reserve P for Subset of TOP-REAL 2,
  f,f1,f2,g for FinSequence of TOP-REAL 2,
  p,p1,p2,q,q1,q2 for Point of TOP-REAL 2,
  r1,r2,r19,r29 for Real,
  i,j,k,n for Nat;

theorem Th29:
  g is unfolded & LSeg(p,g/.1) /\ LSeg(g,1) = {g/.1} implies <*p*>
  ^g is unfolded
proof
  set f = <*p*>;
A1: len f = 1 by FINSEQ_1:39;
A2: f/.1 = p by FINSEQ_4:16;
A3: len(f^g) = len f + len g by FINSEQ_1:22;
  assume that
A4: g is unfolded and
A5: LSeg(p,g/.1) /\ LSeg(g,1) = {g/.1};
  let i be Nat such that
A6: 1 <= i and
A7: i + 2 <= len(f^g);
A8: i+(1+1) = i+1+1;
  per cases;
  suppose
A9: i = len f;
    then
A10: LSeg(f^g,i+1) = LSeg(g,1) by Th7;
    now
      i <= i+1 by NAT_1:11;
      then
A11:  i < i+(1+1) by A8,NAT_1:13;
      assume len g = 0;
      hence contradiction by A1,A6,A7,A3,A11,XXREAL_0:2;
    end;
    then 1 <= len g by NAT_1:14;
    then
A12: 1 in dom g by FINSEQ_3:25;
    then LSeg(f^g,i) = LSeg(f/.len f,g/.1) by A9,Th8,RELAT_1:38;
    hence thesis by A1,A5,A2,A9,A12,A10,FINSEQ_4:69;
  end;
  suppose
A13: i <> len f;
    reconsider j = i - len f as Element of NAT by A1,A6,INT_1:5;
    i > len f by A1,A6,A13,XXREAL_0:1;
    then len f + 1 <= i by NAT_1:13;
    then
A14: 1 <= j by XREAL_1:19;
A15: i+2-len f <= len g by A7,A3,XREAL_1:20;
    then
A16: j+(1+1) <= len g;
    j+1 <= j+1+1 by NAT_1:11;
    then j+1 <= len g by A15,XXREAL_0:2;
    then
A17: j+1 in dom g by A14,SEQ_4:134;
A18: len f + (j+1) = i+1;
    len f + j = i;
    hence LSeg(f^g,i) /\ LSeg(f^g,i+1) = LSeg(g,j) /\ LSeg(f^g,i+1) by A14,Th7
      .= LSeg(g,j) /\ LSeg(g,j+1) by A18,Th7,NAT_1:11
      .= {g/.(j+1)} by A4,A14,A16
      .= {(f^g)/.(i+1)} by A18,A17,FINSEQ_4:69;
  end;
end;
