Russell's Paradox [closed] - math

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Let X be the set of all sets that do not contain themselves. Is X a member of X?

In ZFC, either the axiom of foundation [as mentioned] or the axiom (scheme) of comprehension will prohibit this. The first, for obvious reasons; the second, since it basically says that for given z and first-order property P, you can construct { x ∈ z : P(x) }, but to generate the Russell set, you would need z = V (the class of all sets), which is not a set (i.e. cannot be generated from any of the given axioms).
In New Foundations (NF), "x ∉ x" is not a stratified formula, and so again we cannot define the Russell set. Somewhat amusingly, however, V is a set in NF.
In von Neumann--Bernays--Gödel set theory (NBG), the class R = { x : x is a set and x ∉ x } is definable. We then ask whether R ∈ R; if so, then also R ∉ R, giving a contradiction. Thus we must have R ∉ R. But there is no contradiction here, since for any given class A, A ∉ R implies either A ∈ A or A is a proper class. Since R ∉ R, we must simply have that R is a proper class.
Of course, the class R = { x : x ∉ x }, without the restriction, is simply not definable in NBG.
Also of note is that the above procedure is formally constructable as a proof in NBG, whereas in ZFC one has to resort to meta-reasoning.

The question is ill-posed in the standard ZFC (Zermelo-Fraenkel + axiom of Choice) set theory because the object thus defined is not a set.
Since (again, assuming standard ZFC) your class {x : x\not\in x} is not a set, the answer becomes no, it's not an element of itself (even as a class) since only sets can be elements of classes or sets.
By the way, as soon as you agree to the axiom of foundation, no set can be an element of itself.
Of course the nice thing about math is you can choose whichever axioms you want :) but believing in paradoxes is just weird.

The most elegant proof I've ever seen resembles Russell's paradox closely.
Theorem (Cantor, I suppose).
Let X be a set, and 2^X the set of its subsets. Then card(X) < card(2^X).
Proof. Surely card(X) <= card(2^X), since there is a trivial bijection between X and the singletons in 2^X. We must prove that card(X) != card(2^X).
Suppose there is a bijection between X and 2^X. Then each xk in X is mapped to a set Ak in 2^X.
x1 ---> A1
x2 ---> A2
...
xk ---> Ak
...
For each xk the chances are: either xk belongs to Ak, or it does not. Let M be the set of all those xk that do not belong to their corresponding set Ak. M is a subset of X, thus there must exist an element m of X which is mapped to M by the bijection.
Does m belong to M? If it does, then it does not, for M is the set of those x that do not belong to the set they're mapped to. If it does not, then it does, for M contains all such x's. This contradiction stems from the assumption that a bijection exists. Thus a bijection cannot exist, the two cardinalities are different, and the theorem is proved.

Related

Mathematical logic in Julia

Does Jump support direct use of mathematical logics in a model?
I know it supports conditional indicator, but how about these conditionals?
For example:
1- A bi-conditional indicator is a binary variable that is associated with satisfaction and
non-satisfaction statuses of a constraint concerning the current solution.
δi = 1 ⟺ sum(j, a_ij. x_j) <= b_i
2- Either-or Constraints ensuring that at least one of the two constraints is met.
3- If-Then-Else Constraints describing a situation where we want to ensure that if the constraint C1
holds, then the constraint C2 must be held; otherwise the constraint C3 must be held
Does Julia support direct use of mathematical logics in a model?
I assume you mean JuMP here. (JuMP is a package for mathematical optimization written in Julia.)
JuMP does not have direct syntax for these three constraints.
However, they can all be formulated with some tricks.
The Mosek Modeling Cookbook is a good collection of tricks:
https://docs.mosek.com/modeling-cookbook/mio.html.
There are a variety of textbooks and lecture notes on modeling integer programs
https://download.aimms.com/aimms/download/manuals/AIMMS3OM_IntegerProgrammingTricks.pdf
Online courses: https://www.coursera.org/learn/discrete-optimization
The JuMP documentation also has some tips.
Point (2) is https://jump.dev/JuMP.jl/stable/tutorials/Mixed-integer%20linear%20programs/tips_and_tricks/#Big-M-Disjunctive-Constraints-(OR)
(1) The constraint
δ(i)=1 ⇔ sum(j, a(i,j)) ≤ b(i)
can be stated as two indicator constraints:
δ(i)=1 ⇒ sum(j, a(i,j)) ≤ b(i)
δ(i)=0 ⇒ sum(j, a(i,j)) ≥ b(i) + 0.0001
δ(i) ∈ {0,1}
I typically drop the 0.001 and let the problem be slightly ambiguous at equality. This way the solver can pick the best. If the sum is long, use an intermediate variable to prevent duplicating the sum.
(2) Either-or-constraints. Same idea:
δ=1 ⇒ linear constraint 1
δ=0 ⇒ linear constraint 2
δ ∈ {0,1}
One of the constraints 1 or 2 will be enforced
(3) If-Then-Else Constraints. I.e.
If constraint 1 then constraint 2 else constraint 3
Again similar to what we have above:
δ=1 ⇒ linear constraint 1
δ=1 ⇒ linear constraint 2
δ=0 ⇒ not linear constraint 1
δ=0 ⇒ linear constraint 3
A more complicated case can look like:
δ=1 ⇒ y=b
δ=0 ⇒ y≠b
The second implication needs to be split into two using an additional binary variable. I'll leave that as an exersize.

Understanding derivatives in Isabelle (meaning of `at .. within`)

This is a question about the notion of derivatives from the Isabelle libraries.
I am trying to understand what (f has_field_derivative D x) (at x within S) means. I know (at x within S) is a filter, but intuitively I was imagining that the following statement is true
lemma DERIV_at_within:
"(∀x ∈ S. (f has_field_derivative D x) (at x))
= (∀x. (f has_field_derivative D x) (at x within S))"
If it is not, how else should I interpret (at x within S) in the context of derivatives?
at x within A is the pointed neighbourhood of x, intersected with A. For instance, at_right is an abbreviation for at x within {x<..}, i.e. the right-neighbourhood of x. This allows you to express one-sided derivatives.
Occasionally, one also sees assumptions like ∀x∈{a..b}. (f has_field_derivative f' x) (at x within {a..b}). This means that f is differentiable with derivative f' between a and b, but the derivatives at the edges (i.e. at a and b) need only be one-sided.
Note also that at x = at x within UNIV. Also, if A is an open set containint x, you simply have at x within A = at x.
Typically, you only really need has_field_derivative with at x within … if you want something like a one-sided limit (or, in higher dimensions, if you somehow want to constrain the direction of approach).

Query regarding vector transpose in hypothesis function (Stanford Machine Learning Video Lecture 2)

I was looking at lecture 2 of the stanford machine learning lecture series taught by professor Andrew NG and had a question about something that I think might be quite rudimentary but is just not clicking in my head. So let us consider two vectors θ and x where both vectors contain real numbers.
Let h(x) be a function (in this specific case called the hypothesis) but let it be some function denoted by :
h(x) = "summation from i = 0 to i = n" of θ(i)*x(i) = θ(transpose)*x
I dont understand the last part where he says h(x) is also equal to θ(transpose)*x.
If someone could clarify this concept for my I would be very grateful.
It's just basic linear algebra, it follows from the definition of matrix vector multiplication:
So if θ and x are both n+1 x 1 matrices, then

Get branch points of equation

If I have a general function,f(z,a), z and a are both real, and the function f takes on real values for all z except in some interval (z1,z2), where it becomes complex. How do I determine z1 and z2 (which will be in terms of a) using Mathematica (or is this possible)? What are the limitations?
For a test example, consider the function f[z_,a_]=Sqrt[(z-a)(z-2a)]. For real z and a, this takes on real values except in the interval (a,2a), where it becomes imaginary. How do I find this interval in Mathematica?
In general, I'd like to know how one would go about finding it mathematically for a general case. For a function with just two variables like this, it'd probably be straightforward to do a contour plot of the Riemann surface and observe the branch cuts. But what if it is a multivariate function? Is there a general approach that one can take?
What you have appears to be a Riemann surface parametrized by 'a'. Consider the algebraic (or analytic) relation g(a,z)=0 that would be spawned from this branch of a parametrized Riemann surface. In this case it is simply g^2 - (z - a)*(z - 2*a) == 0. More generally it might be obtained using Groebnerbasis, as below (no guarantee this will always work without some amount of user intervention).
grelation = First[GroebnerBasis[g - Sqrt[(z - a)*(z - 2*a)], {x, a, g}]]
Out[472]= 2 a^2 - g^2 - 3 a z + z^2
A necessary condition for the branch points, as functions of the parameter 'a', is that the zero set for 'g' not give a (single valued) function in a neighborhood of such points. This in turn means that the partial derivative of this relation with respect to g vanishes (this is from the implicit function theorem of multivariable calculus). So we find where grelation and its derivative both vanish, and solve for 'z' as a function of 'a'.
Solve[Eliminate[{grelation == 0, D[grelation, g] == 0}, g], z]
Out[481]= {{z -> a}, {z -> 2 a}}
Daniel Lichtblau
Wolfram Research
For polynomial systems (and some class of others), Reduce can do the job.
E.g.
In[1]:= Reduce[Element[{a, z}, Reals]
&& !Element[Sqrt[(z - a) (z - 2 a)], Reals], z]
Out[1]= (a < 0 && 2a < z < a) || (a > 0 && a < z < 2a)
This type of approach also works (often giving very complicated solutions for functions with many branch cuts) for other combinations of elementary functions I checked.
To find the branch cuts (as opposed to the simple class of branch points you're interested in) in general, I don't know of a good approach. The best place to find the detailed conventions that Mathematica uses is at the functions.wolfram site.
I do remember reading a good paper on this a while back... I'll try to find it....
That's right! The easiest approach I've seen for branch cut analysis uses the unwinding number. There's a paper "Reasoning about the elementary functions of complex analysis" about this the the journal "Artificial Intelligence and Symbolic Computation". It and similar papers can be found at one of the authors homepage: http://www.apmaths.uwo.ca/~djeffrey/offprints.html.
For general functions you cannot make Mathematica calculate it.
Even for polynomials, finding an exact answer takes time.
I believe Mathematica uses some sort of quantifier elimination when it uses Reduce,
which takes time.
Without any restrictions on your functions (are they polynomials, continuous, smooth?)
one can easily construct functions which Mathematica cannot simplify further:
f[x_,y_] := Abs[Zeta[y+0.5+x*I]]*I
If this function is real for arbitrary x and any -0.5 < y < 0 or 0<y<0.5,
then you will have found a counterexample to the Riemann zeta conjecture,
and I'm sure Mathematica cannot give a correct answer.

How to find which subset of bitfields xor to another bitfield?

I have a somewhat math-oriented problem. I have a bunch of bitfields and would like to calculate what subset of them to xor together to achieve a certain other bitfield, or if there isn't a way to do it discover that no such subset exists.
I'd like to do this using a free library, rather than original code, and I'd strongly prefer something with Python bindings (using Python's built-in math libraries would be acceptable as well, but I want to port this to multiple languages eventually). Also it would be good to not take the memory hit of having to expand each bit to its own byte.
Some further clarification: I only need a single solution. My matrices are the opposite of sparse. I'm very interested in keeping the runtime to an absolute minimum, so using algorithmically fancy methods for inverting matrices is strongly preferred. Also, it's very important that the specific given bitfield be the one outputted, so a technique which just finds a subset which xor to 0 doesn't quite cut it.
And I'm generally aware of gaussian elimination. I'm trying to avoid doing this from scratch!
cross-posted to mathoverflow, because it isn't clear what the right place for this question is - https://mathoverflow.net/questions/41036/how-to-find-which-subset-of-bitfields-xor-to-another-bitfield
Mathematically speaking, XOR of two bits can be treated as addition in F_2 field.
You want to solve a set of equations in a F_2 field. For four bitfiels with bits (a_0, a_1, ... a_n), (b_0, b_1, ..., b_n), (c_0, c_1, ..., c_n), (r_0, r_1, ..., r_n), you get equations:
x * a_0 + y * b_0 + z * c_0 = r_0
x * a_1 + y * b_1 + z * c_1 = r_1
...
x * a_n + y * b_n + z * c_n = r_n
(where you look for x, y, z).
You could program this as a simple integer linear problem with glpk, probably lp_solve (but I don't remember if it will fit). These might work very slowly though, as they are trying to solve much more general problem.
After googling for a while, it seems that this page might be a good start looking for code. From descriptions it seems that Dixon and LinBox could be a good fit.
Anyway, I think asking at mathoverflow might give you more precise answers. If you do, please link your question here.
Update: Sagemath uses M4RI for solving this problem. This makes it (for me) a very good recommendation.
For small instances that easily fit in memory, this is just solving a linear system over F_2, so try mod-2 Gaussian elimination. For very large sparse instances, like those that occur in factoring (sieve) algorithms, look up the Wiedemann algorithm.
It's possible to have multiple subsets xor to the same value; do you care about finding all subsets?
A perhaps heavy-handed approach would be to filter the powerset of bitfields. In Haskell:
import Data.Bits
xorsTo :: Int -> [Int] -> [[Int]]
xorsTo target fields = filter xorsToTarget (powerset fields)
where xorsToTarget f = (foldl xor 0 f) == target
powerset [] = [[]]
powerset (x:xs) = powerset xs ++ map (x:) (powerset xs)
Not sure if there is a way to do this without generating the powerset. (In the worst case, it is possible for the solution to actually be the entire powerset).
expanding on liori's answer above we have a linear system of equations (in modulo 2):
a0, b0, c0 ...| r0
a1, b1, c1 ...| r1
... |
an, bn, cn ...| rn
Gaussian elimination can be used to solve the system. In modulo 2, the add row operation becomes an XOR operation. It is much simpler computationally to do this than to use a generic linear systems solver.
So, if a0 is zero we swap up a row that has a 1 in the a position. Then perform an XOR (using row 0) on any other row whos "a" bit is a 1. Then repeat using row 1 and column b, then row 2 col c, etc.
If you get a row of zeroes with a non-zero in the r column then the subset DNE.

Resources