Skip to content

Commit

Permalink
feat: affineSpan k (insert 0 s) = span k s (#17661)
Browse files Browse the repository at this point in the history
From LeanCamCombi
  • Loading branch information
YaelDillies committed Oct 16, 2024
1 parent f4d8a98 commit 054aa6c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Mathlib/LinearAlgebra/AffineSpace/AffineSubspace.lean
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ noncomputable section
open Affine

open Set
open scoped Pointwise

section

Expand Down Expand Up @@ -510,6 +511,12 @@ theorem direction_affineSpan (s : Set P) : (affineSpan k s).direction = vectorSp
theorem mem_affineSpan {p : P} {s : Set P} (hp : p ∈ s) : p ∈ affineSpan k s :=
mem_spanPoints k p s hp

@[simp]
lemma vectorSpan_add_self (s : Set V) : (vectorSpan k s : Set V) + s = affineSpan k s := by
ext
simp [mem_add, spanPoints]
aesop

end affineSpan

namespace AffineSubspace
Expand Down Expand Up @@ -1284,6 +1291,17 @@ lemma affineSpan_subset_span {s : Set V} :
(affineSpan k s : Set V) ⊆ Submodule.span k s :=
affineSpan_le_toAffineSubspace_span

-- TODO: We want this to be simp, but `affineSpan` gets simped away to `spanPoints`!
-- Let's delete `spanPoints`
lemma affineSpan_insert_zero (s : Set V) :
(affineSpan k (insert 0 s) : Set V) = Submodule.span k s := by
rw [← Submodule.span_insert_zero]
refine affineSpan_subset_span.antisymm ?_
rw [← vectorSpan_add_self, vectorSpan_def]
refine Subset.trans ?_ <| subset_add_left _ <| mem_insert ..
gcongr
exact subset_sub_left <| mem_insert ..

end AffineSpace'

namespace AffineSubspace
Expand Down

0 comments on commit 054aa6c

Please sign in to comment.