reserve n for Nat;

theorem Th46:
  for C be compact connected non vertical non horizontal Subset of
  TOP-REAL 2 for p be Point of TOP-REAL 2 holds p in L~Upper_Seq(C,n) & p`1 =
  E-bound L~Cage(C,n) implies p = E-max L~Cage(C,n)
proof
  let C be compact connected non vertical non horizontal Subset of TOP-REAL 2;
  let p be Point of TOP-REAL 2;
  set Ca = Cage(C,n);
  set US = Upper_Seq(C,n);
  set LS = Lower_Seq(C,n);
  set Wmin = W-min L~Ca;
  set Smax = S-max L~Ca;
  set Smin = S-min L~Ca;
  set Emin = E-min L~Ca;
  set Emax = E-max L~Ca;
  set Wbo = W-bound L~Cage(C,n);
  set Nbo = N-bound L~Cage(C,n);
  set Ebo = E-bound L~Cage(C,n);
  set Sbo = S-bound L~Cage(C,n);
  set NE = NE-corner L~Ca;
  assume that
A1: p in L~Upper_Seq(C,n) and
A2: p`1 = E-bound L~Cage(C,n) and
A3: p <> E-max L~Cage(C,n);
A4: US/.1 = Wmin by JORDAN1F:5;
  1 in dom US by FINSEQ_5:6;
  then
A5: US.1 = Wmin by A4,PARTFUN1:def 6;
  Wbo <> Ebo by SPRECT_1:31;
  then p <> US.1 by A2,A5,EUCLID:52;
  then reconsider
  g = R_Cut(US,p) as being_S-Seq FinSequence of TOP-REAL 2 by A1,JORDAN3:35;
  <*p*> is_in_the_area_of Ca by A1,JORDAN1E:17,SPRECT_3:46;
  then
A6: g is_in_the_area_of Ca by A1,JORDAN1E:17,SPRECT_3:52;
  len g in dom g by FINSEQ_5:6;
  then
A7: g/.len g = g.len g by PARTFUN1:def 6
    .= p by A1,JORDAN3:24;
  (g/.1)`1 = (US/.1)`1 by A1,SPRECT_3:22
    .= Wmin`1 by JORDAN1F:5
    .= Wbo by EUCLID:52;
  then
A8: g is_a_h.c._for Ca by A2,A6,A7,SPRECT_2:def 2;
A9: LS/.1 = Emax by JORDAN1F:6;
  1 in dom LS by FINSEQ_5:6;
  then
A10: LS.1 = Emax by A9,PARTFUN1:def 6;
  len Cage(C,n) > 4 by GOBOARD7:34;
  then
A11: rng Cage(C,n) c= L~Cage(C,n) by SPPOL_2:18,XXREAL_0:2;
  now
    per cases;
    suppose
A12:  Emax <> NE;
A13:  not NE in rng Cage(C,n)
      proof
A14:    NE`1 = E-bound L~Cage(C,n) by EUCLID:52;
A15:    NE`2 = N-bound L~Cage(C,n) by EUCLID:52;
        then NE`2 >= S-bound L~Cage(C,n) by SPRECT_1:22;
        then NE in { p1 where p1 is Point of TOP-REAL 2 : p1`1 = E-bound L~
Cage(C,n) & p1`2 <= N-bound L~Cage(C,n) & p1`2 >= S-bound L~Cage(C,n) } by A14
,A15;
        then
A16:    NE in LSeg(SE-corner L~Cage(C,n), NE-corner L~Cage(C,n)) by SPRECT_1:23
;
        assume NE in rng Cage(C,n);
        then NE in LSeg(SE-corner L~Cage(C,n), NE-corner L~Cage(C,n)) /\ L~
        Cage(C,n) by A11,A16,XBOOLE_0:def 4;
        then
A17:    NE`2 <= (E-max L~Cage(C,n))`2 by PSCOMP_1:47;
A18:    (E-max L~Cage(C,n))`1 = NE`1 by PSCOMP_1:45;
        (E-max L~Cage(C,n))`2 <= NE`2 by PSCOMP_1:46;
        then (E-max L~Cage(C,n))`2 = NE`2 by A17,XXREAL_0:1;
        hence contradiction by A12,A18,TOPREAL3:6;
      end;
      Smax in rng LS by Th12;
      then R_Cut(LS,Smax) = mid(LS,1,Smax..LS) by JORDAN1G:49;
      then
A19:  rng R_Cut(LS,Smax) c= rng LS by FINSEQ_6:119;
      rng LS c= rng Ca by JORDAN1G:39;
      then rng R_Cut(LS,Smax) c= rng Ca by A19;
      then not NE in rng R_Cut(LS,Smax) by A13;
      then rng R_Cut(LS,Smax) misses {NE} by ZFMISC_1:50;
      then rng R_Cut(LS,Smax) misses rng <*NE*> by FINSEQ_1:38;
      then
A20:  rng Rev R_Cut(LS,Smax) misses rng <*NE*> by FINSEQ_5:57;
      set h = Rev R_Cut(LS,Smax)^<*NE*>;
A21:  <*NE*> is one-to-one by FINSEQ_3:93;
A22:  (h/.len h)`2 = (h/.(len Rev R_Cut(LS,Smax)+1))`2 by FINSEQ_2:16
        .= NE`2 by FINSEQ_4:67
        .= Nbo by EUCLID:52;
      Emin in L~Ca by SPRECT_1:14;
      then
A23:  Sbo <= Emin`2 by PSCOMP_1:24;
A24:  Index(Smax,LS)+1 >= 0+1 by XREAL_1:7;
A25:  Smax in L~LS by Th12;
      then <*Smax*> is_in_the_area_of Ca by JORDAN1E:18,SPRECT_3:46;
      then R_Cut(LS,Smax) is_in_the_area_of Ca by A25,JORDAN1E:18,SPRECT_3:52;
      then
A26:  Rev R_Cut(LS,Smax) is_in_the_area_of Ca by SPRECT_3:51;
      Emin`2 < Emax`2 by SPRECT_2:53;
      then
A27:  Smax <> LS.1 by A10,A23,EUCLID:52;
      then reconsider RCutLS = R_Cut(LS,Smax) as being_S-Seq FinSequence of
      TOP-REAL 2 by A25,JORDAN3:35;
      len h = len Rev R_Cut(LS,Smax) + 1 by FINSEQ_2:16
        .= len R_Cut(LS,Smax) + 1 by FINSEQ_5:def 3
        .= Index(Smax,LS)+1+1 by A25,A27,JORDAN3:25;
      then
A28:  len h >= 1+1 by A24,XREAL_1:7;
A29:  2 <= len g by TOPREAL1:def 8;
      1 in dom Rev RCutLS by FINSEQ_5:6;
      then h/.1 = Rev RCutLS/.1 by FINSEQ_4:68
        .= R_Cut(LS,Smax)/.len R_Cut(LS,Smax) by FINSEQ_5:65
        .= Smax by A25,Th45;
      then
A30:  (h/.1)`2 = Sbo by EUCLID:52;
      <*NE*> is_in_the_area_of Ca by SPRECT_2:25;
      then h is_in_the_area_of Ca by A26,SPRECT_2:24;
      then
A31:  h is_a_v.c._for Ca by A30,A22,SPRECT_2:def 3;
A32:  len LS in dom LS by FINSEQ_5:6;
A33:  Rev RCutLS/.len Rev RCutLS = Rev RCutLS/.len RCutLS by FINSEQ_5:def 3
        .= RCutLS/.1 by FINSEQ_5:65
        .= LS/.1 by A25,SPRECT_3:22
        .= Emax by JORDAN1F:6;
      then (Rev RCutLS/.len Rev RCutLS)`1 = E-bound L~Ca by EUCLID:52
        .= NE`1 by EUCLID:52
        .= (<*NE*>/.1)`1 by FINSEQ_4:16;
      then h is one-to-one special by A20,A21,FINSEQ_3:91,GOBOARD2:8;
      then L~g meets L~h by A8,A29,A28,A31,SPRECT_2:29;
      then consider x be object such that
A34:  x in L~g and
A35:  x in L~h by XBOOLE_0:3;
      reconsider x as Point of TOP-REAL 2 by A34;
A36:  L~h = L~Rev RCutLS \/ LSeg(Rev RCutLS/.len Rev RCutLS,NE) by SPPOL_2:19;
A37:  L~RCutLS c= L~LS by Th12,JORDAN3:41;
A38:  len US in dom US by FINSEQ_5:6;
A39:  L~g c= L~US by A1,JORDAN3:41;
      then
A40:  x in L~US by A34;
      now
        per cases by A35,A36,XBOOLE_0:def 3;
        suppose
          x in L~Rev RCutLS;
          then
A41:      x in L~RCutLS by SPPOL_2:22;
          then x in L~US /\ L~LS by A34,A39,A37,XBOOLE_0:def 4;
          then
A42:      x in {Wmin,Emax} by JORDAN1E:16;
          now
            per cases by A42,TARSKI:def 2;
            suppose
              x = Wmin;
              then LS/.len LS in L~R_Cut(LS,Smax) by A41,JORDAN1F:8;
              then LS.len LS in L~R_Cut(LS,Smax) by A32,PARTFUN1:def 6;
              then LS.len LS = Smax by A25,Th43;
              then LS/.len LS = Smax by A32,PARTFUN1:def 6;
              then
A43:          Wmin = Smax by JORDAN1F:8;
              Smin in L~Ca by SPRECT_1:12;
              then
A44:          Wbo <= Smin`1 by PSCOMP_1:24;
              Smin`1 < Smax`1 by SPRECT_2:55;
              hence contradiction by A43,A44,EUCLID:52;
            end;
            suppose
              x = Emax;
              then US/.len US in L~R_Cut(US,p) by A34,JORDAN1F:7;
              then US.len US in L~R_Cut(US,p) by A38,PARTFUN1:def 6;
              then US.len US = p by A1,Th43;
              then US/.len US = p by A38,PARTFUN1:def 6;
              hence contradiction by A3,JORDAN1F:7;
            end;
          end;
          hence contradiction;
        end;
        suppose
A45:      x in LSeg(Rev RCutLS/.len Rev RCutLS,NE);
          Emax`2 <= NE`2 by PSCOMP_1:46;
          then
A46:      Emax`2 <= x`2 by A33,A45,TOPREAL1:4;
A47:      Emax`1 = Ebo by EUCLID:52;
          NE`1 = Ebo by EUCLID:52;
          then
A48:      x`1 = Ebo by A33,A45,A47,GOBOARD7:5;
          L~Ca = L~US \/ L~LS by JORDAN1E:13;
          then L~US c= L~Ca by XBOOLE_1:7;
          then x in E-most L~Ca by A40,A48,SPRECT_2:13;
          then x`2 <= Emax`2 by PSCOMP_1:47;
          then x`2 = Emax`2 by A46,XXREAL_0:1;
          then x = Emax by A47,A48,TOPREAL3:6;
          then US/.len US in L~R_Cut(US,p) by A34,JORDAN1F:7;
          then US.len US in L~R_Cut(US,p) by A38,PARTFUN1:def 6;
          then US.len US = p by A1,Th43;
          then US/.len US = p by A38,PARTFUN1:def 6;
          hence contradiction by A3,JORDAN1F:7;
        end;
      end;
      hence contradiction;
    end;
    suppose
A49:  Emax = NE;
      Emin in L~Ca by SPRECT_1:14;
      then
A50:  Sbo <= Emin`2 by PSCOMP_1:24;
      set h = Rev R_Cut(LS,Smax);
A51:  2 <= len g by TOPREAL1:def 8;
A52:  Smax in L~LS by Th12;
      then <*Smax*> is_in_the_area_of Ca by JORDAN1E:18,SPRECT_3:46;
      then R_Cut(LS,Smax) is_in_the_area_of Ca by A52,JORDAN1E:18,SPRECT_3:52;
      then
A53:  h is_in_the_area_of Ca by SPRECT_3:51;
      Emin`2 < Emax`2 by SPRECT_2:53;
      then Smax <> LS.1 by A10,A50,EUCLID:52;
      then reconsider RCutLS = R_Cut(LS,Smax) as being_S-Seq FinSequence of
      TOP-REAL 2 by A52,JORDAN3:35;
      1 in dom Rev RCutLS by FINSEQ_5:6;
      then h/.1 = R_Cut(LS,Smax)/.len R_Cut(LS,Smax) by FINSEQ_5:65
        .= Smax by A52,Th45;
      then
A54:  (h/.1)`2 = Sbo by EUCLID:52;
A55:  Rev RCutLS is special;
      len RCutLS >= 2 by TOPREAL1:def 8;
      then
A56:  len h >= 2 by FINSEQ_5:def 3;
      Rev RCutLS/.len Rev RCutLS = Rev RCutLS/.len RCutLS by FINSEQ_5:def 3
        .= RCutLS/.1 by FINSEQ_5:65
        .= LS/.1 by A52,SPRECT_3:22
        .= Emax by JORDAN1F:6;
      then (h/.len h)`2 = Nbo by A49,EUCLID:52;
      then h is_a_v.c._for Ca by A53,A54,SPRECT_2:def 3;
      then L~g meets L~h by A8,A55,A51,A56,SPRECT_2:29;
      then consider x be object such that
A57:  x in L~g and
A58:  x in L~h by XBOOLE_0:3;
      reconsider x as Point of TOP-REAL 2 by A57;
A59:  x in L~RCutLS by A58,SPPOL_2:22;
A60:  L~g c= L~US by A1,JORDAN3:41;
A61:  len US in dom US by FINSEQ_5:6;
A62:  len LS in dom LS by FINSEQ_5:6;
      L~RCutLS c= L~LS by Th12,JORDAN3:41;
      then x in L~US /\ L~LS by A57,A60,A59,XBOOLE_0:def 4;
      then
A63:  x in {Wmin,Emax} by JORDAN1E:16;
      now
        per cases by A63,TARSKI:def 2;
        suppose
          x = Wmin;
          then LS/.len LS in L~R_Cut(LS,Smax) by A59,JORDAN1F:8;
          then LS.len LS in L~R_Cut(LS,Smax) by A62,PARTFUN1:def 6;
          then LS.len LS = Smax by A52,Th43;
          then LS/.len LS = Smax by A62,PARTFUN1:def 6;
          then
A64:      Wmin = Smax by JORDAN1F:8;
          Smin in L~Ca by SPRECT_1:12;
          then
A65:      Wbo <= Smin`1 by PSCOMP_1:24;
          Smin`1 < Smax`1 by SPRECT_2:55;
          hence contradiction by A64,A65,EUCLID:52;
        end;
        suppose
          x = Emax;
          then US/.len US in L~R_Cut(US,p) by A57,JORDAN1F:7;
          then US.len US in L~R_Cut(US,p) by A61,PARTFUN1:def 6;
          then US.len US = p by A1,Th43;
          then US/.len US = p by A61,PARTFUN1:def 6;
          hence contradiction by A3,JORDAN1F:7;
        end;
      end;
      hence contradiction;
    end;
  end;
  hence contradiction;
end;
