Mathlib v3 is deprecated. Go to Mathlib v4

Commit 2021-08-17 18:30 90fc0641

View on Github →

chore(algebra/associated): use more dot notation (#8556) I was getting annoyed that working with definitions such as irreducible, prime and associated, I had to write quite verbose terms like dvd_symm_of_irreducible (irreducible_of_prime (prime_of_factor _ hp)) (irreducible_of_prime (prime_of_factor _ hq)) hdvd, where a lot of redundancy can be eliminated with dot notation: (prime_of_factor _ hp).irreducible.dvd_symm (prime_of_factor _ hq).irreducible hdvd. This PR changes the spelling of many of the lemmas in algebra/associated.lean to make usage of dot notation easier. It also adds a few shortcut lemmas that address common patterns. Since this change touches a lot of files, I'll add a RFC label / open a thread on Zulip to see what everyone thinks. Renamings:

  • irreducible_of_primeprime.irreducible
  • dvd_symm_of_irreducibleirreducible.dvd_symm
  • dvd_symm_iff_of_irreducibleirreducible.dvd_comm (cf. eq.symm versus eq_comm)
  • associated_mul_mulassociated.mul_mul
  • associated_pow_powassociated.pow_pow
  • dvd_of_associatedassociated.dvd
  • dvd_dvd_of_associatedassociated.dvd_dvd
  • dvd_iff_dvd_of_rel_{left,right}associated.dvd_iff_dvd_{left,right}
  • {eq,ne}_zero_iff_of_associatedassociated.{eq,ne}_zero_iff
  • {irreducible,prime}_of_associatedassociated.{irreducible,prime}
  • {irreducible,is_unit,prime}_iff_of_associatedassociated.{irreducible,is_unit,prime}_iff
  • associated_of_{irreducible,prime}_of_dvd{irreducible,prime}.associated_of_dvd
  • gcd_eq_of_associated_{left,right}associated.gcd_eq_{left,right}
  • {irreducible,prime}_of_degree_eq_one_of_monicmonic.{irreducible,prime}_of_degree_eq_one
  • gcd_monoid.prime_of_irreducibleirreducible.prime (since the GCD case is probably the only case we care about for this implication. And we could generalize to Schreier domains if not) Additions:
  • associated.is_unit := (associated.is_unit_iff _).mp (to match associated.prime and associated.irreducible)
  • associated.mul_left := associated.mul_mul (associated.refl _) _
  • associated.mul_right := associated.mul_mul _ (associated.refl _) Other changes:
  • associated_normalize, normalize_associated, associates.mk_normalize, normalize_apply, prime_X_sub_C: make their final parameter explicit, since it is only inferrable when trying to apply these lemmas. This change helped to golf a few proofs from tactic mode to term mode.
  • slight golfing and style fixes

Estimated changes

added theorem associated.eq_zero_iff
added theorem associated.is_unit_iff
added theorem associated.mul_left
added theorem associated.mul_mul
added theorem associated.mul_right
added theorem associated.ne_zero_iff
added theorem associated.of_mul_left
added theorem associated.pow_pow
added theorem associated.prime_iff
deleted theorem associated_mul_mul
deleted theorem associated_pow_pow
deleted theorem dvd_dvd_of_associated
deleted theorem dvd_iff_dvd_of_rel_left
deleted theorem dvd_iff_dvd_of_rel_right
deleted theorem dvd_of_associated
deleted theorem dvd_symm_of_irreducible
deleted theorem eq_zero_iff_of_associated
added theorem irreducible.dvd_comm
added theorem irreducible.dvd_symm
deleted theorem irreducible_of_associated
deleted theorem irreducible_of_prime
deleted theorem is_unit_iff_of_associated
deleted theorem ne_zero_iff_of_associated
deleted theorem prime_iff_of_associated
deleted theorem prime_of_associated