reserve x,y,z for Real,
  a,b,c,d,e,f,g,h for Nat,
  k,l,m,n,m1,n1,m2,n2 for Integer,
  q for Rational;
reserve fs,fs1,fs2,fs3 for FinSequence;
reserve D for non empty set,
  v,v1,v2,v3 for object,
  fp for FinSequence of NAT,
  fr,fr1,fr2 for FinSequence of INT,
  ft for FinSequence of REAL;
reserve x,y,t for Integer;

theorem Th36:
  for d holds (for a st a in dom fp holds fp.a gcd d=1) implies
  Product(fp) gcd d = 1
proof
  let d;
  defpred TH[set] means ex f being FinSequence of NAT st f = $1 &
  ((for a st a in dom f holds f.a gcd d=1) implies Product(f) gcd d = 1);
A1: now
    let fp;
    let a be Element of NAT such that
A2: TH[fp];
    thus TH[fp^<*a*>]
    proof
      set fp1=fp^<*a*>;
      take fp1;
      thus fp1 = fp^<*a*>;
      assume
A3:   for b st b in dom fp1 holds fp1.b gcd d=1;
A4:   dom fp c= dom fp1 by FINSEQ_1:26;
A5:   for b st b in dom fp holds fp.b gcd d=1
      proof
        let b;
        assume
A6:     b in dom fp;
        then fp1.b gcd d=1 by A3,A4;
        hence thesis by A6,FINSEQ_1:def 7;
      end;
      len fp1 in dom fp1 by FINSEQ_5:6;
      then len fp1=len fp + 1 & fp1.len fp1 gcd d=1 by A3,FINSEQ_2:16;
      then
A7:   a gcd d=1 by FINSEQ_1:42;
      Product(fp1)=Product(fp)*a by RVSUM_1:96;
      hence thesis by A2,A5,A7,Th6;
    end;
  end;
A8: TH[<*>NAT]
    proof
      take <*>NAT;
      thus thesis by NEWTON:51,RVSUM_1:94;
    end;
  for fp holds TH[fp] from FINSEQ_2:sch 2(A8,A1);
  then ex f being FinSequence of NAT st f = fp &
  ((for a st a in dom f holds f.a gcd d=1) implies Product(f) gcd d=1);
  hence thesis;
end;
