Skip to content

Commit d7fd3e4

Browse files
committed
feat(NumberField/CanonicalEmbedding): add normAtPlace (#13135)
Working in the mixed space `ℝ^r₁ × ℂ^r₂` associated to a number field can be sometimes tedious since one has to deal separately with real and complex components even though the arguments are often very similar. In order to make working with norms easier, this PR defines for an infinite place `w` and an element `x` of `ℝ^r₁ × ℂ^r₂`, `normAtPlace w x` as essentially `‖x w‖` and proves many properties about it. This make it possible to golf some existing proofs and will also make things simpler in the coming PRs about the fundamental cone.
1 parent b70b6b2 commit d7fd3e4

File tree

3 files changed

+188
-120
lines changed

3 files changed

+188
-120
lines changed

Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean

Lines changed: 129 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ end NumberField.canonicalEmbedding
156156

157157
namespace NumberField.mixedEmbedding
158158

159-
open NumberField NumberField.InfinitePlace FiniteDimensional
159+
open NumberField NumberField.InfinitePlace FiniteDimensional Finset
160160

161161
/-- The space `ℝ^r₁ × ℂ^r₂` with `(r₁, r₂)` the signature of `K`. -/
162162
local notation "E" K =>
@@ -177,9 +177,9 @@ instance [NumberField K] : Nontrivial (E K) := by
177177

178178
protected theorem finrank [NumberField K] : finrank ℝ (E K) = finrank ℚ K := by
179179
classical
180-
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, Finset.sum_const,
181-
Finset.card_univ, ← NrRealPlaces, ← NrComplexPlaces, ← card_real_embeddings,
182-
Algebra.id.smul_eq_mul, mul_comm, ← card_complex_embeddings, ← NumberField.Embeddings.card K ℂ,
180+
rw [finrank_prod, finrank_pi, finrank_pi_fintype, Complex.finrank_real_complex, sum_const,
181+
card_univ, ← NrRealPlaces, ← NrComplexPlaces, ← card_real_embeddings, Algebra.id.smul_eq_mul,
182+
mul_comm, ← card_complex_embeddings, ← NumberField.Embeddings.card K ℂ,
183183
Fintype.card_subtype_compl, Nat.add_sub_of_le (Fintype.card_subtype_le _)]
184184

185185
theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
@@ -246,57 +246,126 @@ noncomputable section norm
246246

247247
open scoped Classical
248248

249-
variable [NumberField K] {K}
249+
variable {K}
250+
251+
/-- The norm at the infinite place `w` of an element of
252+
`({w // IsReal w} → ℝ) × ({ w // IsComplex w } → ℂ)`. -/
253+
def normAtPlace (w : InfinitePlace K) : (E K) →*₀ ℝ where
254+
toFun x := if hw : IsReal w then ‖x.1 ⟨w, hw⟩‖ else ‖x.2 ⟨w, not_isReal_iff_isComplex.mp hw⟩‖
255+
map_zero' := by simp
256+
map_one' := by simp
257+
map_mul' x y := by split_ifs <;> simp
258+
259+
theorem normAtPlace_nonneg (w : InfinitePlace K) (x : E K) :
260+
0 ≤ normAtPlace w x := by
261+
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
262+
split_ifs <;> exact norm_nonneg _
263+
264+
theorem normAtPlace_neg (w : InfinitePlace K) (x : E K) :
265+
normAtPlace w (- x) = normAtPlace w x := by
266+
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
267+
split_ifs <;> simp
268+
269+
theorem normAtPlace_add_le (w : InfinitePlace K) (x y : E K) :
270+
normAtPlace w (x + y) ≤ normAtPlace w x + normAtPlace w y := by
271+
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
272+
split_ifs <;> exact norm_add_le _ _
273+
274+
theorem normAtPlace_smul (w : InfinitePlace K) (x : E K) (c : ℝ) :
275+
normAtPlace w (c • x) = |c| * normAtPlace w x := by
276+
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk]
277+
split_ifs
278+
· rw [Prod.smul_fst, Pi.smul_apply, norm_smul, Real.norm_eq_abs]
279+
· rw [Prod.smul_snd, Pi.smul_apply, norm_smul, Real.norm_eq_abs, Complex.norm_eq_abs]
280+
281+
theorem normAtPlace_real (w : InfinitePlace K) (c : ℝ) :
282+
normAtPlace w ((fun _ ↦ c, fun _ ↦ c) : (E K)) = |c| := by
283+
rw [show ((fun _ ↦ c, fun _ ↦ c) : (E K)) = c • 1 by ext <;> simp, normAtPlace_smul, map_one,
284+
mul_one]
285+
286+
theorem normAtPlace_apply_isReal {w : InfinitePlace K} (hw : IsReal w) (x : E K):
287+
normAtPlace w x = ‖x.1 ⟨w, hw⟩‖ := by
288+
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, dif_pos]
289+
290+
theorem normAtPlace_apply_isComplex {w : InfinitePlace K} (hw : IsComplex w) (x : E K) :
291+
normAtPlace w x = ‖x.2 ⟨w, hw⟩‖ := by
292+
rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk,
293+
dif_neg (not_isReal_iff_isComplex.mpr hw)]
294+
295+
@[simp]
296+
theorem normAtPlace_apply (w : InfinitePlace K) (x : K) :
297+
normAtPlace w (mixedEmbedding K x) = w x := by
298+
simp_rw [normAtPlace, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, mixedEmbedding,
299+
RingHom.prod_apply, Pi.ringHom_apply, norm_embedding_of_isReal, norm_embedding_eq, dite_eq_ite,
300+
ite_id]
301+
302+
theorem normAtPlace_eq_zero {x : E K} :
303+
(∀ w, normAtPlace w x = 0) ↔ x = 0 := by
304+
refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
305+
· ext w
306+
· exact norm_eq_zero'.mp (normAtPlace_apply_isReal w.prop _ ▸ h w.1)
307+
· exact norm_eq_zero'.mp (normAtPlace_apply_isComplex w.prop _ ▸ h w.1)
308+
· simp_rw [h, map_zero, implies_true]
309+
310+
variable [NumberField K]
311+
312+
theorem nnnorm_eq_sup_normAtPlace (x : E K) :
313+
‖x‖₊ = univ.sup fun w ↦ ⟨normAtPlace w x, normAtPlace_nonneg w x⟩ := by
314+
rw [show (univ : Finset (InfinitePlace K)) = (univ.image
315+
(fun w : {w : InfinitePlace K // IsReal w} ↦ w.1)) ∪
316+
(univ.image (fun w : {w : InfinitePlace K // IsComplex w} ↦ w.1))
317+
by ext; simp [isReal_or_isComplex], sup_union, univ.sup_image, univ.sup_image, sup_eq_max,
318+
Prod.nnnorm_def', Pi.nnnorm_def, Pi.nnnorm_def]
319+
congr
320+
· ext w
321+
simp [normAtPlace_apply_isReal w.prop]
322+
· ext w
323+
simp [normAtPlace_apply_isComplex w.prop]
324+
325+
theorem norm_eq_sup'_normAtPlace (x : E K) :
326+
‖x‖ = univ.sup' univ_nonempty fun w ↦ normAtPlace w x := by
327+
rw [← coe_nnnorm, nnnorm_eq_sup_normAtPlace, ← sup'_eq_sup univ_nonempty, ← NNReal.val_eq_coe,
328+
← OrderHom.Subtype.val_coe, map_finset_sup', OrderHom.Subtype.val_coe]
329+
rfl
250330

251-
/-- The norm of `x` is `∏ w real, ‖x‖_w * ∏ w complex, ‖x‖_w ^ 2`. It is defined such that
252-
the norm of `mixedEmbedding K a` for `a : K` is equal to the absolute value of the norm of `a`
253-
over `ℚ`, see `norm_eq_norm`. -/
331+
/-- The norm of `x` is `∏ w, (normAtPlace x) ^ mult w`. It is defined such that the norm of
332+
`mixedEmbedding K a` for `a : K` is equal to the absolute value of the norm of `a` over `ℚ`,
333+
see `norm_eq_norm`. -/
254334
protected def norm : (E K) →*₀ ℝ where
255-
toFun := fun x ↦ (∏ w, ‖x.1 w‖) * ∏ w, ‖x.2 w‖ ^ 2
256-
map_one' := by simp only [Prod.fst_one, Pi.one_apply, norm_one, Finset.prod_const_one,
257-
Prod.snd_one, one_pow, mul_one]
258-
map_zero' := by
259-
simp_rw [Prod.fst_zero, Prod.snd_zero, Pi.zero_apply, norm_zero, zero_pow (two_ne_zero),
260-
mul_eq_zero, Finset.prod_const, pow_eq_zero_iff', true_and, Finset.card_univ]
261-
by_contra!
262-
have : finrank ℚ K = 0 := by
263-
rw [← card_add_two_mul_card_eq_rank, NrRealPlaces, NrComplexPlaces, this.1, this.2]
264-
exact ne_of_gt finrank_pos this
265-
map_mul' _ _ := by simp only [Prod.fst_mul, Pi.mul_apply, norm_mul, Real.norm_eq_abs,
266-
Finset.prod_mul_distrib, Prod.snd_mul, Complex.norm_eq_abs, mul_pow]; ring
335+
toFun x := ∏ w, (normAtPlace w x) ^ (mult w)
336+
map_one' := by simp only [map_one, one_pow, prod_const_one]
337+
map_zero' := by simp [mult]
338+
map_mul' _ _ := by simp only [map_mul, mul_pow, prod_mul_distrib]
339+
340+
protected theorem norm_apply (x : E K) :
341+
mixedEmbedding.norm x = ∏ w, (normAtPlace w x) ^ (mult w) := rfl
342+
343+
protected theorem norm_nonneg (x : E K) :
344+
0 ≤ mixedEmbedding.norm x := univ.prod_nonneg fun _ _ ↦ pow_nonneg (normAtPlace_nonneg _ _) _
267345

268346
protected theorem norm_eq_zero_iff {x : E K} :
269-
mixedEmbedding.norm x = 0(∃ w, x.1 w = 0) ∨ (∃ w, x.2 w = 0) := by
270-
simp_rw [mixedEmbedding.norm, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, mul_eq_zero,
271-
Finset.prod_eq_zero_iff, Finset.mem_univ, true_and, pow_eq_zero_iff two_ne_zero, norm_eq_zero]
347+
mixedEmbedding.norm x = 0 ↔ ∃ w, normAtPlace w x = 0 := by
348+
simp_rw [mixedEmbedding.norm, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, prod_eq_zero_iff,
349+
mem_univ, true_and, pow_eq_zero_iff mult_ne_zero]
272350

273351
protected theorem norm_ne_zero_iff {x : E K} :
274-
mixedEmbedding.norm x ≠ 0(∀ w, x.1 w 0) ∧ (∀ w, x.2 w 0) := by
352+
mixedEmbedding.norm x ≠ 0 ↔ ∀ w, normAtPlace w x 0 := by
275353
rw [← not_iff_not]
276-
simp_rw [ne_eq, mixedEmbedding.norm_eq_zero_iff, not_and_or, not_forall, not_not]
277-
278-
theorem norm_real (c : ℝ) :
279-
mixedEmbedding.norm ((fun _ ↦ c, fun _ ↦ c) : (E K)) = |c| ^ finrank ℚ K := by
280-
simp_rw [mixedEmbedding.norm, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, Real.norm_eq_abs,
281-
Complex.norm_eq_abs, Complex.abs_ofReal, Finset.prod_const, ← pow_mul,
282-
← card_add_two_mul_card_eq_rank, Finset.card_univ, pow_add]
354+
simp_rw [ne_eq, mixedEmbedding.norm_eq_zero_iff, not_not, not_forall, not_not]
283355

284356
theorem norm_smul (c : ℝ) (x : E K) :
285357
mixedEmbedding.norm (c • x) = |c| ^ finrank ℚ K * (mixedEmbedding.norm x) := by
286-
rw [show c • x = ((fun _ ↦ c, fun _ ↦ c) : (E K)) * x by rfl, map_mul, norm_real]
358+
simp_rw [mixedEmbedding.norm_apply, normAtPlace_smul, mul_pow, prod_mul_distrib,
359+
prod_pow_eq_pow_sum, sum_mult_eq]
360+
361+
theorem norm_real (c : ℝ) :
362+
mixedEmbedding.norm ((fun _ ↦ c, fun _ ↦ c) : (E K)) = |c| ^ finrank ℚ K := by
363+
rw [show ((fun _ ↦ c, fun _ ↦ c) : (E K)) = c • 1 by ext <;> simp, norm_smul, map_one, mul_one]
287364

288365
@[simp]
289366
theorem norm_eq_norm (x : K) :
290367
mixedEmbedding.norm (mixedEmbedding K x) = |Algebra.norm ℚ x| := by
291-
simp_rw [← prod_eq_abs_norm, mixedEmbedding.norm, mixedEmbedding, RingHom.prod_apply,
292-
MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, Pi.ringHom_apply, norm_embedding_eq,
293-
norm_embedding_of_isReal]
294-
rw [← Fintype.prod_subtype_mul_prod_subtype (fun w : InfinitePlace K ↦ IsReal w)]
295-
congr 1
296-
· exact Finset.prod_congr rfl (fun w _ ↦ by rw [mult, if_pos w.prop, pow_one])
297-
· refine (Fintype.prod_equiv (Equiv.subtypeEquivRight ?_) _ _ (fun w ↦ ?_)).symm
298-
· exact fun _ ↦ not_isReal_iff_isComplex
299-
· rw [Equiv.subtypeEquivRight_apply_coe, mult, if_neg w.prop]
368+
simp_rw [mixedEmbedding.norm_apply, normAtPlace_apply, prod_eq_abs_norm]
300369

301370
theorem norm_eq_zero_iff' {x : E K} (hx : x ∈ Set.range (mixedEmbedding K)) :
302371
mixedEmbedding.norm x = 0 ↔ x = 0 := by
@@ -310,8 +379,7 @@ noncomputable section stdBasis
310379

311380
open scoped Classical
312381

313-
open Complex MeasureTheory MeasureTheory.Measure Zspan Matrix BigOperators
314-
ComplexConjugate
382+
open Complex MeasureTheory MeasureTheory.Measure Zspan Matrix BigOperators Finset ComplexConjugate
315383

316384
variable [NumberField K]
317385

@@ -352,8 +420,7 @@ theorem volume_fundamentalDomain_stdBasis :
352420
volume (fundamentalDomain (stdBasis K)) = 1 := by
353421
rw [fundamentalDomain_stdBasis, volume_eq_prod, prod_prod, volume_pi, volume_pi, pi_pi, pi_pi,
354422
Complex.volume_preserving_equiv_pi.measure_preimage ?_, volume_pi, pi_pi, Real.volume_Ico,
355-
sub_zero, ENNReal.ofReal_one, Finset.prod_const_one, Finset.prod_const_one,
356-
Finset.prod_const_one, one_mul]
423+
sub_zero, ENNReal.ofReal_one, prod_const_one, prod_const_one, prod_const_one, one_mul]
357424
exact MeasurableSet.pi Set.countable_univ (fun _ _ => measurableSet_Ico)
358425

359426
/-- The `Equiv` between `index K` and `K →+* ℂ` defined by sending a real infinite place `w` to
@@ -403,13 +470,13 @@ theorem det_matrixToStdBasis :
403470
(matrixToStdBasis K).det = (2⁻¹ * I) ^ NrComplexPlaces K :=
404471
calc
405472
_ = ∏ _k : { w : InfinitePlace K // IsComplex w }, det ((2 : ℂ)⁻¹ • !![1, 1; -I, I]) := by
406-
rw [matrixToStdBasis, det_fromBlocks_zero₂₁, det_diagonal, Finset.prod_const_one, one_mul,
473+
rw [matrixToStdBasis, det_fromBlocks_zero₂₁, det_diagonal, prod_const_one, one_mul,
407474
det_reindex_self, det_blockDiagonal]
408475
_ = ∏ _k : { w : InfinitePlace K // IsComplex w }, (2⁻¹ * Complex.I) := by
409-
refine Finset.prod_congr (Eq.refl _) (fun _ _ => ?_)
476+
refine prod_congr (Eq.refl _) (fun _ _ => ?_)
410477
field_simp; ring
411478
_ = (2⁻¹ * Complex.I) ^ Fintype.card {w : InfinitePlace K // IsComplex w} := by
412-
rw [Finset.prod_const, Fintype.card]
479+
rw [prod_const, Fintype.card]
413480

414481
/-- Let `x : (K →+* ℂ) → ℂ` such that `x_φ = conj x_(conj φ)` for all `φ : K →+* ℂ`, then the
415482
representation of `commMap K x` on `stdBasis` is given (up to reindexing) by the product of
@@ -420,32 +487,30 @@ theorem stdBasis_repr_eq_matrixToStdBasis_mul (x : (K →+* ℂ) → ℂ)
420487
(matrixToStdBasis K *ᵥ (x ∘ (indexEquiv K))) c := by
421488
simp_rw [commMap, matrixToStdBasis, LinearMap.coe_mk, AddHom.coe_mk,
422489
mulVec, dotProduct, Function.comp_apply, index, Fintype.sum_sum_type,
423-
diagonal_one, reindex_apply, ← Finset.univ_product_univ, Finset.sum_product,
490+
diagonal_one, reindex_apply, ← univ_product_univ, sum_product,
424491
indexEquiv_apply_ofIsReal, Fin.sum_univ_two, indexEquiv_apply_ofIsComplex_fst,
425492
indexEquiv_apply_ofIsComplex_snd, smul_of, smul_cons, smul_eq_mul,
426-
mul_one, smul_empty, Equiv.prodComm_symm, Equiv.coe_prodComm]
493+
mul_one, Matrix.smul_empty, Equiv.prodComm_symm, Equiv.coe_prodComm]
427494
cases c with
428495
| inl w =>
429496
simp_rw [stdBasis_apply_ofIsReal, fromBlocks_apply₁₁, fromBlocks_apply₁₂,
430-
one_apply, Matrix.zero_apply, ite_mul, one_mul, zero_mul, Finset.sum_ite_eq,
431-
Finset.mem_univ, ite_true, add_zero, Finset.sum_const_zero, add_zero,
432-
← conj_eq_iff_re, hx (embedding w.val), conjugate_embedding_eq_of_isReal w.prop]
497+
one_apply, Matrix.zero_apply, ite_mul, one_mul, zero_mul, sum_ite_eq, mem_univ, ite_true,
498+
add_zero, sum_const_zero, add_zero, ← conj_eq_iff_re, hx (embedding w.val),
499+
conjugate_embedding_eq_of_isReal w.prop]
433500
| inr c =>
434501
rcases c with ⟨w, j⟩
435502
fin_cases j
436503
· simp_rw [Fin.mk_zero, stdBasis_apply_ofIsComplex_fst, fromBlocks_apply₂₁,
437504
fromBlocks_apply₂₂, Matrix.zero_apply, submatrix_apply,
438-
blockDiagonal_apply, Prod.swap_prod_mk, ite_mul, zero_mul, Finset.sum_const_zero,
439-
zero_add, Finset.sum_add_distrib, Finset.sum_ite_eq, Finset.mem_univ, ite_true,
440-
of_apply, cons_val', cons_val_zero, cons_val_one,
441-
head_cons, ← hx (embedding w), re_eq_add_conj]
505+
blockDiagonal_apply, Prod.swap_prod_mk, ite_mul, zero_mul, sum_const_zero, zero_add,
506+
sum_add_distrib, sum_ite_eq, mem_univ, ite_true, of_apply, cons_val', cons_val_zero,
507+
cons_val_one, head_cons, ← hx (embedding w), re_eq_add_conj]
442508
field_simp
443509
· simp_rw [Fin.mk_one, stdBasis_apply_ofIsComplex_snd, fromBlocks_apply₂₁,
444-
fromBlocks_apply₂₂, Matrix.zero_apply, submatrix_apply,
445-
blockDiagonal_apply, Prod.swap_prod_mk, ite_mul, zero_mul, Finset.sum_const_zero,
446-
zero_add, Finset.sum_add_distrib, Finset.sum_ite_eq, Finset.mem_univ, ite_true,
447-
of_apply, cons_val', cons_val_zero, cons_val_one,
448-
head_cons, ← hx (embedding w), im_eq_sub_conj]
510+
fromBlocks_apply₂₂, Matrix.zero_apply, submatrix_apply, blockDiagonal_apply,
511+
Prod.swap_prod_mk, ite_mul, zero_mul, sum_const_zero, zero_add, sum_add_distrib, sum_ite_eq,
512+
mem_univ, ite_true, of_apply, cons_val', cons_val_zero, cons_val_one, head_cons,
513+
← hx (embedding w), im_eq_sub_conj]
449514
ring_nf; field_simp
450515

451516
end stdBasis
@@ -471,8 +536,8 @@ def latticeBasis :
471536
-- and it's a basis since it has the right cardinality
472537
refine basisOfLinearIndependentOfCardEqFinrank this ?_
473538
rw [← finrank_eq_card_chooseBasisIndex, RingOfIntegers.rank, finrank_prod, finrank_pi,
474-
finrank_pi_fintype, Complex.finrank_real_complex, Finset.sum_const, Finset.card_univ,
475-
NrRealPlaces, ← NrComplexPlaces, ← card_real_embeddings, Algebra.id.smul_eq_mul, mul_comm,
539+
finrank_pi_fintype, Complex.finrank_real_complex, sum_const, card_univ, ← NrRealPlaces,
540+
← NrComplexPlaces, ← card_real_embeddings, Algebra.id.smul_eq_mul, mul_comm,
476541
← card_complex_embeddings, ← NumberField.Embeddings.card K ℂ, Fintype.card_subtype_compl,
477542
Nat.add_sub_of_le (Fintype.card_subtype_le _)]
478543

0 commit comments

Comments
 (0)