reserve n for Nat;

theorem
  for C be compact connected non vertical non horizontal Subset of
TOP-REAL 2 for i,j,k be Nat st 1 <= i & i <= len Gauge(C,n) & 1 <= j
  & j <= k & k <= width Gauge(C,n) & Gauge(C,n)*(i,k) in L~Upper_Seq(C,n) ex k1
be Nat st j <= k1 & k1 <= k & LSeg(Gauge(C,n)*(i,j),Gauge(C,n)*(i,k1
  )) /\ L~Upper_Seq(C,n) = {Gauge(C,n)*(i,k1)}
proof
  let C be compact connected non vertical non horizontal Subset of TOP-REAL 2;
  let i,j,k be Nat;
  assume that
A1: 1 <= i and
A2: i <= len Gauge(C,n) and
A3: 1 <= j and
A4: j <= k and
A5: k <= width Gauge(C,n) and
A6: Gauge(C,n)*(i,k) in L~Upper_Seq(C,n);
  set G = Gauge(C,n);
A7: k >= 1 by A3,A4,XXREAL_0:2;
  then
A8: [i,k] in Indices G by A1,A2,A5,MATRIX_0:30;
  set X = LSeg(G*(i,j),G*(i,k)) /\ L~Upper_Seq(C,n);
A9: G*(i,k) in LSeg(G*(i,j),G*(i,k)) by RLTOPSP1:68;
  then reconsider X1=X as non empty compact Subset of TOP-REAL 2 by A6,
XBOOLE_0:def 4;
A10: LSeg(G*(i,j),G*(i,k)) meets L~Upper_Seq(C,n) by A6,A9,XBOOLE_0:3;
  set s = G*(i,1)`1;
  set e = G*(i,k);
  set f = G*(i,j);
  set w1 = lower_bound(proj2.:(LSeg(f,e) /\ L~Upper_Seq(C,n)));
A11: j <= width G by A4,A5,XXREAL_0:2;
  then [i,j] in Indices G by A1,A2,A3,MATRIX_0:30;
  then consider k1 be Nat such that
A12: j <= k1 and
A13: k1 <= k and
A14: G*(i,k1)`2 = w1 by A4,A10,A8,JORDAN1F:1,JORDAN1G:4;
  set p = |[s,w1]|;
A15: k1 <= width G by A5,A13,XXREAL_0:2;
  f`1 = s by A1,A2,A3,A11,GOBOARD5:2
    .= e`1 by A1,A2,A5,A7,GOBOARD5:2;
  then
A16: LSeg(f,e) is vertical by SPPOL_1:16;
  take k1;
  thus j <= k1 & k1 <= k by A12,A13;
  consider pp be object such that
A17: pp in S-most X1 by XBOOLE_0:def 1;
A18: 1 <= k1 by A3,A12,XXREAL_0:2;
  then
A19: G*(i,k1)`1 = s by A1,A2,A15,GOBOARD5:2;
  then
A20: p = G*(i,k1) by A14,EUCLID:53;
  then
A21: f`2 <= p`2 by A1,A2,A3,A12,A15,SPRECT_3:12;
A22: f`1 = p`1 by A1,A2,A3,A11,A19,A20,GOBOARD5:2;
  reconsider pp as Point of TOP-REAL 2 by A17;
A23: pp in X by A17,XBOOLE_0:def 4;
  then
A24: pp in L~Upper_Seq(C,n) by XBOOLE_0:def 4;
A25: p`2 = S-bound X by A14,A20,SPRECT_1:44
    .= (S-min X)`2 by EUCLID:52
    .= pp`2 by A17,PSCOMP_1:55;
  pp in LSeg(G*(i,j),G*(i,k)) by A23,XBOOLE_0:def 4;
  then pp`1 = p`1 by A22,A16,SPPOL_1:41;
  then
A26: p in L~Upper_Seq(C,n) by A24,A25,TOPREAL3:6;
  for x be object holds x in LSeg(p,f) /\ L~Upper_Seq(C,n) iff x = p
  proof
    let x be object;
    thus x in LSeg(p,f) /\ L~Upper_Seq(C,n) implies x = p
    proof
      reconsider EE = LSeg(f,e) /\ L~Upper_Seq(C,n) as compact Subset of
      TOP-REAL 2;
      reconsider E0 = proj2.:EE as compact Subset of REAL by JCT_MISC:15;
A27:  f in LSeg(f,e) by RLTOPSP1:68;
A28:  e`1 = p`1 by A1,A2,A5,A7,A19,A20,GOBOARD5:2;
A29:  p`2 <= e`2 by A1,A2,A5,A13,A18,A20,SPRECT_3:12;
A30:  f`2 <= p`2 by A1,A2,A3,A12,A15,A20,SPRECT_3:12;
      f`1 = p`1 by A1,A2,A3,A11,A19,A20,GOBOARD5:2;
      then p in LSeg(f,e) by A28,A30,A29,GOBOARD7:7;
      then
A31:  LSeg(p,f) c= LSeg(f,e) by A27,TOPREAL1:6;
      assume
A32:  x in LSeg(p,f) /\ L~Upper_Seq(C,n);
      then reconsider pp = x as Point of TOP-REAL 2;
A33:  pp in LSeg(p,f) by A32,XBOOLE_0:def 4;
      then
A34:  pp`2 <= p`2 by A21,TOPREAL1:4;
      pp in L~Upper_Seq(C,n) by A32,XBOOLE_0:def 4;
      then pp in EE by A33,A31,XBOOLE_0:def 4;
      then proj2.pp in E0 by FUNCT_2:35;
      then
A35:  pp`2 in E0 by PSCOMP_1:def 6;
      E0 is real-bounded by RCOMP_1:10;
      then E0 is bounded_below by XXREAL_2:def 11;
      then p`2 <= pp`2 by A14,A20,A35,SEQ_4:def 2;
      then
A36:  pp`2 = p`2 by A34,XXREAL_0:1;
      pp`1 = p`1 by A22,A33,GOBOARD7:5;
      hence thesis by A36,TOPREAL3:6;
    end;
    assume
A37: x = p;
    then x in LSeg(p,f) by RLTOPSP1:68;
    hence thesis by A26,A37,XBOOLE_0:def 4;
  end;
  hence thesis by A20,TARSKI:def 1;
end;
