@@ -12,6 +12,7 @@ import Mathlib.Algebra.Homology.ComplexShape
1212import Mathlib.Algebra.Homology.ShortComplex.Basic
1313import Mathlib.Algebra.DirectSum.Basic
1414import Mathlib.Algebra.DirectSum.Module
15+ import Mathlib.Algebra.Category.ModuleCat.Basic
1516import Mathlib.CategoryTheory.Subobject.Limits
1617import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects
1718import Mathlib.CategoryTheory.GradedObject
@@ -23,15 +24,15 @@ infixr:20 "<∘ₗ>" => LinearMap.comp
2324
2425variable {ι R A M σ : Type *}
2526variable [DecidableEq ι] [AddMonoid ι] [CommRing R] [Semiring A] [Algebra R A]
26- variable [SetLike σ A] [AddSubmonoidClass σ A] (𝒜 : ℕ → σ)
2727variable (I : Ideal R)
2828variable [AddCommGroup M]
2929variable [Module R M]
30- variable [Module.Finite R M] -- allows you to decompose into the direct sum without trouble
30+ -- variable [Module.Finite R M] -- allows you to decompose into the direct sum without trouble
3131
3232universe v u
3333variable {ι : Type *}
3434variable (V : Type u) [Category.{v} V] [HasZeroMorphisms V] [HasZeroObject V]
35+ -- variable (Rmod : Type u) [Category.{v} Rmod] [HasZeroMorphisms Rmod] [HasZeroObject Rmod]
3536variable {c : ComplexShape ℤ}
3637
3738
@@ -78,71 +79,53 @@ noncomputable def trivialHomologicalComplex : HomologicalComplex V c := {
7879
7980open ExteriorAlgebra
8081
82+ -- Koszul complex
83+
84+ #check ModuleCat R -- category of R-mod
85+
8186def mulRight (b : A) : A →ₗ[R] A :=
8287{ toFun := λ a => a * b,
8388 map_add' := λ x y => by exact RightDistribClass.right_distrib x y b,
8489 map_smul' := λ m x => by exact smul_mul_assoc m x b }
8590
8691--lemma linear_of_ext_mul
87- def ext_mul_a' (a : M) : ExteriorAlgebra R M →ₗ[R] ExteriorAlgebra R M :=
92+ @[simp] def ext_mul_a' (a : M) : ExteriorAlgebra R M →ₗ[R] ExteriorAlgebra R M :=
8893 mulRight (ExteriorAlgebra.ι R a)
8994
9095#check ⋀[R]^2 M
91- #check (ExteriorAlgebra.gradedAlgebra R M).toDecomposition.decompose'
92- #check (ExteriorAlgebra.gradedAlgebra R M).toDecomposition
93- #check (DirectSum.lof R ι)
94- #check (DirectSum.component R ℕ)
9596
96- noncomputable def ext_inclusion (i : ℕ) : ⋀[R]^i M →ₗ[R] ExteriorAlgebra R M :=
97+ @[simp] noncomputable def ext_inclusion (i : ℕ) : ⋀[R]^i M →ₗ[R] ExteriorAlgebra R M :=
9798 (⋀[R]^i M).subtype
9899
99- -- noncomputable def ext_proj (i : ℕ) : ExteriorAlgebra R M →ₗ[ R ] ⋀[ R ] ^i M := by
100- -- apply LinearMap.IsProj.codRestrict ?_
101- -- . exact CliffordAlgebra.reverse
102- -- . case _ =>
103- -- refine { map_mem := ?_, map_id := ?_ }
104- -- . intro x
105-
106- -- sorry
107- -- . refine fun x a ↦ ?_
108- -- . sorry
100+ @[simp] noncomputable def ext_proj (i : ℕ) : ExteriorAlgebra R M →ₗ[R] ⋀[R]^i M := {
101+ toFun := fun a => ((ExteriorAlgebra.GradedAlgebra.liftι R M) a) i,
102+ map_add' := λ x y => by simp,
103+ map_smul' := λ m x => by simp; rfl
104+ }
109105
110- #check (DirectSum.component R ι)
111- #check fun (i : ℕ) => (DirectSum.component R ℕ)
112- def ex_extalg : ExteriorAlgebra R M := by sorry
113- #check ((ExteriorAlgebra.gradedAlgebra R M).toDecomposition.decompose' ex_extalg) 3
106+ @[simp] noncomputable def diff_map (i j : ℕ) (a : M) : ⋀[R]^i M →ₗ[R] ⋀[R]^j M :=
107+ (ext_proj j) ∘ₗ (ext_mul_a' a) ∘ₗ (ext_inclusion i)
114108
115- noncomputable def ext_proj' (i : ℕ) : ExteriorAlgebra R M →ₗ[R] ⋀[R]^i M :=
116- {
117- toFun := by
118- intro hx
119109
120- sorry
121- ,
122- map_add' := sorry ,
123- map_smul' := sorry
124- }
110+ -- def KoszulComplexShape : ComplexShape ℕ := {
111+ -- Rel := (fun i j => j = i + 1) ,
112+ -- next_eq := (fun {i j j'} h h' => by subst h h'; rfl ) ,
113+ -- prev_eq := (fun {i i' j} h h' => by subst h; exact Nat.succ_inj'.mp h')
114+ -- }
125115
116+ -- abbrev kcs := KoszulComplexShape
126117
127- noncomputable def diff_map (i : ℕ) (a : M) : ⋀[R]^i M →ₗ[R] ⋀[R]^(i+1 ) M := by
128- (ext_proj (i+1 )) ∘ₗ (ext_mul_a' a) ∘ₗ (ext_inclusion i)
118+ noncomputable def KoszulComplex (a : M) [Module R M] : CochainComplex (ModuleCat R) ℕ := {
119+ X := (fun i => ModuleCat.of R (⋀[R]^i M)),
120+ d := λ i j => if j == i + 1 then ModuleCat.ofHom (diff_map i j a) else 0 ,
121+ shape := fun i j h => by
122+ simp_all; intro h'
123+ exact False.elim (h (id (Eq.symm h'))),
124+ d_comp_d' := by
125+ intro i j k hij hjk
126+ rw [← ExteriorAlgebra.ι_sq_zero a]
129127
130128
131129
132- def KoszulComplexShape : ComplexShape ℤ := {
133- Rel := (fun i j => j = i + 1 ),
134- next_eq := (fun {i j j'} h h' => by subst h h'; rfl ),
135- prev_eq := (fun {i i' j} h h' => by subst h; exact (Int.add_left_inj 1 ).mp h')
130+ sorry
136131}
137- abbrev kcs := KoszulComplexShape
138-
139- /-
140- `[Module.Free R M]` is a typeclass that says `M` is free as an `R`-module.
141- -/
142- noncomputable def KoszulComplex [Module R M] : CochainComplex V ℤ :=
143- {
144- X := (fun i => sorry ),
145- d := (fun d => sorry ),
146- shape := sorry
147- d_comp_d' := sorry
148- }
0 commit comments