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 Th12:
  LE p,E-max C,C & LE E-max C, q, C implies
  Segment(p,q,C) = R_Segment(Upper_Arc C,W-min C,E-max C,p)
  \/ L_Segment(Lower_Arc C,E-max C,W-min C,q)
proof
  assume that
A1: LE p,E-max C,C and
A2: LE E-max C, q, C;
A3: p in Upper_Arc C by A1,JORDAN17:3;
A4: q in Lower_Arc C by A2,JORDAN17:4;
A5: now
    assume q = W-min C;
    then W-min C = E-max C by A2,JORDAN7:2;
    hence contradiction by TOPREAL5:19;
  end;
A6: Lower_Arc C is_an_arc_of E-max C,W-min C by JORDAN6:50;
  defpred P[Point of TOP-REAL 2] means LE p,$1,C & LE $1,q,C;
  defpred Q1[Point of TOP-REAL 2] means LE p,$1,Upper_Arc C,W-min C,E-max C;
  defpred Q2[Point of TOP-REAL 2] means LE $1,q,Lower_Arc C,E-max C,W-min C;
  defpred Q[Point of TOP-REAL 2] means Q1[$1] or Q2[$1];
A7: P[p1] iff Q[p1]
  proof
    thus
    LE p,p1,C & LE p1,q,C implies LE p,p1,Upper_Arc C,W-min C,E-max C or
    LE p1,q,Lower_Arc C,E-max C,W-min C
    proof
      assume that
A8:   LE p,p1,C and
A9:   LE p1,q,C;
A10:  now
        assume that
A11:    p1 in Lower_Arc C and
A12:    p1 in Upper_Arc C;
        p1 in Lower_Arc C /\ Upper_Arc C by A11,A12,XBOOLE_0:def 4;
        then p1 in {W-min C,E-max C} by JORDAN6:def 9;
        hence p1 = W-min C or p1 = E-max C by TARSKI:def 2;
      end;
      per cases by A10;
      suppose
A13:    p1 = W-min C;
        then p = W-min C by A8,JORDAN7:2;
        hence thesis by A1,A13,JORDAN17:3,JORDAN5C:9;
      end;
      suppose p1 = E-max C;
        hence thesis by A4,A6,JORDAN5C:10;
      end;
      suppose not p1 in Lower_Arc C;
        hence thesis by A8,JORDAN6:def 10;
      end;
      suppose not p1 in Upper_Arc C;
        hence thesis by A9,JORDAN6:def 10;
      end;
    end;
    assume that
A14: LE p,p1,Upper_Arc C,W-min C,E-max C or
    LE p1,q,Lower_Arc C,E-max C,W-min C;
    per cases by A14;
    suppose
A15:  LE p,p1,Upper_Arc C,W-min C,E-max C;
      then
A16:  p1 in Upper_Arc C by JORDAN5C:def 3;
      hence LE p,p1,C by A3,A15,JORDAN6:def 10;
      thus thesis by A4,A5,A16,JORDAN6:def 10;
    end;
    suppose that
A17:  LE p1,q,Lower_Arc C,E-max C,W-min C and
A18:  p1 <> W-min C;
A19:  p1 in Lower_Arc C by A17,JORDAN5C:def 3;
      hence LE p,p1,C by A3,A18,JORDAN6:def 10;
      thus thesis by A4,A5,A17,A19,JORDAN6:def 10;
    end;
    suppose LE p1,q,Lower_Arc C,E-max C,W-min C & p1 = W-min C;
      hence thesis by A5,A6,JORDAN6:55;
    end;
  end;
  set Y1 = {p1: Q1[p1]}, Y2 = {p1: Q2[p1]};
  deffunc F(set) = $1;
  set X = {F(p1): P[p1]}, Y = {F(p1): Q[p1]}, Y9 = {p1: Q1[p1] or Q2[p1]};
A20: X = Y from FRAENKEL:sch 3(A7);
A21: Segment(p,q,C) = X by A5,JORDAN7:def 1;
A22: L_Segment(Lower_Arc C,E-max C,W-min C,q) = Y2 by JORDAN6:def 3;
  Y9 = Y1 \/ Y2 from TOPREAL1:sch 1;
  hence thesis by A20,A21,A22,JORDAN6:def 4;
end;
