reserve n for Nat;

theorem Th31:
  for C be compact connected non vertical non horizontal Subset of
  TOP-REAL 2 holds (Upper_Seq(C,n)/.2)`1 = W-bound L~Cage(C,n)
proof
  let C be compact connected non vertical non horizontal Subset of TOP-REAL 2;
  set Ca = Cage(C,n);
  set US = Upper_Seq(C,n);
  set Wmin = W-min L~Cage(C,n);
  set Emax = E-max L~Cage(C,n);
  set Nmin = N-min L~Cage(C,n);
  Emax in rng Ca by SPRECT_2:46;
  then
A1: Emax in rng Rotate(Ca,Wmin) by FINSEQ_6:90,SPRECT_2:43;
  len US >= 3 by JORDAN1E:15;
  then len US >= 2 by XXREAL_0:2;
  then 2 in Seg len US by FINSEQ_1:1;
  then
A2: 2 in Seg(Emax..Rotate(Ca,Wmin)) by JORDAN1E:8;
  (Ca:-Wmin)/.1 = Wmin by FINSEQ_5:53;
  then
A3: Wmin in rng (Ca:-Wmin) by FINSEQ_6:42;
  Ca/.1 = Nmin by JORDAN9:32;
  then Wmin..Ca < len Ca by SPRECT_2:76;
  then
A4: Wmin..Ca+1 <= len Ca by NAT_1:13;
  W-max L~Ca in L~Ca & Nmin`2 = N-bound L~Ca by EUCLID:52,SPRECT_1:13;
  then (W-max L~Ca)`2 <= Nmin`2 by PSCOMP_1:24;
  then Nmin <> Wmin by SPRECT_2:57;
  then
A5: card {Nmin,Wmin} = 2 by CARD_2:57;
A6: Wmin in rng Ca by SPRECT_2:43;
  then
A7: 1 <= Wmin..Ca by FINSEQ_4:21;
  (Ca:-Wmin)/.len(Ca:-Wmin) = Ca/.len Ca by A6,FINSEQ_5:54
    .= Ca/.1 by FINSEQ_6:def 1
    .= Nmin by JORDAN9:32;
  then
A8: Nmin in rng (Ca:-Wmin) by FINSEQ_6:168;
  {Nmin,Wmin} c= rng (Ca:-Wmin)
  by A8,A3,TARSKI:def 2;
  then
A9: card {Nmin,Wmin} c= card rng (Ca:-Wmin) by CARD_1:11;
  card rng (Ca:-Wmin) c= card dom (Ca:-Wmin) by CARD_2:61;
  then card rng (Ca:-Wmin) c= len (Ca:-Wmin) by CARD_1:62;
  then Segm 2 c= Segm len (Ca:-Wmin) by A5,A9;
  then
A10: len (Ca:-Wmin) >= 2 by NAT_1:39;
  then
A11: len(Ca:-Wmin) >= 1 by XXREAL_0:2;
A12: US/.1 = (Rotate(Ca,Wmin)-:Emax)/.1 by JORDAN1E:def 1
    .= Rotate(Ca,Wmin)/.1 by A1,FINSEQ_5:44
    .= Ca/.(1-'1+Wmin..Ca) by A6,A11,FINSEQ_6:174
    .= Ca/.(0+Wmin..Ca) by XREAL_1:232;
  US/.2 = (Rotate(Ca,Wmin)-:Emax)/.2 by JORDAN1E:def 1
    .= Rotate(Ca,Wmin)/.2 by A1,A2,FINSEQ_5:43
    .= Ca/.(2-'1+Wmin..Ca) by A6,A10,FINSEQ_6:174
    .= Ca/.(2-1+Wmin..Ca) by XREAL_0:def 2;
  hence thesis by A7,A4,A12,JORDAN1E:22,JORDAN1F:5;
end;
