-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(LinearAlgebra/{ExteriorPower,LinearIndependent,TensorPower}): define the exterior powers of a module and prove some of their basic properties #10654
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
`Λ[R]^n M` for `ExteriorPower R n M`. -/ | ||
@[reducible] | ||
def ExteriorPower := (LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n) | ||
|
||
@[inherit_doc] | ||
notation:100 "Λ[" R "]^" n:arg => ExteriorPower R n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think (LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n)
is already used quite a lot throughout mathlib; can you split out a PR that just adds this new def
and notation, and replaces all the existing uses with the new notation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do. Given that this expression already appears in LinearAlgebra/ExteriorAlgebra/Basic.lean
, I guess it would make sense to introduce ExteriorPower
there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's maybe worth waiting to see what Zulip says about the type of this expression, Right now Lean is inferring this as Submodule R (ExteriorAlgebra R M)
`Λ[R]^n M` for `ExteriorPower R n M`. -/ | |
@[reducible] | |
def ExteriorPower := (LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n) | |
@[inherit_doc] | |
notation:100 "Λ[" R "]^" n:arg => ExteriorPower R n | |
`Λ[R]^n M` for `ExteriorPower R n M`. -/ | |
@[reducible] | |
def ExteriorPower : Submodule R (ExteriorAlgebra R M) := | |
(LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n) | |
@[inherit_doc] | |
notation:100 "Λ[" R "]^" n:arg => ExteriorPower R n |
but this goes against the naming convention, since ExteriorPower
is not a type.
Either we should make it a type (in which case it won't actually work as a substitute in a handful of places), or we should rename it to exteriorPower
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I am actually using that it's a submodule of the exterior algebra in a few places. Anyway, I started a new branch that defined ExteriorPower
earlier and started substituting it there, and it's creating timeouts in ExteriorAlgebra/Grading.lean
. I need to play around with it more to see if I can figure out what happened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I changed all the ExteriorPower
s to exteriorPower
s and created PR #10744 to introduce the definition and notation. (But it does have that annoying instance synthesization problem.)
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
!bench |
Here are the benchmark results for commit 3c3d7f9. |
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
…tion and notation for the exterior powers of a module (#10744) This is split off from PR #10654 (that actually proves some properties of the exterior powers). It introduces the reducible definition `exteriorPower R n M` for the `n`th exterior power of the `R`-module `M`; this is of type `Submodule R (ExteriorAlgebra R M)` and defined as `LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n`. It also introduces the notation `Λ[R]^n M` for `exteriorPower R n M`. Note: for a reason that I don't understand, Lean becomes unable to synthesize the `SetLike.GradedMonoid` instance on `fun (i : ℕ) ↦ (Λ[R]^i) M`, so I added it manually in `ExteriorAlgebra/Graded.lean`. I am far from sure that this is the correct solution. Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Richard Copley <buster@buster.me.uk>
This PR/issue depends on: |
|
||
/-- A family `f` of linear forms on `M` indexed by `Fin n` defines a linear form on | ||
`⨂[R]^n M`, by multiplying the components of `f`. -/ | ||
noncomputable def linearFormOfFamily (f : (_ : Fin n) → (M →ₗ[R] R)) : (⨂[R]^n) M →ₗ[R] R := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noncomputable def linearFormOfFamily (f : (_ : Fin n) → (M →ₗ[R] R)) : (⨂[R]^n) M →ₗ[R] R := | |
noncomputable def linearFormOfFamily (f : (_ : Fin n) → Module.Dual R M) : Module.Dual R (⨂[R]^n M) := |
I think this holds more generally for the n-ary tensor products, rather than just tensor powers; can you add that definition instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that it should make it more complicated, so I'll try.
You suggested having a name that contains dual
instead of linearFormOfFamily
, and I'm not against that, but I don't feel very inspired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TensorProduct.dualDistrib
seems pretty analogous to this result; ideally we would bundle this map slightly further, and use the same name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, my linearFormOfFamily
is basically PiTensorProduct.dualDistrib
applied to the case of a constant family. PiTensorProduct.dualDistrib
doesn't exist yet, but I'll get to work on it.
I don't know if you were also suggesting to unify the case of the tensor product of two modules and that of the tensor product of a finite family of modules; if so, I don't know how to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so there is no PiTensorProduct.map
, I have to define that too... I am making this into another PR, because I am afraid that it will grow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started working in a new branch. Let's hope this doesn't grow too large.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if you were also suggesting to unify the case of the tensor product of two modules and that of the tensor product of a finite family of modules; if so, I don't know how to do that.
No, I am certainly not suggesting this! Just that we should try to match the names of the AP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started working in a new branch. Let's hope this doesn't grow too large.
It looks like you haven't pushed this branch yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did push it, but I didn't create a PR yet. I also got my link wrong somehow. Let's try again.
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
…tion and notation for the exterior powers of a module (#10744) This is split off from PR #10654 (that actually proves some properties of the exterior powers). It introduces the reducible definition `exteriorPower R n M` for the `n`th exterior power of the `R`-module `M`; this is of type `Submodule R (ExteriorAlgebra R M)` and defined as `LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n`. It also introduces the notation `Λ[R]^n M` for `exteriorPower R n M`. Note: for a reason that I don't understand, Lean becomes unable to synthesize the `SetLike.GradedMonoid` instance on `fun (i : ℕ) ↦ (Λ[R]^i) M`, so I added it manually in `ExteriorAlgebra/Graded.lean`. I am far from sure that this is the correct solution. Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Richard Copley <buster@buster.me.uk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really looking forward to this.
theorem finite [Module.Finite R M]: Module.Finite R (⋀[R]^n M) := | ||
Module.Finite.mk ((Submodule.fg_top _).mpr (Submodule.FG.pow (by | ||
rw [LinearMap.range_eq_map]; exact Submodule.FG.map _ (Module.finite_def.mp inferInstance)) _ )) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theorem finite [Module.Finite R M]: Module.Finite R (⋀[R]^n M) := | |
Module.Finite.mk ((Submodule.fg_top _).mpr (Submodule.FG.pow (by | |
rw [LinearMap.range_eq_map]; exact Submodule.FG.map _ (Module.finite_def.mp inferInstance)) _ )) | |
instance instFinite [Module.Finite R M]: Module.Finite R (⋀[R]^n M) := | |
Module.Finite.mk ((Submodule.fg_top _).mpr (Submodule.FG.pow (by | |
rw [LinearMap.range_eq_map]; exact Submodule.FG.map _ (Module.finite_def.mp inferInstance)) _ )) |
|
||
/-- If `b` is a basis of `M` (indexed by a linearly ordered type), the basis of the `n`th | ||
exterior power of `M` formed by the `n`-fold exterior products of elements of `b`. -/ | ||
noncomputable def BasisOfBasis {I : Type*} [LinearOrder I] (b : Basis I R M) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noncomputable def BasisOfBasis {I : Type*} [LinearOrder I] (b : Basis I R M) : | |
noncomputable def basisOfBasis {I : Type*} [LinearOrder I] (b : Basis I R M) : |
and throughout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or _root_.Basis.exteriorPower
?
(by rw [span_top_of_span_top']; rw [Basis.span_eq]) | ||
|
||
@[simp] | ||
lemma BasisOfBasis_coe {I : Type*} [LinearOrder I] (b : Basis I R M) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lemma BasisOfBasis_coe {I : Type*} [LinearOrder I] (b : Basis I R M) : | |
lemma coe_basisOfBasis {I : Type*} [LinearOrder I] (b : Basis I R M) : |
and throughout
lemma FreeOfFree (hfree : Module.Free R M) : Module.Free R (⋀[R]^n M) := | ||
let ⟨I, b⟩ := (Classical.choice hfree.exists_basis) | ||
letI := WellFounded.wellOrderExtension (emptyWf (α := I)).wf | ||
Module.Free.of_basis (BasisOfBasis R n b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lemma FreeOfFree (hfree : Module.Free R M) : Module.Free R (⋀[R]^n M) := | |
let ⟨I, b⟩ := (Classical.choice hfree.exists_basis) | |
letI := WellFounded.wellOrderExtension (emptyWf (α := I)).wf | |
Module.Free.of_basis (BasisOfBasis R n b) | |
instance instFree [hfree : Module.Free R M] : Module.Free R (⋀[R]^n M) := | |
let ⟨I, b⟩ := hfree.exists_basis | |
letI := WellFounded.wellOrderExtension (emptyWf (α := I)).wf | |
Module.Free.of_basis (basisOfBasis R n b) |
lemma nonemptyOfNonempty {I : Type*} [LinearOrder I] | ||
(hne : Nonempty {v : I → E // LinearIndependent K v}) : | ||
Nonempty {v : {s : Finset I // Finset.card s = n} → | ||
(⋀[K]^n) E // LinearIndependent K v} := | ||
let v := Classical.choice hne | ||
Nonempty.intro ⟨ιMulti_family K n v, ιMulti_family_linearIndependent_field n v.2⟩ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lemma nonemptyOfNonempty {I : Type*} [LinearOrder I] | |
(hne : Nonempty {v : I → E // LinearIndependent K v}) : | |
Nonempty {v : {s : Finset I // Finset.card s = n} → | |
(⋀[K]^n) E // LinearIndependent K v} := | |
let v := Classical.choice hne | |
Nonempty.intro ⟨ιMulti_family K n v, ιMulti_family_linearIndependent_field n v.2⟩ | |
instance instNonempty {I : Type*} [LinearOrder I] [Nonempty {v : I → E // LinearIndependent K v}] : | |
Nonempty {v : {s : Finset I // Finset.card s = n} → (⋀[K]^n) E // LinearIndependent K v} := | |
Nonempty.map (fun v : {v : I → E // LinearIndependent K v} ↦ | |
⟨ιMulti_family K n v, ιMulti_family_linearIndependent_field n v.2⟩) ‹_› |
lemma FinrankOfFiniteFree (hfree : Module.Free R M) [Module.Finite R M] : | ||
FiniteDimensional.finrank R (⋀[R]^n M) = | ||
Nat.choose (FiniteDimensional.finrank R M) n := | ||
letI := WellFounded.wellOrderExtension (emptyWf (α := hfree.ChooseBasisIndex)).wf | ||
let B := BasisOfBasis R n (hfree.chooseBasis) | ||
by rw [FiniteDimensional.finrank_eq_card_basis hfree.chooseBasis, | ||
FiniteDimensional.finrank_eq_card_basis B, Fintype.card_finset_len] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lemma FinrankOfFiniteFree (hfree : Module.Free R M) [Module.Finite R M] : | |
FiniteDimensional.finrank R (⋀[R]^n M) = | |
Nat.choose (FiniteDimensional.finrank R M) n := | |
letI := WellFounded.wellOrderExtension (emptyWf (α := hfree.ChooseBasisIndex)).wf | |
let B := BasisOfBasis R n (hfree.chooseBasis) | |
by rw [FiniteDimensional.finrank_eq_card_basis hfree.chooseBasis, | |
FiniteDimensional.finrank_eq_card_basis B, Fintype.card_finset_len] | |
lemma finrank_eq_of_finite_free [hfree : Module.Free R M] [Module.Finite R M] : | |
FiniteDimensional.finrank R (⋀[R]^n M) = | |
Nat.choose (FiniteDimensional.finrank R M) n := by | |
letI := WellFounded.wellOrderExtension (emptyWf (α := hfree.ChooseBasisIndex)).wf | |
let B := basisOfBasis R n hfree.chooseBasis | |
rw [FiniteDimensional.finrank_eq_card_basis hfree.chooseBasis, | |
FiniteDimensional.finrank_eq_card_basis B, Fintype.card_finset_len] |
or just finrank_eq
?
* `exteriorPower.BasisOfBases` -> `Basis.exteriorPower` * `exteriorPower.BasisOfBasis_coe` -> `exteriorPower.coe_basis` * `exteriorPower.BasisOfBasis_apply` -> `exteriorPower.basis_apply` * `exteriorPower.BasisOfBasis_coord` -> `exteriorPower.basis_coord` * `FinrankOfFiniteFree` -> `finrank_eq` * `theorem finite` -> `instance instFinite` * `theorem FreeOfFree` -> `instance instFree` Use instance-implicit arguments for `Module.Free` and `Nonempty`.
I've made those changes, along with a separate golf commit, on [edit: deleted branch]. Feel free to use any or all of it if you want. |
Thanks ! I'm happy to use all of them, you can make them directly here if you want, otherwise I'll try to get to it this evening. |
Don't feel like you have to write everything that's missing, especially not in one go; the changes in |
I got slightly carried away... But I also constructed a basis of the |
Here is the PR proving that |
…tion and notation for the exterior powers of a module (#10744) This is split off from PR #10654 (that actually proves some properties of the exterior powers). It introduces the reducible definition `exteriorPower R n M` for the `n`th exterior power of the `R`-module `M`; this is of type `Submodule R (ExteriorAlgebra R M)` and defined as `LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n`. It also introduces the notation `Λ[R]^n M` for `exteriorPower R n M`. Note: for a reason that I don't understand, Lean becomes unable to synthesize the `SetLike.GradedMonoid` instance on `fun (i : ℕ) ↦ (Λ[R]^i) M`, so I added it manually in `ExteriorAlgebra/Graded.lean`. I am far from sure that this is the correct solution. Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Richard Copley <buster@buster.me.uk>
…tion and notation for the exterior powers of a module (#10744) This is split off from PR #10654 (that actually proves some properties of the exterior powers). It introduces the reducible definition `exteriorPower R n M` for the `n`th exterior power of the `R`-module `M`; this is of type `Submodule R (ExteriorAlgebra R M)` and defined as `LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n`. It also introduces the notation `Λ[R]^n M` for `exteriorPower R n M`. Note: for a reason that I don't understand, Lean becomes unable to synthesize the `SetLike.GradedMonoid` instance on `fun (i : ℕ) ↦ (Λ[R]^i) M`, so I added it manually in `ExteriorAlgebra/Graded.lean`. I am far from sure that this is the correct solution. Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Richard Copley <buster@buster.me.uk>
…tion and notation for the exterior powers of a module (#10744) This is split off from PR #10654 (that actually proves some properties of the exterior powers). It introduces the reducible definition `exteriorPower R n M` for the `n`th exterior power of the `R`-module `M`; this is of type `Submodule R (ExteriorAlgebra R M)` and defined as `LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n`. It also introduces the notation `Λ[R]^n M` for `exteriorPower R n M`. Note: for a reason that I don't understand, Lean becomes unable to synthesize the `SetLike.GradedMonoid` instance on `fun (i : ℕ) ↦ (Λ[R]^i) M`, so I added it manually in `ExteriorAlgebra/Graded.lean`. I am far from sure that this is the correct solution. Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Richard Copley <buster@buster.me.uk>
…tion and notation for the exterior powers of a module (#10744) This is split off from PR #10654 (that actually proves some properties of the exterior powers). It introduces the reducible definition `exteriorPower R n M` for the `n`th exterior power of the `R`-module `M`; this is of type `Submodule R (ExteriorAlgebra R M)` and defined as `LinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n`. It also introduces the notation `Λ[R]^n M` for `exteriorPower R n M`. Note: for a reason that I don't understand, Lean becomes unable to synthesize the `SetLike.GradedMonoid` instance on `fun (i : ℕ) ↦ (Λ[R]^i) M`, so I added it manually in `ExteriorAlgebra/Graded.lean`. I am far from sure that this is the correct solution. Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Richard Copley <buster@buster.me.uk>
This introduces the exterior powers of a module and proves some of their basic properties, in
LinearAlgebra/ExteriorPower/Basic.lean
andLinearAlgebra/ExteriorPower/Generators.lean
. It also adds a lemma inLinearAlgebra/LinearIndependent.lean
(linearIndependent_of_dualFamily
: if a family of vectors admits a "dual" family of linear forms, then it is linearly independent) and a construction inLinearAlgebra/TensorPower.lean
(linearFormOfFamily
: the linear form on the tensor power ofM
obtained by multiplying a family of linear forms onM
).Main definitions
In
LinearAlgebra/ExteriorPower/Basic.lean
:ExteriorPower R n M
is then
th exterior power of aR
-moduleM
, defined asLinearMap.range (ExteriorAlgebra.ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n
. We also introduce the notationΛ[R]^n M
forExteriorPower R n M
.ExteriorPower.ιMulti
is the canonical alternating map onM
with values inΛ[R]^n M
.ExteriorPower.map
: functoriality of exterior powers with respect to linear maps between modules.ExteriorPower.toTensorPower
: linear map from then
th exterior power to then
thtensor power (coming from
MultilinearMap.alternatization
via the universal property ofexterior powers).
In
LinearAlgebra/ExteriorPower/Generators.lean
:ExteriorPower.BasisOfBasis
: Ifb
is a basis ofM
(indexed by a linearly ordered type),the basis of the
n
th exterior power ofM
formed by then
-fold exterior products of elementsof
b
.Main theorems
In
LinearAlgebra/ExteriorPower/Basic.lean
:The image of
ExteriorPower.ιMulti
spansΛ[R]^n M
.ExteriorPower.liftAlternatingEquiv
(universal property of then
th exterior power ofM
):the linear equivalence between linear maps from
Λ[R]^n M
to a moduleN
andn
-foldalternating maps from
M
toN
.ExteriorPower.map_injective_field
: Iff : M →ₗ[R] N
is injective andR
is a field, thenExteriorPower.map n f
is injective.ExteriorPower.map_surjective
: Iff : M →ₗ[R] N
is surjective, thenExteriorPower.map n f
is surjective.
ExteriorPower.mem_exteriorPower_is_mem_finite
: Every element ofΛ[R]^n M
is in the image ofΛ[R]^n P
for some finitely generated submoduleP
ofM
.In
LinearAlgebra/ExteriorPower/Generators.lean
:ExteriorPower.Finite
: Then
th exterior power of a finite module is a finite module.ExteriorPower.span_top_of_span_top
andExteriorPower.span_top_of_span_top'
: If a family ofvectors spans
M
, then the family of itsn
-fold exterior products spansΛ[R]^n M
. (We giveversions in the exterior algebra and in the exterior power.)
ExteriorPower.FreeOfFree
: IfM
is a free module, then so is itsn
th exterior power.ExteriorPower.FinrankOfFiniteFree
: IfR
satisfies the strong rank condition andM
isfinite free of rank
r
, then then
th exterior power ofM
is of finrankNat.choose r n
.ExteriorPower.ιMulti_family_linearIndependent_field
: IfR
is a field, and ifv
is alinearly independent family of vectors (indexed by a linearly ordered type), then the family of
its
n
-fold exterior products is also linearly independent.PiTensorProduct
#11156