reserve i,i1,i2,i3,i4,i5,j,r,a,b,x,y for Integer,
  d,e,k,n for Nat,
  fp,fk for FinSequence of INT,
  f,f1,f2 for FinSequence of REAL,
  p for Prime;
reserve fr for FinSequence of REAL;
reserve fr,f for FinSequence of INT;
reserve b,m for Nat;
reserve b for Integer;

theorem
  p>2 & a gcd p=1 & b gcd p=1 implies Lege(a*b,p)=Lege(a,p)*Lege(b,p)
proof
  assume that
A1: p>2 and
A2: a gcd p=1 and
A3: b gcd p=1;
A4: Lege(b,p),b|^((p-'1) div 2) are_congruent_mod p by A1,A3,Th28;
  Lege(a,p),a|^((p-'1) div 2) are_congruent_mod p by A1,A2,Th28;
  then Lege(a,p)*Lege(b,p),(a|^((p-'1) div 2))*(b|^((p-'1) div 2))
  are_congruent_mod p by A4,INT_1:18;
  then Lege(a,p)*Lege(b,p),(a*b)|^((p-'1) div 2) are_congruent_mod p by
NEWTON:7;
  then
A5: (a*b)|^((p-'1) div 2),Lege(a,p)*Lege(b,p) are_congruent_mod p by INT_1:14;
  a*b gcd p = 1 by A2,A3,WSIERP_1:6;
  then Lege(a*b,p),(a*b)|^((p-'1) div 2) are_congruent_mod p by A1,Th28;
  then Lege(a*b,p),Lege(a,p)*Lege(b,p) are_congruent_mod p by A5,INT_1:15;
  then
A6: p divides (Lege(a*b,p)-Lege(a,p)*Lege(b,p));
A7: Lege(b,p) = 1 or Lege(b,p) = -1 or Lege(b,p) = 0 by Th25;
A8: Lege(a,p) = 1 or Lege(a,p) = -1 or Lege(a,p) = 0 by Th25;
  per cases by Th25;
  suppose
A9: Lege(a*b,p) = 1;
    now
      assume Lege(a,p) = 0 or Lege(b,p) = 0; then
      p = 1 by A6,A9,WSIERP_1:15;
      hence contradiction by A1;
    end;
    hence thesis by A8,A7,A1,A6,A9,NAT_D:7;
  end;
  suppose
A10: Lege(a*b,p) = 0;
A11: now
      assume Lege(a,p) * Lege(b,p) = -1; then
      p <= 1 by A6,A10,NAT_D:7; then
      p < 1+1 by NAT_1:13;
      hence contradiction by A1;
    end;
    now
      assume Lege(a,p) * Lege(b,p) = 1; then
      p divides 1 by A6,A10,INT_2:10; then
      p <= 1 by NAT_D:7; then
      p < 1+1 by NAT_1:13;
      hence contradiction by A1;
    end;
    hence thesis by A8,A7,A11,A10;
  end;
  suppose
A12: Lege(a*b,p) = -1;
A13: now
      assume Lege(a,p) = 0 or Lege(b,p) = 0; then
      p = 1 or p = -1 by A6,A12,INT_2:13;
      hence contradiction by INT_2:def 4;
    end;
    now
      assume Lege(a,p) * Lege(b,p) = 1; then
      p divides (-2) by A6,A12; then
      p divides 2 by INT_2:10;
      hence contradiction by A1,NAT_D:7;
    end;
    hence thesis by A12,A13,A7,A8;
  end;
end;
