:: Tarski {G}rothendieck Set Theory
:: by Andrzej Trybulec
::
:: Copyright (c) 1990-2012 Association of Mizar Users

begin

theorem :: TARSKI:1
for X, Y being set st ( for x being set holds
( x in X iff x in Y ) ) holds
X = Y ;

definition
let y be set ;
func {y} -> set means :: TARSKI:def 1
for x being set holds
( x in it iff x = y );
correctness
existence
ex b1 being set st
for x being set holds
( x in b1 iff x = y )
;
uniqueness
for b1, b2 being set st ( for x being set holds
( x in b1 iff x = y ) ) & ( for x being set holds
( x in b2 iff x = y ) ) holds
b1 = b2
;
;
let z be set ;
func {y,z} -> set means :: TARSKI:def 2
for x being set holds
( x in it iff ( x = y or x = z ) );
correctness
existence
ex b1 being set st
for x being set holds
( x in b1 iff ( x = y or x = z ) )
;
uniqueness
for b1, b2 being set st ( for x being set holds
( x in b1 iff ( x = y or x = z ) ) ) & ( for x being set holds
( x in b2 iff ( x = y or x = z ) ) ) holds
b1 = b2
;
;
commutativity
for b1, y, z being set st ( for x being set holds
( x in b1 iff ( x = y or x = z ) ) ) holds
for x being set holds
( x in b1 iff ( x = z or x = y ) )
;
end;

:: deftheorem defines { TARSKI:def 1 :
for y, b2 being set holds
( b2 = {y} iff for x being set holds
( x in b2 iff x = y ) );

:: deftheorem defines { TARSKI:def 2 :
for y, z, b3 being set holds
( b3 = {y,z} iff for x being set holds
( x in b3 iff ( x = y or x = z ) ) );

definition
let X, Y be set ;
pred X c= Y means :: TARSKI:def 3
for x being set st x in X holds
x in Y;
reflexivity
for X, x being set st x in X holds
x in X
;
end;

:: deftheorem defines c= TARSKI:def 3 :
for X, Y being set holds
( X c= Y iff for x being set st x in X holds
x in Y );

definition
let X be set ;
func union X -> set means :: TARSKI:def 4
for x being set holds
( x in it iff ex Y being set st
( x in Y & Y in X ) );
correctness
existence
ex b1 being set st
for x being set holds
( x in b1 iff ex Y being set st
( x in Y & Y in X ) )
;
uniqueness
for b1, b2 being set st ( for x being set holds
( x in b1 iff ex Y being set st
( x in Y & Y in X ) ) ) & ( for x being set holds
( x in b2 iff ex Y being set st
( x in Y & Y in X ) ) ) holds
b1 = b2
;
;
end;

:: deftheorem defines union TARSKI:def 4 :
for X, b2 being set holds
( b2 = union X iff for x being set holds
( x in b2 iff ex Y being set st
( x in Y & Y in X ) ) );

theorem :: TARSKI:2
for x, X being set st x in X holds
ex Y being set st
( Y in X & ( for x being set holds
( not x in X or not x in Y ) ) ) ;

scheme :: TARSKI:sch 1
Fraenkel{ F1() -> set , P1[ set , set ] } :
ex X being set st
for x being set holds
( x in X iff ex y being set st
( y in F1() & P1[y,x] ) )
provided
for x, y, z being set st P1[x,y] & P1[x,z] holds
y = z
proof end;

definition
let x, y be set ;
func [x,y] -> set equals :: TARSKI:def 5
{{x,y},{x}};
correctness
coherence
{{x,y},{x}} is set
;
;
end;

:: deftheorem defines [ TARSKI:def 5 :
for x, y being set holds [x,y] = {{x,y},{x}};

definition
let X, Y be set ;
pred X,Y are_equipotent means :: TARSKI:def 6
ex Z being set st
( ( for x being set st x in X holds
ex y being set st
( y in Y & [x,y] in Z ) ) & ( for y being set st y in Y holds
ex x being set st
( x in X & [x,y] in Z ) ) & ( for x, y, z, u being set st [x,y] in Z & [z,u] in Z holds
( x = z iff y = u ) ) );
end;

:: deftheorem defines are_equipotent TARSKI:def 6 :
for X, Y being set holds
( X,Y are_equipotent iff ex Z being set st
( ( for x being set st x in X holds
ex y being set st
( y in Y & [x,y] in Z ) ) & ( for y being set st y in Y holds
ex x being set st
( x in X & [x,y] in Z ) ) & ( for x, y, z, u being set st [x,y] in Z & [z,u] in Z holds
( x = z iff y = u ) ) ) );

:: Alfred Tarski
:: Ueber unerreichbare Kardinalzahlen,
:: Fundamenta Mathematicae, vol. 30 (1938), pp. 68--69
:: Axiom A. (Axiom der unerreichbaren Mengen). Zu jeder Menge N gibt es
:: eine Menge M mit folgenden Eigenschaften:
:: A1. N in M;
:: A2. ist X in M und Y c= X, so ist Y in M;
:: A3. ist X in M und ist Z die Menge, die alle Mengen Y c= X und keine
:: andere Dinge als Element enthaelt, so,ist z in M;
:: A4. ist X c= M und sind dabei die Menge X und M nicht gleichmaechtig,
:: so ist X in M.
:: Alfred Tarski
:: On Well-ordered Subsets of any Set,
:: Fundamenta Mathematicae, vol. 32 (1939), pp. 176--183
:: A. For every set N there exists a system M of sets which satisfies
:: the following conditions:
:: (i) N in M
:: (ii) if X in M and Y c= X, then Y in M
:: (iii) if X in M and Z is the system of all subsets of X, then Z in M
:: (iv) if X c= M and X and M do not have the same potency, then X in M.
theorem :: TARSKI:3
for N being set ex M being set st
( N in M & ( for X, Y being set st X in M & Y c= X holds
Y in M ) & ( for X being set st X in M holds
ex Z being set st
( Z in M & ( for Y being set st Y c= X holds
Y in Z ) ) ) & ( for X being set holds
( not X c= M or X,M are_equipotent or X in M ) ) ) ;