
theorem Th28:
  for A being Subset of REAL? holds A is open & REAL in A iff ex O
  being Subset of R^1 st O is open & NAT c= O & A=(O\NAT) \/ {REAL}
proof
  let A be Subset of REAL?;
  consider f being Function of R^1, REAL? such that
A1: f = (id REAL)+*(NAT --> REAL) and
A2: for A being Subset of REAL? holds A is closed iff f"A is closed by Def8;
  thus A is open & REAL in A implies ex O being Subset of R^1 st O is open &
  NAT c= O & A=(O\NAT) \/ {REAL}
  proof
    assume that
A3: A is open and
A4: REAL in A;
    consider O being Subset of R^1 such that
A5: O=(f"(A`))`;
    A` is closed by A3,TOPS_1:4;
    then f"(A`) is closed by A2;
    then
A6: (f"(A`))` is open by TOPS_1:3;
A7: not REAL in [#](REAL?) \ A by A4,XBOOLE_0:def 5;
A8: A` c= A` \ {REAL}
    proof
      let x be object;
      assume
A9:   x in A`;
      then not x in {REAL} by A7,TARSKI:def 1;
      hence thesis by A9,XBOOLE_0:def 5;
    end;
    A` c= the carrier of REAL?;
    then
A10: A` c= (REAL \ NAT) \/ {REAL} by Def8;
A11: A` c= REAL \ NAT
    proof
      let x be object;
      assume
A12:  x in A`;
      then x in (REAL \ NAT) or x in {REAL} by A10,XBOOLE_0:def 3;
      hence thesis by A7,A12,TARSKI:def 1;
    end;
    A` \ {REAL} c= A` by XBOOLE_1:36;
    then
A13: A` = A` \ {REAL} by A8;
    not REAL in REAL;
    then ((id REAL)+*(NAT --> REAL))"(A` \ {REAL}) = A` \ NAT by A11,Th19,
XBOOLE_1:1;
    then O = ([#](R^1) \ A`) \/ (NAT /\ [#](R^1)) by A1,A5,A13,XBOOLE_1:52;
    then
A14: O = ([#](R^1) \ A`) \/ NAT by TOPMETR:17,XBOOLE_1:28,NUMBERS:19;
    A = A`` .= (the carrier of REAL?) \ A`;
    then
A15: A = ((REAL \ NAT) \/ {REAL}) \ A` by Def8;
A16: A = (REAL \ A`) \ NAT \/ {REAL}
    proof
      thus A c= (REAL \ A`) \ NAT \/ {REAL}
      proof
        let x be object;
        assume
A17:    x in A;
        then
A18:    not x in A` by XBOOLE_0:def 5;
        x in (REAL \ NAT) or x in {REAL} by A15,A17,XBOOLE_0:def 3;
        then x in (REAL\ A`) & not x in NAT or x in {REAL} by A18,
XBOOLE_0:def 5;
        then x in (REAL\ A`) \ NAT or x in {REAL} by XBOOLE_0:def 5;
        hence thesis by XBOOLE_0:def 3;
      end;
      let x be object;
      assume x in (REAL \ A`) \ NAT \/ {REAL};
      then x in (REAL \ A`) \ NAT or x in {REAL} by XBOOLE_0:def 3;
      then
A19:  x in (REAL \ A`) & not x in NAT or x in {REAL} & not x in A` by A7,
TARSKI:def 1,XBOOLE_0:def 5;
      then x in REAL\ NAT or x in {REAL} by XBOOLE_0:def 5;
      then
A20:  x in (REAL \ NAT) \/ {REAL} by XBOOLE_0:def 3;
      not x in A` by A19,XBOOLE_0:def 5;
      hence thesis by A15,A20,XBOOLE_0:def 5;
    end;
    NAT c= REAL \ A`
    proof
      let x be object;
      assume
A21:  x in NAT;
      then not x in A` by A11,XBOOLE_0:def 5;
      hence thesis by A21,XBOOLE_0:def 5,NUMBERS:19;
    end;
    then O = REAL \ A` by A14,TOPMETR:17,XBOOLE_1:12;
    hence thesis by A5,A6,A14,A16,XBOOLE_1:7;
  end;
  given O being Subset of R^1 such that
A22: O is open and
A23: NAT c= O and
A24: A=(O\NAT) \/ {REAL};
  consider B being Subset of R^1 such that
A25: B = [#](R^1) \ O;
  not REAL in REAL;
  then ((id REAL)+*(NAT --> REAL))"((REAL \ O) \ {REAL})= REAL \ O \ NAT by
Th19;
  then
A26: f"((REAL \ O) \ {REAL}) = REAL \ (O \/ NAT) by A1,XBOOLE_1:41;
A27: B is closed by A22,A25,Lm2;
  A` = ((REAL \ NAT) \/ {REAL}) \ ((O\NAT) \/ {REAL}) by A24,Def8
    .= ((REAL \ NAT) \((O\NAT) \/ {REAL})) \/ ({REAL} \ ({REAL} \/ (O\NAT)))
  by XBOOLE_1:42
    .= ((REAL \ NAT) \((O\NAT) \/ {REAL})) \/ {} by XBOOLE_1:46
    .= ((REAL \ NAT) \ (O\NAT)) \ {REAL} by XBOOLE_1:41
    .= (REAL \ (NAT \/ (O \ NAT))) \ {REAL} by XBOOLE_1:41
    .= (REAL \ (NAT \/ O )) \ {REAL} by XBOOLE_1:39
    .= (REAL \ O) \ {REAL} by A23,XBOOLE_1:12;
  then f"(A`)=B by A23,A25,A26,TOPMETR:17,XBOOLE_1:12;
  then [#](REAL?) \ A is closed by A2,A27;
  hence A is open by Lm2;
  REAL in {REAL} by TARSKI:def 1;
  hence thesis by A24,XBOOLE_0:def 3;
end;
