
theorem Th18:
  for A,B,C,x being set holds C c= A & not x in A implies ((id A)
  +*(B --> x))"(C \/ {x}) = C \/ B
proof
  let A,B,C,x be set;
  assume that
A1: C c= A and
A2: not x in A;
A3: C \ {x} = C
  proof
    thus C \ {x} c= C;
    let y be object;
    assume
A4: y in C;
    not y in {x}
    proof
      assume y in {x};
      then y = x by TARSKI:def 1;
      hence contradiction by A1,A2,A4;
    end;
    hence thesis by A4,XBOOLE_0:def 5;
  end;
A5: C \ B \ {x} \/ B = C \/ B
  proof
    thus C \ B \ {x} \/ B c= C \/ B
    proof
      let y be object;
      assume y in C \ B \ {x} \/ B;
      then y in C \ B \ {x} or y in B by XBOOLE_0:def 3;
      hence thesis by XBOOLE_0:def 3;
    end;
    let y be object;
    assume y in C \/ B;
    then
A6: y in (C \ B) \/ B by XBOOLE_1:39;
    per cases by A6,XBOOLE_0:def 3;
    suppose
A7:   y in C \ B;
      then
A8:   y in C;
      not y in {x}
      proof
        assume y in {x};
        then x in C by A8,TARSKI:def 1;
        hence contradiction by A1,A2;
      end;
      then y in C \ B \ {x} by A7,XBOOLE_0:def 5;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose
      y in B;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
  set f = ((id A)+*(B --> x));
  f"({x})=B by A2,Th17;
  then f"(C \/ {x}) = f"(C) \/ B by RELAT_1:140;
  hence thesis by A1,A3,A5,Th16;
end;
