:: JORDAN9 semantic presentation

Lemma1: for b1 being Nat st 1 <= b1 holds
(b1 -' 1) + 2 = b1 + 1
proof end;

theorem Th1: :: JORDAN9:1
canceled;

theorem Th2: :: JORDAN9:2
canceled;

theorem Th3: :: JORDAN9:3
for b1 being non empty TopSpace
for b2, b3, b4, b5 being Subset of b1 st b2 is connected & b3 is_a_component_of b5 & b4 is_a_component_of b5 & b2 meets b3 & b2 meets b4 & b2 c= b5 holds
b3 = b4
proof end;

theorem Th4: :: JORDAN9:4
for b1 being non empty set
for b2, b3 being FinSequence of b1 st ( for b4 being Nat holds b2 | b4 = b3 | b4 ) holds
b2 = b3
proof end;

theorem Th5: :: JORDAN9:5
for b1 being Nat
for b2 being non empty set
for b3 being FinSequence of b2 st b1 in dom b3 holds
ex b4 being Nat st
( b4 in dom (Rev b3) & b1 + b4 = (len b3) + 1 & b3 /. b1 = (Rev b3) /. b4 )
proof end;

theorem Th6: :: JORDAN9:6
for b1 being Nat
for b2 being non empty set
for b3 being FinSequence of b2 st b1 in dom (Rev b3) holds
ex b4 being Nat st
( b4 in dom b3 & b1 + b4 = (len b3) + 1 & (Rev b3) /. b1 = b3 /. b4 )
proof end;

theorem Th7: :: JORDAN9:7
for b1 being non empty set
for b2 being Matrix of b1
for b3 being FinSequence of b1 holds
( b3 is_sequence_on b2 iff Rev b3 is_sequence_on b2 )
proof end;

theorem Th8: :: JORDAN9:8
for b1 being Nat
for b2 being Matrix of (TOP-REAL 2)
for b3 being FinSequence of (TOP-REAL 2) st b3 is_sequence_on b2 & 1 <= b1 & b1 <= len b3 holds
b3 /. b1 in Values b2
proof end;

Lemma8: for b1 being Nat
for b2 being Go-board
for b3 being FinSequence of (TOP-REAL 2) st b3 is_sequence_on b2 & 1 <= b1 & b1 <= len b3 holds
ex b4, b5 being Nat st
( [b4,b5] in Indices b2 & b3 /. b1 = b2 * b4,b5 )
proof end;

theorem Th9: :: JORDAN9:9
for b1 being Nat
for b2 being FinSequence of (TOP-REAL 2)
for b3 being set st b1 <= len b2 & b3 in L~ (b2 /^ b1) holds
ex b4 being Nat st
( b1 + 1 <= b4 & b4 + 1 <= len b2 & b3 in LSeg b2,b4 )
proof end;

theorem Th10: :: JORDAN9:10
for b1 being Nat
for b2 being Go-board
for b3 being FinSequence of (TOP-REAL 2) st b3 is_sequence_on b2 & 1 <= b1 & b1 + 1 <= len b3 holds
( b3 /. b1 in left_cell b3,b1,b2 & b3 /. b1 in right_cell b3,b1,b2 )
proof end;

theorem Th11: :: JORDAN9:11
for b1 being Nat
for b2 being Go-board
for b3 being FinSequence of (TOP-REAL 2) st b3 is_sequence_on b2 & 1 <= b1 & b1 + 1 <= len b3 holds
( Int (left_cell b3,b1,b2) <> {} & Int (right_cell b3,b1,b2) <> {} )
proof end;

theorem Th12: :: JORDAN9:12
for b1 being Nat
for b2 being Go-board
for b3 being FinSequence of (TOP-REAL 2) st b3 is_sequence_on b2 & 1 <= b1 & b1 + 1 <= len b3 holds
( Int (left_cell b3,b1,b2) is connected & Int (right_cell b3,b1,b2) is connected )
proof end;

theorem Th13: :: JORDAN9:13
for b1 being Nat
for b2 being Go-board
for b3 being FinSequence of (TOP-REAL 2) st b3 is_sequence_on b2 & 1 <= b1 & b1 + 1 <= len b3 holds
( Cl (Int (left_cell b3,b1,b2)) = left_cell b3,b1,b2 & Cl (Int (right_cell b3,b1,b2)) = right_cell b3,b1,b2 )
proof end;

theorem Th14: :: JORDAN9:14
for b1 being Nat
for b2 being Go-board
for b3 being FinSequence of (TOP-REAL 2) st b3 is_sequence_on b2 & LSeg b3,b1 is horizontal holds
ex b4 being Nat st
( 1 <= b4 & b4 <= width b2 & ( for b5 being Point of (TOP-REAL 2) st b5 in LSeg b3,b1 holds
b5 `2 = (b2 * 1,b4) `2 ) )
proof end;

theorem Th15: :: JORDAN9:15
for b1 being Nat
for b2 being Go-board
for b3 being FinSequence of (TOP-REAL 2) st b3 is_sequence_on b2 & LSeg b3,b1 is vertical holds
ex b4 being Nat st
( 1 <= b4 & b4 <= len b2 & ( for b5 being Point of (TOP-REAL 2) st b5 in LSeg b3,b1 holds
b5 `1 = (b2 * b4,1) `1 ) )
proof end;

theorem Th16: :: JORDAN9:16
for b1, b2 being Nat
for b3 being Go-board
for b4 being FinSequence of (TOP-REAL 2) st b4 is_sequence_on b3 & b4 is special & b1 <= len b3 & b2 <= width b3 holds
Int (cell b3,b1,b2) misses L~ b4
proof end;

theorem Th17: :: JORDAN9:17
for b1 being Nat
for b2 being Go-board
for b3 being FinSequence of (TOP-REAL 2) st b3 is_sequence_on b2 & b3 is special & 1 <= b1 & b1 + 1 <= len b3 holds
( Int (left_cell b3,b1,b2) misses L~ b3 & Int (right_cell b3,b1,b2) misses L~ b3 )
proof end;

theorem Th18: :: JORDAN9:18
for b1, b2 being Nat
for b3 being Go-board st 1 <= b1 & b1 + 1 <= len b3 & 1 <= b2 & b2 + 1 <= width b3 holds
( (b3 * b1,b2) `1 = (b3 * b1,(b2 + 1)) `1 & (b3 * b1,b2) `2 = (b3 * (b1 + 1),b2) `2 & (b3 * (b1 + 1),(b2 + 1)) `1 = (b3 * (b1 + 1),b2) `1 & (b3 * (b1 + 1),(b2 + 1)) `2 = (b3 * b1,(b2 + 1)) `2 )
proof end;

theorem Th19: :: JORDAN9:19
for b1 being Go-board
for b2 being Point of (TOP-REAL 2)
for b3, b4 being Nat st 1 <= b3 & b3 + 1 <= len b1 & 1 <= b4 & b4 + 1 <= width b1 holds
( b2 in cell b1,b3,b4 iff ( (b1 * b3,b4) `1 <= b2 `1 & b2 `1 <= (b1 * (b3 + 1),b4) `1 & (b1 * b3,b4) `2 <= b2 `2 & b2 `2 <= (b1 * b3,(b4 + 1)) `2 ) )
proof end;

theorem Th20: :: JORDAN9:20
for b1, b2 being Nat
for b3 being Go-board st 1 <= b1 & b1 + 1 <= len b3 & 1 <= b2 & b2 + 1 <= width b3 holds
cell b3,b1,b2 = { |[b4,b5]| where B is Real, B is Real : ( (b3 * b1,b2) `1 <= b4 & b4 <= (b3 * (b1 + 1),b2) `1 & (b3 * b1,b2) `2 <= b5 & b5 <= (b3 * b1,(b2 + 1)) `2 ) }
proof end;

theorem Th21: :: JORDAN9:21
for b1, b2 being Nat
for b3 being Go-board
for b4 being Point of (TOP-REAL 2) st 1 <= b1 & b1 + 1 <= len b3 & 1 <= b2 & b2 + 1 <= width b3 & b4 in Values b3 & b4 in cell b3,b1,b2 & not b4 = b3 * b1,b2 & not b4 = b3 * b1,(b2 + 1) & not b4 = b3 * (b1 + 1),(b2 + 1) holds
b4 = b3 * (b1 + 1),b2
proof end;

theorem Th22: :: JORDAN9:22
for b1, b2 being Nat
for b3 being Go-board st 1 <= b1 & b1 + 1 <= len b3 & 1 <= b2 & b2 + 1 <= width b3 holds
( b3 * b1,b2 in cell b3,b1,b2 & b3 * b1,(b2 + 1) in cell b3,b1,b2 & b3 * (b1 + 1),(b2 + 1) in cell b3,b1,b2 & b3 * (b1 + 1),b2 in cell b3,b1,b2 )
proof end;

theorem Th23: :: JORDAN9:23
for b1, b2 being Nat
for b3 being Go-board
for b4 being Point of (TOP-REAL 2) st 1 <= b1 & b1 + 1 <= len b3 & 1 <= b2 & b2 + 1 <= width b3 & b4 in Values b3 & b4 in cell b3,b1,b2 holds
b4 is_extremal_in cell b3,b1,b2
proof end;

theorem Th24: :: JORDAN9:24
for b1 being Nat
for b2 being Go-board
for b3 being FinSequence of (TOP-REAL 2) st 2 <= len b2 & 2 <= width b2 & b3 is_sequence_on b2 & 1 <= b1 & b1 + 1 <= len b3 holds
ex b4, b5 being Nat st
( 1 <= b4 & b4 + 1 <= len b2 & 1 <= b5 & b5 + 1 <= width b2 & LSeg b3,b1 c= cell b2,b4,b5 )
proof end;

theorem Th25: :: JORDAN9:25
for b1 being Nat
for b2 being Go-board
for b3 being FinSequence of (TOP-REAL 2)
for b4 being Point of (TOP-REAL 2) st 2 <= len b2 & 2 <= width b2 & b3 is_sequence_on b2 & 1 <= b1 & b1 + 1 <= len b3 & b4 in Values b2 & b4 in LSeg b3,b1 & not b4 = b3 /. b1 holds
b4 = b3 /. (b1 + 1)
proof end;

theorem Th26: :: JORDAN9:26
for b1, b2, b3 being Nat
for b4 being Go-board st [b1,b2] in Indices b4 & 1 <= b3 & b3 <= width b4 holds
(b4 * b1,b2) `1 <= (b4 * (len b4),b3) `1
proof end;

theorem Th27: :: JORDAN9:27
for b1, b2, b3 being Nat
for b4 being Go-board st [b1,b2] in Indices b4 & 1 <= b3 & b3 <= len b4 holds
(b4 * b1,b2) `2 <= (b4 * b3,(width b4)) `2
proof end;

theorem Th28: :: JORDAN9:28
for b1 being Nat
for b2 being Go-board
for b3, b4 being FinSequence of (TOP-REAL 2) st b3 is_sequence_on b2 & b3 is special & L~ b4 c= L~ b3 & 1 <= b1 & b1 + 1 <= len b3 holds
for b5 being Subset of (TOP-REAL 2) st ( b5 = (right_cell b3,b1,b2) \ (L~ b4) or b5 = (left_cell b3,b1,b2) \ (L~ b4) ) holds
b5 is connected
proof end;

theorem Th29: :: JORDAN9:29
for b1 being Go-board
for b2 being non constant standard special_circular_sequence st b2 is_sequence_on b1 holds
for b3 being Nat st 1 <= b3 & b3 + 1 <= len b2 holds
( (right_cell b2,b3,b1) \ (L~ b2) c= RightComp b2 & (left_cell b2,b3,b1) \ (L~ b2) c= LeftComp b2 )
proof end;

theorem Th30: :: JORDAN9:30
for b1 being Nat
for b2 being non empty compact non horizontal non vertical Subset of (TOP-REAL 2) ex b3 being Nat st
( 1 <= b3 & b3 + 1 <= len (Gauge b2,b1) & N-min b2 in cell (Gauge b2,b1),b3,((width (Gauge b2,b1)) -' 1) & N-min b2 <> (Gauge b2,b1) * b3,((width (Gauge b2,b1)) -' 1) )
proof end;

theorem Th31: :: JORDAN9:31
for b1 being Nat
for b2 being non empty compact non horizontal non vertical Subset of (TOP-REAL 2)
for b3, b4 being Nat st 1 <= b3 & b3 + 1 <= len (Gauge b2,b1) & N-min b2 in cell (Gauge b2,b1),b3,((width (Gauge b2,b1)) -' 1) & N-min b2 <> (Gauge b2,b1) * b3,((width (Gauge b2,b1)) -' 1) & 1 <= b4 & b4 + 1 <= len (Gauge b2,b1) & N-min b2 in cell (Gauge b2,b1),b4,((width (Gauge b2,b1)) -' 1) & N-min b2 <> (Gauge b2,b1) * b4,((width (Gauge b2,b1)) -' 1) holds
b3 = b4
proof end;

theorem Th32: :: JORDAN9:32
for b1 being Nat
for b2 being non empty compact non horizontal non vertical Subset of (TOP-REAL 2)
for b3 being non constant standard special_circular_sequence st b3 is_sequence_on Gauge b2,b1 & ( for b4 being Nat st 1 <= b4 & b4 + 1 <= len b3 holds
( left_cell b3,b4,(Gauge b2,b1) misses b2 & right_cell b3,b4,(Gauge b2,b1) meets b2 ) ) & ex b4 being Nat st
( 1 <= b4 & b4 + 1 <= len (Gauge b2,b1) & b3 /. 1 = (Gauge b2,b1) * b4,(width (Gauge b2,b1)) & b3 /. 2 = (Gauge b2,b1) * (b4 + 1),(width (Gauge b2,b1)) & N-min b2 in cell (Gauge b2,b1),b4,((width (Gauge b2,b1)) -' 1) & N-min b2 <> (Gauge b2,b1) * b4,((width (Gauge b2,b1)) -' 1) ) holds
N-min (L~ b3) = b3 /. 1
proof end;

definition
let c1 be non empty compact non horizontal non vertical Subset of (TOP-REAL 2);
let c2 be Nat;
assume E30: c1 is connected ;
func Cage c1,c2 -> clockwise_oriented non constant standard special_circular_sequence means :Def1: :: JORDAN9:def 1
( a3 is_sequence_on Gauge a1,a2 & ex b1 being Nat st
( 1 <= b1 & b1 + 1 <= len (Gauge a1,a2) & a3 /. 1 = (Gauge a1,a2) * b1,(width (Gauge a1,a2)) & a3 /. 2 = (Gauge a1,a2) * (b1 + 1),(width (Gauge a1,a2)) & N-min a1 in cell (Gauge a1,a2),b1,((width (Gauge a1,a2)) -' 1) & N-min a1 <> (Gauge a1,a2) * b1,((width (Gauge a1,a2)) -' 1) ) & ( for b1 being Nat st 1 <= b1 & b1 + 2 <= len a3 holds
( ( front_left_cell a3,b1,(Gauge a1,a2) misses a1 & front_right_cell a3,b1,(Gauge a1,a2) misses a1 implies a3 turns_right b1, Gauge a1,a2 ) & ( front_left_cell a3,b1,(Gauge a1,a2) misses a1 & front_right_cell a3,b1,(Gauge a1,a2) meets a1 implies a3 goes_straight b1, Gauge a1,a2 ) & ( front_left_cell a3,b1,(Gauge a1,a2) meets a1 implies a3 turns_left b1, Gauge a1,a2 ) ) ) );
existence
ex b1 being clockwise_oriented non constant standard special_circular_sequence st
( b1 is_sequence_on Gauge c1,c2 & ex b2 being Nat st
( 1 <= b2 & b2 + 1 <= len (Gauge c1,c2) & b1 /. 1 = (Gauge c1,c2) * b2,(width (Gauge c1,c2)) & b1 /. 2 = (Gauge c1,c2) * (b2 + 1),(width (Gauge c1,c2)) & N-min c1 in cell (Gauge c1,c2),b2,((width (Gauge c1,c2)) -' 1) & N-min c1 <> (Gauge c1,c2) * b2,((width (Gauge c1,c2)) -' 1) ) & ( for b2 being Nat st 1 <= b2 & b2 + 2 <= len b1 holds
( ( front_left_cell b1,b2,(Gauge c1,c2) misses c1 & front_right_cell b1,b2,(Gauge c1,c2) misses c1 implies b1 turns_right b2, Gauge c1,c2 ) & ( front_left_cell b1,b2,(Gauge c1,c2) misses c1 & front_right_cell b1,b2,(Gauge c1,c2) meets c1 implies b1 goes_straight b2, Gauge c1,c2 ) & ( front_left_cell b1,b2,(Gauge c1,c2) meets c1 implies b1 turns_left b2, Gauge c1,c2 ) ) ) )
proof end;
uniqueness
for b1, b2 being clockwise_oriented non constant standard special_circular_sequence st b1 is_sequence_on Gauge c1,c2 & ex b3 being Nat st
( 1 <= b3 & b3 + 1 <= len (Gauge c1,c2) & b1 /. 1 = (Gauge c1,c2) * b3,(width (Gauge c1,c2)) & b1 /. 2 = (Gauge c1,c2) * (b3 + 1),(width (Gauge c1,c2)) & N-min c1 in cell (Gauge c1,c2),b3,((width (Gauge c1,c2)) -' 1) & N-min c1 <> (Gauge c1,c2) * b3,((width (Gauge c1,c2)) -' 1) ) & ( for b3 being Nat st 1 <= b3 & b3 + 2 <= len b1 holds
( ( front_left_cell b1,b3,(Gauge c1,c2) misses c1 & front_right_cell b1,b3,(Gauge c1,c2) misses c1 implies b1 turns_right b3, Gauge c1,c2 ) & ( front_left_cell b1,b3,(Gauge c1,c2) misses c1 & front_right_cell b1,b3,(Gauge c1,c2) meets c1 implies b1 goes_straight b3, Gauge c1,c2 ) & ( front_left_cell b1,b3,(Gauge c1,c2) meets c1 implies b1 turns_left b3, Gauge c1,c2 ) ) ) & b2 is_sequence_on Gauge c1,c2 & ex b3 being Nat st
( 1 <= b3 & b3 + 1 <= len (Gauge c1,c2) & b2 /. 1 = (Gauge c1,c2) * b3,(width (Gauge c1,c2)) & b2 /. 2 = (Gauge c1,c2) * (b3 + 1),(width (Gauge c1,c2)) & N-min c1 in cell (Gauge c1,c2),b3,((width (Gauge c1,c2)) -' 1) & N-min c1 <> (Gauge c1,c2) * b3,((width (Gauge c1,c2)) -' 1) ) & ( for b3 being Nat st 1 <= b3 & b3 + 2 <= len b2 holds
( ( front_left_cell b2,b3,(Gauge c1,c2) misses c1 & front_right_cell b2,b3,(Gauge c1,c2) misses c1 implies b2 turns_right b3, Gauge c1,c2 ) & ( front_left_cell b2,b3,(Gauge c1,c2) misses c1 & front_right_cell b2,b3,(Gauge c1,c2) meets c1 implies b2 goes_straight b3, Gauge c1,c2 ) & ( front_left_cell b2,b3,(Gauge c1,c2) meets c1 implies b2 turns_left b3, Gauge c1,c2 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines Cage JORDAN9:def 1 :
for b1 being non empty compact non horizontal non vertical Subset of (TOP-REAL 2)
for b2 being Nat st b1 is connected holds
for b3 being clockwise_oriented non constant standard special_circular_sequence holds
( b3 = Cage b1,b2 iff ( b3 is_sequence_on Gauge b1,b2 & ex b4 being Nat st
( 1 <= b4 & b4 + 1 <= len (Gauge b1,b2) & b3 /. 1 = (Gauge b1,b2) * b4,(width (Gauge b1,b2)) & b3 /. 2 = (Gauge b1,b2) * (b4 + 1),(width (Gauge b1,b2)) & N-min b1 in cell (Gauge b1,b2),b4,((width (Gauge b1,b2)) -' 1) & N-min b1 <> (Gauge b1,b2) * b4,((width (Gauge b1,b2)) -' 1) ) & ( for b4 being Nat st 1 <= b4 & b4 + 2 <= len b3 holds
( ( front_left_cell b3,b4,(Gauge b1,b2) misses b1 & front_right_cell b3,b4,(Gauge b1,b2) misses b1 implies b3 turns_right b4, Gauge b1,b2 ) & ( front_left_cell b3,b4,(Gauge b1,b2) misses b1 & front_right_cell b3,b4,(Gauge b1,b2) meets b1 implies b3 goes_straight b4, Gauge b1,b2 ) & ( front_left_cell b3,b4,(Gauge b1,b2) meets b1 implies b3 turns_left b4, Gauge b1,b2 ) ) ) ) );

theorem Th33: :: JORDAN9:33
for b1, b2 being Nat
for b3 being non empty compact non horizontal non vertical Subset of (TOP-REAL 2) st b3 is connected & 1 <= b1 & b1 + 1 <= len (Cage b3,b2) holds
( left_cell (Cage b3,b2),b1,(Gauge b3,b2) misses b3 & right_cell (Cage b3,b2),b1,(Gauge b3,b2) meets b3 )
proof end;

theorem Th34: :: JORDAN9:34
for b1 being Nat
for b2 being non empty compact non horizontal non vertical Subset of (TOP-REAL 2) st b2 is connected holds
N-min (L~ (Cage b2,b1)) = (Cage b2,b1) /. 1
proof end;