reserve p for Point of TOP-REAL 2,
  f,f1,f2,g for FinSequence of TOP-REAL 2,
  v, v1,v2 for FinSequence of REAL,
  r,s for Real,
  n,m,i,j,k for Nat,
  x for set;
reserve G for Go-board;
reserve D for set,
  f for FinSequence of D,
  M for Matrix of D;

theorem
  (for n st n in dom f1 & n+1 in dom f1
   for m,k,i,j st [m,k] in Indices M & [i,j] in Indices M
      & f1/.n=M*(m,k) & f1/.(n+1)=M*(i,j)
    holds |.m-i.|+|.k-j.|=1) &
  (for n st n in dom f2 & n+1 in dom f2
   for m,k,i,j st [m,k] in Indices M & [i,j] in Indices M &
     f2/.n=M*(m,k) & f2/.(n+1)=M*(i,j)
    holds |.m-i.|+|.k-j.|=1) &
  (for m,k,i,j st [m,k] in Indices  M & [i,j] in Indices M &
     f1/.len f1=M*(m,k) & f2/.1=M*(i,j) & len f1 in dom f1 & 1 in dom f2
     holds |.m-i.|+|.k-j.|=1)
   implies
   for n st n in dom(f1^f2) & n+1 in dom(f1^f2)
   for m,k,i,j st [m,k] in Indices M & [i,j] in Indices M &
     (f1^f2)/.n =M* (m,k) & (f1^f2)/.(n+1)=M*(i,j)
   holds |.m-i.|+|.k-j.|=1
proof
  assume that
A1: for n st n in dom f1 & n+1 in dom f1 holds for m,k,i,j st [m,k] in
Indices M & [i,j] in Indices M & f1/.n=M*(m,k) & f1/.(n+1)=M*(i,j)
  holds |.m-i.|+|.k-j.|=1 and
A2: for n st n in dom f2 & n+1 in dom f2 holds for m,k,i,j st [m,k] in
Indices M & [i,j] in Indices M & f2/.n=M*(m,k) & f2/.(n+1)=M*(i,j)
  holds |.m-i.|+|.k-j.|=1 and
A3: for m,k,i,j st [m,k] in Indices M & [i,j] in Indices M & f1/.len f1=
M*(m,k) & f2/.1=M*(i,j) & len f1 in dom f1 & 1 in dom f2
  holds |.m-i.|+|.k-j.|=1;
  let n such that
A4: n in dom(f1^f2) and
A5: n+1 in dom(f1^f2);
  let m,k,i,j such that
A6: [m,k] in Indices M & [i,j] in Indices M and
A7: (f1^f2)/.n=M*(m,k) and
A8: (f1^f2)/.(n+1)=M*(i,j);
A9: dom f1=Seg len f1 by FINSEQ_1:def 3;
  per cases by A4,FINSEQ_1:25;
  suppose
A10: n in dom f1;
    then
A11: f1/.n=M*(m,k) by A7,FINSEQ_4:68;
    now
      per cases by A5,FINSEQ_1:25;
      suppose
A12:    n+1 in dom f1;
        then f1/.(n+1)=M*(i,j) by A8,FINSEQ_4:68;
        hence thesis by A1,A6,A10,A11,A12;
      end;
      suppose
        ex m be Nat st m in dom f2 & n+1=len f1+m;
        then consider mm be Nat such that
A13:    mm in dom f2 and
A14:    n+1=len f1+mm;
        1<=mm by A13,FINSEQ_3:25;
        then
A15:    0<=mm-1 by XREAL_1:48;
        len f1+(mm-1)<=len f1+0 by A9,A10,A14,FINSEQ_1:1;
        then
A16:    mm-1=0 by A15,XREAL_1:6;
        then M*(i,j)=f2/.1 & M*(m,k)=f1/.len f1 by A7,A8,A10,A13,A14,
FINSEQ_4:68,69;
        hence thesis by A3,A6,A10,A13,A14,A16;
      end;
    end;
    hence thesis;
  end;
  suppose
    ex m be Nat st m in dom f2 & n=len f1+m;
    then consider mm be Nat such that
A17: mm in dom f2 and
A18: n=len f1+mm;
A19: M*(m,k)=f2/.mm by A7,A17,A18,FINSEQ_4:69;
A20: len f1+mm+1=len f1+(mm+1);
    n+1<=len(f1^f2) by A5,FINSEQ_3:25;
    then len f1+mm+1<=len f1+len f2 by A18,FINSEQ_1:22;
    then 1<=mm+1 & mm+1<=len f2 by A20,NAT_1:11,XREAL_1:6;
    then
A21: mm+1 in dom f2 by FINSEQ_3:25;
    M*(i,j)=(f1^f2)/.(len f1+(mm+1)) by A8,A18
      .=f2/.(mm+1) by A21,FINSEQ_4:69;
    hence thesis by A2,A6,A17,A21,A19;
  end;
end;
