
theorem Th11: ::p.121 lemma 3.2.(iii)
  for T,S being non empty TopSpace st T is injective for f being
  Function of T,S st corestr(f) is being_homeomorphism holds T is_Retract_of S
proof
  let T,S be non empty TopSpace;
  assume
A1: T is injective;
  let f be Function of T,S;
  consider g being Function of Image f, T such that
A2: g = (corestr f)";
  assume
A3: corestr(f) is being_homeomorphism;
  then g is continuous by A2,TOPS_2:def 5;
  then consider h being Function of S,T such that
A4: h is continuous and
A5: h|(the carrier of Image f) = g by A1;
  g is being_homeomorphism by A3,A2,TOPS_2:56;
  then
A6: g is one-to-one by TOPS_2:def 5;
A7: the carrier of Image f = rng f by Th9;
A8: for x being object st x in the carrier of T holds (h*f).x = x
  proof
    let x be object;
    assume
A9: x in the carrier of T;
    then
A10: x in dom (corestr f) by FUNCT_2:def 1;
A11: x in dom f by A9,FUNCT_2:def 1;
    then
A12: f.x in rng f by FUNCT_1:def 3;
A13: corestr f is one-to-one by A3,TOPS_2:def 5;
    thus (h*f).x = h.(f.x) by A11,FUNCT_1:13
      .= ((corestr f)").((corestr f).x) by A2,A5,A7,A12,FUNCT_1:49
      .= ((corestr f qua Function)").((corestr f).x) by A13,TOPS_2:def 4
      .= x by A10,A13,FUNCT_1:34;
  end;
  dom (h*f) = the carrier of T by FUNCT_2:def 1;
  then
A14: h*f = id (the carrier of T) by A8,FUNCT_1:17;
  take F = f*h;
  set H = h*(incl Image F);
A15: dom H = [#](Image F) by FUNCT_2:def 1;
  rng h c= the carrier of T;
  then
A16: rng h c= dom f by FUNCT_2:def 1;
A17: rng F c= rng f
  proof
    let y be object;
    assume y in rng F;
    then consider x being object such that
A18: x in dom F and
A19: y = F.x by FUNCT_1:def 3;
    x in the carrier of S by A18;
    then
A20: x in dom h by FUNCT_2:def 1;
    then
A21: h.x in rng h by FUNCT_1:def 3;
    f.(h.x) = y by A19,A20,FUNCT_1:13;
    hence thesis by A16,A21,FUNCT_1:def 3;
  end;
A22: H is one-to-one
  proof
    let x,y be Element of Image F;
    assume
A23: H.x = H.y;
A24: x in the carrier of Image F;
    then
A25: x in dom (incl Image F) by FUNCT_2:def 1;
A26: y in the carrier of Image F;
    then
A27: y in dom (incl Image F) by FUNCT_2:def 1;
A28: y in rng F by A26,Th9;
A29: x in rng F by A24,Th9;
    then reconsider a = x, b = y as Point of S by A28;
    reconsider x9 = x, y9 = y as Element of Image f by A17,A29,A28,Th9;
    g.x9 = h.x by A5,FUNCT_1:49
      .= h.((incl Image F).a) by TMAP_1:84
      .= (h*(incl Image F)).b by A23,A25,FUNCT_1:13
      .= h.((incl Image F).b) by A27,FUNCT_1:13
      .= h.y by TMAP_1:84
      .= g.y9 by A5,FUNCT_1:49;
    hence thesis by A6;
  end;
A30: dom incl Image F = the carrier of Image F by FUNCT_2:def 1;
A31: rng H = [#]T
  proof
    thus rng H c= [#](T);
    let y be object;
    assume
A32: y in [#](T);
    then
A33: y in dom f by FUNCT_2:def 1;
    then
A34: F.(f.y) = ((f*h)*f).y by FUNCT_1:13
      .= (f*id T).y by A14,RELAT_1:36
      .= f.y by FUNCT_2:17;
A35: f.y in rng f by A33,FUNCT_1:def 3;
    then reconsider pp = f.y as Point of S;
    f.y in the carrier of S by A35;
    then
A36: f.y in dom F by FUNCT_2:def 1;
    then F.(f.y) in rng F by FUNCT_1:def 3;
    then
A37: f.y in the carrier of Image F by A34,Th9;
    then
A38: y in dom((incl Image F)*f) by A30,A33,FUNCT_1:11;
    dom H = rng F by A15,Th9;
    then
A39: f.y in dom H by A36,A34,FUNCT_1:def 3;
    H.(f.y) = ((h*(incl Image F))*f).y by A33,FUNCT_1:13
      .= (h*((incl Image F)*f)).y by RELAT_1:36
      .= h.(((incl Image F)*f).y) by A38,FUNCT_1:13
      .= h.((incl Image F).pp) by A33,FUNCT_1:13
      .= h.(f.y) by A37,TMAP_1:84
      .= (id T).y by A14,A33,FUNCT_1:13
      .= y by A32,FUNCT_1:18;
    hence thesis by A39,FUNCT_1:def 3;
  end;
  reconsider p = incl(Image f) as Function of Image f,S;
A40: [#]S <> {};
A41: dom (p*(corestr f)) = the carrier of T by FUNCT_2:def 1
    .= dom f by FUNCT_2:def 1;
A42: for P being Subset of S holds f"P = (p*(corestr f))"P
  proof
    let P be Subset of S;
    hereby
      let x be object;
      assume
A43:  x in f"P;
      then
A44:  x in dom f by FUNCT_1:def 7;
      then f.x in rng f by FUNCT_1:def 3;
      then
A45:  f.x in the carrier of Image f by Th9;
A46:  f.x in P by A43,FUNCT_1:def 7;
      then reconsider y = f.x as Point of S;
      (p*(corestr f)).x = p.(f.x) by A44,FUNCT_1:13
        .= y by A45,TMAP_1:84;
      hence x in (p*(corestr f))"P by A41,A44,A46,FUNCT_1:def 7;
    end;
    let x be object;
    assume
A47: x in (p*(corestr f))"P;
    then
A48: x in dom(p*(corestr f)) by FUNCT_1:def 7;
    then
A49: f.x in rng f by A41,FUNCT_1:def 3;
    then reconsider y = f.x as Point of S;
A50: (p*(corestr f)).x in P by A47,FUNCT_1:def 7;
A51: f.x in the carrier of Image f by A49,Th9;
    (p*(corestr f)).x = p.(f.x) by A41,A48,FUNCT_1:13
      .= y by A51,TMAP_1:84;
    hence thesis by A41,A48,A50,FUNCT_1:def 7;
  end;
A52: corestr(f) is continuous by A3,TOPS_2:def 5;
A53: for P being Subset of Image F st P is open holds (H")"P is open
  proof
    let P be Subset of Image F;
A54: p is continuous by TMAP_1:87;
    (incl Image F).:P = P
    proof
      hereby
        let y be object;
        assume y in (incl Image F).:P;
        then consider x being object such that
A55:    x in dom (incl Image F) and
A56:    x in P & y = (incl Image F).x by FUNCT_1:def 6;
        x in the carrier of Image F by A55;
        then x in rng F by Th9;
        then reconsider xx = x as Point of S;
        (incl Image F).xx = x by A55,TMAP_1:84;
        hence y in P by A56;
      end;
      let y be object;
      assume
A57:  y in P;
      then
A58:  y in the carrier of Image F;
      then y in rng F by Th9;
      then reconsider yy = y as Point of S;
A59:  yy = (incl Image F).y by A57,TMAP_1:84;
      y in dom (incl Image F) by A58,FUNCT_2:def 1;
      hence thesis by A57,A59,FUNCT_1:def 6;
    end;
    then
A60: H.:P = h.:P by RELAT_1:126;
    assume P is open;
    then P in the topology of Image F;
    then consider Q being Subset of S such that
A61: Q in the topology of S and
A62: P = Q /\ [#](Image F) by PRE_TOPC:def 4;
    reconsider Q as Subset of S;
A63: f"Q = h.:P
    proof
      hereby
        let x be object;
        assume
A64:    x in f"Q;
        then
A65:    x in dom f by FUNCT_1:def 7;
        then
A66:    h.(f.x) = (id T).x by A14,FUNCT_1:13
          .= x by A64,FUNCT_1:18;
        f.x in rng f by A65,FUNCT_1:def 3;
        then
A67:    f.x in the carrier of S;
        then
A68:    f.x in dom h by FUNCT_2:def 1;
A69:    f.x in dom F by A67,FUNCT_2:def 1;
        F.(f.x) = f.(h.(f.x)) by A68,FUNCT_1:13
          .= f.((id T).x) by A14,A65,FUNCT_1:13
          .= f.x by A64,FUNCT_1:18;
        then f.x in rng F by A69,FUNCT_1:def 3;
        then
A70:    f.x in the carrier of Image F by Th9;
        f.x in Q by A64,FUNCT_1:def 7;
        then f.x in P by A62,A70,XBOOLE_0:def 4;
        hence x in h.:P by A68,A66,FUNCT_1:def 6;
      end;
      let x be object;
      assume x in h.:P;
      then consider y being object such that
A71:  y in dom h and
A72:  y in P and
A73:  x = h.y by FUNCT_1:def 6;
A74:  y in Q by A62,A72,XBOOLE_0:def 4;
      y in the carrier of Image F by A72;
      then
A75:  y in rng F by Th9;
A76:  x in rng h by A71,A73,FUNCT_1:def 3;
      then f.x in rng f by A16,FUNCT_1:def 3;
      then reconsider a = f.x, b = y as Element of Image f by A17,A75,Th9;
      g.a = h.(f.x) by A5,FUNCT_1:49
        .= (id T).x by A16,A14,A76,FUNCT_1:13
        .= h.y by A73,A76,FUNCT_1:18
        .= g .b by A5,FUNCT_1:49;
      then f.x in Q by A6,A74;
      hence thesis by A16,A76,FUNCT_1:def 7;
    end;
    Q is open by A61;
    then (p*(corestr f))"Q is open by A40,A52,A54,TOPS_2:43;
    then f"Q is open by A42;
    hence thesis by A31,A22,A63,A60,TOPS_2:54;
  end;
A77: p is continuous by TMAP_1:87;
A78: [#]T <> {};
  for P being Subset of S st P is open holds F"P is open
  proof
    let P be Subset of S;
    assume P is open;
    then (p*(corestr f))"P is open by A40,A52,A77,TOPS_2:43;
    then f"P is open by A42;
    then h"(f"P) is open by A78,A4,TOPS_2:43;
    hence thesis by RELAT_1:146;
  end;
  hence F is continuous by A40,TOPS_2:43;
  thus F*F = (f*h*f)*h by RELAT_1:36
    .= f*(id T)*h by A14,RELAT_1:36
    .= F by FUNCT_2:17;
  [#]Image F <> {};
  then incl Image F is continuous & H" is continuous by A53,TMAP_1:87,TOPS_2:43
;
  then H is being_homeomorphism by A4,A15,A31,A22,TOPS_2:def 5;
  hence thesis by T_0TOPSP:def 1;
end;
