diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberEvaluation.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7c3337f91e1f296e0d2acc7bacc06e6459c60cf --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberEvaluation.lean @@ -0,0 +1,86 @@ +import OAI.Algebra.AuslanderReiten.Fibers.FiberEvaluationMap +import OAI.Algebra.AuslanderReiten.Evaluation.TensorTwistEvaluation + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory CategoryTheory.Pretriangulated +open scoped TensorProduct +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H₁ H₂ : kˣ) +local notation "R" => A k q +local notation "X" => A.simpleFiniteModule q +local notation "U₁" => twistedFiniteModule (sourceTwist q H₁) +local notation "U₂" => twistedFiniteModule (sourceTwist q H₂) +local notation "Y" => fiberTarget q + +abbrev evaluatedFiber := FiniteLeftModule.evaluated X (finiteFiber q H₁ H₂) + +abbrev evaluatedMiddle := FiniteLeftModule.evaluated X (FiniteLeftModule.fiberSource U₁ U₂ Y) + +def evaluatedTwistPairEquiv : + ((FiniteLeftModule.evaluated X U₁).carrier × (FiniteLeftModule.evaluated X U₂).carrier) ≃ₗ[R] + ((X).carrier × (X).carrier) := + LinearEquiv.prodCongr (evaluatedTwistEquiv q H₁) (evaluatedTwistEquiv q H₂) + +def middleToSimplePair : (evaluatedMiddle q H₁ H₂).carrier →ₗ[R] ((X).carrier × (X).carrier) := + (evaluatedTwistPairEquiv q H₁ H₂).toLinearMap.comp + (FiniteLeftModule.middlePairMap X U₁ U₂ Y) + +def middleSimpleStableIso : StableIsomorphism R (evaluatedMiddle q H₁ H₂).carrier + ((X).carrier × (X).carrier) := + (FiniteLeftModule.evaluatedMiddleStableIso X U₁ U₂ Y).trans + (StableIsomorphism.ofLinearEquiv (evaluatedTwistPairEquiv q H₁ H₂)) + +@[simp] theorem middleSimpleStableIso_hom : (middleSimpleStableIso q H₁ H₂).hom = + StableHom.classOf R _ _ (middleToSimplePair q H₁ H₂) := by + change StableHom.comp (StableHom.classOf R _ _ (evaluatedTwistPairEquiv q H₁ H₂).toLinearMap) + (FiniteLeftModule.evaluatedMiddleStableIso X U₁ U₂ Y).hom = _ + rw [FiniteLeftModule.evaluatedMiddleStableIso_hom, StableHom.comp_classOf] + rfl + +def evaluatedRho₁ : (evaluatedFiber q H₁ H₂).carrier →ₗ[R] (X).carrier := + (evaluatedTwistEquiv q H₁).toLinearMap.comp + (FiniteLeftModule.evaluationMap X (rho₁ q H₁ H₂).hom) + +def evaluatedRho₂ : (evaluatedFiber q H₁ H₂).carrier →ₗ[R] (X).carrier := + (evaluatedTwistEquiv q H₂).toLinearMap.comp + (FiniteLeftModule.evaluationMap X (rho₂ q H₁ H₂).hom) + +def evaluatedFiberInclusion : (evaluatedFiber q H₁ H₂).carrier →ₗ[R] + (evaluatedMiddle q H₁ H₂).carrier := + FiniteLeftModule.fiberEvaluationInclusion X U₁ U₂ Y + (normalizedLift q H₁) (normalizedLift q H₂) + +theorem middleToSimplePair_fiberInclusion : + (middleToSimplePair q H₁ H₂).comp (evaluatedFiberInclusion q H₁ H₂) = + (evaluatedRho₁ q H₁ H₂).prod (evaluatedRho₂ q H₁ H₂) := by + apply BalancedTensor.leftHom_ext (k := k) + intro m x + rfl + +theorem fiberTarget_right_projective : Module.Projective Rᵐᵒᵖ + (EnvelopingBimodule k R (fiberTarget q).carrier) := by + let := firstTailModule_right_finite q + let := firstTailModule_right_projective q + let := (BimoduleFiber.target_right (firstTailModule q) (AEnvelopingFrobeniusTrace k q)).2 + infer_instance + +def fiberEvaluationTriangle : + Triangle (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := by + letI := fiberTarget_right_projective q + exact FiniteLeftModule.evaluatedFiberTriangle X U₁ U₂ Y + (normalizedLift q H₁) (normalizedLift q H₂) (AFrobeniusTrace k q) + + theorem fiberEvaluationTriangle_distinguished : fiberEvaluationTriangle q H₁ H₂ ∈ + distTriang (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := by + let := fiberTarget_right_projective q + exact FiniteLeftModule.evaluatedFiberTriangle_distinguished X U₁ U₂ Y + (normalizedLift q H₁) (normalizedLift q H₂) (AFrobeniusTrace k q) + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberHomCoordinates.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberHomCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..8effa0c29259409569ae1cf2605326ad1777879d --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberHomCoordinates.lean @@ -0,0 +1,65 @@ +import OAI.Algebra.AuslanderReiten.Fibers.ConcreteFiberHomotopy +import OAI.Algebra.AuslanderReiten.Coordinates.MappedBiproductHom + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory CategoryTheory.Limits +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H₁ H₂ : kˣ) +local notation "R" => A k q +local notation "X" => A.simpleFiniteModule q +local notation "τ" => AFrobeniusTrace k q +local notation "HC" => HomotopyCategory (ModuleCat R) (ComplexShape.up ℤ) +local notation "Q" => HomotopyCategory.quotient (ModuleCat R) (ComplexShape.up ℤ) +abbrev simpleHomotopyObject := (Q).obj ((X).completeCochain τ) +local notation "SX" => simpleHomotopyObject q + +abbrev SimpleHom (n : ℤ) := SX ⟶ (SX)⟦n⟧ +abbrev FiberHom (n : ℤ) := SX ⟶ ((Q).obj ((evaluatedFiber q H₁ H₂).completeCochain τ))⟦n⟧ +abbrev MiddleHom (n : ℤ) := SX ⟶ ((Q).obj ((evaluatedMiddle q H₁ H₂).completeCochain τ))⟦n⟧ + +def middleHomEquiv (n : ℤ) : MiddleHom q H₁ H₂ n ≃ₗ[k] + (SimpleHom q n × SimpleHom q n) := + (Linear.homCongr k (Iso.refl _) ((CategoryTheory.shiftFunctor HC n).mapIso + (middleProductResolutionIso q H₁ H₂))).trans + (mappedBiproductHomEquiv k (CategoryTheory.shiftFunctor HC n) SX SX SX) + +def fiberHomInclusion (n : ℤ) : FiberHom q H₁ H₂ n →ₗ[k] MiddleHom q H₁ H₂ n := + Linear.rightComp k SX ((CategoryTheory.shiftFunctor HC n).map + ((Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := evaluatedMiddle q H₁ H₂) τ (evaluatedFiberInclusion q H₁ H₂)))) + +def fiberHomRhoPair (n : ℤ) : FiberHom q H₁ H₂ n →ₗ[k] + (SimpleHom q n × SimpleHom q n) := + (Linear.rightComp k SX ((CategoryTheory.shiftFunctor HC n).map + ((Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := X) τ (evaluatedRho₁ q H₁ H₂))))).prod + (Linear.rightComp k SX ((CategoryTheory.shiftFunctor HC n).map + ((Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := X) τ (evaluatedRho₂ q H₁ H₂))))) + +theorem middleHomEquiv_inclusion (n : ℤ) (f : FiberHom q H₁ H₂ n) : + middleHomEquiv q H₁ H₂ n (fiberHomInclusion q H₁ H₂ n f) = + fiberHomRhoPair q H₁ H₂ n f := by + apply Prod.ext + · simp only [middleHomEquiv, LinearEquiv.trans_apply, mappedBiproductHomEquiv_fst, + Linear.homCongr_apply, Iso.refl_inv, Category.id_comp, Functor.mapIso_hom, + fiberHomInclusion, Linear.rightComp_apply, fiberHomRhoPair, LinearMap.prod_apply] + simp only [Category.assoc, ← Functor.map_comp] + rw [fiberInclusion_product_fst q H₁ H₂] + rfl + · simp only [middleHomEquiv, LinearEquiv.trans_apply, mappedBiproductHomEquiv_snd, + Linear.homCongr_apply, Iso.refl_inv, Category.id_comp, Functor.mapIso_hom, + fiberHomInclusion, Linear.rightComp_apply, fiberHomRhoPair, LinearMap.prod_apply] + simp only [Category.assoc, ← Functor.map_comp] + rw [fiberInclusion_product_snd q H₁ H₂] + rfl + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberHomotopy.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberHomotopy.lean new file mode 100644 index 0000000000000000000000000000000000000000..c616e94c01a89c72fd393e7022ae8652865cb00b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberHomotopy.lean @@ -0,0 +1,77 @@ +import OAI.Algebra.AuslanderReiten.Fibers.ConcreteFiberEvaluation +import OAI.Algebra.AuslanderReiten.Resolutions.FiniteResolutionProduct + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory CategoryTheory.Limits +open scoped TensorProduct +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H₁ H₂ : kˣ) +local notation "R" => A k q +local notation "X" => A.simpleFiniteModule q +local notation "τ" => AFrobeniusTrace k q +local notation "Q" => HomotopyCategory.quotient (ModuleCat R) (ComplexShape.up ℤ) + +def middlePairResolutionIso : + (Q).obj ((evaluatedMiddle q H₁ H₂).completeCochain τ) ≅ + (Q).obj ((FiniteLeftModule.pairModule X X).completeCochain τ) := + FiniteLeftModule.stableResolutionIso (M := evaluatedMiddle q H₁ H₂) + (N := FiniteLeftModule.pairModule X X) τ (middleSimpleStableIso q H₁ H₂) + +@[simp] theorem middlePairResolutionIso_hom : (middlePairResolutionIso q H₁ H₂).hom = + (Q).map (FiniteLeftModule.resolutionMap (M := evaluatedMiddle q H₁ H₂) + (N := FiniteLeftModule.pairModule X X) τ (middleToSimplePair q H₁ H₂)) := + FiniteLeftModule.stableResolutionIso_hom_of_class τ _ _ (middleSimpleStableIso_hom q H₁ H₂) + +def middleProductResolutionIso : + (Q).obj ((evaluatedMiddle q H₁ H₂).completeCochain τ) ≅ + ((Q).obj ((X).completeCochain τ) ⊞ (Q).obj ((X).completeCochain τ)) := + (middlePairResolutionIso q H₁ H₂).trans (FiniteLeftModule.resolutionPairIso τ X X) + + theorem fiberInclusion_pairResolution : + (Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := evaluatedMiddle q H₁ H₂) τ (evaluatedFiberInclusion q H₁ H₂)) ≫ + (middlePairResolutionIso q H₁ H₂).hom = + (Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := FiniteLeftModule.pairModule X X) τ + ((evaluatedRho₁ q H₁ H₂).prod (evaluatedRho₂ q H₁ H₂))) := by + erw [middlePairResolutionIso_hom, ← FiniteLeftModule.resolutionMap_comp, + middleToSimplePair_fiberInclusion] + +theorem fiberInclusion_product_fst : + (Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := evaluatedMiddle q H₁ H₂) τ (evaluatedFiberInclusion q H₁ H₂)) ≫ + (middleProductResolutionIso q H₁ H₂).hom ≫ biprod.fst = + (Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := X) τ (evaluatedRho₁ q H₁ H₂)) := by + simp only [middleProductResolutionIso, Iso.trans_hom, Category.assoc, + FiniteLeftModule.resolutionPairIso_hom_fst] + rw [← Category.assoc] + erw [fiberInclusion_pairResolution q H₁ H₂] + exact (FiniteLeftModule.resolutionMap_comp (M := evaluatedFiber q H₁ H₂) + (N := FiniteLeftModule.pairModule X X) (L := X) τ + ((evaluatedRho₁ q H₁ H₂).prod (evaluatedRho₂ q H₁ H₂)) + (FiniteLeftModule.pairFst X X)).symm + +theorem fiberInclusion_product_snd : + (Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := evaluatedMiddle q H₁ H₂) τ (evaluatedFiberInclusion q H₁ H₂)) ≫ + (middleProductResolutionIso q H₁ H₂).hom ≫ biprod.snd = + (Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := X) τ (evaluatedRho₂ q H₁ H₂)) := by + simp only [middleProductResolutionIso, Iso.trans_hom, Category.assoc, + FiniteLeftModule.resolutionPairIso_hom_snd] + rw [← Category.assoc] + erw [fiberInclusion_pairResolution q H₁ H₂] + exact (FiniteLeftModule.resolutionMap_comp (M := evaluatedFiber q H₁ H₂) + (N := FiniteLeftModule.pairModule X X) (L := X) τ + ((evaluatedRho₁ q H₁ H₂).prod (evaluatedRho₂ q H₁ H₂)) + (FiniteLeftModule.pairSnd X X)).symm + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberProfile.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberProfile.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d219a9deea89e60e9cb8cc16c2f70faea042f25 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberProfile.lean @@ -0,0 +1,68 @@ +import OAI.Algebra.AuslanderReiten.Coordinates.BranchHomProfile +import OAI.Algebra.AuslanderReiten.Evaluation.ConcreteBranchDetector +import OAI.Algebra.AuslanderReiten.Fibers.FiberBranchConsequences + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open CochainComplex.HomComplex CompleteComparison +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +variable [HasDerivedCategory (ModuleCat.{u} (T k q))] +variable [HasDerivedCategory (ModuleCat.{u} (A k q))] +variable (hq : q ≠ 0) (hq1 : 1+q ≠ 0) (h : Resolution.NoPositivePowerOne q) +variable (H₁ H₂ : kˣ) +local notation "P₀" => A.simpleComplete q + +include hq hq1 h + +theorem normalizedBranches_equal : branchHom q H₁ = branchHom q H₂ := + branchHom_common_of_scalarCoordinate q hq1 (branchPlainScalarEquiv q hq hq1 h) H₁ H₂ + +theorem normalizedBranch_ne_zero (H : kˣ) : branchHom q H ≠ 0 := + branchHom_ne_zero_of_scalarCoordinate q hq1 (branchPlainScalarEquiv q hq hq1 h) H + +theorem fiberPositiveRhoPair_bijective (n : ℤ) (hn : 0 < n) : + Function.Bijective (fiberFullRhoPair q H₁ H₂ n) := + fiberFullRhoPair_positive_bijective q H₁ H₂ hq1 (branchZeroScalarEquiv q hq hq1 h) + (normalizedBranches_equal q hq hq1 h H₁ H₂) + (normalizedBranch_ne_zero q hq hq1 h H₁) + (fun a ha => branchHom_subsingleton q hq hq1 h a (by omega) (by omega)) n hn + +def fiberDiagonalClass : CohomologyClass P₀ (fiberComplete q H₁ H₂) 0 := by + letI := branchHom_subsingleton q hq hq1 h (-1) (by omega) (by omega) + exact fiberZeroClassOfBranches q H₁ H₂ hq1 (branchZeroScalarEquiv q hq hq1 h) + (normalizedBranches_equal q hq hq1 h H₁ H₂) + (normalizedBranch_ne_zero q hq hq1 h H₁) + +theorem fiberDiagonalClass_image : + fiberFullRhoPair q H₁ H₂ 0 (fiberDiagonalClass q hq hq1 h H₁ H₂) = + (fullHomIdentity P₀, fullHomIdentity P₀) := by + let := branchHom_subsingleton q hq hq1 h (-1) (by omega) (by omega) + exact fiberZeroClassOfBranches_image q H₁ H₂ hq1 (branchZeroScalarEquiv q hq hq1 h) + (normalizedBranches_equal q hq hq1 h H₁ H₂) + (normalizedBranch_ne_zero q hq hq1 h H₁) + +theorem fiberDiagonalClass_spans (x : CohomologyClass P₀ (fiberComplete q H₁ H₂) 0) : + ∃ c : k, x = c • fiberDiagonalClass q hq hq1 h H₁ H₂ := by + let := branchHom_subsingleton q hq hq1 h (-1) (by omega) (by omega) + exact fiberZeroClassOfBranches_spans q H₁ H₂ hq1 (branchZeroScalarEquiv q hq hq1 h) + (normalizedBranches_equal q hq hq1 h H₁ H₂) + (normalizedBranch_ne_zero q hq hq1 h H₁) x + +theorem fiberDiagonalClass_ne_zero : fiberDiagonalClass q hq hq1 h H₁ H₂ ≠ 0 := by + intro hz + have hp := fiberDiagonalClass_image q hq hq1 h H₁ H₂ + rw [hz, map_zero] at hp + have hs := congrArg (fun z => A.fullHomZeroScalarEquiv q hq1 z.1) hp + simp only [Prod.fst_zero, map_zero, fullHomIdentity, A.fullHomZeroScalarEquiv_identity] at hs + exact zero_ne_one hs + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberRow.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberRow.lean new file mode 100644 index 0000000000000000000000000000000000000000..460a03b7251ac3dc9b92fb056abb0b8cef60c386 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberRow.lean @@ -0,0 +1,70 @@ +import OAI.Algebra.AuslanderReiten.Fibers.ConcreteFiberComponentMaps +import OAI.Algebra.AuslanderReiten.Coordinates.MappedBiproductRow +import OAI.Algebra.AuslanderReiten.Algebras.SimpleHomScalars +import OAI.Algebra.AuslanderReiten.Homology.TriangleConnectingProduct + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory CategoryTheory.Limits +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H₁ H₂ : kˣ) +local notation "HC" => HomotopyCategory (ModuleCat (A k q)) (ComplexShape.up ℤ) +local notation "X₀" => simpleHomotopyObject q +local notation "T₀" => fiberProductTriangle q H₁ H₂ + +def fiberProductMiddleEquiv (n : ℤ) : + TriangleGradedSequence.Middle T₀ X₀ n ≃ₗ[k] (SimpleHom q n × SimpleHom q n) := + mappedBiproductHomEquiv k (CategoryTheory.shiftFunctor HC n) X₀ X₀ X₀ + +def fiberProductMiddleScalarEquiv (hq1 : 1+q ≠ 0) : + TriangleGradedSequence.Middle T₀ X₀ 0 ≃ₗ[k] k × k := + (fiberProductMiddleEquiv q H₁ H₂ 0).trans + ((simpleZeroScalarEquiv q hq1).prodCongr (simpleZeroScalarEquiv q hq1)) + +def branchZeroHom (H : kˣ) : BranchHom q 0 := + branchHom q H ≫ (shiftFunctorZero HC ℤ).inv.app (branchTargetObject q) + +theorem fiberProductSecond_row (n : ℤ) + (m : TriangleGradedSequence.Middle T₀ X₀ n) : + TriangleGradedSequence.second k T₀ X₀ n m = + (fiberProductMiddleEquiv q H₁ H₂ n m).1 ≫ (branchHom q H₁)⟦n⟧' + + (fiberProductMiddleEquiv q H₁ H₂ n m).2 ≫ (branchHom q H₂)⟦n⟧' := by + erw [TriangleGradedSequence.second_eq_shift, + mappedBiproduct_row k (CategoryTheory.shiftFunctor HC n) X₀ X₀ X₀, + fiberProductTriangle_inl_second, fiberProductTriangle_inr_second] + rfl + +theorem fiberProductSecond_zero (hq1 : 1+q ≠ 0) + (m : TriangleGradedSequence.Middle T₀ X₀ 0) : + TriangleGradedSequence.second k T₀ X₀ 0 m = + (fiberProductMiddleScalarEquiv q H₁ H₂ hq1 m).1 • branchZeroHom q H₁ + + (fiberProductMiddleScalarEquiv q H₁ H₂ hq1 m).2 • branchZeroHom q H₂ := by + have h₁ := congrArg (fun v => v ≫ (branchHom q H₁)⟦(0 : ℤ)⟧') + (simpleHom_eq_scalar_unit q hq1 (fiberProductMiddleEquiv q H₁ H₂ 0 m).1) + have h₂ := congrArg (fun v => v ≫ (branchHom q H₂)⟦(0 : ℤ)⟧') + (simpleHom_eq_scalar_unit q hq1 (fiberProductMiddleEquiv q H₁ H₂ 0 m).2) + refine (fiberProductSecond_row q H₁ H₂ 0 m).trans ((congrArg₂ (· + ·) h₁ h₂).trans ?_) + rw [Linear.smul_comp, Linear.smul_comp, simpleZeroUnit_postcomp, simpleZeroUnit_postcomp] + rfl + +theorem fiberProductSecond_zero_common (hq1 : 1+q ≠ 0) + (e : BranchHom q 0 ≃ₗ[k] k) (hg : branchHom q H₁ = branchHom q H₂) + (m : TriangleGradedSequence.Middle T₀ X₀ 0) : + e (TriangleGradedSequence.second k T₀ X₀ 0 m) = + e (branchZeroHom q H₁) * + ((fiberProductMiddleScalarEquiv q H₁ H₂ hq1 m).1 + + (fiberProductMiddleScalarEquiv q H₁ H₂ hq1 m).2) := by + have hz : branchZeroHom q H₁ = branchZeroHom q H₂ := + congrArg (fun f => f ≫ (shiftFunctorZero HC ℤ).inv.app (branchTargetObject q)) hg + rw [fiberProductSecond_zero q H₁ H₂ hq1, ← hz, map_add, map_smul, map_smul] + simp only [smul_eq_mul] + ring + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberTriangle.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberTriangle.lean new file mode 100644 index 0000000000000000000000000000000000000000..1079ed48a4d89b921102f606c796886a4f17d877 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/ConcreteFiberTriangle.lean @@ -0,0 +1,50 @@ +import OAI.Algebra.AuslanderReiten.Fibers.ConcreteFiberHomotopy +import OAI.Algebra.AuslanderReiten.Homology.TriangleMiddleTransport + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory CategoryTheory.Limits CategoryTheory.Pretriangulated +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H₁ H₂ : kˣ) +local notation "R" => A k q +local notation "X" => A.simpleFiniteModule q +local notation "τ" => AFrobeniusTrace k q +local notation "HC" => HomotopyCategory (ModuleCat R) (ComplexShape.up ℤ) +local notation "Q" => HomotopyCategory.quotient (ModuleCat R) (ComplexShape.up ℤ) + +@[simp] theorem fiberEvaluationTriangle_first : (fiberEvaluationTriangle q H₁ H₂).mor₁ = + (Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := evaluatedMiddle q H₁ H₂) τ (evaluatedFiberInclusion q H₁ H₂)) := rfl + +def fiberProductTriangle : Triangle HC := + triangleReplaceMiddle (fiberEvaluationTriangle q H₁ H₂) (middleProductResolutionIso q H₁ H₂) + +def fiberProductTriangleIso : fiberEvaluationTriangle q H₁ H₂ ≅ fiberProductTriangle q H₁ H₂ := + triangleReplaceMiddleIso _ _ + + theorem fiberProductTriangle_distinguished : fiberProductTriangle q H₁ H₂ ∈ distTriang HC := + triangleReplaceMiddle_distinguished _ _ (fiberEvaluationTriangle_distinguished q H₁ H₂) + +theorem fiberProductTriangle_first_fst : (fiberProductTriangle q H₁ H₂).mor₁ ≫ biprod.fst = + (Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := X) τ (evaluatedRho₁ q H₁ H₂)) := by + change ((fiberEvaluationTriangle q H₁ H₂).mor₁ ≫ + (middleProductResolutionIso q H₁ H₂).hom) ≫ biprod.fst = _ + erw [fiberEvaluationTriangle_first, Category.assoc] + exact fiberInclusion_product_fst q H₁ H₂ + +theorem fiberProductTriangle_first_snd : (fiberProductTriangle q H₁ H₂).mor₁ ≫ biprod.snd = + (Q).map (FiniteLeftModule.resolutionMap (M := evaluatedFiber q H₁ H₂) + (N := X) τ (evaluatedRho₂ q H₁ H₂)) := by + change ((fiberEvaluationTriangle q H₁ H₂).mor₁ ≫ + (middleProductResolutionIso q H₁ H₂).hom) ≫ biprod.snd = _ + erw [fiberEvaluationTriangle_first, Category.assoc] + exact fiberInclusion_product_snd q H₁ H₂ + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/ExplicitBimoduleFiber.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/ExplicitBimoduleFiber.lean new file mode 100644 index 0000000000000000000000000000000000000000..12d73e0d01000ec77ddf7c7114bb52e7c41f3d50 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/ExplicitBimoduleFiber.lean @@ -0,0 +1,74 @@ +import OAI.Algebra.AuslanderReiten.Coordinates.TensorFiniteLift + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open scoped TensorProduct +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H H₁ H₂ : kˣ) +local notation "R" => A k q +local notation "Ae" => R ⊗[k] Rᵐᵒᵖ + +abbrev fiberTarget : FiniteLeftModule k Ae := (firstTailModule q).canonicalCosyzygies 4 + +def normalizedLift : (twistedFiniteModule (sourceTwist q H)).carrier ⟶ (fiberTarget q).carrier := + ModuleCat.ofHom (X := (twistedFiniteModule (sourceTwist q H)).carrier) + (Y := (fiberTarget q).carrier) (((H : k)^2)⁻¹ • finiteLift q H) + +@[simp] theorem normalizedLift_apply (x : (twistedFiniteModule (sourceTwist q H)).carrier) : + normalizedLift q H x = ((H : k)^2)⁻¹ • finiteLift q H x := rfl + +abbrev finiteFiber : FiniteLeftModule k Ae := + BimoduleFiber.finiteModule (firstTailModule q) (sourceTwist q H₁) (sourceTwist q H₂) + (normalizedLift q H₁) (normalizedLift q H₂) + +abbrev explicitBimodule := + BimoduleFiber.bimodule (firstTailModule q) (sourceTwist q H₁) (sourceTwist q H₂) + (normalizedLift q H₁) (normalizedLift q H₂) + +def rho₁ : (finiteFiber q H₁ H₂).carrier ⟶ (twistedFiniteModule (sourceTwist q H₁)).carrier := + FiniteLeftModule.fiberProjection₁ + (twistedFiniteModule (sourceTwist q H₁)) (twistedFiniteModule (sourceTwist q H₂)) + (fiberTarget q) (normalizedLift q H₁) (normalizedLift q H₂) + +def rho₂ : (finiteFiber q H₁ H₂).carrier ⟶ (twistedFiniteModule (sourceTwist q H₂)).carrier := + FiniteLeftModule.fiberProjection₂ + (twistedFiniteModule (sourceTwist q H₁)) (twistedFiniteModule (sourceTwist q H₂)) + (fiberTarget q) (normalizedLift q H₁) (normalizedLift q H₂) + +def explicitFiberSequence := + FiniteLeftModule.fiberSequence + (twistedFiniteModule (sourceTwist q H₁)) (twistedFiniteModule (sourceTwist q H₂)) + (fiberTarget q) (normalizedLift q H₁) (normalizedLift q H₂) + +theorem explicitFiberSequence_shortExact : (explicitFiberSequence q H₁ H₂).ShortExact := + FiniteLeftModule.fiberSequence_shortExact + (twistedFiniteModule (sourceTwist q H₁)) (twistedFiniteModule (sourceTwist q H₂)) + (fiberTarget q) (normalizedLift q H₁) (normalizedLift q H₂) + +theorem explicitBimodule_finite_k : Module.Finite k (explicitBimodule q H₁ H₂) := by + infer_instance + +theorem explicitBimodule_left : + Module.Finite R (explicitBimodule q H₁ H₂) ∧ + Module.Projective R (explicitBimodule q H₁ H₂) := by + let := firstTailModule_left_finite q + let := firstTailModule_left_projective q + exact BimoduleFiber.left (firstTailModule q) (sourceTwist q H₁) (sourceTwist q H₂) + (normalizedLift q H₁) (normalizedLift q H₂) (AEnvelopingFrobeniusTrace k q) + +theorem explicitBimodule_right : + Module.Finite Rᵐᵒᵖ (explicitBimodule q H₁ H₂) ∧ + Module.Projective Rᵐᵒᵖ (explicitBimodule q H₁ H₂) := by + let := firstTailModule_right_finite q + let := firstTailModule_right_projective q + exact BimoduleFiber.right (firstTailModule q) (sourceTwist q H₁) (sourceTwist q H₂) + (normalizedLift q H₁) (normalizedLift q H₂) (AEnvelopingFrobeniusTrace k q) + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/ExplicitBimoduleProjective.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/ExplicitBimoduleProjective.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b8ddb9a40ae28530b5d888d6ee895e7af84f50d --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/ExplicitBimoduleProjective.lean @@ -0,0 +1,26 @@ +import OAI.Algebra.AuslanderReiten.Fibers.ExplicitBimoduleFiber + +namespace OAI + +noncomputable section +namespace ArExplicit.T +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H₁ H₂ : kˣ) + +instance explicitBimodule_finite_left : Module.Finite (A k q) (explicitBimodule q H₁ H₂) := + (explicitBimodule_left q H₁ H₂).1 + +instance explicitBimodule_projective_left : Module.Projective (A k q) (explicitBimodule q H₁ H₂) := + (explicitBimodule_left q H₁ H₂).2 + +instance explicitBimodule_finite_right : Module.Finite (A k q)ᵐᵒᵖ (explicitBimodule q H₁ H₂) := + (explicitBimodule_right q H₁ H₂).1 + +instance explicitBimodule_projective_right : Module.Projective (A k q)ᵐᵒᵖ (explicitBimodule q H₁ H₂) := + (explicitBimodule_right q H₁ H₂).2 + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberBranchConsequences.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberBranchConsequences.lean new file mode 100644 index 0000000000000000000000000000000000000000..b97bef47bf0c1e6206f5831ac12ef18f5641f657 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberBranchConsequences.lean @@ -0,0 +1,110 @@ +import OAI.Algebra.AuslanderReiten.Fibers.FiberProductCoordinates +import OAI.Algebra.AuslanderReiten.Fibers.FiberDiagonalGenerator + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open CochainComplex.HomComplex CompleteComparison +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H₁ H₂ : kˣ) +local notation "HC" => HomotopyCategory (ModuleCat (A k q)) (ComplexShape.up ℤ) +local notation "T₀" => fiberProductTriangle q H₁ H₂ +local notation "X₀" => simpleHomotopyObject q +local notation "P₀" => A.simpleComplete q + +theorem branchZeroHom_ne_zero (H : kˣ) (hn : branchHom q H ≠ 0) : + branchZeroHom q H ≠ 0 := by + intro h + apply hn + apply (cancel_mono ((shiftFunctorZero HC ℤ).inv.app (branchTargetObject q))).1 + simpa only [branchZeroHom, Limits.zero_comp] using h + +variable (hq1 : 1+q ≠ 0) (e : BranchHom q 0 ≃ₗ[k] k) +variable (hg : branchHom q H₁ = branchHom q H₂) (hn : branchHom q H₁ ≠ 0) + +include hn in +theorem branchScalar_ne_zero : e (branchZeroHom q H₁) ≠ 0 := by + intro hz + exact branchZeroHom_ne_zero q H₁ hn (e.injective (hz.trans (map_zero e).symm)) + +include hq1 e hg hn + +theorem fiberSecondZero_surjective : + Function.Surjective (TriangleGradedSequence.second k T₀ X₀ 0) := + TriangleGradedSequence.second_zero_surjective k T₀ X₀ + (fiberProductMiddleScalarEquiv q H₁ H₂ hq1) e + (e (branchZeroHom q H₁)) (branchScalar_ne_zero q H₁ e hn) + (fiberProductSecond_zero_common q H₁ H₂ hq1 e hg) + +theorem fiberFullRhoPair_positive_bijective + (hpos : ∀ n : ℤ, 0 < n → Subsingleton (BranchHom q n)) + (n : ℤ) (hnpos : 0 < n) : + Function.Bijective (fiberFullRhoPair q H₁ H₂ n) := by + apply fiberFullRhoPair_bijective_of_rho + apply fiberRhoPair_bijective_of_productFirst + exact TriangleGradedSequence.first_positive_bijective k T₀ + (fiberProductTriangle_distinguished q H₁ H₂) X₀ hpos + (fiberSecondZero_surjective q H₁ H₂ hq1 e hg hn) n hnpos + +variable [Subsingleton (BranchHom q (-1))] +local instance : Subsingleton (TriangleGradedSequence.Top T₀ X₀ (-1)) := + inferInstanceAs (Subsingleton (BranchHom q (-1))) + +def fiberZeroScalarEquivOfBranches : FiberHom q H₁ H₂ 0 ≃ₗ[k] k := + TriangleGradedSequence.zeroScalarEquiv k T₀ + (fiberProductTriangle_distinguished q H₁ H₂) X₀ + (fiberProductMiddleScalarEquiv q H₁ H₂ hq1) e + (e (branchZeroHom q H₁)) (branchScalar_ne_zero q H₁ e hn) + (fiberProductSecond_zero_common q H₁ H₂ hq1 e hg) + +def fiberZeroClassOfBranches : CohomologyClass P₀ (fiberComplete q H₁ H₂) 0 := + (fiberFullHomEquiv q H₁ H₂ 0).symm + ((fiberZeroScalarEquivOfBranches q H₁ H₂ hq1 e hg hn).symm 1) + +omit e hg hn [Subsingleton (BranchHom q (-1))] in +theorem fiberFullRhoPair_zero_coordinates + (x : CohomologyClass P₀ (fiberComplete q H₁ H₂) 0) : + ((A.fullHomZeroScalarEquiv q hq1).prodCongr (A.fullHomZeroScalarEquiv q hq1)) + (fiberFullRhoPair q H₁ H₂ 0 x) = + fiberProductMiddleScalarEquiv q H₁ H₂ hq1 + (TriangleGradedSequence.first k T₀ X₀ 0 (fiberFullHomEquiv q H₁ H₂ 0 x)) := by + change _ = ((simpleZeroScalarEquiv q hq1).prodCongr (simpleZeroScalarEquiv q hq1)) + (fiberProductMiddleEquiv q H₁ H₂ 0 _) + rw [fiberProductFirst_coordinates] + rfl + +theorem fiberZeroClassOfBranches_image : + fiberFullRhoPair q H₁ H₂ 0 (fiberZeroClassOfBranches q H₁ H₂ hq1 e hg hn) = + (fullHomIdentity P₀, fullHomIdentity P₀) := by + apply ((A.fullHomZeroScalarEquiv q hq1).prodCongr (A.fullHomZeroScalarEquiv q hq1)).injective + rw [fiberFullRhoPair_zero_coordinates] + simp only [LinearEquiv.prodCongr_apply, fullHomIdentity, A.fullHomZeroScalarEquiv_identity] + rw [fiberZeroClassOfBranches, LinearEquiv.apply_symm_apply] + change fiberProductMiddleScalarEquiv q H₁ H₂ hq1 + (TriangleGradedSequence.first k T₀ X₀ 0 + ((fiberZeroScalarEquivOfBranches q H₁ H₂ hq1 e hg hn).symm 1)) = (1, 1) + exact TriangleGradedSequence.diagonalGenerator_image k T₀ + (fiberProductTriangle_distinguished q H₁ H₂) X₀ + (fiberProductMiddleScalarEquiv q H₁ H₂ hq1) e + (e (branchZeroHom q H₁)) (branchScalar_ne_zero q H₁ e hn) + (fiberProductSecond_zero_common q H₁ H₂ hq1 e hg) + +theorem fiberZeroClassOfBranches_spans + (x : CohomologyClass P₀ (fiberComplete q H₁ H₂) 0) : + ∃ c : k, x = c • fiberZeroClassOfBranches q H₁ H₂ hq1 e hg hn := by + let f := (fiberFullHomEquiv q H₁ H₂ 0).trans + (fiberZeroScalarEquivOfBranches q H₁ H₂ hq1 e hg hn) + refine ⟨f x, f.injective ?_⟩ + rw [map_smul] + change f x = f x • f (f.symm 1) + rw [f.apply_symm_apply] + exact (mul_one _).symm + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberDiagonalGenerator.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberDiagonalGenerator.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b3a6a1fbd39e6a5b5eb88e1bc2e42145993f165 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberDiagonalGenerator.lean @@ -0,0 +1,53 @@ +import OAI.Algebra.AuslanderReiten.Fibers.FiberProjectionZero + +namespace OAI + +noncomputable section +namespace ArExplicit.TriangleGradedSequence +open CategoryTheory CategoryTheory.Pretriangulated +universe u v w +variable (k : Type u) [Field k] [CharP k 2] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable [Limits.HasZeroObject C] [HasShift C ℤ] +variable [∀ n : ℤ, (CategoryTheory.shiftFunctor C n).Additive] [Pretriangulated C] +variable (T : Triangle C) (hT : T ∈ distTriang C) (X : C) +variable (em : Middle T X 0 ≃ₗ[k] k × k) (et : Top T X 0 ≃ₗ[k] k) +variable (c : k) (hc : c ≠ 0) +variable (hrow : ∀ m, et (second k T X 0 m) = c * ((em m).1 + (em m).2)) +variable [Subsingleton (Top T X (-1))] + +def zeroScalarEquiv : Bottom T X 0 ≃ₗ[k] k := + (zeroDiagonalEquiv k T hT X em et c hc hrow).trans (scalarDiagonalEquiv k) + +def diagonalGenerator : Bottom T X 0 := + (zeroScalarEquiv k T hT X em et c hc hrow).symm 1 + +@[simp] theorem zeroScalarEquiv_diagonalGenerator : + zeroScalarEquiv k T hT X em et c hc hrow (diagonalGenerator k T hT X em et c hc hrow) = 1 := + LinearEquiv.apply_symm_apply _ _ + +theorem diagonalGenerator_image : + em (first k T X 0 (diagonalGenerator k T hT X em et c hc hrow)) = (1,1) := by + have h := congrArg Subtype.val + ((zeroDiagonalEquiv k T hT X em et c hc hrow).apply_symm_apply + ((scalarDiagonalEquiv k).symm 1)) + exact h + +theorem diagonalGenerator_ne_zero : diagonalGenerator k T hT X em et c hc hrow ≠ 0 := by + intro hz + have h := zeroScalarEquiv_diagonalGenerator k T hT X em et c hc hrow + rw [hz, map_zero] at h + exact zero_ne_one h + +theorem eq_scalar_diagonalGenerator (z : Bottom T X 0) : + z = zeroScalarEquiv k T hT X em et c hc hrow z • + diagonalGenerator k T hT X em et c hc hrow := by + apply (zeroScalarEquiv k T hT X em et c hc hrow).injective + rw [map_smul, zeroScalarEquiv_diagonalGenerator] + exact (mul_one _).symm + +end ArExplicit.TriangleGradedSequence + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberEvaluationMap.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberEvaluationMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..a785bf53a49608ac11897f96495a808038776838 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberEvaluationMap.lean @@ -0,0 +1,30 @@ +import OAI.Algebra.AuslanderReiten.Fibers.FiniteEvaluatedFiber + +namespace OAI + +noncomputable section +namespace ArExplicit.FiniteLeftModule +open CategoryTheory +open scoped TensorProduct +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (X : FiniteLeftModule k R) +variable (U₁ U₂ Y : FiniteLeftModule k (R ⊗[k] Rᵐᵒᵖ)) +variable (g₁ : U₁.carrier ⟶ Y.carrier) (g₂ : U₂.carrier ⟶ Y.carrier) + +def fiberEvaluationInclusion : (evaluated X (fiber U₁ U₂ Y g₁ g₂)).carrier →ₗ[R] + (evaluated X (fiberSource U₁ U₂ Y)).carrier := + evaluationMap X (M := fiber U₁ U₂ Y g₁ g₂) (N := fiberSource U₁ U₂ Y) + (fiberInclusion U₁ U₂ Y g₁ g₂).hom + +theorem middlePairMap_fiberEvaluationInclusion : + (middlePairMap X U₁ U₂ Y).comp (fiberEvaluationInclusion X U₁ U₂ Y g₁ g₂) = + (evaluationMap X (fiberProjection₁ U₁ U₂ Y g₁ g₂).hom).prod + (evaluationMap X (fiberProjection₂ U₁ U₂ Y g₁ g₂).hom) := + middlePairMap_fiberInclusion X U₁ U₂ Y g₁ g₂ + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberExactness.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberExactness.lean new file mode 100644 index 0000000000000000000000000000000000000000..d08de3ceef7dc2894968b0418acfeb8ab395f996 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberExactness.lean @@ -0,0 +1,43 @@ +import Mathlib.LinearAlgebra.Prod + +namespace OAI + +namespace ArExplicit + +section Fiber + +variable {k : Type*} [Ring k] +variable {B₀ B₁ B₂ C₀ C₁ C₂ : Type*} +variable [AddCommGroup B₀] [AddCommGroup B₁] [AddCommGroup B₂] +variable [AddCommGroup C₀] [AddCommGroup C₁] [AddCommGroup C₂] +variable [Module k B₀] [Module k B₁] [Module k B₂] +variable [Module k C₀] [Module k C₁] [Module k C₂] + +theorem fiber_cocycle_is_boundary + (dB₀ : B₀ →ₗ[k] B₁) (dB₁ : B₁ →ₗ[k] B₂) + (dC₀ : C₀ →ₗ[k] C₁) (dC₁ : C₁ →ₗ[k] C₂) + (f₀ : B₀ →ₗ[k] C₁) (f₁ : B₁ →ₗ[k] C₂) + (hf : ∀ a, f₁ (dB₀ a) = dC₁ (f₀ a)) + (hinj : ∀ b, dB₁ b = 0 → (∃ c, f₁ b = dC₁ c) → ∃ a, dB₀ a = b) + (hsurj : ∀ c, dC₁ c = 0 → ∃ a, dB₀ a = 0 ∧ ∃ e, f₀ a - dC₀ e = c) + (b : B₁) (c : C₁) (hb : dB₁ b = 0) (hc : f₁ b = dC₁ c) : + ∃ a : B₀, ∃ e : C₀, dB₀ a = b ∧ f₀ a - dC₀ e = c := by + obtain ⟨a, ha⟩ := hinj b hb ⟨c, hc⟩ + have hcycle : dC₁ (c - f₀ a) = 0 := by + rw [map_sub, ← hf, ha, hc, sub_self] + obtain ⟨u, hu, e, he⟩ := hsurj (c - f₀ a) hcycle + refine ⟨a + u, e, ?_, ?_⟩ + · rw [map_add, ha, hu, add_zero] + · rw [map_add, add_sub_assoc, he, add_sub_cancel] + +theorem fiber_nonboundary_of_projection + (dB₀ : B₀ →ₗ[k] B₁) (dC₀ : C₀ →ₗ[k] C₁) (f₀ : B₀ →ₗ[k] C₁) + (b : B₁) (c : C₁) (hb : ¬ ∃ a, dB₀ a = b) : + ¬ ∃ a : B₀, ∃ e : C₀, dB₀ a = b ∧ f₀ a - dC₀ e = c := by + rintro ⟨a, e, ha, he⟩ + exact hb ⟨a, ha⟩ + +end Fiber +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberFullHomCoordinates.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberFullHomCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..298d42064a0fa193938ec82233c5d2e93612d1f5 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberFullHomCoordinates.lean @@ -0,0 +1,50 @@ +import OAI.Algebra.AuslanderReiten.Fibers.ConcreteFiberHomCoordinates +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomShiftedMaps +import OAI.Algebra.AuslanderReiten.HomComplex.TensorFullHomZero + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open CochainComplex.HomComplex +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H₁ H₂ : kˣ) +local notation "τ₀" => AFrobeniusTrace k q +local notation "P₀" => A.simpleComplete q + +abbrev fiberComplete := (evaluatedFiber q H₁ H₂).completeCochain τ₀ + +def fiberFullHomEquiv (n : ℤ) : + CohomologyClass P₀ (fiberComplete q H₁ H₂) n ≃ₗ[k] FiberHom q H₁ H₂ n := + fullHomShiftedHomotopyEquiv k P₀ (fiberComplete q H₁ H₂) n + +def simpleFullHomEquiv (n : ℤ) : CohomologyClass P₀ P₀ n ≃ₗ[k] SimpleHom q n := + fullHomShiftedHomotopyEquiv k P₀ P₀ n + +def fiberFullRhoPair (n : ℤ) : + CohomologyClass P₀ (fiberComplete q H₁ H₂) n →ₗ[k] + (CohomologyClass P₀ P₀ n × CohomologyClass P₀ P₀ n) := + (((simpleFullHomEquiv q n).symm.prodCongr (simpleFullHomEquiv q n).symm).toLinearMap.comp + (fiberHomRhoPair q H₁ H₂ n)).comp (fiberFullHomEquiv q H₁ H₂ n).toLinearMap + +theorem fiberFullRhoPair_apply (n : ℤ) + (x : CohomologyClass P₀ (fiberComplete q H₁ H₂) n) : + fiberFullRhoPair q H₁ H₂ n x = + (fullHomPostcomp (FiniteLeftModule.resolutionMap τ₀ (evaluatedRho₁ q H₁ H₂)) n x, + fullHomPostcomp (FiniteLeftModule.resolutionMap τ₀ (evaluatedRho₂ q H₁ H₂)) n x) := by + apply ((simpleFullHomEquiv q n).prodCongr (simpleFullHomEquiv q n)).injective + simp only [fiberFullRhoPair, LinearMap.comp_apply, LinearEquiv.coe_coe, + LinearEquiv.prodCongr_apply, LinearEquiv.apply_symm_apply] + apply Prod.ext + · exact (fullHomShiftedHomotopyEquiv_postcomp k n + (FiniteLeftModule.resolutionMap τ₀ (evaluatedRho₁ q H₁ H₂)) x).symm + · exact (fullHomShiftedHomotopyEquiv_postcomp k n + (FiniteLeftModule.resolutionMap τ₀ (evaluatedRho₂ q H₁ H₂)) x).symm + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberProductCoordinates.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberProductCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ddbc6fb6f77ad995eaad1f66e33733b83dd980a --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberProductCoordinates.lean @@ -0,0 +1,44 @@ +import OAI.Algebra.AuslanderReiten.Fibers.ConcreteFiberRow +import OAI.Algebra.AuslanderReiten.Fibers.FiberSequenceCoordinates + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory CategoryTheory.Limits +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H₁ H₂ : kˣ) +local notation "R₀" => A k q +local notation "X₀" => simpleHomotopyObject q +local notation "τ₀" => AFrobeniusTrace k q +local notation "T₀" => fiberProductTriangle q H₁ H₂ +local notation "Q₀" => HomotopyCategory.quotient (ModuleCat R₀) (ComplexShape.up ℤ) + +theorem fiberProductFirst_coordinates (n : ℤ) (v : FiberHom q H₁ H₂ n) : + fiberProductMiddleEquiv q H₁ H₂ n + (TriangleGradedSequence.first k T₀ X₀ n v) = fiberHomRhoPair q H₁ H₂ n v := by + erw [TriangleGradedSequence.first_eq_shift] + apply Prod.ext + · change (v ≫ (T₀).mor₁⟦n⟧') ≫ biprod.fst⟦n⟧' = + v ≫ ((Q₀).map (FiniteLeftModule.resolutionMap τ₀ (evaluatedRho₁ q H₁ H₂)))⟦n⟧' + erw [Category.assoc, ← Functor.map_comp, fiberProductTriangle_first_fst] + · change (v ≫ (T₀).mor₁⟦n⟧') ≫ biprod.snd⟦n⟧' = + v ≫ ((Q₀).map (FiniteLeftModule.resolutionMap τ₀ (evaluatedRho₂ q H₁ H₂)))⟦n⟧' + erw [Category.assoc, ← Functor.map_comp, fiberProductTriangle_first_snd] + +theorem fiberRhoPair_bijective_of_productFirst (n : ℤ) + (hf : Function.Bijective (TriangleGradedSequence.first k T₀ X₀ n)) : + Function.Bijective (fiberHomRhoPair q H₁ H₂ n) := by + have he : (fiberHomRhoPair q H₁ H₂ n : FiberHom q H₁ H₂ n → _) = + (fiberProductMiddleEquiv q H₁ H₂ n) ∘ (TriangleGradedSequence.first k T₀ X₀ n) := by + funext v + exact (fiberProductFirst_coordinates q H₁ H₂ n v).symm + rw [he] + exact (fiberProductMiddleEquiv q H₁ H₂ n).bijective.comp hf + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberProjectionProfile.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberProjectionProfile.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3cf6b043394a9231c4d697bb2acd1c6185417ff --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberProjectionProfile.lean @@ -0,0 +1,75 @@ +import OAI.Algebra.AuslanderReiten.Homology.TriangleGradedSequence + +namespace OAI + +noncomputable section +namespace ArExplicit.TriangleGradedSequence +open CategoryTheory CategoryTheory.Pretriangulated +universe u v w +variable (k : Type u) [Field k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable [Limits.HasZeroObject C] [HasShift C ℤ] +variable [∀ n : ℤ, (CategoryTheory.shiftFunctor C n).Additive] [Pretriangulated C] +variable (T : Triangle C) (hT : T ∈ distTriang C) (X : C) +include hT + +theorem first_injective_of_previous_surjective (n : ℤ) + (hs : Function.Surjective (second k T X n)) : + Function.Injective (first k T X (n+1)) := by + have hc : connecting k T X n = 0 := by + apply LinearMap.ext + intro x + have hx : x ∈ LinearMap.range (second k T X n) := hs x + rw [exact_top k T X hT n] at hx + exact hx + rw [← LinearMap.ker_eq_bot, ← exact_next k T X hT n, hc, LinearMap.range_zero] + +theorem first_surjective_of_top_subsingleton (n : ℤ) [Subsingleton (Top T X n)] : + Function.Surjective (first k T X n) := by + rw [← LinearMap.range_eq_top, exact_middle k T X hT n] + apply top_unique + intro x _ + exact Subsingleton.elim _ _ + +omit hT [Limits.HasZeroObject C] [Pretriangulated C] in + +theorem second_surjective_of_top_subsingleton (n : ℤ) [Subsingleton (Top T X n)] : + Function.Surjective (second k T X n) := by + intro y + exact ⟨0, Subsingleton.elim _ _⟩ + +theorem first_positive_bijective + (hpos : ∀ n : ℤ, 0 < n → Subsingleton (Top T X n)) + (hs₀ : Function.Surjective (second k T X 0)) (n : ℤ) (hn : 0 < n) : + Function.Bijective (first k T X n) := by + constructor + · have hs : Function.Surjective (second k T X (n-1)) := by + by_cases h1 : n = 1 + · subst n + exact hs₀ + · let := hpos (n-1) (by omega) + exact second_surjective_of_top_subsingleton k T X (n-1) + generalize hm : n - 1 = m at hs + have he : n = m + 1 := by omega + subst n + exact first_injective_of_previous_surjective k T hT X m hs + · let := hpos n hn + exact first_surjective_of_top_subsingleton k T hT X n + +def firstPositiveEquiv + (hpos : ∀ n : ℤ, 0 < n → Subsingleton (Top T X n)) + (hs₀ : Function.Surjective (second k T X 0)) (n : ℤ) (hn : 0 < n) : + Bottom T X n ≃ₗ[k] Middle T X n := + LinearEquiv.ofBijective (first k T X n) (first_positive_bijective k T hT X hpos hs₀ n hn) + +theorem first_zero_injective [Subsingleton (Top T X (-1))] : + Function.Injective (first k T X 0) := by + have hinj := first_injective_of_previous_surjective k T hT X (-1) + (second_surjective_of_top_subsingleton k T X (-1)) + exact hinj + +end ArExplicit.TriangleGradedSequence + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberProjectionZero.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberProjectionZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..9373811a6eb10867aad930a431c5304695b49266 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberProjectionZero.lean @@ -0,0 +1,87 @@ +import OAI.Algebra.AuslanderReiten.Fibers.FiberProjectionProfile +import OAI.Algebra.AuslanderReiten.Coordinates.TwoTwistLinear +import Mathlib.Algebra.CharP.Two + +namespace OAI + +noncomputable section +namespace ArExplicit.TriangleGradedSequence +open CategoryTheory CategoryTheory.Pretriangulated +universe u v w +variable (k : Type u) [Field k] [CharP k 2] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable [Limits.HasZeroObject C] [HasShift C ℤ] +variable [∀ n : ℤ, (CategoryTheory.shiftFunctor C n).Additive] [Pretriangulated C] +variable (T : Triangle C) (hT : T ∈ distTriang C) (X : C) +variable (em : Middle T X 0 ≃ₗ[k] k × k) (et : Top T X 0 ≃ₗ[k] k) +variable (c : k) (hc : c ≠ 0) +variable (hrow : ∀ m, et (second k T X 0 m) = c * ((em m).1 + (em m).2)) + +include hc hrow in +omit [CharP k 2] [Limits.HasZeroObject C] [Pretriangulated C] in +theorem second_zero_surjective : Function.Surjective (second k T X 0) := by + intro y + refine ⟨em.symm (c⁻¹ * et y, 0), et.injective ?_⟩ + rw [hrow, em.apply_symm_apply, add_zero, ← mul_assoc, mul_inv_cancel₀ hc, one_mul] + +include hT hc hrow in + +theorem first_zero_diagonal (x : Bottom T X 0) : + (em (first k T X 0 x)).1 = (em (first k T X 0 x)).2 := by + have hz : second k T X 0 (first k T X 0 x) = 0 := by + have hmem := LinearMap.mem_range_self (first k T X 0) x + rw [exact_middle k T X hT 0] at hmem + exact hmem + have h := hrow (first k T X 0 x) + rw [hz, map_zero] at h + exact CharTwo.add_eq_zero.mp ((mul_eq_zero.mp h.symm).resolve_left hc) + +def zeroDiagonalProjection : Bottom T X 0 →ₗ[k] diagonalSubmodule (k := k) (V := k) := + (em.toLinearMap.comp (first k T X 0)).codRestrict _ + (first_zero_diagonal k T hT X em et c hc hrow) + +variable [Subsingleton (Top T X (-1))] + +theorem zeroDiagonalProjection_bijective : + Function.Bijective (zeroDiagonalProjection k T hT X em et c hc hrow) := by + constructor + · intro x y h + apply first_zero_injective k T hT X + apply em.injective + exact congrArg Subtype.val h + · intro z + have hz : second k T X 0 (em.symm z.val) = 0 := by + apply et.injective + rw [hrow, em.apply_symm_apply, map_zero] + rw [CharTwo.add_eq_zero.mpr z.property, mul_zero] + have hm : em.symm z.val ∈ LinearMap.range (first k T X 0) := by + rw [exact_middle k T X hT 0] + exact hz + obtain ⟨x, hx⟩ := hm + refine ⟨x, Subtype.ext ?_⟩ + change em (first k T X 0 x) = z.val + rw [hx, em.apply_symm_apply] + +def zeroDiagonalEquiv : Bottom T X 0 ≃ₗ[k] diagonalSubmodule (k := k) (V := k) := + LinearEquiv.ofBijective (zeroDiagonalProjection k T hT X em et c hc hrow) + (zeroDiagonalProjection_bijective k T hT X em et c hc hrow) + +end ArExplicit.TriangleGradedSequence + +namespace ArExplicit +universe u +variable (k : Type u) [Field k] + +def scalarDiagonalEquiv : diagonalSubmodule (k := k) (V := k) ≃ₗ[k] k where + toFun z := z.val.1 + invFun a := ⟨(a,a), rfl⟩ + left_inv z := Subtype.ext (Prod.ext rfl z.property) + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberSequenceCoordinates.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberSequenceCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..863394d1d7134892db33ed7d8e830883b230642a --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiberSequenceCoordinates.lean @@ -0,0 +1,49 @@ +import OAI.Algebra.AuslanderReiten.Fibers.ConcreteFiberTriangle +import OAI.Algebra.AuslanderReiten.Fibers.FiberFullHomCoordinates +import OAI.Algebra.AuslanderReiten.Homology.TriangleConnectingProduct + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open CochainComplex.HomComplex +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H₁ H₂ : kˣ) + +theorem fiberSequenceFirst (n : ℤ) (v : FiberHom q H₁ H₂ n) : + TriangleGradedSequence.first k (fiberEvaluationTriangle q H₁ H₂) + (simpleHomotopyObject q) n v = fiberHomInclusion q H₁ H₂ n v := by + erw [TriangleGradedSequence.first_eq_shift, fiberEvaluationTriangle_first] + rfl + +theorem fiberRhoPair_eq_first (n : ℤ) (v : FiberHom q H₁ H₂ n) : + fiberHomRhoPair q H₁ H₂ n v = middleHomEquiv q H₁ H₂ n + (TriangleGradedSequence.first k (fiberEvaluationTriangle q H₁ H₂) + (simpleHomotopyObject q) n v) := by + rw [fiberSequenceFirst] + exact (middleHomEquiv_inclusion q H₁ H₂ n v).symm + +theorem fiberRhoPair_bijective_of_first (n : ℤ) + (hf : Function.Bijective (TriangleGradedSequence.first k + (fiberEvaluationTriangle q H₁ H₂) (simpleHomotopyObject q) n)) : + Function.Bijective (fiberHomRhoPair q H₁ H₂ n) := by + have hmap : (fiberHomRhoPair q H₁ H₂ n : FiberHom q H₁ H₂ n → _) = + (middleHomEquiv q H₁ H₂ n) ∘ + (TriangleGradedSequence.first k (fiberEvaluationTriangle q H₁ H₂) + (simpleHomotopyObject q) n) := funext (fiberRhoPair_eq_first q H₁ H₂ n) + rw [hmap] + exact (middleHomEquiv q H₁ H₂ n).bijective.comp hf + +theorem fiberFullRhoPair_bijective_of_rho (n : ℤ) + (hf : Function.Bijective (fiberHomRhoPair q H₁ H₂ n)) : + Function.Bijective (fiberFullRhoPair q H₁ H₂ n) := + ((simpleFullHomEquiv q n).symm.prodCongr (simpleFullHomEquiv q n).symm).bijective.comp + (hf.comp (fiberFullHomEquiv q H₁ H₂ n).bijective) + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteEvaluatedFiber.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteEvaluatedFiber.lean new file mode 100644 index 0000000000000000000000000000000000000000..71229d996270b2ca75502c6efc8ad6a70fad764f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteEvaluatedFiber.lean @@ -0,0 +1,115 @@ +import OAI.Algebra.AuslanderReiten.Modules.FiniteModuleEvaluation +import OAI.Algebra.AuslanderReiten.Fibers.FiniteFiberSides +import OAI.Algebra.AuslanderReiten.Stable.StableProjectiveSummand +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBalancedProduct + +namespace OAI + +noncomputable section +namespace ArExplicit.FiniteLeftModule +open CategoryTheory CategoryTheory.Pretriangulated +open scoped TensorProduct +universe u +variable {k S : Type u} [Field k] [Ring S] [Algebra k S] [Module.Finite k S] + +def pairModule (U V : FiniteLeftModule k S) : FiniteLeftModule k S where + carrier := ModuleCat.of S (U.carrier × V.carrier) + scalar := inferInstance + tower := inferInstance + finite := inferInstance + +variable (U V Y : FiniteLeftModule k S) + +def fiberReassociate : (fiberSource U V Y).carrier ≃ₗ[S] + ((pairModule U V).carrier × Y.canonicalFreeCover.carrier) where + toFun z := ((z.1, z.2.1), z.2.2) + invFun z := (z.1.1, z.1.2, z.2) + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + +def fiberPairProjection : (fiberSource U V Y).carrier →ₗ[S] (pairModule U V).carrier := + (LinearMap.fst S U.carrier (V.carrier × Y.canonicalFreeCover.carrier)).prod + ((LinearMap.fst S V.carrier Y.canonicalFreeCover.carrier).comp + (LinearMap.snd S U.carrier (V.carrier × Y.canonicalFreeCover.carrier))) + +def fiberPairStableIso : StableIsomorphism S (fiberSource U V Y).carrier (pairModule U V).carrier := by + letI := Y.canonicalFreeCover_projective + letI := Y.canonicalFreeCover_finite + exact (StableIsomorphism.ofLinearEquiv (fiberReassociate U V Y)).trans + (StableIsomorphism.dropRight (R := S)) + +@[simp] theorem fiberPairStableIso_hom : (fiberPairStableIso U V Y).hom = + StableHom.classOf S _ _ (fiberPairProjection U V Y) := by + change StableHom.comp (StableHom.classOf S _ _ (LinearMap.fst S _ _)) + (StableHom.classOf S _ _ (fiberReassociate U V Y).toLinearMap) = _ + rw [StableHom.comp_classOf] + rfl + +section Evaluation +variable {R : Type u} [Ring R] [Algebra k R] [Module.Finite k R] +variable (X : FiniteLeftModule k R) +variable (U₁ U₂ Y₀ : FiniteLeftModule k (R ⊗[k] Rᵐᵒᵖ)) + +def evaluatedPairEquiv : (evaluated X (pairModule U₁ U₂)).carrier ≃ₗ[R] + ((evaluated X U₁).carrier × (evaluated X U₂).carrier) := + EnvelopingBimodule.tensorProdEquiv U₁.carrier U₂.carrier X.carrier + +def middlePairMap : (evaluated X (fiberSource U₁ U₂ Y₀)).carrier →ₗ[R] + ((evaluated X U₁).carrier × (evaluated X U₂).carrier) := + (evaluatedPairEquiv X U₁ U₂).toLinearMap.comp + (evaluationMap X (fiberPairProjection U₁ U₂ Y₀)) + +def evaluatedMiddleStableIso : StableIsomorphism R + (evaluated X (fiberSource U₁ U₂ Y₀)).carrier + ((evaluated X U₁).carrier × (evaluated X U₂).carrier) := + (evaluationStableIso X (fiberPairStableIso U₁ U₂ Y₀)).trans + (StableIsomorphism.ofLinearEquiv (evaluatedPairEquiv X U₁ U₂)) + +@[simp] theorem evaluatedMiddleStableIso_hom : (evaluatedMiddleStableIso X U₁ U₂ Y₀).hom = + StableHom.classOf R _ _ (middlePairMap X U₁ U₂ Y₀) := by + change StableHom.comp (StableHom.classOf R _ _ (evaluatedPairEquiv X U₁ U₂).toLinearMap) + (EnvelopingBimodule.stableEvaluation X.carrier (fiberPairStableIso U₁ U₂ Y₀).hom) = _ + rw [fiberPairStableIso_hom, EnvelopingBimodule.stableEvaluation_classOf] + erw [StableHom.comp_classOf] + +variable (g₁ : U₁.carrier ⟶ Y₀.carrier) (g₂ : U₂.carrier ⟶ Y₀.carrier) + +theorem middlePairMap_fiberInclusion : + (middlePairMap X U₁ U₂ Y₀).comp + (evaluationMap X (fiberInclusion U₁ U₂ Y₀ g₁ g₂).hom) = + (evaluationMap X (fiberProjection₁ U₁ U₂ Y₀ g₁ g₂).hom).prod + (evaluationMap X (fiberProjection₂ U₁ U₂ Y₀ g₁ g₂).hom) := by + apply BalancedTensor.leftHom_ext (k := k) (R := R) + intro m x + rfl + +theorem fiberFunctionExact : Function.Exact + (fiberInclusion U₁ U₂ Y₀ g₁ g₂).hom (fiberMap U₁ U₂ Y₀ g₁ g₂).hom := by + intro x + constructor + · intro hx + exact ⟨⟨x, hx⟩, rfl⟩ + · rintro ⟨x, rfl⟩ + exact x.property + +variable [Module.Projective Rᵐᵒᵖ (EnvelopingBimodule k R Y₀.carrier)] + +def evaluatedFiberTriangle (τ : FrobeniusTrace k R) : + Triangle (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := + evaluationTriangle X (fiberInclusion U₁ U₂ Y₀ g₁ g₂).hom (fiberMap U₁ U₂ Y₀ g₁ g₂).hom + Subtype.val_injective (fiberMap_surjective U₁ U₂ Y₀ g₁ g₂) + (fiberFunctionExact U₁ U₂ Y₀ g₁ g₂) τ + + theorem evaluatedFiberTriangle_distinguished (τ : FrobeniusTrace k R) : + evaluatedFiberTriangle X U₁ U₂ Y₀ g₁ g₂ τ ∈ + distTriang (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := + evaluationTriangle_distinguished _ _ _ _ _ _ _ + +end Evaluation +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteFiberComponents.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteFiberComponents.lean new file mode 100644 index 0000000000000000000000000000000000000000..92b724cd89ce6e7ac5f2dab098ddddf21857ed61 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteFiberComponents.lean @@ -0,0 +1,74 @@ +import OAI.Algebra.AuslanderReiten.Fibers.FiniteEvaluatedFiber + +namespace OAI + +noncomputable section +namespace ArExplicit.FiniteLeftModule +open CategoryTheory +open scoped TensorProduct +universe u +variable {k S : Type u} [Field k] [Ring S] [Algebra k S] [Module.Finite k S] +variable (U V Y : FiniteLeftModule k S) + +def fiberSourceInl : U.carrier →ₗ[S] (fiberSource U V Y).carrier := + (LinearMap.id : U.carrier →ₗ[S] U.carrier).prod (0 : U.carrier →ₗ[S] V.carrier × Y.canonicalFreeCover.carrier) + +def fiberSourceInr : V.carrier →ₗ[S] (fiberSource U V Y).carrier := + (0 : V.carrier →ₗ[S] U.carrier).prod + ((LinearMap.id : V.carrier →ₗ[S] V.carrier).prod (0 : V.carrier →ₗ[S] Y.canonicalFreeCover.carrier)) + +theorem fiberMap_inl (g : U.carrier ⟶ Y.carrier) (h : V.carrier ⟶ Y.carrier) : + (fiberMap U V Y g h).hom.comp (fiberSourceInl U V Y) = g.hom := by + ext x + change g.hom x + (h.hom 0 + Y.canonicalFreeCoverMap.hom 0) = g.hom x + simp + +theorem fiberMap_inr (g : U.carrier ⟶ Y.carrier) (h : V.carrier ⟶ Y.carrier) : + (fiberMap U V Y g h).hom.comp (fiberSourceInr U V Y) = h.hom := by + ext x + change g.hom 0 + (h.hom x + Y.canonicalFreeCoverMap.hom 0) = h.hom x + simp + +section Evaluation +variable {R : Type u} [Ring R] [Algebra k R] [Module.Finite k R] +variable (X : FiniteLeftModule k R) +variable (U₁ U₂ Y₀ : FiniteLeftModule k (R ⊗[k] Rᵐᵒᵖ)) + +theorem middlePairMap_inl : + (middlePairMap X U₁ U₂ Y₀).comp + (evaluationMap X (fiberSourceInl U₁ U₂ Y₀)) = + LinearMap.inl R (evaluated X U₁).carrier (evaluated X U₂).carrier := by + apply BalancedTensor.leftHom_ext (k := k) + intro m x + change (BalancedTensor.tmul (k := k) (R := R) m x, + BalancedTensor.tmul (k := k) (R := R) (0 : EnvelopingBimodule k R U₂.carrier) x) = + (BalancedTensor.tmul (k := k) (R := R) m x, 0) + rw [BalancedTensor.zero_tmul] + +theorem middlePairMap_inr : + (middlePairMap X U₁ U₂ Y₀).comp + (evaluationMap X (fiberSourceInr U₁ U₂ Y₀)) = + LinearMap.inr R (evaluated X U₁).carrier (evaluated X U₂).carrier := by + apply BalancedTensor.leftHom_ext (k := k) + intro m x + change (BalancedTensor.tmul (k := k) (R := R) (0 : EnvelopingBimodule k R U₁.carrier) x, + BalancedTensor.tmul (k := k) (R := R) m x) = + (0, BalancedTensor.tmul (k := k) (R := R) m x) + rw [BalancedTensor.zero_tmul] + +theorem evaluatedFiberMap_inl (g : U₁.carrier ⟶ Y₀.carrier) (h : U₂.carrier ⟶ Y₀.carrier) : + (evaluationMap X (fiberMap U₁ U₂ Y₀ g h).hom).comp + (evaluationMap X (fiberSourceInl U₁ U₂ Y₀)) = evaluationMap X g.hom := by + rw [← evaluationMap_comp, fiberMap_inl] + +theorem evaluatedFiberMap_inr (g : U₁.carrier ⟶ Y₀.carrier) (h : U₂.carrier ⟶ Y₀.carrier) : + (evaluationMap X (fiberMap U₁ U₂ Y₀ g h).hom).comp + (evaluationMap X (fiberSourceInr U₁ U₂ Y₀)) = evaluationMap X h.hom := by + rw [← evaluationMap_comp, fiberMap_inr] + +end Evaluation +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteFiberSides.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteFiberSides.lean new file mode 100644 index 0000000000000000000000000000000000000000..fa1fc655c55db558fe177dfc02020f0e856668a1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteFiberSides.lean @@ -0,0 +1,99 @@ +import OAI.Algebra.AuslanderReiten.Fibers.FiniteModuleFiber +import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +import Mathlib.RingTheory.Finiteness.Prod + +namespace OAI + +noncomputable section + +namespace ArExplicit.FiniteLeftModule + +open CategoryTheory + +universe u + +variable {k R S : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable [Ring S] (j : S →+* R) +variable (U₁ U₂ Y : FiniteLeftModule k R) + +def fiberSourceSideEquiv : + ((ModuleCat.restrictScalars j).obj (fiberSource U₁ U₂ Y).carrier) ≃ₗ[S] + (((ModuleCat.restrictScalars j).obj U₁.carrier) × + ((ModuleCat.restrictScalars j).obj U₂.carrier) × + ((ModuleCat.restrictScalars j).obj Y.canonicalFreeCover.carrier)) where + toFun x := x + invFun x := x + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + +variable [Module.Finite S ((ModuleCat.restrictScalars j).obj (ModuleCat.of R R))] +variable [Module.Projective S ((ModuleCat.restrictScalars j).obj (ModuleCat.of R R))] + +theorem canonicalFreeCover_side : + Module.Finite S ((ModuleCat.restrictScalars j).obj Y.canonicalFreeCover.carrier) ∧ + Module.Projective S ((ModuleCat.restrictScalars j).obj Y.canonicalFreeCover.carrier) := by + let := canonicalFreeCover_finite Y + let := canonicalFreeCover_projective Y + exact ⟨restrict_finite j _, restrict_projective j _⟩ + +variable [Module.Finite S ((ModuleCat.restrictScalars j).obj U₁.carrier)] +variable [Module.Projective S ((ModuleCat.restrictScalars j).obj U₁.carrier)] +variable [Module.Finite S ((ModuleCat.restrictScalars j).obj U₂.carrier)] +variable [Module.Projective S ((ModuleCat.restrictScalars j).obj U₂.carrier)] + +theorem fiberSource_side : + Module.Finite S ((ModuleCat.restrictScalars j).obj (fiberSource U₁ U₂ Y).carrier) ∧ + Module.Projective S ((ModuleCat.restrictScalars j).obj (fiberSource U₁ U₂ Y).carrier) := by + obtain ⟨hfin, hproj⟩ := canonicalFreeCover_side j Y + let := hfin + let := hproj + exact ⟨Module.Finite.equiv (fiberSourceSideEquiv j U₁ U₂ Y).symm, + Module.Projective.of_equiv (fiberSourceSideEquiv j U₁ U₂ Y).symm⟩ + +theorem fiber_side [Module.Projective S ((ModuleCat.restrictScalars j).obj Y.carrier)] + (g₁ : U₁.carrier ⟶ Y.carrier) (g₂ : U₂.carrier ⟶ Y.carrier) : + Module.Finite S ((ModuleCat.restrictScalars j).obj (fiber U₁ U₂ Y g₁ g₂).carrier) ∧ + Module.Projective S ((ModuleCat.restrictScalars j).obj (fiber U₁ U₂ Y g₁ g₂).carrier) := by + obtain ⟨hfin, hproj⟩ := fiberSource_side j U₁ U₂ Y + let := hfin + let := hproj + exact ⟨kernel_restrict_finite j (fiberMap U₁ U₂ Y g₁ g₂) + (fiberMap_surjective U₁ U₂ Y g₁ g₂), + kernel_restrict_projective j (fiberMap U₁ U₂ Y g₁ g₂) + (fiberMap_surjective U₁ U₂ Y g₁ g₂)⟩ + +variable (g₁ : U₁.carrier ⟶ Y.carrier) (g₂ : U₂.carrier ⟶ Y.carrier) + +def fiberInclusion : (fiber U₁ U₂ Y g₁ g₂).carrier ⟶ (fiberSource U₁ U₂ Y).carrier := + ModuleCat.ofHom (LinearMap.ker (fiberMap U₁ U₂ Y g₁ g₂).hom).subtype + +def fiberProjection₁ : (fiber U₁ U₂ Y g₁ g₂).carrier ⟶ U₁.carrier := + fiberInclusion U₁ U₂ Y g₁ g₂ ≫ ModuleCat.ofHom (LinearMap.fst R _ _) + +def fiberProjection₂ : (fiber U₁ U₂ Y g₁ g₂).carrier ⟶ U₂.carrier := + fiberInclusion U₁ U₂ Y g₁ g₂ ≫ ModuleCat.ofHom + ((LinearMap.fst R _ _).comp (LinearMap.snd R _ _)) + +def fiberSequence : ShortComplex (ModuleCat.{u} R) := + ShortComplex.mk (fiberInclusion U₁ U₂ Y g₁ g₂) (fiberMap U₁ U₂ Y g₁ g₂) (by + ext x + exact x.property) + +theorem fiberSequence_shortExact : (fiberSequence U₁ U₂ Y g₁ g₂).ShortExact where + exact := (ShortComplex.ShortExact.moduleCat_exact_iff_function_exact _).mpr (by + intro x + constructor + · intro hx + exact ⟨⟨x, hx⟩, rfl⟩ + · rintro ⟨y, rfl⟩ + exact y.property) + mono_f := (ModuleCat.mono_iff_injective _).mpr Subtype.val_injective + epi_g := (ModuleCat.epi_iff_surjective _).mpr (fiberMap_surjective U₁ U₂ Y g₁ g₂) + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteModuleFiber.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteModuleFiber.lean new file mode 100644 index 0000000000000000000000000000000000000000..374eaf14c91f6f45a8fcd23ed90683826e4b5d8b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/FiniteModuleFiber.lean @@ -0,0 +1,96 @@ +import OAI.Algebra.AuslanderReiten.Stable.CanonicalCosyzygy +import Mathlib.LinearAlgebra.TensorProduct.Basis +import Mathlib.LinearAlgebra.FreeModule.Finite.Basic +import Mathlib.RingTheory.TensorProduct.Finite + +namespace OAI + +noncomputable section + +namespace ArExplicit.FiniteLeftModule + +open CategoryTheory +open scoped TensorProduct + +universe u + +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] + +def canonicalFreeCover (Y : FiniteLeftModule k R) : FiniteLeftModule k R where + carrier := ModuleCat.of R (R ⊗[k] Y.carrier) + scalar := inferInstance + tower := inferInstance + finite := inferInstanceAs (Module.Finite k (R ⊗[k] Y.carrier)) + +private def freeCoverMapScalar (Y : FiniteLeftModule k R) : R ⊗[k] Y.carrier →ₗ[k] Y.carrier := + TensorProduct.lift + { toFun := fun r => + { toFun := fun y => r • y + map_add' := smul_add r + map_smul' := fun a y => by + rw [← IsScalarTower.algebraMap_smul R a y, ← mul_smul, + ← Algebra.commutes, mul_smul, IsScalarTower.algebraMap_smul] + rfl } + map_add' := fun r s => by ext y; exact add_smul r s y + map_smul' := fun a r => by ext y; exact smul_assoc a r y } + +def canonicalFreeCoverMap (Y : FiniteLeftModule k R) : Y.canonicalFreeCover.carrier ⟶ Y.carrier := + ModuleCat.ofHom + { __ := (freeCoverMapScalar Y).toAddHom + map_smul' r z := by + change freeCoverMapScalar Y (r • z) = r • freeCoverMapScalar Y z + induction z using TensorProduct.inductionOn with + | add x y hx hy => simp [smul_add, hx, hy] + | tmul s y => exact mul_smul r s y } + +@[simp] theorem canonicalFreeCoverMap_tmul (Y : FiniteLeftModule k R) (r : R) (y : Y.carrier) : + Y.canonicalFreeCoverMap.hom (r ⊗ₜ[k] y) = r • y := rfl + +theorem canonicalFreeCoverMap_surjective (Y : FiniteLeftModule k R) : + Function.Surjective Y.canonicalFreeCoverMap.hom := by + intro y + exact ⟨1 ⊗ₜ[k] y, one_smul R y⟩ + +theorem canonicalFreeCover_finite (Y : FiniteLeftModule k R) : + Module.Finite R Y.canonicalFreeCover.carrier := + Module.Finite.of_basis ((Module.finBasis k Y.carrier).baseChange R) + +theorem canonicalFreeCover_projective (Y : FiniteLeftModule k R) : + Module.Projective R Y.canonicalFreeCover.carrier := by + change Module.Projective R (R ⊗[k] Y.carrier) + infer_instance + +variable (U₁ U₂ Y : FiniteLeftModule k R) + +def fiberSource : FiniteLeftModule k R where + carrier := ModuleCat.of R (U₁.carrier × U₂.carrier × Y.canonicalFreeCover.carrier) + scalar := inferInstance + tower := inferInstance + finite := inferInstance + +def fiberMap (g₁ : U₁.carrier ⟶ Y.carrier) (g₂ : U₂.carrier ⟶ Y.carrier) : + (fiberSource U₁ U₂ Y).carrier ⟶ Y.carrier := + ModuleCat.ofHom (g₁.hom.coprod (g₂.hom.coprod Y.canonicalFreeCoverMap.hom)) + +theorem fiberMap_surjective (g₁ : U₁.carrier ⟶ Y.carrier) (g₂ : U₂.carrier ⟶ Y.carrier) : + Function.Surjective (fiberMap U₁ U₂ Y g₁ g₂).hom := by + intro y + obtain ⟨z, hz⟩ := canonicalFreeCoverMap_surjective Y y + refine ⟨(0, 0, z), ?_⟩ + change g₁.hom 0 + (g₂.hom 0 + Y.canonicalFreeCoverMap.hom z) = y + simpa using hz + +def fiber (g₁ : U₁.carrier ⟶ Y.carrier) (g₂ : U₂.carrier ⟶ Y.carrier) : FiniteLeftModule k R where + carrier := kernelObject (fiberMap U₁ U₂ Y g₁ g₂) + scalar := inferInstanceAs (Module k (LinearMap.ker (fiberMap U₁ U₂ Y g₁ g₂).hom)) + tower := inferInstanceAs (IsScalarTower k R (LinearMap.ker (fiberMap U₁ U₂ Y g₁ g₂).hom)) + finite := by + change Module.Finite k (LinearMap.ker (fiberMap U₁ U₂ Y g₁ g₂).hom) + exact Module.Finite.of_injective + (((LinearMap.ker (fiberMap U₁ U₂ Y g₁ g₂).hom).subtype).restrictScalars k) Subtype.val_injective + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Fibers/TensorFiberCoordinateIso.lean b/lean/OAI/Algebra/AuslanderReiten/Fibers/TensorFiberCoordinateIso.lean new file mode 100644 index 0000000000000000000000000000000000000000..f392b3a7d47e012b1eddaad031aa8f596ade5c9e --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Fibers/TensorFiberCoordinateIso.lean @@ -0,0 +1,28 @@ +import OAI.Algebra.AuslanderReiten.Evaluation.ConcreteTensorFiber + +namespace OAI + +noncomputable section +open CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.T +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H₁ H₂ : kˣ) + +def tensorFiberRhoEquiv (n : ℤ) (h : Function.Bijective (fiberFullRhoPair q H₁ H₂ n)) : + CohomologyClass (A.simpleComplete q) (tensorFiberComplete q H₁ H₂) n ≃ₗ[k] + (CohomologyClass (A.simpleComplete q) (A.simpleComplete q) n × + CohomologyClass (A.simpleComplete q) (A.simpleComplete q) n) := + (tensorFiberFullEquiv q H₁ H₂ n).trans + (LinearEquiv.ofBijective (fiberFullRhoPair q H₁ H₂ n) h) + +theorem tensorFiberRhoEquiv_apply (n : ℤ) + (h : Function.Bijective (fiberFullRhoPair q H₁ H₂ n)) + (x : CohomologyClass (A.simpleComplete q) (tensorFiberComplete q H₁ H₂) n) : + tensorFiberRhoEquiv q H₁ H₂ n h x = tensorFiberRhoPair q H₁ H₂ n x := rfl + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FiniteFullHomExt.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FiniteFullHomExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..acb9e98b8043ef2d45056bf22c0d13333551df7c --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FiniteFullHomExt.lean @@ -0,0 +1,45 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FiniteFullHomZero +import OAI.Algebra.AuslanderReiten.HomComplex.PositiveFullHomProducts +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomDegreeProducts +import OAI.Algebra.AuslanderReiten.Ext.ExtIsoCongr + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.FiniteLeftModule +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] [CharP k 2] +variable [HasDerivedCategory (ModuleCat.{u} R)] +open CompleteComparison +variable (τ : FrobeniusTrace k R) (M : FiniteLeftModule k R) + +def fullPositiveModuleExtEquiv (n : ℕ) : + CohomologyClass (M.completeCochain τ) (M.completeCochain τ) ((n+1:ℕ):ℤ) ≃ₗ[k] + Ext M.carrier M.carrier (n+1) := + (fullPositiveExtEquiv (k := k) _ _ (M.completeCochain_totallyAcyclic τ).to_chain + (M.completeCochain_totallyAcyclic τ).to_chain.toExactProjectiveComplex n).trans + (selfExtIso (k := k) (M.fullCokernelEquiv τ).toModuleIso (n+1)) + +theorem fullPositiveModuleExtEquiv_product (n m : ℕ) + (x : CohomologyClass (M.completeCochain τ) (M.completeCochain τ) ((n+1:ℕ):ℤ)) + (y : CohomologyClass (M.completeCochain τ) (M.completeCochain τ) ((m+1:ℕ):ℤ)) : + fullPositiveModuleExtEquiv τ M (n+1+m) + (TateKoszul.degreeEquiv (k := k) (CohomologyClass (M.completeCochain τ) (M.completeCochain τ)) + (show ((n+1:ℕ):ℤ)+((m+1:ℕ):ℤ)=((n+1+m+1:ℕ):ℤ) by omega) (fullHomProduct x y)) = + (fullPositiveModuleExtEquiv τ M n x).comp (fullPositiveModuleExtEquiv τ M m y) (by omega) := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + obtain ⟨y,rfl⟩ := CohomologyClass.mk_surjective y + rw [fullHomProduct_degree_mk _ x y (ResolutionProducts.natCocycleProduct x y) rfl] + change selfExtIso _ _ (fullPositiveExtEquiv _ _ _ _ _ _) = + (selfExtIso _ _ (fullPositiveExtEquiv _ _ _ _ _ _)).comp + (selfExtIso _ _ (fullPositiveExtEquiv _ _ _ _ _ _)) _ + rw [← selfExtIso_comp, fullPositiveExtEquiv_product] + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FiniteFullHomZero.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FiniteFullHomZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..d748d22af660be5abbc7c863a7f77e8a8477e7a1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FiniteFullHomZero.lean @@ -0,0 +1,107 @@ +import OAI.Algebra.AuslanderReiten.Stable.SourceStableCoordinates +import OAI.Algebra.AuslanderReiten.Modules.FiniteModuleTriangle + +namespace OAI + +noncomputable section +open CategoryTheory HomologicalComplex +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [CharP k 2] + +namespace CompleteComparison +variable {K L : CochainComplex (ModuleCat.{u} R) ℤ} + +include k in +theorem sourceCocycleMap_ofHom (f : K ⟶ L) : + sourceCocycleMap (Cocycle.ofHom f) = cokernelMap (extendMap f negIndexEmbedding) 0 := by + apply LinearMap.ext + intro z + obtain ⟨x, rfl⟩ := (LinearMap.range ((chainOfCochain K).d 1 0).hom).mkQ_surjective z + change sourceCocycleMap (Cocycle.ofHom f) (Submodule.Quotient.mk x) = _ + rw [sourceCocycleMap_mk (k := k)] + change Submodule.Quotient.mk ((sourceCocycleComponent (Cocycle.ofHom f)).hom x) = + Submodule.Quotient.mk (((extendMap f negIndexEmbedding).f 0).hom x) + congr 2 + unfold sourceCocycleComponent + rw [extendMap_f f negIndexEmbedding (show negIndexEmbedding.f 0 = 0 from rfl)] + rfl + +end CompleteComparison + +namespace FiniteLeftModule +open CompleteComparison +variable [Module.Finite k R] (τ : FrobeniusTrace k R) (M N : FiniteLeftModule k R) + +def fullCokernelEquiv : Cokernel (chainOfCochain (M.completeCochain τ)) 0 ≃ₗ[R] M.carrier := + (cochainCokernelLinearEquiv _).trans (M.completeCochainCokernelEquiv τ) + +def fullHomZeroEquiv : CohomologyClass (M.completeCochain τ) (N.completeCochain τ) 0 ≃ₗ[k] + StableHom R M.carrier N.carrier := + (fullHomSourceStableLinearEquiv _ _ 0 (M.completeCochain_totallyAcyclic τ).to_chain + (N.completeCochain_totallyAcyclic τ).to_chain.toExactProjectiveComplex).trans + ((StableHom.sourceEquiv (k := k) (M.fullCokernelEquiv τ).symm).trans + (StableHom.targetEquiv (k := k) (N.fullCokernelEquiv τ))) + +theorem fullHomZeroEquiv_ofHom (f : M.completeCochain τ ⟶ N.completeCochain τ) : + fullHomZeroEquiv τ M N (CohomologyClass.mk (Cocycle.ofHom f)) = + StableHom.classOf R _ _ ((N.completeCochainCokernelEquiv τ).toLinearMap.comp + ((cochainCokernelMap f).comp (M.completeCochainCokernelEquiv τ).symm.toLinearMap)) := by + change StableHom.targetEquiv (k := k) (N.fullCokernelEquiv τ) + (StableHom.sourceEquiv (k := k) (M.fullCokernelEquiv τ).symm + (fullHomSourceStableLinearEquiv _ _ 0 + (M.completeCochain_totallyAcyclic τ).to_chain + (N.completeCochain_totallyAcyclic τ).to_chain.toExactProjectiveComplex + (CohomologyClass.mk (Cocycle.ofHom f)))) = _ + rw [fullHomSourceStableLinearEquiv_mk, sourceCocycleMap_ofHom (k := k), + StableHom.sourceEquiv_classOf, StableHom.targetEquiv_classOf] + congr 1 + apply LinearMap.ext + intro x + have h := DFunLike.congr_fun (cochainCokernelLinearEquiv_natural f) + ((M.fullCokernelEquiv τ).symm x) + change (cochainCokernelLinearEquiv _) (cokernelMap (extendMap f negIndexEmbedding) 0 + ((M.fullCokernelEquiv τ).symm x)) = cochainCokernelMap f + ((cochainCokernelLinearEquiv _) ((M.fullCokernelEquiv τ).symm x)) at h + change (N.completeCochainCokernelEquiv τ) + ((cochainCokernelLinearEquiv _) (cokernelMap (extendMap f negIndexEmbedding) 0 + ((M.fullCokernelEquiv τ).symm x))) = _ + rw [h] + simp only [fullCokernelEquiv, LinearEquiv.trans_symm, LinearEquiv.trans_apply, + LinearEquiv.apply_symm_apply, LinearMap.comp_apply, LinearEquiv.coe_coe] + +@[simp] +theorem fullHomZeroEquiv_lift (f : M.carrier →ₗ[R] N.carrier) : + fullHomZeroEquiv τ M N (CohomologyClass.mk (Cocycle.ofHom (resolutionMap τ f))) = + StableHom.classOf R _ _ f := by + rw [fullHomZeroEquiv_ofHom, resolutionMap_cokernel] + congr 1 + ext x + simp [resolutionCokernelMap] + +@[simp] +theorem fullHomZeroEquiv_identity : + fullHomZeroEquiv τ M M (CohomologyClass.mk (Cocycle.ofHom (𝟙 (M.completeCochain τ)))) = + StableHom.identity := by + rw [fullHomZeroEquiv_ofHom] + change StableHom.classOf R _ _ _ = StableHom.classOf R _ _ LinearMap.id + congr 1 + ext x + change (M.completeCochainCokernelEquiv τ) + (cochainCokernelMap (𝟙 _) ((M.completeCochainCokernelEquiv τ).symm x)) = x + have hid : cochainCokernelMap (𝟙 (M.completeCochain τ)) = LinearMap.id := by + apply LinearMap.ext + intro z + obtain ⟨y, rfl⟩ := (LinearMap.range ((M.completeCochain τ).d (-1) 0).hom).mkQ_surjective z + rfl + rw [hid] + exact LinearEquiv.apply_symm_apply _ _ + +end FiniteLeftModule +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullCochainProducts.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullCochainProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..d178938744897153542f088560e228a8224826d9 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullCochainProducts.lean @@ -0,0 +1,79 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullCochainTail + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.CompleteComparison +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [CharP k 2] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (K : CochainComplex (ModuleCat.{u} R) ℤ) +variable (hK : TotallyAcyclicComplex (chainOfCochain K)) + +private theorem tailPrefix_congr {r : ℤ} (x : Cochain K K r) (p q : ℤ) + (a b : ℕ) (hab : a=b) (ha : -(a : ℤ)=p) (hb : -(b : ℤ)=p) + (hxa : -(a : ℤ)+r=q) (hxb : -(b : ℤ)+r=q) : + ((completeExtResolution hK).cochainComplexXIso p a ha).hom ≫ + (tailTermIso K a).hom ≫ x.v (-(a : ℤ)) q hxa = + ((completeExtResolution hK).cochainComplexXIso p b hb).hom ≫ + (tailTermIso K b).hom ≫ x.v (-(b : ℤ)) q hxb := by + subst b + rfl + +theorem restrictedCocycle_product {r s : ℕ} + (x : Cocycle K K (r : ℤ)) (y : Cocycle K K (s : ℤ)) : + restrictedCocycle (k := k) K K hK hK.toExactProjectiveComplex (r+s) + (ResolutionProducts.natCocycleProduct x y) = + ResolutionProducts.natCocycleProduct + (restrictedCocycle (k := k) K K hK hK.toExactProjectiveComplex r x) + (restrictedCocycle (k := k) K K hK hK.toExactProjectiveComplex s y) := by + change ↥(cocycle K K (r : ℤ)) at x + change ↥(cocycle K K (s : ℤ)) at y + apply Subtype.ext + apply Cochain.ext + intro p q hpq + by_cases hq : q ≤ 0 + · obtain ⟨n,rfl⟩ := Int.exists_eq_neg_ofNat hq + change (ResolutionProducts.natComparisonCochain _ _ (r+s) _).v _ _ _ = _ + erw [ResolutionProducts.natComparisonCochain_v_of_eq] + erw [Cochain.comp_v _ _ _ _ (-((s+n : ℕ) : ℤ)) _ (by omega) (by omega)] + change _ = + (ResolutionProducts.natComparisonCochain _ _ r _).v _ _ _ ≫ + (ResolutionProducts.natComparisonCochain _ _ s _).v _ _ _ + erw [ResolutionProducts.natComparisonCochain_v_of_eq, + ResolutionProducts.natComparisonCochain_v_of_eq] + simp only [cochainTailMap, ResolutionProducts.natCocycleProduct, + Cocycle.mk] + try simp only [Nat.add_assoc] + erw [Cochain.comp_v _ _ _ _ (-((s+n : ℕ) : ℤ)) _ (by omega) (by omega)] + all_goals try omega + let P := completeExtResolution hK + let a := P.cochainComplexXIso p (r+(s+n)) (by omega) + let b : P.complex.X (r+(s+n)) ≅ K.X (-((r+(s+n) : ℕ) : ℤ)) := tailTermIso K (r+(s+n)) + let c : P.complex.X (s+n) ≅ K.X (-((s+n : ℕ) : ℤ)) := tailTermIso K (s+n) + let d := P.cochainComplexXIso (-((s+n : ℕ) : ℤ)) (s+n) rfl + let e : P.complex.X n ≅ K.X (-(n : ℤ)) := tailTermIso K n + let f := P.cochainComplexXIso (-(n : ℤ)) n rfl + let xv := x.val.v (-((r+(s+n) : ℕ) : ℤ)) (-((s+n : ℕ) : ℤ)) (by omega) + let yv := y.val.v (-((s+n : ℕ) : ℤ)) (-(n : ℤ)) (by omega) + have hh : a.hom ≫ (b.hom ≫ xv ≫ yv ≫ e.inv) ≫ f.inv = + a.hom ≫ ((b.hom ≫ xv ≫ c.inv) ≫ d.inv) ≫ d.hom ≫ + (c.hom ≫ yv ≫ e.inv) ≫ f.inv := by + simp only [Category.assoc, Iso.inv_hom_id_assoc] + convert! hh using 1 + dsimp only [a, b, c, d, e, f, xv, yv, P] + have he := tailPrefix_congr K hK x.val p (-((s+n : ℕ) : ℤ)) + (r+s+n) (r+(s+n)) (by omega) (by omega) (by omega) (by omega) (by omega) + have hh' := congrArg (fun z => (z ≫ yv ≫ e.inv) ≫ f.inv) he + exact hh' + + · exact ((completeExtResolution hK).cochainComplex.isZero_of_isStrictlyLE 0 q + (by omega)).eq_of_tgt _ _ + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullCochainTail.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullCochainTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..a4a03d72f93b7185c7b6cf0a1ae13a45acb899b0 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullCochainTail.lean @@ -0,0 +1,73 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.NatResolutionCochain +import OAI.Algebra.AuslanderReiten.HomComplex.PositiveFullHomExt +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionProductCompatibility + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.CompleteComparison +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [CharP k 2] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (K L : CochainComplex (ModuleCat.{u} R) ℤ) + +def tailTermIso (n : ℕ) : + (nonnegativeTail (chainOfCochain K)).X n ≅ K.X (-(n : ℤ)) := + K.extendXIso negIndexEmbedding (by change -(-(n : ℤ))=(n : ℤ); omega) + +theorem tailTerm_d (i j : ℕ) (h : j+1=i) : + (nonnegativeTail (chainOfCochain K)).d i j = + (tailTermIso K i).hom ≫ K.d (-(i : ℤ)) (-(j : ℤ)) ≫ (tailTermIso K j).inv := by + subst i + rw [nonnegativeTail_d] + exact K.extend_d_eq negIndexEmbedding + (show negIndexEmbedding.f (-((j+1 : ℕ) : ℤ))=((j+1 : ℕ) : ℤ) by + change -(-((j+1 : ℕ) : ℤ))=((j+1 : ℕ) : ℤ); omega) + (show negIndexEmbedding.f (-(j : ℤ))=(j : ℤ) by change -(-(j : ℤ))=(j : ℤ); omega) + +def cochainTailMap (r : ℕ) (x : Cochain K L (r : ℤ)) (n : ℕ) : + (nonnegativeTail (chainOfCochain K)).X (r+n) ⟶ + (nonnegativeTail (chainOfCochain L)).X n := + (tailTermIso K (r+n)).hom ≫ x.v (-((r+n : ℕ) : ℤ)) (-(n : ℤ)) (by omega) ≫ + (tailTermIso L n).inv + +include k in +theorem cochainTailMap_comm (r : ℕ) (x : Cocycle K L (r : ℤ)) (n : ℕ) : + cochainTailMap K L r x.val (n+1) ≫ (nonnegativeTail (chainOfCochain L)).d (n+1) n = + (nonnegativeTail (chainOfCochain K)).d (r+(n+1)) (r+n) ≫ cochainTailMap K L r x.val n := by + let i : ℤ := -((r+(n+1) : ℕ) : ℤ) + let j : ℤ := -(n : ℤ) + have hx := congrArg (fun z : Cochain K L ((r : ℤ)+1) => z.v i j (by dsimp [i,j]; omega)) + (show δ (r : ℤ) ((r : ℤ)+1) x.val=0 by simp) + rw [δ_v _ _ rfl _ _ _ (by dsimp [i,j]; omega) + (-((n+1 : ℕ) : ℤ)) (-((r+n : ℕ) : ℤ)) (by dsimp [i,j]; omega) (by dsimp [i,j]; omega), + ResolutionProducts.intUnit_smul_charTwo (k := k), Cochain.zero_v] at hx + let a := x.val.v i (-((n+1 : ℕ) : ℤ)) (by dsimp [i]; omega) ≫ + L.d (-((n+1 : ℕ) : ℤ)) j + let b := K.d i (-((r+n : ℕ) : ℤ)) ≫ + x.val.v (-((r+n : ℕ) : ℤ)) j (by dsimp [j]; omega) + have hab : a=b := by + have hb : b+b=0 := by + rw [← two_smul k b, show (2 : k)=0 from CharP.cast_eq_zero k 2, zero_smul] + exact (eq_neg_of_add_eq_zero_left hx).trans (eq_neg_iff_add_eq_zero.mpr hb).symm + rw [tailTerm_d L _ _ rfl, tailTerm_d K _ _ (by omega)] + simp only [cochainTailMap, Category.assoc, Iso.inv_hom_id_assoc] + exact congrArg (fun z => (tailTermIso K (r+(n+1))).hom ≫ z ≫ (tailTermIso L n).inv) hab + +variable (hK : TotallyAcyclicComplex (chainOfCochain K)) +variable (hL : ExactProjectiveComplex (chainOfCochain L)) + +def restrictedCocycle (r : ℕ) (x : Cocycle K L (r : ℤ)) : + Cocycle (completeExtResolution hK).cochainComplex + (completeCokernelResolution (chainOfCochain L) hL.projective hL.exactAt).cochainComplex (r : ℤ) := + ResolutionProducts.natComparisonCocycle (k := k) (completeExtResolution hK) + (completeCokernelResolution (chainOfCochain L) hL.projective hL.exactAt) r + (cochainTailMap K L r x.val) (cochainTailMap_comm (k := k) K L r x) + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomAugmentedExt.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomAugmentedExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..e0bd203bfc645df5d8b9a02f96f2bf59d53fccad --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomAugmentedExt.lean @@ -0,0 +1,30 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.PositiveFullHomProducts + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.CompleteComparison +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [CharP k 2] +variable [HasDerivedCategory (ModuleCat.{u} R)] +variable (K : CochainComplex (ModuleCat.{u} R) ℤ) +variable (hK : TotallyAcyclicComplex (chainOfCochain K)) + +theorem fullPositiveExtEquiv_augmented (n : ℕ) (x : Cocycle K K ((n+1 : ℕ) : ℤ)) : + fullPositiveExtEquiv (k := k) K K hK hK.toExactProjectiveComplex n (CohomologyClass.mk x) = + (completeExtResolution hK).extMk + (ResolutionProducts.natComparisonAugmentation (completeExtResolution hK) (n+1) + (cochainTailMap K K (n+1) x.val)) (n+2) rfl + (ResolutionProducts.natComparison_augmented_cycle (completeExtResolution hK) (n+1) + (cochainTailMap K K (n+1) x.val) (cochainTailMap_comm (k := k) K K (n+1) x)) := by + rw [fullPositiveExtEquiv_mk] + exact ResolutionProducts.natComparison_endExt_eq (completeExtResolution hK) (n+1) + (cochainTailMap K K (n+1) x.val) (cochainTailMap_comm (k := k) K K (n+1) x) + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomComparison.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..417e436d3c1c5591bc56c658cd381b65118e888b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomComparison.lean @@ -0,0 +1,57 @@ +import OAI.Algebra.AuslanderReiten.Complete.CompleteStableComparison +import Mathlib.Algebra.Homology.Embedding.ExtendHomotopy +import Mathlib.Algebra.Homology.HomotopyCategory.HomComplexCohomology + +namespace OAI + +open CategoryTheory + +namespace ArExplicit.CompleteComparison + +universe u + +variable {R : Type u} [Ring R] + +def negIndexEmbedding : (ComplexShape.up ℤ).Embedding (ComplexShape.down ℤ) := + ComplexShape.Embedding.mk' _ _ (fun i : ℤ => -i) neg_injective (by + intro i j + change i + 1 = j ↔ -j + 1 = -i + omega) + +instance : negIndexEmbedding.IsRelIff := by + dsimp [negIndexEmbedding] + infer_instance + +noncomputable abbrev chainOfCochain (K : CochainComplex (ModuleCat.{u} R) ℤ) := + K.extend negIndexEmbedding + +private instance negIndexFunctor_additive : + (negIndexEmbedding.extendHomotopyFunctor (ModuleCat.{u} R)).Additive := by + have := Functor.additive_of_iso + (negIndexEmbedding.extendHomotopyFunctorFactors (ModuleCat.{u} R)).symm + exact Functor.additive_of_full_essSurj_comp + (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.up ℤ)) _ + +noncomputable def fullHomStableEquiv + (K L : CochainComplex (ModuleCat.{u} R) ℤ) (n : ℤ) + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain (L⟦n⟧))) : + CochainComplex.HomComplex.CohomologyClass K L n ≃+ + StableHom R (Cokernel (chainOfCochain K) 0) (Cokernel (chainOfCochain (L⟦n⟧)) 0) := + CochainComplex.HomComplex.CohomologyClass.homAddEquiv.trans + ((AddEquiv.ofBijective + (Functor.mapAddHom (negIndexEmbedding.extendHomotopyFunctor (ModuleCat.{u} R))) + ⟨Functor.map_injective _, Functor.map_surjective _⟩).trans + (homotopyCokernelEquiv hK hL)) + +theorem fullHomStableEquiv_eq_zero_iff + (K L : CochainComplex (ModuleCat.{u} R) ℤ) (n : ℤ) + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain (L⟦n⟧))) + (x : CochainComplex.HomComplex.CohomologyClass K L n) : + fullHomStableEquiv K L n hK hL x = 0 ↔ x = 0 := + map_eq_zero_iff (fullHomStableEquiv K L n hK hL) (fullHomStableEquiv K L n hK hL).injective + +end ArExplicit.CompleteComparison + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomComposition.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomComposition.lean new file mode 100644 index 0000000000000000000000000000000000000000..6a3cd106a7c38652a2f9f4fc318b5975b1781744 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomComposition.lean @@ -0,0 +1,53 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProducts + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory +open CochainComplex CochainComplex.HomComplex + +variable {C : Type*} [Category* C] [Preadditive C] +variable {F G K : CochainComplex C ℤ} (φ : F ⟶ G) (n : ℤ) + +def fullHomPrecompCocycle : Cocycle G K n →+ Cocycle F K n where + toFun x := x.precomp φ + map_zero' := by apply Cocycle.ext; simp + map_add' x y := by apply Cocycle.ext; simp + +def fullHomPostcompCocycle : Cocycle K F n →+ Cocycle K G n where + toFun x := x.postcomp φ + map_zero' := by apply Cocycle.ext; simp + map_add' x y := by apply Cocycle.ext; simp + +def fullHomPrecomp : CohomologyClass G K n →+ CohomologyClass F K n := + CohomologyClass.descAddMonoidHom + ((CohomologyClass.mkAddMonoidHom _ _ _).comp (fullHomPrecompCocycle φ n)) (by + intro x hx + apply (CohomologyClass.mk_eq_zero_iff _).mpr + obtain ⟨m, hm, y, hy⟩ := hx + refine ⟨m, hm, (Cochain.ofHom φ).comp y (zero_add m), ?_⟩ + simpa [fullHomPrecompCocycle] using congrArg (fun z => (Cochain.ofHom φ).comp z (zero_add n)) hy) + +def fullHomPostcomp : CohomologyClass K F n →+ CohomologyClass K G n := + CohomologyClass.descAddMonoidHom + ((CohomologyClass.mkAddMonoidHom _ _ _).comp (fullHomPostcompCocycle φ n)) (by + intro x hx + apply (CohomologyClass.mk_eq_zero_iff _).mpr + obtain ⟨m, hm, y, hy⟩ := hx + refine ⟨m, hm, y.comp (Cochain.ofHom φ) (add_zero m), ?_⟩ + simpa [fullHomPostcompCocycle] using congrArg (fun z => z.comp (Cochain.ofHom φ) (add_zero n)) hy) + +@[simp] theorem fullHomPrecomp_mk (x : Cocycle G K n) : + fullHomPrecomp φ n (CohomologyClass.mk x) = CohomologyClass.mk (x.precomp φ) := rfl + +@[simp] theorem fullHomPostcomp_mk (x : Cocycle K F n) : + fullHomPostcomp φ n (CohomologyClass.mk x) = CohomologyClass.mk (x.postcomp φ) := rfl + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomCompositionLinear.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomCompositionLinear.lean new file mode 100644 index 0000000000000000000000000000000000000000..719724d9cfc728eeea45e695d2524f99120b7585 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomCompositionLinear.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomMapLinear + +namespace OAI + +noncomputable section +open CategoryTheory CochainComplex.HomComplex +namespace ArExplicit +universe u v w +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable {K L M : CochainComplex C ℤ} (n : ℤ) + +def fullHomPostcompLinear (f : L ⟶ M) : CohomologyClass K L n →ₗ[k] CohomologyClass K M n where + __ := fullHomPostcomp f n + map_smul' a x := by + change fullHomPostcomp f n (a • x) = a • fullHomPostcomp f n x + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + rw [← CompleteComparison.fullHom_mk_smul, fullHomPostcomp_mk, fullHomPostcomp_mk, + ← CompleteComparison.fullHom_mk_smul] + congr 1 + apply Subtype.ext + exact Cochain.smul_comp a x.val (Cochain.ofHom f) (add_zero n) + +def fullHomPrecompLinear (f : K ⟶ L) : CohomologyClass L M n →ₗ[k] CohomologyClass K M n where + __ := fullHomPrecomp f n + map_smul' a x := by + change fullHomPrecomp f n (a • x) = a • fullHomPrecomp f n x + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + rw [← CompleteComparison.fullHom_mk_smul, fullHomPrecomp_mk, fullHomPrecomp_mk, + ← CompleteComparison.fullHom_mk_smul] + congr 1 + apply Subtype.ext + exact Cochain.comp_smul (Cochain.ofHom f) a x.val (zero_add n) + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomCompositionSquare.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomCompositionSquare.lean new file mode 100644 index 0000000000000000000000000000000000000000..92ccdd9281e0e732be06028268b6b0ef2e9b0490 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomCompositionSquare.lean @@ -0,0 +1,28 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomHomotopyMaps + +namespace OAI + +noncomputable section +open CategoryTheory CochainComplex.HomComplex +namespace ArExplicit +universe u v w +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable {K L M N P : CochainComplex C ℤ} +variable {a : L ⟶ M} {b : M ⟶ N} {c : L ⟶ P} {d : P ⟶ N} +include k + +theorem fullHomPostcomp_square (n : ℤ) + (h : (HomotopyCategory.quotient C _).map (a ≫ b) = + (HomotopyCategory.quotient C _).map (c ≫ d)) + (x : CohomologyClass K L n) : + fullHomPostcomp b n (fullHomPostcomp a n x) = + fullHomPostcomp d n (fullHomPostcomp c n x) := by + rw [fullHomPostcomp_comp, fullHomPostcomp_comp] + exact fullHomPostcomp_congr k n h x + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomDegreeProducts.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomDegreeProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..34460a2197ed8341745ca8e249afbe03d4be47c8 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomDegreeProducts.lean @@ -0,0 +1,47 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProductLinear +import OAI.Algebra.AuslanderReiten.Complete.TateKoszul +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionProductCompatibility + +namespace OAI + +noncomputable section +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.CompleteComparison +universe u v +variable {k : Type u} [Field k] +variable {C : Type v} [Category.{u} C] [Preadditive C] [Linear k C] +variable {K L M : CochainComplex C ℤ} {n m l : ℤ} + +theorem fullHomProduct_degree_mk (h : n+m=l) + (x : Cocycle K L n) (y : Cocycle L M m) (z : Cocycle K M l) + (hz : z.val=x.val.comp y.val h) : + TateKoszul.degreeEquiv (k := k) (CohomologyClass K M) h + (fullHomProduct (CohomologyClass.mk x) (CohomologyClass.mk y)) = CohomologyClass.mk z := by + subst l + change CohomologyClass.mk (cocycleProduct x y) = CohomologyClass.mk z + congr 1 + exact Subtype.ext hz.symm + +def fullHomIdentity (K : CochainComplex C ℤ) : CohomologyClass K K 0 := + CohomologyClass.mk (Cocycle.ofHom (𝟙 K)) + +theorem fullHomProduct_identity_right (x : CohomologyClass K L n) : + TateKoszul.degreeEquiv (k := k) (CohomologyClass K L) (add_zero n) + (fullHomProduct x (fullHomIdentity L)) = x := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + apply fullHomProduct_degree_mk + exact (Cochain.comp_id x.val).symm + +theorem fullHomProduct_identity_left (x : CohomologyClass K L n) : + TateKoszul.degreeEquiv (k := k) (CohomologyClass K L) (zero_add n) + (fullHomProduct (fullHomIdentity K) x) = x := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + apply fullHomProduct_degree_mk + exact (Cochain.id_comp x.val).symm + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomDuality.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomDuality.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e2e91d42bd50bab83db1eec2146b663954416f4 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomDuality.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.Stable.SourceStableShift +import OAI.Algebra.AuslanderReiten.Duality.ProjectiveStablePairing + +namespace OAI + +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra + +namespace ArExplicit.FrobeniusTrace + +universe u + +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (τ : FrobeniusTrace k R) +variable (hs : ∀ a b : R, τ.trace (a * b) = τ.trace (b * a)) + +open CompleteComparison + +noncomputable def fullHomSymmetricDuality + (K : CochainComplex (ModuleCat.{u} R) ℤ) + (hK : TotallyAcyclicComplex (chainOfCochain K)) (a : ℤ) : + Module.Dual k (CohomologyClass K K a) ≃ₗ[k] CohomologyClass K K (-a - 1) := by + let E := fullHomStableLinearEquiv (k := k) K K a hK + (hK.toExactProjectiveComplex.cochainShift a) + let D := τ.completeStableDuality hs (chainOfCochain K) hK.toExactProjectiveComplex + (N := Cokernel (chainOfCochain (K⟦a⟧)) 0) + let B := StableHom.targetEquiv (k := k) + (M := Cokernel (chainOfCochain (K⟦a⟧)) 0) + (shiftedCokernelEquiv K (-1) 1 rfl).symm + let C := fullHomStableZeroLinearEquiv (k := k) (K⟦a⟧) (K⟦(-1 : ℤ)⟧) + (hK.cochainShift a) (hK.toExactProjectiveComplex.cochainShift (-1)) + let L := leftShiftCohomologyEquiv k K (K⟦(-1 : ℤ)⟧) (-a) a 0 (by omega) + let T := rightShiftCohomologyEquiv k K K (-a - 1) (-1) (-a) (by omega) + exact E.symm.dualMap.trans (D.trans (B.trans (C.symm.trans (L.symm.trans T.symm)))) + +end ArExplicit.FrobeniusTrace + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomExt.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..d7de691f0fd66f2e75fe8964fd8b8c0217dd699f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomExt.lean @@ -0,0 +1,49 @@ +import OAI.Algebra.AuslanderReiten.Stable.StableExt +import OAI.Algebra.AuslanderReiten.Stable.SourceStableShift + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory CompleteComparison +open CochainComplex CochainComplex.HomComplex + +universe u + +variable {k R : Type u} [CommRing k] [Ring R] [Algebra k R] +variable {K L : CochainComplex (ModuleCat.{u} R) ℤ} + +include k + +theorem positiveExtVanish_of_fullHom + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain L)) + (h : ∀ n : ℕ, 0 < n → Subsingleton (CohomologyClass K L (n : ℤ))) : + PositiveExtVanish R (Cokernel (chainOfCochain K) 0) (Cokernel (chainOfCochain L) 0) := by + apply positiveExtVanish_of_stableCokernels hK + intro n + let := h (n + 1) (Nat.zero_lt_succ n) + exact (fullHomSourceStableLinearEquiv (k := k) K L ((n + 1 : ℕ) : ℤ) hK hL).symm.injective.subsingleton + +theorem not_projective_of_fullHom_nontrivial + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (h : Nontrivial (CohomologyClass K K 0)) : + ¬ Module.Projective R (Cokernel (chainOfCochain K) 0) := by + intro hp + let := hK.finite 0 + let := hp + have : Subsingleton (StableHom R (Cokernel (chainOfCochain K) 0) + (Cokernel (chainOfCochain K) 0)) := ⟨fun a b => + (StableHom.eq_zero_of_projective_source a).trans (StableHom.eq_zero_of_projective_source b).symm⟩ + have : Subsingleton (CohomologyClass K K 0) := + (fullHomStableZeroLinearEquiv (k := k) K K hK hK.toExactProjectiveComplex).injective.subsingleton + obtain ⟨a, b, hab⟩ := h.exists_pair_ne + exact hab (Subsingleton.elim a b) + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomFunctor.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f79748649c4568e5859db74750c24dd095bbade --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomFunctor.lean @@ -0,0 +1,123 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProducts + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory +open CochainComplex CochainComplex.HomComplex + +variable {C D : Type*} [Category* C] [Category* D] [Preadditive C] [Preadditive D] +variable (Φ : C ⥤ D) [Φ.Additive] [Φ.Full] [Φ.Faithful] +variable (K L : CochainComplex C ℤ) (n : ℤ) + +def fullHomCochainEquiv : Cochain K L n ≃+ + Cochain ((Φ.mapHomologicalComplex _).obj K) ((Φ.mapHomologicalComplex _).obj L) n where + toFun x := x.map Φ + invFun y := Cochain.mk fun p q hpq => Φ.preimage (y.v p q hpq) + left_inv x := by + apply Cochain.ext + intro p q hpq + exact Φ.preimage_map _ + right_inv y := by + apply Cochain.ext + intro p q hpq + exact Φ.map_preimage _ + map_add' := fun x y => Cochain.map_add x y Φ + +theorem fullHomCochainEquiv_differential (m : ℤ) (x : Cochain K L n) : + δ n m (fullHomCochainEquiv Φ K L n x) = fullHomCochainEquiv Φ K L m (δ n m x) := + δ_map n m x Φ + +def fullHomCocycleMap : Cocycle K L n →+ + Cocycle ((Φ.mapHomologicalComplex _).obj K) ((Φ.mapHomologicalComplex _).obj L) n where + toFun x := Cocycle.mk (x.1.map Φ) (n + 1) rfl (by + rw [δ_map, Cocycle.δ_eq_zero, Cochain.map_zero]) + map_zero' := by apply Cocycle.ext; exact Cochain.map_zero K L n Φ + map_add' x y := by apply Cocycle.ext; exact Cochain.map_add x.1 y.1 Φ + +theorem fullHomCocycleMap_bijective : Function.Bijective (fullHomCocycleMap Φ K L n) := by + constructor + · intro x y h + apply Cocycle.ext + apply (fullHomCochainEquiv Φ K L n).injective + exact congrArg Subtype.val h + · intro y + let x := (fullHomCochainEquiv Φ K L n).symm y.1 + have hx : δ n (n + 1) x = 0 := by + apply (fullHomCochainEquiv Φ K L (n + 1)).injective + rw [← fullHomCochainEquiv_differential, map_zero] + change δ n (n + 1) (fullHomCochainEquiv Φ K L n + ((fullHomCochainEquiv Φ K L n).symm y.1)) = 0 + rw [AddEquiv.apply_symm_apply, Cocycle.δ_eq_zero] + refine ⟨Cocycle.mk x (n + 1) rfl hx, ?_⟩ + apply Cocycle.ext + exact (fullHomCochainEquiv Φ K L n).apply_symm_apply y.1 + +theorem fullHomCocycleMap_boundary (x : Cocycle K L n) : + fullHomCocycleMap Φ K L n x ∈ + coboundaries ((Φ.mapHomologicalComplex _).obj K) ((Φ.mapHomologicalComplex _).obj L) n ↔ + x ∈ coboundaries K L n := by + rw [mem_coboundaries_iff _ (n - 1) (by omega), mem_coboundaries_iff _ (n - 1) (by omega)] + constructor + · rintro ⟨y, hy⟩ + refine ⟨(fullHomCochainEquiv Φ K L (n - 1)).symm y, ?_⟩ + apply (fullHomCochainEquiv Φ K L n).injective + rw [← fullHomCochainEquiv_differential, AddEquiv.apply_symm_apply] + exact hy + · rintro ⟨y, hy⟩ + refine ⟨y.map Φ, ?_⟩ + rw [δ_map, hy] + rfl + +def fullHomCohomologyMap : CohomologyClass K L n →+ + CohomologyClass ((Φ.mapHomologicalComplex _).obj K) ((Φ.mapHomologicalComplex _).obj L) n := + CohomologyClass.descAddMonoidHom + ((CohomologyClass.mkAddMonoidHom _ _ _).comp (fullHomCocycleMap Φ K L n)) (by + intro x hx + exact (CohomologyClass.mk_eq_zero_iff _).mpr + ((fullHomCocycleMap_boundary Φ K L n x).mpr hx)) + +@[simp] theorem fullHomCohomologyMap_mk (x : Cocycle K L n) : + fullHomCohomologyMap Φ K L n (CohomologyClass.mk x) = + CohomologyClass.mk (fullHomCocycleMap Φ K L n x) := rfl + +theorem fullHomCohomologyMap_bijective : Function.Bijective (fullHomCohomologyMap Φ K L n) := by + constructor + · apply (injective_iff_map_eq_zero _).mpr + intro x hx + obtain ⟨y, rfl⟩ := CohomologyClass.mk_surjective x + exact (CohomologyClass.mk_eq_zero_iff y).mpr + ((fullHomCocycleMap_boundary Φ K L n y).mp + ((CohomologyClass.mk_eq_zero_iff _).mp hx)) + · intro y + obtain ⟨y, rfl⟩ := CohomologyClass.mk_surjective y + obtain ⟨x, rfl⟩ := (fullHomCocycleMap_bijective Φ K L n).surjective y + exact ⟨CohomologyClass.mk x, rfl⟩ + +def fullHomCohomologyEquiv : CohomologyClass K L n ≃+ + CohomologyClass ((Φ.mapHomologicalComplex _).obj K) ((Φ.mapHomologicalComplex _).obj L) n := + AddEquiv.ofBijective (fullHomCohomologyMap Φ K L n) (fullHomCohomologyMap_bijective Φ K L n) + +variable {K L n} + +theorem fullHomCohomologyMap_product {M : CochainComplex C ℤ} {m : ℤ} + (x : CohomologyClass K L n) (y : CohomologyClass L M m) : + fullHomCohomologyMap Φ K M (n + m) (CompleteComparison.fullHomProduct x y) = + CompleteComparison.fullHomProduct (fullHomCohomologyMap Φ K L n x) + (fullHomCohomologyMap Φ L M m y) := by + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + obtain ⟨y, rfl⟩ := CohomologyClass.mk_surjective y + simp only [CompleteComparison.fullHomProduct_mk, fullHomCohomologyMap_mk] + congr 1 + apply Cocycle.ext + apply Cochain.map_comp + rfl + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomHomotopyMaps.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomHomotopyMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..0723c352c1cd78fe22f9f9fb8a0403ce1324965d --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomHomotopyMaps.lean @@ -0,0 +1,60 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomShiftedMaps +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomNaturality + +namespace OAI + +noncomputable section +open CategoryTheory CochainComplex.HomComplex +namespace ArExplicit +universe u v w +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable {K L M : CochainComplex C ℤ} (n : ℤ) +include k + +theorem fullHomPostcomp_congr {f g : L ⟶ M} + (h : (HomotopyCategory.quotient C _).map f = (HomotopyCategory.quotient C _).map g) + (x : CohomologyClass K L n) : fullHomPostcomp f n x = fullHomPostcomp g n x := by + apply (fullHomShiftedHomotopyEquiv k K M n).injective + rw [fullHomShiftedHomotopyEquiv_postcomp, fullHomShiftedHomotopyEquiv_postcomp, h] + +theorem fullHomPrecomp_congr {f g : K ⟶ L} + (h : (HomotopyCategory.quotient C _).map f = (HomotopyCategory.quotient C _).map g) + (x : CohomologyClass L M n) : fullHomPrecomp f n x = fullHomPrecomp g n x := by + apply (fullHomShiftedHomotopyEquiv k K M n).injective + rw [fullHomShiftedHomotopyEquiv_precomp, fullHomShiftedHomotopyEquiv_precomp, h] + +theorem fullHomPostcomp_id (x : CohomologyClass K L n) : + fullHomPostcomp (𝟙 L) n x = x := by + apply (fullHomShiftedHomotopyEquiv k K L n).injective + rw [fullHomShiftedHomotopyEquiv_postcomp, CategoryTheory.Functor.map_id, + CategoryTheory.Functor.map_id, Category.comp_id] + +theorem fullHomPrecomp_id (x : CohomologyClass K L n) : + fullHomPrecomp (𝟙 K) n x = x := by + apply (fullHomShiftedHomotopyEquiv k K L n).injective + rw [fullHomShiftedHomotopyEquiv_precomp, CategoryTheory.Functor.map_id, Category.id_comp] + +theorem fullHomPostcomp_homotopy_inverse (f : L ⟶ M) (g : M ⟶ L) + (h : (HomotopyCategory.quotient C _).map (f ≫ g) = 𝟙 _) + (x : CohomologyClass K L n) : fullHomPostcomp g n (fullHomPostcomp f n x) = x := by + rw [fullHomPostcomp_comp] + rw [fullHomPostcomp_congr k n (h.trans (CategoryTheory.Functor.map_id _ _).symm), + fullHomPostcomp_id k n] + +theorem fullHomPostcomp_bijective (f : L ⟶ M) (g : M ⟶ L) + (hfg : (HomotopyCategory.quotient C _).map (f ≫ g) = 𝟙 _) + (hgf : (HomotopyCategory.quotient C _).map (g ≫ f) = 𝟙 _) : + Function.Bijective (fullHomPostcomp (K := K) f n) := by + constructor + · intro x y h + have hh := congrArg (fullHomPostcomp g n) h + simpa only [fullHomPostcomp_homotopy_inverse k n f g hfg] using hh + · intro x + exact ⟨fullHomPostcomp g n x, fullHomPostcomp_homotopy_inverse k n g f hgf x⟩ + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomLinear.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomLinear.lean new file mode 100644 index 0000000000000000000000000000000000000000..d181360d499fff4de2f95fdbe0e0ec86fad3b6a4 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomLinear.lean @@ -0,0 +1,90 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProducts +import Mathlib.Algebra.Homology.Linear + +namespace OAI + +open CategoryTheory +open CochainComplex CochainComplex.HomComplex + +namespace ArExplicit.CompleteComparison + +universe u v + +section Cochains + +variable (k : Type u) [CommRing k] +variable {C : Type*} [Category* C] [Preadditive C] [Linear k C] +variable (K L : CochainComplex C ℤ) (n : ℤ) + +def fullHomCoboundaries : Submodule k (Cocycle K L n) where + __ := coboundaries K L n + smul_mem' a x hx := by + obtain ⟨m, hm, y, hy⟩ := hx + refine ⟨m, hm, a • y, ?_⟩ + rw [δ_smul, hy] + rfl + +instance fullHomModule : Module k (CohomologyClass K L n) := + inferInstanceAs (Module k ((Cocycle K L n) ⧸ fullHomCoboundaries k K L n)) + +variable {K L n} + +@[simp] +theorem fullHom_mk_smul (a : k) (x : Cocycle K L n) : + CohomologyClass.mk (a • x) = a • CohomologyClass.mk x := rfl + +theorem cocycleHom_smul (a : k) (x : Cocycle K L n) : + Cocycle.equivHomShift.symm (a • x) = a • Cocycle.equivHomShift.symm x := by + apply HomologicalComplex.Hom.ext + funext i + simp only [cocycleHom_component, HomologicalComplex.smul_f_apply, + Cocycle.coe_smul, Cochain.smul_v] + +end Cochains + +variable {k R : Type u} [CommRing k] [Ring R] [Algebra k R] +open scoped ModuleCat.Algebra + +variable {P Q : ChainComplex (ModuleCat.{u} R) ℤ} + +theorem cokernelMap_smul (a : k) (F : P ⟶ Q) (n : ℤ) : + cokernelMap (a • F) n = a • cokernelMap F n := by + apply LinearMap.ext + intro z + obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective (LinearMap.range (P.d (n + 1) n).hom) z + change (LinearMap.range (Q.d (n + 1) n).hom).mkQ (a • (F.f n).hom x) = + a • (LinearMap.range (Q.d (n + 1) n).hom).mkQ ((F.f n).hom x) + exact ((LinearMap.range (Q.d (n + 1) n).hom).mkQ.restrictScalars k).map_smul a _ + +variable {K L : CochainComplex (ModuleCat.{u} R) ℤ} {n : ℤ} + +theorem cocycleComparisonMap_smul (a : k) (x : Cocycle K L n) : + cocycleComparisonMap (a • x) = a • cocycleComparisonMap x := by + unfold cocycleComparisonMap + rw [cocycleHom_smul] + apply HomologicalComplex.Hom.ext + funext i + have hi : negIndexEmbedding.f (-i) = i := neg_neg i + simp only [HomologicalComplex.extendMap_f _ _ hi, + HomologicalComplex.smul_f_apply, Linear.comp_smul, Linear.smul_comp] + +theorem fullHomStableEquiv_smul (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain (L⟦n⟧))) + (a : k) (x : CohomologyClass K L n) : + fullHomStableEquiv K L n hK hL (a • x) = a • fullHomStableEquiv K L n hK hL x := by + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + rw [← fullHom_mk_smul, fullHomStableEquiv_mk, fullHomStableEquiv_mk, + cocycleComparisonMap_smul, cokernelMap_smul, StableHom.classOf_smul] + +noncomputable def fullHomStableLinearEquiv + (K L : CochainComplex (ModuleCat.{u} R) ℤ) (n : ℤ) + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain (L⟦n⟧))) : + CohomologyClass K L n ≃ₗ[k] + StableHom R (Cokernel (chainOfCochain K) 0) (Cokernel (chainOfCochain (L⟦n⟧)) 0) := + { fullHomStableEquiv K L n hK hL with + map_smul' := fullHomStableEquiv_smul hK hL } + +end ArExplicit.CompleteComparison + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomMap.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd608c1be36d70b7f35d5cab7a8ec50f119fbe6f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomMap.lean @@ -0,0 +1,49 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomFunctor + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory CochainComplex.HomComplex +variable {C D : Type*} [Category* C] [Category* D] [Preadditive C] [Preadditive D] +variable (Φ : C ⥤ D) [Φ.Additive] +variable (K L : CochainComplex C ℤ) (n : ℤ) + +def mapFullHom : CohomologyClass K L n →+ + CohomologyClass ((Φ.mapHomologicalComplex _).obj K) + ((Φ.mapHomologicalComplex _).obj L) n := + CohomologyClass.descAddMonoidHom + ((CohomologyClass.mkAddMonoidHom _ _ _).comp (fullHomCocycleMap Φ K L n)) (by + intro x hx + apply (CohomologyClass.mk_eq_zero_iff _).mpr + obtain ⟨m, hm, y, hy⟩ := hx + refine ⟨m, hm, y.map Φ, ?_⟩ + rw [δ_map, hy] + rfl) + +@[simp] theorem mapFullHom_mk (x : Cocycle K L n) : + mapFullHom Φ K L n (CohomologyClass.mk x) = + CohomologyClass.mk (fullHomCocycleMap Φ K L n x) := rfl + +theorem mapFullHom_eq [Φ.Full] [Φ.Faithful] : + mapFullHom Φ K L n = fullHomCohomologyMap Φ K L n := rfl + +variable {K L n} +theorem mapFullHom_product {M : CochainComplex C ℤ} {m : ℤ} + (x : CohomologyClass K L n) (y : CohomologyClass L M m) : + mapFullHom Φ K M (n+m) (CompleteComparison.fullHomProduct x y) = + CompleteComparison.fullHomProduct (mapFullHom Φ K L n x) + (mapFullHom Φ L M m y) := by + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + obtain ⟨y, rfl⟩ := CohomologyClass.mk_surjective y + simp only [CompleteComparison.fullHomProduct_mk, mapFullHom_mk] + congr 1 + apply Cocycle.ext + apply Cochain.map_comp + rfl + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomMapLinear.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomMapLinear.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e90f294506968e14ea7ac18bd401769951fdf68 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomMapLinear.lean @@ -0,0 +1,85 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomMap +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProductLinear +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomComposition + +namespace OAI + +noncomputable section +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit +variable {k : Type*} [CommRing k] +variable {C D : Type*} [Category* C] [Category* D] [Preadditive C] [Preadditive D] + [Linear k C] [Linear k D] +variable (Φ : C ⥤ D) [Φ.Additive] [Φ.Linear k] +variable (K L : CochainComplex C ℤ) (n : ℤ) + +theorem mapFullHom_smul (a : k) (x : CohomologyClass K L n) : + mapFullHom Φ K L n (a • x) = a • mapFullHom Φ K L n x := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + rw [← CompleteComparison.fullHom_mk_smul, mapFullHom_mk, mapFullHom_mk, + ← CompleteComparison.fullHom_mk_smul] + congr 1 + apply Subtype.ext + apply Cochain.ext + intro p q hpq + exact Φ.map_smul a (x.val.v p q hpq) + +def mapFullHomLinear : CohomologyClass K L n →ₗ[k] + CohomologyClass ((Φ.mapHomologicalComplex _).obj K) + ((Φ.mapHomologicalComplex _).obj L) n where + __ := mapFullHom Φ K L n + map_smul' := mapFullHom_smul Φ K L n + +theorem mapFullHom_identity : + mapFullHom Φ K K 0 (CohomologyClass.mk (Cocycle.ofHom (𝟙 K))) = + CohomologyClass.mk (Cocycle.ofHom (𝟙 ((Φ.mapHomologicalComplex _).obj K))) := by + rw [mapFullHom_mk] + congr 1 + apply Subtype.ext + change (Cochain.ofHom (𝟙 K)).map Φ = + Cochain.ofHom (𝟙 ((Φ.mapHomologicalComplex _).obj K)) + rw [Cochain.map_ofHom, CategoryTheory.Functor.map_id] + +variable {K L n} +theorem fullHomPostcomp_smul (f : K ⟶ L) (n : ℤ) (a : k) + (x : CohomologyClass K K n) : + fullHomPostcomp f n (a • x) = a • fullHomPostcomp f n x := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + rw [← CompleteComparison.fullHom_mk_smul, fullHomPostcomp_mk, fullHomPostcomp_mk, + ← CompleteComparison.fullHom_mk_smul] + congr 1 + apply Subtype.ext + exact Cochain.smul_comp a x.val (Cochain.ofHom f) (add_zero n) + +theorem fullHomPrecomp_smul (f : K ⟶ L) (n : ℤ) (a : k) + (x : CohomologyClass L L n) : + fullHomPrecomp f n (a • x) = a • fullHomPrecomp f n x := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + rw [← CompleteComparison.fullHom_mk_smul, fullHomPrecomp_mk, fullHomPrecomp_mk, + ← CompleteComparison.fullHom_mk_smul] + congr 1 + apply Subtype.ext + exact Cochain.comp_smul (Cochain.ofHom f) a x.val (zero_add n) + +theorem fullHomPostcomp_identity (f : K ⟶ L) : + fullHomPostcomp f 0 (CohomologyClass.mk (Cocycle.ofHom (𝟙 K))) = + CohomologyClass.mk (Cocycle.ofHom f) := by + rw [fullHomPostcomp_mk] + congr 1 + apply Subtype.ext + exact Cochain.id_comp _ + +theorem fullHomPrecomp_identity (f : K ⟶ L) : + fullHomPrecomp f 0 (CohomologyClass.mk (Cocycle.ofHom (𝟙 L))) = + CohomologyClass.mk (Cocycle.ofHom f) := by + rw [fullHomPrecomp_mk] + congr 1 + apply Subtype.ext + exact Cochain.comp_id _ + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomNaturality.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f80bec1035a663e70ed7ec98eb56ee282160dfe --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomNaturality.lean @@ -0,0 +1,86 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomMap +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomComposition + +namespace OAI + +noncomputable section +open CategoryTheory CochainComplex CochainComplex.HomComplex +namespace ArExplicit +variable {C D : Type*} [Category* C] [Category* D] [Preadditive C] [Preadditive D] +variable {Φ Ψ : C ⥤ D} [Φ.Additive] [Ψ.Additive] +variable {K L : CochainComplex C ℤ} {n : ℤ} + +theorem mapFullHom_naturality (η : Φ ⟶ Ψ) (x : CohomologyClass K L n) : + fullHomPostcomp ((η.mapHomologicalComplex _).app L) n (mapFullHom Φ K L n x) = + fullHomPrecomp ((η.mapHomologicalComplex _).app K) n (mapFullHom Ψ K L n x) := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + rw [mapFullHom_mk, mapFullHom_mk, fullHomPostcomp_mk, fullHomPrecomp_mk] + congr 1 + apply Cocycle.ext + apply Cochain.ext + intro i j hij + change ((x.val.map Φ).comp (Cochain.ofHom ((η.mapHomologicalComplex _).app L)) + (add_zero n)).v i j hij = + ((Cochain.ofHom ((η.mapHomologicalComplex _).app K)).comp (x.val.map Ψ) + (zero_add n)).v i j hij + rw [Cochain.comp_v _ _ (add_zero n) i j j hij (add_zero j), + Cochain.comp_v _ _ (zero_add n) i i j (add_zero i) hij] + simp only [Cochain.map_v, Cochain.ofHom_v, NatTrans.mapHomologicalComplex_app_f] + exact η.naturality (x.val.v i j hij) + +variable {F G H I : CochainComplex C ℤ} + +theorem fullHomPostcomp_comp (f : F ⟶ G) (g : G ⟶ H) (x : CohomologyClass I F n) : + fullHomPostcomp g n (fullHomPostcomp f n x) = fullHomPostcomp (f ≫ g) n x := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + simp only [fullHomPostcomp_mk] + congr 1 + apply Cocycle.ext + apply Cochain.ext + intro i j hij + change ((x.val.comp (Cochain.ofHom f) (add_zero n)).comp (Cochain.ofHom g) + (add_zero n)).v i j hij = (x.val.comp (Cochain.ofHom (f ≫ g)) (add_zero n)).v i j hij + rw [Cochain.comp_v _ _ (add_zero n) i j j hij (add_zero j), + Cochain.comp_v _ _ (add_zero n) i j j hij (add_zero j), + Cochain.comp_v _ _ (add_zero n) i j j hij (add_zero j)] + simp only [Cochain.ofHom_v, HomologicalComplex.comp_f, Category.assoc] + +theorem fullHomPostcomp_precomp (f : F ⟶ G) (g : H ⟶ I) (x : CohomologyClass G H n) : + fullHomPostcomp g n (fullHomPrecomp f n x) = + fullHomPrecomp f n (fullHomPostcomp g n x) := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + simp only [fullHomPostcomp_mk, fullHomPrecomp_mk] + congr 1 + apply Cocycle.ext + apply Cochain.ext + intro i j hij + change (((Cochain.ofHom f).comp x.val (zero_add n)).comp (Cochain.ofHom g) + (add_zero n)).v i j hij = + ((Cochain.ofHom f).comp (x.val.comp (Cochain.ofHom g) (add_zero n)) + (zero_add n)).v i j hij + rw [Cochain.comp_v _ _ (add_zero n) i j j hij (add_zero j), + Cochain.comp_v _ _ (zero_add n) i i j (add_zero i) hij, + Cochain.comp_v _ _ (zero_add n) i i j (add_zero i) hij, + Cochain.comp_v _ _ (add_zero n) i j j hij (add_zero j)] + simp only [Cochain.ofHom_v, Category.assoc] + +theorem fullHomPrecomp_comp (f : F ⟶ G) (g : G ⟶ H) (x : CohomologyClass H I n) : + fullHomPrecomp f n (fullHomPrecomp g n x) = fullHomPrecomp (f ≫ g) n x := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + simp only [fullHomPrecomp_mk] + congr 1 + apply Cocycle.ext + apply Cochain.ext + intro i j hij + change ((Cochain.ofHom f).comp ((Cochain.ofHom g).comp x.val (zero_add n)) + (zero_add n)).v i j hij = ((Cochain.ofHom (f ≫ g)).comp x.val (zero_add n)).v i j hij + rw [Cochain.comp_v _ _ (zero_add n) i i j (add_zero i) hij, + Cochain.comp_v _ _ (zero_add n) i i j (add_zero i) hij, + Cochain.comp_v _ _ (zero_add n) i i j (add_zero i) hij] + simp only [Cochain.ofHom_v, HomologicalComplex.comp_f, Category.assoc] + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomPairing.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomPairing.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3c3366d8e39dec2962c6ac9a9c7ffa227f0d04c --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomPairing.lean @@ -0,0 +1,83 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomDuality + +namespace OAI + +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra + +namespace ArExplicit.FrobeniusTrace + +universe u + +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (τ : FrobeniusTrace k R) +variable (hs : ∀ a b : R, τ.trace (a * b) = τ.trace (b * a)) +variable {N N' : Type u} +variable [AddCommGroup N] [Module R N] [Module k N] [IsScalarTower k R N] +variable [SMulCommClass R k N] +variable [AddCommGroup N'] [Module R N'] [Module k N'] [IsScalarTower k R N'] +variable [SMulCommClass R k N'] + +open CompleteComparison + +theorem completeStableDuality_natural + (P : ChainComplex (ModuleCat.{u} R) ℤ) (hP : ExactProjectiveComplex P) + (u : N →ₗ[R] N') (f : StableHom R (Cokernel P 0) N) + (g : StableHom R N' (Cokernel P 1)) : + ((τ.completeStableDuality hs P hP).symm g) (StableHom.postcomp u f) = + ((τ.completeStableDuality hs P hP).symm (StableHom.precomp u g)) f := by + let : ∀ i, Module.Finite R (P.X i) := hP.finite + let : ∀ i, Module.Projective R (P.X i) := hP.projective + let E := cokernelSyzygyEquiv hP 0 + change ((τ.projectiveStableDuality hs (P.d 1 0).hom (P.d 0 (-1)).hom + (differential_comp P 1 0 (-1)) (hP.exactAt 0)).symm + (StableHom.postcomp E.toLinearMap g)) (StableHom.postcomp u f) = + ((τ.projectiveStableDuality hs (P.d 1 0).hom (P.d 0 (-1)).hom + (differential_comp P 1 0 (-1)) (hP.exactAt 0)).symm + (StableHom.postcomp E.toLinearMap (StableHom.precomp u g))) f + rw [τ.projectiveStableDuality_natural] + congr 2 + obtain ⟨g, rfl⟩ := StableHom.classOf_surjective g + rfl + +noncomputable def fullHomTracePairing + (K : CochainComplex (ModuleCat.{u} R) ℤ) + (hK : TotallyAcyclicComplex (chainOfCochain K)) (n : ℤ) : + StableHom R (Cokernel (chainOfCochain (K⟦n⟧)) 0) (Cokernel (chainOfCochain K) 1) + ≃ₗ[k] Module.Dual k (CohomologyClass K K n) := + (τ.completeStableDuality hs (chainOfCochain K) hK.toExactProjectiveComplex).symm.trans + (fullHomStableLinearEquiv (k := k) K K n hK + (hK.toExactProjectiveComplex.cochainShift n)).dualMap + +theorem fullHomTracePairing_product + (K : CochainComplex (ModuleCat.{u} R) ℤ) + (hK : TotallyAcyclicComplex (chainOfCochain K)) {n m : ℤ} + (x : Cocycle K K n) (y : Cocycle K K m) + (g : StableHom R (Cokernel (chainOfCochain (K⟦n + m⟧)) 0) + (Cokernel (chainOfCochain K) 1)) : + (τ.fullHomTracePairing hs K hK (n + m) g) (CohomologyClass.mk (cocycleProduct x y)) = + (τ.fullHomTracePairing hs K hK n + (StableHom.precomp + (cokernelMap (HomologicalComplex.extendMap (shiftedCocycleHom y n) negIndexEmbedding) 0) + g)) (CohomologyClass.mk x) := by + change ((τ.completeStableDuality hs (chainOfCochain K) hK.toExactProjectiveComplex).symm g) + (fullHomStableEquiv K K (n + m) hK (hK.toExactProjectiveComplex.cochainShift (n + m)) + (CohomologyClass.mk (cocycleProduct x y))) = _ + rw [fullHomStableEquiv_product hK (hK.toExactProjectiveComplex.cochainShift n) + (hK.toExactProjectiveComplex.cochainShift (n + m))] + let u := cokernelMap + (HomologicalComplex.extendMap (shiftedCocycleHom y n) negIndexEmbedding) 0 + have hc (z : StableHom R (Cokernel (chainOfCochain K) 0) + (Cokernel (chainOfCochain (K⟦n⟧)) 0)) : + StableHom.comp (StableHom.classOf R _ _ u) z = StableHom.postcomp u z := by + obtain ⟨z, rfl⟩ := StableHom.classOf_surjective z + rw [StableHom.comp_classOf, StableHom.postcomp_classOf] + rw [hc] + exact τ.completeStableDuality_natural hs (chainOfCochain K) hK.toExactProjectiveComplex u + (fullHomStableEquiv K K n hK (hK.toExactProjectiveComplex.cochainShift n) + (CohomologyClass.mk x)) g + +end ArExplicit.FrobeniusTrace + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomPlainZero.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomPlainZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c9ab141a8e8325c63bd291d8519cf47937700d8 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomPlainZero.lean @@ -0,0 +1,41 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomZeroRepresentative + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory +open CochainComplex CochainComplex.HomComplex CompleteComparison +universe u v w +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable (K L : CochainComplex C ℤ) + +def fullHomPlainZeroEquiv : CohomologyClass K L 0 ≃ₗ[k] + ((HomotopyCategory.quotient C _).obj K ⟶ (HomotopyCategory.quotient C _).obj L) := + (fullHomShiftedHomotopyEquiv k K L 0).trans + (Linear.homCongr k (Iso.refl _) + ((shiftFunctorZero (HomotopyCategory C (ComplexShape.up ℤ)) ℤ).app _)) + +theorem fullHomPlainZeroEquiv_mk (f : K ⟶ L) : + fullHomPlainZeroEquiv k K L (CohomologyClass.mk (Cocycle.ofHom f)) = + (HomotopyCategory.quotient C _).map f := by + simp only [fullHomPlainZeroEquiv, LinearEquiv.trans_apply, Linear.homCongr_apply, + Iso.refl_inv, Category.id_comp] + change fullHomShiftedHomotopyEquiv k K L 0 + (CohomologyClass.mk (Cocycle.ofHom f)) ≫ + (shiftFunctorZero (HomotopyCategory C (ComplexShape.up ℤ)) ℤ).hom.app _ = _ + rw [← fullHomPrecomp_identity f, fullHomShiftedHomotopyEquiv_precomp] + change (_ ≫ fullHomShiftedHomotopyEquiv k L L 0 (fullHomIdentity L)) ≫ _ = _ + erw [fullHomShiftedHomotopyEquiv_identity, Category.assoc, Iso.inv_hom_id_app, + Category.comp_id] + +theorem fullHomPlainZeroEquiv_identity : + fullHomPlainZeroEquiv k K K (fullHomIdentity K) = 𝟙 _ := by + rw [fullHomIdentity, fullHomPlainZeroEquiv_mk, CategoryTheory.Functor.map_id] + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProductCoordinate.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProductCoordinate.lean new file mode 100644 index 0000000000000000000000000000000000000000..041fc498f1866bb43f8edccfa1d598ef334b4cde --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProductCoordinate.lean @@ -0,0 +1,26 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProductReindex + +namespace OAI + +noncomputable section +namespace ArExplicit.CompleteComparison +open CategoryTheory CochainComplex CochainComplex.HomComplex +universe u w +variable {k : Type u} [Field k] +variable {C : Type w} [Category.{u} C] [Preadditive C] [Linear k C] +variable {K L M : CochainComplex C ℤ} {a b c d : ℤ} + +theorem fullHomProduct_coordinate + (h : a=b) (h₁ : b+c=d) (h₂ : a+c=d) + {x : CohomologyClass K L a} {y : CohomologyClass K L b} + {p : CohomologyClass L M c} {z : CohomologyClass K M d} + (hy : y = TateKoszul.degreeEquiv (k := k) (CohomologyClass K L) h x) + (hz : z = TateKoszul.degreeEquiv (k := k) (CohomologyClass K M) h₁ (fullHomProduct y p)) : + z = TateKoszul.degreeEquiv (k := k) (CohomologyClass K M) h₂ (fullHomProduct x p) := by + rw [hz, hy, fullHomProduct_reindex_left] + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProductLinear.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProductLinear.lean new file mode 100644 index 0000000000000000000000000000000000000000..afae562932219ef0d042378756645cc37bdf55be --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProductLinear.lean @@ -0,0 +1,71 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomLinear + +namespace OAI + +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.CompleteComparison +universe u v +variable {k : Type u} [CommRing k] +variable {C : Type v} [Category* C] [Preadditive C] [Linear k C] +variable {K L M : CochainComplex C ℤ} {n m : ℤ} + +theorem fullHomProduct_add_left (x x' : CohomologyClass K L n) + (y : CohomologyClass L M m) : + fullHomProduct (x+x') y = fullHomProduct x y + fullHomProduct x' y := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + obtain ⟨x',rfl⟩ := CohomologyClass.mk_surjective x' + obtain ⟨y,rfl⟩ := CohomologyClass.mk_surjective y + rw [← CohomologyClass.mk_add, fullHomProduct_mk, fullHomProduct_mk, fullHomProduct_mk, + ← CohomologyClass.mk_add] + congr 1 + apply Subtype.ext + exact Cochain.add_comp x.val x'.val y.val rfl + +theorem fullHomProduct_add_right (x : CohomologyClass K L n) + (y y' : CohomologyClass L M m) : + fullHomProduct x (y+y') = fullHomProduct x y + fullHomProduct x y' := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + obtain ⟨y,rfl⟩ := CohomologyClass.mk_surjective y + obtain ⟨y',rfl⟩ := CohomologyClass.mk_surjective y' + rw [← CohomologyClass.mk_add, fullHomProduct_mk, fullHomProduct_mk, fullHomProduct_mk, + ← CohomologyClass.mk_add] + congr 1 + apply Subtype.ext + exact Cochain.comp_add x.val y.val y'.val rfl + +theorem fullHomProduct_smul_left (c : k) (x : CohomologyClass K L n) + (y : CohomologyClass L M m) : + fullHomProduct (c • x) y = c • fullHomProduct x y := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + obtain ⟨y,rfl⟩ := CohomologyClass.mk_surjective y + rw [← fullHom_mk_smul, fullHomProduct_mk, fullHomProduct_mk, ← fullHom_mk_smul] + congr 1 + apply Subtype.ext + exact Cochain.smul_comp c x.val y.val rfl + +theorem fullHomProduct_smul_right (c : k) (x : CohomologyClass K L n) + (y : CohomologyClass L M m) : + fullHomProduct x (c • y) = c • fullHomProduct x y := by + obtain ⟨x,rfl⟩ := CohomologyClass.mk_surjective x + obtain ⟨y,rfl⟩ := CohomologyClass.mk_surjective y + rw [← fullHom_mk_smul, fullHomProduct_mk, fullHomProduct_mk, ← fullHom_mk_smul] + congr 1 + apply Subtype.ext + exact Cochain.comp_smul x.val c y.val rfl + +def fullHomRightMultiply (y : CohomologyClass L M m) : + CohomologyClass K L n →ₗ[k] CohomologyClass K M (n+m) where + toFun x := fullHomProduct x y + map_add' x x' := fullHomProduct_add_left x x' y + map_smul' c x := fullHomProduct_smul_left c x y + +def fullHomLeftMultiply (x : CohomologyClass K L n) : + CohomologyClass L M m →ₗ[k] CohomologyClass K M (n+m) where + toFun y := fullHomProduct x y + map_add' y y' := fullHomProduct_add_right x y y' + map_smul' c y := fullHomProduct_smul_right c x y + +end ArExplicit.CompleteComparison + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProductReindex.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProductReindex.lean new file mode 100644 index 0000000000000000000000000000000000000000..370dae8ed491c4b5113c00c19b66fa4807f03da8 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProductReindex.lean @@ -0,0 +1,35 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProductLinear +import OAI.Algebra.AuslanderReiten.Complete.TateKoszul + +namespace OAI + +noncomputable section +namespace ArExplicit.CompleteComparison +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +universe u w +variable {k : Type u} [Field k] +variable {C : Type w} [Category.{u} C] [Preadditive C] [Linear k C] +variable {K L M : CochainComplex C ℤ} {a b c d : ℤ} + +theorem fullHomProduct_reindex_left (h : a=b) (h₁ : b+c=d) (h₂ : a+c=d) + (x : CohomologyClass K L a) (y : CohomologyClass L M c) : + TateKoszul.degreeEquiv (k := k) (CohomologyClass K M) h₁ + (fullHomProduct (TateKoszul.degreeEquiv (k := k) (CohomologyClass K L) h x) y) = + TateKoszul.degreeEquiv (k := k) (CohomologyClass K M) h₂ (fullHomProduct x y) := by + subst b + rfl + +theorem degreeEquiv_trans_apply {H : ℤ → Type u} [∀ i, AddCommGroup (H i)] [∀ i, Module k (H i)] + (h₁ : a=b) (h₂ : b=c) (x : H a) : + TateKoszul.degreeEquiv (k := k) H h₂ (TateKoszul.degreeEquiv (k := k) H h₁ x) = + TateKoszul.degreeEquiv (k := k) H (h₁.trans h₂) x := by + subst b + subst c + rfl + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProducts.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..34b477f3d476aa0e6c2135303c5e104214ff5ff9 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomProducts.lean @@ -0,0 +1,116 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomComparison + +namespace OAI + +open CategoryTheory +open CochainComplex CochainComplex.HomComplex + +namespace ArExplicit.CompleteComparison + +universe u + +section Cochains + +variable {C : Type*} [Category* C] [Preadditive C] +variable {K L M : CochainComplex C ℤ} {n m : ℤ} + +def cocycleProduct (x : Cocycle K L n) (y : Cocycle L M m) : Cocycle K M (n + m) := + Cocycle.mk (x.1.comp y.1 rfl) _ rfl (by + rw [δ_comp x.1 y.1 rfl (n + 1) (m + 1) (n + m + 1) rfl rfl rfl] + simp) + +@[simp] +theorem cocycleProduct_coe (x : Cocycle K L n) (y : Cocycle L M m) : + (cocycleProduct x y).1 = x.1.comp y.1 rfl := rfl + +def shiftedCocycleHom (y : Cocycle L M m) (n : ℤ) : L⟦n⟧ ⟶ M⟦n + m⟧ := + (Cocycle.equivHomShift.symm y)⟦n⟧' ≫ + (CategoryTheory.shiftFunctorAdd' (CochainComplex C ℤ) m n (n + m) + (add_comm m n)).inv.app M + +theorem cocycleHom_component (x : Cocycle K L n) (i : ℤ) : + (Cocycle.equivHomShift.symm x).f i = x.1.v i (i + n) rfl := by + simp only [Cocycle.equivHomShift_symm_apply, Cocycle.homOf_f, + Cocycle.rightShift_coe, Cochain.rightShift_v, shiftFunctorObjXIso, + HomologicalComplex.XIsoOfEq_rfl, Iso.refl_inv] + exact Category.comp_id _ + +private theorem cochain_component_transport (x : Cochain K L n) + (p q r : ℤ) (hpq : p + n = q) (hqr : q = r) : + x.v p q hpq ≫ (L.XIsoOfEq hqr).hom = x.v p r (hpq.trans hqr) := by + subst r + simp + +theorem cocycleHom_product (x : Cocycle K L n) (y : Cocycle L M m) : + Cocycle.equivHomShift.symm (cocycleProduct x y) = + Cocycle.equivHomShift.symm x ≫ shiftedCocycleHom y n := by + apply HomologicalComplex.Hom.ext + funext i + simp only [HomologicalComplex.comp_f, shiftedCocycleHom, cocycleHom_component, + shiftFunctor_map_f', shiftFunctorAdd'_inv_app_f'] + change (x.1.comp y.1 rfl).v i (i + (n + m)) rfl = + x.1.v i (i + n) rfl ≫ y.1.v (i + n) (i + n + m) rfl ≫ + (M.XIsoOfEq (show i + n + m = i + (n + m) by omega)).hom + rw [cochain_component_transport] + exact Cochain.comp_v x.1 y.1 rfl i (i + n) (i + (n + m)) rfl (by omega) + +theorem cocycleProduct_respects_classes + (x x' : Cocycle K L n) (y y' : Cocycle L M m) + (hx : CohomologyClass.mk x = CohomologyClass.mk x') + (hy : CohomologyClass.mk y = CohomologyClass.mk y') : + CohomologyClass.mk (cocycleProduct x y) = CohomologyClass.mk (cocycleProduct x' y') := by + have hx' := congrArg CohomologyClass.toHom hx + have hy' := congrArg CohomologyClass.toHom hy + let Hx := HomotopyCategory.homotopyOfEq _ _ hx' + let Hy := HomotopyCategory.homotopyOfEq _ _ hy' + apply (CohomologyClass.toHom_bijective K M (n + m)).1 + change (HomotopyCategory.quotient _ _).map + (Cocycle.equivHomShift.symm (cocycleProduct x y)) = + (HomotopyCategory.quotient _ _).map (Cocycle.equivHomShift.symm (cocycleProduct x' y')) + rw [cocycleHom_product, cocycleHom_product] + exact HomotopyCategory.eq_of_homotopy _ _ (Hx.comp ((Hy.shift n).compRight _)) + +def fullHomProduct (x : CohomologyClass K L n) (y : CohomologyClass L M m) : + CohomologyClass K M (n + m) := + Quotient.liftOn₂ x y (fun a b => CohomologyClass.mk (cocycleProduct a b)) (by + intro a b a' b' ha hb + exact cocycleProduct_respects_classes a a' b b' (Quotient.sound ha) (Quotient.sound hb)) + +@[simp] +theorem fullHomProduct_mk (x : Cocycle K L n) (y : Cocycle L M m) : + fullHomProduct (CohomologyClass.mk x) (CohomologyClass.mk y) = + CohomologyClass.mk (cocycleProduct x y) := rfl + +end Cochains + +variable {R : Type u} [Ring R] +variable {K L M : CochainComplex (ModuleCat.{u} R) ℤ} {n m : ℤ} + +noncomputable def cocycleComparisonMap (x : Cocycle K L n) : + chainOfCochain K ⟶ chainOfCochain (L⟦n⟧) := + HomologicalComplex.extendMap (Cocycle.equivHomShift.symm x) negIndexEmbedding + +@[simp] +theorem fullHomStableEquiv_mk (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain (L⟦n⟧))) (x : Cocycle K L n) : + fullHomStableEquiv K L n hK hL (CohomologyClass.mk x) = + StableHom.classOf R _ _ (cokernelMap (cocycleComparisonMap x) 0) := by + exact homotopyCokernelEquiv_map hK hL (cocycleComparisonMap x) + +theorem fullHomStableEquiv_product + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain (L⟦n⟧))) + (hM : ExactProjectiveComplex (chainOfCochain (M⟦n + m⟧))) + (x : Cocycle K L n) (y : Cocycle L M m) : + fullHomStableEquiv K M (n + m) hK hM (CohomologyClass.mk (cocycleProduct x y)) = + StableHom.comp + (StableHom.classOf R _ _ (cokernelMap + (HomologicalComplex.extendMap (shiftedCocycleHom y n) negIndexEmbedding) 0)) + (fullHomStableEquiv K L n hK hL (CohomologyClass.mk x)) := by + rw [fullHomStableEquiv_mk, fullHomStableEquiv_mk, StableHom.comp_classOf] + unfold cocycleComparisonMap + rw [cocycleHom_product, HomologicalComplex.extendMap_comp, cokernelMap_comp] + +end ArExplicit.CompleteComparison + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShift.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e430c0ce50039e19ad3550d8c15e012e6c77992 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShift.lean @@ -0,0 +1,102 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomLinear + +namespace OAI + +open CategoryTheory +open CochainComplex CochainComplex.HomComplex + +namespace ArExplicit.CompleteComparison + +universe u + +variable (k : Type u) [CommRing k] +variable {C : Type*} [Category* C] [Preadditive C] [Linear k C] +variable (K L : CochainComplex C ℤ) (n a n' : ℤ) + +noncomputable def rightShiftCocycleLinearEquiv (hn : n' + a = n) : + Cocycle K L n ≃ₗ[k] Cocycle K (L⟦a⟧) n' := + { Cocycle.rightShiftAddEquiv n a n' hn with + map_smul' := by + intro c x + apply Subtype.ext + exact Cochain.rightShift_smul x.val a n' hn c } + +variable {k K L n a n'} + +theorem rightShift_boundary (hn : n' + a = n) (x : Cocycle K L n) + (hx : x ∈ coboundaries K L n) : x.rightShift a n' hn ∈ coboundaries K (L⟦a⟧) n' := by + obtain ⟨m, hm, y, hy⟩ := hx + have hm' : n' - 1 + a = m := by omega + refine ⟨n' - 1, by omega, a.negOnePow • y.rightShift a (n' - 1) hm', ?_⟩ + rw [δ_units_smul, Cochain.δ_rightShift y a (n' - 1) n' hm' n hn, hy] + simp only [smul_smul, Int.units_mul_self, one_smul] + rfl + +theorem rightUnshift_boundary (hn : n' + a = n) (x : Cocycle K (L⟦a⟧) n') + (hx : x ∈ coboundaries K (L⟦a⟧) n') : x.rightUnshift n hn ∈ coboundaries K L n := by + obtain ⟨m', hm', y, hy⟩ := hx + have hm : m' + a = n - 1 := by omega + refine ⟨n - 1, by omega, a.negOnePow • y.rightUnshift (n - 1) hm, ?_⟩ + rw [δ_units_smul, Cochain.δ_rightUnshift y (n - 1) hm n n' hn, hy] + simp only [smul_smul, Int.units_mul_self, one_smul] + rfl + +variable (k K L n a n') + +noncomputable def rightShiftCohomologyEquiv (hn : n' + a = n) : + CohomologyClass K L n ≃ₗ[k] CohomologyClass K (L⟦a⟧) n' := + Submodule.Quotient.equiv (fullHomCoboundaries k K L n) + (fullHomCoboundaries k K (L⟦a⟧) n') (rightShiftCocycleLinearEquiv k K L n a n' hn) (by + ext y + constructor + · rintro ⟨x, hx, rfl⟩ + exact rightShift_boundary hn x hx + · intro hy + let E := rightShiftCocycleLinearEquiv k K L n a n' hn + refine ⟨E.symm y, rightUnshift_boundary hn y hy, E.apply_symm_apply y⟩) + +noncomputable def leftShiftCocycleLinearEquiv (hn : n + a = n') : + Cocycle K L n ≃ₗ[k] Cocycle (K⟦a⟧) L n' := + { Cocycle.leftShiftAddEquiv n a n' hn with + map_smul' := by + intro c x + apply Subtype.ext + exact Cochain.leftShift_smul x.val a n' hn c } + +variable {k K L n a n'} + +theorem leftShift_boundary (hn : n + a = n') (x : Cocycle K L n) + (hx : x ∈ coboundaries K L n) : x.leftShift a n' hn ∈ coboundaries (K⟦a⟧) L n' := by + obtain ⟨m, hm, y, hy⟩ := hx + have hm' : m + a = n' - 1 := by omega + refine ⟨n' - 1, by omega, a.negOnePow • y.leftShift a (n' - 1) hm', ?_⟩ + rw [δ_units_smul, Cochain.δ_leftShift y a (n' - 1) n' hm' n hn, hy] + simp only [smul_smul, Int.units_mul_self, one_smul] + rfl + +theorem leftUnshift_boundary (hn : n + a = n') (x : Cocycle (K⟦a⟧) L n') + (hx : x ∈ coboundaries (K⟦a⟧) L n') : x.leftUnshift n hn ∈ coboundaries K L n := by + obtain ⟨m', hm', y, hy⟩ := hx + have hm : n - 1 + a = m' := by omega + refine ⟨n - 1, by omega, a.negOnePow • y.leftUnshift (n - 1) hm, ?_⟩ + rw [δ_units_smul, Cochain.δ_leftUnshift y (n - 1) hm n n' hn, hy] + simp only [smul_smul, Int.units_mul_self, one_smul] + rfl + +variable (k K L n a n') + +noncomputable def leftShiftCohomologyEquiv (hn : n + a = n') : + CohomologyClass K L n ≃ₗ[k] CohomologyClass (K⟦a⟧) L n' := + Submodule.Quotient.equiv (fullHomCoboundaries k K L n) + (fullHomCoboundaries k (K⟦a⟧) L n') (leftShiftCocycleLinearEquiv k K L n a n' hn) (by + ext y + constructor + · rintro ⟨x, hx, rfl⟩ + exact leftShift_boundary hn x hx + · intro hy + let E := leftShiftCocycleLinearEquiv k K L n a n' hn + refine ⟨E.symm y, leftUnshift_boundary hn y hy, E.apply_symm_apply y⟩) + +end ArExplicit.CompleteComparison + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedHomotopy.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedHomotopy.lean new file mode 100644 index 0000000000000000000000000000000000000000..540a5baff6768cf3e59f1f4ee02a725978cc31c2 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedHomotopy.lean @@ -0,0 +1,33 @@ +import OAI.Algebra.AuslanderReiten.Homology.TriangleHomExact + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +universe u v w +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable (K L : CochainComplex C ℤ) (n : ℤ) + +def fullHomShiftedHomotopyEquiv : CohomologyClass K L n ≃ₗ[k] + ((HomotopyCategory.quotient C _).obj K ⟶ ((HomotopyCategory.quotient C _).obj L)⟦n⟧) := + (fullHomHomotopyLinearEquiv k K L n).trans + (Linear.homCongr k (Iso.refl _) + (((HomotopyCategory.quotient C _).commShiftIso n).app L)) + +@[simp] +theorem fullHomShiftedHomotopyEquiv_mk (x : Cocycle K L n) : + fullHomShiftedHomotopyEquiv k K L n (CohomologyClass.mk x) = + (HomotopyCategory.quotient C _).map (Cocycle.equivHomShift.symm x) ≫ + (((HomotopyCategory.quotient C _).commShiftIso n).app L).hom := by + simp only [fullHomShiftedHomotopyEquiv, LinearEquiv.trans_apply, + Linear.homCongr_apply, Iso.refl_inv, Category.id_comp] + rfl + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedIdentity.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..a65e00258568232fb31b9ac4b8c6eed6822d7d71 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedIdentity.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomShiftedProducts +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomDegreeProducts + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory +open CochainComplex CochainComplex.HomComplex CompleteComparison +universe u v w +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] + +theorem fullHomShiftedHomotopyEquiv_identity (K : CochainComplex C ℤ) : + fullHomShiftedHomotopyEquiv k K K 0 (fullHomIdentity K) = + (shiftFunctorZero (HomotopyCategory C (ComplexShape.up ℤ)) ℤ).inv.app + ((HomotopyCategory.quotient C _).obj K) := by + have h : Cocycle.equivHomShift.symm (Cocycle.ofHom (𝟙 K)) = + ShiftedHom.mk₀ (0 : ℤ) rfl (𝟙 K) := by + apply HomologicalComplex.Hom.ext + funext i + simp only [cocycleHom_component, Cocycle.ofHom_coe] + simp only [ShiftedHom.mk₀, CategoryTheory.shiftFunctorZero', + eqToIso_refl, Iso.trans_inv, Iso.refl_inv, + Category.id_comp, CochainComplex.shiftFunctorZero_inv_app_f, Category.comp_id] + change (Cochain.ofHom (𝟙 K)).v i (i+0) rfl = + (K.XIsoOfEq (show i=i+0 by omega)).hom + simpa only [Cochain.ofHom_v, HomologicalComplex.id_f, Category.id_comp] using + (Cochain.v_comp_XIsoOfEq_hom (Cochain.ofHom (𝟙 K)) i i (i+0) (add_zero i) (by omega)).symm + rw [fullHomIdentity, fullHomShiftedHomotopyEquiv_mk, h] + change (ShiftedHom.mk₀ (0 : ℤ) rfl (𝟙 K)).map (HomotopyCategory.quotient C _) = _ + rw [ShiftedHom.map_mk₀, CategoryTheory.Functor.map_id] + simp [ShiftedHom.mk₀, CategoryTheory.shiftFunctorZero'] + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedMaps.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..684b4e27e39975fc36a330322d6ff40a87037e33 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedMaps.lean @@ -0,0 +1,38 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomShiftedHomotopy +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomComposition + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +universe u v w +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable {K L M : CochainComplex C ℤ} (n : ℤ) + +theorem fullHomShiftedHomotopyEquiv_postcomp (f : L ⟶ M) (x : CohomologyClass K L n) : + fullHomShiftedHomotopyEquiv k K M n (fullHomPostcomp f n x) = + fullHomShiftedHomotopyEquiv k K L n x ≫ + ((HomotopyCategory.quotient C _).map f)⟦n⟧' := by + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + rw [fullHomPostcomp_mk, fullHomShiftedHomotopyEquiv_mk, + fullHomShiftedHomotopyEquiv_mk, Cocycle.equivHomShift_symm_postcomp, + Functor.map_comp, Category.assoc] + simpa only [Category.assoc, Iso.app_hom] using congrArg + (fun g => (HomotopyCategory.quotient C _).map (Cocycle.equivHomShift.symm x) ≫ g) + ((HomotopyCategory.quotient C _).commShiftIso_hom_naturality f n) + +theorem fullHomShiftedHomotopyEquiv_precomp (f : K ⟶ L) (x : CohomologyClass L M n) : + fullHomShiftedHomotopyEquiv k K M n (fullHomPrecomp f n x) = + (HomotopyCategory.quotient C _).map f ≫ fullHomShiftedHomotopyEquiv k L M n x := by + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + rw [fullHomPrecomp_mk, fullHomShiftedHomotopyEquiv_mk, + fullHomShiftedHomotopyEquiv_mk, Cocycle.equivHomShift_symm_precomp, + Functor.map_comp, Category.assoc] +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedProducts.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..388e4fd62c6537dee24179c950bea99db49505f8 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomShiftedProducts.lean @@ -0,0 +1,58 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomShiftedHomotopy +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProducts + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +universe u v w + +section Functor +variable {C D : Type*} [Category* C] [Category* D] [HasShift C ℤ] [HasShift D ℤ] +variable (F : C ⥤ D) [F.CommShift ℤ] +variable {X Y Z : C} {n m : ℤ} + +theorem map_shifted_composition (f : X ⟶ Y⟦n⟧) (g : Y ⟶ Z⟦m⟧) : + F.map (f ≫ g⟦n⟧' ≫ (CategoryTheory.shiftFunctorAdd' C m n (n+m) (add_comm m n)).inv.app Z) ≫ + (F.commShiftIso (n+m)).hom.app Z = + (F.map f ≫ (F.commShiftIso n).hom.app Y) ≫ + (F.map g ≫ (F.commShiftIso m).hom.app Z)⟦n⟧' ≫ + (CategoryTheory.shiftFunctorAdd' D m n (n+m) (add_comm m n)).inv.app (F.obj Z) := by + have h := NatTrans.congr_app (congrArg Iso.hom (F.commShiftIso_add' (add_comm m n))) Z + simp only [Functor.CommShift.isoAdd'_hom_app] at h + rw [h] + simp only [Functor.map_comp, Category.assoc] + rw [← F.map_comp_assoc + ((CategoryTheory.shiftFunctorAdd' C m n (n+m) (add_comm m n)).inv.app Z) + ((CategoryTheory.shiftFunctorAdd' C m n (n+m) (add_comm m n)).hom.app Z), + Iso.inv_hom_id_app, F.map_id, Category.id_comp] + rw [F.commShiftIso_hom_naturality_assoc g n] + +end Functor + +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable {K L M : CochainComplex C ℤ} {n m : ℤ} + +theorem fullHomShiftedHomotopyEquiv_product (x : CohomologyClass K L n) + (y : CohomologyClass L M m) : + fullHomShiftedHomotopyEquiv k K M (n+m) (CompleteComparison.fullHomProduct x y) = + fullHomShiftedHomotopyEquiv k K L n x ≫ + (fullHomShiftedHomotopyEquiv k L M m y)⟦n⟧' ≫ + (CategoryTheory.shiftFunctorAdd' (HomotopyCategory C (ComplexShape.up ℤ)) m n + (n+m) (add_comm m n)).inv.app ((HomotopyCategory.quotient C _).obj M) := by + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + obtain ⟨y, rfl⟩ := CohomologyClass.mk_surjective y + rw [CompleteComparison.fullHomProduct_mk, fullHomShiftedHomotopyEquiv_mk, + fullHomShiftedHomotopyEquiv_mk, fullHomShiftedHomotopyEquiv_mk, + CompleteComparison.cocycleHom_product] + exact map_shifted_composition (HomotopyCategory.quotient C _) + (Cocycle.equivHomShift.symm x) (Cocycle.equivHomShift.symm y) + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomSourceDuality.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomSourceDuality.lean new file mode 100644 index 0000000000000000000000000000000000000000..f68947da163ba3811c1e8ae6180b8762640e9cac --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomSourceDuality.lean @@ -0,0 +1,80 @@ +import OAI.Algebra.AuslanderReiten.Stable.TargetStableCoordinates +import OAI.Algebra.AuslanderReiten.Complete.TateKoszul + +namespace OAI + +noncomputable section +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.FrobeniusTrace +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (τ : FrobeniusTrace k R) (hs : ∀ a b : R, τ.trace (a*b)=τ.trace (b*a)) +open CompleteComparison +variable (K : CochainComplex (ModuleCat.{u} R) ℤ) +variable (hK : TotallyAcyclicComplex (chainOfCochain K)) + +def fullHomSourceDualityAt (a b : ℤ) (hb : b = -a-1) : + Module.Dual k (CohomologyClass K K a) ≃ₗ[k] CohomologyClass K K b := + (fullHomSourceStableLinearEquiv (k := k) K K a hK + hK.toExactProjectiveComplex).symm.dualMap |>.trans + ((τ.completeStableDualityAt hs (chainOfCochain K) hK.toExactProjectiveComplex a).trans + (fullHomTargetStableLinearEquiv (k := k) (a+1) (by omega) hK + hK.toExactProjectiveComplex).symm) + +theorem fullHomSourceDualityAt_symm_apply (a b : ℤ) (hb : b = -a-1) + (v : CohomologyClass K K b) (u : CohomologyClass K K a) : + ((τ.fullHomSourceDualityAt hs K hK a b hb).symm v) u = + ((τ.completeStableDualityAt hs (chainOfCochain K) hK.toExactProjectiveComplex a).symm + (fullHomTargetStableLinearEquiv (k := k) (a+1) (by omega) hK + hK.toExactProjectiveComplex v)) + (fullHomSourceStableLinearEquiv (k := k) K K a hK hK.toExactProjectiveComplex u) := rfl + +def fullHomSourceDuality (a : ℤ) : + Module.Dual k (CohomologyClass K K a) ≃ₗ[k] CohomologyClass K K (-a-1) := + τ.fullHomSourceDualityAt hs K hK a (-a-1) rfl + +theorem fullHomSourceDualityAt_transport (a b : ℤ) (hb : b = -a-1) + (v : CohomologyClass K K b) : + (τ.fullHomSourceDualityAt hs K hK a b hb).symm v = + (τ.fullHomSourceDuality hs K hK a).symm + (TateKoszul.degreeEquiv (k := k) (CohomologyClass K K) hb v) := by + subst b + rfl + +variable [CharP k 2] + +theorem fullHomSourceDualityAt_product (a n m : ℤ) (hm : m = -(n+a)-1) + (p : CohomologyClass K K n) (u : CohomologyClass K K a) + (v : CohomologyClass K K m) : + ((τ.fullHomSourceDualityAt hs K hK a (m+n) (by omega)).symm + (fullHomProduct v p)) u = + ((τ.fullHomSourceDualityAt hs K hK (n+a) m hm).symm v) + (fullHomProduct p u) := by + obtain ⟨p,rfl⟩ := CohomologyClass.mk_surjective p + obtain ⟨u,rfl⟩ := CohomologyClass.mk_surjective u + obtain ⟨v,rfl⟩ := CohomologyClass.mk_surjective v + rw [fullHomProduct_mk, fullHomProduct_mk, + fullHomSourceDualityAt_symm_apply, fullHomSourceDualityAt_symm_apply, + fullHomTargetStableLinearEquiv_mk, fullHomTargetStableLinearEquiv_mk, + fullHomSourceStableLinearEquiv_mk, fullHomSourceStableLinearEquiv_mk] + rw [targetCocycleMap_eq_reversed (k := k), targetCocycleMap_eq_reversed (k := k), + sourceCocycleMap_eq_reversed (k := k), sourceCocycleMap_eq_reversed (k := k), + reversedCokernelMap_product (k := k) v p 0 (n+a+1) (a+1) (by omega) (by omega), + reversedCokernelMap_product (k := k) p u (n+a) a 0 (by omega) (by omega)] + exact (τ.completeStableDualityAt_source hs hK.toExactProjectiveComplex + hK.toExactProjectiveComplex (n+a) a + (reversedComponent p.val (n+a) a (by omega)).hom + (reversedCokernelMap (k := k) p (n+a) a (by omega)) + (reversedCokernelMap (k := k) p (n+a+1) (a+1) (by omega)) + (by ext x; rfl) (reversedCokernelMap_syzygy (k := k) p hK.toExactProjectiveComplex + hK.toExactProjectiveComplex (n+a) a (by omega)) + (StableHom.classOf R _ _ (reversedCokernelMap (k := k) u a 0 (by omega))) + (StableHom.classOf R _ _ (reversedCokernelMap (k := k) v 0 (n+a+1) (by omega)))).symm + +end ArExplicit.FrobeniusTrace + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomTransport.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..cd4fd1eeb4cd06169d721b60e5bb98156a398430 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomTransport.lean @@ -0,0 +1,87 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProducts + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory CochainComplex.HomComplex + +variable {C D : Type*} [Category* C] [Category* D] [Preadditive C] [Preadditive D] + +structure FullHomEquivalence (K L : CochainComplex C ℤ) (K' L' : CochainComplex D ℤ) where + cochain : ∀ n : ℤ, Cochain K L n ≃+ Cochain K' L' n + differential : ∀ (n m : ℤ) (x : Cochain K L n), δ n m (cochain n x) = cochain m (δ n m x) + +namespace FullHomEquivalence + +variable {K L : CochainComplex C ℤ} {K' L' : CochainComplex D ℤ} +variable (e : FullHomEquivalence K L K' L') (n : ℤ) + +def cocycle : Cocycle K L n →+ Cocycle K' L' n where + toFun x := Cocycle.mk (e.cochain n x.1) (n+1) rfl (by + rw [e.differential, Cocycle.δ_eq_zero, map_zero]) + map_zero' := by apply Cocycle.ext; exact (e.cochain n).map_zero + map_add' x y := by apply Cocycle.ext; exact (e.cochain n).map_add x.1 y.1 + +theorem cocycle_bijective : Function.Bijective (e.cocycle n) := by + constructor + · intro x y h + apply Cocycle.ext + exact (e.cochain n).injective (congrArg Subtype.val h) + · intro y + let x := (e.cochain n).symm y.1 + have hx : δ n (n+1) x = 0 := by + apply (e.cochain (n+1)).injective + rw [← e.differential, map_zero] + change δ n (n+1) (e.cochain n ((e.cochain n).symm y.1)) = 0 + rw [AddEquiv.apply_symm_apply, Cocycle.δ_eq_zero] + refine ⟨Cocycle.mk x (n+1) rfl hx, ?_⟩ + apply Cocycle.ext + exact (e.cochain n).apply_symm_apply y.1 + +theorem boundary_iff (x : Cocycle K L n) : + e.cocycle n x ∈ coboundaries K' L' n ↔ x ∈ coboundaries K L n := by + rw [mem_coboundaries_iff _ (n-1) (by omega), mem_coboundaries_iff _ (n-1) (by omega)] + constructor + · rintro ⟨y, hy⟩ + refine ⟨(e.cochain (n-1)).symm y, ?_⟩ + apply (e.cochain n).injective + rw [← e.differential, AddEquiv.apply_symm_apply] + exact hy + · rintro ⟨y, hy⟩ + refine ⟨e.cochain (n-1) y, ?_⟩ + rw [e.differential, hy] + rfl + +def cohomologyMap : CohomologyClass K L n →+ CohomologyClass K' L' n := + CohomologyClass.descAddMonoidHom + ((CohomologyClass.mkAddMonoidHom _ _ _).comp (e.cocycle n)) (by + intro x hx + exact (CohomologyClass.mk_eq_zero_iff _).mpr ((e.boundary_iff n x).mpr hx)) + +@[simp] theorem cohomologyMap_mk (x : Cocycle K L n) : + e.cohomologyMap n (CohomologyClass.mk x) = CohomologyClass.mk (e.cocycle n x) := rfl + +theorem cohomologyMap_bijective : Function.Bijective (e.cohomologyMap n) := by + constructor + · apply (injective_iff_map_eq_zero _).mpr + intro x hx + obtain ⟨y, rfl⟩ := CohomologyClass.mk_surjective x + exact (CohomologyClass.mk_eq_zero_iff y).mpr + ((e.boundary_iff n y).mp ((CohomologyClass.mk_eq_zero_iff _).mp hx)) + · intro y + obtain ⟨y, rfl⟩ := CohomologyClass.mk_surjective y + obtain ⟨x, rfl⟩ := (e.cocycle_bijective n).2 y + exact ⟨CohomologyClass.mk x, rfl⟩ + +def cohomology : CohomologyClass K L n ≃+ CohomologyClass K' L' n := + AddEquiv.ofBijective (e.cohomologyMap n) (e.cohomologyMap_bijective n) + +end FullHomEquivalence +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomZeroProjection.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomZeroProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..a59032a738b8605024dc77ecc139d75fea1d57cf --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomZeroProjection.lean @@ -0,0 +1,36 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomZeroRepresentative + +namespace OAI + +noncomputable section +open CategoryTheory CochainComplex.HomComplex +namespace ArExplicit +universe u v w +variable {C : Type w} [Category.{v} C] [Preadditive C] +variable {K L M : CochainComplex C ℤ} + +theorem fullHomPostcomp_ofHom (f : K ⟶ L) (g : L ⟶ M) : + fullHomPostcomp g 0 (CohomologyClass.mk (Cocycle.ofHom f)) = + CohomologyClass.mk (Cocycle.ofHom (f ≫ g)) := by + rw [← fullHomPostcomp_identity f, fullHomPostcomp_comp, fullHomPostcomp_identity] + +variable (k : Type u) [CommRing k] [Linear k C] + +include k in +theorem fullHomZero_projection_inverse (f : K ⟶ L) (g : L ⟶ K) + (e : (HomotopyCategory.quotient C _).obj L ≅ (HomotopyCategory.quotient C _).obj K) + (he : (HomotopyCategory.quotient C _).map g = e.hom) + (h : fullHomPostcomp g 0 (CohomologyClass.mk (Cocycle.ofHom f)) = + CohomologyClass.mk (Cocycle.ofHom (𝟙 K))) : + (HomotopyCategory.quotient C _).map f = e.inv := by + rw [fullHomPostcomp_ofHom] at h + have hh := (fullHomZero_class_eq_iff k (f ≫ g) (𝟙 K)).mp h + rw [CategoryTheory.Functor.map_comp, he, CategoryTheory.Functor.map_id] at hh + apply (cancel_mono e.hom).1 + exact hh.trans e.inv_hom_id.symm + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomZeroRepresentative.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomZeroRepresentative.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb45e73e6a2d984363599a64de1d21516060bc14 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/FullHomZeroRepresentative.lean @@ -0,0 +1,45 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomMapLinear +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomShiftedIdentity +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomHomotopyMaps + +namespace OAI + +noncomputable section +open CategoryTheory CochainComplex.HomComplex +namespace ArExplicit +universe u v w +variable {C : Type w} [Category.{v} C] [Preadditive C] +variable {K L : CochainComplex C ℤ} + +def fullHomZeroRepresentative (x : CohomologyClass K L 0) : K ⟶ L := + Cocycle.homOf (Classical.choose (CohomologyClass.mk_surjective x)) + +@[simp] theorem fullHomZeroRepresentative_class (x : CohomologyClass K L 0) : + CohomologyClass.mk (Cocycle.ofHom (fullHomZeroRepresentative x)) = x := by + rw [fullHomZeroRepresentative, Cocycle.ofHom_homOf_eq_self] + exact Classical.choose_spec (CohomologyClass.mk_surjective x) + +variable (k : Type u) [CommRing k] [Linear k C] + +include k in +theorem fullHomZero_class_eq_iff (f g : K ⟶ L) : + CohomologyClass.mk (Cocycle.ofHom f) = CohomologyClass.mk (Cocycle.ofHom g) ↔ + (HomotopyCategory.quotient C _).map f = (HomotopyCategory.quotient C _).map g := by + constructor + · intro h + rw [← fullHomPrecomp_identity f, ← fullHomPrecomp_identity g] at h + have hh := congrArg (fullHomShiftedHomotopyEquiv k K L 0) h + rw [fullHomShiftedHomotopyEquiv_precomp, fullHomShiftedHomotopyEquiv_precomp] at hh + change _ ≫ fullHomShiftedHomotopyEquiv k L L 0 (CompleteComparison.fullHomIdentity L) = + _ ≫ fullHomShiftedHomotopyEquiv k L L 0 (CompleteComparison.fullHomIdentity L) at hh + rw [fullHomShiftedHomotopyEquiv_identity] at hh + exact (cancel_mono _).1 hh + · intro h + rw [← fullHomPrecomp_identity f, ← fullHomPrecomp_identity g] + exact fullHomPrecomp_congr k 0 h _ + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainExt.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..404d92e41b5a55ef312acc08a040ef9628cc7011 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainExt.lean @@ -0,0 +1,116 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorHomComplex +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionExtZero +import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +import Mathlib.Algebra.Category.ModuleCat.Ext.HasExt + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open scoped ModuleCat.Algebra +namespace ArExplicit.ExternalTensor +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +attribute [local instance 2000] moduleCatBaseModule moduleCatBaseTower +variable {X Y : ModuleCat.{u} R} (P : ProjectiveResolution X) + +abbrev homShort (n : ℕ) := (homCochain k R P.complex Y).sc' (n-1) n (n+1) + +theorem homShort_outgoing (n : ℕ) : + (homShort k R (Y := Y) P n).g = + ModuleCat.ofHom (LinearMap.lcomp k Y (P.complex.d (n+1) n).hom) := + homCochain_d k R P.complex Y n + +theorem homShort_incoming_succ (n : ℕ) : + (homShort k R (Y := Y) P (n+1)).f = + ModuleCat.ofHom (LinearMap.lcomp k Y (P.complex.d (n+1) n).hom) := by + exact homCochain_d k R P.complex Y n + +theorem homShort_incoming_zero : (homShort k R (Y := Y) P 0).f = 0 := by + exact (homCochain k R P.complex Y).shape 0 0 (by simp) + +theorem homCycle_closed (n : ℕ) (f : LinearMap.ker (homShort k R (Y := Y) P n).g.hom) : + P.complex.d (n+1) n ≫ ModuleCat.ofHom (X := P.complex.X n) (Y := Y) f.val = 0 := by + apply ModuleCat.hom_ext + let g : P.complex.X n →ₗ[R] Y := f.val + have hf : (homShort k R (Y := Y) P n).g.hom g = 0 := f.property + rw [homShort_outgoing] at hf + exact hf + +def homCyclesToExt (n : ℕ) : + LinearMap.ker (homShort k R (Y := Y) P n).g.hom →ₗ[k] Ext X Y n where + toFun f := P.extMk (ModuleCat.ofHom (X := P.complex.X n) (Y := Y) f.val) + (n+1) rfl (homCycle_closed k R P n f) + map_add' f g := (P.add_extMk + (ModuleCat.ofHom (X := P.complex.X n) (Y := Y) f.val) + (ModuleCat.ofHom (X := P.complex.X n) (Y := Y) g.val) (n+1) rfl + (homCycle_closed k R P n f) (homCycle_closed k R P n g)).symm + map_smul' a f := ResolutionHomology.extMk_smul P n + (ModuleCat.ofHom (X := P.complex.X n) (Y := Y) f.val) (homCycle_closed k R P n f) a + +theorem homCyclesToExt_surjective (n : ℕ) : + Function.Surjective (homCyclesToExt k R (Y := Y) P n) := by + intro a + obtain ⟨f, hf, hfa⟩ := P.extMk_surjective a (n+1) rfl + refine ⟨⟨f.hom, ?_⟩, hfa⟩ + change (homShort k R (Y := Y) P n).g.hom f.hom = 0 + rw [homShort_outgoing] + exact congrArg ModuleCat.Hom.hom hf + +theorem homCyclesToExt_kernel (n : ℕ) : + LinearMap.ker (homCyclesToExt k R (Y := Y) P n) = + LinearMap.range (homShort k R (Y := Y) P n).moduleCatToCycles := by + ext x + cases n with + | zero => + constructor + · intro hx + have hx0 : ModuleCat.ofHom x.val = 0 := + (ResolutionHomology.extMk_zeroDegree_eq_zero_iff P _ (homCycle_closed k R P 0 x)).mp hx + refine ⟨0, Subtype.ext ?_⟩ + change (0 : P.complex.X 0 →ₗ[R] Y) = x.val + exact (congrArg ModuleCat.Hom.hom hx0).symm + · rintro ⟨f, rfl⟩ + have hf0 : (homShort k R (Y := Y) P 0).moduleCatToCycles f = 0 := by + apply Subtype.ext + change (homShort k R (Y := Y) P 0).f.hom f = 0 + rw [homShort_incoming_zero] + rfl + rw [hf0] + exact map_zero _ + | succ n => + constructor + · intro hx + obtain ⟨f, hf⟩ := (P.extMk_eq_zero_iff (ModuleCat.ofHom x.val) + (n+2) rfl (homCycle_closed k R P (n+1) x) n rfl).mp hx + refine ⟨f.hom, Subtype.ext ?_⟩ + change (homShort k R (Y := Y) P (n+1)).f.hom f.hom = x.val + rw [homShort_incoming_succ] + exact congrArg ModuleCat.Hom.hom hf + · rintro ⟨f, rfl⟩ + apply (P.extMk_eq_zero_iff _ (n+2) rfl + (homCycle_closed k R P (n+1) ((homShort k R (Y := Y) P (n+1)).moduleCatToCycles f)) n rfl).mpr + refine ⟨ModuleCat.ofHom f, ?_⟩ + apply ModuleCat.hom_ext + change f.comp (P.complex.d (n+1) n).hom = + (homShort k R (Y := Y) P (n+1)).f.hom f + rw [homShort_incoming_succ] + rfl + +def homShortExtEquiv (n : ℕ) : + (homShort k R (Y := Y) P n).homology ≃ₗ[k] Ext X Y n := + (homShort k R (Y := Y) P n).moduleCatHomologyIso.toLinearEquiv.trans + ((Submodule.quotEquivOfEq _ _ (homCyclesToExt_kernel k R P n).symm).trans + ((homCyclesToExt k R P n).quotKerEquivOfSurjective + (homCyclesToExt_surjective k R P n))) + +def homCochainExtEquiv (n : ℕ) : + (homCochain k R P.complex Y).homology n ≃ₗ[k] Ext X Y n := + ((homCochain k R P.complex Y).homologyIsoSc' (n-1) n (n+1) + (by cases n <;> simp) (by simp)).toLinearEquiv.trans (homShortExtEquiv k R P n) + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainExtClass.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainExtClass.lean new file mode 100644 index 0000000000000000000000000000000000000000..2318c65c8ec56859dd48f0133bee5e2325b37729 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainExtClass.lean @@ -0,0 +1,44 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.HomCochainExt + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open scoped ModuleCat.Algebra +namespace ArExplicit.ExternalTensor +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +attribute [local instance 2000] moduleCatBaseModule moduleCatBaseTower +variable {X Y : ModuleCat.{u} R} (P : ProjectiveResolution X) + +def homCochainQuotientEquiv (n : ℕ) : + (homCochain k R P.complex Y).homology n ≃ₗ[k] + (LinearMap.ker (homShort k R (Y := Y) P n).g.hom ⧸ + LinearMap.range (homShort k R (Y := Y) P n).moduleCatToCycles) := + ((homCochain k R P.complex Y).homologyIsoSc' (n-1) n (n+1) + (by cases n <;> simp) (by simp)).toLinearEquiv.trans + (homShort k R (Y := Y) P n).moduleCatHomologyIso.toLinearEquiv + +def homCochainCycleClass (n : ℕ) + (f : LinearMap.ker (homShort k R (Y := Y) P n).g.hom) : + (homCochain k R P.complex Y).homology n := + (homCochainQuotientEquiv k R P n).symm (Submodule.Quotient.mk f) + +theorem homCochainExtEquiv_cycleClass (n : ℕ) + (f : LinearMap.ker (homShort k R (Y := Y) P n).g.hom) : + homCochainExtEquiv k R P n (homCochainCycleClass k R P n f) = + P.extMk (ModuleCat.ofHom (X := P.complex.X n) (Y := Y) f.val) + (n+1) rfl (homCycle_closed k R P n f) := by + change ((Submodule.quotEquivOfEq _ _ (homCyclesToExt_kernel k R P n).symm).trans + ((homCyclesToExt k R P n).quotKerEquivOfSurjective + (homCyclesToExt_surjective k R P n))) + ((homCochainQuotientEquiv k R P n) + ((homCochainQuotientEquiv k R P n).symm (Submodule.Quotient.mk f))) = _ + rw [LinearEquiv.apply_symm_apply] + rfl + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainNativeClass.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainNativeClass.lean new file mode 100644 index 0000000000000000000000000000000000000000..74956148d53d545cd82c0c17921fc5411ad00221 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainNativeClass.lean @@ -0,0 +1,62 @@ +import OAI.Algebra.AuslanderReiten.Ext.ExtKunneth +import OAI.Algebra.AuslanderReiten.HomComplex.HomCochainNaturality + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian HomologicalComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.ExternalTensor +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable {X : ModuleCat.{u} R} (P : ProjectiveResolution X) +variable (Y : Type u) [AddCommGroup Y] [Module R Y] [Module k Y] [IsScalarTower k R Y] + +theorem homCochain_mem_cycles (n : ℕ) (f : P.complex.X n →ₗ[R] Y) + (hf : f.comp (P.complex.d (n+1) n).hom=0) : + f ∈ LinearMap.ker ((homCochain k R P.complex Y).d n (n+1)).hom := by + change ((homCochain k R P.complex Y).d n (n+1)).hom f=0 + rw [homCochain_d] + exact hf + +theorem homCochainNativeExtEquiv_literal (n : ℕ) + (f : P.complex.X n →ₗ[R] Y) (hf : f.comp (P.complex.d (n+1) n).hom=0) : + homCochainNativeExtEquiv k R P Y n + (VectorCochain.literalClass k (homCochain k R P.complex Y) n ⟨f,homCochain_mem_cycles k R P Y n f hf⟩) = + P.extMk (ModuleCat.ofHom (X := P.complex.X n) (Y := ModuleCat.of R Y) f) + (n+1) rfl (ModuleCat.hom_ext hf) := by + let C := canonicalHomCochain k R P.complex (ModuleCat.of R Y) + let z : LinearMap.ker (C.d n (n+1)).hom := ⟨f,by + change (C.d n (n+1)).hom f=0 + dsimp only [C, canonicalHomCochain] + rw [homCochain_d] + exact hf⟩ + have hz := VectorCochain.literalClass_map k (homCochainScalarIso k R P.complex Y).hom n + (⟨f,homCochain_mem_cycles k R P Y n f hf⟩ : LinearMap.ker ((homCochain k R P.complex Y).d n (n+1)).hom) z rfl + change homCochainExtEquiv k R (Y := ModuleCat.of R Y) P n + ((homologyMap (homCochainScalarIso k R P.complex Y).hom n).hom + (VectorCochain.literalClass k (homCochain k R P.complex Y) n ⟨f,homCochain_mem_cycles k R P Y n f hf⟩)) = _ + rw [hz] + have he := homCochainExtEquiv_cycleClass k R (Y := ModuleCat.of R Y) P n z + erw [homCochainCycleClass_eq_literal] at he + exact he + +theorem homCochainExtEquiv_literal (N : ModuleCat.{u} R) (n : ℕ) + (f : P.complex.X n →ₗ[R] N) (hf : f.comp (P.complex.d (n+1) n).hom=0) : + homCochainExtEquiv k R (Y := N) P n + (VectorCochain.literalClass k (homCochain k R P.complex N) n + ⟨f,homCochain_mem_cycles k R P N n f hf⟩) = + P.extMk (ModuleCat.ofHom (X := P.complex.X n) (Y := N) f) + (n+1) rfl (ModuleCat.hom_ext hf) := by + let z : LinearMap.ker (homShort k R (Y := N) P n).g.hom := + ⟨f,homCochain_mem_cycles k R P N n f hf⟩ + have he := homCochainExtEquiv_cycleClass k R (Y := N) P n z + rw [homCochainCycleClass_eq_literal] at he + exact he + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainNaturality.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..eff6f15149eb02dc0a5c3264f3858a4a04cccf39 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainNaturality.lean @@ -0,0 +1,48 @@ +import OAI.Algebra.AuslanderReiten.Homology.CochainCycleClass + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian HomologicalComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.ExternalTensor +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +attribute [local instance 2000] moduleCatBaseModule moduleCatBaseTower +variable {X Y : ModuleCat.{u} R} (P : ProjectiveResolution X) + +theorem homCochainCycleClass_eq_literal (n : ℕ) + (f : LinearMap.ker (homShort k R (Y := Y) P n).g.hom) : + homCochainCycleClass k R P n f = + VectorCochain.literalClass k (homCochain k R P.complex Y) n f := by + exact (VectorCochain.literalClass_eq_quotient k (homCochain k R P.complex Y) n f).symm + +variable (F : homCochain k R P.complex Y ⟶ homCochain k R P.complex Y) + +def homCochainEndExt (n : ℕ) : Ext X Y n →ₗ[k] Ext X Y n := + (homCochainExtEquiv k R P n).toLinearMap.comp + ((homologyMap F n).hom.comp (homCochainExtEquiv k R P n).symm.toLinearMap) + +theorem homCochainEndExt_cycleClass (n : ℕ) + (f g : LinearMap.ker (homShort k R (Y := Y) P n).g.hom) + (hfg : (F.f n).hom f.val = g.val) : + homCochainEndExt k R P F n + (P.extMk (ModuleCat.ofHom (X := P.complex.X n) (Y := Y) f.val) + (n+1) rfl (homCycle_closed k R P n f)) = + P.extMk (ModuleCat.ofHom (X := P.complex.X n) (Y := Y) g.val) + (n+1) rfl (homCycle_closed k R P n g) := by + rw [← homCochainExtEquiv_cycleClass k R P n f, + ← homCochainExtEquiv_cycleClass k R P n g] + change (homCochainExtEquiv k R P n) + ((homologyMap F n).hom ((homCochainExtEquiv k R P n).symm + ((homCochainExtEquiv k R P n) (homCochainCycleClass k R P n f)))) = _ + rw [LinearEquiv.symm_apply_apply, homCochainCycleClass_eq_literal, + homCochainCycleClass_eq_literal] + exact congrArg (homCochainExtEquiv k R P n) + (VectorCochain.literalClass_map k F n f g hfg) + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainScalar.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainScalar.lean new file mode 100644 index 0000000000000000000000000000000000000000..e919e7a2abd630beac002017deb0db28dc237ff1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomCochainScalar.lean @@ -0,0 +1,49 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorHomComplex + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.ExternalTensor +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P : ChainComplex (ModuleCat.{u} R) ℕ) + +def canonicalHomCochain (U : ModuleCat.{u} R) : CochainComplex (ModuleCat.{u} k) ℕ := + letI := moduleCatBaseModule (k := k) (R := R) U + letI := moduleCatBaseTower (k := k) (R := R) U + homCochain k R P U + +variable (U : Type u) [AddCommGroup U] [Module R U] [Module k U] [IsScalarTower k R U] + +def homCochainScalarEquiv (n : ℕ) : + (homCochain k R P U).X n ≃ₗ[k] (canonicalHomCochain k R P (ModuleCat.of R U)).X n where + toFun f := f + invFun f := f + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' a f := by + change P.X n →ₗ[R] U at f + apply LinearMap.ext + intro x + change a • f x = (algebraMap k R a) • f x + exact (IsScalarTower.algebraMap_smul R a (f x)).symm + +def homCochainScalarIso : homCochain k R P U ≅ + canonicalHomCochain k R P (ModuleCat.of R U) := + HomologicalComplex.Hom.isoOfComponents + (fun n => (homCochainScalarEquiv k R P U n).toModuleIso) + (fun i j hij => by + have h : i+1=j := hij + subst j + dsimp only [canonicalHomCochain] + rw [homCochain_d, homCochain_d] + rfl) + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomKunnethClass.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomKunnethClass.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2205907b2884ca4fccc41a6c028315474c36880 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/HomKunnethClass.lean @@ -0,0 +1,77 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorHomKunneth +import OAI.Algebra.AuslanderReiten.HomComplex.HomCochainNativeClass +import OAI.Algebra.AuslanderReiten.Homology.VectorCochainKunnethLiteral + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits HomologicalComplex +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) +variable (U : ModuleCat.{u} A) (V : ModuleCat.{u} B) +variable [∀ n, Module.Finite A (P.X n)] [∀ n, Module.Projective A (P.X n)] +variable [∀ n, Module.Finite B (Q.X n)] [∀ n, Module.Projective B (Q.X n)] +variable (i j n : ℕ) (h : i+j=n) +variable (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) +variable (hf : f.comp (P.d (i+1) i).hom=0) (hg : g.comp (Q.d (j+1) j).hom=0) +include hf hg + +theorem elementary_closed : + (elementaryHom k A B P Q U V i j n h f g).comp ((complex k A B P Q).d (n+1) n).hom=0 := by + rw [elementary_d, hf, hg] + simp [elementaryHom] + change (0 : (complex k A B P Q).X (n+1) →ₗ[A ⊗[k] B] moduleObject k A B U V) + + ((-1 : ℤˣ)^i) • 0 = 0 + simp only [smul_zero, add_zero] + +omit [∀ n, Module.Finite A (P.X n)] [∀ n, Module.Projective A (P.X n)] + [∀ n, Module.Finite B (Q.X n)] [∀ n, Module.Projective B (Q.X n)] in +theorem elementary_total_closed : + ((homCochainTotal k A B P Q U V).d n (n+1)).hom + ((homCochainInclusion k A B P Q U V i j n h).hom (f ⊗ₜ[k] g))=0 := by + rw [homCochainInclusion_d_tmul, hf, hg] + simp + +theorem homKunnethEquiv_elementary + (xf : LinearMap.ker ((homCochain k A P U).d i (i+1)).hom) + (xg : LinearMap.ker ((homCochain k B Q V).d j (j+1)).hom) + (hx : xf.val=f) (hy : xg.val=g) + (z : LinearMap.ker ((homCochain k (A ⊗[k] B) (complex k A B P Q) + (moduleObject k A B U V)).d n (n+1)).hom) + (hz : z.val=elementaryHom k A B P Q U V i j n h f g) : + homKunnethEquiv k A B P Q U V n + (VectorCochain.literalClass k _ n z) = + (DFinsupp.single ⟨(i,j),h⟩ + (VectorCochain.literalClass k (homCochain k A P U) i xf ⊗ₜ[k] + VectorCochain.literalClass k (homCochain k B Q V) j xg) : + Π₀ p : Diagonal n, (homCochain k A P U).homology p.val.1 ⊗[k] + (homCochain k B Q V).homology p.val.2) := by + let w : LinearMap.ker ((homCochainTotal k A B P Q U V).d n (n+1)).hom := + ⟨(homCochainInclusion k A B P Q U V i j n h).hom (f ⊗ₜ[k] g), + elementary_total_closed k A B P Q U V i j n h f g hf hg⟩ + let e := (homologyFunctor (ModuleCat.{u} k) (ComplexShape.up ℕ) n).mapIso + (homCochainTotalIso k A B P Q U V) + have hmap := VectorCochain.literalClass_map k (homCochainTotalIso k A B P Q U V).hom n w z + (by exact hz.symm) + have hcancel : e.inv.hom (VectorCochain.literalClass k _ n z) = + VectorCochain.literalClass k _ n w := by + rw [← hmap] + exact e.toLinearEquiv.symm_apply_apply _ + change VectorCochain.kunnethLinearEquiv k (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) + (homCochain k A P U) (homCochain k B Q V) n + (e.inv.hom (VectorCochain.literalClass k _ n z)) = _ + rw [hcancel] + apply VectorCochain.kunnethLinearEquiv_literal_tmul k _ _ i j n h xf xg w + change (homCochainInclusion k A B P Q U V i j n h).hom (f ⊗ₜ[k] g) = + (homCochainInclusion k A B P Q U V i j n h).hom (xf.val ⊗ₜ[k] xg.val) + rw [hx, hy] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/NativeHomExtAction.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/NativeHomExtAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..70b8477ab0f49f10afe38137ff7cc434fd0889f5 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/NativeHomExtAction.lean @@ -0,0 +1,90 @@ +import OAI.Algebra.AuslanderReiten.Ext.ExtKunnethMap +import OAI.Algebra.AuslanderReiten.HomComplex.HomCochainNativeClass +import OAI.Algebra.AuslanderReiten.Resolutions.MapResolutionExtConjugate + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian HomologicalComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.ExternalTensor +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable {X : ModuleCat.{u} R} (P : ProjectiveResolution X) +variable (Y : Type u) [AddCommGroup Y] [Module R Y] [Module k Y] [IsScalarTower k R Y] +variable (H : homCochain k R P.complex Y ⟶ homCochain k R P.complex Y) + +theorem nativeHomEndExt_extMk (n : ℕ) (f g : P.complex.X n →ₗ[R] Y) + (hf : f.comp (P.complex.d (n+1) n).hom = 0) + (hg : g.comp (P.complex.d (n+1) n).hom = 0) + (hfg : (H.f n).hom f = g) : + nativeHomEndExt k R P Y H n + (P.extMk (ModuleCat.ofHom (X := P.complex.X n) (Y := ModuleCat.of R Y) f) + (n+1) rfl (ModuleCat.hom_ext hf)) = + P.extMk (ModuleCat.ofHom (X := P.complex.X n) (Y := ModuleCat.of R Y) g) + (n+1) rfl (ModuleCat.hom_ext hg) := by + rw [← homCochainNativeExtEquiv_literal k R P Y n f hf, + ← homCochainNativeExtEquiv_literal k R P Y n g hg] + change (homCochainNativeExtEquiv k R P Y n) + ((homologyMap H n).hom ((homCochainNativeExtEquiv k R P Y n).symm + ((homCochainNativeExtEquiv k R P Y n) + (VectorCochain.literalClass k (homCochain k R P.complex Y) n _)))) = _ + rw [LinearEquiv.symm_apply_apply] + exact congrArg (homCochainNativeExtEquiv k R P Y n) + (VectorCochain.literalClass_map k H n _ _ hfg) + +theorem nativeHomEnd_closed (n : ℕ) (f : P.complex.X n →ₗ[R] Y) + (hf : f.comp (P.complex.d (n+1) n).hom = 0) : + (show P.complex.X n →ₗ[R] Y from (H.f n).hom f).comp + (P.complex.d (n+1) n).hom = 0 := by + have hh := LinearMap.congr_fun (congrArg ModuleCat.Hom.hom (H.comm n (n+1))) f + change ((homCochain k R P.complex Y).d n (n+1)).hom ((H.f n).hom f) = + (H.f (n+1)).hom (((homCochain k R P.complex Y).d n (n+1)).hom f) at hh + rw [homCochain_d] at hh + change (show P.complex.X n →ₗ[R] Y from (H.f n).hom f).comp + (P.complex.d (n+1) n).hom = + (H.f (n+1)).hom (f.comp (P.complex.d (n+1) n).hom) at hh + rw [hf] at hh + exact hh.trans (H.f (n+1)).hom.map_zero + +end ArExplicit.ExternalTensor + +namespace ArExplicit.ExternalTensor +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (Y : Type u) [addY : AddCommGroup Y] [modY : Module R Y] + [baseY : Module k Y] [towerY : IsScalarTower k R Y] +variable (P : ProjectiveResolution (ModuleCat.of R Y)) +variable (H : homCochain k R P.complex Y ⟶ homCochain k R P.complex Y) +variable (F : ModuleCat.{u} R ⥤ ModuleCat.{u} R) [F.Additive] + [CategoryTheory.Limits.PreservesFiniteLimits F] + [CategoryTheory.Limits.PreservesFiniteColimits F] [F.PreservesProjectiveObjects] +variable (e : ModuleCat.of R Y ≅ F.obj (ModuleCat.of R Y)) +variable (φ : ProjectiveResolution.Hom P (ResolutionProducts.mapResolution F P) e.hom) + +theorem nativeHomEndExt_eq_exactFunctor + (hφ : ∀ n (a : P.complex.X n ⟶ ModuleCat.of R Y), + ModuleCat.ofHom (X := P.complex.X n) (Y := ModuleCat.of R Y) ((H.f n).hom a.hom) = + (φ.hom.f n ≫ F.map a) ≫ e.inv) + (n : ℕ) (x : Ext (ModuleCat.of R Y) (ModuleCat.of R Y) n) : + nativeHomEndExt k R P Y H n x = + ((Ext.mk₀ e.hom).comp (x.mapExactFunctor F) (zero_add n)).comp + (Ext.mk₀ e.inv) (add_zero n) := by + obtain ⟨a, ha, rfl⟩ := P.extMk_surjective x (n+1) rfl + let b : P.complex.X n →ₗ[R] Y := (H.f n).hom a.hom + have ha' : a.hom.comp (P.complex.d (n+1) n).hom = 0 := + congrArg ModuleCat.Hom.hom ha + have hb := nativeHomEnd_closed k R P Y H n a.hom ha' + have ht := nativeHomEndExt_extMk k R P Y H n a.hom b ha' hb rfl + refine ht.trans ?_ + exact (ResolutionProducts.map_extMk_conjugate F P e.hom e.inv φ a ha + (ModuleCat.ofHom (X := P.complex.X n) (Y := ModuleCat.of R Y) b) + (ModuleCat.hom_ext hb) (hφ n a)).symm + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/PositiveFullHomExt.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/PositiveFullHomExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..c73b90606f33f4b02be56e530ab3e2cf7c58575b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/PositiveFullHomExt.lean @@ -0,0 +1,37 @@ +import OAI.Algebra.AuslanderReiten.Stable.SourceStableShift +import OAI.Algebra.AuslanderReiten.Stable.StableExtEquiv + +namespace OAI + +noncomputable section +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.CompleteComparison +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable (K L : CochainComplex (ModuleCat.{u} R) ℤ) +variable (hK : TotallyAcyclicComplex (chainOfCochain K)) +variable (hL : ExactProjectiveComplex (chainOfCochain L)) + +def fullPositiveExtEquiv (n : ℕ) : + CohomologyClass K L ((n+1 : ℕ) : ℤ) ≃ₗ[k] + Abelian.Ext (ModuleCat.of R (Cokernel (chainOfCochain K) 0)) + (ModuleCat.of R (Cokernel (chainOfCochain L) 0)) (n+1) := + (fullHomSourceStableLinearEquiv (k := k) K L ((n+1 : ℕ) : ℤ) hK hL).trans + (positiveExtStableEquiv (k := k) hK + (ModuleCat.of R (Cokernel (chainOfCochain L) 0)) n).symm + +theorem fullPositiveExtEquiv_stable (n : ℕ) + (x : CohomologyClass K L ((n+1 : ℕ) : ℤ)) : + positiveExtStableEquiv (k := k) hK + (ModuleCat.of R (Cokernel (chainOfCochain L) 0)) n + (fullPositiveExtEquiv (k := k) K L hK hL n x) = + fullHomSourceStableLinearEquiv (k := k) K L ((n+1 : ℕ) : ℤ) hK hL x := + LinearEquiv.apply_symm_apply _ _ + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/PositiveFullHomProducts.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/PositiveFullHomProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c7dad33ea19424e8143e54a4c10749052df9f3e --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/PositiveFullHomProducts.lean @@ -0,0 +1,64 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullCochainProducts +import OAI.Algebra.AuslanderReiten.Ext.NatComparisonExt +import OAI.Algebra.AuslanderReiten.Stable.SourceStableCoordinates + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.CompleteComparison +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [CharP k 2] +variable [HasDerivedCategory (ModuleCat.{u} R)] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (K : CochainComplex (ModuleCat.{u} R) ℤ) +variable (hK : TotallyAcyclicComplex (chainOfCochain K)) + +def restrictedEndExt (r : ℕ) (x : Cocycle K K (r : ℤ)) : + Ext (ModuleCat.of R (Cokernel (chainOfCochain K) 0)) + (ModuleCat.of R (Cokernel (chainOfCochain K) 0)) r := + ResolutionProducts.endExt (completeExtResolution hK) + (restrictedCocycle (k := k) K K hK hK.toExactProjectiveComplex r x) + +theorem fullPositiveExtEquiv_mk (n : ℕ) (x : Cocycle K K ((n+1 : ℕ) : ℤ)) : + fullPositiveExtEquiv (k := k) K K hK hK.toExactProjectiveComplex n + (CohomologyClass.mk x) = restrictedEndExt (k := k) K hK (n+1) x := by + apply (positiveExtStableEquiv (k := k) hK + (ModuleCat.of R (Cokernel (chainOfCochain K) 0)) n).injective + rw [fullPositiveExtEquiv_stable, fullHomSourceStableLinearEquiv_mk] + unfold restrictedEndExt restrictedCocycle + erw [ResolutionProducts.natComparison_endExt_eq, + positiveExtStableEquiv_extMk] + unfold completeExtCyclesStable + apply congrArg (StableHom.classOf R _ _) + apply LinearMap.ext + intro z + obtain ⟨z,rfl⟩ := Submodule.mkQ_surjective + (LinearMap.range ((chainOfCochain K).d (((n+1 : ℕ) : ℤ)+1) ((n+1 : ℕ) : ℤ)).hom) z + exact (sourceCocycleMap_mk (k := k) x z).trans (by rfl) + +theorem restrictedEndExt_product {r s : ℕ} + (x : Cocycle K K (r : ℤ)) (y : Cocycle K K (s : ℤ)) : + (restrictedEndExt (k := k) K hK r x).comp (restrictedEndExt (k := k) K hK s y) rfl = + restrictedEndExt (k := k) K hK (r+s) (ResolutionProducts.natCocycleProduct x y) := by + unfold restrictedEndExt + rw [ResolutionProducts.endExt_product, restrictedCocycle_product] + +theorem fullPositiveExtEquiv_product (n m : ℕ) + (x : Cocycle K K ((n+1 : ℕ) : ℤ)) (y : Cocycle K K ((m+1 : ℕ) : ℤ)) : + (fullPositiveExtEquiv (k := k) K K hK hK.toExactProjectiveComplex n + (CohomologyClass.mk x)).comp + (fullPositiveExtEquiv (k := k) K K hK hK.toExactProjectiveComplex m + (CohomologyClass.mk y)) rfl = + fullPositiveExtEquiv (k := k) K K hK hK.toExactProjectiveComplex (n+1+m) + (CohomologyClass.mk (ResolutionProducts.natCocycleProduct (n := n+1) (m := m+1) x y)) := by + rw [fullPositiveExtEquiv_mk, fullPositiveExtEquiv_mk, fullPositiveExtEquiv_mk, + restrictedEndExt_product] + rfl + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/TensorFullHomPositive.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/TensorFullHomPositive.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd52ead40f96b6076ae46c5ca0fab53a10a4b6bb --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/TensorFullHomPositive.lean @@ -0,0 +1,94 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FiniteFullHomExt +import OAI.Algebra.AuslanderReiten.HomComplex.TensorFullHomZero +import OAI.Algebra.AuslanderReiten.Ext.NativeExtZero + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.A +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +open CompleteComparison +variable [HasDerivedCategory (ModuleCat.{u} (A k q))] + +def simpleExtZeroEquiv (hq1 : 1+q ≠ 0) : k ≃ₗ[k] Ext (Simple q) (Simple q) 0 := + (simpleEndEquiv q hq1).symm.trans (nativeExtZeroEquiv (Simple q) (Simple q)) + +omit [CharP k 2] [HasDerivedCategory (ModuleCat.{u} (A k q))] in +@[simp] +theorem simpleExtZeroEquiv_one (hq1 : 1+q ≠ 0) : + simpleExtZeroEquiv q hq1 1 = Ext.mk₀ (𝟙 (Simple q)) := by + unfold simpleExtZeroEquiv + rw [LinearEquiv.trans_apply, nativeExtZeroEquiv_apply] + congr 1 + apply ModuleCat.hom_ext + change (1:k) • (LinearMap.id : Simple q →ₗ[A k q] Simple q) = LinearMap.id + exact one_smul k _ + +omit [HasDerivedCategory (ModuleCat.{u} (A k q))] in +theorem fullHomZero_eq_scalar (hq1 : 1+q ≠ 0) + (x : CohomologyClass (simpleComplete q) (simpleComplete q) 0) : + x = fullHomZeroScalarEquiv q hq1 x • fullHomIdentity (simpleComplete q) := by + apply (fullHomZeroScalarEquiv q hq1).injective + rw [map_smul] + change _ = _ • fullHomZeroScalarEquiv q hq1 (CohomologyClass.mk (Cocycle.ofHom (𝟙 _))) + rw [fullHomZeroScalarEquiv_identity] + exact (mul_one _).symm + +def fullNonnegativeExtEquiv (hq1 : 1+q ≠ 0) : (n : ℕ) → + CohomologyClass (simpleComplete q) (simpleComplete q) (n:ℤ) ≃ₗ[k] Ext (Simple q) (Simple q) n + | 0 => (fullHomZeroScalarEquiv q hq1).trans (simpleExtZeroEquiv q hq1) + | n+1 => FiniteLeftModule.fullPositiveModuleExtEquiv (AFrobeniusTrace k q) (simpleFiniteModule q) n + +omit [HasDerivedCategory (ModuleCat.{u} (A k q))] in +@[simp] +theorem fullNonnegativeExtEquiv_identity (hq1 : 1+q ≠ 0) : + fullNonnegativeExtEquiv q hq1 0 (fullHomIdentity (simpleComplete q)) = Ext.mk₀ (𝟙 (Simple q)) := by + change simpleExtZeroEquiv q hq1 (fullHomZeroScalarEquiv q hq1 + (CohomologyClass.mk (Cocycle.ofHom (𝟙 _)))) = _ + rw [fullHomZeroScalarEquiv_identity, simpleExtZeroEquiv_one] + +theorem fullNonnegativeExtEquiv_product_of_eq (hq1 : 1+q ≠ 0) (n m r : ℕ) (hr : n+m=r) + (x : CohomologyClass (simpleComplete q) (simpleComplete q) (n:ℤ)) + (y : CohomologyClass (simpleComplete q) (simpleComplete q) (m:ℤ)) : + fullNonnegativeExtEquiv q hq1 r + (TateKoszul.degreeEquiv (k := k) (CohomologyClass (simpleComplete q) (simpleComplete q)) + (show (n:ℤ)+(m:ℤ)=(r:ℤ) by omega) (fullHomProduct x y)) = + (fullNonnegativeExtEquiv q hq1 n x).comp (fullNonnegativeExtEquiv q hq1 m y) hr := by + cases n with + | zero => + obtain rfl : r=m := by omega + rw [fullHomZero_eq_scalar q hq1 x] + simp only [fullHomProduct_smul_left, map_smul, + fullNonnegativeExtEquiv_identity, Ext.smul_comp, Ext.mk₀_id_comp] + erw [fullHomProduct_identity_left] + | succ n => + cases m with + | zero => + obtain rfl : r=n+1 := by omega + rw [fullHomZero_eq_scalar q hq1 y] + simp only [fullHomProduct_smul_right, map_smul, + fullNonnegativeExtEquiv_identity, Ext.comp_smul, Ext.comp_mk₀_id] + erw [fullHomProduct_identity_right] + | succ m => + obtain rfl : r=n+1+m+1 := by omega + exact FiniteLeftModule.fullPositiveModuleExtEquiv_product (AFrobeniusTrace k q) + (simpleFiniteModule q) n m x y + +theorem fullNonnegativeExtEquiv_product (hq1 : 1+q ≠ 0) (n m : ℕ) + (x : CohomologyClass (simpleComplete q) (simpleComplete q) (n:ℤ)) + (y : CohomologyClass (simpleComplete q) (simpleComplete q) (m:ℤ)) : + fullNonnegativeExtEquiv q hq1 (n+m) + (TateKoszul.degreeEquiv (k := k) (CohomologyClass (simpleComplete q) (simpleComplete q)) + (show (n:ℤ)+(m:ℤ)=((n+m:ℕ):ℤ) by omega) (fullHomProduct x y)) = + (fullNonnegativeExtEquiv q hq1 n x).comp (fullNonnegativeExtEquiv q hq1 m y) rfl := + fullNonnegativeExtEquiv_product_of_eq q hq1 n m (n+m) rfl x y + +end ArExplicit.A + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/HomComplex/TensorFullHomZero.lean b/lean/OAI/Algebra/AuslanderReiten/HomComplex/TensorFullHomZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..833f611807dbf7cfb97b5d241ed34db9f0cf9380 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/HomComplex/TensorFullHomZero.lean @@ -0,0 +1,33 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FiniteFullHomZero +import OAI.Algebra.AuslanderReiten.Stable.TensorStableEnd +import OAI.Algebra.AuslanderReiten.Cones.ConcreteTwoConeEvaluation + +namespace OAI + +noncomputable section +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.A +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) + +def simpleComplete := (simpleFiniteModule q).completeCochain (AFrobeniusTrace k q) + +def fullHomZeroScalarEquiv (hq1 : 1+q ≠ 0) : + CohomologyClass (simpleComplete q) (simpleComplete q) 0 ≃ₗ[k] k := + (FiniteLeftModule.fullHomZeroEquiv (AFrobeniusTrace k q) + (simpleFiniteModule q) (simpleFiniteModule q)).trans (stableEndEquiv q hq1) + +@[simp] +theorem fullHomZeroScalarEquiv_identity (hq1 : 1+q ≠ 0) : + fullHomZeroScalarEquiv q hq1 (CohomologyClass.mk (Cocycle.ofHom (𝟙 (simpleComplete q)))) = 1 := by + change stableEndEquiv q hq1 (FiniteLeftModule.fullHomZeroEquiv (AFrobeniusTrace k q) + (simpleFiniteModule q) (simpleFiniteModule q) _) = 1 + erw [FiniteLeftModule.fullHomZeroEquiv_identity, stableEndEquiv_identity] + +end ArExplicit.A + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/AEndHomScalar.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/AEndHomScalar.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3349f7752ee9331e94d5c6ced0e87e99315fffd --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/AEndHomScalar.lean @@ -0,0 +1,25 @@ +import OAI.Algebra.AuslanderReiten.Ext.AExtZero + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped ModuleCat.Algebra +namespace ArExplicit.Resolution +universe u +variable {k : Type u} [Field k] (q : k) (hq1 : 1+q ≠ 0) +include hq1 + +theorem aEndHom_scalar (f : ArExplicit.A.Simple q ⟶ ArExplicit.A.Simple q) : + ∃ c : k, ∀ x : ArExplicit.A.Simple q, f.hom x = (algebraMap k (ArExplicit.A k q) c) • x := by + refine ⟨ArExplicit.A.endScalar q f.hom, ?_⟩ + intro x + have hf := DFunLike.congr_fun (ArExplicit.A.end_eq_scalar_id q hq1 f.hom) x + change f.hom x = ArExplicit.A.endScalar q f.hom • x at hf + exact hf.trans (IsScalarTower.algebraMap_smul (ArExplicit.A k q) _ _).symm + +end ArExplicit.Resolution + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/BifunctorHomotopyEquiv.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/BifunctorHomotopyEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..72435065c7fce8e59c408644461e3c7a1b1340ae --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/BifunctorHomotopyEquiv.lean @@ -0,0 +1,64 @@ +import Mathlib.Algebra.Homology.BifunctorHomotopy + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory CategoryTheory.Limits HomologicalComplex + +universe u₁ u₂ u₃ v₁ v₂ v₃ + +variable {C₁ : Type u₁} {C₂ : Type u₂} {D : Type u₃} + [Category.{v₁} C₁] [Category.{v₂} C₂] [Category.{v₃} D] + [Preadditive C₁] [Preadditive C₂] [Preadditive D] + {c : ComplexShape ℕ} [TotalComplexShape c c c] + (F : C₁ ⥤ C₂ ⥤ D) [F.Additive] [∀ X, (F.obj X).Additive] + [∀ (P : HomologicalComplex C₁ c) (Q : HomologicalComplex C₂ c), + HasMapBifunctor P Q F c] + +theorem totalMap_id (P : HomologicalComplex C₁ c) (Q : HomologicalComplex C₂ c) : + mapBifunctorMap (𝟙 P) (𝟙 Q) F c = 𝟙 _ := by + ext n : 1 + apply mapBifunctor.hom_ext + intro i j h + simp + +theorem totalMap_comp {P P' P'' : HomologicalComplex C₁ c} + {Q Q' Q'' : HomologicalComplex C₂ c} (f : P ⟶ P') (f' : P' ⟶ P'') + (g : Q ⟶ Q') (g' : Q' ⟶ Q'') : + mapBifunctorMap f g F c ≫ + mapBifunctorMap f' g' F c = + mapBifunctorMap (f ≫ f') (g ≫ g') F c := by + ext n : 1 + apply mapBifunctor.hom_ext + intro i j h + simp only [comp_f, Category.assoc, ι_mapBifunctorMap_assoc, ι_mapBifunctorMap, + Functor.map_comp, NatTrans.comp_app] + simp only [NatTrans.naturality_assoc] + +def totalHomotopyEquiv {P P' : HomologicalComplex C₁ c} {Q Q' : HomologicalComplex C₂ c} + (e : HomotopyEquiv P P') (f : HomotopyEquiv Q Q') : + HomotopyEquiv (mapBifunctor P Q F c) + (mapBifunctor P' Q' F c) where + hom := mapBifunctorMap e.hom f.hom F c + inv := mapBifunctorMap e.inv f.inv F c + homotopyHomInvId := + (Homotopy.ofEq (totalMap_comp F e.hom e.inv f.hom f.inv)).trans + ((mapBifunctorMapHomotopy₁ e.homotopyHomInvId (f.hom ≫ f.inv) F + c).trans + ((mapBifunctorMapHomotopy₂ (𝟙 P) f.homotopyHomInvId F + c).trans (Homotopy.ofEq (totalMap_id F P Q)))) + homotopyInvHomId := + (Homotopy.ofEq (totalMap_comp F e.inv e.hom f.inv f.hom)).trans + ((mapBifunctorMapHomotopy₁ e.homotopyInvHomId (f.inv ≫ f.hom) F + c).trans + ((mapBifunctorMapHomotopy₂ (𝟙 P') f.homotopyInvHomId F + c).trans (Homotopy.ofEq (totalMap_id F P' Q')))) + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/ChainComparisonIso.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/ChainComparisonIso.lean new file mode 100644 index 0000000000000000000000000000000000000000..4ae15abdf03074704f5a469ccbcd06c0c9cde513 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/ChainComparisonIso.lean @@ -0,0 +1,20 @@ +import Mathlib.Algebra.Homology.HomologicalComplex + +namespace OAI + +namespace ArExplicit +open CategoryTheory +universe u v +variable {C : Type u} [Category.{v} C] [Limits.HasZeroMorphisms C] {P Q R : ChainComplex C ℕ} + +theorem comparisonIso_trans (e : P ≅ Q) (f : Q ≅ R) (m n : ℕ) + (p : P.X m ⟶ P.X n) (q : Q.X m ⟶ Q.X n) (r : R.X m ⟶ R.X n) + (he : p ≫ e.hom.f n = e.hom.f m ≫ q) + (hf : q ≫ f.hom.f n = f.hom.f m ≫ r) : + p ≫ (e ≪≫ f).hom.f n = (e ≪≫ f).hom.f m ≫ r := by + change p ≫ (e.hom.f n ≫ f.hom.f n) = (e.hom.f m ≫ f.hom.f m) ≫ r + rw [← Category.assoc, he, Category.assoc, hf, ← Category.assoc] + +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/CochainCycleClass.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/CochainCycleClass.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a4949856a98de4311cad69d351dac17ace93f3c --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/CochainCycleClass.lean @@ -0,0 +1,69 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.HomCochainExtClass + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits HomologicalComplex +namespace ArExplicit.VectorCochain +universe u +variable (k : Type u) [Field k] +variable (P : CochainComplex (ModuleCat.{u} k) ℕ) + +def literalCyclesIso (n : ℕ) := + P.cyclesIsoSc' (n-1) n (n+1) (by cases n <;> simp) (by simp) ≪≫ + (P.sc' (n-1) n (n+1)).moduleCatCyclesIso + +def literalClass (n : ℕ) (x : LinearMap.ker (P.d n (n+1)).hom) : P.homology n := + (P.homologyπ n).hom ((literalCyclesIso k P n).inv.hom x) + +@[simp] theorem literalCyclesIso_inv_iCycles (n : ℕ) + (x : LinearMap.ker (P.d n (n+1)).hom) : + (P.iCycles n).hom ((literalCyclesIso k P n).inv.hom x) = x.val := by + have he : (literalCyclesIso k P n).inv ≫ P.iCycles n = + ModuleCat.ofHom (LinearMap.ker (P.d n (n+1)).hom).subtype := by + simp only [literalCyclesIso, Iso.trans_inv, Category.assoc, + P.cyclesIsoSc'_inv_iCycles] + exact (P.sc' (n-1) n (n+1)).moduleCatCyclesIso_inv_iCycles + exact congrArg (fun f => f.hom x) he + +theorem literalClass_eq_quotient (n : ℕ) + (x : LinearMap.ker (P.d n (n+1)).hom) : + literalClass k P n x = + ((P.homologyIsoSc' (n-1) n (n+1) (by cases n <;> simp) (by simp)).inv).hom + ((P.sc' (n-1) n (n+1)).moduleCatHomologyIso.inv.hom (Submodule.Quotient.mk x)) := by + have he : (literalCyclesIso k P n).inv ≫ P.homologyπ n = + (P.sc' (n-1) n (n+1)).moduleCatLeftHomologyData.π ≫ + (P.sc' (n-1) n (n+1)).moduleCatHomologyIso.inv ≫ + (P.homologyIsoSc' (n-1) n (n+1) (by cases n <;> simp) (by simp)).inv := by + simp only [literalCyclesIso, Iso.trans_inv, Category.assoc] + rw [← P.π_homologyIsoSc'_inv (n-1) n (n+1) (by cases n <;> simp) (by simp), + ← Category.assoc, ShortComplex.moduleCatCyclesIso_inv_π, Category.assoc] + exact congrArg (fun f => f.hom x) he + +variable {P} {Q : CochainComplex (ModuleCat.{u} k) ℕ} + +theorem literalClass_map (f : P ⟶ Q) (n : ℕ) + (x : LinearMap.ker (P.d n (n+1)).hom) + (y : LinearMap.ker (Q.d n (n+1)).hom) + (hxy : (f.f n).hom x.val = y.val) : + (homologyMap f n).hom (literalClass k P n x) = literalClass k Q n y := by + have hc : (cyclesMap f n).hom ((literalCyclesIso k P n).inv.hom x) = + (literalCyclesIso k Q n).inv.hom y := by + apply (ModuleCat.mono_iff_injective (Q.iCycles n)).mp inferInstance + have hh := congrArg (fun u => u.hom ((literalCyclesIso k P n).inv.hom x)) + (cyclesMap_i f n) + simp only [ModuleCat.hom_comp, LinearMap.comp_apply, literalCyclesIso_inv_iCycles] at hh ⊢ + exact hh.trans hxy + have hh := congrArg (fun u => u.hom ((literalCyclesIso k P n).inv.hom x)) + (homologyπ_naturality f n) + change (homologyMap f n).hom ((P.homologyπ n).hom _) = _ + rw [show (homologyMap f n).hom ((P.homologyπ n).hom ((literalCyclesIso k P n).inv.hom x)) = + (Q.homologyπ n).hom ((cyclesMap f n).hom ((literalCyclesIso k P n).inv.hom x)) from hh] + rw [hc] + rfl + +end ArExplicit.VectorCochain + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/CochainNatTensorSigns.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/CochainNatTensorSigns.lean new file mode 100644 index 0000000000000000000000000000000000000000..f1f69ea98ac10f02dd6372ec85dab47c0fd8a71a --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/CochainNatTensorSigns.lean @@ -0,0 +1,19 @@ +import Mathlib.Algebra.Homology.ComplexShapeSigns + +namespace OAI + +namespace ArExplicit + +instance cochainNatTensorSigns : ComplexShape.TensorSigns (ComplexShape.up ℕ) where + ε' := MonoidHom.mk' (fun (i : Multiplicative ℕ) => (-1 : ℤˣ)^i.toAdd) + (fun i j => pow_add (-1 : ℤˣ) i.toAdd j.toAdd) + rel_add p q r (h : p+1=q) := by change (p+r)+1=q+r; omega + add_rel p q r (h : p+1=q) := by change (r+p)+1=r+q; omega + ε'_succ := by + rintro p _ rfl + change (-1 : ℤˣ)^(p+1) = -(-1 : ℤˣ)^p + exact (pow_succ (-1 : ℤˣ) p).trans (by simp) + +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/CochainNullhomotopy.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/CochainNullhomotopy.lean new file mode 100644 index 0000000000000000000000000000000000000000..2866b0be004b7394784a10dacdfef18df4d470b6 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/CochainNullhomotopy.lean @@ -0,0 +1,66 @@ +import OAI.Algebra.AuslanderReiten.Cones.CochainCokernel +import OAI.Algebra.AuslanderReiten.Complete.CompleteNullhomotopy + +namespace OAI + +noncomputable section +open CategoryTheory HomologicalComplex + +namespace ArExplicit.CompleteComparison + +universe u +variable {R : Type u} [Ring R] +variable {K L M : CochainComplex (ModuleCat.{u} R) ℤ} + +@[simp] +theorem cochainCokernelMap_comp (f : K ⟶ L) (g : L ⟶ M) : + cochainCokernelMap (f ≫ g) = (cochainCokernelMap g).comp (cochainCokernelMap f) := by + apply LinearMap.ext + intro x + obtain ⟨x, rfl⟩ := (LinearMap.range (K.d (-1) 0).hom).mkQ_surjective x + rfl + +@[simp] +theorem cochainCokernelMap_sub (f g : K ⟶ L) : + cochainCokernelMap (f - g) = cochainCokernelMap f - cochainCokernelMap g := by + apply LinearMap.ext + intro x + obtain ⟨x, rfl⟩ := (LinearMap.range (K.d (-1) 0).hom).mkQ_surjective x + change Submodule.Quotient.mk ((f.f 0).hom x - (g.f 0).hom x) = _ + exact Submodule.Quotient.mk_sub _ + +theorem cochain_nullhomotopy_of_cokernel_zero + (hK : TotallyAcyclicCochain K) (hL : ExactProjectiveCochain L) + (f : K ⟶ L) (hf : cochainCokernelMap f = 0) : + ∃ H : Homotopy f 0, H.hom 1 0 = 0 := by + have hz : cokernelMap (extendMap f negIndexEmbedding) 0 = 0 := by + apply LinearMap.ext + intro x + apply (cochainCokernelLinearEquiv L).injective + have hh := DFunLike.congr_fun (cochainCokernelLinearEquiv_natural f) x + rw [hf] at hh + simpa using hh + obtain ⟨H, hH⟩ := nullhomotopy_of_cokernel_zero hK.to_chain hL.to_chain + (extendMap f negIndexEmbedding) hz + let H' : Homotopy (extendMap f negIndexEmbedding) (extendMap (0 : K ⟶ L) negIndexEmbedding) := + H.trans (Homotopy.ofEq (extendMap_zero K L negIndexEmbedding).symm) + refine ⟨H'.ofExtend, ?_⟩ + change (K.extendXIso negIndexEmbedding (i := 1) (i' := -1) rfl).inv ≫ H'.hom (-1) 0 ≫ + (L.extendXIso negIndexEmbedding (i := 0) (i' := 0) rfl).hom = 0 + have hs : H'.hom (-1) 0 = 0 := by + simp [H', Homotopy.trans_hom, hH] + simp [hs] + +theorem cochain_homotopy_of_cokernel_eq + (hK : TotallyAcyclicCochain K) (hL : ExactProjectiveCochain L) + (f g : K ⟶ L) (hfg : cochainCokernelMap f = cochainCokernelMap g) : + ∃ H : Homotopy f g, H.hom 1 0 = 0 := by + obtain ⟨H, hH⟩ := cochain_nullhomotopy_of_cokernel_zero hK hL (f - g) (by + rw [cochainCokernelMap_sub, hfg, sub_self]) + exact ⟨Homotopy.equivSubZero.symm H, hH⟩ + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/CoefficientComplexValues.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/CoefficientComplexValues.lean new file mode 100644 index 0000000000000000000000000000000000000000..b753824524fb5878ed00c97d1f9e6066b703a938 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/CoefficientComplexValues.lean @@ -0,0 +1,28 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingCoefficientComplex + +namespace OAI + +noncomputable section +namespace ArExplicit.EnvelopingBimodule +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +variable {X Y : ModuleCat.{u} R} +variable [Module k X] [IsScalarTower k R X] [Module k Y] [IsScalarTower k R Y] +variable (e : X ≅ Y) (P : ChainComplex (ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)) ℕ) + +theorem coefficientComplexIso_f (n : ℕ) : + (coefficientComplexIso k R e P).hom.f n = (evaluationCoefficientIso k R e).hom.app (P.X n) := rfl + +theorem coefficientComplexIso_tmul (n : ℕ) (z : EnvelopingBimodule k R (P.X n)) (x : X) : + (coefficientComplexIso k R e P).hom.f n (BalancedTensor.tmul z x) = + BalancedTensor.tmul z (e.hom x) := by + rw [coefficientComplexIso_f] + exact evaluationCoefficientIso_tmul k R e (P.X n) z x + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/ConcentratedNatDerived.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/ConcentratedNatDerived.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ad1912d5fd09c6994e5e74ff5f1e7d757de2cd8 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/ConcentratedNatDerived.lean @@ -0,0 +1,35 @@ +import OAI.Algebra.AuslanderReiten.Homology.DerivedSingle +import Mathlib.Algebra.Homology.Embedding.ExtendHomology + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit +universe u v +variable {C : Type u} [Category.{v} C] [Abelian C] + +theorem concentratedNat_exact (K : ChainComplex C ℕ) (n : ℕ) + (hex : ∀ m : ℕ, m ≠ n → K.ExactAt m) (i : ℤ) (hi : i ≠ -(n : ℤ)) : + (K.extend ComplexShape.embeddingDownNat).ExactAt i := by + by_cases hh : ∃ m : ℕ, -(m : ℤ) = i + · obtain ⟨m, rfl⟩ := hh + exact (K.extend_exactAt_iff ComplexShape.embeddingDownNat (j := m) rfl).mpr + (hex m (by omega)) + · exact K.extend_exactAt ComplexShape.embeddingDownNat i (by intro m hm; exact hh ⟨m, hm⟩) + +def concentratedNatDerivedIso [HasDerivedCategory C] + (K : ChainComplex C ℕ) (n : ℕ) (X : C) + (hex : ∀ m : ℕ, m ≠ n → K.ExactAt m) (e : K.homology n ≅ X) : + DerivedCategory.Q.obj (K.extend ComplexShape.embeddingDownNat) ≅ + ((DerivedCategory.singleFunctor C 0).obj X)⟦(n : ℤ)⟧ := + derivedSingleIso _ (-(n : ℤ)) (concentratedNat_exact K n hex) ≪≫ + (DerivedCategory.singleFunctor C (-(n : ℤ))).mapIso + (K.extendHomologyIso ComplexShape.embeddingDownNat (j := n) rfl ≪≫ e) ≪≫ + (((DerivedCategory.singleFunctors C).shiftIso (n : ℤ) (-(n : ℤ)) 0 (by omega)).app X).symm + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/DerivedHomVanishing.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/DerivedHomVanishing.lean new file mode 100644 index 0000000000000000000000000000000000000000..08eef497d9736ff33252d7b5000210cdf798831a --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/DerivedHomVanishing.lean @@ -0,0 +1,38 @@ +import Mathlib.Algebra.Homology.DerivedCategory.KProjective +import Mathlib.Algebra.Homology.HomotopyCategory.HomComplexSingle + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit +universe u v +variable {C : Type u} [Category.{v} C] [Abelian C] [HasDerivedCategory C] +open CochainComplex.HomComplex + +def fullCohomologyDerivedEquiv (K L : CochainComplex C ℤ) (n : ℤ) [K.IsKProjective] : + CohomologyClass K L n ≃ (DerivedCategory.Q.obj K ⟶ (DerivedCategory.Q.obj L)⟦n⟧) := + CohomologyClass.homAddEquiv.toEquiv.trans + ((Equiv.ofBijective DerivedCategory.Qh.map + (CochainComplex.IsKProjective.Qh_map_bijective K + ((HomotopyCategory.quotient C _).obj (L⟦n⟧)))).trans + (Iso.homCongr ((DerivedCategory.quotientCompQhIso C).app K) + (((DerivedCategory.quotientCompQhIso C).app (L⟦n⟧)) ≪≫ + (DerivedCategory.Q.commShiftIso n).app L))) + +theorem derivedHom_zero_of_cochain_zero (K L : CochainComplex C ℤ) (n : ℤ) + [K.IsKProjective] (h : ∀ a : Cochain K L n, a = 0) + (f : DerivedCategory.Q.obj K ⟶ (DerivedCategory.Q.obj L)⟦n⟧) : f = 0 := by + have hc : ∀ a : CohomologyClass K L n, a = 0 := by + intro a + obtain ⟨b, rfl⟩ := CohomologyClass.mk_surjective a + have hb : b = 0 := Subtype.ext (h b.val) + rw [hb, CohomologyClass.mk_zero] + have : Subsingleton (CohomologyClass K L n) := ⟨fun a b => (hc a).trans (hc b).symm⟩ + exact (fullCohomologyDerivedEquiv K L n).symm.injective (Subsingleton.elim _ _) + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/DerivedSingle.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/DerivedSingle.lean new file mode 100644 index 0000000000000000000000000000000000000000..a58c0667081413fafb992b413cce48c7ef862648 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/DerivedSingle.lean @@ -0,0 +1,31 @@ +import Mathlib.Algebra.Homology.DerivedCategory.TStructure +import Mathlib.Algebra.Homology.DerivedCategory.FullyFaithful + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit +universe u v w +variable {C : Type u} [Category.{v} C] [Abelian C] [HasDerivedCategory.{w} C] + +def derivedSingleIso (K : CochainComplex C ℤ) (n : ℤ) + (hex : ∀ i : ℤ, i ≠ n → K.ExactAt i) : + DerivedCategory.Q.obj K ≅ (DerivedCategory.singleFunctor C n).obj (K.homology n) := Classical.choice (by + let : K.IsGE n := (CochainComplex.isGE_iff K n).mpr (fun i hi => hex i (ne_of_lt hi)) + let : K.IsLE n := (CochainComplex.isLE_iff K n).mpr (fun i hi => hex i (ne_of_gt hi)) + let : (DerivedCategory.Q.obj K).IsGE n := (DerivedCategory.isGE_Q_obj_iff K n).mpr inferInstance + let : (DerivedCategory.Q.obj K).IsLE n := (DerivedCategory.isLE_Q_obj_iff K n).mpr inferInstance + obtain ⟨M, ⟨e⟩⟩ := DerivedCategory.exists_iso_singleFunctor_obj_of_isGE_of_isLE + (DerivedCategory.Q.obj K) n + let h : K.homology n ≅ M := + ((DerivedCategory.homologyFunctorFactors C n).app K).symm ≪≫ + (DerivedCategory.homologyFunctor C n).mapIso e ≪≫ + (DerivedCategory.singleFunctorCompHomologyFunctorIso C n).app M + exact ⟨e ≪≫ (DerivedCategory.singleFunctor C n).mapIso h.symm⟩) + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/DimensionOneDetector.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/DimensionOneDetector.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9ef133af5775d8e7e08f7be15d003fea67fb4fc --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/DimensionOneDetector.lean @@ -0,0 +1,48 @@ +import Mathlib.LinearAlgebra.Dual.Defs + +namespace OAI + +noncomputable section +namespace ArExplicit +universe u v w +variable {k : Type u} [Field k] +variable {V : Type v} [AddCommGroup V] [Module k V] +variable {W : Type w} [AddCommGroup W] [Module k W] + +theorem scalarChart_eq_smul (e : V ≃ₗ[k] k) (x : V) : x = e x • e.symm 1 := by + apply e.injective + rw [map_smul, e.apply_symm_apply] + exact (mul_one _).symm + +theorem scalarDetector_injective (e : V ≃ₗ[k] k) (d : V →ₗ[k] W) + (x : V) (hx : d x ≠ 0) : Function.Injective d := by + have hg : d (e.symm 1) ≠ 0 := by + intro hz + apply hx + rw [scalarChart_eq_smul e x, map_smul, hz, smul_zero] + apply (injective_iff_map_eq_zero d).mpr + intro z hz + have hs : e z = 0 := by + have h := hz + rw [scalarChart_eq_smul e z, map_smul] at h + by_contra he + apply hg + calc + d (e.symm 1) = (e z)⁻¹ • (e z • d (e.symm 1)) := by + rw [← mul_smul, inv_mul_cancel₀ he, one_smul] + _ = 0 := by rw [h, smul_zero] + exact e.injective (hs.trans (map_zero e).symm) + +theorem scalarDetector_common (e : V ≃ₗ[k] k) (d : V →ₗ[k] W) + (x y : V) (b : W) (hb : b ≠ 0) (hx : d x = b) (hy : d y = b) : + x = y ∧ x ≠ 0 := by + have hdx : d x ≠ 0 := hx ▸ hb + refine ⟨scalarDetector_injective e d x hdx (hx.trans hy.symm), ?_⟩ + intro hz + exact hdx (hz ▸ map_zero d) + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/ExceptionalHomology.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/ExceptionalHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3b108c4694979f453ad2860c7b2de6889fd7779 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/ExceptionalHomology.lean @@ -0,0 +1,78 @@ +import OAI.Algebra.AuslanderReiten.Duality.DualResolution +import OAI.Algebra.AuslanderReiten.Algebras.SimpleDual +import OAI.Algebra.AuslanderReiten.Duality.RightDualHomology + +namespace OAI + +noncomputable section +namespace ArExplicit.Resolution +open ArExplicit.Letter ArExplicit.BaseAlgebra +variable {k : Type*} [Field k] [CharP k 2] (q : k) +local notation "C" => BaseAlgebra k q + +theorem exceptional_differential_comp : (leftEll q q).comp (leftEll q 1) = 0 := by + apply LinearMap.ext + intro a + apply Subtype.ext + change ell q q * (ell q 1 * (a : C)) = 0 + rw [← mul_assoc, show ell q q * ell q 1 = 0 by simpa using ell_successor_mul q 1, zero_mul] + +abbrev ExceptionalHomology := RightDualHomology.Homology + (leftEll q 1) (leftEll q q) (exceptional_differential_comp q) + +def exceptionalCyclesMap (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) : + LinearMap.ker (leftEll q q) →ₗ[Cᵐᵒᵖ] Simple q where + toFun a := (a.val : C).coeff v • generator q + map_add' a b := add_smul _ _ _ + map_smul' c a := by + change ((a.val : C) * c.unop).coeff v • generator q = + c.unop.coeff f • ((a.val : C).coeff v • generator q) + rw [exceptional_right_action q hq hq1 a.val a.property c.unop, mul_comm, mul_smul] + +theorem exceptionalCyclesMap_surjective (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) : + Function.Surjective (exceptionalCyclesMap q hq hq1) := by + intro s + let r := simpleCoordinate q s + refine ⟨⟨r • exceptionalCycle q, ?_⟩, ?_⟩ + · change leftEll q q (r • exceptionalCycle q) = 0 + rw [LinearMap.map_smul_of_tower, exceptionalCycle_closed] + exact @smul_zero k (rightE q) inferInstance inferInstance r + · change ((r • (exceptionalCycle q : C)).coeff v) • generator q = s + simpa [exceptionalCycle, r] using (simple_expand q hq1 s).symm + +theorem exceptionalCyclesMap_kernel (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) : + LinearMap.ker (exceptionalCyclesMap q hq hq1) = + RightDualHomology.boundaries (leftEll q 1) (leftEll q q) (exceptional_differential_comp q) := by + ext a + constructor + · intro ha + have hv : (a.val : C).coeff v = 0 := by + have hh := congrArg (simpleCoordinate q) ha + change simpleCoordinate q ((a.val : C).coeff v • generator q) = simpleCoordinate q 0 at hh + simpa using hh + obtain ⟨b, hb⟩ := (exceptional_boundary_iff q hq hq1 a.val a.property).mpr hv + exact ⟨b, Subtype.ext hb⟩ + · rintro ⟨b, hb⟩ + have he : leftEll q 1 b = a.val := congrArg Subtype.val hb + have hv := (exceptional_boundary_iff q hq hq1 a.val a.property).mp ⟨b, he⟩ + change (a.val : C).coeff v • generator q = 0 + rw [hv, zero_smul] + +def exceptionalHomologyEquiv (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) : + ExceptionalHomology q ≃ₗ[Cᵐᵒᵖ] Simple q := + (Submodule.quotEquivOfEq _ _ (exceptionalCyclesMap_kernel q hq hq1).symm).trans + ((exceptionalCyclesMap q hq hq1).quotKerEquivOfSurjective + (exceptionalCyclesMap_surjective q hq hq1)) + +def exceptionalDualHomologyEquiv (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) : + RightDualHomology.DualHomology (k := k) (leftEll q 1) (leftEll q q) + (exceptional_differential_comp q) ≃ₗ[C] Simple q := + (RightDualHomology.dualHomologyEquiv _ _ _).symm.trans + ((RightDual.congr (exceptionalHomologyEquiv q hq hq1)).symm.trans + (rightSimpleDualEquiv q hq1)) + +end ArExplicit.Resolution + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveComposite.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveComposite.lean new file mode 100644 index 0000000000000000000000000000000000000000..9bf455e9abd5b6217242b5df8d078b33b05f42ec --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveComposite.lean @@ -0,0 +1,35 @@ +import OAI.Algebra.AuslanderReiten.Homology.FullPositiveModel + +namespace OAI + +noncomputable section +namespace ArExplicit.FullPositive +open CategoryTheory CategoryTheory.Abelian +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable (K : CochainComplex (ModuleCat.{u} R) ℤ) (X : ModuleCat.{u} R) +variable {C : ℕ → Type u} [∀ n, AddCommGroup (C n)] [∀ n, Module k (C n)] + +def modelOfComposite (D : NonnegativeChart (k := k) K X) + (e : ∀ n, Ext X X n ≃ₗ[k] C n) + (f : ∀ n, C (3*n) ≃ₗ[k] BinaryKoszul.Piece k n) + (p q : Ext X X 3) + (off : ∀ n, (¬ 3 ∣ n) → ∀ x : Ext X X n, x=0) + (lx : ∀ n (x : Ext X X (3*n)), + f (n+1) (e (3*n+3) (p.comp x (by omega))) = BinaryKoszul.mulX k n (f n (e (3*n) x))) + (ly : ∀ n (x : Ext X X (3*n)), + f (n+1) (e (3*n+3) (q.comp x (by omega))) = BinaryKoszul.mulY k n (f n (e (3*n) x))) + (rx : ∀ n (x : Ext X X (3*n)), + f (n+1) (e (3*n+3) (x.comp p (by omega))) = BinaryKoszul.mulX k n (f n (e (3*n) x))) + (ry : ∀ n (x : Ext X X (3*n)), + f (n+1) (e (3*n+3) (x.comp q (by omega))) = BinaryKoszul.mulY k n (f n (e (3*n) x))) : + FullTate.PositiveModel (k := k) K ((D.equiv 3).symm p) ((D.equiv 3).symm q) := + model K X D (fun n => (e (3*n)).trans (f n)) p q off lx ly rx ry + +end ArExplicit.FullPositive + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveFunctorAction.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveFunctorAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f1e685251975a8bf7fede450a9591c2dd14b2f7 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveFunctorAction.lean @@ -0,0 +1,63 @@ +import OAI.Algebra.AuslanderReiten.Homology.FullPositiveNaturality +import OAI.Algebra.AuslanderReiten.Complete.CompleteTailCanonical +import OAI.Algebra.AuslanderReiten.Ext.ExtIsoFunctor + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian CategoryTheory.Limits HomologicalComplex +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.CompleteComparison +universe u +variable {k R : Type u} [Field k] [CharP k 2] [Ring R] [Algebra k R] +variable [HasDerivedCategory (ModuleCat.{u} R)] +variable (F : ModuleCat.{u} R ⥤ ModuleCat.{u} R) [F.Additive] + [PreservesFiniteLimits F] [PreservesFiniteColimits F] [F.PreservesProjectiveObjects] +variable (K : CochainComplex (ModuleCat.{u} R) ℤ) +variable (hK : TotallyAcyclicComplex (chainOfCochain K)) +variable (hFK : TotallyAcyclicComplex (chainOfCochain (functorComplex F K))) + +theorem fullPositiveExtEquiv_conjugatedFunctor + (a : K ⟶ functorComplex F K) (b : functorComplex F K ⟶ K) + (E : ModuleCat.of R (Cokernel (chainOfCochain K) 0) ≅ + F.obj (ModuleCat.of R (Cokernel (chainOfCochain K) 0))) + (ha : ModuleCat.ofHom (cokernelMap (extendMap a negIndexEmbedding) 0) ≫ + (completeFunctorEndpointIso F K hK hFK).hom = E.hom) + (hb : (completeFunctorEndpointIso F K hK hFK).inv ≫ + ModuleCat.ofHom (cokernelMap (extendMap b negIndexEmbedding) 0) = E.inv) + (n : ℕ) (x : CohomologyClass K K ((n+1 : ℕ) : ℤ)) : + fullPositiveExtEquiv (k := k) K K hK hK.toExactProjectiveComplex n + (fullHomPostcomp b _ (fullHomPrecomp a _ (mapFullHom F K K _ x))) = + selfExtIso (k := k) E.symm (n+1) + ((fullPositiveExtEquiv (k := k) K K hK hK.toExactProjectiveComplex n x).mapExactFunctor F) := by + rw [fullPositiveExtEquiv_postcomp hK hFK.toExactProjectiveComplex hK.toExactProjectiveComplex, + fullPositiveExtEquiv_precomp hK hFK hFK.toExactProjectiveComplex] + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + rw [mapFullHom_mk, fullPositiveExtEquiv_functor F K hK hFK] + simp only [selfExtIso_apply, Iso.symm_inv, Iso.symm_hom] + simp only [Ext.comp_assoc_of_third_deg_zero, Ext.mk₀_comp_mk₀_assoc, + Ext.mk₀_comp_mk₀, ha, hb] + +theorem fullHom_conjugatedFunctor_scalar + (a : K ⟶ functorComplex F K) (b : functorComplex F K ⟶ K) + (E : ModuleCat.of R (Cokernel (chainOfCochain K) 0) ≅ + F.obj (ModuleCat.of R (Cokernel (chainOfCochain K) 0))) + (ha : ModuleCat.ofHom (cokernelMap (extendMap a negIndexEmbedding) 0) ≫ + (completeFunctorEndpointIso F K hK hFK).hom = E.hom) + (hb : (completeFunctorEndpointIso F K hK hFK).inv ≫ + ModuleCat.ofHom (cokernelMap (extendMap b negIndexEmbedding) 0) = E.inv) + (n : ℕ) (c : k) + (hscalar : ∀ z : Ext (ModuleCat.of R (Cokernel (chainOfCochain K) 0)) + (ModuleCat.of R (Cokernel (chainOfCochain K) 0)) (n+1), + selfExtIso (k := k) E.symm (n+1) (z.mapExactFunctor F) = c • z) + (x : CohomologyClass K K ((n+1 : ℕ) : ℤ)) : + fullHomPostcomp b _ (fullHomPrecomp a _ (mapFullHom F K K _ x)) = c • x := by + apply (fullPositiveExtEquiv (k := k) K K hK hK.toExactProjectiveComplex n).injective + rw [fullPositiveExtEquiv_conjugatedFunctor F K hK hFK a b E ha hb, hscalar, map_smul] + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveModel.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5cf3255486f638c11f551650e6f96c53826486f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveModel.lean @@ -0,0 +1,92 @@ +import OAI.Algebra.AuslanderReiten.Complete.FullTateModel +import OAI.Algebra.AuslanderReiten.Ext.ExtIsoCongr + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.FullPositive +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable (K : CochainComplex (ModuleCat.{u} R) ℤ) (X : ModuleCat.{u} R) +open CompleteComparison TateKoszul +local notation "H" => CohomologyClass K K + +structure NonnegativeChart where + equiv : ∀ n : ℕ, H (n:ℤ) ≃ₗ[k] Ext X X n + product : ∀ (n m : ℕ) (x : H (n:ℤ)) (y : H (m:ℤ)), + equiv (n+m) (degreeEquiv (k := k) H (show (n:ℤ)+(m:ℤ)=((n+m:ℕ):ℤ) by omega) + (fullHomProduct x y)) = (equiv n x).comp (equiv m y) rfl + +def atDegree (D : NonnegativeChart (k := k) K X) (a : ℤ) (n : ℕ) (ha : a=(n:ℤ)) : H a ≃ₗ[k] Ext X X n := + (degreeEquiv (k := k) H ha).trans (D.equiv n) + +theorem atDegree_product (D : NonnegativeChart (k := k) K X) (a b : ℤ) (n m r : ℕ) + (ha : a=(n:ℤ)) (hb : b=(m:ℤ)) (hr : n+m=r) + (x : H a) (y : H b) : + atDegree K X D (a+b) r (by omega) (fullHomProduct x y) = + (atDegree K X D a n ha x).comp (atDegree K X D b m hb y) hr := by + subst r + subst a + subst b + exact D.product n m x y + +def positive (D : NonnegativeChart (k := k) K X) + (f : ∀ n : ℕ, Ext X X (3*n) ≃ₗ[k] BinaryKoszul.Piece k n) (n : ℕ) : H (3*(n:ℤ)) ≃ₗ[k] BinaryKoszul.Piece k n := + (atDegree K X D (3*(n:ℤ)) (3*n) (by omega)).trans (f n) + +theorem positive_transport (D : NonnegativeChart (k := k) K X) + (f : ∀ n : ℕ, Ext X X (3*n) ≃ₗ[k] BinaryKoszul.Piece k n) (a : ℤ) (n : ℕ) (ha : a=3*(n:ℤ)) (v : H a) : + positive K X D f n (degreeEquiv (k := k) H ha v) = + f n (atDegree K X D a (3*n) (by omega) v) := by + subst a + rfl + +def model (D : NonnegativeChart (k := k) K X) + (f : ∀ n : ℕ, Ext X X (3*n) ≃ₗ[k] BinaryKoszul.Piece k n) + (p q : Ext X X 3) + (off : ∀ (n : ℕ), (¬ 3 ∣ n) → ∀ x : Ext X X n, x=0) + (lx : ∀ n (x : Ext X X (3*n)), + f (n+1) (p.comp x (by omega : 3+3*n=3*(n+1))) = BinaryKoszul.mulX k n (f n x)) + (ly : ∀ n (x : Ext X X (3*n)), + f (n+1) (q.comp x (by omega : 3+3*n=3*(n+1))) = BinaryKoszul.mulY k n (f n x)) + (rx : ∀ n (x : Ext X X (3*n)), + f (n+1) (x.comp p (by omega : 3*n+3=3*(n+1))) = BinaryKoszul.mulX k n (f n x)) + (ry : ∀ n (x : Ext X X (3*n)), + f (n+1) (x.comp q (by omega : 3*n+3=3*(n+1))) = BinaryKoszul.mulY k n (f n x)) : + FullTate.PositiveModel (k := k) K ((D.equiv 3).symm p) ((D.equiv 3).symm q) where + positive := positive K X D f + outside a ha hn := by + obtain ⟨n,rfl⟩ := Int.eq_ofNat_of_zero_le ha + have hd : ¬ 3 ∣ n := by + rintro ⟨m,hm⟩ + exact hn m (by omega) + exact ⟨fun x y => (D.equiv n).injective ((off n hd _).trans (off n hd _).symm)⟩ + right_x a n ha v := by + change positive K X D f (n+1) (degreeEquiv (k := k) H _ (fullHomProduct v ((D.equiv 3).symm p))) = _ + erw [positive_transport, atDegree_product K X D a 3 (3*n) 3 (3*(n+1)) (by omega) rfl (by omega)] + change f (n+1) ((atDegree K X D a (3*n) (by omega) v).comp (D.equiv 3 ((D.equiv 3).symm p)) _) = _ + rw [LinearEquiv.apply_symm_apply, rx, positive_transport] + right_y a n ha v := by + change positive K X D f (n+1) (degreeEquiv (k := k) H _ (fullHomProduct v ((D.equiv 3).symm q))) = _ + erw [positive_transport, atDegree_product K X D a 3 (3*n) 3 (3*(n+1)) (by omega) rfl (by omega)] + change f (n+1) ((atDegree K X D a (3*n) (by omega) v).comp (D.equiv 3 ((D.equiv 3).symm q)) _) = _ + rw [LinearEquiv.apply_symm_apply, ry, positive_transport] + left_x a n ha v := by + change positive K X D f (n+1) (degreeEquiv (k := k) H _ (fullHomProduct ((D.equiv 3).symm p) v)) = _ + erw [positive_transport, atDegree_product K X D 3 a 3 (3*n) (3*(n+1)) rfl (by omega) (by omega)] + change f (n+1) ((D.equiv 3 ((D.equiv 3).symm p)).comp (atDegree K X D a (3*n) (by omega) v) _) = _ + rw [LinearEquiv.apply_symm_apply, lx, positive_transport] + left_y a n ha v := by + change positive K X D f (n+1) (degreeEquiv (k := k) H _ (fullHomProduct ((D.equiv 3).symm q) v)) = _ + erw [positive_transport, atDegree_product K X D 3 a 3 (3*n) (3*(n+1)) rfl (by omega) (by omega)] + change f (n+1) ((D.equiv 3 ((D.equiv 3).symm q)).comp (atDegree K X D a (3*n) (by omega) v) _) = _ + rw [LinearEquiv.apply_symm_apply, ly, positive_transport] + +end ArExplicit.FullPositive + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveNaturality.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c31201b6fb50e6294135ee288f5f551ecab964c --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/FullPositiveNaturality.lean @@ -0,0 +1,54 @@ +import OAI.Algebra.AuslanderReiten.Cocycles.SourceCocycleNaturality +import OAI.Algebra.AuslanderReiten.Stable.StableExtPrecomp +import OAI.Algebra.AuslanderReiten.HomComplex.PositiveFullHomExt + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian HomologicalComplex +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.CompleteComparison +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [CharP k 2] +variable {K L M : CochainComplex (ModuleCat.{u} R) ℤ} + +theorem fullPositiveExtEquiv_precomp + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : TotallyAcyclicComplex (chainOfCochain L)) + (hM : ExactProjectiveComplex (chainOfCochain M)) + (f : K ⟶ L) (n : ℕ) (x : CohomologyClass L M ((n+1 : ℕ) : ℤ)) : + fullPositiveExtEquiv (k := k) K M hK hM n (fullHomPrecomp f _ x) = + (Ext.mk₀ (ModuleCat.ofHom (cokernelMap (extendMap f negIndexEmbedding) 0))).comp + (fullPositiveExtEquiv (k := k) L M hL hM n x) (zero_add _) := by + apply (positiveExtStableEquiv (k := k) hK + (ModuleCat.of R (Cokernel (chainOfCochain M) 0)) n).injective + rw [fullPositiveExtEquiv_stable, positiveExtStableEquiv_precomp hK hL, + fullPositiveExtEquiv_stable] + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + rw [fullHomPrecomp_mk, fullHomSourceStableLinearEquiv_mk, + fullHomSourceStableLinearEquiv_mk, StableHom.precomp_classOf, + sourceCocycleMap_precomp (k := k)] + +theorem fullPositiveExtEquiv_postcomp + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain L)) + (hM : ExactProjectiveComplex (chainOfCochain M)) + (f : L ⟶ M) (n : ℕ) (x : CohomologyClass K L ((n+1 : ℕ) : ℤ)) : + fullPositiveExtEquiv (k := k) K M hK hM n (fullHomPostcomp f _ x) = + (fullPositiveExtEquiv (k := k) K L hK hL n x).comp + (Ext.mk₀ (ModuleCat.ofHom (cokernelMap (extendMap f negIndexEmbedding) 0))) (add_zero _) := by + apply (positiveExtStableEquiv (k := k) hK + (ModuleCat.of R (Cokernel (chainOfCochain M) 0)) n).injective + rw [fullPositiveExtEquiv_stable, positiveExtStableEquiv_postcomp, + fullPositiveExtEquiv_stable] + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + rw [fullHomPostcomp_mk, fullHomSourceStableLinearEquiv_mk, + fullHomSourceStableLinearEquiv_mk, StableHom.postcomp_classOf, + sourceCocycleMap_postcomp (k := k)] + rfl + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/LinearCokernelMap.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/LinearCokernelMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..b248b196b74e5c3c6b1a76129096571e7f1c32e9 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/LinearCokernelMap.lean @@ -0,0 +1,55 @@ +import Mathlib.LinearAlgebra.Isomorphisms + +namespace OAI + +noncomputable section +namespace ArExplicit.LinearCokernel +variable {R : Type*} [Ring R] +variable {L M L' M' L'' M'' : Type*} +variable [AddCommGroup L] [Module R L] [AddCommGroup M] [Module R M] +variable [AddCommGroup L'] [Module R L'] [AddCommGroup M'] [Module R M'] +variable [AddCommGroup L''] [Module R L''] [AddCommGroup M''] [Module R M''] + +def map (d : L →ₗ[R] M) (d' : L' →ₗ[R] M') + (a : L →ₗ[R] L') (b : M →ₗ[R] M') (h : b.comp d = d'.comp a) : + (M ⧸ LinearMap.range d) →ₗ[R] (M' ⧸ LinearMap.range d') := + (LinearMap.range d).liftQ ((LinearMap.range d').mkQ.comp b) (by + rintro z ⟨x,rfl⟩ + apply (Submodule.Quotient.mk_eq_zero _).mpr + exact ⟨a x, (DFunLike.congr_fun h x).symm⟩) + +@[simp] theorem map_mk (d : L →ₗ[R] M) (d' : L' →ₗ[R] M') + (a : L →ₗ[R] L') (b : M →ₗ[R] M') (h : b.comp d = d'.comp a) (x : M) : + map d d' a b h (Submodule.Quotient.mk x) = Submodule.Quotient.mk (b x) := rfl + +private theorem inverse_square (d : L →ₗ[R] M) (d' : L' →ₗ[R] M') + (a : L ≃ₗ[R] L') (b : M ≃ₗ[R] M') (h : b.toLinearMap.comp d = d'.comp a.toLinearMap) : + b.symm.toLinearMap.comp d' = d.comp a.symm.toLinearMap := by + ext x + apply b.injective + simpa only [LinearMap.comp_apply, LinearEquiv.coe_coe, LinearEquiv.apply_symm_apply] + using (DFunLike.congr_fun h (a.symm x)).symm + +def equiv (d : L →ₗ[R] M) (d' : L' →ₗ[R] M') + (a : L ≃ₗ[R] L') (b : M ≃ₗ[R] M') (h : b.toLinearMap.comp d = d'.comp a.toLinearMap) : + (M ⧸ LinearMap.range d) ≃ₗ[R] (M' ⧸ LinearMap.range d') where + __ := map d d' a.toLinearMap b.toLinearMap h + invFun := map d' d a.symm.toLinearMap b.symm.toLinearMap (inverse_square d d' a b h) + left_inv x := by + obtain ⟨x,rfl⟩ := (LinearMap.range d).mkQ_surjective x + change Submodule.Quotient.mk (b.symm (b x)) = Submodule.Quotient.mk x + rw [LinearEquiv.symm_apply_apply] + right_inv x := by + obtain ⟨x,rfl⟩ := (LinearMap.range d').mkQ_surjective x + change Submodule.Quotient.mk (b (b.symm x)) = Submodule.Quotient.mk x + rw [LinearEquiv.apply_symm_apply] + +@[simp] theorem equiv_mk (d : L →ₗ[R] M) (d' : L' →ₗ[R] M') + (a : L ≃ₗ[R] L') (b : M ≃ₗ[R] M') (h : b.toLinearMap.comp d = d'.comp a.toLinearMap) (x : M) : + equiv d d' a b h (Submodule.Quotient.mk x) = Submodule.Quotient.mk (b x) := rfl + +end ArExplicit.LinearCokernel + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/LinearEquivActionTransfer.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/LinearEquivActionTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e2a9905cbcc8c332e102d5cb29b1d2b8348d6f3 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/LinearEquivActionTransfer.lean @@ -0,0 +1,28 @@ +import Mathlib.LinearAlgebra.Prod + +namespace OAI + +namespace ArExplicit +universe u +variable {k : Type u} [Field k] +variable {V₀ V₁ W₀ W₁ U₀ U₁ : Type u} +variable [AddCommGroup V₀] [AddCommGroup V₁] [AddCommGroup W₀] + [AddCommGroup W₁] [AddCommGroup U₀] [AddCommGroup U₁] +variable [Module k V₀] [Module k V₁] [Module k W₀] + [Module k W₁] [Module k U₀] [Module k U₁] + +theorem linearEquivActionTransfer + (e₀ : V₀ ≃ₗ[k] W₀) (e₁ : V₁ ≃ₗ[k] W₁) + (f₀ : W₀ ≃ₗ[k] U₀) (f₁ : W₁ ≃ₗ[k] U₁) + (g : W₀ → W₁) (h : U₀ → U₁) {x : V₀} {y : V₁} + (he : e₁ y = g (e₀ x)) (hf : f₁ (g (e₀ x)) = h (f₀ (e₀ x))) : + (e₁.trans f₁) y = h ((e₀.trans f₀) x) := + (congrArg f₁ he).trans hf + +theorem linearEquivEqSmul (e : V₀ ≃ₗ[k] W₀) (c : k) + {x y : V₀} {z : W₀} (he : e y = z) (hz : z = c • e x) : y = c • x := + e.injective (he.trans (hz.trans (e.map_smul c x).symm)) + +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/LinearHomologyCongr.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/LinearHomologyCongr.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f5768f5784d920e5d9e00a6ecdb8c3e27c0aacf --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/LinearHomologyCongr.lean @@ -0,0 +1,60 @@ +import OAI.Algebra.AuslanderReiten.Duality.LinearHomologyDuality + +namespace OAI + +namespace ArExplicit.LinearHomology + +universe u + +variable {k : Type u} [Field k] +variable {U V W U' V' W' : Type u} +variable [AddCommGroup U] [Module k U] [AddCommGroup V] [Module k V] +variable [AddCommGroup W] [Module k W] [AddCommGroup U'] [Module k U'] +variable [AddCommGroup V'] [Module k V'] [AddCommGroup W'] [Module k W'] +variable (f : U →ₗ[k] V) (g : V →ₗ[k] W) (h : g.comp f = 0) +variable (f' : U' →ₗ[k] V') (g' : V' →ₗ[k] W') (h' : g'.comp f' = 0) +variable (a : U ≃ₗ[k] U') (b : V ≃ₗ[k] V') (c : W ≃ₗ[k] W') +variable (hf : ∀ x, b (f x) = f' (a x)) (hg : ∀ x, c (g x) = g' (b x)) + +def cycleEquiv : LinearMap.ker g ≃ₗ[k] LinearMap.ker g' where + toFun x := ⟨b x.val, by + change g' (b x.val) = 0 + rw [← hg, x.property, map_zero]⟩ + invFun y := ⟨b.symm y.val, by + apply c.injective + rw [hg, b.apply_symm_apply, y.property, map_zero]⟩ + left_inv x := Subtype.ext (b.symm_apply_apply x.val) + right_inv y := Subtype.ext (b.apply_symm_apply y.val) + map_add' x y := Subtype.ext (b.map_add x.val y.val) + map_smul' r x := Subtype.ext (b.map_smul r x.val) + +include a hf in +theorem cycleEquiv_boundaries : + (boundaries f g h).map (cycleEquiv g g' b c hg).toLinearMap = boundaries f' g' h' := by + ext y + constructor + · rintro ⟨x, ⟨u, rfl⟩, rfl⟩ + exact ⟨a u, Subtype.ext (hf u).symm⟩ + · rintro ⟨u, rfl⟩ + refine ⟨cycleMap f g h (a.symm u), ⟨a.symm u, rfl⟩, ?_⟩ + apply Subtype.ext + change b (f (a.symm u)) = f' u + rw [hf, a.apply_symm_apply] + +def congr : Homology f g h ≃ₗ[k] Homology f' g' h' := + Submodule.Quotient.equiv _ _ (cycleEquiv g g' b c hg) + (cycleEquiv_boundaries f g h f' g' h' a b c hf hg) + +@[simp] +theorem congr_mk (x : LinearMap.ker g) : + congr f g h f' g' h' a b c hf hg ((boundaries f g h).mkQ x) = + (boundaries f' g' h').mkQ (cycleEquiv g g' b c hg x) := rfl + +@[simp] +theorem congr_symm_mk (x : LinearMap.ker g') : + (congr f g h f' g' h' a b c hf hg).symm ((boundaries f' g' h').mkQ x) = + (boundaries f g h).mkQ ((cycleEquiv g g' b c hg).symm x) := rfl + +end ArExplicit.LinearHomology + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/LinearHomotopy.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/LinearHomotopy.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7d8b80344a43283a44031cd0c2fb6953e3ea743 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/LinearHomotopy.lean @@ -0,0 +1,116 @@ +import OAI.Algebra.AuslanderReiten.Complete.CompleteResolution + +namespace OAI + +namespace ArExplicit + +universe u + +variable {R : Type u} [Ring R] +variable {P₂ P₁ P₀ Q₃ Q₂ Q₁ : Type u} +variable [AddCommGroup P₂] [Module R P₂] [AddCommGroup P₁] [Module R P₁] +variable [AddCommGroup P₀] [Module R P₀] [AddCommGroup Q₃] [Module R Q₃] +variable [AddCommGroup Q₂] [Module R Q₂] [AddCommGroup Q₁] [Module R Q₁] + +theorem extend_homotopy_up [Module.Projective R P₂] + (p₂ : P₂ →ₗ[R] P₁) (p₁ : P₁ →ₗ[R] P₀) (hp : p₁.comp p₂ = 0) + (q₃ : Q₃ →ₗ[R] Q₂) (q₂ : Q₂ →ₗ[R] Q₁) + (hq : LinearMap.range q₃ = LinearMap.ker q₂) + (f₂ : P₂ →ₗ[R] Q₂) (f₁ : P₁ →ₗ[R] Q₁) + (hc : q₂.comp f₂ = f₁.comp p₂) + (h₁ : P₁ →ₗ[R] Q₂) (h₀ : P₀ →ₗ[R] Q₁) + (hh : f₁ = q₂.comp h₁ + h₀.comp p₁) : + ∃ h₂ : P₂ →ₗ[R] Q₃, f₂ = q₃.comp h₂ + h₁.comp p₂ := by + have hz : q₂.comp (f₂ - h₁.comp p₂) = 0 := by + ext x + have hc' : q₂ (f₂ x) = f₁ (p₂ x) := DFunLike.congr_fun hc x + have hh' : f₁ (p₂ x) = q₂ (h₁ (p₂ x)) + h₀ (p₁ (p₂ x)) := + DFunLike.congr_fun hh (p₂ x) + have hp' : p₁ (p₂ x) = 0 := DFunLike.congr_fun hp x + change q₂ (f₂ x - h₁ (p₂ x)) = 0 + rw [map_sub, hc', hh', hp', map_zero, add_zero, sub_self] + obtain ⟨h₂, hh₂⟩ := lift_through_exact q₃ q₂ hq (f₂ - h₁.comp p₂) hz + exact ⟨h₂, by rw [hh₂, sub_add_cancel]⟩ + +theorem extend_homotopy_down [Module.Finite R Q₁] [Module.Projective R Q₁] + (p₂ : P₂ →ₗ[R] P₁) (p₁ : P₁ →ₗ[R] P₀) (hp : HomExactAt p₂ p₁) + (q₃ : Q₃ →ₗ[R] Q₂) (q₂ : Q₂ →ₗ[R] Q₁) (hq : q₂.comp q₃ = 0) + (f₂ : P₂ →ₗ[R] Q₂) (f₁ : P₁ →ₗ[R] Q₁) + (hc : q₂.comp f₂ = f₁.comp p₂) + (h₂ : P₂ →ₗ[R] Q₃) (h₁ : P₁ →ₗ[R] Q₂) + (hh : f₂ = q₃.comp h₂ + h₁.comp p₂) : + ∃ h₀ : P₀ →ₗ[R] Q₁, f₁ = q₂.comp h₁ + h₀.comp p₁ := by + have hz : (f₁ - q₂.comp h₁).comp p₂ = 0 := by + ext x + have hc' : f₁ (p₂ x) = q₂ (f₂ x) := (DFunLike.congr_fun hc x).symm + have hh' : f₂ x = q₃ (h₂ x) + h₁ (p₂ x) := DFunLike.congr_fun hh x + have hq' : q₂ (q₃ (h₂ x)) = 0 := DFunLike.congr_fun hq (h₂ x) + change f₁ (p₂ x) - q₂ (h₁ (p₂ x)) = 0 + rw [hc', hh', map_add, hq', zero_add, sub_self] + obtain ⟨h₀, hh₀⟩ := hp.projective (f₁ - q₂.comp h₁) hz + refine ⟨h₀, ?_⟩ + rw [hh₀] + abel + +theorem initial_homotopy_of_factorization + [Module.Projective R P₁] [Module.Finite R Q₁] [Module.Projective R Q₁] + (e : P₂ →ₗ[R] P₁) (d : P₁ →ₗ[R] P₀) (hd : HomExactAt e d) + (e' : Q₃ →ₗ[R] Q₂) (f : P₁ →ₗ[R] Q₂) + (a : (P₁ ⧸ LinearMap.range e) →ₗ[R] Q₁) + (b : Q₁ →ₗ[R] (Q₂ ⧸ LinearMap.range e')) + (hf : (LinearMap.range e').mkQ.comp f = + b.comp (a.comp (LinearMap.range e).mkQ)) : + ∃ (h₀ : P₀ →ₗ[R] Q₂) (h₁ : P₁ →ₗ[R] Q₃), + f = e'.comp h₁ + h₀.comp d := by + have ha : (a.comp (LinearMap.range e).mkQ).comp e = 0 := by + ext x + change a ((LinearMap.range e).mkQ (e x)) = 0 + rw [show (LinearMap.range e).mkQ (e x) = 0 by + exact (Submodule.Quotient.mk_eq_zero _).mpr ⟨x, rfl⟩, map_zero] + obtain ⟨A, hA⟩ := hd.projective (a.comp (LinearMap.range e).mkQ) ha + obtain ⟨B, hB⟩ := Module.projective_lifting_property (LinearMap.range e').mkQ b + (Submodule.mkQ_surjective _) + have hz : (LinearMap.range e').mkQ.comp (f - (B.comp A).comp d) = 0 := by + ext x + have hf' : (LinearMap.range e').mkQ (f x) = + b (a ((LinearMap.range e).mkQ x)) := DFunLike.congr_fun hf x + have hB' : (LinearMap.range e').mkQ (B (A (d x))) = b (A (d x)) := + DFunLike.congr_fun hB (A (d x)) + have hA' : A (d x) = a ((LinearMap.range e).mkQ x) := DFunLike.congr_fun hA x + change (LinearMap.range e').mkQ (f x - B (A (d x))) = 0 + rw [map_sub, hf', hB', hA', sub_self] + obtain ⟨h₁, hh₁⟩ := lift_through_exact e' (LinearMap.range e').mkQ + (Submodule.ker_mkQ _).symm (f - (B.comp A).comp d) hz + exact ⟨B.comp A, h₁, by rw [hh₁, sub_add_cancel]⟩ + +theorem factorization_of_initial_homotopy + (e : P₂ →ₗ[R] P₁) (d : P₁ →ₗ[R] P₀) (hd : d.comp e = 0) + (e' : Q₃ →ₗ[R] Q₂) (f : P₁ →ₗ[R] Q₂) + (u : (P₁ ⧸ LinearMap.range e) →ₗ[R] (Q₂ ⧸ LinearMap.range e')) + (hu : (LinearMap.range e').mkQ.comp f = u.comp (LinearMap.range e).mkQ) + (h₀ : P₀ →ₗ[R] Q₂) (h₁ : P₁ →ₗ[R] Q₃) + (hh : f = e'.comp h₁ + h₀.comp d) : + ∃ (a : (P₁ ⧸ LinearMap.range e) →ₗ[R] P₀) + (b : P₀ →ₗ[R] (Q₂ ⧸ LinearMap.range e')), b.comp a = u := by + have he : LinearMap.range e ≤ LinearMap.ker d := by + rintro _ ⟨x, rfl⟩ + exact DFunLike.congr_fun hd x + let a : (P₁ ⧸ LinearMap.range e) →ₗ[R] P₀ := (LinearMap.range e).liftQ d he + refine ⟨a, (LinearMap.range e').mkQ.comp h₀, ?_⟩ + apply LinearMap.ext + intro t + obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective (LinearMap.range e) t + change (LinearMap.range e').mkQ (h₀ (d x)) = u ((LinearMap.range e).mkQ x) + have hz : (LinearMap.range e').mkQ (e' (h₁ x)) = 0 := + (Submodule.Quotient.mk_eq_zero _).mpr ⟨h₁ x, rfl⟩ + calc + (LinearMap.range e').mkQ (h₀ (d x)) = + (LinearMap.range e').mkQ (e' (h₁ x) + h₀ (d x)) := by + rw [map_add, hz, zero_add] + _ = (LinearMap.range e').mkQ (f x) := + congrArg (LinearMap.range e').mkQ (DFunLike.congr_fun hh x).symm + _ = u ((LinearMap.range e).mkQ x) := DFunLike.congr_fun hu x + +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/LinearRetractEquiv.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/LinearRetractEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..9fe1d673eea7e8c59e29c3774e330c1fd84ac9ea --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/LinearRetractEquiv.lean @@ -0,0 +1,31 @@ +import Mathlib.LinearAlgebra.Isomorphisms + +namespace OAI + +namespace ArExplicit + +universe u + +variable {k A B C D : Type u} [Semiring k] +variable [AddCommMonoid A] [Module k A] [AddCommMonoid B] [Module k B] +variable [AddCommMonoid C] [Module k C] [AddCommMonoid D] [Module k D] + +def linearRetractEquiv (i : A →ₗ[k] B) (p : B →ₗ[k] A) (hpi : p.comp i = LinearMap.id) + (j : C →ₗ[k] D) (q : D →ₗ[k] C) (hqj : q.comp j = LinearMap.id) + (e : B ≃ₗ[k] D) (he : ∀ b, e (i (p b)) = j (q (e b))) : A ≃ₗ[k] C where + toFun a := q (e (i a)) + invFun c := p (e.symm (j c)) + left_inv a := by + change p (e.symm (j (q (e (i a))))) = a + rw [← he, e.symm_apply_apply] + exact (DFunLike.congr_fun hpi _).trans (DFunLike.congr_fun hpi a) + right_inv c := by + change q (e (i (p (e.symm (j c))))) = c + rw [he, e.apply_symm_apply] + exact (DFunLike.congr_fun hqj _).trans (DFunLike.congr_fun hqj c) + map_add' a b := by simp + map_smul' r a := by simp + +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/ModuleCatLinearCoherence.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/ModuleCatLinearCoherence.lean new file mode 100644 index 0000000000000000000000000000000000000000..b8e689e885c088d40e371349fb58baa3537d5328 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/ModuleCatLinearCoherence.lean @@ -0,0 +1,15 @@ +import Mathlib.Algebra.Category.ModuleCat.Algebra + +namespace OAI + +open CategoryTheory +namespace ArExplicit +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] + +theorem moduleCatLinear_coherence : ModuleCat.linearOverField (k := k) (A := R) = + ModuleCat.Algebra.instLinear (S₀ := k) (S := R) := rfl + +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/NatComparisonFunctor.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/NatComparisonFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..d94d59279246865fb68dd59030644853b7dfa727 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/NatComparisonFunctor.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.Ext.NatComparisonExt +import OAI.Algebra.AuslanderReiten.Resolutions.MapResolutionExtComparison + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian CategoryTheory.Limits +namespace ArExplicit.ResolutionProducts +universe u +variable {k R S : Type u} [Field k] [CharP k 2] [Ring R] [Algebra k R] + [Ring S] [Algebra k S] +variable [HasDerivedCategory (ModuleCat.{u} R)] [HasDerivedCategory (ModuleCat.{u} S)] +variable (F : ModuleCat.{u} R ⥤ ModuleCat.{u} S) [F.Additive] + [PreservesFiniteLimits F] [PreservesFiniteColimits F] [F.PreservesProjectiveObjects] +variable {X : ModuleCat.{u} R} {Y : ModuleCat.{u} S} +variable (P : ProjectiveResolution X) (Q : ProjectiveResolution Y) + +theorem natComparisonEndExt_map (e : Y ≅ F.obj X) + (φ : ProjectiveResolution.Hom Q (mapResolution F P) e.hom) (r : ℕ) + (f : ∀ n, P.complex.X (r+n) ⟶ P.complex.X n) + (hf : ∀ n, f (n+1) ≫ P.complex.d (n+1) n = P.complex.d (r+(n+1)) (r+n) ≫ f n) + (g : ∀ n, Q.complex.X (r+n) ⟶ Q.complex.X n) + (hg : ∀ n, g (n+1) ≫ Q.complex.d (n+1) n = Q.complex.d (r+(n+1)) (r+n) ≫ g n) + (ha : natComparisonAugmentation Q r g = + (φ.hom.f r ≫ F.map (natComparisonAugmentation P r f)) ≫ e.inv) : + endExt Q (natComparisonCocycle (k := k) Q Q r g hg) = + ((Ext.mk₀ e.hom).comp + ((endExt P (natComparisonCocycle (k := k) P P r f hf)).mapExactFunctor F) (zero_add r)).comp + (Ext.mk₀ e.inv) (add_zero r) := by + rw [natComparison_endExt_eq, natComparison_endExt_eq] + exact (map_extMk_comparison F P Q e φ + (natComparisonAugmentation P r f) (natComparison_augmented_cycle P r f hf) + (natComparisonAugmentation Q r g) (natComparison_augmented_cycle Q r g hg) ha).symm + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/ProjectiveNullhomotopyAbove.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/ProjectiveNullhomotopyAbove.lean new file mode 100644 index 0000000000000000000000000000000000000000..0fc991a71f5bcce8d8c5f4fc36d99cce9fe1f814 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/ProjectiveNullhomotopyAbove.lean @@ -0,0 +1,76 @@ +import OAI.Algebra.AuslanderReiten.Homology.LinearHomotopy + +namespace OAI + +noncomputable section + +namespace ArExplicit.ProjectiveNullhomotopyAbove + +universe u +variable {R : Type u} [Ring R] +variable {P Q : ℕ → Type u} +variable [∀ n, AddCommGroup (P n)] [∀ n, Module R (P n)] +variable [∀ n, AddCommGroup (Q n)] [∀ n, Module R (Q n)] +variable (dP : (n : ℕ) → P (n + 1) →ₗ[R] P n) +variable (dQ : (n : ℕ) → Q (n + 1) →ₗ[R] Q n) +variable (f : (n : ℕ) → Q (n + 2) →ₗ[R] P n) + +private structure Pair (n : ℕ) where + lo : Q (n + 1) →ₗ[R] P n + hi : Q (n + 2) →ₗ[R] P (n + 1) + eqn : f n = (dP n).comp hi + lo.comp (dQ (n + 1)) + +variable (hproj : ∀ n, Module.Projective R (Q n)) +variable (hQQ : ∀ n, (dQ n).comp (dQ (n + 1)) = 0) +variable (hexact : ∀ n, LinearMap.range (dP (n + 1)) = LinearMap.ker (dP n)) +variable (hcomm : ∀ n, (dP n).comp (f (n + 1)) = (f n).comp (dQ (n + 2))) + +include hproj hQQ hexact hcomm + +private theorem step (n : ℕ) (c : Pair dP dQ f n) : + ∃ c' : Pair dP dQ f (n + 1), c'.lo = c.hi := by + let := hproj (n + 3) + obtain ⟨h, hh⟩ := extend_homotopy_up (dQ (n + 2)) (dQ (n + 1)) (hQQ (n + 1)) + (dP (n + 1)) (dP n) (hexact n) (f (n + 1)) (f n) (hcomm n) c.hi c.lo c.eqn + exact ⟨⟨c.hi, h, hh⟩, rfl⟩ + +private def sequence (c : Pair dP dQ f 0) : (n : ℕ) → Pair dP dQ f n + | 0 => c + | n + 1 => Classical.choose (step dP dQ f hproj hQQ hexact hcomm n + (sequence c n)) + +private theorem sequence_succ_lo (c : Pair dP dQ f 0) (n : ℕ) : + (sequence dP dQ f hproj hQQ hexact hcomm c (n + 1)).lo = + (sequence dP dQ f hproj hQQ hexact hcomm c n).hi := + Classical.choose_spec (step dP dQ f hproj hQQ hexact hcomm n + (sequence dP dQ f hproj hQQ hexact hcomm c n)) + +variable {M : Type u} [AddCommGroup M] [Module R M] + +theorem exists_homotopy (e : P 0 →ₗ[R] M) (hepi : Function.Surjective e) + (he : LinearMap.range (dP 0) = LinearMap.ker e) (z : Q 1 →ₗ[R] M) + (hz : e.comp (f 0) = z.comp (dQ 1)) : + ∃ G : (n : ℕ) → Q (n + 1) →ₗ[R] P n, + e.comp (G 0) = z ∧ ∀ n, f n = (dP n).comp (G (n + 1)) + (G n).comp (dQ (n + 1)) := by + let := hproj 1 + obtain ⟨g₀, hg₀⟩ := Module.projective_lifting_property e z hepi + have hc : e.comp (f 0 - g₀.comp (dQ 1)) = 0 := by + ext x + have h1 := LinearMap.congr_fun hz x + have h2 := LinearMap.congr_fun hg₀ (dQ 1 x) + simp only [LinearMap.comp_apply] at h1 h2 + change e (f 0 x - g₀ (dQ 1 x)) = 0 + rw [map_sub, h2] + exact sub_eq_zero.mpr h1 + let := hproj 2 + obtain ⟨g₁, hg₁⟩ := lift_through_exact (dP 0) e he (f 0 - g₀.comp (dQ 1)) hc + let c : Pair dP dQ f 0 := ⟨g₀, g₁, by rw [hg₁, sub_add_cancel]⟩ + refine ⟨fun n => (sequence dP dQ f hproj hQQ hexact hcomm c n).lo, hg₀, ?_⟩ + intro n + simpa only [sequence_succ_lo] using (sequence dP dQ f hproj hQQ hexact hcomm c n).eqn + +end ArExplicit.ProjectiveNullhomotopyAbove + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/RestrictKernelCokernel.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/RestrictKernelCokernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..19ca4b001e3701807b44e1a69536090906b648da --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/RestrictKernelCokernel.lean @@ -0,0 +1,68 @@ +import OAI.Algebra.AuslanderReiten.Modules.SplitModules +import OAI.Algebra.AuslanderReiten.Modules.ModuleRestriction + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory + +universe u + +variable {R S : Type u} [Ring R] [Ring S] (j : R →+* S) +variable {M N : ModuleCat.{u} S} (f : M ⟶ N) + +def kernelObject : ModuleCat.{u} S := ModuleCat.of S (LinearMap.ker f.hom) +def cokernelObject : ModuleCat.{u} S := ModuleCat.of S (N ⧸ LinearMap.range f.hom) + +def restrictKernelEquiv : + ((ModuleCat.restrictScalars j).obj (kernelObject f)) ≃ₗ[R] + LinearMap.ker (((ModuleCat.restrictScalars j).map f).hom) where + toFun x := ⟨x.val, x.property⟩ + invFun x := ⟨x.val, x.property⟩ + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + +def restrictCokernelEquiv : + ((ModuleCat.restrictScalars j).obj (cokernelObject f)) ≃ₗ[R] + (((ModuleCat.restrictScalars j).obj N) ⧸ LinearMap.range (((ModuleCat.restrictScalars j).map f).hom)) where + toFun x := x + invFun x := x + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + +theorem kernel_restrict_projective + [Module.Projective R ((ModuleCat.restrictScalars j).obj M)] + [Module.Projective R ((ModuleCat.restrictScalars j).obj N)] + (hf : Function.Surjective f.hom) : + Module.Projective R ((ModuleCat.restrictScalars j).obj (kernelObject f)) := by + let := projective_kernel_of_surjective (((ModuleCat.restrictScalars j).map f).hom) hf + exact Module.Projective.of_equiv (restrictKernelEquiv j f).symm + +theorem kernel_restrict_finite + [Module.Finite R ((ModuleCat.restrictScalars j).obj M)] + [Module.Projective R ((ModuleCat.restrictScalars j).obj N)] + (hf : Function.Surjective f.hom) : + Module.Finite R ((ModuleCat.restrictScalars j).obj (kernelObject f)) := by + let := finite_kernel_of_surjective (((ModuleCat.restrictScalars j).map f).hom) hf + exact Module.Finite.equiv (restrictKernelEquiv j f).symm + +theorem cokernel_restrict_projective + [Module.Injective R ((ModuleCat.restrictScalars j).obj M)] + [Module.Projective R ((ModuleCat.restrictScalars j).obj N)] + (hf : Function.Injective f.hom) : + Module.Projective R ((ModuleCat.restrictScalars j).obj (cokernelObject f)) := by + let := projective_cokernel_of_injective (((ModuleCat.restrictScalars j).map f).hom) hf + exact Module.Projective.of_equiv (restrictCokernelEquiv j f).symm + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/RestrictionProjective.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/RestrictionProjective.lean new file mode 100644 index 0000000000000000000000000000000000000000..fae5c0c1c47ed0f1a9a57d7b49d709d81d164a89 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/RestrictionProjective.lean @@ -0,0 +1,58 @@ +import OAI.Algebra.AuslanderReiten.Homology.RestrictKernelCokernel + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory + +universe u + +variable {R S : Type u} [Ring R] [Ring S] (j : R →+* S) + +private instance finitePiProjective {P ι : Type*} [AddCommGroup P] [Module R P] + [Module.Projective R P] [Fintype ι] : Module.Projective R (ι → P) := + Module.Projective.of_equiv (DFinsupp.linearEquivFunOnFintype : + (Π₀ _ : ι, P) ≃ₗ[R] (ι → P)) + +def restrictPiEquiv (ι : Type) : + ((ModuleCat.restrictScalars j).obj (ModuleCat.of S (ι → S))) ≃ₗ[R] + (ι → ((ModuleCat.restrictScalars j).obj (ModuleCat.of S S))) where + toFun x := x + invFun x := x + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + +variable (M : ModuleCat.{u} S) [Module.Finite S M] + +theorem restrict_finite [Module.Finite R ((ModuleCat.restrictScalars j).obj (ModuleCat.of S S))] : + Module.Finite R ((ModuleCat.restrictScalars j).obj M) := by + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' S M + have : Module.Finite R ((ModuleCat.restrictScalars j).obj (ModuleCat.of S (Fin n → S))) := + Module.Finite.equiv (restrictPiEquiv j (Fin n)).symm + exact Module.Finite.of_surjective + (((ModuleCat.restrictScalars j).map (ModuleCat.ofHom p)).hom) hp + +theorem restrict_projective [Module.Projective S M] + [Module.Projective R ((ModuleCat.restrictScalars j).obj (ModuleCat.of S S))] : + Module.Projective R ((ModuleCat.restrictScalars j).obj M) := by + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' S M + obtain ⟨s, hs⟩ := Module.projective_lifting_property p (LinearMap.id : M →ₗ[S] M) hp + have : Module.Projective R ((ModuleCat.restrictScalars j).obj (ModuleCat.of S (Fin n → S))) := + Module.Projective.of_equiv (restrictPiEquiv j (Fin n)).symm + apply Module.Projective.of_split + (((ModuleCat.restrictScalars j).map (ModuleCat.ofHom s)).hom) + (((ModuleCat.restrictScalars j).map (ModuleCat.ofHom p)).hom) + apply LinearMap.ext + intro x + exact DFunLike.congr_fun hs x + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactConnecting.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactConnecting.lean new file mode 100644 index 0000000000000000000000000000000000000000..36acbee4ab1283ebf9992b6fb7fa1a22f68e1542 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactConnecting.lean @@ -0,0 +1,102 @@ +import OAI.Algebra.AuslanderReiten.Cones.ShortExactConeRaw +import OAI.Algebra.AuslanderReiten.Stable.RawSourceStable +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomShiftedHomotopy + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory HomologicalComplex +open CochainComplex CochainComplex.HomComplex CompleteComparison +open scoped ModuleCat.Algebra +universe u +variable {k R : Type u} [Field k] [CharP k 2] [Ring R] [Algebra k R] +variable [Module.Injective R R] +variable {F G H : CochainComplex (ModuleCat.{u} R) ℤ} +variable (φ : F ⟶ G) (p : CochainCokernel G →ₗ[R] CochainCokernel H) +variable (he : Function.Exact (cochainCokernelMap φ) p) +variable (hF : TotallyAcyclicCochain F) (hG : TotallyAcyclicCochain G) (hH : TotallyAcyclicCochain H) +variable (hi : Function.Injective (cochainCokernelMap φ)) (hp : Function.Surjective p) +variable (κ : H ⟶ mappingCone φ) +variable (hκ : (HomotopyCategory.quotient _ _).map κ = + (shortExactConeIso φ p he hF hG hH hi hp).inv) + +include hκ in + +theorem shortExactConeKernel_stable + (A : H.X 0 →ₗ[R] CochainCokernel G) (t : RawSyzygy H →ₗ[R] CochainCokernel F) + (hA : p.comp A = (LinearMap.range (H.d (-1) 0).hom).mkQ) + (ht : (cochainCokernelMap φ).comp t = A.comp (rawSyzygyInclusion H)) : + StableHom.classOf R _ _ (coneLiftKernel φ κ hi) = StableHom.classOf R _ _ t := by + let := hH.finite 0 + let := hH.projective 0 + apply stable_connecting_congr (rawSyzygyInclusion H) + (LinearMap.range (H.d (-1) 0).hom).mkQ (rawSyzygyInclusion_cover H) + (cochainCokernelMap φ) p hi hp (LinearMap.exact_iff.mp he).symm + ((rawConeQuotient φ p he).comp (cochainCokernelMap κ)) LinearMap.id + (coneLiftMiddle φ κ) A (coneLiftKernel φ κ hi) t + · exact coneLiftMiddle_square φ κ p he + · simpa only [LinearMap.id_comp] using hA + · exact coneLiftKernel_square φ κ hi + · exact ht + · exact shortExactConeInverse_stable_identity φ p he hF hG hH hi hp κ hκ + +omit [Module.Injective R R] in +theorem coneProjectionCocycle_hom : + Cocycle.equivHomShift.symm (cocycleProduct (Cocycle.ofHom κ) (mappingCone.fst φ)) = + κ ≫ Cocycle.equivHomShift.symm (mappingCone.fst φ) := by + apply HomologicalComplex.Hom.ext + funext i + rw [cocycleHom_component] + change ((Cochain.ofHom κ).comp (mappingCone.fst φ).val rfl).v i (i+1) rfl = _ + rw [Cochain.comp_v _ _ rfl i i (i+1) (by omega) rfl, Cochain.ofHom_v] + simp only [HomologicalComplex.comp_f, cocycleHom_component] + +include hκ in + +theorem shortExactConnecting_cone_class : + fullHomShiftedHomotopyEquiv k H F 1 + (CohomologyClass.mk (cocycleProduct (Cocycle.ofHom κ) (mappingCone.fst φ))) = + (shortExactTriangle φ p he hF hG hH hi hp).mor₃ := by + have hn : -(mappingCone.fst φ) = mappingCone.fst φ := by + apply neg_eq_iff_add_eq_zero.mpr + rw [← two_smul k, show (2:k)=0 from CharP.cast_eq_zero k 2, zero_smul] + rw [fullHomShiftedHomotopyEquiv_mk, coneProjectionCocycle_hom, + Functor.map_comp, Category.assoc, hκ] + change _ = (shortExactConeIso φ p he hF hG hH hi hp).inv ≫ + ((HomotopyCategory.quotient _ _).map + (Cocycle.equivHomShift.symm (-(mappingCone.fst φ))) ≫ + ((HomotopyCategory.quotient _ _).commShiftIso (1:ℤ)).hom.app F) + rw [hn] + rfl + +include k hκ in + +theorem shortExactConnecting_source + (A : H.X 0 →ₗ[R] CochainCokernel G) (t : RawSyzygy H →ₗ[R] CochainCokernel F) + (hA : p.comp A = (LinearMap.range (H.d (-1) 0).hom).mkQ) + (ht : (cochainCokernelMap φ).comp t = A.comp (rawSyzygyInclusion H)) : + StableHom.classOf R _ _ + (rawSourceCocycleMap (cocycleProduct (Cocycle.ofHom κ) (mappingCone.fst φ))) = + StableHom.classOf R _ _ t := by + rw [rawSourceCocycleMap_cone (k := k) φ κ hi] + exact shortExactConeKernel_stable φ p he hF hG hH hi hp κ hκ A t hA ht + +theorem shortExactConnecting_source_equiv + (A : H.X 0 →ₗ[R] CochainCokernel G) (t : RawSyzygy H →ₗ[R] CochainCokernel F) + (hA : p.comp A = (LinearMap.range (H.d (-1) 0).hom).mkQ) + (ht : (cochainCokernelMap φ).comp t = A.comp (rawSyzygyInclusion H)) : + rawSourceStableEquiv (k := k) H F hH.to_chain hF.to_chain.toExactProjectiveComplex + ((fullHomShiftedHomotopyEquiv k H F 1).symm + (shortExactTriangle φ p he hF hG hH hi hp).mor₃) = StableHom.classOf R _ _ t := by + obtain ⟨κ, hκ⟩ := Functor.map_surjective (HomotopyCategory.quotient _ _) + (shortExactConeIso φ p he hF hG hH hi hp).inv + rw [← shortExactConnecting_cone_class (k := k) φ p he hF hG hH hi hp κ hκ, + LinearEquiv.symm_apply_apply, rawSourceStableEquiv_mk] + exact shortExactConnecting_source (k := k) φ p he hF hG hH hi hp κ hκ A t hA ht + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactConnectingProducts.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactConnectingProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..42f117861b9a41159d26cad7ca9cc241b09abc15 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactConnectingProducts.lean @@ -0,0 +1,89 @@ +import OAI.Algebra.AuslanderReiten.Homology.ShortExactConnecting +import OAI.Algebra.AuslanderReiten.Cocycles.RawCocycleProducts + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory HomologicalComplex +open CochainComplex CochainComplex.HomComplex CompleteComparison +open scoped ModuleCat.Algebra +universe u +variable {k R : Type u} [Field k] [CharP k 2] [Ring R] [Algebra k R] +variable [Module.Injective R R] +variable {K F G H : CochainComplex (ModuleCat.{u} R) ℤ} +variable (φ : F ⟶ G) (p : CochainCokernel G →ₗ[R] CochainCokernel H) +variable (he : Function.Exact (cochainCokernelMap φ) p) +variable (hK : TotallyAcyclicCochain K) (hF : TotallyAcyclicCochain F) +variable (hG : TotallyAcyclicCochain G) (hH : TotallyAcyclicCochain H) +variable (hi : Function.Injective (cochainCokernelMap φ)) (hp : Function.Surjective p) + +theorem shortExactConnecting_product_source (n : ℤ) (u : CohomologyClass K H n) + (s : RawCokernelAt K n →ₗ[R] CochainCokernel H) + (hs : rawSourceAtStableEquiv (k := k) K H n hK.to_chain + hH.to_chain.toExactProjectiveComplex u = StableHom.classOf R _ _ s) + (A : K.X (-n) →ₗ[R] CochainCokernel G) + (t : RawCokernelAt K (n+1) →ₗ[R] CochainCokernel F) + (hA : p.comp A = s.comp (LinearMap.range (K.d (-(n+1)) (-n)).hom).mkQ) + (ht : (cochainCokernelMap φ).comp t = A.comp (rawCokernelAtInclusion K n)) : + rawSourceAtStableEquiv (k := k) K F (n+1) hK.to_chain + hF.to_chain.toExactProjectiveComplex + (fullHomProduct u ((fullHomShiftedHomotopyEquiv k H F 1).symm + (shortExactTriangle φ p he hF hG hH hi hp).mor₃)) = StableHom.classOf R _ _ t := by + let := hH.projective 0 + obtain ⟨A₀, hA₀⟩ := Module.projective_lifting_property p + (LinearMap.range (H.d (-1) 0).hom).mkQ hp + have hzero : p.comp (A₀.comp (rawSyzygyInclusion H)) = 0 := by + rw [← LinearMap.comp_assoc, hA₀, rawSyzygyInclusion_cover] + let w := (A₀.comp (rawSyzygyInclusion H)).codRestrict + (LinearMap.range (cochainCokernelMap φ)) (fun z => by + rw [(LinearMap.exact_iff.mp he).symm] + exact LinearMap.congr_fun hzero z) + let e := LinearEquiv.ofInjective (cochainCokernelMap φ) hi + let t₀ := e.symm.toLinearMap.comp w + have ht₀ : (cochainCokernelMap φ).comp t₀ = A₀.comp (rawSyzygyInclusion H) := by + apply LinearMap.ext + intro z + exact congrArg Subtype.val (e.apply_symm_apply (w z)) + let d := (fullHomShiftedHomotopyEquiv k H F 1).symm + (shortExactTriangle φ p he hF hG hH hi hp).mor₃ + obtain ⟨y, hy⟩ := CohomologyClass.mk_surjective d + have hySource : StableHom.classOf R _ _ (rawSourceAt y) = + StableHom.classOf R _ _ t₀ := by + have hh := shortExactConnecting_source_equiv (k := k) φ p he hF hG hH hi hp A₀ t₀ hA₀ ht₀ + change rawSourceStableEquiv (k := k) H F _ _ d = _ at hh + rw [← hy, rawSourceStableEquiv_mk] at hh + exact hh + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective u + rw [rawSourceAtStableEquiv_mk] at hs + change rawSourceAtStableEquiv (k := k) K F (n+1) _ _ + (fullHomProduct (CohomologyClass.mk x) d) = _ + rw [← hy, fullHomProduct_mk, rawSourceAtStableEquiv_mk, rawSourceAt_product (k := k)] + rw [← StableHom.comp_classOf, hySource] + erw [StableHom.comp_classOf] + let X₀ := (x.val.v (-n) 0 (by omega)).hom + let x₁ := rawCokernelAtMap (k := k) x (n+1) 1 rfl + have hfirst : p.comp (A₀.comp X₀) = + (rawSourceAt x).comp (LinearMap.range (K.d (-(n+1)) (-n)).hom).mkQ := by + rw [← LinearMap.comp_assoc, hA₀] + apply LinearMap.ext + intro z + exact (rawSourceAt_mk (k := k) x z).symm + have hsecond : (cochainCokernelMap φ).comp (t₀.comp x₁) = + (A₀.comp X₀).comp (rawCokernelAtInclusion K n) := by + rw [← LinearMap.comp_assoc, ht₀, LinearMap.comp_assoc] + have hx := rawCokernelAtMap_cover (k := k) x n 0 (add_zero n).symm + change (rawSyzygyInclusion H).comp x₁ = X₀.comp (rawCokernelAtInclusion K n) at hx + rw [hx, LinearMap.comp_assoc] + let := hK.finite (-n) + let := hK.projective (-n) + exact stable_connecting_congr (rawCokernelAtInclusion K n) + (LinearMap.range (K.d (-(n+1)) (-n)).hom).mkQ (rawCokernelAtInclusion_cover K n) + (cochainCokernelMap φ) p hi hp (LinearMap.exact_iff.mp he).symm + (rawSourceAt x) s (A₀.comp X₀) A (t₀.comp x₁) t hfirst hA hsecond ht hs + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactNaturality.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..30b2be1de04ba2f5ea11d14fb731d6648296e16e --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactNaturality.lean @@ -0,0 +1,145 @@ +import OAI.Algebra.AuslanderReiten.Cones.MappingConeNaturality + +namespace OAI + +noncomputable section +open CategoryTheory HomologicalComplex +open CochainComplex CochainComplex.HomComplex + +namespace ArExplicit +open CompleteComparison + +universe u +variable {R : Type u} [Ring R] + +namespace CompleteComparison +variable {K L M : CochainComplex (ModuleCat.{u} R) ℤ} + +theorem cochainHomotopyRawEquiv_comp + (hK : TotallyAcyclicCochain K) (hL : TotallyAcyclicCochain L) + (hM : ExactProjectiveCochain M) + (f : (HomotopyCategory.quotient _ _).obj K ⟶ (HomotopyCategory.quotient _ _).obj L) + (g : (HomotopyCategory.quotient _ _).obj L ⟶ (HomotopyCategory.quotient _ _).obj M) : + cochainHomotopyRawEquiv hK.to_chain hM.to_chain (f ≫ g) = + StableHom.comp (cochainHomotopyRawEquiv hL.to_chain hM.to_chain g) + (cochainHomotopyRawEquiv hK.to_chain hL.to_chain.toExactProjectiveComplex f) := by + obtain ⟨f, rfl⟩ := (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.up ℤ)).map_surjective f + obtain ⟨g, rfl⟩ := (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.up ℤ)).map_surjective g + rw [← Functor.map_comp, cochainHomotopyRawEquiv_map, cochainHomotopyRawEquiv_map, + cochainHomotopyRawEquiv_map, cochainCokernelMap_comp, StableHom.comp_classOf] + +theorem cochainHomotopyRawEquiv_comp_class + (hK : TotallyAcyclicCochain K) (hL : TotallyAcyclicCochain L) + (hM : ExactProjectiveCochain M) + (f : (HomotopyCategory.quotient _ _).obj K ⟶ (HomotopyCategory.quotient _ _).obj L) + (g : (HomotopyCategory.quotient _ _).obj L ⟶ (HomotopyCategory.quotient _ _).obj M) + (p : CochainCokernel K →ₗ[R] CochainCokernel L) + (q : CochainCokernel L →ₗ[R] CochainCokernel M) + (hf : cochainHomotopyRawEquiv hK.to_chain hL.to_chain.toExactProjectiveComplex f = + StableHom.classOf R _ _ p) + (hg : cochainHomotopyRawEquiv hL.to_chain hM.to_chain g = StableHom.classOf R _ _ q) : + cochainHomotopyRawEquiv hK.to_chain hM.to_chain (f ≫ g) = + StableHom.classOf R _ _ (q.comp p) := by + rw [cochainHomotopyRawEquiv_comp hK hL hM, hg, hf, StableHom.comp_classOf] + +end CompleteComparison + +variable [Module.Injective R R] +variable {F G K : CochainComplex (ModuleCat.{u} R) ℤ} +variable (φ : F ⟶ G) (p : CochainCokernel G →ₗ[R] CochainCokernel K) +variable (hex : Function.Exact (cochainCokernelMap φ) p) +variable (hF : TotallyAcyclicCochain F) (hG : TotallyAcyclicCochain G) +variable (hK : TotallyAcyclicCochain K) +variable (hi : Function.Injective (cochainCokernelMap φ)) (hp : Function.Surjective p) + +theorem shortExactConeIso_raw_hom : + cochainHomotopyRawEquiv (mappingCone_totallyAcyclic φ hF hG).to_chain + hK.to_chain.toExactProjectiveComplex (shortExactConeIso φ p hex hF hG hK hi hp).hom = + StableHom.classOf R _ _ (rawConeQuotient φ p hex) := by + simp only [cochainHomotopyRawEquiv, AddEquiv.trans_apply, shortExactConeIso_hom, + StableIsomorphism.sourceAddEquiv, StableIsomorphism.targetAddEquiv, + StableIsomorphism.ofLinearEquiv, AddEquiv.coe_mk, Equiv.coe_fn_mk, + StableHom.comp_classOf] + apply congrArg (StableHom.classOf R _ _) + apply LinearMap.ext + intro x + simp [completeConeQuotient] + +variable {F₁ G₁ K₁ F₂ G₂ K₂ : CochainComplex (ModuleCat.{u} R) ℤ} +variable (φ₁ : F₁ ⟶ G₁) (φ₂ : F₂ ⟶ G₂) +variable (p₁ : CochainCokernel G₁ →ₗ[R] CochainCokernel K₁) + (p₂ : CochainCokernel G₂ →ₗ[R] CochainCokernel K₂) +variable (hex₁ : Function.Exact (cochainCokernelMap φ₁) p₁) + (hex₂ : Function.Exact (cochainCokernelMap φ₂) p₂) +variable (hF₁ : TotallyAcyclicCochain F₁) (hG₁ : TotallyAcyclicCochain G₁) + (hK₁ : TotallyAcyclicCochain K₁) +variable (hF₂ : TotallyAcyclicCochain F₂) (hG₂ : TotallyAcyclicCochain G₂) + (hK₂ : TotallyAcyclicCochain K₂) +variable (hi₁ : Function.Injective (cochainCokernelMap φ₁)) (hp₁ : Function.Surjective p₁) + (hi₂ : Function.Injective (cochainCokernelMap φ₂)) (hp₂ : Function.Surjective p₂) +variable (a : F₁ ⟶ F₂) (b : G₁ ⟶ G₂) (c : K₁ ⟶ K₂) +variable (H : Homotopy (φ₁ ≫ b) (a ≫ φ₂)) (hH : H.hom 1 0 = 0) +variable (hc : p₂.comp (cochainCokernelMap b) = (cochainCokernelMap c).comp p₁) + +include hH hc in + +theorem shortExactConeIso_natural : + (HomotopyCategory.quotient _ _).map (mappingCone.mapOfHomotopy H) ≫ + (shortExactConeIso φ₂ p₂ hex₂ hF₂ hG₂ hK₂ hi₂ hp₂).hom = + (shortExactConeIso φ₁ p₁ hex₁ hF₁ hG₁ hK₁ hi₁ hp₁).hom ≫ + (HomotopyCategory.quotient _ _).map c := by + apply (cochainHomotopyRawEquiv (mappingCone_totallyAcyclic φ₁ hF₁ hG₁).to_chain + hK₂.to_chain.toExactProjectiveComplex).injective + have hl := cochainHomotopyRawEquiv_comp_class + (mappingCone_totallyAcyclic φ₁ hF₁ hG₁) (mappingCone_totallyAcyclic φ₂ hF₂ hG₂) + hK₂.toExactProjectiveCochain + ((HomotopyCategory.quotient _ _).map (mappingCone.mapOfHomotopy H)) + (shortExactConeIso φ₂ p₂ hex₂ hF₂ hG₂ hK₂ hi₂ hp₂).hom + (cochainCokernelMap (mappingCone.mapOfHomotopy H)) (rawConeQuotient φ₂ p₂ hex₂) + (cochainHomotopyRawEquiv_map _ _ _) (shortExactConeIso_raw_hom φ₂ p₂ hex₂ hF₂ hG₂ hK₂ hi₂ hp₂) + have hr := cochainHomotopyRawEquiv_comp_class + (mappingCone_totallyAcyclic φ₁ hF₁ hG₁) hK₁ hK₂.toExactProjectiveCochain + (shortExactConeIso φ₁ p₁ hex₁ hF₁ hG₁ hK₁ hi₁ hp₁).hom + ((HomotopyCategory.quotient _ _).map c) + (rawConeQuotient φ₁ p₁ hex₁) (cochainCokernelMap c) + (shortExactConeIso_raw_hom φ₁ p₁ hex₁ hF₁ hG₁ hK₁ hi₁ hp₁) (cochainHomotopyRawEquiv_map _ _ _) + exact hl.trans ((congrArg (StableHom.classOf R _ _) + (rawConeQuotient_natural H hH p₁ p₂ hex₁ hex₂ (cochainCokernelMap c) hc)).trans hr.symm) + +include hc in + +theorem shortExactTriangle_connecting_natural + (hab : cochainCokernelMap (φ₁ ≫ b) = cochainCokernelMap (a ≫ φ₂)) : + (HomotopyCategory.quotient _ _).map c ≫ + (shortExactTriangle φ₂ p₂ hex₂ hF₂ hG₂ hK₂ hi₂ hp₂).mor₃ = + (shortExactTriangle φ₁ p₁ hex₁ hF₁ hG₁ hK₁ hi₁ hp₁).mor₃ ≫ + (CategoryTheory.shiftFunctor (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) 1).map + ((HomotopyCategory.quotient _ _).map a) := by + obtain ⟨H, hH⟩ := cochain_homotopy_of_cokernel_eq hF₁ hG₂.toExactProjectiveCochain + (φ₁ ≫ b) (a ≫ φ₂) hab + let E₁ := shortExactConeIso φ₁ p₁ hex₁ hF₁ hG₁ hK₁ hi₁ hp₁ + let E₂ := shortExactConeIso φ₂ p₂ hex₂ hF₂ hG₂ hK₂ hi₂ hp₂ + have hn : (HomotopyCategory.quotient _ _).map (mappingCone.mapOfHomotopy H) ≫ E₂.hom = + E₁.hom ≫ (HomotopyCategory.quotient _ _).map c := + shortExactConeIso_natural φ₁ φ₂ p₁ p₂ hex₁ hex₂ hF₁ hG₁ hK₁ hF₂ hG₂ hK₂ + hi₁ hp₁ hi₂ hp₂ a b c H hH hc + have hi : (HomotopyCategory.quotient _ _).map c ≫ E₂.inv = + E₁.inv ≫ (HomotopyCategory.quotient _ _).map (mappingCone.mapOfHomotopy H) := by + apply (cancel_mono E₂.hom).mp + simp only [Category.assoc, Iso.inv_hom_id, Category.comp_id] + rw [hn] + simp + change (HomotopyCategory.quotient _ _).map c ≫ + (E₂.inv ≫ (mappingCone.triangleh φ₂).mor₃) = + (E₁.inv ≫ (mappingCone.triangleh φ₁).mor₃) ≫ _ + erw [← Category.assoc, hi, Category.assoc, + ← (mappingCone.trianglehMapOfHomotopy H).comm₃] + exact (Category.assoc E₁.inv (mappingCone.triangleh φ₁).mor₃ + ((CategoryTheory.shiftFunctor (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) 1).map + ((HomotopyCategory.quotient _ _).map a))).symm + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactTriangle.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactTriangle.lean new file mode 100644 index 0000000000000000000000000000000000000000..5facf0b50e7e7c8e7a24db7757a53afc07f0c217 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/ShortExactTriangle.lean @@ -0,0 +1,109 @@ +import OAI.Algebra.AuslanderReiten.Cones.MappingConeCokernel +import OAI.Algebra.AuslanderReiten.Coordinates.CochainStableComparison +import Mathlib.Algebra.Homology.HomotopyCategory.Pretriangulated + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Pretriangulated +open CochainComplex + +namespace ArExplicit + +open CompleteComparison + +universe u + +variable {R : Type u} [Ring R] [Module.Injective R R] +variable {F G H : CochainComplex (ModuleCat.{u} R) ℤ} +variable (φ : F ⟶ G) (p : CochainCokernel G →ₗ[R] CochainCokernel H) +variable (hex : Function.Exact (cochainCokernelMap φ) p) +variable (hF : TotallyAcyclicCochain F) (hG : TotallyAcyclicCochain G) +variable (hH : TotallyAcyclicCochain H) +variable (hi : Function.Injective (cochainCokernelMap φ)) (hp : Function.Surjective p) + +def shortExactConeIso : + (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.up ℤ)).obj (mappingCone φ) ≅ + (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.up ℤ)).obj H := + stableCochainHomotopyIso (mappingCone_totallyAcyclic φ hF hG).to_chain hH.to_chain + ((mappingConeStableQuotient φ p hex hF.toExactProjectiveCochain hi hp).trans + (StableIsomorphism.ofLinearEquiv (cochainCokernelLinearEquiv H).symm)) + +def shortExactTriangle : Triangle (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := + Triangle.mk ((HomotopyCategory.quotient _ _).map φ) + ((HomotopyCategory.quotient _ _).map (mappingCone.inr φ) ≫ + (shortExactConeIso φ p hex hF hG hH hi hp).hom) + ((shortExactConeIso φ p hex hF hG hH hi hp).inv ≫ (mappingCone.triangleh φ).mor₃) + +theorem shortExactTriangle_distinguished : + shortExactTriangle φ p hex hF hG hH hi hp ∈ + distTriang (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := by + apply isomorphic_distinguished _ (HomotopyCategory.mappingCone_triangleh_distinguished φ) + refine Triangle.isoMk _ _ (Iso.refl _) (Iso.refl _) + (shortExactConeIso φ p hex hF hG hH hi hp).symm ?_ ?_ ?_ + · change ((HomotopyCategory.quotient _ _).map φ) ≫ 𝟙 _ = + 𝟙 _ ≫ ((HomotopyCategory.quotient _ _).map φ) + simp only [Category.comp_id, Category.id_comp] + · change (((HomotopyCategory.quotient _ _).map (mappingCone.inr φ)) ≫ + (shortExactConeIso φ p hex hF hG hH hi hp).hom) ≫ + (shortExactConeIso φ p hex hF hG hH hi hp).inv = + 𝟙 _ ≫ ((HomotopyCategory.quotient _ _).map (mappingCone.inr φ)) + simp only [Category.assoc, Iso.hom_inv_id, Category.comp_id, Category.id_comp] + · change ((shortExactConeIso φ p hex hF hG hH hi hp).inv ≫ (mappingCone.triangleh φ).mor₃) ≫ + (CategoryTheory.shiftFunctor (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) 1).map (𝟙 _) = _ + erw [CategoryTheory.Functor.map_id, Category.comp_id] + rfl + +theorem shortExactConeIso_hom : + cochainHomotopyCokernelEquiv (mappingCone_totallyAcyclic φ hF hG).to_chain + hH.to_chain.toExactProjectiveComplex (shortExactConeIso φ p hex hF hG hH hi hp).hom = + StableHom.classOf R _ _ ((cochainCokernelLinearEquiv H).symm.toLinearMap.comp + (completeConeQuotient φ p hex)) := by + unfold shortExactConeIso + rw [stableCochainHomotopyIso_hom] + change StableHom.comp + (StableHom.classOf R _ _ (cochainCokernelLinearEquiv H).symm.toLinearMap) + (mappingConeStableQuotient φ p hex hF.toExactProjectiveCochain hi hp).hom = _ + rw [mappingConeStableQuotient_hom φ p hex hF.toExactProjectiveCochain hi hp, + StableHom.comp_classOf] + +theorem shortExactTriangle_second (ψ : G ⟶ H) (hψ : cochainCokernelMap ψ = p) : + (shortExactTriangle φ p hex hF hG hH hi hp).mor₂ = + (HomotopyCategory.quotient _ _).map ψ := by + apply (cochainHomotopyCokernelEquiv hG.to_chain hH.to_chain.toExactProjectiveComplex).injective + change cochainHomotopyCokernelEquiv hG.to_chain hH.to_chain.toExactProjectiveComplex + (((HomotopyCategory.quotient _ _).map (mappingCone.inr φ)) ≫ + (shortExactConeIso φ p hex hF hG hH hi hp).hom) = _ + rw [cochainHomotopyCokernelEquiv_comp hG.to_chain + (mappingCone_totallyAcyclic φ hF hG).to_chain hH.to_chain.toExactProjectiveComplex, + shortExactConeIso_hom, cochainHomotopyCokernelEquiv_map, cochainHomotopyCokernelEquiv_map, + StableHom.comp_classOf] + apply congrArg (StableHom.classOf R _ _) + rw [LinearMap.comp_assoc, completeConeQuotient_inr] + apply LinearMap.ext + intro x + apply (cochainCokernelLinearEquiv H).injective + have h := DFunLike.congr_fun (cochainCokernelLinearEquiv_natural ψ) x + rw [hψ] at h + simpa only [LinearMap.comp_apply, LinearEquiv.coe_coe, LinearEquiv.apply_symm_apply] using h.symm + +include hex hF hG hH hi hp in + +theorem exists_shortExact_distinguished (ψ : G ⟶ H) (hψ : cochainCokernelMap ψ = p) : + ∃ δ : (HomotopyCategory.quotient _ _).obj H ⟶ + ((HomotopyCategory.quotient _ _).obj F)⟦(1 : ℤ)⟧, + Triangle.mk ((HomotopyCategory.quotient _ _).map φ) + ((HomotopyCategory.quotient _ _).map ψ) δ ∈ + distTriang (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := by + refine ⟨(shortExactTriangle φ p hex hF hG hH hi hp).mor₃, ?_⟩ + have ht := shortExactTriangle_distinguished φ p hex hF hG hH hi hp + have he := shortExactTriangle_second φ p hex hF hG hH hi hp ψ hψ + change (Triangle.mk _ _ _) ∈ _ at ht + rw [← he] + exact ht + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/SplitQuotient.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/SplitQuotient.lean new file mode 100644 index 0000000000000000000000000000000000000000..089e9f3cb92d7ffb1a19245720b0109ffd219b41 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/SplitQuotient.lean @@ -0,0 +1,22 @@ +import Mathlib.Algebra.Algebra.Prod +import Mathlib.Algebra.Algebra.Pi +import Mathlib.Data.Fin.VecNotation +import Mathlib.Tactic.FinCases + +namespace OAI + +namespace ArExplicit + +def eightCoordinates (k : Type*) [CommSemiring k] : + (((k × k) × (k × k)) × ((k × k) × (k × k))) ≃ₐ[k] (Fin 8 → k) where + toFun a := ![a.1.1.1, a.1.1.2, a.1.2.1, a.1.2.2, a.2.1.1, a.2.1.2, a.2.2.1, a.2.2.2] + invFun a := (((a 0, a 1), (a 2, a 3)), ((a 4, a 5), (a 6, a 7))) + left_inv a := rfl + right_inv a := by ext i; fin_cases i <;> rfl + map_mul' a b := by ext i; fin_cases i <;> rfl + map_add' a b := by ext i; fin_cases i <;> rfl + commutes' c := by ext i; fin_cases i <;> rfl + +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/TBoundaryCochain.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/TBoundaryCochain.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ba99090b21d1bd64e564976a0126b15ba027149 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/TBoundaryCochain.lean @@ -0,0 +1,83 @@ +import OAI.Algebra.AuslanderReiten.Bar.TBarLift +import OAI.Algebra.AuslanderReiten.Cocycles.TwistedBoundary +import OAI.Algebra.AuslanderReiten.Modules.TwistedOneCochain + +namespace OAI + +noncomputable section +open scoped TensorProduct + +namespace ArExplicit.T + +variable {k : Type*} [Field k] (q : k) +local notation "R" => T k q + +def Z (H : kˣ) : + AbsoluteBar.twistedObject k R (TrivialExtension.twist H) 2 →ₗ[AbsoluteBar.Enveloping k R] + AbsoluteBar.moduleObject k R 0 := + AbsoluteBar.oneCochain k R (TrivialExtension.twist H) (CocycleData.z q H) + +private theorem twist_symm_apply (H : kˣ) (a : R) : + (TrivialExtension.twist H).symm a = TrivialExtension.twist H⁻¹ a := rfl + +private theorem casimirMap_right (H : kˣ) (a : R) : + AbsoluteBar.casimirMap k R (twistedCasimir q H) a = + AbsoluteBar.right k R 1 (MulOpposite.op ((TrivialExtension.twist H).symm a)) + (twistedCasimir q H) := by + have hh := twistedCasimir_equivariant q H ((TrivialExtension.twist H).symm a) + rw [AlgEquiv.apply_symm_apply] at hh + exact hh + +theorem pB_bottom_tmul (H : kˣ) (a b c d : R) : + AbsoluteBar.cochain3Linear k R (CocycleData.p q) + (AbsoluteBar.casimirInsertion k R (twistedCasimir q H) 3 + (a ⊗ₜ[k] (b ⊗ₜ[k] (c ⊗ₜ[k] d)))) = + a * (∑ i : TIndex, CocycleData.p q b c (TrivialExtension.twist H (vector q i)) * + vector q i.star) * (TrivialExtension.twist H).symm d := by + change AbsoluteBar.cochain3Linear k R (CocycleData.p q) + (a ⊗ₜ[k] (b ⊗ₜ[k] (c ⊗ₜ[k] AbsoluteBar.casimirMap k R (twistedCasimir q H) d))) = _ + rw [casimirMap_right] + simp only [twistedCasimir, map_sum, AbsoluteBar.right_tmul k R 0, + AbsoluteBar.right_zero k R, MulOpposite.unop_op, + TensorProduct.tmul_sum, AbsoluteBar.cochain3Linear_tmul k R (CocycleData.p q)] + rw [Finset.mul_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + simp only [mul_assoc] + +variable [CharP k 2] + +theorem pB_bottom_linear (H : kˣ) : + (AbsoluteBar.cochain3Linear k R (CocycleData.p q)).comp + (AbsoluteBar.casimirInsertion k R (twistedCasimir q H) 3) = + (AbsoluteBar.oneCochainLinear k R (TrivialExtension.twist H) (CocycleData.z q H)).comp + (AbsoluteBar.boundary k R 2) := by + apply TensorProduct.ext' + intro a x + induction x using TensorProduct.inductionOn with + | add x y hx hy => simp only [TensorProduct.tmul_add, map_add, hx, hy] + | tmul b x => + induction x using TensorProduct.inductionOn with + | add x y hx hy => simp only [TensorProduct.tmul_add, map_add, hx, hy] + | tmul c d => + change AbsoluteBar.cochain3Linear k R (CocycleData.p q) + (AbsoluteBar.casimirInsertion k R (twistedCasimir q H) 3 + (a ⊗ₜ[k] (b ⊗ₜ[k] (c ⊗ₜ[k] d)))) = + AbsoluteBar.oneCochainLinear k R (TrivialExtension.twist H) (CocycleData.z q H) + (AbsoluteBar.boundary k R 2 (a ⊗ₜ[k] (b ⊗ₜ[k] (c ⊗ₜ[k] d)))) + rw [pB_bottom_tmul, AbsoluteBar.oneCochain_boundary_tmul] + rw [CocycleData.twisted_boundary] + rfl + +theorem pB_bottom (H : kˣ) : + (AbsoluteBar.cochain3 k R (CocycleData.p q)).comp (B q H 3) = + (Z q H).comp (AbsoluteBar.twistedDifferential k R (TrivialExtension.twist H) 2) := by + apply LinearMap.ext + intro x + exact LinearMap.congr_fun (pB_bottom_linear q H) x + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/TNullhomotopy.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/TNullhomotopy.lean new file mode 100644 index 0000000000000000000000000000000000000000..e345fee306a741f17a7157988e21bfb745777783 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/TNullhomotopy.lean @@ -0,0 +1,86 @@ +import OAI.Algebra.AuslanderReiten.Homology.TBoundaryCochain +import OAI.Algebra.AuslanderReiten.Homology.ProjectiveNullhomotopyAbove + +namespace OAI + +noncomputable section + +namespace ArExplicit.T + +variable {k : Type*} [Field k] [CharP k 2] (q : k) +local notation "R" => T k q +local notation "Ae" => AbsoluteBar.Enveloping k R + +def pB (H : kˣ) (n : ℕ) : + AbsoluteBar.twistedObject k R (TrivialExtension.twist H) (n + 3) →ₗ[Ae] + AbsoluteBar.moduleObject k R (n + 1) := + (P q n).comp (B q H (n + 3)) + +private theorem B_comm (H : kˣ) (n : ℕ) : + (AbsoluteBar.differential k R (n + 1)).comp (B q H (n + 1)) = + (B q H n).comp (AbsoluteBar.twistedDifferential k R (TrivialExtension.twist H) n) := by + apply LinearMap.ext + intro x + have hh := LinearMap.congr_fun (B_differential q H n) x + simp only [LinearMap.add_apply, LinearMap.comp_apply, LinearMap.zero_apply] at hh + exact add_right_cancel (hh.trans + (SparseParity.module_add_self_eq_zero (k := k) (B q H n + (AbsoluteBar.twistedDifferential k R (TrivialExtension.twist H) n x))).symm) + +private theorem P_comm (n : ℕ) : + (AbsoluteBar.differential k R (n + 1)).comp (P q (n + 1)) = + (P q n).comp (AbsoluteBar.differential k R (n + 4)) := by + apply LinearMap.ext + intro x + exact P_differential q (n + 1) x + +theorem pB_comm (H : kˣ) (n : ℕ) : + (AbsoluteBar.differential k R (n + 1)).comp (pB q H (n + 1)) = + (pB q H n).comp (AbsoluteBar.twistedDifferential k R (TrivialExtension.twist H) (n + 3)) := by + unfold pB + rw [← LinearMap.comp_assoc, P_comm, LinearMap.comp_assoc, B_comm, ← LinearMap.comp_assoc] + +theorem exists_G (H : kˣ) : + ∃ G : (n : ℕ) → + AbsoluteBar.twistedObject k R (TrivialExtension.twist H) (n + 2) →ₗ[Ae] + AbsoluteBar.moduleObject k R (n + 1), + (AbsoluteBar.differential k R 0).comp (G 0) = Z q H ∧ + ∀ n, pB q H n = (AbsoluteBar.differential k R (n + 1)).comp (G (n + 1)) + + (G n).comp (AbsoluteBar.twistedDifferential k R (TrivialExtension.twist H) (n + 2)) := by + apply ProjectiveNullhomotopyAbove.exists_homotopy + (P := fun n => AbsoluteBar.moduleObject k R (n + 1)) + (Q := fun n => AbsoluteBar.twistedObject k R (TrivialExtension.twist H) (n + 1)) + (fun n => AbsoluteBar.differential k R (n + 1)) + (fun n => AbsoluteBar.twistedDifferential k R (TrivialExtension.twist H) (n + 1)) + (pB q H) (fun n => AbsoluteBar.twistedProjective k R (TrivialExtension.twist H) n) + · intro n + apply LinearMap.ext + exact AbsoluteBar.boundary_squared k R (n + 1) + · intro n + exact AbsoluteBar.differential_exact k R (n + 1) + · exact pB_comm q H + · intro x + exact ⟨AbsoluteBar.contraction k R 0 x, AbsoluteBar.augmentation_contraction k R x⟩ + · exact AbsoluteBar.differential_exact k R 0 + · change (AbsoluteBar.differential k R 0).comp ((P q 0).comp (B q H 3)) = _ + rw [← LinearMap.comp_assoc, P_augmentation, pB_bottom] + +def G (H : kˣ) (n : ℕ) : + AbsoluteBar.twistedObject k R (TrivialExtension.twist H) (n + 2) →ₗ[Ae] + AbsoluteBar.moduleObject k R (n + 1) := + Classical.choose (exists_G q H) n + +theorem G_augmentation (H : kˣ) : + (AbsoluteBar.differential k R 0).comp (G q H 0) = Z q H := + (Classical.choose_spec (exists_G q H)).1 + +theorem G_equation (H : kˣ) (n : ℕ) : + pB q H n = (AbsoluteBar.differential k R (n + 1)).comp (G q H (n + 1)) + + (G q H n).comp (AbsoluteBar.twistedDifferential k R (TrivialExtension.twist H) (n + 2)) := + (Classical.choose_spec (exists_G q H)).2 n + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/TTwistCompatibility.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/TTwistCompatibility.lean new file mode 100644 index 0000000000000000000000000000000000000000..e6f7c8bb0210c83a62fc7f36023c6bec8979c534 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/TTwistCompatibility.lean @@ -0,0 +1,23 @@ +import OAI.Algebra.AuslanderReiten.Bar.ModuleBarTwistCocycle + +namespace OAI + +noncomputable section +namespace ArExplicit.T +universe u +variable {k : Type u} [Field k] (q : k) (H : kˣ) + +theorem inverseTwist_cubic_compatible (a b d : T k q) (m : Resolution.Simple q) : + CocycleData.p q ((TrivialExtension.twist H).symm a) + ((TrivialExtension.twist H).symm b) ((TrivialExtension.twist H).symm d) • + (LinearEquiv.refl k (Resolution.Simple q)) m = + ((H⁻¹ : kˣ) : k) • (LinearEquiv.refl k (Resolution.Simple q)) + (CocycleData.p q a b d • m) := by + simp only [LinearEquiv.refl_apply] + exact p_inverse_twist_simple q H a b d m + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/TTwistFactor.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/TTwistFactor.lean new file mode 100644 index 0000000000000000000000000000000000000000..dac05af76c578692d1251e587984133c279d0464 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/TTwistFactor.lean @@ -0,0 +1,19 @@ +import OAI.Algebra.AuslanderReiten.Ext.TTwistExtPolynomial + +namespace OAI + +noncomputable section +namespace ArExplicit.Resolution +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H : kˣ) + +theorem tInverseTwistExt_factor (n : ℕ) : + ModuleBar.twistExtAction k (ArExplicit.T k q) (Simple q) (TrivialExtension.twist H).symm + (LinearEquiv.refl k _) (ArExplicit.T.inverseTwist_simple_compatible q H) n = + tInverseTwistExt q H n := rfl + +end ArExplicit.Resolution + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleConnectingProduct.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleConnectingProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..e4fb920d352181d213b406ecb4cbf142f6716347 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleConnectingProduct.lean @@ -0,0 +1,58 @@ +import OAI.Algebra.AuslanderReiten.Homology.TriangleGradedSequence +import Mathlib.CategoryTheory.Shift.ShiftedHom + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Pretriangulated +namespace ArExplicit.TriangleGradedSequence +universe u v w +variable (k : Type u) [CommRing k] [CharP k 2] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable [HasShift C ℤ] +variable [∀ n : ℤ, (CategoryTheory.shiftFunctor C n).Additive] +variable (T : Triangle C) (X : C) + +theorem integerUnit_smul {M : Type*} [AddCommGroup M] [Module k M] + (s : ℤˣ) (x : M) : s • x = x := by + rcases Int.units_eq_one_or s with rfl | rfl + · exact one_smul _ x + · change (-1 : ℤ) • x = x + rw [neg_one_zsmul] + apply neg_eq_iff_add_eq_zero.mpr + rw [← two_smul k, show (2 : k) = 0 from CharP.cast_eq_zero k 2, zero_smul] + +theorem first_eq_shift (n : ℤ) (v : Bottom T X n) : + first k T X n v = v ≫ T.mor₁⟦n⟧' := by + change v ≫ (n.negOnePow • T.mor₁⟦n⟧') = _ + rw [integerUnit_smul k] + +theorem second_eq_shift (n : ℤ) (v : Middle T X n) : + second k T X n v = v ≫ T.mor₂⟦n⟧' := by + change v ≫ (n.negOnePow • T.mor₂⟦n⟧') = _ + rw [integerUnit_smul k] + +theorem nextIso_inv_first (n : ℤ) : + (nextIso T n).inv.hom₁ = + (CategoryTheory.shiftFunctorAdd' C n 1 (n+1) rfl).inv.app T.obj₁ := by + simp [nextIso] + rfl + +theorem connecting_eq_product (n : ℤ) (v : Top T X n) : + connecting k T X n v = ShiftedHom.comp v T.mor₃ (add_comm 1 n) := by + change v ≫ ((n.negOnePow • T.mor₃⟦n⟧' ≫ + (CategoryTheory.shiftFunctorComm C 1 n).hom.app T.obj₁) ≫ + (nextIso T n).inv.hom₁) = _ + rw [integerUnit_smul k, nextIso_inv_first] + simp only [ShiftedHom.comp, + CategoryTheory.shiftFunctorComm_eq C 1 n (n+1) (add_comm 1 n), + Iso.trans_hom, NatTrans.comp_app, Iso.symm_hom] + erw [Category.assoc, Category.assoc, Category.assoc, Iso.hom_inv_id_app, + Category.comp_id] + rfl + +end ArExplicit.TriangleGradedSequence + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleGradedSequence.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleGradedSequence.lean new file mode 100644 index 0000000000000000000000000000000000000000..603088cc121790cda75d9e3c6108d61428536a35 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleGradedSequence.lean @@ -0,0 +1,93 @@ +import OAI.Algebra.AuslanderReiten.Homology.TriangleHomExact + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Pretriangulated + +namespace ArExplicit.TriangleGradedSequence + +universe u v w +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable [Limits.HasZeroObject C] [HasShift C ℤ] +variable [∀ n : ℤ, (CategoryTheory.shiftFunctor C n).Additive] [Pretriangulated C] +variable (T : Triangle C) (X : C) + +abbrev Bottom (n : ℤ) := X ⟶ (T⟦n⟧).obj₁ +abbrev Middle (n : ℤ) := X ⟶ (T⟦n⟧).obj₂ +abbrev Top (n : ℤ) := X ⟶ (T⟦n⟧).obj₃ + +def nextIso (n : ℤ) : T⟦n + 1⟧ ≅ (T⟦n⟧)⟦(1 : ℤ)⟧ := + (CategoryTheory.shiftFunctorAdd' (Triangle C) n 1 (n + 1) rfl).app T + +def first (n : ℤ) : Bottom T X n →ₗ[k] Middle T X n := + Linear.rightComp k X (T⟦n⟧).mor₁ + +def second (n : ℤ) : Middle T X n →ₗ[k] Top T X n := + Linear.rightComp k X (T⟦n⟧).mor₂ + +def connecting (n : ℤ) : Top T X n →ₗ[k] Bottom T X (n + 1) := + Linear.rightComp k X ((T⟦n⟧).mor₃ ≫ (nextIso T n).inv.hom₁) + +variable (hT : T ∈ distTriang C) +include hT + +theorem exact_middle (n : ℤ) : + LinearMap.range (first k T X n) = LinearMap.ker (second k T X n) := + shiftedTriangleHom_middle_exact k T hT X n + +theorem exact_top (n : ℤ) : + LinearMap.range (second k T X n) = LinearMap.ker (connecting k T X n) := by + ext f + constructor + · rintro ⟨g, rfl⟩ + change (g ≫ (T⟦n⟧).mor₂) ≫ ((T⟦n⟧).mor₃ ≫ (nextIso T n).inv.hom₁) = 0 + erw [Category.assoc, ← Category.assoc (T⟦n⟧).mor₂, comp_distTriang_mor_zero₂₃ _ (T.shift_distinguished hT n)] + erw [Limits.zero_comp, Limits.comp_zero] + · intro hf + have hz : f ≫ (T⟦n⟧).mor₃ = 0 := by + apply (cancel_mono (nextIso T n).inv.hom₁).mp + change f ≫ ((T⟦n⟧).mor₃ ≫ (nextIso T n).inv.hom₁) = 0 at hf + erw [Category.assoc, Limits.zero_comp] + exact hf + obtain ⟨g, hg⟩ := (T⟦n⟧).coyoneda_exact₃ (T.shift_distinguished hT n) f hz + exact ⟨g, hg.symm⟩ + +omit hT [Limits.HasZeroObject C] [Pretriangulated C] in +private theorem next_first (n : ℤ) : + ((T⟦n⟧)⟦(1 : ℤ)⟧).mor₁ = -((T⟦n⟧).mor₁⟦(1 : ℤ)⟧') := by + simp [Triangle.shiftFunctor, Triangle.shiftFunctor_eq] + rfl + +theorem exact_next (n : ℤ) : + LinearMap.range (connecting k T X n) = LinearMap.ker (first k T X (n + 1)) := by + ext f + constructor + · rintro ⟨g, rfl⟩ + change (g ≫ ((T⟦n⟧).mor₃ ≫ (nextIso T n).inv.hom₁)) ≫ (T⟦n + 1⟧).mor₁ = 0 + erw [Category.assoc g, Category.assoc (T⟦n⟧).mor₃, ← (nextIso T n).inv.comm₁] + erw [next_first, Preadditive.neg_comp, Preadditive.comp_neg, ← Category.assoc (T⟦n⟧).mor₃, + comp_distTriang_mor_zero₃₁ _ (T.shift_distinguished hT n)] + erw [Limits.zero_comp, neg_zero, Limits.comp_zero] + · intro hf + have hz : (f ≫ (nextIso T n).hom.hom₁) ≫ ((T⟦n⟧)⟦(1 : ℤ)⟧).mor₁ = 0 := by + erw [Category.assoc, ← (nextIso T n).hom.comm₁, ← Category.assoc] + change ((first k T X (n + 1)) f) ≫ _ = 0 + rw [show first k T X (n + 1) f = 0 from hf] + simp + erw [next_first, Preadditive.comp_neg, neg_eq_zero] at hz + obtain ⟨g, hg⟩ := (T⟦n⟧).coyoneda_exact₁ (T.shift_distinguished hT n) + (f ≫ (nextIso T n).hom.hom₁) hz + refine ⟨g, ?_⟩ + change g ≫ ((T⟦n⟧).mor₃ ≫ (nextIso T n).inv.hom₁) = f + erw [← Category.assoc, ← hg, Category.assoc] + have hi : (nextIso T n).hom.hom₁ ≫ (nextIso T n).inv.hom₁ = 𝟙 _ := by + exact congrArg (fun m => m.hom₁) (nextIso T n).hom_inv_id + erw [hi, Category.comp_id] + +end ArExplicit.TriangleGradedSequence + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleHomExact.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleHomExact.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3b5ed4a5dc146ad5fff87a1b39d81dd82c7c67d --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleHomExact.lean @@ -0,0 +1,98 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomLinear +import Mathlib.CategoryTheory.Triangulated.Pretriangulated + +namespace OAI + +open CategoryTheory CategoryTheory.Pretriangulated +open CochainComplex CochainComplex.HomComplex + +namespace ArExplicit + +universe u v w + +section Homotopy + +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable (K L : CochainComplex C ℤ) (n : ℤ) + +noncomputable def fullHomHomotopyLinearEquiv : + CohomologyClass K L n ≃ₗ[k] + ((HomotopyCategory.quotient C _).obj K ⟶ + (HomotopyCategory.quotient C _).obj (L⟦n⟧)) := + { CohomologyClass.homAddEquiv with + map_smul' := by + intro a x + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + change CohomologyClass.toHom (CohomologyClass.mk (a • x)) = + a • CohomologyClass.toHom (CohomologyClass.mk x) + rw [CohomologyClass.toHom_mk, CohomologyClass.toHom_mk, + CompleteComparison.cocycleHom_smul, Functor.map_smul] } + +end Homotopy + +section Triangle + +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable [Limits.HasZeroObject C] [HasShift C ℤ] +variable [∀ n : ℤ, (CategoryTheory.shiftFunctor C n).Additive] [Pretriangulated C] +variable (T : Triangle C) (hT : T ∈ distTriang C) (X : C) + +include hT + +theorem triangleHom_middle_exact : + LinearMap.range (Linear.rightComp k X T.mor₁) = + LinearMap.ker (Linear.rightComp k X T.mor₂) := by + ext f + constructor + · rintro ⟨g, rfl⟩ + change (g ≫ T.mor₁) ≫ T.mor₂ = 0 + rw [Category.assoc, comp_distTriang_mor_zero₁₂ T hT, Limits.comp_zero] + · intro h + obtain ⟨g, hg⟩ := T.coyoneda_exact₂ hT f h + exact ⟨g, hg.symm⟩ + +theorem triangleHom_top_exact : + LinearMap.range (Linear.rightComp k X T.mor₂) = + LinearMap.ker (Linear.rightComp k X T.mor₃) := by + ext f + constructor + · rintro ⟨g, rfl⟩ + change (g ≫ T.mor₂) ≫ T.mor₃ = 0 + rw [Category.assoc, comp_distTriang_mor_zero₂₃ T hT, Limits.comp_zero] + · intro h + obtain ⟨g, hg⟩ := T.coyoneda_exact₃ hT f h + exact ⟨g, hg.symm⟩ + +theorem triangleHom_bottom_exact : + LinearMap.range (Linear.rightComp k X T.mor₃) = + LinearMap.ker (Linear.rightComp k X (T.mor₁⟦(1 : ℤ)⟧')) := by + ext f + constructor + · rintro ⟨g, rfl⟩ + change (g ≫ T.mor₃) ≫ T.mor₁⟦(1 : ℤ)⟧' = 0 + rw [Category.assoc, comp_distTriang_mor_zero₃₁ T hT, Limits.comp_zero] + · intro h + obtain ⟨g, hg⟩ := T.coyoneda_exact₁ hT f h + exact ⟨g, hg.symm⟩ + +theorem shiftedTriangleHom_middle_exact (n : ℤ) : + LinearMap.range (Linear.rightComp k X (T⟦n⟧).mor₁) = + LinearMap.ker (Linear.rightComp k X (T⟦n⟧).mor₂) := + triangleHom_middle_exact k _ (T.shift_distinguished hT n) X + +theorem shiftedTriangleHom_top_exact (n : ℤ) : + LinearMap.range (Linear.rightComp k X (T⟦n⟧).mor₂) = + LinearMap.ker (Linear.rightComp k X (T⟦n⟧).mor₃) := + triangleHom_top_exact k _ (T.shift_distinguished hT n) X + +theorem shiftedTriangleHom_bottom_exact (n : ℤ) : + LinearMap.range (Linear.rightComp k X (T⟦n⟧).mor₃) = + LinearMap.ker (Linear.rightComp k X ((T⟦n⟧).mor₁⟦(1 : ℤ)⟧')) := + triangleHom_bottom_exact k _ (T.shift_distinguished hT n) X + +end Triangle +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleMiddleTransport.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleMiddleTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..defead7d7ade60213b48ed4160a98ee43c4fa9a4 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleMiddleTransport.lean @@ -0,0 +1,38 @@ +import Mathlib.CategoryTheory.Triangulated.Pretriangulated + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory CategoryTheory.Pretriangulated +universe u v +variable {C : Type u} [Category.{v} C] [HasShift C ℤ] +variable (T : Triangle C) {Y : C} (e : T.obj₂ ≅ Y) + +def triangleReplaceMiddle : Triangle C := + Triangle.mk (T.mor₁ ≫ e.hom) (e.inv ≫ T.mor₂) T.mor₃ + +def triangleReplaceMiddleIso : T ≅ triangleReplaceMiddle T e := + Triangle.isoMk _ _ (Iso.refl _) e (Iso.refl _) + (by + change T.mor₁ ≫ e.hom = 𝟙 _ ≫ (T.mor₁ ≫ e.hom) + rw [Category.id_comp]) + (by + change T.mor₂ ≫ 𝟙 _ = e.hom ≫ (e.inv ≫ T.mor₂) + rw [Category.comp_id, Iso.hom_inv_id_assoc]) + (by + change T.mor₃ ≫ (CategoryTheory.shiftFunctor C 1).map (𝟙 _) = 𝟙 _ ≫ T.mor₃ + rw [(CategoryTheory.shiftFunctor C 1).map_id, Category.id_comp, Category.comp_id]) + +variable [Preadditive C] [Limits.HasZeroObject C] +variable [∀ n : ℤ, (CategoryTheory.shiftFunctor C n).Additive] [Pretriangulated C] + +theorem triangleReplaceMiddle_distinguished (hT : T ∈ distTriang C) : + triangleReplaceMiddle T e ∈ distTriang C := + (distinguished_iff_of_iso (triangleReplaceMiddleIso T e)).mp hT + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleRecurrence.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleRecurrence.lean new file mode 100644 index 0000000000000000000000000000000000000000..694c4fc75b250ac75ad105e7ab832ae4596008fb --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/TriangleRecurrence.lean @@ -0,0 +1,86 @@ +import Mathlib.CategoryTheory.Triangulated.Pretriangulated +import Mathlib.CategoryTheory.Shift.ShiftedHom + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Pretriangulated +namespace ArExplicit.TriangleRecurrence + +universe v u +variable {C : Type u} [Category.{v} C] [Preadditive C] [Limits.HasZeroObject C] [HasShift C ℤ] + [∀ n : ℤ, (shiftFunctor C n).Additive] [Pretriangulated C] + +variable (T : Triangle C) (hT : T ∈ distTriang C) (Y : C) +include hT + +theorem connecting_surjective (h : ∀ f : T.obj₂ ⟶ Y, f = 0) : + Function.Surjective (fun f : T.obj₁⟦(1 : ℤ)⟧ ⟶ Y => T.mor₃ ≫ f) := by + intro f + obtain ⟨g, hg⟩ := T.yoneda_exact₃ hT f (h _) + exact ⟨g, hg.symm⟩ + +theorem connecting_injective (h : ∀ f : T.obj₂⟦(1 : ℤ)⟧ ⟶ Y, f = 0) : + Function.Injective (fun f : T.obj₁⟦(1 : ℤ)⟧ ⟶ Y => T.mor₃ ≫ f) := by + intro f g hfg + change T.mor₃ ≫ f = T.mor₃ ≫ g at hfg + have hz : T.mor₃ ≫ (f - g) = 0 := by + rw [Preadditive.comp_sub, hfg, sub_self] + obtain ⟨a, ha⟩ := T.rotate.rotate.yoneda_exact₂ + (rot_of_distTriang _ (rot_of_distTriang _ hT)) (f - g) hz + have ha0 : a = 0 := h a + have hf : f - g = 0 := by + rw [ha, ha0] + exact Limits.comp_zero + exact sub_eq_zero.mp hf + +theorem connecting_bijective + (h₀ : ∀ f : T.obj₂ ⟶ Y, f = 0) + (h₁ : ∀ f : T.obj₂⟦(1 : ℤ)⟧ ⟶ Y, f = 0) : + Function.Bijective (fun f : T.obj₁⟦(1 : ℤ)⟧ ⟶ Y => T.mor₃ ≫ f) := + ⟨connecting_injective T hT Y h₁, connecting_surjective T hT Y h₀⟩ + +def connectingEquiv + (h₀ : ∀ f : T.obj₂ ⟶ Y, f = 0) + (h₁ : ∀ f : T.obj₂⟦(1 : ℤ)⟧ ⟶ Y, f = 0) : + (T.obj₁⟦(1 : ℤ)⟧ ⟶ Y) ≃+ (T.obj₃ ⟶ Y) := + AddEquiv.ofBijective + ({ toFun f := T.mor₃ ≫ f + map_zero' := Limits.comp_zero + map_add' f g := by simp only [Preadditive.comp_add] } : + (T.obj₁⟦(1 : ℤ)⟧ ⟶ Y) →+ (T.obj₃ ⟶ Y)) + (connecting_bijective T hT Y h₀ h₁) + +omit hT in + +def shiftedMapEquiv (X Z : C) (a b c : ℤ) (h : b + a = c) : + ShiftedHom X Z b ≃ (X⟦a⟧ ⟶ Z⟦c⟧) := + (Functor.FullyFaithful.ofFullyFaithful (shiftFunctor C a)).homEquiv.trans + (((shiftFunctorAdd' C b a c h).symm.app Z).homToEquiv) + +omit hT in + +theorem degreeThreeComposition_bijective (X I : C) + (a : X⟦(2 : ℤ)⟧ ⟶ I) (b : I ⟶ X) (d : X ⟶ (X⟦(2 : ℤ)⟧)⟦(1 : ℤ)⟧) + (hd : Triangle.mk a b d ∈ distTriang C) (n : ℤ) + (h₀ : ∀ f : I ⟶ X⟦n + 3⟧, f = 0) + (h₁ : ∀ f : I⟦(1 : ℤ)⟧ ⟶ X⟦n + 3⟧, f = 0) : + Function.Bijective (fun β : ShiftedHom X X n => + ShiftedHom.comp (a := (3 : ℤ)) (b := n) + (d ≫ (shiftFunctorAdd' C (2 : ℤ) 1 3 (by decide)).inv.app X) β rfl) := by + let e := shiftedMapEquiv X X 3 n (n + 3) rfl + let e' := ((shiftFunctorAdd' C (2 : ℤ) 1 3 (by decide)).app X).homFromEquiv + (Z := X⟦n + 3⟧) + have h := (connecting_bijective (Triangle.mk a b d) hd (X⟦n + 3⟧) h₀ h₁).comp + (e'.bijective.comp e.bijective) + convert! h using 1 + ext β + simp only [Function.comp_apply, e, e', shiftedMapEquiv, Equiv.trans_apply, + ShiftedHom.comp, Category.assoc] + rfl + +end ArExplicit.TriangleRecurrence + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunneth.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunneth.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e3ad714f2fb3d59d3e859774a6e58525cb556d1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunneth.lean @@ -0,0 +1,101 @@ +import OAI.Algebra.AuslanderReiten.Homology.VectorCochainSplitting +import OAI.Algebra.AuslanderReiten.Homology.CochainNatTensorSigns +import OAI.Algebra.AuslanderReiten.Homology.BifunctorHomotopyEquiv +import Mathlib.Algebra.Category.ModuleCat.Colimits +import Mathlib.Algebra.Category.ModuleCat.Products + +namespace OAI + +noncomputable section + +namespace ArExplicit.VectorCochain + +open CategoryTheory CategoryTheory.Limits HomologicalComplex + +universe u + +variable (k : Type u) [Field k] +variable (F : ModuleCat.{u} k ⥤ ModuleCat.{u} k ⥤ ModuleCat.{u} k) + [F.Additive] [∀ X, (F.obj X).Additive] + +instance hasMapBifunctor (P Q : CochainComplex (ModuleCat.{u} k) ℕ) : + HasMapBifunctor P Q F (ComplexShape.up ℕ) := fun _ => inferInstance + +theorem totalMap_quasiIso {P P' Q Q' : CochainComplex (ModuleCat.{u} k) ℕ} + (f : P ⟶ P') (g : Q ⟶ Q') [QuasiIso f] [QuasiIso g] : + QuasiIso (mapBifunctorMap f g F (ComplexShape.up ℕ)) := by + obtain ⟨e, rfl⟩ := (CochainComplex.quasiIso_iff_of_injective f).mp inferInstance + obtain ⟨e', rfl⟩ := (CochainComplex.quasiIso_iff_of_injective g).mp inferInstance + exact homotopyEquivalences_le_quasiIso _ _ _ ⟨totalHomotopyEquiv F e e', rfl⟩ + +theorem total_zero_differential (X Y : ℕ → ModuleCat.{u} k) (n m : ℕ) : + (mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F + (ComplexShape.up ℕ)).d n m = 0 := by + rw [mapBifunctor.d_eq] + have h₁ : mapBifunctor.D₁ (zeroDifferential k X) (zeroDifferential k Y) F + (ComplexShape.up ℕ) n m = 0 := by + apply mapBifunctor.hom_ext + intro i j h + rw [comp_zero, mapBifunctor.ι_D₁] + rw [mapBifunctor.d₁_eq' _ _ _ _ (show (ComplexShape.up ℕ).Rel i (i+1) from rfl)] + simp [zeroDifferential] + have h₂ : mapBifunctor.D₂ (zeroDifferential k X) (zeroDifferential k Y) F + (ComplexShape.up ℕ) n m = 0 := by + apply mapBifunctor.hom_ext + intro i j h + rw [comp_zero, mapBifunctor.ι_D₂] + rw [mapBifunctor.d₂_eq' _ _ _ _ i (show (ComplexShape.up ℕ).Rel j (j+1) from rfl)] + simp [zeroDifferential] + rw [h₁, h₂, add_zero] + +def totalZeroHomologyIso (X Y : ℕ → ModuleCat.{u} k) (n : ℕ) : + (mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F + (ComplexShape.up ℕ)).homology n ≅ + (mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F + (ComplexShape.up ℕ)).X n := + let K := mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F (ComplexShape.up ℕ) + (K.isoHomologyπ ((ComplexShape.up ℕ).prev n) n rfl + (total_zero_differential k F X Y _ _)).symm ≪≫ + K.iCyclesIso n ((ComplexShape.up ℕ).next n) rfl (total_zero_differential k F X Y _ _) + +variable (P Q : CochainComplex (ModuleCat.{u} k) ℕ) + +def tensorSplitting : + HomotopyEquiv + (mapBifunctor (gradedHomology k P) (gradedHomology k Q) F (ComplexShape.up ℕ)) + (mapBifunctor P Q F (ComplexShape.up ℕ)) := + totalHomotopyEquiv F (splitting k P) (splitting k Q) + +def kunnethIso (n : ℕ) : + (mapBifunctor P Q F (ComplexShape.up ℕ)).homology n ≅ + (mapBifunctor (gradedHomology k P) (gradedHomology k Q) F (ComplexShape.up ℕ)).X n := + ((tensorSplitting k F P Q).toHomologyIso n).symm ≪≫ + totalZeroHomologyIso k F (fun i => P.homology i) (fun j => Q.homology j) n + +theorem tensorSplitting_hom : + (tensorSplitting k F P Q).hom = + mapBifunctorMap (representatives k P) (representatives k Q) F (ComplexShape.up ℕ) := by + simp [tensorSplitting, totalHomotopyEquiv] + +theorem kunnethIso_inv (n : ℕ) : + (kunnethIso k F P Q n).inv = + (totalZeroHomologyIso k F (fun i => P.homology i) (fun j => Q.homology j) n).inv ≫ + homologyMap (mapBifunctorMap (representatives k P) (representatives k Q) F + (ComplexShape.up ℕ)) n := by + change _ ≫ homologyMap (tensorSplitting k F P Q).hom n = _ + rw [tensorSplitting_hom] + +def kunnethLinearEquiv (n : ℕ) : + (mapBifunctor P Q F (ComplexShape.up ℕ)).homology n ≃ₗ[k] + (Π₀ p : {p : ℕ × ℕ // p.1 + p.2 = n}, + (F.obj (P.homology p.val.1)).obj (Q.homology p.val.2)) := + (kunnethIso k F P Q n).toLinearEquiv.trans + (ModuleCat.coprodIsoDirectSum + (fun p : {p : ℕ × ℕ // p.1 + p.2 = n} => + (F.obj (P.homology p.val.1)).obj (Q.homology p.val.2))).toLinearEquiv + +end ArExplicit.VectorCochain + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethCycles.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethCycles.lean new file mode 100644 index 0000000000000000000000000000000000000000..8831927b8573c4d3f8123554d21f7f7f8e05f0ad --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethCycles.lean @@ -0,0 +1,90 @@ +import OAI.Algebra.AuslanderReiten.Homology.VectorCochainKunnethNaturality + +namespace OAI + +noncomputable section +namespace ArExplicit.VectorCochain +open CategoryTheory CategoryTheory.Limits HomologicalComplex +universe u +variable (k : Type u) [Field k] +variable (P : CochainComplex (ModuleCat.{u} k) ℕ) + +abbrev gradedCycles := zeroDifferential k (fun n => P.cycles n) + +def cyclesInclusion : gradedCycles k P ⟶ P where + f n := P.iCycles n + comm' _ _ _ := by simp [gradedCycles, zeroDifferential] + +def cyclesQuotient : gradedCycles k P ⟶ gradedHomology k P where + f n := P.homologyπ n + comm' _ _ _ := by simp [gradedCycles, gradedHomology, zeroDifferential] + +theorem cyclesMap_cyclesInclusion (n : ℕ) : + cyclesMap (cyclesInclusion k P) n = (gradedCycles k P).iCycles n := by + apply (cancel_mono (P.iCycles n)).1 + simp [cyclesInclusion] + +theorem homologyMap_cyclesInclusion (n : ℕ) : + homologyMap (cyclesInclusion k P) n = + (zeroHomologyIso k (fun i => P.cycles i) n).hom ≫ P.homologyπ n := by + apply (cancel_epi ((gradedCycles k P).homologyπ n)).1 + rw [homologyπ_naturality, cyclesMap_cyclesInclusion, ← Category.assoc, zeroHomologyIso_π] + +theorem cyclesInclusion_comp_splitting_inv : + cyclesInclusion k P ≫ (splitting k P).inv = cyclesQuotient k P := by + ext n : 1 + apply (cancel_epi (zeroHomologyIso k (fun i => P.cycles i) n).hom).1 + calc + (zeroHomologyIso k (fun i => P.cycles i) n).hom ≫ + (cyclesInclusion k P ≫ (splitting k P).inv).f n = + homologyMap (cyclesInclusion k P ≫ (splitting k P).inv) n ≫ + (zeroHomologyIso k (fun i => P.homology i) n).hom := + (zeroHomologyIso_natural k _ n).symm + _ = (zeroHomologyIso k (fun i => P.cycles i) n).hom ≫ (cyclesQuotient k P).f n := by + simp only [homologyMap_comp, homologyMap_cyclesInclusion, homologyMap_splitting_inv, + Category.assoc, Iso.inv_hom_id, Category.comp_id, cyclesQuotient] + +def cyclesInclusionHomotopy : + Homotopy (cyclesInclusion k P) (cyclesQuotient k P ≫ representatives k P) := by + have hh := ((splitting k P).homotopyInvHomId.compLeftId (cyclesInclusion k P)).symm + have he : cyclesInclusion k P ≫ ((splitting k P).inv ≫ (splitting k P).hom) = + cyclesQuotient k P ≫ representatives k P := by + rw [splitting_hom, ← Category.assoc, cyclesInclusion_comp_splitting_inv] + exact hh.trans (Homotopy.ofEq he) + +variable (F : ModuleCat.{u} k ⥤ ModuleCat.{u} k ⥤ ModuleCat.{u} k) + [F.Additive] [∀ X, (F.obj X).Additive] +variable (Q : CochainComplex (ModuleCat.{u} k) ℕ) + +def tensorCyclesInclusionHomotopy : + Homotopy (mapBifunctorMap (cyclesInclusion k P) (cyclesInclusion k Q) F (.up ℕ)) + (mapBifunctorMap (cyclesQuotient k P) (cyclesQuotient k Q) F (.up ℕ) ≫ + mapBifunctorMap (representatives k P) (representatives k Q) F (.up ℕ)) := + (mapBifunctorMapHomotopy₁ (cyclesInclusionHomotopy k P) + (cyclesInclusion k Q) F (.up ℕ)).trans + ((mapBifunctorMapHomotopy₂ (cyclesQuotient k P ≫ representatives k P) + (cyclesInclusionHomotopy k Q) F (.up ℕ)).trans + (Homotopy.ofEq (totalMap_comp F _ _ _ _).symm)) + +@[reassoc] theorem tensorRepresentatives_kunneth (n : ℕ) : + homologyMap (mapBifunctorMap (representatives k P) (representatives k Q) F (.up ℕ)) n ≫ + (kunnethIso k F P Q n).hom = + (totalZeroHomologyIso k F (fun i => P.homology i) (fun i => Q.homology i) n).hom := by + apply (cancel_epi (totalZeroHomologyIso k F + (fun i => P.homology i) (fun i => Q.homology i) n).inv).1 + rw [← Category.assoc, ← kunnethIso_inv, Iso.inv_hom_id, Iso.inv_hom_id] + +@[reassoc] theorem tensorCycles_kunneth (n : ℕ) : + homologyMap (mapBifunctorMap (cyclesInclusion k P) (cyclesInclusion k Q) F (.up ℕ)) n ≫ + (kunnethIso k F P Q n).hom = + (totalZeroHomologyIso k F (fun i => P.cycles i) (fun i => Q.cycles i) n).hom ≫ + (mapBifunctorMap (cyclesQuotient k P) (cyclesQuotient k Q) F (.up ℕ)).f n := by + rw [(tensorCyclesInclusionHomotopy k P F Q).homologyMap_eq, + homologyMap_comp, Category.assoc, tensorRepresentatives_kunneth, + totalZeroHomologyIso_natural] + +end ArExplicit.VectorCochain + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethLiteral.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethLiteral.lean new file mode 100644 index 0000000000000000000000000000000000000000..e0b2d895dfad60c478ae6795872ad67e6d38bdfe --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethLiteral.lean @@ -0,0 +1,93 @@ +import OAI.Algebra.AuslanderReiten.Homology.VectorCochainKunnethCycles +import OAI.Algebra.AuslanderReiten.Homology.CochainCycleClass +import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits HomologicalComplex +open scoped TensorProduct +namespace ArExplicit.VectorCochain +universe u +variable (k : Type u) [Field k] +variable (F : ModuleCat.{u} k ⥤ ModuleCat.{u} k ⥤ ModuleCat.{u} k) + [F.Additive] [∀ X, (F.obj X).Additive] + +private theorem totalZero_literalClass (U V : ℕ → ModuleCat.{u} k) (n : ℕ) + (z : LinearMap.ker ((mapBifunctor (zeroDifferential k U) (zeroDifferential k V) F + (.up ℕ)).d n (n+1)).hom) : + (totalZeroHomologyIso k F U V n).hom.hom + (literalClass k (mapBifunctor (zeroDifferential k U) (zeroDifferential k V) F (.up ℕ)) n z) = z.val := by + have h := congrArg (fun f => f.hom ((literalCyclesIso k + (mapBifunctor (zeroDifferential k U) (zeroDifferential k V) F (.up ℕ)) n).inv.hom z)) + (totalZeroHomologyIso_π k F U V n) + exact h.trans (literalCyclesIso_inv_iCycles k _ n z) + +variable (P Q : CochainComplex (ModuleCat.{u} k) ℕ) + +theorem kunneth_literal_cycles (n : ℕ) + (z : LinearMap.ker ((mapBifunctor (gradedCycles k P) (gradedCycles k Q) F (.up ℕ)).d n (n+1)).hom) + (w : LinearMap.ker ((mapBifunctor P Q F (.up ℕ)).d n (n+1)).hom) + (hw : ((mapBifunctorMap (cyclesInclusion k P) (cyclesInclusion k Q) F (.up ℕ)).f n).hom z.val = w.val) : + (kunnethIso k F P Q n).hom.hom (literalClass k (mapBifunctor P Q F (.up ℕ)) n w) = + ((mapBifunctorMap (cyclesQuotient k P) (cyclesQuotient k Q) F (.up ℕ)).f n).hom z.val := by + rw [← literalClass_map k _ n z w hw] + have h := congrArg (fun f => f.hom + (literalClass k (mapBifunctor (gradedCycles k P) (gradedCycles k Q) F (.up ℕ)) n z)) + (tensorCycles_kunneth k P F Q n) + change _ = ((mapBifunctorMap (cyclesQuotient k P) (cyclesQuotient k Q) F (.up ℕ)).f n).hom + ((totalZeroHomologyIso k F (fun i => P.cycles i) (fun i => Q.cycles i) n).hom.hom + (literalClass k (mapBifunctor (gradedCycles k P) (gradedCycles k Q) F (.up ℕ)) n z)) at h + rw [totalZero_literalClass] at h + exact h + +local notation "T" => MonoidalCategory.curriedTensor (ModuleCat k) + +theorem kunnethLinearEquiv_literal_tmul (i j n : ℕ) (hij : i+j=n) + (x : LinearMap.ker (P.d i (i+1)).hom) (y : LinearMap.ker (Q.d j (j+1)).hom) + (z : LinearMap.ker ((mapBifunctor P Q T (.up ℕ)).d n (n+1)).hom) + (hz : z.val = (ιMapBifunctor P Q T (.up ℕ) i j n hij).hom (x.val ⊗ₜ[k] y.val)) : + kunnethLinearEquiv k T P Q n (literalClass k (mapBifunctor P Q T (.up ℕ)) n z) = + (DFinsupp.single ⟨(i,j), hij⟩ (literalClass k P i x ⊗ₜ[k] literalClass k Q j y) : + Π₀ p : {p : ℕ × ℕ // p.1+p.2=n}, + (P.homology p.val.1 ⊗[k] Q.homology p.val.2)) := by + let xc := (literalCyclesIso k P i).inv.hom x + let yc := (literalCyclesIso k Q j).inv.hom y + let t := (ιMapBifunctor (gradedCycles k P) (gradedCycles k Q) T (.up ℕ) i j n hij).hom + (xc ⊗ₜ[k] yc) + have ht : ((mapBifunctor (gradedCycles k P) (gradedCycles k Q) T (.up ℕ)).d n (n+1)).hom t = 0 := by + rw [total_zero_differential] + rfl + let tc : LinearMap.ker ((mapBifunctor (gradedCycles k P) (gradedCycles k Q) T (.up ℕ)).d n (n+1)).hom := ⟨t, ht⟩ + have hm : ((mapBifunctorMap (cyclesInclusion k P) (cyclesInclusion k Q) T (.up ℕ)).f n).hom t = z.val := by + have h := congrArg (fun f => f.hom (xc ⊗ₜ[k] yc)) + (ι_mapBifunctorMap (cyclesInclusion k P) (cyclesInclusion k Q) T (.up ℕ) i j n hij) + change _ = (ιMapBifunctor P Q T (.up ℕ) i j n hij).hom + ((P.iCycles i).hom xc ⊗ₜ[k] (Q.iCycles j).hom yc) at h + rw [show (P.iCycles i).hom xc = x.val from literalCyclesIso_inv_iCycles k P i x, + show (Q.iCycles j).hom yc = y.val from literalCyclesIso_inv_iCycles k Q j y] at h + exact h.trans hz.symm + change (ModuleCat.coprodIsoDirectSum _).hom.hom + ((kunnethIso k T P Q n).hom.hom (literalClass k _ n z)) = _ + rw [kunneth_literal_cycles k T P Q n tc z hm] + have hq := congrArg (fun f => f.hom (xc ⊗ₜ[k] yc)) + (ι_mapBifunctorMap (cyclesQuotient k P) (cyclesQuotient k Q) T (.up ℕ) i j n hij) + change _ = (ιMapBifunctor (gradedHomology k P) (gradedHomology k Q) T (.up ℕ) i j n hij).hom + (literalClass k P i x ⊗ₜ[k] literalClass k Q j y) at hq + change (ModuleCat.coprodIsoDirectSum _).hom.hom + (((mapBifunctorMap (cyclesQuotient k P) (cyclesQuotient k Q) T (.up ℕ)).f n).hom t) = _ + change ((mapBifunctorMap (cyclesQuotient k P) (cyclesQuotient k Q) T (.up ℕ)).f n).hom t = + (ιMapBifunctor (gradedHomology k P) (gradedHomology k Q) T (.up ℕ) i j n hij).hom + (literalClass k P i x ⊗ₜ[k] literalClass k Q j y) at hq + erw [hq] + have hi := ModuleCat.ι_coprodIsoDirectSum_hom + (fun p : {p : ℕ × ℕ // p.1+p.2=n} => ((T).obj (P.homology p.val.1)).obj (Q.homology p.val.2)) + ⟨(i,j), hij⟩ + exact congrArg (fun f => (ModuleCat.Hom.hom f) + (literalClass k P i x ⊗ₜ[k] literalClass k Q j y)) hi + +end ArExplicit.VectorCochain + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethMap.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..d6baf94d605406602107cc9a606e97c9e97d1ffe --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethMap.lean @@ -0,0 +1,108 @@ +import OAI.Algebra.AuslanderReiten.Homology.VectorCochainKunnethNaturality +import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorComplex + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits HomologicalComplex +open scoped TensorProduct +namespace ArExplicit.VectorCochain +universe u +variable (k : Type u) [Field k] +local notation "T" => MonoidalCategory.curriedTensor (ModuleCat k) +variable (P Q : CochainComplex (ModuleCat.{u} k) ℕ) + +abbrev Diagonal (n : ℕ) := ExternalTensor.Diagonal n + +def totalTermCoordinates (n : ℕ) : + (mapBifunctor P Q T (.up ℕ)).X n ≃ₗ[k] + (∀ p : Diagonal n, P.X p.val.1 ⊗[k] Q.X p.val.2) := + (ModuleCat.coprodIsoDirectSum (fun p : Diagonal n => + ((T).obj (P.X p.val.1)).obj (Q.X p.val.2))).toLinearEquiv.trans + DFinsupp.linearEquivFunOnFintype + +theorem totalTermCoordinates_inclusion (i j n : ℕ) (h : i+j=n) + (x : P.X i ⊗[k] Q.X j) : + totalTermCoordinates k P Q n ((ιMapBifunctor P Q T (.up ℕ) i j n h).hom x) = + Pi.single ⟨(i,j),h⟩ x := by + have hi := ModuleCat.ι_coprodIsoDirectSum_hom + (fun p : Diagonal n => ((T).obj (P.X p.val.1)).obj (Q.X p.val.2)) ⟨(i,j),h⟩ + exact congrArg (fun y => DFinsupp.linearEquivFunOnFintype (R := k) y) + (congrArg (fun f => f.hom x) hi) + +variable {P Q} {P' Q' : CochainComplex (ModuleCat.{u} k) ℕ} + +def diagonalTermMap (f : P ⟶ P') (g : Q ⟶ Q') (n : ℕ) : + (∀ p : Diagonal n, P.X p.val.1 ⊗[k] Q.X p.val.2) →ₗ[k] + (∀ p : Diagonal n, P'.X p.val.1 ⊗[k] Q'.X p.val.2) where + toFun x p := TensorProduct.map (f.f p.val.1).hom (g.f p.val.2).hom (x p) + map_add' x y := by funext p; exact map_add _ _ _ + map_smul' a x := by + funext p + exact (TensorProduct.map (f.f p.val.1).hom (g.f p.val.2).hom).map_smul a (x p) + +theorem diagonalTermMap_single (f : P ⟶ P') (g : Q ⟶ Q') (n : ℕ) + (p : Diagonal n) (x : P.X p.val.1 ⊗[k] Q.X p.val.2) : + diagonalTermMap k f g n (Pi.single p x) = + Pi.single p (TensorProduct.map (f.f p.val.1).hom (g.f p.val.2).hom x) := by + classical + funext r + by_cases h : r=p + · subst r + simp only [diagonalTermMap, LinearMap.coe_mk, AddHom.coe_mk, Pi.single_eq_same] + · simp only [diagonalTermMap, LinearMap.coe_mk, AddHom.coe_mk, Pi.single_eq_of_ne h, + map_zero] + +theorem totalTermCoordinates_natural (f : P ⟶ P') (g : Q ⟶ Q') (n : ℕ) + (x : (mapBifunctor P Q T (.up ℕ)).X n) : + totalTermCoordinates k P' Q' n (((mapBifunctorMap f g T (.up ℕ)).f n).hom x) = + diagonalTermMap k f g n (totalTermCoordinates k P Q n x) := by + have hh : (mapBifunctorMap f g T (.up ℕ)).f n ≫ + ModuleCat.ofHom (totalTermCoordinates k P' Q' n).toLinearMap = + ModuleCat.ofHom ((diagonalTermMap k f g n).comp + (totalTermCoordinates k P Q n).toLinearMap) := by + apply mapBifunctor.hom_ext + intro i j hij + erw [← Category.assoc, ι_mapBifunctorMap] + apply ModuleCat.hom_ext + apply LinearMap.ext + intro z + change totalTermCoordinates k P' Q' n + ((ιMapBifunctor P' Q' T (.up ℕ) i j n hij).hom + (TensorProduct.map LinearMap.id (g.f j).hom + (TensorProduct.map (f.f i).hom LinearMap.id z))) = + diagonalTermMap k f g n (totalTermCoordinates k P Q n + ((ιMapBifunctor P Q T (.up ℕ) i j n hij).hom z)) + rw [TensorProduct.map_map] + simp only [LinearMap.id_comp, LinearMap.comp_id] + rw [totalTermCoordinates_inclusion, totalTermCoordinates_inclusion, + diagonalTermMap_single] + exact congrArg (fun a => a.hom x) hh + +def homologyCoordinates (n : ℕ) : + (mapBifunctor P Q T (.up ℕ)).homology n ≃ₗ[k] + (∀ p : Diagonal n, P.homology p.val.1 ⊗[k] Q.homology p.val.2) := + (kunnethIso k T P Q n).toLinearEquiv.trans + (totalTermCoordinates k (gradedHomology k P) (gradedHomology k Q) n) + +theorem homologyCoordinates_natural (f : P ⟶ P') (g : Q ⟶ Q') (n : ℕ) + (x : (mapBifunctor P Q T (.up ℕ)).homology n) : + homologyCoordinates k n ((homologyMap (mapBifunctorMap f g T (.up ℕ)) n).hom x) = + diagonalTermMap k (gradedMap k f) (gradedMap k g) n (homologyCoordinates k n x) := by + have hn := congrArg (fun a => a.hom x) (kunnethIso_natural k T f g n) + change (kunnethIso k T P' Q' n).hom.hom + ((homologyMap (mapBifunctorMap f g T (.up ℕ)) n).hom x) = + ((mapBifunctorMap (gradedMap k f) (gradedMap k g) T (.up ℕ)).f n).hom + ((kunnethIso k T P Q n).hom.hom x) at hn + change totalTermCoordinates k (gradedHomology k P') (gradedHomology k Q') n + ((kunnethIso k T P' Q' n).hom.hom + ((homologyMap (mapBifunctorMap f g T (.up ℕ)) n).hom x)) = _ + rw [hn] + exact totalTermCoordinates_natural k (gradedMap k f) (gradedMap k g) n _ + +end ArExplicit.VectorCochain + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethNaturality.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..49c4df101155119cdd9b597a440919c29222688b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainKunnethNaturality.lean @@ -0,0 +1,86 @@ +import OAI.Algebra.AuslanderReiten.Homology.VectorCochainNaturality + +namespace OAI + +noncomputable section +namespace ArExplicit.VectorCochain +open CategoryTheory CategoryTheory.Limits HomologicalComplex +universe u +variable (k : Type u) [Field k] +variable (F : ModuleCat.{u} k ⥤ ModuleCat.{u} k ⥤ ModuleCat.{u} k) + [F.Additive] [∀ X, (F.obj X).Additive] + +@[simp, reassoc] theorem totalZeroHomologyIso_π + (X Y : ℕ → ModuleCat.{u} k) (n : ℕ) : + (mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F (.up ℕ)).homologyπ n ≫ + (totalZeroHomologyIso k F X Y n).hom = + (mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F (.up ℕ)).iCycles n := by + let K := mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F (.up ℕ) + let a := K.isoHomologyπ ((ComplexShape.up ℕ).prev n) n rfl + (total_zero_differential k F X Y _ _) + let b := K.iCyclesIso n ((ComplexShape.up ℕ).next n) rfl + (total_zero_differential k F X Y _ _) + change a.hom ≫ a.inv ≫ b.hom = b.hom + exact a.hom_inv_id_assoc _ + +@[reassoc] theorem totalZeroHomologyIso_natural + {X Y X' Y' : ℕ → ModuleCat.{u} k} + (f : mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F (.up ℕ) ⟶ + mapBifunctor (zeroDifferential k X') (zeroDifferential k Y') F (.up ℕ)) (n : ℕ) : + homologyMap f n ≫ (totalZeroHomologyIso k F X' Y' n).hom = + (totalZeroHomologyIso k F X Y n).hom ≫ f.f n := by + apply (cancel_epi ((mapBifunctor (zeroDifferential k X) + (zeroDifferential k Y) F (.up ℕ)).homologyπ n)).1 + rw [homologyπ_naturality_assoc, totalZeroHomologyIso_π, ← Category.assoc, + totalZeroHomologyIso_π] + simp + +@[reassoc] theorem totalZeroHomologyIso_inv_natural + {X Y X' Y' : ℕ → ModuleCat.{u} k} + (f : mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F (.up ℕ) ⟶ + mapBifunctor (zeroDifferential k X') (zeroDifferential k Y') F (.up ℕ)) (n : ℕ) : + (totalZeroHomologyIso k F X Y n).inv ≫ homologyMap f n = + f.f n ≫ (totalZeroHomologyIso k F X' Y' n).inv := by + apply (cancel_mono (totalZeroHomologyIso k F X' Y' n).hom).1 + simp only [Category.assoc, totalZeroHomologyIso_natural, + Iso.inv_hom_id, Category.comp_id, Iso.inv_hom_id_assoc] + +variable {P P' Q Q' : CochainComplex (ModuleCat.{u} k) ℕ} + +def tensorRepresentativesNaturality (f : P ⟶ P') (g : Q ⟶ Q') : + Homotopy + (mapBifunctorMap (representatives k P) (representatives k Q) F (.up ℕ) ≫ + mapBifunctorMap f g F (.up ℕ)) + (mapBifunctorMap (gradedMap k f) (gradedMap k g) F (.up ℕ) ≫ + mapBifunctorMap (representatives k P') (representatives k Q') F (.up ℕ)) := + (Homotopy.ofEq (totalMap_comp F _ _ _ _)).trans + ((mapBifunctorMapHomotopy₁ (representativesNaturality k f) + (representatives k Q ≫ g) F (.up ℕ)).trans + ((mapBifunctorMapHomotopy₂ (gradedMap k f ≫ representatives k P') + (representativesNaturality k g) F (.up ℕ)).trans + (Homotopy.ofEq (totalMap_comp F _ _ _ _).symm))) + +@[reassoc] theorem kunnethIso_inv_natural (f : P ⟶ P') (g : Q ⟶ Q') (n : ℕ) : + (kunnethIso k F P Q n).inv ≫ homologyMap (mapBifunctorMap f g F (.up ℕ)) n = + (mapBifunctorMap (gradedMap k f) (gradedMap k g) F (.up ℕ)).f n ≫ + (kunnethIso k F P' Q' n).inv := by + rw [kunnethIso_inv, kunnethIso_inv] + rw [Category.assoc, ← homologyMap_comp, + (tensorRepresentativesNaturality k F f g).homologyMap_eq, + homologyMap_comp, ← Category.assoc, totalZeroHomologyIso_inv_natural] + exact Category.assoc _ _ _ + +@[reassoc] theorem kunnethIso_natural (f : P ⟶ P') (g : Q ⟶ Q') (n : ℕ) : + homologyMap (mapBifunctorMap f g F (.up ℕ)) n ≫ (kunnethIso k F P' Q' n).hom = + (kunnethIso k F P Q n).hom ≫ + (mapBifunctorMap (gradedMap k f) (gradedMap k g) F (.up ℕ)).f n := by + apply (cancel_epi (kunnethIso k F P Q n).inv).1 + simp only [← Category.assoc] + rw [kunnethIso_inv_natural, Iso.inv_hom_id, Category.id_comp, Category.assoc, + Iso.inv_hom_id, Category.comp_id] + +end ArExplicit.VectorCochain + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainNaturality.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..6753d04dd1aa7aff7cab4bcb6dfb7b696ac50a77 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainNaturality.lean @@ -0,0 +1,65 @@ +import OAI.Algebra.AuslanderReiten.Homology.VectorCochainKunneth + +namespace OAI + +noncomputable section +namespace ArExplicit.VectorCochain +open CategoryTheory CategoryTheory.Limits HomologicalComplex +universe u +variable (k : Type u) [Field k] + +@[reassoc] theorem zeroHomologyIso_natural {X Y : ℕ → ModuleCat.{u} k} + (f : zeroDifferential k X ⟶ zeroDifferential k Y) (n : ℕ) : + homologyMap f n ≫ (zeroHomologyIso k Y n).hom = + (zeroHomologyIso k X n).hom ≫ f.f n := by + apply (cancel_epi ((zeroDifferential k X).homologyπ n)).1 + rw [homologyπ_naturality_assoc, zeroHomologyIso_π, ← Category.assoc, + zeroHomologyIso_π] + simp + +variable {P Q : CochainComplex (ModuleCat.{u} k) ℕ} + +def gradedMap (f : P ⟶ Q) : gradedHomology k P ⟶ gradedHomology k Q where + f n := homologyMap f n + comm' _ _ _ := by simp [gradedHomology, zeroDifferential] + +@[simp] theorem homologyMap_splitting_inv (n : ℕ) : + homologyMap (splitting k P).inv n = + (zeroHomologyIso k (fun i => P.homology i) n).inv := by + have he : (splitting k P).toHomologyIso n = + zeroHomologyIso k (fun i => P.homology i) n := by + apply Iso.ext + change homologyMap (splitting k P).hom n = _ + rw [splitting_hom, homologyMap_representatives] + exact congrArg Iso.inv he + +theorem representatives_comp_splitting_inv (f : P ⟶ Q) : + representatives k P ≫ f ≫ (splitting k Q).inv = gradedMap k f := by + ext n : 1 + apply (cancel_epi (zeroHomologyIso k (fun i => P.homology i) n).hom).1 + calc + (zeroHomologyIso k (fun i => P.homology i) n).hom ≫ + (representatives k P ≫ f ≫ (splitting k Q).inv).f n = + homologyMap (representatives k P ≫ f ≫ (splitting k Q).inv) n ≫ + (zeroHomologyIso k (fun i => Q.homology i) n).hom := + (zeroHomologyIso_natural k _ n).symm + _ = (zeroHomologyIso k (fun i => P.homology i) n).hom ≫ (gradedMap k f).f n := by + simp only [homologyMap_comp, homologyMap_representatives, homologyMap_splitting_inv, + Category.assoc, Iso.inv_hom_id, Category.comp_id, gradedMap] + +def representativesNaturality (f : P ⟶ Q) : + Homotopy (representatives k P ≫ f) (gradedMap k f ≫ representatives k Q) := by + have hh := ((splitting k Q).homotopyInvHomId.compLeftId + (representatives k P ≫ f)).symm + have he : (representatives k P ≫ f) ≫ + ((splitting k Q).inv ≫ (splitting k Q).hom) = + gradedMap k f ≫ representatives k Q := by + rw [splitting_hom, ← Category.assoc, Category.assoc (representatives k P) f, + representatives_comp_splitting_inv] + exact hh.trans (Homotopy.ofEq he) + +end ArExplicit.VectorCochain + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainSplitting.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainSplitting.lean new file mode 100644 index 0000000000000000000000000000000000000000..54128a00ca3839410a8e9aea146616e529cc92c5 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorCochainSplitting.lean @@ -0,0 +1,91 @@ +import Mathlib.Algebra.Homology.DerivedCategory.KInjective +import Mathlib.Algebra.Category.ModuleCat.Projective +import Mathlib.LinearAlgebra.Basis.VectorSpace + +namespace OAI + +noncomputable section + +namespace ArExplicit.VectorCochain + +open CategoryTheory CategoryTheory.Limits HomologicalComplex + +universe u + +variable (k : Type u) [Field k] + +instance vectorSpaceInjective (M : ModuleCat.{u} k) : CategoryTheory.Injective M where + factors g f hf := by + obtain ⟨r, hr⟩ := f.hom.exists_leftInverse_of_injective + (LinearMap.ker_eq_bot.mpr ((ModuleCat.mono_iff_injective f).mp hf)) + refine ⟨ModuleCat.ofHom (g.hom.comp r), ?_⟩ + apply ModuleCat.hom_ext + change (g.hom.comp r).comp f.hom = g.hom + rw [LinearMap.comp_assoc, hr, LinearMap.comp_id] + +abbrev zeroDifferential (X : ℕ → ModuleCat.{u} k) : CochainComplex (ModuleCat.{u} k) ℕ where + X := X + d _ _ := 0 + shape _ _ _ := rfl + d_comp_d' _ _ _ _ _ := by simp + +def zeroHomologyIso (X : ℕ → ModuleCat.{u} k) (n : ℕ) : + (zeroDifferential k X).homology n ≅ X n := + ((zeroDifferential k X).isoHomologyπ ((ComplexShape.up ℕ).prev n) n rfl rfl).symm ≪≫ + (zeroDifferential k X).iCyclesIso n ((ComplexShape.up ℕ).next n) rfl rfl + +@[simp, reassoc] theorem zeroHomologyIso_π (X : ℕ → ModuleCat.{u} k) (n : ℕ) : + (zeroDifferential k X).homologyπ n ≫ (zeroHomologyIso k X n).hom = + (zeroDifferential k X).iCycles n := by + let a := (zeroDifferential k X).isoHomologyπ ((ComplexShape.up ℕ).prev n) n rfl rfl + let b := (zeroDifferential k X).iCyclesIso n ((ComplexShape.up ℕ).next n) rfl rfl + change a.hom ≫ a.inv ≫ b.hom = b.hom + exact a.hom_inv_id_assoc _ + +variable (P : CochainComplex (ModuleCat.{u} k) ℕ) + +abbrev gradedHomology : CochainComplex (ModuleCat.{u} k) ℕ := + zeroDifferential k (fun n => P.homology n) + +def cycleSection (n : ℕ) : P.homology n ⟶ P.cycles n := + Projective.factorThru (𝟙 (P.homology n)) (P.homologyπ n) + +@[simp, reassoc] theorem cycleSection_π (n : ℕ) : + cycleSection k P n ≫ P.homologyπ n = 𝟙 _ := + Projective.factorThru_comp _ _ + +def representatives : gradedHomology k P ⟶ P where + f n := cycleSection k P n ≫ P.iCycles n + comm' i j _ := by simp [gradedHomology, zeroDifferential] + +theorem cyclesMap_representatives (n : ℕ) : + cyclesMap (representatives k P) n = + (gradedHomology k P).iCycles n ≫ cycleSection k P n := by + apply (cancel_mono (P.iCycles n)).1 + simp [representatives, Category.assoc] + +theorem homologyMap_representatives (n : ℕ) : + homologyMap (representatives k P) n = (zeroHomologyIso k (fun n => P.homology n) n).hom := by + apply (cancel_epi ((gradedHomology k P).homologyπ n)).1 + rw [homologyπ_naturality, cyclesMap_representatives, Category.assoc, + cycleSection_π, Category.comp_id, zeroHomologyIso_π] + +instance representatives_quasiIso : QuasiIso (representatives k P) := by + constructor + intro n + rw [quasiIsoAt_iff_isIso_homologyMap, homologyMap_representatives] + infer_instance + +def splitting : HomotopyEquiv (gradedHomology k P) P := + Classical.choose ((CochainComplex.quasiIso_iff_of_injective (representatives k P)).mp + (representatives_quasiIso k P)) + +@[simp] theorem splitting_hom : (splitting k P).hom = representatives k P := + Classical.choose_spec ((CochainComplex.quasiIso_iff_of_injective (representatives k P)).mp + (representatives_quasiIso k P)) + +end ArExplicit.VectorCochain + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/VectorComplexSplitting.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorComplexSplitting.lean new file mode 100644 index 0000000000000000000000000000000000000000..d88a71dd930b7cbee08453f8e805083554507ed4 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorComplexSplitting.lean @@ -0,0 +1,82 @@ +import Mathlib.Algebra.Homology.DerivedCategory.KProjective +import Mathlib.Algebra.Category.ModuleCat.Projective +import Mathlib.LinearAlgebra.Basis.VectorSpace + +namespace OAI + +noncomputable section + +namespace ArExplicit.VectorComplex + +open CategoryTheory CategoryTheory.Limits HomologicalComplex + +universe u + +variable (k : Type u) [Field k] + +abbrev zeroDifferential (X : ℕ → ModuleCat.{u} k) : ChainComplex (ModuleCat.{u} k) ℕ where + X := X + d _ _ := 0 + shape _ _ _ := rfl + d_comp_d' _ _ _ _ _ := by simp + +def zeroHomologyIso (X : ℕ → ModuleCat.{u} k) (n : ℕ) : + (zeroDifferential k X).homology n ≅ X n := + ((zeroDifferential k X).isoHomologyπ ((ComplexShape.down ℕ).prev n) n rfl rfl).symm ≪≫ + (zeroDifferential k X).iCyclesIso n ((ComplexShape.down ℕ).next n) rfl rfl + +@[simp, reassoc] theorem zeroHomologyIso_π (X : ℕ → ModuleCat.{u} k) (n : ℕ) : + (zeroDifferential k X).homologyπ n ≫ (zeroHomologyIso k X n).hom = + (zeroDifferential k X).iCycles n := by + let a := (zeroDifferential k X).isoHomologyπ ((ComplexShape.down ℕ).prev n) n rfl rfl + let b := (zeroDifferential k X).iCyclesIso n ((ComplexShape.down ℕ).next n) rfl rfl + change a.hom ≫ a.inv ≫ b.hom = b.hom + exact a.hom_inv_id_assoc _ + +variable (P : ChainComplex (ModuleCat.{u} k) ℕ) + +abbrev gradedHomology : ChainComplex (ModuleCat.{u} k) ℕ := + zeroDifferential k (fun n => P.homology n) + +def cycleSection (n : ℕ) : P.homology n ⟶ P.cycles n := + Projective.factorThru (𝟙 (P.homology n)) (P.homologyπ n) + +@[simp, reassoc] theorem cycleSection_π (n : ℕ) : + cycleSection k P n ≫ P.homologyπ n = 𝟙 _ := + Projective.factorThru_comp _ _ + +def representatives : gradedHomology k P ⟶ P where + f n := cycleSection k P n ≫ P.iCycles n + comm' i j _ := by simp [gradedHomology, zeroDifferential] + +theorem cyclesMap_representatives (n : ℕ) : + cyclesMap (representatives k P) n = + (gradedHomology k P).iCycles n ≫ cycleSection k P n := by + apply (cancel_mono (P.iCycles n)).1 + simp [representatives, Category.assoc] + +theorem homologyMap_representatives (n : ℕ) : + homologyMap (representatives k P) n = (zeroHomologyIso k (fun n => P.homology n) n).hom := by + apply (cancel_epi ((gradedHomology k P).homologyπ n)).1 + rw [homologyπ_naturality, cyclesMap_representatives, Category.assoc, + cycleSection_π, Category.comp_id, zeroHomologyIso_π] + +instance representatives_quasiIso : QuasiIso (representatives k P) := by + constructor + intro n + rw [quasiIsoAt_iff_isIso_homologyMap, homologyMap_representatives] + infer_instance + +def splitting : HomotopyEquiv (gradedHomology k P) P := + Classical.choose ((ChainComplex.quasiIso_iff_of_projective (representatives k P)).mp + (representatives_quasiIso k P)) + +@[simp] theorem splitting_hom : (splitting k P).hom = representatives k P := + Classical.choose_spec ((ChainComplex.quasiIso_iff_of_projective (representatives k P)).mp + (representatives_quasiIso k P)) + +end ArExplicit.VectorComplex + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Homology/VectorTensorKunneth.lean b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorTensorKunneth.lean new file mode 100644 index 0000000000000000000000000000000000000000..2afbef6ba86f8e0d6682abd611c0ed11045382cf --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Homology/VectorTensorKunneth.lean @@ -0,0 +1,106 @@ +import OAI.Algebra.AuslanderReiten.Homology.VectorComplexSplitting +import OAI.Algebra.AuslanderReiten.Homology.BifunctorHomotopyEquiv +import Mathlib.Algebra.Category.ModuleCat.Colimits +import Mathlib.Algebra.Category.ModuleCat.Products + +namespace OAI + +noncomputable section + +namespace ArExplicit.VectorComplex + +open CategoryTheory CategoryTheory.Limits HomologicalComplex + +universe u + +variable (k : Type u) [Field k] +variable (F : ModuleCat.{u} k ⥤ ModuleCat.{u} k ⥤ ModuleCat.{u} k) + [F.Additive] [∀ X, (F.obj X).Additive] + +instance hasMapBifunctor (P Q : ChainComplex (ModuleCat.{u} k) ℕ) : + HasMapBifunctor P Q F (ComplexShape.down ℕ) := fun _ => inferInstance + +theorem totalMap_quasiIso {P P' Q Q' : ChainComplex (ModuleCat.{u} k) ℕ} + (f : P ⟶ P') (g : Q ⟶ Q') [QuasiIso f] [QuasiIso g] : + QuasiIso (mapBifunctorMap f g F (ComplexShape.down ℕ)) := by + obtain ⟨e, rfl⟩ := (ChainComplex.quasiIso_iff_of_projective f).mp inferInstance + obtain ⟨e', rfl⟩ := (ChainComplex.quasiIso_iff_of_projective g).mp inferInstance + exact homotopyEquivalences_le_quasiIso _ _ _ ⟨totalHomotopyEquiv F e e', rfl⟩ + +theorem total_zero_differential (X Y : ℕ → ModuleCat.{u} k) (n m : ℕ) : + (mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F + (ComplexShape.down ℕ)).d n m = 0 := by + rw [mapBifunctor.d_eq] + have h₁ : mapBifunctor.D₁ (zeroDifferential k X) (zeroDifferential k Y) F + (ComplexShape.down ℕ) n m = 0 := by + apply mapBifunctor.hom_ext + intro i j h + rw [comp_zero, mapBifunctor.ι_D₁] + cases i with + | zero => exact mapBifunctor.d₁_eq_zero _ _ _ _ 0 j m (by simp) + | succ i => + rw [mapBifunctor.d₁_eq' _ _ _ _ (show (ComplexShape.down ℕ).Rel (i+1) i from rfl)] + simp [zeroDifferential] + have h₂ : mapBifunctor.D₂ (zeroDifferential k X) (zeroDifferential k Y) F + (ComplexShape.down ℕ) n m = 0 := by + apply mapBifunctor.hom_ext + intro i j h + rw [comp_zero, mapBifunctor.ι_D₂] + cases j with + | zero => exact mapBifunctor.d₂_eq_zero _ _ _ _ i 0 m (by simp) + | succ j => + rw [mapBifunctor.d₂_eq' _ _ _ _ i (show (ComplexShape.down ℕ).Rel (j+1) j from rfl)] + simp [zeroDifferential] + rw [h₁, h₂, add_zero] + +def totalZeroHomologyIso (X Y : ℕ → ModuleCat.{u} k) (n : ℕ) : + (mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F + (ComplexShape.down ℕ)).homology n ≅ + (mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F + (ComplexShape.down ℕ)).X n := + let K := mapBifunctor (zeroDifferential k X) (zeroDifferential k Y) F (ComplexShape.down ℕ) + (K.isoHomologyπ ((ComplexShape.down ℕ).prev n) n rfl + (total_zero_differential k F X Y _ _)).symm ≪≫ + K.iCyclesIso n ((ComplexShape.down ℕ).next n) rfl (total_zero_differential k F X Y _ _) + +variable (P Q : ChainComplex (ModuleCat.{u} k) ℕ) + +def tensorSplitting : + HomotopyEquiv + (mapBifunctor (gradedHomology k P) (gradedHomology k Q) F (ComplexShape.down ℕ)) + (mapBifunctor P Q F (ComplexShape.down ℕ)) := + totalHomotopyEquiv F (splitting k P) (splitting k Q) + +def kunnethIso (n : ℕ) : + (mapBifunctor P Q F (ComplexShape.down ℕ)).homology n ≅ + (mapBifunctor (gradedHomology k P) (gradedHomology k Q) F (ComplexShape.down ℕ)).X n := + ((tensorSplitting k F P Q).toHomologyIso n).symm ≪≫ + totalZeroHomologyIso k F (fun i => P.homology i) (fun j => Q.homology j) n + +theorem tensorSplitting_hom : + (tensorSplitting k F P Q).hom = + mapBifunctorMap (representatives k P) (representatives k Q) F (ComplexShape.down ℕ) := by + simp [tensorSplitting, totalHomotopyEquiv] + +theorem kunnethIso_inv (n : ℕ) : + (kunnethIso k F P Q n).inv = + (totalZeroHomologyIso k F (fun i => P.homology i) (fun j => Q.homology j) n).inv ≫ + homologyMap (mapBifunctorMap (representatives k P) (representatives k Q) F + (ComplexShape.down ℕ)) n := by + change _ ≫ homologyMap (tensorSplitting k F P Q).hom n = _ + rw [tensorSplitting_hom] + +def kunnethLinearEquiv (n : ℕ) : + (mapBifunctor P Q F (ComplexShape.down ℕ)).homology n ≃ₗ[k] + (Π₀ p : {p : ℕ × ℕ // p.1 + p.2 = n}, + (F.obj (P.homology p.val.1)).obj (Q.homology p.val.2)) := + (kunnethIso k F P Q n).toLinearEquiv.trans + (ModuleCat.coprodIsoDirectSum + (fun p : {p : ℕ × ℕ // p.1 + p.2 = n} => + (F.obj (P.homology p.val.1)).obj (Q.homology p.val.2))).toLinearEquiv + +end ArExplicit.VectorComplex + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Main.lean b/lean/OAI/Algebra/AuslanderReiten/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..7c89bc0a559c5a8d711639f8b8b89982b48a5643 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Main.lean @@ -0,0 +1,62 @@ +import OAI.Algebra.AuslanderReiten.Coordinates.ConcreteMainCriterion +import OAI.Algebra.AuslanderReiten.Fibers.ConcreteFiberProfile +import OAI.Algebra.AuslanderReiten.Coordinates.ConcreteParameters +import OAI.Algebra.AuslanderReiten.BaseChange.MainScalarExtension + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped ModuleCat.Algebra +namespace ArExplicit +universe v + +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +local instance : HasDerivedCategory (ModuleCat (T BaseField q)) := + HasDerivedCategory.standard (ModuleCat (T BaseField q)) +local instance : HasDerivedCategory (ModuleCat (A BaseField q)) := + HasDerivedCategory.standard (ModuleCat (A BaseField q)) + +def diagonalClass := T.fiberDiagonalClass q q_ne_zero one_add_q_ne_zero q_noPositivePowerOne + (parameterUnit 1) (parameterUnit 2) + +private abbrev explicitConclusionProof := + let hspan := fun z => + Exists.elim (T.fiberDiagonalClass_spans q q_ne_zero one_add_q_ne_zero + q_noPositivePowerOne (parameterUnit 1) (parameterUnit 2) z) + (fun a ha => Exists.intro a ha.symm) + T.explicit_mainConclusions q (parameterUnit 1) (parameterUnit 2) + diagonalClass q_ne_zero one_add_q_ne_zero q_noPositivePowerOne + (T.fiberDiagonalClass_image q q_ne_zero one_add_q_ne_zero q_noPositivePowerOne + (parameterUnit 1) (parameterUnit 2)) + hspan + (T.fiberPositiveRhoPair_bijective q q_ne_zero one_add_q_ne_zero q_noPositivePowerOne + (parameterUnit 1) (parameterUnit 2)) + parameterUnit_twist_ne + +private def verifiedCandidate {R M : Type} [Ring R] [Algebra BaseField R] + [AddCommGroup M] [Module R M] [Module BaseField M] [IsScalarTower BaseField R M] + (h : MainConclusions BaseField R M) : + {c : Candidate // MainConclusions BaseField c.R c.M} := + ⟨{ R := R, M := M }, h⟩ + +private def verifiedCounterexample := verifiedCandidate explicitConclusionProof + +def counterexample : Candidate := verifiedCounterexample.val + +theorem counterexample_mainConclusions : + MainConclusions BaseField counterexample.R counterexample.M := + verifiedCounterexample.property + +theorem fullMainTheorem : FullMainTheorem.{v} := + fullMainTheorem_of_mainConclusions counterexample counterexample_mainConclusions + +theorem main : AlgebraicIndependent (ZMod 2) parameter ∧ FullMainTheorem.{v} := + ⟨parameters_algebraicallyIndependent, fullMainTheorem⟩ + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/ATwistFunctor.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/ATwistFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..f5f5f4dabfc6580cea4d86e0a3c86ce0b80a5344 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/ATwistFunctor.lean @@ -0,0 +1,67 @@ +import OAI.Algebra.AuslanderReiten.Ext.ATwistExt +import OAI.Algebra.AuslanderReiten.Bar.ModuleBarTensorEndpointCoordinates +import OAI.Algebra.AuslanderReiten.Evaluation.TensorTwistEvaluation + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open scoped TensorProduct ModuleCat.Algebra +namespace ArExplicit.Resolution +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H : kˣ) +variable [HasDerivedCategory (ModuleCat.{u} (ArExplicit.T k q))] + +abbrev aInverseRestriction := ExternalTensor.tensorRestriction k (ArExplicit.T k q) (ArExplicit.T k q) + (TrivialExtension.twist H).symm (TrivialExtension.twist H).symm + +instance aInverseRestriction_isEquivalence : (aInverseRestriction q H).IsEquivalence := + ModuleCat.restrictScalars_isEquivalence_of_ringEquiv + (Algebra.TensorProduct.congr (TrivialExtension.twist H).symm + (TrivialExtension.twist H).symm).toRingEquiv + +def aInverseEndpoint : A.Simple q ≅ (aInverseRestriction q H).obj (A.Simple q) := + ModuleBar.tensorEndpointIso k (ArExplicit.T k q) (ArExplicit.T k q) (Simple q) (Simple q) + (TrivialExtension.twist H).symm (TrivialExtension.twist H).symm + (LinearEquiv.refl k _) (LinearEquiv.refl k _) + (ArExplicit.T.inverseTwist_simple_compatible q H) + (ArExplicit.T.inverseTwist_simple_compatible q H) + +omit [CharP k 2] [HasDerivedCategory (ModuleCat.{u} (ArExplicit.T k q))] in +theorem aInverseEndpoint_apply (x : A.Simple q) : (aInverseEndpoint q H).hom.hom x = x := by + exact (ModuleBar.tensorEndpointIso_apply k (ArExplicit.T k q) (ArExplicit.T k q) + (Simple q) (Simple q) (TrivialExtension.twist H).symm (TrivialExtension.twist H).symm + (LinearEquiv.refl k _) (LinearEquiv.refl k _) + (ArExplicit.T.inverseTwist_simple_compatible q H) + (ArExplicit.T.inverseTwist_simple_compatible q H) x).trans (by simp; rfl) + +omit [CharP k 2] [HasDerivedCategory (ModuleCat.{u} (ArExplicit.T k q))] in +theorem aInverseRestriction_eq : aInverseRestriction q H = + ModuleCat.restrictScalars (ArExplicit.T.sourceTwist q H).symm.toRingHom := rfl + +omit [HasDerivedCategory (ModuleCat.{u} (ArExplicit.T k q))] in +theorem aInverseTwist_standard (n : ℕ) (x : ASelfExt q n) : + type_of% (ModuleBar.tensorTwist_eq_exactFunctor k (ArExplicit.T k q) (ArExplicit.T k q) + (Simple q) (Simple q) (TrivialExtension.twist H).symm (TrivialExtension.twist H).symm + (LinearEquiv.refl k _) (LinearEquiv.refl k _) + (ArExplicit.T.inverseTwist_simple_compatible q H) + (ArExplicit.T.inverseTwist_simple_compatible q H) n x) := + ModuleBar.tensorTwist_eq_exactFunctor k (ArExplicit.T k q) (ArExplicit.T k q) + (Simple q) (Simple q) (TrivialExtension.twist H).symm (TrivialExtension.twist H).symm + (LinearEquiv.refl k _) (LinearEquiv.refl k _) + (ArExplicit.T.inverseTwist_simple_compatible q H) + (ArExplicit.T.inverseTwist_simple_compatible q H) n x + +theorem aInverseTwist_standard_scalar (hq : q ≠ 0) (hq1 : 1+q ≠ 0) (hp : NoPositivePowerOne q) + (n : ℕ) (x : ASelfExt q (3*n)) : + selfExtIso (k := k) (aInverseEndpoint q H).symm (3*n) + (x.mapExactFunctor (aInverseRestriction q H)) = (((H⁻¹ : kˣ) : k)^n) • x := by + rw [selfExtIso_apply] + exact (aInverseTwist_standard q H (3*n) x).symm.trans + (aInverseTwistExt_scalar q H hq hq1 hp n x) + +end ArExplicit.Resolution + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/ATwistedCompleteAction.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/ATwistedCompleteAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..6bc5996c11b626d7b87bb0f823c5c5d20ab82b0f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/ATwistedCompleteAction.lean @@ -0,0 +1,71 @@ +import OAI.Algebra.AuslanderReiten.Ext.ATwistedTensorExt +import OAI.Algebra.AuslanderReiten.Tensor.TwistedEnvelopingProjective +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorPositiveAction +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCompleteInverse +import OAI.Algebra.AuslanderReiten.HomComplex.TensorFullHomZero + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.T +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H : kˣ) +variable [HasDerivedCategory (ModuleCat.{u} (ArExplicit.T k q))] +variable [HasDerivedCategory (ModuleCat.{u} (ArExplicit.A k q))] + +abbrev completeTwistIn := BalancedTensor.completeActionIn (AFrobeniusTrace k q) + (A.simpleFiniteModule q) (evaluatedTwistEquiv q H) + +abbrev completeTwistOut := BalancedTensor.completeActionOut (AFrobeniusTrace k q) + (A.simpleFiniteModule q) (evaluatedTwistEquiv q H) + +omit [CharP k 2] [HasDerivedCategory (ModuleCat (T k q))] + [HasDerivedCategory (ModuleCat (A k q))] in +theorem nativeEvaluationIso_eq : + BalancedTensor.nativeEvaluationIso (A.simpleFiniteModule q) (evaluatedTwistEquiv q H) = + evaluatedTwistIso q H := rfl + +omit [CharP k 2] [HasDerivedCategory (ModuleCat (T k q))] + [HasDerivedCategory (ModuleCat (A k q))] in +theorem completeTwist_inverse : + (HomotopyCategory.quotient _ _).map (completeTwistIn q H ≫ completeTwistOut q H) = 𝟙 _ := + BalancedTensor.completeAction_inverse (AFrobeniusTrace k q) + (A.simpleFiniteModule q) (evaluatedTwistEquiv q H) + +omit [CharP k 2] [HasDerivedCategory (ModuleCat (T k q))] + [HasDerivedCategory (ModuleCat (A k q))] in +theorem completeTwistIn_quotient : + (HomotopyCategory.quotient _ _).map (completeTwistIn q H) = + (BalancedTensor.completeTensorIso (AFrobeniusTrace k q) + (A.simpleFiniteModule q) (A.simpleFiniteModule q) (evaluatedTwistEquiv q H)).inv := + BalancedTensor.completeActionIn_quotient (AFrobeniusTrace k q) + (A.simpleFiniteModule q) (evaluatedTwistEquiv q H) + +omit [CharP k 2] [HasDerivedCategory (ModuleCat (T k q))] + [HasDerivedCategory (ModuleCat (A k q))] in +theorem completeTwistOut_quotient : + (HomotopyCategory.quotient _ _).map (completeTwistOut q H) = + (BalancedTensor.completeTensorIso (AFrobeniusTrace k q) + (A.simpleFiniteModule q) (A.simpleFiniteModule q) (evaluatedTwistEquiv q H)).hom := + BalancedTensor.completeActionOut_quotient (AFrobeniusTrace k q) + (A.simpleFiniteModule q) (evaluatedTwistEquiv q H) + +theorem completeTwist_scalar (hq : q ≠ 0) (hq1 : 1+q ≠ 0) + (hp : Resolution.NoPositivePowerOne q) (m : ℕ) (hm : 0 < m) + (x : CohomologyClass (A.simpleComplete q) (A.simpleComplete q) ((3*m : ℕ) : ℤ)) : + fullHomPostcomp (completeTwistOut q H) _ + (fullHomPrecomp (completeTwistIn q H) _ + (mapFullHom (evaluatedTwistFunctor q H) _ _ _ x)) = (((H⁻¹ : kˣ) : k)^m) • x := by + apply BalancedTensor.completeAction_scalar_positive (AFrobeniusTrace k q) + (A.simpleFiniteModule q) (evaluatedTwistEquiv q H) (3*m) (by omega) + intro z + rw [nativeEvaluationIso_eq] + exact evaluatedTwistExt_scalar q H hq hq1 hp m z + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/BimoduleEnveloping.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/BimoduleEnveloping.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e6a8a913bc5edce51b2b222915a2ef65c534b86 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/BimoduleEnveloping.lean @@ -0,0 +1,75 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBimodule +import OAI.Algebra.AuslanderReiten.Modules.TwistedBimodule + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory +open scoped TensorProduct + +universe u + +variable (k R M : Type u) [Field k] [Ring R] [Algebra k R] +variable [AddCommGroup M] [Module k M] [Module R M] [Module Rᵐᵒᵖ M] +variable [IsScalarTower k R M] [IsScalarTower k Rᵐᵒᵖ M] +variable [SMulCommClass k R M] [SMulCommClass k Rᵐᵒᵖ M] +variable [SMulCommClass R Rᵐᵒᵖ M] + +def bimoduleEnvelopingRepresentation : R ⊗[k] Rᵐᵒᵖ →ₐ[k] Module.End k M := + Algebra.TensorProduct.lift (Algebra.lsmul k k M) (Algebra.lsmul k k M) (by + intro a b + apply LinearMap.ext + intro x + exact smul_comm a b x) + +@[instance_reducible] def bimoduleEnvelopingModule : Module (R ⊗[k] Rᵐᵒᵖ) M := + Module.compHom M (bimoduleEnvelopingRepresentation k R M).toRingHom + +def bimoduleEnvelopingObject : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ) := + letI := bimoduleEnvelopingModule k R M + ModuleCat.of (R ⊗[k] Rᵐᵒᵖ) M + +instance : Module k (bimoduleEnvelopingObject k R M) := inferInstanceAs (Module k M) + +instance : IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) (bimoduleEnvelopingObject k R M) := + IsScalarTower.of_algebraMap_smul (A := R ⊗[k] Rᵐᵒᵖ) fun a (x : bimoduleEnvelopingObject k R M) => by + change bimoduleEnvelopingRepresentation k R M (algebraMap k (R ⊗[k] Rᵐᵒᵖ) a) x = a • x + rw [AlgHom.commutes] + rfl + +omit [SMulCommClass k R M] [SMulCommClass k Rᵐᵒᵖ M] in +@[simp] theorem bimoduleEnveloping_smul (a : R) (b : Rᵐᵒᵖ) (x : bimoduleEnvelopingObject k R M) : + (a ⊗ₜ[k] b) • x = a • (b • (show M from x)) := rfl + +def bimoduleEnvelopingLeftEquiv : + ((ModuleCat.restrictScalars (tensorLeftInclusion k R Rᵐᵒᵖ)).obj + (bimoduleEnvelopingObject k R M)) ≃ₗ[R] M where + toFun x := x + invFun x := x + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' a x := by + change a • ((1 : Rᵐᵒᵖ) • (show M from x)) = a • (show M from x) + rw [one_smul] + +def bimoduleEnvelopingRightEquiv : + ((ModuleCat.restrictScalars (tensorRightInclusion k R Rᵐᵒᵖ)).obj + (bimoduleEnvelopingObject k R M)) ≃ₗ[Rᵐᵒᵖ] M where + toFun x := x + invFun x := x + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' a x := by + change (1 : R) • (a • (show M from x)) = a • (show M from x) + rw [one_smul] + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/Coinduced.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/Coinduced.lean new file mode 100644 index 0000000000000000000000000000000000000000..153ffdd9303dad396e650e5fb6f1c32b9803a8a1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/Coinduced.lean @@ -0,0 +1,102 @@ +import Mathlib.Algebra.Module.Injective +import Mathlib.Algebra.Module.TransferInstance +import Mathlib.Algebra.Group.TransferInstance +import Mathlib.LinearAlgebra.Dual.Lemmas + +namespace OAI + +namespace ArExplicit + +@[ext] structure Coinduced (k R : Type*) [CommRing k] [Ring R] [Algebra k R] where + functional : Module.Dual k R + +namespace Coinduced + +variable {k R : Type*} [CommRing k] [Ring R] [Algebra k R] + +def coordinates : Coinduced k R ≃ Module.Dual k R where + toFun := functional + invFun := Coinduced.mk + left_inv _ := rfl + right_inv _ := rfl + +instance : AddCommGroup (Coinduced k R) := coordinates.addCommGroup +instance : Module k (Coinduced k R) := coordinates.addEquiv.module k + +@[simp] theorem functional_zero (s : R) : (0 : Coinduced k R).functional s = 0 := rfl +@[simp] theorem functional_add (x y : Coinduced k R) (s : R) : + (x + y).functional s = x.functional s + y.functional s := rfl +@[simp] theorem functional_smul (c : k) (x : Coinduced k R) (s : R) : + (c • x).functional s = c * x.functional s := rfl + +def action (r : R) (x : Coinduced k R) : Coinduced k R := + ⟨{ toFun := fun s => x.functional (s * r) + map_add' := fun s t => by simp [add_mul] + map_smul' := fun c s => by simp }⟩ + +instance : SMul R (Coinduced k R) := ⟨action⟩ + +@[simp] theorem functional_action (r : R) (x : Coinduced k R) (s : R) : + (r • x).functional s = x.functional (s * r) := rfl + +instance : Module R (Coinduced k R) where + one_smul x := by ext s; simp + mul_smul r s x := by ext t; simp [mul_assoc] + smul_zero r := by ext s; simp + smul_add r x y := by ext s; simp + zero_smul x := by ext s; simp + add_smul r s x := by ext t; simp [mul_add] + +instance : IsScalarTower k R (Coinduced k R) where + smul_assoc c r x := by ext s; simp + +instance : SMulCommClass k R (Coinduced k R) where + smul_comm c r x := by ext s; rfl + +def scalarLinearEquiv : Coinduced k R ≃ₗ[k] Module.Dual k R := + coordinates.addEquiv.linearEquiv k + +def evalOne : Coinduced k R →ₗ[k] k where + toFun x := x.functional 1 + map_add' _ _ := rfl + map_smul' _ _ := rfl + +def fromFunctional (φ : Module.Dual k R) : R →ₗ[R] Coinduced k R where + toFun r := action r ⟨φ⟩ + map_add' r s := by ext t; simp [action, mul_add] + map_smul' r s := by + ext t + change φ (t * (r * s)) = φ ((t * r) * s) + exact congrArg φ (mul_assoc t r s).symm + +section Field + +variable {k : Type*} [Field k] {R : Type*} [Ring R] [Algebra k R] + +instance : Module.Injective R (Coinduced k R) := by + apply Module.Baer.injective + intro I g + let φ : (I.restrictScalars k) →ₗ[k] k := evalOne.comp (g.restrictScalars k) + obtain ⟨ψ, hψ⟩ := φ.exists_extend + refine ⟨fromFunctional ψ, ?_⟩ + intro x hx + apply Coinduced.ext + ext r + have h := LinearMap.congr_fun hψ (r • (⟨x, hx⟩ : I)) + change ψ (r * x) = (g ⟨x, hx⟩).functional r + change ψ (r * x) = (g (r • (⟨x, hx⟩ : I))).functional 1 at h + rw [map_smul] at h + simpa using h + +instance [Module.Finite k R] : Module.Finite k (Coinduced k R) := + Module.Finite.equiv scalarLinearEquiv.symm + +theorem finrank_eq [Module.Finite k R] : + Module.finrank k (Coinduced k R) = Module.finrank k R := by + rw [scalarLinearEquiv.finrank_eq, Subspace.dual_finrank_eq] + +end Field +end Coinduced +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/CoinducedBimodule.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/CoinducedBimodule.lean new file mode 100644 index 0000000000000000000000000000000000000000..0639615342956c087c6269a7469671cd6caf8f63 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/CoinducedBimodule.lean @@ -0,0 +1,33 @@ +import OAI.Algebra.AuslanderReiten.Modules.Coinduced + +namespace OAI + +namespace ArExplicit.Coinduced +variable {k R : Type*} [CommRing k] [Ring R] [Algebra k R] + +instance : SMul Rᵐᵒᵖ (Coinduced k R) := + ⟨fun r x => ⟨{ toFun := fun s => x.functional (r.unop * s) + map_add' := fun s t => by simp [mul_add] + map_smul' := fun a s => by simp }⟩⟩ + +@[simp] theorem functional_right (r : Rᵐᵒᵖ) (x : Coinduced k R) (s : R) : + (r • x).functional s = x.functional (r.unop * s) := rfl + +instance : Module Rᵐᵒᵖ (Coinduced k R) where + one_smul x := by ext s; simp + mul_smul r t x := by ext s; simp [mul_assoc] + smul_zero r := by ext s; simp + smul_add r x y := by ext s; simp + zero_smul x := by ext s; simp + add_smul r t x := by ext s; simp [add_mul] + +instance : SMulCommClass R Rᵐᵒᵖ (Coinduced k R) where + smul_comm r t x := by ext s; simp [mul_assoc] +instance : IsScalarTower k Rᵐᵒᵖ (Coinduced k R) where + smul_assoc a r x := by ext s; simp +instance : SMulCommClass k Rᵐᵒᵖ (Coinduced k R) where + smul_comm a r x := by ext s; rfl + +end ArExplicit.Coinduced + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/CoinducedEmbedding.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/CoinducedEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..8efc70bed3c0485fe94af77f12bd6687aab11d5b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/CoinducedEmbedding.lean @@ -0,0 +1,66 @@ +import OAI.Algebra.AuslanderReiten.Algebras.FrobeniusTrace + +namespace OAI + +namespace ArExplicit.Coinduced + +variable {k R M : Type*} [Field k] [Ring R] [Algebra k R] +variable [AddCommGroup M] [Module R M] [Module k M] [IsScalarTower k R M] + +def adjoint (φ : Module.Dual k M) : M →ₗ[R] Coinduced k R where + toFun m := ⟨{ + toFun := fun r => φ (r • m) + map_add' := fun r s => by simp [add_smul] + map_smul' := fun c r => by simp [smul_assoc] }⟩ + map_add' m n := by ext r; simp [smul_add] + map_smul' r m := by + ext s + change φ (s • r • m) = φ ((s * r) • m) + rw [mul_smul] + +@[simp] theorem adjoint_eval_one (φ : Module.Dual k M) (m : M) : + (adjoint (R := R) φ m).functional (1 : R) = φ m := by simp [adjoint] + +variable [Module.Finite k M] + +noncomputable def finiteEmbedding : M →ₗ[R] (Fin (Module.finrank k M) → Coinduced k R) := + LinearMap.pi fun i => adjoint ((Module.finBasis k M).coord i) + +theorem finiteEmbedding_injective : + Function.Injective (finiteEmbedding (k := k) (R := R) (M := M)) := by + intro x y h + apply (Module.finBasis k M).ext_elem + intro i + have hi := congrArg (fun f : Fin (Module.finrank k M) → Coinduced k R => + (f i).functional 1) h + simpa [finiteEmbedding, Module.Basis.coord_apply] using hi + +end ArExplicit.Coinduced + +namespace ArExplicit.FrobeniusTrace + +variable {k R M : Type*} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (τ : FrobeniusTrace k R) +variable [AddCommGroup M] [Module R M] [Module k M] [IsScalarTower k R M] +variable [Module.Finite k M] + +noncomputable def finiteFreeEmbedding : M →ₗ[R] (Fin (Module.finrank k M) → R) := + LinearMap.pi fun i => τ.leftEquiv.symm.toLinearMap.comp + (Coinduced.adjoint ((Module.finBasis k M).coord i)) + +theorem finiteFreeEmbedding_injective : + Function.Injective (τ.finiteFreeEmbedding (M := M)) := by + intro x y h + apply Coinduced.finiteEmbedding_injective (k := k) (R := R) + funext i + have hi := congrFun h i + exact τ.leftEquiv.symm.injective hi + +include τ in +theorem exists_finiteFree_embedding : + ∃ n : ℕ, ∃ i : M →ₗ[R] (Fin n → R), Function.Injective i := + ⟨Module.finrank k M, τ.finiteFreeEmbedding, τ.finiteFreeEmbedding_injective⟩ + +end ArExplicit.FrobeniusTrace + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/CoinducedModule.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/CoinducedModule.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e810184a1903dba1e2c089b2c187b02e5d6b28b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/CoinducedModule.lean @@ -0,0 +1,125 @@ +import OAI.Algebra.AuslanderReiten.Modules.CoinducedEmbedding +import OAI.Algebra.AuslanderReiten.Modules.SplitModules + +namespace OAI + +noncomputable section + +namespace ArExplicit + +@[ext] structure CoinducedModule (k R M : Type*) [Field k] [Ring R] [Algebra k R] + [AddCommGroup M] [Module k M] where + functional : R →ₗ[k] M + +namespace CoinducedModule + +variable {k R M : Type*} [Field k] [Ring R] [Algebra k R] +variable [AddCommGroup M] [Module k M] + +def coordinates : CoinducedModule k R M ≃ (R →ₗ[k] M) where + toFun := functional + invFun := CoinducedModule.mk + left_inv _ := rfl + right_inv _ := rfl + +instance : AddCommGroup (CoinducedModule k R M) := coordinates.addCommGroup +instance : Module k (CoinducedModule k R M) := coordinates.addEquiv.module k + +@[simp] theorem functional_zero (r : R) : (0 : CoinducedModule k R M).functional r = 0 := rfl +@[simp] theorem functional_add (f g : CoinducedModule k R M) (r : R) : + (f + g).functional r = f.functional r + g.functional r := rfl +@[simp] theorem functional_smul (a : k) (f : CoinducedModule k R M) (r : R) : + (a • f).functional r = a • f.functional r := rfl + +instance : SMul R (CoinducedModule k R M) := + ⟨fun r f => ⟨{ toFun := fun t => f.functional (t * r) + map_add' := fun s t => by simp [add_mul] + map_smul' := fun a t => by simp }⟩⟩ + +@[simp] theorem functional_action (r t : R) (f : CoinducedModule k R M) : + (r • f).functional t = f.functional (t * r) := rfl + +instance : Module R (CoinducedModule k R M) where + one_smul f := by ext t; simp + mul_smul r s f := by ext t; simp [mul_assoc] + smul_zero r := by ext t; simp + smul_add r f g := by ext t; simp + zero_smul f := by ext t; simp + add_smul r s f := by ext t; simp [mul_add] + +instance : IsScalarTower k R (CoinducedModule k R M) where + smul_assoc a r f := by ext t; simp + +instance : SMulCommClass k R (CoinducedModule k R M) where + smul_comm a r f := by ext t; rfl + +def scalarEquiv : CoinducedModule k R M ≃ₗ[k] (R →ₗ[k] M) := + coordinates.addEquiv.linearEquiv k + +instance [Module.Finite k R] [Module.Finite k M] : Module.Finite k (CoinducedModule k R M) := + Module.Finite.equiv scalarEquiv.symm + +section Embedding + +variable [Module R M] [IsScalarTower k R M] + +def embedding : M →ₗ[R] CoinducedModule k R M where + toFun m := ⟨{ toFun := fun t => t • m + map_add' := fun r s => add_smul r s m + map_smul' := fun a r => smul_assoc a r m }⟩ + map_add' m n := by ext t; exact smul_add t m n + map_smul' r m := by ext t; exact (mul_smul t r m).symm + +@[simp] theorem embedding_apply (m : M) (t : R) : + (embedding (k := k) m).functional t = t • m := rfl + +theorem embedding_injective : Function.Injective (embedding (k := k) (R := R) (M := M)) := by + intro m n h + have h' := congrArg (fun f : CoinducedModule k R M => f.functional 1) h + simpa using h' + +end Embedding + +variable [Module.Finite k M] + +private def coefficients : M ≃ₗ[k] (Fin (Module.finrank k M) → k) := + (Module.finBasis k M).equivFun + +def coordinateEquiv : CoinducedModule k R M ≃ₗ[R] + (Fin (Module.finrank k M) → Coinduced k R) where + toFun f i := ⟨(LinearMap.proj i).comp (coefficients.toLinearMap.comp f.functional)⟩ + invFun g := ⟨coefficients.symm.toLinearMap.comp + (LinearMap.pi fun i => (g i).functional)⟩ + left_inv f := by + ext t + exact coefficients.symm_apply_apply (f.functional t) + right_inv g := by + funext i + apply Coinduced.ext + apply LinearMap.ext + intro t + exact congrFun (coefficients.apply_symm_apply (fun j => (g j).functional t)) i + map_add' f g := by funext i; apply Coinduced.ext; ext t; simp + map_smul' r f := by funext i; apply Coinduced.ext; ext t; rfl + +def freeEquiv [Module.Finite k R] (τ : FrobeniusTrace k R) : + CoinducedModule k R M ≃ₗ[R] (Fin (Module.finrank k M) → R) := + coordinateEquiv.trans (LinearEquiv.piCongrRight fun _ => τ.leftEquiv.symm) + +theorem finite [Module.Finite k R] (τ : FrobeniusTrace k R) : + Module.Finite R (CoinducedModule k R M) := Module.Finite.equiv (freeEquiv τ).symm + +theorem free [Module.Finite k R] (τ : FrobeniusTrace k R) : + Module.Free R (CoinducedModule k R M) := Module.Free.of_equiv (freeEquiv τ).symm + +theorem projective [Module.Finite k R] (τ : FrobeniusTrace k R) : + Module.Projective R (CoinducedModule k R M) := by + let := free (M := M) τ + exact Module.Projective.of_free + +end CoinducedModule +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/FiniteModuleEvaluation.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/FiniteModuleEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..755b4fa340dfc48236e886e2ec65b640ccb6ec11 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/FiniteModuleEvaluation.lean @@ -0,0 +1,135 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBalancedExact +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingStableEvaluation +import OAI.Algebra.AuslanderReiten.Resolutions.FiniteResolutionLinear +import OAI.Algebra.AuslanderReiten.Complete.ProjectiveCompleteResolution + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Pretriangulated +open scoped TensorProduct + +namespace ArExplicit.FiniteLeftModule +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (X : FiniteLeftModule k R) +variable (M : FiniteLeftModule k (R ⊗[k] Rᵐᵒᵖ)) + +def evaluated : FiniteLeftModule k R where + carrier := ModuleCat.of R (BalancedTensor k R (EnvelopingBimodule k R M.carrier) X.carrier) + scalar := inferInstance + tower := inferInstance + finite := inferInstance + +variable {M N P : FiniteLeftModule k (R ⊗[k] Rᵐᵒᵖ)} + +def evaluationMap (f : M.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] N.carrier) : + (evaluated X M).carrier →ₗ[R] (evaluated X N).carrier := + EnvelopingBimodule.tensorMap X.carrier (ModuleCat.ofHom f) + +omit [Module.Finite k R] in +@[simp] theorem evaluationMap_id : evaluationMap X (LinearMap.id : M.carrier →ₗ[_] M.carrier) = + LinearMap.id := EnvelopingBimodule.tensorMap_id X.carrier + +omit [Module.Finite k R] in +@[simp] theorem evaluationMap_comp (f : M.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] N.carrier) + (g : N.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] P.carrier) : + evaluationMap X (g.comp f) = (evaluationMap X g).comp (evaluationMap X f) := + EnvelopingBimodule.tensorMap_comp X.carrier (ModuleCat.ofHom f) (ModuleCat.ofHom g) + +def evaluationStableIso (e : StableIsomorphism (R ⊗[k] Rᵐᵒᵖ) M.carrier N.carrier) : + StableIsomorphism R (evaluated X M).carrier (evaluated X N).carrier where + hom := EnvelopingBimodule.stableEvaluation X.carrier e.hom + inv := EnvelopingBimodule.stableEvaluation X.carrier e.inv + hom_inv_id := by + erw [← EnvelopingBimodule.stableEvaluation_comp, e.hom_inv_id] + exact EnvelopingBimodule.stableEvaluation_id X.carrier + inv_hom_id := by + erw [← EnvelopingBimodule.stableEvaluation_comp, e.inv_hom_id] + exact EnvelopingBimodule.stableEvaluation_id X.carrier + +omit [Module.Finite k R] in +theorem evaluated_projective [Module.Projective (R ⊗[k] Rᵐᵒᵖ) M.carrier] : + Module.Projective R (evaluated X M).carrier := by + let := Module.Finite.of_restrictScalars_finite k (R ⊗[k] Rᵐᵒᵖ) M.carrier + exact EnvelopingBimodule.tensor_projective X.carrier M.carrier + +variable (f : M.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] N.carrier) + (g : N.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] P.carrier) +variable (hf : Function.Injective f) (hg : Function.Surjective g) (he : Function.Exact f g) +variable [Module.Projective Rᵐᵒᵖ (EnvelopingBimodule k R P.carrier)] + +include hf hg he in +omit [Module.Finite k R] in + +theorem evaluation_shortExact : + Function.Injective (evaluationMap X f) ∧ Function.Surjective (evaluationMap X g) ∧ + Function.Exact (evaluationMap X f) (evaluationMap X g) := by + have hr : LinearMap.range f = LinearMap.ker g := by + ext y + exact (he y).symm + obtain ⟨hi, hs, hx⟩ := EnvelopingBimodule.tensorMap_shortExact X.carrier + (ModuleCat.ofHom f) (ModuleCat.ofHom g) hf hg hr + change LinearMap.range (evaluationMap X f) = LinearMap.ker (evaluationMap X g) at hx + refine ⟨hi, hs, ?_⟩ + intro y + exact (show y ∈ LinearMap.ker (evaluationMap X g) ↔ + y ∈ LinearMap.range (evaluationMap X f) by rw [hx]) + +variable (τ : FrobeniusTrace k R) + +def evaluationTriangle : Triangle (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := + resolutionTriangle τ (evaluationMap X f) (evaluationMap X g) + (evaluation_shortExact X f g hf hg he).1 (evaluation_shortExact X f g hf hg he).2.1 + (evaluation_shortExact X f g hf hg he).2.2 + +theorem evaluationTriangle_distinguished : evaluationTriangle X f g hf hg he τ ∈ + distTriang (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := + resolutionTriangle_distinguished _ _ _ _ _ _ + +def evaluationSuccessorIso [Module.Projective (R ⊗[k] Rᵐᵒᵖ) N.carrier] : + (HomotopyCategory.quotient _ _).obj ((evaluated X P).completeCochain τ) ≅ + ((HomotopyCategory.quotient _ _).obj ((evaluated X M).completeCochain τ))⟦(1 : ℤ)⟧ := by + letI := evaluated_projective X (M := N) + exact projectiveMiddleShiftIso τ (evaluationMap X f) (evaluationMap X g) + (evaluation_shortExact X f g hf hg he).1 (evaluation_shortExact X f g hf hg he).2.1 + (evaluation_shortExact X f g hf hg he).2.2 + +@[simp] +theorem evaluationSuccessorIso_hom [Module.Projective (R ⊗[k] Rᵐᵒᵖ) N.carrier] : + (evaluationSuccessorIso X f g hf hg he τ).hom = + (evaluationTriangle X f g hf hg he τ).mor₃ := by + let := evaluated_projective X (M := N) + exact projectiveMiddleShiftIso_hom _ _ _ _ _ _ + +section Naturality +variable {M₁ N₁ P₁ M₂ N₂ P₂ : FiniteLeftModule k (R ⊗[k] Rᵐᵒᵖ)} +variable (f₁ : M₁.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] N₁.carrier) + (g₁ : N₁.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] P₁.carrier) + (f₂ : M₂.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] N₂.carrier) + (g₂ : N₂.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] P₂.carrier) +variable (hf₁ : Function.Injective f₁) (hg₁ : Function.Surjective g₁) (he₁ : Function.Exact f₁ g₁) + (hf₂ : Function.Injective f₂) (hg₂ : Function.Surjective g₂) (he₂ : Function.Exact f₂ g₂) +variable [Module.Projective Rᵐᵒᵖ (EnvelopingBimodule k R P₁.carrier)] + [Module.Projective Rᵐᵒᵖ (EnvelopingBimodule k R P₂.carrier)] +variable (a : M₁.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] M₂.carrier) + (b : N₁.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] N₂.carrier) + (c : P₁.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] P₂.carrier) + +theorem evaluationConnecting_natural + (hab : b.comp f₁ = f₂.comp a) (hbc : g₂.comp b = c.comp g₁) : + (HomotopyCategory.quotient _ _).map (resolutionMap τ (evaluationMap X c)) ≫ + (evaluationTriangle X f₂ g₂ hf₂ hg₂ he₂ τ).mor₃ = + (evaluationTriangle X f₁ g₁ hf₁ hg₁ he₁ τ).mor₃ ≫ + (CategoryTheory.shiftFunctor (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) 1).map + ((HomotopyCategory.quotient _ _).map (resolutionMap τ (evaluationMap X a))) := by + apply resolutionConnecting_natural + · rw [← evaluationMap_comp, ← evaluationMap_comp, hab] + · rw [← evaluationMap_comp, ← evaluationMap_comp, hbc] +end Naturality + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/FiniteModuleNaturality.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/FiniteModuleNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..7030d9f3720ecf47edca482d0e84f0310e8d0a12 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/FiniteModuleNaturality.lean @@ -0,0 +1,127 @@ +import OAI.Algebra.AuslanderReiten.Modules.FiniteModuleTriangle +import OAI.Algebra.AuslanderReiten.Homology.ShortExactNaturality + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Pretriangulated + +namespace ArExplicit.FiniteLeftModule +open CompleteComparison + +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (τ : FrobeniusTrace k R) +variable {M N L : FiniteLeftModule k R} + +theorem resolutionCokernelMap_comp (f : M.carrier →ₗ[R] N.carrier) (g : N.carrier →ₗ[R] L.carrier) : + resolutionCokernelMap τ (g.comp f) = (resolutionCokernelMap τ g).comp (resolutionCokernelMap τ f) := by + apply LinearMap.ext + intro x + simp [resolutionCokernelMap] + +@[simp] +theorem resolutionMap_id : + (HomotopyCategory.quotient _ _).map (resolutionMap τ (LinearMap.id : M.carrier →ₗ[R] M.carrier)) = 𝟙 _ := by + apply (cochainHomotopyRawEquiv (M.completeCochain_totallyAcyclic τ).to_chain + (M.completeCochain_totallyAcyclic τ).to_chain.toExactProjectiveComplex).injective + rw [← (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.up ℤ)).map_id, + cochainHomotopyRawEquiv_map, cochainHomotopyRawEquiv_map, resolutionMap_cokernel] + apply congrArg (StableHom.classOf R _ _) + apply LinearMap.ext + intro x + obtain ⟨x, rfl⟩ := (LinearMap.range ((M.completeCochain τ).d (-1) 0).hom).mkQ_surjective x + simp [resolutionCokernelMap, cochainCokernelMap_mk] + +theorem resolutionMap_comp (f : M.carrier →ₗ[R] N.carrier) (g : N.carrier →ₗ[R] L.carrier) : + (HomotopyCategory.quotient _ _).map (resolutionMap τ (g.comp f)) = + (HomotopyCategory.quotient _ _).map (resolutionMap τ f) ≫ + (HomotopyCategory.quotient _ _).map (resolutionMap τ g) := by + apply (cochainHomotopyRawEquiv (M.completeCochain_totallyAcyclic τ).to_chain + (L.completeCochain_totallyAcyclic τ).to_chain.toExactProjectiveComplex).injective + rw [← Functor.map_comp, cochainHomotopyRawEquiv_map, cochainHomotopyRawEquiv_map, + cochainCokernelMap_comp, resolutionMap_cokernel, resolutionMap_cokernel, resolutionMap_cokernel, + resolutionCokernelMap_comp] + +theorem resolutionMap_surjective : Function.Surjective + (fun f : M.carrier →ₗ[R] N.carrier => + (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.up ℤ)).map (resolutionMap τ f)) := by + intro h + let E := cochainHomotopyRawEquiv (M.completeCochain_totallyAcyclic τ).to_chain + (N.completeCochain_totallyAcyclic τ).to_chain.toExactProjectiveComplex + obtain ⟨u, hu⟩ := StableHom.classOf_surjective (E h) + let f := (N.completeCochainCokernelEquiv τ).toLinearMap.comp + (u.comp (M.completeCochainCokernelEquiv τ).symm.toLinearMap) + refine ⟨f, E.injective ?_⟩ + change cochainHomotopyRawEquiv _ _ _ = _ + rw [cochainHomotopyRawEquiv_map, resolutionMap_cokernel] + have hf : resolutionCokernelMap τ f = u := by + apply LinearMap.ext + intro x + simp [resolutionCokernelMap, f] + rw [hf] + exact hu + +variable (f : M.carrier →ₗ[R] N.carrier) (g : N.carrier →ₗ[R] L.carrier) +variable (hf : Function.Injective f) (hg : Function.Surjective g) (hex : Function.Exact f g) + +def resolutionTriangle : Triangle (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := by + letI := τ.regular_injective + exact shortExactTriangle (resolutionMap τ f) (resolutionCokernelMap τ g) + (by rw [resolutionMap_cokernel]; exact resolutionCokernelMap_exact τ f g hex) + (M.completeCochain_totallyAcyclic τ) (N.completeCochain_totallyAcyclic τ) + (L.completeCochain_totallyAcyclic τ) + (by rw [resolutionMap_cokernel]; exact resolutionCokernelMap_injective τ f hf) + (resolutionCokernelMap_surjective τ g hg) + +theorem resolutionTriangle_distinguished : + resolutionTriangle τ f g hf hg hex ∈ + distTriang (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := by + let := τ.regular_injective + apply shortExactTriangle_distinguished + +@[simp] +theorem resolutionTriangle_first : + (resolutionTriangle τ f g hf hg hex).mor₁ = + (HomotopyCategory.quotient _ _).map (resolutionMap τ f) := rfl + +theorem resolutionTriangle_second : + (resolutionTriangle τ f g hf hg hex).mor₂ = + (HomotopyCategory.quotient _ _).map (resolutionMap τ g) := by + let := τ.regular_injective + apply shortExactTriangle_second + exact resolutionMap_cokernel τ g + +abbrev resolutionConnecting : + (HomotopyCategory.quotient _ _).obj (L.completeCochain τ) ⟶ + ((HomotopyCategory.quotient _ _).obj (M.completeCochain τ))⟦(1 : ℤ)⟧ := + (resolutionTriangle τ f g hf hg hex).mor₃ + +variable {M₁ N₁ L₁ M₂ N₂ L₂ : FiniteLeftModule k R} +variable (f₁ : M₁.carrier →ₗ[R] N₁.carrier) (g₁ : N₁.carrier →ₗ[R] L₁.carrier) + (f₂ : M₂.carrier →ₗ[R] N₂.carrier) (g₂ : N₂.carrier →ₗ[R] L₂.carrier) +variable (hf₁ : Function.Injective f₁) (hg₁ : Function.Surjective g₁) (hex₁ : Function.Exact f₁ g₁) + (hf₂ : Function.Injective f₂) (hg₂ : Function.Surjective g₂) (hex₂ : Function.Exact f₂ g₂) +variable (a : M₁.carrier →ₗ[R] M₂.carrier) (b : N₁.carrier →ₗ[R] N₂.carrier) + (c : L₁.carrier →ₗ[R] L₂.carrier) + +theorem resolutionConnecting_natural + (hab : b.comp f₁ = f₂.comp a) (hbc : g₂.comp b = c.comp g₁) : + (HomotopyCategory.quotient _ _).map (resolutionMap τ c) ≫ + resolutionConnecting τ f₂ g₂ hf₂ hg₂ hex₂ = + resolutionConnecting τ f₁ g₁ hf₁ hg₁ hex₁ ≫ + (CategoryTheory.shiftFunctor (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) 1).map + ((HomotopyCategory.quotient _ _).map (resolutionMap τ a)) := by + let := τ.regular_injective + apply shortExactTriangle_connecting_natural + · rw [resolutionMap_cokernel, ← resolutionCokernelMap_comp, + resolutionMap_cokernel, ← resolutionCokernelMap_comp, hbc] + · rw [cochainCokernelMap_comp, cochainCokernelMap_comp, + resolutionMap_cokernel, resolutionMap_cokernel, resolutionMap_cokernel, resolutionMap_cokernel, + ← resolutionCokernelMap_comp, ← resolutionCokernelMap_comp, hab] + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/FiniteModuleTriangle.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/FiniteModuleTriangle.lean new file mode 100644 index 0000000000000000000000000000000000000000..d0bfe9ba17b14e071ed15416cd5ed4975c1106cd --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/FiniteModuleTriangle.lean @@ -0,0 +1,92 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.FiniteCochainResolution +import OAI.Algebra.AuslanderReiten.Homology.ShortExactTriangle + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Pretriangulated + +namespace ArExplicit.FiniteLeftModule + +open CompleteComparison + +universe u + +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (τ : FrobeniusTrace k R) +variable {M N L : FiniteLeftModule k R} + +def resolutionCokernelMap (f : M.carrier →ₗ[R] N.carrier) : + CochainCokernel (M.completeCochain τ) →ₗ[R] CochainCokernel (N.completeCochain τ) := + (N.completeCochainCokernelEquiv τ).symm.toLinearMap.comp + (f.comp (M.completeCochainCokernelEquiv τ).toLinearMap) + +def resolutionMap (f : M.carrier →ₗ[R] N.carrier) : M.completeCochain τ ⟶ N.completeCochain τ := + Classical.choose (cochainCokernelMap_surjective + (M.completeCochain_totallyAcyclic τ).to_chain + (N.completeCochain_totallyAcyclic τ).to_chain.toExactProjectiveComplex + (resolutionCokernelMap τ f)) + +@[simp] +theorem resolutionMap_cokernel (f : M.carrier →ₗ[R] N.carrier) : + cochainCokernelMap (resolutionMap τ f) = resolutionCokernelMap τ f := + Classical.choose_spec (cochainCokernelMap_surjective + (M.completeCochain_totallyAcyclic τ).to_chain + (N.completeCochain_totallyAcyclic τ).to_chain.toExactProjectiveComplex + (resolutionCokernelMap τ f)) + +theorem resolutionCokernelMap_injective (f : M.carrier →ₗ[R] N.carrier) + (hf : Function.Injective f) : Function.Injective (resolutionCokernelMap τ f) := + (N.completeCochainCokernelEquiv τ).symm.injective.comp + (hf.comp (M.completeCochainCokernelEquiv τ).injective) + +theorem resolutionCokernelMap_surjective (f : M.carrier →ₗ[R] N.carrier) + (hf : Function.Surjective f) : Function.Surjective (resolutionCokernelMap τ f) := + (N.completeCochainCokernelEquiv τ).symm.surjective.comp + (hf.comp (M.completeCochainCokernelEquiv τ).surjective) + +theorem resolutionCokernelMap_exact + (f : M.carrier →ₗ[R] N.carrier) (g : N.carrier →ₗ[R] L.carrier) + (h : Function.Exact f g) : Function.Exact (resolutionCokernelMap τ f) (resolutionCokernelMap τ g) := by + intro x + constructor + · intro hx + have hx' : g ((N.completeCochainCokernelEquiv τ) x) = 0 := by + have hh := congrArg (L.completeCochainCokernelEquiv τ) hx + simpa [resolutionCokernelMap] using hh + obtain ⟨m, hm⟩ := (h _).mp hx' + refine ⟨(M.completeCochainCokernelEquiv τ).symm m, ?_⟩ + simp [resolutionCokernelMap, hm] + · rintro ⟨m, rfl⟩ + change (L.completeCochainCokernelEquiv τ).symm + (g ((N.completeCochainCokernelEquiv τ) + ((N.completeCochainCokernelEquiv τ).symm + (f ((M.completeCochainCokernelEquiv τ) m))))) = 0 + rw [LinearEquiv.apply_symm_apply, (h _).mpr ⟨_, rfl⟩, map_zero] + +theorem exists_resolution_triangle + (f : M.carrier →ₗ[R] N.carrier) (g : N.carrier →ₗ[R] L.carrier) + (hf : Function.Injective f) (hg : Function.Surjective g) (hex : Function.Exact f g) : + ∃ δ : (HomotopyCategory.quotient _ _).obj (L.completeCochain τ) ⟶ + ((HomotopyCategory.quotient _ _).obj (M.completeCochain τ))⟦(1 : ℤ)⟧, + Triangle.mk ((HomotopyCategory.quotient _ _).map (resolutionMap τ f)) + ((HomotopyCategory.quotient _ _).map (resolutionMap τ g)) δ ∈ + distTriang (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) := by + let := τ.regular_injective + apply exists_shortExact_distinguished (resolutionMap τ f) (resolutionCokernelMap τ g) + (hF := M.completeCochain_totallyAcyclic τ) + (hG := N.completeCochain_totallyAcyclic τ) + (hH := L.completeCochain_totallyAcyclic τ) + (ψ := resolutionMap τ g) + · rw [resolutionMap_cokernel] + exact resolutionCokernelMap_exact τ f g hex + · rw [resolutionMap_cokernel] + exact resolutionCokernelMap_injective τ f hf + · exact resolutionCokernelMap_surjective τ g hg + · exact resolutionMap_cokernel τ g + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/InductionAdjunction.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/InductionAdjunction.lean new file mode 100644 index 0000000000000000000000000000000000000000..e627f786baec4f019946640962800dd904e867af --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/InductionAdjunction.lean @@ -0,0 +1,80 @@ +import OAI.Algebra.AuslanderReiten.Modules.InductionBimodule +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorUnit + +namespace OAI + +noncomputable section +namespace ArExplicit +namespace Induction + +variable {k R S V W : Type*} [CommRing k] [Ring R] [Ring S] + [Algebra k R] [Algebra k S] (ι : R →ₐ[k] S) + [AddCommGroup V] [Module k V] [Module R V] [IsScalarTower k R V] + [AddCommGroup W] [Module k W] [Module R W] [Module S W] + [IsScalarTower k R W] [IsScalarTower k S W] + +abbrev Object := BalancedTensor k R (InductionBimodule ι) V + +def restrictHom (hcompat : ∀ (r : R) (w : W), r • w = (ι r) • w) + (f : Object (V := V) ι →ₗ[S] W) : V →ₗ[R] W where + toFun v := f (BalancedTensor.tmul ⟨1⟩ v) + map_add' x y := by rw [BalancedTensor.tmul_add, map_add] + map_smul' r v := by + rw [← BalancedTensor.balance] + change f (BalancedTensor.tmul ⟨1 * ι r⟩ v) = r • f (BalancedTensor.tmul ⟨1⟩ v) + rw [one_mul, hcompat] + have he : BalancedTensor.tmul (InductionBimodule.mk (ι r)) v = + (ι r) • (BalancedTensor.tmul (InductionBimodule.mk (1 : S)) v : Object (V := V) ι) := by + change BalancedTensor.tmul (InductionBimodule.mk (ι r)) v = + BalancedTensor.tmul (InductionBimodule.mk (ι r * 1)) v + rw [mul_one] + rw [he, f.map_smul] + +def extendFormula (g : V →ₗ[R] W) : InductionBimodule ι →ₗ[k] V →ₗ[k] W := + ((BalancedTensor.leftAction (k := k) (R := S) (M := W)).compl₂ + (g.restrictScalars k)).comp (InductionBimodule.scalarEquiv ι).toLinearMap + +def extendHom (hcompat : ∀ (r : R) (w : W), r • w = (ι r) • w) + (g : V →ₗ[R] W) : Object (V := V) ι →ₗ[S] W := + BalancedTensor.liftLeft (extendFormula ι g) + (by + intro a r v + change (a.value * ι r) • g v = a.value • g (r • v) + rw [g.map_smul, hcompat, mul_smul]) + (by intro s a v; exact mul_smul s a.value (g v)) + +@[simp] theorem extendHom_tmul (hcompat : ∀ (r : R) (w : W), r • w = (ι r) • w) + (g : V →ₗ[R] W) (a : InductionBimodule ι) (v : V) : + extendHom ι hcompat g (BalancedTensor.tmul a v) = a.value • g v := rfl + +def homEquiv (hcompat : ∀ (r : R) (w : W), r • w = (ι r) • w) : + (Object (V := V) ι →ₗ[S] W) ≃ₗ[k] (V →ₗ[R] W) where + toFun := restrictHom ι hcompat + invFun := extendHom ι hcompat + left_inv f := by + apply BalancedTensor.leftHom_ext + intro a v + change a.value • f (BalancedTensor.tmul ⟨1⟩ v) = f (BalancedTensor.tmul a v) + rw [← f.map_smul] + congr 1 + change BalancedTensor.tmul ⟨a.value * 1⟩ v = BalancedTensor.tmul a v + rw [mul_one] + right_inv g := by + apply LinearMap.ext + intro v + exact one_smul S (g v) + map_add' f g := by + apply LinearMap.ext + intro v + rfl + map_smul' a f := by + apply LinearMap.ext + intro v + rfl + +end Induction +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/InductionBimodule.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/InductionBimodule.lean new file mode 100644 index 0000000000000000000000000000000000000000..d41618e82d4fc3e9d4c7f6e0e48a996f443f25b4 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/InductionBimodule.lean @@ -0,0 +1,70 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorPi +import Mathlib.Algebra.Module.TransferInstance +import Mathlib.Algebra.Module.Projective + +namespace OAI + +noncomputable section +namespace ArExplicit + +@[ext] structure InductionBimodule {k R S : Type*} [CommRing k] [Ring R] [Ring S] + [Algebra k R] [Algebra k S] (ι : R →ₐ[k] S) where + value : S + +namespace InductionBimodule +variable {k R S : Type*} [CommRing k] [Ring R] [Ring S] [Algebra k R] [Algebra k S] + (ι : R →ₐ[k] S) + +def coordinates : InductionBimodule ι ≃ S where + toFun := value + invFun := InductionBimodule.mk + left_inv _ := rfl + right_inv _ := rfl + +instance : AddCommGroup (InductionBimodule ι) := (coordinates ι).addCommGroup +instance : Module S (InductionBimodule ι) := (coordinates ι).addEquiv.module S +instance : Module k (InductionBimodule ι) := (coordinates ι).addEquiv.module k +instance : SMul Rᵐᵒᵖ (InductionBimodule ι) := ⟨fun r x => ⟨x.value * ι r.unop⟩⟩ + +@[simp] theorem value_zero : (0 : InductionBimodule ι).value = 0 := rfl +@[simp] theorem value_add (x y : InductionBimodule ι) : (x + y).value = x.value + y.value := rfl +@[simp] theorem value_smul (s : S) (x : InductionBimodule ι) : (s • x).value = s * x.value := rfl +@[simp] theorem value_scalar (a : k) (x : InductionBimodule ι) : (a • x).value = a • x.value := rfl +@[simp] theorem value_right (r : Rᵐᵒᵖ) (x : InductionBimodule ι) : + (r • x).value = x.value * ι r.unop := rfl + +instance : Module Rᵐᵒᵖ (InductionBimodule ι) where + one_smul x := by ext; simp + mul_smul r s x := by ext; simp [mul_assoc] + smul_zero r := by ext; simp + smul_add r x y := by ext; simp [add_mul] + add_smul r s x := by ext; simp [mul_add] + zero_smul x := by ext; simp + +instance : SMulCommClass S Rᵐᵒᵖ (InductionBimodule ι) where + smul_comm s r x := by ext; exact (mul_assoc _ _ _).symm +instance : SMulCommClass k S (InductionBimodule ι) where + smul_comm a s x := by ext; exact (mul_smul_comm a s x.value).symm +instance : IsScalarTower k S (InductionBimodule ι) where + smul_assoc a s x := by ext; exact smul_mul_assoc a s x.value +instance : IsScalarTower k Rᵐᵒᵖ (InductionBimodule ι) where + smul_assoc a r x := by + ext + change x.value * ι (a • r.unop) = a • (x.value * ι r.unop) + rw [map_smul, mul_smul_comm] +instance : SMulCommClass k Rᵐᵒᵖ (InductionBimodule ι) where + smul_comm a r x := by ext; exact (smul_mul_assoc a x.value (ι r.unop)).symm + +def leftEquiv : InductionBimodule ι ≃ₗ[S] S := (coordinates ι).addEquiv.linearEquiv S +def scalarEquiv : InductionBimodule ι ≃ₗ[k] S := (coordinates ι).addEquiv.linearEquiv k + +instance : Module.Free S (InductionBimodule ι) := Module.Free.of_equiv (leftEquiv ι).symm +instance : Module.Projective S (InductionBimodule ι) := Module.Projective.of_free +instance : Module.Finite S (InductionBimodule ι) := Module.Finite.equiv (leftEquiv ι).symm + +end InductionBimodule +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/ModuleRestriction.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/ModuleRestriction.lean new file mode 100644 index 0000000000000000000000000000000000000000..6acc828bd72b31bcf41ce21530593fd4d5c88d32 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/ModuleRestriction.lean @@ -0,0 +1,22 @@ +import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings +import Mathlib.Algebra.Homology.ShortComplex.ExactFunctor +import Mathlib.Algebra.Homology.ShortComplex.ModuleCat + +namespace OAI + +open CategoryTheory +namespace ArExplicit.ModuleRestriction +universe v u u' +variable {R : Type u} {S : Type u'} [Ring R] [Ring S] (f : R →+* S) + +theorem map_exact (s : ShortComplex (ModuleCat.{v} S)) (h : s.Exact) : + (s.map (ModuleCat.restrictScalars f)).Exact := by + rw [ShortComplex.ShortExact.moduleCat_exact_iff_function_exact] at h ⊢ + exact h + +noncomputable instance preservesHomology : (ModuleCat.restrictScalars.{v} f).PreservesHomology := + ((Functor.exact_tfae (ModuleCat.restrictScalars.{v} f)).out 2 3).mp (map_exact f) + +end ArExplicit.ModuleRestriction + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/SplitModules.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/SplitModules.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b63c62e70fa83cbaf98611f34895b2aed402c16 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/SplitModules.lean @@ -0,0 +1,87 @@ +import OAI.Algebra.AuslanderReiten.Complete.CompleteResolution +import Mathlib.Algebra.Module.Injective + +namespace OAI + +noncomputable section + +namespace ArExplicit + +universe u + +variable {R M N : Type u} [Ring R] [AddCommGroup M] [Module R M] +variable [AddCommGroup N] [Module R N] + +theorem finiteProjective_injective [Module.Injective R R] + [Module.Finite R M] [Module.Projective R M] : Module.Injective R M where + out := by + intro X Y _ _ _ _ f hf g + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' R M + obtain ⟨s, hs⟩ := Module.projective_lifting_property p (LinearMap.id : M →ₗ[R] M) hp + obtain ⟨g', hg'⟩ := Module.Injective.extension_property R (Fin n → R) X Y f hf (s.comp g) + refine ⟨p.comp g', ?_⟩ + intro x + change p (g' (f x)) = g x + rw [show g' (f x) = s (g x) from DFunLike.congr_fun hg' x] + exact DFunLike.congr_fun hs (g x) + +def splitKernelProjection (f : M →ₗ[R] N) (s : N →ₗ[R] M) (hs : f.comp s = LinearMap.id) : + M →ₗ[R] LinearMap.ker f := + (LinearMap.id - s.comp f).codRestrict _ (by + intro x + change f (x - s (f x)) = 0 + rw [map_sub, show f (s (f x)) = f x from DFunLike.congr_fun hs (f x)] + exact sub_self _) + +@[simp] theorem splitKernelProjection_subtype (f : M →ₗ[R] N) (s : N →ₗ[R] M) + (hs : f.comp s = LinearMap.id) : + (splitKernelProjection f s hs).comp (LinearMap.ker f).subtype = LinearMap.id := by + apply LinearMap.ext + intro x + apply Subtype.ext + simp [splitKernelProjection, show f x.val = 0 from x.property] + +theorem projective_kernel_of_surjective [Module.Projective R M] [Module.Projective R N] + (f : M →ₗ[R] N) (hf : Function.Surjective f) : Module.Projective R (LinearMap.ker f) := by + obtain ⟨s, hs⟩ := Module.projective_lifting_property f (LinearMap.id : N →ₗ[R] N) hf + exact Module.Projective.of_split (LinearMap.ker f).subtype (splitKernelProjection f s hs) + (splitKernelProjection_subtype f s hs) + +theorem finite_kernel_of_surjective [Module.Finite R M] [Module.Projective R N] + (f : M →ₗ[R] N) (hf : Function.Surjective f) : Module.Finite R (LinearMap.ker f) := by + obtain ⟨s, hs⟩ := Module.projective_lifting_property f (LinearMap.id : N →ₗ[R] N) hf + apply Module.Finite.of_surjective (splitKernelProjection f s hs) + intro x + exact ⟨x.val, DFunLike.congr_fun (splitKernelProjection_subtype f s hs) x⟩ + +def splitCokernelSection (i : M →ₗ[R] N) (r : N →ₗ[R] M) (hr : r.comp i = LinearMap.id) : + (N ⧸ LinearMap.range i) →ₗ[R] N := + (LinearMap.range i).liftQ (LinearMap.id - i.comp r) (by + rintro x ⟨m, rfl⟩ + change i m - i (r (i m)) = 0 + rw [show r (i m) = m from DFunLike.congr_fun hr m] + exact sub_self _) + +@[simp] theorem splitCokernelSection_mkQ (i : M →ₗ[R] N) (r : N →ₗ[R] M) + (hr : r.comp i = LinearMap.id) : + (LinearMap.range i).mkQ.comp (splitCokernelSection i r hr) = LinearMap.id := by + apply LinearMap.ext + intro x + obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective (LinearMap.range i) x + change (LinearMap.range i).mkQ (x - i (r x)) = (LinearMap.range i).mkQ x + rw [map_sub] + have hi : (LinearMap.range i).mkQ (i (r x)) = 0 := + DFunLike.congr_fun (LinearMap.range_mkQ_comp i) (r x) + rw [hi, sub_zero] + +theorem projective_cokernel_of_injective [Module.Injective R M] [Module.Projective R N] + (i : M →ₗ[R] N) (hi : Function.Injective i) : Module.Projective R (N ⧸ LinearMap.range i) := by + obtain ⟨r, hr⟩ := Module.Injective.extension_property R M M N i hi (LinearMap.id : M →ₗ[R] M) + exact Module.Projective.of_split (splitCokernelSection i r hr) (LinearMap.range i).mkQ + (splitCokernelSection_mkQ i r hr) + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/SupportedPi.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/SupportedPi.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d91ef0674fa864f6bb4d04211f5251bbc414eae --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/SupportedPi.lean @@ -0,0 +1,52 @@ +import Mathlib.LinearAlgebra.Pi + +namespace OAI + +noncomputable section +namespace ArExplicit +universe u v w z +variable {k : Type u} [Field k] {ι : Type v} {κ : Type w} +variable (M : κ → Type z) [∀ j, AddCommGroup (M j)] [∀ j, Module k (M j)] +variable (f : ι → κ) + +def supportedRestriction : (∀ j, M j) →ₗ[k] (∀ i, M (f i)) where + toFun x i := x (f i) + map_add' _ _ := rfl + map_smul' _ _ := rfl + +theorem supportedRestriction_bijective (hf : Function.Injective f) + (hz : ∀ j, (¬ ∃ i, f i = j) → ∀ x : M j, x = 0) : + Function.Bijective (supportedRestriction (k := k) M f) := by + constructor + · intro x y hxy + funext j + by_cases hj : ∃ i, f i = j + · obtain ⟨i, rfl⟩ := hj + exact congrFun hxy i + · exact (hz j hj (x j)).trans (hz j hj (y j)).symm + · intro y + classical + let x : ∀ j, M j := fun j => if hj : ∃ i, f i = j then + hj.choose_spec ▸ y hj.choose else 0 + refine ⟨x, ?_⟩ + funext i + change x (f i) = y i + have hi : ∃ a, f a = f i := ⟨i, rfl⟩ + simp only [x, dite_eq_left hi] + have hs (a : ι) (ha : f a = f i) : ha ▸ y a = y i := by + have hai : a = i := hf ha + subst a + rfl + exact hs _ _ + +def supportedPiEquiv (hf : Function.Injective f) + (hz : ∀ j, (¬ ∃ i, f i = j) → ∀ x : M j, x = 0) : + (∀ j, M j) ≃ₗ[k] (∀ i, M (f i)) := + LinearEquiv.ofBijective (supportedRestriction M f) + (supportedRestriction_bijective M f hf hz) + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/TInducedHom.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/TInducedHom.lean new file mode 100644 index 0000000000000000000000000000000000000000..655e8bec64e5f677bea3a677fdef990c03ce8d24 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/TInducedHom.lean @@ -0,0 +1,66 @@ +import OAI.Algebra.AuslanderReiten.Modules.TInductionHomology +import Mathlib.Algebra.Homology.DerivedCategory.KProjective +import Mathlib.Algebra.Homology.HomotopyCategory.HomComplexSingle + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.Resolution +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +local notation "C" => BaseAlgebra k q +local notation "T" => ArExplicit.T k q + +def tInducedCochain : CochainComplex (ModuleCat T) ℤ := + (TrivialInduction.inducedComplex (k := k) (complex q)).extend ComplexShape.embeddingDownNat + +omit [CharP k 2] in +private theorem inducedE_hom_zero (hq1 : 1 + q ≠ 0) + (f : Induction.Object (V := E q) (TrivialExtension.inlHom (k := k) (A := C)) →ₗ[T] Simple q) : f = 0 := by + let e := Induction.homEquiv (V := E q) (W := Simple q) + (TrivialExtension.inlHom (k := k) (A := C)) (fun _ _ => rfl) + exact e.injective (by rw [map_zero]; exact hom_E_simple_eq_zero q hq1 (e f)) + +theorem tInduced_term_hom_zero (hq1 : 1 + q ≠ 0) (n : ℕ) + (f : (TrivialInduction.inducedComplex (k := k) (complex q)).X (n + 1) ⟶ + ModuleCat.of T (Simple q)) : f = 0 := by + let := moduleCatBaseModule (k := k) (R := C) ((complex q).X (n + 1)) + let := moduleCatBaseTower (k := k) (R := C) ((complex q).X (n + 1)) + let e := Induction.homEquiv (V := (complex q).X (n + 1)) (W := Simple q) + (TrivialExtension.inlHom (k := k) (A := C)) (fun _ _ => rfl) + apply ModuleCat.hom_ext + exact e.injective ((hom_E_simple_eq_zero q hq1 (e f.hom)).trans (e.map_zero).symm) + +theorem tInducedCochain_term_hom_zero (hq1 : 1 + q ≠ 0) (n : ℤ) (hn : n ≠ 0) + (f : (tInducedCochain q).X n ⟶ ModuleCat.of T (Simple q)) : f = 0 := by + dsimp [tInducedCochain] at f ⊢ + by_cases hh : ∃ m : ℕ, -(m : ℤ) = n + · obtain ⟨m, hm⟩ := hh + have hm0 : m ≠ 0 := by intro h; subst m; simp at hm; exact hn hm.symm + obtain ⟨r, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hm0 + let e := (TrivialInduction.inducedComplex (k := k) (complex q)).extendXIso + ComplexShape.embeddingDownNat hm + apply (cancel_epi e.inv).mp + exact (tInduced_term_hom_zero q hq1 r (e.inv ≫ f)).trans (Limits.comp_zero).symm + · exact ((TrivialInduction.inducedComplex (k := k) (complex q)).isZero_extend_X + ComplexShape.embeddingDownNat n (by intro m hm; exact hh ⟨m, hm⟩)).eq_of_src f 0 + +theorem tInduced_fullCochain_zero (hq1 : 1 + q ≠ 0) (n : ℤ) (hn : n ≠ 0) + (a : CochainComplex.HomComplex.Cochain (tInducedCochain q) + ((CochainComplex.singleFunctor (ModuleCat T) 0).obj (ModuleCat.of T (Simple q))) n) : a = 0 := by + apply (CochainComplex.HomComplex.Cochain.toSingleEquiv (p := -n) (by omega)).injective + rw [map_zero] + exact tInducedCochain_term_hom_zero q hq1 (-n) (by omega) _ + +instance tInducedCochain_kprojective : (tInducedCochain q).IsKProjective := by + let (n : ℕ) : Projective ((TrivialInduction.inducedComplex (k := k) (complex q)).X n) := + ModuleCat.projective_of_categoryTheory_projective _ + change CochainComplex.IsKProjective ((TrivialInduction.inducedComplex (k := k) (complex q)).extend ComplexShape.embeddingDownNat) + infer_instance + +end ArExplicit.Resolution + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/TInductionHomology.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/TInductionHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..80768611fec401235946545dba23c03c3f0df013 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/TInductionHomology.lean @@ -0,0 +1,77 @@ +import OAI.Algebra.AuslanderReiten.Duality.IdealDualHomology +import OAI.Algebra.AuslanderReiten.Resolutions.TrivialInductionDual +import OAI.Algebra.AuslanderReiten.Homology.ConcentratedNatDerived +import OAI.Algebra.AuslanderReiten.Algebras.TSimple + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.Resolution +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +local notation "C" => BaseAlgebra k q +local notation "T" => ArExplicit.T k q + +def inflatedSimpleIso : + (TrivialInduction.inflate (k := k)).obj (ModuleCat.of C (Simple q)) ≅ + ModuleCat.of T (Simple q) := Iso.refl _ + +def dualIdealComparison : + TrivialInduction.dualComplex (k := k) (complex q) ≅ + ((TrivialInduction.inflate (k := k)).mapHomologicalComplex _).obj (idealDualComplex q) := + TrivialInduction.dualComplexIso (complex q) ≪≫ + ((TrivialInduction.inflate (k := k)).mapHomologicalComplex _).mapIso (tensorIdealComparison q) + +theorem tDual_exact (hq : q ≠ 0) (h : NoPositivePowerOne q) (n : ℕ) (hn : n ≠ 2) : + (TrivialInduction.dualComplex (k := k) (complex q)).ExactAt n := by + apply (exactAt_iff_of_quasiIsoAt (dualIdealComparison q).hom n).mpr + exact ModuleRestriction.map_exact _ _ (idealDual_exactAt q hq h n hn) + +def tDual_homology_iso (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) : + (TrivialInduction.dualComplex (k := k) (complex q)).homology 2 ≅ ModuleCat.of T (Simple q) := + HomologicalComplex.homologyMapIso (dualIdealComparison q) 2 ≪≫ + ((idealDualComplex q).sc 2).mapHomologyIso (TrivialInduction.inflate (k := k)) ≪≫ + (TrivialInduction.inflate (k := k)).mapIso (idealDual_homology_two_iso q hq hq1) ≪≫ + inflatedSimpleIso q + +def tDualDerivedIso [HasDerivedCategory (ModuleCat T)] + (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) (h : NoPositivePowerOne q) : + DerivedCategory.Q.obj + ((TrivialInduction.dualComplex (k := k) (complex q)).extend ComplexShape.embeddingDownNat) ≅ + ((DerivedCategory.singleFunctor (ModuleCat T) 0).obj (ModuleCat.of T (Simple q)))⟦(2 : ℤ)⟧ := + concentratedNatDerivedIso _ 2 _ (tDual_exact q hq h) (tDual_homology_iso q hq hq1) + +theorem tQuotient_exact (h : NoPositivePowerOne q) (n : ℕ) (hn : n ≠ 0) : + (TrivialInduction.quotientComplex (k := k) (complex q)).ExactAt n := by + apply (exactAt_iff_of_quasiIsoAt + (TrivialInduction.quotientComplexIso (complex q)).hom n).mpr + obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hn + exact ModuleRestriction.map_exact _ _ (complex_exactAt_succ q h m) + +def cResolution_homology_zero (h : NoPositivePowerOne q) : + (complex q).homology 0 ≅ ModuleCat.of C (Simple q) := by + letI := toSimple_quasiIso q h + exact isoOfQuasiIsoAt (toSimple q) 0 ≪≫ + HomologicalComplex.singleObjHomologySelfIso _ _ _ + +def tQuotient_homology_iso (h : NoPositivePowerOne q) : + (TrivialInduction.quotientComplex (k := k) (complex q)).homology 0 ≅ ModuleCat.of T (Simple q) := + HomologicalComplex.homologyMapIso (TrivialInduction.quotientComplexIso (complex q)) 0 ≪≫ + ((complex q).sc 0).mapHomologyIso (TrivialInduction.inflate (k := k)) ≪≫ + (TrivialInduction.inflate (k := k)).mapIso (cResolution_homology_zero q h) ≪≫ + inflatedSimpleIso q + +def tQuotientDerivedIso [HasDerivedCategory (ModuleCat T)] + (h : NoPositivePowerOne q) : + DerivedCategory.Q.obj + ((TrivialInduction.quotientComplex (k := k) (complex q)).extend ComplexShape.embeddingDownNat) ≅ + (DerivedCategory.singleFunctor (ModuleCat T) 0).obj (ModuleCat.of T (Simple q)) := + concentratedNatDerivedIso _ 0 _ (tQuotient_exact q h) (tQuotient_homology_iso q h) ≪≫ + (shiftFunctorZero _ ℤ).app _ + +end ArExplicit.Resolution + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/TInductionTriangle.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/TInductionTriangle.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e27d829739dfbe20197dc8ef7db9f2ccaddcece --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/TInductionTriangle.lean @@ -0,0 +1,72 @@ +import OAI.Algebra.AuslanderReiten.Modules.TInducedHom +import OAI.Algebra.AuslanderReiten.Ext.ExtendShortExact +import OAI.Algebra.AuslanderReiten.Homology.DerivedHomVanishing +import OAI.Algebra.AuslanderReiten.Homology.TriangleRecurrence + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.Resolution +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +local notation "C" => BaseAlgebra k q +local notation "T" => ArExplicit.T k q + +def tExtendedSequence : ShortComplex (CochainComplex (ModuleCat T) ℤ) := + (TrivialInduction.sequence (k := k) (complex q)).map + (ComplexShape.embeddingDownNat.extendFunctor (ModuleCat T)) + +theorem tExtendedSequence_shortExact : (tExtendedSequence q).ShortExact := + extend_shortExact _ _ (TrivialInduction.sequence_shortExact (complex q)) + +variable [HasDerivedCategory (ModuleCat.{u} (ArExplicit.T k q))] + +def tSimpleDerived : DerivedCategory (ModuleCat T) := + (DerivedCategory.singleFunctor (ModuleCat T) 0).obj (ModuleCat.of T (Simple q)) + +def tInducedDerived : DerivedCategory (ModuleCat T) := + DerivedCategory.Q.obj (tInducedCochain q) + +def tTriangleA (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) (h : NoPositivePowerOne q) : + (tSimpleDerived q)⟦(2 : ℤ)⟧ ⟶ tInducedDerived q := + (tDualDerivedIso q hq hq1 h).inv ≫ DerivedCategory.Q.map (tExtendedSequence q).f + +def tTriangleB (h : NoPositivePowerOne q) : tInducedDerived q ⟶ tSimpleDerived q := + DerivedCategory.Q.map (tExtendedSequence q).g ≫ (tQuotientDerivedIso q h).hom + +def tTriangleD (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) (h : NoPositivePowerOne q) : + tSimpleDerived q ⟶ ((tSimpleDerived q)⟦(2 : ℤ)⟧)⟦(1 : ℤ)⟧ := + (tQuotientDerivedIso q h).inv ≫ + DerivedCategory.triangleOfSESδ (tExtendedSequence_shortExact q) ≫ + (tDualDerivedIso q hq hq1 h).hom⟦(1 : ℤ)⟧' + +def tInductionTriangle (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) (h : NoPositivePowerOne q) := + Pretriangulated.Triangle.mk (tTriangleA q hq hq1 h) (tTriangleB q h) (tTriangleD q hq hq1 h) + +def tInductionTriangleIso (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) (h : NoPositivePowerOne q) : + DerivedCategory.triangleOfSES (tExtendedSequence_shortExact q) ≅ tInductionTriangle q hq hq1 h := + Pretriangulated.Triangle.isoMk _ _ (tDualDerivedIso q hq hq1 h) (Iso.refl _) + (tQuotientDerivedIso q h) + (by exact (Category.comp_id _).trans (Iso.hom_inv_id_assoc _ _).symm) + (by exact (Category.id_comp _).symm) + (by exact (Iso.hom_inv_id_assoc _ _).symm) + +theorem tInductionTriangle_distinguished (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) + (h : NoPositivePowerOne q) : + tInductionTriangle q hq hq1 h ∈ distTriang (DerivedCategory (ModuleCat T)) := + Pretriangulated.isomorphic_distinguished _ + (DerivedCategory.triangleOfSES_distinguished (tExtendedSequence_shortExact q)) + _ (tInductionTriangleIso q hq hq1 h).symm + +theorem tInducedDerived_hom_zero (hq1 : 1 + q ≠ 0) (n : ℤ) (hn : n ≠ 0) + (f : tInducedDerived q ⟶ (tSimpleDerived q)⟦n⟧) : f = 0 := + derivedHom_zero_of_cochain_zero (tInducedCochain q) + ((CochainComplex.singleFunctor (ModuleCat T) 0).obj (ModuleCat.of T (Simple q))) n + (tInduced_fullCochain_zero q hq1 n hn) f + +end ArExplicit.Resolution + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/TrivialInduction.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/TrivialInduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..eae172625edbe3a471b248159ca50517ecead1b6 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/TrivialInduction.lean @@ -0,0 +1,112 @@ +import OAI.Algebra.AuslanderReiten.Algebras.TrivialExtensionRadical +import OAI.Algebra.AuslanderReiten.Modules.CoinducedBimodule +import OAI.Algebra.AuslanderReiten.Modules.InductionBimodule + +namespace OAI + +noncomputable section +namespace ArExplicit.TrivialInduction + +variable {k R : Type*} [CommRing k] [Ring R] [Algebra k R] + +local notation "T" => TrivialExtension k R + +abbrev Middle := InductionBimodule (TrivialExtension.inlHom : R →ₐ[k] T) +abbrev Quotient := InductionBimodule (AlgHom.id k R) + +instance dualModule : Module T (Coinduced k R) := + Module.compHom (Coinduced k R) TrivialExtension.projection.toRingHom + +@[simp] theorem dual_smul (t : T) (φ : Coinduced k R) : t • φ = t.base • φ := rfl + +instance : SMulCommClass k T (Coinduced k R) where + smul_comm a t φ := smul_comm a t.base φ +instance : SMulCommClass T Rᵐᵒᵖ (Coinduced k R) where + smul_comm t r φ := smul_comm t.base r φ +instance : IsScalarTower k T (Coinduced k R) where + smul_assoc a t φ := smul_assoc a t.base φ + +instance quotientModule : Module T (Quotient (k := k) (R := R)) := + Module.compHom _ TrivialExtension.projection.toRingHom + +@[simp] theorem quotient_smul_value (t : T) (r : Quotient (k := k) (R := R)) : + (t • r).value = t.base * r.value := rfl + +instance : SMulCommClass k T (Quotient (k := k) (R := R)) where + smul_comm a t r := smul_comm a t.base r +instance : SMulCommClass T Rᵐᵒᵖ (Quotient (k := k) (R := R)) where + smul_comm t r s := smul_comm t.base r s +instance : IsScalarTower k T (Quotient (k := k) (R := R)) where + smul_assoc a t r := smul_assoc a t.base r + +def inclusion : Coinduced k R →ₗ[Rᵐᵒᵖ] Middle (k := k) (R := R) where + toFun φ := ⟨TrivialExtension.inr φ.functional⟩ + map_add' φ ψ := by + apply InductionBimodule.ext + apply TrivialExtension.ext + · exact (zero_add _).symm + · rfl + map_smul' r φ := by + apply InductionBimodule.ext + apply TrivialExtension.ext + · exact (zero_mul _).symm + · ext x + change φ.functional (r.unop * x) = 0 + φ.functional (r.unop * x) + exact (zero_add _).symm + +def projection : Middle (k := k) (R := R) →ₗ[Rᵐᵒᵖ] Quotient (k := k) (R := R) where + toFun t := ⟨t.value.base⟩ + map_add' _ _ := rfl + map_smul' _ _ := rfl + +@[simp] theorem inclusion_value (φ : Coinduced k R) : + (inclusion φ).value = TrivialExtension.inr φ.functional := rfl +@[simp] theorem projection_value (t : Middle (k := k) (R := R)) : + (projection t).value = t.value.base := rfl + +theorem inclusion_left (t : T) (φ : Coinduced k R) : + inclusion (t • φ) = t • inclusion φ := by + apply InductionBimodule.ext + apply TrivialExtension.ext + · exact (mul_zero _).symm + · ext x + change φ.functional (x * t.base) = φ.functional (x * t.base) + t.dual (0 * x) + rw [zero_mul, map_zero, add_zero] + +theorem projection_left (t : T) (x : Middle (k := k) (R := R)) : + projection (t • x) = t • projection x := rfl + +theorem projection_inclusion : + (projection (k := k) (R := R)).comp inclusion = 0 := rfl + +theorem inclusion_injective : Function.Injective (inclusion (k := k) (R := R)) := by + intro φ ψ h + exact Coinduced.ext (congrArg (fun x : Middle (k := k) (R := R) => x.value.dual) h) + +theorem projection_surjective : Function.Surjective (projection (k := k) (R := R)) := by + intro r + exact ⟨⟨TrivialExtension.inl r.value⟩, rfl⟩ + +theorem inclusion_projection_exact : + Function.Exact (inclusion (k := k) (R := R)) projection := by + intro t + constructor + · intro ht + refine ⟨⟨t.value.dual⟩, ?_⟩ + apply InductionBimodule.ext + apply TrivialExtension.ext + · exact (congrArg InductionBimodule.value ht).symm + · rfl + · rintro ⟨φ, rfl⟩ + rfl + +theorem dual_ideal_annihilates (ψ : Module.Dual k R) (φ : Coinduced k R) : + TrivialExtension.inr ψ • φ = 0 := by + change (0 : R) • φ = 0 + exact zero_smul _ _ + +end ArExplicit.TrivialInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/Twist.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/Twist.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f8003b7f7878541c548535d077e432bf807632b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/Twist.lean @@ -0,0 +1,63 @@ +import OAI.Algebra.AuslanderReiten.Algebras.TrivialExtension + +namespace OAI + +namespace ArExplicit.TrivialExtension + +variable {k A : Type*} [CommRing k] [Ring A] [Algebra k A] + +def twist (h : kˣ) : TrivialExtension k A ≃ₐ[k] TrivialExtension k A where + toFun a := ⟨a.base, (h : k) • a.dual⟩ + invFun a := ⟨a.base, (↑h⁻¹ : k) • a.dual⟩ + left_inv a := by + apply TrivialExtension.ext + · rfl + · simp [smul_smul] + right_inv a := by + apply TrivialExtension.ext + · rfl + · simp [smul_smul] + map_add' a b := by + apply TrivialExtension.ext + · rfl + · exact smul_add _ _ _ + map_mul' a b := by + apply TrivialExtension.ext + · rfl + · ext c + change (h : k) * (b.dual (c * a.base) + a.dual (b.base * c)) = + (h : k) * b.dual (c * a.base) + (h : k) * a.dual (b.base * c) + exact mul_add _ _ _ + commutes' c := by + apply TrivialExtension.ext + · rfl + · change (h : k) • (algebraMap k (TrivialExtension k A) c).dual = + (algebraMap k (TrivialExtension k A) c).dual + simp only [Algebra.algebraMap_eq_smul_one, dual_smul, dual_one, smul_zero] + +@[simp] theorem twist_base (h : kˣ) (a : TrivialExtension k A) : + (twist h a).base = a.base := rfl + +@[simp] theorem twist_dual (h : kˣ) (a : TrivialExtension k A) : + (twist h a).dual = (h : k) • a.dual := rfl + +@[simp] theorem twist_inl (h : kˣ) (a : A) : twist h (inl a) = inl a := by + apply TrivialExtension.ext + · rfl + · exact smul_zero _ + +@[simp] theorem twist_inr (h : kˣ) (φ : Module.Dual k A) : + twist h (inr φ) = inr ((h : k) • φ) := rfl + +theorem trace_twist (h : kˣ) (a : TrivialExtension k A) : + trace (twist h a) = (h : k) * trace a := rfl + +theorem twist_mul (g h : kˣ) (a : TrivialExtension k A) : + twist (g * h) a = twist g (twist h a) := by + apply TrivialExtension.ext + · rfl + · exact mul_smul _ _ _ + +end ArExplicit.TrivialExtension + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedBimodule.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedBimodule.lean new file mode 100644 index 0000000000000000000000000000000000000000..7ca41e3ec4196f513ea71321b057b12cc88fe27b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedBimodule.lean @@ -0,0 +1,102 @@ +import Mathlib.Algebra.Group.TransferInstance +import Mathlib.Algebra.Module.TransferInstance +import Mathlib.Algebra.Module.Projective +import Mathlib.Algebra.Algebra.Opposite +import Mathlib.RingTheory.Finiteness.Basic + +namespace OAI + +namespace ArExplicit + +@[ext] structure TwistedBimodule (k R : Type*) [CommRing k] [Ring R] [Algebra k R] + (σ : R ≃ₐ[k] R) where + value : R + +namespace TwistedBimodule + +variable {k R : Type*} [CommRing k] [Ring R] [Algebra k R] (σ : R ≃ₐ[k] R) + +def coordinates : TwistedBimodule k R σ ≃ R where + toFun := value + invFun := TwistedBimodule.mk + left_inv _ := rfl + right_inv _ := rfl + +instance : AddCommGroup (TwistedBimodule k R σ) := (coordinates σ).addCommGroup +instance : Module R (TwistedBimodule k R σ) := (coordinates σ).addEquiv.module R +instance : Module k (TwistedBimodule k R σ) := (coordinates σ).addEquiv.module k + +@[simp] theorem value_zero : (0 : TwistedBimodule k R σ).value = 0 := rfl +@[simp] theorem value_add (x y : TwistedBimodule k R σ) : + (x + y).value = x.value + y.value := rfl +@[simp] theorem value_left_smul (r : R) (x : TwistedBimodule k R σ) : + (r • x).value = r * x.value := rfl +@[simp] theorem value_scalar_smul (c : k) (x : TwistedBimodule k R σ) : + (c • x).value = c • x.value := rfl + +instance : SMul Rᵐᵒᵖ (TwistedBimodule k R σ) := + ⟨fun r x => ⟨x.value * σ r.unop⟩⟩ + +@[simp] theorem value_right_smul (r : Rᵐᵒᵖ) (x : TwistedBimodule k R σ) : + (r • x).value = x.value * σ r.unop := rfl + +instance : Module Rᵐᵒᵖ (TwistedBimodule k R σ) where + one_smul x := by ext; simp + mul_smul r s x := by ext; simp [mul_assoc] + smul_zero r := by ext; simp + smul_add r x y := by ext; simp [add_mul] + add_smul r s x := by ext; simp [mul_add] + zero_smul x := by ext; simp + +instance : SMulCommClass R Rᵐᵒᵖ (TwistedBimodule k R σ) where + smul_comm r s x := by ext; exact (mul_assoc _ _ _).symm + +instance : IsScalarTower k R (TwistedBimodule k R σ) where + smul_assoc c r x := by ext; exact smul_mul_assoc c r x.value + +instance : SMulCommClass k R (TwistedBimodule k R σ) where + smul_comm c r x := by ext; exact (mul_smul_comm c r x.value).symm + +instance : IsScalarTower k Rᵐᵒᵖ (TwistedBimodule k R σ) where + smul_assoc c r x := by + ext + change x.value * σ (c • r.unop) = c • (x.value * σ r.unop) + rw [map_smul, mul_smul_comm] + +instance : SMulCommClass k Rᵐᵒᵖ (TwistedBimodule k R σ) where + smul_comm c r x := by ext; exact (smul_mul_assoc c x.value (σ r.unop)).symm + +def leftLinearEquiv : TwistedBimodule k R σ ≃ₗ[R] R := (coordinates σ).addEquiv.linearEquiv R + +def rightLinearEquiv : TwistedBimodule k R σ ≃ₗ[Rᵐᵒᵖ] Rᵐᵒᵖ where + toFun x := MulOpposite.op (σ.symm x.value) + invFun x := ⟨σ x.unop⟩ + left_inv x := by ext; exact σ.apply_symm_apply x.value + right_inv x := by simp + map_add' x y := by simp + map_smul' r x := by + apply MulOpposite.unop_injective + change σ.symm (x.value * σ r.unop) = σ.symm x.value * r.unop + simp + +def scalarLinearEquiv : TwistedBimodule k R σ ≃ₗ[k] R := (coordinates σ).addEquiv.linearEquiv k + +instance : Module.Projective R (TwistedBimodule k R σ) := + Module.Projective.of_equiv (leftLinearEquiv σ).symm + +instance : Module.Projective Rᵐᵒᵖ (TwistedBimodule k R σ) := + Module.Projective.of_equiv (rightLinearEquiv σ).symm + +instance : Module.Finite R (TwistedBimodule k R σ) := + Module.Finite.equiv (leftLinearEquiv σ).symm + +instance : Module.Finite Rᵐᵒᵖ (TwistedBimodule k R σ) := + Module.Finite.equiv (rightLinearEquiv σ).symm + +instance [Module.Finite k R] : Module.Finite k (TwistedBimodule k R σ) := + Module.Finite.equiv (scalarLinearEquiv σ).symm + +end TwistedBimodule +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedEvaluationNaturality.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedEvaluationNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..101471a3b9782f0e37923efbb039557bf9cfcc67 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedEvaluationNaturality.lean @@ -0,0 +1,36 @@ +import OAI.Algebra.AuslanderReiten.Modules.TwistedModuleEvaluation + +namespace OAI + +noncomputable section +namespace ArExplicit.FiniteLeftModule +open scoped TensorProduct +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (σ : R ≃ₐ[k] R) {X Y : FiniteLeftModule k R} + +def twistedLeftMap (f : X.carrier →ₗ[R] Y.carrier) : + TwistedLeftModule k R σ X.carrier →ₗ[R] TwistedLeftModule k R σ Y.carrier where + toFun x := ⟨f x.value⟩ + map_add' x y := by + apply TwistedLeftModule.ext + exact f.map_add _ _ + map_smul' r x := by + apply TwistedLeftModule.ext + exact f.map_smul (σ.symm r) x.value + +theorem twistedEvaluationEquiv_natural (f : X.carrier →ₗ[R] Y.carrier) : + (twistedEvaluationEquiv σ Y).toLinearMap.comp + (BalancedTensor.mapRight (k := k) (S := R) + (F := EnvelopingBimodule k R (twistedFiniteModule σ).carrier) f) = + (twistedLeftMap σ f).comp (twistedEvaluationEquiv σ X).toLinearMap := by + apply BalancedTensor.leftHom_ext + intro a x + apply TwistedLeftModule.ext + exact (f.map_smul (σ.symm a.value.value) x).symm + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedFiniteEndpoint.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedFiniteEndpoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b00c68924077aa89a8da7c670013cd82c5686c7 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedFiniteEndpoint.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.Tensor.TwistedEnvelopingEndpoint +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorFiniteEvaluation +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorFunctorExt + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (σ : R ≃ₐ[k] R) (M : FiniteLeftModule k R) +variable (e : BalancedTensor k R + (EnvelopingBimodule k R (twistedFiniteModule σ).carrier) M.carrier ≃ₗ[R] M.carrier) +variable (E : M.carrier ≅ (ModuleCat.restrictScalars σ.symm.toRingHom).obj M.carrier) + +theorem twistedFiniteEndpoint_eq + (h : ∀ (a : EnvelopingBimodule k R (twistedFiniteModule σ).carrier) (m : M.carrier), + E.inv.hom (σ.symm a.value.value • m) = e (BalancedTensor.tmul a m)) : + (twistedEnvelopingRestrictionIso σ).app M.carrier ≪≫ E.symm = + BalancedTensor.nativeEvaluationIso M e := by + apply BalancedTensor.functorIso_ext M.carrier M.carrier + intro a m + exact (twistedEnvelopingEndpoint_tmul σ M.carrier M.carrier E.symm a m).trans + ((h a m).trans (BalancedTensor.nativeEvaluationIso_tmul M e a m).symm) + +theorem twistedFiniteEndpoint_symm_eq + (h : ∀ (a : EnvelopingBimodule k R (twistedFiniteModule σ).carrier) (m : M.carrier), + E.inv.hom (σ.symm a.value.value • m) = e (BalancedTensor.tmul a m)) : + (BalancedTensor.nativeEvaluationIso M e).symm = + E ≪≫ ((twistedEnvelopingRestrictionIso σ).app M.carrier).symm := by + rw [← twistedFiniteEndpoint_eq σ M e E h] + rfl + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedModuleEvaluation.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedModuleEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3533ab3cdb77d5083b11a2ec22c9bec788bdc7c --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedModuleEvaluation.lean @@ -0,0 +1,50 @@ +import OAI.Algebra.AuslanderReiten.Modules.FiniteModuleEvaluation +import OAI.Algebra.AuslanderReiten.Fibers.BimoduleFiber +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorEquiv +import OAI.Algebra.AuslanderReiten.Tensor.TwistedTensor + +namespace OAI + +noncomputable section +namespace ArExplicit +open scoped TensorProduct +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (σ : R ≃ₐ[k] R) + +def twistedEvaluationCoordinates : + EnvelopingBimodule k R (twistedFiniteModule σ).carrier ≃ₗ[k] TwistedBimodule k R σ := + EnvelopingBimodule.scalarEquiv _ + + theorem twistedEvaluationCoordinates_right (r : Rᵐᵒᵖ) + (x : EnvelopingBimodule k R (twistedFiniteModule σ).carrier) : + twistedEvaluationCoordinates σ (r • x) = r • twistedEvaluationCoordinates σ x := by + change (1 : R) • (r • (show TwistedBimodule k R σ from x.value)) = r • (show TwistedBimodule k R σ from x.value) + rw [one_smul] + + theorem twistedEvaluationCoordinates_left (r : R) + (x : EnvelopingBimodule k R (twistedFiniteModule σ).carrier) : + twistedEvaluationCoordinates σ (r • x) = r • twistedEvaluationCoordinates σ x := by + change r • ((1 : Rᵐᵒᵖ) • (show TwistedBimodule k R σ from x.value)) = r • (show TwistedBimodule k R σ from x.value) + rw [one_smul] + +namespace FiniteLeftModule +variable (X : FiniteLeftModule k R) + +def twistedEvaluationEquiv : (evaluated X (twistedFiniteModule σ)).carrier ≃ₗ[R] + TwistedLeftModule k R σ X.carrier := + (BalancedTensor.congrLeft (twistedEvaluationCoordinates σ) (LinearEquiv.refl k X.carrier) + (twistedEvaluationCoordinates_right σ) (fun _ _ => rfl) + (twistedEvaluationCoordinates_left σ)).trans (TwistedBimodule.tensorUntwist σ) + +@[simp] theorem twistedEvaluationEquiv_tmul + (r : EnvelopingBimodule k R (twistedFiniteModule σ).carrier) (x : X.carrier) : + twistedEvaluationEquiv σ X (BalancedTensor.tmul r x) = + ⟨σ.symm r.value.value • x⟩ := rfl + +end FiniteLeftModule +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedOneCochain.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedOneCochain.lean new file mode 100644 index 0000000000000000000000000000000000000000..31fab7994f5f362f634226bce77ee437bf0da22e --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/TwistedOneCochain.lean @@ -0,0 +1,65 @@ +import OAI.Algebra.AuslanderReiten.Bar.TwistedBar + +namespace OAI + +noncomputable section +open scoped TensorProduct + +namespace ArExplicit.AbsoluteBar + +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] + +def oneSuffix (h : R ≃ₐ[k] R) (z : R →ₗ[k] R) : object k R 1 →ₗ[k] R := + TensorProduct.lift (((LinearMap.mul k R).comp z).compl₂ h.symm.toLinearMap) + +@[simp] theorem oneSuffix_tmul (h : R ≃ₐ[k] R) (z : R →ₗ[k] R) (b c : R) : + oneSuffix k R h z (b ⊗ₜ[k] c) = z b * h.symm c := rfl + +def oneCochainLinear (h : R ≃ₐ[k] R) (z : R →ₗ[k] R) : object k R 2 →ₗ[k] R := + TensorProduct.lift ((LinearMap.mul k R).compl₂ (oneSuffix k R h z)) + +@[simp] theorem oneCochainLinear_tmul (h : R ≃ₐ[k] R) (z : R →ₗ[k] R) (a b c : R) : + oneCochainLinear k R h z (a ⊗ₜ[k] (b ⊗ₜ[k] c)) = a * z b * h.symm c := by + exact (mul_assoc _ _ _).symm + +theorem oneCochainLinear_left (h : R ≃ₐ[k] R) (z : R →ₗ[k] R) (a : R) + (x : object k R 2) : + oneCochainLinear k R h z (left k R 2 a x) = a * oneCochainLinear k R h z x := by + induction x using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy, mul_add] + | tmul b x => exact mul_assoc _ _ _ + +theorem oneCochainLinear_right (h : R ≃ₐ[k] R) (z : R →ₗ[k] R) (a : R) + (x : object k R 2) : + oneCochainLinear k R h z (right k R 2 (MulOpposite.op (h a)) x) = + oneCochainLinear k R h z x * a := by + induction x using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy, add_mul] + | tmul b x => + induction x using TensorProduct.inductionOn with + | add x y hx hy => + simp only [TensorProduct.tmul_add, map_add, hx, hy, add_mul] + | tmul c d => + change b * (z c * h.symm (d * h a)) = b * (z c * h.symm d) * a + rw [map_mul, h.symm_apply_apply] + simp only [mul_assoc] + +def oneCochain (h : R ≃ₐ[k] R) (z : R →ₗ[k] R) : + twistedObject k R h 2 →ₗ[Enveloping k R] moduleObject k R 0 := + twistedToOrdinary k R h (oneCochainLinear k R h z) + (oneCochainLinear_left k R h z) (oneCochainLinear_right k R h z) + +theorem oneCochain_boundary_tmul (h : R ≃ₐ[k] R) (z : R →ₗ[k] R) (a b c d : R) : + oneCochainLinear k R h z (boundary k R 2 (a ⊗ₜ[k] (b ⊗ₜ[k] (c ⊗ₜ[k] d)))) = + a * (b * z c + z (b * c) + z b * h.symm c) * h.symm d := by + simp only [boundary_succ_tmul k R 1, boundary_succ_tmul k R 0, + boundary_zero_tmul k R, left_tmul k R 1, left_tmul k R 0, + TensorProduct.tmul_add, map_add, oneCochainLinear_tmul k R h z, + map_mul, mul_add, add_mul, mul_assoc, add_assoc] + +end ArExplicit.AbsoluteBar + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Modules/TwoActions.lean b/lean/OAI/Algebra/AuslanderReiten/Modules/TwoActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..6036f90c19b3d66b5dad7b3a017d9f3a4de8ee77 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Modules/TwoActions.lean @@ -0,0 +1,88 @@ +import Mathlib.LinearAlgebra.Prod +import Mathlib.Tactic.Module +import Mathlib.Algebra.CharP.Two + +namespace OAI + +namespace ArExplicit + +variable {k V : Type*} [Field k] [AddCommGroup V] [Module k V] + +def twoActionMap (a b : k) : (V × V) →ₗ[k] (V × V) := + (a • LinearMap.fst k V V + LinearMap.snd k V V).prod + (b • LinearMap.fst k V V + LinearMap.snd k V V) + +@[simp] theorem twoActionMap_apply (a b : k) (x y : V) : + twoActionMap a b (x, y) = (a • x + y, b • x + y) := rfl + +private def twoActionInverse (a b : k) (p : V × V) : V × V := + let g := (a - b)⁻¹ • (p.1 - p.2) + (g, p.1 - a • g) + +private theorem twoActionInverse_left (a b : k) (hab : a ≠ b) (p : V × V) : + twoActionInverse a b (twoActionMap a b p) = p := by + rcases p with ⟨x, y⟩ + have hd : a - b ≠ 0 := sub_ne_zero.mpr hab + have hsub : (a • x + y) - (b • x + y) = (a - b) • x := by module + have hx : (a - b)⁻¹ • ((a • x + y) - (b • x + y)) = x := by + rw [hsub, smul_smul, inv_mul_cancel₀ hd, one_smul] + change (_, _) = (x, y) + simp only [twoActionMap_apply, hx] + congr 1 + module + +private theorem twoActionInverse_right (a b : k) (hab : a ≠ b) (p : V × V) : + twoActionMap a b (twoActionInverse a b p) = p := by + rcases p with ⟨u, v⟩ + have hd : a - b ≠ 0 := sub_ne_zero.mpr hab + let g : V := (a - b)⁻¹ • (u - v) + have hg : (a - b) • g = u - v := by + dsimp [g] + rw [smul_smul, mul_inv_cancel₀ hd, one_smul] + change (a • g + (u - a • g), b • g + (u - a • g)) = (u, v) + apply Prod.ext + · module + · calc + b • g + (u - a • g) = u - (a - b) • g := by module + _ = v := by rw [hg]; module + +def twoActionEquiv (a b : k) (hab : a ≠ b) : (V × V) ≃ₗ[k] (V × V) where + toLinearMap := twoActionMap a b + invFun := twoActionInverse a b + left_inv := twoActionInverse_left a b hab + right_inv := twoActionInverse_right a b hab + +theorem twoActionMap_bijective (a b : k) (hab : a ≠ b) : + Function.Bijective (twoActionMap a b : (V × V) → V × V) := + (twoActionEquiv a b hab).bijective + +def degreeZeroMap : (V × V) →ₗ[k] V := + LinearMap.fst k V V + LinearMap.snd k V V + +theorem degreeZeroMap_surjective : + Function.Surjective (degreeZeroMap (k := k) : (V × V) → V) := by + intro v + exact ⟨(v, 0), add_zero v⟩ + +theorem degreeZeroMap_kernel [CharP k 2] (x y : V) : + degreeZeroMap (k := k) (x, y) = 0 ↔ x = y := by + change x + y = 0 ↔ x = y + rw [add_eq_zero_iff_eq_neg] + have hy : -y = y := by + have htwo : (2 : k) = 0 := CharP.cast_eq_zero k 2 + have : y + y = 0 := by rw [← two_smul k y, htwo, zero_smul] + exact neg_eq_iff_add_eq_zero.mpr this + rw [hy] + +theorem twoActionMap_same_not_injective [Nontrivial V] (a : k) : + ¬ Function.Injective (twoActionMap a a : (V × V) → V × V) := by + obtain ⟨x, hx⟩ := exists_ne (0 : V) + intro hinj + have h : twoActionMap a a (x, -(a • x)) = twoActionMap a a (0, 0) := by + simp + have he := congrArg Prod.fst (hinj h) + exact hx he + +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Parameters.lean b/lean/OAI/Algebra/AuslanderReiten/Parameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..c123574b39e0f4ec802543aaa8671532c680902e --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Parameters.lean @@ -0,0 +1,83 @@ +import Mathlib.RingTheory.AlgebraicIndependent.Basic +import Mathlib.RingTheory.Localization.FractionRing +import Mathlib.Data.ZMod.Basic +import Mathlib.Algebra.Field.ZMod +import Mathlib.Algebra.CharP.Algebra +import Mathlib.Algebra.CharP.Two +import Mathlib.Algebra.MvPolynomial.Degrees + +namespace OAI + +namespace ArExplicit + +abbrev ParameterRing := MvPolynomial (Fin 3) (ZMod 2) + +abbrev BaseField := FractionRing ParameterRing + +noncomputable def parameter (i : Fin 3) : BaseField := + algebraMap ParameterRing BaseField (MvPolynomial.X i) + +noncomputable abbrev q : BaseField := parameter 0 +noncomputable abbrev H₁ : BaseField := parameter 1 +noncomputable abbrev H₂ : BaseField := parameter 2 + +theorem parameters_algebraicallyIndependent : + AlgebraicIndependent (ZMod 2) parameter := by + exact (MvPolynomial.algebraicIndependent_X (Fin 3) (ZMod 2)).map' + (f := IsScalarTower.toAlgHom (ZMod 2) ParameterRing BaseField) + (IsFractionRing.injective ParameterRing BaseField) + +theorem parameter_ne_zero (i : Fin 3) : parameter i ≠ 0 := by + exact parameters_algebraicallyIndependent.ne_zero i + +theorem parameter_pow_ne_one (i : Fin 3) (n : ℕ) (hn : 0 < n) : + parameter i ^ n ≠ 1 := by + intro h + have he : (MvPolynomial.X i : ParameterRing) ^ n = 1 := by + apply IsFractionRing.injective ParameterRing BaseField + simpa only [map_pow, map_one, parameter] using h + have hd := congrArg MvPolynomial.totalDegree he + simp only [MvPolynomial.totalDegree_X_pow, MvPolynomial.totalDegree_one] at hd + omega + +theorem parameter_pow_ne (i j : Fin 3) (hij : i ≠ j) (n : ℕ) (hn : 0 < n) : + parameter i ^ n ≠ parameter j ^ n := by + intro h + have he : (MvPolynomial.X i : ParameterRing) ^ n = MvPolynomial.X j ^ n := by + apply IsFractionRing.injective ParameterRing BaseField + simpa only [map_pow, parameter] using h + have hd := congrArg (MvPolynomial.degreeOf i) he + simp only [MvPolynomial.degreeOf_X_self_pow, MvPolynomial.degreeOf_X_pow_of_ne n hij] at hd + omega + +theorem q_pow_add_one_ne_zero (n : ℕ) (hn : 0 < n) : q ^ n + 1 ≠ 0 := by + intro h + apply parameter_pow_ne_one 0 n hn + calc + q ^ n = q ^ n + (1 + 1) := by rw [CharTwo.add_self_eq_zero, add_zero] + _ = 1 := by rw [← add_assoc, h, zero_add] + +theorem twist_eigenvalues_ne (n : ℕ) (hn : 0 < n) : + (H₁ ^ n)⁻¹ ≠ (H₂ ^ n)⁻¹ := by + intro h + have := congrArg (fun x : BaseField => x⁻¹) h + simp only [inv_inv] at this + exact parameter_pow_ne 1 2 (by decide) n hn this + +theorem twist_determinant_ne_zero (n : ℕ) (hn : 0 < n) : + (H₁ ^ n)⁻¹ + (H₂ ^ n)⁻¹ ≠ 0 := by + intro h + apply twist_eigenvalues_ne n hn + calc + (H₁ ^ n)⁻¹ = (H₁ ^ n)⁻¹ + ((H₂ ^ n)⁻¹ + (H₂ ^ n)⁻¹) := by + rw [CharTwo.add_self_eq_zero, add_zero] + _ = (H₂ ^ n)⁻¹ := by rw [← add_assoc, h, zero_add] + +theorem twist_determinant_ne_zero_after_extension + (K : Type*) [Field K] [Algebra BaseField K] (n : ℕ) (hn : 0 < n) : + algebraMap BaseField K ((H₁ ^ n)⁻¹ + (H₂ ^ n)⁻¹) ≠ 0 := by + exact (map_ne_zero (algebraMap BaseField K)).mpr (twist_determinant_ne_zero n hn) + +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/BinaryKoszul.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/BinaryKoszul.lean new file mode 100644 index 0000000000000000000000000000000000000000..8267cdd0a13c5e50bdcb3614552191ab10906fbd --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/BinaryKoszul.lean @@ -0,0 +1,156 @@ +import OAI.Algebra.AuslanderReiten.Duality.LinearHomologyDuality +import Mathlib.Data.Fin.Tuple.Basic +import Mathlib.LinearAlgebra.Prod + +namespace OAI + +namespace ArExplicit.BinaryKoszul + +universe u + +variable (k : Type u) [CommRing k] + +abbrev Piece (n : ℕ) := Fin (n + 1) → k + +omit [CommRing k] in +@[simp] +theorem cons_succ_castSucc {n : ℕ} (a : k) (f : Fin (n + 1) → k) (i : Fin n) : + (Fin.cons a f : Fin (n + 2) → k) i.succ.castSucc = f i.castSucc := by + rw [Fin.castSucc_succ] + rfl + +omit [CommRing k] in +@[simp] +theorem snoc_castSucc_succ {n : ℕ} (f : Fin (n + 1) → k) (a : k) (i : Fin n) : + (Fin.snoc f a : Fin (n + 2) → k) i.castSucc.succ = f i.succ := by + rw [← Fin.castSucc_succ, Fin.snoc_castSucc] + +def mulX (n : ℕ) : Piece k n →ₗ[k] Piece k (n + 1) where + toFun f := Fin.cons 0 f + map_add' f g := by ext i; cases i using Fin.cases <;> simp + map_smul' a f := by ext i; cases i using Fin.cases <;> simp + +def mulY (n : ℕ) : Piece k n →ₗ[k] Piece k (n + 1) where + toFun f := Fin.snoc f 0 + map_add' f g := by ext i; cases i using Fin.lastCases <;> simp + map_smul' a f := by ext i; cases i using Fin.lastCases <;> simp + +@[simp] +theorem mulX_zero (n : ℕ) (f : Piece k n) : mulX k n f 0 = 0 := rfl +@[simp] +theorem mulX_succ (n : ℕ) (f : Piece k n) (i : Fin (n + 1)) : + mulX k n f i.succ = f i := rfl +@[simp] +theorem mulY_last (n : ℕ) (f : Piece k n) : mulY k n f (Fin.last (n + 1)) = 0 := by + simp [mulY] +@[simp] +theorem mulY_castSucc (n : ℕ) (f : Piece k n) (i : Fin (n + 1)) : + mulY k n f i.castSucc = f i := by simp [mulY] + +theorem mulX_injective (n : ℕ) : Function.Injective (mulX k n) := by + intro f g h + ext i + exact congrFun h i.succ + +theorem mulY_injective (n : ℕ) : Function.Injective (mulY k n) := by + intro f g h + ext i + have hi := congrFun h i.castSucc + simpa using hi + +theorem mul_commute (n : ℕ) : (mulX k (n + 1)).comp (mulY k n) = + (mulY k (n + 1)).comp (mulX k n) := by + apply LinearMap.ext + intro f + exact Fin.cons_snoc_eq_snoc_cons 0 f 0 + +def row (n : ℕ) : Piece k n × Piece k n →ₗ[k] Piece k (n + 1) := + (mulX k n).coprod (mulY k n) + +def column (n : ℕ) : Piece k n →ₗ[k] Piece k (n + 1) × Piece k (n + 1) := + (mulY k n).prod (-(mulX k n)) + +@[simp] +theorem row_apply (n : ℕ) (u v : Piece k n) : row k n (u, v) = mulX k n u + mulY k n v := rfl + +@[simp] +theorem column_apply (n : ℕ) (w : Piece k n) : + column k n w = (mulY k n w, -(mulX k n w)) := rfl + +theorem row_column (n : ℕ) : (row k (n + 1)).comp (column k n) = 0 := by + apply LinearMap.ext + intro w + change mulX k (n + 1) (mulY k n w) + mulY k (n + 1) (-(mulX k n w)) = 0 + rw [map_neg, ← LinearMap.comp_apply, mul_commute] + simp + +theorem column_injective (n : ℕ) : Function.Injective (column k n) := by + intro f g h + apply mulY_injective k n + exact congrArg Prod.fst h + +theorem kernel_row (n : ℕ) (u v : Piece k (n + 1)) (h : row k (n + 1) (u, v) = 0) : + ∃ w : Piece k n, column k n w = (u, v) := by + let w : Piece k n := fun i => u i.castSucc + have hu : u (Fin.last (n + 1)) = 0 := by + have H := congrFun h (Fin.last (n + 2)) + simpa [row, mulX, mulY] using H + have hv : v 0 = 0 := by + have H := congrFun h 0 + simpa [row, mulX, mulY] using H + have huv (i : Fin (n + 1)) : u i.castSucc + v i.succ = 0 := by + have H := congrFun h i.castSucc.succ + simpa [row, mulX, mulY] using H + refine ⟨w, Prod.ext ?_ ?_⟩ + · funext i + refine Fin.lastCases ?_ (fun j => ?_) i + · simpa using hu.symm + · simp [w] + · funext i + refine Fin.cases ?_ (fun j => ?_) i + · simpa using hv.symm + · change -w j = v j.succ + exact (eq_neg_of_add_eq_zero_right (huv j)).symm + +theorem range_column_eq_ker_row (n : ℕ) : + LinearMap.range (column k n) = LinearMap.ker (row k (n + 1)) := by + apply le_antisymm + · exact LinearMap.range_le_ker_iff.mpr (row_column k n) + · rintro ⟨u, v⟩ h + exact kernel_row k n u v h + +theorem row_surjective (n : ℕ) : Function.Surjective (row k n) := by + intro f + let u : Piece k n := Pi.single (Fin.last n) (f (Fin.last (n + 1))) + let v : Piece k n := fun i => f i.castSucc + refine ⟨(u, v), ?_⟩ + funext i + refine Fin.lastCases ?_ (fun j => ?_) i + · simp [row, mulX, mulY, u] + · refine Fin.cases ?_ (fun j => ?_) j + · simp [row, mulX, mulY, v] + · simp [row, mulX, mulY, u, v] + +theorem row_zero_injective : Function.Injective (row k 0) := by + rintro ⟨u, v⟩ ⟨u', v'⟩ h + have hv : v 0 = v' 0 := by + have H := congrFun h 0 + simpa [row, mulX, mulY] using H + have hu : u 0 = u' 0 := by + have H := congrFun h (Fin.last 1) + change u 0 + 0 = u' 0 + 0 at H + simpa using H + apply Prod.ext + · funext i + have hi : i = 0 := Fin.eq_zero i + simpa [hi] using hu + · funext i + have hi : i = 0 := Fin.eq_zero i + simpa [hi] using hv + +noncomputable def rowZeroEquiv : (Piece k 0 × Piece k 0) ≃ₗ[k] Piece k 1 := + LinearEquiv.ofBijective (row k 0) ⟨row_zero_injective k, row_surjective k 0⟩ + +end ArExplicit.BinaryKoszul + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/BinaryKoszulDual.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/BinaryKoszulDual.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa4a791dc2dcb5d4660a6f24042968b651059803 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/BinaryKoszulDual.lean @@ -0,0 +1,115 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.BinaryKoszul + +namespace OAI + +namespace ArExplicit.BinaryKoszul + +universe u + +variable (k : Type u) [Field k] + +abbrev DualPiece (n : ℕ) := Module.Dual k (Piece k n) + +def dualRow (n : ℕ) : (DualPiece k (n + 1) × DualPiece k (n + 1)) →ₗ[k] DualPiece k n := + (mulX k n).dualMap.coprod (mulY k n).dualMap + +def dualColumn (n : ℕ) : DualPiece k (n + 1) →ₗ[k] + (DualPiece k n × DualPiece k n) := + (mulY k n).dualMap.prod (-(mulX k n).dualMap) + +@[simp] +theorem dualRow_apply (n : ℕ) (f g : DualPiece k (n + 1)) (x : Piece k n) : + dualRow k n (f, g) x = f (mulX k n x) + g (mulY k n x) := rfl + +@[simp] +theorem dualColumn_apply (n : ℕ) (f : DualPiece k (n + 1)) : + dualColumn k n f = (f.comp (mulY k n), -(f.comp (mulX k n))) := rfl + +theorem exact_dual {U V W : Type u} + [AddCommGroup U] [Module k U] [AddCommGroup V] [Module k V] + [AddCommGroup W] [Module k W] + (f : U →ₗ[k] V) (g : V →ₗ[k] W) (h : LinearMap.range f = LinearMap.ker g) : + LinearMap.range g.dualMap = LinearMap.ker f.dualMap := by + rw [LinearMap.range_dualMap_eq_dualAnnihilator_ker, + LinearMap.ker_dualMap_eq_dualAnnihilator_range, h] + +theorem dualRow_dualColumn (n : ℕ) : (dualRow k n).comp (dualColumn k (n + 1)) = 0 := by + apply LinearMap.ext + intro f + apply LinearMap.ext + intro x + change f (mulY k (n + 1) (mulX k n x)) + -f (mulX k (n + 1) (mulY k n x)) = 0 + have h := DFunLike.congr_fun (mul_commute k n) x + change mulX k (n + 1) (mulY k n x) = mulY k (n + 1) (mulX k n x) at h + rw [h, add_neg_cancel] + +theorem dualRow_surjective (n : ℕ) : Function.Surjective (dualRow k n) := by + intro f + obtain ⟨g, hg⟩ := LinearMap.dualMap_surjective_of_injective (mulX_injective k n) f + refine ⟨(g, 0), ?_⟩ + change (mulX k n).dualMap g + (mulY k n).dualMap 0 = f + simpa using hg + +theorem dualColumn_injective (n : ℕ) : Function.Injective (dualColumn k n) := by + intro f g h + apply LinearMap.ext + intro x + obtain ⟨⟨a, b⟩, rfl⟩ := row_surjective k n x + have hy := congrArg Prod.fst h + have hx := congrArg Prod.snd h + have hya := DFunLike.congr_fun hy b + have hxa := neg_injective (DFunLike.congr_fun hx a) + change f (mulY k n b) = g (mulY k n b) at hya + change f (mulX k n a) = g (mulX k n a) at hxa + simp only [row_apply, map_add, hxa, hya] + +theorem range_dualColumn_eq_ker_dualRow (n : ℕ) : + LinearMap.range (dualColumn k (n + 1)) = LinearMap.ker (dualRow k n) := by + apply le_antisymm + · exact LinearMap.range_le_ker_iff.mpr (dualRow_dualColumn k n) + · rintro ⟨f, g⟩ h + let l : Module.Dual k (Piece k (n + 1) × Piece k (n + 1)) := (-g).coprod f + have hl : l ∈ LinearMap.ker (column k n).dualMap := by + apply LinearMap.ext + intro x + have hx := DFunLike.congr_fun h x + change f (mulX k n x) + g (mulY k n x) = 0 at hx + change -g (mulY k n x) + f (-(mulX k n x)) = 0 + rw [map_neg, ← neg_add, add_comm] + exact neg_eq_zero.mpr hx + rw [← exact_dual k (column k n) (row k (n + 1)) + (range_column_eq_ker_row k n)] at hl + obtain ⟨t, ht⟩ := hl + refine ⟨t, Prod.ext ?_ ?_⟩ + · apply LinearMap.ext + intro x + have hx := DFunLike.congr_fun ht (0, x) + simpa [l, row] using hx + · apply LinearMap.ext + intro x + have hx := DFunLike.congr_fun ht (x, 0) + have hx' := congrArg Neg.neg hx + simpa [l, row] using hx' + +theorem dualColumn_zero_surjective : Function.Surjective (dualColumn k 0) := by + rintro ⟨f, g⟩ + let l : Module.Dual k (Piece k 0 × Piece k 0) := (-g).coprod f + obtain ⟨t, ht⟩ := LinearMap.dualMap_surjective_of_injective (row_zero_injective k) l + refine ⟨t, Prod.ext ?_ ?_⟩ + · apply LinearMap.ext + intro x + have hx := DFunLike.congr_fun ht (0, x) + simpa [l, row] using hx + · apply LinearMap.ext + intro x + have hx := congrArg Neg.neg (DFunLike.congr_fun ht (x, 0)) + simpa [l, row] using hx + +noncomputable def dualColumnZeroEquiv : DualPiece k 1 ≃ₗ[k] + (DualPiece k 0 × DualPiece k 0) := + LinearEquiv.ofBijective (dualColumn k 0) + ⟨dualColumn_injective k 0, dualColumn_zero_surjective k⟩ + +end ArExplicit.BinaryKoszul + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/BinaryKoszulScalar.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/BinaryKoszulScalar.lean new file mode 100644 index 0000000000000000000000000000000000000000..b35e41d5a2c83289dc6baee977675ccac926c110 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/BinaryKoszulScalar.lean @@ -0,0 +1,20 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.BinaryKoszulDual + +namespace OAI + +noncomputable section +namespace ArExplicit.BinaryKoszul +universe u +variable (k : Type u) [Field k] + +def zeroPieceScalarEquiv : Piece k 0 ≃ₗ[k] k := + LinearEquiv.funUnique (Fin 1) k k + +def zeroDualPieceScalarEquiv : DualPiece k 0 ≃ₗ[k] k := + (zeroPieceScalarEquiv k).symm.dualMap.trans (LinearMap.ringLmapEquivSelf k k k) + +end ArExplicit.BinaryKoszul + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/CProjectiveResolution.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/CProjectiveResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..a6ccc96be8a2869a733c9c4f4a6705123dac6175 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/CProjectiveResolution.lean @@ -0,0 +1,142 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.Resolution +import OAI.Algebra.AuslanderReiten.Parameters +import Mathlib.Algebra.Category.ModuleCat.Projective +import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +import Mathlib.CategoryTheory.Abelian.Projective.Resolution + +namespace OAI + +noncomputable section + +open CategoryTheory + +namespace ArExplicit.Resolution + +variable {k : Type*} [Field k] [CharP k 2] (q : k) + +local notation "C" => BaseAlgebra k q + +abbrev Simple := (F q) ⧸ LinearMap.range (dU q) + +def objects : ℕ → ModuleCat C + | 0 => ModuleCat.of C (F q) + | _ + 1 => ModuleCat.of C (E q) + +def differential : (n : ℕ) → objects q (n + 1) ⟶ objects q n + | 0 => ModuleCat.ofHom (dU q) + | n + 1 => ModuleCat.ofHom (dEll q (q ^ n)) + +theorem differential_comp (n : ℕ) : differential q (n + 1) ≫ differential q n = 0 := by + cases n with + | zero => + apply ModuleCat.hom_ext + change (dU q).comp (dEll q (q ^ 0)) = 0 + simpa only [pow_zero] using dU_comp_dEll_one q + | succ n => + apply ModuleCat.hom_ext + change (dEll q (q ^ n)).comp (dEll q (q ^ (n + 1))) = 0 + simpa only [pow_succ'] using dEll_comp_successor q (q ^ n) + +def complex : ChainComplex (ModuleCat C) ℕ := + ChainComplex.of (objects q) (differential q) (differential_comp q) + +instance complex_projective (n : ℕ) : CategoryTheory.Projective ((complex q).X n) := by + cases n <;> dsimp [complex, objects] <;> infer_instance + +instance complex_scalar (n : ℕ) : Module k ((complex q).X n) := by + cases n with + | zero => exact (inferInstance : Module k (F q)) + | succ n => exact (inferInstance : Module k (E q)) + +instance complex_finite (n : ℕ) : Module.Finite k ((complex q).X n) := by + cases n with + | zero => exact (inferInstance : Module.Finite k (F q)) + | succ n => exact (inferInstance : Module.Finite k (E q)) + +def NoPositivePowerOne : Prop := ∀ m : ℕ, 0 < m → 1 + q ^ m ≠ 0 + +omit [CharP k 2] in +theorem denominator_power_ne (h : NoPositivePowerOne q) (n : ℕ) : + 1 + q ^ 2 * q ^ n ≠ 0 := by + rw [← pow_add] + exact h (2 + n) (by omega) + +theorem differential_exact (h : NoPositivePowerOne q) (n : ℕ) : + Function.Exact (differential q (n + 1)) (differential q n) := by + cases n with + | zero => + change Function.Exact (dEll q (q ^ 0)) (dU q) + simpa only [pow_zero] using exact_dU q (by simpa using h 1 (by decide)) (h 2 (by decide)) + | succ n => + change Function.Exact (dEll q (q ^ (n + 1))) (dEll q (q ^ n)) + simpa only [pow_succ'] using exact_dEll q (q ^ n) + (denominator_power_ne q h n) + (by simpa [pow_succ'] using denominator_power_ne q h (n + 1)) + +theorem complex_exactAt_succ (h : NoPositivePowerOne q) (n : ℕ) : + (complex q).ExactAt (n + 1) := by + rw [HomologicalComplex.exactAt_iff' _ (n + 1 + 1) (n + 1) n (by simp) (by simp)] + apply (ShortComplex.ShortExact.moduleCat_exact_iff_function_exact _).mpr + simpa [complex, HomologicalComplex.sc', HomologicalComplex.shortComplexFunctor', + ChainComplex.of_d] using! differential_exact q h n + +def augmentation : (complex q).X 0 ⟶ ModuleCat.of C (Simple q) := + ModuleCat.ofHom (LinearMap.range (dU q)).mkQ + +instance augmentation_epi : Epi (augmentation q) := + (ModuleCat.epi_iff_surjective _).mpr (Submodule.mkQ_surjective _) + +theorem differential_augmentation : (complex q).d 1 0 ≫ augmentation q = 0 := by + apply ModuleCat.hom_ext + change (LinearMap.range (dU q)).mkQ.comp (dU q) = 0 + exact LinearMap.range_mkQ_comp (dU q) + +def toSimple : complex q ⟶ (ChainComplex.single₀ (ModuleCat C)).obj (ModuleCat.of C (Simple q)) := + (ChainComplex.toSingle₀Equiv _ _).symm ⟨augmentation q, differential_augmentation q⟩ + +@[simp] theorem toSimple_zero : (toSimple q).f 0 = augmentation q := + ChainComplex.toSingle₀Equiv_symm_apply_f_zero _ _ + +theorem augmentation_exact : + (ShortComplex.mk ((complex q).d 1 0) (augmentation q) (differential_augmentation q)).Exact := by + apply (ShortComplex.ShortExact.moduleCat_exact_iff_function_exact _).mpr + change Function.Exact (dU q) (LinearMap.range (dU q)).mkQ + exact LinearMap.exact_map_mkQ_range (dU q) + +theorem toSimple_quasiIso (h : NoPositivePowerOne q) : QuasiIso (toSimple q) := by + constructor + intro n + cases n with + | zero => + rw [ChainComplex.quasiIsoAt₀_iff, ShortComplex.quasiIso_iff_of_zeros'] + · change (ShortComplex.mk ((complex q).d 1 0) ((toSimple q).f 0) _).Exact ∧ + Epi ((toSimple q).f 0) + simpa only [toSimple_zero, ChainComplex.single₀_obj_zero] using And.intro (augmentation_exact q) (augmentation_epi q) + · rfl + · rfl + · rfl + | succ n => + rw [quasiIsoAt_iff_exactAt'] + · exact complex_exactAt_succ q h n + · exact ChainComplex.exactAt_succ_single_obj _ _ + +def projectiveResolution (h : NoPositivePowerOne q) : + CategoryTheory.ProjectiveResolution (ModuleCat.of C (Simple q)) where + complex := complex q + π := toSimple q + quasiIso := toSimple_quasiIso q h + +theorem baseField_noPositivePowerOne : NoPositivePowerOne ArExplicit.q := by + intro m hm + simpa [add_comm] using ArExplicit.q_pow_add_one_ne_zero m hm + +def baseFieldProjectiveResolution : + CategoryTheory.ProjectiveResolution + (ModuleCat.of (BaseAlgebra BaseField ArExplicit.q) (Simple ArExplicit.q)) := + projectiveResolution ArExplicit.q baseField_noPositivePowerOne + +end ArExplicit.Resolution + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulColumn.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulColumn.lean new file mode 100644 index 0000000000000000000000000000000000000000..a61cf30a532b93ba0ebfff636e39bbfe00864d22 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulColumn.lean @@ -0,0 +1,70 @@ +import OAI.Algebra.AuslanderReiten.Coordinates.ConcreteCubicAction +import OAI.Algebra.AuslanderReiten.Evaluation.EvaluatedCoverStep +import OAI.Algebra.AuslanderReiten.Evaluation.EvaluatedAdjacentComponents +import OAI.Algebra.AuslanderReiten.Coordinates.ShiftedBoundaryComponents +import OAI.Algebra.AuslanderReiten.Homology.TriangleConnectingProduct +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProductReindex +import OAI.Algebra.AuslanderReiten.Coordinates.ConcreteCubicStepAction + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open CochainComplex CochainComplex.HomComplex CompleteComparison +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +local notation "R₀" => A k q +local notation "τ₀" => AFrobeniusTrace k q +local notation "Q₀" => HomotopyCategory.quotient (ModuleCat R₀) (ComplexShape.up ℤ) +local notation "H₀" => fun d => CohomologyClass (A.simpleComplete q) (A.simpleComplete q) d + +private theorem columnNeg {M : Type u} [AddCommGroup M] [Module k M] (x : M) : -x=x := by + apply neg_eq_iff_add_eq_zero.mpr + rw [← two_smul k, show (2:k)=0 from CharP.cast_eq_zero k 2, zero_smul] + +theorem simpleTopColumn_fst (a : ℤ) + (v : evaluatedSimpleObject q ⟶ (evaluatedBaseResolution q 4)⟦a⟧) : + (evaluatedSingletonFullHomEquiv q 0 (a+1) + (TriangleGradedSequence.second k (simpleSkeletonTriangle q 0) (evaluatedSimpleObject q) + (a+1) (TriangleGradedSequence.connecting k (simpleTopTriangle q 0) + (evaluatedSimpleObject q) a v))).1 = + TateKoszul.degreeEquiv (k := k) H₀ (by omega : a-4+3=(a+1)-2) + (fullHomProduct (evaluatedBaseFullHomEquiv q 4 a v) (secondCoverClass q)) := by + erw [evaluatedSingletonFullHomEquiv_fst, TriangleGradedSequence.second_eq_shift, + TriangleGradedSequence.connecting_eq_product, Category.assoc, ← Functor.map_comp, + ← shiftedComp_post, simpleTopConnecting_fst, shiftedComp_post, + evaluatedSecondCokernel_step_action] + +theorem simpleTopColumn_snd_unsigned (a : ℤ) + (v : evaluatedSimpleObject q ⟶ (evaluatedBaseResolution q 4)⟦a⟧) : + (evaluatedSingletonFullHomEquiv q 0 (a+1) + (TriangleGradedSequence.second k (simpleSkeletonTriangle q 0) (evaluatedSimpleObject q) + (a+1) (TriangleGradedSequence.connecting k (simpleTopTriangle q 0) + (evaluatedSimpleObject q) a v))).2 = + TateKoszul.degreeEquiv (k := k) H₀ (by omega : a-4+3=(a+1)-2) + (fullHomProduct (evaluatedBaseFullHomEquiv q 4 a v) (firstCoverClass q)) := by + erw [evaluatedSingletonFullHomEquiv_snd, TriangleGradedSequence.second_eq_shift, + TriangleGradedSequence.connecting_eq_product, Category.assoc, ← Functor.map_comp, + ← shiftedComp_post, simpleTopConnecting_snd, shiftedComp_post, + evaluatedFirstCokernel_step_action] + +theorem simpleTopColumn_snd (a : ℤ) + (v : evaluatedSimpleObject q ⟶ (evaluatedBaseResolution q 4)⟦a⟧) : + (evaluatedSingletonFullHomEquiv q 0 (a+1) + (TriangleGradedSequence.second k (simpleSkeletonTriangle q 0) (evaluatedSimpleObject q) + (a+1) (TriangleGradedSequence.connecting k (simpleTopTriangle q 0) + (evaluatedSimpleObject q) a v))).2 = + TateKoszul.degreeEquiv (k := k) H₀ (by omega : a-4+3=(a+1)-2) + (-(fullHomProduct (evaluatedBaseFullHomEquiv q 4 a v) (firstCoverClass q))) := by + have h := simpleTopColumn_snd_unsigned q a v + exact h.trans (congrArg + (TateKoszul.degreeEquiv (k := k) H₀ (by omega : a-4+3=(a+1)-2)) + (columnNeg (k := k) _).symm) + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulCoordinateLaws.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulCoordinateLaws.lean new file mode 100644 index 0000000000000000000000000000000000000000..e011bae45b0c8ea457ced32223cc3708fefb469f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulCoordinateLaws.lean @@ -0,0 +1,44 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.ConcreteKoszulRow +import OAI.Algebra.AuslanderReiten.Resolutions.ConcreteKoszulColumn +import OAI.Algebra.AuslanderReiten.Cones.ConcreteTwoConeCoordinates + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open CochainComplex CochainComplex.HomComplex CompleteComparison +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +local notation "H₀" => fun d => CohomologyClass (A.simpleComplete q) (A.simpleComplete q) d + +abbrev firstCoverOperator (a : ℤ) := + fullHomRightMultiply (k := k) (K := A.simpleComplete q) (n := a) (firstCoverClass q) +abbrev secondCoverOperator (a : ℤ) := + fullHomRightMultiply (k := k) (K := A.simpleComplete q) (n := a) (secondCoverClass q) + +theorem concreteRowCoordinate (a : ℤ) (v : twoConeMiddleHom q a) : + twoConeBottomCoordinate q (a+1) ((concreteTwoConeFiltration q).row a v) = + TateKoszul.degreeEquiv (k := k) H₀ (by omega : a-2+3=a+1) + (TateKoszul.row (x := firstCoverOperator q) (y := secondCoverOperator q) + (a-2) (twoConeMiddleCoordinate q a v)) := by + have h := congrArg (TateKoszul.degreeEquiv (k := k) H₀ + (by omega : (a+1)-((0:ℕ):ℤ)=a+1)) (simpleSkeletonRow_fullHom q a v) + exact h.trans (degreeEquiv_trans_apply _ _ _) + +theorem concreteColumnCoordinate (a : ℤ) (v : twoConeTopHom q a) : + twoConeMiddleCoordinate q (a+1) ((concreteTwoConeFiltration q).column a v) = + ((TateKoszul.degreeEquiv (k := k) H₀ (by omega : a-4+3=a+1-2)).prodCongr + (TateKoszul.degreeEquiv (k := k) H₀ (by omega : a-4+3=a+1-2))) + (TateKoszul.column (x := firstCoverOperator q) (y := secondCoverOperator q) + (a-4) (twoConeTopCoordinate q a v)) := by + apply Prod.ext + · exact simpleTopColumn_fst q a v + · exact simpleTopColumn_snd q a v + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulCoordinates.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..2efb32063c0af784f328025e250c88dc52246308 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulCoordinates.lean @@ -0,0 +1,38 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.ConcreteKoszulCoordinateLaws + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open CochainComplex CochainComplex.HomComplex CompleteComparison +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +local notation "H₀" => fun d => CohomologyClass (A.simpleComplete q) (A.simpleComplete q) d + +theorem concreteTwoConeFiltration_row (a : ℤ) (v : twoConeMiddleHom q a) : + (concreteTwoConeFiltration q).row a v = + TriangleGradedSequence.connecting k (simpleSkeletonTriangle q 0) + (evaluatedSimpleObject q) a v := rfl + +theorem concreteTwoConeFiltration_column (a : ℤ) (v : twoConeTopHom q a) : + (concreteTwoConeFiltration q).column a v = + TriangleGradedSequence.second k (simpleSkeletonTriangle q 0) (evaluatedSimpleObject q) + (a+1) (TriangleGradedSequence.connecting k (simpleTopTriangle q 0) + (evaluatedSimpleObject q) a v) := rfl + +def concreteKoszulCoordinates : TwoConeKoszulCoordinates (concreteTwoConeFiltration q) + (fun a => fullHomRightMultiply (k := k) (K := A.simpleComplete q) (n := a) (firstCoverClass q)) + (fun a => fullHomRightMultiply (k := k) (K := A.simpleComplete q) (n := a) (secondCoverClass q)) where + bottom := twoConeBottomCoordinate q + middle := twoConeMiddleCoordinate q + top := twoConeTopCoordinate q + row_eq := concreteRowCoordinate q + column_eq := concreteColumnCoordinate q + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulRow.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulRow.lean new file mode 100644 index 0000000000000000000000000000000000000000..8239d06c8041ab9fab36c9f13a0030c6975f5c1c --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteKoszulRow.lean @@ -0,0 +1,59 @@ +import OAI.Algebra.AuslanderReiten.Coordinates.ConcreteCubicAction +import OAI.Algebra.AuslanderReiten.Evaluation.EvaluatedCoverStep +import OAI.Algebra.AuslanderReiten.Evaluation.EvaluatedConnectingCoordinates +import OAI.Algebra.AuslanderReiten.Coordinates.ShiftedBoundaryComponents +import OAI.Algebra.AuslanderReiten.Homology.TriangleConnectingProduct +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProductReindex +import OAI.Algebra.AuslanderReiten.Coordinates.ConcreteCubicStepAction +import OAI.Algebra.AuslanderReiten.Coordinates.GradedRowCoordinates + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open CochainComplex CochainComplex.HomComplex CompleteComparison +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +local notation "R₀" => A k q +local notation "τ₀" => AFrobeniusTrace k q +local notation "Q₀" => HomotopyCategory.quotient (ModuleCat R₀) (ComplexShape.up ℤ) +local notation "H₀" => fun d => CohomologyClass (A.simpleComplete q) (A.simpleComplete q) d +local notation "D₀" => bimoduleTwoConeData q +local notation "hf₀" => bimodule_term_finite_k q +local notation "X₀" => A.simpleFiniteModule q + +theorem simpleSkeletonRow_fullHom (a : ℤ) + (v : evaluatedSimpleObject q ⟶ (evaluatedSingletonResolution q 0)⟦a⟧) : + evaluatedBaseFullHomEquiv q 0 (a+1) + (TriangleGradedSequence.connecting k (simpleSkeletonTriangle q 0) + (evaluatedSimpleObject q) a v) = + TateKoszul.degreeEquiv (k := k) H₀ (by omega : a-2+3=(a+1)-((0:ℕ):ℤ)) + (fullHomProduct (evaluatedSingletonFullHomEquiv q 0 a v).1 (firstCoverClass q) + + fullHomProduct (evaluatedSingletonFullHomEquiv q 0 a v).2 (secondCoverClass q)) := by + have hr := connectingRow (k := k) (simpleSkeletonTriangle q 0) + (evaluatedSimpleObject q) (evaluatedBaseResolution q 2) (evaluatedBaseResolution q 3) + a v + ((Q₀).map (FiniteLeftModule.resolutionMap τ₀ (evaluatedSingletonFst q 0))) + ((Q₀).map (FiniteLeftModule.resolutionMap τ₀ (evaluatedSingletonSnd q 0))) + (evaluatedBaseStepIso q 2).hom + (TwoCone.evaluatedFirstCokernel D₀ hf₀ X₀ τ₀ 0) + (TwoCone.evaluatedSecondCokernel D₀ hf₀ X₀ τ₀ 0) + (simpleSkeletonConnecting_components q 0) + have h₁ := evaluatedFirstCokernel_step_action q 0 a + (v ≫ ((Q₀).map (FiniteLeftModule.resolutionMap τ₀ (evaluatedSingletonFst q 0)))⟦a⟧') + have h₂ := evaluatedSecondCokernel_step_action q 0 a + (v ≫ ((Q₀).map (FiniteLeftModule.resolutionMap τ₀ (evaluatedSingletonSnd q 0)))⟦a⟧') + exact additiveRowCoordinates (evaluatedBaseFullHomEquiv q 0 (a+1)).toAddMonoidHom + (TateKoszul.degreeEquiv (k := k) H₀ (by omega : a-2+3=(a+1)-((0:ℕ):ℤ))).toAddMonoidHom + (fun z => fullHomProduct z (firstCoverClass q)) + (fun z => fullHomProduct z (secondCoverClass q)) hr h₁ h₂ + (evaluatedSingletonFullHomEquiv_fst q 0 a v) + (evaluatedSingletonFullHomEquiv_snd q 0 a v) + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteNativeResolution.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteNativeResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ba16e44d2a479408852b06cd71a5dc4879f8bdb --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ConcreteNativeResolution.lean @@ -0,0 +1,65 @@ +import OAI.Algebra.AuslanderReiten.Evaluation.ConcreteNativeAugmentation +import OAI.Algebra.AuslanderReiten.Ext.ExternalNativeRegularAugmentation + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open scoped TensorProduct +private theorem augmentation_compose {C : Type*} [Category C] + {P Q R S U V W : C} (a : P ⟶ Q) (b : Q ⟶ R) (p : R ⟶ S) + (f : Q ⟶ U) (g : U ⟶ S) (u : P ⟶ V) (v : V ⟶ U) + (z : P ⟶ W) (w : W ⟶ S) + (hb : b ≫ p = f ≫ g) (ha : a ≫ f = u ≫ v) (hc : u ≫ (v ≫ g) = z ≫ w) : + (a ≫ b) ≫ p = z ≫ w := by + rw [Category.assoc, hb, ← Category.assoc, ha, Category.assoc, hc] + +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +local notation "T₀" => T k q +local notation "A₀" => A k q +local notation "S" => Resolution.Simple q +local notation "X" => A.simpleFiniteModule q +local instance concreteNativeResolutionBaseModule : Module k (canonicalTensorSimple q) := + moduleCatBaseModule (k := k) (R := A₀) (canonicalTensorSimple q) +local instance concreteNativeResolutionBaseTower : IsScalarTower k A₀ (canonicalTensorSimple q) := + moduleCatBaseTower (k := k) (R := A₀) (canonicalTensorSimple q) + +def simpleNativeTensorResolution : ProjectiveResolution (canonicalTensorSimple q) := + ExternalTensor.projectiveResolution k T₀ T₀ (ModuleBar.nativeResolution k T₀ S) + (ModuleBar.nativeResolution k T₀ S) + +theorem simpleNativeBarIso_augmentation : + (simpleNativeBarIso q).hom.f 0 ≫ (simpleNativeTensorResolution q).π.f 0 = + (simpleOrdinaryResolution q).π.f 0 ≫ + (evaluatedBaseZeroEquiv q).toModuleIso.hom ≫ (nativeToCanonicalSimple q).hom := by + have hbar := ExternalBalanced.nativeTotalBarIso_regularAugmentation k T₀ T₀ S S + have hcoef := (EnvelopingBimodule.evaluationCoefficientIso k A₀ + (nativeToCanonicalSimple q)).hom.naturality (bimoduleAugmentation q) + rw [simpleNativeBarIso_hom_f] + erw [simpleOrdinaryBarIso_f, Category.id_comp] + exact augmentation_compose + ((simpleCoefficientComplexIso q).hom.f 0) + ((ExternalBalanced.nativeTotalBarIso k T₀ T₀ S S).hom.f 0) + ((simpleNativeTensorResolution q).π.f 0) + ((EnvelopingBimodule.evaluationFunctor k A₀ (canonicalTensorSimple q)).map (bimoduleAugmentation q)) + (BarBalanced.nativeEndpointIso k A₀ (canonicalTensorSimple q)).hom + ((EnvelopingBimodule.evaluationFunctor k A₀ (X).carrier).map (bimoduleAugmentation q)) + ((EnvelopingBimodule.evaluationCoefficientIso k A₀ (nativeToCanonicalSimple q)).hom.app + (AbsoluteBar.moduleObject k A₀ 0)) + ((simpleOrdinaryResolution q).π.f 0) + ((evaluatedBaseZeroEquiv q).toModuleIso.hom ≫ (nativeToCanonicalSimple q).hom) + hbar hcoef.symm (simpleBaseAugmentation q) + +def simpleNativeResolutionHom : ProjectiveResolution.Hom (simpleOrdinaryResolution q) + (simpleNativeTensorResolution q) + ((evaluatedBaseZeroEquiv q).toModuleIso.hom ≫ (nativeToCanonicalSimple q).hom) where + hom := (simpleNativeBarIso q).hom + hom_f_zero_comp_π_f_zero := simpleNativeBarIso_augmentation q + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/CoverFullHomAction.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/CoverFullHomAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b73eeac928283d7f327084fa3eaf855eec3e9af --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/CoverFullHomAction.lean @@ -0,0 +1,58 @@ +import OAI.Algebra.AuslanderReiten.Coordinates.CubicShiftNaturality +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomShiftedProducts +import OAI.Algebra.AuslanderReiten.Complete.TateKoszul + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory +open CochainComplex CochainComplex.HomComplex CompleteComparison +universe u w +variable (k : Type u) [Field k] +variable {C : Type w} [Category.{u} C] [Preadditive C] [Linear k C] + +private theorem fullHom_composition_degree {K L M : CochainComplex C ℤ} + {a b d : ℤ} (h : a+b=d) (x : CohomologyClass K L a) (y : CohomologyClass L M b) : + (fullHomShiftedHomotopyEquiv k K M d).symm + (ShiftedHom.comp (fullHomShiftedHomotopyEquiv k K L a x) + (fullHomShiftedHomotopyEquiv k L M b y) (by omega : b+a=d)) = + TateKoszul.degreeEquiv (k := k) (fun n => CohomologyClass K M n) h (fullHomProduct x y) := by + subst d + apply (fullHomShiftedHomotopyEquiv k K M (a+b)).injective + simp only [LinearEquiv.apply_symm_apply] + exact (fullHomShiftedHomotopyEquiv_product k x y).symm + +variable (K : CochainComplex C ℤ) +variable (Y : ℕ → HomotopyCategory C (ComplexShape.up ℤ)) (s : ∀ n, Y n ≅ (Y (n+1))⟦(1 : ℤ)⟧) +variable (u : ((HomotopyCategory.quotient C (ComplexShape.up ℤ)).obj K) ≅ Y 0) (c : ∀ n, Y (n+3) ⟶ Y n) + +def coverFullHomEquiv (n : ℕ) (a : ℤ) : + (((HomotopyCategory.quotient C (ComplexShape.up ℤ)).obj K) ⟶ (Y n)⟦a⟧) ≃ₗ[k] CohomologyClass K K (a-(n : ℤ)) := + (shiftedNegativeHomEquiv (n : ℤ) (basedIteration Y s u n) k ((HomotopyCategory.quotient C (ComplexShape.up ℤ)).obj K) a).trans + (fullHomShiftedHomotopyEquiv k K K (a-(n : ℤ))).symm + +theorem coverFullHom_action + (hs : ∀ n, c n ≫ (s n).hom = (s (n+3)).hom ≫ (c (n+1))⟦(1 : ℤ)⟧') + (p : CohomologyClass K K 3) + (hp : fullHomShiftedHomotopyEquiv k K K 3 p = coverCubic Y s u c) + (n : ℕ) (a : ℤ) (v : ((HomotopyCategory.quotient C (ComplexShape.up ℤ)).obj K) ⟶ (Y (n+3))⟦a⟧) : + coverFullHomEquiv k K Y s u n a (v ≫ (c n)⟦a⟧') = + TateKoszul.degreeEquiv (k := k) (fun i => CohomologyClass K K i) + (by omega : (a-((n+3 : ℕ) : ℤ))+3=a-(n : ℤ)) + (fullHomProduct (coverFullHomEquiv k K Y s u (n+3) a v) p) := by + unfold coverFullHomEquiv + simp only [LinearEquiv.trans_apply, shiftedNegativeHomEquiv_comp] + rw [coverCubic_action Y s u c hs n a v, ← hp] + simpa only [LinearEquiv.apply_symm_apply] using + (fullHom_composition_degree k (K := K) (L := K) (M := K) + (a := a-((n+3 : ℕ) : ℤ)) (b := 3) (d := a-(n : ℤ)) (by omega) + ((fullHomShiftedHomotopyEquiv k K K (a-((n+3 : ℕ) : ℤ))).symm + (ShiftedHom.comp v + (negativeShiftIso ((n+3 : ℕ) : ℤ) (basedIteration Y s u (n+3))).hom (by omega))) p) + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/CoverStepCoordinates.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/CoverStepCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..34ff6a8dacb4abf472206713a19916995a83e2cb --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/CoverStepCoordinates.lean @@ -0,0 +1,45 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.CoverFullHomAction + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory +universe u v w +section Category +variable {C : Type u} [Category.{v} C] [HasShift C ℤ] +variable {X Y Z S : C} (n : ℤ) (e : X ≅ Y⟦n⟧) +variable (s : Y ≅ Z⟦(1 : ℤ)⟧) (t : X ≅ Z⟦n+1⟧) +variable (ht : t.hom = ShiftedHom.comp e.hom s.hom (add_comm 1 n)) + +include ht in +theorem negativeShiftIso_step : + ShiftedHom.comp s.hom (negativeShiftIso (n+1) t).hom + (by omega : -(n+1)+1 = -n) = (negativeShiftIso n e).hom := by + apply (CategoryTheory.shiftFunctor C n).map_injective + apply (cancel_epi e.hom).mp + apply (cancel_mono ((shiftFunctorAdd' C (-n) n 0 (by omega)).inv.app X)).mp + simp only [Category.assoc] + change ShiftedHom.comp e.hom + (ShiftedHom.comp s.hom (negativeShiftIso (n+1) t).hom (by omega : -(n+1)+1 = -n)) + (by omega : -n+n=0) = + ShiftedHom.comp e.hom (negativeShiftIso n e).hom (by omega : -n+n=0) + rw [← ShiftedHom.comp_assoc e.hom s.hom (negativeShiftIso (n+1) t).hom + (add_comm 1 n) (by omega : -(n+1)+1 = -n) (by omega), ← ht, + hom_comp_negativeShiftIso, hom_comp_negativeShiftIso] + +include ht in +theorem shiftedNegative_step (a : ℤ) (v : S ⟶ Y⟦a⟧) : + ShiftedHom.comp (ShiftedHom.comp v s.hom (add_comm 1 a)) + (negativeShiftIso (n+1) t).hom (by omega : -(n+1)+(a+1)=a-n) = + ShiftedHom.comp v (negativeShiftIso n e).hom (by omega : -n+a=a-n) := by + rw [ShiftedHom.comp_assoc v s.hom (negativeShiftIso (n+1) t).hom + (add_comm 1 a) (by omega : -(n+1)+1 = -n) (by omega), + negativeShiftIso_step n e s t ht] + +end Category +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/CoverStepFullHom.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/CoverStepFullHom.lean new file mode 100644 index 0000000000000000000000000000000000000000..3148ac03b1712f968ccb59436b8b580eadd41b6f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/CoverStepFullHom.lean @@ -0,0 +1,58 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.CoverStepCoordinates + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory +open CochainComplex CochainComplex.HomComplex CompleteComparison +universe u w +variable (k : Type u) [Field k] +variable {C : Type w} [Category.{u} C] [Preadditive C] [Linear k C] +variable {K : CochainComplex C ℤ} +local notation "HC" => HomotopyCategory C (ComplexShape.up ℤ) +private abbrev sourceObject (K : CochainComplex C ℤ) := + (HomotopyCategory.quotient C (ComplexShape.up ℤ)).obj K +local notation "X₀" => sourceObject K + +private theorem fullHom_coordinates_degree {a b i j : ℤ} (h : a=b) + {Y : HC} (x : X₀ ⟶ Y⟦i⟧) (y : Y ⟶ X₀⟦j⟧) + (ha : j+i=a) (hb : j+i=b) : + (fullHomShiftedHomotopyEquiv k K K b).symm (ShiftedHom.comp x y hb) = + TateKoszul.degreeEquiv (k := k) (fun d => CohomologyClass K K d) h + ((fullHomShiftedHomotopyEquiv k K K a).symm (ShiftedHom.comp x y ha)) := by + subst b + rfl + +private theorem shiftedNegative_step_at (Y Z : HC) (n : ℤ) + (e : X₀ ≅ Y⟦n⟧) (s : Y ≅ Z⟦(1 : ℤ)⟧) (t : X₀ ≅ Z⟦n+1⟧) + (ht : t.hom = ShiftedHom.comp e.hom s.hom (add_comm 1 n)) + (a d : ℤ) (hd : d=a-n) (v : X₀ ⟶ Y⟦a⟧) : + ShiftedHom.comp (ShiftedHom.comp v s.hom (add_comm 1 a)) + (negativeShiftIso (n+1) t).hom (by omega : -(n+1)+(a+1)=d) = + ShiftedHom.comp v (negativeShiftIso n e).hom (by omega : -n+a=d) := by + subst d + exact shiftedNegative_step n e s t ht a v + +theorem coverStepFullHom (Y Z : HC) (n m : ℤ) (hm : m=n+1) + (e : X₀ ≅ Y⟦n⟧) (s : Y ≅ Z⟦(1 : ℤ)⟧) (t : X₀ ≅ Z⟦m⟧) + (ht : t.hom = ShiftedHom.comp e.hom s.hom (by omega : 1+n=m)) + (a : ℤ) (v : X₀ ⟶ Y⟦a⟧) : + (fullHomShiftedHomotopyEquiv k K K (a+1-m)).symm + (shiftedNegativeHomEquiv m t k X₀ (a+1) + (ShiftedHom.comp v s.hom (add_comm 1 a))) = + TateKoszul.degreeEquiv (k := k) (fun d => CohomologyClass K K d) + (by omega : a-n=a+1-m) + ((fullHomShiftedHomotopyEquiv k K K (a-n)).symm + (shiftedNegativeHomEquiv n e k X₀ a v)) := by + subst m + simp only [shiftedNegativeHomEquiv_comp] + have hh := shiftedNegative_step_at Y Z n e s t ht a (a+1-(n+1)) (by omega) v + rw [hh] + exact fullHom_coordinates_degree k (by omega) v (negativeShiftIso n e).hom _ _ + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/CubicCoverSquares.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/CubicCoverSquares.lean new file mode 100644 index 0000000000000000000000000000000000000000..c1d3417102eb7ab739e78aa1dfdd7c28f10edf5b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/CubicCoverSquares.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.Cones.TwoConeExtensionDiagrams + +namespace OAI + +noncomputable section +namespace ArExplicit.TwoCone +universe u +variable {R : Type u} [Ring R] (D : Data R) +variable (hex : ∀ n, Function.Exact (D.d (n+1)) (D.d n)) + +theorem firstCokernelMap_cover (n : ℕ) : + (D.first n).comp (baseStepInclusion D hex (n+3)) = + (baseStepInclusion D hex n).comp (firstCokernelMap D (n+1)) := by + apply LinearMap.ext + intro z + obtain ⟨z,rfl⟩ := (LinearMap.range (D.d (n+4))).mkQ_surjective z + exact (DFunLike.congr_fun (D.first_comm n) z).symm + +theorem secondCokernelMap_cover (n : ℕ) : + (D.second n).comp (baseStepInclusion D hex (n+3)) = + (baseStepInclusion D hex n).comp (secondCokernelMap D (n+1)) := by + apply LinearMap.ext + intro z + obtain ⟨z,rfl⟩ := (LinearMap.range (D.d (n+4))).mkQ_surjective z + exact (DFunLike.congr_fun (D.second_comm n) z).symm + +theorem firstCokernelMap_quotient (n : ℕ) : + ((LinearMap.range (D.d n)).mkQ).comp (D.first n) = + (firstCokernelMap D n).comp (LinearMap.range (D.d (n+3))).mkQ := rfl + +theorem secondCokernelMap_quotient (n : ℕ) : + ((LinearMap.range (D.d n)).mkQ).comp (D.second n) = + (secondCokernelMap D n).comp (LinearMap.range (D.d (n+3))).mkQ := rfl + +end ArExplicit.TwoCone + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/EvaluatedOrdinaryResolution.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/EvaluatedOrdinaryResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..7db1b909489790a009dd4ab6297b5ca7d22e78a8 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/EvaluatedOrdinaryResolution.lean @@ -0,0 +1,125 @@ +import OAI.Algebra.AuslanderReiten.Evaluation.EvaluatedBaseQuotient +import Mathlib.Algebra.Homology.Single + +namespace OAI + +noncomputable section +namespace ArExplicit.TwoCone +open CategoryTheory CategoryTheory.Limits +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable (D : Data (R ⊗[k] Rᵐᵒᵖ)) (hf : ∀ n, Module.Finite k (D.term n)) +variable (X : FiniteLeftModule k R) + +private theorem evaluation_zero {M N : FiniteLeftModule k (R ⊗[k] Rᵐᵒᵖ)} : + FiniteLeftModule.evaluationMap X (0 : M.carrier →ₗ[_] N.carrier) = 0 := + EnvelopingBimodule.tensorMap_zero X.carrier + +theorem evaluatedBaseDifferential_square (n : ℕ) : + (evaluatedBaseDifferential D hf X n).comp (evaluatedBaseDifferential D hf X (n+1)) = 0 := by + dsimp only [evaluatedBaseDifferential] + rw [← FiniteLeftModule.evaluationMap_comp, D.square] + exact evaluation_zero X + +def evaluatedOrdinaryComplex : ChainComplex (ModuleCat.{u} R) ℕ := + ChainComplex.of (evaluatedRawTerm D hf X) + (fun n => ModuleCat.ofHom (evaluatedBaseDifferential D hf X n)) + (fun n => ModuleCat.hom_ext (evaluatedBaseDifferential_square D hf X n)) + +@[simp] theorem evaluatedOrdinaryComplex_d (n : ℕ) : + (evaluatedOrdinaryComplex D hf X).d (n+1) n = + ModuleCat.ofHom (evaluatedBaseDifferential D hf X n) := by + simp only [evaluatedOrdinaryComplex, ChainComplex.of.d] + apply Category.id_comp + +variable (hex : ∀ n, Function.Exact (D.d (n+1)) (D.d n)) +variable (hr : ∀ n, Module.Projective Rᵐᵒᵖ + (EnvelopingBimodule k R (baseCokernelModule D hf n).carrier)) + +include hex hr in +theorem evaluatedBaseDifferential_ker (n : ℕ) : + LinearMap.ker (evaluatedBaseDifferential D hf X n) = + LinearMap.ker (evaluatedBaseQuotient D hf X (n+1)) := by + rw [evaluatedBaseDifferential_factor D hf hex X n] + ext z + change evaluatedBaseInclusion D hf hex X n (evaluatedBaseQuotient D hf X (n+1) z) = 0 ↔ _ + have hi := (evaluatedBaseCover_exact D hf hex hr X n).1 + constructor + · intro h + apply hi + simpa using h + · intro h + rw [show evaluatedBaseQuotient D hf X (n+1) z = 0 from h, map_zero] + +include hex hr in +theorem evaluatedOrdinaryComplex_exact (n : ℕ) : + (evaluatedOrdinaryComplex D hf X).ExactAt (n+1) := by + rw [HomologicalComplex.exactAt_iff' _ (n+2) (n+1) n (by simp) (by simp)] + rw [ShortComplex.moduleCat_exact_iff_range_eq_ker] + change LinearMap.range ((evaluatedOrdinaryComplex D hf X).d (n+2) (n+1)).hom = + LinearMap.ker ((evaluatedOrdinaryComplex D hf X).d (n+1) n).hom + rw [evaluatedOrdinaryComplex_d, evaluatedOrdinaryComplex_d] + exact (evaluatedBase_range_eq_ker D hf hex hr X (n+1)).trans + (evaluatedBaseDifferential_ker D hf X hex hr n).symm + +theorem evaluatedBaseQuotient_comp_d_zero (n : ℕ) : + (evaluatedBaseQuotient D hf X n).comp (evaluatedBaseDifferential D hf X n) = 0 := by + have h : ((LinearMap.range (D.d n)).mkQ).comp (D.d n) = 0 := by + ext y + exact (Submodule.Quotient.mk_eq_zero _).mpr ⟨y,rfl⟩ + have he := congrArg (fun f => FiniteLeftModule.evaluationMap X + (M := termModule D hf (n+1)) (N := baseCokernelModule D hf n) f) h + erw [FiniteLeftModule.evaluationMap_comp X + (M := termModule D hf (n+1)) (N := termModule D hf n) + (P := baseCokernelModule D hf n) (D.d n) (LinearMap.range (D.d n)).mkQ, + evaluation_zero X (M := termModule D hf (n+1)) (N := baseCokernelModule D hf n)] at he + exact he + +def evaluatedOrdinaryAugmentation : evaluatedOrdinaryComplex D hf X ⟶ + (ChainComplex.single₀ (ModuleCat.{u} R)).obj (X.evaluated (baseCokernelModule D hf 0)).carrier := + (ChainComplex.toSingle₀Equiv _ _).symm + ⟨ModuleCat.ofHom (evaluatedBaseQuotient D hf X 0), by + rw [evaluatedOrdinaryComplex_d] + exact ModuleCat.hom_ext (evaluatedBaseQuotient_comp_d_zero D hf X 0)⟩ + +theorem evaluatedOrdinaryAugmentation_zero : (evaluatedOrdinaryAugmentation D hf X).f 0 = + ModuleCat.ofHom (evaluatedBaseQuotient D hf X 0) := + ChainComplex.toSingle₀Equiv_symm_apply_f_zero _ _ + +variable (hp : ∀ n, Module.Projective (R ⊗[k] Rᵐᵒᵖ) (D.term n)) + +def evaluatedOrdinaryResolution : + ProjectiveResolution (X.evaluated (baseCokernelModule D hf 0)).carrier where + complex := evaluatedOrdinaryComplex D hf X + projective n := by + let := hp n + let := FiniteLeftModule.evaluated_projective X (M := termModule D hf n) + change CategoryTheory.Projective (evaluatedRawTerm D hf X n) + infer_instance + π := evaluatedOrdinaryAugmentation D hf X + quasiIso := ⟨fun n => by + cases n with + | zero => + rw [ChainComplex.quasiIsoAt₀_iff, ShortComplex.quasiIso_iff_of_zeros'] + · constructor + · rw [ShortComplex.moduleCat_exact_iff_range_eq_ker] + change LinearMap.range ((evaluatedOrdinaryComplex D hf X).d 1 0).hom = + LinearMap.ker ((evaluatedOrdinaryAugmentation D hf X).f 0).hom + rw [evaluatedOrdinaryComplex_d, evaluatedOrdinaryAugmentation_zero] + exact evaluatedBase_range_eq_ker D hf hex hr X 0 + · rw [ModuleCat.epi_iff_surjective] + exact (evaluatedBaseCover_exact D hf hex hr X 0).2.1 + · exact (evaluatedOrdinaryComplex D hf X).shape _ _ (by simp) + · rfl + · rfl + | succ n => + rw [quasiIsoAt_iff_exactAt'] + · exact evaluatedOrdinaryComplex_exact D hf X hex hr n + · exact ChainComplex.exactAt_succ_single_obj _ _⟩ + +end ArExplicit.TwoCone + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/EvaluatedResolutionTerms.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/EvaluatedResolutionTerms.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e4b7db8697bc172650730aa7c8058ca56615206 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/EvaluatedResolutionTerms.lean @@ -0,0 +1,36 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.EvaluatedOrdinaryResolution + +namespace OAI + +noncomputable section +namespace ArExplicit.TwoCone +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable (D : Data (R ⊗[k] Rᵐᵒᵖ)) (hf : ∀ n, Module.Finite k (D.term n)) +variable (X : FiniteLeftModule k R) +variable (hex : ∀ n, Function.Exact (D.d (n+1)) (D.d n)) +variable (hr : ∀ n, Module.Projective Rᵐᵒᵖ + (EnvelopingBimodule k R (baseCokernelModule D hf n).carrier)) +variable (hp : ∀ n, Module.Projective (R ⊗[k] Rᵐᵒᵖ) (D.term n)) + +def evaluatedResolutionTermIso (n : ℕ) : + (evaluatedOrdinaryResolution D hf X hex hr hp).complex.X n ≅ evaluatedRawTerm D hf X n := + Iso.refl _ + +@[simp] theorem evaluatedResolutionTermIso_inv_apply (n : ℕ) (x : evaluatedRawTerm D hf X n) : + (evaluatedResolutionTermIso D hf X hex hr hp n).inv x = x := rfl + +theorem evaluatedResolutionTermIso_augmentation : + (evaluatedResolutionTermIso D hf X hex hr hp 0).inv ≫ + (evaluatedOrdinaryResolution D hf X hex hr hp).π.f 0 = + ModuleCat.ofHom (evaluatedBaseQuotient D hf X 0) := by + change 𝟙 _ ≫ (evaluatedOrdinaryAugmentation D hf X).f 0 = _ + rw [Category.id_comp, evaluatedOrdinaryAugmentation_zero] + +end ArExplicit.TwoCone + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteCochainResolution.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteCochainResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..24120a5a33db8ceccc9535550a0c86b677f2f9aa --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteCochainResolution.lean @@ -0,0 +1,59 @@ +import OAI.Algebra.AuslanderReiten.Complete.FiniteCompleteResolution +import OAI.Algebra.AuslanderReiten.Cones.CochainCokernel +import Mathlib.Algebra.Homology.Embedding.Restriction + +namespace OAI + +open CategoryTheory + +namespace ArExplicit + +universe u + +variable {R : Type u} [Ring R] + +namespace CompleteComparison + +def cochainOfChain (P : ChainComplex (ModuleCat.{u} R) ℤ) : + CochainComplex (ModuleCat.{u} R) ℤ := P.restriction negIndexEmbedding + +def cochainOfChainCokernelEquiv (P : ChainComplex (ModuleCat.{u} R) ℤ) : + CochainCokernel (cochainOfChain P) ≃ₗ[R] Cokernel P 0 := + LinearEquiv.refl R _ + +theorem cochainOfChain_totallyAcyclic (P : ChainComplex (ModuleCat.{u} R) ℤ) + (hP : TotallyAcyclicComplex P) : TotallyAcyclicCochain (cochainOfChain P) where + finite i := hP.finite (-i) + projective i := hP.projective (-i) + exactAt i := by + rw [(cochainOfChain P).exactAt_iff' (i := i - 1) (j := i) (k := i + 1) + (by simp) (by simp), ShortComplex.moduleCat_exact_iff_range_eq_ker] + exact hP.exactAt_of_indices (by change -(i - 1) = -i + 1; omega) + (by change -(i + 1) = -i - 1; omega) + dualExact i := by + exact hP.dualExact_of_indices (by change -(i - 1) = -i + 1; omega) + (by change -(i + 1) = -i - 1; omega) + +end CompleteComparison + +namespace FiniteLeftModule + +open CompleteComparison + +variable {k : Type u} [Field k] [Algebra k R] [Module.Finite k R] + +noncomputable def completeCochain (τ : FrobeniusTrace k R) (M : FiniteLeftModule k R) : + CochainComplex (ModuleCat.{u} R) ℤ := cochainOfChain (M.completeComplex τ) + +theorem completeCochain_totallyAcyclic (τ : FrobeniusTrace k R) (M : FiniteLeftModule k R) : + TotallyAcyclicCochain (M.completeCochain τ) := + cochainOfChain_totallyAcyclic _ (M.completeComplex_totallyAcyclic τ) + +noncomputable def completeCochainCokernelEquiv (τ : FrobeniusTrace k R) (M : FiniteLeftModule k R) : + CochainCokernel (M.completeCochain τ) ≃ₗ[R] M.carrier := + (cochainOfChainCokernelEquiv (M.completeComplex τ)).trans (M.completeCokernelEquiv τ) + +end FiniteLeftModule +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteCoverProducts.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteCoverProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed0a5415b01b22b2ac1ed9bc4c51064a771a64f8 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteCoverProducts.lean @@ -0,0 +1,96 @@ +import OAI.Algebra.AuslanderReiten.Coordinates.FiniteSourceCoordinates +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomShiftedIdentity +import OAI.Algebra.AuslanderReiten.Coordinates.IteratedShiftNaturality + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory +open CochainComplex CochainComplex.HomComplex CompleteComparison +open scoped ModuleCat.Algebra +universe u +variable {k R : Type u} [Field k] [CharP k 2] [Ring R] [Algebra k R] +variable [Module.Finite k R] + +structure FiniteCoverTower where + obj : ℕ → FiniteLeftModule k R + middle : ℕ → FiniteLeftModule k R + inclusion : ∀ n, (obj (n+1)).carrier →ₗ[R] (middle n).carrier + quotient : ∀ n, (middle n).carrier →ₗ[R] (obj n).carrier + injective : ∀ n, Function.Injective (inclusion n) + surjective : ∀ n, Function.Surjective (quotient n) + exact : ∀ n, Function.Exact (inclusion n) (quotient n) + projective : ∀ n, Module.Projective R (middle n).carrier + +namespace FiniteCoverTower +variable (τ : FrobeniusTrace k R) (T : FiniteCoverTower (k := k) (R := R)) +local notation "K" => FiniteLeftModule.completeCochain τ (T.obj 0) +local notation "Q" => HomotopyCategory.quotient (ModuleCat R) (ComplexShape.up ℤ) + +def stepIso (n : ℕ) : (Q).obj ((T.obj n).completeCochain τ) ≅ + ((Q).obj ((T.obj (n+1)).completeCochain τ))⟦(1 : ℤ)⟧ := by + letI := T.projective n + exact FiniteLeftModule.projectiveMiddleShiftIso τ (T.inclusion n) (T.quotient n) + (T.injective n) (T.surjective n) (T.exact n) + +def shiftIso (n : ℕ) : (Q).obj K ≅ ((Q).obj ((T.obj n).completeCochain τ))⟦(n : ℤ)⟧ := + iteratedShiftIso (fun n => (Q).obj ((T.obj n).completeCochain τ)) (T.stepIso τ) n + +def boundaryClass (n : ℕ) : + CohomologyClass ((T.obj n).completeCochain τ) ((T.obj (n+1)).completeCochain τ) 1 := + (fullHomShiftedHomotopyEquiv k _ _ 1).symm + (FiniteLeftModule.resolutionConnecting τ (T.inclusion n) (T.quotient n) + (T.injective n) (T.surjective n) (T.exact n)) + +def coverClass : (n : ℕ) → CohomologyClass K ((T.obj n).completeCochain τ) (n : ℤ) + | 0 => fullHomIdentity K + | n+1 => fullHomProduct (coverClass n) (boundaryClass τ T n) + +omit [CharP k 2] in +theorem coverClass_hom (n : ℕ) : + fullHomShiftedHomotopyEquiv k K ((T.obj n).completeCochain τ) (n : ℤ) + (T.coverClass τ n) = (T.shiftIso τ n).hom := by + induction n with + | zero => exact fullHomShiftedHomotopyEquiv_identity k K + | succ n ih => + change fullHomShiftedHomotopyEquiv k K ((T.obj (n+1)).completeCochain τ) ((n : ℤ)+1) + (fullHomProduct (T.coverClass τ n) (T.boundaryClass τ n)) = _ + rw [fullHomShiftedHomotopyEquiv_product, ih] + simp only [boundaryClass, LinearEquiv.apply_symm_apply] + rfl + +variable (S : FiniteLeftModule k R) +variable (u₀ : CohomologyClass (S.completeCochain τ) ((T.obj 0).completeCochain τ) 0) + +def coverClassFrom : (n : ℕ) → + CohomologyClass (S.completeCochain τ) ((T.obj n).completeCochain τ) (n : ℤ) + | 0 => u₀ + | n+1 => fullHomProduct (coverClassFrom n) (boundaryClass τ T n) + +variable (s : ∀ n : ℕ, RawCokernelAt (S.completeCochain τ) (n : ℤ) →ₗ[R] (T.obj n).carrier) +variable (A : ∀ n : ℕ, (S.completeCochain τ).X (-(n : ℤ)) →ₗ[R] (T.middle n).carrier) +variable (hzero : FiniteLeftModule.HasSourceCoordinates τ S (T.obj 0) 0 u₀ (s 0)) +variable (hquotient : ∀ n : ℕ, FiniteLeftModule.SourceQuotientSquare τ S + (T.middle n) (T.obj n) (n : ℤ) (T.quotient n) (s n) (A n)) +variable (hinclusion : ∀ n : ℕ, FiniteLeftModule.SourceInclusionSquare τ S + (T.obj (n+1)) (T.middle n) (n : ℤ) (T.inclusion n) (A n) (s (n+1))) + +include hzero hquotient hinclusion in + +theorem coverClassFrom_source (n : ℕ) : + FiniteLeftModule.HasSourceCoordinates τ S (T.obj n) (n : ℤ) + (T.coverClassFrom τ S u₀ n) (s n) := by + induction n with + | zero => exact hzero + | succ n ih => + exact FiniteLeftModule.HasSourceCoordinates.connecting_product τ + (T.inclusion n) (T.quotient n) (T.injective n) (T.surjective n) (T.exact n) + (T.coverClassFrom τ S u₀ n) (s n) (A n) (s (n+1)) ih (hquotient n) (hinclusion n) + +end FiniteCoverTower +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteCoverTransport.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteCoverTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..b21d497e96bf1440ccf2719dcdedb1cffd25f84b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteCoverTransport.lean @@ -0,0 +1,67 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.FiniteCoverProducts + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory +open CochainComplex CochainComplex.HomComplex CompleteComparison +universe u v w +section General +variable (k : Type u) [CommRing k] +variable {C : Type w} [Category.{v} C] [Preadditive C] [Linear k C] +variable {K L : CochainComplex C ℤ} + +theorem fullHomShiftedHomotopyEquiv_ofHom (f : K ⟶ L) : + fullHomShiftedHomotopyEquiv k K L 0 (CohomologyClass.mk (Cocycle.ofHom f)) = + (HomotopyCategory.quotient C _).map f ≫ + (shiftFunctorZero (HomotopyCategory C (ComplexShape.up ℤ)) ℤ).inv.app + ((HomotopyCategory.quotient C _).obj L) := by + have h : Cocycle.equivHomShift.symm (Cocycle.ofHom f) = + ShiftedHom.mk₀ (0 : ℤ) rfl f := by + apply HomologicalComplex.Hom.ext + funext i + simp only [cocycleHom_component, Cocycle.ofHom_coe] + simp only [ShiftedHom.mk₀, HomologicalComplex.comp_f, CategoryTheory.shiftFunctorZero', + eqToIso_refl, Iso.trans_inv, Iso.refl_inv, + CochainComplex.shiftFunctorZero_inv_app_f, Category.comp_id] + change (Cochain.ofHom f).v i (i+0) rfl = + f.f i ≫ (L.XIsoOfEq (show i=i+0 by omega)).hom + simpa only [Cochain.ofHom_v] using + (Cochain.v_comp_XIsoOfEq_hom (Cochain.ofHom f) i i (i+0) (add_zero i) (by omega)).symm + rw [fullHomShiftedHomotopyEquiv_mk, h] + change (ShiftedHom.mk₀ (0 : ℤ) rfl f).map (HomotopyCategory.quotient C _) = _ + rw [ShiftedHom.map_mk₀] + simp [ShiftedHom.mk₀, CategoryTheory.shiftFunctorZero'] +end General + +open scoped ModuleCat.Algebra +variable {k R : Type u} [Field k] [CharP k 2] [Ring R] [Algebra k R] +variable [Module.Finite k R] +namespace FiniteCoverTower +variable (τ : FrobeniusTrace k R) (T : FiniteCoverTower (k := k) (R := R)) +variable (S : FiniteLeftModule k R) +local notation "Q" => HomotopyCategory.quotient (ModuleCat R) (ComplexShape.up ℤ) + +omit [CharP k 2] in +theorem coverClassFrom_hom (f : S.completeCochain τ ⟶ (T.obj 0).completeCochain τ) (n : ℕ) : + fullHomShiftedHomotopyEquiv k _ _ (n : ℤ) + (T.coverClassFrom τ S (CohomologyClass.mk (Cocycle.ofHom f)) n) = + (Q).map f ≫ (T.shiftIso τ n).hom := by + induction n with + | zero => exact fullHomShiftedHomotopyEquiv_ofHom k f + | succ n ih => + change fullHomShiftedHomotopyEquiv k _ _ ((n : ℤ)+1) + (fullHomProduct (T.coverClassFrom τ S (CohomologyClass.mk (Cocycle.ofHom f)) n) + (T.boundaryClass τ n)) = _ + rw [fullHomShiftedHomotopyEquiv_product, ih] + simp only [boundaryClass, LinearEquiv.apply_symm_apply] + simp only [shiftIso, iteratedShiftIso, Iso.trans_hom, Functor.mapIso_hom, + Iso.app_hom, Iso.symm_hom, Category.assoc] + rfl +end FiniteCoverTower +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionAdditive.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionAdditive.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7518e2da2e5ae223306b3702c24610a55632e9e --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionAdditive.lean @@ -0,0 +1,41 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.FiniteResolutionLinear + +namespace OAI + +open CategoryTheory +open scoped ModuleCat.Algebra +namespace ArExplicit +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +namespace CompleteComparison +variable {K L : CochainComplex (ModuleCat.{u} R) ℤ} +theorem cochainCokernelMap_add (f g : K ⟶ L) : + cochainCokernelMap (f+g) = cochainCokernelMap f + cochainCokernelMap g := by + apply LinearMap.ext + intro z + obtain ⟨x, rfl⟩ := (LinearMap.range (K.d (-1) 0).hom).mkQ_surjective z + exact (LinearMap.range (L.d (-1) 0).hom).mkQ.map_add _ _ +end CompleteComparison +namespace FiniteLeftModule +open CompleteComparison +variable [Module.Finite k R] (τ : FrobeniusTrace k R) +variable {M N : FiniteLeftModule k R} +theorem resolutionCokernelMap_add (f g : M.carrier →ₗ[R] N.carrier) : + resolutionCokernelMap τ (f+g) = resolutionCokernelMap τ f + resolutionCokernelMap τ g := by + ext x + exact (N.completeCochainCokernelEquiv τ).symm.map_add _ _ + +theorem resolutionMap_add (f g : M.carrier →ₗ[R] N.carrier) : + (HomotopyCategory.quotient _ _).map (resolutionMap τ (f+g)) = + (HomotopyCategory.quotient _ _).map (resolutionMap τ f) + + (HomotopyCategory.quotient _ _).map (resolutionMap τ g) := by + rw [← Functor.map_add] + apply (cochainHomotopyRawEquiv (M.completeCochain_totallyAcyclic τ).to_chain + (N.completeCochain_totallyAcyclic τ).to_chain.toExactProjectiveComplex).injective + rw [cochainHomotopyRawEquiv_map, cochainHomotopyRawEquiv_map, + resolutionMap_cokernel, cochainCokernelMap_add, resolutionMap_cokernel, + resolutionMap_cokernel, resolutionCokernelMap_add] +end FiniteLeftModule +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionEvaluation.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..a6920e0877fd1a30799797b8b7b5d5b1174640da --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionEvaluation.lean @@ -0,0 +1,82 @@ +import OAI.Algebra.AuslanderReiten.Modules.FiniteModuleEvaluation +import OAI.Algebra.AuslanderReiten.Duality.FiniteStableResolutionIso + +namespace OAI + +noncomputable section +namespace ArExplicit.FiniteLeftModule +open CategoryTheory +open scoped TensorProduct +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (X : FiniteLeftModule k R) (τe : FrobeniusTrace k (R ⊗[k] Rᵐᵒᵖ)) +variable (τ : FrobeniusTrace k R) +variable {M N P : FiniteLeftModule k (R ⊗[k] Rᵐᵒᵖ)} + +def evaluationResolutionMap + (f : (HomotopyCategory.quotient _ _).obj (M.completeCochain τe) ⟶ + (HomotopyCategory.quotient _ _).obj (N.completeCochain τe)) : + (HomotopyCategory.quotient _ _).obj ((X.evaluated M).completeCochain τ) ⟶ + (HomotopyCategory.quotient _ _).obj ((X.evaluated N).completeCochain τ) := + (resolutionHomotopyEquiv τ (X.evaluated M) (X.evaluated N)).symm + (EnvelopingBimodule.stableEvaluation X.carrier (resolutionHomotopyEquiv τe M N f)) + +@[simp] theorem evaluationResolutionMap_lift (f : M.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] N.carrier) : + evaluationResolutionMap X τe τ + ((HomotopyCategory.quotient _ _).map (resolutionMap τe f)) = + (HomotopyCategory.quotient _ _).map (resolutionMap τ (evaluationMap X f)) := by + apply (resolutionHomotopyEquiv τ (X.evaluated M) (X.evaluated N)).injective + simp only [evaluationResolutionMap, resolutionHomotopyEquiv_map] + erw [AddEquiv.apply_symm_apply] + rfl + +theorem evaluationResolutionMap_comp + (f : (HomotopyCategory.quotient _ _).obj (M.completeCochain τe) ⟶ + (HomotopyCategory.quotient _ _).obj (N.completeCochain τe)) + (g : (HomotopyCategory.quotient _ _).obj (N.completeCochain τe) ⟶ + (HomotopyCategory.quotient _ _).obj (P.completeCochain τe)) : + evaluationResolutionMap X τe τ (f ≫ g) = + evaluationResolutionMap X τe τ f ≫ evaluationResolutionMap X τe τ g := by + obtain ⟨f, rfl⟩ := resolutionMap_surjective τe f + obtain ⟨g, rfl⟩ := resolutionMap_surjective τe g + rw [← resolutionMap_comp, evaluationResolutionMap_lift, + evaluationResolutionMap_lift, evaluationResolutionMap_lift, + ← resolutionMap_comp, evaluationMap_comp] + +@[simp] theorem evaluationResolutionMap_id : + evaluationResolutionMap X τe τ (𝟙 ((HomotopyCategory.quotient _ _).obj (M.completeCochain τe))) = 𝟙 _ := by + rw [← resolutionMap_id (M := M) τe, evaluationResolutionMap_lift, + evaluationMap_id, resolutionMap_id] + +def evaluationResolutionIso + (e : (HomotopyCategory.quotient _ _).obj (M.completeCochain τe) ≅ + (HomotopyCategory.quotient _ _).obj (N.completeCochain τe)) : + (HomotopyCategory.quotient _ _).obj ((X.evaluated M).completeCochain τ) ≅ + (HomotopyCategory.quotient _ _).obj ((X.evaluated N).completeCochain τ) where + hom := evaluationResolutionMap X τe τ e.hom + inv := evaluationResolutionMap X τe τ e.inv + hom_inv_id := by rw [← evaluationResolutionMap_comp, e.hom_inv_id, evaluationResolutionMap_id] + inv_hom_id := by rw [← evaluationResolutionMap_comp, e.inv_hom_id, evaluationResolutionMap_id] + +theorem evaluationResolutionMap_triangle + (f : M.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] N.carrier) + (g : M.carrier →ₗ[R ⊗[k] Rᵐᵒᵖ] P.carrier) + (t : (HomotopyCategory.quotient _ _).obj (N.completeCochain τe) ⟶ + (HomotopyCategory.quotient _ _).obj (P.completeCochain τe)) + (h : (HomotopyCategory.quotient _ _).map (resolutionMap τe f) ≫ t = + (HomotopyCategory.quotient _ _).map (resolutionMap τe g)) : + (HomotopyCategory.quotient _ _).map (resolutionMap τ (evaluationMap X f)) ≫ + evaluationResolutionMap X τe τ t = + (HomotopyCategory.quotient _ _).map (resolutionMap τ (evaluationMap X g)) := by + have he := congrArg (evaluationResolutionMap X τe τ) h + erw [evaluationResolutionMap_comp X τe τ (M := M) (N := N) (P := P) + ((HomotopyCategory.quotient _ _).map (resolutionMap τe f)) t, + evaluationResolutionMap_lift X τe τ (M := M) (N := N) f, + evaluationResolutionMap_lift X τe τ (M := M) (N := P) g] at he + exact he + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionIso.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionIso.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa05ad068a0a5929e5c9e589ff820ba252770f56 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionIso.lean @@ -0,0 +1,32 @@ +import OAI.Algebra.AuslanderReiten.Modules.FiniteModuleNaturality + +namespace OAI + +noncomputable section +open CategoryTheory + +namespace ArExplicit.FiniteLeftModule + +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (τ : FrobeniusTrace k R) {M N : FiniteLeftModule k R} + +def resolutionIso (e : M.carrier ≃ₗ[R] N.carrier) : + (HomotopyCategory.quotient _ _).obj (M.completeCochain τ) ≅ + (HomotopyCategory.quotient _ _).obj (N.completeCochain τ) where + hom := (HomotopyCategory.quotient _ _).map (resolutionMap τ e.toLinearMap) + inv := (HomotopyCategory.quotient _ _).map (resolutionMap τ e.symm.toLinearMap) + hom_inv_id := by + rw [← resolutionMap_comp, e.symm_comp, resolutionMap_id] + inv_hom_id := by + rw [← resolutionMap_comp, e.comp_symm, resolutionMap_id] + +@[simp] +theorem resolutionIso_hom (e : M.carrier ≃ₗ[R] N.carrier) : + (resolutionIso τ e).hom = (HomotopyCategory.quotient _ _).map (resolutionMap τ e.toLinearMap) := rfl + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionLinear.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionLinear.lean new file mode 100644 index 0000000000000000000000000000000000000000..d1011ff276af8592d38918daf7ca78e447aaf097 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionLinear.lean @@ -0,0 +1,49 @@ +import OAI.Algebra.AuslanderReiten.Modules.FiniteModuleNaturality +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomLinear + +namespace OAI + +open CategoryTheory +open scoped ModuleCat.Algebra + +namespace ArExplicit +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] + +namespace CompleteComparison +variable {K L : CochainComplex (ModuleCat.{u} R) ℤ} + +theorem cochainCokernelMap_smul (a : k) (f : K ⟶ L) : + cochainCokernelMap (a • f) = a • cochainCokernelMap f := by + apply LinearMap.ext + intro z + obtain ⟨x, rfl⟩ := (LinearMap.range (K.d (-1) 0).hom).mkQ_surjective z + change (LinearMap.range (L.d (-1) 0).hom).mkQ (a • (f.f 0).hom x) = + a • (LinearMap.range (L.d (-1) 0).hom).mkQ ((f.f 0).hom x) + exact ((LinearMap.range (L.d (-1) 0).hom).mkQ.restrictScalars k).map_smul a _ +end CompleteComparison + +namespace FiniteLeftModule +open CompleteComparison +variable [Module.Finite k R] (τ : FrobeniusTrace k R) +variable {M N : FiniteLeftModule k R} + +theorem resolutionCokernelMap_smul (a : k) (f : M.carrier →ₗ[R] N.carrier) : + resolutionCokernelMap τ (a • f) = a • resolutionCokernelMap τ f := by + apply LinearMap.ext + intro x + exact ((N.completeCochainCokernelEquiv τ).symm.toLinearMap.restrictScalars k).map_smul a _ + +theorem resolutionMap_smul (a : k) (f : M.carrier →ₗ[R] N.carrier) : + (HomotopyCategory.quotient _ _).map (resolutionMap τ (a • f)) = + a • (HomotopyCategory.quotient _ _).map (resolutionMap τ f) := by + rw [← Functor.map_smul] + apply (cochainHomotopyRawEquiv (M.completeCochain_totallyAcyclic τ).to_chain + (N.completeCochain_totallyAcyclic τ).to_chain.toExactProjectiveComplex).injective + rw [cochainHomotopyRawEquiv_map, cochainHomotopyRawEquiv_map, + resolutionMap_cokernel, cochainCokernelMap_smul, resolutionMap_cokernel, + resolutionCokernelMap_smul] +end FiniteLeftModule +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionProduct.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..7a60c9e12b629f82a6e4bb5f96a78af3dab06f3c --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionProduct.lean @@ -0,0 +1,94 @@ +import OAI.Algebra.AuslanderReiten.Duality.FiniteStableResolutionIso +import OAI.Algebra.AuslanderReiten.Fibers.FiniteEvaluatedFiber +import Mathlib.CategoryTheory.Preadditive.Biproducts + +namespace OAI + +noncomputable section +namespace ArExplicit.FiniteLeftModule +open CategoryTheory CategoryTheory.Limits +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (τ : FrobeniusTrace k R) +local notation "Q" => HomotopyCategory.quotient (ModuleCat R) (ComplexShape.up ℤ) +variable {M N : FiniteLeftModule k R} + +theorem homotopyResolutionMap_add (f g : M.carrier →ₗ[R] N.carrier) : + (Q).map (resolutionMap τ (f + g)) = (Q).map (resolutionMap τ f) + (Q).map (resolutionMap τ g) := by + apply (resolutionHomotopyEquiv τ M N).injective + rw [map_add, resolutionHomotopyEquiv_map, resolutionHomotopyEquiv_map, + resolutionHomotopyEquiv_map] + exact map_add (StableHom.classOf R M.carrier N.carrier) f g + +theorem homotopyResolutionMap_zero : + (Q).map (resolutionMap τ (0 : M.carrier →ₗ[R] N.carrier)) = 0 := by + apply (resolutionHomotopyEquiv τ M N).injective + rw [map_zero, resolutionHomotopyEquiv_map] + exact map_zero (StableHom.classOf R M.carrier N.carrier) + +variable (M N) + +def pairFst : (pairModule M N).carrier →ₗ[R] M.carrier := LinearMap.fst R _ _ +def pairSnd : (pairModule M N).carrier →ₗ[R] N.carrier := LinearMap.snd R _ _ +def pairInl : M.carrier →ₗ[R] (pairModule M N).carrier := LinearMap.inl R _ _ +def pairInr : N.carrier →ₗ[R] (pairModule M N).carrier := LinearMap.inr R _ _ + +abbrev resolutionPairBicone : BinaryBicone ((Q).obj (M.completeCochain τ)) + ((Q).obj (N.completeCochain τ)) where + pt := (Q).obj ((pairModule M N).completeCochain τ) + fst := (Q).map (resolutionMap (M := pairModule M N) (N := M) τ (pairFst M N)) + snd := (Q).map (resolutionMap (M := pairModule M N) (N := N) τ (pairSnd M N)) + inl := (Q).map (resolutionMap (M := M) (N := pairModule M N) τ (pairInl M N)) + inr := (Q).map (resolutionMap (M := N) (N := pairModule M N) τ (pairInr M N)) + inl_fst := by + erw [← resolutionMap_comp] + rw [show (pairFst M N).comp (pairInl M N) = LinearMap.id from by ext x; rfl, resolutionMap_id] + inl_snd := by + erw [← resolutionMap_comp] + rw [show (pairSnd M N).comp (pairInl M N) = 0 from by ext x; rfl, homotopyResolutionMap_zero] + inr_fst := by + erw [← resolutionMap_comp] + rw [show (pairFst M N).comp (pairInr M N) = 0 from by ext x; rfl, homotopyResolutionMap_zero] + inr_snd := by + erw [← resolutionMap_comp] + rw [show (pairSnd M N).comp (pairInr M N) = LinearMap.id from by ext x; rfl, resolutionMap_id] + + theorem resolutionPairBicone_total : + (resolutionPairBicone τ M N).fst ≫ (resolutionPairBicone τ M N).inl + + (resolutionPairBicone τ M N).snd ≫ (resolutionPairBicone τ M N).inr = + 𝟙 (resolutionPairBicone τ M N).pt := by + apply (resolutionHomotopyEquiv τ (pairModule M N) (pairModule M N)).injective + rw [map_add, resolutionHomotopyEquiv_comp, resolutionHomotopyEquiv_comp, + resolutionHomotopyEquiv_id] + simp only [resolutionHomotopyEquiv_map, StableHom.comp_classOf] + rw [← map_add] + apply congrArg (StableHom.classOf R _ _) + ext x + exact Prod.ext (add_zero _) (zero_add _) + +def resolutionPairBilimit : (resolutionPairBicone τ M N).IsBilimit := + isBinaryBilimitOfTotal _ (resolutionPairBicone_total τ M N) + +instance resolutionPairHasBiproduct : HasBinaryBiproduct ((Q).obj (M.completeCochain τ)) + ((Q).obj (N.completeCochain τ)) := + hasBinaryBiproduct_of_total _ (resolutionPairBicone_total τ M N) + +def resolutionPairIso : (Q).obj ((pairModule M N).completeCochain τ) ≅ + ((Q).obj (M.completeCochain τ) ⊞ (Q).obj (N.completeCochain τ)) := + biprod.uniqueUpToIso _ _ (resolutionPairBilimit τ M N) + +@[simp] theorem resolutionPairIso_hom_fst : + (resolutionPairIso τ M N).hom ≫ biprod.fst = + (Q).map (resolutionMap (M := pairModule M N) (N := M) τ (pairFst M N)) := + by simp [resolutionPairIso] + +@[simp] theorem resolutionPairIso_hom_snd : + (resolutionPairIso τ M N).hom ≫ biprod.snd = + (Q).map (resolutionMap (M := pairModule M N) (N := N) τ (pairSnd M N)) := + by simp [resolutionPairIso] + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionProductInclusions.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionProductInclusions.lean new file mode 100644 index 0000000000000000000000000000000000000000..38860e4c42881a3fa10b71e7d73b6104cb92d3a1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/FiniteResolutionProductInclusions.lean @@ -0,0 +1,35 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.FiniteResolutionProduct + +namespace OAI + +noncomputable section +namespace ArExplicit.FiniteLeftModule +open CategoryTheory CategoryTheory.Limits +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (τ : FrobeniusTrace k R) (M N : FiniteLeftModule k R) +local notation "Q" => HomotopyCategory.quotient (ModuleCat R) (ComplexShape.up ℤ) + +theorem resolutionPairInl : + (Q).map (resolutionMap (M := M) (N := pairModule M N) τ (pairInl M N)) ≫ + (resolutionPairIso τ M N).hom = biprod.inl := by + apply biprod.hom_ext + · rw [Category.assoc, resolutionPairIso_hom_fst, biprod.inl_fst] + exact (resolutionPairBicone τ M N).inl_fst + · rw [Category.assoc, resolutionPairIso_hom_snd, biprod.inl_snd] + exact (resolutionPairBicone τ M N).inl_snd + +theorem resolutionPairInr : + (Q).map (resolutionMap (M := N) (N := pairModule M N) τ (pairInr M N)) ≫ + (resolutionPairIso τ M N).hom = biprod.inr := by + apply biprod.hom_ext + · rw [Category.assoc, resolutionPairIso_hom_fst, biprod.inr_fst] + exact (resolutionPairBicone τ M N).inr_fst + · rw [Category.assoc, resolutionPairIso_hom_snd, biprod.inr_snd] + exact (resolutionPairBicone τ M N).inr_snd + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionCochain.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionCochain.lean new file mode 100644 index 0000000000000000000000000000000000000000..e35a1d971ec408b5ab11d7cb4c2383538331f9f3 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionCochain.lean @@ -0,0 +1,59 @@ +import OAI.Algebra.AuslanderReiten.Coordinates.MapExtend + +namespace OAI + +noncomputable section +open CategoryTheory Category Limits ZeroObject HomologicalComplex +namespace ArExplicit.ResolutionProducts +universe u v u' v' +variable {C : Type u} [Category.{v} C] [Abelian C] +variable {D : Type u'} [Category.{v'} D] [Abelian D] +variable (F : C ⥤ D) [F.Additive] [PreservesFiniteLimits F] [PreservesFiniteColimits F] +variable [F.PreservesProjectiveObjects] +variable {X : C} (P : ProjectiveResolution X) + +omit [Abelian C] [Abelian D] [F.Additive] [PreservesFiniteLimits F] + [PreservesFiniteColimits F] [F.PreservesProjectiveObjects] in +private theorem map_composite_cancel {U V W Z : C} {U' Z' : D} + (a : U' ⟶ F.obj U) (b : U ⟶ V) (f : V ⟶ W) (e : W ≅ Z) (t : F.obj W ⟶ Z') : + a ≫ F.map (b ≫ f ≫ e.hom) ≫ (F.map e.inv ≫ t) = + (a ≫ F.map b) ≫ F.map f ≫ t := by + simp only [Functor.map_comp, Category.assoc] + rw [← F.map_comp_assoc e.hom e.inv t, e.hom_inv_id, F.map_id, id_comp] + +def mapResolutionCochainIso : (mapResolution F P).cochainComplex ≅ + (F.mapHomologicalComplex (.up ℤ)).obj P.cochainComplex := + mapExtendIso F P.complex ComplexShape.embeddingDownNat + +theorem mapResolutionCochainIso_coordinate (n : ℤ) (j : ℕ) (h : -(j : ℤ) = n) : + (mapResolutionCochainIso F P).hom.f n ≫ F.map (P.cochainComplexXIso n j h).hom = + ((mapResolution F P).cochainComplexXIso n j h).hom := + mapExtendXIso_hom_XIso F P.complex (ComplexShape.embeddingDownNat.r_eq_some h) + +theorem mapResolution_π_zero : (mapResolution F P).π.f 0 = F.map (P.π.f 0) := by + change F.map (P.π.f 0) ≫ ((singleMapHomologicalComplex F (.down ℕ) 0).hom.app X).f 0 = _ + rw [singleMapHomologicalComplex_hom_app_self] + change F.map (P.π.f 0) ≫ (F.map (𝟙 X) ≫ 𝟙 (F.obj X)) = _ + simp + +theorem mapResolutionCochainIso_π : + (mapResolutionCochainIso F P).hom ≫ + (F.mapHomologicalComplex (.up ℤ)).map P.π' ≫ + (F.mapCochainComplexSingleFunctor 0).hom.app X = (mapResolution F P).π' := by + apply to_single_hom_ext + change (mapResolutionCochainIso F P).hom.f 0 ≫ F.map (P.π'.f 0) ≫ + ((singleMapHomologicalComplex F (.up ℤ) 0).hom.app X).f 0 = (mapResolution F P).π'.f 0 + rw [P.π'_f_zero, + (mapResolution F P).π'_f_zero, mapResolution_π_zero, + singleMapHomologicalComplex_hom_app_self] + have he := map_composite_cancel F ((mapResolutionCochainIso F P).hom.f 0) + (P.cochainComplexXIso 0 0 (by simp)).hom (show P.complex.X 0 ⟶ X from P.π.f 0) + (singleObjXSelf (.up ℤ) 0 X).symm (singleObjXSelf (.up ℤ) 0 (F.obj X)).inv + exact he.trans (congrArg (fun a => a ≫ F.map (P.π.f 0) ≫ + (singleObjXSelf (.up ℤ) 0 (F.obj X)).inv) (mapResolutionCochainIso_coordinate F P 0 0 (by simp))) + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExt.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..a5d7b5843fd487758d0462a2fc0d3ce63fd19020 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExt.lean @@ -0,0 +1,73 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.MapResolutionCochain +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionExtAction + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian CategoryTheory.Localization +open CochainComplex CochainComplex.HomComplex HomologicalComplex +namespace ArExplicit.ResolutionProducts +universe u v u' v' +variable {C : Type u} [Category.{v} C] [Abelian C] [HasExt.{v} C] +variable {D : Type u'} [Category.{v'} D] [Abelian D] [HasExt.{v'} D] +variable (F : C ⥤ D) [F.Additive] [CategoryTheory.Limits.PreservesFiniteLimits F] + [CategoryTheory.Limits.PreservesFiniteColimits F] [F.PreservesProjectiveObjects] +variable {X Y : C} (P : ProjectiveResolution X) {n : ℕ} + +def mappedResolutionCocycle + (x : Cocycle P.cochainComplex ((CochainComplex.singleFunctor C 0).obj Y) (n : ℤ)) : + Cocycle (mapResolution F P).cochainComplex + ((CochainComplex.singleFunctor D 0).obj (F.obj Y)) (n : ℤ) := + Cocycle.equivHomShift ((mapResolutionCochainIso F P).hom ≫ + ShiftedHom.map (Cocycle.equivHomShift.symm x) (F.mapHomologicalComplex (.up ℤ)) ≫ + ((F.mapCochainComplexSingleFunctor 0).hom.app Y)⟦(n : ℤ)⟧') + +theorem precomp_extOfCocycle + (x : Cocycle P.cochainComplex ((CochainComplex.singleFunctor C 0).obj Y) (n : ℤ)) : + (SmallShiftedHom.mk₀ (quasiIso C (.up ℤ)) 0 rfl P.π').comp + (P.extEquivCohomologyClass.symm (CohomologyClass.mk x)) (add_zero (n : ℤ)) = + SmallShiftedHom.mk (quasiIso C (.up ℤ)) (Cocycle.equivHomShift.symm x) := by + have hπ : quasiIso C (.up ℤ) P.π' := by rw [mem_quasiIso_iff]; infer_instance + change (SmallShiftedHom.precompEquiv P.π' hπ) + ((SmallShiftedHom.precompEquiv P.π' hπ).symm + (CohomologyClass.equivOfIsKProjective (CohomologyClass.mk x))) = _ + rw [Equiv.apply_symm_apply] + rfl + +theorem map_extOfCocycle + (x : Cocycle P.cochainComplex ((CochainComplex.singleFunctor C 0).obj Y) (n : ℤ)) : + (P.extEquivCohomologyClass.symm (CohomologyClass.mk x)).mapExactFunctor F = + (mapResolution F P).extEquivCohomologyClass.symm + (CohomologyClass.mk (mappedResolutionCocycle F P x)) := by + let Φ := F.mapHomologicalComplexUpToQuasiIsoLocalizerMorphism (.up ℤ) + let eP : (F.mapHomologicalComplex (.up ℤ)).obj P.cochainComplex ≅ + (mapResolution F P).cochainComplex := (mapResolutionCochainIso F P).symm + let eX : (F.mapHomologicalComplex (.up ℤ)).obj ((CochainComplex.singleFunctor C 0).obj X) ≅ + (CochainComplex.singleFunctor D 0).obj (F.obj X) := (F.mapCochainComplexSingleFunctor 0).app X + let eY : (F.mapHomologicalComplex (.up ℤ)).obj ((CochainComplex.singleFunctor C 0).obj Y) ≅ + (CochainComplex.singleFunctor D 0).obj (F.obj Y) := (F.mapCochainComplexSingleFunctor 0).app Y + have h := congrArg (fun z => Φ.smallShiftedHomMap eP eY z) (precomp_extOfCocycle P x) + erw [Φ.smallShiftedHomMap_comp eP eX eY, + Φ.smallShiftedHomMap_mk₀ eP eX, Φ.smallShiftedHomMap_mk eP eY] at h + have hπ : eP.inv ≫ Φ.functor.map P.π' ≫ eX.hom = (mapResolution F P).π' := + mapResolutionCochainIso_π F P + erw [hπ] at h + apply (SmallShiftedHom.precompEquiv (mapResolution F P).π' + (by rw [mem_quasiIso_iff]; infer_instance)).injective + change (SmallShiftedHom.mk₀ (quasiIso D (.up ℤ)) 0 rfl (mapResolution F P).π').comp + _ (add_zero (n : ℤ)) = + (SmallShiftedHom.mk₀ (quasiIso D (.up ℤ)) 0 rfl (mapResolution F P).π').comp + ((mapResolution F P).extEquivCohomologyClass.symm + (CohomologyClass.mk (mappedResolutionCocycle F P x))) (add_zero (n : ℤ)) + have hpost := precomp_extOfCocycle (mapResolution F P) (mappedResolutionCocycle F P x) + refine h.trans (Eq.trans ?_ hpost.symm) + apply congrArg (SmallShiftedHom.mk (quasiIso D (.up ℤ))) + rw [mappedResolutionCocycle, AddEquiv.symm_apply_apply] + simp only [ShiftedHom.mk₀_comp, ShiftedHom.comp_mk₀] + rfl + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExtComparison.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExtComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..6eb9f29d26e42fa29c6da0bdfd3aec37022cddc0 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExtComparison.lean @@ -0,0 +1,30 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.MapResolutionExtMk + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian CategoryTheory.Limits +namespace ArExplicit.ResolutionProducts +universe u v u' v' +variable {C : Type u} [Category.{v} C] [Abelian C] [HasExt.{v} C] +variable {D : Type u'} [Category.{v'} D] [Abelian D] [HasExt.{v'} D] +variable (F : C ⥤ D) [F.Additive] [PreservesFiniteLimits F] + [PreservesFiniteColimits F] [F.PreservesProjectiveObjects] +variable {X : C} {Y : D} (P : ProjectiveResolution X) (Q : ProjectiveResolution Y) + +theorem map_extMk_comparison (e : Y ≅ F.obj X) + (φ : ProjectiveResolution.Hom Q (mapResolution F P) e.hom) + {n : ℕ} (f : P.complex.X n ⟶ X) (hf : P.complex.d (n+1) n ≫ f = 0) + (g : Q.complex.X n ⟶ Y) (hg : Q.complex.d (n+1) n ≫ g = 0) + (hgf : g = (φ.hom.f n ≫ F.map f) ≫ e.inv) : + ((Ext.mk₀ e.hom).comp ((P.extMk f (n+1) rfl hf).mapExactFunctor F) (zero_add n)).comp + (Ext.mk₀ e.inv) (add_zero n) = Q.extMk g (n+1) rfl hg := by + subst g + erw [map_extMk, ProjectiveResolution.mk₀_comp_extMk _ _ _ _ φ, + ProjectiveResolution.extMk_comp_mk₀] + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExtConjugate.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExtConjugate.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a914b93afd6e6860b051bb39191b239e047dfa9 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExtConjugate.lean @@ -0,0 +1,30 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.MapResolutionExtMk + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian CategoryTheory.Limits +namespace ArExplicit.ResolutionProducts +universe u v +variable {C : Type u} [Category.{v} C] [Abelian C] [HasExt.{v} C] +variable (F : C ⥤ C) [F.Additive] [PreservesFiniteLimits F] + [PreservesFiniteColimits F] [F.PreservesProjectiveObjects] +variable {X Y : C} (P : ProjectiveResolution X) {n : ℕ} + +theorem map_extMk_conjugate (a : X ⟶ F.obj X) (b : F.obj Y ⟶ Y) + (φ : ProjectiveResolution.Hom P (mapResolution F P) a) + (f : P.complex.X n ⟶ Y) (hf : P.complex.d (n+1) n ≫ f = 0) + (g : P.complex.X n ⟶ Y) (hg : P.complex.d (n+1) n ≫ g = 0) + (hgf : g = (φ.hom.f n ≫ F.map f) ≫ b) : + ((Ext.mk₀ a).comp ((P.extMk f (n+1) rfl hf).mapExactFunctor F) (zero_add n)).comp + (Ext.mk₀ b) (add_zero n) = + P.extMk g (n+1) rfl hg := by + subst g + erw [map_extMk, ProjectiveResolution.mk₀_comp_extMk _ _ _ _ φ, + ProjectiveResolution.extMk_comp_mk₀] + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExtMk.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExtMk.lean new file mode 100644 index 0000000000000000000000000000000000000000..9669daabda4f0b944db283f63596a52b3b2538ea --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/MapResolutionExtMk.lean @@ -0,0 +1,82 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.MapResolutionExt +import OAI.Algebra.AuslanderReiten.Cocycles.CocycleFunctor + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian CategoryTheory.Limits +open CochainComplex CochainComplex.HomComplex HomologicalComplex +namespace ArExplicit.ResolutionProducts +universe u v u' v' +variable {C : Type u} [Category.{v} C] [Abelian C] [HasExt.{v} C] +variable {D : Type u'} [Category.{v'} D] [Abelian D] [HasExt.{v'} D] +variable (F : C ⥤ D) [F.Additive] [PreservesFiniteLimits F] + [PreservesFiniteColimits F] [F.PreservesProjectiveObjects] +variable {X Y : C} (P : ProjectiveResolution X) {n : ℕ} + +omit [Abelian C] [Abelian D] [HasExt.{v} C] [HasExt.{v'} D] [F.Additive] + [PreservesFiniteLimits F] [PreservesFiniteColimits F] [F.PreservesProjectiveObjects] in +private theorem map_eval_cancel {U V W Z : C} {U' Z' : D} + (a : U' ⟶ F.obj U) (b : U ⟶ V) (f : V ⟶ W) (e : Z ≅ W) (t : Z' ≅ F.obj W) : + (a ≫ F.map ((b ≫ f) ≫ e.inv) ≫ (F.map e.hom ≫ t.inv)) ≫ t.hom = + (a ≫ F.map b) ≫ F.map f := by + simp only [Functor.map_comp, Category.assoc, t.inv_hom_id, Category.comp_id] + rw [← F.map_comp e.inv e.hom, e.inv_hom_id, F.map_id, Category.comp_id] + +omit [HasExt.{v} C] [HasExt.{v'} D] in +theorem mappedResolutionCocycle_eq + (x : Cocycle P.cochainComplex ((CochainComplex.singleFunctor C 0).obj Y) (n : ℤ)) : + mappedResolutionCocycle F P x = + ((fullHomCocycleMap F _ _ _ x).precomp (mapResolutionCochainIso F P).hom).postcomp + ((F.mapCochainComplexSingleFunctor 0).hom.app Y) := by + apply Cocycle.equivHomShift.symm.injective + rw [mappedResolutionCocycle, AddEquiv.symm_apply_apply, + Cocycle.equivHomShift_symm_postcomp, Cocycle.equivHomShift_symm_precomp, cocycle_map_hom] + exact (Category.assoc _ _ _).symm + +omit [HasExt.{v} C] [HasExt.{v'} D] in +theorem mappedResolutionCocycle_v + (x : Cocycle P.cochainComplex ((CochainComplex.singleFunctor C 0).obj Y) (n : ℤ)) + (i j : ℤ) (hij : i+n=j) : + (mappedResolutionCocycle F P x).val.v i j hij = + (mapResolutionCochainIso F P).hom.f i ≫ F.map (x.val.v i j hij) ≫ + ((F.mapCochainComplexSingleFunctor 0).hom.app Y).f j := by + rw [mappedResolutionCocycle_eq] + change (((Cochain.ofHom _).comp (x.val.map F) (zero_add (n : ℤ))).comp + (Cochain.ofHom _) (add_zero (n : ℤ))).v i j hij = _ + simp only [Cochain.comp_zero_cochain_v, Cochain.zero_cochain_comp_v, Cochain.ofHom_v, + Cochain.map_v] + exact Category.assoc _ _ _ + +theorem map_extMk (f : P.complex.X n ⟶ Y) + (hf : P.complex.d (n+1) n ≫ f = 0) : + (P.extMk f (n+1) rfl hf).mapExactFunctor F = + (mapResolution F P).extMk (F.map f) (n+1) rfl + (by change F.map (P.complex.d (n+1) n) ≫ F.map f = 0 + rw [← F.map_comp, hf, F.map_zero]) := by + unfold ProjectiveResolution.extMk + rw [map_extOfCocycle] + apply congrArg (mapResolution F P).extEquivCohomologyClass.symm + apply congrArg CohomologyClass.mk + apply Cocycle.ext + apply (Cochain.toSingleEquiv (p := -(n : ℤ)) (q := 0) (n := (n : ℤ)) (by omega)).injective + rw [Cocycle.toSingleMk_coe, Cochain.toSingleEquiv_toSingleMk] + change (mappedResolutionCocycle F P _).val.v (-(n : ℤ)) 0 (by omega) ≫ + (singleObjXSelf (.up ℤ) 0 (F.obj Y)).hom = _ + rw [mappedResolutionCocycle_v, Cocycle.toSingleMk_coe, Cochain.toSingleMk_v] + change ((mapResolutionCochainIso F P).hom.f (-(n : ℤ)) ≫ + F.map (((P.cochainComplexXIso (-(n : ℤ)) n rfl).hom ≫ f) ≫ + (singleObjXSelf (.up ℤ) 0 Y).inv) ≫ + ((singleMapHomologicalComplex F (.up ℤ) 0).hom.app Y).f 0) ≫ + (singleObjXSelf (.up ℤ) 0 (F.obj Y)).hom = _ + rw [singleMapHomologicalComplex_hom_app_self] + exact (map_eval_cancel F ((mapResolutionCochainIso F P).hom.f (-(n : ℤ))) + (P.cochainComplexXIso (-(n : ℤ)) n rfl).hom f + (singleObjXSelf (.up ℤ) 0 Y) (singleObjXSelf (.up ℤ) 0 (F.obj Y))).trans + (congrArg (fun g => g ≫ F.map f) (mapResolutionCochainIso_coordinate F P _ n rfl)) + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/NatResolutionCochain.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/NatResolutionCochain.lean new file mode 100644 index 0000000000000000000000000000000000000000..baebc14c86d27a6103f7d9debedc712d24aef1da --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/NatResolutionCochain.lean @@ -0,0 +1,84 @@ +import Mathlib.Algebra.Homology.HomotopyCategory.HomComplex +import Mathlib.CategoryTheory.Abelian.Projective.Extend +import OAI.Algebra.AuslanderReiten.BaseChange.ScalarExtensionComplete + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.ResolutionProducts +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +include k in +theorem intUnit_smul_charTwo [CharP k 2] {M : Type u} [AddCommGroup M] [Module k M] + (a : ℤˣ) (x : M) : a • x = x := by + rcases Int.units_eq_one_or a with rfl | rfl + · exact one_smul _ x + · change (-1 : ℤ) • x = x + rw [neg_one_zsmul] + have hx : x+x=0 := by + rw [← two_smul k x, show (2 : k)=0 from CharP.cast_eq_zero k 2, zero_smul] + exact (eq_neg_iff_add_eq_zero.mpr hx).symm + +variable {X Y : ModuleCat.{u} R} (P : ProjectiveResolution X) (Q : ProjectiveResolution Y) +variable (r : ℕ) (f : ∀ n : ℕ, P.complex.X (r+n) ⟶ Q.complex.X n) + +def natComparisonCochain : Cochain P.cochainComplex Q.cochainComplex (r : ℤ) := + Cochain.mk (fun p q hpq => if hq : q ≤ 0 then + let m := (-q).toNat + (P.cochainComplexXIso p (r+m) (by dsimp [m]; omega)).hom ≫ f m ≫ + (Q.cochainComplexXIso q m (by dsimp [m]; omega)).inv + else 0) + +theorem natComparisonCochain_v (m : ℕ) : + (natComparisonCochain P Q r f).v (-((r+m : ℕ) : ℤ)) (-(m : ℤ)) (by omega) = + (P.cochainComplexXIso (-((r+m : ℕ) : ℤ)) (r+m) rfl).hom ≫ f m ≫ + (Q.cochainComplexXIso (-(m : ℤ)) m rfl).inv := by + cases m <;> rfl + +theorem natComparisonCochain_v_of_eq (p : ℤ) (m : ℕ) (hp : p+(r : ℤ)=-(m : ℤ)) : + (natComparisonCochain P Q r f).v p (-(m : ℤ)) hp = + (P.cochainComplexXIso p (r+m) (by omega)).hom ≫ f m ≫ + (Q.cochainComplexXIso (-(m : ℤ)) m rfl).inv := by + cases m <;> rfl + +variable [CharP k 2] +variable (hf : ∀ n, f (n+1) ≫ Q.complex.d (n+1) n = + P.complex.d (r+(n+1)) (r+n) ≫ f n) +include hf k + +theorem natComparisonCochain_closed : + δ (r : ℤ) ((r : ℤ)+1) (natComparisonCochain P Q r f) = 0 := by + apply Cochain.ext + intro p q hpq + by_cases hq : q ≤ 0 + · obtain ⟨m,rfl⟩ := Int.exists_eq_neg_ofNat hq + have hp : p = -((r+(m+1) : ℕ) : ℤ) := by omega + subst p + rw [δ_v _ _ rfl _ _ _ hpq (-((m+1 : ℕ) : ℤ)) (-((r+m : ℕ) : ℤ)) + (by omega) (by omega)] + rw [natComparisonCochain_v P Q r f (m+1), natComparisonCochain_v P Q r f m] + rw [Q.cochainComplex_d _ _ (m+1) m rfl rfl, + P.cochainComplex_d _ _ (r+(m+1)) (r+m) rfl rfl] + rw [intUnit_smul_charTwo (k := k)] + simp only [Category.assoc, Iso.inv_hom_id_assoc, Cochain.zero_v] + rw [← Category.assoc (f (m+1)), hf m] + let z := (P.cochainComplexXIso (-((r+(m+1) : ℕ) : ℤ)) (r+(m+1)) rfl).hom ≫ + P.complex.d (r+(m+1)) (r+m) ≫ f m ≫ + (Q.cochainComplexXIso (-(m : ℤ)) m rfl).inv + change z+z=0 + rw [← two_smul k z, show (2 : k)=0 from CharP.cast_eq_zero k 2, zero_smul] + · exact (Q.cochainComplex.isZero_of_isStrictlyLE 0 q (by omega)).eq_of_tgt _ _ + +def natComparisonCocycle : Cocycle P.cochainComplex Q.cochainComplex (r : ℤ) := + Cocycle.mk (natComparisonCochain P Q r f) _ rfl + (natComparisonCochain_closed (k := k) P Q r f hf) + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/NatResolutionCubic.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/NatResolutionCubic.lean new file mode 100644 index 0000000000000000000000000000000000000000..b5edc24049955e73f542dabb5746191db0f28bbe --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/NatResolutionCubic.lean @@ -0,0 +1,65 @@ +import Mathlib.Algebra.Homology.HomotopyCategory.HomComplex +import Mathlib.CategoryTheory.Abelian.Projective.Extend +import OAI.Algebra.AuslanderReiten.BaseChange.ScalarExtensionComplete + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.ResolutionProducts +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable {X : ModuleCat.{u} R} (P : ProjectiveResolution X) +variable (f : ∀ n : ℕ, P.complex.X (n+3) ⟶ P.complex.X n) + +def natCubicCochain : Cochain P.cochainComplex P.cochainComplex 3 := + Cochain.mk (fun p q hpq => if hq : q ≤ 0 then + let m := (-q).toNat + (P.cochainComplexXIso p (m+3) (by dsimp [m]; omega)).hom ≫ f m ≫ + (P.cochainComplexXIso q m (by dsimp [m]; omega)).inv + else 0) + +theorem natCubicCochain_v (m : ℕ) : + (natCubicCochain P f).v (-((m+3 : ℕ) : ℤ)) (-(m : ℤ)) (by omega) = + (P.cochainComplexXIso (-((m+3 : ℕ) : ℤ)) (m+3) rfl).hom ≫ f m ≫ + (P.cochainComplexXIso (-(m : ℤ)) m rfl).inv := by + cases m <;> rfl + +variable [CharP k 2] +variable (hf : ∀ n, f (n+1) ≫ P.complex.d (n+1) n = + P.complex.d (n+4) (n+3) ≫ f n) + +include hf k + +theorem natCubicCochain_closed : δ 3 4 (natCubicCochain P f) = 0 := by + apply Cochain.ext + intro p q hpq + by_cases hq : q ≤ 0 + · obtain ⟨m,rfl⟩ := Int.exists_eq_neg_ofNat hq + have hp : p = -((m+4 : ℕ) : ℤ) := by omega + subst p + rw [δ_v 3 4 rfl _ _ _ hpq (-((m+1 : ℕ) : ℤ)) (-((m+3 : ℕ) : ℤ)) (by omega) (by omega)] + rw [natCubicCochain_v P f (m+1), natCubicCochain_v P f m] + rw [P.cochainComplex_d _ _ (m+1) m rfl rfl, + P.cochainComplex_d _ _ (m+4) (m+3) rfl rfl] + have hfour : (4 : ℤ).negOnePow = 1 := by decide + simp only [hfour, one_smul, Category.assoc, Iso.inv_hom_id_assoc, + Cochain.zero_v] + rw [← Category.assoc (f (m+1)), hf m] + let z := (P.cochainComplexXIso (-((m+4 : ℕ) : ℤ)) (m+4) rfl).hom ≫ + P.complex.d (m+4) (m+3) ≫ f m ≫ + (P.cochainComplexXIso (-(m : ℤ)) m rfl).inv + change z + z = 0 + rw [← two_smul k z, show (2 : k) = 0 from CharP.cast_eq_zero k 2, zero_smul] + · exact (P.cochainComplex.isZero_of_isStrictlyLE 0 q (by omega)).eq_of_tgt _ _ + +def natCubicCocycle : Cocycle P.cochainComplex P.cochainComplex 3 := + Cocycle.mk (natCubicCochain P f) 4 rfl (natCubicCochain_closed (k := k) P f hf) + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ProjectiveResolutionFunctor.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ProjectiveResolutionFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..37a77cbf3eb4c0e81823272008d7248b52eda46d --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ProjectiveResolutionFunctor.lean @@ -0,0 +1,27 @@ +import Mathlib.CategoryTheory.Abelian.Projective.Ext +import Mathlib.Algebra.Homology.DerivedCategory.Ext.Map + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits HomologicalComplex +namespace ArExplicit.ResolutionProducts +universe u v u' v' +variable {C : Type u} [Category.{v} C] [Abelian C] +variable {D : Type u'} [Category.{v'} D] [Abelian D] +variable (F : C ⥤ D) [F.Additive] [PreservesFiniteLimits F] [PreservesFiniteColimits F] +variable [F.PreservesProjectiveObjects] +variable {X : C} (P : ProjectiveResolution X) + +def mapResolution : ProjectiveResolution (F.obj X) where + complex := (F.mapHomologicalComplex (.down ℕ)).obj P.complex + projective n := F.projective_obj_of_projective (P.projective n) + π := (F.mapHomologicalComplex (.down ℕ)).map P.π ≫ + (singleMapHomologicalComplex F (.down ℕ) 0).hom.app X + quasiIso := by infer_instance + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/Resolution.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/Resolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..11a7443e44a8b2631daa7b7cb574053920bfc3d3 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/Resolution.lean @@ -0,0 +1,245 @@ +import OAI.Algebra.AuslanderReiten.Algebras.BaseAlgebra +import Mathlib.Algebra.Module.Projective +import Mathlib.Algebra.CharP.Two +import Mathlib.Algebra.Exact.Basic + +namespace OAI + +namespace ArExplicit.Resolution + +open ArExplicit.Letter ArExplicit.BaseAlgebra + +variable {k : Type*} [Field k] (q : k) + +local notation "C" => BaseAlgebra k q + +def fixedRight (p : C) : Submodule C C where + carrier := {a | a * p = a} + zero_mem' := zero_mul p + add_mem' {a b} ha hb := by + change a * p = a at ha + change b * p = b at hb + change (a + b) * p = a + b + rw [add_mul, ha, hb] + smul_mem' c a ha := by + change (c * a) * p = c * a + rw [mul_assoc, ha] + +def rightMultiply (p : C) : C →ₗ[C] C where + toFun a := a * p + map_add' a b := add_mul a b p + map_smul' c a := mul_assoc c a p + +def projection (p : C) (hp : p * p = p) : C →ₗ[C] fixedRight q p where + toFun a := ⟨a * p, by change (a * p) * p = a * p; rw [mul_assoc, hp]⟩ + map_add' a b := Subtype.ext (add_mul a b p) + map_smul' c a := Subtype.ext (mul_assoc c a p) + +theorem projection_surjective (p : C) (hp : p * p = p) : + Function.Surjective (projection q p hp) := by + intro a + exact ⟨a, Subtype.ext a.property⟩ + +theorem projective_fixedRight (p : C) (hp : p * p = p) : + Module.Projective C (fixedRight q p) := by + apply Module.Projective.of_split (fixedRight q p).subtype (projection q p hp) + apply LinearMap.ext + intro a + exact Subtype.ext a.property + +theorem finite_fixedRight (p : C) (hp : p * p = p) : + Module.Finite k (fixedRight q p) := + Module.Finite.of_surjective ((projection q p hp).restrictScalars k) + (projection_surjective q p hp) + +abbrev E : Submodule C C := fixedRight q (basisVector q e) + +abbrev F : Submodule C C := fixedRight q (basisVector q f) + +instance : Module.Projective C (E q) := + projective_fixedRight q _ (by simpa [multiplicationTable] using basis_mul q e e) +instance : Module.Projective C (F q) := + projective_fixedRight q _ (by simpa [multiplicationTable] using basis_mul q f f) + +instance : Module.Finite k (E q) := + finite_fixedRight q _ (by simpa [multiplicationTable] using basis_mul q e e) +instance : Module.Finite k (F q) := + finite_fixedRight q _ (by simpa [multiplicationTable] using basis_mul q f f) + +def rightBetween (p r z : C) (hz : z * r = z) : + fixedRight q p →ₗ[C] fixedRight q r where + toFun a := ⟨(a : C) * z, by change ((a : C) * z) * r = (a : C) * z; rw [mul_assoc, hz]⟩ + map_add' a b := Subtype.ext (add_mul (a : C) (b : C) z) + map_smul' c a := Subtype.ext (mul_assoc c (a : C) z) + +def ell (r : k) : C := basisVector q x + r • basisVector q y + +@[simp] theorem ell_right_e (r : k) : ell q r * basisVector q e = ell q r := by + simp [ell, add_mul, basis_mul, multiplicationTable] + +def dU : E q →ₗ[C] F q := + rightBetween q _ _ (basisVector q u) + (by simpa [multiplicationTable] using basis_mul q u f) + +def dEll (r : k) : E q →ₗ[C] E q := rightBetween q _ _ (ell q r) (ell_right_e q r) + +@[simp] theorem coe_dU (a : E q) : (dU q a : C) = (a : C) * basisVector q u := rfl +@[simp] theorem coe_dEll (r : k) (a : E q) : (dEll q r a : C) = (a : C) * ell q r := rfl + +private theorem E_coeff_zero (a : E q) (i : Letter) + (hi : i = u ∨ i = v ∨ i = f ∨ i = n) : (a : C).coeff i = 0 := by + have h := congrArg (fun b : C => b.coeff i) a.property + rcases hi with rfl | rfl | rfl | rfl <;> simpa [product] using h.symm + +@[simp] theorem E_coeff_u (a : E q) : (a : C).coeff u = 0 := E_coeff_zero q a u (by simp) +@[simp] theorem E_coeff_v (a : E q) : (a : C).coeff v = 0 := E_coeff_zero q a v (by simp) +@[simp] theorem E_coeff_f (a : E q) : (a : C).coeff f = 0 := E_coeff_zero q a f (by simp) +@[simp] theorem E_coeff_n (a : E q) : (a : C).coeff n = 0 := E_coeff_zero q a n (by simp) + +theorem E_expand (a : E q) : (a : C) = + (a : C).coeff e • basisVector q e + (a : C).coeff x • basisVector q x + + (a : C).coeff y • basisVector q y + (a : C).coeff z • basisVector q z + + (a : C).coeff t • basisVector q t + (a : C).coeff j • basisVector q j := by + ext i + cases i <;> simp + +theorem mul_u_formula (a : E q) : (a : C) * basisVector q u = + (a : C).coeff e • basisVector q u + + ((a : C).coeff x + (a : C).coeff y) • basisVector q v + + ((1 + q) * (a : C).coeff t) • basisVector q n := by + ext i + cases i <;> simp [product] + +theorem mul_ell_formula (r : k) (a : E q) : (a : C) * ell q r = + (a : C).coeff e • ell q r + + (q * r * (a : C).coeff x + (a : C).coeff y) • basisVector q z + + ((1 + q ^ 2 * r) * (a : C).coeff t) • basisVector q j := by + ext i + cases i <;> simp [product, ell] <;> ring + +section CharacteristicTwo + +variable [CharP k 2] + +theorem mul_u_eq_zero_iff (hq : 1 + q ≠ 0) (a : E q) : + (a : C) * basisVector q u = 0 ↔ + (a : C).coeff e = 0 ∧ (a : C).coeff t = 0 ∧ (a : C).coeff y = (a : C).coeff x := by + rw [mul_u_formula] + constructor + · intro h + have he := congrArg (fun b : C => b.coeff u) h + have ht := congrArg (fun b : C => b.coeff n) h + have hy := congrArg (fun b : C => b.coeff v) h + simp only [coeff_add, coeff_smul, coeff_basisVector, coeff_zero] at he ht hy + simp only [reduceCtorEq, ↓reduceIte, mul_zero, mul_one, add_zero, zero_add] at he ht hy + exact ⟨he, (mul_eq_zero.mp ht).resolve_left hq, (CharTwo.add_eq_zero.mp hy).symm⟩ + · rintro ⟨he, ht, hy⟩ + simp [he, ht, hy, CharTwo.add_self_eq_zero] + +theorem mul_ell_eq_zero_iff (r : k) (hr : 1 + q ^ 2 * r ≠ 0) (a : E q) : + (a : C) * ell q r = 0 ↔ + (a : C).coeff e = 0 ∧ (a : C).coeff t = 0 ∧ + (a : C).coeff y = q * r * (a : C).coeff x := by + rw [mul_ell_formula] + constructor + · intro h + have he := congrArg (fun b : C => b.coeff x) h + have ht := congrArg (fun b : C => b.coeff j) h + have hy := congrArg (fun b : C => b.coeff z) h + simp [ell] at he ht hy + exact ⟨he, ht.resolve_left hr, (CharTwo.add_eq_zero.mp hy).symm⟩ + · rintro ⟨he, ht, hy⟩ + simp [he, ht, hy, CharTwo.add_self_eq_zero] + +end CharacteristicTwo + +def ellPreimage (r α β γ : k) : E q := + ⟨α • basisVector q e + β • basisVector q y + (γ / (1 + q ^ 2 * r)) • basisVector q t, by + change (_ : C) * basisVector q e = _ + simp [add_mul, basis_mul, multiplicationTable]⟩ + +theorem ellPreimage_spec (r α β γ : k) (hr : 1 + q ^ 2 * r ≠ 0) : + (ellPreimage q r α β γ : C) * ell q r = + α • ell q r + β • basisVector q z + γ • basisVector q j := by + rw [mul_ell_formula] + have hγ : (1 + q ^ 2 * r) * (γ / (1 + q ^ 2 * r)) = γ := by + rw [mul_comm, div_mul_cancel₀ γ hr] + simp [ellPreimage, hγ] + +section Exactness + +variable [CharP k 2] + +theorem uKernel_expand (hq : 1 + q ≠ 0) (a : E q) + (ha : (a : C) * basisVector q u = 0) : + (a : C) = (a : C).coeff x • ell q 1 + + (a : C).coeff z • basisVector q z + (a : C).coeff j • basisVector q j := by + obtain ⟨he, ht, hy⟩ := (mul_u_eq_zero_iff q hq a).mp ha + ext i + cases i <;> simp [ell, he, ht, hy] + +theorem ellKernel_expand (r : k) (hr : 1 + q ^ 2 * r ≠ 0) (a : E q) + (ha : (a : C) * ell q r = 0) : + (a : C) = (a : C).coeff x • ell q (q * r) + + (a : C).coeff z • basisVector q z + (a : C).coeff j • basisVector q j := by + obtain ⟨he, ht, hy⟩ := (mul_ell_eq_zero_iff q r hr a).mp ha + ext i + cases i <;> simp [ell, he, ht, hy] + ring + +@[simp] theorem ell_one_mul_u : ell q 1 * basisVector q u = 0 := by + ext i + cases i <;> simp [ell, product, CharTwo.add_self_eq_zero] + +@[simp] theorem ell_successor_mul (r : k) : ell q (q * r) * ell q r = 0 := by + ext i + cases i <;> simp [ell, product, CharTwo.add_self_eq_zero] + +theorem dU_comp_dEll_one : (dU q).comp (dEll q 1) = 0 := by + apply LinearMap.ext + intro a + apply Subtype.ext + change ((a : C) * ell q 1) * basisVector q u = 0 + rw [mul_assoc, ell_one_mul_u, mul_zero] + +theorem dEll_comp_successor (r : k) : (dEll q r).comp (dEll q (q * r)) = 0 := by + apply LinearMap.ext + intro a + apply Subtype.ext + change ((a : C) * ell q (q * r)) * ell q r = 0 + rw [mul_assoc, ell_successor_mul, mul_zero] + +theorem exact_dU (hq : 1 + q ≠ 0) (hq2 : 1 + q ^ 2 ≠ 0) : + Function.Exact (dEll q 1) (dU q) := by + intro a + constructor + · intro ha + have ha' : (a : C) * basisVector q u = 0 := congrArg Subtype.val ha + refine ⟨ellPreimage q 1 ((a : C).coeff x) ((a : C).coeff z) ((a : C).coeff j), ?_⟩ + apply Subtype.ext + change (_ : C) * ell q 1 = (a : C) + rw [ellPreimage_spec q 1 _ _ _ (by simpa using hq2)] + exact (uKernel_expand q hq a ha').symm + · rintro ⟨b, rfl⟩ + exact DFunLike.congr_fun (dU_comp_dEll_one q) b + +theorem exact_dEll (r : k) (hr : 1 + q ^ 2 * r ≠ 0) + (hnext : 1 + q ^ 2 * (q * r) ≠ 0) : + Function.Exact (dEll q (q * r)) (dEll q r) := by + intro a + constructor + · intro ha + have ha' : (a : C) * ell q r = 0 := congrArg Subtype.val ha + refine ⟨ellPreimage q (q * r) ((a : C).coeff x) ((a : C).coeff z) ((a : C).coeff j), ?_⟩ + apply Subtype.ext + change (_ : C) * ell q (q * r) = (a : C) + rw [ellPreimage_spec q (q * r) _ _ _ hnext] + exact (ellKernel_expand q r hr a ha').symm + · rintro ⟨b, rfl⟩ + exact DFunLike.congr_fun (dEll_comp_successor q r) b + +end Exactness + +end ArExplicit.Resolution + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionCokernel.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionCokernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..758b9afad841d46968a18f99bed03eeba0c5fda2 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionCokernel.lean @@ -0,0 +1,33 @@ +import Mathlib.CategoryTheory.Abelian.Projective.Resolution +import Mathlib.Algebra.Homology.ShortComplex.ModuleCat +import Mathlib.Algebra.Category.ModuleCat.Projective + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory CategoryTheory.Limits +universe u +variable {R : Type u} [Ring R] {M : ModuleCat.{u} R} +variable (P : ProjectiveResolution M) + +theorem resolution_range_eq_ker : + LinearMap.range (P.complex.d 1 0).hom = LinearMap.ker (P.π.f 0).hom := by + have h := P.exact₀ + rw [ShortComplex.moduleCat_exact_iff_range_eq_ker] at h + exact h + +def resolutionCokernelEquiv : + (P.complex.X 0 ⧸ LinearMap.range (P.complex.d 1 0).hom) ≃ₗ[R] M := + (Submodule.quotEquivOfEq _ _ (resolution_range_eq_ker P)).trans + ((P.π.f 0).hom.quotKerEquivOfSurjective + ((ModuleCat.epi_iff_surjective (P.π.f 0)).mp inferInstance)) + +theorem resolutionCokernelEquiv_mk (x : P.complex.X 0) : + resolutionCokernelEquiv P (Submodule.Quotient.mk x) = (P.π.f 0).hom x := rfl + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionCoverExt.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionCoverExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..6898d15936fdd7485dd1fbac414f1e2669b1460b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionCoverExt.lean @@ -0,0 +1,30 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionExtSquare + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +namespace ArExplicit +universe u v +variable {C : Type u} [Category.{v} C] [Abelian C] [HasExt.{v} C] +variable {k : Type v} [CommRing k] [Linear k C] +variable {B S N : C} (P : ProjectiveResolution B) (Q : ProjectiveResolution N) + +theorem resolutionExt_cover_conjugate (e : B ≅ S) (j : S ≅ N) + (φ : ProjectiveResolution.Hom P Q (e.hom ≫ j.hom)) (n : ℕ) + (f : P.complex.X n ⟶ S) (g : Q.complex.X n ⟶ N) + (hf : P.complex.d (n+1) n ≫ f = 0) (hg : Q.complex.d (n+1) n ≫ g = 0) + (h : φ.hom.f n ≫ g = f ≫ j.hom) : + selfExtIso (k := k) j n ((Ext.mk₀ e.inv).comp + (P.extMk f (n+1) rfl hf) (zero_add _)) = Q.extMk g (n+1) rfl hg := by + apply selfExtIso_eq_of_square + have he := resolutionExt_square P Q (e.hom ≫ j.hom) j.hom φ n f g hf hg h + have hh := congrArg (fun z => (Ext.mk₀ e.inv).comp z (zero_add n)) he + rw [Ext.mk₀_comp_mk₀_assoc, Iso.inv_hom_id_assoc] at hh + simpa only [Ext.comp_assoc_of_third_deg_zero] using hh + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionCubicConjugate.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionCubicConjugate.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b00894c2879ded394e0a020b22c154eb823e821 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionCubicConjugate.lean @@ -0,0 +1,48 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionCoverExt +import OAI.Algebra.AuslanderReiten.Ext.NatCubicExt + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +namespace ArExplicit +universe u + +private theorem cubicAugmentedSquare {C : Type*} [Category C] + {P₃ P₀ Q₃ Q₀ B S N : C} + (φ₃ : P₃ ⟶ Q₃) (φ₀ : P₀ ⟶ Q₀) (p : P₃ ⟶ P₀) (q : Q₃ ⟶ Q₀) + (π : P₀ ⟶ B) (ρ : Q₀ ⟶ N) (e : B ⟶ S) (j : S ⟶ N) (f : P₃ ⟶ S) + (hφ : φ₀ ≫ ρ = π ≫ (e ≫ j)) (hc : p ≫ φ₀ = φ₃ ≫ q) + (hf : f = p ≫ π ≫ e) : + φ₃ ≫ (q ≫ ρ) = f ≫ j := by + rw [← Category.assoc, ← hc, Category.assoc, hφ, hf] + simp only [Category.assoc] + +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [CharP k 2] +variable [HasDerivedCategory (ModuleCat.{u} R)] +variable {B S N : ModuleCat.{u} R} + +theorem resolutionExt_cubic_conjugate + (P : ProjectiveResolution B) (Q : ProjectiveResolution N) + (e : B ≅ S) (j : S ≅ N) + (φ : ProjectiveResolution.Hom P Q (e.hom ≫ j.hom)) + (p : P.complex.X 3 ⟶ P.complex.X 0) + (q : ∀ n : ℕ, Q.complex.X (n+3) ⟶ Q.complex.X n) + (hq : ∀ n, q (n+1) ≫ Q.complex.d (n+1) n = + Q.complex.d (n+4) (n+3) ≫ q n) + (f : P.complex.X 3 ⟶ S) (hf : P.complex.d 4 3 ≫ f = 0) + (hfc : f = p ≫ P.π.f 0 ≫ e.hom) + (hc : p ≫ φ.hom.f 0 = φ.hom.f 3 ≫ q 0) : + selfExtIso (k := k) j 3 ((Ext.mk₀ e.inv).comp + (P.extMk f 4 rfl hf) (zero_add _)) = + ResolutionProducts.endExt Q (ResolutionProducts.natCubicCocycle (k := k) Q q hq) := by + rw [ResolutionProducts.natCubic_endExt_eq] + apply resolutionExt_cover_conjugate P Q e j φ 3 f (q 0 ≫ Q.π.f 0) hf + (ResolutionProducts.natCubic_augmented_cycle Q q hq) + exact cubicAugmentedSquare _ _ _ _ _ _ _ _ _ φ.hom_f_zero_comp_π_f_zero hc hfc + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionEndpointIso.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionEndpointIso.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb9946dede38f2b08eee0ec12eb336b75a8f010d --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionEndpointIso.lean @@ -0,0 +1,70 @@ +import Mathlib.CategoryTheory.Abelian.Projective.Resolution + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits +namespace ArExplicit.ResolutionProducts +universe u v +variable {C : Type u} [Category.{v} C] [Abelian C] +variable {X Y Z : C} +variable (P : ProjectiveResolution X) (Q : ProjectiveResolution Y) + +omit [Abelian C] in +private theorem compose_square {A B D X Y Z : C} + (p : A ⟶ X) (q : B ⟶ Y) (r : D ⟶ Z) + (f : A ⟶ B) (g : B ⟶ D) (a : X ⟶ Y) (b : Y ⟶ Z) (c : X ⟶ Z) + (hp : p ≫ a = f ≫ q) (hq : q ≫ b = g ≫ r) (hc : p ≫ c = (f ≫ g) ≫ r) : + p ≫ c = p ≫ a ≫ b := by + calc + p ≫ c = (f ≫ g) ≫ r := hc + _ = f ≫ g ≫ r := Category.assoc _ _ _ + _ = f ≫ q ≫ b := congrArg (fun z => f ≫ z) hq.symm + _ = (f ≫ q) ≫ b := (Category.assoc _ _ _).symm + _ = (p ≫ a) ≫ b := congrArg (fun z => z ≫ b) hp.symm + _ = p ≫ a ≫ b := Category.assoc _ _ _ + +def resolutionEndpointMap (f : P.complex ⟶ Q.complex) : X ⟶ Y := + P.isColimitCokernelCofork.desc (CokernelCofork.ofπ (f.f 0 ≫ Q.π.f 0) (by + rw [← Category.assoc, ← f.comm 1 0, Category.assoc, + Q.complex_d_comp_π_f_zero, comp_zero])) + +@[reassoc] theorem resolutionEndpointMap_augmentation (f : P.complex ⟶ Q.complex) : + P.π.f 0 ≫ resolutionEndpointMap P Q f = f.f 0 ≫ Q.π.f 0 := + Cofork.IsColimit.π_desc P.isColimitCokernelCofork + +theorem resolutionEndpointMap_id : resolutionEndpointMap P P (𝟙 _) = 𝟙 X := by + apply (cancel_epi (P.π.f 0)).1 + erw [resolutionEndpointMap_augmentation] + exact (Category.id_comp _).trans (Category.comp_id _).symm + +theorem resolutionEndpointMap_comp (T : ProjectiveResolution Z) + (f : P.complex ⟶ Q.complex) (g : Q.complex ⟶ T.complex) : + resolutionEndpointMap P T (f ≫ g) = resolutionEndpointMap P Q f ≫ resolutionEndpointMap Q T g := by + apply (cancel_epi (P.π.f 0)).1 + exact compose_square (show P.complex.X 0 ⟶ X from P.π.f 0) + (show Q.complex.X 0 ⟶ Y from Q.π.f 0) (show T.complex.X 0 ⟶ Z from T.π.f 0) + (f.f 0) (g.f 0) _ _ _ (resolutionEndpointMap_augmentation P Q f) + (resolutionEndpointMap_augmentation Q T g) (resolutionEndpointMap_augmentation P T (f ≫ g)) + +def resolutionEndpointIso (e : P.complex ≅ Q.complex) : X ≅ Y where + hom := resolutionEndpointMap P Q e.hom + inv := resolutionEndpointMap Q P e.inv + hom_inv_id := by erw [← resolutionEndpointMap_comp, e.hom_inv_id, resolutionEndpointMap_id] + inv_hom_id := by erw [← resolutionEndpointMap_comp, e.inv_hom_id, resolutionEndpointMap_id] + +@[reassoc] theorem resolutionEndpointIso_augmentation (e : P.complex ≅ Q.complex) : + P.π.f 0 ≫ (resolutionEndpointIso P Q e).hom = e.hom.f 0 ≫ Q.π.f 0 := + resolutionEndpointMap_augmentation P Q e.hom + +theorem resolutionEndpointIso_hom_unique (e : P.complex ≅ Q.complex) (a : X ⟶ Y) + (ha : P.π.f 0 ≫ a = e.hom.f 0 ≫ Q.π.f 0) : + (resolutionEndpointIso P Q e).hom = a := by + apply (cancel_epi (P.π.f 0)).1 + erw [resolutionEndpointIso_augmentation, ha] + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtAction.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..6c40c1fbc8f6b90defaa5138ffeba41687cb66eb --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtAction.lean @@ -0,0 +1,60 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionProductCompatibility + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.ResolutionProducts +universe u v +variable {C : Type u} [Category.{v} C] [Abelian C] [HasDerivedCategory C] + +def conjugateTo {X X' Y Y' : DerivedCategory C} (e : X ≅ X') (t : Y ≅ Y') + {n : ℤ} (f : ShiftedHom X Y n) : ShiftedHom X' Y' n := + e.inv ≫ f ≫ (CategoryTheory.shiftFunctor (DerivedCategory C) n).map t.hom + +theorem conjugateTo_comp {X X' Y Y' Z Z' : DerivedCategory C} + (e : X ≅ X') (t : Y ≅ Y') (w : Z ≅ Z') + {n m r : ℤ} (f : ShiftedHom X Y n) (g : ShiftedHom Y Z m) (h : m+n=r) : + conjugateTo e w (f.comp g h) = (conjugateTo e t f).comp (conjugateTo t w g) h := by + simp only [conjugateTo, ShiftedHom.comp, Functor.map_comp, Category.assoc] + rw [← Category.assoc ((CategoryTheory.shiftFunctor (DerivedCategory C) n).map t.hom), + ← Functor.map_comp, t.hom_inv_id, CategoryTheory.Functor.map_id, Category.id_comp] + exact congrArg (fun z => e.inv ≫ f ≫ + (CategoryTheory.shiftFunctor (DerivedCategory C) n).map g ≫ z) + ((CategoryTheory.shiftFunctorAdd' (DerivedCategory C) m n r h).inv.naturality w.hom).symm + +variable [HasExt.{v} C] + +def extOfCocycle {X Y : C} (P : ProjectiveResolution X) {n : ℕ} + (y : Cocycle P.cochainComplex ((CochainComplex.singleFunctor C 0).obj Y) (n : ℤ)) : + Ext X Y n := P.extEquivCohomologyClass.symm (CohomologyClass.mk y) + +theorem extOfCocycle_hom {X Y : C} (P : ProjectiveResolution X) {n : ℕ} + (y : Cocycle P.cochainComplex ((CochainComplex.singleFunctor C 0).obj Y) (n : ℤ)) : + (extOfCocycle P y).hom = conjugateTo (resolutionIso P) + ((DerivedCategory.singleFunctorIsoCompQ C 0).symm.app Y) + (ShiftedHom.map (Cocycle.equivHomShift.symm y) DerivedCategory.Q) := by + rw [extOfCocycle, P.extEquivCohomologyClass_symm_mk_hom] + simp only [conjugateTo, resolutionIso, Iso.trans_inv, asIso_inv, + ShiftedHom.mk₀_comp, ShiftedHom.comp_mk₀, Category.assoc] + rfl + +theorem endExt_comp_extOfCocycle {X Y : C} (P : ProjectiveResolution X) {n m r : ℕ} + (x : Cocycle P.cochainComplex P.cochainComplex (n : ℤ)) + (y : Cocycle P.cochainComplex ((CochainComplex.singleFunctor C 0).obj Y) (m : ℤ)) + (z : Cocycle P.cochainComplex ((CochainComplex.singleFunctor C 0).obj Y) (r : ℤ)) + (h : n+m=r) (hz : z.val=x.val.comp y.val (by omega)) : + (endExt P x).comp (extOfCocycle P y) h = extOfCocycle P z := by + apply Ext.homEquiv.injective + change ((endExt P x).comp (extOfCocycle P y) h).hom = (extOfCocycle P z).hom + rw [Ext.comp_hom, endExt_hom, extOfCocycle_hom, extOfCocycle_hom, + cocycleHom_comp (by omega) x y z hz, ShiftedHom.map_comp] + exact (conjugateTo_comp (resolutionIso P) (resolutionIso P) + ((DerivedCategory.singleFunctorIsoCompQ C 0).symm.app Y) _ _ _).symm + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtIdentity.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ef171374b6f69e9fbc78548dc729bdd139e22de --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtIdentity.lean @@ -0,0 +1,59 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionProductCompatibility + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.ResolutionProducts +universe u v +variable {C : Type u} [Category.{v} C] [Abelian C] + +theorem cocycleHom_ofHom {K L : CochainComplex C ℤ} (f : K ⟶ L) : + Cocycle.equivHomShift.symm (Cocycle.ofHom f) = ShiftedHom.mk₀ 0 rfl f := by + apply HomologicalComplex.Hom.ext + funext i + simp only [CompleteComparison.cocycleHom_component, Cocycle.ofHom_coe] + simp only [ShiftedHom.mk₀, HomologicalComplex.comp_f, CategoryTheory.shiftFunctorZero', + eqToIso_refl, Iso.trans_inv, Iso.refl_inv, + CochainComplex.shiftFunctorZero_inv_app_f, Category.comp_id] + change (Cochain.ofHom f).v i (i+0) rfl = + f.f i ≫ (L.XIsoOfEq (show i=i+0 by omega)).hom + simpa only [Cochain.ofHom_v] using + (Cochain.v_comp_XIsoOfEq_hom (Cochain.ofHom f) i i (i+0) (add_zero i) (by omega)).symm + +variable [HasDerivedCategory C] [HasExt.{v} C] + +theorem endExt_identity {X : C} (P : ProjectiveResolution X) : + endExt P (Cocycle.ofHom (𝟙 P.cochainComplex)) = Ext.mk₀ (𝟙 X) := by + apply Ext.homEquiv.injective + change (endExt P (Cocycle.ofHom (𝟙 P.cochainComplex))).hom = (Ext.mk₀ (𝟙 X)).hom + rw [endExt_hom, cocycleHom_ofHom, Ext.mk₀_hom] + erw [ShiftedHom.map_mk₀] + simp [conjugate, ShiftedHom.mk₀, ← NatTrans.naturality] + +theorem extMk_augmentation {X : C} (P : ProjectiveResolution X) : + P.extMk (Y := X) (P.π.f 0) 1 rfl P.complex_d_comp_π_f_zero = Ext.mk₀ (𝟙 X) := by + rw [← endExt_identity P, endExt_eq_augmented] + unfold ProjectiveResolution.extMk + apply congrArg P.extEquivCohomologyClass.symm + apply congrArg CohomologyClass.mk + apply Subtype.ext + apply (Cochain.toSingleEquiv (show (0 : ℤ)+0=0 by omega)).injective + change (Cochain.toSingleMk ((P.cochainComplexXIso 0 0 rfl).hom ≫ P.π.f 0) + (by omega : (0 : ℤ)+0=0)).v 0 0 (by omega) ≫ + (HomologicalComplex.singleObjXSelf (.up ℤ) 0 X).hom = + ((Cochain.ofHom (𝟙 P.cochainComplex)).comp (Cochain.ofHom P.π') (add_zero 0)).v 0 0 + (by omega) ≫ (HomologicalComplex.singleObjXSelf (.up ℤ) 0 X).hom + rw [Cochain.id_comp, Cochain.ofHom_v, Cochain.toSingleMk_v, P.π'_f_zero] + dsimp only [ChainComplex.single₀_obj_zero] + exact congrArg (fun morphism => + morphism ≫ (HomologicalComplex.singleObjXSelf (.up ℤ) 0 X).hom) + (Category.assoc (P.cochainComplexXIso 0 0 rfl).hom (P.π.f 0) + (HomologicalComplex.singleObjXSelf (.up ℤ) 0 X).inv) + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtSquare.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtSquare.lean new file mode 100644 index 0000000000000000000000000000000000000000..235676be58a38f83e143f0d1bf3b431f2e2ed509 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtSquare.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.Ext.NatCubicExt +import OAI.Algebra.AuslanderReiten.Ext.ExtIsoCongr +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorScalarProducts +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorScalarIso + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +namespace ArExplicit +universe u v +section General +variable {C : Type u} [Category.{v} C] [Abelian C] [HasExt.{v} C] +variable {X X' Y Y' : C} (P : ProjectiveResolution X) (Q : ProjectiveResolution X') + +theorem resolutionExt_square (a : X ⟶ X') (b : Y ⟶ Y') + (φ : ProjectiveResolution.Hom P Q a) (n : ℕ) + (f : P.complex.X n ⟶ Y) (g : Q.complex.X n ⟶ Y') + (hf : P.complex.d (n+1) n ≫ f = 0) (hg : Q.complex.d (n+1) n ≫ g = 0) + (h : φ.hom.f n ≫ g = f ≫ b) : + (Ext.mk₀ a).comp (Q.extMk g (n+1) rfl hg) (zero_add _) = + (P.extMk f (n+1) rfl hf).comp (Ext.mk₀ b) (add_zero _) := by + rw [ProjectiveResolution.mk₀_comp_extMk g (n+1) rfl hg φ, + ProjectiveResolution.extMk_comp_mk₀] + congr 1 + +theorem selfExtIso_eq_of_square {k : Type v} [CommRing k] [Linear k C] + (e : X ≅ X') {n : ℕ} (x : Ext X X n) (y : Ext X' X' n) + (h : (Ext.mk₀ e.hom).comp y (zero_add _) = x.comp (Ext.mk₀ e.hom) (add_zero _)) : + selfExtIso (k := k) e n x = y := by + rw [selfExtIso_apply, Ext.comp_assoc_of_third_deg_zero, ← h, + Ext.mk₀_comp_mk₀_assoc, e.inv_hom_id, Ext.mk₀_id_comp] +end General + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtZero.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7e58f770bf01a2acc9938bf8ae86a3620cfbd7b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionExtZero.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionHomology +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionExtIdentity + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian CategoryTheory.Limits +namespace ArExplicit.ResolutionHomology +universe u v +variable {C : Type u} [Category.{v} C] [Abelian C] [HasExt.{v} C] +variable {X Y : C} (P : ProjectiveResolution X) + +theorem extMk_zeroDegree_eq_zero_iff (f : P.complex.X 0 ⟶ Y) + (hf : P.complex.d 1 0 ≫ f = 0) : P.extMk f 1 rfl hf = 0 ↔ f = 0 := by + let := HasDerivedCategory.standard C + obtain ⟨g,hg⟩ := CokernelCofork.IsColimit.desc' P.isColimitCokernelCofork f hf + change X ⟶ Y at g + change P.π.f 0 ≫ g = f at hg + have he : P.extMk (P.π.f 0 ≫ g) 1 rfl + (by erw [← Category.assoc, P.complex_d_comp_π_f_zero, zero_comp]) = Ext.mk₀ g := by + erw [← P.extMk_comp_mk₀ (P.π.f 0) 1 rfl P.complex_d_comp_π_f_zero g, + ResolutionProducts.extMk_augmentation, Ext.mk₀_id_comp] + rfl + have he' : P.extMk f 1 rfl hf = Ext.mk₀ g := by simpa only [hg] using he + constructor + · intro hz + have hg0 : g=0 := Ext.homEquiv₀.symm.injective (by + change Ext.mk₀ g = Ext.mk₀ (0 : X ⟶ Y) + erw [← he', hz, Ext.mk₀_zero]) + erw [← hg, hg0, comp_zero] + · intro hz + cases hz + exact P.extMk_zero 1 rfl + +end ArExplicit.ResolutionHomology + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionHomology.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b5b0d3a26855c1bacb7fbb0f4c415a35a96cb52 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionHomology.lean @@ -0,0 +1,72 @@ +import OAI.Algebra.AuslanderReiten.Duality.LinearHomologyDuality +import Mathlib.CategoryTheory.Abelian.Projective.Ext +import Mathlib.Algebra.Homology.DerivedCategory.Ext.Linear + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +namespace ArExplicit.ResolutionHomology +universe u v w +variable {k : Type v} [Field k] +variable {C : Type u} [Category.{v} C] [Abelian C] [Linear k C] +variable {X Y : C} (P : ProjectiveResolution X) + +def differential (n : ℕ) : (P.complex.X n ⟶ Y) →ₗ[k] (P.complex.X (n + 1) ⟶ Y) where + toFun f := P.complex.d (n + 1) n ≫ f + map_add' f g := by simp only [Preadditive.comp_add] + map_smul' a f := by simp only [Linear.comp_smul, RingHom.id_apply] + +@[simp] theorem differential_apply (n : ℕ) (f : P.complex.X n ⟶ Y) : + differential (k := k) P n f = P.complex.d (n + 1) n ≫ f := rfl + +theorem differential_comp (n : ℕ) : + (differential (k := k) (Y := Y) P (n + 1)).comp (differential P n) = 0 := by + ext f + change P.complex.d (n + 2) (n + 1) ≫ (P.complex.d (n + 1) n ≫ f) = 0 + rw [← Category.assoc, P.complex.d_comp_d, Limits.zero_comp] + +variable [HasExt.{w} C] + +theorem extMk_smul (n : ℕ) (f : P.complex.X n ⟶ Y) + (hf : P.complex.d (n + 1) n ≫ f = 0) (a : k) : + P.extMk (a • f) (n + 1) rfl (by simp [hf]) = a • P.extMk f (n + 1) rfl hf := by + rw [Ext.smul_eq_comp_mk₀, P.extMk_comp_mk₀] + congr 1 + simp + +def cyclesToExt (n : ℕ) : + LinearMap.ker (differential (k := k) (Y := Y) P (n + 1)) →ₗ[k] Ext X Y (n + 1) where + toFun f := P.extMk f.val (n + 2) rfl f.property + map_add' f g := (P.add_extMk f.val g.val _ rfl f.property g.property).symm + map_smul' a f := extMk_smul P (n + 1) f.val f.property a + +theorem cyclesToExt_surjective (n : ℕ) : + Function.Surjective (cyclesToExt (k := k) (Y := Y) P n) := by + intro a + obtain ⟨f, hf, hfa⟩ := P.extMk_surjective a (n + 2) rfl + exact ⟨⟨f, hf⟩, hfa⟩ + +theorem cyclesToExt_kernel (n : ℕ) : + LinearMap.ker (cyclesToExt (k := k) (Y := Y) P n) = + LinearHomology.boundaries (differential P n) (differential P (n + 1)) (differential_comp P n) := by + ext x + constructor + · intro hx + obtain ⟨f, hf⟩ := (P.extMk_eq_zero_iff x.val (n + 2) rfl x.property n rfl).mp hx + exact ⟨f, Subtype.ext hf⟩ + · rintro ⟨f, hfx⟩ + apply (P.extMk_eq_zero_iff x.val (n + 2) rfl x.property n rfl).mpr + exact ⟨f, congrArg Subtype.val hfx⟩ + +def extEquiv (n : ℕ) : + LinearHomology.Homology (differential (k := k) (Y := Y) P n) + (differential P (n + 1)) (differential_comp P n) ≃ₗ[k] Ext X Y (n + 1) := + (Submodule.quotEquivOfEq _ _ (cyclesToExt_kernel P n).symm).trans + ((cyclesToExt P n).quotKerEquivOfSurjective (cyclesToExt_surjective P n)) + +end ArExplicit.ResolutionHomology + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionProductCompatibility.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionProductCompatibility.lean new file mode 100644 index 0000000000000000000000000000000000000000..a173552c9a6529057193ede07890b0587469c224 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionProductCompatibility.lean @@ -0,0 +1,68 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionProducts + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.ResolutionProducts +universe u v +variable {C : Type u} [Category.{v} C] [Abelian C] [HasDerivedCategory C] + +theorem conjugate_comp_of_eq {X Y : DerivedCategory C} (e : X ≅ Y) + {n m r : ℤ} (f : ShiftedHom X X n) (g : ShiftedHom X X m) (h : m+n=r) : + conjugate e (f.comp g h) = (conjugate e f).comp (conjugate e g) h := by + obtain rfl : r=n+m := by omega + exact conjugate_comp e f g + +omit [HasDerivedCategory C] in +theorem cocycleHom_comp {K L M : CochainComplex C ℤ} {i j l : ℤ} (hl : i+j=l) + (x : Cocycle K L i) (y : Cocycle L M j) (z : Cocycle K M l) + (hz : z.val = x.val.comp y.val hl) : + Cocycle.equivHomShift.symm z = + ShiftedHom.comp (Cocycle.equivHomShift.symm x) (Cocycle.equivHomShift.symm y) (by omega) := by + subst l + have he : z = CompleteComparison.cocycleProduct x y := Subtype.ext hz + subst z + exact CompleteComparison.cocycleHom_product x y + +def natCocycleProduct {K L M : CochainComplex C ℤ} {n m : ℕ} + (x : Cocycle K L (n : ℤ)) (y : Cocycle L M (m : ℤ)) : + Cocycle K M ((n+m : ℕ) : ℤ) := + Cocycle.mk (x.val.comp y.val (by omega)) _ rfl (by + rw [δ_comp x.val y.val (by omega) ((n : ℤ)+1) ((m : ℤ)+1) + (((n+m : ℕ) : ℤ)+1) rfl rfl rfl] + simp) + +variable [HasExt.{v} C] + +theorem endExt_product {X : C} (P : ProjectiveResolution X) {n m : ℕ} + (x : Cocycle P.cochainComplex P.cochainComplex (n : ℤ)) + (y : Cocycle P.cochainComplex P.cochainComplex (m : ℤ)) : + (endExt P x).comp (endExt P y) rfl = endExt P (natCocycleProduct x y) := by + apply Ext.homEquiv.injective + change ((endExt P x).comp (endExt P y) rfl).hom = (endExt P (natCocycleProduct x y)).hom + simp only [Ext.comp_hom, endExt_hom] + rw [cocycleHom_comp (by omega) x y (natCocycleProduct x y) rfl, + ShiftedHom.map_comp] + exact (conjugate_comp_of_eq _ _ _ _).symm + +theorem endExt_eq_augmented {X : C} (P : ProjectiveResolution X) {n : ℕ} + (x : Cocycle P.cochainComplex P.cochainComplex (n : ℤ)) : + endExt P x = P.extEquivCohomologyClass.symm + (CohomologyClass.mk (x.postcomp P.π')) := by + apply Ext.homEquiv.injective + change (endExt P x).hom = (P.extEquivCohomologyClass.symm (CohomologyClass.mk (x.postcomp P.π'))).hom + rw [endExt_hom, P.extEquivCohomologyClass_symm_mk_hom] + rw [Cocycle.equivHomShift_symm_postcomp] + rw [← ShiftedHom.comp_mk₀ _ 0 rfl, ShiftedHom.map_comp, ShiftedHom.map_mk₀] + simp only [ShiftedHom.mk₀_comp, ShiftedHom.comp_mk₀] + simp only [conjugate, resolutionIso, Iso.trans_inv, Iso.trans_hom, + asIso_inv, asIso_hom, Functor.map_comp, Category.assoc] + rfl + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionProducts.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..4eb1ddd2ec1c413bcb49a95888b0d9c6c06787d9 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/ResolutionProducts.lean @@ -0,0 +1,50 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomProducts +import Mathlib.CategoryTheory.Abelian.Projective.Ext +import Mathlib.Algebra.Homology.DerivedCategory.Ext.Linear + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open CochainComplex CochainComplex.HomComplex +namespace ArExplicit.ResolutionProducts +universe u v +variable {C : Type u} [Category.{v} C] [Abelian C] [HasDerivedCategory C] + +def conjugate {X Y : DerivedCategory C} (e : X ≅ Y) {n : ℤ} + (f : ShiftedHom X X n) : ShiftedHom Y Y n := + e.inv ≫ f ≫ (CategoryTheory.shiftFunctor (DerivedCategory C) n).map e.hom + +theorem conjugate_comp {X Y : DerivedCategory C} (e : X ≅ Y) {n m : ℤ} + (f : ShiftedHom X X n) (g : ShiftedHom X X m) : + conjugate e (f.comp g (add_comm m n)) = + (conjugate e f).comp (conjugate e g) (add_comm m n) := by + simp only [conjugate, ShiftedHom.comp, Functor.map_comp, Category.assoc] + rw [← Category.assoc ((CategoryTheory.shiftFunctor (DerivedCategory C) n).map e.hom), + ← Functor.map_comp, e.hom_inv_id, CategoryTheory.Functor.map_id, Category.id_comp] + exact congrArg (fun h => e.inv ≫ f ≫ + (CategoryTheory.shiftFunctor (DerivedCategory C) n).map g ≫ h) + ((CategoryTheory.shiftFunctorAdd' (DerivedCategory C) m n (n+m) (add_comm m n)).inv.naturality e.hom).symm + +def resolutionIso {X : C} (P : ProjectiveResolution X) : + DerivedCategory.Q.obj P.cochainComplex ≅ (DerivedCategory.singleFunctor C 0).obj X := + asIso (DerivedCategory.Q.map P.π') ≪≫ (DerivedCategory.singleFunctorIsoCompQ C 0).symm.app X + +variable [HasExt.{v} C] + +def endExt {X : C} (P : ProjectiveResolution X) {n : ℕ} + (x : Cocycle P.cochainComplex P.cochainComplex (n : ℤ)) : Ext X X n := + Ext.homEquiv.symm (conjugate (resolutionIso P) + (ShiftedHom.map (Cocycle.equivHomShift.symm x) DerivedCategory.Q)) + +@[simp] theorem endExt_hom {X : C} (P : ProjectiveResolution X) {n : ℕ} + (x : Cocycle P.cochainComplex P.cochainComplex (n : ℤ)) : + (endExt P x).hom = conjugate (resolutionIso P) + (ShiftedHom.map (Cocycle.equivHomShift.symm x) DerivedCategory.Q) := + Equiv.apply_symm_apply _ _ + +end ArExplicit.ResolutionProducts + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/SimpleCoverClasses.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/SimpleCoverClasses.lean new file mode 100644 index 0000000000000000000000000000000000000000..3771b2522caa0b6ede86a09987c261b31d47d941 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/SimpleCoverClasses.lean @@ -0,0 +1,80 @@ +import OAI.Algebra.AuslanderReiten.Evaluation.EvaluatedCoverCoordinates +import OAI.Algebra.AuslanderReiten.Evaluation.EvaluatedBaseShift +import OAI.Algebra.AuslanderReiten.Evaluation.EvaluatedQuotientCubic +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomShiftedMaps +import OAI.Algebra.AuslanderReiten.HomComplex.TensorFullHomZero + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open CochainComplex CochainComplex.HomComplex CompleteComparison +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +local notation "R₀" => A k q +local notation "X₀" => A.simpleFiniteModule q +local notation "D₀" => bimoduleTwoConeData q +local notation "hf₀" => bimodule_term_finite_k q +local notation "τ₀" => AFrobeniusTrace k q +local notation "Q₀" => HomotopyCategory.quotient (ModuleCat R₀) (ComplexShape.up ℤ) + +abbrev simpleCoverClass (n : ℕ) := + (TwoCone.evaluatedCoverTower D₀ hf₀ X₀ (bimodule_exact q) + (baseTail_right_projective q) (bimodule_term_projective q)).coverClassFrom τ₀ X₀ + (CohomologyClass.mk (Cocycle.ofHom + (FiniteLeftModule.resolutionMap τ₀ (evaluatedBaseZeroEquiv q).symm.toLinearMap))) n + +theorem simpleCoverClass_hom (n : ℕ) : + fullHomShiftedHomotopyEquiv k _ _ (n : ℤ) (simpleCoverClass q n) = + (simpleToEvaluatedBaseShiftIso q n).hom := + TwoCone.evaluatedCoverTower_coverClassFrom_hom D₀ hf₀ X₀ (bimodule_exact q) + (baseTail_right_projective q) (bimodule_term_projective q) τ₀ X₀ + (FiniteLeftModule.resolutionMap τ₀ (evaluatedBaseZeroEquiv q).symm.toLinearMap) n + +def firstCubicBack : (evaluatedBaseModule q 3).carrier →ₗ[R₀] (X₀).carrier := + (evaluatedBaseZeroEquiv q).toLinearMap.comp + (FiniteLeftModule.evaluationMap X₀ + (M := TwoCone.baseCokernelModule D₀ hf₀ 3) + (N := TwoCone.baseCokernelModule D₀ hf₀ 0) (TwoCone.firstCokernelMap D₀ 0)) + +def secondCubicBack : (evaluatedBaseModule q 3).carrier →ₗ[R₀] (X₀).carrier := + (evaluatedBaseZeroEquiv q).toLinearMap.comp + (FiniteLeftModule.evaluationMap X₀ + (M := TwoCone.baseCokernelModule D₀ hf₀ 3) + (N := TwoCone.baseCokernelModule D₀ hf₀ 0) (TwoCone.secondCokernelMap D₀ 0)) + +def firstCoverClass : CohomologyClass (A.simpleComplete q) (A.simpleComplete q) 3 := + fullHomPostcomp (FiniteLeftModule.resolutionMap τ₀ (firstCubicBack q)) 3 (simpleCoverClass q 3) + +def secondCoverClass : CohomologyClass (A.simpleComplete q) (A.simpleComplete q) 3 := + fullHomPostcomp (FiniteLeftModule.resolutionMap τ₀ (secondCubicBack q)) 3 (simpleCoverClass q 3) + +theorem firstCoverClass_hom : + fullHomShiftedHomotopyEquiv k _ _ 3 (firstCoverClass q) = + (simpleToEvaluatedBaseShiftIso q 3).hom ≫ + (TwoCone.evaluatedFirstCokernel D₀ hf₀ X₀ τ₀ 0 ≫ (evaluatedBaseZeroResolutionIso q).hom)⟦(3 : ℤ)⟧' := by + erw [firstCoverClass, fullHomShiftedHomotopyEquiv_postcomp, simpleCoverClass_hom] + congr 1 + apply congrArg (fun f => (CategoryTheory.shiftFunctor + (HomotopyCategory (ModuleCat R₀) (ComplexShape.up ℤ)) (3 : ℤ)).map f) + change (Q₀).map (FiniteLeftModule.resolutionMap τ₀ (firstCubicBack q)) = _ + exact FiniteLeftModule.resolutionMap_comp τ₀ _ _ + +theorem secondCoverClass_hom : + fullHomShiftedHomotopyEquiv k _ _ 3 (secondCoverClass q) = + (simpleToEvaluatedBaseShiftIso q 3).hom ≫ + (TwoCone.evaluatedSecondCokernel D₀ hf₀ X₀ τ₀ 0 ≫ (evaluatedBaseZeroResolutionIso q).hom)⟦(3 : ℤ)⟧' := by + erw [secondCoverClass, fullHomShiftedHomotopyEquiv_postcomp, simpleCoverClass_hom] + congr 1 + apply congrArg (fun f => (CategoryTheory.shiftFunctor + (HomotopyCategory (ModuleCat R₀) (ComplexShape.up ℤ)) (3 : ℤ)).map f) + change (Q₀).map (FiniteLeftModule.resolutionMap τ₀ (secondCubicBack q)) = _ + exact FiniteLeftModule.resolutionMap_comp τ₀ _ _ + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/SimpleCoverCubicConjugate.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/SimpleCoverCubicConjugate.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8d6e38cffdd09c8d1ed3b7a12143a0c49184845 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/SimpleCoverCubicConjugate.lean @@ -0,0 +1,127 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.ConcreteNativeResolution +import OAI.Algebra.AuslanderReiten.Ext.SimpleCoverExt +import OAI.Algebra.AuslanderReiten.Bar.ModuleBarCubicConjugate +import OAI.Algebra.AuslanderReiten.Bar.ModuleBarScalarClass +import OAI.Algebra.AuslanderReiten.Coordinates.ConcreteCubicClasses + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory CategoryTheory.Abelian +open CochainComplex.HomComplex CompleteComparison +open scoped TensorProduct ModuleCat.Algebra +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) +variable [HasDerivedCategory (ModuleCat.{u} (A k q))] +local notation "T₀" => T k q +local notation "S₀" => Resolution.Simple q +local notation "D₀" => bimoduleTwoConeData q +local notation "hf₀" => bimodule_term_finite_k q +local notation "X₀" => A.simpleFiniteModule q + +private theorem firstCoverConjugateStart : + type_of% (ModuleBar.resolutionExt_nativeFirst k T₀ T₀ S₀ S₀ + (CocycleData.p q) (CocycleData.p_isCocycle3 q) + (simpleOrdinaryResolution q) + (evaluatedBaseZeroEquiv q).toModuleIso (nativeToCanonicalSimple q)) := + ModuleBar.resolutionExt_nativeFirst k T₀ T₀ S₀ S₀ + (CocycleData.p q) (CocycleData.p_isCocycle3 q) + (simpleOrdinaryResolution q) + (evaluatedBaseZeroEquiv q).toModuleIso (nativeToCanonicalSimple q) + +private theorem firstCoverConjugateComparison : + type_of% (firstCoverConjugateStart q (simpleNativeResolutionHom q)) := + firstCoverConjugateStart q (simpleNativeResolutionHom q) + +private theorem firstCoverConjugateCocycle : + type_of% (firstCoverConjugateComparison q + (ModuleCat.ofHom (TwoCone.evaluatedFirstBaseMap D₀ hf₀ X₀ 0)) + (firstCoverCocycle q) (firstCoverCocycle_closed q) (firstCoverCocycle_eq q)) := + firstCoverConjugateComparison q + (ModuleCat.ofHom (TwoCone.evaluatedFirstBaseMap D₀ hf₀ X₀ 0)) + (firstCoverCocycle q) (firstCoverCocycle_closed q) (firstCoverCocycle_eq q) + +private theorem firstCoverConjugateProof : + type_of% (firstCoverConjugateCocycle q (simpleNativeBarIso_first q 0)) := + firstCoverConjugateCocycle q (simpleNativeBarIso_first q 0) + +theorem firstCoverCocycle_conjugate : type_of% (firstCoverConjugateProof q) := + firstCoverConjugateProof q + +private theorem secondCoverConjugateStart : + type_of% (ModuleBar.resolutionExt_nativeSecond k T₀ T₀ S₀ S₀ + (CocycleData.p q) (CocycleData.p_isCocycle3 q) + (simpleOrdinaryResolution q) + (evaluatedBaseZeroEquiv q).toModuleIso (nativeToCanonicalSimple q)) := + ModuleBar.resolutionExt_nativeSecond k T₀ T₀ S₀ S₀ + (CocycleData.p q) (CocycleData.p_isCocycle3 q) + (simpleOrdinaryResolution q) + (evaluatedBaseZeroEquiv q).toModuleIso (nativeToCanonicalSimple q) + +private theorem secondCoverConjugateComparison : + type_of% (secondCoverConjugateStart q (simpleNativeResolutionHom q)) := + secondCoverConjugateStart q (simpleNativeResolutionHom q) + +private theorem secondCoverConjugateCocycle : + type_of% (secondCoverConjugateComparison q + (ModuleCat.ofHom (TwoCone.evaluatedSecondBaseMap D₀ hf₀ X₀ 0)) + (secondCoverCocycle q) (secondCoverCocycle_closed q) (secondCoverCocycle_eq q)) := + secondCoverConjugateComparison q + (ModuleCat.ofHom (TwoCone.evaluatedSecondBaseMap D₀ hf₀ X₀ 0)) + (secondCoverCocycle q) (secondCoverCocycle_closed q) (secondCoverCocycle_eq q) + +private theorem secondCoverConjugateProof : + type_of% (secondCoverConjugateCocycle q (simpleNativeBarIso_second q 0)) := + secondCoverConjugateCocycle q (simpleNativeBarIso_second q 0) + +theorem secondCoverCocycle_conjugate : type_of% (secondCoverConjugateProof q) := + secondCoverConjugateProof q + +theorem firstCoverClass_conjugate (hq1 : 1+q ≠ 0) : + selfExtIso (k := k) (nativeToCanonicalSimple q) 3 + (A.fullNonnegativeExtEquiv q hq1 3 (firstCoverClass q)) = + Resolution.aCanonicalFirst q := by + rw [firstCoverClass_ext] + dsimp only [Resolution.aCanonicalFirst] + exact firstCoverCocycle_conjugate q + +theorem secondCoverClass_conjugate (hq1 : 1+q ≠ 0) : + selfExtIso (k := k) (nativeToCanonicalSimple q) 3 + (A.fullNonnegativeExtEquiv q hq1 3 (secondCoverClass q)) = + Resolution.aCanonicalSecond q := by + rw [secondCoverClass_ext] + dsimp only [Resolution.aCanonicalSecond] + exact secondCoverCocycle_conjugate q + +theorem firstCoverClass_ext_eq (hq1 : 1+q ≠ 0) : + A.fullNonnegativeExtEquiv q hq1 3 (firstCoverClass q) = Resolution.aFirst q := by + exact ModuleBar.tensorFirst_eq_of_conjugate k T₀ T₀ S₀ S₀ + (CocycleData.p q) (CocycleData.p_isCocycle3 q) + (A.fullNonnegativeExtEquiv q hq1 3 (firstCoverClass q)) + (firstCoverClass_conjugate q hq1) + +theorem secondCoverClass_ext_eq (hq1 : 1+q ≠ 0) : + A.fullNonnegativeExtEquiv q hq1 3 (secondCoverClass q) = Resolution.aSecond q := by + exact ModuleBar.tensorSecond_eq_of_conjugate k T₀ T₀ S₀ S₀ + (CocycleData.p q) (CocycleData.p_isCocycle3 q) + (A.fullNonnegativeExtEquiv q hq1 3 (secondCoverClass q)) + (secondCoverClass_conjugate q hq1) + +theorem firstCoverClass_eq (hq1 : 1+q ≠ 0) : + firstCoverClass q = A.firstFullClass q hq1 := by + apply (A.fullNonnegativeExtEquiv q hq1 3).injective + exact (firstCoverClass_ext_eq q hq1).trans + ((A.fullNonnegativeExtEquiv q hq1 3).apply_symm_apply _).symm + +theorem secondCoverClass_eq (hq1 : 1+q ≠ 0) : + secondCoverClass q = A.secondFullClass q hq1 := by + apply (A.fullNonnegativeExtEquiv q hq1 3).injective + exact (secondCoverClass_ext_eq q hq1).trans + ((A.fullNonnegativeExtEquiv q hq1 3).apply_symm_apply _).symm + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/TrivialInductionComplex.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/TrivialInductionComplex.lean new file mode 100644 index 0000000000000000000000000000000000000000..9d8e403cff9e5c08b9070d1b8b339f4413c8cdf0 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/TrivialInductionComplex.lean @@ -0,0 +1,78 @@ +import OAI.Algebra.AuslanderReiten.Modules.TrivialInduction +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCategory +import Mathlib.Algebra.Homology.DerivedCategory.ShortExact + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.TrivialInduction +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +local notation "T" => TrivialExtension k R + +variable {ι : Type*} {c : ComplexShape ι} + +def dualComplex (P : HomologicalComplex (ModuleCat.{u} R) c) : + HomologicalComplex (ModuleCat.{u} T) c := + ((BalancedTensor.functor (k := k) (R := R) (S := T) (F := Coinduced k R)).mapHomologicalComplex c).obj P + +def inducedComplex (P : HomologicalComplex (ModuleCat.{u} R) c) : + HomologicalComplex (ModuleCat.{u} T) c := + ((BalancedTensor.functor (k := k) (R := R) (S := T) (F := Middle (k := k) (R := R))).mapHomologicalComplex c).obj P + +def quotientComplex (P : HomologicalComplex (ModuleCat.{u} R) c) : + HomologicalComplex (ModuleCat.{u} T) c := + ((BalancedTensor.functor (k := k) (R := R) (S := T) (F := Quotient (k := k) (R := R))).mapHomologicalComplex c).obj P + +def sequence (P : HomologicalComplex (ModuleCat.{u} R) c) : + ShortComplex (HomologicalComplex (ModuleCat.{u} T) c) := + BalancedTensor.complexSequence (k := k) inclusion projection inclusion_left + projection_left projection_inclusion P + +theorem sequence_shortExact (P : HomologicalComplex (ModuleCat.{u} R) c) + [∀ i, Module.Finite R (P.X i)] [∀ i, Module.Projective R (P.X i)] : + (sequence (k := k) P).ShortExact := + BalancedTensor.complexSequence_shortExact inclusion projection inclusion_left + projection_left projection_inclusion inclusion_injective inclusion_projection_exact + projection_surjective P + +instance induced_term_projective (P : HomologicalComplex (ModuleCat.{u} R) c) (i : ι) + [Module.Finite R (P.X i)] [Module.Projective R (P.X i)] : + Module.Projective T ((inducedComplex (k := k) P).X i) := + BalancedTensor.projective + +instance induced_term_finite (P : HomologicalComplex (ModuleCat.{u} R) c) (i : ι) + [Module.Finite R (P.X i)] [Module.Projective R (P.X i)] : + Module.Finite T ((inducedComplex (k := k) P).X i) := + BalancedTensor.finite + +theorem dualComplex_ideal_zero (P : HomologicalComplex (ModuleCat.{u} R) c) (i : ι) + (ψ : Module.Dual k R) (z : (dualComplex (k := k) P).X i) : + TrivialExtension.inr ψ • z = 0 := by + have hz : ∀ w : BalancedTensor k R (Coinduced k R) (P.X i), + TrivialExtension.inr ψ • w = 0 := by + intro w + induction w using BalancedTensor.induction_on with + | zero => exact smul_zero _ + | tmul φ v => rw [BalancedTensor.smul_tmul, dual_ideal_annihilates, BalancedTensor.zero_tmul] + | add x y hx hy => rw [smul_add, hx, hy, zero_add] + exact hz z + +variable (P : CochainComplex (ModuleCat.{u} R) ℤ) + [∀ i, Module.Finite R (P.X i)] [∀ i, Module.Projective R (P.X i)] + [HasDerivedCategory (ModuleCat.{u} (TrivialExtension k R))] + +def triangle : CategoryTheory.Pretriangulated.Triangle (DerivedCategory (ModuleCat.{u} T)) := + DerivedCategory.triangleOfSES (sequence_shortExact (k := k) P) + +theorem triangle_distinguished : + triangle (k := k) P ∈ distTriang (DerivedCategory (ModuleCat.{u} T)) := + DerivedCategory.triangleOfSES_distinguished (sequence_shortExact (k := k) P) + +end ArExplicit.TrivialInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/TrivialInductionDual.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/TrivialInductionDual.lean new file mode 100644 index 0000000000000000000000000000000000000000..f072292a306d72ed0556a92379023817cb0cf7c8 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/TrivialInductionDual.lean @@ -0,0 +1,52 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.TrivialInductionQuotient +import OAI.Algebra.AuslanderReiten.Duality.DualTensorComplex + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.TrivialInduction +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +local notation "T" => TrivialExtension k R + +def dualInflateEquiv (M : ModuleCat.{u} R) : + BalancedTensor k R (Coinduced k R) M ≃ₗ[T] + (inflate (k := k)).obj + (ModuleCat.of R (BalancedTensor k R (Coinduced k R) M)) where + toFun := id + invFun := id + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' t z := by + change t • z = t.base • z + induction z using BalancedTensor.induction_on with + | zero => simp + | add x y hx hy => simp only [smul_add, hx, hy] + | tmul φ m => rfl + +def dualFunctorIso : + BalancedTensor.functor (k := k) (R := R) (S := T) (F := Coinduced k R) ≅ + BalancedTensor.functor (k := k) (R := R) (S := R) (F := Coinduced k R) ⋙ inflate := + NatIso.ofComponents (fun M => (dualInflateEquiv M).toModuleIso) (by + intro M N f + apply ModuleCat.hom_ext + apply LinearMap.ext + intro z + rfl) + +def dualComplexIso {ι : Type*} {c : ComplexShape ι} + (P : HomologicalComplex (ModuleCat.{u} R) c) : + dualComplex (k := k) P ≅ + ((inflate (k := k)).mapHomologicalComplex c).obj + (((BalancedTensor.functor (k := k) (R := R) (S := R) + (F := Coinduced k R)).mapHomologicalComplex c).obj P) := + (NatIso.mapHomologicalComplex dualFunctorIso c).app P + +end ArExplicit.TrivialInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Resolutions/TrivialInductionQuotient.lean b/lean/OAI/Algebra/AuslanderReiten/Resolutions/TrivialInductionQuotient.lean new file mode 100644 index 0000000000000000000000000000000000000000..713bd12da08647d52d7743c01061e8786caa4efa --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Resolutions/TrivialInductionQuotient.lean @@ -0,0 +1,83 @@ +import OAI.Algebra.AuslanderReiten.Resolutions.TrivialInductionComplex +import OAI.Algebra.AuslanderReiten.Modules.InductionAdjunction +import OAI.Algebra.AuslanderReiten.Modules.ModuleRestriction + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.TrivialInduction +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +local notation "T" => TrivialExtension k R + +def inflate : ModuleCat.{u} R ⥤ ModuleCat.{u} T := + ModuleCat.restrictScalars TrivialExtension.projection.toRingHom + +instance : (inflate (k := k) (R := R)).Additive := + inferInstanceAs (ModuleCat.restrictScalars (TrivialExtension.projection (k := k) (A := R)).toRingHom).Additive + +private instance baseComm (M : ModuleCat.{u} R) : SMulCommClass k R M where + smul_comm a r m := by + change (algebraMap k R a) • (r • m) = r • ((algebraMap k R a) • m) + rw [← mul_smul, Algebra.commutes a r, mul_smul] + +def quotientScalarMap (M : ModuleCat.{u} R) : + BalancedTensor k R (Quotient (k := k) (R := R)) M →ₗ[k] M := + BalancedTensor.lift + ((BalancedTensor.leftAction (k := k) (R := R) (M := M)).comp + (InductionBimodule.scalarEquiv (AlgHom.id k R)).toLinearMap) + (by intro a r m; exact mul_smul a.value r m) + +@[simp] theorem quotientScalarMap_tmul (M : ModuleCat.{u} R) + (r : Quotient (k := k) (R := R)) (m : M) : + quotientScalarMap M (BalancedTensor.tmul r m) = r.value • m := rfl + +def quotientEquiv (M : ModuleCat.{u} R) : + BalancedTensor k R (Quotient (k := k) (R := R)) M ≃ₗ[T] (inflate (k := k)).obj M where + toFun := quotientScalarMap M + invFun m := BalancedTensor.tmul ⟨1⟩ m + left_inv z := by + induction z using BalancedTensor.induction_on with + | zero => simp + | add x y hx hy => simpa only [map_add, BalancedTensor.tmul_add] using congrArg₂ (· + ·) hx hy + | tmul r m => + change BalancedTensor.tmul (InductionBimodule.mk (1 : R)) (r.value • m) = + BalancedTensor.tmul r m + rw [← BalancedTensor.balance] + change BalancedTensor.tmul (InductionBimodule.mk (1 * r.value)) m = _ + rw [one_mul] + right_inv m := by + exact @one_smul R M _ _ (show M from m) + map_add' := (quotientScalarMap M).map_add + map_smul' t z := by + change quotientScalarMap M (t • z) = t.base • quotientScalarMap M z + induction z using BalancedTensor.induction_on with + | zero => simp + | tmul r m => exact mul_smul t.base r.value m + | add x y hx hy => simp only [smul_add, map_add, hx, hy] + +def quotientFunctorIso : + BalancedTensor.functor (k := k) (R := R) (S := T) (F := Quotient (k := k) (R := R)) ≅ inflate := + NatIso.ofComponents (fun M => (quotientEquiv M).toModuleIso) (by + intro M N f + apply ModuleCat.hom_ext + apply BalancedTensor.leftHom_ext + intro r m + change r.value • f.hom m = f.hom (r.value • m) + exact (f.hom.map_smul r.value m).symm) + +def quotientComplexIso {ι : Type*} {c : ComplexShape ι} + (P : HomologicalComplex (ModuleCat.{u} R) c) : + quotientComplex (k := k) P ≅ ((inflate (k := k)).mapHomologicalComplex c).obj P := + (NatIso.mapHomologicalComplex quotientFunctorIso c).app P + +instance : (inflate (k := k) (R := R)).PreservesHomology := + ModuleRestriction.preservesHomology _ + +end ArExplicit.TrivialInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/CanonicalCosyzygy.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/CanonicalCosyzygy.lean new file mode 100644 index 0000000000000000000000000000000000000000..961883a61b698c892db06843c5f0bebc46a599a7 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/CanonicalCosyzygy.lean @@ -0,0 +1,80 @@ +import OAI.Algebra.AuslanderReiten.Modules.CoinducedModule +import OAI.Algebra.AuslanderReiten.Complete.FiniteCompleteResolution +import OAI.Algebra.AuslanderReiten.Homology.RestrictionProjective + +namespace OAI + +noncomputable section + +namespace ArExplicit.FiniteLeftModule + +open CategoryTheory + +universe u + +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] + +def canonicalEnvelope (M : FiniteLeftModule k R) : ModuleCat.{u} R := + ModuleCat.of R (CoinducedModule k R M.carrier) + +def canonicalEmbedding (M : FiniteLeftModule k R) : M.carrier ⟶ M.canonicalEnvelope := + ModuleCat.ofHom CoinducedModule.embedding + +def canonicalCosyzygy (M : FiniteLeftModule k R) : FiniteLeftModule k R where + carrier := cokernelObject M.canonicalEmbedding + scalar := inferInstanceAs (Module k (CoinducedModule k R M.carrier ⧸ LinearMap.range (CoinducedModule.embedding (k := k) (R := R) (M := M.carrier)))) + tower := inferInstanceAs (IsScalarTower k R + (CoinducedModule k R M.carrier ⧸ LinearMap.range (CoinducedModule.embedding (k := k) (R := R) (M := M.carrier)))) + finite := inferInstanceAs (Module.Finite k + (CoinducedModule k R M.carrier ⧸ LinearMap.range (CoinducedModule.embedding (k := k) (R := R) (M := M.carrier)))) + +def canonicalCosyzygies (M : FiniteLeftModule k R) : ℕ → FiniteLeftModule k R + | 0 => M + | n + 1 => (canonicalCosyzygies M n).canonicalCosyzygy + +variable {S : Type u} [Ring S] (j : S →+* R) +variable [Module.Injective S S] +variable [Module.Finite S ((ModuleCat.restrictScalars j).obj (ModuleCat.of R R))] +variable [Module.Projective S ((ModuleCat.restrictScalars j).obj (ModuleCat.of R R))] + +omit [Module.Injective S S] in +theorem canonicalEnvelope_side (τ : FrobeniusTrace k R) (M : FiniteLeftModule k R) : + Module.Finite S ((ModuleCat.restrictScalars j).obj M.canonicalEnvelope) ∧ + Module.Projective S ((ModuleCat.restrictScalars j).obj M.canonicalEnvelope) := by + let : Module.Finite R M.canonicalEnvelope := CoinducedModule.finite (M := M.carrier) τ + let : Module.Projective R M.canonicalEnvelope := CoinducedModule.projective (M := M.carrier) τ + exact ⟨restrict_finite j M.canonicalEnvelope, restrict_projective j M.canonicalEnvelope⟩ + +theorem canonicalCosyzygy_side (τ : FrobeniusTrace k R) (M : FiniteLeftModule k R) + [Module.Finite S ((ModuleCat.restrictScalars j).obj M.carrier)] + [Module.Projective S ((ModuleCat.restrictScalars j).obj M.carrier)] : + Module.Finite S ((ModuleCat.restrictScalars j).obj M.canonicalCosyzygy.carrier) ∧ + Module.Projective S ((ModuleCat.restrictScalars j).obj M.canonicalCosyzygy.carrier) := by + obtain ⟨hfin, hproj⟩ := canonicalEnvelope_side j τ M + let := hfin + let := hproj + let := finiteProjective_injective (R := S) (M := (ModuleCat.restrictScalars j).obj M.carrier) + constructor + · exact Module.Finite.equiv (restrictCokernelEquiv j M.canonicalEmbedding).symm + · exact cokernel_restrict_projective j M.canonicalEmbedding CoinducedModule.embedding_injective + +theorem canonicalCosyzygies_side (τ : FrobeniusTrace k R) (M : FiniteLeftModule k R) + [Module.Finite S ((ModuleCat.restrictScalars j).obj M.carrier)] + [Module.Projective S ((ModuleCat.restrictScalars j).obj M.carrier)] (n : ℕ) : + Module.Finite S ((ModuleCat.restrictScalars j).obj (M.canonicalCosyzygies n).carrier) ∧ + Module.Projective S ((ModuleCat.restrictScalars j).obj (M.canonicalCosyzygies n).carrier) := by + induction n with + | zero => + change Module.Finite S ((ModuleCat.restrictScalars j).obj M.carrier) ∧ + Module.Projective S ((ModuleCat.restrictScalars j).obj M.carrier) + exact ⟨inferInstance, inferInstance⟩ + | succ n ih => + let := ih.1 + let := ih.2 + exact canonicalCosyzygy_side j τ (M.canonicalCosyzygies n) + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/CanonicalCosyzygyShift.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/CanonicalCosyzygyShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..5bb6fb2e80ec719da7310bcce5a643e78c082391 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/CanonicalCosyzygyShift.lean @@ -0,0 +1,61 @@ +import OAI.Algebra.AuslanderReiten.Stable.CanonicalCosyzygy +import OAI.Algebra.AuslanderReiten.Complete.ProjectiveCompleteResolution + +namespace OAI + +noncomputable section +open CategoryTheory + +namespace ArExplicit.FiniteLeftModule + +open CompleteComparison + +universe u + +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (τ : FrobeniusTrace k R) (M : FiniteLeftModule k R) + +def canonicalEnvelopeModule : FiniteLeftModule k R where + carrier := M.canonicalEnvelope + scalar := inferInstanceAs (Module k (CoinducedModule k R M.carrier)) + tower := inferInstanceAs (IsScalarTower k R (CoinducedModule k R M.carrier)) + finite := inferInstanceAs (Module.Finite k (CoinducedModule k R M.carrier)) + +def canonicalCosyzygyQuotient : (M.canonicalEnvelopeModule).carrier →ₗ[R] + M.canonicalCosyzygy.carrier := + (LinearMap.range (M.canonicalEmbedding).hom).mkQ + +theorem canonicalCosyzygyQuotient_surjective : Function.Surjective M.canonicalCosyzygyQuotient := + (LinearMap.range (M.canonicalEmbedding).hom).mkQ_surjective + +theorem canonicalCosyzygy_exact : Function.Exact (M.canonicalEmbedding).hom + M.canonicalCosyzygyQuotient := by + intro x + exact Submodule.Quotient.mk_eq_zero _ + +def canonicalCosyzygyShiftIso : + (HomotopyCategory.quotient _ _).obj (M.canonicalCosyzygy.completeCochain τ) ≅ + ((HomotopyCategory.quotient _ _).obj (M.completeCochain τ))⟦(1 : ℤ)⟧ := by + letI : Module.Projective R M.canonicalEnvelopeModule.carrier := + CoinducedModule.projective (M := M.carrier) τ + exact projectiveMiddleShiftIso τ (M.canonicalEmbedding).hom M.canonicalCosyzygyQuotient + CoinducedModule.embedding_injective M.canonicalCosyzygyQuotient_surjective + M.canonicalCosyzygy_exact + +def canonicalCosyzygiesShiftIso (n : ℕ) : + (HomotopyCategory.quotient _ _).obj ((M.canonicalCosyzygies n).completeCochain τ) ≅ + ((HomotopyCategory.quotient _ _).obj (M.completeCochain τ))⟦(n : ℤ)⟧ := by + induction n with + | zero => + exact ((shiftFunctorZero (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) ℤ).app _).symm + | succ n ih => + exact canonicalCosyzygyShiftIso τ (M.canonicalCosyzygies n) ≪≫ + (CategoryTheory.shiftFunctor (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) 1).mapIso ih ≪≫ + (shiftFunctorAdd' (HomotopyCategory (ModuleCat.{u} R) (ComplexShape.up ℤ)) + (n : ℤ) 1 ((n + 1 : ℕ) : ℤ) (by omega)).symm.app _ + +end ArExplicit.FiniteLeftModule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/RawSourceCoordinates.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/RawSourceCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..429c71efd7506b973b9f292655549cae0336c948 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/RawSourceCoordinates.lean @@ -0,0 +1,68 @@ +import OAI.Algebra.AuslanderReiten.Cones.ConeConnectingCoordinates +import OAI.Algebra.AuslanderReiten.Stable.SourceStableCoordinates + +namespace OAI + +noncomputable section +namespace ArExplicit.CompleteComparison +open CategoryTheory HomologicalComplex +open CochainComplex CochainComplex.HomComplex +universe u +variable {R : Type u} [Ring R] +variable (K : CochainComplex (ModuleCat.{u} R) ℤ) + +def rawSyzygyEquiv : Cokernel (chainOfCochain K) 1 ≃ₗ[R] RawSyzygy K := + cokernelLinearCongr _ _ + (K.extendXIso negIndexEmbedding (i := -2) (i' := 2) rfl).toLinearEquiv + (K.extendXIso negIndexEmbedding (i := -1) (i' := 1) rfl).toLinearEquiv + (congrArg ModuleCat.Hom.hom + (reverseShortComplexIso K (-2) (-1) 0 2 1 0 rfl rfl rfl).hom.comm₁₂).symm + +@[simp] +theorem rawSyzygyEquiv_symm_mk (z : K.X (-1)) : + (rawSyzygyEquiv K).symm (Submodule.Quotient.mk z) = + Submodule.Quotient.mk ((K.extendXIso negIndexEmbedding (i := -1) (i' := 1) rfl).inv.hom z) := rfl + +variable {k : Type u} [Field k] [CharP k 2] [Algebra k R] +variable {K} {L : CochainComplex (ModuleCat.{u} R) ℤ} + +def rawSourceCocycleMap (x : Cocycle K L 1) : RawSyzygy K →ₗ[R] CochainCokernel L := + (cochainCokernelLinearEquiv L).toLinearMap.comp + ((sourceCocycleMap x).comp (rawSyzygyEquiv K).symm.toLinearMap) + +include k in +@[simp] +theorem rawSourceCocycleMap_mk (x : Cocycle K L 1) (z : K.X (-1)) : + rawSourceCocycleMap x (Submodule.Quotient.mk z) = + Submodule.Quotient.mk ((x.val.v (-1) 0 rfl).hom z) := by + change cochainCokernelLinearEquiv L + (sourceCocycleMap x ((rawSyzygyEquiv K).symm (Submodule.Quotient.mk z))) = _ + rw [rawSyzygyEquiv_symm_mk, sourceCocycleMap_mk (k := k)] + change Submodule.Quotient.mk + ((L.extendXIso negIndexEmbedding (i := 0) (i' := 0) rfl).hom.hom + ((sourceCocycleComponent x).hom + ((K.extendXIso negIndexEmbedding (i := -1) (i' := 1) rfl).inv.hom z))) = _ + simp [sourceCocycleComponent] + +variable {F G H : CochainComplex (ModuleCat.{u} R) ℤ} +variable (φ : F ⟶ G) (κ : H ⟶ mappingCone φ) + +include k in + +theorem rawSourceCocycleMap_cone (hi : Function.Injective (cochainCokernelMap φ)) : + rawSourceCocycleMap (cocycleProduct (Cocycle.ofHom κ) (mappingCone.fst φ)) = + coneLiftKernel φ κ hi := by + apply LinearMap.ext + intro z + obtain ⟨z, rfl⟩ := Submodule.mkQ_surjective (LinearMap.range (H.d (-2) (-1)).hom) z + erw [rawSourceCocycleMap_mk (k := k)] + change Submodule.Quotient.mk + ((((Cochain.ofHom κ).comp (mappingCone.fst φ).val rfl).v (-1) 0 rfl).hom z) = _ + rw [Cochain.comp_v _ _ rfl (-1) (-1) 0 (by omega) (by omega), Cochain.ofHom_v] + rfl + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/RawSourceDegrees.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/RawSourceDegrees.lean new file mode 100644 index 0000000000000000000000000000000000000000..19267e86bb28fc94bbd99fe8bc5d1ad23ffa2579 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/RawSourceDegrees.lean @@ -0,0 +1,106 @@ +import OAI.Algebra.AuslanderReiten.Stable.RawSourceStable + +namespace OAI + +noncomputable section +namespace ArExplicit.CompleteComparison +open CategoryTheory HomologicalComplex +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +universe u +variable {R : Type u} [Ring R] +variable (K : CochainComplex (ModuleCat.{u} R) ℤ) (n : ℤ) + +abbrev RawCokernelAt := K.X (-n) ⧸ LinearMap.range (K.d (-(n+1)) (-n)).hom + +def rawCokernelAtEquiv : Cokernel (chainOfCochain K) n ≃ₗ[R] RawCokernelAt K n := + cokernelLinearCongr _ _ + (K.extendXIso negIndexEmbedding (i := -(n+1)) (i' := n+1) (neg_neg (n+1))).toLinearEquiv + (K.extendXIso negIndexEmbedding (i := -n) (i' := n) (neg_neg n)).toLinearEquiv + (congrArg ModuleCat.Hom.hom + (reverseShortComplexIso K (-(n+1)) (-n) (-(n-1)) (n+1) n (n-1) + (neg_neg (n+1)) (neg_neg n) (neg_neg (n-1))).hom.comm₁₂).symm + +@[simp] +theorem rawCokernelAtEquiv_symm_mk (z : K.X (-n)) : + (rawCokernelAtEquiv K n).symm (Submodule.Quotient.mk z) = + Submodule.Quotient.mk + ((K.extendXIso negIndexEmbedding (i := -n) (i' := n) (neg_neg n)).inv.hom z) := rfl + +def rawCokernelAtInclusion : RawCokernelAt K (n+1) →ₗ[R] K.X (-n) := + (LinearMap.range (K.d (-(n+1+1)) (-(n+1))).hom).liftQ + (K.d (-(n+1)) (-n)).hom + (LinearMap.range_le_ker_iff.mpr + (congrArg ModuleCat.Hom.hom (K.d_comp_d (-(n+1+1)) (-(n+1)) (-n)))) + +theorem rawCokernelAtInclusion_cover : + ((LinearMap.range (K.d (-(n+1)) (-n)).hom).mkQ).comp + (rawCokernelAtInclusion K n) = 0 := by + apply LinearMap.ext + intro z + obtain ⟨z, rfl⟩ := Submodule.mkQ_surjective + (LinearMap.range (K.d (-(n+1+1)) (-(n+1))).hom) z + exact (Submodule.Quotient.mk_eq_zero _).mpr ⟨z, rfl⟩ + +variable {k : Type u} [Field k] [Algebra k R] +variable {K n} {L M : CochainComplex (ModuleCat.{u} R) ℤ} + +def rawSourceAt (x : Cocycle K L n) : RawCokernelAt K n →ₗ[R] CochainCokernel L := + (cochainCokernelLinearEquiv L).toLinearMap.comp + ((sourceCocycleMap x).comp (rawCokernelAtEquiv K n).symm.toLinearMap) + +include k in +@[simp] +theorem rawSourceAt_mk [CharP k 2] (x : Cocycle K L n) (z : K.X (-n)) : + rawSourceAt x (Submodule.Quotient.mk z) = + Submodule.Quotient.mk ((x.val.v (-n) 0 (by omega)).hom z) := by + change cochainCokernelLinearEquiv L + (sourceCocycleMap x ((rawCokernelAtEquiv K n).symm (Submodule.Quotient.mk z))) = _ + rw [rawCokernelAtEquiv_symm_mk, sourceCocycleMap_mk (k := k)] + change Submodule.Quotient.mk + ((L.extendXIso negIndexEmbedding (i := 0) (i' := 0) rfl).hom.hom + ((sourceCocycleComponent x).hom + ((K.extendXIso negIndexEmbedding (i := -n) (i' := n) (neg_neg n)).inv.hom z))) = _ + simp [sourceCocycleComponent] + +include k in +theorem rawSourceAt_postcomp [CharP k 2] (x : Cocycle K L n) (f : L ⟶ M) : + rawSourceAt (x.postcomp f) = (cochainCokernelMap f).comp (rawSourceAt x) := by + apply LinearMap.ext + intro z + obtain ⟨z, rfl⟩ := Submodule.mkQ_surjective + (LinearMap.range (K.d (-(n+1)) (-n)).hom) z + change rawSourceAt (x.postcomp f) (Submodule.Quotient.mk z) = + cochainCokernelMap f (rawSourceAt x (Submodule.Quotient.mk z)) + rw [rawSourceAt_mk (k := k), rawSourceAt_mk (k := k)] + change Submodule.Quotient.mk + (((x.val.comp (Cochain.ofHom f) (add_zero n)).v (-n) 0 (by omega)).hom z) = _ + rw [Cochain.comp_v _ _ (add_zero n) (-n) 0 0 (by omega) (by omega), Cochain.ofHom_v] + rfl + +def rawSourceAtStableEquiv (K L : CochainComplex (ModuleCat.{u} R) ℤ) (n : ℤ) + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain L)) : + CohomologyClass K L n ≃+ StableHom R (RawCokernelAt K n) (CochainCokernel L) := + (fullHomSourceStableLinearEquiv (k := k) K L n hK hL).toAddEquiv.trans + (((StableIsomorphism.ofLinearEquiv (rawCokernelAtEquiv K n).symm).sourceAddEquiv).trans + (StableIsomorphism.ofLinearEquiv (cochainCokernelLinearEquiv L)).targetAddEquiv) + +@[simp] +theorem rawSourceAtStableEquiv_mk + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain L)) (x : Cocycle K L n) : + rawSourceAtStableEquiv (k := k) K L n hK hL (CohomologyClass.mk x) = + StableHom.classOf R _ _ (rawSourceAt x) := by + simp only [rawSourceAtStableEquiv, AddEquiv.trans_apply, LinearEquiv.coe_toAddEquiv, + StableIsomorphism.sourceAddEquiv, StableIsomorphism.targetAddEquiv, + StableIsomorphism.ofLinearEquiv, AddEquiv.coe_mk, Equiv.coe_fn_mk] + erw [fullHomSourceStableLinearEquiv_mk hK hL x] + rw [StableHom.comp_classOf, StableHom.comp_classOf] + rfl + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/RawSourceStable.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/RawSourceStable.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe605b86b0b61e20831bf01961af43091d807eee --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/RawSourceStable.lean @@ -0,0 +1,38 @@ +import OAI.Algebra.AuslanderReiten.Stable.RawSourceCoordinates +import OAI.Algebra.AuslanderReiten.Stable.StableIsomorphism + +namespace OAI + +noncomputable section +namespace ArExplicit.CompleteComparison +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable (K L : CochainComplex (ModuleCat.{u} R) ℤ) +variable (hK : TotallyAcyclicComplex (chainOfCochain K)) +variable (hL : ExactProjectiveComplex (chainOfCochain L)) + +def rawSourceStableEquiv : CohomologyClass K L 1 ≃+ StableHom R (RawSyzygy K) (CochainCokernel L) := + (fullHomSourceStableLinearEquiv (k := k) K L 1 hK hL).toAddEquiv.trans + (((StableIsomorphism.ofLinearEquiv (rawSyzygyEquiv K).symm).sourceAddEquiv).trans + (StableIsomorphism.ofLinearEquiv (cochainCokernelLinearEquiv L)).targetAddEquiv) + +@[simp] +theorem rawSourceStableEquiv_mk (x : Cocycle K L 1) : + rawSourceStableEquiv (k := k) K L hK hL (CohomologyClass.mk x) = + StableHom.classOf R _ _ (rawSourceCocycleMap x) := by + simp only [rawSourceStableEquiv, AddEquiv.trans_apply, + LinearEquiv.coe_toAddEquiv, + StableIsomorphism.sourceAddEquiv, StableIsomorphism.targetAddEquiv, + StableIsomorphism.ofLinearEquiv, AddEquiv.coe_mk, Equiv.coe_fn_mk] + erw [fullHomSourceStableLinearEquiv_mk hK hL x] + rw [StableHom.comp_classOf, StableHom.comp_classOf] + rfl + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/SourceStableCoordinates.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/SourceStableCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5ee215c8403c66bdc4ff36382a7c7fb31f40563 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/SourceStableCoordinates.lean @@ -0,0 +1,80 @@ +import OAI.Algebra.AuslanderReiten.Stable.SourceStableShift +import OAI.Algebra.AuslanderReiten.Cones.CokernelShiftCoordinates +import OAI.Algebra.AuslanderReiten.Resolutions.NatResolutionCochain + +namespace OAI + +noncomputable section +open CategoryTheory HomologicalComplex +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra + +namespace ArExplicit.CompleteComparison +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable {K L : CochainComplex (ModuleCat.{u} R) ℤ} {n : ℤ} + +def sourceCocycleMap (x : Cocycle K L n) : + Cokernel (chainOfCochain K) n →ₗ[R] Cokernel (chainOfCochain L) 0 := + (shiftedCokernelEquiv L 0 0 rfl).toLinearMap.comp + ((cokernelMap (cocycleComparisonMap (x.leftShift (-n) 0 (by omega))) 0).comp + (shiftedCokernelEquiv K (-n) n rfl).symm.toLinearMap) + +@[simp] +theorem fullHomSourceStableLinearEquiv_mk + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain L)) (x : Cocycle K L n) : + fullHomSourceStableLinearEquiv (k := k) K L n hK hL (CohomologyClass.mk x) = + StableHom.classOf R _ _ (sourceCocycleMap x) := by + change StableHom.sourceEquiv (k := k) (shiftedCokernelEquiv K (-n) n rfl).symm + (StableHom.targetEquiv (k := k) (shiftedCokernelEquiv L 0 0 rfl) + (fullHomStableEquiv (K⟦-n⟧) L 0 (hK.cochainShift (-n)) (hL.cochainShift 0) + (CohomologyClass.mk (x.leftShift (-n) 0 (by omega))))) = _ + rw [fullHomStableEquiv_mk, StableHom.targetEquiv_classOf, StableHom.sourceEquiv_classOf] + rfl + +def sourceCocycleComponent (x : Cocycle K L n) : + (chainOfCochain K).X n ⟶ (chainOfCochain L).X 0 := + (K.extendXIso negIndexEmbedding (i := -n) (i' := n) (neg_neg n)).hom ≫ + x.val.v (-n) 0 (by omega) ≫ + (L.extendXIso negIndexEmbedding (i := 0) (i' := 0) rfl).inv + +theorem sourceCocycleMap_mk [CharP k 2] (x : Cocycle K L n) + (z : (chainOfCochain K).X n) : + sourceCocycleMap x (Submodule.Quotient.mk z) = + Submodule.Quotient.mk ((sourceCocycleComponent x).hom z) := by + change shiftedCokernelEquiv L 0 0 rfl + (cokernelMap (cocycleComparisonMap (x.leftShift (-n) 0 (by omega))) 0 + ((shiftedCokernelEquiv K (-n) n rfl).symm (Submodule.Quotient.mk z))) = _ + rw [shiftedCokernelEquiv_symm_mk] + change shiftedCokernelEquiv L 0 0 rfl + (Submodule.Quotient.mk + (((cocycleComparisonMap (x.leftShift (-n) 0 (by omega))).f 0).hom + ((shiftedCokernelComponent K (-n) n rfl).inv.hom z))) = _ + rw [shiftedCokernelEquiv_mk] + congr 1 + unfold cocycleComparisonMap + rw [extendMap_f _ negIndexEmbedding (show negIndexEmbedding.f 0 = 0 from rfl)] + rw [cocycleHom_component] + simp only [Cocycle.leftShift_coe] + rw [Cochain.leftShift_v _ (-n) 0 (by omega) 0 (0 + 0) rfl (-n) (by omega)] + rw [ResolutionProducts.intUnit_smul_charTwo (k := k)] + have hh : (shiftedCokernelComponent K (-n) n rfl).inv ≫ + ((K⟦-n⟧).extendXIso negIndexEmbedding (i := 0) (i' := 0) rfl).hom ≫ + (K.shiftFunctorObjXIso (-n) 0 (-n) (by omega)).hom ≫ + x.val.v (-n) 0 (by omega) ≫ + ((L⟦(0 : ℤ)⟧).extendXIso negIndexEmbedding (i := 0) (i' := 0) rfl).inv ≫ + (shiftedCokernelComponent L 0 0 rfl).hom = sourceCocycleComponent x := by + dsimp only [shiftedCokernelComponent, sourceCocycleComponent] + erw [Iso.trans_inv, Iso.trans_inv, Iso.trans_hom, Iso.trans_hom] + simp only [Iso.symm_inv, Iso.symm_hom] + simp only [Category.assoc, Iso.inv_hom_id_assoc, + CochainComplex.shiftFunctorObjXIso, XIsoOfEq_rfl, Iso.refl_hom] + erw [Category.id_comp] + exact congrArg (fun f : (chainOfCochain K).X n ⟶ (chainOfCochain L).X 0 => f.hom z) hh + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/SourceStableShift.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/SourceStableShift.lean new file mode 100644 index 0000000000000000000000000000000000000000..570c638f498b5d6207c7309a2d884a5422b52a0c --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/SourceStableShift.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomShift +import OAI.Algebra.AuslanderReiten.Cones.CokernelShift +import OAI.Algebra.AuslanderReiten.Complete.CompleteShiftDual +import OAI.Algebra.AuslanderReiten.Stable.StableHomEquiv + +namespace OAI + +open CategoryTheory +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra + +namespace ArExplicit.CompleteComparison + +universe u + +variable {k R : Type u} [CommRing k] [Ring R] [Algebra k R] + +noncomputable def fullHomStableZeroLinearEquiv + (K L : CochainComplex (ModuleCat.{u} R) ℤ) + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain L)) : + CohomologyClass K L 0 ≃ₗ[k] + StableHom R (Cokernel (chainOfCochain K) 0) (Cokernel (chainOfCochain L) 0) := + (fullHomStableLinearEquiv K L 0 hK (hL.cochainShift 0)).trans + (StableHom.targetEquiv (k := k) (shiftedCokernelEquiv L 0 0 rfl)) + +noncomputable def fullHomSourceStableLinearEquiv + (K L : CochainComplex (ModuleCat.{u} R) ℤ) (n : ℤ) + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain L)) : + CohomologyClass K L n ≃ₗ[k] + StableHom R (Cokernel (chainOfCochain K) n) (Cokernel (chainOfCochain L) 0) := + (leftShiftCohomologyEquiv k K L n (-n) 0 (by omega)).trans + ((fullHomStableZeroLinearEquiv (K⟦-n⟧) L (hK.cochainShift (-n)) hL).trans + (StableHom.sourceEquiv (k := k) (shiftedCokernelEquiv K (-n) n rfl).symm)) + +end ArExplicit.CompleteComparison + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableConnecting.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableConnecting.lean new file mode 100644 index 0000000000000000000000000000000000000000..d7bfa2ac8cc1d428909e6977ad45390abe1a5624 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableConnecting.lean @@ -0,0 +1,56 @@ +import OAI.Algebra.AuslanderReiten.Stable.StableHom +import OAI.Algebra.AuslanderReiten.Complete.CompleteResolution + +namespace OAI + +noncomputable section +namespace ArExplicit +universe u +variable {R S₁ P₀ S₀ M B N : Type u} [Ring R] +variable [AddCommGroup S₁] [Module R S₁] [AddCommGroup P₀] [Module R P₀] +variable [AddCommGroup S₀] [Module R S₀] [AddCommGroup M] [Module R M] +variable [AddCommGroup B] [Module R B] [AddCommGroup N] [Module R N] +variable [Module.Finite R P₀] [Module.Projective R P₀] + +theorem stable_connecting_congr (i : S₁ →ₗ[R] P₀) (π : P₀ →ₗ[R] S₀) + (hπi : π.comp i = 0) (f : M →ₗ[R] B) (g : B →ₗ[R] N) + (hf : Function.Injective f) (hg : Function.Surjective g) + (he : LinearMap.range f = LinearMap.ker g) + (s s' : S₀ →ₗ[R] N) (A A' : P₀ →ₗ[R] B) (t t' : S₁ →ₗ[R] M) + (hA : g.comp A = s.comp π) (hA' : g.comp A' = s'.comp π) + (ht : f.comp t = A.comp i) (ht' : f.comp t' = A'.comp i) + (hs : StableHom.classOf R S₀ N s = StableHom.classOf R S₀ N s') : + StableHom.classOf R S₁ M t = StableHom.classOf R S₁ M t' := by + obtain ⟨Q, hQ, hRQ, hfree, hfin, j, v, hv⟩ := (StableHom.classOf_eq_iff s s').mp hs + obtain ⟨vl, hvl⟩ := Module.projective_lifting_property g v hg + let A₀ : P₀ →ₗ[R] B := A - A' - vl.comp (j.comp π) + have hA₀ : g.comp A₀ = 0 := by + ext z + change g (A z - A' z - vl (j (π z))) = 0 + rw [map_sub, map_sub, + show g (A z) = s (π z) from DFunLike.congr_fun hA z, + show g (A' z) = s' (π z) from DFunLike.congr_fun hA' z, + show g (vl (j (π z))) = v (j (π z)) from DFunLike.congr_fun hvl (j (π z))] + change s (π z) - s' (π z) - v (j (π z)) = 0 + rw [show v (j (π z)) = s (π z) - s' (π z) from DFunLike.congr_fun hv (π z)] + exact sub_self _ + obtain ⟨L, hL⟩ := lift_through_exact f g he A₀ hA₀ + have hdiff : L.comp i = t-t' := by + ext z + apply hf + change f (L (i z)) = f (t z - t' z) + rw [map_sub, + show f (L (i z)) = A₀ (i z) from DFunLike.congr_fun hL (i z), + show f (t z) = A (i z) from DFunLike.congr_fun ht z, + show f (t' z) = A' (i z) from DFunLike.congr_fun ht' z] + change A (i z) - A' (i z) - vl (j (π (i z))) = A (i z) - A' (i z) + rw [show π (i z) = 0 from DFunLike.congr_fun hπi z, map_zero, map_zero, sub_zero] + apply (StableHom.classOf_eq_iff t t').mpr + apply (factorsThroughFiniteFree_iff_projective _).mpr + exact ⟨P₀, inferInstance, inferInstance, inferInstance, inferInstance, i, L, hdiff⟩ + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableExt.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..ba3c3fe2b145ae40a70f0ad29543f4b8acc23607 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableExt.lean @@ -0,0 +1,75 @@ +import OAI.Algebra.AuslanderReiten.Ext.ExtBridge +import OAI.Algebra.AuslanderReiten.Complete.CompleteComparison +import OAI.Algebra.AuslanderReiten.Stable.StableHom + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory CompleteComparison + +universe u + +variable {R : Type u} [Ring R] +variable {P : ChainComplex (ModuleCat.{u} R) ℤ} +variable {N : Type u} [AddCommGroup N] [Module R N] + +def completeExtCocycleMap (n : ℤ) (f : P.X n →ₗ[R] N) + (hf : f.comp (P.d (n + 1) n).hom = 0) : Cokernel P n →ₗ[R] N := + (LinearMap.range (P.d (n + 1) n).hom).liftQ f (LinearMap.range_le_ker_iff.mpr hf) + +@[simp] theorem completeExtCocycleMap_mk (n : ℤ) (f : P.X n →ₗ[R] N) + (hf : f.comp (P.d (n + 1) n).hom = 0) (x : P.X n) : + completeExtCocycleMap n f hf ((LinearMap.range (P.d (n + 1) n).hom).mkQ x) = f x := rfl + +theorem completeExtCocycleMap_stable_zero_iff (hP : TotallyAcyclicComplex P) + (n : ℤ) (f : P.X n →ₗ[R] N) (hf : f.comp (P.d (n + 1) n).hom = 0) : + StableHom.classOf R _ N (completeExtCocycleMap n f hf) = 0 ↔ + ∃ g : P.X (n - 1) →ₗ[R] N, g.comp (P.d n (n - 1)).hom = f := by + rw [StableHom.classOf_eq_zero_iff_projective] + constructor + · rintro ⟨Q, hQ, hRQ, hproj, hfin, i, p, hip⟩ + let π := (LinearMap.range (P.d (n + 1) n).hom).mkQ + have hi : (i.comp π).comp (P.d (n + 1) n).hom = 0 := by + rw [LinearMap.comp_assoc, LinearMap.range_mkQ_comp, LinearMap.comp_zero] + obtain ⟨g, hg⟩ := (hP.dualExact n).projective (i.comp π) hi + refine ⟨p.comp g, ?_⟩ + rw [LinearMap.comp_assoc, hg, ← LinearMap.comp_assoc, hip] + rfl + · rintro ⟨g, hg⟩ + let := hP.finite (n - 1) + let := hP.projective (n - 1) + let d : Cokernel P n →ₗ[R] P.X (n - 1) := + completeExtCocycleMap n (P.d n (n - 1)).hom (differential_comp P _ _ _) + refine ⟨P.X (n - 1), inferInstance, inferInstance, inferInstance, inferInstance, d, g, ?_⟩ + apply LinearMap.ext + intro x + obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective (LinearMap.range (P.d (n + 1) n).hom) x + exact DFunLike.congr_fun hg x + +theorem positiveExtVanish_of_stableCokernels (hP : TotallyAcyclicComplex P) + (h : ∀ n : ℕ, Subsingleton (StableHom R (Cokernel P ((n + 1 : ℕ) : ℤ)) N)) : + PositiveExtVanish R (Cokernel P 0) N := by + apply (positiveExtVanish_iff_completeResolution R (Cokernel P 0) N P + hP.projective hP.exactAt (LinearEquiv.refl R _)).mpr + intro n f hf + have hi : ((n + 1 : ℕ) : ℤ) + 1 = ((n + 2 : ℕ) : ℤ) := by omega + have hf' : f.comp (P.d (((n + 1 : ℕ) : ℤ) + 1) ((n + 1 : ℕ) : ℤ)).hom = 0 := by + rw [hi] + exact hf + have := h n + have hz : StableHom.classOf R _ N (completeExtCocycleMap ((n + 1 : ℕ) : ℤ) f hf') = 0 := + Subsingleton.elim _ _ + have hgex := (completeExtCocycleMap_stable_zero_iff hP _ f hf').mp hz + have hn : ((n + 1 : ℕ) : ℤ) - 1 = (n : ℤ) := by omega + rw [hn] at hgex + obtain ⟨g, hg⟩ := hgex + exact ⟨g, hg.symm⟩ + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableExtEquiv.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableExtEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..729868d8e8674bdd5ec80d5ec4c95122bdf69ac5 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableExtEquiv.lean @@ -0,0 +1,142 @@ +import OAI.Algebra.AuslanderReiten.Stable.StableExt +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionHomology + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open scoped ModuleCat.Algebra +namespace ArExplicit +open CompleteComparison +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable {P : ChainComplex (ModuleCat.{u} R) ℤ} (hP : TotallyAcyclicComplex P) +variable (N : ModuleCat.{u} R) + +abbrev completeExtResolution := completeCokernelResolution P hP.projective hP.exactAt + +private theorem closed_of_indices {i j : ℤ} (h : i = j+1) + (f : P.X j →ₗ[R] N) (hf : f.comp (P.d i j).hom = 0) : + f.comp (P.d (j+1) j).hom = 0 := by + subst i + exact hf + +theorem completeExtCycle_closed (n : ℕ) + (f : LinearMap.ker (ResolutionHomology.differential (k := k) (Y := N) + (completeExtResolution hP) (n+1))) : + f.val.hom.comp (P.d (((n+1 : ℕ) : ℤ)+1) ((n+1 : ℕ) : ℤ)).hom = 0 := by + have hf : (nonnegativeTail P).d (n+2) (n+1) ≫ f.val = 0 := f.property + rw [nonnegativeTail_d] at hf + exact closed_of_indices N (by omega : ((n+2 : ℕ) : ℤ) = ((n+1 : ℕ) : ℤ)+1) + f.val.hom (congrArg ModuleCat.Hom.hom hf) + +def completeExtCyclesMap (n : ℕ) : + LinearMap.ker (ResolutionHomology.differential (k := k) (Y := N) + (completeExtResolution hP) (n+1)) →ₗ[k] + (Cokernel P ((n+1 : ℕ) : ℤ) →ₗ[R] N) where + toFun f := completeExtCocycleMap ((n+1 : ℕ) : ℤ) f.val.hom (completeExtCycle_closed hP N n f) + map_add' f g := by + apply LinearMap.ext + intro z + obtain ⟨z,rfl⟩ := Submodule.mkQ_surjective (LinearMap.range + (P.d (((n+1 : ℕ) : ℤ)+1) ((n+1 : ℕ) : ℤ)).hom) z + rfl + map_smul' a f := by + apply LinearMap.ext + intro z + obtain ⟨z,rfl⟩ := Submodule.mkQ_surjective (LinearMap.range + (P.d (((n+1 : ℕ) : ℤ)+1) ((n+1 : ℕ) : ℤ)).hom) z + rfl + +def completeExtCyclesStable (n : ℕ) := + (StableHom.classOfLinear k).comp (completeExtCyclesMap (k := k) hP N n) + +theorem completeExtCyclesMap_surjective (n : ℕ) : + Function.Surjective (completeExtCyclesMap (k := k) hP N n) := by + intro f + let π := (LinearMap.range (P.d (((n+1 : ℕ) : ℤ)+1) ((n+1 : ℕ) : ℤ)).hom).mkQ + let g : (completeExtResolution hP).complex.X (n+1) ⟶ N := ModuleCat.ofHom (f.comp π) + have hg : ResolutionHomology.differential (k := k) (completeExtResolution hP) (n+1) g = 0 := by + change (nonnegativeTail P).d (n+2) (n+1) ≫ g = 0 + rw [nonnegativeTail_d] + apply ModuleCat.hom_ext + change (f.comp π).comp (P.d ((n+2 : ℕ) : ℤ) ((n+1 : ℕ) : ℤ)).hom = 0 + have hi : ((n+2 : ℕ) : ℤ) = ((n+1 : ℕ) : ℤ)+1 := by omega + rw [hi, LinearMap.comp_assoc, LinearMap.range_mkQ_comp, LinearMap.comp_zero] + refine ⟨⟨g,hg⟩, ?_⟩ + apply LinearMap.ext + intro z + obtain ⟨z,rfl⟩ := Submodule.mkQ_surjective (LinearMap.range + (P.d (((n+1 : ℕ) : ℤ)+1) ((n+1 : ℕ) : ℤ)).hom) z + rfl + +theorem completeExtCyclesStable_surjective (n : ℕ) : + Function.Surjective (completeExtCyclesStable (k := k) hP N n) := + StableHom.classOf_surjective.comp (completeExtCyclesMap_surjective hP N n) + +theorem completeExtCyclesStable_kernel (n : ℕ) : + LinearMap.ker (completeExtCyclesStable (k := k) hP N n) = + LinearHomology.boundaries + (ResolutionHomology.differential (k := k) (Y := N) (completeExtResolution hP) n) + (ResolutionHomology.differential (completeExtResolution hP) (n+1)) + (ResolutionHomology.differential_comp (completeExtResolution hP) n) := by + ext x + change StableHom.classOf R _ N (completeExtCocycleMap ((n+1 : ℕ) : ℤ) x.val.hom + (completeExtCycle_closed hP N n x)) = 0 ↔ _ + refine (completeExtCocycleMap_stable_zero_iff hP ((n+1 : ℕ) : ℤ) + (show P.X ((n+1 : ℕ) : ℤ) →ₗ[R] N from x.val.hom) (completeExtCycle_closed hP N n x)).trans ?_ + have hprev : ((n+1 : ℕ) : ℤ)-1 = (n : ℤ) := by omega + rw [hprev] + constructor + · rintro ⟨g,hg⟩ + refine ⟨ModuleCat.ofHom g, Subtype.ext ?_⟩ + apply ModuleCat.hom_ext + change ((nonnegativeTail P).d (n+1) n ≫ ModuleCat.ofHom g).hom = x.val.hom + rw [nonnegativeTail_d] + exact hg + · rintro ⟨g,hg⟩ + refine ⟨g.hom, ?_⟩ + have hh := congrArg (fun y => y.val.hom) hg + change ((nonnegativeTail P).d (n+1) n ≫ g).hom = x.val.hom at hh + rw [nonnegativeTail_d] at hh + exact hh + +def completeExtHomologyStableEquiv (n : ℕ) : + LinearHomology.Homology + (ResolutionHomology.differential (k := k) (Y := N) (completeExtResolution hP) n) + (ResolutionHomology.differential (completeExtResolution hP) (n+1)) + (ResolutionHomology.differential_comp (completeExtResolution hP) n) ≃ₗ[k] + StableHom R (Cokernel P ((n+1 : ℕ) : ℤ)) N := + (Submodule.quotEquivOfEq _ _ (completeExtCyclesStable_kernel hP N n).symm).trans + ((completeExtCyclesStable hP N n).quotKerEquivOfSurjective + (completeExtCyclesStable_surjective hP N n)) + +def positiveExtStableEquiv (n : ℕ) : + Ext (ModuleCat.of R (Cokernel P 0)) N (n+1) ≃ₗ[k] + StableHom R (Cokernel P ((n+1 : ℕ) : ℤ)) N := + (ResolutionHomology.extEquiv (k := k) (Y := N) (completeExtResolution hP) n).symm.trans + (completeExtHomologyStableEquiv hP N n) + +theorem positiveExtStableEquiv_extMk (n : ℕ) + (f : (completeExtResolution hP).complex.X (n+1) ⟶ N) + (hf : (completeExtResolution hP).complex.d (n+2) (n+1) ≫ f = 0) : + positiveExtStableEquiv (k := k) hP N n + ((completeExtResolution hP).extMk f (n+2) rfl hf) = + completeExtCyclesStable (k := k) hP N n ⟨f,hf⟩ := by + let z : LinearMap.ker (ResolutionHomology.differential (k := k) (Y := N) + (completeExtResolution hP) (n+1)) := ⟨f,hf⟩ + have he : ResolutionHomology.extEquiv (k := k) (Y := N) (completeExtResolution hP) n + (Submodule.Quotient.mk z) = (completeExtResolution hP).extMk f (n+2) rfl hf := rfl + rw [← he] + change completeExtHomologyStableEquiv hP N n + ((ResolutionHomology.extEquiv (k := k) (Y := N) (completeExtResolution hP) n).symm + ((ResolutionHomology.extEquiv (k := k) (Y := N) (completeExtResolution hP) n) + (Submodule.Quotient.mk z))) = _ + rw [LinearEquiv.symm_apply_apply] + rfl + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableExtNaturality.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableExtNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b009740d4e11081540a58eb62833ff5001c2047 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableExtNaturality.lean @@ -0,0 +1,35 @@ +import OAI.Algebra.AuslanderReiten.Stable.StableExtEquiv + +namespace OAI + +noncomputable section +namespace ArExplicit +open CategoryTheory CategoryTheory.Abelian CompleteComparison +open scoped ModuleCat.Algebra +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable {P : ChainComplex (ModuleCat.{u} R) ℤ} (hP : TotallyAcyclicComplex P) +variable {N N' : ModuleCat.{u} R} + +theorem positiveExtStableEquiv_postcomp (n : ℕ) (g : N ⟶ N') + (x : Ext (ModuleCat.of R (Cokernel P 0)) N (n+1)) : + positiveExtStableEquiv (k := k) hP N' n + (x.comp (Ext.mk₀ g) (add_zero _)) = + StableHom.postcomp g.hom (positiveExtStableEquiv (k := k) hP N n x) := by + obtain ⟨f, hf, rfl⟩ := (completeExtResolution hP).extMk_surjective x (n+2) rfl + rw [ProjectiveResolution.extMk_comp_mk₀, positiveExtStableEquiv_extMk, + positiveExtStableEquiv_extMk] + change StableHom.classOf R _ _ _ = StableHom.postcomp g.hom (StableHom.classOf R _ _ _) + rw [StableHom.postcomp_classOf] + apply congrArg (StableHom.classOf R _ _) + apply LinearMap.ext + intro z + obtain ⟨z, rfl⟩ := Submodule.mkQ_surjective + (LinearMap.range (P.d (((n+1 : ℕ) : ℤ)+1) ((n+1 : ℕ) : ℤ)).hom) z + rfl + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableExtPrecomp.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableExtPrecomp.lean new file mode 100644 index 0000000000000000000000000000000000000000..a8efce19db9cf127faa00d38f6dd2b5cedb7dfc2 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableExtPrecomp.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.Complete.CompleteTailMap +import OAI.Algebra.AuslanderReiten.Stable.StableExtNaturality + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open scoped ModuleCat.Algebra +namespace ArExplicit +open CompleteComparison +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable {P Q : ChainComplex (ModuleCat.{u} R) ℤ} +variable (hP : TotallyAcyclicComplex P) (hQ : TotallyAcyclicComplex Q) +variable (f : P ⟶ Q) (N : ModuleCat.{u} R) + +theorem positiveExtStableEquiv_precomp (n : ℕ) + (x : Ext (ModuleCat.of R (Cokernel Q 0)) N (n+1)) : + positiveExtStableEquiv (k := k) hP N n + ((Ext.mk₀ (ModuleCat.ofHom (cokernelMap f 0))).comp x (zero_add _)) = + StableHom.precomp (cokernelMap f ((n+1 : ℕ) : ℤ)) + (positiveExtStableEquiv (k := k) hQ N n x) := by + obtain ⟨g, hg, rfl⟩ := (completeExtResolution hQ).extMk_surjective x (n+2) rfl + rw [ProjectiveResolution.mk₀_comp_extMk g (n+2) rfl hg (completeTailHom f hP hQ), + positiveExtStableEquiv_extMk, positiveExtStableEquiv_extMk] + change StableHom.classOf R _ _ _ = StableHom.precomp _ (StableHom.classOf R _ _ _) + rw [StableHom.precomp_classOf] + apply congrArg (StableHom.classOf R _ _) + apply LinearMap.ext + intro z + obtain ⟨z, rfl⟩ := Submodule.mkQ_surjective + (LinearMap.range (P.d (((n+1 : ℕ) : ℤ)+1) ((n+1 : ℕ) : ℤ)).hom) z + rfl + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableHom.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableHom.lean new file mode 100644 index 0000000000000000000000000000000000000000..e033f6579908bc0a66d4ecd64d3556a5553bb67f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableHom.lean @@ -0,0 +1,298 @@ +import Mathlib.Algebra.Module.Projective +import Mathlib.RingTheory.Finiteness.Cardinality +import Mathlib.RingTheory.Finiteness.Prod +import Mathlib.LinearAlgebra.Basis.Prod +import Mathlib.GroupTheory.QuotientGroup.Defs +import Mathlib.Algebra.Algebra.Tower + +namespace OAI + +universe u + +namespace ArExplicit + +variable (R : Type u) [Ring R] +variable (M N : Type u) [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] + +def FactorsThroughFiniteFree (f : M →ₗ[R] N) : Prop := + ∃ (P : Type u) (_ : AddCommGroup P) (_ : Module R P) + (_ : Module.Free R P) (_ : Module.Finite R P) + (i : M →ₗ[R] P) (p : P →ₗ[R] N), p.comp i = f + +def FactorsThroughFiniteProjective (f : M →ₗ[R] N) : Prop := + ∃ (P : Type u) (_ : AddCommGroup P) (_ : Module R P) + (_ : Module.Projective R P) (_ : Module.Finite R P) + (i : M →ₗ[R] P) (p : P →ₗ[R] N), p.comp i = f + +variable {R M N} + +theorem factorsThroughFiniteFree_iff_projective (f : M →ₗ[R] N) : + FactorsThroughFiniteFree R M N f ↔ FactorsThroughFiniteProjective R M N f := by + constructor + · rintro ⟨P, hP, hRP, hfree, hfinite, i, p, h⟩ + exact ⟨P, hP, hRP, inferInstance, hfinite, i, p, h⟩ + · rintro ⟨P, hP, hRP, hprojective, hfinite, i, p, h⟩ + obtain ⟨n, π, hπ⟩ := Module.Finite.exists_fin' R P + obtain ⟨s, hs⟩ := Module.projective_lifting_property π (LinearMap.id : P →ₗ[R] P) hπ + refine ⟨Fin n → R, inferInstance, inferInstance, inferInstance, inferInstance, + s.comp i, p.comp π, ?_⟩ + ext x + calc + p (π (s (i x))) = p (i x) := congrArg p (DFunLike.congr_fun hs (i x)) + _ = f x := DFunLike.congr_fun h x + +theorem factorsThroughFiniteFree_zero : + FactorsThroughFiniteFree R M N (0 : M →ₗ[R] N) := by + exact ⟨R, inferInstance, inferInstance, inferInstance, inferInstance, 0, 0, rfl⟩ + +theorem FactorsThroughFiniteFree.add {f g : M →ₗ[R] N} + (hf : FactorsThroughFiniteFree R M N f) (hg : FactorsThroughFiniteFree R M N g) : + FactorsThroughFiniteFree R M N (f + g) := by + rcases hf with ⟨P, hP, hRP, hfreeP, hfiniteP, i, p, rfl⟩ + rcases hg with ⟨Q, hQ, hRQ, hfreeQ, hfiniteQ, j, q, rfl⟩ + refine ⟨P × Q, inferInstance, inferInstance, inferInstance, inferInstance, + i.prod j, p.coprod q, ?_⟩ + ext x + rfl + +theorem FactorsThroughFiniteFree.neg {f : M →ₗ[R] N} + (hf : FactorsThroughFiniteFree R M N f) : + FactorsThroughFiniteFree R M N (-f) := by + rcases hf with ⟨P, hP, hRP, hfreeP, hfiniteP, i, p, rfl⟩ + refine ⟨P, hP, hRP, hfreeP, hfiniteP, i, -p, ?_⟩ + ext x + rfl + +variable {L P : Type u} [AddCommGroup L] [Module R L] [AddCommGroup P] [Module R P] + +theorem FactorsThroughFiniteFree.postcomp {f : M →ₗ[R] N} + (hf : FactorsThroughFiniteFree R M N f) (g : N →ₗ[R] P) : + FactorsThroughFiniteFree R M P (g.comp f) := by + rcases hf with ⟨Q, hQ, hRQ, hfreeQ, hfiniteQ, i, p, rfl⟩ + exact ⟨Q, hQ, hRQ, hfreeQ, hfiniteQ, i, g.comp p, LinearMap.comp_assoc ..⟩ + +theorem FactorsThroughFiniteFree.precomp {f : M →ₗ[R] N} + (hf : FactorsThroughFiniteFree R M N f) (g : L →ₗ[R] M) : + FactorsThroughFiniteFree R L N (f.comp g) := by + rcases hf with ⟨Q, hQ, hRQ, hfreeQ, hfiniteQ, i, p, rfl⟩ + exact ⟨Q, hQ, hRQ, hfreeQ, hfiniteQ, i.comp g, p, (LinearMap.comp_assoc ..).symm⟩ + +variable (R M N) + +def projectiveMaps : AddSubgroup (M →ₗ[R] N) where + carrier := FactorsThroughFiniteFree R M N + zero_mem' := factorsThroughFiniteFree_zero + add_mem' := FactorsThroughFiniteFree.add + neg_mem' := FactorsThroughFiniteFree.neg + +abbrev StableHom := (M →ₗ[R] N) ⧸ projectiveMaps R M N + +namespace StableHom + +def classOf : (M →ₗ[R] N) →+ StableHom R M N := + QuotientAddGroup.mk' (projectiveMaps R M N) + +variable {R M N} + +theorem classOf_surjective : Function.Surjective (classOf R M N) := + QuotientAddGroup.mk'_surjective _ + +@[simp] +theorem classOf_eq_zero_iff (f : M →ₗ[R] N) : + classOf R M N f = 0 ↔ FactorsThroughFiniteFree R M N f := + QuotientAddGroup.eq_zero_iff f + +theorem classOf_eq_zero_iff_projective (f : M →ₗ[R] N) : + classOf R M N f = 0 ↔ FactorsThroughFiniteProjective R M N f := by + rw [classOf_eq_zero_iff, factorsThroughFiniteFree_iff_projective] + +@[simp] +theorem classOf_eq_iff (f g : M →ₗ[R] N) : + classOf R M N f = classOf R M N g ↔ FactorsThroughFiniteFree R M N (f - g) := + QuotientAddGroup.eq_iff_sub_mem + +theorem identity_eq_zero_iff [Module.Finite R M] : + classOf R M M LinearMap.id = 0 ↔ Module.Projective R M := by + rw [classOf_eq_zero_iff_projective] + constructor + · rintro ⟨P, hP, hRP, hprojective, hfinite, i, p, h⟩ + exact Module.Projective.of_split i p h + · intro h + exact ⟨M, inferInstance, inferInstance, h, inferInstance, + LinearMap.id, LinearMap.id, rfl⟩ + +def postcomp (g : N →ₗ[R] P) : StableHom R M N →+ StableHom R M P := + QuotientAddGroup.map (projectiveMaps R M N) (projectiveMaps R M P) + { toFun := fun f => g.comp f + map_zero' := LinearMap.comp_zero g + map_add' := by intros; ext x; simp } + (fun _ hf => hf.postcomp g) + +def precomp (g : L →ₗ[R] M) : StableHom R M N →+ StableHom R L N := + QuotientAddGroup.map (projectiveMaps R M N) (projectiveMaps R L N) + { toFun := fun f => f.comp g + map_zero' := LinearMap.zero_comp g + map_add' := by intros; ext x; simp } + (fun _ hf => hf.precomp g) + +@[simp] +theorem postcomp_classOf (g : N →ₗ[R] P) (f : M →ₗ[R] N) : + postcomp g (classOf R M N f) = classOf R M P (g.comp f) := by + exact QuotientAddGroup.map_mk' _ _ _ _ _ + +@[simp] +theorem precomp_classOf (g : L →ₗ[R] M) (f : M →ₗ[R] N) : + precomp g (classOf R M N f) = classOf R L N (f.comp g) := by + exact QuotientAddGroup.map_mk' _ _ _ _ _ + +def postcompHom : (N →ₗ[R] P) →+ (StableHom R M N →+ StableHom R M P) where + toFun := postcomp + map_zero' := by + apply AddMonoidHom.ext + intro f + obtain ⟨f, rfl⟩ := classOf_surjective f + simp + map_add' := by + intro g h + apply AddMonoidHom.ext + intro f + obtain ⟨f, rfl⟩ := classOf_surjective f + simp only [AddMonoidHom.add_apply, postcomp_classOf] + rw [show (g + h).comp f = g.comp f + h.comp f by ext x; rfl] + exact map_add (classOf R M P) _ _ + +def comp : StableHom R N P →+ (StableHom R M N →+ StableHom R M P) := + QuotientAddGroup.lift (projectiveMaps R N P) postcompHom (by + intro g hg + change postcomp g = 0 + apply AddMonoidHom.ext + intro f + obtain ⟨f, rfl⟩ := classOf_surjective f + exact (classOf_eq_zero_iff (g.comp f)).mpr (hg.precomp f)) + +@[simp] +theorem comp_classOf (g : N →ₗ[R] P) (f : M →ₗ[R] N) : + comp (classOf R N P g) (classOf R M N f) = classOf R M P (g.comp f) := by + change postcomp g (classOf R M N f) = _ + exact postcomp_classOf g f + +def identity : StableHom R M M := classOf R M M LinearMap.id + +@[simp] +theorem identity_comp (f : StableHom R M N) : comp identity f = f := by + obtain ⟨f, rfl⟩ := classOf_surjective f + simp [identity] + +@[simp] +theorem comp_identity (f : StableHom R M N) : comp f identity = f := by + obtain ⟨f, rfl⟩ := classOf_surjective f + simp [identity] + +theorem comp_assoc {Q : Type u} [AddCommGroup Q] [Module R Q] + (h : StableHom R P Q) (g : StableHom R N P) (f : StableHom R M N) : + comp h (comp g f) = comp (comp h g) f := by + obtain ⟨h, rfl⟩ := classOf_surjective h + obtain ⟨g, rfl⟩ := classOf_surjective g + obtain ⟨f, rfl⟩ := classOf_surjective f + simp only [comp_classOf, LinearMap.comp_assoc] + +theorem eq_zero_of_projective_source [Module.Finite R M] [Module.Projective R M] + (f : StableHom R M N) : f = 0 := by + obtain ⟨f, rfl⟩ := classOf_surjective f + apply (classOf_eq_zero_iff_projective f).mpr + exact ⟨M, inferInstance, inferInstance, inferInstance, inferInstance, + LinearMap.id, f, LinearMap.comp_id _⟩ + +theorem eq_zero_of_projective_target [Module.Finite R N] [Module.Projective R N] + (f : StableHom R M N) : f = 0 := by + obtain ⟨f, rfl⟩ := classOf_surjective f + apply (classOf_eq_zero_iff_projective f).mpr + exact ⟨N, inferInstance, inferInstance, inferInstance, inferInstance, + f, LinearMap.id, LinearMap.id_comp _⟩ + +end StableHom + +section CentralScalars + +variable {R M N} +variable (k : Type u) [CommRing k] [Algebra k R] +variable [Module k N] [IsScalarTower k R N] + +theorem FactorsThroughFiniteFree.smul {f : M →ₗ[R] N} + (hf : FactorsThroughFiniteFree R M N f) (a : k) : + FactorsThroughFiniteFree R M N (a • f) := by + rcases hf with ⟨Q, hQ, hRQ, hfreeQ, hfiniteQ, i, p, rfl⟩ + refine ⟨Q, hQ, hRQ, hfreeQ, hfiniteQ, i, a • p, ?_⟩ + ext x + rfl + +def projectiveMapsSubmodule : Submodule k (M →ₗ[R] N) where + __ := projectiveMaps R M N + smul_mem' := fun a _ hf => hf.smul k a + +instance stableHomModule : Module k (StableHom R M N) := + inferInstanceAs (Module k ((M →ₗ[R] N) ⧸ projectiveMapsSubmodule k)) + +namespace StableHom + +def classOfLinear : (M →ₗ[R] N) →ₗ[k] StableHom R M N := + (projectiveMapsSubmodule k).mkQ + +@[simp] +theorem classOfLinear_apply (f : M →ₗ[R] N) : + classOfLinear k f = classOf R M N f := rfl + +@[simp] +theorem classOf_smul (a : k) (f : M →ₗ[R] N) : + classOf R M N (a • f) = a • classOf R M N f := + (classOfLinear k).map_smul a f + +variable [Module k P] [IsScalarTower k R P] + +theorem comp_smul (g : StableHom R N P) (a : k) (f : StableHom R M N) : + comp g (a • f) = a • comp g f := by + obtain ⟨g, rfl⟩ := classOf_surjective g + obtain ⟨f, rfl⟩ := classOf_surjective f + rw [← classOf_smul k a f, comp_classOf, LinearMap.comp_smul, + classOf_smul, comp_classOf] + +omit [Module k N] [IsScalarTower k R N] in +theorem smul_comp (a : k) (g : StableHom R N P) (f : StableHom R M N) : + comp (a • g) f = a • comp g f := by + obtain ⟨g, rfl⟩ := classOf_surjective g + obtain ⟨f, rfl⟩ := classOf_surjective f + rw [← classOf_smul k a g, comp_classOf, LinearMap.smul_comp, + classOf_smul, comp_classOf] + +def postcompLinear (g : StableHom R N P) : + StableHom R M N →ₗ[k] StableHom R M P where + toFun := comp g + map_add' := map_add (comp g) + map_smul' := comp_smul k g + +def compLinear : + StableHom R N P →ₗ[k] (StableHom R M N →ₗ[k] StableHom R M P) where + toFun := postcompLinear k + map_add' := by + intro g h + apply LinearMap.ext + intro f + change comp (g + h) f = comp g f + comp h f + exact DFunLike.congr_fun (map_add comp g h) f + map_smul' := by + intro a g + apply LinearMap.ext + intro f + exact smul_comp k a g f + +@[simp] +theorem compLinear_apply (g : StableHom R N P) (f : StableHom R M N) : + compLinear k g f = comp g f := rfl + +end StableHom + +end CentralScalars + +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableHomEquiv.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableHomEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..151ddaf9df0a89cf1af3b4b767b06a1dc7a5b4b9 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableHomEquiv.lean @@ -0,0 +1,70 @@ +import OAI.Algebra.AuslanderReiten.Stable.StableHom + +namespace OAI + +namespace ArExplicit.StableHom + +universe u + +variable {k R : Type u} [CommRing k] [Ring R] [Algebra k R] +variable {M M' N N' : Type u} +variable [AddCommGroup M] [Module R M] [AddCommGroup M'] [Module R M'] +variable [AddCommGroup N] [Module R N] [Module k N] [IsScalarTower k R N] +variable [AddCommGroup N'] [Module R N'] [Module k N'] [IsScalarTower k R N'] + +def sourceEquiv (e : M ≃ₗ[R] M') : StableHom R M' N ≃ₗ[k] StableHom R M N where + toFun := precomp e.toLinearMap + invFun := precomp e.symm.toLinearMap + left_inv f := by + obtain ⟨f, rfl⟩ := classOf_surjective f + simp only [precomp_classOf] + congr 1 + ext x + simp + right_inv f := by + obtain ⟨f, rfl⟩ := classOf_surjective f + simp only [precomp_classOf] + congr 1 + ext x + simp + map_add' := map_add _ + map_smul' c f := by + obtain ⟨f, rfl⟩ := classOf_surjective f + rw [← classOf_smul k, precomp_classOf, precomp_classOf, ← classOf_smul k] + rfl + +def targetEquiv (e : N ≃ₗ[R] N') : StableHom R M N ≃ₗ[k] StableHom R M N' where + toFun := postcomp e.toLinearMap + invFun := postcomp e.symm.toLinearMap + left_inv f := by + obtain ⟨f, rfl⟩ := classOf_surjective f + simp only [postcomp_classOf] + congr 1 + ext x + simp + right_inv f := by + obtain ⟨f, rfl⟩ := classOf_surjective f + simp only [postcomp_classOf] + congr 1 + ext x + simp + map_add' := map_add _ + map_smul' c f := by + obtain ⟨f, rfl⟩ := classOf_surjective f + rw [← classOf_smul k, postcomp_classOf, postcomp_classOf, ← classOf_smul k] + congr 1 + exact LinearMap.comp_smul _ _ _ + +@[simp] +theorem sourceEquiv_classOf (e : M ≃ₗ[R] M') (f : M' →ₗ[R] N) : + sourceEquiv (k := k) e (classOf R M' N f) = classOf R M N (f.comp e.toLinearMap) := + precomp_classOf _ _ + +@[simp] +theorem targetEquiv_classOf (e : N ≃ₗ[R] N') (f : M →ₗ[R] N) : + targetEquiv (k := k) e (classOf R M N f) = classOf R M N' (e.toLinearMap.comp f) := + postcomp_classOf _ _ + +end ArExplicit.StableHom + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableHomology.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..29d8bae994fa9a1d60ca544da6117c40cff87383 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableHomology.lean @@ -0,0 +1,146 @@ +import OAI.Algebra.AuslanderReiten.Duality.LinearHomologyDuality +import OAI.Algebra.AuslanderReiten.Complete.CompleteResolution +import OAI.Algebra.AuslanderReiten.Stable.StableHom + +namespace OAI + +namespace ArExplicit.StableHomology + +universe u + +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable {P₁ P₀ Pminus N : Type u} +variable [AddCommGroup P₁] [Module R P₁] [AddCommGroup P₀] [Module R P₀] +variable [AddCommGroup Pminus] [Module R Pminus] [AddCommGroup N] [Module R N] +variable [Module k N] [IsScalarTower k R N] + +def precomp {L M : Type u} [AddCommGroup L] [Module R L] [AddCommGroup M] [Module R M] + (f : L →ₗ[R] M) : (M →ₗ[R] N) →ₗ[k] (L →ₗ[R] N) where + toFun g := g.comp f + map_add' _ _ := rfl + map_smul' _ _ := rfl + +theorem precomp_comp (e : P₁ →ₗ[R] P₀) (d : P₀ →ₗ[R] Pminus) (h : d.comp e = 0) : + (precomp (k := k) (N := N) e).comp (precomp d) = 0 := by + ext f x + change f (d (e x)) = 0 + rw [show d (e x) = 0 from DFunLike.congr_fun h x, map_zero] + +abbrev Cokernel (e : P₁ →ₗ[R] P₀) := P₀ ⧸ LinearMap.range e + +def cycleToMap (e : P₁ →ₗ[R] P₀) + (z : LinearMap.ker (precomp (k := k) (N := N) e)) : Cokernel e →ₗ[R] N := + (LinearMap.range e).liftQ z.val (by + rintro _ ⟨x, rfl⟩ + exact DFunLike.congr_fun z.property x) + +@[simp] +theorem cycleToMap_mkQ (e : P₁ →ₗ[R] P₀) + (z : LinearMap.ker (precomp (k := k) (N := N) e)) (x : P₀) : + cycleToMap e z ((LinearMap.range e).mkQ x) = z.val x := rfl + +def cyclesToStable (e : P₁ →ₗ[R] P₀) : + LinearMap.ker (precomp (k := k) (N := N) e) →ₗ[k] StableHom R (Cokernel e) N where + toFun z := StableHom.classOf R _ _ (cycleToMap e z) + map_add' z w := by + have he : cycleToMap e (z + w) = cycleToMap e z + cycleToMap e w := by + apply LinearMap.ext + intro x + obtain ⟨y, rfl⟩ := Submodule.mkQ_surjective (LinearMap.range e) x + rfl + rw [he, map_add] + map_smul' c z := by + have he : cycleToMap e (c • z) = c • cycleToMap e z := by + apply LinearMap.ext + intro x + obtain ⟨y, rfl⟩ := Submodule.mkQ_surjective (LinearMap.range e) x + rfl + rw [he, StableHom.classOf_smul] + rfl + +theorem cyclesToStable_surjective (e : P₁ →ₗ[R] P₀) : + Function.Surjective (cyclesToStable (k := k) (N := N) e) := by + intro x + obtain ⟨f, rfl⟩ := StableHom.classOf_surjective x + have hz : f.comp (LinearMap.range e).mkQ ∈ LinearMap.ker (precomp (k := k) e) := by + ext y + change f ((LinearMap.range e).mkQ (e y)) = 0 + rw [show (LinearMap.range e).mkQ (e y) = 0 from + (Submodule.Quotient.mk_eq_zero _).mpr ⟨y, rfl⟩, map_zero] + refine ⟨⟨f.comp (LinearMap.range e).mkQ, hz⟩, ?_⟩ + apply congrArg (StableHom.classOf R (Cokernel e) N) + apply LinearMap.ext + intro x + obtain ⟨y, rfl⟩ := Submodule.mkQ_surjective (LinearMap.range e) x + rfl + +theorem cyclesToStable_kernel [Module.Finite R Pminus] [Module.Projective R Pminus] + (e : P₁ →ₗ[R] P₀) (d : P₀ →ₗ[R] Pminus) (h : d.comp e = 0) + (hd : HomExactAt e d) : + LinearMap.ker (cyclesToStable (k := k) (N := N) e) = + LinearHomology.boundaries (precomp d) (precomp e) (precomp_comp e d h) := by + ext z + constructor + · intro hz + change StableHom.classOf R (Cokernel e) N (cycleToMap e z) = 0 at hz + rcases (StableHom.classOf_eq_zero_iff_projective (cycleToMap e z)).mp hz with + ⟨T, hT, hRT, hpT, hfT, a, b, hab⟩ + have ha : (a.comp (LinearMap.range e).mkQ).comp e = 0 := by + ext x + change a ((LinearMap.range e).mkQ (e x)) = 0 + rw [show (LinearMap.range e).mkQ (e x) = 0 from + (Submodule.Quotient.mk_eq_zero _).mpr ⟨x, rfl⟩, map_zero] + obtain ⟨A, hA⟩ := hd.projective (a.comp (LinearMap.range e).mkQ) ha + refine ⟨b.comp A, ?_⟩ + apply Subtype.ext + apply LinearMap.ext + intro x + change b (A (d x)) = z.val x + rw [show A (d x) = a ((LinearMap.range e).mkQ x) from DFunLike.congr_fun hA x] + exact DFunLike.congr_fun hab ((LinearMap.range e).mkQ x) + · rintro ⟨b, rfl⟩ + apply (StableHom.classOf_eq_zero_iff_projective _).mpr + have he : LinearMap.range e ≤ LinearMap.ker d := LinearMap.range_le_ker_iff.mpr h + refine ⟨Pminus, inferInstance, inferInstance, inferInstance, inferInstance, + (LinearMap.range e).liftQ d he, b, ?_⟩ + apply LinearMap.ext + intro x + obtain ⟨y, rfl⟩ := Submodule.mkQ_surjective (LinearMap.range e) x + rfl + +noncomputable def homologyStableEquiv [Module.Finite R Pminus] [Module.Projective R Pminus] + (e : P₁ →ₗ[R] P₀) (d : P₀ →ₗ[R] Pminus) (h : d.comp e = 0) + (hd : HomExactAt e d) : + LinearHomology.Homology (precomp (k := k) (N := N) d) (precomp e) (precomp_comp e d h) + ≃ₗ[k] StableHom R (Cokernel e) N := + (Submodule.quotEquivOfEq _ _ (cyclesToStable_kernel e d h hd).symm).trans + ((cyclesToStable e).quotKerEquivOfSurjective (cyclesToStable_surjective e)) + +@[simp] +theorem homologyStableEquiv_mk [Module.Finite R Pminus] [Module.Projective R Pminus] + (e : P₁ →ₗ[R] P₀) (d : P₀ →ₗ[R] Pminus) (h : d.comp e = 0) + (hd : HomExactAt e d) (z : LinearMap.ker (precomp (k := k) (N := N) e)) : + homologyStableEquiv e d h hd + ((LinearHomology.boundaries (precomp d) (precomp e) (precomp_comp e d h)).mkQ z) = + cyclesToStable e z := rfl + +def mapToCycle (e : P₁ →ₗ[R] P₀) (f : Cokernel e →ₗ[R] N) : + LinearMap.ker (precomp (k := k) (N := N) e) := + ⟨f.comp (LinearMap.range e).mkQ, by + ext x + change f ((LinearMap.range e).mkQ (e x)) = 0 + rw [show (LinearMap.range e).mkQ (e x) = 0 from + (Submodule.Quotient.mk_eq_zero _).mpr ⟨x, rfl⟩, map_zero]⟩ + +@[simp] +theorem cyclesToStable_mapToCycle (e : P₁ →ₗ[R] P₀) (f : Cokernel e →ₗ[R] N) : + cyclesToStable e (mapToCycle (k := k) e f) = StableHom.classOf R _ _ f := by + apply congrArg (StableHom.classOf R (Cokernel e) N) + apply LinearMap.ext + intro x + obtain ⟨y, rfl⟩ := Submodule.mkQ_surjective (LinearMap.range e) x + rfl + +end ArExplicit.StableHomology + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableHomotopyIso.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableHomotopyIso.lean new file mode 100644 index 0000000000000000000000000000000000000000..ddc1054339745c5b16758553d0ba97201dbb81ec --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableHomotopyIso.lean @@ -0,0 +1,57 @@ +import OAI.Algebra.AuslanderReiten.Stable.StableIsomorphism +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomComparison + +namespace OAI + +open CategoryTheory + +namespace ArExplicit.CompleteComparison + +universe u + +variable {R : Type u} [Ring R] +variable {P Q : ChainComplex (ModuleCat.{u} R) ℤ} + +@[simp] +theorem homotopyCokernelEquiv_id (hP : TotallyAcyclicComplex P) : + homotopyCokernelEquiv hP hP.toExactProjectiveComplex (𝟙 _) = StableHom.identity := by + rw [← (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.down ℤ)).map_id, + homotopyCokernelEquiv_map, cokernelMap_id] + rfl + +noncomputable def stableHomotopyIso (hP : TotallyAcyclicComplex P) + (hQ : TotallyAcyclicComplex Q) (e : StableIsomorphism R (Cokernel P 0) (Cokernel Q 0)) : + (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.down ℤ)).obj P ≅ + (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.down ℤ)).obj Q where + hom := (homotopyCokernelEquiv hP hQ.toExactProjectiveComplex).symm e.hom + inv := (homotopyCokernelEquiv hQ hP.toExactProjectiveComplex).symm e.inv + hom_inv_id := by + apply (homotopyCokernelEquiv hP hP.toExactProjectiveComplex).injective + rw [homotopyCokernelEquiv_comp hP hQ hP.toExactProjectiveComplex, + AddEquiv.apply_symm_apply, AddEquiv.apply_symm_apply, homotopyCokernelEquiv_id] + exact e.hom_inv_id + inv_hom_id := by + apply (homotopyCokernelEquiv hQ hQ.toExactProjectiveComplex).injective + rw [homotopyCokernelEquiv_comp hQ hP hQ.toExactProjectiveComplex, + AddEquiv.apply_symm_apply, AddEquiv.apply_symm_apply, homotopyCokernelEquiv_id] + exact e.inv_hom_id + +@[simp] +theorem stableHomotopyIso_hom (hP : TotallyAcyclicComplex P) + (hQ : TotallyAcyclicComplex Q) (e : StableIsomorphism R (Cokernel P 0) (Cokernel Q 0)) : + homotopyCokernelEquiv hP hQ.toExactProjectiveComplex (stableHomotopyIso hP hQ e).hom = + e.hom := AddEquiv.apply_symm_apply _ _ + +noncomputable def stableCochainHomotopyIso + {K L : CochainComplex (ModuleCat.{u} R) ℤ} + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : TotallyAcyclicComplex (chainOfCochain L)) + (e : StableIsomorphism R (Cokernel (chainOfCochain K) 0) (Cokernel (chainOfCochain L) 0)) : + (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.up ℤ)).obj K ≅ + (HomotopyCategory.quotient (ModuleCat.{u} R) (ComplexShape.up ℤ)).obj L := + (negIndexEmbedding.extendHomotopyFunctor (ModuleCat.{u} R)).preimageIso + (stableHomotopyIso hK hL e) + +end ArExplicit.CompleteComparison + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableIsomorphism.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableIsomorphism.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f6c9d39a1396d540eb90904f9cccaed884f372f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableIsomorphism.lean @@ -0,0 +1,125 @@ +import OAI.Algebra.AuslanderReiten.Stable.StableHomEquiv +import OAI.Algebra.AuslanderReiten.Modules.SplitModules +import Mathlib.LinearAlgebra.Isomorphisms +import Mathlib.Algebra.Exact.Basic + +namespace OAI + +namespace ArExplicit + +universe u + +variable (R M N : Type u) [Ring R] +variable [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] + +structure StableIsomorphism where + hom : StableHom R M N + inv : StableHom R N M + hom_inv_id : StableHom.comp inv hom = StableHom.identity + inv_hom_id : StableHom.comp hom inv = StableHom.identity + +namespace StableIsomorphism + +variable {R M N} +variable {P : Type u} [AddCommGroup P] [Module R P] + +def refl : StableIsomorphism R M M where + hom := StableHom.identity + inv := StableHom.identity + hom_inv_id := StableHom.identity_comp _ + inv_hom_id := StableHom.identity_comp _ + +def symm (e : StableIsomorphism R M N) : StableIsomorphism R N M where + hom := e.inv + inv := e.hom + hom_inv_id := e.inv_hom_id + inv_hom_id := e.hom_inv_id + +def ofLinearEquiv (e : M ≃ₗ[R] N) : StableIsomorphism R M N where + hom := StableHom.classOf R _ _ e.toLinearMap + inv := StableHom.classOf R _ _ e.symm.toLinearMap + hom_inv_id := by simp [StableHom.identity] + inv_hom_id := by simp [StableHom.identity] + +def trans (e : StableIsomorphism R M N) (f : StableIsomorphism R N P) : + StableIsomorphism R M P where + hom := StableHom.comp f.hom e.hom + inv := StableHom.comp e.inv f.inv + hom_inv_id := by + rw [← StableHom.comp_assoc, StableHom.comp_assoc f.inv, + f.hom_inv_id, StableHom.identity_comp, e.hom_inv_id] + inv_hom_id := by + rw [← StableHom.comp_assoc, StableHom.comp_assoc e.hom, + e.inv_hom_id, StableHom.identity_comp, f.inv_hom_id] + +def targetAddEquiv (e : StableIsomorphism R M N) : StableHom R P M ≃+ StableHom R P N where + toFun := StableHom.comp e.hom + invFun := StableHom.comp e.inv + left_inv f := by rw [StableHom.comp_assoc, e.hom_inv_id, StableHom.identity_comp] + right_inv f := by rw [StableHom.comp_assoc, e.inv_hom_id, StableHom.identity_comp] + map_add' := map_add _ + +def sourceAddEquiv (e : StableIsomorphism R M N) : StableHom R N P ≃+ StableHom R M P where + toFun f := StableHom.comp f e.hom + invFun f := StableHom.comp f e.inv + left_inv f := by + change StableHom.comp (StableHom.comp f e.hom) e.inv = f + rw [← StableHom.comp_assoc, e.inv_hom_id, StableHom.comp_identity] + right_inv f := by + change StableHom.comp (StableHom.comp f e.inv) e.hom = f + rw [← StableHom.comp_assoc, e.hom_inv_id, StableHom.comp_identity] + map_add' f g := by + exact congrArg (fun a : StableHom R M N →+ StableHom R M P => a e.hom) + (map_add (StableHom.comp (R := R) (M := M)) f g) + +noncomputable def ofExactProjectiveKernel + [Module.Finite R P] [Module.Projective R P] [Module.Injective R P] + (i : P →ₗ[R] M) (q : M →ₗ[R] N) (hi : Function.Injective i) + (hq : Function.Surjective q) (hex : Function.Exact i q) : + StableIsomorphism R M N := by + let r := Classical.choose (Module.Injective.extension_property R P P M i hi (LinearMap.id : P →ₗ[R] P)) + have hr := Classical.choose_spec (Module.Injective.extension_property R P P M i hi (LinearMap.id : P →ₗ[R] P)) + let t : M →ₗ[R] M := LinearMap.id - i.comp r + have ht : LinearMap.ker q ≤ LinearMap.ker t := by + intro x hx + obtain ⟨p, rfl⟩ := (hex x).mp hx + change i p - i (r (i p)) = 0 + rw [show r (i p) = p from DFunLike.congr_fun hr p, sub_self] + let s : N →ₗ[R] M := ((LinearMap.ker q).liftQ t ht).comp + (q.quotKerEquivOfSurjective hq).symm.toLinearMap + have hs (x : M) : s (q x) = x - i (r x) := by + simp only [s, LinearMap.comp_apply, LinearEquiv.coe_coe, + LinearMap.quotKerEquivOfSurjective_symm_apply, Submodule.liftQ_apply] + rfl + have hqi (p : P) : q (i p) = 0 := (hex (i p)).mpr ⟨p, rfl⟩ + have hqs : q.comp s = LinearMap.id := by + apply LinearMap.ext + intro y + obtain ⟨x, rfl⟩ := hq y + change q (s (q x)) = q x + rw [hs, map_sub, hqi, sub_zero] + refine ⟨StableHom.classOf R _ _ q, StableHom.classOf R _ _ s, ?_, ?_⟩ + · rw [StableHom.comp_classOf] + change StableHom.classOf R M M (s.comp q) = StableHom.classOf R M M LinearMap.id + rw [StableHom.classOf_eq_iff, factorsThroughFiniteFree_iff_projective] + refine ⟨P, inferInstance, inferInstance, inferInstance, inferInstance, r, -i, ?_⟩ + apply LinearMap.ext + intro x + change -i (r x) = s (q x) - x + rw [hs] + abel + · rw [StableHom.comp_classOf, hqs] + rfl + +@[simp] +theorem ofExactProjectiveKernel_hom + [Module.Finite R P] [Module.Projective R P] [Module.Injective R P] + (i : P →ₗ[R] M) (q : M →ₗ[R] N) (hi : Function.Injective i) + (hq : Function.Surjective q) (hex : Function.Exact i q) : + (ofExactProjectiveKernel i q hi hq hex).hom = StableHom.classOf R _ _ q := by + rfl + +end StableIsomorphism +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableProjectiveSummand.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableProjectiveSummand.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c790a78d9ca8a443ee3c1e0f0b34d7e9665d7f1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableProjectiveSummand.lean @@ -0,0 +1,31 @@ +import OAI.Algebra.AuslanderReiten.Stable.StableIsomorphism + +namespace OAI + +namespace ArExplicit.StableIsomorphism +universe u +variable {R M P : Type u} [Ring R] [AddCommGroup M] [Module R M] + [AddCommGroup P] [Module R P] [Module.Finite R P] [Module.Projective R P] + +def dropRight : StableIsomorphism R (M × P) M where + hom := StableHom.classOf R _ _ (LinearMap.fst R M P) + inv := StableHom.classOf R _ _ (LinearMap.inl R M P) + hom_inv_id := by + rw [StableHom.comp_classOf] + change StableHom.classOf R _ _ ((LinearMap.inl R M P).comp (LinearMap.fst R M P)) = + StableHom.classOf R _ _ LinearMap.id + rw [StableHom.classOf_eq_iff, factorsThroughFiniteFree_iff_projective] + refine ⟨P, inferInstance, inferInstance, inferInstance, inferInstance, + LinearMap.snd R M P, -(LinearMap.inr R M P), ?_⟩ + ext x <;> simp + inv_hom_id := by + rw [StableHom.comp_classOf] + congr 1 + +@[simp] theorem dropRight_hom : + (dropRight (R := R) (M := M) (P := P)).hom = + StableHom.classOf R _ _ (LinearMap.fst R M P) := rfl + +end ArExplicit.StableIsomorphism + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/StableTargetHomology.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/StableTargetHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..da0c94a17076e3ef2619f7d54b9f5f1465ea4ae1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/StableTargetHomology.lean @@ -0,0 +1,114 @@ +import OAI.Algebra.AuslanderReiten.Stable.StableHomology + +namespace OAI + +namespace ArExplicit.StableTargetHomology + +universe u + +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable {P₁ P₀ Pminus N : Type u} +variable [AddCommGroup P₁] [Module R P₁] [Module k P₁] [IsScalarTower k R P₁] +variable [AddCommGroup P₀] [Module R P₀] [Module k P₀] [IsScalarTower k R P₀] +variable [AddCommGroup Pminus] [Module R Pminus] [Module k Pminus] [IsScalarTower k R Pminus] +variable [AddCommGroup N] [Module R N] + +def postcomp {L M : Type u} [AddCommGroup L] [Module R L] [Module k L] + [IsScalarTower k R L] [AddCommGroup M] [Module R M] [Module k M] + [IsScalarTower k R M] (f : L →ₗ[R] M) : (N →ₗ[R] L) →ₗ[k] (N →ₗ[R] M) where + toFun g := f.comp g + map_add' _ _ := LinearMap.comp_add _ _ _ + map_smul' _ _ := LinearMap.comp_smul _ _ _ + +theorem postcomp_comp (e : P₁ →ₗ[R] P₀) (d : P₀ →ₗ[R] Pminus) (h : d.comp e = 0) : + (postcomp (k := k) (N := N) d).comp (postcomp e) = 0 := by + ext f x + exact DFunLike.congr_fun h (f x) + +def cycleToMap (d : P₀ →ₗ[R] Pminus) + (z : LinearMap.ker (postcomp (k := k) (N := N) d)) : N →ₗ[R] LinearMap.ker d := + z.val.codRestrict _ (fun x => DFunLike.congr_fun z.property x) + +def cyclesToStable (d : P₀ →ₗ[R] Pminus) : + LinearMap.ker (postcomp (k := k) (N := N) d) →ₗ[k] StableHom R N (LinearMap.ker d) where + toFun z := StableHom.classOf R _ _ (cycleToMap d z) + map_add' z w := by + have he : cycleToMap d (z + w) = cycleToMap d z + cycleToMap d w := by ext; rfl + rw [he, map_add] + map_smul' c z := by + have he : cycleToMap d (c • z) = c • cycleToMap d z := by ext; rfl + rw [he, StableHom.classOf_smul] + rfl + +theorem cyclesToStable_surjective (d : P₀ →ₗ[R] Pminus) : + Function.Surjective (cyclesToStable (k := k) (N := N) d) := by + intro x + obtain ⟨f, rfl⟩ := StableHom.classOf_surjective x + have hz : (LinearMap.ker d).subtype.comp f ∈ LinearMap.ker (postcomp (k := k) d) := by + ext y + exact (f y).property + refine ⟨⟨(LinearMap.ker d).subtype.comp f, hz⟩, ?_⟩ + apply congrArg (StableHom.classOf R N (LinearMap.ker d)) + ext + rfl + +theorem cyclesToStable_kernel [Module.Finite R P₁] [Module.Projective R P₁] + (e : P₁ →ₗ[R] P₀) (d : P₀ →ₗ[R] Pminus) (h : d.comp e = 0) + (hex : LinearMap.range e = LinearMap.ker d) : + LinearMap.ker (cyclesToStable (k := k) (N := N) d) = + LinearHomology.boundaries (postcomp e) (postcomp d) (postcomp_comp e d h) := by + ext z + constructor + · intro hz + change StableHom.classOf R N (LinearMap.ker d) (cycleToMap d z) = 0 at hz + rcases (StableHom.classOf_eq_zero_iff_projective (cycleToMap d z)).mp hz with + ⟨T, hT, hRT, hpT, hfT, a, b, hab⟩ + have hb : d.comp ((LinearMap.ker d).subtype.comp b) = 0 := by + ext x + exact (b x).property + obtain ⟨B, hB⟩ := lift_through_exact e d hex ((LinearMap.ker d).subtype.comp b) hb + refine ⟨B.comp a, ?_⟩ + apply Subtype.ext + apply LinearMap.ext + intro x + change e (B (a x)) = z.val x + rw [show e (B (a x)) = (b (a x)).val from DFunLike.congr_fun hB (a x)] + exact congrArg Subtype.val (DFunLike.congr_fun hab x) + · rintro ⟨a, rfl⟩ + apply (StableHom.classOf_eq_zero_iff_projective _).mpr + refine ⟨P₁, inferInstance, inferInstance, inferInstance, inferInstance, + a, e.codRestrict (LinearMap.ker d) (fun x => DFunLike.congr_fun h x), ?_⟩ + ext + rfl + +noncomputable def homologyStableEquiv [Module.Finite R P₁] [Module.Projective R P₁] + (e : P₁ →ₗ[R] P₀) (d : P₀ →ₗ[R] Pminus) (h : d.comp e = 0) + (hex : LinearMap.range e = LinearMap.ker d) : + LinearHomology.Homology (postcomp (k := k) (N := N) e) (postcomp d) (postcomp_comp e d h) + ≃ₗ[k] StableHom R N (LinearMap.ker d) := + (Submodule.quotEquivOfEq _ _ (cyclesToStable_kernel e d h hex).symm).trans + ((cyclesToStable d).quotKerEquivOfSurjective (cyclesToStable_surjective d)) + +@[simp] +theorem homologyStableEquiv_mk [Module.Finite R P₁] [Module.Projective R P₁] + (e : P₁ →ₗ[R] P₀) (d : P₀ →ₗ[R] Pminus) (h : d.comp e = 0) + (hex : LinearMap.range e = LinearMap.ker d) + (z : LinearMap.ker (postcomp (k := k) (N := N) d)) : + homologyStableEquiv e d h hex + ((LinearHomology.boundaries (postcomp e) (postcomp d) (postcomp_comp e d h)).mkQ z) = + cyclesToStable d z := rfl + +def mapToCycle (d : P₀ →ₗ[R] Pminus) (f : N →ₗ[R] LinearMap.ker d) : + LinearMap.ker (postcomp (k := k) (N := N) d) := + ⟨(LinearMap.ker d).subtype.comp f, by ext x; exact (f x).property⟩ + +@[simp] +theorem cyclesToStable_mapToCycle (d : P₀ →ₗ[R] Pminus) (f : N →ₗ[R] LinearMap.ker d) : + cyclesToStable d (mapToCycle (k := k) d f) = StableHom.classOf R _ _ f := by + apply congrArg (StableHom.classOf R N (LinearMap.ker d)) + ext + rfl + +end ArExplicit.StableTargetHomology + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/TargetStableCoordinates.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/TargetStableCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad3ccba4e6810f6a798400f26cd637f08933770e --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/TargetStableCoordinates.lean @@ -0,0 +1,82 @@ +import OAI.Algebra.AuslanderReiten.Cocycles.ReversedCocycleMap + +namespace OAI + +noncomputable section +open CategoryTheory HomologicalComplex +open CochainComplex CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.CompleteComparison +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable {K L : CochainComplex (ModuleCat.{u} R) ℤ} {n : ℤ} + +def fullHomTargetStableLinearEquiv (b : ℤ) (hb : n = -b) + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain L)) : + CohomologyClass K L n ≃ₗ[k] + StableHom R (Cokernel (chainOfCochain K) 0) (Cokernel (chainOfCochain L) b) := + (fullHomStableLinearEquiv K L n hK (hL.cochainShift n)).trans + (StableHom.targetEquiv (k := k) (shiftedCokernelEquiv L n b hb)) + +def targetCocycleMap (x : Cocycle K L n) (b : ℤ) (hb : n = -b) : + Cokernel (chainOfCochain K) 0 →ₗ[R] Cokernel (chainOfCochain L) b := + (shiftedCokernelEquiv L n b hb).toLinearMap.comp + (cokernelMap (cocycleComparisonMap x) 0) + +@[simp] theorem fullHomTargetStableLinearEquiv_mk (b : ℤ) (hb : n = -b) + (hK : TotallyAcyclicComplex (chainOfCochain K)) + (hL : ExactProjectiveComplex (chainOfCochain L)) (x : Cocycle K L n) : + fullHomTargetStableLinearEquiv (k := k) b hb hK hL (CohomologyClass.mk x) = + StableHom.classOf R _ _ (targetCocycleMap x b hb) := by + change StableHom.targetEquiv (k := k) (shiftedCokernelEquiv L n b hb) + (fullHomStableEquiv K L n hK (hL.cochainShift n) (CohomologyClass.mk x)) = _ + rw [fullHomStableEquiv_mk, StableHom.targetEquiv_classOf] + rfl + +@[reassoc] private theorem component_transport (x : Cochain K L n) + (p q r : ℤ) (hpq : p + n = q) (hqr : q = r) : + x.v p q hpq ≫ (L.XIsoOfEq hqr).hom = x.v p r (hpq.trans hqr) := by + subst r + simp + +theorem targetCocycleMap_mk (x : Cocycle K L n) (b : ℤ) (hb : n = -b) + (z : (chainOfCochain K).X 0) : + targetCocycleMap x b hb (Submodule.Quotient.mk z) = + Submodule.Quotient.mk ((reversedComponent x.val 0 b (by omega)).hom z) := by + change shiftedCokernelEquiv L n b hb + (Submodule.Quotient.mk (((cocycleComparisonMap x).f 0).hom z)) = _ + rw [shiftedCokernelEquiv_mk] + congr 1 + unfold cocycleComparisonMap + rw [extendMap_f _ negIndexEmbedding (show negIndexEmbedding.f 0 = 0 from rfl)] + rw [cocycleHom_component] + have he : + (K.extendXIso negIndexEmbedding (i := 0) (i' := 0) rfl).hom ≫ + x.val.v 0 (0+n) rfl ≫ + ((L⟦n⟧).extendXIso negIndexEmbedding (i := 0) (i' := 0) rfl).inv ≫ + (shiftedCokernelComponent L n b hb).hom = reversedComponent x.val 0 b (by omega) := by + subst n + dsimp only [shiftedCokernelComponent, reversedComponent] + erw [Iso.trans_hom, Iso.trans_hom] + simp only [Iso.symm_hom, Iso.inv_hom_id_assoc] + simp only [CochainComplex.shiftFunctorObjXIso, Int.neg_zero] + erw [component_transport_assoc] + exact congrArg (fun f => f.hom z) he + +variable [CharP k 2] +include k + +theorem targetCocycleMap_eq_reversed (x : Cocycle K L n) (b : ℤ) (hb : n = -b) : + targetCocycleMap x b hb = reversedCokernelMap (k := k) x 0 b (by omega) := by + apply LinearMap.ext + intro z + induction z using Submodule.Quotient.induction_on with + | _ z => + rw [targetCocycleMap_mk, reversedCokernelMap_mk] + +end ArExplicit.CompleteComparison + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Stable/TensorStableEnd.lean b/lean/OAI/Algebra/AuslanderReiten/Stable/TensorStableEnd.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9e39a36b4176b9f6d17df25c7201568c694c2ee --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Stable/TensorStableEnd.lean @@ -0,0 +1,101 @@ +import OAI.Algebra.AuslanderReiten.Evaluation.TensorBeta +import OAI.Algebra.AuslanderReiten.Stable.StableHomEquiv + +namespace OAI + +noncomputable section +namespace ArExplicit.A +universe u +variable {k : Type u} [Field k] (q : k) (hq1 : 1 + q ≠ 0) + +include hq1 in + +theorem simple_not_projective : ¬ Module.Projective (A k q) (Simple q) := by + intro hp + let := hp + let : Module.Finite (A k q) (Simple q) := Module.Finite.of_restrictScalars_finite k (A k q) _ + exact beta_stable_ne_zero q hq1 (StableHom.eq_zero_of_projective_source _) + +include hq1 in +theorem simple_scalar_generator (x : Simple q) : + x = simpleCoordinate q x • simpleGenerator q := by + apply simpleCoordinate_injective q hq1 + erw [(simpleCoordinate q).map_smul, simpleGenerator_coordinate] + exact (mul_one _).symm + +def endScalar : (Simple q →ₗ[A k q] Simple q) →ₗ[k] k where + toFun f := simpleCoordinate q (f (simpleGenerator q)) + map_add' left right := + (simpleCoordinate q).map_add (left (simpleGenerator q)) (right (simpleGenerator q)) + map_smul' scalar endomorphism := + (simpleCoordinate q).map_smul scalar (endomorphism (simpleGenerator q)) + +include hq1 in +theorem end_eq_scalar_id (f : Simple q →ₗ[A k q] Simple q) : + f = endScalar q f • LinearMap.id := by + apply LinearMap.ext + intro x + change f x = endScalar q f • x + calc + f x = f (simpleCoordinate q x • simpleGenerator q) := congrArg f (simple_scalar_generator q hq1 x) + _ = simpleCoordinate q x • f (simpleGenerator q) := (f.restrictScalars k).map_smul _ _ + _ = simpleCoordinate q x • (endScalar q f • simpleGenerator q) := by + exact congrArg (fun z => simpleCoordinate q x • z) + (simple_scalar_generator q hq1 (f (simpleGenerator q))) + _ = endScalar q f • (simpleCoordinate q x • simpleGenerator q) := smul_comm _ _ _ + _ = endScalar q f • x := congrArg (fun z => endScalar q f • z) (simple_scalar_generator q hq1 x).symm + +def simpleEndEquiv : (Simple q →ₗ[A k q] Simple q) ≃ₗ[k] k where + __ := endScalar q + invFun c := c • LinearMap.id + left_inv f := (end_eq_scalar_id q hq1 f).symm + right_inv c := by + change simpleCoordinate q (c • simpleGenerator q) = c + erw [(simpleCoordinate q).map_smul, simpleGenerator_coordinate] + exact mul_one _ + +include hq1 in +theorem stable_identity_ne_zero : + StableHom.classOf (A k q) (Simple q) (Simple q) LinearMap.id ≠ 0 := by + let : Module.Finite (A k q) (Simple q) := Module.Finite.of_restrictScalars_finite k (A k q) _ + intro h + exact simple_not_projective q hq1 (StableHom.identity_eq_zero_iff.mp h) + +include hq1 in + +theorem simpleEnd_classOf_injective : Function.Injective + (StableHom.classOfLinear k : (Simple q →ₗ[A k q] Simple q) →ₗ[k] + StableHom (A k q) (Simple q) (Simple q)) := by + rw [← LinearMap.ker_eq_bot] + apply le_antisymm _ bot_le + intro f hf + have hz : StableHom.classOf (A k q) (Simple q) (Simple q) f = 0 := hf + rw [end_eq_scalar_id q hq1 f, StableHom.classOf_smul] at hz + have hc : endScalar q f = 0 := (smul_eq_zero.mp hz).resolve_right (stable_identity_ne_zero q hq1) + rw [end_eq_scalar_id q hq1 f, hc, zero_smul] + exact Submodule.zero_mem _ + +def stableEndEquiv : StableHom (A k q) (Simple q) (Simple q) ≃ₗ[k] k := + (LinearEquiv.ofBijective (StableHom.classOfLinear k) + ⟨simpleEnd_classOf_injective q hq1, StableHom.classOf_surjective⟩).symm.trans + (simpleEndEquiv q hq1) + +@[simp] +theorem stableEndEquiv_classOf (f : Simple q →ₗ[A k q] Simple q) : + stableEndEquiv q hq1 (StableHom.classOf (A k q) _ _ f) = endScalar q f := by + change simpleEndEquiv q hq1 ((LinearEquiv.ofBijective (StableHom.classOfLinear k) _).symm + ((StableHom.classOfLinear k) f)) = _ + erw [LinearEquiv.symm_apply_apply] + rfl + +@[simp] +theorem stableEndEquiv_identity : stableEndEquiv q hq1 StableHom.identity = 1 := by + change stableEndEquiv q hq1 (StableHom.classOf _ _ _ LinearMap.id) = 1 + rw [stableEndEquiv_classOf] + exact simpleGenerator_coordinate q + +end ArExplicit.A + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Statement.lean b/lean/OAI/Algebra/AuslanderReiten/Statement.lean new file mode 100644 index 0000000000000000000000000000000000000000..c57b0e8a9484694450bf30d4acac01b7b6438a39 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Statement.lean @@ -0,0 +1,69 @@ +import Mathlib + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped TensorProduct +namespace ArExplicit.Statement +universe u v + +abbrev K := FractionRing (MvPolynomial (Fin 3) (ZMod 2)) + +def parameters (i : Fin 3) : K := + algebraMap (MvPolynomial (Fin 3) (ZMod 2)) K (MvPolynomial.X i) + +def TotallyAcyclicWitness (R : Type u) [Ring R] + (Z : Type u) [AddCommGroup Z] [Module R Z] : Prop := + ∃ P : ChainComplex (ModuleCat.{u} R) ℤ, + (∀ i : ℤ, Module.Finite R (P.X i) ∧ Module.Projective R (P.X i)) ∧ + (∀ i : ℤ, LinearMap.range (P.d (i+1) i).hom = LinearMap.ker (P.d i (i-1)).hom) ∧ + (∀ (Q : Type u) [AddCommGroup Q] [Module R Q] [Module.Projective R Q] + (i : ℤ) (f : P.X i →ₗ[R] Q), f.comp (P.d (i+1) i).hom = 0 → + ∃ g : P.X (i-1) →ₗ[R] Q, f = g.comp (P.d i (i-1)).hom) ∧ + Nonempty (Z ≃ₗ[R] (P.X 0 ⧸ LinearMap.range (P.d 1 0).hom)) + +def Conclusions (F R Z : Type u) [Field F] [Ring R] [Algebra F R] + [AddCommGroup Z] [Module R Z] [Module F Z] [IsScalarTower F R Z] : Prop := + FiniteDimensional F R ∧ + FiniteDimensional F Z ∧ + ¬ Module.Projective R Z ∧ + TotallyAcyclicWitness R Z ∧ + (∀ i : ℕ, 0 < i → + Subsingleton (Abelian.Ext (ModuleCat.of R Z) (ModuleCat.of R Z) i)) ∧ + (∀ i : ℕ, 0 < i → + Subsingleton (Abelian.Ext (ModuleCat.of R Z) (ModuleCat.of R R) i)) ∧ + Nonempty ((R ⧸ Ring.jacobson R) ≃ₐ[F] (Fin 8 → F)) ∧ + (Ring.jacobson R)^4 ≠ ⊥ + +structure System where + algebraCarrier : Type + [ring : Ring algebraCarrier] + [scalarAlgebra : Algebra K algebraCarrier] + moduleCarrier : Type + [additiveGroup : AddCommGroup moduleCarrier] + [action : Module algebraCarrier moduleCarrier] + [scalarAction : Module K moduleCarrier] + [actionTower : IsScalarTower K algebraCarrier moduleCarrier] + +attribute [instance] System.ring System.scalarAlgebra System.additiveGroup + System.action System.scalarAction System.actionTower + +def FullStatement : Prop := + AlgebraicIndependent (ZMod 2) parameters ∧ + ∃ s : System, + Conclusions K s.algebraCarrier s.moduleCarrier ∧ + ∀ (E : Type v) [Field E] [Algebra K E], + ∃ action : Module (E ⊗[K] s.algebraCarrier) (E ⊗[K] s.moduleCarrier), + letI := action + ∃ tower : IsScalarTower E (E ⊗[K] s.algebraCarrier) (E ⊗[K] s.moduleCarrier), + letI := tower + (∀ (a b : E) (r : s.algebraCarrier) (z : s.moduleCarrier), + (a ⊗ₜ[K] r) • (b ⊗ₜ[K] z) = (a*b) ⊗ₜ[K] (r • z)) ∧ + Conclusions E (E ⊗[K] s.algebraCarrier) (E ⊗[K] s.moduleCarrier) + +end ArExplicit.Statement + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/StatementEquivalence.lean b/lean/OAI/Algebra/AuslanderReiten/StatementEquivalence.lean new file mode 100644 index 0000000000000000000000000000000000000000..971552221a8d972f3d4c98b065c927a44bdc1416 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/StatementEquivalence.lean @@ -0,0 +1,46 @@ +import OAI.Algebra.AuslanderReiten.Statement +import OAI.Algebra.AuslanderReiten.Complete.CompleteResolutionAllProjectives +import OAI.Algebra.AuslanderReiten.BaseChange.MainScalarExtension + +namespace OAI + +noncomputable section +open scoped TensorProduct +namespace ArExplicit.Statement +universe u v + +theorem conclusions_iff {F R Z : Type u} [Field F] [Ring R] [Algebra F R] + [AddCommGroup Z] [Module R Z] [Module F Z] [IsScalarTower F R Z] : + ArExplicit.MainConclusions F R Z ↔ Conclusions F R Z := by + constructor + · rintro ⟨hR,hZ,hn,hg,hs,hr,hq,h4⟩ + exact ⟨hR,hZ,hn,hg.all_projective_targets,hs,hr,hq,h4⟩ + · rintro ⟨hR,hZ,hn,hg,hs,hr,hq,h4⟩ + exact ⟨hR,hZ,hn,ArExplicit.gorensteinProjective_iff_all_projective_targets.mpr hg, + hs,hr,hq,h4⟩ + +theorem fullStatement_of_mainConclusions (c : ArExplicit.Candidate) + (h : ArExplicit.MainConclusions ArExplicit.BaseField c.R c.M) : FullStatement.{v} := by + let s : System := + { algebraCarrier := c.R + ring := c.ring + scalarAlgebra := c.algebra + moduleCarrier := c.M + additiveGroup := c.addCommGroup + action := c.module + scalarAction := c.baseModule + actionTower := c.tower } + refine ⟨ArExplicit.parameters_algebraicallyIndependent,s,conclusions_iff.mp h,?_⟩ + intro E _ _ + let := ArExplicit.scalarExtensionModule K E c.R c.M + refine ⟨ArExplicit.scalarExtensionModule K E c.R c.M, + ArExplicit.scalarExtensionIsScalarTower K E c.R c.M,?_,?_⟩ + · intro a b r z + exact ArExplicit.scalarExtension_smul_tmul K E c.R c.M a b r z + · exact conclusions_iff.mp (h.scalarExtension E) + +end ArExplicit.Statement + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedFourAddExt.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedFourAddExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..66168937e5256f061275626491546984f60a9962 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedFourAddExt.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedFourExt + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalBalanced +open scoped TensorProduct +universe u +variable {k A B E V F G X Y Z : Type u} [Field k] [Ring A] [Ring B] + [Algebra k A] [Algebra k B] + [AddCommGroup E] [AddCommGroup V] [AddCommGroup F] [AddCommGroup G] + [AddCommGroup X] [AddCommGroup Y] [AddCommGroup Z] + [Module k E] [Module k V] [Module k F] [Module k G] [Module k X] [Module k Y] + [Module (A ⊗[k] B)ᵐᵒᵖ E] [Module (A ⊗[k] B) V] +variable (e : E ≃ₗ[k] F ⊗[k] G) (v : V ≃ₗ[k] X ⊗[k] Y) + +theorem fourfold_add_hom_ext (f g : BalancedTensor k (A ⊗[k] B) E V →+ Z) + (h : ∀ a b x y, f (BalancedTensor.tmul (e.symm (a ⊗ₜ[k] b)) (v.symm (x ⊗ₜ[k] y))) = + g (BalancedTensor.tmul (e.symm (a ⊗ₜ[k] b)) (v.symm (x ⊗ₜ[k] y)))) : f=g := by + apply AddMonoidHom.ext + intro z + induction z using BalancedTensor.induction_on with + | zero => simp + | add z w hz hw => simp only [map_add, hz, hw] + | tmul z w => + obtain ⟨z, rfl⟩ := e.symm.surjective z + obtain ⟨w, rfl⟩ := v.symm.surjective w + induction z using TensorProduct.inductionOn with + | add z z' hz hz' => simp only [map_add, BalancedTensor.add_tmul, hz, hz'] + | tmul a b => + induction w using TensorProduct.inductionOn with + | add w w' hw hw' => simp only [map_add, BalancedTensor.tmul_add, hw, hw'] + | tmul x y => exact h a b x y + +end ArExplicit.ExternalBalanced + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedFourExt.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedFourExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..49d403bd4420bb57b4ec2ee47072ca412cad4064 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedFourExt.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalBalancedEquiv + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalBalanced +open scoped TensorProduct +universe u +variable {k A B E V F G X Y Z : Type u} [Field k] [Ring A] [Ring B] + [Algebra k A] [Algebra k B] + [AddCommGroup E] [AddCommGroup V] [AddCommGroup F] [AddCommGroup G] + [AddCommGroup X] [AddCommGroup Y] [AddCommGroup Z] + [Module k E] [Module k V] [Module k F] [Module k G] [Module k X] [Module k Y] [Module k Z] + [Module (A ⊗[k] B)ᵐᵒᵖ E] [Module (A ⊗[k] B) V] +variable (e : E ≃ₗ[k] F ⊗[k] G) (v : V ≃ₗ[k] X ⊗[k] Y) + +theorem fourfold_hom_ext (f g : BalancedTensor k (A ⊗[k] B) E V →ₗ[k] Z) + (h : ∀ a b x y, f (BalancedTensor.tmul (e.symm (a ⊗ₜ[k] b)) (v.symm (x ⊗ₜ[k] y))) = + g (BalancedTensor.tmul (e.symm (a ⊗ₜ[k] b)) (v.symm (x ⊗ₜ[k] y)))) : f=g := by + apply LinearMap.ext + intro z + induction z using BalancedTensor.induction_on with + | zero => simp + | add z w hz hw => simp only [map_add, hz, hw] + | tmul z w => + obtain ⟨z, rfl⟩ := e.symm.surjective z + obtain ⟨w, rfl⟩ := v.symm.surjective w + induction z using TensorProduct.inductionOn with + | add z z' hz hz' => simp only [map_add, BalancedTensor.add_tmul, hz, hz'] + | tmul a b => + induction w using TensorProduct.inductionOn with + | add w w' hw hw' => simp only [map_add, BalancedTensor.tmul_add, hw, hw'] + | tmul x y => exact h a b x y + +end ArExplicit.ExternalBalanced + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedFourLinearExt.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedFourLinearExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..22f256e9c5dd9645055c3648b7c0f8dc75f197f2 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedFourLinearExt.lean @@ -0,0 +1,43 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedFourExt +import Mathlib.Algebra.Category.ModuleCat.Basic + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalBalanced +open scoped TensorProduct +universe u +variable {k A B S E V F G X Y Z : Type u} [Field k] [Ring A] [Ring B] [Ring S] + [Algebra k A] [Algebra k B] + [AddCommGroup E] [AddCommGroup V] [AddCommGroup F] [AddCommGroup G] + [AddCommGroup X] [AddCommGroup Y] [AddCommGroup Z] + [Module k E] [Module k V] [Module k F] [Module k G] [Module k X] [Module k Y] [Module k Z] + [Module (A ⊗[k] B)ᵐᵒᵖ E] [Module (A ⊗[k] B) V] + [Module S (BalancedTensor k (A ⊗[k] B) E V)] [Module S Z] +variable (e : E ≃ₗ[k] F ⊗[k] G) (v : V ≃ₗ[k] X ⊗[k] Y) + +omit [Module k Z] in +theorem fourfold_linear_hom_ext + (f g : BalancedTensor k (A ⊗[k] B) E V →ₗ[S] Z) + (h : ∀ a b x y, f (BalancedTensor.tmul (e.symm (a ⊗ₜ[k] b)) (v.symm (x ⊗ₜ[k] y))) = + g (BalancedTensor.tmul (e.symm (a ⊗ₜ[k] b)) (v.symm (x ⊗ₜ[k] y)))) : f=g := by + apply LinearMap.ext + intro z + induction z using BalancedTensor.induction_on with + | zero => simp + | add z w hz hw => simp only [map_add, hz, hw] + | tmul z w => + obtain ⟨z, rfl⟩ := e.symm.surjective z + obtain ⟨w, rfl⟩ := v.symm.surjective w + induction z using TensorProduct.inductionOn with + | add z z' hz hz' => simp only [map_add, BalancedTensor.add_tmul, hz, hz'] + | tmul a b => + induction w using TensorProduct.inductionOn with + | add w w' hw hw' => simp only [map_add, BalancedTensor.tmul_add, hw, hw'] + | tmul x y => exact h a b x y + +end ArExplicit.ExternalBalanced + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensor.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensor.lean new file mode 100644 index 0000000000000000000000000000000000000000..2507e362ec211bb7c0c5e64352a8504fd089b216 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensor.lean @@ -0,0 +1,93 @@ +import Mathlib.LinearAlgebra.TensorProduct.Basic +import Mathlib.LinearAlgebra.Quotient.Basic +import Mathlib.RingTheory.TensorProduct.Finite +import Mathlib.Algebra.Algebra.Opposite + +namespace OAI + +namespace ArExplicit + +open TensorProduct + +variable (k R F M : Type*) [CommRing k] [Ring R] +variable [AddCommGroup F] [AddCommGroup M] [Module k F] [Module k M] +variable [Module Rᵐᵒᵖ F] [Module R M] + +def balancingRelations : Submodule k (F ⊗[k] M) := + Submodule.span k {z | ∃ (f : F) (r : R) (m : M), + z = (MulOpposite.op r • f) ⊗ₜ[k] m - f ⊗ₜ[k] (r • m)} + +abbrev BalancedTensor := (F ⊗[k] M) ⧸ balancingRelations k R F M + +namespace BalancedTensor + +variable {k R F M} + +def tmul (f : F) (m : M) : BalancedTensor k R F M := + (balancingRelations k R F M).mkQ (f ⊗ₜ[k] m) + +@[simp] theorem zero_tmul (m : M) : tmul (k := k) (R := R) (0 : F) m = 0 := by + simp [tmul] + +@[simp] theorem tmul_zero (f : F) : tmul (k := k) (R := R) f (0 : M) = 0 := by + simp [tmul] + +theorem add_tmul (f g : F) (m : M) : + tmul (k := k) (R := R) (f + g) m = tmul f m + tmul g m := by simp [tmul, TensorProduct.add_tmul] + +theorem tmul_add (f : F) (m n : M) : + tmul (k := k) (R := R) f (m + n) = tmul f m + tmul f n := by simp [tmul, TensorProduct.tmul_add] + +theorem scalar_tmul (c : k) (f : F) (m : M) : + tmul (k := k) (R := R) (c • f) m = c • tmul f m := by + exact (balancingRelations k R F M).mkQ.map_smul c (f ⊗ₜ[k] m) + +theorem tmul_scalar (c : k) (f : F) (m : M) : + tmul (k := k) (R := R) f (c • m) = c • tmul f m := by simp [tmul] + +theorem balance (f : F) (r : R) (m : M) : + tmul (k := k) (R := R) (MulOpposite.op r • f) m = tmul f (r • m) := by + apply (Submodule.Quotient.eq (balancingRelations k R F M)).mpr + exact Submodule.subset_span ⟨f, r, m, rfl⟩ + +def mk : F →ₗ[k] M →ₗ[k] BalancedTensor k R F M where + toFun f := + { toFun := tmul f + map_add' := tmul_add f + map_smul' := fun c m => tmul_scalar c f m } + map_add' f g := by ext m; exact add_tmul f g m + map_smul' c f := by ext m; exact scalar_tmul c f m + +variable {N : Type*} [AddCommGroup N] [Module k N] + +def lift (b : F →ₗ[k] M →ₗ[k] N) + (hb : ∀ (f : F) (r : R) (m : M), b (MulOpposite.op r • f) m = b f (r • m)) : + BalancedTensor k R F M →ₗ[k] N := + (balancingRelations k R F M).liftQ (TensorProduct.lift b) (by + apply Submodule.span_le.mpr + rintro z ⟨f, r, m, rfl⟩ + change TensorProduct.lift b ((MulOpposite.op r • f) ⊗ₜ[k] m - f ⊗ₜ[k] (r • m)) = 0 + simp only [map_sub, TensorProduct.lift.tmul, hb, sub_self]) + +@[simp] theorem lift_tmul (b : F →ₗ[k] M →ₗ[k] N) + (hb : ∀ (f : F) (r : R) (m : M), b (MulOpposite.op r • f) m = b f (r • m)) (f : F) (m : M) : + lift b hb (tmul f m) = b f m := rfl + +@[ext] theorem hom_ext (f g : BalancedTensor k R F M →ₗ[k] N) + (h : ∀ x y, f (tmul x y) = g (tmul x y)) : f = g := by + apply LinearMap.ext + intro z + induction z using Submodule.Quotient.induction_on with + | H z => + induction z using TensorProduct.inductionOn with + | tmul x y => exact h x y + | add z z' hz hz' => + change f ((balancingRelations k R F M).mkQ (z + z')) = + g ((balancingRelations k R F M).mkQ (z + z')) + simp only [map_add] + exact congrArg₂ (· + ·) hz hz' + +end BalancedTensor +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorAction.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9d52a6a4aee5ffe4e20cb60474746afe1f6ccfc --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorAction.lean @@ -0,0 +1,58 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensor + +namespace OAI + +namespace ArExplicit.BalancedTensor + +open TensorProduct + +variable {k R F M S : Type*} [CommRing k] [Ring R] [Ring S] +variable [AddCommGroup F] [AddCommGroup M] [Module k F] [Module k M] +variable [Module Rᵐᵒᵖ F] [Module R M] +variable [Module S F] [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] + +theorem smul_mem_relations (s : S) {z : F ⊗[k] M} + (hz : z ∈ balancingRelations k R F M) : s • z ∈ balancingRelations k R F M := by + induction hz using Submodule.span_induction with + | mem z hz => + obtain ⟨f, r, m, rfl⟩ := hz + rw [smul_sub, TensorProduct.smul_tmul', TensorProduct.smul_tmul', smul_comm s] + exact Submodule.subset_span ⟨s • f, r, m, rfl⟩ + | zero => simp + | add x y hx hy ihx ihy => + simpa only [smul_add] using (balancingRelations k R F M).add_mem ihx ihy + | smul c z hz ih => + rw [← smul_comm c s z] + exact (balancingRelations k R F M).smul_mem c ih + +def relationsAsLeft : Submodule S (F ⊗[k] M) where + __ := (balancingRelations k R F M).toAddSubmonoid + smul_mem' := fun s _ hz => smul_mem_relations s hz + +instance (priority := 100) : Module S (BalancedTensor k R F M) := + Submodule.Quotient.module (relationsAsLeft (k := k) (R := R) (S := S) (F := F) (M := M)) + +@[simp] theorem smul_tmul (s : S) (f : F) (m : M) : + s • tmul (k := k) (R := R) f m = tmul (s • f) m := rfl + +variable [Algebra k S] [IsScalarTower k S F] + +instance : IsScalarTower k S (BalancedTensor k R F M) where + smul_assoc c s z := by + induction z using Submodule.Quotient.induction_on with + | H z => + change Submodule.Quotient.mk ((c • s) • z) = + (Submodule.Quotient.mk (c • s • z) : BalancedTensor k R F M) + rw [smul_assoc] + +instance : SMulCommClass k S (BalancedTensor k R F M) where + smul_comm c s z := by + induction z using Submodule.Quotient.induction_on with + | H z => + change Submodule.Quotient.mk (c • s • z) = + (Submodule.Quotient.mk (s • c • z) : BalancedTensor k R F M) + rw [smul_comm] + +end ArExplicit.BalancedTensor + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCanonicalEndpoint.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCanonicalEndpoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..d86989894e85651eae0cab7e4c2946756b71cf67 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCanonicalEndpoint.lean @@ -0,0 +1,42 @@ +import OAI.Algebra.AuslanderReiten.Complete.CompleteFunctorRawEndpoint +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCokernel + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits +namespace ArExplicit.BalancedTensor +open CompleteComparison +universe u +variable {k R S F : Type u} [Field k] [Ring R] [Ring S] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module S F] +variable [IsScalarTower k Rᵐᵒᵖ F] +variable [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] +variable [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable [PreservesFiniteLimits (functor (k := k) (R := R) (S := S) (F := F))] +variable [PreservesFiniteColimits (functor (k := k) (R := R) (S := S) (F := F))] +variable [(functor (k := k) (R := R) (S := S) (F := F)).PreservesProjectiveObjects] +variable (K : CochainComplex (ModuleCat.{u} R) ℤ) +variable (hK : TotallyAcyclicComplex (chainOfCochain K)) +variable (hFK : TotallyAcyclicComplex (chainOfCochain + (functorComplex (functor (k := k) (R := R) (S := S) (F := F)) K))) + +theorem rawFunctorEndpointIso_eq : + rawFunctorEndpointIso (functor (k := k) (R := R) (S := S) (F := F)) K hK hFK = + (cochainCokernelEquiv (k := k) (F := F) (S := S) K).toModuleIso := by + apply Iso.ext + apply ModuleCat.hom_ext + apply LinearMap.ext + intro z + obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective + (LinearMap.range ((functorComplex (functor (k := k) (R := R) (S := S) (F := F)) K).d (-1) 0).hom) z + have h := congrArg (fun f => f.hom x) + (rawFunctorEndpointIso_augmentation (functor (k := k) (R := R) (S := S) (F := F)) K hK hFK) + exact h.symm.trans (cokernelEquiv_mk (k := k) (F := F) (S := S) (K.d (-1) 0).hom x).symm + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCategory.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCategory.lean new file mode 100644 index 0000000000000000000000000000000000000000..824bdeb8d2ae078153a7346be7895b25e736db31 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCategory.lean @@ -0,0 +1,99 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorLeftExact +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorProjective +import OAI.Algebra.AuslanderReiten.BaseChange.ScalarExtensionComplete +import Mathlib.Algebra.Category.ModuleCat.Projective +import Mathlib.Algebra.Homology.HomologicalComplexAbelian +import Mathlib.Algebra.Homology.ShortComplex.ModuleCat + +namespace OAI + +noncomputable section +open CategoryTheory + +namespace ArExplicit.BalancedTensor +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +universe u +variable {k R S : Type u} [Field k] [Ring R] [Ring S] [Algebra k R] +variable {F G H : Type u} +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module S F] + [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] [IsScalarTower k Rᵐᵒᵖ F] +variable [AddCommGroup G] [Module k G] [Module Rᵐᵒᵖ G] [Module S G] + [SMulCommClass k S G] [SMulCommClass S Rᵐᵒᵖ G] [IsScalarTower k Rᵐᵒᵖ G] +variable [AddCommGroup H] [Module k H] [Module Rᵐᵒᵖ H] [Module S H] + [SMulCommClass k S H] [SMulCommClass S Rᵐᵒᵖ H] [IsScalarTower k Rᵐᵒᵖ H] + +def mapLeftLinear (a : F →ₗ[Rᵐᵒᵖ] G) (ha : ∀ (s : S) f, a (s • f) = s • a f) + (M : ModuleCat.{u} R) : BalancedTensor k R F M →ₗ[S] BalancedTensor k R G M where + __ := (mapLeft (k := k) (M := M) a).toAddHom + map_smul' s z := by + change mapLeft (k := k) a (s • z) = s • mapLeft (k := k) a z + induction z using induction_on with + | zero => simp + | tmul f m => simp only [smul_tmul, mapLeft_tmul, ha] + | add x y hx hy => simp only [smul_add, map_add, hx, hy] + +@[simp] theorem mapLeftLinear_tmul (a : F →ₗ[Rᵐᵒᵖ] G) + (ha : ∀ (s : S) f, a (s • f) = s • a f) (M : ModuleCat.{u} R) (f : F) (m : M) : + mapLeftLinear (k := k) a ha M (tmul f m) = tmul (a f) m := rfl + +def functor : ModuleCat.{u} R ⥤ ModuleCat.{u} S where + obj M := ModuleCat.of S (BalancedTensor k R F M) + map a := ModuleCat.ofHom (mapRight (k := k) (F := F) (S := S) a.hom) + map_id M := by apply ModuleCat.hom_ext; exact mapRight_id + map_comp a b := by apply ModuleCat.hom_ext; exact mapRight_comp a.hom b.hom + +instance : (functor (k := k) (R := R) (S := S) (F := F)).Additive where + map_add := by intros; apply ModuleCat.hom_ext; exact mapRight_add _ _ + +def naturalMap (a : F →ₗ[Rᵐᵒᵖ] G) (ha : ∀ (s : S) f, a (s • f) = s • a f) : + functor (k := k) (R := R) (S := S) (F := F) ⟶ functor (k := k) (R := R) (S := S) (F := G) where + app M := ModuleCat.ofHom (mapLeftLinear (k := k) a ha M) + naturality M N b := by + apply ModuleCat.hom_ext + apply leftHom_ext + intro f m + rfl + +variable {ι : Type*} {c : ComplexShape ι} + +def complexMap (a : F →ₗ[Rᵐᵒᵖ] G) (ha : ∀ (s : S) f, a (s • f) = s • a f) + (P : HomologicalComplex (ModuleCat.{u} R) c) : + ((functor (k := k) (R := R) (S := S) (F := F)).mapHomologicalComplex c).obj P ⟶ + ((functor (k := k) (R := R) (S := S) (F := G)).mapHomologicalComplex c).obj P where + f i := (naturalMap (k := k) a ha).app (P.X i) + comm' i j _ := ((naturalMap (k := k) a ha).naturality (P.d i j)).symm + +def complexSequence (a : F →ₗ[Rᵐᵒᵖ] G) (b : G →ₗ[Rᵐᵒᵖ] H) + (ha : ∀ (s : S) f, a (s • f) = s • a f) (hb : ∀ (s : S) g, b (s • g) = s • b g) + (hab : b.comp a = 0) (P : HomologicalComplex (ModuleCat.{u} R) c) : + ShortComplex (HomologicalComplex (ModuleCat.{u} S) c) := + ShortComplex.mk (complexMap (k := k) a ha P) (complexMap (k := k) b hb P) (by + ext i : 1 + apply ModuleCat.hom_ext + apply leftHom_ext + intro f m + change tmul (b (a f)) m = 0 + rw [show b (a f) = 0 from LinearMap.congr_fun hab f, zero_tmul]) + +theorem complexSequence_shortExact (a : F →ₗ[Rᵐᵒᵖ] G) (b : G →ₗ[Rᵐᵒᵖ] H) + (ha : ∀ (s : S) f, a (s • f) = s • a f) (hb : ∀ (s : S) g, b (s • g) = s • b g) + (hab : b.comp a = 0) (hinj : Function.Injective a) + (hex : Function.Exact a b) (hsurj : Function.Surjective b) + (P : HomologicalComplex (ModuleCat.{u} R) c) + [∀ i, Module.Finite R (P.X i)] [∀ i, Module.Projective R (P.X i)] : + (complexSequence (k := k) a b ha hb hab P).ShortExact := by + apply HomologicalComplex.shortExact_of_degreewise_shortExact + intro i + refine { exact := ?_, mono_f := ?_, epi_g := ?_ } + · apply (ShortComplex.ShortExact.moduleCat_exact_iff_function_exact _).mpr + exact mapLeft_exact a b hex + · apply (ModuleCat.mono_iff_injective _).mpr + exact mapLeft_injective a hinj + · apply (ModuleCat.epi_iff_surjective _).mpr + exact mapLeft_surjective b hsurj + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCokernel.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCokernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..aac498001ec17908c5573366e20ed7fa0bf25abf --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCokernel.lean @@ -0,0 +1,84 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCategory +import OAI.Algebra.AuslanderReiten.Cones.CochainCokernel + +namespace OAI + +noncomputable section +namespace ArExplicit.BalancedTensor +open CategoryTheory CompleteComparison +universe u +variable {k R S F : Type u} [Field k] [Ring R] [Ring S] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module S F] +variable [IsScalarTower k Rᵐᵒᵖ F] +variable [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] +variable [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] +variable {L M : Type u} [AddCommGroup L] [AddCommGroup M] +variable [Module k L] [Module k M] [Module R L] [Module R M] +variable [IsScalarTower k R L] [IsScalarTower k R M] +variable [SMulCommClass k R M] + +def cokernelEquiv (d : L →ₗ[R] M) : + (BalancedTensor k R F M ⧸ LinearMap.range (mapRight (k := k) (F := F) (S := S) d)) ≃ₗ[S] + BalancedTensor k R F (M ⧸ LinearMap.range d) := + (mapRight_exact (k := k) (F := F) (S := S) d (LinearMap.range d).mkQ + (LinearMap.exact_map_mkQ_range d)).linearEquivOfSurjective + (mapRight_surjective (k := k) (F := F) (S := S) _ (Submodule.mkQ_surjective _)) + +theorem cokernelEquiv_mk (d : L →ₗ[R] M) (x : BalancedTensor k R F M) : + cokernelEquiv (k := k) (F := F) (S := S) d (Submodule.Quotient.mk x) = + mapRight (k := k) (F := F) (S := S) (LinearMap.range d).mkQ x := by + apply (cokernelEquiv (k := k) (F := F) (S := S) d).symm.injective + rw [LinearEquiv.symm_apply_apply] + exact (Function.Exact.linearEquivOfSurjective_symm_apply _ _ x).symm + +@[simp] theorem cokernelEquiv_mk_tmul (d : L →ₗ[R] M) (f : F) (m : M) : + cokernelEquiv (k := k) (F := F) (S := S) d (Submodule.Quotient.mk (tmul f m)) = + tmul f (Submodule.Quotient.mk m) := by + rw [cokernelEquiv_mk, mapRight_tmul] + rfl + +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +def cochainCokernelEquiv (P : CochainComplex (ModuleCat.{u} R) ℤ) : + CochainCokernel (((functor (k := k) (R := R) (S := S) (F := F)).mapHomologicalComplex _).obj P) ≃ₗ[S] + BalancedTensor k R F (CochainCokernel P) := + cokernelEquiv (k := k) (F := F) (S := S) (P.d (-1) 0).hom + +@[simp] theorem cochainCokernelEquiv_mk_tmul + (P : CochainComplex (ModuleCat.{u} R) ℤ) (f : F) (x : P.X 0) : + cochainCokernelEquiv (k := k) (F := F) (S := S) P + (Submodule.Quotient.mk (tmul f x)) = tmul f (Submodule.Quotient.mk x) := + cokernelEquiv_mk_tmul (k := k) (F := F) (S := S) (P.d (-1) 0).hom f x + +variable {G : Type u} [AddCommGroup G] [Module k G] [Module Rᵐᵒᵖ G] [Module S G] +variable [IsScalarTower k Rᵐᵒᵖ G] +variable [SMulCommClass k S G] [SMulCommClass S Rᵐᵒᵖ G] +variable [Module.Finite Rᵐᵒᵖ G] [Module.Projective Rᵐᵒᵖ G] + +theorem cochainCokernelEquiv_natural + (a : F →ₗ[Rᵐᵒᵖ] G) (ha : ∀ (s : S) f, a (s • f) = s • a f) + (P : CochainComplex (ModuleCat.{u} R) ℤ) + (z : CochainCokernel (((functor (k := k) (R := R) (S := S) (F := F)).mapHomologicalComplex _).obj P)) : + cochainCokernelEquiv (k := k) (F := G) (S := S) P + (cochainCokernelMap (complexMap (k := k) a ha P) z) = + mapLeft (k := k) (M := CochainCokernel P) a + (cochainCokernelEquiv (k := k) (F := F) (S := S) P z) := by + obtain ⟨x,rfl⟩ := Submodule.mkQ_surjective + (LinearMap.range (((((functor (k := k) (R := R) (S := S) (F := F)).mapHomologicalComplex _).obj P).d (-1) 0).hom)) z + induction x using induction_on with + | zero => + repeat' erw [map_zero] + | add x y hx hy => + repeat' erw [map_add] + exact congrArg₂ (· + ·) hx hy + | tmul f m => + erw [cochainCokernelMap_mk] + change cochainCokernelEquiv (k := k) (F := G) (S := S) P + (Submodule.Quotient.mk (tmul (a f) m)) = _ + erw [cochainCokernelEquiv_mk_tmul] + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorComparisonMaps.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorComparisonMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1d1c6b8cf6f6bc348426101eb3b55f1e104465b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorComparisonMaps.lean @@ -0,0 +1,90 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorResolution +import OAI.Algebra.AuslanderReiten.Complete.CompleteCokernelLifts + +namespace OAI + +noncomputable section +open CategoryTheory CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.BalancedTensor +open CompleteComparison +universe u +variable {k R F : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module R F] +variable [IsScalarTower k Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] +variable [Module.Finite R F] [Module.Projective R F] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (τ : FrobeniusTrace k R) (M N : FiniteLeftModule k R) +variable (e : BalancedTensor k R F M.carrier ≃ₗ[R] N.carrier) + +def comparisonOut : completeTensor (F := F) τ M ⟶ N.completeCochain τ := + cokernelCochainLift (completeTensor_totallyAcyclic (F := F) τ M) + (N.completeCochain_totallyAcyclic τ) + (((tensorCokernelEquiv (F := F) τ M).trans e).trans + (N.completeCochainCokernelEquiv τ).symm).toLinearMap + +def comparisonIn : N.completeCochain τ ⟶ completeTensor (F := F) τ M := + cokernelCochainLift (N.completeCochain_totallyAcyclic τ) + (completeTensor_totallyAcyclic (F := F) τ M) + (((tensorCokernelEquiv (F := F) τ M).trans e).trans + (N.completeCochainCokernelEquiv τ).symm).symm.toLinearMap + +theorem comparisonOut_quotient : + (HomotopyCategory.quotient _ _).map (comparisonOut τ M N e) = + (completeTensorIso τ M N e).hom := + cokernelCochainLift_quotient _ _ _ + +theorem comparisonIn_quotient : + (HomotopyCategory.quotient _ _).map (comparisonIn τ M N e) = + (completeTensorIso τ M N e).inv := + cokernelCochainLift_quotient_inv _ _ _ + +theorem comparisonOut_bijective (K : CochainComplex (ModuleCat.{u} R) ℤ) (n : ℤ) : + Function.Bijective (fullHomPostcomp (K := K) (comparisonOut τ M N e) n) := by + apply fullHomPostcomp_bijective k n (comparisonOut τ M N e) (comparisonIn τ M N e) + · rw [CategoryTheory.Functor.map_comp, comparisonOut_quotient, comparisonIn_quotient, + Iso.hom_inv_id] + · rw [CategoryTheory.Functor.map_comp, comparisonOut_quotient, comparisonIn_quotient, + Iso.inv_hom_id] + +variable {G : Type u} [AddCommGroup G] [Module k G] [Module Rᵐᵒᵖ G] [Module R G] +variable [IsScalarTower k Rᵐᵒᵖ G] +variable [SMulCommClass k R G] [SMulCommClass R Rᵐᵒᵖ G] +variable [Module.Finite Rᵐᵒᵖ G] [Module.Projective Rᵐᵒᵖ G] +variable [Module.Finite R G] [Module.Projective R G] +variable (N' : FiniteLeftModule k R) + +theorem comparisonOut_natural + (a : F →ₗ[Rᵐᵒᵖ] G) (ha : ∀ (r : R) f, a (r • f) = r • a f) + (e' : BalancedTensor k R G M.carrier ≃ₗ[R] N'.carrier) + (b : N.carrier →ₗ[R] N'.carrier) + (hab : ∀ x, e' (mapLeft (k := k) (M := M.carrier) a x) = b (e x)) : + (HomotopyCategory.quotient _ _).map + (complexMap (k := k) a ha (M.completeCochain τ) ≫ comparisonOut τ M N' e') = + (HomotopyCategory.quotient _ _).map + (comparisonOut τ M N e ≫ FiniteLeftModule.resolutionMap τ b) := by + rw [CategoryTheory.Functor.map_comp, CategoryTheory.Functor.map_comp, + comparisonOut_quotient, comparisonOut_quotient] + exact completeTensorIso_natural τ M N N' a ha e e' b hab + +theorem comparisonOut_fullHom_natural + (a : F →ₗ[Rᵐᵒᵖ] G) (ha : ∀ (r : R) f, a (r • f) = r • a f) + (e' : BalancedTensor k R G M.carrier ≃ₗ[R] N'.carrier) + (b : N.carrier →ₗ[R] N'.carrier) + (hab : ∀ x, e' (mapLeft (k := k) (M := M.carrier) a x) = b (e x)) + (K : CochainComplex (ModuleCat.{u} R) ℤ) (n : ℤ) + (x : CohomologyClass K (completeTensor (F := F) τ M) n) : + fullHomPostcomp (comparisonOut τ M N' e') n + (fullHomPostcomp (complexMap (k := k) a ha (M.completeCochain τ)) n x) = + fullHomPostcomp (FiniteLeftModule.resolutionMap τ b) n + (fullHomPostcomp (comparisonOut τ M N e) n x) := by + rw [fullHomPostcomp_comp, fullHomPostcomp_comp] + exact fullHomPostcomp_congr k n (comparisonOut_natural τ M N e N' a ha e' b hab) x + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorComplete.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorComplete.lean new file mode 100644 index 0000000000000000000000000000000000000000..09cc738de66c4cc3c98450c0f2eebe49d3794f0a --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorComplete.lean @@ -0,0 +1,50 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCokernel +import OAI.Algebra.AuslanderReiten.Complete.CompleteShiftDual + +namespace OAI + +noncomputable section +namespace ArExplicit.BalancedTensor +open CategoryTheory +universe u +variable {k R S F : Type u} [Field k] [Ring R] [Ring S] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module S F] +variable [IsScalarTower k Rᵐᵒᵖ F] +variable [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] +variable [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] +variable [Module.Finite S F] [Module.Projective S F] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +theorem complex_exactProjective (P : CochainComplex (ModuleCat.{u} R) ℤ) + (hP : ExactProjectiveCochain P) : + ExactProjectiveCochain + (((functor (k := k) (R := R) (S := S) (F := F)).mapHomologicalComplex _).obj P) where + finite n := by + let := hP.finite n + exact finite + projective n := by + let := hP.finite n + let := hP.projective n + exact projective + exactAt n := by + rw [HomologicalComplex.exactAt_iff' _ (n-1) n (n+1) (by simp) (by simp), + ShortComplex.moduleCat_exact_iff_range_eq_ker] + have he := hP.exactAt n + rw [HomologicalComplex.exactAt_iff' _ (n-1) n (n+1) (by simp) (by simp), + ShortComplex.moduleCat_exact_iff_range_eq_ker] at he + exact (LinearMap.exact_iff.mp + (mapRight_exact (k := k) (F := F) (S := S) _ _ + (LinearMap.exact_iff.mpr he.symm))).symm + +theorem complex_totallyAcyclic [Module.Injective S S] + (P : CochainComplex (ModuleCat.{u} R) ℤ) (hP : ExactProjectiveCochain P) : + TotallyAcyclicCochain + (((functor (k := k) (R := R) (S := S) (F := F)).mapHomologicalComplex _).obj P) := + TotallyAcyclicCochain.of_chain + (complex_exactProjective (k := k) (F := F) (S := S) P hP).to_chain.totallyAcyclic + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCompleteAction.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCompleteAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ad253ab60c7cc29c92cb3e10a08a2b9eb2c2cb2 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCompleteAction.lean @@ -0,0 +1,119 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorResolution +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCanonicalEndpoint +import OAI.Algebra.AuslanderReiten.Complete.CompleteFunctorCokernelAction +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorNative + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian CategoryTheory.Limits +open CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.BalancedTensor +open CompleteComparison +universe u +variable {k R F : Type u} [Field k] [CharP k 2] [Ring R] [Algebra k R] [Module.Finite k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module R F] +variable [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] +variable [Module.Finite R F] [Module.Projective R F] +variable [HasDerivedCategory (ModuleCat.{u} R)] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable [PreservesFiniteLimits (functor (k := k) (R := R) (S := R) (F := F))] +variable [PreservesFiniteColimits (functor (k := k) (R := R) (S := R) (F := F))] +variable [(functor (k := k) (R := R) (S := R) (F := F)).PreservesProjectiveObjects] +variable (τ : FrobeniusTrace k R) (M : FiniteLeftModule k R) +variable (e : BalancedTensor k R F M.carrier ≃ₗ[R] M.carrier) + +def nativeEvaluationIso : + (functor (k := k) (R := R) (S := R) (F := F)).obj M.carrier ≅ M.carrier := + nativeObjectIso (k := k) (R := R) (S := R) (F := F) M.carrier ≪≫ e.toModuleIso + +def completeActionEndpoint : ModuleCat.of R (CochainCokernel (M.completeCochain τ)) ≅ + (functor (k := k) (R := R) (S := R) (F := F)).obj + (ModuleCat.of R (CochainCokernel (M.completeCochain τ))) := + (M.completeCochainCokernelEquiv τ).toModuleIso ≪≫ (nativeEvaluationIso M e).symm ≪≫ + (functor (k := k) (R := R) (S := R) (F := F)).mapIso + (M.completeCochainCokernelEquiv τ).symm.toModuleIso + +def completeActionCokernelIso : + ModuleCat.of R (CochainCokernel (completeTensor (F := F) τ M)) ≅ + ModuleCat.of R (CochainCokernel (M.completeCochain τ)) := + rawFunctorEndpointIso (functor (k := k) (R := R) (S := R) (F := F)) (M.completeCochain τ) + (M.completeCochain_totallyAcyclic τ).to_chain + (completeTensor_totallyAcyclic (F := F) τ M).to_chain ≪≫ + (completeActionEndpoint τ M e).symm + +def completeActionIn : M.completeCochain τ ⟶ completeTensor (F := F) τ M := + cokernelCochainLift (M.completeCochain_totallyAcyclic τ) + (completeTensor_totallyAcyclic (F := F) τ M) + (completeActionCokernelIso τ M e).inv.hom + +def completeActionOut : completeTensor (F := F) τ M ⟶ M.completeCochain τ := + cokernelCochainLift (completeTensor_totallyAcyclic (F := F) τ M) + (M.completeCochain_totallyAcyclic τ) (completeActionCokernelIso τ M e).hom.hom + +omit [CharP k 2] [SMulCommClass k Rᵐᵒᵖ F] + [HasDerivedCategory (ModuleCat.{u} R)] in +theorem completeAction_inverse : + (HomotopyCategory.quotient _ _).map + (completeActionIn τ M e ≫ completeActionOut τ M e) = 𝟙 _ := by + exact cokernelCochainLift_homotopy_inverse (M.completeCochain_totallyAcyclic τ) + (completeTensor_totallyAcyclic (F := F) τ M) + (completeActionCokernelIso τ M e).symm.toLinearEquiv + +omit [CharP k 2] [SMulCommClass k Rᵐᵒᵖ F] + [HasDerivedCategory (ModuleCat.{u} R)] in +theorem completeAction_inverse' : + (HomotopyCategory.quotient _ _).map + (completeActionOut τ M e ≫ completeActionIn τ M e) = 𝟙 _ := by + exact cokernelCochainLift_homotopy_inverse (completeTensor_totallyAcyclic (F := F) τ M) + (M.completeCochain_totallyAcyclic τ) (completeActionCokernelIso τ M e).toLinearEquiv + +omit [SMulCommClass k Rᵐᵒᵖ F] in +theorem completeAction_scalar (n : ℕ) (c : k) + (hs : ∀ z : Ext M.carrier M.carrier (n+1), + selfExtIso (k := k) (nativeEvaluationIso M e) (n+1) + (z.mapExactFunctor (functor (k := k) (R := R) (S := R) (F := F))) = c • z) + (x : CohomologyClass (M.completeCochain τ) (M.completeCochain τ) ((n+1 : ℕ) : ℤ)) : + fullHomPostcomp (completeActionOut τ M e) _ + (fullHomPrecomp (completeActionIn τ M e) _ + (mapFullHom (functor (k := k) (R := R) (S := R) (F := F)) _ _ _ x)) = c • x := by + apply fullHom_rawFunctor_scalar (functor (k := k) (R := R) (S := R) (F := F)) + (M.completeCochain τ) (M.completeCochain_totallyAcyclic τ).to_chain + (completeTensor_totallyAcyclic (F := F) τ M).to_chain + (completeActionIn τ M e) (completeActionOut τ M e) (completeActionEndpoint τ M e) + · exact cokernelCochainLift_map _ _ _ + · exact cokernelCochainLift_map _ _ _ + · exact exactFunctor_scalar_transport (functor (k := k) (R := R) (S := R) (F := F)) + (M.completeCochainCokernelEquiv τ).toModuleIso (nativeEvaluationIso M e).symm (n+1) c hs + +omit [CharP k 2] [SMulCommClass k Rᵐᵒᵖ F] + [HasDerivedCategory (ModuleCat.{u} R)] in +theorem completeActionCokernelIso_eq : completeActionCokernelIso τ M e = + (((tensorCokernelEquiv (F := F) τ M).trans e).trans + (M.completeCochainCokernelEquiv τ).symm).toModuleIso := by + rw [completeActionCokernelIso, rawFunctorEndpointIso_eq] + apply Iso.ext + have ht := congrArg (fun f => + (cochainCokernelEquiv (k := k) (F := F) (S := R) (M.completeCochain τ)).toModuleIso.hom ≫ + f ≫ e.toModuleIso.hom ≫ (M.completeCochainCokernelEquiv τ).toModuleIso.inv) + (nativeObjectIso_natural (k := k) (F := F) (S := R) + (M.completeCochainCokernelEquiv τ).toLinearMap) + exact ht + +omit [CharP k 2] [SMulCommClass k Rᵐᵒᵖ F] + [HasDerivedCategory (ModuleCat.{u} R)] in +theorem completeActionOut_quotient : + (HomotopyCategory.quotient _ _).map (completeActionOut τ M e) = + (completeTensorIso τ M M e).hom := by + unfold completeActionOut + rw [completeActionCokernelIso_eq] + exact cokernelCochainLift_quotient _ _ _ + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCompleteInverse.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCompleteInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..63225904822272bcd69fd77a1015548a26d75487 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorCompleteInverse.lean @@ -0,0 +1,35 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCompleteAction + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian CategoryTheory.Limits +open scoped ModuleCat.Algebra +namespace ArExplicit.BalancedTensor +universe u +variable {k R F : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module R F] +variable [IsScalarTower k Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] +variable [Module.Finite R F] [Module.Projective R F] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable [PreservesFiniteLimits (functor (k := k) (R := R) (S := R) (F := F))] +variable [PreservesFiniteColimits (functor (k := k) (R := R) (S := R) (F := F))] +variable [(functor (k := k) (R := R) (S := R) (F := F)).PreservesProjectiveObjects] +variable (τ : FrobeniusTrace k R) (M : FiniteLeftModule k R) +variable (e : BalancedTensor k R F M.carrier ≃ₗ[R] M.carrier) + +theorem completeActionIn_quotient : + (HomotopyCategory.quotient _ _).map (completeActionIn τ M e) = + (completeTensorIso τ M M e).inv := by + apply (cancel_mono (completeTensorIso τ M M e).hom).1 + have h := completeAction_inverse τ M e + rw [CategoryTheory.Functor.map_comp, completeActionOut_quotient] at h + exact h.trans (completeTensorIso τ M M e).inv_hom_id.symm + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorDoubleLift.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorDoubleLift.lean new file mode 100644 index 0000000000000000000000000000000000000000..82d15ff4d13a54260b1a5787efb33bff01a51265 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorDoubleLift.lean @@ -0,0 +1,68 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorMap +import Mathlib.LinearAlgebra.TensorProduct.Associator + +namespace OAI + +noncomputable section +namespace ArExplicit.BalancedTensor +open scoped TensorProduct +universe u +variable {k A B F G X Y Z : Type u} [CommRing k] [Ring A] [Ring B] + [AddCommGroup F] [AddCommGroup G] [AddCommGroup X] [AddCommGroup Y] [AddCommGroup Z] + [Module k F] [Module k G] [Module k X] [Module k Y] [Module k Z] + [Module Aᵐᵒᵖ F] [Module Bᵐᵒᵖ G] [Module A X] [Module B Y] + +def doubleLift (b : F →ₗ[k] X →ₗ[k] G →ₗ[k] Y →ₗ[k] Z) + (hA : ∀ (f : F) (a : A) (x : X) (g : G) (y : Y), b (MulOpposite.op a • f) x g y = b f (a • x) g y) + (hB : ∀ (f : F) (x : X) (g : G) (a : B) (y : Y), b f x (MulOpposite.op a • g) y = b f x g (a • y)) : + BalancedTensor k A F X →ₗ[k] BalancedTensor k B G Y →ₗ[k] Z := + lift + { toFun f := + { toFun x := lift (b f x) (hB f x) + map_add' x x' := by + apply hom_ext + intro g y + simp only [lift_tmul, map_add, LinearMap.add_apply] + map_smul' a x := by + apply hom_ext + intro g y + simp only [lift_tmul, map_smul, LinearMap.smul_apply, RingHom.id_apply] } + map_add' f f' := by + apply LinearMap.ext + intro x + apply hom_ext + intro g y + simp only [LinearMap.coe_mk, AddHom.coe_mk, lift_tmul, map_add, LinearMap.add_apply] + map_smul' a f := by + apply LinearMap.ext + intro x + apply hom_ext + intro g y + simp only [LinearMap.coe_mk, AddHom.coe_mk, lift_tmul, map_smul, + LinearMap.smul_apply, RingHom.id_apply] } + (by + intro f a x + apply hom_ext + intro g y + exact hA f a x g y) + +@[simp] theorem doubleLift_tmul (b : F →ₗ[k] X →ₗ[k] G →ₗ[k] Y →ₗ[k] Z) + (hA : ∀ (f : F) (a : A) (x : X) (g : G) (y : Y), b (MulOpposite.op a • f) x g y = b f (a • x) g y) + (hB : ∀ (f : F) (x : X) (g : G) (a : B) (y : Y), b f x (MulOpposite.op a • g) y = b f x g (a • y)) + (f : F) (x : X) (g : G) (y : Y) : + doubleLift b hA hB (tmul f x) (tmul g y) = b f x g y := rfl + +def curryFour (f : ((F ⊗[k] X) ⊗[k] (G ⊗[k] Y)) →ₗ[k] Z) : + F →ₗ[k] X →ₗ[k] G →ₗ[k] Y →ₗ[k] Z := + TensorProduct.curry ((TensorProduct.lcurry (RingHom.id k) G Y Z).comp + (TensorProduct.curry f)) + +@[simp] theorem curryFour_apply (h : ((F ⊗[k] X) ⊗[k] (G ⊗[k] Y)) →ₗ[k] Z) + (f : F) (x : X) (g : G) (y : Y) : + curryFour h f x g y = h ((f ⊗ₜ[k] x) ⊗ₜ[k] (g ⊗ₜ[k] y)) := rfl + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorEquiv.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..92c0edb1aa9eee5d24962c1d11e523e8bcd1e3e0 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorEquiv.lean @@ -0,0 +1,78 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorMap + +namespace OAI + +noncomputable section +namespace ArExplicit.BalancedTensor +universe u +variable {k R F F' M M' : Type u} [CommRing k] [Ring R] + [AddCommGroup F] [AddCommGroup F'] [AddCommGroup M] [AddCommGroup M'] + [Module k F] [Module k F'] [Module k M] [Module k M'] + [Module Rᵐᵒᵖ F] [Module Rᵐᵒᵖ F'] [Module R M] [Module R M'] +variable (e : F ≃ₗ[k] F') (v : M ≃ₗ[k] M') + (he : ∀ (r : Rᵐᵒᵖ) x, e (r • x) = r • e x) + (hv : ∀ (r : R) x, v (r • x) = r • v x) + +include he hv + +omit hv in +theorem inverse_equivariant_right (r : Rᵐᵒᵖ) (x : F') : + e.symm (r • x) = r • e.symm x := by + apply e.injective + rw [LinearEquiv.apply_symm_apply, he, LinearEquiv.apply_symm_apply] + +omit he in +theorem inverse_equivariant_left (r : R) (x : M') : + v.symm (r • x) = r • v.symm x := by + apply v.injective + rw [LinearEquiv.apply_symm_apply, hv, LinearEquiv.apply_symm_apply] + +def congr : BalancedTensor k R F M ≃ₗ[k] BalancedTensor k R F' M' where + __ := map e.toLinearMap v.toLinearMap he hv + invFun := map e.symm.toLinearMap v.symm.toLinearMap + (inverse_equivariant_right e he) (inverse_equivariant_left v hv) + left_inv z := by + change map e.symm.toLinearMap v.symm.toLinearMap + (inverse_equivariant_right e he) (inverse_equivariant_left v hv) + (map e.toLinearMap v.toLinearMap he hv z) = z + induction z using induction_on with + | zero => simp + | add z w hz hw => simp only [map_add, hz, hw] + | tmul f m => simp only [map_tmul, LinearEquiv.coe_coe, + LinearEquiv.symm_apply_apply] + right_inv z := by + change map e.toLinearMap v.toLinearMap he hv + (map e.symm.toLinearMap v.symm.toLinearMap + (inverse_equivariant_right e he) (inverse_equivariant_left v hv) z) = z + induction z using induction_on with + | zero => simp + | add z w hz hw => simp only [map_add, hz, hw] + | tmul f m => simp only [map_tmul, LinearEquiv.coe_coe, + LinearEquiv.apply_symm_apply] + +@[simp] theorem congr_tmul (f : F) (m : M) : + congr e v he hv (tmul f m) = tmul (e f) (v m) := rfl + +variable {S : Type u} [Ring S] [Module S F] [Module S F'] + [SMulCommClass k S F] [SMulCommClass k S F'] + [SMulCommClass S Rᵐᵒᵖ F] [SMulCommClass S Rᵐᵒᵖ F'] + (hs : ∀ (s : S) x, e (s • x) = s • e x) + +include hs + +theorem congr_smul (s : S) (z : BalancedTensor k R F M) : + congr e v he hv (s • z) = s • congr e v he hv z := by + induction z using induction_on with + | zero => simp + | add z w hz hw => simp only [smul_add, map_add, hz, hw] + | tmul f m => rw [smul_tmul, congr_tmul, hs, congr_tmul, smul_tmul] + +def congrLeft : BalancedTensor k R F M ≃ₗ[S] BalancedTensor k R F' M' where + __ := (congr e v he hv).toAddEquiv + map_smul' := congr_smul e v he hv hs + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorExact.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorExact.lean new file mode 100644 index 0000000000000000000000000000000000000000..d6ec39d6e11c958f67ab320c55e8b80f1c4fa32a --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorExact.lean @@ -0,0 +1,139 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorFunctor +import Mathlib.Algebra.Module.Projective +import Mathlib.RingTheory.Finiteness.Cardinality +import Mathlib.LinearAlgebra.Pi +import Mathlib.Algebra.Exact.Basic + +namespace OAI + +noncomputable section + +namespace ArExplicit.BalancedTensor + +variable {k R F : Type*} [CommRing k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] +variable [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] +variable {M N L : Type*} +variable [AddCommGroup M] [Module k M] [Module R M] [IsScalarTower k R M] [SMulCommClass k R M] +variable [AddCommGroup N] [Module k N] [Module R N] [IsScalarTower k R N] [SMulCommClass k R N] +variable [AddCommGroup L] [Module k L] [Module R L] [IsScalarTower k R L] [SMulCommClass k R L] +variable {n : ℕ} + +def rightCoefficients (s : F →ₗ[Rᵐᵒᵖ] (Fin n → Rᵐᵒᵖ)) : + BalancedTensor k R F M →ₗ[k] (Fin n → M) := + lift + { toFun f := + { toFun m i := (s f i).unop • m + map_add' m m' := by ext i; exact smul_add _ _ _ + map_smul' c m := by ext i; exact (smul_comm c (s f i).unop m).symm } + map_add' f f' := by + ext m i + change (s (f + f') i).unop • m = (s f i).unop • m + (s f' i).unop • m + simp only [map_add, Pi.add_apply, MulOpposite.unop_add, add_smul] + map_smul' c f := by + ext m i + change (s (c • f) i).unop • m = c • (s f i).unop • m + simp only [LinearMap.map_smul_of_tower, Pi.smul_apply, MulOpposite.unop_smul, + smul_assoc] } + (by + intro f r m + ext i + change (s (MulOpposite.op r • f) i).unop • m = (s f i).unop • (r • m) + simp only [map_smul, Pi.smul_apply, smul_eq_mul, MulOpposite.unop_mul, + MulOpposite.unop_op, mul_smul]) + +omit [SMulCommClass k Rᵐᵒᵖ F] in +@[simp] theorem rightCoefficients_tmul (s : F →ₗ[Rᵐᵒᵖ] (Fin n → Rᵐᵒᵖ)) + (f : F) (m : M) (i : Fin n) : + rightCoefficients (k := k) s (tmul f m) i = (s f i).unop • m := rfl + +def freeRecombine (p : (Fin n → Rᵐᵒᵖ) →ₗ[Rᵐᵒᵖ] F) : + (Fin n → M) →ₗ[k] BalancedTensor k R F M := + ∑ i, (mk (p (Pi.single i 1))).comp (LinearMap.proj i) + +omit [Algebra k R] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] + [IsScalarTower k R M] [SMulCommClass k R M] in +@[simp] theorem freeRecombine_apply (p : (Fin n → Rᵐᵒᵖ) →ₗ[Rᵐᵒᵖ] F) (m : Fin n → M) : + freeRecombine (k := k) p m = ∑ i, tmul (p (Pi.single i 1)) (m i) := by + simp [freeRecombine, mk] + +omit [SMulCommClass k Rᵐᵒᵖ F] in +theorem freeRecombine_rightCoefficients + (s : F →ₗ[Rᵐᵒᵖ] (Fin n → Rᵐᵒᵖ)) (p : (Fin n → Rᵐᵒᵖ) →ₗ[Rᵐᵒᵖ] F) + (h : p.comp s = LinearMap.id) (z : BalancedTensor k R F M) : + freeRecombine p (rightCoefficients s z) = z := by + induction z using induction_on with + | zero => simp + | add x y hx hy => simp only [map_add, hx, hy] + | tmul f m => + rw [freeRecombine_apply] + calc + (∑ i, tmul (p (Pi.single i 1)) (rightCoefficients s (tmul f m) i)) = + ∑ i, tmul (p (Pi.single i (s f i))) m := by + apply Finset.sum_congr rfl + intro i hi + rw [rightCoefficients_tmul, ← balance] + congr 1 + rw [MulOpposite.op_unop, ← p.map_smul] + congr 1 + ext j + by_cases hij : j = i + · subst j; simp + · simp [hij] + _ = tmul (p (∑ i, Pi.single i (s f i))) m := by + simp only [map_sum] + exact (map_sum ((mk (k := k) (R := R)).flip m) _ _).symm + _ = tmul f m := by + rw [Finset.univ_sum_single] + exact congrArg (fun f => tmul (k := k) (R := R) f m) (DFunLike.congr_fun h f) + +variable {S : Type*} [Ring S] [Module S F] +variable [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] + +omit [SMulCommClass k Rᵐᵒᵖ F] in +theorem rightCoefficients_natural (s : F →ₗ[Rᵐᵒᵖ] (Fin n → Rᵐᵒᵖ)) (b : M →ₗ[R] N) + (z : BalancedTensor k R F M) : + rightCoefficients s (mapRight (S := S) b z) = fun i => b (rightCoefficients s z i) := by + induction z using induction_on with + | zero => ext i; simp + | tmul f m => ext i; simp + | add x y hx hy => + ext i + simp only [map_add, Pi.add_apply, hx, hy] + +omit [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] + [SMulCommClass k R M] [SMulCommClass k R N] in +theorem freeRecombine_natural (p : (Fin n → Rᵐᵒᵖ) →ₗ[Rᵐᵒᵖ] F) (b : M →ₗ[R] N) + (z : Fin n → M) : + mapRight (S := S) b (freeRecombine p z) = freeRecombine (k := k) p (fun i => b (z i)) := by + simp only [freeRecombine_apply, map_sum, mapRight_tmul] + +omit [SMulCommClass k Rᵐᵒᵖ F] [SMulCommClass k R M] in +theorem mapRight_exact [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] + (e : M →ₗ[R] N) (d : N →ₗ[R] L) (hex : Function.Exact e d) : + Function.Exact (mapRight (k := k) (F := F) (S := S) e) (mapRight (S := S) d) := by + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' Rᵐᵒᵖ F + obtain ⟨s, hs⟩ := Module.projective_lifting_property p (LinearMap.id : F →ₗ[Rᵐᵒᵖ] F) hp + intro z + constructor + · intro hz + have hcoords : ∀ i, d (rightCoefficients s z i) = 0 := by + have hnat := rightCoefficients_natural (S := S) s d z + rw [hz, map_zero] at hnat + intro i + exact (congrFun hnat i).symm + choose w hw using fun i => (hex (rightCoefficients s z i)).mp (hcoords i) + refine ⟨freeRecombine p w, ?_⟩ + rw [freeRecombine_natural] + convert freeRecombine_rightCoefficients s p hs z using 1 + exact congrArg (freeRecombine (k := k) p) (funext hw) + · rintro ⟨w, rfl⟩ + have hde : d.comp e = 0 := by ext m; exact (hex (e m)).mpr ⟨m, rfl⟩ + change ((mapRight (S := S) d).comp (mapRight (S := S) e)) w = 0 + rw [← mapRight_comp, hde, mapRight_zero, LinearMap.zero_apply] + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFiniteEvaluation.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFiniteEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..c7e0cfe026f184decfeaa04c17650b09be91951f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFiniteEvaluation.lean @@ -0,0 +1,25 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCompleteAction +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorNativeEvaluation + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.BalancedTensor +universe u +variable {k R F : Type u} [Field k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module R F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable (M : FiniteLeftModule k R) +variable (e : BalancedTensor k R F M.carrier ≃ₗ[R] M.carrier) + +theorem nativeEvaluationIso_tmul (f : F) (m : M.carrier) : + (nativeEvaluationIso M e).hom.hom + (letI := moduleCatBaseModule (k := k) (R := R) M.carrier; tmul f m) = e (tmul f m) := + tensorEvaluationIso_tmul M.carrier e f m + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFirst.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFirst.lean new file mode 100644 index 0000000000000000000000000000000000000000..54fc1b0838fb17ebeea86fc5b3fc63891645bbbc --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFirst.lean @@ -0,0 +1,139 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorMap +import Mathlib.Algebra.Module.Projective + +namespace OAI + +noncomputable section +namespace ArExplicit.BalancedTensor + +universe u +variable {k R F G Q X : Type u} [Field k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [IsScalarTower k Rᵐᵒᵖ F] +variable [AddCommGroup G] [Module k G] [Module Rᵐᵒᵖ G] [IsScalarTower k Rᵐᵒᵖ G] +variable [AddCommGroup Q] [Module k Q] [Module Rᵐᵒᵖ Q] [IsScalarTower k Rᵐᵒᵖ Q] +variable [AddCommGroup X] [Module k X] [Module R X] [IsScalarTower k R X] + +def mapFirst (X : Type u) [AddCommGroup X] [Module k X] [Module R X] + (f : F →ₗ[Rᵐᵒᵖ] G) : BalancedTensor k R F X →ₗ[k] BalancedTensor k R G X := + map (f.restrictScalars k) (LinearMap.id : X →ₗ[k] X) + (fun a x => f.map_smul a x) (fun _ _ => rfl) + +omit [IsScalarTower k R X] in +@[simp] theorem mapFirst_tmul (f : F →ₗ[Rᵐᵒᵖ] G) (m : F) (x : X) : + mapFirst (k := k) X f (tmul m x) = tmul (f m) x := rfl + +omit [IsScalarTower k R X] in +@[simp] theorem mapFirst_id : mapFirst (k := k) X (LinearMap.id : F →ₗ[Rᵐᵒᵖ] F) = LinearMap.id := by + apply LinearMap.ext + intro z + induction z using induction_on with + | zero => simp + | tmul f x => rfl + | add z w hz hw => simp_all + +omit [IsScalarTower k R X] in +@[simp] theorem mapFirst_comp (f : F →ₗ[Rᵐᵒᵖ] G) (g : G →ₗ[Rᵐᵒᵖ] Q) : + mapFirst (k := k) X (g.comp f) = (mapFirst (k := k) X g).comp (mapFirst (k := k) X f) := by + apply LinearMap.ext + intro z + induction z using induction_on with + | zero => simp + | tmul f x => rfl + | add z w hz hw => simp_all + +omit [IsScalarTower k R X] in +@[simp] theorem mapFirst_add (f g : F →ₗ[Rᵐᵒᵖ] G) : + mapFirst (k := k) X (f + g) = mapFirst (k := k) X f + mapFirst (k := k) X g := by + apply LinearMap.ext + intro z + induction z using induction_on with + | zero => simp + | tmul f x => simp [BalancedTensor.add_tmul] + | add z w hz hw => simp_all [add_left_comm, add_comm] + +omit [IsScalarTower k R X] in +@[simp] theorem mapFirst_zero : mapFirst (k := k) X (0 : F →ₗ[Rᵐᵒᵖ] G) = 0 := by + apply LinearMap.ext + intro z + induction z using induction_on with + | zero => simp + | tmul f x => simp + | add z w hz hw => simp_all + +theorem exists_splitting (f : F →ₗ[Rᵐᵒᵖ] G) (g : G →ₗ[Rᵐᵒᵖ] Q) + (hf : Function.Injective f) (hg : Function.Surjective g) + (he : LinearMap.range f = LinearMap.ker g) [Module.Projective Rᵐᵒᵖ Q] : + ∃ c : G →ₗ[Rᵐᵒᵖ] F, ∃ s : Q →ₗ[Rᵐᵒᵖ] G, + c.comp f = LinearMap.id ∧ g.comp s = LinearMap.id ∧ + f.comp c + s.comp g = LinearMap.id := by + obtain ⟨s, hs⟩ := Module.projective_lifting_property g (LinearMap.id : Q →ₗ[Rᵐᵒᵖ] Q) hg + let e : F ≃ₗ[Rᵐᵒᵖ] LinearMap.range f := LinearEquiv.ofBijective f.rangeRestrict + ⟨fun x y h => hf (congrArg Subtype.val h), by + rintro ⟨y, x, rfl⟩ + exact ⟨x, rfl⟩⟩ + let r : G →ₗ[Rᵐᵒᵖ] LinearMap.range f := + { toFun := fun y => ⟨y - s (g y), by + rw [he] + change g (y - s (g y)) = 0 + rw [map_sub, show g (s (g y)) = g y from DFunLike.congr_fun hs (g y), sub_self]⟩ + map_add' a b := by + apply Subtype.ext + change a + b - s (g (a + b)) = (a - s (g a)) + (b - s (g b)) + simp only [map_add, add_sub_add_comm] + map_smul' a b := by + apply Subtype.ext + change a • b - s (g (a • b)) = a • (b - s (g b)) + simp only [map_smul, smul_sub] } + let c : G →ₗ[Rᵐᵒᵖ] F := e.symm.toLinearMap.comp r + have hc (y : G) : f (c y) = y - s (g y) := by + exact congrArg Subtype.val (e.apply_symm_apply (r y)) + have hgf : g.comp f = 0 := LinearMap.range_le_ker_iff.mp he.le + refine ⟨c, s, ?_, hs, ?_⟩ + · apply LinearMap.ext + intro x + apply hf + rw [LinearMap.comp_apply, hc] + have hz : g (f x) = 0 := DFunLike.congr_fun hgf x + simp [hz] + · apply LinearMap.ext + intro y + change f (c y) + s (g y) = y + rw [hc, sub_add_cancel] + +omit [IsScalarTower k R X] in +theorem mapFirst_shortExact (f : F →ₗ[Rᵐᵒᵖ] G) (g : G →ₗ[Rᵐᵒᵖ] Q) + (hf : Function.Injective f) (hg : Function.Surjective g) + (he : LinearMap.range f = LinearMap.ker g) [Module.Projective Rᵐᵒᵖ Q] : + Function.Injective (mapFirst (k := k) X f) ∧ Function.Surjective (mapFirst (k := k) X g) ∧ + LinearMap.range (mapFirst (k := k) X f) = LinearMap.ker (mapFirst (k := k) X g) := by + obtain ⟨c, s, hcf, hgs, hsum⟩ := exists_splitting f g hf hg he + have hcf' : (mapFirst (k := k) X c).comp (mapFirst (k := k) X f) = LinearMap.id := by + rw [← mapFirst_comp, hcf, mapFirst_id] + have hgs' : (mapFirst (k := k) X g).comp (mapFirst (k := k) X s) = LinearMap.id := by + rw [← mapFirst_comp, hgs, mapFirst_id] + have hsum' : (mapFirst (k := k) X f).comp (mapFirst (k := k) X c) + + (mapFirst (k := k) X s).comp (mapFirst (k := k) X g) = LinearMap.id := by + rw [← mapFirst_comp, ← mapFirst_comp, ← mapFirst_add, hsum, mapFirst_id] + have hgf : g.comp f = 0 := LinearMap.range_le_ker_iff.mp he.le + have hgf' : (mapFirst (k := k) X g).comp (mapFirst (k := k) X f) = 0 := by + rw [← mapFirst_comp, hgf, mapFirst_zero] + refine ⟨?_, ?_, le_antisymm (LinearMap.range_le_ker_iff.mpr hgf') ?_⟩ + · intro x y hxy + have hx := DFunLike.congr_fun hcf' x + have hy := DFunLike.congr_fun hcf' y + change mapFirst (k := k) X c (mapFirst (k := k) X f x) = x at hx + change mapFirst (k := k) X c (mapFirst (k := k) X f y) = y at hy + rw [← hx, ← hy, hxy] + · intro z + exact ⟨mapFirst (k := k) X s z, DFunLike.congr_fun hgs' z⟩ + · intro z hz + refine ⟨mapFirst (k := k) X c z, ?_⟩ + have h := DFunLike.congr_fun hsum' z + change mapFirst (k := k) X f (mapFirst (k := k) X c z) + mapFirst (k := k) X s (mapFirst (k := k) X g z) = z at h + simpa only [show mapFirst (k := k) X g z = 0 from hz, map_zero, add_zero] using h + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFunctor.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..6082059ea469f5bee1c7c2e43e695aab5e375ac4 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFunctor.lean @@ -0,0 +1,78 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorMap + +namespace OAI + +namespace ArExplicit.BalancedTensor + +variable {k R S F M N L : Type*} [CommRing k] [Ring R] [Ring S] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] +variable [Module S F] [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] +variable [AddCommGroup M] [Module k M] [Module R M] [IsScalarTower k R M] +variable [AddCommGroup N] [Module k N] [Module R N] [IsScalarTower k R N] +variable [AddCommGroup L] [Module k L] [Module R L] [IsScalarTower k R L] + +def mapRight (b : M →ₗ[R] N) : BalancedTensor k R F M →ₗ[S] BalancedTensor k R F N := + liftLeft + { toFun := fun f => (mk f).comp (b.restrictScalars k) + map_add' := by intros; ext m; simp + map_smul' := by intros; ext m; simp } + (by + intro f r m + change tmul (MulOpposite.op r • f) (b m) = tmul f (b (r • m)) + rw [b.map_smul, balance]) + (by intro s f m; exact (smul_tmul s f (b m)).symm) + +@[simp] theorem mapRight_tmul (b : M →ₗ[R] N) (f : F) (m : M) : + mapRight (k := k) (S := S) b (tmul f m) = tmul f (b m) := rfl + +omit [Algebra k R] [IsScalarTower k R M] in +@[ext] theorem leftHom_ext {Q : Type*} [AddCommGroup Q] [Module S Q] + (f g : BalancedTensor k R F M →ₗ[S] Q) + (h : ∀ x y, f (tmul x y) = g (tmul x y)) : f = g := by + apply LinearMap.ext + intro z + induction z using induction_on with + | zero => simp + | tmul x y => exact h x y + | add x y hx hy => simp only [map_add, hx, hy] + +@[simp] theorem mapRight_id : mapRight (k := k) (S := S) (LinearMap.id : M →ₗ[R] M) = + (LinearMap.id : BalancedTensor k R F M →ₗ[S] BalancedTensor k R F M) := by + apply leftHom_ext + intro f m + rfl + +@[simp] theorem mapRight_comp (b : M →ₗ[R] N) (c : N →ₗ[R] L) : + mapRight (k := k) (F := F) (S := S) (c.comp b) = (mapRight c).comp (mapRight b) := by + apply leftHom_ext + intro f m + rfl + +@[simp] theorem mapRight_zero : mapRight (k := k) (S := S) (0 : M →ₗ[R] N) = + (0 : BalancedTensor k R F M →ₗ[S] BalancedTensor k R F N) := by + apply leftHom_ext + intro f m + exact tmul_zero f + +theorem mapRight_add (b c : M →ₗ[R] N) : + mapRight (k := k) (F := F) (S := S) (b + c) = mapRight b + mapRight c := by + apply leftHom_ext + intro f m + exact tmul_add f (b m) (c m) + +theorem mapRight_surjective (b : M →ₗ[R] N) (hb : Function.Surjective b) : + Function.Surjective (mapRight (k := k) (F := F) (S := S) b) := by + intro z + induction z using induction_on with + | zero => exact ⟨0, map_zero _⟩ + | tmul f n => + obtain ⟨m, rfl⟩ := hb n + exact ⟨tmul f m, rfl⟩ + | add x y hx hy => + obtain ⟨x, rfl⟩ := hx + obtain ⟨y, rfl⟩ := hy + exact ⟨x + y, map_add _ x y⟩ + +end ArExplicit.BalancedTensor + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFunctorExt.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFunctorExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..0710fdf80484a9396d9ddc955076726c2f1074e7 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorFunctorExt.lean @@ -0,0 +1,30 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorNativeEvaluation + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.BalancedTensor +universe u +variable {k R S F : Type u} [Field k] [Ring R] [Ring S] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module S F] +variable [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] +variable (M : ModuleCat.{u} R) (N : ModuleCat.{u} S) + +theorem functorIso_ext + (d e : (functor (k := k) (R := R) (S := S) (F := F)).obj M ≅ N) + (h : ∀ (f : F) (m : M), + d.hom.hom (letI := moduleCatBaseModule (k := k) (R := R) M; tmul f m) = + e.hom.hom (letI := moduleCatBaseModule (k := k) (R := R) M; tmul f m)) : d = e := by + apply Iso.ext + apply ModuleCat.hom_ext + let := moduleCatBaseModule (k := k) (R := R) M + let := moduleCatBaseTower (k := k) (R := R) M + apply leftHom_ext + exact h + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorLeftExact.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorLeftExact.lean new file mode 100644 index 0000000000000000000000000000000000000000..071390ef160e02fe07b0e6d403905f7a27199075 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorLeftExact.lean @@ -0,0 +1,156 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorExact + +namespace OAI + +noncomputable section +namespace ArExplicit.BalancedTensor + +variable {k R : Type*} [CommRing k] [Ring R] [Algebra k R] +variable {F G H M : Type*} +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [IsScalarTower k Rᵐᵒᵖ F] +variable [AddCommGroup G] [Module k G] [Module Rᵐᵒᵖ G] [IsScalarTower k Rᵐᵒᵖ G] +variable [AddCommGroup H] [Module k H] [Module Rᵐᵒᵖ H] [IsScalarTower k Rᵐᵒᵖ H] +variable [AddCommGroup M] [Module k M] [Module R M] [IsScalarTower k R M] + +def mapLeft (a : F →ₗ[Rᵐᵒᵖ] G) : BalancedTensor k R F M →ₗ[k] BalancedTensor k R G M := + map (a.restrictScalars k) LinearMap.id (fun r f => a.map_smul r f) (fun _ _ => rfl) + +omit [IsScalarTower k R M] in +@[simp] theorem mapLeft_tmul (a : F →ₗ[Rᵐᵒᵖ] G) (f : F) (m : M) : + mapLeft (k := k) a (tmul f m) = tmul (a f) m := rfl + +omit [IsScalarTower k R M] in +@[simp] theorem mapLeft_comp (a : F →ₗ[Rᵐᵒᵖ] G) (b : G →ₗ[Rᵐᵒᵖ] H) : + mapLeft (k := k) (M := M) (b.comp a) = (mapLeft b).comp (mapLeft a) := by + apply hom_ext + intro f m + rfl + +omit [IsScalarTower k R M] in +@[simp] theorem mapLeft_zero : mapLeft (k := k) (M := M) (0 : F →ₗ[Rᵐᵒᵖ] G) = 0 := by + apply hom_ext + intro f m + exact zero_tmul m + +variable {n : ℕ} + +def leftCoefficients (s : M →ₗ[R] (Fin n → R)) : + BalancedTensor k R F M →ₗ[k] (Fin n → F) := + lift + { toFun f := + { toFun m i := MulOpposite.op (s m i) • f + map_add' m m' := by + ext i + simp only [map_add, Pi.add_apply, MulOpposite.op_add, add_smul] + map_smul' c m := by + ext i + simp only [LinearMap.map_smul_of_tower, Pi.smul_apply, MulOpposite.op_smul, + smul_assoc, RingHom.id_apply] } + map_add' f f' := by ext m i; exact smul_add _ _ _ + map_smul' c f := by + ext m i + exact (smul_comm c (MulOpposite.op (s m i)) f).symm } + (by + intro f r m + ext i + change MulOpposite.op (s m i) • (MulOpposite.op r • f) = MulOpposite.op (s (r • m) i) • f + simp only [map_smul, Pi.smul_apply, smul_eq_mul, MulOpposite.op_mul, mul_smul]) + +@[simp] theorem leftCoefficients_tmul (s : M →ₗ[R] (Fin n → R)) (f : F) (m : M) (i : Fin n) : + leftCoefficients (k := k) s (tmul f m) i = MulOpposite.op (s m i) • f := rfl + +def leftRecombine (p : (Fin n → R) →ₗ[R] M) : + (Fin n → F) →ₗ[k] BalancedTensor k R F M := + ∑ i, (((mk (k := k) (R := R)).flip (p (Pi.single i 1))).comp (LinearMap.proj i)) + +omit [Algebra k R] [IsScalarTower k Rᵐᵒᵖ F] [IsScalarTower k R M] in +@[simp] theorem leftRecombine_apply (p : (Fin n → R) →ₗ[R] M) (f : Fin n → F) : + leftRecombine (k := k) p f = ∑ i, tmul (f i) (p (Pi.single i 1)) := by + simp [leftRecombine, mk] + +theorem leftRecombine_leftCoefficients (s : M →ₗ[R] (Fin n → R)) + (p : (Fin n → R) →ₗ[R] M) (h : p.comp s = LinearMap.id) (z : BalancedTensor k R F M) : + leftRecombine p (leftCoefficients s z) = z := by + induction z using induction_on with + | zero => simp + | add x y hx hy => simp only [map_add, hx, hy] + | tmul f m => + rw [leftRecombine_apply] + calc + (∑ i, tmul (leftCoefficients s (tmul f m) i) (p (Pi.single i 1))) = + ∑ i, tmul f (p (Pi.single i (s m i))) := by + apply Finset.sum_congr rfl + intro i hi + rw [leftCoefficients_tmul, balance, ← p.map_smul] + congr 2 + ext j + by_cases hij : j = i + · subst j; simp + · simp [hij] + _ = tmul f (p (∑ i, Pi.single i (s m i))) := by + simp only [map_sum] + exact (map_sum (mk (k := k) (R := R) f) _ _).symm + _ = tmul f m := by + rw [Finset.univ_sum_single] + exact congrArg (fun m => tmul (k := k) (R := R) f m) (DFunLike.congr_fun h m) + +theorem leftCoefficients_natural (s : M →ₗ[R] (Fin n → R)) (a : F →ₗ[Rᵐᵒᵖ] G) + (z : BalancedTensor k R F M) : + leftCoefficients s (mapLeft a z) = fun i => a (leftCoefficients s z i) := by + induction z using induction_on with + | zero => ext i; simp + | tmul f m => ext i; simp + | add x y hx hy => ext i; simp only [map_add, Pi.add_apply, hx, hy] + +omit [IsScalarTower k R M] in +theorem leftRecombine_natural (p : (Fin n → R) →ₗ[R] M) (a : F →ₗ[Rᵐᵒᵖ] G) (z : Fin n → F) : + mapLeft a (leftRecombine p z) = leftRecombine (k := k) p (fun i => a (z i)) := by + simp only [leftRecombine_apply, map_sum, mapLeft_tmul] + +theorem mapLeft_exact [Module.Finite R M] [Module.Projective R M] + (a : F →ₗ[Rᵐᵒᵖ] G) (b : G →ₗ[Rᵐᵒᵖ] H) (hex : Function.Exact a b) : + Function.Exact (mapLeft (k := k) (M := M) a) (mapLeft b) := by + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' R M + obtain ⟨s, hs⟩ := Module.projective_lifting_property p (LinearMap.id : M →ₗ[R] M) hp + intro z + constructor + · intro hz + have hcoords : ∀ i, b (leftCoefficients s z i) = 0 := by + have hnat := leftCoefficients_natural s b z + rw [hz, map_zero] at hnat + intro i + exact (congrFun hnat i).symm + choose w hw using fun i => (hex (leftCoefficients s z i)).mp (hcoords i) + refine ⟨leftRecombine p w, ?_⟩ + rw [leftRecombine_natural] + convert leftRecombine_leftCoefficients s p hs z using 1 + exact congrArg (leftRecombine (k := k) p) (funext hw) + · rintro ⟨w, rfl⟩ + have hba : b.comp a = 0 := by ext f; exact (hex (a f)).mpr ⟨f, rfl⟩ + change ((mapLeft b).comp (mapLeft a)) w = 0 + rw [← mapLeft_comp, hba, mapLeft_zero, LinearMap.zero_apply] + +omit [IsScalarTower k R M] in +theorem mapLeft_surjective (a : F →ₗ[Rᵐᵒᵖ] G) (ha : Function.Surjective a) : + Function.Surjective (mapLeft (k := k) (M := M) a) := + map_surjective (a.restrictScalars k) LinearMap.id + (fun r f => a.map_smul r f) (fun _ _ => rfl) ha Function.surjective_id + +theorem mapLeft_injective [Module.Finite R M] [Module.Projective R M] + (a : F →ₗ[Rᵐᵒᵖ] G) (ha : Function.Injective a) : + Function.Injective (mapLeft (k := k) (M := M) a) := by + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' R M + obtain ⟨s, hs⟩ := Module.projective_lifting_property p (LinearMap.id : M →ₗ[R] M) hp + intro x y hxy + have hc : leftCoefficients s x = leftCoefficients s y := by + ext i + apply ha + have hh := congrArg (fun z => leftCoefficients s z i) hxy + simpa only [leftCoefficients_natural] using hh + rw [← leftRecombine_leftCoefficients s p hs x, ← leftRecombine_leftCoefficients s p hs y, hc] + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorLinear.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorLinear.lean new file mode 100644 index 0000000000000000000000000000000000000000..a0f1991c844b282362aa26a0f64944a0ef25fa8c --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorLinear.lean @@ -0,0 +1,34 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCategory +import Mathlib.CategoryTheory.Linear.LinearFunctor + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped ModuleCat.Algebra +namespace ArExplicit.BalancedTensor +universe u +variable {k R S F : Type u} [Field k] [Ring R] [Ring S] [Algebra k R] [Algebra k S] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module S F] + [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] + [IsScalarTower k Rᵐᵒᵖ F] [IsScalarTower k S F] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +instance functor_linear : + (functor (k := k) (R := R) (S := S) (F := F)).Linear k where + map_smul := by + intro M N g a + apply ModuleCat.hom_ext + apply leftHom_ext + intro f m + change tmul (k := k) (R := R) f ((algebraMap k R a) • g.hom m) = + (algebraMap k S a) • tmul (k := k) (R := R) f (g.hom m) + rw [IsScalarTower.algebraMap_smul R a (g.hom m), + IsScalarTower.algebraMap_smul S a (tmul (k := k) (R := R) f (g.hom m))] + exact map_smul (mk (k := k) (R := R) f) a (g.hom m) + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorMap.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..3062e6326fd857c7e1c6f457507c67d37af1dd44 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorMap.lean @@ -0,0 +1,92 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorAction + +namespace OAI + +namespace ArExplicit.BalancedTensor + +open TensorProduct + +variable {k R F M N : Type*} [CommRing k] [Ring R] +variable [AddCommGroup F] [AddCommGroup M] [Module k F] [Module k M] +variable [Module Rᵐᵒᵖ F] [Module R M] + +@[elab_as_elim] theorem induction_on {motive : BalancedTensor k R F M → Prop} + (z : BalancedTensor k R F M) (zero : motive 0) + (tmul : ∀ f m, motive (tmul f m)) + (add : ∀ x y, motive x → motive y → motive (x + y)) : motive z := by + classical + by_cases hz : z = 0 + · simpa only [hz] using zero + clear hz + induction z using Submodule.Quotient.induction_on with + | H z => + induction z using TensorProduct.inductionOn with + | tmul f m => exact tmul f m + | add x y hx hy => exact add _ _ hx hy + +variable {F' M' : Type*} [AddCommGroup F'] [AddCommGroup M'] +variable [Module k F'] [Module k M'] [Module Rᵐᵒᵖ F'] [Module R M'] + +def map (a : F →ₗ[k] F') (b : M →ₗ[k] M') + (ha : ∀ (r : Rᵐᵒᵖ) f, a (r • f) = r • a f) + (hb : ∀ (r : R) m, b (r • m) = r • b m) : + BalancedTensor k R F M →ₗ[k] BalancedTensor k R F' M' := + lift + { toFun := fun f => (mk (a f)).comp b + map_add' := by intros; ext m; simp + map_smul' := by intros; ext m; simp } + (by + intro f r m + change tmul (a (MulOpposite.op r • f)) (b m) = tmul (a f) (b (r • m)) + rw [ha, hb, balance]) + +@[simp] theorem map_tmul (a : F →ₗ[k] F') (b : M →ₗ[k] M') + (ha : ∀ (r : Rᵐᵒᵖ) f, a (r • f) = r • a f) + (hb : ∀ (r : R) m, b (r • m) = r • b m) (f : F) (m : M) : + map a b ha hb (tmul f m) = tmul (a f) (b m) := rfl + +theorem map_surjective (a : F →ₗ[k] F') (b : M →ₗ[k] M') + (ha : ∀ (r : Rᵐᵒᵖ) f, a (r • f) = r • a f) + (hb : ∀ (r : R) m, b (r • m) = r • b m) + (asurj : Function.Surjective a) (bsurj : Function.Surjective b) : + Function.Surjective (map a b ha hb) := by + intro z + induction z using induction_on with + | zero => exact ⟨0, map_zero _⟩ + | tmul f m => + obtain ⟨f, rfl⟩ := asurj f + obtain ⟨m, rfl⟩ := bsurj m + exact ⟨tmul f m, rfl⟩ + | add x y hx hy => + obtain ⟨x, rfl⟩ := hx + obtain ⟨y, rfl⟩ := hy + exact ⟨x + y, map_add _ x y⟩ + +section LeftLinear + +variable {S : Type*} [Ring S] [AddCommGroup N] [Module k N] +variable [Module S F] [Module S N] +variable [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] + +def liftLeft (b : F →ₗ[k] M →ₗ[k] N) + (hb : ∀ (f : F) (r : R) (m : M), b (MulOpposite.op r • f) m = b f (r • m)) + (hs : ∀ (s : S) f m, b (s • f) m = s • b f m) : + BalancedTensor k R F M →ₗ[S] N where + __ := (lift b hb).toAddHom + map_smul' s z := by + change lift b hb (s • z) = s • lift b hb z + induction z using induction_on with + | zero => simp + | tmul f m => simpa only [smul_tmul, lift_tmul, RingHom.id_apply] using hs s f m + | add x y hx hy => simp only [smul_add, map_add] at *; rw [hx, hy] + +@[simp] theorem liftLeft_tmul (b : F →ₗ[k] M →ₗ[k] N) + (hb : ∀ (f : F) (r : R) (m : M), b (MulOpposite.op r • f) m = b f (r • m)) + (hs : ∀ (s : S) f m, b (s • f) m = s • b f m) (f : F) (m : M) : + liftLeft b hb hs (tmul f m) = b f m := rfl + +end LeftLinear + +end ArExplicit.BalancedTensor + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorMapEquiv.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorMapEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..51b25fa90af6cb31598aeeb7c11a332dbb6fe046 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorMapEquiv.lean @@ -0,0 +1,36 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCategory + +namespace OAI + +noncomputable section +namespace ArExplicit.BalancedTensor +variable {k R S F L M : Type*} [Field k] [Ring R] [Ring S] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module S F] +variable [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] +variable [AddCommGroup L] [Module k L] [Module R L] [IsScalarTower k R L] +variable [AddCommGroup M] [Module k M] [Module R M] [IsScalarTower k R M] + +def mapRightEquiv (e : L ≃ₗ[R] M) : BalancedTensor k R F L ≃ₗ[S] BalancedTensor k R F M where + __ := mapRight (k := k) (F := F) (S := S) e.toLinearMap + invFun := mapRight (k := k) (F := F) (S := S) e.symm.toLinearMap + left_inv x := by + change mapRight (k := k) (F := F) (S := S) e.symm.toLinearMap + (mapRight (k := k) (F := F) (S := S) e.toLinearMap x) = x + have h := congrArg (fun t : BalancedTensor k R F L →ₗ[S] BalancedTensor k R F L => t x) + (mapRight_comp (k := k) (F := F) (S := S) e.toLinearMap e.symm.toLinearMap) + simpa only [e.symm_comp, mapRight_id, LinearMap.comp_apply, LinearMap.id_apply] using h.symm + right_inv x := by + change mapRight (k := k) (F := F) (S := S) e.toLinearMap + (mapRight (k := k) (F := F) (S := S) e.symm.toLinearMap x) = x + have h := congrArg (fun t : BalancedTensor k R F M →ₗ[S] BalancedTensor k R F M => t x) + (mapRight_comp (k := k) (F := F) (S := S) e.symm.toLinearMap e.toLinearMap) + simpa only [e.comp_symm, mapRight_id, LinearMap.comp_apply, LinearMap.id_apply] using h.symm + +@[simp] theorem mapRightEquiv_tmul (e : L ≃ₗ[R] M) (f : F) (x : L) : + mapRightEquiv (k := k) (F := F) (S := S) e (tmul f x) = tmul f (e x) := rfl + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorNative.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorNative.lean new file mode 100644 index 0000000000000000000000000000000000000000..c7e87a6f51a69b5f6e7569ea8e4d9fa3b410317d --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorNative.lean @@ -0,0 +1,49 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorMapEquiv +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorScalar + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.BalancedTensor +universe u +variable {k R S F : Type u} [Field k] [Ring R] [Ring S] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module S F] +variable [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] +variable (M : Type u) [AddCommGroup M] [Module R M] [mM : Module k M] [IsScalarTower k R M] + +theorem nativeObject_eq : + (functor (k := k) (R := R) (S := S) (F := F)).obj (ModuleCat.of R M) = + ModuleCat.of S (BalancedTensor k R F M) := by + cases ExternalTensor.canonicalScalar_eq k R M (mM := mM) + rfl + +def nativeObjectIso : + (functor (k := k) (R := R) (S := S) (F := F)).obj (ModuleCat.of R M) ≅ + ModuleCat.of S (BalancedTensor k R F M) := + eqToIso (nativeObject_eq (k := k) (R := R) (S := S) (F := F) M) + +theorem nativeObjectIso_tmul (f : F) (m : M) : + (nativeObjectIso (k := k) (R := R) (S := S) (F := F) M).hom.hom + (letI := moduleCatBaseModule (k := k) (R := R) (ModuleCat.of R M) + tmul f m) = tmul f m := by + cases ExternalTensor.canonicalScalar_eq k R M (mM := mM) + rfl + +variable {M} +variable {L : Type u} [AddCommGroup L] [Module R L] [mL : Module k L] [IsScalarTower k R L] + +theorem nativeObjectIso_natural (f : M →ₗ[R] L) : + (functor (k := k) (R := R) (S := S) (F := F)).map (ModuleCat.ofHom f) ≫ + (nativeObjectIso (k := k) (R := R) (S := S) (F := F) L).hom = + (nativeObjectIso (k := k) (R := R) (S := S) (F := F) M).hom ≫ + ModuleCat.ofHom (mapRight (k := k) (F := F) (S := S) f) := by + cases ExternalTensor.canonicalScalar_eq k R M (mM := mM) + cases ExternalTensor.canonicalScalar_eq k R L (mM := mL) + rfl + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorNativeEvaluation.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorNativeEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..d7ea6b23e8dfe6a078c1a916b1f7b57831aac913 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorNativeEvaluation.lean @@ -0,0 +1,29 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorNative + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.BalancedTensor +universe u +variable {k R S F : Type u} [Field k] [Ring R] [Ring S] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module S F] +variable [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] +variable (M : Type u) [AddCommGroup M] [Module R M] [mM : Module k M] [IsScalarTower k R M] +variable {N : ModuleCat.{u} S} (e : BalancedTensor k R F M ≃ₗ[S] N) + +def tensorEvaluationIso : + (functor (k := k) (R := R) (S := S) (F := F)).obj (ModuleCat.of R M) ≅ N := + nativeObjectIso (k := k) (R := R) (S := S) (F := F) M ≪≫ e.toModuleIso + +theorem tensorEvaluationIso_tmul (f : F) (m : M) : + (tensorEvaluationIso M e).hom.hom + (letI := moduleCatBaseModule (k := k) (R := R) (ModuleCat.of R M) + tmul f m) = e (tmul f m) := + congrArg e (nativeObjectIso_tmul M f m) + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorPi.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorPi.lean new file mode 100644 index 0000000000000000000000000000000000000000..a9ab47cc997eafb30e96a6f41e4419b6148c5deb --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorPi.lean @@ -0,0 +1,70 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorFunctor +import Mathlib.LinearAlgebra.Pi + +namespace OAI + +noncomputable section + +namespace ArExplicit.BalancedTensor + +variable {k R S F M : Type*} [CommRing k] [Ring R] [Algebra k R] [Ring S] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] +variable [Module S F] [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] +variable [AddCommGroup M] [Module k M] [Module R M] [IsScalarTower k R M] +variable {ι : Type*} [Fintype ι] [DecidableEq ι] + +omit [Algebra k R] [IsScalarTower k R M] [Fintype ι] [DecidableEq ι] in +theorem tmul_sum (f : F) (s : Finset ι) (m : ι → M) : + tmul (k := k) (R := R) f (∑ i ∈ s, m i) = ∑ i ∈ s, tmul f (m i) := by + exact map_sum (mk (k := k) (R := R) f) m s + +def piRightMap : BalancedTensor k R F (ι → M) →ₗ[S] (ι → BalancedTensor k R F M) := + LinearMap.pi fun i => mapRight (k := k) (S := S) (LinearMap.proj i) + +omit [Fintype ι] [DecidableEq ι] in +@[simp] theorem piRightMap_tmul (f : F) (m : ι → M) (i : ι) : + piRightMap (S := S) (tmul f m : BalancedTensor k R F (ι → M)) i = tmul f (m i) := rfl + +def piRightInv : (ι → BalancedTensor k R F M) →ₗ[S] BalancedTensor k R F (ι → M) where + toFun z := ∑ i, mapRight (k := k) (S := S) (LinearMap.single R (fun _ : ι => M) i) (z i) + map_add' x y := by simp only [Pi.add_apply, map_add, Finset.sum_add_distrib] + map_smul' s z := by simp only [Pi.smul_apply, map_smul, RingHom.id_apply, Finset.smul_sum] + +omit [Fintype ι] in +theorem piRightMap_single (i j : ι) (z : BalancedTensor k R F M) : + piRightMap (S := S) (mapRight (k := k) (S := S) (LinearMap.single R (fun _ : ι => M) j) z) i = if i = j then z else 0 := by + induction z using induction_on with + | zero => simp + | tmul f m => + simp only [mapRight_tmul, piRightMap_tmul, LinearMap.single_apply] + by_cases h : i = j + · subst i; simp + · simp [h] + | add x y hx hy => + simp only [map_add, Pi.add_apply, hx, hy] + split_ifs <;> simp + +def piRight : BalancedTensor k R F (ι → M) ≃ₗ[S] (ι → BalancedTensor k R F M) where + __ := piRightMap + invFun := piRightInv + right_inv z := by + ext i + change piRightMap (S := S) (∑ j, mapRight (k := k) (S := S) (LinearMap.single R (fun _ : ι => M) j) (z j)) i = z i + simp only [map_sum, Finset.sum_apply, piRightMap_single] + simp + left_inv z := by + change piRightInv (S := S) (piRightMap (S := S) z) = z + induction z using induction_on with + | zero => simp + | tmul f m => + change (∑ i, tmul (k := k) (R := R) f (Pi.single i (m i))) = tmul f m + rw [← tmul_sum] + congr + exact Finset.univ_sum_single m + | add x y hx hy => simp only [map_add, hx, hy] + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorPositiveAction.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorPositiveAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc817e347594f672bac3711a3caed5bfd7fc0128 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorPositiveAction.lean @@ -0,0 +1,41 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCompleteAction + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian CategoryTheory.Limits CochainComplex.HomComplex +open scoped ModuleCat.Algebra +namespace ArExplicit.BalancedTensor +universe u +variable {k R F : Type u} [Field k] [CharP k 2] [Ring R] [Algebra k R] [Module.Finite k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module R F] +variable [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] +variable [Module.Finite R F] [Module.Projective R F] +variable [HasDerivedCategory (ModuleCat.{u} R)] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable [PreservesFiniteLimits (functor (k := k) (R := R) (S := R) (F := F))] +variable [PreservesFiniteColimits (functor (k := k) (R := R) (S := R) (F := F))] +variable [(functor (k := k) (R := R) (S := R) (F := F)).PreservesProjectiveObjects] +variable (τ : FrobeniusTrace k R) (M : FiniteLeftModule k R) +variable (e : BalancedTensor k R F M.carrier ≃ₗ[R] M.carrier) + +omit [SMulCommClass k Rᵐᵒᵖ F] in +theorem completeAction_scalar_positive (d : ℕ) (hd : 0 < d) (c : k) + (hs : ∀ z : Ext M.carrier M.carrier d, + selfExtIso (k := k) (nativeEvaluationIso M e) d + (z.mapExactFunctor (functor (k := k) (R := R) (S := R) (F := F))) = c • z) + (x : CohomologyClass (M.completeCochain τ) (M.completeCochain τ) (d : ℤ)) : + fullHomPostcomp (completeActionOut τ M e) _ + (fullHomPrecomp (completeActionIn τ M e) _ + (mapFullHom (functor (k := k) (R := R) (S := R) (F := F)) _ _ _ x)) = c • x := by + cases d with + | zero => exact False.elim (Nat.lt_irrefl 0 hd) + | succ n => exact completeAction_scalar τ M e n c hs x + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorProjective.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorProjective.lean new file mode 100644 index 0000000000000000000000000000000000000000..954da729ee9a97b621e76cde81e779f448a64934 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorProjective.lean @@ -0,0 +1,46 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorPi +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorUnit +import Mathlib.Algebra.Module.Projective +import Mathlib.RingTheory.Finiteness.Cardinality + +namespace OAI + +noncomputable section +namespace ArExplicit.BalancedTensor + +private instance finitePiProjective {S P ι : Type*} [Ring S] [AddCommGroup P] + [Module S P] [Module.Projective S P] [Fintype ι] : Module.Projective S (ι → P) := + Module.Projective.of_equiv (DFinsupp.linearEquivFunOnFintype : + (Π₀ _ : ι, P) ≃ₗ[S] (ι → P)) + +variable {k R S F M : Type*} [CommRing k] [Ring R] [Ring S] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module S F] +variable [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] +variable [IsScalarTower k Rᵐᵒᵖ F] +variable [AddCommGroup M] [Module k M] [Module R M] [IsScalarTower k R M] + +theorem projective [Module.Projective S F] [Module.Finite R M] [Module.Projective R M] : + Module.Projective S (BalancedTensor k R F M) := by + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' R M + obtain ⟨s, hs⟩ := Module.projective_lifting_property p (LinearMap.id : M →ₗ[R] M) hp + let : Module.Projective S (BalancedTensor k R F R) := + Module.Projective.of_equiv (runitLeft (k := k) (R := R) (S := S) (F := F)).symm + let : Module.Projective S (BalancedTensor k R F (Fin n → R)) := + Module.Projective.of_equiv (piRight (k := k) (R := R) (S := S) (F := F) (M := R)).symm + apply Module.Projective.of_split (mapRight (k := k) (S := S) s) (mapRight (k := k) (S := S) p) + rw [← mapRight_comp, hs, mapRight_id] + +theorem finite [Module.Finite S F] [Module.Finite R M] : + Module.Finite S (BalancedTensor k R F M) := by + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' R M + let : Module.Finite S (BalancedTensor k R F R) := + Module.Finite.equiv (runitLeft (k := k) (R := R) (S := S) (F := F)).symm + let : Module.Finite S (BalancedTensor k R F (Fin n → R)) := + Module.Finite.equiv (piRight (k := k) (R := R) (S := S) (F := F) (M := R)).symm + exact Module.Finite.of_surjective (mapRight (k := k) (S := S) p) (mapRight_surjective p hp) + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorResolution.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..57b555a1d3c5dac17b83e332f301fa3fb8e1587a --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorResolution.lean @@ -0,0 +1,105 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorComplete +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorMapEquiv +import OAI.Algebra.AuslanderReiten.Cones.CochainCokernelIso +import OAI.Algebra.AuslanderReiten.Duality.FiniteStableResolutionIso + +namespace OAI + +noncomputable section +namespace ArExplicit.BalancedTensor +open CategoryTheory CompleteComparison +universe u +variable {k R F : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] [Module R F] +variable [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] +variable [Module.Finite R F] [Module.Projective R F] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (τ : FrobeniusTrace k R) (M N : FiniteLeftModule k R) + +abbrev completeTensor := + (((functor (k := k) (R := R) (S := R) (F := F)).mapHomologicalComplex _).obj + (M.completeCochain τ)) + +def tensorCokernelEquiv : CochainCokernel (completeTensor (F := F) τ M) ≃ₗ[R] + BalancedTensor k R F M.carrier := + (cochainCokernelEquiv (k := k) (F := F) (S := R) (M.completeCochain τ)).trans + (mapRightEquiv (k := k) (F := F) (S := R) (M.completeCochainCokernelEquiv τ)) + +omit [SMulCommClass k Rᵐᵒᵖ F] [Module.Finite R F] [Module.Projective R F] in +@[simp] theorem tensorCokernelEquiv_mk (f : F) (x : (M.completeCochain τ).X 0) : + tensorCokernelEquiv (F := F) τ M (Submodule.Quotient.mk (tmul f x)) = + tmul f (M.completeCochainCokernelEquiv τ (Submodule.Quotient.mk x)) := by + rw [tensorCokernelEquiv, LinearEquiv.trans_apply, + cochainCokernelEquiv_mk_tmul, mapRightEquiv_tmul] + +omit [SMulCommClass k Rᵐᵒᵖ F] in +theorem completeTensor_totallyAcyclic : TotallyAcyclicCochain (completeTensor (F := F) τ M) := by + let := τ.regular_injective + exact complex_totallyAcyclic (M.completeCochain τ) + (M.completeCochain_totallyAcyclic τ).toExactProjectiveCochain + +def completeTensorIso (e : BalancedTensor k R F M.carrier ≃ₗ[R] N.carrier) : + (HomotopyCategory.quotient _ _).obj (completeTensor (F := F) τ M) ≅ + (HomotopyCategory.quotient _ _).obj (N.completeCochain τ) := + rawCokernelHomotopyIso (completeTensor_totallyAcyclic (F := F) τ M) + (N.completeCochain_totallyAcyclic τ) + (((tensorCokernelEquiv (F := F) τ M).trans e).trans (N.completeCochainCokernelEquiv τ).symm) + +variable {G : Type u} [AddCommGroup G] [Module k G] [Module Rᵐᵒᵖ G] [Module R G] +variable [IsScalarTower k Rᵐᵒᵖ G] [SMulCommClass k Rᵐᵒᵖ G] +variable [SMulCommClass k R G] [SMulCommClass R Rᵐᵒᵖ G] +variable [Module.Finite Rᵐᵒᵖ G] [Module.Projective Rᵐᵒᵖ G] +variable [Module.Finite R G] [Module.Projective R G] + +omit [SMulCommClass k Rᵐᵒᵖ F] [Module.Finite R F] [Module.Projective R F] in +omit [SMulCommClass k Rᵐᵒᵖ G] [Module.Finite R G] [Module.Projective R G] in +theorem tensorCokernelEquiv_natural (a : F →ₗ[Rᵐᵒᵖ] G) + (ha : ∀ (r : R) f, a (r • f) = r • a f) + (z : CochainCokernel (completeTensor (F := F) τ M)) : + tensorCokernelEquiv (F := G) τ M + (cochainCokernelMap (complexMap (k := k) a ha (M.completeCochain τ)) z) = + mapLeft (k := k) (M := M.carrier) a (tensorCokernelEquiv (F := F) τ M z) := by + obtain ⟨x,rfl⟩ := Submodule.mkQ_surjective + (LinearMap.range ((completeTensor (F := F) τ M).d (-1) 0).hom) z + induction x using induction_on with + | zero => repeat' erw [map_zero] + | add x y hx hy => + repeat' erw [map_add] + exact congrArg₂ (· + ·) hx hy + | tmul f m => + erw [cochainCokernelMap_mk] + change tensorCokernelEquiv (F := G) τ M (Submodule.Quotient.mk (tmul (a f) m)) = _ + erw [tensorCokernelEquiv_mk] + +variable (N' : FiniteLeftModule k R) + +omit [SMulCommClass k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ G] in +theorem completeTensorIso_natural + (a : F →ₗ[Rᵐᵒᵖ] G) (ha : ∀ (r : R) f, a (r • f) = r • a f) + (e : BalancedTensor k R F M.carrier ≃ₗ[R] N.carrier) + (e' : BalancedTensor k R G M.carrier ≃ₗ[R] N'.carrier) + (b : N.carrier →ₗ[R] N'.carrier) + (hab : ∀ x, e' (mapLeft (k := k) (M := M.carrier) a x) = b (e x)) : + (HomotopyCategory.quotient _ _).map (complexMap (k := k) a ha (M.completeCochain τ)) ≫ + (completeTensorIso τ M N' e').hom = + (completeTensorIso τ M N e).hom ≫ + (HomotopyCategory.quotient _ _).map (FiniteLeftModule.resolutionMap τ b) := by + apply rawCokernelHomotopyIso_natural + rw [FiniteLeftModule.resolutionMap_cokernel] + apply LinearMap.ext + intro z + change (N'.completeCochainCokernelEquiv τ).symm + (e' (tensorCokernelEquiv (F := G) τ M + (cochainCokernelMap (complexMap (k := k) a ha (M.completeCochain τ)) z))) = + (N'.completeCochainCokernelEquiv τ).symm + (b ((N.completeCochainCokernelEquiv τ) + ((N.completeCochainCokernelEquiv τ).symm (e (tensorCokernelEquiv (F := F) τ M z))))) + rw [tensorCokernelEquiv_natural, LinearEquiv.apply_symm_apply, hab] + +end ArExplicit.BalancedTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorUnit.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorUnit.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a6a28ae09f632aa2d1bb20b22c63255fa6481a0 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/BalancedTensorUnit.lean @@ -0,0 +1,107 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorMap + +namespace OAI + +namespace ArExplicit.BalancedTensor + +variable {k R : Type*} [CommRing k] [Ring R] [Algebra k R] + +section Left + +variable {M : Type*} [AddCommGroup M] [Module k M] [Module R M] +variable [IsScalarTower k R M] + +def leftAction : R →ₗ[k] M →ₗ[k] M where + toFun r := + { toFun := fun m => r • m + map_add' := smul_add r + map_smul' := fun c m => smul_comm r c m } + map_add' r s := by ext m; exact add_smul r s m + map_smul' c r := by ext m; exact smul_assoc c r m + +def lunitMap : BalancedTensor k R R M →ₗ[R] M := + liftLeft leftAction (by intro x r m; exact mul_smul x r m) + (by intro s r m; exact mul_smul s r m) + +@[simp] theorem lunitMap_tmul (r : R) (m : M) : + lunitMap (tmul r m : BalancedTensor k R R M) = r • m := rfl + +def lunitInv : M →ₗ[R] BalancedTensor k R R M where + toFun m := tmul 1 m + map_add' := tmul_add 1 + map_smul' r m := by + change tmul (k := k) (R := R) 1 (r • m) = tmul (r * 1) m + rw [mul_one] + simpa using (balance (k := k) (R := R) (1 : R) r m).symm + +def lunit : BalancedTensor k R R M ≃ₗ[R] M where + __ := lunitMap (k := k) (R := R) (M := M) + invFun := lunitInv + right_inv m := by simp [lunitInv] + left_inv z := by + change lunitInv (lunitMap z) = z + induction z using induction_on with + | zero => simp + | tmul r m => + change tmul (k := k) (R := R) 1 (r • m) = tmul r m + simpa using (balance (k := k) (R := R) (1 : R) r m).symm + | add x y hx hy => simp only [map_add, hx, hy] + +@[simp] theorem lunit_tmul (r : R) (m : M) : + lunit (tmul r m : BalancedTensor k R R M) = r • m := rfl + +end Left + +section Right + +variable {F : Type*} [AddCommGroup F] [Module k F] [Module Rᵐᵒᵖ F] +variable [IsScalarTower k Rᵐᵒᵖ F] + +def rightAction : F →ₗ[k] R →ₗ[k] F where + toFun f := + { toFun := fun r => MulOpposite.op r • f + map_add' r s := by simp [add_smul] + map_smul' c r := by simp [MulOpposite.op_smul, smul_assoc] } + map_add' f g := by ext r; exact smul_add _ _ _ + map_smul' c f := by ext r; exact smul_comm _ _ _ + +def runitMap : BalancedTensor k R F R →ₗ[k] F := + lift rightAction (by + intro f r s + change MulOpposite.op s • MulOpposite.op r • f = MulOpposite.op (r * s) • f + rw [MulOpposite.op_mul, mul_smul]) + +@[simp] theorem runitMap_tmul (f : F) (r : R) : + runitMap (tmul f r : BalancedTensor k R F R) = MulOpposite.op r • f := rfl + +def runit : BalancedTensor k R F R ≃ₗ[k] F where + __ := runitMap (k := k) (R := R) (F := F) + invFun f := tmul f 1 + right_inv f := by simp [runitMap_tmul] + left_inv z := by + change tmul (runitMap z) 1 = z + induction z using induction_on with + | zero => simp + | tmul f r => simpa using (balance (k := k) (R := R) f r (1 : R)) + | add x y hx hy => simpa only [map_add, add_tmul] using congrArg₂ (· + ·) hx hy + +@[simp] theorem runit_tmul (f : F) (r : R) : + runit (tmul f r : BalancedTensor k R F R) = MulOpposite.op r • f := rfl + +variable {S : Type*} [Ring S] [Module S F] +variable [SMulCommClass k S F] [SMulCommClass S Rᵐᵒᵖ F] + +def runitLeft : BalancedTensor k R F R ≃ₗ[S] F where + __ := (runit (k := k) (R := R) (F := F)).toAddEquiv + map_smul' s z := by + change runit (s • z) = s • runit z + induction z using induction_on with + | zero => simp + | tmul f r => simpa only [smul_tmul, runit_tmul] using (smul_comm s (MulOpposite.op r) f).symm + | add x y hx hy => simp only [smul_add, map_add] at *; rw [hx, hy] + +end Right + +end ArExplicit.BalancedTensor + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedEquiv.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b9c2c1cf5bbbc7e353e0196198cfdb5c69fd5af --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedEquiv.lean @@ -0,0 +1,50 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBalancedMap +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorEquiv + +namespace OAI + +noncomputable section +namespace ArExplicit.EnvelopingBimodule +open CategoryTheory +open scoped TensorProduct +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable {M N : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)} +variable [Module k M] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) M] +variable [Module k N] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) N] +variable (e : M ≃ₗ[R ⊗[k] Rᵐᵒᵖ] N) + +def scalarCongr : EnvelopingBimodule k R M ≃ₗ[k] EnvelopingBimodule k R N where + toFun x := ⟨e x.value⟩ + invFun y := ⟨e.symm y.value⟩ + left_inv x := by ext; exact e.symm_apply_apply x.value + right_inv y := by ext; exact e.apply_symm_apply y.value + map_add' x y := by ext; exact e.map_add _ _ + map_smul' c x := by ext; exact (e.restrictScalars k).map_smul c x.value + +@[simp] theorem scalarCongr_left (a : R) (x : EnvelopingBimodule k R M) : + scalarCongr e (a • x) = a • scalarCongr e x := by + ext + exact e.map_smul (a ⊗ₜ[k] (1 : Rᵐᵒᵖ)) x.value + +@[simp] theorem scalarCongr_right (a : Rᵐᵒᵖ) (x : EnvelopingBimodule k R M) : + scalarCongr e (a • x) = a • scalarCongr e x := by + ext + exact e.map_smul ((1 : R) ⊗ₜ[k] a) x.value + +variable (X : ModuleCat.{u} R) [Module k X] + +def tensorCongr : BalancedTensor k R (EnvelopingBimodule k R M) X ≃ₗ[R] + BalancedTensor k R (EnvelopingBimodule k R N) X := + BalancedTensor.congrLeft (scalarCongr e) (LinearEquiv.refl k X) + (scalarCongr_right e) (fun _ _ => rfl) (scalarCongr_left e) + +@[simp] theorem tensorCongr_tmul (m : EnvelopingBimodule k R M) (x : X) : + tensorCongr e X (BalancedTensor.tmul m x) = + BalancedTensor.tmul (⟨e m.value⟩ : EnvelopingBimodule k R N) x := rfl + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedExact.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedExact.lean new file mode 100644 index 0000000000000000000000000000000000000000..ade4eb4e7d336a2c66757beda91679536670cd07 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedExact.lean @@ -0,0 +1,83 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBalancedMap +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorFirst + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra + +namespace ArExplicit.EnvelopingBimodule + +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable {M N Q : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)} +variable [Module k M] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) M] +variable [Module k N] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) N] +variable [Module k Q] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) Q] + +def mapRight (f : M ⟶ N) : + EnvelopingBimodule k R M →ₗ[Rᵐᵒᵖ] EnvelopingBimodule k R N where + toFun := map f + map_add' := (map f).map_add + map_smul' := map_right_smul f + +theorem mapRight_injective (f : M ⟶ N) (hf : Function.Injective f.hom) : + Function.Injective (mapRight f) := by + intro x y h + apply EnvelopingBimodule.ext + apply hf + exact congrArg EnvelopingBimodule.value h + +theorem mapRight_surjective (f : M ⟶ N) (hf : Function.Surjective f.hom) : + Function.Surjective (mapRight f) := by + rintro ⟨y⟩ + obtain ⟨x, hx⟩ := hf y + refine ⟨⟨x⟩, ?_⟩ + apply EnvelopingBimodule.ext + exact hx + +theorem mapRight_exact (f : M ⟶ N) (g : N ⟶ Q) + (he : LinearMap.range f.hom = LinearMap.ker g.hom) : + LinearMap.range (mapRight f) = LinearMap.ker (mapRight g) := by + ext y + constructor + · rintro ⟨x, rfl⟩ + change mapRight g (mapRight f x) = 0 + apply EnvelopingBimodule.ext + have h : f.hom x.value ∈ LinearMap.range f.hom := ⟨x.value, rfl⟩ + rw [he] at h + exact h + · intro hy + have hy' : y.value ∈ LinearMap.ker g.hom := congrArg EnvelopingBimodule.value hy + rw [← he] at hy' + obtain ⟨x, hx⟩ := hy' + refine ⟨⟨x⟩, ?_⟩ + apply EnvelopingBimodule.ext + exact hx + +variable (X : ModuleCat.{u} R) [Module k X] + +@[simp] theorem mapFirst_mapRight_apply (f : M ⟶ N) + (z : BalancedTensor k R (EnvelopingBimodule k R M) X) : + BalancedTensor.mapFirst X (mapRight f) z = tensorMap X f z := rfl + +theorem tensorMap_shortExact (f : M ⟶ N) (g : N ⟶ Q) + (hf : Function.Injective f.hom) (hg : Function.Surjective g.hom) + (he : LinearMap.range f.hom = LinearMap.ker g.hom) + [Module.Projective Rᵐᵒᵖ (EnvelopingBimodule k R Q)] : + Function.Injective (tensorMap X f) ∧ Function.Surjective (tensorMap X g) ∧ + LinearMap.range (tensorMap X f) = LinearMap.ker (tensorMap X g) := by + obtain ⟨hi, hs, hx⟩ := BalancedTensor.mapFirst_shortExact (k := k) (X := X) + (mapRight f) (mapRight g) (mapRight_injective f hf) + (mapRight_surjective g hg) (mapRight_exact f g he) + refine ⟨hi, hs, ?_⟩ + ext z + exact Iff.of_eq (congrArg (fun S : Submodule k (BalancedTensor k R (EnvelopingBimodule k R N) X) => + z ∈ S) hx) + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedMap.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..a62645209fa5e1aca1f557bfbf9bc0577e4bfce6 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedMap.lean @@ -0,0 +1,126 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBimodule +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorMap + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra + +namespace ArExplicit.EnvelopingBimodule + +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable {M N P : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)} +variable [Module k M] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) M] +variable [Module k N] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) N] +variable [Module k P] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) P] + +def map (f : M ⟶ N) : EnvelopingBimodule k R M →ₗ[k] EnvelopingBimodule k R N where + toFun x := ⟨f.hom x.value⟩ + map_add' x y := by + ext + exact f.hom.map_add x.value y.value + map_smul' c x := by + ext + exact (f.hom.restrictScalars k).map_smul c x.value + +@[simp] theorem map_value (f : M ⟶ N) (x : EnvelopingBimodule k R M) : + (map f x).value = f.hom x.value := rfl + +@[simp] theorem map_left_smul (f : M ⟶ N) (a : R) + (x : EnvelopingBimodule k R M) : map f (a • x) = a • map f x := by + ext + exact f.hom.map_smul (a ⊗ₜ[k] (1 : Rᵐᵒᵖ)) x.value + +@[simp] theorem map_right_smul (f : M ⟶ N) (b : Rᵐᵒᵖ) + (x : EnvelopingBimodule k R M) : map f (b • x) = b • map f x := by + ext + exact f.hom.map_smul ((1 : R) ⊗ₜ[k] b) x.value + +def mapLeft (f : M ⟶ N) : EnvelopingBimodule k R M →ₗ[R] EnvelopingBimodule k R N where + toFun := map f + map_add' := (map f).map_add + map_smul' := map_left_smul f + +@[simp] theorem map_id : map (𝟙 M) = LinearMap.id := by + ext x + rfl + +@[simp] theorem map_comp (f : M ⟶ N) (g : N ⟶ P) : + map (f ≫ g) = (map g).comp (map f) := by + ext x + rfl + +@[simp] theorem map_zero : map (0 : M ⟶ N) = 0 := by + ext x + rfl + +@[simp] theorem map_add (f g : M ⟶ N) : map (f + g) = map f + map g := by + ext x + rfl + +variable (X : ModuleCat.{u} R) [Module k X] [IsScalarTower k R X] + +def tensorMap (f : M ⟶ N) : + BalancedTensor k R (EnvelopingBimodule k R M) X →ₗ[R] + BalancedTensor k R (EnvelopingBimodule k R N) X where + __ := (BalancedTensor.map (map f) (LinearMap.id : X →ₗ[k] X) + (map_right_smul f) (fun _ _ => rfl)).toAddHom + map_smul' a z := by + change BalancedTensor.map (map f) (LinearMap.id : X →ₗ[k] X) + (map_right_smul f) (fun _ _ => rfl) (a • z) = + a • BalancedTensor.map (map f) (LinearMap.id : X →ₗ[k] X) + (map_right_smul f) (fun _ _ => rfl) z + induction z using BalancedTensor.induction_on with + | zero => simp + | tmul m x => simp only [BalancedTensor.smul_tmul, BalancedTensor.map_tmul, + LinearMap.id_apply, map_left_smul] + | add z w hz hw => simp_all + +omit [IsScalarTower k R X] + +@[simp] theorem tensorMap_tmul (f : M ⟶ N) + (m : EnvelopingBimodule k R M) (x : X) : + tensorMap X f (BalancedTensor.tmul m x) = BalancedTensor.tmul (map f m) x := rfl + +@[simp] theorem tensorMap_id : tensorMap X (𝟙 M) = LinearMap.id := by + apply LinearMap.ext + intro z + induction z using BalancedTensor.induction_on with + | zero => simp + | tmul m x => rfl + | add z w hz hw => simp_all + +@[simp] theorem tensorMap_comp (f : M ⟶ N) (g : N ⟶ P) : + tensorMap X (f ≫ g) = (tensorMap X g).comp (tensorMap X f) := by + apply LinearMap.ext + intro z + induction z using BalancedTensor.induction_on with + | zero => simp + | tmul m x => rfl + | add z w hz hw => simp_all + +@[simp] theorem tensorMap_zero : tensorMap X (0 : M ⟶ N) = 0 := by + apply LinearMap.ext + intro z + induction z using BalancedTensor.induction_on with + | zero => simp + | tmul m x => simp + | add z w hz hw => simp_all + +@[simp] theorem tensorMap_add (f g : M ⟶ N) : + tensorMap X (f + g) = tensorMap X f + tensorMap X g := by + apply LinearMap.ext + intro z + induction z using BalancedTensor.induction_on with + | zero => simp + | tmul m x => simp [BalancedTensor.add_tmul] + | add z w hz hw => + simp only [_root_.LinearMap.map_add, hz, hw] + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedProduct.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..c9fbdf59248679abd44eb8b81d5ec016eaadb8c3 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedProduct.lean @@ -0,0 +1,89 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBalancedMap +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorFunctor + +namespace OAI + +noncomputable section +namespace ArExplicit.EnvelopingBimodule +open CategoryTheory +open scoped TensorProduct +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable (M N : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)) + [Module k M] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) M] + [Module k N] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) N] +variable (X : ModuleCat.{u} R) [Module k X] +local notation "ProdMN" => ModuleCat.of (R ⊗[k] Rᵐᵒᵖ) (M × N) +local notation "EM" => BalancedTensor k R (EnvelopingBimodule k R M) X +local notation "EN" => BalancedTensor k R (EnvelopingBimodule k R N) X +local notation "EP" => BalancedTensor k R (EnvelopingBimodule k R ProdMN) X + +def tensorProdMap : EP →ₗ[R] EM × EN := + (tensorMap (k := k) X (ModuleCat.ofHom (X := ProdMN) (Y := M) (LinearMap.fst (R ⊗[k] Rᵐᵒᵖ) M N))).prod + (tensorMap (k := k) X (ModuleCat.ofHom (X := ProdMN) (Y := N) (LinearMap.snd (R ⊗[k] Rᵐᵒᵖ) M N))) + +def tensorProdInv : (EM × EN) →ₗ[R] EP := + (tensorMap (k := k) X (ModuleCat.ofHom (X := M) (Y := ProdMN) (LinearMap.inl (R ⊗[k] Rᵐᵒᵖ) M N))).coprod + (tensorMap (k := k) X (ModuleCat.ofHom (X := N) (Y := ProdMN) (LinearMap.inr (R ⊗[k] Rᵐᵒᵖ) M N))) + +@[simp] theorem tensorProdMap_tmul (m : EnvelopingBimodule k R ProdMN) (x : X) : + tensorProdMap M N X (BalancedTensor.tmul (k := k) (R := R) m x) = + (BalancedTensor.tmul (k := k) (R := R) (⟨m.value.1⟩ : EnvelopingBimodule k R M) x, + BalancedTensor.tmul (k := k) (R := R) (⟨m.value.2⟩ : EnvelopingBimodule k R N) x) := rfl + +theorem tensorProd_left (z : EP) : tensorProdInv M N X (tensorProdMap M N X z) = z := by + induction z using BalancedTensor.induction_on with + | zero => simp + | add z w hz hw => simp only [_root_.map_add, hz, hw] + | tmul m x => + change BalancedTensor.tmul (k := k) (R := R) (⟨(m.value.1, 0)⟩ : EnvelopingBimodule k R ProdMN) x + + BalancedTensor.tmul (k := k) (R := R) (⟨(0, m.value.2)⟩ : EnvelopingBimodule k R ProdMN) x = _ + rw [← BalancedTensor.add_tmul] + congr 1 + apply EnvelopingBimodule.ext + simp + +theorem tensorProd_right (z : EM × EN) : tensorProdMap M N X (tensorProdInv M N X z) = z := by + rcases z with ⟨z, w⟩ + have hz : tensorProdMap M N X (tensorProdInv M N X (z, 0)) = (z, 0) := by + induction z using BalancedTensor.induction_on with + | zero => + change tensorProdMap M N X (tensorProdInv M N X 0) = 0 + rw [(tensorProdInv M N X).map_zero, (tensorProdMap M N X).map_zero] + | add z z' hz hz' => + have hh : (z+z', (0 : EN)) = (z, 0) + (z', 0) := by simp + rw [hh, _root_.map_add, _root_.map_add, hz, hz'] + | tmul m x => + change tensorProdMap M N X + (BalancedTensor.tmul (k := k) (R := R) (⟨(m.value, 0)⟩ : EnvelopingBimodule k R ProdMN) x + 0) = _ + rw [add_zero, tensorProdMap_tmul] + simp + exact BalancedTensor.zero_tmul _ + have hw : tensorProdMap M N X (tensorProdInv M N X (0, w)) = (0, w) := by + induction w using BalancedTensor.induction_on with + | zero => + change tensorProdMap M N X (tensorProdInv M N X 0) = 0 + rw [(tensorProdInv M N X).map_zero, (tensorProdMap M N X).map_zero] + | add w w' hw hw' => + have hh : ((0 : EM), w+w') = (0, w) + (0, w') := by simp + rw [hh, _root_.map_add, _root_.map_add, hw, hw'] + | tmul n x => + change tensorProdMap M N X + (0 + BalancedTensor.tmul (k := k) (R := R) (⟨(0, n.value)⟩ : EnvelopingBimodule k R ProdMN) x) = _ + rw [zero_add, tensorProdMap_tmul] + simp + exact BalancedTensor.zero_tmul _ + have hh : (z, w) = (z, (0 : EN)) + (0, w) := by simp + rw [hh, _root_.map_add, _root_.map_add, hz, hw] + +def tensorProdEquiv : EP ≃ₗ[R] EM × EN where + __ := tensorProdMap M N X + invFun := tensorProdInv M N X + left_inv := tensorProd_left M N X + right_inv := tensorProd_right M N X + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedProjective.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedProjective.lean new file mode 100644 index 0000000000000000000000000000000000000000..74b6ac5f672cd3dd0961df2b8f66f617bc75e5f6 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedProjective.lean @@ -0,0 +1,112 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBalancedRegular +import Mathlib.LinearAlgebra.TensorProduct.Basis +import Mathlib.Algebra.Module.Projective +import Mathlib.LinearAlgebra.Pi +import Mathlib.RingTheory.Finiteness.Cardinality + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra + +namespace ArExplicit.EnvelopingBimodule + +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable (X : ModuleCat.{u} R) [Module k X] [IsScalarTower k R X] + +private instance finitePiProjective {V : Type u} [AddCommGroup V] [Module R V] + [Module.Projective R V] (n : ℕ) : Module.Projective R (Fin n → V) := + Module.Projective.of_equiv (DFinsupp.linearEquivFunOnFintype : + (Π₀ _ : Fin n, V) ≃ₗ[R] (Fin n → V)) + +instance regular_projective : + Module.Projective R (BalancedTensor k R (EnvelopingBimodule k R (regularObject k R)) X) := + Module.Projective.of_equiv (regularEquiv k R X).symm + +variable (M : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)) +variable [Module k M] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) M] + +abbrev piObject (n : ℕ) : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ) := + ModuleCat.of (R ⊗[k] Rᵐᵒᵖ) (Fin n → M) + +def piProjection (n : ℕ) (i : Fin n) : piObject M n ⟶ M := + ModuleCat.ofHom (LinearMap.proj i) + +def piInclusion (n : ℕ) (i : Fin n) : M ⟶ piObject M n := + ModuleCat.ofHom (LinearMap.single (R ⊗[k] Rᵐᵒᵖ) (fun _ : Fin n => M) i) + +def tensorPiCoordinates (n : ℕ) : + BalancedTensor k R (EnvelopingBimodule k R (piObject M n)) X →ₗ[R] + (Fin n → BalancedTensor k R (EnvelopingBimodule k R M) X) := + LinearMap.pi fun i => tensorMap X (piProjection M n i) + +def tensorPiRecombine (n : ℕ) : + (Fin n → BalancedTensor k R (EnvelopingBimodule k R M) X) →ₗ[R] + BalancedTensor k R (EnvelopingBimodule k R (piObject M n)) X := + ∑ i, (tensorMap X (piInclusion M n i)).comp (LinearMap.proj i) + +omit [IsScalarTower k R X] in +@[simp] theorem tensorPiRecombine_apply (n : ℕ) + (v : Fin n → BalancedTensor k R (EnvelopingBimodule k R M) X) : + tensorPiRecombine X M n v = ∑ i, tensorMap X (piInclusion M n i) (v i) := by + simp only [tensorPiRecombine, LinearMap.sum_apply, LinearMap.comp_apply, LinearMap.proj_apply] + +private theorem pi_reconstruct (n : ℕ) (f : EnvelopingBimodule k R (piObject M n)) : + ∑ i, map (piInclusion M n i) (map (piProjection M n i) f) = f := by + apply EnvelopingBimodule.ext + change (scalarEquiv (piObject M n)) (∑ i, map (piInclusion M n i) (map (piProjection M n i) f)) = f.value + rw [_root_.map_sum] + change (∑ i, Pi.single i (f.value i)) = f.value + exact Finset.univ_sum_single f.value + +omit [IsScalarTower k R X] in +theorem tensorPi_retraction (n : ℕ) : + (tensorPiRecombine X M n).comp (tensorPiCoordinates X M n) = LinearMap.id := by + apply LinearMap.ext + intro z + change tensorPiRecombine X M n (tensorPiCoordinates X M n z) = z + induction z using BalancedTensor.induction_on with + | zero => simp only [_root_.map_zero] + | add z w hz hw => simp only [_root_.map_add, hz, hw] + | tmul f x => + rw [tensorPiRecombine_apply] + change (∑ i, tensorMap X (piInclusion M n i) + (tensorMap X (piProjection M n i) (BalancedTensor.tmul f x))) = BalancedTensor.tmul f x + simp only [tensorMap_tmul] + change (∑ i, ((BalancedTensor.mk (k := k) (R := R)).flip x) + (map (piInclusion M n i) (map (piProjection M n i) f))) = _ + rw [← _root_.map_sum, pi_reconstruct] + rfl + +omit [IsScalarTower k R X] in +theorem tensorPi_projective + [Module.Projective R (BalancedTensor k R (EnvelopingBimodule k R M) X)] (n : ℕ) : + Module.Projective R (BalancedTensor k R (EnvelopingBimodule k R (piObject M n)) X) := + Module.Projective.of_split (R := R) (tensorPiCoordinates X M n) (tensorPiRecombine X M n) + (tensorPi_retraction X M n) + +theorem tensor_projective [Module.Finite (R ⊗[k] Rᵐᵒᵖ) M] + [Module.Projective (R ⊗[k] Rᵐᵒᵖ) M] : + Module.Projective R (BalancedTensor k R (EnvelopingBimodule k R M) X) := by + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' (R ⊗[k] Rᵐᵒᵖ) M + obtain ⟨s, hs⟩ := Module.projective_lifting_property p + (LinearMap.id : M →ₗ[R ⊗[k] Rᵐᵒᵖ] M) hp + let := regular_projective (k := k) (R := R) X + let : Module.Projective R (BalancedTensor k R + (EnvelopingBimodule k R (piObject (regularObject k R) n)) X) := + tensorPi_projective X (regularObject k R) n + apply Module.Projective.of_split (tensorMap X (ModuleCat.ofHom s)) + (tensorMap X (ModuleCat.ofHom p)) + rw [← tensorMap_comp] + have hsp : ModuleCat.ofHom s ≫ ModuleCat.ofHom p = 𝟙 M := by + apply ModuleCat.hom_ext + exact hs + rw [hsp, tensorMap_id] + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedRegular.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedRegular.lean new file mode 100644 index 0000000000000000000000000000000000000000..fa90a42b393ffc072bcae5b5d5fed090667abd78 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBalancedRegular.lean @@ -0,0 +1,140 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBalancedMap + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra + +namespace ArExplicit.EnvelopingBimodule + +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +variable (X : ModuleCat.{u} R) [Module k X] [IsScalarTower k R X] + +abbrev regularObject : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ) := + ModuleCat.of (R ⊗[k] Rᵐᵒᵖ) (R ⊗[k] Rᵐᵒᵖ) + +private def unopAction : Rᵐᵒᵖ →ₗ[k] X →ₗ[k] X where + toFun b := + { toFun := fun x => b.unop • x + map_add' := smul_add b.unop + map_smul' := by intros; exact smul_comm _ _ _ } + map_add' b c := by ext x; exact add_smul b.unop c.unop x + map_smul' c b := by + ext x + change (c • b.unop) • x = c • (b.unop • x) + exact smul_assoc c b.unop x + +private def regularRaw : (R ⊗[k] Rᵐᵒᵖ) →ₗ[k] X →ₗ[k] (R ⊗[k] X) := + TensorProduct.lift + { toFun := fun a => + { toFun := fun b => (TensorProduct.mk k R X a).comp (unopAction k R X b) + map_add' := by intros; ext x; simp [unopAction, add_smul, TensorProduct.tmul_add] + map_smul' := by intros; ext x; simp [unopAction] } + map_add' := by intros; ext b x; simp + map_smul' := by intros; ext b x; simp } + +@[simp] private theorem regularRaw_tmul (a : R) (b : Rᵐᵒᵖ) (x : X) : + regularRaw k R X (a ⊗ₜ[k] b) x = a ⊗ₜ[k] (b.unop • x) := rfl + +private def regularBilinear : EnvelopingBimodule k R (regularObject k R) →ₗ[k] + X →ₗ[k] (R ⊗[k] X) := + (regularRaw k R X).comp (scalarEquiv (regularObject k R)).toLinearMap + +private theorem regularBilinear_balance + (f : EnvelopingBimodule k R (regularObject k R)) (r : R) (x : X) : + regularBilinear k R X (MulOpposite.op r • f) x = + regularBilinear k R X f (r • x) := by + rcases f with ⟨f⟩ + induction f using TensorProduct.inductionOn with + | add f g hf hg => + change regularRaw k R X (((1 : R) ⊗ₜ[k] MulOpposite.op r) * (f + g)) x = + regularRaw k R X (f + g) (r • x) + simp only [mul_add, _root_.map_add, LinearMap.add_apply] at * + exact congrArg₂ (· + ·) hf hg + | tmul a b => + change regularRaw k R X (((1 : R) ⊗ₜ[k] MulOpposite.op r) * (a ⊗ₜ[k] b)) x = + regularRaw k R X (a ⊗ₜ[k] b) (r • x) + simp only [Algebra.TensorProduct.tmul_mul_tmul, one_mul, regularRaw_tmul, + MulOpposite.unop_mul, MulOpposite.unop_op, mul_smul] + +private theorem regularBilinear_left + (r : R) (f : EnvelopingBimodule k R (regularObject k R)) (x : X) : + regularBilinear k R X (r • f) x = r • regularBilinear k R X f x := by + rcases f with ⟨f⟩ + induction f using TensorProduct.inductionOn with + | add f g hf hg => + change regularRaw k R X ((r ⊗ₜ[k] (1 : Rᵐᵒᵖ)) * (f + g)) x = + r • regularRaw k R X (f + g) x + simp only [mul_add, _root_.map_add, LinearMap.add_apply, smul_add] at * + exact congrArg₂ (· + ·) hf hg + | tmul a b => + change regularRaw k R X ((r ⊗ₜ[k] (1 : Rᵐᵒᵖ)) * (a ⊗ₜ[k] b)) x = + r • regularRaw k R X (a ⊗ₜ[k] b) x + simp only [Algebra.TensorProduct.tmul_mul_tmul, one_mul, regularRaw_tmul, + TensorProduct.smul_tmul', smul_eq_mul] + +def regularEvaluation : + BalancedTensor k R (EnvelopingBimodule k R (regularObject k R)) X →ₗ[R] + R ⊗[k] X := + BalancedTensor.liftLeft (regularBilinear k R X) + (regularBilinear_balance k R X) (regularBilinear_left k R X) + +@[simp] theorem regularEvaluation_tmul (a : R) (b : Rᵐᵒᵖ) (x : X) : + regularEvaluation k R X (BalancedTensor.tmul ⟨a ⊗ₜ[k] b⟩ x) = + a ⊗ₜ[k] (b.unop • x) := rfl + +private def regularInclusion : R →ₗ[k] EnvelopingBimodule k R (regularObject k R) where + toFun a := ⟨a ⊗ₜ[k] (1 : Rᵐᵒᵖ)⟩ + map_add' a b := by ext; exact TensorProduct.add_tmul a b 1 + map_smul' c a := by ext; exact TensorProduct.smul_tmul' c a 1 + +private def regularInverse : R ⊗[k] X →ₗ[k] + BalancedTensor k R (EnvelopingBimodule k R (regularObject k R)) X := + TensorProduct.lift ((BalancedTensor.mk (k := k) (R := R)).comp (regularInclusion k R)) + +omit [IsScalarTower k R X] in +@[simp] private theorem regularInverse_tmul (a : R) (x : X) : + regularInverse k R X (a ⊗ₜ[k] x) = + BalancedTensor.tmul (⟨a ⊗ₜ[k] (1 : Rᵐᵒᵖ)⟩ : EnvelopingBimodule k R (regularObject k R)) x := rfl + +private theorem regularInverse_evaluation + (z : BalancedTensor k R (EnvelopingBimodule k R (regularObject k R)) X) : + regularInverse k R X (regularEvaluation k R X z) = z := by + induction z using BalancedTensor.induction_on with + | zero => simp only [_root_.map_zero] + | add z w hz hw => simp only [_root_.map_add, hz, hw] + | tmul f x => + rcases f with ⟨f⟩ + induction f using TensorProduct.inductionOn with + | add f g hf hg => + change regularInverse k R X (regularEvaluation k R X + (BalancedTensor.tmul ((⟨f⟩ : EnvelopingBimodule k R (regularObject k R)) + ⟨g⟩) x)) = + BalancedTensor.tmul ((⟨f⟩ : EnvelopingBimodule k R (regularObject k R)) + ⟨g⟩) x + simpa only [BalancedTensor.add_tmul, _root_.map_add] using congrArg₂ (· + ·) hf hg + | tmul a b => + rw [regularEvaluation_tmul, regularInverse_tmul, ← BalancedTensor.balance] + congr 1 + apply EnvelopingBimodule.ext + change (((1 : R) ⊗ₜ[k] MulOpposite.op b.unop) * (a ⊗ₜ[k] (1 : Rᵐᵒᵖ))) = a ⊗ₜ[k] b + simp only [MulOpposite.op_unop, Algebra.TensorProduct.tmul_mul_tmul, one_mul, mul_one] + +private theorem regularEvaluation_inverse (z : R ⊗[k] X) : + regularEvaluation k R X (regularInverse k R X z) = z := by + induction z using TensorProduct.inductionOn with + | add z w hz hw => simp only [_root_.map_add, hz, hw] + | tmul a x => simp only [regularInverse_tmul, regularEvaluation_tmul, MulOpposite.unop_one, one_smul] + +def regularEquiv : + BalancedTensor k R (EnvelopingBimodule k R (regularObject k R)) X ≃ₗ[R] R ⊗[k] X where + __ := regularEvaluation k R X + invFun := regularInverse k R X + left_inv := regularInverse_evaluation k R X + right_inv := regularEvaluation_inverse k R X + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBimodule.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBimodule.lean new file mode 100644 index 0000000000000000000000000000000000000000..13fe1c97c3dfa87d787623f50ba0fc8249f4fc5f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingBimodule.lean @@ -0,0 +1,124 @@ +import OAI.Algebra.AuslanderReiten.Coordinates.TensorRestriction +import Mathlib.Algebra.Module.TransferInstance + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory +open scoped TensorProduct + +universe u + +@[ext] structure EnvelopingBimodule (k R : Type u) [Field k] [Ring R] [Algebra k R] + (M : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)) where + value : M + +namespace EnvelopingBimodule + +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable (M : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)) + +def coordinates : EnvelopingBimodule k R M ≃ M where + toFun := value + invFun := EnvelopingBimodule.mk + left_inv _ := rfl + right_inv _ := rfl + +instance : AddCommGroup (EnvelopingBimodule k R M) := (coordinates M).addCommGroup +instance : Module (R ⊗[k] Rᵐᵒᵖ) (EnvelopingBimodule k R M) := + (coordinates M).addEquiv.module (R ⊗[k] Rᵐᵒᵖ) +instance : Module R (EnvelopingBimodule k R M) := + Module.compHom _ (tensorLeftInclusion k R Rᵐᵒᵖ) +instance : Module Rᵐᵒᵖ (EnvelopingBimodule k R M) := + Module.compHom _ (tensorRightInclusion k R Rᵐᵒᵖ) + +@[simp] theorem value_zero : (0 : EnvelopingBimodule k R M).value = 0 := rfl +@[simp] theorem value_add (x y : EnvelopingBimodule k R M) : + (x + y).value = x.value + y.value := rfl +@[simp] theorem value_smul (a : R ⊗[k] Rᵐᵒᵖ) (x : EnvelopingBimodule k R M) : + (a • x).value = a • x.value := rfl +@[simp] theorem value_left_smul (a : R) (x : EnvelopingBimodule k R M) : + (a • x).value = (a ⊗ₜ[k] (1 : Rᵐᵒᵖ)) • x.value := rfl +@[simp] theorem value_right_smul (b : Rᵐᵒᵖ) (x : EnvelopingBimodule k R M) : + (b • x).value = ((1 : R) ⊗ₜ[k] b) • x.value := rfl + +instance : SMulCommClass R Rᵐᵒᵖ (EnvelopingBimodule k R M) where + smul_comm a b x := by + ext + change (a ⊗ₜ[k] (1 : Rᵐᵒᵖ)) • (((1 : R) ⊗ₜ[k] b) • x.value) = + ((1 : R) ⊗ₜ[k] b) • ((a ⊗ₜ[k] (1 : Rᵐᵒᵖ)) • x.value) + simp only [← mul_smul, Algebra.TensorProduct.tmul_mul_tmul, mul_one, one_mul] + +def leftEquiv : EnvelopingBimodule k R M ≃ₗ[R] + ((ModuleCat.restrictScalars (tensorLeftInclusion k R Rᵐᵒᵖ)).obj M) where + __ := coordinates M + map_add' _ _ := rfl + map_smul' _ _ := rfl + +def rightEquiv : EnvelopingBimodule k R M ≃ₗ[Rᵐᵒᵖ] + ((ModuleCat.restrictScalars (tensorRightInclusion k R Rᵐᵒᵖ)).obj M) where + __ := coordinates M + map_add' _ _ := rfl + map_smul' _ _ := rfl + +instance [Module.Projective R ((ModuleCat.restrictScalars (tensorLeftInclusion k R Rᵐᵒᵖ)).obj M)] : + Module.Projective R (EnvelopingBimodule k R M) := + Module.Projective.of_equiv (leftEquiv M).symm + +instance [Module.Projective Rᵐᵒᵖ ((ModuleCat.restrictScalars (tensorRightInclusion k R Rᵐᵒᵖ)).obj M)] : + Module.Projective Rᵐᵒᵖ (EnvelopingBimodule k R M) := + Module.Projective.of_equiv (rightEquiv M).symm + +instance [Module.Finite R ((ModuleCat.restrictScalars (tensorLeftInclusion k R Rᵐᵒᵖ)).obj M)] : + Module.Finite R (EnvelopingBimodule k R M) := + Module.Finite.equiv (leftEquiv M).symm + +instance [Module.Finite Rᵐᵒᵖ ((ModuleCat.restrictScalars (tensorRightInclusion k R Rᵐᵒᵖ)).obj M)] : + Module.Finite Rᵐᵒᵖ (EnvelopingBimodule k R M) := + Module.Finite.equiv (rightEquiv M).symm + +variable [Module k M] + +instance : Module k (EnvelopingBimodule k R M) := (coordinates M).addEquiv.module k + +@[simp] theorem value_scalar_smul (a : k) (x : EnvelopingBimodule k R M) : + (a • x).value = a • x.value := rfl + +def scalarEquiv : EnvelopingBimodule k R M ≃ₗ[k] M := (coordinates M).addEquiv.linearEquiv k + +instance [Module.Finite k M] : Module.Finite k (EnvelopingBimodule k R M) := + Module.Finite.equiv (scalarEquiv M).symm + +variable [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) M] + +instance : IsScalarTower k R (EnvelopingBimodule k R M) := + IsScalarTower.of_algebraMap_smul fun a x => by + ext + change ((algebraMap k R a) ⊗ₜ[k] (1 : Rᵐᵒᵖ)) • x.value = a • x.value + exact IsScalarTower.algebraMap_smul (R ⊗[k] Rᵐᵒᵖ) a x.value + +instance : IsScalarTower k Rᵐᵒᵖ (EnvelopingBimodule k R M) := + IsScalarTower.of_algebraMap_smul fun a x => by + ext + change ((1 : R) ⊗ₜ[k] (algebraMap k Rᵐᵒᵖ a)) • x.value = a • x.value + rw [show (1 : R) ⊗ₜ[k] algebraMap k Rᵐᵒᵖ a = algebraMap k (R ⊗[k] Rᵐᵒᵖ) a from + (Algebra.TensorProduct.includeRight : Rᵐᵒᵖ →ₐ[k] R ⊗[k] Rᵐᵒᵖ).commutes a] + exact IsScalarTower.algebraMap_smul (R ⊗[k] Rᵐᵒᵖ) a x.value + +instance : SMulCommClass k R (EnvelopingBimodule k R M) where + smul_comm a r x := by + simp only [← IsScalarTower.algebraMap_smul R a, ← mul_smul, Algebra.commutes] + +instance : SMulCommClass k Rᵐᵒᵖ (EnvelopingBimodule k R M) where + smul_comm a r x := by + simp only [← IsScalarTower.algebraMap_smul Rᵐᵒᵖ a, ← mul_smul, Algebra.commutes] + +end EnvelopingBimodule +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingCoefficientComplex.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingCoefficientComplex.lean new file mode 100644 index 0000000000000000000000000000000000000000..51f4ab1bab865b818070b25800dac41e4fe8a7d2 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingCoefficientComplex.lean @@ -0,0 +1,30 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingEvaluationCoefficient +import OAI.Algebra.AuslanderReiten.Ext.ExternalEvaluationTerms + +namespace OAI + +noncomputable section +namespace ArExplicit.EnvelopingBimodule +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +variable {X Y : ModuleCat.{u} R} +variable [Module k X] [IsScalarTower k R X] [Module k Y] [IsScalarTower k R Y] +variable (e : X ≅ Y) (P : ChainComplex (ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)) ℕ) + +def coefficientComplexIso : + ((evaluationFunctor k R X).mapHomologicalComplex (ComplexShape.down ℕ)).obj P ≅ + ((evaluationFunctor k R Y).mapHomologicalComplex (ComplexShape.down ℕ)).obj P := + (NatIso.mapHomologicalComplex (evaluationCoefficientIso k R e) (ComplexShape.down ℕ)).app P + +theorem coefficientComplexIso_comparison (m n : ℕ) (f : P.X m ⟶ P.X n) : + (evaluationFunctor k R X).map f ≫ (coefficientComplexIso k R e P).hom.f n = + (coefficientComplexIso k R e P).hom.f m ≫ (evaluationFunctor k R Y).map f := + (evaluationCoefficientIso k R e).hom.naturality f + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingEvaluationCoefficient.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingEvaluationCoefficient.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ebfa84a9e62430189c34801210a0ceb22f5927b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingEvaluationCoefficient.lean @@ -0,0 +1,46 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingEvaluationFunctor +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorMapEquiv + +namespace OAI + +noncomputable section +namespace ArExplicit.EnvelopingBimodule +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +variable {X Y : ModuleCat.{u} R} +variable [Module k X] [IsScalarTower k R X] [Module k Y] [IsScalarTower k R Y] + +def evaluationCoefficientMap (f : X ⟶ Y) : + evaluationFunctor k R X ⟶ evaluationFunctor k R Y where + app M := ModuleCat.ofHom (BalancedTensor.mapRight (k := k) (S := R) + (F := EnvelopingBimodule k R M) f.hom) + naturality {M N} g := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro z + change BalancedTensor.mapRight (k := k) (S := R) f.hom (tensorMap X g z) = + tensorMap Y g (BalancedTensor.mapRight (k := k) (S := R) f.hom z) + induction z using BalancedTensor.induction_on with + | zero => simp + | add z w hz hw => simp only [_root_.map_add, hz, hw] + | tmul m x => rfl + +def evaluationCoefficientIso (e : X ≅ Y) : + evaluationFunctor k R X ≅ evaluationFunctor k R Y := + NatIso.ofComponents + (fun M => (BalancedTensor.mapRightEquiv (k := k) (S := R) + (F := EnvelopingBimodule k R M) e.toLinearEquiv).toModuleIso) + (fun g => (evaluationCoefficientMap k R e.hom).naturality g) + +@[simp] theorem evaluationCoefficientIso_tmul (e : X ≅ Y) + (M : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)) (m : EnvelopingBimodule k R M) (x : X) : + (evaluationCoefficientIso k R e).hom.app M (BalancedTensor.tmul m x) = + BalancedTensor.tmul m (e.hom x) := rfl + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingEvaluationFunctor.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingEvaluationFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..09be786826e9958ebbc3b13d1d096b25013ecdab --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingEvaluationFunctor.lean @@ -0,0 +1,34 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBalancedMap +import Mathlib.CategoryTheory.Preadditive.AdditiveFunctor + +namespace OAI + +noncomputable section +namespace ArExplicit.EnvelopingBimodule +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra +universe u +variable (k R : Type u) [Field k] [Ring R] [Algebra k R] +variable (X : ModuleCat.{u} R) [Module k X] [IsScalarTower k R X] + +def evaluationFunctor : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ) ⥤ ModuleCat.{u} R where + obj M := ModuleCat.of R (BalancedTensor k R (EnvelopingBimodule k R M) X) + map f := ModuleCat.ofHom (tensorMap X f) + map_id M := by apply ModuleCat.hom_ext; exact tensorMap_id X + map_comp f g := by apply ModuleCat.hom_ext; exact tensorMap_comp X f g + +instance : (evaluationFunctor k R X).Additive where + map_add := by intro M N f g; apply ModuleCat.hom_ext; exact tensorMap_add X f g + +omit [IsScalarTower k R X] in +@[simp] theorem evaluationFunctor_map_tmul + {M N : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)} (f : M ⟶ N) + (m : EnvelopingBimodule k R M) (x : X) : + (evaluationFunctor k R X).map f (BalancedTensor.tmul m x) = + BalancedTensor.tmul (map f m) x := rfl + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingProducts.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..5cb936371929dff92bbff71eee6d6eabf8667873 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingProducts.lean @@ -0,0 +1,34 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBimodule +import Mathlib.Algebra.Module.Projective + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped TensorProduct +namespace ArExplicit.EnvelopingBimodule +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable (M N : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)) + +def prodRightEquiv : EnvelopingBimodule k R (ModuleCat.of (R ⊗[k] Rᵐᵒᵖ) (M × N)) ≃ₗ[Rᵐᵒᵖ] + EnvelopingBimodule k R M × EnvelopingBimodule k R N where + toFun x := (⟨x.value.1⟩, ⟨x.value.2⟩) + invFun x := ⟨(x.1.value, x.2.value)⟩ + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + +theorem prod_right_projective + [Module.Projective Rᵐᵒᵖ (EnvelopingBimodule k R M)] + [Module.Projective Rᵐᵒᵖ (EnvelopingBimodule k R N)] : + Module.Projective Rᵐᵒᵖ + (EnvelopingBimodule k R (ModuleCat.of (R ⊗[k] Rᵐᵒᵖ) (M × N))) := + Module.Projective.of_equiv (prodRightEquiv M N).symm + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingStableEvaluation.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingStableEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea643805786730db61ff2d6668eab8767e4b6871 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/EnvelopingStableEvaluation.lean @@ -0,0 +1,109 @@ +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBalancedProjective +import OAI.Algebra.AuslanderReiten.Stable.StableHom +import Mathlib.Algebra.Category.ModuleCat.Algebra + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra + +namespace ArExplicit.EnvelopingBimodule +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +variable (X : ModuleCat.{u} R) [Module k X] [IsScalarTower k R X] +variable {M N P : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)} +variable [Module k M] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) M] +variable [Module k N] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) N] +variable [Module k P] [IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) P] + +omit [IsScalarTower k R X] in +theorem tensorMap_smul_linear (c : k) (f : M →ₗ[R ⊗[k] Rᵐᵒᵖ] N) : + tensorMap X (ModuleCat.ofHom (c • f)) = c • tensorMap X (ModuleCat.ofHom f) := by + have hm : map (ModuleCat.ofHom (c • f)) = c • map (ModuleCat.ofHom f) := by + apply LinearMap.ext + intro z + rfl + apply LinearMap.ext + intro z + induction z using BalancedTensor.induction_on with + | zero => simp + | add z w hz hw => simp_all + | tmul m x => simp only [tensorMap_tmul, hm, LinearMap.smul_apply, + BalancedTensor.scalar_tmul] + +def tensorHom : (M →ₗ[R ⊗[k] Rᵐᵒᵖ] N) →ₗ[k] + (BalancedTensor k R (EnvelopingBimodule k R M) X →ₗ[R] + BalancedTensor k R (EnvelopingBimodule k R N) X) where + toFun f := tensorMap X (ModuleCat.ofHom f) + map_add' _ _ := tensorMap_add X _ _ + map_smul' := tensorMap_smul_linear X + +variable [Module.Finite k R] [Module.Finite k X] + +theorem tensorHom_projective {f : M →ₗ[R ⊗[k] Rᵐᵒᵖ] N} + (hf : FactorsThroughFiniteProjective (R ⊗[k] Rᵐᵒᵖ) M N f) : + FactorsThroughFiniteProjective R + (BalancedTensor k R (EnvelopingBimodule k R M) X) + (BalancedTensor k R (EnvelopingBimodule k R N) X) (tensorHom X f) := by + obtain ⟨Q, hQ, hAQ, hp, hfin, i, p, rfl⟩ := hf + let Q' : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ) := ModuleCat.of _ Q + let : Module k Q := ModuleCat.moduleOfAlgebraModule Q' + let : IsScalarTower k (R ⊗[k] Rᵐᵒᵖ) Q := ModuleCat.isScalarTower_of_algebra_moduleCat Q' + let : Module.Finite k Q := Module.Finite.trans (R ⊗[k] Rᵐᵒᵖ) Q + let : Module.Finite k (BalancedTensor k R (EnvelopingBimodule k R Q') X) := inferInstance + let : Module.Finite R (BalancedTensor k R (EnvelopingBimodule k R Q') X) := + Module.Finite.of_restrictScalars_finite k R _ + refine ⟨BalancedTensor k R (EnvelopingBimodule k R Q') X, + inferInstance, inferInstance, tensor_projective X Q', inferInstance, + tensorMap X (ModuleCat.ofHom i), tensorMap X (ModuleCat.ofHom p), ?_⟩ + exact (tensorMap_comp X (ModuleCat.ofHom i) (ModuleCat.ofHom p)).symm + +def stableEvaluation : StableHom (R ⊗[k] Rᵐᵒᵖ) M N →+ + StableHom R (BalancedTensor k R (EnvelopingBimodule k R M) X) + (BalancedTensor k R (EnvelopingBimodule k R N) X) := + QuotientAddGroup.map _ _ (tensorHom (k := k) (M := M) (N := N) X).toAddMonoidHom (by + intro f hf + exact (factorsThroughFiniteFree_iff_projective _).mpr + (tensorHom_projective X ((factorsThroughFiniteFree_iff_projective _).mp hf))) + +@[simp] +theorem stableEvaluation_classOf (f : M →ₗ[R ⊗[k] Rᵐᵒᵖ] N) : + stableEvaluation X (StableHom.classOf _ _ _ f) = + StableHom.classOf R _ _ (tensorMap X (ModuleCat.ofHom f)) := + QuotientAddGroup.map_mk' _ _ _ _ _ + +def stableEvaluationLinear : StableHom (R ⊗[k] Rᵐᵒᵖ) M N →ₗ[k] + StableHom R (BalancedTensor k R (EnvelopingBimodule k R M) X) + (BalancedTensor k R (EnvelopingBimodule k R N) X) where + __ := stableEvaluation X + map_smul' c f := by + obtain ⟨f, rfl⟩ := StableHom.classOf_surjective f + change stableEvaluation X (c • StableHom.classOf _ _ _ f) = + c • stableEvaluation X (StableHom.classOf _ _ _ f) + rw [← StableHom.classOf_smul, stableEvaluation_classOf, stableEvaluation_classOf, + tensorMap_smul_linear, StableHom.classOf_smul] + +@[simp] +theorem stableEvaluation_id : stableEvaluation X + (StableHom.classOf _ M M LinearMap.id) = + StableHom.classOf R _ _ LinearMap.id := by + rw [stableEvaluation_classOf] + exact congrArg (StableHom.classOf R _ _) (tensorMap_id X) + +theorem stableEvaluation_comp (f : StableHom (R ⊗[k] Rᵐᵒᵖ) M N) + (g : StableHom (R ⊗[k] Rᵐᵒᵖ) N P) : + stableEvaluation X (StableHom.comp g f) = + StableHom.comp (stableEvaluation X g) (stableEvaluation X f) := by + obtain ⟨f, rfl⟩ := StableHom.classOf_surjective f + obtain ⟨g, rfl⟩ := StableHom.classOf_surjective g + rw [StableHom.comp_classOf, stableEvaluation_classOf, stableEvaluation_classOf, + stableEvaluation_classOf, StableHom.comp_classOf] + exact congrArg (StableHom.classOf R _ _) + (tensorMap_comp X (ModuleCat.ofHom f) (ModuleCat.ofHom g)) + +end ArExplicit.EnvelopingBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedCoordinates.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b91f78e84f134d0ba60cc8a082c1d283a2f8188 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedCoordinates.lean @@ -0,0 +1,62 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorCoordinates +import OAI.Algebra.AuslanderReiten.Tensor.ExternalEnvelopingScalar +import OAI.Algebra.AuslanderReiten.Tensor.EnvelopingBalancedMap + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalBalanced +open CategoryTheory +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance 2000] moduleCatBaseModule moduleCatBaseTower +local notation "Ae" => A ⊗[k] Aᵐᵒᵖ +local notation "Be" => B ⊗[k] Bᵐᵒᵖ +variable (M : ModuleCat.{u} (A ⊗[k] Aᵐᵒᵖ)) (N : ModuleCat.{u} (B ⊗[k] Bᵐᵒᵖ)) + +abbrev exteriorBimodule (M : ModuleCat.{u} (A ⊗[k] Aᵐᵒᵖ)) + (N : ModuleCat.{u} (B ⊗[k] Bᵐᵒᵖ)) := EnvelopingBimodule k (A ⊗[k] B) + (ExternalTensor.envelopingObject k A B (ExternalTensor.moduleObject k Ae Be M N)) + +def bimoduleCoordinates : exteriorBimodule k A B M N ≃ₗ[k] + (EnvelopingBimodule k A M) ⊗[k] (EnvelopingBimodule k B N) := + (EnvelopingBimodule.scalarEquiv _).trans + ((ExternalTensor.envelopingScalarEquiv k A B _).trans + ((ExternalTensor.moduleScalarCoordinates k Ae Be M N).trans + (TensorProduct.congr (EnvelopingBimodule.scalarEquiv M).symm + (EnvelopingBimodule.scalarEquiv N).symm))) + +@[simp] theorem bimoduleCoordinates_symm_tmul (m : EnvelopingBimodule k A M) + (n : EnvelopingBimodule k B N) : + ((bimoduleCoordinates k A B M N).symm (m ⊗ₜ[k] n)).value = + m.value ⊗ₜ[k] n.value := rfl + +theorem bimoduleCoordinates_right (a : A) (b : B) + (m : EnvelopingBimodule k A M) (n : EnvelopingBimodule k B N) : + MulOpposite.op (a ⊗ₜ[k] b) • (bimoduleCoordinates k A B M N).symm (m ⊗ₜ[k] n) = + (bimoduleCoordinates k A B M N).symm + ((MulOpposite.op a • m) ⊗ₜ[k] (MulOpposite.op b • n)) := by + apply EnvelopingBimodule.ext + change ExternalTensor.representation k Ae Be M N ((ExternalTensor.envelopingEquiv k A B).symm + (((1 : A) ⊗ₜ[k] (1 : B)) ⊗ₜ[k] MulOpposite.op (a ⊗ₜ[k] b))) + (m.value ⊗ₜ[k] n.value) = _ + rw [ExternalTensor.envelopingEquiv_symm_tmul] + rfl + +theorem bimoduleCoordinates_left (a : A) (b : B) + (m : EnvelopingBimodule k A M) (n : EnvelopingBimodule k B N) : + (a ⊗ₜ[k] b) • (bimoduleCoordinates k A B M N).symm (m ⊗ₜ[k] n) = + (bimoduleCoordinates k A B M N).symm ((a • m) ⊗ₜ[k] (b • n)) := by + apply EnvelopingBimodule.ext + change ExternalTensor.representation k Ae Be M N ((ExternalTensor.envelopingEquiv k A B).symm + ((a ⊗ₜ[k] b) ⊗ₜ[k] MulOpposite.op ((1 : A) ⊗ₜ[k] (1 : B)))) + (m.value ⊗ₜ[k] n.value) = _ + rw [ExternalTensor.envelopingEquiv_symm_tmul] + rfl + +end ArExplicit.ExternalBalanced + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedCore.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c8f06852b82bde69a7984ec6ab8b86b43f9f539 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedCore.lean @@ -0,0 +1,107 @@ +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorDoubleLift +import Mathlib.RingTheory.TensorProduct.Basic + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalBalanced +open scoped TensorProduct +universe u +variable {k A B E V F G X Y : Type u} [Field k] [Ring A] [Ring B] + [Algebra k A] [Algebra k B] + [AddCommGroup E] [AddCommGroup V] [AddCommGroup F] [AddCommGroup G] + [AddCommGroup X] [AddCommGroup Y] + [Module k E] [Module k V] [Module k F] [Module k G] [Module k X] [Module k Y] + [Module (A ⊗[k] B)ᵐᵒᵖ E] [Module (A ⊗[k] B) V] + [Module Aᵐᵒᵖ F] [Module Bᵐᵒᵖ G] [Module A X] [Module B Y] + +variable (e : E ≃ₗ[k] F ⊗[k] G) (v : V ≃ₗ[k] X ⊗[k] Y) +local notation "Sbal" => BalancedTensor k (A ⊗[k] B) E V +local notation "Lbal" => BalancedTensor k A F X +local notation "Rbal" => BalancedTensor k B G Y + +def rawForward : (E ⊗[k] V) →ₗ[k] Lbal ⊗[k] Rbal := + (TensorProduct.map (balancingRelations k A F X).mkQ + (balancingRelations k B G Y).mkQ).comp + ((TensorProduct.tensorTensorTensorComm k F G X Y).toLinearMap.comp + (TensorProduct.map e.toLinearMap v.toLinearMap)) + +def forwardPair : E →ₗ[k] V →ₗ[k] Lbal ⊗[k] Rbal := TensorProduct.curry (rawForward (A := A) (B := B) e v) + +omit [Algebra k A] [Algebra k B] [Module (A ⊗[k] B)ᵐᵒᵖ E] [Module (A ⊗[k] B) V] in +@[simp] theorem forwardPair_pure (f : F) (g : G) (x : X) (y : Y) : + forwardPair (A := A) (B := B) e v (e.symm (f ⊗ₜ[k] g)) (v.symm (x ⊗ₜ[k] y)) = + BalancedTensor.tmul (R := A) f x ⊗ₜ[k] BalancedTensor.tmul (R := B) g y := by + simp [forwardPair, rawForward, BalancedTensor.tmul] + +variable + (he : ∀ (a : A) (b : B) (f : F) (g : G), + MulOpposite.op (a ⊗ₜ[k] b) • e.symm (f ⊗ₜ[k] g) = + e.symm ((MulOpposite.op a • f) ⊗ₜ[k] (MulOpposite.op b • g))) + (hv : ∀ (a : A) (b : B) (x : X) (y : Y), + (a ⊗ₜ[k] b) • v.symm (x ⊗ₜ[k] y) = v.symm ((a • x) ⊗ₜ[k] (b • y))) + +include he hv + + theorem forwardPair_balanced (z : E) (r : A ⊗[k] B) (w : V) : + forwardPair (A := A) (B := B) e v (MulOpposite.op r • z) w = forwardPair (A := A) (B := B) e v z (r • w) := by + obtain ⟨z, rfl⟩ := e.symm.surjective z + obtain ⟨w, rfl⟩ := v.symm.surjective w + induction r using TensorProduct.inductionOn with + | add r s hr hs => simp only [MulOpposite.op_add, add_smul, map_add, LinearMap.add_apply, hr, hs] + | tmul a b => + induction z using TensorProduct.inductionOn with + | add z z' hz hz' => simp only [map_add, smul_add, LinearMap.add_apply, hz, hz'] + | tmul f g => + induction w using TensorProduct.inductionOn with + | add w w' hw hw' => simp only [map_add, smul_add, hw, hw'] + | tmul x y => rw [he, hv, forwardPair_pure, forwardPair_pure, + BalancedTensor.balance, BalancedTensor.balance] + +def forward : Sbal →ₗ[k] Lbal ⊗[k] Rbal := + BalancedTensor.lift (forwardPair (A := A) (B := B) e v) (forwardPair_balanced (A := A) (B := B) e v he hv) + +@[simp] theorem forward_pure (f : F) (g : G) (x : X) (y : Y) : + forward (A := A) (B := B) e v he hv (BalancedTensor.tmul (R := A ⊗[k] B) (e.symm (f ⊗ₜ[k] g)) (v.symm (x ⊗ₜ[k] y))) = + BalancedTensor.tmul (R := A) f x ⊗ₜ[k] BalancedTensor.tmul (R := B) g y := + forwardPair_pure (A := A) (B := B) e v f g x y + +def rawInverse : ((F ⊗[k] X) ⊗[k] (G ⊗[k] Y)) →ₗ[k] Sbal := + (TensorProduct.lift (BalancedTensor.mk (k := k) (R := A ⊗[k] B))).comp + ((TensorProduct.map e.symm.toLinearMap v.symm.toLinearMap).comp + (TensorProduct.tensorTensorTensorComm k F X G Y).toLinearMap) + +omit he hv [Module Aᵐᵒᵖ F] [Module Bᵐᵒᵖ G] [Module A X] [Module B Y] in +@[simp] theorem rawInverse_pure (f : F) (x : X) (g : G) (y : Y) : + rawInverse (A := A) (B := B) e v ((f ⊗ₜ[k] x) ⊗ₜ[k] (g ⊗ₜ[k] y)) = + BalancedTensor.tmul (R := A ⊗[k] B) (e.symm (f ⊗ₜ[k] g)) (v.symm (x ⊗ₜ[k] y)) := rfl + + theorem inverse_balanced_left (f : F) (a : A) (x : X) (g : G) (y : Y) : + BalancedTensor.curryFour (rawInverse (A := A) (B := B) e v) (MulOpposite.op a • f) x g y = + BalancedTensor.curryFour (rawInverse (A := A) (B := B) e v) f (a • x) g y := by + simpa only [BalancedTensor.curryFour_apply, rawInverse_pure, he, hv, + MulOpposite.op_one, one_smul] using + (BalancedTensor.balance (k := k) (R := A ⊗[k] B) + (e.symm (f ⊗ₜ[k] g)) (a ⊗ₜ[k] (1 : B)) (v.symm (x ⊗ₜ[k] y))) + + theorem inverse_balanced_right (f : F) (x : X) (g : G) (b : B) (y : Y) : + BalancedTensor.curryFour (rawInverse (A := A) (B := B) e v) f x (MulOpposite.op b • g) y = + BalancedTensor.curryFour (rawInverse (A := A) (B := B) e v) f x g (b • y) := by + simpa only [BalancedTensor.curryFour_apply, rawInverse_pure, he, hv, + MulOpposite.op_one, one_smul] using + (BalancedTensor.balance (k := k) (R := A ⊗[k] B) + (e.symm (f ⊗ₜ[k] g)) ((1 : A) ⊗ₜ[k] b) (v.symm (x ⊗ₜ[k] y))) + +def inverse : (Lbal ⊗[k] Rbal) →ₗ[k] Sbal := + TensorProduct.lift (BalancedTensor.doubleLift (BalancedTensor.curryFour (rawInverse (A := A) (B := B) e v)) + (inverse_balanced_left (A := A) (B := B) e v he hv) (inverse_balanced_right (A := A) (B := B) e v he hv)) + +@[simp] theorem inverse_pure (f : F) (x : X) (g : G) (y : Y) : + inverse (A := A) (B := B) e v he hv (BalancedTensor.tmul (R := A) f x ⊗ₜ[k] BalancedTensor.tmul (R := B) g y) = + BalancedTensor.tmul (R := A ⊗[k] B) (e.symm (f ⊗ₜ[k] g)) (v.symm (x ⊗ₜ[k] y)) := rfl + +end ArExplicit.ExternalBalanced + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedEquiv.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..adf419ea6b3506db9ad15d31a27622a73e04c2fc --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedEquiv.lean @@ -0,0 +1,75 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalBalancedCore + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalBalanced +open scoped TensorProduct +universe u +variable {k A B E V F G X Y : Type u} [Field k] [Ring A] [Ring B] + [Algebra k A] [Algebra k B] + [AddCommGroup E] [AddCommGroup V] [AddCommGroup F] [AddCommGroup G] + [AddCommGroup X] [AddCommGroup Y] + [Module k E] [Module k V] [Module k F] [Module k G] [Module k X] [Module k Y] + [Module (A ⊗[k] B)ᵐᵒᵖ E] [Module (A ⊗[k] B) V] + [Module Aᵐᵒᵖ F] [Module Bᵐᵒᵖ G] [Module A X] [Module B Y] + +variable (e : E ≃ₗ[k] F ⊗[k] G) (v : V ≃ₗ[k] X ⊗[k] Y) +local notation "Sbal" => BalancedTensor k (A ⊗[k] B) E V +local notation "Lbal" => BalancedTensor k A F X +local notation "Rbal" => BalancedTensor k B G Y + +variable + (he : ∀ (a : A) (b : B) (f : F) (g : G), + MulOpposite.op (a ⊗ₜ[k] b) • e.symm (f ⊗ₜ[k] g) = + e.symm ((MulOpposite.op a • f) ⊗ₜ[k] (MulOpposite.op b • g))) + (hv : ∀ (a : A) (b : B) (x : X) (y : Y), + (a ⊗ₜ[k] b) • v.symm (x ⊗ₜ[k] y) = v.symm ((a • x) ⊗ₜ[k] (b • y))) + +include he hv + +theorem inverse_forward (z : Sbal) : + inverse (A := A) (B := B) e v he hv (forward e v he hv z) = z := by + induction z using BalancedTensor.induction_on with + | zero => simp + | add z w hz hw => simp only [map_add, hz, hw] + | tmul z w => + obtain ⟨z, rfl⟩ := e.symm.surjective z + obtain ⟨w, rfl⟩ := v.symm.surjective w + induction z using TensorProduct.inductionOn with + | add z z' hz hz' => simp only [map_add, BalancedTensor.add_tmul, hz, hz'] + | tmul f g => + induction w using TensorProduct.inductionOn with + | add w w' hw hw' => simp only [map_add, BalancedTensor.tmul_add, hw, hw'] + | tmul x y => rw [forward_pure, inverse_pure] + +theorem forward_inverse (z : Lbal ⊗[k] Rbal) : + forward (A := A) (B := B) e v he hv (inverse e v he hv z) = z := by + induction z using TensorProduct.inductionOn with + | add z w hz hw => simp only [map_add, hz, hw] + | tmul z w => + induction z using BalancedTensor.induction_on with + | zero => simp + | add z z' hz hz' => simp only [TensorProduct.add_tmul, map_add, hz, hz'] + | tmul f x => + induction w using BalancedTensor.induction_on with + | zero => simp + | add w w' hw hw' => simp only [TensorProduct.tmul_add, map_add, hw, hw'] + | tmul g y => rw [inverse_pure, forward_pure] + +def equiv : Sbal ≃ₗ[k] Lbal ⊗[k] Rbal where + __ := forward e v he hv + invFun := inverse e v he hv + left_inv := inverse_forward e v he hv + right_inv := forward_inverse e v he hv + +@[simp] theorem equiv_pure (f : F) (g : G) (x : X) (y : Y) : + equiv e v he hv (BalancedTensor.tmul (e.symm (f ⊗ₜ[k] g)) (v.symm (x ⊗ₜ[k] y))) = + BalancedTensor.tmul (R := A) f x ⊗ₜ[k] BalancedTensor.tmul (R := B) g y := + forward_pure e v he hv f g x y + +end ArExplicit.ExternalBalanced + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedHomExt.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedHomExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..6715b74ba2519fee7704ba5af87f144627c46cab --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedHomExt.lean @@ -0,0 +1,34 @@ +import OAI.Algebra.AuslanderReiten.Ext.ExternalEvaluationTerms +import OAI.Algebra.AuslanderReiten.Tensor.BalancedFourAddExt + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalBalanced +open CategoryTheory +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance 2000] moduleCatBaseModule moduleCatBaseTower +variable (M : ModuleCat.{u} (A ⊗[k] Aᵐᵒᵖ)) (N : ModuleCat.{u} (B ⊗[k] Bᵐᵒᵖ)) +variable (X : ModuleCat.{u} A) (Y : ModuleCat.{u} B) (Z : ModuleCat.{u} (A ⊗[k] B)) + +theorem exterior_hom_ext + (f g : (productEvaluation k A B X Y).obj + (ExternalTensor.moduleObject k (A ⊗[k] Aᵐᵒᵖ) (B ⊗[k] Bᵐᵒᵖ) M N) ⟶ Z) + (h : ∀ (a : EnvelopingBimodule k A M) (b : EnvelopingBimodule k B N) (x : X) (y : Y), + f (BalancedTensor.tmul ((bimoduleCoordinates k A B M N).symm (a ⊗ₜ[k] b)) + ((ExternalTensor.moduleScalarCoordinates k A B X Y).symm (x ⊗ₜ[k] y))) = + g (BalancedTensor.tmul ((bimoduleCoordinates k A B M N).symm (a ⊗ₜ[k] b)) + ((ExternalTensor.moduleScalarCoordinates k A B X Y).symm (x ⊗ₜ[k] y)))) : f = g := by + apply ModuleCat.hom_ext + apply LinearMap.toAddMonoidHom_injective + exact fourfold_add_hom_ext (k := k) (A := A) (B := B) (Z := Z) + (bimoduleCoordinates k A B M N) (ExternalTensor.moduleScalarCoordinates k A B X Y) + f.hom.toAddMonoidHom g.hom.toAddMonoidHom h + +end ArExplicit.ExternalBalanced + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedNaturality.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..60e900bfe372be37e0090ca8bc971a4f37a401fb --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedNaturality.lean @@ -0,0 +1,82 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalBalancedShuffle +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorFunctor +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorFunctor + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalBalanced +open CategoryTheory +open scoped TensorProduct +universe u +variable {k A B : Type u} [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance 2000] moduleCatBaseModule moduleCatBaseTower + +def balancedMap {R : Type u} [Ring R] [Algebra k R] + {M M' : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)} {X X' : ModuleCat.{u} R} + (f : M ⟶ M') (g : X ⟶ X') : + BalancedTensor k R (EnvelopingBimodule k R M) X →ₗ[R] + BalancedTensor k R (EnvelopingBimodule k R M') X' := + (BalancedTensor.mapRight (k := k) (S := R) g.hom).comp + (EnvelopingBimodule.tensorMap X f) + +@[simp] theorem balancedMap_tmul {R : Type u} [Ring R] [Algebra k R] + {M M' : ModuleCat.{u} (R ⊗[k] Rᵐᵒᵖ)} {X X' : ModuleCat.{u} R} + (f : M ⟶ M') (g : X ⟶ X') (m : EnvelopingBimodule k R M) (x : X) : + balancedMap f g (BalancedTensor.tmul m x) = + BalancedTensor.tmul (EnvelopingBimodule.map f m) (g.hom x) := rfl + +variable {M M' : ModuleCat.{u} (A ⊗[k] Aᵐᵒᵖ)} + {N N' : ModuleCat.{u} (B ⊗[k] Bᵐᵒᵖ)} {X X' : ModuleCat.{u} A} {Y Y' : ModuleCat.{u} B} + (f : M ⟶ M') (g : N ⟶ N') (h : X ⟶ X') (j : Y ⟶ Y') + +def exteriorMap : + ExternalTensor.envelopingObject k A B + (ExternalTensor.moduleObject k (A ⊗[k] Aᵐᵒᵖ) (B ⊗[k] Bᵐᵒᵖ) M N) ⟶ + ExternalTensor.envelopingObject k A B + (ExternalTensor.moduleObject k (A ⊗[k] Aᵐᵒᵖ) (B ⊗[k] Bᵐᵒᵖ) M' N') := + (ExternalTensor.envelopingFunctor k A B).map + (ExternalTensor.mapHom k (A ⊗[k] Aᵐᵒᵖ) (B ⊗[k] Bᵐᵒᵖ) f g) + +@[simp] theorem coordinates_map (m : EnvelopingBimodule k A M) (n : EnvelopingBimodule k B N) : + EnvelopingBimodule.map (exteriorMap f g) + ((bimoduleCoordinates k A B M N).symm (m ⊗ₜ[k] n)) = + (bimoduleCoordinates k A B M' N').symm + ((EnvelopingBimodule.map f m) ⊗ₜ[k] (EnvelopingBimodule.map g n)) := by + apply EnvelopingBimodule.ext + rfl + +@[simp] theorem scalarCoordinates_map (x : X) (y : Y) : + (ExternalTensor.mapHom k A B h j).hom + ((ExternalTensor.moduleScalarCoordinates k A B X Y).symm (x ⊗ₜ[k] y)) = + (ExternalTensor.moduleScalarCoordinates k A B X' Y').symm + ((h.hom x) ⊗ₜ[k] (j.hom y)) := rfl + +theorem shuffle_natural : + (shuffle k A B M' N' X' Y').toLinearMap.comp + (balancedMap (exteriorMap f g) (ExternalTensor.mapHom k A B h j)) = + (ExternalTensor.map k A B (balancedMap f h) (balancedMap g j)).comp + (shuffle k A B M N X Y).toLinearMap := by + apply LinearMap.ext + intro z + induction z using BalancedTensor.induction_on with + | zero => simp + | add z w hz hw => simp only [map_add, hz, hw] + | tmul z w => + obtain ⟨z, rfl⟩ := (bimoduleCoordinates k A B M N).symm.surjective z + obtain ⟨w, rfl⟩ := (ExternalTensor.moduleScalarCoordinates k A B X Y).symm.surjective w + induction z using TensorProduct.inductionOn with + | add z z' hz hz' => simp only [map_add, BalancedTensor.add_tmul, hz, hz'] + | tmul m n => + induction w using TensorProduct.inductionOn with + | add w w' hw hw' => simp only [map_add, BalancedTensor.tmul_add, hw, hw'] + | tmul x y => + simp only [LinearMap.comp_apply, LinearEquiv.coe_coe, balancedMap_tmul, + coordinates_map, scalarCoordinates_map, shuffle_pure, ExternalTensor.map_tmul] + rfl + +end ArExplicit.ExternalBalanced + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedShuffle.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedShuffle.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a00b0914bcc2be4150ec7a9909a7a124ac541c1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalBalancedShuffle.lean @@ -0,0 +1,71 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalBalancedEquiv +import OAI.Algebra.AuslanderReiten.Tensor.ExternalBalancedCoordinates + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalBalanced +open CategoryTheory +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance 2000] moduleCatBaseModule moduleCatBaseTower +variable (M : ModuleCat.{u} (A ⊗[k] Aᵐᵒᵖ)) (N : ModuleCat.{u} (B ⊗[k] Bᵐᵒᵖ)) + (X : ModuleCat.{u} A) (Y : ModuleCat.{u} B) +local notation "FM" => EnvelopingBimodule k A M +local notation "FN" => EnvelopingBimodule k B N +local notation "BM" => BalancedTensor k A FM X +local notation "BN" => BalancedTensor k B FN Y +local notation "Src" => BalancedTensor k (A ⊗[k] B) (exteriorBimodule k A B M N) + (ExternalTensor.moduleObject k A B X Y) +local notation "Tgt" => ExternalTensor.moduleObject k A B BM BN + +def scalarShuffle : Src ≃ₗ[k] BM ⊗[k] BN := + equiv (bimoduleCoordinates k A B M N) (ExternalTensor.moduleScalarCoordinates k A B X Y) + (bimoduleCoordinates_right k A B M N) (fun _ _ _ _ => rfl) + +@[simp] theorem scalarShuffle_pure (m : FM) (n : FN) (x : X) (y : Y) : + scalarShuffle k A B M N X Y + (BalancedTensor.tmul ((bimoduleCoordinates k A B M N).symm (m ⊗ₜ[k] n)) + ((ExternalTensor.moduleScalarCoordinates k A B X Y).symm (x ⊗ₜ[k] y))) = + BalancedTensor.tmul (R := A) m x ⊗ₜ[k] BalancedTensor.tmul (R := B) n y := + equiv_pure _ _ _ _ m n x y + +theorem scalarShuffle_smul (r : A ⊗[k] B) (z : Src) : + scalarShuffle k A B M N X Y (r • z) = + ExternalTensor.representation k A B BM BN r (scalarShuffle k A B M N X Y z) := by + induction r using TensorProduct.inductionOn with + | add r s hr hs => simp only [add_smul, map_add, LinearMap.add_apply, hr, hs] + | tmul a b => + induction z using BalancedTensor.induction_on with + | zero => simp + | add z w hz hw => simp only [smul_add, map_add, hz, hw] + | tmul z w => + obtain ⟨z, rfl⟩ := (bimoduleCoordinates k A B M N).symm.surjective z + obtain ⟨w, rfl⟩ := (ExternalTensor.moduleScalarCoordinates k A B X Y).symm.surjective w + induction z using TensorProduct.inductionOn with + | add z z' hz hz' => simp only [map_add, BalancedTensor.add_tmul, smul_add, hz, hz'] + | tmul m n => + induction w using TensorProduct.inductionOn with + | add w w' hw hw' => simp only [map_add, BalancedTensor.tmul_add, smul_add, hw, hw'] + | tmul x y => + rw [BalancedTensor.smul_tmul, bimoduleCoordinates_left, scalarShuffle_pure, + scalarShuffle_pure] + rfl + +def shuffle : Src ≃ₗ[A ⊗[k] B] Tgt where + __ := (scalarShuffle k A B M N X Y).toAddEquiv + map_smul' := scalarShuffle_smul k A B M N X Y + +@[simp] theorem shuffle_pure (m : FM) (n : FN) (x : X) (y : Y) : + shuffle k A B M N X Y + (BalancedTensor.tmul ((bimoduleCoordinates k A B M N).symm (m ⊗ₜ[k] n)) + ((ExternalTensor.moduleScalarCoordinates k A B X Y).symm (x ⊗ₜ[k] y))) = + (BalancedTensor.tmul (R := A) m x ⊗ₜ[k] BalancedTensor.tmul (R := B) n y : Tgt) := + scalarShuffle_pure k A B M N X Y m n x y + +end ArExplicit.ExternalBalanced + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalEnveloping.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalEnveloping.lean new file mode 100644 index 0000000000000000000000000000000000000000..eff6d6bc3cdff6c7825757be248ed59890c30880 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalEnveloping.lean @@ -0,0 +1,90 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorProjective +import Mathlib.LinearAlgebra.TensorProduct.Opposite +import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped TensorProduct + +namespace ArExplicit.ExternalTensor + +attribute [local instance] RingHomInvPair.of_ringEquiv RingHomInvPair.of_ringEquiv_symm + +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] + +abbrev ProductEnveloping := (A ⊗[k] Aᵐᵒᵖ) ⊗[k] (B ⊗[k] Bᵐᵒᵖ) +abbrev EnvelopingProduct := (A ⊗[k] B) ⊗[k] (A ⊗[k] B)ᵐᵒᵖ + +def envelopingEquiv : ProductEnveloping k A B ≃ₐ[k] EnvelopingProduct k A B := + (Algebra.TensorProduct.tensorTensorTensorComm k k k k A Aᵐᵒᵖ B Bᵐᵒᵖ).trans + (Algebra.TensorProduct.congr (AlgEquiv.refl : (A ⊗[k] B) ≃ₐ[k] (A ⊗[k] B)) + (Algebra.TensorProduct.opAlgEquiv k k A B)) + +@[simp] theorem envelopingEquiv_tmul (a c : A) (b d : B) : + envelopingEquiv k A B ((a ⊗ₜ[k] MulOpposite.op c) ⊗ₜ[k] (b ⊗ₜ[k] MulOpposite.op d)) = + (a ⊗ₜ[k] b) ⊗ₜ[k] MulOpposite.op (c ⊗ₜ[k] d) := by + simp [envelopingEquiv] + +@[simp] theorem envelopingEquiv_symm_tmul (a c : A) (b d : B) : + (envelopingEquiv k A B).symm ((a ⊗ₜ[k] b) ⊗ₜ[k] MulOpposite.op (c ⊗ₜ[k] d)) = + (a ⊗ₜ[k] MulOpposite.op c) ⊗ₜ[k] (b ⊗ₜ[k] MulOpposite.op d) := by + apply (envelopingEquiv k A B).injective + simp + +abbrev envelopingFunctor : ModuleCat.{u} (ProductEnveloping k A B) ⥤ + ModuleCat.{u} (EnvelopingProduct k A B) := + ModuleCat.restrictScalars (envelopingEquiv k A B).symm.toRingHom + +abbrev envelopingObject (M : ModuleCat.{u} (ProductEnveloping k A B)) : + ModuleCat.{u} (EnvelopingProduct k A B) := (envelopingFunctor k A B).obj M + +private instance forwardInverse : RingHomInvPair (envelopingEquiv k A B).toRingHom + (envelopingEquiv k A B).symm.toRingHom where + comp_eq := by apply RingHom.ext; intro x; exact (envelopingEquiv k A B).symm_apply_apply x + comp_eq₂ := by apply RingHom.ext; intro x; exact (envelopingEquiv k A B).apply_symm_apply x + +private instance backwardInverse : RingHomInvPair (envelopingEquiv k A B).symm.toRingHom + (envelopingEquiv k A B).toRingHom where + comp_eq := by apply RingHom.ext; intro x; exact (envelopingEquiv k A B).apply_symm_apply x + comp_eq₂ := by apply RingHom.ext; intro x; exact (envelopingEquiv k A B).symm_apply_apply x + +def envelopingSemilinear (M : ModuleCat.{u} (ProductEnveloping k A B)) : + LinearEquiv (envelopingEquiv k A B).toRingHom + (σ' := (envelopingEquiv k A B).symm.toRingHom) M (envelopingObject k A B M) where + toFun x := x + invFun x := x + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' a x := by + change a • x = ((envelopingEquiv k A B).symm ((envelopingEquiv k A B) a)) • x + rw [AlgEquiv.symm_apply_apply] + +theorem enveloping_projective (M : ModuleCat.{u} (ProductEnveloping k A B)) + [Module.Projective (ProductEnveloping k A B) M] : + Module.Projective (EnvelopingProduct k A B) (envelopingObject k A B M) := + Module.Projective.of_equiv (envelopingSemilinear k A B M) + +instance envelopingBaseModule (M : ModuleCat.{u} (ProductEnveloping k A B)) [Module k M] : + Module k (envelopingObject k A B M) := inferInstanceAs (Module k M) + +instance envelopingTower (M : ModuleCat.{u} (ProductEnveloping k A B)) [Module k M] + [IsScalarTower k (ProductEnveloping k A B) M] : + IsScalarTower k (EnvelopingProduct k A B) (envelopingObject k A B M) := + IsScalarTower.of_algebraMap_smul (A := EnvelopingProduct k A B) fun a x => by + change (envelopingEquiv k A B).symm (algebraMap k (EnvelopingProduct k A B) a) • + (show M from x) = a • (show M from x) + rw [AlgEquiv.commutes, algebraMap_smul] + +instance envelopingFinite (M : ModuleCat.{u} (ProductEnveloping k A B)) [Module k M] + [Module.Finite k M] : Module.Finite k (envelopingObject k A B M) := + inferInstanceAs (Module.Finite k M) + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalEnvelopingScalar.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalEnvelopingScalar.lean new file mode 100644 index 0000000000000000000000000000000000000000..3488b29a0801b8eb3953fafa9ee93b5d2ae9fb60 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalEnvelopingScalar.lean @@ -0,0 +1,29 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalEnveloping +import OAI.Algebra.AuslanderReiten.BaseChange.ScalarExtensionComplete + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance 2000] moduleCatBaseModule moduleCatBaseTower + +def envelopingScalarEquiv (M : ModuleCat.{u} (ProductEnveloping k A B)) : + envelopingObject k A B M ≃ₗ[k] M where + toFun x := x + invFun x := x + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' a x := by + change (envelopingEquiv k A B).symm (algebraMap k (EnvelopingProduct k A B) a) • (show M from x) = + a • (show M from x) + rw [AlgEquiv.commutes, algebraMap_smul] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorAugmentation.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorAugmentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..6389b77346672b7988d8426e6fd29980a571bd48 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorAugmentation.lean @@ -0,0 +1,67 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorResolution +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorCubicDifferential + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory HomologicalComplex +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (M : ModuleCat.{u} A) (N : ModuleCat.{u} B) + +theorem singleTotalZeroEquiv_insert (x : moduleObject k A B M N) : + singleTotalZeroEquiv k A B M N + (cubicInsert k A B ((ChainComplex.single₀ (ModuleCat A)).obj M) + ((ChainComplex.single₀ (ModuleCat B)).obj N) 0 ⟨(0,0),rfl⟩ x) = x := by + let e := termDirectSumEquiv k A B ((ChainComplex.single₀ (ModuleCat A)).obj M) + ((ChainComplex.single₀ (ModuleCat B)).obj N) 0 + change (e (e.symm (DFinsupp.single ⟨(0,0),rfl⟩ x))) ⟨(0,0),rfl⟩ = x + rw [LinearEquiv.apply_symm_apply] + exact DFinsupp.single_eq_same + +theorem singleTotalIso_inclusion : + inclusion k A B ((ChainComplex.single₀ (ModuleCat A)).obj M) + ((ChainComplex.single₀ (ModuleCat B)).obj N) 0 0 0 rfl ≫ + (singleTotalIso k A B M N).hom.f 0 = 𝟙 (moduleObject k A B M N) := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro x + change singleTotalZeroEquiv k A B M N + ((inclusion k A B ((ChainComplex.single₀ (ModuleCat A)).obj M) + ((ChainComplex.single₀ (ModuleCat B)).obj N) 0 0 0 rfl).hom x) = x + rw [inclusion_eq_cubicInsert] + exact singleTotalZeroEquiv_insert k A B M N x + +variable {M N} (P : ProjectiveResolution M) (Q : ProjectiveResolution N) + +theorem inclusion_augmentation : + inclusion k A B P.complex Q.complex 0 0 0 rfl ≫ (augmentation k A B P Q).f 0 = + mapHom k A B (P.π.f 0) (Q.π.f 0) := by + unfold augmentation + rw [HomologicalComplex.comp_f, ← Category.assoc] + rw [show inclusion k A B P.complex Q.complex 0 0 0 rfl ≫ + (mapBifunctorMap P.π Q.π (bifunctor k A B) (ComplexShape.down ℕ)).f 0 = + ((bifunctor k A B).map (P.π.f 0)).app (Q.complex.X 0) ≫ + ((bifunctor k A B).obj (((ChainComplex.single₀ (ModuleCat A)).obj M).X 0)).map (Q.π.f 0) ≫ + inclusion k A B ((ChainComplex.single₀ (ModuleCat A)).obj M) + ((ChainComplex.single₀ (ModuleCat B)).obj N) 0 0 0 rfl from + ι_mapBifunctorMap P.π Q.π (bifunctor k A B) (ComplexShape.down ℕ) 0 0 0 rfl] + erw [Category.assoc, Category.assoc, singleTotalIso_inclusion, Category.comp_id] + change mapHom k A B (P.π.f 0) (𝟙 _) ≫ mapHom k A B (𝟙 _) (Q.π.f 0) = _ + rw [← mapHom_comp, Category.comp_id, Category.id_comp] + +theorem augmentation_insert (x : moduleObject k A B (P.complex.X 0) (Q.complex.X 0)) : + (augmentation k A B P Q).f 0 (cubicInsert k A B P.complex Q.complex 0 ⟨(0,0),rfl⟩ x) = + mapHom k A B (P.π.f 0) (Q.π.f 0) x := by + have h := congrArg (fun f => f.hom x) (inclusion_augmentation k A B P Q) + simp only [ModuleCat.hom_comp, LinearMap.comp_apply, inclusion_eq_cubicInsert] at h + convert! h using 1 + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorBottom.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorBottom.lean new file mode 100644 index 0000000000000000000000000000000000000000..e38fa8aa3fbddfafd777083c119cb3a4851aa554 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorBottom.lean @@ -0,0 +1,60 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorCubicDifferential + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) +local notation "E" => A ⊗[k] B + +def bottomProjection (n : ℕ) : (complex k A B P Q).X n →ₗ[E] + moduleObject k A B (P.X n) (Q.X 0) := + (DFinsupp.lapply ⟨(n,0), Nat.add_zero n⟩).comp + (termDirectSumEquiv k A B P Q n).toLinearMap + +@[simp] theorem bottomProjection_bottom (n : ℕ) + (x : moduleObject k A B (P.X n) (Q.X 0)) : + bottomProjection k A B P Q n (cubicInsert k A B P Q n ⟨(n,0), Nat.add_zero n⟩ x) = x := by + simp [bottomProjection, cubicInsert] + +@[simp] theorem bottomProjection_positive (n i j : ℕ) (h : i+(j+1)=n) + (x : moduleObject k A B (P.X i) (Q.X (j+1))) : + bottomProjection k A B P Q n (cubicInsert k A B P Q n ⟨(i,j+1),h⟩ x) = 0 := by + have hh : (⟨(n,0), Nat.add_zero n⟩ : Diagonal n) ≠ ⟨(i,j+1),h⟩ := by + intro he + have := congrArg (fun t : Diagonal n => t.val.2) he + simp only at this + omega + simp [bottomProjection, cubicInsert, DFinsupp.single_apply, Ne.symm hh] + +variable (U : ChainComplex (ModuleCat.{u} A) ℕ) (V : ChainComplex (ModuleCat.{u} B) ℕ) + +def bottomMap (s t : ℕ) (f : U.X s ⟶ P.X t) (g : V.X 0 ⟶ Q.X 0) : + (complex k A B U V).X s →ₗ[E] (complex k A B P Q).X t := + (cubicInsert k A B P Q t ⟨(t,0),Nat.add_zero t⟩).comp + ((map k A B f.hom g.hom).comp (bottomProjection k A B U V s)) + +@[simp] theorem bottomMap_bottom (s t : ℕ) (f : U.X s ⟶ P.X t) (g : V.X 0 ⟶ Q.X 0) + (x : moduleObject k A B (U.X s) (V.X 0)) : + bottomMap k A B P Q U V s t f g + (cubicInsert k A B U V s ⟨(s,0),Nat.add_zero s⟩ x) = + cubicInsert k A B P Q t ⟨(t,0),Nat.add_zero t⟩ (map k A B f.hom g.hom x) := by + simp only [bottomMap, LinearMap.comp_apply, bottomProjection_bottom] + +@[simp] theorem bottomMap_positive (s t i j : ℕ) (h : i+(j+1)=s) + (f : U.X s ⟶ P.X t) (g : V.X 0 ⟶ Q.X 0) + (x : moduleObject k A B (U.X i) (V.X (j+1))) : + bottomMap k A B P Q U V s t f g + (cubicInsert k A B U V s ⟨(i,j+1),h⟩ x) = 0 := by + simp only [bottomMap, LinearMap.comp_apply, bottomProjection_positive, map_zero] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorBottomCubic.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorBottomCubic.lean new file mode 100644 index 0000000000000000000000000000000000000000..bcd9894fba8288672699add7ec05ae9460c7e2f6 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorBottomCubic.lean @@ -0,0 +1,52 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorBottomDifferential + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P U : ChainComplex (ModuleCat.{u} A) ℕ) (Q V : ChainComplex (ModuleCat.{u} B) ℕ) +local notation "E" => A ⊗[k] B + +theorem bottomMap_add (s t : ℕ) (f f' : U.X s ⟶ P.X t) (g : V.X 0 ⟶ Q.X 0) : + bottomMap k A B P Q U V s t (f+f') g = + bottomMap k A B P Q U V s t f g + bottomMap k A B P Q U V s t f' g := by + apply LinearMap.ext + intro x + have hh := congrArg (fun h => h.hom (bottomProjection k A B U V s x)) + (mapHom_add_left k A B f f' g) + change map k A B (f+f').hom g.hom _ = + map k A B f.hom g.hom _ + map k A B f'.hom g.hom _ at hh + simpa only [bottomMap, LinearMap.comp_apply, LinearMap.add_apply, map_add] using + congrArg (cubicInsert k A B P Q t ⟨(t,0),Nat.add_zero t⟩) hh + +theorem firstCubic_bottomMap (p : (n : ℕ) → P.X (n+3) ⟶ P.X n) + (s n : ℕ) (f : U.X s ⟶ P.X (n+3)) (g : V.X 0 ⟶ Q.X 0) : + (firstCubic k A B P Q p n).comp (bottomMap k A B P Q U V s (n+3) f g) = + bottomMap k A B P Q U V s n (f ≫ p n) g := by + apply LinearMap.ext + intro x + simp only [LinearMap.comp_apply, bottomMap, firstCubic_insert, firstCubicEntry] + congr 1 + have hh := map_comp_apply k A B f (p n) g (𝟙 (Q.X 0)) + (bottomProjection k A B U V s x) + simp only [Category.comp_id] at hh + convert! hh using 1 + +theorem secondCubic_bottomMap (r : (n : ℕ) → Q.X (n+3) ⟶ Q.X n) + (s n : ℕ) (f : U.X s ⟶ P.X (n+3)) (g : V.X 0 ⟶ Q.X 0) : + (secondCubic k A B P Q r n).comp (bottomMap k A B P Q U V s (n+3) f g) = 0 := by + apply LinearMap.ext + intro x + simp only [LinearMap.comp_apply, bottomMap, secondCubic_insert, secondCubicEntry, + LinearMap.zero_apply] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorBottomDifferential.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorBottomDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..e727bfb96ad23ea8695ab1bb368d783189d9b8a1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorBottomDifferential.lean @@ -0,0 +1,108 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorBottom + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P U : ChainComplex (ModuleCat.{u} A) ℕ) (Q V : ChainComplex (ModuleCat.{u} B) ℕ) +local notation "E" => A ⊗[k] B + +private theorem hom_zero_apply {M N : ModuleCat.{u} E} (x : M) : (0 : M ⟶ N) x = 0 := rfl + +theorem map_comp_apply {M₀ M₁ M₂ : ModuleCat.{u} A} {N₀ N₁ N₂ : ModuleCat.{u} B} + (f : M₀ ⟶ M₁) (f' : M₁ ⟶ M₂) (g : N₀ ⟶ N₁) (g' : N₁ ⟶ N₂) + (x : moduleObject k A B M₀ N₀) : + map k A B f'.hom g'.hom (map k A B f.hom g.hom x) = + map k A B (f ≫ f').hom (g ≫ g').hom x := + (congrArg (fun h => h.hom x) (mapHom_comp k A B f f' g g')).symm + +@[simp] theorem map_zero_right_apply {M M' : ModuleCat.{u} A} {N N' : ModuleCat.{u} B} + (f : M ⟶ M') (x : moduleObject k A B M N) : + map k A B f.hom (0 : N →ₗ[B] N') x = 0 := by + let y : M ⊗[k] N := x + change TensorProduct.map (f.hom.restrictScalars k) (0 : N →ₗ[k] N') y = 0 + rw [TensorProduct.map_zero_right, LinearMap.zero_apply] + +theorem bottomMap_d_target (s t : ℕ) (f : U.X s ⟶ P.X (t+1)) (g : V.X 0 ⟶ Q.X 0) : + ((complex k A B P Q).d (t+1) t).hom.comp (bottomMap k A B P Q U V s (t+1) f g) = + bottomMap k A B P Q U V s t (f ≫ P.d (t+1) t) g := by + apply cubic_hom_ext k A B U V s + rintro ⟨⟨i,j⟩,h⟩ x + cases j with + | zero => + have hi : i=s := by simpa using h + subst i + simp only [LinearMap.comp_apply, bottomMap_bottom, cubicInsert_d, + horizontal_succ_apply k A B P Q t 0 t (Nat.add_zero t), vertical_zero, + hom_zero_apply, add_zero] + congr 1 + have hh := map_comp_apply k A B f (P.d (t+1) t) g (𝟙 (Q.X 0)) x + simp only [Category.comp_id] at hh + convert! hh using 1 + | succ j => simp only [LinearMap.comp_apply, bottomMap_positive, map_zero] + +variable [CharP k 2] + +theorem bottomMap_d_source (s t : ℕ) (f : U.X s ⟶ P.X t) (g : V.X 0 ⟶ Q.X 0) + (hg : V.d 1 0 ≫ g = 0) : + (bottomMap k A B P Q U V s t f g).comp ((complex k A B U V).d (s+1) s).hom = + bottomMap k A B P Q U V (s+1) t (U.d (s+1) s ≫ f) g := by + apply cubic_hom_ext k A B U V (s+1) + rintro ⟨⟨i,j⟩,h⟩ x + cases j with + | zero => + have hi : i=s+1 := by simpa using h + subst i + simp only [LinearMap.comp_apply, cubicInsert_d, + horizontal_succ_apply k A B U V s 0 s (Nat.add_zero s), vertical_zero, + hom_zero_apply, add_zero, bottomMap_bottom] + congr 1 + have hh := map_comp_apply k A B (U.d (s+1) s) f (𝟙 (V.X 0)) g x + simp only [Category.id_comp] at hh + convert! hh using 1 + | succ j => + cases j with + | zero => + have hi : i=s := by omega + subst i + cases s with + | zero => + simp only [LinearMap.comp_apply, cubicInsert_d, horizontal_zero, hom_zero_apply, + vertical_succ_apply k A B U V 0 0 0 rfl, zero_add, bottomMap_bottom, + bottomMap_positive] + have hh := map_comp_apply k A B (𝟙 (U.X 0)) f (V.d 1 0) g x + simp only [Category.id_comp, hg, ModuleCat.hom_zero, map_zero_right_apply] at hh + have he : map k A B f.hom g.hom (map k A B LinearMap.id (V.d 1 0).hom x) = 0 := by + convert! hh using 1 + rw [he, map_zero] + | succ s => + simp only [LinearMap.comp_apply, cubicInsert_d, + horizontal_succ_apply k A B U V s 1 (s+1) rfl, + vertical_succ_apply k A B U V (s+1) 0 (s+1) (Nat.add_zero _), map_add, + bottomMap_positive, bottomMap_bottom, zero_add] + have hh := map_comp_apply k A B (𝟙 (U.X (s+1))) f (V.d 1 0) g x + simp only [Category.id_comp, hg, ModuleCat.hom_zero, map_zero_right_apply] at hh + have he : map k A B f.hom g.hom (map k A B LinearMap.id (V.d 1 0).hom x) = 0 := by + convert! hh using 1 + rw [he, map_zero] + | succ j => + cases i with + | zero => + simp (disch := omega) only [LinearMap.comp_apply, cubicInsert_d, + horizontal_zero, hom_zero_apply, vertical_succ_apply, zero_add, + bottomMap_positive] + | succ i => + simp (disch := omega) only [LinearMap.comp_apply, cubicInsert_d, + horizontal_succ_apply, vertical_succ_apply, map_add, bottomMap_positive, + zero_add] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorComplex.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorComplex.lean new file mode 100644 index 0000000000000000000000000000000000000000..b48432a84fc5839ad6ea4eb06b1d2d9bfda6e415 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorComplex.lean @@ -0,0 +1,68 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorFunctor +import Mathlib.Algebra.Homology.Bifunctor +import Mathlib.Algebra.Category.ModuleCat.Colimits +import Mathlib.Algebra.Category.ModuleCat.Products +import Mathlib.Data.Finset.NatAntidiagonal + +namespace OAI + +noncomputable section + +namespace ArExplicit.ExternalTensor + +open CategoryTheory CategoryTheory.Limits +open scoped TensorProduct + +universe u + +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] + +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) + +instance hasTotal : HomologicalComplex.HasMapBifunctor P Q (bifunctor k A B) (ComplexShape.down ℕ) := + fun _ => inferInstance + +abbrev complex : ChainComplex (ModuleCat.{u} (A ⊗[k] B)) ℕ := + HomologicalComplex.mapBifunctor P Q (bifunctor k A B) (ComplexShape.down ℕ) + +abbrev Diagonal (n : ℕ) := {p : ℕ × ℕ // p.1 + p.2 = n} + +instance (n : ℕ) : Fintype (Diagonal n) := + Fintype.ofFinset (Finset.antidiagonal n) (by intro p; exact Finset.mem_antidiagonal) + +abbrev summands (n : ℕ) (p : Diagonal n) : ModuleCat.{u} (A ⊗[k] B) := + moduleObject k A B (P.X p.val.1) (Q.X p.val.2) + +def termDirectSumEquiv (n : ℕ) : + (complex k A B P Q).X n ≃ₗ[A ⊗[k] B] (Π₀ p : Diagonal n, summands k A B P Q n p) := + CategoryTheory.Iso.toLinearEquiv (ModuleCat.coprodIsoDirectSum (summands k A B P Q n)) + +def termPiEquiv (n : ℕ) : + (complex k A B P Q).X n ≃ₗ[A ⊗[k] B] (∀ p : Diagonal n, summands k A B P Q n p) := + (termDirectSumEquiv k A B P Q n).trans DFinsupp.linearEquivFunOnFintype + +variable [Module.Finite k A] [Module.Finite k B] +variable [∀ n, Module.Finite A (P.X n)] [∀ n, Module.Finite B (Q.X n)] + +theorem term_finite (n : ℕ) : Module.Finite (A ⊗[k] B) ((complex k A B P Q).X n) := by + let (index : ℕ) : Module.Finite k (P.X index) := Module.Finite.trans A (P.X index) + let (index : ℕ) : Module.Finite k (Q.X index) := Module.Finite.trans B (Q.X index) + let (index : Diagonal n) : Module.Finite (A ⊗[k] B) (summands k A B P Q n index) := + Module.Finite.of_restrictScalars_finite k (A ⊗[k] B) _ + exact Module.Finite.equiv (termPiEquiv k A B P Q n).symm + +variable [∀ n, Module.Projective A (P.X n)] [∀ n, Module.Projective B (Q.X n)] + +omit [Module.Finite k A] [Module.Finite k B] in +theorem term_projective (n : ℕ) : Module.Projective (A ⊗[k] B) ((complex k A B P Q).X n) := by + let (index : Diagonal n) : Module.Projective (A ⊗[k] B) (summands k A B P Q n index) := + projective k A B + exact Module.Projective.of_equiv (termDirectSumEquiv k A B P Q n).symm + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCoordinates.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea479bc9b999c1cd7ed6cc149701dc1e321bfaf9 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCoordinates.lean @@ -0,0 +1,29 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorModule +import OAI.Algebra.AuslanderReiten.BaseChange.ScalarExtensionComplete + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance 2000] moduleCatBaseModule moduleCatBaseTower + +def moduleScalarCoordinates (M : ModuleCat.{u} A) (N : ModuleCat.{u} B) : + moduleObject k A B M N ≃ₗ[k] (M ⊗[k] N) where + toFun x := x + invFun x := x + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' a x := by + change representation k A B M N (algebraMap k (A ⊗[k] B) a) x = a • (show M ⊗[k] N from x) + rw [AlgHom.commutes] + rfl + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubic.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubic.lean new file mode 100644 index 0000000000000000000000000000000000000000..92186ef282457226971d658ed04589a6f48a2fe2 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubic.lean @@ -0,0 +1,66 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorComplex + +namespace OAI + +noncomputable section + +namespace ArExplicit.ExternalTensor + +open CategoryTheory +open scoped TensorProduct + +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) +local notation "E" => A ⊗[k] B + +def cubicInsert (n : ℕ) (ij : Diagonal n) : + summands k A B P Q n ij →ₗ[E] (complex k A B P Q).X n := + (termDirectSumEquiv k A B P Q n).symm.toLinearMap.comp (DFinsupp.lsingle (R := E) + (M := fun t : Diagonal n => ↥(summands k A B P Q n t)) ij) + +variable (p : (n : ℕ) → P.X (n+3) ⟶ P.X n) +variable (r : (n : ℕ) → Q.X (n+3) ⟶ Q.X n) + +def firstCubicEntry (n : ℕ) : (ij : Diagonal (n+3)) → + summands k A B P Q (n+3) ij →ₗ[E] (complex k A B P Q).X n + | ⟨(0, _), _⟩ => 0 + | ⟨(1, _), _⟩ => 0 + | ⟨(2, _), _⟩ => 0 + | ⟨(i+3, j), h⟩ => (cubicInsert k A B P Q n ⟨(i,j), by omega⟩).comp + (map k A B (p i).hom (LinearMap.id : Q.X j →ₗ[B] Q.X j)) + +def secondCubicEntry (n : ℕ) : (ij : Diagonal (n+3)) → + summands k A B P Q (n+3) ij →ₗ[E] (complex k A B P Q).X n + | ⟨(_, 0), _⟩ => 0 + | ⟨(_, 1), _⟩ => 0 + | ⟨(_, 2), _⟩ => 0 + | ⟨(i, j+3), h⟩ => (cubicInsert k A B P Q n ⟨(i,j), by omega⟩).comp + (map k A B (LinearMap.id : P.X i →ₗ[A] P.X i) (r j).hom) + +def firstCubic (n : ℕ) : (complex k A B P Q).X (n+3) →ₗ[E] (complex k A B P Q).X n := + (DFinsupp.coprodMap (firstCubicEntry k A B P Q p n)).comp + (termDirectSumEquiv k A B P Q (n+3)).toLinearMap + +def secondCubic (n : ℕ) : (complex k A B P Q).X (n+3) →ₗ[E] (complex k A B P Q).X n := + (DFinsupp.coprodMap (secondCubicEntry k A B P Q r n)).comp + (termDirectSumEquiv k A B P Q (n+3)).toLinearMap + +@[simp] theorem firstCubic_insert (n : ℕ) (ij : Diagonal (n+3)) + (x : summands k A B P Q (n+3) ij) : + firstCubic k A B P Q p n (cubicInsert k A B P Q (n+3) ij x) = + firstCubicEntry k A B P Q p n ij x := by + simp [firstCubic, cubicInsert, DFinsupp.coprodMap_apply_single] + +@[simp] theorem secondCubic_insert (n : ℕ) (ij : Diagonal (n+3)) + (x : summands k A B P Q (n+3) ij) : + secondCubic k A B P Q r n (cubicInsert k A B P Q (n+3) ij x) = + secondCubicEntry k A B P Q r n ij x := by + simp [secondCubic, cubicInsert, DFinsupp.coprodMap_apply_single] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicChain.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicChain.lean new file mode 100644 index 0000000000000000000000000000000000000000..436e93098c4c0e8b712a11302e84ade5516bb9ea --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicChain.lean @@ -0,0 +1,83 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorCubicDifferential + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) +local notation "E" => A ⊗[k] B + +private theorem hom_zero_apply {M N : ModuleCat.{u} E} (x : M) : (0 : M ⟶ N) x = 0 := rfl + +variable (p : (n : ℕ) → P.X (n+3) ⟶ P.X n) +variable (r : (n : ℕ) → Q.X (n+3) ⟶ Q.X n) +variable (hp : ∀ n, p (n+1) ≫ P.d (n+1) n = P.d (n+4) (n+3) ≫ p n) +variable (hr : ∀ n, r (n+1) ≫ Q.d (n+1) n = Q.d (n+4) (n+3) ≫ r n) + +include hp in +private theorem first_map_chain (i j : ℕ) + (x : moduleObject k A B (P.X (i+4)) (Q.X j)) : + map k A B (P.d (i+1) i).hom (LinearMap.id : Q.X j →ₗ[B] Q.X j) + (map k A B (p (i+1)).hom (LinearMap.id : Q.X j →ₗ[B] Q.X j) x) = + map k A B (p i).hom (LinearMap.id : Q.X j →ₗ[B] Q.X j) + (map k A B (P.d (i+4) (i+3)).hom (LinearMap.id : Q.X j →ₗ[B] Q.X j) x) := by + have hh := congrArg (fun f => mapHom k A B f (𝟙 (Q.X j))) (hp i) + rw [show 𝟙 (Q.X j) = 𝟙 (Q.X j) ≫ 𝟙 (Q.X j) from (Category.id_comp _).symm, + mapHom_comp, mapHom_comp] at hh + exact congrArg (fun f => f.hom x) hh + +variable [CharP k 2] + +include hp in + +theorem firstCubic_chain (n : ℕ) : + ((complex k A B P Q).d (n+1) n).hom.comp (firstCubic k A B P Q p (n+1)) = + (firstCubic k A B P Q p n).comp ((complex k A B P Q).d (n+4) (n+3)).hom := by + apply cubic_hom_ext k A B P Q (n+4) + rintro ⟨⟨i,j⟩,h⟩ x + simp only [LinearMap.comp_apply, firstCubic_insert, cubicInsert_d] + rcases i with _ | (_ | (_ | (_ | i))) <;> rcases j with _ | j + all_goals simp (disch := omega) only [firstCubicEntry, LinearMap.comp_apply, map_zero, + cubicInsert_d, horizontal_zero, vertical_zero, hom_zero_apply, + horizontal_succ_apply, vertical_succ_apply, map_add, add_zero, zero_add, + firstCubic_insert, LinearMap.zero_apply] + all_goals simp only [first_map_chain k A B P Q p hp, map_interchange k A B] + +omit [CharP k 2] in +include hr in +private theorem second_map_chain (i j : ℕ) + (x : moduleObject k A B (P.X i) (Q.X (j+4))) : + map k A B (LinearMap.id : P.X i →ₗ[A] P.X i) (Q.d (j+1) j).hom + (map k A B (LinearMap.id : P.X i →ₗ[A] P.X i) (r (j+1)).hom x) = + map k A B (LinearMap.id : P.X i →ₗ[A] P.X i) (r j).hom + (map k A B (LinearMap.id : P.X i →ₗ[A] P.X i) (Q.d (j+4) (j+3)).hom x) := by + have hh := congrArg (fun f => mapHom k A B (𝟙 (P.X i)) f) (hr j) + rw [show 𝟙 (P.X i) = 𝟙 (P.X i) ≫ 𝟙 (P.X i) from (Category.id_comp _).symm, + mapHom_comp, mapHom_comp] at hh + exact congrArg (fun f => f.hom x) hh + +include hr in + +theorem secondCubic_chain (n : ℕ) : + ((complex k A B P Q).d (n+1) n).hom.comp (secondCubic k A B P Q r (n+1)) = + (secondCubic k A B P Q r n).comp ((complex k A B P Q).d (n+4) (n+3)).hom := by + apply cubic_hom_ext k A B P Q (n+4) + rintro ⟨⟨i,j⟩,h⟩ x + simp only [LinearMap.comp_apply, secondCubic_insert, cubicInsert_d] + rcases j with _ | (_ | (_ | (_ | j))) <;> rcases i with _ | i + all_goals simp (disch := omega) only [secondCubicEntry, LinearMap.comp_apply, map_zero, + cubicInsert_d, horizontal_zero, vertical_zero, hom_zero_apply, + horizontal_succ_apply, vertical_succ_apply, map_add, add_zero, zero_add, + secondCubic_insert, LinearMap.zero_apply] + all_goals simp only [second_map_chain k A B P Q r hr, map_interchange k A B] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicComm.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicComm.lean new file mode 100644 index 0000000000000000000000000000000000000000..b61da604a3278fc822ae182717ac6e2bbfbb6ce9 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicComm.lean @@ -0,0 +1,61 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorCubic + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor + +open CategoryTheory +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) +local notation "E" => A ⊗[k] B + +theorem cubic_hom_ext {V : Type u} [AddCommGroup V] [Module E V] (n : ℕ) + (f g : (complex k A B P Q).X n →ₗ[E] V) + (h : ∀ (ij : Diagonal n) (x : summands k A B P Q n ij), + f (cubicInsert k A B P Q n ij x) = g (cubicInsert k A B P Q n ij x)) : f = g := by + have hh : f.comp (termDirectSumEquiv k A B P Q n).symm.toLinearMap = + g.comp (termDirectSumEquiv k A B P Q n).symm.toLinearMap := by + apply DFinsupp.lhom_ext + intro ij x + exact h ij x + apply LinearMap.ext + intro x + have hx := DFunLike.congr_fun hh (termDirectSumEquiv k A B P Q n x) + simpa only [LinearMap.comp_apply, LinearEquiv.coe_coe, LinearEquiv.symm_apply_apply] using hx + +theorem map_interchange {M M' : ModuleCat.{u} A} {N N' : ModuleCat.{u} B} + (f : M ⟶ M') (g : N ⟶ N') (x : moduleObject k A B M N) : + map k A B f.hom (LinearMap.id : N' →ₗ[B] N') + (map k A B (LinearMap.id : M →ₗ[A] M) g.hom x) = + map k A B (LinearMap.id : M' →ₗ[A] M') g.hom + (map k A B f.hom (LinearMap.id : N →ₗ[B] N) x) := by + have h : mapHom k A B (𝟙 M) g ≫ mapHom k A B f (𝟙 N') = + mapHom k A B f (𝟙 N) ≫ mapHom k A B (𝟙 M') g := by + rw [← mapHom_comp, ← mapHom_comp] + simp only [Category.id_comp, Category.comp_id] + exact congrArg (fun t => t.hom x) h + +variable (p : (n : ℕ) → P.X (n+3) ⟶ P.X n) +variable (r : (n : ℕ) → Q.X (n+3) ⟶ Q.X n) + +theorem cubic_commute (n : ℕ) : + (firstCubic k A B P Q p n).comp (secondCubic k A B P Q r (n+3)) = + (secondCubic k A B P Q r n).comp (firstCubic k A B P Q p (n+3)) := by + apply cubic_hom_ext k A B P Q (n+3+3) + rintro ⟨⟨i,j⟩,h⟩ x + simp only [LinearMap.comp_apply, firstCubic_insert, secondCubic_insert] + rcases i with _ | (_ | (_ | i)) <;> rcases j with _ | (_ | (_ | j)) + all_goals simp only [firstCubicEntry, secondCubicEntry, LinearMap.zero_apply, + LinearMap.comp_apply, firstCubic_insert, secondCubic_insert, map_zero] + exact congrArg (cubicInsert k A B P Q n ⟨(i,j), by omega⟩) + (map_interchange k A B (p i) (r j) x) + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicDifferential.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..c04cdb4faa6cd1f200d1e4315a79e192d8b7a9a5 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicDifferential.lean @@ -0,0 +1,70 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorCubicComm +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorDifferential + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor + +open CategoryTheory +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) +local notation "E" => A ⊗[k] B + +@[simp] theorem inclusion_eq_cubicInsert (i j n : ℕ) (h : i+j=n) : + (inclusion k A B P Q i j n h).hom = cubicInsert k A B P Q n ⟨(i,j),h⟩ := + inclusion_eq_directSum k A B P Q i j n h + +theorem cubicInsert_d (i j n m : ℕ) (h : i+j=n) + (x : moduleObject k A B (P.X i) (Q.X j)) : + (complex k A B P Q).d n m (cubicInsert k A B P Q n ⟨(i,j),h⟩ x) = + horizontal k A B P Q i j m x + vertical k A B P Q i j m x := by + have hh := congrArg (fun f => f.hom x) (inclusion_d k A B P Q i j n m h) + simpa only [ModuleCat.hom_comp, LinearMap.comp_apply, inclusion_eq_cubicInsert, + ModuleCat.hom_add, LinearMap.add_apply] using hh + +@[simp] theorem horizontal_succ_apply (i j n : ℕ) (h : i+j=n) + (x : moduleObject k A B (P.X (i+1)) (Q.X j)) : + horizontal k A B P Q (i+1) j n x = + cubicInsert k A B P Q n ⟨(i,j),h⟩ + (map k A B (P.d (i+1) i).hom (LinearMap.id : Q.X j →ₗ[B] Q.X j) x) := by + rw [horizontal_succ k A B P Q i j n h] + change (inclusion k A B P Q i j n h).hom _ = _ + rw [inclusion_eq_cubicInsert] + rfl + +variable [CharP k 2] + +private theorem module_neg_eq (M : ModuleCat.{u} E) (x : M) : -x=x := by + apply neg_eq_iff_add_eq_zero.mpr + have ht : (2 : k)=0 := CharP.cast_eq_zero k 2 + rw [← two_smul k, ht, zero_smul] + +private theorem signed_hom_eq {M N : ModuleCat.{u} E} (f : M ⟶ N) (v : ℤˣ) : v • f = f := by + rcases Int.units_eq_one_or v with rfl | rfl + · exact one_smul _ _ + · change (-1 : ℤ) • f = f + rw [neg_one_smul] + apply ModuleCat.hom_ext + apply LinearMap.ext + intro x + exact module_neg_eq k A B N (f x) + +@[simp] theorem vertical_succ_apply (i j n : ℕ) (h : i+j=n) + (x : moduleObject k A B (P.X i) (Q.X (j+1))) : + vertical k A B P Q i (j+1) n x = + cubicInsert k A B P Q n ⟨(i,j),h⟩ + (map k A B (LinearMap.id : P.X i →ₗ[A] P.X i) (Q.d (j+1) j).hom x) := by + rw [vertical_succ k A B P Q i j n h, signed_hom_eq k A B] + change (inclusion k A B P Q i j n h).hom _ = _ + rw [inclusion_eq_cubicInsert] + rfl + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicExt.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..7dedb0557c4f995b92642a22a00ead3485323bfb --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicExt.lean @@ -0,0 +1,87 @@ +import OAI.Algebra.AuslanderReiten.Ext.CubicExtAction +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorHomCubic +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorResolution + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable [CharP k 2] [Module.Finite k A] [Module.Finite k B] +variable [HasDerivedCategory (ModuleCat.{u} (A ⊗[k] B))] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable {X : ModuleCat.{u} A} {Y : ModuleCat.{u} B} +variable (P : ProjectiveResolution X) (Q : ProjectiveResolution Y) +variable [∀ n, Module.Finite A (P.complex.X n)] [∀ n, Module.Finite B (Q.complex.X n)] +variable (p : ∀ n, P.complex.X (n+3) ⟶ P.complex.X n) +variable (r : ∀ n, Q.complex.X (n+3) ⟶ Q.complex.X n) + +def firstComparison (n : ℕ) : (projectiveResolution k A B P Q).complex.X (n+3) ⟶ + (projectiveResolution k A B P Q).complex.X n := + ModuleCat.ofHom (firstCubic k A B P.complex Q.complex p n) + +def secondComparison (n : ℕ) : (projectiveResolution k A B P Q).complex.X (n+3) ⟶ + (projectiveResolution k A B P Q).complex.X n := + ModuleCat.ofHom (secondCubic k A B P.complex Q.complex r n) + +variable (hp : ∀ n, p (n+1) ≫ P.complex.d (n+1) n = P.complex.d (n+4) (n+3) ≫ p n) +variable (hr : ∀ n, r (n+1) ≫ Q.complex.d (n+1) n = Q.complex.d (n+4) (n+3) ≫ r n) + +include hp in +omit [Module.Finite k A] [Module.Finite k B] + [HasDerivedCategory (ModuleCat.{u} (A ⊗[k] B))] in +theorem firstComparison_comm (n : ℕ) : + firstComparison k A B P Q p (n+1) ≫ (projectiveResolution k A B P Q).complex.d (n+1) n = + (projectiveResolution k A B P Q).complex.d (n+4) (n+3) ≫ firstComparison k A B P Q p n := + ModuleCat.hom_ext (firstCubic_chain k A B P.complex Q.complex p hp n) + +include hr in +omit [Module.Finite k A] [Module.Finite k B] + [HasDerivedCategory (ModuleCat.{u} (A ⊗[k] B))] in +theorem secondComparison_comm (n : ℕ) : + secondComparison k A B P Q r (n+1) ≫ (projectiveResolution k A B P Q).complex.d (n+1) n = + (projectiveResolution k A B P Q).complex.d (n+4) (n+3) ≫ secondComparison k A B P Q r n := + ModuleCat.hom_ext (secondCubic_chain k A B P.complex Q.complex r hr n) + +def firstCubicExt : Ext (moduleObject k A B X Y) (moduleObject k A B X Y) 3 := + ResolutionProducts.endExt (projectiveResolution k A B P Q) + (ResolutionProducts.natCubicCocycle (k := k) (projectiveResolution k A B P Q) + (firstComparison k A B P Q p) (firstComparison_comm k A B P Q p hp)) + +def secondCubicExt : Ext (moduleObject k A B X Y) (moduleObject k A B X Y) 3 := + ResolutionProducts.endExt (projectiveResolution k A B P Q) + (ResolutionProducts.natCubicCocycle (k := k) (projectiveResolution k A B P Q) + (secondComparison k A B P Q r) (secondComparison_comm k A B P Q r hr)) + +omit [Module.Finite k A] [Module.Finite k B] in +theorem firstCubicExt_action {N : ModuleCat.{u} (A ⊗[k] B)} {n : ℕ} + (f : (projectiveResolution k A B P Q).complex.X n ⟶ N) + (hf : (projectiveResolution k A B P Q).complex.d (n+1) n ≫ f=0) : + (firstCubicExt k A B P Q p hp).comp ((projectiveResolution k A B P Q).extMk f (n+1) rfl hf) + (by omega : 3+n=n+3) = + (projectiveResolution k A B P Q).extMk (firstComparison k A B P Q p n ≫ f) (n+4) rfl + (ResolutionProducts.cubicPrecomp_closed (projectiveResolution k A B P Q) + (firstComparison k A B P Q p) (firstComparison_comm k A B P Q p hp) f hf) := + ResolutionProducts.cubic_endExt_comp_extMk (k := k) (projectiveResolution k A B P Q) + (firstComparison k A B P Q p) (firstComparison_comm k A B P Q p hp) f hf + +omit [Module.Finite k A] [Module.Finite k B] in +theorem secondCubicExt_action {N : ModuleCat.{u} (A ⊗[k] B)} {n : ℕ} + (f : (projectiveResolution k A B P Q).complex.X n ⟶ N) + (hf : (projectiveResolution k A B P Q).complex.d (n+1) n ≫ f=0) : + (secondCubicExt k A B P Q r hr).comp ((projectiveResolution k A B P Q).extMk f (n+1) rfl hf) + (by omega : 3+n=n+3) = + (projectiveResolution k A B P Q).extMk (secondComparison k A B P Q r n ≫ f) (n+4) rfl + (ResolutionProducts.cubicPrecomp_closed (projectiveResolution k A B P Q) + (secondComparison k A B P Q r) (secondComparison_comm k A B P Q r hr) f hf) := + ResolutionProducts.cubic_endExt_comp_extMk (k := k) (projectiveResolution k A B P Q) + (secondComparison k A B P Q r) (secondComparison_comm k A B P Q r hr) f hf + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicProducts.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..f2259cf744857cc5546d345deabc7321d761c5cc --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorCubicProducts.lean @@ -0,0 +1,38 @@ +import OAI.Algebra.AuslanderReiten.Ext.CubicExtCommute +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorCubicExt +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorCubicComm + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable [CharP k 2] +variable [HasDerivedCategory (ModuleCat.{u} (A ⊗[k] B))] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable {X : ModuleCat.{u} A} {Y : ModuleCat.{u} B} +variable (P : ProjectiveResolution X) (Q : ProjectiveResolution Y) +variable [∀ n, Module.Finite A (P.complex.X n)] [∀ n, Module.Finite B (Q.complex.X n)] +variable (p : ∀ n, P.complex.X (n+3) ⟶ P.complex.X n) +variable (r : ∀ n, Q.complex.X (n+3) ⟶ Q.complex.X n) +variable (hp : ∀ n, p (n+1) ≫ P.complex.d (n+1) n = P.complex.d (n+4) (n+3) ≫ p n) +variable (hr : ∀ n, r (n+1) ≫ Q.complex.d (n+1) n = Q.complex.d (n+4) (n+3) ≫ r n) + +theorem cubicExt_commute : + (firstCubicExt k A B P Q p hp).comp (secondCubicExt k A B P Q r hr) rfl = + (secondCubicExt k A B P Q r hr).comp (firstCubicExt k A B P Q p hp) rfl := by + apply ResolutionProducts.cubic_endExt_commute (k := k) + (projectiveResolution k A B P Q) + (firstComparison k A B P Q p) (secondComparison k A B P Q r) + (firstComparison_comm k A B P Q p hp) (secondComparison_comm k A B P Q r hr) + apply ModuleCat.hom_ext + exact (cubic_commute k A B P.complex Q.complex p r 0).symm + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorDegreeZero.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorDegreeZero.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f5afe44410adfbbdad1122cba3ddd3737deb030 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorDegreeZero.lean @@ -0,0 +1,33 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorBottom + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) + +theorem bottomProjection_zero_injective : Function.Injective (bottomProjection k A B P Q 0) := by + intro x y h + apply (termDirectSumEquiv k A B P Q 0).injective + apply DFinsupp.ext + intro ij + obtain ⟨⟨i,j⟩,hij⟩ := ij + have hi : i = 0 := by omega + have hj : j = 0 := by omega + subst i; subst j + exact h + +theorem bottomInsert_projection_zero (x : (complex k A B P Q).X 0) : + cubicInsert k A B P Q 0 ⟨(0,0),rfl⟩ (bottomProjection k A B P Q 0 x) = x := by + apply bottomProjection_zero_injective k A B P Q + exact bottomProjection_bottom k A B P Q 0 _ + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorDifferential.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..a518e1aae909ec4b627092b454b4d513efcfbd25 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorDifferential.lean @@ -0,0 +1,106 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorComplex + +namespace OAI + +noncomputable section + +namespace ArExplicit.ExternalTensor + +open CategoryTheory CategoryTheory.Limits HomologicalComplex +open scoped TensorProduct + +universe u + +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] + +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) + +abbrev inclusion (i j n : ℕ) (h : i+j=n) : + moduleObject k A B (P.X i) (Q.X j) ⟶ (complex k A B P Q).X n := + ιMapBifunctor P Q (bifunctor k A B) (ComplexShape.down ℕ) i j n h + +abbrev desc {N : ModuleCat.{u} (A ⊗[k] B)} {n : ℕ} + (f : ∀ (i j : ℕ) (_ : i+j=n), moduleObject k A B (P.X i) (Q.X j) ⟶ N) : + (complex k A B P Q).X n ⟶ N := + mapBifunctorDesc (K₁ := P) (K₂ := Q) (F := bifunctor k A B) (c := ComplexShape.down ℕ) f + +@[simp] theorem inclusion_desc {N : ModuleCat.{u} (A ⊗[k] B)} {n : ℕ} + (f : ∀ (i j : ℕ) (_ : i+j=n), moduleObject k A B (P.X i) (Q.X j) ⟶ N) + (i j : ℕ) (h : i+j=n) : + inclusion k A B P Q i j n h ≫ desc k A B P Q f = f i j h := + ι_mapBifunctorDesc (K₁ := P) (K₂ := Q) (F := bifunctor k A B) + (c := ComplexShape.down ℕ) f i j h + +theorem hom_ext {N : ModuleCat.{u} (A ⊗[k] B)} {n : ℕ} + {f g : (complex k A B P Q).X n ⟶ N} + (h : ∀ (i j : ℕ) (hij : i+j=n), + inclusion k A B P Q i j n hij ≫ f = inclusion k A B P Q i j n hij ≫ g) : f=g := + mapBifunctor.hom_ext h + +abbrev horizontal (i j n : ℕ) : moduleObject k A B (P.X i) (Q.X j) ⟶ (complex k A B P Q).X n := + mapBifunctor.d₁ P Q (bifunctor k A B) (ComplexShape.down ℕ) i j n + +abbrev vertical (i j n : ℕ) : moduleObject k A B (P.X i) (Q.X j) ⟶ (complex k A B P Q).X n := + mapBifunctor.d₂ P Q (bifunctor k A B) (ComplexShape.down ℕ) i j n + +theorem inclusion_d (i j n n' : ℕ) (h : i+j=n) : + inclusion k A B P Q i j n h ≫ (complex k A B P Q).d n n' = + horizontal k A B P Q i j n' + vertical k A B P Q i j n' := by + change ιMapBifunctor P Q (bifunctor k A B) (ComplexShape.down ℕ) i j n h ≫ + (mapBifunctor P Q (bifunctor k A B) (ComplexShape.down ℕ)).d n n' = + mapBifunctor.d₁ P Q (bifunctor k A B) (ComplexShape.down ℕ) i j n' + + mapBifunctor.d₂ P Q (bifunctor k A B) (ComplexShape.down ℕ) i j n' + rw [mapBifunctor.d_eq, Preadditive.comp_add, mapBifunctor.ι_D₁, mapBifunctor.ι_D₂] + +theorem horizontal_succ (i j n : ℕ) (h : i+j=n) : + horizontal k A B P Q (i+1) j n = + mapHom k A B (P.d (i+1) i) (𝟙 (Q.X j)) ≫ inclusion k A B P Q i j n h := by + dsimp only [horizontal] + rw [mapBifunctor.d₁_eq P Q (bifunctor k A B) (ComplexShape.down ℕ) (by rfl) j n h] + change (1 : ℤˣ) • _ = _ + exact one_smul _ _ + +theorem vertical_succ (i j n : ℕ) (h : i+j=n) : + vertical k A B P Q i (j+1) n = + (-1 : ℤˣ)^i • (mapHom k A B (𝟙 (P.X i)) (Q.d (j+1) j) ≫ + inclusion k A B P Q i j n h) := by + dsimp only [vertical] + rw [mapBifunctor.d₂_eq P Q (bifunctor k A B) (ComplexShape.down ℕ) i (by rfl) n h] + rfl + +theorem horizontal_zero (j n : ℕ) : horizontal k A B P Q 0 j n = 0 := + mapBifunctor.d₁_eq_zero P Q (bifunctor k A B) (ComplexShape.down ℕ) 0 j n (by + change ¬ (ComplexShape.down ℕ).next 0 + 1 = 0 + omega) + +theorem vertical_zero (i n : ℕ) : vertical k A B P Q i 0 n = 0 := + mapBifunctor.d₂_eq_zero P Q (bifunctor k A B) (ComplexShape.down ℕ) i 0 n (by + change ¬ (ComplexShape.down ℕ).next 0 + 1 = 0 + omega) + +theorem termDirectSumEquiv_inclusion (i j n : ℕ) (h : i+j=n) : + (termDirectSumEquiv k A B P Q n).toLinearMap.comp + (inclusion k A B P Q i j n h).hom = + DFinsupp.lsingle (R := A ⊗[k] B) (M := fun p : Diagonal n => summands k A B P Q n p) + ⟨(i,j),h⟩ := by + exact congrArg (fun f => f.hom) + (ModuleCat.ι_coprodIsoDirectSum_hom (summands k A B P Q n) ⟨(i,j),h⟩) + +theorem inclusion_eq_directSum (i j n : ℕ) (h : i+j=n) : + (inclusion k A B P Q i j n h).hom = + (termDirectSumEquiv k A B P Q n).symm.toLinearMap.comp + (DFinsupp.lsingle (R := A ⊗[k] B) (M := fun p : Diagonal n => summands k A B P Q n p) + ⟨(i,j),h⟩) := by + ext x + apply (termDirectSumEquiv k A B P Q n).injective + simpa only [LinearMap.comp_apply, LinearEquiv.coe_coe, + LinearEquiv.apply_symm_apply] using + LinearMap.congr_fun (termDirectSumEquiv_inclusion k A B P Q i j n h) x + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorExact.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorExact.lean new file mode 100644 index 0000000000000000000000000000000000000000..3dda036cb176a0c8e708896748a267f76a1f1a8c --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorExact.lean @@ -0,0 +1,40 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorForget +import OAI.Algebra.AuslanderReiten.Homology.VectorTensorKunneth + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory CategoryTheory.Limits HomologicalComplex +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +theorem map_quasiIso {P P' : ChainComplex (ModuleCat.{u} A) ℕ} + {Q Q' : ChainComplex (ModuleCat.{u} B) ℕ} (f : P ⟶ P') (g : Q ⟶ Q') + [QuasiIso f] [QuasiIso g] : + QuasiIso (mapBifunctorMap f g (bifunctor k A B) (ComplexShape.down ℕ)) := by + let Φ := (forgetField k (A ⊗[k] B)).mapHomologicalComplex (ComplexShape.down ℕ) + let f₀ := ((forgetField k A).mapHomologicalComplex (ComplexShape.down ℕ)).map f + let g₀ := ((forgetField k B).mapHomologicalComplex (ComplexShape.down ℕ)).map g + let t := mapBifunctorMap f₀ g₀ (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) + (ComplexShape.down ℕ) + have : QuasiIso f₀ := inferInstance + have : QuasiIso g₀ := inferInstance + have : QuasiIso t := VectorComplex.totalMap_quasiIso k _ f₀ g₀ + have h := scalarForgetTotalIso_naturality k A B f g + have : QuasiIso ((scalarForgetTotalIso k A B P Q).hom ≫ + Φ.map (mapBifunctorMap f g (bifunctor k A B) (ComplexShape.down ℕ))) := by + rw [← h] + infer_instance + have : QuasiIso (Φ.map (mapBifunctorMap f g (bifunctor k A B) (ComplexShape.down ℕ))) := + (quasiIso_iff_comp_left (scalarForgetTotalIso k A B P Q).hom + (Φ.map (mapBifunctorMap f g (bifunctor k A B) (ComplexShape.down ℕ)))).mp inferInstance + exact (quasiIso_map_iff_of_preservesHomology _ (forgetField k (A ⊗[k] B))).mp inferInstance + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorForget.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorForget.lean new file mode 100644 index 0000000000000000000000000000000000000000..cda3ae06be5353af8a376c6e637cf708434e9e6f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorForget.lean @@ -0,0 +1,194 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorDifferential +import Mathlib.Algebra.Category.ModuleCat.Monoidal.Basic +import OAI.Algebra.AuslanderReiten.Modules.ModuleRestriction + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits HomologicalComplex +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +abbrev forgetField : ModuleCat.{u} A ⥤ ModuleCat.{u} k := + ModuleCat.restrictScalars (algebraMap k A) + +abbrev forgetComplex (P : ChainComplex (ModuleCat.{u} A) ℕ) : ChainComplex (ModuleCat.{u} k) ℕ := + ((forgetField k A).mapHomologicalComplex _).obj P + +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) + +instance hasScalarTotal : HomologicalComplex.HasMapBifunctor (forgetComplex k A P) (forgetComplex k B Q) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.down ℕ) := fun _ => inferInstance + +abbrev scalarTotal : ChainComplex (ModuleCat.{u} k) ℕ := + HomologicalComplex.mapBifunctor (forgetComplex k A P) (forgetComplex k B Q) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.down ℕ) + +abbrev scalarSummands (n : ℕ) (p : Diagonal n) : ModuleCat.{u} k := + ModuleCat.of k ((forgetComplex k A P).X p.val.1 ⊗[k] (forgetComplex k B Q).X p.val.2) + +def scalarTermDirectSumEquiv (n : ℕ) : + (scalarTotal k A B P Q).X n ≃ₗ[k] (Π₀ p : Diagonal n, scalarSummands k A B P Q n p) := + CategoryTheory.Iso.toLinearEquiv (ModuleCat.coprodIsoDirectSum (scalarSummands k A B P Q n)) + +def forgetTermEquiv (n : ℕ) : + (forgetComplex k (A ⊗[k] B) (complex k A B P Q)).X n ≃ₗ[k] (scalarTotal k A B P Q).X n := + ((termDirectSumEquiv k A B P Q n).restrictScalars k).trans + (scalarTermDirectSumEquiv k A B P Q n).symm + +abbrev scalarInclusion (i j n : ℕ) (h : i+j=n) : + scalarSummands k A B P Q n ⟨(i,j),h⟩ ⟶ (scalarTotal k A B P Q).X n := + ιMapBifunctor (forgetComplex k A P) (forgetComplex k B Q) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.down ℕ) i j n h + +def forgetTermIso (n : ℕ) : + (forgetComplex k (A ⊗[k] B) (complex k A B P Q)).X n ≅ (scalarTotal k A B P Q).X n := + (forgetTermEquiv k A B P Q n).toModuleIso + +theorem scalarTermDirectSumEquiv_inclusion (i j n : ℕ) (h : i+j=n) : + (scalarTermDirectSumEquiv k A B P Q n).toLinearMap.comp + (scalarInclusion k A B P Q i j n h).hom = + DFinsupp.lsingle (R := k) (M := fun p : Diagonal n => scalarSummands k A B P Q n p) + ⟨(i,j),h⟩ := by + exact congrArg (fun f => f.hom) + (ModuleCat.ι_coprodIsoDirectSum_hom (scalarSummands k A B P Q n) ⟨(i,j),h⟩) + +@[reassoc] theorem scalarInclusion_forgetTermIso_inv (i j n : ℕ) (h : i+j=n) : + scalarInclusion k A B P Q i j n h ≫ (forgetTermIso k A B P Q n).inv = + ModuleCat.ofHom ((inclusion k A B P Q i j n h).hom.restrictScalars k) := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro x + apply (termDirectSumEquiv k A B P Q n).injective + change (termDirectSumEquiv k A B P Q n) + ((termDirectSumEquiv k A B P Q n).symm + ((scalarTermDirectSumEquiv k A B P Q n) + ((scalarInclusion k A B P Q i j n h).hom x))) = _ + exact (LinearEquiv.apply_symm_apply (termDirectSumEquiv k A B P Q n) _).trans + ((LinearMap.congr_fun (scalarTermDirectSumEquiv_inclusion k A B P Q i j n h) x).trans + (LinearMap.congr_fun (termDirectSumEquiv_inclusion k A B P Q i j n h) x).symm) + +abbrev scalarHorizontal (i j n : ℕ) := + mapBifunctor.d₁ (forgetComplex k A P) (forgetComplex k B Q) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.down ℕ) i j n + +abbrev scalarVertical (i j n : ℕ) := + mapBifunctor.d₂ (forgetComplex k A P) (forgetComplex k B Q) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.down ℕ) i j n + +theorem scalarHorizontal_comp (i j n : ℕ) (h : i+j=n+1) : + scalarHorizontal k A B P Q i j n ≫ (forgetTermIso k A B P Q n).inv = + ModuleCat.ofHom ((horizontal k A B P Q i j n).hom.restrictScalars k) := by + cases i with + | zero => + rw [show scalarHorizontal k A B P Q 0 j n = 0 from + mapBifunctor.d₁_eq_zero _ _ _ _ 0 j n (by change ¬ ((ComplexShape.down ℕ).next 0 + 1 = 0); omega), + zero_comp, horizontal_zero] + rfl + | succ i => + have hij : i+j=n := by omega + dsimp only [scalarHorizontal] + rw [mapBifunctor.d₁_eq _ _ _ _ (show (ComplexShape.down ℕ).Rel (i+1) i from rfl) j n hij] + change ((1 : ℤˣ) • _) ≫ _ = _ + rw [one_smul, Category.assoc, scalarInclusion_forgetTermIso_inv, + horizontal_succ k A B P Q i j n hij] + apply ModuleCat.hom_ext + apply TensorProduct.ext + apply LinearMap.ext + intro x + apply LinearMap.ext + intro y + rfl + +theorem scalarVertical_comp (i j n : ℕ) (h : i+j=n+1) : + scalarVertical k A B P Q i j n ≫ (forgetTermIso k A B P Q n).inv = + ModuleCat.ofHom ((vertical k A B P Q i j n).hom.restrictScalars k) := by + cases j with + | zero => + rw [show scalarVertical k A B P Q i 0 n = 0 from + mapBifunctor.d₂_eq_zero _ _ _ _ i 0 n (by change ¬ ((ComplexShape.down ℕ).next 0 + 1 = 0); omega), + zero_comp, vertical_zero] + rfl + | succ j => + have hij : i+j=n := by omega + dsimp only [scalarVertical] + rw [mapBifunctor.d₂_eq _ _ _ _ i (show (ComplexShape.down ℕ).Rel (j+1) j from rfl) n hij] + change ((-1 : ℤˣ)^i • _) ≫ _ = _ + rw [Linear.units_smul_comp, Category.assoc, scalarInclusion_forgetTermIso_inv, + vertical_succ k A B P Q i j n hij] + apply ModuleCat.hom_ext + apply TensorProduct.ext + apply LinearMap.ext + intro x + apply LinearMap.ext + intro y + rfl + +theorem scalarInclusion_d (i j n n' : ℕ) (h : i+j=n) : + scalarInclusion k A B P Q i j n h ≫ (scalarTotal k A B P Q).d n n' = + scalarHorizontal k A B P Q i j n' + scalarVertical k A B P Q i j n' := by + change ιMapBifunctor _ _ _ _ i j n h ≫ _ = _ + rw [mapBifunctor.d_eq, Preadditive.comp_add, mapBifunctor.ι_D₁, mapBifunctor.ι_D₂] + +def scalarForgetTotalIso : scalarTotal k A B P Q ≅ + forgetComplex k (A ⊗[k] B) (complex k A B P Q) := + HomologicalComplex.Hom.isoOfComponents (fun n => (forgetTermIso k A B P Q n).symm) + (fun n m h => by + have hnm : m+1=n := h + subst n + apply mapBifunctor.hom_ext + intro i j hij + change scalarInclusion k A B P Q i j (m+1) hij ≫ + ((forgetTermIso k A B P Q (m+1)).inv ≫ _) = + scalarInclusion k A B P Q i j (m+1) hij ≫ + ((scalarTotal k A B P Q).d (m+1) m ≫ (forgetTermIso k A B P Q m).inv) + rw [← Category.assoc, scalarInclusion_forgetTermIso_inv, ← Category.assoc, + scalarInclusion_d, Preadditive.add_comp, + scalarHorizontal_comp k A B P Q i j m hij, + scalarVertical_comp k A B P Q i j m hij] + apply ModuleCat.hom_ext + apply LinearMap.ext + intro x + exact congrArg (fun f => f.hom x) (inclusion_d k A B P Q i j (m+1) m hij)) + +def forgetTotalIso : forgetComplex k (A ⊗[k] B) (complex k A B P Q) ≅ + scalarTotal k A B P Q := (scalarForgetTotalIso k A B P Q).symm + +variable {P Q} +variable {P' : ChainComplex (ModuleCat.{u} A) ℕ} {Q' : ChainComplex (ModuleCat.{u} B) ℕ} + +theorem scalarForgetTotalIso_naturality (f : P ⟶ P') (g : Q ⟶ Q') : + mapBifunctorMap (((forgetField k A).mapHomologicalComplex _).map f) + (((forgetField k B).mapHomologicalComplex _).map g) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.down ℕ) ≫ + (scalarForgetTotalIso k A B P' Q').hom = + (scalarForgetTotalIso k A B P Q).hom ≫ + (((forgetField k (A ⊗[k] B)).mapHomologicalComplex _).map + (mapBifunctorMap f g (bifunctor k A B) (ComplexShape.down ℕ))) := by + apply HomologicalComplex.Hom.ext + funext n + apply mapBifunctor.hom_ext + intro i j hij + change scalarInclusion k A B P Q i j n hij ≫ + ((mapBifunctorMap _ _ _ _).f n ≫ (forgetTermIso k A B P' Q' n).inv) = + scalarInclusion k A B P Q i j n hij ≫ + ((forgetTermIso k A B P Q n).inv ≫ _) + rw [← Category.assoc, ι_mapBifunctorMap, Category.assoc, Category.assoc, + scalarInclusion_forgetTermIso_inv, ← Category.assoc, scalarInclusion_forgetTermIso_inv] + apply ModuleCat.hom_ext + apply TensorProduct.ext + apply LinearMap.ext + intro x + apply LinearMap.ext + intro y + exact (congrArg (fun u => u.hom (x ⊗ₜ[k] y)) + (ι_mapBifunctorMap f g (bifunctor k A B) (ComplexShape.down ℕ) i j n hij)).symm + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorFunctor.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..dbaa43e5c2a0970d857c49040e97bff7d224a7c2 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorFunctor.lean @@ -0,0 +1,118 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorProjective +import OAI.Algebra.AuslanderReiten.BaseChange.ScalarExtensionComplete + +namespace OAI + +noncomputable section + +namespace ArExplicit.ExternalTensor + +open CategoryTheory +open scoped TensorProduct + +universe u + +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] + +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +def mapHom {M M' : ModuleCat.{u} A} {N N' : ModuleCat.{u} B} + (f : M ⟶ M') (g : N ⟶ N') : + moduleObject k A B M N ⟶ moduleObject k A B M' N' := + ModuleCat.ofHom (X := moduleObject k A B M N) (Y := moduleObject k A B M' N') + (map k A B f.hom g.hom) + +@[simp] theorem mapHom_id (M : ModuleCat.{u} A) (N : ModuleCat.{u} B) : + mapHom k A B (𝟙 M) (𝟙 N) = 𝟙 (moduleObject k A B M N) := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro z + let w : M ⊗[k] N := z + change TensorProduct.map (LinearMap.id : M →ₗ[k] M) (LinearMap.id : N →ₗ[k] N) w = w + simp + +@[simp] theorem mapHom_comp {M M' M'' : ModuleCat.{u} A} {N N' N'' : ModuleCat.{u} B} + (f : M ⟶ M') (f' : M' ⟶ M'') (g : N ⟶ N') (g' : N' ⟶ N'') : + mapHom k A B (f ≫ f') (g ≫ g') = mapHom k A B f g ≫ mapHom k A B f' g' := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro z + let w : M ⊗[k] N := z + change TensorProduct.map ((f'.hom.comp f.hom).restrictScalars k) + ((g'.hom.comp g.hom).restrictScalars k) w = + TensorProduct.map (f'.hom.restrictScalars k) (g'.hom.restrictScalars k) + (TensorProduct.map (f.hom.restrictScalars k) (g.hom.restrictScalars k) w) + induction w using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy] + | tmul x y => rfl + +theorem mapHom_add_left {M M' : ModuleCat.{u} A} {N N' : ModuleCat.{u} B} + (f f' : M ⟶ M') (g : N ⟶ N') : + mapHom k A B (f+f') g = mapHom k A B f g + mapHom k A B f' g := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro z + let w : M ⊗[k] N := z + change TensorProduct.map ((f.hom+f'.hom).restrictScalars k) (g.hom.restrictScalars k) w = + TensorProduct.map (f.hom.restrictScalars k) (g.hom.restrictScalars k) w + + TensorProduct.map (f'.hom.restrictScalars k) (g.hom.restrictScalars k) w + induction w using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy]; abel + | tmul x y => exact TensorProduct.add_tmul _ _ _ + +theorem mapHom_add_right {M M' : ModuleCat.{u} A} {N N' : ModuleCat.{u} B} + (f : M ⟶ M') (g g' : N ⟶ N') : + mapHom k A B f (g+g') = mapHom k A B f g + mapHom k A B f g' := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro z + let w : M ⊗[k] N := z + change TensorProduct.map (f.hom.restrictScalars k) ((g.hom+g'.hom).restrictScalars k) w = + TensorProduct.map (f.hom.restrictScalars k) (g.hom.restrictScalars k) w + + TensorProduct.map (f.hom.restrictScalars k) (g'.hom.restrictScalars k) w + induction w using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy]; abel + | tmul x y => exact TensorProduct.tmul_add _ _ _ + +def rightFunctor (M : ModuleCat.{u} A) : ModuleCat.{u} B ⥤ ModuleCat.{u} (A ⊗[k] B) where + obj N := moduleObject k A B M N + map f := mapHom k A B (𝟙 M) f + map_id N := mapHom_id k A B M N + map_comp f g := by simpa only [Category.id_comp] using mapHom_comp k A B (𝟙 M) (𝟙 M) f g + +instance (M : ModuleCat.{u} A) : (rightFunctor k A B M).Additive where + map_add := by intros; exact mapHom_add_right k A B (𝟙 M) _ _ + +def bifunctor : ModuleCat.{u} A ⥤ ModuleCat.{u} B ⥤ ModuleCat.{u} (A ⊗[k] B) where + obj := rightFunctor k A B + map f := + { app := fun N => mapHom k A B f (𝟙 N) + naturality N N' g := by + change mapHom k A B (𝟙 _) g ≫ mapHom k A B f (𝟙 _) = + mapHom k A B f (𝟙 _) ≫ mapHom k A B (𝟙 _) g + simp only [← mapHom_comp, Category.id_comp, Category.comp_id] } + map_id M := by + apply NatTrans.ext + funext N + exact mapHom_id k A B M N + map_comp f g := by + apply NatTrans.ext + funext N + change mapHom k A B (f ≫ g) (𝟙 N) = mapHom k A B f (𝟙 N) ≫ mapHom k A B g (𝟙 N) + simpa only [Category.id_comp] using mapHom_comp k A B f g (𝟙 N) (𝟙 N) + +instance : (bifunctor k A B).Additive where + map_add := by + intro M N f g + apply NatTrans.ext + funext L + exact mapHom_add_left k A B f g (𝟙 L) + +instance (M : ModuleCat.{u} A) : ((bifunctor k A B).obj M).Additive := + inferInstanceAs ((rightFunctor k A B M).Additive) + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHom.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHom.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3b44f550a4997d2bd60021f7bdc286597d02adb --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHom.lean @@ -0,0 +1,177 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorProjective +import Mathlib.LinearAlgebra.Pi + +namespace OAI + +noncomputable section +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable {M N U V : Type u} +variable [AddCommGroup M] [AddCommGroup N] [AddCommGroup U] [AddCommGroup V] +variable [Module k M] [Module k N] [Module k U] [Module k V] +variable [Module A M] [Module B N] [Module A U] [Module B V] +variable [IsScalarTower k A M] [IsScalarTower k B N] [IsScalarTower k A U] [IsScalarTower k B V] + +def homPair : (M →ₗ[A] U) →ₗ[k] (N →ₗ[B] V) →ₗ[k] + (moduleObject k A B M N →ₗ[A ⊗[k] B] moduleObject k A B U V) := + LinearMap.mk₂ k (map k A B) + (fun f f' g => by + apply LinearMap.restrictScalars_injective k + apply TensorProduct.ext + apply LinearMap.ext + intro x + apply LinearMap.ext + intro y + exact TensorProduct.add_tmul _ _ _) + (fun a f g => by + apply LinearMap.restrictScalars_injective k + apply TensorProduct.ext + apply LinearMap.ext + intro x + apply LinearMap.ext + intro y + exact TensorProduct.smul_tmul' a (f x) (g y)) + (fun f g g' => by + apply LinearMap.restrictScalars_injective k + apply TensorProduct.ext + apply LinearMap.ext + intro x + apply LinearMap.ext + intro y + exact TensorProduct.tmul_add _ _ _) + (fun a f g => by + apply LinearMap.restrictScalars_injective k + apply TensorProduct.ext + apply LinearMap.ext + intro x + apply LinearMap.ext + intro y + exact TensorProduct.tmul_smul a (f x) (g y)) + +def homMap : (M →ₗ[A] U) ⊗[k] (N →ₗ[B] V) →ₗ[k] + (moduleObject k A B M N →ₗ[A ⊗[k] B] moduleObject k A B U V) := + TensorProduct.lift (homPair k A B) + +@[simp] theorem homMap_tmul (f : M →ₗ[A] U) (g : N →ₗ[B] V) : + homMap k A B (f ⊗ₜ[k] g) = map k A B f g := rfl + +def freeFlatEquiv (n m : ℕ) : + moduleObject k A B (Fin n → A) (Fin m → B) ≃ₗ[A ⊗[k] B] + (Fin n × Fin m → A ⊗[k] B) := + (freeEquiv k A B n m).trans (LinearEquiv.curry _ _ (Fin n) (Fin m)).symm + +@[simp] theorem freeFlatEquiv_tmul (n m : ℕ) (a : Fin n → A) (b : Fin m → B) + (i : Fin n) (j : Fin m) : + freeFlatEquiv k A B n m (a ⊗ₜ[k] b) (i,j) = a i ⊗ₜ[k] b j := + freeCoordinates_tmul k A B n m a b i j + +theorem freeFlatEquiv_symm_single (n m : ℕ) (i : Fin n) (j : Fin m) : + (freeFlatEquiv k A B n m).symm (Pi.single (i,j) 1) = + (Pi.single i (1 : A)) ⊗ₜ[k] (Pi.single j (1 : B)) := by + apply (freeFlatEquiv k A B n m).injective + rw [LinearEquiv.apply_symm_apply] + funext ⟨i',j'⟩ + rw [freeFlatEquiv_tmul] + by_cases hi : i'=i <;> by_cases hj : j'=j <;> + simp [hi, hj, Prod.mk.injEq, Algebra.TensorProduct.one_def] + +def homFreeCoordinates (n m : ℕ) : + (moduleObject k A B (Fin n → A) (Fin m → B) →ₗ[A ⊗[k] B] moduleObject k A B U V) ≃ₗ[k] + (Fin n × Fin m → moduleObject k A B U V) := + (LinearEquiv.congrLeft (moduleObject k A B U V) k (freeFlatEquiv k A B n m)).trans + (LinearEquiv.piRing (A ⊗[k] B) (moduleObject k A B U V) (Fin n × Fin m) k) + +theorem homMap_bijective_free (n m : ℕ) : + Function.Bijective (homMap k A B (M := Fin n → A) (N := Fin m → B) (U := U) (V := V)) := by + let s : (((Fin n → A) →ₗ[A] U) ⊗[k] ((Fin m → B) →ₗ[B] V)) ≃ₗ[k] + (Fin n × Fin m → U ⊗[k] V) := + (TensorProduct.congr (LinearEquiv.piRing A U (Fin n) k) + (LinearEquiv.piRing B V (Fin m) k)).trans + ((TensorProduct.piLeft k (Fin m → V) (fun _ : Fin n => U)).trans + ((LinearEquiv.piCongrRight fun _ => TensorProduct.piRight k k U (fun _ : Fin m => V)).trans + (LinearEquiv.curry k (U ⊗[k] V) (Fin n) (Fin m)).symm)) + let t := homFreeCoordinates k A B (U := U) (V := V) n m + have heq (x) : t (homMap k A B x) = s x := by + induction x using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy]; rfl + | tmul f g => + funext ⟨i,j⟩ + change homMap k A B (f ⊗ₜ[k] g) + ((freeFlatEquiv k A B n m).symm (Pi.single (i,j) 1)) = _ + rw [freeFlatEquiv_symm_single, homMap_tmul, map_tmul] + rfl + constructor + · intro x y hxy + exact s.injective ((heq x).symm.trans ((congrArg t hxy).trans (heq y))) + · intro f + obtain ⟨x,hx⟩ := s.surjective (t f) + exact ⟨x,t.injective ((heq x).trans hx)⟩ + +variable {M' N' : Type u} [AddCommGroup M'] [AddCommGroup N'] +variable [Module k M'] [Module k N'] [Module A M'] [Module B N'] +variable [IsScalarTower k A M'] [IsScalarTower k B N'] + +theorem homMap_precomp (f : M' →ₗ[A] M) (g : N' →ₗ[B] N) + (x : (M →ₗ[A] U) ⊗[k] (N →ₗ[B] V)) : + homMap k A B ((TensorProduct.map (LinearMap.lcomp k U f) (LinearMap.lcomp k V g)) x) = + (homMap k A B x).comp (map k A B f g) := by + induction x using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy, LinearMap.add_comp] + | tmul u v => + apply LinearMap.restrictScalars_injective k + apply TensorProduct.ext + apply LinearMap.ext + intro m + apply LinearMap.ext + intro n + rfl + +theorem homMap_bijective [Module.Finite A M] [Module.Projective A M] + [Module.Finite B N] [Module.Projective B N] : + Function.Bijective (homMap k A B (M := M) (N := N) (U := U) (V := V)) := by + obtain ⟨n,p,hp⟩ := Module.Finite.exists_fin' A M + obtain ⟨m,q,hq⟩ := Module.Finite.exists_fin' B N + obtain ⟨s,hs⟩ := Module.projective_lifting_property p (LinearMap.id : M →ₗ[A] M) hp + obtain ⟨t,ht⟩ := Module.projective_lifting_property q (LinearMap.id : N →ₗ[B] N) hq + let a := TensorProduct.map (LinearMap.lcomp k U p) (LinearMap.lcomp k V q) + let b := TensorProduct.map (LinearMap.lcomp k U s) (LinearMap.lcomp k V t) + have hba (x : (M →ₗ[A] U) ⊗[k] (N →ₗ[B] V)) : b (a x) = x := by + induction x using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy] + | tmul u v => + change ((u.comp p).comp s) ⊗ₜ[k] ((v.comp q).comp t) = u ⊗ₜ[k] v + rw [LinearMap.comp_assoc, LinearMap.comp_assoc, hs, ht, LinearMap.comp_id, LinearMap.comp_id] + have hsplit : (map k A B p q).comp (map k A B s t) = LinearMap.id := by + apply LinearMap.restrictScalars_injective k + apply TensorProduct.ext + apply LinearMap.ext + intro x + apply LinearMap.ext + intro y + change p (s x) ⊗ₜ[k] q (t y) = x ⊗ₜ[k] y + rw [show p (s x) = x from DFunLike.congr_fun hs x, + show q (t y) = y from DFunLike.congr_fun ht y] + have hfree := homMap_bijective_free k A B (U := U) (V := V) n m + constructor + · intro x y hxy + have hab : a x = a y := hfree.1 (by simp only [a, homMap_precomp, hxy]) + exact (hba x).symm.trans ((congrArg b hab).trans (hba y)) + · intro f + obtain ⟨x,hx⟩ := hfree.2 (f.comp (map k A B p q)) + refine ⟨b x, ?_⟩ + rw [show b = TensorProduct.map (LinearMap.lcomp k U s) (LinearMap.lcomp k V t) from rfl, + homMap_precomp, hx, LinearMap.comp_assoc, hsplit, LinearMap.comp_id] + +def homEquiv [Module.Finite A M] [Module.Projective A M] + [Module.Finite B N] [Module.Projective B N] : + (M →ₗ[A] U) ⊗[k] (N →ₗ[B] V) ≃ₗ[k] + (moduleObject k A B M N →ₗ[A ⊗[k] B] moduleObject k A B U V) := + LinearEquiv.ofBijective (homMap k A B) (homMap_bijective k A B) + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomComplex.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomComplex.lean new file mode 100644 index 0000000000000000000000000000000000000000..6bc48c464cb5f31ba3cfb6b52b42c670b268c5b2 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomComplex.lean @@ -0,0 +1,145 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorHom +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorForget +import OAI.Algebra.AuslanderReiten.Homology.CochainNatTensorSigns + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits HomologicalComplex +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) + +def homCochain (U : Type u) [AddCommGroup U] [Module A U] [Module k U] + [IsScalarTower k A U] : CochainComplex (ModuleCat.{u} k) ℕ := + CochainComplex.of (fun n => ModuleCat.of k (P.X n →ₗ[A] U)) + (fun n => ModuleCat.ofHom (LinearMap.lcomp k U (P.d (n+1) n).hom)) (by + intro n + apply ModuleCat.hom_ext + apply LinearMap.ext + intro f + apply LinearMap.ext + intro x + change f ((P.d (n+1) n).hom ((P.d (n+2) (n+1)).hom x)) = 0 + have hz := congrArg (fun g => g.hom x) (P.d_comp_d (n+2) (n+1) n) + change (P.d (n+1) n).hom ((P.d (n+2) (n+1)).hom x) = 0 at hz + rw [hz, map_zero]) + +@[simp] theorem homCochain_d (U : Type u) [AddCommGroup U] [Module A U] [Module k U] + [IsScalarTower k A U] (n : ℕ) : + (homCochain k A P U).d n (n+1) = + ModuleCat.ofHom (LinearMap.lcomp k U (P.d (n+1) n).hom) := + by + exact CochainComplex.of_d (V := ModuleCat.{u} k) + (fun n => ModuleCat.of k (P.X n →ₗ[A] U)) + (fun n => ModuleCat.ofHom (LinearMap.lcomp k U (P.d (n+1) n).hom)) n + +variable (U : ModuleCat.{u} A) (V : ModuleCat.{u} B) + +instance hasHomCochainTotal : HasMapBifunctor (homCochain k A P U) (homCochain k B Q V) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.up ℕ) := fun _ => inferInstance + +abbrev homCochainTotal : CochainComplex (ModuleCat.{u} k) ℕ := + mapBifunctor (homCochain k A P U) (homCochain k B Q V) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.up ℕ) + +def homOutTerm (n : ℕ) : + ((complex k A B P Q).X n →ₗ[A ⊗[k] B] moduleObject k A B U V) →ₗ[k] + (∀ p : Diagonal n, summands k A B P Q n p →ₗ[A ⊗[k] B] moduleObject k A B U V) where + toFun f p := f.comp (inclusion k A B P Q p.val.1 p.val.2 n p.property).hom + map_add' f g := by funext p; exact LinearMap.add_comp _ _ _ + map_smul' a f := by funext p; exact LinearMap.smul_comp _ _ _ + +theorem homOutTerm_bijective (n : ℕ) : Function.Bijective (homOutTerm k A B P Q U V n) := by + constructor + · intro f g hfg + have hh : ModuleCat.ofHom f = ModuleCat.ofHom g := by + apply hom_ext k A B P Q + intro i j hij + exact ModuleCat.hom_ext (congrFun hfg ⟨(i,j),hij⟩) + exact congrArg (fun h => h.hom) hh + · intro f + refine ⟨(desc k A B P Q (fun i j hij => ModuleCat.ofHom (X := moduleObject k A B (P.X i) (Q.X j)) + (Y := moduleObject k A B U V) (f ⟨(i,j),hij⟩))).hom, ?_⟩ + funext p + exact congrArg (fun h => h.hom) + (inclusion_desc k A B P Q (fun i j hij => ModuleCat.ofHom (X := moduleObject k A B (P.X i) (Q.X j)) + (Y := moduleObject k A B U V) (f ⟨(i,j),hij⟩)) + p.val.1 p.val.2 p.property) + +def homOutTermEquiv (n : ℕ) : + ((complex k A B P Q).X n →ₗ[A ⊗[k] B] moduleObject k A B U V) ≃ₗ[k] + (∀ p : Diagonal n, summands k A B P Q n p →ₗ[A ⊗[k] B] moduleObject k A B U V) := + LinearEquiv.ofBijective (homOutTerm k A B P Q U V n) (homOutTerm_bijective k A B P Q U V n) + +abbrev homCochainSummand (n : ℕ) (p : Diagonal n) : ModuleCat.{u} k := + ModuleCat.of k ((P.X p.val.1 →ₗ[A] U) ⊗[k] (Q.X p.val.2 →ₗ[B] V)) + +def homCochainTermCoordinates (n : ℕ) : + (homCochainTotal k A B P Q U V).X n ≃ₗ[k] + (∀ p : Diagonal n, homCochainSummand k A B P Q U V n p) := + (ModuleCat.coprodIsoDirectSum (homCochainSummand k A B P Q U V n)).toLinearEquiv.trans + DFinsupp.linearEquivFunOnFintype + +variable [∀ n, Module.Finite A (P.X n)] [∀ n, Module.Projective A (P.X n)] +variable [∀ n, Module.Finite B (Q.X n)] [∀ n, Module.Projective B (Q.X n)] + +def homCochainTermEquiv (n : ℕ) : + (homCochainTotal k A B P Q U V).X n ≃ₗ[k] + (homCochain k (A ⊗[k] B) (complex k A B P Q) (moduleObject k A B U V)).X n := + (homCochainTermCoordinates k A B P Q U V n).trans + ((LinearEquiv.piCongrRight fun p => homEquiv k A B + (M := P.X p.val.1) (N := Q.X p.val.2) (U := U) (V := V)).trans + (homOutTermEquiv k A B P Q U V n).symm) + +abbrev homCochainInclusion (i j n : ℕ) (h : i+j=n) : + homCochainSummand k A B P Q U V n ⟨(i,j),h⟩ ⟶ (homCochainTotal k A B P Q U V).X n := + ιMapBifunctor (homCochain k A P U) (homCochain k B Q V) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.up ℕ) i j n h + +theorem homCochainTermEquiv_restrict (n : ℕ) (x : (homCochainTotal k A B P Q U V).X n) + (p : Diagonal n) : + (homCochainTermEquiv k A B P Q U V n x).comp + (inclusion k A B P Q p.val.1 p.val.2 n p.property).hom = + homMap k A B (homCochainTermCoordinates k A B P Q U V n x p) := by + exact congrFun ((homOutTermEquiv k A B P Q U V n).apply_symm_apply + ((LinearEquiv.piCongrRight fun p => homEquiv k A B + (M := P.X p.val.1) (N := Q.X p.val.2) (U := U) (V := V)) + (homCochainTermCoordinates k A B P Q U V n x))) p + +omit [∀ n, Module.Finite A (P.X n)] [∀ n, Module.Projective A (P.X n)] + [∀ n, Module.Finite B (Q.X n)] [∀ n, Module.Projective B (Q.X n)] in +theorem homCochainTermCoordinates_inclusion (i j n : ℕ) (h : i+j=n) + (x : (P.X i →ₗ[A] U) ⊗[k] (Q.X j →ₗ[B] V)) : + homCochainTermCoordinates k A B P Q U V n (homCochainInclusion k A B P Q U V i j n h x) = + Pi.single ⟨(i,j),h⟩ x := by + have hh := congrArg (fun f => f.hom x) + (ModuleCat.ι_coprodIsoDirectSum_hom (homCochainSummand k A B P Q U V n) ⟨(i,j),h⟩) + exact congrArg (fun y => DFinsupp.linearEquivFunOnFintype (R := k) y) hh + +@[simp] theorem homCochainTermEquiv_inclusion_same (i j n : ℕ) (h : i+j=n) + (x : (P.X i →ₗ[A] U) ⊗[k] (Q.X j →ₗ[B] V)) : + (homCochainTermEquiv k A B P Q U V n (homCochainInclusion k A B P Q U V i j n h x)).comp + (inclusion k A B P Q i j n h).hom = homMap k A B x := by + exact (homCochainTermEquiv_restrict k A B P Q U V n _ ⟨(i,j),h⟩).trans + (congrArg (homMap k A B) ((congrFun (homCochainTermCoordinates_inclusion k A B P Q U V i j n h x) ⟨(i,j),h⟩).trans (Pi.single_eq_same _ _))) + +@[simp] theorem homCochainTermEquiv_inclusion_ne (i j n : ℕ) (h : i+j=n) + (x : (P.X i →ₗ[A] U) ⊗[k] (Q.X j →ₗ[B] V)) (a b : ℕ) (hab : a+b=n) + (hne : (a,b) ≠ (i,j)) : + (homCochainTermEquiv k A B P Q U V n (homCochainInclusion k A B P Q U V i j n h x)).comp + (inclusion k A B P Q a b n hab).hom = 0 := by + refine (homCochainTermEquiv_restrict k A B P Q U V n _ ⟨(a,b),hab⟩).trans ?_ + rw [homCochainTermCoordinates_inclusion, + Pi.single_eq_of_ne (show (⟨(a,b),hab⟩ : Diagonal n) ≠ ⟨(i,j),h⟩ from fun hh => hne (congrArg Subtype.val hh)), + map_zero] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomCubic.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomCubic.lean new file mode 100644 index 0000000000000000000000000000000000000000..2833c6690c51dafa760e0b826ca0faad0fcb021f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomCubic.lean @@ -0,0 +1,135 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorHomDifferential +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorCubicChain + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) +variable (U : ModuleCat.{u} A) (V : ModuleCat.{u} B) +variable [∀ n, Module.Finite A (P.X n)] [∀ n, Module.Projective A (P.X n)] +variable [∀ n, Module.Finite B (Q.X n)] [∀ n, Module.Projective B (Q.X n)] + +theorem elementary_cubicInsert_same (i j n : ℕ) (h : i+j=n) + (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) + (x : moduleObject k A B (P.X i) (Q.X j)) : + elementaryHom k A B P Q U V i j n h f g + (cubicInsert k A B P Q n ⟨(i,j),h⟩ x) = map k A B f g x := by + have hh := homCochainTermEquiv_inclusion_same k A B P Q U V i j n h (f ⊗ₜ[k] g) + rw [inclusion_eq_cubicInsert, homMap_tmul] at hh + exact DFunLike.congr_fun hh x + +theorem elementary_cubicInsert_ne (i j n : ℕ) (h : i+j=n) + (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) + (a b : ℕ) (hab : a+b=n) (hne : (a,b) ≠ (i,j)) + (x : moduleObject k A B (P.X a) (Q.X b)) : + elementaryHom k A B P Q U V i j n h f g + (cubicInsert k A B P Q n ⟨(a,b),hab⟩ x) = 0 := by + have hh := homCochainTermEquiv_inclusion_ne k A B P Q U V i j n h (f ⊗ₜ[k] g) a b hab hne + rw [inclusion_eq_cubicInsert] at hh + exact DFunLike.congr_fun hh x + +private theorem map_first_comp {M M' : ModuleCat.{u} A} {N : ModuleCat.{u} B} + (f : M →ₗ[A] U) (g : N →ₗ[B] V) (p : M' →ₗ[A] M) + (x : moduleObject k A B M' N) : + map k A B f g (map k A B p (LinearMap.id : N →ₗ[B] N) x) = + map k A B (f.comp p) g x := by + have h : (map k A B f g).comp (map k A B p (LinearMap.id : N →ₗ[B] N)) = + map k A B (f.comp p) g := by + apply LinearMap.restrictScalars_injective k + apply TensorProduct.ext + apply LinearMap.ext + intro a + apply LinearMap.ext + intro b + rfl + exact DFunLike.congr_fun h x + +theorem elementary_firstCubic + (p : ∀ n, P.X (n+3) ⟶ P.X n) + (i j n : ℕ) (h : i+j=n) (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) : + (elementaryHom k A B P Q U V i j n h f g).comp (firstCubic k A B P Q p n) = + elementaryHom k A B P Q U V (i+3) j (n+3) (by omega) (f.comp (p i).hom) g := by + apply cubic_hom_ext k A B P Q (n+3) + rintro ⟨⟨a,b⟩,hab⟩ x + simp only [LinearMap.comp_apply, firstCubic_insert] + rcases a with _ | (_ | (_ | a)) + · simp only [firstCubicEntry, LinearMap.zero_apply, map_zero] + exact (elementary_cubicInsert_ne k A B P Q U V (i+3) j (n+3) (by omega) + (f.comp (p i).hom) g 0 b hab (by intro he; have := congrArg Prod.fst he; omega) x).symm + · simp only [firstCubicEntry, LinearMap.zero_apply, map_zero] + exact (elementary_cubicInsert_ne k A B P Q U V (i+3) j (n+3) (by omega) + (f.comp (p i).hom) g 1 b hab (by intro he; have := congrArg Prod.fst he; omega) x).symm + · simp only [firstCubicEntry, LinearMap.zero_apply, map_zero] + exact (elementary_cubicInsert_ne k A B P Q U V (i+3) j (n+3) (by omega) + (f.comp (p i).hom) g 2 b hab (by intro he; have := congrArg Prod.fst he; omega) x).symm + · by_cases ha : a=i + · subst a + have hb : b=j := by omega + subst b + simp only [firstCubicEntry, LinearMap.comp_apply, elementary_cubicInsert_same] + exact map_first_comp k A B U V f g (p i).hom x + · have hn : (a,b)≠(i,j) := by intro he; exact ha (congrArg Prod.fst he) + have hn' : (a+3,b)≠(i+3,j) := by intro he; have := congrArg Prod.fst he; omega + simp only [firstCubicEntry, LinearMap.comp_apply] + rw [elementary_cubicInsert_ne k A B P Q U V i j n h f g a b (by omega) hn, + elementary_cubicInsert_ne k A B P Q U V (i+3) j (n+3) (by omega) + (f.comp (p i).hom) g (a+3) b hab hn'] + +private theorem map_second_comp {M : ModuleCat.{u} A} {N N' : ModuleCat.{u} B} + (f : M →ₗ[A] U) (g : N →ₗ[B] V) (r : N' →ₗ[B] N) + (x : moduleObject k A B M N') : + map k A B f g (map k A B (LinearMap.id : M →ₗ[A] M) r x) = + map k A B f (g.comp r) x := by + have h : (map k A B f g).comp (map k A B (LinearMap.id : M →ₗ[A] M) r) = + map k A B f (g.comp r) := by + apply LinearMap.restrictScalars_injective k + apply TensorProduct.ext + apply LinearMap.ext + intro a + apply LinearMap.ext + intro b + rfl + exact DFunLike.congr_fun h x + +theorem elementary_secondCubic + (r : ∀ n, Q.X (n+3) ⟶ Q.X n) + (i j n : ℕ) (h : i+j=n) (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) : + (elementaryHom k A B P Q U V i j n h f g).comp (secondCubic k A B P Q r n) = + elementaryHom k A B P Q U V i (j+3) (n+3) (by omega) f (g.comp (r j).hom) := by + apply cubic_hom_ext k A B P Q (n+3) + rintro ⟨⟨a,b⟩,hab⟩ x + simp only [LinearMap.comp_apply, secondCubic_insert] + rcases b with _ | (_ | (_ | b)) + · simp only [secondCubicEntry, LinearMap.zero_apply, map_zero] + exact (elementary_cubicInsert_ne k A B P Q U V i (j+3) (n+3) (by omega) + f (g.comp (r j).hom) a 0 hab (by intro he; have := congrArg Prod.snd he; omega) x).symm + · simp only [secondCubicEntry, LinearMap.zero_apply, map_zero] + exact (elementary_cubicInsert_ne k A B P Q U V i (j+3) (n+3) (by omega) + f (g.comp (r j).hom) a 1 hab (by intro he; have := congrArg Prod.snd he; omega) x).symm + · simp only [secondCubicEntry, LinearMap.zero_apply, map_zero] + exact (elementary_cubicInsert_ne k A B P Q U V i (j+3) (n+3) (by omega) + f (g.comp (r j).hom) a 2 hab (by intro he; have := congrArg Prod.snd he; omega) x).symm + · by_cases hb : b=j + · subst b + have ha : a=i := by omega + subst a + simp only [secondCubicEntry, LinearMap.comp_apply, elementary_cubicInsert_same] + exact map_second_comp k A B U V f g (r j).hom x + · have hn : (a,b)≠(i,j) := by intro he; exact hb (congrArg Prod.snd he) + have hn' : (a,b+3)≠(i,j+3) := by intro he; have := congrArg Prod.snd he; omega + simp only [secondCubicEntry, LinearMap.comp_apply] + rw [elementary_cubicInsert_ne k A B P Q U V i j n h f g a b (by omega) hn, + elementary_cubicInsert_ne k A B P Q U V i (j+3) (n+3) (by omega) + f (g.comp (r j).hom) a (b+3) hab hn'] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomDifferential.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..38a5e906af6980b3a73696a0e123c72f71c3bfa0 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomDifferential.lean @@ -0,0 +1,195 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorHomComplex + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits HomologicalComplex +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) +variable (U : ModuleCat.{u} A) (V : ModuleCat.{u} B) + +theorem homCochainInclusion_d_tmul (i j n : ℕ) (h : i+j=n) + (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) : + (homCochainTotal k A B P Q U V).d n (n+1) + (homCochainInclusion k A B P Q U V i j n h (f ⊗ₜ[k] g)) = + homCochainInclusion k A B P Q U V (i+1) j (n+1) (show i+1+j=n+1 by omega) + ((f.comp (P.d (i+1) i).hom) ⊗ₜ[k] g) + + (-1 : ℤˣ)^i • homCochainInclusion k A B P Q U V i (j+1) (n+1) (by omega) + (f ⊗ₜ[k] (g.comp (Q.d (j+1) j).hom)) := by + have hd : homCochainInclusion k A B P Q U V i j n h ≫ + (homCochainTotal k A B P Q U V).d n (n+1) = + mapBifunctor.d₁ (homCochain k A P U) (homCochain k B Q V) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.up ℕ) i j (n+1) + + mapBifunctor.d₂ (homCochain k A P U) (homCochain k B Q V) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.up ℕ) i j (n+1) := by + change ιMapBifunctor (homCochain k A P U) (homCochain k B Q V) + (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) (ComplexShape.up ℕ) i j n h ≫ _ = _ + rw [mapBifunctor.d_eq, Preadditive.comp_add, mapBifunctor.ι_D₁, mapBifunctor.ι_D₂] + rw [mapBifunctor.d₁_eq _ _ _ _ (show (ComplexShape.up ℕ).Rel i (i+1) from rfl) j (n+1) (show i+1+j=n+1 by omega), + mapBifunctor.d₂_eq _ _ _ _ i (show (ComplexShape.up ℕ).Rel j (j+1) from rfl) (n+1) (show i+(j+1)=n+1 by omega)] at hd + rw [show ComplexShape.ε₁ (ComplexShape.up ℕ) (ComplexShape.up ℕ) (ComplexShape.up ℕ) (i,j) = (1 : ℤˣ) from rfl, + show ComplexShape.ε₂ (ComplexShape.up ℕ) (ComplexShape.up ℕ) (ComplexShape.up ℕ) (i,j) = (-1 : ℤˣ)^i from rfl, + one_smul] at hd + have hh := congrArg (fun l => l.hom (f ⊗ₜ[k] g)) hd + simp only [homCochain_d, ModuleCat.hom_comp, LinearMap.comp_apply] at hh + exact hh + +variable [∀ n, Module.Finite A (P.X n)] [∀ n, Module.Projective A (P.X n)] +variable [∀ n, Module.Finite B (Q.X n)] [∀ n, Module.Projective B (Q.X n)] + +abbrev elementaryHom (i j n : ℕ) (h : i+j=n) + (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) : + (complex k A B P Q).X n →ₗ[A ⊗[k] B] moduleObject k A B U V := + homCochainTermEquiv k A B P Q U V n + (homCochainInclusion k A B P Q U V i j n h (f ⊗ₜ[k] g)) + +theorem elementary_horizontal_same (i j n : ℕ) (h : i+j=n) + (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) : + (elementaryHom k A B P Q U V i j n h f g).comp + (horizontal k A B P Q (i+1) j n).hom = + map k A B (f.comp (P.d (i+1) i).hom) g := by + rw [horizontal_succ k A B P Q i j n h, ModuleCat.hom_comp, ← LinearMap.comp_assoc] + rw [homCochainTermEquiv_inclusion_same, homMap_tmul] + apply LinearMap.restrictScalars_injective k + apply TensorProduct.ext + apply LinearMap.ext + intro x + apply LinearMap.ext + intro y + rfl + +theorem elementary_horizontal_zero (i j n : ℕ) (h : i+j=n) + (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) + (a b : ℕ) (hab : a+b=n+1) (hne : (a,b) ≠ (i+1,j)) : + (elementaryHom k A B P Q U V i j n h f g).comp + (horizontal k A B P Q a b n).hom = 0 := by + cases a with + | zero => rw [horizontal_zero, ModuleCat.hom_zero, LinearMap.comp_zero] + | succ a => + have hh : a+b=n := by omega + have hn : (a,b) ≠ (i,j) := by intro he; rcases Prod.mk.inj he with ⟨rfl,rfl⟩; exact hne rfl + rw [horizontal_succ k A B P Q a b n hh, ModuleCat.hom_comp, ← LinearMap.comp_assoc, + homCochainTermEquiv_inclusion_ne k A B P Q U V i j n h (f ⊗ₜ[k] g) a b hh hn, + LinearMap.zero_comp] + +theorem elementary_vertical_same (i j n : ℕ) (h : i+j=n) + (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) : + (elementaryHom k A B P Q U V i j n h f g).comp + (vertical k A B P Q i (j+1) n).hom = + (-1 : ℤˣ)^i • map k A B f (g.comp (Q.d (j+1) j).hom) := by + rw [vertical_succ k A B P Q i j n h, ModuleCat.hom_smul, ModuleCat.hom_comp, + LinearMap.comp_smul, ← LinearMap.comp_assoc, homCochainTermEquiv_inclusion_same, homMap_tmul] + congr 1 + apply LinearMap.restrictScalars_injective k + apply TensorProduct.ext + apply LinearMap.ext + intro x + apply LinearMap.ext + intro y + rfl + +theorem elementary_vertical_zero (i j n : ℕ) (h : i+j=n) + (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) + (a b : ℕ) (hab : a+b=n+1) (hne : (a,b) ≠ (i,j+1)) : + (elementaryHom k A B P Q U V i j n h f g).comp + (vertical k A B P Q a b n).hom = 0 := by + cases b with + | zero => rw [vertical_zero, ModuleCat.hom_zero, LinearMap.comp_zero] + | succ b => + have hh : a+b=n := by omega + have hn : (a,b) ≠ (i,j) := by intro he; rcases Prod.mk.inj he with ⟨rfl,rfl⟩; exact hne rfl + rw [vertical_succ k A B P Q a b n hh, ModuleCat.hom_smul, ModuleCat.hom_comp, + LinearMap.comp_smul, ← LinearMap.comp_assoc, + homCochainTermEquiv_inclusion_ne k A B P Q U V i j n h (f ⊗ₜ[k] g) a b hh hn, + LinearMap.zero_comp, smul_zero] + +theorem elementary_d (i j n : ℕ) (h : i+j=n) + (f : P.X i →ₗ[A] U) (g : Q.X j →ₗ[B] V) : + (elementaryHom k A B P Q U V i j n h f g).comp + ((complex k A B P Q).d (n+1) n).hom = + elementaryHom k A B P Q U V (i+1) j (n+1) (by omega) + (f.comp (P.d (i+1) i).hom) g + + (-1 : ℤˣ)^i • elementaryHom k A B P Q U V i (j+1) (n+1) (by omega) + f (g.comp (Q.d (j+1) j).hom) := by + suffices hh : ModuleCat.ofHom (X := (complex k A B P Q).X (n+1)) (Y := moduleObject k A B U V) + ((elementaryHom k A B P Q U V i j n h f g).comp ((complex k A B P Q).d (n+1) n).hom) = + ModuleCat.ofHom (X := (complex k A B P Q).X (n+1)) (Y := moduleObject k A B U V) + (elementaryHom k A B P Q U V (i+1) j (n+1) (by omega) (f.comp (P.d (i+1) i).hom) g + + (-1 : ℤˣ)^i • elementaryHom k A B P Q U V i (j+1) (n+1) (by omega) f (g.comp (Q.d (j+1) j).hom)) by + exact congrArg (fun z => z.hom) hh + apply hom_ext k A B P Q + intro a b hab + apply ModuleCat.hom_ext + change ((elementaryHom k A B P Q U V i j n h f g).comp + ((complex k A B P Q).d (n+1) n).hom).comp (inclusion k A B P Q a b (n+1) hab).hom = + (elementaryHom k A B P Q U V (i+1) j (n+1) (by omega) (f.comp (P.d (i+1) i).hom) g + + (-1 : ℤˣ)^i • elementaryHom k A B P Q U V i (j+1) (n+1) (by omega) f (g.comp (Q.d (j+1) j).hom)).comp + (inclusion k A B P Q a b (n+1) hab).hom + rw [LinearMap.comp_assoc, + show ((complex k A B P Q).d (n+1) n).hom.comp (inclusion k A B P Q a b (n+1) hab).hom = + (horizontal k A B P Q a b n).hom + (vertical k A B P Q a b n).hom from + congrArg (fun z => z.hom) (inclusion_d k A B P Q a b (n+1) n hab), + LinearMap.comp_add, LinearMap.add_comp, LinearMap.smul_comp] + by_cases ha : a=i+1 + · have hb : b=j := by omega + subst a + subst b + have hn : (i+1,j) ≠ (i,j+1) := by intro hh; have := congrArg Prod.fst hh; omega + rw [elementary_horizontal_same, elementary_vertical_zero k A B P Q U V i j n h f g _ _ hab hn, + homCochainTermEquiv_inclusion_same, homMap_tmul, + homCochainTermEquiv_inclusion_ne k A B P Q U V i (j+1) (n+1) (by omega) + (f ⊗ₜ[k] (g.comp (Q.d (j+1) j).hom)) _ _ hab hn, smul_zero] + · by_cases hb : b=j+1 + · have hai : a=i := by omega + subst a + subst b + have hn : (i,j+1) ≠ (i+1,j) := by intro hh; have := congrArg Prod.fst hh; omega + rw [elementary_horizontal_zero k A B P Q U V i j n h f g _ _ hab hn, elementary_vertical_same, + homCochainTermEquiv_inclusion_ne k A B P Q U V (i+1) j (n+1) (by omega) + ((f.comp (P.d (i+1) i).hom) ⊗ₜ[k] g) _ _ hab hn, + homCochainTermEquiv_inclusion_same, homMap_tmul] + · have hna : (a,b) ≠ (i+1,j) := by intro hh; exact ha (congrArg Prod.fst hh) + have hnb : (a,b) ≠ (i,j+1) := by intro hh; exact hb (congrArg Prod.snd hh) + rw [elementary_horizontal_zero k A B P Q U V i j n h f g _ _ hab hna, + elementary_vertical_zero k A B P Q U V i j n h f g _ _ hab hnb, + homCochainTermEquiv_inclusion_ne k A B P Q U V (i+1) j (n+1) (by omega) + ((f.comp (P.d (i+1) i).hom) ⊗ₜ[k] g) _ _ hab hna, + homCochainTermEquiv_inclusion_ne k A B P Q U V i (j+1) (n+1) (by omega) + (f ⊗ₜ[k] (g.comp (Q.d (j+1) j).hom)) _ _ hab hnb, smul_zero] + +def homCochainTotalIso : homCochainTotal k A B P Q U V ≅ + homCochain k (A ⊗[k] B) (complex k A B P Q) (moduleObject k A B U V) := + HomologicalComplex.Hom.isoOfComponents + (fun n => (homCochainTermEquiv k A B P Q U V n).toModuleIso) + (fun n m h => by + have hnm : n+1=m := h + subst m + apply mapBifunctor.hom_ext + intro i j hij + apply ModuleCat.hom_ext + apply TensorProduct.ext + apply LinearMap.ext + intro f + apply LinearMap.ext + intro g + change (P.X i →ₗ[A] U) at f + change (Q.X j →ₗ[B] V) at g + change i+j=n at hij + change (homCochain k (A ⊗[k] B) (complex k A B P Q) (moduleObject k A B U V)).d n (n+1) + (elementaryHom k A B P Q U V i j n hij f g) = + homCochainTermEquiv k A B P Q U V (n+1) + ((homCochainTotal k A B P Q U V).d n (n+1) + (homCochainInclusion k A B P Q U V i j n hij (f ⊗ₜ[k] g))) + rw [homCochainInclusion_d_tmul, homCochain_d] + simp only [map_add, Units.smul_def, map_zsmul] + exact elementary_d k A B P Q U V i j n hij f g) + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomKunneth.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomKunneth.lean new file mode 100644 index 0000000000000000000000000000000000000000..e87314291a12efab9f38a4a667c6a39e75dcef19 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomKunneth.lean @@ -0,0 +1,31 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorHomDifferential +import OAI.Algebra.AuslanderReiten.Homology.VectorCochainKunneth + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits HomologicalComplex +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) +variable (U : ModuleCat.{u} A) (V : ModuleCat.{u} B) +variable [∀ n, Module.Finite A (P.X n)] [∀ n, Module.Projective A (P.X n)] +variable [∀ n, Module.Finite B (Q.X n)] [∀ n, Module.Projective B (Q.X n)] + +def homKunnethEquiv (n : ℕ) : + (homCochain k (A ⊗[k] B) (complex k A B P Q) (moduleObject k A B U V)).homology n ≃ₗ[k] + (Π₀ p : Diagonal n, + ((homCochain k A P U).homology p.val.1 ⊗[k] (homCochain k B Q V).homology p.val.2)) := + (((homologyFunctor (ModuleCat.{u} k) (ComplexShape.up ℕ) n).mapIso + (homCochainTotalIso k A B P Q U V)).symm.toLinearEquiv).trans + (VectorCochain.kunnethLinearEquiv k (MonoidalCategory.curriedTensor (ModuleCat.{u} k)) + (homCochain k A P U) (homCochain k B Q V) n) + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomPairTransport.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomPairTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1ed711bb510680c2cff54457cabffbcd57af296 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomPairTransport.lean @@ -0,0 +1,46 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorHom + +namespace OAI + +noncomputable section +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable {M N U V : Type u} +variable [AddCommGroup M] [AddCommGroup N] [AddCommGroup U] [AddCommGroup V] +variable [Module k M] [Module k N] [Module k U] [Module k V] +variable [Module A M] [Module B N] [Module A U] [Module B V] +variable [IsScalarTower k A M] [IsScalarTower k B N] [IsScalarTower k A U] [IsScalarTower k B V] +variable (a : M →ₗ[k] M) (b : N →ₗ[k] N) (e : U ≃ₗ[k] U) (f : V ≃ₗ[k] V) +variable (α : (M →ₗ[A] U) →ₗ[k] (M →ₗ[A] U)) +variable (β : (N →ₗ[B] V) →ₗ[k] (N →ₗ[B] V)) +variable (hα : ∀ c x, α c x = e.symm (c (a x))) +variable (hβ : ∀ d y, β d y = f.symm (d (b y))) +include hα hβ + +theorem homMap_transport (c : (M →ₗ[A] U) ⊗[k] (N →ₗ[B] V)) + (z : moduleObject k A B M N) : + homMap k A B (TensorProduct.map α β c) z = + (TensorProduct.congr e f).symm (homMap k A B c (TensorProduct.map a b z)) := by + induction c using TensorProduct.inductionOn with + | add c d hc hd => + erw [map_add, map_add, LinearMap.add_apply, map_add, LinearMap.add_apply, map_add] + rw [hc, hd] + rfl + | tmul c d => + induction z using TensorProduct.inductionOn with + | add x y hx hy => + erw [map_add, map_add, map_add, map_add] + rw [hx, hy] + rfl + | tmul x y => + simp only [TensorProduct.map_tmul, homMap_tmul, map_tmul, + TensorProduct.congr_symm, TensorProduct.congr_tmul, hα, hβ] + rfl + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomTransport.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..3388006feca59debee5ce0e2603db59e56d72285 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorHomTransport.lean @@ -0,0 +1,47 @@ +import OAI.Algebra.AuslanderReiten.Ext.ExtKunnethMap + +namespace OAI + +noncomputable section +open CategoryTheory HomologicalComplex +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable {M : ModuleCat.{u} A} {N : ModuleCat.{u} B} +variable (P : ProjectiveResolution M) (Q : ProjectiveResolution N) +variable (U : ModuleCat.{u} A) (V : ModuleCat.{u} B) +variable (f : homCochain k A P.complex U ⟶ homCochain k A P.complex U) +variable (g : homCochain k B Q.complex V ⟶ homCochain k B Q.complex V) +local notation "T" => MonoidalCategory.curriedTensor (ModuleCat k) + +theorem homCochainTermCoordinates_natural (n : ℕ) + (x : (homCochainTotal k A B P.complex Q.complex U V).X n) (p : Diagonal n) : + homCochainTermCoordinates k A B P.complex Q.complex U V n + (((mapBifunctorMap f g T (.up ℕ)).f n).hom x) p = + TensorProduct.map (f.f p.val.1).hom (g.f p.val.2).hom + (homCochainTermCoordinates k A B P.complex Q.complex U V n x p) := by + exact congrFun (VectorCochain.totalTermCoordinates_natural k f g n x) p + +variable [∀ degree, Module.Finite A (P.complex.X degree)] + [∀ degree, Module.Finite B (Q.complex.X degree)] + +theorem homTensorMap_restrict (n : ℕ) + (x : (homCochain k (A ⊗[k] B) (complex k A B P.complex Q.complex) + (moduleObject k A B U V)).X n) (p : Diagonal n) : + (((homTensorMap k A B P Q U V f g).f n).hom x).comp + (inclusion k A B P.complex Q.complex p.val.1 p.val.2 n p.property).hom = + homMap k A B (TensorProduct.map (f.f p.val.1).hom (g.f p.val.2).hom + (homCochainTermCoordinates k A B P.complex Q.complex U V n + ((homCochainTermEquiv k A B P.complex Q.complex U V n).symm x) p)) := by + change (homCochainTermEquiv k A B P.complex Q.complex U V n + (((mapBifunctorMap f g T (.up ℕ)).f n).hom + ((homCochainTermEquiv k A B P.complex Q.complex U V n).symm x))).comp _ = _ + rw [homCochainTermEquiv_restrict, homCochainTermCoordinates_natural] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorModule.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorModule.lean new file mode 100644 index 0000000000000000000000000000000000000000..5822eb9aeb0ad25343c7c8c91e294d6191eab95b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorModule.lean @@ -0,0 +1,95 @@ +import Mathlib.Algebra.Category.ModuleCat.Basic +import Mathlib.RingTheory.TensorProduct.Maps +import Mathlib.RingTheory.TensorProduct.Finite + +namespace OAI + +noncomputable section +open scoped TensorProduct + +namespace ArExplicit.ExternalTensor + +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable (M N : Type u) [AddCommGroup M] [AddCommGroup N] +variable [Module k M] [Module k N] [Module A M] [Module B N] +variable [IsScalarTower k A M] [IsScalarTower k B N] + +def left : A →ₐ[k] Module.End k (M ⊗[k] N) := + (Module.End.rTensorAlgHom k M N).comp (Algebra.lsmul k k M) + +def right : B →ₐ[k] Module.End k (M ⊗[k] N) := + (Module.End.lTensorAlgHom k N M).comp (Algebra.lsmul k k N) + +@[simp] theorem left_tmul (a : A) (m : M) (n : N) : + left k A M N a (m ⊗ₜ[k] n) = (a • m) ⊗ₜ[k] n := rfl + +@[simp] theorem right_tmul (b : B) (m : M) (n : N) : + right k B M N b (m ⊗ₜ[k] n) = m ⊗ₜ[k] (b • n) := rfl + +theorem left_right (a : A) (b : B) (z : M ⊗[k] N) : + left k A M N a (right k B M N b z) = + right k B M N b (left k A M N a z) := by + induction z using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy] + | tmul m n => rfl + +def representation : (A ⊗[k] B) →ₐ[k] Module.End k (M ⊗[k] N) := + Algebra.TensorProduct.lift (left k A M N) (right k B M N) fun a b => by + apply LinearMap.ext + exact left_right k A B M N a b + +@[instance_reducible] def module : Module (A ⊗[k] B) (M ⊗[k] N) := + Module.compHom (M ⊗[k] N) (representation k A B M N).toRingHom + +def moduleObject : ModuleCat.{u} (A ⊗[k] B) := + letI := module k A B M N + ModuleCat.of (A ⊗[k] B) (M ⊗[k] N) + +instance baseModule : Module k (moduleObject k A B M N) := + inferInstanceAs (Module k (M ⊗[k] N)) + +instance tower : IsScalarTower k (A ⊗[k] B) (moduleObject k A B M N) := + IsScalarTower.of_algebraMap_smul (A := A ⊗[k] B) fun a x => by + change representation k A B M N (algebraMap k (A ⊗[k] B) a) x = a • x + rw [AlgHom.commutes] + rfl + +@[simp] theorem smul_tmul (a : A) (b : B) (m : M) (n : N) : + @SMul.smul (A ⊗[k] B) (moduleObject k A B M N) + (moduleObject k A B M N).isModule.toSMul (a ⊗ₜ[k] b) (m ⊗ₜ[k] n) = + ((a • m) ⊗ₜ[k] (b • n) : moduleObject k A B M N) := rfl + +instance finite [Module.Finite k M] [Module.Finite k N] : + Module.Finite k (moduleObject k A B M N) := + inferInstanceAs (Module.Finite k (M ⊗[k] N)) + +variable {M N} +variable {M' N' : Type u} [AddCommGroup M'] [AddCommGroup N'] +variable [Module k M'] [Module k N'] [Module A M'] [Module B N'] +variable [IsScalarTower k A M'] [IsScalarTower k B N'] + +def map (f : M →ₗ[A] M') (g : N →ₗ[B] N') : + moduleObject k A B M N →ₗ[A ⊗[k] B] moduleObject k A B M' N' where + toAddHom := (TensorProduct.map (f.restrictScalars k) (g.restrictScalars k)).toAddHom + map_smul' a z := by + let F := TensorProduct.map (f.restrictScalars k) (g.restrictScalars k) + let w : M ⊗[k] N := z + change F (representation k A B M N a w) = representation k A B M' N' a (F w) + induction a using TensorProduct.inductionOn with + | add a b ha hb => simp only [map_add, LinearMap.add_apply, ha, hb] + | tmul a b => + induction w using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy] + | tmul m n => + change (f (a • m)) ⊗ₜ[k] (g (b • n)) = (a • f m) ⊗ₜ[k] (b • g n) + rw [map_smul, map_smul] + +@[simp] theorem map_tmul (f : M →ₗ[A] M') (g : N →ₗ[B] N') (m : M) (n : N) : + map k A B f g (m ⊗ₜ[k] n) = (f m) ⊗ₜ[k] (g n) := rfl + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorProjective.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorProjective.lean new file mode 100644 index 0000000000000000000000000000000000000000..3062a4c034531e877f3e9876c3230ad38ca5265e --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorProjective.lean @@ -0,0 +1,81 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorModule +import Mathlib.Algebra.Module.Projective +import Mathlib.LinearAlgebra.TensorProduct.Pi +import Mathlib.LinearAlgebra.Finsupp.Pi +import Mathlib.RingTheory.Finiteness.Cardinality +import Mathlib.LinearAlgebra.StdBasis + +namespace OAI + +noncomputable section +open scoped TensorProduct + +namespace ArExplicit.ExternalTensor + +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] + +def freeCoordinates (n m : ℕ) : + (Fin n → A) ⊗[k] (Fin m → B) ≃ₗ[k] (Fin n → Fin m → A ⊗[k] B) := + (TensorProduct.piLeft k (Fin m → B) (fun _ : Fin n => A)).trans + (LinearEquiv.piCongrRight fun _ => TensorProduct.piRight k k A (fun _ : Fin m => B)) + +@[simp] theorem freeCoordinates_tmul (n m : ℕ) (a : Fin n → A) (b : Fin m → B) + (i : Fin n) (j : Fin m) : + freeCoordinates k A B n m (a ⊗ₜ[k] b) i j = (a i) ⊗ₜ[k] (b j) := by + simp [freeCoordinates, TensorProduct.piLeft, TensorProduct.piRight_apply, + TensorProduct.piRightHom_tmul] + +def freeEquiv (n m : ℕ) : + moduleObject k A B (Fin n → A) (Fin m → B) ≃ₗ[A ⊗[k] B] + (Fin n → Fin m → A ⊗[k] B) where + __ := (freeCoordinates k A B n m).toAddEquiv + map_smul' a z := by + let w : (Fin n → A) ⊗[k] (Fin m → B) := z + change freeCoordinates k A B n m (representation k A B _ _ a w) = + a • freeCoordinates k A B n m w + induction a using TensorProduct.inductionOn with + | add a b ha hb => simp only [map_add, LinearMap.add_apply, add_smul, ha, hb] + | tmul a b => + induction w using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, smul_add, hx, hy] + | tmul x y => + funext i j + change freeCoordinates k A B n m ((a • x) ⊗ₜ[k] (b • y)) i j = + (a ⊗ₜ[k] b) * freeCoordinates k A B n m (x ⊗ₜ[k] y) i j + simp only [freeCoordinates_tmul, Pi.smul_apply, smul_eq_mul, + Algebra.TensorProduct.tmul_mul_tmul] + +instance freeFree (n m : ℕ) : + Module.Free (A ⊗[k] B) (moduleObject k A B (Fin n → A) (Fin m → B)) := + Module.Free.of_equiv (freeEquiv k A B n m).symm + +variable {M N : Type u} [AddCommGroup M] [AddCommGroup N] +variable [Module k M] [Module k N] [Module A M] [Module B N] +variable [IsScalarTower k A M] [IsScalarTower k B N] + +theorem projective [Module.Finite A M] [Module.Projective A M] + [Module.Finite B N] [Module.Projective B N] : + Module.Projective (A ⊗[k] B) (moduleObject k A B M N) := by + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' A M + obtain ⟨m, q, hq⟩ := Module.Finite.exists_fin' B N + obtain ⟨s, hs⟩ := Module.projective_lifting_property p (LinearMap.id : M →ₗ[A] M) hp + obtain ⟨t, ht⟩ := Module.projective_lifting_property q (LinearMap.id : N →ₗ[B] N) hq + apply Module.Projective.of_split (map k A B s t) (map k A B p q) + apply LinearMap.ext + intro z + let w : M ⊗[k] N := z + change TensorProduct.map (p.restrictScalars k) (q.restrictScalars k) + (TensorProduct.map (s.restrictScalars k) (t.restrictScalars k) w) = w + induction w using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy] + | tmul x y => + simp only [TensorProduct.map_tmul, LinearMap.restrictScalars_apply, + show p (s x) = x from DFunLike.congr_fun hs x, + show q (t y) = y from DFunLike.congr_fun ht y] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorRegular.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorRegular.lean new file mode 100644 index 0000000000000000000000000000000000000000..1187e0dc711997c4ac758247fa586af9202cbc77 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorRegular.lean @@ -0,0 +1,38 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorModule + +namespace OAI + +noncomputable section +open scoped TensorProduct + +namespace ArExplicit.ExternalTensor + +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] + +def regularEquiv : moduleObject k A B A B ≃ₗ[A ⊗[k] B] (A ⊗[k] B) where + toFun x := x + invFun x := x + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' a z := by + let w : A ⊗[k] B := z + change representation k A B A B a w = a * w + induction a using TensorProduct.inductionOn with + | add a b ha hb => simp only [map_add, LinearMap.add_apply, add_mul, ha, hb] + | tmul a b => + induction w using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, mul_add, hx, hy] + | tmul x y => + rw [Algebra.TensorProduct.tmul_mul_tmul] + rfl + +@[simp] theorem regularEquiv_apply (x : moduleObject k A B A B) : + regularEquiv k A B x = (x : A ⊗[k] B) := rfl + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorResolution.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e5f2e6872723f0e57fb1991959cf44b6ff1c2be --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorResolution.lean @@ -0,0 +1,49 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorSingle +import Mathlib.CategoryTheory.Abelian.Projective.Resolution + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory CategoryTheory.Limits HomologicalComplex +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable {M : ModuleCat.{u} A} {N : ModuleCat.{u} B} +variable (P : ProjectiveResolution M) (Q : ProjectiveResolution N) +variable [∀ n, Module.Finite A (P.complex.X n)] [∀ n, Module.Finite B (Q.complex.X n)] + +def augmentation : complex k A B P.complex Q.complex ⟶ + (ChainComplex.single₀ (ModuleCat (A ⊗[k] B))).obj (moduleObject k A B M N) := + mapBifunctorMap P.π Q.π (bifunctor k A B) (ComplexShape.down ℕ) ≫ + (singleTotalIso k A B M N).hom + +def projectiveResolution : ProjectiveResolution (moduleObject k A B M N) where + complex := complex k A B P.complex Q.complex + projective n := by + have : Module.Projective (A ⊗[k] B) ((complex k A B P.complex Q.complex).X n) := + term_projective k A B P.complex Q.complex n + infer_instance + π := augmentation k A B P Q + quasiIso := by + have := map_quasiIso k A B P.π Q.π + change QuasiIso (mapBifunctorMap P.π Q.π (bifunctor k A B) (ComplexShape.down ℕ) ≫ + (singleTotalIso k A B M N).hom) + infer_instance + +theorem differential_exact (n : ℕ) : + Function.Exact ((complex k A B P.complex Q.complex).d (n+2) (n+1)).hom + ((complex k A B P.complex Q.complex).d (n+1) n).hom := by + have h := (projectiveResolution k A B P Q).exact_succ n + rw [ShortComplex.ShortExact.moduleCat_exact_iff_function_exact] at h + exact h + +theorem augmentation_surjective : Function.Surjective ((augmentation k A B P Q).f 0) := + (ModuleCat.epi_iff_surjective ((projectiveResolution k A B P Q).π.f 0)).mp inferInstance + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalar.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalar.lean new file mode 100644 index 0000000000000000000000000000000000000000..7fd00f2eb4d149f977905c24069a2b86ba576f2b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalar.lean @@ -0,0 +1,42 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorModule +import OAI.Algebra.AuslanderReiten.BaseChange.ScalarExtensionComplete + +namespace OAI + +noncomputable section +open CategoryTheory +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable (M N : Type u) [AddCommGroup M] [AddCommGroup N] +variable [Module A M] [Module B N] [mM : Module k M] [mN : Module k N] +variable [IsScalarTower k A M] [IsScalarTower k B N] + +theorem canonicalScalar_eq : + moduleCatBaseModule (k := k) (R := A) (ModuleCat.of A M) = mM := by + apply Module.ext' + intro a x + exact IsScalarTower.algebraMap_smul A a x + +def canonicalTensorObject : ModuleCat.{u} (A ⊗[k] B) := + letI : Module k M := moduleCatBaseModule (k := k) (R := A) (ModuleCat.of A M) + letI : Module k N := moduleCatBaseModule (k := k) (R := B) (ModuleCat.of B N) + letI : IsScalarTower k A M := moduleCatBaseTower (k := k) (R := A) (ModuleCat.of A M) + letI : IsScalarTower k B N := moduleCatBaseTower (k := k) (R := B) (ModuleCat.of B N) + moduleObject k A B M N + +theorem canonicalTensorObject_eq : + canonicalTensorObject k A B M N = moduleObject k A B M N := by + cases canonicalScalar_eq k A M (mM := mM) + cases canonicalScalar_eq k B N (mM := mN) + rfl + +def canonicalTensorIso : canonicalTensorObject k A B M N ≅ moduleObject k A B M N := + eqToIso (canonicalTensorObject_eq k A B M N) + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarExt.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarExt.lean new file mode 100644 index 0000000000000000000000000000000000000000..f0fa5b274456ccf72c05566aa79ed8208b76e6b8 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarExt.lean @@ -0,0 +1,27 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorScalar +import Mathlib.Algebra.Category.ModuleCat.Ext.HasExt +import Mathlib.Algebra.Homology.DerivedCategory.Ext.Linear +import Mathlib.Algebra.Category.ModuleCat.Algebra + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open scoped TensorProduct ModuleCat.Algebra +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable (M N : Type u) [AddCommGroup M] [AddCommGroup N] +variable [Module A M] [Module B N] [Module k M] [Module k N] +variable [IsScalarTower k A M] [IsScalarTower k B N] + +def selfExtScalarEquiv (n : ℕ) : + Ext (moduleObject k A B M N) (moduleObject k A B M N) n ≃ₗ[k] + Ext (canonicalTensorObject k A B M N) (canonicalTensorObject k A B M N) n := by + rw [canonicalTensorObject_eq] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarIso.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarIso.lean new file mode 100644 index 0000000000000000000000000000000000000000..883bbcbb110075fd149efbc6d009e956fd931bb7 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarIso.lean @@ -0,0 +1,37 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorScalarExt +import OAI.Algebra.AuslanderReiten.Ext.ExtIsoFunctor + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open scoped TensorProduct ModuleCat.Algebra +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable (M N : Type u) [AddCommGroup M] [AddCommGroup N] +variable [Module A M] [Module B N] [mM : Module k M] [mN : Module k N] +variable [IsScalarTower k A M] [IsScalarTower k B N] + +theorem selfExtScalarEquiv_eq_iso (n : ℕ) + (x : Ext (moduleObject k A B M N) (moduleObject k A B M N) n) : + selfExtScalarEquiv k A B M N n x = + selfExtIso (k := k) (canonicalTensorIso k A B M N).symm n x := by + cases canonicalScalar_eq k A M (mM := mM) + cases canonicalScalar_eq k B N (mM := mN) + change x = ((Ext.mk₀ (𝟙 _)).comp x (zero_add n)).comp (Ext.mk₀ (𝟙 _)) (add_zero n) + simp + +theorem selfExtScalarEquiv_symm_eq_iso (n : ℕ) + (x : Ext (canonicalTensorObject k A B M N) (canonicalTensorObject k A B M N) n) : + (selfExtScalarEquiv k A B M N n).symm x = + selfExtIso (k := k) (canonicalTensorIso k A B M N) n x := by + apply (selfExtScalarEquiv k A B M N n).injective + rw [LinearEquiv.apply_symm_apply, selfExtScalarEquiv_eq_iso] + simp [selfExtIso_apply] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarProducts.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9cdb5db8dd94c8c2543d2fca5495b0b738a7318 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarProducts.lean @@ -0,0 +1,44 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorScalarExt + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Abelian +open scoped TensorProduct ModuleCat.Algebra +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable (M N : Type u) [AddCommGroup M] [AddCommGroup N] +variable [Module A M] [Module B N] [mM : Module k M] [mN : Module k N] +variable [IsScalarTower k A M] [IsScalarTower k B N] + +@[simp] theorem selfExtScalarEquiv_identity : + selfExtScalarEquiv k A B M N 0 (Ext.mk₀ (𝟙 (moduleObject k A B M N))) = + Ext.mk₀ (𝟙 (canonicalTensorObject k A B M N)) := by + cases canonicalScalar_eq k A M (mM := mM) + cases canonicalScalar_eq k B N (mM := mN) + rfl + +theorem selfExtScalarEquiv_comp {i j n : ℕ} + (x : Ext (moduleObject k A B M N) (moduleObject k A B M N) i) + (y : Ext (moduleObject k A B M N) (moduleObject k A B M N) j) (h : i+j=n) : + selfExtScalarEquiv k A B M N n (x.comp y h) = + (selfExtScalarEquiv k A B M N i x).comp (selfExtScalarEquiv k A B M N j y) h := by + cases canonicalScalar_eq k A M (mM := mM) + cases canonicalScalar_eq k B N (mM := mN) + rfl + +theorem selfExtScalarEquiv_symm_comp {i j n : ℕ} + (x : Ext (canonicalTensorObject k A B M N) (canonicalTensorObject k A B M N) i) + (y : Ext (canonicalTensorObject k A B M N) (canonicalTensorObject k A B M N) j) (h : i+j=n) : + (selfExtScalarEquiv k A B M N n).symm (x.comp y h) = + ((selfExtScalarEquiv k A B M N i).symm x).comp ((selfExtScalarEquiv k A B M N j).symm y) h := by + apply (selfExtScalarEquiv k A B M N n).injective + rw [selfExtScalarEquiv_comp] + simp + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarPure.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarPure.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f5aa8536e6f3e36f30d096181affed7a00c6caf --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorScalarPure.lean @@ -0,0 +1,35 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorScalar + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory +open scoped TensorProduct +universe u +variable (k A B M N : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable [AddCommGroup M] [AddCommGroup N] [Module A M] [Module B N] +variable [μ : Module k M] [ν : Module k N] [IsScalarTower k A M] [IsScalarTower k B N] + +def canonicalTmul (x : M) (y : N) : canonicalTensorObject k A B M N := + letI : Module k M := moduleCatBaseModule (k := k) (R := A) (ModuleCat.of A M) + letI : Module k N := moduleCatBaseModule (k := k) (R := B) (ModuleCat.of B N) + x ⊗ₜ[k] y + +@[simp] theorem canonicalTensorIso_tmul (x : M) (y : N) : + (canonicalTensorIso k A B M N).hom (canonicalTmul k A B M N x y) = x ⊗ₜ[k] y := by + cases canonicalScalar_eq k A M (mM := μ) + cases canonicalScalar_eq k B N (mM := ν) + rfl + +@[simp] theorem canonicalTensorIso_inv_tmul (x : M) (y : N) : + (canonicalTensorIso k A B M N).inv (x ⊗ₜ[k] y) = canonicalTmul k A B M N x y := by + cases canonicalScalar_eq k A M (mM := μ) + cases canonicalScalar_eq k B N (mM := ν) + rfl + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorSemilinear.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorSemilinear.lean new file mode 100644 index 0000000000000000000000000000000000000000..000f5e403cf027dc5ddc482599ab5f0318fede64 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorSemilinear.lean @@ -0,0 +1,74 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorModule +import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings + +namespace OAI + +noncomputable section +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable {M N M' N' : Type u} +variable [AddCommGroup M] [AddCommGroup N] [AddCommGroup M'] [AddCommGroup N'] +variable [Module k M] [Module k N] [Module k M'] [Module k N'] +variable [Module A M] [Module B N] [Module A M'] [Module B N'] +variable [IsScalarTower k A M] [IsScalarTower k B N] +variable [IsScalarTower k A M'] [IsScalarTower k B N'] +variable (h : A ≃ₐ[k] A) (j : B ≃ₐ[k] B) +variable (e : M →ₗ[k] M') (f : N →ₗ[k] N') +variable (he : ∀ a m, e (a • m) = h a • e m) +variable (hf : ∀ b n, f (b • n) = j b • f n) + +include he hf in +theorem tensorSemilinear_smul (r : A ⊗[k] B) (x : moduleObject k A B M N) : + TensorProduct.map e f (r • x) = + (Algebra.TensorProduct.map h.toAlgHom j.toAlgHom r) • + (show moduleObject k A B M' N' from TensorProduct.map e f x) := by + let w : M ⊗[k] N := x + change TensorProduct.map e f (representation k A B M N r w) = + representation k A B M' N' (Algebra.TensorProduct.map h.toAlgHom j.toAlgHom r) + (TensorProduct.map e f w) + induction r using TensorProduct.inductionOn with + | add a b ha hb => simp only [map_add, LinearMap.add_apply, ha, hb] + | tmul a b => + induction w using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy] + | tmul m n => + change e (a • m) ⊗ₜ[k] f (b • n) = (h a • e m) ⊗ₜ[k] (j b • f n) + rw [he, hf] + +def tensorSemilinear : moduleObject k A B M N →ₗ[A ⊗[k] B] + (ModuleCat.restrictScalars + (Algebra.TensorProduct.map h.toAlgHom j.toAlgHom).toRingHom).obj + (moduleObject k A B M' N') where + toAddHom := (TensorProduct.map e f).toAddHom + map_smul' := tensorSemilinear_smul k A B h j e f he hf + +@[simp] theorem tensorSemilinear_tmul (m : M) (n : N) : + tensorSemilinear k A B h j e f he hf (m ⊗ₜ[k] n) = e m ⊗ₜ[k] f n := rfl + +def tensorSemilinearEquiv (e : M ≃ₗ[k] M') (f : N ≃ₗ[k] N') + (he : ∀ a m, e (a • m) = h a • e m) + (hf : ∀ b n, f (b • n) = j b • f n) : + moduleObject k A B M N ≃ₗ[A ⊗[k] B] + (ModuleCat.restrictScalars + (Algebra.TensorProduct.map h.toAlgHom j.toAlgHom).toRingHom).obj + (moduleObject k A B M' N') := + LinearEquiv.ofBijective (tensorSemilinear k A B h j e.toLinearMap f.toLinearMap he hf) + (TensorProduct.congr e f).bijective + +theorem tensorSemilinearEquiv_symm_apply (e : M ≃ₗ[k] M') (f : N ≃ₗ[k] N') + (he : ∀ a m, e (a • m) = h a • e m) + (hf : ∀ b n, f (b • n) = j b • f n) + (z : moduleObject k A B M' N') : + (tensorSemilinearEquiv k A B h j e f he hf).symm z = + (TensorProduct.congr e f).symm z := by + apply (tensorSemilinearEquiv k A B h j e f he hf).injective + erw [LinearEquiv.apply_symm_apply] + exact ((TensorProduct.congr e f).apply_symm_apply z).symm + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorSingle.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorSingle.lean new file mode 100644 index 0000000000000000000000000000000000000000..825f642721075a11dc49fa8d03d8ec21fb422cb1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorSingle.lean @@ -0,0 +1,70 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorExact +import Mathlib.Algebra.Homology.Single + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory CategoryTheory.Limits HomologicalComplex +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +instance diagonalZeroUnique : Unique (Diagonal 0) where + default := ⟨(0,0),rfl⟩ + uniq p := by + apply Subtype.ext + apply Prod.ext <;> have h := p.property <;> dsimp at * <;> omega + +variable (M : ModuleCat.{u} A) (N : ModuleCat.{u} B) + +abbrev singleTotal := complex k A B ((ChainComplex.single₀ (ModuleCat A)).obj M) + ((ChainComplex.single₀ (ModuleCat B)).obj N) + +def singleTotalZeroEquiv : (singleTotal k A B M N).X 0 ≃ₗ[A ⊗[k] B] + moduleObject k A B M N := + (termPiEquiv k A B _ _ 0).trans + { Equiv.piUnique (fun p : Diagonal 0 => + summands k A B ((ChainComplex.single₀ (ModuleCat A)).obj M) + ((ChainComplex.single₀ (ModuleCat B)).obj N) 0 p) with + map_add' _ _ := rfl + map_smul' _ _ := rfl } + +theorem singleTotal_summand_isZero (n : ℕ) (hn : n ≠ 0) (p : Diagonal n) : + IsZero (summands k A B ((ChainComplex.single₀ (ModuleCat A)).obj M) + ((ChainComplex.single₀ (ModuleCat B)).obj N) n p) := by + by_cases hi : p.val.1 = 0 + · have hj : p.val.2 ≠ 0 := by have h := p.property; omega + exact (rightFunctor k A B (((ChainComplex.single₀ (ModuleCat A)).obj M).X p.val.1)).map_isZero + (isZero_single_obj_X _ _ _ _ hj) + · exact ((bifunctor k A B).flip.obj (((ChainComplex.single₀ (ModuleCat B)).obj N).X p.val.2)).map_isZero + (isZero_single_obj_X _ _ _ _ hi) + +theorem singleTotal_isZero (n : ℕ) (hn : n ≠ 0) : IsZero ((singleTotal k A B M N).X n) := by + have (p : Diagonal n) : Subsingleton + (summands k A B ((ChainComplex.single₀ (ModuleCat A)).obj M) + ((ChainComplex.single₀ (ModuleCat B)).obj N) n p) := + ModuleCat.subsingleton_of_isZero (singleTotal_summand_isZero k A B M N n hn p) + apply ModuleCat.isZero_iff_subsingleton.mpr + exact (termPiEquiv k A B _ _ n).injective.subsingleton + +def singleTotalTermIso (n : ℕ) : (singleTotal k A B M N).X n ≅ + ((ChainComplex.single₀ (ModuleCat (A ⊗[k] B))).obj (moduleObject k A B M N)).X n := by + by_cases hn : n=0 + · subst n + exact (singleTotalZeroEquiv k A B M N).toModuleIso + · exact (singleTotal_isZero k A B M N n hn).iso (isZero_single_obj_X _ _ _ _ hn) + +def singleTotalIso : singleTotal k A B M N ≅ + (ChainComplex.single₀ (ModuleCat (A ⊗[k] B))).obj (moduleObject k A B M N) := + HomologicalComplex.Hom.isoOfComponents (singleTotalTermIso k A B M N) (by + intro i j hij + have hi : i ≠ 0 := by change j+1=i at hij; omega + exact (singleTotal_isZero k A B M N i hi).eq_of_src _ _) + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorTransport.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..350a4990b872e4a124c2e08e229b596e916a0f96 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorTransport.lean @@ -0,0 +1,137 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorSemilinear +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorDifferential + +namespace OAI + +noncomputable section +open CategoryTheory CategoryTheory.Limits +open scoped TensorProduct +namespace ArExplicit.ExternalTensor +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (h : A ≃ₐ[k] A) (j : B ≃ₐ[k] B) + +abbrev tensorRestriction : ModuleCat.{u} (A ⊗[k] B) ⥤ ModuleCat.{u} (A ⊗[k] B) := + ModuleCat.restrictScalars (Algebra.TensorProduct.map h.toAlgHom j.toAlgHom).toRingHom + +local notation "F" => tensorRestriction k A B h j + +section Naturality +variable {M M' : ModuleCat.{u} A} {N N' : ModuleCat.{u} B} +variable (e : M →ₗ[k] M) (e' : M' →ₗ[k] M') +variable (f : N →ₗ[k] N) (f' : N' →ₗ[k] N') +variable (he : ∀ a x, e (a • x) = h a • e x) +variable (he' : ∀ a x, e' (a • x) = h a • e' x) +variable (hf : ∀ b x, f (b • x) = j b • f x) +variable (hf' : ∀ b x, f' (b • x) = j b • f' x) +variable (a : M ⟶ M') (b : N ⟶ N') +variable (ha : ∀ x, a.hom (e x) = e' (a.hom x)) +variable (hb : ∀ x, b.hom (f x) = f' (b.hom x)) + +include ha hb in +theorem tensorSemilinear_natural : + ModuleCat.ofHom (X := moduleObject k A B M N) (Y := (F).obj (moduleObject k A B M N)) + (tensorSemilinear k A B h j e f he hf) ≫ + (F).map + (mapHom k A B a b) = + mapHom k A B a b ≫ ModuleCat.ofHom + (X := moduleObject k A B M' N') (Y := (F).obj (moduleObject k A B M' N')) + (tensorSemilinear k A B h j e' f' he' hf') := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro z + let w : M ⊗[k] N := z + change TensorProduct.map (a.hom.restrictScalars k) (b.hom.restrictScalars k) + (TensorProduct.map e f w) = + TensorProduct.map e' f' (TensorProduct.map (a.hom.restrictScalars k) (b.hom.restrictScalars k) w) + induction w using TensorProduct.inductionOn with + | add x y hx hy => simp only [map_add, hx, hy] + | tmul x y => + simp only [TensorProduct.map_tmul, LinearMap.restrictScalars_apply] + exact congrArg₂ (fun s t => s ⊗ₜ[k] t) (ha x) (hb y) +end Naturality + +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) +variable (e : ∀ n, P.X n →ₗ[k] P.X n) (f : ∀ n, Q.X n →ₗ[k] Q.X n) +variable (he : ∀ n a x, e n (a • x) = h a • e n x) +variable (hf : ∀ n b x, f n (b • x) = j b • f n x) +def transportSummand (i j' : ℕ) : moduleObject k A B (P.X i) (Q.X j') ⟶ + (F).obj (moduleObject k A B (P.X i) (Q.X j')) := + ModuleCat.ofHom (X := moduleObject k A B (P.X i) (Q.X j')) + (Y := (F).obj (moduleObject k A B (P.X i) (Q.X j'))) + (tensorSemilinear k A B h j (e i) (f j') (he i) (hf j')) + +def transportTerm (n : ℕ) : (complex k A B P Q).X n ⟶ + (F).obj ((complex k A B P Q).X n) := + desc k A B P Q (fun i j' hij => + transportSummand k A B h j P Q e f he hf i j' ≫ + (F).map (inclusion k A B P Q i j' n hij)) + +@[reassoc] theorem inclusion_transportTerm (i j' n : ℕ) (hij : i+j'=n) : + inclusion k A B P Q i j' n hij ≫ transportTerm k A B h j P Q e f he hf n = + transportSummand k A B h j P Q e f he hf i j' ≫ + (F).map (inclusion k A B P Q i j' n hij) := + inclusion_desc k A B P Q _ i j' hij + +variable (hdP : ∀ n x, (P.d (n+1) n).hom (e (n+1) x) = e n ((P.d (n+1) n).hom x)) +variable (hdQ : ∀ n x, (Q.d (n+1) n).hom (f (n+1) x) = f n ((Q.d (n+1) n).hom x)) + +include hdP in +theorem horizontal_transport (i j' n : ℕ) (hij : i+j'=n+1) : + horizontal k A B P Q i j' n ≫ transportTerm k A B h j P Q e f he hf n = + transportSummand k A B h j P Q e f he hf i j' ≫ + (F).map (horizontal k A B P Q i j' n) := by + cases i with + | zero => simp only [horizontal_zero, Functor.map_zero, zero_comp, comp_zero] + | succ i => + have hi : i+j'=n := by omega + rw [horizontal_succ k A B P Q i j' n hi, Category.assoc, + inclusion_transportTerm, Functor.map_comp, ← Category.assoc, ← Category.assoc] + apply congrArg (fun t => t ≫ (F).map (inclusion k A B P Q i j' n hi)) + exact (tensorSemilinear_natural k A B h j (e (i+1)) (e i) (f j') (f j') + (he (i+1)) (he i) (hf j') (hf j') (P.d (i+1) i) (𝟙 (Q.X j')) + (hdP i) (fun _ => rfl)).symm + +include hdQ in +theorem vertical_transport (i j' n : ℕ) (hij : i+j'=n+1) : + vertical k A B P Q i j' n ≫ transportTerm k A B h j P Q e f he hf n = + transportSummand k A B h j P Q e f he hf i j' ≫ + (F).map (vertical k A B P Q i j' n) := by + cases j' with + | zero => simp only [vertical_zero, Functor.map_zero, zero_comp, comp_zero] + | succ j' => + have hi : i+j'=n := by omega + rw [vertical_succ k A B P Q i j' n hi, Linear.units_smul_comp, + Category.assoc, inclusion_transportTerm, Functor.map_units_smul, + Linear.comp_units_smul, Functor.map_comp, ← Category.assoc, ← Category.assoc] + apply congrArg (fun t => ((-1 : ℤˣ)^i) • t) + apply congrArg (fun t => t ≫ (F).map (inclusion k A B P Q i j' n hi)) + exact (tensorSemilinear_natural k A B h j (e i) (e i) (f (j'+1)) (f j') + (he i) (he i) (hf (j'+1)) (hf j') (𝟙 (P.X i)) (Q.d (j'+1) j') + (fun _ => rfl) (hdQ j')).symm + +def transportComplex : complex k A B P Q ⟶ + ((F).mapHomologicalComplex (.down ℕ)).obj (complex k A B P Q) where + f n := transportTerm k A B h j P Q e f he hf n + comm' n m hnm := by + have hn : m+1=n := hnm + subst n + apply hom_ext k A B P Q + intro i j' hij + change inclusion k A B P Q i j' (m+1) hij ≫ + (transportTerm k A B h j P Q e f he hf (m+1) ≫ + (F).map ((complex k A B P Q).d (m+1) m)) = + inclusion k A B P Q i j' (m+1) hij ≫ + ((complex k A B P Q).d (m+1) m ≫ transportTerm k A B h j P Q e f he hf m) + rw [← Category.assoc, inclusion_transportTerm, Category.assoc, + ← Functor.map_comp, inclusion_d, Functor.map_add, Preadditive.comp_add, + ← Category.assoc, inclusion_d, Preadditive.add_comp, + horizontal_transport k A B h j P Q e f he hf hdP i j' m hij, + vertical_transport k A B h j P Q e f he hf hdQ i j' m hij] + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorTwoCone.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorTwoCone.lean new file mode 100644 index 0000000000000000000000000000000000000000..7f1e25737bce92a0988b56a0e68fe22b32eecec4 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorTwoCone.lean @@ -0,0 +1,33 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorCubicChain +import OAI.Algebra.AuslanderReiten.Cones.TwoConeRestriction + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory +open scoped TensorProduct +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable [CharP k 2] +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) +variable (p : (n : ℕ) → P.X (n+3) ⟶ P.X n) +variable (r : (n : ℕ) → Q.X (n+3) ⟶ Q.X n) +variable (hp : ∀ n, p (n+1) ≫ P.d (n+1) n = P.d (n+4) (n+3) ≫ p n) +variable (hr : ∀ n, r (n+1) ≫ Q.d (n+1) n = Q.d (n+4) (n+3) ≫ r n) + +abbrev twoConeData : TwoCone.Data (A ⊗[k] B) where + term := (complex k A B P Q).X + d n := ((complex k A B P Q).d (n+1) n).hom + first := firstCubic k A B P Q p + second := secondCubic k A B P Q r + square n := congrArg ModuleCat.Hom.hom ((complex k A B P Q).d_comp_d (n+2) (n+1) n) + first_comm := firstCubic_chain k A B P Q p hp + second_comm := secondCubic_chain k A B P Q r hr + comparisons_comm := cubic_commute k A B P Q p r + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorZeroEquiv.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorZeroEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..d17828d196f0705c217ca0c731ac79bfff0a6ad7 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/ExternalTensorZeroEquiv.lean @@ -0,0 +1,30 @@ +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorDegreeZero +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorDifferential + +namespace OAI + +noncomputable section +namespace ArExplicit.ExternalTensor +open CategoryTheory +open scoped TensorProduct ModuleCat.Algebra +universe u +variable (k A B : Type u) [Field k] [Ring A] [Ring B] [Algebra k A] [Algebra k B] +variable (P : ChainComplex (ModuleCat.{u} A) ℕ) (Q : ChainComplex (ModuleCat.{u} B) ℕ) + +def zeroEquiv : (complex k A B P Q).X 0 ≃ₗ[A ⊗[k] B] + moduleObject k A B (P.X 0) (Q.X 0) where + toLinearMap := bottomProjection k A B P Q 0 + invFun := cubicInsert k A B P Q 0 ⟨(0,0),rfl⟩ + left_inv := bottomInsert_projection_zero k A B P Q + right_inv := bottomProjection_bottom k A B P Q 0 + +theorem zeroEquiv_symm (x : moduleObject k A B (P.X 0) (Q.X 0)) : + (zeroEquiv k A B P Q).symm x = inclusion k A B P Q 0 0 0 rfl x := by + change cubicInsert k A B P Q 0 ⟨(0,0),rfl⟩ x = _ + exact (LinearMap.congr_fun (inclusion_eq_directSum k A B P Q 0 0 0 rfl) x).symm + +end ArExplicit.ExternalTensor + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedEnvelopingEndpoint.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedEnvelopingEndpoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..9daf794bbc9e4b84ab88d958255ee96f2cc94431 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedEnvelopingEndpoint.lean @@ -0,0 +1,23 @@ +import OAI.Algebra.AuslanderReiten.Tensor.TwistedEnvelopingFunctor + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (σ : R ≃ₐ[k] R) (M N : ModuleCat.{u} R) +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +theorem twistedEnvelopingEndpoint_tmul + (e : (ModuleCat.restrictScalars σ.symm.toRingHom).obj M ≅ N) + (a : EnvelopingBimodule k R (twistedFiniteModule σ).carrier) (m : M) : + (((twistedEnvelopingRestrictionIso σ).app M) ≪≫ e).hom.hom + (BalancedTensor.tmul a m) = e.hom.hom (σ.symm a.value.value • m) := rfl + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedEnvelopingFunctor.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedEnvelopingFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..a3a3bb40b26983c60909a33a46ae18b5ff10d8b1 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedEnvelopingFunctor.lean @@ -0,0 +1,48 @@ +import OAI.Algebra.AuslanderReiten.Modules.TwistedModuleEvaluation +import OAI.Algebra.AuslanderReiten.Tensor.TwistedTensorFunctor + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (σ : R ≃ₐ[k] R) +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +def twistedEnvelopingRestrictionEquiv (M : ModuleCat.{u} R) : + BalancedTensor k R (EnvelopingBimodule k R (twistedFiniteModule σ).carrier) M ≃ₗ[R] + (ModuleCat.restrictScalars σ.symm.toRingHom).obj M := + (BalancedTensor.congrLeft (twistedEvaluationCoordinates σ) (LinearEquiv.refl k M) + (twistedEvaluationCoordinates_right σ) (fun _ _ => rfl) + (twistedEvaluationCoordinates_left σ)).trans (TwistedBimodule.tensorRestrictionEquiv σ M) + +@[simp] theorem twistedEnvelopingRestrictionEquiv_tmul (M : ModuleCat.{u} R) + (a : EnvelopingBimodule k R (twistedFiniteModule σ).carrier) (m : M) : + twistedEnvelopingRestrictionEquiv σ M (BalancedTensor.tmul a m) = + σ.symm a.value.value • m := rfl + +def twistedEnvelopingRestrictionIso : + BalancedTensor.functor (k := k) (R := R) (S := R) + (F := EnvelopingBimodule k R (twistedFiniteModule σ).carrier) ≅ + ModuleCat.restrictScalars σ.symm.toRingHom := + NatIso.ofComponents (fun M => (twistedEnvelopingRestrictionEquiv σ M).toModuleIso) (by + intro M N f + apply ModuleCat.hom_ext + apply BalancedTensor.leftHom_ext + intro a m + change σ.symm a.value.value • f.hom m = f.hom (σ.symm a.value.value • m) + exact (f.hom.map_smul _ _).symm) + +instance twistedEnvelopingFunctor_equivalence : + (BalancedTensor.functor (k := k) (R := R) (S := R) + (F := EnvelopingBimodule k R (twistedFiniteModule σ).carrier)).IsEquivalence := by + let := ModuleCat.restrictScalars_isEquivalence_of_ringEquiv σ.symm.toRingEquiv + exact Functor.isEquivalence_of_iso (twistedEnvelopingRestrictionIso σ).symm + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedEnvelopingProjective.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedEnvelopingProjective.lean new file mode 100644 index 0000000000000000000000000000000000000000..f01e3ed69a900af0a5938426382228d00341a5c3 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedEnvelopingProjective.lean @@ -0,0 +1,35 @@ +import OAI.Algebra.AuslanderReiten.Tensor.TwistedEnvelopingFunctor + +namespace OAI + +noncomputable section +namespace ArExplicit +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] [Module.Finite k R] +variable (σ : R ≃ₐ[k] R) + +instance twistedEnveloping_left_finite : + Module.Finite R (EnvelopingBimodule k R (twistedFiniteModule σ).carrier) := by + let := (twistedFiniteModule_left σ).1 + infer_instance + +instance twistedEnveloping_left_projective : + Module.Projective R (EnvelopingBimodule k R (twistedFiniteModule σ).carrier) := by + let := (twistedFiniteModule_left σ).2 + infer_instance + +instance twistedEnveloping_right_finite : + Module.Finite Rᵐᵒᵖ (EnvelopingBimodule k R (twistedFiniteModule σ).carrier) := by + let := (twistedFiniteModule_right σ).1 + infer_instance + +instance twistedEnveloping_right_projective : + Module.Projective Rᵐᵒᵖ (EnvelopingBimodule k R (twistedFiniteModule σ).carrier) := by + let := (twistedFiniteModule_right σ).2 + infer_instance + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedTensor.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedTensor.lean new file mode 100644 index 0000000000000000000000000000000000000000..6c9f99a2e61321ad6f8290fef21c3e8a182861f2 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedTensor.lean @@ -0,0 +1,130 @@ +import OAI.Algebra.AuslanderReiten.Modules.TwistedBimodule +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorFunctor + +namespace OAI + +namespace ArExplicit + +@[ext] structure TwistedLeftModule (k R : Type*) [CommRing k] [Ring R] [Algebra k R] + (σ : R ≃ₐ[k] R) (M : Type*) where + value : M + +namespace TwistedLeftModule + +variable {k R M : Type*} [CommRing k] [Ring R] [Algebra k R] +variable [AddCommGroup M] [Module k M] [Module R M] +variable [IsScalarTower k R M] [SMulCommClass k R M] +variable (σ : R ≃ₐ[k] R) + +def coordinates : TwistedLeftModule k R σ M ≃ M where + toFun := value + invFun := TwistedLeftModule.mk + left_inv _ := rfl + right_inv _ := rfl + +instance : AddCommGroup (TwistedLeftModule k R σ M) := (coordinates σ).addCommGroup +instance : Module k (TwistedLeftModule k R σ M) := (coordinates σ).addEquiv.module k +instance : SMul R (TwistedLeftModule k R σ M) := ⟨fun r x => ⟨σ.symm r • x.value⟩⟩ + +omit [Module k M] [Module R M] [IsScalarTower k R M] [SMulCommClass k R M] in +@[simp] theorem value_zero : (0 : TwistedLeftModule k R σ M).value = 0 := rfl +omit [Module k M] [Module R M] [IsScalarTower k R M] [SMulCommClass k R M] in +@[simp] theorem value_add (x y : TwistedLeftModule k R σ M) : + (x + y).value = x.value + y.value := rfl +omit [Module R M] [IsScalarTower k R M] [SMulCommClass k R M] in +@[simp] theorem value_scalar_smul (a : k) (x : TwistedLeftModule k R σ M) : + (a • x).value = a • x.value := rfl +omit [Module k M] [IsScalarTower k R M] [SMulCommClass k R M] in +@[simp] theorem value_smul (r : R) (x : TwistedLeftModule k R σ M) : + (r • x).value = σ.symm r • x.value := rfl + +instance : Module R (TwistedLeftModule k R σ M) where + one_smul x := by ext; simp + mul_smul r s x := by ext; simp [mul_smul] + smul_zero r := by ext; simp + smul_add r x y := by ext; simp [smul_add] + add_smul r s x := by ext; simp [add_smul] + zero_smul x := by ext; simp + +instance : IsScalarTower k R (TwistedLeftModule k R σ M) where + smul_assoc a r x := by ext; simp [smul_assoc] + +instance : SMulCommClass k R (TwistedLeftModule k R σ M) where + smul_comm a r x := by ext; exact smul_comm a (σ.symm r) x.value + +def scalarEquiv : TwistedLeftModule k R σ M ≃ₗ[k] M where + __ := coordinates σ + map_add' _ _ := rfl + map_smul' _ _ := rfl + +instance [Module.Finite k M] : Module.Finite k (TwistedLeftModule k R σ M) := + Module.Finite.equiv (scalarEquiv σ).symm + +end TwistedLeftModule + +namespace TwistedBimodule + +variable {k R M : Type*} [CommRing k] [Ring R] [Algebra k R] +variable [AddCommGroup M] [Module k M] [Module R M] +variable [IsScalarTower k R M] [SMulCommClass k R M] +variable (σ : R ≃ₐ[k] R) + +private def untwistBilinear : TwistedBimodule k R σ →ₗ[k] M →ₗ[k] TwistedLeftModule k R σ M where + toFun f := + { toFun := fun m => ⟨σ.symm f.value • m⟩ + map_add' x y := by ext; exact smul_add _ _ _ + map_smul' a x := by ext; exact (smul_comm a (σ.symm f.value) x).symm } + map_add' f g := by ext m; simp [add_smul] + map_smul' a f := by ext m; simp [smul_assoc] + +private theorem untwist_balanced (f : TwistedBimodule k R σ) (r : R) (m : M) : + untwistBilinear σ (MulOpposite.op r • f) m = untwistBilinear σ f (r • m) := by + apply TwistedLeftModule.ext + change σ.symm (f.value * σ r) • m = σ.symm f.value • (r • m) + simp [mul_smul] + +private theorem untwist_left (r : R) (f : TwistedBimodule k R σ) (m : M) : + untwistBilinear σ (r • f) m = r • untwistBilinear σ f m := by + apply TwistedLeftModule.ext + change σ.symm (r * f.value) • m = σ.symm r • (σ.symm f.value • m) + simp [mul_smul] + +def tensorUntwistMap : BalancedTensor k R (TwistedBimodule k R σ) M →ₗ[R] + TwistedLeftModule k R σ M := + BalancedTensor.liftLeft (untwistBilinear σ) (untwist_balanced σ) (untwist_left σ) + +@[simp] theorem tensorUntwistMap_tmul (f : TwistedBimodule k R σ) (m : M) : + tensorUntwistMap σ (BalancedTensor.tmul f m) = ⟨σ.symm f.value • m⟩ := rfl + +private def untwistInverse : TwistedLeftModule k R σ M →ₗ[k] + BalancedTensor k R (TwistedBimodule k R σ) M := + (BalancedTensor.mk (⟨1⟩ : TwistedBimodule k R σ)).comp (TwistedLeftModule.scalarEquiv σ).toLinearMap + +def tensorUntwist : BalancedTensor k R (TwistedBimodule k R σ) M ≃ₗ[R] + TwistedLeftModule k R σ M where + __ := tensorUntwistMap σ + invFun := untwistInverse σ + left_inv z := by + induction z using BalancedTensor.induction_on with + | zero => simp + | add x y hx hy => + change untwistInverse σ (tensorUntwistMap σ (x + y)) = x + y + rw [map_add, map_add] + exact congrArg₂ (· + ·) hx hy + | tmul f m => + change BalancedTensor.tmul (k := k) (R := R) + (⟨1⟩ : TwistedBimodule k R σ) (σ.symm f.value • m) = + BalancedTensor.tmul f m + rw [← BalancedTensor.balance] + congr 1 + apply TwistedBimodule.ext + simp + right_inv x := by + apply TwistedLeftModule.ext + change σ.symm 1 • x.value = x.value + simp + +end TwistedBimodule +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedTensorFunctor.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedTensorFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..321662c58509bba2e01e6857eb99596c9f7db733 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedTensorFunctor.lean @@ -0,0 +1,49 @@ +import OAI.Algebra.AuslanderReiten.Tensor.TwistedTensor +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCategory +import Mathlib.Algebra.Category.ModuleCat.ChangeOfRings + +namespace OAI + +noncomputable section +open CategoryTheory +namespace ArExplicit.TwistedBimodule +universe u +variable {k R : Type u} [Field k] [Ring R] [Algebra k R] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable (σ : R ≃ₐ[k] R) + +def leftModuleCoordinates (M : ModuleCat.{u} R) : + TwistedLeftModule k R σ M ≃ₗ[R] + (ModuleCat.restrictScalars σ.symm.toRingHom).obj M where + toFun x := x.value + invFun x := ⟨x⟩ + left_inv _ := rfl + right_inv _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + +def tensorRestrictionEquiv (M : ModuleCat.{u} R) : + BalancedTensor k R (TwistedBimodule k R σ) M ≃ₗ[R] + (ModuleCat.restrictScalars σ.symm.toRingHom).obj M := + (tensorUntwist σ).trans (leftModuleCoordinates σ M) + +@[simp] theorem tensorRestrictionEquiv_tmul (M : ModuleCat.{u} R) + (a : TwistedBimodule k R σ) (m : M) : + tensorRestrictionEquiv σ M (BalancedTensor.tmul a m) = σ.symm a.value • m := rfl + +def tensorRestrictionIso : + BalancedTensor.functor (k := k) (R := R) (S := R) (F := TwistedBimodule k R σ) ≅ + ModuleCat.restrictScalars σ.symm.toRingHom := + NatIso.ofComponents (fun M => (tensorRestrictionEquiv σ M).toModuleIso) (by + intro M N f + apply ModuleCat.hom_ext + apply BalancedTensor.leftHom_ext + intro a m + change σ.symm a.value • f.hom m = f.hom (σ.symm a.value • m) + exact (f.hom.map_smul _ _).symm) + +end ArExplicit.TwistedBimodule + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedTensorResolution.lean b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedTensorResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..a0c8d1edf7f3b8270bf1abdba8f0093924aa2996 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Tensor/TwistedTensorResolution.lean @@ -0,0 +1,124 @@ +import OAI.Algebra.AuslanderReiten.Coordinates.TensorTailMap +import OAI.Algebra.AuslanderReiten.Tensor.ExternalTensorResolution +import OAI.Algebra.AuslanderReiten.Resolutions.ResolutionCokernel +import OAI.Algebra.AuslanderReiten.Bar.TwistedBarTensorRegular +import OAI.Algebra.AuslanderReiten.Cones.TwoConeBaseRestriction + +namespace OAI + +noncomputable section +namespace ArExplicit.T +open CategoryTheory +open scoped TensorProduct +universe u +variable {k : Type u} [Field k] [CharP k 2] (q : k) (H : kˣ) +attribute [local instance 2000] moduleCatBaseModule moduleCatBaseTower +attribute [local instance 2001] Semiring.toNonAssocSemiring +local notation "R" => T k q +local notation "Te" => AbsoluteBar.Enveloping k R +local notation "Q₀" => productTwistedTotal q H + +def sourceTwist : (R ⊗[k] R) ≃ₐ[k] (R ⊗[k] R) := + Algebra.TensorProduct.congr (TrivialExtension.twist H) (TrivialExtension.twist H) + +def twistedTensorBarResolution : ProjectiveResolution + (ExternalTensor.moduleObject k Te Te + (AbsoluteBar.twistedObject k R (TrivialExtension.twist H) 0) + (AbsoluteBar.twistedObject k R (TrivialExtension.twist H) 0)) := by + letI (n : ℕ) : Module.Finite Te + ((AbsoluteBar.twistedResolution k R (TrivialExtension.twist H)).complex.X n) := + AbsoluteBar.twistedFinite k R (TrivialExtension.twist H) n + exact ExternalTensor.projectiveResolution k Te Te + (AbsoluteBar.twistedResolution k R (TrivialExtension.twist H)) + (AbsoluteBar.twistedResolution k R (TrivialExtension.twist H)) + +abbrev productSourceData : TwoCone.Data (Te ⊗[k] Te) where + term := (Q₀).X + d n := ((Q₀).d (n+1) n).hom + first _ := 0 + second _ := 0 + square n := congrArg ModuleCat.Hom.hom ((Q₀).d_comp_d (n+2) (n+1) n) + first_comm _ := by simp + second_comm _ := by simp + comparisons_comm _ := by simp + +abbrev sourceData := (productSourceData q H).restrict + (ExternalTensor.envelopingEquiv k R R).symm.toRingHom + +def sourceFourthEquiv : fourthSyzygy q H ≃ₗ[ExternalTensor.EnvelopingProduct k R R] + TwoCone.BaseCokernel (sourceData q H) 4 := LinearEquiv.refl _ _ + +theorem source_exact (n : ℕ) : + Function.Exact ((sourceData q H).d (n+1)) ((sourceData q H).d n) := by + let (n : ℕ) : Module.Finite Te + ((AbsoluteBar.twistedResolution k R (TrivialExtension.twist H)).complex.X n) := + AbsoluteBar.twistedFinite k R (TrivialExtension.twist H) n + exact ExternalTensor.differential_exact k Te Te + (AbsoluteBar.twistedResolution k R (TrivialExtension.twist H)) + (AbsoluteBar.twistedResolution k R (TrivialExtension.twist H)) n + +private def sourceProductBaseTyped : TwoCone.BaseCokernel (productSourceData q H) 0 ≃ₗ[Te ⊗[k] Te] + ExternalTensor.moduleObject k Te Te + (AbsoluteBar.twistedObject k R (TrivialExtension.twist H) 0) + (AbsoluteBar.twistedObject k R (TrivialExtension.twist H) 0) := + resolutionCokernelEquiv (twistedTensorBarResolution q H) + +private def sourceQuotientRestriction : TwoCone.BaseCokernel (sourceData q H) 0 ≃ₗ[ + ExternalTensor.EnvelopingProduct k R R] + (ExternalTensor.envelopingFunctor k R R).obj + (ModuleCat.of (ExternalTensor.ProductEnveloping k R R) + (TwoCone.BaseCokernel (productSourceData q H) 0)) := by + unfold sourceData + convert! (TwoCone.baseCokernelRestrictionEquiv (ExternalTensor.envelopingEquiv k R R).symm.toRingHom + (productSourceData q H) 0).symm using 1 + +private def sourceProductBaseRestricted := Iso.toLinearEquiv + ((ExternalTensor.envelopingFunctor k R R).mapIso (sourceProductBaseTyped q H).toModuleIso) + +private def sourceToTwistedRegular := + (sourceQuotientRestriction q H).trans (sourceProductBaseRestricted q H) + +def sourceBaseEquiv : TwoCone.BaseCokernel (sourceData q H) 0 ≃ₗ[ + ExternalTensor.EnvelopingProduct k R R] + bimoduleEnvelopingObject k (R ⊗[k] R) (TwistedBimodule k (R ⊗[k] R) (sourceTwist q H)) := + (sourceToTwistedRegular q H).trans + (twistedBarTensorBimoduleEquiv k R R (TrivialExtension.twist H) (TrivialExtension.twist H)) + +theorem source_product_finite (n : ℕ) : + Module.Finite (Te ⊗[k] Te) ((productSourceData q H).term n) := by + let (i : ℕ) : Module.Finite Te + ((AbsoluteBar.twistedComplex k R (TrivialExtension.twist H)).X i) := + AbsoluteBar.twistedFinite k R (TrivialExtension.twist H) i + exact ExternalTensor.term_finite k Te Te + (AbsoluteBar.twistedComplex k R (TrivialExtension.twist H)) + (AbsoluteBar.twistedComplex k R (TrivialExtension.twist H)) n + +theorem source_product_projective (n : ℕ) : + Module.Projective (Te ⊗[k] Te) ((productSourceData q H).term n) := by + let (i : ℕ) : Module.Finite Te + ((AbsoluteBar.twistedComplex k R (TrivialExtension.twist H)).X i) := + AbsoluteBar.twistedFinite k R (TrivialExtension.twist H) i + let (i : ℕ) : Module.Projective Te + ((AbsoluteBar.twistedComplex k R (TrivialExtension.twist H)).X i) := + AbsoluteBar.twistedProjective k R (TrivialExtension.twist H) i + exact ExternalTensor.term_projective k Te Te + (AbsoluteBar.twistedComplex k R (TrivialExtension.twist H)) + (AbsoluteBar.twistedComplex k R (TrivialExtension.twist H)) n + +theorem source_finite (n : ℕ) : + Module.Finite (ExternalTensor.EnvelopingProduct k R R) ((sourceData q H).term n) := by + let := source_product_finite q H n + exact Module.Finite.of_surjective + (ExternalTensor.envelopingSemilinear k R R ((productSourceData q H).term n)).toLinearMap + (ExternalTensor.envelopingSemilinear k R R ((productSourceData q H).term n)).surjective + +theorem source_projective (n : ℕ) : + Module.Projective (ExternalTensor.EnvelopingProduct k R R) ((sourceData q H).term n) := by + let := source_product_projective q H n + exact ExternalTensor.enveloping_projective k R R ((productSourceData q H).term n) + +end ArExplicit.T + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedCriterion.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedCriterion.lean new file mode 100644 index 0000000000000000000000000000000000000000..26b1e25aec6329573978897e58182a9e3233942f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedCriterion.lean @@ -0,0 +1,56 @@ +import OAI.Algebra.AuslanderReiten.Cones.ConeCriterion +import OAI.Algebra.AuslanderReiten.Triangular.TriangularCochain +import OAI.Algebra.AuslanderReiten.Triangular.ConvertedStructure + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory CompleteComparison TriangularInduction +open CochainComplex CochainComplex.HomComplex + +universe u + +variable {k : Type u} [Field k] (q : k) (B : Type u) +variable [AddCommGroup B] [Module k B] [Module (A k q) B] [Module (A k q)ᵐᵒᵖ B] +variable [SMulCommClass k (A k q) B] [SMulCommClass (A k q) (A k q)ᵐᵒᵖ B] +variable [IsScalarTower k (A k q) B] [IsScalarTower k (A k q)ᵐᵒᵖ B] +variable [SMulCommClass k (A k q)ᵐᵒᵖ B] +variable [Module.Finite k B] +variable [Module.Finite (A k q) B] [Module.Projective (A k q) B] +variable [Module.Finite (A k q)ᵐᵒᵖ B] [Module.Projective (A k q)ᵐᵒᵖ B] + +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +variable (P : CochainComplex (ModuleCat.{u} (A k q)) ℤ) +variable (φ : jCochain (k := k) (F := B) P ⟶ eCochain (k := k) (F := B) P) + +theorem convertedCone_mainConclusions (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) + (hP : TotallyAcyclicCochain P) + (hinj : ∀ n : ℕ, 0 < n → Function.Injective (coneComparison φ (n : ℤ))) + (hsurj : ∀ n : ℕ, Function.Surjective (coneComparison φ (n : ℤ))) + (hker : ∃ w : CohomologyClass (eCochain (k := k) (F := B) P) + (eCochain (k := k) (F := B) P) 0 × + CohomologyClass (jCochain (k := k) (F := B) P) + (jCochain (k := k) (F := B) P) 0, + w ≠ 0 ∧ coneComparison φ 0 w = 0) : + MainConclusions k (ConvertedAlgebra k q B) (ConeModule φ) := by + have hJ := jCochain_totallyAcyclic (k := k) (F := B) P hP + have hE := eCochain_totallyAcyclic (k := k) (F := B) P hP + obtain ⟨hnp, hgp, hself, hreg⟩ := coneModule_properties (k := k) φ hJ hE + (eToJCochain_eq_zero k (A k q) B P P) hinj hsurj hker + have hC := (mappingCone_totallyAcyclic φ hJ hE).to_chain + let := hC.finite 0 + let : Module.Finite k ((chainOfCochain (mappingCone φ)).X 0) := + Module.Finite.trans (ConvertedAlgebra k q B) _ + exact ⟨inferInstance, inferInstance, hnp, hgp, hself, hreg, + ⟨ConvertedAlgebra.semisimpleQuotientEquiv q B⟩, + ConvertedAlgebra.jacobson_fourth_ne_bot q B hq hq1⟩ + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedNoncommutative.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedNoncommutative.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b57f40924fc3d7f3c421a4a9b80fa328323ab1a --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedNoncommutative.lean @@ -0,0 +1,57 @@ +import OAI.Algebra.AuslanderReiten.Triangular.ConvertedStructure +import Mathlib.RingTheory.Flat.Basic + +namespace OAI + +noncomputable section +open scoped TensorProduct +namespace ArExplicit +namespace BaseAlgebra +variable {k : Type*} [Field k] (q : k) + +theorem e_u_ne_u_e : + basisVector q Letter.e * basisVector q Letter.u ≠ + basisVector q Letter.u * basisVector q Letter.e := by + intro h + have hh := congrArg (fun a : BaseAlgebra k q => a.coeff Letter.u) h + simp [basis_mul, multiplicationTable] at hh + +end BaseAlgebra +namespace ConvertedAlgebra +variable {k : Type*} [Field k] (q : k) (F : Type*) [AddCommGroup F] +variable [Module (A k q) F] [Module (A k q)ᵐᵒᵖ F] + +def noncommE : ConvertedAlgebra k q F := ⟨T.lower q Letter.e ⊗ₜ[k] 1, 0, 0⟩ + +theorem explicit_noncommuting_pair : + noncommE q F * radicalU q F ≠ radicalU q F * noncommE q F := by + intro h + have hh := congrArg (fun a : ConvertedAlgebra k q F => A.originalProjection q a.top) h + apply BaseAlgebra.e_u_ne_u_e q + have he : A.originalProjection q (T.lower q Letter.e ⊗ₜ[k] 1) = + BaseAlgebra.basisVector q Letter.e := by + simp [A.originalProjection, T.lower, TrivialExtension.inl] + simpa only [Triangular.top_mul, noncommE, radicalU, map_mul, + A.originalProjection_radicalU, he] using hh + +theorem noncommutative : ¬ ∀ a b : ConvertedAlgebra k q F, a*b = b*a := by + intro h + exact explicit_noncommuting_pair q F (h _ _) + +end ConvertedAlgebra + +theorem noncommuting_scalarExtension {k R : Type*} [Field k] [Ring R] [Algebra k R] + (E : Type*) [Field E] [Algebra k E] (a b : R) (h : a*b ≠ b*a) : + ((1 : E) ⊗ₜ[k] a) * ((1 : E) ⊗ₜ[k] b) ≠ + ((1 : E) ⊗ₜ[k] b) * ((1 : E) ⊗ₜ[k] a) := by + intro he + apply h + apply Module.Flat.tensorProduct_mk_injective (R := k) (S := E) (M := R) + change (1 : E) ⊗ₜ[k] (a*b) = (1 : E) ⊗ₜ[k] (b*a) + simpa only [Algebra.TensorProduct.tmul_mul_tmul, one_mul] using he + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedScalarExtension.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedScalarExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..945646904ea658e9e100bfa7bdf1e1a6147a04f2 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedScalarExtension.lean @@ -0,0 +1,46 @@ +import OAI.Algebra.AuslanderReiten.Triangular.ConvertedStructure +import OAI.Algebra.AuslanderReiten.BaseChange.ScalarExtensionStructure + +namespace OAI + +namespace ArExplicit.ConvertedAlgebra + +open TensorProduct + +variable {k : Type*} [Field k] (q : k) (F : Type*) [AddCommGroup F] +variable [Module (A k q) F] [Module (A k q)ᵐᵒᵖ F] +variable [SMulCommClass (A k q) (A k q)ᵐᵒᵖ F] +variable [Module k F] +variable [IsScalarTower k (A k q) F] [IsScalarTower k (A k q)ᵐᵒᵖ F] +variable [SMulCommClass k (A k q) F] [SMulCommClass k (A k q)ᵐᵒᵖ F] + +noncomputable def diagonalAlg : ConvertedAlgebra k q F →ₐ[k] (Fin 8 → k) := + (eightCoordinates k).toAlgHom.comp (Triangular.quotientMap (F := F) k (A.diagonalAlg q)) + +theorem diagonalAlg_surjective : Function.Surjective (diagonalAlg q F) := + (eightCoordinates k).surjective.comp + (Triangular.quotientMap_surjective k (A.diagonalAlg q) (A.diagonalAlg_surjective q)) + +theorem radical_eq_ker_diagonal : + Ring.jacobson (ConvertedAlgebra k q F) = RingHom.ker (diagonalAlg q F) := by + rw [Triangular.radical_eq_ker_quotientMap k (A.diagonalAlg q) (A.radical_eq_ker_diagonal q)] + ext a + change Triangular.quotientMap k (A.diagonalAlg q) a = 0 ↔ + eightCoordinates k (Triangular.quotientMap k (A.diagonalAlg q) a) = 0 + exact ⟨fun h => by rw [h, map_zero], fun h => (eightCoordinates k).injective (by simpa using h)⟩ + +variable [Module.Finite k F] (E : Type*) [Field E] [Algebra k E] + +noncomputable def scalarExtensionQuotientEquiv : + (E ⊗[k] ConvertedAlgebra k q F ⧸ Ring.jacobson (E ⊗[k] ConvertedAlgebra k q F)) ≃ₐ[E] + (Fin 8 → E) := + ArExplicit.scalarExtension_semisimpleQuotientEquiv E (diagonalAlg q F) + (diagonalAlg_surjective q F) (radical_eq_ker_diagonal q F) + +theorem scalarExtension_jacobson_fourth_ne_bot (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) : + (Ring.jacobson (E ⊗[k] ConvertedAlgebra k q F)) ^ 4 ≠ ⊥ := + scalarExtension_radical_pow_ne_bot E 4 (jacobson_fourth_ne_bot q F hq hq1) + +end ArExplicit.ConvertedAlgebra + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedStructure.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedStructure.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2303f92cae3d8cc0d5ab8c4c8a14af77cd3ad91 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedStructure.lean @@ -0,0 +1,54 @@ +import OAI.Algebra.AuslanderReiten.Algebras.TensorStructure +import OAI.Algebra.AuslanderReiten.Triangular.TriangularRadical +import OAI.Algebra.AuslanderReiten.Homology.SplitQuotient + +namespace OAI + +namespace ArExplicit + +abbrev ConvertedAlgebra (k : Type*) [Field k] (q : k) (F : Type*) := Triangular (A k q) F + +namespace ConvertedAlgebra + +variable {k : Type*} [Field k] (q : k) (F : Type*) [AddCommGroup F] +variable [Module (A k q) F] [Module (A k q)ᵐᵒᵖ F] +variable [SMulCommClass (A k q) (A k q)ᵐᵒᵖ F] + +def radicalU : ConvertedAlgebra k q F := ⟨A.radicalU q, 0, 0⟩ + +def radicalT : ConvertedAlgebra k q F := ⟨A.radicalT q, 0, 0⟩ + +theorem radicalU_mem : radicalU q F ∈ Ring.jacobson (ConvertedAlgebra k q F) := by + apply Triangular.mem_jacobson_iff _ |>.mpr + exact ⟨A.radicalU_mem q, Submodule.zero_mem _⟩ + +theorem radicalT_mem : radicalT q F ∈ Ring.jacobson (ConvertedAlgebra k q F) := by + apply Triangular.mem_jacobson_iff _ |>.mpr + exact ⟨A.radicalT_mem q, Submodule.zero_mem _⟩ + +theorem jacobson_fourth_ne_bot (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) : + (Ring.jacobson (ConvertedAlgebra k q F)) ^ 4 ≠ ⊥ := by + have h4 := Ideal.mul_mem_mul + (Ideal.mul_mem_mul (Ideal.mul_mem_mul (radicalU_mem q F) (radicalT_mem q F)) + (radicalU_mem q F)) (radicalT_mem q F) + have hmem : ((radicalU q F * radicalT q F) * radicalU q F) * radicalT q F ∈ + (Ring.jacobson (ConvertedAlgebra k q F)) ^ 4 := by + simpa only [Submodule.pow_succ, Submodule.pow_zero, Submodule.one_mul] using h4 + intro h + rw [h] at hmem + have ht := congrArg Triangular.top (show _ = 0 from hmem) + exact A.fourfold_product_ne_zero q hq hq1 ht + +variable [Module k F] +variable [IsScalarTower k (A k q) F] [IsScalarTower k (A k q)ᵐᵒᵖ F] +variable [SMulCommClass k (A k q) F] [SMulCommClass k (A k q)ᵐᵒᵖ F] + +noncomputable def semisimpleQuotientEquiv : + (ConvertedAlgebra k q F ⧸ Ring.jacobson (ConvertedAlgebra k q F)) ≃ₐ[k] (Fin 8 → k) := + (Triangular.semisimpleQuotientEquiv (F := F) k (A.diagonalAlg q) + (A.diagonalAlg_surjective q) (A.radical_eq_ker_diagonal q)).trans (eightCoordinates k) + +end ConvertedAlgebra +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedTensorCriterion.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedTensorCriterion.lean new file mode 100644 index 0000000000000000000000000000000000000000..824b4293c0a2c4ac06f615ce8ae5cb21a9366bdd --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/ConvertedTensorCriterion.lean @@ -0,0 +1,49 @@ +import OAI.Algebra.AuslanderReiten.Triangular.ConvertedCriterion +import OAI.Algebra.AuslanderReiten.Triangular.TriangularCochain +import OAI.Algebra.AuslanderReiten.Triangular.ConvertedStructure +import OAI.Algebra.AuslanderReiten.Triangular.TriangularComparisonTransport + +namespace OAI + +noncomputable section + +namespace ArExplicit + +open CategoryTheory CompleteComparison TriangularInduction +open CochainComplex CochainComplex.HomComplex + +universe u + +variable {k : Type u} [Field k] (q : k) (B : Type u) +variable [AddCommGroup B] [Module k B] [Module (A k q) B] [Module (A k q)ᵐᵒᵖ B] +variable [SMulCommClass k (A k q) B] [SMulCommClass (A k q) (A k q)ᵐᵒᵖ B] +variable [IsScalarTower k (A k q) B] [IsScalarTower k (A k q)ᵐᵒᵖ B] +variable [SMulCommClass k (A k q)ᵐᵒᵖ B] +variable [Module.Finite k B] +variable [Module.Finite (A k q) B] [Module.Projective (A k q) B] +variable [Module.Finite (A k q)ᵐᵒᵖ B] [Module.Projective (A k q)ᵐᵒᵖ B] + +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +variable (P : CochainComplex (ModuleCat.{u} (A k q)) ℤ) +variable (v : P ⟶ tensorCochain (k := k) (F := B) P) + +theorem convertedTensorCone_mainConclusions (hq : q ≠ 0) (hq1 : 1 + q ≠ 0) + (hP : TotallyAcyclicCochain P) + (hinj : ∀ n : ℕ, 0 < n → Function.Injective (tensorComparison v (n : ℤ))) + (hsurj : ∀ n : ℕ, Function.Surjective (tensorComparison v (n : ℤ))) + (hker : ∃ w : CohomologyClass P P 0 × CohomologyClass P P 0, + w ≠ 0 ∧ tensorComparison v 0 w = 0) : + MainConclusions k (ConvertedAlgebra k q B) (ConeModule (crossChainMap v)) := by + apply convertedCone_mainConclusions q B P (crossChainMap v) hq hq1 hP + · intro n hn + exact coneComparison_injective_of_tensor v (n : ℤ) (hinj n hn) + · intro n + exact coneComparison_surjective_of_tensor v (n : ℤ) (hsurj n) + · exact coneComparison_nonzero_kernel_of_tensor v 0 hker + +end ArExplicit + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/Triangular.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/Triangular.lean new file mode 100644 index 0000000000000000000000000000000000000000..24dfd26d57cbacb0d9c59101bc2889f039b6254d --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/Triangular.lean @@ -0,0 +1,143 @@ +import Mathlib.Algebra.Group.TransferInstance +import Mathlib.Algebra.Module.TransferInstance +import Mathlib.Algebra.Algebra.Defs +import Mathlib.Algebra.Algebra.Opposite +import Mathlib.LinearAlgebra.Dimension.Constructions +import Mathlib.RingTheory.Finiteness.Prod + +namespace OAI + +namespace ArExplicit + +@[ext] structure Triangular (R F : Type*) where + top : R + bottom : R + off : F + +namespace Triangular + +variable {R F : Type*} + +def coordinates : Triangular R F ≃ (R × R) × F where + toFun x := ((x.top, x.bottom), x.off) + invFun x := ⟨x.1.1, x.1.2, x.2⟩ + left_inv _ := rfl + right_inv _ := rfl + +instance [AddCommGroup R] [AddCommGroup F] : AddCommGroup (Triangular R F) := + coordinates.addCommGroup + +def coordinateAddEquiv [AddCommGroup R] [AddCommGroup F] : + Triangular R F ≃+ (R × R) × F where + toEquiv := coordinates + map_add' _ _ := rfl + +variable [Ring R] [AddCommGroup F] +variable [Module R F] [Module Rᵐᵒᵖ F] + +instance : One (Triangular R F) := ⟨⟨1, 1, 0⟩⟩ + +instance : Mul (Triangular R F) := + ⟨fun x y => ⟨x.top * y.top, x.bottom * y.bottom, + x.bottom • y.off + MulOpposite.op y.top • x.off⟩⟩ + +section BasicCoordinates + +omit [Module R F] [Module Rᵐᵒᵖ F] + +@[simp] theorem top_zero : (0 : Triangular R F).top = 0 := rfl +@[simp] theorem bottom_zero : (0 : Triangular R F).bottom = 0 := rfl +@[simp] theorem off_zero : (0 : Triangular R F).off = 0 := rfl +@[simp] theorem top_one : (1 : Triangular R F).top = 1 := rfl +@[simp] theorem bottom_one : (1 : Triangular R F).bottom = 1 := rfl +@[simp] theorem off_one : (1 : Triangular R F).off = 0 := rfl +@[simp] theorem top_add (x y : Triangular R F) : (x + y).top = x.top + y.top := rfl +@[simp] theorem bottom_add (x y : Triangular R F) : + (x + y).bottom = x.bottom + y.bottom := rfl +@[simp] theorem off_add (x y : Triangular R F) : (x + y).off = x.off + y.off := rfl +end BasicCoordinates + +@[simp] theorem top_mul (x y : Triangular R F) : (x * y).top = x.top * y.top := rfl +@[simp] theorem bottom_mul (x y : Triangular R F) : + (x * y).bottom = x.bottom * y.bottom := rfl +@[simp] theorem off_mul (x y : Triangular R F) : + (x * y).off = x.bottom • y.off + MulOpposite.op y.top • x.off := rfl + +variable [SMulCommClass R Rᵐᵒᵖ F] + +instance : Ring (Triangular R F) where + __ := (inferInstance : AddCommGroup (Triangular R F)) + mul_assoc x y z := by + ext + · exact mul_assoc .. + · exact mul_assoc .. + · simp only [off_mul, bottom_mul, top_mul, mul_smul, smul_add, MulOpposite.op_mul] + rw [← smul_comm x.bottom (MulOpposite.op z.top) y.off] + exact (add_assoc ..).symm + one_mul x := by ext <;> simp + mul_one x := by ext <;> simp + left_distrib x y z := by ext <;> simp [mul_add, smul_add, add_smul, add_add_add_comm] + right_distrib x y z := by ext <;> simp [add_mul, smul_add, add_smul, add_add_add_comm] + zero_mul x := by ext <;> simp + mul_zero x := by ext <;> simp + +def diagonal : Triangular R F →+* R × R where + toFun x := (x.top, x.bottom) + map_one' := rfl + map_mul' _ _ := rfl + map_zero' := rfl + map_add' _ _ := rfl + +theorem diagonal_surjective : Function.Surjective (diagonal (R := R) (F := F)) := by + intro x + exact ⟨⟨x.1, x.2, 0⟩, rfl⟩ + +def offDiagonal (f : F) : Triangular R F := ⟨0, 0, f⟩ + +@[simp] theorem offDiagonal_mul_offDiagonal (f g : F) : + offDiagonal (R := R) f * offDiagonal g = 0 := by + ext <;> simp [offDiagonal] + +section Scalars + +variable (k : Type*) [CommRing k] [Algebra k R] [Module k F] + +instance : Module k (Triangular R F) := coordinateAddEquiv.module k + +@[simp] theorem top_smul (c : k) (x : Triangular R F) : (c • x).top = c • x.top := rfl +@[simp] theorem bottom_smul (c : k) (x : Triangular R F) : + (c • x).bottom = c • x.bottom := rfl +@[simp] theorem off_smul (c : k) (x : Triangular R F) : (c • x).off = c • x.off := rfl + +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass k Rᵐᵒᵖ F] + +instance : Algebra k (Triangular R F) := Algebra.ofModule + (by + intro c x y + ext + · exact smul_mul_assoc c x.top y.top + · exact smul_mul_assoc c x.bottom y.bottom + · simp only [off_mul, off_smul, bottom_smul, smul_assoc, smul_add] + rw [← smul_comm c (MulOpposite.op y.top) x.off]) + (by + intro c x y + ext + · exact mul_smul_comm c x.top y.top + · exact mul_smul_comm c x.bottom y.bottom + · simp only [off_mul, off_smul, top_smul, MulOpposite.op_smul, + smul_assoc, smul_add] + rw [← smul_comm c x.bottom y.off]) + +def coordinateLinearEquiv : Triangular R F ≃ₗ[k] (R × R) × F := + (coordinateAddEquiv (R := R) (F := F)).linearEquiv k + +instance [Module.Finite k R] [Module.Finite k F] : Module.Finite k (Triangular R F) := + Module.Finite.equiv (coordinateLinearEquiv (R := R) (F := F) k).symm + +end Scalars + +end Triangular +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularCategory.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularCategory.lean new file mode 100644 index 0000000000000000000000000000000000000000..585460043be6cd6c4d9606220ec53b248b22958f --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularCategory.lean @@ -0,0 +1,94 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularComplete +import Mathlib.Algebra.Homology.HomotopyCategory.HomComplex + +namespace OAI + +noncomputable section + +namespace ArExplicit.TriangularInduction + +open CategoryTheory +open CochainComplex CochainComplex.HomComplex + +universe u + +variable (k R F : Type u) [Field k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] + +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +def eFunctor : ModuleCat.{u} R ⥤ ModuleCat.{u} (Triangular R F) where + obj M := ModuleCat.of _ (TriangularE k R F M) + map f := ModuleCat.ofHom (eMap f.hom) + map_id M := by apply ModuleCat.hom_ext; exact eMap_id + map_comp f g := by apply ModuleCat.hom_ext; exact eMap_comp f.hom g.hom + +def jFunctor : ModuleCat.{u} R ⥤ ModuleCat.{u} (Triangular R F) where + obj M := ModuleCat.of _ (TriangularJ k R F M) + map f := ModuleCat.ofHom (jMap f.hom) + map_id M := by apply ModuleCat.hom_ext; exact jMap_id + map_comp f g := by apply ModuleCat.hom_ext; exact jMap_comp f.hom g.hom + +instance : (eFunctor k R F).Additive where + map_add := by + intro X Y f g + apply ModuleCat.hom_ext + apply eHomEquiv.injective + ext m + rfl + +instance : (jFunctor k R F).Additive where + map_add := by + intro X Y f g + apply ModuleCat.hom_ext + apply jHomEquiv.injective + ext m + rfl + +instance : (eFunctor k R F).Faithful where + map_injective := by + intro M N f g h + apply ModuleCat.hom_ext + apply LinearMap.ext + intro m + exact congrArg (fun a : (eFunctor k R F).obj M ⟶ (eFunctor k R F).obj N => + (a.hom ⟨m, 0⟩).top) h + +instance : (jFunctor k R F).Faithful where + map_injective := by + intro M N f g h + apply ModuleCat.hom_ext + apply LinearMap.ext + intro m + exact congrArg (fun a : (jFunctor k R F).obj M ⟶ (jFunctor k R F).obj N => + (a.hom ⟨0, m⟩).bottom) h + +instance : (eFunctor k R F).Full where + map_surjective := by + intro M N g + refine ⟨ModuleCat.ofHom (TriangularModule.topMap g.hom), ?_⟩ + apply ModuleCat.hom_ext + exact eHom_topMap g.hom + +instance : (jFunctor k R F).Full where + map_surjective := by + intro M N g + refine ⟨ModuleCat.ofHom (TriangularModule.bottomMap g.hom), ?_⟩ + apply ModuleCat.hom_ext + exact jHom_bottomMap g.hom + +theorem eToJCochain_eq_zero (P Q : CochainComplex (ModuleCat.{u} R) ℤ) (n : ℤ) + (x : Cochain (((eFunctor k R F).mapHomologicalComplex _).obj P) + (((jFunctor k R F).mapHomologicalComplex _).obj Q) n) : x = 0 := by + apply Cochain.ext + intro i j hij + apply ModuleCat.hom_ext + exact hom_E_J_eq_zero (x.v i j hij).hom + +end ArExplicit.TriangularInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularCochain.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularCochain.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c8adeaec9647d682ee3917097cceb2cfc25bb8a --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularCochain.lean @@ -0,0 +1,76 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularCategory +import OAI.Algebra.AuslanderReiten.Complete.CompleteShiftDual + +namespace OAI + +noncomputable section + +namespace ArExplicit.TriangularInduction + +open CategoryTheory + +universe u + +variable {k R F : Type u} [Field k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] + +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +abbrev eCochain (P : CochainComplex (ModuleCat.{u} R) ℤ) := + ((eFunctor k R F).mapHomologicalComplex _).obj P + +abbrev jCochain (P : CochainComplex (ModuleCat.{u} R) ℤ) := + ((jFunctor k R F).mapHomologicalComplex _).obj P + +variable [Module.Finite k R] [Module.Finite k F] + +theorem eCochain_totallyAcyclic [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] + (P : CochainComplex (ModuleCat.{u} R) ℤ) (hP : TotallyAcyclicCochain P) : + TotallyAcyclicCochain (eCochain (k := k) (F := F) P) where + finite n := by + let := hP.finite n + let : Module.Finite k (P.X n) := Module.Finite.trans R (P.X n) + exact Module.Finite.of_restrictScalars_finite k (Triangular R F) (TriangularE k R F (P.X n)) + projective n := by + let := hP.finite n + let := hP.projective n + exact eProjective + exactAt n := by + rw [HomologicalComplex.exactAt_iff' _ (n - 1) n (n + 1) (by simp) (by simp), + ShortComplex.moduleCat_exact_iff_range_eq_ker] + have h := hP.exactAt n + rw [HomologicalComplex.exactAt_iff' _ (n - 1) n (n + 1) (by simp) (by simp), + ShortComplex.moduleCat_exact_iff_range_eq_ker] at h + exact (LinearMap.exact_iff.mp (eMap_exact (k := k) (F := F) _ _ + (LinearMap.exact_iff.mpr h.symm))).symm + dualExact n := eHomExact _ _ (hP.dualExact n) + +omit [Module.Finite k F] in +theorem jCochain_totallyAcyclic [Module.Finite R F] [Module.Projective R F] + (P : CochainComplex (ModuleCat.{u} R) ℤ) (hP : TotallyAcyclicCochain P) : + TotallyAcyclicCochain (jCochain (k := k) (F := F) P) where + finite n := by + let := hP.finite n + let : Module.Finite k (P.X n) := Module.Finite.trans R (P.X n) + exact Module.Finite.of_restrictScalars_finite k (Triangular R F) (TriangularJ k R F (P.X n)) + projective n := by + let := hP.finite n + let := hP.projective n + exact jProjective + exactAt n := by + rw [HomologicalComplex.exactAt_iff' _ (n - 1) n (n + 1) (by simp) (by simp), + ShortComplex.moduleCat_exact_iff_range_eq_ker] + have h := hP.exactAt n + rw [HomologicalComplex.exactAt_iff' _ (n - 1) n (n + 1) (by simp) (by simp), + ShortComplex.moduleCat_exact_iff_range_eq_ker] at h + exact (LinearMap.exact_iff.mp (jMap_exact (k := k) (F := F) _ _ + (LinearMap.exact_iff.mpr h.symm))).symm + dualExact n := jHomExact _ _ (hP.dualExact n) + +end ArExplicit.TriangularInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularComparison.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..7643cb46f558efbc74d239cd3102e9bc3f40eda5 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularComparison.lean @@ -0,0 +1,88 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularCrossHom +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomMap +import OAI.Algebra.AuslanderReiten.Cones.ConeComparison + +namespace OAI + +noncomputable section +namespace ArExplicit.TriangularInduction +open CategoryTheory CochainComplex.HomComplex +universe u +variable {k R F : Type u} [Field k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable {P : CochainComplex (ModuleCat.{u} R) ℤ} +variable (v : P ⟶ tensorCochain (k := k) (F := F) P) (n : ℤ) + +@[simp] theorem crossCohomologyEquiv_mk + (x : Cocycle P (tensorCochain (k := k) (F := F) P) n) : + crossCohomologyEquiv P P n (CohomologyClass.mk x) = + CohomologyClass.mk ((crossFullHomEquivalence P P).cocycle n x) := rfl + +theorem crossCohomology_postcomp (x : CohomologyClass P P n) : + crossCohomologyEquiv P P n (fullHomPostcomp v n x) = + fullHomPostcomp (crossChainMap v) n (mapFullHom (jFunctor k R F) P P n x) := by + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + rw [fullHomPostcomp_mk, crossCohomologyEquiv_mk, mapFullHom_mk, fullHomPostcomp_mk] + congr 1 + apply Cocycle.ext + change crossCochainEquiv P P n (x.1.comp (Cochain.ofHom v) (add_zero n)) = + (x.1.map (jFunctor k R F)).comp (Cochain.ofHom (crossChainMap v)) (add_zero n) + apply Cochain.ext + intro i j hij + rw [crossCochainEquiv_v, + Cochain.comp_v x.1 (Cochain.ofHom v) (add_zero n) i j j hij (add_zero j), + Cochain.comp_v (x.1.map (jFunctor k R F)) (Cochain.ofHom (crossChainMap v)) + (add_zero n) i j j hij (add_zero j)] + simp only [Cochain.ofHom_v, Cochain.map_v] + exact crossHomAdd_source _ _ + +theorem crossCohomology_precomp (x : CohomologyClass P P n) : + crossCohomologyEquiv P P n (fullHomPrecomp v n + (mapFullHom (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F)) P P n x)) = + fullHomPrecomp (crossChainMap v) n (mapFullHom (eFunctor k R F) P P n x) := by + obtain ⟨x, rfl⟩ := CohomologyClass.mk_surjective x + rw [mapFullHom_mk, fullHomPrecomp_mk, crossCohomologyEquiv_mk, + mapFullHom_mk, fullHomPrecomp_mk] + congr 1 + apply Cocycle.ext + change crossCochainEquiv P P n ((Cochain.ofHom v).comp + (x.1.map (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F))) (zero_add n)) = + (Cochain.ofHom (crossChainMap v)).comp (x.1.map (eFunctor k R F)) (zero_add n) + apply Cochain.ext + intro i j hij + rw [crossCochainEquiv_v, + Cochain.comp_v (Cochain.ofHom v) + (x.1.map (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F))) + (zero_add n) i i j (add_zero i) hij, + Cochain.comp_v (Cochain.ofHom (crossChainMap v)) (x.1.map (eFunctor k R F)) + (zero_add n) i i j (add_zero i) hij] + simp only [Cochain.ofHom_v, Cochain.map_v] + exact crossHomAdd_target _ _ + +def tensorComparison : (CohomologyClass P P n × CohomologyClass P P n) →+ + CohomologyClass P (tensorCochain (k := k) (F := F) P) n where + toFun x := fullHomPostcomp v n x.2 + (n+1).negOnePow • fullHomPrecomp v n + (mapFullHom (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F)) P P n x.1) + map_zero' := by simp + map_add' x y := by simp [smul_add]; abel + +theorem cross_tensorComparison (a b : CohomologyClass P P n) : + crossCohomologyEquiv P P n (tensorComparison v n (a,b)) = + coneComparison (crossChainMap v) n + (fullHomCohomologyEquiv (eFunctor k R F) P P n a, + fullHomCohomologyEquiv (jFunctor k R F) P P n b) := by + change crossCohomologyEquiv P P n (fullHomPostcomp v n b + + (n+1).negOnePow • fullHomPrecomp v n + (mapFullHom (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F)) P P n a)) = _ + rw [map_add] + simp only [Units.smul_def, map_zsmul, crossCohomology_postcomp, crossCohomology_precomp] + rfl + +end ArExplicit.TriangularInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularComparisonTransport.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularComparisonTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..cabc83ca741dbf1f4860c9419484e895f5b2762d --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularComparisonTransport.lean @@ -0,0 +1,70 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularComparison + +namespace OAI + +noncomputable section +namespace ArExplicit.TriangularInduction +open CategoryTheory CochainComplex.HomComplex +universe u +variable {k R F : Type u} [Field k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] +attribute [local instance] moduleCatBaseModule moduleCatBaseTower +variable {P : CochainComplex (ModuleCat.{u} R) ℤ} +variable (v : P ⟶ tensorCochain (k := k) (F := F) P) (n : ℤ) + +def comparisonSourceEquiv : + (CohomologyClass P P n × CohomologyClass P P n) ≃+ + (CohomologyClass (eCochain (k := k) (F := F) P) + (eCochain (k := k) (F := F) P) n × + CohomologyClass (jCochain (k := k) (F := F) P) + (jCochain (k := k) (F := F) P) n) := + AddEquiv.prodCongr (fullHomCohomologyEquiv (eFunctor k R F) P P n) + (fullHomCohomologyEquiv (jFunctor k R F) P P n) + +@[simp] theorem comparisonSourceEquiv_apply (a b : CohomologyClass P P n) : + comparisonSourceEquiv (F := F) (P := P) n (a,b) = + (fullHomCohomologyEquiv (eFunctor k R F) P P n a, + fullHomCohomologyEquiv (jFunctor k R F) P P n b) := rfl + +theorem coneComparison_injective_of_tensor + (h : Function.Injective (tensorComparison v n)) : + Function.Injective (coneComparison (crossChainMap v) n) := by + intro x y hxy + obtain ⟨a,rfl⟩ := (comparisonSourceEquiv (F := F) (P := P) n).surjective x + obtain ⟨b,rfl⟩ := (comparisonSourceEquiv (F := F) (P := P) n).surjective y + apply congrArg + apply h + apply (crossCohomologyEquiv P P n).injective + rw [cross_tensorComparison, cross_tensorComparison] + exact hxy + +theorem coneComparison_surjective_of_tensor + (h : Function.Surjective (tensorComparison v n)) : + Function.Surjective (coneComparison (crossChainMap v) n) := by + intro y + obtain ⟨x,hx⟩ := h ((crossCohomologyEquiv P P n).symm y) + refine ⟨comparisonSourceEquiv (F := F) (P := P) n x, ?_⟩ + rcases x with ⟨a,b⟩ + rw [comparisonSourceEquiv_apply, ← cross_tensorComparison, hx, AddEquiv.apply_symm_apply] + +theorem coneComparison_nonzero_kernel_of_tensor + (h : ∃ x : CohomologyClass P P n × CohomologyClass P P n, + x ≠ 0 ∧ tensorComparison v n x = 0) : + ∃ x : CohomologyClass (eCochain (k := k) (F := F) P) + (eCochain (k := k) (F := F) P) n × + CohomologyClass (jCochain (k := k) (F := F) P) + (jCochain (k := k) (F := F) P) n, + x ≠ 0 ∧ coneComparison (crossChainMap v) n x = 0 := by + obtain ⟨x,hx,h0⟩ := h + refine ⟨comparisonSourceEquiv (F := F) (P := P) n x, ?_, ?_⟩ + · exact fun he => hx ((comparisonSourceEquiv (F := F) (P := P) n).map_eq_zero_iff.mp he) + · rcases x with ⟨a,b⟩ + rw [comparisonSourceEquiv_apply, ← cross_tensorComparison, h0, map_zero] + +end ArExplicit.TriangularInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularComplete.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularComplete.lean new file mode 100644 index 0000000000000000000000000000000000000000..f5e8e90d59a837792dcc6ecb8e5e7081a3550d43 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularComplete.lean @@ -0,0 +1,95 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularExact +import OAI.Algebra.AuslanderReiten.Triangular.TriangularDualExact +import OAI.Algebra.AuslanderReiten.BaseChange.ScalarExtensionComplete +import OAI.Algebra.AuslanderReiten.Complete.CompleteComparison + +namespace OAI + +noncomputable section + +namespace ArExplicit.TriangularInduction + +open CategoryTheory + +universe u + +variable {k R F : Type u} [Field k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] + +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +private instance moduleCatBaseComm (M : ModuleCat.{u} R) : SMulCommClass k R M where + smul_comm c r m := by + change (algebraMap k R c) • (r • m) = r • ((algebraMap k R c) • m) + rw [← mul_smul, Algebra.commutes c r, mul_smul] + +def eComplex (P : ChainComplex (ModuleCat.{u} R) ℤ) : + ChainComplex (ModuleCat.{u} (Triangular R F)) ℤ where + X n := ModuleCat.of (Triangular R F) (TriangularE k R F (P.X n)) + d i j := ModuleCat.ofHom (eMap (P.d i j).hom) + shape i j hij := by + rw [P.shape i j hij] + apply ModuleCat.hom_ext + exact eMap_zero + d_comp_d' i j l _ _ := by + apply ModuleCat.hom_ext + change (eMap (P.d j l).hom).comp (eMap (P.d i j).hom) = 0 + rw [← eMap_comp, show (P.d j l).hom.comp (P.d i j).hom = 0 from + congrArg ModuleCat.Hom.hom (P.d_comp_d i j l), eMap_zero] + +def jComplex (P : ChainComplex (ModuleCat.{u} R) ℤ) : + ChainComplex (ModuleCat.{u} (Triangular R F)) ℤ where + X n := ModuleCat.of (Triangular R F) (TriangularJ k R F (P.X n)) + d i j := ModuleCat.ofHom (jMap (P.d i j).hom) + shape i j hij := by + rw [P.shape i j hij] + apply ModuleCat.hom_ext + exact jMap_zero + d_comp_d' i j l _ _ := by + apply ModuleCat.hom_ext + change (jMap (P.d j l).hom).comp (jMap (P.d i j).hom) = 0 + rw [← jMap_comp, show (P.d j l).hom.comp (P.d i j).hom = 0 from + congrArg ModuleCat.Hom.hom (P.d_comp_d i j l), jMap_zero] + +variable [Module.Finite k R] [Module.Finite k F] + +theorem eComplex_totallyAcyclic [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] + (P : ChainComplex (ModuleCat.{u} R) ℤ) (hP : TotallyAcyclicComplex P) : + TotallyAcyclicComplex (eComplex (k := k) (F := F) P) where + finite n := by + let := hP.finite n + let : Module.Finite k (P.X n) := Module.Finite.trans R (P.X n) + exact Module.Finite.of_restrictScalars_finite k (Triangular R F) (TriangularE k R F (P.X n)) + projective n := by + let := hP.finite n + let := hP.projective n + exact eProjective + exactAt n := + (LinearMap.exact_iff.mp (eMap_exact (k := k) (F := F) _ _ + (LinearMap.exact_iff.mpr (hP.exactAt n).symm))).symm + dualExact n := eHomExact _ _ (hP.dualExact n) + +omit [Module.Finite k F] in +theorem jComplex_totallyAcyclic [Module.Finite R F] [Module.Projective R F] + (P : ChainComplex (ModuleCat.{u} R) ℤ) (hP : TotallyAcyclicComplex P) : + TotallyAcyclicComplex (jComplex (k := k) (F := F) P) where + finite n := by + let := hP.finite n + let : Module.Finite k (P.X n) := Module.Finite.trans R (P.X n) + exact Module.Finite.of_restrictScalars_finite k (Triangular R F) (TriangularJ k R F (P.X n)) + projective n := by + let := hP.finite n + let := hP.projective n + exact jProjective + exactAt n := + (LinearMap.exact_iff.mp (jMap_exact (k := k) (F := F) _ _ + (LinearMap.exact_iff.mpr (hP.exactAt n).symm))).symm + dualExact n := jHomExact _ _ (hP.dualExact n) + +end ArExplicit.TriangularInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularCrossHom.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularCrossHom.lean new file mode 100644 index 0000000000000000000000000000000000000000..21fc720edeb3b096fefb7aa689e2018a66d18655 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularCrossHom.lean @@ -0,0 +1,159 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularCochain +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorCategory +import OAI.Algebra.AuslanderReiten.HomComplex.FullHomTransport + +namespace OAI + +noncomputable section + +namespace ArExplicit.TriangularInduction + +open CategoryTheory CochainComplex.HomComplex + +universe u + +variable {k R F : Type u} [Field k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] + +attribute [local instance] moduleCatBaseModule moduleCatBaseTower + +def crossHomAdd (M N : ModuleCat.{u} R) : + (M ⟶ (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F)).obj N) →+ + ((jFunctor k R F).obj M ⟶ (eFunctor k R F).obj N) where + toFun f := ModuleCat.ofHom (jHom f.hom) + map_zero' := by + apply ModuleCat.hom_ext + apply jHomEquiv.injective + exact map_zero jHomEquiv |>.symm + map_add' f g := by + apply ModuleCat.hom_ext + apply jHomEquiv.injective + ext z + rfl + +theorem crossHomAdd_source {M N L : ModuleCat.{u} R} (f : M ⟶ N) + (g : N ⟶ (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F)).obj L) : + crossHomAdd M L (f ≫ g) = (jFunctor k R F).map f ≫ crossHomAdd N L g := by + apply ModuleCat.hom_ext + apply jHomEquiv.injective + rfl + +theorem crossHomAdd_target {M N L : ModuleCat.{u} R} + (f : M ⟶ (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F)).obj N) + (g : N ⟶ L) : + crossHomAdd M L (f ≫ (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F)).map g) = + crossHomAdd M N f ≫ (eFunctor k R F).map g := by + apply ModuleCat.hom_ext + apply jHomEquiv.injective + rfl + +abbrev tensorCochain (P : CochainComplex (ModuleCat.{u} R) ℤ) := + ((BalancedTensor.functor (k := k) (R := R) (S := R) (F := F)).mapHomologicalComplex _).obj P + +variable (P Q : CochainComplex (ModuleCat.{u} R) ℤ) (n : ℤ) + +def crossCochainEquiv : Cochain P (tensorCochain (k := k) (F := F) Q) n ≃+ + Cochain (jCochain (k := k) (F := F) P) (eCochain (k := k) (F := F) Q) n where + toFun x := Cochain.mk fun p q hpq => crossHomAdd (P.X p) (Q.X q) (x.v p q hpq) + invFun x := Cochain.mk fun p q hpq => ModuleCat.ofHom (TriangularModule.bottomMap (x.v p q hpq).hom) + left_inv x := by + apply Cochain.ext + intro p q hpq + rfl + right_inv x := by + apply Cochain.ext + intro p q hpq + apply ModuleCat.hom_ext + exact jHom_bottomMap _ + map_add' x y := by + apply Cochain.ext + intro p q hpq + exact map_add (crossHomAdd (P.X p) (Q.X q)) (x.v p q hpq) (y.v p q hpq) + +@[simp] theorem crossCochainEquiv_v + (x : Cochain P (tensorCochain (k := k) (F := F) Q) n) (p q : ℤ) (hpq : p+n=q) : + (crossCochainEquiv P Q n x).v p q hpq = crossHomAdd (P.X p) (Q.X q) (x.v p q hpq) := rfl + +theorem crossCochainEquiv_differential (m : ℤ) + (x : Cochain P (tensorCochain (k := k) (F := F) Q) n) : + δ n m (crossCochainEquiv P Q n x) = crossCochainEquiv P Q m (δ n m x) := by + by_cases hnm : n+1=m + · apply Cochain.ext + intro p q hpq + simp only [δ_v n m hnm _ p q hpq (q-1) (p+1) rfl rfl, crossCochainEquiv_v] + let x₁ : P.X p ⟶ (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F)).obj (Q.X (q-1)) := + x.v p (q-1) (by omega) + let x₂ : P.X (p+1) ⟶ (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F)).obj (Q.X q) := + x.v (p+1) q (by omega) + change crossHomAdd _ _ x₁ ≫ (eFunctor k R F).map (Q.d (q-1) q) + + m.negOnePow • ((jFunctor k R F).map (P.d p (p+1)) ≫ crossHomAdd _ _ x₂) = + crossHomAdd (P.X p) (Q.X q) (x₁ ≫ + (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F)).map (Q.d (q-1) q) + + m.negOnePow • (P.d p (p+1) ≫ x₂)) + rw [map_add] + simp only [Units.smul_def, map_zsmul] + rw [crossHomAdd_target, crossHomAdd_source] + · rw [δ_shape n m hnm, δ_shape n m hnm, map_zero] + +def crossFullHomEquivalence : FullHomEquivalence P (tensorCochain (k := k) (F := F) Q) + (jCochain (k := k) (F := F) P) (eCochain (k := k) (F := F) Q) where + cochain := crossCochainEquiv P Q + differential := crossCochainEquiv_differential P Q + +def crossCohomologyEquiv : + CohomologyClass P (tensorCochain (k := k) (F := F) Q) n ≃+ + CohomologyClass (jCochain (k := k) (F := F) P) (eCochain (k := k) (F := F) Q) n := + (crossFullHomEquivalence P Q).cohomology n + +variable {P Q n} + +def crossChainMap (f : P ⟶ tensorCochain (k := k) (F := F) Q) : + jCochain (k := k) (F := F) P ⟶ eCochain (k := k) (F := F) Q where + f i := crossHomAdd (P.X i) (Q.X i) (f.f i) + comm' i j _ := by + change crossHomAdd _ _ (f.f i) ≫ (eFunctor k R F).map (Q.d i j) = + (jFunctor k R F).map (P.d i j) ≫ crossHomAdd _ _ (f.f j) + exact (crossHomAdd_target (f.f i) (Q.d i j)).symm.trans + ((congrArg (crossHomAdd (P.X i) (Q.X j)) (f.comm i j)).trans + (crossHomAdd_source (P.d i j) (f.f j))) + +theorem crossChainMap_ofHom (f : P ⟶ tensorCochain (k := k) (F := F) Q) : + crossCochainEquiv P Q 0 (Cochain.ofHom f) = Cochain.ofHom (crossChainMap f) := by + apply Cochain.ext₀ + intro p + simp only [crossCochainEquiv_v, Cochain.ofHom_v, crossChainMap] + +variable {L : CochainComplex (ModuleCat.{u} R) ℤ} {m : ℤ} + +theorem crossCochainEquiv_source (a : Cochain P Q n) + (b : Cochain Q (tensorCochain (k := k) (F := F) L) m) : + crossCochainEquiv P L (n+m) (a.comp b rfl) = + (a.map (jFunctor k R F)).comp (crossCochainEquiv Q L m b) rfl := by + apply Cochain.ext + intro p q hpq + simp only [crossCochainEquiv_v, Cochain.comp_v a b rfl p (p+n) q rfl (by omega), + Cochain.comp_v (a.map (jFunctor k R F)) (crossCochainEquiv Q L m b) rfl + p (p+n) q rfl (by omega), Cochain.map_v] + exact crossHomAdd_source _ _ + +theorem crossCochainEquiv_target + (a : Cochain P (tensorCochain (k := k) (F := F) Q) n) (b : Cochain Q L m) : + crossCochainEquiv P L (n+m) + (a.comp (b.map (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F))) rfl) = + (crossCochainEquiv P Q n a).comp (b.map (eFunctor k R F)) rfl := by + apply Cochain.ext + intro p q hpq + simp only [crossCochainEquiv_v, + Cochain.comp_v a (b.map (BalancedTensor.functor (k := k) (R := R) (S := R) (F := F))) rfl + p (p+n) q rfl (by omega), + Cochain.comp_v (crossCochainEquiv P Q n a) (b.map (eFunctor k R F)) rfl + p (p+n) q rfl (by omega), Cochain.map_v] + exact crossHomAdd_target _ _ + +end ArExplicit.TriangularInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularDualExact.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularDualExact.lean new file mode 100644 index 0000000000000000000000000000000000000000..6255a5513d70da117087c2feb53d0dca09e8ef2b --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularDualExact.lean @@ -0,0 +1,116 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularProjective +import OAI.Algebra.AuslanderReiten.Complete.CompleteResolution + +namespace OAI + +namespace ArExplicit.TriangularInduction + +variable {k R F : Type*} [CommRing k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] +variable {K L M U V : Type*} +variable [AddCommGroup K] [Module k K] [Module R K] [IsScalarTower k R K] +variable [AddCommGroup L] [Module k L] [Module R L] [IsScalarTower k R L] +variable [AddCommGroup M] [Module k M] [Module R M] [IsScalarTower k R M] +variable [AddCommGroup U] [Module k U] [Module R U] [IsScalarTower k R U] +variable [AddCommGroup V] [Module k V] [Module R V] [IsScalarTower k R V] + +theorem eHomLift (e : K →ₗ[R] L) (d : L →ₗ[R] M) (h : HomExactAt e d) + [Module.Finite R U] [Module.Projective R U] + {ψ : BalancedTensor k R F U →ₗ[R] V} + (g : TriangularE k R F L →ₗ[Triangular R F] TriangularModule k R F U V ψ) + (hg : g.comp (eMap e) = 0) : + ∃ G : TriangularE k R F M →ₗ[Triangular R F] TriangularModule k R F U V ψ, + G.comp (eMap d) = g := by + have ha : (TriangularModule.topMap g).comp e = 0 := by + ext x + have hx := congrArg TriangularModule.top (DFunLike.congr_fun hg ⟨x, 0⟩) + simpa only [LinearMap.comp_apply, LinearMap.zero_apply, TriangularModule.top_zero, + eMap, eHom, TriangularModule.hom, LinearMap.coe_mk, AddHom.coe_mk, + map_zero, TriangularModule.topMap_apply] using hx + obtain ⟨b, hb⟩ := h.projective (TriangularModule.topMap g) ha + refine ⟨eHom b, ?_⟩ + apply eHomEquiv.injective + apply LinearMap.ext + intro x + exact DFunLike.congr_fun hb x + +omit [Module k K] [IsScalarTower k R K] [Module k L] [IsScalarTower k R L] + [Module k M] [IsScalarTower k R M] in +theorem jHomLift (e : K →ₗ[R] L) (d : L →ₗ[R] M) (h : HomExactAt e d) + [Module.Finite R V] [Module.Projective R V] + {ψ : BalancedTensor k R F U →ₗ[R] V} + (g : TriangularJ k R F L →ₗ[Triangular R F] TriangularModule k R F U V ψ) + (hg : g.comp (jMap e) = 0) : + ∃ G : TriangularJ k R F M →ₗ[Triangular R F] TriangularModule k R F U V ψ, + G.comp (jMap d) = g := by + have ha : (TriangularModule.bottomMap g).comp e = 0 := by + ext x + exact congrArg TriangularModule.bottom (DFunLike.congr_fun hg ⟨0, x⟩) + obtain ⟨b, hb⟩ := h.projective (TriangularModule.bottomMap g) ha + refine ⟨jHom b, ?_⟩ + apply jHomEquiv.injective + apply LinearMap.ext + intro x + exact DFunLike.congr_fun hb x + +omit [IsScalarTower k R F] [SMulCommClass k Rᵐᵒᵖ F] in +theorem regular_decomposition (a : Triangular R F) : + eRegularInclusion (eRegularProjection (k := k) a) + + jRegularInclusion (jRegularProjection (k := k) a) = a := by + ext <;> simp [eRegularInclusion, eRegularProjection, jRegularInclusion, jRegularProjection] + +theorem eHomExact (e : K →ₗ[R] L) (d : L →ₗ[R] M) (h : HomExactAt e d) : + HomExactAt (eMap (k := k) (F := F) e) (eMap d) := by + intro g hg + let g₁ := (eRegularProjection (k := k)).comp g + have hg₁ : g₁.comp (eMap e) = 0 := by + dsimp [g₁] + rw [LinearMap.comp_assoc, hg, LinearMap.comp_zero] + obtain ⟨G, hG⟩ := eHomLift e d h g₁ hg₁ + refine ⟨eRegularInclusion.comp G, ?_⟩ + have hg₂ : (jRegularProjection (k := k)).comp g = 0 := hom_E_J_eq_zero _ + apply LinearMap.ext + intro x + have hGx := DFunLike.congr_fun hG x + change G (eMap d x) = g₁ x at hGx + change eRegularInclusion (G (eMap d x)) = g x + rw [hGx] + have hsplit := regular_decomposition (k := k) (g x) + have hzero := DFunLike.congr_fun hg₂ x + change jRegularProjection (g x) = 0 at hzero + simpa only [hzero, map_zero, add_zero, g₁, LinearMap.comp_apply] using hsplit + +omit [Module k K] [IsScalarTower k R K] [Module k L] [IsScalarTower k R L] + [Module k M] [IsScalarTower k R M] in +theorem jHomExact [Module.Finite R F] [Module.Projective R F] + (e : K →ₗ[R] L) (d : L →ₗ[R] M) (h : HomExactAt e d) : + HomExactAt (jMap (k := k) (F := F) e) (jMap d) := by + intro g hg + let : Module.Finite R (BalancedTensor k R F R) := + Module.Finite.equiv (BalancedTensor.runitLeft (S := R)).symm + let : Module.Projective R (BalancedTensor k R F R) := + Module.Projective.of_equiv (BalancedTensor.runitLeft (S := R)).symm + let g₁ := (eRegularProjection (k := k)).comp g + let g₂ := (jRegularProjection (k := k)).comp g + have hg₁ : g₁.comp (jMap e) = 0 := by + dsimp [g₁] + rw [LinearMap.comp_assoc, hg, LinearMap.comp_zero] + have hg₂ : g₂.comp (jMap e) = 0 := by + dsimp [g₂] + rw [LinearMap.comp_assoc, hg, LinearMap.comp_zero] + obtain ⟨G₁, hG₁⟩ := jHomLift e d h g₁ hg₁ + obtain ⟨G₂, hG₂⟩ := jHomLift e d h g₂ hg₂ + refine ⟨eRegularInclusion.comp G₁ + jRegularInclusion.comp G₂, ?_⟩ + apply LinearMap.ext + intro x + change eRegularInclusion (G₁ (jMap d x)) + jRegularInclusion (G₂ (jMap d x)) = g x + have h₁ : G₁ (jMap d x) = g₁ x := DFunLike.congr_fun hG₁ x + have h₂ : G₂ (jMap d x) = g₂ x := DFunLike.congr_fun hG₂ x + rw [h₁, h₂] + exact regular_decomposition (k := k) (g x) + +end ArExplicit.TriangularInduction + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularExact.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularExact.lean new file mode 100644 index 0000000000000000000000000000000000000000..2def51fb4342fcb3fbf9ae803a7f3788207374d3 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularExact.lean @@ -0,0 +1,49 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularFunctor +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorExact + +namespace OAI + +namespace ArExplicit.TriangularInduction + +variable {k R F : Type*} [CommRing k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] +variable {M N L : Type*} +variable [AddCommGroup M] [Module k M] [Module R M] [IsScalarTower k R M] [SMulCommClass k R M] +variable [AddCommGroup N] [Module k N] [Module R N] [IsScalarTower k R N] [SMulCommClass k R N] +variable [AddCommGroup L] [Module k L] [Module R L] [IsScalarTower k R L] [SMulCommClass k R L] + +omit [IsScalarTower k R F] [SMulCommClass k Rᵐᵒᵖ F] [SMulCommClass k R M] in +theorem eMap_exact [Module.Finite Rᵐᵒᵖ F] [Module.Projective Rᵐᵒᵖ F] + (e : M →ₗ[R] N) (d : N →ₗ[R] L) (hex : Function.Exact e d) : + Function.Exact (eMap (k := k) (F := F) e) (eMap d) := by + have ht := BalancedTensor.mapRight_exact (k := k) (F := F) (S := R) e d hex + intro z + constructor + · intro hz + obtain ⟨x, hx⟩ := (hex z.top).mp (congrArg TriangularModule.top hz) + obtain ⟨y, hy⟩ := (ht z.bottom).mp (congrArg TriangularModule.bottom hz) + exact ⟨⟨x, y⟩, TriangularModule.ext hx hy⟩ + · rintro ⟨w, rfl⟩ + apply TriangularModule.ext + · exact (hex (e w.top)).mpr ⟨w.top, rfl⟩ + · exact (ht (BalancedTensor.mapRight (S := R) e w.bottom)).mpr ⟨w.bottom, rfl⟩ + +omit [Algebra k R] [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] + [SMulCommClass k Rᵐᵒᵖ F] [Module k M] [IsScalarTower k R M] [SMulCommClass k R M] + [Module k N] [IsScalarTower k R N] [SMulCommClass k R N] + [Module k L] [IsScalarTower k R L] [SMulCommClass k R L] in +theorem jMap_exact (e : M →ₗ[R] N) (d : N →ₗ[R] L) (hex : Function.Exact e d) : + Function.Exact (jMap (k := k) (F := F) e) (jMap d) := by + intro z + constructor + · intro hz + obtain ⟨x, hx⟩ := (hex z.bottom).mp (congrArg TriangularModule.bottom hz) + exact ⟨⟨0, x⟩, TriangularModule.ext (Subsingleton.elim _ _) hx⟩ + · rintro ⟨w, rfl⟩ + exact TriangularModule.ext (Subsingleton.elim _ _) ((hex (e w.bottom)).mpr ⟨w.bottom, rfl⟩) + +end ArExplicit.TriangularInduction + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularFunctor.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..69674a8b118ad1c7f0d3c2c9ae0cdac872063e99 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularFunctor.lean @@ -0,0 +1,100 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularInduction +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorPi + +namespace OAI + +noncomputable section + +namespace ArExplicit.TriangularInduction + +variable {k R F : Type*} [CommRing k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] +variable {M N L : Type*} +variable [AddCommGroup M] [Module k M] [Module R M] [IsScalarTower k R M] +variable [AddCommGroup N] [Module k N] [Module R N] [IsScalarTower k R N] +variable [AddCommGroup L] [Module k L] [Module R L] [IsScalarTower k R L] + +def eMap (f : M →ₗ[R] N) : TriangularE k R F M →ₗ[Triangular R F] TriangularE k R F N := eHom f + +def jMap (f : M →ₗ[R] N) : TriangularJ k R F M →ₗ[Triangular R F] TriangularJ k R F N := jHom f + +omit [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] in +@[simp] theorem eMap_top (f : M →ₗ[R] N) (x : TriangularE k R F M) : + (eMap f x).top = f x.top := rfl + +omit [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] in +@[simp] theorem eMap_bottom (f : M →ₗ[R] N) (x : TriangularE k R F M) : + (eMap f x).bottom = BalancedTensor.mapRight (S := R) f x.bottom := rfl + +omit [Algebra k R] [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] + [SMulCommClass k Rᵐᵒᵖ F] [Module k M] [IsScalarTower k R M] + [Module k N] [IsScalarTower k R N] in +@[simp] theorem jMap_bottom (f : M →ₗ[R] N) (x : TriangularJ k R F M) : + (jMap f x).bottom = f x.bottom := rfl + +@[simp] theorem eMap_id : eMap (k := k) (F := F) (LinearMap.id : M →ₗ[R] M) = LinearMap.id := by + apply eHomEquiv.injective + ext m + rfl + +@[simp] theorem eMap_comp (f : M →ₗ[R] N) (g : N →ₗ[R] L) : + eMap (k := k) (F := F) (g.comp f) = (eMap g).comp (eMap f) := by + apply eHomEquiv.injective + ext m + rfl + +@[simp] theorem jMap_id : jMap (k := k) (F := F) (LinearMap.id : M →ₗ[R] M) = LinearMap.id := by + apply jHomEquiv.injective + ext m + rfl + +omit [Module k M] [IsScalarTower k R M] [Module k N] [IsScalarTower k R N] in +@[simp] theorem jMap_comp (f : M →ₗ[R] N) (g : N →ₗ[R] L) : + jMap (k := k) (F := F) (g.comp f) = (jMap g).comp (jMap f) := by + apply jHomEquiv.injective + ext m + rfl + +@[simp] theorem eMap_zero : eMap (k := k) (F := F) (0 : M →ₗ[R] N) = 0 := by + apply eHomEquiv.injective + ext m + rfl + +omit [Module k M] [IsScalarTower k R M] in +@[simp] theorem jMap_zero : jMap (k := k) (F := F) (0 : M →ₗ[R] N) = 0 := by + apply jHomEquiv.injective + ext m + rfl + +variable (ι : Type*) [Fintype ι] [DecidableEq ι] + +def ePi : TriangularE k R F (ι → M) ≃ₗ[Triangular R F] (ι → TriangularE k R F M) where + toFun x i := ⟨x.top i, BalancedTensor.piRight (S := R) x.bottom i⟩ + invFun y := ⟨fun i => (y i).top, (BalancedTensor.piRight (S := R)).symm (fun i => (y i).bottom)⟩ + left_inv x := by ext <;> simp + right_inv y := by ext <;> simp + map_add' x y := by ext <;> simp + map_smul' a x := by + ext i + · rfl + · change BalancedTensor.piRight (S := R) + (BalancedTensor.tmul a.off x.top + a.bottom • x.bottom) i = + BalancedTensor.tmul a.off (x.top i) + a.bottom • BalancedTensor.piRight (S := R) x.bottom i + simp only [map_add, map_smul, Pi.add_apply, Pi.smul_apply] + rfl + +def jPi : TriangularJ k R F (ι → M) ≃ₗ[Triangular R F] (ι → TriangularJ k R F M) where + toFun x i := ⟨0, x.bottom i⟩ + invFun y := ⟨0, fun i => (y i).bottom⟩ + left_inv x := by ext; rfl + right_inv y := by ext; rfl + map_add' x y := by ext; rfl + map_smul' a x := by ext; simp + +end ArExplicit.TriangularInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularHom.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularHom.lean new file mode 100644 index 0000000000000000000000000000000000000000..5a146b8b984f10e02e881a2dc6f48279821dea85 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularHom.lean @@ -0,0 +1,117 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularModule +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorFunctor + +namespace OAI + +namespace ArExplicit.TriangularModule + +variable {k R F M N M' N' : Type*} [CommRing k] [Ring R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [AddCommGroup M] [Module k M] [Module R M] +variable [AddCommGroup N] [Module R N] +variable [AddCommGroup M'] [Module k M'] [Module R M'] +variable [AddCommGroup N'] [Module R N'] +variable {φ : BalancedTensor k R F M →ₗ[R] N} +variable {ψ : BalancedTensor k R F M' →ₗ[R] N'} + +def hom (a : M →ₗ[R] M') (b : N →ₗ[R] N') + (h : ∀ f m, b (φ (BalancedTensor.tmul f m)) = ψ (BalancedTensor.tmul f (a m))) : + TriangularModule k R F M N φ →ₗ[Triangular R F] TriangularModule k R F M' N' ψ where + toFun x := ⟨a x.top, b x.bottom⟩ + map_add' x y := by ext <;> simp + map_smul' t x := by + ext + · exact a.map_smul t.top x.top + · simp only [bottom_smul, map_add, h, map_smul, RingHom.id_apply] + +@[simp] theorem hom_top (a : M →ₗ[R] M') (b : N →ₗ[R] N') + (h : ∀ f m, b (φ (BalancedTensor.tmul f m)) = ψ (BalancedTensor.tmul f (a m))) + (x : TriangularModule k R F M N φ) : (hom a b h x).top = a x.top := rfl + +@[simp] theorem hom_bottom (a : M →ₗ[R] M') (b : N →ₗ[R] N') + (h : ∀ f m, b (φ (BalancedTensor.tmul f m)) = ψ (BalancedTensor.tmul f (a m))) + (x : TriangularModule k R F M N φ) : (hom a b h x).bottom = b x.bottom := rfl + +variable (g : TriangularModule k R F M N φ →ₗ[Triangular R F] TriangularModule k R F M' N' ψ) + +theorem top_of_map (x : TriangularModule k R F M N φ) : + (g ⟨x.top, 0⟩).top = (g x).top := by + have h := congrArg TriangularModule.top (g.map_smul (⟨1, 0, 0⟩ : Triangular R F) x) + have he : (⟨1, 0, 0⟩ : Triangular R F) • x = ⟨x.top, 0⟩ := by ext <;> simp + rw [he] at h + simpa using h + +theorem bottom_of_map (x : TriangularModule k R F M N φ) : + (g ⟨0, x.bottom⟩).bottom = (g x).bottom := by + have h := congrArg TriangularModule.bottom (g.map_smul (⟨0, 1, 0⟩ : Triangular R F) x) + have he : (⟨0, 1, 0⟩ : Triangular R F) • x = ⟨0, x.bottom⟩ := by ext <;> simp + rw [he] at h + simpa using h + +def topMap : M →ₗ[R] M' where + toFun m := (g ⟨m, 0⟩).top + map_add' m n := by + have h : (⟨m + n, 0⟩ : TriangularModule k R F M N φ) = ⟨m, 0⟩ + ⟨n, 0⟩ := by + ext <;> simp + rw [h] + rw [g.map_add] + rfl + map_smul' r m := by + have h := congrArg TriangularModule.top + (g.map_smul (⟨r, 0, 0⟩ : Triangular R F) ⟨m, 0⟩) + have he : (⟨r, 0, 0⟩ : Triangular R F) • + (⟨m, 0⟩ : TriangularModule k R F M N φ) = ⟨r • m, 0⟩ := by ext <;> simp + rw [he] at h + exact h + +def bottomMap : N →ₗ[R] N' where + toFun n := (g ⟨0, n⟩).bottom + map_add' m n := by + have h : (⟨0, m + n⟩ : TriangularModule k R F M N φ) = ⟨0, m⟩ + ⟨0, n⟩ := by + ext <;> simp + rw [h] + rw [g.map_add] + rfl + map_smul' r n := by + have h := congrArg TriangularModule.bottom + (g.map_smul (⟨0, r, 0⟩ : Triangular R F) ⟨0, n⟩) + have he : (⟨0, r, 0⟩ : Triangular R F) • + (⟨0, n⟩ : TriangularModule k R F M N φ) = ⟨0, r • n⟩ := by ext <;> simp + rw [he] at h + simpa using h + +@[simp] theorem topMap_apply (m : M) : topMap g m = (g ⟨m, 0⟩).top := rfl +@[simp] theorem bottomMap_apply (n : N) : bottomMap g n = (g ⟨0, n⟩).bottom := rfl + +theorem compatibility (f : F) (m : M) : + bottomMap g (φ (BalancedTensor.tmul f m)) = ψ (BalancedTensor.tmul f (topMap g m)) := by + have h := congrArg TriangularModule.bottom + (g.map_smul (⟨0, 0, f⟩ : Triangular R F) ⟨m, 0⟩) + have he : (⟨0, 0, f⟩ : Triangular R F) • + (⟨m, 0⟩ : TriangularModule k R F M N φ) = ⟨0, φ (BalancedTensor.tmul f m)⟩ := by + ext <;> simp + rw [he] at h + simpa using h + +theorem hom_topMap_bottomMap : hom (topMap g) (bottomMap g) (compatibility g) = g := by + apply LinearMap.ext + intro x + ext + · exact top_of_map g x + · exact bottom_of_map g x + +@[ext] theorem hom_ext + (g' : TriangularModule k R F M N φ →ₗ[Triangular R F] TriangularModule k R F M' N' ψ) + (ht : topMap g = topMap g') (hb : bottomMap g = bottomMap g') : g = g' := by + apply LinearMap.ext + intro x + ext + · rw [← top_of_map g x, ← top_of_map g' x] + exact congrArg (fun a : M →ₗ[R] M' => a x.top) ht + · rw [← bottom_of_map g x, ← bottom_of_map g' x] + exact congrArg (fun b : N →ₗ[R] N' => b x.bottom) hb + +end ArExplicit.TriangularModule + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularInduction.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularInduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf5803d5e278ff9a5f10fe81155d8ed0e001b613 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularInduction.lean @@ -0,0 +1,86 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularHom +import Mathlib.Algebra.Module.PUnit + +namespace OAI + +namespace ArExplicit + +variable (k R F : Type*) [CommRing k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable (M : Type*) [AddCommGroup M] [Module k M] [Module R M] + +abbrev TriangularE := TriangularModule k R F M (BalancedTensor k R F M) LinearMap.id + +variable (N : Type*) [AddCommGroup N] [Module R N] + +abbrev TriangularJ := TriangularModule k R F PUnit.{1} N 0 + +namespace TriangularInduction + +variable {k R F M N} +variable {M' N' : Type*} [AddCommGroup M'] [Module k M'] [Module R M'] +variable [AddCommGroup N'] [Module R N'] +variable {ψ : BalancedTensor k R F M' →ₗ[R] N'} +variable [IsScalarTower k R M] [IsScalarTower k R M'] + +def eHom (a : M →ₗ[R] M') : + TriangularE k R F M →ₗ[Triangular R F] TriangularModule k R F M' N' ψ := + TriangularModule.hom a (ψ.comp (BalancedTensor.mapRight a)) (by intros; rfl) + +def jHom (b : N →ₗ[R] N') : + TriangularJ k R F N →ₗ[Triangular R F] TriangularModule k R F M' N' ψ := + TriangularModule.hom 0 b (by intros; simp) + +theorem eHom_topMap + (g : TriangularE k R F M →ₗ[Triangular R F] TriangularModule k R F M' N' ψ) : + eHom (TriangularModule.topMap g) = g := by + apply TriangularModule.hom_ext + · ext m; rfl + · apply BalancedTensor.leftHom_ext + intro f m + exact (TriangularModule.compatibility g f m).symm + +omit [Algebra k R] [IsScalarTower k R M'] in +theorem jHom_bottomMap + (g : TriangularJ k R F N →ₗ[Triangular R F] TriangularModule k R F M' N' ψ) : + jHom (TriangularModule.bottomMap g) = g := by + apply TriangularModule.hom_ext + · apply Subsingleton.elim + · ext n; rfl + +variable [Module k N] [Module k N'] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] +variable [SMulCommClass k Rᵐᵒᵖ F] +variable [IsScalarTower k R N] [IsScalarTower k R N'] +variable [SMulCommClass k R M'] [SMulCommClass k R N'] + +def eHomEquiv : + (TriangularE k R F M →ₗ[Triangular R F] TriangularModule k R F M' N' ψ) ≃ₗ[k] + (M →ₗ[R] M') where + toFun := TriangularModule.topMap + invFun := eHom + left_inv := eHom_topMap + right_inv a := by ext m; rfl + map_add' g h := by ext m; rfl + map_smul' c g := by ext m; rfl + +def jHomEquiv : + (TriangularJ k R F N →ₗ[Triangular R F] TriangularModule k R F M' N' ψ) ≃ₗ[k] + (N →ₗ[R] N') where + toFun := TriangularModule.bottomMap + invFun := jHom + left_inv := jHom_bottomMap + right_inv a := by ext n; rfl + map_add' g h := by ext n; rfl + map_smul' c g := by ext n; rfl + +theorem hom_E_J_eq_zero (g : TriangularE k R F M →ₗ[Triangular R F] TriangularJ k R F N) : + g = 0 := by + apply eHomEquiv.injective + exact Subsingleton.elim _ _ + +end TriangularInduction +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularModule.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularModule.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc239e568f06c80f70ee64a71757e6a7b1874743 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularModule.lean @@ -0,0 +1,107 @@ +import OAI.Algebra.AuslanderReiten.Triangular.Triangular +import OAI.Algebra.AuslanderReiten.Tensor.BalancedTensorUnit + +namespace OAI + +namespace ArExplicit + +variable (k R F M N : Type*) [CommRing k] [Ring R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [AddCommGroup M] [Module k M] [Module R M] +variable [AddCommGroup N] [Module R N] + +@[ext] structure TriangularModule (φ : BalancedTensor k R F M →ₗ[R] N) where + top : M + bottom : N + +namespace TriangularModule + +variable {k R F M N} +variable (φ : BalancedTensor k R F M →ₗ[R] N) + +def coordinates : TriangularModule k R F M N φ ≃ M × N where + toFun x := (x.top, x.bottom) + invFun x := ⟨x.1, x.2⟩ + left_inv _ := rfl + right_inv _ := rfl + +instance : AddCommGroup (TriangularModule k R F M N φ) := (coordinates φ).addCommGroup + +def coordinateAddEquiv : TriangularModule k R F M N φ ≃+ M × N where + __ := coordinates φ + map_add' _ _ := rfl + +@[simp] theorem top_add (x y : TriangularModule k R F M N φ) : (x + y).top = x.top + y.top := rfl +@[simp] theorem bottom_add (x y : TriangularModule k R F M N φ) : + (x + y).bottom = x.bottom + y.bottom := rfl +@[simp] theorem top_zero : (0 : TriangularModule k R F M N φ).top = 0 := rfl +@[simp] theorem bottom_zero : (0 : TriangularModule k R F M N φ).bottom = 0 := rfl + +instance : SMul (Triangular R F) (TriangularModule k R F M N φ) := + ⟨fun a x => ⟨a.top • x.top, φ (BalancedTensor.tmul a.off x.top) + a.bottom • x.bottom⟩⟩ + +@[simp] theorem top_smul (a : Triangular R F) (x : TriangularModule k R F M N φ) : + (a • x).top = a.top • x.top := rfl +@[simp] theorem bottom_smul (a : Triangular R F) (x : TriangularModule k R F M N φ) : + (a • x).bottom = φ (BalancedTensor.tmul a.off x.top) + a.bottom • x.bottom := rfl + +instance : Module (Triangular R F) (TriangularModule k R F M N φ) where + one_smul x := by ext <;> simp + mul_smul a b x := by + ext + · exact mul_smul a.top b.top x.top + · simp only [bottom_smul, top_smul, Triangular.off_mul, Triangular.bottom_mul, + BalancedTensor.add_tmul, BalancedTensor.balance, map_add, mul_smul, smul_add] + rw [← BalancedTensor.smul_tmul, φ.map_smul] + abel + smul_add a x y := by + ext <;> simp [BalancedTensor.tmul_add, smul_add, add_add_add_comm] + smul_zero a := by ext <;> simp + add_smul a b x := by + ext <;> simp [BalancedTensor.add_tmul, add_smul, add_add_add_comm] + zero_smul x := by ext <;> simp + +section Scalars + +variable [Module k N] + +instance : Module k (TriangularModule k R F M N φ) := (coordinateAddEquiv φ).module k + +@[simp] theorem top_scalar (c : k) (x : TriangularModule k R F M N φ) : + (c • x).top = c • x.top := rfl +@[simp] theorem bottom_scalar (c : k) (x : TriangularModule k R F M N φ) : + (c • x).bottom = c • x.bottom := rfl + +variable [Algebra k R] [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] +variable [SMulCommClass k Rᵐᵒᵖ F] +variable [IsScalarTower k R M] [IsScalarTower k R N] + +instance : IsScalarTower k (Triangular R F) (TriangularModule k R F M N φ) where + smul_assoc c a x := by + ext + · exact smul_assoc c a.top x.top + · simp only [bottom_smul, Triangular.off_smul, Triangular.bottom_smul, + bottom_scalar, BalancedTensor.scalar_tmul, LinearMap.map_smul_of_tower, smul_assoc, smul_add] + +instance [SMulCommClass k R M] [SMulCommClass k R N] : + SMulCommClass k (Triangular R F) (TriangularModule k R F M N φ) where + smul_comm c a x := by + ext + · exact smul_comm c a.top x.top + · simp only [bottom_scalar, bottom_smul, top_scalar, BalancedTensor.tmul_scalar, + LinearMap.map_smul_of_tower, smul_add, smul_comm c a.bottom] + +def coordinateLinearEquiv : TriangularModule k R F M N φ ≃ₗ[k] M × N := + (coordinateAddEquiv φ).linearEquiv k + +instance [Module.Finite k M] [Module.Finite k N] : + Module.Finite k (TriangularModule k R F M N φ) := + Module.Finite.equiv (coordinateLinearEquiv φ).symm + +end Scalars + +end TriangularModule +end ArExplicit + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularProjective.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularProjective.lean new file mode 100644 index 0000000000000000000000000000000000000000..cad4879d296092587fc485a3d6bb4174db377d99 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularProjective.lean @@ -0,0 +1,109 @@ +import OAI.Algebra.AuslanderReiten.Triangular.TriangularFunctor +import Mathlib.Algebra.Module.Projective +import Mathlib.RingTheory.Finiteness.Cardinality + +namespace OAI + +noncomputable section + +namespace ArExplicit.TriangularInduction + +private instance finitePiProjective {S P ι : Type*} [Ring S] [AddCommGroup P] + [Module S P] [Module.Projective S P] [Fintype ι] : Module.Projective S (ι → P) := + Module.Projective.of_equiv (DFinsupp.linearEquivFunOnFintype : + (Π₀ _ : ι, P) ≃ₗ[S] (ι → P)) + +variable {k R F : Type*} [CommRing k] [Ring R] [Algebra k R] +variable [AddCommGroup F] [Module k F] [Module R F] [Module Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass R Rᵐᵒᵖ F] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] [SMulCommClass k Rᵐᵒᵖ F] + +def eRegularInclusion : TriangularE k R F R →ₗ[Triangular R F] Triangular R F where + toFun x := ⟨x.top, 0, BalancedTensor.runitLeft (S := R) x.bottom⟩ + map_add' x y := by ext <;> simp + map_smul' a x := by + ext + · rfl + · simp + · change BalancedTensor.runitLeft (S := R) + (BalancedTensor.tmul a.off x.top + a.bottom • x.bottom) = + a.bottom • BalancedTensor.runitLeft (S := R) x.bottom + MulOpposite.op x.top • a.off + rw [map_add, map_smul] + exact add_comm _ _ + +def eRegularProjection : Triangular R F →ₗ[Triangular R F] TriangularE k R F R where + toFun a := ⟨a.top, (BalancedTensor.runitLeft (k := k) (R := R) (S := R)).symm a.off⟩ + map_add' a b := by ext <;> simp + map_smul' a b := by + ext + · rfl + · change (BalancedTensor.runitLeft (S := R)).symm + (a.bottom • b.off + MulOpposite.op b.top • a.off) = + BalancedTensor.tmul a.off b.top + + a.bottom • (BalancedTensor.runitLeft (S := R)).symm b.off + apply (BalancedTensor.runitLeft (S := R)).injective + rw [LinearEquiv.apply_symm_apply, map_add, map_smul, LinearEquiv.apply_symm_apply] + exact add_comm _ _ + +omit [IsScalarTower k R F] [SMulCommClass k Rᵐᵒᵖ F] in +theorem eRegular_split : + (eRegularProjection (k := k) (R := R) (F := F)).comp eRegularInclusion = LinearMap.id := by + apply LinearMap.ext + intro x + ext + · rfl + · exact (BalancedTensor.runitLeft (S := R)).symm_apply_apply x.bottom + +instance eRegular_projective : Module.Projective (Triangular R F) (TriangularE k R F R) := + Module.Projective.of_split eRegularInclusion eRegularProjection eRegular_split + +def jRegularInclusion : TriangularJ k R F R →ₗ[Triangular R F] Triangular R F where + toFun x := ⟨0, x.bottom, 0⟩ + map_add' x y := by ext <;> simp + map_smul' a x := by ext <;> simp + +def jRegularProjection : Triangular R F →ₗ[Triangular R F] TriangularJ k R F R where + toFun a := ⟨0, a.bottom⟩ + map_add' a b := by ext; simp + map_smul' a b := by ext; simp + +omit [Algebra k R] [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] + [SMulCommClass k Rᵐᵒᵖ F] in +theorem jRegular_split : + (jRegularProjection (k := k) (R := R) (F := F)).comp jRegularInclusion = LinearMap.id := by + apply LinearMap.ext + intro x + ext + exact rfl + +instance jRegular_projective : Module.Projective (Triangular R F) (TriangularJ k R F R) := + Module.Projective.of_split jRegularInclusion jRegularProjection jRegular_split + +variable {M : Type*} [AddCommGroup M] [Module k M] [Module R M] +variable [IsScalarTower k R M] [SMulCommClass k R M] + +omit [SMulCommClass k R M] in +theorem eProjective [Module.Finite R M] [Module.Projective R M] : + Module.Projective (Triangular R F) (TriangularE k R F M) := by + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' R M + obtain ⟨s, hs⟩ := Module.projective_lifting_property p (LinearMap.id : M →ₗ[R] M) hp + let : Module.Projective (Triangular R F) (TriangularE k R F (Fin n → R)) := + Module.Projective.of_equiv (ePi (k := k) (R := R) (F := F) (M := R) (Fin n)).symm + apply Module.Projective.of_split (eMap s) (eMap p) + rw [← eMap_comp, hs, eMap_id] + +omit [SMulCommClass k R M] in +theorem jProjective [Module.Finite R M] [Module.Projective R M] : + Module.Projective (Triangular R F) (TriangularJ k R F M) := by + obtain ⟨n, p, hp⟩ := Module.Finite.exists_fin' R M + obtain ⟨s, hs⟩ := Module.projective_lifting_property p (LinearMap.id : M →ₗ[R] M) hp + let : Module.Projective (Triangular R F) (TriangularJ k R F (Fin n → R)) := + Module.Projective.of_equiv (jPi (k := k) (R := R) (F := F) (M := R) (Fin n)).symm + apply Module.Projective.of_split (jMap s) (jMap p) + rw [← jMap_comp, hs, jMap_id] + +end ArExplicit.TriangularInduction + +end + +end OAI diff --git a/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularRadical.lean b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularRadical.lean new file mode 100644 index 0000000000000000000000000000000000000000..03e07f1577182c1739d54305fb237c6422b1af88 --- /dev/null +++ b/lean/OAI/Algebra/AuslanderReiten/Triangular/TriangularRadical.lean @@ -0,0 +1,82 @@ +import OAI.Algebra.AuslanderReiten.Triangular.Triangular +import OAI.Algebra.AuslanderReiten.Algebras.Radical +import Mathlib.RingTheory.Ideal.Quotient.Operations + +namespace OAI + +namespace ArExplicit.Triangular + +variable {R F : Type*} [Ring R] [AddCommGroup F] +variable [Module R F] [Module Rᵐᵒᵖ F] [SMulCommClass R Rᵐᵒᵖ F] + +theorem diagonal_kernel_square : + (RingHom.ker (diagonal (R := R) (F := F))) ^ 2 = ⊥ := by + apply le_antisymm _ bot_le + rw [Submodule.pow_succ, Submodule.pow_one] + apply Ideal.mul_le.mpr + intro a ha b hb + change (a.top, a.bottom) = (0, 0) at ha + change (b.top, b.bottom) = (0, 0) at hb + have ha₁ : a.top = 0 := congrArg Prod.fst ha + have ha₂ : a.bottom = 0 := congrArg Prod.snd ha + have hb₁ : b.top = 0 := congrArg Prod.fst hb + have hb₂ : b.bottom = 0 := congrArg Prod.snd hb + change a * b = 0 + ext <;> simp [ha₁, ha₂, hb₁, hb₂] + +theorem radical_eq_comap : + Ring.jacobson (Triangular R F) = Ideal.comap diagonal (Ring.jacobson (R × R)) := by + apply jacobson_eq_comap_of_nil_kernel _ diagonal_surjective + intro a ha + refine ⟨2, ?_⟩ + have h := Ideal.pow_mem_pow ha 2 + simpa only [diagonal_kernel_square, Ideal.mem_bot] using h + +theorem mem_jacobson_iff (a : Triangular R F) : + a ∈ Ring.jacobson (Triangular R F) ↔ + a.top ∈ Ring.jacobson R ∧ a.bottom ∈ Ring.jacobson R := by + rw [radical_eq_comap] + exact mem_jacobson_prod_iff (a.top, a.bottom) + +section Scalars + +variable (k : Type*) [CommRing k] [Algebra k R] [Module k F] +variable [IsScalarTower k R F] [IsScalarTower k Rᵐᵒᵖ F] +variable [SMulCommClass k R F] [SMulCommClass k Rᵐᵒᵖ F] + +def diagonalAlg : Triangular R F →ₐ[k] R × R where + __ := diagonal + commutes' c := by + simp only [Algebra.algebraMap_eq_smul_one] + rfl + +variable {S : Type*} [Ring S] [Algebra k S] + +def quotientMap (f : R →ₐ[k] S) : Triangular R F →ₐ[k] S × S := + (f.prodMap f).comp (diagonalAlg k) + +theorem quotientMap_surjective (f : R →ₐ[k] S) (hf : Function.Surjective f) : + Function.Surjective (quotientMap (F := F) k f) := by + rintro ⟨s, t⟩ + obtain ⟨r, hr⟩ := hf s + obtain ⟨r', hr'⟩ := hf t + exact ⟨⟨r, r', 0⟩, Prod.ext hr hr'⟩ + +theorem radical_eq_ker_quotientMap (f : R →ₐ[k] S) + (hf : Ring.jacobson R = RingHom.ker f) : + Ring.jacobson (Triangular R F) = RingHom.ker (quotientMap k f) := by + ext a + rw [mem_jacobson_iff, hf] + change (f a.top = 0 ∧ f a.bottom = 0) ↔ (f a.top, f a.bottom) = (0, 0) + simp only [Prod.mk.injEq] + +noncomputable def semisimpleQuotientEquiv (f : R →ₐ[k] S) + (hsurj : Function.Surjective f) (hker : Ring.jacobson R = RingHom.ker f) : + (Triangular R F ⧸ Ring.jacobson (Triangular R F)) ≃ₐ[k] S × S := + (Ideal.quotientEquivAlgOfEq k (radical_eq_ker_quotientMap k f hker)).trans + (Ideal.quotientKerAlgEquivOfSurjective (quotientMap_surjective k f hsurj)) + +end Scalars +end ArExplicit.Triangular + +end OAI diff --git a/lean/OAI/Algebra/BogomolovPop/Canonical.lean b/lean/OAI/Algebra/BogomolovPop/Canonical.lean new file mode 100644 index 0000000000000000000000000000000000000000..a46fc1a12e31b8eed2ff2cb3802329511fa9c12b --- /dev/null +++ b/lean/OAI/Algebra/BogomolovPop/Canonical.lean @@ -0,0 +1,785 @@ +import Mathlib +import OAI.Algebra.BogomolovPop.Foundations + +namespace OAI + +/-! Canonical Galois transport, bracket compatibility and quotient-map well-definedness. -/ + +noncomputable section +open scoped Topology + +namespace BogomolovPop +open scoped Topology commutatorElement +open Filter + +instance PiA.nonarchimedean (ell : ℕ) (F : Type*) [Field F] : + NonarchimedeanGroup (PiA ell F) := + quotient_nonarchimedean (commutator (ProEll ell F)).topologicalClosure + +instance additive_nonarchimedean (G : Type*) [Group G] [TopologicalSpace G] + [NonarchimedeanGroup G] : NonarchimedeanAddGroup (Additive G) where + is_nonarchimedean U hU := by + obtain ⟨V, hV⟩ := NonarchimedeanGroup.is_nonarchimedean (G := G) U hU + exact ⟨{ V.toSubgroup.toAddSubgroup with isOpen' := V.isOpen }, hV⟩ + +instance PiA.allLevelsEll (ell : ℕ) (F : Type*) [Field F] : + Fact (AllLevelsEll ell (Additive (PiA ell F))) := ⟨by + intro H + let q : PiA ell F →* Multiplicative (Additive (PiA ell F) ⧸ H.toAddSubgroup) := + { toFun := fun x => Multiplicative.ofAdd (QuotientAddGroup.mk (Additive.ofMul x)) + map_one' := by rfl + map_mul' := fun x y => by rfl } + have hq : Continuous q := + (QuotientAddGroup.continuous_mk : + Continuous (QuotientAddGroup.mk : Additive (PiA ell F) → Additive (PiA ell F) ⧸ H.toAddSubgroup)) + have hqs : Function.Surjective q := by + intro y + obtain ⟨x, hx⟩ := QuotientAddGroup.mk_surjective (Multiplicative.toAdd y) + exact ⟨Additive.toMul x, hx⟩ + exact isPGroup_of_proEll_image (QuotientGroup.mk' _) QuotientGroup.continuous_mk + QuotientGroup.mk_surjective q hq hqs⟩ + +instance PiA.padicModule (ell : ℕ) [Fact ell.Prime] (F : Type*) [Field F] : + Module (PadicInt ell) (Additive (PiA ell F)) := abelianEllModule + +instance PiA.padicContinuousSMul (ell : ℕ) [Fact ell.Prime] (F : Type*) [Field F] : + ContinuousSMul (PadicInt ell) (Additive (PiA ell F)) := abelianEllModule_continuous + +instance PiA.additiveT2 (ell : ℕ) (F : Type*) [Field F] : + T2Space (Additive (PiA ell F)) := PiA.t2Space ell F + +theorem PiA.continuous_linear {ell : ℕ} [Fact ell.Prime] {F E : Type*} [Field F] [Field E] + (f : PiA ell F →* PiA ell E) (hf : Continuous f) (c : PadicInt ell) (x : PiA ell F) : + Additive.ofMul (f (Additive.toMul (c • Additive.ofMul x))) = c • Additive.ofMul (f x) := + continuous_addHom_padic_linear f.toAdditive hf c (Additive.ofMul x) + +theorem scalarStep_iff_unit {ell : ℕ} [Fact ell.Prime] {K L : Type*} [Field K] [Field L] + (φ χ : IsomC ell K L) : + ScalarStep φ χ ↔ ∃ u : (PadicInt ell)ˣ, ∀ x : PiA ell L, + Additive.ofMul (χ.1 x) = (u : PadicInt ell) • Additive.ofMul (φ.1 x) := by + constructor + · rintro ⟨u, hu⟩ + refine ⟨u, fun x => ?_⟩ + exact tendsto_nhds_unique (hu x) (padic_appr_smul_tendsto (u : PadicInt ell) (Additive.ofMul (φ.1 x))) + · rintro ⟨u, hu⟩ + refine ⟨u, fun x => ?_⟩ + have ht := padic_appr_smul_tendsto (u : PadicInt ell) (Additive.ofMul (φ.1 x)) + rw [← hu x] at ht + exact ht + +theorem delta_commute {ell : ℕ} {F : Type*} [Field F] + (z : Delta ell F) (x : PiC ell F) : Commute (z : PiC ell F) x := by + obtain ⟨a, ha⟩ := QuotientGroup.mk'_surjective (closedGammaThree (ProEll ell F)) z.1 + obtain ⟨b, rfl⟩ := QuotientGroup.mk'_surjective (closedGammaThree (ProEll ell F)) x + rw [← ha] + apply closedCommutator_image_commute + apply (QuotientGroup.eq_one_iff a).mp + have hz := z.property + rw [← ha] at hz + exact hz + +instance Delta.commGroup (ell : ℕ) (F : Type*) [Field F] : CommGroup (Delta ell F) := + { (inferInstance : Group (Delta ell F)) with + mul_comm := fun z x => Subtype.ext (delta_commute z x).eq } + +theorem centralProjection_continuous (ell : ℕ) (F : Type*) [Field F] : + Continuous (centralProjection ell F) := by + apply (QuotientGroup.isQuotientMap_mk (closedGammaThree (ProEll ell F))).continuous_iff.mpr + exact QuotientGroup.continuous_mk + +instance Delta.compactSpace (ell : ℕ) (F : Type*) [Field F] : CompactSpace (Delta ell F) := by + have h : IsClosed ((centralProjection ell F).ker : Set (PiC ell F)) := + isClosed_singleton.preimage (centralProjection_continuous ell F) + exact isCompact_iff_compactSpace.mp h.isCompact + +instance PiC.nonarchimedean (ell : ℕ) (F : Type*) [Field F] : + NonarchimedeanGroup (PiC ell F) := quotient_nonarchimedean _ + +instance Delta.nonarchimedean (ell : ℕ) (F : Type*) [Field F] : + NonarchimedeanGroup (Delta ell F) where + is_nonarchimedean U hU := by + obtain ⟨V, hV, hVo, h1V⟩ := mem_nhds_iff.mp hU + obtain ⟨H, hH⟩ := ProfiniteGrp.exist_openNormalSubgroup_sub_open_nhds_of_one hVo h1V + exact ⟨H.toOpenSubgroup, hH.trans hV⟩ + +theorem PiC.pow_tendsto_one {ell : ℕ} {F : Type*} [Field F] (x : PiC ell F) : + Tendsto (fun n : ℕ => x ^ ell ^ n) atTop (nhds 1) := by + obtain ⟨a, rfl⟩ := QuotientGroup.mk'_surjective (closedGammaThree (ProEll ell F)) x + have hq : Continuous (QuotientGroup.mk' (closedGammaThree (ProEll ell F))) := + QuotientGroup.continuous_mk + simpa only [map_one, Function.comp_def, map_pow] using + (hq.tendsto (1 : ProEll ell F)).comp (proEll_pow_tendsto_one a) + +theorem Delta.pow_tendsto_one {ell : ℕ} {F : Type*} [Field F] (x : Delta ell F) : + Tendsto (fun n : ℕ => x ^ ell ^ n) atTop (nhds 1) := by + apply Topology.IsEmbedding.subtypeVal.tendsto_nhds_iff.mpr + exact PiC.pow_tendsto_one x.1 + +instance Delta.allLevelsEll (ell : ℕ) (F : Type*) [Field F] : + Fact (AllLevelsEll ell (Additive (Delta ell F))) := ⟨by + intro H y + obtain ⟨x, rfl⟩ := QuotientAddGroup.mk_surjective (Multiplicative.toAdd y) + have hq : Continuous (QuotientAddGroup.mk' H.toAddSubgroup) := + QuotientAddGroup.continuous_mk + have hx : Tendsto (fun n : ℕ => ell ^ n • x) atTop (nhds 0) := + Delta.pow_tendsto_one (Additive.toMul x) + have ht := (hq.tendsto (0 : Additive (Delta ell F))).comp hx + simp only [Function.comp_def, map_zero] at ht + have he : ∀ᶠ n : ℕ in atTop, + (QuotientAddGroup.mk (ell ^ n • x) : Additive (Delta ell F) ⧸ H.toAddSubgroup) = 0 := by + exact tendsto_pure.mp (by simpa only [nhds_discrete, QuotientAddGroup.mk'_apply] using ht) + obtain ⟨n, hn⟩ := he.exists + exact ⟨n, hn⟩⟩ + +instance Delta.additiveT2 (ell : ℕ) (F : Type*) [Field F] : + T2Space (Additive (Delta ell F)) := inferInstanceAs (T2Space (Delta ell F)) + +instance Delta.padicModule (ell : ℕ) [Fact ell.Prime] (F : Type*) [Field F] : + Module (PadicInt ell) (Additive (Delta ell F)) := abelianEllModule + +instance Delta.padicContinuousSMul (ell : ℕ) [Fact ell.Prime] (F : Type*) [Field F] : + ContinuousSMul (PadicInt ell) (Additive (Delta ell F)) := abelianEllModule_continuous + +theorem Delta.continuous_linear {ell : ℕ} [Fact ell.Prime] {F E : Type*} [Field F] [Field E] + (f : Delta ell F →* Delta ell E) (hf : Continuous f) (c : PadicInt ell) (x : Delta ell F) : + Additive.ofMul (f (Additive.toMul (c • Additive.ofMul x))) = c • Additive.ofMul (f x) := + continuous_addHom_padic_linear f.toAdditive hf c (Additive.ofMul x) + +theorem map_sourceCommutator {G H : Type*} [Group G] [Group H] + (f : G →* H) (a b : G) : + f (sourceCommutator a b) = sourceCommutator (f a) (f b) := by + simp only [sourceCommutator, map_mul, map_inv] + +theorem sourceCommutator_mul_left_of_central {G : Type*} [Group G] + (a b c : G) (h : Commute (sourceCommutator a c) b) : + sourceCommutator (a * b) c = sourceCommutator a c * sourceCommutator b c := by + calc + sourceCommutator (a * b) c = b⁻¹ * sourceCommutator a c * b * sourceCommutator b c := by + simp only [sourceCommutator] + group + _ = sourceCommutator a c * sourceCommutator b c := by + rw [h.symm.inv_left.eq] + simp only [mul_assoc, inv_mul_cancel, one_mul] + +theorem bracket_on_lifts {ell : ℕ} {F : Type*} [Field F] (a b : ProEll ell F) : + (bracket ell F (QuotientGroup.mk' _ a) (QuotientGroup.mk' _ b) : PiC ell F) = + QuotientGroup.mk' _ (sourceCommutator a b) := + bracket_eq_of_lifts ell F _ _ a b rfl rfl + +theorem bracket_mul_left {ell : ℕ} {F : Type*} [Field F] (x y z : PiA ell F) : + bracket ell F (x * y) z = bracket ell F x z * bracket ell F y z := by + obtain ⟨a, rfl⟩ := QuotientGroup.mk'_surjective (commutator (ProEll ell F)).topologicalClosure x + obtain ⟨b, rfl⟩ := QuotientGroup.mk'_surjective (commutator (ProEll ell F)).topologicalClosure y + obtain ⟨c, rfl⟩ := QuotientGroup.mk'_surjective (commutator (ProEll ell F)).topologicalClosure z + apply Subtype.ext + change (bracket ell F _ _ : PiC ell F) = + (bracket ell F _ _ : PiC ell F) * (bracket ell F _ _ : PiC ell F) + rw [← map_mul, bracket_on_lifts, bracket_on_lifts, bracket_on_lifts] + simp only [map_sourceCommutator, map_mul] + apply sourceCommutator_mul_left_of_central + rw [← map_sourceCommutator] + apply closedCommutator_image_commute + apply Subgroup.le_topologicalClosure + have hm : ⁅a⁻¹, c⁻¹⁆ ∈ commutator (ProEll ell F) := by + rw [commutator_eq_closure] + exact Subgroup.subset_closure (commutator_mem_commutatorSet _ _) + simpa only [sourceCommutator, commutatorElement_def, inv_inv] using hm + +theorem bracket_swap {ell : ℕ} {F : Type*} [Field F] (x y : PiA ell F) : + bracket ell F y x = (bracket ell F x y)⁻¹ := by + apply Subtype.ext + change QuotientGroup.mk' _ _ = (QuotientGroup.mk' _ _)⁻¹ + rw [← map_inv] + congr 1 + simp only [sourceCommutator] + group + +theorem bracket_mul_right {ell : ℕ} {F : Type*} [Field F] (x y z : PiA ell F) : + bracket ell F x (y * z) = bracket ell F x y * bracket ell F x z := by + rw [bracket_swap, bracket_mul_left, mul_inv_rev, ← bracket_swap, ← bracket_swap] + exact mul_comm _ _ + +theorem bracket_alternating {ell : ℕ} {F : Type*} [Field F] (x : PiA ell F) : + bracket ell F x x = 1 := by + apply Subtype.ext + change QuotientGroup.mk' _ _ = 1 + simp [sourceCommutator] + +theorem bracket_one_left {ell : ℕ} {F : Type*} [Field F] (x : PiA ell F) : + bracket ell F 1 x = 1 := by + have h := bracket_mul_left (1 : PiA ell F) 1 x + simp only [one_mul] at h + exact (mul_left_cancel (a := bracket ell F 1 x) (by simpa using h.symm)).symm + +theorem bracket_continuous (ell : ℕ) (F : Type*) [Field F] : + Continuous (fun z : PiA ell F × PiA ell F => bracket ell F z.1 z.2) := by + have h : Continuous (fun z : PiA ell F × PiA ell F => (bracket ell F z.1 z.2 : PiC ell F)) := by + apply ((QuotientGroup.isOpenQuotientMap_mk (N := (commutator (ProEll ell F)).topologicalClosure)).prodMap + (QuotientGroup.isOpenQuotientMap_mk (N := (commutator (ProEll ell F)).topologicalClosure))).isQuotientMap.continuous_iff.mpr + have hq : Continuous (QuotientGroup.mk' (closedGammaThree (ProEll ell F))) := + QuotientGroup.continuous_mk + convert hq.comp (((continuous_fst.inv.mul continuous_snd.inv).mul continuous_fst).mul continuous_snd) using 1 + funext z + exact bracket_on_lifts z.1 z.2 + exact h.subtype_mk _ + +def bracketLeftHom {ell : ℕ} {F : Type*} [Field F] (y : PiA ell F) : + PiA ell F →* Delta ell F where + toFun := fun x => bracket ell F x y + map_one' := bracket_one_left y + map_mul' := fun x z => bracket_mul_left x z y + +theorem bracket_smul_left {ell : ℕ} [Fact ell.Prime] {F : Type*} [Field F] + (c : PadicInt ell) (x y : PiA ell F) : + Additive.ofMul (bracket ell F (Additive.toMul (c • Additive.ofMul x)) y) = + c • Additive.ofMul (bracket ell F x y) := by + exact continuous_addHom_padic_linear (bracketLeftHom y).toAdditive + ((bracket_continuous ell F).comp (continuous_id.prodMk continuous_const)) c (Additive.ofMul x) + +def bracketRightHom {ell : ℕ} {F : Type*} [Field F] (x : PiA ell F) : + PiA ell F →* Delta ell F where + toFun := fun y => bracket ell F x y + map_one' := by rw [bracket_swap, bracket_one_left, inv_one] + map_mul' := fun y z => bracket_mul_right x y z + +theorem bracket_smul_right {ell : ℕ} [Fact ell.Prime] {F : Type*} [Field F] + (c : PadicInt ell) (x y : PiA ell F) : + Additive.ofMul (bracket ell F x (Additive.toMul (c • Additive.ofMul y))) = + c • Additive.ofMul (bracket ell F x y) := by + exact continuous_addHom_padic_linear (bracketRightHom x).toAdditive + ((bracket_continuous ell F).comp (continuous_const.prodMk continuous_id)) c (Additive.ofMul y) + +def unitScalarEquiv {R G : Type*} [CommRing R] [TopologicalSpace R] + [CommGroup G] [TopologicalSpace G] [Module R (Additive G)] + [ContinuousSMul R (Additive G)] (u : Rˣ) : G ≃ₜ* G where + toMulEquiv := (DistribMulAction.toAddEquiv (Additive G) u).toMultiplicative + continuous_toFun := by + change Continuous (fun x : Additive G => (u : R) • x) + exact continuous_const.smul continuous_id + continuous_invFun := by + change Continuous (fun x : Additive G => ((u⁻¹ : Rˣ) : R) • x) + exact continuous_const.smul continuous_id + +@[simp] theorem unitScalarEquiv_apply {R G : Type*} [CommRing R] [TopologicalSpace R] + [CommGroup G] [TopologicalSpace G] [Module R (Additive G)] + [ContinuousSMul R (Additive G)] (u : Rˣ) (x : G) : + unitScalarEquiv u x = Additive.toMul ((u : R) • Additive.ofMul x) := rfl + +def scalarIsomC {ell : ℕ} [Fact ell.Prime] {K L : Type*} [Field K] [Field L] + (u : (PadicInt ell)ˣ) (φ : IsomC ell K L) : IsomC ell K L := by + refine ⟨φ.1.trans (unitScalarEquiv u), ?_⟩ + obtain ⟨ψ, hψ⟩ := φ.2 + refine ⟨ψ.trans (unitScalarEquiv (u * u)), fun x y => ?_⟩ + change Additive.toMul (((u * u : (PadicInt ell)ˣ) : PadicInt ell) • Additive.ofMul (ψ (bracket ell L x y))) = _ + rw [hψ] + change _ = Additive.ofMul (bracket ell K + (Additive.toMul ((u : PadicInt ell) • Additive.ofMul (φ.1 x))) + (Additive.toMul ((u : PadicInt ell) • Additive.ofMul (φ.1 y)))) + rw [bracket_smul_left, bracket_smul_right, Units.val_mul, mul_smul] + rfl + +theorem scalarStep_equivalence {ell : ℕ} [Fact ell.Prime] {K L : Type*} [Field K] [Field L] : + Equivalence (ScalarStep (ell := ell) (K := K) (L := L)) := by + refine ⟨?_, ?_, ?_⟩ + · intro φ + rw [scalarStep_iff_unit] + exact ⟨1, fun x => by simp⟩ + · intro φ χ h + obtain ⟨u, hu⟩ := (scalarStep_iff_unit φ χ).mp h + rw [scalarStep_iff_unit] + exact ⟨u⁻¹, fun x => by rw [hu, ← mul_smul]; simp⟩ + · intro φ χ ψ h h' + obtain ⟨u, hu⟩ := (scalarStep_iff_unit φ χ).mp h + obtain ⟨v, hv⟩ := (scalarStep_iff_unit χ ψ).mp h' + rw [scalarStep_iff_unit] + exact ⟨v * u, fun x => by rw [hv, hu, Units.val_mul, mul_smul]⟩ + +theorem scalarEqvGen_iff {ell : ℕ} [Fact ell.Prime] {K L : Type*} [Field K] [Field L] + (φ χ : IsomC ell K L) : + Relation.EqvGen ScalarStep φ χ ↔ ScalarStep φ χ := by + exact scalarStep_equivalence.eqvGen_iff + +end BogomolovPop + +namespace BogomolovPop +open scoped Topology commutatorElement + +theorem quotient_comap_map_injective {G H : Type*} [Group G] [Group H] + (f : G →* H) (N : Subgroup H) [N.Normal] : + Function.Injective (QuotientGroup.map (N.comap f) N f le_rfl) := by + apply (MonoidHom.ker_eq_bot_iff _).mp + apply le_antisymm _ bot_le + intro z hz + rw [Subgroup.mem_bot] + induction z using QuotientGroup.induction_on with | H x => + apply (QuotientGroup.eq_one_iff x).mpr + exact (QuotientGroup.eq_one_iff (f x)).mp hz + +theorem proEllKernel_map_le {G H : Type*} [Group G] [Group H] + [TopologicalSpace G] [TopologicalSpace H] (ell : ℕ) (f : G →* H) + (hf : Continuous f) : proEllKernel ell G ≤ (proEllKernel ell H).comap f := by + intro x hx + simp only [proEllKernel, Subgroup.mem_comap, Subgroup.mem_iInf] at hx ⊢ + intro N hN + let U : OpenNormalSubgroup G := + { N.toOpenSubgroup.comap f hf with + isNormal' := by + change (N.toSubgroup.comap f).Normal + infer_instance } + have : U.toSubgroup.Normal := U.isNormal' + have hU : IsPGroup ell (G ⧸ U.toSubgroup) := + hN.of_injective (QuotientGroup.map (N.toSubgroup.comap f) N.toSubgroup f le_rfl) + (quotient_comap_map_injective f N.toSubgroup) + exact hx U hU + +theorem continuous_quotientMap {G H : Type*} [Group G] [Group H] + [TopologicalSpace G] [TopologicalSpace H] (N : Subgroup G) (M : Subgroup H) + [N.Normal] [M.Normal] (f : G →* H) (h : N ≤ M.comap f) (hf : Continuous f) : + Continuous (QuotientGroup.map N M f h) := by + apply (QuotientGroup.isQuotientMap_mk N).continuous_iff.mpr + exact QuotientGroup.continuous_mk.comp hf + +theorem closedCommutator_map_le {G H : Type*} [Group G] [Group H] + [TopologicalSpace G] [TopologicalSpace H] [IsTopologicalGroup G] + [IsTopologicalGroup H] (f : G →* H) (hf : Continuous f) : + (commutator G).topologicalClosure ≤ ((commutator H).topologicalClosure).comap f := by + apply Subgroup.topologicalClosure_minimal + · rw [_root_.commutator_def] + apply Subgroup.commutator_le.mpr + intro x _ y _ + change f ⁅x, y⁆ ∈ (commutator H).topologicalClosure + rw [map_commutatorElement] + exact Subgroup.le_topologicalClosure _ + (Subgroup.commutator_mem_commutator (Subgroup.mem_top _) (Subgroup.mem_top _)) + · exact (Subgroup.isClosed_topologicalClosure _).preimage hf + +theorem closedGammaThree_map_le {G H : Type*} [Group G] [Group H] + [TopologicalSpace G] [TopologicalSpace H] [IsTopologicalGroup G] + [IsTopologicalGroup H] (f : G →* H) (hf : Continuous f) : + closedGammaThree G ≤ (closedGammaThree H).comap f := by + apply Subgroup.topologicalClosure_minimal + · apply Subgroup.commutator_le.mpr + intro x hx y _ + change f ⁅x, y⁆ ∈ closedGammaThree H + rw [map_commutatorElement] + exact Subgroup.le_topologicalClosure _ + (Subgroup.commutator_mem_commutator (closedCommutator_map_le f hf hx) + (Subgroup.mem_top _)) + · exact (Subgroup.isClosed_topologicalClosure _).preimage hf + +def quotientContinuousEquiv {G H : Type*} [Group G] [Group H] + [TopologicalSpace G] [TopologicalSpace H] (N : Subgroup G) (M : Subgroup H) + [N.Normal] [M.Normal] (f : G ≃ₜ* H) + (hf : N ≤ M.comap f.toMonoidHom) (hi : M ≤ N.comap f.symm.toMonoidHom) : + (G ⧸ N) ≃ₜ* (H ⧸ M) where + toFun := QuotientGroup.map N M f.toMonoidHom hf + invFun := QuotientGroup.map M N f.symm.toMonoidHom hi + left_inv x := by + induction x using QuotientGroup.induction_on with | H x => + change QuotientGroup.mk' N (f.symm (f x)) = QuotientGroup.mk' N x + rw [f.symm_apply_apply] + right_inv x := by + induction x using QuotientGroup.induction_on with | H x => + change QuotientGroup.mk' M (f (f.symm x)) = QuotientGroup.mk' M x + rw [f.apply_symm_apply] + map_mul' := map_mul _ + continuous_toFun := continuous_quotientMap N M f.toMonoidHom hf f.continuous + continuous_invFun := continuous_quotientMap M N f.symm.toMonoidHom hi f.symm.continuous + +def proEllContinuousEquiv {G H : Type*} [Group G] [Group H] + [TopologicalSpace G] [TopologicalSpace H] (ell : ℕ) (f : G ≃ₜ* H) : + (G ⧸ proEllKernel ell G) ≃ₜ* (H ⧸ proEllKernel ell H) := + quotientContinuousEquiv _ _ f (proEllKernel_map_le ell f.toMonoidHom f.continuous) + (proEllKernel_map_le ell f.symm.toMonoidHom f.symm.continuous) + +def abelianContinuousEquiv {G H : Type*} [Group G] [Group H] + [TopologicalSpace G] [TopologicalSpace H] [IsTopologicalGroup G] + [IsTopologicalGroup H] (f : G ≃ₜ* H) : + TopologicalAbelianization G ≃ₜ* TopologicalAbelianization H := + quotientContinuousEquiv _ _ f (closedCommutator_map_le f.toMonoidHom f.continuous) + (closedCommutator_map_le f.symm.toMonoidHom f.symm.continuous) + +def centralContinuousEquiv {G H : Type*} [Group G] [Group H] + [TopologicalSpace G] [TopologicalSpace H] [IsTopologicalGroup G] + [IsTopologicalGroup H] (f : G ≃ₜ* H) : + (G ⧸ closedGammaThree G) ≃ₜ* (H ⧸ closedGammaThree H) := + quotientContinuousEquiv _ _ f (closedGammaThree_map_le f.toMonoidHom f.continuous) + (closedGammaThree_map_le f.symm.toMonoidHom f.symm.continuous) + +end BogomolovPop + +noncomputable section +namespace BogomolovPop +open scoped Topology + +theorem isAlgClosure_perfectClosure (F : Type*) [Field F] : + IsAlgClosure (PerfectFieldClosure F) (AlgebraicClosure F) := by + have : Algebra.IsAlgebraic (PerfectFieldClosure F) (AlgebraicClosure F) := + Algebra.IsAlgebraic.tower_top (K := F) (PerfectFieldClosure F) + exact ⟨inferInstance, inferInstance⟩ + +def extendPerfectEquiv {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) : + AlgebraicClosure K ≃+* AlgebraicClosure L := by + letI := isAlgClosure_perfectClosure K + letI := isAlgClosure_perfectClosure L + exact IsAlgClosure.equivOfEquiv (AlgebraicClosure K) (AlgebraicClosure L) α + +theorem extendPerfectEquiv_spec {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) (x : PerfectFieldClosure K) : + extendPerfectEquiv α x = (α x : AlgebraicClosure L) := by + let := isAlgClosure_perfectClosure K + let := isAlgClosure_perfectClosure L + exact IsAlgClosure.equivOfEquiv_algebraMap (AlgebraicClosure K) (AlgebraicClosure L) α x + +theorem perfectClosure_fixed {F : Type*} [Field F] + (σ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) (x : PerfectFieldClosure F) : + σ (x : AlgebraicClosure F) = x := by + have h : σ.toAlgHom.comp (perfectClosure F (AlgebraicClosure F)).val = + (perfectClosure F (AlgebraicClosure F)).val := Subsingleton.elim _ _ + exact DFunLike.congr_fun h x + +def absoluteConjugate {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) + (β : AlgebraicClosure K ≃+* AlgebraicClosure L) + (hβ : ∀ x : PerfectFieldClosure K, β x = (α x : AlgebraicClosure L)) + (σ : AlgebraicClosure L ≃ₐ[L] AlgebraicClosure L) : + AlgebraicClosure K ≃ₐ[K] AlgebraicClosure K where + toRingEquiv := (β.trans σ.toRingEquiv).trans β.symm + commutes' x := by + change β.symm (σ (β (algebraMap K (AlgebraicClosure K) x))) = _ + apply β.injective + rw [β.apply_symm_apply] + change σ (β ((algebraMap K (PerfectFieldClosure K) x : PerfectFieldClosure K) : + AlgebraicClosure K)) = β _ + rw [hβ, perfectClosure_fixed] + exact (hβ _).symm + +@[simp] theorem absoluteConjugate_apply {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) + (β : AlgebraicClosure K ≃+* AlgebraicClosure L) + (hβ : ∀ x : PerfectFieldClosure K, β x = (α x : AlgebraicClosure L)) + (σ : AlgebraicClosure L ≃ₐ[L] AlgebraicClosure L) (x : AlgebraicClosure K) : + absoluteConjugate α β hβ σ x = β.symm (σ (β x)) := rfl + +theorem perfectExtension_symm {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) + (β : AlgebraicClosure K ≃+* AlgebraicClosure L) + (hβ : ∀ x : PerfectFieldClosure K, β x = (α x : AlgebraicClosure L)) : + ∀ y : PerfectFieldClosure L, β.symm y = (α.symm y : AlgebraicClosure K) := by + intro y + apply β.injective + rw [β.apply_symm_apply, hβ, α.apply_symm_apply] + +def absoluteConjugateEquiv {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) + (β : AlgebraicClosure K ≃+* AlgebraicClosure L) + (hβ : ∀ x : PerfectFieldClosure K, β x = (α x : AlgebraicClosure L)) : + (AlgebraicClosure L ≃ₐ[L] AlgebraicClosure L) ≃* + (AlgebraicClosure K ≃ₐ[K] AlgebraicClosure K) where + toFun := absoluteConjugate α β hβ + invFun := absoluteConjugate α.symm β.symm (perfectExtension_symm α β hβ) + left_inv σ := by ext x; simp + right_inv σ := by ext x; simp + map_mul' σ τ := by ext x; simp [AlgEquiv.mul_apply] + +theorem absoluteConjugate_continuous {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) + (β : AlgebraicClosure K ≃+* AlgebraicClosure L) + (hβ : ∀ x : PerfectFieldClosure K, β x = (α x : AlgebraicClosure L)) : + Continuous (absoluteConjugate α β hβ) := by + change Continuous (absoluteConjugateEquiv α β hβ).toMonoidHom + apply continuous_of_continuousAt_one _ (continuousAt_def.mpr _) + intro U hU + rw [map_one, krullTopology_mem_nhds_one_iff] at hU + obtain ⟨E, hE, heU⟩ := hU + let : FiniteDimensional K E := hE + obtain ⟨s, hs⟩ := (Algebra.FiniteType.out (R := K) (A := E)) + let S : Set (AlgebraicClosure L) := (fun x : E => β (x : AlgebraicClosure K)) '' (s : Set E) + have hS : S.Finite := s.finite_toSet.image _ + let : Finite S := hS.to_subtype + let E' := IntermediateField.adjoin L S + have : FiniteDimensional L E' := IntermediateField.finiteDimensional_adjoin + (fun x _ => (Algebra.IsAlgebraic.isAlgebraic (R := L) x).isIntegral) + apply (krullTopology_mem_nhds_one_iff L (AlgebraicClosure L) _).mpr + refine ⟨E', inferInstance, ?_⟩ + intro σ hσ + apply heU + change absoluteConjugate α β hβ σ ∈ E.fixingSubgroup + rw [IntermediateField.mem_fixingSubgroup_iff] + have heq : (absoluteConjugate α β hβ σ).toAlgHom.comp E.val = E.val := by + apply AlgHom.ext_of_adjoin_eq_top hs + intro x hx + change β.symm (σ (β (x : AlgebraicClosure K))) = x + rw [((IntermediateField.mem_fixingSubgroup_iff E' σ).mp hσ) _ + (IntermediateField.subset_adjoin L S ⟨x, hx, rfl⟩), β.symm_apply_apply] + intro x hx + exact DFunLike.congr_fun heq ⟨x, hx⟩ + +def absoluteConjugateContinuousEquiv {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) + (β : AlgebraicClosure K ≃+* AlgebraicClosure L) + (hβ : ∀ x : PerfectFieldClosure K, β x = (α x : AlgebraicClosure L)) : + Field.absoluteGaloisGroup L ≃ₜ* Field.absoluteGaloisGroup K where + toMulEquiv := absoluteConjugateEquiv α β hβ + continuous_toFun := absoluteConjugate_continuous α β hβ + continuous_invFun := absoluteConjugate_continuous α.symm β.symm + (perfectExtension_symm α β hβ) + +end BogomolovPop + +namespace BogomolovPop +open scoped Topology + +theorem centralProjection_natural {ell : ℕ} {K L : Type*} [Field K] [Field L] + (f : ProEll ell L ≃ₜ* ProEll ell K) (z : PiC ell L) : + centralProjection ell K (centralContinuousEquiv f z) = + abelianContinuousEquiv f (centralProjection ell L z) := by + induction z using QuotientGroup.induction_on with | H z => rfl + +def deltaContinuousEquiv {ell : ℕ} {K L : Type*} [Field K] [Field L] + (f : ProEll ell L ≃ₜ* ProEll ell K) : Delta ell L ≃ₜ* Delta ell K where + toFun x := ⟨centralContinuousEquiv f x, by + change centralProjection ell K _ = 1 + rw [centralProjection_natural, x.property, map_one]⟩ + invFun x := ⟨(centralContinuousEquiv f).symm x, by + change centralProjection ell L _ = 1 + apply (abelianContinuousEquiv f).injective + rw [map_one, ← centralProjection_natural, ContinuousMulEquiv.apply_symm_apply] + exact x.property⟩ + left_inv x := by ext; exact (centralContinuousEquiv f).symm_apply_apply x + right_inv x := by ext; exact (centralContinuousEquiv f).apply_symm_apply x + map_mul' x y := by ext; exact map_mul (centralContinuousEquiv f) (x : PiC ell L) (y : PiC ell L) + continuous_toFun := Continuous.subtype_mk + ((centralContinuousEquiv f).continuous.comp continuous_subtype_val) _ + continuous_invFun := Continuous.subtype_mk + ((centralContinuousEquiv f).symm.continuous.comp continuous_subtype_val) _ + +theorem induced_bracketCompatible {ell : ℕ} {K L : Type*} [Field K] [Field L] + (f : ProEll ell L ≃ₜ* ProEll ell K) : + BracketCompatible (abelianContinuousEquiv f) := by + refine ⟨deltaContinuousEquiv f, ?_⟩ + intro σ τ + apply Subtype.ext + change centralContinuousEquiv f (bracket ell L σ τ : PiC ell L) = _ + rw [bracket_eq_of_lifts ell K _ _ (f (abelianLift ell L σ)) + (f (abelianLift ell L τ))] + · change QuotientGroup.mk' _ (f (sourceCommutator (abelianLift ell L σ) + (abelianLift ell L τ))) = _ + simp only [sourceCommutator, map_mul, map_inv] + · change abelianContinuousEquiv f (QuotientGroup.mk' _ (abelianLift ell L σ)) = _ + rw [abelianLift_spec] + · change abelianContinuousEquiv f (QuotientGroup.mk' _ (abelianLift ell L τ)) = _ + rw [abelianLift_spec] + +def isomCOfExtension (ell : ℕ) {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) + (β : AlgebraicClosure K ≃+* AlgebraicClosure L) + (hβ : ∀ x : PerfectFieldClosure K, β x = (α x : AlgebraicClosure L)) : + IsomC ell K L := + ⟨abelianContinuousEquiv (proEllContinuousEquiv ell + (absoluteConjugateContinuousEquiv α β hβ)), induced_bracketCompatible _⟩ + +theorem pullbackGraph_of_extension (ell : ℕ) {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + (α : PerfectIsom k K l L) (β : AlgebraicClosure K ≃+* AlgebraicClosure L) + (hβ : ∀ x : PerfectFieldClosure K, β x = (α.1 x : AlgebraicClosure L)) : + PullbackGraph α (isomCOfExtension ell α.1 β hβ) := by + refine ⟨β, hβ, ?_⟩ + intro σ + refine ⟨absoluteConjugate α.1 β hβ σ, ?_, rfl⟩ + intro x + exact β.apply_symm_apply _ + +theorem exists_pullbackGraph (ell : ℕ) {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + (α : PerfectIsom k K l L) : ∃ φ : IsomC ell K L, PullbackGraph α φ := by + exact ⟨isomCOfExtension ell α.1 (extendPerfectEquiv α.1) (extendPerfectEquiv_spec α.1), + pullbackGraph_of_extension ell α _ (extendPerfectEquiv_spec α.1)⟩ + +end BogomolovPop + +namespace BogomolovPop + + theorem absoluteToPiA_surjective (ell : ℕ) (F : Type*) [Field F] : + Function.Surjective (absoluteToPiA ell F) := + (QuotientGroup.mk'_surjective _).comp (QuotientGroup.mk'_surjective _) + +def extensionDifference {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) + (β γ : AlgebraicClosure K ≃+* AlgebraicClosure L) + (hβ : ∀ x : PerfectFieldClosure K, β x = (α x : AlgebraicClosure L)) + (hγ : ∀ x : PerfectFieldClosure K, γ x = (α x : AlgebraicClosure L)) : + AlgebraicClosure K ≃ₐ[K] AlgebraicClosure K where + toRingEquiv := β.trans γ.symm + commutes' x := by + change γ.symm (β (algebraMap K (AlgebraicClosure K) x)) = _ + apply γ.injective + rw [γ.apply_symm_apply] + exact (hβ (algebraMap K (PerfectFieldClosure K) x)).trans + (hγ (algebraMap K (PerfectFieldClosure K) x)).symm + +theorem absoluteConjugate_extensionDifference {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) + (β γ : AlgebraicClosure K ≃+* AlgebraicClosure L) + (hβ : ∀ x : PerfectFieldClosure K, β x = (α x : AlgebraicClosure L)) + (hγ : ∀ x : PerfectFieldClosure K, γ x = (α x : AlgebraicClosure L)) + (σ : AlgebraicClosure L ≃ₐ[L] AlgebraicClosure L) : + absoluteConjugate α γ hγ σ = extensionDifference α β γ hβ hγ * + absoluteConjugate α β hβ σ * (extensionDifference α β γ hβ hγ)⁻¹ := by + ext x + simp [AlgEquiv.mul_apply, extensionDifference, absoluteConjugate] + change γ x = β (β.symm (γ x)) + exact (β.apply_symm_apply _).symm + +theorem isomCOfExtension_eq (ell : ℕ) {K L : Type*} [Field K] [Field L] + (α : PerfectFieldClosure K ≃+* PerfectFieldClosure L) + (β γ : AlgebraicClosure K ≃+* AlgebraicClosure L) + (hβ : ∀ x : PerfectFieldClosure K, β x = (α x : AlgebraicClosure L)) + (hγ : ∀ x : PerfectFieldClosure K, γ x = (α x : AlgebraicClosure L)) : + isomCOfExtension ell α β hβ = isomCOfExtension ell α γ hγ := by + apply Subtype.ext + ext x + obtain ⟨σ, rfl⟩ := absoluteToPiA_surjective ell L x + change absoluteToPiA ell K (absoluteConjugate α β hβ σ) = + absoluteToPiA ell K (absoluteConjugate α γ hγ σ) + rw [absoluteConjugate_extensionDifference α β γ hβ hγ σ] + let f : (AlgebraicClosure K ≃ₐ[K] AlgebraicClosure K) →* PiA ell K := absoluteToPiA ell K + change f _ = f _ + simp [map_mul, map_inv, mul_comm, mul_left_comm, mul_assoc] + +theorem pullbackGraph_eq_extension (ell : ℕ) {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + (α : PerfectIsom k K l L) (φ : IsomC ell K L) (hφ : PullbackGraph α φ) : + φ = isomCOfExtension ell α.1 (extendPerfectEquiv α.1) (extendPerfectEquiv_spec α.1) := by + obtain ⟨β, hβ, h⟩ := hφ + have heq : φ = isomCOfExtension ell α.1 β hβ := by + apply Subtype.ext + ext x + obtain ⟨σ, rfl⟩ := absoluteToPiA_surjective ell L x + obtain ⟨τ, hτ, hφτ⟩ := h σ + have hτ' : τ = absoluteConjugate α.1 β hβ σ := by + apply AlgEquiv.ext + intro x + apply β.injective + exact (hτ x).trans (β.apply_symm_apply _).symm + change φ.1 (absoluteToPiA ell L σ) = + absoluteToPiA ell K (absoluteConjugate α.1 β hβ σ) + exact hφτ.trans (congrArg (absoluteToPiA ell K) hτ') + exact heq.trans (isomCOfExtension_eq ell α.1 β (extendPerfectEquiv α.1) hβ + (extendPerfectEquiv_spec α.1)) + +theorem existsUnique_pullbackGraph (ell : ℕ) {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + (α : PerfectIsom k K l L) : ∃! φ : IsomC ell K L, PullbackGraph α φ := by + obtain ⟨φ, hφ⟩ := exists_pullbackGraph ell α + refine ⟨φ, hφ, fun χ hχ => ?_⟩ + exact (pullbackGraph_eq_extension ell α χ hχ).trans + (pullbackGraph_eq_extension ell α φ hφ).symm + +end BogomolovPop + +namespace BogomolovPop + +def canonicalPullback (ell : ℕ) {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + (α : PerfectIsom k K l L) : IsomC ell K L := + isomCOfExtension ell α.1 (extendPerfectEquiv α.1) (extendPerfectEquiv_spec α.1) + +theorem canonicalPullback_spec (ell : ℕ) {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + (α : PerfectIsom k K l L) : PullbackGraph α (canonicalPullback ell α) := + pullbackGraph_of_extension ell α _ (extendPerfectEquiv_spec α.1) + +theorem canonicalPullback_frobenius (ell : ℕ) {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + {α χ : PerfectIsom k K l L} (h : FrobeniusStep α χ) : + canonicalPullback ell α = canonicalPullback ell χ := by + obtain ⟨p, hp, hpL, hχ⟩ := h + let : Fact p.Prime := ⟨hp⟩ + let : CharP L p := (CharP.charP_iff_prime_eq_zero hp).mpr hpL + let β := extendPerfectEquiv α.1 + have hβ := extendPerfectEquiv_spec α.1 + let γ := β.trans (frobeniusEquiv (AlgebraicClosure L) p) + have hγ : ∀ x : PerfectFieldClosure K, γ x = (χ.1 x : AlgebraicClosure L) := by + intro x + change (β x) ^ p = (χ.1 x : AlgebraicClosure L) + rw [hβ, hχ x] + rfl + have heq : isomCOfExtension ell α.1 β hβ = isomCOfExtension ell χ.1 γ hγ := by + apply Subtype.ext + ext x + obtain ⟨σ, rfl⟩ := absoluteToPiA_surjective ell L x + change absoluteToPiA ell K (absoluteConjugate α.1 β hβ σ) = + absoluteToPiA ell K (absoluteConjugate χ.1 γ hγ σ) + congr 1 + apply AlgEquiv.ext + intro x + apply γ.injective + let σ' : AlgebraicClosure L ≃ₐ[L] AlgebraicClosure L := σ + change γ (β.symm (σ' (β x))) = γ (γ.symm (σ' (γ x))) + rw [γ.apply_symm_apply] + change (β (β.symm (σ' (β x)))) ^ p = σ' ((β x) ^ p) + rw [β.apply_symm_apply, map_pow] + exact heq.trans (isomCOfExtension_eq ell χ.1 γ (extendPerfectEquiv χ.1) hγ + (extendPerfectEquiv_spec χ.1)) + +theorem canonicalPullback_eq_of_frobeniusOrbit (ell : ℕ) {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + {α χ : PerfectIsom k K l L} + (h : Relation.EqvGen (FrobeniusStep (k := k) (K := K) (l := l) (L := L)) α χ) : + canonicalPullback ell α = canonicalPullback ell χ := by + induction h with + | rel a b hab => exact canonicalPullback_frobenius ell hab + | refl a => rfl + | symm a b _ ih => exact ih.symm + | trans a b c _ _ ih₁ ih₂ => exact ih₁.trans ih₂ + +def canonicalPhi (ell : ℕ) [Fact ell.Prime] {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] : + IsomF k K l L → IsomCUnits ell K L := + Quotient.lift (fun α => Quotient.mk _ (canonicalPullback ell α)) (by + intro α χ h + rw [canonicalPullback_eq_of_frobeniusOrbit ell h]) + +theorem canonicalPhi_graph (ell : ℕ) [Fact ell.Prime] {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + (a : IsomF k K l L) : PhiGraph a (canonicalPhi ell a) := by + induction a using Quotient.inductionOn with | h α => + exact ⟨α, canonicalPullback ell α, rfl, rfl, canonicalPullback_spec ell α⟩ + +theorem phiGraph_eq_canonicalPhi (ell : ℕ) [Fact ell.Prime] {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + {a : IsomF k K l L} {b : IsomCUnits ell K L} (h : PhiGraph a b) : + b = canonicalPhi ell a := by + obtain ⟨α, φ, rfl, rfl, hφ⟩ := h + change Quotient.mk _ φ = Quotient.mk _ (canonicalPullback ell α) + rw [pullbackGraph_eq_extension ell α φ hφ] + rfl + +theorem main_wellDefined (ell : ℕ) [Fact ell.Prime] {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] : + ∀ a : IsomF k K l L, ∃! b : IsomCUnits ell K L, PhiGraph a b := by + intro a + exact ⟨canonicalPhi ell a, canonicalPhi_graph ell a, + fun b hb => phiGraph_eq_canonicalPhi ell hb⟩ + +end BogomolovPop + +namespace BogomolovPop + +theorem main_canonical_wellDefined (ell : ℕ) [Fact ell.Prime] + (k K l L : Type*) [Field k] [Field K] [Field l] [Field L] + [IsAlgClosed k] [IsAlgClosed l] [Algebra k K] [Algebra l L] + [Algebra.EssFiniteType k K] [Algebra.EssFiniteType l L] + (_hk : (ell : k) ≠ 0) (_hl : (ell : l) ≠ 0) + (_hK : 2 ≤ Algebra.trdeg k K) (_hL : 2 ≤ Algebra.trdeg l L) : + ∀ a : IsomF k K l L, ∃! b : IsomCUnits ell K L, PhiGraph a b := by + exact main_wellDefined ell + +end BogomolovPop + +end +end + +end OAI diff --git a/lean/OAI/Algebra/BogomolovPop/Foundations.lean b/lean/OAI/Algebra/BogomolovPop/Foundations.lean new file mode 100644 index 0000000000000000000000000000000000000000..7b437fbbdf25ba5c2836ef135c27a53f7b2be376 --- /dev/null +++ b/lean/OAI/Algebra/BogomolovPop/Foundations.lean @@ -0,0 +1,564 @@ +import Mathlib + +namespace OAI + +/-! Literal Galois objects, quotient topology and continuous ell-adic actions. -/ + +noncomputable section +open scoped Topology + +noncomputable section +namespace BogomolovPop + +def proEllKernel (ell : ℕ) (G : Type*) [Group G] [TopologicalSpace G] : Subgroup G := + ⨅ (H : OpenNormalSubgroup G) (_ : IsPGroup ell (G ⧸ H.toSubgroup)), H.toSubgroup + +instance proEllKernel_normal (ell : ℕ) (G : Type*) [Group G] [TopologicalSpace G] : + (proEllKernel ell G).Normal := by + unfold proEllKernel + exact Subgroup.normal_iInf_normal fun H => + Subgroup.normal_iInf_normal fun _ => H.isNormal' + +abbrev ProEll (ell : ℕ) (F : Type*) [Field F] := + Field.absoluteGaloisGroup F ⧸ proEllKernel ell (Field.absoluteGaloisGroup F) + +def closedGammaThree (G : Type*) [Group G] [TopologicalSpace G] [IsTopologicalGroup G] : + Subgroup G := + (⁅(commutator G).topologicalClosure, (⊤ : Subgroup G)⁆).topologicalClosure + +instance closedGammaThree_normal (G : Type*) [Group G] [TopologicalSpace G] + [IsTopologicalGroup G] : (closedGammaThree G).Normal := by + unfold closedGammaThree + exact Subgroup.is_normal_topologicalClosure _ + +abbrev PiA (ell : ℕ) (F : Type*) [Field F] := TopologicalAbelianization (ProEll ell F) + +abbrev PiC (ell : ℕ) (F : Type*) [Field F] := ProEll ell F ⧸ closedGammaThree (ProEll ell F) + +theorem closedGammaThree_le (G : Type*) [Group G] [TopologicalSpace G] + [IsTopologicalGroup G] : closedGammaThree G ≤ (commutator G).topologicalClosure := by + exact Subgroup.topologicalClosure_minimal _ (Subgroup.commutator_le_left _ _) + (Subgroup.isClosed_topologicalClosure _) + +def centralProjection (ell : ℕ) (F : Type*) [Field F] : PiC ell F →* PiA ell F := + QuotientGroup.map _ _ (MonoidHom.id _) (closedGammaThree_le _) + +abbrev Delta (ell : ℕ) (F : Type*) [Field F] := (centralProjection ell F).ker + +def sourceCommutator {G : Type*} [Group G] (x y : G) : G := x⁻¹ * y⁻¹ * x * y + +def abelianLift (ell : ℕ) (F : Type*) [Field F] (x : PiA ell F) : ProEll ell F := + Quotient.out x + +theorem abelianLift_spec (ell : ℕ) (F : Type*) [Field F] (x : PiA ell F) : + QuotientGroup.mk' _ (abelianLift ell F x) = x := Quotient.out_eq x + +def bracket (ell : ℕ) (F : Type*) [Field F] (x y : PiA ell F) : Delta ell F := + ⟨QuotientGroup.mk' _ (sourceCommutator (abelianLift ell F x) (abelianLift ell F y)), by + change centralProjection ell F _ = 1 + simp only [centralProjection, sourceCommutator, map_mul, map_inv] + simp [mul_comm]⟩ + +def BracketCompatible {ell : ℕ} {K L : Type*} [Field K] [Field L] + (φ : PiA ell L ≃ₜ* PiA ell K) : Prop := + ∃ ψ : Delta ell L ≃ₜ* Delta ell K, + ∀ σ τ, ψ (bracket ell L σ τ) = bracket ell K (φ σ) (φ τ) + +abbrev PerfectFieldClosure (F : Type*) [Field F] := perfectClosure F (AlgebraicClosure F) + +def PerfectIsom (k K l L : Type*) [Field k] [Field K] [Field l] [Field L] + [Algebra k K] [Algebra l L] := + { α : PerfectFieldClosure K ≃+* PerfectFieldClosure L // + α '' Set.range (algebraMap k (PerfectFieldClosure K)) = + Set.range (algebraMap l (PerfectFieldClosure L)) } + +def FrobeniusStep {k K l L : Type*} [Field k] [Field K] [Field l] [Field L] + [Algebra k K] [Algebra l L] (α β : PerfectIsom k K l L) : Prop := + ∃ p : ℕ, p.Prime ∧ (p : L) = 0 ∧ + ∀ x : PerfectFieldClosure K, β.1 x = (α.1 x) ^ p + +abbrev IsomF (k K l L : Type*) [Field k] [Field K] [Field l] [Field L] + [Algebra k K] [Algebra l L] := + Quotient (Relation.EqvGen.setoid (FrobeniusStep (k := k) (K := K) (l := l) (L := L))) + +abbrev IsomC (ell : ℕ) (K L : Type*) [Field K] [Field L] := + {φ : PiA ell L ≃ₜ* PiA ell K // BracketCompatible φ} + +def ScalarStep {ell : ℕ} [Fact ell.Prime] {K L : Type*} [Field K] [Field L] + (φ χ : IsomC ell K L) : Prop := + ∃ u : (PadicInt ell)ˣ, ∀ x : PiA ell L, + Filter.Tendsto (fun n : ℕ => (φ.1 x) ^ PadicInt.appr (u : PadicInt ell) n) + Filter.atTop (nhds (χ.1 x)) + +abbrev IsomCUnits (ell : ℕ) [Fact ell.Prime] (K L : Type*) [Field K] [Field L] := + Quotient (Relation.EqvGen.setoid (ScalarStep (ell := ell) (K := K) (L := L))) + +def absoluteToPiA (ell : ℕ) (F : Type*) [Field F] : + Field.absoluteGaloisGroup F →* PiA ell F := + (QuotientGroup.mk' _).comp (QuotientGroup.mk' _) + +def absoluteAction {F : Type*} [Field F] (σ : Field.absoluteGaloisGroup F) + (x : AlgebraicClosure F) : AlgebraicClosure F := by + change AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F at σ + exact σ x + +def PullbackGraph {ell : ℕ} {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + (α : PerfectIsom k K l L) (φ : IsomC ell K L) : Prop := + ∃ β : AlgebraicClosure K ≃+* AlgebraicClosure L, + (∀ x : PerfectFieldClosure K, β x = ((α.1 x : PerfectFieldClosure L) : + AlgebraicClosure L)) ∧ + ∀ σ : Field.absoluteGaloisGroup L, ∃ τ : Field.absoluteGaloisGroup K, + (∀ x : AlgebraicClosure K, + β (absoluteAction τ x) = absoluteAction σ (β x)) ∧ + φ.1 (absoluteToPiA ell L σ) = absoluteToPiA ell K τ + +def PhiGraph {ell : ℕ} [Fact ell.Prime] {k K l L : Type*} + [Field k] [Field K] [Field l] [Field L] [Algebra k K] [Algebra l L] + (a : IsomF k K l L) (b : IsomCUnits ell K L) : Prop := + ∃ α : PerfectIsom k K l L, ∃ φ : IsomC ell K L, + Quotient.mk _ α = a ∧ Quotient.mk _ φ = b ∧ PullbackGraph α φ + +def MainStatement (ell : ℕ) [Fact ell.Prime] (k K l L : Type*) + [Field k] [Field K] [Field l] [Field L] + [IsAlgClosed k] [IsAlgClosed l] [Algebra k K] [Algebra l L] + [Algebra.EssFiniteType k K] [Algebra.EssFiniteType l L] : Prop := + (ell : k) ≠ 0 → (ell : l) ≠ 0 → + 2 ≤ Algebra.trdeg k K → 2 ≤ Algebra.trdeg l L → + (∀ a : IsomF k K l L, ∃! b : IsomCUnits ell K L, PhiGraph a b) ∧ + (∀ b : IsomCUnits ell K L, ∃! a : IsomF k K l L, PhiGraph a b) + +end BogomolovPop + +namespace BogomolovPop +open scoped commutatorElement + +theorem closedCommutator_image_commute {G : Type*} [Group G] + [TopologicalSpace G] [IsTopologicalGroup G] {z : G} + (hz : z ∈ (commutator G).topologicalClosure) (g : G) : + Commute (QuotientGroup.mk' (closedGammaThree G) z) + (QuotientGroup.mk' (closedGammaThree G) g) := by + apply commutatorElement_eq_one_iff_commute.mp + rw [← map_commutatorElement] + apply (QuotientGroup.eq_one_iff _).mpr + exact Subgroup.le_topologicalClosure _ + (Subgroup.commutator_mem_commutator hz (Subgroup.mem_top g)) + +theorem quotient_commutator_independent {G : Type*} [Group G] + [TopologicalSpace G] [IsTopologicalGroup G] {a a' b b' : G} + (ha : QuotientGroup.mk' (commutator G).topologicalClosure a = + QuotientGroup.mk' (commutator G).topologicalClosure a') + (hb : QuotientGroup.mk' (commutator G).topologicalClosure b = + QuotientGroup.mk' (commutator G).topologicalClosure b') : + QuotientGroup.mk' (closedGammaThree G) ⁅a, b⁆ = + QuotientGroup.mk' (closedGammaThree G) ⁅a', b'⁆ := by + let q := QuotientGroup.mk' (closedGammaThree G) + have haz : a⁻¹ * a' ∈ (commutator G).topologicalClosure := + QuotientGroup.leftRel_apply.mp (Quotient.exact ha) + have hbz : b⁻¹ * b' ∈ (commutator G).topologicalClosure := + QuotientGroup.leftRel_apply.mp (Quotient.exact hb) + have hea : q a' = q a * q (a⁻¹ * a') := by rw [← map_mul]; simp + have heb : q b' = q b * q (b⁻¹ * b') := by rw [← map_mul]; simp + change q ⁅a, b⁆ = q ⁅a', b'⁆ + rw [map_commutatorElement, map_commutatorElement, hea, heb] + have hza : Commute (q (a⁻¹ * a')) (q b * q (b⁻¹ * b')) := by + rw [← map_mul] + exact closedCommutator_image_commute haz _ + rw [commutatorElement_mul_left_eq_conj_mul, hza.commutator_eq] + simp only [mul_one, mul_inv_cancel, one_mul] + rw [commutatorElement_mul_right_eq_mul_conj, + (closedCommutator_image_commute hbz a).symm.commutator_eq] + simp [mul_assoc] + +end BogomolovPop + +namespace BogomolovPop +open scoped commutatorElement + +theorem sourceCommutator_independent {G : Type*} [Group G] + [TopologicalSpace G] [IsTopologicalGroup G] {a a' b b' : G} + (ha : QuotientGroup.mk' (commutator G).topologicalClosure a = + QuotientGroup.mk' (commutator G).topologicalClosure a') + (hb : QuotientGroup.mk' (commutator G).topologicalClosure b = + QuotientGroup.mk' (commutator G).topologicalClosure b') : + QuotientGroup.mk' (closedGammaThree G) (sourceCommutator a b) = + QuotientGroup.mk' (closedGammaThree G) (sourceCommutator a' b') := by + have ha' : QuotientGroup.mk' (commutator G).topologicalClosure a⁻¹ = + QuotientGroup.mk' (commutator G).topologicalClosure a'⁻¹ := by + simpa only [map_inv] using congrArg Inv.inv ha + have hb' : QuotientGroup.mk' (commutator G).topologicalClosure b⁻¹ = + QuotientGroup.mk' (commutator G).topologicalClosure b'⁻¹ := by + simpa only [map_inv] using congrArg Inv.inv hb + simpa only [commutatorElement_def, inv_inv, sourceCommutator] using + quotient_commutator_independent ha' hb' + +theorem bracket_eq_of_lifts (ell : ℕ) (F : Type*) [Field F] + (x y : PiA ell F) (a b : ProEll ell F) + (ha : QuotientGroup.mk' _ a = x) (hb : QuotientGroup.mk' _ b = y) : + (bracket ell F x y : PiC ell F) = + QuotientGroup.mk' _ (sourceCommutator a b) := by + exact sourceCommutator_independent ((abelianLift_spec ell F x).trans ha.symm) + ((abelianLift_spec ell F y).trans hb.symm) + +theorem quotient_nonarchimedean {G : Type*} [Group G] [TopologicalSpace G] + [IsTopologicalGroup G] [CompactSpace G] [TotallyDisconnectedSpace G] + (N : Subgroup G) [N.Normal] : NonarchimedeanGroup (G ⧸ N) where + is_nonarchimedean U hU := by + let q := QuotientGroup.mk' N + have hpre : q ⁻¹' U ∈ nhds (1 : G) := by + apply (QuotientGroup.continuous_mk.continuousAt : + ContinuousAt (fun x : G => (QuotientGroup.mk x : G ⧸ N)) 1).preimage_mem_nhds + simpa using hU + obtain ⟨V, hV, hVo, h1V⟩ := mem_nhds_iff.mp hpre + obtain ⟨H, hH⟩ := ProfiniteGrp.exist_openNormalSubgroup_sub_open_nhds_of_one hVo h1V + refine ⟨{ H.toSubgroup.map q with + isOpen' := QuotientGroup.isOpenMap_coe _ H.isOpen }, ?_⟩ + rintro _ ⟨g, hg, rfl⟩ + exact hV (hH hg) + +theorem proEllKernel_isClosed (ell : ℕ) (G : Type*) [Group G] + [TopologicalSpace G] [IsTopologicalGroup G] : IsClosed (proEllKernel ell G : Set G) := by + simp only [proEllKernel, Subgroup.coe_iInf] + exact isClosed_iInter fun H => isClosed_iInter fun _ => H.toOpenSubgroup.isClosed + +theorem restrictScalarsHom_continuous {F P A : Type*} [Field F] [Field P] [Field A] + [Algebra F P] [Algebra P A] [Algebra F A] [IsScalarTower F P A] + [Algebra.IsAlgebraic P A] : + Continuous (AlgEquiv.restrictScalarsHom F : (A ≃ₐ[P] A) →* (A ≃ₐ[F] A)) := by + apply continuous_of_continuousAt_one _ (continuousAt_def.mpr _) + intro U hU + rw [map_one, krullTopology_mem_nhds_one_iff] at hU + obtain ⟨E, hE, heU⟩ := hU + let : FiniteDimensional F E := hE + obtain ⟨s, hs⟩ := (Algebra.FiniteType.out (R := F) (A := E)) + let S : Set A := (algebraMap E A) '' (s : Set E) + have hS : S.Finite := s.finite_toSet.image _ + let : Finite S := hS.to_subtype + let E' := IntermediateField.adjoin P S + have : FiniteDimensional P E' := IntermediateField.finiteDimensional_adjoin + (fun x _ => (Algebra.IsAlgebraic.isAlgebraic (R := P) x).isIntegral) + apply (krullTopology_mem_nhds_one_iff P A _).mpr + refine ⟨E', inferInstance, ?_⟩ + intro σ hσ + apply heU + change (σ.restrictScalars F) ∈ E.fixingSubgroup + rw [IntermediateField.mem_fixingSubgroup_iff] + have heq : ((σ.restrictScalars F).toAlgHom.comp E.val) = E.val := by + apply AlgHom.ext_of_adjoin_eq_top hs + intro x hx + exact ((IntermediateField.mem_fixingSubgroup_iff E' σ).mp hσ) _ + (IntermediateField.subset_adjoin P S ⟨x, hx, rfl⟩) + intro x hx + exact DFunLike.congr_fun heq ⟨x, hx⟩ + +theorem restrictScalarsHom_surjective_of_purelyInseparable {F P A : Type*} + [Field F] [Field P] [Field A] [Algebra F P] [Algebra P A] [Algebra F A] + [IsScalarTower F P A] [IsPurelyInseparable F P] : + Function.Surjective (AlgEquiv.restrictScalarsHom F : (A ≃ₐ[P] A) →* (A ≃ₐ[F] A)) := by + intro σ + have hfix : σ.toAlgHom.comp (IsScalarTower.toAlgHom F P A) = + IsScalarTower.toAlgHom F P A := Subsingleton.elim _ _ + refine ⟨{ σ.toRingEquiv with commutes' := fun p => DFunLike.congr_fun hfix p }, ?_⟩ + ext x + rfl + +theorem absoluteGaloisGroup_compact (F : Type*) [Field F] : + CompactSpace (Field.absoluteGaloisGroup F) := by + let P := perfectClosure F (AlgebraicClosure F) + have : Algebra.IsAlgebraic P (AlgebraicClosure F) := + Algebra.IsAlgebraic.tower_top (K := F) P + have : Normal P (AlgebraicClosure F) := ⟨fun x => IsAlgClosed.splits _⟩ + have : IsGalois P (AlgebraicClosure F) := isGalois_iff.mpr ⟨inferInstance, inferInstance⟩ + change CompactSpace (AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) + exact Function.Surjective.compactSpace + (restrictScalarsHom_continuous (F := F) (P := P) (A := AlgebraicClosure F)) + (restrictScalarsHom_surjective_of_purelyInseparable (F := F) (P := P) + (A := AlgebraicClosure F)) + +theorem absoluteGaloisGroup_nonarchimedean (F : Type*) [Field F] : + NonarchimedeanGroup (Field.absoluteGaloisGroup F) where + is_nonarchimedean U hU := by + change U ∈ nhds (1 : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) at hU + obtain ⟨E, hE, hEU⟩ := (krullTopology_mem_nhds_one_iff F (AlgebraicClosure F) U).mp hU + let := hE + exact ⟨{ E.fixingSubgroup with isOpen' := E.fixingSubgroup_isOpen }, hEU⟩ + +instance (F : Type*) [Field F] : CompactSpace (Field.absoluteGaloisGroup F) := + absoluteGaloisGroup_compact F + +instance (F : Type*) [Field F] : NonarchimedeanGroup (Field.absoluteGaloisGroup F) := + absoluteGaloisGroup_nonarchimedean F + +instance (F : Type*) [Field F] : T2Space (Field.absoluteGaloisGroup F) := by + change T2Space (AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) + infer_instance + +instance ProEll.t2Space (ell : ℕ) (F : Type*) [Field F] : T2Space (ProEll ell F) := by + have := proEllKernel_isClosed ell (Field.absoluteGaloisGroup F) + infer_instance + +instance ProEll.totallyDisconnectedSpace (ell : ℕ) (F : Type*) [Field F] : + TotallyDisconnectedSpace (ProEll ell F) := by + have := quotient_nonarchimedean (proEllKernel ell (Field.absoluteGaloisGroup F)) + infer_instance + +instance PiA.t2Space (ell : ℕ) (F : Type*) [Field F] : T2Space (PiA ell F) := by + have := Subgroup.isClosed_topologicalClosure (commutator (ProEll ell F)) + infer_instance + +instance PiA.totallyDisconnectedSpace (ell : ℕ) (F : Type*) [Field F] : + TotallyDisconnectedSpace (PiA ell F) := by + have := quotient_nonarchimedean (commutator (ProEll ell F)).topologicalClosure + infer_instance + +instance PiC.t2Space (ell : ℕ) (F : Type*) [Field F] : T2Space (PiC ell F) := by + have : IsClosed (closedGammaThree (ProEll ell F) : Set (ProEll ell F)) := + Subgroup.isClosed_topologicalClosure _ + infer_instance + +instance PiC.totallyDisconnectedSpace (ell : ℕ) (F : Type*) [Field F] : + TotallyDisconnectedSpace (PiC ell F) := by + have := quotient_nonarchimedean (closedGammaThree (ProEll ell F)) + infer_instance + +open Filter + +def EllQuotients (ell : ℕ) (G : Type*) [Group G] [TopologicalSpace G] := + {H : OpenNormalSubgroup G // IsPGroup ell (G ⧸ H.toSubgroup)} + +instance ellQuotient_normal {ell : ℕ} {G : Type*} [Group G] [TopologicalSpace G] + (H : EllQuotients ell G) : H.1.toSubgroup.Normal := H.1.isNormal' + +theorem proEllKernel_le {ell : ℕ} {G : Type*} [Group G] [TopologicalSpace G] + (H : EllQuotients ell G) : proEllKernel ell G ≤ H.1.toSubgroup := by + exact iInf_le_of_le H.1 (iInf_le _ H.2) + +def proEllEval {ell : ℕ} {G : Type*} [Group G] [TopologicalSpace G] : + (G ⧸ proEllKernel ell G) →* (∀ H : EllQuotients ell G, G ⧸ H.1.toSubgroup) := + MonoidHom.pi fun H => QuotientGroup.map _ _ (MonoidHom.id G) (proEllKernel_le H) + +theorem proEllEval_injective {ell : ℕ} {G : Type*} [Group G] [TopologicalSpace G] : + Function.Injective (proEllEval (ell := ell) (G := G)) := by + apply (MonoidHom.ker_eq_bot_iff _).mp + apply le_antisymm _ bot_le + intro z hz + rw [Subgroup.mem_bot] + induction z using QuotientGroup.induction_on with | H x => + apply (QuotientGroup.eq_one_iff x).mpr + simp only [proEllKernel, Subgroup.mem_iInf] + intro H hH + exact (QuotientGroup.eq_one_iff x).mp (congrFun hz ⟨H, hH⟩) + +theorem proEllEval_continuous {ell : ℕ} {G : Type*} [Group G] + [TopologicalSpace G] : Continuous (proEllEval (ell := ell) (G := G)) := by + apply continuous_pi + intro H + apply (QuotientGroup.isQuotientMap_mk (proEllKernel ell G)).continuous_iff.mpr + exact QuotientGroup.continuous_mk + +theorem proEllEval_isClosedEmbedding {ell : ℕ} {G : Type*} [Group G] + [TopologicalSpace G] [IsTopologicalGroup G] [CompactSpace G] : + Topology.IsClosedEmbedding (proEllEval (ell := ell) (G := G)) := by + have (H : EllQuotients ell G) : DiscreteTopology (G ⧸ H.1.toSubgroup) := + QuotientGroup.discreteTopology H.1.isOpen + exact proEllEval_continuous.isClosedEmbedding proEllEval_injective + +theorem proEll_pow_tendsto_one {ell : ℕ} {G : Type*} [Group G] + [TopologicalSpace G] [IsTopologicalGroup G] [CompactSpace G] + (x : G ⧸ proEllKernel ell G) : + Tendsto (fun n : ℕ => x ^ ell ^ n) atTop (nhds 1) := by + apply proEllEval_isClosedEmbedding.tendsto_nhds_iff.mpr + apply tendsto_pi_nhds.mpr + intro H + obtain ⟨k, hk⟩ := H.2 (proEllEval x H) + apply tendsto_const_nhds.congr' + filter_upwards [eventually_ge_atTop k] with n hn + change (1 : G ⧸ H.1.toSubgroup) = proEllEval (x ^ ell ^ n) H + rw [map_pow] + change 1 = (proEllEval x H) ^ ell ^ n + obtain ⟨r, rfl⟩ := Nat.exists_eq_add_of_le hn + rw [pow_add, pow_mul, hk, one_pow] + +theorem isPGroup_of_proEll_image {ell : ℕ} {G A Q : Type*} [Group G] [Group A] [Group Q] + [TopologicalSpace G] [TopologicalSpace A] [TopologicalSpace Q] + [IsTopologicalGroup G] [CompactSpace G] [DiscreteTopology Q] + (f : (G ⧸ proEllKernel ell G) →* A) (hf : Continuous f) (hs : Function.Surjective f) + (q : A →* Q) (hq : Continuous q) (hqs : Function.Surjective q) : IsPGroup ell Q := by + intro y + obtain ⟨a, rfl⟩ := hqs y + obtain ⟨x, rfl⟩ := hs a + have ht := (hq.tendsto (f 1)).comp ((hf.tendsto 1).comp (proEll_pow_tendsto_one x)) + simp only [Function.comp_def, map_one, map_pow] at ht + have he : ∀ᶠ n : ℕ in atTop, q (f x) ^ ell ^ n = 1 := + (tendsto_pure.mp (by simpa only [nhds_discrete, QuotientAddGroup.mk'_apply] using ht)) + exact he.exists + +variable {ell : ℕ} [Fact ell.Prime] + +theorem continuous_padic_toZModPow (n : ℕ) : + Continuous (PadicInt.toZModPow (p := ell) n) := by + apply continuous_of_continuousAt_zero + rw [ContinuousAt, map_zero, (nhds_discrete (ZMod (ell ^ n))), tendsto_pure] + have hpos : 0 < (ell : ℝ) := Nat.cast_pos.mpr (Fact.out : ell.Prime).pos + have hr : (ell : ℝ) ^ (-(n : ℤ)) ≠ 0 := zpow_ne_zero _ (ne_of_gt hpos) + have hb := (IsUltrametricDist.isOpen_closedBall (0 : PadicInt ell) hr).mem_nhds + (Metric.mem_closedBall_self (le_of_lt (by positivity : (0 : ℝ) < ell ^ (-(n : ℤ))))) + filter_upwards [hb] with x hx + apply RingHom.mem_ker.mp + rw [PadicInt.ker_toZModPow, ← PadicInt.norm_le_pow_iff_mem_span_pow] + simpa only [Metric.mem_closedBall, dist_zero_right] using hx + +omit [Fact ell.Prime] in +theorem finite_abelian_ell_exponent {A : Type*} [AddCommGroup A] [Finite A] + (h : IsPGroup ell (Multiplicative A)) : ∃ n, ∀ x : A, ell ^ n • x = 0 := by + obtain ⟨n, hn⟩ := isPGroup_iff_exists_pow_pow_eq_one.mp h + exact ⟨n, fun x => congrArg Multiplicative.toAdd (hn (Multiplicative.ofAdd x))⟩ + +abbrev finiteEllModule {A : Type*} [AddCommGroup A] [Finite A] + (h : IsPGroup ell (Multiplicative A)) : Module (PadicInt ell) A := by + let n := (finite_abelian_ell_exponent h).choose + letI := AddCommGroup.zmodModule (finite_abelian_ell_exponent h).choose_spec + exact Module.compHom A (PadicInt.toZModPow n) + +theorem finiteEllModule_continuous {A : Type*} [AddCommGroup A] [Finite A] + [TopologicalSpace A] [DiscreteTopology A] + (h : IsPGroup ell (Multiplicative A)) : + letI := finiteEllModule h + ContinuousSMul (PadicInt ell) A := by + let n := (finite_abelian_ell_exponent h).choose + let := AddCommGroup.zmodModule (finite_abelian_ell_exponent h).choose_spec + let : ContinuousSMul (ZMod (ell ^ n)) A := ⟨continuous_of_discreteTopology⟩ + exact MulAction.continuousSMul_compHom (continuous_padic_toZModPow n) + +section Profinite +variable {A : Type*} [AddCommGroup A] [TopologicalSpace A] + [NonarchimedeanAddGroup A] [CompactSpace A] [T2Space A] + +abbrev AllLevels (A : Type*) [AddCommGroup A] [TopologicalSpace A] := + ∀ H : OpenAddSubgroup A, A ⧸ H.toAddSubgroup + +instance levelDiscrete (H : OpenAddSubgroup A) : + DiscreteTopology (A ⧸ H.toAddSubgroup) := QuotientAddGroup.discreteTopology H.isOpen + +instance levelFinite (H : OpenAddSubgroup A) : + Finite (A ⧸ H.toAddSubgroup) := finite_of_compact_of_discrete + +def levelEval : A →+ AllLevels A := + AddMonoidHom.pi fun H => QuotientAddGroup.mk' H.toAddSubgroup + +omit [CompactSpace A] in +theorem levelEval_injective : Function.Injective (levelEval (A := A)) := by + apply (AddMonoidHom.ker_eq_bot_iff _).mp + apply le_antisymm _ bot_le + intro x hx + rw [AddSubgroup.mem_bot] + by_contra h + have hU : {x}ᶜ ∈ nhds (0 : A) := isClosed_singleton.isOpen_compl.mem_nhds (by simpa using Ne.symm h) + obtain ⟨H, hH⟩ := NonarchimedeanAddGroup.is_nonarchimedean _ hU + have hxH : x ∈ H := (QuotientAddGroup.eq_zero_iff x).mp (congrFun hx H) + exact hH hxH (Set.mem_singleton x) + +omit [NonarchimedeanAddGroup A] [CompactSpace A] [T2Space A] in +theorem levelEval_continuous : Continuous (levelEval (A := A)) := + continuous_pi fun _ => QuotientAddGroup.continuous_mk + +theorem levelEval_closedEmbedding : + Topology.IsClosedEmbedding (levelEval (A := A)) := + levelEval_continuous.isClosedEmbedding levelEval_injective + +def AllLevelsEll (ell : ℕ) (A : Type*) [AddCommGroup A] [TopologicalSpace A] : Prop := + ∀ H : OpenAddSubgroup A, IsPGroup ell (Multiplicative (A ⧸ H.toAddSubgroup)) + +variable [hA : Fact (AllLevelsEll ell A)] + +instance levelsModule : Module (PadicInt ell) (AllLevels A) := by + letI (H : OpenAddSubgroup A) := finiteEllModule (hA.out H) + exact Pi.module _ _ _ + +omit [T2Space A] in +theorem levels_continuous : ContinuousSMul (PadicInt ell) (AllLevels A) := by + let (H : OpenAddSubgroup A) := finiteEllModule (hA.out H) + let (H : OpenAddSubgroup A) := finiteEllModule_continuous (hA.out H) + infer_instance + +def levelImage : Submodule (PadicInt ell) (AllLevels A) where + carrier := Set.range (levelEval (A := A)) + zero_mem' := ⟨0, map_zero _⟩ + add_mem' := by rintro _ _ ⟨x, rfl⟩ ⟨y, rfl⟩; exact ⟨x + y, map_add _ _ _⟩ + smul_mem' := by + let := levels_continuous (ell := ell) (A := A) + rintro c _ ⟨x, rfl⟩ + refine (PadicInt.denseRange_natCast (p := ell)).induction_on c ?_ ?_ + · exact levelEval_closedEmbedding.isClosed_range.preimage (continuous_id.smul continuous_const) + · intro n + exact ⟨n • x, by simp [Nat.cast_smul_eq_nsmul]⟩ + +def levelImageEquiv : A ≃+ levelImage (ell := ell) (A := A) := + AddEquiv.ofBijective + ({ toFun := fun x => ⟨levelEval x, ⟨x, rfl⟩⟩ + map_zero' := Subtype.ext (map_zero _) + map_add' := fun x y => Subtype.ext (map_add _ x y) } : A →+ levelImage (ell := ell)) + ⟨fun _ _ h => levelEval_injective (congrArg Subtype.val h), by + rintro ⟨y, x, rfl⟩ + exact ⟨x, rfl⟩⟩ + +abbrev abelianEllModule : Module (PadicInt ell) A := + (levelImageEquiv (ell := ell) (A := A)).module (PadicInt ell) + +theorem levelEval_smul (c : PadicInt ell) (x : A) : + letI := abelianEllModule (ell := ell) (A := A) + levelEval (c • x) = c • levelEval x := by + let := abelianEllModule (ell := ell) (A := A) + exact congrArg Subtype.val + (((levelImageEquiv (ell := ell) (A := A)).linearEquiv (PadicInt ell)).map_smul c x) + +theorem abelianEllModule_continuous : + letI := abelianEllModule (ell := ell) (A := A) + ContinuousSMul (PadicInt ell) A := by + let := abelianEllModule (ell := ell) (A := A) + let := levels_continuous (ell := ell) (A := A) + constructor + apply levelEval_closedEmbedding.isEmbedding.continuous_iff.mpr + change Continuous (fun z : PadicInt ell × A => levelEval (z.1 • z.2)) + simp_rw [levelEval_smul] + exact continuous_fst.smul (levelEval_continuous.comp continuous_snd) + +end Profinite + +theorem padic_appr_tendsto (c : PadicInt ell) : + Tendsto (fun n : ℕ => (PadicInt.appr c n : PadicInt ell)) atTop (nhds c) := by + have hpos : 0 < (ell : ℝ) := Nat.cast_pos.mpr (Fact.out : ell.Prime).pos + have hlt : 1 < (ell : ℝ) := by exact_mod_cast (Fact.out : ell.Prime).one_lt + apply tendsto_iff_dist_tendsto_zero.mpr + apply squeeze_zero (fun _ => dist_nonneg) + · intro n + have hb := (PadicInt.norm_le_pow_iff_mem_span_pow (c - (PadicInt.appr c n : PadicInt ell)) n).mpr + (PadicInt.appr_spec n c) + simpa only [dist_eq_norm, norm_sub_rev, zpow_neg, zpow_natCast, inv_pow] using hb + · simpa only [inv_pow] using + tendsto_pow_atTop_nhds_zero_of_lt_one (inv_nonneg.mpr hpos.le) (inv_lt_one_of_one_lt₀ hlt) + +theorem continuous_addHom_padic_linear {A B : Type*} [AddCommGroup A] [AddCommGroup B] + [TopologicalSpace A] [TopologicalSpace B] [T2Space B] + [Module (PadicInt ell) A] [Module (PadicInt ell) B] + [ContinuousSMul (PadicInt ell) A] [ContinuousSMul (PadicInt ell) B] + (f : A →+ B) (hf : Continuous f) (c : PadicInt ell) (x : A) : + f (c • x) = c • f x := by + refine (PadicInt.denseRange_natCast (p := ell)).induction_on c ?_ ?_ + · exact isClosed_eq (hf.comp (continuous_id.smul continuous_const)) + (continuous_id.smul continuous_const) + · intro n + simp only [Nat.cast_smul_eq_nsmul, map_nsmul] + +theorem padic_appr_smul_tendsto {A : Type*} [AddCommGroup A] [TopologicalSpace A] + [Module (PadicInt ell) A] [ContinuousSMul (PadicInt ell) A] + (c : PadicInt ell) (x : A) : + Tendsto (fun n : ℕ => PadicInt.appr c n • x) atTop (nhds (c • x)) := by + simpa only [Nat.cast_smul_eq_nsmul] using (padic_appr_tendsto c).smul_const x + +end BogomolovPop + +end +end + +end OAI diff --git a/lean/OAI/Algebra/BogomolovPop/Injectivity.lean b/lean/OAI/Algebra/BogomolovPop/Injectivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..13e184237fe9ba63a29a37759380186b3966edac --- /dev/null +++ b/lean/OAI/Algebra/BogomolovPop/Injectivity.lean @@ -0,0 +1,322 @@ +import Mathlib +import OAI.Algebra.BogomolovPop.Kummer + +namespace OAI + +/-! Perfect-closure descent and injectivity of the canonical orbit map. -/ + +noncomputable section +open scoped Topology + +noncomputable section +namespace BogomolovPop + +lemma purely_inseparable_pow_mem_mono + (F E : Type*) [Field F] [Field E] [Algebra F E] (q : ℕ) + {x : E} {n m : ℕ} (h : x ^ q ^ n ∈ (algebraMap F E).range) (hnm : n ≤ m) : + x ^ q ^ m ∈ (algebraMap F E).range := by + obtain ⟨y, hy⟩ := h + refine ⟨y ^ (q ^ (m - n)), ?_⟩ + rw [map_pow, hy, ← pow_mul, ← pow_add, Nat.add_sub_of_le hnm] + +theorem uniform_frobenius_clearing + (k F E : Type*) [Field k] [Field F] [Field E] + [Algebra k F] [Algebra F E] [Algebra k E] [IsScalarTower k F E] + [Algebra.EssFiniteType k F] [IsPurelyInseparable F E] + (q : ℕ) [ExpChar F q] (σ : F →+* E) + (hc : ∀ c : k, ∃ d : k, σ (algebraMap k F c) = algebraMap k E d) : + ∃ n : ℕ, ∃ φ : F →+* F, ∀ x : F, + algebraMap F E (φ x) = (σ x) ^ (q ^ n) := by + classical + let : ExpChar E q := expChar_of_injective_algebraMap (algebraMap F E).injective q + obtain ⟨s, hs⟩ := IntermediateField.fg_top k F + choose e he using fun x : F => IsPurelyInseparable.pow_mem F q (σ x) + let n := s.sup e + let ψ : F →+* E := (iterateFrobenius E q n).comp σ + let S : IntermediateField k F := ((algebraMap F E).fieldRange.comap ψ).toIntermediateField + (by + intro c + obtain ⟨d, hd⟩ := hc c + change ψ (algebraMap k F c) ∈ (algebraMap F E).fieldRange + refine ⟨(algebraMap k F d) ^ (q ^ n), ?_⟩ + simp only [ψ, RingHom.comp_apply, iterateFrobenius_def, hd, map_pow, + ← IsScalarTower.algebraMap_apply k F E]) + have hS : S = ⊤ := by + apply top_le_iff.mp + rw [← hs, IntermediateField.adjoin_le_iff] + intro x hx + change σ x ^ (q ^ n) ∈ (algebraMap F E).fieldRange + exact purely_inseparable_pow_mem_mono F E q (he x) (Finset.le_sup hx) + have hψ : ∀ x : F, ψ x ∈ (algebraMap F E).fieldRange := by + intro x + change x ∈ S + simp [hS] + let φ : F →+* F := ((algebraMap F E).rangeRestrictFieldEquiv.symm.toRingHom).comp + (ψ.codRestrict _ hψ) + refine ⟨n, φ, ?_⟩ + intro x + exact congrArg (fun z : (algebraMap F E).fieldRange => (z : E)) + ((algebraMap F E).rangeRestrictFieldEquiv.apply_symm_apply ⟨ψ x, hψ x⟩) + +end BogomolovPop + +namespace BogomolovPop +lemma purely_inseparable_ringHom_ext + {F E T : Type*} [Field F] [Field E] [Field T] + [Algebra F E] [IsPurelyInseparable F E] + (q : ℕ) [ExpChar F q] [ExpChar T q] + (f g : E →+* T) (h : ∀ x : F, f (algebraMap F E x) = g (algebraMap F E x)) : f = g := by + ext x + obtain ⟨n, y, hy⟩ := IsPurelyInseparable.pow_mem F q x + apply (iterateFrobenius T q n).injective + simp only [iterateFrobenius_def, ← map_pow, ← hy, h] + +def frobeniusPerfectIsom + {k K l L : Type*} [Field k] [Field K] [Field l] [Field L] + [Algebra k K] [Algebra l L] [IsAlgClosed l] + (q : ℕ) [ExpChar L q] (n : ℕ) (α : PerfectIsom k K l L) : + PerfectIsom k K l L := by + letI : ExpChar (PerfectFieldClosure L) q := + expChar_of_injective_algebraMap (algebraMap L (PerfectFieldClosure L)).injective q + refine ⟨α.1.trans (iterateFrobeniusEquiv (PerfectFieldClosure L) q n), ?_⟩ + change ((iterateFrobeniusEquiv (PerfectFieldClosure L) q n) ∘ α.1) '' _ = _ + rw [Set.image_comp, α.2] + ext x + constructor + · rintro ⟨y, ⟨c, rfl⟩, rfl⟩ + exact ⟨c ^ (q ^ n), by simp [iterateFrobeniusEquiv_apply, iterateFrobenius_def]⟩ + · rintro ⟨c, rfl⟩ + obtain ⟨d, hd⟩ := IsAlgClosed.exists_pow_nat_eq c (expChar_pow_pos L q n) + refine ⟨algebraMap l (PerfectFieldClosure L) d, ⟨d, rfl⟩, ?_⟩ + simp only [iterateFrobeniusEquiv_apply, iterateFrobenius_def, ← map_pow, hd] + +@[simp] lemma frobeniusPerfectIsom_apply + {k K l L : Type*} [Field k] [Field K] [Field l] [Field L] + [Algebra k K] [Algebra l L] [IsAlgClosed l] + (q : ℕ) [ExpChar L q] (n : ℕ) (α : PerfectIsom k K l L) (x : PerfectFieldClosure K) : + (frobeniusPerfectIsom q n α).1 x = (α.1 x) ^ (q ^ n) := rfl + +lemma frobeniusPerfectIsom_eqvGen + {k K l L : Type*} [Field k] [Field K] [Field l] [Field L] + [Algebra k K] [Algebra l L] [IsAlgClosed l] + (q : ℕ) [ExpChar L q] (n : ℕ) (α : PerfectIsom k K l L) : + Relation.EqvGen FrobeniusStep α (frobeniusPerfectIsom q n α) := by + induction n with + | zero => + have he : frobeniusPerfectIsom q 0 α = α := by + apply Subtype.ext; apply RingEquiv.ext; intro x + simp + rw [he] + exact Relation.EqvGen.refl _ + | succ n ih => + apply Relation.EqvGen.trans _ _ _ ih + rcases expChar_is_prime_or_one L q with hp | rfl + · apply Relation.EqvGen.rel + refine ⟨q, hp, ?_, ?_⟩ + · have : CharP L q := by + cases (inferInstance : ExpChar L q) with + | zero => exact False.elim (hp.ne_one rfl) + | prime hp => infer_instance + exact CharP.cast_eq_zero L q + · intro x + simp only [frobeniusPerfectIsom_apply, pow_succ, pow_mul] + · have he : frobeniusPerfectIsom 1 (n + 1) α = frobeniusPerfectIsom 1 n α := by + apply Subtype.ext; apply RingEquiv.ext; intro x + simp + rw [he] + exact Relation.EqvGen.refl _ + +theorem frobenius_orbit_of_iterates + {k K l L : Type*} [Field k] [Field K] [Field l] [Field L] + [Algebra k K] [Algebra l L] [IsAlgClosed l] + (q : ℕ) [ExpChar L q] (α β : PerfectIsom k K l L) + (n m : ℕ) (h : ∀ x, (α.1 x) ^ (q ^ n) = (β.1 x) ^ (q ^ m)) : + Relation.EqvGen FrobeniusStep α β := by + have he : frobeniusPerfectIsom q n α = frobeniusPerfectIsom q m β := by + apply Subtype.ext; apply RingEquiv.ext; intro x + exact h x + exact Relation.EqvGen.trans _ _ _ (frobeniusPerfectIsom_eqvGen q n α) + (he ▸ Relation.EqvGen.symm _ _ (frobeniusPerfectIsom_eqvGen q m β)) +end BogomolovPop +namespace BogomolovPop +open scoped Topology +theorem perfect_scalar_iterates (ell : ℕ) [Fact ell.Prime] + (k F : Type*) [Field k] [Field F] [Algebra k F] [IsAlgClosed k] + [Algebra.EssFiniteType k F] (hchar : (ell : F) ≠ 0) + (q : ℕ) [ExpChar F q] (δ : PerfectIsom k F k F) + (β : AlgebraicClosure F ≃+* AlgebraicClosure F) + (hβ : ∀ x : PerfectFieldClosure F, β x = (δ.1 x : AlgebraicClosure F)) + (u : (PadicInt ell)ˣ) + (hg : ∀ σ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F, + ∃ τ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F, + (∀ x, β (τ x) = σ (β x)) ∧ + Filter.Tendsto (fun n : ℕ => absoluteToPiA ell F σ ^ (u : PadicInt ell).appr n) + Filter.atTop (nhds (absoluteToPiA ell F τ))) + (hx : ∃ x : F, Transcendental k x) : + ∃ n m : ℕ, ∀ x : PerfectFieldClosure F, (δ.1 x) ^ (q ^ n) = x ^ (q ^ m) := by + let P : Type _ := PerfectFieldClosure F + let A := AlgebraicClosure F + let : ExpChar P q := expChar_of_injective_algebraMap (algebraMap F P).injective q + let : ExpChar A q := expChar_of_injective_algebraMap (algebraMap F A).injective q + let σ : F →+* P := δ.1.toRingHom.comp (algebraMap F P) + have hc : ∀ c : k, ∃ d : k, σ (algebraMap k F c) = algebraMap k P d := by + intro c + have hm : δ.1 (algebraMap k P c) ∈ Set.range (algebraMap k P) := by + have hs : δ.1 '' Set.range (algebraMap k P) ⊆ Set.range (algebraMap k P) := le_of_eq δ.2 + exact hs ⟨algebraMap k P c, ⟨c, rfl⟩, rfl⟩ + obtain ⟨d, hd⟩ := hm + refine ⟨d, ?_⟩ + change δ.1 (algebraMap F P (algebraMap k F c)) = _ + rw [← IsScalarTower.algebraMap_apply k F P] + exact hd.symm + obtain ⟨n, φ, hφ⟩ := uniform_frobenius_clearing k F P q σ hc + let γ : A ≃+* A := β.trans (iterateFrobeniusEquiv A q n) + have hγ : ∀ x : F, γ (algebraMap F A x) = algebraMap F A (φ x) := by + intro x + change (β (algebraMap F A x)) ^ (q ^ n) = _ + change (β ((algebraMap F P x : P) : A)) ^ (q ^ n) = _ + rw [hβ] + have hh := congrArg (algebraMap P A) (hφ x) + rw [map_pow] at hh + exact hh.symm + have hγg : ∀ ρ : A ≃ₐ[F] A, ∃ τ : A ≃ₐ[F] A, + (∀ x, γ (τ x) = ρ (γ x)) ∧ + Filter.Tendsto (fun n : ℕ => absoluteToPiA ell F ρ ^ (u : PadicInt ell).appr n) + Filter.atTop (nhds (absoluteToPiA ell F τ)) := by + intro ρ + obtain ⟨τ, hτ, hlim⟩ := hg ρ + refine ⟨τ, ?_, hlim⟩ + intro x + change (β (τ x)) ^ (q ^ n) = ρ ((β x) ^ (q ^ n)) + rw [hτ, map_pow] + obtain ⟨a, ha⟩ := conjugation_kummer_scalar ell k F hchar φ γ hγ u hγg + have he : ∃ m : ℕ, ∀ x : F, φ x = x ^ (q ^ m) := by + rcases kummer_endomorphism_frobenius ell k F φ a hx ha with hid | ⟨p, r, hp, hpF, hr⟩ + · exact ⟨0, fun x => by simp [hid]⟩ + · have : CharP F p := (CharP.charP_iff_prime_eq_zero hp).mpr hpF + have hpq : p = q := ExpChar.eq (R := F) (ExpChar.prime hp) inferInstance + exact ⟨r, hpq ▸ hr⟩ + obtain ⟨m, hm⟩ := he + refine ⟨n, m, ?_⟩ + have heq : (iterateFrobenius P q n).comp δ.1.toRingHom = iterateFrobenius P q m := by + apply purely_inseparable_ringHom_ext (F := F) q + intro x + change (σ x) ^ (q ^ n) = (algebraMap F P x) ^ (q ^ m) + rw [← hφ x, hm, map_pow] + intro x + exact DFunLike.congr_fun heq x +end BogomolovPop + +namespace BogomolovPop +open scoped Topology + +theorem pullback_scalar_frobenius (ell : ℕ) [Fact ell.Prime] + {k K l L : Type*} [Field k] [Field K] [Field l] [Field L] + [Algebra k K] [Algebra l L] [IsAlgClosed k] [IsAlgClosed l] + [Algebra.EssFiniteType k K] + (hchar : (ell : K) ≠ 0) (hx : ∃ x : K, Transcendental k x) + (α β : PerfectIsom k K l L) (φ χ : IsomC ell K L) + (hφ : PullbackGraph α φ) (hχ : PullbackGraph β χ) + (hu : ScalarStep φ χ) : Relation.EqvGen FrobeniusStep α β := by + obtain ⟨a, ha, hfa⟩ := hφ + obtain ⟨b, hb, hfb⟩ := hχ + obtain ⟨u, hu⟩ := hu + let δ : PerfectIsom k K k K := ⟨β.1.trans α.1.symm, by + calc (α.1.symm ∘ β.1) '' Set.range (algebraMap k (PerfectFieldClosure K)) = + α.1.symm '' (β.1 '' Set.range (algebraMap k (PerfectFieldClosure K))) := Set.image_comp _ _ _ + _ = α.1.symm '' Set.range (algebraMap l (PerfectFieldClosure L)) := congrArg _ β.2 + _ = α.1.symm '' (α.1 '' Set.range (algebraMap k (PerfectFieldClosure K))) := congrArg _ α.2.symm + _ = Set.range (algebraMap k (PerfectFieldClosure K)) := by + simp only [Set.image_image, RingEquiv.symm_apply_apply] + exact Set.image_id _⟩ + let γ : AlgebraicClosure K ≃+* AlgebraicClosure K := b.trans a.symm + have hγ : ∀ x : PerfectFieldClosure K, γ x = (δ.1 x : AlgebraicClosure K) := by + intro x + change a.symm (b x) = _ + rw [hb, perfectExtension_symm α.1 a ha] + rfl + have hγg : ∀ σ : AlgebraicClosure K ≃ₐ[K] AlgebraicClosure K, + ∃ τ : AlgebraicClosure K ≃ₐ[K] AlgebraicClosure K, + (∀ x, γ (τ x) = σ (γ x)) ∧ + Filter.Tendsto (fun n : ℕ => absoluteToPiA ell K σ ^ (u : PadicInt ell).appr n) + Filter.atTop (nhds (absoluteToPiA ell K τ)) := by + intro σ + obtain ⟨ρ, hρ⟩ := (absoluteConjugateEquiv α.1 a ha).surjective σ + change absoluteConjugate α.1 a ha ρ = σ at hρ + obtain ⟨τ, hτ, hχτ⟩ := hfb ρ + change AlgebraicClosure K ≃ₐ[K] AlgebraicClosure K at τ + change (∀ x, b (τ x) = ρ (b x)) at hτ + obtain ⟨ν, hν, hφν⟩ := hfa ρ + have hνσ : ν = σ := by + rw [← hρ] + apply AlgEquiv.ext + intro x + apply a.injective + exact (hν x).trans (a.apply_symm_apply _).symm + refine ⟨τ, ?_, ?_⟩ + · intro x + change a.symm (b (τ x)) = σ (a.symm (b x)) + rw [hτ, ← hρ, absoluteConjugate_apply, a.apply_symm_apply] + · have ht := hu (absoluteToPiA ell L ρ) + rw [hφν, hνσ, hχτ] at ht + exact ht + obtain ⟨q, hq⟩ := ExpChar.exists K + let := hq + let : ExpChar (AlgebraicClosure K) q := + expChar_of_injective_algebraMap (algebraMap K (AlgebraicClosure K)).injective q + let : ExpChar (AlgebraicClosure L) q := expChar_of_injective_ringHom (f := a.toRingHom) a.injective q + let : ExpChar L q := (algebraMap L (AlgebraicClosure L)).expChar + (algebraMap L (AlgebraicClosure L)).injective q + obtain ⟨n, m, hm⟩ := perfect_scalar_iterates ell k K hchar q δ γ hγ u hγg hx + apply frobenius_orbit_of_iterates q α β m n + intro x + have he := congrArg α.1 (hm x) + simpa only [map_pow, δ, RingEquiv.trans_apply, RingEquiv.apply_symm_apply] using he.symm + +theorem main_canonical_injective (ell : ℕ) [Fact ell.Prime] + (k K l L : Type*) [Field k] [Field K] [Field l] [Field L] + [IsAlgClosed k] [IsAlgClosed l] [Algebra k K] [Algebra l L] + [Algebra.EssFiniteType k K] [Algebra.EssFiniteType l L] + (hk : (ell : k) ≠ 0) (_hl : (ell : l) ≠ 0) + (hK : 2 ≤ Algebra.trdeg k K) (_hL : 2 ≤ Algebra.trdeg l L) : + Function.Injective (canonicalPhi ell (k := k) (K := K) (l := l) (L := L)) := by + have hchar : (ell : K) ≠ 0 := by + simpa only [map_natCast] using (map_ne_zero (algebraMap k K)).mpr hk + have ht : Algebra.Transcendental k K := trdeg_ne_zero_iff.mp (by + intro he + rw [he] at hK + norm_num at hK) + let := ht + have hx : ∃ x : K, Transcendental k x := Algebra.Transcendental.transcendental + intro a b hab + induction a using Quotient.inductionOn with | h α => + induction b using Quotient.inductionOn with | h β => + apply Quotient.sound + change Quotient.mk _ (canonicalPullback ell α) = Quotient.mk _ (canonicalPullback ell β) at hab + have hs := (scalarEqvGen_iff (canonicalPullback ell α) (canonicalPullback ell β)).mp + (Quotient.exact hab) + exact pullback_scalar_frobenius ell hchar hx α β _ _ + (canonicalPullback_spec ell α) (canonicalPullback_spec ell β) hs +end BogomolovPop + +namespace BogomolovPop + +/-- Injectivity of the canonical Galois graph on its prescribed orbit sets. -/ +theorem main_graph_injective (ell : ℕ) [Fact ell.Prime] + (k K l L : Type*) [Field k] [Field K] [Field l] [Field L] + [IsAlgClosed k] [IsAlgClosed l] [Algebra k K] [Algebra l L] + [Algebra.EssFiniteType k K] [Algebra.EssFiniteType l L] + (hk : (ell : k) ≠ 0) (hl : (ell : l) ≠ 0) + (hK : 2 ≤ Algebra.trdeg k K) (hL : 2 ≤ Algebra.trdeg l L) : + ∀ (a a' : IsomF k K l L) (b : IsomCUnits ell K L), + PhiGraph a b → PhiGraph a' b → a = a' := by + intro a a' b ha ha' + apply main_canonical_injective ell k K l L hk hl hK hL + exact (phiGraph_eq_canonicalPhi ell ha).symm.trans (phiGraph_eq_canonicalPhi ell ha') + +end BogomolovPop + +end +end + +end OAI diff --git a/lean/OAI/Algebra/BogomolovPop/Kummer.lean b/lean/OAI/Algebra/BogomolovPop/Kummer.lean new file mode 100644 index 0000000000000000000000000000000000000000..51196c02d5034a33f0f3b7909b988966fde54da4 --- /dev/null +++ b/lean/OAI/Algebra/BogomolovPop/Kummer.lean @@ -0,0 +1,697 @@ +import Mathlib +import OAI.Algebra.BogomolovPop.Canonical +import OAI.Algebra.BogomolovPop.PowerCompletion + +namespace OAI + +/-! Tate bases, Kummer characters and scalar conjugation. -/ + +noncomputable section +open scoped Topology + +noncomputable section +namespace BogomolovPop +open scoped Topology +instance finiteRootsTopology (n : ℕ) (F : Type*) [Field F] : + TopologicalSpace (rootsOfUnity n (AlgebraicClosure F)) := ⊥ +instance finiteRootsDiscrete (n : ℕ) (F : Type*) [Field F] : + DiscreteTopology (rootsOfUnity n (AlgebraicClosure F)) := ⟨rfl⟩ + +variable {F : Type*} [Field F] +def rootTransition (ell e : ℕ) : + rootsOfUnity (ell ^ (e + 1)) (AlgebraicClosure F) →* + rootsOfUnity (ell ^ e) (AlgebraicClosure F) where + toFun z := ⟨(z : (AlgebraicClosure F)ˣ) ^ ell, by + rw [mem_rootsOfUnity, ← pow_mul, ← pow_succ'] + exact (mem_rootsOfUnity _ _).mp z.property⟩ + map_one' := by ext; simp + map_mul' x y := by ext; simp [mul_pow] + +def tateModuleGroup (ell : ℕ) (F : Type*) [Field F] : + Subgroup (∀ e : ℕ, rootsOfUnity (ell ^ e) (AlgebraicClosure F)) where + carrier := {z | ∀ e, rootTransition ell e (z (e + 1)) = z e} + one_mem' := fun e => map_one _ + mul_mem' := by intro x y hx hy e; rw [Pi.mul_apply, map_mul, hx, hy]; rfl + inv_mem' := by intro x hx e; rw [Pi.inv_apply, map_inv, hx]; rfl + +abbrev TateModule (ell : ℕ) (F : Type*) [Field F] := tateModuleGroup ell F + +end BogomolovPop +noncomputable section +namespace BogomolovPop +variable {A : Type*} [Field A] + +abbrev PrimitiveLevel (ell e : ℕ) := + {z : rootsOfUnity (ell ^ e) A // IsPrimitiveRoot (z : Aˣ) (ell ^ e)} + +lemma primitiveLevel_nonempty [IsAlgClosed A] (ell e : ℕ) (hchar : (ell : A) ≠ 0) : + Nonempty (PrimitiveLevel (A := A) ell e) := by + have : NeZero (ell : A) := ⟨hchar⟩ + obtain ⟨z, hz⟩ := HasEnoughRootsOfUnity.exists_primitiveRoot A (ell ^ e) + have hn : ell ^ e ≠ 0 := by + have : ell ≠ 0 := by intro h; simp [h] at hchar + exact pow_ne_zero _ this + obtain ⟨u, hu⟩ := hz.isUnit hn + have hp : IsPrimitiveRoot u (ell ^ e) := by + rw [← IsPrimitiveRoot.coe_units_iff, hu] + exact hz + exact ⟨⟨⟨u, hp.pow_eq_one⟩, hp⟩⟩ + +def primitiveDown (ell : ℕ) (hell : 0 < ell) (e n : ℕ) (h : e ≤ n) + (z : PrimitiveLevel (A := A) ell n) : PrimitiveLevel (A := A) ell e := by + have hp : IsPrimitiveRoot ((z.val : Aˣ) ^ (ell ^ (n-e))) (ell ^ e) := + z.property.pow (pow_pos hell n) (by rw [← pow_add, Nat.sub_add_cancel h]) + exact ⟨⟨_, hp.pow_eq_one⟩, hp⟩ + +lemma primitiveDown_self (ell : ℕ) (hell : 0 < ell) (e : ℕ) + (z : PrimitiveLevel (A := A) ell e) : primitiveDown ell hell e e le_rfl z = z := by + apply Subtype.ext + apply Subtype.ext + simp [primitiveDown] + +lemma primitiveDown_comp (ell : ℕ) (hell : 0 < ell) (e n m : ℕ) + (hen : e ≤ n) (hnm : n ≤ m) (z : PrimitiveLevel (A := A) ell m) : + primitiveDown ell hell e n hen (primitiveDown ell hell n m hnm z) = + primitiveDown ell hell e m (hen.trans hnm) z := by + apply Subtype.ext + apply Subtype.ext + change ((z.val : Aˣ) ^ (ell ^ (m-n))) ^ (ell ^ (n-e)) = _ + rw [← pow_mul, ← pow_add, show m-n+(n-e) = m-e by omega] + rfl + +theorem exists_compatible_primitive [IsAlgClosed A] (ell : ℕ) (hell : 0 < ell) + (hchar : (ell : A) ≠ 0) : + ∃ z : ℕ → Aˣ, (∀ e, IsPrimitiveRoot (z e) (ell ^ e)) ∧ + ∀ e, z (e+1) ^ ell = z e := by + classical + let : ∀ e, TopologicalSpace (PrimitiveLevel (A := A) ell e) := fun _ => ⊥ + let : ∀ e, DiscreteTopology (PrimitiveLevel (A := A) ell e) := fun _ => ⟨rfl⟩ + let : ∀ e, NeZero (ell ^ e) := fun e => ⟨pow_ne_zero _ hell.ne'⟩ + let : ∀ e, Nonempty (PrimitiveLevel (A := A) ell e) := fun e => primitiveLevel_nonempty ell e hchar + let T := ∀ e, PrimitiveLevel (A := A) ell e + let s (e : ℕ) : Set T := + {z | primitiveDown ell hell e (e+1) (Nat.le_succ e) (z (e+1)) = z e} + have hs (e : ℕ) : IsClosed (s e) := + isClosed_eq ((continuous_of_discreteTopology : Continuous + (primitiveDown (A := A) ell hell e (e+1) (Nat.le_succ e))).comp (continuous_apply (e+1))) (continuous_apply e) + have hf (u : Finset ℕ) : (Set.univ ∩ ⋂ e ∈ u, s e).Nonempty := by + let n := u.sup Nat.succ + let a : PrimitiveLevel (A := A) ell n := Classical.choice inferInstance + let z : T := fun e => if h : e ≤ n then primitiveDown ell hell e n h a + else Classical.choice inferInstance + refine ⟨z, Set.mem_univ _, Set.mem_iInter.mpr fun e => Set.mem_iInter.mpr fun he => ?_⟩ + have hn : e+1 ≤ n := Finset.le_sup (f := Nat.succ) he + change primitiveDown ell hell e (e+1) (Nat.le_succ e) (z (e+1)) = z e + simp only [z, dite_eq_left hn, dite_eq_left ((Nat.le_succ e).trans hn)] + exact primitiveDown_comp ell hell e (e+1) n (Nat.le_succ e) hn a + obtain ⟨z, _, hz⟩ := isCompact_univ.inter_iInter_nonempty s hs hf + refine ⟨fun e => (z e).val.val, fun e => (z e).property, fun e => ?_⟩ + have he := congrArg (fun z : PrimitiveLevel (A := A) ell e => z.val.val) (Set.mem_iInter.mp hz e) + simpa [primitiveDown] using he + +def zmodRootEquiv {n : ℕ} [NeZero n] {z : Aˣ} (hz : IsPrimitiveRoot z n) : + Multiplicative (ZMod n) ≃* rootsOfUnity n A := + hz.zmodEquivZPowers.toMultiplicative.trans + ((MulEquiv.multiplicativeAdditive (Subgroup.zpowers z)).trans + (MulEquiv.subgroupCongr hz.zpowers_eq)) + +lemma zmodRootEquiv_nat {n : ℕ} [NeZero n] {z : Aˣ} (hz : IsPrimitiveRoot z n) (i : ℕ) : + (zmodRootEquiv hz (Multiplicative.ofAdd (i : ZMod n)) : Aˣ) = z ^ i := by + change (hz.zmodEquivZPowers (i : ZMod n)).toMul.val = _ + rw [hz.zmodEquivZPowers_apply_coe_nat] + rfl + +lemma zmodRootEquiv_val {n : ℕ} [NeZero n] {z : Aˣ} (hz : IsPrimitiveRoot z n) (i : ZMod n) : + (zmodRootEquiv hz (Multiplicative.ofAdd i) : Aˣ) = z ^ i.val := by + simpa using zmodRootEquiv_nat hz i.val + +lemma zmodRootEquiv_transition (ell e : ℕ) (hell : 0 < ell) {z w : Aˣ} + (hz : IsPrimitiveRoot z (ell ^ e)) (hw : IsPrimitiveRoot w (ell ^ (e+1))) + (hc : w ^ ell = z) (i : ZMod (ell ^ (e+1))) : + letI : NeZero (ell ^ e) := ⟨pow_ne_zero _ hell.ne'⟩ + letI : NeZero (ell ^ (e+1)) := ⟨pow_ne_zero _ hell.ne'⟩ + (zmodRootEquiv hw (Multiplicative.ofAdd i) : Aˣ) ^ ell = + (zmodRootEquiv hz (Multiplicative.ofAdd + ((ZMod.castHom (pow_dvd_pow ell (Nat.le_succ e)) (ZMod (ell^e))) i)) : Aˣ) := by + let : NeZero (ell ^ e) := ⟨pow_ne_zero _ hell.ne'⟩ + let : NeZero (ell ^ (e+1)) := ⟨pow_ne_zero _ hell.ne'⟩ + have hi : (ZMod.castHom (pow_dvd_pow ell (Nat.le_succ e)) (ZMod (ell^e))) i = + (i.val : ZMod (ell^e)) := by + conv_lhs => rw [← ZMod.natCast_zmod_val i, map_natCast] + rw [zmodRootEquiv_val, hi, zmodRootEquiv_nat] + rw [← pow_mul, mul_comm i.val ell, pow_mul, hc] + +end BogomolovPop + +namespace BogomolovPop +open scoped Topology +open Filter + +variable {ell : ℕ} [Fact ell.Prime] + +theorem root_continuous_padic_toZModPow (n : ℕ) : + Continuous (PadicInt.toZModPow (p := ell) n) := by + apply continuous_of_continuousAt_zero + rw [ContinuousAt, map_zero, (nhds_discrete (ZMod (ell ^ n))), tendsto_pure] + have hpos : 0 < (ell : ℝ) := Nat.cast_pos.mpr (Fact.out : ell.Prime).pos + have hr : (ell : ℝ) ^ (-(n : ℤ)) ≠ 0 := zpow_ne_zero _ (ne_of_gt hpos) + have hb := (IsUltrametricDist.isOpen_closedBall (0 : PadicInt ell) hr).mem_nhds + (Metric.mem_closedBall_self (le_of_lt (by positivity : (0 : ℝ) < ell ^ (-(n : ℤ))))) + filter_upwards [hb] with x hx + apply RingHom.mem_ker.mp + rw [PadicInt.ker_toZModPow, ← PadicInt.norm_le_pow_iff_mem_span_pow] + simpa only [Metric.mem_closedBall, dist_zero_right] using hx + +end BogomolovPop + +namespace BogomolovPop +variable {F : Type*} [Field F] {ell : ℕ} [Fact ell.Prime] + +def padicToTate (z : ℕ → (AlgebraicClosure F)ˣ) + (hz : ∀ e, IsPrimitiveRoot (z e) (ell ^ e)) + (hc : ∀ e, z (e+1) ^ ell = z e) : + Multiplicative (PadicInt ell) →* TateModule ell F where + toFun a := ⟨fun e => zmodRootEquiv (hz e) (Multiplicative.ofAdd (PadicInt.toZModPow e a.toAdd)), + fun e => Subtype.ext (by + change _ ^ ell = _ + rw [zmodRootEquiv_transition ell e (Nat.Prime.pos Fact.out) (hz e) (hz (e+1)) (hc e)] + congr 2 + exact DFunLike.congr_fun (PadicInt.zmod_cast_comp_toZModPow e (e+1) (Nat.le_succ e)) a.toAdd)⟩ + map_one' := by + apply Subtype.ext + funext e + simp + map_mul' a b := by + apply Subtype.ext + funext e + simp [map_add] + +lemma padicToTate_continuous (z : ℕ → (AlgebraicClosure F)ˣ) + (hz : ∀ e, IsPrimitiveRoot (z e) (ell ^ e)) + (hc : ∀ e, z (e+1) ^ ell = z e) : Continuous (padicToTate z hz hc) := by + apply Continuous.subtype_mk + apply continuous_pi + intro e + exact (continuous_of_discreteTopology : Continuous (zmodRootEquiv (hz e))).comp + (continuous_ofAdd.comp ((root_continuous_padic_toZModPow e).comp + continuous_toAdd)) + +lemma padicToTate_injective (z : ℕ → (AlgebraicClosure F)ˣ) + (hz : ∀ e, IsPrimitiveRoot (z e) (ell ^ e)) + (hc : ∀ e, z (e+1) ^ ell = z e) : Function.Injective (padicToTate z hz hc) := by + intro a b h + apply Multiplicative.toAdd.injective + apply PadicInt.ext_of_toZModPow.mp + intro e + exact Multiplicative.ofAdd.injective ((zmodRootEquiv (hz e)).injective + (congrArg (fun t : TateModule ell F => t.val e) h)) + +lemma padicToTate_surjective (z : ℕ → (AlgebraicClosure F)ˣ) + (hz : ∀ e, IsPrimitiveRoot (z e) (ell ^ e)) + (hc : ∀ e, z (e+1) ^ ell = z e) : Function.Surjective (padicToTate z hz hc) := by + intro t + let s (e : ℕ) : Set (Multiplicative (PadicInt ell)) := {a | (padicToTate z hz hc a).val e = t.val e} + have hs (e : ℕ) : IsClosed (s e) := + isClosed_eq ((continuous_apply e).comp (continuous_subtype_val.comp (padicToTate_continuous z hz hc))) continuous_const + have hn (e : ℕ) : (s e).Nonempty := by + let i := ((zmodRootEquiv (hz e)).symm (t.val e)).toAdd + refine ⟨Multiplicative.ofAdd (i.val : PadicInt ell), ?_⟩ + change zmodRootEquiv (hz e) (Multiplicative.ofAdd (PadicInt.toZModPow e (i.val : PadicInt ell))) = t.val e + rw [map_natCast, ZMod.natCast_zmod_val] + exact (zmodRootEquiv (hz e)).apply_symm_apply (t.val e) + have hm : Antitone s := antitone_nat_of_succ_le (fun e a ha => by + change (padicToTate z hz hc a).val e = t.val e + rw [← (padicToTate z hz hc a).property e, ← t.property e, ha]) + obtain ⟨a, ha⟩ := IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed + s (fun e => hm (Nat.le_succ e)) hn ((hs 0).isCompact) hs + exact ⟨a, Subtype.ext (funext fun e => Set.mem_iInter.mp ha e)⟩ + +def tateBasisEquiv (z : ℕ → (AlgebraicClosure F)ˣ) + (hz : ∀ e, IsPrimitiveRoot (z e) (ell ^ e)) + (hc : ∀ e, z (e+1) ^ ell = z e) : Multiplicative (PadicInt ell) ≃ₜ* TateModule ell F := + { MulEquiv.ofBijective (padicToTate z hz hc) + ⟨padicToTate_injective z hz hc, padicToTate_surjective z hz hc⟩ with + continuous_toFun := padicToTate_continuous z hz hc + continuous_invFun := by + let E := MulEquiv.ofBijective (padicToTate z hz hc) + ⟨padicToTate_injective z hz hc, padicToTate_surjective z hz hc⟩ + have h : Continuous E.toEquiv := padicToTate_continuous z hz hc + exact h.continuous_symm_of_equiv_compact_to_t2 } + +end BogomolovPop + +namespace BogomolovPop +lemma root_scalar_exists (ell : ℕ) [Fact ell.Prime] + (F : Type*) [Field F] (hchar : (ell : F) ≠ 0) + (σ : AlgebraicClosure F ≃+* AlgebraicClosure F) : + ∃ a : PadicInt ell, ∀ n : ℕ, ∀ z : (AlgebraicClosure F)ˣ, + z ^ (ell ^ n) = 1 → Units.map σ.toMonoidHom z = z ^ a.appr n := by + have hc : (ell : AlgebraicClosure F) ≠ 0 := by + simpa only [map_natCast] using (map_ne_zero (algebraMap F (AlgebraicClosure F))).mpr hchar + obtain ⟨z, hz, hcompat⟩ := exists_compatible_primitive ell (Nat.Prime.pos Fact.out) hc + let t : TateModule ell F := ⟨fun n => ⟨Units.map σ.toMonoidHom (z n), by + rw [mem_rootsOfUnity, ← map_pow, (hz n).pow_eq_one, map_one]⟩, + fun n => Subtype.ext (by change _ ^ ell = _; rw [← map_pow, hcompat n])⟩ + obtain ⟨a, ha⟩ := padicToTate_surjective z hz hcompat t + have haz (n : ℕ) : Units.map σ.toMonoidHom (z n) = z n ^ a.toAdd.appr n := by + have he := congrArg (fun v : TateModule ell F => (v.val n : (AlgebraicClosure F)ˣ)) ha + change (zmodRootEquiv (hz n) (Multiplicative.ofAdd + (PadicInt.toZModPow n a.toAdd)) : (AlgebraicClosure F)ˣ) = _ at he + rw [show PadicInt.toZModPow n a.toAdd = (a.toAdd.appr n : ZMod (ell ^ n)) by rfl, + zmodRootEquiv_nat] at he + exact he.symm + refine ⟨a.toAdd, fun n w hw => ?_⟩ + let : NeZero (ell ^ n) := ⟨pow_ne_zero _ (Nat.Prime.ne_zero Fact.out)⟩ + obtain ⟨i, hi⟩ := (zmodRootEquiv (hz n)).surjective ⟨w, hw⟩ + have he := congrArg (fun v : rootsOfUnity (ell ^ n) (AlgebraicClosure F) => + (v : (AlgebraicClosure F)ˣ)) hi + rw [show i = Multiplicative.ofAdd i.toAdd by rfl, zmodRootEquiv_val] at he + change z n ^ i.toAdd.val = w at he + rw [← he, map_pow, haz, ← pow_mul, ← pow_mul, Nat.mul_comm] + +theorem closure_root_scalar (ell : ℕ) [Fact ell.Prime] + (F : Type*) [Field F] (hchar : (ell : F) ≠ 0) + (σ : AlgebraicClosure F ≃+* AlgebraicClosure F) : + ∃ u : (PadicInt ell)ˣ, ∀ n : ℕ, ∀ z : AlgebraicClosure F, + z ^ (ell ^ n) = 1 → σ z = z ^ (u : PadicInt ell).appr n := by + obtain ⟨a, ha⟩ := root_scalar_exists ell F hchar σ + obtain ⟨b, hb⟩ := root_scalar_exists ell F hchar σ.symm + have hab : a * b = 1 := by + apply PadicInt.ext_of_toZModPow.mp + intro n + let : NeZero (ell ^ n) := ⟨pow_ne_zero _ (Nat.Prime.ne_zero Fact.out)⟩ + have hc : (ell : AlgebraicClosure F) ≠ 0 := by + simpa only [map_natCast] using (map_ne_zero (algebraMap F (AlgebraicClosure F))).mpr hchar + obtain ⟨z, hz⟩ := primitiveLevel_nonempty (A := AlgebraicClosure F) ell n hc + have he : (z : (AlgebraicClosure F)ˣ) ^ (a.appr n * b.appr n) = z := by + rw [pow_mul, ← ha n _ hz.pow_eq_one, ← hb n _ (by rw [← map_pow, hz.pow_eq_one, map_one])] + apply Units.ext + exact σ.symm_apply_apply _ + have hh := (zmodRootEquiv hz).injective (show + zmodRootEquiv hz (Multiplicative.ofAdd ((a.appr n * b.appr n : ℕ) : ZMod (ell ^ n))) = + zmodRootEquiv hz (Multiplicative.ofAdd (1 : ZMod (ell ^ n))) by + apply Subtype.ext + rw [zmodRootEquiv_nat] + have hh1 := zmodRootEquiv_nat hz 1 + simp only [Nat.cast_one, pow_one] at hh1 + exact he.trans hh1.symm + ) + change (PadicInt.toZModPow n) (a * b) = (PadicInt.toZModPow n) 1 + rw [map_mul, map_one] + simpa only [toAdd_ofAdd, Nat.cast_mul, PadicInt.toZModPow, PadicInt.toZModHom, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk] using congrArg Multiplicative.toAdd hh + refine ⟨Units.mkOfMulEqOne a b hab, fun n z hz => ?_⟩ + have hz0 : z ≠ 0 := by + intro he + rw [he, zero_pow (pow_ne_zero _ (Nat.Prime.ne_zero Fact.out))] at hz + exact zero_ne_one hz + exact congrArg Units.val (ha n (Units.mk0 z hz0) (Units.ext hz)) +end BogomolovPop + +noncomputable section +namespace BogomolovPop + +open Polynomial + +theorem torsion_is_constant {k A : Type*} [Field k] [IsAlgClosed k] [Field A] + [Algebra k A] {n : ℕ} (hn : 0 < n) {x : A} (hx : x ^ n = 1) : + x ∈ Set.range (algebraMap k A) := by + have hm : x ∈ algebraicClosure k A := mem_algebraicClosure_iff.mpr + (IsAlgebraic.of_pow hn (hx ▸ isAlgebraic_one)) + rw [IntermediateField.eq_bot_of_isAlgClosed_of_isAlgebraic (algebraicClosure k A)] at hm + exact hm + +theorem fixed_separable_mem_base {F A : Type*} [Field F] [Field A] [Algebra F A] + [Normal F A] {x : A} (hx : IsSeparable F x) + (hfix : ∀ σ : A ≃ₐ[F] A, σ x = x) : x ∈ Set.range (algebraMap F A) := by + let S := separableClosure F A + let z : S := ⟨x, hx⟩ + have hz : z ∈ Set.range (algebraMap F S) := + (InfiniteGalois.mem_range_algebraMap_iff_fixed z).mpr fun τ => by + obtain ⟨σ, rfl⟩ := AlgEquiv.restrictNormalHom_surjective (E := A) (K₁ := S) τ + apply Subtype.val_injective + exact (AlgEquiv.restrictNormal_commutes σ S z).trans (hfix σ) + obtain ⟨f, hf⟩ := hz + exact ⟨f, congrArg Subtype.val hf⟩ + +variable {k F : Type*} [Field k] [IsAlgClosed k] [Field F] [Algebra k F] + +include k in + +theorem galois_fixes_torsion {n : ℕ} (hn : 0 < n) + (σ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) {x : AlgebraicClosure F} (hx : x ^ n = 1) : + σ x = x := by + obtain ⟨c, rfl⟩ := torsion_is_constant (k := k) hn hx + rw [IsScalarTower.algebraMap_apply k F (AlgebraicClosure F), σ.commutes] + +def kummerRoot (n : ℕ) (hn : 0 < n) (f : Fˣ) : (AlgebraicClosure F)ˣ := + Units.mk0 (IsAlgClosed.exists_pow_nat_eq (algebraMap F (AlgebraicClosure F) (f : F)) hn).choose + (by + intro he + have h := (IsAlgClosed.exists_pow_nat_eq + (algebraMap F (AlgebraicClosure F) (f : F)) hn).choose_spec + rw [he, zero_pow hn.ne'] at h + exact f.ne_zero ((algebraMap F (AlgebraicClosure F)).injective (by simpa using h.symm))) + +theorem kummerRoot_pow (n : ℕ) (hn : 0 < n) (f : Fˣ) : + (kummerRoot n hn f : AlgebraicClosure F) ^ n = + algebraMap F (AlgebraicClosure F) (f : F) := + (IsAlgClosed.exists_pow_nat_eq _ hn).choose_spec + +def kummerRatio (n : ℕ) (hn : 0 < n) (f : Fˣ) (σ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) : + rootsOfUnity n (AlgebraicClosure F) := + ⟨Units.map σ.toMonoidHom (kummerRoot n hn f) / kummerRoot n hn f, by + rw [mem_rootsOfUnity] + apply Units.ext + change (σ (kummerRoot n hn f : AlgebraicClosure F) / + (kummerRoot n hn f : AlgebraicClosure F)) ^ n = 1 + rw [div_pow, ← map_pow, kummerRoot_pow, σ.commutes, + div_self ((_root_.map_ne_zero _).mpr f.ne_zero)]⟩ + +include k in + +theorem ratio_eq_of_pow_eq {n : ℕ} (hn : 0 < n) + (σ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) + (r s : (AlgebraicClosure F)ˣ) (hrs : (r : AlgebraicClosure F) ^ n = (s : AlgebraicClosure F) ^ n) : + σ (r : AlgebraicClosure F) / (r : AlgebraicClosure F) = + σ (s : AlgebraicClosure F) / (s : AlgebraicClosure F) := by + have hh := galois_fixes_torsion (k := k) hn σ (x := (r : AlgebraicClosure F) / s) (by + rw [div_pow, hrs, div_self (pow_ne_zero _ s.ne_zero)]) + rw [map_div₀, div_eq_div_iff ((_root_.map_ne_zero σ).mpr s.ne_zero) s.ne_zero] at hh + apply (div_eq_div_iff r.ne_zero s.ne_zero).mpr + simpa [mul_comm] using hh + +include k in + +def kummerCharacter (n : ℕ) (hn : 0 < n) (f : Fˣ) : + (AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) →* rootsOfUnity n (AlgebraicClosure F) where + toFun := kummerRatio n hn f + map_one' := by + apply Subtype.ext + apply Units.ext + simp [kummerRatio] + map_mul' σ τ := by + apply Subtype.ext + apply Units.ext + change σ (τ (kummerRoot n hn f : AlgebraicClosure F)) / kummerRoot n hn f = + (σ (kummerRoot n hn f : AlgebraicClosure F) / kummerRoot n hn f) * + (τ (kummerRoot n hn f : AlgebraicClosure F) / kummerRoot n hn f) + have hh := galois_fixes_torsion (k := k) hn σ + (x := τ (kummerRoot n hn f : AlgebraicClosure F) / kummerRoot n hn f) (by + rw [div_pow, ← map_pow, kummerRoot_pow, τ.commutes, + div_self ((_root_.map_ne_zero _).mpr f.ne_zero)]) + rw [map_div₀] at hh + have hs0 := (_root_.map_ne_zero σ).mpr (kummerRoot n hn f).ne_zero + rw [(div_eq_iff hs0).mp hh] + ring + +theorem kummerCharacter_apply_of_root (n : ℕ) (hn : 0 < n) (f : Fˣ) + (σ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) (r : (AlgebraicClosure F)ˣ) + (hr : (r : AlgebraicClosure F) ^ n = algebraMap F (AlgebraicClosure F) (f : F)) : + ((kummerCharacter (k := k) n hn f σ : (AlgebraicClosure F)ˣ) : AlgebraicClosure F) = + σ (r : AlgebraicClosure F) / r := + ratio_eq_of_pow_eq (k := k) hn σ _ r ((kummerRoot_pow n hn f).trans hr.symm) + +def kummerPairing (n : ℕ) (hn : 0 < n) : + Fˣ →* ((AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) →* + rootsOfUnity n (AlgebraicClosure F)) where + toFun := kummerCharacter (k := k) n hn + map_one' := by + ext σ + change ((kummerCharacter (k := k) n hn 1 σ : (AlgebraicClosure F)ˣ) : AlgebraicClosure F) = 1 + rw [kummerCharacter_apply_of_root n hn 1 σ 1 (by simp)] + simp + map_mul' f g := by + ext σ + change ((kummerCharacter (k := k) n hn (f * g) σ : (AlgebraicClosure F)ˣ) : AlgebraicClosure F) = + ((kummerCharacter (k := k) n hn f σ : (AlgebraicClosure F)ˣ) : AlgebraicClosure F) * + ((kummerCharacter (k := k) n hn g σ : (AlgebraicClosure F)ˣ) : AlgebraicClosure F) + rw [kummerCharacter_apply_of_root n hn (f * g) σ (kummerRoot n hn f * kummerRoot n hn g) (by + simp only [Units.val_mul, mul_pow, kummerRoot_pow, map_mul])] + change σ ((kummerRoot n hn f : AlgebraicClosure F) * kummerRoot n hn g) / + ((kummerRoot n hn f : AlgebraicClosure F) * kummerRoot n hn g) = _ + rw [map_mul, mul_div_mul_comm] + rfl + +theorem kummerRoot_isSeparable (n : ℕ) (hn : 0 < n) (hchar : (n : F) ≠ 0) (f : Fˣ) : + IsSeparable F (kummerRoot n hn f : AlgebraicClosure F) := by + apply (Polynomial.separable_X_pow_sub_C (f : F) hchar f.ne_zero).of_dvd + exact minpoly.dvd F _ (by simp [kummerRoot_pow]) + +theorem kummerPairing_eq_one_iff (n : ℕ) (hn : 0 < n) (hchar : (n : F) ≠ 0) (f : Fˣ) : + kummerPairing (k := k) n hn f = 1 ↔ ∃ g : Fˣ, g ^ n = f := by + constructor + · intro hf + have hfix (σ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) : + σ (kummerRoot n hn f : AlgebraicClosure F) = kummerRoot n hn f := by + have hh := congrArg (fun χ => ((χ σ : (AlgebraicClosure F)ˣ) : AlgebraicClosure F)) hf + change σ (kummerRoot n hn f : AlgebraicClosure F) / kummerRoot n hn f = 1 at hh + exact (div_eq_one_iff_eq (kummerRoot n hn f).ne_zero).mp hh + obtain ⟨g, hg⟩ := fixed_separable_mem_base (kummerRoot_isSeparable n hn hchar f) hfix + have hg0 : g ≠ 0 := by + intro he + apply (kummerRoot n hn f).ne_zero + rw [← hg, he, map_zero] + refine ⟨Units.mk0 g hg0, Units.ext ((algebraMap F (AlgebraicClosure F)).injective ?_)⟩ + simpa only [Units.val_pow_eq_pow_val, Units.val_mk0, map_pow, hg] using kummerRoot_pow n hn f + · rintro ⟨g, rfl⟩ + ext σ + change ((kummerCharacter (k := k) n hn (g ^ n) σ : (AlgebraicClosure F)ˣ) : AlgebraicClosure F) = 1 + rw [kummerCharacter_apply_of_root n hn (g ^ n) σ (Units.map (algebraMap F (AlgebraicClosure F)) g) + (by simp)] + change σ (algebraMap F (AlgebraicClosure F) (g : F)) / algebraMap F (AlgebraicClosure F) (g : F) = 1 + rw [σ.commutes, div_self ((_root_.map_ne_zero _).mpr g.ne_zero)] + +theorem kummerCharacter_eq_one_iff (n : ℕ) (hn : 0 < n) (f : Fˣ) + (σ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) : + kummerCharacter (k := k) n hn f σ = 1 ↔ + σ (kummerRoot n hn f : AlgebraicClosure F) = kummerRoot n hn f := by + constructor + · intro h + have hh := congrArg (fun z : rootsOfUnity n (AlgebraicClosure F) => + ((z : (AlgebraicClosure F)ˣ) : AlgebraicClosure F)) h + exact (div_eq_one_iff_eq (kummerRoot n hn f).ne_zero).mp hh + · intro h + apply Subtype.ext + apply Units.ext + change σ (kummerRoot n hn f : AlgebraicClosure F) / kummerRoot n hn f = 1 + rw [h, div_self (kummerRoot n hn f).ne_zero] + +theorem kummerCharacter_ker_isOpen (n : ℕ) (hn : 0 < n) (f : Fˣ) : + IsOpen ((kummerCharacter (k := k) n hn f).ker : + Set (AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F)) := by + have he : ((kummerCharacter (k := k) n hn f).ker : + Set (AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F)) = + (MulAction.stabilizer (AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) + (kummerRoot n hn f : AlgebraicClosure F) : Set _) := by + ext σ + exact kummerCharacter_eq_one_iff (k := k) n hn f σ + rw [he] + exact stabilizer_isOpen_of_isIntegral _ + +theorem kummerCharacter_continuous (n : ℕ) (hn : 0 < n) (f : Fˣ) : + Continuous (kummerCharacter (k := k) n hn f) := by + apply continuous_of_continuousAt_one _ (continuousAt_def.mpr _) + intro U hU + have h1 : 1 ∈ U := by simpa only [map_one] using mem_of_mem_nhds hU + have ho := kummerCharacter_ker_isOpen (k := k) n hn f + exact Filter.mem_of_superset (ho.mem_nhds (Subgroup.one_mem _)) fun σ hσ => by + change kummerCharacter (k := k) n hn f σ ∈ U + rw [MonoidHom.mem_ker.mp hσ] + exact h1 + +theorem kummerCharacter_proEllKernel (ell e : ℕ) (hell : 0 < ell) (f : Fˣ) : + proEllKernel ell (Field.absoluteGaloisGroup F) ≤ + (kummerCharacter (k := k) (ell ^ e) (pow_pos hell e) f).ker := by + let φ : Field.absoluteGaloisGroup F →* rootsOfUnity (ell ^ e) (AlgebraicClosure F) := + kummerCharacter (k := k) (ell ^ e) (pow_pos hell e) f + let H : OpenNormalSubgroup (Field.absoluteGaloisGroup F) := + { φ.ker with isOpen' := kummerCharacter_ker_isOpen (k := k) _ _ f } + have hp : IsPGroup ell (rootsOfUnity (ell ^ e) (AlgebraicClosure F)) := by + intro z + refine ⟨e, Subtype.ext ?_⟩ + exact z.property + have hpQ : IsPGroup ell (Field.absoluteGaloisGroup F ⧸ H.toSubgroup) := + hp.of_injective (φ.range.subtype.comp (QuotientGroup.quotientKerEquivRange φ).toMonoidHom) + (Subtype.val_injective.comp (QuotientGroup.quotientKerEquivRange φ).injective) + exact iInf_le_of_le H (iInf_le_of_le hpQ le_rfl) + +def kummerProEll (ell e : ℕ) (hell : 0 < ell) (f : Fˣ) : + ProEll ell F →* rootsOfUnity (ell ^ e) (AlgebraicClosure F) := + QuotientGroup.lift _ (kummerCharacter (k := k) (ell ^ e) (pow_pos hell e) f) + (kummerCharacter_proEllKernel ell e hell f) + +theorem kummerProEll_continuous (ell e : ℕ) (hell : 0 < ell) (f : Fˣ) : + Continuous (kummerProEll (k := k) ell e hell f) := by + apply continuous_coinduced_dom.mpr + exact kummerCharacter_continuous (k := k) (ell ^ e) (pow_pos hell e) f + +theorem kummerProEll_closedCommutator (ell e : ℕ) (hell : 0 < ell) (f : Fˣ) : + (commutator (ProEll ell F)).topologicalClosure ≤ + (kummerProEll (k := k) ell e hell f).ker := by + apply Subgroup.topologicalClosure_minimal _ + (Abelianization.commutator_subset_ker (kummerProEll (k := k) ell e hell f)) + exact isClosed_singleton.preimage (kummerProEll_continuous ell e hell f) + +def kummerPiA (ell e : ℕ) (hell : 0 < ell) (f : Fˣ) : + PiA ell F →* rootsOfUnity (ell ^ e) (AlgebraicClosure F) := + QuotientGroup.lift _ (kummerProEll (k := k) ell e hell f) + (kummerProEll_closedCommutator ell e hell f) + +theorem kummerPiA_continuous (ell e : ℕ) (hell : 0 < ell) (f : Fˣ) : + Continuous (kummerPiA (k := k) ell e hell f) := by + apply continuous_coinduced_dom.mpr + exact kummerProEll_continuous ell e hell f + +@[simp] +theorem kummerPiA_absolute (ell e : ℕ) (hell : 0 < ell) (f : Fˣ) + (σ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F) : + kummerPiA (k := k) ell e hell f (absoluteToPiA ell F σ) = + kummerCharacter (k := k) (ell ^ e) (pow_pos hell e) f σ := rfl + +theorem kummerPiA_eq_one_iff (ell e : ℕ) (hell : 0 < ell) (hchar : (ell : F) ≠ 0) (f : Fˣ) : + kummerPiA (k := k) ell e hell f = 1 ↔ ∃ g : Fˣ, g ^ (ell ^ e) = f := by + have hc : ((ell ^ e : ℕ) : F) ≠ 0 := by simpa using pow_ne_zero e hchar + rw [← kummerPairing_eq_one_iff (k := k) (ell ^ e) (pow_pos hell e) hc f] + constructor + · intro h + apply MonoidHom.ext + intro σ + exact DFunLike.congr_fun h (absoluteToPiA ell F σ) + · intro h + apply MonoidHom.ext + intro x + obtain ⟨σ, rfl⟩ := absoluteToPiA_surjective (F := F) ell x + exact DFunLike.congr_fun h σ + +end BogomolovPop + +namespace BogomolovPop +open scoped Topology +open Filter +lemma torsion_appr_eventually {G : Type*} [CommGroup G] (ell : ℕ) [Fact ell.Prime] + (a : PadicInt ell) (e : ℕ) (x : G) (hx : x ^ (ell ^ e) = 1) : + ∀ᶠ n in atTop, x ^ a.appr n = x ^ a.appr e := by + filter_upwards [eventually_ge_atTop e] with n hn + obtain ⟨c, hc⟩ := a.dvd_appr_sub_appr e n hn + have he : a.appr n = a.appr e + ell ^ e * c := by + have := a.appr_mono hn + omega + rw [he, pow_add, pow_mul, hx, one_pow, mul_one] + +lemma kummerPiA_scalar_limit (ell : ℕ) [Fact ell.Prime] + {k F : Type*} [Field k] [Field F] [Algebra k F] [IsAlgClosed k] + (u : PadicInt ell) (σ τ : PiA ell F) + (h : Tendsto (fun n : ℕ => σ ^ u.appr n) atTop (nhds τ)) (e : ℕ) (f : Fˣ) : + kummerPiA (k := k) ell e (Nat.Prime.pos Fact.out) f τ = + kummerPiA (k := k) ell e (Nat.Prime.pos Fact.out) f σ ^ u.appr e := by + let χ := kummerPiA (k := k) ell e (Nat.Prime.pos Fact.out) f + have hc : Tendsto (fun n : ℕ => χ (σ ^ u.appr n)) atTop (nhds (χ τ)) := + (kummerPiA_continuous ell e (Nat.Prime.pos Fact.out) f).continuousAt.tendsto.comp h + have hd : Tendsto (fun n : ℕ => χ (σ ^ u.appr n)) atTop (nhds (χ σ ^ u.appr e)) := by + apply tendsto_const_nhds.congr' + filter_upwards [torsion_appr_eventually ell u e (χ σ) + (Subtype.ext (χ σ).property)] with n hn + simpa only [map_pow] using hn.symm + exact tendsto_nhds_unique hc hd + +lemma kummerPiA_pairing_mul {k F : Type*} [Field k] [Field F] [Algebra k F] [IsAlgClosed k] + (ell e : ℕ) (hell : 0 < ell) (f g : Fˣ) (σ : PiA ell F) : + kummerPiA (k := k) ell e hell (f * g) σ = + kummerPiA (k := k) ell e hell f σ * kummerPiA (k := k) ell e hell g σ := by + obtain ⟨τ, rfl⟩ := absoluteToPiA_surjective (F := F) ell σ + exact DFunLike.congr_fun (map_mul (kummerPairing (k := k) (ell ^ e) (pow_pos hell e)) f g) τ + +def kummerPiAPairing {k F : Type*} [Field k] [Field F] [Algebra k F] [IsAlgClosed k] + (ell e : ℕ) (hell : 0 < ell) : Fˣ →* (PiA ell F →* rootsOfUnity (ell ^ e) (AlgebraicClosure F)) where + toFun := kummerPiA (k := k) ell e hell + map_one' := by + apply MonoidHom.ext + intro σ + obtain ⟨τ, rfl⟩ := absoluteToPiA_surjective (F := F) ell σ + exact DFunLike.congr_fun (map_one (kummerPairing (k := k) (ell ^ e) (pow_pos hell e))) τ + map_mul' f g := MonoidHom.ext (kummerPiA_pairing_mul ell e hell f g) + +lemma kummerPiA_class_eq {k F : Type*} [Field k] [Field F] [Algebra k F] [IsAlgClosed k] + (ell e : ℕ) (hell : 0 < ell) (hchar : (ell : F) ≠ 0) {f g : Fˣ} + (h : ∀ σ, kummerPiA (k := k) ell e hell f σ = kummerPiA (k := k) ell e hell g σ) : + PowerClass.mk (ell ^ e) f = PowerClass.mk (ell ^ e) g := by + rw [← div_eq_one, ← map_div, PowerClass.mk_eq_one] + apply (kummerPiA_eq_one_iff (k := k) ell e hell hchar (f / g)).mp + change kummerPiAPairing (k := k) ell e hell (f / g) = 1 + rw [map_div, div_eq_one] + exact MonoidHom.ext h + +theorem conjugation_kummer_scalar (ell : ℕ) [Fact ell.Prime] + (k F : Type*) [Field k] [Field F] [Algebra k F] [IsAlgClosed k] + (hchar : (ell : F) ≠ 0) (φ : F →+* F) + (β : AlgebraicClosure F ≃+* AlgebraicClosure F) + (hβ : ∀ x : F, β (algebraMap F (AlgebraicClosure F) x) = + algebraMap F (AlgebraicClosure F) (φ x)) + (u : (PadicInt ell)ˣ) + (hg : ∀ σ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F, + ∃ τ : AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F, + (∀ x, β (τ x) = σ (β x)) ∧ + Tendsto (fun n : ℕ => absoluteToPiA ell F σ ^ (u : PadicInt ell).appr n) + atTop (nhds (absoluteToPiA ell F τ))) : + ∃ a : (PadicInt ell)ˣ, ∀ f : Fˣ, + KummerScalarLevels ell (a : PadicInt ell) f (Units.map φ.toMonoidHom f) := by + obtain ⟨v, hv⟩ := closure_root_scalar ell F hchar β + refine ⟨v * u, fun f e => ?_⟩ + rw [← map_pow] + apply kummerPiA_class_eq (k := k) ell e (Nat.Prime.pos Fact.out) hchar + intro γ + obtain ⟨σ, rfl⟩ := absoluteToPiA_surjective (F := F) ell γ + change AlgebraicClosure F ≃ₐ[F] AlgebraicClosure F at σ + obtain ⟨τ, hτ, hlim⟩ := hg σ + let r := kummerRoot (ell ^ e) (pow_pos (Nat.Prime.pos Fact.out) e) f + have hn : 0 < ell ^ e := pow_pos (Nat.Prime.pos Fact.out) e + have hr : ((Units.map β.toMonoidHom r : (AlgebraicClosure F)ˣ) : AlgebraicClosure F) ^ (ell ^ e) = + algebraMap F (AlgebraicClosure F) (Units.map φ.toMonoidHom f : F) := by + change (β (r : AlgebraicClosure F)) ^ _ = _ + rw [← map_pow, kummerRoot_pow, hβ] + rfl + have hroot := kummerCharacter_apply_of_root (k := k) (ell ^ e) hn + (Units.map φ.toMonoidHom f) σ (Units.map β.toMonoidHom r) hr + have hleft := kummerCharacter_apply_of_root (k := k) (ell ^ e) hn f τ r (kummerRoot_pow _ _ f) + have hright := kummerPiA_scalar_limit (k := k) ell (u : PadicInt ell) + (absoluteToPiA ell F σ) (absoluteToPiA ell F τ) hlim e f + have hv' := hv e (τ (r : AlgebraicClosure F) / r) (by + rw [div_pow, ← map_pow, kummerRoot_pow, τ.commutes, + div_self ((map_ne_zero (algebraMap F (AlgebraicClosure F))).mpr f.ne_zero)]) + have heq : kummerPiA (k := k) ell e (Nat.Prime.pos Fact.out) + (Units.map φ.toMonoidHom f) (absoluteToPiA ell F σ) = + (kummerPiA (k := k) ell e (Nat.Prime.pos Fact.out) f + (absoluteToPiA ell F σ)) ^ ((u : PadicInt ell).appr e * (v : PadicInt ell).appr e) := by + apply Subtype.ext + apply Units.ext + change ((kummerCharacter (k := k) (ell ^ e) hn (Units.map φ.toMonoidHom f) σ : + (AlgebraicClosure F)ˣ) : AlgebraicClosure F) = _ + rw [hroot] + change σ (β (r : AlgebraicClosure F)) / β (r : AlgebraicClosure F) = _ + rw [← hτ, ← map_div₀, hv'] + rw [← hleft] + have hh := congrArg (fun z : rootsOfUnity (ell ^ e) (AlgebraicClosure F) => + ((z : (AlgebraicClosure F)ˣ) : AlgebraicClosure F)) hright + change ((kummerCharacter (k := k) (ell ^ e) hn f τ : (AlgebraicClosure F)ˣ) : AlgebraicClosure F) = _ at hh + rw [hh] + simp only [Subgroup.coe_pow, Units.val_pow_eq_pow_val, pow_mul] + rw [heq] + change _ = kummerPiAPairing (k := k) ell e (Nat.Prime.pos Fact.out) + (f ^ (↑(v * u) : PadicInt ell).appr e) (absoluteToPiA ell F σ) + rw [map_pow, MonoidHom.pow_apply] + let ζ := kummerPiA (k := k) ell e (Nat.Prime.pos Fact.out) f (absoluteToPiA ell F σ) + have hh : (((u : PadicInt ell).appr e * (v : PadicInt ell).appr e : ℕ) : ZMod (ell ^ e)) = + ((↑(v * u) : PadicInt ell).appr e : ZMod (ell ^ e)) := by + rw [Nat.cast_mul] + change (PadicInt.toZModPow e) (u : PadicInt ell) * (PadicInt.toZModPow e) (v : PadicInt ell) = (PadicInt.toZModPow e) (↑(v * u) : PadicInt ell) + rw [Units.val_mul, map_mul, mul_comm] + have hd := (ZMod.natCast_eq_natCast_iff _ _ _).mp hh + exact (pow_eq_pow_of_modEq hd (Subtype.ext ζ.property)) +end BogomolovPop + +end +end +end +end + +end OAI diff --git a/lean/OAI/Algebra/BogomolovPop/PowerCompletion.lean b/lean/OAI/Algebra/BogomolovPop/PowerCompletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..e1649b38678d53f0e0778c137b5f67ac5689e6da --- /dev/null +++ b/lean/OAI/Algebra/BogomolovPop/PowerCompletion.lean @@ -0,0 +1,971 @@ +import Mathlib + +namespace OAI + +/-! Multiplicative power completions, integral characters and Frobenius endomorphisms. -/ + +noncomputable section +open scoped Topology + +noncomputable section +namespace BogomolovPop + +def powerSubgroup (G : Type*) [CommGroup G] (q : ℕ) : Subgroup G := + (powMonoidHom q).range + +abbrev PowerClass (G : Type*) [CommGroup G] (q : ℕ) := G ⧸ powerSubgroup G q + +namespace PowerClass +variable {G H I : Type*} [CommGroup G] [CommGroup H] [CommGroup I] + +def mk (q : ℕ) : G →* PowerClass G q := QuotientGroup.mk' _ + +@[simp] theorem mk_eq_one {q : ℕ} {x : G} : + mk q x = 1 ↔ ∃ y : G, y ^ q = x := QuotientGroup.eq_one_iff x + +def map (f : G →* H) (q : ℕ) : PowerClass G q →* PowerClass H q := + QuotientGroup.map _ _ f (by + rintro x ⟨y, rfl⟩ + exact ⟨f y, (map_pow f y q).symm⟩) + +@[simp] theorem map_mk (f : G →* H) (q : ℕ) (x : G) : + map f q (mk q x) = mk q (f x) := rfl + +@[simp] theorem map_comp (f : G →* H) (g : H →* I) (q : ℕ) : + (map g q).comp (map f q) = map (g.comp f) q := by + ext x + rfl + +@[simp] theorem map_id (q : ℕ) : map (MonoidHom.id G) q = MonoidHom.id _ := by + ext x + rfl + +def reduce (q r : ℕ) (h : q ∣ r) : PowerClass G r →* PowerClass G q := + QuotientGroup.map _ _ (MonoidHom.id _) (by + rintro x ⟨y, rfl⟩ + obtain ⟨d, rfl⟩ := h + exact ⟨y ^ d, by change (y ^ d) ^ q = y ^ (q * d); rw [← pow_mul, Nat.mul_comm]⟩) + +@[simp] theorem reduce_mk (q r : ℕ) (h : q ∣ r) (x : G) : + reduce q r h (mk r x) = mk q x := rfl + +theorem map_reduce (f : G →* H) (q r : ℕ) (h : q ∣ r) (x : PowerClass G r) : + map f q (reduce q r h x) = reduce q r h (map f r x) := by + induction x using QuotientGroup.induction_on with | H x => rfl + +end PowerClass + +def powerCompletionGroup (ell : ℕ) (G : Type*) [CommGroup G] : + Subgroup (∀ n : ℕ, PowerClass G (ell ^ n)) where + carrier := { x | ∀ n, PowerClass.reduce (ell ^ n) (ell ^ (n+1)) + (pow_dvd_pow ell (Nat.le_succ n)) (x (n+1)) = x n } + one_mem' := by intro n; exact map_one _ + mul_mem' := by + intro x y hx hy n + rw [Pi.mul_apply, map_mul, hx n, hy n] + rfl + inv_mem' := by + intro x hx n + rw [Pi.inv_apply, map_inv, hx n] + rfl + +abbrev PowerCompletion (ell : ℕ) (G : Type*) [CommGroup G] := powerCompletionGroup ell G + +namespace PowerCompletion +variable {ell : ℕ} {G H I : Type*} [CommGroup G] [CommGroup H] [CommGroup I] + +@[ext] theorem ext {x y : PowerCompletion ell G} (h : ∀ n, x.1 n = y.1 n) : x = y := + Subtype.ext (funext h) + +def of (x : G) : PowerCompletion ell G := + ⟨fun n => PowerClass.mk (ell ^ n) x, fun _ => rfl⟩ + +def map (f : G →* H) : PowerCompletion ell G →* PowerCompletion ell H where + toFun x := ⟨fun n => PowerClass.map f (ell ^ n) (x.1 n), by + intro n + rw [← PowerClass.map_reduce, x.2 n]⟩ + map_one' := by apply ext; intro n; exact map_one _ + map_mul' := by intro x y; apply ext; intro n; exact map_mul _ _ _ + +@[simp] theorem map_val (f : G →* H) (x : PowerCompletion ell G) (n : ℕ) : + (map f x).1 n = PowerClass.map f (ell ^ n) (x.1 n) := rfl + +@[simp] theorem map_of (f : G →* H) (x : G) : + map f (of (ell := ell) x) = of (f x) := rfl + +@[simp] theorem map_comp (f : G →* H) (g : H →* I) : + (map (ell := ell) g).comp (map f) = map (g.comp f) := by + ext x n + exact DFunLike.congr_fun (PowerClass.map_comp f g _) (x.1 n) + +theorem map_injective (f : G →* H) + (hf : ∀ n, Function.Injective (PowerClass.map f (ell ^ n))) : + Function.Injective (map (ell := ell) f) := by + intro x y h + apply ext + intro n + apply hf n + exact congrArg (fun z : PowerCompletion ell H => z.1 n) h + +theorem range_iff (f : G →* H) + (hf : ∀ n, Function.Injective (PowerClass.map f (ell ^ n))) + (x : PowerCompletion ell H) : + (∃ y : PowerCompletion ell G, map f y = x) ↔ + ∀ n, ∃ y : PowerClass G (ell ^ n), PowerClass.map f (ell ^ n) y = x.1 n := by + constructor + · rintro ⟨y, rfl⟩ n + exact ⟨y.1 n, rfl⟩ + · intro h + choose y hy using h + have hcompat : ∀ n, PowerClass.reduce (ell ^ n) (ell ^ (n+1)) + (pow_dvd_pow ell (Nat.le_succ n)) (y (n+1)) = y n := by + intro n + apply hf n + rw [PowerClass.map_reduce, hy (n+1), hy n, x.2 n] + exact ⟨⟨y, hcompat⟩, ext hy⟩ + +end PowerCompletion +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +namespace PowerClass +variable {G : Type*} [CommGroup G] + +theorem pow_eq_one (q : ℕ) (x : PowerClass G q) : x ^ q = 1 := by + induction x using QuotientGroup.induction_on with + | H x => exact (map_pow (mk q) x q).symm.trans (mk_eq_one.2 ⟨x, rfl⟩) + +end PowerClass + +namespace PowerCompletion +variable {G : Type*} [CommGroup G] {ell : ℕ} + +theorem pow_ell_eq_one (_hell : 0 < ell) + (htors : ∀ z : G, z ^ ell = 1 → ∀ n, ∃ c : G, c ^ (ell ^ n) = z) + (x : PowerCompletion ell G) (hx : x ^ ell = 1) : x = 1 := by + apply ext + intro n + obtain ⟨a, ha⟩ := QuotientGroup.mk'_surjective (powerSubgroup G (ell ^ (n+1))) + (x.1 (n+1)) + change PowerClass.mk (ell ^ (n+1)) a = x.1 (n+1) at ha + have hapow : PowerClass.mk (ell ^ (n+1)) (a ^ ell) = 1 := by + rw [map_pow, ha] + exact congrArg (fun y : PowerCompletion ell G => y.1 (n+1)) hx + obtain ⟨b, hb⟩ := PowerClass.mk_eq_one.1 hapow + have hz : (a / b ^ (ell ^ n)) ^ ell = 1 := by + rw [div_pow, ← pow_mul, ← pow_succ, hb, div_self'] + obtain ⟨c, hc⟩ := htors _ hz n + have hc' : (b*c) ^ (ell ^ n) = a := by + simp only [mul_pow, hc, div_eq_mul_inv, ← mul_assoc, mul_comm, mul_inv_cancel_right] + rw [← x.2 n, ← ha, PowerClass.reduce_mk] + exact PowerClass.mk_eq_one.2 ⟨b*c, hc'⟩ + +theorem pow_eq_one (hell : ell.Prime) + (htors : ∀ z : G, z ^ ell = 1 → ∀ n, ∃ c : G, c ^ (ell ^ n) = z) + (x : PowerCompletion ell G) {m : ℕ} (hm : 0 < m) (hx : x ^ m = 1) : x = 1 := by + induction m using Nat.strong_induction_on with + | h m ih => + by_cases hd : ell ∣ m + · have hpow : (x ^ (m / ell)) ^ ell = 1 := by + rw [← pow_mul, Nat.div_mul_cancel hd, hx] + have hsmall : m / ell < m := Nat.div_lt_self hm hell.one_lt + have hmdiv : 0 < m / ell := Nat.div_pos (Nat.le_of_dvd hm hd) hell.pos + exact ih (m / ell) hsmall hmdiv (pow_ell_eq_one hell.pos htors _ hpow) + · apply ext + intro n + have h1 : (x.1 n) ^ m = 1 := + congrArg (fun y : PowerCompletion ell G => y.1 n) hx + have h2 := PowerClass.pow_eq_one (ell ^ n) (x.1 n) + have hcop := ((hell.coprime_iff_not_dvd.2 hd).symm).pow_right n + apply orderOf_eq_one_iff.1 + exact Nat.eq_one_of_dvd_one (hcop ▸ Nat.dvd_gcd + (orderOf_dvd_iff_pow_eq_one.2 h1) (orderOf_dvd_iff_pow_eq_one.2 h2)) + +end PowerCompletion + +end +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +theorem field_torsion_divisible {k F : Type*} [Field k] [IsAlgClosed k] + [Field F] [Algebra k F] {ell : ℕ} (hell : 0 < ell) + (z : Fˣ) (hz : z ^ ell = 1) (n : ℕ) : ∃ c : Fˣ, c ^ (ell ^ n) = z := by + have hzalg : IsAlgebraic k (z : F) := IsAlgebraic.of_pow hell (by + have hz' : (z : F) ^ ell = 1 := congrArg Units.val hz + rw [hz'] + exact isAlgebraic_one) + have hzmem : (z : F) ∈ algebraicClosure k F := mem_algebraicClosure_iff.2 hzalg + rw [IntermediateField.eq_bot_of_isAlgClosed_of_isAlgebraic (algebraicClosure k F)] at hzmem + obtain ⟨a, ha⟩ := hzmem + change algebraMap k F a = (z : F) at ha + obtain ⟨b, hb⟩ := IsAlgClosed.exists_pow_nat_eq a (pow_pos hell n) + have hb0 : b ≠ 0 := by + intro hzero + have ha0 : a = 0 := by rw [hzero, zero_pow (by positivity)] at hb; exact hb.symm + apply z.ne_zero + rw [← ha, ha0, map_zero] + refine ⟨Units.mk0 (algebraMap k F b) ((map_ne_zero _).2 hb0), Units.ext ?_⟩ + simpa only [Units.val_pow_eq_pow_val, Units.val_mk0, ← map_pow, hb] using ha + +theorem field_completion_pow_eq_one {k F : Type*} [Field k] [IsAlgClosed k] + [Field F] [Algebra k F] {ell : ℕ} (hell : ell.Prime) + (x : PowerCompletion ell Fˣ) {m : ℕ} (hm : 0 < m) (hx : x ^ m = 1) : x = 1 := + PowerCompletion.pow_eq_one hell (field_torsion_divisible (k := k) hell.pos) x hm hx + +def inclusionUnits (E F : Type*) [Field E] [Field F] [Algebra E F] : Eˣ →* Fˣ := + Units.map (algebraMap E F).toMonoidHom + +def normUnits (E F : Type*) [Field E] [Field F] [Algebra E F] : Fˣ →* Eˣ := + Units.map (Algebra.norm E) + +theorem completion_norm_inclusion {E F : Type*} [Field E] [Field F] + [Algebra E F] {ell : ℕ} (x : PowerCompletion ell Eˣ) : + PowerCompletion.map (normUnits E F) (PowerCompletion.map (inclusionUnits E F) x) = + x ^ Module.finrank E F := by + apply PowerCompletion.ext + intro n + change PowerClass.map (normUnits E F) _ + (PowerClass.map (inclusionUnits E F) _ (x.1 n)) = (x.1 n) ^ Module.finrank E F + induction x.1 n using QuotientGroup.induction_on with + | H u => + change PowerClass.map (normUnits E F) _ + (PowerClass.map (inclusionUnits E F) _ (PowerClass.mk (ell ^ n) u)) = _ + rw [PowerClass.map_mk, PowerClass.map_mk] + change PowerClass.mk (ell ^ n) _ = (PowerClass.mk (ell ^ n) u) ^ Module.finrank E F + rw [← map_pow] + apply congrArg (PowerClass.mk (ell ^ n)) + ext + exact Algebra.norm_algebraMap _ + +theorem finite_extension_completion_injective {k E F : Type*} + [Field k] [IsAlgClosed k] [Field E] [Field F] + [Algebra k E] [Algebra E F] [FiniteDimensional E F] + {ell : ℕ} (hell : ell.Prime) : + Function.Injective (PowerCompletion.map (ell := ell) (inclusionUnits E F)) := by + apply (injective_iff_map_eq_one _).2 + intro x hx + apply field_completion_pow_eq_one (k := k) hell x (Module.finrank_pos (R := E) (M := F)) + rw [← completion_norm_inclusion (F := F), hx, map_one] + +end +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +def RelativelyAlgebraicallyClosed (P M : Type*) [Field P] [Field M] [Algebra P M] : + Prop := ∀ x : M, IsAlgebraic P x → ∃ c : P, algebraMap P M c = x + +theorem kummer_level_injective + {P M : Type*} [Field P] [Field M] [Algebra P M] + (hclosed : RelativelyAlgebraicallyClosed P M) + (q : ℕ) (hq : 0 < q) : + Function.Injective (PowerClass.map (inclusionUnits P M) q) := by + apply (injective_iff_map_eq_one _).2 + intro x hx + induction x using QuotientGroup.induction_on with + | H u => + obtain ⟨v, hv⟩ := PowerClass.mk_eq_one.1 hx + have hv' : (v : M) ^ q = algebraMap P M (u : P) := congrArg Units.val hv + obtain ⟨b, hb⟩ := hclosed (v : M) (IsAlgebraic.of_pow hq + (hv' ▸ isIntegral_algebraMap.isAlgebraic)) + have hb0 : b ≠ 0 := by + intro hz + apply v.ne_zero + rw [← hb, hz, map_zero] + apply PowerClass.mk_eq_one.2 + refine ⟨Units.mk0 b hb0, Units.ext ?_⟩ + apply (algebraMap P M).injective + simpa only [Units.val_pow_eq_pow_val, Units.val_mk0, map_pow, hb] using hv' + +theorem relatively_closed_completion_saturated + {E F : Type*} [Field E] [Field F] [Algebra E F] + (hc : RelativelyAlgebraicallyClosed E F) {ell : ℕ} (hell : 0 < ell) + (x : PowerCompletion ell Fˣ) + (hx : ∃ y : PowerCompletion ell Eˣ, + PowerCompletion.map (inclusionUnits E F) y = x ^ ell) : + ∃ y : PowerCompletion ell Eˣ, + PowerCompletion.map (inclusionUnits E F) y = x := by + obtain ⟨y, hy⟩ := hx + apply (PowerCompletion.range_iff _ (fun n => + kummer_level_injective hc _ (pow_pos hell n)) x).2 + intro n + obtain ⟨a, ha⟩ := QuotientGroup.mk'_surjective (powerSubgroup Fˣ (ell ^ (n+1))) + (x.1 (n+1)) + obtain ⟨b, hb⟩ := QuotientGroup.mk'_surjective (powerSubgroup Eˣ (ell ^ (n+1))) + (y.1 (n+1)) + change PowerClass.mk (ell ^ (n+1)) a = x.1 (n+1) at ha + change PowerClass.mk (ell ^ (n+1)) b = y.1 (n+1) at hb + have heq : PowerClass.mk (ell ^ (n+1)) (a ^ ell) = + PowerClass.mk (ell ^ (n+1)) (inclusionUnits E F b) := by + rw [map_pow, ha, ← PowerClass.map_mk, hb] + exact (congrArg (fun z : PowerCompletion ell Fˣ => z.1 (n+1)) hy).symm + have hratio : PowerClass.mk (ell ^ (n+1)) (a ^ ell / inclusionUnits E F b) = 1 := by + rw [map_div, heq, div_self'] + obtain ⟨c, hcq⟩ := PowerClass.mk_eq_one.1 hratio + have hroot : (a / c ^ (ell ^ n)) ^ ell = inclusionUnits E F b := by + rw [div_pow, ← pow_mul, ← pow_succ, hcq] + exact div_div_self' _ _ + have hroot' : ((a / c ^ (ell ^ n) : Fˣ) : F) ^ ell = algebraMap E F (b : E) := + congrArg Units.val hroot + obtain ⟨d, hd⟩ := hc ((a / c ^ (ell ^ n) : Fˣ) : F) + (IsAlgebraic.of_pow hell (hroot' ▸ isIntegral_algebraMap.isAlgebraic)) + have hd0 : d ≠ 0 := by + intro hz + apply (a / c ^ (ell ^ n)).ne_zero + rw [← hd, hz, map_zero] + let u : Eˣ := Units.mk0 d hd0 + have hu : inclusionUnits E F u = a / c ^ (ell ^ n) := Units.ext hd + refine ⟨PowerClass.mk (ell ^ n) u, ?_⟩ + rw [PowerClass.map_mk, hu, ← x.2 n, ← ha, PowerClass.reduce_mk, map_div] + have hcpow : PowerClass.mk (ell ^ n) (c ^ (ell ^ n)) = 1 := + PowerClass.mk_eq_one.2 ⟨c, rfl⟩ + rw [hcpow, div_one] + +end +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +theorem completion_coprime_saturated + {E F : Type*} [Field E] [Field F] [Algebra E F] + (hc : RelativelyAlgebraicallyClosed E F) {ell m : ℕ} (hell : 0 < ell) + (hm : m.Coprime ell) (x : PowerCompletion ell Fˣ) + (hx : ∃ y : PowerCompletion ell Eˣ, + PowerCompletion.map (inclusionUnits E F) y = x ^ m) : + ∃ y : PowerCompletion ell Eˣ, + PowerCompletion.map (inclusionUnits E F) y = x := by + obtain ⟨y, hy⟩ := hx + apply (PowerCompletion.range_iff _ (fun n => + kummer_level_injective hc _ (pow_pos hell n)) x).2 + intro n + have hcop : m.Coprime (orderOf (x.1 n)) := + (hm.pow_right n).of_dvd_right + (orderOf_dvd_iff_pow_eq_one.2 (PowerClass.pow_eq_one _ _)) + obtain ⟨s, hs⟩ := exists_pow_eq_self_of_coprime hcop + refine ⟨(y.1 n) ^ s, ?_⟩ + rw [map_pow] + have hy' : PowerClass.map (inclusionUnits E F) _ (y.1 n) = (x.1 n) ^ m := + congrArg (fun z : PowerCompletion ell Fˣ => z.1 n) hy + rw [hy', hs] + +theorem relatively_closed_completion_nat_saturated + {E F : Type*} [Field E] [Field F] [Algebra E F] + (hc : RelativelyAlgebraicallyClosed E F) {ell : ℕ} (hell : ell.Prime) + (x : PowerCompletion ell Fˣ) {m : ℕ} (hm : 0 < m) + (hx : ∃ y : PowerCompletion ell Eˣ, + PowerCompletion.map (inclusionUnits E F) y = x ^ m) : + ∃ y : PowerCompletion ell Eˣ, + PowerCompletion.map (inclusionUnits E F) y = x := by + induction m using Nat.strong_induction_on with + | h m ih => + by_cases hd : ell ∣ m + · have hx' : ∃ y : PowerCompletion ell Eˣ, + PowerCompletion.map (inclusionUnits E F) y = (x ^ (m / ell)) ^ ell := by + simpa only [← pow_mul, Nat.div_mul_cancel hd] using hx + exact ih (m / ell) (Nat.div_lt_self hm hell.one_lt) + (Nat.div_pos (Nat.le_of_dvd hm hd) hell.pos) + (relatively_closed_completion_saturated hc hell.pos _ hx') + · exact completion_coprime_saturated hc hell.pos + (hell.coprime_iff_not_dvd.2 hd).symm x hx + +end +end BogomolovPop + +namespace BogomolovPop +noncomputable section +open scoped IntermediateField.algebraAdjoinAdjoin + +theorem independent_powerClass_injective {E N ι : Type*} [Field E] [Field N] + [Algebra E N] {x : ι → N} (hx : AlgebraicIndependent E x) + (q : ℕ) (hq : 0 < q) : + Function.Injective (PowerClass.map + (inclusionUnits E (IntermediateField.adjoin E (Set.range x))) q) := by + let R := Algebra.adjoin E (Set.range x) + let F := IntermediateField.adjoin E (Set.range x) + let : IsIntegrallyClosed R := IsIntegrallyClosed.of_equiv hx.aevalEquiv.toRingEquiv + let f : R →ₐ[E] E := (MvPolynomial.aeval (fun _ : ι => (0 : E))).comp hx.repr + apply (injective_iff_map_eq_one _).2 + intro z hz + induction z using QuotientGroup.induction_on with + | H u => + obtain ⟨v, hv⟩ := PowerClass.mk_eq_one.1 hz + have hv' : (v : F) ^ q = algebraMap E F (u : E) := congrArg Units.val hv + obtain ⟨a, ha⟩ : ∃ a : R, algebraMap R F a = (v : F) := + IsIntegrallyClosed.exists_algebraMap_eq_of_isIntegral_pow hq (by + rw [hv', IsScalarTower.algebraMap_apply E R F] + exact isIntegral_algebraMap) + have hap : a ^ q = algebraMap E R (u : E) := by + apply IsFractionRing.injective R F + simpa only [map_pow, ha, ← IsScalarTower.algebraMap_apply E R F] using hv' + have hfp : f a ^ q = (u : E) := by + rw [← map_pow, hap, f.commutes] + rfl + have hf0 : f a ≠ 0 := by + intro h + exact u.ne_zero (by simpa [h, zero_pow hq.ne'] using hfp.symm) + exact PowerClass.mk_eq_one.2 ⟨Units.mk0 (f a) hf0, Units.ext hfp⟩ + +theorem independent_completion_injective {E N ι : Type*} [Field E] [Field N] + [Algebra E N] {x : ι → N} (hx : AlgebraicIndependent E x) + {ell : ℕ} (hell : 0 < ell) : + Function.Injective (PowerCompletion.map (ell := ell) + (inclusionUnits E (IntermediateField.adjoin E (Set.range x)))) := + PowerCompletion.map_injective _ (fun n => + independent_powerClass_injective hx _ (pow_pos hell n)) + +end +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +theorem inclusionUnits_comp {E F N : Type*} [Field E] [Field F] [Field N] + [Algebra E F] [Algebra F N] [Algebra E N] [IsScalarTower E F N] : + (inclusionUnits F N).comp (inclusionUnits E F) = inclusionUnits E N := by + ext u + exact (IsScalarTower.algebraMap_apply E F N (u : E)).symm + +theorem fg_extension_completion_injective {k E N : Type*} + [Field k] [IsAlgClosed k] [Field E] [Field N] + [Algebra k E] [Algebra k N] [Algebra E N] [IsScalarTower k E N] + [Algebra.EssFiniteType E N] {ell : ℕ} (hell : ell.Prime) : + Function.Injective (PowerCompletion.map (ell := ell) (inclusionUnits E N)) := by + obtain ⟨s, hs⟩ := exists_isTranscendenceBasis E N + let F := IntermediateField.adjoin E (Set.range ((↑) : s → N)) + have : Algebra.EssFiniteType F N := Algebra.EssFiniteType.of_comp E F N + have : Algebra.IsAlgebraic F N := hs.isAlgebraic_field + have : Module.Finite F N := Algebra.finite_of_essFiniteType_of_isAlgebraic + have hp := independent_completion_injective hs.1 hell.pos + have hf := finite_extension_completion_injective (k := k) (E := F) (F := N) hell + have hc := hf.comp hp + change Function.Injective ((PowerCompletion.map (ell := ell) + (inclusionUnits F N)).comp (PowerCompletion.map (inclusionUnits E F))) at hc + simpa only [← MonoidHom.coe_comp, PowerCompletion.map_comp, inclusionUnits_comp] using hc + +end +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +def rationalDegree (k : Type*) [Field k] : (RatFunc k)ˣ →* Multiplicative ℤ where + toFun u := Multiplicative.ofAdd (RatFunc.intDegree (u : RatFunc k)) + map_one' := RatFunc.intDegree_one + map_mul' u v := RatFunc.intDegree_mul u.ne_zero v.ne_zero + +lemma rational_variable_completion_ne_one (ell : ℕ) [Fact ell.Prime] + (k : Type*) [Field k] : + PowerCompletion.of (ell := ell) (Units.mk0 (RatFunc.X : RatFunc k) RatFunc.X_ne_zero) ≠ 1 := by + intro h + have h₁ := congrArg (fun z : PowerCompletion ell (RatFunc k)ˣ => z.val 1) h + change PowerClass.mk (ell ^ 1) (Units.mk0 RatFunc.X RatFunc.X_ne_zero) = 1 at h₁ + rw [pow_one] at h₁ + obtain ⟨u, hu⟩ := PowerClass.mk_eq_one.mp h₁ + have hd := congrArg (rationalDegree k) hu + rw [map_pow] at hd + have hi := congrArg Multiplicative.toAdd hd + change ell • RatFunc.intDegree (u : RatFunc k) = + RatFunc.intDegree (RatFunc.X : RatFunc k) at hi + have hd' : (ell : ℤ) * RatFunc.intDegree (u : RatFunc k) = 1 := by + simpa only [nsmul_eq_mul, RatFunc.intDegree_X] using hi + have hdvd : (ell : ℤ) ∣ 1 := ⟨_, hd'.symm⟩ + exact (Fact.out : ell.Prime).not_dvd_one (Int.natCast_dvd_natCast.mp hdvd) + +lemma transcendental_completion_ne_one (ell : ℕ) [Fact ell.Prime] + (k F : Type*) [Field k] [Field F] [IsAlgClosed k] [Algebra k F] + [Algebra.EssFiniteType k F] (u : Fˣ) (hu : Transcendental k (u : F)) : + PowerCompletion.of (ell := ell) u ≠ 1 := by + let φ : RatFunc k →ₐ[k] F := RatFunc.liftAlgHom (Polynomial.aeval (u : F)) + (nonZeroDivisors_le_comap_nonZeroDivisors_of_injective _ + (transcendental_iff_injective.mp hu)) + let : Algebra (RatFunc k) F := φ.toRingHom.toAlgebra + have : IsScalarTower k (RatFunc k) F := + IsScalarTower.of_algebraMap_eq (fun c => (φ.commutes c).symm) + have : Algebra.EssFiniteType (RatFunc k) F := Algebra.EssFiniteType.of_comp k _ F + have hi := fg_extension_completion_injective (k := k) (E := RatFunc k) (N := F) + (Fact.out : ell.Prime) + have hx : φ RatFunc.X = (u : F) := by + change RatFunc.liftRingHom _ _ (algebraMap (Polynomial k) (RatFunc k) Polynomial.X) = _ + erw [RatFunc.liftRingHom_algebraMap, Polynomial.aeval_X] + have hx' : inclusionUnits (RatFunc k) F + (Units.mk0 RatFunc.X RatFunc.X_ne_zero) = u := Units.ext hx + intro h + apply rational_variable_completion_ne_one ell k + apply hi + rw [map_one, PowerCompletion.map_of, hx', h] + +theorem field_completion_kernel_constants + (ell : ℕ) [Fact ell.Prime] (k F : Type*) + [Field k] [Field F] [IsAlgClosed k] [Algebra k F] + [Algebra.EssFiniteType k F] (u : Fˣ) : + PowerCompletion.of (ell := ell) u = 1 ↔ + ∃ c : kˣ, inclusionUnits k F c = u := by + constructor + · intro h + have ha : IsAlgebraic k (u : F) := by + by_contra ht + exact transcendental_completion_ne_one ell k F u ht h + have he : algebraicClosure k F = ⊥ := + IntermediateField.eq_bot_of_isAlgClosed_of_isAlgebraic _ + have hu' : (u : F) ∈ algebraicClosure k F := mem_algebraicClosure_iff.mpr ha + rw [he] at hu' + obtain ⟨c, hc⟩ := IntermediateField.mem_bot.mp hu' + have hc0 : c ≠ 0 := by + intro h + exact u.ne_zero (by simpa [h] using hc.symm) + exact ⟨Units.mk0 c hc0, Units.ext hc⟩ + · rintro ⟨c, rfl⟩ + apply PowerCompletion.ext + intro n + change PowerClass.mk (ell ^ n) (inclusionUnits k F c) = 1 + obtain ⟨r, hr⟩ := IsAlgClosed.exists_pow_nat_eq (c : k) + (pow_pos (Fact.out : ell.Prime).pos n) + have hr0 : r ≠ 0 := by + intro h + exact c.ne_zero (by simpa [h, zero_pow (pow_pos (Fact.out : ell.Prime).pos n).ne'] using hr.symm) + apply PowerClass.mk_eq_one.mpr + exact ⟨inclusionUnits k F (Units.mk0 r hr0), Units.ext (by + simp only [inclusionUnits, Units.val_pow_eq_pow_val, Units.coe_map, + RingHom.toMonoidHom_eq_coe, MonoidHom.coe_coe, Units.val_mk0, ← map_pow, hr])⟩ + +end +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +def polynomialTotalDegree (k ι : Type*) [Field k] : + MvPolynomial ι k →*₀ WithZero (Multiplicative ℤ) := by + classical + exact { + toFun := fun f => if f = 0 then 0 else ↑(Multiplicative.ofAdd (f.totalDegree : ℤ)) + map_zero' := by simp + map_one' := by simp + map_mul' f g := by + by_cases hf : f = 0 + · simp [hf] + by_cases hg : g = 0 + · simp [hg] + simp only [mul_ne_zero hf hg, hf, hg, ↓reduceIte, + MvPolynomial.totalDegree_mul_of_isDomain hf hg, Nat.cast_add] + rfl } + +lemma polynomialTotalDegree_unit (k ι : Type*) [Field k] + (y : nonZeroDivisors (MvPolynomial ι k)) : IsUnit (polynomialTotalDegree k ι y) := by + apply isUnit_iff_ne_zero.mpr + simp [polynomialTotalDegree, nonZeroDivisors.ne_zero y.property] + +def fractionTotalDegree (k ι : Type*) [Field k] : + FractionRing (MvPolynomial ι k) →*₀ WithZero (Multiplicative ℤ) := + (IsLocalization.toLocalizationMap (nonZeroDivisors (MvPolynomial ι k)) _).lift₀ + (polynomialTotalDegree k ι) (polynomialTotalDegree_unit k ι) + +lemma fractionTotalDegree_algebraMap (k ι : Type*) [Field k] (f : MvPolynomial ι k) : + fractionTotalDegree k ι (algebraMap _ _ f) = polynomialTotalDegree k ι f := by + exact Submonoid.LocalizationMap.lift_eq _ _ _ + +def fractionDegreeUnits (k ι : Type*) [Field k] : + (FractionRing (MvPolynomial ι k))ˣ →* Multiplicative ℤ := + WithZero.unitsWithZeroEquiv.toMonoidHom.comp + (Units.map (fractionTotalDegree k ι).toMonoidHom) + +lemma fractionDegreeUnits_X (k ι : Type*) [Field k] (i : ι) : + fractionDegreeUnits k ι (Units.mk0 (algebraMap (MvPolynomial ι k) (FractionRing (MvPolynomial ι k)) (MvPolynomial.X i)) + (by simp)) = + Multiplicative.ofAdd (1 : ℤ) := by + apply WithZero.coe_injective (α := Multiplicative ℤ) + change (↑(WithZero.unitsWithZeroEquiv (α := Multiplicative ℤ) _) : WithZero (Multiplicative ℤ)) = _ + rw [WithZero.coe_unitsWithZeroEquiv_eq_units_val] + change fractionTotalDegree k ι (algebraMap _ _ (MvPolynomial.X i)) = _ + rw [fractionTotalDegree_algebraMap] + simp [polynomialTotalDegree] + +end +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +theorem transcendental_integer_character (k F : Type*) [Field k] [Field F] + [Algebra k F] [Algebra.EssFiniteType k F] (u : Fˣ) + (hu : Transcendental k (u : F)) : + ∃ d : Fˣ →* Multiplicative ℤ, d u ≠ 1 := by + classical + have hsingleton : AlgebraicIndepOn k id ({(u : F)} : Set F) := by + apply algebraicIndependent_unique_type_iff.mpr + simpa using hu + obtain ⟨s, hs, ht⟩ := exists_isTranscendenceBasis_superset hsingleton + let i : s := ⟨u, hs (Set.mem_singleton _)⟩ + let E := IntermediateField.adjoin k (Set.range ((↑) : s → F)) + have : Algebra.EssFiniteType E F := Algebra.EssFiniteType.of_comp k E F + have : Algebra.IsAlgebraic E F := ht.isAlgebraic_field + have : Module.Finite E F := Algebra.finite_of_essFiniteType_of_isAlgebraic + let ξ : E ≃ₐ[k] FractionRing (MvPolynomial s k) := ht.1.aevalEquivField.symm + let dE : Eˣ →* Multiplicative ℤ := (fractionDegreeUnits k s).comp + (Units.map ξ.toRingHom.toMonoidHom) + let v : Eˣ := Units.mk0 ⟨u, IntermediateField.subset_adjoin k _ ⟨i, rfl⟩⟩ + (by exact fun h => u.ne_zero (congrArg (fun z : E => (z : F)) h)) + have hv : inclusionUnits E F v = u := by ext; rfl + have hx : ξ (v : E) = algebraMap (MvPolynomial s k) (FractionRing (MvPolynomial s k)) (MvPolynomial.X i) := by + apply ξ.symm.injective + rw [ξ.symm_apply_apply] + apply Subtype.ext + change (u : F) = ((ht.1.aevalEquivField (algebraMap _ _ (MvPolynomial.X i))) : F) + rw [ht.1.aevalEquivField_algebraMap_apply_coe, MvPolynomial.aeval_X] + have hdE : dE v = Multiplicative.ofAdd (1 : ℤ) := by + change fractionDegreeUnits k s (Units.map ξ.toRingHom.toMonoidHom v) = _ + have he : Units.map ξ.toRingHom.toMonoidHom v = Units.mk0 + (algebraMap (MvPolynomial s k) (FractionRing (MvPolynomial s k)) (MvPolynomial.X i)) + (by simp) := Units.ext hx + rw [he, fractionDegreeUnits_X] + let d := dE.comp (normUnits E F) + refine ⟨d, ?_⟩ + have hd : d u = Multiplicative.ofAdd (Module.finrank E F : ℤ) := by + rw [← hv] + have hn : normUnits E F (inclusionUnits E F v) = v ^ Module.finrank E F := by + apply Units.ext + exact Algebra.norm_algebraMap (v : E) + change dE (normUnits E F _) = _ + rw [hn, map_pow, hdE] + apply Multiplicative.toAdd.injective + simp + rw [hd] + intro heq + have hzero := congrArg Multiplicative.toAdd heq + change (Module.finrank E F : ℤ) = 0 at hzero + exact (Module.finrank_pos (R := E) (M := F)).ne' (Int.natCast_eq_zero.mp hzero) + +end +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +def KummerScalarLevels (ell : ℕ) [Fact ell.Prime] {G : Type*} [CommGroup G] + (a : PadicInt ell) (x y : G) : Prop := + ∀ n, PowerClass.mk (ell ^ n) y = (PowerClass.mk (ell ^ n) x) ^ a.appr n + +lemma integer_character_scalar (ell : ℕ) [Fact ell.Prime] + {G : Type*} [CommGroup G] (d : G →* Multiplicative ℤ) + {a : PadicInt ell} {x y : G} (h : KummerScalarLevels ell a x y) : + (↑(Multiplicative.toAdd (d y)) : PadicInt ell) = + a * (↑(Multiplicative.toAdd (d x)) : PadicInt ell) := by + apply PadicInt.ext_of_toZModPow.mp + intro n + have heq := h n + rw [← map_pow, ← div_eq_one, ← map_div] at heq + obtain ⟨z, hz⟩ := PowerClass.mk_eq_one.mp heq + have hz' := congrArg d hz + rw [map_pow, map_div, map_pow] at hz' + have hi := congrArg Multiplicative.toAdd hz' + have hi' : (ell ^ n : ℤ) * Multiplicative.toAdd (d z) = + Multiplicative.toAdd (d y) - a.appr n * Multiplicative.toAdd (d x) := by + simpa only [toAdd_pow, toAdd_div, nsmul_eq_mul, Nat.cast_pow] using hi + have hzmod : (↑(Multiplicative.toAdd (d y)) : ZMod (ell ^ n)) = + (a.appr n : ZMod (ell ^ n)) * (↑(Multiplicative.toAdd (d x)) : ZMod (ell ^ n)) := by + apply sub_eq_zero.mp + have hd : (ell ^ n : ℤ) ∣ Multiplicative.toAdd (d y) - + a.appr n * Multiplicative.toAdd (d x) := ⟨_, hi'.symm⟩ + have := (ZMod.intCast_zmod_eq_zero_iff_dvd _ _).mpr hd + simpa only [Int.cast_sub, Int.cast_mul, Int.cast_natCast] using this + simpa only [map_intCast, map_mul, PadicInt.toZModPow, PadicInt.toZModHom, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk] using hzmod + +theorem kummer_scalar_rational (ell : ℕ) [Fact ell.Prime] + (k F : Type*) [Field k] [Field F] [Algebra k F] + [Algebra.EssFiniteType k F] {a : PadicInt ell} {x y : Fˣ} + (hx : Transcendental k (x : F)) (h : KummerScalarLevels ell a x y) : + ∃ r s : ℤ, s ≠ 0 ∧ (r : PadicInt ell) = a * (s : PadicInt ell) := by + obtain ⟨d, hd⟩ := transcendental_integer_character k F x hx + refine ⟨Multiplicative.toAdd (d y), Multiplicative.toAdd (d x), ?_, + integer_character_scalar ell d h⟩ + intro hz + apply hd + apply Multiplicative.toAdd.injective + exact hz + +end +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +lemma exponent_eq_of_zmod {G : Type*} [CommGroup G] (x : G) (q : ℕ) + (hx : x ^ q = 1) {r s : ℤ} (hrs : (r : ZMod q) = (s : ZMod q)) : + x ^ r = x ^ s := by + have hd : (q : ℤ) ∣ r - s := (ZMod.intCast_zmod_eq_zero_iff_dvd (r - s) q).mp + (by simpa using sub_eq_zero.mpr hrs) + obtain ⟨t, ht⟩ := hd + rw [← div_eq_one, div_eq_mul_inv, ← zpow_sub, ht, zpow_mul, zpow_natCast, hx, one_zpow] + +theorem kummer_scalar_power_constants (ell : ℕ) [Fact ell.Prime] + (k F : Type*) [Field k] [Field F] [IsAlgClosed k] [Algebra k F] + [Algebra.EssFiniteType k F] {a : PadicInt ell} {x y : Fˣ} + (h : KummerScalarLevels ell a x y) {r s : ℤ} + (hrs : (r : PadicInt ell) = a * (s : PadicInt ell)) : + ∃ c : kˣ, inclusionUnits k F c = y ^ s / x ^ r := by + apply (field_completion_kernel_constants ell k F _).mp + apply PowerCompletion.ext + intro n + change PowerClass.mk (ell ^ n) (y ^ s / x ^ r) = 1 + rw [map_div, map_zpow, map_zpow, h n] + have he : (↑((a.appr n : ℤ) * s) : ZMod (ell ^ n)) = (r : ZMod (ell ^ n)) := by + have hh := congrArg (PadicInt.toZModPow n) hrs.symm + simpa only [map_mul, map_intCast, Int.cast_mul, Int.cast_natCast, PadicInt.toZModPow, PadicInt.toZModHom, + RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk] using hh + rw [← zpow_natCast, ← zpow_mul, exponent_eq_of_zmod _ _ (PowerClass.pow_eq_one _ _) he, + div_self'] + +end +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +lemma cyclic_character_scalar_integer (ell : ℕ) [Fact ell.Prime] + {G : Type*} [CommGroup G] (φ : G →* G) (d : G →* Multiplicative ℤ) + {a : PadicInt ell} (hd : ∃ x, d x ≠ 1) + (h : ∀ u, KummerScalarLevels ell a u (φ u)) : ∃ m : ℤ, a = m := by + obtain ⟨g, hg⟩ := IsCyclic.exists_generator (α := d.range) + obtain ⟨x, hx⟩ := g.property + have hgne : (g : Multiplicative ℤ) ≠ 1 := by + intro he + obtain ⟨z, hz⟩ := hd + obtain ⟨n, hn⟩ := hg ⟨d z, ⟨z, rfl⟩⟩ + have hh := congrArg (fun t : d.range => (t : Multiplicative ℤ)) hn + simp only [Subgroup.coe_zpow, he, one_zpow] at hh + exact hz hh.symm + obtain ⟨m, hm⟩ := hg ⟨d (φ x), ⟨φ x, rfl⟩⟩ + have hm' := congrArg (fun t : d.range => Multiplicative.toAdd (t : Multiplicative ℤ)) hm + have hm'' : m * Multiplicative.toAdd (d x) = Multiplicative.toAdd (d (φ x)) := by + simpa only [Subgroup.coe_zpow, ← hx, toAdd_zpow, zsmul_eq_mul, Int.cast_id] using hm' + have hc := integer_character_scalar ell d (h x) + have hn : Multiplicative.toAdd (d x) ≠ 0 := by + intro hh + apply hgne + rw [← hx] + exact Multiplicative.toAdd.injective hh + refine ⟨m, ?_⟩ + apply mul_right_cancel₀ (Int.cast_ne_zero.mpr hn : (↑(Multiplicative.toAdd (d x)) : PadicInt ell) ≠ 0) + rw [← hc, ← hm'', Int.cast_mul] + +theorem kummer_endomorphism_scalar_integer (ell : ℕ) [Fact ell.Prime] + (k F : Type*) [Field k] [Field F] [Algebra k F] + [Algebra.EssFiniteType k F] (φ : F →+* F) {a : PadicInt ell} + (hx : ∃ x : Fˣ, Transcendental k (x : F)) + (h : ∀ u : Fˣ, KummerScalarLevels ell a u (Units.map φ.toMonoidHom u)) : + ∃ m : ℤ, a = m := by + obtain ⟨x, hx⟩ := hx + obtain ⟨d, hd⟩ := transcendental_integer_character k F x hx + exact cyclic_character_scalar_integer ell (Units.map φ.toMonoidHom) d ⟨x, hd⟩ h + +end +end BogomolovPop +noncomputable section +namespace BogomolovPop + +def IntegerPowerModuloConstants (k F : Type*) [Field k] [Field F] [Algebra k F] + (φ : F →+* F) (m : ℤ) : Prop := + ∀ u : Fˣ, ∃ c : kˣ, φ (u : F) = algebraMap k F (c : k) * (u : F) ^ m + +open Polynomial + +lemma transcendental_ne_zero {k F : Type*} [Field k] [Field F] [Algebra k F] + {x : F} (hx : Transcendental k x) : x ≠ 0 := by + rintro rfl + exact hx isAlgebraic_zero + +lemma transcendental_add_constant {k F : Type*} [Field k] [Field F] [Algebra k F] + {x : F} (hx : Transcendental k x) (c : k) : + Transcendental k (x + algebraMap k F c) := by + intro h + apply hx + simpa using h.sub (isIntegral_algebraMap (x := c)).isAlgebraic + +lemma integer_power_shift_nonneg {k F : Type*} [Field k] [Field F] [Algebra k F] + {x : F} (hx : Transcendental k x) (a b : k) (ha : a ≠ 0) {m : ℤ} + (h : algebraMap k F a * x ^ m + 1 = algebraMap k F b * (x + 1) ^ m) : + 0 ≤ m := by + have hx0 := transcendental_ne_zero hx + have hx1 : x + 1 ≠ 0 := by + simpa using transcendental_ne_zero (transcendental_add_constant hx (1 : k)) + cases m with + | ofNat n => exact Int.natCast_nonneg _ + | negSucc n => + simp only [zpow_negSucc] at h + have he : algebraMap k F a * (x + 1) ^ (n + 1) + + x ^ (n + 1) * (x + 1) ^ (n + 1) = algebraMap k F b * x ^ (n + 1) := by + field_simp [hx0, hx1] at h + linear_combination h + have hp : C a * (X + 1) ^ (n + 1) + X ^ (n + 1) * (X + 1) ^ (n + 1) = + C b * X ^ (n + 1) := by + apply (transcendental_iff_injective.mp hx) + simpa using he + have hc := congrArg (Polynomial.eval (0 : k)) hp + simp at hc + exact (ha hc).elim + +lemma positive_power_shift {k F : Type*} [Field k] [Field F] [Algebra k F] + {x : F} (hx : Transcendental k x) (a b : k) {n : ℕ} (hn : 0 < n) + (h : algebraMap k F a * x ^ n + 1 = algebraMap k F b * (x + 1) ^ n) : + a = 1 ∧ b = 1 ∧ (X + 1 : k[X]) ^ n = X ^ n + 1 := by + have hp : C a * X ^ n + 1 = C b * (X + 1 : k[X]) ^ n := by + apply transcendental_iff_injective.mp hx + simpa using h + have hb := congrArg (Polynomial.eval (0 : k)) hp + simp [Nat.ne_of_gt hn] at hb + have ha := congrArg (fun p : k[X] => p.coeff n) hp + simp [Nat.ne_of_gt hn, coeff_X_add_one_pow, coeff_one] at ha + have ha1 : a = 1 := ha.trans hb.symm + refine ⟨ha1, hb.symm, ?_⟩ + simpa [ha1, hb.symm] using hp.symm + +lemma power_relation_shift {k F : Type*} [Field k] [Field F] [Algebra k F] + (φ : F →+* F) {m : ℤ} (h : IntegerPowerModuloConstants k F φ m) + {x : F} (hx : Transcendental k x) : + ∃ a b : kˣ, φ x = algebraMap k F (a : k) * x ^ m ∧ + algebraMap k F (a : k) * x ^ m + 1 = + algebraMap k F (b : k) * (x + 1) ^ m := by + obtain ⟨a, ha⟩ := h (Units.mk0 x (transcendental_ne_zero hx)) + have hx1 : x + 1 ≠ 0 := by + simpa using transcendental_ne_zero (transcendental_add_constant hx (1 : k)) + obtain ⟨b, hb⟩ := h (Units.mk0 (x + 1) hx1) + simp only [Units.val_mk0] at ha hb + refine ⟨a, b, ha, ?_⟩ + simpa only [Units.val_mk0, map_add, map_one, ha] using hb + +lemma power_endomorphism_transcendental {k F : Type*} [Field k] [Field F] [Algebra k F] + (φ : F →+* F) {n : ℕ} (hn : 0 < n) + (h : IntegerPowerModuloConstants k F φ (n : ℤ)) + {x : F} (hx : Transcendental k x) : + φ x = x ^ n ∧ (X + 1 : k[X]) ^ n = X ^ n + 1 := by + obtain ⟨a, b, ha, hab⟩ := power_relation_shift φ h hx + simp only [zpow_natCast] at ha hab + obtain ⟨ha1, _, hp⟩ := positive_power_shift hx (a : k) (b : k) hn hab + exact ⟨by simpa [ha1] using ha, hp⟩ + +lemma polynomial_power_prime (k F : Type*) [Field k] [Field F] [Algebra k F] + {n : ℕ} (hn : 0 < n) (hp : (X + 1 : k[X]) ^ n = X ^ n + 1) : + n = 1 ∨ ∃ p r : ℕ, p.Prime ∧ (p : F) = 0 ∧ n = p ^ r := by + have hcoeff : ∀ i, 0 < i → i < n → (n.choose i : k) = 0 := by + intro i hi hin + have he := congrArg (fun q : k[X] => q.coeff i) hp + simpa [coeff_X_add_one_pow, coeff_X_pow, coeff_one, Nat.ne_of_gt hi, + Nat.ne_of_lt hin] using he + obtain ⟨p, hchar⟩ := CharP.exists k + let := hchar + rcases CharP.char_is_prime_or_zero k p with hprime | rfl + · let : Fact p.Prime := ⟨hprime⟩ + right + refine ⟨p, multiplicity p n, hprime, ?_, ?_⟩ + · have hc : (p : k) = 0 := (CharP.cast_eq_zero_iff k p p).mpr dvd_rfl + simpa only [map_natCast, map_zero] using congrArg (algebraMap k F) hc + · apply Choose.eq_pow_multiplicity_of_choose_modEq_zero_nat hn + intro i hi + apply Nat.modEq_zero_iff_dvd.mpr + apply (CharP.cast_eq_zero_iff k p _).mp + exact hcoeff i (by have := (Finset.mem_Icc.mp hi).1; omega) + (by have := (Finset.mem_Icc.mp hi).2; omega) + · left + by_contra hne + have hc := hcoeff 1 (by omega) (by omega) + simp only [Nat.choose_one_right] at hc + have : 0 ∣ n := (CharP.cast_eq_zero_iff k 0 n).mp hc + exact (Nat.ne_of_gt hn) (zero_dvd_iff.mp this) + +lemma algebraic_is_constant {k F : Type*} [Field k] [Field F] [Algebra k F] + [IsAlgClosed k] {x : F} (hx : IsAlgebraic k x) : ∃ c : k, algebraMap k F c = x := by + have he : algebraicClosure k F = ⊥ := + IntermediateField.eq_bot_of_isAlgClosed_of_isAlgebraic _ + have hx' : x ∈ algebraicClosure k F := mem_algebraicClosure_iff.mpr hx + rw [he] at hx' + exact IntermediateField.mem_bot.mp hx' + +lemma power_endomorphism_constants {k F : Type*} [Field k] [Field F] [Algebra k F] + (φ : F →+* F) {n : ℕ} (hn : 0 < n) + (h : IntegerPowerModuloConstants k F φ (n : ℤ)) + {t : F} (ht : Transcendental k t) (c : k) : + φ (algebraMap k F c) = (algebraMap k F c) ^ n := by + by_cases hc : c = 0 + · simp [hc, Nat.ne_of_gt hn] + obtain ⟨d, hd⟩ := h (Units.map (algebraMap k F).toMonoidHom (Units.mk0 c hc)) + have hd' : φ (algebraMap k F c) = algebraMap k F ((d : k) * c ^ n) := by + simpa only [Units.coe_map, RingHom.toMonoidHom_eq_coe, MonoidHom.coe_coe, + Units.val_mk0, zpow_natCast, map_mul, map_pow] using hd + have ht' := (power_endomorphism_transcendental φ hn h ht).1 + have hc' := (power_endomorphism_transcendental φ hn h + (transcendental_add_constant ht c)).1 + have hp : (X + C c : k[X]) ^ n = X ^ n + C ((d : k) * c ^ n) := by + apply transcendental_iff_injective.mp ht + simpa only [map_pow, map_add, aeval_X, aeval_C, ← ht', ← hd'] using hc'.symm + have hz := congrArg (Polynomial.eval (0 : k)) hp + simp only [eval_pow, eval_add, eval_X, eval_C, zero_add, zero_pow (Nat.ne_of_gt hn)] at hz + rw [hd', ← hz, map_pow] + + theorem integer_power_endomorphism_rigid + (k F : Type*) [Field k] [Field F] [Algebra k F] [IsAlgClosed k] + (φ : F →+* F) {m : ℤ} (hm : m ≠ 0) + (ht : ∃ x : F, Transcendental k x) + (h : IntegerPowerModuloConstants k F φ m) : + ∃ n : ℕ, m = n ∧ (∀ x : F, φ x = x ^ n) ∧ + (n = 1 ∨ ∃ p r : ℕ, p.Prime ∧ (p : F) = 0 ∧ n = p ^ r) := by + obtain ⟨t, ht⟩ := ht + obtain ⟨a, b, _, hab⟩ := power_relation_shift φ h ht + have hmpos : 0 ≤ m := integer_power_shift_nonneg ht (a : k) (b : k) a.ne_zero hab + lift m to ℕ using hmpos with n + have hn : 0 < n := by omega + refine ⟨n, rfl, ?_, polynomial_power_prime k F hn + (power_endomorphism_transcendental φ hn h ht).2⟩ + intro x + by_cases hx : IsAlgebraic k x + · obtain ⟨c, rfl⟩ := algebraic_is_constant hx + exact power_endomorphism_constants φ hn h ht c + · exact (power_endomorphism_transcendental φ hn h hx).1 + +end BogomolovPop + +namespace BogomolovPop +noncomputable section + +theorem kummer_endomorphism_frobenius (ell : ℕ) [Fact ell.Prime] + (k F : Type*) [Field k] [Field F] [Algebra k F] [IsAlgClosed k] + [Algebra.EssFiniteType k F] (φ : F →+* F) (a : (PadicInt ell)ˣ) + (hx : ∃ x : F, Transcendental k x) + (h : ∀ u : Fˣ, KummerScalarLevels ell (a : PadicInt ell) u + (Units.map φ.toMonoidHom u)) : + φ = RingHom.id F ∨ ∃ p r : ℕ, p.Prime ∧ (p : F) = 0 ∧ + ∀ x : F, φ x = x ^ (p ^ r) := by + obtain ⟨m, hm⟩ := kummer_endomorphism_scalar_integer ell k F φ + (by obtain ⟨x, hx⟩ := hx; exact ⟨Units.mk0 x (transcendental_ne_zero hx), hx⟩) h + have hm0 : m ≠ 0 := by + intro hh + apply a.ne_zero + simpa only [hh, Int.cast_zero] using hm + have hp : IntegerPowerModuloConstants k F φ m := by + intro u + obtain ⟨c, hc⟩ := kummer_scalar_power_constants ell k F (h u) + (r := m) (s := 1) (by simpa using hm.symm) + have he := congrArg Units.val hc + simp only [inclusionUnits, Units.coe_map, RingHom.toMonoidHom_eq_coe, + MonoidHom.coe_coe, Units.val_div_eq_div_val, zpow_one, Units.val_zpow_eq_zpow_val] at he + exact ⟨c, (eq_div_iff (zpow_ne_zero _ u.ne_zero)).mp he |>.symm⟩ + obtain ⟨n, _, hφ, hn⟩ := integer_power_endomorphism_rigid k F φ hm0 hx hp + rcases hn with rfl | ⟨p, r, hprime, hchar, rfl⟩ + · left + ext x + simpa using hφ x + · exact Or.inr ⟨p, r, hprime, hchar, hφ⟩ + +end +end BogomolovPop + +end +end +end + +end OAI diff --git a/lean/OAI/Algebra/Cohomology/SemilinearCochains.lean b/lean/OAI/Algebra/Cohomology/SemilinearCochains.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d608cca52b79a20310407d7fbbc7fd5df143944 --- /dev/null +++ b/lean/OAI/Algebra/Cohomology/SemilinearCochains.lean @@ -0,0 +1,254 @@ +import Mathlib + +namespace OAI + +/-! Degree exclusions, separated filtrations, kernel obstructions, and contraction of semilinear homogeneous cochains. -/ + +namespace NamedPrimeFiveSupport + +theorem no_incoming_monomial + (r : ℤ) (hr : 2 ≤ r) (a b : ℕ) (ha : a ≤ 1) (l : ℤ) : + ¬ ((a : ℤ) + 2 * b = 32 - r ∧ + 8 * (a : ℤ) + 40 * b + 160 * l = 641 - r) := by + rintro ⟨hs, hq⟩ + have hab : (a : ℤ) ≤ 1 := by exact_mod_cast ha + have ha0 : 0 ≤ (a : ℤ) := by omega + have hb0 : 0 ≤ (b : ℤ) := by omega + omega + +theorem incoming_congruence (r l : ℤ) (h : 160 * l = 13 + 19 * r) : + r % 160 = 33 := by + omega + +theorem no_incoming_odd_degree (r l : ℤ) (hr : 3 ≤ r) (hr' : r ≤ 31) : + 160 * l ≠ 13 + 19 * r := by + intro h + have := incoming_congruence r l h + omega + +theorem filtration_zero_source_is_odd : Odd (641 - 32 : ℤ) := by + norm_num + +theorem source_filtration_zero (r : ℤ) (h : 32 - r = 0) : + r = 32 ∧ Odd (641 - r) := by + have hr : r = 32 := by omega + exact ⟨hr, hr ▸ filtration_zero_source_is_odd⟩ + +theorem power_degrees : + (38 * 16 : ℕ) = 608 ∧ (40 * 16 : ℕ) = 640 ∧ + (2 * 16 : ℕ) = 32 ∧ (640 - 32 : ℤ) = 608 := by + norm_num + +section Filtration + +variable {L : Type*} [CompleteLattice L] + +theorem tail_eq_bot {F : ℕ → L} (hmono : Antitone F) + (hsep : (⨅ s, F s) = ⊥) {N : ℕ} + (hstable : ∀ s, N ≤ s → F s = F (s + 1)) : + F N = ⊥ := by + have hc (d : ℕ) : F (N + d) = F N := by + induction d with + | zero => simp + | succ d ih => + exact (hstable (N + d) (by omega)).symm.trans ih + apply le_antisymm _ bot_le + rw [← hsep] + apply le_iInf + intro s + rcases le_total s N with hs | hs + · exact hmono hs + · obtain ⟨d, rfl⟩ := Nat.exists_eq_add_of_le hs + exact (hc d).ge + +theorem later_eq_bot {F : ℕ → L} (hmono : Antitone F) + (hsep : (⨅ s, F s) = ⊥) {N : ℕ} + (hstable : ∀ s, N ≤ s → F s = F (s + 1)) + {s : ℕ} (hs : N ≤ s) : F s = ⊥ := by + apply le_antisymm _ bot_le + calc + F s ≤ F N := hmono hs + _ = ⊥ := tail_eq_bot hmono hsep hstable + +end Filtration + +section FilteredPowers + +variable {R : Type*} [Ring R] + +theorem power_mem (F : ℕ → AddSubgroup R) + (hone : (1 : R) ∈ F 0) + (hmul : ∀ {i j : ℕ} {x y : R}, x ∈ F i → y ∈ F j → x * y ∈ F (i + j)) + {s : ℕ} {x : R} (hx : x ∈ F s) (n : ℕ) : + x ^ n ∈ F (s * n) := by + induction n with + | zero => simpa using hone + | succ n ih => simpa only [pow_succ, Nat.mul_succ] using hmul ih hx + +theorem sixteenth_power_zero_of_filtration + (F : ℕ → AddSubgroup R) (hmono : Antitone F) + (hsep : (⨅ s, F s) = ⊥) + (hstable : ∀ s, 27 ≤ s → F s = F (s + 1)) + (hone : (1 : R) ∈ F 0) + (hmul : ∀ {i j : ℕ} {x y : R}, x ∈ F i → y ∈ F j → x * y ∈ F (i + j)) + {x : R} (hx : x ∈ F 2) : x ^ 16 = 0 := by + have hmem := power_mem F hone hmul hx 16 + have hbot : F (2 * 16) = ⊥ := later_eq_bot hmono hsep hstable (by norm_num) + rw [hbot] at hmem + exact hmem + +end FilteredPowers + +section Kernel + +variable {A B : Type*} [AddGroup A] [AddGroup B] + +theorem no_left_inverse (f : A →+ B) {x : A} + (hx : x ≠ 0) (hfx : f x = 0) : + ¬ ∃ r : B → A, Function.LeftInverse r f := by + rintro ⟨r, hr⟩ + apply hx + apply hr.injective + exact hfx.trans (map_zero f).symm + +variable {S D U T : Type*} + [AddGroup S] [AddGroup D] [AddGroup U] [AddGroup T] + +theorem kernel_from_factorization + (c : S →+ A) (d : S →+ D) (v : A →+ D) + (u : S →+ U) (j : U →+ T) (i : A →+ T) + (hfactor : v.comp c = d) (hsquare : i.comp c = j.comp u) + {z : S} (hd : d z ≠ 0) (hu : u z = 0) : + c z ≠ 0 ∧ i (c z) = 0 ∧ + ¬ ∃ r : T → A, Function.LeftInverse r i := by + have hcz : c z ≠ 0 := by + intro hz + apply hd + have h := DFunLike.congr_fun hfactor z + simpa [hz] using h.symm + have hic : i (c z) = 0 := by + have h := DFunLike.congr_fun hsquare z + simpa [hu] using h + exact ⟨hcz, hic, no_left_inverse i hcz hic⟩ + +end Kernel + +open CategoryTheory + +theorem no_retraction_of_detected_kernel + {C : Type*} [Category C] (P : C ⥤ AddCommGrpCat) + {A B : C} (f : A ⟶ B) {z : P.obj A} + (hz : z ≠ 0) (hfz : P.map f z = 0) : + ¬ ∃ r : B ⟶ A, f ≫ r = 𝟙 A := by + rintro ⟨r, hr⟩ + apply hz + have h := congrArg (fun k : A ⟶ A => P.map k z) hr + simpa [hfz] using h.symm + +end NamedPrimeFiveSupport + +noncomputable section +namespace SemilinearTraceSupport + +open Finset + +variable {Q W P : Type*} [Group Q] [Fintype Q] + [CommRing W] [AddCommGroup P] [Module W P] + [MulSemiringAction Q W] [DistribMulAction Q P] + [SMulDistribClass Q W P] + +abbrev Cochain (Q P : Type*) (n : ℕ) := (Fin (n + 1) → Q) → P + +def delta {n : ℕ} (f : Cochain Q P n) : Cochain Q P (n + 1) := + fun gs => ∑ i : Fin (n + 2), (-1 : ℤ) ^ i.val • f (gs ∘ i.succAbove) + +def Equivariant {n : ℕ} (f : Cochain Q P n) : Prop := + ∀ (g : Q) (gs : Fin (n + 1) → Q), f (fun i => g * gs i) = g • f gs + +def contract (w : W) {n : ℕ} (f : Cochain Q P (n + 1)) : Cochain Q P n := + fun gs => ∑ g : Q, (g • w) • f (Fin.cons g gs) + +omit [Group Q] [Fintype Q] [DistribMulAction Q P] in +lemma delta_cons {n : ℕ} (f : Cochain Q P (n + 1)) (g : Q) + (gs : Fin (n + 2) → Q) : + delta f (Fin.cons g gs) = + f gs - ∑ i : Fin (n + 2), (-1 : ℤ) ^ i.val • f (Fin.cons g (gs ∘ i.succAbove)) := by + rw [delta, Fin.sum_univ_succ] + have h₀ : Fin.cons g gs ∘ (0 : Fin (n + 3)).succAbove = gs := by + funext i + simp + rw [h₀] + simp only [Fin.val_zero, pow_zero, one_zsmul, sub_eq_add_neg, ← Finset.sum_neg_distrib] + congr 1 + apply Finset.sum_congr rfl + intro i hi + rw [Fin.val_succ, pow_succ, mul_neg_one, neg_smul] + congr 2 + apply congrArg f + funext j + refine Fin.cases ?_ (fun k => ?_) j + · simp + · simp + +omit [Fintype Q] in + +theorem delta_equivariant {n : ℕ} {f : Cochain Q P n} (hf : Equivariant f) : + Equivariant (delta f) := by + intro g gs + simp only [delta, Finset.smul_sum] + apply Finset.sum_congr rfl + intro i hi + change (-1 : ℤ) ^ i.val • f (fun j => g * gs (i.succAbove j)) = _ + rw [hf] + exact smul_comm _ _ _ + +theorem contract_equivariant (w : W) {n : ℕ} {f : Cochain Q P (n + 1)} + (hf : Equivariant f) : Equivariant (contract w f) := by + intro q gs + dsimp only [contract] + rw [← Equiv.sum_comp (Equiv.mulLeft q) + (fun g : Q => (g • w) • f (Fin.cons g (fun i => q * gs i)))] + rw [Finset.smul_sum] + apply Finset.sum_congr rfl + intro g hg + have he : (Fin.cons (q * g) (fun i => q * gs i) : Fin (n + 2) → Q) = + fun i => q * (Fin.cons g gs : Fin (n + 2) → Q) i := by + funext i + refine Fin.cases ?_ (fun j => ?_) i <;> simp + change ((q * g) • w) • f (Fin.cons (q * g) (fun i => q * gs i)) = _ + rw [he, hf, mul_smul] + exact (smul_distrib_smul q (g • w) (f (Fin.cons g gs))).symm + +omit [SMulDistribClass Q W P] [DistribMulAction Q P] in + +theorem contract_identity (w : W) (hw : ∑ g : Q, g • w = 1) + {n : ℕ} (f : Cochain Q P (n + 1)) (gs : Fin (n + 2) → Q) : + delta (contract w f) gs + contract w (delta f) gs = f gs := by + have h : contract w (delta f) gs = f gs - delta (contract w f) gs := by + simp only [contract, delta_cons, smul_sub, Finset.sum_sub_distrib] + rw [← Finset.sum_smul, hw, one_smul] + congr 1 + simp only [delta, contract, Finset.smul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i hi + apply Finset.sum_congr rfl + intro g hg + exact smul_comm _ _ _ + rw [h] + abel + +theorem equivariant_cocycle_is_boundary (w : W) (hw : ∑ g : Q, g • w = 1) + {n : ℕ} (f : Cochain Q P (n + 1)) (hf : Equivariant f) + (hc : delta f = 0) : + ∃ b : Cochain Q P n, Equivariant b ∧ delta b = f := by + refine ⟨contract w f, contract_equivariant w hf, ?_⟩ + funext gs + have h := contract_identity w hw f gs + simpa [hc, contract] using h + +end SemilinearTraceSupport + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ActualBalancedWordSum.lean b/lean/OAI/Algebra/DepthFive/ActualBalancedWordSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..b15088505036382481fb4f9ced17d28fa26b6b81 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ActualBalancedWordSum.lean @@ -0,0 +1,28 @@ +import OAI.Algebra.DepthFive.BalancedWordSum +import OAI.Algebra.DepthFive.WordWeightParameters + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335.LowerParameters + +/-- The complete corrected path-word estimate at the actual lower-bound +parameters and balanced schedule. There are no remaining weight assumptions. -/ +theorem actual_balanced_word_sum_bound {n : ℕ} (hn : 16 ≤ n) : + (∑ w : Fin n → Bool, + IsolatedWeight.weight (BalancedSchedule.internalEdges n) + (Finset.univ.filter (fun i => balancedLayer (show 4 ≤ n by omega) i = true)) + BalancedSchedule.adjacent (alpha n)⁻¹ (beta n) ((n : ℝ)⁻¹) w) ≤ + Real.exp (8 * Real.sqrt (n : ℝ)) := by + have hn4 : 4 ≤ n := by omega + exact balanced_word_sum_bound hn4 (alpha_pos hn4) (alpha_lt_one hn4).le + (inv_alpha_le_sqrt hn4) (beta_pos hn4).le (beta_le_rpow_mul_exp_two_div hn) + (alpha_run_scale_le hn4) (by positivity) (word_error_mul_n_le_sqrt hn) + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ActualCircuitRank.lean b/lean/OAI/Algebra/DepthFive/ActualCircuitRank.lean new file mode 100644 index 0000000000000000000000000000000000000000..ffd8fc41b3653bbf94824929c4d7e916c8d2465c --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ActualCircuitRank.lean @@ -0,0 +1,83 @@ +import OAI.Algebra.DepthFive.ActualProductRank +import OAI.Algebra.DepthFive.CircuitWeightBound +import OAI.Algebra.DepthFive.CircuitOutputDegree +import OAI.Algebra.DepthFive.ActualWeightParameters +import OAI.Algebra.DepthFive.ConfiguredRankData + +namespace OAI + +/-! The circuit rank bound for the actual rounded parameters. -/ +noncomputable section + +namespace Problem335.LowerParameters + +/-- The full quantitative circuit estimate with actual source degrees and +dimension. The weight-parameter premise is discharged uniformly eventually. -/ +theorem actual_circuit_rank_bound_of_weightParameters + {K : Type*} [Field K] {n : ℕ} (c : Depth5Circuit K n) + (side : (Fin n × Fin n × Fin n) → Bool) + (hvcard : Fintype.card {x // side x = true} = v n) + (hucard : Fintype.card {x // side x = false} = u n) + (hp : WeightParameters n (s n) (q n)) + (hc : circuitValue c = imm K n) : + (bidegreeRank side (a n) (b n) (k n) (m n) (circuitValue c) : ℝ) ≤ + 2 * (circuitSize c : ℝ) ^ 2 * sourceDimension n * + Real.exp ((24 + 4 * Real.log 5) * Real.sqrt n) * + (n : ℝ) ^ (-Real.sqrt n / 100) := by + have hn4 : 4 ≤ n := by have := hp.large; omega + have hnpos : 0 < n := by omega + let R := fun p : MvPolynomial (Fin n × Fin n × Fin n) K => + (bidegreeRank side (a n) (b n) (k n) (m n) p : ℝ) + have hprod : HomogeneousProductRankBound R n (q n) (lambda n) + (sourceDimension n) := by + exact actual_homogeneousProductRankBound hn4 side hvcard hucard + have hzero : R 0 = 0 := by simp [R] + have hadd : ∀ p r, R (p + r) ≤ R p + R r := by + intro p r + dsimp [R] + exact_mod_cast bidegreeRank_add_le side (a n) (b n) (k n) (m n) p r + have hscale : ∀ z p, R (MvPolynomial.C z * p) ≤ R p := by + intro z p + dsimp [R, bidegreeRank] + rw [MvPolynomial.C_mul'] + exact_mod_cast RankMeasure.measure_smul_le + (bidegreeOperatorFamily side (a n) (b n) (k n) (m n)) z p + exact circuit_rank_bound_from_product_rank c R hzero hadd hscale + (s n) (q n) (sourceDimension n) hp (sourceDimension_pos hn4).le + (outputDegree_eq_of_circuitValue_eq_imm hnpos c hc) + (by simpa only [lambda_eq_half_sub hnpos] using hprod) + +/-- The actual, fixed rank measure satisfies the circuit upper bound after +one absolute threshold. No numerical, product-rank, or partition hypotheses +remain. This is the upper estimate used in the final rank sandwich. -/ +theorem exists_rankData_circuit_upper_cutoff : + ∃ n₀ : ℕ, ∀ n : ℕ, n₀ ≤ n → ∀ c : Depth5Circuit ℂ n, + circuitValue c = imm ℂ n → + rankData n (circuitValue c) ≤ + 2 * (circuitSize c : ℝ) ^ 2 * rankDimension n * + Real.exp ((24 + 4 * Real.log 5) * Real.sqrt n) * + (n : ℝ) ^ (-Real.sqrt n / 100) := by + obtain ⟨n₀, hn₀⟩ := exists_weightParameters_cutoff + refine ⟨n₀, fun n hn c hc => ?_⟩ + have hp := hn₀ n hn + have hn4 : 4 ≤ n := by have := hp.large; omega + rw [rankData_eq hn4] + exact actual_circuit_rank_bound_of_weightParameters c + (fun x : Fin n × Fin n × Fin n => balancedLayer hn4 x.1) + (balancedVariable_card_true hn4) (balancedVariable_card_false hn4) hp hc + +/-- Filter form of the concrete circuit endpoint. -/ +theorem eventually_rankData_circuit_upper : + ∀ᶠ n : ℕ in Filter.atTop, ∀ c : Depth5Circuit ℂ n, + circuitValue c = imm ℂ n → + rankData n (circuitValue c) ≤ + 2 * (circuitSize c : ℝ) ^ 2 * rankDimension n * + Real.exp ((24 + 4 * Real.log 5) * Real.sqrt n) * + (n : ℝ) ^ (-Real.sqrt n / 100) := + Filter.eventually_atTop.mpr exists_rankData_circuit_upper_cutoff + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ActualImmRank.lean b/lean/OAI/Algebra/DepthFive/ActualImmRank.lean new file mode 100644 index 0000000000000000000000000000000000000000..4ffc41b901cc8a8a25c8165cd60b600c934ac3d2 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ActualImmRank.lean @@ -0,0 +1,68 @@ +import OAI.Algebra.DepthFive.ConfiguredRankData +import OAI.Algebra.DepthFive.ImmFiniteMatrix +import OAI.Algebra.DepthFive.BidegreeDimension +import OAI.Algebra.DepthFive.ImmFirstMomentParameters + +namespace OAI + +/-! Identification of the concrete rank measure with the finite normalized +matrix used in the IMM trace estimates. -/ + +noncomputable section + +namespace Problem335.LowerParameters + +theorem card_immSourceIndex_eq_rankDimension {n : ℕ} (hn : 4 ≤ n) : + (Fintype.card (ImmSourceIndex n (balancedLayer hn) (a n) (b n)) : ℝ) = + rankDimension n := by + have h := card_bidegree_finsupp_exponents + (fun x : Fin n × Fin n × Fin n => balancedLayer hn x.1) (a n) (b n) + rw [balancedVariable_card_true hn, balancedVariable_card_false hn, + Nat.multichoose_eq, Nat.multichoose_eq] at h + simp only [Nat.card_eq_fintype_card] at h + unfold rankDimension homogeneousDim + exact_mod_cast h + +theorem rankData_imm_eq_matrixRank {n : ℕ} (hn : 4 ≤ n) : + rankData n (imm ℂ n) = + ((immNormalizedMatrix n (balancedLayer hn) (a n) (b n)).rank : ℝ) := by + rw [rankData_eq hn, immNormalizedMatrix_rank] + simp only [immLayerVCount, immLayerUCount, + balancedLayer_card_true hn, balancedLayer_card_false hn] + +/-- The configured actual first trace, in the common normalization used by +the final rank comparison. -/ +theorem configured_imm_first_trace_lower {n : ℕ} (hn : 16 ≤ n) : + rankDimension n * rankMomentScale n * Real.exp (-(64 * Real.sqrt (n : ℝ))) ≤ + ((immNormalizedMatrix n (balancedLayer (Nat.le_trans (of_decide_eq_true rfl : 4 ≤ 16) hn)) (a n) (b n)).conjTranspose * + immNormalizedMatrix n (balancedLayer (Nat.le_trans (of_decide_eq_true rfl : 4 ≤ 16) hn)) (a n) (b n)).trace.re := by + have hn4 : 4 ≤ n := by omega + have h := immNormalizedMatrix_first_moment_lower_sqrt hn (balancedLayer hn4) + (balancedLayer_card_true hn4) (balancedLayer_card_false hn4) + rw [card_immSourceIndex_eq_rankDimension hn4] at h + simpa only [rankMomentScale, mul_assoc, neg_mul] using h + +/-- After the actual first-moment estimate is discharged, the sole remaining +matrix hypothesis for the configured rank lower bound is the second trace. -/ +theorem rankData_imm_lower_of_second_trace_bound {n : ℕ} (hn : 16 ≤ n) (C : ℝ) + (hsecond : + (((immNormalizedMatrix n (balancedLayer (Nat.le_trans (of_decide_eq_true rfl : 4 ≤ 16) hn)) (a n) (b n)).conjTranspose * + immNormalizedMatrix n (balancedLayer (Nat.le_trans (of_decide_eq_true rfl : 4 ≤ 16) hn)) (a n) (b n)) ^ 2).trace.re ≤ + rankDimension n * rankMomentScale n ^ 2 * Real.exp (C * Real.sqrt (n : ℝ))) : + rankDimension n * Real.exp (-((128 + C) * Real.sqrt (n : ℝ))) ≤ + rankData n (imm ℂ n) := by + have hn4 : 4 ≤ n := by omega + have h := rank_lower_bound_of_trace_moment_bounds + (immNormalizedMatrix n (balancedLayer hn4) (a n) (b n)) + (rankDimension_pos hn4) (rankMomentScale_pos hn4) + (configured_imm_first_trace_lower hn) hsecond + rw [← rankData_imm_eq_matrixRank hn4] at h + have he : 2 * (64 * Real.sqrt (n : ℝ)) + C * Real.sqrt (n : ℝ) = + (128 + C) * Real.sqrt (n : ℝ) := by ring + simpa only [he] using h + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ActualProductRank.lean b/lean/OAI/Algebra/DepthFive/ActualProductRank.lean new file mode 100644 index 0000000000000000000000000000000000000000..54320126aaa844531b19e53eb1c824bc9a113535 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ActualProductRank.lean @@ -0,0 +1,95 @@ +import OAI.Algebra.DepthFive.ProductRankCanonical +import OAI.Algebra.DepthFive.CircuitWeightBound +import OAI.Algebra.DepthFive.AnalyticParameters + +namespace OAI + +/-! Product-rank estimates specialized to the actual rounded rank parameters. -/ +noncomputable section +open scoped BigOperators + +namespace Problem335.LowerParameters + +/-- Dimension of the source of the actual mixed operator. -/ +def sourceDimension (n : ℕ) : ℝ := + (homogeneousDim (v n) (a n) : ℝ) * homogeneousDim (u n) (b n) + +theorem sourceDimension_pos {n : ℕ} (hn : 4 ≤ n) : 0 < sourceDimension n := by + unfold sourceDimension + exact mul_pos (by exact_mod_cast homogeneousDim_pos (v_pos hn) (a n)) + (by exact_mod_cast homogeneousDim_pos (u_pos hn) (b n)) + +theorem slope_lambda {n : ℕ} (hn : 4 ≤ n) : + (1 + rho n) * lambda n = rho n := by + rw [lambda_eq_rho_div hn] + have h : 1 + rho n ≠ 0 := by have := rho_pos hn; linarith + exact mul_div_cancel₀ _ h + +theorem twice_k_le_a_add_v {n : ℕ} (hn : 4 ≤ n) : + 2 * k n ≤ a n + v n := by + have h := k_mul_n_le_a hn + have hmul : 2 * k n ≤ k n * n := by nlinarith + omega + +/-- All numerical hypotheses of the mixed product-rank lemma hold for our +chosen parameters. Only the cardinalities of the variable partition remain. -/ +theorem actual_mixed_product_rank_le + {σ K ι : Type*} [Fintype σ] [Field K] [Fintype ι] [DecidableEq ι] + {n : ℕ} (hn : 4 ≤ n) (side : σ → Bool) + (hvcard : Fintype.card {x : σ // side x = true} = v n) + (hucard : Fintype.card {x : σ // side x = false} = u n) + (Q : ι → MvPolynomial σ K) (e : ι → ℕ) + (hQ : ∀ j, (Q j).IsHomogeneous (e j)) (he : ∑ j, e j = n) : + (RankMeasure.mapRank (sourceMixedOperator side (a n) (b n) + (bidegreeComponent side (k n) (m n) (∏ j, Q j))) : ℝ) ≤ + 2 * sourceDimension n * ∏ j, degreeWeight (q n) (lambda n) (e j) := by + have hmk : n - k n = m n := by have := k_add_m n; omega + simpa only [hmk, sourceDimension, q, alpha] using + mixed_product_rank_le side Q e hQ (k n) n (v n) (u n) (a n) (b n) + (rho n) (lambda n) hvcard hucard he (lambda_mul_n n) (slope_lambda hn) + (v_pos hn) (u_pos hn) (a_pos hn) (b_pos hn) (k_le_a hn) + (twice_k_le_a_add_v hn) (alpha_rpow_rho_le_beta hn) + +/-- The dimension factor is exactly the dimension of the chosen source space. -/ +theorem sourceDimension_eq_finrank {σ : Type*} [Fintype σ] + (K : Type*) [Field K] (n : ℕ) (side : σ → Bool) + (hvcard : Fintype.card {x : σ // side x = true} = v n) + (hucard : Fintype.card {x : σ // side x = false} = u n) : + sourceDimension n = + (Module.finrank K (bidegreeSubmodule (K := K) side (a n) (b n)) : ℝ) := by + rw [bidegreeSubmodule_finrank_choose K side, hvcard, hucard, Nat.cast_mul] + rfl + +/-- The canonical finite-source rank has the actual-parameter product bound. -/ +theorem actual_bidegreeRank_product_le + {σ K ι : Type*} [Fintype σ] [Field K] [Fintype ι] [DecidableEq ι] + {n : ℕ} (hn : 4 ≤ n) (side : σ → Bool) + (hvcard : Fintype.card {x : σ // side x = true} = v n) + (hucard : Fintype.card {x : σ // side x = false} = u n) + (Q : ι → MvPolynomial σ K) (e : ι → ℕ) + (hQ : ∀ j, (Q j).IsHomogeneous (e j)) (he : ∑ j, e j = n) : + (bidegreeRank side (a n) (b n) (k n) (m n) (∏ j, Q j) : ℝ) ≤ + 2 * sourceDimension n * ∏ j, degreeWeight (q n) (lambda n) (e j) := by + rw [bidegreeRank_eq_source_measure] + exact actual_mixed_product_rank_le hn side hvcard hucard Q e hQ he + +/-- The full list interface consumed by the circuit estimate, with every +analytic and operator-rank hypothesis discharged for the actual parameters. -/ +theorem actual_homogeneousProductRankBound + {σ K : Type*} [Fintype σ] [Field K] + {n : ℕ} (hn : 4 ≤ n) (side : σ → Bool) + (hvcard : Fintype.card {x : σ // side x = true} = v n) + (hucard : Fintype.card {x : σ // side x = false} = u n) : + HomogeneousProductRankBound + (fun p : MvPolynomial σ K => + (bidegreeRank side (a n) (b n) (k n) (m n) p : ℝ)) + n (q n) (lambda n) (sourceDimension n) := by + apply homogeneousProductRankBound_of_fin + intro r P e _hepos hP he + exact actual_bidegreeRank_product_le hn side hvcard hucard P e hP he + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ActualRelaxedWeightBound.lean b/lean/OAI/Algebra/DepthFive/ActualRelaxedWeightBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c1d89ce7a7af97d2a910e0e9772f9f0acbc7960 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ActualRelaxedWeightBound.lean @@ -0,0 +1,47 @@ +import OAI.Algebra.DepthFive.RelaxedWordBridge +import OAI.Algebra.DepthFive.ActualBalancedWordSum + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Problem335.MomentPairing +open Pairings LowerParameters + +theorem balanced_normalV_endpoints_disjoint {L : ℕ} (hn : 4 ≤ L + 1) + (τ : Fin (L + 1) → Kind) : + Pairwise (fun t u : normalVLayers (balancedLayer hn) τ => + Disjoint (internalEndpointSet t.1) (internalEndpointSet u.1)) := by + intro t u htu + rw [internalEndpointSet_eq_internalEnds, internalEndpointSet_eq_internalEnds] + apply balancedLayer_internalEnds_disjoint hn + · exact (Finset.mem_filter.mp t.property).2.1 + · exact (Finset.mem_filter.mp u.property).2.1 + · exact fun h => htu (Subtype.ext h) + +theorem sum_relaxed_pathWeight_balanced_le_exp {L : ℕ} (hn : 16 ≤ L + 1) + (endpoint : Fin (L + 1)) : + (∑ τ : Fin (L + 1) → Kind, + ∑ x : RelaxedPaths (Fin (L + 1)) endpoint τ, + pathWeight (balancedLayer (show 4 ≤ L + 1 by omega)) + (alpha (L + 1)) (beta (L + 1)) endpoint τ x.1) ≤ + (1 + beta (L + 1)) ^ m (L + 1) * ((L + 1 : ℕ) : ℝ) ^ (2 * L) * + Real.exp (8 * Real.sqrt ((L + 1 : ℕ) : ℝ)) := by + have hn4 : 4 ≤ L + 1 := by omega + have h := sum_relaxed_pathWeight_le_of_boolWordSum + (balancedLayer hn4) (alpha_pos hn4).le (beta_pos hn4).le endpoint + (balanced_normalV_endpoints_disjoint hn4) + (B := Real.exp (8 * Real.sqrt ((L + 1 : ℕ) : ℝ))) + have hw : (∑ w : Fin (L + 1) → Bool, + relaxedWordWeight (balancedLayer hn4) (Fintype.card (Fin (L + 1))) + (alpha (L + 1)) (beta (L + 1)) (fun t => boolKindEquiv (w t))) ≤ + Real.exp (8 * Real.sqrt ((L + 1 : ℕ) : ℝ)) := by + simpa only [Fintype.card_fin, relaxedWordWeight_eq_isolatedWeight] using + actual_balanced_word_sum_bound hn + simpa only [Fintype.card_fin, uLayerCount, balancedLayer_card_false] using h hw + +end Problem335.MomentPairing + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ActualSecondMomentParameters.lean b/lean/OAI/Algebra/DepthFive/ActualSecondMomentParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2a2a9b378acff3c19d7e746190e982dd4f13a00 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ActualSecondMomentParameters.lean @@ -0,0 +1,107 @@ +import OAI.Algebra.DepthFive.ConfiguredRankData +import OAI.Algebra.DepthFive.SecondMomentNormalization +import OAI.Algebra.DepthFive.MomentLossParameters + +namespace OAI + +/-! Exact normalization and uniform numerical losses for the configured second +trace. The actual trace-to-path inequality is deliberately an explicit premise. -/ + +noncomputable section + +namespace Problem335.LowerParameters + +open MomentPairing + +/-- The path mean for the balanced partition uses exactly the configured +numbers of differentiation and multiplication layers. -/ +theorem configured_pathMean_eq {L : ℕ} (hn : 4 ≤ L + 1) : + pathMean (balancedLayer hn) + ((a (L + 1) : ℝ) / v (L + 1)) + ((b (L + 1) : ℝ) / u (L + 1)) = + ((a (L + 1) : ℝ) / v (L + 1)) ^ k (L + 1) * + (1 + (b (L + 1) : ℝ) / u (L + 1)) ^ m (L + 1) := by + simp only [pathMean, balancedLayer_card_true, balancedLayer_card_false] + rw [add_comm ((b (L + 1) : ℝ) / u (L + 1)) 1] + +/-- The common first-moment scale is the path count times the path mean. -/ +theorem rankMomentScale_eq_pathMean {L : ℕ} (hn : 4 ≤ L + 1) : + rankMomentScale (L + 1) = ((L + 1 : ℕ) : ℝ) ^ L * + pathMean (balancedLayer hn) + ((a (L + 1) : ℝ) / v (L + 1)) + ((b (L + 1) : ℝ) / u (L + 1)) := by + rw [configured_pathMean_eq] + simp only [rankMomentScale, Nat.add_sub_cancel, mul_assoc] + +/-- The U-layer correction and the balanced-word factor cost at most ten +square-root units in the exponent, without an occupation upper-loss factor. -/ +theorem configured_word_loss_le_exp {n : ℕ} (hn : 16 ≤ n) + (hbeta : beta n ≤ 2 / Real.sqrt (n : ℝ)) : + (1 + beta n) ^ m n * Real.exp (8 * Real.sqrt (n : ℝ)) ≤ + Real.exp (10 * Real.sqrt (n : ℝ)) := by + calc + _ ≤ Real.exp (2 * Real.sqrt (n : ℝ)) * + Real.exp (8 * Real.sqrt (n : ℝ)) := + mul_le_mul_of_nonneg_right (u_layer_correction_le_exp hn hbeta) + (Real.exp_pos _).le + _ = _ := by rw [← Real.exp_add]; congr 1; ring + +/-- Rearrangement of the actual path normalization, including the square of +its path-count factor. -/ +theorem configured_second_scale_identity {L : ℕ} (hn : 4 ≤ L + 1) + (W : ℝ) : + rankDimension (L + 1) * + pathMean (balancedLayer hn) + ((a (L + 1) : ℝ) / v (L + 1)) + ((b (L + 1) : ℝ) / u (L + 1)) ^ 2 * + (((L + 1 : ℕ) : ℝ) ^ (2 * L) * W) = + rankDimension (L + 1) * rankMomentScale (L + 1) ^ 2 * W := by + rw [rankMomentScale_eq_pathMean hn, Nat.mul_comm 2 L, pow_mul] + ring + +/-- Numerical endpoint consumed by the actual trace-to-relaxed-path assembly. +There is only one source-dimension factor. -/ +theorem configured_second_bound_of_path_bound {L : ℕ} (hn : 16 ≤ L + 1) + (hbeta : beta (L + 1) ≤ 2 / Real.sqrt ((L + 1 : ℕ) : ℝ)) + (T : ℝ) + (hT : T ≤ rankDimension (L + 1) * + pathMean (balancedLayer (show 4 ≤ L + 1 by omega)) + ((a (L + 1) : ℝ) / v (L + 1)) + ((b (L + 1) : ℝ) / u (L + 1)) ^ 2 * + ((1 + beta (L + 1)) ^ m (L + 1) * + ((L + 1 : ℕ) : ℝ) ^ (2 * L) * + Real.exp (8 * Real.sqrt ((L + 1 : ℕ) : ℝ)))) : + T ≤ rankDimension (L + 1) * rankMomentScale (L + 1) ^ 2 * + Real.exp (10 * Real.sqrt ((L + 1 : ℕ) : ℝ)) := by + have hn4 : 4 ≤ L + 1 := by omega + have hid := configured_second_scale_identity hn4 + ((1 + beta (L + 1)) ^ m (L + 1) * + Real.exp (8 * Real.sqrt ((L + 1 : ℕ) : ℝ))) + have hT' : T ≤ rankDimension (L + 1) * rankMomentScale (L + 1) ^ 2 * + ((1 + beta (L + 1)) ^ m (L + 1) * + Real.exp (8 * Real.sqrt ((L + 1 : ℕ) : ℝ))) := by + rw [← hid] + convert hT using 1; ring + exact hT'.trans (mul_le_mul_of_nonneg_left + (configured_word_loss_le_exp hn hbeta) + (mul_nonneg (rankDimension_nonneg _) (sq_nonneg _))) + +/-- A single absolute threshold discharges every numerical premise of the +configured second-moment normalization. -/ +theorem exists_second_moment_parameter_cutoff : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → + 16 ≤ n ∧ beta n ≤ 2 / Real.sqrt (n : ℝ) ∧ + (1 + beta n) ^ m n * Real.exp (8 * Real.sqrt (n : ℝ)) ≤ + Real.exp (10 * Real.sqrt (n : ℝ)) := by + obtain ⟨N, hN⟩ := eventually_q_beta_le_two_div_sqrt + refine ⟨max N 16, ?_⟩ + intro n hn + have hn16 : 16 ≤ n := (le_max_right _ _).trans hn + have hb := (hN n ((le_max_left _ _).trans hn)).2 + exact ⟨hn16, hb, configured_word_loss_le_exp hn16 hb⟩ + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ActualWeightParameters.lean b/lean/OAI/Algebra/DepthFive/ActualWeightParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f81d64293f8ae1ab205061dec97178e5122c821 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ActualWeightParameters.lean @@ -0,0 +1,40 @@ +import OAI.Algebra.DepthFive.ParameterBounds +import OAI.Algebra.DepthFive.CircuitWeightBound +import OAI.Algebra.DepthFive.OddDegreeThreshold + +namespace OAI + +noncomputable section + +namespace Problem335.LowerParameters + +/-- All hypotheses of the circuit weight estimate hold simultaneously for +the actual integer and analytic parameters beyond one uniform threshold. -/ +theorem exists_weightParameters_cutoff : + ∃ n₀ : ℕ, ∀ n : ℕ, n₀ ≤ n → WeightParameters n (s n : ℝ) (q n) := by + obtain ⟨n₁, h₁⟩ := eventually_admissible + obtain ⟨n₂, h₂⟩ := eventually_odd_degree_smallness + refine ⟨max (max n₁ n₂) 64, ?_⟩ + intro n hn + have hn64 : 64 ≤ n := (le_max_right _ _).trans hn + have hn4 : 4 ≤ n := by omega + have hn1 : n₁ ≤ n := (le_max_left n₁ n₂).trans ((le_max_left _ _).trans hn) + have hn2 : n₂ ≤ n := (le_max_right n₁ n₂).trans ((le_max_left _ _).trans hn) + have hA := h₁ n hn1 + have hq := q_pos hn4 + have henv := hA.q_upper.trans hA.sqrt_upper_power + refine ⟨hn64, ?_, hA.s_lower, hA.s_upper, hq, + hA.q_upper.trans hA.sqrt_upper_half, hA.q_upper, henv, ?_⟩ + · exact_mod_cast s_pos hn4 + · exact h₂ n hn2 (q n) hq.le henv + +/-- Filter form of the actual-parameter specialization, for final asymptotic assembly. -/ +theorem eventually_weightParameters : + ∀ᶠ n : ℕ in Filter.atTop, WeightParameters n (s n : ℝ) (q n) := + Filter.eventually_atTop.mpr exists_weightParameters_cutoff + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/AlphaParameters.lean b/lean/OAI/Algebra/DepthFive/AlphaParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..42463b297148947ff49056cd991f2ec8bfd11dd9 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/AlphaParameters.lean @@ -0,0 +1,141 @@ +import OAI.Algebra.DepthFive.AnalyticParameters +import OAI.Algebra.DepthFive.FractionRounding + +namespace OAI + +noncomputable section +namespace Problem335.LowerParameters + +theorem sqrt_ge_four {n : ℕ} (hn : 16 ≤ n) : 4 ≤ Real.sqrt (n : ℝ) := by + apply (Real.le_sqrt (by norm_num) (by positivity)).mpr + exact_mod_cast hn + +theorem a_ideal_le {n : ℕ} (_hn : 16 ≤ n) : + (v n : ℝ) / (Real.sqrt (n : ℝ) - 1) ≤ (a n : ℝ) := Nat.le_ceil _ + +theorem a_lt_ideal_add_one {n : ℕ} (hn : 16 ≤ n) : + (a n : ℝ) < (v n : ℝ) / (Real.sqrt (n : ℝ) - 1) + 1 := by + apply Nat.ceil_lt_add_one + have hs := sqrt_ge_four hn + exact div_nonneg (Nat.cast_nonneg _) (by linarith) + +theorem a_scale_lower {n : ℕ} (hn : 16 ≤ n) : + (n : ℝ) ^ 2 * Real.sqrt (n : ℝ) / 4 ≤ (a n : ℝ) := by + have hs := sqrt_ge_four hn + have hden : 0 < Real.sqrt (n : ℝ) - 1 := by linarith + have hv : 3 * (n : ℝ) ^ 3 ≤ 8 * (v n : ℝ) := by + exact_mod_cast three_mul_cube_le_eight_mul_v hn + have heq : (n : ℝ) ^ 2 * Real.sqrt (n : ℝ) * Real.sqrt (n : ℝ) = (n : ℝ) ^ 3 := by + calc + _ = (n : ℝ) ^ 2 * (Real.sqrt (n : ℝ)) ^ 2 := by ring + _ = (n : ℝ) ^ 3 := by rw [Real.sq_sqrt (by positivity)]; ring + apply le_trans _ (a_ideal_le hn) + apply (le_div_iff₀ hden).mpr + have hnonneg : 0 ≤ (n : ℝ) ^ 2 * Real.sqrt (n : ℝ) := by positivity + nlinarith + +theorem a_scale_upper {n : ℕ} (hn : 16 ≤ n) : + (a n : ℝ) ≤ 3 * (n : ℝ) ^ 2 * Real.sqrt (n : ℝ) := by + have hs := sqrt_ge_four hn + have hnR : (16 : ℝ) ≤ n := by exact_mod_cast hn + have hden : 0 < Real.sqrt (n : ℝ) - 1 := by linarith + have hv : (v n : ℝ) ≤ (n : ℝ) ^ 3 := by exact_mod_cast v_le_cube n + have heq : (n : ℝ) ^ 2 * Real.sqrt (n : ℝ) * Real.sqrt (n : ℝ) = (n : ℝ) ^ 3 := by + calc + _ = (n : ℝ) ^ 2 * (Real.sqrt (n : ℝ)) ^ 2 := by ring + _ = (n : ℝ) ^ 3 := by rw [Real.sq_sqrt (by positivity)]; ring + have hnonneg : 0 ≤ (n : ℝ) ^ 2 * Real.sqrt (n : ℝ) := by positivity + have hmul := mul_le_mul_of_nonneg_right (show (2 : ℝ) ≤ Real.sqrt (n : ℝ) by linarith) hnonneg + have hideal : (v n : ℝ) / (Real.sqrt (n : ℝ) - 1) ≤ + 2 * (n : ℝ) ^ 2 * Real.sqrt (n : ℝ) := by + apply (div_le_iff₀ hden).mpr + nlinarith + have hlarge : 1 ≤ (n : ℝ) ^ 2 * Real.sqrt (n : ℝ) := by + have hn2 : (1 : ℝ) ≤ (n : ℝ) ^ 2 := by nlinarith + nlinarith [mul_le_mul_of_nonneg_left (show (1 : ℝ) ≤ Real.sqrt (n : ℝ) by linarith) + (sq_nonneg (n : ℝ))] + have hround := a_lt_ideal_add_one hn + nlinarith + +theorem alpha_bounds {n : ℕ} (hn : 16 ≤ n) : + 1 / Real.sqrt (n : ℝ) ≤ alpha n ∧ + alpha n ≤ 1 / Real.sqrt (n : ℝ) * + Real.exp ((Real.sqrt (n : ℝ) - 1) / (v n : ℝ)) := by + have hs := sqrt_ge_four hn + have hv : (0 : ℝ) < v n := by exact_mod_cast v_pos (by omega : 4 ≤ n) + exact fraction_natCeil_inverse_bounds (by linarith) hv + +/-- The relative logarithmic rounding error is controlled by the rounded order. -/ +theorem alpha_log_error_bounds {n : ℕ} (hn : 16 ≤ n) : + 0 ≤ Real.log (alpha n * Real.sqrt (n : ℝ)) ∧ + Real.log (alpha n * Real.sqrt (n : ℝ)) ≤ 2 / (a n : ℝ) := by + have hs := sqrt_ge_four hn + have hsm : 0 < Real.sqrt (n : ℝ) - 1 := by linarith + have hspos : 0 < Real.sqrt (n : ℝ) := by linarith + have hv : (0 : ℝ) < v n := by exact_mod_cast v_pos (by omega : 4 ≤ n) + have hx : 0 < (v n : ℝ) / (Real.sqrt (n : ℝ) - 1) := div_pos hv hsm + have hxa := a_ideal_le hn + have hax := a_lt_ideal_add_one hn + have ha : 4 * (n : ℝ) ≤ (a n : ℝ) := by exact_mod_cast four_mul_n_le_a hn + have hnR : (16 : ℝ) ≤ n := by exact_mod_cast hn + have hxone : 1 ≤ (v n : ℝ) / (Real.sqrt (n : ℝ) - 1) := by linarith + have hbase : ((v n : ℝ) / (Real.sqrt (n : ℝ) - 1)) / + ((v n : ℝ) / (Real.sqrt (n : ℝ) - 1) + (v n : ℝ)) = + 1 / Real.sqrt (n : ℝ) := by + field_simp + ring + have heq : ((a n : ℝ) / ((a n : ℝ) + (v n : ℝ))) / + (((v n : ℝ) / (Real.sqrt (n : ℝ) - 1)) / + ((v n : ℝ) / (Real.sqrt (n : ℝ) - 1) + (v n : ℝ))) = + alpha n * Real.sqrt (n : ℝ) := by + rw [hbase, alpha] + field_simp + constructor + · rw [← heq] + exact (fraction_rounding_log_bounds hx hv hxa hax.le).1 + · rw [← heq] + exact fraction_rounding_log_le_two_div hxone hv hxa hax.le + +/-- The occupation-moment error from differentiation is of order `n^(-1/2)`. -/ +theorem sq_div_a_le {n : ℕ} (hn : 16 ≤ n) : + (n : ℝ) ^ 2 / (a n : ℝ) ≤ 4 / Real.sqrt (n : ℝ) := by + have ha : (0 : ℝ) < a n := by exact_mod_cast a_pos (by omega : 4 ≤ n) + have hs : 0 < Real.sqrt (n : ℝ) := by have := sqrt_ge_four hn; linarith + apply (div_le_div_iff₀ ha hs).mpr + have h := a_scale_lower hn + linarith + +/-- The ambient-variable occupation error has the better order `1/n`. -/ +theorem sq_div_v_le {n : ℕ} (hn : 16 ≤ n) : + (n : ℝ) ^ 2 / (v n : ℝ) ≤ 8 / (3 * (n : ℝ)) := by + have hv : (0 : ℝ) < v n := by exact_mod_cast v_pos (by omega : 4 ≤ n) + have hnR : (0 : ℝ) < n := by exact_mod_cast (by omega : 0 < n) + apply (div_le_div_iff₀ hv (by positivity)).mpr + have h : 3 * (n : ℝ) ^ 3 ≤ 8 * (v n : ℝ) := by + exact_mod_cast three_mul_cube_le_eight_mul_v hn + nlinarith + +/-- Uniform two-sided growth of the chosen differentiation order. -/ +theorem a_isTheta : + Asymptotics.IsTheta Filter.atTop (fun n : ℕ => (a n : ℝ)) + (fun n : ℕ => (n : ℝ) ^ 2 * Real.sqrt (n : ℝ)) := by + constructor + · apply Asymptotics.isBigO_iff.mpr + refine ⟨3, ?_⟩ + filter_upwards [Filter.eventually_ge_atTop 16] with n hn + have hnonneg : 0 ≤ (n : ℝ) ^ 2 * Real.sqrt (n : ℝ) := by positivity + simpa only [Real.norm_eq_abs, abs_of_nonneg (show (0 : ℝ) ≤ (a n : ℝ) by positivity), + abs_of_nonneg hnonneg, mul_assoc] using a_scale_upper hn + · apply Asymptotics.isBigO_iff.mpr + refine ⟨4, ?_⟩ + filter_upwards [Filter.eventually_ge_atTop 16] with n hn + have hnonneg : 0 ≤ (n : ℝ) ^ 2 * Real.sqrt (n : ℝ) := by positivity + simp only [Real.norm_eq_abs, abs_of_nonneg (show (0 : ℝ) ≤ (a n : ℝ) by positivity), abs_of_nonneg hnonneg] + have h := a_scale_lower hn + linarith + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/AnalyticParameters.lean b/lean/OAI/Algebra/DepthFive/AnalyticParameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..230159cdb1823fe89f2ecbe167f175ff292d5eeb --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/AnalyticParameters.lean @@ -0,0 +1,198 @@ +import OAI.Algebra.DepthFive.LowerParameters + +namespace OAI + +/-! Rounded analytic parameters used by the lower-bound rank measure. -/ +noncomputable section +namespace Problem335.LowerParameters + +def a0 (n : ℕ) : ℝ := (v n : ℝ) / (Real.sqrt (n : ℝ) - 1) +def a (n : ℕ) : ℕ := ⌈a0 n⌉₊ +def alpha (n : ℕ) : ℝ := (a n : ℝ) / ((a n : ℝ) + (v n : ℝ)) +def b0 (n : ℕ) : ℝ := (u n : ℝ) * (alpha n) ^ (rho n) / (1 - (alpha n) ^ (rho n)) +def b (n : ℕ) : ℕ := ⌈b0 n⌉₊ +def beta (n : ℕ) : ℝ := (b n : ℝ) / ((b n : ℝ) + (u n : ℝ)) +def q (n : ℕ) : ℝ := (alpha n) ^ ((1 + rho n) / 2) + +theorem sqrt_ge_two {n : ℕ} (hn : 4 ≤ n) : 2 ≤ Real.sqrt (n : ℝ) := by + apply (Real.le_sqrt (by norm_num) (by positivity)).mpr + exact_mod_cast hn + +theorem a0_pos {n : ℕ} (hn : 4 ≤ n) : 0 < a0 n := by + unfold a0 + apply div_pos + · exact_mod_cast v_pos hn + · have := sqrt_ge_two hn + linarith + +theorem a_pos {n : ℕ} (hn : 4 ≤ n) : 0 < a n := by + exact Nat.ceil_pos.mpr (a0_pos hn) + +theorem a0_le_a (n : ℕ) : a0 n ≤ (a n : ℝ) := Nat.le_ceil _ + +theorem a_lt_a0_add_one {n : ℕ} (hn : 4 ≤ n) : (a n : ℝ) < a0 n + 1 := + Nat.ceil_lt_add_one (a0_pos hn).le + +theorem alpha_pos {n : ℕ} (hn : 4 ≤ n) : 0 < alpha n := by + have ha : (0 : ℝ) < a n := by exact_mod_cast a_pos hn + unfold alpha + positivity + +theorem alpha_lt_one {n : ℕ} (hn : 4 ≤ n) : alpha n < 1 := by + have hv : (0 : ℝ) < v n := by exact_mod_cast v_pos hn + unfold alpha + apply (div_lt_one (by positivity)).mpr + linarith + +theorem inv_sqrt_le_alpha {n : ℕ} (hn : 4 ≤ n) : + (Real.sqrt (n : ℝ))⁻¹ ≤ alpha n := by + have hr := sqrt_ge_two hn + have ha : (0 : ℝ) < a n := by exact_mod_cast a_pos hn + have hv : (0 : ℝ) < v n := by exact_mod_cast v_pos hn + have hround := a0_le_a n + have hmul : (v n : ℝ) ≤ (a n : ℝ) * (Real.sqrt (n : ℝ) - 1) := + (div_le_iff₀ (by linarith)).mp hround + rw [inv_eq_one_div, alpha] + apply (div_le_div_iff₀ (by linarith) (by positivity)).mpr + nlinarith + +theorem inv_alpha_le_sqrt {n : ℕ} (hn : 4 ≤ n) : + (alpha n)⁻¹ ≤ Real.sqrt (n : ℝ) := by + have ha := alpha_pos hn + have hs := sqrt_ge_two hn + have h := inv_sqrt_le_alpha hn + calc + (alpha n)⁻¹ ≤ ((Real.sqrt (n : ℝ))⁻¹)⁻¹ := + (inv_le_inv₀ ha (inv_pos.mpr (by linarith))).mpr h + _ = _ := inv_inv _ + +theorem k_mul_n_le_a0 {n : ℕ} (hn : 4 ≤ n) : + (k n : ℝ) * (n : ℝ) ≤ a0 n := by + have hr := sqrt_ge_two hn + have hn' : (4 : ℝ) ≤ n := by exact_mod_cast hn + have hsq := Real.sq_sqrt (show (0 : ℝ) ≤ n by positivity) + have hbound : Real.sqrt (n : ℝ) - 1 ≤ (n : ℝ) := by nlinarith + unfold a0 + apply (le_div_iff₀ (by linarith)).mpr + have h := mul_le_mul_of_nonneg_left hbound + (show 0 ≤ (k n : ℝ) * (n : ℝ) by positivity) + simpa [v, Nat.cast_mul, Nat.cast_pow, pow_two, mul_assoc] using h + +theorem k_mul_n_le_a {n : ℕ} (hn : 4 ≤ n) : k n * n ≤ a n := by + have h := (k_mul_n_le_a0 hn).trans (a0_le_a n) + exact_mod_cast h + +theorem k_le_a {n : ℕ} (hn : 4 ≤ n) : k n ≤ a n := by + exact (Nat.le_mul_of_pos_right _ (by omega)).trans (k_mul_n_le_a hn) + +theorem four_mul_n_le_a {n : ℕ} (hn : 16 ≤ n) : 4 * n ≤ a n := by + have hk := three_mul_n_le_eight_mul_k hn + have hka := k_mul_n_le_a (show 4 ≤ n by omega) + have hk4 : 4 ≤ k n := by omega + exact (Nat.mul_le_mul_right n hk4).trans hka + +theorem alpha_rpow_rho_pos {n : ℕ} (hn : 4 ≤ n) : + 0 < (alpha n) ^ (rho n) := Real.rpow_pos_of_pos (alpha_pos hn) _ + +theorem alpha_rpow_rho_lt_one {n : ℕ} (hn : 4 ≤ n) : + (alpha n) ^ (rho n) < 1 := + Real.rpow_lt_one (alpha_pos hn).le (alpha_lt_one hn) (rho_pos hn) + +theorem alpha_le_alpha_rpow_rho {n : ℕ} (hn : 4 ≤ n) : + alpha n ≤ (alpha n) ^ (rho n) := + Real.self_le_rpow_of_le_one (alpha_pos hn).le (alpha_lt_one hn).le (rho_lt_one hn).le + +theorem b0_pos {n : ℕ} (hn : 4 ≤ n) : 0 < b0 n := by + have hu : (0 : ℝ) < u n := by exact_mod_cast u_pos hn + have hp := alpha_rpow_rho_pos hn + have hp1 := alpha_rpow_rho_lt_one hn + unfold b0 + positivity + +theorem b_pos {n : ℕ} (hn : 4 ≤ n) : 0 < b n := + Nat.ceil_pos.mpr (b0_pos hn) + +theorem b0_le_b (n : ℕ) : b0 n ≤ (b n : ℝ) := Nat.le_ceil _ + +theorem b_lt_b0_add_one {n : ℕ} (hn : 4 ≤ n) : (b n : ℝ) < b0 n + 1 := + Nat.ceil_lt_add_one (b0_pos hn).le + +theorem beta_pos {n : ℕ} (hn : 4 ≤ n) : 0 < beta n := by + have hb : (0 : ℝ) < b n := by exact_mod_cast b_pos hn + unfold beta + positivity + +theorem beta_lt_one {n : ℕ} (hn : 4 ≤ n) : beta n < 1 := by + have hu : (0 : ℝ) < u n := by exact_mod_cast u_pos hn + unfold beta + apply (div_lt_one (by positivity)).mpr + linarith + +theorem alpha_rpow_rho_le_beta {n : ℕ} (hn : 4 ≤ n) : + (alpha n) ^ (rho n) ≤ beta n := by + have hu : (0 : ℝ) < u n := by exact_mod_cast u_pos hn + have hp := alpha_rpow_rho_lt_one hn + have hround := b0_le_b n + have hmul : (u n : ℝ) * (alpha n) ^ (rho n) ≤ + (b n : ℝ) * (1 - (alpha n) ^ (rho n)) := + (div_le_iff₀ (by linarith)).mp hround + rw [beta] + apply (le_div_iff₀ (by positivity)).mpr + nlinarith + +theorem a_le_b0 {n : ℕ} (hn : 4 ≤ n) : (a n : ℝ) ≤ b0 n := by + have hap := alpha_pos hn + have ha : (0 : ℝ) < a n := by exact_mod_cast a_pos hn + have hv : (0 : ℝ) < v n := by exact_mod_cast v_pos hn + have hu : (v n : ℝ) ≤ u n := by + have hkm : k n ≤ m n := (k_lt_m hn).le + exact_mod_cast Nat.mul_le_mul_right (n ^ 2) hkm + have hp := alpha_rpow_rho_pos hn + have hp1 := alpha_rpow_rho_lt_one hn + have hal := alpha_le_alpha_rpow_rho hn + have heq : (a n : ℝ) * (1 - alpha n) = (v n : ℝ) * alpha n := by + unfold alpha + field_simp + ring + unfold b0 + apply (le_div_iff₀ (by linarith)).mpr + calc + (a n : ℝ) * (1 - (alpha n) ^ (rho n)) ≤ (a n : ℝ) * (1 - alpha n) := by + gcongr + _ = (v n : ℝ) * alpha n := heq + _ ≤ (u n : ℝ) * (alpha n) ^ (rho n) := + mul_le_mul hu hal hap.le (by positivity) + +theorem a_le_b {n : ℕ} (hn : 4 ≤ n) : a n ≤ b n := by + exact_mod_cast (a_le_b0 hn).trans (b0_le_b n) + +theorem four_mul_n_le_b {n : ℕ} (hn : 16 ≤ n) : 4 * n ≤ b n := + (four_mul_n_le_a hn).trans (a_le_b (by omega)) + +theorem q_pos {n : ℕ} (hn : 4 ≤ n) : 0 < q n := + Real.rpow_pos_of_pos (alpha_pos hn) _ + +theorem q_lt_one {n : ℕ} (hn : 4 ≤ n) : q n < 1 := by + have hr := rho_pos hn + exact Real.rpow_lt_one (alpha_pos hn).le (alpha_lt_one hn) (by linarith) + +theorem alpha_le_q {n : ℕ} (hn : 4 ≤ n) : alpha n ≤ q n := by + have hr := rho_lt_one hn + exact Real.self_le_rpow_of_le_one (alpha_pos hn).le (alpha_lt_one hn).le (by linarith) + +theorem q_le_alpha_rpow_rho {n : ℕ} (hn : 4 ≤ n) : + q n ≤ (alpha n) ^ (rho n) := by + have hr := rho_lt_one hn + exact Real.rpow_le_rpow_of_exponent_ge (alpha_pos hn) (alpha_lt_one hn).le (by linarith) + +theorem q_le_beta {n : ℕ} (hn : 4 ≤ n) : q n ≤ beta n := + (q_le_alpha_rpow_rho hn).trans (alpha_rpow_rho_le_beta hn) + +theorem inv_sqrt_le_q {n : ℕ} (hn : 4 ≤ n) : (Real.sqrt (n : ℝ))⁻¹ ≤ q n := + (inv_sqrt_le_alpha hn).trans (alpha_le_q hn) + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BalancedSchedule.lean b/lean/OAI/Algebra/DepthFive/BalancedSchedule.lean new file mode 100644 index 0000000000000000000000000000000000000000..e0e32e22c898d8d2e4f5a5f48567935881c1c245 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BalancedSchedule.lean @@ -0,0 +1,409 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace Problem335 +namespace BalancedSchedule + +/-- Number of `U` layers following the `i`th `V` layer. -/ +def chunkLength (k s i : ℕ) : ℕ := + 1 + ((i + 1) * s / k - i * s / k) + +lemma quotient_mono (k s : ℕ) {i j : ℕ} (hij : i ≤ j) : + i * s / k ≤ j * s / k := + Nat.div_le_div_right (Nat.mul_le_mul_right s hij) + +lemma chunkLength_pos (k s i : ℕ) : 0 < chunkLength k s i := by + unfold chunkLength + omega + +lemma chunkLength_le_two {k s : ℕ} (hs : s < k) (i : ℕ) : + chunkLength k s i ≤ 2 := by + have hk : 0 < k := lt_of_le_of_lt (Nat.zero_le s) hs + have hrem := Nat.mod_lt (i * s) hk + have hdiv := Nat.mod_add_div (i * s) k + have hnext : (i + 1) * s < (i * s / k + 2) * k := by nlinarith + have hq : (i + 1) * s / k < i * s / k + 2 := + (Nat.div_lt_iff_lt_mul hk).2 hnext + unfold chunkLength + omega + +lemma chunkLength_eq_one_or_two {k s : ℕ} (hs : s < k) (i : ℕ) : + chunkLength k s i = 1 ∨ chunkLength k s i = 2 := by + have hp := chunkLength_pos k s i + have hl := chunkLength_le_two hs i + omega + +/-- The number of `U` layers in consecutive complete chunks. -/ +lemma sum_chunkLength (k s a r : ℕ) : + (∑ j ∈ Finset.range r, chunkLength k s (a + j)) = + r + ((a + r) * s / k - a * s / k) := by + induction r with + | zero => simp + | succ r ih => + rw [Finset.sum_range_succ, ih] + have h₁ := quotient_mono k s (show a ≤ a + r by omega) + have h₂ := quotient_mono k s (show a + r ≤ a + (r + 1) by omega) + unfold chunkLength + have heq : a + r + 1 = a + (r + 1) := by omega + rw [heq] + omega + +lemma sum_all_chunkLength {k : ℕ} (hk : 0 < k) (s : ℕ) : + (∑ j ∈ Finset.range k, chunkLength k s j) = k + s := by + simpa [Nat.mul_div_cancel_left s hk] using sum_chunkLength k s 0 k + +/-- A complete-chunk block has discrepancy strictly less than `ρ = k / (k+s)`. -/ +lemma complete_chunks_discrepancy_lt {k : ℕ} (hk : 0 < k) (s a r : ℕ) : + (r : ℝ) - (k : ℝ) / (k + s) * + (∑ j ∈ Finset.range r, (chunkLength k s (a + j) : ℝ)) < + (k : ℝ) / (k + s) := by + have hm := quotient_mono k s (show a ≤ a + r by omega) + have hsum : (∑ j ∈ Finset.range r, (chunkLength k s (a + j) : ℝ)) = + (r : ℝ) + (((a + r) * s / k : ℕ) : ℝ) - ((a * s / k : ℕ) : ℝ) := by + rw [← Nat.cast_sum, sum_chunkLength] + rw [Nat.cast_add, Nat.cast_sub hm] + ring + rw [hsum] + have hd₀ := Nat.mod_add_div (a * s) k + have hd₁ := Nat.mod_add_div ((a + r) * s) k + have hr₁ := Nat.mod_lt ((a + r) * s) hk + have hd₀' : ((a * s % k : ℕ) : ℝ) + (k : ℝ) * ((a * s / k : ℕ) : ℝ) = + (a : ℝ) * s := by exact_mod_cast hd₀ + have hd₁' : (((a + r) * s % k : ℕ) : ℝ) + (k : ℝ) * + (((a + r) * s / k : ℕ) : ℝ) = ((a : ℝ) + r) * s := by + exact_mod_cast hd₁ + have hr₁' : (((a + r) * s % k : ℕ) : ℝ) < (k : ℝ) := by exact_mod_cast hr₁ + have hr₀' : 0 ≤ ((a * s % k : ℕ) : ℝ) := Nat.cast_nonneg _ + have hk' : (0 : ℝ) < k := by exact_mod_cast hk + have hks : (0 : ℝ) < k + s := by positivity + apply (mul_lt_mul_iff_left₀ hks).1 + field_simp + nlinarith + +/-- The relative density used in the mixed rank measure. -/ +def rho (k s : ℕ) : ℝ := (k : ℝ) / (k + s) + +/-- `true` denotes a `V` layer and `false` denotes a `U` layer. -/ +def chunk (k s i : ℕ) : List Bool := + true :: List.replicate (chunkLength k s i) false + +/-- The first `r` complete chunks of the balanced schedule. -/ +def wordPrefix (k s : ℕ) : ℕ → List Bool + | 0 => [] + | r + 1 => wordPrefix k s r ++ chunk k s r + +/-- The complete balanced layer schedule. -/ +def word (k s : ℕ) : List Bool := wordPrefix k s k + +/-- The number of `V` layers minus `ρ` times the number of `U` layers. -/ +def discrepancy (k s : ℕ) (w : List Bool) : ℝ := + (w.count true : ℝ) - rho k s * (w.count false : ℝ) + +@[simp] lemma count_true_chunk (k s i : ℕ) : (chunk k s i).count true = 1 := by + simp [chunk, List.count_replicate] + +@[simp] lemma count_false_chunk (k s i : ℕ) : + (chunk k s i).count false = chunkLength k s i := by + simp [chunk] + +@[simp] lemma count_true_wordPrefix (k s r : ℕ) : + (wordPrefix k s r).count true = r := by + induction r with + | zero => simp [wordPrefix] + | succ r ih => simp [wordPrefix, List.count_append, ih] + +@[simp] lemma count_false_wordPrefix (k s r : ℕ) : + (wordPrefix k s r).count false = r + r * s / k := by + induction r with + | zero => simp [wordPrefix] + | succ r ih => + simp only [wordPrefix, List.count_append, ih, count_false_chunk] + have hm : r * s / k ≤ (r + 1) * s / k := quotient_mono k s (by omega) + unfold chunkLength + omega + +@[simp] lemma discrepancy_nil (k s : ℕ) : discrepancy k s [] = 0 := by + simp [discrepancy] + +@[simp] lemma discrepancy_append (k s : ℕ) (w z : List Bool) : + discrepancy k s (w ++ z) = discrepancy k s w + discrepancy k s z := by + simp only [discrepancy, List.count_append, Nat.cast_add] + ring + +@[simp] lemma discrepancy_chunk (k s i : ℕ) : + discrepancy k s (chunk k s i) = 1 - rho k s * chunkLength k s i := by + simp [discrepancy] + +lemma discrepancy_wordPrefix_eq_mod {k : ℕ} (hk : 0 < k) (s r : ℕ) : + discrepancy k s (wordPrefix k s r) = ((r * s % k : ℕ) : ℝ) / (k + s) := by + simp only [discrepancy, count_true_wordPrefix, count_false_wordPrefix, Nat.cast_add] + have hd := Nat.mod_add_div (r * s) k + have hd' : ((r * s % k : ℕ) : ℝ) + (k : ℝ) * ((r * s / k : ℕ) : ℝ) = + (r : ℝ) * s := by exact_mod_cast hd + have hk' : (0 : ℝ) < k := by exact_mod_cast hk + have hks : (0 : ℝ) < k + s := by positivity + unfold rho + field_simp + nlinarith + +lemma discrepancy_wordPrefix_nonneg {k : ℕ} (hk : 0 < k) (s r : ℕ) : + 0 ≤ discrepancy k s (wordPrefix k s r) := by + rw [discrepancy_wordPrefix_eq_mod hk] + positivity + +lemma discrepancy_wordPrefix_lt_rho {k : ℕ} (hk : 0 < k) (s r : ℕ) : + discrepancy k s (wordPrefix k s r) < rho k s := by + rw [discrepancy_wordPrefix_eq_mod hk] + have hk' : (0 : ℝ) < k := by exact_mod_cast hk + have hks : (0 : ℝ) < k + s := by positivity + apply (div_lt_div_iff_of_pos_right hks).2 + exact_mod_cast Nat.mod_lt (r * s) hk + +lemma take_chunk_discrepancy (k s i p : ℕ) (hp : 0 < p) : + discrepancy k s ((chunk k s i).take p) = + 1 - rho k s * (min (p - 1) (chunkLength k s i) : ℕ) := by + simp [chunk, List.take_cons hp, discrepancy, List.count_replicate] + +/-- Every prefix of the balanced schedule stays in a strip of width `1+ρ`. -/ +lemma take_wordPrefix_discrepancy_bounds {k : ℕ} (hk : 0 < k) (s r p : ℕ) : + 0 ≤ discrepancy k s ((wordPrefix k s r).take p) ∧ + discrepancy k s ((wordPrefix k s r).take p) < 1 + rho k s := by + have hrho : 0 ≤ rho k s := by unfold rho; positivity + induction r with + | zero => simp [wordPrefix]; positivity + | succ r ih => + change 0 ≤ discrepancy k s ((wordPrefix k s r ++ chunk k s r).take p) ∧ + discrepancy k s ((wordPrefix k s r ++ chunk k s r).take p) < 1 + rho k s + by_cases hp : p ≤ (wordPrefix k s r).length + · simpa only [List.take_append_of_le_length hp] using ih + · have hlt : (wordPrefix k s r).length < p := by omega + rw [List.take_append, List.take_of_length_le hlt.le, discrepancy_append] + rw [take_chunk_discrepancy k s r _ (by omega)] + have hmin : ((min (p - (wordPrefix k s r).length - 1) (chunkLength k s r) : ℕ) : ℝ) ≤ + (chunkLength k s r : ℝ) := by exact_mod_cast Nat.min_le_right _ _ + have hmul := mul_le_mul_of_nonneg_left hmin hrho + have hnonneg := discrepancy_wordPrefix_nonneg hk s (r + 1) + simp only [wordPrefix, discrepancy_append, discrepancy_chunk] at hnonneg + have hupper := discrepancy_wordPrefix_lt_rho hk s r + have hprod : 0 ≤ rho k s * + ((min (p - (wordPrefix k s r).length - 1) (chunkLength k s r) : ℕ) : ℝ) := by positivity + constructor <;> linarith + +/-- Every interval of layers has discrepancy strictly less than `1+ρ`. -/ +lemma interval_discrepancy_lt {k : ℕ} (hk : 0 < k) (s r a len : ℕ) : + discrepancy k s (((wordPrefix k s r).drop a).take len) < 1 + rho k s := by + have h₁ := (take_wordPrefix_discrepancy_bounds hk s r a).1 + have h₂ := (take_wordPrefix_discrepancy_bounds hk s r (a + len)).2 + rw [List.take_add, discrepancy_append] at h₂ + linarith + +lemma infix_discrepancy_lt {k : ℕ} (hk : 0 < k) (s r : ℕ) {w : List Bool} + (hw : w <:+: wordPrefix k s r) : discrepancy k s w < 1 + rho k s := by + rcases hw with ⟨l, z, heq⟩ + have h := interval_discrepancy_lt hk s r l.length w.length + rw [← heq, List.append_assoc, List.drop_left, List.take_left] at h + exact h + +@[simp] lemma word_count_true (k s : ℕ) : (word k s).count true = k := by + simp [word] + +@[simp] lemma word_count_false {k : ℕ} (hk : 0 < k) (s : ℕ) : + (word k s).count false = k + s := by + simp [word, Nat.mul_div_cancel_left s hk] + +lemma word_length {k : ℕ} (hk : 0 < k) (s : ℕ) : + (word k s).length = 2 * k + s := by + rw [← List.count_true_add_count_false, word_count_true, word_count_false hk] + omega + +@[simp] lemma discrepancy_word {k : ℕ} (hk : 0 < k) (s : ℕ) : + discrepancy k s (word k s) = 0 := by + rw [word, discrepancy_wordPrefix_eq_mod hk] + simp + +@[simp] lemma chunk_head (k s i : ℕ) : (chunk k s i).head? = some true := rfl + +@[simp] lemma chunk_last (k s i : ℕ) : (chunk k s i).getLast? = some false := by + have hp := chunkLength_pos k s i + simp [chunk, List.getLast?_cons, List.getLast?_replicate, Nat.ne_of_gt hp] + +lemma wordPrefix_head {r : ℕ} (hr : 0 < r) (k s : ℕ) : + (wordPrefix k s r).head? = some true := by + induction r with + | zero => omega + | succ r ih => + cases r with + | zero => simp [wordPrefix] + | succ r => + change (wordPrefix k s (r + 1) ++ chunk k s (r + 1)).head? = some true + rw [List.head?_append, ih (by omega)] + rfl + +lemma wordPrefix_last {r : ℕ} (hr : 0 < r) (k s : ℕ) : + (wordPrefix k s r).getLast? = some false := by + cases r with + | zero => omega + | succ r => simp [wordPrefix, List.getLast?_append] + +lemma replicate_no_adjacent_V (d : ℕ) : + (List.replicate d false).IsChain (fun a b => a = false ∨ b = false) := by + rw [List.isChain_iff_getElem] + simp + +lemma chunk_no_adjacent_V (k s i : ℕ) : + (chunk k s i).IsChain (fun a b => a = false ∨ b = false) := by + unfold chunk + apply (List.isChain_cons).2 + constructor + · intro y hy + right + exact List.eq_of_mem_replicate (List.mem_of_mem_head? hy) + · exact replicate_no_adjacent_V _ + +/-- No two `V` layers are adjacent, a key independence property of the schedule. -/ +lemma wordPrefix_no_adjacent_V (k s r : ℕ) : + (wordPrefix k s r).IsChain (fun a b => a = false ∨ b = false) := by + induction r with + | zero => simp [wordPrefix] + | succ r ih => + apply ih.append (chunk_no_adjacent_V k s r) + intro x hx y hy + cases r with + | zero => simp [wordPrefix] at hx + | succ r => + left + have hlast := wordPrefix_last (r := r + 1) (by omega) k s + rw [hlast] at hx + simpa [eq_comm] using hx + +lemma word_no_adjacent_V (k s : ℕ) : + (word k s).IsChain (fun a b => a = false ∨ b = false) := + wordPrefix_no_adjacent_V k s k + +/-- Finite-indexed form of the balanced layer partition. -/ +def indexedWord {k : ℕ} (hk : 0 < k) (s : ℕ) : Fin (2 * k + s) → Bool := + fun i => (word k s).get ⟨i.val, by simp [word_length hk]⟩ + +/-- The finite set of the `V` layers. -/ +def vLayers {k : ℕ} (hk : 0 < k) (s : ℕ) : Finset (Fin (2 * k + s)) := + Finset.univ.filter (fun i => indexedWord hk s i = true) + +/-- The finite set of the `U` layers. -/ +def uLayers {k : ℕ} (hk : 0 < k) (s : ℕ) : Finset (Fin (2 * k + s)) := + Finset.univ.filter (fun i => indexedWord hk s i = false) + +lemma card_vLayers {k : ℕ} (hk : 0 < k) (s : ℕ) : (vLayers hk s).card = k := by + let v : List.Vector Bool (2 * k + s) := ⟨word k s, word_length hk s⟩ + have h := Fin.card_filter_univ_eq_vector_get_eq_count true v + change (vLayers hk s).card = (word k s).count true at h + simpa using h + +lemma card_uLayers {k : ℕ} (hk : 0 < k) (s : ℕ) : (uLayers hk s).card = k + s := by + let v : List.Vector Bool (2 * k + s) := ⟨word k s, word_length hk s⟩ + have h := Fin.card_filter_univ_eq_vector_get_eq_count false v + change (uLayers hk s).card = (word k s).count false at h + simpa [word_count_false hk] using h + +lemma layer_partition {k : ℕ} (hk : 0 < k) (s : ℕ) : + vLayers hk s ∪ uLayers hk s = Finset.univ := by + ext i + simp only [vLayers, uLayers, Finset.mem_union, Finset.mem_filter, + Finset.mem_univ, true_and, iff_true] + cases indexedWord hk s i <;> simp + +lemma layer_disjoint {k : ℕ} (hk : 0 < k) (s : ℕ) : + Disjoint (vLayers hk s) (uLayers hk s) := by + apply Finset.disjoint_left.2 + intro i hi hj + simp only [vLayers, uLayers, Finset.mem_filter, Finset.mem_univ, true_and] at hi hj + rw [hi] at hj + cases hj + +lemma indexedWord_no_adjacent_V {k : ℕ} (hk : 0 < k) (s : ℕ) + (i j : Fin (2 * k + s)) (hij : i.val + 1 = j.val) : + indexedWord hk s i = false ∨ indexedWord hk s j = false := by + have hlt : i.val + 1 < (word k s).length := by + rw [word_length hk, hij] + exact j.isLt + have h := List.isChain_iff_getElem.mp (word_no_adjacent_V k s) i.val hlt + simpa only [indexedWord, List.get_eq_getElem, hij] using h + +/-- Adjacent layer positions in either order. -/ +def adjacent {n : ℕ} (i j : Fin n) : Prop := i.val + 1 = j.val ∨ j.val + 1 = i.val + +lemma vLayers_independent {k : ℕ} (hk : 0 < k) (s : ℕ) + {i j : Fin (2 * k + s)} (hi : i ∈ vLayers hk s) (hij : adjacent i j) : + j ∉ vLayers hk s := by + intro hj + have hi' : indexedWord hk s i = true := (Finset.mem_filter.mp hi).2 + have hj' : indexedWord hk s j = true := (Finset.mem_filter.mp hj).2 + rcases hij with hij | hji + · have h := indexedWord_no_adjacent_V hk s i j hij + simp [hi', hj'] at h + · have h := indexedWord_no_adjacent_V hk s j i hji + simp [hi', hj'] at h + +/-- Internal vertices adjacent to a layer. Vertex `j` is between layers `j` and `j+1`. -/ +def internalEnds {n : ℕ} (i : Fin n) : Finset (Fin (n - 1)) := + Finset.univ.filter (fun j => j.val = i.val ∨ j.val + 1 = i.val) + +lemma internalEnds_disjoint_of_not_adjacent {n : ℕ} {i j : Fin n} + (hne : i ≠ j) (hij : ¬ adjacent i j) : + Disjoint (internalEnds i) (internalEnds j) := by + apply Finset.disjoint_left.2 + intro v hvi hvj + have hi := (Finset.mem_filter.mp hvi).2 + have hj := (Finset.mem_filter.mp hvj).2 + have hne' : i.val ≠ j.val := fun h => hne (Fin.ext h) + unfold adjacent at hij + omega + +/-- Distinct selected V layers depend on disjoint internal-vertex coordinates. -/ +lemma vLayers_internalEnds_disjoint {k : ℕ} (hk : 0 < k) (s : ℕ) + {i j : Fin (2 * k + s)} (hi : i ∈ vLayers hk s) (hj : j ∈ vLayers hk s) + (hne : i ≠ j) : Disjoint (internalEnds i) (internalEnds j) := by + apply internalEnds_disjoint_of_not_adjacent hne + exact fun hadj => vLayers_independent hk s hi hadj hj + +/-- The left end of an interior layer is an internal vertex. -/ +lemma mem_internalEnds_left {n : ℕ} (i : Fin n) (hi : 0 < i.val) : + (⟨i.val - 1, by omega⟩ : Fin (n - 1)) ∈ internalEnds i := by + simp only [internalEnds, Finset.mem_filter, Finset.mem_univ, true_and] + right + exact Nat.sub_add_cancel hi + +/-- The right end of a nonfinal layer is an internal vertex. -/ +lemma mem_internalEnds_right {n : ℕ} (i : Fin n) (hi : i.val + 1 < n) : + (⟨i.val, by omega⟩ : Fin (n - 1)) ∈ internalEnds i := by + simp [internalEnds] + +lemma card_internalEnds_le_two {n : ℕ} (i : Fin n) : (internalEnds i).card ≤ 2 := by + let f : Fin (n - 1) → Bool := fun v => v.val = i.val + have hinj : Set.InjOn f (internalEnds i : Set (Fin (n - 1))) := by + intro a ha b hb hab + have ha' := (Finset.mem_filter.mp ha).2 + have hb' := (Finset.mem_filter.mp hb).2 + have hab' : (decide (a.val = i.val)) = decide (b.val = i.val) := hab + apply Fin.ext + by_cases hai : a.val = i.val + · have hbi : b.val = i.val := by simpa [hai] using hab'.symm + omega + · have hbi : b.val ≠ i.val := by simpa [hai] using hab'.symm + omega + calc + (internalEnds i).card = ((internalEnds i).image f).card := + (Finset.card_image_of_injOn hinj).symm + _ ≤ Fintype.card Bool := Finset.card_le_univ _ + _ = 2 := by decide + +end BalancedSchedule +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BalancedWordSum.lean b/lean/OAI/Algebra/DepthFive/BalancedWordSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..931a12107661498f720f4d59afea0ff576292ef8 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BalancedWordSum.lean @@ -0,0 +1,108 @@ +import OAI.Algebra.DepthFive.LowerSchedule +import OAI.Algebra.DepthFive.ScheduleWeightBridge +import OAI.Algebra.DepthFive.WordSum + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335.LowerParameters + +/-- The full graph-word estimate for the actual balanced layer partition. +All path-graph, endpoint, flip, and cardinality premises are discharged. -/ +lemma balanced_word_sum_bound_of_product {n : ℕ} (hn : 4 ≤ n + 1) + (A B E : ℝ) (hA : 1 ≤ A) (hAN : A ≤ Real.sqrt ((n + 1 : ℕ) : ℝ)) + (hB : 0 ≤ B) (hE : E ≤ Real.sqrt ((n + 1 : ℕ) : ℝ)) + (hprod : ∀ w : Fin (n + 1) → Bool, + A ^ ((Finset.univ.filter (fun i => balancedLayer hn i = true)).filter + (fun i => w i = true)).card * + B ^ ((Finset.univ \ Finset.univ.filter (fun i => balancedLayer hn i = true)).filter + (fun i => w i = true)).card ≤ + Real.exp E * ((n + 1 : ℕ) : ℝ) ^ WordRuns.runCount w) : + (∑ w : Fin (n + 1) → Bool, + IsolatedWeight.weight (BalancedSchedule.internalEdges (n + 1)) + (Finset.univ.filter (fun i => balancedLayer hn i = true)) + BalancedSchedule.adjacent A B (((n + 1 : ℕ) : ℝ)⁻¹) w) ≤ + Real.exp (8 * Real.sqrt ((n + 1 : ℕ) : ℝ)) := by + classical + let V := Finset.univ.filter (fun i => balancedLayer hn i = true) + let first : Fin (n + 1) := ⟨0, by omega⟩ + let S := V.erase first + have hfirst : first ∈ V := by + apply Finset.mem_filter.mpr + exact ⟨Finset.mem_univ _, balancedLayer_first hn⟩ + apply WordSum.sum_actual_weight_le_exp_of_endpoints n A B E + (BalancedSchedule.internalEdges (n + 1)) V S BalancedSchedule.adjacent + · exact Finset.erase_subset _ _ + · intro i hi j hij hj + exact balancedLayer_independent hn (Finset.mem_filter.mp hi).2 + (Finset.mem_filter.mp hj).2 hij + · intro e he + exact BalancedSchedule.internalEdges_adjacent he + · intro i hi + obtain ⟨hifirst, hiV⟩ := Finset.mem_erase.mp hi + have hival : i.val ≠ 0 := by + intro h + exact hifirst (Fin.ext h) + have hlast : i.val + 1 < n + 1 := by + by_contra hf + have heq : i = ⟨(n + 1) - 1, by omega⟩ := by + apply Fin.ext + change i.val = (n + 1) - 1 + have := i.isLt + omega + have hitrue := (Finset.mem_filter.mp hiV).2 + rw [heq, balancedLayer_final hn] at hitrue + cases hitrue + rw [BalancedSchedule.endpointDegree_internalEdges] + exact BalancedSchedule.card_internalEnds_eq_two i (by omega) hlast + · intro w + rw [BalancedSchedule.internalEdges_eq_pathEdges, + SwitchRestoration.switchCount_pathEdges] + simp [WordSwitches.switches, Finset.card_filter] + · change (V \ V.erase first).card ≤ 1 + rw [Finset.sdiff_erase hfirst] + simp + · have hcard : V.card = k (n + 1) := balancedLayer_card_true hn + rw [hcard] + have hle : 2 * k (n + 1) ≤ n + 1 := by + have h := two_mul_k_add_s (n + 1) + omega + exact_mod_cast hle + · exact hA + · exact hAN + · exact hB + · exact hE + · exact hprod + +/-- The canonical balanced schedule satisfies the complete corrected-word bound. +The only premises are the scalar parameter inequalities. -/ +lemma balanced_word_sum_bound {n : ℕ} (hn : 4 ≤ n) {α β ε : ℝ} + (hα : 0 < α) (hα1 : α ≤ 1) (hαN : α⁻¹ ≤ Real.sqrt (n : ℝ)) + (hβ : 0 ≤ β) (hβupper : β ≤ α ^ rho n * Real.exp ε) + (hscale : α ^ (-(1 + rho n)) ≤ (n : ℝ)) + (hε : 0 ≤ ε) (hεN : ε * (n : ℝ) ≤ Real.sqrt (n : ℝ)) : + (∑ w : Fin n → Bool, + IsolatedWeight.weight (BalancedSchedule.internalEdges n) + (Finset.univ.filter (fun i => balancedLayer hn i = true)) + BalancedSchedule.adjacent α⁻¹ β ((n : ℝ)⁻¹) w) ≤ + Real.exp (8 * Real.sqrt (n : ℝ)) := by + classical + cases n with + | zero => omega + | succ n => + apply balanced_word_sum_bound_of_product hn α⁻¹ β (ε * ((n + 1 : ℕ) : ℝ)) + ((one_le_inv₀ hα).2 hα1) hαN hβ hεN + intro w + apply RunLayerWeights.count_weight_le_exp_mul_runCount w + (Finset.univ.filter (fun i => balancedLayer hn i = true)) + hα hα1 hβ hε hβupper hscale + intro b hb + simpa using (balancedLayer_infix_discrepancy hn b hb).le + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/Basic.lean b/lean/OAI/Algebra/DepthFive/Basic.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c971f51f6abdbe5f9c59b7792e5a965caa73661 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/Basic.lean @@ -0,0 +1,122 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped BigOperators +universe u + +namespace Problem335 + +inductive D5Leaf (K : Type u) (n : ℕ) where + | scalar : K → D5Leaf K n + | variable : (Fin n × Fin n × Fin n) → D5Leaf K n + +def d5LeafDegree {K : Type u} {n : ℕ} : D5Leaf K n → ℕ + | D5Leaf.scalar _ => 0 + | D5Leaf.variable _ => 1 + +structure Depth5Circuit (K : Type u) [CommSemiring K] (n : ℕ) where + leafCount : ℕ + leaves : Fin leafCount → D5Leaf K n + bottomCount : ℕ + bottomInputs : Fin bottomCount → List (K × Fin leafCount) + bottomDegree : Fin bottomCount → ℕ + bottomHomogeneous : + ∀ i entry, entry ∈ bottomInputs i → d5LeafDegree (leaves entry.2) = bottomDegree i + bottomEmpty : + ∀ i, bottomInputs i = [] → bottomDegree i = 0 + lowerCount : ℕ + lowerInputs : Fin lowerCount → List (Fin bottomCount) + middleCount : ℕ + middleInputs : Fin middleCount → List (K × Fin lowerCount) + middleDegree : Fin middleCount → ℕ + middleHomogeneous : + ∀ i entry, entry ∈ middleInputs i → + ((lowerInputs entry.2).map bottomDegree).sum = middleDegree i + middleEmpty : + ∀ i, middleInputs i = [] → middleDegree i = 0 + upperCount : ℕ + upperInputs : Fin upperCount → List (Fin middleCount) + outputInputs : List (K × Fin upperCount) + outputDegree : ℕ + outputHomogeneous : + ∀ entry, entry ∈ outputInputs → + ((upperInputs entry.2).map middleDegree).sum = outputDegree + outputEmpty : + outputInputs = [] → outputDegree = 0 + +def d5LeafValue {K : Type u} [CommSemiring K] {n : ℕ} + (x : D5Leaf K n) : MvPolynomial (Fin n × Fin n × Fin n) K := + match x with + | D5Leaf.scalar a => MvPolynomial.C a + | D5Leaf.variable i => MvPolynomial.X i + +def bottomValue {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) (i : Fin c.bottomCount) : + MvPolynomial (Fin n × Fin n × Fin n) K := by + classical + exact ((c.bottomInputs i).map (fun entry => + MvPolynomial.C entry.1 * d5LeafValue (c.leaves entry.2))).sum + +def lowerValue {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) (i : Fin c.lowerCount) : + MvPolynomial (Fin n × Fin n × Fin n) K := by + classical + exact ((c.lowerInputs i).map (fun j => bottomValue c j)).prod + +def middleValue {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) (i : Fin c.middleCount) : + MvPolynomial (Fin n × Fin n × Fin n) K := by + classical + exact ((c.middleInputs i).map (fun entry => + MvPolynomial.C entry.1 * lowerValue c entry.2)).sum + +def upperValue {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) (i : Fin c.upperCount) : + MvPolynomial (Fin n × Fin n × Fin n) K := by + classical + exact ((c.upperInputs i).map (fun j => middleValue c j)).prod + +def circuitValue {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) : MvPolynomial (Fin n × Fin n × Fin n) K := by + classical + exact (c.outputInputs.map (fun entry => + MvPolynomial.C entry.1 * upperValue c entry.2)).sum + +def circuitSize {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) : ℕ := + c.leafCount + c.bottomCount + c.lowerCount + c.middleCount + c.upperCount + 1 + +def immLayer (K : Type u) [CommSemiring K] (n : ℕ) (t : Fin n) : + Matrix (Fin n) (Fin n) (MvPolynomial (Fin n × Fin n × Fin n) K) := + fun i j => MvPolynomial.X (t, i, j) + +def imm (K : Type u) [CommSemiring K] (n : ℕ) : + MvPolynomial (Fin n × Fin n × Fin n) K := by + classical + by_cases h : 0 < n + · let matrices : + List (Matrix (Fin n) (Fin n) + (MvPolynomial (Fin n × Fin n × Fin n) K)) := + List.ofFn (fun t : Fin n => immLayer K n t) + exact matrices.prod ⟨0, h⟩ ⟨0, h⟩ + · exact 0 + +def ceilSqrt (n : ℕ) : ℕ := + Nat.sqrt n + if (Nat.sqrt n) ^ 2 = n then 0 else 1 + +def ceilDiv (n t : ℕ) : ℕ := + (n + t - 1) / t + +def upperGateBound (n : ℕ) : ℕ := + let t := ceilSqrt n + let r := ceilDiv n t + 2 * n ^ 3 + r * n ^ 2 + r * n ^ (t + 1) + n ^ (r - 1) + 1 + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BetaRefinements.lean b/lean/OAI/Algebra/DepthFive/BetaRefinements.lean new file mode 100644 index 0000000000000000000000000000000000000000..1aad5695f916e2934b875029f00b409aedb733dc --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BetaRefinements.lean @@ -0,0 +1,49 @@ +import OAI.Algebra.DepthFive.AnalyticParameters +import OAI.Algebra.DepthFive.FractionRounding + +namespace OAI + +noncomputable section +namespace Problem335.LowerParameters + +/-- The rounded multiplication fraction has logarithmic error at most `2/b`. -/ +theorem beta_log_error_bounds {n : ℕ} (hn : 16 ≤ n) : + 0 ≤ Real.log (beta n / ((alpha n) ^ (rho n))) ∧ + Real.log (beta n / ((alpha n) ^ (rho n))) ≤ 2 / (b n : ℝ) := by + have hn4 : 4 ≤ n := by omega + have hu : (0 : ℝ) < u n := by exact_mod_cast u_pos hn4 + have hp : 0 < (alpha n) ^ (rho n) := alpha_rpow_rho_pos hn4 + have hp1 : (alpha n) ^ (rho n) < 1 := alpha_rpow_rho_lt_one hn4 + have hpm : 0 < 1 - (alpha n) ^ (rho n) := sub_pos.mpr hp1 + have hx := b0_pos hn4 + have hab := a_le_b0 hn4 + have ha : 4 * (n : ℝ) ≤ (a n : ℝ) := by exact_mod_cast four_mul_n_le_a hn + have hnR : (16 : ℝ) ≤ n := by exact_mod_cast hn + have hxone : 1 ≤ b0 n := by linarith + have hbase : b0 n / (b0 n + (u n : ℝ)) = (alpha n) ^ (rho n) := by + unfold b0 + field_simp [ne_of_gt hu, ne_of_gt hpm] + ring + have hratio : ((b n : ℝ) / ((b n : ℝ) + (u n : ℝ))) / + (b0 n / (b0 n + (u n : ℝ))) = beta n / ((alpha n) ^ (rho n)) := by + rw [hbase, beta] + constructor + · rw [← hratio] + exact (fraction_rounding_log_bounds hx hu (b0_le_b n) (b_lt_b0_add_one hn4).le).1 + · rw [← hratio] + exact fraction_rounding_log_le_two_div hxone hu (b0_le_b n) (b_lt_b0_add_one hn4).le + +/-- Sharp multiplicative rounding bound used when summing path runs. -/ +theorem beta_le_rpow_mul_exp_two_div {n : ℕ} (hn : 16 ≤ n) : + beta n ≤ (alpha n) ^ (rho n) * Real.exp (2 / (b n : ℝ)) := by + have hn4 : 4 ≤ n := by omega + have hp : 0 < (alpha n) ^ (rho n) := alpha_rpow_rho_pos hn4 + have hratio : 0 < beta n / ((alpha n) ^ (rho n)) := div_pos (beta_pos hn4) hp + have h := (Real.log_le_iff_le_exp hratio).mp (beta_log_error_bounds hn).2 + exact ((div_le_iff₀ hp).mp h).trans_eq (mul_comm _ _) + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/Bidegree.lean b/lean/OAI/Algebra/DepthFive/Bidegree.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f9ba991daf91d86127dccaffa7f7279ad2fbf9e --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/Bidegree.lean @@ -0,0 +1,158 @@ +import Mathlib + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335 +namespace Bidegree + +open MvPolynomial Finsupp + +variable {σ R : Type*} [CommSemiring R] + +/-- The indicator weight of the derivative-variable side of a partition. -/ +def weight (side : σ → Bool) (x : σ) : ℕ := if side x then 1 else 0 + +/-- Projection onto one degree in the selected variables. -/ +def component (side : σ → Bool) (i : ℕ) : + MvPolynomial σ R →ₗ[R] MvPolynomial σ R := + weightedHomogeneousComponent (weight side) i + +@[simp] theorem coeff_component (side : σ → Bool) (i : ℕ) + (p : MvPolynomial σ R) (d : σ →₀ ℕ) : + (component side i p).coeff d = + if Finsupp.weight (weight side) d = i then p.coeff d else 0 := + coeff_weightedHomogeneousComponent i p d + +theorem weight_add_complement (side : σ → Bool) (d : σ →₀ ℕ) : + Finsupp.weight (weight side) d + + Finsupp.weight (weight (fun x => !(side x))) d = d.degree := by + classical + simp only [Finsupp.weight_apply, Finsupp.sum, Finsupp.degree_apply] + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro x hx + cases h : side x <;> simp [weight, h] + +theorem weight_le_degree (side : σ → Bool) (d : σ →₀ ℕ) : + Finsupp.weight (weight side) d ≤ d.degree := by + have := weight_add_complement side d + omega + +theorem component_isWeightedHomogeneous (side : σ → Bool) (i : ℕ) + (p : MvPolynomial σ R) : + (component side i p).IsWeightedHomogeneous (weight side) i := + weightedHomogeneousComponent_isWeightedHomogeneous i p + +theorem component_isHomogeneous (side : σ → Bool) (i : ℕ) + {p : MvPolynomial σ R} {n : ℕ} (hp : p.IsHomogeneous n) : + (component side i p).IsHomogeneous n := by + intro d hd + apply hp + intro hz + simp [hz] at hd + +theorem component_complement_degree (side : σ → Bool) (i : ℕ) + {p : MvPolynomial σ R} {n : ℕ} (hp : p.IsHomogeneous n) : + (component side i p).IsWeightedHomogeneous (weight (fun x => !(side x))) (n - i) := by + intro d hd + have hi := component_isWeightedHomogeneous side i p hd + have hn := component_isHomogeneous side i hp hd + change Finsupp.weight (fun _ : σ => 1) d = n at hn + have hsum := weight_add_complement side d + rw [Finsupp.degree_eq_weight_one] at hsum + omega + +theorem component_eq_zero_of_lt (side : σ → Bool) + {p : MvPolynomial σ R} {n i : ℕ} (hp : p.IsHomogeneous n) (hi : n < i) : + component side i p = 0 := by + ext d + rw [coeff_component, AddMonoidAlgebra.coeff_zero] + split_ifs with h + · by_contra hz + have hn := hp hz + change Finsupp.weight (fun _ : σ => 1) d = n at hn + have := weight_le_degree side d + rw [Finsupp.degree_eq_weight_one] at this + omega + · rfl + +/-- A homogeneous polynomial is the sum of its bidegree components. -/ +theorem sum_components (side : σ → Bool) {p : MvPolynomial σ R} {n : ℕ} + (hp : p.IsHomogeneous n) : + (∑ i ∈ Finset.range (n + 1), component side i p) = p := by + classical + ext d + simp only [coeff_sum, coeff_component] + by_cases hd : p.coeff d = 0 + · simp [hd] + · have hn := hp hd + change Finsupp.weight (fun _ : σ => 1) d = n at hn + have hle := weight_le_degree side d + rw [Finsupp.degree_eq_weight_one] at hle + have hmem : Finsupp.weight (weight side) d ∈ Finset.range (n + 1) := by + simp only [Finset.mem_range] + omega + rw [Finset.sum_eq_single (Finsupp.weight (weight side) d)] + · simp + · intro b hb hne + simp [Ne.symm hne] + · exact fun h => (h hmem).elim + +@[simp] theorem component_same (side : σ → Bool) {p : MvPolynomial σ R} {i : ℕ} + (hp : p.IsWeightedHomogeneous (weight side) i) : component side i p = p := + hp.weightedHomogeneousComponent_same + +theorem component_ne (side : σ → Bool) {p : MvPolynomial σ R} {i j : ℕ} + (hp : p.IsWeightedHomogeneous (weight side) i) (hji : j ≠ i) : + component side j p = 0 := + hp.weightedHomogeneousComponent_ne j hji + +theorem component_of_weightedHomogeneous (side : σ → Bool) + {p : MvPolynomial σ R} {i : ℕ} + (hp : p.IsWeightedHomogeneous (weight side) i) (k : ℕ) : + component side k p = if k = i then p else 0 := by + classical + exact weightedHomogeneousComponent_of_mem hp + +/-- Distributing a finite product over all choices of bidegrees. -/ +theorem prod_eq_sum_components {ι : Type*} [Fintype ι] [DecidableEq ι] + (side : σ → Bool) (p : ι → MvPolynomial σ R) (e : ι → ℕ) + (hp : ∀ a, (p a).IsHomogeneous (e a)) : + (∏ a, p a) = + ∑ f ∈ Fintype.piFinset (fun a => Finset.range (e a + 1)), + ∏ a, component side (f a) (p a) := by + classical + calc + (∏ a, p a) = ∏ a, ∑ i ∈ Finset.range (e a + 1), component side i (p a) := by + apply Finset.prod_congr rfl + intro a ha + exact (sum_components side (hp a)).symm + _ = _ := Finset.prod_univ_sum _ _ + +/-- Projection of the product keeps exactly degree assignments whose sum is `k`. -/ +theorem component_prod {ι : Type*} [Fintype ι] [DecidableEq ι] + (side : σ → Bool) (p : ι → MvPolynomial σ R) (e : ι → ℕ) + (hp : ∀ a, (p a).IsHomogeneous (e a)) (k : ℕ) : + component side k (∏ a, p a) = + ∑ f ∈ Fintype.piFinset (fun a => Finset.range (e a + 1)), + if (∑ a, f a) = k then ∏ a, component side (f a) (p a) else 0 := by + classical + rw [prod_eq_sum_components side p e hp, map_sum] + apply Finset.sum_congr rfl + intro f hf + have hprod : (∏ a, component side (f a) (p a)).IsWeightedHomogeneous + (weight side) (∑ a, f a) := by + exact IsWeightedHomogeneous.prod _ _ _ (fun a ha => + component_isWeightedHomogeneous side (f a) (p a)) + rw [component_of_weightedHomogeneous side hprod] + simp only [eq_comm] + +end Bidegree +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BidegreeAverages.lean b/lean/OAI/Algebra/DepthFive/BidegreeAverages.lean new file mode 100644 index 0000000000000000000000000000000000000000..76b9818c6136212004cd469785ed4f18fb020b72 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BidegreeAverages.lean @@ -0,0 +1,95 @@ +import OAI.Algebra.DepthFive.ExponentCardinality + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335.BidegreeAverages + +/-- A weak composition indexed by a finite variable set. -/ +abbrev Composition (σ : Type*) [Fintype σ] (a : ℕ) := + {d : σ → ℕ // ∑ x, d x = a} + +/-- The exponent index set for the source of the mixed operator. -/ +abbrev Index {σ : Type*} (isV : σ → Bool) (a b : ℕ) := + {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)} + +/-- Summing a separated function over bihomogeneous exponent vectors factors +into the two weak-composition sums. This is the independence of the two +occupation groups, not independence of coordinates within either group. -/ +theorem sum_split {σ : Type*} [Fintype σ] (isV : σ → Bool) (a b : ℕ) + (f : ({x // isV x = true} → ℕ) → ℝ) + (g : ({x // ¬ isV x = true} → ℕ) → ℝ) : + (∑' d : Index isV a b, + f (fun x => d.val x) * g (fun x => d.val x)) = + (∑' v : Composition {x // isV x = true} a, f v.val) * + (∑' u : Composition {x // ¬ isV x = true} b, g u.val) := by + classical + let : Fintype (Composition {x // isV x = true} a) := + Fintype.ofEquiv (Sym {x // isV x = true} a) + (Sym.equivNatSumOfFintype _ _) + let : Fintype (Composition {x // ¬ isV x = true} b) := + Fintype.ofEquiv (Sym {x // ¬ isV x = true} b) + (Sym.equivNatSumOfFintype _ _) + calc + _ = ∑' z : Composition {x // isV x = true} a × + Composition {x // ¬ isV x = true} b, f z.1.val * g z.2.val := + (bidegreeExponentsEquiv isV a b).tsum_eq (fun z => f z.1.val * g z.2.val) + _ = _ := by + simp only [tsum_fintype, Fintype.sum_prod_type] + exact (Fintype.sum_mul_sum + (fun v : Composition {x // isV x = true} a => f v.val) + (fun u : Composition {x // ¬ isV x = true} b => g u.val)).symm + +/-- The normalized form of `sum_split`: the uniform domain occupation average +is the product of the two uniform weak-composition averages. Empty index sets +are handled by the usual convention that division by zero is zero. -/ +theorem average_split {σ : Type*} [Fintype σ] (isV : σ → Bool) (a b : ℕ) + (f : ({x // isV x = true} → ℕ) → ℝ) + (g : ({x // ¬ isV x = true} → ℕ) → ℝ) : + (∑' d : Index isV a b, + f (fun x => d.val x) * g (fun x => d.val x)) / + (Nat.card (Index isV a b) : ℝ) = + ((∑' v : Composition {x // isV x = true} a, f v.val) / + (Nat.card (Composition {x // isV x = true} a) : ℝ)) * + ((∑' u : Composition {x // ¬ isV x = true} b, g u.val) / + (Nat.card (Composition {x // ¬ isV x = true} b) : ℝ)) := by + rw [sum_split, Nat.card_congr (bidegreeExponentsEquiv isV a b), + Nat.card_prod, Nat.cast_mul, div_mul_div_comm] + +/-- Finite-sum version, compatible with any chosen enumerations of the three +finite index types (in particular with matrix bases). -/ +theorem sum_split_fintype {σ : Type*} [Fintype σ] (isV : σ → Bool) (a b : ℕ) + [Fintype (Index isV a b)] + [Fintype (Composition {x // isV x = true} a)] + [Fintype (Composition {x // ¬ isV x = true} b)] + (f : ({x // isV x = true} → ℕ) → ℝ) + (g : ({x // ¬ isV x = true} → ℕ) → ℝ) : + (∑ d : Index isV a b, + f (fun x => d.val x) * g (fun x => d.val x)) = + (∑ v : Composition {x // isV x = true} a, f v.val) * + (∑ u : Composition {x // ¬ isV x = true} b, g u.val) := by + simpa only [tsum_fintype] using sum_split isV a b f g + +/-- The average identity with the exact stars-and-bars dimension factors. -/ +theorem average_split_multichoose {σ : Type*} [Fintype σ] + (isV : σ → Bool) (a b : ℕ) + (f : ({x // isV x = true} → ℕ) → ℝ) + (g : ({x // ¬ isV x = true} → ℕ) → ℝ) : + (∑' d : Index isV a b, + f (fun x => d.val x) * g (fun x => d.val x)) / + (((Fintype.card {x // isV x = true}).multichoose a : ℝ) * + ((Fintype.card {x // ¬ isV x = true}).multichoose b : ℝ)) = + ((∑' v : Composition {x // isV x = true} a, f v.val) / + ((Fintype.card {x // isV x = true}).multichoose a : ℝ)) * + ((∑' u : Composition {x // ¬ isV x = true} b, g u.val) / + ((Fintype.card {x // ¬ isV x = true}).multichoose b : ℝ)) := by + simpa only [Index, Composition, card_bidegree_exponents, + card_homogeneous_functions, Nat.cast_mul] using average_split isV a b f g + +end Problem335.BidegreeAverages + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BidegreeBasis.lean b/lean/OAI/Algebra/DepthFive/BidegreeBasis.lean new file mode 100644 index 0000000000000000000000000000000000000000..bc08cdc446b6087456dcebae79e1affdbd119155 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BidegreeBasis.lean @@ -0,0 +1,74 @@ +import OAI.Algebra.DepthFive.OperatorRank + +namespace OAI + +noncomputable section + +namespace Problem335 + +universe u v + +/-- Ordinary monomial basis of a fixed bidegree subspace. -/ +def bidegreeMonomialBasis (K : Type u) [CommSemiring K] + {σ : Type v} (side : σ → Bool) (a b : ℕ) : + Module.Basis {m : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) m = (a, b)} K + (bidegreeSubmodule (K := K) side a b) := + (MvPolynomial.basisRestrictSupport K + {m : σ →₀ ℕ | Finsupp.weight (bidegreeWeight side) m = (a, b)}).map + (LinearEquiv.ofEq _ _ + (MvPolynomial.weightedHomogeneousSubmodule_eq_finsupp_supported + K (bidegreeWeight side) (a, b)).symm) + +@[simp] theorem bidegreeMonomialBasis_repr (K : Type u) [CommSemiring K] + {σ : Type v} (side : σ → Bool) (a b : ℕ) + (p : bidegreeSubmodule (K := K) side a b) + (d : {m : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) m = (a, b)}) : + (bidegreeMonomialBasis K side a b).repr p d = p.1.coeff d.1 := by + rfl + +@[simp] theorem bidegreeMonomialBasis_apply (K : Type u) [CommSemiring K] + {σ : Type v} (side : σ → Bool) (a b : ℕ) + (d : {m : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) m = (a, b)}) : + ((bidegreeMonomialBasis K side a b) d : MvPolynomial σ K) = + MvPolynomial.monomial d.1 1 := by + classical + have hm : MvPolynomial.monomial d.1 (1 : K) ∈ + bidegreeSubmodule (K := K) side a b := by + exact MvPolynomial.isWeightedHomogeneous_monomial (bidegreeWeight side) d.1 1 d.2 + have he : (bidegreeMonomialBasis K side a b) d = + ⟨MvPolynomial.monomial d.1 1, hm⟩ := by + apply (bidegreeMonomialBasis K side a b).repr.injective + ext j + rw [Module.Basis.repr_self, bidegreeMonomialBasis_repr] + simp [MvPolynomial.coeff_monomial, Finsupp.single_apply, Subtype.ext_iff] + exact congrArg Subtype.val he + +/-- Finite monomial indexing for bidegree spaces over a finite variable set. -/ +instance bidegreeMonomialFintype {σ : Type v} [Finite σ] + (side : σ → Bool) (a b : ℕ) : + Fintype {m : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) m = (a, b)} := + (finite_bidegreeMonomials side a b).fintype + +/-- Matrix entries in the ordinary bidegree monomial bases are polynomial coefficients. -/ +theorem bidegree_toMatrix_apply (K : Type u) [CommSemiring K] + {σ : Type v} [Finite σ] [DecidableEq σ] (side : σ → Bool) (a b c d : ℕ) + (F : bidegreeSubmodule (K := K) side a b →ₗ[K] + bidegreeSubmodule (K := K) side c d) + (i : {m : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) m = (c, d)}) + (j : {m : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) m = (a, b)}) : + (LinearMap.toMatrix (bidegreeMonomialBasis K side a b) + (bidegreeMonomialBasis K side c d) F) i j = + (F ⟨MvPolynomial.monomial j.1 1, + MvPolynomial.isWeightedHomogeneous_monomial (bidegreeWeight side) j.1 1 j.2⟩).1.coeff i.1 := by + classical + have hb : (bidegreeMonomialBasis K side a b) j = + ⟨MvPolynomial.monomial j.1 1, + MvPolynomial.isWeightedHomogeneous_monomial (bidegreeWeight side) j.1 1 j.2⟩ := + Subtype.ext (bidegreeMonomialBasis_apply K side a b j) + rw [LinearMap.toMatrix_apply, bidegreeMonomialBasis_repr, hb] + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BidegreeBridge.lean b/lean/OAI/Algebra/DepthFive/BidegreeBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb903a8743d74641404d5f15c5f6f25d3a1399fb --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BidegreeBridge.lean @@ -0,0 +1,126 @@ +import OAI.Algebra.DepthFive.Bidegree +import OAI.Algebra.DepthFive.OperatorRank + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335 + +open MvPolynomial +variable {σ R : Type*} [CommSemiring R] + +/-- The paired weight is exactly the two complementary indicator weights. -/ +theorem bidegreeWeight_eq_pair (side : σ → Bool) (d : σ →₀ ℕ) : + Finsupp.weight (bidegreeWeight side) d = + (Finsupp.weight (Bidegree.weight side) d, + Finsupp.weight (Bidegree.weight (fun x => !(side x))) d) := by + classical + apply Prod.ext <;> + simp only [Finsupp.weight_apply, Finsupp.sum, Prod.fst_sum, Prod.snd_sum, + Prod.smul_fst, Prod.smul_snd] <;> + apply Finset.sum_congr rfl <;> + intro x hx <;> + cases h : side x <;> simp [bidegreeWeight, Bidegree.weight, h] + +theorem mem_bidegreeSubmodule_iff_indicator (side : σ → Bool) (i j : ℕ) + (p : MvPolynomial σ R) : + p ∈ bidegreeSubmodule side i j ↔ + p.IsWeightedHomogeneous (Bidegree.weight side) i ∧ + p.IsWeightedHomogeneous (Bidegree.weight (fun x => !(side x))) j := by + constructor + · intro h + constructor + · intro d hd + have hh := h hd + rw [bidegreeWeight_eq_pair] at hh + exact congrArg Prod.fst hh + · intro d hd + have hh := h hd + rw [bidegreeWeight_eq_pair] at hh + exact congrArg Prod.snd hh + · rintro ⟨h₁, h₂⟩ d hd + rw [bidegreeWeight_eq_pair, h₁ hd, h₂ hd] + +/-- On total degree `n`, a single degree projection already fixes the other degree. -/ +theorem bidegreeComponent_sub_eq_component (side : σ → Bool) (i : ℕ) + {p : MvPolynomial σ R} {n : ℕ} (hp : p.IsHomogeneous n) : + bidegreeComponent side i (n - i) p = Bidegree.component side i p := by + classical + ext d + rw [coeff_bidegreeComponent, Bidegree.coeff_component, bidegreeWeight_eq_pair] + by_cases hz : p.coeff d = 0 + · simp [hz] + · have hn := hp hz + change Finsupp.weight (fun _ : σ => 1) d = n at hn + have hsum := Bidegree.weight_add_complement side d + rw [Finsupp.degree_eq_weight_one] at hsum + by_cases hi : Finsupp.weight (Bidegree.weight side) d = i + · have hj : Finsupp.weight (Bidegree.weight (fun x => !(side x))) d = n - i := by + omega + simp [hi, hj] + · simp [hi] + +theorem bidegreeComponent_eq_component (side : σ → Bool) (i j : ℕ) + {p : MvPolynomial σ R} (hp : p.IsHomogeneous (i + j)) : + bidegreeComponent side i j p = Bidegree.component side i p := by + simpa only [Nat.add_sub_cancel_left] using bidegreeComponent_sub_eq_component side i hp + +theorem component_mem_bidegreeSubmodule (side : σ → Bool) (i : ℕ) + {p : MvPolynomial σ R} {n : ℕ} (hp : p.IsHomogeneous n) : + Bidegree.component side i p ∈ bidegreeSubmodule side i (n - i) := by + rw [← bidegreeComponent_sub_eq_component side i hp] + exact bidegreeComponent_mem side i (n - i) p + +theorem sum_bidegreeComponents (side : σ → Bool) + {p : MvPolynomial σ R} {n : ℕ} (hp : p.IsHomogeneous n) : + (∑ i ∈ Finset.range (n + 1), bidegreeComponent side i (n - i) p) = p := by + simp_rw [bidegreeComponent_sub_eq_component side _ hp] + exact Bidegree.sum_components side hp + +/-- The product-rank expansion, expressed in the paired bidegree API. -/ +theorem bidegreeComponent_prod {ι : Type*} [Fintype ι] [DecidableEq ι] + (side : σ → Bool) (p : ι → MvPolynomial σ R) (e : ι → ℕ) + (hp : ∀ a, (p a).IsHomogeneous (e a)) (k m : ℕ) + (hkm : k + m = ∑ a, e a) : + bidegreeComponent side k m (∏ a, p a) = + ∑ f ∈ Fintype.piFinset (fun a => Finset.range (e a + 1)), + if (∑ a, f a) = k then + ∏ a, bidegreeComponent side (f a) (e a - f a) (p a) else 0 := by + classical + have htotal : (∏ a, p a).IsHomogeneous (k + m) := by + rw [hkm] + exact IsHomogeneous.prod _ _ _ (fun a ha => hp a) + rw [bidegreeComponent_eq_component side k m htotal, + Bidegree.component_prod side p e hp k] + simp_rw [bidegreeComponent_sub_eq_component side _ (hp _)] + +/-- A summand in the constrained expansion has the intended target bidegree. -/ +theorem component_product_mem_bidegree {ι : Type*} [Fintype ι] + (side : σ → Bool) (p : ι → MvPolynomial σ R) (e f : ι → ℕ) + (hp : ∀ a, (p a).IsHomogeneous (e a)) (k m : ℕ) + (hkm : k + m = ∑ a, e a) (hf : ∑ a, f a = k) : + (∏ a, Bidegree.component side (f a) (p a)) ∈ bidegreeSubmodule side k m := by + classical + let q := ∏ a, Bidegree.component side (f a) (p a) + have htotal : q.IsHomogeneous (k + m) := by + rw [hkm] + exact IsHomogeneous.prod _ _ _ (fun a ha => + Bidegree.component_isHomogeneous side (f a) (hp a)) + have hweight : q.IsWeightedHomogeneous (Bidegree.weight side) k := by + rw [← hf] + exact IsWeightedHomogeneous.prod _ _ _ (fun a ha => + Bidegree.component_isWeightedHomogeneous side (f a) (p a)) + have heq : bidegreeComponent side k m q = q := by + rw [bidegreeComponent_eq_component side k m htotal, + Bidegree.component_same side hweight] + change q ∈ bidegreeSubmodule side k m + rw [← heq] + exact bidegreeComponent_mem side k m q + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BidegreeCompositionReindex.lean b/lean/OAI/Algebra/DepthFive/BidegreeCompositionReindex.lean new file mode 100644 index 0000000000000000000000000000000000000000..ff9c989d8f370d6b24b509c2cce4e6499ec4e1c8 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BidegreeCompositionReindex.lean @@ -0,0 +1,78 @@ +import OAI.Algebra.DepthFive.ExponentCardinality + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Problem335 + +private theorem double_sum_coe_sort {α β : Type*} (s : Finset α) (t : Finset β) + (f : α → β → ℝ) : + (∑ x : s, ∑ y : t, f x y) = ∑ x ∈ s, ∑ y ∈ t, f x y := by + rw [Finset.sum_coe_sort s (fun x => ∑ y : t, f x y)] + apply Finset.sum_congr rfl + intro x hx + exact Finset.sum_coe_sort t (f x) + +variable {σ : Type*} [Fintype σ] [DecidableEq σ] + +/-- Reindex a bidegree exponent by its two finite occupation antidiagonals. -/ +def bidegreeAntidiagEquiv (side : σ → Bool) (a b : ℕ) : + {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) d = (a,b)} ≃ + (Finset.finsuppAntidiag (Finset.univ : Finset {i // side i = true}) a) × + (Finset.finsuppAntidiag (Finset.univ : Finset {i // ¬ side i = true}) b) := + (bidegreeExponentsEquiv side a b).trans + (Equiv.prodCongr (homogeneousFunctionsEquivAntidiag a) + (homogeneousFunctionsEquivAntidiag b)) + +theorem bidegreeAntidiagEquiv_join (side : σ → Bool) (a b : ℕ) + (d : {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) d = (a,b)}) : + (fun i => if h : side i = true then + (bidegreeAntidiagEquiv side a b d).1.val ⟨i,h⟩ else + (bidegreeAntidiagEquiv side a b d).2.val ⟨i,h⟩) = d.val := by + funext i + by_cases h : side i = true <;> + simp [bidegreeAntidiagEquiv, bidegreeExponentsEquiv, + homogeneousFunctionsEquivAntidiag, Equiv.subtypeProdEquivProd, h] + +/-- Arbitrary, not necessarily separated, functions may be summed in the two groups. -/ +theorem bidegree_sum_eq_double_antidiag (side : σ → Bool) (a b : ℕ) + [Fintype {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) d = (a,b)}] + (f : (σ → ℕ) → ℝ) : + (∑ d : {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) d = (a,b)}, f d.val) = + ∑ M ∈ Finset.finsuppAntidiag (Finset.univ : Finset {i // side i = true}) a, + ∑ N ∈ Finset.finsuppAntidiag (Finset.univ : Finset {i // ¬ side i = true}) b, + f (fun i => if h : side i = true then M ⟨i,h⟩ else N ⟨i,h⟩) := by + let e := bidegreeAntidiagEquiv side a b + have h := e.sum_comp (fun z => f (fun i => + if h : side i = true then z.1.val ⟨i,h⟩ else z.2.val ⟨i,h⟩)) + dsimp only [e] at h + simp only [bidegreeAntidiagEquiv_join] at h + rw [h, Fintype.sum_prod_type] + exact double_sum_coe_sort + (Finset.finsuppAntidiag (Finset.univ : Finset {i // side i = true}) a) + (Finset.finsuppAntidiag (Finset.univ : Finset {i // ¬ side i = true}) b) + (fun M N => + f (fun i => if h : side i = true then M ⟨i,h⟩ else N ⟨i,h⟩)) + +/-- Uniform bidegree averages are the nested uniform occupation means. -/ +theorem bidegree_average_eq_double_antidiag (side : σ → Bool) (a b : ℕ) + [Fintype {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) d = (a,b)}] + (f : (σ → ℕ) → ℝ) : + (∑ d : {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) d = (a,b)}, f d.val) / + (Fintype.card {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) d = (a,b)} : ℝ) = + (∑ M ∈ Finset.finsuppAntidiag (Finset.univ : Finset {i // side i = true}) a, + (∑ N ∈ Finset.finsuppAntidiag (Finset.univ : Finset {i // ¬ side i = true}) b, + f (fun i => if h : side i = true then M ⟨i,h⟩ else N ⟨i,h⟩)) / + ((Finset.finsuppAntidiag (Finset.univ : Finset {i // ¬ side i = true}) b).card : ℝ)) / + ((Finset.finsuppAntidiag (Finset.univ : Finset {i // side i = true}) a).card : ℝ) := by + have hc := Fintype.card_congr (bidegreeAntidiagEquiv side a b) + simp only [Fintype.card_prod, Fintype.card_coe] at hc + rw [bidegree_sum_eq_double_antidiag, hc, Nat.cast_mul] + rw [← Finset.sum_div, div_div, mul_comm] + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BidegreeDimension.lean b/lean/OAI/Algebra/DepthFive/BidegreeDimension.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b5664222d365dc0fee12d39dc549f27d9215e98 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BidegreeDimension.lean @@ -0,0 +1,113 @@ +import OAI.Algebra.DepthFive.OperatorRank +import OAI.Algebra.DepthFive.HomogeneousSpaceDimension + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335 + +universe u v + +/-- Split a finite exponent vector into its derivative and multiplication coordinates. -/ +def splitBidegreeExponents {σ : Type u} [Fintype σ] (side : σ → Bool) : + (σ →₀ ℕ) ≃ ({i : σ // side i = true} →₀ ℕ) × + ({i : σ // side i = false} →₀ ℕ) := by + classical + refine { + toFun := fun m => (m.subtypeDomain (fun i => side i = true), + m.subtypeDomain (fun i => side i = false)) + invFun := fun p => Finsupp.equivFunOnFinite.symm (fun i => + if h : side i = true then p.1 ⟨i, h⟩ else p.2 ⟨i, by simpa using h⟩) + left_inv := ?_ + right_inv := ?_ } + · intro m + ext i + simp only [Finsupp.coe_equivFunOnFinite_symm] + split <;> rfl + · intro p + apply Prod.ext + · ext i + simp [i.property] + · ext i + simp [i.property] + +/-- The bidegree is the pair of total degrees of the restricted exponent vectors. -/ +theorem weight_splitBidegreeExponents {σ : Type u} [Fintype σ] + (side : σ → Bool) (m : σ →₀ ℕ) : + Finsupp.weight (bidegreeWeight side) m = + ((splitBidegreeExponents side m).1.degree, + (splitBidegreeExponents side m).2.degree) := by + classical + have hs (p : σ → Prop) [DecidablePred p] : + (∑ i : Subtype p, m i) = ∑ i, if p i then m i else 0 := by + rw [← Finset.sum_filter] + exact (Finset.sum_subtype _ (by simp) _).symm + apply Prod.ext + · simp [Finsupp.weight_apply, Finsupp.sum_fintype, Finsupp.degree_eq_sum, + splitBidegreeExponents, bidegreeWeight, Prod.fst_sum, hs] + apply Finset.sum_congr rfl + intro i _ + cases side i <;> simp + · simp [Finsupp.weight_apply, Finsupp.sum_fintype, Finsupp.degree_eq_sum, + splitBidegreeExponents, bidegreeWeight, Prod.snd_sum, hs] + apply Finset.sum_congr rfl + intro i _ + cases side i <;> simp + +/-- A fixed bidegree fiber is the product of two ordinary degree fibers. -/ +def bidegreeFinsuppExponentsEquiv {σ : Type u} [Fintype σ] (side : σ → Bool) (a b : ℕ) : + {m : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) m = (a, b)} ≃ + {m : {i : σ // side i = true} →₀ ℕ // m.degree = a} × + {m : {i : σ // side i = false} →₀ ℕ // m.degree = b} := + ((splitBidegreeExponents side).subtypeEquiv + (p := fun m => Finsupp.weight (bidegreeWeight side) m = (a, b)) + (q := fun p : ({i : σ // side i = true} →₀ ℕ) × + ({i : σ // side i = false} →₀ ℕ) => p.1.degree = a ∧ p.2.degree = b) + (by + intro m + constructor + · intro h + exact Prod.mk.inj ((weight_splitBidegreeExponents side m).symm.trans h) + · rintro ⟨h1, h2⟩ + exact (weight_splitBidegreeExponents side m).trans (Prod.ext h1 h2))).trans + (Equiv.subtypeProdEquivProd + (p := fun m : {i : σ // side i = true} →₀ ℕ => m.degree = a) + (q := fun m : {i : σ // side i = false} →₀ ℕ => m.degree = b)) + +/-- Counting bidegree monomials separates into the two variable groups. -/ +theorem card_bidegree_finsupp_exponents {σ : Type u} [Fintype σ] + (side : σ → Bool) (a b : ℕ) : + Nat.card {m : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) m = (a, b)} = + Nat.multichoose (Fintype.card {i : σ // side i = true}) a * + Nat.multichoose (Fintype.card {i : σ // side i = false}) b := by + rw [Nat.card_congr (bidegreeFinsuppExponentsEquiv side a b), Nat.card_prod, + card_degree_exponents, card_degree_exponents] + +/-- Exact finite dimension of the polynomial subspace used by the mixed operator. -/ +theorem bidegreeSubmodule_finrank (K : Type u) [Field K] + {σ : Type v} [Fintype σ] (side : σ → Bool) (a b : ℕ) : + Module.finrank K (bidegreeSubmodule (K := K) side a b) = + Nat.multichoose (Fintype.card {i : σ // side i = true}) a * + Nat.multichoose (Fintype.card {i : σ // side i = false}) b := by + unfold bidegreeSubmodule + rw [MvPolynomial.weightedHomogeneousSubmodule_eq_finsupp_supported] + change Module.finrank K (MvPolynomial.restrictSupport K + {m : σ →₀ ℕ | Finsupp.weight (bidegreeWeight side) m = (a, b)}) = _ + rw [Module.finrank_eq_nat_card_basis (MvPolynomial.basisRestrictSupport K _)] + exact card_bidegree_finsupp_exponents side a b + +/-- Stars-and-bars form, with no nonemptiness hypothesis needed. -/ +theorem bidegreeSubmodule_finrank_choose (K : Type u) [Field K] + {σ : Type v} [Fintype σ] (side : σ → Bool) (a b : ℕ) : + Module.finrank K (bidegreeSubmodule (K := K) side a b) = + Nat.choose (Fintype.card {i : σ // side i = true} + a - 1) a * + Nat.choose (Fintype.card {i : σ // side i = false} + b - 1) b := by + rw [bidegreeSubmodule_finrank, Nat.multichoose_eq, Nat.multichoose_eq] + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BidegreeLocalProductAverage.lean b/lean/OAI/Algebra/DepthFive/BidegreeLocalProductAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..6091cf3fce8cafa6b5ecd3ebcbfe774f1cc65b97 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BidegreeLocalProductAverage.lean @@ -0,0 +1,57 @@ +import OAI.Algebra.DepthFive.BidegreeCompositionReindex +import OAI.Algebra.DepthFive.LocalProductAverage + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335 + +theorem bidegree_average_eq_partitionCompositionMean + {σ : Type*} [Fintype σ] [DecidableEq σ] (side : σ → Bool) (a b : ℕ) + [Fintype {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) d = (a, b)}] + (f : (σ → ℕ) → ℝ) : + (∑ d : {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) d = (a, b)}, f d.val) / + (Fintype.card {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight side) d = (a, b)} : ℝ) = + partitionCompositionMean side f a b := by + unfold partitionCompositionMean + unfold joinOccupation + exact bidegree_average_eq_double_antidiag side a b f + +namespace LocalMoments + +/-- The second-moment occupation estimate on the actual canonical source +exponent subtype, presented in the same local coordinates as the four paths. -/ +theorem bidegree_average_layered_localProduct_le + {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + (derivative : ι → Bool) + [Nonempty {x : ι × κ // derivative x.1 = true}] + [Nonempty {x : ι × κ // ¬ derivative x.1 = true}] + (a b : ℕ) + [Fintype {d : (ι × κ) →₀ ℕ // + Finsupp.weight (bidegreeWeight (fun x => derivative x.1)) d = (a, b)}] + (layers : Finset ι) (p q r : ι → κ) : + (∑ d : {d : (ι × κ) →₀ ℕ // + Finsupp.weight (bidegreeWeight (fun x => derivative x.1)) d = (a, b)}, + ∏ t ∈ layers, localPolynomial (derivative t) (fun x => d.val (t, x)) + (p t) (q t) (r t)) / + (Fintype.card {d : (ι × κ) →₀ ℕ // + Finsupp.weight (bidegreeWeight (fun x => derivative x.1)) d = (a, b)} : ℝ) ≤ + ∏ t ∈ layers, localGeometricMass (derivative t) + (if derivative t = true then + (a : ℝ) / Fintype.card {x : ι × κ // derivative x.1 = true} + else (b : ℝ) / Fintype.card {x : ι × κ // ¬ derivative x.1 = true}) + (p t) (q t) (r t) := by + have heq := bidegree_average_eq_partitionCompositionMean + (fun x : ι × κ => derivative x.1) a b + (fun M => ∏ t ∈ layers, localPolynomial (derivative t) (fun x => M (t, x)) + (p t) (q t) (r t)) + exact heq.trans_le (partitionCompositionMean_layered_restrict_le derivative a b layers p q r) + +end LocalMoments +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BidegreeNonempty.lean b/lean/OAI/Algebra/DepthFive/BidegreeNonempty.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9d323ef7f0334ecefa6da0d0667e6c29457f90c --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BidegreeNonempty.lean @@ -0,0 +1,54 @@ +import OAI.Algebra.DepthFive.OperatorRank + +namespace OAI + +noncomputable section + +namespace Problem335 + +/-- One variable on each side gives an explicit monomial of every bidegree. -/ +theorem exists_bidegree_exponent {σ : Type*} (isV : σ → Bool) + (v u : σ) (hv : isV v = true) (hu : isV u = false) (a b : ℕ) : + ∃ d : σ →₀ ℕ, Finsupp.weight (bidegreeWeight isV) d = (a, b) := by + refine ⟨Finsupp.single v a + Finsupp.single u b, ?_⟩ + simp [map_add, Finsupp.weight_single, bidegreeWeight, hv, hu] + +/-- The finite exponent-index subtype used by restricted operator matrices is inhabited. -/ +theorem nonempty_bidegree_exponents {σ : Type*} (isV : σ → Bool) + (v u : σ) (hv : isV v = true) (hu : isV u = false) (a b : ℕ) : + Nonempty {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)} := by + obtain ⟨d, hd⟩ := exists_bidegree_exponent isV v u hv hu a b + exact ⟨⟨d, hd⟩⟩ + +/-- The bidegree submodule contains a nonzero polynomial whenever both groups +contain a variable. -/ +theorem exists_ne_zero_mem_bidegree {σ K : Type*} [CommSemiring K] [Nontrivial K] + (isV : σ → Bool) (v u : σ) (hv : isV v = true) (hu : isV u = false) + (a b : ℕ) : + ∃ p : MvPolynomial σ K, p ∈ bidegreeSubmodule isV a b ∧ p ≠ 0 := by + obtain ⟨d, hd⟩ := exists_bidegree_exponent isV v u hv hu a b + refine ⟨MvPolynomial.monomial d 1, ?_, ?_⟩ + · exact MvPolynomial.isWeightedHomogeneous_monomial (bidegreeWeight isV) d 1 hd + · simp + +/-- Nontriviality of the source and target homogeneous spaces. -/ +theorem bidegreeSubmodule_nontrivial {σ K : Type*} [CommSemiring K] [Nontrivial K] + (isV : σ → Bool) (v u : σ) (hv : isV v = true) (hu : isV u = false) + (a b : ℕ) : Nontrivial (bidegreeSubmodule (K := K) isV a b) := by + obtain ⟨p, hp, hne⟩ := exists_ne_zero_mem_bidegree (K := K) isV v u hv hu a b + refine ⟨⟨⟨p, hp⟩, 0, ?_⟩⟩ + intro heq + exact hne (congrArg Subtype.val heq) + +/-- The source dimension cancelled in the rank comparison is strictly positive. -/ +theorem bidegreeSubmodule_finrank_pos {σ K : Type*} [Finite σ] [Field K] + (isV : σ → Bool) (v u : σ) (hv : isV v = true) (hu : isV u = false) + (a b : ℕ) : 0 < Module.finrank K (bidegreeSubmodule (K := K) isV a b) := by + let := bidegreeSubmodule_nontrivial (K := K) isV v u hv hu a b + exact Module.finrank_pos + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BidegreeOccupationSum.lean b/lean/OAI/Algebra/DepthFive/BidegreeOccupationSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..751c8e8a71ec854e6272bd2c00926de04e53877e --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BidegreeOccupationSum.lean @@ -0,0 +1,80 @@ +import OAI.Algebra.DepthFive.ExponentCardinality + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Problem335 + +variable {σ : Type*} [Fintype σ] (isV : σ → Bool) (a b : ℕ) + +@[simp] theorem bidegreeExponentsEquiv_fst_apply + (d : {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)}) + (i : {i // isV i = true}) : + (bidegreeExponentsEquiv isV a b d).1.1 i = d.1 i := rfl + +@[simp] theorem bidegreeExponentsEquiv_snd_apply + (d : {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)}) + (i : {i // ¬ isV i = true}) : + (bidegreeExponentsEquiv isV a b d).2.1 i = d.1 i := rfl + +@[simp] theorem bidegreeExponentsEquiv_symm_true + (p : {d : {i // isV i = true} → ℕ // ∑ i, d i = a} × + {d : {i // ¬ isV i = true} → ℕ // ∑ i, d i = b}) + (i : {i // isV i = true}) : + ((bidegreeExponentsEquiv isV a b).symm p).1 i = p.1.1 i := by + simpa using (bidegreeExponentsEquiv_fst_apply isV a b + ((bidegreeExponentsEquiv isV a b).symm p) i).symm + +@[simp] theorem bidegreeExponentsEquiv_symm_false + (p : {d : {i // isV i = true} → ℕ // ∑ i, d i = a} × + {d : {i // ¬ isV i = true} → ℕ // ∑ i, d i = b}) + (i : {i // ¬ isV i = true}) : + ((bidegreeExponentsEquiv isV a b).symm p).1 i = p.2.1 i := by + simpa using (bidegreeExponentsEquiv_snd_apply isV a b + ((bidegreeExponentsEquiv isV a b).symm p) i).symm + +variable + [Fintype {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)}] + [Fintype {d : {i // isV i = true} → ℕ // ∑ i, d i = a}] + [Fintype {d : {i // ¬ isV i = true} → ℕ // ∑ i, d i = b}] + +/-- Uniform bidegree exponents split into the independent uniform occupation +vectors of the differentiated and multiplied coordinate sets. -/ +theorem sum_bidegree_occupation_products + (s : Finset {i // isV i = true}) (t : Finset {i // ¬ isV i = true}) : + (∑ d : {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)}, + (∏ i ∈ s, (d.1 i : ℝ)) * (∏ i ∈ t, ((d.1 i : ℝ) + 1))) = + (∑ d : {d : {i // isV i = true} → ℕ // ∑ i, d i = a}, + ∏ i ∈ s, (d.1 i : ℝ)) * + (∑ d : {d : {i // ¬ isV i = true} → ℕ // ∑ i, d i = b}, + ∏ i ∈ t, ((d.1 i : ℝ) + 1)) := by + classical + rw [← (bidegreeExponentsEquiv isV a b).symm.sum_comp + (fun d => (∏ i ∈ s, (d.1 i : ℝ)) * (∏ i ∈ t, ((d.1 i : ℝ) + 1)))] + simp only [bidegreeExponentsEquiv_symm_true, bidegreeExponentsEquiv_symm_false, + Fintype.sum_prod_type] + rw [Finset.sum_mul_sum] + +/-- The corresponding normalized-average identity. It remains valid for empty +index sets because both sides use the field convention for division by zero. -/ +theorem mean_bidegree_occupation_products + (s : Finset {i // isV i = true}) (t : Finset {i // ¬ isV i = true}) : + (∑ d : {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)}, + (∏ i ∈ s, (d.1 i : ℝ)) * (∏ i ∈ t, ((d.1 i : ℝ) + 1))) / + Fintype.card {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)} = + ((∑ d : {d : {i // isV i = true} → ℕ // ∑ i, d i = a}, + ∏ i ∈ s, (d.1 i : ℝ)) / + Fintype.card {d : {i // isV i = true} → ℕ // ∑ i, d i = a}) * + ((∑ d : {d : {i // ¬ isV i = true} → ℕ // ∑ i, d i = b}, + ∏ i ∈ t, ((d.1 i : ℝ) + 1)) / + Fintype.card {d : {i // ¬ isV i = true} → ℕ // ∑ i, d i = b}) := by + rw [sum_bidegree_occupation_products, Fintype.card_congr (bidegreeExponentsEquiv isV a b), + Fintype.card_prod, Nat.cast_mul] + exact (div_mul_div_comm _ _ _ _).symm + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BidegreeShiftedOccupation.lean b/lean/OAI/Algebra/DepthFive/BidegreeShiftedOccupation.lean new file mode 100644 index 0000000000000000000000000000000000000000..156a7b011fbe2c2fbb63769bc56019c03721c55f --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BidegreeShiftedOccupation.lean @@ -0,0 +1,132 @@ +import OAI.Algebra.DepthFive.OperatorRank +import OAI.Algebra.DepthFive.ShiftedOccupation + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335 +namespace ShiftedOccupation + +lemma bidegreeWeight_eq_of_layer_sums {ι σ : Type*} [Fintype ι] [Fintype σ] + (side : ι → Bool) (M N : (ι × σ) →₀ ℕ) + (h : ∀ t, (∑ a : σ, M (t, a)) = ∑ a : σ, N (t, a)) : + Finsupp.weight (bidegreeWeight (fun x : ι × σ => side x.1)) M = + Finsupp.weight (bidegreeWeight (fun x : ι × σ => side x.1)) N := by + classical + simp only [Finsupp.weight_apply] + rw [Finsupp.sum_fintype _ _ (by simp), Finsupp.sum_fintype _ _ (by simp)] + rw [← Finset.univ_product_univ, Finset.sum_product, Finset.sum_product] + apply Finset.sum_congr rfl + intro t ht + change (∑ x : σ, M (t, x) • (if side t then (1, 0) else (0, 1) : ℕ × ℕ)) = + ∑ x : σ, N (t, x) • (if side t then (1, 0) else (0, 1) : ℕ × ℕ) + rw [← Finset.sum_smul, ← Finset.sum_smul, h t] + +/-- A natural shifted occupation, represented in the canonical finite-exponent type. -/ +def sourceFinsupp {ι σ : Type*} [Fintype ι] [Fintype σ] [DecidableEq σ] + (M : (ι × σ) →₀ ℕ) (sign : ι → ℤ) (p q : ι → σ) : (ι × σ) →₀ ℕ := + Finsupp.equivFunOnFinite.symm (source M sign p q) + +@[simp] lemma sourceFinsupp_apply {ι σ : Type*} [Fintype ι] [Fintype σ] + [DecidableEq σ] (M : (ι × σ) →₀ ℕ) (sign : ι → ℤ) (p q : ι → σ) + (x : ι × σ) : sourceFinsupp M sign p q x = source M sign p q x := by + simp [sourceFinsupp] + +lemma sourceFinsupp_bidegree {ι σ : Type*} [Fintype ι] [Fintype σ] + [DecidableEq σ] (side : ι → Bool) (M : (ι × σ) →₀ ℕ) + (sign : ι → ℤ) (p q : ι → σ) + (h : ∀ x, 0 ≤ signedSource M sign p q x) : + Finsupp.weight (bidegreeWeight (fun x : ι × σ => side x.1)) + (sourceFinsupp M sign p q) = + Finsupp.weight (bidegreeWeight (fun x : ι × σ => side x.1)) M := by + apply bidegreeWeight_eq_of_layer_sums + intro t + simpa using source_layer_sum M sign p q h t + +/-- Existence inside the exact bidegree-index subtype is equivalent to coordinate nonnegativity. -/ +theorem exists_bidegree_source_iff {ι σ : Type*} [Fintype ι] [Fintype σ] + [DecidableEq σ] (side : ι → Bool) (a b : ℕ) + (M : (ι × σ) →₀ ℕ) + (hM : Finsupp.weight (bidegreeWeight (fun x : ι × σ => side x.1)) M = (a, b)) + (sign : ι → ℤ) (p q : ι → σ) : + (∃ N : {d : (ι × σ) →₀ ℕ | + Finsupp.weight (bidegreeWeight (fun x : ι × σ => side x.1)) d = (a, b)}, + ∀ x, ((N.1 x : ℕ) : ℤ) = signedSource M sign p q x) ↔ + ∀ x, 0 ≤ signedSource M sign p q x := by + constructor + · rintro ⟨N, hN⟩ x + rw [← hN x] + positivity + · intro h + refine ⟨⟨sourceFinsupp M sign p q, ?_⟩, ?_⟩ + · exact (sourceFinsupp_bidegree side M sign p q h).trans hM + · intro x + simp only [sourceFinsupp_apply] + exact source_cast M sign p q h x + +/-- The canonical source exponent subtype used by the bidegree monomial basis. -/ +abbrev BidegreeSource {ι σ : Type*} (side : ι → Bool) (a b : ℕ) := + {d : (ι × σ) →₀ ℕ | + Finsupp.weight (bidegreeWeight (fun x : ι × σ => side x.1)) d = (a, b)} + +def sourceEmbedding {ι σ : Type*} {side : ι → Bool} {a b : ℕ} + (d : BidegreeSource (σ := σ) side a b) : ι × σ → ℤ := + fun x => (d.1 x : ℤ) + +lemma sourceEmbedding_injective {ι σ : Type*} {side : ι → Bool} {a b : ℕ} : + Function.Injective (@sourceEmbedding ι σ side a b) := by + intro M N h + apply Subtype.ext + apply Finsupp.ext + intro x + have hx := congrFun h x + change (M.1 x : ℤ) = (N.1 x : ℤ) at hx + exact_mod_cast hx + +/-- The unique shifted source as an element of the original bidegree domain. -/ +def sourceIndex {ι σ : Type*} [Fintype ι] [Fintype σ] [DecidableEq σ] + {side : ι → Bool} {a b : ℕ} (M : BidegreeSource (σ := σ) side a b) + (sign : ι → ℤ) (p q : ι → σ) + (h : ∀ x, 0 ≤ signedSource M.1 sign p q x) : BidegreeSource (σ := σ) side a b := + ⟨sourceFinsupp M.1 sign p q, (sourceFinsupp_bidegree side M.1 sign p q h).trans M.2⟩ + +lemma sourceIndex_embedding {ι σ : Type*} [Fintype ι] [Fintype σ] [DecidableEq σ] + {side : ι → Bool} {a b : ℕ} (M : BidegreeSource (σ := σ) side a b) + (sign : ι → ℤ) (p q : ι → σ) + (h : ∀ x, 0 ≤ signedSource M.1 sign p q x) : + sourceEmbedding (sourceIndex M sign p q h) = signedSource M.1 sign p q := by + funext x + exact source_cast M.1 sign p q h x + +lemma extend_source_valid {ι σ : Type*} [Fintype ι] [Fintype σ] [DecidableEq σ] + {side : ι → Bool} {a b : ℕ} (M : BidegreeSource (σ := σ) side a b) + (sign : ι → ℤ) (p q : ι → σ) + (h : ∀ x, 0 ≤ signedSource M.1 sign p q x) + (w : BidegreeSource (σ := σ) side a b → ℝ) : + Function.extend sourceEmbedding w (fun _ => 0) (signedSource M.1 sign p q) = + w (sourceIndex M sign p q h) := by + rw [← sourceIndex_embedding M sign p q h] + exact sourceEmbedding_injective.extend_apply _ _ _ + +lemma extend_source_invalid {ι σ : Type*} [Fintype ι] [Fintype σ] [DecidableEq σ] + {side : ι → Bool} {a b : ℕ} (M : BidegreeSource (σ := σ) side a b) + (sign : ι → ℤ) (p q : ι → σ) + (h : ¬ ∀ x, 0 ≤ signedSource M.1 sign p q x) + (w : BidegreeSource (σ := σ) side a b → ℝ) : + Function.extend sourceEmbedding w (fun _ => 0) (signedSource M.1 sign p q) = 0 := by + apply Function.extend_apply' + rintro ⟨N, hN⟩ + apply h + intro x + have hx := congrFun hN x + rw [← hx] + exact Int.natCast_nonneg _ + +end ShiftedOccupation +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BinomialRatios.lean b/lean/OAI/Algebra/DepthFive/BinomialRatios.lean new file mode 100644 index 0000000000000000000000000000000000000000..87b9221a4bc77748bbdf4901d473769bfd0652d7 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BinomialRatios.lean @@ -0,0 +1,208 @@ +import Mathlib + +namespace OAI + +/-! Binomial dimension estimates for the intermediate spaces in the +differentiation--multiplication rank argument. -/ + +namespace Problem335 + +/-- Dimension of homogeneous degree `t` polynomials in `r` variables, +for a positive number of variables. -/ +def homogeneousDim (r t : ℕ) : ℕ := (r + t - 1).choose t + +theorem homogeneousDim_pos {r : ℕ} (hr : 1 ≤ r) (t : ℕ) : + 0 < homogeneousDim r t := by + apply Nat.choose_pos + omega + +@[simp] theorem homogeneousDim_zero (r : ℕ) : homogeneousDim r 0 = 1 := by + simp [homogeneousDim] + +theorem homogeneousDim_succ_mul {r : ℕ} (hr : 1 ≤ r) (t : ℕ) : + homogeneousDim r (t + 1) * (t + 1) = homogeneousDim r t * (r + t) := by + have h := Nat.add_one_mul_choose_eq (r + t - 1) t + have hrt : r + t - 1 + 1 = r + t := by omega + have hrt' : r + (t + 1) - 1 = r + t := by omega + simpa only [homogeneousDim, hrt, hrt', Nat.mul_comm] using h.symm + +theorem homogeneousDim_succ_cast {r : ℕ} (hr : 1 ≤ r) (t : ℕ) : + (homogeneousDim r (t + 1) : ℝ) = + (homogeneousDim r t : ℝ) * ((r : ℝ) + t) / ((t : ℝ) + 1) := by + apply (eq_div_iff (by positivity : (t : ℝ) + 1 ≠ 0)).2 + exact_mod_cast homogeneousDim_succ_mul hr t + +theorem homogeneousDim_cast_eq_succ {r : ℕ} (hr : 1 ≤ r) (t : ℕ) : + (homogeneousDim r t : ℝ) = + (homogeneousDim r (t + 1) : ℝ) * ((t : ℝ) + 1) / ((r : ℝ) + t) := by + have hr' : (0 : ℝ) < r := by exact_mod_cast (show 0 < r by omega) + apply (eq_div_iff (by positivity : (r : ℝ) + t ≠ 0)).2 + exact_mod_cast (homogeneousDim_succ_mul hr t).symm + +/-- Moving down one degree costs at most the largest ratio on the interval. -/ +theorem homogeneousDim_down_step {r a t : ℕ} (hr : 1 ≤ r) + (ht : t + 1 ≤ a) : + (homogeneousDim r t : ℝ) ≤ + (homogeneousDim r (t + 1) : ℝ) * + ((a : ℝ) / ((a : ℝ) + r - 1)) := by + have hr' : (1 : ℝ) ≤ r := by exact_mod_cast hr + have ht' : (t : ℝ) + 1 ≤ a := by exact_mod_cast ht + have ht0 : (0 : ℝ) ≤ t := Nat.cast_nonneg t + have hden : (0 : ℝ) < (a : ℝ) + r - 1 := by linarith + have hratio : ((t : ℝ) + 1) / ((r : ℝ) + t) ≤ + (a : ℝ) / ((a : ℝ) + r - 1) := by + apply (div_le_div_iff₀ (by linarith) hden).2 + nlinarith + rw [homogeneousDim_cast_eq_succ hr t, mul_div_assoc] + exact mul_le_mul_of_nonneg_left hratio (Nat.cast_nonneg _) + +/-- Moving up one degree costs at most the initial coarse ratio. -/ +theorem homogeneousDim_up_step {r b t : ℕ} (hr : 1 ≤ r) + (hb : 0 < b) (ht : b ≤ t) : + (homogeneousDim r (t + 1) : ℝ) ≤ + (homogeneousDim r t : ℝ) * (((b : ℝ) + r) / b) := by + have hb' : (0 : ℝ) < b := by exact_mod_cast hb + have ht' : (b : ℝ) ≤ t := by exact_mod_cast ht + have hr' : (1 : ℝ) ≤ r := by exact_mod_cast hr + have hratio : ((r : ℝ) + t) / ((t : ℝ) + 1) ≤ + ((b : ℝ) + r) / b := by + apply (div_le_div_iff₀ (by positivity) hb').2 + nlinarith + rw [homogeneousDim_succ_cast hr t, mul_div_assoc] + exact mul_le_mul_of_nonneg_left hratio (Nat.cast_nonneg _) + +/-- Iterating the descending degree ratio. -/ +theorem homogeneousDim_down_bound {r a : ℕ} (hr : 1 ≤ r) (I : ℕ) : + I ≤ a → (homogeneousDim r (a - I) : ℝ) ≤ + (homogeneousDim r a : ℝ) * ((a : ℝ) / ((a : ℝ) + r - 1)) ^ I := by + have hr' : (1 : ℝ) ≤ r := by exact_mod_cast hr + have hq : 0 ≤ (a : ℝ) / ((a : ℝ) + r - 1) := by + apply div_nonneg (Nat.cast_nonneg _) + linarith [Nat.cast_nonneg (α := ℝ) a] + induction I with + | zero => simp + | succ I ih => + intro hI + have hindex : a - (I + 1) + 1 = a - I := by omega + have hstep := homogeneousDim_down_step (a := a) (t := a - (I + 1)) hr + (by omega) + rw [hindex] at hstep + calc + (homogeneousDim r (a - (I + 1)) : ℝ) ≤ + (homogeneousDim r (a - I) : ℝ) * + ((a : ℝ) / ((a : ℝ) + r - 1)) := hstep + _ ≤ ((homogeneousDim r a : ℝ) * + ((a : ℝ) / ((a : ℝ) + r - 1)) ^ I) * + ((a : ℝ) / ((a : ℝ) + r - 1)) := + mul_le_mul_of_nonneg_right (ih (by omega)) hq + _ = (homogeneousDim r a : ℝ) * + ((a : ℝ) / ((a : ℝ) + r - 1)) ^ (I + 1) := by + rw [pow_succ, mul_assoc] + +/-- Iterating the ascending degree ratio. -/ +theorem homogeneousDim_up_bound {r b : ℕ} (hr : 1 ≤ r) (hb : 0 < b) (J : ℕ) : + (homogeneousDim r (b + J) : ℝ) ≤ + (homogeneousDim r b : ℝ) * (((b : ℝ) + r) / b) ^ J := by + have hq : 0 ≤ ((b : ℝ) + r) / b := by positivity + induction J with + | zero => simp + | succ J ih => + calc + (homogeneousDim r (b + (J + 1)) : ℝ) ≤ + (homogeneousDim r (b + J) : ℝ) * (((b : ℝ) + r) / b) := by + simpa only [Nat.add_assoc] using + homogeneousDim_up_step hr hb (Nat.le_add_right b J) + _ ≤ ((homogeneousDim r b : ℝ) * (((b : ℝ) + r) / b) ^ J) * + (((b : ℝ) + r) / b) := mul_le_mul_of_nonneg_right ih hq + _ = (homogeneousDim r b : ℝ) * (((b : ℝ) + r) / b) ^ (J + 1) := by + rw [pow_succ, mul_assoc] + +theorem homogeneousDim_down_ratio {r a I : ℕ} (hr : 1 ≤ r) (hI : I ≤ a) : + (homogeneousDim r (a - I) : ℝ) / homogeneousDim r a ≤ + ((a : ℝ) / ((a : ℝ) + r - 1)) ^ I := by + have hd : (0 : ℝ) < homogeneousDim r a := by + exact_mod_cast homogeneousDim_pos hr a + apply (div_le_iff₀ hd).2 + simpa only [mul_comm] using homogeneousDim_down_bound hr I hI + +theorem homogeneousDim_up_ratio {r b : ℕ} (hr : 1 ≤ r) (hb : 0 < b) (J : ℕ) : + (homogeneousDim r (b + J) : ℝ) / homogeneousDim r b ≤ + (((b : ℝ) + r) / b) ^ J := by + have hd : (0 : ℝ) < homogeneousDim r b := by + exact_mod_cast homogeneousDim_pos hr b + apply (div_le_iff₀ hd).2 + simpa only [mul_comm] using homogeneousDim_up_bound hr hb J + +/-- The product of the two degree-space ratios bounds the relative size +of the intermediate space in the mixed operator factorization. -/ +theorem intermediate_dimension_ratio_le {v u a b I J : ℕ} + (hv : 1 ≤ v) (hu : 1 ≤ u) (hb : 0 < b) (hI : I ≤ a) : + ((homogeneousDim v (a - I) : ℝ) * homogeneousDim u (b + J)) / + ((homogeneousDim v a : ℝ) * homogeneousDim u b) ≤ + ((a : ℝ) / ((a : ℝ) + v - 1)) ^ I * + (((b : ℝ) + u) / b) ^ J := by + rw [← div_mul_div_comm] + apply mul_le_mul (homogeneousDim_down_ratio hv hI) + (homogeneousDim_up_ratio hu hb J) + · positivity + · apply pow_nonneg + apply div_nonneg (Nat.cast_nonneg _) + have hv' : (1 : ℝ) ≤ v := by exact_mod_cast hv + linarith [Nat.cast_nonneg (α := ℝ) a] + +/-- The slope condition balances the cost of multiplication against the +cost of differentiation. -/ +theorem ratio_power_slope_bound {α β ρ : ℝ} (hα : 0 < α) + (hβ : α ^ ρ ≤ β) (I J : ℕ) : + α ^ I / β ^ J ≤ α ^ ((I : ℝ) - ρ * J) := by + have hp : (α ^ ρ) ^ J ≤ β ^ J := + pow_le_pow_left₀ (Real.rpow_nonneg hα.le ρ) hβ J + calc + α ^ I / β ^ J ≤ α ^ I / (α ^ ρ) ^ J := + div_le_div_of_nonneg_left (pow_nonneg hα.le I) + (pow_pos (Real.rpow_pos_of_pos hα ρ) J) hp + _ = α ^ ((I : ℝ) - ρ * J) := by + rw [Real.rpow_sub hα, Real.rpow_natCast, Real.rpow_mul_natCast hα.le] + +/-- A bounded rounding correction can be pulled out before using the +slope condition. -/ +theorem corrected_ratio_power_bound {α β ρ η : ℝ} (hα : 0 < α) + (hβ : α ^ ρ ≤ β) {I J : ℕ} (hη : η ^ I ≤ 2) : + (α * η) ^ I * (β⁻¹) ^ J ≤ 2 * α ^ ((I : ℝ) - ρ * J) := by + have hβpos : 0 < β := lt_of_lt_of_le (Real.rpow_pos_of_pos hα ρ) hβ + calc + (α * η) ^ I * (β⁻¹) ^ J = η ^ I * (α ^ I / β ^ J) := by + rw [mul_pow, inv_pow, div_eq_mul_inv] + ring + _ ≤ 2 * α ^ ((I : ℝ) - ρ * J) := + mul_le_mul hη (ratio_power_slope_bound hα hβ I J) (by positivity) (by norm_num) + +/-- The intermediate homogeneous-space bound in the balanced slope form. +The only analytic hypothesis left is the small rounding correction. -/ +theorem intermediate_dimension_slope_bound {v u a b I J : ℕ} {ρ : ℝ} + (hv : 1 ≤ v) (hu : 1 ≤ u) (ha : 0 < a) (hb : 0 < b) (hI : I ≤ a) + (hβ : ((a : ℝ) / ((a : ℝ) + v)) ^ ρ ≤ (b : ℝ) / ((b : ℝ) + u)) + (hcorr : ((1 - 1 / ((a : ℝ) + v))⁻¹) ^ I ≤ 2) : + ((homogeneousDim v (a - I) : ℝ) * homogeneousDim u (b + J)) / + ((homogeneousDim v a : ℝ) * homogeneousDim u b) ≤ + 2 * ((a : ℝ) / ((a : ℝ) + v)) ^ ((I : ℝ) - ρ * J) := by + have ha' : (0 : ℝ) < a := by exact_mod_cast ha + have hb' : (0 : ℝ) < b := by exact_mod_cast hb + have hv' : (1 : ℝ) ≤ v := by exact_mod_cast hv + have hsum : (a : ℝ) + v ≠ 0 := by linarith + have hsum' : (a : ℝ) + v - 1 ≠ 0 := by linarith + have hratio : (a : ℝ) / ((a : ℝ) + v - 1) = + ((a : ℝ) / ((a : ℝ) + v)) * (1 - 1 / ((a : ℝ) + v))⁻¹ := by + field_simp + have hbeta : ((b : ℝ) + u) / b = ((b : ℝ) / ((b : ℝ) + u))⁻¹ := by + rw [inv_div] + calc + _ ≤ ((a : ℝ) / ((a : ℝ) + v - 1)) ^ I * (((b : ℝ) + u) / b) ^ J := + intermediate_dimension_ratio_le hv hu hb hI + _ ≤ _ := by + rw [hratio, hbeta] + exact corrected_ratio_power_bound (by positivity) hβ hcorr + +end Problem335 + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BlockCircuit.lean b/lean/OAI/Algebra/DepthFive/BlockCircuit.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9cd1da55ad65876bb1000cced1513e40bf46f49 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BlockCircuit.lean @@ -0,0 +1,95 @@ +import OAI.Algebra.DepthFive.IndexedCircuit +import OAI.Algebra.DepthFive.UpperBlockData + +namespace OAI + +noncomputable section + +namespace Problem335.BlockData + +variable {n : ℕ} + +theorem middleInputs_empty_degree (K : Type*) [One K] + (blocks : List (List (Fin n))) (m : Middle blocks) + (h : middleInputs K blocks m = []) : middleDegree blocks m = 0 := by + by_cases hb : blocks.get m.1 = [] + · change (blocks.get m.1).length = 0 + rw [hb] + rfl + · have hc := congrArg List.length h + simp only [middleInputs, List.length_ofFn, List.length_nil] at hc + have hp := matrixEntryPaths_length (blocks.get m.1) hb m.2.1 m.2.2 + have hn : 0 < n := Nat.zero_lt_of_lt m.2.1.isLt + have hpos : 0 < (paths blocks m).length := by + rw [paths, hp, Fintype.card_fin] + exact Nat.pow_pos hn + omega + +theorem outputInputs_empty_degree (K : Type*) [One K] + (blocks : List (List (Fin n))) (z : Fin n) + (h : outputInputs K blocks z = []) : (blocks.map List.length).sum = 0 := by + by_cases hb : blocks = [] + · simp [hb] + · have hc := congrArg List.length h + simp only [outputInputs, List.length_ofFn, List.length_nil] at hc + have hp := matrixEntryPaths_length (List.finRange blocks.length) + (by simpa using hb) z z + have hn : 0 < n := Nat.zero_lt_of_lt z.isLt + have hpos : 0 < (upperPaths blocks z).length := by + rw [upperPaths, hp, Fintype.card_fin] + exact Nat.pow_pos hn + omega + +/-- The actual homogeneous five-layer block-expansion circuit, before finite reindexing. -/ +def indexedCircuit (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (z : Fin n) : + IndexedDepth5Circuit K n + (Fin n × Fin n × Fin n) (Fin n × Fin n × Fin n) + (Lower blocks) (Middle blocks) (Upper blocks z) where + leaves := D5Leaf.variable + bottomInputs v := [(1, v)] + bottomDegree _ := 1 + bottomHomogeneous := by + intro i entry h + simp only [List.mem_singleton] at h + subst entry + rfl + bottomEmpty := by simp + lowerInputs := lowerInputs blocks + middleInputs := middleInputs K blocks + middleDegree := middleDegree blocks + middleHomogeneous := by + intro m entry h + simpa using middleInputs_homogeneous K blocks m entry h + middleEmpty := middleInputs_empty_degree K blocks + upperInputs := upperInputs blocks z + outputInputs := outputInputs K blocks z + outputDegree := (blocks.map List.length).sum + outputHomogeneous := by + intro entry _ + exact upperInputs_degree blocks z entry.2 + outputEmpty := outputInputs_empty_degree K blocks z + +/-- The qualified `Fin`-indexed circuit produced by block expansion. -/ +def circuit (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (z : Fin n) : Depth5Circuit K n := + (indexedCircuit K blocks z).toDepth5Circuit + +@[simp] theorem circuit_outputDegree (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (z : Fin n) : + (circuit K blocks z).outputDegree = (blocks.map List.length).sum := rfl + +theorem circuit_size (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (z : Fin n) : + circuitSize (circuit K blocks z) = 2 * n ^ 3 + + Fintype.card (Lower blocks) + Fintype.card (Middle blocks) + + Fintype.card (Upper blocks z) + 1 := by + rw [circuit, IndexedDepth5Circuit.circuitSize_toDepth5Circuit] + simp only [Fintype.card_prod, Fintype.card_fin] + ring + +end Problem335.BlockData + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BlockCircuitValue.lean b/lean/OAI/Algebra/DepthFive/BlockCircuitValue.lean new file mode 100644 index 0000000000000000000000000000000000000000..20e1b16eeb613c6b16595eb13adc60d2deb861c8 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BlockCircuitValue.lean @@ -0,0 +1,79 @@ +import OAI.Algebra.DepthFive.BlockCircuit +import OAI.Algebra.DepthFive.IndexedCircuitValue +import OAI.Algebra.DepthFive.BlockMiddleSemantics +import OAI.Algebra.DepthFive.ImmBlocks + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335.BlockData + +variable {n : ℕ} + +@[simp] theorem indexedCircuit_bottomValue (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (z : Fin n) (v : Fin n × Fin n × Fin n) : + (indexedCircuit K blocks z).bottomValue v = MvPolynomial.X v := by + simp [IndexedDepth5Circuit.bottomValue, indexedCircuit, d5LeafValue] + +@[simp] theorem indexedCircuit_lowerValue (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (z : Fin n) (p : Lower blocks) : + (indexedCircuit K blocks z).lowerValue p = lowerMonomial K blocks p := by + simp [IndexedDepth5Circuit.lowerValue, indexedCircuit, lowerMonomial, + IndexedDepth5Circuit.bottomValue, d5LeafValue] + +@[simp] theorem indexedCircuit_middleValue (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (z : Fin n) (m : Middle blocks) : + (indexedCircuit K blocks z).middleValue m = + immBlock K n (blocks.get m.1) m.2.1 m.2.2 := by + change ((middleInputs K blocks m).map (fun e => + MvPolynomial.C e.1 * (indexedCircuit K blocks z).lowerValue e.2)).sum = _ + simp_rw [indexedCircuit_lowerValue] + exact middleInputs_value K blocks m + +@[simp] theorem indexedCircuit_upperValue (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (z : Fin n) (p : Upper blocks z) : + (indexedCircuit K blocks z).upperValue p = + ((upperInputs blocks z p).map (fun e => + immBlock K n (blocks.get e.1) e.2.1 e.2.2)).prod := by + change ((upperInputs blocks z p).map + (fun m => (indexedCircuit K blocks z).middleValue m)).prod = _ + simp only [indexedCircuit_middleValue] + +/-- The block circuit computes the corresponding entry of the product of block matrices. -/ +theorem indexedCircuit_circuitValue (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (z : Fin n) : + (indexedCircuit K blocks z).circuitValue = + ((blocks.map (immBlock K n)).prod) z z := by + change ((outputInputs K blocks z).map (fun e => + MvPolynomial.C e.1 * (indexedCircuit K blocks z).upperValue e.2)).sum = _ + simp only [indexedCircuit_upperValue, outputInputs, List.map_ofFn, + Function.comp_def, MvPolynomial.C_1, one_mul, List.sum_ofFn] + change (∑ k : Fin (matrixEntryPaths (List.finRange blocks.length) z z).length, + (((matrixEntryPaths (List.finRange blocks.length) z z).get k).map + (fun e => immBlock K n (blocks.get e.1) e.2.1 e.2.2)).prod) = _ + rw [matrixEntryPaths_fin_sum_prod (fun j : Fin blocks.length => + immBlock K n (blocks.get j))] + simp [← List.ofFn_eq_map] + +/-- Semantic correctness after converting all gate indices to `Fin`. -/ +theorem circuit_value (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (z : Fin n) : + Problem335.circuitValue (circuit K blocks z) = + ((blocks.map (immBlock K n)).prod) z z := by + rw [circuit, IndexedDepth5Circuit.circuitValue_toDepth5Circuit, + indexedCircuit_circuitValue] + +/-- Any partition of the layers produces a circuit computing the qualified IMM polynomial. -/ +theorem circuit_value_eq_imm (K : Type*) [CommSemiring K] + (hn : 0 < n) (blocks : List (List (Fin n))) + (hblocks : blocks.flatten = List.finRange n) : + Problem335.circuitValue (circuit K blocks ⟨0, hn⟩) = imm K n := by + rw [circuit_value, imm_eq_blocks_prod hn blocks hblocks] + +end Problem335.BlockData + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BlockMiddleSemantics.lean b/lean/OAI/Algebra/DepthFive/BlockMiddleSemantics.lean new file mode 100644 index 0000000000000000000000000000000000000000..3837616d3a4bcbc50c0254a07010b5c0d8b001cd --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BlockMiddleSemantics.lean @@ -0,0 +1,42 @@ +import OAI.Algebra.DepthFive.UpperBlockData +import OAI.Algebra.DepthFive.MatrixPathSemantics + +namespace OAI + +noncomputable section + +namespace Problem335.BlockData + +variable {n : ℕ} + +/-- The lower-gate monomial belonging to an enumerated block path. -/ +def lowerMonomial (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (p : Lower blocks) : + MvPolynomial (Fin n × Fin n × Fin n) K := + ((lowerInputs blocks p).map MvPolynomial.X).prod + +/-- The weighted middle input list computes exactly the corresponding block matrix entry. -/ +theorem middleInputs_value (K : Type*) [CommSemiring K] + (blocks : List (List (Fin n))) (m : Middle blocks) : + ((middleInputs K blocks m).map (fun e => + MvPolynomial.C e.1 * lowerMonomial K blocks e.2)).sum = + (((blocks.get m.1).map (immLayer K n)).prod) m.2.1 m.2.2 := by + simp only [middleInputs, List.map_ofFn, Function.comp_def, lowerMonomial, + lowerInputs, MvPolynomial.C_1, one_mul, List.sum_ofFn] + exact matrixEntryPaths_fin_sum_prod (immLayer K n) (blocks.get m.1) m.2.1 m.2.2 + +/-- Substitute lower-gate semantics into the middle gate. -/ +theorem middleInputs_value_of_lower + (K : Type*) [CommSemiring K] (blocks : List (List (Fin n))) + (v : Lower blocks → MvPolynomial (Fin n × Fin n × Fin n) K) + (hv : ∀ p, v p = lowerMonomial K blocks p) (m : Middle blocks) : + ((middleInputs K blocks m).map (fun e => MvPolynomial.C e.1 * v e.2)).sum = + (((blocks.get m.1).map (immLayer K n)).prod) m.2.1 m.2.2 := by + simp_rw [hv] + exact middleInputs_value K blocks m + +end Problem335.BlockData + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/BlockPartition.lean b/lean/OAI/Algebra/DepthFive/BlockPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..6590541033f8827766a77194549f4efa3168800f --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/BlockPartition.lean @@ -0,0 +1,177 @@ +import OAI.Algebra.DepthFive.Basic +import Mathlib.Data.List.SplitLengths + +namespace OAI + +namespace Problem335 + +/-- Full blocks followed by one possible shorter final block. -/ +def blockLengths (n t : ℕ) : List ℕ := + List.replicate (n / t) t ++ if n % t = 0 then [] else [n % t] + +theorem blockLengths_sum (n t : ℕ) : (blockLengths n t).sum = n := by + simp only [blockLengths, List.sum_append, List.sum_replicate] + split_ifs with h + · simp only [List.sum_nil, add_zero] + simpa [h, Nat.mul_comm] using Nat.div_add_mod n t + · simpa [Nat.mul_comm] using Nat.div_add_mod n t + +theorem blockLengths_pos {n t : ℕ} (ht : 0 < t) : + ∀ d ∈ blockLengths n t, 0 < d := by + intro d hd + simp only [blockLengths, List.mem_append] at hd + rcases hd with hd | hd + · have : d = t := (List.mem_replicate.mp hd).2 + simpa [this] using ht + · split_ifs at hd with h + · simp at hd + · have : d = n % t := by simpa using hd + simpa [this] using (show 0 < n % t from Nat.pos_of_ne_zero h) + +theorem blockLengths_le {n t : ℕ} (ht : 0 < t) : + ∀ d ∈ blockLengths n t, d ≤ t := by + intro d hd + simp only [blockLengths, List.mem_append] at hd + rcases hd with hd | hd + · exact le_of_eq (List.mem_replicate.mp hd).2 + · split_ifs at hd with h + · simp at hd + · have : d = n % t := by simpa using hd + simpa [this] using (Nat.mod_lt n ht).le + +theorem blockLengths_length {n t : ℕ} (ht : 0 < t) : + (blockLengths n t).length = ceilDiv n t := by + simp only [blockLengths, List.length_append, List.length_replicate] + have hm := Nat.mod_lt n ht + have hd := Nat.div_add_mod n t + have hs : n + t - 1 + 1 = n + t := by omega + unfold ceilDiv + split_ifs with h + · simp only [List.length_nil, add_zero] + symm + apply Nat.div_eq_of_lt_le + · nlinarith + · nlinarith + · simp only [List.length_singleton] + have hp : 0 < n % t := Nat.pos_of_ne_zero h + symm + apply Nat.div_eq_of_lt_le + · nlinarith + · nlinarith + +/-- Consecutive blocks, with their lengths prescribed explicitly. -/ +def consecutiveBlocks {α : Type*} (t : ℕ) (l : List α) : List (List α) := + (blockLengths l.length t).splitLengths l + +@[simp] theorem consecutiveBlocks_flatten {α : Type*} (t : ℕ) (l : List α) : + (consecutiveBlocks t l).flatten = l := by + apply List.flatten_splitLengths + simp [blockLengths_sum] + +@[simp] theorem consecutiveBlocks_map_length {α : Type*} (t : ℕ) (l : List α) : + (consecutiveBlocks t l).map List.length = blockLengths l.length t := by + apply List.map_splitLengths_length + simp [blockLengths_sum] + +theorem consecutiveBlocks_length {α : Type*} {t : ℕ} (ht : 0 < t) (l : List α) : + (consecutiveBlocks t l).length = ceilDiv l.length t := by + simpa only [consecutiveBlocks, List.length_splitLengths] using + (blockLengths_length (n := l.length) ht) + +theorem consecutiveBlocks_length_pos {α : Type*} {t : ℕ} (ht : 0 < t) + (l : List α) {b : List α} (hb : b ∈ consecutiveBlocks t l) : 0 < b.length := by + apply blockLengths_pos ht b.length + rw [← consecutiveBlocks_map_length t l] + exact List.mem_map_of_mem hb + +theorem consecutiveBlocks_length_le {α : Type*} {t : ℕ} (ht : 0 < t) + (l : List α) {b : List α} (hb : b ∈ consecutiveBlocks t l) : b.length ≤ t := by + apply blockLengths_le ht b.length + rw [← consecutiveBlocks_map_length t l] + exact List.mem_map_of_mem hb + +theorem consecutiveBlocks_nonempty {α : Type*} {t : ℕ} (ht : 0 < t) + (l : List α) {b : List α} (hb : b ∈ consecutiveBlocks t l) : b ≠ [] := by + have := consecutiveBlocks_length_pos ht l hb + intro he + simp [he] at this + +theorem consecutiveBlocks_prod {M : Type*} [Monoid M] (t : ℕ) (l : List M) : + ((consecutiveBlocks t l).map List.prod).prod = l.prod := by + rw [← List.prod_flatten, consecutiveBlocks_flatten] + +theorem consecutiveBlocks_map_prod {α M : Type*} [Monoid M] + (f : α → M) (t : ℕ) (l : List α) : + ((consecutiveBlocks t l).map (fun b => (b.map f).prod)).prod = (l.map f).prod := by + calc + _ = (((consecutiveBlocks t l).map (List.map f)).map List.prod).prod := by + simp only [List.map_map, Function.comp_def] + _ = (l.map f).prod := by + rw [← List.prod_flatten, ← List.map_flatten, consecutiveBlocks_flatten] + +/-- The consecutive blocks of the matrix-layer index list. -/ +def layerBlocks (n t : ℕ) : List (List (Fin n)) := + consecutiveBlocks t (List.finRange n) + +@[simp] theorem layerBlocks_flatten (n t : ℕ) : + (layerBlocks n t).flatten = List.finRange n := + consecutiveBlocks_flatten t _ + +theorem layerBlocks_length {n t : ℕ} (ht : 0 < t) : + (layerBlocks n t).length = ceilDiv n t := by + simpa [layerBlocks] using consecutiveBlocks_length ht (List.finRange n) + +end Problem335 + +namespace Problem335 + +theorem layerBlocks_length_pos {n t : ℕ} (ht : 0 < t) + {b : List (Fin n)} (hb : b ∈ layerBlocks n t) : 0 < b.length := + consecutiveBlocks_length_pos ht _ hb + +theorem layerBlocks_length_le {n t : ℕ} (ht : 0 < t) + {b : List (Fin n)} (hb : b ∈ layerBlocks n t) : b.length ≤ t := + consecutiveBlocks_length_le ht _ hb + +theorem layerBlocks_nonempty {n t : ℕ} (ht : 0 < t) + {b : List (Fin n)} (hb : b ∈ layerBlocks n t) : b ≠ [] := + consecutiveBlocks_nonempty ht _ hb + +theorem layerBlocks_get_length_pos {n t : ℕ} (ht : 0 < t) + (i : Fin (layerBlocks n t).length) : 0 < ((layerBlocks n t).get i).length := + layerBlocks_length_pos ht (List.get_mem ..) + +theorem layerBlocks_get_length_le {n t : ℕ} (ht : 0 < t) + (i : Fin (layerBlocks n t).length) : ((layerBlocks n t).get i).length ≤ t := + layerBlocks_length_le ht (List.get_mem ..) + +@[simp] theorem layerBlocks_sum_lengths (n t : ℕ) : + ((layerBlocks n t).map List.length).sum = n := by + simp [layerBlocks, blockLengths_sum] + +theorem layerBlocks_map_prod {M : Type*} [Monoid M] (n t : ℕ) (f : Fin n → M) : + ((layerBlocks n t).map (fun b => (b.map f).prod)).prod = (List.ofFn f).prod := by + simpa only [layerBlocks, List.ofFn_eq_map] using consecutiveBlocks_map_prod f t (List.finRange n) + +/-- The entry defining IMM can be computed from the consecutive block products. -/ +theorem imm_eq_layerBlocks (K : Type*) [CommSemiring K] {n : ℕ} (hn : 0 < n) (t : ℕ) : + imm K n = + (((layerBlocks n t).map (fun b : List (Fin n) => (b.map (immLayer K n)).prod)).prod) + ⟨0, hn⟩ ⟨0, hn⟩ := by + rw [layerBlocks_map_prod] + simp only [imm, dite_eq_left hn] + +/-- The block-expansion lower-product gate budget. -/ +theorem layerBlocks_power_sum_le {n t : ℕ} (hn : 0 < n) (ht : 0 < t) : + ((layerBlocks n t).map (fun b => n ^ (b.length + 1))).sum ≤ + ceilDiv n t * n ^ (t + 1) := by + have h := List.sum_le_length_nsmul + ((layerBlocks n t).map (fun b => n ^ (b.length + 1))) (n ^ (t + 1)) (by + intro x hx + obtain ⟨b, hb, rfl⟩ := List.mem_map.mp hx + exact Nat.pow_le_pow_right hn (Nat.add_le_add_right (layerBlocks_length_le ht hb) 1)) + simpa only [List.length_map, layerBlocks_length ht, nsmul_eq_mul, Nat.cast_id] using h + +end Problem335 + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/Bounds.lean b/lean/OAI/Algebra/DepthFive/Bounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..aae7cd6e956572893d759df04d59d2358fb419e6 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/Bounds.lean @@ -0,0 +1,50 @@ +import OAI.Algebra.DepthFive.Basic +import OAI.Algebra.DepthFive.UpperConstruction +import OAI.Algebra.DepthFive.UpperBoundArithmetic +import OAI.Algebra.DepthFive.CharacteristicZeroTransfer +import OAI.Algebra.DepthFive.ConfiguredImmSecondMoment +import OAI.Algebra.DepthFive.LowerBoundAssembly + +namespace OAI + +noncomputable section + +universe u + +namespace Problem335 + +theorem complex_depth_five_lower_bound : + ∃ n0 : ℕ, ∀ n : ℕ, n0 ≤ n → ∀ c : Depth5Circuit ℂ n, circuitValue c = imm ℂ n → (n : ℝ) ^ (Real.sqrt (n : ℝ) / 400) ≤ (circuitSize c : ℝ) := by + exact complex_depth_five_lower_bound_of_eventual_second_trace 10 + LowerParameters.eventually_configured_imm_second_moment_upper + +theorem characteristic_zero_depth_five_lower_bound : + ∃ n0 : ℕ, ∀ (K : Type u) [Field K] [CharZero K], ∀ n : ℕ, n0 ≤ n → ∀ c : Depth5Circuit K n, circuitValue c = imm K n → (n : ℝ) ^ (Real.sqrt (n : ℝ) / 400) ≤ (circuitSize c : ℝ) := by + exact characteristic_zero_depth_five_lower_bound_of_complex complex_depth_five_lower_bound + +theorem all_field_depth_five_upper_bound : + ∀ (K : Type u) [Field K] (n : ℕ), 2 ≤ n → ∃ c : Depth5Circuit K n, circuitValue c = imm K n ∧ circuitSize c ≤ upperGateBound n ∧ (upperGateBound n : ℝ) ≤ (n : ℝ) ^ (Real.sqrt (n : ℝ) + 4) := by + intro K _ n hn + obtain ⟨c, hc, hs⟩ := exists_imm_circuit_le_upperGateBound K n hn + exact ⟨c, hc, hs, upperGateBound_le_rpow n hn⟩ + +theorem main : + (∃ threshold : ℕ, ∀ size : ℕ, threshold ≤ size → + ∀ circuit : Depth5Circuit ℂ size, circuitValue circuit = imm ℂ size → + (size : ℝ) ^ (Real.sqrt (size : ℝ) / 400) ≤ (circuitSize circuit : ℝ)) ∧ + (∃ threshold : ℕ, ∀ (FieldType : Type u) [Field FieldType] [CharZero FieldType], + ∀ size : ℕ, threshold ≤ size → ∀ circuit : Depth5Circuit FieldType size, + circuitValue circuit = imm FieldType size → + (size : ℝ) ^ (Real.sqrt (size : ℝ) / 400) ≤ (circuitSize circuit : ℝ)) ∧ + (∀ (FieldType : Type u) [Field FieldType] (size : ℕ), 2 ≤ size → + ∃ circuit : Depth5Circuit FieldType size, circuitValue circuit = imm FieldType size ∧ + circuitSize circuit ≤ upperGateBound size ∧ + (upperGateBound size : ℝ) ≤ (size : ℝ) ^ (Real.sqrt (size : ℝ) + 4)) := by + exact ⟨complex_depth_five_lower_bound, + characteristic_zero_depth_five_lower_bound, all_field_depth_five_upper_bound⟩ + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CeilArithmetic.lean b/lean/OAI/Algebra/DepthFive/CeilArithmetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..6decddcd350ae57c94444d3ad3dc24488538c9c8 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CeilArithmetic.lean @@ -0,0 +1,95 @@ +import OAI.Algebra.DepthFive.Basic + +namespace OAI + +namespace Problem335 + +@[simp] theorem ceilSqrt_zero : ceilSqrt 0 = 0 := by + simp [ceilSqrt] + +@[simp] theorem ceilSqrt_one : ceilSqrt 1 = 1 := by + simp [ceilSqrt] + +@[simp] theorem ceilSqrt_two : ceilSqrt 2 = 2 := by + norm_num [ceilSqrt, Nat.sqrt_two] + +theorem sqrt_le_ceilSqrt (n : ℕ) : Nat.sqrt n ≤ ceilSqrt n := by + unfold ceilSqrt + omega + +theorem ceilSqrt_le_sqrt_add_one (n : ℕ) : ceilSqrt n ≤ Nat.sqrt n + 1 := by + unfold ceilSqrt + split <;> omega + +theorem self_le_ceilSqrt_sq (n : ℕ) : n ≤ ceilSqrt n ^ 2 := by + unfold ceilSqrt + split + · rename_i h + simpa using h.ge + · simpa [Nat.succ_eq_add_one] using (Nat.lt_succ_sqrt' n).le + +theorem ceilSqrt_pos {n : ℕ} (hn : 0 < n) : 0 < ceilSqrt n := + lt_of_lt_of_le (Nat.sqrt_pos.mpr hn) (sqrt_le_ceilSqrt n) + +theorem ceilSqrt_le_self (n : ℕ) : ceilSqrt n ≤ n := by + rcases Nat.eq_zero_or_pos n with rfl | hn + · simp + by_cases h : n = 1 + · subst n + simp + have hn' : 1 < n := by omega + exact (ceilSqrt_le_sqrt_add_one n).trans (Nat.succ_le_of_lt (Nat.sqrt_lt_self hn')) + +theorem two_le_ceilSqrt {n : ℕ} (hn : 2 ≤ n) : 2 ≤ ceilSqrt n := by + have h := self_le_ceilSqrt_sq n + by_contra hh + have hh' : ceilSqrt n ≤ 1 := by omega + have : ceilSqrt n ^ 2 ≤ 1 ^ 2 := Nat.pow_le_pow_left hh' 2 + omega + +theorem ceilSqrt_cast_le_real_sqrt_add_one (n : ℕ) : + (ceilSqrt n : ℝ) ≤ Real.sqrt (n : ℝ) + 1 := by + have hnat : (Nat.sqrt n : ℝ) ≤ Real.sqrt (n : ℝ) := by + apply Real.le_sqrt_of_sq_le + exact_mod_cast Nat.sqrt_le' n + have hceil : (ceilSqrt n : ℝ) ≤ (Nat.sqrt n : ℝ) + 1 := by + exact_mod_cast ceilSqrt_le_sqrt_add_one n + linarith + +theorem real_sqrt_le_ceilSqrt_cast (n : ℕ) : + Real.sqrt (n : ℝ) ≤ (ceilSqrt n : ℝ) := by + apply (Real.sqrt_le_left (Nat.cast_nonneg _)).mpr + exact_mod_cast self_le_ceilSqrt_sq n + +theorem ceilDiv_le_iff {n t r : ℕ} (ht : 0 < t) : + ceilDiv n t ≤ r ↔ n ≤ r * t := by + unfold ceilDiv + rw [Nat.div_le_iff_le_mul_add_pred ht] + rw [Nat.mul_comm t r] + omega + +theorem self_le_ceilDiv_mul (n : ℕ) {t : ℕ} (ht : 0 < t) : + n ≤ ceilDiv n t * t := + (ceilDiv_le_iff ht).mp le_rfl + +theorem ceilDiv_le_self (n : ℕ) {t : ℕ} (ht : 0 < t) : + ceilDiv n t ≤ n := by + apply (ceilDiv_le_iff ht).mpr + exact Nat.le_mul_of_pos_right n ht + +theorem ceilDiv_pos {n t : ℕ} (hn : 0 < n) (ht : 0 < t) : + 0 < ceilDiv n t := by + by_contra h + have hh : ceilDiv n t ≤ 0 := by omega + have := (ceilDiv_le_iff ht).mp hh + omega + +theorem ceilDiv_ceilSqrt_le (n : ℕ) : ceilDiv n (ceilSqrt n) ≤ ceilSqrt n := by + rcases Nat.eq_zero_or_pos n with rfl | hn + · simp [ceilDiv] + apply (ceilDiv_le_iff (ceilSqrt_pos hn)).mpr + simpa [pow_two] using self_le_ceilSqrt_sq n + +end Problem335 + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CharacteristicZeroTransfer.lean b/lean/OAI/Algebra/DepthFive/CharacteristicZeroTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..c31494882a9d7afce3c94fde53d9d7ce46edd621 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CharacteristicZeroTransfer.lean @@ -0,0 +1,82 @@ +import OAI.Algebra.DepthFive.ComplexEmbedding +import OAI.Algebra.DepthFive.CoefficientMap +import OAI.Algebra.DepthFive.ImmMap +import OAI.Algebra.DepthFive.CoefficientDescent + +namespace OAI + +noncomputable section +universe u + +namespace Problem335 + +/-- A circuit over a countable characteristic-zero field can be realized over +`ℂ`, with exactly the same number of gates and the same IMM identity. -/ +theorem exists_complex_circuit_of_countable {K : Type u} [Field K] [CharZero K] + [Countable K] {n : ℕ} (c : Depth5Circuit K n) + (hc : circuitValue c = imm K n) : + ∃ d : Depth5Circuit ℂ n, circuitValue d = imm ℂ n ∧ circuitSize d = circuitSize c := by + obtain ⟨f⟩ := countable_field_embeds_complex K + refine ⟨c.mapCoefficients f, ?_, circuitSize_mapCoefficients f c⟩ + rw [circuitValue_mapCoefficients, hc, map_imm] + +/-- Any pointwise real gate-count lower bound over `ℂ` transfers to every +countable field of characteristic zero. -/ +theorem countable_circuit_bound_of_complex {K : Type u} [Field K] [CharZero K] + [Countable K] {n : ℕ} {b : ℝ} + (h : ∀ d : Depth5Circuit ℂ n, + circuitValue d = imm ℂ n → b ≤ (circuitSize d : ℝ)) + (c : Depth5Circuit K n) (hc : circuitValue c = imm K n) : + b ≤ (circuitSize c : ℝ) := by + obtain ⟨d, hd, hs⟩ := exists_complex_circuit_of_countable c hc + simpa only [hs] using h d hd + +/-- Restriction to the coefficient subfield preserves and reflects the IMM identity. -/ +theorem restrictCircuit_computes_imm {K : Type u} [Field K] {n : ℕ} + (c : Depth5Circuit K n) : + circuitValue (restrictCircuit c) = imm (circuitCoefficientField c) n ↔ + circuitValue c = imm K n := by + have hi := MvPolynomial.map_injective (σ := Fin n × Fin n × Fin n) + (circuitCoefficientField c).subtype + (circuitCoefficientField c).subtype.injective + rw [← hi.eq_iff, map_circuitValue_restrictCircuit, map_imm] + +/-- Every characteristic-zero IMM circuit has a same-size complex realization. +Only the finitely many occurring coefficients are embedded, not the entire field. -/ +theorem exists_complex_circuit {K : Type u} [Field K] [CharZero K] + {n : ℕ} (c : Depth5Circuit K n) (hc : circuitValue c = imm K n) : + ∃ d : Depth5Circuit ℂ n, circuitValue d = imm ℂ n ∧ circuitSize d = circuitSize c := by + obtain ⟨d, hd, hs⟩ := exists_complex_circuit_of_countable (restrictCircuit c) + ((restrictCircuit_computes_imm c).mpr hc) + exact ⟨d, hd, hs.trans (circuitSize_restrictCircuit c)⟩ + +/-- Pointwise complex gate lower bounds hold over any characteristic-zero field. -/ +theorem circuit_bound_of_complex {K : Type u} [Field K] [CharZero K] + {n : ℕ} {b : ℝ} + (h : ∀ d : Depth5Circuit ℂ n, + circuitValue d = imm ℂ n → b ≤ (circuitSize d : ℝ)) + (c : Depth5Circuit K n) (hc : circuitValue c = imm K n) : + b ≤ (circuitSize c : ℝ) := by + obtain ⟨d, hd, hs⟩ := exists_complex_circuit c hc + simpa only [hs] using h d hd + +/-- The extension to characteristic zero uses the same absolute threshold as +its complex counterpart. This implication has no lower-bound assumptions other +than the precise complex conclusion. -/ +theorem characteristic_zero_depth_five_lower_bound_of_complex + (h : ∃ n0 : ℕ, ∀ n : ℕ, n0 ≤ n → ∀ c : Depth5Circuit ℂ n, + circuitValue c = imm ℂ n → + (n : ℝ) ^ (Real.sqrt (n : ℝ) / 400) ≤ (circuitSize c : ℝ)) : + ∃ n0 : ℕ, ∀ (K : Type u) [Field K] [CharZero K], ∀ n : ℕ, n0 ≤ n → + ∀ c : Depth5Circuit K n, circuitValue c = imm K n → + (n : ℝ) ^ (Real.sqrt (n : ℝ) / 400) ≤ (circuitSize c : ℝ) := by + obtain ⟨n0, h0⟩ := h + refine ⟨n0, ?_⟩ + intro K _ _ n hn c hc + exact circuit_bound_of_complex (h0 n hn) c hc + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CircuitDegreeBounds.lean b/lean/OAI/Algebra/DepthFive/CircuitDegreeBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..91cae1253b6fdf8549749b59d74f2b8cdbd1afd2 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CircuitDegreeBounds.lean @@ -0,0 +1,160 @@ +import OAI.Algebra.DepthFive.Basic + +namespace OAI + +noncomputable section + +namespace Problem335 +universe u +variable {K : Type u} [CommSemiring K] {n : ℕ} + +omit [CommSemiring K] in +/-- Every input leaf has formal degree at most one. -/ +theorem d5LeafDegree_le_one (x : D5Leaf K n) : d5LeafDegree x ≤ 1 := by + cases x <;> simp [d5LeafDegree] + +/-- Bottom sums have degree zero or one, including empty bottom sums. -/ +theorem bottomDegree_le_one (c : Depth5Circuit K n) (i : Fin c.bottomCount) : + c.bottomDegree i ≤ 1 := by + by_cases h : c.bottomInputs i = [] + · rw [c.bottomEmpty i h] + omega + · obtain ⟨entry, hentry⟩ := List.exists_mem_of_ne_nil _ h + rw [← c.bottomHomogeneous i entry hentry] + exact d5LeafDegree_le_one _ + +omit [CommSemiring K] in +/-- A zero-degree leaf is a scalar, syntactically, even if its value is zero. -/ +theorem leaf_scalar_of_degree_zero (x : D5Leaf K n) (h : d5LeafDegree x = 0) : + ∃ a : K, x = D5Leaf.scalar a := by + cases x with + | scalar a => exact ⟨a, rfl⟩ + | «variable» v => simp [d5LeafDegree] at h + +omit [CommSemiring K] in +/-- A positive-degree leaf is a variable. -/ +theorem leaf_variable_of_degree_pos (x : D5Leaf K n) (h : 0 < d5LeafDegree x) : + ∃ v, x = D5Leaf.variable v := by + cases x with + | scalar a => simp [d5LeafDegree] at h + | «variable» v => exact ⟨v, rfl⟩ + +/-- For a list of zeros and ones, the formal degree is the number of one inputs. -/ +theorem sum_map_eq_length_filter_one {α : Type*} (d : α → ℕ) (l : List α) + (hd : ∀ a ∈ l, d a ≤ 1) : + (l.map d).sum = (l.filter fun a => d a = 1).length := by + induction l with + | nil => simp + | cons a l ih => + have ha : d a ≤ 1 := hd a (by simp) + have hl : ∀ b ∈ l, d b ≤ 1 := fun b hb => hd b (by simp [hb]) + have hcases : d a = 0 ∨ d a = 1 := by omega + rcases hcases with ha | ha <;> simp [ha, ih hl, Nat.add_comm] + +/-- Repeated lower-product inputs count separately in their formal degree. -/ +theorem lowerDegree_eq_linear_count (c : Depth5Circuit K n) (i : Fin c.lowerCount) : + ((c.lowerInputs i).map c.bottomDegree).sum = + ((c.lowerInputs i).filter fun j => c.bottomDegree j = 1).length := by + apply sum_map_eq_length_filter_one + intro j _ + exact bottomDegree_le_one c j + +/-- The number of positive-degree input occurrences is bounded by their total degree. -/ +theorem length_filter_pos_le_sum_map {α : Type*} (d : α → ℕ) (l : List α) : + (l.filter fun a => 0 < d a).length ≤ (l.map d).sum := by + induction l with + | nil => simp + | cons a l ih => + by_cases ha : 0 < d a + · simp [ha] + omega + · have hz : d a = 0 := by omega + simpa [ha, hz] using ih + +/-- The number of positive-degree middle factors is bounded by an upper product's degree. -/ +theorem upper_positive_count_le_degree (c : Depth5Circuit K n) (i : Fin c.upperCount) : + ((c.upperInputs i).filter fun j => 0 < c.middleDegree j).length ≤ + ((c.upperInputs i).map c.middleDegree).sum := + length_filter_pos_le_sum_map _ _ + +/-- An upper term that occurs at the output has at most outputDegree positive factors. -/ +theorem output_term_positive_count_le_degree (c : Depth5Circuit K n) + (entry : K × Fin c.upperCount) (hentry : entry ∈ c.outputInputs) : + ((c.upperInputs entry.2).filter fun j => 0 < c.middleDegree j).length ≤ + c.outputDegree := by + rw [← c.outputHomogeneous entry hentry] + exact upper_positive_count_le_degree c entry.2 + +/-- A finite sum of scalar polynomials is a scalar polynomial. -/ +theorem sum_eq_C_of_mem {σ : Type*} (l : List (MvPolynomial σ K)) + (h : ∀ p ∈ l, ∃ a : K, p = MvPolynomial.C a) : + ∃ a : K, l.sum = MvPolynomial.C a := by + induction l with + | nil => exact ⟨0, by simp⟩ + | cons p l ih => + obtain ⟨a, ha⟩ := h p (by simp) + obtain ⟨b, hb⟩ := ih (fun q hq => h q (by simp [hq])) + exact ⟨a + b, by simp [ha, hb]⟩ + +/-- Zero-degree bottom sums really compute scalars; cancellation is harmless. -/ +theorem bottomValue_eq_C_of_degree_zero (c : Depth5Circuit K n) + (i : Fin c.bottomCount) (hdeg : c.bottomDegree i = 0) : + ∃ a : K, bottomValue c i = MvPolynomial.C a := by + unfold bottomValue + apply sum_eq_C_of_mem + intro p hp + obtain ⟨entry, hentry, rfl⟩ := List.mem_map.mp hp + obtain ⟨a, ha⟩ := leaf_scalar_of_degree_zero (c.leaves entry.2) + ((c.bottomHomogeneous i entry hentry).trans hdeg) + exact ⟨entry.1 * a, by simp [ha, d5LeafValue]⟩ + +/-- Large-degree occurrences are bounded using their total formal degree. -/ +theorem threshold_mul_length_filter_le_sum {α : Type*} (d : α → ℕ) + (l : List α) (t : ℕ) : + t * (l.filter fun a => t ≤ d a).length ≤ (l.map d).sum := by + induction l with + | nil => simp + | cons a l ih => + by_cases ha : t ≤ d a + · simp [ha, Nat.mul_add] + omega + · simpa [ha] using le_trans ih (Nat.le_add_left _ _) + +/-- The manuscript's number of high-degree occurrences bound for an upper term. -/ +theorem output_term_high_count_bound (c : Depth5Circuit K n) + (entry : K × Fin c.upperCount) (hentry : entry ∈ c.outputInputs) (t : ℕ) : + t * ((c.upperInputs entry.2).filter fun j => t ≤ c.middleDegree j).length ≤ + c.outputDegree := by + rw [← c.outputHomogeneous entry hentry] + exact threshold_mul_length_filter_le_sum _ _ _ + +/-- Real thresholds need not be rounded to bound the number of large factors. -/ +theorem real_threshold_mul_length_filter_le_sum {α : Type*} (d : α → ℕ) + (l : List α) (t : ℝ) : + t * ((l.filter fun a => t ≤ (d a : ℝ)).length : ℝ) ≤ (l.map d).sum := by + induction l with + | nil => simp + | cons a l ih => + simp only [Nat.cast_list_sum, List.map_map] at ih + by_cases ha : t ≤ (d a : ℝ) + · simp [ha, Nat.cast_add, mul_add] + linarith + · have hnonneg : (0 : ℝ) ≤ d a := Nat.cast_nonneg _ + simp [ha, Nat.cast_add] + linarith + +/-- The number of high middle-factor occurrences is at most output degree / threshold. -/ +theorem output_term_high_count_le_div (c : Depth5Circuit K n) + (entry : K × Fin c.upperCount) (hentry : entry ∈ c.outputInputs) + (t : ℝ) (ht : 0 < t) : + (((c.upperInputs entry.2).filter fun j => t ≤ (c.middleDegree j : ℝ)).length : ℝ) ≤ + (c.outputDegree : ℝ) / t := by + apply (le_div_iff₀ ht).mpr + rw [mul_comm, ← c.outputHomogeneous entry hentry] + exact real_threshold_mul_length_filter_le_sum _ _ _ + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CircuitFactorForms.lean b/lean/OAI/Algebra/DepthFive/CircuitFactorForms.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b36feb87b904038a929356bf02c9cb7964fde47 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CircuitFactorForms.lean @@ -0,0 +1,50 @@ +import OAI.Algebra.DepthFive.CircuitDegreeBounds +import OAI.Algebra.DepthFive.Homogeneity +import OAI.Algebra.DepthFive.ProductNormalization + +namespace OAI + +noncomputable section + +namespace Problem335 +universe u +variable {K : Type u} [CommSemiring K] {n : ℕ} + +/-- A lower product computes a scalar times exactly its formal degree many +homogeneous linear forms, with repeated inputs retained as repeated factors. -/ +theorem lowerValue_normal_form (c : Depth5Circuit K n) (i : Fin c.lowerCount) : + ∃ a : K, ∃ factors : List (MvPolynomial (Fin n × Fin n × Fin n) K), + factors.length = ((c.lowerInputs i).map c.bottomDegree).sum ∧ + (∀ p ∈ factors, p.IsHomogeneous 1) ∧ + lowerValue c i = MvPolynomial.C a * factors.prod := by + let l := (c.lowerInputs i).map fun j => (bottomValue c j, c.bottomDegree j) + have hl : ∀ q ∈ l, q.1.IsHomogeneous q.2 := by + intro q hq + obtain ⟨j, _, rfl⟩ := List.mem_map.mp hq + exact bottomValue_isHomogeneous c j + have hle : ∀ q ∈ l, q.2 ≤ 1 := by + intro q hq + obtain ⟨j, _, rfl⟩ := List.mem_map.mp hq + exact bottomDegree_le_one c j + obtain ⟨a, factors, hlen, hhom, hval⟩ := homogeneous_product_linear_factors l hl hle + exact ⟨a, factors, by simpa [l, Function.comp_def] using hlen, hhom, + by simpa [l, lowerValue, Function.comp_def] using hval⟩ + +/-- A weighted term of a middle sum has a linear-factor form of the middle +sum's assigned degree, even for a zero coefficient or zero product. -/ +theorem middle_input_normal_form (c : Depth5Circuit K n) (i : Fin c.middleCount) + (entry : K × Fin c.lowerCount) (hentry : entry ∈ c.middleInputs i) : + ∃ a : K, ∃ factors : List (MvPolynomial (Fin n × Fin n × Fin n) K), + factors.length = c.middleDegree i ∧ + (∀ p ∈ factors, p.IsHomogeneous 1) ∧ + MvPolynomial.C entry.1 * lowerValue c entry.2 = + MvPolynomial.C a * factors.prod := by + obtain ⟨a, factors, hlen, hhom, hval⟩ := lowerValue_normal_form c entry.2 + refine ⟨entry.1 * a, factors, hlen.trans (c.middleHomogeneous i entry hentry), hhom, ?_⟩ + simp [hval, mul_assoc] + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CircuitOutputDegree.lean b/lean/OAI/Algebra/DepthFive/CircuitOutputDegree.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c62c4a984f5fb21601e4c64071d37f836391d4b --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CircuitOutputDegree.lean @@ -0,0 +1,39 @@ +import OAI.Algebra.DepthFive.Homogeneity +import OAI.Algebra.DepthFive.ImmDegree + +namespace OAI + +noncomputable section + +namespace Problem335 + +/-- A nonzero IMM output forces the assigned syntactic output degree to be the layer count. -/ +theorem outputDegree_eq_of_circuitValue_eq_imm {K : Type*} [CommSemiring K] + [Nontrivial K] {n : ℕ} (hn : 0 < n) (c : Depth5Circuit K n) + (hc : circuitValue c = imm K n) : c.outputDegree = n := by + have hh := circuitValue_isHomogeneous c + rw [hc] at hh + exact hh.inj_right (imm_isHomogeneous K n) (imm_ne_zero K n hn) + +/-- Every upper product contributing to an IMM circuit has formal degree `n`. -/ +theorem upper_degree_eq_of_circuitValue_eq_imm {K : Type*} [CommSemiring K] + [Nontrivial K] {n : ℕ} (hn : 0 < n) (c : Depth5Circuit K n) + (hc : circuitValue c = imm K n) (entry : K × Fin c.upperCount) + (he : entry ∈ c.outputInputs) : + ((c.upperInputs entry.2).map c.middleDegree).sum = n := by + rw [c.outputHomogeneous entry he, outputDegree_eq_of_circuitValue_eq_imm hn c hc] + +/-- Nonzero IMM cannot be computed by an empty output sum. -/ +theorem outputInputs_ne_nil_of_circuitValue_eq_imm {K : Type*} [CommSemiring K] + [Nontrivial K] {n : ℕ} (hn : 0 < n) (c : Depth5Circuit K n) + (hc : circuitValue c = imm K n) : c.outputInputs ≠ [] := by + intro he + have hdeg := c.outputEmpty he + rw [outputDegree_eq_of_circuitValue_eq_imm hn c hc] at hdeg + omega + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CircuitProductBound.lean b/lean/OAI/Algebra/DepthFive/CircuitProductBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..aaa7bc924882d2b92bf914c2c57e4edacbd31baf --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CircuitProductBound.lean @@ -0,0 +1,142 @@ +import OAI.Algebra.DepthFive.CircuitFactorForms +import OAI.Algebra.DepthFive.CircuitStructure +import OAI.Algebra.DepthFive.CircuitRankAssembly + +namespace OAI + +open scoped BigOperators +noncomputable section + +namespace Problem335 +universe u v + +/-- The product estimate required when every positive formal degree is small. -/ +def LowProductBound {K : Type u} [CommSemiring K] {σ : Type v} + (R : MvPolynomial σ K → ℝ) (d : ℕ) (t B : ℝ) : Prop := + ∀ factors : List (MvPolynomial σ K × ℕ), + (∀ q ∈ factors, 0 < q.2 ∧ q.1.IsHomogeneous q.2 ∧ (q.2 : ℝ) < t) → + (factors.map Prod.snd).sum = d → + R (factors.map Prod.fst).prod ≤ B + +/-- The product estimate required after opening one large middle factor. -/ +def HighProductBound {K : Type u} [CommSemiring K] {σ : Type v} + (R : MvPolynomial σ K → ℝ) (d : ℕ) (t B : ℝ) : Prop := + ∀ (linears : List (MvPolynomial σ K)) (others : List (MvPolynomial σ K × ℕ)), + (∀ p ∈ linears, p.IsHomogeneous 1) → + (∀ q ∈ others, 0 < q.2 ∧ q.1.IsHomogeneous q.2) → + t ≤ (linears.length : ℝ) → + linears.length + (others.map Prod.snd).sum = d → + R (linears.prod * (others.map Prod.fst).prod) ≤ B + +/-- Opening one high middle factor, or applying the all-low estimate, bounds +an actual list of positive-degree middle-gate occurrences. -/ +theorem positive_middle_product_measure_le + {K : Type u} [CommSemiring K] {n : ℕ} (c : Depth5Circuit K n) + (R : MvPolynomial (Fin n × Fin n × Fin n) K → ℝ) + (hzero : R 0 = 0) (hadd : ∀ x y, R (x + y) ≤ R x + R y) + (hscale : ∀ a p, R (MvPolynomial.C a * p) ≤ R p) + (d : ℕ) (t B : ℝ) (hB : 0 ≤ B) + (hlow : LowProductBound R d t B) (hhigh : HighProductBound R d t B) + (l : List (Fin c.middleCount)) + (hpos : ∀ j ∈ l, 0 < c.middleDegree j) + (hdegree : (l.map c.middleDegree).sum = d) : + R (l.map (middleValue c)).prod ≤ (circuitSize c : ℝ) * B := by + classical + have honeNat : 1 ≤ circuitSize c := by unfold circuitSize; omega + have hone : (1 : ℝ) ≤ circuitSize c := by exact_mod_cast honeNat + by_cases hsmall : ∀ j ∈ l, (c.middleDegree j : ℝ) < t + · have hb := hlow (l.map fun j => (middleValue c j, c.middleDegree j)) (by + intro q hq + obtain ⟨j, hj, rfl⟩ := List.mem_map.mp hq + exact ⟨hpos j hj, middleValue_isHomogeneous c j, hsmall j hj⟩) (by + simpa only [List.map_map, Function.comp_def] using hdegree) + have hb' : R (l.map (middleValue c)).prod ≤ B := by + simpa only [List.map_map, Function.comp_def] using hb + exact hb'.trans (by nlinarith) + · push Not at hsmall + obtain ⟨j, hj, hjhigh⟩ := hsmall + obtain ⟨before, after, rfl⟩ := List.mem_iff_append.mp hj + let others := (before ++ after).map fun k => (middleValue c k, c.middleDegree k) + have hothers : ∀ q ∈ others, 0 < q.2 ∧ q.1.IsHomogeneous q.2 := by + intro q hq + obtain ⟨k, hk, rfl⟩ := List.mem_map.mp hq + refine ⟨hpos k ?_, middleValue_isHomogeneous c k⟩ + rcases List.mem_append.mp hk with hk | hk + · exact List.mem_append_left _ hk + · exact List.mem_append_right _ (List.mem_cons_of_mem _ hk) + have htotal : c.middleDegree j + (others.map Prod.snd).sum = d := by + simpa [others, List.map_append, List.sum_append, Nat.add_assoc, + Nat.add_comm, Nat.add_left_comm, Function.comp_def] using hdegree + have hexpand : + ((before ++ j :: after).map (middleValue c)).prod = + ∑ k : Fin c.lowerCount, + MvPolynomial.C (gateCoefficient (c.middleInputs j) k) * + (lowerValue c k * (others.map Prod.fst).prod) := by + simp only [List.map_append, List.map_cons, List.prod_append, List.prod_cons] + rw [middleValue_eq_sum, Finset.sum_mul, Finset.mul_sum] + apply Finset.sum_congr rfl + intro k _ + simp only [others, List.map_map, Function.comp_def, List.map_append, List.prod_append] + ring + have hbranches : ∀ k : Fin c.lowerCount, + gateCoefficient (c.middleInputs j) k ≠ 0 → + R (lowerValue c k * (others.map Prod.fst).prod) ≤ B := by + intro k hk + have hkdegree := middleDegree_of_gateCoefficient_ne_zero c j k hk + obtain ⟨a, linears, hlen, hlin, hval⟩ := lowerValue_normal_form c k + have hlen' : linears.length = c.middleDegree j := hlen.trans hkdegree + have heq : lowerValue c k * (others.map Prod.fst).prod = + MvPolynomial.C a * (linears.prod * (others.map Prod.fst).prod) := by + rw [hval] + ring + rw [heq] + apply (hscale a _).trans + exact hhigh linears others hlin hothers (by simpa [hlen'] using hjhigh) + (by simpa [hlen'] using htotal) + have hb : R (((before ++ j :: after).map (middleValue c)).prod) ≤ + (c.lowerCount : ℝ) * B := by + rw [hexpand] + simpa using measure_weighted_sum_le_card_mul R hzero hadd hscale Finset.univ + (gateCoefficient (c.middleInputs j)) + (fun k => lowerValue c k * (others.map Prod.fst).prod) B hB + (fun k _ => hbranches k) + have hcountNat : c.lowerCount ≤ circuitSize c := by unfold circuitSize; omega + have hcount : (c.lowerCount : ℝ) ≤ circuitSize c := by exact_mod_cast hcountNat + exact hb.trans (mul_le_mul_of_nonneg_right hcount hB) + +/-- The manuscript's gate-count reduction instantiated with the actual circuit +normal forms. All remaining hypotheses are bounds on homogeneous products, +not circuit-specific summands or wire counts. -/ +theorem circuit_measure_le_of_product_estimates + {K : Type u} [CommSemiring K] {n : ℕ} (c : Depth5Circuit K n) + (R : MvPolynomial (Fin n × Fin n × Fin n) K → ℝ) + (hzero : R 0 = 0) (hadd : ∀ x y, R (x + y) ≤ R x + R y) + (hscale : ∀ a p, R (MvPolynomial.C a * p) ≤ R p) + (d : ℕ) (houtput : c.outputDegree = d) (t B : ℝ) (hB : 0 ≤ B) + (hlow : LowProductBound R d t B) (hhigh : HighProductBound R d t B) : + R (circuitValue c) ≤ (circuitSize c : ℝ) ^ 2 * B := by + have hSB : 0 ≤ (circuitSize c : ℝ) * B := mul_nonneg (Nat.cast_nonneg _) hB + have hgates : ∀ u, gateCoefficient c.outputInputs u ≠ 0 → + R (upperValue c u) ≤ (circuitSize c : ℝ) * B := by + intro u hu + obtain ⟨a, factors, _, hpos, hdegree, hval, _⟩ := upperValue_positive_factors c u + have hdegree' : (factors.map c.middleDegree).sum = d := + hdegree.trans ((outputDegree_of_gateCoefficient_ne_zero c u hu).trans houtput) + rw [hval] + exact (hscale a _).trans + (positive_middle_product_measure_le c R hzero hadd hscale d t B hB + hlow hhigh factors hpos hdegree') + have hcountNat : c.upperCount ≤ circuitSize c := by unfold circuitSize; omega + have hcount : (c.upperCount : ℝ) ≤ circuitSize c := by exact_mod_cast hcountNat + calc + R (circuitValue c) ≤ (c.upperCount : ℝ) * ((circuitSize c : ℝ) * B) := + circuit_measure_le_upperCount_mul c R hzero hadd hscale _ hSB hgates + _ ≤ (circuitSize c : ℝ) * ((circuitSize c : ℝ) * B) := + mul_le_mul_of_nonneg_right hcount hSB + _ = (circuitSize c : ℝ) ^ 2 * B := by ring + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CircuitRankAssembly.lean b/lean/OAI/Algebra/DepthFive/CircuitRankAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7fa45e6f4649969385b0e949e472fe0ba740d44 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CircuitRankAssembly.lean @@ -0,0 +1,169 @@ +import OAI.Algebra.DepthFive.GateSums + +namespace OAI + +open scoped BigOperators +noncomputable section + +namespace Problem335 + +/-- Finite subadditivity, with no assumptions on the individual summands. -/ +theorem measure_finset_sum_le {A ι : Type*} [AddCommMonoid A] + (R : A → ℝ) (hzero : R 0 = 0) + (hadd : ∀ x y, R (x + y) ≤ R x + R y) + (s : Finset ι) (f : ι → A) : + R (∑ j ∈ s, f j) ≤ ∑ j ∈ s, R (f j) := by + classical + induction s using Finset.induction with + | empty => simp [hzero] + | @insert j s hj ih => + rw [Finset.sum_insert hj, Finset.sum_insert hj] + exact (hadd _ _).trans (add_le_add le_rfl ih) + +/-- Scalar weighting cannot increase a subadditive rank-like measure. -/ +theorem measure_weighted_sum_le {K σ ι : Type*} [CommSemiring K] + (R : MvPolynomial σ K → ℝ) (hzero : R 0 = 0) + (hadd : ∀ x y, R (x + y) ≤ R x + R y) + (hscale : ∀ a p, R (MvPolynomial.C a * p) ≤ R p) + (s : Finset ι) (a : ι → K) (p : ι → MvPolynomial σ K) : + R (∑ j ∈ s, MvPolynomial.C (a j) * p j) ≤ ∑ j ∈ s, R (p j) := by + exact (measure_finset_sum_le R hzero hadd s _).trans + (Finset.sum_le_sum (fun j _ => hscale (a j) (p j))) + +/-- Expand one selected factor and leave all other occurrences unchanged. +This is the algebraic step behind the high-degree-factor case: in particular, +other occurrences of the very same middle gate are not expanded. -/ +theorem measure_one_factor_expansion_le {K σ ι : Type*} [CommSemiring K] + (R : MvPolynomial σ K → ℝ) (hzero : R 0 = 0) + (hadd : ∀ x y, R (x + y) ≤ R x + R y) + (hscale : ∀ a p, R (MvPolynomial.C a * p) ≤ R p) + (s : Finset ι) (a : ι → K) (p : ι → MvPolynomial σ K) + (before after : MvPolynomial σ K) : + R (before * (∑ j ∈ s, MvPolynomial.C (a j) * p j) * after) ≤ + ∑ j ∈ s, R (before * p j * after) := by + have heq : + before * (∑ j ∈ s, MvPolynomial.C (a j) * p j) * after = + ∑ j ∈ s, MvPolynomial.C (a j) * (before * p j * after) := by + rw [Finset.mul_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro j hj + ring + rw [heq] + exact measure_weighted_sum_le R hzero hadd hscale s a _ + +/-- Only predecessors with nonzero aggregate coefficient need a bound. +This matters for homogeneous circuits, since inactive gates can have arbitrary +formal degree. -/ +theorem measure_weighted_sum_le_card_mul {K σ ι : Type*} [CommSemiring K] + (R : MvPolynomial σ K → ℝ) (hzero : R 0 = 0) + (hadd : ∀ x y, R (x + y) ≤ R x + R y) + (hscale : ∀ a p, R (MvPolynomial.C a * p) ≤ R p) + (s : Finset ι) (a : ι → K) (p : ι → MvPolynomial σ K) + (B : ℝ) (hB : 0 ≤ B) + (hbound : ∀ j ∈ s, a j ≠ 0 → R (p j) ≤ B) : + R (∑ j ∈ s, MvPolynomial.C (a j) * p j) ≤ (s.card : ℝ) * B := by + calc + R (∑ j ∈ s, MvPolynomial.C (a j) * p j) ≤ + ∑ j ∈ s, R (MvPolynomial.C (a j) * p j) := + measure_finset_sum_le R hzero hadd s _ + _ ≤ ∑ j ∈ s, B := by + apply Finset.sum_le_sum + intro j hj + by_cases ha : a j = 0 + · simpa [ha, hzero] using hB + · exact (hscale _ _).trans (hbound j hj ha) + _ = (s.card : ℝ) * B := by simp + +/-- A uniform bound on active output predecessors costs the number of upper +product gates, never the number of output wires. -/ +theorem circuit_measure_le_upperCount_mul {K : Type*} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) + (R : MvPolynomial (Fin n × Fin n × Fin n) K → ℝ) (hzero : R 0 = 0) + (hadd : ∀ x y, R (x + y) ≤ R x + R y) + (hscale : ∀ a p, R (MvPolynomial.C a * p) ≤ R p) + (B : ℝ) (hB : 0 ≤ B) + (hbound : ∀ j, gateCoefficient c.outputInputs j ≠ 0 → R (upperValue c j) ≤ B) : + R (circuitValue c) ≤ (c.upperCount : ℝ) * B := by + rw [circuitValue_eq_sum] + simpa using measure_weighted_sum_le_card_mul R hzero hadd hscale + Finset.univ (gateCoefficient c.outputInputs) (upperValue c) B hB + (fun j _ => hbound j) + +/-- Expanding one middle-gate occurrence costs at most the number of lower +product gates. All other occurrences, including shared copies of the selected +gate, are retained as factors in `before` and `after`. -/ +theorem upper_measure_le_lowerCount_mul_of_split + {K : Type*} [CommSemiring K] {n : ℕ} (c : Depth5Circuit K n) + (R : MvPolynomial (Fin n × Fin n × Fin n) K → ℝ) (hzero : R 0 = 0) + (hadd : ∀ x y, R (x + y) ≤ R x + R y) + (hscale : ∀ a p, R (MvPolynomial.C a * p) ≤ R p) + (u : Fin c.upperCount) (j : Fin c.middleCount) + (before after : List (Fin c.middleCount)) + (hsplit : c.upperInputs u = before ++ j :: after) + (B : ℝ) (hB : 0 ≤ B) + (hbound : ∀ l, gateCoefficient (c.middleInputs j) l ≠ 0 → + R ((before.map (middleValue c)).prod * lowerValue c l * + (after.map (middleValue c)).prod) ≤ B) : + R (upperValue c u) ≤ (c.lowerCount : ℝ) * B := by + classical + have heq : upperValue c u = + ∑ l : Fin c.lowerCount, + MvPolynomial.C (gateCoefficient (c.middleInputs j) l) * + ((before.map (middleValue c)).prod * lowerValue c l * + (after.map (middleValue c)).prod) := by + unfold upperValue + rw [hsplit] + simp only [List.map_append, List.map_cons, List.prod_append, List.prod_cons] + rw [middleValue_eq_sum, Finset.sum_mul, Finset.mul_sum] + apply Finset.sum_congr rfl + intro l hl + ring + rw [heq] + simpa using measure_weighted_sum_le_card_mul R hzero hadd hscale + Finset.univ (gateCoefficient (c.middleInputs j)) + (fun l => (before.map (middleValue c)).prod * lowerValue c l * + (after.map (middleValue c)).prod) B hB (fun l _ => hbound l) + +/-- The gate-count assembly step in the depth-five rank upper bound. +Each active upper product is either bounded directly, or one occurrence can +be expanded into active lower products with the same bound. -/ +theorem circuit_measure_le_size_sq_mul_of_low_or_split + {K : Type*} [CommSemiring K] {n : ℕ} (c : Depth5Circuit K n) + (R : MvPolynomial (Fin n × Fin n × Fin n) K → ℝ) (hzero : R 0 = 0) + (hadd : ∀ x y, R (x + y) ≤ R x + R y) + (hscale : ∀ a p, R (MvPolynomial.C a * p) ≤ R p) + (B : ℝ) (hB : 0 ≤ B) + (hupper : ∀ u, gateCoefficient c.outputInputs u ≠ 0 → + R (upperValue c u) ≤ B ∨ + ∃ (j : Fin c.middleCount) (before after : List (Fin c.middleCount)), + c.upperInputs u = before ++ j :: after ∧ + ∀ l, gateCoefficient (c.middleInputs j) l ≠ 0 → + R ((before.map (middleValue c)).prod * lowerValue c l * + (after.map (middleValue c)).prod) ≤ B) : + R (circuitValue c) ≤ (circuitSize c : ℝ) ^ 2 * B := by + have honeNat : 1 ≤ circuitSize c := by unfold circuitSize; omega + have hlowerNat : c.lowerCount ≤ circuitSize c := by unfold circuitSize; omega + have hupperNat : c.upperCount ≤ circuitSize c := by unfold circuitSize; omega + have hone : (1 : ℝ) ≤ circuitSize c := by exact_mod_cast honeNat + have hlower : (c.lowerCount : ℝ) ≤ circuitSize c := by exact_mod_cast hlowerNat + have hupperCount : (c.upperCount : ℝ) ≤ circuitSize c := by exact_mod_cast hupperNat + have hSB : 0 ≤ (circuitSize c : ℝ) * B := mul_nonneg (Nat.cast_nonneg _) hB + have hgates : ∀ u, gateCoefficient c.outputInputs u ≠ 0 → + R (upperValue c u) ≤ (circuitSize c : ℝ) * B := by + intro u hu + rcases hupper u hu with hlow | ⟨j, before, after, hsplit, hbound⟩ + · exact hlow.trans (by nlinarith) + · exact (upper_measure_le_lowerCount_mul_of_split c R hzero hadd hscale + u j before after hsplit B hB hbound).trans (mul_le_mul_of_nonneg_right hlower hB) + calc + R (circuitValue c) ≤ (c.upperCount : ℝ) * ((circuitSize c : ℝ) * B) := + circuit_measure_le_upperCount_mul c R hzero hadd hscale _ hSB hgates + _ ≤ (circuitSize c : ℝ) * ((circuitSize c : ℝ) * B) := + mul_le_mul_of_nonneg_right hupperCount hSB + _ = (circuitSize c : ℝ) ^ 2 * B := by ring + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CircuitStructure.lean b/lean/OAI/Algebra/DepthFive/CircuitStructure.lean new file mode 100644 index 0000000000000000000000000000000000000000..22bb11be6cfc4659d22e2218224aa9d3e7951664 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CircuitStructure.lean @@ -0,0 +1,75 @@ +import OAI.Algebra.DepthFive.ProductNormalization +import OAI.Algebra.DepthFive.Homogeneity + +namespace OAI + +noncomputable section + +namespace Problem335 + +open MvPolynomial + +universe u v w + +/-- An indexed version of positive-factor normalization. The resulting list +is a sublist of the original gate occurrences, so sharing and multiplicity +are preserved. -/ +theorem homogeneous_indexed_product_positive_factors + {K : Type u} [CommSemiring K] {σ : Type v} {ι : Type w} + (l : List ι) (p : ι → MvPolynomial σ K) (d : ι → ℕ) + (hl : ∀ i ∈ l, (p i).IsHomogeneous (d i)) : + ∃ a : K, ∃ factors : List ι, + factors.Sublist l ∧ + (∀ i ∈ factors, 0 < d i) ∧ + (factors.map d).sum = (l.map d).sum ∧ + (l.map p).prod = C a * (factors.map p).prod ∧ + factors.length ≤ (l.map d).sum := by + obtain ⟨a, fs, hf, hd, hv, hs, hn⟩ := + homogeneous_product_positive_factors (l.map (fun i => (p i, d i))) (by + intro q hq + obtain ⟨i, hi, rfl⟩ := List.mem_map.mp hq + exact hl i hi) + obtain ⟨factors, hsub, rfl⟩ := List.sublist_map_iff.mp hs + refine ⟨a, factors, hsub, ?_, ?_, ?_, ?_⟩ + · intro i hi + exact (hf (p i, d i) (List.mem_map.mpr ⟨i, hi, rfl⟩)).1 + · simpa only [List.map_map, Function.comp_def] using hd + · simpa only [List.map_map, Function.comp_def] using hv + · simpa only [List.length_map, List.map_map, Function.comp_def] using hn + +/-- Every upper product is a scalar multiple of positive-formal-degree +middle-gate occurrences whose degrees add to the original formal degree. -/ +theorem upperValue_positive_factors + {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) (i : Fin c.upperCount) : + ∃ a : K, ∃ factors : List (Fin c.middleCount), + factors.Sublist (c.upperInputs i) ∧ + (∀ j ∈ factors, 0 < c.middleDegree j) ∧ + (factors.map c.middleDegree).sum = + ((c.upperInputs i).map c.middleDegree).sum ∧ + upperValue c i = C a * (factors.map (middleValue c)).prod ∧ + factors.length ≤ ((c.upperInputs i).map c.middleDegree).sum := by + exact homogeneous_indexed_product_positive_factors + (c.upperInputs i) (middleValue c) c.middleDegree + (fun j _ => middleValue_isHomogeneous c j) + +/-- For an upper gate occurring at the output, the positive factor degrees +sum to the circuit output degree, hence there are at most that many factors. -/ +theorem output_term_positive_factors + {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) (entry : K × Fin c.upperCount) + (hentry : entry ∈ c.outputInputs) : + ∃ a : K, ∃ factors : List (Fin c.middleCount), + factors.Sublist (c.upperInputs entry.2) ∧ + (∀ j ∈ factors, 0 < c.middleDegree j) ∧ + (factors.map c.middleDegree).sum = c.outputDegree ∧ + upperValue c entry.2 = C a * (factors.map (middleValue c)).prod ∧ + factors.length ≤ c.outputDegree := by + simpa only [c.outputHomogeneous entry hentry] using + upperValue_positive_factors c entry.2 + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CircuitWeightBound.lean b/lean/OAI/Algebra/DepthFive/CircuitWeightBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..c74818076ee22acfe5e660753a081022f24d7dc6 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CircuitWeightBound.lean @@ -0,0 +1,168 @@ +import OAI.Algebra.DepthFive.HighDegreeWeights +import OAI.Algebra.DepthFive.CircuitProductBound + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Problem335 + +/-- The numerical parameter estimates needed by the circuit upper rank bound. -/ +structure WeightParameters (n : ℕ) (s q : ℝ) : Prop where + large : 64 ≤ n + s_pos : 0 < s + s_lower : Real.sqrt n / 2 ≤ s + s_upper : s ≤ Real.sqrt n + q_pos : 0 < q + q_half : q ≤ 1 / 2 + q_sqrt : q ≤ 2 / Real.sqrt n + q_pow : q ≤ (n : ℝ) ^ (-(2 / 5 : ℝ)) + q_small : 5 * q ^ ((3 : ℝ) / 16) ≤ 1 + +/-- The product-rank statement is kept explicit as the one algebraic input. -/ +def HomogeneousProductRankBound {K σ : Type*} [CommSemiring K] + (R : MvPolynomial σ K → ℝ) (n : ℕ) (q lam D : ℝ) : Prop := + ∀ factors : List (MvPolynomial σ K × ℕ), + (∀ f ∈ factors, 0 < f.2 ∧ f.1.IsHomogeneous f.2) → + (factors.map Prod.snd).sum = n → + R (factors.map Prod.fst).prod ≤ + 2 * D * (factors.map (fun f => degreeWeight q lam f.2)).prod + +/-- A common bound for a small product and for one expanded high product. -/ +def circuitProductEnvelope (n : ℕ) (D : ℝ) : ℝ := + 2 * D * Real.exp ((24 + 4 * Real.log 5) * Real.sqrt n) * + (n : ℝ) ^ (-Real.sqrt n / 100) + +private lemma sum_get_eq_map_sum {α M : Type*} [AddCommMonoid M] + (l : List α) (f : α → M) : + (∑ i : Fin l.length, f (l.get i)) = (l.map f).sum := by + rw [← List.sum_ofFn] + change (List.ofFn (f ∘ l.get)).sum = _ + rw [← List.map_ofFn, List.ofFn_get] + +private lemma prod_get_eq_map_prod {α M : Type*} [CommMonoid M] + (l : List α) (f : α → M) : + (∏ i : Fin l.length, f (l.get i)) = (l.map f).prod := by + rw [← List.prod_ofFn] + change (List.ofFn (f ∘ l.get)).prod = _ + rw [← List.map_ofFn, List.ofFn_get] + +/-- A `Fin`-indexed product-rank theorem supplies the list interface used by circuits. -/ +theorem homogeneousProductRankBound_of_fin {K σ : Type*} [CommSemiring K] + (R : MvPolynomial σ K → ℝ) (n : ℕ) (q lam D : ℝ) + (h : ∀ (m : ℕ) (P : Fin m → MvPolynomial σ K) (e : Fin m → ℕ), + (∀ i, 0 < e i) → (∀ i, (P i).IsHomogeneous (e i)) → + (∑ i, e i) = n → R (∏ i, P i) ≤ 2 * D * ∏ i, degreeWeight q lam (e i)) : + HomogeneousProductRankBound R n q lam D := by + intro factors hf hsum + have hsum' : (∑ i : Fin factors.length, (factors.get i).2) = n := by + rw [sum_get_eq_map_sum factors Prod.snd] + exact hsum + have hb := h factors.length (fun i => (factors.get i).1) (fun i => (factors.get i).2) + (fun i => (hf _ (List.get_mem _ _)).1) + (fun i => (hf _ (List.get_mem _ _)).2) hsum' + simpa only [prod_get_eq_map_prod factors Prod.fst, + prod_get_eq_map_prod factors (fun f => degreeWeight q lam f.2)] using hb + +lemma lowProductBound_of_product_rank {K σ : Type*} [CommSemiring K] + (R : MvPolynomial σ K → ℝ) (n : ℕ) (s q D : ℝ) + (hp : WeightParameters n s q) (hD : 0 ≤ D) + (hprod : HomogeneousProductRankBound R n q (1 / 2 - s / (2 * n)) D) : + LowProductBound R n ((n : ℝ) / (4 * s)) (circuitProductEnvelope n D) := by + intro factors hf hsum + have hn1 : 1 ≤ (n : ℝ) := by exact_mod_cast (show 1 ≤ n by have := hp.large; omega) + have hsumreal : (∑ i : Fin factors.length, ((factors.get i).2 : ℝ)) = n := by + rw [sum_get_eq_map_sum factors (fun f => (f.2 : ℝ))] + simpa only [Nat.cast_list_sum, List.map_map, Function.comp_def] using + congrArg (fun k : ℕ => (k : ℝ)) hsum + have hw := low_degreeWeight_product_bound Finset.univ (fun i : Fin factors.length => (factors.get i).2) + hn1 hp.s_pos hp.s_lower hp.s_upper hp.q_pos hp.q_half hp.q_sqrt hp.q_pow hp.q_small + (fun i _ => (hf _ (List.get_mem _ _)).1) + (fun i _ => (hf _ (List.get_mem _ _)).2.2) hsumreal + rw [prod_get_eq_map_prod factors (fun f => degreeWeight q (1 / 2 - s / (2 * n)) f.2)] at hw + have hr := hprod factors (fun f h => ⟨(hf f h).1, (hf f h).2.1⟩) hsum + have hcommon := all_low_common_rank_bound (n : ℝ) 1 D 6 hn1 (by norm_num) hD + norm_num only [mul_one, one_mul] at hcommon + calc + R (factors.map Prod.fst).prod ≤ + 2 * D * (factors.map (fun f => degreeWeight q (1 / 2 - s / (2 * n)) f.2)).prod := hr + _ ≤ 2 * D * (Real.exp (24 * Real.sqrt n) * (n : ℝ) ^ (-Real.sqrt n / 20)) := + mul_le_mul_of_nonneg_left hw (by positivity) + _ ≤ circuitProductEnvelope n D := by + simpa only [circuitProductEnvelope, show (4 : ℝ) * 6 = 24 by norm_num, + mul_assoc] using hcommon + +lemma highProductBound_of_product_rank {K σ : Type*} [CommSemiring K] + (R : MvPolynomial σ K → ℝ) (n : ℕ) (s q D : ℝ) + (hp : WeightParameters n s q) (hD : 0 ≤ D) + (hprod : HomogeneousProductRankBound R n q (1 / 2 - s / (2 * n)) D) : + HighProductBound R n ((n : ℝ) / (4 * s)) (circuitProductEnvelope n D) := by + intro linears others hlin hothers hlarge hsum + have hn64 : 64 ≤ (n : ℝ) := by exact_mod_cast hp.large + have hn1 : 1 ≤ (n : ℝ) := by linarith + have hbudgetNat : (others.map Prod.snd).sum ≤ n := by omega + have hbudget : (∑ i : Fin others.length, ((others.get i).2 : ℝ)) ≤ n := by + rw [sum_get_eq_map_sum others (fun f => (f.2 : ℝ))] + have hc : ((others.map Prod.snd).sum : ℝ) ≤ (n : ℝ) := by exact_mod_cast hbudgetNat + simpa only [Nat.cast_list_sum, List.map_map, Function.comp_def] using hc + have hw := expanded_degreeWeight_product_bound Finset.univ + (fun i : Fin others.length => (others.get i).2) linears.length + hn64 hp.s_pos hp.s_upper hp.q_pos hp.q_half hp.q_sqrt hp.q_pow hp.q_small + (fun i _ => (hothers _ (List.get_mem _ _)).1) hbudget hlarge + rw [prod_get_eq_map_prod others (fun f => degreeWeight q (1 / 2 - s / (2 * n)) f.2)] at hw + let factors := linears.map (fun p => (p, 1)) ++ others + have hfactor : ∀ f ∈ factors, 0 < f.2 ∧ f.1.IsHomogeneous f.2 := by + intro f hf + rcases List.mem_append.mp hf with hf | hf + · obtain ⟨p, hp', rfl⟩ := List.mem_map.mp hf + exact ⟨by norm_num, hlin p hp'⟩ + · exact hothers f hf + have htotal : (factors.map Prod.snd).sum = n := by + simpa [factors, List.map_append, List.map_map, Function.comp_def] using hsum + have hr := hprod factors hfactor htotal + have hr' : R (linears.prod * (others.map Prod.fst).prod) ≤ + 2 * D * ((degreeWeight q (1 / 2 - s / (2 * n)) 1) ^ linears.length * + (others.map (fun f => degreeWeight q (1 / 2 - s / (2 * n)) f.2)).prod) := by + simpa [factors, List.map_append, List.map_map, Function.comp_def] using hr + have hcommon := one_high_common_rank_bound (n : ℝ) s 1 D 6 hn1 hp.s_upper + (by norm_num) hD + norm_num only [mul_one, one_mul] at hcommon + calc + R (linears.prod * (others.map Prod.fst).prod) ≤ + 2 * D * ((degreeWeight q (1 / 2 - s / (2 * n)) 1) ^ linears.length * + (others.map (fun f => degreeWeight q (1 / 2 - s / (2 * n)) f.2)).prod) := hr' + _ ≤ 2 * D * ((5 : ℝ) ^ (4 * s) * Real.exp (24 * Real.sqrt n) * + (n : ℝ) ^ (-(3 * Real.sqrt n / 160))) := + mul_le_mul_of_nonneg_left hw (by positivity) + _ ≤ circuitProductEnvelope n D := by + simpa only [circuitProductEnvelope, show (4 : ℝ) * 6 = 24 by norm_num, + neg_div, mul_assoc] using hcommon + +/-- The full circuit upper rank estimate, reducing the actual circuit only to +the homogeneous-product rank theorem and explicit numerical parameters. -/ +theorem circuit_rank_bound_from_product_rank + {K : Type*} [CommSemiring K] {n : ℕ} (c : Depth5Circuit K n) + (R : MvPolynomial (Fin n × Fin n × Fin n) K → ℝ) + (hzero : R 0 = 0) (hadd : ∀ x y, R (x + y) ≤ R x + R y) + (hscale : ∀ a p, R (MvPolynomial.C a * p) ≤ R p) + (s q D : ℝ) (hp : WeightParameters n s q) (hD : 0 ≤ D) + (houtput : c.outputDegree = n) + (hprod : HomogeneousProductRankBound R n q (1 / 2 - s / (2 * n)) D) : + R (circuitValue c) ≤ 2 * (circuitSize c : ℝ) ^ 2 * D * + Real.exp ((24 + 4 * Real.log 5) * Real.sqrt n) * (n : ℝ) ^ (-Real.sqrt n / 100) := by + have hB : 0 ≤ circuitProductEnvelope n D := by + unfold circuitProductEnvelope + positivity + have h := circuit_measure_le_of_product_estimates c R hzero hadd hscale n houtput + ((n : ℝ) / (4 * s)) (circuitProductEnvelope n D) hB + (lowProductBound_of_product_rank R n s q D hp hD hprod) + (highProductBound_of_product_rank R n s q D hp hD hprod) + calc + R (circuitValue c) ≤ (circuitSize c : ℝ) ^ 2 * circuitProductEnvelope n D := h + _ = _ := by unfold circuitProductEnvelope; ring + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CoefficientDescent.lean b/lean/OAI/Algebra/DepthFive/CoefficientDescent.lean new file mode 100644 index 0000000000000000000000000000000000000000..27fcf798e9e3a34b4540e4720428650e059d81cb --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CoefficientDescent.lean @@ -0,0 +1,157 @@ +import OAI.Algebra.DepthFive.CoefficientSupport + +namespace OAI + +noncomputable section + +universe u v + +namespace Problem335 + +variable {K : Type u} [Field K] {n : ℕ} + +def restrictLeaf (c : Depth5Circuit K n) (i : Fin c.leafCount) : + D5Leaf (circuitCoefficientField c) n := + match h : c.leaves i with + | .scalar a => .scalar ⟨a, leaf_scalar_mem c i a h⟩ + | .variable x => .variable x + +@[simp] theorem restrictLeaf_degree (c : Depth5Circuit K n) (i : Fin c.leafCount) : + d5LeafDegree (restrictLeaf c i) = d5LeafDegree (c.leaves i) := by + unfold restrictLeaf + split <;> simp_all [d5LeafDegree] + +def restrictWeightedInputs {ι : Type v} (S : Subfield K) (l : List (K × ι)) + (h : ∀ e ∈ l, e.1 ∈ S) : List (S × ι) := + l.attach.map fun e => (⟨e.val.1, h e.val e.property⟩, e.val.2) + +@[simp] theorem restrictWeightedInputs_eq_nil_iff {ι : Type v} (S : Subfield K) + (l : List (K × ι)) (h : ∀ e ∈ l, e.1 ∈ S) : + restrictWeightedInputs S l h = [] ↔ l = [] := by + simp [restrictWeightedInputs] + +@[simp] theorem restrictWeightedInputs_map_coe {ι : Type v} (S : Subfield K) + (l : List (K × ι)) (h : ∀ e ∈ l, e.1 ∈ S) : + (restrictWeightedInputs S l h).map (fun e => ((e.1 : K), e.2)) = l := by + simp [restrictWeightedInputs, List.map_map, Function.comp_def, List.attach_map_subtype_val] + +/-- Restrict a circuit to the subfield generated by its occurring coefficients. -/ +def restrictCircuit (c : Depth5Circuit K n) : Depth5Circuit (circuitCoefficientField c) n where + leafCount := c.leafCount + leaves := restrictLeaf c + bottomCount := c.bottomCount + bottomInputs i := restrictWeightedInputs _ (c.bottomInputs i) (bottom_coeff_mem c i) + bottomDegree := c.bottomDegree + bottomHomogeneous := by + intro i e he + rcases List.mem_map.mp he with ⟨a, ha, rfl⟩ + simpa using c.bottomHomogeneous i a.val a.property + bottomEmpty := by + intro i h + exact c.bottomEmpty i ((restrictWeightedInputs_eq_nil_iff _ _ _).mp h) + lowerCount := c.lowerCount + lowerInputs := c.lowerInputs + middleCount := c.middleCount + middleInputs i := restrictWeightedInputs _ (c.middleInputs i) (middle_coeff_mem c i) + middleDegree := c.middleDegree + middleHomogeneous := by + intro i e he + rcases List.mem_map.mp he with ⟨a, ha, rfl⟩ + exact c.middleHomogeneous i a.val a.property + middleEmpty := by + intro i h + exact c.middleEmpty i ((restrictWeightedInputs_eq_nil_iff _ _ _).mp h) + upperCount := c.upperCount + upperInputs := c.upperInputs + outputInputs := restrictWeightedInputs _ c.outputInputs (output_coeff_mem c) + outputDegree := c.outputDegree + outputHomogeneous := by + intro e he + rcases List.mem_map.mp he with ⟨a, ha, rfl⟩ + exact c.outputHomogeneous a.val a.property + outputEmpty := by + intro h + exact c.outputEmpty ((restrictWeightedInputs_eq_nil_iff _ _ _).mp h) + +@[simp] theorem circuitSize_restrictCircuit (c : Depth5Circuit K n) : + circuitSize (restrictCircuit c) = circuitSize c := rfl + + +@[simp] theorem map_restrictLeaf_value (c : Depth5Circuit K n) (i : Fin c.leafCount) : + MvPolynomial.map (circuitCoefficientField c).subtype (d5LeafValue (restrictLeaf c i)) = + d5LeafValue (c.leaves i) := by + unfold restrictLeaf + split <;> simp_all [d5LeafValue] + +theorem restrictWeightedInputs_map_eval {ι : Type v} {β : Type*} (S : Subfield K) + (l : List (K × ι)) (h : ∀ e ∈ l, e.1 ∈ S) (f : K × ι → β) : + (restrictWeightedInputs S l h).map (fun e => f ((e.1 : K), e.2)) = l.map f := by + simpa only [List.map_map, Function.comp_def] using + congrArg (List.map f) (restrictWeightedInputs_map_coe S l h) + +@[simp] theorem map_bottomValue_restrictCircuit (c : Depth5Circuit K n) + (i : Fin c.bottomCount) : + MvPolynomial.map (circuitCoefficientField c).subtype + (bottomValue (restrictCircuit c) i) = bottomValue c i := by + simp only [bottomValue, map_list_sum, List.map_map, Function.comp_def, map_mul, + MvPolynomial.map_C] + change (List.map (fun e => MvPolynomial.C (e.1 : K) * + MvPolynomial.map (circuitCoefficientField c).subtype + (d5LeafValue (restrictLeaf c e.2))) + (restrictWeightedInputs _ (c.bottomInputs i) (bottom_coeff_mem c i))).sum = _ + simp only [map_restrictLeaf_value] + exact congrArg List.sum (restrictWeightedInputs_map_eval _ _ _ + (fun e : K × Fin c.leafCount => MvPolynomial.C e.1 * d5LeafValue (c.leaves e.2))) + +@[simp] theorem map_lowerValue_restrictCircuit (c : Depth5Circuit K n) + (i : Fin c.lowerCount) : + MvPolynomial.map (circuitCoefficientField c).subtype + (lowerValue (restrictCircuit c) i) = lowerValue c i := by + simp only [lowerValue, map_list_prod, List.map_map, Function.comp_def] + change (List.map (fun j => MvPolynomial.map (circuitCoefficientField c).subtype + (bottomValue (restrictCircuit c) j)) (c.lowerInputs i)).prod = _ + exact congrArg List.prod (List.map_congr_left + (fun index _ => map_bottomValue_restrictCircuit c index)) + +@[simp] theorem map_middleValue_restrictCircuit (c : Depth5Circuit K n) + (i : Fin c.middleCount) : + MvPolynomial.map (circuitCoefficientField c).subtype + (middleValue (restrictCircuit c) i) = middleValue c i := by + simp only [middleValue, map_list_sum, List.map_map, Function.comp_def, map_mul, + MvPolynomial.map_C] + change (List.map (fun e => MvPolynomial.C (e.1 : K) * + MvPolynomial.map (circuitCoefficientField c).subtype + (lowerValue (restrictCircuit c) e.2)) + (restrictWeightedInputs _ (c.middleInputs i) (middle_coeff_mem c i))).sum = _ + simp only [map_lowerValue_restrictCircuit] + exact congrArg List.sum (restrictWeightedInputs_map_eval _ _ _ + (fun e : K × Fin c.lowerCount => MvPolynomial.C e.1 * lowerValue c e.2)) + +@[simp] theorem map_upperValue_restrictCircuit (c : Depth5Circuit K n) + (i : Fin c.upperCount) : + MvPolynomial.map (circuitCoefficientField c).subtype + (upperValue (restrictCircuit c) i) = upperValue c i := by + simp only [upperValue, map_list_prod, List.map_map, Function.comp_def] + change (List.map (fun j => MvPolynomial.map (circuitCoefficientField c).subtype + (middleValue (restrictCircuit c) j)) (c.upperInputs i)).prod = _ + exact congrArg List.prod (List.map_congr_left + (fun index _ => map_middleValue_restrictCircuit c index)) + +@[simp] theorem map_circuitValue_restrictCircuit (c : Depth5Circuit K n) : + MvPolynomial.map (circuitCoefficientField c).subtype + (circuitValue (restrictCircuit c)) = circuitValue c := by + simp only [circuitValue, map_list_sum, List.map_map, Function.comp_def, map_mul, + MvPolynomial.map_C] + change (List.map (fun e => MvPolynomial.C (e.1 : K) * + MvPolynomial.map (circuitCoefficientField c).subtype + (upperValue (restrictCircuit c) e.2)) + (restrictWeightedInputs _ c.outputInputs (output_coeff_mem c))).sum = _ + simp only [map_upperValue_restrictCircuit] + exact congrArg List.sum (restrictWeightedInputs_map_eval _ _ _ + (fun e : K × Fin c.upperCount => MvPolynomial.C e.1 * upperValue c e.2)) + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CoefficientMap.lean b/lean/OAI/Algebra/DepthFive/CoefficientMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c9173826d9b9472242a049b1ef5ffc1c9fd0b09 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CoefficientMap.lean @@ -0,0 +1,156 @@ +import OAI.Algebra.DepthFive.Basic + +namespace OAI + +noncomputable section +universe u v w + +namespace Problem335 + +namespace D5Leaf + +def mapCoefficients {K : Type u} {L : Type v} {n : ℕ} + (f : K → L) : D5Leaf K n → D5Leaf L n + | .scalar a => .scalar (f a) + | .variable x => .variable x + +@[simp] theorem degree_mapCoefficients {K : Type u} {L : Type v} {n : ℕ} + (f : K → L) (x : D5Leaf K n) : + d5LeafDegree (mapCoefficients f x) = d5LeafDegree x := by + cases x <;> rfl + +@[simp] theorem mapCoefficients_id {K : Type u} {n : ℕ} (x : D5Leaf K n) : + mapCoefficients id x = x := by cases x <;> rfl + +@[simp] theorem mapCoefficients_comp {K : Type u} {L : Type v} {M : Type w} + {n : ℕ} (f : K → L) (g : L → M) (x : D5Leaf K n) : + mapCoefficients g (mapCoefficients f x) = mapCoefficients (g ∘ f) x := by + cases x <;> rfl + +end D5Leaf + +/-- Pure coefficient relabeling; no algebraic properties are needed for syntactic homogeneity. -/ +def Depth5Circuit.mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K → L) (c : Depth5Circuit K n) : Depth5Circuit L n where + leafCount := c.leafCount + leaves := fun i => D5Leaf.mapCoefficients f (c.leaves i) + bottomCount := c.bottomCount + bottomInputs := fun i => (c.bottomInputs i).map (fun e => (f e.1, e.2)) + bottomDegree := c.bottomDegree + bottomHomogeneous := by + intro i entry h + obtain ⟨e, he, rfl⟩ := List.mem_map.mp h + simpa using c.bottomHomogeneous i e he + bottomEmpty := by + intro i h + exact c.bottomEmpty i (List.map_eq_nil_iff.mp h) + lowerCount := c.lowerCount + lowerInputs := c.lowerInputs + middleCount := c.middleCount + middleInputs := fun i => (c.middleInputs i).map (fun e => (f e.1, e.2)) + middleDegree := c.middleDegree + middleHomogeneous := by + intro i entry h + obtain ⟨e, he, rfl⟩ := List.mem_map.mp h + exact c.middleHomogeneous i e he + middleEmpty := by + intro i h + exact c.middleEmpty i (List.map_eq_nil_iff.mp h) + upperCount := c.upperCount + upperInputs := c.upperInputs + outputInputs := c.outputInputs.map (fun e => (f e.1, e.2)) + outputDegree := c.outputDegree + outputHomogeneous := by + intro entry h + obtain ⟨e, he, rfl⟩ := List.mem_map.mp h + exact c.outputHomogeneous e he + outputEmpty := by + intro h + exact c.outputEmpty (List.map_eq_nil_iff.mp h) + +@[simp] theorem Depth5Circuit.lowerInputs_mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K → L) (c : Depth5Circuit K n) (i : Fin c.lowerCount) : + (c.mapCoefficients f).lowerInputs i = c.lowerInputs i := rfl + +@[simp] theorem Depth5Circuit.middleInputs_mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K → L) (c : Depth5Circuit K n) (i : Fin c.middleCount) : + (c.mapCoefficients f).middleInputs i = + (c.middleInputs i).map (fun e => (f e.1, e.2)) := rfl + +@[simp] theorem Depth5Circuit.upperInputs_mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K → L) (c : Depth5Circuit K n) (i : Fin c.upperCount) : + (c.mapCoefficients f).upperInputs i = c.upperInputs i := rfl + +@[simp] theorem Depth5Circuit.outputInputs_mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K → L) (c : Depth5Circuit K n) : + (c.mapCoefficients f).outputInputs = + c.outputInputs.map (fun e => (f e.1, e.2)) := rfl + +@[simp] theorem circuitSize_mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K → L) (c : Depth5Circuit K n) : + circuitSize (c.mapCoefficients f) = circuitSize c := rfl + +@[simp] theorem d5LeafValue_mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K →+* L) (x : D5Leaf K n) : + d5LeafValue (x.mapCoefficients f) = MvPolynomial.map f (d5LeafValue x) := by + cases x <;> simp [D5Leaf.mapCoefficients, d5LeafValue] + +@[simp] theorem bottomValue_mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K →+* L) (c : Depth5Circuit K n) (i : Fin c.bottomCount) : + bottomValue (c.mapCoefficients f) i = MvPolynomial.map f (bottomValue c i) := by + simp [bottomValue, Depth5Circuit.mapCoefficients, List.map_map, + Function.comp_def, map_list_sum] + +@[simp] theorem lowerValue_mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K →+* L) (c : Depth5Circuit K n) (i : Fin c.lowerCount) : + lowerValue (c.mapCoefficients f) i = MvPolynomial.map f (lowerValue c i) := by + simp [lowerValue, bottomValue, Depth5Circuit.mapCoefficients, List.map_map, + Function.comp_def, map_list_sum, map_list_prod] + +@[simp] theorem middleValue_mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K →+* L) (c : Depth5Circuit K n) (i : Fin c.middleCount) : + middleValue (c.mapCoefficients f) i = MvPolynomial.map f (middleValue c i) := by + simp [middleValue, lowerValue, bottomValue, Depth5Circuit.mapCoefficients, List.map_map, + Function.comp_def, map_list_sum, map_list_prod] + +@[simp] theorem upperValue_mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K →+* L) (c : Depth5Circuit K n) (i : Fin c.upperCount) : + upperValue (c.mapCoefficients f) i = MvPolynomial.map f (upperValue c i) := by + simp [upperValue, middleValue, lowerValue, bottomValue, Depth5Circuit.mapCoefficients, List.map_map, + Function.comp_def, map_list_sum, map_list_prod] + +@[simp] theorem circuitValue_mapCoefficients {K : Type u} {L : Type v} + [CommSemiring K] [CommSemiring L] {n : ℕ} + (f : K →+* L) (c : Depth5Circuit K n) : + circuitValue (c.mapCoefficients f) = MvPolynomial.map f (circuitValue c) := by + simp [circuitValue, upperValue, middleValue, lowerValue, bottomValue, Depth5Circuit.mapCoefficients, List.map_map, + Function.comp_def, map_list_sum, map_list_prod] +@[simp] theorem Depth5Circuit.mapCoefficients_id {K : Type u} + [CommSemiring K] {n : ℕ} (c : Depth5Circuit K n) : + c.mapCoefficients id = c := by + cases c + simp [Depth5Circuit.mapCoefficients] + +@[simp] theorem Depth5Circuit.mapCoefficients_comp {K : Type u} {L : Type v} + {M : Type w} [CommSemiring K] [CommSemiring L] [CommSemiring M] + {n : ℕ} (f : K → L) (g : L → M) (c : Depth5Circuit K n) : + (c.mapCoefficients f).mapCoefficients g = c.mapCoefficients (g ∘ f) := by + cases c + simp [Depth5Circuit.mapCoefficients, List.map_map, Function.comp_def] + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CoefficientSupport.lean b/lean/OAI/Algebra/DepthFive/CoefficientSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..0aefec89aaaabd7a5597bed5ef19350f346c4cb2 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CoefficientSupport.lean @@ -0,0 +1,96 @@ +import OAI.Algebra.DepthFive.Basic + +namespace OAI + +noncomputable section + +universe u + +namespace Problem335 + +/-- The scalars actually occurring at a leaf. -/ +def leafCoefficientSet {K : Type u} {n : ℕ} (x : D5Leaf K n) : Finset K := by + classical + exact match x with + | .scalar a => {a} + | .variable _ => ∅ + +/-- All coefficients occurring in a circuit, including weighted wires. -/ +def circuitCoefficientSet {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) : Finset K := by + classical + exact (Finset.univ.biUnion fun i => leafCoefficientSet (c.leaves i)) ∪ + (Finset.univ.biUnion fun i => ((c.bottomInputs i).map Prod.fst).toFinset) ∪ + (Finset.univ.biUnion fun i => ((c.middleInputs i).map Prod.fst).toFinset) ∪ + (c.outputInputs.map Prod.fst).toFinset + +lemma leaf_scalar_mem_coefficientSet {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) (i : Fin c.leafCount) (a : K) + (h : c.leaves i = .scalar a) : a ∈ circuitCoefficientSet c := by + classical + simp only [circuitCoefficientSet, Finset.mem_union] + left; left; left + exact Finset.mem_biUnion.mpr ⟨i, Finset.mem_univ _, by simp [h, leafCoefficientSet]⟩ + +lemma bottom_coeff_mem_coefficientSet {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) (i : Fin c.bottomCount) (entry : K × Fin c.leafCount) + (h : entry ∈ c.bottomInputs i) : entry.1 ∈ circuitCoefficientSet c := by + classical + simp only [circuitCoefficientSet, Finset.mem_union] + left; left; right + exact Finset.mem_biUnion.mpr ⟨i, Finset.mem_univ _, List.mem_toFinset.mpr + (List.mem_map.mpr ⟨entry, h, rfl⟩)⟩ + +lemma middle_coeff_mem_coefficientSet {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) (i : Fin c.middleCount) (entry : K × Fin c.lowerCount) + (h : entry ∈ c.middleInputs i) : entry.1 ∈ circuitCoefficientSet c := by + classical + simp only [circuitCoefficientSet, Finset.mem_union] + left; right + exact Finset.mem_biUnion.mpr ⟨i, Finset.mem_univ _, List.mem_toFinset.mpr + (List.mem_map.mpr ⟨entry, h, rfl⟩)⟩ + +lemma output_coeff_mem_coefficientSet {K : Type u} [CommSemiring K] {n : ℕ} + (c : Depth5Circuit K n) (entry : K × Fin c.upperCount) + (h : entry ∈ c.outputInputs) : entry.1 ∈ circuitCoefficientSet c := by + classical + simp only [circuitCoefficientSet, Finset.mem_union] + right + exact List.mem_toFinset.mpr (List.mem_map.mpr ⟨entry, h, rfl⟩) + +/-- The subfield generated by the finitely many coefficients of a circuit. -/ +def circuitCoefficientField {K : Type u} [Field K] {n : ℕ} + (c : Depth5Circuit K n) : Subfield K := + Subfield.closure (↑(circuitCoefficientSet c) : Set K) + +lemma leaf_scalar_mem {K : Type u} [Field K] {n : ℕ} + (c : Depth5Circuit K n) (i : Fin c.leafCount) (a : K) + (h : c.leaves i = .scalar a) : a ∈ circuitCoefficientField c := + Subfield.subset_closure (leaf_scalar_mem_coefficientSet c i a h) + +lemma bottom_coeff_mem {K : Type u} [Field K] {n : ℕ} + (c : Depth5Circuit K n) (i : Fin c.bottomCount) (entry : K × Fin c.leafCount) + (h : entry ∈ c.bottomInputs i) : entry.1 ∈ circuitCoefficientField c := + Subfield.subset_closure (bottom_coeff_mem_coefficientSet c i entry h) + +lemma middle_coeff_mem {K : Type u} [Field K] {n : ℕ} + (c : Depth5Circuit K n) (i : Fin c.middleCount) (entry : K × Fin c.lowerCount) + (h : entry ∈ c.middleInputs i) : entry.1 ∈ circuitCoefficientField c := + Subfield.subset_closure (middle_coeff_mem_coefficientSet c i entry h) + +lemma output_coeff_mem {K : Type u} [Field K] {n : ℕ} + (c : Depth5Circuit K n) (entry : K × Fin c.upperCount) + (h : entry ∈ c.outputInputs) : entry.1 ∈ circuitCoefficientField c := + Subfield.subset_closure (output_coeff_mem_coefficientSet c entry h) + +instance circuitCoefficientField_countable {K : Type u} [Field K] {n : ℕ} + (c : Depth5Circuit K n) : Countable (circuitCoefficientField c) := by + apply Cardinal.mk_le_aleph0_iff.mp + exact (Subfield.cardinalMk_closure_le_max (↑(circuitCoefficientSet c) : Set K)).trans + (max_le (Cardinal.mk_le_aleph0) le_rfl) + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ComplexEmbedding.lean b/lean/OAI/Algebra/DepthFive/ComplexEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..7dc334ba3b0b936ea90ab1f149bc35264d0bbb89 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ComplexEmbedding.lean @@ -0,0 +1,43 @@ +import Mathlib + +namespace OAI + +noncomputable section + +universe u + +namespace Problem335 + +/-- Every countable characteristic-zero field admits an embedding into the complex numbers. +This applies to the subfield generated by the finitely many coefficients of a circuit. -/ +theorem countable_field_embeds_complex (K : Type u) [Field K] [CharZero K] [Countable K] : + Nonempty (K →+* ℂ) := by + classical + obtain ⟨s, hs⟩ := exists_isTranscendenceBasis ℚ K + obtain ⟨t, ht⟩ := exists_isTranscendenceBasis ℚ ℂ + have htcard : Cardinal.mk ℂ = Cardinal.mk t := + IsAlgClosed.cardinal_eq_cardinal_transcendence_basis_of_aleph0_lt' + (fun x : t => (x : ℂ)) ht Cardinal.mk_le_aleph0 + (by simpa using Cardinal.aleph0_lt_continuum) + have : Infinite t := Cardinal.infinite_iff.mpr (by + rw [← htcard] + simpa using Cardinal.aleph0_lt_continuum.le) + let e : s ↪ t := (Classical.choice (nonempty_embedding_nat s)).trans + (Infinite.natEmbedding t) + let v : s → ℂ := fun x => (e x : ℂ) + have hv : AlgebraicIndependent ℚ v := ht.1.comp e e.injective + let A := Algebra.adjoin ℚ (Set.range (fun x : s => (x : K))) + let f : A →+* ℂ := (MvPolynomial.aeval v).toRingHom.comp hs.1.aevalEquiv.symm.toRingHom + have hf : Function.Injective f := + (algebraicIndependent_iff_injective_aeval.mp hv).comp hs.1.aevalEquiv.symm.injective + let : Algebra A ℂ := f.toAlgebra + have : Module.IsTorsionFree A ℂ := + (Module.isTorsionFree_iff_algebraMap_injective).mpr hf + have : Algebra.IsAlgebraic A K := hs.isAlgebraic + exact ⟨(IsAlgClosed.lift (R := A) (S := K) (M := ℂ)).toRingHom⟩ + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/CompositionAntidiag.lean b/lean/OAI/Algebra/DepthFive/CompositionAntidiag.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd48944f73ba3ea28cb301a2e19f7b04fcf34771 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/CompositionAntidiag.lean @@ -0,0 +1,110 @@ +import OAI.Algebra.DepthFive.BidegreeAverages +import OAI.Algebra.DepthFive.FirstOccupationMoment + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335.BidegreeAverages + +/-- The function representation of a weak composition and the finite +`finsuppAntidiag` representation used by occupation moments agree coordinatewise. -/ +def compositionAntidiagEquiv (σ : Type*) [Fintype σ] [DecidableEq σ] (a : ℕ) : + Composition σ a ≃ (Finset.finsuppAntidiag (Finset.univ : Finset σ) a) := by + refine Finsupp.equivFunOnFinite.symm.subtypeEquiv ?_ + intro d + simp only [Finset.mem_finsuppAntidiag, Finset.subset_univ, and_true] + rfl + +@[simp] theorem compositionAntidiagEquiv_apply (σ : Type*) + [Fintype σ] [DecidableEq σ] (a : ℕ) (d : Composition σ a) (i : σ) : + (compositionAntidiagEquiv σ a d).val i = d.val i := rfl + +/-- Convert a sum over function compositions to the canonical occupation finset. -/ +theorem sum_compositions_eq_antidiag {σ : Type*} [Fintype σ] [DecidableEq σ] + (a : ℕ) (f : (σ → ℕ) → ℝ) : + (∑' d : Composition σ a, f d.val) = + ∑ M ∈ Finset.finsuppAntidiag (Finset.univ : Finset σ) a, f M := by + calc + _ = ∑' M : (Finset.finsuppAntidiag (Finset.univ : Finset σ) a), f M.val := + (compositionAntidiagEquiv σ a).tsum_eq (fun M => f M.val) + _ = _ := by + rw [tsum_fintype] + exact Finset.sum_coe_sort _ (fun M : σ →₀ ℕ => f M) + +/-- Denominator conversion for the same index equivalence. -/ +theorem card_compositions_eq_antidiag {σ : Type*} [Fintype σ] [DecidableEq σ] + (a : ℕ) : + Nat.card (Composition σ a) = + (Finset.finsuppAntidiag (Finset.univ : Finset σ) a).card := by + rw [Nat.card_congr (compositionAntidiagEquiv σ a), Nat.card_eq_fintype_card, + Fintype.card_coe] + +/-- The function-composition average is exactly the canonical occupation average. -/ +theorem composition_average_eq_occupationAverage {σ : Type*} + [Fintype σ] [DecidableEq σ] (a : ℕ) (f : (σ → ℕ) → ℝ) : + (∑' d : Composition σ a, f d.val) / (Nat.card (Composition σ a) : ℝ) = + occupationAverage a (fun M : σ →₀ ℕ => f M) := by + rw [sum_compositions_eq_antidiag, card_compositions_eq_antidiag] + rfl + +/-- The actual bidegree-domain average, expressed directly using the canonical +occupation-average API. This bridges the Fock/matrix source indices and both +first- and second-moment inequalities. -/ +theorem bidegree_average_eq_occupationAverage {σ : Type*} [Fintype σ] [DecidableEq σ] + (isV : σ → Bool) (a b : ℕ) + (f : ({x // isV x = true} → ℕ) → ℝ) + (g : ({x // ¬ isV x = true} → ℕ) → ℝ) : + (∑' d : Index isV a b, + f (fun x => d.val x) * g (fun x => d.val x)) / + (Nat.card (Index isV a b) : ℝ) = + occupationAverage a (fun M : {x // isV x = true} →₀ ℕ => f M) * + occupationAverage b (fun M : {x // ¬ isV x = true} →₀ ℕ => g M) := by + classical + rw [average_split, composition_average_eq_occupationAverage, + composition_average_eq_occupationAverage] + +/-- Matrix-indexed finite-sum version of the bridge. -/ +theorem bidegree_average_eq_occupationAverage_fintype {σ : Type*} + [Fintype σ] [DecidableEq σ] (isV : σ → Bool) (a b : ℕ) + [Fintype (Index isV a b)] + (f : ({x // isV x = true} → ℕ) → ℝ) + (g : ({x // ¬ isV x = true} → ℕ) → ℝ) : + (∑ d : Index isV a b, + f (fun x => d.val x) * g (fun x => d.val x)) / + (Fintype.card (Index isV a b) : ℝ) = + occupationAverage a (fun M : {x // isV x = true} →₀ ℕ => f M) * + occupationAverage b (fun M : {x // ¬ isV x = true} →₀ ℕ => g M) := by + simpa only [tsum_fintype, Nat.card_eq_fintype_card] using + bidegree_average_eq_occupationAverage isV a b f g + +/-- The first occupation-moment lower estimate on the ACTUAL bidegree exponent +source, rather than on an auxiliary Cartesian product of composition finsets. -/ +theorem bidegree_first_moment_lower {σ : Type*} [Fintype σ] [DecidableEq σ] + (isV : σ → Bool) (a b : ℕ) + [Fintype (Index isV a b)] + [Nonempty {x // isV x = true}] [Nonempty {x // ¬ isV x = true}] + (s : Finset {x // isV x = true}) (z : Finset {x // ¬ isV x = true}) + (ha : 0 < a) (hb : 0 < b) (hs : 2 * s.card ≤ a) (hz : 2 * z.card ≤ b) : + Real.exp ((-(s.card : ℝ) ^ 2 / a - + (s.card : ℝ) ^ 2 / (2 * Fintype.card {x // isV x = true})) + + (-(z.card : ℝ) ^ 2 / b - + (z.card : ℝ) ^ 2 / (2 * Fintype.card {x // ¬ isV x = true}))) * + (((a : ℝ) / Fintype.card {x // isV x = true}) ^ s.card * + (1 + (b : ℝ) / Fintype.card {x // ¬ isV x = true}) ^ z.card) ≤ + (∑ d : Index isV a b, + (∏ i ∈ s, (d.val i : ℝ)) * (∏ i ∈ z, ((d.val i : ℝ) + 1))) / + (Fintype.card (Index isV a b) : ℝ) := by + rw [bidegree_average_eq_occupationAverage_fintype isV a b + (fun M => ∏ i ∈ s, (M i : ℝ)) + (fun M => ∏ i ∈ z, ((M i : ℝ) + 1))] + have h := occupation_first_moment_lower a b s z ha hb hs hz + rw [occupationAverage_tensor] at h + exact h + +end Problem335.BidegreeAverages + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ConfiguredImmSecondMoment.lean b/lean/OAI/Algebra/DepthFive/ConfiguredImmSecondMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..db7d5758f424d1e3821931ab9611c58c430cf0df --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ConfiguredImmSecondMoment.lean @@ -0,0 +1,78 @@ +import OAI.Algebra.DepthFive.ImmSecondMomentParameters +import OAI.Algebra.DepthFive.ActualRelaxedWeightBound +import OAI.Algebra.DepthFive.ActualImmRank +import OAI.Algebra.DepthFive.ActualSecondMomentParameters + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Problem335.LowerParameters +open MomentPairing + +private theorem configured_layerMeanV {L : ℕ} (hn : 4 ≤ L + 1) : + layerMeanV (Fin (L + 1)) (balancedLayer hn) (a (L + 1)) = + (a (L + 1) : ℝ) / v (L + 1) := by + unfold layerMeanV + rw [balancedVariable_card_true hn] + +private theorem configured_layerMeanU {L : ℕ} (hn : 4 ≤ L + 1) : + layerMeanU (Fin (L + 1)) (balancedLayer hn) (b (L + 1)) = + (b (L + 1) : ℝ) / u (L + 1) := by + unfold layerMeanU + simp only [Bool.not_eq_true] + rw [balancedVariable_card_false hn] + +private theorem v_fraction {n : ℕ} (hn : 4 ≤ n) : + ((a n : ℝ) / v n) / ((a n : ℝ) / v n + 1) = alpha n := by + have hv : (v n : ℝ) ≠ 0 := by exact_mod_cast (v_pos hn).ne' + rw [alpha, div_add_one hv, div_div_div_cancel_right₀ hv] + +private theorem u_fraction {n : ℕ} (hn : 4 ≤ n) : + ((b n : ℝ) / u n) / ((b n : ℝ) / u n + 1) = beta n := by + have hu : (u n : ℝ) ≠ 0 := by exact_mod_cast (u_pos hn).ne' + rw [beta, div_add_one hu, div_div_div_cancel_right₀ hu] + +/-- The complete actual second-trace estimate for the canonical parameters. -/ +theorem configured_imm_second_moment_upper {n : ℕ} (hn : 16 ≤ n) + (hbeta : beta n ≤ 2 / Real.sqrt (n : ℝ)) : + let A := immNormalizedMatrix n (balancedLayer (show 4 ≤ n by omega)) (a n) (b n) + ((A.conjTranspose * A) ^ 2).trace.re ≤ + rankDimension n * rankMomentScale n ^ 2 * Real.exp (10 * Real.sqrt (n : ℝ)) := by + obtain ⟨L, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (show n ≠ 0 by omega) + have hn4 : 4 ≤ L + 1 := by omega + let : Nonempty {x : Fin (L + 1) × (Fin (L + 1) × Fin (L + 1)) // + balancedLayer hn4 x.1 = true} := + Fintype.card_pos_iff.mp (by rw [balancedVariable_card_true hn4]; exact v_pos hn4) + let : Nonempty {x : Fin (L + 1) × (Fin (L + 1) × Fin (L + 1)) // + ¬ balancedLayer hn4 x.1 = true} := + Fintype.card_pos_iff.mp (by + simp only [Bool.not_eq_true] + rw [balancedVariable_card_false hn4] + exact u_pos hn4) + have hraw := immNormalizedMatrix_second_moment_le_relaxed L + (balancedLayer hn4) (a (L + 1)) (b (L + 1)) (a_pos hn4) + dsimp only at hraw ⊢ + rw [configured_layerMeanV hn4, configured_layerMeanU hn4, + v_fraction hn4, u_fraction hn4, card_immSourceIndex_eq_rankDimension hn4] at hraw + apply configured_second_bound_of_path_bound hn hbeta _ + exact hraw.trans (mul_le_mul_of_nonneg_left + (sum_relaxed_pathWeight_balanced_le_exp hn (0 : Fin (L + 1))) + (mul_nonneg (rankDimension_nonneg _) (sq_nonneg _))) + +/-- A single eventual statement supplies the actual matrix premise required +by the final rank and circuit-size comparison. -/ +theorem eventually_configured_imm_second_moment_upper : + ∀ᶠ n : ℕ in Filter.atTop, ∀ hn : 16 ≤ n, + let A := immNormalizedMatrix n (balancedLayer (show 4 ≤ n by omega)) (a n) (b n) + ((A.conjTranspose * A) ^ 2).trace.re ≤ + rankDimension n * rankMomentScale n ^ 2 * Real.exp (10 * Real.sqrt (n : ℝ)) := by + obtain ⟨N, hN⟩ := exists_second_moment_parameter_cutoff + filter_upwards [Filter.eventually_ge_atTop N] with n hn hn16 + exact configured_imm_second_moment_upper hn16 (hN n hn).2.1 + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ConfiguredRankData.lean b/lean/OAI/Algebra/DepthFive/ConfiguredRankData.lean new file mode 100644 index 0000000000000000000000000000000000000000..2a9e74a99595f707cf5d726b3e426ec0c5625c9d --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ConfiguredRankData.lean @@ -0,0 +1,67 @@ +import OAI.Algebra.DepthFive.FiniteOperator +import OAI.Algebra.DepthFive.LowerSchedule +import OAI.Algebra.DepthFive.AnalyticParameters +import OAI.Algebra.DepthFive.BinomialRatios + +namespace OAI + +/-! Common, concrete data for the two sides of the IMM rank comparison. -/ + +noncomputable section + +namespace Problem335.LowerParameters + +/-- The source dimension for the configured bidegree rank measure. -/ +def rankDimension (n : ℕ) : ℝ := + (homogeneousDim (v n) (a n) : ℝ) * (homogeneousDim (u n) (b n) : ℝ) + +/-- The common path-count and occupation-mean factor in the two trace moments. -/ +def rankMomentScale (n : ℕ) : ℝ := + (n : ℝ) ^ (n - 1) * ((a n : ℝ) / (v n : ℝ)) ^ k n * + (1 + (b n : ℝ) / (u n : ℝ)) ^ m n + +/-- The actual rank measure, extended by zero outside the range where the +balanced schedule is used. The small values do not enter the eventual bounds. -/ +def rankData (n : ℕ) (p : MvPolynomial (Fin n × Fin n × Fin n) ℂ) : ℝ := + if hn : 4 ≤ n then + (bidegreeRank (fun x : Fin n × Fin n × Fin n => balancedLayer hn x.1) + (a n) (b n) (k n) (m n) p : ℝ) + else 0 + +theorem rankData_eq {n : ℕ} (hn : 4 ≤ n) + (p : MvPolynomial (Fin n × Fin n × Fin n) ℂ) : + rankData n p = + (bidegreeRank (fun x : Fin n × Fin n × Fin n => balancedLayer hn x.1) + (a n) (b n) (k n) (m n) p : ℝ) := by + simp [rankData, hn] + +theorem rankData_nonneg (n : ℕ) + (p : MvPolynomial (Fin n × Fin n × Fin n) ℂ) : 0 ≤ rankData n p := by + unfold rankData + split_ifs <;> positivity + +theorem rankDimension_nonneg (n : ℕ) : 0 ≤ rankDimension n := by + unfold rankDimension + positivity + +theorem rankDimension_pos {n : ℕ} (hn : 4 ≤ n) : 0 < rankDimension n := by + have hv : 0 < homogeneousDim (v n) (a n) := + homogeneousDim_pos (v_pos hn) (a n) + have hu : 0 < homogeneousDim (u n) (b n) := + homogeneousDim_pos (u_pos hn) (b n) + unfold rankDimension + positivity + +theorem rankMomentScale_pos {n : ℕ} (hn : 4 ≤ n) : 0 < rankMomentScale n := by + have hn' : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) + have ha : (0 : ℝ) < a n := by exact_mod_cast a_pos hn + have hv : (0 : ℝ) < v n := by exact_mod_cast v_pos hn + have hu : (0 : ℝ) < u n := by exact_mod_cast u_pos hn + unfold rankMomentScale + positivity + +end Problem335.LowerParameters + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/DegreeDiscrepancy.lean b/lean/OAI/Algebra/DepthFive/DegreeDiscrepancy.lean new file mode 100644 index 0000000000000000000000000000000000000000..fccdf48b1691e5af096d6d137bbdc27f87057665 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/DegreeDiscrepancy.lean @@ -0,0 +1,111 @@ +import Mathlib + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335 + +/-- For a zero-sum finite family, its total positive discrepancy is half of +its total absolute discrepancy. This is the algebraic identity used when +ordering the factors in the product-rank argument. -/ +theorem sum_positive_eq_half_sum_abs {ι : Type*} (s : Finset ι) (δ : ι → ℝ) + (hδ : ∑ j ∈ s, δ j = 0) : + ∑ j ∈ s.filter (fun j => 0 < δ j), δ j = + (∑ j ∈ s, |δ j|) / 2 := by + classical + have habs : ∀ j, |δ j| = 2 * (if 0 < δ j then δ j else 0) - δ j := by + intro j + by_cases h : 0 < δ j + · rw [ite_eq_left h, abs_of_pos h] + ring + · rw [ite_eq_right h, abs_of_nonpos (le_of_not_gt h)] + ring + have hs : (∑ j ∈ s, |δ j|) = + 2 * (∑ j ∈ s.filter (fun j => 0 < δ j), δ j) := by + simp_rw [habs] + rw [Finset.sum_sub_distrib, ← Finset.mul_sum, hδ, sub_zero, + Finset.sum_filter] + linarith + +/-- The proportional bidegree discrepancies sum to zero. -/ +theorem sum_degree_discrepancy_eq_zero {ι : Type*} (s : Finset ι) + (e i : ι → ℝ) (lam n k : ℝ) + (he : ∑ j ∈ s, e j = n) (hi : ∑ j ∈ s, i j = k) + (hlam : lam * n = k) : + ∑ j ∈ s, (i j - lam * e j) = 0 := by + rw [Finset.sum_sub_distrib, ← Finset.mul_sum, he, hi, hlam, sub_self] + +/-- Collecting factors with positive proportional discrepancy expresses +precisely the dimension-saving exponent in terms of absolute discrepancies. -/ +theorem positive_bidegree_identity {ι : Type*} (s : Finset ι) + (e i : ι → ℝ) (ρ lam : ℝ) + (hlam : (1 + ρ) * lam = ρ) + (hδ : ∑ j ∈ s, (i j - lam * e j) = 0) : + (∑ j ∈ s.filter (fun j => 0 < i j - lam * e j), i j) - + ρ * (∑ j ∈ s.filter (fun j => 0 < i j - lam * e j), (e j - i j)) = + (1 + ρ) / 2 * (∑ j ∈ s, |i j - lam * e j|) := by + classical + have hpoint : ∀ j, i j - ρ * (e j - i j) = + (1 + ρ) * (i j - lam * e j) := by + intro j + nlinarith [congrArg (fun x : ℝ => x * e j) hlam] + rw [Finset.mul_sum, ← Finset.sum_sub_distrib] + simp_rw [hpoint] + rw [← Finset.mul_sum, sum_positive_eq_half_sum_abs s (fun j => i j - lam * e j) hδ] + ring + +/-- Conversion of the intermediate-dimension exponent to a product of +individual discrepancy weights. -/ +theorem positive_bidegree_rpow {ι : Type*} (s : Finset ι) + (e i : ι → ℝ) (ρ lam α : ℝ) (hα : 0 < α) + (hlam : (1 + ρ) * lam = ρ) + (hδ : ∑ j ∈ s, (i j - lam * e j) = 0) : + α ^ ((∑ j ∈ s.filter (fun j => 0 < i j - lam * e j), i j) - + ρ * (∑ j ∈ s.filter (fun j => 0 < i j - lam * e j), (e j - i j))) = + ∏ j ∈ s, (α ^ ((1 + ρ) / 2)) ^ |i j - lam * e j| := by + rw [positive_bidegree_identity s e i ρ lam hlam hδ, + Real.rpow_mul hα.le, + Real.rpow_sum_of_pos (Real.rpow_pos_of_pos hα _) _ s] + +/-- Dropping a constraint on independent choices and then distributing the +finite sums is valid for nonnegative weights. -/ +theorem constrained_sum_prod_le_prod_sum {ι : Type*} [Fintype ι] [DecidableEq ι] + {κ : ι → Type*} (t : (j : ι) → Finset (κ j)) + (w : (j : ι) → κ j → ℝ) + (hw : ∀ j x, x ∈ t j → 0 ≤ w j x) + (P : ((j : ι) → κ j) → Prop) [DecidablePred P] : + (∑ x ∈ (Fintype.piFinset t).filter P, ∏ j, w j (x j)) ≤ + ∏ j, ∑ x ∈ t j, w j x := by + classical + rw [Finset.prod_univ_sum] + apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) + intro x hx _ + apply Finset.prod_nonneg + intro j _ + exact hw j (x j) ((Fintype.mem_piFinset.mp hx) j) + +/-- The one-factor bidegree weight used in the manuscript. -/ +def degreeWeight (q lam : ℝ) (e : ℕ) : ℝ := + ∑ i ∈ Finset.range (e + 1), q ^ |(i : ℝ) - lam * e| + +/-- The bidegree-constrained sum in the product-rank bound is at most the +product of the individual degree weights. -/ +theorem bidegree_weight_sum_le {ι : Type*} [Fintype ι] [DecidableEq ι] + (e : ι → ℕ) (k : ℕ) (q lam : ℝ) (hq : 0 ≤ q) : + (∑ i ∈ (Fintype.piFinset (fun j => Finset.range (e j + 1))).filter + (fun i => ∑ j, i j = k), + ∏ j, q ^ |(i j : ℝ) - lam * e j|) ≤ + ∏ j, degreeWeight q lam (e j) := by + classical + exact constrained_sum_prod_le_prod_sum + (fun j => Finset.range (e j + 1)) + (fun j i => q ^ |(i : ℝ) - lam * e j|) + (fun _ _ _ => Real.rpow_nonneg hq _) _ + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/DegreeDistances.lean b/lean/OAI/Algebra/DepthFive/DegreeDistances.lean new file mode 100644 index 0000000000000000000000000000000000000000..22e7e9f56f58185024e4f0db72296ae316fa5eb9 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/DegreeDistances.lean @@ -0,0 +1,140 @@ +import Mathlib + +namespace OAI + +noncomputable section + +namespace Problem335 + +/-- Distance to the nearest integer, with rounding used only to select a minimizer. -/ +def nearestIntegerDistance (x : ℝ) : ℝ := |x - (round x : ℝ)| + +lemma nearestIntegerDistance_nonneg (x : ℝ) : 0 ≤ nearestIntegerDistance x := + abs_nonneg _ + +lemma nearestIntegerDistance_le_half (x : ℝ) : nearestIntegerDistance x ≤ 1 / 2 := + abs_sub_round x + +lemma nearestIntegerDistance_le (x : ℝ) (z : ℤ) : + nearestIntegerDistance x ≤ |x - (z : ℝ)| := + round_le x z + +lemma nearestIntegerDistance_even {e : ℕ} (he : Even e) {δ : ℝ} + (hδ : 0 ≤ δ) (hδ' : δ < 1 / 2) : + nearestIntegerDistance ((e : ℝ) / 2 - δ) = δ := by + rcases he with ⟨k, rfl⟩ + have hr : round (((k + k : ℕ) : ℝ) / 2 - δ) = (k : ℤ) := by + apply round_eq_iff.mpr + constructor <;> push_cast <;> linarith + rw [nearestIntegerDistance, hr] + push_cast + rw [show ((k : ℝ) + k) / 2 - δ - k = -δ by ring] + simpa using abs_of_nonpos (neg_nonpos.mpr hδ) + +lemma nearestIntegerDistance_odd {e : ℕ} (he : Odd e) {δ : ℝ} + (hδ : 0 < δ) (hδ' : δ ≤ 1 / 2) : + nearestIntegerDistance ((e : ℝ) / 2 - δ) = 1 / 2 - δ := by + rcases he with ⟨k, rfl⟩ + have hr : round (((2 * k + 1 : ℕ) : ℝ) / 2 - δ) = (k : ℤ) := by + apply round_eq_iff.mpr + constructor <;> push_cast <;> linarith + rw [nearestIntegerDistance, hr] + push_cast + rw [show ((2 * (k : ℝ) + 1) / 2 - δ - k) = 1 / 2 - δ by ring] + exact abs_of_nonneg (sub_nonneg.mpr hδ') + +lemma nearestIntegerDistance_half_sub_ge {e : ℕ} {δ : ℝ} + (hδ : 0 < δ) (hδ' : δ ≤ 1 / 4) : + δ ≤ nearestIntegerDistance ((e : ℝ) / 2 - δ) := by + rcases Nat.even_or_odd e with he | he + · rw [nearestIntegerDistance_even he hδ.le (by linarith)] + · rw [nearestIntegerDistance_odd he hδ (by linarith)] + linarith + +/-- The degree-saving distance at slope `(n-s)/(2*n)`. -/ +def degreeDistance (n s : ℝ) (e : ℕ) : ℝ := + nearestIntegerDistance ((1 / 2 - s / (2 * n)) * e) + +lemma degreeDistance_eq_half_sub (n s : ℝ) (e : ℕ) : + degreeDistance n s e = nearestIntegerDistance ((e : ℝ) / 2 - s * e / (2 * n)) := by + unfold degreeDistance + congr 1 + ring + +lemma low_degree_offset {n s : ℝ} (hn : 0 < n) (hs : 0 < s) + {e : ℕ} (he : 0 < e) (he' : (e : ℝ) < n / (4 * s)) : + 0 < s * e / (2 * n) ∧ s * e / (2 * n) < 1 / 8 := by + constructor + · positivity + · have hmul : (e : ℝ) * (4 * s) < n := + (lt_div_iff₀ (by positivity : 0 < 4 * s)).mp he' + apply (div_lt_iff₀ (by positivity : 0 < 2 * n)).mpr + nlinarith + +lemma degreeDistance_even {n s : ℝ} (hn : 0 < n) (hs : 0 < s) + {e : ℕ} (he : 0 < e) (he' : (e : ℝ) < n / (4 * s)) (heven : Even e) : + degreeDistance n s e = s * e / (2 * n) := by + rw [degreeDistance_eq_half_sub] + obtain ⟨hδ, hδ'⟩ := low_degree_offset hn hs he he' + exact nearestIntegerDistance_even heven hδ.le (by linarith) + +lemma degreeDistance_odd {n s : ℝ} (hn : 0 < n) (hs : 0 < s) + {e : ℕ} (he : 0 < e) (he' : (e : ℝ) < n / (4 * s)) (hodd : Odd e) : + degreeDistance n s e = 1 / 2 - s * e / (2 * n) := by + rw [degreeDistance_eq_half_sub] + obtain ⟨hδ, hδ'⟩ := low_degree_offset hn hs he he' + exact nearestIntegerDistance_odd hodd hδ (by linarith) + +lemma degreeDistance_ge {n s : ℝ} (hn : 0 < n) (hs : 0 < s) + {e : ℕ} (he : 0 < e) (he' : (e : ℝ) < n / (4 * s)) : + s * e / (2 * n) ≤ degreeDistance n s e := by + rw [degreeDistance_eq_half_sub] + obtain ⟨hδ, hδ'⟩ := low_degree_offset hn hs he he' + exact nearestIntegerDistance_half_sub_ge hδ (by linarith) + +lemma degreeDistance_odd_ge {n s : ℝ} (hn : 0 < n) (hs : 0 < s) + {e : ℕ} (he : 0 < e) (he' : (e : ℝ) < n / (4 * s)) (hodd : Odd e) : + 3 / 8 ≤ degreeDistance n s e := by + rw [degreeDistance_odd hn hs he he' hodd] + obtain ⟨_, hδ'⟩ := low_degree_offset hn hs he he' + linarith + +open scoped BigOperators + +lemma sum_degreeDistance_ge {ι : Type*} (I : Finset ι) (e : ι → ℕ) + {n s : ℝ} (hn : 0 < n) (hs : 0 < s) + (he : ∀ i ∈ I, 0 < e i) (he' : ∀ i ∈ I, (e i : ℝ) < n / (4 * s)) : + s / (2 * n) * (∑ i ∈ I, (e i : ℝ)) ≤ ∑ i ∈ I, degreeDistance n s (e i) := by + rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro i hi + calc + s / (2 * n) * (e i : ℝ) = s * e i / (2 * n) := by ring + _ ≤ degreeDistance n s (e i) := degreeDistance_ge hn hs (he i hi) (he' i hi) + +lemma sum_degreeDistance_ge_half {ι : Type*} (I : Finset ι) (e : ι → ℕ) + {n s : ℝ} (hn : 0 < n) (hs : 0 < s) + (he : ∀ i ∈ I, 0 < e i) (he' : ∀ i ∈ I, (e i : ℝ) < n / (4 * s)) + (hsum : ∑ i ∈ I, (e i : ℝ) = n) : + s / 2 ≤ ∑ i ∈ I, degreeDistance n s (e i) := by + have h := sum_degreeDistance_ge I e hn hs he he' + rw [hsum] at h + convert h using 1 + field_simp + +lemma prod_degreeDistance_rpow_le {ι : Type*} (I : Finset ι) (e : ι → ℕ) + {n s q : ℝ} (hn : 0 < n) (hs : 0 < s) (hq : 0 < q) (hq' : q ≤ 1) + (he : ∀ i ∈ I, 0 < e i) (he' : ∀ i ∈ I, (e i : ℝ) < n / (4 * s)) + (hsum : ∑ i ∈ I, (e i : ℝ) = n) : + (∏ i ∈ I, q ^ (degreeDistance n s (e i) / 2)) ≤ q ^ (s / 4) := by + rw [← Real.rpow_sum_of_pos hq] + apply Real.rpow_le_rpow_of_exponent_ge hq hq' + rw [← Finset.sum_div] + have h := sum_degreeDistance_ge_half I e hn hs he he' hsum + linarith + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/DegreeProductBounds.lean b/lean/OAI/Algebra/DepthFive/DegreeProductBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f01d73ec6d43377bd5eac4189015a132104270c --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/DegreeProductBounds.lean @@ -0,0 +1,78 @@ +import OAI.Algebra.DepthFive.DegreeDistances + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Problem335 + +lemma low_degree_power_saving {n s q : ℝ} (hn : 1 ≤ n) (hq : 0 ≤ q) + (hq' : q ≤ n ^ (-(2 / 5 : ℝ))) (hs : Real.sqrt n / 2 ≤ s) : + q ^ (s / 4) ≤ n ^ (-Real.sqrt n / 20) := by + have hn0 : 0 ≤ n := by linarith + have hs0 : 0 ≤ s := le_trans (by positivity) hs + calc + q ^ (s / 4) ≤ (n ^ (-(2 / 5 : ℝ))) ^ (s / 4) := + Real.rpow_le_rpow hq hq' (by positivity) + _ = n ^ (-(s / 10)) := by rw [← Real.rpow_mul hn0]; congr 1; ring + _ ≤ n ^ (-Real.sqrt n / 20) := by + apply Real.rpow_le_rpow_of_exponent_le hn + linarith + +lemma high_degree_power_saving {n q lam t : ℝ} (hn : 1 ≤ n) (hq : 0 ≤ q) + (hq' : q ≤ n ^ (-(2 / 5 : ℝ))) (hlam : 3 / 8 ≤ lam) + (ht : Real.sqrt n / 4 ≤ t) : + q ^ (lam * t / 2) ≤ n ^ (-(3 * Real.sqrt n / 160)) := by + have hn0 : 0 ≤ n := by linarith + have ht0 : 0 ≤ t := le_trans (by positivity) ht + have hlam0 : 0 ≤ lam := by linarith + have hprod : 3 / 8 * (Real.sqrt n / 4) ≤ lam * t := + mul_le_mul hlam ht (by positivity) hlam0 + calc + q ^ (lam * t / 2) ≤ (n ^ (-(2 / 5 : ℝ))) ^ (lam * t / 2) := + Real.rpow_le_rpow hq hq' (by positivity) + _ = n ^ (-(lam * t / 5)) := by rw [← Real.rpow_mul hn0]; congr 1; ring + _ ≤ n ^ (-(3 * Real.sqrt n / 160)) := by + apply Real.rpow_le_rpow_of_exponent_le hn + nlinarith + +lemma prod_exp_corrections {ι : Type*} (I : Finset ι) (H d E : ι → ℝ) + {q B : ℝ} (hq : 0 ≤ q) (hH : ∀ i ∈ I, 0 ≤ H i) + (hbound : ∀ i ∈ I, H i ≤ q ^ d i * Real.exp (E i)) + (hE : ∑ i ∈ I, E i ≤ B) : + (∏ i ∈ I, H i) ≤ (∏ i ∈ I, q ^ d i) * Real.exp B := by + calc + (∏ i ∈ I, H i) ≤ ∏ i ∈ I, q ^ d i * Real.exp (E i) := + Finset.prod_le_prod₀ hH hbound + _ = (∏ i ∈ I, q ^ d i) * Real.exp (∑ i ∈ I, E i) := by + rw [Finset.prod_mul_distrib, Real.exp_sum] + _ ≤ (∏ i ∈ I, q ^ d i) * Real.exp B := by + apply mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr hE) + exact Finset.prod_nonneg (fun i _ => Real.rpow_nonneg hq (d i)) + +lemma all_low_degree_product_bound {ι : Type*} (I : Finset ι) (e : ι → ℕ) + (H E : ι → ℝ) {n s q C : ℝ} (hn : 1 ≤ n) (hs : 0 < s) + (hs' : Real.sqrt n / 2 ≤ s) (hq : 0 < q) (hq1 : q ≤ 1) + (hq' : q ≤ n ^ (-(2 / 5 : ℝ))) + (he : ∀ i ∈ I, 0 < e i) (he' : ∀ i ∈ I, (e i : ℝ) < n / (4 * s)) + (hsum : ∑ i ∈ I, (e i : ℝ) = n) (hH : ∀ i ∈ I, 0 ≤ H i) + (hbound : ∀ i ∈ I, H i ≤ q ^ (degreeDistance n s (e i) / 2) * Real.exp (E i)) + (hE : ∑ i ∈ I, E i ≤ C * Real.sqrt n) : + (∏ i ∈ I, H i) ≤ Real.exp (C * Real.sqrt n) * n ^ (-Real.sqrt n / 20) := by + have hn0 : 0 < n := by linarith + calc + (∏ i ∈ I, H i) ≤ (∏ i ∈ I, q ^ (degreeDistance n s (e i) / 2)) * + Real.exp (C * Real.sqrt n) := + prod_exp_corrections I H _ E hq.le hH hbound hE + _ ≤ q ^ (s / 4) * Real.exp (C * Real.sqrt n) := + mul_le_mul_of_nonneg_right + (prod_degreeDistance_rpow_le I e hn0 hs hq hq1 he he' hsum) (Real.exp_pos _).le + _ ≤ n ^ (-Real.sqrt n / 20) * Real.exp (C * Real.sqrt n) := + mul_le_mul_of_nonneg_right (low_degree_power_saving hn hq.le hq' hs') (Real.exp_pos _).le + _ = _ := mul_comm _ _ + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/DegreeWeight.lean b/lean/OAI/Algebra/DepthFive/DegreeWeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9e06be17a7583bfffd495b1c120d324f7f495bb --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/DegreeWeight.lean @@ -0,0 +1,172 @@ +import OAI.Algebra.DepthFive.DegreeDiscrepancy +import OAI.Algebra.DepthFive.DegreeDistances + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335 + +/-- The geometric majorant for weights at the integers around a chosen center. -/ +def latticeMajorant (q d : ℝ) (z : ℤ) : ℝ := + if z = 0 then q ^ d else q ^ (1 - d) * q ^ (z.natAbs - 1) + +lemma latticeMajorant_nonneg {q : ℝ} (hq : 0 ≤ q) (d : ℝ) (z : ℤ) : + 0 ≤ latticeMajorant q d z := by + unfold latticeMajorant + split_ifs + · exact Real.rpow_nonneg hq _ + · exact mul_nonneg (Real.rpow_nonneg hq _) (pow_nonneg hq _) + +lemma hasSum_latticeMajorant {q : ℝ} (hq : 0 ≤ q) (hq1 : q < 1) (d : ℝ) : + HasSum (latticeMajorant q d) + (q ^ d + 2 * (q ^ (1 - d) / (1 - q))) := by + have hgeom : HasSum (fun n : ℕ => q ^ (1 - d) * q ^ n) + (q ^ (1 - d) / (1 - q)) := by + simpa only [div_eq_mul_inv] using + (hasSum_geometric_of_lt_one hq hq1).mul_left (q ^ (1 - d)) + have hpval (n : ℕ) : latticeMajorant q d ((n : ℤ) + 1) = + q ^ (1 - d) * q ^ n := by + have hne : (n : ℤ) + 1 ≠ 0 := by omega + have habs : ((n : ℤ) + 1).natAbs = n + 1 := by omega + simp only [latticeMajorant, ite_eq_right hne, habs, Nat.add_sub_cancel] + have hnval (n : ℕ) : latticeMajorant q d (-((n : ℤ) + 1)) = + q ^ (1 - d) * q ^ n := by + have hne : -((n : ℤ) + 1) ≠ 0 := by omega + have habs : ((n : ℤ) + 1).natAbs = n + 1 := by omega + simp only [latticeMajorant, ite_eq_right hne, Int.natAbs_neg, habs, Nat.add_sub_cancel] + have hp : HasSum (fun n : ℕ => latticeMajorant q d ((n : ℤ) + 1)) + (q ^ (1 - d) / (1 - q)) := by + simpa only [hpval] using hgeom + have hn : HasSum (fun n : ℕ => latticeMajorant q d (-((n : ℤ) + 1))) + (q ^ (1 - d) / (1 - q)) := by + simpa only [hnval] using hgeom + have h := hp.of_add_one_of_neg_add_one hn + have hzero : latticeMajorant q d 0 = q ^ d := by simp [latticeMajorant] + rw [hzero] at h + convert h using 1 + ring + +lemma rpow_abs_sub_le_latticeMajorant {q : ℝ} (hq : 0 < q) (hq1 : q ≤ 1) + (y : ℝ) (z : ℤ) : + q ^ |(z : ℝ) - y| ≤ latticeMajorant q |y| z := by + by_cases hz : z = 0 + · subst z + simp [latticeMajorant] + have hzpos : 1 ≤ z.natAbs := by + have := Int.natAbs_pos.mpr hz + omega + have htriangle : (z.natAbs : ℝ) - |y| ≤ |(z : ℝ) - y| := by + have h := abs_sub_abs_le_abs_sub (z : ℝ) y + have heq : |(z : ℝ)| = (z.natAbs : ℝ) := by + rw [← Int.cast_abs, ← Int.natCast_natAbs] + simp + rw [heq] at h + exact h + calc + q ^ |(z : ℝ) - y| ≤ q ^ ((z.natAbs : ℝ) - |y|) := + Real.rpow_le_rpow_of_exponent_ge hq hq1 htriangle + _ = latticeMajorant q |y| z := by + rw [latticeMajorant, ite_eq_right hz] + have he : (z.natAbs : ℝ) - |y| = (1 - |y|) + ((z.natAbs - 1 : ℕ) : ℝ) := by + rw [Nat.cast_sub hzpos] + norm_num + rw [he, Real.rpow_add hq, Real.rpow_natCast] + +lemma sum_lattice_rpow_le {q : ℝ} (hq : 0 < q) (hq1 : q < 1) + (y : ℝ) (s : Finset ℤ) : + ∑ z ∈ s, q ^ |(z : ℝ) - y| ≤ + q ^ |y| + 2 * (q ^ (1 - |y|) / (1 - q)) := by + have hs := hasSum_latticeMajorant hq.le hq1 |y| + calc + ∑ z ∈ s, q ^ |(z : ℝ) - y| ≤ ∑ z ∈ s, latticeMajorant q |y| z := + Finset.sum_le_sum (fun z _ => rpow_abs_sub_le_latticeMajorant hq hq1.le y z) + _ ≤ ∑' z : ℤ, latticeMajorant q |y| z := + hs.summable.sum_le_tsum s (fun z _ => latticeMajorant_nonneg hq.le |y| z) + _ = _ := hs.tsum_eq + +lemma sum_nat_rpow_le {q : ℝ} (hq : 0 < q) (hq1 : q < 1) + (x : ℝ) (s : Finset ℕ) : + ∑ i ∈ s, q ^ |(i : ℝ) - x| ≤ + q ^ nearestIntegerDistance x + + 2 * (q ^ (1 - nearestIntegerDistance x) / (1 - q)) := by + unfold nearestIntegerDistance + have h := sum_lattice_rpow_le hq hq1 (x - (round x : ℝ)) + (s.image (fun i : ℕ => (i : ℤ) - round x)) + rw [Finset.sum_image] at h + · convert h using 1 + apply Finset.sum_congr rfl + intro i hi + simp only [Int.cast_sub, Int.cast_natCast] + congr 2 + ring + · intro a ha b hb hab + exact_mod_cast sub_left_injective hab + +lemma rpow_geometric_bound {q d : ℝ} (hq : 0 < q) (hqhalf : q ≤ 1 / 2) : + q ^ d + 2 * (q ^ (1 - d) / (1 - q)) ≤ + q ^ d * (1 + 4 * q ^ (1 - 2 * d)) := by + have hden : 0 < 1 - q := by linarith + have hnum : 0 ≤ q ^ (1 - d) := Real.rpow_nonneg hq.le _ + have hdiv : q ^ (1 - d) / (1 - q) ≤ 2 * q ^ (1 - d) := by + apply (div_le_iff₀ hden).2 + nlinarith + have hmul : q ^ d * q ^ (1 - 2 * d) = q ^ (1 - d) := by + rw [← Real.rpow_add hq] + congr 1 + ring + nlinarith + +lemma rpow_geometric_bound_le_five {q d : ℝ} (hq : 0 < q) + (hqhalf : q ≤ 1 / 2) (hd : 0 ≤ d) (hdhalf : d ≤ 1 / 2) : + q ^ d * (1 + 4 * q ^ (1 - 2 * d)) ≤ 5 := by + have hq1 : q ≤ 1 := by linarith + have ha := Real.rpow_le_one hq.le hq1 hd + have hb := Real.rpow_le_one hq.le hq1 (show 0 ≤ 1 - 2 * d by linarith) + have hapos := Real.rpow_nonneg hq.le d + have hbpos := Real.rpow_nonneg hq.le (1 - 2 * d) + nlinarith + +lemma sum_nat_rpow_le_nearest {q : ℝ} (hq : 0 < q) (hqhalf : q ≤ 1 / 2) + (x : ℝ) (s : Finset ℕ) : + ∑ i ∈ s, q ^ |(i : ℝ) - x| ≤ + q ^ nearestIntegerDistance x * (1 + 4 * q ^ (1 - 2 * nearestIntegerDistance x)) := + (sum_nat_rpow_le hq (by linarith) x s).trans (rpow_geometric_bound hq hqhalf) + +lemma sum_nat_rpow_le_five {q : ℝ} (hq : 0 < q) (hqhalf : q ≤ 1 / 2) + (x : ℝ) (s : Finset ℕ) : + ∑ i ∈ s, q ^ |(i : ℝ) - x| ≤ 5 := + (sum_nat_rpow_le_nearest hq hqhalf x s).trans + (rpow_geometric_bound_le_five hq hqhalf + (nearestIntegerDistance_nonneg x) (nearestIntegerDistance_le_half x)) + +/-- The nearest-integer geometric estimate for the manuscript's factor weight. -/ +theorem degreeWeight_le_nearest {q : ℝ} (hq : 0 < q) (hqhalf : q ≤ 1 / 2) + (lam : ℝ) (e : ℕ) : + degreeWeight q lam e ≤ + q ^ nearestIntegerDistance (lam * e) * + (1 + 4 * q ^ (1 - 2 * nearestIntegerDistance (lam * e))) := + sum_nat_rpow_le_nearest hq hqhalf (lam * e) (Finset.range (e + 1)) + +/-- The sharper uniform estimate retaining the nearest-integer saving. -/ +theorem degreeWeight_le_five_mul {q : ℝ} (hq : 0 < q) (hqhalf : q ≤ 1 / 2) + (lam : ℝ) (e : ℕ) : + degreeWeight q lam e ≤ 5 * q ^ nearestIntegerDistance (lam * e) := by + have h := degreeWeight_le_nearest hq hqhalf lam e + have hb := Real.rpow_le_one hq.le (show q ≤ 1 by linarith) + (show 0 ≤ 1 - 2 * nearestIntegerDistance (lam * e) by + linarith [nearestIntegerDistance_le_half (lam * e)]) + have ha := Real.rpow_nonneg hq.le (nearestIntegerDistance (lam * e)) + nlinarith + +/-- Uniform upper bound for each factor weight, including arbitrarily high degrees. -/ +theorem degreeWeight_le_five {q : ℝ} (hq : 0 < q) (hqhalf : q ≤ 1 / 2) + (lam : ℝ) (e : ℕ) : degreeWeight q lam e ≤ 5 := + sum_nat_rpow_le_five hq hqhalf (lam * e) (Finset.range (e + 1)) + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/DimensionCorrection.lean b/lean/OAI/Algebra/DepthFive/DimensionCorrection.lean new file mode 100644 index 0000000000000000000000000000000000000000..1168ab4acdf2fc80fd144652662c5049d887325f --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/DimensionCorrection.lean @@ -0,0 +1,106 @@ +import OAI.Algebra.DepthFive.BinomialRatios + +namespace OAI + +namespace Problem335 + +/-- A uniform Bernoulli bound for the rounding correction in the descending +homogeneous-space dimension ratio. -/ +theorem inverse_one_sub_pow_le_two (N : ℝ) (I : ℕ) + (hN : 1 ≤ N) (hI : 2 * (I : ℝ) ≤ N) : + ((1 - 1 / N) ^ I)⁻¹ ≤ 2 := by + have hNpos : 0 < N := by linarith + have hinv : 1 / N ≤ 1 := (div_le_one hNpos).2 hN + have hber := one_add_mul_le_pow (a := -(1 / N)) (by linarith : -2 ≤ -(1 / N)) I + have hfrac : (I : ℝ) / N ≤ 1 / 2 := (div_le_iff₀ hNpos).2 (by linarith) + have hhalf : (1 / 2 : ℝ) ≤ (1 - 1 / N) ^ I := by + simp only [mul_neg, mul_one_div, ← sub_eq_add_neg] at hber + nlinarith + have hpow : 0 < (1 - 1 / N) ^ I := lt_of_lt_of_le (by norm_num) hhalf + rw [inv_eq_one_div] + apply (div_le_iff₀ hpow).2 + linarith + +/-- Real-exponent version of the preceding natural-power estimate. -/ +theorem one_sub_rpow_neg_nat_le_two (N : ℝ) (I : ℕ) + (hN : 1 ≤ N) (hI : 2 * (I : ℝ) ≤ N) : + (1 - 1 / N) ^ (-(I : ℝ)) ≤ 2 := by + have hbase : 0 ≤ 1 - 1 / N := by + have hNpos : 0 < N := by linarith + have := (div_le_one hNpos).2 hN + linarith + rw [Real.rpow_neg hbase, Real.rpow_natCast] + exact inverse_one_sub_pow_le_two N I hN hI + +/-- Rounding loss and the balanced multiplication cost combine into one +absolute-discrepancy exponent. -/ +theorem corrected_ratio_product_le (α β N ρ : ℝ) (I J : ℕ) + (hα : 0 < α) (hβ : α ^ ρ ≤ β) + (hN : 1 ≤ N) (hI : 2 * (I : ℝ) ≤ N) : + (α / (1 - 1 / N)) ^ I * β ^ (-(J : ℝ)) ≤ + 2 * α ^ ((I : ℝ) - ρ * J) := by + have hβpos : 0 < β := lt_of_lt_of_le (Real.rpow_pos_of_pos hα _) hβ + have hdown : (α / (1 - 1 / N)) ^ I ≤ 2 * α ^ I := by + rw [div_pow, div_eq_mul_inv] + have := mul_le_mul_of_nonneg_left (inverse_one_sub_pow_le_two N I hN hI) + (pow_nonneg hα.le I) + simpa only [mul_comm] using this + have hup := Real.rpow_le_rpow_of_nonpos (Real.rpow_pos_of_pos hα ρ) hβ + (neg_nonpos.mpr (Nat.cast_nonneg J)) + rw [← Real.rpow_mul hα.le] at hup + calc + _ ≤ (2 * α ^ I) * α ^ (ρ * -(J : ℝ)) := + mul_le_mul hdown hup (Real.rpow_nonneg hβpos.le _) (by positivity) + _ = 2 * α ^ ((I : ℝ) - ρ * J) := by + rw [mul_assoc, ← Real.rpow_natCast, ← Real.rpow_add hα] + congr 2 + ring + +/-- The exact intermediate-dimension bound after the harmless rounding factor +has been absorbed. The hypotheses are purely numerical and field-independent. -/ +theorem intermediate_dimension_ratio_le_balanced {v u a b I J : ℕ} + (hv : 1 ≤ v) (hu : 1 ≤ u) (ha : 0 < a) (hb : 0 < b) (hI : I ≤ a) + (hbudget : 2 * I ≤ a + v) (ρ : ℝ) + (hbalance : ((a : ℝ) / ((a : ℝ) + v)) ^ ρ ≤ + (b : ℝ) / ((b : ℝ) + u)) : + ((homogeneousDim v (a - I) : ℝ) * homogeneousDim u (b + J)) / + ((homogeneousDim v a : ℝ) * homogeneousDim u b) ≤ + 2 * ((a : ℝ) / ((a : ℝ) + v)) ^ ((I : ℝ) - ρ * J) := by + have ha' : (0 : ℝ) < a := by exact_mod_cast ha + have hb' : (0 : ℝ) < b := by exact_mod_cast hb + have hv' : (1 : ℝ) ≤ v := by exact_mod_cast hv + have hu' : (1 : ℝ) ≤ u := by exact_mod_cast hu + have hN : (1 : ℝ) < (a : ℝ) + v := by linarith + have hdown : (a : ℝ) / ((a : ℝ) + v - 1) = + ((a : ℝ) / ((a : ℝ) + v)) / (1 - 1 / ((a : ℝ) + v)) := by + field_simp + have hup : (((b : ℝ) + u) / b) ^ J = + ((b : ℝ) / ((b : ℝ) + u)) ^ (-(J : ℝ)) := by + rw [Real.rpow_neg (by positivity), Real.rpow_natCast, ← inv_pow, inv_div] + calc + _ ≤ ((a : ℝ) / ((a : ℝ) + v - 1)) ^ I * + (((b : ℝ) + u) / b) ^ J := intermediate_dimension_ratio_le hv hu hb hI + _ = ((((a : ℝ) / ((a : ℝ) + v)) / (1 - 1 / ((a : ℝ) + v))) ^ I) * + ((b : ℝ) / ((b : ℝ) + u)) ^ (-(J : ℝ)) := by rw [hdown, hup] + _ ≤ _ := corrected_ratio_product_le _ _ _ ρ I J (by positivity) hbalance hN.le + (by exact_mod_cast hbudget) + +/-- Unnormalized form of the balanced intermediate-dimension estimate. -/ +theorem intermediate_dimension_le_balanced {v u a b I J : ℕ} + (hv : 1 ≤ v) (hu : 1 ≤ u) (ha : 0 < a) (hb : 0 < b) (hI : I ≤ a) + (hbudget : 2 * I ≤ a + v) (ρ : ℝ) + (hbalance : ((a : ℝ) / ((a : ℝ) + v)) ^ ρ ≤ + (b : ℝ) / ((b : ℝ) + u)) : + (homogeneousDim v (a - I) : ℝ) * homogeneousDim u (b + J) ≤ + 2 * ((homogeneousDim v a : ℝ) * homogeneousDim u b) * + ((a : ℝ) / ((a : ℝ) + v)) ^ ((I : ℝ) - ρ * J) := by + have hd : (0 : ℝ) < (homogeneousDim v a : ℝ) * homogeneousDim u b := by + exact mul_pos (by exact_mod_cast homogeneousDim_pos hv a) + (by exact_mod_cast homogeneousDim_pos hu b) + have h := (div_le_iff₀ hd).mp + (intermediate_dimension_ratio_le_balanced (J := J) hv hu ha hb hI hbudget ρ hbalance) + simpa only [mul_assoc, mul_left_comm, mul_comm] using h + +end Problem335 + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/EvenCorrection.lean b/lean/OAI/Algebra/DepthFive/EvenCorrection.lean new file mode 100644 index 0000000000000000000000000000000000000000..715ccff284f29d86f274b854d096f2bee852b2dd --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/EvenCorrection.lean @@ -0,0 +1,193 @@ +import Mathlib + +namespace OAI + +/-! Endpoint control for the even-degree correction in the circuit rank estimate. -/ + +namespace Problem335 + +open scoped BigOperators +open Set + +/-- The logarithm of an exponential divided by its positive argument is convex. -/ +theorem convexOn_affine_sub_log (A B : ℝ) : + ConvexOn ℝ (Ioi 0) (fun x : ℝ => A * x + B - Real.log x) := by + have haff : ConvexOn ℝ (Ioi 0) (fun x : ℝ => A * x + B) := by + refine ⟨convex_Ioi 0, ?_⟩ + intro x hx y hy a b ha hb hab + simp only [smul_eq_mul] + have hB : (a + b) * B = B := by rw [hab, one_mul] + nlinarith + exact haff.sub strictConcaveOn_log_Ioi.concaveOn + +/-- The quotient occurring in the even-degree error is bounded by its two +endpoint values. No smallness assumption on `q` is needed for this fact. -/ +theorem rpow_affine_div_le_max_endpoints {q a b z c : ℝ} + (hq : 0 < q) (ha : 0 < a) (haz : a ≤ z) (hzb : z ≤ b) : + q ^ (1 - c * z) / z ≤ + max (q ^ (1 - c * a) / a) (q ^ (1 - c * b) / b) := by + have hz : 0 < z := ha.trans_le haz + have hb : 0 < b := hz.trans_le hzb + have hc := (convexOn_affine_sub_log (-c * Real.log q) (Real.log q)).le_max_of_mem_Icc + ha hb ⟨haz, hzb⟩ + have hlog (x : ℝ) (hx : 0 < x) : + Real.log (q ^ (1 - c * x) / x) = + (-c * Real.log q) * x + Real.log q - Real.log x := by + rw [Real.log_div (Real.rpow_pos_of_pos hq _).ne' hx.ne', Real.log_rpow hq] + ring + rw [← hlog z hz, ← hlog a ha, ← hlog b hb] at hc + rcases le_max_iff.mp hc with hc | hc + · exact le_max_of_le_left ((Real.log_le_log_iff (by positivity) (by positivity)).mp hc) + · exact le_max_of_le_right ((Real.log_le_log_iff (by positivity) (by positivity)).mp hc) + +/-- Summing the endpoint estimate charges each term by its degree, rather +than by the number of factors. This avoids a constant loss per even degree. -/ +theorem sum_rpow_affine_le_endpoint_mul_sum {ι : Type*} (s : Finset ι) + (d : ι → ℝ) {q a b c : ℝ} (hq : 0 < q) (ha : 0 < a) + (hd : ∀ i ∈ s, a ≤ d i ∧ d i ≤ b) : + (∑ i ∈ s, q ^ (1 - c * d i)) ≤ + max (q ^ (1 - c * a) / a) (q ^ (1 - c * b) / b) * ∑ i ∈ s, d i := by + rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro i hi + have hdi : 0 < d i := ha.trans_le (hd i hi).1 + exact (div_le_iff₀ hdi).mp + (rpow_affine_div_le_max_endpoints hq ha (hd i hi).1 (hd i hi).2) + +/-- A total degree bound turns the preceding weighted estimate into a bound +independent of the number of terms. -/ +theorem sum_rpow_affine_le_endpoint_mul {ι : Type*} (s : Finset ι) + (d : ι → ℝ) {q a b c N : ℝ} (hq : 0 < q) (ha : 0 < a) + (hd : ∀ i ∈ s, a ≤ d i ∧ d i ≤ b) (hs : (∑ i ∈ s, d i) ≤ N) : + (∑ i ∈ s, q ^ (1 - c * d i)) ≤ + max (q ^ (1 - c * a) / a) (q ^ (1 - c * b) / b) * N := by + apply (sum_rpow_affine_le_endpoint_mul_sum s d hq ha hd).trans + apply mul_le_mul_of_nonneg_left hs + exact le_trans (by positivity : 0 ≤ q ^ (1 - c * a) / a) (le_max_left _ _) + +/-- The exact square-root error bound needed after estimating the two endpoint +quotients by `C / sqrt N`. -/ +theorem sum_rpow_affine_le_mul_sqrt {ι : Type*} (s : Finset ι) + (d : ι → ℝ) {q a b c N C : ℝ} (hq : 0 < q) (ha : 0 < a) + (hN : 0 < N) (hd : ∀ i ∈ s, a ≤ d i ∧ d i ≤ b) + (hs : (∑ i ∈ s, d i) ≤ N) + (hleft : q ^ (1 - c * a) / a ≤ C / Real.sqrt N) + (hright : q ^ (1 - c * b) / b ≤ C / Real.sqrt N) : + (∑ i ∈ s, q ^ (1 - c * d i)) ≤ C * Real.sqrt N := by + calc + _ ≤ max (q ^ (1 - c * a) / a) (q ^ (1 - c * b) / b) * N := + sum_rpow_affine_le_endpoint_mul s d hq ha hd hs + _ ≤ (C / Real.sqrt N) * N := + mul_le_mul_of_nonneg_right (max_le hleft hright) hN.le + _ = C * Real.sqrt N := by + have hsq := Real.sq_sqrt hN.le + have hne : Real.sqrt N ≠ 0 := (Real.sqrt_pos.mpr hN).ne' + field_simp + rw [hsq] + +/-- The left endpoint correction is uniformly bounded. -/ +theorem evenCorrection_left_endpoint {N s q : ℝ} (hN : 0 < N) + (hs : 0 ≤ s) (hsN : s ≤ Real.sqrt N) + (hqlo : (Real.sqrt N)⁻¹ ≤ q) (hqhi : q ≤ 2 / Real.sqrt N) : + q ^ (1 - (s / N) * 2) / 2 ≤ Real.exp 2 / Real.sqrt N := by + have hroot : 0 < Real.sqrt N := Real.sqrt_pos.mpr hN + have hq : 0 < q := (inv_pos.mpr hroot).trans_le hqlo + have hlogq : -Real.log q ≤ Real.sqrt N := by + have hlog := Real.log_le_log (inv_pos.mpr hroot) hqlo + rw [Real.log_inv] at hlog + have hrootlog := Real.log_le_sub_one_of_pos hroot + linarith + have hc : 0 ≤ 2 * s / N := by positivity + have hrootbound : (2 * s / N) * Real.sqrt N ≤ 2 := by + rw [div_mul_eq_mul_div, div_le_iff₀ hN] + have hsq := Real.sq_sqrt hN.le + have hmul := mul_le_mul_of_nonneg_right hsN hroot.le + nlinarith + have hexponent : (-(s / N * 2)) * Real.log q ≤ 2 := by + calc + _ = (2 * s / N) * (-Real.log q) := by ring + _ ≤ (2 * s / N) * Real.sqrt N := mul_le_mul_of_nonneg_left hlogq hc + _ ≤ 2 := hrootbound + have hpower : q ^ (-(s / N * 2)) ≤ Real.exp 2 := by + rw [Real.rpow_def_of_pos hq] + exact Real.exp_le_exp.mpr (by simpa only [mul_comm] using hexponent) + rw [sub_eq_add_neg, Real.rpow_add hq, Real.rpow_one] + have hp := mul_le_mul hqhi hpower (Real.rpow_nonneg hq.le _) (by positivity) + calc + q * q ^ (-(s / N * 2)) / 2 ≤ ((2 / Real.sqrt N) * Real.exp 2) / 2 := by linarith + _ = Real.exp 2 / Real.sqrt N := by ring + +/-- The right endpoint correction needs only `q ≤ 1`. -/ +theorem evenCorrection_right_endpoint {N s q : ℝ} (hN : 0 < N) + (hs : 0 < s) (hsN : s ≤ Real.sqrt N) (hq : 0 ≤ q) (hqone : q ≤ 1) : + q ^ (1 - (s / N) * (N / (4 * s))) / (N / (4 * s)) ≤ + 4 / Real.sqrt N := by + have hroot : 0 < Real.sqrt N := Real.sqrt_pos.mpr hN + have ht : 0 < N / (4 * s) := by positivity + have he : 1 - (s / N) * (N / (4 * s)) = (3 / 4 : ℝ) := by + field_simp + ring + rw [he] + have hp : q ^ (3 / 4 : ℝ) ≤ 1 := Real.rpow_le_one hq hqone (by norm_num) + apply (div_le_div_of_nonneg_right hp ht.le).trans + rw [div_le_div_iff₀ ht hroot] + have heq : N / (4 * s) * (4 * s) = N := div_mul_cancel₀ _ (by positivity) + have hsq := Real.sq_sqrt hN.le + have hmul := mul_le_mul_of_nonneg_left hsN hroot.le + nlinarith + +/-- An explicit uniform square-root bound for the sum of all low-even-degree +corrections. Only the numerical range of degrees is needed, not their parity. -/ +theorem evenCorrection_sum_bound {ι : Type*} (I : Finset ι) (d : ι → ℝ) + {N s q : ℝ} (hN : 0 < N) (hs : 0 < s) (hsN : s ≤ Real.sqrt N) + (hqlo : (Real.sqrt N)⁻¹ ≤ q) (hqhi : q ≤ 2 / Real.sqrt N) (hqone : q ≤ 1) + (hd : ∀ i ∈ I, 2 ≤ d i ∧ d i ≤ N / (4 * s)) + (hdsum : (∑ i ∈ I, d i) ≤ N) : + (∑ i ∈ I, q ^ (1 - (s / N) * d i)) ≤ + (Real.exp 2 + 4) * Real.sqrt N := by + have hroot : 0 < Real.sqrt N := Real.sqrt_pos.mpr hN + have hq : 0 < q := (inv_pos.mpr hroot).trans_le hqlo + apply sum_rpow_affine_le_mul_sqrt I d hq (by norm_num) hN hd hdsum + · apply (evenCorrection_left_endpoint hN hs.le hsN hqlo hqhi).trans + apply div_le_div_of_nonneg_right _ hroot.le + linarith + · apply (evenCorrection_right_endpoint hN hs hsN hq.le hqone).trans + apply div_le_div_of_nonneg_right _ hroot.le + linarith [Real.exp_pos (2 : ℝ)] + +/-- The correction bound specialized to the low even members of a list of +positive integer degrees with bounded total degree. -/ +theorem sum_low_even_corrections {ι : Type*} (I : Finset ι) (e : ι → ℕ) + {N s q : ℝ} (hN : 0 < N) (hs : 0 < s) (hsN : s ≤ Real.sqrt N) + (hqlo : (Real.sqrt N)⁻¹ ≤ q) (hqhi : q ≤ 2 / Real.sqrt N) (hqone : q ≤ 1) + (he : ∀ i ∈ I, 0 < e i) (hsum : (∑ i ∈ I, (e i : ℝ)) ≤ N) : + (∑ i ∈ I, if Even (e i) ∧ (e i : ℝ) < N / (4 * s) + then 4 * q ^ (1 - (s / N) * e i) else 0) ≤ + (4 * (Real.exp 2 + 4)) * Real.sqrt N := by + classical + let J := I.filter (fun i => Even (e i) ∧ (e i : ℝ) < N / (4 * s)) + have hd : ∀ i ∈ J, 2 ≤ (e i : ℝ) ∧ (e i : ℝ) ≤ N / (4 * s) := by + intro i hi + obtain ⟨hiI, hiEven, hiBound⟩ := Finset.mem_filter.mp hi + refine ⟨?_, hiBound.le⟩ + have hpos := he i hiI + obtain ⟨k, hk⟩ := hiEven + have htwo : 2 ≤ e i := by omega + exact_mod_cast htwo + have hsumJ : (∑ i ∈ J, (e i : ℝ)) ≤ N := by + apply le_trans _ hsum + apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) + intro i hi hin + positivity + have h := evenCorrection_sum_bound J (fun i => (e i : ℝ)) hN hs hsN + hqlo hqhi hqone hd hsumJ + calc + _ = 4 * ∑ i ∈ J, q ^ (1 - (s / N) * e i) := by + rw [Finset.mul_sum] + simp only [J, Finset.sum_filter] + _ ≤ 4 * ((Real.exp 2 + 4) * Real.sqrt N) := by linarith + _ = _ := by ring + +end Problem335 + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ExponentCardinality.lean b/lean/OAI/Algebra/DepthFive/ExponentCardinality.lean new file mode 100644 index 0000000000000000000000000000000000000000..d1806f798203db3204606124c964508329d1c096 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ExponentCardinality.lean @@ -0,0 +1,158 @@ +import OAI.Algebra.DepthFive.OperatorRank + +namespace OAI + +/-! # Cardinalities of homogeneous and bihomogeneous exponent sets -/ + +noncomputable section +open scoped BigOperators + +namespace Problem335 + +variable {σ : Type*} + +/-- Stars and bars for finitely supported natural exponent vectors. -/ +theorem card_homogeneous_exponents (σ : Type*) [Fintype σ] (a : ℕ) : + Nat.card {d : σ →₀ ℕ // d.sum (fun _ n => n) = a} = + (Fintype.card σ).multichoose a := by + classical + change Nat.card {d : σ →₀ ℕ // d.sum (fun _ => id) = a} = _ + rw [← Nat.card_congr (Sym.equivNatSum σ a), Nat.card_eq_fintype_card] + exact Sym.card_sym_eq_multichoose σ a + +/-- Stars and bars for ordinary natural exponent vectors on a finite type. -/ +theorem card_homogeneous_functions (σ : Type*) [Fintype σ] (a : ℕ) : + Nat.card {d : σ → ℕ // ∑ x, d x = a} = + (Fintype.card σ).multichoose a := by + classical + rw [← Nat.card_congr (Sym.equivNatSumOfFintype σ a), Nat.card_eq_fintype_card] + exact Sym.card_sym_eq_multichoose σ a + +lemma bidegreeWeight_fst_sum [Fintype σ] (isV : σ → Bool) (d : σ →₀ ℕ) : + (Finsupp.weight (bidegreeWeight isV) d).1 = + ∑ x : {x // isV x = true}, d x := by + classical + rw [Finsupp.weight_apply, Finsupp.sum_fintype _ _ (by simp), Prod.fst_sum] + calc + _ = ∑ x, if isV x = true then d x else 0 := by + apply Finset.sum_congr rfl + intro x hx + cases h : isV x <;> simp [bidegreeWeight, h] + _ = _ := by + rw [← Finset.sum_filter] + exact Finset.sum_subtype _ (by simp) _ + +lemma bidegreeWeight_snd_sum [Fintype σ] (isV : σ → Bool) (d : σ →₀ ℕ) : + (Finsupp.weight (bidegreeWeight isV) d).2 = + ∑ x : {x // ¬ isV x = true}, d x := by + classical + rw [Finsupp.weight_apply, Finsupp.sum_fintype _ _ (by simp), Prod.snd_sum] + calc + _ = ∑ x, if ¬ isV x = true then d x else 0 := by + apply Finset.sum_congr rfl + intro x hx + cases h : isV x <;> simp [bidegreeWeight, h] + _ = _ := by + rw [← Finset.sum_filter] + exact Finset.sum_subtype _ (by simp) _ + +/-- Split a bihomogeneous monomial into its two independent exponent vectors. -/ +def bidegreeExponentsEquiv [Fintype σ] (isV : σ → Bool) (a b : ℕ) : + {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)} ≃ + {d : {x // isV x = true} → ℕ // ∑ x, d x = a} × + {d : {x // ¬ isV x = true} → ℕ // ∑ x, d x = b} := by + classical + let e : (σ →₀ ℕ) ≃ + ({x // isV x = true} → ℕ) × ({x // ¬ isV x = true} → ℕ) := + Finsupp.equivFunOnFinite.trans + (Equiv.piEquivPiSubtypeProd (fun x => isV x = true) (fun _ => ℕ)) + refine (e.subtypeEquiv (q := fun z => (∑ x, z.1 x) = a ∧ (∑ x, z.2 x) = b) + ?_).trans (Equiv.subtypeProdEquivProd + (p := fun d : {x // isV x = true} → ℕ => (∑ x, d x) = a) + (q := fun d : {x // ¬ isV x = true} → ℕ => (∑ x, d x) = b)) + intro d + change Finsupp.weight (bidegreeWeight isV) d = (a, b) ↔ + (∑ x : {x // isV x = true}, d x) = a ∧ + (∑ x : {x // ¬ isV x = true}, d x) = b + rw [Prod.ext_iff, bidegreeWeight_fst_sum, bidegreeWeight_snd_sum] + +/-- Bihomogeneous monomials are counted by the product of two stars-and-bars +numbers; the variable sets may be empty. -/ +theorem card_bidegree_exponents [Fintype σ] (isV : σ → Bool) (a b : ℕ) : + Nat.card {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)} = + (Fintype.card {x // isV x = true}).multichoose a * + (Fintype.card {x // ¬ isV x = true}).multichoose b := by + classical + rw [Nat.card_congr (bidegreeExponentsEquiv isV a b), Nat.card_prod, + card_homogeneous_functions, card_homogeneous_functions] + +/-- The same count with the explicit `false` Boolean fiber. -/ +theorem card_bidegree_exponents_bool [Fintype σ] (isV : σ → Bool) (a b : ℕ) : + Nat.card {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)} = + (Fintype.card {x // isV x = true}).multichoose a * + (Fintype.card {x // isV x = false}).multichoose b := by + simpa only [Bool.not_eq_true] using card_bidegree_exponents isV a b + +/-- Each selected matrix layer contributes all `n²` ambient variables. -/ +theorem card_layer_variables {n : ℕ} (s : Finset (Fin n)) : + Fintype.card {x : Fin n × Fin n × Fin n // x.1 ∈ s} = s.card * n ^ 2 := by + classical + rw [Fintype.card_congr (Equiv.prodSubtypeFstEquivSubtypeProd + (α := Fin n) (β := Fin n × Fin n) (p := fun x => x ∈ s))] + simp [pow_two] + +/-- The complementary group has the expected number of ambient variables. -/ +theorem card_complement_layer_variables {n : ℕ} (s : Finset (Fin n)) : + Fintype.card {x : Fin n × Fin n × Fin n // x.1 ∉ s} = + (n - s.card) * n ^ 2 := by + classical + simpa only [Finset.mem_compl, Finset.card_compl, Fintype.card_fin] using card_layer_variables sᶜ + +/-- The exact dimension index count for a partition by complete matrix layers. +In particular, inactive endpoint coordinates remain part of both stars-and-bars +counts, as required in the occupation-moment argument. -/ +theorem card_layer_bidegree_exponents {n : ℕ} (s : Finset (Fin n)) (a b : ℕ) : + Nat.card {d : (Fin n × Fin n × Fin n) →₀ ℕ // + Finsupp.weight (bidegreeWeight (fun x => decide (x.1 ∈ s))) d = (a, b)} = + (s.card * n ^ 2).multichoose a * + ((n - s.card) * n ^ 2).multichoose b := by + classical + simpa only [decide_eq_true_eq, card_layer_variables, + card_complement_layer_variables] using + card_bidegree_exponents (fun x : Fin n × Fin n × Fin n => decide (x.1 ∈ s)) a b + +/-- An explicit finite enumeration for a weak-composition function type. This +is not installed globally, so consumers may choose their preferred enumeration. -/ +abbrev homogeneousFunctionsFintype (σ : Type*) [Fintype σ] (a : ℕ) : + Fintype {d : σ → ℕ // ∑ x, d x = a} := by + classical + exact Fintype.ofEquiv (Sym σ a) (Sym.equivNatSumOfFintype σ a) + +/-- The weak-composition function representation and the finite antidiagonal +representation used by power-series coefficient extraction are equivalent. -/ +def homogeneousFunctionsEquivAntidiag [Fintype σ] [DecidableEq σ] (a : ℕ) : + {d : σ → ℕ // ∑ x, d x = a} ≃ + ↥(Finset.finsuppAntidiag (Finset.univ : Finset σ) a) := by + classical + refine Finsupp.equivFunOnFinite.symm.subtypeEquiv ?_ + intro d + simp [Finset.mem_finsuppAntidiag] + +/-- Exact transport of a weak-composition sum to the finite antidiagonal. -/ +theorem sum_homogeneousFunctions_eq_antidiag [Fintype σ] [DecidableEq σ] (a : ℕ) + [Fintype {d : σ → ℕ // ∑ x, d x = a}] + {M : Type*} [AddCommMonoid M] (f : (σ →₀ ℕ) → M) : + (∑ d : {d : σ → ℕ // ∑ x, d x = a}, + f (Finsupp.equivFunOnFinite.symm d.val)) = + ∑ d ∈ Finset.finsuppAntidiag (Finset.univ : Finset σ) a, f d := by + classical + calc + _ = ∑ d : ↥(Finset.finsuppAntidiag (Finset.univ : Finset σ) a), f d := + (homogeneousFunctionsEquivAntidiag a).sum_comp (fun d => f d.val) + _ = _ := Finset.sum_coe_sort _ _ + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/ExtendedLocalMoment.lean b/lean/OAI/Algebra/DepthFive/ExtendedLocalMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..325bc29612843a3adffc728c0dceb1c2e31e55ca --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/ExtendedLocalMoment.lean @@ -0,0 +1,72 @@ +import OAI.Algebra.DepthFive.BidegreeShiftedOccupation +import OAI.Algebra.DepthFive.InvalidOccupation + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335 +namespace LocalMoments + +open ShiftedOccupation + +/-- The explicit path amplitude on the canonical fixed-bidegree source indices. -/ +def sourcePathAmplitude {ι σ : Type*} [Fintype ι] + {side : ι → Bool} {a b : ℕ} (M : BidegreeSource (σ := σ) side a b) + (p : ι → σ) : ℝ := + ∏ t : ι, coefficient (side t) (M.1 (t, p t)) + +lemma sourceIndex_shiftRelation {ι σ : Type*} [Fintype ι] [Fintype σ] + [DecidableEq σ] {side : ι → Bool} {a b : ℕ} + (M : BidegreeSource (σ := σ) side a b) (p q : ι → σ) + (h : ∀ x, 0 ≤ signedSource M.1 (operatorSign ∘ side) p q x) (t : ι) : + ShiftRelation (side t) (fun x => M.1 (t, x)) + (fun x => (sourceIndex M (operatorSign ∘ side) p q h).1 (t, x)) (p t) (q t) := by + intro x + change (source M.1 (operatorSign ∘ side) p q (t, x) : ℤ) = _ + rw [source_cast M.1 (operatorSign ∘ side) p q h] + simp only [signedSource, operatorSign, Function.comp_apply, Finsupp.sub_apply, + Finsupp.single_apply] + congr 2 + simp only [eq_comm] + +/-- The complete zero-extension bridge required by the eliminated-source second trace. +Valid shifts remain in the fixed bidegree domain; invalid shifts give zero on both sides. -/ +theorem extended_four_path_product_eq {ι σ : Type*} [Fintype ι] [Fintype σ] + [DecidableEq σ] {side : ι → Bool} {a b : ℕ} + (M : BidegreeSource (σ := σ) side a b) (p q r s : ι → σ) + (hmatch : ∀ t, Finsupp.single (p t) (1 : ℤ) - Finsupp.single (q t) 1 = + Finsupp.single (r t) 1 - Finsupp.single (s t) 1) : + sourcePathAmplitude M p * + Function.extend sourceEmbedding (fun N : BidegreeSource (σ := σ) side a b => sourcePathAmplitude N q) (fun _ => 0) + (signedSource M.1 (operatorSign ∘ side) p q) * + sourcePathAmplitude M r * + Function.extend sourceEmbedding (fun N : BidegreeSource (σ := σ) side a b => sourcePathAmplitude N s) (fun _ => 0) + (signedSource M.1 (operatorSign ∘ side) p q) = + ∏ t : ι, localPolynomial (side t) (fun x => M.1 (t, x)) (p t) (q t) (r t) := by + classical + by_cases h : ∀ x, 0 ≤ signedSource M.1 (operatorSign ∘ side) p q x + · rw [extend_source_valid M (operatorSign ∘ side) p q h, + extend_source_valid M (operatorSign ∘ side) p q h] + unfold sourcePathAmplitude + apply four_path_products_eq_localPolynomial_product Finset.univ side + (fun t x => M.1 (t, x)) + (fun t x => (sourceIndex M (operatorSign ∘ side) p q h).1 (t, x)) p q r s + · intro t ht + exact hmatch t + · intro t ht + exact sourceIndex_shiftRelation M p q h t + · rw [extend_source_invalid M (operatorSign ∘ side) p q h, + mul_zero, zero_mul, zero_mul] + symm + apply localPolynomial_product_zero_of_no_source side M.1 p q r + rw [ShiftedOccupation.exists_source_iff] + exact h + +end LocalMoments +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FactorialGeometricValue.lean b/lean/OAI/Algebra/DepthFive/FactorialGeometricValue.lean new file mode 100644 index 0000000000000000000000000000000000000000..e4b84b3ccd664ab81f4fa072a9413ad01a6c9e05 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FactorialGeometricValue.lean @@ -0,0 +1,311 @@ +import OAI.Algebra.DepthFive.LocalFactorialExpansion + +namespace OAI + +/-! Finite geometric-moment evaluation of nonnegative factorial expansions. -/ +namespace Problem335 + +open scoped BigOperators + +variable {σ : Type*} [Fintype σ] + +/-- Independent geometric factorial moments, with a possibly different mean per coordinate. -/ +def geometricFactorialMonomial (d : σ → ℕ) (G : σ → ℝ) : ℝ := + ∏ i, ((d i).factorial : ℝ) * G i ^ d i + +namespace FactorialExpansion + +/-- The finite value to which occupation comparison bounds an expansion. -/ +def geometricValue {f : (σ → ℕ) → ℕ} {S : Finset σ} {D : ℕ} + (F : FactorialExpansion f S D) (G : σ → ℝ) : ℝ := + ∑ j, (F.coeff j : ℝ) * geometricFactorialMonomial (F.degree j) G + +@[simp] theorem geometricValue_weaken {f : (σ → ℕ) → ℕ} {S T : Finset σ} {D E : ℕ} + (F : FactorialExpansion f S D) (hS : S ⊆ T) (hD : D ≤ E) (G : σ → ℝ) : + (F.weaken hS hD).geometricValue G = F.geometricValue G := rfl + +@[simp] theorem geometricValue_reframe [DecidableEq σ] + {f g : (σ → ℕ) → ℕ} {S T : Finset σ} {D E : ℕ} + (F : FactorialExpansion f S D) (hfg : ∀ M, f M = g M) + (hST : S ⊆ T) (hDE : D ≤ E) (G : σ → ℝ) : + (F.reframe hfg hST hDE).geometricValue G = F.geometricValue G := rfl + +variable [DecidableEq σ] + +@[simp] theorem geometricFactorialMonomial_single (i : σ) (d : ℕ) (G : σ → ℝ) : + geometricFactorialMonomial (fun j => if j = i then d else 0) G = + (d.factorial : ℝ) * G i ^ d := by + unfold geometricFactorialMonomial + calc + _ = ∏ j, if j = i then (d.factorial : ℝ) * G j ^ d else 1 := by + apply Finset.prod_congr rfl + intro j hj + by_cases h : j = i <;> simp [h] + _ = _ := by simp + +omit [DecidableEq σ] in +@[simp] theorem geometricValue_add {f g : (σ → ℕ) → ℕ} {S : Finset σ} {D : ℕ} + (F : FactorialExpansion f S D) (E : FactorialExpansion g S D) (G : σ → ℝ) : + (F.add E).geometricValue G = F.geometricValue G + E.geometricValue G := by + change (∑ j : F.Index ⊕ E.Index, ((Sum.elim F.coeff E.coeff j : ℕ) : ℝ) * + geometricFactorialMonomial (Sum.elim F.degree E.degree j) G) = _ + rw [Fintype.sum_sum_type] + rfl + +/-- Independence at disjoint coordinates is an exact algebraic identity of the +finite factorial-moment values; no probability-space construction is needed. -/ +@[simp] theorem geometricValue_mul {f g : (σ → ℕ) → ℕ} {S T : Finset σ} {D E : ℕ} + (F : FactorialExpansion f S D) (H : FactorialExpansion g T E) + (hST : Disjoint S T) (G : σ → ℝ) : + (F.mul H hST).geometricValue G = F.geometricValue G * H.geometricValue G := by + have hterm (a : F.Index) (b : H.Index) : + geometricFactorialMonomial (fun i => F.degree a i + H.degree b i) G = + geometricFactorialMonomial (F.degree a) G * geometricFactorialMonomial (H.degree b) G := by + unfold geometricFactorialMonomial + rw [← Finset.prod_mul_distrib] + apply Finset.prod_congr rfl + intro i hi + by_cases hS : i ∈ S + · have hT : i ∉ T := fun ht => (Finset.disjoint_left.mp hST) hS ht + simp [H.supported b i hT] + · simp [F.supported a i hS] + change (∑ j : F.Index × H.Index, ((F.coeff j.1 * H.coeff j.2 : ℕ) : ℝ) * + geometricFactorialMonomial (fun i => F.degree j.1 i + H.degree j.2 i) G) = _ + simp only [Fintype.sum_prod_type, Nat.cast_mul, hterm, geometricValue, Finset.sum_mul_sum] + apply Finset.sum_congr rfl + intro a ha + apply Finset.sum_congr rfl + intro b hb + ring + +@[simp] theorem geometricValue_coordinate (i : σ) (J : Type) [Fintype J] (c e : J → ℕ) + {f : ℕ → ℕ} {D : ℕ} (he : ∀ j, e j ≤ D) + (hf : ∀ z, f z = ∑ j, c j * z.descFactorial (e j)) (G : σ → ℝ) : + (coordinate i J c e he hf).geometricValue G = + ∑ j, (c j : ℝ) * ((e j).factorial : ℝ) * G i ^ e j := by + change (∑ j : J, (c j : ℝ) * + geometricFactorialMonomial (fun k => if k = i then e j else 0) G) = _ + simp only [geometricFactorialMonomial_single, mul_assoc] + +@[simp] theorem geometricValue_occupation (i : σ) (G : σ → ℝ) : + (occupation i).geometricValue G = G i := by simp [occupation] + +@[simp] theorem geometricValue_successor (i : σ) (G : σ → ℝ) : + (successor i).geometricValue G = G i + 1 := by + simp [successor, Fin.sum_univ_two] + +@[simp] theorem geometricValue_square (i : σ) (G : σ → ℝ) : + (square i).geometricValue G = 2 * G i ^ 2 + G i := by + simp [square, Fin.sum_univ_two] + +@[simp] theorem geometricValue_successorSquare (i : σ) (G : σ → ℝ) : + (successorSquare i).geometricValue G = 2 * G i ^ 2 + 3 * G i + 1 := by + simp [successorSquare, Fin.sum_univ_three] + +@[simp] theorem geometricValue_normalDerivative (i j : σ) (G : σ → ℝ) : + (normalDerivative i j).geometricValue G = + if i = j then 2 * G i ^ 2 + G i else G i * G j := by + by_cases h : i = j + · subst j + simp [normalDerivative] + · simp only [normalDerivative, dite_eq_right h, ite_eq_right h] + change ((occupation i).mul (occupation j) (by simpa using h)).geometricValue G = _ + rw [geometricValue_mul] + simp + +@[simp] theorem geometricValue_normalMultiplication (i j : σ) (G : σ → ℝ) : + (normalMultiplication i j).geometricValue G = + if i = j then 2 * G i ^ 2 + 3 * G i + 1 else (G i + 1) * (G j + 1) := by + by_cases h : i = j + · subst j + simp [normalMultiplication] + · simp only [normalMultiplication, dite_eq_right h, ite_eq_right h] + change ((successor i).mul (successor j) (by simpa using h)).geometricValue G = _ + rw [geometricValue_mul] + simp + +@[simp] theorem geometricValue_distinctDerivative (i j : σ) (h : i ≠ j) (G : σ → ℝ) : + (distinctDerivative i j h).geometricValue G = G i * (G j + 1) := by + change ((occupation i).mul (successor j) (by simpa using h)).geometricValue G = _ + rw [geometricValue_mul] + simp + +@[simp] theorem geometricValue_distinctMultiplication (i j : σ) (h : i ≠ j) (G : σ → ℝ) : + (distinctMultiplication i j h).geometricValue G = (G i + 1) * G j := by + change ((successor i).mul (occupation j) (by simpa using h)).geometricValue G = _ + rw [geometricValue_mul] + simp + +omit [DecidableEq σ] in +@[simp] theorem geometricValue_constant (c : ℕ) (G : σ → ℝ) : + (constant c : FactorialExpansion (fun _ : σ → ℕ => c) ∅ 0).geometricValue G = c := by + change (∑ _ : Unit, (c : ℝ) * geometricFactorialMonomial (fun _ : σ => 0) G) = _ + simp [geometricFactorialMonomial] + +/-- The value depends only on the coordinates allowed by the expansion support. -/ +theorem geometricValue_congr_on {f : (σ → ℕ) → ℕ} {S : Finset σ} {D : ℕ} + (F : FactorialExpansion f S D) (G H : σ → ℝ) + (heq : ∀ i ∈ S, G i = H i) : F.geometricValue G = F.geometricValue H := by + unfold geometricValue + apply Finset.sum_congr rfl + intro j hj + congr 1 + unfold geometricFactorialMonomial + apply Finset.prod_congr rfl + intro i hi + by_cases hS : i ∈ S + · rw [heq i hS] + · simp [F.supported j i hS] + +/-- Choose the finite product expansion together with its exact independent +geometric factorial value. -/ +theorem exists_prod_geometricValue {ι : Type*} (s : Finset ι) + (f : ι → (σ → ℕ) → ℕ) (S : ι → Finset σ) (D : ι → ℕ) + (F : ∀ i, FactorialExpansion (f i) (S i) (D i)) (G : σ → ℝ) + (hdis : (s : Set ι).Pairwise fun i j => Disjoint (S i) (S j)) : + ∃ H : FactorialExpansion (fun M => ∏ i ∈ s, f i M) + (s.biUnion S) (∑ i ∈ s, D i), + H.geometricValue G = ∏ i ∈ s, (F i).geometricValue G := by + classical + revert hdis + induction s using Finset.induction_on with + | empty => + intro hdis + exact ⟨constant 1, by simp⟩ + | @insert a s ha ih => + intro hdis + have hs : (s : Set ι).Pairwise fun i j => Disjoint (S i) (S j) := by + intro i hi j hj hij + exact hdis (Finset.mem_insert_of_mem hi) (Finset.mem_insert_of_mem hj) hij + obtain ⟨H, hH⟩ := ih hs + have hd : Disjoint (S a) (s.biUnion S) := by + rw [Finset.disjoint_biUnion_right] + intro j hj + exact hdis (Finset.mem_insert_self _ _) (Finset.mem_insert_of_mem hj) + (by intro h; subst j; exact ha hj) + let E := ((F a).mul H hd).reframe + (g := fun M => ∏ i ∈ insert a s, f i M) + (T := (insert a s).biUnion S) (E := ∑ i ∈ insert a s, D i) + (by intro M; simp [ha]) (by simp) (by simp [ha]) + refine ⟨E, ?_⟩ + change (((F a).mul H hd).reframe _ _ _).geometricValue G = _ + rw [geometricValue_reframe, geometricValue_mul, hH, Finset.prod_insert ha] + +end FactorialExpansion + +namespace LocalMoments + +variable [DecidableEq σ] + +/-- Exact independent geometric expectation of the local table at a common mean. -/ +def localGeometricMass (derivative : Bool) (G : ℝ) (p q r : σ) : ℝ := + if p = q then normalGeometricMass derivative G (decide (p = r)) + else diagonalGeometricMass G + +@[simp] theorem geometricValue_localPolynomialExpansion (derivative : Bool) + (p q r : σ) (G : ℝ) : + (localPolynomialExpansion derivative p q r).geometricValue (fun _ => G) = + localGeometricMass derivative G p q r := by + by_cases hpq : p = q + · subst q + by_cases hpr : p = r + · subst r + cases derivative <;> simp [localPolynomialExpansion, localGeometricMass, + normalGeometricMass, pow_two] + · cases derivative <;> simp [localPolynomialExpansion, hpr, localGeometricMass, + normalGeometricMass, pow_two] + · cases derivative <;> simp [localPolynomialExpansion, hpq, localGeometricMass, + diagonalGeometricMass, mul_comm] + +/-- Local evaluation when only the three relevant coordinate means agree. -/ +theorem geometricValue_localPolynomialExpansion_of_eq (derivative : Bool) + (p q r : σ) (G : σ → ℝ) (g : ℝ) + (hp : G p = g) (hq : G q = g) (hr : G r = g) : + (localPolynomialExpansion derivative p q r).geometricValue G = + localGeometricMass derivative g p q r := by + rw [FactorialExpansion.geometricValue_congr_on + (localPolynomialExpansion derivative p q r) G (fun _ => g)] + · exact geometricValue_localPolynomialExpansion derivative p q r g + · intro i hi + simp only [Finset.mem_insert, Finset.mem_singleton] at hi + rcases hi with h | h | h + · simpa [h] using hp + · simpa [h] using hq + · simpa [h] using hr + +/-- The actual local-table product has an expansion whose geometric value is +exactly the product of its local expected masses. This is the finite algebraic +bridge from occupation comparison to the normalized pairing weights. -/ +theorem exists_localProduct_geometricValue {ι : Type*} (layers : Finset ι) + (derivative : ι → Bool) (p q r : ι → σ) (G : ℝ) + (hdis : (layers : Set ι).Pairwise fun i j => + Disjoint ({p i, q i, r i} : Finset σ) {p j, q j, r j}) : + ∃ F : FactorialExpansion (localProductNat layers derivative p q r) + (layers.biUnion fun i => {p i, q i, r i}) (2 * layers.card), + F.geometricValue (fun _ => G) = + ∏ t ∈ layers, localGeometricMass (derivative t) G (p t) (q t) (r t) := by + obtain ⟨F, hF⟩ := FactorialExpansion.exists_prod_geometricValue layers + (fun i M => localPolynomialNat (derivative i) M (p i) (q i) (r i)) + (fun i => {p i, q i, r i}) (fun _ => 2) + (fun i => localPolynomialExpansion (derivative i) (p i) (q i) (r i)) + (fun _ => G) hdis + let H := F.reframe (g := localProductNat layers derivative p q r) + (T := layers.biUnion fun i => {p i, q i, r i}) (E := 2 * layers.card) + (by intro M; rfl) (by rfl) (by simp [Nat.mul_comm]) + refine ⟨H, ?_⟩ + change F.geometricValue (fun _ => G) = _ + rw [hF] + simp + +/-- Different layers may have different geometric means. In particular this +handles mean `A` on derivative layers and mean `B` on multiplication layers. -/ +theorem exists_localProduct_geometricValue_of_eq {ι : Type*} (layers : Finset ι) + (derivative : ι → Bool) (p q r : ι → σ) (G : σ → ℝ) (g : ι → ℝ) + (hp : ∀ t ∈ layers, G (p t) = g t) + (hq : ∀ t ∈ layers, G (q t) = g t) + (hr : ∀ t ∈ layers, G (r t) = g t) + (hdis : (layers : Set ι).Pairwise fun i j => + Disjoint ({p i, q i, r i} : Finset σ) {p j, q j, r j}) : + ∃ F : FactorialExpansion (localProductNat layers derivative p q r) + (layers.biUnion fun i => {p i, q i, r i}) (2 * layers.card), + F.geometricValue G = + ∏ t ∈ layers, localGeometricMass (derivative t) (g t) (p t) (q t) (r t) := by + obtain ⟨F, hF⟩ := FactorialExpansion.exists_prod_geometricValue layers + (fun i M => localPolynomialNat (derivative i) M (p i) (q i) (r i)) + (fun i => {p i, q i, r i}) (fun _ => 2) + (fun i => localPolynomialExpansion (derivative i) (p i) (q i) (r i)) G hdis + let H := F.reframe (g := localProductNat layers derivative p q r) + (T := layers.biUnion fun i => {p i, q i, r i}) (E := 2 * layers.card) + (by intro M; rfl) (by rfl) (by simp [Nat.mul_comm]) + refine ⟨H, ?_⟩ + change F.geometricValue G = _ + rw [hF] + apply Finset.prod_congr rfl + intro t ht + exact geometricValue_localPolynomialExpansion_of_eq (derivative t) + (p t) (q t) (r t) G (g t) (hp t ht) (hq t ht) (hr t ht) + +/-- Layer-labelled coordinates automatically satisfy the local equal-mean and +disjoint-support requirements. -/ +theorem exists_layered_localProduct_geometricValue {ι κ : Type*} + [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + (layers : Finset ι) (derivative : ι → Bool) (p q r : ι → κ) (g : ι → ℝ) : + ∃ F : FactorialExpansion + (localProductNat layers derivative (fun i => (i, p i)) + (fun i => (i, q i)) (fun i => (i, r i))) + (layers.biUnion fun i => {(i, p i), (i, q i), (i, r i)}) (2 * layers.card), + F.geometricValue (fun x => g x.1) = + ∏ t ∈ layers, localGeometricMass (derivative t) (g t) + (t, p t) (t, q t) (t, r t) := by + apply exists_localProduct_geometricValue_of_eq layers derivative + (fun i => (i, p i)) (fun i => (i, q i)) (fun i => (i, r i)) + (fun x => g x.1) g + · intros; rfl + · intros; rfl + · intros; rfl + · exact layered_support_disjoint layers p q r + +end LocalMoments +end Problem335 + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FactorialOccupation.lean b/lean/OAI/Algebra/DepthFive/FactorialOccupation.lean new file mode 100644 index 0000000000000000000000000000000000000000..a58897912b2122f4daa0b9be3ab891fa9bd70d00 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FactorialOccupation.lean @@ -0,0 +1,111 @@ +import OAI.Algebra.DepthFive.FactorialPositive +import OAI.Algebra.DepthFive.OccupationExpansion + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335.FactorialExpansion + +variable {σ : Type*} [Fintype σ] [DecidableEq σ] + +/-- Uniform weak-composition mean of an actual natural-valued function. -/ +def uniformMean (f : (σ → ℕ) → ℕ) (t : ℕ) : ℝ := + (∑ M ∈ Finset.finsuppAntidiag (Finset.univ : Finset σ) t, (f M : ℝ)) / + (Finset.finsuppAntidiag (Finset.univ : Finset σ) t).card + +/-- Product-geometric evaluation of a nonnegative factorial expansion. -/ +def geometricMean {f : (σ → ℕ) → ℕ} {S : Finset σ} {D : ℕ} + (F : FactorialExpansion f S D) (G : ℝ) : ℝ := + geometricExpansionValue Finset.univ (fun j => (F.coeff j : ℝ)) F.degree G + +theorem uniformMean_eq {f : (σ → ℕ) → ℕ} {S : Finset σ} {D : ℕ} + (F : FactorialExpansion f S D) (t : ℕ) : + uniformMean f t = compositionExpansionMean Finset.univ + (fun j => (F.coeff j : ℝ)) F.degree t := by + unfold uniformMean compositionExpansionMean + congr 1 + apply Finset.sum_congr rfl + intro M hM + simpa [factorialExpansionValue, factorialMonomial, Nat.cast_prod] using F.eval_real M + +theorem uniformMean_le_geometric [Nonempty σ] {f : (σ → ℕ) → ℕ} + {S : Finset σ} {D : ℕ} (F : FactorialExpansion f S D) (t : ℕ) : + uniformMean f t ≤ F.geometricMean ((t : ℝ) / Fintype.card σ) := by + rw [F.uniformMean_eq] + exact compositionExpansionMean_le_geometric _ _ _ _ (by intros; positivity) + +theorem exp_mul_geometric_le_uniformMean [Nonempty σ] {f : (σ → ℕ) → ℕ} + {S : Finset σ} {D t : ℕ} (F : FactorialExpansion f S D) + (ht : 0 < t) (hD : 2 * D ≤ t) : + Real.exp (-(D : ℝ) ^ 2 / t - (D : ℝ) ^ 2 / (2 * Fintype.card σ)) * + F.geometricMean ((t : ℝ) / Fintype.card σ) ≤ uniformMean f t := by + rw [F.uniformMean_eq] + exact exp_mul_geometric_le_compositionExpansionMean _ _ _ ht hD + (by intros; positivity) (by intro j hj; exact F.order_le j) + +variable {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] + +/-- Independent uniform means, keeping the two occupation totals fixed separately. -/ +def twoGroupMean (f : ((ι ⊕ κ) → ℕ) → ℕ) (a b : ℕ) : ℝ := + (∑ M ∈ Finset.finsuppAntidiag (Finset.univ : Finset ι) a, + (∑ N ∈ Finset.finsuppAntidiag (Finset.univ : Finset κ) b, + (f (Sum.elim M N) : ℝ)) / + (Finset.finsuppAntidiag (Finset.univ : Finset κ) b).card) / + (Finset.finsuppAntidiag (Finset.univ : Finset ι) a).card + +def twoGroupGeometricMean {f : ((ι ⊕ κ) → ℕ) → ℕ} {S : Finset (ι ⊕ κ)} {D : ℕ} + (F : FactorialExpansion f S D) (A B : ℝ) : ℝ := + twoGroupGeometricExpansionValue Finset.univ (fun j => (F.coeff j : ℝ)) + (fun j i => F.degree j (.inl i)) (fun j i => F.degree j (.inr i)) A B + +theorem twoGroupMean_eq {f : ((ι ⊕ κ) → ℕ) → ℕ} {S : Finset (ι ⊕ κ)} {D : ℕ} + (F : FactorialExpansion f S D) (a b : ℕ) : + twoGroupMean f a b = twoGroupCompositionExpansionMean Finset.univ + (fun j => (F.coeff j : ℝ)) (fun j i => F.degree j (.inl i)) + (fun j i => F.degree j (.inr i)) a b := by + unfold twoGroupMean twoGroupCompositionExpansionMean compositionExpansionMean + congr 1 + apply Finset.sum_congr rfl + intro M hM + congr 1 + apply Finset.sum_congr rfl + intro N hN + simpa [factorialExpansionValue, factorialMonomial, Fintype.prod_sum_type, + Nat.cast_prod, Nat.cast_mul, mul_assoc] using F.eval_real (Sum.elim M N) + +theorem twoGroupMean_le_geometric [Nonempty ι] [Nonempty κ] + {f : ((ι ⊕ κ) → ℕ) → ℕ} {S : Finset (ι ⊕ κ)} {D : ℕ} + (F : FactorialExpansion f S D) (a b : ℕ) : + twoGroupMean f a b ≤ F.twoGroupGeometricMean + ((a : ℝ) / Fintype.card ι) ((b : ℝ) / Fintype.card κ) := by + rw [F.twoGroupMean_eq] + exact twoGroupCompositionExpansionMean_le_geometric _ _ _ _ _ _ + (by intros; positivity) + +theorem exp_mul_geometric_le_twoGroupMean [Nonempty ι] [Nonempty κ] + {f : ((ι ⊕ κ) → ℕ) → ℕ} {S : Finset (ι ⊕ κ)} {D a b : ℕ} + (F : FactorialExpansion f S D) (ha : 0 < a) (hb : 0 < b) + (hDa : 2 * D ≤ a) (hDb : 2 * D ≤ b) : + Real.exp ((-(D : ℝ) ^ 2 / a - (D : ℝ) ^ 2 / (2 * Fintype.card ι)) + + (-(D : ℝ) ^ 2 / b - (D : ℝ) ^ 2 / (2 * Fintype.card κ))) * + F.twoGroupGeometricMean ((a : ℝ) / Fintype.card ι) ((b : ℝ) / Fintype.card κ) ≤ + twoGroupMean f a b := by + rw [F.twoGroupMean_eq] + apply exp_mul_geometric_le_twoGroupCompositionExpansionMean _ _ _ _ ha hb hDa hDb + (by intros; positivity) + · intro j hj + have h := F.order_le j + rw [Fintype.sum_sum_type] at h + omega + · intro j hj + have h := F.order_le j + rw [Fintype.sum_sum_type] at h + omega + +end Problem335.FactorialExpansion + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FactorialPositive.lean b/lean/OAI/Algebra/DepthFive/FactorialPositive.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3f51858f77da14337bb85f90d1349e89593bfa8 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FactorialPositive.lean @@ -0,0 +1,262 @@ +import Mathlib + +namespace OAI + +/-! Nonnegative falling-factorial expansions for the local trace weights. -/ +namespace Problem335 + +open scoped BigOperators + +universe u + +/-- Evaluation of a falling-factorial monomial at a natural occupation vector. -/ +def factorialMonomial {σ : Type u} [Fintype σ] + (d M : σ → ℕ) : ℕ := ∏ i, (M i).descFactorial (d i) + +/-- A finite expansion with natural (hence nonnegative) coefficients, + bounded total order, supported on a specified coordinate set. -/ +structure FactorialExpansion {σ : Type u} [Fintype σ] + (f : (σ → ℕ) → ℕ) (S : Finset σ) (D : ℕ) where + Index : Type + indexFintype : Fintype Index + coeff : Index → ℕ + degree : Index → σ → ℕ + order_le : ∀ j, ∑ i, degree j i ≤ D + supported : ∀ j i, i ∉ S → degree j i = 0 + eval_eq : ∀ M, f M = ∑ j, coeff j * factorialMonomial (degree j) M + +attribute [instance] FactorialExpansion.indexFintype + +namespace FactorialExpansion + +variable {σ : Type u} [Fintype σ] [DecidableEq σ] + +/-- Addition preserves positivity of the factorial-basis coefficients. -/ +def add {f g : (σ → ℕ) → ℕ} {S : Finset σ} {D : ℕ} + (F : FactorialExpansion f S D) (G : FactorialExpansion g S D) : + FactorialExpansion (fun M => f M + g M) S D where + Index := F.Index ⊕ G.Index + indexFintype := inferInstance + coeff := Sum.elim F.coeff G.coeff + degree := Sum.elim F.degree G.degree + order_le := by rintro (j | j); exact F.order_le j; exact G.order_le j + supported := by rintro (j | j) i hi; exact F.supported j i hi; exact G.supported j i hi + eval_eq := by + intro M + rw [F.eval_eq, G.eval_eq] + simp + +/-- A disjoint-coordinate product has the product of the local coefficients. -/ +def mul {f g : (σ → ℕ) → ℕ} {S T : Finset σ} {D E : ℕ} + (F : FactorialExpansion f S D) (G : FactorialExpansion g T E) + (hST : Disjoint S T) : + FactorialExpansion (fun M => f M * g M) (S ∪ T) (D + E) where + Index := F.Index × G.Index + indexFintype := inferInstance + coeff := fun j => F.coeff j.1 * G.coeff j.2 + degree := fun j i => F.degree j.1 i + G.degree j.2 i + order_le := by + intro j + simpa [Finset.sum_add_distrib] using Nat.add_le_add (F.order_le j.1) (G.order_le j.2) + supported := by + intro j i hi + simp only [Finset.mem_union, not_or] at hi + simp [F.supported j.1 i hi.1, G.supported j.2 i hi.2] + eval_eq := by + intro M + have hterm (a : F.Index) (b : G.Index) : + factorialMonomial (fun i => F.degree a i + G.degree b i) M = + factorialMonomial (F.degree a) M * factorialMonomial (G.degree b) M := by + unfold factorialMonomial + rw [← Finset.prod_mul_distrib] + apply Finset.prod_congr rfl + intro i hi + by_cases hS : i ∈ S + · have hT : i ∉ T := fun ht => (Finset.disjoint_left.mp hST) hS ht + simp [G.supported b i hT] + · simp [F.supported a i hS] + rw [F.eval_eq, G.eval_eq, Finset.sum_mul_sum] + simp only [Fintype.sum_prod_type, hterm] + apply Finset.sum_congr rfl + intro a ha + apply Finset.sum_congr rfl + intro b hb + ring + +theorem factorialMonomial_single (i : σ) (d : ℕ) (M : σ → ℕ) : + factorialMonomial (fun j => if j = i then d else 0) M = (M i).descFactorial d := by + simp [factorialMonomial, apply_ite] + +/-- Lift an explicit univariate expansion to one selected coordinate. -/ +def coordinate (i : σ) (J : Type) [Fintype J] (c e : J → ℕ) + {f : ℕ → ℕ} {D : ℕ} (he : ∀ j, e j ≤ D) + (hf : ∀ z, f z = ∑ j, c j * z.descFactorial (e j)) : + FactorialExpansion (fun M => f (M i)) {i} D where + Index := J + indexFintype := inferInstance + coeff := c + degree := fun a j => if j = i then e a else 0 + order_le := by intro a; simpa using he a + supported := by + intro a j hj + simp only [Finset.mem_singleton] at hj + simp [hj] + eval_eq := by intro M; simpa only [factorialMonomial_single] using hf (M i) + +/-- The occupation itself has order one. -/ +def occupation (i : σ) : FactorialExpansion (fun M => M i) {i} 1 := + coordinate (f := fun z => z) (D := 1) i Unit (fun _ => 1) (fun _ => 1) (by simp) (by simp) + +/-- Creation operators contribute the successor occupation. -/ +def successor (i : σ) : FactorialExpansion (fun M => M i + 1) {i} 1 := + coordinate (f := fun z => z + 1) (D := 1) i (Fin 2) (fun _ => 1) ![1, 0] + (by intro j; fin_cases j <;> simp) + (by intro z; simp [Fin.sum_univ_two]) + +theorem square_descFactorial (z : ℕ) : z ^ 2 = z.descFactorial 2 + z := by + cases z with + | zero => simp + | succ z => simp [Nat.descFactorial_succ]; ring + +/-- A repeated annihilation coordinate retains its extra first-order term. -/ +def square (i : σ) : FactorialExpansion (fun M => (M i) ^ 2) {i} 2 := + coordinate (f := fun z => z ^ 2) (D := 2) i (Fin 2) (fun _ => 1) ![2, 1] + (by intro j; fin_cases j <;> simp) + (by intro z; simpa [Fin.sum_univ_two] using square_descFactorial z) + +/-- The repeated creation-coordinate weight has coefficients `1,3,1`. -/ +def successorSquare (i : σ) : + FactorialExpansion (fun M => (M i + 1) ^ 2) {i} 2 := + coordinate (f := fun z => (z + 1) ^ 2) (D := 2) i (Fin 3) ![1, 3, 1] ![2, 1, 0] + (by intro j; fin_cases j <;> simp) + (by + intro z + simp only [Fin.sum_univ_three] + simp + have h := square_descFactorial z + simp [Nat.descFactorial_succ] at h + nlinarith) + +/-- Copy the coefficient data while enlarging bounds or changing the displayed +function by pointwise equality. Unlike a type cast, this keeps all data projections transparent. -/ +def reframe {f g : (σ → ℕ) → ℕ} {S T : Finset σ} {D E : ℕ} + (F : FactorialExpansion f S D) (hfg : ∀ M, f M = g M) + (hST : S ⊆ T) (hDE : D ≤ E) : FactorialExpansion g T E where + Index := F.Index + indexFintype := F.indexFintype + coeff := F.coeff + degree := F.degree + order_le := fun j => (F.order_le j).trans hDE + supported := fun j i hi => F.supported j i (fun h => hi (hST h)) + eval_eq := fun M => (hfg M).symm.trans (F.eval_eq M) + +/-- The normal pairing in a derivative layer, including equal coordinates. -/ +def normalDerivative (i j : σ) : + FactorialExpansion (fun M => M i * M j) {i, j} 2 := by + by_cases h : i = j + · exact (square i).reframe (by intro M; simp [h, pow_two]) (by simp) (by rfl) + · exact ((occupation i).mul (occupation j) (by simpa using h)).reframe + (by intro M; rfl) (by simp) (by rfl) + +/-- The normal pairing in a multiplication layer, including equal coordinates. -/ +def normalMultiplication (i j : σ) : + FactorialExpansion (fun M => (M i + 1) * (M j + 1)) {i, j} 2 := by + by_cases h : i = j + · exact (successorSquare i).reframe (by intro M; simp [h, pow_two]) (by simp) (by rfl) + · exact ((successor i).mul (successor j) (by simpa using h)).reframe + (by intro M; rfl) (by simp) (by rfl) + +/-- The distinct-coordinate pairing in a derivative layer. -/ +def distinctDerivative (i j : σ) (h : i ≠ j) : + FactorialExpansion (fun M => M i * (M j + 1)) {i, j} 2 := + ((occupation i).mul (successor j) (by simpa using h)).reframe + (by intro M; rfl) (by simp) (by rfl) + +/-- The distinct-coordinate pairing in a multiplication layer. -/ +def distinctMultiplication (i j : σ) (h : i ≠ j) : + FactorialExpansion (fun M => (M i + 1) * M j) {i, j} 2 := + ((successor i).mul (occupation j) (by simpa using h)).reframe + (by intro M; rfl) (by simp) (by rfl) + +omit [DecidableEq σ] in +/-- The same expansion as a real-valued sum, ready for expectation comparisons. -/ +theorem eval_real {f : (σ → ℕ) → ℕ} {S : Finset σ} {D : ℕ} + (F : FactorialExpansion f S D) (M : σ → ℕ) : + (f M : ℝ) = ∑ j, (F.coeff j : ℝ) * (factorialMonomial (F.degree j) M : ℝ) := by + exact_mod_cast F.eval_eq M + +/-- A constant has a single order-zero term. -/ +def constant (c : ℕ) : FactorialExpansion (fun _ : σ → ℕ => c) ∅ 0 where + Index := Unit + indexFintype := inferInstance + coeff := fun _ => c + degree := fun _ _ => 0 + order_le := by simp + supported := by simp + eval_eq := by simp [factorialMonomial] + +/-- Products of local weights on pairwise disjoint coordinate sets retain a +nonnegative factorial expansion, and their local order bounds add. -/ +theorem nonempty_prod {ι : Type*} (s : Finset ι) + (f : ι → (σ → ℕ) → ℕ) (S : ι → Finset σ) (D : ι → ℕ) + (F : ∀ i, FactorialExpansion (f i) (S i) (D i)) + (hS : (s : Set ι).Pairwise fun i j => Disjoint (S i) (S j)) : + Nonempty (FactorialExpansion (fun M => ∏ i ∈ s, f i M) + (s.biUnion S) (∑ i ∈ s, D i)) := by + classical + revert hS + induction s using Finset.induction_on with + | empty => + intro hS + simpa using (show Nonempty (FactorialExpansion (fun _ : σ → ℕ => 1) ∅ 0) from + ⟨constant 1⟩) + | @insert a s ha ih => + intro hS + have hs : (s : Set ι).Pairwise fun i j => Disjoint (S i) (S j) := by + intro i hi j hj hij + exact hS (Finset.mem_insert_of_mem hi) (Finset.mem_insert_of_mem hj) hij + obtain ⟨G⟩ := ih hs + have hd : Disjoint (S a) (s.biUnion S) := by + rw [Finset.disjoint_biUnion_right] + intro j hj + exact hS (Finset.mem_insert_self _ _) (Finset.mem_insert_of_mem hj) + (by intro h; subst j; exact ha hj) + simpa [Finset.prod_insert, Finset.biUnion_insert, Finset.sum_insert, ha] using + (show Nonempty (FactorialExpansion + (fun M => f a M * ∏ i ∈ s, f i M) (S a ∪ s.biUnion S) + (D a + ∑ i ∈ s, D i)) from ⟨(F a).mul G hd⟩) + +omit [DecidableEq σ] in +/-- Any real linear functional can be evaluated termwise in the expansion. -/ +theorem linear_eval {f : (σ → ℕ) → ℕ} {S : Finset σ} {D : ℕ} + (F : FactorialExpansion f S D) + (L : ((σ → ℕ) → ℝ) →ₗ[ℝ] ℝ) : + L (fun M => (f M : ℝ)) = + ∑ j, (F.coeff j : ℝ) * L (fun M => (factorialMonomial (F.degree j) M : ℝ)) := by + have h : (fun M => (f M : ℝ)) = + ∑ j, (F.coeff j : ℝ) • (fun M => (factorialMonomial (F.degree j) M : ℝ)) := by + funext M + simpa using F.eval_real M + rw [h] + simp + +omit [DecidableEq σ] in +/-- Termwise moment comparison extends to every nonnegative factorial expansion. -/ +theorem linear_comparison {f : (σ → ℕ) → ℕ} {S : Finset σ} {D : ℕ} + (F : FactorialExpansion f S D) + (L R : ((σ → ℕ) → ℝ) →ₗ[ℝ] ℝ) (C : ℝ) + (h : ∀ d : σ → ℕ, (∑ i, d i) ≤ D → (∀ i, i ∉ S → d i = 0) → + L (fun M => (factorialMonomial d M : ℝ)) ≤ + C * R (fun M => (factorialMonomial d M : ℝ))) : + L (fun M => (f M : ℝ)) ≤ C * R (fun M => (f M : ℝ)) := by + rw [F.linear_eval L, F.linear_eval R, Finset.mul_sum] + apply Finset.sum_le_sum + intro j hj + have hd := h (F.degree j) (F.order_le j) (F.supported j) + have hc : (0 : ℝ) ≤ F.coeff j := by positivity + nlinarith [mul_le_mul_of_nonneg_left hd hc] + +end FactorialExpansion +end Problem335 + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FiniteOperator.lean b/lean/OAI/Algebra/DepthFive/FiniteOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..bc168aa22a33122e3d7c8d48424f0b390ae06162 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FiniteOperator.lean @@ -0,0 +1,169 @@ +import OAI.Algebra.DepthFive.OperatorRank +import OAI.Algebra.DepthFive.MixedOperator +import OAI.Algebra.DepthFive.RankMeasure +import OAI.Algebra.DepthFive.MixedOperatorBidegree + +namespace OAI + +/-! The finite-source rank measure and its product decomposition. -/ + +noncomputable section +open scoped BigOperators + +namespace Problem335 + +variable {σ K : Type*} [Field K] + +/-- The full substitution operator restricted to a fixed bidegree source. +Keeping the ambient polynomial codomain avoids unnecessary degree transports. -/ +def rawOperatorFamily (isV : σ → Bool) (a b : ℕ) : + MvPolynomial σ K →ₗ[K] + (bidegreeSubmodule (K := K) isV a b →ₗ[K] MvPolynomial σ K) := + RankMeasure.restrictFamily (mixedOperator isV).toLinearMap + (bidegreeSubmodule isV a b) + +@[simp] theorem rawOperatorFamily_apply (isV : σ → Bool) (a b : ℕ) + (q : MvPolynomial σ K) (p : bidegreeSubmodule (K := K) isV a b) : + rawOperatorFamily isV a b q p = mixedOperator isV q p := rfl + +/-- Project the defining polynomial to bidegree `(k,m)` before substitution. -/ +def bidegreeOperatorFamily (isV : σ → Bool) (a b k m : ℕ) : + MvPolynomial σ K →ₗ[K] + (bidegreeSubmodule (K := K) isV a b →ₗ[K] MvPolynomial σ K) := + (rawOperatorFamily isV a b).comp (bidegreeComponent isV k m) + +@[simp] theorem bidegreeOperatorFamily_apply (isV : σ → Bool) (a b k m : ℕ) + (q : MvPolynomial σ K) (p : bidegreeSubmodule (K := K) isV a b) : + bidegreeOperatorFamily isV a b k m q p = + mixedOperator isV (bidegreeComponent isV k m q) p := rfl + +/-- The rank measure from the manuscript, with an ambient codomain. -/ +def bidegreeRank (isV : σ → Bool) (a b k m : ℕ) (q : MvPolynomial σ K) : ℕ := + RankMeasure.measure (bidegreeOperatorFamily isV a b k m) q + +@[simp] theorem bidegreeRank_zero (isV : σ → Bool) (a b k m : ℕ) : + bidegreeRank (K := K) isV a b k m 0 = 0 := + RankMeasure.measure_zero _ + + theorem bidegreeRank_smul (isV : σ → Bool) (a b k m : ℕ) + (q : MvPolynomial σ K) (c : K) (hc : c ≠ 0) : + bidegreeRank isV a b k m (c • q) = bidegreeRank isV a b k m q := + RankMeasure.measure_smul _ c hc q + + theorem bidegreeRank_add_le [Finite σ] (isV : σ → Bool) (a b k m : ℕ) + (q r : MvPolynomial σ K) : + bidegreeRank isV a b k m (q + r) ≤ + bidegreeRank isV a b k m q + bidegreeRank isV a b k m r := + RankMeasure.measure_add_le _ q r + + theorem bidegreeRank_sum_le [Finite σ] {ι : Type*} (s : Finset ι) + (isV : σ → Bool) (a b k m : ℕ) (q : ι → MvPolynomial σ K) : + bidegreeRank isV a b k m (∑ i ∈ s, q i) ≤ + ∑ i ∈ s, bidegreeRank isV a b k m (q i) := + RankMeasure.measure_sum_le _ s q + + theorem bidegreeRank_eq_raw_of_mem (isV : σ → Bool) (a b k m : ℕ) + {q : MvPolynomial σ K} (hq : q ∈ bidegreeSubmodule isV k m) : + bidegreeRank isV a b k m q = + RankMeasure.mapRank (rawOperatorFamily isV a b q) := by + unfold bidegreeRank RankMeasure.measure bidegreeOperatorFamily + rw [LinearMap.comp_apply, bidegreeComponent_eq_self hq] + +/-- The projected product map is a sum of maps with fixed factor bidegrees. -/ +theorem bidegreeOperatorFamily_product {ι : Type*} [Fintype ι] [DecidableEq ι] + (isV : σ → Bool) (a b k m : ℕ) (e : ι → ℕ) + (q : ι → MvPolynomial σ K) (hq : ∀ j, (q j).IsHomogeneous (e j)) : + bidegreeOperatorFamily isV a b k m (∏ j, q j) = + ∑ d : (∀ j : ι, Fin (e j + 1)), + if (∑ j : ι, (d j : ℕ)) = k ∧ (∑ j : ι, (e j - (d j : ℕ))) = m then + rawOperatorFamily isV a b + (∏ j, bidegreeComponent isV (d j) (e j - d j) (q j)) + else 0 := by + classical + change rawOperatorFamily isV a b + (bidegreeComponent isV k m (∏ j, q j)) = _ + rw [bidegreeComponent_product isV e q hq, map_sum] + apply Finset.sum_congr rfl + intro d hd + split_ifs <;> simp + +/-- Subadditivity reduces product rank to the constrained assignments. -/ +theorem bidegreeRank_product_le [Finite σ] {ι : Type*} [Fintype ι] [DecidableEq ι] + (isV : σ → Bool) (a b k m : ℕ) (e : ι → ℕ) + (q : ι → MvPolynomial σ K) (hq : ∀ j, (q j).IsHomogeneous (e j)) : + bidegreeRank isV a b k m (∏ j, q j) ≤ + ∑ d : (∀ j : ι, Fin (e j + 1)), + if (∑ j : ι, (d j : ℕ)) = k ∧ (∑ j : ι, (e j - (d j : ℕ))) = m then + RankMeasure.mapRank (rawOperatorFamily isV a b + (∏ j, bidegreeComponent isV (d j) (e j - d j) (q j))) + else 0 := by + classical + unfold bidegreeRank RankMeasure.measure + rw [bidegreeOperatorFamily_product isV a b k m e q hq] + convert RankMeasure.mapRank_sum_le Finset.univ + (fun d : (∀ j : ι, Fin (e j + 1)) => + if (∑ j : ι, (d j : ℕ)) = k ∧ (∑ j : ι, (e j - (d j : ℕ))) = m then + rawOperatorFamily isV a b + (∏ j, bidegreeComponent isV (d j) (e j - d j) (q j)) + else 0) using 1 + apply Finset.sum_congr rfl + intro d hd + split_ifs <;> simp + +/-- Replacing an ambient codomain with any subspace containing the image +preserves the rank measure exactly. -/ +theorem rawOperatorFamily_rank_codRestrict (isV : σ → Bool) (a b : ℕ) + (q : MvPolynomial σ K) (T : Submodule K (MvPolynomial σ K)) + (hT : ∀ p : bidegreeSubmodule (K := K) isV a b, + rawOperatorFamily isV a b q p ∈ T) : + RankMeasure.mapRank ((rawOperatorFamily isV a b q).codRestrict T hT) = + RankMeasure.mapRank (rawOperatorFamily isV a b q) := by + have h := RankMeasure.mapRank_subtype_comp T + ((rawOperatorFamily isV a b q).codRestrict T hT) + exact h.symm + +/-- The finite-dimensional operator with its exact target bidegree. +The map is zero when `k > a`, so no degree-inequality argument is needed. -/ +def finiteMixedOperator (isV : σ → Bool) (a b k m : ℕ) : + MvPolynomial σ K →ₗ[K] + (bidegreeSubmodule (K := K) isV a b →ₗ[K] + bidegreeSubmodule (K := K) isV (a - k) (b + m)) where + toFun q := (bidegreeOperatorFamily isV a b k m q).codRestrict + (bidegreeSubmodule isV (a - k) (b + m)) (fun p => + mixedOperator_mem_bidegreeSubmodule_all isV + (bidegreeComponent_mem isV k m q) p.property) + map_add' q r := by + ext p : 2 + exact LinearMap.congr_fun (map_add (bidegreeOperatorFamily isV a b k m) q r) p + map_smul' c q := by + ext p : 2 + exact LinearMap.congr_fun (map_smul (bidegreeOperatorFamily isV a b k m) c q) p + +@[simp] theorem finiteMixedOperator_apply_coe (isV : σ → Bool) (a b k m : ℕ) + (q : MvPolynomial σ K) (p : bidegreeSubmodule (K := K) isV a b) : + (finiteMixedOperator isV a b k m q p : MvPolynomial σ K) = + mixedOperator isV (bidegreeComponent isV k m q) p := rfl + +/-- On a polynomial of bidegree `(k,m)`, projection is redundant. -/ +theorem finiteMixedOperator_apply_of_mem (isV : σ → Bool) (a b k m : ℕ) + {q : MvPolynomial σ K} (hq : q ∈ bidegreeSubmodule isV k m) + (p : bidegreeSubmodule (K := K) isV a b) : + (finiteMixedOperator isV a b k m q p : MvPolynomial σ K) = + mixedOperator isV q p := by + rw [finiteMixedOperator_apply_coe, bidegreeComponent_eq_self hq] + +/-- The intrinsic finite-dimensional map and the ambient-codomain rank agree. -/ +theorem finiteMixedOperator_rank (isV : σ → Bool) (a b k m : ℕ) + (q : MvPolynomial σ K) : + RankMeasure.mapRank (finiteMixedOperator isV a b k m q) = + bidegreeRank isV a b k m q := by + have h := RankMeasure.mapRank_subtype_comp + (bidegreeSubmodule (K := K) isV (a - k) (b + m)) + (finiteMixedOperator isV a b k m q) + exact h.symm + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FirstOccupationMoment.lean b/lean/OAI/Algebra/DepthFive/FirstOccupationMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..a26527b7ebfcff387d167ca6b7ff8f2df04916f1 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FirstOccupationMoment.lean @@ -0,0 +1,140 @@ +import OAI.Algebra.DepthFive.OccupationSum +import OAI.Algebra.DepthFive.OccupationComparison + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335 + +/-- Uniform average over all weak compositions of `t` in the coordinates `ι`. -/ +def occupationAverage {ι : Type*} [Fintype ι] [DecidableEq ι] + (t : ℕ) (f : (ι →₀ ℕ) → ℝ) : ℝ := + (∑ M ∈ Finset.finsuppAntidiag (Finset.univ : Finset ι) t, f M) / + (Finset.finsuppAntidiag (Finset.univ : Finset ι) t).card + +lemma occupationAverage_sum {ι κ : Type*} [Fintype ι] [DecidableEq ι] + (t : ℕ) (s : Finset κ) (f : κ → (ι →₀ ℕ) → ℝ) : + occupationAverage t (fun M => ∑ j ∈ s, f j M) = + ∑ j ∈ s, occupationAverage t (f j) := by + unfold occupationAverage + rw [Finset.sum_comm, Finset.sum_div] + +lemma occupationAverage_nonneg {ι : Type*} [Fintype ι] [DecidableEq ι] + (t : ℕ) (f : (ι →₀ ℕ) → ℝ) (hf : ∀ M, 0 ≤ f M) : + 0 ≤ occupationAverage t f := by + unfold occupationAverage + exact div_nonneg (Finset.sum_nonneg fun M _ => hf M) (Nat.cast_nonneg _) + +/-- The squarefree occupation product needed by differentiated path layers. -/ +theorem occupationAverage_prod {ι : Type*} [Fintype ι] [DecidableEq ι] [Nonempty ι] + (t : ℕ) (s : Finset ι) : + occupationAverage t (fun M => ∏ i ∈ s, (M i : ℝ)) = + (t.descFactorial s.card : ℝ) / ((Fintype.card ι).ascFactorial s.card : ℝ) := by + have h := occupation_factorial_moment (fun i => if i ∈ s then 1 else 0) t + simpa [occupationAverage, apply_ite] using h + +/-- Multiplication layers supply successor occupations; expand them by subsets. -/ +theorem occupationAverage_prod_add_one {ι : Type*} [Fintype ι] [DecidableEq ι] + [Nonempty ι] (t : ℕ) (s : Finset ι) : + occupationAverage t (fun M => ∏ i ∈ s, ((M i : ℝ) + 1)) = + ∑ z ∈ s.powerset, + (t.descFactorial z.card : ℝ) / ((Fintype.card ι).ascFactorial z.card : ℝ) := by + simp_rw [Finset.prod_add_one] + rw [occupationAverage_sum] + simp_rw [occupationAverage_prod] + +lemma occupation_powerset_sum {ι : Type*} (s : Finset ι) (x : ℝ) : + (∑ z ∈ s.powerset, x ^ z.card) = (1 + x) ^ s.card := by + simpa using (Finset.prod_one_add (f := fun _ : ι => x) s).symm + +/-- A uniform factorial-moment loss transfers to the successor product. -/ +theorem occupationAverage_prod_add_one_lower_of_factorial {ι : Type*} + [Fintype ι] [DecidableEq ι] [Nonempty ι] (t : ℕ) (s : Finset ι) (L : ℝ) + (hL : ∀ H ≤ s.card, + L * ((t : ℝ) / Fintype.card ι) ^ H ≤ + (t.descFactorial H : ℝ) / ((Fintype.card ι).ascFactorial H : ℝ)) : + L * (1 + (t : ℝ) / Fintype.card ι) ^ s.card ≤ + occupationAverage t (fun M => ∏ i ∈ s, ((M i : ℝ) + 1)) := by + rw [occupationAverage_prod_add_one, ← occupation_powerset_sum, + Finset.mul_sum] + apply Finset.sum_le_sum + intro z hz + exact hL z.card (Finset.card_le_card (Finset.mem_powerset.mp hz)) + +/-- Independent composition averages factor without any probabilistic +independence convention being implicit. -/ +theorem occupationAverage_tensor {ι κ : Type*} [Fintype ι] [DecidableEq ι] + [Fintype κ] [DecidableEq κ] (a b : ℕ) + (f : (ι →₀ ℕ) → ℝ) (g : (κ →₀ ℕ) → ℝ) : + (∑ M ∈ Finset.finsuppAntidiag (Finset.univ : Finset ι) a, + ∑ N ∈ Finset.finsuppAntidiag (Finset.univ : Finset κ) b, f M * g N) / + ((Finset.finsuppAntidiag (Finset.univ : Finset ι) a).card * + (Finset.finsuppAntidiag (Finset.univ : Finset κ) b).card : ℝ) = + occupationAverage a f * occupationAverage b g := by + unfold occupationAverage + rw [← Finset.sum_mul_sum, mul_div_mul_comm] + +theorem occupationAverage_prod_le {ι : Type*} [Fintype ι] [DecidableEq ι] + [Nonempty ι] (t : ℕ) (s : Finset ι) : + occupationAverage t (fun M => ∏ i ∈ s, (M i : ℝ)) ≤ + ((t : ℝ) / Fintype.card ι) ^ s.card := by + rw [occupationAverage_prod] + exact descFactorial_div_ascFactorial_le_mean_pow_of_pos Fintype.card_pos + +theorem occupationAverage_prod_lower {ι : Type*} [Fintype ι] [DecidableEq ι] + [Nonempty ι] (t : ℕ) (s : Finset ι) (ht : 0 < t) (hs : 2 * s.card ≤ t) : + Real.exp (-(s.card : ℝ) ^ 2 / t - (s.card : ℝ) ^ 2 / (2 * Fintype.card ι)) * + ((t : ℝ) / Fintype.card ι) ^ s.card ≤ + occupationAverage t (fun M => ∏ i ∈ s, (M i : ℝ)) := by + rw [occupationAverage_prod] + exact exp_mul_mean_pow_le_descFactorial_div_ascFactorial ht Fintype.card_pos hs + +theorem occupationAverage_prod_add_one_le {ι : Type*} [Fintype ι] [DecidableEq ι] + [Nonempty ι] (t : ℕ) (s : Finset ι) : + occupationAverage t (fun M => ∏ i ∈ s, ((M i : ℝ) + 1)) ≤ + (1 + (t : ℝ) / Fintype.card ι) ^ s.card := by + rw [occupationAverage_prod_add_one, ← occupation_powerset_sum] + apply Finset.sum_le_sum + intro z hz + exact descFactorial_div_ascFactorial_le_mean_pow_of_pos Fintype.card_pos + +theorem occupationAverage_prod_add_one_lower {ι : Type*} [Fintype ι] [DecidableEq ι] + [Nonempty ι] (t : ℕ) (s : Finset ι) (ht : 0 < t) (hs : 2 * s.card ≤ t) : + Real.exp (-(s.card : ℝ) ^ 2 / t - (s.card : ℝ) ^ 2 / (2 * Fintype.card ι)) * + (1 + (t : ℝ) / Fintype.card ι) ^ s.card ≤ + occupationAverage t (fun M => ∏ i ∈ s, ((M i : ℝ) + 1)) := by + apply occupationAverage_prod_add_one_lower_of_factorial + intro H hH + exact occupation_factorial_ratio_lower_of_le ht Fintype.card_pos hH hs + +/-- The two-group first-trace occupation estimate, with its exact finite-size +loss and no asymptotic or independence premises. -/ +theorem occupation_first_moment_lower {V U : Type*} + [Fintype V] [DecidableEq V] [Nonempty V] + [Fintype U] [DecidableEq U] [Nonempty U] + (a b : ℕ) (s : Finset V) (z : Finset U) + (ha : 0 < a) (hb : 0 < b) (hs : 2 * s.card ≤ a) (hz : 2 * z.card ≤ b) : + Real.exp ((-(s.card : ℝ) ^ 2 / a - (s.card : ℝ) ^ 2 / (2 * Fintype.card V)) + + (-(z.card : ℝ) ^ 2 / b - (z.card : ℝ) ^ 2 / (2 * Fintype.card U))) * + (((a : ℝ) / Fintype.card V) ^ s.card * + (1 + (b : ℝ) / Fintype.card U) ^ z.card) ≤ + (∑ M ∈ Finset.finsuppAntidiag (Finset.univ : Finset V) a, + ∑ N ∈ Finset.finsuppAntidiag (Finset.univ : Finset U) b, + (∏ i ∈ s, (M i : ℝ)) * (∏ j ∈ z, ((N j : ℝ) + 1))) / + ((Finset.finsuppAntidiag (Finset.univ : Finset V) a).card * + (Finset.finsuppAntidiag (Finset.univ : Finset U) b).card : ℝ) := by + rw [occupationAverage_tensor] + have h₁ := occupationAverage_prod_lower a s ha hs + have h₂ := occupationAverage_prod_add_one_lower b z hb hz + have hprod := mul_le_mul h₁ h₂ (by positivity) + (occupationAverage_nonneg a _ (fun M => by positivity)) + rw [Real.exp_add] + simpa only [mul_assoc, mul_left_comm, mul_comm] using hprod + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FirstTraceBound.lean b/lean/OAI/Algebra/DepthFive/FirstTraceBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..12e65e6159ff2b2051fa2b0cb43d9c23f9775fc0 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FirstTraceBound.lean @@ -0,0 +1,148 @@ +import OAI.Algebra.DepthFive.FirstOccupationMoment +import OAI.Algebra.DepthFive.TraceComplexification + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335.FirstMoment + +abbrev CompositionIndex (V : Type*) [Fintype V] [DecidableEq V] (a : ℕ) := + ↥(Finset.finsuppAntidiag (Finset.univ : Finset V) a) + +abbrev Source (V U : Type*) [Fintype V] [DecidableEq V] + [Fintype U] [DecidableEq U] (a b : ℕ) := + CompositionIndex V a × CompositionIndex U b + +variable {V U P : Type*} [Fintype V] [DecidableEq V] [Nonempty V] + [Fintype U] [DecidableEq U] [Nonempty U] [Fintype P] + +/-- The squared normalized coefficient of one squarefree path. -/ +def mass {a b : ℕ} (s : P → Finset V) (z : P → Finset U) + (i : Source V U a b) (p : P) : ℝ := + (∏ v ∈ s p, (i.1.val v : ℝ)) * (∏ u ∈ z p, ((i.2.val u : ℝ) + 1)) + +omit [Nonempty V] [Nonempty U] [Fintype P] in +lemma mass_nonneg {a b : ℕ} (s : P → Finset V) (z : P → Finset U) + (i : Source V U a b) (p : P) : 0 ≤ mass s z i p := by + unfold mass + positivity + +lemma card_source (a b : ℕ) : + Fintype.card (Source V U a b) = + (a + Fintype.card V - 1).choose a * (b + Fintype.card U - 1).choose b := by + simp [Source, CompositionIndex, occupation_composition_card] + +lemma composition_card_pos (W : Type*) [Fintype W] [DecidableEq W] [Nonempty W] + (t : ℕ) : 0 < (Finset.finsuppAntidiag (Finset.univ : Finset W) t).card := by + rw [occupation_composition_card] + apply Nat.choose_pos + have : 0 < Fintype.card W := Fintype.card_pos + omega + +omit [Nonempty V] [Nonempty U] in +lemma sum_mass {a b : ℕ} (s : P → Finset V) (z : P → Finset U) : + (∑ i : Source V U a b, ∑ p, mass s z i p) = + ∑ p, ∑ M ∈ Finset.finsuppAntidiag (Finset.univ : Finset V) a, + ∑ N ∈ Finset.finsuppAntidiag (Finset.univ : Finset U) b, + (∏ v ∈ s p, (M v : ℝ)) * (∏ u ∈ z p, ((N u : ℝ) + 1)) := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro p hp + simp only [Source, Fintype.sum_prod_type, mass] + change (∑ M : CompositionIndex V a, ∑ N : CompositionIndex U b, + (∏ v ∈ s p, (M.val v : ℝ)) * (∏ u ∈ z p, ((N.val u : ℝ) + 1))) = _ + calc + _ = ∑ M ∈ Finset.finsuppAntidiag (Finset.univ : Finset V) a, + ∑ N : CompositionIndex U b, + (∏ v ∈ s p, (M v : ℝ)) * (∏ u ∈ z p, ((N.val u : ℝ) + 1)) := by + exact Finset.sum_coe_sort _ (fun M : V →₀ ℕ => + ∑ N : CompositionIndex U b, + (∏ v ∈ s p, (M v : ℝ)) * (∏ u ∈ z p, ((N.val u : ℝ) + 1))) + _ = _ := by + apply Finset.sum_congr rfl + intro M hM + exact Finset.sum_coe_sort _ (fun N : U →₀ ℕ => + (∏ v ∈ s p, (M v : ℝ)) * (∏ u ∈ z p, ((N u : ℝ) + 1))) + +/-- Exact first-moment loss, deliberately kept separate from asymptotic +parameter estimates. -/ +def loss (a v b u k m : ℕ) : ℝ := + (k : ℝ) ^ 2 / a + (k : ℝ) ^ 2 / (2 * v) + + (m : ℝ) ^ 2 / b + (m : ℝ) ^ 2 / (2 * u) + +def mean (a v b u k m : ℕ) : ℝ := + ((a : ℝ) / v) ^ k * (1 + (b : ℝ) / u) ^ m + +/-- Sum the concrete occupation lower bound over every path and every source +basis vector. The number of paths is counted exactly, not estimated. -/ +theorem sum_mass_lower {a b k m : ℕ} (s : P → Finset V) (z : P → Finset U) + (hs : ∀ p, (s p).card = k) (hz : ∀ p, (z p).card = m) + (ha : 0 < a) (hb : 0 < b) (hka : 2 * k ≤ a) (hmb : 2 * m ≤ b) : + (Fintype.card (Source V U a b) : ℝ) * Fintype.card P * + mean a (Fintype.card V) b (Fintype.card U) k m * + Real.exp (-loss a (Fintype.card V) b (Fintype.card U) k m) ≤ + ∑ i : Source V U a b, ∑ p, mass s z i p := by + have hD : 0 < ((Finset.finsuppAntidiag (Finset.univ : Finset V) a).card * + (Finset.finsuppAntidiag (Finset.univ : Finset U) b).card : ℝ) := by + exact_mod_cast Nat.mul_pos (composition_card_pos V a) (composition_card_pos U b) + have hper (p : P) := occupation_first_moment_lower a b (s p) (z p) ha hb + (by simpa [hs p] using hka) (by simpa [hz p] using hmb) + have hbound (p : P) : + Real.exp (-loss a (Fintype.card V) b (Fintype.card U) k m) * + mean a (Fintype.card V) b (Fintype.card U) k m * + ((Finset.finsuppAntidiag (Finset.univ : Finset V) a).card * + (Finset.finsuppAntidiag (Finset.univ : Finset U) b).card : ℝ) ≤ + ∑ M ∈ Finset.finsuppAntidiag (Finset.univ : Finset V) a, + ∑ N ∈ Finset.finsuppAntidiag (Finset.univ : Finset U) b, + (∏ v ∈ s p, (M v : ℝ)) * (∏ u ∈ z p, ((N u : ℝ) + 1)) := by + apply (le_div_iff₀ hD).mp + simpa only [hs p, hz p, loss, mean, neg_add_rev, neg_div, + sub_eq_add_neg, add_assoc, add_left_comm, add_comm] using hper p + have hsum := Finset.sum_le_sum (fun p (_ : p ∈ (Finset.univ : Finset P)) => hbound p) + rw [sum_mass] + simpa only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, + Source, Fintype.card_prod, CompositionIndex, Fintype.card_coe, + Nat.cast_mul, mul_assoc, mul_left_comm, mul_comm] using hsum + +/-- First Gram-trace lower bound for a real square-root occupation path matrix. +The disjointness premise permits arbitrary targets for zero-mass invalid paths. -/ +theorem real_first_trace_lower {J : Type*} [Fintype J] [DecidableEq J] + {a b k m : ℕ} (s : P → Finset V) (z : P → Finset U) + (hs : ∀ p, (s p).card = k) (hz : ∀ p, (z p).card = m) + (ha : 0 < a) (hb : 0 < b) (hka : 2 * k ≤ a) (hmb : 2 * m ≤ b) + (shift : Source V U a b → P → J) + (hdisjoint : ∀ i p q, p ≠ q → shift i p = shift i q → + mass s z i p = 0 ∨ mass s z i q = 0) : + let A := pathShiftMatrix shift (fun i p => Real.sqrt (mass s z i p)) + (Fintype.card (Source V U a b) : ℝ) * Fintype.card P * + mean a (Fintype.card V) b (Fintype.card U) k m * + Real.exp (-loss a (Fintype.card V) b (Fintype.card U) k m) ≤ + (A.transpose * A).trace := by + dsimp only + rw [pathShiftMatrix_first_trace_sqrt shift (mass s z) (mass_nonneg s z) hdisjoint] + exact sum_mass_lower s z hs hz ha hb hka hmb + +/-- The same first-moment estimate for the genuine complex adjoint. -/ +theorem complex_first_trace_lower {J : Type*} [Fintype J] [DecidableEq J] + {a b k m : ℕ} (s : P → Finset V) (z : P → Finset U) + (hs : ∀ p, (s p).card = k) (hz : ∀ p, (z p).card = m) + (ha : 0 < a) (hb : 0 < b) (hka : 2 * k ≤ a) (hmb : 2 * m ≤ b) + (shift : Source V U a b → P → J) + (hdisjoint : ∀ i p q, p ≠ q → shift i p = shift i q → + mass s z i p = 0 ∨ mass s z i q = 0) : + let A := pathShiftMatrix shift (fun i p => (Real.sqrt (mass s z i p) : ℂ)) + (Fintype.card (Source V U a b) : ℝ) * Fintype.card P * + mean a (Fintype.card V) b (Fintype.card U) k m * + Real.exp (-loss a (Fintype.card V) b (Fintype.card U) k m) ≤ + (A.conjTranspose * A).trace.re := by + dsimp only + rw [complex_path_first_trace_sqrt shift (mass s z) (mass_nonneg s z) hdisjoint] + exact sum_mass_lower s z hs hz ha hb hka hmb + +end Problem335.FirstMoment + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FirstTraceNonnegative.lean b/lean/OAI/Algebra/DepthFive/FirstTraceNonnegative.lean new file mode 100644 index 0000000000000000000000000000000000000000..6bf58010bc2161820ad76f3bf3b73f92a6cfdcca --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FirstTraceNonnegative.lean @@ -0,0 +1,74 @@ +import OAI.Algebra.DepthFive.TraceComplexification + +namespace OAI + +noncomputable section +open scoped BigOperators Matrix + +namespace Problem335 + +variable {I J P : Type*} [Fintype I] [Fintype J] [Fintype P] + [DecidableEq I] [DecidableEq J] + +/-- Nonnegative path coefficients suffice for a first-moment lower bound. +Unlike the exact identity, this does not require disjoint path shifts. -/ +theorem pathShiftMatrix_first_trace_lower + (shift : I → P → J) (weight : I → P → ℝ) + (hw : ∀ i p, 0 ≤ weight i p) : + (∑ i, ∑ p, weight i p ^ 2) ≤ + Matrix.trace ((pathShiftMatrix shift weight).transpose * + pathShiftMatrix shift weight) := by + classical + simp only [Matrix.trace, Matrix.diag_apply, pathShiftMatrix_gram_apply] + apply Finset.sum_le_sum + intro i hi + apply Finset.sum_le_sum + intro p hp + have h := Finset.single_le_sum + (fun q (_ : q ∈ (Finset.univ : Finset P)) => + show 0 ≤ (if shift i p = shift i q then weight i p * weight i q else 0) from + by split_ifs + · exact mul_nonneg (hw i p) (hw i q) + · exact le_rfl) + (Finset.mem_univ p) + simpa only [ite_true, pow_two] using h + +/-- Real nonnegative path coefficients give the same lower bound in the +genuine complex Gram trace. -/ +theorem complex_path_first_trace_lower_nonnegative + (shift : I → P → J) (weight : I → P → ℝ) + (hw : ∀ i p, 0 ≤ weight i p) : + let A := pathShiftMatrix shift (fun i p => (weight i p : ℂ)) + (∑ i, ∑ p, weight i p ^ 2) ≤ (A.conjTranspose * A).trace.re := by + dsimp + rw [← pathShiftMatrix_complexify, complexify_first_trace] + exact pathShiftMatrix_first_trace_lower shift weight hw + +/-- A uniform source-average path-mass lower bound gives the expected +dimension times path-count lower bound for the complex first trace. -/ +theorem complex_path_first_trace_lower_of_average [Nonempty I] + (shift : I → P → J) (weight : I → P → ℝ) (L : ℝ) + (hw : ∀ i p, 0 ≤ weight i p) + (hmean : ∀ p, L ≤ (∑ i, weight i p ^ 2) / (Fintype.card I : ℝ)) : + let A := pathShiftMatrix shift (fun i p => (weight i p : ℂ)) + (Fintype.card I : ℝ) * (Fintype.card P : ℝ) * L ≤ + (A.conjTranspose * A).trace.re := by + dsimp + have hcard : (0 : ℝ) < Fintype.card I := by + exact_mod_cast Fintype.card_pos + have hsum : ∀ p, (Fintype.card I : ℝ) * L ≤ ∑ i, weight i p ^ 2 := by + intro p + simpa only [mul_comm] using (le_div_iff₀ hcard).mp (hmean p) + calc + (Fintype.card I : ℝ) * (Fintype.card P : ℝ) * L = + ∑ p : P, (Fintype.card I : ℝ) * L := by simp; ring + _ ≤ ∑ p : P, ∑ i : I, weight i p ^ 2 := + Finset.sum_le_sum (fun p _ => hsum p) + _ = ∑ i : I, ∑ p : P, weight i p ^ 2 := Finset.sum_comm + _ ≤ _ := complex_path_first_trace_lower_nonnegative shift weight hw + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FockBidegreeBasis.lean b/lean/OAI/Algebra/DepthFive/FockBidegreeBasis.lean new file mode 100644 index 0000000000000000000000000000000000000000..58df45576feea8a07937ddce114665a31951931f --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FockBidegreeBasis.lean @@ -0,0 +1,119 @@ +import OAI.Algebra.DepthFive.BidegreeBasis +import OAI.Algebra.DepthFive.FockMonomials +import OAI.Algebra.DepthFive.MatrixNormalization + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335 + +variable {σ : Type*} + +/-- Exponent vectors at a fixed derivative/multiplication bidegree. -/ +abbrev BidegreeIndex (isV : σ → Bool) (a b : ℕ) := + {d : σ →₀ ℕ // Finsupp.weight (bidegreeWeight isV) d = (a, b)} + +section Normalized + +variable [Fintype σ] + +/-- The real factorial-normalized monomial basis at fixed bidegree. -/ +def bidegreeFockBasis (isV : σ → Bool) (a b : ℕ) : + Module.Basis (BidegreeIndex isV a b) ℝ (bidegreeSubmodule (K := ℝ) isV a b) := + (bidegreeMonomialBasis ℝ isV a b).isUnitSMul + (fun d => IsUnit.mk0 (Real.sqrt (multiFactorial d.1 : ℝ))⁻¹ + (inv_ne_zero (sqrt_multiFactorial_pos d.1).ne')) + +@[simp] theorem bidegreeFockBasis_apply (isV : σ → Bool) (a b : ℕ) + (d : BidegreeIndex isV a b) : + ((bidegreeFockBasis isV a b d : bidegreeSubmodule (K := ℝ) isV a b) : + MvPolynomial σ ℝ) = fockMonomial d.1 := by + simp [bidegreeFockBasis, Module.Basis.isUnitSMul_apply, + bidegreeMonomialBasis_apply, fockMonomial, MvPolynomial.smul_monomial] + +@[simp] theorem bidegreeFockBasis_repr (isV : σ → Bool) (a b : ℕ) + (p : bidegreeSubmodule (K := ℝ) isV a b) (d : BidegreeIndex isV a b) : + (bidegreeFockBasis isV a b).repr p d = + Real.sqrt (multiFactorial d.1 : ℝ) * p.1.coeff d.1 := by + simp only [bidegreeFockBasis, Module.Basis.repr_isUnitSMul, Units.smul_def, + IsUnit.unit_spec, Units.val_inv_eq_inv_val, inv_inv, bidegreeMonomialBasis_repr, + smul_eq_mul] + +/-- The complex factorial-normalized monomial basis at fixed bidegree. -/ +def bidegreeComplexFockBasis (isV : σ → Bool) (a b : ℕ) : + Module.Basis (BidegreeIndex isV a b) ℂ (bidegreeSubmodule (K := ℂ) isV a b) := + (bidegreeMonomialBasis ℂ isV a b).isUnitSMul + (fun d => IsUnit.mk0 (((Real.sqrt (multiFactorial d.1 : ℝ))⁻¹ : ℝ) : ℂ) + (Complex.ofReal_ne_zero.mpr (inv_ne_zero (sqrt_multiFactorial_pos d.1).ne'))) + +@[simp] theorem bidegreeComplexFockBasis_apply (isV : σ → Bool) (a b : ℕ) + (d : BidegreeIndex isV a b) : + ((bidegreeComplexFockBasis isV a b d : bidegreeSubmodule (K := ℂ) isV a b) : + MvPolynomial σ ℂ) = complexFockMonomial d.1 := by + simp [bidegreeComplexFockBasis, Module.Basis.isUnitSMul_apply, + bidegreeMonomialBasis_apply, complexFockMonomial_eq, MvPolynomial.smul_monomial] + +@[simp] theorem bidegreeComplexFockBasis_repr (isV : σ → Bool) (a b : ℕ) + (p : bidegreeSubmodule (K := ℂ) isV a b) (d : BidegreeIndex isV a b) : + (bidegreeComplexFockBasis isV a b).repr p d = + (Real.sqrt (multiFactorial d.1 : ℝ) : ℂ) * p.1.coeff d.1 := by + simp only [bidegreeComplexFockBasis, Module.Basis.repr_isUnitSMul, Units.smul_def, + IsUnit.unit_spec, Units.val_inv_eq_inv_val, Complex.ofReal_inv, inv_inv, + bidegreeMonomialBasis_repr, smul_eq_mul] + +variable [DecidableEq σ] + +/-- The finite Fock-basis matrix is precisely the square-root diagonal +normalization of the ordinary monomial-basis matrix. -/ +theorem toMatrix_bidegreeComplexFockBasis_apply (isV : σ → Bool) + (a b c d : ℕ) + (f : bidegreeSubmodule (K := ℂ) isV a b →ₗ[ℂ] + bidegreeSubmodule (K := ℂ) isV c d) + (i : BidegreeIndex isV c d) (j : BidegreeIndex isV a b) : + LinearMap.toMatrix (bidegreeComplexFockBasis isV a b) + (bidegreeComplexFockBasis isV c d) f i j = + (Real.sqrt (multiFactorial i.1 : ℝ) : ℂ) * + LinearMap.toMatrix (bidegreeMonomialBasis ℂ isV a b) + (bidegreeMonomialBasis ℂ isV c d) f i j / + (Real.sqrt (multiFactorial j.1 : ℝ) : ℂ) := by + classical + rw [LinearMap.toMatrix_apply, bidegreeComplexFockBasis_repr] + simp only [bidegreeComplexFockBasis, Module.Basis.isUnitSMul_apply, map_smul, + SetLike.val_smul, MvPolynomial.coeff_smul, smul_eq_mul, + LinearMap.toMatrix_apply, bidegreeMonomialBasis_repr, Complex.ofReal_inv] + ring + +/-- Finite Fock normalization leaves the rank of the restricted operator unchanged. -/ +theorem rank_toMatrix_bidegreeComplexFockBasis (isV : σ → Bool) + (a b c d : ℕ) + (f : bidegreeSubmodule (K := ℂ) isV a b →ₗ[ℂ] + bidegreeSubmodule (K := ℂ) isV c d) : + (LinearMap.toMatrix (bidegreeComplexFockBasis isV a b) + (bidegreeComplexFockBasis isV c d) f).rank = + (LinearMap.toMatrix (bidegreeMonomialBasis ℂ isV a b) + (bidegreeMonomialBasis ℂ isV c d) f).rank := by + classical + have heq : LinearMap.toMatrix (bidegreeComplexFockBasis isV a b) + (bidegreeComplexFockBasis isV c d) f = + fun i j => (Real.sqrt (multiFactorial i.1 : ℝ) : ℂ) * + LinearMap.toMatrix (bidegreeMonomialBasis ℂ isV a b) + (bidegreeMonomialBasis ℂ isV c d) f i j / + (Real.sqrt (multiFactorial j.1 : ℝ) : ℂ) := by + ext i j + exact toMatrix_bidegreeComplexFockBasis_apply isV a b c d f i j + rw [heq] + apply rank_sqrt_normalization + · intro i + exact_mod_cast multiFactorial_pos i.1 + · intro j + exact_mod_cast multiFactorial_pos j.1 + +end Normalized + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FockLayerProfile.lean b/lean/OAI/Algebra/DepthFive/FockLayerProfile.lean new file mode 100644 index 0000000000000000000000000000000000000000..ab8cf09a8178302bebe3bb6edd4c0f16f21abb73 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FockLayerProfile.lean @@ -0,0 +1,177 @@ +import OAI.Algebra.DepthFive.FockPaths +import OAI.Algebra.DepthFive.PathInjectivity +import OAI.Algebra.DepthFive.LayeredFourPath +import OAI.Algebra.DepthFive.ImmFockMatrix + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Problem335 +namespace FockLayerProfile + +variable {ι : Type*} {n : ℕ} + +/-- Read a signed exponent by its layer and matrix-entry coordinates. -/ +def currySigned : ((Fin n × ι × ι) →₀ ℤ) →+ (Fin n → ι × ι → ℤ) where + toFun f t x := f (t, x) + map_zero' := rfl + map_add' _ _ := rfl + +lemma currySigned_injective : Function.Injective (currySigned (n := n) (ι := ι)) := by + intro f g h + ext e + exact congrFun (congrFun h e.1) e.2 + +@[simp] lemma currySigned_signedOccupation (d : (Fin n × ι × ι) →₀ ℕ) : + currySigned (Problem335.signedOccupation d) = + LayeredFourPath.signedOccupation (fun t x => d (t, x)) := rfl + +/-- The list-path coefficient is exactly the coefficient of its layer profile. -/ +theorem pathAmplitude_eq_layered (side : Fin n → Bool) + (p : List (Fin n × ι × ι)) (hp : p.map Prod.fst = List.finRange n) + (d : (Fin n × ι × ι) →₀ ℕ) : + (p.map (occupationAmplitude (fun e => side e.1) d)).prod = + LayeredFourPath.amplitude side (fun t x => d (t, x)) (edgeProfile p hp) := by + conv_lhs => rw [edgeList_eq_ofFn_profile p hp, List.map_ofFn, Fin.prod_ofFn] + rfl + +/-- Signed list shifts and signed layer-profile shifts have identical coordinates. -/ +theorem occupationShift_eq_layered [DecidableEq ι] (side : Fin n → Bool) + (p : List (Fin n × ι × ι)) (hp : p.map Prod.fst = List.finRange n) : + currySigned (occupationShift (fun e => side e.1) p) = + LayeredFourPath.signedShift side (edgeProfile p hp) := by + ext t x + rcases x with ⟨a, b⟩ + change occupationShift (fun e => side e.1) p (t, a, b) = _ + have heq : occupationShift (fun e => side e.1) p = edgeListShift side p := + (edgeListShift_eq_sum side p).symm + rw [heq, edgeListShift_apply_profile side p hp] + simp only [LayeredFourPath.signedShift, Finsupp.single_apply, mul_ite, mul_one, mul_zero] + +/-- Changing from finitely supported signed occupations to layer coordinates +preserves zero extension, including arguments outside the finite source. -/ +theorem zeroExtend_eq_layered {I : Type*} + (d : I → (Fin n × ι × ι) →₀ ℕ) (hd : Function.Injective d) + (w : I → ℝ) (x : (Fin n × ι × ι) →₀ ℤ) : + Function.extend (fun i => Problem335.signedOccupation (d i)) w (fun _ => 0) x = + Function.extend (fun i => LayeredFourPath.signedOccupation (fun t y => d i (t, y))) + w (fun _ => 0) (currySigned x) := by + classical + have hi : Function.Injective (fun i => Problem335.signedOccupation (d i)) := + Problem335.signedOccupation_injective.comp hd + have hc : Function.Injective (fun i => + LayeredFourPath.signedOccupation (fun t y => d i (t, y))) := + currySigned_injective.comp hi + by_cases hx : ∃ i, Problem335.signedOccupation (d i) = x + · obtain ⟨i, rfl⟩ := hx + rw [hi.extend_apply, currySigned_signedOccupation, hc.extend_apply] + · rw [Function.extend_apply' _ _ _ hx, Function.extend_apply'] + rintro ⟨i, h⟩ + exact hx ⟨i, currySigned_injective h⟩ + +/-- The exact list-path four-amplitude summand is bounded by the local table +of its layer profiles. No closure assumption for the shifted source is needed. -/ +theorem zeroExtended_pathAmplitude_four_le_local_product + {I : Type*} [DecidableEq ι] (side : Fin n → Bool) + (d : I → (Fin n × ι × ι) →₀ ℕ) (hd : Function.Injective d) (i : I) + (p q r s : List (Fin n × ι × ι)) + (hp : p.map Prod.fst = List.finRange n) + (hq : q.map Prod.fst = List.finRange n) + (hr : r.map Prod.fst = List.finRange n) + (hs : s.map Prod.fst = List.finRange n) + (hmatch : occupationShift (fun e => side e.1) p - occupationShift (fun e => side e.1) q = + occupationShift (fun e => side e.1) r - occupationShift (fun e => side e.1) s) : + (p.map (occupationAmplitude (fun e => side e.1) (d i))).prod * + Function.extend (fun k => Problem335.signedOccupation (d k)) + (fun k => (q.map (occupationAmplitude (fun e => side e.1) (d k))).prod) + (fun _ => 0) (Problem335.signedOccupation (d i) + + occupationShift (fun e => side e.1) p - occupationShift (fun e => side e.1) q) * + (r.map (occupationAmplitude (fun e => side e.1) (d i))).prod * + Function.extend (fun k => Problem335.signedOccupation (d k)) + (fun k => (s.map (occupationAmplitude (fun e => side e.1) (d k))).prod) + (fun _ => 0) (Problem335.signedOccupation (d i) + + occupationShift (fun e => side e.1) p - occupationShift (fun e => side e.1) q) ≤ + ∏ t, LocalMoments.localPolynomial (side t) (fun x => d i (t, x)) + (edgeProfile p hp t) (edgeProfile q hq t) (edgeProfile r hr t) := by + have hinj : Function.Injective (fun k => + LayeredFourPath.signedOccupation (fun t x => d k (t, x))) := + currySigned_injective.comp (Problem335.signedOccupation_injective.comp hd) + have hmatch' := congrArg (currySigned (n := n) (ι := ι)) hmatch + simp only [map_sub, occupationShift_eq_layered side p hp, + occupationShift_eq_layered side q hq, occupationShift_eq_layered side r hr, + occupationShift_eq_layered side s hs] at hmatch' + have h := LayeredFourPath.zeroExtended_amplitude_four_le_local_product side + (fun k t x => d k (t, x)) hinj i + (edgeProfile p hp) (edgeProfile q hq) (edgeProfile r hr) (edgeProfile s hs) hmatch' + simp_rw [pathAmplitude_eq_layered side p hp, pathAmplitude_eq_layered side q hq, + pathAmplitude_eq_layered side r hr, pathAmplitude_eq_layered side s hs] + rw [zeroExtend_eq_layered d hd, zeroExtend_eq_layered d hd] + simpa only [map_sub, map_add, currySigned_signedOccupation, + occupationShift_eq_layered side p hp, occupationShift_eq_layered side q hq] using h + +/-- Profile reconstruction simplifies on an explicitly layer-indexed edge list. -/ +@[simp] theorem edgeProfile_ofFn (f : Fin n → ι × ι) + (h : (List.ofFn (fun t => (t, f t))).map Prod.fst = List.finRange n) : + edgeProfile (List.ofFn (fun t => (t, f t))) h = f := by + funext t + simp [edgeProfile] + +/-- Reindexing an IMM path by its internal vertices also reindexes its layer profile. -/ +@[simp] theorem edgeProfile_immInternalPathEdges (d : ℕ) (p : Fin d → Fin (d + 1)) + (h : (immInternalPathEdges d p).map Prod.fst = List.finRange (d + 1)) : + edgeProfile (immInternalPathEdges d p) h = + fun t => (Fin.cons (α := fun _ => Fin (d + 1)) 0 p t, + Fin.snoc (α := fun _ => Fin (d + 1)) p 0 t) := by + exact edgeProfile_ofFn _ h + +/-- The canonical layer profile of a list-indexed IMM path. -/ +def immProfile (n : ℕ) (hn : 0 < n) (p : Fin (immPaths n hn).length) : + Fin n → Fin n × Fin n := + edgeProfile ((immPaths n hn).get p) + (immPaths_labels n hn _ (List.get_mem _ p)) + +theorem immPathAmplitude_eq_layered (n : ℕ) (hn : 0 < n) (side : Fin n → Bool) + (d : (Fin n × Fin n × Fin n) →₀ ℕ) (p : Fin (immPaths n hn).length) : + immPathAmplitude n hn (fun e => side e.1) d p = + LayeredFourPath.amplitude side (fun t x => d (t, x)) (immProfile n hn p) := + pathAmplitude_eq_layered side _ (immPaths_labels n hn _ (List.get_mem _ p)) d + +/-- The actual IMM list-path summand, with the second source zero-extended, +is bounded by its layerwise occupation table. -/ +theorem imm_zeroExtended_amplitude_four_le_local_product + {I : Type*} (n : ℕ) (hn : 0 < n) (side : Fin n → Bool) + (d : I → (Fin n × Fin n × Fin n) →₀ ℕ) (hd : Function.Injective d) (i : I) + (p q r s : Fin (immPaths n hn).length) + (hmatch : occupationShift (fun e => side e.1) ((immPaths n hn).get p) - + occupationShift (fun e => side e.1) ((immPaths n hn).get q) = + occupationShift (fun e => side e.1) ((immPaths n hn).get r) - + occupationShift (fun e => side e.1) ((immPaths n hn).get s)) : + immPathAmplitude n hn (fun e => side e.1) (d i) p * + Function.extend (fun k => Problem335.signedOccupation (d k)) + (fun k => immPathAmplitude n hn (fun e => side e.1) (d k) q) (fun _ => 0) + (Problem335.signedOccupation (d i) + + occupationShift (fun e => side e.1) ((immPaths n hn).get p) - + occupationShift (fun e => side e.1) ((immPaths n hn).get q)) * + immPathAmplitude n hn (fun e => side e.1) (d i) r * + Function.extend (fun k => Problem335.signedOccupation (d k)) + (fun k => immPathAmplitude n hn (fun e => side e.1) (d k) s) (fun _ => 0) + (Problem335.signedOccupation (d i) + + occupationShift (fun e => side e.1) ((immPaths n hn).get p) - + occupationShift (fun e => side e.1) ((immPaths n hn).get q)) ≤ + ∏ t, LocalMoments.localPolynomial (side t) (fun x => d i (t, x)) + (immProfile n hn p t) (immProfile n hn q t) (immProfile n hn r t) := by + exact zeroExtended_pathAmplitude_four_le_local_product side d hd i + ((immPaths n hn).get p) ((immPaths n hn).get q) + ((immPaths n hn).get r) ((immPaths n hn).get s) + (immPaths_labels n hn _ (List.get_mem _ p)) + (immPaths_labels n hn _ (List.get_mem _ q)) + (immPaths_labels n hn _ (List.get_mem _ r)) + (immPaths_labels n hn _ (List.get_mem _ s)) hmatch + +end FockLayerProfile +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FockMonomials.lean b/lean/OAI/Algebra/DepthFive/FockMonomials.lean new file mode 100644 index 0000000000000000000000000000000000000000..4fbff3d42717f45de82ce32d726669206c682f93 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FockMonomials.lean @@ -0,0 +1,149 @@ +import Mathlib + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Problem335 + +variable {σ : Type*} [Fintype σ] [DecidableEq σ] + +/-- The product of coordinate factorials of an exponent vector. -/ +def multiFactorial (d : σ →₀ ℕ) : ℕ := ∏ i, (d i).factorial + +omit [DecidableEq σ] in +lemma multiFactorial_pos (d : σ →₀ ℕ) : 0 < multiFactorial d := by + exact Finset.prod_pos (fun i _ => Nat.factorial_pos (d i)) + +lemma multiFactorial_add_single (d : σ →₀ ℕ) (i : σ) : + multiFactorial (d + Finsupp.single i 1) = (d i + 1) * multiFactorial d := by + unfold multiFactorial + calc + ∏ j, ((d + Finsupp.single i 1 : σ →₀ ℕ) j).factorial = + ∏ j, (if i = j then d i + 1 else 1) * (d j).factorial := by + apply Finset.prod_congr rfl + intro j _ + by_cases h : i = j + · subst j + simp [Nat.factorial_succ] + · simp [h] + _ = (d i + 1) * ∏ j, (d j).factorial := by + rw [Finset.prod_mul_distrib] + simp + +/-- A factorial-normalized real monomial, the algebraic part of the +Bargmann--Fock basis used in the moment calculation. -/ +def fockMonomial (d : σ →₀ ℕ) : MvPolynomial σ ℝ := + MvPolynomial.monomial d (Real.sqrt (multiFactorial d : ℝ))⁻¹ + +omit [DecidableEq σ] in +lemma sqrt_multiFactorial_pos (d : σ →₀ ℕ) : + 0 < Real.sqrt (multiFactorial d : ℝ) := by + exact Real.sqrt_pos.2 (by exact_mod_cast multiFactorial_pos d) + +lemma sqrt_multiFactorial_add_single (d : σ →₀ ℕ) (i : σ) : + Real.sqrt (multiFactorial (d + Finsupp.single i 1) : ℝ) = + Real.sqrt ((d i : ℝ) + 1) * Real.sqrt (multiFactorial d : ℝ) := by + rw [multiFactorial_add_single, Nat.cast_mul, Nat.cast_add, Nat.cast_one, + Real.sqrt_mul (by positivity)] + +lemma X_mul_fockMonomial (d : σ →₀ ℕ) (i : σ) : + MvPolynomial.X i * fockMonomial d = + Real.sqrt ((d i : ℝ) + 1) • fockMonomial (d + Finsupp.single i 1) := by + rw [fockMonomial, fockMonomial, MvPolynomial.X, MvPolynomial.monomial_mul_monomial, + MvPolynomial.smul_monomial] + rw [add_comm (Finsupp.single i 1) d] + congr 1 + rw [one_mul, smul_eq_mul, sqrt_multiFactorial_add_single] + have h : Real.sqrt ((d i : ℝ) + 1) ≠ 0 := ne_of_gt (Real.sqrt_pos.2 (by positivity)) + field_simp + +lemma pderiv_fockMonomial_add_single (d : σ →₀ ℕ) (i : σ) : + MvPolynomial.pderiv i (fockMonomial (d + Finsupp.single i 1)) = + Real.sqrt ((d i : ℝ) + 1) • fockMonomial d := by + rw [fockMonomial, fockMonomial, MvPolynomial.pderiv_monomial, + MvPolynomial.smul_monomial] + simp only [add_tsub_cancel_right, Finsupp.add_apply, Finsupp.single_eq_same, + Nat.cast_add, Nat.cast_one, smul_eq_mul] + congr 1 + rw [sqrt_multiFactorial_add_single] + have h₁ := Real.sq_sqrt (show 0 ≤ (d i : ℝ) + 1 by positivity) + have h₂ : Real.sqrt ((d i : ℝ) + 1) ≠ 0 := ne_of_gt (Real.sqrt_pos.2 (by positivity)) + have h₃ := (sqrt_multiFactorial_pos d).ne' + field_simp + nlinarith + +lemma pderiv_fockMonomial (d : σ →₀ ℕ) (i : σ) : + MvPolynomial.pderiv i (fockMonomial d) = + Real.sqrt (d i : ℝ) • fockMonomial (d - Finsupp.single i 1) := by + by_cases h : d i = 0 + · simp [fockMonomial, MvPolynomial.pderiv_monomial, h] + · have hd := Finsupp.sub_add_single_one_cancel h + have hc : ((d - Finsupp.single i 1 : σ →₀ ℕ) i : ℝ) + 1 = (d i : ℝ) := by + have : (d - Finsupp.single i 1 : σ →₀ ℕ) i + 1 = d i := by + simpa using congrArg (fun a : σ →₀ ℕ => a i) hd + exact_mod_cast this + have heq := pderiv_fockMonomial_add_single (σ := σ) (d - Finsupp.single i 1) i + rw [hd, hc] at heq + exact heq + +/-- The normalized monomials form a basis, by rescaling the monomial basis +with nonzero coefficients. -/ +def fockBasis : Module.Basis (σ →₀ ℕ) ℝ (MvPolynomial σ ℝ) := + (MvPolynomial.basisMonomials σ ℝ).isUnitSMul + (fun d => IsUnit.mk0 (Real.sqrt (multiFactorial d : ℝ))⁻¹ + (inv_ne_zero (sqrt_multiFactorial_pos d).ne')) + +omit [DecidableEq σ] in +lemma fockBasis_apply (d : σ →₀ ℕ) : fockBasis d = fockMonomial d := by + simp [fockBasis, Module.Basis.isUnitSMul_apply, fockMonomial, + MvPolynomial.smul_monomial] + +/-- Complex normalized monomials are obtained by coefficient extension. -/ +def complexFockMonomial (d : σ →₀ ℕ) : MvPolynomial σ ℂ := + MvPolynomial.map (algebraMap ℝ ℂ) (fockMonomial d) + +omit [DecidableEq σ] in +lemma complexFockMonomial_eq (d : σ →₀ ℕ) : + complexFockMonomial d = MvPolynomial.monomial d + ((Real.sqrt (multiFactorial d : ℝ))⁻¹ : ℂ) := by + simp [complexFockMonomial, fockMonomial] + +lemma X_mul_complexFockMonomial (d : σ →₀ ℕ) (i : σ) : + MvPolynomial.X i * complexFockMonomial d = + (Real.sqrt ((d i : ℝ) + 1) : ℂ) • complexFockMonomial (d + Finsupp.single i 1) := by + have h := congrArg (MvPolynomial.map (algebraMap ℝ ℂ)) (X_mul_fockMonomial d i) + simpa [complexFockMonomial, fockMonomial, MvPolynomial.smul_monomial] using h + +lemma pderiv_complexFockMonomial (d : σ →₀ ℕ) (i : σ) : + MvPolynomial.pderiv i (complexFockMonomial d) = + (Real.sqrt (d i : ℝ) : ℂ) • complexFockMonomial (d - Finsupp.single i 1) := by + have h := congrArg (MvPolynomial.map (algebraMap ℝ ℂ)) (pderiv_fockMonomial d i) + rw [complexFockMonomial, MvPolynomial.pderiv_map] + simpa [complexFockMonomial, fockMonomial, MvPolynomial.smul_monomial] using h + +/-- Complex version of the normalized monomial basis. -/ +def complexFockBasis : Module.Basis (σ →₀ ℕ) ℂ (MvPolynomial σ ℂ) := + (MvPolynomial.basisMonomials σ ℂ).isUnitSMul + (fun d => IsUnit.mk0 (((Real.sqrt (multiFactorial d : ℝ))⁻¹ : ℝ) : ℂ) + (Complex.ofReal_ne_zero.mpr (inv_ne_zero (sqrt_multiFactorial_pos d).ne'))) + +omit [DecidableEq σ] in +lemma complexFockBasis_apply (d : σ →₀ ℕ) : + complexFockBasis d = complexFockMonomial d := by + simp [complexFockBasis, Module.Basis.isUnitSMul_apply, complexFockMonomial_eq, + MvPolynomial.smul_monomial] + +omit [DecidableEq σ] in +lemma complexFockBasis_repr (p : MvPolynomial σ ℂ) (d : σ →₀ ℕ) : + complexFockBasis.repr p d = + (Real.sqrt (multiFactorial d : ℝ) : ℂ) * p.coeff d := by + simp only [complexFockBasis, Module.Basis.repr_isUnitSMul, Units.smul_def, + IsUnit.unit_spec, Units.val_inv_eq_inv_val, Complex.ofReal_inv, inv_inv] + rfl + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FockPaths.lean b/lean/OAI/Algebra/DepthFive/FockPaths.lean new file mode 100644 index 0000000000000000000000000000000000000000..acc0c9f58f5794a7ba295b63c83134bd341b0f5b --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FockPaths.lean @@ -0,0 +1,183 @@ +import OAI.Algebra.DepthFive.FockMonomials +import OAI.Algebra.DepthFive.MixedOperator + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Problem335 + +variable {σ : Type*} [Fintype σ] [DecidableEq σ] + +/-- Occupation update for one derivative or multiplication variable. Natural +subtraction is harmless when the derivative coefficient vanishes. -/ +def stepOccupation (isV : σ → Bool) (i : σ) (d : σ →₀ ℕ) : σ →₀ ℕ := + if isV i then d - Finsupp.single i 1 else d + Finsupp.single i 1 + +/-- Occupation update for a variable path, in operator-composition order. -/ +def pathOccupation (isV : σ → Bool) (l : List σ) (d : σ →₀ ℕ) : σ →₀ ℕ := + l.foldr (stepOccupation isV) d + +/-- The nonnegative coefficient of one normalized creation/annihilation step. -/ +def occupationAmplitude (isV : σ → Bool) (d : σ →₀ ℕ) (i : σ) : ℝ := + Real.sqrt (if isV i then (d i : ℝ) else (d i : ℝ) + 1) + +omit [Fintype σ] [DecidableEq σ] in +lemma occupationAmplitude_nonneg (isV : σ → Bool) (d : σ →₀ ℕ) (i : σ) : + 0 ≤ occupationAmplitude isV d i := Real.sqrt_nonneg _ + +omit [Fintype σ] [DecidableEq σ] in +lemma stepOccupation_apply_of_ne (isV : σ → Bool) (d : σ →₀ ℕ) + {i j : σ} (h : i ≠ j) : stepOccupation isV i d j = d j := by + cases hi : isV i <;> simp [stepOccupation, hi, h] + +omit [Fintype σ] [DecidableEq σ] in +lemma pathOccupation_apply_of_not_mem (isV : σ → Bool) (l : List σ) + (d : σ →₀ ℕ) {i : σ} (h : i ∉ l) : pathOccupation isV l d i = d i := by + induction l with + | nil => rfl + | cons j l ih => + have hij : j ≠ i := by + intro heq + exact h (by simp [heq]) + have hil : i ∉ l := fun hi => h (List.mem_cons_of_mem _ hi) + change stepOccupation isV j (pathOccupation isV l d) i = d i + rw [stepOccupation_apply_of_ne isV _ hij, ih hil] + +lemma variableOperator_complexFockMonomial (isV : σ → Bool) + (d : σ →₀ ℕ) (i : σ) : + variableOperator isV i (complexFockMonomial d) = + (occupationAmplitude isV d i : ℂ) • complexFockMonomial (stepOccupation isV i d) := by + cases h : isV i + · simpa [occupationAmplitude, stepOccupation, h] using X_mul_complexFockMonomial d i + · simpa [occupationAmplitude, stepOccupation, h] using pderiv_complexFockMonomial d i + +/-- Exact factorial-normalized action of a product of distinct variables. +This is the sparse path-coefficient formula needed for IMM trace moments. -/ +theorem mixedOperator_path_complexFockMonomial (isV : σ → Bool) + (l : List σ) (hl : l.Nodup) (d : σ →₀ ℕ) : + mixedOperator isV ((l.map (MvPolynomial.X : σ → MvPolynomial σ ℂ)).prod) + (complexFockMonomial d) = + (((l.map (occupationAmplitude isV d)).prod : ℝ) : ℂ) • + complexFockMonomial (pathOccupation isV l d) := by + induction l with + | nil => simp [pathOccupation] + | cons i l ih => + obtain ⟨hi, hl⟩ := List.nodup_cons.mp hl + simp only [List.map_cons, List.prod_cons] + rw [mixedOperator_mul_apply, ih hl, map_smul, mixedOperator_X, + variableOperator_complexFockMonomial, smul_smul] + have hc : occupationAmplitude isV (pathOccupation isV l d) i = + occupationAmplitude isV d i := by + unfold occupationAmplitude + rw [pathOccupation_apply_of_not_mem isV l d hi] + rw [hc] + change _ • complexFockMonomial (pathOccupation isV (i :: l) d) = _ + congr 1 + push_cast + ring + +omit [Fintype σ] [DecidableEq σ] in +/-- Squaring the normalized path amplitude gives exactly the occupation +polynomial, with no factorials or square roots left. -/ +theorem pathAmplitude_sq (isV : σ → Bool) (l : List σ) (d : σ →₀ ℕ) : + ((l.map (occupationAmplitude isV d)).prod) ^ 2 = + (l.map (fun i => if isV i then (d i : ℝ) else (d i : ℝ) + 1)).prod := by + induction l with + | nil => simp + | cons i l ih => + simp only [List.map_cons, List.prod_cons, mul_pow, ih] + congr 1 + apply Real.sq_sqrt + cases isV i <;> positivity + +omit [Fintype σ] [DecidableEq σ] in +lemma occupationAmplitude_eq_zero_iff (isV : σ → Bool) (d : σ →₀ ℕ) (i : σ) : + occupationAmplitude isV d i = 0 ↔ isV i = true ∧ d i = 0 := by + cases h : isV i + · have hp : 0 < (d i : ℝ) + 1 := by positivity + simp [occupationAmplitude, h, (Real.sqrt_pos.2 hp).ne'] + · simp [occupationAmplitude, h, Real.sqrt_eq_zero (Nat.cast_nonneg (d i))] + +omit [Fintype σ] [DecidableEq σ] in +lemma pathAmplitude_eq_zero_iff (isV : σ → Bool) (l : List σ) (d : σ →₀ ℕ) : + (l.map (occupationAmplitude isV d)).prod = 0 ↔ + ∃ i ∈ l, isV i = true ∧ d i = 0 := by + simp only [List.prod_eq_zero_iff, List.mem_map, occupationAmplitude_eq_zero_iff] + +/-- An occupation vector viewed as a signed exponent vector. -/ +def signedOccupation (d : σ →₀ ℕ) : σ →₀ ℤ := + d.mapRange (fun n : ℕ => (n : ℤ)) (by simp) + +omit [Fintype σ] [DecidableEq σ] in +@[simp] lemma signedOccupation_apply (d : σ →₀ ℕ) (i : σ) : + signedOccupation d i = (d i : ℤ) := rfl + +omit [Fintype σ] [DecidableEq σ] in +lemma signedOccupation_injective : Function.Injective (signedOccupation (σ := σ)) := by + intro d e h + ext i + have hi := congrArg (fun x : σ →₀ ℤ => x i) h + simp only [signedOccupation_apply] at hi + exact_mod_cast hi + +omit [Fintype σ] [DecidableEq σ] in +@[simp] lemma signedOccupation_eq_iff (d e : σ →₀ ℕ) : + signedOccupation d = signedOccupation e ↔ d = e := + signedOccupation_injective.eq_iff + +/-- The signed shift of a product of variable operators. -/ +def occupationShift (isV : σ → Bool) (l : List σ) : σ →₀ ℤ := + (l.map (fun i => Finsupp.single i (if isV i then (-1 : ℤ) else 1))).sum + +omit [Fintype σ] [DecidableEq σ] in +lemma signedOccupation_step (isV : σ → Bool) (d : σ →₀ ℕ) (i : σ) + (hvalid : isV i = true → 0 < d i) : + signedOccupation (stepOccupation isV i d) = + signedOccupation d + Finsupp.single i (if isV i then (-1 : ℤ) else 1) := by + classical + ext j + by_cases hij : i = j + · subst j + cases hside : isV i + · simp [signedOccupation, stepOccupation, hside] + · have hp := hvalid hside + simp [signedOccupation, stepOccupation, hside] + omega + · cases hside : isV i <;> simp [signedOccupation, stepOccupation, hside, hij] + +omit [Fintype σ] [DecidableEq σ] in +lemma signedOccupation_path_of_valid (isV : σ → Bool) (l : List σ) + (hl : l.Nodup) (d : σ →₀ ℕ) + (hvalid : ∀ i ∈ l, isV i = true → 0 < d i) : + signedOccupation (pathOccupation isV l d) = signedOccupation d + occupationShift isV l := by + induction l with + | nil => simp [pathOccupation, occupationShift] + | cons i l ih => + obtain ⟨hi, hl⟩ := List.nodup_cons.mp hl + have hv : isV i = true → 0 < pathOccupation isV l d i := by + rw [pathOccupation_apply_of_not_mem isV l d hi] + exact hvalid i (by simp) + have htail := ih hl (fun j hj => hvalid j (List.mem_cons_of_mem _ hj)) + change signedOccupation (stepOccupation isV i (pathOccupation isV l d)) = _ + rw [signedOccupation_step isV _ i hv, htail] + simp [occupationShift, add_comm, add_left_comm] + +omit [Fintype σ] [DecidableEq σ] in +/-- A nonzero path amplitude guarantees that natural subtraction agrees with +the signed path shift, including at every intermediate occupation. -/ +theorem signedOccupation_path_of_amplitude_ne_zero (isV : σ → Bool) (l : List σ) + (hl : l.Nodup) (d : σ →₀ ℕ) + (hamp : (l.map (occupationAmplitude isV d)).prod ≠ 0) : + signedOccupation (pathOccupation isV l d) = signedOccupation d + occupationShift isV l := by + apply signedOccupation_path_of_valid isV l hl d + intro i hi hs + by_contra h + have hz : d i = 0 := by omega + exact hamp ((pathAmplitude_eq_zero_iff isV l d).2 ⟨i, hi, hs, hz⟩) + +end Problem335 + +end + +end OAI diff --git a/lean/OAI/Algebra/DepthFive/FourPathLocal.lean b/lean/OAI/Algebra/DepthFive/FourPathLocal.lean new file mode 100644 index 0000000000000000000000000000000000000000..b8f0878709fd3d06ecdc195051e3c3878b0bbfc1 --- /dev/null +++ b/lean/OAI/Algebra/DepthFive/FourPathLocal.lean @@ -0,0 +1,103 @@ +import OAI.Algebra.DepthFive.Pairings +import OAI.Algebra.DepthFive.LocalMomentPolynomials + +namespace OAI + +noncomputable section +open scoped BigOperators + +namespace Problem335 +namespace LocalMoments + +/-- A valid source-occupation shift arising from two paths at a single layer. -/ +def ShiftRelation {σ : Type*} (derivative : Bool) (M M' : σ → ℕ) (p q : σ) : Prop := + ∀ x, (M' x : ℤ) = (M x : ℤ) + (if derivative then -1 else 1) * + ((Finsupp.single p (1 : ℤ) - Finsupp.single q 1 : σ →₀ ℤ) x) + +lemma shiftRelation_normal {σ : Type*} (derivative : Bool) (M M' : σ → ℕ) (p : σ) + (h : ShiftRelation derivative M M' p p) : M' = M := by + funext x + have hx := h x + simp only [sub_self, Finsupp.zero_apply, mul_zero, add_zero] at hx + exact_mod_cast hx + +lemma shiftRelation_derivative {σ : Type*} (M M' : σ → ℕ) (p q : σ) (hpq : p ≠ q) + (h : ShiftRelation true M M' p q) : M' q = M q + 1 := by + classical + have hq := h q + simp [Finsupp.sub_apply, Ne.symm hpq] at hq + omega + +lemma shiftRelation_multiplication {σ : Type*} (M M' : σ → ℕ) (p q : σ) (hpq : p ≠ q) + (h : ShiftRelation false M M' p q) : M' q + 1 = M q := by + classical + have hq := h q + simp [Finsupp.sub_apply, Ne.symm hpq] at hq + omega + +/-- The complete local second-trace polynomial. The all-equal case belongs to normal pairing. -/ +def localPolynomial {σ : Type*} [DecidableEq σ] (derivative : Bool) + (M : σ → ℕ) (p q r : σ) : ℝ := + if p = q then mass derivative (M p) * mass derivative (M r) + else if derivative then (M p : ℝ) * ((M q : ℝ) + 1) + else ((M p : ℝ) + 1) * (M q : ℝ) + +/-- Matching signed coordinate differences and the actual source shift imply precisely + the normal/diagonal local polynomial table from the four-path expansion. -/ +theorem fourCoefficient_eq_localPolynomial {σ : Type*} [DecidableEq σ] + (derivative : Bool) (M M' : σ → ℕ) (p q r s : σ) + (hmatch : Finsupp.single p (1 : ℤ) - Finsupp.single q 1 = + Finsupp.single r 1 - Finsupp.single s 1) + (hshift : ShiftRelation derivative M M' p q) : + fourCoefficient derivative (M p) (M' q) (M r) (M' s) = + localPolynomial derivative M p q r := by + rcases (Pairings.coordinate_difference_eq_iff_exclusive p q r s).mp hmatch with hN | hD + · rcases hN with ⟨hpq, hrs⟩ + subst q + subst s + have hM := shiftRelation_normal derivative M M' p hshift + subst M' + simp [localPolynomial, normal_fourCoefficient] + · rcases hD with ⟨hpr, hqs, hpq⟩ + subst r + subst s + cases derivative + · have hq := shiftRelation_multiplication M M' p q hpq hshift + simpa [localPolynomial, hpq] using + multiplication_diagonal_layer M M' p q hq + · have hq := shiftRelation_derivative M M' p q hpq hshift + simpa [localPolynomial, hpq] using derivative_diagonal_layer M M' p q hq + +lemma localPolynomial_nonneg {σ : Type*} [DecidableEq σ] (derivative : Bool) + (M : σ → ℕ) (p q r : σ) : 0 ≤ localPolynomial derivative M p q r := by + unfold localPolynomial + split_ifs + · exact mul_nonneg (mass_nonneg _ _) (mass_nonneg _ _) + all_goals positivity + +/-- The local table applies simultaneously at all layers, converting the four path +coefficient products into a product of occupation polynomials. -/ +theorem four_path_products_eq_localPolynomial_product {ι σ : Type*} [DecidableEq σ] + (layers : Finset ι) (derivative : ι → Bool) (M M' : ι → σ → ℕ) + (p q r s : ι → σ) + (hmatch : ∀ t ∈ layers, + Finsupp.single (p t) (1 : ℤ) - Finsupp.single (q t) 1 = + Finsupp.single (r t) 1 - Finsupp.single (s t) 1) + (hshift : ∀ t ∈ layers, ShiftRelation (derivative t) (M t) (M' t) (p t) (q t)) : + (∏ t ∈ layers, coefficient (derivative t) (M t (p t))) * + (∏ t ∈ layers, coefficient (derivative t) (M' t (q t))) * + (∏ t ∈ layers, coefficient (derivative t) (M t (r t))) * + (∏ t ∈ layers, coefficient (derivative t) (M' t (s t))) = + ∏ t ∈ layers, localPolynomial (derivative t) (M t) (p t) (q t) (r t) := by + rw [four_products_eq_product] + apply Finset.prod_congr rfl + intro t ht + exact fourCoefficient_eq_localPolynomial (derivative t) (M t) (M' t) + (p t) (q t) (r t) (s t) (hmatch t ht) (hshift t ht) + +end LocalMoments +end Problem335 + +end + +end OAI