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,j) in L~Upper_Seq(C,n) ex j1
be Nat st j <= j1 & j1 <= k & LSeg(Gauge(C,n)*(i,j1),Gauge(C,n)*(i,k
  )) /\ L~Upper_Seq(C,n) = {Gauge(C,n)*(i,j1)}
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,j) 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,j) 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 w2 = upper_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 j1 be Nat such that
A12: j <= j1 and
A13: j1 <= k and
A14: G*(i,j1)`2 = w2 by A4,A10,A8,JORDAN1F:2,JORDAN1G:4;
  set q = |[s,w2]|;
A15: j1 <= width G by A5,A13,XXREAL_0:2;
A16: G*(i,k)`1 = s by A1,A2,A5,A7,GOBOARD5:2;
  then f`1 = e`1 by A1,A2,A3,A11,GOBOARD5:2;
  then
A17: LSeg(f,e) is vertical by SPPOL_1:16;
  take j1;
  thus j <= j1 & j1 <= k by A12,A13;
  consider pp be object such that
A18: pp in N-most X1 by XBOOLE_0:def 1;
  reconsider pp as Point of TOP-REAL 2 by A18;
A19: pp in X by A18,XBOOLE_0:def 4;
  then
A20: pp in L~Upper_Seq(C,n) by XBOOLE_0:def 4;
A21: 1 <= j1 by A3,A12,XXREAL_0:2;
  then
A22: G*(i,j1)`1 = s by A1,A2,A15,GOBOARD5:2;
  then
A23: q = G*(i,j1) by A14,EUCLID:53;
  then
A24: q`2 <= e`2 by A1,A2,A5,A13,A21,SPRECT_3:12;
A25: q`2 = N-bound X by A14,A23,SPRECT_1:45
    .= (N-min X)`2 by EUCLID:52
    .= pp`2 by A18,PSCOMP_1:39;
  pp in LSeg(G*(i,j),G*(i,k)) by A19,XBOOLE_0:def 4;
  then pp`1 = q`1 by A16,A22,A23,A17,SPPOL_1:41;
  then
A26: q in L~Upper_Seq(C,n) by A20,A25,TOPREAL3:6;
  for x be object holds x in LSeg(e,q) /\ L~Upper_Seq(C,n) iff x = q
  proof
    let x be object;
    thus x in LSeg(e,q) /\ L~Upper_Seq(C,n) implies x = q
    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:  e in LSeg(f,e) by RLTOPSP1:68;
A28:  f`2 <= q`2 by A1,A2,A3,A12,A15,A23,SPRECT_3:12;
      f`1 = q`1 by A1,A2,A3,A11,A22,A23,GOBOARD5:2;
      then q in LSeg(e,f) by A16,A22,A23,A24,A28,GOBOARD7:7;
      then
A29:  LSeg(e,q) c= LSeg(f,e) by A27,TOPREAL1:6;
      assume
A30:  x in LSeg(e,q) /\ L~Upper_Seq(C,n);
      then reconsider pp = x as Point of TOP-REAL 2;
A31:  pp in LSeg(e,q) by A30,XBOOLE_0:def 4;
      then
A32:  pp`2 >= q`2 by A24,TOPREAL1:4;
      pp in L~Upper_Seq(C,n) by A30,XBOOLE_0:def 4;
      then pp in EE by A31,A29,XBOOLE_0:def 4;
      then proj2.pp in E0 by FUNCT_2:35;
      then
A33:  pp`2 in E0 by PSCOMP_1:def 6;
      E0 is real-bounded by RCOMP_1:10;
      then E0 is bounded_above by XXREAL_2:def 11;
      then q`2 >= pp`2 by A14,A23,A33,SEQ_4:def 1;
      then
A34:  pp`2 = q`2 by A32,XXREAL_0:1;
      pp`1 = q`1 by A16,A22,A23,A31,GOBOARD7:5;
      hence thesis by A34,TOPREAL3:6;
    end;
    assume
A35: x = q;
    then x in LSeg(e,q) by RLTOPSP1:68;
    hence thesis by A26,A35,XBOOLE_0:def 4;
  end;
  hence thesis by A23,TARSKI:def 1;
end;
