
theorem Th20:
  for a,b being non zero Nat holds
  (for p being Element of NAT st p is prime holds p |-count a <= p |-count b)
  implies ex c being Element of NAT st b = a*c
proof
A1: for a,a1,b,b1 being non zero Nat, x being Prime st (for p being
Element of NAT st p is prime holds p |-count a <= p |-count b) & a1=a div (x|^(
x|-count a)) & b1=b div (x|^(x|-count b)) holds for p being Element of NAT st p
  is prime holds p |-count a1 <= p |-count b1
  proof
    let a,a1,b,b1 be non zero Nat;
    let x be Prime;
    assume
A2: for p being Element of NAT st p is prime holds p |-count a <= p |-count b;
    set xcb=x|-count b;
    set xca=x|-count a;
    assume
A3: a1=a div (x|^(x|-count a));
    assume
A4: b1=b div (x|^(x|-count b));
    let p be Element of NAT;
    assume
A5: p is prime;
    then
A6: p>1 by INT_2:def 4;
A7: x>1 by INT_2:def 4;
    then x|^xca divides a by NAT_3:def 7;
    then
A8: p|-count a1 =(p|-count a)-'(p|-count x|^xca) by A3,A5,NAT_3:31;
    x|^xcb divides b by A7,NAT_3:def 7;
    then
A9: p|-count b1 = (p|-count b)-'(p|-count x|^xcb) by A4,A5,NAT_3:31;
    per cases;
    suppose
      x=p;
      then p|-count x|^xca = p|-count a by A6,NAT_3:25;
      hence thesis by A8,NAT_2:8;
    end;
    suppose
A10:  x<>p;
      p|-count x|^xcb=xcb * (p|-count x) by A5,NAT_3:32
        .= xcb * 0 by A6,A10,NAT_3:24
        .= 0;
      then
A11:  p|-count b1=(p|-count b)-0 by A9,XREAL_1:233
        .=p|-count b;
      p|-count x|^xca=xca * (p|-count x) by A5,NAT_3:32
        .= xca * 0 by A6,A10,NAT_3:24
        .= 0;
      then p|-count a1=(p|-count a)-0 by A8,XREAL_1:233
        .=p|-count a;
      hence thesis by A2,A5,A11;
    end;
  end;
A12: for a being non zero Nat, x being Prime holds a div (x|^(x|-count a))
  is non zero Nat
  proof
    let a be non zero Nat;
    let x be Prime;
    assume
A13: not a div (x|^(x|-count a)) is non zero Nat;
      set xca=x|^(x|-count a);
      x>1 by INT_2:def 4;
      then
A14:  xca divides a by NAT_3:def 7;
      ex t being Nat st a = xca * (0 qua Nat) + t & t < xca by A13,NAT_D:def 1;
      hence contradiction by A14,NAT_D:7;
  end;
  defpred P[Nat] means for a,b being non zero Nat st card(support
  pfexp b)=$1 holds (for p being Element of NAT st p is prime holds p |-count a
  <= p |-count b) implies (ex c being Element of NAT st b=a*c);
  let a,b be non zero Nat;
  assume
A15: for p being Element of NAT st p is prime holds p |-count a <= p |-count b;
A16: ex n1 being Element of NAT st n1=card(support pfexp b);
A17: for n1,n2 being non zero Nat st n1 divides n2 holds (n2 div n1)*n1 = n2
  proof
    let n1,n2 be non zero Nat;
    assume n1 divides n2;
    then ex a being Nat st n2=n1*a by NAT_D:def 3;
    hence thesis by NAT_D:18;
  end;
A18: for b,b1 being non zero Nat, x being Prime, n being Element of NAT st
  card(support pfexp b)=n+1 & b1=b div (x|^(x|-count b)) & x in support pfexp b
  holds card(support pfexp b1)=n
  proof
    let b,b1 be non zero Nat;
    let x be Prime;
    let n be Element of NAT;
    assume
A19: card(support pfexp b)=n+1;
    set xcb=x|-count b;
    assume
A20: b1=b div (x|^(x|-count b));
A21: x>1 by INT_2:def 4;
    then x|^xcb divides b by NAT_3:def 7;
    then
A22: b=b1*x|^xcb by A17,A20;
    reconsider b1 as Element of NAT by ORDINAL1:def 12;
A23: b1,x are_coprime
    proof
      assume not b1,x are_coprime;
      then b1 gcd x = x by PEPIN:2;
      then x divides b1 by NAT_D:def 5;
      then consider c be Nat such that
A24:  b1=x*c by NAT_D:def 3;
A25:  not x|^(xcb+1) divides b by A21,NAT_3:def 7;
      x|^xcb divides b by A21,NAT_3:def 7;
      then b = x*c*x|^xcb by A17,A20,A24
        .= c*(x|^xcb*x)
        .= c*x|^(xcb+1) by NEWTON:6;
      hence contradiction by A25,NAT_D:def 3;
    end;
    assume x in support pfexp b;
    then (pfexp b).x<>0 by PRE_POLY:def 7;
    then
A26: xcb<>0 by NAT_3:def 8;
    reconsider b1 as non zero Nat;
    card support pfexp (x|^xcb*b1) = card support pfexp x|^xcb + card
    support pfexp b1 by A23,EULER_2:17,NAT_3:47;
    then n+1=card {x} + card support pfexp b1 by A19,A22,A26,NAT_3:42;
    then n+1=1+card (support pfexp b1) by CARD_2:42;
    hence thesis;
  end;
A27: for n being Nat holds P[n] implies P[n+1]
  proof
    let n be Nat;
    assume
A28: P[n];
    for a,b being non zero Nat st card(support pfexp b)=n+1 holds (for p
being Element of NAT st p is prime holds p |-count a <= p |-count b) implies ex
    c being Element of NAT st b=a*c
    proof
      let a,b be non zero Nat;
      assume
A29:  card(support pfexp b)=n+1;
      then support pfexp b<>{};
      then consider x being object such that
A30:  x in support pfexp b;
      reconsider x as Prime by A30,NAT_3:34;
      set a1=a div (x|^(x|-count a));
      set b1=b div (x|^(x|-count b));
      reconsider a1,b1 as non zero Nat by A12;
      assume
A31:  for p being Element of NAT st p is prime holds p |-count a <= p
      |-count b;
      then
A32:  for p being Element of NAT st p is prime holds p |-count a1 <= p
      |-count b1 by A1;
      set xca=x|-count a;
      set xcb=x|-count b;
      x in NAT by ORDINAL1:def 12;
      then
A33:  xcb-xca=xcb-'xca by A31,XREAL_1:233;
      n in NAT by ORDINAL1:def 12;
      then card(support pfexp b1)=n by A18,A29,A30;
      then consider d be Element of NAT such that
A34:  b1=a1*d by A28,A32;
      reconsider e=d*x|^(xcb-'xca) as Element of NAT by ORDINAL1:def 12;
      take e;
A35:  x<>1 by INT_2:def 4;
      then
A36:  x|^(xca) divides a by NAT_3:def 7;
      x|^(xcb) divides b by A35,NAT_3:def 7;
      then b = d*(a div (x|^xca))*(x|^(xca+(xcb-'xca))) by A17,A34,A33
        .= d*(a div (x|^xca))*(x|^xca*x|^(xcb-'xca)) by NEWTON:8
        .= d*((a div (x|^xca))*x|^xca)*x|^(xcb-'xca)
        .= d*a*x|^(xcb-'xca) by A17,A36
        .= a*(d*x|^(xcb-'xca));
      hence thesis;
    end;
    hence thesis;
  end;
A37: P[0]
  proof
    let a,b be non zero Nat;
    assume
A38: card support pfexp b=0;
    (for p being Element of NAT st p is prime holds p |-count a <= p
    |-count b) implies ex c being Element of NAT st b=a*c
    proof
      set d=1;
      assume
A39:  for p being Element of NAT st p is prime holds p |-count a <= p
      |-count b;
      take d;
A40:  (support pfexp b)={} by A38;
      (support pfexp a)={}
      proof
        assume (support pfexp a)<>{};
        then consider x be object such that
A41:    x in support pfexp a;
        reconsider x as Prime by A41,NAT_3:34;
        reconsider x as prime Element of NAT by ORDINAL1:def 12;
        (pfexp a).x<>0 by A41,PRE_POLY:def 7;
        then x|-count a<>0 by NAT_3:def 8;
        then x|-count b>0 by A39;
        then (pfexp b).x<>0 by NAT_3:def 8;
        hence contradiction by A40,PRE_POLY:def 7;
      end;
      then a=1 by NAT_3:52;
      hence thesis by A40,NAT_3:52;
    end;
    hence thesis;
  end;
  for n being Nat holds P[n] from NAT_1:sch 2(A37,A27);
  hence thesis by A15,A16;
end;
