@@ -23,9 +23,12 @@ open Classical
2323
2424infixr :20 "<∘ₗ>" => LinearMap.comp
2525
26+ universe u
27+
2628variable {A : Type *} [Semiring A]
2729variable {R : Type *} [CommRing R] [Algebra R A]
2830variable {M : Type *} [AddCommGroup M] [Module R M]
31+ variable {ι : Type u}
2932
3033open ExteriorAlgebra CategoryTheory
3134
@@ -76,7 +79,7 @@ end TensorPower
7679#check exteriorPower.alternatingMapToDual
7780noncomputable def linearFormOfFamily {n : ℕ} (f : (_ : Fin n) → (Module.Dual R M)) :
7881 Module.Dual R (⋀[R]^n M) :=
79- ( TensorPower.multilinearMapToDual R M n f) ∘ₗ (exteriorPower.toTensorPower R M n)
82+ TensorPower.linearFormOfFamily f ∘ₗ (exteriorPower.toTensorPower R M) n
8083
8184@[simp]
8285lemma linearFormOfFamily_apply (f : (_ : Fin n) → (M →ₗ[R] R)) (x : ⋀[R]^n M) :
@@ -112,40 +115,125 @@ lemma linearFormOfBasis_apply_ιMulti {I : Type*} [LinearOrder I] (b : Basis I R
112115 refine Finset.sum_congr rfl fun σ _ => ?_
113116 rw [LinearMap.map_smul_of_tower, TensorPower.linearFormOfFamily_apply_tprod]
114117
118+ /-- If `v : ι → M` is a family of vectors and there exists a family of linear forms
119+ `dv : ι → (M →ₗ[R] R)` such that `dv i (v j)` is `1` for `i = j` and `0` for `i ≠ j`, then
120+ `v` is linearly independent. -/
121+ theorem linearIndependent_of_dualFamily
122+ (v : ι → M) (dv : ι → (M →ₗ[R] R))
123+ (h1 : ∀ (a : ι) (b : ι), a ≠ b → (dv a) (v b) = 0 ) (h2 : ∀ (a : ι), (dv a) (v a) = 1 ) :
124+ LinearIndependent R v := by
125+ rw [linearIndependent_iff']
126+ intro s g hrel i hi
127+ apply_fun (fun x => dv i x) at hrel
128+ simp only [map_sum, map_smul, smul_eq_mul, _root_.map_zero] at hrel
129+ rw [Finset.sum_eq_single i (fun j _ hj ↦ by rw [h1 i j (Ne.symm hj), mul_zero])
130+ (fun hi' ↦ False.elim (hi' hi)), h2 i, mul_one] at hrel
131+ exact hrel
132+
133+ /-- Let `b` be a basis of `M` indexed by a linearly ordered type `I` and `s` be a finset of `I`
134+ of cardinality `n`. If we apply the linear form on `⋀[R]^n M` defined by `b` and `s`
135+ to the exterior product of the `b i` for `i ∈ s`, then we get `1`. -/
136+ lemma linearFormOfBasis_apply_diag {I : Type *} [LinearOrder I] (b : Basis I R M)
137+ {s : Finset I} (hs : Finset.card s = n) :
138+ linearFormOfBasis b hs (ιMulti_family R n b (Subtype.mk s hs)) = 1 := by
139+ trans ∑ σ : Fin n ≃ Fin n,
140+ TensorPower.linearFormOfFamily R n (fun i ↦ b.coord (Finset.orderIsoOfFin s hs i))
141+ (Equiv.Perm.sign σ • ⨂ₜ[R] i : Fin n, b (Finset.orderIsoOfFin s hs (σ i)))
142+ · rw [ιMulti_family, linearFormOfBasis_apply_ιMulti]
143+ congr
144+ ext σ
145+ rw [LinearMap.map_smul_of_tower, TensorPower.linearFormOfFamily_apply_tprod]
146+ · have hzero : ∀ σ ∈ Finset.univ, σ ≠ Equiv.refl (Fin n) →
147+ (TensorPower.linearFormOfFamily R n fun i ↦ b.coord (Finset.orderIsoOfFin s hs i))
148+ (Equiv.Perm.sign σ • ⨂ₜ[R] i, b (Finset.orderIsoOfFin s hs (σ i))) = 0 := by
149+ rintro σ - hσ
150+ rw [ne_eq, Equiv.ext_iff.not, not_forall] at hσ
151+ obtain ⟨i, hi⟩ := hσ
152+ rw [LinearMap.map_smul_of_tower, smul_eq_zero_iff_eq,
153+ TensorPower.linearFormOfFamily_apply_tprod]
154+ apply Finset.prod_eq_zero (Finset.mem_univ _) (a := i)
155+ rw [Finset.coe_orderIsoOfFin_apply, Basis.coord_apply, Basis.repr_self_apply,
156+ Finset.coe_orderIsoOfFin_apply, ite_eq_right_iff, OrderEmbedding.eq_iff_eq]
157+ exact fun a ↦ absurd a hi
158+ rw [Finset.sum_eq_single_of_mem (Equiv.refl (Fin n)) (Finset.mem_univ _) hzero,
159+ Equiv.Perm.sign_refl, one_smul, TensorPower.linearFormOfFamily_apply_tprod]
160+ apply Finset.prod_eq_one
161+ rintro i -
162+ rw [Basis.coord_apply, Basis.repr_self, Equiv.refl_apply, Finsupp.single_eq_same]
163+
164+ lemma linearFormOfBasis_apply_nondiag_aux {I : Type *} [LinearOrder I] {s t : Finset I}
165+ (hs : Finset.card s = n) (ht : Finset.card t = n) (hst : s ≠ t) (σ : Equiv.Perm (Fin n)) :
166+ ∃ (i : Fin n), (Finset.orderIsoOfFin s hs i).1 ≠ (Finset.orderIsoOfFin t ht (σ i)).1 := by
167+ by_contra! habs
168+ apply hst
169+ apply Finset.eq_of_subset_of_card_le
170+ · intro a has
171+ let b := Finset.orderIsoOfFin t ht (σ ((Finset.orderIsoOfFin s hs).symm ⟨a, has⟩))
172+ have heq : a = b.1 := by
173+ rw [← habs]
174+ simp only [OrderIso.apply_symm_apply]
175+ rw [heq]
176+ exact b.2
177+ · rw [hs, ht]
178+
179+ /-- Let `b` be a basis of `M` indexed by a linearly ordered type `I` and `s` be a finset of `I`
180+ of cardinality `n`. Let `t` be a finset of `I` of cardinality `n` such that `s ≠ t`. If we apply
181+ the linear form on `⋀[R]^n M` defined by `b` and `s` to the exterior product of the
182+ `b i` for `i ∈ t`, then we get `0`. -/
183+ lemma linearFormOfBasis_apply_nondiag {I : Type *} [LinearOrder I] (b : Basis I R M)
184+ {s t : Finset I} (hs : Finset.card s = n) (ht : Finset.card t = n) (hst : s ≠ t) :
185+ linearFormOfBasis b hs (ιMulti_family R n b ⟨t, ht⟩) = 0 := by
186+ simp only [ιMulti_family]
187+ rw [linearFormOfBasis_apply_ιMulti]
188+ apply Finset.sum_eq_zero
189+ intro σ _
190+ have ⟨i, hi⟩ := linearFormOfBasis_apply_nondiag_aux n hs ht hst σ
191+ apply smul_eq_zero_of_right
192+ apply Finset.prod_eq_zero (Finset.mem_univ i)
193+ rw [Basis.coord_apply, Basis.repr_self_apply, if_neg (ne_comm.mp hi)]
115194
116195/-! ### Freeness and dimension of `⋀[ R ] ^n M. -/
117196
118197lemma ιMulti_family_linearIndependent_ofBasis {I : Type *} [LinearOrder I] (b : Basis I R M) :
119- LinearIndependent R (ιMulti_family R n b) := by
120- -- linearIndependent_of_dualFamily _ (fun s ↦ linearFormOfBasis R n b s .2)
121- -- (fun ⟨_, _⟩ ⟨_ , _⟩ hst ↦ by
122- -- rw [ne_eq, Subtype.mk.injEq] at hst
123- -- exact linearFormOfBasis_apply_nondiag _ _ _ _ _ hst)
124- -- (fun ⟨_, _⟩ ↦ linearFormOfBasis_apply_diag _ _ _ _)
125- sorry
198+ LinearIndependent R (ιMulti_family R n b) :=
199+ linearIndependent_of_dualFamily _ (fun st ↦ linearFormOfBasis b st .2 )
200+ (fun ⟨_, _⟩ ⟨_, _⟩ hst ↦ by
201+ rw [ne_eq, Subtype.mk.injEq] at hst
202+ exact linearFormOfBasis_apply_nondiag _ _ _ _ _ hst)
203+ (fun ⟨_, _⟩ ↦ linearFormOfBasis_apply_diag _ _ _ _)
204+
126205
127206noncomputable def basisExteriorPower {I : Type *} [LinearOrder I] (b : Basis I R M) :
128207 Basis {s : Finset I // Finset.card s = n} R (⋀[R]^n M) := by
208+ -- by
209+ -- letI : LinearOrder {s : Finset I // Finset.card s = n} := IsWellFounded.wellOrderExtension emptyWf.rel
210+ -- apply Basis.mk
211+ -- . case hli =>
212+ -- apply ιMulti_family_linearIndependent_ofBasis R
213+
214+ -- #check exteriorPower.toTensorPower R M n
215+
216+ -- sorry
217+ -- . case hsp =>
218+
219+ -- sorry
220+ -- . case v =>
221+ -- -- use linearFormOfBasis
222+
129223
130- -- Basis.mk (ιMulti_family_linearIndependent_ofBasis _ _ _)
131- -- (eq_top_iff.mp <| span_top_of_span_top' R n (Basis.span_eq b))
224+ -- sorry
225+ apply Basis.mk (ιMulti_family_linearIndependent_ofBasis _ _ _)
226+ (eq_top_iff.mp <| span_top_of_span_top' R n (Basis.span_eq b))
132227 sorry
133228
134229-- variable
135230
136231/-- If `M` is a free module, then so is its `n`th exterior power. -/
137232instance instFree [hfree : Module.Free R M] : Module.Free R (⋀[R]^n M) := by
138233 have ⟨I, b⟩ := hfree.exists_basis
139- -- letI : LinearOrder I := IsWellFounded.wellOrderExtension (@WellFoundedRelation.emptyWf I)
140-
141- letI : LinearOrder I := by
142- apply IsWellFounded.wellOrderExtension emptyWf.rel
143-
144-
234+ letI : LinearOrder I := IsWellFounded.wellOrderExtension emptyWf.rel
145235 apply Module.Free.of_basis (basisExteriorPower b)
146236
147-
148-
149237variable [StrongRankCondition R]
150238
151239set_option linter.unusedTactic false
@@ -155,28 +243,10 @@ set_option linter.unusedTactic false
155243the `n`th exterior power of `M` is of finrank `Nat.choose r n`. -/
156244lemma finrank_eq [hfree : Module.Free R M] [Module.Finite R M] :
157245 Module.finrank R (⋀[R]^n M) = Nat.choose (Module.finrank R M) n := by
158- -- have : IsWellFounded ((Module.Free.ChooseBasisIndex R M)) (@emptyWf.wf (Module.Free.ChooseBasisIndex R M)) := by
159-
160- -- letI : LinearOrder hfree.ChooseBasisIndex := by
161- -- apply IsWellFounded.wellOrderExtension (@emptyWf.wf (Module.Free.ChooseBasisIndex R M))
162-
163-
164-
165-
166- have ⟨I, b⟩ := hfree.exists_basis
167- letI lin : LinearOrder I := by sorry
168- let B := @basisExteriorPower R _ M _ _ n I lin b
169- rw [Module.finrank_eq_card_basis hfree.chooseBasis]
170-
171-
172- haveI : Fintype {s : Finset I // s.card = n} := sorry
173- rw [Module.finrank_eq_card_basis B]
174- rw [← Fintype.card_finset_len]
175-
176-
177- sorry
178-
179-
246+ letI : LinearOrder hfree.ChooseBasisIndex := IsWellFounded.wellOrderExtension emptyWf.rel
247+ let B := @basisExteriorPower R _ M _ _ n hfree.ChooseBasisIndex _ hfree.chooseBasis
248+ rw [Module.finrank_eq_card_basis hfree.chooseBasis,
249+ Module.finrank_eq_card_basis B, Fintype.card_finset_len]
180250
181251instance ExteriorAlgebraFinite [E_finite : Module.Finite R E] :
182252 Module.Finite R (ExteriorAlgebra R E) := by
0 commit comments