Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit a232366

Browse files
committed
feat(analysis/inner_product_space/projection): orthonormal basis subordinate to an orthogonal_family (#10208)
In a finite-dimensional inner product space of `E`, there exists an orthonormal basis subordinate to a given direct sum decomposition into an `orthogonal_family` of subspaces `E`.
1 parent 8bb0b6f commit a232366

File tree

4 files changed

+133
-10
lines changed

4 files changed

+133
-10
lines changed

src/algebra/direct_sum/module.lean

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,35 @@ lemma submodule_is_internal.independent (h : submodule_is_internal A) :
236236
complete_lattice.independent A :=
237237
complete_lattice.independent_of_dfinsupp_lsum_injective _ h.injective
238238

239+
/-- Given an internal direct sum decomposition of a module `M`, and a basis for each of the
240+
components of the direct sum, the disjoint union of these bases is a basis for `M`. -/
241+
noncomputable def submodule_is_internal.collected_basis
242+
(h : submodule_is_internal A) {α : ι → Type*} (v : Π i, basis (α i) R (A i)) :
243+
basis (Σ i, α i) R M :=
244+
{ repr := (linear_equiv.of_bijective _ h.injective h.surjective).symm ≪≫ₗ
245+
(dfinsupp.map_range.linear_equiv (λ i, (v i).repr)) ≪≫ₗ
246+
(sigma_finsupp_lequiv_dfinsupp R).symm }
247+
248+
@[simp] lemma submodule_is_internal.collected_basis_coe
249+
(h : submodule_is_internal A) {α : ι → Type*} (v : Π i, basis (α i) R (A i)) :
250+
⇑(h.collected_basis v) = λ a : Σ i, (α i), ↑(v a.1 a.2) :=
251+
begin
252+
funext a,
253+
simp only [submodule_is_internal.collected_basis, to_module, submodule_coe,
254+
add_equiv.to_fun_eq_coe, basis.coe_of_repr, basis.repr_symm_apply, dfinsupp.lsum_apply_apply,
255+
dfinsupp.map_range.linear_equiv_apply, dfinsupp.map_range.linear_equiv_symm,
256+
dfinsupp.map_range_single, finsupp.total_single, linear_equiv.of_bijective_apply,
257+
linear_equiv.symm_symm, linear_equiv.symm_trans_apply, one_smul,
258+
sigma_finsupp_add_equiv_dfinsupp_apply, sigma_finsupp_equiv_dfinsupp_single,
259+
sigma_finsupp_lequiv_dfinsupp_apply],
260+
convert dfinsupp.sum_add_hom_single (λ i, (A i).subtype.to_add_monoid_hom) a.1 (v a.1 a.2),
261+
end
262+
263+
lemma submodule_is_internal.collected_basis_mem
264+
(h : submodule_is_internal A) {α : ι → Type*} (v : Π i, basis (α i) R (A i)) (a : Σ i, α i) :
265+
h.collected_basis v a ∈ A a.1 :=
266+
by simp
267+
239268
end semiring
240269

241270
section ring

src/analysis/inner_product_space/basic.lean

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ instance submodule.inner_product_space (W : submodule 𝕜 E) : inner_product_sp
14941494
/-! ### Families of mutually-orthogonal subspaces of an inner product space -/
14951495

14961496
section orthogonal_family
1497-
variables {ι : Type*} (𝕜)
1497+
variables {ι : Type*} [dec_ι : decidable_eq ι] (𝕜)
14981498
open_locale direct_sum
14991499

15001500
/-- An indexed family of mutually-orthogonal subspaces of an inner product space `E`. -/
@@ -1503,6 +1503,7 @@ def orthogonal_family (V : ι → submodule 𝕜 E) : Prop :=
15031503

15041504
variables {𝕜} {V : ι → submodule 𝕜 E}
15051505

1506+
include dec_ι
15061507
lemma orthogonal_family.eq_ite (hV : orthogonal_family 𝕜 V) {i j : ι} (v : V i) (w : V j) :
15071508
⟪(v:E), w⟫ = ite (i = j) ⟪(v:E), w⟫ 0 :=
15081509
begin
@@ -1535,6 +1536,7 @@ begin
15351536
intros h,
15361537
simp [h]
15371538
end
1539+
omit dec_ι
15381540

15391541
lemma orthogonal_family.inner_right_fintype
15401542
[fintype ι] (hV : orthogonal_family 𝕜 V) (l : Π i, V i) (i : ι) (v : V i) :
@@ -1570,6 +1572,29 @@ lemma orthogonal_family.comp (hV : orthogonal_family 𝕜 V) {γ : Type*} {f :
15701572
orthogonal_family 𝕜 (V ∘ f) :=
15711573
λ i j hij v hv w hw, hV (hf.ne hij) hv hw
15721574

1575+
lemma orthogonal_family.orthonormal_sigma_orthonormal (hV : orthogonal_family 𝕜 V) {α : ι → Type*}
1576+
{v_family : Π i, (α i) → V i} (hv_family : ∀ i, orthonormal 𝕜 (v_family i)) :
1577+
orthonormal 𝕜 (λ a : Σ i, α i, (v_family a.1 a.2 : E)) :=
1578+
begin
1579+
split,
1580+
{ rintros ⟨i, vi⟩,
1581+
exact (hv_family i).1 vi },
1582+
rintros ⟨i, vi⟩ ⟨j, vj⟩ hvij,
1583+
by_cases hij : i = j,
1584+
{ subst hij,
1585+
have : vi ≠ vj := by simpa using hvij,
1586+
exact (hv_family i).2 this },
1587+
{ exact hV hij (v_family i vi : V i).prop (v_family j vj : V j).prop }
1588+
end
1589+
1590+
include dec_ι
1591+
lemma direct_sum.submodule_is_internal.collected_basis_orthonormal (hV : orthogonal_family 𝕜 V)
1592+
(hV_sum : direct_sum.submodule_is_internal V) {α : ι → Type*}
1593+
{v_family : Π i, basis (α i) 𝕜 (V i)} (hv_family : ∀ i, orthonormal 𝕜 (v_family i)) :
1594+
orthonormal 𝕜 (hV_sum.collected_basis v_family) :=
1595+
by simpa using hV.orthonormal_sigma_orthonormal hv_family
1596+
omit dec_ι
1597+
15731598
end orthogonal_family
15741599

15751600
section is_R_or_C_to_real

src/analysis/inner_product_space/projection.lean

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -974,10 +974,14 @@ let ⟨u, hus, hu, hu_max⟩ := exists_subset_is_orthonormal_dense_span (orthono
974974
⟨u, hu, hu_max⟩
975975
variables {𝕜 E}
976976

977+
section finite_dimensional
978+
979+
variables [finite_dimensional 𝕜 E]
980+
977981
/-- An orthonormal set in a finite-dimensional `inner_product_space` is maximal, if and only if it
978982
is a basis. -/
979983
lemma maximal_orthonormal_iff_basis_of_finite_dimensional
980-
[finite_dimensional 𝕜 E] (hv : orthonormal 𝕜 (coe : v → E)) :
984+
(hv : orthonormal 𝕜 (coe : v → E)) :
981985
(∀ u ⊇ v, orthonormal 𝕜 (coe : u → E) → u = v) ↔ ∃ b : basis v 𝕜 E, ⇑b = coe :=
982986
begin
983987
rw maximal_orthonormal_iff_orthogonal_complement_eq_bot hv,
@@ -994,7 +998,7 @@ end
994998
/-- In a finite-dimensional `inner_product_space`, any orthonormal subset can be extended to an
995999
orthonormal basis. -/
9961000
lemma exists_subset_is_orthonormal_basis
997-
[finite_dimensional 𝕜 E] (hv : orthonormal 𝕜 (coe : v → E)) :
1001+
(hv : orthonormal 𝕜 (coe : v → E)) :
9981002
∃ (u ⊇ v) (b : basis u 𝕜 E), orthonormal 𝕜 b ∧ ⇑b = coe :=
9991003
begin
10001004
obtain ⟨u, hus, hu, hu_max⟩ := exists_maximal_orthonormal hv,
@@ -1005,39 +1009,89 @@ end
10051009
variables (𝕜 E)
10061010

10071011
/-- Index for an arbitrary orthonormal basis on a finite-dimensional `inner_product_space`. -/
1008-
def orthonormal_basis_index [finite_dimensional 𝕜 E] : set E :=
1012+
def orthonormal_basis_index : set E :=
10091013
classical.some (exists_subset_is_orthonormal_basis (orthonormal_empty 𝕜 E))
10101014

10111015
/-- A finite-dimensional `inner_product_space` has an orthonormal basis. -/
1012-
def orthonormal_basis [finite_dimensional 𝕜 E] :
1016+
def orthonormal_basis :
10131017
basis (orthonormal_basis_index 𝕜 E) 𝕜 E :=
10141018
(exists_subset_is_orthonormal_basis (orthonormal_empty 𝕜 E)).some_spec.some_spec.some
10151019

1016-
lemma orthonormal_basis_orthonormal [finite_dimensional 𝕜 E] :
1020+
lemma orthonormal_basis_orthonormal :
10171021
orthonormal 𝕜 (orthonormal_basis 𝕜 E) :=
10181022
(exists_subset_is_orthonormal_basis (orthonormal_empty 𝕜 E)).some_spec.some_spec.some_spec.1
10191023

1020-
@[simp] lemma coe_orthonormal_basis [finite_dimensional 𝕜 E] :
1024+
@[simp] lemma coe_orthonormal_basis :
10211025
⇑(orthonormal_basis 𝕜 E) = coe :=
10221026
(exists_subset_is_orthonormal_basis (orthonormal_empty 𝕜 E)).some_spec.some_spec.some_spec.2
10231027

1024-
instance [finite_dimensional 𝕜 E] : fintype (orthonormal_basis_index 𝕜 E) :=
1028+
instance : fintype (orthonormal_basis_index 𝕜 E) :=
10251029
@is_noetherian.fintype_basis_index _ _ _ _ _ _ _
10261030
(is_noetherian.iff_fg.2 infer_instance) (orthonormal_basis 𝕜 E)
10271031

10281032
variables {𝕜 E}
10291033

10301034
/-- An `n`-dimensional `inner_product_space` has an orthonormal basis indexed by `fin n`. -/
1031-
def fin_orthonormal_basis [finite_dimensional 𝕜 E] {n : ℕ} (hn : finrank 𝕜 E = n) :
1035+
def fin_orthonormal_basis {n : ℕ} (hn : finrank 𝕜 E = n) :
10321036
basis (fin n) 𝕜 E :=
10331037
have h : fintype.card (orthonormal_basis_index 𝕜 E) = n,
10341038
by rw [← finrank_eq_card_basis (orthonormal_basis 𝕜 E), hn],
10351039
(orthonormal_basis 𝕜 E).reindex (fintype.equiv_fin_of_card_eq h)
10361040

1037-
lemma fin_orthonormal_basis_orthonormal [finite_dimensional 𝕜 E] {n : ℕ} (hn : finrank 𝕜 E = n) :
1041+
lemma fin_orthonormal_basis_orthonormal {n : ℕ} (hn : finrank 𝕜 E = n) :
10381042
orthonormal 𝕜 (fin_orthonormal_basis hn) :=
10391043
suffices orthonormal 𝕜 (orthonormal_basis _ _ ∘ equiv.symm _),
10401044
by { simp only [fin_orthonormal_basis, basis.coe_reindex], assumption }, -- why doesn't simpa work?
10411045
(orthonormal_basis_orthonormal 𝕜 E).comp _ (equiv.injective _)
10421046

1047+
section subordinate_orthonormal_basis
1048+
open direct_sum
1049+
variables {n : ℕ} (hn : finrank 𝕜 E = n) {ι : Type*} [fintype ι] [decidable_eq ι]
1050+
{V : ι → submodule 𝕜 E} (hV : submodule_is_internal V)
1051+
1052+
/-- Exhibit a bijection between `fin n` and the index set of a certain basis of an `n`-dimensional
1053+
inner product space `E`. This should not be accessed directly, but only via the subsequent API. -/
1054+
@[irreducible] def direct_sum.submodule_is_internal.sigma_orthonormal_basis_index_equiv :
1055+
(Σ i, orthonormal_basis_index 𝕜 (V i)) ≃ fin n :=
1056+
let b := hV.collected_basis (λ i, orthonormal_basis 𝕜 (V i)) in
1057+
fintype.equiv_fin_of_card_eq $ (finite_dimensional.finrank_eq_card_basis b).symm.trans hn
1058+
1059+
/-- An `n`-dimensional `inner_product_space` equipped with a decomposition as an internal direct
1060+
sum has an orthonormal basis indexed by `fin n` and subordinate to that direct sum. -/
1061+
@[irreducible] def direct_sum.submodule_is_internal.subordinate_orthonormal_basis :
1062+
basis (fin n) 𝕜 E :=
1063+
(hV.collected_basis (λ i, orthonormal_basis 𝕜 (V i))).reindex
1064+
(hV.sigma_orthonormal_basis_index_equiv hn)
1065+
1066+
/-- An `n`-dimensional `inner_product_space` equipped with a decomposition as an internal direct
1067+
sum has an orthonormal basis indexed by `fin n` and subordinate to that direct sum. This function
1068+
provides the mapping by which it is subordinate. -/
1069+
def direct_sum.submodule_is_internal.subordinate_orthonormal_basis_index (a : fin n) : ι :=
1070+
((hV.sigma_orthonormal_basis_index_equiv hn).symm a).1
1071+
1072+
/-- The basis constructed in `orthogonal_family.subordinate_orthonormal_basis` is orthonormal. -/
1073+
lemma direct_sum.submodule_is_internal.subordinate_orthonormal_basis_orthonormal
1074+
(hV' : orthogonal_family 𝕜 V) :
1075+
orthonormal 𝕜 (hV.subordinate_orthonormal_basis hn) :=
1076+
begin
1077+
simp only [direct_sum.submodule_is_internal.subordinate_orthonormal_basis, basis.coe_reindex],
1078+
have : orthonormal 𝕜 (hV.collected_basis (λ i, orthonormal_basis 𝕜 (V i))) :=
1079+
hV.collected_basis_orthonormal hV' (λ i, orthonormal_basis_orthonormal 𝕜 (V i)),
1080+
exact this.comp _ (equiv.injective _),
1081+
end
1082+
1083+
/-- The basis constructed in `orthogonal_family.subordinate_orthonormal_basis` is subordinate to
1084+
the `orthogonal_family` in question. -/
1085+
lemma direct_sum.submodule_is_internal.subordinate_orthonormal_basis_subordinate (a : fin n) :
1086+
hV.subordinate_orthonormal_basis hn a ∈ V (hV.subordinate_orthonormal_basis_index hn a) :=
1087+
by simpa only [direct_sum.submodule_is_internal.subordinate_orthonormal_basis, basis.coe_reindex]
1088+
using hV.collected_basis_mem (λ i, orthonormal_basis 𝕜 (V i))
1089+
((hV.sigma_orthonormal_basis_index_equiv hn).symm a)
1090+
1091+
attribute [irreducible] direct_sum.submodule_is_internal.subordinate_orthonormal_basis_index
1092+
1093+
end subordinate_orthonormal_basis
1094+
1095+
end finite_dimensional
1096+
10431097
end orthonormal_basis

src/data/finsupp/to_dfinsupp.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,21 @@ begin
238238
exact (finsupp.mem_split_support_iff_nonzero _ _).symm,
239239
end
240240

241+
@[simp] lemma sigma_finsupp_equiv_dfinsupp_single [has_zero N] (a : Σ i, η i) (n : N) :
242+
sigma_finsupp_equiv_dfinsupp (finsupp.single a n)
243+
= @dfinsupp.single _ (λ i, η i →₀ N) _ _ a.1 (finsupp.single a.2 n) :=
244+
begin
245+
obtain ⟨i, a⟩ := a,
246+
ext j b,
247+
by_cases h : i = j,
248+
{ subst h,
249+
simp [split_apply, finsupp.single_apply] },
250+
suffices : finsupp.single (⟨i, a⟩ : Σ i, η i) n ⟨j, b⟩ = 0,
251+
{ simp [split_apply, dif_neg h, this] },
252+
have H : (⟨i, a⟩ : Σ i, η i) ≠ ⟨j, b⟩ := by simp [h],
253+
rw [finsupp.single_apply, if_neg H]
254+
end
255+
241256
-- Without this Lean fails to find the `add_zero_class` instance on `Π₀ i, (η i →₀ N)`.
242257
local attribute [-instance] finsupp.has_zero
243258

0 commit comments

Comments
 (0)