diff --git a/Mathlib/NumberTheory/Height/NumberField.lean b/Mathlib/NumberTheory/Height/NumberField.lean index 852c8132ed30e9..662998281a7a86 100644 --- a/Mathlib/NumberTheory/Height/NumberField.lean +++ b/Mathlib/NumberTheory/Height/NumberField.lean @@ -128,6 +128,16 @@ lemma mulHeight_eq {ι : Type*} {x : ι → K} (hx : x ≠ 0) : simp only [FinitePlace.coe_apply, InfinitePlace.coe_apply, Height.mulHeight_eq hx, prod_archAbsVal_eq, prod_nonarchAbsVal_eq fun v ↦ ⨆ i, v (x i)] +open Classical IntermediateField in +/-- The absolute multiplicative height of an algebraic number. This is defined for elements of any +field of characteristic zero, with a junk value of `0` if the element is not algebraic. -/ +noncomputable def absMulHeight₁ {K : Type*} [Field K] [CharZero K] (x : K) : ℝ := + if hx : IsIntegral ℚ x then + haveI : FiniteDimensional ℚ ℚ⟮x⟯ := adjoin.finiteDimensional hx + haveI : NumberField ℚ⟮x⟯ := {} + (Height.mulHeight₁ (AdjoinSimple.gen ℚ x)) ^ (Module.finrank ℚ ℚ⟮x⟯ : ℝ)⁻¹ + else 0 + variable (K) in lemma totalWeight_eq_sum_mult : totalWeight K = ∑ v : InfinitePlace K, v.mult := by simp only [totalWeight]