Skip to content

Commit 98e86f4

Browse files
chore(LinearAlgebra/{ExteriorAlgebra,ExteriorPower}): refactor ExteriorAlgebra.ιMulti_family and exteriorPower.ιMulti_family to use Set.powersetCard (#35167)
Rewrites `ExteriorAlgebra.ιMulti_family` and `exteriorPower.ιMulti_family` to use `Set.powersetCard` instead of an explicit subtype.
1 parent fe7639f commit 98e86f4

File tree

4 files changed

+47
-7
lines changed

4 files changed

+47
-7
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5658,6 +5658,7 @@ public import Mathlib.Order.Hom.CompleteLattice
56585658
public import Mathlib.Order.Hom.Lattice
56595659
public import Mathlib.Order.Hom.Lex
56605660
public import Mathlib.Order.Hom.Order
5661+
public import Mathlib.Order.Hom.PowersetCard
56615662
public import Mathlib.Order.Hom.Set
56625663
public import Mathlib.Order.Hom.WithTopBot
56635664
public import Mathlib.Order.Ideal

Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean

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

88
public import Mathlib.LinearAlgebra.CliffordAlgebra.Basic
99
public import Mathlib.LinearAlgebra.Alternating.Curry
10+
public import Mathlib.Order.Hom.PowersetCard
1011

1112
/-!
1213
# Exterior Algebras
@@ -341,8 +342,8 @@ lemma ιMulti_span_fixedDegree (n : ℕ) :
341342
/-- Given a linearly ordered family `v` of vectors of `M` and a natural number `n`, produce the
342343
family of `n`fold exterior products of elements of `v`, seen as members of the exterior algebra. -/
343344
abbrev ιMulti_family (n : ℕ) {I : Type*} [LinearOrder I] (v : I → M)
344-
(s : {s : Finset I // Finset.card s = n}) : ExteriorAlgebra R M :=
345-
ιMulti R n fun i => v (Finset.orderIsoOfFin _ s.prop i)
345+
(s : Set.powersetCard I n) : ExteriorAlgebra R M :=
346+
ιMulti R n (v ∘ (Set.powersetCard.ofFinEmbEquiv.symm s))
346347

347348
variable {R}
348349

Mathlib/LinearAlgebra/ExteriorPower/Basic.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ variable (R : Type u) [CommRing R] (n : ℕ) {M N N' : Type*}
4646

4747
namespace exteriorPower
4848

49-
open Function
49+
open Function Set Set.powersetCard
5050

5151
/-! The canonical alternating map from `Fin n → M` to `⋀[R]^n M`. -/
5252

@@ -63,15 +63,15 @@ def ιMulti : M [⋀^Fin n]→ₗ[R] (⋀[R]^n M) :=
6363
family of `n`fold exterior products of elements of `v`, seen as members of the
6464
`n`th exterior power. -/
6565
noncomputable def ιMulti_family {I : Type*} [LinearOrder I] (v : I → M)
66-
(s : {s : Finset I // Finset.card s = n}) : ⋀[R]^n M :=
67-
ιMulti R n fun i ↦ v <| Finset.orderIsoOfFin s.val s.property i
66+
(s : powersetCard I n) : ⋀[R]^n M :=
67+
ιMulti R n (v ∘ (ofFinEmbEquiv.symm s))
6868

6969
lemma ιMulti_family_eq_coe_comp {I : Type*} [LinearOrder I] (v : I → M) :
7070
ExteriorAlgebra.ιMulti_family R n v = (↑) ∘ ιMulti_family R n v :=
7171
rfl
7272

7373
@[simp] lemma ιMulti_family_apply_coe {I : Type*} [LinearOrder I] (v : I → M)
74-
(s : {s : Finset I // Finset.card s = n}) :
74+
(s : powersetCard I n) :
7575
ιMulti_family R n v s = ExteriorAlgebra.ιMulti_family R n v s := rfl
7676

7777
variable (M)
@@ -281,7 +281,7 @@ lemma map_comp_ιMulti_family {I : Type*} [LinearOrder I] (v : I → M) (f : M
281281

282282
@[simp]
283283
lemma map_apply_ιMulti_family {I : Type*} [LinearOrder I] (v : I → M) (f : M →ₗ[R] N)
284-
(s : {s : Finset I // s.card = n}) :
284+
(s : powersetCard I n) :
285285
(map n f) (ιMulti_family R n v s) = ιMulti_family R n (f ∘ v) s := by
286286
simp only [ιMulti_family, map, alternatingMapLinearEquiv_apply_ιMulti]
287287
rfl
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/-
2+
Copyright (c) 2026 Daniel Morrison. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Daniel Morrison
5+
-/
6+
module
7+
8+
public import Mathlib.Data.Set.PowersetCard
9+
public import Mathlib.Data.Finset.Sort
10+
11+
@[expose] public section
12+
13+
open Finset Function Set
14+
15+
namespace Set.powersetCard
16+
17+
section order
18+
19+
variable {n : ℕ} {I : Type*} [LinearOrder I]
20+
21+
/-- The isomorphism of `OrderEmbedding`s from `Fin n` into `I` with `Set.powersetCard I n`
22+
when `I` is linearly ordered. -/
23+
def ofFinEmbEquiv : (Fin n ↪o I) ≃ powersetCard I n where
24+
toFun f := ofFinEmb n I f.toEmbedding
25+
invFun s := Finset.orderEmbOfFin s.val s.prop
26+
left_inv f := by symm; apply Finset.orderEmbOfFin_unique'; simp
27+
right_inv s := by ext; simp
28+
29+
lemma ofFinEmbEquiv_apply (f : Fin n ↪o I) :
30+
ofFinEmbEquiv f = ofFinEmb n I f.toEmbedding :=
31+
rfl
32+
33+
lemma ofFinEmbEquiv_symm_apply (s : powersetCard I n) :
34+
ofFinEmbEquiv.symm s = Finset.orderEmbOfFin s.val s.prop := rfl
35+
36+
end order
37+
38+
end Set.powersetCard

0 commit comments

Comments
 (0)