Mathlib v3 is deprecated. Go to Mathlib v4

Commit 2021-07-05 14:14 0b0d8e7e

View on Github →

refactor(ring_theory): turn localization_map into a typeclass (#8119) This PR replaces the previous localization_map (M : submodule R) Rₘ definition (a ring hom R →+* Rₘ that presents Rₘ as the localization of R at M) with a new is_localization M Rₘ typeclass that puts these requirements on algebra_map R Rₘ instead. An important benefit is that we no longer need to mess with localization_map.codomain to put an R-algebra structure on Rₘ, we can just work with Rₘ directly. The important API changes are in commit 0de78dc, all other commits are simply fixes to the dependent files. Main changes:

  • localization_map has been replaced with is_localization, similarly away_map -> is_localization.away, localization_map.at_prime -> is_localization.at_prime and fraction_map -> is_fraction_ring
  • many declarations taking the localization_map as a parameter now take R and/or M and/or Rₘ, depending on what can be inferred easily
  • localization_map.to_map has been replaced with algebra_map R Rₘ
  • localization_map.codomain and its instances have been removed (you can now directly use Rₘ)
  • is_localization.alg_equiv generalizes fraction_map.alg_equiv_of_quotient (which has been renamed to is_fraction_ring.alg_equiv)
  • is_localization.sec has been introduced to replace (to_localization_map _ _).sec
  • localization.of have been replaced with algebra and is_localization instances on localization, similarly for localization.away.of, localization.at_prime.of and fraction_ring.of.
  • int.fraction_map is now an instance rat.is_fraction_ring
  • All files depending on the above definitions have had fixes. These were mostly straightforward, except:
  • Some category-theory arrows in algebraic_geometry/structure.sheaf are now plain ring_homs. This change was suggested by @justus-springer in order to help the elaborator figure out the arguments to is_localization.
  • Deleted minpoly.over_int_eq_over_rat and minpoly.integer_dvd, now you can just use gcd_domain_eq_field_fractions or gcd_domain_dvd respectively. This removes code duplication in minpoly.lean
  • fractional_ideal does not need to assume is_localization everywhere, only for certain specific definitions Things that stay the same:
  • localization, localization.away, localization.at_prime and fraction_ring are still a construction of localizations (although see above for {localization,localization.away,localization.at_prime,fraction_ring}.of) Zulip thread: https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/Refactoring.20.60localization_map.60

Estimated changes

modified theorem coe_inv_of_nonzero
modified theorem inv_nonzero
modified theorem inv_zero'
modified theorem invertible_of_principal
modified theorem is_dedekind_domain_iff
modified theorem is_dedekind_domain_inv_iff
modified theorem is_principal_inv
modified theorem map_inv
modified theorem mul_generator_self_inv
modified theorem mul_inv_cancel_iff
modified theorem right_inverse_eq
modified theorem span_singleton_inv
modified theorem ring.fractional_ideal.ext
modified def ring.is_fractional
deleted theorem fraction_map.lift_mk'
deleted theorem fraction_map.mk'_eq_div
deleted def fraction_map
deleted def fraction_ring.of
added def is_fraction_ring
added theorem is_localization.map_eq
added theorem is_localization.map_id
modified theorem localization.mk_eq_mk'
deleted theorem localization.mk_one_eq_of
deleted def localization.of
deleted theorem localization_map.eq_of_eq
deleted theorem localization_map.ext
deleted theorem localization_map.ext_iff
deleted theorem localization_map.lift_eq
deleted theorem localization_map.lift_id
deleted theorem localization_map.lift_mk'
deleted theorem localization_map.map_comp
deleted theorem localization_map.map_eq
deleted theorem localization_map.map_id
deleted theorem localization_map.map_map
deleted theorem localization_map.map_mk'
deleted theorem localization_map.map_smul
deleted theorem localization_map.mk'_add
deleted theorem localization_map.mk'_mul
deleted theorem localization_map.mk'_one
deleted theorem localization_map.mk'_sec
deleted theorem localization_map.mk'_self
deleted theorem localization_map.mk'_spec
deleted theorem localization_map.of_id
deleted theorem localization_map.sec_spec
deleted theorem localization_map.surj
deleted structure localization_map