:: WELLORD1 semantic presentation

Lemma1: for b1 being Relation holds
( b1 is reflexive iff for b2 being set st b2 in field b1 holds
[b2,b2] in b1 )
proof end;

Lemma2: for b1 being Relation holds
( b1 is transitive iff for b2, b3, b4 being set st [b2,b3] in b1 & [b3,b4] in b1 holds
[b2,b4] in b1 )
proof end;

Lemma3: for b1 being Relation holds
( b1 is antisymmetric iff for b2, b3 being set st [b2,b3] in b1 & [b3,b2] in b1 holds
b2 = b3 )
proof end;

Lemma4: for b1 being Relation holds
( b1 is connected iff for b2, b3 being set st b2 in field b1 & b3 in field b1 & b2 <> b3 & not [b2,b3] in b1 holds
[b3,b2] in b1 )
proof end;

definition
let c1 be Relation;
let c2 be set ;
defpred S1[ set ] means ( a1 <> c2 & [a1,c2] in c1 );
func c1 -Seg c2 -> set means :Def1: :: WELLORD1:def 1
for b1 being set holds
( b1 in a3 iff ( b1 <> a2 & [b1,a2] in a1 ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ( b2 <> c2 & [b2,c2] in c1 ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ( b3 <> c2 & [b3,c2] in c1 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ( b3 <> c2 & [b3,c2] in c1 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines -Seg WELLORD1:def 1 :
for b1 being Relation
for b2, b3 being set holds
( b3 = b1 -Seg b2 iff for b4 being set holds
( b4 in b3 iff ( b4 <> b2 & [b4,b2] in b1 ) ) );

theorem Th1: :: WELLORD1:1
canceled;

theorem Th2: :: WELLORD1:2
for b1 being set
for b2 being Relation holds
( b1 in field b2 or b2 -Seg b1 = {} )
proof end;

definition
let c1 be Relation;
attr a1 is well_founded means :Def2: :: WELLORD1:def 2
for b1 being set st b1 c= field a1 & b1 <> {} holds
ex b2 being set st
( b2 in b1 & a1 -Seg b2 misses b1 );
let c2 be set ;
pred c1 is_well_founded_in c2 means :Def3: :: WELLORD1:def 3
for b1 being set st b1 c= a2 & b1 <> {} holds
ex b2 being set st
( b2 in b1 & a1 -Seg b2 misses b1 );
end;

:: deftheorem Def2 defines well_founded WELLORD1:def 2 :
for b1 being Relation holds
( b1 is well_founded iff for b2 being set st b2 c= field b1 & b2 <> {} holds
ex b3 being set st
( b3 in b2 & b1 -Seg b3 misses b2 ) );

:: deftheorem Def3 defines is_well_founded_in WELLORD1:def 3 :
for b1 being Relation
for b2 being set holds
( b1 is_well_founded_in b2 iff for b3 being set st b3 c= b2 & b3 <> {} holds
ex b4 being set st
( b4 in b3 & b1 -Seg b4 misses b3 ) );

theorem Th3: :: WELLORD1:3
canceled;

theorem Th4: :: WELLORD1:4
canceled;

theorem Th5: :: WELLORD1:5
for b1 being Relation holds
( b1 is well_founded iff b1 is_well_founded_in field b1 )
proof end;

definition
let c1 be Relation;
attr a1 is well-ordering means :Def4: :: WELLORD1:def 4
( a1 is reflexive & a1 is transitive & a1 is antisymmetric & a1 is connected & a1 is well_founded );
let c2 be set ;
pred c1 well_orders c2 means :Def5: :: WELLORD1:def 5
( a1 is_reflexive_in a2 & a1 is_transitive_in a2 & a1 is_antisymmetric_in a2 & a1 is_connected_in a2 & a1 is_well_founded_in a2 );
end;

:: deftheorem Def4 defines well-ordering WELLORD1:def 4 :
for b1 being Relation holds
( b1 is well-ordering iff ( b1 is reflexive & b1 is transitive & b1 is antisymmetric & b1 is connected & b1 is well_founded ) );

:: deftheorem Def5 defines well_orders WELLORD1:def 5 :
for b1 being Relation
for b2 being set holds
( b1 well_orders b2 iff ( b1 is_reflexive_in b2 & b1 is_transitive_in b2 & b1 is_antisymmetric_in b2 & b1 is_connected_in b2 & b1 is_well_founded_in b2 ) );

theorem Th6: :: WELLORD1:6
canceled;

theorem Th7: :: WELLORD1:7
canceled;

theorem Th8: :: WELLORD1:8
for b1 being Relation holds
( b1 well_orders field b1 iff b1 is well-ordering )
proof end;

theorem Th9: :: WELLORD1:9
for b1 being set
for b2 being Relation st b2 well_orders b1 holds
for b3 being set st b3 c= b1 & b3 <> {} holds
ex b4 being set st
( b4 in b3 & ( for b5 being set st b5 in b3 holds
[b4,b5] in b2 ) )
proof end;

theorem Th10: :: WELLORD1:10
for b1 being Relation st b1 is well-ordering holds
for b2 being set st b2 c= field b1 & b2 <> {} holds
ex b3 being set st
( b3 in b2 & ( for b4 being set st b4 in b2 holds
[b3,b4] in b1 ) )
proof end;

theorem Th11: :: WELLORD1:11
for b1 being Relation st b1 is well-ordering & field b1 <> {} holds
ex b2 being set st
( b2 in field b1 & ( for b3 being set st b3 in field b1 holds
[b2,b3] in b1 ) ) by Th10;

theorem Th12: :: WELLORD1:12
for b1 being Relation st b1 is well-ordering & field b1 <> {} holds
for b2 being set holds
( not b2 in field b1 or for b3 being set st b3 in field b1 holds
[b3,b2] in b1 or ex b3 being set st
( b3 in field b1 & [b2,b3] in b1 & ( for b4 being set st b4 in field b1 & [b2,b4] in b1 & not b4 = b2 holds
[b3,b4] in b1 ) ) )
proof end;

theorem Th13: :: WELLORD1:13
for b1 being set
for b2 being Relation holds b2 -Seg b1 c= field b2
proof end;

definition
let c1 be Relation;
let c2 be set ;
func c1 |_2 c2 -> Relation equals :: WELLORD1:def 6
a1 /\ [:a2,a2:];
coherence
c1 /\ [:c2,c2:] is Relation
by RELAT_1:9;
end;

:: deftheorem Def6 defines |_2 WELLORD1:def 6 :
for b1 being Relation
for b2 being set holds b1 |_2 b2 = b1 /\ [:b2,b2:];

theorem Th14: :: WELLORD1:14
canceled;

theorem Th15: :: WELLORD1:15
for b1 being set
for b2 being Relation holds
( b2 |_2 b1 c= b2 & b2 |_2 b1 c= [:b1,b1:] ) by XBOOLE_1:17;

theorem Th16: :: WELLORD1:16
for b1, b2 being set
for b3 being Relation holds
( b1 in b3 |_2 b2 iff ( b1 in b3 & b1 in [:b2,b2:] ) ) by XBOOLE_0:def 3;

theorem Th17: :: WELLORD1:17
for b1 being set
for b2 being Relation holds b2 |_2 b1 = (b1 | b2) | b1
proof end;

theorem Th18: :: WELLORD1:18
for b1 being set
for b2 being Relation holds b2 |_2 b1 = b1 | (b2 | b1)
proof end;

Lemma17: for b1 being set
for b2 being Relation holds dom (b1 | b2) c= dom b2
proof end;

theorem Th19: :: WELLORD1:19
for b1, b2 being set
for b3 being Relation st b1 in field (b3 |_2 b2) holds
( b1 in field b3 & b1 in b2 )
proof end;

theorem Th20: :: WELLORD1:20
for b1 being set
for b2 being Relation holds
( field (b2 |_2 b1) c= field b2 & field (b2 |_2 b1) c= b1 )
proof end;

theorem Th21: :: WELLORD1:21
for b1, b2 being set
for b3 being Relation holds (b3 |_2 b1) -Seg b2 c= b3 -Seg b2
proof end;

theorem Th22: :: WELLORD1:22
for b1 being set
for b2 being Relation st b2 is reflexive holds
b2 |_2 b1 is reflexive
proof end;

theorem Th23: :: WELLORD1:23
for b1 being set
for b2 being Relation st b2 is connected holds
b2 |_2 b1 is connected
proof end;

theorem Th24: :: WELLORD1:24
for b1 being set
for b2 being Relation st b2 is transitive holds
b2 |_2 b1 is transitive
proof end;

theorem Th25: :: WELLORD1:25
for b1 being set
for b2 being Relation st b2 is antisymmetric holds
b2 |_2 b1 is antisymmetric
proof end;

theorem Th26: :: WELLORD1:26
for b1, b2 being set
for b3 being Relation holds (b3 |_2 b1) |_2 b2 = b3 |_2 (b1 /\ b2)
proof end;

theorem Th27: :: WELLORD1:27
for b1, b2 being set
for b3 being Relation holds (b3 |_2 b1) |_2 b2 = (b3 |_2 b2) |_2 b1
proof end;

theorem Th28: :: WELLORD1:28
for b1 being set
for b2 being Relation holds (b2 |_2 b1) |_2 b1 = b2 |_2 b1
proof end;

theorem Th29: :: WELLORD1:29
for b1, b2 being set
for b3 being Relation st b1 c= b2 holds
(b3 |_2 b2) |_2 b1 = b3 |_2 b1
proof end;

theorem Th30: :: WELLORD1:30
for b1 being Relation holds b1 |_2 (field b1) = b1
proof end;

theorem Th31: :: WELLORD1:31
for b1 being set
for b2 being Relation st b2 is well_founded holds
b2 |_2 b1 is well_founded
proof end;

theorem Th32: :: WELLORD1:32
for b1 being set
for b2 being Relation st b2 is well-ordering holds
b2 |_2 b1 is well-ordering
proof end;

theorem Th33: :: WELLORD1:33
for b1, b2 being set
for b3 being Relation st b3 is well-ordering holds
b3 -Seg b1,b3 -Seg b2 are_c=-comparable
proof end;

theorem Th34: :: WELLORD1:34
canceled;

theorem Th35: :: WELLORD1:35
for b1, b2 being set
for b3 being Relation st b3 is well-ordering & b1 in field b3 & b2 in b3 -Seg b1 holds
(b3 |_2 (b3 -Seg b1)) -Seg b2 = b3 -Seg b2
proof end;

theorem Th36: :: WELLORD1:36
for b1 being set
for b2 being Relation st b2 is well-ordering & b1 c= field b2 holds
( ( b1 = field b2 or ex b3 being set st
( b3 in field b2 & b1 = b2 -Seg b3 ) ) iff for b3 being set st b3 in b1 holds
for b4 being set st [b4,b3] in b2 holds
b4 in b1 )
proof end;

theorem Th37: :: WELLORD1:37
for b1, b2 being set
for b3 being Relation st b3 is well-ordering & b1 in field b3 & b2 in field b3 holds
( [b1,b2] in b3 iff b3 -Seg b1 c= b3 -Seg b2 )
proof end;

theorem Th38: :: WELLORD1:38
for b1, b2 being set
for b3 being Relation st b3 is well-ordering & b1 in field b3 & b2 in field b3 holds
( b3 -Seg b1 c= b3 -Seg b2 iff ( b1 = b2 or b1 in b3 -Seg b2 ) )
proof end;

theorem Th39: :: WELLORD1:39
for b1 being set
for b2 being Relation st b2 is well-ordering & b1 c= field b2 holds
field (b2 |_2 b1) = b1
proof end;

theorem Th40: :: WELLORD1:40
for b1 being set
for b2 being Relation st b2 is well-ordering holds
field (b2 |_2 (b2 -Seg b1)) = b2 -Seg b1
proof end;

theorem Th41: :: WELLORD1:41
for b1 being Relation st b1 is well-ordering holds
for b2 being set st ( for b3 being set st b3 in field b1 & b1 -Seg b3 c= b2 holds
b3 in b2 ) holds
field b1 c= b2
proof end;

theorem Th42: :: WELLORD1:42
for b1, b2 being set
for b3 being Relation st b3 is well-ordering & b1 in field b3 & b2 in field b3 & ( for b4 being set st b4 in b3 -Seg b1 holds
( [b4,b2] in b3 & b4 <> b2 ) ) holds
[b1,b2] in b3
proof end;

theorem Th43: :: WELLORD1:43
for b1 being Relation
for b2 being Function st b1 is well-ordering & dom b2 = field b1 & rng b2 c= field b1 & ( for b3, b4 being set st [b3,b4] in b1 & b3 <> b4 holds
( [(b2 . b3),(b2 . b4)] in b1 & b2 . b3 <> b2 . b4 ) ) holds
for b3 being set st b3 in field b1 holds
[b3,(b2 . b3)] in b1
proof end;

definition
let c1, c2 be Relation;
let c3 be Function;
pred c3 is_isomorphism_of c1,c2 means :Def7: :: WELLORD1:def 7
( dom a3 = field a1 & rng a3 = field a2 & a3 is one-to-one & ( for b1, b2 being set holds
( [b1,b2] in a1 iff ( b1 in field a1 & b2 in field a1 & [(a3 . b1),(a3 . b2)] in a2 ) ) ) );
end;

:: deftheorem Def7 defines is_isomorphism_of WELLORD1:def 7 :
for b1, b2 being Relation
for b3 being Function holds
( b3 is_isomorphism_of b1,b2 iff ( dom b3 = field b1 & rng b3 = field b2 & b3 is one-to-one & ( for b4, b5 being set holds
( [b4,b5] in b1 iff ( b4 in field b1 & b5 in field b1 & [(b3 . b4),(b3 . b5)] in b2 ) ) ) ) );

theorem Th44: :: WELLORD1:44
canceled;

theorem Th45: :: WELLORD1:45
for b1, b2 being Relation
for b3 being Function st b3 is_isomorphism_of b1,b2 holds
for b4, b5 being set st [b4,b5] in b1 & b4 <> b5 holds
( [(b3 . b4),(b3 . b5)] in b2 & b3 . b4 <> b3 . b5 )
proof end;

definition
let c1, c2 be Relation;
pred c1,c2 are_isomorphic means :Def8: :: WELLORD1:def 8
ex b1 being Function st b1 is_isomorphism_of a1,a2;
end;

:: deftheorem Def8 defines are_isomorphic WELLORD1:def 8 :
for b1, b2 being Relation holds
( b1,b2 are_isomorphic iff ex b3 being Function st b3 is_isomorphism_of b1,b2 );

theorem Th46: :: WELLORD1:46
canceled;

theorem Th47: :: WELLORD1:47
for b1 being Relation holds id (field b1) is_isomorphism_of b1,b1
proof end;

theorem Th48: :: WELLORD1:48
for b1 being Relation holds b1,b1 are_isomorphic
proof end;

theorem Th49: :: WELLORD1:49
for b1, b2 being Relation
for b3 being Function st b3 is_isomorphism_of b1,b2 holds
b3 " is_isomorphism_of b2,b1
proof end;

theorem Th50: :: WELLORD1:50
for b1, b2 being Relation st b1,b2 are_isomorphic holds
b2,b1 are_isomorphic
proof end;

theorem Th51: :: WELLORD1:51
for b1, b2, b3 being Relation
for b4, b5 being Function st b4 is_isomorphism_of b1,b2 & b5 is_isomorphism_of b2,b3 holds
b5 * b4 is_isomorphism_of b1,b3
proof end;

theorem Th52: :: WELLORD1:52
for b1, b2, b3 being Relation st b1,b2 are_isomorphic & b2,b3 are_isomorphic holds
b1,b3 are_isomorphic
proof end;

theorem Th53: :: WELLORD1:53
for b1, b2 being Relation
for b3 being Function st b3 is_isomorphism_of b1,b2 holds
( ( b1 is reflexive implies b2 is reflexive ) & ( b1 is transitive implies b2 is transitive ) & ( b1 is connected implies b2 is connected ) & ( b1 is antisymmetric implies b2 is antisymmetric ) & ( b1 is well_founded implies b2 is well_founded ) )
proof end;

theorem Th54: :: WELLORD1:54
for b1, b2 being Relation
for b3 being Function st b1 is well-ordering & b3 is_isomorphism_of b1,b2 holds
b2 is well-ordering
proof end;

theorem Th55: :: WELLORD1:55
for b1, b2 being Relation st b1 is well-ordering holds
for b3, b4 being Function st b3 is_isomorphism_of b1,b2 & b4 is_isomorphism_of b1,b2 holds
b3 = b4
proof end;

definition
let c1, c2 be Relation;
assume E51: ( c1 is well-ordering & c1,c2 are_isomorphic ) ;
func canonical_isomorphism_of c1,c2 -> Function means :Def9: :: WELLORD1:def 9
a3 is_isomorphism_of a1,a2;
existence
ex b1 being Function st b1 is_isomorphism_of c1,c2
by E51, Def8;
uniqueness
for b1, b2 being Function st b1 is_isomorphism_of c1,c2 & b2 is_isomorphism_of c1,c2 holds
b1 = b2
by E51, Th55;
end;

:: deftheorem Def9 defines canonical_isomorphism_of WELLORD1:def 9 :
for b1, b2 being Relation st b1 is well-ordering & b1,b2 are_isomorphic holds
for b3 being Function holds
( b3 = canonical_isomorphism_of b1,b2 iff b3 is_isomorphism_of b1,b2 );

theorem Th56: :: WELLORD1:56
canceled;

theorem Th57: :: WELLORD1:57
for b1 being Relation st b1 is well-ordering holds
for b2 being set st b2 in field b1 holds
not b1,b1 |_2 (b1 -Seg b2) are_isomorphic
proof end;

theorem Th58: :: WELLORD1:58
for b1, b2 being set
for b3 being Relation st b3 is well-ordering & b1 in field b3 & b2 in field b3 & b1 <> b2 holds
not b3 |_2 (b3 -Seg b1),b3 |_2 (b3 -Seg b2) are_isomorphic
proof end;

theorem Th59: :: WELLORD1:59
for b1 being set
for b2, b3 being Relation
for b4 being Function st b2 is well-ordering & b1 c= field b2 & b4 is_isomorphism_of b2,b3 holds
( b4 | b1 is_isomorphism_of b2 |_2 b1,b3 |_2 (b4 .: b1) & b2 |_2 b1,b3 |_2 (b4 .: b1) are_isomorphic )
proof end;

theorem Th60: :: WELLORD1:60
for b1, b2 being Relation
for b3 being Function st b1 is well-ordering & b3 is_isomorphism_of b1,b2 holds
for b4 being set st b4 in field b1 holds
ex b5 being set st
( b5 in field b2 & b3 .: (b1 -Seg b4) = b2 -Seg b5 )
proof end;

theorem Th61: :: WELLORD1:61
for b1, b2 being Relation
for b3 being Function st b1 is well-ordering & b3 is_isomorphism_of b1,b2 holds
for b4 being set st b4 in field b1 holds
ex b5 being set st
( b5 in field b2 & b1 |_2 (b1 -Seg b4),b2 |_2 (b2 -Seg b5) are_isomorphic )
proof end;

theorem Th62: :: WELLORD1:62
for b1, b2, b3 being set
for b4, b5 being Relation st b4 is well-ordering & b5 is well-ordering & b1 in field b4 & b2 in field b5 & b3 in field b5 & b4,b5 |_2 (b5 -Seg b2) are_isomorphic & b4 |_2 (b4 -Seg b1),b5 |_2 (b5 -Seg b3) are_isomorphic holds
( b5 -Seg b3 c= b5 -Seg b2 & [b3,b2] in b5 )
proof end;

theorem Th63: :: WELLORD1:63
for b1, b2 being Relation st b1 is well-ordering & b2 is well-ordering & not b1,b2 are_isomorphic & ( for b3 being set holds
( not b3 in field b1 or not b1 |_2 (b1 -Seg b3),b2 are_isomorphic ) ) holds
ex b3 being set st
( b3 in field b2 & b1,b2 |_2 (b2 -Seg b3) are_isomorphic )
proof end;

theorem Th64: :: WELLORD1:64
for b1 being set
for b2 being Relation st b1 c= field b2 & b2 is well-ordering & not b2,b2 |_2 b1 are_isomorphic holds
ex b3 being set st
( b3 in field b2 & b2 |_2 (b2 -Seg b3),b2 |_2 b1 are_isomorphic )
proof end;