From 567220c269ba1ca5895871a9356fb1239858d3b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C3=ABl=20Dillies?= Date: Sat, 1 Oct 2022 18:32:35 +0000 Subject: [PATCH] refactor(analysis/inner_product_space/pi_L2): Delete `orthonormal_basis_index` (#16698) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `std_orthonormal_basis` was indexed by `orthonormal_basis_index` while it can simply be indexed by `fin (finrank ๐•œ E)`. As a result, `fin_std_orthonormal_basis` becomes a trivial reindexation of `std_orthonormal_basis` so we delete it. --- .../inner_product_space/orientation.lean | 4 +-- src/analysis/inner_product_space/pi_L2.lean | 33 +++++++------------ 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src/analysis/inner_product_space/orientation.lean b/src/analysis/inner_product_space/orientation.lean index cdc5569c7e729..f83291043780d 100644 --- a/src/analysis/inner_product_space/orientation.lean +++ b/src/analysis/inner_product_space/orientation.lean @@ -70,7 +70,7 @@ protected def orientation.fin_orthonormal_basis {n : โ„•} (hn : 0 < n) (h : finr begin haveI := fin.pos_iff_nonempty.1 hn, haveI := finite_dimensional_of_finrank (h.symm โ–ธ hn : 0 < finrank โ„ E), - exact (fin_std_orthonormal_basis h).adjust_to_orientation x + exact ((std_orthonormal_basis _ _).reindex $ fin_congr h).adjust_to_orientation x end /-- `orientation.fin_orthonormal_basis` gives a basis with the required orientation. -/ @@ -80,5 +80,5 @@ end begin haveI := fin.pos_iff_nonempty.1 hn, haveI := finite_dimensional_of_finrank (h.symm โ–ธ hn : 0 < finrank โ„ E), - exact (fin_std_orthonormal_basis h).orientation_adjust_to_orientation x + exact ((std_orthonormal_basis _ _).reindex $ fin_congr h).orientation_adjust_to_orientation x end diff --git a/src/analysis/inner_product_space/pi_L2.lean b/src/analysis/inner_product_space/pi_L2.lean index 5cd0a253847e5..2ddd494dd1e6c 100644 --- a/src/analysis/inner_product_space/pi_L2.lean +++ b/src/analysis/inner_product_space/pi_L2.lean @@ -632,25 +632,16 @@ lemma _root_.exists_orthonormal_basis : let โŸจw, hw, hw', hw''โŸฉ := (orthonormal_empty ๐•œ E).exists_orthonormal_basis_extension in โŸจw, hw, hw''โŸฉ -/-- Index for an arbitrary orthonormal basis on a finite-dimensional `inner_product_space`. -/ -def orthonormal_basis_index : finset E := -classical.some (exists_orthonormal_basis ๐•œ E) - /-- A finite-dimensional `inner_product_space` has an orthonormal basis. -/ -def std_orthonormal_basis : orthonormal_basis (orthonormal_basis_index ๐•œ E) ๐•œ E := -classical.some (classical.some_spec (exists_orthonormal_basis ๐•œ E)) - -@[simp] lemma coe_std_orthonormal_basis : โ‡‘(std_orthonormal_basis ๐•œ E) = coe := -classical.some_spec (classical.some_spec (exists_orthonormal_basis ๐•œ E)) +def std_orthonormal_basis : orthonormal_basis (fin (finrank ๐•œ E)) ๐•œ E := +begin + let b := classical.some (classical.some_spec $ exists_orthonormal_basis ๐•œ E), + rw [finrank_eq_card_basis b.to_basis], + exact b.reindex (fintype.equiv_fin_of_card_eq rfl), +end variables {๐•œ E} -/-- An `n`-dimensional `inner_product_space` has an orthonormal basis indexed by `fin n`. -/ -def fin_std_orthonormal_basis {n : โ„•} (hn : finrank ๐•œ E = n) : orthonormal_basis (fin n) ๐•œ E := -have h : fintype.card (orthonormal_basis_index ๐•œ E) = n, -by rw [โ† finrank_eq_card_basis (std_orthonormal_basis ๐•œ E).to_basis, hn], -(std_orthonormal_basis ๐•œ E).reindex (fintype.equiv_fin_of_card_eq h) - section subordinate_orthonormal_basis open direct_sum variables {n : โ„•} (hn : finrank ๐•œ E = n) [decidable_eq ฮน] @@ -660,7 +651,7 @@ variables {n : โ„•} (hn : finrank ๐•œ E = n) [decidable_eq ฮน] inner product space `E`. This should not be accessed directly, but only via the subsequent API. -/ @[irreducible] def direct_sum.is_internal.sigma_orthonormal_basis_index_equiv (hV' : @orthogonal_family ๐•œ _ _ _ _ (ฮป i, V i) _ (ฮป i, (V i).subtypeโ‚—แตข)) : - (ฮฃ i, orthonormal_basis_index ๐•œ (V i)) โ‰ƒ fin n := + (ฮฃ i, fin (finrank ๐•œ (V i))) โ‰ƒ fin n := let b := hV.collected_orthonormal_basis hV' (ฮป i, (std_orthonormal_basis ๐•œ (V i))) in fintype.equiv_fin_of_card_eq $ (finite_dimensional.finrank_eq_card_basis b.to_basis).symm.trans hn @@ -704,7 +695,7 @@ space, there exists an isometry from the orthogonal complement of a nonzero sing def orthonormal_basis.from_orthogonal_span_singleton (n : โ„•) [fact (finrank ๐•œ E = n + 1)] {v : E} (hv : v โ‰  0) : orthonormal_basis (fin n) ๐•œ (๐•œ โˆ™ v)แ—ฎ := -(fin_std_orthonormal_basis (finrank_orthogonal_span_singleton hv)) +(std_orthonormal_basis _ _).reindex $ fin_congr $ finrank_orthogonal_span_singleton hv section linear_isometry @@ -731,11 +722,9 @@ begin ... = finrank ๐•œ V - finrank ๐•œ S : by simp only [linear_map.finrank_range_of_inj L.injective] ... = finrank ๐•œ Sแ—ฎ : by simp only - [โ† S.finrank_add_finrank_orthogonal, add_tsub_cancel_left] - ... = d : dim_S_perp, - let BS := (fin_std_orthonormal_basis dim_S_perp), - let BLS := (fin_std_orthonormal_basis dim_LS_perp), - exact BS.repr.trans BLS.repr.symm }, + [โ† S.finrank_add_finrank_orthogonal, add_tsub_cancel_left], + exact (std_orthonormal_basis ๐•œ Sแ—ฎ).repr.trans + ((std_orthonormal_basis ๐•œ LSแ—ฎ).reindex $ fin_congr dim_LS_perp).repr.symm }, let L3 := (LS)แ—ฎ.subtypeโ‚—แตข.comp E.to_linear_isometry, -- Project onto S and Sแ—ฎ haveI : complete_space S := finite_dimensional.complete ๐•œ S,