reserve a,b for Complex;
reserve z for Complex;
reserve n0 for non zero Nat;
reserve a0,a1,a2,s1,s2 for Complex;
reserve a3,x,q,r,s,s3 for Complex;

theorem Th18:
  1_root_of_cubic(a0,a1,a2) * 2_root_of_cubic(a0,a1,a2) +
1_root_of_cubic(a0,a1,a2) * 3_root_of_cubic(a0,a1,a2) + 2_root_of_cubic(a0,a1,
  a2) * 3_root_of_cubic(a0,a1,a2) = a1
proof
  per cases;
  suppose
A1: 3*a1 - a2|^2 = 0;
    set r = (9*a2*a1 - 2*a2|^3 - 27*a0)/54, s1 = 3-root(2*r);
A2: ( ex r,s1 st r = (9*a2*a1 - 2*a2|^3 - 27*a0)/54 & s1 = 3-root(2*r) &
2_root_of_cubic(a0,a1,a2) = -s1/2-a2/3+s1*(2-root 3)*<i>/2)& ex r,s1 st r = (9
*a2*a1 - 2*a2|^3 - 27*a0)/54 & s1 = 3-root(2*r) & 3_root_of_cubic(a0,a1,a2) = -
    s1/2-a2/3-s1*(2-root 3)*<i>/2 by A1,Def3,Def4;
    thus 1_root_of_cubic(a0,a1,a2) * 2_root_of_cubic(a0,a1,a2) +
1_root_of_cubic(a0,a1,a2) * 3_root_of_cubic(a0,a1,a2) + 2_root_of_cubic(a0,a1,
a2) * 3_root_of_cubic(a0,a1,a2) = 1_root_of_cubic(a0,a1,a2) * (2_root_of_cubic(
    a0,a1,a2) + 3_root_of_cubic(a0,a1,a2)) + 2_root_of_cubic(a0,a1,a2) *
    3_root_of_cubic(a0,a1,a2)
      .= (s1-a2/3)*((-s1/2-a2/3+s1*(2-root 3)*<i>/2)+ (-s1/2-a2/3-s1*(2-root
3)*<i>/2))+ (-s1/2-a2/3+s1*(2-root 3)*<i>/2)* (-s1/2-a2/3-s1*(2-root 3)*<i>/2)
    by A1,A2,Def2
      .= (-3*s1*s1/4-a2*s1/3+3*a2*a2/9+a2*s1/3) -(s1*s1*((2-root 3)*(2-root
    3))*(-1)/2/2)
      .= (-3*s1*s1/4+a2*a2/3)-(s1*s1*((2-root 3)|^2)*(-1)/2/2) by Th1
      .= (-3*s1*s1/4+a2*a2/3)-(s1*s1*3*(-1)/2/2) by Th7
      .= (a2|^2)/3 by Th1
      .= a1 by A1;
  end;
  suppose
A3: 3*a1 - a2|^2 <> 0;
    set q = (3*a1 - a2|^2)/9, r = (9*a2*a1 - 2*a2|^3 - 27*a0)/54, s = 2-root(q
    |^3+r|^2), s1 = 3-root(r+s), s2 = -q/s1;
A4: s1 <> 0
    proof
      assume s1 = 0;
      then
A5:   0 = s1|^3 by NEWTON:11
        .= r+s by Th7;
      q|^3+r|^2 = s|^2 by Th7
        .= s*s by Th1
        .= (-s)*(-s)
        .= r|^2 by A5,Th1;
      then q*q*q = 0 by Th2;
      hence contradiction by A3;
    end;
A6: ( ex q,r,s,s1,s2 st q = (3*a1 - a2|^2)/9 & r = (9*a2*a1 - 2*a2|^3 - 27
    *a0)/54 & s = 2-root(q|^3+r|^2) & s1 = 3-root(r+s) & s2 = -q/s1 &
2_root_of_cubic(a0,a1, a2) = -(s1+s2)/2-a2/3+(s1-s2)*(2-root 3)*<i>/2)& ex q,r,
s,s1,s2 st q = (3*a1 - a2|^2)/9 & r = (9*a2*a1 - 2*a2|^3 - 27*a0)/54 & s = 2
-root(q|^3+r|^2) & s1 = 3 -root(r+s) & s2 = -q/s1 & 3_root_of_cubic(a0,a1,a2) =
    -(s1+s2)/2-a2/3-(s1-s2)*( 2-root 3)*<i>/2 by A3,Def3,Def4;
    set t = s1+s2, d = s1-s2;
    thus 1_root_of_cubic(a0,a1,a2) * 2_root_of_cubic(a0,a1,a2) +
1_root_of_cubic(a0,a1,a2) * 3_root_of_cubic(a0,a1,a2) + 2_root_of_cubic(a0,a1,
a2) * 3_root_of_cubic(a0,a1,a2) = 1_root_of_cubic(a0,a1,a2) * (2_root_of_cubic(
    a0,a1,a2) + 3_root_of_cubic(a0,a1,a2)) + 2_root_of_cubic(a0,a1,a2) *
    3_root_of_cubic(a0,a1,a2)
      .= (t-a2/3)*((-t/2-a2/3+d*(2-root 3)*<i>/2)+ (-t/2-a2/3-d*(2-root 3)*
<i>/2))+(-t/2-a2/3+d*(2-root 3)*<i>/2)* (-t/2-a2/3-d*(2-root 3)*<i>/2) by A3,A6
,Def2
      .= (-3*t*t/4-a2*t/3+3*a2*a2/9+a2*t/3)-(d*d*((2-root 3)*(2-root 3))*(-1
    )/4)
      .= (-3*t*t/4+a2*a2/3)-(d*d*((2-root 3)|^2)*(-1)/4) by Th1
      .= (-3*t*t/4+a2*a2/3)-(d*d*(3)*(-1)/4) by Th7
      .= 3*s1*(q/s1)+a2*a2/3
      .= 3*q+a2*a2/3 by A4,XCMPLX_1:90
      .= 3*q+a2|^2/3 by Th1
      .= a1;
  end;
end;
