reserve C for Simple_closed_curve,
  p,q,p1 for Point of TOP-REAL 2,
  i,j,k,n for Nat,
  r,s for Real;

theorem Th35:
  for S being Segmentation of C ex F being finite non empty Subset of REAL st
  F = { dist_min(Segm(S,i),Segm(S,j)):
  1<=i & i<j & j<=len S & Segm(S,i) misses Segm(S,j)} & S-Gap S = min F
proof
  let S be Segmentation of C;
  consider S1,S2 being non empty finite Subset of REAL such that
A1: S1 = { dist_min(Segm(S,i),Segm(S,j)) where i,j is Element of NAT:
  1<=i & i< j & j<len S & i,j aren't_adjacent} and
A2: S2 = { dist_min(Segm(S,len S),Segm(S,k)) where k is Element of NAT:
1<k & k<len S -' 1 } and
A3: S-Gap S = min(min S1,min S2) by Def7;
  take F = S1 \/ S2;
  set X = { dist_min(Segm(S,i),Segm(S,j)):
  1<=i & i<j & j<=len S & Segm(S,i) misses Segm(S,j)};
  thus F c= X
  proof
    let e be object;
    assume
A4: e in F;
    per cases by A4,XBOOLE_0:def 3;
    suppose e in S1;
      then consider i,j being Element of NAT such that
A5:   e = dist_min(Segm(S,i),Segm(S,j)) and
A6:   1<=i and
A7:   i< j and
A8:   j<len S and
A9:   i,j aren't_adjacent by A1;
      Segm(S,i) misses Segm(S,j) by A6,A7,A8,A9,Th24;
      hence thesis by A5,A6,A7,A8;
    end;
    suppose e in S2;
      then consider j being Element of NAT such that
A10:  e = dist_min(Segm(S,len S),Segm(S,j)) and
A11:  1<j and
A12:  j<len S -' 1 by A2;
A13:  j < len S by A12,NAT_D:44;
      Segm(S,len S) misses Segm(S,j) by A11,A12,Th25;
      hence thesis by A10,A11,A13;
    end;
  end;
  thus X c= F
  proof
    let e be object;
    assume e in X;
    then consider i,j such that
A14: e = dist_min(Segm(S,i),Segm(S,j)) and
A15: 1<=i and
A16: i<j and
A17: j<=len S and
A18: Segm(S,i) misses Segm(S,j);
A19: i < len S by A16,A17,XXREAL_0:2;
A20: i in NAT & j in NAT by ORDINAL1:def 12;
    per cases by A17,XXREAL_0:1;
    suppose that
A21:  j < len S;
      i,j aren't_adjacent by A15,A16,A18,A21,Th27;
      then e in S1 by A1,A14,A15,A16,A21,A20;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose
A22:  j = len S;
      then 1 <> i by A18,Th29;
      then
A23:  1 < i by A15,XXREAL_0:1;
A24:  i <= len S -' 1 by A19,NAT_D:49;
      i <> len S -' 1 by A18,A22,Th31;
      then i < len S -' 1 by A24,XXREAL_0:1;
      then e in S2 by A2,A14,A22,A23,A20;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
  thus thesis by A3,XXREAL_2:9;
end;
