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 Th32:
  f is unfolded & p in LSeg(f,n) implies Ins(f,n,p) is unfolded
proof
  assume that
A1: f is unfolded and
A2: p in LSeg(f,n);
  set f1 = f|n, g1 = f1^<*p*>, f2 = f/^n;
A3: n+1 <= len f by A2,TOPREAL1:def 3;
A4: n <= n+1 by NAT_1:11;
  then
A5: len f1 = n by A3,FINSEQ_1:59,XXREAL_0:2;
  then
A6: n+1 = len g1 by FINSEQ_2:16;
A7: n <= len f by A3,A4,XXREAL_0:2;
  1 <= len f - n by A3,XREAL_1:19;
  then
A8: 1 <= len f2 by A7,RFINSEQ:def 1;
  then ZZ: 1 in dom f2 by FINSEQ_3:25;
  then
A9: f/.(n+1) = f2/.1 by FINSEQ_5:27;
A10: 1 <= n by A2,TOPREAL1:def 3;
  then
A11: LSeg(f,n) = LSeg(f/.n,f/.(n+1)) by A3,TOPREAL1:def 3;
A12: n in dom f1 by A10,A5,FINSEQ_3:25;
  then
A13: f/.n = f1/.len f1 by A5,FINSEQ_4:70;
A14: g1/.len g1 = g1/.(len f1 + 1) by FINSEQ_2:16
    .= p by FINSEQ_4:67;
  then
A15: LSeg(f1/.len f1,p) \/ LSeg(g1/.len g1,f2/.1) = LSeg(f1/.len f1,f2/.1)
  by A2,A11,A13,A9,TOPREAL1:5;
A16: now
    len f1 <> 0 by A2,A5,TOPREAL1:def 3;
    then consider k be Nat such that
A17: k+1 = len f1 by NAT_1:6;
    reconsider k as Element of NAT by ORDINAL1:def 12;
A18: k+(1+1) <= len f by A3,A5,A17;
    per cases;
    suppose
      k <> 0;
      then
A19:  1 <= k by NAT_1:14;
      LSeg(f1,k) = LSeg(f,k) by A17,Th3;
      then
A20:  LSeg(f1,k) /\ LSeg(f,n) = {f/.n} by A1,A5,A17,A18,A19;
      now
        let x be object;
        hereby
          assume
A21:      x in LSeg(f1,k) /\ LSeg(f1/.len f1,p);
          then x in LSeg(f1/.len f1,p) by XBOOLE_0:def 4;
          then
A22:      x in LSeg(f,n) by A11,A13,A9,A15,XBOOLE_0:def 3;
          x in LSeg(f1,k) by A21,XBOOLE_0:def 4;
          then x in LSeg(f1,k) /\ LSeg(f,n) by A22,XBOOLE_0:def 4;
          hence x = f/.n by A20,TARSKI:def 1;
        end;
        assume
A23:    x = f/.n;
        then x in LSeg(f1,k) /\ LSeg(f,n) by A20,TARSKI:def 1;
        then
A24:    x in LSeg(f1,k) by XBOOLE_0:def 4;
        x in LSeg(f1/.len f1,p) by A13,A23,RLTOPSP1:68;
        hence x in LSeg(f1,k) /\ LSeg(f1/.len f1,p) by A24,XBOOLE_0:def 4;
      end;
      then LSeg(f1,k) /\ LSeg(f1/.len f1,p) = {f1/.len f1} by A13,TARSKI:def 1;
      hence g1 is unfolded by A1,A17,Th30;
    end;
    suppose
      k = 0;
      then len g1 = 1+1 by A17,FINSEQ_2:16;
      hence g1 is unfolded by Th26;
    end;
  end;
  f1/.len f1 = g1/.n by A5,A12,FINSEQ_4:68;
  then LSeg(g1,n) = LSeg(f1/.len f1,g1/.len g1) by A10,A6,TOPREAL1:def 3;
  then
A25: LSeg(g1,n) /\ LSeg(g1/.len g1,f2/.1) = {g1/.len g1} by A2,A14,A11,A13,A9,
TOPREAL1:8;
  now
    per cases;
    suppose
      len f2 = 1;
      then f2 = <*f2.1*> by FINSEQ_5:14 .= <*f2/.1*> by ZZ,PARTFUN1:def 6;
      hence g1^f2 is unfolded by A16,A6,A25,Th30;
    end;
    suppose
      len f2 <> 1;
      then len f2 > 1 by A8,XXREAL_0:1;
      then
A26:  1+1 <= len f2 by NAT_1:13;
      then LSeg(f2,1) = LSeg(f2/.1,f2/.(1+1)) by TOPREAL1:def 3;
      then
A27:  f2/.1 in LSeg(f2,1) by RLTOPSP1:68;
A28:  1+1 <= len f - n by A7,A26,RFINSEQ:def 1;
      then n+(1+1) <= len f by XREAL_1:19;
      then
A29:  {f/.(n+1)} = LSeg(f,n) /\ LSeg(f,n+1) by A1,A10
        .= LSeg(f,n) /\ LSeg(f2,1) by A28,Th5;
      now
        let x be object;
        hereby
          assume
A30:      x in LSeg(g1/.len g1,f2/.1) /\ LSeg(f2,1);
          then x in LSeg(g1/.len g1,f2/.1) by XBOOLE_0:def 4;
          then
A31:      x in LSeg(f,n) by A11,A13,A9,A15,XBOOLE_0:def 3;
          x in LSeg(f2,1) by A30,XBOOLE_0:def 4;
          then x in LSeg(f,n) /\ LSeg(f2,1) by A31,XBOOLE_0:def 4;
          hence x = f2/.1 by A9,A29,TARSKI:def 1;
        end;
        assume
A32:    x = f2/.1;
        then x in LSeg(g1/.len g1,f2/.1) by RLTOPSP1:68;
        hence x in LSeg(g1/.len g1,f2/.1) /\ LSeg(f2,1) by A27,A32,
XBOOLE_0:def 4;
      end;
      then LSeg(g1/.len g1,f2/.1) /\ LSeg(f2,1) = {f2/.1} by TARSKI:def 1;
      hence g1^f2 is unfolded by A1,A16,A6,A25,Th31;
    end;
  end;
  hence thesis by FINSEQ_5:def 4;
end;
