import Mathlib import OAI.Combinatorics.Chromatic.Shuffle.PrimitiveOperators import OAI.Combinatorics.Chromatic.Shuffle.OriginalDegree import OAI.Combinatorics.Chromatic.Shuffle.GlobalTensorDetection import OAI.Combinatorics.Chromatic.Walls.UnitalGradeComparison namespace OAI section namespace ElementaryPositivity.RawShuffle open scoped TensorProduct DirectSum open DimensionSplit ElementaryPositivity.SlopeArithmetic variable {I : Type*} [Fintype I] [DecidableEq I] attribute [local instance] Classical.propDecidable variable (a : I → I → ℕ) (c η : I → ℝ) (hc : ∀ i,0(1:ℤ)) (m-1) := by rw [derivativeS_val] exact D_homogeneous _ _ (componentS_homogeneous d m f) rw [componentS_componentS,componentS_of_homogeneous d _ hh] by_cases h : ℓ=m · subst m simp · simp only [ite_eq_right h,ite_eq_right (by omega : ℓ-1≠m-1),map_zero] lemma derivativeB_component (a : I → I → ℕ) (μ : (I → ℕ) → ℝ) (d : I → ℕ) (ℓ : ℤ) (f : B a μ d) : derivativeB a μ d (componentB a μ d ℓ f)=componentB a μ d (ℓ-1) (derivativeB a μ d f) := by induction f using Submodule.Quotient.induction_on with | H f => change derivativeB a μ d (quotientAlg a μ d (componentS d ℓ f))= componentB a μ d (ℓ-1) (derivativeB a μ d (quotientAlg a μ d f)) rw [derivativeB_mk,derivativeB_mk] change quotientAlg a μ d (derivativeS d (componentS d ℓ f))= quotientAlg a μ d (componentS d (ℓ-1) (derivativeS d f)) rw [derivativeS_component] omit [DecidableEq I] in lemma meanS_homogeneous (d : I → ℕ) : (meanS d).val.IsWeightedHomogeneous (fun _=>(1:ℤ)) 1 := by classical apply (weightedHomogeneousSubmodule ℚ (fun _ : (Σ i,Fin (d i))=>(1:ℤ)) 1).smul_mem exact IsWeightedHomogeneous.sum _ _ 1 (fun v _=>isWeightedHomogeneous_X ℚ (fun _=>(1:ℤ)) v) omit [DecidableEq I] in lemma componentS_mean (d : I → ℕ) (ℓ : ℤ) (f : S d) : componentS d (ℓ+1) (meanS d*f)=meanS d*componentS d ℓ f := by apply Subtype.ext change weightedHomogeneousComponent (fun _=>(1:ℤ)) (ℓ+1) ((meanS d).val*f.val)=_ rw [add_comm ℓ 1,Homogeneity.component_mul _ _ (meanS_homogeneous d) ℓ] rfl lemma meanMultiplyB_component (a : I → I → ℕ) (μ : (I → ℕ) → ℝ) (d : I → ℕ) (ℓ : ℤ) (f : B a μ d) : componentB a μ d (ℓ+1) (meanMultiplyB a μ d f)=meanMultiplyB a μ d (componentB a μ d ℓ f) := by induction f using Submodule.Quotient.induction_on with | H f => change componentB a μ d (ℓ+1) (quotientAlg a μ d (meanS d)*quotientAlg a μ d f)= quotientAlg a μ d (meanS d)*quotientAlg a μ d (componentS d ℓ f) rw [←map_mul,←map_mul] change quotientAlg a μ d (componentS d (ℓ+1) (meanS d*f))=_ rw [componentS_mean] variable (a : I → I → ℕ) (c η : I → ℝ) (hc : ∀ i,0 apply congrArg (LinearFiltration.mk (sourceFiltration a c η hc θ d W) (sourceFiltration a c η hc θ d (W+1))) apply Subtype.ext exact derivativeB_component a (SlopeArithmetic.slope c η) d ℓ f.val lemma gradeMeanMultiply_component (d : I → ℕ) (W ℓ : ℤ) (f : SourceAssociatedGrade a c η hc θ d W) : associatedComponent a c η hc θ d W (ℓ+1) (gradeMeanMultiply a c η hc θ d W f)= gradeMeanMultiply a c η hc θ d W (associatedComponent a c η hc θ d W ℓ f) := by induction f using Submodule.Quotient.induction_on with | H f => apply congrArg (LinearFiltration.mk (sourceFiltration a c η hc θ d W) (sourceFiltration a c η hc θ d (W+1))) apply Subtype.ext exact meanMultiplyB_component a (SlopeArithmetic.slope c η) d ℓ f.val end ElementaryPositivity.RawShuffle end section namespace ElementaryPositivity.RawShuffle variable {I : Type*} [Fintype I] [DecidableEq I] attribute [local instance] Classical.propDecidable variable (a : I → I → ℕ) (c η : I → ℝ) (hc : ∀ i,0 simpa only [Nat.cast_zero,add_zero,pow_zero,Module.End.one_apply] using hx | succ n ih => rw [Nat.cast_succ,←add_assoc,pow_succ',Module.End.mul_apply,primitiveMeanMultiply_component,ih] noncomputable def homogeneousPrimitiveStringBasis (hd : d≠0) : Module.Basis (Σ _ : ℕ,StringBaseIndex a c η hc θ hχ d W) ℚ (primitiveSpace a c η hc θ hχ d W) := (Finsupp.basis (fun _ : ℕ=>homogeneousStringBaseBasis a c η hc θ hχ d W)).map (primitiveStringDecomposition a c η hc θ hχ d hd W) lemma homogeneousPrimitiveStringBasis_apply (hd : d≠0) (i : Σ _ : ℕ,StringBaseIndex a c η hc θ hχ d W) : homogeneousPrimitiveStringBasis a c η hc θ hχ d W hd i= (primitiveMeanMultiply a c η hc θ hχ d W^i.1) (homogeneousStringBaseBasis a c η hc θ hχ d W i.2).val := by rw [homogeneousPrimitiveStringBasis,Module.Basis.map_apply,Finsupp.coe_basis] exact PrimitiveStrings.evaluate_single _ _ _ _ lemma homogeneousPrimitiveStringBasis_degree (hd : d≠0) (i : Σ _ : ℕ,StringBaseIndex a c η hc θ hχ d W) : primitiveComponent a c η hc θ hχ d W (stringBaseDegree a c η hc θ hχ d W i.2+i.1) (homogeneousPrimitiveStringBasis a c η hc θ hχ d W hd i)= homogeneousPrimitiveStringBasis a c η hc θ hχ d W hd i := by rw [homogeneousPrimitiveStringBasis_apply] exact primitiveMeanMultiply_pow_component a c η hc θ hχ d W _ _ _ (stringBaseDegree_spec a c η hc θ hχ d W i.2) end ElementaryPositivity.RawShuffle end end OAI