State/Canonical decompositions can be used to find GCD and LCM

 =Proof=