reserve X,Y for set;
reserve R for domRing-like commutative Ring;
reserve c for Element of R;
reserve R for gcdDomain;

theorem Th35:
  for Amp being AmpleSet of R for a,b,c being Element of R holds
  gcd(gcd(a,b,Amp),c,Amp) = gcd(a,gcd(b,c,Amp),Amp)
proof
  let Amp be AmpleSet of R;
  let A,B,C be Element of R;
  set D = gcd(gcd(A,B,Amp),C,Amp);
  set E = gcd(A,gcd(B,C,Amp),Amp);
A1: D divides C by Def12;
A2: E divides A by Def12;
A3: E divides gcd(B,C,Amp) by Def12;
  then
A4: E divides C by Th28;
  E divides B by A3,Th28;
  then E divides gcd(A,B,Amp) by A2,Def12;
  then
A5: E divides D by A4,Def12;
A6: D is Element of Amp & E is Element of Amp by Def12;
A7: D divides gcd(A,B,Amp) by Def12;
  then
A8: D divides A by Th28;
  D divides B by A7,Th28;
  then D divides gcd(B,C,Amp) by A1,Def12;
  then D divides E by A8,Def12;
  then D is_associated_to E by A5;
  hence thesis by A6,Th22;
end;
