
theorem Th25:
  for m being CR_Sequence, i being Nat st i in dom m
for mm being Integer st mm = Product(m) / m.i holds mm, m.i are_coprime
proof
  defpred P[Nat] means for m being CR_Sequence st len m = $1 for i being
  Nat st i in dom m for mm being Integer st mm = Product(m) / m.i
  holds mm, m.i are_coprime;
  let m be CR_Sequence, i be Nat;
  assume
A1: i in dom m;
  let mm be Integer;
A2: ex l be Element of NAT st len m = l;
A3: now
    let k be Nat;
    assume
A4: P[k];
    now
      let m be CR_Sequence;
      set m1 = m|k;
      assume
A5:   len m = k+1;
      then
A6:   m1 ^ <*m.(k+1)*> = m|(k+1) by Th5
        .= m by A5,FINSEQ_1:58;
A7:   len m1 = k by A5,FINSEQ_1:59,NAT_1:11;
      1 <= k + 1 by NAT_1:11;
      then k+1 in Seg(k+1);
      then
A8:   k+1 in dom m by A5,FINSEQ_1:def 3;
      let i9 be Nat;
      reconsider i = i9 as Element of NAT by ORDINAL1:def 12;
      assume
A9:   i9 in dom m;
      then
A10:  i in Seg(k+1) by A5,FINSEQ_1:def 3;
      then
A11:  i <= k + 1 by FINSEQ_1:1;
      let mm be Integer;
      assume
A12:  mm = Product(m) / m.i9;
      per cases;
      suppose
        k > 0;
        then reconsider m1 as CR_Sequence by A5,Th24,NAT_1:11;
        per cases;
        suppose
A13:      i in dom m1;
          then i in Seg(k) by A7,FINSEQ_1:def 3;
          then i <= k by FINSEQ_1:1;
          then i <> k + 1 by NAT_1:13;
          then
A14:      m.i, m.(k+1) are_coprime by A9,A8,Def2;
          reconsider mm1 = Product(m1) / m1.i as Integer;
A15:      m1.i = m.i by A13,FUNCT_1:47;
          then mm1, m.i are_coprime by A4,A7,A13;
          then
A16:      m.i gcd (mm1 * m.(k+1)) = m.i gcd m.(k+1) by Th19
            .= 1 by A14;
          mm1 * m.(k+1) = (Product(m1) * m.(k+1)) * (m.i)" by A15
            .= mm by A12,A6,RVSUM_1:96;
          hence mm, m.i9 are_coprime by A16;
        end;
        suppose
A17:      not i in dom m1;
          m.(k+1) in rng m by A8,FUNCT_1:3;
          then
A18:      m.(k+1) > 0 by PARTFUN3:def 1;
          defpred Q[Nat] means $1 <= len m1 implies for s being Element of NAT
          st s = $1 holds Product(m1|s), m.(k+1) are_coprime;
A19:      m1|(len m1) = m1 by FINSEQ_1:58;
A20:      now
            let j be Element of NAT;
            assume that
            0 <= j and
A21:        j < len m1;
            assume
A22:        Q[j];
            now
              assume
A23:          j+1 <= len m1;
A24:          0 + 1 <= j + 1 by XREAL_1:6;
              then j+1 in Seg(len m1) by A23;
              then
A25:          j+1 in dom m1 by FINSEQ_1:def 3;
              j + 1 <= len m by A5,A7,A21,XREAL_1:8;
              then j+1 in Seg(len m) by A24;
              then
A26:          j+1 in dom m by FINSEQ_1:def 3;
              j+1 <= k by A5,A23,FINSEQ_1:59,NAT_1:11;
              then
A27:          j+1 <> k+1 by NAT_1:13;
              now
                reconsider s9 = j as Element of NAT;
                let s be Element of NAT;
A28:            m1.(j+1) = m.(j+1) by A25,FUNCT_1:47;
A29:            m.(j+1), m.(k+1) are_coprime by A8,A27,A26,Def2;
                j <= j + 1 by NAT_1:11;
                then
Product(m1|s9), m.(k+1) are_coprime by A22,A23,XXREAL_0:2;
                then
A30:            Product(m1|s9) * m.(j+1) gcd m.(k+1) = m.(j+1) gcd m.(k+1
                ) by Th19
                  .= 1 by A29;
                assume
A31:            s = j+1;
                then m1|s9 ^ <*m1.s*> = m1|s by A23,Th5;
                then Product(m1|s) gcd m.(k+1) = 1 by A31,A30,A28,RVSUM_1:96;
                hence Product(m1|s), m.(k+1) are_coprime;
              end;
              hence Q[j+1];
            end;
            hence Q[j+1];
          end;
          m1|0 is empty;
          then
A32:      Q[0] by RVSUM_1:94,WSIERP_1:9;
A33:      for j being Element of NAT st 0 <= j & j <= len m1 holds Q[j]
          from INT_1:sch 7(A32,A20);
          not i in Seg k by A7,A17,FINSEQ_1:def 3;
          then not(1 <= i & i <= k);
          then not i < k + 1 by A10,FINSEQ_1:1,NAT_1:13;
          then
A34:      i = k + 1 by A11,XXREAL_0:1;
          then mm = (Product(m1)*m.(k+1))*(m.(k+1))" by A12,A6,RVSUM_1:96
            .= Product(m1)* (m.(k+1)*(m.(k+1))")
            .= Product(m1) * 1 by A18,XCMPLX_0:def 7;
          hence mm, m.i9 are_coprime by A34,A33,A19;
        end;
      end;
      suppose
        k = 0;
        then
A35:    m = <*m.1*> by A5,FINSEQ_1:40;
        then
A36:    dom m = Seg 1 by FINSEQ_1:38;
        then
A37:    i <= 1 by A9,FINSEQ_1:1;
        1 <= i by A9,A36,FINSEQ_1:1;
        then
A38:    i = 1 by A37,XXREAL_0:1;
        Product(m) = m.1 by A35;
        then mm = 1 by A12,A38,XCMPLX_0:def 7;
        hence mm, m.i9 are_coprime by WSIERP_1:9;
      end;
    end;
    hence P[k+1];
  end;
A39: P[0];
A40: for k be Nat holds P[k] from NAT_1:sch 2(A39,A3);
  assume mm = Product(m) / m.i;
  hence thesis by A1,A40,A2;
end;
