:: GOBRD13 semantic presentation

definition
let c1 be non empty set ;
let c2 be FinSequence-DOMAIN of the carrier of (TOP-REAL 2);
let c3 be Function of c1,c2;
let c4 be Element of c1;
redefine func . as c3 . c4 -> FinSequence of (TOP-REAL 2);
coherence
c3 . c4 is FinSequence of (TOP-REAL 2)
proof end;
end;

definition
let c1 be Function;
func Values c1 -> set equals :: GOBRD13:def 1
Union (rngs a1);
correctness
coherence
Union (rngs c1) is set
;
;
end;

:: deftheorem Def1 defines Values GOBRD13:def 1 :
for b1 being Function holds Values b1 = Union (rngs b1);

theorem Th1: :: GOBRD13:1
for b1 being Nat
for b2 being non empty set
for b3 being FinSequence of b2 * holds b3 . b1 is FinSequence of b2
proof end;

registration
let c1 be set ;
cluster -> FinSequence-yielding FinSequence of a1 * ;
coherence
for b1 being FinSequence of c1 * holds b1 is FinSequence-yielding
proof end;
end;

registration
cluster FinSequence-yielding -> Function-yielding set ;
coherence
for b1 being Function st b1 is FinSequence-yielding holds
b1 is Function-yielding
proof end;
end;

theorem Th2: :: GOBRD13:2
canceled;

theorem Th3: :: GOBRD13:3
for b1 being non empty set
for b2 being FinSequence of b1 * holds Values b2 = union { (rng b3) where B is Element of b1 * : b3 in rng b2 }
proof end;

registration
let c1 be non empty set ;
let c2 be FinSequence of c1 * ;
cluster Values a2 -> finite ;
coherence
Values c2 is finite
proof end;
end;

theorem Th4: :: GOBRD13:4
for b1 being Nat
for b2 being non empty set
for b3 being FinSequence of b2
for b4 being Matrix of b2 st b1 in dom b4 & b4 . b1 = b3 holds
len b3 = width b4
proof end;

theorem Th5: :: GOBRD13:5
for b1, b2 being Nat
for b3 being non empty set
for b4 being FinSequence of b3
for b5 being Matrix of b3 st b1 in dom b5 & b5 . b1 = b4 & b2 in dom b4 holds
[b1,b2] in Indices b5
proof end;

theorem Th6: :: GOBRD13:6
for b1, b2 being Nat
for b3 being non empty set
for b4 being FinSequence of b3
for b5 being Matrix of b3 st [b1,b2] in Indices b5 & b5 . b1 = b4 holds
( len b4 = width b5 & b2 in dom b4 )
proof end;

theorem Th7: :: GOBRD13:7
for b1 being non empty set
for b2 being Matrix of b1 holds Values b2 = { (b2 * b3,b4) where B is Nat, B is Nat : [b3,b4] in Indices b2 }
proof end;

theorem Th8: :: GOBRD13:8
for b1 being non empty set
for b2 being Matrix of b1 holds card (Values b2) <= (len b2) * (width b2)
proof end;

theorem Th9: :: GOBRD13:9
for b1 being FinSequence of (TOP-REAL 2)
for b2 being Matrix of (TOP-REAL 2) st b1 is_sequence_on b2 holds
rng b1 c= Values b2
proof end;

theorem Th10: :: GOBRD13:10
for b1, b2, b3 being Nat
for b4, b5 being Go-board st Values b4 c= Values b5 & [b1,b2] in Indices b4 & 1 <= b3 & b3 <= width b5 & b4 * b1,b2 = b5 * 1,b3 holds
b1 = 1
proof end;

theorem Th11: :: GOBRD13:11
for b1, b2, b3 being Nat
for b4, b5 being Go-board st Values b4 c= Values b5 & [b1,b2] in Indices b4 & 1 <= b3 & b3 <= width b5 & b4 * b1,b2 = b5 * (len b5),b3 holds
b1 = len b4
proof end;

theorem Th12: :: GOBRD13:12
for b1, b2, b3 being Nat
for b4, b5 being Go-board st Values b4 c= Values b5 & [b1,b2] in Indices b4 & 1 <= b3 & b3 <= len b5 & b4 * b1,b2 = b5 * b3,1 holds
b2 = 1
proof end;

theorem Th13: :: GOBRD13:13
for b1, b2, b3 being Nat
for b4, b5 being Go-board st Values b4 c= Values b5 & [b1,b2] in Indices b4 & 1 <= b3 & b3 <= len b5 & b4 * b1,b2 = b5 * b3,(width b5) holds
b2 = width b4
proof end;

theorem Th14: :: GOBRD13:14
for b1, b2, b3, b4 being Nat
for b5, b6 being Go-board st Values b5 c= Values b6 & 1 <= b1 & b1 < len b5 & 1 <= b2 & b2 <= width b5 & 1 <= b3 & b3 < len b6 & 1 <= b4 & b4 <= width b6 & b5 * b1,b2 = b6 * b3,b4 holds
(b6 * (b3 + 1),b4) `1 <= (b5 * (b1 + 1),b2) `1
proof end;

theorem Th15: :: GOBRD13:15
for b1, b2, b3, b4 being Nat
for b5, b6 being Go-board st b5 * (b1 -' 1),b2 in Values b6 & 1 < b1 & b1 <= len b5 & 1 <= b2 & b2 <= width b5 & 1 < b3 & b3 <= len b6 & 1 <= b4 & b4 <= width b6 & b5 * b1,b2 = b6 * b3,b4 holds
(b5 * (b1 -' 1),b2) `1 <= (b6 * (b3 -' 1),b4) `1
proof end;

theorem Th16: :: GOBRD13:16
for b1, b2, b3, b4 being Nat
for b5, b6 being Go-board st b5 * b1,(b2 + 1) in Values b6 & 1 <= b1 & b1 <= len b5 & 1 <= b2 & b2 < width b5 & 1 <= b3 & b3 <= len b6 & 1 <= b4 & b4 < width b6 & b5 * b1,b2 = b6 * b3,b4 holds
(b6 * b3,(b4 + 1)) `2 <= (b5 * b1,(b2 + 1)) `2
proof end;

theorem Th17: :: GOBRD13:17
for b1, b2, b3, b4 being Nat
for b5, b6 being Go-board st Values b5 c= Values b6 & 1 <= b1 & b1 <= len b5 & 1 < b2 & b2 <= width b5 & 1 <= b3 & b3 <= len b6 & 1 < b4 & b4 <= width b6 & b5 * b1,b2 = b6 * b3,b4 holds
(b5 * b1,(b2 -' 1)) `2 <= (b6 * b3,(b4 -' 1)) `2
proof end;

Lemma15: for b1, b2 being Nat
for b3 being non empty set
for b4 being Matrix of b3 st 1 <= b1 & b1 <= len b4 & 1 <= b2 & b2 <= width b4 holds
b4 * b1,b2 in Values b4
proof end;

theorem Th18: :: GOBRD13:18
for b1, b2, b3, b4 being Nat
for b5, b6 being Go-board st Values b5 c= Values b6 & [b1,b2] in Indices b5 & [b3,b4] in Indices b6 & b5 * b1,b2 = b6 * b3,b4 holds
cell b6,b3,b4 c= cell b5,b1,b2
proof end;

theorem Th19: :: GOBRD13:19
for b1, b2, b3, b4 being Nat
for b5, b6 being Go-board st Values b5 c= Values b6 & [b1,b2] in Indices b5 & [b3,b4] in Indices b6 & b5 * b1,b2 = b6 * b3,b4 holds
cell b6,(b3 -' 1),b4 c= cell b5,(b1 -' 1),b2
proof end;

theorem Th20: :: GOBRD13:20
for b1, b2, b3, b4 being Nat
for b5, b6 being Go-board st Values b5 c= Values b6 & [b1,b2] in Indices b5 & [b3,b4] in Indices b6 & b5 * b1,b2 = b6 * b3,b4 holds
cell b6,b3,(b4 -' 1) c= cell b5,b1,(b2 -' 1)
proof end;

Lemma19: for b1, b2 being Nat
for b3 being non empty FinSequence of (TOP-REAL 2) st 1 <= b1 & b1 <= len (GoB b3) & 1 <= b2 & b2 <= width (GoB b3) holds
ex b4 being Nat st
( b4 in dom b3 & (b3 /. b4) `1 = ((GoB b3) * b1,b2) `1 )
proof end;

Lemma20: for b1, b2 being Nat
for b3 being non empty FinSequence of (TOP-REAL 2) st 1 <= b1 & b1 <= len (GoB b3) & 1 <= b2 & b2 <= width (GoB b3) holds
ex b4 being Nat st
( b4 in dom b3 & (b3 /. b4) `2 = ((GoB b3) * b1,b2) `2 )
proof end;

theorem Th21: :: GOBRD13:21
for b1 being Go-board
for b2 being standard special_circular_sequence st b2 is_sequence_on b1 holds
Values (GoB b2) c= Values b1
proof end;

definition
let c1 be FinSequence of (TOP-REAL 2);
let c2 be Go-board;
let c3 be Nat;
assume that
E22: ( 1 <= c3 & c3 + 1 <= len c1 ) and
E23: c1 is_sequence_on c2 ;
consider c4, c5, c6, c7 being Nat such that
E24: ( [c4,c5] in Indices c2 & c1 /. c3 = c2 * c4,c5 ) and
E25: ( [c6,c7] in Indices c2 & c1 /. (c3 + 1) = c2 * c6,c7 ) and
E26: ( ( c4 = c6 & c5 + 1 = c7 ) or ( c4 + 1 = c6 & c5 = c7 ) or ( c4 = c6 + 1 & c5 = c7 ) or ( c4 = c6 & c5 = c7 + 1 ) ) by E22, E23, JORDAN8:6;
func right_cell c1,c3,c2 -> Subset of (TOP-REAL 2) means :Def2: :: GOBRD13:def 2
for b1, b2, b3, b4 being Nat st [b1,b2] in Indices a2 & [b3,b4] in Indices a2 & a1 /. a3 = a2 * b1,b2 & a1 /. (a3 + 1) = a2 * b3,b4 & not ( b1 = b3 & b2 + 1 = b4 & a4 = cell a2,b1,b2 ) & not ( b1 + 1 = b3 & b2 = b4 & a4 = cell a2,b1,(b2 -' 1) ) & not ( b1 = b3 + 1 & b2 = b4 & a4 = cell a2,b3,b4 ) holds
( b1 = b3 & b2 = b4 + 1 & a4 = cell a2,(b1 -' 1),b4 );
existence
ex b1 being Subset of (TOP-REAL 2) st
for b2, b3, b4, b5 being Nat st [b2,b3] in Indices c2 & [b4,b5] in Indices c2 & c1 /. c3 = c2 * b2,b3 & c1 /. (c3 + 1) = c2 * b4,b5 & not ( b2 = b4 & b3 + 1 = b5 & b1 = cell c2,b2,b3 ) & not ( b2 + 1 = b4 & b3 = b5 & b1 = cell c2,b2,(b3 -' 1) ) & not ( b2 = b4 + 1 & b3 = b5 & b1 = cell c2,b4,b5 ) holds
( b2 = b4 & b3 = b5 + 1 & b1 = cell c2,(b2 -' 1),b5 )
proof end;
uniqueness
for b1, b2 being Subset of (TOP-REAL 2) st ( for b3, b4, b5, b6 being Nat st [b3,b4] in Indices c2 & [b5,b6] in Indices c2 & c1 /. c3 = c2 * b3,b4 & c1 /. (c3 + 1) = c2 * b5,b6 & not ( b3 = b5 & b4 + 1 = b6 & b1 = cell c2,b3,b4 ) & not ( b3 + 1 = b5 & b4 = b6 & b1 = cell c2,b3,(b4 -' 1) ) & not ( b3 = b5 + 1 & b4 = b6 & b1 = cell c2,b5,b6 ) holds
( b3 = b5 & b4 = b6 + 1 & b1 = cell c2,(b3 -' 1),b6 ) ) & ( for b3, b4, b5, b6 being Nat st [b3,b4] in Indices c2 & [b5,b6] in Indices c2 & c1 /. c3 = c2 * b3,b4 & c1 /. (c3 + 1) = c2 * b5,b6 & not ( b3 = b5 & b4 + 1 = b6 & b2 = cell c2,b3,b4 ) & not ( b3 + 1 = b5 & b4 = b6 & b2 = cell c2,b3,(b4 -' 1) ) & not ( b3 = b5 + 1 & b4 = b6 & b2 = cell c2,b5,b6 ) holds
( b3 = b5 & b4 = b6 + 1 & b2 = cell c2,(b3 -' 1),b6 ) ) holds
b1 = b2
proof end;
func left_cell c1,c3,c2 -> Subset of (TOP-REAL 2) means :Def3: :: GOBRD13:def 3
for b1, b2, b3, b4 being Nat st [b1,b2] in Indices a2 & [b3,b4] in Indices a2 & a1 /. a3 = a2 * b1,b2 & a1 /. (a3 + 1) = a2 * b3,b4 & not ( b1 = b3 & b2 + 1 = b4 & a4 = cell a2,(b1 -' 1),b2 ) & not ( b1 + 1 = b3 & b2 = b4 & a4 = cell a2,b1,b2 ) & not ( b1 = b3 + 1 & b2 = b4 & a4 = cell a2,b3,(b4 -' 1) ) holds
( b1 = b3 & b2 = b4 + 1 & a4 = cell a2,b1,b4 );
existence
ex b1 being Subset of (TOP-REAL 2) st
for b2, b3, b4, b5 being Nat st [b2,b3] in Indices c2 & [b4,b5] in Indices c2 & c1 /. c3 = c2 * b2,b3 & c1 /. (c3 + 1) = c2 * b4,b5 & not ( b2 = b4 & b3 + 1 = b5 & b1 = cell c2,(b2 -' 1),b3 ) & not ( b2 + 1 = b4 & b3 = b5 & b1 = cell c2,b2,b3 ) & not ( b2 = b4 + 1 & b3 = b5 & b1 = cell c2,b4,(b5 -' 1) ) holds
( b2 = b4 & b3 = b5 + 1 & b1 = cell c2,b2,b5 )
proof end;
uniqueness
for b1, b2 being Subset of (TOP-REAL 2) st ( for b3, b4, b5, b6 being Nat st [b3,b4] in Indices c2 & [b5,b6] in Indices c2 & c1 /. c3 = c2 * b3,b4 & c1 /. (c3 + 1) = c2 * b5,b6 & not ( b3 = b5 & b4 + 1 = b6 & b1 = cell c2,(b3 -' 1),b4 ) & not ( b3 + 1 = b5 & b4 = b6 & b1 = cell c2,b3,b4 ) & not ( b3 = b5 + 1 & b4 = b6 & b1 = cell c2,b5,(b6 -' 1) ) holds
( b3 = b5 & b4 = b6 + 1 & b1 = cell c2,b3,b6 ) ) & ( for b3, b4, b5, b6 being Nat st [b3,b4] in Indices c2 & [b5,b6] in Indices c2 & c1 /. c3 = c2 * b3,b4 & c1 /. (c3 + 1) = c2 * b5,b6 & not ( b3 = b5 & b4 + 1 = b6 & b2 = cell c2,(b3 -' 1),b4 ) & not ( b3 + 1 = b5 & b4 = b6 & b2 = cell c2,b3,b4 ) & not ( b3 = b5 + 1 & b4 = b6 & b2 = cell c2,b5,(b6 -' 1) ) holds
( b3 = b5 & b4 = b6 + 1 & b2 = cell c2,b3,b6 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines right_cell GOBRD13:def 2 :
for b1 being FinSequence of (TOP-REAL 2)
for b2 being Go-board
for b3 being Nat st 1 <= b3 & b3 + 1 <= len b1 & b1 is_sequence_on b2 holds
for b4 being Subset of (TOP-REAL 2) holds
( b4 = right_cell b1,b3,b2 iff for b5, b6, b7, b8 being Nat st [b5,b6] in Indices b2 & [b7,b8] in Indices b2 & b1 /. b3 = b2 * b5,b6 & b1 /. (b3 + 1) = b2 * b7,b8 & not ( b5 = b7 & b6 + 1 = b8 & b4 = cell b2,b5,b6 ) & not ( b5 + 1 = b7 & b6 = b8 & b4 = cell b2,b5,(b6 -' 1) ) & not ( b5 = b7 + 1 & b6 = b8 & b4 = cell b2,b7,b8 ) holds
( b5 = b7 & b6 = b8 + 1 & b4 = cell b2,(b5 -' 1),b8 ) );

:: deftheorem Def3 defines left_cell GOBRD13:def 3 :
for b1 being FinSequence of (TOP-REAL 2)
for b2 being Go-board
for b3 being Nat st 1 <= b3 & b3 + 1 <= len b1 & b1 is_sequence_on b2 holds
for b4 being Subset of (TOP-REAL 2) holds
( b4 = left_cell b1,b3,b2 iff for b5, b6, b7, b8 being Nat st [b5,b6] in Indices b2 & [b7,b8] in Indices b2 & b1 /. b3 = b2 * b5,b6 & b1 /. (b3 + 1) = b2 * b7,b8 & not ( b5 = b7 & b6 + 1 = b8 & b4 = cell b2,(b5 -' 1),b6 ) & not ( b5 + 1 = b7 & b6 = b8 & b4 = cell b2,b5,b6 ) & not ( b5 = b7 + 1 & b6 = b8 & b4 = cell b2,b7,(b8 -' 1) ) holds
( b5 = b7 & b6 = b8 + 1 & b4 = cell b2,b5,b8 ) );

theorem Th22: :: GOBRD13:22
for b1, b2, b3 being Nat
for b4 being FinSequence of (TOP-REAL 2)
for b5 being Go-board st 1 <= b1 & b1 + 1 <= len b4 & b4 is_sequence_on b5 & [b2,b3] in Indices b5 & [b2,(b3 + 1)] in Indices b5 & b4 /. b1 = b5 * b2,b3 & b4 /. (b1 + 1) = b5 * b2,(b3 + 1) holds
left_cell b4,b1,b5 = cell b5,(b2 -' 1),b3
proof end;

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

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

theorem Th25: :: GOBRD13:25
for b1, b2, b3 being Nat
for b4 being FinSequence of (TOP-REAL 2)
for b5 being Go-board st 1 <= b1 & b1 + 1 <= len b4 & b4 is_sequence_on b5 & [b2,b3] in Indices b5 & [(b2 + 1),b3] in Indices b5 & b4 /. b1 = b5 * b2,b3 & b4 /. (b1 + 1) = b5 * (b2 + 1),b3 holds
right_cell b4,b1,b5 = cell b5,b2,(b3 -' 1)
proof end;

theorem Th26: :: GOBRD13:26
for b1, b2, b3 being Nat
for b4 being FinSequence of (TOP-REAL 2)
for b5 being Go-board st 1 <= b1 & b1 + 1 <= len b4 & b4 is_sequence_on b5 & [b2,b3] in Indices b5 & [(b2 + 1),b3] in Indices b5 & b4 /. b1 = b5 * (b2 + 1),b3 & b4 /. (b1 + 1) = b5 * b2,b3 holds
left_cell b4,b1,b5 = cell b5,b2,(b3 -' 1)
proof end;

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

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

theorem Th29: :: GOBRD13:29
for b1, b2, b3 being Nat
for b4 being FinSequence of (TOP-REAL 2)
for b5 being Go-board st 1 <= b1 & b1 + 1 <= len b4 & b4 is_sequence_on b5 & [b2,(b3 + 1)] in Indices b5 & [b2,b3] in Indices b5 & b4 /. b1 = b5 * b2,(b3 + 1) & b4 /. (b1 + 1) = b5 * b2,b3 holds
right_cell b4,b1,b5 = cell b5,(b2 -' 1),b3
proof end;

theorem Th30: :: GOBRD13:30
for b1 being Nat
for b2 being FinSequence of (TOP-REAL 2)
for b3 being Go-board st 1 <= b1 & b1 + 1 <= len b2 & b2 is_sequence_on b3 holds
(left_cell b2,b1,b3) /\ (right_cell b2,b1,b3) = LSeg b2,b1
proof end;

theorem Th31: :: GOBRD13:31
for b1 being Nat
for b2 being FinSequence of (TOP-REAL 2)
for b3 being Go-board st 1 <= b1 & b1 + 1 <= len b2 & b2 is_sequence_on b3 holds
right_cell b2,b1,b3 is closed
proof end;

theorem Th32: :: GOBRD13:32
for b1, b2 being Nat
for b3 being FinSequence of (TOP-REAL 2)
for b4 being Go-board st 1 <= b1 & b1 + 1 <= len b3 & b3 is_sequence_on b4 & b1 + 1 <= b2 holds
( left_cell b3,b1,b4 = left_cell (b3 | b2),b1,b4 & right_cell b3,b1,b4 = right_cell (b3 | b2),b1,b4 )
proof end;

theorem Th33: :: GOBRD13:33
for b1, b2 being Nat
for b3 being FinSequence of (TOP-REAL 2)
for b4 being Go-board st 1 <= b1 & b1 + 1 <= len (b3 /^ b2) & b2 <= len b3 & b3 is_sequence_on b4 holds
( left_cell b3,(b1 + b2),b4 = left_cell (b3 /^ b2),b1,b4 & right_cell b3,(b1 + b2),b4 = right_cell (b3 /^ b2),b1,b4 )
proof end;

theorem Th34: :: GOBRD13:34
for b1 being Nat
for b2 being Go-board
for b3 being standard special_circular_sequence st 1 <= b1 & b1 + 1 <= len b3 & b3 is_sequence_on b2 holds
( left_cell b3,b1,b2 c= left_cell b3,b1 & right_cell b3,b1,b2 c= right_cell b3,b1 )
proof end;

definition
let c1 be FinSequence of (TOP-REAL 2);
let c2 be Go-board;
let c3 be Nat;
assume that
E32: ( 1 <= c3 & c3 + 1 <= len c1 ) and
E33: c1 is_sequence_on c2 ;
consider c4, c5, c6, c7 being Nat such that
E34: ( [c4,c5] in Indices c2 & c1 /. c3 = c2 * c4,c5 ) and
E35: ( [c6,c7] in Indices c2 & c1 /. (c3 + 1) = c2 * c6,c7 ) and
E36: ( ( c4 = c6 & c5 + 1 = c7 ) or ( c4 + 1 = c6 & c5 = c7 ) or ( c4 = c6 + 1 & c5 = c7 ) or ( c4 = c6 & c5 = c7 + 1 ) ) by E32, E33, JORDAN8:6;
func front_right_cell c1,c3,c2 -> Subset of (TOP-REAL 2) means :Def4: :: GOBRD13:def 4
for b1, b2, b3, b4 being Nat st [b1,b2] in Indices a2 & [b3,b4] in Indices a2 & a1 /. a3 = a2 * b1,b2 & a1 /. (a3 + 1) = a2 * b3,b4 & not ( b1 = b3 & b2 + 1 = b4 & a4 = cell a2,b3,b4 ) & not ( b1 + 1 = b3 & b2 = b4 & a4 = cell a2,b3,(b4 -' 1) ) & not ( b1 = b3 + 1 & b2 = b4 & a4 = cell a2,(b3 -' 1),b4 ) holds
( b1 = b3 & b2 = b4 + 1 & a4 = cell a2,(b3 -' 1),(b4 -' 1) );
existence
ex b1 being Subset of (TOP-REAL 2) st
for b2, b3, b4, b5 being Nat st [b2,b3] in Indices c2 & [b4,b5] in Indices c2 & c1 /. c3 = c2 * b2,b3 & c1 /. (c3 + 1) = c2 * b4,b5 & not ( b2 = b4 & b3 + 1 = b5 & b1 = cell c2,b4,b5 ) & not ( b2 + 1 = b4 & b3 = b5 & b1 = cell c2,b4,(b5 -' 1) ) & not ( b2 = b4 + 1 & b3 = b5 & b1 = cell c2,(b4 -' 1),b5 ) holds
( b2 = b4 & b3 = b5 + 1 & b1 = cell c2,(b4 -' 1),(b5 -' 1) )
proof end;
uniqueness
for b1, b2 being Subset of (TOP-REAL 2) st ( for b3, b4, b5, b6 being Nat st [b3,b4] in Indices c2 & [b5,b6] in Indices c2 & c1 /. c3 = c2 * b3,b4 & c1 /. (c3 + 1) = c2 * b5,b6 & not ( b3 = b5 & b4 + 1 = b6 & b1 = cell c2,b5,b6 ) & not ( b3 + 1 = b5 & b4 = b6 & b1 = cell c2,b5,(b6 -' 1) ) & not ( b3 = b5 + 1 & b4 = b6 & b1 = cell c2,(b5 -' 1),b6 ) holds
( b3 = b5 & b4 = b6 + 1 & b1 = cell c2,(b5 -' 1),(b6 -' 1) ) ) & ( for b3, b4, b5, b6 being Nat st [b3,b4] in Indices c2 & [b5,b6] in Indices c2 & c1 /. c3 = c2 * b3,b4 & c1 /. (c3 + 1) = c2 * b5,b6 & not ( b3 = b5 & b4 + 1 = b6 & b2 = cell c2,b5,b6 ) & not ( b3 + 1 = b5 & b4 = b6 & b2 = cell c2,b5,(b6 -' 1) ) & not ( b3 = b5 + 1 & b4 = b6 & b2 = cell c2,(b5 -' 1),b6 ) holds
( b3 = b5 & b4 = b6 + 1 & b2 = cell c2,(b5 -' 1),(b6 -' 1) ) ) holds
b1 = b2
proof end;
func front_left_cell c1,c3,c2 -> Subset of (TOP-REAL 2) means :Def5: :: GOBRD13:def 5
for b1, b2, b3, b4 being Nat st [b1,b2] in Indices a2 & [b3,b4] in Indices a2 & a1 /. a3 = a2 * b1,b2 & a1 /. (a3 + 1) = a2 * b3,b4 & not ( b1 = b3 & b2 + 1 = b4 & a4 = cell a2,(b3 -' 1),b4 ) & not ( b1 + 1 = b3 & b2 = b4 & a4 = cell a2,b3,b4 ) & not ( b1 = b3 + 1 & b2 = b4 & a4 = cell a2,(b3 -' 1),(b4 -' 1) ) holds
( b1 = b3 & b2 = b4 + 1 & a4 = cell a2,b3,(b4 -' 1) );
existence
ex b1 being Subset of (TOP-REAL 2) st
for b2, b3, b4, b5 being Nat st [b2,b3] in Indices c2 & [b4,b5] in Indices c2 & c1 /. c3 = c2 * b2,b3 & c1 /. (c3 + 1) = c2 * b4,b5 & not ( b2 = b4 & b3 + 1 = b5 & b1 = cell c2,(b4 -' 1),b5 ) & not ( b2 + 1 = b4 & b3 = b5 & b1 = cell c2,b4,b5 ) & not ( b2 = b4 + 1 & b3 = b5 & b1 = cell c2,(b4 -' 1),(b5 -' 1) ) holds
( b2 = b4 & b3 = b5 + 1 & b1 = cell c2,b4,(b5 -' 1) )
proof end;
uniqueness
for b1, b2 being Subset of (TOP-REAL 2) st ( for b3, b4, b5, b6 being Nat st [b3,b4] in Indices c2 & [b5,b6] in Indices c2 & c1 /. c3 = c2 * b3,b4 & c1 /. (c3 + 1) = c2 * b5,b6 & not ( b3 = b5 & b4 + 1 = b6 & b1 = cell c2,(b5 -' 1),b6 ) & not ( b3 + 1 = b5 & b4 = b6 & b1 = cell c2,b5,b6 ) & not ( b3 = b5 + 1 & b4 = b6 & b1 = cell c2,(b5 -' 1),(b6 -' 1) ) holds
( b3 = b5 & b4 = b6 + 1 & b1 = cell c2,b5,(b6 -' 1) ) ) & ( for b3, b4, b5, b6 being Nat st [b3,b4] in Indices c2 & [b5,b6] in Indices c2 & c1 /. c3 = c2 * b3,b4 & c1 /. (c3 + 1) = c2 * b5,b6 & not ( b3 = b5 & b4 + 1 = b6 & b2 = cell c2,(b5 -' 1),b6 ) & not ( b3 + 1 = b5 & b4 = b6 & b2 = cell c2,b5,b6 ) & not ( b3 = b5 + 1 & b4 = b6 & b2 = cell c2,(b5 -' 1),(b6 -' 1) ) holds
( b3 = b5 & b4 = b6 + 1 & b2 = cell c2,b5,(b6 -' 1) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines front_right_cell GOBRD13:def 4 :
for b1 being FinSequence of (TOP-REAL 2)
for b2 being Go-board
for b3 being Nat st 1 <= b3 & b3 + 1 <= len b1 & b1 is_sequence_on b2 holds
for b4 being Subset of (TOP-REAL 2) holds
( b4 = front_right_cell b1,b3,b2 iff for b5, b6, b7, b8 being Nat st [b5,b6] in Indices b2 & [b7,b8] in Indices b2 & b1 /. b3 = b2 * b5,b6 & b1 /. (b3 + 1) = b2 * b7,b8 & not ( b5 = b7 & b6 + 1 = b8 & b4 = cell b2,b7,b8 ) & not ( b5 + 1 = b7 & b6 = b8 & b4 = cell b2,b7,(b8 -' 1) ) & not ( b5 = b7 + 1 & b6 = b8 & b4 = cell b2,(b7 -' 1),b8 ) holds
( b5 = b7 & b6 = b8 + 1 & b4 = cell b2,(b7 -' 1),(b8 -' 1) ) );

:: deftheorem Def5 defines front_left_cell GOBRD13:def 5 :
for b1 being FinSequence of (TOP-REAL 2)
for b2 being Go-board
for b3 being Nat st 1 <= b3 & b3 + 1 <= len b1 & b1 is_sequence_on b2 holds
for b4 being Subset of (TOP-REAL 2) holds
( b4 = front_left_cell b1,b3,b2 iff for b5, b6, b7, b8 being Nat st [b5,b6] in Indices b2 & [b7,b8] in Indices b2 & b1 /. b3 = b2 * b5,b6 & b1 /. (b3 + 1) = b2 * b7,b8 & not ( b5 = b7 & b6 + 1 = b8 & b4 = cell b2,(b7 -' 1),b8 ) & not ( b5 + 1 = b7 & b6 = b8 & b4 = cell b2,b7,b8 ) & not ( b5 = b7 + 1 & b6 = b8 & b4 = cell b2,(b7 -' 1),(b8 -' 1) ) holds
( b5 = b7 & b6 = b8 + 1 & b4 = cell b2,b7,(b8 -' 1) ) );

theorem Th35: :: GOBRD13:35
for b1, b2, b3 being Nat
for b4 being FinSequence of (TOP-REAL 2)
for b5 being Go-board st 1 <= b1 & b1 + 1 <= len b4 & b4 is_sequence_on b5 & [b2,b3] in Indices b5 & [b2,(b3 + 1)] in Indices b5 & b4 /. b1 = b5 * b2,b3 & b4 /. (b1 + 1) = b5 * b2,(b3 + 1) holds
front_left_cell b4,b1,b5 = cell b5,(b2 -' 1),(b3 + 1)
proof end;

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

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

theorem Th38: :: GOBRD13:38
for b1, b2, b3 being Nat
for b4 being FinSequence of (TOP-REAL 2)
for b5 being Go-board st 1 <= b1 & b1 + 1 <= len b4 & b4 is_sequence_on b5 & [b2,b3] in Indices b5 & [(b2 + 1),b3] in Indices b5 & b4 /. b1 = b5 * b2,b3 & b4 /. (b1 + 1) = b5 * (b2 + 1),b3 holds
front_right_cell b4,b1,b5 = cell b5,(b2 + 1),(b3 -' 1)
proof end;

theorem Th39: :: GOBRD13:39
for b1, b2, b3 being Nat
for b4 being FinSequence of (TOP-REAL 2)
for b5 being Go-board st 1 <= b1 & b1 + 1 <= len b4 & b4 is_sequence_on b5 & [b2,b3] in Indices b5 & [(b2 + 1),b3] in Indices b5 & b4 /. b1 = b5 * (b2 + 1),b3 & b4 /. (b1 + 1) = b5 * b2,b3 holds
front_left_cell b4,b1,b5 = cell b5,(b2 -' 1),(b3 -' 1)
proof end;

theorem Th40: :: GOBRD13:40
for b1, b2, b3 being Nat
for b4 being FinSequence of (TOP-REAL 2)
for b5 being Go-board st 1 <= b1 & b1 + 1 <= len b4 & b4 is_sequence_on b5 & [b2,b3] in Indices b5 & [(b2 + 1),b3] in Indices b5 & b4 /. b1 = b5 * (b2 + 1),b3 & b4 /. (b1 + 1) = b5 * b2,b3 holds
front_right_cell b4,b1,b5 = cell b5,(b2 -' 1),b3
proof end;

theorem Th41: :: GOBRD13:41
for b1, b2, b3 being Nat
for b4 being FinSequence of (TOP-REAL 2)
for b5 being Go-board st 1 <= b1 & b1 + 1 <= len b4 & b4 is_sequence_on b5 & [b2,(b3 + 1)] in Indices b5 & [b2,b3] in Indices b5 & b4 /. b1 = b5 * b2,(b3 + 1) & b4 /. (b1 + 1) = b5 * b2,b3 holds
front_left_cell b4,b1,b5 = cell b5,b2,(b3 -' 1)
proof end;

theorem Th42: :: GOBRD13:42
for b1, b2, b3 being Nat
for b4 being FinSequence of (TOP-REAL 2)
for b5 being Go-board st 1 <= b1 & b1 + 1 <= len b4 & b4 is_sequence_on b5 & [b2,(b3 + 1)] in Indices b5 & [b2,b3] in Indices b5 & b4 /. b1 = b5 * b2,(b3 + 1) & b4 /. (b1 + 1) = b5 * b2,b3 holds
front_right_cell b4,b1,b5 = cell b5,(b2 -' 1),(b3 -' 1)
proof end;

theorem Th43: :: GOBRD13:43
for b1, b2 being Nat
for b3 being FinSequence of (TOP-REAL 2)
for b4 being Go-board st 1 <= b1 & b1 + 1 <= len b3 & b3 is_sequence_on b4 & b1 + 1 <= b2 holds
( front_left_cell b3,b1,b4 = front_left_cell (b3 | b2),b1,b4 & front_right_cell b3,b1,b4 = front_right_cell (b3 | b2),b1,b4 )
proof end;

definition
let c1 be set ;
let c2 be FinSequence of c1;
let c3 be Matrix of c1;
let c4 be Nat;
pred c2 turns_right c4,c3 means :Def6: :: GOBRD13:def 6
for b1, b2, b3, b4 being Nat st [b1,b2] in Indices a3 & [b3,b4] in Indices a3 & a2 /. a4 = a3 * b1,b2 & a2 /. (a4 + 1) = a3 * b3,b4 & not ( b1 = b3 & b2 + 1 = b4 & [(b3 + 1),b4] in Indices a3 & a2 /. (a4 + 2) = a3 * (b3 + 1),b4 ) & not ( b1 + 1 = b3 & b2 = b4 & [b3,(b4 -' 1)] in Indices a3 & a2 /. (a4 + 2) = a3 * b3,(b4 -' 1) ) & not ( b1 = b3 + 1 & b2 = b4 & [b3,(b4 + 1)] in Indices a3 & a2 /. (a4 + 2) = a3 * b3,(b4 + 1) ) holds
( b1 = b3 & b2 = b4 + 1 & [(b3 -' 1),b4] in Indices a3 & a2 /. (a4 + 2) = a3 * (b3 -' 1),b4 );
pred c2 turns_left c4,c3 means :Def7: :: GOBRD13:def 7
for b1, b2, b3, b4 being Nat st [b1,b2] in Indices a3 & [b3,b4] in Indices a3 & a2 /. a4 = a3 * b1,b2 & a2 /. (a4 + 1) = a3 * b3,b4 & not ( b1 = b3 & b2 + 1 = b4 & [(b3 -' 1),b4] in Indices a3 & a2 /. (a4 + 2) = a3 * (b3 -' 1),b4 ) & not ( b1 + 1 = b3 & b2 = b4 & [b3,(b4 + 1)] in Indices a3 & a2 /. (a4 + 2) = a3 * b3,(b4 + 1) ) & not ( b1 = b3 + 1 & b2 = b4 & [b3,(b4 -' 1)] in Indices a3 & a2 /. (a4 + 2) = a3 * b3,(b4 -' 1) ) holds
( b1 = b3 & b2 = b4 + 1 & [(b3 + 1),b4] in Indices a3 & a2 /. (a4 + 2) = a3 * (b3 + 1),b4 );
pred c2 goes_straight c4,c3 means :Def8: :: GOBRD13:def 8
for b1, b2, b3, b4 being Nat st [b1,b2] in Indices a3 & [b3,b4] in Indices a3 & a2 /. a4 = a3 * b1,b2 & a2 /. (a4 + 1) = a3 * b3,b4 & not ( b1 = b3 & b2 + 1 = b4 & [b3,(b4 + 1)] in Indices a3 & a2 /. (a4 + 2) = a3 * b3,(b4 + 1) ) & not ( b1 + 1 = b3 & b2 = b4 & [(b3 + 1),b4] in Indices a3 & a2 /. (a4 + 2) = a3 * (b3 + 1),b4 ) & not ( b1 = b3 + 1 & b2 = b4 & [(b3 -' 1),b4] in Indices a3 & a2 /. (a4 + 2) = a3 * (b3 -' 1),b4 ) holds
( b1 = b3 & b2 = b4 + 1 & [b3,(b4 -' 1)] in Indices a3 & a2 /. (a4 + 2) = a3 * b3,(b4 -' 1) );
end;

:: deftheorem Def6 defines turns_right GOBRD13:def 6 :
for b1 being set
for b2 being FinSequence of b1
for b3 being Matrix of b1
for b4 being Nat holds
( b2 turns_right b4,b3 iff for b5, b6, b7, b8 being Nat st [b5,b6] in Indices b3 & [b7,b8] in Indices b3 & b2 /. b4 = b3 * b5,b6 & b2 /. (b4 + 1) = b3 * b7,b8 & not ( b5 = b7 & b6 + 1 = b8 & [(b7 + 1),b8] in Indices b3 & b2 /. (b4 + 2) = b3 * (b7 + 1),b8 ) & not ( b5 + 1 = b7 & b6 = b8 & [b7,(b8 -' 1)] in Indices b3 & b2 /. (b4 + 2) = b3 * b7,(b8 -' 1) ) & not ( b5 = b7 + 1 & b6 = b8 & [b7,(b8 + 1)] in Indices b3 & b2 /. (b4 + 2) = b3 * b7,(b8 + 1) ) holds
( b5 = b7 & b6 = b8 + 1 & [(b7 -' 1),b8] in Indices b3 & b2 /. (b4 + 2) = b3 * (b7 -' 1),b8 ) );

:: deftheorem Def7 defines turns_left GOBRD13:def 7 :
for b1 being set
for b2 being FinSequence of b1
for b3 being Matrix of b1
for b4 being Nat holds
( b2 turns_left b4,b3 iff for b5, b6, b7, b8 being Nat st [b5,b6] in Indices b3 & [b7,b8] in Indices b3 & b2 /. b4 = b3 * b5,b6 & b2 /. (b4 + 1) = b3 * b7,b8 & not ( b5 = b7 & b6 + 1 = b8 & [(b7 -' 1),b8] in Indices b3 & b2 /. (b4 + 2) = b3 * (b7 -' 1),b8 ) & not ( b5 + 1 = b7 & b6 = b8 & [b7,(b8 + 1)] in Indices b3 & b2 /. (b4 + 2) = b3 * b7,(b8 + 1) ) & not ( b5 = b7 + 1 & b6 = b8 & [b7,(b8 -' 1)] in Indices b3 & b2 /. (b4 + 2) = b3 * b7,(b8 -' 1) ) holds
( b5 = b7 & b6 = b8 + 1 & [(b7 + 1),b8] in Indices b3 & b2 /. (b4 + 2) = b3 * (b7 + 1),b8 ) );

:: deftheorem Def8 defines goes_straight GOBRD13:def 8 :
for b1 being set
for b2 being FinSequence of b1
for b3 being Matrix of b1
for b4 being Nat holds
( b2 goes_straight b4,b3 iff for b5, b6, b7, b8 being Nat st [b5,b6] in Indices b3 & [b7,b8] in Indices b3 & b2 /. b4 = b3 * b5,b6 & b2 /. (b4 + 1) = b3 * b7,b8 & not ( b5 = b7 & b6 + 1 = b8 & [b7,(b8 + 1)] in Indices b3 & b2 /. (b4 + 2) = b3 * b7,(b8 + 1) ) & not ( b5 + 1 = b7 & b6 = b8 & [(b7 + 1),b8] in Indices b3 & b2 /. (b4 + 2) = b3 * (b7 + 1),b8 ) & not ( b5 = b7 + 1 & b6 = b8 & [(b7 -' 1),b8] in Indices b3 & b2 /. (b4 + 2) = b3 * (b7 -' 1),b8 ) holds
( b5 = b7 & b6 = b8 + 1 & [b7,(b8 -' 1)] in Indices b3 & b2 /. (b4 + 2) = b3 * b7,(b8 -' 1) ) );

theorem Th44: :: GOBRD13:44
for b1, b2 being Nat
for b3 being set
for b4 being FinSequence of b3
for b5 being Matrix of b3 st 1 <= b1 & b1 + 2 <= len b4 & b1 + 2 <= b2 & b4 | b2 turns_right b1,b5 holds
b4 turns_right b1,b5
proof end;

theorem Th45: :: GOBRD13:45
for b1, b2 being Nat
for b3 being set
for b4 being FinSequence of b3
for b5 being Matrix of b3 st 1 <= b1 & b1 + 2 <= len b4 & b1 + 2 <= b2 & b4 | b2 turns_left b1,b5 holds
b4 turns_left b1,b5
proof end;

theorem Th46: :: GOBRD13:46
for b1, b2 being Nat
for b3 being set
for b4 being FinSequence of b3
for b5 being Matrix of b3 st 1 <= b1 & b1 + 2 <= len b4 & b1 + 2 <= b2 & b4 | b2 goes_straight b1,b5 holds
b4 goes_straight b1,b5
proof end;

theorem Th47: :: GOBRD13:47
for b1 being Nat
for b2 being set
for b3, b4 being FinSequence of b2
for b5 being Matrix of b2 st 1 < b1 & b1 + 1 <= len b3 & b1 + 1 <= len b4 & b3 is_sequence_on b5 & b3 | b1 = b4 | b1 & b3 turns_right b1 -' 1,b5 & b4 turns_right b1 -' 1,b5 holds
b3 | (b1 + 1) = b4 | (b1 + 1)
proof end;

theorem Th48: :: GOBRD13:48
for b1 being Nat
for b2 being set
for b3, b4 being FinSequence of b2
for b5 being Matrix of b2 st 1 < b1 & b1 + 1 <= len b3 & b1 + 1 <= len b4 & b3 is_sequence_on b5 & b3 | b1 = b4 | b1 & b3 turns_left b1 -' 1,b5 & b4 turns_left b1 -' 1,b5 holds
b3 | (b1 + 1) = b4 | (b1 + 1)
proof end;

theorem Th49: :: GOBRD13:49
for b1 being Nat
for b2 being set
for b3, b4 being FinSequence of b2
for b5 being Matrix of b2 st 1 < b1 & b1 + 1 <= len b3 & b1 + 1 <= len b4 & b3 is_sequence_on b5 & b3 | b1 = b4 | b1 & b3 goes_straight b1 -' 1,b5 & b4 goes_straight b1 -' 1,b5 holds
b3 | (b1 + 1) = b4 | (b1 + 1)
proof end;

theorem Th50: :: GOBRD13:50
for b1, b2 being Nat
for b3 being non empty set
for b4 being Matrix of b3 st 1 <= b1 & b1 <= len b4 & 1 <= b2 & b2 <= width b4 holds
b4 * b1,b2 in Values b4 by Lemma15;