reserve R for Ring,
  I for Ideal of R,
  a, b for Element of R;
reserve R for add-associative right_zeroed right_complementable Abelian
    distributive left_unital non empty doubleLoopStr;
reserve I for Ideal of R;
reserve a,b for Element of R;
reserve x, y for Element of R/I;

theorem Th19:
  for R being Ring, I being Ideal of R st
    R is commutative & I is quasi-maximal holds R/I is almost_left_invertible
proof
  let R be Ring, I be Ideal of R;
  set E = EqRel(R,I);
  assume that
A1: R is commutative and
A2: I is quasi-maximal;
  let x be Element of R/I such that
A3: x <> 0.(R/I);
  consider a being Element of R such that
A4: x = Class(E,a) by Th11;
  set M = {a*r+s where r, s is Element of R: s in I};
  M c= the carrier of R
  proof
    let k be object;
    assume k in M;
    then ex r, s being Element of R st k = a*r+s & s in I;
    hence thesis;
  end;
  then reconsider M as Subset of R;
A5: 0.R in I by IDEAL_1:2;
A6: M is left-ideal
  proof
    let p, x be Element of R;
    assume x in M;
    then consider r, s being Element of R such that
A7: x = a*r+s and
A8: s in I;
A9: p*s in I by A8,IDEAL_1:def 2;
    a*(r*p)+p*s = a*r*p+p*s by GROUP_1:def 3
      .= a*r*p+s*p by A1
      .= x*p by A7,VECTSP_1:def 3
      .= p*x by A1;
    hence thesis by A9;
  end;
A10: I c= M
  proof
    let i be object;
    assume i in I;
    then reconsider i as Element of I;
    a*0.R+i = 0.R+i
      .= i by RLVECT_1:def 4;
    hence thesis;
  end;
A11: M is right-ideal
  proof
    let p, x be Element of R;
    assume x in M;
    then consider r, s being Element of R such that
A12: x = a*r+s and
A13: s in I;
A14: p*s in I by A13,IDEAL_1:def 2;
    a*(r*p)+p*s = a*r*p+p*s by GROUP_1:def 3
      .= a*r*p+s*p by A1
      .= x*p by A12,VECTSP_1:def 3;
    hence thesis by A14;
  end;
A15: M is add-closed
  proof
    let c, d be Element of R;
    assume c in M;
    then consider rc, sc being Element of R such that
A16: c = a*rc+sc and
A17: sc in I;
    assume d in M;
    then consider rd, sd being Element of R such that
A18: d = a*rd+sd and
A19: sd in I;
A20: a*(rc+rd)+(sc+sd) = a*rc+a*rd+(sc+sd) by VECTSP_1:def 2
      .= a*rc+a*rd+sc+sd by RLVECT_1:def 3
      .= a*rc+sc+a*rd+sd by RLVECT_1:def 3
      .= c+d by A16,A18,RLVECT_1:def 3;
    sc+sd in I by A17,A19,IDEAL_1:def 1;
    hence c+d in M by A20;
  end;
A21: now
A22: a-0.R = a by RLVECT_1:13;
    assume a in I;
    then Class(E,a) = Class(E,0.R) by A22,Th6
      .= 0.(R/I) by Def6;
    hence contradiction by A3,A4;
  end;
  a*1.R+0.R = a+0.R
    .= a by RLVECT_1:def 4;
  then a in M by A5;
  then M is non proper by A2,A15,A6,A11,A21,A10;
  then M = the carrier of R by SUBSET_1:def 6;
  then 1.R in M;
  then consider b, m being Element of R such that
A23: 1.R = a*b+m and
A24: m in I;
A25: m = 1.R-a*b by A23,VECTSP_2:2;
  reconsider y = Class(E,b) as Element of R/I by Th12;
  take y;
A26: Class(E,1.R) = 1.(R/I) by Def6;
  thus y*x = Class(E,b*a) by A4,Th14
    .= Class(E,a*b) by A1
    .= 1.(R/I) by A24,A25,A26,Th6;
end;
