reserve p,p1,p2,p3,p11,p22,q,q1,q2 for Point of TOP-REAL 2,
  f,h for FinSequence of TOP-REAL 2,
  r,r1,r2,s,s1,s2 for Real,
  u,u1,u2,u5 for Point of Euclid 2,
  n,m,i,j,k for Nat,
  N for Nat,
  x,y,z for set;
reserve lambda for Real;

theorem
  not p1 in Ball(u,r) & p in Ball(u,r) & |[p`1,q`2]| in Ball(u,r) & not
|[p`1,q`2]| in LSeg(p1,p) & p1`1 = p`1 & p`1<>q`1 & p`2<>q`2 implies (LSeg(p,|[
  p`1,q`2]|) \/ LSeg(|[p`1,q`2]|,q)) /\ LSeg(p1,p) = {p}
proof
  set v = |[p`1,q`2]|;
  assume that
A1: not p1 in Ball(u,r) and
A2: p in Ball(u,r) and
A3: v in Ball(u,r) and
A4: not v in LSeg(p1,p) and
A5: p1`1=p`1 and
A6: p`1<>q`1 and
A7: p`2<>q`2;
A8: LSeg(p,v) c= Ball(u,r) by A2,A3,Th21;
  p in LSeg(p,v) by RLTOPSP1:68;
  then p in LSeg(p1,p) & p in LSeg(p,v) \/ LSeg(v,q) by RLTOPSP1:68
,XBOOLE_0:def 3;
  then p in (LSeg(p,v) \/ LSeg(v,q)) /\ LSeg(p1,p) by XBOOLE_0:def 4;
  then
A9: {p} c= (LSeg(p,v) \/ LSeg(v,q)) /\ LSeg(p1,p) by ZFMISC_1:31;
A10: (LSeg(p,v) \/ LSeg(v,q)) /\ LSeg(p1,p) = LSeg(p,v) /\ LSeg(p1,p) \/
  LSeg(v,q) /\ LSeg(p1,p) by XBOOLE_1:23;
A11: p1=|[p`1,p1`2]| by A5,EUCLID:53;
A12: q=|[q`1,q`2]| by EUCLID:53;
A13: p=|[p`1,p`2]| by EUCLID:53;
A14: v`1=p`1;
A15: v`2=q`2;
  per cases;
  suppose
    p1`2=p`2;
    hence thesis by A1,A2,A5,Th6;
  end;
  suppose
A16: p1`2<>p`2;
    now
      per cases by A16,XXREAL_0:1;
      suppose
A17:    p1`2>p`2;
        now
          per cases by A6,XXREAL_0:1;
          suppose
A18:        p`1>q`1;
            now
              per cases by A7,XXREAL_0:1;
              case
A19:            p`2>q`2;
                then
A20:            p`2>=v`2;
                (LSeg(p,v) \/ LSeg(v,q)) /\ LSeg(p1,p) c= {p}
                proof
                  let x be object such that
A21:              x in (LSeg(p,v) \/ LSeg(v,q)) /\ LSeg(p1,p);
                  now
                    per cases by A10,A21,XBOOLE_0:def 3;
                    case
A22:                  x in LSeg(p,v) /\ LSeg(p1,p);
                      p in {q1: q1`1=p`1 & v`2<=q1`2 & q1`2<=p1`2} by A17,A20;
                      then p in LSeg(p1,v) by A11,A17,A19,Th9,XXREAL_0:2;
                      hence thesis by A22,TOPREAL1:8;
                    end;
                    case
A23:                  x in LSeg(v,q) /\ LSeg(p1,p);
                      then x in LSeg(v,q) by XBOOLE_0:def 4;
                      then
                      x in {p2: p2`2=q`2 & q`1<=p2`1 & p2`1<=p`1} by A12,A18
,Th10;
                      then
A24:                  ex p2 st p2=x & p2`2=q`2 & q`1<=p2`1 & p2`1<=p`1;
                      x in LSeg(p1, p) by A23,XBOOLE_0:def 4;
                      then
                      x in {q2: q2`1=p`1 & p`2<=q2`2 & q2`2<=p1`2} by A11,A13
,A17,Th9;
                      then
                      ex q2 st q2=x & q2`1=p`1 & p`2<=q2`2 & q2`2<=p1`2;
                      hence contradiction by A19,A24;
                    end;
                  end;
                  hence thesis;
                end;
                hence thesis by A9;
              end;
              case
A25:            p`2<q`2;
                now
                  per cases by XXREAL_0:1;
                  suppose
A26:                q`2>p1`2;
                    then p1 in {q2: q2`1=p`1 & p`2<=q2`2 & q2`2<=v`2} by A5,A17
;
                    then p1 in LSeg(p,v) by A13,A17,A26,Th9,XXREAL_0:2;
                    hence contradiction by A1,A8;
                  end;
                  suppose
                    q`2=p1`2;
                    hence contradiction by A1,A3,A5,EUCLID:53;
                  end;
                  suppose
A27:                q`2<p1`2;
                    then v in {p2: p2`1=p`1 & p`2<=p2`2 & p2`2<=p1`2} by A14
,A15,A25;
                    hence contradiction by A4,A11,A13,A25,A27,Th9,XXREAL_0:2;
                  end;
                end;
                hence contradiction;
              end;
            end;
            hence thesis;
          end;
          suppose
A28:        p`1<q`1;
            now
              per cases by A7,XXREAL_0:1;
              case
A29:            p`2>q`2;
                then
A30:            p`2>=v`2;
                (LSeg(p,v) \/ LSeg(v,q)) /\ LSeg(p1,p) c= {p}
                proof
                  let x be object such that
A31:              x in (LSeg(p,v) \/ LSeg(v,q)) /\ LSeg(p1,p);
                  now
                    per cases by A10,A31,XBOOLE_0:def 3;
                    case
A32:                  x in LSeg(p,v) /\ LSeg(p1,p);
                      p in {q1: q1`1=p`1 & v`2<=q1`2 & q1`2<=p1`2} by A17,A30;
                      then p in LSeg(p1,v) by A11,A17,A29,Th9,XXREAL_0:2;
                      hence thesis by A32,TOPREAL1:8;
                    end;
                    case
A33:                  x in LSeg(v,q) /\ LSeg(p1,p);
                      then x in LSeg(v,q) by XBOOLE_0:def 4;
                      then
                      x in {p2: p2`2=q`2 & p`1<=p2`1 & p2`1<=q`1} by A12,A28
,Th10;
                      then
A34:                  ex p2 st p2=x & p2`2=q`2 & p`1<=p2`1 & p2`1<=q`1;
                      x in LSeg(p1, p) by A33,XBOOLE_0:def 4;
                      then
                      x in {q2: q2`1=p`1 & p`2<=q2`2 & q2`2<=p1`2} by A11,A13
,A17,Th9;
                      then ex q2 st q2=x & q2`1=p`1 & p`2 <=q2`2 & q2`2<=p1`2;
                      hence contradiction by A29,A34;
                    end;
                  end;
                  hence thesis;
                end;
                hence thesis by A9;
              end;
              case
A35:            p`2<q`2;
                now
                  per cases by XXREAL_0:1;
                  suppose
A36:                q`2>p1`2;
                    then p1 in {q2: q2`1=p`1 & p`2<=q2`2 & q2`2<=v`2} by A5,A17
;
                    then p1 in LSeg(p,v) by A13,A17,A36,Th9,XXREAL_0:2;
                    hence contradiction by A1,A8;
                  end;
                  suppose
                    q`2=p1`2;
                    hence contradiction by A1,A3,A5,EUCLID:53;
                  end;
                  suppose
A37:                q`2<p1`2;
                    then v in {p2: p2`1=p`1 & p`2<=p2`2 & p2`2<=p1`2} by A14
,A15,A35;
                    hence contradiction by A4,A11,A13,A35,A37,Th9,XXREAL_0:2;
                  end;
                end;
                hence contradiction;
              end;
            end;
            hence thesis;
          end;
        end;
        hence thesis;
      end;
      suppose
A38:    p1`2<p`2;
        now
          per cases by A6,XXREAL_0:1;
          suppose
A39:        p`1>q`1;
            now
              per cases by A7,XXREAL_0:1;
              case
A40:            p`2>q`2;
                now
                  per cases by XXREAL_0:1;
                  suppose
A41:                q`2>p1`2;
                    then v in {p2: p2`1=p`1 & p1`2<=p2`2 & p2`2<=p`2} by A14
,A15,A40;
                    hence contradiction by A4,A11,A13,A40,A41,Th9,XXREAL_0:2;
                  end;
                  suppose
                    q`2=p1`2;
                    hence contradiction by A1,A3,A5,EUCLID:53;
                  end;
                  suppose
A42:                q`2<p1`2;
                    then p1 in {q2: q2`1=p`1 & v`2<=q2`2 & q2`2<=p`2} by A5,A38
;
                    then p1 in LSeg(p,v) by A13,A38,A42,Th9,XXREAL_0:2;
                    hence contradiction by A1,A8;
                  end;
                end;
                hence contradiction;
              end;
              case
A43:            p`2<q`2;
                (LSeg(p,v) \/ LSeg(v,q)) /\ LSeg(p1,p) c= {p}
                proof
                  let x be object such that
A44:              x in (LSeg(p,v) \/ LSeg(v,q)) /\ LSeg(p1,p);
                  now
                    per cases by A10,A44,XBOOLE_0:def 3;
                    case
A45:                  x in LSeg(p,v) /\ LSeg(p1,p);
                      p in {q1: q1`1=p`1 & p1`2<=q1`2 & q1`2<=v`2} by A38
,A43;
                      then p in LSeg(p1,v) by A11,A38,A43,Th9,XXREAL_0:2;
                      hence thesis by A45,TOPREAL1:8;
                    end;
                    case
A46:                  x in LSeg(v,q) /\ LSeg(p1,p);
                      then x in LSeg(v,q) by XBOOLE_0:def 4;
                      then
                      x in {p2: p2`2=q`2 & q`1<=p2`1 & p2`1<=p`1} by A12,A39
,Th10;
                      then
A47:                  ex p2 st p2=x & p2`2=q`2 & q`1<=p2`1 & p2`1<=p`1;
                      x in LSeg(p1, p) by A46,XBOOLE_0:def 4;
                      then
                      x in {q2: q2`1=p`1 & p1`2<=q2`2 & q2`2<=p`2} by A11,A13
,A38,Th9;
                      then ex q2 st q2=x & q2`1=p`1 & p1 `2<=q2`2 & q2`2<=p`2;
                      hence contradiction by A43,A47;
                    end;
                  end;
                  hence thesis;
                end;
                hence thesis by A9;
              end;
            end;
            hence thesis;
          end;
          suppose
A48:        p`1<q`1;
            now
              per cases by A7,XXREAL_0:1;
              case
A49:            p`2>q`2;
                now
                  per cases by XXREAL_0:1;
                  suppose
A50:                q`2>p1`2;
                    then v in {p2: p2`1=p`1 & p1`2<=p2`2 & p2`2<=p`2} by A14
,A15,A49;
                    hence contradiction by A4,A11,A13,A49,A50,Th9,XXREAL_0:2;
                  end;
                  suppose
                    q`2=p1`2;
                    hence contradiction by A1,A3,A5,EUCLID:53;
                  end;
                  suppose
A51:                q`2<p1`2;
                    then p1 in {q2: q2`1=p`1 & v`2<=q2`2 & q2`2<=p`2} by A5,A38
;
                    then p1 in LSeg(p,v) by A13,A38,A51,Th9,XXREAL_0:2;
                    hence contradiction by A1,A8;
                  end;
                end;
                hence contradiction;
              end;
              case
A52:            p`2<q`2;
                (LSeg(p,v) \/ LSeg(v,q)) /\ LSeg(p1,p) c= {p}
                proof
                  let x be object such that
A53:              x in (LSeg(p,v) \/ LSeg(v,q)) /\ LSeg(p1,p);
                  now
                    per cases by A10,A53,XBOOLE_0:def 3;
                    case
A54:                  x in LSeg(p,v) /\ LSeg(p1,p);
                      p in {q1: q1`1=p`1 & p1`2<=q1`2 & q1`2<=v`2} by A38
,A52;
                      then p in LSeg(p1,v) by A11,A38,A52,Th9,XXREAL_0:2;
                      hence thesis by A54,TOPREAL1:8;
                    end;
                    case
A55:                  x in LSeg(v,q) /\ LSeg(p1,p);
                      then x in LSeg(v,q) by XBOOLE_0:def 4;
                      then x in {p2: p2`2=q`2 & p`1<=p2`1 & p2`1<=q`1} by A12
,A48,Th10;
                      then
A56:                  ex p2 st p2=x & p2`2=q`2 & p`1<=p2`1 & p2`1<=q`1;
                      x in LSeg(p1, p) by A55,XBOOLE_0:def 4;
                      then x in {q2: q2`1=p`1 & p1`2<=q2`2 & q2`2<=p`2} by A11
,A13,A38,Th9;
                      then ex q2 st q2=x & q2`1=p`1 & p1 `2<=q2`2 & q2`2<=p`2;
                      hence contradiction by A52,A56;
                    end;
                  end;
                  hence thesis;
                end;
                hence thesis by A9;
              end;
            end;
            hence thesis;
          end;
        end;
        hence thesis;
      end;
    end;
    hence thesis;
  end;
end;
