Skip to content

Commit

Permalink
fix: align Int.norm_eq_abs with its mathlib3 meaning (#11841)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben-VandeVelde committed Apr 2, 2024
1 parent a3021ae commit 921bb50
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions Mathlib/Analysis/Normed/Group/Basic.lean
Expand Up @@ -1917,9 +1917,8 @@ theorem norm_cast_real (m : ℤ) : ‖(m : ℝ)‖ = ‖m‖ :=
rfl
#align int.norm_cast_real Int.norm_cast_real

theorem norm_eq_abs (n : ℤ) : ‖n‖ = |n| :=
show ‖(n : ℝ)‖ = |n| by rw [Real.norm_eq_abs, cast_abs]
-- Porting note: I'm not sure why this isn't `rfl` anymore, but I suspect it's about coercions
theorem norm_eq_abs (n : ℤ) : ‖n‖ = |(n : ℝ)| :=
rfl
#align int.norm_eq_abs Int.norm_eq_abs

@[simp]
Expand All @@ -1930,7 +1929,7 @@ theorem _root_.NNReal.coe_natAbs (n : ℤ) : (n.natAbs : ℝ≥0) = ‖n‖₊ :
NNReal.eq <|
calc
((n.natAbs : ℝ≥0) : ℝ) = (n.natAbs : ℤ) := by simp only [Int.cast_ofNat, NNReal.coe_nat_cast]
_ = |n| := by simp only [Int.coe_natAbs, Int.cast_abs]
_ = |(n : ℝ)| := by simp only [Int.coe_natAbs, Int.cast_abs]
_ = ‖n‖ := (norm_eq_abs n).symm
#align nnreal.coe_nat_abs NNReal.coe_natAbs

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Analysis/NormedSpace/Basic.lean
Expand Up @@ -101,8 +101,8 @@ instance NormedSpace.discreteTopology_zmultiples
obtain ⟨k, rfl⟩ := AddSubgroup.mem_zmultiples_iff.mp hx
rw [mem_preimage, mem_ball_zero_iff, AddSubgroup.coe_mk, mem_singleton_iff, Subtype.ext_iff,
AddSubgroup.coe_mk, AddSubgroup.coe_zero, norm_zsmul ℚ k e, Int.norm_cast_rat,
Int.norm_eq_abs, mul_lt_iff_lt_one_left (norm_pos_iff.mpr he), ←
@Int.cast_one ℝ _, Int.cast_lt, Int.abs_lt_one_iff, smul_eq_zero, or_iff_left he]
Int.norm_eq_abs, mul_lt_iff_lt_one_left (norm_pos_iff.mpr he), ← @Int.cast_one ℝ _,
Int.cast_abs, Int.cast_lt, Int.abs_lt_one_iff, smul_eq_zero, or_iff_left he]

open NormedField

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/NumberTheory/NumberField/Discriminant.lean
Expand Up @@ -309,8 +309,8 @@ theorem minkowskiBound_lt_boundOfDiscBdd : minkowskiBound K ↑1 < boundOfDiscBd
coe_mul, ENNReal.coe_pow, coe_ofNat, show sqrt N = (1:ℝ≥0∞) * sqrt N by rw [one_mul]]
gcongr
· exact pow_le_one _ (by positivity) (by norm_num)
· rw [sqrt_le_sqrt, ← NNReal.coe_le_coe, coe_nnnorm, Int.norm_eq_abs]
exact Int.cast_le.mpr hK
· rwa [sqrt_le_sqrt, ← NNReal.coe_le_coe, coe_nnnorm, Int.norm_eq_abs, ← Int.cast_abs,
NNReal.coe_nat_cast, ← Int.cast_ofNat, Int.cast_le]
· exact one_le_two
· exact rank_le_rankOfDiscrBdd hK

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/NumberTheory/NumberField/Embeddings.lean
Expand Up @@ -112,7 +112,7 @@ theorem finite_of_norm_le (B : ℝ) : {x : K | IsIntegral ℤ x ∧ ∀ φ : K
exact minpoly.natDegree_le x
rw [mem_Icc, ← abs_le, ← @Int.cast_le ℝ]
refine (Eq.trans_le ?_ <| coeff_bdd_of_norm_le hx.2 i).trans (Nat.le_ceil _)
rw [h_map_ℚ_minpoly, coeff_map, eq_intCast, Int.norm_cast_rat, Int.norm_eq_abs]
rw [h_map_ℚ_minpoly, coeff_map, eq_intCast, Int.norm_cast_rat, Int.norm_eq_abs, Int.cast_abs]
#align number_field.embeddings.finite_of_norm_le NumberField.Embeddings.finite_of_norm_le

/-- An algebraic integer whose conjugates are all of norm one is a root of unity. -/
Expand Down

0 comments on commit 921bb50

Please sign in to comment.