reserve M,N for AbGroup;
 reserve R for Ring;
 reserve r for Element of R;
reserve M,N for LeftMod of R;
reserve f,g,h for Element of Funcs(the carrier of M, the carrier of N);
reserve a,b for Element of the carrier of R;
reserve R for comRing;
reserve M,M1,N,N1 for LeftMod of R;

theorem
    for R,M holds Hom(R,LeftModule(R),M) ~= M
    proof
      let R,M;
      reconsider R1 = LeftModule(R) as LeftMod of R;
reconsider m1 = 1.R as Element of R1;
      deffunc F(Element of Funcs(the carrier of R1,the carrier of M)) = $1.m1;
      consider G be Function of
      Funcs(the carrier of R1, the carrier of M),M such that
A1:   for x be Element of Funcs(the carrier of R1,the carrier of M) holds
      G.x = F(x) from FUNCT_2:sch 4;
A2:   for f,g be Element of Funcs(the carrier of R1,the carrier of M) holds
      G.(ADD(R1,M).(f,g)) = G.f + G.g
      proof
        let f,g be Element of Funcs(the carrier of R1,the carrier of M);
        set h = ADD(R1,M).(f,g);
        G.h = h.m1 & G.f = f.m1 & G.g = g.m1 by A1;
        hence thesis by Th15;
      end;
A3:   for f be Element of Funcs(the carrier of R1,the carrier of M),
      a be Element of R holds G.((LMULT(R1,M)).[a,f]) = a*(G.f)
      proof
        let f be Element of Funcs(the carrier of R1,the carrier of M),
        a be Element of R;
        set h = (LMULT(R1,M)).[a,f];
        G.h = h.m1 & G.f = f.m1 by A1;
        hence thesis by Th16;
      end;
      set H = Hom(R,R1,M);
      set caH = the carrier of Hom(R,R1,M);
      set G1 = G|caH;
A4:   dom G = Funcs(the carrier of R1, the carrier of M) by FUNCT_2:def 1;
A5:   dom G1 = caH /\ dom G by RELAT_1:61 .= caH by A4,XBOOLE_1:28;
A6:   for y be object st y in rng G1 holds y in the carrier of M
      proof
        let y be object;
        assume y in rng G1; then
        consider x be object such that
A8:     x in dom G1 & y = G1.x by FUNCT_1:def 3;
        G.x in the carrier of M by FUNCT_2:5,A8;
        hence thesis by A8,FUNCT_1:49,A5;
      end;
reconsider G1 as Function of Hom(R,R1,M),M by A5, A6,TARSKI:def 3, FUNCT_2:2;
A10: for f,g be Element of Hom(R,R1,M) holds
      G1.(f+g) = G1.f + G1.g
      proof
        let f,g be Element of Hom(R,R1,M);
A11:    f is Homomorphism of R,R1,M & g is Homomorphism of R,R1,M by Lm29;
reconsider f1 = f, g1 = g as Homomorphism of R,R1,M by Lm29;
reconsider f0 = f, g0 = g as
        Element of Funcs(the carrier of R1,the carrier of M) by A11,Th21;
        (ADD(R1,M)).(f1,g1) is Homomorphism of R,R1,M by Th21; then
A12:    (ADD(R1,M)).(f1,g1) in caH;
A13:    G1.f = G.f0 by FUNCT_1:49;
A14:    G1.g = G.g0 by FUNCT_1:49;
        G1.(f+g) = G1.((add_Hom(R1,M)).[f1,g1])
        .= G1.(ADD(R1,M).(f,g)) by Th21
        .= G.(ADD(R1,M).(f0,g0)) by A12,FUNCT_1:49
        .= G1.f + G1.g by A2,A13,A14;
        hence thesis;
      end;
A15:  G1 is additive by A10;
      for f be Element of Hom(R,R1,M), a be Element of R holds
      G1.(a*f) = a*G1.f
      proof
        let f be Element of Hom(R,R1,M), a be Element of R;
A16:    f is Homomorphism of R,R1,M by Lm29;
        reconsider f1 = f as Homomorphism of R,R1,M by Lm29;
reconsider f0 = f as Element of
           Funcs(the carrier of R1,the carrier of M) by A16,Th21;
A17:    (lmult_Hom(R1,M)).[a,f1] = (LMULT(R1,M)).[a,f1] &
        (LMULT(R1,M)).[a,f1] is Homomorphism of R,R1,M by Th22;
A18:    (LMULT(R1,M)).[a,f1] in caH by A17;
        G1.(a*f) = G1.((lmult_Hom(R1,M)).[a,f1])
        .= G1.((LMULT(R1,M)).[a,f]) by Th22
        .= G.((LMULT(R1,M)).[a,f]) by A18,FUNCT_1:49
        .= a*(G.f0) by A3 .= a*G1.f by FUNCT_1:49;
        hence thesis;
      end; then
      G1 is homogeneous; then
      reconsider G1 as Homomorphism of R,H,M by A15,Def10;
A19:  ker G1 = {0.Hom(R,R1,M)}
      proof
        G1.0.H = G1.(0.H+0.H) by RLVECT_1:4 .= G1.0.H + G1.0.H by A10; then
        G1.0.H = 0.M by RLVECT_1:9; then
        0.H in ker G1; then
A20:    for f be object holds f in {0.H} implies f in ker G1 by TARSKI:def 1;
        for f be object holds f in ker G1 implies f in {0.H}
        proof
          let f be object;
          assume f in ker G1; then
          consider f1 be Element of set_Hom(R1,M) such that
A22:      f1 = f & G1.f1 = 0.M;
          reconsider f1 as Homomorphism of R,R1,M by Lm29;
          reconsider f0 = f1 as Element of
             Funcs(the carrier of R1,the carrier of M);
A23:      f1 is additive & f1 is homogeneous by Def10;
A24:      0.M = G.f0 by A22,FUNCT_1:49 .= f0.m1 by A1;
          for a be Element of R1 holds f0.a = 0.M
          proof
            let a be Element of R1;
            reconsider a0 = a as Element of R;
            a0*m1 = a0*1.R .= a0; then
            f1.a = a0*0.M by A23,A24 .= 0.M by VECTSP_1:14;
            hence thesis;
          end; then
          f0 = R1 --> 0.M; then
          f0 = ZeroMap(R1,M) by GRCAT_1:def 7;
          hence thesis by A22, TARSKI:def 1;
        end;
        hence thesis by A20,TARSKI:2;
       end;
       for y be object holds y in the carrier of M implies y in rng G1
       proof
         let y be object;
         assume y in the carrier of M; then
         reconsider y0 = y as Element of M;
         defpred P[object,object] means
         ex x1 be object st x1 in the carrier of R & x1 = $1 &
         ex x0 be Element of R st x0 = x1 & $2 = x0*y0;
A26:     for x be object st x in the carrier of R1
         ex y be object st y in the carrier of M & P[x,y]
         proof
           let x be object;
           assume x in the carrier of R1; then
           reconsider x0 = x as Element of R;
           consider y be object such that
A28:       y in the carrier of M & y = x0*y0;
           thus thesis by A28;
         end;
         consider h being Function of R1,the carrier of M such that
A29:     for z being object st z in the carrier of R1
         holds P[z,h.z] from FUNCT_2:sch 1(A26);
         for a,b be Element of R1 holds h.(a+b) = h.a + h.b
         proof
           let a,b be Element of R1;
           consider a1 be object such that
A30:       a1 in the carrier of R & a = a1 &
           ex a0 be Element of R st a0 = a1 & h.a = a0*y0 by A29;
           consider a0 be Element of R such that
A31:       a0 = a1 & h.a = a0*y0 by A30;
           consider b1 be object such that
A32:       b1 in the carrier of R & b = b1 &
           ex b0 be Element of R st b0 = b1 & h.b = b0*y0 by A29;
           consider b0 be Element of R such that
A33:       b0 = b1 & h.b = b0*y0 by A32;
           reconsider ab = a+ b as Element of R1;
           consider ab1 be object such that
A34:       ab1 in the carrier of R & ab = ab1 &
           ex ab0 be Element of R st ab0 = ab1 & h.ab = ab0*y0 by A29;
           consider ab0 be Element of R such that
A35:       ab0 = ab1 & h.ab = ab0*y0 by A34;
           ab0 = a0 + b0 by A30,A31,A32,A33,A34,A35;
           hence thesis by A33,A31,VECTSP_1:def 15,A35;
         end; then
A37:     h is additive;
         for a be Element of R,b be Element of R1 holds h.(a*b) = a*(h.b)
         proof
           let a be Element of R,b be Element of R1;
           reconsider ab = a*b as Element of R1;
           consider b1 be object such that
A38:       b1 in the carrier of R & b = b1 &
           ex b0 be Element of R st b0 = b1 & h.b = b0*y0 by A29;
           consider b0 be Element of R such that
A39:       b0 = b1 & h.b = b0*y0 by A38;
           reconsider ab = a*b as Element of R1;
           consider ab1 be object such that
A40:       ab1 in the carrier of R & ab = ab1 &
           ex ab0 be Element of R st ab0 = ab1 & h.ab = ab0*y0 by A29;
           consider ab0 be Element of R such that
A41:       ab0 = ab1 & h.ab = ab0*y0 by A40;
           reconsider ab9 = a*b0 as Element of R;
           a*b0 = ab0 by A41,A40,A39,A38;
           hence thesis by A39,A41,VECTSP_1:def 16;
         end; then
A43:     h is homogeneous; then
A44:     h is Homomorphism of R,R1,M by A37,Def10;
         reconsider h1 = h as Homomorphism of R,R1,M by A43,A37,Def10;
         reconsider h0 = h as Element of
           Funcs(the carrier of R1,the carrier of M) by A44,Th21;
         consider m be object such that
A45:     m in the carrier of R & m1 = m &
         ex m0 be Element of R st m0 = m & h.m1 = m0*y0 by A29;
         reconsider n1 = m1 as Element of R;
         h0 in caH by A44; then
A47:     G1.h = G.h0 by FUNCT_1:49
         .= n1*y0 by A1,A45
         .= y;
         h in dom G1 by A5,A44;
         hence thesis by A47,FUNCT_1:def 3;
       end; then
       G1 is onto by A6,TARSKI:2;
       hence thesis by A19,Th13;
     end;
