reserve x,y for set;
reserve G for Graph;
reserve vs,vs9 for FinSequence of the carrier of G;
reserve IT for oriented Chain of G;
reserve N for Nat;
reserve n,m,k,i,j for Nat;
reserve r,r1,r2 for Real;
reserve X for non empty set;

theorem Th17:
  for f being FinSequence of TOP-REAL 2 st f is s.n.c. & LSeg(f,1)
/\ LSeg(f,1+1) c= {f/.(1+1)} & LSeg(f,len f-'2) /\ LSeg(f,len f-'1) c= {f/.(len
  f-'1)} holds f is unfolded
proof
  let f be FinSequence of TOP-REAL 2;
  assume that
A1: f is s.n.c. and
A2: LSeg(f,1) /\ LSeg(f,1+1) c= {f/.(1+1)} and
A3: LSeg(f,len f-'2) /\ LSeg(f,len f-'1) c= {f/.(len f-'1)};
  for i be Nat st 1 <= i & i + 2 <= len f holds LSeg(f,i) /\ LSeg(f,i+1) =
  {f/.(i+1)}
  proof
    let i be Nat;
    assume that
A4: 1 <= i and
A5: i + 2 <= len f;
A6: 1<i+1 by A4,NAT_1:13;
    then
A7: LSeg(f,i+1)=LSeg(f/.(i+1),f/.(i+1+1)) by A5,TOPREAL1:def 3;
A8: 1<i+1+1 by A6,NAT_1:13;
    i+1+1=i+2;
    then
A9: i+1<len f by A5,NAT_1:13;
    then
A10: LSeg(f,i)=LSeg(f/.i,f/.(i+1)) by A4,TOPREAL1:def 3;
    f/.(i+1) in LSeg(f/.i,f/.(i+1)) & f/.(i+1) in LSeg(f/.(i+1),f/.(i+1+1
    )) by RLTOPSP1:68;
    then f/.(i+1) in LSeg(f,i) /\ LSeg(f,i+1) by A10,A7,XBOOLE_0:def 4;
    then
A11: {f/.(i+1)} c= LSeg(f,i) /\ LSeg(f,i+1) by ZFMISC_1:31;
A12: i<len f by A9,NAT_1:13;
    per cases;
    suppose
      i=1;
      hence thesis by A2,A11;
    end;
    suppose
A13:  i<>1;
      now
        per cases;
        case
A14:      i+2=len f;
          then len f-2=len f-'2 & len f-1=len f-'1 by A4,A6,NAT_D:39;
          hence thesis by A3,A11,A14;
        end;
        case
A15:      i+2<>len f;
          1<i by A4,A13,XXREAL_0:1;
          then 1+1<=i by NAT_1:13;
          then
A16:      1+1-1<=i-1 by XREAL_1:9;
          i+2<len f by A5,A15,XXREAL_0:1;
          then
A17:      i+1+1+1<=len f by NAT_1:13;
          now
            f/.(i+1) in LSeg(f,i+1) & f/.(i+1) in LSeg(f,i) by A10,A7,
RLTOPSP1:68;
            then f/.(i+1) in LSeg(f,i) /\ LSeg(f,i+1) by XBOOLE_0:def 4;
            then
A18:        {f/.(i+1)} c= LSeg(f,i) /\ LSeg(f,i+1) by ZFMISC_1:31;
            assume LSeg(f,i) /\ LSeg(f,i+1)<>{f/.(i+1)};
            then not LSeg(f,i) /\ LSeg(f,i+1) c= {f/.(i+1)} by A18;
            then consider x being object such that
A19:        x in LSeg(f,i) /\ LSeg(f,i+1) and
A20:        not x in {f/.(i+1)};
A21:        LSeg(f,i+1+1)=LSeg(f/.(i+1+1),f/.(i+1+1+1)) by A8,A17,
TOPREAL1:def 3;
A22:        x<>f/.(i+1) by A20,TARSKI:def 1;
            now
              per cases by A10,A7,A19,A22,Th16;
              case
A23:            f/.i in LSeg(f/.(i+1),f/.(i+1+1));
A24:            i-'1=i-1 by A4,XREAL_1:233;
                then i-'1+1<i+1 by NAT_1:13;
                then LSeg(f,i-'1) misses LSeg(f,i+1) by A1,TOPREAL1:def 7;
                then
A25:            LSeg(f,i-'1)/\ LSeg(f,i+1)={};
                LSeg(f,i-'1)=LSeg(f/.(i-'1),f/.(i-'1+1)) by A12,A16,A24,
TOPREAL1:def 3;
                then f/.i in LSeg(f,i-'1) by A24,RLTOPSP1:68;
                hence contradiction by A7,A23,A25,XBOOLE_0:def 4;
              end;
              case
A26:            f/.(i+1+1) in LSeg(f/.i,f/.(i+1));
                i+1<i+1+1 by NAT_1:13;
                then LSeg(f,i) misses LSeg(f,i+1+1) by A1,TOPREAL1:def 7;
                then
A27:            LSeg(f,i)/\ LSeg(f,i+1+1)={};
                f/.(i+1+1) in LSeg(f,i+1+1) by A21,RLTOPSP1:68;
                hence contradiction by A10,A26,A27,XBOOLE_0:def 4;
              end;
            end;
            hence contradiction;
          end;
          hence thesis;
        end;
      end;
      hence thesis;
    end;
  end;
  hence thesis by TOPREAL1:def 6;
end;
