Skip to content

Commit 2a6bde3

Browse files
feat(LinearAlgebra/ExteriorAlgebra/Basic): adds multiplication lemmas for ExteriorAlgebra (leanprover-community#35433)
This adds lemmas for dealing with multiplication of elements in the `ExteriorAlgebra`: * `ιMulti_eq_zero_of_not_inj` : a product containing duplicates is zero * `ιMulti_mul_ιMulti` : `ιMulti R m a * ιMulti R n b = ιMulti R (m+n) (Fin.append a b)` * `ιMulti_family_mul_of_not_disjoint` : if two sets of elements are not disjoint their product is zero * `ιMulti_perm` : the permutation corresponding to adjoining two sets of elements and sorting the result * `ιMulti_family_mul_of_disjoint` : the product of two elements of the form `ιMulti_family` is of the form `ιMulti_family` up to sign Co-authored-by: Oliver Nash <7734364+ocfnash@users.noreply.github.com>
1 parent b72c034 commit 2a6bde3

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

Mathlib/Data/Finset/Basic.lean

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,33 @@ theorem Finset.union_symm_right (h : Disjoint s t) {i : α} (hi : i ∈ t)
601601
(hi' : i ∈ s ∪ t) : (Equiv.Finset.union s t h).symm ⟨i, hi'⟩ = Sum.inr ⟨i, hi⟩ := by
602602
simp [Equiv.symm_apply_eq]
603603

604+
/-- The disjoint union of finsets is a sum -/
605+
def Finset.disjUnionEquiv (s t : Finset α) (h : Disjoint s t) :
606+
s ⊕ t ≃ s.disjUnion t h :=
607+
Equiv.setCongr (coe_disjUnion h) |>.trans (Equiv.Set.union (disjoint_coe.mpr h)) |>.symm
608+
609+
@[simp]
610+
theorem Finset.disjUnionEquiv_inl (h : Disjoint s t) (x : s) :
611+
Equiv.Finset.disjUnionEquiv s t h (Sum.inl x) = ⟨x, Finset.mem_disjUnion.mpr <| Or.inl x.2⟩ :=
612+
rfl
613+
614+
@[simp]
615+
theorem Finset.disjUnionEquiv_inr (h : Disjoint s t) (y : t) :
616+
Equiv.Finset.disjUnionEquiv s t h (Sum.inr y) = ⟨y, Finset.mem_disjUnion.mpr <| Or.inr y.2⟩ :=
617+
rfl
618+
619+
@[simp]
620+
theorem Finset.disjUnionEquiv_symm_left (h : Disjoint s t) {i : α} (hi : i ∈ s)
621+
(hi' : i ∈ s.disjUnion t h) :
622+
(Equiv.Finset.disjUnionEquiv s t h).symm ⟨i, hi'⟩ = Sum.inl ⟨i, hi⟩ := by
623+
simp [Equiv.symm_apply_eq]
624+
625+
@[simp]
626+
theorem Finset.disjUnionEquiv_symm_right (h : Disjoint s t) {i : α} (hi : i ∈ t)
627+
(hi' : i ∈ s.disjUnion t h) :
628+
(Equiv.Finset.disjUnionEquiv s t h).symm ⟨i, hi'⟩ = Sum.inr ⟨i, hi⟩ := by
629+
simp [Equiv.symm_apply_eq]
630+
604631
/-- The type of dependent functions on the disjoint union of finsets `s ∪ t` is equivalent to the
605632
type of pairs of functions on `s` and on `t`. This is similar to `Equiv.sumPiEquivProdPi`. -/
606633
def piFinsetUnion {ι} [DecidableEq ι] (α : ι → Type*) {s t : Finset ι} (h : Disjoint s t) :

Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,18 @@ theorem ιMulti_succ_curryLeft {n : ℕ} (m : M) :
316316
(LinearMap.mulLeft R (ι R m)).compAlternatingMap (ιMulti R n) := by
317317
ext; simp
318318

319+
lemma ιMulti_eq_zero_of_not_inj {n : ℕ} {v : Fin n → M} (hv : ¬Function.Injective v) :
320+
ιMulti R n v = 0 :=
321+
(ιMulti R n).map_eq_zero_of_not_injective v hv
322+
323+
lemma ιMulti_mul_ιMulti {m n : ℕ} (a : Fin m → M) (b : Fin n → M) :
324+
ιMulti R m a * ιMulti R n b = ιMulti R (m + n) (Fin.append a b) := by
325+
simp only [ιMulti_apply]
326+
change _ = (List.ofFn ((ι R) ∘ Fin.append a b)).prod
327+
rw [← List.map_ofFn, List.ofFn_fin_append, List.map_append, List.prod_append]
328+
simp only [List.map_ofFn]
329+
congr
330+
319331
variable (R)
320332

321333
/-- The image of `ExteriorAlgebra.ιMulti R n` is contained in the `n`th exterior power. -/
@@ -350,6 +362,39 @@ abbrev ιMulti_family (n : ℕ) {I : Type*} [LinearOrder I] (v : I → M)
350362
(s : Set.powersetCard I n) : ExteriorAlgebra R M :=
351363
ιMulti R n (v ∘ (Set.powersetCard.ofFinEmbEquiv.symm s))
352364

365+
open Set Set.powersetCard
366+
367+
lemma ιMulti_family_mul_of_not_disjoint {m n : ℕ} {I : Type*} [LinearOrder I] (v : I → M)
368+
(s : powersetCard I m) (t : powersetCard I n) (h : ¬Disjoint s.val t.val) :
369+
ιMulti_family R m v s * ιMulti_family R n v t = 0 := by
370+
rw [Finset.not_disjoint_iff] at h
371+
obtain ⟨i, his, hit⟩ := h
372+
obtain ⟨j, hj⟩ := (mem_range_ofFinEmbEquiv_symm_iff_mem s i).mpr his
373+
obtain ⟨k, hk⟩ := (mem_range_ofFinEmbEquiv_symm_iff_mem t i).mpr hit
374+
simp only [ιMulti_family, ιMulti_mul_ιMulti]
375+
apply AlternatingMap.map_eq_zero_of_eq (i := Fin.castAdd n j) (j := Fin.natAdd m k)
376+
· simp [hj, hk]
377+
· apply ne_of_lt
378+
apply lt_of_lt_of_le (b := m) <;> simp
379+
380+
lemma ιMulti_family_mul_of_disjoint {m n : ℕ} {I : Type*} [LinearOrder I] (v : I → M)
381+
(s : powersetCard I m) (t : powersetCard I n) (h : Disjoint s.val t.val) :
382+
ιMulti_family R m v s * ιMulti_family R n v t =
383+
(permOfDisjoint h).sign • ιMulti_family R (m + n) v (disjUnion h) := by
384+
simp only [ιMulti_family, ιMulti_mul_ιMulti]
385+
rw [← AlternatingMap.map_perm, permOfDisjoint]
386+
congr
387+
ext i
388+
let e := powersetCard.orderIsoOfFin (powersetCard.disjUnion h)
389+
change _ = v (e (e.symm _))
390+
by_cases! hi : i < m
391+
· rw [← Fin.castAdd_castLT n i hi, Fin.append_left, OrderIso.apply_symm_apply,
392+
finSumFinEquiv_symm_apply_castAdd]
393+
aesop
394+
· rw [← Fin.natAdd_subNat_cast hi, Fin.append_right, OrderIso.apply_symm_apply,
395+
finSumFinEquiv_symm_apply_natAdd]
396+
aesop
397+
353398
variable {R}
354399

355400
/-- An `ExteriorAlgebra` over a nontrivial ring is nontrivial. -/

Mathlib/Order/Hom/PowersetCard.lean

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module
77

88
public import Mathlib.Data.Set.PowersetCard
99
public import Mathlib.Data.Finset.Sort
10+
public import Mathlib.Logic.Equiv.Fin.Basic
1011

1112
/-!
1213
# Finite sets of an ordered type
@@ -55,6 +56,24 @@ lemma mem_range_ofFinEmbEquiv_symm_iff_mem (s : powersetCard I n) (i : I) :
5556
i ∈ range (ofFinEmbEquiv.symm s) ↔ i ∈ s := by
5657
simp [ofFinEmbEquiv_symm_apply]
5758

59+
/-- The natural enumeration of the elements of linearly-ordered type. -/
60+
@[simps!] def orderIsoOfFin {n : ℕ} {I : Type*} [LinearOrder I] (s : powersetCard I n) :
61+
Fin n ≃o s.val :=
62+
s.val.orderIsoOfFin s.prop
63+
64+
/-- The permutation of `Fin (m + n)` corresponding to adjoining a `Finset` of card `m`
65+
to a `Finset` of card `n` and sorting the resulting set. In other words, given `s₁ < s₂ < ⋯ < sₘ`
66+
and `t₁ < t₂ < ⋯ < tₙ` (disjoint) this is the permutation obtained by sorting
67+
`s₁, s₂, …, sₘ, t₁, t₂, …, tₙ`. -/
68+
def permOfDisjoint {m n : ℕ} {I : Type*} [LinearOrder I]
69+
{s : powersetCard I m} {t : powersetCard I n} (h : Disjoint s.val t.val) :
70+
Equiv.Perm (Fin (m + n)) :=
71+
letI e₁ : Fin (m + n) ≃ Fin m ⊕ Fin n := finSumFinEquiv.symm
72+
letI e₂ : Fin m ⊕ Fin n ≃ s.val ⊕ t.val := (orderIsoOfFin s).sumCongr (orderIsoOfFin t)
73+
letI e₃ : s.val ⊕ t.val ≃ disjUnion h := Equiv.Finset.disjUnionEquiv _ _ h
74+
letI e₄ : disjUnion h ≃o Fin (m + n) := (orderIsoOfFin (disjUnion h)).symm
75+
e₁.trans <| e₂.trans <| e₃.trans <| e₄
76+
5877
end order
5978

6079
end Set.powersetCard

0 commit comments

Comments
 (0)