ring_theory.dedekind_domain.adic_valuationMathlib.RingTheory.DedekindDomain.AdicValuation

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -300,7 +300,7 @@ theorem int_valuation_exists_uniformizer :
   rw [int_valuation_def, if_neg (associates.mk_ne_zero'.mp hπ), WithZero.coe_inj]
   apply congr_arg
   rw [neg_inj, ← Int.ofNat_one, Int.natCast_inj]
-  rw [← Ideal.dvd_span_singleton, ← Associates.mk_le_mk_iff_dvd_iff] at mem nmem
+  rw [← Ideal.dvd_span_singleton, ← Associates.mk_le_mk_iff_dvd] at mem nmem
   rw [← pow_one (Associates.mk v.as_ideal), Associates.prime_pow_dvd_iff_le hπ hv] at mem
   rw [Associates.mk_pow, Associates.prime_pow_dvd_iff_le hπ hv, not_le] at nmem
   exact Nat.eq_of_le_of_lt_succ mem nmem
Diff
@@ -136,7 +136,7 @@ theorem int_valuation_le_one (x : R) : v.intValuationDef x ≤ 1 :=
   · rw [if_pos hx]; exact WithZero.zero_le 1
   · rw [if_neg hx, ← WithZero.coe_one, ← ofAdd_zero, WithZero.coe_le_coe, of_add_le,
       Right.neg_nonpos_iff]
-    exact Int.coe_nat_nonneg _
+    exact Int.natCast_nonneg _
 #align is_dedekind_domain.height_one_spectrum.int_valuation_le_one IsDedekindDomain.HeightOneSpectrum.int_valuation_le_one
 -/
 
@@ -299,7 +299,7 @@ theorem int_valuation_exists_uniformizer :
   use π
   rw [int_valuation_def, if_neg (associates.mk_ne_zero'.mp hπ), WithZero.coe_inj]
   apply congr_arg
-  rw [neg_inj, ← Int.ofNat_one, Int.coe_nat_inj']
+  rw [neg_inj, ← Int.ofNat_one, Int.natCast_inj]
   rw [← Ideal.dvd_span_singleton, ← Associates.mk_le_mk_iff_dvd_iff] at mem nmem
   rw [← pow_one (Associates.mk v.as_ideal), Associates.prime_pow_dvd_iff_le hπ hv] at mem
   rw [Associates.mk_pow, Associates.prime_pow_dvd_iff_le hπ hv, not_le] at nmem
Diff
@@ -259,7 +259,7 @@ theorem IntValuation.map_add_le_max' (x y : R) :
           by
           rw [Associates.le_singleton_iff]
           exact Ideal.add_mem (v.as_ideal ^ nmin) h_dvd_x h_dvd_y
-        rw [Associates.prime_pow_dvd_iff_le (associates.mk_ne_zero'.mpr hxy) _] at h_dvd_xy 
+        rw [Associates.prime_pow_dvd_iff_le (associates.mk_ne_zero'.mpr hxy) _] at h_dvd_xy
         exact h_dvd_xy
         apply v.associates_irreducible
 #align is_dedekind_domain.height_one_spectrum.int_valuation.map_add_le_max' IsDedekindDomain.HeightOneSpectrum.IntValuation.map_add_le_max'
@@ -294,15 +294,15 @@ theorem int_valuation_exists_uniformizer :
     by
     rw [Associates.mk_ne_zero']
     intro h
-    rw [h] at nmem 
+    rw [h] at nmem
     exact nmem (Submodule.zero_mem (v.as_ideal ^ 2))
   use π
   rw [int_valuation_def, if_neg (associates.mk_ne_zero'.mp hπ), WithZero.coe_inj]
   apply congr_arg
   rw [neg_inj, ← Int.ofNat_one, Int.coe_nat_inj']
-  rw [← Ideal.dvd_span_singleton, ← Associates.mk_le_mk_iff_dvd_iff] at mem nmem 
-  rw [← pow_one (Associates.mk v.as_ideal), Associates.prime_pow_dvd_iff_le hπ hv] at mem 
-  rw [Associates.mk_pow, Associates.prime_pow_dvd_iff_le hπ hv, not_le] at nmem 
+  rw [← Ideal.dvd_span_singleton, ← Associates.mk_le_mk_iff_dvd_iff] at mem nmem
+  rw [← pow_one (Associates.mk v.as_ideal), Associates.prime_pow_dvd_iff_le hπ hv] at mem
+  rw [Associates.mk_pow, Associates.prime_pow_dvd_iff_le hπ hv, not_le] at nmem
   exact Nat.eq_of_le_of_lt_succ mem nmem
 #align is_dedekind_domain.height_one_spectrum.int_valuation_exists_uniformizer IsDedekindDomain.HeightOneSpectrum.int_valuation_exists_uniformizer
 -/
@@ -553,10 +553,10 @@ theorem coe_smul_adicCompletionIntegers (r : R) (x : v.adicCompletionIntegers K)
 instance : NoZeroSMulDivisors R (v.adicCompletionIntegers K)
     where eq_zero_or_eq_zero_of_smul_eq_zero c x hcx :=
     by
-    rw [Algebra.smul_def, mul_eq_zero] at hcx 
+    rw [Algebra.smul_def, mul_eq_zero] at hcx
     refine' hcx.imp_left fun hc => _
     letI : UniformSpace K := v.adic_valued.to_uniform_space
-    rw [← map_zero (algebraMap R (v.adic_completion_integers K))] at hc 
+    rw [← map_zero (algebraMap R (v.adic_completion_integers K))] at hc
     exact
       IsFractionRing.injective R K (UniformSpace.Completion.coe_injective K (subtype.ext_iff.mp hc))
 
Diff
@@ -3,11 +3,11 @@ Copyright (c) 2022 María Inés de Frutos-Fernández. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: María Inés de Frutos-Fernández
 -/
-import Mathbin.RingTheory.DedekindDomain.Ideal
-import Mathbin.RingTheory.Valuation.ExtendToLocalization
-import Mathbin.RingTheory.Valuation.ValuationSubring
-import Mathbin.Topology.Algebra.ValuedField
-import Mathbin.Algebra.Order.Group.TypeTags
+import RingTheory.DedekindDomain.Ideal
+import RingTheory.Valuation.ExtendToLocalization
+import RingTheory.Valuation.ValuationSubring
+import Topology.Algebra.ValuedField
+import Algebra.Order.Group.TypeTags
 
 #align_import ring_theory.dedekind_domain.adic_valuation from "leanprover-community/mathlib"@"5d0c76894ada7940957143163d7b921345474cbc"
 
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2022 María Inés de Frutos-Fernández. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: María Inés de Frutos-Fernández
-
-! This file was ported from Lean 3 source module ring_theory.dedekind_domain.adic_valuation
-! leanprover-community/mathlib commit 5d0c76894ada7940957143163d7b921345474cbc
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.RingTheory.DedekindDomain.Ideal
 import Mathbin.RingTheory.Valuation.ExtendToLocalization
@@ -14,6 +9,8 @@ import Mathbin.RingTheory.Valuation.ValuationSubring
 import Mathbin.Topology.Algebra.ValuedField
 import Mathbin.Algebra.Order.Group.TypeTags
 
+#align_import ring_theory.dedekind_domain.adic_valuation from "leanprover-community/mathlib"@"5d0c76894ada7940957143163d7b921345474cbc"
+
 /-!
 # Adic valuations on Dedekind domains
 
Diff
@@ -501,11 +501,10 @@ theorem coe_smul_adicCompletion (r : R) (x : K) :
 instance : Algebra K (v.adicCompletion K) :=
   @UniformSpace.Completion.algebra' K _ v.adicValued.toUniformSpace _ _
 
-#print IsDedekindDomain.HeightOneSpectrum.algebraMap_adic_completion' /-
-theorem algebraMap_adic_completion' :
-    ⇑(algebraMap R <| v.adicCompletion K) = coe ∘ algebraMap R K :=
+#print IsDedekindDomain.HeightOneSpectrum.algebraMap_adicCompletion' /-
+theorem algebraMap_adicCompletion' : ⇑(algebraMap R <| v.adicCompletion K) = coe ∘ algebraMap R K :=
   rfl
-#align is_dedekind_domain.height_one_spectrum.algebra_map_adic_completion' IsDedekindDomain.HeightOneSpectrum.algebraMap_adic_completion'
+#align is_dedekind_domain.height_one_spectrum.algebra_map_adic_completion' IsDedekindDomain.HeightOneSpectrum.algebraMap_adicCompletion'
 -/
 
 #print IsDedekindDomain.HeightOneSpectrum.algebraMap_adicCompletion /-
@@ -564,11 +563,11 @@ instance : NoZeroSMulDivisors R (v.adicCompletionIntegers K)
     exact
       IsFractionRing.injective R K (UniformSpace.Completion.coe_injective K (subtype.ext_iff.mp hc))
 
-#print IsDedekindDomain.HeightOneSpectrum.AdicCompletion.is_scalar_tower' /-
-instance AdicCompletion.is_scalar_tower' :
+#print IsDedekindDomain.HeightOneSpectrum.AdicCompletion.instIsScalarTower' /-
+instance AdicCompletion.instIsScalarTower' :
     IsScalarTower R (v.adicCompletionIntegers K) (v.adicCompletion K)
     where smul_assoc x y z := by simp only [Algebra.smul_def]; apply mul_assoc
-#align is_dedekind_domain.height_one_spectrum.adic_completion.is_scalar_tower' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.is_scalar_tower'
+#align is_dedekind_domain.height_one_spectrum.adic_completion.is_scalar_tower' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.instIsScalarTower'
 -/
 
 end AlgebraInstances
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: María Inés de Frutos-Fernández
 
 ! This file was ported from Lean 3 source module ring_theory.dedekind_domain.adic_valuation
-! leanprover-community/mathlib commit f0c8bf9245297a541f468be517f1bde6195105e9
+! leanprover-community/mathlib commit 5d0c76894ada7940957143163d7b921345474cbc
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -16,6 +16,9 @@ import Mathbin.Algebra.Order.Group.TypeTags
 
 /-!
 # Adic valuations on Dedekind domains
+
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
 Given a Dedekind domain `R` of Krull dimension 1 and a maximal ideal `v` of `R`, we define the
 `v`-adic valuation on `R` and its extension to the field of fractions `K` of `R`.
 We prove several properties of this valuation, including the existence of uniformizers.
Diff
@@ -75,6 +75,7 @@ namespace IsDedekindDomain.HeightOneSpectrum
 /-! ### Adic valuations on the Dedekind domain R -/
 
 
+#print IsDedekindDomain.HeightOneSpectrum.intValuationDef /-
 /-- The additive `v`-adic valuation of `r ∈ R` is the exponent of `v` in the factorization of the
 ideal `(r)`, if `r` is nonzero, or infinity, if `r = 0`. `int_valuation_def` is the corresponding
 multiplicative valuation. -/
@@ -84,37 +85,49 @@ def intValuationDef (r : R) : ℤₘ₀ :=
     Multiplicative.ofAdd
       (-(Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {r} : Ideal R)).factors : ℤ)
 #align is_dedekind_domain.height_one_spectrum.int_valuation_def IsDedekindDomain.HeightOneSpectrum.intValuationDef
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.intValuationDef_if_pos /-
 theorem intValuationDef_if_pos {r : R} (hr : r = 0) : v.intValuationDef r = 0 :=
   if_pos hr
 #align is_dedekind_domain.height_one_spectrum.int_valuation_def_if_pos IsDedekindDomain.HeightOneSpectrum.intValuationDef_if_pos
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.intValuationDef_if_neg /-
 theorem intValuationDef_if_neg {r : R} (hr : r ≠ 0) :
     v.intValuationDef r =
       Multiplicative.ofAdd
         (-(Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {r} : Ideal R)).factors : ℤ) :=
   if_neg hr
 #align is_dedekind_domain.height_one_spectrum.int_valuation_def_if_neg IsDedekindDomain.HeightOneSpectrum.intValuationDef_if_neg
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.int_valuation_ne_zero /-
 /-- Nonzero elements have nonzero adic valuation. -/
 theorem int_valuation_ne_zero (x : R) (hx : x ≠ 0) : v.intValuationDef x ≠ 0 :=
   by
   rw [int_valuation_def, if_neg hx]
   exact WithZero.coe_ne_zero
 #align is_dedekind_domain.height_one_spectrum.int_valuation_ne_zero IsDedekindDomain.HeightOneSpectrum.int_valuation_ne_zero
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.int_valuation_ne_zero' /-
 /-- Nonzero divisors have nonzero valuation. -/
 theorem int_valuation_ne_zero' (x : nonZeroDivisors R) : v.intValuationDef x ≠ 0 :=
   v.int_valuation_ne_zero x (nonZeroDivisors.coe_ne_zero x)
 #align is_dedekind_domain.height_one_spectrum.int_valuation_ne_zero' IsDedekindDomain.HeightOneSpectrum.int_valuation_ne_zero'
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.int_valuation_zero_le /-
 /-- Nonzero divisors have valuation greater than zero. -/
 theorem int_valuation_zero_le (x : nonZeroDivisors R) : 0 < v.intValuationDef x :=
   by
   rw [v.int_valuation_def_if_neg (nonZeroDivisors.coe_ne_zero x)]
   exact WithZero.zero_lt_coe _
 #align is_dedekind_domain.height_one_spectrum.int_valuation_zero_le IsDedekindDomain.HeightOneSpectrum.int_valuation_zero_le
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.int_valuation_le_one /-
 /-- The `v`-adic valuation on `R` is bounded above by 1. -/
 theorem int_valuation_le_one (x : R) : v.intValuationDef x ≤ 1 :=
   by
@@ -125,7 +138,9 @@ theorem int_valuation_le_one (x : R) : v.intValuationDef x ≤ 1 :=
       Right.neg_nonpos_iff]
     exact Int.coe_nat_nonneg _
 #align is_dedekind_domain.height_one_spectrum.int_valuation_le_one IsDedekindDomain.HeightOneSpectrum.int_valuation_le_one
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.int_valuation_lt_one_iff_dvd /-
 /-- The `v`-adic valuation of `r ∈ R` is less than 1 if and only if `v` divides the ideal `(r)`. -/
 theorem int_valuation_lt_one_iff_dvd (r : R) :
     v.intValuationDef r < 1 ↔ v.asIdeal ∣ Ideal.span {r} :=
@@ -141,7 +156,9 @@ theorem int_valuation_lt_one_iff_dvd (r : R) :
       exact hr
     apply Associates.count_ne_zero_iff_dvd h (by apply v.irreducible)
 #align is_dedekind_domain.height_one_spectrum.int_valuation_lt_one_iff_dvd IsDedekindDomain.HeightOneSpectrum.int_valuation_lt_one_iff_dvd
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.int_valuation_le_pow_iff_dvd /-
 /-- The `v`-adic valuation of `r ∈ R` is less than `multiplicative.of_add (-n)` if and only if
 `vⁿ` divides the ideal `(r)`. -/
 theorem int_valuation_le_pow_iff_dvd (r : R) (n : ℕ) :
@@ -156,12 +173,16 @@ theorem int_valuation_le_pow_iff_dvd (r : R) (n : ℕ) :
       Associates.prime_pow_dvd_iff_le (associates.mk_ne_zero'.mpr hr)
         (by apply v.associates_irreducible)]
 #align is_dedekind_domain.height_one_spectrum.int_valuation_le_pow_iff_dvd IsDedekindDomain.HeightOneSpectrum.int_valuation_le_pow_iff_dvd
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.IntValuation.map_zero' /-
 /-- The `v`-adic valuation of `0 : R` equals 0. -/
 theorem IntValuation.map_zero' : v.intValuationDef 0 = 0 :=
   v.intValuationDef_if_pos (Eq.refl 0)
 #align is_dedekind_domain.height_one_spectrum.int_valuation.map_zero' IsDedekindDomain.HeightOneSpectrum.IntValuation.map_zero'
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.IntValuation.map_one' /-
 /-- The `v`-adic valuation of `1 : R` equals 1. -/
 theorem IntValuation.map_one' : v.intValuationDef 1 = 1 := by
   rw [v.int_valuation_def_if_neg (zero_ne_one.symm : (1 : R) ≠ 0), Ideal.span_singleton_one, ←
@@ -169,7 +190,9 @@ theorem IntValuation.map_one' : v.intValuationDef 1 = 1 := by
     Associates.count_zero (by apply v.associates_irreducible), Int.ofNat_zero, neg_zero, ofAdd_zero,
     WithZero.coe_one]
 #align is_dedekind_domain.height_one_spectrum.int_valuation.map_one' IsDedekindDomain.HeightOneSpectrum.IntValuation.map_one'
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.IntValuation.map_mul' /-
 /-- The `v`-adic valuation of a product equals the product of the valuations. -/
 theorem IntValuation.map_mul' (x y : R) :
     v.intValuationDef (x * y) = v.intValuationDef x * v.intValuationDef y :=
@@ -185,7 +208,9 @@ theorem IntValuation.map_mul' (x y : R) :
           (by apply associates.mk_ne_zero'.mpr hy) (by apply v.associates_irreducible)]
       rfl
 #align is_dedekind_domain.height_one_spectrum.int_valuation.map_mul' IsDedekindDomain.HeightOneSpectrum.IntValuation.map_mul'
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.IntValuation.le_max_iff_min_le /-
 theorem IntValuation.le_max_iff_min_le {a b c : ℕ} :
     Multiplicative.ofAdd (-c : ℤ) ≤
         max (Multiplicative.ofAdd (-a : ℤ)) (Multiplicative.ofAdd (-b : ℤ)) ↔
@@ -194,7 +219,9 @@ theorem IntValuation.le_max_iff_min_le {a b c : ℕ} :
   rw [le_max_iff, of_add_le, of_add_le, neg_le_neg_iff, neg_le_neg_iff, Int.ofNat_le, Int.ofNat_le,
     ← min_le_iff]
 #align is_dedekind_domain.height_one_spectrum.int_valuation.le_max_iff_min_le IsDedekindDomain.HeightOneSpectrum.IntValuation.le_max_iff_min_le
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.IntValuation.map_add_le_max' /-
 /-- The `v`-adic valuation of a sum is bounded above by the maximum of the valuations. -/
 theorem IntValuation.map_add_le_max' (x y : R) :
     v.intValuationDef (x + y) ≤ max (v.intValuationDef x) (v.intValuationDef y) :=
@@ -236,7 +263,9 @@ theorem IntValuation.map_add_le_max' (x y : R) :
         exact h_dvd_xy
         apply v.associates_irreducible
 #align is_dedekind_domain.height_one_spectrum.int_valuation.map_add_le_max' IsDedekindDomain.HeightOneSpectrum.IntValuation.map_add_le_max'
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.intValuation /-
 /-- The `v`-adic valuation on `R`. -/
 def intValuation : Valuation R ℤₘ₀
     where
@@ -246,7 +275,9 @@ def intValuation : Valuation R ℤₘ₀
   map_mul' := IntValuation.map_mul' v
   map_add_le_max' := IntValuation.map_add_le_max' v
 #align is_dedekind_domain.height_one_spectrum.int_valuation IsDedekindDomain.HeightOneSpectrum.intValuation
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.int_valuation_exists_uniformizer /-
 /-- There exists `π ∈ R` with `v`-adic valuation `multiplicative.of_add (-1)`. -/
 theorem int_valuation_exists_uniformizer :
     ∃ π : R, v.intValuationDef π = Multiplicative.ofAdd (-1 : ℤ) :=
@@ -274,24 +305,30 @@ theorem int_valuation_exists_uniformizer :
   rw [Associates.mk_pow, Associates.prime_pow_dvd_iff_le hπ hv, not_le] at nmem 
   exact Nat.eq_of_le_of_lt_succ mem nmem
 #align is_dedekind_domain.height_one_spectrum.int_valuation_exists_uniformizer IsDedekindDomain.HeightOneSpectrum.int_valuation_exists_uniformizer
+-/
 
 /-! ### Adic valuations on the field of fractions `K` -/
 
 
+#print IsDedekindDomain.HeightOneSpectrum.valuation /-
 /-- The `v`-adic valuation of `x ∈ K` is the valuation of `r` divided by the valuation of `s`,
 where `r` and `s` are chosen so that `x = r/s`. -/
 def valuation (v : HeightOneSpectrum R) : Valuation K ℤₘ₀ :=
   v.intValuation.extendToLocalization
     (fun r hr => Set.mem_compl <| v.int_valuation_ne_zero' ⟨r, hr⟩) K
 #align is_dedekind_domain.height_one_spectrum.valuation IsDedekindDomain.HeightOneSpectrum.valuation
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.valuation_def /-
 theorem valuation_def (x : K) :
     v.Valuation x =
       v.intValuation.extendToLocalization
         (fun r hr => Set.mem_compl (v.int_valuation_ne_zero' ⟨r, hr⟩)) K x :=
   rfl
 #align is_dedekind_domain.height_one_spectrum.valuation_def IsDedekindDomain.HeightOneSpectrum.valuation_def
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.valuation_of_mk' /-
 /-- The `v`-adic valuation of `r/s ∈ K` is the valuation of `r` divided by the valuation of `s`. -/
 theorem valuation_of_mk' {r : R} {s : nonZeroDivisors R} :
     v.Valuation (IsLocalization.mk' K r s) = v.intValuation r / v.intValuation s :=
@@ -302,25 +339,33 @@ theorem valuation_of_mk' {r : R} {s : nonZeroDivisors R} :
   rw [Units.val_inv_eq_inv_val, inv_inj]
   rfl
 #align is_dedekind_domain.height_one_spectrum.valuation_of_mk' IsDedekindDomain.HeightOneSpectrum.valuation_of_mk'
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.valuation_of_algebraMap /-
 /-- The `v`-adic valuation on `K` extends the `v`-adic valuation on `R`. -/
 theorem valuation_of_algebraMap (r : R) : v.Valuation (algebraMap R K r) = v.intValuation r := by
   rw [valuation_def, Valuation.extendToLocalization_apply_map_apply]
 #align is_dedekind_domain.height_one_spectrum.valuation_of_algebra_map IsDedekindDomain.HeightOneSpectrum.valuation_of_algebraMap
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.valuation_le_one /-
 /-- The `v`-adic valuation on `R` is bounded above by 1. -/
 theorem valuation_le_one (r : R) : v.Valuation (algebraMap R K r) ≤ 1 := by
   rw [valuation_of_algebra_map]; exact v.int_valuation_le_one r
 #align is_dedekind_domain.height_one_spectrum.valuation_le_one IsDedekindDomain.HeightOneSpectrum.valuation_le_one
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.valuation_lt_one_iff_dvd /-
 /-- The `v`-adic valuation of `r ∈ R` is less than 1 if and only if `v` divides the ideal `(r)`. -/
 theorem valuation_lt_one_iff_dvd (r : R) :
     v.Valuation (algebraMap R K r) < 1 ↔ v.asIdeal ∣ Ideal.span {r} := by
   rw [valuation_of_algebra_map]; exact v.int_valuation_lt_one_iff_dvd r
 #align is_dedekind_domain.height_one_spectrum.valuation_lt_one_iff_dvd IsDedekindDomain.HeightOneSpectrum.valuation_lt_one_iff_dvd
+-/
 
 variable (K)
 
+#print IsDedekindDomain.HeightOneSpectrum.valuation_exists_uniformizer /-
 /-- There exists `π ∈ K` with `v`-adic valuation `multiplicative.of_add (-1)`. -/
 theorem valuation_exists_uniformizer : ∃ π : K, v.Valuation π = Multiplicative.ofAdd (-1 : ℤ) :=
   by
@@ -329,12 +374,15 @@ theorem valuation_exists_uniformizer : ∃ π : K, v.Valuation π = Multiplicati
   rw [valuation_def, Valuation.extendToLocalization_apply_map_apply]
   exact hr
 #align is_dedekind_domain.height_one_spectrum.valuation_exists_uniformizer IsDedekindDomain.HeightOneSpectrum.valuation_exists_uniformizer
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.valuation_uniformizer_ne_zero /-
 /-- Uniformizers are nonzero. -/
 theorem valuation_uniformizer_ne_zero : Classical.choose (v.valuation_exists_uniformizer K) ≠ 0 :=
   haveI hu := Classical.choose_spec (v.valuation_exists_uniformizer K)
   (Valuation.ne_zero_iff _).mp (ne_of_eq_of_ne hu WithZero.coe_ne_zero)
 #align is_dedekind_domain.height_one_spectrum.valuation_uniformizer_ne_zero IsDedekindDomain.HeightOneSpectrum.valuation_uniformizer_ne_zero
+-/
 
 /-! ### Completions with respect to adic valuations
 
@@ -345,97 +393,126 @@ ring of integers, denoted `v.adic_completion_integers`. -/
 
 variable {K}
 
+#print IsDedekindDomain.HeightOneSpectrum.adicValued /-
 /-- `K` as a valued field with the `v`-adic valuation. -/
 def adicValued : Valued K ℤₘ₀ :=
   Valued.mk' v.Valuation
 #align is_dedekind_domain.height_one_spectrum.adic_valued IsDedekindDomain.HeightOneSpectrum.adicValued
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.adicValued_apply /-
 theorem adicValued_apply {x : K} : (v.adicValued.V : _) x = v.Valuation x :=
   rfl
 #align is_dedekind_domain.height_one_spectrum.adic_valued_apply IsDedekindDomain.HeightOneSpectrum.adicValued_apply
+-/
 
 variable (K)
 
+#print IsDedekindDomain.HeightOneSpectrum.adicCompletion /-
 /-- The completion of `K` with respect to its `v`-adic valuation. -/
-def AdicCompletion :=
+def adicCompletion :=
   @UniformSpace.Completion K v.adicValued.toUniformSpace
-#align is_dedekind_domain.height_one_spectrum.adic_completion IsDedekindDomain.HeightOneSpectrum.AdicCompletion
+#align is_dedekind_domain.height_one_spectrum.adic_completion IsDedekindDomain.HeightOneSpectrum.adicCompletion
+-/
 
 instance : Field (v.adicCompletion K) :=
-  @UniformSpace.Completion.field K _ v.adicValued.toUniformSpace _ _ v.adicValued.to_uniformAddGroup
+  @UniformSpace.Completion.instField K _ v.adicValued.toUniformSpace _ _
+    v.adicValued.to_uniformAddGroup
 
 instance : Inhabited (v.adicCompletion K) :=
   ⟨0⟩
 
+#print IsDedekindDomain.HeightOneSpectrum.valuedAdicCompletion /-
 instance valuedAdicCompletion : Valued (v.adicCompletion K) ℤₘ₀ :=
   @Valued.valuedCompletion _ _ _ _ v.adicValued
 #align is_dedekind_domain.height_one_spectrum.valued_adic_completion IsDedekindDomain.HeightOneSpectrum.valuedAdicCompletion
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.valuedAdicCompletion_def /-
 theorem valuedAdicCompletion_def {x : v.adicCompletion K} :
     Valued.v x = @Valued.extension K _ _ _ (adicValued v) x :=
   rfl
 #align is_dedekind_domain.height_one_spectrum.valued_adic_completion_def IsDedekindDomain.HeightOneSpectrum.valuedAdicCompletion_def
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.adicCompletion_completeSpace /-
 instance adicCompletion_completeSpace : CompleteSpace (v.adicCompletion K) :=
   @UniformSpace.Completion.completeSpace K v.adicValued.toUniformSpace
 #align is_dedekind_domain.height_one_spectrum.adic_completion_complete_space IsDedekindDomain.HeightOneSpectrum.adicCompletion_completeSpace
+-/
 
-instance AdicCompletion.hasLiftT : HasLiftT K (v.adicCompletion K) :=
+instance adicCompletion.hasLiftT : HasLiftT K (v.adicCompletion K) :=
   (inferInstance : HasLiftT K (@UniformSpace.Completion K v.adicValued.toUniformSpace))
-#align is_dedekind_domain.height_one_spectrum.adic_completion.has_lift_t IsDedekindDomain.HeightOneSpectrum.AdicCompletion.hasLiftT
+#align is_dedekind_domain.height_one_spectrum.adic_completion.has_lift_t IsDedekindDomain.HeightOneSpectrum.adicCompletion.hasLiftT
 
+#print IsDedekindDomain.HeightOneSpectrum.adicCompletionIntegers /-
 /-- The ring of integers of `adic_completion`. -/
 def adicCompletionIntegers : ValuationSubring (v.adicCompletion K) :=
   Valued.v.ValuationSubring
 #align is_dedekind_domain.height_one_spectrum.adic_completion_integers IsDedekindDomain.HeightOneSpectrum.adicCompletionIntegers
+-/
 
 instance : Inhabited (adicCompletionIntegers K v) :=
   ⟨0⟩
 
 variable (R K)
 
+#print IsDedekindDomain.HeightOneSpectrum.mem_adicCompletionIntegers /-
 theorem mem_adicCompletionIntegers {x : v.adicCompletion K} :
     x ∈ v.adicCompletionIntegers K ↔ (Valued.v x : ℤₘ₀) ≤ 1 :=
   Iff.rfl
 #align is_dedekind_domain.height_one_spectrum.mem_adic_completion_integers IsDedekindDomain.HeightOneSpectrum.mem_adicCompletionIntegers
+-/
 
 section AlgebraInstances
 
+#print IsDedekindDomain.HeightOneSpectrum.adicValued.has_uniform_continuous_const_smul' /-
 instance (priority := 100) adicValued.has_uniform_continuous_const_smul' :
     @UniformContinuousConstSMul R K v.adicValued.toUniformSpace _ :=
   @uniformContinuousConstSMul_of_continuousConstSMul R K _ _ _ v.adicValued.toUniformSpace _ _
 #align is_dedekind_domain.height_one_spectrum.adic_valued.has_uniform_continuous_const_smul' IsDedekindDomain.HeightOneSpectrum.adicValued.has_uniform_continuous_const_smul'
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.adicValued.uniformContinuousConstSMul /-
 instance adicValued.uniformContinuousConstSMul :
     @UniformContinuousConstSMul K K v.adicValued.toUniformSpace _ :=
   @Ring.uniformContinuousConstSMul K _ v.adicValued.toUniformSpace _ _
 #align is_dedekind_domain.height_one_spectrum.adic_valued.has_uniform_continuous_const_smul IsDedekindDomain.HeightOneSpectrum.adicValued.uniformContinuousConstSMul
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.AdicCompletion.algebra' /-
 instance AdicCompletion.algebra' : Algebra R (v.adicCompletion K) :=
   @UniformSpace.Completion.algebra K _ v.adicValued.toUniformSpace _ _ R _ _
     (adicValued.has_uniform_continuous_const_smul' R K v)
 #align is_dedekind_domain.height_one_spectrum.adic_completion.algebra' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.algebra'
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.coe_smul_adicCompletion /-
 @[simp]
 theorem coe_smul_adicCompletion (r : R) (x : K) :
     (↑(r • x) : v.adicCompletion K) = r • (↑x : v.adicCompletion K) :=
   @UniformSpace.Completion.coe_smul R K v.adicValued.toUniformSpace _ _ r x
 #align is_dedekind_domain.height_one_spectrum.coe_smul_adic_completion IsDedekindDomain.HeightOneSpectrum.coe_smul_adicCompletion
+-/
 
 instance : Algebra K (v.adicCompletion K) :=
   @UniformSpace.Completion.algebra' K _ v.adicValued.toUniformSpace _ _
 
+#print IsDedekindDomain.HeightOneSpectrum.algebraMap_adic_completion' /-
 theorem algebraMap_adic_completion' :
     ⇑(algebraMap R <| v.adicCompletion K) = coe ∘ algebraMap R K :=
   rfl
 #align is_dedekind_domain.height_one_spectrum.algebra_map_adic_completion' IsDedekindDomain.HeightOneSpectrum.algebraMap_adic_completion'
+-/
 
+#print IsDedekindDomain.HeightOneSpectrum.algebraMap_adicCompletion /-
 theorem algebraMap_adicCompletion : ⇑(algebraMap K <| v.adicCompletion K) = coe :=
   rfl
 #align is_dedekind_domain.height_one_spectrum.algebra_map_adic_completion IsDedekindDomain.HeightOneSpectrum.algebraMap_adicCompletion
+-/
 
 instance : IsScalarTower R K (v.adicCompletion K) :=
-  @UniformSpace.Completion.isScalarTower R K K v.adicValued.toUniformSpace _ _ _
+  @UniformSpace.Completion.instIsScalarTower R K K v.adicValued.toUniformSpace _ _ _
     (adicValued.has_uniform_continuous_const_smul' R K v) _ _
 
 instance : Algebra R (v.adicCompletionIntegers K)
@@ -466,11 +543,13 @@ instance : Algebra R (v.adicCompletionIntegers K)
     simp only [Subring.coe_mul, SetLike.coe_mk, Algebra.smul_def]
     rfl
 
+#print IsDedekindDomain.HeightOneSpectrum.coe_smul_adicCompletionIntegers /-
 @[simp]
 theorem coe_smul_adicCompletionIntegers (r : R) (x : v.adicCompletionIntegers K) :
     (↑(r • x) : v.adicCompletion K) = r • (x : v.adicCompletion K) :=
   rfl
 #align is_dedekind_domain.height_one_spectrum.coe_smul_adic_completion_integers IsDedekindDomain.HeightOneSpectrum.coe_smul_adicCompletionIntegers
+-/
 
 instance : NoZeroSMulDivisors R (v.adicCompletionIntegers K)
     where eq_zero_or_eq_zero_of_smul_eq_zero c x hcx :=
@@ -482,10 +561,12 @@ instance : NoZeroSMulDivisors R (v.adicCompletionIntegers K)
     exact
       IsFractionRing.injective R K (UniformSpace.Completion.coe_injective K (subtype.ext_iff.mp hc))
 
+#print IsDedekindDomain.HeightOneSpectrum.AdicCompletion.is_scalar_tower' /-
 instance AdicCompletion.is_scalar_tower' :
     IsScalarTower R (v.adicCompletionIntegers K) (v.adicCompletion K)
     where smul_assoc x y z := by simp only [Algebra.smul_def]; apply mul_assoc
 #align is_dedekind_domain.height_one_spectrum.adic_completion.is_scalar_tower' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.is_scalar_tower'
+-/
 
 end AlgebraInstances
 
Diff
@@ -232,7 +232,7 @@ theorem IntValuation.map_add_le_max' (x y : R) :
           by
           rw [Associates.le_singleton_iff]
           exact Ideal.add_mem (v.as_ideal ^ nmin) h_dvd_x h_dvd_y
-        rw [Associates.prime_pow_dvd_iff_le (associates.mk_ne_zero'.mpr hxy) _] at h_dvd_xy
+        rw [Associates.prime_pow_dvd_iff_le (associates.mk_ne_zero'.mpr hxy) _] at h_dvd_xy 
         exact h_dvd_xy
         apply v.associates_irreducible
 #align is_dedekind_domain.height_one_spectrum.int_valuation.map_add_le_max' IsDedekindDomain.HeightOneSpectrum.IntValuation.map_add_le_max'
@@ -263,15 +263,15 @@ theorem int_valuation_exists_uniformizer :
     by
     rw [Associates.mk_ne_zero']
     intro h
-    rw [h] at nmem
+    rw [h] at nmem 
     exact nmem (Submodule.zero_mem (v.as_ideal ^ 2))
   use π
   rw [int_valuation_def, if_neg (associates.mk_ne_zero'.mp hπ), WithZero.coe_inj]
   apply congr_arg
   rw [neg_inj, ← Int.ofNat_one, Int.coe_nat_inj']
-  rw [← Ideal.dvd_span_singleton, ← Associates.mk_le_mk_iff_dvd_iff] at mem nmem
-  rw [← pow_one (Associates.mk v.as_ideal), Associates.prime_pow_dvd_iff_le hπ hv] at mem
-  rw [Associates.mk_pow, Associates.prime_pow_dvd_iff_le hπ hv, not_le] at nmem
+  rw [← Ideal.dvd_span_singleton, ← Associates.mk_le_mk_iff_dvd_iff] at mem nmem 
+  rw [← pow_one (Associates.mk v.as_ideal), Associates.prime_pow_dvd_iff_le hπ hv] at mem 
+  rw [Associates.mk_pow, Associates.prime_pow_dvd_iff_le hπ hv, not_le] at nmem 
   exact Nat.eq_of_le_of_lt_succ mem nmem
 #align is_dedekind_domain.height_one_spectrum.int_valuation_exists_uniformizer IsDedekindDomain.HeightOneSpectrum.int_valuation_exists_uniformizer
 
@@ -475,10 +475,10 @@ theorem coe_smul_adicCompletionIntegers (r : R) (x : v.adicCompletionIntegers K)
 instance : NoZeroSMulDivisors R (v.adicCompletionIntegers K)
     where eq_zero_or_eq_zero_of_smul_eq_zero c x hcx :=
     by
-    rw [Algebra.smul_def, mul_eq_zero] at hcx
+    rw [Algebra.smul_def, mul_eq_zero] at hcx 
     refine' hcx.imp_left fun hc => _
     letI : UniformSpace K := v.adic_valued.to_uniform_space
-    rw [← map_zero (algebraMap R (v.adic_completion_integers K))] at hc
+    rw [← map_zero (algebraMap R (v.adic_completion_integers K))] at hc 
     exact
       IsFractionRing.injective R K (UniformSpace.Completion.coe_injective K (subtype.ext_iff.mp hc))
 
Diff
@@ -212,7 +212,7 @@ theorem IntValuation.map_add_le_max' (x y : R) :
     · by_cases hxy : x + y = 0
       · rw [int_valuation_def, if_pos hxy]; exact zero_le'
       · rw [v.int_valuation_def_if_neg hxy, v.int_valuation_def_if_neg hx,
-          v.int_valuation_def_if_neg hy, [anonymous], int_valuation.le_max_iff_min_le]
+          v.int_valuation_def_if_neg hy, WithZero.le_max_iff, int_valuation.le_max_iff_min_le]
         set nmin :=
           min ((Associates.mk v.as_ideal).count (Associates.mk (Ideal.span {x})).factors)
             ((Associates.mk v.as_ideal).count (Associates.mk (Ideal.span {y})).factors)
@@ -463,7 +463,7 @@ instance : Algebra R (v.adicCompletionIntegers K)
   commutes' r x := by rw [mul_comm]
   smul_def' r x := by
     ext
-    simp only [Subring.coe_mul, [anonymous], Algebra.smul_def]
+    simp only [Subring.coe_mul, SetLike.coe_mk, Algebra.smul_def]
     rfl
 
 @[simp]
Diff
@@ -63,7 +63,7 @@ dedekind domain, dedekind ring, adic valuation
 
 noncomputable section
 
-open Classical DiscreteValuation
+open scoped Classical DiscreteValuation
 
 open Multiplicative IsDedekindDomain
 
Diff
@@ -120,8 +120,7 @@ theorem int_valuation_le_one (x : R) : v.intValuationDef x ≤ 1 :=
   by
   rw [int_valuation_def]
   by_cases hx : x = 0
-  · rw [if_pos hx]
-    exact WithZero.zero_le 1
+  · rw [if_pos hx]; exact WithZero.zero_le 1
   · rw [if_neg hx, ← WithZero.coe_one, ← ofAdd_zero, WithZero.coe_le_coe, of_add_le,
       Right.neg_nonpos_iff]
     exact Int.coe_nat_nonneg _
@@ -211,8 +210,7 @@ theorem IntValuation.map_add_le_max' (x y : R) :
       rw [max_eq_right (WithZero.zero_le (v.int_valuation_def x))]
       exact le_refl _
     · by_cases hxy : x + y = 0
-      · rw [int_valuation_def, if_pos hxy]
-        exact zero_le'
+      · rw [int_valuation_def, if_pos hxy]; exact zero_le'
       · rw [v.int_valuation_def_if_neg hxy, v.int_valuation_def_if_neg hx,
           v.int_valuation_def_if_neg hy, [anonymous], int_valuation.le_max_iff_min_le]
         set nmin :=
@@ -311,18 +309,14 @@ theorem valuation_of_algebraMap (r : R) : v.Valuation (algebraMap R K r) = v.int
 #align is_dedekind_domain.height_one_spectrum.valuation_of_algebra_map IsDedekindDomain.HeightOneSpectrum.valuation_of_algebraMap
 
 /-- The `v`-adic valuation on `R` is bounded above by 1. -/
-theorem valuation_le_one (r : R) : v.Valuation (algebraMap R K r) ≤ 1 :=
-  by
-  rw [valuation_of_algebra_map]
-  exact v.int_valuation_le_one r
+theorem valuation_le_one (r : R) : v.Valuation (algebraMap R K r) ≤ 1 := by
+  rw [valuation_of_algebra_map]; exact v.int_valuation_le_one r
 #align is_dedekind_domain.height_one_spectrum.valuation_le_one IsDedekindDomain.HeightOneSpectrum.valuation_le_one
 
 /-- The `v`-adic valuation of `r ∈ R` is less than 1 if and only if `v` divides the ideal `(r)`. -/
 theorem valuation_lt_one_iff_dvd (r : R) :
-    v.Valuation (algebraMap R K r) < 1 ↔ v.asIdeal ∣ Ideal.span {r} :=
-  by
-  rw [valuation_of_algebra_map]
-  exact v.int_valuation_lt_one_iff_dvd r
+    v.Valuation (algebraMap R K r) < 1 ↔ v.asIdeal ∣ Ideal.span {r} := by
+  rw [valuation_of_algebra_map]; exact v.int_valuation_lt_one_iff_dvd r
 #align is_dedekind_domain.height_one_spectrum.valuation_lt_one_iff_dvd IsDedekindDomain.HeightOneSpectrum.valuation_lt_one_iff_dvd
 
 variable (K)
@@ -490,9 +484,7 @@ instance : NoZeroSMulDivisors R (v.adicCompletionIntegers K)
 
 instance AdicCompletion.is_scalar_tower' :
     IsScalarTower R (v.adicCompletionIntegers K) (v.adicCompletion K)
-    where smul_assoc x y z := by
-    simp only [Algebra.smul_def]
-    apply mul_assoc
+    where smul_assoc x y z := by simp only [Algebra.smul_def]; apply mul_assoc
 #align is_dedekind_domain.height_one_spectrum.adic_completion.is_scalar_tower' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.is_scalar_tower'
 
 end AlgebraInstances
Diff
@@ -4,15 +4,15 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: María Inés de Frutos-Fernández
 
 ! This file was ported from Lean 3 source module ring_theory.dedekind_domain.adic_valuation
-! leanprover-community/mathlib commit a8e7ac804fc39df0340c64906075787e0c90fa60
+! leanprover-community/mathlib commit f0c8bf9245297a541f468be517f1bde6195105e9
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.RingTheory.DedekindDomain.Ideal
 import Mathbin.RingTheory.Valuation.ExtendToLocalization
 import Mathbin.RingTheory.Valuation.ValuationSubring
-import Mathbin.RingTheory.Polynomial.Cyclotomic.Basic
 import Mathbin.Topology.Algebra.ValuedField
+import Mathbin.Algebra.Order.Group.TypeTags
 
 /-!
 # Adic valuations on Dedekind domains
Diff
@@ -177,9 +177,9 @@ theorem IntValuation.map_mul' (x y : R) :
   by
   simp only [int_valuation_def]
   by_cases hx : x = 0
-  · rw [hx, zero_mul, if_pos (Eq.refl _), zero_mul]
+  · rw [hx, MulZeroClass.zero_mul, if_pos (Eq.refl _), MulZeroClass.zero_mul]
   · by_cases hy : y = 0
-    · rw [hy, mul_zero, if_pos (Eq.refl _), mul_zero]
+    · rw [hy, MulZeroClass.mul_zero, if_pos (Eq.refl _), MulZeroClass.mul_zero]
     · rw [if_neg hx, if_neg hy, if_neg (mul_ne_zero hx hy), ← WithZero.coe_mul, WithZero.coe_inj, ←
         ofAdd_add, ← Ideal.span_singleton_mul_span_singleton, ← Associates.mk_mul_mk, ← neg_add,
         Associates.count_mul (by apply associates.mk_ne_zero'.mpr hx)
Diff
@@ -368,8 +368,7 @@ def AdicCompletion :=
 #align is_dedekind_domain.height_one_spectrum.adic_completion IsDedekindDomain.HeightOneSpectrum.AdicCompletion
 
 instance : Field (v.adicCompletion K) :=
-  @UniformSpace.Completion.field K _ v.adicValued.toUniformSpace _ _
-    v.adicValued.to_uniform_add_group
+  @UniformSpace.Completion.field K _ v.adicValued.toUniformSpace _ _ v.adicValued.to_uniformAddGroup
 
 instance : Inhabited (v.adicCompletion K) :=
   ⟨0⟩
Diff
@@ -409,14 +409,14 @@ theorem mem_adicCompletionIntegers {x : v.adicCompletion K} :
 section AlgebraInstances
 
 instance (priority := 100) adicValued.has_uniform_continuous_const_smul' :
-    @HasUniformContinuousConstSmul R K v.adicValued.toUniformSpace _ :=
-  @hasUniformContinuousConstSmul_of_continuous_const_smul R K _ _ _ v.adicValued.toUniformSpace _ _
+    @UniformContinuousConstSMul R K v.adicValued.toUniformSpace _ :=
+  @uniformContinuousConstSMul_of_continuousConstSMul R K _ _ _ v.adicValued.toUniformSpace _ _
 #align is_dedekind_domain.height_one_spectrum.adic_valued.has_uniform_continuous_const_smul' IsDedekindDomain.HeightOneSpectrum.adicValued.has_uniform_continuous_const_smul'
 
-instance adicValued.hasUniformContinuousConstSmul :
-    @HasUniformContinuousConstSmul K K v.adicValued.toUniformSpace _ :=
-  @Ring.hasUniformContinuousConstSmul K _ v.adicValued.toUniformSpace _ _
-#align is_dedekind_domain.height_one_spectrum.adic_valued.has_uniform_continuous_const_smul IsDedekindDomain.HeightOneSpectrum.adicValued.hasUniformContinuousConstSmul
+instance adicValued.uniformContinuousConstSMul :
+    @UniformContinuousConstSMul K K v.adicValued.toUniformSpace _ :=
+  @Ring.uniformContinuousConstSMul K _ v.adicValued.toUniformSpace _ _
+#align is_dedekind_domain.height_one_spectrum.adic_valued.has_uniform_continuous_const_smul IsDedekindDomain.HeightOneSpectrum.adicValued.uniformContinuousConstSMul
 
 instance AdicCompletion.algebra' : Algebra R (v.adicCompletion K) :=
   @UniformSpace.Completion.algebra K _ v.adicValued.toUniformSpace _ _ R _ _
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: María Inés de Frutos-Fernández
 
 ! This file was ported from Lean 3 source module ring_theory.dedekind_domain.adic_valuation
-! leanprover-community/mathlib commit 2032a878972d5672e7c27c957e7a6e297b044973
+! leanprover-community/mathlib commit a8e7ac804fc39df0340c64906075787e0c90fa60
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -396,5 +396,107 @@ def adicCompletionIntegers : ValuationSubring (v.adicCompletion K) :=
   Valued.v.ValuationSubring
 #align is_dedekind_domain.height_one_spectrum.adic_completion_integers IsDedekindDomain.HeightOneSpectrum.adicCompletionIntegers
 
+instance : Inhabited (adicCompletionIntegers K v) :=
+  ⟨0⟩
+
+variable (R K)
+
+theorem mem_adicCompletionIntegers {x : v.adicCompletion K} :
+    x ∈ v.adicCompletionIntegers K ↔ (Valued.v x : ℤₘ₀) ≤ 1 :=
+  Iff.rfl
+#align is_dedekind_domain.height_one_spectrum.mem_adic_completion_integers IsDedekindDomain.HeightOneSpectrum.mem_adicCompletionIntegers
+
+section AlgebraInstances
+
+instance (priority := 100) adicValued.has_uniform_continuous_const_smul' :
+    @HasUniformContinuousConstSmul R K v.adicValued.toUniformSpace _ :=
+  @hasUniformContinuousConstSmul_of_continuous_const_smul R K _ _ _ v.adicValued.toUniformSpace _ _
+#align is_dedekind_domain.height_one_spectrum.adic_valued.has_uniform_continuous_const_smul' IsDedekindDomain.HeightOneSpectrum.adicValued.has_uniform_continuous_const_smul'
+
+instance adicValued.hasUniformContinuousConstSmul :
+    @HasUniformContinuousConstSmul K K v.adicValued.toUniformSpace _ :=
+  @Ring.hasUniformContinuousConstSmul K _ v.adicValued.toUniformSpace _ _
+#align is_dedekind_domain.height_one_spectrum.adic_valued.has_uniform_continuous_const_smul IsDedekindDomain.HeightOneSpectrum.adicValued.hasUniformContinuousConstSmul
+
+instance AdicCompletion.algebra' : Algebra R (v.adicCompletion K) :=
+  @UniformSpace.Completion.algebra K _ v.adicValued.toUniformSpace _ _ R _ _
+    (adicValued.has_uniform_continuous_const_smul' R K v)
+#align is_dedekind_domain.height_one_spectrum.adic_completion.algebra' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.algebra'
+
+@[simp]
+theorem coe_smul_adicCompletion (r : R) (x : K) :
+    (↑(r • x) : v.adicCompletion K) = r • (↑x : v.adicCompletion K) :=
+  @UniformSpace.Completion.coe_smul R K v.adicValued.toUniformSpace _ _ r x
+#align is_dedekind_domain.height_one_spectrum.coe_smul_adic_completion IsDedekindDomain.HeightOneSpectrum.coe_smul_adicCompletion
+
+instance : Algebra K (v.adicCompletion K) :=
+  @UniformSpace.Completion.algebra' K _ v.adicValued.toUniformSpace _ _
+
+theorem algebraMap_adic_completion' :
+    ⇑(algebraMap R <| v.adicCompletion K) = coe ∘ algebraMap R K :=
+  rfl
+#align is_dedekind_domain.height_one_spectrum.algebra_map_adic_completion' IsDedekindDomain.HeightOneSpectrum.algebraMap_adic_completion'
+
+theorem algebraMap_adicCompletion : ⇑(algebraMap K <| v.adicCompletion K) = coe :=
+  rfl
+#align is_dedekind_domain.height_one_spectrum.algebra_map_adic_completion IsDedekindDomain.HeightOneSpectrum.algebraMap_adicCompletion
+
+instance : IsScalarTower R K (v.adicCompletion K) :=
+  @UniformSpace.Completion.isScalarTower R K K v.adicValued.toUniformSpace _ _ _
+    (adicValued.has_uniform_continuous_const_smul' R K v) _ _
+
+instance : Algebra R (v.adicCompletionIntegers K)
+    where
+  smul r x :=
+    ⟨r • (x : v.adicCompletion K),
+      by
+      have h : (algebraMap R (adicCompletion K v)) r = (coe <| algebraMap R K r) := rfl
+      rw [Algebra.smul_def]
+      refine' ValuationSubring.mul_mem _ _ _ _ x.2
+      rw [mem_adic_completion_integers, h, Valued.valuedCompletion_apply]
+      exact v.valuation_le_one _⟩
+  toFun r :=
+    ⟨coe <| algebraMap R K r, by
+      simpa only [mem_adic_completion_integers, Valued.valuedCompletion_apply] using
+        v.valuation_le_one _⟩
+  map_one' := by simp only [map_one] <;> rfl
+  map_mul' x y := by
+    ext
+    simp_rw [RingHom.map_mul, Subring.coe_mul, Subtype.coe_mk, UniformSpace.Completion.coe_mul]
+  map_zero' := by simp only [map_zero] <;> rfl
+  map_add' x y := by
+    ext
+    simp_rw [RingHom.map_add, Subring.coe_add, Subtype.coe_mk, UniformSpace.Completion.coe_add]
+  commutes' r x := by rw [mul_comm]
+  smul_def' r x := by
+    ext
+    simp only [Subring.coe_mul, [anonymous], Algebra.smul_def]
+    rfl
+
+@[simp]
+theorem coe_smul_adicCompletionIntegers (r : R) (x : v.adicCompletionIntegers K) :
+    (↑(r • x) : v.adicCompletion K) = r • (x : v.adicCompletion K) :=
+  rfl
+#align is_dedekind_domain.height_one_spectrum.coe_smul_adic_completion_integers IsDedekindDomain.HeightOneSpectrum.coe_smul_adicCompletionIntegers
+
+instance : NoZeroSMulDivisors R (v.adicCompletionIntegers K)
+    where eq_zero_or_eq_zero_of_smul_eq_zero c x hcx :=
+    by
+    rw [Algebra.smul_def, mul_eq_zero] at hcx
+    refine' hcx.imp_left fun hc => _
+    letI : UniformSpace K := v.adic_valued.to_uniform_space
+    rw [← map_zero (algebraMap R (v.adic_completion_integers K))] at hc
+    exact
+      IsFractionRing.injective R K (UniformSpace.Completion.coe_injective K (subtype.ext_iff.mp hc))
+
+instance AdicCompletion.is_scalar_tower' :
+    IsScalarTower R (v.adicCompletionIntegers K) (v.adicCompletion K)
+    where smul_assoc x y z := by
+    simp only [Algebra.smul_def]
+    apply mul_assoc
+#align is_dedekind_domain.height_one_spectrum.adic_completion.is_scalar_tower' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.is_scalar_tower'
+
+end AlgebraInstances
+
 end IsDedekindDomain.HeightOneSpectrum
 

Changes in mathlib4

mathlib3
mathlib4
chore(Associated): add simps, golf (#11435)

New simp tags or simp lemmas

associated_one_iff_isUnit, associated_zero_iff_eq_zero, Associates.mk_eq_one, Associates.mk_dvd_mk, Associates.mk_isRelPrime_iff, Associates.mk_zero, Associates.quot_out_zero, Associates.le_zero, Associates.prime_mk, Associates.irreducible_mk, Associates.mk_dvdNotUnit_mk_iff, Associates.factors_le, Associates.prod_factors

New gcongr tags

Associates.factors_mono, Associates.prod_mono

Change explicit args to implicit

Associates.prime_mk, Associates.irreducible_mk, Associates.one_or_eq_of_le_of_prime

Change typeclass assumptions

  • drop [Nontrivial _] here and there, mostly in cases when a lemma has _ ≠ _ assumption
  • drop all decidability assumptions in Associates.FactorSetMem
  • drop decidability assumptions when they aren't needed to formulate a theorem

Use WithTop API

Use WithTop.some and instead of Option.some and none in UniqueFactorizationDomain.

Renames

  • Associates.isPrimal_iffAssociates.isPrimal_mk;
  • Associates.mk_le_mk_iff_dvd_iffAssociates.mk_le_mk_iff_dvd;
  • Associates.factors_0Associates.factors_zero;
  • Associates.factors_eq_none_iff_zeroAssociates.factors_eq_top_iff_zero
Diff
@@ -247,7 +247,7 @@ theorem int_valuation_exists_uniformizer :
   rw [intValuationDef, if_neg (Associates.mk_ne_zero'.mp hπ), WithZero.coe_inj]
   apply congr_arg
   rw [neg_inj, ← Int.ofNat_one, Int.natCast_inj]
-  rw [← Ideal.dvd_span_singleton, ← Associates.mk_le_mk_iff_dvd_iff] at mem nmem
+  rw [← Ideal.dvd_span_singleton, ← Associates.mk_le_mk_iff_dvd] at mem nmem
   rw [← pow_one (Associates.mk v.asIdeal), Associates.prime_pow_dvd_iff_le hπ hv] at mem
   rw [Associates.mk_pow, Associates.prime_pow_dvd_iff_le hπ hv, not_le] at nmem
   exact Nat.eq_of_le_of_lt_succ mem nmem
chore(Data/Int): Rename coe_nat to natCast (#11637)

Reduce the diff of #11499

Renames

All in the Int namespace:

  • ofNat_eq_castofNat_eq_natCast
  • cast_eq_cast_iff_NatnatCast_inj
  • natCast_eq_ofNatofNat_eq_natCast
  • coe_nat_subnatCast_sub
  • coe_nat_nonnegnatCast_nonneg
  • sign_coe_add_onesign_natCast_add_one
  • nat_succ_eq_int_succnatCast_succ
  • succ_neg_nat_succsucc_neg_natCast_succ
  • coe_pred_of_posnatCast_pred_of_pos
  • coe_nat_divnatCast_div
  • coe_nat_edivnatCast_ediv
  • sign_coe_nat_of_nonzerosign_natCast_of_ne_zero
  • toNat_coe_nattoNat_natCast
  • toNat_coe_nat_add_onetoNat_natCast_add_one
  • coe_nat_dvdnatCast_dvd_natCast
  • coe_nat_dvd_leftnatCast_dvd
  • coe_nat_dvd_rightdvd_natCast
  • le_coe_nat_suble_natCast_sub
  • succ_coe_nat_possucc_natCast_pos
  • coe_nat_modEq_iffnatCast_modEq_iff
  • coe_natAbsnatCast_natAbs
  • coe_nat_eq_zeronatCast_eq_zero
  • coe_nat_ne_zeronatCast_ne_zero
  • coe_nat_ne_zero_iff_posnatCast_ne_zero_iff_pos
  • abs_coe_natabs_natCast
  • coe_nat_nonpos_iffnatCast_nonpos_iff

Also rename Nat.coe_nat_dvd to Nat.cast_dvd_cast

Diff
@@ -117,7 +117,7 @@ theorem int_valuation_le_one (x : R) : v.intValuationDef x ≤ 1 := by
   · rw [if_pos hx]; exact WithZero.zero_le 1
   · rw [if_neg hx, ← WithZero.coe_one, ← ofAdd_zero, WithZero.coe_le_coe, ofAdd_le,
       Right.neg_nonpos_iff]
-    exact Int.coe_nat_nonneg _
+    exact Int.natCast_nonneg _
 #align is_dedekind_domain.height_one_spectrum.int_valuation_le_one IsDedekindDomain.HeightOneSpectrum.int_valuation_le_one
 
 /-- The `v`-adic valuation of `r ∈ R` is less than 1 if and only if `v` divides the ideal `(r)`. -/
@@ -246,7 +246,7 @@ theorem int_valuation_exists_uniformizer :
   use π
   rw [intValuationDef, if_neg (Associates.mk_ne_zero'.mp hπ), WithZero.coe_inj]
   apply congr_arg
-  rw [neg_inj, ← Int.ofNat_one, Int.coe_nat_inj']
+  rw [neg_inj, ← Int.ofNat_one, Int.natCast_inj]
   rw [← Ideal.dvd_span_singleton, ← Associates.mk_le_mk_iff_dvd_iff] at mem nmem
   rw [← pow_one (Associates.mk v.asIdeal), Associates.prime_pow_dvd_iff_le hπ hv] at mem
   rw [Associates.mk_pow, Associates.prime_pow_dvd_iff_le hπ hv, not_le] at nmem
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11813)
Diff
@@ -129,7 +129,7 @@ theorem int_valuation_lt_one_iff_dvd (r : R) :
   · rw [← WithZero.coe_one, ← ofAdd_zero, WithZero.coe_lt_coe, ofAdd_lt, neg_lt_zero, ←
       Int.ofNat_zero, Int.ofNat_lt, zero_lt_iff]
     have h : (Ideal.span {r} : Ideal R) ≠ 0 := by
-      rw [Ne.def, Ideal.zero_eq_bot, Ideal.span_singleton_eq_bot]
+      rw [Ne, Ideal.zero_eq_bot, Ideal.span_singleton_eq_bot]
       exact hr
     apply Associates.count_ne_zero_iff_dvd h (by apply v.irreducible)
 #align is_dedekind_domain.height_one_spectrum.int_valuation_lt_one_iff_dvd IsDedekindDomain.HeightOneSpectrum.int_valuation_lt_one_iff_dvd
feat(DedekindDomain.Ideal): remove Domain assumption from DedekindDomain (#11527)

Probably because in mathlib4 the definition IsDedekindDomain extends Domain, and this was not the case in mathlib3, there are unused hypothesis of the form

variable [IsDomain R] [IsDedekindDomain R]

and this PR removes the first one, that can be inferred by the second, both in variable declarations and in theorem/definition assumptions. A regex search has been performed on the library to search for all occurrences and none is left.

Diff
@@ -64,7 +64,7 @@ open scoped Classical DiscreteValuation
 
 open Multiplicative IsDedekindDomain
 
-variable {R : Type*} [CommRing R] [IsDomain R] [IsDedekindDomain R] {K : Type*} [Field K]
+variable {R : Type*} [CommRing R] [IsDedekindDomain R] {K : Type*} [Field K]
   [Algebra R K] [IsFractionRing R K] (v : HeightOneSpectrum R)
 
 namespace IsDedekindDomain.HeightOneSpectrum
chore: move Mathlib to v4.7.0-rc1 (#11162)

This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0 branch as we update to intermediate nightlies.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>

Diff
@@ -397,7 +397,6 @@ instance AdicCompletion.algebra' : Algebra R (v.adicCompletion K) :=
     (adicValued.has_uniform_continuous_const_smul' R K v)
 #align is_dedekind_domain.height_one_spectrum.adic_completion.algebra' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.algebra'
 
-@[simp]
 theorem coe_smul_adicCompletion (r : R) (x : K) :
     (↑(r • x) : v.adicCompletion K) = r • (↑x : v.adicCompletion K) :=
   @UniformSpace.Completion.coe_smul R K v.adicValued.toUniformSpace _ _ r x
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -436,7 +436,7 @@ instance : Algebra R (v.adicCompletionIntegers K) where
     ⟨(algebraMap R K r : adicCompletion K v), by
       -- porting note (#10754): added instance
       letI : Valued K ℤₘ₀ := adicValued v
-      --Porting note: rest of proof was `simpa only
+      -- Porting note: rest of proof was `simpa only
       --   [mem_adicCompletionIntegers, Valued.valuedCompletion_apply] using
       --   v.valuation_le_one _
       -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
@@ -460,7 +460,7 @@ instance : Algebra R (v.adicCompletionIntegers K) where
     rw [mul_comm]
   smul_def' r x := by
     ext
-    --Porting note: added `dsimp`
+    -- Porting note: added `dsimp`
     dsimp
     --porting note (#10754): added instance
     letI : Valued K ℤₘ₀ := adicValued v
chore: classify added instance porting notes (#10755)

Classifies by adding issue number (#10754) to porting notes claiming added instance.

Diff
@@ -427,14 +427,14 @@ instance : Algebra R (v.adicCompletionIntegers K) where
         (algebraMap R (adicCompletion K v)) r = (algebraMap R K r : adicCompletion K v) := rfl
       rw [Algebra.smul_def]
       refine' ValuationSubring.mul_mem _ _ _ _ x.2
-      --Porting note: added instance
+      --porting note (#10754): added instance
       letI : Valued K ℤₘ₀ := adicValued v
       -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
       erw [mem_adicCompletionIntegers, h, Valued.valuedCompletion_apply]
       exact v.valuation_le_one _⟩
   toFun r :=
     ⟨(algebraMap R K r : adicCompletion K v), by
-      -- Porting note: added instance
+      -- porting note (#10754): added instance
       letI : Valued K ℤₘ₀ := adicValued v
       --Porting note: rest of proof was `simpa only
       --   [mem_adicCompletionIntegers, Valued.valuedCompletion_apply] using
@@ -445,13 +445,13 @@ instance : Algebra R (v.adicCompletionIntegers K) where
   map_one' := by simp only [map_one]; rfl
   map_mul' x y := by
     ext
-    --Porting note: added instance
+    --porting note (#10754): added instance
     letI : Valued K ℤₘ₀ := adicValued v
     simp_rw [RingHom.map_mul, Subring.coe_mul, UniformSpace.Completion.coe_mul]
   map_zero' := by simp only [map_zero]; rfl
   map_add' x y := by
     ext
-    --Porting note: added instance
+    --porting note (#10754): added instance
     letI : Valued K ℤₘ₀ := adicValued v
     simp_rw [RingHom.map_add, Subring.coe_add, UniformSpace.Completion.coe_add]
   commutes' r x := by
@@ -462,7 +462,7 @@ instance : Algebra R (v.adicCompletionIntegers K) where
     ext
     --Porting note: added `dsimp`
     dsimp
-    --Porting note: added instance
+    --porting note (#10754): added instance
     letI : Valued K ℤₘ₀ := adicValued v
     simp only [Subring.coe_mul, Algebra.smul_def]
     rfl
perf(FunLike.Basic): beta reduce CoeFun.coe (#7905)

This eliminates (fun a ↦ β) α in the type when applying a FunLike.

Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -78,8 +78,8 @@ multiplicative valuation. -/
 def intValuationDef (r : R) : ℤₘ₀ :=
   if r = 0 then 0
   else
-    Multiplicative.ofAdd
-      (-(Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {r} : Ideal R)).factors : ℤ)
+    ↑(Multiplicative.ofAdd
+      (-(Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {r} : Ideal R)).factors : ℤ))
 #align is_dedekind_domain.height_one_spectrum.int_valuation_def IsDedekindDomain.HeightOneSpectrum.intValuationDef
 
 theorem intValuationDef_if_pos {r : R} (hr : r = 0) : v.intValuationDef r = 0 :=
Revert "chore: revert #7703 (#7710)"

This reverts commit f3695eb2.

Diff
@@ -429,7 +429,8 @@ instance : Algebra R (v.adicCompletionIntegers K) where
       refine' ValuationSubring.mul_mem _ _ _ _ x.2
       --Porting note: added instance
       letI : Valued K ℤₘ₀ := adicValued v
-      rw [mem_adicCompletionIntegers, h, Valued.valuedCompletion_apply]
+      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+      erw [mem_adicCompletionIntegers, h, Valued.valuedCompletion_apply]
       exact v.valuation_le_one _⟩
   toFun r :=
     ⟨(algebraMap R K r : adicCompletion K v), by
@@ -438,7 +439,8 @@ instance : Algebra R (v.adicCompletionIntegers K) where
       --Porting note: rest of proof was `simpa only
       --   [mem_adicCompletionIntegers, Valued.valuedCompletion_apply] using
       --   v.valuation_le_one _
-      rw [mem_adicCompletionIntegers, Valued.valuedCompletion_apply]
+      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+      erw [mem_adicCompletionIntegers, Valued.valuedCompletion_apply]
       exact v.valuation_le_one _⟩
   map_one' := by simp only [map_one]; rfl
   map_mul' x y := by
chore: revert #7703 (#7710)

This reverts commit 26eb2b0a.

Diff
@@ -429,8 +429,7 @@ instance : Algebra R (v.adicCompletionIntegers K) where
       refine' ValuationSubring.mul_mem _ _ _ _ x.2
       --Porting note: added instance
       letI : Valued K ℤₘ₀ := adicValued v
-      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
-      erw [mem_adicCompletionIntegers, h, Valued.valuedCompletion_apply]
+      rw [mem_adicCompletionIntegers, h, Valued.valuedCompletion_apply]
       exact v.valuation_le_one _⟩
   toFun r :=
     ⟨(algebraMap R K r : adicCompletion K v), by
@@ -439,8 +438,7 @@ instance : Algebra R (v.adicCompletionIntegers K) where
       --Porting note: rest of proof was `simpa only
       --   [mem_adicCompletionIntegers, Valued.valuedCompletion_apply] using
       --   v.valuation_le_one _
-      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
-      erw [mem_adicCompletionIntegers, Valued.valuedCompletion_apply]
+      rw [mem_adicCompletionIntegers, Valued.valuedCompletion_apply]
       exact v.valuation_le_one _⟩
   map_one' := by simp only [map_one]; rfl
   map_mul' x y := by
chore: bump toolchain to v4.2.0-rc2 (#7703)

This includes all the changes from #7606.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -429,7 +429,8 @@ instance : Algebra R (v.adicCompletionIntegers K) where
       refine' ValuationSubring.mul_mem _ _ _ _ x.2
       --Porting note: added instance
       letI : Valued K ℤₘ₀ := adicValued v
-      rw [mem_adicCompletionIntegers, h, Valued.valuedCompletion_apply]
+      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+      erw [mem_adicCompletionIntegers, h, Valued.valuedCompletion_apply]
       exact v.valuation_le_one _⟩
   toFun r :=
     ⟨(algebraMap R K r : adicCompletion K v), by
@@ -438,7 +439,8 @@ instance : Algebra R (v.adicCompletionIntegers K) where
       --Porting note: rest of proof was `simpa only
       --   [mem_adicCompletionIntegers, Valued.valuedCompletion_apply] using
       --   v.valuation_le_one _
-      rw [mem_adicCompletionIntegers, Valued.valuedCompletion_apply]
+      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
+      erw [mem_adicCompletionIntegers, Valued.valuedCompletion_apply]
       exact v.valuation_le_one _⟩
   map_one' := by simp only [map_one]; rfl
   map_mul' x y := by
chore: fix some cases in names (#7469)

And fix some names in comments where this revealed issues

Diff
@@ -38,7 +38,7 @@ We define the completion of `K` with respect to the `v`-adic valuation, denoted
   ideal `(r)`.
 - `IsDedekindDomain.HeightOneSpectrum.int_valuation_exists_uniformizer` : There exists `π ∈ R`
   with `v`-adic valuation `Multiplicative.ofAdd (-1)`.
-- `is_dedekind_domain.height_one_spectrum.valuation_of_mk'` : The `v`-adic valuation of `r/s ∈ K`
+- IsDedekindDomain.HeightOneSpectrum.valuation_of_mk'` : The `v`-adic valuation of `r/s ∈ K`
   is the valuation of `r` divided by the valuation of `s`.
 - `IsDedekindDomain.HeightOneSpectrum.valuation_of_algebraMap` : The `v`-adic valuation on `K`
   extends the `v`-adic valuation on `R`.
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -165,9 +165,9 @@ theorem IntValuation.map_mul' (x y : R) :
     v.intValuationDef (x * y) = v.intValuationDef x * v.intValuationDef y := by
   simp only [intValuationDef]
   by_cases hx : x = 0
-  · rw [hx, MulZeroClass.zero_mul, if_pos (Eq.refl _), MulZeroClass.zero_mul]
+  · rw [hx, zero_mul, if_pos (Eq.refl _), zero_mul]
   · by_cases hy : y = 0
-    · rw [hy, MulZeroClass.mul_zero, if_pos (Eq.refl _), MulZeroClass.mul_zero]
+    · rw [hy, mul_zero, if_pos (Eq.refl _), mul_zero]
     · rw [if_neg hx, if_neg hy, if_neg (mul_ne_zero hx hy), ← WithZero.coe_mul, WithZero.coe_inj, ←
         ofAdd_add, ← Ideal.span_singleton_mul_span_singleton, ← Associates.mk_mul_mk, ← neg_add,
         Associates.count_mul (by apply Associates.mk_ne_zero'.mpr hx)
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -445,13 +445,13 @@ instance : Algebra R (v.adicCompletionIntegers K) where
     ext
     --Porting note: added instance
     letI : Valued K ℤₘ₀ := adicValued v
-    simp_rw [RingHom.map_mul, Subring.coe_mul, Subtype.coe_mk, UniformSpace.Completion.coe_mul]
+    simp_rw [RingHom.map_mul, Subring.coe_mul, UniformSpace.Completion.coe_mul]
   map_zero' := by simp only [map_zero]; rfl
   map_add' x y := by
     ext
     --Porting note: added instance
     letI : Valued K ℤₘ₀ := adicValued v
-    simp_rw [RingHom.map_add, Subring.coe_add, Subtype.coe_mk, UniformSpace.Completion.coe_add]
+    simp_rw [RingHom.map_add, Subring.coe_add, UniformSpace.Completion.coe_add]
   commutes' r x := by
     -- Porting note: added `dsimp` line
     dsimp
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -64,7 +64,7 @@ open scoped Classical DiscreteValuation
 
 open Multiplicative IsDedekindDomain
 
-variable {R : Type _} [CommRing R] [IsDomain R] [IsDedekindDomain R] {K : Type _} [Field K]
+variable {R : Type*} [CommRing R] [IsDomain R] [IsDedekindDomain R] {K : Type*} [Field K]
   [Algebra R K] [IsFractionRing R K] (v : HeightOneSpectrum R)
 
 namespace IsDedekindDomain.HeightOneSpectrum
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2022 María Inés de Frutos-Fernández. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: María Inés de Frutos-Fernández
-
-! This file was ported from Lean 3 source module ring_theory.dedekind_domain.adic_valuation
-! leanprover-community/mathlib commit f0c8bf9245297a541f468be517f1bde6195105e9
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.RingTheory.DedekindDomain.Ideal
 import Mathlib.RingTheory.Valuation.ExtendToLocalization
@@ -14,6 +9,8 @@ import Mathlib.RingTheory.Valuation.ValuationSubring
 import Mathlib.Topology.Algebra.ValuedField
 import Mathlib.Algebra.Order.Group.TypeTags
 
+#align_import ring_theory.dedekind_domain.adic_valuation from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9"
+
 /-!
 # Adic valuations on Dedekind domains
 Given a Dedekind domain `R` of Krull dimension 1 and a maximal ideal `v` of `R`, we define the
chore: tidy various files (#5482)
Diff
@@ -21,7 +21,7 @@ Given a Dedekind domain `R` of Krull dimension 1 and a maximal ideal `v` of `R`,
 We prove several properties of this valuation, including the existence of uniformizers.
 
 We define the completion of `K` with respect to the `v`-adic valuation, denoted
-`v.adic_completion`,and its ring of integers, denoted `v.adic_completion_integers`.
+`v.adicCompletion`, and its ring of integers, denoted `v.adicCompletionIntegers`.
 
 ## Main definitions
  - `IsDedekindDomain.HeightOneSpectrum.intValuation v` is the `v`-adic valuation on `R`.
@@ -29,7 +29,7 @@ We define the completion of `K` with respect to the `v`-adic valuation, denoted
  - `IsDedekindDomain.HeightOneSpectrum.adicCompletion v` is the completion of `K` with respect
     to its `v`-adic valuation.
  - `IsDedekindDomain.HeightOneSpectrum.adicCompletionIntegers v` is the ring of integers of
-    `v.adic_completion`.
+    `v.adicCompletion`.
 
 ## Main results
 - `IsDedekindDomain.HeightOneSpectrum.int_valuation_le_one` : The `v`-adic valuation on `R` is
@@ -76,7 +76,7 @@ namespace IsDedekindDomain.HeightOneSpectrum
 
 
 /-- The additive `v`-adic valuation of `r ∈ R` is the exponent of `v` in the factorization of the
-ideal `(r)`, if `r` is nonzero, or infinity, if `r = 0`. `int_valuation_def` is the corresponding
+ideal `(r)`, if `r` is nonzero, or infinity, if `r = 0`. `intValuationDef` is the corresponding
 multiplicative valuation. -/
 def intValuationDef (r : R) : ℤₘ₀ :=
   if r = 0 then 0
@@ -318,8 +318,8 @@ theorem valuation_uniformizer_ne_zero : Classical.choose (v.valuation_exists_uni
 /-! ### Completions with respect to adic valuations
 
 Given a Dedekind domain `R` with field of fractions `K` and a maximal ideal `v` of `R`, we define
-the completion of `K` with respect to its `v`-adic valuation, denoted `v.adic_completion`, and its
-ring of integers, denoted `v.adic_completion_integers`. -/
+the completion of `K` with respect to its `v`-adic valuation, denoted `v.adicCompletion`, and its
+ring of integers, denoted `v.adicCompletionIntegers`. -/
 
 
 variable {K}
@@ -409,10 +409,10 @@ theorem coe_smul_adicCompletion (r : R) (x : K) :
 instance : Algebra K (v.adicCompletion K) :=
   @UniformSpace.Completion.algebra' K _ v.adicValued.toUniformSpace _ _
 
-theorem algebraMap_adic_completion' :
+theorem algebraMap_adicCompletion' :
     ⇑(algebraMap R <| v.adicCompletion K) = (↑) ∘ algebraMap R K :=
   rfl
-#align is_dedekind_domain.height_one_spectrum.algebra_map_adic_completion' IsDedekindDomain.HeightOneSpectrum.algebraMap_adic_completion'
+#align is_dedekind_domain.height_one_spectrum.algebra_map_adic_completion' IsDedekindDomain.HeightOneSpectrum.algebraMap_adicCompletion'
 
 theorem algebraMap_adicCompletion :
     ⇑(algebraMap K <| v.adicCompletion K) = ((↑) : K → adicCompletion K v) :=
@@ -483,10 +483,10 @@ instance : NoZeroSMulDivisors R (v.adicCompletionIntegers K) where
     exact
       IsFractionRing.injective R K (UniformSpace.Completion.coe_injective K (Subtype.ext_iff.mp hc))
 
-instance AdicCompletion.is_scalar_tower' :
+instance AdicCompletion.instIsScalarTower' :
     IsScalarTower R (v.adicCompletionIntegers K) (v.adicCompletion K) where
   smul_assoc x y z := by simp only [Algebra.smul_def]; apply mul_assoc
-#align is_dedekind_domain.height_one_spectrum.adic_completion.is_scalar_tower' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.is_scalar_tower'
+#align is_dedekind_domain.height_one_spectrum.adic_completion.is_scalar_tower' IsDedekindDomain.HeightOneSpectrum.AdicCompletion.instIsScalarTower'
 
 end AlgebraInstances
 
feat: port RingTheory.DedekindDomain.AdicValuation (#5372)

Co-authored-by: Chris Hughes <chrishughes24@gmail.com>

Dependencies 11 + 759

760 files ported (98.6%)
324877 lines ported (98.4%)
Show graph

The unported dependencies are