Skip to content

Commit

Permalink
chore(InnerProductSpace/Basic): drop some DecidableEq assumptions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
urkud committed Feb 6, 2024
1 parent 7184374 commit 7ab6068
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions Mathlib/Analysis/InnerProductSpace/Basic.lean
Expand Up @@ -419,8 +419,6 @@ variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E]

variable [NormedAddCommGroup F] [InnerProductSpace ℝ F]

variable [dec_E : DecidableEq E]

local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y

local notation "IK" => @IsROrC.I 𝕜 _
Expand Down Expand Up @@ -536,13 +534,13 @@ theorem Finsupp.inner_sum {ι : Type*} (l : ι →₀ 𝕜) (v : ι → E) (x :
simp only [inner_smul_right, Finsupp.sum, smul_eq_mul]
#align finsupp.inner_sum Finsupp.inner_sum

theorem DFinsupp.sum_inner {ι : Type*} [dec : DecidableEq ι] {α : ι → Type*}
theorem DFinsupp.sum_inner {ι : Type*} [DecidableEq ι] {α : ι → Type*}
[∀ i, AddZeroClass (α i)] [∀ (i) (x : α i), Decidable (x ≠ 0)] (f : ∀ i, α i → E)
(l : Π₀ i, α i) (x : E) : ⟪l.sum f, x⟫ = l.sum fun i a => ⟪f i a, x⟫ := by
simp (config := { contextual := true }) only [DFinsupp.sum, _root_.sum_inner, smul_eq_mul]
#align dfinsupp.sum_inner DFinsupp.sum_inner

theorem DFinsupp.inner_sum {ι : Type*} [dec : DecidableEq ι] {α : ι → Type*}
theorem DFinsupp.inner_sum {ι : Type*} [DecidableEq ι] {α : ι → Type*}
[∀ i, AddZeroClass (α i)] [∀ (i) (x : α i), Decidable (x ≠ 0)] (f : ∀ i, α i → E)
(l : Π₀ i, α i) (x : E) : ⟪x, l.sum f⟫ = l.sum fun i a => ⟪x, f i a⟫ := by
simp (config := { contextual := true }) only [DFinsupp.sum, _root_.inner_sum, smul_eq_mul]
Expand Down Expand Up @@ -735,7 +733,7 @@ end BasicProperties

section OrthonormalSets

variable {ι : Type*} [dec_ι : DecidableEq ι] (𝕜)
variable {ι : Type*} (𝕜)

/-- An orthonormal set of vectors in an `InnerProductSpace` -/
def Orthonormal (v : ι → E) : Prop :=
Expand All @@ -746,7 +744,7 @@ variable {𝕜}

/-- `if ... then ... else` characterization of an indexed set of vectors being orthonormal. (Inner
product equals Kronecker delta.) -/
theorem orthonormal_iff_ite {v : ι → E} :
theorem orthonormal_iff_ite [DecidableEq ι] {v : ι → E} :
Orthonormal 𝕜 v ↔ ∀ i j, ⟪v i, v j⟫ = if i = j then (1 : 𝕜) else (0 : 𝕜) := by
constructor
· intro hv i j
Expand All @@ -766,7 +764,7 @@ theorem orthonormal_iff_ite {v : ι → E} :

/-- `if ... then ... else` characterization of a set of vectors being orthonormal. (Inner product
equals Kronecker delta.) -/
theorem orthonormal_subtype_iff_ite {s : Set E} :
theorem orthonormal_subtype_iff_ite [DecidableEq E] {s : Set E} :
Orthonormal 𝕜 (Subtype.val : s → E) ↔ ∀ v ∈ s, ∀ w ∈ s, ⟪v, w⟫ = if v = w then 1 else 0 := by
rw [orthonormal_iff_ite]
constructor
Expand Down Expand Up @@ -1961,7 +1959,7 @@ theorem orthonormal_span {ι : Type*} {v : ι → E} (hv : Orthonormal 𝕜 v) :

section OrthogonalFamily

variable {ι : Type*} [dec_ι : DecidableEq ι] (𝕜)
variable {ι : Type*} (𝕜)

open DirectSum

Expand Down Expand Up @@ -1991,14 +1989,14 @@ theorem Orthonormal.orthogonalFamily {v : ι → E} (hv : Orthonormal 𝕜 v) :
fun i j hij a b => by simp [inner_smul_left, inner_smul_right, hv.2 hij]
#align orthonormal.orthogonal_family Orthonormal.orthogonalFamily

theorem OrthogonalFamily.eq_ite {i j : ι} (v : G i) (w : G j) :
theorem OrthogonalFamily.eq_ite [DecidableEq ι] {i j : ι} (v : G i) (w : G j) :
⟪V i v, V j w⟫ = ite (i = j) ⟪V i v, V j w⟫ 0 := by
split_ifs with h
· rfl
· exact hV h v w
#align orthogonal_family.eq_ite OrthogonalFamily.eq_ite

theorem OrthogonalFamily.inner_right_dfinsupp (l : ⨁ i, G i) (i : ι) (v : G i) :
theorem OrthogonalFamily.inner_right_dfinsupp [DecidableEq ι] (l : ⨁ i, G i) (i : ι) (v : G i) :
⟪V i v, l.sum fun j => V j⟫ = ⟪v, l i⟫ :=
calc
⟪V i v, l.sum fun j => V j⟫ = l.sum fun j => fun w => ⟪V i v, V j w⟫ :=
Expand Down Expand Up @@ -2070,7 +2068,7 @@ theorem OrthogonalFamily.orthonormal_sigma_orthonormal {α : ι → Type*} {v_fa
· exact hV hij (v_family i v) (v_family j w)
#align orthogonal_family.orthonormal_sigma_orthonormal OrthogonalFamily.orthonormal_sigma_orthonormal

theorem OrthogonalFamily.norm_sq_diff_sum (f : ∀ i, G i) (s₁ s₂ : Finset ι) :
theorem OrthogonalFamily.norm_sq_diff_sum [DecidableEq ι] (f : ∀ i, G i) (s₁ s₂ : Finset ι) :
‖(∑ i in s₁, V i (f i)) - ∑ i in s₂, V i (f i)‖ ^ 2 =
(∑ i in s₁ \ s₂, ‖f i‖ ^ 2) + ∑ i in s₂ \ s₁, ‖f i‖ ^ 2 := by
rw [← Finset.sum_sdiff_sub_sum_sdiff, sub_eq_add_neg, ← Finset.sum_neg_distrib]
Expand Down Expand Up @@ -2100,7 +2098,6 @@ theorem OrthogonalFamily.norm_sq_diff_sum (f : ∀ i, G i) (s₁ s₂ : Finset
theorem OrthogonalFamily.summable_iff_norm_sq_summable [CompleteSpace E] (f : ∀ i, G i) :
(Summable fun i => V i (f i)) ↔ Summable fun i => ‖f i‖ ^ 2 := by
classical
clear dec_ι
simp only [summable_iff_cauchySeq_finset, NormedAddCommGroup.cauchySeq_iff, Real.norm_eq_abs]
constructor
· intro hf ε hε
Expand Down Expand Up @@ -2161,7 +2158,7 @@ theorem OrthogonalFamily.independent {V : ι → Submodule 𝕜 E}
_ = 0 := by simp only [hv, inner_zero_right]
#align orthogonal_family.independent OrthogonalFamily.independent

theorem DirectSum.IsInternal.collectedBasis_orthonormal {V : ι → Submodule 𝕜 E}
theorem DirectSum.IsInternal.collectedBasis_orthonormal [DecidableEq ι] {V : ι → Submodule 𝕜 E}
(hV : OrthogonalFamily 𝕜 (fun i => V i) fun i => (V i).subtypeₗᵢ)
(hV_sum : DirectSum.IsInternal fun i => V i) {α : ι → Type*}
{v_family : ∀ i, Basis (α i) 𝕜 (V i)} (hv_family : ∀ i, Orthonormal 𝕜 (v_family i)) :
Expand Down

0 comments on commit 7ab6068

Please sign in to comment.