roseking commited on
Commit
ae00908
·
verified ·
1 Parent(s): 216fb31

Add lean source and binary files (part 8)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFirstDerivedRetraction.lean +66 -0
  2. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFixedTensorFunctor.lean +86 -0
  3. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFreeTensor.lean +80 -0
  4. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFreeTensorExactness.lean +83 -0
  5. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFullTensorComplex.lean +89 -0
  6. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFullTensorTerms.lean +86 -0
  7. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFunctorExtension.lean +42 -0
  8. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryGenuineBimoduleComparison.lean +78 -0
  9. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryGlobalDimension.lean +41 -0
  10. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryIntegerResolution.lean +74 -0
  11. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryLeftTensorCongruence.lean +27 -0
  12. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryLeftTensorMaps.lean +43 -0
  13. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryMiddleTensorFunctors.lean +83 -0
  14. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalComplex.lean +44 -0
  15. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalComplexMaps.lean +43 -0
  16. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalForget.lean +66 -0
  17. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalMaps.lean +31 -0
  18. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalObjects.lean +50 -0
  19. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalProjective.lean +52 -0
  20. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalSingle.lean +45 -0
  21. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryPairComplex.lean +86 -0
  22. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryPairQuasiIso.lean +74 -0
  23. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductComponent.lean +101 -0
  24. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductDimension.lean +46 -0
  25. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductOpposite.lean +49 -0
  26. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductProjective.lean +61 -0
  27. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductSecondDimension.lean +52 -0
  28. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductSplitting.lean +101 -0
  29. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProjectiveTensor.lean +98 -0
  30. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryResolutionComplex.lean +85 -0
  31. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryResolutionExact.lean +69 -0
  32. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryResolutionModels.lean +68 -0
  33. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryResolutionQuasiIso.lean +155 -0
  34. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryRestrictionHomology.lean +30 -0
  35. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryRetainedBimodule.lean +57 -0
  36. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryRetainedCongruence.lean +42 -0
  37. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryRetainedRestriction.lean +54 -0
  38. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryRightProjective.lean +36 -0
  39. lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySecondBlockTensor.lean +102 -0
  40. lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySecondBlockTotal.lean +113 -0
  41. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryShiftDerivedTensor.lean +44 -0
  42. lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryShiftSign.lean +49 -0
  43. lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySignedExactness.lean +35 -0
  44. lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySimulationComparison.lean +75 -0
  45. lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySingleTensorTerms.lean +99 -0
  46. lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySingleTensorTotal.lean +84 -0
  47. lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySourceBimoduleTotal.lean +35 -0
  48. lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySourceDerivedComparison.lean +42 -0
  49. lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySourceResolutionModels.lean +80 -0
  50. lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySupportedExtension.lean +53 -0
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFirstDerivedRetraction.lean ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryFirstDerivedCompatibility
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryFirstComponentExact
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory CategoryTheory.Limits
7
+ namespace LittleFinitistic.BlockModule
8
+ universe u
9
+ variable (L R : Type u) [Ring L] [Ring R]
10
+ variable [HasDerivedCategory.{u+1} (ModuleCat.{u} L)]
11
+ variable [HasDerivedCategory.{u+1} (ModuleCat.{u} (L × R))]
12
+
13
+ /-- The exact derived first-component functor on the whole product-ring derived category. -/
14
+ abbrev derivedFirstComponent := (ProductModules.firstFunctor.{u,u} L R).mapDerivedCategory
15
+
16
+ def firstComplexComponentIso : firstComplexFunctor L R ⋙
17
+ (ProductModules.firstFunctor L R).mapHomologicalComplex (.up ℤ) ≅
18
+ 𝟭 (CochainComplex (ModuleCat.{u} L) ℤ) :=
19
+ Functor.mapHomologicalComplexCompIso (ProductModules.firstInflationComponentIso L R) (.up ℤ) ≪≫
20
+ Functor.mapHomologicalComplexIdIso (ModuleCat.{u} L) (.up ℤ)
21
+
22
+ /-- On chain representatives, the composite is the identity localization. -/
23
+ def derivedFirstComponentFactors : DerivedCategory.Q ⋙ derivedFirst L R ⋙
24
+ derivedFirstComponent L R ≅ (DerivedCategory.Q : CochainComplex (ModuleCat.{u} L) ℤ ⥤ _) :=
25
+ (Functor.associator ..).symm ≪≫
26
+ Functor.isoWhiskerRight (derivedFirstComparison L R) _ ≪≫
27
+ Functor.associator .. ≪≫
28
+ Functor.isoWhiskerLeft _ (ProductModules.firstFunctor L R).mapDerivedCategoryFactors ≪≫
29
+ (Functor.associator ..).symm ≪≫
30
+ Functor.isoWhiskerRight (firstComplexComponentIso L R) _ ≪≫ Functor.leftUnitor _
31
+
32
+ /-- Taking the first component recovers every derived object, naturally. -/
33
+ def derivedFirstRetraction : derivedFirst L R ⋙ derivedFirstComponent L R ≅
34
+ 𝟭 (DerivedCategory (ModuleCat.{u} L)) := by
35
+ letI : Localization.Lifting DerivedCategory.Q
36
+ (HomologicalComplex.quasiIso (ModuleCat.{u} L) (.up ℤ)) DerivedCategory.Q
37
+ (derivedFirst L R ⋙ derivedFirstComponent L R) := ⟨derivedFirstComponentFactors L R⟩
38
+ exact Localization.liftNatIso DerivedCategory.Q
39
+ (HomologicalComplex.quasiIso (ModuleCat.{u} L) (.up ℤ))
40
+ DerivedCategory.Q DerivedCategory.Q _ _ (Iso.refl _)
41
+
42
+ /-- The same retraction for mathlib's exact derived inflation. -/
43
+ def exactFirstRetraction : (ProductModules.firstInflation L R).mapDerivedCategory ⋙
44
+ derivedFirstComponent L R ≅ 𝟭 (DerivedCategory (ModuleCat.{u} L)) :=
45
+ Functor.isoWhiskerRight (derivedFirstIso L R).symm _ ≪≫ derivedFirstRetraction L R
46
+
47
+ instance derivedFirst_additive : (derivedFirst L R).Additive :=
48
+ Functor.additive_of_iso (derivedFirstIso L R).symm
49
+
50
+ /-- No derived object becomes zero merely by putting it in the first block. -/
51
+ theorem derivedFirst_isZero_iff (Y : DerivedCategory (ModuleCat.{u} L)) :
52
+ IsZero ((derivedFirst L R).obj Y) ↔ IsZero Y := by
53
+ constructor
54
+ · intro h
55
+ exact ((derivedFirstRetraction L R).app Y).isZero_iff.mp
56
+ ((derivedFirstComponent L R).map_isZero h)
57
+ · exact (derivedFirst L R).map_isZero
58
+
59
+ theorem exactFirst_isZero_iff (Y : DerivedCategory (ModuleCat.{u} L)) :
60
+ IsZero ((ProductModules.firstInflation L R).mapDerivedCategory.obj Y) ↔ IsZero Y :=
61
+ ((derivedFirstIso L R).app Y).isZero_iff.symm.trans (derivedFirst_isZero_iff L R Y)
62
+ end LittleFinitistic.BlockModule
63
+
64
+ end
65
+
66
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFixedTensorFunctor.lean ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryTensorExactness
2
+ import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings
3
+ import Mathlib.Algebra.Homology.ShortComplex.ModuleCat
4
+ import Mathlib.CategoryTheory.Abelian.Exact
5
+ import Mathlib.Algebra.Homology.QuasiIso
6
+
7
+ namespace OAI
8
+ noncomputable section
9
+ open CategoryTheory
10
+ namespace LittleFinitistic.BalancedTensor
11
+ universe u
12
+ variable (k A : Type u) [Field k] [Ring A] [Algebra k A]
13
+
14
+ abbrev ScalarLeftModule (N : ModuleCat.{u} A) :=
15
+ (ModuleCat.restrictScalars (algebraMap k A)).obj N
16
+
17
+ instance scalarLeftTower (N : ModuleCat.{u} A) : IsScalarTower k A (ScalarLeftModule k A N) where
18
+ smul_assoc r a n := by
19
+ change (r • a) • (n : N) = algebraMap k A r • (a • (n : N))
20
+ rw [Algebra.smul_def,mul_smul]
21
+
22
+ variable (M : Type u) [AddCommGroup M] [Module k M] [Module Aᵐᵒᵖ M]
23
+
24
+ /-- Tensor by a fixed actual right module on every left module. -/
25
+ def fixedTensorFunctor : ModuleCat.{u} A ⥤ ModuleCat.{u} k where
26
+ obj N := ModuleCat.of k (Tensor k A M (ScalarLeftModule k A N))
27
+ map {N N'} f := ModuleCat.ofHom
28
+ (mapRightTo (k := k) (M := M) (N := ScalarLeftModule k A N) (N' := ScalarLeftModule k A N') f.hom)
29
+ map_id N := by
30
+ apply ModuleCat.hom_ext
31
+ apply BalancedTensor.ext
32
+ intro m n
33
+ rfl
34
+ map_comp f g := by
35
+ apply ModuleCat.hom_ext
36
+ apply BalancedTensor.ext
37
+ intro m n
38
+ rfl
39
+
40
+ instance fixedTensorFunctor_additive : (fixedTensorFunctor k A M).Additive where
41
+ map_add {N N'} {f g} := by
42
+ apply ModuleCat.hom_ext
43
+ apply BalancedTensor.ext
44
+ intro m n
45
+ exact (mk k A M (ScalarLeftModule k A N') m).map_add (f.hom n) (g.hom n)
46
+
47
+ variable (e : A) (he : e*e=e)
48
+
49
+ include he in
50
+ theorem idempotentTensor_mapsExact (S : ShortComplex (ModuleCat.{u} A)) (hS : S.Exact) :
51
+ (S.map (fixedTensorFunctor k A (IdempotentTensor.rightIdeal e))).Exact := by
52
+ rw [ShortComplex.moduleCat_exact_iff]
53
+ have h : Function.Exact
54
+ (S.f.hom : ScalarLeftModule k A S.X₁ →ₗ[A] ScalarLeftModule k A S.X₂)
55
+ (S.g.hom : ScalarLeftModule k A S.X₂ →ₗ[A] ScalarLeftModule k A S.X₃) := by
56
+ intro n
57
+ constructor
58
+ · exact (ShortComplex.moduleCat_exact_iff S).mp hS n
59
+ · rintro ⟨m,rfl⟩
60
+ exact congrArg (fun f => f.hom m) S.zero
61
+ have ht := @IdempotentTensor.tensor_exact k A
62
+ (ScalarLeftModule k A S.X₁) (ScalarLeftModule k A S.X₂) (ScalarLeftModule k A S.X₃)
63
+ _ _ _ _ _ _ (scalarLeftTower k A S.X₁)
64
+ _ _ _ (scalarLeftTower k A S.X₂) _ _ _ (scalarLeftTower k A S.X₃)
65
+ e he S.f.hom S.g.hom h
66
+ intro z hz
67
+ exact (ht z).mp hz
68
+
69
+ include he in
70
+ /-- Derived input complexes remain arbitrary: this functor preserves homology. -/
71
+ theorem idempotentTensor_preservesHomology :
72
+ (fixedTensorFunctor k A (IdempotentTensor.rightIdeal e)).PreservesHomology :=
73
+ Functor.preservesHomology_of_map_exact _ (idempotentTensor_mapsExact k A e he)
74
+
75
+ include he in
76
+ /-- No boundedness, dimension, projectivity, or flatness hypothesis on either input complex. -/
77
+ theorem idempotentTensor_quasiIso
78
+ {Z Z' : CochainComplex (ModuleCat.{u} A) ℤ} (f : Z ⟶ Z') [QuasiIso f] :
79
+ QuasiIso (((fixedTensorFunctor k A (IdempotentTensor.rightIdeal e)).mapHomologicalComplex (.up ℤ)).map f) := by
80
+ let := idempotentTensor_preservesHomology k A e he
81
+ infer_instance
82
+ end LittleFinitistic.BalancedTensor
83
+
84
+ end
85
+
86
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFreeTensor.lean ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryTensorExactness
2
+ import Mathlib.LinearAlgebra.Finsupp.LSum
3
+ import Mathlib.Algebra.Algebra.Opposite
4
+
5
+ namespace OAI
6
+ noncomputable section
7
+ namespace LittleFinitistic.BalancedTensor.Free
8
+ universe u
9
+ variable {k A : Type u} [Field k] [Ring A] [Algebra k A]
10
+ variable (I N : Type u) [AddCommGroup N] [Module k N] [Module A N] [IsScalarTower k A N]
11
+
12
+ /-- A right-regular coefficient acts on the left tensor factor by its unop. -/
13
+ def coefficientAction : Aᵐᵒᵖ →ₗ[k] N →ₗ[k] N :=
14
+ (Algebra.lsmul k k N).toLinearMap.comp (MulOpposite.opLinearEquiv k).symm.toLinearMap
15
+
16
+ /-- Coordinate evaluation of a free right module tensor N. -/
17
+ def evaluateBilinear : (I →₀ Aᵐᵒᵖ) →ₗ[k] N →ₗ[k] (I →₀ N) :=
18
+ Finsupp.lsum k (fun i => (coefficientAction (k := k) (A := A) N).compr₂ (Finsupp.lsingle i))
19
+
20
+ @[simp] theorem evaluateBilinear_single (i : I) (x : Aᵐᵒᵖ) (n : N) :
21
+ evaluateBilinear (k := k) I N (Finsupp.single i x) n = Finsupp.single i (x.unop • n) := by
22
+ simp only [evaluateBilinear,Finsupp.lsum_single]
23
+ rfl
24
+
25
+ def evaluation : Tensor k A (I →₀ Aᵐᵒᵖ) N →ₗ[k] (I →₀ N) :=
26
+ lift (evaluateBilinear (k := k) I N) (by
27
+ intro a m n
28
+ induction m using Finsupp.induction_linear with
29
+ | zero => simp only [smul_zero,map_zero,LinearMap.zero_apply]
30
+ | add x y hx hy => simp only [smul_add,map_add,LinearMap.add_apply,hx,hy]
31
+ | single i x =>
32
+ rw [Finsupp.smul_single,evaluateBilinear_single,evaluateBilinear_single]
33
+ change Finsupp.single i ((x.unop*a) • n) = Finsupp.single i (x.unop • (a • n))
34
+ rw [mul_smul])
35
+
36
+ @[simp] theorem evaluation_single (i : I) (x : Aᵐᵒᵖ) (n : N) :
37
+ evaluation (k := k) I N (mk k A (I →₀ Aᵐᵒᵖ) N (Finsupp.single i x) n) =
38
+ Finsupp.single i (x.unop • n) := evaluateBilinear_single I N i x n
39
+
40
+ def insertion : (I →₀ N) →ₗ[k] Tensor k A (I →₀ Aᵐᵒᵖ) N :=
41
+ Finsupp.lsum k (fun i => mk k A (I →₀ Aᵐᵒᵖ) N (Finsupp.single i 1))
42
+
43
+ omit [IsScalarTower k A N] in
44
+ @[simp] theorem insertion_single (i : I) (n : N) :
45
+ insertion (k := k) (A := A) I N (Finsupp.single i n) =
46
+ mk k A (I →₀ Aᵐᵒᵖ) N (Finsupp.single i 1) n := by
47
+ simp only [insertion,Finsupp.lsum_single]
48
+
49
+ theorem evaluation_insertion (z : I →₀ N) :
50
+ evaluation (k := k) (A := A) I N (insertion I N z) = z := by
51
+ induction z using Finsupp.induction_linear with
52
+ | zero => simp only [map_zero]
53
+ | add x y hx hy => simp only [map_add,hx,hy]
54
+ | single i n => rw [insertion_single,evaluation_single,MulOpposite.unop_one,one_smul]
55
+
56
+ theorem insertion_evaluation (z : Tensor k A (I →₀ Aᵐᵒᵖ) N) :
57
+ insertion I N (evaluation (k := k) I N z) = z := by
58
+ induction z using BalancedTensor.induction_on with
59
+ | hz => simp only [map_zero]
60
+ | ht m n =>
61
+ induction m using Finsupp.induction_linear with
62
+ | zero => simp only [map_zero,LinearMap.zero_apply]
63
+ | add x y hx hy => simp only [map_add,LinearMap.add_apply,hx,hy]
64
+ | single i x =>
65
+ rw [evaluation_single,insertion_single,← balance]
66
+ congr 1
67
+ rw [MulOpposite.op_unop,Finsupp.smul_single,smul_eq_mul,mul_one]
68
+ | ha x y hx hy => simp only [map_add,hx,hy]
69
+
70
+ /-- The actual free balanced tensor, for arbitrary index sets and arbitrary modules N. -/
71
+ def equivalence : Tensor k A (I →₀ Aᵐᵒᵖ) N ≃ₗ[k] (I →₀ N) where
72
+ __ := evaluation (k := k) I N
73
+ invFun := insertion I N
74
+ left_inv := insertion_evaluation I N
75
+ right_inv := evaluation_insertion I N
76
+ end LittleFinitistic.BalancedTensor.Free
77
+
78
+ end
79
+
80
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFreeTensorExactness.lean ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryFreeTensor
2
+ import Mathlib.LinearAlgebra.Finsupp.Defs
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ namespace LittleFinitistic.BalancedTensor.Free
7
+ universe u
8
+ variable {k A : Type u} [Field k] [Ring A] [Algebra k A]
9
+ variable (I : Type u)
10
+ variable {N N' N'' : Type u}
11
+ variable [AddCommGroup N] [Module k N] [Module A N] [IsScalarTower k A N]
12
+ variable [AddCommGroup N'] [Module k N'] [Module A N'] [IsScalarTower k A N']
13
+ variable [AddCommGroup N''] [Module k N''] [Module A N''] [IsScalarTower k A N'']
14
+
15
+ theorem evaluation_naturality (f : N →ₗ[A] N') (z : Tensor k A (I →₀ Aᵐᵒᵖ) N) :
16
+ evaluation (k := k) I N' (mapRightTo f z) =
17
+ Finsupp.mapRange.linearMap (f.restrictScalars k) (evaluation (k := k) I N z) := by
18
+ induction z using BalancedTensor.induction_on with
19
+ | hz => simp only [map_zero]
20
+ | ht m n =>
21
+ induction m using Finsupp.induction_linear with
22
+ | zero => simp only [map_zero,LinearMap.zero_apply]
23
+ | add x y hx hy => simp only [map_add,LinearMap.add_apply,hx,hy]
24
+ | single i x =>
25
+ simp only [mapRightTo_mk,evaluation_single]
26
+ change Finsupp.single i (MulOpposite.unop x • f n) =
27
+ Finsupp.mapRange f f.map_zero (Finsupp.single i (MulOpposite.unop x • n))
28
+ rw [Finsupp.mapRange_single, f.map_smul]
29
+ | ha x y hx hy => simp only [map_add,hx,hy]
30
+
31
+ /-- Direct sums preserve exactness, with a preimage supported on the given finite support. -/
32
+ theorem finsupp_exact (f : N →ₗ[A] N') (g : N' →ₗ[A] N'') (h : Function.Exact f g) :
33
+ Function.Exact (Finsupp.mapRange.linearMap (f.restrictScalars k) : (I →₀ N) →ₗ[k] (I →₀ N'))
34
+ (Finsupp.mapRange.linearMap (g.restrictScalars k)) := by
35
+ classical
36
+ intro z
37
+ constructor
38
+ · intro hz
39
+ have hg (i : I) : g (z i) = 0 := congrArg (fun x : I →₀ N'' => x i) hz
40
+ let y : I →₀ N := Finsupp.onFinset z.support
41
+ (fun i => if hi : z i = 0 then 0 else Classical.choose ((h (z i)).mp (hg i))) (by
42
+ intro i hi
43
+ by_contra hn
44
+ have hz0 : z i = 0 := by simpa only [Finsupp.mem_support_iff,not_not] using hn
45
+ exact hi (by simp [hz0]))
46
+ refine ⟨y, ?_⟩
47
+ ext i
48
+ change f (if hi : z i = 0 then 0 else Classical.choose ((h (z i)).mp (hg i))) = z i
49
+ split_ifs with hi
50
+ · rw [map_zero,hi]
51
+ · exact Classical.choose_spec ((h (z i)).mp (hg i))
52
+ · rintro ⟨y,rfl⟩
53
+ ext i
54
+ exact (h (f (y i))).mpr ⟨y i,rfl⟩
55
+
56
+ /-- Tensor by an arbitrary free right module preserves every exact module sequence. -/
57
+ theorem tensor_exact (f : N →ₗ[A] N') (g : N' →ₗ[A] N'') (h : Function.Exact f g) :
58
+ Function.Exact (mapRightTo (k := k) (M := I →₀ Aᵐᵒᵖ) f)
59
+ (mapRightTo (k := k) (M := I →₀ Aᵐᵒᵖ) g) := by
60
+ intro z
61
+ constructor
62
+ · intro hz
63
+ have hz' : Finsupp.mapRange.linearMap (g.restrictScalars k) (evaluation (k := k) I N' z) = 0 := by
64
+ rw [← evaluation_naturality,hz,map_zero]
65
+ obtain ⟨y,hy⟩ := (finsupp_exact (k := k) I f g h _).mp hz'
66
+ refine ⟨(equivalence (k := k) (A := A) I N).symm y, ?_⟩
67
+ apply (equivalence (k := k) (A := A) I N').injective
68
+ change evaluation (k := k) I N' (mapRightTo f ((equivalence (k := k) (A := A) I N).symm y)) = _
69
+ rw [evaluation_naturality]
70
+ change Finsupp.mapRange.linearMap (f.restrictScalars k)
71
+ ((equivalence (k := k) (A := A) I N) ((equivalence (k := k) (A := A) I N).symm y)) = _
72
+ rw [LinearEquiv.apply_symm_apply]
73
+ exact hy
74
+ · rintro ⟨y,rfl⟩
75
+ induction y using BalancedTensor.induction_on with
76
+ | hz => simp only [map_zero]
77
+ | ht m n => rw [mapRightTo_mk,mapRightTo_mk,(h (f n)).mpr ⟨n,rfl⟩,map_zero]
78
+ | ha x y hx hy => simp only [map_add,hx,hy,add_zero]
79
+ end LittleFinitistic.BalancedTensor.Free
80
+
81
+ end
82
+
83
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFullTensorComplex.lean ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryFullTensorTerms
2
+ import Mathlib.Algebra.Homology.Embedding.Restriction
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory Limits
7
+ open scoped TensorProduct
8
+ namespace LittleFinitistic.OrdinarySimulation.FullTensorTerm
9
+ universe u
10
+ variable {k B : Type u} [Field k] [Ring B] [Algebra k B]
11
+ variable (P : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ) (a : ℤ) (l : ℕ)
12
+ attribute [local instance] VertexTensor.termScalar VertexTensor.termTower
13
+
14
+ def differential (n : ℕ) : FullTensorTerm P a l n →ₗ[Enveloping k B] FullTensorTerm P a l (n+1) :=
15
+ TwoSidedTensor.map (T := Bᵐᵒᵖ) (N := BimoduleO P a l)
16
+ (TensorResolution.differential k B l n) (TensorResolution.differential_left k B l n)
17
+
18
+ theorem differential_square (n : ℕ) : (differential P a l (n+1)).comp (differential P a l n) = 0 := by
19
+ apply LinearMap.restrictScalars_injective k
20
+ apply BalancedTensor.ext
21
+ intro m v
22
+ change BalancedTensor.mk k (B ⊗[k] ChainAlgebra k l) (TensorResolution.term k B l (n+2))
23
+ (BimoduleO P a l) (TensorResolution.differential k B l (n+1)
24
+ (TensorResolution.differential k B l n m)) v = 0
25
+ have h := congrArg (fun f => f m) (TensorResolution.differential_square k B l n)
26
+ change TensorResolution.differential k B l (n+1) (TensorResolution.differential k B l n m) = 0 at h
27
+ rw [h,map_zero,LinearMap.zero_apply]
28
+
29
+ /-- Actual tensor complex, with both B-actions and the actual extended arrow maps. -/
30
+ def complex : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℕ :=
31
+ CochainComplex.of (fun n => ModuleCat.of _ (FullTensorTerm P a l n))
32
+ (fun n => ModuleCat.ofHom (differential P a l n))
33
+ (fun n => ModuleCat.hom_ext (differential_square P a l n))
34
+
35
+ /-- Supported evaluation is the product action followed by the source coordinate projection. -/
36
+ theorem supportedEquiv_mk (n : ℕ) (hn : n ≤ l) (m : TensorResolution.term k B l n) (v : BimoduleO P a l) :
37
+ supportedEquiv P a l n hn
38
+ (TwoSidedTensor.mk k (B ⊗[k] ChainAlgebra k l) B Bᵐᵒᵖ (TensorResolution.term k B l n) (BimoduleO P a l) m v) =
39
+ (m.val • v : BimoduleO P a l) ⟨n,by omega⟩ := rfl
40
+
41
+ theorem supported_differential (n : ℕ) (hn : n+1 ≤ l) (z : FullTensorTerm P a l n) :
42
+ supportedEquiv P a l (n+1) hn (differential P a l n z) =
43
+ (P.d (a+(n:ℤ)) (a+((n+1:ℕ):ℤ))).hom (supportedEquiv P a l n (by omega) z) := by
44
+ have h : (supportedEquiv P a l (n+1) hn).toLinearMap.comp (differential P a l n) =
45
+ (P.d (a+(n:ℤ)) (a+((n+1:ℕ):ℤ))).hom.comp
46
+ (supportedEquiv P a l n (by omega)).toLinearMap := by
47
+ apply LinearMap.restrictScalars_injective k
48
+ apply BalancedTensor.ext
49
+ intro m v
50
+ change ((((1:B) ⊗ₜ[k] ChainAlgebra.extendedArrow k l n) * m.val) • v : BimoduleO P a l) ⟨n+1,by omega⟩ =
51
+ (P.d (a+(n:ℤ)) (a+((n+1:ℕ):ℤ))).hom ((m.val • v : BimoduleO P a l) ⟨n,by omega⟩)
52
+ have hv : (((1:B) ⊗ₜ[k] ChainAlgebra.extendedArrow k l n) * m.val) • v =
53
+ ChainAlgebra.arrow k l ⟨n,by omega⟩ • (m.val • v) := by
54
+ rw [mul_smul,BimoduleO.tensor_smul,one_smul,ChainAlgebra.extendedArrow,dite_eq_left (by omega)]
55
+ exact (congrArg (fun w : BimoduleO P a l => w ⟨n+1,by omega⟩) hv).trans
56
+ (VertexTensor.arrow_coordinate P a l ⟨n,by omega⟩ (m.val • v))
57
+ exact congrArg (fun f => f z) h
58
+
59
+ variable (hP : ∀ n : ℕ, l < n → IsZero (P.X (a+(n:ℤ))))
60
+
61
+ theorem termEquiv_differential (n : ℕ) (z : FullTensorTerm P a l n) :
62
+ termEquiv P a l hP (n+1) (differential P a l n z) =
63
+ (P.d (a+(n:ℤ)) (a+((n+1:ℕ):ℤ))).hom (termEquiv P a l hP n z) := by
64
+ by_cases hn : n+1 ≤ l
65
+ · simp only [termEquiv,dite_eq_left hn,dite_eq_left (show n ≤ l by omega)]
66
+ exact supported_differential P a l n hn z
67
+ · let : Subsingleton (P.X (a+((n+1:ℕ):ℤ))) :=
68
+ ModuleCat.isZero_iff_subsingleton.mp (hP (n+1) (by omega))
69
+ exact Subsingleton.elim _ _
70
+
71
+ /-- The entire actual tensor complex identifies with P on degrees a,a+1,... . -/
72
+ def complexIso : complex P a l ≅ P.restriction (ComplexShape.embeddingUpIntGE a) :=
73
+ HomologicalComplex.Hom.isoOfComponents (fun n => (termEquiv P a l hP n).toModuleIso) (by
74
+ intro n m hnm
75
+ change n+1=m at hnm
76
+ subst m
77
+ change (termEquiv P a l hP n).toModuleIso.hom ≫ P.d (a+(n:ℤ)) (a+((n+1:ℕ):ℤ)) =
78
+ CochainComplex.of.d (fun j => ModuleCat.of (Enveloping k B) (FullTensorTerm P a l j))
79
+ (fun j => ModuleCat.ofHom (differential P a l j)) n (n+1) ≫ (termEquiv P a l hP (n+1)).toModuleIso.hom
80
+ rw [CochainComplex.of_d]
81
+ apply ModuleCat.hom_ext
82
+ apply LinearMap.ext
83
+ intro z
84
+ exact (termEquiv_differential P a l hP n z).symm)
85
+ end LittleFinitistic.OrdinarySimulation.FullTensorTerm
86
+
87
+ end
88
+
89
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFullTensorTerms.lean ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryTwoSidedTensor
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryTensorDifferential
3
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryIntegerResolution
4
+
5
+ namespace OAI
6
+ noncomputable section
7
+ open CategoryTheory Limits
8
+ open scoped TensorProduct
9
+ namespace LittleFinitistic.OrdinarySimulation
10
+ universe u
11
+ variable {k B : Type u} [Field k] [Ring B] [Algebra k B]
12
+ variable (P : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ) (a : ℤ) (l : ℕ)
13
+
14
+ instance BimoduleO.commuteRightTensor : SMulCommClass Bᵐᵒᵖ (B ⊗[k] ChainAlgebra k l) (BimoduleO P a l) :=
15
+ ⟨fun r x v => (smul_comm x r v).symm⟩
16
+
17
+ /-- Every degree of Q_T tensor_BC O, carrying the actual outside B-actions. -/
18
+ abbrev FullTensorTerm (n : ℕ) := TwoSidedTensor k (B ⊗[k] ChainAlgebra k l) B Bᵐᵒᵖ
19
+ (TensorResolution.term k B l n) (BimoduleO P a l)
20
+
21
+ namespace FullTensorTerm
22
+ open ChainAlgebra
23
+
24
+ /-- Supported extended ideals are the same right ideals as the finite vertex terms. -/
25
+ def supportedIdealEquiv (n : ℕ) (hn : n ≤ l) :
26
+ TensorResolution.term k B l n ≃ₗ[(B ⊗[k] ChainAlgebra k l)ᵐᵒᵖ]
27
+ IdempotentTensor.rightIdeal (TensorIdeal.vertex (k := k) (B := B) (vertex k l ⟨n,by omega⟩)) where
28
+ toFun x := ⟨x.val, by
29
+ have hx := x.property
30
+ change TensorIdeal.vertex (k := k) (B := B) (extendedVertex k l n) * x.val = x.val at hx
31
+ rw [extendedVertex,dite_eq_left hn] at hx
32
+ exact hx⟩
33
+ invFun x := ⟨x.val, by
34
+ change TensorIdeal.vertex (k := k) (B := B) (extendedVertex k l n) * x.val = x.val
35
+ rw [extendedVertex,dite_eq_left hn]
36
+ exact x.property⟩
37
+ left_inv _ := rfl
38
+ right_inv _ := rfl
39
+ map_add' _ _ := rfl
40
+ map_smul' _ _ := rfl
41
+
42
+ def finiteModel (i : Fin (l+1)) :
43
+ TwoSidedTensor k (B ⊗[k] ChainAlgebra k l) B Bᵐᵒᵖ
44
+ (IdempotentTensor.rightIdeal (TensorIdeal.vertex (k := k) (B := B) (vertex k l i)))
45
+ (BimoduleO P a l) ≃ₗ[Enveloping k B] VertexTensor P a l i where
46
+ toFun z := z
47
+ invFun z := z
48
+ left_inv _ := rfl
49
+ right_inv _ := rfl
50
+ map_add' _ _ := rfl
51
+ map_smul' _ _ := rfl
52
+
53
+ /-- Actual degreewise B-bimodule comparison throughout the supported range. -/
54
+ def supportedEquiv (n : ℕ) (hn : n ≤ l) : FullTensorTerm P a l n ≃ₗ[Enveloping k B] P.X (a+(n:ℤ)) :=
55
+ (TwoSidedTensor.congrLeft (k := k) (S := B) (T := Bᵐᵒᵖ) (N := BimoduleO P a l)
56
+ (supportedIdealEquiv (k := k) (B := B) l n hn) (fun _ _ => rfl)).trans
57
+ ((finiteModel P a l ⟨n,by omega⟩).trans (VertexTensor.bimoduleEquiv P a l ⟨n,by omega⟩))
58
+
59
+ theorem subsingleton_above (n : ℕ) (hn : l < n) : Subsingleton (FullTensorTerm P a l n) := by
60
+ let : Subsingleton (TensorResolution.term k B l n) :=
61
+ (ModuleCat.isZero_iff_subsingleton).mp (TensorResolution.term_vanishes k B l n hn)
62
+ exact inferInstanceAs (Subsingleton (BalancedTensor.Tensor k (B ⊗[k] ChainAlgebra k l)
63
+ (TensorResolution.term k B l n) (BimoduleO P a l)))
64
+
65
+ /-- Use precisely the source's upper support bound for all remaining degrees. -/
66
+ def outsideEquiv (n : ℕ) (hn : l < n) (hP : IsZero (P.X (a+(n:ℤ)))) :
67
+ FullTensorTerm P a l n ≃ₗ[Enveloping k B] P.X (a+(n:ℤ)) := by
68
+ letI := subsingleton_above P a l n hn
69
+ letI : Subsingleton (P.X (a+(n:ℤ))) := ModuleCat.isZero_iff_subsingleton.mp hP
70
+ exact { toFun := fun _ => 0
71
+ invFun := fun _ => 0
72
+ left_inv := fun _ => Subsingleton.elim _ _
73
+ right_inv := fun _ => Subsingleton.elim _ _
74
+ map_add' := fun _ _ => Subsingleton.elim _ _
75
+ map_smul' := fun _ _ => Subsingleton.elim _ _ }
76
+
77
+ /-- No extra support assumptions: P is required to vanish only above a+l here. -/
78
+ def termEquiv (hP : ∀ n : ℕ, l < n → IsZero (P.X (a+(n:ℤ)))) (n : ℕ) :
79
+ FullTensorTerm P a l n ≃ₗ[Enveloping k B] P.X (a+(n:ℤ)) :=
80
+ if hn : n ≤ l then supportedEquiv P a l n hn else outsideEquiv P a l n (by omega) (hP n (by omega))
81
+ end FullTensorTerm
82
+ end LittleFinitistic.OrdinarySimulation
83
+
84
+ end
85
+
86
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryFunctorExtension.lean ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinarySupportedExtension
2
+ import Mathlib.Algebra.Homology.Additive
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory Limits
7
+ namespace LittleFinitistic.FunctorExtension
8
+ universe u v u' v' w w'
9
+ variable {C : Type u} [Category.{v} C] [HasZeroMorphisms C] [HasZeroObject C]
10
+ variable {D : Type u'} [Category.{v'} D] [HasZeroMorphisms D] [HasZeroObject D]
11
+ variable (F : C ⥤ D) [F.PreservesZeroMorphisms]
12
+ variable {I : Type w} {J : Type w'} {c : ComplexShape I} {c' : ComplexShape J}
13
+ variable (K : HomologicalComplex C c) (e : c.Embedding c') [e.IsRelIff]
14
+
15
+ omit [HasZeroObject D] [e.IsRelIff] in
16
+ /-- Mapping an extended complex retains its proved zero terms outside the embedded degrees. -/
17
+ theorem mappedSupport : ((F.mapHomologicalComplex c').obj (K.extend e)).IsStrictlySupported e where
18
+ isZero j hj := F.map_isZero (K.isZero_extend_X e j hj)
19
+
20
+ /-- On the actual supported degrees, mapping and extension have the same original terms. -/
21
+ def restrictionIso : ((F.mapHomologicalComplex c').obj (K.extend e)).restriction e ≅
22
+ (F.mapHomologicalComplex c).obj K :=
23
+ HomologicalComplex.Hom.isoOfComponents (fun i => F.mapIso (K.extendXIso e (i := i) rfl)) (by
24
+ intro i j _
25
+ change F.map (K.extendXIso e (i := i) rfl).hom ≫ F.map (K.d i j) =
26
+ F.map ((K.extend e).d (e.f i) (e.f j)) ≫ F.map (K.extendXIso e (i := j) rfl).hom
27
+ rw [← F.map_comp,← F.map_comp]
28
+ congr 1
29
+ rw [HomologicalComplex.extend_d_eq _ _ rfl rfl]
30
+ simp only [Category.assoc,Iso.inv_hom_id,Category.comp_id])
31
+
32
+ /-- An actual chain isomorphism commuting a zero-preserving functor with extension by zero. -/
33
+ def iso : (F.mapHomologicalComplex c').obj (K.extend e) ≅
34
+ ((F.mapHomologicalComplex c).obj K).extend e := by
35
+ letI := mappedSupport F K e
36
+ exact (OrdinarySimulation.SupportedExtension.iso ((F.mapHomologicalComplex c').obj (K.extend e)) e).symm ≪≫
37
+ (e.extendFunctor D).mapIso (restrictionIso F K e)
38
+ end LittleFinitistic.FunctorExtension
39
+
40
+ end
41
+
42
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryGenuineBimoduleComparison.lean ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimoduleTensorFunctor
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryTensorBimoduleResolution
3
+ import OAI.Algebra.Finitistic.Ordinary.OrdinarySimulationComparison
4
+
5
+ namespace OAI
6
+ noncomputable section
7
+ open CategoryTheory Limits
8
+ open scoped TensorProduct
9
+ namespace LittleFinitistic.OrdinarySimulation
10
+ universe u
11
+ variable {k B : Type u} [Field k] [Ring B] [Algebra k B]
12
+ variable (P : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ) (a : ℤ) (l : ℕ)
13
+
14
+ abbrev genuineTensorFunctor :=
15
+ bimoduleTensorFunctor k B (B ⊗[k] ChainAlgebra k l) Bᵐᵒᵖ (BimoduleO P a l)
16
+
17
+ def genuineFiniteTermIso (n : ℕ) :
18
+ (genuineTensorFunctor P a l).obj ((TensorResolution.bimoduleComplex k B l).X n) ≅
19
+ (FullTensorTerm.complex P a l).X n := by
20
+ let e : BimoduleCoefficients k B (B ⊗[k] ChainAlgebra k l)
21
+ ((TensorResolution.bimoduleComplex k B l).X n) ≃ₗ[(B ⊗[k] ChainAlgebra k l)ᵐᵒᵖ]
22
+ TensorResolution.term k B l n := (TensorResolution.forgetBimoduleTerm k B l n).toLinearEquiv
23
+ have he (b : B) (x : BimoduleCoefficients k B (B ⊗[k] ChainAlgebra k l)
24
+ ((TensorResolution.bimoduleComplex k B l).X n)) : e (b • x) = b • e x := by
25
+ apply Subtype.ext
26
+ change TensorIdeal.coefficient b * (x.val * 1) = TensorIdeal.coefficient b * x.val
27
+ rw [mul_one]
28
+ exact (TwoSidedTensor.congrLeft (k := k) (S := B) (T := Bᵐᵒᵖ) (N := BimoduleO P a l) e he).toModuleIso
29
+
30
+ /-- The actual finite bimodule tensor agrees with the existing full computation, preserving both B-actions. -/
31
+ def genuineFiniteComplexIso :
32
+ ((genuineTensorFunctor P a l).mapHomologicalComplex (.up ℕ)).obj
33
+ (TensorResolution.bimoduleComplex k B l) ≅ FullTensorTerm.complex P a l :=
34
+ HomologicalComplex.Hom.isoOfComponents (genuineFiniteTermIso P a l) (by
35
+ intro n m h
36
+ change n+1=m at h
37
+ subst m
38
+ change (genuineFiniteTermIso P a l n).hom ≫ (FullTensorTerm.complex P a l).d n (n+1) =
39
+ (genuineTensorFunctor P a l).map ((TensorResolution.bimoduleComplex k B l).d n (n+1)) ≫
40
+ (genuineFiniteTermIso P a l (n+1)).hom
41
+ have h₁ : (FullTensorTerm.complex P a l).d n (n+1) = ModuleCat.ofHom (FullTensorTerm.differential P a l n) :=
42
+ CochainComplex.of_d (fun n => ModuleCat.of (Enveloping k B) (FullTensorTerm P a l n))
43
+ (fun n => ModuleCat.ofHom (FullTensorTerm.differential P a l n)) n
44
+ have h₂ : (TensorResolution.bimoduleComplex k B l).d n (n+1) =
45
+ ModuleCat.ofHom (TensorResolution.bimoduleDifferential k B l n) :=
46
+ CochainComplex.of_d (fun n => ModuleCat.of (B ⊗[k] (B ⊗[k] ChainAlgebra k l)ᵐᵒᵖ)
47
+ (TensorResolution.bimoduleTerm k B l n))
48
+ (fun n => ModuleCat.ofHom (TensorResolution.bimoduleDifferential k B l n)) n
49
+ rw [h₁,h₂]
50
+ apply ModuleCat.hom_ext
51
+ dsimp only [genuineTensorFunctor, bimoduleTensorFunctor, FullTensorTerm.complex]
52
+ apply LinearMap.restrictScalars_injective k
53
+ apply BalancedTensor.ext
54
+ intro q o
55
+ rfl)
56
+
57
+ /-- The actual all-integer tensor of genuine Q_T with O, retaining both outside B-actions. -/
58
+ def genuineComputedTensor : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ :=
59
+ ((genuineTensorFunctor P a l).mapHomologicalComplex (.up ℤ)).obj
60
+ (TensorResolution.integerBimoduleComplex k B l)
61
+
62
+ /-- Agreement with the preserved full signed-comparison input in every integer degree. -/
63
+ def genuineComputedTensorIso : genuineComputedTensor P a l ≅ computedTensorComplex P a l :=
64
+ FunctorExtension.iso (genuineTensorFunctor P a l) (TensorResolution.bimoduleComplex k B l)
65
+ (TensorResolution.degreeEmbedding l) ≪≫
66
+ ((TensorResolution.degreeEmbedding l).extendFunctor _).mapIso (genuineFiniteComplexIso P a l)
67
+
68
+ /-- The actual ordinary tensor Q_T tensor O is isomorphic to P[b] as B-bimodule complexes.
69
+ Only the manuscript support and indexing hypotheses are used. -/
70
+ def genuineSourceShiftComparison (b : ℤ) (hb : a+(l:ℤ)=b)
71
+ (hP : ∀ n : ℤ, n < a ∨ b < n → IsZero (P.X n)) :
72
+ genuineComputedTensor P a l ≅ P⟦b⟧ :=
73
+ genuineComputedTensorIso P a l ≪≫ sourceShiftComparison P a l b hb hP
74
+ end LittleFinitistic.OrdinarySimulation
75
+
76
+ end
77
+
78
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryGlobalDimension.lean ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryProductOpposite
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryTensorGlobalDimension
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory
7
+ open scoped TensorProduct
8
+ namespace LittleFinitistic.OrdinarySimulation
9
+ universe u v
10
+ variable {k B : Type u} [Field k] [Ring B] [Algebra k B]
11
+
12
+ /-- The manuscript's exact bound for D, on both sides and for arbitrary modules. -/
13
+ theorem ordinary_globalDimension_bound (DB : DirectedBound.DirectedSystem k B 3) (l : ℕ) :
14
+ (⨆ M : ModuleCat.{max u v} (AlgebraD k l B), projectiveDimension M) ≤ (3*l+2 : ℕ) ∧
15
+ (⨆ M : ModuleCat.{max u v} (AlgebraD k l B)ᵐᵒᵖ, projectiveDimension M) ≤ (3*l+2 : ℕ) := by
16
+ have hB := DirectedBound.DirectedSystem.both_sides_projectiveDimension_le.{u,v} DB
17
+ have hBC := tensor_projectiveDimension_bound.{u,v} DB l
18
+ have hL (M : ModuleCat.{max u v} B) : projectiveDimension M ≤ (3*l+2 : ℕ) := by
19
+ apply (hB.1 M).trans
20
+ exact_mod_cast (show 3-1 ≤ 3*l+2 by omega)
21
+ have hR (M : ModuleCat.{max u v} Bᵐᵒᵖ) : projectiveDimension M ≤ (3*l+2 : ℕ) := by
22
+ apply (hB.2 M).trans
23
+ exact_mod_cast (show 3-1 ≤ 3*l+2 by omega)
24
+ exact ⟨iSup_le (fun M => ProductModules.product_module_bound B (B ⊗[k] ChainAlgebra k l)
25
+ (3*l+2) hL hBC.1 M),
26
+ iSup_le (fun M => ProductModules.opposite_product_module_bound B (B ⊗[k] ChainAlgebra k l)
27
+ (3*l+2) hR hBC.2 M)⟩
28
+
29
+ variable {V W U : Type u} [AddCommGroup V] [Module k V] [AddCommGroup W] [Module k W]
30
+ [AddCommGroup U] [Module k U]
31
+
32
+ /-- The bound for the actual three-vertex coefficient algebra and the actual Section 5 product D. -/
33
+ theorem source_ordinary_globalDimension_bound (μ : W →ₗ[k] V →ₗ[k] U) (l : ℕ) :
34
+ (⨆ M : ModuleCat.{max u v} (AlgebraD k l (ThreeVertexAlgebra μ)), projectiveDimension M) ≤ (3*l+2 : ℕ) ∧
35
+ (⨆ M : ModuleCat.{max u v} (AlgebraD k l (ThreeVertexAlgebra μ))ᵐᵒᵖ, projectiveDimension M) ≤ (3*l+2 : ℕ) :=
36
+ ordinary_globalDimension_bound (ThreeVertexAlgebra.directedSystem μ) l
37
+ end LittleFinitistic.OrdinarySimulation
38
+
39
+ end
40
+
41
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryIntegerResolution.lean ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryTensorResolutionComplex
2
+ import Mathlib.Algebra.Homology.Embedding.ExtendHomology
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory Limits
7
+ open scoped TensorProduct
8
+ namespace LittleFinitistic.OrdinarySimulation.TensorResolution
9
+ universe u
10
+ variable (k B : Type u) [Field k] [Ring B] [Algebra k B] (l : ℕ)
11
+
12
+ def degreeEmbedding : (ComplexShape.up ℕ).Embedding (ComplexShape.up ℤ) :=
13
+ ComplexShape.embeddingUpIntGE (-(l:ℤ))
14
+
15
+ instance degreeEmbedding_rel : (degreeEmbedding l).IsRelIff :=
16
+ inferInstanceAs ((ComplexShape.embeddingUpIntGE (-(l:ℤ))).IsRelIff)
17
+
18
+ @[simp] theorem degreeEmbedding_apply (n : ℕ) : (degreeEmbedding l).f n = -(l:ℤ)+n := rfl
19
+
20
+ /-- Q_T in the manuscript's cohomological degrees -l,...,0. -/
21
+ def integerComplex : CochainComplex (ModuleCat.{u} (B ⊗[k] ChainAlgebra k l)ᵐᵒᵖ) ℤ :=
22
+ (complex k B l).extend (degreeEmbedding l)
23
+
24
+ def integerTermIso (n : ℕ) : (integerComplex k B l).X (-(l:ℤ)+n) ≅ termObject k B l n :=
25
+ (complex k B l).extendXIso (degreeEmbedding l) rfl
26
+
27
+ /-- The terminal simple is in degree zero after the actual reindexing. -/
28
+ def integerAugmentation : integerComplex k B l ⟶
29
+ (HomologicalComplex.single _ (.up ℤ) 0).obj
30
+ (ModuleCat.of (B ⊗[k] ChainAlgebra k l)ᵐᵒᵖ (TerminalTensor B)) :=
31
+ HomologicalComplex.extendMap (augmentationMap k B l) (degreeEmbedding l) ≫
32
+ (HomologicalComplex.extendSingleIso (e := degreeEmbedding l)
33
+ (X := ModuleCat.of (B ⊗[k] ChainAlgebra k l)ᵐᵒᵖ (TerminalTensor B)) l 0 (by simp)).hom
34
+
35
+ theorem integerAugmentation_quasiIso : QuasiIso (integerAugmentation k B l) := by
36
+ have := augmentationMap_quasiIso k B l
37
+ exact inferInstanceAs (QuasiIso
38
+ (HomologicalComplex.extendMap (augmentationMap k B l) (degreeEmbedding l) ≫
39
+ (HomologicalComplex.extendSingleIso (e := degreeEmbedding l)
40
+ (X := ModuleCat.of (B ⊗[k] ChainAlgebra k l)ᵐᵒᵖ (TerminalTensor B)) l 0 (by simp)).hom))
41
+
42
+ theorem integerTerm_lower (n : ℤ) (h : n < -(l:ℤ)) : IsZero ((integerComplex k B l).X n) := by
43
+ apply (complex k B l).isZero_extend_X (degreeEmbedding l) n
44
+ intro j hj
45
+ simp only [degreeEmbedding_apply] at hj
46
+ omega
47
+
48
+ theorem integerTerm_upper (n : ℤ) (h : 0 < n) : IsZero ((integerComplex k B l).X n) := by
49
+ let j := (n+(l:ℤ)).toNat
50
+ have hj : (degreeEmbedding l).f j = n := by
51
+ simp only [degreeEmbedding_apply]
52
+ dsimp [j]
53
+ rw [Int.toNat_of_nonneg (by omega)]
54
+ omega
55
+ have hjl : l < j := by
56
+ have hc : (j:ℤ) = n+(l:ℤ) := Int.toNat_of_nonneg (by omega)
57
+ omega
58
+ exact (term_vanishes k B l j hjl).of_iso ((complex k B l).extendXIso (degreeEmbedding l) hj)
59
+
60
+ theorem integerTerm_projective (n : ℤ) : Projective ((integerComplex k B l).X n) := by
61
+ by_cases h : n < -(l:ℤ)
62
+ · exact (integerTerm_lower k B l n h).projective
63
+ let j := (n+(l:ℤ)).toNat
64
+ have hj : (degreeEmbedding l).f j = n := by
65
+ simp only [degreeEmbedding_apply]
66
+ dsimp [j]
67
+ rw [Int.toNat_of_nonneg (by omega)]
68
+ omega
69
+ exact Projective.of_iso ((complex k B l).extendXIso (degreeEmbedding l) hj).symm (projectiveTerm k B l j)
70
+ end LittleFinitistic.OrdinarySimulation.TensorResolution
71
+
72
+ end
73
+
74
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryLeftTensorCongruence.lean ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryLeftTensorMaps
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBalancedCongruence
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ namespace LittleFinitistic.LeftTensor
7
+ universe u
8
+ variable {k A S M M' N N' : Type u} [Field k] [Ring A] [Ring S] [Algebra k A] [Algebra k S]
9
+ variable [AddCommGroup M] [Module k M] [Module Aᵐᵒᵖ M] [IsScalarTower k Aᵐᵒᵖ M]
10
+ [Module S M] [IsScalarTower k S M] [SMulCommClass S Aᵐᵒᵖ M]
11
+ variable [AddCommGroup M'] [Module k M'] [Module Aᵐᵒᵖ M'] [IsScalarTower k Aᵐᵒᵖ M']
12
+ [Module S M'] [IsScalarTower k S M'] [SMulCommClass S Aᵐᵒᵖ M']
13
+ variable [AddCommGroup N] [Module k N] [Module A N] [IsScalarTower k A N]
14
+ variable [AddCommGroup N'] [Module k N'] [Module A N'] [IsScalarTower k A N']
15
+
16
+ /-- Actual balanced tensor congruence retaining the outside left action. -/
17
+ def congr (f : M ≃ₗ[Aᵐᵒᵖ] M') (hf : ∀ (s : S) m, f (s • m) = s • f m)
18
+ (g : N ≃ₗ[A] N') : LeftTensor k A S M N ≃ₗ[S] LeftTensor k A S M' N' where
19
+ __ := bimap f.toLinearMap hf g.toLinearMap
20
+ invFun := (BalancedTensor.congr (k := k) f g).symm
21
+ left_inv := (BalancedTensor.congr (k := k) f g).left_inv
22
+ right_inv := (BalancedTensor.congr (k := k) f g).right_inv
23
+ end LittleFinitistic.LeftTensor
24
+
25
+ end
26
+
27
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryLeftTensorMaps.lean ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryAssociativeTensorModules
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryTensorBimap
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ namespace LittleFinitistic.LeftTensor
7
+ universe u
8
+ variable {k A S M M' N N' : Type u} [Field k] [Ring A] [Ring S] [Algebra k A] [Algebra k S]
9
+ variable [AddCommGroup M] [Module k M] [Module Aᵐᵒᵖ M] [IsScalarTower k Aᵐᵒᵖ M]
10
+ [Module S M] [IsScalarTower k S M] [SMulCommClass S Aᵐᵒᵖ M]
11
+ variable [AddCommGroup M'] [Module k M'] [Module Aᵐᵒᵖ M'] [IsScalarTower k Aᵐᵒᵖ M']
12
+ [Module S M'] [IsScalarTower k S M'] [SMulCommClass S Aᵐᵒᵖ M']
13
+ variable [AddCommGroup N] [Module k N] [Module A N] [IsScalarTower k A N]
14
+ variable [AddCommGroup N'] [Module k N'] [Module A N'] [IsScalarTower k A N']
15
+
16
+ /-- The actual balanced bimap retains the outside left action. -/
17
+ def bimap (f : M →ₗ[Aᵐᵒᵖ] M') (hf : ∀ (s : S) m, f (s • m) = s • f m)
18
+ (g : N →ₗ[A] N') : LeftTensor k A S M N →ₗ[S] LeftTensor k A S M' N' where
19
+ __ := (BalancedTensor.bimap (k := k) f g).toAddHom
20
+ map_smul' s z := by
21
+ change BalancedTensor.bimap (k := k) f g (action k S A M N s z) =
22
+ action k S A M' N' s (BalancedTensor.bimap (k := k) f g z)
23
+ induction z using BalancedTensor.induction_on with
24
+ | hz =>
25
+ exact ((BalancedTensor.bimap (k := k) f g).comp (action k S A M N s)).map_zero.trans
26
+ (((action k S A M' N' s).comp (BalancedTensor.bimap (k := k) f g)).map_zero).symm
27
+ | ht m n =>
28
+ change BalancedTensor.mk k A M' N' (f (s • m)) (g n) =
29
+ BalancedTensor.mk k A M' N' (s • f m) (g n)
30
+ rw [hf]
31
+ | ha x y hx hy =>
32
+ exact (((BalancedTensor.bimap (k := k) f g).comp (action k S A M N s)).map_add x y).trans
33
+ ((congrArg₂ (· + ·) hx hy).trans
34
+ (((action k S A M' N' s).comp (BalancedTensor.bimap (k := k) f g)).map_add x y).symm)
35
+
36
+ @[simp] theorem bimap_mk (f : M →ₗ[Aᵐᵒᵖ] M') (hf : ∀ (s : S) m, f (s • m) = s • f m)
37
+ (g : N →ₗ[A] N') (m : M) (n : N) :
38
+ bimap f hf g (mk k S A M N m n) = mk k S A M' N' (f m) (g n) := rfl
39
+ end LittleFinitistic.LeftTensor
40
+
41
+ end
42
+
43
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryMiddleTensorFunctors.lean ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryAssociativityNaturality
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryFixedTensorFunctor
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory
7
+ namespace LittleFinitistic
8
+ universe u
9
+ variable (k A B N : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B]
10
+ variable [AddCommGroup N] [Module k N] [Module A N] [Module Bᵐᵒᵖ N]
11
+ [IsScalarTower k A N] [IsScalarTower k Bᵐᵒᵖ N] [SMulCommClass A Bᵐᵒᵖ N]
12
+
13
+ /-- Tensor by the fixed middle bimodule, retaining its actual left action. -/
14
+ def middleLeftFunctor : ModuleCat.{u} B ⥤ ModuleCat.{u} A where
15
+ obj Z := ModuleCat.of A (LeftTensor k B A N (BalancedTensor.ScalarLeftModule k B Z))
16
+ map {Z Z'} g := ModuleCat.ofHom
17
+ (LeftTensor.mapLast (k := k) (A := A) (N := N)
18
+ (Z := BalancedTensor.ScalarLeftModule k B Z) (Z' := BalancedTensor.ScalarLeftModule k B Z') g.hom)
19
+ map_id Z := by
20
+ apply ModuleCat.hom_ext
21
+ apply LinearMap.restrictScalars_injective k
22
+ apply BalancedTensor.ext
23
+ intro n z
24
+ rfl
25
+ map_comp f g := by
26
+ apply ModuleCat.hom_ext
27
+ apply LinearMap.restrictScalars_injective k
28
+ apply BalancedTensor.ext
29
+ intro n z
30
+ rfl
31
+
32
+ instance middleLeftFunctor_additive : (middleLeftFunctor k A B N).Additive where
33
+ map_add {Z Z'} {f g} := by
34
+ dsimp only [middleLeftFunctor]
35
+ apply ModuleCat.hom_ext
36
+ apply LinearMap.restrictScalars_injective k
37
+ apply BalancedTensor.ext
38
+ intro n z
39
+ exact (BalancedTensor.mk k B N (BalancedTensor.ScalarLeftModule k B Z') n).map_add (f.hom z) (g.hom z)
40
+
41
+ /-- Tensor a right module by the middle bimodule, retaining its actual right action. -/
42
+ def middleRightFunctor : ModuleCat.{u} Aᵐᵒᵖ ⥤ ModuleCat.{u} Bᵐᵒᵖ where
43
+ obj M := ModuleCat.of Bᵐᵒᵖ (RightTensor k A B (BalancedTensor.ScalarLeftModule k Aᵐᵒᵖ M) N)
44
+ map {M M'} f := ModuleCat.ofHom
45
+ (RightTensor.mapFirst (k := k) (B := B) (N := N)
46
+ (M := BalancedTensor.ScalarLeftModule k Aᵐᵒᵖ M) (M' := BalancedTensor.ScalarLeftModule k Aᵐᵒᵖ M') f.hom)
47
+ map_id M := by
48
+ apply ModuleCat.hom_ext
49
+ apply LinearMap.restrictScalars_injective k
50
+ apply BalancedTensor.ext
51
+ intro m n
52
+ rfl
53
+ map_comp f g := by
54
+ apply ModuleCat.hom_ext
55
+ apply LinearMap.restrictScalars_injective k
56
+ apply BalancedTensor.ext
57
+ intro m n
58
+ rfl
59
+
60
+ instance middleRightFunctor_additive : (middleRightFunctor k A B N).Additive where
61
+ map_add {M M'} {f g} := by
62
+ dsimp only [middleRightFunctor]
63
+ apply ModuleCat.hom_ext
64
+ apply LinearMap.restrictScalars_injective k
65
+ apply BalancedTensor.ext
66
+ intro m n
67
+ exact congrArg (fun h => h n)
68
+ ((BalancedTensor.mk k A (BalancedTensor.ScalarLeftModule k Aᵐᵒᵖ M') N).map_add (f.hom m) (g.hom m))
69
+
70
+ /-- The genuine right tensor complex, with its right B-action. -/
71
+ def middleRightComplex (Q : CochainComplex (ModuleCat.{u} Aᵐᵒᵖ) ℤ) :
72
+ CochainComplex (ModuleCat.{u} Bᵐᵒᵖ) ℤ :=
73
+ ((middleRightFunctor k A B N).mapHomologicalComplex (.up ℤ)).obj Q
74
+
75
+ /-- The genuine left tensor complex, with its left A-action. -/
76
+ def middleLeftComplex (Z : CochainComplex (ModuleCat.{u} B) ℤ) :
77
+ CochainComplex (ModuleCat.{u} A) ℤ :=
78
+ ((middleLeftFunctor k A B N).mapHomologicalComplex (.up ℤ)).obj Z
79
+ end LittleFinitistic
80
+
81
+ end
82
+
83
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalComplex.lean ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryOffDiagonalMaps
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimoduleCoefficients
3
+ import Mathlib.Algebra.Homology.Additive
4
+
5
+ namespace OAI
6
+ noncomputable section
7
+ open CategoryTheory
8
+ open scoped TensorProduct
9
+ namespace LittleFinitistic.OrdinarySimulation.OffDiagonal
10
+ universe u
11
+ variable (k L R : Type u) [Field k] [Ring L] [Ring R] [Algebra k L] [Algebra k R]
12
+ variable (O : CochainComplex (ModuleCat.{u} (R ⊗[k] Lᵐᵒᵖ)) ℤ)
13
+ variable (T : CochainComplex (ModuleCat.{u} (L ⊗[k] Rᵐᵒᵖ)) ℤ)
14
+
15
+ abbrev complexTerm (n : ℤ) := RetainedBimodule k (L × R) (L × R)
16
+ (OffDiagonal (BimoduleCoefficients k R L (O.X n)) (BimoduleCoefficients k L R (T.X n)))
17
+
18
+ def complexDifferential (n : ℤ) :=
19
+ RetainedBimodule.map (k := k) (S := L × R) (A := L × R)
20
+ (map (BimoduleCoefficients.map k R L (O.d n (n+1)))
21
+ (BimoduleCoefficients.map k L R (T.d n (n+1))))
22
+ (map_left (BimoduleCoefficients.map k R L (O.d n (n+1)))
23
+ (BimoduleCoefficients.map_left k R L (O.d n (n+1)))
24
+ (BimoduleCoefficients.map k L R (T.d n (n+1)))
25
+ (BimoduleCoefficients.map_left k L R (T.d n (n+1))))
26
+
27
+ theorem complexDifferential_square (n : ℤ) :
28
+ (complexDifferential k L R O T (n+1)).comp (complexDifferential k L R O T n) = 0 := by
29
+ apply LinearMap.ext
30
+ intro x
31
+ apply Prod.ext
32
+ · exact congrArg (fun f => f.hom x.1) (O.d_comp_d n (n+1) ((n+1)+1))
33
+ · exact congrArg (fun f => f.hom x.2) (T.d_comp_d n (n+1) ((n+1)+1))
34
+
35
+ /-- Actual off-diagonal complex with both actions of the product algebra retained. -/
36
+ def complex : CochainComplex (ModuleCat.{u} ((L × R) ⊗[k] (L × R)ᵐᵒᵖ)) ℤ :=
37
+ CochainComplex.of (fun n => ModuleCat.of _ (complexTerm k L R O T n))
38
+ (fun n => ModuleCat.ofHom (complexDifferential k L R O T n))
39
+ (fun n => ModuleCat.hom_ext (complexDifferential_square k L R O T n))
40
+ end LittleFinitistic.OrdinarySimulation.OffDiagonal
41
+
42
+ end
43
+
44
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalComplexMaps.lean ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryOffDiagonalComplex
2
+
3
+ namespace OAI
4
+ noncomputable section
5
+ open CategoryTheory
6
+ open scoped TensorProduct
7
+ namespace LittleFinitistic.OrdinarySimulation.OffDiagonal
8
+ universe u
9
+ variable (k L R : Type u) [Field k] [Ring L] [Ring R] [Algebra k L] [Algebra k R]
10
+ variable {O O' : CochainComplex (ModuleCat.{u} (R ⊗[k] Lᵐᵒᵖ)) ℤ}
11
+ variable {T T' : CochainComplex (ModuleCat.{u} (L ⊗[k] Rᵐᵒᵖ)) ℤ}
12
+
13
+ def complexTermMap (f : O ⟶ O') (g : T ⟶ T') (n : ℤ) :=
14
+ RetainedBimodule.map (k := k) (S := L × R) (A := L × R)
15
+ (map (BimoduleCoefficients.map k R L (f.f n)) (BimoduleCoefficients.map k L R (g.f n)))
16
+ (map_left (BimoduleCoefficients.map k R L (f.f n))
17
+ (BimoduleCoefficients.map_left k R L (f.f n))
18
+ (BimoduleCoefficients.map k L R (g.f n))
19
+ (BimoduleCoefficients.map_left k L R (g.f n)))
20
+
21
+ theorem complex_d (n : ℤ) : (complex k L R O T).d n (n+1) =
22
+ ModuleCat.ofHom (complexDifferential k L R O T n) :=
23
+ CochainComplex.of_d (fun n => ModuleCat.of _ (complexTerm k L R O T n))
24
+ (fun n => ModuleCat.ofHom (complexDifferential k L R O T n)) n
25
+
26
+ /-- An actual map of off-diagonal complexes retaining both product-ring actions. -/
27
+ def complexMap (f : O ⟶ O') (g : T ⟶ T') : complex k L R O T ⟶ complex k L R O' T' where
28
+ f n := ModuleCat.ofHom (complexTermMap k L R f g n)
29
+ comm' n m h := by
30
+ change n+1=m at h
31
+ subst m
32
+ rw [complex_d,complex_d]
33
+ apply ModuleCat.hom_ext
34
+ apply LinearMap.ext
35
+ intro x
36
+ apply Prod.ext
37
+ · exact congrArg (fun h => h.hom x.1) (f.comm n (n+1))
38
+ · exact congrArg (fun h => h.hom x.2) (g.comm n (n+1))
39
+ end LittleFinitistic.OrdinarySimulation.OffDiagonal
40
+
41
+ end
42
+
43
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalForget.lean ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryOffDiagonalComplexMaps
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryRetainedRestriction
3
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryPairQuasiIso
4
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryRestrictionHomology
5
+
6
+ namespace OAI
7
+ noncomputable section
8
+ open CategoryTheory
9
+ open scoped TensorProduct
10
+ namespace LittleFinitistic.OrdinarySimulation.OffDiagonal
11
+ universe u
12
+ variable (k L R : Type u) [Field k] [Ring L] [Ring R] [Algebra k L] [Algebra k R]
13
+ variable (O : CochainComplex (ModuleCat.{u} (R ⊗[k] Lᵐᵒᵖ)) ℤ)
14
+ variable (T : CochainComplex (ModuleCat.{u} (L ⊗[k] Rᵐᵒᵖ)) ℤ)
15
+
16
+ def forgetTermIso (n : ℤ) : (underlyingComplex (k := k) (complex k L R O T)).X n ≅
17
+ (PairComplex.complex (underlyingComplex (k := k) O) (underlyingComplex (k := k) T)).X n :=
18
+ (RetainedBimodule.scalarEquiv k (L × R) (L × R)
19
+ (OffDiagonal (BimoduleCoefficients k R L (O.X n)) (BimoduleCoefficients k L R (T.X n)))).toModuleIso
20
+
21
+ /-- Forgetting the two outside actions gives the actual coordinate direct-sum complex. -/
22
+ def forgetIso : underlyingComplex (k := k) (complex k L R O T) ≅
23
+ PairComplex.complex (underlyingComplex (k := k) O) (underlyingComplex (k := k) T) :=
24
+ HomologicalComplex.Hom.isoOfComponents (forgetTermIso k L R O T) (by
25
+ intro n m h
26
+ change n+1=m at h
27
+ subst m
28
+ change (forgetTermIso k L R O T n).hom ≫ _ =
29
+ (ModuleCat.restrictScalars (algebraMap k ((L × R) ⊗[k] (L × R)ᵐᵒᵖ))).map
30
+ ((complex k L R O T).d n (n+1)) ≫ (forgetTermIso k L R O T (n+1)).hom
31
+ rw [complex_d,PairComplex.complex_d]
32
+ rfl)
33
+
34
+ variable {O T} {O' : CochainComplex (ModuleCat.{u} (R ⊗[k] Lᵐᵒᵖ)) ℤ}
35
+ variable {T' : CochainComplex (ModuleCat.{u} (L ⊗[k] Rᵐᵒᵖ)) ℤ}
36
+
37
+ theorem forgetIso_natural (f : O ⟶ O') (g : T ⟶ T') :
38
+ ((ModuleCat.restrictScalars (algebraMap k ((L × R) ⊗[k] (L × R)ᵐᵒᵖ))).mapHomologicalComplex (.up ℤ)).map
39
+ (complexMap k L R f g) ≫ (forgetIso k L R O' T').hom =
40
+ (forgetIso k L R O T).hom ≫ PairComplex.map
41
+ (((ModuleCat.restrictScalars (algebraMap k (R ⊗[k] Lᵐᵒᵖ))).mapHomologicalComplex (.up ℤ)).map f)
42
+ (((ModuleCat.restrictScalars (algebraMap k (L ⊗[k] Rᵐᵒᵖ))).mapHomologicalComplex (.up ℤ)).map g) := by
43
+ ext n x
44
+ rfl
45
+
46
+ /-- The actual off-diagonal map is a quasi-isomorphism when its two components are. -/
47
+ theorem complexMap_quasiIso (f : O ⟶ O') (g : T ⟶ T') [QuasiIso f] [QuasiIso g] :
48
+ QuasiIso (complexMap k L R f g) := by
49
+ apply (RestrictionHomology.quasiIso_iff (algebraMap k ((L × R) ⊗[k] (L × R)ᵐᵒᵖ)) _).mp
50
+ let f' := ((ModuleCat.restrictScalars (algebraMap k (R ⊗[k] Lᵐᵒᵖ))).mapHomologicalComplex (.up ℤ)).map f
51
+ let g' := ((ModuleCat.restrictScalars (algebraMap k (L ⊗[k] Rᵐᵒᵖ))).mapHomologicalComplex (.up ℤ)).map g
52
+ have : QuasiIso f' := (RestrictionHomology.quasiIso_iff (algebraMap k (R ⊗[k] Lᵐᵒᵖ)) f).mpr inferInstance
53
+ have : QuasiIso g' := (RestrictionHomology.quasiIso_iff (algebraMap k (L ⊗[k] Rᵐᵒᵖ)) g).mpr inferInstance
54
+ have := PairComplex.map_quasiIso f' g'
55
+ let h := ((ModuleCat.restrictScalars (algebraMap k ((L × R) ⊗[k] (L × R)ᵐᵒᵖ))).mapHomologicalComplex (.up ℤ)).map
56
+ (complexMap k L R f g)
57
+ have hh : QuasiIso (h ≫ (forgetIso k L R O' T').hom) := by
58
+ dsimp only [h]
59
+ rw [forgetIso_natural]
60
+ exact inferInstanceAs (QuasiIso ((forgetIso k L R O T).hom ≫ PairComplex.map f' g'))
61
+ exact (quasiIso_iff_comp_right h (forgetIso k L R O' T').hom).mp hh
62
+ end LittleFinitistic.OrdinarySimulation.OffDiagonal
63
+
64
+ end
65
+
66
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalMaps.lean ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBlockBimodule
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryRetainedBimodule
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ namespace LittleFinitistic.OrdinarySimulation.OffDiagonal
7
+ universe u
8
+ variable {L R O O' T T' : Type u} [Ring L] [Ring R]
9
+ variable [AddCommGroup O] [AddCommGroup O'] [AddCommGroup T] [AddCommGroup T']
10
+ variable [Module R O] [Module R O'] [Module L T] [Module L T']
11
+ variable [Module Lᵐᵒᵖ O] [Module Lᵐᵒᵖ O'] [Module Rᵐᵒᵖ T] [Module Rᵐᵒᵖ T']
12
+
13
+ /-- Actual component maps of the off-diagonal right product-ring module. -/
14
+ def map (f : O →ₗ[Lᵐᵒᵖ] O') (g : T →ₗ[Rᵐᵒᵖ] T') :
15
+ OffDiagonal O T →ₗ[(L × R)ᵐᵒᵖ] OffDiagonal O' T' where
16
+ toFun x := (f x.1,g x.2)
17
+ map_add' left right := Prod.ext (f.map_add left.1 right.1) (g.map_add left.2 right.2)
18
+ map_smul' d x := Prod.ext (f.map_smul (MulOpposite.op d.unop.1) x.1)
19
+ (g.map_smul (MulOpposite.op d.unop.2) x.2)
20
+
21
+ /-- The same map retains the two prescribed left product-ring actions. -/
22
+ theorem map_left (f : O →ₗ[Lᵐᵒᵖ] O') (hf : ∀ (r : R) x, f (r • x) = r • f x)
23
+ (g : T →ₗ[Rᵐᵒᵖ] T') (hg : ∀ (s : L) x, g (s • x) = s • g x)
24
+ (d : L × R) (x : OffDiagonal O T) :
25
+ map f g (d • x) = d • map f g x :=
26
+ Prod.ext (hf d.2 x.1) (hg d.1 x.2)
27
+ end LittleFinitistic.OrdinarySimulation.OffDiagonal
28
+
29
+ end
30
+
31
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalObjects.lean ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryOffDiagonalComplexMaps
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryRetainedRestriction
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory Limits
7
+ open scoped TensorProduct
8
+ namespace LittleFinitistic.OrdinarySimulation.OffDiagonal
9
+ universe u
10
+ variable (k L R : Type u) [Field k] [Ring L] [Ring R] [Algebra k L] [Algebra k R]
11
+ variable (O : ModuleCat.{u} (R ⊗[k] Lᵐᵒᵖ)) (T : ModuleCat.{u} (L ⊗[k] Rᵐᵒᵖ))
12
+
13
+ abbrev object : ModuleCat.{u} ((L × R) ⊗[k] (L × R)ᵐᵒᵖ) :=
14
+ RetainedBimodule.object k (L × R) (L × R)
15
+ (OffDiagonal (BimoduleCoefficients k R L O) (BimoduleCoefficients k L R T))
16
+
17
+ variable {O T} {O' : ModuleCat.{u} (R ⊗[k] Lᵐᵒᵖ)} {T' : ModuleCat.{u} (L ⊗[k] Rᵐᵒᵖ)}
18
+
19
+ def objectMap (f : O ⟶ O') (g : T ⟶ T') : object k L R O T ⟶ object k L R O' T' :=
20
+ ModuleCat.ofHom (RetainedBimodule.map (k := k) (S := L × R) (A := L × R)
21
+ (map (BimoduleCoefficients.map k R L f) (BimoduleCoefficients.map k L R g))
22
+ (map_left (BimoduleCoefficients.map k R L f) (BimoduleCoefficients.map_left k R L f)
23
+ (BimoduleCoefficients.map k L R g) (BimoduleCoefficients.map_left k L R g)))
24
+
25
+ def objectIso (f : O ≅ O') (g : T ≅ T') : object k L R O T ≅ object k L R O' T' where
26
+ hom := objectMap k L R f.hom g.hom
27
+ inv := objectMap k L R f.inv g.inv
28
+ hom_inv_id := by
29
+ apply ModuleCat.hom_ext
30
+ apply LinearMap.ext
31
+ intro x
32
+ exact Prod.ext (congrArg (fun h => h.hom x.1) f.hom_inv_id)
33
+ (congrArg (fun h => h.hom x.2) g.hom_inv_id)
34
+ inv_hom_id := by
35
+ apply ModuleCat.hom_ext
36
+ apply LinearMap.ext
37
+ intro x
38
+ exact Prod.ext (congrArg (fun h => h.hom x.1) f.inv_hom_id)
39
+ (congrArg (fun h => h.hom x.2) g.inv_hom_id)
40
+
41
+ theorem object_isZero (hO : IsZero O) (hT : IsZero T) : IsZero (object k L R O T) := by
42
+ have := ModuleCat.isZero_iff_subsingleton.mp hO
43
+ have := ModuleCat.isZero_iff_subsingleton.mp hT
44
+ apply ModuleCat.isZero_iff_subsingleton.mpr
45
+ exact inferInstanceAs (Subsingleton (O × T))
46
+ end LittleFinitistic.OrdinarySimulation.OffDiagonal
47
+
48
+ end
49
+
50
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalProjective.lean ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryOffDiagonalMaps
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryProductOpposite
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory
7
+ namespace LittleFinitistic.OrdinarySimulation.OffDiagonal
8
+ universe u
9
+ variable (L R O T : Type u) [Ring L] [Ring R]
10
+ variable [AddCommGroup O] [AddCommGroup T] [Module Lᵐᵒᵖ O] [Module Rᵐᵒᵖ T]
11
+ open ProductModules
12
+
13
+ abbrev inflatedPair : ModuleCat.{u} (Lᵐᵒᵖ × Rᵐᵒᵖ) := ModuleCat.of _
14
+ (((firstInflation Lᵐᵒᵖ Rᵐᵒᵖ).obj (ModuleCat.of Lᵐᵒᵖ O)) ×
15
+ ((secondInflation Lᵐᵒᵖ Rᵐᵒᵖ).obj (ModuleCat.of Rᵐᵒᵖ T)))
16
+
17
+ attribute [local instance] RingHomInvPair.of_ringEquiv
18
+
19
+ def rightPairEquiv : OffDiagonal O T ≃ₛₗ[RingHomClass.toRingHom (oppositeEquiv L R)]
20
+ inflatedPair L R O T where
21
+ toFun x := x
22
+ invFun x := x
23
+ left_inv _ := rfl
24
+ right_inv _ := rfl
25
+ map_add' _ _ := rfl
26
+ map_smul' _ _ := rfl
27
+
28
+ /-- Off-diagonal right projectivity follows from the actual two product-factor modules. -/
29
+ theorem right_projective [Module.Projective Lᵐᵒᵖ O] [Module.Projective Rᵐᵒᵖ T] :
30
+ Module.Projective (L × R)ᵐᵒᵖ (OffDiagonal O T) := by
31
+ let P := ModuleCat.of Lᵐᵒᵖ O
32
+ let Q := ModuleCat.of Rᵐᵒᵖ T
33
+ have : Projective P := ModuleCat.projective_of_categoryTheory_projective P
34
+ have : Projective Q := ModuleCat.projective_of_categoryTheory_projective Q
35
+ have : HasProjectiveDimensionLE P 0 := (projective_iff_hasProjectiveDimensionLT_one (X := P)).mp inferInstance
36
+ have : HasProjectiveDimensionLE Q 0 := (projective_iff_hasProjectiveDimensionLT_one (X := Q)).mp inferInstance
37
+ have := firstInflation_dimensionLE Lᵐᵒᵖ Rᵐᵒᵖ 0 P
38
+ have := secondInflation_dimensionLE Lᵐᵒᵖ Rᵐᵒᵖ 0 Q
39
+ let e := ModuleCat.biprodIsoProd ((firstInflation Lᵐᵒᵖ Rᵐᵒᵖ).obj P)
40
+ ((secondInflation Lᵐᵒᵖ Rᵐᵒᵖ).obj Q)
41
+ have : HasProjectiveDimensionLT (inflatedPair L R O T) 1 := hasProjectiveDimensionLT_of_iso e 1
42
+ have : HasProjectiveDimensionLE (ModuleCat.of (L × R)ᵐᵒᵖ (OffDiagonal O T)) 0 :=
43
+ ModuleCat.hasProjectiveDimensionLE_of_semiLinearEquiv (oppositeEquiv L R).symm
44
+ (rightPairEquiv L R O T).symm 0
45
+ have : Projective (ModuleCat.of (L × R)ᵐᵒᵖ (OffDiagonal O T)) :=
46
+ (projective_iff_hasProjectiveDimensionLT_one (X := ModuleCat.of (L × R)ᵐᵒᵖ (OffDiagonal O T))).mpr inferInstance
47
+ exact ModuleCat.projective_of_module_projective (ModuleCat.of (L × R)ᵐᵒᵖ (OffDiagonal O T))
48
+ end LittleFinitistic.OrdinarySimulation.OffDiagonal
49
+
50
+ end
51
+
52
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryOffDiagonalSingle.lean ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryOffDiagonalObjects
2
+ import Mathlib.Algebra.Homology.Single
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory Limits
7
+ open scoped TensorProduct
8
+ namespace LittleFinitistic.OrdinarySimulation.OffDiagonal
9
+ universe u
10
+ variable (k L R : Type u) [Field k] [Ring L] [Ring R] [Algebra k L] [Algebra k R]
11
+ variable (O : ModuleCat.{u} (R ⊗[k] Lᵐᵒᵖ)) (T : ModuleCat.{u} (L ⊗[k] Rᵐᵒᵖ))
12
+
13
+ abbrev singles : CochainComplex (ModuleCat.{u} ((L × R) ⊗[k] (L × R)ᵐᵒᵖ)) ℤ :=
14
+ complex k L R ((HomologicalComplex.single _ (.up ℤ) 0).obj O)
15
+ ((HomologicalComplex.single _ (.up ℤ) 0).obj T)
16
+
17
+ theorem singles_isZero (n : ℤ) (hn : n ≠ 0) : IsZero ((singles k L R O T).X n) :=
18
+ object_isZero k L R (HomologicalComplex.isZero_single_obj_X (.up ℤ) 0 O n hn)
19
+ (HomologicalComplex.isZero_single_obj_X (.up ℤ) 0 T n hn)
20
+
21
+ def singleTermIso (n : ℤ) : (singles k L R O T).X n ≅
22
+ ((HomologicalComplex.single _ (.up ℤ) 0).obj (object k L R O T)).X n := by
23
+ by_cases hn : n = 0
24
+ · subst n
25
+ exact objectIso k L R (HomologicalComplex.singleObjXSelf (.up ℤ) 0 O)
26
+ (HomologicalComplex.singleObjXSelf (.up ℤ) 0 T) ≪≫
27
+ (HomologicalComplex.singleObjXSelf (.up ℤ) 0 (object k L R O T)).symm
28
+ · exact (singles_isZero k L R O T n hn).iso
29
+ (HomologicalComplex.isZero_single_obj_X (.up ℤ) 0 (object k L R O T) n hn)
30
+
31
+ /-- The off-diagonal direct sum of two ordinary modules is their ordinary bimodule in degree zero. -/
32
+ def singleIso : singles k L R O T ≅
33
+ (HomologicalComplex.single _ (.up ℤ) 0).obj (object k L R O T) :=
34
+ HomologicalComplex.Hom.isoOfComponents (singleTermIso k L R O T) (by
35
+ intro n m h
36
+ change n+1=m at h
37
+ by_cases hn : n = 0
38
+ · have hm : m ≠ 0 := by omega
39
+ exact (HomologicalComplex.isZero_single_obj_X (.up ℤ) 0 (object k L R O T) m hm).eq_of_tgt _ _
40
+ · exact (singles_isZero k L R O T n hn).eq_of_src _ _)
41
+ end LittleFinitistic.OrdinarySimulation.OffDiagonal
42
+
43
+ end
44
+
45
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryPairComplex.lean ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib.Algebra.Homology.Additive
2
+ import Mathlib.Algebra.Homology.QuasiIso
3
+ import Mathlib.Algebra.Homology.HomologicalComplexBiprod
4
+ import Mathlib.Algebra.Category.ModuleCat.Biproducts
5
+
6
+ namespace OAI
7
+ noncomputable section
8
+ open CategoryTheory Limits
9
+ namespace LittleFinitistic.PairComplex
10
+ universe u
11
+ variable {k : Type u} [Ring k]
12
+ variable (O T : CochainComplex (ModuleCat.{u} k) ℤ)
13
+
14
+ def complex : CochainComplex (ModuleCat.{u} k) ℤ :=
15
+ CochainComplex.of (fun n => ModuleCat.of k (O.X n × T.X n))
16
+ (fun n => ModuleCat.ofHom ((O.d n (n+1)).hom.prodMap (T.d n (n+1)).hom)) (by
17
+ intro n
18
+ apply ModuleCat.hom_ext
19
+ apply LinearMap.ext
20
+ intro x
21
+ exact Prod.ext (congrArg (fun h => h.hom x.1) (O.d_comp_d n (n+1) ((n+1)+1)))
22
+ (congrArg (fun h => h.hom x.2) (T.d_comp_d n (n+1) ((n+1)+1))))
23
+
24
+ theorem complex_d (n : ℤ) : (complex O T).d n (n+1) =
25
+ ModuleCat.ofHom ((O.d n (n+1)).hom.prodMap (T.d n (n+1)).hom) :=
26
+ CochainComplex.of_d (fun n => ModuleCat.of k (O.X n × T.X n))
27
+ (fun n => ModuleCat.ofHom ((O.d n (n+1)).hom.prodMap (T.d n (n+1)).hom)) n
28
+
29
+ def fst : complex O T ⟶ O where
30
+ f n := ModuleCat.ofHom (LinearMap.fst k (O.X n) (T.X n))
31
+ comm' n m h := by
32
+ change n+1=m at h
33
+ subst m
34
+ rw [complex_d]
35
+ rfl
36
+
37
+ def snd : complex O T ⟶ T where
38
+ f n := ModuleCat.ofHom (LinearMap.snd k (O.X n) (T.X n))
39
+ comm' n m h := by
40
+ change n+1=m at h
41
+ subst m
42
+ rw [complex_d]
43
+ rfl
44
+
45
+ def inl : O ⟶ complex O T where
46
+ f n := ModuleCat.ofHom (LinearMap.inl k (O.X n) (T.X n))
47
+ comm' n m h := by
48
+ change n+1=m at h
49
+ subst m
50
+ rw [complex_d]
51
+ apply ModuleCat.hom_ext
52
+ apply LinearMap.ext
53
+ intro x
54
+ exact Prod.ext rfl ((T.d n (n+1)).hom.map_zero)
55
+
56
+ def inr : T ⟶ complex O T where
57
+ f n := ModuleCat.ofHom (LinearMap.inr k (O.X n) (T.X n))
58
+ comm' n m h := by
59
+ change n+1=m at h
60
+ subst m
61
+ rw [complex_d]
62
+ apply ModuleCat.hom_ext
63
+ apply LinearMap.ext
64
+ intro x
65
+ exact Prod.ext ((O.d n (n+1)).hom.map_zero) rfl
66
+
67
+ @[simp] theorem inl_fst : inl O T ≫ fst O T = 𝟙 O := by ext degree element; rfl
68
+ @[simp] theorem inl_snd : inl O T ≫ snd O T = 0 := by ext degree element; rfl
69
+ @[simp] theorem inr_fst : inr O T ≫ fst O T = 0 := by ext degree element; rfl
70
+ @[simp] theorem inr_snd : inr O T ≫ snd O T = 𝟙 T := by ext degree element; rfl
71
+
72
+ /-- The actual coordinate complex is the native binary biproduct. -/
73
+ def biprodIso : complex O T ≅ O ⊞ T where
74
+ hom := biprod.lift (fst O T) (snd O T)
75
+ inv := biprod.desc (inl O T) (inr O T)
76
+ hom_inv_id := by
77
+ rw [biprod.lift_desc]
78
+ ext n x
79
+ exact Prod.ext (add_zero _) (zero_add _)
80
+ inv_hom_id := by
81
+ apply biprod.hom_ext <;> apply biprod.hom_ext' <;> simp [Category.assoc]
82
+ end LittleFinitistic.PairComplex
83
+
84
+ end
85
+
86
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryPairQuasiIso.lean ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryPairComplex
2
+ import Mathlib.Algebra.Homology.HomologicalComplexAbelian
3
+ import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor
4
+
5
+ namespace OAI
6
+ noncomputable section
7
+ open CategoryTheory Limits
8
+ namespace LittleFinitistic.PairComplex
9
+ universe u
10
+ variable {k : Type u} [Ring k]
11
+ variable {O O' T T' : CochainComplex (ModuleCat.{u} k) ℤ}
12
+
13
+ def map (f : O ⟶ O') (g : T ⟶ T') : complex O T ⟶ complex O' T' where
14
+ f n := ModuleCat.ofHom ((f.f n).hom.prodMap (g.f n).hom)
15
+ comm' n m h := by
16
+ change n+1=m at h
17
+ subst m
18
+ rw [complex_d,complex_d]
19
+ apply ModuleCat.hom_ext
20
+ apply LinearMap.ext
21
+ intro x
22
+ exact Prod.ext (congrArg (fun h => h.hom x.1) (f.comm n (n+1)))
23
+ (congrArg (fun h => h.hom x.2) (g.comm n (n+1)))
24
+
25
+ theorem biprodIso_natural (f : O ⟶ O') (g : T ⟶ T') :
26
+ map f g ≫ (biprodIso O' T').hom = (biprodIso O T).hom ≫ biprod.map f g := by
27
+ apply biprod.hom_ext
28
+ · simp only [biprodIso,Category.assoc,biprod.lift_fst,biprod.map_fst,biprod.lift_fst_assoc]
29
+ ext n x
30
+ rfl
31
+ · simp only [biprodIso,Category.assoc,biprod.lift_snd,biprod.map_snd,biprod.lift_snd_assoc]
32
+ ext n x
33
+ rfl
34
+
35
+ /-- Native binary biproducts preserve actual quasi-isomorphisms. -/
36
+ theorem biprodMap_quasiIso (f : O ⟶ O') (g : T ⟶ T') [QuasiIso f] [QuasiIso g] :
37
+ QuasiIso (biprod.map f g) := by
38
+ constructor
39
+ intro i
40
+ apply (quasiIsoAt_iff_isIso_homologyMap _ i).mpr
41
+ let H := HomologicalComplex.homologyFunctor (ModuleCat.{u} k) (.up ℤ) i
42
+ let : H.Additive := inferInstanceAs ((HomologicalComplex.homologyFunctor (ModuleCat.{u} k) (.up ℤ) i).Additive)
43
+ let : PreservesFiniteBiproducts H := Functor.preservesFiniteBiproductsOfAdditive H
44
+ let : PreservesBinaryBiproducts H := preservesBinaryBiproducts_of_preservesBiproducts H
45
+ have : IsIso (H.map f) := (quasiIsoAt_iff_isIso_homologyMap f i).mp inferInstance
46
+ have : IsIso (H.map g) := (quasiIsoAt_iff_isIso_homologyMap g i).mp inferInstance
47
+ change IsIso (H.map (biprod.map f g))
48
+ have he : H.map (biprod.map f g) ≫ (H.mapBiprod O' T').hom =
49
+ (H.mapBiprod O T).hom ≫ biprod.map (H.map f) (H.map g) := by
50
+ apply biprod.hom_ext
51
+ · simp only [Functor.mapBiprod_hom,Category.assoc,biprod.lift_fst,biprod.map_fst,biprod.lift_fst_assoc,← H.map_comp]
52
+ · simp only [Functor.mapBiprod_hom,Category.assoc,biprod.lift_snd,biprod.map_snd,biprod.lift_snd_assoc,← H.map_comp]
53
+ have : IsIso (biprod.map (H.map f) (H.map g)) := by
54
+ refine ⟨⟨biprod.map (inv (H.map f)) (inv (H.map g)), ?_, ?_⟩⟩
55
+ · apply biprod.hom_ext <;> simp [Category.assoc]
56
+ · apply biprod.hom_ext <;> simp [Category.assoc]
57
+ have h : IsIso (H.map (biprod.map f g) ≫ (H.mapBiprod O' T').hom) := by
58
+ rw [he]
59
+ infer_instance
60
+ exact (isIso_comp_right_iff _ (H.mapBiprod O' T').hom).mp h
61
+
62
+ /-- Coordinatewise quasi-isomorphisms give a quasi-isomorphism of the actual direct sum. -/
63
+ theorem map_quasiIso (f : O ⟶ O') (g : T ⟶ T') [QuasiIso f] [QuasiIso g] :
64
+ QuasiIso (map f g) := by
65
+ have := biprodMap_quasiIso f g
66
+ have h : QuasiIso (map f g ≫ (biprodIso O' T').hom) := by
67
+ rw [biprodIso_natural]
68
+ infer_instance
69
+ exact (quasiIso_iff_comp_right (map f g) (biprodIso O' T').hom).mp h
70
+ end LittleFinitistic.PairComplex
71
+
72
+ end
73
+
74
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductComponent.lean ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryRestrictionHomology
2
+ import Mathlib.Algebra.Category.ModuleCat.Projective
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory
7
+ namespace LittleFinitistic.ProductModules
8
+ universe u v
9
+ variable (L R : Type u) [Ring L] [Ring R]
10
+ variable (M : ModuleCat.{v} (L × R))
11
+
12
+ /-- The actual first central-idempotent summand of an arbitrary product-ring module. -/
13
+ def firstSpace : Submodule (L × R) M where
14
+ carrier := {m | ((1,0) : L × R) • m = m}
15
+ zero_mem' := smul_zero _
16
+ add_mem' {x y} hx hy := by
17
+ change ((1,0) : L × R) • (x+y) = x+y
18
+ rw [smul_add,hx,hy]
19
+ smul_mem' d x hx := by
20
+ change ((1,0) : L × R) • (d • x) = d • x
21
+ have he : ((1,0) : L × R) * d = d * (1,0) := by ext <;> simp
22
+ rw [← mul_smul,he,mul_smul,hx]
23
+
24
+ def firstScalar (r : L) : firstSpace L R M →ₗ[ℤ] firstSpace L R M where
25
+ toFun x := ⟨(r,(0:R)) • x.val, by
26
+ change ((1,0) : L × R) • ((r,(0:R)) • x.val) = (r,(0:R)) • x.val
27
+ rw [← mul_smul]
28
+ have h : ((1,0) : L × R) * (r,(0:R)) = (r,(0:R)) := by ext <;> simp
29
+ rw [h]⟩
30
+ map_add' x y := Subtype.ext (smul_add _ _ _)
31
+ map_smul' n x := by
32
+ apply Subtype.ext
33
+ exact smul_comm ((r,(0:R)) : L × R) n x.val
34
+
35
+ def firstAction : L →+* Module.End ℤ (firstSpace L R M) where
36
+ toFun := firstScalar L R M
37
+ map_one' := by
38
+ apply LinearMap.ext
39
+ intro x
40
+ apply Subtype.ext
41
+ change ((1,0) : L × R) • x.val = x.val
42
+ exact x.property
43
+ map_zero' := by
44
+ apply LinearMap.ext
45
+ intro x
46
+ apply Subtype.ext
47
+ change (0 : L × R) • x.val = 0
48
+ exact zero_smul (L × R) x.val
49
+ map_add' r s := by
50
+ apply LinearMap.ext
51
+ intro x
52
+ apply Subtype.ext
53
+ change ((r+s,(0:R)) : L × R) • x.val = (r,(0:R)) • x.val + (s,(0:R)) • x.val
54
+ simpa only [Prod.mk_add_mk,add_zero] using add_smul ((r,(0:R)) : L × R) (s,(0:R)) x.val
55
+ map_mul' r s := by
56
+ apply LinearMap.ext
57
+ intro x
58
+ apply Subtype.ext
59
+ change ((r*s,(0:R)) : L × R) • x.val = (r,(0:R)) • ((s,(0:R)) • x.val)
60
+ rw [← mul_smul]
61
+ have h : ((r,(0:R)) : L × R) * (s,0) = (r*s,0) := by ext <;> simp
62
+ rw [h]
63
+
64
+ instance firstModule : Module L (firstSpace L R M) := Module.compHom _ (firstAction L R M)
65
+
66
+ abbrev firstObject : ModuleCat.{v} L := ModuleCat.of L (firstSpace L R M)
67
+
68
+ variable {M} {N : ModuleCat.{v} (L × R)}
69
+
70
+ def firstMap (f : M ⟶ N) : firstSpace L R M →ₗ[L] firstSpace L R N where
71
+ toFun x := ⟨f.hom x.val, by
72
+ change ((1,0) : L × R) • f.hom x.val = f.hom x.val
73
+ rw [← f.hom.map_smul,x.property]⟩
74
+ map_add' x y := Subtype.ext (f.hom.map_add _ _)
75
+ map_smul' r x := Subtype.ext (f.hom.map_smul ((r,(0:R)) : L × R) x.val)
76
+
77
+ /-- The actual component functor, constructed on every module and map. -/
78
+ def firstFunctor : ModuleCat.{v} (L × R) ⥤ ModuleCat.{v} L where
79
+ obj M := firstObject L R M
80
+ map f := ModuleCat.ofHom (firstMap L R f)
81
+ map_id M := by rfl
82
+ map_comp f g := by rfl
83
+
84
+ /-- Surjections remain surjections on the selected component, by projecting a preimage. -/
85
+ theorem firstMap_surjective (f : M ⟶ N) (hf : Function.Surjective f.hom) :
86
+ Function.Surjective (firstMap L R f) := by
87
+ intro y
88
+ obtain ⟨x,hx⟩ := hf y.val
89
+ refine ⟨⟨((1,0) : L × R) • x,?_⟩,?_⟩
90
+ · change ((1,0) : L × R) • (((1,0) : L × R) • x) = ((1,0) : L × R) • x
91
+ rw [← mul_smul]
92
+ have h : ((1,0) : L × R) * (1,0) = (1,0) := by ext <;> simp
93
+ rw [h]
94
+ · apply Subtype.ext
95
+ change f.hom (((1,0) : L × R) • x) = y.val
96
+ rw [f.hom.map_smul,hx,y.property]
97
+ end LittleFinitistic.ProductModules
98
+
99
+ end
100
+
101
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductDimension.lean ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryProductProjective
2
+ import Mathlib.Algebra.Category.ModuleCat.ProjectiveDimension
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory
7
+ namespace LittleFinitistic.ProductModules
8
+ universe u v
9
+ variable (L R : Type u) [Ring L] [Ring R] [Small.{v} L] [Small.{v} R]
10
+
11
+ omit [Small.{v} L] [Small.{v} R] in
12
+ /-- Exactness of actual inflation, with the module universe independent of the ring universe. -/
13
+ theorem firstInflation_preservesHomology :
14
+ (firstInflation.{u,v} L R).PreservesHomology :=
15
+ CategoryTheory.Functor.preservesHomology_of_map_exact _ (fun K hK => by
16
+ rw [ShortComplex.moduleCat_exact_iff] at hK ⊢
17
+ exact hK)
18
+
19
+ omit [Small.{v} R] in
20
+ /-- Inflation from a factor preserves finite projective-dimension bounds, via actual projective covers. -/
21
+ theorem firstInflation_dimensionLE (n : ℕ) (M : ModuleCat.{v} L) [HasProjectiveDimensionLE M n] :
22
+ HasProjectiveDimensionLE ((firstInflation L R).obj M) n := by
23
+ induction n generalizing M with
24
+ | zero =>
25
+ have : Projective M := (projective_iff_hasProjectiveDimensionLT_one (X := M)).mpr inferInstance
26
+ have := firstInflation_projective L R M
27
+ infer_instance
28
+ | succ n ih =>
29
+ let S := M.projectiveShortComplex
30
+ have hS := M.shortExact_projectiveShortComplex
31
+ have : HasProjectiveDimensionLT S.X₁ (n+1) :=
32
+ (hS.hasProjectiveDimensionLT_X₃_iff n inferInstance).mp inferInstance
33
+ have hk := ih S.X₁
34
+ have hp := firstInflation_projective L R S.X₂
35
+ have := firstInflation_preservesHomology.{u,v} L R
36
+ have : Mono ((firstInflation L R).map S.f) :=
37
+ (ModuleCat.mono_iff_injective _).mpr ((ModuleCat.mono_iff_injective S.f).mp hS.mono_f)
38
+ have : Epi ((firstInflation L R).map S.g) :=
39
+ (ModuleCat.epi_iff_surjective _).mpr ((ModuleCat.epi_iff_surjective S.g).mp hS.epi_g)
40
+ have hs : (S.map (firstInflation L R)).ShortExact := hS.map (firstInflation L R)
41
+ exact (hs.hasProjectiveDimensionLT_X₃_iff n hp).mpr hk
42
+ end LittleFinitistic.ProductModules
43
+
44
+ end
45
+
46
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductOpposite.lean ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryProductSecondDimension
2
+ import Mathlib.Algebra.Algebra.Opposite
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory
7
+ namespace LittleFinitistic.ProductModules
8
+ universe u v
9
+ variable (L R : Type u) [Ring L] [Ring R]
10
+
11
+ /-- The opposite of the actual product ring is the product of the two opposite rings. -/
12
+ def oppositeEquiv : (L × R)ᵐᵒᵖ ≃+* Lᵐᵒᵖ × Rᵐᵒᵖ where
13
+ toFun x := (MulOpposite.op x.unop.1,MulOpposite.op x.unop.2)
14
+ invFun x := MulOpposite.op (x.1.unop,x.2.unop)
15
+ left_inv _ := rfl
16
+ right_inv _ := rfl
17
+ map_add' _ _ := rfl
18
+ map_mul' _ _ := rfl
19
+
20
+ abbrev oppositeModule (M : ModuleCat.{v} (L × R)ᵐᵒᵖ) : ModuleCat.{v} (Lᵐᵒᵖ × Rᵐᵒᵖ) :=
21
+ (ModuleCat.restrictScalars (oppositeEquiv L R).symm.toRingHom).obj M
22
+
23
+ attribute [local instance] RingHomInvPair.of_ringEquiv
24
+
25
+ def oppositeModuleEquiv (M : ModuleCat.{v} (L × R)ᵐᵒᵖ) :
26
+ M ≃ₛₗ[RingHomClass.toRingHom (oppositeEquiv L R)] oppositeModule L R M where
27
+ toFun x := x
28
+ invFun x := x
29
+ left_inv _ := rfl
30
+ right_inv _ := rfl
31
+ map_add' _ _ := rfl
32
+ map_smul' _ _ := rfl
33
+
34
+ variable [Small.{v} L] [Small.{v} R]
35
+
36
+ theorem opposite_product_module_bound (n : ℕ)
37
+ (hL : ∀ M : ModuleCat.{v} Lᵐᵒᵖ, projectiveDimension M ≤ (n : ℕ))
38
+ (hR : ∀ M : ModuleCat.{v} Rᵐᵒᵖ, projectiveDimension M ≤ (n : ℕ))
39
+ (M : ModuleCat.{v} (L × R)ᵐᵒᵖ) : projectiveDimension M ≤ (n : ℕ) := by
40
+ let : Small.{v} Lᵐᵒᵖ := small_of_injective (@MulOpposite.unop_injective L)
41
+ let : Small.{v} Rᵐᵒᵖ := small_of_injective (@MulOpposite.unop_injective R)
42
+ let : Small.{v} (L × R)ᵐᵒᵖ := small_of_injective (@MulOpposite.unop_injective (L × R))
43
+ rw [ModuleCat.projectiveDimension_eq_of_semiLinearEquiv (oppositeEquiv L R) (oppositeModuleEquiv L R M)]
44
+ exact product_module_bound Lᵐᵒᵖ Rᵐᵒᵖ n hL hR (oppositeModule L R M)
45
+ end LittleFinitistic.ProductModules
46
+
47
+ end
48
+
49
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductProjective.lean ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryProductComponent
2
+
3
+ namespace OAI
4
+ noncomputable section
5
+ open CategoryTheory
6
+ namespace LittleFinitistic.ProductModules
7
+ universe u v
8
+ variable (L R : Type u) [Ring L] [Ring R]
9
+
10
+ abbrev firstInflation : ModuleCat.{v} L ⥤ ModuleCat.{v} (L × R) :=
11
+ ModuleCat.restrictScalars (RingHom.fst L R)
12
+
13
+ variable {P : ModuleCat.{v} L} {M : ModuleCat.{v} (L × R)}
14
+
15
+ def intoFirst (g : (firstInflation L R).obj P ⟶ M) : P ⟶ firstObject L R M :=
16
+ ModuleCat.ofHom
17
+ { toFun := fun x => ⟨g.hom x, by
18
+ have h := g.hom.map_smul ((1,0) : L × R) x
19
+ change g.hom ((1:L) • x) = ((1,0) : L × R) • g.hom x at h
20
+ rw [one_smul] at h
21
+ exact h.symm⟩
22
+ map_add' := fun x y => Subtype.ext (g.hom.map_add x y)
23
+ map_smul' := fun r x => Subtype.ext (g.hom.map_smul ((r,0) : L × R) x) }
24
+
25
+ theorem firstSpace_product_smul (d : L × R) (x : firstSpace L R M) :
26
+ d • x.val = ((d.1,0) : L × R) • x.val := by
27
+ have he : d * ((1,0) : L × R) = (d.1,0) := by ext <;> simp
28
+ calc
29
+ d • x.val = d • (((1,0) : L × R) • x.val) := by rw [x.property]
30
+ _ = (d * ((1,0) : L × R)) • x.val := (mul_smul _ _ _).symm
31
+ _ = _ := by rw [he]
32
+
33
+ def outOfFirst (g : P ⟶ firstObject L R M) : (firstInflation L R).obj P ⟶ M := by
34
+ letI : Module (L × R) P := Module.compHom P (RingHom.fst L R)
35
+ exact ModuleCat.ofHom (show (firstInflation L R).obj P →ₗ[L × R] M from
36
+ { toFun := fun x => (g.hom x).val
37
+ map_add' := fun x y => congrArg Subtype.val (g.hom.map_add x y)
38
+ map_smul' := fun d x => by
39
+ have h := congrArg Subtype.val (g.hom.map_smul d.1 x)
40
+ exact h.trans (firstSpace_product_smul L R d (g.hom x)).symm })
41
+
42
+ /-- Inflation from one factor preserves actual projective objects. -/
43
+ theorem firstInflation_projective (P : ModuleCat.{v} L) [Projective P] :
44
+ Projective ((firstInflation L R).obj P) := by
45
+ refine ⟨fun g E he => ?_⟩
46
+ let e : firstObject L R _ ⟶ firstObject L R _ := (firstFunctor L R).map E
47
+ let g' := intoFirst L R g
48
+ let : Epi e := (ModuleCat.epi_iff_surjective e).mpr
49
+ (firstMap_surjective L R E ((ModuleCat.epi_iff_surjective E).mp he))
50
+ let h := Projective.factorThru g' e
51
+ refine ⟨outOfFirst L R h,?_⟩
52
+ apply ModuleCat.hom_ext
53
+ apply LinearMap.ext
54
+ intro x
55
+ have hh := congrArg (fun f => f.hom x) (Projective.factorThru_comp g' e)
56
+ exact congrArg Subtype.val hh
57
+ end LittleFinitistic.ProductModules
58
+
59
+ end
60
+
61
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductSecondDimension.lean ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryProductDimension
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryProductSplitting
3
+ import Mathlib.Algebra.Category.ModuleCat.Biproducts
4
+
5
+ namespace OAI
6
+ noncomputable section
7
+ open CategoryTheory
8
+ namespace LittleFinitistic.ProductModules
9
+ universe u v
10
+ variable (L R : Type u) [Ring L] [Ring R]
11
+
12
+ attribute [local instance] RingHomInvPair.of_ringEquiv
13
+
14
+ /-- Swapping product factors identifies the two actual inflation constructions. -/
15
+ def swapInflationEquiv (P : ModuleCat.{v} R) :
16
+ (firstInflation R L).obj P ≃ₛₗ[RingHomClass.toRingHom (RingEquiv.prodComm : R × L ≃+* L × R)]
17
+ (secondInflation L R).obj P where
18
+ toFun x := x
19
+ invFun x := x
20
+ left_inv _ := rfl
21
+ right_inv _ := rfl
22
+ map_add' _ _ := rfl
23
+ map_smul' _ _ := rfl
24
+
25
+ variable [Small.{v} L] [Small.{v} R]
26
+
27
+ theorem secondInflation_dimensionLE (n : ℕ) (P : ModuleCat.{v} R) [HasProjectiveDimensionLE P n] :
28
+ HasProjectiveDimensionLE ((secondInflation L R).obj P) n := by
29
+ have := firstInflation_dimensionLE R L n P
30
+ exact ModuleCat.hasProjectiveDimensionLE_of_semiLinearEquiv
31
+ (RingEquiv.prodComm : R × L ≃+* L × R) (swapInflationEquiv L R P) n
32
+
33
+ /-- Each module over the product has the same finite bound as its two factors. -/
34
+ theorem product_module_bound (n : ℕ)
35
+ (hL : ∀ M : ModuleCat.{v} L, projectiveDimension M ≤ (n : ℕ))
36
+ (hR : ∀ M : ModuleCat.{v} R, projectiveDimension M ≤ (n : ℕ))
37
+ (M : ModuleCat.{v} (L × R)) : projectiveDimension M ≤ (n : ℕ) := by
38
+ have : HasProjectiveDimensionLE (firstObject L R M) n := (projectiveDimension_le_iff _ n).mp (hL _)
39
+ have : HasProjectiveDimensionLE (secondObject L R M) n := (projectiveDimension_le_iff _ n).mp (hR _)
40
+ have := firstInflation_dimensionLE L R n (firstObject L R M)
41
+ have := secondInflation_dimensionLE L R n (secondObject L R M)
42
+ let e := ModuleCat.biprodIsoProd ((firstInflation L R).obj (firstObject L R M))
43
+ ((secondInflation L R).obj (secondObject L R M))
44
+ have : HasProjectiveDimensionLT (pairObject L R M) (n+1) := hasProjectiveDimensionLT_of_iso e (n+1)
45
+ have : HasProjectiveDimensionLT M (n+1) :=
46
+ hasProjectiveDimensionLT_of_iso (splitting L R M).toModuleIso.symm (n+1)
47
+ exact (projectiveDimension_le_iff _ n).mpr inferInstance
48
+ end LittleFinitistic.ProductModules
49
+
50
+ end
51
+
52
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProductSplitting.lean ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryProductProjective
2
+ import Mathlib.Algebra.Ring.Prod
3
+ import Mathlib.Algebra.Category.ModuleCat.Limits
4
+ import Mathlib.Tactic.Abel
5
+
6
+ namespace OAI
7
+ noncomputable section
8
+ open CategoryTheory
9
+ namespace LittleFinitistic.ProductModules
10
+ universe u v
11
+ variable (L R : Type u) [Ring L] [Ring R]
12
+
13
+ abbrev secondInflation : ModuleCat.{v} R ⥤ ModuleCat.{v} (L × R) :=
14
+ ModuleCat.restrictScalars (RingHom.snd L R)
15
+
16
+ abbrev swapModule (M : ModuleCat.{v} (L × R)) : ModuleCat.{v} (R × L) :=
17
+ (ModuleCat.restrictScalars (RingEquiv.prodComm : R × L ≃+* L × R).toRingHom).obj M
18
+
19
+ abbrev secondObject (M : ModuleCat.{v} (L × R)) : ModuleCat.{v} R :=
20
+ firstObject R L (swapModule L R M)
21
+
22
+ abbrev pairObject (M : ModuleCat.{v} (L × R)) : ModuleCat.{v} (L × R) := ModuleCat.of (L × R)
23
+ (((firstInflation L R).obj (firstObject L R M)) × ((secondInflation L R).obj (secondObject L R M)))
24
+
25
+ variable (M : ModuleCat.{v} (L × R))
26
+
27
+ def splitTo : M →ₗ[L × R] pairObject L R M where
28
+ toFun m := (⟨((1,0) : L × R) • m, by
29
+ change ((1,0) : L × R) • (((1,0) : L × R) • m) = ((1,0) : L × R) • m
30
+ rw [← mul_smul]
31
+ have h : ((1,0) : L × R) * (1,0) = (1,0) := by ext <;> simp
32
+ rw [h]⟩, ⟨((0,1) : L × R) • m, by
33
+ change ((0,1) : L × R) • (((0,1) : L × R) • m) = ((0,1) : L × R) • m
34
+ rw [← mul_smul]
35
+ have h : ((0,1) : L × R) * (0,1) = (0,1) := by ext <;> simp
36
+ rw [h]⟩)
37
+ map_add' x y := Prod.ext (Subtype.ext (smul_add _ _ _)) (Subtype.ext (smul_add _ _ _))
38
+ map_smul' d m := by
39
+ apply Prod.ext
40
+ · apply Subtype.ext
41
+ change ((1,0) : L × R) • (d • m) = ((d.1,0) : L × R) • (((1,0) : L × R) • m)
42
+ rw [← mul_smul,← mul_smul]
43
+ congr 1
44
+ ext <;> simp
45
+ · apply Subtype.ext
46
+ change ((0,1) : L × R) • (d • m) = ((0,d.2) : L × R) • (((0,1) : L × R) • m)
47
+ rw [← mul_smul,← mul_smul]
48
+ congr 1
49
+ ext <;> simp
50
+
51
+ def joinTo : pairObject L R M →ₗ[L × R] M where
52
+ toFun x := x.1.val + (show M from x.2.val)
53
+ map_add' x y := by
54
+ change (x.1.val+y.1.val) + ((show M from x.2.val)+(show M from y.2.val)) =
55
+ (x.1.val+(show M from x.2.val)) + (y.1.val+(show M from y.2.val))
56
+ abel
57
+ map_smul' d x := by
58
+ have h₁ := firstSpace_product_smul L R d x.1
59
+ have h₂ := firstSpace_product_smul R L (M := swapModule L R M) (d.2,d.1) x.2
60
+ change ((d.1,0) : L × R) • x.1.val + ((0,d.2) : L × R) • (show M from x.2.val) = d • (x.1.val + (show M from x.2.val))
61
+ rw [smul_add,← h₁]
62
+ exact congrArg (fun y : swapModule L R M => d • x.1.val + (show M from y)) h₂.symm
63
+
64
+ /-- Every module over a product ring splits into its two actual central-idempotent components. -/
65
+ def splitting : M ≃ₗ[L × R] pairObject L R M where
66
+ __ := splitTo L R M
67
+ invFun := joinTo L R M
68
+ left_inv m := by
69
+ change ((1,0) : L × R) • m + ((0,1) : L × R) • m = m
70
+ rw [← add_smul]
71
+ have h : ((1,0) : L × R) + (0,1) = 1 := by ext <;> simp
72
+ rw [h,one_smul]
73
+ right_inv x := by
74
+ have h₁ : ((1,0) : L × R) • x.1.val = x.1.val := x.1.property
75
+ have h₂ : ((0,1) : L × R) • (show M from x.2.val) = (show M from x.2.val) := x.2.property
76
+ have hz₁ : ((0,1) : L × R) • x.1.val = 0 := by
77
+ calc
78
+ _ = ((0,1) : L × R) • (((1,0) : L × R) • x.1.val) := by rw [h₁]
79
+ _ = 0 := by
80
+ rw [← mul_smul]
81
+ have h : ((0,1) : L × R) * (1,0) = 0 := by ext <;> simp
82
+ rw [h,zero_smul]
83
+ have hz₂ : ((1,0) : L × R) • (show M from x.2.val) = 0 := by
84
+ calc
85
+ _ = ((1,0) : L × R) • (((0,1) : L × R) • (show M from x.2.val)) := by rw [h₂]
86
+ _ = 0 := by
87
+ rw [← mul_smul]
88
+ have h : ((1,0) : L × R) * (0,1) = 0 := by ext <;> simp
89
+ rw [h,zero_smul]
90
+ apply Prod.ext
91
+ · apply Subtype.ext
92
+ change ((1,0) : L × R) • (x.1.val + (show M from x.2.val)) = x.1.val
93
+ rw [smul_add,h₁,hz₂,add_zero]
94
+ · apply Subtype.ext
95
+ change ((0,1) : L × R) • (x.1.val + (show M from x.2.val)) = (show M from x.2.val)
96
+ rw [smul_add,hz₁,h₂,zero_add]
97
+ end LittleFinitistic.ProductModules
98
+
99
+ end
100
+
101
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryProjectiveTensor.lean ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryFreeTensorExactness
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryFixedTensorFunctor
3
+ import OAI.Algebra.Finitistic.Tensor.BalancedTensorMaps
4
+ import Mathlib.Algebra.Module.Projective
5
+
6
+ namespace OAI
7
+ noncomputable section
8
+ open CategoryTheory
9
+ namespace LittleFinitistic.BalancedTensor
10
+ universe u
11
+ variable {k A M M' : Type u} [Field k] [Ring A] [Algebra k A]
12
+ variable [AddCommGroup M] [Module k M] [Module Aᵐᵒᵖ M] [IsScalarTower k Aᵐᵒᵖ M]
13
+ variable [AddCommGroup M'] [Module k M'] [Module Aᵐᵒᵖ M'] [IsScalarTower k Aᵐᵒᵖ M']
14
+ variable {N N' N'' : Type u}
15
+ variable [AddCommGroup N] [Module k N] [Module A N] [IsScalarTower k A N]
16
+ variable [AddCommGroup N'] [Module k N'] [Module A N'] [IsScalarTower k A N']
17
+ variable [AddCommGroup N''] [Module k N''] [Module A N''] [IsScalarTower k A N'']
18
+
19
+ theorem mapLeft_mapRightTo (i : M →ₗ[Aᵐᵒᵖ] M') (f : N →ₗ[A] N') (z : Tensor k A M N) :
20
+ mapLeft N' i (mapRightTo f z) = mapRightTo f (mapLeft N i z) := by
21
+ induction z using BalancedTensor.induction_on with
22
+ | hz => simp only [map_zero]
23
+ | ht m n => rfl
24
+ | ha x y hx hy => simp only [map_add,hx,hy]
25
+
26
+ omit [IsScalarTower k A N] in
27
+ theorem mapLeft_split (i : M →ₗ[Aᵐᵒᵖ] M') (p : M' →ₗ[Aᵐᵒᵖ] M)
28
+ (hp : p.comp i = LinearMap.id) (z : Tensor k A M N) :
29
+ mapLeft N p (mapLeft N i z) = z := by
30
+ have hm := congrArg (fun f : Tensor k A M N →ₗ[k] Tensor k A M N => f z)
31
+ (mapLeft_comp (k := k) N i p).symm
32
+ simpa only [hp,mapLeft_id,LinearMap.id_apply,LinearMap.comp_apply] using hm
33
+
34
+ /-- Exactness descends through an actual split right-module retract. -/
35
+ theorem tensor_exact_of_split (i : M →ₗ[Aᵐᵒᵖ] M') (p : M' →ₗ[Aᵐᵒᵖ] M)
36
+ (hp : p.comp i = LinearMap.id) (f : N →ₗ[A] N') (g : N' →ₗ[A] N'')
37
+ (h : Function.Exact f g)
38
+ (h' : Function.Exact (mapRightTo (k := k) (M := M') f) (mapRightTo (k := k) (M := M') g)) :
39
+ Function.Exact (mapRightTo (k := k) (M := M) f) (mapRightTo (k := k) (M := M) g) := by
40
+ intro z
41
+ constructor
42
+ · intro hz
43
+ have hi : mapRightTo g (mapLeft N' i z) = 0 := by
44
+ rw [← mapLeft_mapRightTo,hz,map_zero]
45
+ obtain ⟨y,hy⟩ := (h' _).mp hi
46
+ refine ⟨mapLeft N p y, ?_⟩
47
+ rw [← mapLeft_mapRightTo,hy,mapLeft_split i p hp]
48
+ · rintro ⟨y,rfl⟩
49
+ induction y using BalancedTensor.induction_on with
50
+ | hz => simp only [map_zero]
51
+ | ht m n => rw [mapRightTo_mk,mapRightTo_mk,(h (f n)).mpr ⟨n,rfl⟩,map_zero]
52
+ | ha x y hx hy => simp only [map_add,hx,hy,add_zero]
53
+
54
+ /-- Projectivity of the actual right module suffices, with no hypothesis on the left modules. -/
55
+ theorem projectiveTensor_exact [Module.Projective Aᵐᵒᵖ M]
56
+ (f : N →ₗ[A] N') (g : N' →ₗ[A] N'') (h : Function.Exact f g) :
57
+ Function.Exact (mapRightTo (k := k) (M := M) f) (mapRightTo (k := k) (M := M) g) := by
58
+ obtain ⟨i,hi⟩ := (Module.projective_def' (R := Aᵐᵒᵖ) (P := M)).mp inferInstance
59
+ exact tensor_exact_of_split i (Finsupp.linearCombination Aᵐᵒᵖ id) hi f g h
60
+ (Free.tensor_exact (k := k) M f g h)
61
+
62
+ variable (k A M)
63
+
64
+ theorem projectiveTensor_mapsExact [Module.Projective Aᵐᵒᵖ M]
65
+ (S : ShortComplex (ModuleCat.{u} A)) (hS : S.Exact) :
66
+ (S.map (fixedTensorFunctor k A M)).Exact := by
67
+ rw [ShortComplex.moduleCat_exact_iff]
68
+ have h : Function.Exact
69
+ (S.f.hom : ScalarLeftModule k A S.X₁ →ₗ[A] ScalarLeftModule k A S.X₂)
70
+ (S.g.hom : ScalarLeftModule k A S.X₂ →ₗ[A] ScalarLeftModule k A S.X₃) := by
71
+ intro n
72
+ constructor
73
+ · exact (ShortComplex.moduleCat_exact_iff S).mp hS n
74
+ · rintro ⟨m,rfl⟩
75
+ exact congrArg (fun f => f.hom m) S.zero
76
+ have ht := @projectiveTensor_exact k A M _ _ _ _ _ _ _
77
+ (ScalarLeftModule k A S.X₁) (ScalarLeftModule k A S.X₂) (ScalarLeftModule k A S.X₃)
78
+ _ _ _ (scalarLeftTower k A S.X₁)
79
+ _ _ _ (scalarLeftTower k A S.X₂) _ _ _ (scalarLeftTower k A S.X₃)
80
+ _ S.f.hom S.g.hom h
81
+ intro z hz
82
+ exact (ht z).mp hz
83
+
84
+ theorem projectiveTensor_preservesHomology [Module.Projective Aᵐᵒᵖ M] :
85
+ (fixedTensorFunctor k A M).PreservesHomology :=
86
+ Functor.preservesHomology_of_map_exact _ (projectiveTensor_mapsExact k A M)
87
+
88
+ /-- Degree-zero projective tensor preserves quasi-isomorphisms of arbitrary complexes. -/
89
+ theorem projectiveTensor_quasiIso [Module.Projective Aᵐᵒᵖ M]
90
+ {Z Z' : CochainComplex (ModuleCat.{u} A) ℤ} (f : Z ⟶ Z') [QuasiIso f] :
91
+ QuasiIso (((fixedTensorFunctor k A M).mapHomologicalComplex (.up ℤ)).map f) := by
92
+ let := projectiveTensor_preservesHomology k A M
93
+ infer_instance
94
+ end LittleFinitistic.BalancedTensor
95
+
96
+ end
97
+
98
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryResolutionComplex.lean ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryTerminalResolution
2
+ import Mathlib.Algebra.Homology.HomologicalComplex
3
+ import Mathlib.Algebra.Category.ModuleCat.Projective
4
+ import Mathlib.Algebra.Category.ModuleCat.Abelian
5
+
6
+ namespace OAI
7
+ noncomputable section
8
+ open CategoryTheory Limits
9
+ namespace LittleFinitistic.OrdinarySimulation.ChainAlgebra
10
+ universe u
11
+ variable (k : Type u) [Field k] (l : ℕ)
12
+
13
+ /-- Extending the source idempotents by zero keeps all right ideals in the same C. -/
14
+ def extendedVertex (n : ℕ) : ChainAlgebra k l :=
15
+ if h : n ≤ l then vertex k l ⟨n,by omega⟩ else 0
16
+
17
+ def extendedArrow (n : ℕ) : ChainAlgebra k l :=
18
+ if h : n < l then arrow k l ⟨n,h⟩ else 0
19
+
20
+ theorem extendedVertex_idempotent (n : ℕ) :
21
+ extendedVertex k l n * extendedVertex k l n = extendedVertex k l n := by
22
+ unfold extendedVertex
23
+ split
24
+ · exact vertex_idempotent k l _
25
+ · exact zero_mul _
26
+
27
+ theorem extendedArrow_target (n : ℕ) :
28
+ extendedVertex k l (n+1) * extendedArrow k l n = extendedArrow k l n := by
29
+ by_cases h : n < l
30
+ · have h1 : n+1 ≤ l := by omega
31
+ simp only [extendedVertex, extendedArrow, dite_eq_left h, dite_eq_left h1]
32
+ exact vertex_target_arrow k l ⟨n,h⟩
33
+ · rw [extendedArrow, dite_eq_right h, mul_zero]
34
+
35
+ theorem extendedArrow_square (n : ℕ) : extendedArrow k l (n+1) * extendedArrow k l n = 0 := by
36
+ by_cases h1 : n+1 < l
37
+ · have h0 : n < l := by omega
38
+ simp only [extendedArrow, dite_eq_left h1, dite_eq_left h0, arrow_mul_arrow]
39
+ · rw [extendedArrow, dite_eq_right h1, zero_mul]
40
+
41
+ abbrev resolutionIdeal (n : ℕ) := IdempotentTensor.rightIdeal (extendedVertex k l n)
42
+ abbrev resolutionTerm (n : ℕ) : ModuleCat.{u} (ChainAlgebra k l)ᵐᵒᵖ :=
43
+ ModuleCat.of _ (resolutionIdeal k l n)
44
+
45
+ /-- Actual left-arrow differentials, with no transport of module types. -/
46
+ def resolutionDifferential (n : ℕ) : resolutionTerm k l n ⟶ resolutionTerm k l (n+1) :=
47
+ ModuleCat.ofHom (((leftMultiply (extendedArrow k l n)).comp (resolutionIdeal k l n).subtype).codRestrict _
48
+ (fun x => by
49
+ change extendedVertex k l (n+1) * (extendedArrow k l n * x.val) = extendedArrow k l n * x.val
50
+ rw [← mul_assoc, extendedArrow_target]))
51
+
52
+ theorem resolutionDifferential_square (n : ℕ) :
53
+ resolutionDifferential k l n ≫ resolutionDifferential k l (n+1) = 0 := by
54
+ ext x
55
+ change extendedArrow k l (n+1) * (extendedArrow k l n * x.val) = 0
56
+ rw [← mul_assoc, extendedArrow_square, zero_mul]
57
+
58
+ /-- The source's projective complex, extended by zero after degree l. -/
59
+ def terminalProjectiveComplex : CochainComplex (ModuleCat.{u} (ChainAlgebra k l)ᵐᵒᵖ) ℕ :=
60
+ CochainComplex.of (resolutionTerm k l) (resolutionDifferential k l) (resolutionDifferential_square k l)
61
+
62
+ theorem resolutionTerm_projective (n : ℕ) : Projective (resolutionTerm k l n) := by
63
+ let : Module.Projective (ChainAlgebra k l)ᵐᵒᵖ (ChainAlgebra k l) := Module.Projective.of_equiv rightRegularEquiv
64
+ let r : ChainAlgebra k l →ₗ[(ChainAlgebra k l)ᵐᵒᵖ] resolutionIdeal k l n :=
65
+ (leftMultiply (extendedVertex k l n)).codRestrict _ (fun x => by
66
+ change extendedVertex k l n * (extendedVertex k l n * x) = extendedVertex k l n * x
67
+ rw [← mul_assoc, extendedVertex_idempotent])
68
+ have : Module.Projective (ChainAlgebra k l)ᵐᵒᵖ (resolutionIdeal k l n) :=
69
+ Module.Projective.of_split (resolutionIdeal k l n).subtype r (by ext x; exact x.property)
70
+ infer_instance
71
+
72
+ theorem resolutionTerm_vanishes (n : ℕ) (h : l < n) : IsZero (resolutionTerm k l n) := by
73
+ apply ModuleCat.isZero_iff_subsingleton.mpr
74
+ have hz (x : resolutionIdeal k l n) : x = 0 := by
75
+ apply Subtype.ext
76
+ have hp := x.property
77
+ change extendedVertex k l n * x.val = x.val at hp
78
+ rw [extendedVertex, dite_eq_right (Nat.not_le.mpr h), zero_mul] at hp
79
+ exact hp.symm
80
+ exact ⟨fun x y => (hz x).trans (hz y).symm⟩
81
+ end LittleFinitistic.OrdinarySimulation.ChainAlgebra
82
+
83
+ end
84
+
85
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryResolutionExact.lean ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryResolutionComplex
2
+ import Mathlib.Algebra.Homology.ShortComplex.ModuleCat
3
+ import Mathlib.Algebra.Homology.Single
4
+
5
+ namespace OAI
6
+ noncomputable section
7
+ open CategoryTheory Limits
8
+ namespace LittleFinitistic.OrdinarySimulation.ChainAlgebra
9
+ universe u
10
+ variable (k : Type u) [Field k] (l : ℕ)
11
+
12
+ /-- In the supported range, the extended ideal is the source's actual right projective. -/
13
+ def supportedIdealEquiv (n : ℕ) (h : n ≤ l) :
14
+ resolutionIdeal k l n ≃ₗ[(ChainAlgebra k l)ᵐᵒᵖ] rightTerm (k := k) (⟨n,by omega⟩ : Fin (l+1)) where
15
+ toFun x := ⟨x.val, by
16
+ have hp := x.property
17
+ change extendedVertex k l n * x.val = x.val at hp
18
+ change vertex k l ⟨n,by omega⟩ * x.val = x.val
19
+ simpa only [extendedVertex, dite_eq_left h] using hp⟩
20
+ invFun x := ⟨x.val, by
21
+ change extendedVertex k l n * x.val = x.val
22
+ rw [extendedVertex, dite_eq_left h]
23
+ exact x.property⟩
24
+ left_inv _ := rfl
25
+ right_inv _ := rfl
26
+ map_add' _ _ := rfl
27
+ map_smul' _ _ := rfl
28
+
29
+ @[simp] theorem supportedIdealEquiv_d (n : ℕ) (h : n < l) (x : resolutionIdeal k l n) :
30
+ supportedIdealEquiv k l (n+1) (by omega) ((resolutionDifferential k l n).hom x) =
31
+ resolutionMap (k := k) ⟨n,h⟩ (supportedIdealEquiv k l n (by omega) x) := by
32
+ apply Subtype.ext
33
+ change extendedArrow k l n * x.val = arrow k l ⟨n,h⟩ * x.val
34
+ rw [extendedArrow, dite_eq_left h]
35
+
36
+ /-- The actual bundled complex is exact at every interior degree. -/
37
+ theorem supported_complex_exact (n : ℕ) (h : n+1 < l) :
38
+ (ShortComplex.mk (resolutionDifferential k l n) (resolutionDifferential k l (n+1))
39
+ (resolutionDifferential_square k l n)).Exact := by
40
+ rw [ShortComplex.moduleCat_exact_iff]
41
+ intro x hx
42
+ have hx' := congrArg (supportedIdealEquiv k l (n+2) (by omega)) hx
43
+ rw [supportedIdealEquiv_d k l (n+1) h, map_zero] at hx'
44
+ obtain ⟨y,hy⟩ := (resolution_exact (k := k) n h (supportedIdealEquiv k l (n+1) (by omega) x)).mp hx'
45
+ refine ⟨(supportedIdealEquiv k l n (by omega)).symm y, ?_⟩
46
+ apply (supportedIdealEquiv k l (n+1) (by omega)).injective
47
+ rw [supportedIdealEquiv_d k l n (by omega), LinearEquiv.apply_symm_apply, hy]
48
+
49
+ /-- The actual augmentation of the bundled complex in its last degree. -/
50
+ def resolutionAugmentation : resolutionTerm k l l ⟶ ModuleCat.of (ChainAlgebra k l)ᵐᵒᵖ (TerminalSimple k) :=
51
+ ModuleCat.ofHom ((augmentation k l).comp (supportedIdealEquiv k l l le_rfl).toLinearMap)
52
+
53
+ /-- A genuine chain map to the terminal simple placed in degree l. -/
54
+ def terminalAugmentationMap : terminalProjectiveComplex k l ⟶
55
+ (HomologicalComplex.single _ (.up ℕ) l).obj (ModuleCat.of (ChainAlgebra k l)ᵐᵒᵖ (TerminalSimple k)) :=
56
+ HomologicalComplex.mkHomToSingle (resolutionAugmentation k l) (by
57
+ intro i hi
58
+ change i+1=l at hi
59
+ subst l
60
+ change CochainComplex.of.d _ _ i (i+1) ≫ resolutionAugmentation k (i+1) = 0
61
+ rw [CochainComplex.of_d]
62
+ ext x
63
+ change (extendedArrow k (i+1) i * x.val).1 (Fin.last (i+1)) = (0:k)
64
+ rw [extendedArrow, dite_eq_left (by omega), mul_diagonal, arrow_diagonal, zero_mul])
65
+ end LittleFinitistic.OrdinarySimulation.ChainAlgebra
66
+
67
+ end
68
+
69
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryResolutionModels.lean ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimoduleDerivedTensor
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimoduleTensorFunctor
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory Limits
7
+ open scoped TensorProduct
8
+ namespace LittleFinitistic
9
+ universe u
10
+
11
+ /-- A finite model for tensoring a genuine bimodule complex, with its support and right projectivity proved. -/
12
+ structure FiniteProjectiveBimoduleComplex (k S A : Type u) [Field k] [Ring S] [Ring A]
13
+ [Algebra k S] [Algebra k A] where
14
+ complex : CochainComplex (ModuleCat.{u} (S ⊗[k] Aᵐᵒᵖ)) ℤ
15
+ size : ℕ
16
+ degrees : Fin size → ℤ
17
+ strictMono : StrictMono degrees
18
+ support : ∀ n, n ∉ Set.range degrees → IsZero (complex.X n)
19
+ rightProjective : ∀ n, Module.Projective Aᵐᵒᵖ (BimoduleCoefficients k S A (complex.X n))
20
+
21
+ namespace FiniteProjectiveBimoduleComplex
22
+ variable {k S A : Type u} [Field k] [Ring S] [Ring A] [Algebra k S] [Algebra k A]
23
+ variable (Q : FiniteProjectiveBimoduleComplex k S A)
24
+
25
+ instance rightTerm_projective (n : ℤ) : Module.Projective Aᵐᵒᵖ
26
+ (ComplexTensor.rightTerm k A (BimoduleComplexTensor.rightComplex k S A Q.complex) n) := Q.rightProjective n
27
+
28
+ abbrev tensorFunctor := BimoduleComplexTensor.totalFunctor k S A Q.complex Q.degrees Q.strictMono
29
+
30
+ /-- The certified model inverts every input quasi-isomorphism; no condition is placed on the input complex. -/
31
+ theorem tensorFunctor_quasiIso {Z Z' : CochainComplex (ModuleCat.{u} A) ℤ} (f : Z ⟶ Z') [QuasiIso f] :
32
+ QuasiIso (Q.tensorFunctor.map f) :=
33
+ BimoduleComplexTensor.totalFunctor_quasiIso k S A Q.complex Q.degrees Q.strictMono f
34
+
35
+ variable [HasDerivedCategory.{u+1} (ModuleCat.{u} A)] [HasDerivedCategory.{u+1} (ModuleCat.{u} S)]
36
+
37
+ def derivedTensor : DerivedCategory (ModuleCat.{u} A) ⥤ DerivedCategory (ModuleCat.{u} S) :=
38
+ BimoduleComplexTensor.derivedTotal k S A Q.complex Q.degrees Q.strictMono
39
+
40
+ def comparison : DerivedCategory.Q ⋙ Q.derivedTensor ≅ Q.tensorFunctor ⋙ DerivedCategory.Q :=
41
+ BimoduleComplexTensor.derivedTotalComparison k S A Q.complex Q.degrees Q.strictMono
42
+ end FiniteProjectiveBimoduleComplex
43
+
44
+ /-- A genuine ordinary bimodule supplied with an actual bounded right-projective resolution. -/
45
+ structure BoundedBimoduleResolution (k S A : Type u) [Field k] [Ring S] [Ring A]
46
+ [Algebra k S] [Algebra k A] (M : ModuleCat.{u} (S ⊗[k] Aᵐᵒᵖ)) extends FiniteProjectiveBimoduleComplex k S A where
47
+ augmentation : complex ⟶ (HomologicalComplex.single _ (.up ℤ) 0).obj M
48
+ augmentation_quasiIso : QuasiIso augmentation
49
+
50
+ namespace BoundedBimoduleResolution
51
+ variable {k S A : Type u} [Field k] [Ring S] [Ring A] [Algebra k S] [Algebra k A]
52
+ variable {M : ModuleCat.{u} (S ⊗[k] Aᵐᵒᵖ)} (Q : BoundedBimoduleResolution k S A M)
53
+ variable (B N : Type u) [Ring B] [Algebra k B]
54
+ variable [AddCommGroup N] [Module k N] [Module A N] [Module Bᵐᵒᵖ N]
55
+ [IsScalarTower k A N] [IsScalarTower k Bᵐᵒᵖ N] [SMulCommClass A Bᵐᵒᵖ N]
56
+ local instance : SMulCommClass Bᵐᵒᵖ A N := ⟨fun b a n => (smul_comm a b n).symm⟩
57
+ variable [HasDerivedCategory.{u+1} (ModuleCat.{u} (S ⊗[k] Bᵐᵒᵖ))]
58
+
59
+ /-- The resolved ordinary tensor object, in the native derived category retaining both outside actions.
60
+ The resolution, its quasi-isomorphism, finite support and right projectivity are fields of Q. -/
61
+ def tensorOrdinary : DerivedCategory (ModuleCat.{u} (S ⊗[k] Bᵐᵒᵖ)) :=
62
+ DerivedCategory.Q.obj (((bimoduleTensorFunctor k S A Bᵐᵒᵖ N).mapHomologicalComplex (.up ℤ)).obj Q.complex)
63
+ end BoundedBimoduleResolution
64
+ end LittleFinitistic
65
+
66
+ end
67
+
68
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryResolutionQuasiIso.lean ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryResolutionExact
2
+ import Mathlib.Algebra.Homology.QuasiIso
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory Limits
7
+ namespace LittleFinitistic.OrdinarySimulation.ChainAlgebra
8
+ universe u
9
+ variable (k : Type u) [Field k] (l : ℕ)
10
+
11
+ theorem resolutionInitial_injective (h : 0 < l) :
12
+ Function.Injective (resolutionDifferential k l 0).hom := by
13
+ intro x y hxy
14
+ apply (supportedIdealEquiv k l 0 (by omega)).injective
15
+ apply resolution_first_injective (k := k) h
16
+ rw [← supportedIdealEquiv_d k l 0 h, ← supportedIdealEquiv_d k l 0 h, hxy]
17
+
18
+ /-- Exactness in every degree except the terminal homology degree. -/
19
+ theorem terminalProjectiveComplex_exactAt (n : ℕ) (hn : n ≠ l) :
20
+ (terminalProjectiveComplex k l).ExactAt n := by
21
+ by_cases h : l < n
22
+ · exact HomologicalComplex.ExactAt.of_isZero (resolutionTerm_vanishes k l n h)
23
+ have hnl : n < l := by omega
24
+ cases n with
25
+ | zero =>
26
+ rw [HomologicalComplex.exactAt_iff, ShortComplex.moduleCat_exact_iff]
27
+ intro x hx
28
+ have hx' : (resolutionDifferential k l 0).hom x = 0 := by
29
+ change ((terminalProjectiveComplex k l).d 0 ((ComplexShape.up ℕ).next 0)).hom x = 0 at hx
30
+ rw [show (ComplexShape.up ℕ).next 0 = 1 by simp] at hx
31
+ change (CochainComplex.of.d (resolutionTerm k l) (resolutionDifferential k l) 0 (0+1)).hom x = 0 at hx
32
+ rw [CochainComplex.of_d] at hx
33
+ exact hx
34
+ have hx0 : x = 0 := resolutionInitial_injective k l hnl (hx'.trans (map_zero _).symm)
35
+ refine ⟨0, ?_⟩
36
+ simp only [hx0, map_zero]
37
+ | succ n =>
38
+ apply (HomologicalComplex.exactAt_iff' _ n (n+1) (n+2) (by simp) (by simp)).2
39
+ change (ShortComplex.mk (CochainComplex.of.d _ _ n (n+1)) (CochainComplex.of.d _ _ (n+1) ((n+1)+1)) _).Exact
40
+ simpa only [CochainComplex.of_d] using supported_complex_exact k l n hnl
41
+
42
+ theorem resolutionAugmentation_surjective : Function.Surjective (resolutionAugmentation k l).hom :=
43
+ (augmentation_surjective k l).comp (supportedIdealEquiv k l l le_rfl).surjective
44
+
45
+ instance resolutionAugmentation_epi : Epi (resolutionAugmentation k l) :=
46
+ (ModuleCat.epi_iff_surjective _).mpr (resolutionAugmentation_surjective k l)
47
+
48
+ theorem resolutionAugmentation_comp (n : ℕ) :
49
+ resolutionDifferential k (n+1) n ≫ resolutionAugmentation k (n+1) = 0 := by
50
+ ext x
51
+ change (extendedArrow k (n+1) n * x.val).1 (Fin.last (n+1)) = (0:k)
52
+ rw [extendedArrow, dite_eq_left (by omega), mul_diagonal, arrow_diagonal, zero_mul]
53
+
54
+ theorem resolutionAugmentation_exact (n : ℕ) :
55
+ (ShortComplex.mk (resolutionDifferential k (n+1) n) (resolutionAugmentation k (n+1))
56
+ (resolutionAugmentation_comp k n)).Exact := by
57
+ rw [ShortComplex.moduleCat_exact_iff]
58
+ intro x hx
59
+ have hx' : augmentation k (n+1) (supportedIdealEquiv k (n+1) (n+1) le_rfl x) = 0 := hx
60
+ obtain ⟨y,hy⟩ := (augmentation_exact k n _).mp hx'
61
+ refine ⟨(supportedIdealEquiv k (n+1) n (by omega)).symm y, ?_⟩
62
+ apply (supportedIdealEquiv k (n+1) (n+1) le_rfl).injective
63
+ rw [supportedIdealEquiv_d k (n+1) n (by omega), LinearEquiv.apply_symm_apply]
64
+ exact hy
65
+
66
+ theorem resolutionAugmentation_zero_injective :
67
+ Function.Injective (resolutionAugmentation k 0).hom :=
68
+ (augmentation_zero_injective k).comp (supportedIdealEquiv k 0 0 le_rfl).injective
69
+
70
+ theorem resolutionDifferential_last_zero : resolutionDifferential k l l = 0 := by
71
+ ext x
72
+ change extendedArrow k l l * x.val = 0
73
+ rw [extendedArrow, dite_eq_right (lt_irrefl l), zero_mul]
74
+
75
+ /-- Postcomposing a short complex's second map by an isomorphism preserves exactness. -/
76
+ theorem exact_post_iso {R : Type u} [Ring R] {X Y Z Z' : ModuleCat.{u} R}
77
+ (f : X ⟶ Y) (g : Y ⟶ Z) (hfg : f ≫ g = 0) (e : Z ≅ Z')
78
+ (h : (ShortComplex.mk f g hfg).Exact) :
79
+ (ShortComplex.mk f (g ≫ e.hom) (by rw [← Category.assoc, hfg, zero_comp])).Exact := by
80
+ rw [ShortComplex.moduleCat_exact_iff] at h ⊢
81
+ intro x hx
82
+ apply h x
83
+ apply (ModuleCat.mono_iff_injective e.hom).mp inferInstance
84
+ exact hx.trans (map_zero _).symm
85
+
86
+ /-- The augmentation is a quasi-isomorphism at the terminal degree. -/
87
+ theorem terminalAugmentationMap_quasiIsoAt_last :
88
+ QuasiIsoAt (terminalAugmentationMap k l) l := by
89
+ rw [quasiIsoAt_iff]
90
+ refine (ShortComplex.quasiIso_iff_of_zeros' _ ?_ ?_ ?_).2 ?_
91
+ · change (terminalProjectiveComplex k l).d l ((ComplexShape.up ℕ).next l) = 0
92
+ rw [show (ComplexShape.up ℕ).next l = l+1 by simp]
93
+ change CochainComplex.of.d (resolutionTerm k l) (resolutionDifferential k l) l (l+1) = 0
94
+ rw [CochainComplex.of_d]
95
+ exact resolutionDifferential_last_zero k l
96
+ · exact HomologicalComplex.single_obj_d (.up ℕ) l (ModuleCat.of (ChainAlgebra k l)ᵐᵒᵖ (TerminalSimple k)) ((ComplexShape.up ℕ).prev l) l
97
+ · exact HomologicalComplex.single_obj_d (.up ℕ) l (ModuleCat.of (ChainAlgebra k l)ᵐᵒᵖ (TerminalSimple k)) l ((ComplexShape.up ℕ).next l)
98
+ · change (ShortComplex.mk ((terminalProjectiveComplex k l).d ((ComplexShape.up ℕ).prev l) l)
99
+ ((terminalAugmentationMap k l).f l) _).Exact ∧ Epi ((terminalAugmentationMap k l).f l)
100
+ have hf : (terminalAugmentationMap k l).f l = resolutionAugmentation k l ≫
101
+ (HomologicalComplex.singleObjXSelf (.up ℕ) l
102
+ (ModuleCat.of (ChainAlgebra k l)ᵐᵒᵖ (TerminalSimple k))).inv := by
103
+ unfold terminalAugmentationMap
104
+ apply HomologicalComplex.mkHomToSingle_f
105
+ simp only [hf]
106
+ constructor
107
+ · refine exact_post_iso _ _ ?_
108
+ (HomologicalComplex.singleObjXSelf (.up ℕ) l
109
+ (ModuleCat.of (ChainAlgebra k l)ᵐᵒᵖ (TerminalSimple k))).symm ?_
110
+ · cases l with
111
+ | zero =>
112
+ have hz := (terminalProjectiveComplex k 0).shape ((ComplexShape.up ℕ).prev 0) 0 (by simp)
113
+ erw [hz, zero_comp]
114
+ | succ n =>
115
+ rw [show (ComplexShape.up ℕ).prev (n+1) = n by simp]
116
+ simp only [terminalProjectiveComplex, CochainComplex.of_d]
117
+ convert resolutionAugmentation_comp k n using 1
118
+ rfl
119
+ cases l with
120
+ | zero =>
121
+ rw [ShortComplex.moduleCat_exact_iff]
122
+ intro x hx
123
+ have hx' : (resolutionAugmentation k 0).hom x = 0 := hx
124
+ have hx0 : x = 0 := resolutionAugmentation_zero_injective k (hx'.trans (map_zero _).symm)
125
+ refine ⟨0, ?_⟩
126
+ simp only [hx0, map_zero]
127
+ | succ n =>
128
+ rw [ShortComplex.moduleCat_exact_iff]
129
+ intro x hx
130
+ obtain ⟨y, hy⟩ := (ShortComplex.moduleCat_exact_iff _).mp
131
+ (resolutionAugmentation_exact k n) x hx
132
+ change ∃ z : resolutionTerm k (n+1) ((ComplexShape.up ℕ).prev (n+1)),
133
+ (CochainComplex.of.d (resolutionTerm k (n+1)) (resolutionDifferential k (n+1))
134
+ ((ComplexShape.up ℕ).prev (n+1)) (n+1)).hom z = x
135
+ rw [show (ComplexShape.up ℕ).prev (n+1) = n by simp]
136
+ exact ⟨y, by simpa only [CochainComplex.of_d] using hy⟩
137
+ · erw [ModuleCat.epi_iff_surjective]
138
+ exact ((ModuleCat.epi_iff_surjective _).mp (inferInstance : Epi
139
+ (HomologicalComplex.singleObjXSelf (.up ℕ) l
140
+ (ModuleCat.of (ChainAlgebra k l)ᵐᵒᵖ (TerminalSimple k))).inv)).comp
141
+ (resolutionAugmentation_surjective k l)
142
+
143
+ /-- The source's finite projective resolution now has its actual augmentation quasi-isomorphism. -/
144
+ theorem terminalAugmentationMap_quasiIso : QuasiIso (terminalAugmentationMap k l) := by
145
+ constructor
146
+ intro n
147
+ by_cases hn : n = l
148
+ · subst n; exact terminalAugmentationMap_quasiIsoAt_last k l
149
+ · apply (quasiIsoAt_iff_exactAt' _ n ?_).2 (terminalProjectiveComplex_exactAt k l n hn)
150
+ exact HomologicalComplex.ExactAt.of_isZero (HomologicalComplex.isZero_single_obj_X _ _ _ _ hn)
151
+ end LittleFinitistic.OrdinarySimulation.ChainAlgebra
152
+
153
+ end
154
+
155
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryRestrictionHomology.lean ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings
2
+ import Mathlib.Algebra.Homology.ShortComplex.ModuleCat
3
+ import Mathlib.Algebra.Homology.ShortComplex.PreservesHomology
4
+ import Mathlib.Algebra.Homology.QuasiIso
5
+
6
+ namespace OAI
7
+ noncomputable section
8
+ open CategoryTheory
9
+ namespace LittleFinitistic.RestrictionHomology
10
+ universe u v
11
+ variable {R S : Type u} [Ring R] [Ring S] (f : R →+* S)
12
+
13
+ theorem mapsExact (K : ShortComplex (ModuleCat.{u} S)) (hK : K.Exact) :
14
+ (K.map (ModuleCat.restrictScalars f)).Exact := by
15
+ rw [ShortComplex.moduleCat_exact_iff] at hK ⊢
16
+ exact hK
17
+
18
+ theorem preservesHomology : (ModuleCat.restrictScalars.{u} f).PreservesHomology :=
19
+ CategoryTheory.Functor.preservesHomology_of_map_exact _ (mapsExact f)
20
+
21
+ theorem quasiIso_iff {I : Type v} {c : ComplexShape I}
22
+ {K L : HomologicalComplex (ModuleCat.{u} S) c} (g : K ⟶ L) :
23
+ QuasiIso (((ModuleCat.restrictScalars f).mapHomologicalComplex c).map g) ↔ QuasiIso g := by
24
+ let := preservesHomology f
25
+ exact HomologicalComplex.quasiIso_map_iff_of_preservesHomology g (ModuleCat.restrictScalars f)
26
+ end LittleFinitistic.RestrictionHomology
27
+
28
+ end
29
+
30
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryRetainedBimodule.lean ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimoduleCoefficients
2
+
3
+ namespace OAI
4
+ noncomputable section
5
+ open scoped TensorProduct
6
+ namespace LittleFinitistic
7
+ universe u
8
+ /-- An ordinary bimodule packaged as a module over its actual tensor algebra. -/
9
+ def RetainedBimodule (_k _S _A M : Type u) := M
10
+ namespace RetainedBimodule
11
+ variable (k S A M : Type u) [Field k] [Ring S] [Ring A] [Algebra k S] [Algebra k A]
12
+ variable [AddCommGroup M] [Module k M] [Module S M] [Module Aᵐᵒᵖ M]
13
+ [IsScalarTower k S M] [IsScalarTower k Aᵐᵒᵖ M] [SMulCommClass S Aᵐᵒᵖ M]
14
+ instance : AddCommGroup (RetainedBimodule k S A M) := inferInstanceAs (AddCommGroup M)
15
+ instance : Module k (RetainedBimodule k S A M) := inferInstanceAs (Module k M)
16
+ instance : Module S (RetainedBimodule k S A M) := inferInstanceAs (Module S M)
17
+ instance : Module Aᵐᵒᵖ (RetainedBimodule k S A M) := inferInstanceAs (Module Aᵐᵒᵖ M)
18
+ instance : IsScalarTower k S (RetainedBimodule k S A M) := inferInstanceAs (IsScalarTower k S M)
19
+ instance : IsScalarTower k Aᵐᵒᵖ (RetainedBimodule k S A M) := inferInstanceAs (IsScalarTower k Aᵐᵒᵖ M)
20
+ instance : SMulCommClass S Aᵐᵒᵖ (RetainedBimodule k S A M) := inferInstanceAs (SMulCommClass S Aᵐᵒᵖ M)
21
+
22
+
23
+ def action : (S ⊗[k] Aᵐᵒᵖ) →ₐ[k] Module.End k (RetainedBimodule k S A M) :=
24
+ show (S ⊗[k] Aᵐᵒᵖ) →ₐ[k] Module.End k M from
25
+ Algebra.TensorProduct.lift (Algebra.lsmul k k M) (Algebra.lsmul k k M) (by
26
+ intro s a
27
+ ext m
28
+ exact smul_comm s a (m : M))
29
+ instance : Module (S ⊗[k] Aᵐᵒᵖ) (RetainedBimodule k S A M) := Module.compHom _ (action k S A M).toRingHom
30
+ instance tower : IsScalarTower k (S ⊗[k] Aᵐᵒᵖ) (RetainedBimodule k S A M) where
31
+ smul_assoc r x m := by
32
+ change action k S A M (r • x) m = r • action k S A M x m
33
+ rw [map_smul]
34
+ rfl
35
+
36
+ variable {k S A M} {M' : Type u}
37
+ variable [AddCommGroup M'] [Module k M'] [Module S M'] [Module Aᵐᵒᵖ M']
38
+ [IsScalarTower k S M'] [IsScalarTower k Aᵐᵒᵖ M'] [SMulCommClass S Aᵐᵒᵖ M']
39
+
40
+ def map (f : M →ₗ[Aᵐᵒᵖ] M') (hf : ∀ (s : S) m, f (s • m) = s • f m) :
41
+ RetainedBimodule k S A M →ₗ[S ⊗[k] Aᵐᵒᵖ] RetainedBimodule k S A M' where
42
+ __ := f.toAddHom
43
+ map_smul' x m := by
44
+ change f (action k S A M x m) = action k S A M' x (f m)
45
+ induction x using TensorProduct.inductionOn with
46
+ | tmul s a =>
47
+ change f (s • (a • (m : M))) = s • (a • f (m : M))
48
+ exact (hf s (a • (m : M))).trans (congrArg (s • ·) (f.map_smul a (m : M)))
49
+ | add x y hx hy =>
50
+ rw [map_add, map_add]
51
+ exact (f.map_add _ _).trans (congrArg₂ (· + ·) hx hy)
52
+ end RetainedBimodule
53
+ end LittleFinitistic
54
+
55
+ end
56
+
57
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryRetainedCongruence.lean ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryRetainedRestriction
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryOffDiagonalMaps
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open scoped TensorProduct
7
+ namespace LittleFinitistic.RetainedBimodule
8
+ universe u
9
+ variable {k S A M N : Type u} [Field k] [Ring S] [Ring A] [Algebra k S] [Algebra k A]
10
+ variable [AddCommGroup M] [Module k M] [Module S M] [Module Aᵐᵒᵖ M]
11
+ [IsScalarTower k S M] [IsScalarTower k Aᵐᵒᵖ M] [SMulCommClass S Aᵐᵒᵖ M]
12
+ variable [AddCommGroup N] [Module k N] [Module S N] [Module Aᵐᵒᵖ N]
13
+ [IsScalarTower k S N] [IsScalarTower k Aᵐᵒᵖ N] [SMulCommClass S Aᵐᵒᵖ N]
14
+
15
+ /-- An actual right-linear, left-equivariant equivalence retains both actions. -/
16
+ def congr (f : M ≃ₗ[Aᵐᵒᵖ] N) (hf : ∀ (s : S) x, f (s • x) = s • f x) :
17
+ RetainedBimodule k S A M ≃ₗ[S ⊗[k] Aᵐᵒᵖ] RetainedBimodule k S A N where
18
+ __ := map (k := k) f.toLinearMap hf
19
+ invFun := f.symm
20
+ left_inv := f.left_inv
21
+ right_inv := f.right_inv
22
+ end LittleFinitistic.RetainedBimodule
23
+ namespace LittleFinitistic.OrdinarySimulation.OffDiagonal
24
+ universe u
25
+ variable {L R O O' T T' : Type u} [Ring L] [Ring R]
26
+ variable [AddCommGroup O] [AddCommGroup O'] [AddCommGroup T] [AddCommGroup T']
27
+ variable [Module Lᵐᵒᵖ O] [Module Lᵐᵒᵖ O'] [Module Rᵐᵒᵖ T] [Module Rᵐᵒᵖ T']
28
+
29
+ def congr (f : O ≃ₗ[Lᵐᵒᵖ] O') (g : T ≃ₗ[Rᵐᵒᵖ] T') :
30
+ OffDiagonal O T ≃ₗ[(L × R)ᵐᵒᵖ] OffDiagonal O' T' where
31
+ toFun x := (f x.1,g x.2)
32
+ invFun x := (f.symm x.1,g.symm x.2)
33
+ left_inv x := Prod.ext (f.left_inv x.1) (g.left_inv x.2)
34
+ right_inv x := Prod.ext (f.right_inv x.1) (g.right_inv x.2)
35
+ map_add' left right := Prod.ext (f.map_add left.1 right.1) (g.map_add left.2 right.2)
36
+ map_smul' d x := Prod.ext (f.map_smul (MulOpposite.op d.unop.1) x.1)
37
+ (g.map_smul (MulOpposite.op d.unop.2) x.2)
38
+ end LittleFinitistic.OrdinarySimulation.OffDiagonal
39
+
40
+ end
41
+
42
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryRetainedRestriction.lean ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryRetainedBimodule
2
+ import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory
7
+ open scoped TensorProduct
8
+ namespace LittleFinitistic.RetainedBimodule
9
+ universe u
10
+ variable (k S A M : Type u) [Field k] [Ring S] [Ring A] [Algebra k S] [Algebra k A]
11
+ variable [AddCommGroup M] [Module k M] [Module S M] [Module Aᵐᵒᵖ M]
12
+ [IsScalarTower k S M] [IsScalarTower k Aᵐᵒᵖ M] [SMulCommClass S Aᵐᵒᵖ M]
13
+
14
+ abbrev object : ModuleCat.{u} (S ⊗[k] Aᵐᵒᵖ) := ModuleCat.of _ (RetainedBimodule k S A M)
15
+
16
+ /-- Recover the exact original right action after packaging the ordinary bimodule. -/
17
+ def rightEquiv : BimoduleCoefficients k S A (object k S A M) ≃ₗ[Aᵐᵒᵖ] M where
18
+ toFun x := x
19
+ invFun x := x
20
+ left_inv _ := rfl
21
+ right_inv _ := rfl
22
+ map_add' _ _ := rfl
23
+ map_smul' r x := by
24
+ change action k S A M ((1:S) ⊗ₜ[k] r) x = _
25
+ unfold action
26
+ erw [Algebra.TensorProduct.lift_tmul]
27
+ change (1:S) • (r • (show M from x)) = r • (show M from x)
28
+ exact one_smul _ _
29
+
30
+ theorem rightEquiv_left (s : S) (x : BimoduleCoefficients k S A (object k S A M)) :
31
+ rightEquiv k S A M (s • x) = s • rightEquiv k S A M x := by
32
+ change action k S A M (s ⊗ₜ[k] (1:Aᵐᵒᵖ)) x = _
33
+ unfold action
34
+ erw [Algebra.TensorProduct.lift_tmul]
35
+ change s • ((1:Aᵐᵒᵖ) • (show M from x)) = s • (show M from x)
36
+ rw [one_smul]
37
+
38
+ /-- Recover the exact original scalar module after retaining both actions. -/
39
+ def scalarEquiv : (ModuleCat.restrictScalars (algebraMap k (S ⊗[k] Aᵐᵒᵖ))).obj
40
+ (object k S A M) ≃ₗ[k] M where
41
+ toFun x := x
42
+ invFun x := x
43
+ left_inv _ := rfl
44
+ right_inv _ := rfl
45
+ map_add' _ _ := rfl
46
+ map_smul' r x := by
47
+ have h (y : RetainedBimodule k S A M) :
48
+ (algebraMap k (S ⊗[k] Aᵐᵒᵖ) r) • y = r • y := algebraMap_smul _ r y
49
+ exact h x
50
+ end LittleFinitistic.RetainedBimodule
51
+
52
+ end
53
+
54
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryRightProjective.lean ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimodule
2
+ import Mathlib.Algebra.Module.Projective
3
+ import Mathlib.LinearAlgebra.DFinsupp
4
+
5
+ namespace OAI
6
+ noncomputable section
7
+ namespace LittleFinitistic.OrdinarySimulation
8
+ universe u v w
9
+
10
+ /-- The finite direct sum of actual projective terms is projective. -/
11
+ theorem finitePi_projective {R : Type u} [Ring R] {ι : Type v} [Fintype ι]
12
+ (V : ι → Type w) [∀ i, AddCommGroup (V i)] [∀ i, Module R (V i)]
13
+ [∀ i, Module.Projective R (V i)] : Module.Projective R (∀ i, V i) :=
14
+ Module.Projective.of_equiv (DFinsupp.linearEquivFunOnFintype (R := R) (M := V))
15
+
16
+ open CategoryTheory
17
+ variable {k B : Type u} [Field k] [Ring B] [Algebra k B]
18
+
19
+ /-- The actual underlying right-B complex of the genuine dg bimodule. -/
20
+ abbrev underlyingRightComplex (P : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ) :
21
+ CochainComplex (ModuleCat.{u} Bᵐᵒᵖ) ℤ :=
22
+ ((ModuleCat.restrictScalars
23
+ (Algebra.TensorProduct.includeRight (R := k) (A := B) (B := Bᵐᵒᵖ)).toRingHom).mapHomologicalComplex (.up ℤ)).obj P
24
+
25
+ theorem ordinaryO_right_projective (P : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ)
26
+ (a : ℤ) (l : ℕ)
27
+ [∀ n, Module.Projective Bᵐᵒᵖ ((underlyingRightComplex P).X n)] :
28
+ Module.Projective Bᵐᵒᵖ (BimoduleO P a l) := by
29
+ let V : Fin (l+1) → Type u := fun i => (underlyingRightComplex P).X (a+(i.val:ℤ))
30
+ have : Module.Projective Bᵐᵒᵖ (∀ i, V i) := finitePi_projective V
31
+ exact Module.Projective.of_equiv (show (∀ i, V i) ≃ₗ[Bᵐᵒᵖ] BimoduleO P a l from LinearEquiv.refl _ _)
32
+ end LittleFinitistic.OrdinarySimulation
33
+
34
+ end
35
+
36
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySecondBlockTensor.lean ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBlockModules
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBalancedCongruence
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ namespace LittleFinitistic.OrdinarySimulation.SecondBlockTensor
7
+ universe u
8
+ variable (k L R O T Z : Type u) [Field k] [Ring L] [Ring R] [Algebra k L] [Algebra k R]
9
+ variable [AddCommGroup O] [Module k O] [Module R O] [Module Lᵐᵒᵖ O]
10
+ [IsScalarTower k R O] [IsScalarTower k Lᵐᵒᵖ O] [SMulCommClass R Lᵐᵒᵖ O]
11
+ variable [AddCommGroup T] [Module k T] [Module L T] [Module Rᵐᵒᵖ T]
12
+ [IsScalarTower k L T] [IsScalarTower k Rᵐᵒᵖ T] [SMulCommClass L Rᵐᵒᵖ T]
13
+ variable [AddCommGroup Z] [Module k Z] [Module R Z] [IsScalarTower k R Z]
14
+
15
+ abbrev source := LeftTensor k (L × R) (L × R) (OffDiagonal O T) (BlockModule.Second k L R Z)
16
+ abbrev target := BlockModule.First k L R (LeftTensor k R L T Z)
17
+
18
+ def forward : source k L R O T Z →ₗ[k] target k L R T Z :=
19
+ BalancedTensor.lift ((BalancedTensor.mk k R T Z).compl₁₂
20
+ (show OffDiagonal O T →ₗ[k] T from LinearMap.snd k O T)
21
+ (show BlockModule.Second k L R Z →ₗ[k] Z from LinearMap.id)) (by
22
+ intro d x z
23
+ exact BalancedTensor.balance (k := k) (A := R) (M := T) (N := Z) d.2 x.2 (show Z from z))
24
+
25
+ def inverse : target k L R T Z →ₗ[k] source k L R O T Z :=
26
+ BalancedTensor.lift ((BalancedTensor.mk k (L × R) (OffDiagonal O T) (BlockModule.Second k L R Z)).compl₁₂
27
+ (show T →ₗ[k] OffDiagonal O T from LinearMap.inr k O T)
28
+ (show Z →ₗ[k] BlockModule.Second k L R Z from LinearMap.id)) (by
29
+ intro a t z
30
+ have h := BalancedTensor.balance (k := k) (A := L × R) (M := OffDiagonal O T)
31
+ (N := BlockModule.Second k L R Z) (0,a) (0,t) z
32
+ change BalancedTensor.mk k (L × R) (OffDiagonal O T) (BlockModule.Second k L R Z)
33
+ ((0:Lᵐᵒᵖ) • (0:O),MulOpposite.op a • t) (show BlockModule.Second k L R Z from z) =
34
+ BalancedTensor.mk k (L × R) (OffDiagonal O T) (BlockModule.Second k L R Z) (0,t)
35
+ (show BlockModule.Second k L R Z from a • z) at h
36
+ rw [smul_zero] at h
37
+ exact h)
38
+
39
+ omit [Algebra k L] [Algebra k R] [Module R O] [IsScalarTower k R O]
40
+ [IsScalarTower k Lᵐᵒᵖ O] [SMulCommClass R Lᵐᵒᵖ O] [Module L T]
41
+ [IsScalarTower k L T] [IsScalarTower k Rᵐᵒᵖ T] [SMulCommClass L Rᵐᵒᵖ T]
42
+ [IsScalarTower k R Z] in
43
+ theorem other_block_zero (o : O) (z : BlockModule.Second k L R Z) :
44
+ BalancedTensor.mk k (L × R) (OffDiagonal O T) (BlockModule.Second k L R Z) (o,0) z = 0 := by
45
+ have h := BalancedTensor.balance (k := k) (A := L × R) (M := OffDiagonal O T)
46
+ (N := BlockModule.Second k L R Z) (1,0) (o,0) z
47
+ change BalancedTensor.mk k (L × R) (OffDiagonal O T) (BlockModule.Second k L R Z)
48
+ ((1:Lᵐᵒᵖ) • o,(0:Rᵐᵒᵖ) • (0:T)) z =
49
+ BalancedTensor.mk k (L × R) (OffDiagonal O T) (BlockModule.Second k L R Z) (o,0) ((0:R) • (show Z from z)) at h
50
+ erw [one_smul, zero_smul, zero_smul, map_zero] at h
51
+ exact h
52
+
53
+ omit [Module R O] [IsScalarTower k R O] [IsScalarTower k Lᵐᵒᵖ O]
54
+ [SMulCommClass R Lᵐᵒᵖ O] [Module L T] [IsScalarTower k L T]
55
+ [IsScalarTower k Rᵐᵒᵖ T] [SMulCommClass L Rᵐᵒᵖ T] [IsScalarTower k R Z] in
56
+ theorem inverse_forward (x : source k L R O T Z) :
57
+ inverse k L R O T Z (forward k L R O T Z x) = x := by
58
+ let F := (inverse k L R O T Z).comp (forward k L R O T Z)
59
+ have h : F = LinearMap.id := by
60
+ apply BalancedTensor.ext
61
+ intro x z
62
+ change BalancedTensor.mk k (L × R) (OffDiagonal O T) (BlockModule.Second k L R Z) (0,x.2) z =
63
+ BalancedTensor.mk k (L × R) (OffDiagonal O T) (BlockModule.Second k L R Z) x z
64
+ let q := (BalancedTensor.mk k (L × R) (OffDiagonal O T) (BlockModule.Second k L R Z)).flip z
65
+ have hx : x = (x.1,0) + (0,x.2) := Prod.ext (add_zero _).symm (zero_add _).symm
66
+ exact ((congrArg q hx).trans ((q.map_add _ _).trans
67
+ ((congrArg (· + q (0,x.2)) (other_block_zero k L R O T Z x.1 z)).trans (zero_add _)))).symm
68
+ exact congrArg (fun f => f x) h
69
+
70
+ omit [Module R O] [IsScalarTower k R O] [IsScalarTower k Lᵐᵒᵖ O]
71
+ [SMulCommClass R Lᵐᵒᵖ O] [Module L T] [IsScalarTower k L T]
72
+ [IsScalarTower k Rᵐᵒᵖ T] [SMulCommClass L Rᵐᵒᵖ T] [IsScalarTower k R Z] in
73
+ theorem forward_inverse (x : target k L R T Z) :
74
+ forward k L R O T Z (inverse k L R O T Z x) = x := by
75
+ have h : (forward k L R O T Z).comp (inverse k L R O T Z) = LinearMap.id := by
76
+ apply BalancedTensor.ext
77
+ intro t z
78
+ rfl
79
+ exact congrArg (fun f => f x) h
80
+
81
+ /-- Tensor on the second block selects T and has its actual output on the first block. -/
82
+ def equivalence : source k L R O T Z ≃ₗ[L × R] target k L R T Z where
83
+ toFun := forward k L R O T Z
84
+ invFun := inverse k L R O T Z
85
+ left_inv := inverse_forward k L R O T Z
86
+ right_inv := forward_inverse k L R O T Z
87
+ map_add' := (forward k L R O T Z).map_add
88
+ map_smul' d x := by
89
+ let F := forward k L R O T Z
90
+ have h : F.comp (LeftTensor.action k (L × R) (L × R) (OffDiagonal O T)
91
+ (BlockModule.Second k L R Z) d) =
92
+ (Algebra.lsmul k k (target k L R T Z) d).comp F := by
93
+ apply BalancedTensor.ext
94
+ intro x z
95
+ rfl
96
+ exact congrArg (fun f => f x) h
97
+
98
+ end LittleFinitistic.OrdinarySimulation.SecondBlockTensor
99
+
100
+ end
101
+
102
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySecondBlockTotal.lean ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBlockTensorTerms
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimoduleTensorTotal
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory
7
+ open scoped TensorProduct
8
+ namespace LittleFinitistic.OrdinarySimulation.BlockTensor
9
+ universe u
10
+ variable (k L R : Type u) [Field k] [Ring L] [Ring R] [Algebra k L] [Algebra k R]
11
+ variable (O : CochainComplex (ModuleCat.{u} (R ⊗[k] Lᵐᵒᵖ)) ℤ)
12
+ variable (T : CochainComplex (ModuleCat.{u} (L ⊗[k] Rᵐᵒᵖ)) ℤ)
13
+ variable (Z : CochainComplex (ModuleCat.{u} R) ℤ)
14
+ variable {l : ℕ} (p : Fin l → ℤ) (hp : StrictMono p)
15
+ open BimoduleComplexTensor
16
+
17
+ def secondTotalEquiv (n : ℤ) :
18
+ totalTerm k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) p n ≃ₗ[L × R]
19
+ BlockModule.First k L R (totalTerm k L R T Z p n) :=
20
+ (LinearEquiv.piCongrRight (fun i => secondTermEquiv k L R O T Z (p i) (n + -(p i)))).trans
21
+ (show (∀ i : Fin l, BlockModule.First k L R (term k L R T Z (p i) (n + -(p i)))) ≃ₗ[L × R]
22
+ BlockModule.First k L R (totalTerm k L R T Z p n) from LinearEquiv.refl _ _)
23
+
24
+ @[simp] theorem secondTotalEquiv_apply (n : ℤ)
25
+ (z : totalTerm k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) p n)
26
+ (i : Fin l) : secondTotalEquiv k L R O T Z p n z i =
27
+ secondTermEquiv k L R O T Z (p i) (n + -(p i)) (z i) := rfl
28
+
29
+ theorem second_entry (n : ℤ) (i j : Fin l) :
30
+ (secondTermEquiv k L R O T Z (p j) ((n+1) + -(p j))).toLinearMap.comp
31
+ (entry k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) p n i j) =
32
+ (BlockModule.firstMap k L R (entry k L R T Z p n i j)).comp
33
+ (secondTermEquiv k L R O T Z (p i) (n + -(p i))).toLinearMap := by
34
+ unfold entry
35
+ split_ifs with h
36
+ · have he : n + -(p i) = (n+1) + -(p j) := by omega
37
+ have ht : (ProductModules.secondInflation L R).map (eqToHom (congrArg Z.X he)) =
38
+ eqToHom (congrArg (BlockModule.secondComplex L R Z).X he) := by
39
+ generalize n + -(p i) = q at he ⊢
40
+ generalize (n+1) + -(p j) = q' at he ⊢
41
+ subst q'
42
+ simp only [eqToHom_refl,CategoryTheory.Functor.map_id]
43
+ rfl
44
+ have hh := secondTermEquiv_map k L R O T Z (O.d (p i) (p j)) (T.d (p i) (p j)) (eqToHom (congrArg Z.X he))
45
+ rw [ht,← OffDiagonal.complex_d_all] at hh
46
+ exact hh
47
+ · apply LinearMap.ext
48
+ intro x
49
+ change secondTermEquiv k L R O T Z (p j) ((n+1) + -(p j)) 0 = 0
50
+ exact (secondTermEquiv k L R O T Z (p j) ((n+1) + -(p j))).map_zero
51
+
52
+ theorem second_vertical (n : ℤ) (i : Fin l) :
53
+ (secondTermEquiv k L R O T Z (p i) ((n+1) + -(p i))).toLinearMap.comp
54
+ (map k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) (𝟙 _)
55
+ ((BlockModule.secondComplex L R Z).d (n + -(p i)) ((n+1) + -(p i)))) =
56
+ (BlockModule.firstMap k L R (map k L R T Z (𝟙 _) (Z.d (n + -(p i)) ((n+1) + -(p i))))).comp
57
+ (secondTermEquiv k L R O T Z (p i) (n + -(p i))).toLinearMap := by
58
+ exact secondTermEquiv_map k L R O T Z (𝟙 (O.X (p i))) (𝟙 (T.X (p i))) (Z.d _ _)
59
+
60
+ theorem second_differential (n : ℤ)
61
+ (z : totalTerm k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) p n) :
62
+ secondTotalEquiv k L R O T Z p (n+1)
63
+ (differential k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) p n z) =
64
+ differential k L R T Z p n (secondTotalEquiv k L R O T Z p n z) := by
65
+ funext j
66
+ change secondTermEquiv k L R O T Z (p j) ((n+1) + -(p j))
67
+ (differential k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) p n z j) =
68
+ differential k L R T Z p n (secondTotalEquiv k L R O T Z p n z) j
69
+ simp only [differential,
70
+ LinearMap.pi_apply,LinearMap.add_apply,LinearMap.comp_apply,LinearMap.proj_apply,
71
+ LinearMap.sum_apply,map_add,map_sum]
72
+ apply congrArg₂ (· + ·)
73
+ · change secondTermEquiv k L R O T Z (p j) ((n+1) + -(p j))
74
+ ((((-(p j)).negOnePow : ℤ)) •
75
+ (map k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) (𝟙 _)
76
+ ((BlockModule.secondComplex L R Z).d (n + -(p j)) ((n+1) + -(p j))) (z j))) =
77
+ (((-(p j)).negOnePow : ℤ)) •
78
+ (map k L R T Z (𝟙 _) (Z.d (n + -(p j)) ((n+1) + -(p j))))
79
+ (secondTermEquiv k L R O T Z (p j) (n + -(p j)) (z j))
80
+ rw [map_zsmul]
81
+ congr 1
82
+ exact congrArg (fun f => f (z j)) (second_vertical k L R O T Z p n j)
83
+ · erw [LinearMap.sum_apply]
84
+ apply Finset.sum_congr rfl
85
+ intro i _
86
+ exact congrArg (fun f => f (z i)) (second_entry k L R O T Z p n i j)
87
+
88
+ /-- Actual tensor with the off-diagonal complex on a second-block input is the first-block T-total. -/
89
+ def secondTotalIso :
90
+ total k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) p hp ≅
91
+ BlockModule.firstComplex L R (total k L R T Z p hp) :=
92
+ HomologicalComplex.Hom.isoOfComponents (fun n => (secondTotalEquiv k L R O T Z p n).toModuleIso) (by
93
+ intro n m h
94
+ change n+1=m at h
95
+ subst m
96
+ have h₁ : (total k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) p hp).d n (n+1) =
97
+ ModuleCat.ofHom (differential k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) p n) :=
98
+ CochainComplex.of_d (fun n => ModuleCat.of (L × R) (totalTerm k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) p n))
99
+ (fun n => ModuleCat.ofHom (differential k (L × R) (L × R) (OffDiagonal.complex k L R O T) (BlockModule.secondComplex L R Z) p n)) n
100
+ have h₂ : (total k L R T Z p hp).d n (n+1) = ModuleCat.ofHom (differential k L R T Z p n) :=
101
+ CochainComplex.of_d (fun n => ModuleCat.of L (totalTerm k L R T Z p n))
102
+ (fun n => ModuleCat.ofHom (differential k L R T Z p n)) n
103
+ change _ ≫ (ProductModules.firstInflation L R).map ((total k L R T Z p hp).d n (n+1)) = _
104
+ rw [h₁,h₂]
105
+ apply ModuleCat.hom_ext
106
+ apply LinearMap.ext
107
+ intro z
108
+ exact (second_differential k L R O T Z p n z).symm)
109
+ end LittleFinitistic.OrdinarySimulation.BlockTensor
110
+
111
+ end
112
+
113
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryShiftDerivedTensor.lean ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimoduleDerivedTensor
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryRightProjective
3
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryShiftSign
4
+
5
+ namespace OAI
6
+ noncomputable section
7
+ open CategoryTheory Limits
8
+ open scoped TensorProduct
9
+ namespace LittleFinitistic.OrdinarySimulation
10
+ universe u
11
+ variable {k B : Type u} [Field k] [Ring B] [Algebra k B]
12
+ variable (P : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ) (b : ℤ) (l : ℕ)
13
+ variable [∀ n, Module.Projective Bᵐᵒᵖ ((underlyingRightComplex P).X n)]
14
+
15
+ instance shifted_right_projective (n : ℤ) : Module.Projective Bᵐᵒᵖ
16
+ (ComplexTensor.rightTerm k B (BimoduleComplexTensor.rightComplex k B B (P⟦b⟧)) n) :=
17
+ inferInstanceAs (Module.Projective Bᵐᵒᵖ ((underlyingRightComplex P).X (n+b)))
18
+
19
+ variable [HasDerivedCategory.{u+1} (ModuleCat.{u} B)]
20
+
21
+ /-- The native derived tensor functor computed by the source's actual bounded P[b]. -/
22
+ def shiftedDerivedTensor : DerivedCategory (ModuleCat.{u} B) ⥤ DerivedCategory (ModuleCat.{u} B) :=
23
+ BimoduleComplexTensor.derivedTotal k B B (P⟦b⟧)
24
+ (TensorResolution.finiteDegrees l) (TensorResolution.finiteDegrees_strictMono l)
25
+
26
+ def shiftedDerivedTensorComparison : DerivedCategory.Q ⋙ shiftedDerivedTensor P b l ≅
27
+ BimoduleComplexTensor.totalFunctor k B B (P⟦b⟧)
28
+ (TensorResolution.finiteDegrees l) (TensorResolution.finiteDegrees_strictMono l) ⋙ DerivedCategory.Q :=
29
+ BimoduleComplexTensor.derivedTotalComparison k B B (P⟦b⟧)
30
+ (TensorResolution.finiteDegrees l) (TensorResolution.finiteDegrees_strictMono l)
31
+
32
+ omit [∀ n, Module.Projective Bᵐᵒᵖ ((underlyingRightComplex P).X n)]
33
+ [HasDerivedCategory.{u+1} (ModuleCat.{u} B)] in
34
+ theorem shifted_support (a : ℤ) (hb : a+(l:ℤ)=b)
35
+ (hP : ∀ n : ℤ, n < a ∨ b < n → IsZero (P.X n)) (n : ℤ) (hn : n < -(l:ℤ) ∨ 0 < n) :
36
+ IsZero ((P⟦b⟧).X n) := by
37
+ change IsZero (P.X (n+b))
38
+ apply hP
39
+ omega
40
+ end LittleFinitistic.OrdinarySimulation
41
+
42
+ end
43
+
44
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinaryShiftSign.lean ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib.Algebra.Homology.HomotopyCategory.Shift
2
+
3
+ namespace OAI
4
+ noncomputable section
5
+ open CategoryTheory
6
+ namespace LittleFinitistic.OrdinarySimulation
7
+ universe u v
8
+ variable {C : Type u} [Category.{v} C] [Preadditive C]
9
+
10
+ /-- Reindex P by b, retaining the original differential. This is what the resolution computes. -/
11
+ def unsignedShift (P : CochainComplex C ℤ) (b : ℤ) : CochainComplex C ℤ where
12
+ X n := P.X (n+b)
13
+ d n m := P.d (n+b) (m+b)
14
+ shape n m h := P.shape _ _ (by
15
+ change ¬ (n+b)+1 = m+b
16
+ change ¬ n+1=m at h
17
+ omega)
18
+ d_comp_d' n m q _ _ := P.d_comp_d _ _ _
19
+
20
+ /-- Multiplication by an integer unit is an actual isomorphism in any additive category. -/
21
+ def integerUnitIso (X : C) (u : ℤˣ) : X ≅ X where
22
+ hom := u • 𝟙 X
23
+ inv := u⁻¹ • 𝟙 X
24
+ hom_inv_id := by
25
+ simp only [Linear.units_smul_comp, Linear.comp_units_smul, Category.id_comp,
26
+ smul_smul, inv_mul_cancel, one_smul]
27
+ inv_hom_id := by
28
+ simp only [Linear.units_smul_comp, Linear.comp_units_smul, Category.id_comp,
29
+ smul_smul, mul_inv_cancel, one_smul]
30
+
31
+ /-- The source's degree-n sign (-1)^(b*n), for all integers b and n. -/
32
+ def shiftSignIso (P : CochainComplex C ℤ) (b : ℤ) : unsignedShift P b ≅ P⟦b⟧ :=
33
+ HomologicalComplex.Hom.isoOfComponents
34
+ (fun n => integerUnitIso (P.X (n+b)) (b*n).negOnePow) (by
35
+ intro n m h
36
+ change n+1=m at h
37
+ subst m
38
+ change ((b*n).negOnePow • 𝟙 _) ≫ (b.negOnePow • P.d (n+b) (n+1+b)) =
39
+ P.d (n+b) (n+1+b) ≫ ((b*(n+1)).negOnePow • 𝟙 _)
40
+ simp only [Linear.units_smul_comp, Linear.comp_units_smul, Category.id_comp,
41
+ Category.comp_id, smul_smul]
42
+ rw [← Int.negOnePow_add]
43
+ congr 2
44
+ simp [mul_add, add_comm])
45
+ end LittleFinitistic.OrdinarySimulation
46
+
47
+ end
48
+
49
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySignedExactness.lean ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryTensorExactness
2
+
3
+ namespace OAI
4
+ noncomputable section
5
+ namespace LittleFinitistic
6
+ universe u
7
+ variable {R E F G : Type u} [Ring R]
8
+ variable [AddCommGroup E] [Module R E]
9
+ variable [AddCommGroup F] [Module R F]
10
+ variable [AddCommGroup G] [Module R G]
11
+
12
+ /-- Multiplying both differentials by an integer unit preserves exactness. -/
13
+ theorem exact_units_smul (u : ℤˣ) (f : E →ₗ[R] F) (g : F →ₗ[R] G)
14
+ (h : Function.Exact f g) : Function.Exact (u • f) (u • g) := by
15
+ intro z
16
+ constructor
17
+ · intro hz
18
+ have hg : g z = 0 := by
19
+ have hh := congrArg (fun x : G => u⁻¹ • x) hz
20
+ simpa only [LinearMap.smul_apply,smul_smul,inv_mul_cancel,one_smul,smul_zero] using hh
21
+ obtain ⟨y,hy⟩ := (h z).mp hg
22
+ refine ⟨u⁻¹ • y, ?_⟩
23
+ change u • f ((↑(u⁻¹) : ℤ) • y) = z
24
+ rw [map_zsmul]
25
+ change u • (u⁻¹ • f y) = z
26
+ rw [smul_smul,mul_inv_cancel,one_smul,hy]
27
+ · rintro ⟨y,rfl⟩
28
+ have hg : g (f y) = 0 := (h (f y)).mpr ⟨y,rfl⟩
29
+ change u • g ((↑u : ℤ) • f y) = 0
30
+ rw [map_zsmul,hg,smul_zero,smul_zero]
31
+ end LittleFinitistic
32
+
33
+ end
34
+
35
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySimulationComparison.lean ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryFullTensorComplex
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinarySupportedExtension
3
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryShiftSign
4
+
5
+ namespace OAI
6
+ noncomputable section
7
+ open CategoryTheory Limits
8
+ open scoped TensorProduct
9
+ namespace LittleFinitistic.OrdinarySimulation
10
+ universe u
11
+ variable {k B : Type u} [Field k] [Ring B] [Algebra k B]
12
+ variable (P : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ) (a : ℤ) (l : ℕ)
13
+
14
+ theorem differential_transport {n n' m m' : ℤ} (hn : n = n') (hm : m = m') :
15
+ eqToHom (congrArg P.X hn) ≫ P.d n' m' = P.d n m ≫ eqToHom (congrArg P.X hm) := by
16
+ subst n'
17
+ subst m'
18
+ simp only [eqToHom_refl,Category.id_comp,Category.comp_id]
19
+
20
+ /-- Align the finite resolution's degree n with the source's degree a+n. -/
21
+ def restrictedShiftIso : P.restriction (ComplexShape.embeddingUpIntGE a) ≅
22
+ (unsignedShift P (a+(l:ℤ))).restriction (TensorResolution.degreeEmbedding l) :=
23
+ HomologicalComplex.Hom.isoOfComponents (fun n => eqToIso (by
24
+ change P.X (a+(n:ℤ)) = P.X ((-(l:ℤ)+n)+(a+l))
25
+ congr 1
26
+ omega)) (by
27
+ intro n m _
28
+ have hn : (-(l:ℤ)+(n:ℤ))+(a+l) = a+n := by omega
29
+ have hm : (-(l:ℤ)+(m:ℤ))+(a+l) = a+m := by omega
30
+ change eqToHom (congrArg P.X hn.symm) ≫ P.d ((-(l:ℤ)+n)+(a+l)) ((-(l:ℤ)+m)+(a+l)) =
31
+ P.d (a+n) (a+m) ≫ eqToHom (congrArg P.X hm.symm)
32
+ exact differential_transport P hn.symm hm.symm)
33
+
34
+ /-- The lower support condition of the manuscript supplies strict support after reindexing. -/
35
+ theorem unsignedSupport (hP : ∀ n : ℤ, n < a → IsZero (P.X n)) :
36
+ (unsignedShift P (a+(l:ℤ))).IsStrictlySupported (TensorResolution.degreeEmbedding l) :=
37
+ ⟨fun n hn => by
38
+ have hlt : n < -(l:ℤ) := by
39
+ by_contra h
40
+ let j := (n+(l:ℤ)).toNat
41
+ have hj : (TensorResolution.degreeEmbedding l).f j = n := by
42
+ simp only [TensorResolution.degreeEmbedding_apply]
43
+ dsimp [j]
44
+ rw [Int.toNat_of_nonneg (by omega)]
45
+ omega
46
+ exact hn j hj
47
+ exact hP (n+(a+l)) (by omega)⟩
48
+
49
+ /-- The computed BC-balanced tensor complex in degrees -l,...,0 with both B-actions. -/
50
+ def computedTensorComplex : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ :=
51
+ (FullTensorTerm.complex P a l).extend (TensorResolution.degreeEmbedding l)
52
+
53
+ /-- Full bimodule chain comparison, including all zero terms and the genuine integer shift sign. -/
54
+ def computedTensorIso
55
+ (hLower : ∀ n : ℤ, n < a → IsZero (P.X n))
56
+ (hUpper : ∀ n : ℕ, l < n → IsZero (P.X (a+(n:ℤ)))) :
57
+ computedTensorComplex P a l ≅ P⟦a+(l:ℤ)⟧ := by
58
+ letI := unsignedSupport P a l hLower
59
+ exact ((TensorResolution.degreeEmbedding l).extendFunctor (ModuleCat.{u} (Enveloping k B))).mapIso
60
+ (FullTensorTerm.complexIso P a l hUpper ≪≫ restrictedShiftIso P a l) ≪≫
61
+ SupportedExtension.iso (unsignedShift P (a+(l:ℤ))) (TensorResolution.degreeEmbedding l) ≪≫
62
+ shiftSignIso P (a+(l:ℤ))
63
+
64
+ /-- Exact source indexing: b=a+l, with only the manuscript's support hypothesis. -/
65
+ def sourceShiftComparison (b : ℤ) (hb : a+(l:ℤ)=b)
66
+ (hP : ∀ n : ℤ, n < a ∨ b < n → IsZero (P.X n)) :
67
+ computedTensorComplex P a l ≅ P⟦b⟧ := by
68
+ subst b
69
+ exact computedTensorIso P a l (fun n hn => hP n (Or.inl hn))
70
+ (fun n hn => hP (a+(n:ℤ)) (Or.inr (by omega)))
71
+ end LittleFinitistic.OrdinarySimulation
72
+
73
+ end
74
+
75
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySingleTensorTerms.lean ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimoduleCoefficientEquiv
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimoduleTensorTotal
3
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryRetainedRestriction
4
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryFinitePiSupport
5
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryMiddleTensorFunctors
6
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryShiftSign
7
+
8
+ namespace OAI
9
+ noncomputable section
10
+ open CategoryTheory Limits
11
+ open scoped TensorProduct
12
+ namespace LittleFinitistic.SingleBimoduleTensor
13
+ universe u
14
+ variable (k S A N : Type u) [Field k] [Ring S] [Ring A] [Algebra k S] [Algebra k A]
15
+ variable [AddCommGroup N] [Module k N] [Module S N] [Module Aᵐᵒᵖ N]
16
+ [IsScalarTower k S N] [IsScalarTower k Aᵐᵒᵖ N] [SMulCommClass S Aᵐᵒᵖ N]
17
+
18
+ abbrev complex : CochainComplex (ModuleCat.{u} (S ⊗[k] Aᵐᵒᵖ)) ℤ :=
19
+ (HomologicalComplex.single _ (.up ℤ) 0).obj (RetainedBimodule.object k S A N)
20
+
21
+ variable (Z : CochainComplex (ModuleCat.{u} A) ℤ)
22
+ open BimoduleComplexTensor
23
+
24
+ def zeroCoefficientEquiv : BimoduleCoefficients k S A ((complex k S A N).X 0) ≃ₗ[Aᵐᵒᵖ] N :=
25
+ (BimoduleCoefficients.equiv k S A (HomologicalComplex.singleObjXSelf (.up ℤ) 0 (RetainedBimodule.object k S A N))).trans
26
+ (RetainedBimodule.rightEquiv k S A N)
27
+
28
+ theorem zeroCoefficientEquiv_left (s : S) (x : BimoduleCoefficients k S A ((complex k S A N).X 0)) :
29
+ zeroCoefficientEquiv k S A N (s • x) = s • zeroCoefficientEquiv k S A N x := by
30
+ simp only [zeroCoefficientEquiv,LinearEquiv.trans_apply,BimoduleCoefficients.equiv_left,RetainedBimodule.rightEquiv_left]
31
+
32
+ def zeroTermEquiv (n : ℤ) : term k S A (complex k S A N) Z 0 n ≃ₗ[S] (middleLeftComplex k S A N Z).X n :=
33
+ LeftTensor.congr (zeroCoefficientEquiv k S A N) (zeroCoefficientEquiv_left k S A N)
34
+ (LinearEquiv.refl A (ComplexTensor.leftTerm k A Z n))
35
+
36
+ theorem zeroTermEquiv_map {n m : ℤ} (g : Z.X n ⟶ Z.X m) :
37
+ (zeroTermEquiv k S A N Z m).toLinearMap.comp (map k S A (complex k S A N) Z (𝟙 _) g) =
38
+ ((middleLeftFunctor k S A N).map g).hom.comp (zeroTermEquiv k S A N Z n).toLinearMap := by
39
+ let : Module k ((middleLeftComplex k S A N Z).X m) := inferInstanceAs (Module k (LeftTensor k A S N (ComplexTensor.leftTerm k A Z m)))
40
+ let : IsScalarTower k S ((middleLeftComplex k S A N Z).X m) := inferInstanceAs (IsScalarTower k S (LeftTensor k A S N (ComplexTensor.leftTerm k A Z m)))
41
+ apply LinearMap.restrictScalars_injective k
42
+ apply BalancedTensor.ext
43
+ intro x z
44
+ rfl
45
+
46
+ variable {l : ℕ} (p : Fin l → ℤ) (hp : StrictMono p) (i₀ : Fin l) (h₀ : p i₀ = 0)
47
+
48
+ include hp h₀ in
49
+ theorem otherTerm_subsingleton (n : ℤ) (i : Fin l) (hi : i ≠ i₀) :
50
+ Subsingleton (term k S A (complex k S A N) Z (p i) (n + -(p i))) := by
51
+ have hz : p i ≠ 0 := by
52
+ intro h
53
+ exact hi (hp.injective (h.trans h₀.symm))
54
+ have : Subsingleton (BimoduleCoefficients k S A ((complex k S A N).X (p i))) :=
55
+ ModuleCat.isZero_iff_subsingleton.mp
56
+ (HomologicalComplex.isZero_single_obj_X (.up ℤ) 0 (RetainedBimodule.object k S A N) (p i) hz)
57
+ exact inferInstanceAs (Subsingleton (BalancedTensor.Tensor k A
58
+ (BimoduleCoefficients k S A ((complex k S A N).X (p i))) (ComplexTensor.leftTerm k A Z (n + -(p i)))))
59
+
60
+ def coefficientEquivAt (q : ℤ) (hq : q = 0) :
61
+ BimoduleCoefficients k S A ((complex k S A N).X q) ≃ₗ[Aᵐᵒᵖ] N := by
62
+ subst q
63
+ exact zeroCoefficientEquiv k S A N
64
+
65
+ theorem coefficientEquivAt_left (q : ℤ) (hq : q = 0) (s : S)
66
+ (x : BimoduleCoefficients k S A ((complex k S A N).X q)) :
67
+ coefficientEquivAt k S A N q hq (s • x) = s • coefficientEquivAt k S A N q hq x := by
68
+ subst q
69
+ exact zeroCoefficientEquiv_left k S A N s x
70
+
71
+ def termEquivAt (q : ℤ) (hq : q = 0) (n : ℤ) :
72
+ term k S A (complex k S A N) Z q (n + -q) ≃ₗ[S] ((middleLeftComplex k S A N Z)⟦-q⟧).X n :=
73
+ LeftTensor.congr (coefficientEquivAt k S A N q hq) (coefficientEquivAt_left k S A N q hq)
74
+ (LinearEquiv.refl A (ComplexTensor.leftTerm k A Z (n + -q)))
75
+
76
+ theorem termEquivAt_map (q : ℤ) (hq : q = 0) (n m : ℤ) (g : Z.X (n + -q) ⟶ Z.X (m + -q)) :
77
+ (termEquivAt k S A N Z q hq m).toLinearMap.comp (map k S A (complex k S A N) Z (𝟙 _) g) =
78
+ ((middleLeftFunctor k S A N).map g).hom.comp (termEquivAt k S A N Z q hq n).toLinearMap := by
79
+ let : Module k (((middleLeftComplex k S A N Z)⟦-q⟧).X m) :=
80
+ inferInstanceAs (Module k (LeftTensor k A S N (ComplexTensor.leftTerm k A Z (m + -q))))
81
+ let : IsScalarTower k S (((middleLeftComplex k S A N Z)⟦-q⟧).X m) :=
82
+ inferInstanceAs (IsScalarTower k S (LeftTensor k A S N (ComplexTensor.leftTerm k A Z (m + -q))))
83
+ apply LinearMap.restrictScalars_injective k
84
+ apply BalancedTensor.ext
85
+ intro x z
86
+ rfl
87
+
88
+ abbrev selectedTermEquiv (n : ℤ) := termEquivAt k S A N Z (p i₀) h₀ n
89
+
90
+ def totalTermEquiv (n : ℤ) : totalTerm k S A (complex k S A N) Z p n ≃ₗ[S]
91
+ ((middleLeftComplex k S A N Z)⟦-(p i₀)⟧).X n :=
92
+ (FinitePiSupport.equivalence (fun i => term k S A (complex k S A N) Z (p i) (n + -(p i)))
93
+ i₀ (otherTerm_subsingleton k S A N Z p hp i₀ h₀ n)).trans
94
+ (selectedTermEquiv k S A N Z p i₀ h₀ n)
95
+ end LittleFinitistic.SingleBimoduleTensor
96
+
97
+ end
98
+
99
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySingleTensorTotal.lean ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinarySingleTensorTerms
2
+
3
+ namespace OAI
4
+ noncomputable section
5
+ open CategoryTheory Limits
6
+ open scoped TensorProduct
7
+ namespace LittleFinitistic.SingleBimoduleTensor
8
+ universe u
9
+ variable (k S A N : Type u) [Field k] [Ring S] [Ring A] [Algebra k S] [Algebra k A]
10
+ variable [AddCommGroup N] [Module k N] [Module S N] [Module Aᵐᵒᵖ N]
11
+ [IsScalarTower k S N] [IsScalarTower k Aᵐᵒᵖ N] [SMulCommClass S Aᵐᵒᵖ N]
12
+ variable (Z : CochainComplex (ModuleCat.{u} A) ℤ)
13
+ variable {l : ℕ} (p : Fin l → ℤ) (hp : StrictMono p) (i₀ : Fin l) (h₀ : p i₀ = 0)
14
+ open BimoduleComplexTensor
15
+
16
+ include hp h₀ in
17
+ theorem entry_selected_zero (n : ℤ) (z : totalTerm k S A (complex k S A N) Z p n) (i : Fin l) :
18
+ entry k S A (complex k S A N) Z p n i i₀ (z i) = 0 := by
19
+ by_cases hi : i = i₀
20
+ · subst i
21
+ unfold entry
22
+ rw [dite_eq_right (show ¬ p i₀ + 1 = p i₀ by omega)]
23
+ rfl
24
+ · have hs := otherTerm_subsingleton k S A N Z p hp i₀ h₀ n i hi
25
+ rw [hs.elim (z i) 0,map_zero]
26
+
27
+ include hp h₀ in
28
+ theorem differential_selected (n : ℤ) (z : totalTerm k S A (complex k S A N) Z p n) :
29
+ differential k S A (complex k S A N) Z p n z i₀ =
30
+ ((-(p i₀)).negOnePow • map k S A (complex k S A N) Z (𝟙 _)
31
+ (Z.d (n + -(p i₀)) ((n+1) + -(p i₀)))) (z i₀) := by
32
+ simp only [differential,LinearMap.pi_apply,LinearMap.add_apply,LinearMap.comp_apply,LinearMap.proj_apply,
33
+ LinearMap.sum_apply]
34
+ rw [Finset.sum_eq_zero (fun i _ => entry_selected_zero k S A N Z p hp i₀ h₀ n z i),add_zero]
35
+
36
+ theorem termEquivAt_vertical (q : ℤ) (hq : q = 0) (n : ℤ)
37
+ (y : term k S A (complex k S A N) Z q (n + -q)) :
38
+ termEquivAt k S A N Z q hq (n+1)
39
+ (((-q).negOnePow • map k S A (complex k S A N) Z (𝟙 _)
40
+ (Z.d (n + -q) ((n+1) + -q))) y) =
41
+ (((middleLeftComplex k S A N Z)⟦-q⟧).d n (n+1)).hom (termEquivAt k S A N Z q hq n y) := by
42
+ change termEquivAt k S A N Z q hq (n+1)
43
+ ((((-q).negOnePow : ℤ)) • (map k S A (complex k S A N) Z (𝟙 _)
44
+ (Z.d (n + -q) ((n+1) + -q))) y) =
45
+ (((-q).negOnePow : ℤ)) • (((middleLeftFunctor k S A N).map (Z.d (n + -q) ((n+1) + -q))).hom
46
+ (termEquivAt k S A N Z q hq n y))
47
+ rw [map_zsmul]
48
+ congr 1
49
+ exact congrArg (fun f => f y) (termEquivAt_map k S A N Z q hq n (n+1) (Z.d _ _))
50
+
51
+ theorem totalTermEquiv_differential (n : ℤ) (z : totalTerm k S A (complex k S A N) Z p n) :
52
+ totalTermEquiv k S A N Z p hp i₀ h₀ (n+1) (differential k S A (complex k S A N) Z p n z) =
53
+ (((middleLeftComplex k S A N Z)⟦-(p i₀)⟧).d n (n+1)).hom (totalTermEquiv k S A N Z p hp i₀ h₀ n z) := by
54
+ change termEquivAt k S A N Z (p i₀) h₀ (n+1)
55
+ (differential k S A (complex k S A N) Z p n z i₀) =
56
+ (((middleLeftComplex k S A N Z)⟦-(p i₀)⟧).d n (n+1)).hom (termEquivAt k S A N Z (p i₀) h₀ n (z i₀))
57
+ rw [differential_selected k S A N Z p hp i₀ h₀]
58
+ exact termEquivAt_vertical k S A N Z (p i₀) h₀ n (z i₀)
59
+
60
+ /-- A genuine ordinary bimodule in degree zero has exactly its ordinary tensor complex as total. -/
61
+ def shiftedTotalIso : total k S A (complex k S A N) Z p hp ≅ (middleLeftComplex k S A N Z)⟦-(p i₀)⟧ :=
62
+ HomologicalComplex.Hom.isoOfComponents (fun n => (totalTermEquiv k S A N Z p hp i₀ h₀ n).toModuleIso) (by
63
+ intro n m h
64
+ change n+1=m at h
65
+ subst m
66
+ have hd : (total k S A (complex k S A N) Z p hp).d n (n+1) = ModuleCat.ofHom (differential k S A (complex k S A N) Z p n) :=
67
+ CochainComplex.of_d (fun n => ModuleCat.of S (totalTerm k S A (complex k S A N) Z p n))
68
+ (fun n => ModuleCat.ofHom (differential k S A (complex k S A N) Z p n)) n
69
+ rw [hd]
70
+ apply ModuleCat.hom_ext
71
+ apply LinearMap.ext
72
+ intro z
73
+ exact (totalTermEquiv_differential k S A N Z p hp i₀ h₀ n z).symm)
74
+
75
+ /-- Removing the proved zero shift identifies the ordinary tensor complex exactly. -/
76
+ def totalIso : total k S A (complex k S A N) Z p hp ≅ middleLeftComplex k S A N Z :=
77
+ shiftedTotalIso k S A N Z p hp i₀ h₀ ≪≫
78
+ (eqToIso (congrArg (fun q : ℤ => (middleLeftComplex k S A N Z)⟦q⟧) (show -(p i₀) = 0 by omega))) ≪≫
79
+ (shiftFunctorZero (CochainComplex (ModuleCat.{u} S) ℤ) ℤ).app (middleLeftComplex k S A N Z)
80
+ end LittleFinitistic.SingleBimoduleTensor
81
+
82
+ end
83
+
84
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySourceBimoduleTotal.lean ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryGenuineBimoduleComparison
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimoduleTotalAssociativity
3
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryBimoduleTotalCongruence
4
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryTensorTotalAcyclic
5
+
6
+ namespace OAI
7
+ noncomputable section
8
+ open CategoryTheory Limits
9
+ open scoped TensorProduct
10
+ namespace LittleFinitistic.OrdinarySimulation
11
+ universe u
12
+ variable {k B : Type u} [Field k] [Ring B] [Algebra k B]
13
+ variable (P : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ) (a : ℤ) (l : ℕ)
14
+ variable (b : ℤ) (hb : a+(l:ℤ)=b)
15
+ variable (hP : ∀ n : ℤ, n < a ∨ b < n → IsZero (P.X n))
16
+ variable (Z : CochainComplex (ModuleCat.{u} B) ℤ)
17
+
18
+ /-- The source signed total comparison for every Z, with the actual outside B-action retained. -/
19
+ def sourceBimoduleTotalComparison :
20
+ BimoduleComplexTensor.total k B (B ⊗[k] ChainAlgebra k l)
21
+ (TensorResolution.integerBimoduleComplex k B l)
22
+ (middleLeftComplex k (B ⊗[k] ChainAlgebra k l) B (BimoduleO P a l) Z)
23
+ (TensorResolution.finiteDegrees l) (TensorResolution.finiteDegrees_strictMono l) ≅
24
+ BimoduleComplexTensor.total k B B (P⟦b⟧) Z
25
+ (TensorResolution.finiteDegrees l) (TensorResolution.finiteDegrees_strictMono l) :=
26
+ (BimoduleComplexTensor.totalAssociativityIso k B (B ⊗[k] ChainAlgebra k l) B (BimoduleO P a l)
27
+ (TensorResolution.integerBimoduleComplex k B l) Z
28
+ (TensorResolution.finiteDegrees l) (TensorResolution.finiteDegrees_strictMono l)).symm ≪≫
29
+ BimoduleComplexTensor.totalRightIso k B B (genuineSourceShiftComparison P a l b hb hP) Z
30
+ (TensorResolution.finiteDegrees l) (TensorResolution.finiteDegrees_strictMono l)
31
+ end LittleFinitistic.OrdinarySimulation
32
+
33
+ end
34
+
35
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySourceDerivedComparison.lean ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinarySourceResolutionModels
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryDerivedSquareComparison
3
+
4
+ namespace OAI
5
+ noncomputable section
6
+ open CategoryTheory Limits
7
+ open scoped TensorProduct
8
+ namespace LittleFinitistic.OrdinarySimulation
9
+ universe u
10
+ variable {k B : Type u} [Field k] [Ring B] [Algebra k B]
11
+ variable (P : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ) (a : ℤ) (l : ℕ)
12
+ variable (b : ℤ) (hb : a+(l:ℤ)=b)
13
+ variable (hP : ∀ n : ℤ, n < a ∨ b < n → IsZero (P.X n))
14
+
15
+ section Bimodule
16
+ variable [HasDerivedCategory.{u+1} (ModuleCat.{u} (Enveloping k B))]
17
+
18
+ /-- The source's resolved T tensor O comparison in the native derived category of genuine B-bimodules.
19
+ Its left operand includes the actual bounded right-BC-projective resolution and augmentation to T. -/
20
+ def resolvedBimoduleComparison :
21
+ (TensorResolution.resolutionModel k B l).tensorOrdinary B (BimoduleO P a l) ≅
22
+ DerivedCategory.Q.obj (P⟦b⟧) :=
23
+ DerivedCategory.Q.mapIso (genuineSourceShiftComparison P a l b hb hP)
24
+ end Bimodule
25
+
26
+ variable [∀ n, Module.Projective Bᵐᵒᵖ ((underlyingRightComplex P).X n)]
27
+ variable [HasDerivedCategory.{u+1} (ModuleCat.{u} B)]
28
+ variable [HasDerivedCategory.{u+1} (ModuleCat.{u} (AlgebraD k l B))]
29
+
30
+ /-- The source's native derived square with both tensor functors tied to their certified full-support models. -/
31
+ def resolvedSquareComparison (Z : CochainComplex (ModuleCat.{u} B) ℤ) :
32
+ (XResolution.resolutionModel P a l).toFiniteProjectiveBimoduleComplex.derivedTensor.obj
33
+ ((XResolution.resolutionModel P a l).toFiniteProjectiveBimoduleComplex.derivedTensor.obj
34
+ ((BlockModule.derivedFirst B (B ⊗[k] ChainAlgebra k l)).obj (DerivedCategory.Q.obj Z))) ≅
35
+ (BlockModule.derivedFirst B (B ⊗[k] ChainAlgebra k l)).obj
36
+ ((shiftedResolutionModel P a l b hb hP).derivedTensor.obj (DerivedCategory.Q.obj Z)) :=
37
+ XResolution.derivedSquareComparison P a l b hb hP Z
38
+ end LittleFinitistic.OrdinarySimulation
39
+
40
+ end
41
+
42
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySourceResolutionModels.lean ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryResolutionModels
2
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryXAugmentation
3
+ import OAI.Algebra.Finitistic.Ordinary.OrdinaryShiftDerivedTensor
4
+
5
+ namespace OAI
6
+ noncomputable section
7
+ open CategoryTheory Limits
8
+ open scoped TensorProduct
9
+ namespace LittleFinitistic.OrdinarySimulation
10
+ universe u
11
+ variable {k B : Type u} [Field k] [Ring B] [Algebra k B]
12
+
13
+ namespace TensorResolution
14
+
15
+ theorem finiteDegrees_range (l : ℕ) (n : ℤ) : n ∈ Set.range (finiteDegrees l) ↔ -(l:ℤ) ≤ n ∧ n ≤ 0 := by
16
+ constructor
17
+ · rintro ⟨i,rfl⟩
18
+ dsimp [finiteDegrees]
19
+ have hi := i.isLt
20
+ omega
21
+ · rintro ⟨hlo,hhi⟩
22
+ let j := (n+(l:ℤ)).toNat
23
+ have hj : (j:ℤ) = n+(l:ℤ) := Int.toNat_of_nonneg (by omega)
24
+ refine ⟨⟨j,by omega⟩,?_⟩
25
+ dsimp [finiteDegrees]
26
+ omega
27
+
28
+ /-- The actual Q_T augmentation with all source resolution obligations proved. -/
29
+ def resolutionModel (k B : Type u) [Field k] [Ring B] [Algebra k B] (l : ℕ) :
30
+ BoundedBimoduleResolution k B (B ⊗[k] ChainAlgebra k l) (bimoduleTerminalObject k B l) where
31
+ complex := integerBimoduleComplex k B l
32
+ size := l+1
33
+ degrees := finiteDegrees l
34
+ strictMono := finiteDegrees_strictMono l
35
+ support n hn := by
36
+ have h : n < -(l:ℤ) ∨ 0 < n := by
37
+ have := (finiteDegrees_range l n).not.mp hn
38
+ omega
39
+ exact h.elim (integerBimodule_lower k B l n) (integerBimodule_upper k B l n)
40
+ rightProjective n := integerBimoduleRight_projective k B l n
41
+ augmentation := integerBimoduleAugmentation k B l
42
+ augmentation_quasiIso := integerBimoduleAugmentation_quasiIso k B l
43
+ end TensorResolution
44
+
45
+ variable (P : CochainComplex (ModuleCat.{u} (Enveloping k B)) ℤ) (a : ℤ) (l : ℕ)
46
+ variable [∀ n, Module.Projective Bᵐᵒᵖ ((underlyingRightComplex P).X n)]
47
+
48
+ /-- The actual Q_X resolution with no assumed augmentation, projectivity, or support theorem. -/
49
+ def XResolution.resolutionModel :
50
+ BoundedBimoduleResolution k (AlgebraD k l B) (AlgebraD k l B) (XResolution.ordinaryXObject P a l) where
51
+ complex := XResolution.complex P a l
52
+ size := l+1
53
+ degrees := TensorResolution.finiteDegrees l
54
+ strictMono := TensorResolution.finiteDegrees_strictMono l
55
+ support n hn := by
56
+ apply XResolution.vanishes P a l n
57
+ have := (TensorResolution.finiteDegrees_range l n).not.mp hn
58
+ omega
59
+ rightProjective n := XResolution.right_projective P a l n
60
+ augmentation := XResolution.augmentationToX P a l
61
+ augmentation_quasiIso := XResolution.augmentationToX_quasiIso P a l
62
+
63
+ /-- The actual P[b] itself is a finite right-projective tensor model with exactly the source support. -/
64
+ def shiftedResolutionModel (b : ℤ) (hb : a+(l:ℤ)=b)
65
+ (hP : ∀ n : ℤ, n < a ∨ b < n → IsZero (P.X n)) : FiniteProjectiveBimoduleComplex k B B where
66
+ complex := P⟦b⟧
67
+ size := l+1
68
+ degrees := TensorResolution.finiteDegrees l
69
+ strictMono := TensorResolution.finiteDegrees_strictMono l
70
+ support n hn := by
71
+ change IsZero (P.X (n+b))
72
+ apply hP
73
+ have := (TensorResolution.finiteDegrees_range l n).not.mp hn
74
+ omega
75
+ rightProjective n := shifted_right_projective P b n
76
+ end LittleFinitistic.OrdinarySimulation
77
+
78
+ end
79
+
80
+ end OAI
lean/OAI/Algebra/Finitistic/Ordinary/OrdinarySupportedExtension.lean ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Mathlib.Algebra.Homology.Embedding.StupidTrunc
2
+
3
+ namespace OAI
4
+ noncomputable section
5
+ attribute [local instance] Classical.propDecidable
6
+ open CategoryTheory Limits
7
+ namespace LittleFinitistic.OrdinarySimulation.SupportedExtension
8
+ universe u v w w'
9
+ variable {C : Type u} [Category.{v} C] [HasZeroMorphisms C] [HasZeroObject C]
10
+ variable {I : Type w} {J : Type w'} {c : ComplexShape I} {c' : ComplexShape J}
11
+ variable (K : HomologicalComplex C c') (e : c.Embedding c') [e.IsRelIff] [K.IsStrictlySupported e]
12
+
13
+ /-- The supported complex's restriction and extension have its actual components. -/
14
+ def component (j : J) : (K.stupidTrunc e).X j ≅ K.X j :=
15
+ if hj : ∃ i, e.f i = j then K.stupidTruncXIso e hj.choose_spec
16
+ else (K.isZero_stupidTrunc_X e j (by simpa using hj)).iso
17
+ (K.isZero_X_of_isStrictlySupported e j (by simpa using hj))
18
+
19
+ omit [K.IsStrictlySupported e] in
20
+ theorem component_iso_unique {i j : I} {n : J} (hi : e.f i = n) (hj : e.f j = n) :
21
+ K.stupidTruncXIso e hi = K.stupidTruncXIso e hj := by
22
+ have h : i = j := e.injective_f (hi.trans hj.symm)
23
+ subst j
24
+ rfl
25
+
26
+ theorem component_at (i : I) : component K e (e.f i) = K.stupidTruncXIso e rfl := by
27
+ unfold component
28
+ rw [dite_eq_left (show ∃ j, e.f j = e.f i from ⟨i,rfl⟩)]
29
+ exact component_iso_unique K e _ _
30
+
31
+ /-- An actual chain isomorphism, with support supplied by proved zero objects. -/
32
+ def iso : K.stupidTrunc e ≅ K :=
33
+ HomologicalComplex.Hom.isoOfComponents (component K e) (by
34
+ intro i' j' _
35
+ by_cases hi : ∃ i, e.f i = i'
36
+ · obtain ⟨i,rfl⟩ := hi
37
+ by_cases hj : ∃ j, e.f j = j'
38
+ · obtain ⟨j,rfl⟩ := hj
39
+ rw [component_at,component_at]
40
+ change (((K.restriction e).extendXIso e rfl).hom ≫ 𝟙 _) ≫ K.d (e.f i) (e.f j) =
41
+ ((K.restriction e).extend e).d (e.f i) (e.f j) ≫
42
+ (((K.restriction e).extendXIso e rfl).hom ≫ 𝟙 _)
43
+ rw [Category.comp_id, Category.comp_id]
44
+ rw [HomologicalComplex.extend_d_eq _ _ rfl rfl]
45
+ simp only [Category.assoc,Iso.inv_hom_id,Category.comp_id]
46
+ rfl
47
+ · exact IsZero.eq_of_tgt (K.isZero_X_of_isStrictlySupported e j' (by simpa using hj)) _ _
48
+ · exact IsZero.eq_of_src (K.isZero_stupidTrunc_X e i' (by simpa using hi)) _ _)
49
+ end LittleFinitistic.OrdinarySimulation.SupportedExtension
50
+
51
+ end
52
+
53
+ end OAI