reserve T,U for non empty TopSpace;
reserve t for Point of T;
reserve n for Nat;

theorem Th9:
  for p being Point of TOP-REAL n, S being Subset of TOP-REAL n
  st n >= 2 & S = ([#]TOP-REAL n) \ {p}
  holds (TOP-REAL n) | S is pathwise_connected
  proof
    let p be Point of TOP-REAL n;
    let S be Subset of TOP-REAL n;
    assume
A1: n >= 2;
    assume
A2: S = ([#]TOP-REAL n) \ {p};
    then S is infinite by A1,RAMSEY_1:4;
    then reconsider T = (TOP-REAL n) | S as non empty SubSpace of TOP-REAL n;
A3:[#]T = ([#]TOP-REAL n) \ {p} by A2,PRE_TOPC:def 5;
A4: for a,b being Point of T, a1,b1 being Point of TOP-REAL n
    st not p in LSeg(a1,b1) & a1=a & b1=b
    holds a, b are_connected
    proof
      let a,b be Point of T;
      let a1,b1 be Point of TOP-REAL n;
      assume
A5:   not p in LSeg(a1,b1);
      assume
A6:   a1 = a & b1 = b;
      per cases;
      suppose
A7:     a1 <> b1;
A8:      [#]((TOP-REAL n) | LSeg(a1,b1)) = LSeg(a1,b1) by PRE_TOPC:def 5;
A9:      LSeg(a1,b1) c= ([#]TOP-REAL n) \ {p} by A5,ZFMISC_1:34;
          reconsider Y = (TOP-REAL n) | LSeg(a1,b1) as
          non empty SubSpace of T by A3,A9,A8,RLTOPSP1:68,TSEP_1:4;
          LSeg(a1,b1) is_an_arc_of a1,b1 by A7,TOPREAL1:9;
          then consider
          h being Function of I[01], Y such that
A10:       h is being_homeomorphism and
A11:       h.0 = a1 & h.1 = b1 by TOPREAL1:def 1;
          reconsider f = h as Function of I[01], T by A3,A9,A8,FUNCT_2:7;
          take f;
          thus f is continuous by A10,PRE_TOPC:26;
          thus thesis by A6,A11;
      end;
      suppose a1 = b1; hence a, b are_connected by A6; end;
    end;
    for a,b being Point of T holds a, b are_connected
    proof
      let a,b be Point of T;
A12:   the carrier of T is Subset of TOP-REAL n by TSEP_1:1;
      a in the carrier of T & b in the carrier of T;
      then reconsider a1 = a, b1 = b as Point of TOP-REAL n by A12;
      per cases;
      suppose
A13:     a1 <> b1;
        per cases;
        suppose
A14:      p in LSeg(a1,b1);
          reconsider n1 = n as Element of NAT by ORDINAL1:def 12;
          reconsider aa1=a1,bb1=b1 as Point of TOP-REAL n1;
          consider s be Real such that
A15:      0<=s & s<=1 & p=(1-s)*aa1+s*bb1 by A14,RLTOPSP1:76;
          set q1 = b1 - a1;
          reconsider k = n - 1 as Nat by A1,CHORD:1;
          k + 1 > 1 by A1,XXREAL_0:2;
          then
A16:       k >= 1 by NAT_1:13;
          q1 <> 0.TOP-REAL(k+1) by A13,RLVECT_1:21;
          then TPlane(q1, p) is k-manifold by MFOLD_2:30;
          then [#]TPlane(q1, p) is infinite by A16;
          then [#]( (TOP-REAL n) | Plane(q1, p)) is infinite by MFOLD_2:def 3;
          then
A17:       Plane(q1, p) is infinite;
          reconsider X = Plane(q1, p) as set;
          X \ {p} is infinite by A17,RAMSEY_1:4;
          then consider x be object such that
A18:       x in (X \ {p}) by XBOOLE_0:def 1;
A19:       x in X & not x in {p} by A18,XBOOLE_0:def 5;
          then x in {y where y is Point of TOP-REAL n: |( q1,y-p )| = 0 }
          by MFOLD_2:def 2;
          then consider c1 be Point of TOP-REAL n such that
A20:       c1 = x & |( q1,c1-p )| = 0;
A21:      |( q1 , q1 )| <> 0
          proof
            assume |( q1 , q1 )| = 0;
            then q1 = 0.TOP-REAL n by EUCLID_2:41;
            hence contradiction by A13,RLVECT_1:21;
          end;
A22:      not p in LSeg(a1,c1)
          proof
            assume
A23:         p in LSeg(a1,c1);
            reconsider cc1=c1 as Point of TOP-REAL n1;
            consider r be Real such that
A24:         0<=r & r<=1 & p=(1-r)*aa1+r*cc1 by A23,RLTOPSP1:76;
A25:        1-r <> 0
            proof
              assume 1-r = 0;
              then p = 0.TOP-REAL(n) + (1 qua Real)*c1 by A24,RLVECT_1:10
              .= 0.TOP-REAL(n) + c1 by RLVECT_1:def 8
              .= c1 by RLVECT_1:4;
              hence contradiction by A19,A20,TARSKI:def 1;
            end;
            set q2 = c1 - a1;
            c1-p
            = c1 -(1-r)*a1 - r*c1 by A24,RLVECT_1:27
            .= c1 + (-(1-r))*a1 - r*c1 by RLVECT_1:79
            .= c1 + (-1+r)*a1 - r*c1
            .= c1 + ((-1)*a1 + r*a1) - r*c1 by RLVECT_1:def 6
            .= c1 + (-a1 + r*a1) - r*c1 by RLVECT_1:16
            .= c1 + -a1 + r*a1 - r*c1 by RLVECT_1:def 3
            .= q2 + r*a1 + r*(-c1) by RLVECT_1:25
            .= q2 + (r*a1 + r*(-c1)) by RLVECT_1:def 3
            .= q2 + r*(a1 + -c1) by RLVECT_1:def 5
            .= q2 + r*(-q2) by RLVECT_1:33
            .= q2 + -r*q2 by RLVECT_1:25
            .= q2 + (-r)*q2 by RLVECT_1:79
            .= (1 qua Real)*q2 + (-r)*q2 by RLVECT_1:def 8
            .= (1+(-r))*q2 by RLVECT_1:def 6
            .= (1-r)*q2;
            then (1-r)*|( q1,q2 )| = 0 by A20,EUCLID_2:20;
            then
A26:         |( q1,q2 )| = 0 by A25,XCMPLX_1:6;
            0.TOP-REAL n
            = (1-r)*a1+r*c1 + -((1-s)*a1+s*b1) by A15,A24,RLVECT_1:5
            .= (1-r)*a1 + -((1-s)*a1+s*b1) + r*c1 by RLVECT_1:def 3
            .= (1-r)*a1 + (-(1-s)*a1 -s*b1) + r*c1 by RLVECT_1:30
            .= (1-r)*a1 + -(1-s)*a1 + -s*b1 + r*c1 by RLVECT_1:def 3
            .= (1-r)*a1 + (-(1-s))*a1 + -s*b1 + r*c1 by RLVECT_1:79
            .= ((1-r) + (-(1-s)))*a1 + -s*b1 + r*c1 by RLVECT_1:def 6
            .= (s+(-r))*a1 + -s*b1 + r*c1
            .= s*a1 + (-r)*a1 + -s*b1 + r*c1 by RLVECT_1:def 6
            .= s*a1 + -s*b1 + (-r)*a1 + r*c1 by RLVECT_1:def 3
            .= s*a1 + s*(-b1) + (-r)*a1 + r*c1 by RLVECT_1:25
            .= s*(a1 + -b1) + (-r)*a1 + r*c1 by RLVECT_1:def 5
            .= s*(-(b1-a1)) + (-r)*a1 + r*c1 by RLVECT_1:33
            .= s*(-q1) + ((-r)*a1 + r*c1) by RLVECT_1:def 3
            .= s*(-q1) + (r*c1 + -r*a1) by RLVECT_1:79
            .= s*(-q1) + (r*c1 + r*(-a1)) by RLVECT_1:25
            .= s*(-q1) + r*q2 by RLVECT_1:def 5;
            then
A27:         0 = |( s*(-q1) + r*q2, s*(-q1) + r*q2 )| by EUCLID_2:34
            .= |( s*(-q1) , s*(-q1) )| +2*|( s*(-q1) , r*q2 )|
            +|( r*q2, r*q2 )| by EUCLID_2:30;
A28:         |( s*(-q1) , s*(-q1) )| = s*|( -q1 , s*(-q1) )| by EUCLID_2:19
            .= s*(s*|( -q1 , -q1 )|) by EUCLID_2:20
            .= s*(s*|( q1 , q1 )|) by EUCLID_2:23
            .= s*s*|( q1 , q1 )|;
A29:         |( r*q2 , r*q2 )| = r*|( q2 , r*q2 )| by EUCLID_2:19
            .= r*(r*|( q2 , q2 )|) by EUCLID_2:20
            .= r*r*|( q2 , q2 )|;
A30:       |( s*(-q1) , r*q2 )| = s*|( -q1 , r*q2 )| by EUCLID_2:19
            .= s*(r*|( -q1 , q2 )|) by EUCLID_2:20
            .= s*(r*(-|( q1 , q2 )|)) by EUCLID_2:21
            .= 0 by A26;
A31:        s*s >= 0 by XREAL_1:63;
A32:        r*r >= 0 by XREAL_1:63;
A33:        |( q1 , q1 )| >= 0 by EUCLID_2:35;
A34:        |( q2 , q2 )| >= 0 by EUCLID_2:35;
A35:        s*s <> 0
            proof
              assume s*s = 0;
              then s = 0 by XCMPLX_1:6;
              then p
              = (1 qua Real)*a1 + 0.TOP-REAL n by A15,RLVECT_1:10
              .= (1 qua Real)*a1 by RLVECT_1:4
              .= a1 by RLVECT_1:def 8;
              then not p in {p} by A3,XBOOLE_0:def 5;
              hence contradiction by TARSKI:def 1;
            end;
            thus contradiction
            by A28,A29,A27,A30,A31,A32,A33,A34,A35,A21,XREAL_1:71;
          end;
A36:      not p in LSeg(c1,b1)
          proof
            assume
A37:        p in LSeg(c1,b1);
            reconsider cc1=c1 as Point of TOP-REAL n1;
            consider r be Real such that
A38:         0<=r & r<=1 & p=(1-r)*bb1+r*cc1 by A37,RLTOPSP1:76;
A39:        1-r <> 0
            proof
              assume 1-r = 0;
              then p = 0.TOP-REAL(n) + (1 qua Real)*c1 by A38,RLVECT_1:10
              .= 0.TOP-REAL(n) + c1 by RLVECT_1:def 8
              .= c1 by RLVECT_1:4;
              hence contradiction by A19,A20,TARSKI:def 1;
            end;
            set q2 = c1 - b1;
            c1-p = c1 -(1-r)*b1 - r*c1 by A38,RLVECT_1:27
            .= c1 + (-(1-r))*b1 - r*c1 by RLVECT_1:79
            .= c1 + (-1+r)*b1 - r*c1
            .= c1 + ((-1)*b1 + r*b1) - r*c1 by RLVECT_1:def 6
            .= c1 + (-b1 + r*b1) - r*c1 by RLVECT_1:16
            .= c1 + -b1 + r*b1 - r*c1 by RLVECT_1:def 3
            .= q2 + r*b1 + r*(-c1) by RLVECT_1:25
            .= q2 + (r*b1 + r*(-c1)) by RLVECT_1:def 3
            .= q2 + r*(b1 + -c1) by RLVECT_1:def 5
            .= q2 + r*(-q2) by RLVECT_1:33
            .= q2 + -r*q2 by RLVECT_1:25
            .= q2 + (-r)*q2 by RLVECT_1:79
            .= (1 qua Real)*q2 + (-r)*q2 by RLVECT_1:def 8
            .= (1+(-r))*q2 by RLVECT_1:def 6
            .= (1-r)*q2;
            then (1-r)*|( q1,q2 )| = 0 by A20,EUCLID_2:20;
            then
A40:         |( q1,q2 )| = 0 by A39,XCMPLX_1:6;
A41:         0.TOP-REAL n = (1+(-r))*b1+r*c1 + -((1-s)*a1+s*b1)
            by A38,A15,RLVECT_1:5
            .= (1 qua Real)*b1+(-r)*b1+r*c1
               + -((1-s)*a1+s*b1) by RLVECT_1:def 6
            .= b1+(-r)*b1+r*c1 + -((1-s)*a1+s*b1) by RLVECT_1:def 8
            .= b1+((-r)*b1+r*c1) + -((1-s)*a1+s*b1) by RLVECT_1:def 3
            .= b1+(-r*b1+r*c1) + -((1-s)*a1+s*b1) by RLVECT_1:79
            .= b1+(r*(-b1)+r*c1) + -((1-s)*a1+s*b1) by RLVECT_1:25
            .= b1+r*q2 + -((1-s)*a1+s*b1) by RLVECT_1:def 5
            .= b1 + -((1-s)*a1+s*b1)+r*q2 by RLVECT_1:def 3
            .= b1 + (-1)*(s*b1+(1-s)*a1)+r*q2 by RLVECT_1:16
            .= b1 + ((-1)*(s*b1)+(-1)*((1-s)*a1))+r*q2 by RLVECT_1:def 5
            .= b1 + (((-1)*s)*b1+(-1)*((1-s)*a1))+r*q2 by RLVECT_1:def 7
            .= b1 + ((-s)*b1+ -((1-s)*a1))+r*q2 by RLVECT_1:16
            .= b1 + (-s)*b1+ -((1-s)*a1) +r*q2 by RLVECT_1:def 3
            .= (1 qua Real)*b1+(-s)*b1+ -((1-s)*a1) +r*q2 by RLVECT_1:def 8
            .= (1+(-s))*b1+ -((1-s)*a1) +r*q2 by RLVECT_1:def 6
            .= (1-s)*b1 +(1-s)*(-a1) +r*q2 by RLVECT_1:25
            .= (1-s)*q1 + r*q2 by RLVECT_1:def 5;
            set t = 1-s;
A42:         0 = |( t*q1 + r*q2, t*q1 + r*q2 )| by A41,EUCLID_2:34
            .= |( t*q1 , t*q1 )| +2*|( t*q1 , r*q2 )|
            +|( r*q2, r*q2 )| by EUCLID_2:30;
A43:         |( t*q1 , t*q1 )| = t*|( q1 , t*q1 )| by EUCLID_2:19
            .= t*(t*|( q1 , q1 )|) by EUCLID_2:20
            .= t*t*|( q1 , q1 )|;
A44:         |( r*q2 , r*q2 )| = r*|( q2 , r*q2 )| by EUCLID_2:19
            .= r*(r*|( q2 , q2 )|) by EUCLID_2:20
            .= r*r*|( q2 , q2 )|;
A45:       |( t*q1 , r*q2 )| = t*|( q1 , r*q2 )| by EUCLID_2:19
            .= t*(r*|( q1 , q2 )|) by EUCLID_2:20
            .= 0 by A40;
A46:        t*t >= 0 by XREAL_1:63;
A47:        r*r >= 0 by XREAL_1:63;
A48:        |( q1 , q1 )| >= 0 by EUCLID_2:35;
A49:        |( q2 , q2 )| >= 0 by EUCLID_2:35;
A50:        t*t <> 0
            proof
              assume t*t = 0;
              then t = 0 by XCMPLX_1:6;
              then p
              = 0.TOP-REAL n + (1 qua Real)*b1  by A15,RLVECT_1:10
              .= (1 qua Real)*b1 by RLVECT_1:4
              .= b1 by RLVECT_1:def 8;
              then not p in {p} by A3,XBOOLE_0:def 5;
              hence contradiction by TARSKI:def 1;
            end;
            thus contradiction
            by A50,A21,A43,A44,A42,A45,A46,A47,A48,A49,XREAL_1:71;
          end;
          reconsider c = c1 as Point of T by A20,A19,A3,XBOOLE_0:def 5;
          a,c are_connected & c,b are_connected by A22,A36,A4;
          hence thesis by BORSUK_6:42;
        end;
        suppose not p in LSeg(a1,b1); hence thesis by A4; end;
      end;
      suppose a1 = b1; hence a, b are_connected; end;
    end;
    hence thesis;
  end;
