reserve GX,GY for non empty TopSpace,
  x,y for Point of GX,
  r,s for Real;
reserve Q,P1,P2 for Subset of TOP-REAL 2;
reserve P for Subset of TOP-REAL 2;
reserve w1,w2 for Point of TOP-REAL 2;
reserve pa,pb for Point of TOP-REAL 2,
  s1,t1,s2,t2,s,t,s3,t3,s4,t4,s5,t5,s6,t6, l,sa,sd,ta,td for Real;
reserve s1a,t1a,s2a,t2a,s3a,t3a,sb,tb,sc,tc for Real;

theorem Th30:
  for s1,t1,s2,t2 for P,P1,P2 being Subset of TOP-REAL 2 st s1<s2 & t1<t2 &
  P = { p where p is Point of TOP-REAL 2: p`1 = s1 & p`2 <= t2 & p`2 >= t1 or
  p`1 <= s2 & p`1 >= s1 & p`2 = t2 or p`1 <= s2 & p`1 >= s1 & p`2 = t1 or
  p`1 = s2 & p`2 <= t2 & p`2 >= t1} &
  P1 = {pa where pa is Point of TOP-REAL 2:
  s1<pa`1 & pa`1<s2 & t1 <pa`2 & pa`2 < t2} &
  P2 = {pb where pb is Point of TOP-REAL 2:
  not( s1<=pb`1 & pb`1<=s2 & t1<=pb`2 & pb`2<=t2)} holds
  P`= P1 \/ P2 & P`<> {} & P1 misses P2 &
  for P1A,P2B being Subset of (TOP-REAL 2)|P` st P1A = P1 & P2B = P2 holds
  P1A is a_component & P2B is a_component
proof
  let s1,t1,s2,t2;
  let P,P1,P2 be Subset of TOP-REAL 2;
  assume that
A1: s1<s2 and
A2: t1<t2 and
A3: P ={p where p is Point of TOP-REAL 2:p`1 = s1 & p`2 <= t2 & p`2 >= t1 or
  p`1 <= s2 & p`1 >= s1 & p`2 = t2 or p`1 <= s2 & p`1 >= s1 & p`2 = t1 or
  p`1 = s2 & p`2 <= t2 & p`2 >= t1} and
A4: P1 = {pa where pa is Point of TOP-REAL 2:
  s1<pa`1 & pa`1<s2 & t1 <pa`2 & pa`2 < t2} and
A5: P2 = {pc where pc is Point of TOP-REAL 2:
  not( s1<=pc`1 & pc`1<=s2 & t1<=pc`2 & pc`2<=t2)};
  now
    let x be object;
    assume
A6: x in P`;
    then
A7: not x in P by XBOOLE_0:def 5;
    reconsider pd=x as Point of TOP-REAL 2 by A6;
    not (pd`1 = s1 & pd`2 <= t2 & pd`2 >= t1 or
    pd`1 <= s2 & pd`1 >= s1 & pd`2 = t2 or
    pd`1 <= s2 & pd`1 >= s1 & pd`2 = t1 or
    pd`1 = s2 & pd`2 <= t2 & pd`2 >= t1)by A3,A7;
    then s1<pd`1 & pd`1<s2 & t1 <pd`2 & pd`2 < t2
    or not( s1<=pd`1 & pd`1<=s2 & t1<=pd`2 & pd`2<=t2) by XXREAL_0:1;
    then x in P1 or x in P2 by A4,A5;
    hence x in P1 \/ P2 by XBOOLE_0:def 3;
  end;
  then
A8: P` c= P1 \/ P2;
  now
    let x be object such that
A9: x in P1 \/ P2;
    now per cases by A9,XBOOLE_0:def 3;
      suppose
A10:    x in P1;
        then
A11:    ex pa st pa=x & s1<pa`1 & pa`1<s2 & t1 <pa`2 & pa`2 < t2 by A4;
        now
          assume x in P;
          then ex pb st pb=x &(pb`1 = s1 & pb`2 <= t2 & pb`2 >= t1 or
          pb`1 <= s2 & pb`1 >= s1 & pb`2 = t2 or
          pb`1 <= s2 & pb`1 >= s1 & pb`2 = t1 or
          pb`1 = s2 & pb`2 <= t2 & pb`2 >= t1) by A3;
          hence contradiction by A11;
        end;
        hence x in P` by A10,SUBSET_1:29;
      end;
      suppose x in P2;
        then consider pc being Point of TOP-REAL 2 such that
A12:    pc=x and
A13:    not( s1<=pc`1 & pc`1<=s2 & t1<=pc`2 & pc`2<=t2) by A5;
        now
          assume pc in P;
          then ex p being Point of TOP-REAL 2 st p=pc & (
          p`1 = s1 & p`2 <= t2 & p`2 >= t1 or
          p`1 <= s2 & p`1 >= s1 & p`2 = t2 or
          p`1 <= s2 & p`1 >= s1 & p`2 = t1 or
          p`1 = s2 & p`2 <= t2 & p`2 >= t1) by A3;
          hence contradiction by A1,A2,A13;
        end;
        hence x in P`by A12,SUBSET_1:29;
      end;
    end;
    hence x in P`;
  end;
  then
A14: P1 \/ P2 c= P`;
  hence
A15: P`=P1 \/ P2 by A8;
  set s3 =(s1+s2)/2, t3=(t1+t2)/2;
A16: s1+s1<s1+s2 by A1,XREAL_1:6;
A17: t1+t1<t1+t2 by A2,XREAL_1:6;
A18: (s1+s1)/2<s3 by A16,XREAL_1:74;
A19: (t1+t1)/2<t3 by A17,XREAL_1:74;
A20: s1+s2<s2+s2 by A1,XREAL_1:6;
A21: t1+t2<t2+t2 by A2,XREAL_1:6;
A22: s3<(s2+s2)/2 by A20,XREAL_1:74;
A23: t3<(t2+t2)/2 by A21,XREAL_1:74;
  set pp=|[s3,t3]|;
A24: pp`1=s3 by EUCLID:52;
  pp`2=t3 by EUCLID:52;
  then
A25: |[ s3,t3 ]| in { pp2 where pp2 is Point of TOP-REAL 2:
  s1<pp2`1 & pp2`1<s2 & t1<pp2`2 & pp2`2<t2} by A18,A19,A22,A23,A24;
  hence
  P`<>{} by A4,A14;
  set P9 = P`;
  P1 misses P2 by A4,A5,Th29;
  hence
A26: P1 /\ P2 = {};
  now
    let P1A,P2B be Subset of (TOP-REAL 2)|P9;
    assume that
A27: P1A=P1 and
A28: P2B=P2;
    P1 is convex by A4,Th25;
    then
A29: P1A is connected by A27,CONNSP_1:23;
A30: P2 is connected by A5,Th26;
A31: P2={ |[ sa,ta ]|:not (s1<=sa & sa<=s2 & t1<=ta & ta<=t2)} by A5,Th22;
    reconsider A0={ |[ s3a,t3a ]|:s3a<s1} as Subset of TOP-REAL 2 by Lm2,Lm3;
    reconsider A1={ |[ s4,t4 ]|:t4<t1} as Subset of TOP-REAL 2 by Lm2,Lm4;
    reconsider A2={ |[ s5,t5 ]|:s2<s5} as Subset of TOP-REAL 2 by Lm2,Lm5;
    reconsider A3={ |[ s6,t6 ]|:t2<t6} as Subset of TOP-REAL 2 by Lm2,Lm6;
A32: P2=A0 \/ A1 \/ A2 \/ A3 by A31,Th7;
    t2+1>t2 by XREAL_1:29;
    then
A33: |[s2+1,t2+1]| in A3;
A34: P2B is connected by A28,A30,CONNSP_1:23;
A35: for CP being Subset of (TOP-REAL 2)|(P9) st
    CP is connected holds P1A c= CP implies P1A = CP
    proof
      let CP be Subset of (TOP-REAL 2)|(P9);
      assume CP is connected;
      then
A36:  ((TOP-REAL 2)|P9)|CP is connected;
      now
        assume
A37:    P1A c= CP;
        P1A /\ CP c= CP by XBOOLE_1:17;
        then reconsider AP=P1A /\ CP as Subset of ((TOP-REAL 2)|P9)|CP by
PRE_TOPC:8;
A38:    P1 /\ P` =P1A by A15,A27,XBOOLE_1:21;
        P1 is open by A4,Th27;
        then
A39:    P1 in the topology of TOP-REAL 2 by PRE_TOPC:def 2;
A40:    P`= [#]((TOP-REAL 2)|P9) by PRE_TOPC:def 5;
        P1 /\ [#]((TOP-REAL 2)|P9)=P1A by A38,PRE_TOPC:def 5;
        then
A41:    P1A in the topology of (TOP-REAL 2)|P9 by A39,PRE_TOPC:def 4;
A42:    CP=[#](((TOP-REAL 2)|P9)|CP) by PRE_TOPC:def 5;
A43:    AP<>{}(((TOP-REAL 2)|P9)|CP) by A4,A25,A27,A37,XBOOLE_1:28;
        AP in the topology of ((TOP-REAL 2)|P9)|CP by A41,A42,PRE_TOPC:def 4;
        then
A44:    AP is open by PRE_TOPC:def 2;
        P2B /\ CP c= CP by XBOOLE_1:17;
        then reconsider BP=P2B /\ CP as Subset of ((TOP-REAL 2)|P9)|CP by
PRE_TOPC:8;
A45:    P2 /\ P` =P2B by A15,A28,XBOOLE_1:21;
        P2 is open by A5,Th28;
        then
A46:    P2 in the topology of TOP-REAL 2 by PRE_TOPC:def 2;
        P2 /\ [#]((TOP-REAL 2)|P9)=P2B by A45,PRE_TOPC:def 5;
        then
A47:    P2B in the topology of (TOP-REAL 2)|P9 by A46,PRE_TOPC:def 4;
        CP=[#](((TOP-REAL 2)|P9)|CP) by PRE_TOPC:def 5;
        then BP in the topology of ((TOP-REAL 2)|P9)|CP by A47,PRE_TOPC:def 4;
        then
A48:    BP is open by PRE_TOPC:def 2;
A49:    CP=(P1A \/ P2B) /\ CP by A15,A27,A28,A40,XBOOLE_1:28
          .=AP \/ BP by XBOOLE_1:23;
        now
          assume
A50:      BP<>{};
A51:      AP /\ BP = P1A /\ (P2B /\ CP) /\ CP by XBOOLE_1:16
            .= P1A /\ P2B /\ CP /\ CP by XBOOLE_1:16
            .= P1A /\ P2B /\ (CP /\ CP) by XBOOLE_1:16
            .= P1A /\ P2B /\ CP;
          P1 misses P2 by A4,A5,Th29;
          then P1 /\ P2 = {};
          then AP misses BP by A27,A28,A51;
          hence contradiction by A36,A42,A43,A44,A48,A49,A50,CONNSP_1:11;
        end;
        hence thesis by A49,XBOOLE_1:28;
      end;
      hence thesis;
    end;
    hence P1A is a_component by A29;
    for CP being Subset of (TOP-REAL 2)|(P9) st
    CP is connected holds P2B c= CP implies P2B = CP
    proof
      let CP be Subset of (TOP-REAL 2)|(P9);
      assume CP is connected;
      then
A52:  ((TOP-REAL 2)|P9)|CP is connected;
      assume
A53:  P2B c= CP;
      P2B /\ CP c= CP by XBOOLE_1:17;
      then reconsider BP=P2B /\ CP as Subset of ((TOP-REAL 2)|P9)|CP by
PRE_TOPC:8;
A54:  P2 /\ P` =P2B by A15,A28,XBOOLE_1:21;
      P2 is open by A5,Th28;
      then
A55:  P2 in the topology of TOP-REAL 2 by PRE_TOPC:def 2;
A56:  P`= [#]((TOP-REAL 2)|P9) by PRE_TOPC:def 5;
      P2 /\ [#]((TOP-REAL 2)|P9)=P2B by A54,PRE_TOPC:def 5;
      then
A57:  P2B in the topology of (TOP-REAL 2)|P9 by A55,PRE_TOPC:def 4;
A58:  CP=[#](((TOP-REAL 2)|P9)|CP) by PRE_TOPC:def 5;
A59:  BP<>{}(((TOP-REAL 2)|P9)|CP) by A28,A32,A33,A53,XBOOLE_1:28;
      BP in the topology of ((TOP-REAL 2)|P9)|CP by A57,A58,PRE_TOPC:def 4;
      then
A60:  BP is open by PRE_TOPC:def 2;
      P1A /\ CP c= CP by XBOOLE_1:17;
      then reconsider AP=P1A /\ CP as Subset of ((TOP-REAL 2)|P9)|CP by
PRE_TOPC:8;
A61:  P1 /\ P` =P1A by A15,A27,XBOOLE_1:21;
      P1 is open by A4,Th27;
      then
A62:  P1 in the topology of TOP-REAL 2 by PRE_TOPC:def 2;
      P1 /\ [#]((TOP-REAL 2)|P9)=P1A by A61,PRE_TOPC:def 5;
      then
A63:  P1A in the topology of (TOP-REAL 2)|P9 by A62,PRE_TOPC:def 4;
      CP=[#](((TOP-REAL 2)|P9)|CP) by PRE_TOPC:def 5;
      then AP in the topology of ((TOP-REAL 2)|P9)|CP by A63,PRE_TOPC:def 4;
      then
A64:  AP is open by PRE_TOPC:def 2;
A65:  CP=(P1A \/ P2B) /\ CP by A15,A27,A28,A56,XBOOLE_1:28
        .=AP \/ BP by XBOOLE_1:23;
      now
        assume
A66:    AP<>{};
        AP /\ BP = P1A /\ (P2B /\ CP) /\ CP by XBOOLE_1:16
          .= P1A /\ P2B /\ CP /\ CP by XBOOLE_1:16
          .= P1A /\ P2B /\ (CP /\ CP) by XBOOLE_1:16
          .= P1A /\ P2B /\ CP;
        then AP misses BP by A26,A27,A28;
        hence contradiction by A52,A58,A59,A60,A64,A65,A66,CONNSP_1:11;
      end;
      hence thesis by A53,A65,XBOOLE_1:28;
    end;
    hence P1A is a_component &
    P2B is a_component by A29,A34,A35;
  end;
  hence thesis;
end;
