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;
reserve f for FinSequence of TOP-REAL 2;

theorem Th25:
  1<=len f & f/.len f in rng Col(G,width G) & f is_sequence_on G &
  i in Seg width G & i+1 in Seg width G & m in dom f & f/.m in rng Col(G,i) & (
for k st k in dom f & f/.k in rng Col(G,i) holds k<=m) implies m+1 in dom f & f
  /.(m+1) in rng Col(G,i+1)
proof
  assume that
A1: 1<=len f and
A2: f/.len f in rng Col(G,width G) and
A3: f is_sequence_on G and
A4: i in Seg width G and
A5: i+1 in Seg width G and
A6: m in dom f and
A7: f/.m in rng Col(G,i) and
A8: for k st k in dom f & f/.k in rng Col(G,i) holds k<=m;
  defpred P[Nat,set] means $2 in Seg width G & for k st k=$2 holds f/.$1 in
  rng Col(G,k);
A9: dom G = Seg len G by FINSEQ_1:def 3;
A10: for n st n in dom f ex k st k in Seg width G & f/.n in rng Col(G,k)
  proof
    assume not thesis;
    then consider n such that
A11: n in dom f and
A12: for k st k in Seg width G holds not f/.n in rng Col(G,k);
    consider i,j such that
A13: [i,j] in Indices G and
A14: f/.n = G*(i,j) by A3,A11;
A15: [i,j] in [:dom G, Seg width G:] by A13,MATRIX_0:def 4;
    then j in Seg width G by ZFMISC_1:87;
    then
A16: not f/.n in rng Col(G,j) by A12;
A17: i in dom G by A15,ZFMISC_1:87;
    then i in Seg len Col(G,j) by A9,MATRIX_0:def 8;
    then
A18: i in dom Col(G,j) by FINSEQ_1:def 3;
    (Col(G,j)).i = G*(i,j) by A17,MATRIX_0:def 8;
    hence contradiction by A14,A16,A18,FUNCT_1:def 3;
  end;
A19: for n be Nat st n in Seg len f ex r being Element of REAL st P[n,r]
  proof
    let n be Nat;
    assume n in Seg len f;
    then n in dom f by FINSEQ_1:def 3;
    then consider k such that
A20: k in Seg width G and
A21: f/.n in rng Col(G,k) by A10;
    reconsider r=k as Element of REAL by XREAL_0:def 1;
    take r;
    thus r in Seg width G by A20;
    let m;
    assume m=r;
    hence thesis by A21;
  end;
  consider v such that
A22: dom v = Seg len f and
A23: for n be Nat st n in Seg len f holds P[n,v.n] from FINSEQ_1:sch 5(A19);
A24: dom f = Seg len f by FINSEQ_1:def 3;
A25: for k st k in dom v & v.k = i holds k<=m
  proof
    let k;
    assume that
A26: k in dom v and
A27: v.k=i;
    f/.k in rng Col(G,i) by A22,A23,A26,A27;
    hence thesis by A8,A22,A24,A26;
  end;
A28: rng v c= Seg width G
  proof
    let x be object;
    assume x in rng v;
    then ex y be Nat st y in dom v & v.y=x by FINSEQ_2:10;
    hence thesis by A22,A23;
  end;
A29: len v = len f by A22,FINSEQ_1:def 3;
A30: for k st 1<=k & k<=len v - 1 holds for r,s st r = v.k & s = v.(k+1)
  holds |.r-s.| = 1 or r=s
  proof
    let k;
    assume that
A31: 1<=k and
A32: k<=len v - 1;
A33: k+1<=len v by A32,XREAL_1:19;
    let r,s;
    assume that
A34: r = v.k and
A35: s = v.(k+1);
    1<=k+1 by NAT_1:11;
    then
A36: k+1 in dom f by A29,A33,FINSEQ_3:25;
    then
A37: s in rng v by A22,A24,A35,FUNCT_1:def 3;
    then
A38: s in Seg width G by A28;
    k<=k+1 by NAT_1:11;
    then k<=len f by A29,A33,XXREAL_0:2;
    then
A39: k in dom f by A31,FINSEQ_3:25;
    then
A40: r in rng v by A22,A24,A34,FUNCT_1:def 3;
    then r in Seg width G by A28;
    then reconsider n1=r, n2=s as Element of NAT by A38;
    set L1 = Col(G,n1), L2 = Col(G,n2);
    f/.k in rng L1 by A23,A24,A39,A34;
    then consider x be Nat such that
A41: x in dom L1 and
A42: L1.x = f/.k by FINSEQ_2:10;
A43: dom L1 = Seg len L1 & len L1 = len G by FINSEQ_1:def 3,MATRIX_0:def 8;
    then
A44: f/.k = G*(x,n1) by A9,A41,A42,MATRIX_0:def 8;
    f/.(k+1) in rng L2 by A23,A24,A36,A35;
    then consider y be Nat such that
A45: y in dom L2 and
A46: L2.y = f/.(k+1) by FINSEQ_2:10;
    reconsider x,y as Element of NAT by ORDINAL1:def 12;
    [x,n1] in [:dom G,Seg width G:] by A9,A28,A40,A41,A43,ZFMISC_1:87;
    then
A47: [x,n1] in Indices G by MATRIX_0:def 4;
A48: dom L2 = Seg len L2 & len L2 = len G by FINSEQ_1:def 3,MATRIX_0:def 8;
    then [y,n2] in [:dom G,Seg width G:] by A9,A28,A37,A45,ZFMISC_1:87;
    then
A49: [y,n2] in Indices G by MATRIX_0:def 4;
    f/.(k+1) = G*(y,n2) by A9,A48,A45,A46,MATRIX_0:def 8;
    then |.x-y.|+|.n1-n2.|= 1 by A3,A39,A36,A44,A47,A49;
    hence thesis by SEQM_3:42;
  end;
A50: v.m = i
  proof
A51: v.m in Seg width G by A6,A23,A24;
    then reconsider k=v.m as Element of NAT;
    assume
A52: v.m <> i;
    f/.m in rng Col(G,k) by A6,A23,A24;
    hence contradiction by A4,A7,A52,A51,Th3;
  end;
  1<=m & m<=len f by A6,FINSEQ_3:25;
  then 1<=len f by XXREAL_0:2;
  then
A53: len f in dom f by FINSEQ_3:25;
A54: v.(len v) = width G
  proof
    0<width G by MATRIX_0:44;
    then 0+1<=width G by NAT_1:13;
    then
A55: width G in Seg width G by FINSEQ_1:1;
A56: v.(len v) in Seg width G by A23,A29,A24,A53;
    then reconsider k=v.(len v) as Element of NAT;
    assume
A57: v.(len v) <> width G;
    f/.len f in rng Col(G,k) by A23,A29,A24,A53;
    hence contradiction by A2,A57,A56,A55,Th3;
  end;
A58: v<>{} by A1,A22;
  hence m+1 in dom f by A4,A5,A6,A22,A24,A28,A54,A30,A50,A25,SEQM_3:45;
  m+1 in dom v & v.(m+1)=i+1 by A4,A5,A6,A22,A24,A58,A28,A54,A30,A50,A25,
SEQM_3:45;
  hence thesis by A22,A23;
end;
