Add lean source and binary files (part 41)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentMapNaturality.leanAdded+25
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentProductNaturality.leanAdded+16
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentPureAction.leanAdded+177
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentRectangularKernel.leanAdded+144
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentRegrade.leanAdded+291
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentRegradeFinite.leanAdded+79
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentRegradePure.leanAdded+62
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentScalarNaturality.leanAdded+26
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentSigns.leanAdded+23
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentUnitSigns.leanAdded+24
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutatedEndpoint.leanAdded+85
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutatedNoCutCone.leanAdded+126
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutatedPureFace.leanAdded+107
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutationCoordinates.leanAdded+89
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutationDegreeBound.leanAdded+89
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutationLaurentTransport.leanAdded+100
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutationOrientedCompatibility.leanAdded+108
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutationRootMap.leanAdded+175
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NilpotentLogarithm.leanAdded+245
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NilpotentSeriesInverse.leanAdded+37
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NoncommExpand.leanAdded+108
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NoncommSeriesCalculus.leanAdded+148
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NonpHomogenize.leanAdded+182
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NonpRegrade.leanAdded+189
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NonpRegradeFaithful.leanAdded+164
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PowerSeriesProductLeading.leanAdded+70
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PowerSeriesSplit.leanAdded+168
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PowerSeriesSplitLeading.leanAdded+164
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/Product.leanAdded+146
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/ProjectionRecursion.leanAdded+41
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PureCoefficient.leanAdded+59
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PureComparisonIdentification.leanAdded+212
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PureFaceLog.leanAdded+114
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PurePolynomialCoefficients.leanAdded+85
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/QuantumTorusAlgebra.leanAdded+51
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/QuantumTorusSignFactors.leanAdded+101
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalCenteredAction.leanAdded+91
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalLaurentFaithful.leanAdded+164
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalLaurentScalars.leanAdded+183
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalPolynomialDivisibility.leanAdded+140
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalPureCoefficients.leanAdded+141
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalRegrade.leanAdded+66
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalShearCocycle.leanAdded+62
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalShearEmbedding.leanAdded+53
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RealRootCoordinates.leanAdded+64
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RegradeLog.leanAdded+133
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RootCoefficientLocality.leanAdded+102
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RootCoefficients.leanAdded+48
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RootMutationInventory.leanAdded+76
- lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RootSectionHalfspace.leanAdded+148
12345678910111213141516171819202122232425import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.LaurentInfinity
namespace OAI
sectionnamespace ElementaryPositivity.LaurentAtInfinityvariable {A B C D : Type*} [CommRing A] [CommRing B] [CommRing C] [CommRing D]lemma mapRing_square (f : A →+* B) (g : C →+* D) (p : A →+* C) (q : B →+* D) (h : ∀ x,q (f x)=g (p x)) (x : LaurentSeries A) : mapRing q (mapRing f x)=mapRing g (mapRing p x) := by apply HahnSeries.ext funext k exact h (x.coeff k)lemma mapUnit_square (f : A →+* B) (g : C →+* D) (p : A →+* C) (q : B →+* D) (h : ∀ x,q (f x)=g (p x)) (x : (LaurentSeries A)ˣ) : Units.map (mapRing q).toMonoidHom (Units.map (mapRing f).toMonoidHom x)= Units.map (mapRing g).toMonoidHom (Units.map (mapRing p).toMonoidHom x) := by apply Units.ext exact mapRing_square f g p q h x.valend ElementaryPositivity.LaurentAtInfinity
end
end OAI12345678910111213141516import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.LaurentInfinity
namespace OAI
sectionnamespace ElementaryPositivity.LaurentAtInfinityvariable {R S : Type*} [CommRing R] [CommRing S]lemma mapRing_mul_polynomial (f : R →+* S) (K : LaurentSeries R) (p : Polynomial R) : mapRing f (K*polynomial p)=mapRing f K*polynomial (p.map f) := by rw [map_mul,polynomial_map]end ElementaryPositivity.LaurentAtInfinity
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177import Mathlibimport OAI.Combinatorics.Chromatic.Walls.QuantumTorusRaySeriesimport OAI.Combinatorics.Chromatic.QuantumTorus.RationalPureActionimport OAI.Combinatorics.Chromatic.Walls.LaurentCompletion
namespace OAI
sectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus WallUnits PowerSeries HahnSeriesnoncomputable sectionvariable {K M : Type*} [Field K] [AddCommGroup M]variable (v : Kˣ) (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0) (p : M)local instance : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGrouplocal instance : NonUnitalSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalSemiringlocal instance : NonUnitalNonAssocSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalNonAssocSemiring
def purePower : PowerSeries K →+* HahnSeries ℤ (Torus v Ω) := (laurentRayHom v Ω p (hΩ p)).comp (HahnSeries.ofPowerSeries ℤ K)lemma purePower_eq (f : PowerSeries K) : purePower v Ω hΩ p f=HahnSeries.ofPowerSeries ℤ (Torus v Ω) (raySeries v Ω p f) := by apply HahnSeries.ext funext n change Torus.monomial v Ω (n • p) ((HahnSeries.ofPowerSeries ℤ K f).coeff n)=_ rcases le_or_gt 0 n with hn|hn · lift n to ℕ using hn with j hj rw [HahnSeries.ofPowerSeries_apply_coeff,HahnSeries.ofPowerSeries_apply_coeff,coeff_raySeries] simp only [natCast_zsmul] · have H : (HahnSeries.ofPowerSeries ℤ K f).coeff n=0 := by rw [HahnSeries.ofPowerSeries_apply] apply HahnSeries.embDomain_of_notMem_range rintro ⟨a,ha⟩ change (a:ℤ)=n at ha omega have H' : (HahnSeries.ofPowerSeries ℤ (Torus v Ω) (raySeries v Ω p f)).coeff n=0 := by rw [HahnSeries.ofPowerSeries_apply] apply HahnSeries.embDomain_of_notMem_range rintro ⟨a,ha⟩ change (a:ℤ)=n at ha omega rw [H,H',Torus.monomial_zero]lemma purePower_commutation (m : M) (f : PowerSeries K) : HahnSeries.single 0 (Torus.X v Ω m)*purePower v Ω hΩ p f= purePower v Ω hΩ p (rescale (↑(v^(-2*Ω p m)):K) f)* HahnSeries.single 0 (Torus.X v Ω m) := by have H:=raySeries_twist v Ω hΩ p m (rescale (↑(v^(-2*Ω p m)):K) f) rw [rescale_rescale,←Units.val_mul,←zpow_add, show -2*Ω p m+2*Ω p m=0 by ring,zpow_zero,Units.val_one,rescale_one] at H have HH:=congrArg (HahnSeries.ofPowerSeries ℤ (Torus v Ω)) H rw [purePower_eq,purePower_eq] simpa only [map_mul,HahnSeries.ofPowerSeries_C,HahnSeries.C_apply,RingHom.id_apply] using HH.symmlemma purePower_scalar_commute (a : RatFunc K) (f : PowerSeries K) : expandScalar v Ω hΩ p a*purePower v Ω hΩ p f= purePower v Ω hΩ p f*expandScalar v Ω hΩ p a := by change (laurentRayHom v Ω p (hΩ p)) (expandZero a)* (laurentRayHom v Ω p (hΩ p)) (HahnSeries.ofPowerSeries ℤ K f)=_ rw [←map_mul,mul_comm,map_mul] rfllemma expandedPure_shifted (hq : ∀n : ℕ,1-(↑(v^(-2:ℤ)):K)^(n+1)≠0) (t : ℤ) : expandScalar v Ω hΩ p (pureRatio v t:RatFunc K)* purePower v Ω hΩ p (shiftedElementary v t)=purePower v Ω hΩ p (shiftedElementary v 0) := by have H:=congrArg (laurentRayHom v Ω p (hΩ p)) (expandedPure_times_shift v hq t) simpa only [map_mul,expandScalar,purePower,RingHom.comp_apply] using H
def pureLaurentUnit : (HahnSeries ℤ (Torus v Ω))ˣ where val:=purePower v Ω hΩ p (shiftedElementary v 0) inv:=purePower v Ω hΩ p (shiftedElementary v 0)⁻¹ val_inv:=by rw [←map_mul,PowerSeries.mul_inv_cancel _ (by rw [shiftedElementary_constant]; exact one_ne_zero),map_one] inv_val:=by rw [←map_mul,PowerSeries.inv_mul_cancel _ (by rw [shiftedElementary_constant]; exact one_ne_zero),map_one]variable (k : M →+ ℤ)lemma expand_pure_intertwine (hq : ∀n : ℕ,1-(↑(v^(-2:ℤ)):K)^(n+1)≠0) (f : FiberTorus v (complementOmega k Ω) (complementAlpha k p Ω)) : expandFiber v Ω hΩ k p (pureAction v (complementOmega k Ω) (complementAlpha k p Ω) f)* (↑(pureLaurentUnit v Ω hΩ p):HahnSeries ℤ (Torus v Ω))= (↑(pureLaurentUnit v Ω hΩ p):HahnSeries ℤ (Torus v Ω))*expandFiber v Ω hΩ k p f := by induction f using Finsupp.induction_linear with | zero=>simp | add f g hf hg=>simp only [map_add,add_mul,mul_add,hf,hg] | single l a=> change expandFiber v Ω hΩ k p (pureAction v _ _ (FiberTorus.monomial v _ _ l a))*_=_ rw [pureAction_monomial] change expandFiberAdd v Ω hΩ k p (FiberTorus.monomial v _ _ l (a*(pureRatio v (Ω p l):RatFunc K)))*_= _*expandFiberAdd v Ω hΩ k p (FiberTorus.monomial v _ _ l a) rw [expandFiberAdd_monomial,expandFiberAdd_monomial] change (expandScalar v Ω hΩ p (a*(pureRatio v (Ω p l):RatFunc K))* HahnSeries.single 0 (Torus.X v Ω l))*purePower v Ω hΩ p (shiftedElementary v 0)= purePower v Ω hΩ p (shiftedElementary v 0)* (expandScalar v Ω hΩ p a*HahnSeries.single 0 (Torus.X v Ω l)) rw [map_mul,mul_assoc,mul_assoc,purePower_commutation] have H : rescale (↑(v^(-2*Ω p l)):K) (shiftedElementary v 0)=shiftedElementary v (Ω p l) := by rw [shiftedElementary_zero] rfl rw [H,←mul_assoc (expandScalar v Ω hΩ p (pureRatio v (Ω p l):RatFunc K)), expandedPure_shifted v Ω hΩ p hq,←mul_assoc,purePower_scalar_commute,mul_assoc]lemma expand_pure_conjugate (hq : ∀n : ℕ,1-(↑(v^(-2:ℤ)):K)^(n+1)≠0) (f : FiberTorus v (complementOmega k Ω) (complementAlpha k p Ω)) : expandFiber v Ω hΩ k p (pureAction v (complementOmega k Ω) (complementAlpha k p Ω) f)= innerHom (pureLaurentUnit v Ω hΩ p) (expandFiber v Ω hΩ k p f) := by have H:=congrArg (fun x : HahnSeries ℤ (Torus v Ω)=>x*↑((pureLaurentUnit v Ω hΩ p)⁻¹)) (expand_pure_intertwine v Ω hΩ p k hq f) have hu : (↑(pureLaurentUnit v Ω hΩ p):HahnSeries ℤ (Torus v Ω))*↑((pureLaurentUnit v Ω hΩ p)⁻¹)=1 := (pureLaurentUnit v Ω hΩ p).val_inv change _=(↑(pureLaurentUnit v Ω hΩ p):HahnSeries ℤ (Torus v Ω))* expandFiber v Ω hΩ k p f*↑((pureLaurentUnit v Ω hΩ p)⁻¹) simpa only [mul_assoc,hu,mul_one] using Hendend ElementaryPositivity.RationalFiber
endsectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus WallUnits PowerSeries HahnSeriesnoncomputable sectionvariable {K M : Type*} [Field K] [AddCommGroup M]variable (v : Kˣ) (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (δ κ : M →+ ℤ) (p : M) (hδ : δ p=0) (hκ : κ p=1)local instance : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGrouplocal instance : NonUnitalSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalSemiringlocal instance : NonUnitalNonAssocSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalNonAssocSemiringinclude hδ hκ inlemma pure_biSupported (f : PowerSeries K) : BiSupported v Ω δ κ (raySeries v Ω p f) := by intro n m hm rw [coeff_raySeries] at hm have he : m=n • p := by by_contra H exact hm (Finsupp.single_eq_of_ne H) subst m simp only [map_nsmul,hδ,hκ,nsmul_eq_mul,mul_one] exact ⟨le_rfl,Int.natCast_nonneg _,by omega⟩include hδ hκ inlemma biRegrade_pure (f : PowerSeries K) : biRegrade v Ω δ κ (raySeries v Ω p f)=PowerSeries.C (raySeries v Ω p f) := by apply PowerSeries.ext intro d apply PowerSeries.ext intro e rw [biRegrade_coeff,coeff_raySeries,biHomogenize_monomial] simp only [map_nsmul,hδ,hκ,nsmul_eq_mul,mul_one, Int.toNat_natCast,coeff_monomial] by_cases hd : d=0 · subst d simp [coeff_C,coeff_raySeries] · simp [coeff_C,hd]include hδ hκ inlemma oldLaurent_pure (f : PowerSeries K) : oldLaurent v Ω δ κ (raySeries v Ω p f)=PowerSeries.C (purePower v Ω hΩ p f) := by rw [oldLaurent,biRegrade_pure v Ω δ κ p hδ hκ,PowerSeries.map_C,purePower_eq]include hδ hκ inlemma oldLaurent_pure_unit : oldLaurent v Ω δ κ (rayUnit v Ω p (hΩ p) (shiftedElementary v 0) (shiftedElementary_constant v 0)).val= PowerSeries.C (↑(pureLaurentUnit v Ω hΩ p):HahnSeries ℤ (Torus v Ω)) := oldLaurent_pure v Ω hΩ δ κ p hδ hκ _include hδ hκ inlemma oldLaurent_pure_inverse : oldLaurent v Ω δ κ (rayUnit v Ω p (hΩ p) (shiftedElementary v 0) (shiftedElementary_constant v 0)).inv= PowerSeries.C (↑((pureLaurentUnit v Ω hΩ p)⁻¹):HahnSeries ℤ (Torus v Ω)) := oldLaurent_pure v Ω hΩ δ κ p hδ hκ _endend ElementaryPositivity.RationalFiber
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144import Mathlib
namespace OAI
sectionnamespace ElementaryPositivity.RectangularKernelvariable {I : Type*} [Fintype I]variable {G : Type*} [CommGroup G]
noncomputable def rectangular {L R : I → Type*} [∀ i,Fintype (L i)] [∀ i,Fintype (R i)] (b : I → I → ℤ) (v : ∀ i j,L i → R j → G) : G := ∏ i,∏ j,∏ x : L i,∏ y : R j,v i j x y ^ b i j
lemma rectangular_add {L R : I → Type*} [∀ i,Fintype (L i)] [∀ i,Fintype (R i)] (b c : I → I → ℤ) (v : ∀ i j,L i → R j → G) : rectangular (b+c) v=rectangular b v*rectangular c v := by simp only [rectangular,Pi.add_apply,zpow_add,Finset.prod_mul_distrib]
lemma rectangular_neg {L R : I → Type*} [∀ i,Fintype (L i)] [∀ i,Fintype (R i)] (b : I → I → ℤ) (v : ∀ i j,L i → R j → G) : rectangular (-b) v=(rectangular b v)⁻¹ := by simp only [rectangular,Pi.neg_apply,zpow_neg,Finset.prod_inv_distrib]
lemma rectangular_sub {L R : I → Type*} [∀ i,Fintype (L i)] [∀ i,Fintype (R i)] (b c : I → I → ℤ) (v : ∀ i j,L i → R j → G) : rectangular (b-c) v=rectangular b v*(rectangular c v)⁻¹ := by rw [sub_eq_add_neg,rectangular_add,rectangular_neg]
lemma rectangular_map {H : Type*} [CommGroup H] (f : G →* H) {L R : I → Type*} [∀ i,Fintype (L i)] [∀ i,Fintype (R i)] (b : I → I → ℤ) (v : ∀ i j,L i → R j → G) : f (rectangular b v)=rectangular b (fun i j x y=>f (v i j x y)) := by simp only [rectangular,map_prod,map_zpow]
lemma rectangular_transpose {L R : I → Type*} [∀ i,Fintype (L i)] [∀ i,Fintype (R i)] (b : I → I → ℤ) (v : ∀ i j,L i → R j → G) : rectangular (fun i j=>b j i) (fun i j (x:R i) (y:L j)=>v j i y x)= rectangular b v := by unfold rectangular rw [Finset.prod_comm] apply Finset.prod_congr rfl intro i hi apply Finset.prod_congr rfl intro j hj exact Finset.prod_comm
lemma rectangular_sum {L₁ L₂ R₁ R₂ : I → Type*} [∀ i,Fintype (L₁ i)] [∀ i,Fintype (L₂ i)] [∀ i,Fintype (R₁ i)] [∀ i,Fintype (R₂ i)] (b : I → I → ℤ) (v : ∀ i j,(L₁ i⊕L₂ i) → (R₁ j⊕R₂ j) → G) : rectangular b v= rectangular b (fun i j x y=>v i j (Sum.inl x) (Sum.inl y))* rectangular b (fun i j x y=>v i j (Sum.inl x) (Sum.inr y))* rectangular b (fun i j x y=>v i j (Sum.inr x) (Sum.inl y))* rectangular b (fun i j x y=>v i j (Sum.inr x) (Sum.inr y)) := by simp only [rectangular,Fintype.prod_sum_type,Finset.prod_mul_distrib] ac_rfl
lemma rectangular_diagonal [DecidableEq I] {L R : I → Type*} [∀ i,Fintype (L i)] [∀ i,Fintype (R i)] (v : ∀ i j,L i → R j → G) : rectangular (fun i j=>if i=j then 1 else 0) v= ∏ i,∏ x:L i,∏ y:R i,v i i x y := by unfold rectangular apply Finset.prod_congr rfl intro i hi rw [Finset.prod_eq_single i] · simp · intro j hj hji simp [Ne.symm hji] · simp
lemma four_rectangle_cancellation {L₁ L₂ R₁ R₂ : I → Type*} [∀ i,Fintype (L₁ i)] [∀ i,Fintype (L₂ i)] [∀ i,Fintype (R₁ i)] [∀ i,Fintype (R₂ i)] (δ a : I → I → ℤ) (v : ∀ i j,(L₁ i⊕L₂ i) → (R₁ j⊕R₂ j) → G) : rectangular (δ-a) v * (rectangular δ v)⁻¹ * (rectangular δ (fun i j x y=>v i j (Sum.inl x) (Sum.inl y))* rectangular δ (fun i j x y=>v i j (Sum.inr x) (Sum.inr y))* rectangular a (fun i j x y=>v i j (Sum.inl x) (Sum.inr y))* rectangular (fun i j=>a j i) (fun i j x y=>v i j (Sum.inr x) (Sum.inl y))) = rectangular (δ-a) (fun i j x y=>v i j (Sum.inl x) (Sum.inl y))* rectangular (δ-a) (fun i j x y=>v i j (Sum.inr x) (Sum.inr y))* (rectangular (δ-a) (fun i j x y=>v i j (Sum.inr x) (Sum.inl y))* (rectangular (δ-(fun i j=>a j i)) (fun i j x y=>v i j (Sum.inr x) (Sum.inl y)))⁻¹) := by rw [rectangular_sub δ a v,rectangular_sum a v] rw [rectangular_sub,rectangular_sub,rectangular_sub,rectangular_sub] generalize rectangular δ v=K generalize rectangular a (fun i j x y=>v i j (Sum.inl x) (Sum.inl y))=A generalize rectangular a (fun i j x y=>v i j (Sum.inl x) (Sum.inr y))=B generalize rectangular a (fun i j x y=>v i j (Sum.inr x) (Sum.inl y))=C generalize rectangular a (fun i j x y=>v i j (Sum.inr x) (Sum.inr y))=D generalize rectangular δ (fun i j x y=>v i j (Sum.inl x) (Sum.inl y))=P generalize rectangular δ (fun i j x y=>v i j (Sum.inr x) (Sum.inr y))=Q generalize rectangular δ (fun i j x y=>v i j (Sum.inr x) (Sum.inl y))=R generalize rectangular (fun i j=>a j i) (fun i j x y=>v i j (Sum.inr x) (Sum.inl y))=S simp [mul_comm,mul_left_comm,mul_assoc] rw [mul_left_comm B P,mul_left_comm B Q,mul_left_comm B S,mul_left_comm B A⁻¹, mul_inv_cancel_left]
end ElementaryPositivity.RectangularKernel
endsectionnamespace ElementaryPositivity.RectangularKernelvariable {I : Type*} [Fintype I]variable {G : Type*} [CommGroup G]
lemma rectangular_mul {L R : I → Type*} [∀ i,Fintype (L i)] [∀ i,Fintype (R i)] (b : I → I → ℤ) (v w : ∀ i j,L i → R j → G) : rectangular b (fun i j x y=>v i j x y*w i j x y)=rectangular b v*rectangular b w := by simp only [rectangular,mul_zpow,Finset.prod_mul_distrib]
lemma prod_zpow_sum {α : Type*} (s : Finset α) (b : α → ℤ) (g : G) : (∏ x∈s,g^b x)=g^(∑ x∈s,b x) := by classical induction s using Finset.induction_on with | empty => simp | @insert x s hx ih => rw [Finset.prod_insert hx,Finset.sum_insert hx,ih,zpow_add]
lemma rectangular_constant {L R : I → Type*} [∀ i,Fintype (L i)] [∀ i,Fintype (R i)] (b : I → I → ℤ) (g : G) : rectangular (L:=L) (R:=R) b (fun _ _ _ _=>g)= g^(∑ i,∑ j,b i j*(Fintype.card (L i):ℤ)*(Fintype.card (R j):ℤ)) := by simp only [rectangular,Finset.prod_const,Finset.card_univ,←zpow_natCast,←zpow_mul] rw [←prod_zpow_sum] apply Finset.prod_congr rfl intro i hi rw [←prod_zpow_sum] apply Finset.prod_congr rfl intro j hj congr 1 ring
lemma rectangular_scalar_mul {L R : I → Type*} [∀ i,Fintype (L i)] [∀ i,Fintype (R i)] (b : I → I → ℤ) (g : G) (v : ∀ i j,L i → R j → G) : rectangular b (fun i j x y=>g*v i j x y)= g^(∑ i,∑ j,b i j*(Fintype.card (L i):ℤ)*(Fintype.card (R j):ℤ))*rectangular b v := by rw [rectangular_mul,rectangular_constant]
end ElementaryPositivity.RectangularKernel
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.LaurentHomogenizeimport OAI.Combinatorics.Chromatic.GradedAlgebra.NonpRegrade
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ κ : M →+ ℤ) (B : ℕ)local instance laurentRegradeRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance laurentRegradeAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance laurentRegradeAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroup
def LaurentBounded (f : PowerSeries (Torus v Ω)) : Prop := ∀ n m, coeff n f m ≠ 0 → 0 ≤ δ m ∧ -(B : ℤ)*δ m ≤ κ m ∧ (n : ℤ) ≤ κ m + (B+1 : ℤ)*δ m
lemma LaurentBounded.zero : LaurentBounded v Ω δ κ B 0 := by intro n m h simp at hlemma LaurentBounded.one : LaurentBounded v Ω δ κ B 1 := by intro n m hm have hn : n = 0 := by by_contra hn; simp [coeff_one, hn] at hm subst n have hm0 : m = 0 := by by_contra hm0 apply hm rw [coeff_one, ite_eq_left rfl] exact Finsupp.single_eq_of_ne hm0 subst m simplemma LaurentBounded.add {f g : PowerSeries (Torus v Ω)} (hf : LaurentBounded v Ω δ κ B f) (hg : LaurentBounded v Ω δ κ B g) : LaurentBounded v Ω δ κ B (f+g) := by intro n m hm have H : coeff n f m ≠ 0 ∨ coeff n g m ≠ 0 := by by_contra hh push Not at hh simp [hh.1, hh.2] at hm exact H.elim (hf n m) (hg n m)lemma LaurentBounded.neg {f : PowerSeries (Torus v Ω)} (hf : LaurentBounded v Ω δ κ B f) : LaurentBounded v Ω δ κ B (-f) := by intro n m hm apply hf n m intro hz apply hm change -(coeff n f m) = 0 rw [hz, neg_zero]lemma LaurentBounded.mul {f g : PowerSeries (Torus v Ω)} (hf : LaurentBounded v Ω δ κ B f) (hg : LaurentBounded v Ω δ κ B g) : LaurentBounded v Ω δ κ B (f*g) := by intro n r hr obtain ⟨a,b,m,l,hab,hm,hl,rfl⟩ := series_product_nonzero v Ω f g n r hr obtain ⟨hdm,hkm,hem⟩ := hf a m hm obtain ⟨hdl,hkl,hel⟩ := hg b l hl simp only [map_add] refine ⟨add_nonneg hdm hdl, ?_, ?_⟩ · nlinarith · rw [←hab, Nat.cast_add] nlinarith
lemma LaurentBounded.laurent_vanish {f : PowerSeries (Torus v Ω)} (hf : LaurentBounded v Ω δ κ B f) (d n : ℕ) (z : ℤ) (hz : z < -(B : ℤ)*(d : ℤ) ∨ z + (B+1 : ℤ)*(d : ℤ) < n) : (coeff d (laurentHomogenize v Ω δ κ (coeff n f))).coeff z = 0 := by ext m rw [laurentHomogenize_coeff] split_ifs with hh · by_contra hm obtain ⟨hd,hk,hn⟩ := hf n m hm have hD : δ m = (d : ℤ) := by rw [hh.1, Int.toNat_of_nonneg hd] rw [hD, ←hh.2] at hk hn rcases hz with hz | hz <;> omega · rfl
def laurentRegradeFamily (f : PowerSeries (Torus v Ω)) (hf : LaurentBounded v Ω δ κ B f) (d : ℕ) : HahnSeries.SummableFamily ℤ (Torus v Ω) ℕ where toFun n := coeff d (laurentHomogenize v Ω δ κ (coeff n f)) isPWO_iUnion_support' := by apply Set.IsWF.isPWO apply BddBelow.isWF refine ⟨-(B : ℤ)*(d : ℤ), ?_⟩ intro z hz obtain ⟨n, hn⟩ := Set.mem_iUnion.mp hz by_contra h exact hn (hf.laurent_vanish v Ω δ κ B d n z (Or.inl (lt_of_not_ge h))) finite_co_support' z := by apply (Finset.finite_toSet (Finset.range ((z+(B+1 : ℤ)*(d : ℤ)).toNat+1))).subset intro n hn simp only [Finset.mem_coe, Finset.mem_range] by_contra h apply hn apply hf.laurent_vanish v Ω δ κ B d n z right omega
def laurentRegrade (f : PowerSeries (Torus v Ω)) (hf : LaurentBounded v Ω δ κ B f) : PowerSeries (HahnSeries ℤ (Torus v Ω)) := PowerSeries.mk fun d => (laurentRegradeFamily v Ω δ κ B f hf d).hsum
lemma laurentRegrade_coeff (f : PowerSeries (Torus v Ω)) (hf : LaurentBounded v Ω δ κ B f) (d : ℕ) (z : ℤ) : (coeff d (laurentRegrade v Ω δ κ B f hf)).coeff z = ∑ n ∈ Finset.range ((z+(B+1 : ℤ)*(d : ℤ)).toNat+1), (coeff d (laurentHomogenize v Ω δ κ (coeff n f))).coeff z := by rw [laurentRegrade, coeff_mk] apply HahnSeries.SummableFamily.coeff_hsum_eq_sum_of_subset intro n hn simp only [Finset.mem_coe, Finset.mem_range] by_contra h exact hn (hf.laurent_vanish v Ω δ κ B d n z (Or.inr (by omega)))
endend ElementaryPositivity.QuantumTorus
endsectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ κ : M →+ ℤ)local instance laurentRegradeBiRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance laurentRegradeBiAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance laurentRegradeBiAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroup
def BiBounded (f : PowerSeries (Torus v Ω)) : Prop := ∀ n m, coeff n f m ≠ 0 → 0 ≤ δ m ∧ 0 ≤ κ m ∧ (n : ℤ) ≤ δ m + κ mlemma BiBounded.zero : BiBounded v Ω δ κ 0 := by intro n m h; simp at hlemma BiBounded.one : BiBounded v Ω δ κ 1 := by intro n m hm have hn : n=0 := by by_contra hn; simp [coeff_one,hn] at hm subst n have hm0 : m=0 := by by_contra hm0 apply hm rw [coeff_one,ite_eq_left rfl] exact Finsupp.single_eq_of_ne hm0 subst m simplemma BiBounded.add {f g : PowerSeries (Torus v Ω)} (hf : BiBounded v Ω δ κ f) (hg : BiBounded v Ω δ κ g) : BiBounded v Ω δ κ (f+g) := by intro n m hm have H : coeff n f m≠0 ∨ coeff n g m≠0 := by by_contra hh push Not at hh simp [hh.1,hh.2] at hm exact H.elim (hf n m) (hg n m)lemma BiBounded.neg {f : PowerSeries (Torus v Ω)} (hf : BiBounded v Ω δ κ f) : BiBounded v Ω δ κ (-f) := by intro n m hm apply hf n m intro hz apply hm change -(coeff n f m)=0 rw [hz,neg_zero]lemma BiBounded.mul {f g : PowerSeries (Torus v Ω)} (hf : BiBounded v Ω δ κ f) (hg : BiBounded v Ω δ κ g) : BiBounded v Ω δ κ (f*g) := by intro j r hr obtain ⟨a,b,m,n,hab,hm,hn,rfl⟩ := series_product_nonzero v Ω f g j r hr obtain ⟨hdm,hkm,hem⟩ := hf a m hm obtain ⟨hdn,hkn,hen⟩ := hg b n hn simp only [map_add] refine ⟨add_nonneg hdm hdn,add_nonneg hkm hkn,?_⟩ rw [←hab,Nat.cast_add] omegalemma BiBounded.bi_vanish {f : PowerSeries (Torus v Ω)} (hf : BiBounded v Ω δ κ f) (d e n : ℕ) (hne : d+e<n) : coeff e (coeff d (biHomogenize v Ω δ κ (coeff n f)))=0 := by ext m rw [biHomogenize_coeff] split_ifs with hh · by_contra hz obtain ⟨hd,hk,he⟩ := hf n m hz have hD : δ m=(d : ℤ) := by rw [hh.1,Int.toNat_of_nonneg hd] have hK : κ m=(e : ℤ) := by rw [hh.2,Int.toNat_of_nonneg hk] omega · rfllemma BiBounded.bi_product_vanish {f g : PowerSeries (Torus v Ω)} (hf : BiBounded v Ω δ κ f) (hg : BiBounded v Ω δ κ g) (d e a b : ℕ) (ha : d+e<a ∨ d+e<b) : coeff e (coeff d (biHomogenize v Ω δ κ (coeff a f)* biHomogenize v Ω δ κ (coeff b g)))=0 := by rw [coeff_mul,map_sum] apply Finset.sum_eq_zero intro ij hij rw [coeff_mul] apply Finset.sum_eq_zero intro kl hkl have H1:=Finset.HasAntidiagonal.mem_antidiagonal.mp hij have H2:=Finset.HasAntidiagonal.mem_antidiagonal.mp hkl rcases ha with ha|ha · rw [hf.bi_vanish v Ω δ κ ij.1 kl.1 a (by omega),Torus.zero_mul] · rw [hg.bi_vanish v Ω δ κ ij.2 kl.2 b (by omega),Torus.mul_zero]
def boundedBiRegrade (f : PowerSeries (Torus v Ω)) : PowerSeries (PowerSeries (Torus v Ω)) := PowerSeries.mk fun d => PowerSeries.mk fun e => ∑ n ∈ Finset.range (d+e+1), coeff e (coeff d (biHomogenize v Ω δ κ (coeff n f)))lemma boundedBiRegrade_coeff (f : PowerSeries (Torus v Ω)) (d e : ℕ) : coeff e (coeff d (boundedBiRegrade v Ω δ κ f)) = ∑ n ∈ Finset.range (d+e+1), coeff e (coeff d (biHomogenize v Ω δ κ (coeff n f))) := by simp only [boundedBiRegrade,coeff_mk]
section Topologylocal instance laurentRegradeTopology : TopologicalSpace (Torus v Ω) := ⊥local instance laurentRegradeDiscreteTopology : DiscreteTopology (Torus v Ω) := ⟨rfl⟩open scoped PowerSeries.WithPiTopologylemma boundedBiRegrade_hasSum {f : PowerSeries (Torus v Ω)} (hf : BiBounded v Ω δ κ f) : HasSum (fun n => biHomogenize v Ω δ κ (coeff n f)) (boundedBiRegrade v Ω δ κ f) := by rw [PowerSeries.WithPiTopology.hasSum_iff_hasSum_coeff] intro d rw [PowerSeries.WithPiTopology.hasSum_iff_hasSum_coeff] intro e rw [boundedBiRegrade_coeff] apply hasSum_sum_of_ne_finset_zero intro n hn apply hf.bi_vanish v Ω δ κ d e n simp only [Finset.mem_range,not_lt] at hn omegalemma boundedBiRegrade_product_summable {f g : PowerSeries (Torus v Ω)} (hf : BiBounded v Ω δ κ f) (hg : BiBounded v Ω δ κ g) : Summable (fun ab : ℕ×ℕ => biHomogenize v Ω δ κ (coeff ab.1 f)* biHomogenize v Ω δ κ (coeff ab.2 g)) := by rw [PowerSeries.WithPiTopology.summable_iff_summable_coeff] intro d rw [PowerSeries.WithPiTopology.summable_iff_summable_coeff] intro e apply summable_of_hasFiniteSupport apply (Finset.finite_toSet ((Finset.range (d+e+1)).product (Finset.range (d+e+1)))).subset intro ab hab change coeff e (coeff d (biHomogenize v Ω δ κ (coeff ab.1 f)* biHomogenize v Ω δ κ (coeff ab.2 g)))≠0 at hab change ab∈(Finset.range (d+e+1)) ×ˢ (Finset.range (d+e+1)) rw [Finset.mem_product,Finset.mem_range,Finset.mem_range] by_contra H exact hab (hf.bi_product_vanish v Ω δ κ hg d e ab.1 ab.2 (by omega))lemma boundedBiRegrade_mul {f g : PowerSeries (Torus v Ω)} (hf : BiBounded v Ω δ κ f) (hg : BiBounded v Ω δ κ g) : boundedBiRegrade v Ω δ κ (f*g) = boundedBiRegrade v Ω δ κ f*boundedBiRegrade v Ω δ κ g := by rw [←(boundedBiRegrade_hasSum v Ω δ κ hf).tsum_eq, ←(boundedBiRegrade_hasSum v Ω δ κ hg).tsum_eq, (boundedBiRegrade_hasSum v Ω δ κ hf).summable.tsum_mul_tsum_eq_tsum_sum_antidiagonal (boundedBiRegrade_hasSum v Ω δ κ hg).summable (boundedBiRegrade_product_summable v Ω δ κ hf hg), ←(boundedBiRegrade_hasSum v Ω δ κ (hf.mul v Ω δ κ hg)).tsum_eq] apply tsum_congr intro n rw [coeff_mul,_root_.map_sum] apply Finset.sum_congr rfl intro ab hab exact biHomogenize_mul v Ω δ κ _ _ (fun m hm => ⟨(hf ab.1 m hm).1,(hf ab.1 m hm).2.1⟩) (fun m hm => ⟨(hg ab.2 m hm).1,(hg ab.2 m hm).2.1⟩)end Topology
lemma boundedBiRegrade_add (f g : PowerSeries (Torus v Ω)) : boundedBiRegrade v Ω δ κ (f+g) = boundedBiRegrade v Ω δ κ f+boundedBiRegrade v Ω δ κ g := by apply PowerSeries.ext intro d apply PowerSeries.ext intro e rw [_root_.map_add, _root_.map_add, boundedBiRegrade_coeff, boundedBiRegrade_coeff, boundedBiRegrade_coeff, ←Finset.sum_add_distrib] apply Finset.sum_congr rfl intro n hn rw [_root_.map_add, _root_.map_add, _root_.map_add, _root_.map_add]lemma boundedBiRegrade_one : boundedBiRegrade v Ω δ κ 1=1 := by apply PowerSeries.ext intro d apply PowerSeries.ext intro e rw [boundedBiRegrade_coeff] rw [Finset.sum_eq_single 0] · simp only [coeff_zero_one,biHomogenize_one] · intro n hn hne rw [coeff_one,ite_eq_right hne,_root_.map_zero,_root_.map_zero,_root_.map_zero] · intro hn exact (hn (by simp)).elimlemma boundedBiRegrade_zero : boundedBiRegrade v Ω δ κ 0=0 := by apply PowerSeries.ext intro d apply PowerSeries.ext intro e simp only [boundedBiRegrade_coeff,_root_.map_zero,Finset.sum_const_zero]endend ElementaryPositivity.QuantumTorus
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.NonpRegradeFaithfulimport OAI.Combinatorics.Chromatic.GradedAlgebra.LaurentRegrade
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ κ : M →+ ℤ) (B D : ℕ)local instance laurentRegradeFiniteRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance laurentRegradeFiniteAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance laurentRegradeFiniteAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroup
lemma sum_range_eq_of_tails_zero {A : Type*} [AddCommMonoid A] (f : ℕ → A) (a b : ℕ) (ha : ∀n,a≤n → f n=0) (hb : ∀n,b≤n → f n=0) : ∑n∈Finset.range a,f n=∑n∈Finset.range b,f n := by have H (c : ℕ) (hc : c ≤ max a b) (h : ∀n,c≤n → f n=0) : ∑n∈Finset.range c,f n=∑n∈Finset.range (max a b),f n := by apply Finset.sum_subset (Finset.range_mono hc) intro n hn hnc exact h n (by simpa only [Finset.mem_range,not_lt] using hnc) exact (H a (le_max_left _ _) ha).trans (H b (le_max_right _ _) hb).symm
lemma laurentRegrade_off_diagonal {f : PowerSeries (Torus v Ω)} (hf : LaurentBounded v Ω δ κ B f) (d : ℕ) (z : ℤ) (m : M) (hm : ¬(d=(δ m).toNat ∧ z=κ m)) : (coeff d (laurentRegrade v Ω δ κ B f hf)).coeff z m=0 := by rw [laurentRegrade_coeff,nonp_torus_eval_sum] apply Finset.sum_eq_zero intro n hn rw [laurentHomogenize_coeff,ite_eq_right hm]
lemma laurentRegrade_finite {f : PowerSeries (Torus v Ω)} (hf : LaurentBounded v Ω δ κ B f) (hg : RegradeBound v Ω δ D f) (d : ℕ) : coeff d (laurentRegrade v Ω δ κ B f hf)= coeff d (laurentHomogenize v Ω δ κ (coeff d (regrade v Ω δ D f))) := by apply HahnSeries.ext funext z ext m rw [laurentRegrade_coeff,nonp_torus_eval_sum,laurentHomogenize_coeff] by_cases h : d=(δ m).toNat ∧ z=κ m · rw [ite_eq_left h,regrade_coeff_eval,ite_eq_left h.1] simp_rw [laurentHomogenize_coeff,ite_eq_left h] apply sum_range_eq_of_tails_zero · intro n hn by_contra hm obtain ⟨hd,hk,he⟩:=hf n m hm have hD : δ m=(d:ℤ) := by rw [h.1,Int.toNat_of_nonneg hd] rw [hD,←h.2] at he omega · intro n hn by_contra hm have H:=(hg n m hm).2 rw [←h.1] at H omega · rw [ite_eq_right h] apply Finset.sum_eq_zero intro n hn rw [laurentHomogenize_coeff,ite_eq_right h]
lemma laurentRegrade_finite_read {f : PowerSeries (Torus v Ω)} (hf : LaurentBounded v Ω δ κ B f) (hg : RegradeBound v Ω δ D f) (d : ℕ) (z : ℤ) (m : M) : (coeff d (laurentRegrade v Ω δ κ B f hf)).coeff z m= if z=κ m then coeff d (regrade v Ω δ D f) m else 0 := by rw [laurentRegrade_finite v Ω δ κ B D hf hg,laurentHomogenize_coeff] by_cases he : d=(δ m).toNat · simp only [he,true_and] · rw [regrade_coeff_eval,ite_eq_right he] simpendend ElementaryPositivity.QuantumTorus
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162import Mathlibimport OAI.Combinatorics.Chromatic.Walls.QuantumTorusRaySeriesimport OAI.Combinatorics.Chromatic.GradedAlgebra.LaurentRegrade
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeries WallUnitsnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ κ : M →+ ℤ) (B : ℕ)variable (p : M) (hδ : δ p=0) (hκ : κ p=1)local instance laurentRegradePureRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance laurentRegradePureAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance laurentRegradePureAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroup
include hδ hκ inlemma pure_laurentBounded (f : PowerSeries R) : LaurentBounded v Ω δ κ B (raySeries v Ω p f) := by intro n m hm rw [coeff_raySeries] at hm have he : m=n • p := by by_contra H exact hm (Finsupp.single_eq_of_ne H) subst m simp only [map_nsmul,hδ,hκ,nsmul_eq_mul,mul_one,mul_zero,add_zero] exact ⟨le_rfl,Int.natCast_nonneg _,le_rfl⟩
include hδ hκ inlemma laurentRegrade_pure (f : PowerSeries R) : laurentRegrade v Ω δ κ B (raySeries v Ω p f) (pure_laurentBounded v Ω δ κ B p hδ hκ f)= PowerSeries.C (HahnSeries.ofPowerSeries ℤ (Torus v Ω) (raySeries v Ω p f)) := by classical apply PowerSeries.ext intro d apply HahnSeries.ext funext z rw [laurentRegrade_coeff] simp_rw [coeff_raySeries,laurentHomogenize_monomial] simp only [map_nsmul,hδ,hκ,nsmul_eq_mul,mul_one,mul_zero,Int.toNat_zero,coeff_monomial] by_cases hd : d=0 · subst d simp only [coeff_C,Nat.cast_zero,mul_zero,add_zero,ite_true] by_cases hz : 0≤z · lift z to ℕ using hz with j hj simp [HahnSeries.coeff_single] · have hz' : z<0 := lt_of_not_ge hz have H (j : ℕ) : z≠(j:ℤ) := by omega simp_rw [HahnSeries.coeff_single,ite_eq_right (H _)] rw [Finset.sum_const_zero,HahnSeries.ofPowerSeries_apply,HahnSeries.embDomain_of_notMem_range] rintro ⟨n,hn⟩ simp only [Nat.castOrderEmbedding_apply] at hn omega · simp only [ite_eq_right hd,HahnSeries.coeff_zero,Finset.sum_const_zero,coeff_C]endend ElementaryPositivity.QuantumTorus
end
end OAI1234567891011121314151617181920212223242526import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.LaurentInfinity
namespace OAI
sectionnamespace ElementaryPositivity.LaurentAtInfinityopen HahnSeriesvariable {R S : Type*} [CommRing R] [CommRing S] [Algebra ℚ R] [Algebra ℚ S]lemma rat_smul_series (r : ℚ) (x : LaurentSeries R) : r • x=C (algebraMap ℚ R r)*x := by apply HahnSeries.ext funext k simp only [HahnSeries.coeff_smul,HahnSeries.C_apply,HahnSeries.coeff_single_zero_mul] exact Algebra.smul_def r (x.coeff k)lemma mapRing_rat_smul (f : R →ₐ[ℚ] S) (r : ℚ) (x : LaurentSeries R) : mapRing f.toRingHom (r • x)=r • mapRing f.toRingHom x := by apply HahnSeries.ext funext k simp only [mapRing_coeff,HahnSeries.coeff_smul] exact f.toLinearMap.map_smul r (x.coeff k)end ElementaryPositivity.LaurentAtInfinity
end
end OAI1234567891011121314151617181920212223import Mathlib
namespace OAI
sectionnamespace ElementaryPositivityvariable {R : Type*} [CommRing R]lemma unit_neg_one_inv : (-1 : Rˣ)⁻¹=(-1 : Rˣ) := by apply Units.ext simp
lemma unit_neg_one_zpow_sub (n m : ℤ) : (-1 : Rˣ)^n*(-1 : Rˣ)^m=(-1 : Rˣ)^(n-m) := by rw [zpow_sub,←inv_zpow,unit_neg_one_inv]
end ElementaryPositivity
lemma mul_sign_collect {G : Type*} [CommMonoid G] (s t p q r u : G) : s*p*q*r*(t*u)=(s*t)*(p*q*r*u) := by ac_rfl
end
end OAI123456789101112131415161718192021222324import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.LaurentSigns
namespace OAI
sectionnamespace ElementaryPositivity.LaurentAtInfinityopen HahnSeriesvariable {R : Type*} [CommRing R] [Algebra ℚ R]lemma negative_unit_rat (n : ℤ) : ((-1 : (LaurentSeries R)ˣ)^n).val=C (algebraMap ℚ R ((-1 : ℚ)^n)) := by cases n with | ofNat n => simp only [Int.ofNat_eq_natCast,zpow_natCast,Units.val_pow_eq_pow_val,Units.val_neg, Units.val_one,map_pow,map_neg,map_one] | negSucc n => rw [zpow_negSucc,←inv_pow,ElementaryPositivity.unit_neg_one_inv] simp only [Units.val_pow_eq_pow_val,Units.val_neg,Units.val_one,zpow_negSucc, ←inv_pow,inv_neg,inv_one,map_pow,map_neg,map_one]end ElementaryPositivity.LaurentAtInfinity
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485import Mathlibimport OAI.Combinatorics.Chromatic.Walls.MutationChamberPaths
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeries WallUnits FiniteRayGeometrynoncomputable sectionvariable {M E I : Type*} [AddCommGroup M] [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [Fintype I] [DecidableEq I]variable (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (C : (I → ℤ) →+ M) (coord : M →+ (I → ℤ)) (hcoord : ∀d,coord (C d)=d) (pc : I)variable (e : M →+ E) (he : Function.Injective e)variable (S : E →ₗ[ℝ] E →ₗ[ℝ] ℝ) (hS : ∀x,S x x=0)variable (hcomp : ∀a b,S (e a) (e b)=(Ω a b:ℝ))variable (L : Module.Dual ℝ E) (hdeg : ∀n m,HasRootDegree C n m → L (e m)=(n:ℝ))variable (hnd : ∀r≠0,∃m,Ω r m≠0)
def strictRootsThrough (D : ℕ) : Finset M := by classical exact (Finset.range D).biUnion (fun n=>(rootDegree_finite C (n+1)).toFinset)omit [DecidableEq I] inlemma mem_strictRootsThrough (D : ℕ) (m : M) : m∈strictRootsThrough C D ↔ ∃n,n+1≤D ∧ HasRootDegree C (n+1) m := by classical simp only [strictRootsThrough,Finset.mem_biUnion,Finset.mem_range,Set.Finite.mem_toFinset, Set.mem_ofPred_eq,Nat.lt_iff_add_one_le]
omit [FiniteDimensional ℝ E] ininclude hdeg inlemma RegularCovector.simple_ne {a : Module.Dual ℝ E} (HA : RegularCovector C e a) : a (e (simpleRoot C pc))≠0 := HA 1 _ (realRoot_mem e C 1 1 le_rfl _ (simpleRoot_degree C pc)) (realRoot_ne_zero C e L hdeg 1 (by omega) _ (simpleRoot_degree C pc))
include hnd inlemma mutatedTransport_endpoint_support (V : M → Prop) (hV : ∀a b,V a → V b → V (a+b)) (D : ℕ) {a b : Module.Dual ℝ E} (HA : RegularCovector C e a) (HB : RegularCovector C e b) (hmatch : ∀n,n+1≤D → ∀m,HasRootDegree (mutatedRoots Ω C pc) (n+1) m → ¬V m → (0<realMutationCovector e S (simpleRoot C pc) a (e m) ∧ 0<realMutationCovector e S (simpleRoot C pc) b (e m)) ∨ (realMutationCovector e S (simpleRoot C pc) a (e m)<0 ∧ realMutationCovector e S (simpleRoot C pc) b (e m)<0)) : ∀n,n+1≤D → SupportedOn LaurentRay.vUnit Ω V (coeff (n+1) (mutatedTransport Ω hΩ C coord hcoord pc e he S hS hcomp L hdeg HA HB).val) := by classical let f (m : M) : E:=if 0<realMutationCovector e S (simpleRoot C pc) a (e m) then e m else -e m let R:=(strictRootsThrough (mutatedRoots Ω C pc) D).filter (fun m=>¬V m) let P:=R.image f have hp (n : ℕ) (hn : n+1≤D) (m : M) (hm : HasRootDegree (mutatedRoots Ω C pc) (n+1) m) (hv : ¬V m) : f m∈P:= Finset.mem_image.mpr ⟨m,Finset.mem_filter.mpr ⟨(mem_strictRootsThrough _ _ _).mpr ⟨n,hn,hm⟩,hv⟩,rfl⟩ have hab : a∈mutationSignRegion e S (simpleRoot C pc) P ∧ b∈mutationSignRegion e S (simpleRoot C pc) P:=by have aux (x : E) (hx : x∈P) : 0<realMutationCovector e S (simpleRoot C pc) a x ∧ 0<realMutationCovector e S (simpleRoot C pc) b x:=by obtain ⟨m,hm,rfl⟩:=Finset.mem_image.mp hx obtain ⟨hm,hv⟩:=Finset.mem_filter.mp hm obtain ⟨n,hn,hm⟩:=(mem_strictRootsThrough _ _ _).mp hm rcases hmatch n hn m hm hv with hh|hh · dsimp only [f] rw [ite_eq_left hh.1] exact hh · dsimp only [f] rw [ite_eq_right (not_lt.mpr hh.1.le),map_neg,map_neg] exact ⟨neg_pos.mpr hh.1,neg_pos.mpr hh.2⟩ exact ⟨fun x hx=>(aux x hx).1,fun x hx=>(aux x hx).2⟩ apply mutatedTransport_protected Ω hΩ C coord hcoord pc e he S hS hcomp L hdeg hnd P V hV D _ HA HB hab.1 hab.2 (HA.simple_ne C pc e L hdeg) (HB.simple_ne C pc e L hdeg) intro n hn m hm hv have hh:=hp n hn m hm hv dsimp [f] at hh split_ifs at hh · exact Or.inl hh · exact Or.inr hhendend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.MutationOrientedCompatibility
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeries WallUnits FiniteRayGeometry RationalFibernoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M] (v : Rˣ) (Ω : M →+ M →+ ℤ)local instance mutatedNoCutConeRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance mutatedNoCutConeAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance mutatedNoCutConeAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGrouplemma series_support_addSubmonoid_one (P : AddSubmonoid M) : ∀n m,coeff n (1 : PowerSeries (Torus v Ω)) m≠0 → m∈P := by intro n m hm rw [coeff_one] at hm split_ifs at hm with hn · have hm0 : m=0:=by by_contra h exact hm (Finsupp.single_eq_of_ne h) exact hm0 ▸ P.zero_mem · exact False.elim (hm rfl)lemma series_support_addSubmonoid_mul (P : AddSubmonoid M) (f g : PowerSeries (Torus v Ω)) (hf : ∀n m,coeff n f m≠0 → m∈P) (hg : ∀n m,coeff n g m≠0 → m∈P) : ∀n m,coeff n (f*g) m≠0 → m∈P := by classical intro n m hm rw [coeff_mul,nonp_torus_eval_sum] at hm obtain ⟨ab,hab,hz⟩:=Finset.exists_ne_zero_of_sum_ne_zero hm obtain ⟨a,b,ha,hb,he⟩:=torus_product_nonzero v Ω _ _ m hz exact he ▸ P.add_mem (hf ab.1 a ha) (hg ab.2 b hb)endnoncomputable sectionvariable {M E I : Type*} [AddCommGroup M] [AddCommGroup E] [Module ℝ E] [Fintype I] [DecidableEq I]variable (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (C : (I → ℤ) →+ M) (coord : M →+ (I → ℤ)) (hcoord : ∀d,coord (C d)=d) (pc : I)local instance mutatedNoCutConeLaurentRing : Ring (Torus LaurentRay.vUnit Ω) := Torus.instRing LaurentRay.vUnit Ωlocal instance mutatedNoCutConeLaurentAddCommMonoid : AddCommMonoid (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddCommMonoidlocal instance mutatedNoCutConeLaurentAddGroup : AddGroup (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddGroupvariable (e : M →+ E) (he : Function.Injective e)variable (S : E →ₗ[ℝ] E →ₗ[ℝ] ℝ) (hS : ∀x,S x x=0)variable (hcomp : ∀a b,S (e a) (e b)=(Ω a b:ℝ))variable (L : Module.Dual ℝ E) (hdeg : ∀n m,HasRootDegree C n m → L (e m)=(n:ℝ))variable (v k : Module.Dual ℝ E)variable (H : ∀N,GenericOffset (realRootsThrough e C N) 0 v k)include hcoord hS hcomp inlemma noncutOldLineFactor_cone (pos : Bool) (a : ℝ) (hs : cutSide pos ((k+a • v).toAddMonoidHom.comp e) (simpleRoot C pc)) : ∀n m,coeff n (noncutOldLineFactor Ω C e he L hdeg v k H a) m≠0 → m∈fiberCone coord pc (mutationPairing Ω C pc) (sideSign pos) := by classical unfold noncutOldLineFactor split · next ha=> let data:=lineRayData C e he L hdeg v k H a ha have hf:=simple_fiber_bound Ω C coord hcoord pc e he S hS hcomp L hdeg data.root data.degree data.degree_pos data.root_degree (k+a • v) data.generic pos hs change ∀n m,coeff n (orientPowerSeries (decide (v (e data.root)<0)) (chartZero LaurentRay.vUnit Ω C ((k+a • v).toAddMonoidHom.comp e) (simpleTotalTransport Ω C)).val) m≠0 → _ cases hh : decide (v (e data.root)<0) · exact inverse_support_addSubmonoid LaurentRay.vUnit Ω _ _ hf · exact hf · exact series_support_addSubmonoid_one LaurentRay.vUnit Ω _
include hcoord hS hcomp inlemma noncutComparisonWord_cone (pos : Bool) (lo hi : ℝ) (N : ℕ) (hs : ∀a∈intervalEventList C e v k lo hi N, cutSide pos ((k+a • v).toAddMonoidHom.comp e) (simpleRoot C pc)) : ∀n m,coeff n (comparisonWordOld LaurentRay.vUnit Ω hΩ (nonpDegree coord pc) (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc) (nonpDegree_simple_self C coord hcoord pc) (mutationSize Ω C pc+1) (actualLineWord Ω C coord hcoord pc e he S hS hcomp L hdeg v k H lo hi N)).val.val m≠0 → m∈fiberCone coord pc (mutationPairing Ω C pc) (sideSign pos) := by let U:=fun a=>comparisonOld LaurentRay.vUnit Ω hΩ (nonpDegree coord pc) (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc) (nonpDegree_simple_self C coord hcoord pc) (mutationSize Ω C pc+1) (actualLineLetter Ω C coord hcoord pc e he S hS hcomp L hdeg v k H a) have HH : ∀l : List ℝ, (∀a∈l,cutSide pos ((k+a • v).toAddMonoidHom.comp e) (simpleRoot C pc)) → ∀n m,coeff n (l.map U).prod.val.val m≠0 → m∈fiberCone coord pc (mutationPairing Ω C pc) (sideSign pos) := by intro l induction l with | nil=>intro _; exact series_support_addSubmonoid_one LaurentRay.vUnit Ω _ | cons a l ih=> intro hl have ha:=hl a (by simp) have hb:=noncutOldLineFactor_cone Ω C coord hcoord pc e he S hS hcomp L hdeg v k H pos a ha rw [noncutOldLineFactor_comparison Ω hΩ C coord hcoord pc e he S hS hcomp L hdeg v k H pos a ha] at hb exact series_support_addSubmonoid_mul LaurentRay.vUnit Ω _ _ _ hb (ih (fun b hh=>hl b (List.mem_cons_of_mem a hh))) simpa only [comparisonWordOld,actualLineWord,List.map_map,Function.comp_def] using HH (intervalEventList C e v k lo hi N) hs
include hΩ he hS hcomp hdeg H inlemma noncutEndpointRatio_cone (pos : Bool) (lo hi : ℝ) (ho : lo<hi) (ha : ∀N,lo∉lineEvents (realRootsThrough e C N) v k) (hb : ∀N,hi∉lineEvents (realRootsThrough e C N) v k) (hs : ∀a,lo<a → a<hi → cutSide pos ((k+a • v).toAddMonoidHom.comp e) (simpleRoot C pc)) : ∀n m,coeff n (lineNegativeUnit Ω C coord hcoord pc e v k hi* (lineNegativeUnit Ω C coord hcoord pc e v k lo)⁻¹).val.val m≠0 → m∈fiberCone coord pc (mutationPairing Ω C pc) (sideSign pos) := by intro n m hm have hsN : ∀a∈intervalEventList C e v k lo hi n, cutSide pos ((k+a • v).toAddMonoidHom.comp e) (simpleRoot C pc):=by intro a hh have hhF:=Finset.mem_sort (· ≥ ·) |>.mp hh have hab:=(Finset.mem_filter.mp hhF).2 exact hs a hab.1 hab.2 have hcone:=noncutComparisonWord_cone Ω hΩ C coord hcoord pc e he S hS hcomp L hdeg v k H pos lo hi n hsN have ht:=actualLine_old_transport Ω hΩ C coord hcoord pc e he S hS hcomp L hdeg v k H lo hi n (ha n) (hb n) ho have HH:=oldCoefficientsEqual_mul Ω coord pc n _ _ (lineNegativeUnit Ω C coord hcoord pc e v k lo)⁻¹ (lineNegativeUnit Ω C coord hcoord pc e v k lo)⁻¹ ht (fun _ _=>rfl) simp only [mul_assoc,mul_inv_cancel,mul_one] at HH apply hcone n m rw [HH n le_rfl] exact hmendend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107import Mathlibimport OAI.Combinatorics.Chromatic.Walls.MutatedWallKernel
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeries WallUnits FiniteRayGeometrynoncomputable sectionvariable {M I:Type*} [AddCommGroup M] [Fintype I] [DecidableEq I]variable (Ω:M →+ M →+ ℤ) (C:(I → ℤ) →+ M)variable (coord:M →+ (I → ℤ)) (hcoord:∀d,coord (C d)=d) (pc:I)local instance : Ring (Torus LaurentRay.vUnit Ω) := Torus.instRing LaurentRay.vUnit Ωlocal instance : AddCommMonoid (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddCommMonoidlocal instance : AddGroup (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddGroup
lemma pureFaceSeries_of_pure (f:PowerSeries (Torus LaurentRay.vUnit Ω)) (hf:∀n m,coeff n f m≠0 → nonpDegree coord pc m=0) : pureFaceSeries Ω coord pc f=f := by apply PowerSeries.ext intro n apply Finsupp.ext intro m rw [pureFaceSeries_apply] split_ifs with h · rfl · exact (not_ne_iff.mp (fun H=>h (hf n m H))).symm
include hcoord inlemma pureFaceSeries_kernel_one (f:PowerSeries (Torus LaurentRay.vUnit Ω)) (hf:SeriesGraded LaurentRay.vUnit Ω C f) (hc:constantCoeff f=1) (h:M →+ ℝ) (hp:h (simpleRoot C pc)≠0) (hk:∀n m,coeff n f m≠0 → h m=0) : pureFaceSeries Ω coord pc f=1 := by apply PowerSeries.ext intro n cases n with | zero => rw [coeff_pureFaceSeries,coeff_zero_eq_constantCoeff_apply,hc,coeff_zero_eq_constantCoeff_apply, constantCoeff_one,zeroProject_one] | succ n => apply Finsupp.ext intro m rw [pureFaceSeries_apply,coeff_one,ite_eq_right (show n+1≠0 by omega)] change (if nonpDegree coord pc m=0 then coeff (n+1) f m else 0)=0 split_ifs with hm · by_contra hn have hr:HasRootDegree C (n+1) m:=by by_contra hh exact hn (hf (n+1) m hh) have HH:=hk (n+1) m hn rw [nonp_zero_root C coord hcoord pc hr hm,map_nsmul,nsmul_eq_mul] at HH exact hp ((mul_eq_zero.mp HH).resolve_left (by positivity)) · rfl
include hcoord inlemma pureFaceSeries_orient_simple (b:Bool) : pureFaceSeries Ω coord pc (orientPowerSeries b (normalizedSimple Ω (simpleRoot C pc)))= orientPowerSeries b (normalizedSimple Ω (simpleRoot C pc)) := by apply pureFaceSeries_of_pure have HH:=orientPowerSeries_submonoid LaurentRay.vUnit Ω ((nonpDegree coord pc).ker.toAddSubmonoid) b (normalizedSimple Ω (simpleRoot C pc)) apply HH intro n m hm rw [normalizedSimple,coeff_raySeries] at hm have heq:m=n • simpleRoot C pc:=by by_contra hh exact hm (Finsupp.single_eq_of_ne hh) change nonpDegree coord pc m=0 rw [heq,map_nsmul,nonpDegree_simple_self C coord hcoord,nsmul_zero]
variable {E:Type*} [AddCommGroup E] [Module ℝ E]variable (hΩ:∀m,Ω m m=0) (e:M →+ E) (he:Function.Injective e)variable (S:E →ₗ[ℝ] E →ₗ[ℝ] ℝ) (hS:∀x,S x x=0)variable (hcomp:∀a b,S (e a) (e b)=(Ω a b:ℝ))variable (L:Module.Dual ℝ E) (hdeg:∀n m,HasRootDegree C n m → L (e m)=(n:ℝ))variable (v k:Module.Dual ℝ E) (H:∀N,GenericOffset (realRootsThrough e C N) 0 v k)
include hcoord hS hcomp inlemma mutatedLineFactor_pure (a:ℝ) : pureFaceSeries Ω (mutatedCoordinates Ω C coord pc) pc (mutatedLineFactor Ω hΩ C coord pc e he L hdeg v k H a)= if (k+a • v) (e (simpleRoot C pc))=0 then orientPowerSeries (!(decide (v (e (simpleRoot C pc))<0))) (normalizedSimple Ω (simpleRoot (mutatedRoots Ω C pc) pc)) else 1 := by classical by_cases hp:(k+a • v) (e (simpleRoot C pc))=0 · have hevent:∃N,a∈lineEvents (realRootsThrough e C N) v k:= ⟨1,RationalFiber.line_cut_event C pc e L hdeg v k H a hp⟩ rw [ite_eq_left hp,mutatedLineFactor,dite_eq_left hevent,ite_eq_left hp] exact pureFaceSeries_orient_simple Ω (mutatedRoots Ω C pc) (mutatedCoordinates Ω C coord pc) (mutatedCoordinates_retraction Ω C coord hcoord pc) pc _ · rw [ite_eq_right hp] apply pureFaceSeries_kernel_one Ω (mutatedRoots Ω C pc) (mutatedCoordinates Ω C coord pc) (mutatedCoordinates_retraction Ω C coord hcoord pc) pc _ (mutatedLineFactor_graded Ω hΩ C coord hcoord pc e he S hS hcomp L hdeg v k H a) (mutatedLineFactor_constant Ω hΩ C coord pc e he L hdeg v k H a) ((realMutationCovector e S (simpleRoot C pc) (k+a • v)).toAddMonoidHom.comp e) · change realMutationCovector e S (simpleRoot C pc) (k+a • v) (e (simpleRoot (mutatedRoots Ω C pc) pc))≠0 rw [mutatedRoot_p,map_neg,map_neg,realMutationCovector_at_p e S _ hS] exact neg_ne_zero.mpr hp · exact mutatedLineFactor_kernel Ω hΩ C coord pc e he S hS hcomp L hdeg v k H aendend ElementaryPositivity.QuantumTorus
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889import Mathlibimport OAI.Combinatorics.Chromatic.Walls.QuantumTorusChartCompletion
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {M I : Type*} [AddCommGroup M] [Fintype I] [DecidableEq I]variable (C : (I → ℤ) →+ M) (coord : M →+ (I → ℤ))variable (hcoord : ∀d,coord (C d)=d) (p : I)def simpleRoot : M := C (Pi.single p 1)def nonpDegree : M →+ ℤ where toFun m:=∑i∈Finset.univ.erase p,coord m i map_zero':=by simp map_add':=by intro a b; simp [Finset.sum_add_distrib]def fiberUpper (α : I → ℤ) (σ : ℤ) : M →+ ℤ where toFun m:=∑i∈Finset.univ.erase p,max 0 (-σ*α i)*coord m i map_zero':=by simp map_add':=by intro a b; simp [mul_add,Finset.sum_add_distrib]def fiberCone (α : I → ℤ) (σ : ℤ) : AddSubmonoid M where carrier:={m | 0≤coord m p ∧ coord m p≤fiberUpper coord p α σ m} zero_mem':=by simp add_mem':=by intro a b ha hb change 0≤coord (a+b) p ∧ coord (a+b) p≤fiberUpper coord p α σ (a+b) simp only [map_add,Pi.add_apply] exact ⟨add_nonneg ha.1 hb.1,add_le_add ha.2 hb.2⟩include hcoord inomit [DecidableEq I] inlemma root_coordinates {n : ℕ} {m : M} (hm : HasRootDegree C n m) : ∃d : I → ℕ,(∑i,d i)=n ∧ (∀i,coord m i=(d i:ℤ)) ∧ C (fun i=>(d i:ℤ))=m := by obtain ⟨d,hd,hm⟩:=hm refine ⟨d,hd,?_,hm⟩ rw [←hm,hcoord] exact fun _=>rflinclude hcoord inlemma nonpDegree_root_nonneg {n : ℕ} {m : M} (hm : HasRootDegree C n m) : 0≤nonpDegree coord p m := by obtain ⟨d,hd,hc,hm⟩:=root_coordinates C coord hcoord hm change 0≤∑i∈Finset.univ.erase p,coord m i apply Finset.sum_nonneg intro i hi rw [hc] positivityinclude hcoord inlemma nonpDegree_root_eq {n : ℕ} {m : M} (hm : HasRootDegree C n m) : nonpDegree coord p m+coord m p=(n:ℤ) := by obtain ⟨d,hd,hc,hm⟩:=root_coordinates C coord hcoord hm change (∑i∈Finset.univ.erase p,coord m i)+coord m p=(n:ℤ) rw [Finset.sum_erase_add _ _ (Finset.mem_univ p)] simp only [hc,←Nat.cast_sum,hd]include hcoord inlemma nonp_zero_root {n : ℕ} {m : M} (hm : HasRootDegree C n m) (hz : nonpDegree coord p m=0) : m=n • simpleRoot C p := by obtain ⟨d,hd,hc,he⟩:=root_coordinates C coord hcoord hm have hs : ∑i∈Finset.univ.erase p,(d i:ℤ)=0:=by simpa only [nonpDegree,AddMonoidHom.coe_mk,ZeroHom.coe_mk,hc] using hz have hz' : ∀i,i≠p → d i=0:=by intro i hi have HH:=Finset.sum_eq_zero_iff_of_nonneg (fun i (hi : i∈Finset.univ.erase p)=>Int.natCast_nonneg (d i)) |>.mp hs i (Finset.mem_erase.mpr ⟨hi,Finset.mem_univ i⟩) exact_mod_cast HH have hdp : d p=n:=by rw [←hd,Finset.sum_eq_single p] · intro i hi hp; exact hz' i hp · simp have hds : (fun i=>(d i:ℤ))=n • (Pi.single p 1 : I → ℤ):=by ext i by_cases hi : i=p · subst i; simp [hdp] · simp [hz' i hi,hi] rw [←he,hds,map_nsmul] rflinclude hcoord inlemma nonp_positive_off_cut {n : ℕ} (hn : 0<n) {m : M} (hm : HasRootDegree C n m) (h : M →+ ℝ) (hp : h (simpleRoot C p)≠0) (hm0 : h m=0) : 0<nonpDegree coord p m := by have hnon:=nonpDegree_root_nonneg C coord hcoord p hm by_contra hh have hz : nonpDegree coord p m=0:=by omega rw [nonp_zero_root C coord hcoord p hm hz,map_nsmul] at hm0 have hnR : (n:ℝ)≠0:=by exact_mod_cast (Nat.ne_of_gt hn) exact hp ((mul_eq_zero.mp (show (n:ℝ)*h (simpleRoot C p)=0 by simpa only [nsmul_eq_mul] using hm0)).resolve_left hnR)endend ElementaryPositivity.QuantumTorus
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889import Mathlibimport OAI.Combinatorics.Chromatic.QuantumTorus.GlobalFiberBound
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusnoncomputable sectionvariable {M I : Type*} [AddCommGroup M] [Fintype I] [DecidableEq I]variable (Ω : M →+ M →+ ℤ) (C : (I → ℤ) →+ M)variable (coord : M →+ (I → ℤ)) (hcoord : ∀d,coord (C d)=d) (pc : I)
def mutationSize : ℕ := (Finset.univ.erase pc).sup fun i=>(mutationPairing Ω C pc i).natAbs
lemma mutationSize_bound (i : I) (hi : i≠pc) : |mutationPairing Ω C pc i|≤(mutationSize Ω C pc:ℤ) := by have HH : (mutationPairing Ω C pc i).natAbs ≤ mutationSize Ω C pc:= Finset.le_sup (f:=fun i=>(mutationPairing Ω C pc i).natAbs) (Finset.mem_erase.mpr ⟨hi,Finset.mem_univ i⟩) simpa only [Int.natCast_natAbs] using (show ((mutationPairing Ω C pc i).natAbs:ℤ)≤(mutationSize Ω C pc:ℤ) from by exact_mod_cast HH)
lemma side_upper_le_abs (pos : Bool) (a : ℤ) : max 0 (-sideSign pos*a)≤|a| := by cases pos · simp only [sideSign,Bool.false_eq_true,ite_false,neg_neg,one_mul] exact max_le (abs_nonneg _) (le_abs_self _) · simp only [sideSign,ite_true,neg_mul,one_mul] exact max_le (abs_nonneg _) (neg_le_abs _)
include hcoord inlemma fiberUpper_degree_bound (pos : Bool) {n : ℕ} {m : M} (hm : HasRootDegree C n m) : fiberUpper coord pc (mutationPairing Ω C pc) (sideSign pos) m≤ (mutationSize Ω C pc:ℤ)*nonpDegree coord pc m := by obtain ⟨d,hd,hc,he⟩:=root_coordinates C coord hcoord hm change (∑i∈Finset.univ.erase pc,max 0 (-sideSign pos*mutationPairing Ω C pc i)*coord m i)≤ (mutationSize Ω C pc:ℤ)*(∑i∈Finset.univ.erase pc,coord m i) rw [Finset.mul_sum] apply Finset.sum_le_sum intro i hi apply mul_le_mul_of_nonneg_right · exact (side_upper_le_abs pos _).trans (mutationSize_bound Ω C pc i (Finset.mem_erase.mp hi).1) · rw [hc] exact Int.natCast_nonneg _
include hcoord inlemma fiber_full_degree_bound (pos : Bool) {n : ℕ} {m : M} (hm : HasRootDegree C n m) (hb : m∈fiberCone coord pc (mutationPairing Ω C pc) (sideSign pos)) : (n:ℤ)≤((mutationSize Ω C pc+1:ℕ):ℤ)*nonpDegree coord pc m := by have Hn:=nonpDegree_root_eq C coord hcoord pc hm have Hk:=hb.2.trans (fiberUpper_degree_bound Ω C coord hcoord pc pos hm) push_cast nlinarith
include hcoord inlemma mutation_root_image_bound (hΩ : ∀m,Ω m m=0) (pos : Bool) {n : ℕ} {m : M} (hm : HasRootDegree C n m) (hb : m∈fiberCone coord pc (mutationPairing Ω C pc) (sideSign pos)) : ∃d : ℕ,HasRootDegree (mutatedRoots Ω C pc) d (mutationLinearPiece Ω C pc pos m) ∧ (nonpDegree coord pc m:ℤ)≤(d:ℤ) ∧ n≤(mutationSize Ω C pc+1)*d := by obtain ⟨d,hd,hde⟩:=mutation_root_image Ω C coord hcoord pc hΩ pos hm hb have hwd : nonpDegree coord pc m≤(d:ℤ):=by have HB:=hb.2; omega have Hn:=fiber_full_degree_bound Ω C coord hcoord pc pos hm hb have HH : (n:ℤ)≤((mutationSize Ω C pc+1:ℕ):ℤ)*(d:ℤ):= Hn.trans (mul_le_mul_of_nonneg_left hwd (Int.natCast_nonneg _)) refine ⟨d,hd,hwd,?_⟩ exact_mod_cast HH
variable {E : Type*} [AddCommGroup E] [Module ℝ E]variable (e : M →+ E) (he : Function.Injective e)variable (B : E →ₗ[ℝ] E →ₗ[ℝ] ℝ) (hB : ∀x,B x x=0)variable (hcomp : ∀a b,B (e a) (e b)=(Ω a b:ℝ))variable (L : Module.Dual ℝ E) (hdeg : ∀d m,HasRootDegree C d m → L (e m)=(d:ℝ))include hcoord he hB hcomp hdeg intheorem actual_wall_mutation_root_bound (r : M) (dr : ℕ) (hdr : 0<dr) (hrd : HasRootDegree C dr r) (h : Module.Dual ℝ E) (hg : ∀N,RayGeneric C N r (h.toAddMonoidHom.comp e)) (pos : Bool) (hside : cutSide pos (h.toAddMonoidHom.comp e) (simpleRoot C pc)) (j : ℕ) (m : M) (hm : PowerSeries.coeff j (chartZero WallUnits.LaurentRay.vUnit Ω C (h.toAddMonoidHom.comp e) (simpleTotalTransport Ω C)).val m≠0) : ∃d : ℕ,HasRootDegree (mutatedRoots Ω C pc) d (mutationLinearPiece Ω C pc pos m) ∧ nonpDegree coord pc m≤(d:ℤ) ∧ j≤(mutationSize Ω C pc+1)*d := by have hΩ : ∀m,Ω m m=0:=by intro m; have HH:=hB (e m); rw [hcomp] at HH; exact_mod_cast HH exact mutation_root_image_bound Ω C coord hcoord pc hΩ pos (chart_root_of_ne WallUnits.LaurentRay.vUnit Ω C _ j m hm) (simple_fiber_bound Ω C coord hcoord pc e he B hB hcomp L hdeg r dr hdr hrd h hg pos hside j m hm)endend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100import Mathlibimport OAI.Combinatorics.Chromatic.Walls.CompletedCutActionimport OAI.Combinatorics.Chromatic.Walls.HalfspaceLaurentTransport
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusnoncomputable sectionvariable {K M I : Type*} [Field K] [AddCommGroup M] [Fintype I] [DecidableEq I]variable (v : Kˣ) (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (C : (I → ℤ) →+ M) (pc : I) (pos : Bool)local instance : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroupdef mutationTorusEquiv : Torus v Ω ≃+* Torus v Ω := { Equiv.ofBijective (mutationTorusPush Ω hΩ C pc pos v : Torus v Ω → Torus v Ω) ⟨Finsupp.mapDomain_injective (mutationLinearPiece_injective Ω hΩ C pc pos), Finsupp.mapDomain_surjective (mutationLinearPiece_surjective Ω hΩ C pc pos)⟩ with map_mul' := (mutationTorusPush Ω hΩ C pc pos v).map_mul map_add' := (mutationTorusPush Ω hΩ C pc pos v).map_add }
endend ElementaryPositivity.QuantumTorusnamespace ElementaryPositivity.RationalFiberopen QuantumTorus PowerSeries WallUnits FiniteRayGeometrynoncomputable sectionvariable {M I : Type*} [AddCommGroup M] [Fintype I] [DecidableEq I]variable (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (C : (I → ℤ) →+ M) (coord : M →+ (I → ℤ))variable (hcoord : ∀d,coord (C d)=d) (pc : I)local instance : Ring (Torus LaurentRay.vUnit Ω) := Torus.instRing LaurentRay.vUnit Ωlocal instance : AddCommMonoid (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddCommMonoidlocal instance : AddGroup (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddGroupomit [Fintype I] inlemma mutationSideAction_embed [Fintype I] (pos : Bool) (f : PowerSeries (Torus LaurentRay.vUnit Ω)) : mutationSideAction LaurentRay.vUnit (complementOmega (pureDegree coord pc) Ω) (complementAlpha (pureDegree coord pc) (simpleRoot C pc) Ω) pos (PowerSeries.map (embed LaurentRay.vUnit Ω hΩ (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc)) f)= PowerSeries.map (embed LaurentRay.vUnit Ω hΩ (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc)) (PowerSeries.map (mutationTorusEquiv LaurentRay.vUnit Ω hΩ C pc pos).toRingHom f) := by cases pos · exact completedShearAction_embed LaurentRay.vUnit Ω hΩ _ _ _ f · simp only [mutationSideAction, ite_true, RingEquiv.refl_apply] apply PowerSeries.ext intro D simp only [coeff_map] congr 1 change (coeff (R := Torus LaurentRay.vUnit Ω) D f)=Finsupp.mapDomain id (coeff (R := Torus LaurentRay.vUnit Ω) D f) exact (Finsupp.mapDomain_id).symmlemma mutationSideAction_inverse_embed (pos : Bool) (f : PowerSeries (Torus LaurentRay.vUnit Ω)) : (mutationSideAction LaurentRay.vUnit (complementOmega (pureDegree coord pc) Ω) (complementAlpha (pureDegree coord pc) (simpleRoot C pc) Ω) pos).symm (PowerSeries.map (embed LaurentRay.vUnit Ω hΩ (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc)) f)= PowerSeries.map (embed LaurentRay.vUnit Ω hΩ (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc)) (PowerSeries.map (mutationTorusEquiv LaurentRay.vUnit Ω hΩ C pc pos).symm.toRingHom f) := by apply (mutationSideAction LaurentRay.vUnit (complementOmega (pureDegree coord pc) Ω) (complementAlpha (pureDegree coord pc) (simpleRoot C pc) Ω) pos).injective rw [RingEquiv.apply_symm_apply,mutationSideAction_embed Ω hΩ C coord hcoord pc] congr 1 apply PowerSeries.ext intro D simp only [coeff_map,RingEquiv.toRingHom_eq_coe,RingEquiv.coe_toRingHom,RingEquiv.apply_symm_apply]
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E]variable (e : M →+ E) (he : Function.Injective e)variable (S : E →ₗ[ℝ] E →ₗ[ℝ] ℝ) (hS : ∀x,S x x=0)variable (hcomp : ∀a b,S (e a) (e b)=(Ω a b:ℝ))variable (L : Module.Dual ℝ E) (hdeg : ∀n m,HasRootDegree C n m → L (e m)=(n:ℝ))
theorem pushedRationalTransport_laurent_lift {a b : Module.Dual ℝ E} (HA : RegularCovector C e a) (HB : RegularCovector C e b) (Hside : (0 < a (e (simpleRoot C pc)) ∧ 0 < b (e (simpleRoot C pc))) ∨ (a (e (simpleRoot C pc)) < 0 ∧ b (e (simpleRoot C pc)) < 0)) (f : PowerSeries (Torus LaurentRay.vUnit Ω)) : ∃g : PowerSeries (Torus LaurentRay.vUnit Ω), pushedRationalTransport Ω hΩ C coord hcoord pc e he S hS hcomp L hdeg HA HB (PowerSeries.map (embed LaurentRay.vUnit Ω hΩ (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc)) f)= PowerSeries.map (embed LaurentRay.vUnit Ω hΩ (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc)) g := by classical rw [pushedRationalTransport_apply] unfold covectorSideAction rw [mutationSideAction_inverse_embed Ω hΩ C coord hcoord pc] obtain ⟨g,hg⟩:=completedTransport_laurent_lift Ω hΩ C coord hcoord pc e he S hS hcomp L hdeg HA HB Hside (PowerSeries.map (mutationTorusEquiv LaurentRay.vUnit Ω hΩ C pc (decide (0 < a (e (simpleRoot C pc))))).symm.toRingHom f) rw [hg,mutationSideAction_embed Ω hΩ C coord hcoord pc] exact ⟨_,rfl⟩endend ElementaryPositivity.RationalFiber
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108import Mathlibimport OAI.Combinatorics.Chromatic.Walls.MutatedPathCompletionimport OAI.Combinatorics.Chromatic.Walls.FiniteFiberInfinity
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeries WallUnitsnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M] (v : Rˣ) (Ω : M →+ M →+ ℤ)local instance : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGrouplemma inverse_support_addSubmonoid (P : AddSubmonoid M) (f : PowerSeries (Torus v Ω)) (hf : ∀n m,coeff n f m≠0 → m∈P) : ∀n m,coeff n (invOfUnit f 1) m≠0 → m∈P := by classical intro n induction n using Nat.strong_induction_on with | h n ih=> intro m hm by_cases hn : n=0 · subst n rw [coeff_invOfUnit,ite_eq_left rfl] at hm have hm0 : m=0:=by by_contra hh apply hm change Finsupp.single 0 (1:R) m=0 exact Finsupp.single_eq_of_ne hh exact hm0 ▸ P.zero_mem · rw [coeff_invOfUnit,ite_eq_right hn] at hm simp only [inv_one,Units.val_one] at hm rw [torus_neg_one_mul] at hm change -(∑ab∈Finset.HasAntidiagonal.antidiagonal n, if ab.2<n then coeff ab.1 f*coeff ab.2 (invOfUnit f 1) else 0) m≠0 at hm have HH:=neg_ne_zero.mp hm rw [nonp_torus_eval_sum] at HH obtain ⟨ab,hab,hz⟩:=Finset.exists_ne_zero_of_sum_ne_zero HH have hb : ab.2<n:=by by_contra hh; simp [hh] at hz rw [ite_eq_left hb] at hz obtain ⟨a,b,ha,hb',he⟩:=torus_product_nonzero v Ω _ _ m hz exact he ▸ P.add_mem (hf ab.1 a ha) (ih ab.2 hb b hb')endend ElementaryPositivity.QuantumTorusnamespace ElementaryPositivity.RationalFiberopen QuantumTorus PowerSeries WallUnits FiniteRayGeometrynoncomputable sectionvariable {M I : Type*} [AddCommGroup M] [Fintype I] [DecidableEq I]variable (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (C : (I → ℤ) →+ M) (coord : M →+ (I → ℤ))variable (hcoord : ∀d,coord (C d)=d) (pc : I) (pos : Bool)local instance : Ring (Torus LaurentRay.vUnit Ω) := Torus.instRing LaurentRay.vUnit Ωlocal instance : AddCommMonoid (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddCommMonoidlocal instance : AddGroup (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddGroup
theorem mutation_rational_oriented_compatibility (b : Bool) (f : CompletedPositive LaurentRay.vUnit Ω C) (hf : ∀n m,coeff n f.val m≠0 → m∈fiberCone coord pc (mutationPairing Ω C pc) (sideSign pos)) : mutationSideAction LaurentRay.vUnit (complementOmega (pureDegree coord pc) Ω) (complementAlpha (pureDegree coord pc) (simpleRoot C pc) Ω) pos (rationalRegrade LaurentRay.vUnit Ω hΩ (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc) (nonpDegree coord pc) (mutationSize Ω C pc+1) (orientPowerSeries b f.val))= rationalRegrade LaurentRay.vUnit Ω hΩ (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc) (nonpDegree (mutatedCoordinates Ω C coord pc) pc) (mutationSize Ω C pc+1) (mutationCompletion Ω hΩ C coord pc pos LaurentRay.vUnit (orientPowerSeries b f.val)) := by let g : CompletedPositive LaurentRay.vUnit Ω C:=⟨orientPowerSeries b f.val, orientPowerSeries_constant b f.val f.property.1,orientPowerSeries_graded Ω C b f.val f.property.2⟩ have hg : ∀n m,coeff n g.val m≠0 → m∈fiberCone coord pc (mutationPairing Ω C pc) (sideSign pos):=by cases b · exact inverse_support_addSubmonoid LaurentRay.vUnit Ω _ f.val hf · exact hf exact mutation_rational_compatibility Ω hΩ C coord hcoord pc pos g hg
variable {E : Type*} [AddCommGroup E] [Module ℝ E]variable (e : M →+ E) (he : Function.Injective e)variable (S : E →ₗ[ℝ] E →ₗ[ℝ] ℝ) (hS : ∀x,S x x=0)variable (hcomp : ∀a b,S (e a) (e b)=(Ω a b:ℝ))variable (L : Module.Dual ℝ E) (hdeg : ∀n m,HasRootDegree C n m → L (e m)=(n:ℝ))variable (v k : Module.Dual ℝ E)variable (H : ∀N,GenericOffset (realRootsThrough e C N) 0 v k)include hS hcomp intheorem mutatedLineFactor_rational_nocut (a : ℝ) (ha : ∃N,a∈lineEvents (realRootsThrough e C N) v k) (hs : cutSide pos ((k+a • v).toAddMonoidHom.comp e) (simpleRoot C pc)) : mutationSideAction LaurentRay.vUnit (complementOmega (pureDegree coord pc) Ω) (complementAlpha (pureDegree coord pc) (simpleRoot C pc) Ω) pos (rationalRegrade LaurentRay.vUnit Ω hΩ (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc) (nonpDegree coord pc) (mutationSize Ω C pc+1) (noncutOldLineFactor Ω C e he L hdeg v k H a))= rationalRegrade LaurentRay.vUnit Ω hΩ (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc) (nonpDegree (mutatedCoordinates Ω C coord pc) pc) (mutationSize Ω C pc+1) (mutatedLineFactor Ω hΩ C coord pc e he L hdeg v k H a) := by classical rw [mutatedLineFactor_nocut Ω hΩ C coord pc e he L hdeg v k H pos a hs] unfold noncutOldLineFactor rw [dite_eq_left ha] let data:=lineRayData C e he L hdeg v k H a ha exact mutation_rational_oriented_compatibility Ω hΩ C coord hcoord pc pos _ _ (simple_fiber_bound Ω C coord hcoord pc e he S hS hcomp L hdeg data.root data.degree data.degree_pos data.root_degree (k+a • v) data.generic pos hs)endend ElementaryPositivity.RationalFiber
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175import Mathlibimport OAI.Combinatorics.Chromatic.Walls.RationalCutIdentityimport OAI.Combinatorics.Chromatic.QuantumTorus.SymplecticTorusMapimport OAI.Combinatorics.Chromatic.QuantumTorus.MutationFiberArithmetic
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusnoncomputable sectionvariable {M I : Type*} [AddCommGroup M] [Fintype I] [DecidableEq I]variable (Ω : M →+ M →+ ℤ) (C : (I → ℤ) →+ M)variable (coord : M →+ (I → ℤ)) (hcoord : ∀d,coord (C d)=d) (pc : I)
def mutationShear (p : M) : M →+ M where toFun m:=m-(Ω p m) • p map_zero':=by simp map_add':=by intro a b; simp only [map_add,add_zsmul]; abel
def mutationShearInverse (p : M) : M →+ M where toFun m:=m+(Ω p m) • p map_zero':=by simp map_add':=by intro a b; simp only [map_add,add_zsmul]; abel
lemma mutationShear_left_inverse (p : M) (hp : Ω p p=0) (m : M) : mutationShearInverse Ω p (mutationShear Ω p m)=m := by change (m-Ω p m • p)+Ω p (m-Ω p m • p) • p=m rw [map_sub,map_zsmul,hp,smul_zero,sub_zero,sub_add_cancel]lemma mutationShear_right_inverse (p : M) (hp : Ω p p=0) (m : M) : mutationShear Ω p (mutationShearInverse Ω p m)=m := by change (m+Ω p m • p)-Ω p (m+Ω p m • p) • p=m rw [map_add,map_zsmul,hp,smul_zero,add_zero,add_sub_cancel_right]
def mutationShearEquiv (p : M) (hp : Ω p p=0) : M ≃+ M where toFun:=mutationShear Ω p invFun:=mutationShearInverse Ω p left_inv:=mutationShear_left_inverse Ω p hp right_inv:=mutationShear_right_inverse Ω p hp map_add':=(mutationShear Ω p).map_add
lemma mutationShear_pairing (hΩ : ∀m,Ω m m=0) (p a b : M) : Ω (mutationShear Ω p a) (mutationShear Ω p b)=Ω a b := by have hs : Ω a p= -Ω p a:=by have H:=hΩ (a+p) simp only [map_add,AddMonoidHom.add_apply,hΩ] at H omega change Ω (a-Ω p a • p) (b-Ω p b • p)=Ω a b simp only [map_sub,map_zsmul,AddMonoidHom.sub_apply,AddMonoidHom.zsmul_apply, smul_eq_mul,hΩ,hs] ring
def mutatedCoefficientMap (α : I → ℤ) : (I → ℤ) →+ (I → ℤ) where toFun d:=fun i=>if i=pc then -d pc+∑j∈Finset.univ.erase pc,max 0 (-α j)*d j else d i map_zero':=by ext i; simp map_add':=by intro a b; ext i by_cases hi : i=pc · subst i; simp only [ite_true,Pi.add_apply,neg_add,mul_add,Finset.sum_add_distrib]; ring · simp [hi]
@[simp] lemma mutatedCoefficientMap_off (α : I → ℤ) (d : I → ℤ) (i : I) (hi : i≠pc) : mutatedCoefficientMap pc α d i=d i := by simp [mutatedCoefficientMap,hi]@[simp] lemma mutatedCoefficientMap_at (α : I → ℤ) (d : I → ℤ) : mutatedCoefficientMap pc α d pc= -d pc+∑j∈Finset.univ.erase pc,max 0 (-α j)*d j := by simp [mutatedCoefficientMap]
lemma mutatedCoefficientMap_involutive (α : I → ℤ) : Function.Involutive (mutatedCoefficientMap pc α) := by intro d; ext i by_cases hi : i=pc · subst i rw [mutatedCoefficientMap_at,mutatedCoefficientMap_at] have HH : (∑j∈Finset.univ.erase pc,max 0 (-α j)*mutatedCoefficientMap pc α d j)= ∑j∈Finset.univ.erase pc,max 0 (-α j)*d j:=by apply Finset.sum_congr rfl intro j hj rw [mutatedCoefficientMap_off pc α d j (Finset.mem_erase.mp hj).1] rw [HH]; ring · rw [mutatedCoefficientMap_off pc α _ i hi,mutatedCoefficientMap_off pc α _ i hi]
def mutatedRoots : (I → ℤ) →+ M := C.comp (mutatedCoefficientMap pc (mutationPairing Ω C pc))def mutatedCoordinates : M →+ (I → ℤ) := (mutatedCoefficientMap pc (mutationPairing Ω C pc)).comp coord
include hcoord inlemma mutatedCoordinates_retraction (d : I → ℤ) : mutatedCoordinates Ω C coord pc (mutatedRoots Ω C pc d)=d := by change mutatedCoefficientMap pc (mutationPairing Ω C pc) (coord (C (mutatedCoefficientMap pc (mutationPairing Ω C pc) d)))=d rw [hcoord] exact mutatedCoefficientMap_involutive pc _ d
lemma mutatedRoot_p : simpleRoot (mutatedRoots Ω C pc) pc= -simpleRoot C pc := by have he : mutatedCoefficientMap pc (mutationPairing Ω C pc) (Pi.single pc 1)= -(Pi.single pc 1 : I → ℤ):=by ext i by_cases hi : i=pc · subst i rw [mutatedCoefficientMap_at] have HH : (∑j∈Finset.univ.erase pc,max 0 (-mutationPairing Ω C pc j)*((Pi.single pc 1 : I → ℤ) j))=0:=by apply Finset.sum_eq_zero intro j hj simp [(Finset.mem_erase.mp hj).1] rw [HH]; simp · rw [mutatedCoefficientMap_off pc _ _ i hi] simp [hi] change C (mutatedCoefficientMap pc (mutationPairing Ω C pc) (Pi.single pc 1))= -C (Pi.single pc 1) rw [he,map_neg]
lemma mutatedRoot_off (i : I) (hi : i≠pc) : simpleRoot (mutatedRoots Ω C pc) i=simpleRoot C i+ max 0 (-mutationPairing Ω C pc i) • simpleRoot C pc := by have he : mutatedCoefficientMap pc (mutationPairing Ω C pc) (Pi.single i 1)= (Pi.single i 1 : I → ℤ)+max 0 (-mutationPairing Ω C pc i) • Pi.single pc 1:=by ext j by_cases hj : j=pc · subst j rw [mutatedCoefficientMap_at] have HH : (∑a∈Finset.univ.erase pc,max 0 (-mutationPairing Ω C pc a)*((Pi.single i 1 : I → ℤ) a))= max 0 (-mutationPairing Ω C pc i):=by rw [Finset.sum_eq_single i] · simp · intro a ha hai; simp [hai] · simp [hi] rw [HH] simp [Ne.symm hi] · rw [mutatedCoefficientMap_off pc _ _ j hj] simp [Pi.single_apply,hj] change C (mutatedCoefficientMap pc (mutationPairing Ω C pc) (Pi.single i 1))=_ rw [he,map_add,map_zsmul] rfl
endend ElementaryPositivity.QuantumTorus
endsectionnamespace ElementaryPositivity.QuantumTorusopen WallUnitsnoncomputable sectionvariable {K M : Type*} [Field K] [AddCommGroup M]variable (v : Kˣ) (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)def centeredCrossing (p m : M) (t : ℕ) : Torus v Ω := ∑j : Fin (t+1),Torus.monomial v Ω (m+(j:ℕ) • p) ((centeredPolynomial v t).coeff j)include hΩ inlemma cut_centered_identity (p m : M) (t : ℕ) (ht : Ω p m=(t:ℤ)) : Torus.push v Ω Ω (mutationShear Ω p) (mutationShear_pairing Ω hΩ p) (centeredCrossing v Ω p m t)=centeredCrossing v Ω (-p) m t := by unfold centeredCrossing rw [map_sum] have H (j : Fin (t+1)) : Torus.push v Ω Ω (mutationShear Ω p) (mutationShear_pairing Ω hΩ p) (Torus.monomial v Ω (m+(j:ℕ) • p) ((centeredPolynomial v t).coeff j))= Torus.monomial v Ω (m+(j.rev:ℕ) • (-p)) ((centeredPolynomial v t).coeff j.rev) := by rw [Torus.push_monomial] have hj : (j:ℕ)≤t := by have HH:=j.isLt; omega have hr : (j.rev:ℕ)=t-(j:ℕ):=by rw [Fin.val_rev]; omega have he : mutationShear Ω p (m+(j:ℕ) • p)=m+(j.rev:ℕ) • (-p) := by change (m+(j:ℕ) • p)-Ω p (m+(j:ℕ) • p) • p=_ rw [map_add,map_nsmul,hΩ,smul_zero,add_zero,ht] rw [←natCast_zsmul,←natCast_zsmul,smul_neg] rw [hr] have Hcast : ((t-(j:ℕ):ℕ):ℤ)=(t:ℤ)-(j:ℕ):=by omega rw [Hcast,sub_smul] abel rw [he,hr,centeredPolynomial_coeff_symmetry v t j hj] simp_rw [H] exact Equiv.sum_comp Fin.revPerm (fun j : Fin (t+1)=>Torus.monomial v Ω (m+(j:ℕ) • (-p)) ((centeredPolynomial v t).coeff j))endend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245import Mathlib
namespace OAI
sectionnamespace ElementaryPositivity.FiniteLogopen PowerSeries
lemma subst_one {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] {g : PowerSeries S} (hg : HasSubst g) : (1 : PowerSeries R).subst g=1 :=by rw [←coe_substAlgHom hg,map_one]
lemma deriv_log_mul_one_add_X : derivative (log ℚ) * (1+X)=1 := by rw [derivative_log,mul_add,mul_one] ext n cases n with | zero => simp | succ n => simp only [map_add,coeff_mk,coeff_succ_mul_X,coeff_one, Nat.succ_ne_zero,ite_false,pow_succ] simp
lemma log_subst_exp_sub_one : (log ℚ).subst (exp ℚ-1)=X := by apply derivative.ext · rw [derivative_subst HasSubst.exp_sub_one,derivative_X,map_sub,derivative_exp, derivative_one,sub_zero] have h := congrArg (fun f : PowerSeries ℚ=>f.subst (exp ℚ-1)) deriv_log_mul_one_add_X simpa only [subst_mul HasSubst.exp_sub_one,subst_add HasSubst.exp_sub_one, subst_one HasSubst.exp_sub_one,subst_X HasSubst.exp_sub_one,add_sub_assoc,add_comm (1 : PowerSeries ℚ),add_sub_cancel_right,sub_add_cancel] using h · rw [constantCoeff_X] exact constantCoeff_subst_eq_zero (show MvPowerSeries.constantCoeff (exp ℚ-1)=0 from by change constantCoeff (exp ℚ-1)=0 simp) _ (constantCoeff_log)
lemma subst_reverse {R : Type*} [CommRing R] (f g : PowerSeries R) (hf : constantCoeff f=0) (hg : constantCoeff g=0) (hu : IsUnit (coeff 1 f)) (hfg : f.subst g=X) : g.subst f=X := by let h := f.substInvOfIsUnit hu have hF : HasSubst f := HasSubst.of_constantCoeff_zero' hf have hG : HasSubst g := HasSubst.of_constantCoeff_zero' hg have hlf : PowerSeries.subst f h=X := subst_substInvOfIsUnit_left f hf hu have heq : g=h := by calc g=PowerSeries.subst g (X : PowerSeries R) := (subst_X hG).symm _=PowerSeries.subst g (PowerSeries.subst f h) := by rw [hlf] _=PowerSeries.subst (PowerSeries.subst g f) h := by rw [subst_comp_subst_apply (R := R) (S := R) (T := R) (υ := Unit) hF hG] _=h := by rw [hfg,X_subst] simpa only [heq] using hlf
lemma exp_subst_log : (exp ℚ).subst (log ℚ)=1+X := by have h := subst_reverse (log ℚ) (exp ℚ-1) (by simp) (by simp) (by simp) log_subst_exp_sub_one rw [subst_sub HasSubst.log,subst_one HasSubst.log] at h exact sub_eq_iff_eq_add.mp h |>.trans (add_comm _ _)
end ElementaryPositivity.FiniteLog
endsectionnamespace ElementaryPositivity.FiniteLogopen PowerSeries
variable {A B : Type*} [Ring A] [Ring B] [Algebra ℚ A] [Algebra ℚ B]
noncomputable def nilEval (x : A) (f : PowerSeries ℚ) : A := ∑ i ∈ Finset.range (nilpotencyClass x), coeff i f • x^i
lemma nilEval_eq_sum {x : A} {n : ℕ} (hn : x^n=0) (f : PowerSeries ℚ) : nilEval x f=∑ i ∈ Finset.range n,coeff i f • x^i := by apply Finset.sum_subset (Finset.range_mono (csInf_le' hn)) intro i hi hni rw [Finset.mem_range,not_lt] at hni rw [pow_eq_zero_of_le hni (pow_nilpotencyClass ⟨n,hn⟩),smul_zero]
lemma map_nilEval (φ : A →ₐ[ℚ] B) {x : A} (hx : IsNilpotent x) (f : PowerSeries ℚ) : φ (nilEval x f)=nilEval (φ x) f := by obtain ⟨n,hn⟩ := hx rw [nilEval_eq_sum hn,nilEval_eq_sum (show (φ x)^n=0 by rw [←map_pow,hn,map_zero])] simp only [map_sum,map_smul,map_pow]
lemma nilEval_exp {x : A} (hx : IsNilpotent x) : nilEval x (exp ℚ)=IsNilpotent.exp x := by obtain ⟨n,hn⟩ := hx rw [nilEval_eq_sum hn,IsNilpotent.exp_eq_sum hn] congr 1 ext i simp only [coeff_exp,one_div,Algebra.algebraMap_self,RingHom.id_apply]
section CommRingvariable {S : Type*} [CommRing S] [Algebra ℚ S]
omit [Algebra ℚ S] inlemma substConst_hasSubst {x : S} (hx : IsNilpotent x) : HasSubst (C x : PowerSeries S) := by change IsNilpotent (constantCoeff (C x)) rwa [constantCoeff_C]
lemma nilEval_eq_constantCoeff {x : S} (hx : IsNilpotent x) (f : PowerSeries ℚ) : nilEval x f=constantCoeff (PowerSeries.subst (C x : PowerSeries S) f) := by rw [show constantCoeff (PowerSeries.subst (C x : PowerSeries S) f)= MvPowerSeries.constantCoeff (PowerSeries.subst (C x : PowerSeries S) f) from rfl, constantCoeff_subst (substConst_hasSubst hx)] simp only [map_pow,show MvPowerSeries.constantCoeff (C x : PowerSeries S)=x from constantCoeff_C x] symm apply finsum_eq_sum_of_support_subset intro i hi by_contra h rw [Finset.mem_coe,Finset.mem_range,not_lt] at h apply hi change coeff i f • x^i=0 rw [pow_eq_zero_of_le h (pow_nilpotencyClass hx),smul_zero]
noncomputable def nilEvalAlgHom {x : S} (hx : IsNilpotent x) : PowerSeries ℚ →ₐ[ℚ] S := (constantCoeff : PowerSeries S →+* S).toRatAlgHom.comp (substAlgHom (substConst_hasSubst hx))
lemma nilEvalAlgHom_apply {x : S} (hx : IsNilpotent x) (f : PowerSeries ℚ) : nilEvalAlgHom hx f=nilEval x f := by rw [nilEval_eq_constantCoeff hx] change constantCoeff ((substAlgHom (substConst_hasSubst hx)) f)=_ rw [coe_substAlgHom]
lemma subst_eq_nilEval {z : PowerSeries S} (hz : IsNilpotent z) (f : PowerSeries ℚ) : PowerSeries.subst z f=nilEval z f := by ext n rw [coeff_subst' (hz.map constantCoeff)] simp only [nilEval,map_sum] apply finsum_eq_sum_of_support_subset intro i hi by_contra h rw [Finset.mem_coe,Finset.mem_range,not_lt] at h apply hi change coeff i f • coeff n (z^i)=0 rw [pow_eq_zero_of_le h (pow_nilpotencyClass hz),map_zero,smul_zero]
lemma subst_C_nilEval {x : S} (hx : IsNilpotent x) (f : PowerSeries ℚ) : PowerSeries.subst (C x : PowerSeries S) f=C (nilEval x f) := by rw [subst_eq_nilEval (hx.map C)] exact (map_nilEval (C : S →+* PowerSeries S).toRatAlgHom hx f).symm
lemma nilEval_nilpotent {x : S} (hx : IsNilpotent x) {f : PowerSeries ℚ} (hf : constantCoeff f=0) : IsNilpotent (nilEval x f) := by rw [nilEval_eq_constantCoeff hx] have h := (HasSubst.of_constantCoeff_zero' hf).comp (substConst_hasSubst hx) rwa [coe_substAlgHom] at h
lemma nilEval_subst {x : S} (hx : IsNilpotent x) {f : PowerSeries ℚ} (hf : constantCoeff f=0) (g : PowerSeries ℚ) : nilEval (nilEval x f) g=nilEval x (PowerSeries.subst f g) := by calc _=constantCoeff (PowerSeries.subst (C (nilEval x f) : PowerSeries S) g) := nilEval_eq_constantCoeff (nilEval_nilpotent hx hf) g _=constantCoeff (PowerSeries.subst (PowerSeries.subst (C x : PowerSeries S) f) g) := by rw [subst_C_nilEval hx f] _=constantCoeff (PowerSeries.subst (C x : PowerSeries S) (PowerSeries.subst f g)) := by exact congrArg constantCoeff (subst_comp_subst_apply (R := ℚ) (S := ℚ) (T := S) (υ := Unit) (HasSubst.of_constantCoeff_zero' hf) (substConst_hasSubst hx) g).symm _=_ := (nilEval_eq_constantCoeff hx (PowerSeries.subst f g)).symm
lemma nilEval_X {x : S} (hx : IsNilpotent x) : nilEval x X=x := by rw [nilEval_eq_constantCoeff hx,subst_X (substConst_hasSubst hx),constantCoeff_C]
lemma nilEval_one {x : S} (hx : IsNilpotent x) : nilEval x 1=1 := by rw [←nilEvalAlgHom_apply hx,map_one]
lemma nilEval_add {x : S} (hx : IsNilpotent x) (f g : PowerSeries ℚ) : nilEval x (f+g)=nilEval x f+nilEval x g := by simp only [←nilEvalAlgHom_apply hx,map_add]
lemma nilEval_sub {x : S} (hx : IsNilpotent x) (f g : PowerSeries ℚ) : nilEval x (f-g)=nilEval x f-nilEval x g := by simp only [←nilEvalAlgHom_apply hx,map_sub]
lemma exp_nilEval_log {x : S} (hx : IsNilpotent x) : IsNilpotent.exp (nilEval x (log ℚ))=1+x := by rw [←nilEval_exp (nilEval_nilpotent hx constantCoeff_log), nilEval_subst hx constantCoeff_log,exp_subst_log,nilEval_add hx,nilEval_one hx,nilEval_X hx]
lemma nilEval_log_exp_sub_one {x : S} (hx : IsNilpotent x) : nilEval (IsNilpotent.exp x-1) (log ℚ)=x := by rw [←nilEval_exp hx,←nilEval_one hx,←nilEval_sub hx, nilEval_subst hx (by simp),log_subst_exp_sub_one,nilEval_X hx]
lemma nilEval_log_mul_comm {x y : S} (hx : IsNilpotent x) (hy : IsNilpotent y) : nilEval ((1+x)*(1+y)-1) (log ℚ)=nilEval x (log ℚ)+nilEval y (log ℚ) := by have hlx := nilEval_nilpotent hx (constantCoeff_log (A := ℚ)) have hly := nilEval_nilpotent hy (constantCoeff_log (A := ℚ)) have hs := nilEval_log_exp_sub_one ((Commute.all _ _).isNilpotent_add hlx hly) rw [IsNilpotent.exp_add_of_commute (Commute.all _ _) hlx hly, exp_nilEval_log hx,exp_nilEval_log hy] at hs exact hs
omit [Algebra ℚ S] inlemma nilpotent_one_add_mul_sub_one {x y : S} (hx : IsNilpotent x) (hy : IsNilpotent y) : IsNilpotent ((1+x)*(1+y)-1) := by rw [show (1+x)*(1+y)-1=x+y+x*y by ring] exact (Commute.all _ _).isNilpotent_add ((Commute.all _ _).isNilpotent_add hx hy) ((Commute.all _ _).isNilpotent_mul_right hx)
end CommRing
open scoped IsMulCommutative inlemma nilEval_log_mul_of_commute {x y : A} (hxy : Commute x y) (hx : IsNilpotent x) (hy : IsNilpotent y) : nilEval ((1+x)*(1+y)-1) (log ℚ)=nilEval x (log ℚ)+nilEval y (log ℚ) := by let s : Set A := {x,y} have hs : ∀ u ∈ s, ∀ v ∈ s, u*v=v*u := by intro u hu v hv rcases hu with rfl | hu · rcases hv with rfl | hv · rfl · rw [Set.mem_singleton_iff] at hv subst v exact hxy.eq · rw [Set.mem_singleton_iff] at hu subst u rcases hv with rfl | hv · exact hxy.eq.symm · rw [Set.mem_singleton_iff] at hv subst v rfl let T := Algebra.adjoin ℚ s let : IsMulCommutative T := Algebra.isMulCommutative_adjoin ℚ (fun left hleft right hright _ => hs left hleft right hright) let : CommRing T := inferInstance let tx : T := ⟨x,Algebra.subset_adjoin (Set.mem_insert x _)⟩ let ty : T := ⟨y,Algebra.subset_adjoin (Set.mem_insert_of_mem x (Set.mem_singleton y))⟩ have htx : IsNilpotent tx := by obtain ⟨n,hn⟩ := hx exact ⟨n,Subtype.ext hn⟩ have hty : IsNilpotent ty := by obtain ⟨n,hn⟩ := hy exact ⟨n,Subtype.ext hn⟩ have h := congrArg (Algebra.adjoin ℚ s).val (nilEval_log_mul_comm htx hty) rw [map_nilEval _ (nilpotent_one_add_mul_sub_one htx hty),map_add, map_nilEval _ htx,map_nilEval _ hty,map_sub,map_mul,map_add,map_add,map_one] at h exact h
end ElementaryPositivity.FiniteLog
end
end OAI12345678910111213141516171819202122232425262728293031323334353637import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.NilpotentLogarithm
namespace OAI
sectionnamespace ElementaryPositivity.FiniteLogopen PowerSeriesvariable {A : Type*} [Ring A] [Algebra ℚ A]
open scoped IsMulCommutative inlemma nilEval_exp_log {x : A} (hx : IsNilpotent x) : nilEval (nilEval x (log ℚ)) (exp ℚ)=1+x := by let s : Set A := {x} have hs : ∀ u ∈ s, ∀ v ∈ s, u*v=v*u := by intro u hu v hv rw [Set.mem_singleton_iff] at hu hv subst u; subst v; rfl let T := Algebra.adjoin ℚ s let : IsMulCommutative T := Algebra.isMulCommutative_adjoin ℚ (fun left hleft right hright _ => hs left hleft right hright) let : CommRing T := inferInstance let tx : T := ⟨x,Algebra.subset_adjoin (Set.mem_singleton x)⟩ have htx : IsNilpotent tx := by obtain ⟨n,hn⟩ := hx exact ⟨n,Subtype.ext hn⟩ have h := congrArg (Algebra.adjoin ℚ s).val (exp_nilEval_log htx) rw [←nilEval_exp (nilEval_nilpotent htx (constantCoeff_log (A := ℚ))), map_nilEval _ (nilEval_nilpotent htx (constantCoeff_log (A := ℚ))), map_nilEval _ htx,map_add,map_one] at h exact h
end ElementaryPositivity.FiniteLog
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108import Mathlib
namespace OAI
sectionnamespace ElementaryPositivity.PowerSeriesDilateopen PowerSeriesnoncomputable sectionvariable {R : Type*} [Semiring R]variable (w : ℕ) (hw : 0<w)
def dilate (f : PowerSeries R) : PowerSeries R := mk (fun n=>if w∣n then coeff (n/w) f else 0)
@[simp] lemma coeff_dilate (f : PowerSeries R) (n : ℕ) : coeff n (dilate w f)=if w∣n then coeff (n/w) f else 0 := by rw [dilate,coeff_mk]
lemma dilate_C (r : R) : dilate w (C r)=C r := by ext n rw [coeff_dilate,coeff_C,coeff_C] by_cases hn : n=0 · subst n; simp · rw [ite_eq_right hn] by_cases hd : w∣n · rw [ite_eq_left hd] have H : n/w≠0 := by intro hz have HE:=Nat.div_mul_cancel hd rw [hz,zero_mul] at HE exact hn HE.symm rw [ite_eq_right H] · rw [ite_eq_right hd]
lemma dilate_add (f g : PowerSeries R) : dilate w (f+g)=dilate w f+dilate w g := by ext n simp only [coeff_dilate,map_add] split_ifs <;> simp
def pairEmbedding : ℕ×ℕ ↪ ℕ×ℕ where toFun p:=(w*p.1,w*p.2) inj':=by intro p q h exact Prod.ext (Nat.eq_of_mul_eq_mul_left hw (congrArg Prod.fst h)) (Nat.eq_of_mul_eq_mul_left hw (congrArg Prod.snd h))
include hw inlemma dilate_mul (f g : PowerSeries R) : dilate w (f*g)=dilate w f*dilate w g := by classical ext n rw [coeff_dilate,PowerSeries.coeff_mul n] by_cases hn : w∣n · rw [ite_eq_left hn,PowerSeries.coeff_mul (n/w)] let s:=(Finset.HasAntidiagonal.antidiagonal (n/w)).map (pairEmbedding w hw) have hs : s⊆Finset.HasAntidiagonal.antidiagonal n := by intro p hp rcases Finset.mem_map.mp hp with ⟨q,hq,rfl⟩ have hq' := Finset.HasAntidiagonal.mem_antidiagonal.mp hq rw [Finset.HasAntidiagonal.mem_antidiagonal] change w*q.1+w*q.2=n rw [←Nat.mul_add,hq',Nat.mul_div_cancel' hn] calc _ = ∑p∈s,coeff p.1 (dilate w f)*coeff p.2 (dilate w g) := by rw [Finset.sum_map] apply Finset.sum_congr rfl intro p hp change coeff p.1 f*coeff p.2 g=coeff (w*p.1) (dilate w f)*coeff (w*p.2) (dilate w g) simp [hw.ne'] _ = _ := Finset.sum_subset hs (by intro p hp hnot rw [coeff_dilate,coeff_dilate] by_cases h₁ : w∣p.1 · have h₂ : ¬w∣p.2 := by intro h₂ apply hnot apply Finset.mem_map.mpr refine ⟨(p.1/w,p.2/w),?_,?_⟩ · rw [Finset.HasAntidiagonal.mem_antidiagonal] have HH:=Finset.HasAntidiagonal.mem_antidiagonal.mp hp rw [←Nat.add_div_of_dvd_left h₂,HH] · change (w*(p.1/w),w*(p.2/w))=p rw [Nat.mul_div_cancel' h₁,Nat.mul_div_cancel' h₂] simp [h₂] · simp [h₁]) · rw [ite_eq_right hn] symm apply Finset.sum_eq_zero intro p hp rw [coeff_dilate,coeff_dilate] by_cases h₁ : w∣p.1 · have h₂ : ¬w∣p.2 := by intro h₂ exact hn (Finset.HasAntidiagonal.mem_antidiagonal.mp hp ▸ dvd_add h₁ h₂) simp [h₂] · simp [h₁]
def hom : PowerSeries R →+* PowerSeries R where toFun:=dilate w map_one':=by simpa only [map_one] using dilate_C w (R:=R) 1 map_zero':=by simpa only [map_zero] using dilate_C w (R:=R) 0 map_add':=dilate_add w map_mul':=dilate_mul w hwendend ElementaryPositivity.PowerSeriesDilate
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148import Mathlib
namespace OAI
sectionnamespace ElementaryPositivity.FormalLogopen PowerSeriesnoncomputable sectionvariable {R : Type*} [Ring R] [Algebra ℚ R]
def ncDerivative : PowerSeries R→ₗ[ℚ] PowerSeries R where toFun F:=PowerSeries.mk (fun n=>(n+1) • coeff (n+1) F) map_add' F G:=by ext n; simp map_smul' a F:=by ext n; simp
@[simp] lemma coeff_ncDerivative (F : PowerSeries R) (n : ℕ) : coeff n (ncDerivative F)=(n+1) • coeff (n+1) F := by simp [ncDerivative]
@[simp] lemma ncDerivative_one : ncDerivative (1 : PowerSeries R)=0 := by ext n simp
lemma ncDerivative_mul (F G : PowerSeries R) : ncDerivative (F*G)=ncDerivative F*G+F*ncDerivative G := by ext n simp only [coeff_ncDerivative,coeff_mul,map_add] rw [Finset.smul_sum] have H : (∑p∈Finset.HasAntidiagonal.antidiagonal (n+1), (n+1) • (coeff p.1 F*coeff p.2 G))= (∑p∈Finset.HasAntidiagonal.antidiagonal (n+1), p.1 • (coeff p.1 F*coeff p.2 G))+ (∑p∈Finset.HasAntidiagonal.antidiagonal (n+1), p.2 • (coeff p.1 F*coeff p.2 G)) := by rw [←Finset.sum_add_distrib] apply Finset.sum_congr rfl intro p hp rw [←add_nsmul,Finset.HasAntidiagonal.mem_antidiagonal.mp hp] rw [H,Finset.Nat.sum_antidiagonal_succ,Finset.Nat.sum_antidiagonal_succ'] simp only [zero_nsmul,zero_add,smul_mul_assoc,mul_smul_comm]
omit [Algebra ℚ R] inlemma coeff_power_vanish (F : PowerSeries R) (hF : constantCoeff F=0) (k n : ℕ) (h : n<k) : coeff n (F^k)=0 := by induction k generalizing n with | zero=>omega | succ k ih=> rw [pow_succ,coeff_mul] apply Finset.sum_eq_zero intro p hp have H:=Finset.HasAntidiagonal.mem_antidiagonal.mp hp by_cases h0 : p.2=0 · rw [h0,coeff_zero_eq_constantCoeff,hF,mul_zero] · rw [ih p.1 (by omega),zero_mul]
variable {K : Type*} [CommRing K] [Algebra ℚ K]def traceSeries (τ : R→ₗ[ℚ] K) : PowerSeries R→ₗ[ℚ] PowerSeries K where toFun F:=PowerSeries.mk (fun n=>τ (coeff n F)) map_add' F G:=by ext n; simp map_smul' a F:=by ext n; simp
@[simp] lemma coeff_traceSeries (τ : R→ₗ[ℚ] K) (F : PowerSeries R) (n : ℕ) : coeff n (traceSeries τ F)=τ (coeff n F) := by simp [traceSeries]
variable (τ : R→ₗ[ℚ] K) (hτ : ∀a b,τ (a*b)=τ (b*a))include hτ inlemma traceSeries_cyclic (F G : PowerSeries R) : traceSeries τ (F*G)=traceSeries τ (G*F) := by ext n simp only [coeff_traceSeries,coeff_mul,map_sum] rw [←Finset.Nat.sum_antidiagonal_swap (f:=fun p=>τ (coeff p.1 G*coeff p.2 F))] apply Finset.sum_congr rfl intro p hp exact hτ _ _
include hτ inlemma trace_derivative_power (F : PowerSeries R) (k l : ℕ) : traceSeries τ (ncDerivative (F^(k+1))*F^l)= (k+1) • traceSeries τ (ncDerivative F*F^(k+l)) := by induction k generalizing l with | zero=>simp | succ k ih=> rw [pow_succ (F) (k+1),ncDerivative_mul,add_mul,map_add] have H1 : ncDerivative (F^(k+1))*F*F^l=ncDerivative (F^(k+1))*F^(l+1) := by rw [mul_assoc,←pow_succ'] rw [H1,ih] have H2 : traceSeries τ (F^(k+1)*ncDerivative F*F^l)= traceSeries τ (ncDerivative F*F^(k+1+l)) := by rw [mul_assoc,traceSeries_cyclic τ hτ, mul_assoc,←pow_add] rw [Nat.add_comm l (k+1)] rw [H2] have heq : k+(l+1)=k+1+l := by omega simp only [heq,add_nsmul,one_nsmul]
include hτ inlemma trace_derivative_power' (F : PowerSeries R) (k : ℕ) : traceSeries τ (ncDerivative (F^(k+1)))= (k+1) • traceSeries τ (ncDerivative F*F^k) := by simpa using trace_derivative_power τ hτ F k 0endend ElementaryPositivity.FormalLog
endsectionnamespace ElementaryPositivity.FormalLogopen PowerSeriesnoncomputable sectionvariable {R : Type*} [Ring R]lemma inverse_geometric_coeff (F : PowerSeries R) (hF : constantCoeff F=1) (n : ℕ) : coeff n (invOfUnit F 1)=coeff n (∑k∈Finset.range (n+1),(-(F-1))^k) := by let U:=-(F-1) have hU : constantCoeff U=0:=by simp [U,hF] have heq : 1-U=F := by dsimp [U]; abel have H : (∑k∈Finset.range (n+1),U^k)*F=1-U^(n+1) := by rw [←heq] exact geom_sum_mul_neg U (n+1) have HI : F*invOfUnit F 1=1:=mul_invOfUnit F 1 hF have H' := congrArg (fun x : PowerSeries R=>x*invOfUnit F 1) H rw [mul_assoc,HI,mul_one,sub_mul,one_mul] at H' have Hzero : coeff n (U^(n+1)*invOfUnit F 1)=0 := by rw [coeff_mul] apply Finset.sum_eq_zero intro p hp rw [coeff_power_vanish U hU (n+1) p.1 (by have :=Finset.HasAntidiagonal.mem_antidiagonal.mp hp omega),zero_mul] have HH:=congrArg (coeff n) H' rw [map_sub,Hzero,sub_zero] at HH exact HH.symm
lemma geometric_mul_coeff (F A : PowerSeries R) (hF : constantCoeff F=1) (n : ℕ) : coeff n (A*invOfUnit F 1)= coeff n (A*(∑k∈Finset.range (n+1),(-(F-1))^k)) := by rw [coeff_mul,coeff_mul] apply Finset.sum_congr rfl intro p hp congr 1 have H:=Finset.HasAntidiagonal.mem_antidiagonal.mp hp rw [inverse_geometric_coeff F hF p.2] simp only [map_sum] apply Finset.sum_subset (Finset.range_mono (by omega)) intro k hk hkn exact coeff_power_vanish (-(F-1)) (by simp [hF]) k p.2 (by simp only [Finset.mem_range] at hkn; omega)endend ElementaryPositivity.FormalLog
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182import Mathlibimport OAI.Combinatorics.Chromatic.QuantumTorus.QuantumTorus
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ : M →+ ℤ)local instance homogenizeRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance homogenizeAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance homogenizeAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroupdef homogenizeMonomial (m : M) : R →+ PowerSeries (Torus v Ω) := (PowerSeries.monomial (δ m).toNat).toAddMonoidHom.comp {toFun:=Torus.monomial v Ω m,map_zero':=by simp,map_add':=by intros; simp}def homogenize : Torus v Ω →+ PowerSeries (Torus v Ω) := Finsupp.liftAddHom (homogenizeMonomial v Ω δ)@[simp] lemma homogenize_monomial (m : M) (a : R) : homogenize v Ω δ (Torus.monomial v Ω m a)= PowerSeries.monomial (δ m).toNat (Torus.monomial v Ω m a) := Finsupp.liftAddHom_apply_single _ _ _lemma torus_sum_monomial (f : Torus v Ω) : ∑m∈f.support,Torus.monomial v Ω m (f m)=f := by classical exact Finsupp.sum_single flemma homogenize_coeff (f : Torus v Ω) (d : ℕ) (m : M) : coeff d (homogenize v Ω δ f) m=if d=(δ m).toNat then f m else 0 := by classical induction f using Finsupp.induction_linear with | zero=>simp | add f g hf hg=> rw [_root_.map_add,_root_.map_add] simp only [Finsupp.add_apply,hf,hg] split_ifs <;> simp | single n a=> change coeff d (homogenize v Ω δ (Torus.monomial v Ω n a)) m=_ rw [homogenize_monomial,coeff_monomial] by_cases hm : m=n · subst n; split_ifs <;> simp [Torus.monomial] · split_ifs <;> simp [Torus.monomial,Finsupp.single_eq_of_ne hm]lemma homogenize_monomial_mul (m n : M) (a b : R) (hm : 0≤δ m) (hn : 0≤δ n) : homogenize v Ω δ (Torus.monomial v Ω m a*Torus.monomial v Ω n b)= homogenize v Ω δ (Torus.monomial v Ω m a)*homogenize v Ω δ (Torus.monomial v Ω n b) := by rw [Torus.monomial_mul_monomial,homogenize_monomial,homogenize_monomial, homogenize_monomial,PowerSeries.monomial_mul_monomial,Torus.monomial_mul_monomial,_root_.map_add, Int.toNat_add hm hn]lemma homo_sum_mul {A : Type*} (s : Finset A) (f : A → Torus v Ω) (g : Torus v Ω) : (∑i∈s,f i)*g=∑i∈s,f i*g := by classical induction s using Finset.induction_on with | empty=>simp only [Finset.sum_empty,Torus.zero_mul] | @insert a s ha ih=>simp only [Finset.sum_insert ha,Torus.add_mul,ih]lemma homo_mul_sum {A : Type*} (s : Finset A) (f : A → Torus v Ω) (g : Torus v Ω) : g*(∑i∈s,f i)=∑i∈s,g*f i := by classical induction s using Finset.induction_on with | empty=>simp only [Finset.sum_empty,Torus.mul_zero] | @insert a s ha ih=>simp only [Finset.sum_insert ha,Torus.mul_add,ih]lemma homogenize_mul (f g : Torus v Ω) (hf : ∀m,f m≠0 → 0≤δ m) (hg : ∀m,g m≠0 → 0≤δ m) : homogenize v Ω δ (f*g)=homogenize v Ω δ f*homogenize v Ω δ g := by classical calc _ = ∑m∈f.support,∑n∈g.support, homogenize v Ω δ (Torus.monomial v Ω m (f m)*Torus.monomial v Ω n (g n)) := by have H (s : Finset M) (a : M → Torus v Ω) : homogenize v Ω δ (∑m∈s,a m)=∑m∈s,homogenize v Ω δ (a m) := _root_.map_sum (homogenize v Ω δ) a s simp_rw [←H] congr 1 simp_rw [←homo_mul_sum] rw [torus_sum_monomial,←homo_sum_mul,torus_sum_monomial] _ = ∑m∈f.support,∑n∈g.support, homogenize v Ω δ (Torus.monomial v Ω m (f m))* homogenize v Ω δ (Torus.monomial v Ω n (g n)) := by apply Finset.sum_congr rfl intro m hm apply Finset.sum_congr rfl intro n hn exact homogenize_monomial_mul v Ω δ m n _ _ (hf m (Finsupp.mem_support_iff.mp hm)) (hg n (Finsupp.mem_support_iff.mp hn)) _ = _ := by simp_rw [←Finset.mul_sum] rw [←Finset.sum_mul] congr 1 · rw [←_root_.map_sum,torus_sum_monomial] · rw [←_root_.map_sum,torus_sum_monomial]endend ElementaryPositivity.QuantumTorus
endsectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ κ : M →+ ℤ)local instance biHomogenizeRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance biHomogenizeAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance biHomogenizeAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroup
def biHomogenizeMonomial (m : M) : R →+ PowerSeries (PowerSeries (Torus v Ω)) := (PowerSeries.monomial (δ m).toNat).toAddMonoidHom.comp ((PowerSeries.monomial (κ m).toNat).toAddMonoidHom.comp {toFun:=Torus.monomial v Ω m,map_zero':=by simp,map_add':=by intros; simp})def biHomogenize : Torus v Ω →+ PowerSeries (PowerSeries (Torus v Ω)) := Finsupp.liftAddHom (biHomogenizeMonomial v Ω δ κ)@[simp] lemma biHomogenize_monomial (m : M) (a : R) : biHomogenize v Ω δ κ (Torus.monomial v Ω m a)= monomial (δ m).toNat (monomial (κ m).toNat (Torus.monomial v Ω m a)) := Finsupp.liftAddHom_apply_single _ _ _lemma biHomogenize_coeff (f : Torus v Ω) (d e : ℕ) (m : M) : coeff e (coeff d (biHomogenize v Ω δ κ f)) m= if d=(δ m).toNat ∧ e=(κ m).toNat then f m else 0 := by classical induction f using Finsupp.induction_linear with | zero=>simp | add f g hf hg=> rw [_root_.map_add,_root_.map_add,_root_.map_add] simp only [Finsupp.add_apply,hf,hg] split_ifs <;> simp | single n a=> change coeff e (coeff d (biHomogenize v Ω δ κ (Torus.monomial v Ω n a))) m=_ rw [biHomogenize_monomial,coeff_monomial] by_cases hm : m=n · subst n by_cases hd : d=(δ m).toNat · rw [ite_eq_left hd,coeff_monomial] by_cases he : e=(κ m).toNat <;> simp [hd,he,Torus.monomial] · simp [hd] · by_cases hd : d=(δ n).toNat <;> by_cases he : e=(κ n).toNat <;> simp [hd,he,Torus.monomial,Finsupp.single_eq_of_ne hm,coeff_monomial]lemma biHomogenize_monomial_mul (m n : M) (a b : R) (hm : 0≤δ m ∧ 0≤κ m) (hn : 0≤δ n ∧ 0≤κ n) : biHomogenize v Ω δ κ (Torus.monomial v Ω m a*Torus.monomial v Ω n b)= biHomogenize v Ω δ κ (Torus.monomial v Ω m a)* biHomogenize v Ω δ κ (Torus.monomial v Ω n b) := by rw [Torus.monomial_mul_monomial,biHomogenize_monomial,biHomogenize_monomial, biHomogenize_monomial,monomial_mul_monomial,monomial_mul_monomial, Torus.monomial_mul_monomial,map_add,map_add,Int.toNat_add hm.1 hn.1,Int.toNat_add hm.2 hn.2]lemma biHomogenize_mul (f g : Torus v Ω) (hf : ∀m,f m≠0 → 0≤δ m ∧ 0≤κ m) (hg : ∀m,g m≠0 → 0≤δ m ∧ 0≤κ m) : biHomogenize v Ω δ κ (f*g)=biHomogenize v Ω δ κ f*biHomogenize v Ω δ κ g := by classical calc _ = ∑m∈f.support,∑n∈g.support, biHomogenize v Ω δ κ (Torus.monomial v Ω m (f m)*Torus.monomial v Ω n (g n)) := by have H (s : Finset M) (a : M → Torus v Ω) : biHomogenize v Ω δ κ (∑m∈s,a m)=∑m∈s,biHomogenize v Ω δ κ (a m) := _root_.map_sum (biHomogenize v Ω δ κ) a s simp_rw [←H] congr 1 simp_rw [←homo_mul_sum] rw [torus_sum_monomial,←homo_sum_mul,torus_sum_monomial] _ = ∑m∈f.support,∑n∈g.support, biHomogenize v Ω δ κ (Torus.monomial v Ω m (f m))* biHomogenize v Ω δ κ (Torus.monomial v Ω n (g n)) := by apply Finset.sum_congr rfl intro m hm apply Finset.sum_congr rfl intro n hn exact biHomogenize_monomial_mul v Ω δ κ m n _ _ (hf m (Finsupp.mem_support_iff.mp hm)) (hg n (Finsupp.mem_support_iff.mp hn)) _ = _ := by simp_rw [←Finset.mul_sum] rw [←Finset.sum_mul] congr 1 · rw [←_root_.map_sum,torus_sum_monomial] · rw [←_root_.map_sum,torus_sum_monomial]lemma biHomogenize_one : biHomogenize v Ω δ κ 1=1 := by change biHomogenize v Ω δ κ (Torus.monomial v Ω 0 1)=_ rw [biHomogenize_monomial,_root_.map_zero,_root_.map_zero,Int.toNat_zero,monomial_zero_eq_C_apply,monomial_zero_eq_C_apply] change C (C (1:Torus v Ω))=1 simpendend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.NonpHomogenize
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ)local instance regradeSupportRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance regradeSupportAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance regradeSupportAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGrouplemma torus_product_nonzero (f g : Torus v Ω) (r : M) (h : (f*g) r≠0) : ∃m n,f m≠0 ∧ g n≠0 ∧ m+n=r := by classical by_contra H apply h change Torus.multiply v Ω f g r=0 simp only [Torus.multiply,Finsupp.sum,Finsupp.finsetSum_apply] apply Finset.sum_eq_zero intro m hm apply Finset.sum_eq_zero intro n hn apply Finsupp.single_eq_of_ne intro hr exact H ⟨m,n,Finsupp.mem_support_iff.mp hm,Finsupp.mem_support_iff.mp hn,hr.symm⟩lemma nonp_torus_eval_sum {A : Type*} (s : Finset A) (f : A → Torus v Ω) (r : M) : (∑a∈s,f a) r=∑a∈s,f a r := by classical induction s using Finset.induction_on with | empty=>rfl | @insert a s ha ih=>simp only [Finset.sum_insert ha,Finsupp.add_apply,ih]lemma series_product_nonzero (f g : PowerSeries (Torus v Ω)) (j : ℕ) (r : M) (h : coeff j (f*g) r≠0) : ∃a b m n,a+b=j ∧ coeff a f m≠0 ∧ coeff b g n≠0 ∧ m+n=r := by classical rw [coeff_mul,nonp_torus_eval_sum] at h obtain ⟨ab,hab,hz⟩:=Finset.exists_ne_zero_of_sum_ne_zero h obtain ⟨m,n,hm,hn,he⟩:=torus_product_nonzero v Ω _ _ r hz exact ⟨ab.1,ab.2,m,n,Finset.HasAntidiagonal.mem_antidiagonal.mp hab,hm,hn,he⟩
def RegradeBound (δ : M →+ ℤ) (B : ℕ) (f : PowerSeries (Torus v Ω)) : Prop := ∀n m,coeff n f m≠0 → 0≤δ m ∧ n≤B*(δ m).toNatvariable (δ : M →+ ℤ) (B : ℕ)lemma RegradeBound.zero : RegradeBound v Ω δ B 0 := by intro n m h; simp at hlemma RegradeBound.one : RegradeBound v Ω δ B 1 := by intro n m hm have hn : n=0:=by by_contra hn; simp [coeff_one,hn] at hm subst n have hm0 : m=0:=by by_contra hm0 apply hm rw [coeff_one,ite_eq_left rfl] exact Finsupp.single_eq_of_ne hm0 subst m simplemma RegradeBound.add {f g : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hg : RegradeBound v Ω δ B g) : RegradeBound v Ω δ B (f+g) := by intro n m hm have H : coeff n f m≠0 ∨ coeff n g m≠0:=by by_contra hh push Not at hh simp [hh.1,hh.2] at hm exact H.elim (hf n m) (hg n m)lemma RegradeBound.neg {f : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) : RegradeBound v Ω δ B (-f) := by intro n m hm apply hf n m change -(coeff n f m)≠0 at hm exact neg_ne_zero.mp hmlemma RegradeBound.mul {f g : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hg : RegradeBound v Ω δ B g) : RegradeBound v Ω δ B (f*g) := by intro j r hr obtain ⟨a,b,m,n,hab,hm,hn,rfl⟩:=series_product_nonzero v Ω f g j r hr obtain ⟨hm0,hma⟩:=hf a m hm obtain ⟨hn0,hnb⟩:=hg b n hn refine ⟨by simpa only [map_add] using add_nonneg hm0 hn0,?_⟩ rw [←hab,map_add,Int.toNat_add hm0 hn0,mul_add] exact Nat.add_le_add hma hnb
lemma RegradeBound.homogenize_vanish {f : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (d n : ℕ) (hn : B*d<n) : coeff d (homogenize v Ω δ (coeff n f))=0 := by ext m rw [homogenize_coeff] by_cases hd : d=(δ m).toNat · rw [ite_eq_left hd] by_contra hm have HH:=(hf n m hm).2 rw [←hd] at HH exact Nat.not_lt_of_ge HH hn · simp [hd]endend ElementaryPositivity.QuantumTorus
endsectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ : M →+ ℤ) (B : ℕ)local instance regradeRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance regradeAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance regradeAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroup
def regrade (f : PowerSeries (Torus v Ω)) : PowerSeries (Torus v Ω) := PowerSeries.mk fun d=>∑n∈Finset.range (B*d+1),coeff d (homogenize v Ω δ (coeff n f))lemma regrade_coeff (f : PowerSeries (Torus v Ω)) (d : ℕ) : coeff d (regrade v Ω δ B f)= ∑n∈Finset.range (B*d+1),coeff d (homogenize v Ω δ (coeff n f)) := coeff_mk _ _
section Topologylocal instance regradeTopology : TopologicalSpace (Torus v Ω) := ⊥local instance regradeDiscreteTopology : DiscreteTopology (Torus v Ω) := ⟨rfl⟩open scoped PowerSeries.WithPiTopology
lemma regrade_hasSum {f : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) : HasSum (fun n=>homogenize v Ω δ (coeff n f)) (regrade v Ω δ B f) := by rw [PowerSeries.WithPiTopology.hasSum_iff_hasSum_coeff] intro d rw [regrade_coeff] apply hasSum_sum_of_ne_finset_zero intro n hn apply hf.homogenize_vanish v Ω δ B d n have H : B*d+1≤n:=by simpa only [Finset.mem_range,not_lt] using hn omega
lemma regrade_product_summable {f g : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hg : RegradeBound v Ω δ B g) : Summable (fun ab : ℕ×ℕ=>homogenize v Ω δ (coeff ab.1 f)*homogenize v Ω δ (coeff ab.2 g)) := by rw [PowerSeries.WithPiTopology.summable_iff_summable_coeff] intro d apply summable_of_hasFiniteSupport apply (Finset.finite_toSet ((Finset.range (B*d+1)).product (Finset.range (B*d+1)))).subset intro ab hab change coeff d (homogenize v Ω δ (coeff ab.1 f)*homogenize v Ω δ (coeff ab.2 g))≠0 at hab change ab∈(Finset.range (B*d+1)) ×ˢ (Finset.range (B*d+1)) rw [Finset.mem_product,Finset.mem_range,Finset.mem_range] by_contra H apply hab rw [coeff_mul] apply Finset.sum_eq_zero intro kl hkl have hsum:=Finset.HasAntidiagonal.mem_antidiagonal.mp hkl have hl : B*kl.1≤B*d:=Nat.mul_le_mul_left B (by omega) have hr : B*kl.2≤B*d:=Nat.mul_le_mul_left B (by omega) by_cases ha : ab.1<B*d+1 · have hb : B*d<ab.2:=by omega rw [hg.homogenize_vanish v Ω δ B kl.2 ab.2 (lt_of_le_of_lt hr hb),Torus.mul_zero] · have ha' : B*d<ab.1:=by omega rw [hf.homogenize_vanish v Ω δ B kl.1 ab.1 (lt_of_le_of_lt hl ha'),Torus.zero_mul]
lemma regrade_mul {f g : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hg : RegradeBound v Ω δ B g) : regrade v Ω δ B (f*g)=regrade v Ω δ B f*regrade v Ω δ B g := by rw [←(regrade_hasSum v Ω δ B hf).tsum_eq,←(regrade_hasSum v Ω δ B hg).tsum_eq, (regrade_hasSum v Ω δ B hf).summable.tsum_mul_tsum_eq_tsum_sum_antidiagonal (regrade_hasSum v Ω δ B hg).summable (regrade_product_summable v Ω δ B hf hg), ←(regrade_hasSum v Ω δ B (hf.mul v Ω δ B hg)).tsum_eq] apply tsum_congr intro n rw [coeff_mul,_root_.map_sum] apply Finset.sum_congr rfl intro ab hab exact homogenize_mul v Ω δ _ _ (fun m hm=>(hf ab.1 m hm).1) (fun m hm=>(hg ab.2 m hm).1)
lemma regrade_add {f g : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hg : RegradeBound v Ω δ B g) : regrade v Ω δ B (f+g)=regrade v Ω δ B f+regrade v Ω δ B g := by apply (regrade_hasSum v Ω δ B (hf.add v Ω δ B hg)).unique have H : (fun n=>homogenize v Ω δ (coeff n (f+g)))= (fun n=>homogenize v Ω δ (coeff n f)+homogenize v Ω δ (coeff n g)) := by funext n rw [_root_.map_add,_root_.map_add] rw [H] exact (regrade_hasSum v Ω δ B hf).add (regrade_hasSum v Ω δ B hg)end Topologyendend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.NonpRegrade
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ : M →+ ℤ) (B : ℕ)local instance regradeFaithfulRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance regradeFaithfulAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance regradeFaithfulAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroup
def FullHomogeneous (τ : M →+ ℤ) (f : PowerSeries (Torus v Ω)) : Prop := ∀n m,coeff n f m≠0 → τ m=(n:ℤ)
lemma regrade_coeff_eval (f : PowerSeries (Torus v Ω)) (d : ℕ) (m : M) : coeff d (regrade v Ω δ B f) m= if d=(δ m).toNat then ∑n∈Finset.range (B*d+1),coeff n f m else 0 := by classical rw [regrade_coeff,nonp_torus_eval_sum] simp_rw [homogenize_coeff] split_ifs <;> simp_all
lemma regrade_read (τ : M →+ ℤ) {f : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hτ : FullHomogeneous v Ω τ f) (n : ℕ) (m : M) (hm : τ m=(n:ℤ)) : coeff (δ m).toNat (regrade v Ω δ B f) m=coeff n f m := by classical rw [regrade_coeff_eval,ite_eq_left rfl] apply Finset.sum_eq_single n · intro j hj hne by_contra hz have H:=hτ j m hz have : j=n:=by omega exact hne this · intro hn by_contra hz have H:=(hf n m hz).2 have HH : ¬n<B*(δ m).toNat+1:=by simpa only [Finset.mem_range] using hn omega
lemma regrade_injective_homogeneous (τ : M →+ ℤ) {f g : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hg : RegradeBound v Ω δ B g) (hτf : FullHomogeneous v Ω τ f) (hτg : FullHomogeneous v Ω τ g) (he : regrade v Ω δ B f=regrade v Ω δ B g) : f=g := by apply PowerSeries.ext intro n ext m by_cases hm : τ m=(n:ℤ) · rw [←regrade_read v Ω δ B τ hf hτf n m hm, ←regrade_read v Ω δ B τ hg hτg n m hm,he] · have Hf : coeff n f m=0:=by by_contra hz; exact hm (hτf n m hz) have Hg : coeff n g m=0:=by by_contra hz; exact hm (hτg n m hz) rw [Hf,Hg]endend ElementaryPositivity.QuantumTorus
endsectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ : M →+ ℤ) (B : ℕ)local instance regradeNegationRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance regradeNegationAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance regradeNegationAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGrouplemma torus_neg_one_mul (f : Torus v Ω) : (-1 : Torus v Ω)*f= -f := by have H:=Torus.add_mul v Ω (-1) 1 f rw [neg_add_cancel,Torus.zero_mul,Torus.one_mul] at H exact eq_neg_of_add_eq_zero_left H.symmlemma RegradeBound.invOfUnit {f : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) : RegradeBound v Ω δ B (PowerSeries.invOfUnit f 1) := by classical intro n induction n using Nat.strong_induction_on with | h n ih=> intro m hm by_cases hn : n=0 · subst n rw [coeff_invOfUnit,ite_eq_left rfl] at hm have hm0 : m=0:=by by_contra HH apply hm change Finsupp.single 0 (1:R) m=0 exact Finsupp.single_eq_of_ne HH subst m simp · rw [coeff_invOfUnit,ite_eq_right hn] at hm simp only [inv_one,Units.val_one] at hm rw [torus_neg_one_mul] at hm change -(∑ab∈Finset.HasAntidiagonal.antidiagonal n, if ab.2<n then coeff ab.1 f*coeff ab.2 (PowerSeries.invOfUnit f 1) else 0) m≠0 at hm have HH:=neg_ne_zero.mp hm rw [nonp_torus_eval_sum] at HH obtain ⟨ab,hab,hz⟩:=Finset.exists_ne_zero_of_sum_ne_zero HH have hb : ab.2<n:=by by_contra hh; simp [hh] at hz rw [ite_eq_left hb] at hz obtain ⟨a,b,ha,hb',he⟩:=torus_product_nonzero v Ω _ _ m hz obtain ⟨ha0,han⟩:=hf ab.1 a ha obtain ⟨hb0,hbn⟩:=ih ab.2 hb b hb' have hsum:=Finset.HasAntidiagonal.mem_antidiagonal.mp hab rw [←he,_root_.map_add,Int.toNat_add ha0 hb0,mul_add] exact ⟨add_nonneg ha0 hb0,hsum ▸ Nat.add_le_add han hbn⟩
lemma homogenize_one : homogenize v Ω δ 1=1 := by change homogenize v Ω δ (Torus.monomial v Ω 0 1)=_ rw [homogenize_monomial] simp only [_root_.map_zero,Int.toNat_zero,monomial_zero_eq_C] rfllemma regrade_zero : regrade v Ω δ B 0=0 := by apply PowerSeries.ext intro d rw [regrade_coeff] simplemma regrade_one : regrade v Ω δ B 1=1 := by classical apply PowerSeries.ext intro d rw [regrade_coeff,Finset.sum_eq_single 0] · rw [coeff_zero_eq_constantCoeff_apply,constantCoeff_one,homogenize_one] · intro n hn hn0 rw [coeff_one,ite_eq_right hn0,_root_.map_zero,_root_.map_zero] · intro h simp at h
def boundedRegradeSubring : Subring (PowerSeries (Torus v Ω)) where carrier:=RegradeBound v Ω δ B zero_mem':=RegradeBound.zero v Ω δ B one_mem':=RegradeBound.one v Ω δ B add_mem':=fun hf hg=>hf.add v Ω δ B hg neg_mem':=fun hf=>hf.neg v Ω δ B mul_mem':=fun hf hg=>hf.mul v Ω δ B hg
def regradeHom : boundedRegradeSubring v Ω δ B →+* PowerSeries (Torus v Ω) where toFun f:=regrade v Ω δ B f.val map_zero':=regrade_zero v Ω δ B map_one':=regrade_one v Ω δ B map_add' f g:=regrade_add v Ω δ B f.property g.property map_mul' f g:=regrade_mul v Ω δ B f.property g.property
lemma regrade_inverse_mul {f : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hc : constantCoeff f=1) : regrade v Ω δ B (PowerSeries.invOfUnit f 1)*regrade v Ω δ B f=1 := by rw [←regrade_mul v Ω δ B (hf.invOfUnit v Ω δ B) hf, PowerSeries.invOfUnit_mul f 1 hc,regrade_one]lemma regrade_mul_inverse {f : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hc : constantCoeff f=1) : regrade v Ω δ B f*regrade v Ω δ B (PowerSeries.invOfUnit f 1)=1 := by rw [←regrade_mul v Ω δ B hf (hf.invOfUnit v Ω δ B), PowerSeries.mul_invOfUnit f 1 hc,regrade_one]endend ElementaryPositivity.QuantumTorus
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.PowerSeriesSplitLeading
namespace OAI
sectionsectionnamespace ElementaryPositivity.PowerSeriesSplitopen PowerSeriesnoncomputable sectionvariable {R : Type*} [Ring R]lemma multiply_leading_difference (f g f' g' : PowerSeries R) (n : ℕ) (hf : constantCoeff f=1) (hg : constantCoeff g=1) (hf' : constantCoeff f'=1) (hg' : constantCoeff g'=1) (hff : ∀k≤n,coeff k f=coeff k f') (hgg : ∀k≤n,coeff k g=coeff k g') : coeff (n+1) (f*g)-coeff (n+1) (f'*g')= (coeff (n+1) f-coeff (n+1) f')+(coeff (n+1) g-coeff (n+1) g') := by rw [coeff_mul_succ _ _ _ hf hg,coeff_mul_succ _ _ _ hf' hg'] have he : (∑i : Fin n,coeff (i.val+1) f*coeff (n-i.val) g)= ∑i : Fin n,coeff (i.val+1) f'*coeff (n-i.val) g' := by apply Finset.sum_congr rfl intro i _ rw [hff (i.val+1) (by omega),hgg (n-i.val) (by omega)] rw [he] abel
variable {A : Type*} (f g : A → PowerSeries R)lemma product_constant (l : List A) (hf : ∀a∈l,constantCoeff (f a)=1) : constantCoeff (l.map f).prod=1 := by induction l with | nil => exact map_one _ | cons a l ih => rw [List.map_cons,List.prod_cons,map_mul,hf a List.mem_cons_self,one_mul, ih (fun b hb=>hf b (List.mem_cons_of_mem a hb))]
lemma product_coeff_congr (l : List A) (n : ℕ) (hfg : ∀a∈l,∀k≤n,coeff k (f a)=coeff k (g a)) : coeff n (l.map f).prod=coeff n (l.map g).prod := by induction l generalizing n with | nil => rfl | cons a l ih => simp only [List.map_cons,List.prod_cons] apply FormalLog.mul_coeff_congr · exact hfg a List.mem_cons_self · intro k hk exact ih k (fun b hb j hj=>hfg b (List.mem_cons_of_mem a hb) j (hj.trans hk))
lemma product_leading_difference (l : List A) (n : ℕ) (hf : ∀a∈l,constantCoeff (f a)=1) (hg : ∀a∈l,constantCoeff (g a)=1) (hfg : ∀a∈l,∀k≤n,coeff k (f a)=coeff k (g a)) : coeff (n+1) (l.map f).prod-coeff (n+1) (l.map g).prod= (l.map (fun a=>coeff (n+1) (f a)-coeff (n+1) (g a))).sum := by induction l with | nil => simp only [List.map_nil,List.prod_nil,sub_self,List.sum_nil] | cons a l ih => have hfl : ∀b∈l,constantCoeff (f b)=1:=fun b hb=>hf b (List.mem_cons_of_mem a hb) have hgl : ∀b∈l,constantCoeff (g b)=1:=fun b hb=>hg b (List.mem_cons_of_mem a hb) have hfg' : ∀b∈l,∀k≤n,coeff k (f b)=coeff k (g b):= fun b hb=>hfg b (List.mem_cons_of_mem a hb) simp only [List.map_cons,List.prod_cons,List.sum_cons] rw [multiply_leading_difference _ _ _ _ n (hf a List.mem_cons_self) (product_constant f l hfl) (hg a List.mem_cons_self) (product_constant g l hgl) (hfg a List.mem_cons_self) (fun k hk=>product_coeff_congr f g l k (fun b hb j hj=>hfg' b hb j (hj.trans hk))),ih hfl hgl hfg']endend ElementaryPositivity.PowerSeriesSplitendend
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168import Mathlib
namespace OAI
sectionsectionnamespace ElementaryPositivity.PowerSeriesSplitopen PowerSeriesnoncomputable sectionvariable {R : Type*} [Ring R]
def pairCoefficients (P : R →+ R) (f : PowerSeries R) : ℕ → R × R | 0 => (1,1) | n+1 => let r:=coeff (n+1) f - ∑i : Fin n, (pairCoefficients P f (i.val+1)).1 * (pairCoefficients P f (n-i.val)).2 (P r,r-P r)termination_by n=>ndecreasing_by all_goals omega
def leftFactor (P : R →+ R) (f : PowerSeries R) : PowerSeries R := PowerSeries.mk (fun n=>(pairCoefficients P f n).1)def rightFactor (P : R →+ R) (f : PowerSeries R) : PowerSeries R := PowerSeries.mk (fun n=>(pairCoefficients P f n).2)
@[simp] lemma left_constant (P : R →+ R) (f : PowerSeries R) : constantCoeff (leftFactor P f)=1 := by rw [←coeff_zero_eq_constantCoeff_apply] simp only [leftFactor,coeff_mk,pairCoefficients]@[simp] lemma right_constant (P : R →+ R) (f : PowerSeries R) : constantCoeff (rightFactor P f)=1 := by rw [←coeff_zero_eq_constantCoeff_apply] simp only [rightFactor,coeff_mk,pairCoefficients]
lemma coeff_mul_succ (f g : PowerSeries R) (n : ℕ) (hf : constantCoeff f=1) (hg : constantCoeff g=1) : coeff (n+1) (f*g)=coeff (n+1) f+coeff (n+1) g+ ∑i : Fin n,coeff (i.val+1) f * coeff (n-i.val) g := by rw [coeff_mul,Finset.Nat.sum_antidiagonal_eq_sum_range_succ_mk] rw [Finset.sum_range_succ,Finset.sum_range_succ'] simp only [Nat.sub_self,coeff_zero_eq_constantCoeff_apply,hf,hg,mul_one,one_mul,Nat.sub_zero] rw [Fin.sum_univ_eq_sum_range (fun i=>coeff (i+1) f*coeff (n-i) g) n] simp only [Nat.add_sub_add_right] abel
lemma factorization (P : R →+ R) (f : PowerSeries R) (hf : constantCoeff f=1) : leftFactor P f * rightFactor P f=f := by ext n cases n with | zero => simp only [coeff_zero_eq_constantCoeff_apply,map_mul,left_constant,right_constant,one_mul,hf] | succ n => rw [coeff_mul_succ _ _ n (left_constant P f) (right_constant P f)] simp only [leftFactor,rightFactor,coeff_mk] rw [pairCoefficients] dsimp only abel
lemma left_fixed (P : R →+ R) (hP : ∀r,P (P r)=P r) (f : PowerSeries R) (n : ℕ) : P (coeff (n+1) (leftFactor P f))=coeff (n+1) (leftFactor P f) := by simp only [leftFactor,coeff_mk] rw [pairCoefficients] exact hP _lemma right_killed (P : R →+ R) (hP : ∀r,P (P r)=P r) (f : PowerSeries R) (n : ℕ) : P (coeff (n+1) (rightFactor P f))=0 := by simp only [rightFactor,coeff_mk] rw [pairCoefficients] simp only [map_sub,hP,sub_self]
lemma uniqueness (P : R →+ R) (f a b : PowerSeries R) (ha : constantCoeff a=1) (hb : constantCoeff b=1) (hab : a*b=f) (hleft : ∀n,P (coeff (n+1) a)=coeff (n+1) a) (hright : ∀n,P (coeff (n+1) b)=0) : a=leftFactor P f ∧ b=rightFactor P f := by have h : ∀n,(coeff n a,coeff n b)=pairCoefficients P f n := by intro n induction n using Nat.strong_induction_on with | h n ih => cases n with | zero => simp only [coeff_zero_eq_constantCoeff_apply,ha,hb,pairCoefficients] | succ n => have hsum : (∑i : Fin n, coeff (i.val+1) a * coeff (n-i.val) b)= ∑i : Fin n,(pairCoefficients P f (i.val+1)).1 * (pairCoefficients P f (n-i.val)).2 := by apply Finset.sum_congr rfl intro i hi rw [←ih (i.val+1) (by omega),←ih (n-i.val) (by omega)] have hcoeff := coeff_mul_succ a b n ha hb rw [hab,hsum] at hcoeff have hres : coeff (n+1) f-∑i : Fin n, (pairCoefficients P f (i.val+1)).1 * (pairCoefficients P f (n-i.val)).2 = coeff (n+1) a+coeff (n+1) b := by rw [hcoeff]; abel rw [pairCoefficients,hres] simp only [map_add,hleft,hright,add_zero] congr 1 abel constructor · ext n simpa only [leftFactor,coeff_mk] using congrArg Prod.fst (h n) · ext n simpa only [rightFactor,coeff_mk] using congrArg Prod.snd (h n)
lemma factors_mem (P : R →+ R) (S : Subring R) (hP : ∀r∈S,P r∈S) (f : PowerSeries R) (hf : ∀n,coeff n f∈S) : (∀n,coeff n (leftFactor P f)∈S) ∧ (∀n,coeff n (rightFactor P f)∈S) := by have h : ∀n,(pairCoefficients P f n).1∈S ∧ (pairCoefficients P f n).2∈S := by intro n induction n using Nat.strong_induction_on with | h n ih => cases n with | zero => simpa only [pairCoefficients] using And.intro S.one_mem S.one_mem | succ n => have hc : coeff (n+1) f-∑i : Fin n, (pairCoefficients P f (i.val+1)).1*(pairCoefficients P f (n-i.val)).2∈S := by apply S.sub_mem (hf (n+1)) apply S.sum_mem intro i hi exact S.mul_mem (ih (i.val+1) (by omega)).1 (ih (n-i.val) (by omega)).2 rw [pairCoefficients] exact ⟨hP _ hc,S.sub_mem hc (hP _ hc)⟩ constructor · intro n simpa only [leftFactor,coeff_mk] using (h n).1 · intro n simpa only [rightFactor,coeff_mk] using (h n).2
lemma mul_mem (S : Subring R) (a b : PowerSeries R) (ha : ∀n,coeff n a∈S) (hb : ∀n,coeff n b∈S) : ∀n,coeff n (a*b)∈S := by intro n rw [coeff_mul] exact S.sum_mem (fun p hp=>S.mul_mem (ha p.1) (hb p.2))
lemma factors_graded (P : R →+ R) (A : ℕ → AddSubgroup R) (h0 : (1:R)∈A 0) (hmul : ∀m n x y,x∈A m → y∈A n → x*y∈A (m+n)) (hP : ∀n x,x∈A n → P x∈A n) (f : PowerSeries R) (hf : ∀n,coeff n f∈A n) : (∀n,coeff n (leftFactor P f)∈A n) ∧ (∀n,coeff n (rightFactor P f)∈A n) := by have h : ∀n,(pairCoefficients P f n).1∈A n ∧ (pairCoefficients P f n).2∈A n := by intro n induction n using Nat.strong_induction_on with | h n ih => cases n with | zero => simpa only [pairCoefficients] using And.intro h0 h0 | succ n => have hc : coeff (n+1) f-∑i : Fin n, (pairCoefficients P f (i.val+1)).1*(pairCoefficients P f (n-i.val)).2∈A (n+1) := by apply (A (n+1)).sub_mem (hf (n+1)) apply (A (n+1)).sum_mem intro i hi have hmn : (i.val+1)+(n-i.val)=n+1 := by omega rw [←hmn] exact hmul _ _ _ _ (ih (i.val+1) (by omega)).1 (ih (n-i.val) (by omega)).2 rw [pairCoefficients] exact ⟨hP _ _ hc,(A _).sub_mem hc (hP _ _ hc)⟩ constructor · intro n simpa only [leftFactor,coeff_mk] using (h n).1 · intro n simpa only [rightFactor,coeff_mk] using (h n).2
endend ElementaryPositivity.PowerSeriesSplitendend
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164import Mathlibimport OAI.Combinatorics.Chromatic.Walls.PowerSeriesThreeFactors
namespace OAI
sectionsectionnamespace ElementaryPositivity.PowerSeriesSplitopen PowerSeriesnoncomputable sectionvariable {R : Type*} [Ring R]
lemma pair_congr (P : R →+ R) (f g : PowerSeries R) (n : ℕ) (h : ∀k≤n,coeff k f=coeff k g) : pairCoefficients P f n=pairCoefficients P g n := by induction n using Nat.strong_induction_on with | h n ih => cases n with | zero => rw [pairCoefficients,pairCoefficients] | succ n => have hs : (∑i : Fin n,(pairCoefficients P f (i.val+1)).1*(pairCoefficients P f (n-i.val)).2)= ∑i : Fin n,(pairCoefficients P g (i.val+1)).1*(pairCoefficients P g (n-i.val)).2 := by apply Finset.sum_congr rfl intro i hi rw [ih (i.val+1) (by omega) (fun k hk=>h k (by omega)), ih (n-i.val) (by omega) (fun k hk=>h k (by omega))] rw [pairCoefficients,pairCoefficients,h (n+1) le_rfl,hs]
lemma left_coeff_congr (P : R →+ R) (f g : PowerSeries R) (n : ℕ) (h : ∀k≤n,coeff k f=coeff k g) : coeff n (leftFactor P f)=coeff n (leftFactor P g) := by simpa only [leftFactor,coeff_mk] using congrArg Prod.fst (pair_congr P f g n h)lemma right_coeff_congr (P : R →+ R) (f g : PowerSeries R) (n : ℕ) (h : ∀k≤n,coeff k f=coeff k g) : coeff n (rightFactor P f)=coeff n (rightFactor P g) := by simpa only [rightFactor,coeff_mk] using congrArg Prod.snd (pair_congr P f g n h)
lemma leading_difference (P : R →+ R) (f g : PowerSeries R) (n : ℕ) (h : ∀k≤n,coeff k f=coeff k g) : coeff (n+1) (leftFactor P f)-coeff (n+1) (leftFactor P g)=P (coeff (n+1) f-coeff (n+1) g) ∧ coeff (n+1) (rightFactor P f)-coeff (n+1) (rightFactor P g)= (coeff (n+1) f-coeff (n+1) g)-P (coeff (n+1) f-coeff (n+1) g) := by have hs : (∑i : Fin n,(pairCoefficients P f (i.val+1)).1*(pairCoefficients P f (n-i.val)).2)= ∑i : Fin n,(pairCoefficients P g (i.val+1)).1*(pairCoefficients P g (n-i.val)).2 := by apply Finset.sum_congr rfl intro i hi rw [pair_congr P f g (i.val+1) (fun k hk=>h k (by omega)), pair_congr P f g (n-i.val) (fun k hk=>h k (by omega))] simp only [leftFactor,rightFactor,coeff_mk] rw [pairCoefficients,pairCoefficients,hs] simp only [map_sub] constructor <;> abel
lemma zero_leading_difference (P Q : R →+ R) (hQP : ∀x,Q (P x)=0) (f g : PowerSeries R) (n : ℕ) (h : ∀k≤n,coeff k f=coeff k g) : coeff (n+1) (zeroFactor P Q f)-coeff (n+1) (zeroFactor P Q g)= Q (coeff (n+1) f-coeff (n+1) g) := by have hr : ∀k≤n,coeff k (rightFactor P f)=coeff k (rightFactor P g) := by intro k hk exact right_coeff_congr P f g k (fun j hj=>h j (hj.trans hk)) have hl:= (leading_difference Q (rightFactor P f) (rightFactor P g) n hr).1 rw [(leading_difference P f g n h).2,map_sub,hQP,sub_zero] at hl exact hl
lemma zero_coeff_congr (P Q : R →+ R) (f g : PowerSeries R) (n : ℕ) (h : ∀k≤n,coeff k f=coeff k g) : coeff n (zeroFactor P Q f)=coeff n (zeroFactor P Q g) := by apply left_coeff_congr Q _ _ n intro k hk exact right_coeff_congr P f g k (fun j hj=>h j (hj.trans hk))endend ElementaryPositivity.PowerSeriesSplitendsectionnamespace ElementaryPositivity.FormalLogopen PowerSeriesnoncomputable sectionvariable {R : Type*} [Ring R]
lemma mul_coeff_congr (a b c d : PowerSeries R) (n : ℕ) (ha : ∀j≤n,coeff j a=coeff j c) (hb : ∀j≤n,coeff j b=coeff j d) : coeff n (a*b)=coeff n (c*d) := by rw [coeff_mul,coeff_mul] apply Finset.sum_congr rfl intro p hp have hh:=Finset.HasAntidiagonal.mem_antidiagonal.mp hp rw [ha _ (by omega),hb _ (by omega)]
lemma pow_coeff_congr (a b : PowerSeries R) (n k : ℕ) (h : ∀j≤n,coeff j a=coeff j b) : coeff n (a^k)=coeff n (b^k) := by induction k generalizing n with | zero => rfl | succ k ih => rw [pow_succ a k,pow_succ b k] apply mul_coeff_congr · intro j hj exact ih j (fun i hi=>h i (hi.trans hj)) · exact h
lemma pow_coeff_congr_of_two_le (a b : PowerSeries R) (n k : ℕ) (ha : constantCoeff a=0) (hb : constantCoeff b=0) (hk : 2≤k) (h : ∀j<n,coeff j a=coeff j b) : coeff n (a^k)=coeff n (b^k) := by obtain ⟨j,rfl⟩:=Nat.exists_eq_add_of_le hk rw [show 2+j=(j+1)+1 by omega,pow_succ a (j+1),pow_succ b (j+1)] rw [coeff_mul,coeff_mul] apply Finset.sum_congr rfl intro p hp have hh:=Finset.HasAntidiagonal.mem_antidiagonal.mp hp by_cases h0 : p.1=0 · simp only [h0,coeff_zero_eq_constantCoeff_apply,map_pow,ha,hb,zero_pow (by omega : j+1≠0),zero_mul] by_cases h1 : p.2=0 · simp only [h1,coeff_zero_eq_constantCoeff_apply,ha,hb,mul_zero] have hn1 : p.1<n := by omega have hn2 : p.2<n := by omega rw [pow_coeff_congr a b p.1 (j+1) (fun i hi=>h i (hi.trans_lt hn1)),h _ hn2]
variable [Module ℚ R]
def log (f : PowerSeries R) : PowerSeries R := PowerSeries.mk (fun n=>∑k∈Finset.range n, ((-1:ℚ)^k/(k+1:ℕ)) • coeff n ((f-1)^(k+1)))
@[simp] lemma log_constant (f : PowerSeries R) : constantCoeff (log f)=0 := by rw [←coeff_zero_eq_constantCoeff_apply] simp only [log,coeff_mk,Finset.range_zero,Finset.sum_empty]
lemma log_coeff_congr (f g : PowerSeries R) (n : ℕ) (h : ∀j≤n,coeff j f=coeff j g) : coeff n (log f)=coeff n (log g) := by simp only [log,coeff_mk] apply Finset.sum_congr rfl intro k hk congr 1 apply pow_coeff_congr intro j hj rw [map_sub,map_sub,h j hj]
lemma log_coeff_succ (f : PowerSeries R) (n : ℕ) : coeff (n+1) (log f)=coeff (n+1) f+ ∑k∈Finset.range n,((-1:ℚ)^(k+1)/(k+2:ℕ)) • coeff (n+1) ((f-1)^(k+2)) := by simp only [log,coeff_mk] rw [Finset.sum_range_succ'] simp only [pow_zero,Nat.cast_one,one_div,inv_one,zero_add,pow_one,map_sub, coeff_one,Nat.succ_ne_zero,ite_false,sub_zero,one_smul] rw [add_comm]
lemma log_leading_difference (f g : PowerSeries R) (n : ℕ) (hf : constantCoeff f=1) (hg : constantCoeff g=1) (h : ∀j≤n,coeff j f=coeff j g) : coeff (n+1) (log f)-coeff (n+1) (log g)=coeff (n+1) f-coeff (n+1) g := by rw [log_coeff_succ,log_coeff_succ] have hs : (∑k∈Finset.range n,((-1:ℚ)^(k+1)/(k+2:ℕ)) • coeff (n+1) ((f-1)^(k+2)))= ∑k∈Finset.range n,((-1:ℚ)^(k+1)/(k+2:ℕ)) • coeff (n+1) ((g-1)^(k+2)) := by apply Finset.sum_congr rfl intro k hk congr 1 apply pow_coeff_congr_of_two_le · simp [hf] · simp [hg] · omega · intro j hj simp only [map_sub,h j (by omega)] rw [hs] abelendend ElementaryPositivity.FormalLogendend
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146import Mathlibimport OAI.Combinatorics.Chromatic.Shuffle.CanonicalCard
namespace OAI
sectionnamespace ElementaryPositivity.SlopeArithmeticvariable {I : Type*} [Fintype I]
def OnSlopeOrZero (c η : I → ℝ) (θ : ℝ) (d : I → ℕ) : Prop := d = 0 ∨ slope c η d = θ
lemma onSlopeOrZero_of_mass (c η : I → ℝ) (hc : ∀ i,0<c i) (θ : ℝ) (d : I → ℕ) (h : mass η d = θ * mass c d) : OnSlopeOrZero c η θ d := by by_cases hd : d=0 · exact Or.inl hd · exact Or.inr ((div_eq_iff (mass_pos c hc d hd).ne').mpr h)
lemma high_mass_destabilizes (c η : I → ℝ) (hc : ∀ i,0<c i) (d e : I → ℕ) (h : mass η d > slope c η (d+e) * mass c d) : d≠0 ∧ e≠0 ∧ slope c η d > slope c η (d+e) := by have hd : d≠0 := by intro hh; simp [hh] at h have he : e≠0 := by intro hh rw [hh,add_zero,mass_eq c η hc d] at h exact lt_irrefl _ h exact ⟨hd,he,(lt_div_iff₀ (mass_pos c hc d hd)).mpr h⟩
def CellsOnSlope (c η : I → ℝ) (θ : ℝ) (d₁ e₁ d₂ e₂ : I → ℕ) : Prop := OnSlopeOrZero c η θ d₁ ∧ OnSlopeOrZero c η θ e₁ ∧ OnSlopeOrZero c η θ d₂ ∧ OnSlopeOrZero c η θ e₂
theorem offSlope_destabilizes (c η : I → ℝ) (hc : ∀ i,0<c i) (d₁ e₁ d₂ e₂ : I → ℕ) (ht : slope c η (d₁+e₁) = slope c η (d₂+e₂)) (hs : slope c η (d₁+d₂) = slope c η (d₁+e₁)) (hoff : ¬ CellsOnSlope c η (slope c η (d₁+e₁)) d₁ e₁ d₂ e₂) : (d₁≠0 ∧ e₁≠0 ∧ slope c η d₁ > slope c η (d₁+e₁)) ∨ (d₂≠0 ∧ e₂≠0 ∧ slope c η d₂ > slope c η (d₂+e₂)) := by let θ := slope c η (d₁+e₁) by_cases h₁ : mass η d₁ > θ * mass c d₁ · exact Or.inl (high_mass_destabilizes c η hc d₁ e₁ h₁) by_cases h₂ : mass η d₂ > θ * mass c d₂ · exact Or.inr (high_mass_destabilizes c η hc d₂ e₂ (by simpa only [θ,ht] using h₂)) have hsrc : mass η d₁ + mass η d₂ = θ * (mass c d₁ + mass c d₂) := by have h := mass_eq c η hc (d₁+d₂) rwa [mass_add,mass_add,hs] at h have htar₁ : mass η d₁ + mass η e₁ = θ * (mass c d₁ + mass c e₁) := by have h := mass_eq c η hc (d₁+e₁) rwa [mass_add,mass_add] at h have htar₂ : mass η d₂ + mass η e₂ = θ * (mass c d₂ + mass c e₂) := by have h := mass_eq c η hc (d₂+e₂) rwa [mass_add,mass_add,← ht] at h have hd₁ : mass η d₁ = θ * mass c d₁ := by nlinarith have hd₂ : mass η d₂ = θ * mass c d₂ := by nlinarith have he₁ : mass η e₁ = θ * mass c e₁ := by nlinarith have he₂ : mass η e₂ = θ * mass c e₂ := by nlinarith exact (hoff ⟨onSlopeOrZero_of_mass c η hc θ d₁ hd₁, onSlopeOrZero_of_mass c η hc θ e₁ he₁,onSlopeOrZero_of_mass c η hc θ d₂ hd₂, onSlopeOrZero_of_mass c η hc θ e₂ he₂⟩).elim
end ElementaryPositivity.SlopeArithmetic
namespace ElementaryPositivity.RawShuffleopen MvPolynomialopen ElementaryPositivity.ShufflePolynomiality ElementaryPositivity.PackConvolutionopen ElementaryPositivity.SlopeArithmeticopen scoped TensorProductattribute [local instance] Classical.propDecidablevariable {I : Type*} [Fintype I] [DecidableEq I]variable {A : I → Type*} [∀ i,Fintype (A i)] [∀ i,DecidableEq (A i)]
lemma quotient_cellTransfer_offSlope (a : I → I → ℕ) (c η : I → ℝ) (hc : ∀ i,0<c i) (d₁ e₁ d₂ e₂ : I → ℕ) (ht : slope c η (d₁+e₁) = slope c η (d₂+e₂)) (hs : slope c η (d₁+d₂) = slope c η (d₁+e₁)) (hoff : ¬ CellsOnSlope c η (slope c η (d₁+e₁)) d₁ e₁ d₂ e₂) (p : MvPolynomial (CellVars d₁ e₁ ⊕ CellVars d₂ e₂) ℚ) : quotientTensor a (slope c η) (d₁+e₁) (d₂+e₂) (cellTransfer a d₁ e₁ d₂ e₂ p) = 0 := quotient_cellTransfer_zero a (slope c η) _ _ _ _ (offSlope_destabilizes c η hc _ _ _ _ ht hs hoff) p
omit [(index : I) → Fintype (A index)] inlemma quotient_gridShapeTensor_offSlope (a : I → I → ℕ) (c η : I → ℝ) (hc : ∀ i,0<c i) {d e α β : I → ℕ} (f : S d) (g : S e) {s : Pack (A:=A)} (p : PackConvolution.Cut s) (R : Realization α (left p)) (T : Realization β (right p)) (u : CutShape (left p)) (v : CutShape (right p)) (ht : slope c η α = slope c η β) (hs : slope c η d = slope c η α) (hoff : ¬ CellsOnSlope c η (slope c η α) (fun i=>(u i).val) (shapeComplement u) (fun i=>(v i).val) (shapeComplement v)) : quotientTensor a (slope c η) α β (gridShapeTensor a f g p R T u v) = 0 := by unfold gridShapeTensor apply quotientTensor_cast_zero by_cases hsum : (fun i=>(u i).val) + (fun i=>(v i).val) = d · apply quotient_cellTransfer_offSlope a c η hc · rw [(shape_add_complement u).trans (realization_card R), (shape_add_complement v).trans (realization_card T)] exact ht · rw [hsum,(shape_add_complement u).trans (realization_card R)] exact hs · rwa [(shape_add_complement u).trans (realization_card R)] · rw [fourGridPolynomial_zero_of_source_mismatch a f g _ _ _ _ hsum,map_zero,map_zero]
omit [(index : I) → Fintype (A index)] intheorem quotient_gridTensor_sameSlope_support (a : I → I → ℕ) (c η : I → ℝ) (hc : ∀ i,0<c i) {d e α β : I → ℕ} (f : S d) (g : S e) {s : Pack (A:=A)} (p : PackConvolution.Cut s) (R : Realization α (left p)) (T : Realization β (right p)) (ht : slope c η α = slope c η β) (hs : slope c η d = slope c η α) : quotientTensor a (slope c η) α β (gridTensor a f g p R T) = ∑ u : CutShape (left p), ∑ v : CutShape (right p), if CellsOnSlope c η (slope c η α) (fun i=>(u i).val) (shapeComplement u) (fun i=>(v i).val) (shapeComplement v) then quotientTensor a (slope c η) α β (gridShapeTensor a f g p R T u v) else 0 := by classical simp only [gridTensor,map_sum] apply Finset.sum_congr rfl intro u hu apply Finset.sum_congr rfl intro v hv split_ifs with hon · rfl · exact quotient_gridShapeTensor_offSlope a c η hc f g p R T u v ht hs hon
theorem cleared_restriction_sameSlope_support (a : I → I → ℕ) (c η : I → ℝ) (hc : ∀ i,0<c i) {d e α β : I → ℕ} (h : d+e=α+β) (f : S d) (g : S e) {s : Pack (A:=A)} (R : Realization (α+β) s) (u : Cut α β) (ht : slope c η α = slope c η β) (hs : slope c η d = slope c η α) : quotientTensor a (slope c η) α β (crossTensor α β) * quotientTensor a (slope c η) α β (restrictTensor u (castS h (shufflePolynomial a f g))) = crossSign α β • ∑ x : CutShape (left (cutRealizationEquiv R u).val), ∑ y : CutShape (right (cutRealizationEquiv R u).val), if CellsOnSlope c η (slope c η α) (fun i=>(x i).val) (shapeComplement x) (fun i=>(y i).val) (shapeComplement y) then quotientTensor a (slope c η) α β (gridShapeTensor a f g (cutRealizationEquiv R u).val (leftRealization R u) (rightRealization R u) x y) else 0 := by rw [← map_mul,cleared_restrictTensor a h f g R u,map_smul] rw [quotient_gridTensor_sameSlope_support a c η hc f g _ _ _ ht hs]
end ElementaryPositivity.RawShuffle
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.PowerSeriesSplit
namespace OAI
sectionnamespace ElementaryPositivity.PowerSeriesSplitopen PowerSeriesnoncomputable sectionvariable {R : Type*} [Ring R]
lemma left_coeff_projection (Q : R →+ R) (S : Subring R) (hQ : ∀x,Q (Q x)=Q x) (hOne : Q 1=1) (hMem : ∀x∈S,Q x∈S) (hMul : ∀x∈S,∀y∈S,Q (x*y)=Q x*Q y) (f : PowerSeries R) (hf : constantCoeff f=1) (hS : ∀n,coeff n f∈S) (n : ℕ) : coeff n (leftFactor Q f)=Q (coeff n f) := by have hs:=factors_mem Q S hMem f hS cases n with | zero => simp only [coeff_zero_eq_constantCoeff_apply,left_constant,hf,hOne] | succ n => conv_lhs => rw [leftFactor,coeff_mk,pairCoefficients] have hleft (k : ℕ) : coeff k (leftFactor Q f)=(pairCoefficients Q f k).1 := by simp only [leftFactor,coeff_mk] have hright (k : ℕ) : coeff k (rightFactor Q f)=(pairCoefficients Q f k).2 := by simp only [rightFactor,coeff_mk] simp only [←hleft,←hright] change Q (coeff (n+1) f-∑i : Fin n, coeff (i.val+1) (leftFactor Q f)*coeff (n-i.val) (rightFactor Q f))=Q (coeff (n+1) f) rw [map_sub,map_sum] suffices H : (∑i : Fin n,Q (coeff (i.val+1) (leftFactor Q f)* coeff (n-i.val) (rightFactor Q f)))=0 by rw [H,sub_zero] apply Finset.sum_eq_zero intro i hi rw [hMul _ (hs.1 (i.val+1)) _ (hs.2 (n-i.val))] have he : n-i.val=(n-i.val-1)+1 := by omega rw [he,right_killed Q hQ,mul_zero]endend ElementaryPositivity.PowerSeriesSplit
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859import Mathlibimport OAI.Combinatorics.Chromatic.QuantumTorus.RationalTorusFaithfulimport OAI.Combinatorics.Chromatic.GradedAlgebra.RationalCenteredAction
namespace OAI
sectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus WallUnits PowerSeriesnoncomputable sectionvariable {K M:Type*} [Field K] [AddCommGroup M]variable (v:Kˣ) (Ω:M →+ M →+ ℤ) (hΩ:∀m,Ω m m=0)variable (k:M →+ ℤ) (p:M) (hp:k p=1)
lemma ofPowerSeries_negative (f:PowerSeries K) (j:ℤ) (hj:j<0) : (HahnSeries.ofPowerSeries ℤ K f).coeff j=0 := by rw [HahnSeries.ofPowerSeries_apply] apply HahnSeries.embDomain_notin_image_support rintro ⟨n,_,hn⟩ have he : (n:ℤ)=j := hn omega
include hΩ inlemma read_pure_monomial_support (hq:∀n:ℕ,1-(↑(v^(-2:ℤ)):K)^(n+1)≠0) (b m:M) (hm:readFiber v Ω k p hp m (pureAction v (complementOmega k Ω) (complementAlpha k p Ω) (embed v Ω hΩ k p hp (Torus.X v Ω b)))≠0) : ∃j:ℕ,m=b+j • p := by classical rw [Torus.X,embed_monomial,pureAction_monomial,map_one,one_mul, complement_pairing Ω hΩ k p hp b] at hm change (expandZero ((Finsupp.single (off k p hp b) (centeredScalar v (k b) (Ω p b)*(pureRatio v (Ω p b):RatFunc K))) (off k p hp m))).coeff (k m)* (↑(v^(k m*complementAlpha k p Ω (off k p hp m))):K)≠0 at hm have ho:off k p hp b=off k p hp m:=by by_contra hh simp only [Finsupp.single_apply,ite_eq_right hh,map_zero,HahnSeries.coeff_zero,zero_mul,ne_eq,not_true_eq_false] at hm rw [Finsupp.single_apply,ite_eq_left ho,map_mul] at hm rw [show expandZero (centeredScalar v (k b) (Ω p b))= HahnSeries.single (k b) (↑(v^(-k b*Ω p b)):K) by simpa using expand_centeredScalar v (k b) (Ω p b) (1:K), expandedPure_ratio v hq,HahnSeries.coeff_single_mul] at hm have hk:0≤k m-k b:=by by_contra hh rw [ofPowerSeries_negative _ _ (lt_of_not_ge hh),mul_zero,zero_mul] at hm exact hm rfl refine ⟨(k m-k b).toNat,split_injective k p hp ?_ ?_⟩ · simp only [map_add,map_nsmul,nsmul_eq_mul,hp,mul_one,Int.toNat_of_nonneg hk] omega · simp only [map_add,map_nsmul,off_p,smul_zero,add_zero] exact ho.symmendend ElementaryPositivity.RationalFiber
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212import Mathlibimport OAI.Combinatorics.Chromatic.Walls.SimpleIncomingElementimport OAI.Combinatorics.Chromatic.Walls.CompletedPureComparisonimport OAI.Combinatorics.Chromatic.Walls.CompletedBiUnit
namespace OAI
sectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus PowerSeries WallUnitsnoncomputable sectionvariable {M I : Type*} [AddCommGroup M] [Fintype I] [DecidableEq I]variable (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (C : (I → ℤ) →+ M) (coord : M →+ (I → ℤ))variable (hcoord : ∀d,coord (C d)=d) (pc : I)lemma laurent_shiftedElementary_zero : shiftedElementary LaurentRay.vUnit 0= elementary (HahnSeries.single (2:ℤ) (1:ℚ)) (HahnSeries.single (1:ℤ) (1:ℚ)) := by rw [shiftedElementary_zero,←zpow_neg_one, LaurentRay.vUnit_zpow,LaurentRay.vUnit_zpow] rflomit [Fintype I] ininclude hcoord inlemma pureDegree_simple_self : pureDegree coord pc (simpleRoot C pc)=1 := by change coord (simpleRoot C pc) pc=1 rw [simpleRoot_coordinates C coord hcoord,Pi.single_eq_same]
lemma completedBiUnit_pure (h : M →+ ℝ) (hg : ∀N,RayGeneric C N (simpleRoot C pc) h) : completedBiUnit LaurentRay.vUnit Ω C coord hcoord pc (chartZero LaurentRay.vUnit Ω C h (simpleTotalTransport Ω C))= oldPureUnit LaurentRay.vUnit Ω hΩ (nonpDegree coord pc) (pureDegree coord pc) (simpleRoot C pc) (pureDegree_simple_self C coord hcoord pc) (nonpDegree_simple_self C coord hcoord pc) := by apply Units.ext apply Subtype.ext change (chartZero LaurentRay.vUnit Ω C h (simpleTotalTransport Ω C)).val= raySeries LaurentRay.vUnit Ω (simpleRoot C pc) (shiftedElementary LaurentRay.vUnit 0) rw [laurent_shiftedElementary_zero] apply PowerSeries.ext intro n exact pure_simple_wall Ω C coord hcoord pc hΩ n h (hg n) n le_rflendend ElementaryPositivity.RationalFiber
endsectionnamespace ElementaryPositivity.BiTruncationopen PowerSeriesvariable {R : Type*} [Semiring R]def Through (N : ℕ) (f g : PowerSeries (PowerSeries R)) : Prop := ∀d e,d+e≤N → coeff e (coeff d f)=coeff e (coeff d g)lemma Through.refl (N : ℕ) (f : PowerSeries (PowerSeries R)) : Through N f f := by intro d e h; rfllemma Through.symm {N : ℕ} {f g : PowerSeries (PowerSeries R)} (h : Through N f g) : Through N g f := by intro d e he; exact (h d e he).symmlemma Through.trans {N : ℕ} {f g h : PowerSeries (PowerSeries R)} (hfg : Through N f g) (hgh : Through N g h) : Through N f h := by intro d e he; exact (hfg d e he).trans (hgh d e he)lemma Through.mul {N : ℕ} {f f' g g' : PowerSeries (PowerSeries R)} (hf : Through N f f') (hg : Through N g g') : Through N (f*g) (f'*g') := by intro d e hde simp only [coeff_mul,map_sum] apply Finset.sum_congr rfl intro ij hij apply Finset.sum_congr rfl intro kl hkl have H1:=Finset.HasAntidiagonal.mem_antidiagonal.mp hij have H2:=Finset.HasAntidiagonal.mem_antidiagonal.mp hkl rw [hf ij.1 kl.1 (by omega),hg ij.2 kl.2 (by omega)]lemma Through.conjugate {N : ℕ} {u w : PowerSeries (PowerSeries R)} (hu : Through N u 1) (hw : Through N w 1) (f : PowerSeries (PowerSeries R)) : Through N (u*f*w) f := by simpa only [one_mul,mul_one] using (hu.mul (Through.refl N f)).mul hwlemma ext {f g : PowerSeries (PowerSeries R)} (h : ∀N,Through N f g) : f=g := by apply PowerSeries.ext intro d apply PowerSeries.ext intro e exact h (d+e) d e le_rflend ElementaryPositivity.BiTruncation
endsectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeries BiTruncationnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ κ : M →+ ℤ)local instance biThroughRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance biThroughAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance biThroughAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGrouplocal instance biThroughNonUnitalSemiring : NonUnitalSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalSemiringlocal instance biThroughNonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalNonAssocSemiringlemma biRegrade_through {f g : PowerSeries (Torus v Ω)} (N : ℕ) (h : ∀n≤N,coeff n f=coeff n g) : Through N (biRegrade v Ω δ κ f) (biRegrade v Ω δ κ g) := by intro d e he rw [biRegrade_coeff,biRegrade_coeff,h (d+e) he]lemma oldLaurent_through {f g : PowerSeries (Torus v Ω)} (N : ℕ) (h : ∀n≤N,coeff n f=coeff n g) (d e : ℕ) (he : d+e≤N) : (coeff d (oldLaurent v Ω δ κ f)).coeff (e:ℤ)= (coeff d (oldLaurent v Ω δ κ g)).coeff (e:ℤ) := by simp only [oldLaurent,coeff_map,HahnSeries.ofPowerSeries_apply_coeff] exact biRegrade_through v Ω δ κ N h d e helemma oldLaurent_inner_through (u : (biSupportedSubring v Ω δ κ)ˣ) (N : ℕ) (hv : ∀n≤N,coeff n u.val.val=coeff n 1) (hi : ∀n≤N,coeff n u.inv.val=coeff n 1) (f : PowerSeries (PowerSeries (Torus v Ω))) (d e : ℕ) (he : d+e≤N) : (coeff d (oldLaurent v Ω δ κ u.val.val* PowerSeries.map (HahnSeries.ofPowerSeries ℤ (Torus v Ω)) f* oldLaurent v Ω δ κ u.inv.val)).coeff (e:ℤ)=coeff e (coeff d f) := by have H:=Through.conjugate (show Through N (biRegrade v Ω δ κ u.val.val) 1 by simpa only [biRegrade_one] using biRegrade_through v Ω δ κ N hv) (show Through N (biRegrade v Ω δ κ u.inv.val) 1 by simpa only [biRegrade_one] using biRegrade_through v Ω δ κ N hi) f d e he unfold oldLaurent rw [←map_mul,←map_mul,coeff_map,HahnSeries.ofPowerSeries_apply_coeff] exact Hendend ElementaryPositivity.QuantumTorus
endsectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus PowerSeriesnoncomputable sectionvariable {K M : Type*} [Field K] [AddCommGroup M]variable (v : Kˣ) (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (δ k : M →+ ℤ) (p : M) (hp : k p=1) (B : ℕ)local instance rationalThroughRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance rationalThroughAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance rationalThroughAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGrouplocal instance rationalThroughNonUnitalSemiring : NonUnitalSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalSemiringlocal instance rationalThroughNonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalNonAssocSemiringlemma regrade_congr_through (D : ℕ) {f g : PowerSeries (Torus v Ω)} (he : ∀n≤B*D,coeff n f=coeff n g) : ∀d≤D,coeff d (regrade v Ω δ B f)=coeff d (regrade v Ω δ B g) := by intro d hd rw [regrade_coeff,regrade_coeff] apply Finset.sum_congr rfl intro n hn rw [he n (by have H:=Finset.mem_range.mp hn; have HH:=Nat.mul_le_mul_left B hd; omega)]lemma rationalRegrade_congr_through (D : ℕ) {f g : PowerSeries (Torus v Ω)} (he : ∀n≤B*D,coeff n f=coeff n g) : ∀d≤D,coeff d (rationalRegrade v Ω hΩ k p hp δ B f)= coeff d (rationalRegrade v Ω hΩ k p hp δ B g) := by intro d hd simp only [rationalRegrade,coeff_map] rw [regrade_congr_through v Ω δ B D he d hd]lemma oldUnit_inverse_congr (u w : (biSupportedSubring v Ω δ k)ˣ) (N : ℕ) (h : ∀n≤N,coeff n u.val.val=coeff n w.val.val) : ∀n≤N,coeff n u.inv.val=coeff n w.inv.val := by intro n hn have HE:=FormalLog.mul_coeff_congr u.inv.val (u.val.val*w.inv.val) u.inv.val (w.val.val*w.inv.val) n (fun _ _=>rfl) (by intro j hj exact FormalLog.mul_coeff_congr _ _ _ _ j (fun t ht=>h t (ht.trans (hj.trans hn))) (fun _ _=>rfl)) have hu : u.inv.val*u.val.val=1:=congrArg (fun a : biSupportedSubring v Ω δ k=>a.val) u.inv_val have hw : w.val.val*w.inv.val=1:=congrArg (fun a : biSupportedSubring v Ω δ k=>a.val) w.val_inv rw [←mul_assoc,hu,one_mul,hw,mul_one] at HE exact HE.symmlemma innerHom_coeff_congr {A : Type*} [Ring A] (u w : (PowerSeries A)ˣ) (f g : PowerSeries A) (N : ℕ) (hv : ∀n≤N,coeff n u.val=coeff n w.val) (hi : ∀n≤N,coeff n u.inv=coeff n w.inv) (hf : ∀n≤N,coeff n f=coeff n g) : coeff N (innerHom u f)=coeff N (innerHom w g) := by change coeff N (u.val*f*u.inv)=coeff N (w.val*g*w.inv) apply FormalLog.mul_coeff_congr · intro j hj exact FormalLog.mul_coeff_congr _ _ _ _ j (fun t ht=>hv t (ht.trans hj)) (fun t ht=>hf t (ht.trans hj)) · exact hilemma comparisonAction_input_congr (c : ComparisonCrossing v Ω δ k B) (f g : PowerSeries (FiberTorus v (complementOmega k Ω) (complementAlpha k p Ω))) (N : ℕ) (hg : ∀n≤N,coeff n f=coeff n g) : coeff N (comparisonAction v Ω hΩ δ k p hp B c f)= coeff N (comparisonAction v Ω hΩ δ k p hp B c g) := by cases c with | bounded u hf hi=>exact innerHom_coeff_congr _ _ _ _ N (fun _ _=>rfl) (fun _ _=>rfl) hg | pure b=> cases b · change coeff N (PowerSeries.map (pureAction v (complementOmega k Ω) (complementAlpha k p Ω)).symm.toRingHom f)= coeff N (PowerSeries.map (pureAction v (complementOmega k Ω) (complementAlpha k p Ω)).symm.toRingHom g) rw [coeff_map,coeff_map,hg N le_rfl] · change coeff N (PowerSeries.map (pureAction v (complementOmega k Ω) (complementAlpha k p Ω)).toRingHom f)= coeff N (PowerSeries.map (pureAction v (complementOmega k Ω) (complementAlpha k p Ω)).toRingHom g) rw [coeff_map,coeff_map,hg N le_rfl]lemma bounded_action_congr (D : ℕ) (u w : (biSupportedSubring v Ω δ k)ˣ) (hf : RegradeBound v Ω δ B u.val.val) (hi : RegradeBound v Ω δ B u.inv.val) (hf' : RegradeBound v Ω δ B w.val.val) (hi' : RegradeBound v Ω δ B w.inv.val) (he : ∀n≤B*D,coeff n u.val.val=coeff n w.val.val) (f g : PowerSeries (FiberTorus v (complementOmega k Ω) (complementAlpha k p Ω))) (hg : ∀n≤D,coeff n f=coeff n g) : ∀d≤D,coeff d (comparisonAction v Ω hΩ δ k p hp B (.bounded u hf hi) f)= coeff d (comparisonAction v Ω hΩ δ k p hp B (.bounded w hf' hi') g) := by intro d hd apply innerHom_coeff_congr · intro n hn exact rationalRegrade_congr_through v Ω hΩ δ k p hp B D he n (hn.trans hd) · intro n hn exact rationalRegrade_congr_through v Ω hΩ δ k p hp B D (oldUnit_inverse_congr v Ω δ k u w (B*D) he) n (hn.trans hd) · exact fun n hn=>hg n (hn.trans hd)endend ElementaryPositivity.RationalFiber
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114import Mathlibimport OAI.Combinatorics.Chromatic.Walls.SimpleIncomingDataimport OAI.Combinatorics.Chromatic.QuantumTorus.PureFaceProjection
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeries WallUnitsnoncomputable sectionvariable {M I : Type*} [AddCommGroup M] [Fintype I] [DecidableEq I]variable (Ω : M →+ M →+ ℤ) (C : (I → ℤ) →+ M)variable (coord : M →+ (I → ℤ)) (hcoord : ∀d,coord (C d)=d) (pc : I)local instance pureFaceLogAddCommGroup : AddCommGroup (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddCommGrouplocal instance pureFaceLogAddCommMonoid : AddCommMonoid (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddCommMonoidlocal instance pureFaceLogAddGroup : AddGroup (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddGrouplocal instance pureFaceLogSub : Sub (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toSubomit [DecidableEq I] inlemma graded_series_pow (F : PowerSeries (Torus LaurentRay.vUnit Ω)) (hF : ∀n,coeff n F∈rootGrade LaurentRay.vUnit Ω C n) (k : ℕ) : ∀n,coeff n (F^k)∈rootGrade LaurentRay.vUnit Ω C n := by induction k with | zero=>simpa only [pow_zero] using FormalLog.graded_one _ (rootGrade_one LaurentRay.vUnit Ω C) | succ k ih=>simpa only [pow_succ] using FormalLog.graded_multiply _ (rootGrade_mul LaurentRay.vUnit Ω C) _ _ ih hFinclude hcoord inlemma pureFaceSeries_pow (F : PowerSeries (Torus LaurentRay.vUnit Ω)) (hF : ∀n,coeff n F∈rootGrade LaurentRay.vUnit Ω C n) (k : ℕ) : pureFaceSeries Ω coord pc (F^k)=(pureFaceSeries Ω coord pc F)^k := by induction k with | zero=>simpa only [pow_zero] using pureFaceSeries_one Ω coord pc | succ k ih=>rw [pow_succ,pureFaceSeries_mul Ω C coord hcoord pc _ _ (graded_series_pow Ω C F hF k) hF,ih,pow_succ]lemma zeroProject_rat_smul (h : M →+ ℝ) (a : ℚ) (x : Torus LaurentRay.vUnit Ω) : zeroProject LaurentRay.vUnit Ω h (a • x)=a • zeroProject LaurentRay.vUnit Ω h x := by classical exact map_rat_smul (zeroProject LaurentRay.vUnit Ω h) a xinclude hcoord inlemma pureFaceSeries_log (F : CompletedPositive LaurentRay.vUnit Ω C) : pureFaceSeries Ω coord pc (FormalLog.log F.val)=FormalLog.log (pureFace Ω C coord pc F).val := by have hu : ∀n,coeff n (F.val-1)∈rootGrade LaurentRay.vUnit Ω C n:=by intro n rw [map_sub] exact (rootGrade LaurentRay.vUnit Ω C n).sub_mem (F.property.2 n) (FormalLog.graded_one _ (rootGrade_one LaurentRay.vUnit Ω C) n) apply PowerSeries.ext intro n rw [coeff_pureFaceSeries] simp only [FormalLog.log,coeff_mk,map_sum] apply Finset.sum_congr rfl intro k hk rw [zeroProject_rat_smul,←coeff_pureFaceSeries,pureFaceSeries_pow Ω C coord hcoord pc _ hu, pureFaceSeries_sub,pureFaceSeries_one] rflinclude hcoord inlemma pureFace_log_chart_apply (h : M →+ ℝ) (hp : h (simpleRoot C pc)=0) (F : CompletedPositive LaurentRay.vUnit Ω C) (n : ℕ) (m : M) (hm : nonpDegree coord pc m=0) : coeff n (FormalLog.log (chartZero LaurentRay.vUnit Ω C h F).val) m= coeff n (FormalLog.log F.val) m := by have H:=congrArg (fun D : CompletedPositive LaurentRay.vUnit Ω C=>coeff n (FormalLog.log D.val) m) (pureFace_chartZero Ω C coord hcoord pc h hp F) rw [←pureFaceSeries_log Ω C coord hcoord pc,←pureFaceSeries_log Ω C coord hcoord pc] at H simpa only [pureFaceSeries_apply,hm,ite_true] using Hinclude hcoord inlemma pureFace_simpleTransport (hΩ : ∀m,Ω m m=0) : pureFace Ω C coord pc (simpleTotalTransport Ω C)= literalIncomingCompleted Ω C (simpleIncomingList C) (simpleIncomingList_allowed C) (simpleRoot C pc) := by let F:=simpleTotalTransport Ω C let D:=literalIncomingCompleted Ω C (simpleIncomingList C) (simpleIncomingList_allowed C) (simpleRoot C pc) apply Subtype.ext apply PowerSeries.ext intro N apply FormalLog.log_injective_through (pureFace Ω C coord pc F).val D.val N (pureFace Ω C coord pc F).property.1 D.property.1 intro n hn apply Finsupp.ext intro m rw [←pureFaceSeries_log Ω C coord hcoord pc,pureFaceSeries_apply] have hdlog : ∀j m,coeff j (FormalLog.log D.val) m≠0→OnPositiveRay (simpleRoot C pc) m:=by intro j m hm by_contra hh exact hm (strict_log_support LaurentRay.vUnit Ω (fun a b ha hb=>ha.add hb) D.val D.property.1 (literalRootProducts_strictSupport Ω C (OnPositiveRay (simpleRoot C pc)) (fun a b ha hb=>ha.add hb) (literalIncomingRay_mem Ω C (simpleIncomingList C) (simpleIncomingList_allowed C) (simpleRoot C pc))) j m hh) by_cases hz : nonpDegree coord pc m=0 · rw [ite_eq_left hz] by_cases hr : HasRootDegree C n m · cases n with | zero=>simp only [coeff_zero_eq_constantCoeff_apply,FormalLog.log_constant,Finsupp.zero_apply] | succ n=> have hmray : OnPositiveRay (simpleRoot C pc) m:=by refine ⟨1,n+1,by omega,by omega,?_⟩ rw [one_nsmul,nonp_zero_root C coord hcoord pc hr hz] have hp : incomingCovector Ω m (simpleRoot C pc)=0:=by change (Ω (simpleRoot C pc) m : ℝ)=0 rw [nonp_zero_root C coord hcoord pc hr hz,map_nsmul,hΩ,nsmul_zero,Int.cast_zero] rw [←pureFace_log_chart_apply Ω C coord hcoord pc (incomingCovector Ω m) hp F _ m hz] exact literalTotalTransport_ray_prescription Ω C hΩ _ (simpleIncomingList_allowed C) _ _ _ hmray · rw [root_graded_log LaurentRay.vUnit Ω C F n m hr,root_graded_log LaurentRay.vUnit Ω C D n m hr] · rw [ite_eq_right hz] by_contra hh have hmr:=hdlog n m (Ne.symm hh) obtain ⟨a,b,ha,hb,he⟩:=hmr have HH:=congrArg (nonpDegree coord pc) he rw [map_nsmul,map_nsmul,nonpDegree_simple_self C coord hcoord,nsmul_zero,nsmul_eq_mul] at HH exact hz ((mul_eq_zero.mp HH).resolve_left (by exact_mod_cast (Nat.ne_of_gt ha))) exact Nat.le_refl Nendend ElementaryPositivity.QuantumTorus
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485import Mathlibimport OAI.Combinatorics.Chromatic.Walls.PureActualCoefficients
namespace OAI
sectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus WallUnits PowerSeriesnoncomputable sectionvariable {K M:Type*} [Field K] [AddCommGroup M]variable (v:Kˣ) (Ω:M →+ M →+ ℤ) (hΩ:∀m,Ω m m=0)variable (k:M →+ ℤ) (p:M) (hp:k p=1)lemma read_pure_scalar_monomial (b m:M) (c:K) : readFiber v Ω k p hp m (pureAction v (complementOmega k Ω) (complementAlpha k p Ω) (embed v Ω hΩ k p hp (Torus.monomial v Ω b c)))= c*readFiber v Ω k p hp m (pureAction v (complementOmega k Ω) (complementAlpha k p Ω) (embed v Ω hΩ k p hp (Torus.X v Ω b))) := by classical rw [Torus.X,embed_monomial,embed_monomial,pureAction_monomial,pureAction_monomial,map_one,one_mul] change (expandZero ((Finsupp.single (off k p hp b) ((RatFunc.C c*centeredScalar v (k b) (complementAlpha k p Ω (off k p hp b)))* (pureRatio v (complementAlpha k p Ω (off k p hp b)):RatFunc K))) (off k p hp m))).coeff (k m)* (↑(v^(k m*complementAlpha k p Ω (off k p hp m))):K)= c*((expandZero ((Finsupp.single (off k p hp b) (centeredScalar v (k b) (complementAlpha k p Ω (off k p hp b))* (pureRatio v (complementAlpha k p Ω (off k p hp b)):RatFunc K))) (off k p hp m))).coeff (k m)* (↑(v^(k m*complementAlpha k p Ω (off k p hp m))):K)) by_cases ho:off k p hp b=off k p hp m · simp only [Finsupp.single_apply,ite_eq_left ho] rw [mul_assoc,map_mul,expandZero_constant] change ((HahnSeries.single 0 c:HahnSeries ℤ K)*_).coeff (k m)*_=c*(_*_) rw [HahnSeries.coeff_single_mul,sub_zero,mul_assoc] · simp only [Finsupp.single_apply,ite_eq_right ho,map_zero,HahnSeries.coeff_zero,zero_mul,mul_zero]endend ElementaryPositivity.RationalFibernamespace ElementaryPositivity.QuantumTorusopen PowerSeries PowerSeriesAdjoint WallUnits RationalFibernoncomputable sectionvariable {M:Type*} [AddCommGroup M]variable (Ω:M →+ M →+ ℤ) (hΩ:∀m,Ω m m=0) (τ:M →+ ℤ)local instance purePolynomialCoefficientsRing : Ring (Torus LaurentRay.vUnit Ω) := Torus.instRing LaurentRay.vUnit Ωlocal instance purePolynomialCoefficientsAddCommMonoid : AddCommMonoid (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddCommMonoidlocal instance purePolynomialCoefficientsAddGroup : AddGroup (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddGroupinclude hΩ inlemma actual_pure_polynomial (k:M →+ ℤ) (p:M) (hp:k p=1) (hτ:τ p=1) (F:Torus LaurentRay.vUnit Ω) (m:M) : actualPolynomialAdjointCoefficient Ω τ (normalizedSimple Ω p) F m= readFiber LaurentRay.vUnit Ω k p hp m (pureAction LaurentRay.vUnit (complementOmega k Ω) (complementAlpha k p Ω) (embed LaurentRay.vUnit Ω hΩ k p hp F)) := by classical induction F using Finsupp.induction_linear with | zero=>simp [actualPolynomialAdjointCoefficient] | add F G hF hG=>rw [actualPolynomialAdjointCoefficient_add,map_add,map_add,map_add,hF,hG] | single b c=> change actualPolynomialAdjointCoefficient Ω τ (normalizedSimple Ω p) (Torus.monomial LaurentRay.vUnit Ω b c) m=_ rw [actualPolynomialAdjointCoefficient_monomial,actual_pure_monomial Ω hΩ τ k p hp hτ] exact (read_pure_scalar_monomial LaurentRay.vUnit Ω hΩ k p hp b m c).symminclude hΩ inlemma actual_pure_finite (k:M →+ ℤ) (p:M) (hp:k p=1) (hτ:τ p=1) (F G:Torus LaurentRay.vUnit Ω) (h:embed LaurentRay.vUnit Ω hΩ k p hp G= pureAction LaurentRay.vUnit (complementOmega k Ω) (complementAlpha k p Ω) (embed LaurentRay.vUnit Ω hΩ k p hp F)) (m:M) : actualPolynomialAdjointCoefficient Ω τ (normalizedSimple Ω p) F m=G m := by rw [actual_pure_polynomial Ω hΩ τ k p hp hτ,←h] exact readFiber_embedAdd LaurentRay.vUnit Ω k p hp G minclude hΩ inlemma actual_pure_order_independent (σ:M →+ ℤ) (p:M) (hτ:τ p=1) (hσ:σ p=1) (F:Torus LaurentRay.vUnit Ω) (m:M) : actualPolynomialAdjointCoefficient Ω τ (normalizedSimple Ω p) F m= actualPolynomialAdjointCoefficient Ω σ (normalizedSimple Ω p) F m := by rw [actual_pure_polynomial Ω hΩ τ τ p hτ hτ, actual_pure_polynomial Ω hΩ σ τ p hτ hσ]endend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051import Mathlibimport OAI.Combinatorics.Chromatic.QuantumTorus.QuantumTorus
namespace OAI
sectionsectionnamespace ElementaryPositivity.QuantumTorus.Torusnoncomputable sectionvariable {S R M : Type*} [CommSemiring S] [CommRing R] [Algebra S R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ)
lemma scalar_one (r : S) : r • (1 : Torus v Ω)=monomial v Ω 0 (r • (1:R)) := by change r • Finsupp.single 0 (1:R)=Finsupp.single 0 (r • (1:R)) exact Finsupp.smul_single _ _ _
lemma scalar_one_mul (r : S) (f : Torus v Ω) : (r • (1 : Torus v Ω))*f=r • f := by classical induction f using Finsupp.induction_linear with | zero => simp | add f g hf hg => rw [mul_add,hf,hg,smul_add] | single m a => change (r • (1 : Torus v Ω))*monomial v Ω m a=r • monomial v Ω m a rw [scalar_one,monomial_mul_monomial] simp only [map_zero,AddMonoidHom.zero_apply,zpow_zero,Units.val_one,zero_add,_root_.mul_one, smul_mul_assoc,_root_.one_mul,monomial,Finsupp.smul_single]
lemma mul_scalar_one (r : S) (f : Torus v Ω) : f*(r • (1 : Torus v Ω))=r • f := by classical induction f using Finsupp.induction_linear with | zero => simp | add f g hf hg => rw [add_mul,hf,hg,smul_add] | single m a => change monomial v Ω m a*(r • (1 : Torus v Ω))=r • monomial v Ω m a rw [scalar_one,monomial_mul_monomial] simp only [map_zero,zpow_zero,Units.val_one,add_zero,_root_.mul_one, mul_smul_comm,_root_.mul_one,monomial,Finsupp.smul_single]
instance : Algebra S (Torus v Ω) := by letI : Module S (Torus v Ω) := inferInstanceAs (Module S (M →₀ R)) exact @Algebra.ofModule' S (Torus v Ω) _ (Torus.instRing v Ω).toSemiring (inferInstanceAs (Module S (M →₀ R))) (scalar_one_mul (S:=S) v Ω) (mul_scalar_one (S:=S) v Ω)endend ElementaryPositivity.QuantumTorus.Torusendend
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101import Mathlibimport OAI.Combinatorics.Chromatic.QuantumTorus.QuantumTorus
namespace OAI
sectionsectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ)
def supportedSubring (C : AddSubmonoid M) : Subring (Torus v Ω) where carrier := {f | ∀m,m∉C → f m=0} zero_mem' := by intro m hm; rfl one_mem' := by intro m hm change Finsupp.single 0 (1:R) m=0 exact Finsupp.single_eq_of_ne (fun he=>hm (he ▸ C.zero_mem)) add_mem' := by intro f g hf hg m hm; change f m+g m=0; rw [hf m hm,hg m hm,add_zero] neg_mem' := by intro f hf m hm; change -f m=0; rw [hf m hm,neg_zero] mul_mem' := by classical intro f g hf hg m hm change (Torus.multiply v Ω f g) m=0 simp only [Torus.multiply,Finsupp.sum,Finsupp.finsetSum_apply] apply Finset.sum_eq_zero intro x hx apply Finset.sum_eq_zero intro y hy have hxC : x∈C := by by_contra hn exact (Finsupp.mem_support_iff.mp hx) (hf x hn) have hyC : y∈C := by by_contra hn exact (Finsupp.mem_support_iff.mp hy) (hg y hn) apply Finsupp.single_eq_of_ne intro he apply hm exact he ▸ C.add_mem hxC hyC
variable (h : M →+ ℝ) def nonpositiveCone : AddSubmonoid M where carrier := {m | h m≤0} zero_mem' := by simp add_mem' := by intro a b ha hb change h a≤0 at ha change h b≤0 at hb change h (a+b)≤0 rw [map_add] linarith def positiveProject : Torus v Ω →+ Torus v Ω := Finsupp.filterAddHom (fun m=>0<h m) def zeroProject : Torus v Ω →+ Torus v Ω := Finsupp.filterAddHom (fun m=>h m=0)
lemma nonpositive_iff (f : Torus v Ω) : f∈supportedSubring v Ω (nonpositiveCone h) ↔ positiveProject v Ω h f=0 := by classical change (∀m,¬h m≤0 → f m=0) ↔ Finsupp.filter (fun m=>0<h m) f=0 constructor · intro hf ext m simp only [Finsupp.filter_apply,Finsupp.zero_apply] split_ifs with hm · exact hf m (not_le.mpr hm) · rfl · intro hf m hm have hh:=congrArg (fun f : M →₀ R=>f m) hf simpa only [Finsupp.filter_apply,not_le.mp hm,ite_true,Finsupp.zero_apply] using hh
lemma positiveProject_idem (f : Torus v Ω) : positiveProject v Ω h (positiveProject v Ω h f)=positiveProject v Ω h f := by classical ext m change (f.filter (fun m=>0<h m) |>.filter (fun m=>0<h m)) m = (f.filter (fun m=>0<h m)) m simp only [Finsupp.filter_apply] split_ifs <;> rfllemma zeroProject_idem (f : Torus v Ω) : zeroProject v Ω h (zeroProject v Ω h f)=zeroProject v Ω h f := by classical ext m change (f.filter (fun m=>h m=0) |>.filter (fun m=>h m=0)) m = (f.filter (fun m=>h m=0)) m simp only [Finsupp.filter_apply] split_ifs <;> rfllemma positive_zero_project (f : Torus v Ω) : positiveProject v Ω h (zeroProject v Ω h f)=0 := by classical ext m change (f.filter (fun m=>h m=0) |>.filter (fun m=>0<h m)) m = 0 simp only [Finsupp.filter_apply] split_ifs <;> first | rfl | linarith
endend ElementaryPositivity.QuantumTorusendend
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091import Mathlibimport OAI.Combinatorics.Chromatic.QuantumTorus.RationalTorusEmbeddingimport OAI.Combinatorics.Chromatic.GradedAlgebra.MutationRootMap
namespace OAI
sectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus WallUnits Polynomialnoncomputable sectionvariable {K M : Type*} [Field K] [AddCommGroup M]variable (v : Kˣ)lemma centeredPolynomial_degree_le (t : ℕ) : (centeredPolynomial v t).natDegree≤t := by unfold centeredPolynomial have H:=Polynomial.natDegree_prod_le Finset.univ (fun i : Fin t=>(1+Polynomial.C (↑(v^centeredExponent t i):K)*Polynomial.X)) have H' := Finset.sum_le_sum (s:=Finset.univ) (fun (i : Fin t) _ => natDegree_linear_le (↑(v^centeredExponent t i):K)) exact H.trans (by simpa using H')lemma centered_eval_ratio (t : ℕ) : (centeredPolynomial v t).eval₂ RatFunc.C (RatFunc.C (↑(v^(-(t:ℤ))):K)*RatFunc.X)=(pureRatio v (t:ℤ):RatFunc K) := by change (Polynomial.eval₂RingHom RatFunc.C (RatFunc.C (↑(v^(-(t:ℤ))):K)*RatFunc.X)) (centeredPolynomial v t)=_ rw [centeredPolynomial,map_prod,pureRatio_nat_val,←Fin.prod_univ_eq_prod_range] change (∏i : Fin t, (1+Polynomial.C (↑(v^centeredExponent t i):K)*Polynomial.X).eval₂ RatFunc.C (RatFunc.C (↑(v^(-(t:ℤ))):K)*RatFunc.X))=_ have H (i : Fin t) : (1+Polynomial.C (↑(v^centeredExponent t i):K)*Polynomial.X).eval₂ RatFunc.C (RatFunc.C (↑(v^(-(t:ℤ))):K)*RatFunc.X)= 1+RatFunc.C (↑(v^(-2*((i.rev:ℕ):ℤ)-1)):K)*RatFunc.X := by simp only [Polynomial.eval₂_add,Polynomial.eval₂_one,Polynomial.eval₂_mul, Polynomial.eval₂_C,Polynomial.eval₂_X] rw [←mul_assoc,←map_mul,←Units.val_mul,←zpow_add] congr 4 simp only [centeredExponent,Fin.val_rev] have H:=i.isLt congr 1 omega simp_rw [H] exact Equiv.prod_comp Fin.revPerm (fun i : Fin t=>1+RatFunc.C (↑(v^(-2*((i:ℕ):ℤ)-1)):K)*RatFunc.X)
variable (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (k : M →+ ℤ) (p : M) (hp : k p=1)include hΩ inlemma complement_pairing (m : M) : complementAlpha k p Ω (off k p hp m)=Ω p m := by change Ω p (m-k m • p)=_ rw [map_sub,map_zsmul,hΩ,smul_zero,sub_zero]lemma centeredScalar_shift (n a j : ℤ) : centeredScalar v (n+j) a= centeredScalar v n a*(RatFunc.C (↑(v^(-a)):K)*RatFunc.X)^j := by have hz : (RatFunc.X:RatFunc K)≠0:=RatFunc.X_ne_zero rw [centeredScalar,centeredScalar,mul_zpow,←map_zpow₀, ←Units.val_zpow_eq_zpow_val,←zpow_mul,zpow_add₀ hz] rw [show -(n+j)*a= -n*a+(-a)*j by ring,zpow_add,Units.val_mul,map_mul] ringinclude hΩ inlemma embed_pure_row_term (m : M) (j : ℕ) (a : K) : embed v Ω hΩ k p hp (Torus.monomial v Ω (m+j • p) a)= FiberTorus.monomial v _ _ (off k p hp m) (centeredScalar v (k m) (Ω p m)*RatFunc.C a* (RatFunc.C (↑(v^(-Ω p m)):K)*RatFunc.X)^j) := by rw [embed_monomial] simp only [map_add,map_nsmul,hp,nsmul_eq_mul,mul_one,off_p,smul_zero,add_zero] rw [complement_pairing Ω hΩ k p hp m,centeredScalar_shift] rw [zpow_natCast] congr 1 ringinclude hΩ inlemma pureAction_centered (m : M) (t : ℕ) (ht : Ω p m=(t:ℤ)) : pureAction v (complementOmega k Ω) (complementAlpha k p Ω) (embed v Ω hΩ k p hp (Torus.X v Ω m))= embed v Ω hΩ k p hp (centeredCrossing v Ω p m t) := by rw [Torus.X,embed_monomial,pureAction_monomial,map_one,one_mul, complement_pairing Ω hΩ k p hp m,ht,←centered_eval_ratio] rw [centeredCrossing,map_sum] simp_rw [embed_pure_row_term v Ω hΩ k p hp,ht] have He := Polynomial.eval₂_eq_sum_range' RatFunc.C (Nat.lt_succ_of_le (centeredPolynomial_degree_le v t)) (RatFunc.C (↑(v^(-(t:ℤ))):K)*RatFunc.X) rw [He,Finset.mul_sum] rw [←Fin.sum_univ_eq_sum_range] simp only [FiberTorus.monomial,mul_assoc] classical exact (map_sum (Finsupp.singleAddHom (off k p hp m)) _ Finset.univ)endend ElementaryPositivity.RationalFiber
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.NonpRegradeimport OAI.Combinatorics.Chromatic.GradedAlgebra.RationalLaurentScalarsimport OAI.Combinatorics.Chromatic.Walls.RationalReadExt
namespace OAI
sectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus HahnSeriesnoncomputable sectionvariable {K M : Type*} [Field K] [AddCommGroup M]variable (v : Kˣ) (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (k : M →+ ℤ) (p : M) (hp : k p=1)local instance rationalLaurentFaithfulRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance rationalLaurentFaithfulNonUnitalSemiring : NonUnitalSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalSemiringlocal instance rationalLaurentFaithfulNonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalNonAssocSemiringlemma expandFiber_monomial_coeff (l : k.ker) (a : RatFunc K) (n : ℤ) : (expandFiber v Ω hΩ k p (FiberTorus.monomial v _ _ l a)).coeff n= Torus.monomial v Ω (n • p+(l:M)) ((expandZero a).coeff n*(↑(v^(n*Ω p l)):K)) := by change (expandFiberAdd v Ω hΩ k p (FiberTorus.monomial v _ _ l a)).coeff n=_ rw [expandFiberAdd_monomial,HahnSeries.coeff_mul_single_zero] change Torus.monomial v Ω (n • p) ((expandZero a).coeff n)*Torus.X v Ω l=_ simp only [Torus.X,Torus.monomial_mul_monomial,mul_one,map_zsmul,AddMonoidHom.zsmul_apply, smul_eq_mul]lemma expansion_embed_monomial (m : M) (a : K) : expandFiber v Ω hΩ k p (embed v Ω hΩ k p hp (Torus.monomial v Ω m a))= HahnSeries.single (k m) (Torus.monomial v Ω m a) := by rw [embed_monomial] apply HahnSeries.ext funext n rw [expandFiber_monomial_coeff,expand_centeredScalar] simp only [HahnSeries.coeff_single] by_cases H : n=k m · subst n rw [ite_eq_left rfl,ite_eq_left rfl,split_sum k p hp] congr 1 change a*(↑(v^(-k m*complementAlpha k p Ω (off k p hp m))):K)* (↑(v^(k m*complementAlpha k p Ω (off k p hp m))):K)=a rw [mul_assoc,←Units.val_mul,←zpow_add] simp · simp [H,Torus.monomial]lemma expandFiber_read_monomial (m : M) (l : k.ker) (a : RatFunc K) : ((expandFiber v Ω hΩ k p (FiberTorus.monomial v _ _ l a)).coeff (k m)) m= readFiber v Ω k p hp m (FiberTorus.monomial v _ _ l a) := by classical rw [expandFiber_monomial_coeff] change Finsupp.single (k m • p+(l:M)) ((expandZero a).coeff (k m)*(↑(v^(k m*Ω p l)):K)) m= (expandZero ((Finsupp.single l a) (off k p hp m))).coeff (k m)* (↑(v^(k m*complementAlpha k p Ω (off k p hp m))):K) by_cases H : l=off k p hp m · subst l rw [split_sum k p hp,Finsupp.single_eq_same,Finsupp.single_eq_same] rfl · have hm : k m • p+(l:M)≠m:=by intro hh have HO:=congrArg (off k p hp) hh simp only [map_add,map_zsmul,off_p,smul_zero,off_complement,zero_add] at HO exact H HO rw [Finsupp.single_eq_of_ne (Ne.symm hm),Finsupp.single_eq_of_ne (Ne.symm H),map_zero, HahnSeries.coeff_zero,zero_mul]lemma expandFiber_read (f : FiberTorus v (complementOmega k Ω) (complementAlpha k p Ω)) (m : M) : ((expandFiber v Ω hΩ k p f).coeff (k m)) m=readFiber v Ω k p hp m f := by induction f using Finsupp.induction_linear with | zero=>simp | add f g hf hg=>simp only [_root_.map_add,HahnSeries.coeff_add,Finsupp.add_apply,hf,hg] | single l a=>exact expandFiber_read_monomial v Ω hΩ k p hp m l ainclude hp inlemma expandFiber_injective : Function.Injective (expandFiber v Ω hΩ k p) := by intro f g h apply readFiber_ext v Ω k p hp intro m rw [←expandFiber_read v Ω hΩ k p hp f m,←expandFiber_read v Ω hΩ k p hp g m,h]include hp inlemma completed_expandFiber_injective : Function.Injective (PowerSeries.map (expandFiber v Ω hΩ k p)) := by intro f g h apply PowerSeries.ext intro d apply expandFiber_injective v Ω hΩ k p hp have H:=congrArg (PowerSeries.coeff d) h simpa only [PowerSeries.coeff_map] using Hendend ElementaryPositivity.RationalFiber
endsectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ κ : M →+ ℤ)local instance biSupportedRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance biSupportedAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance biSupportedAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroup
def BiSupported (f : PowerSeries (Torus v Ω)) : Prop := ∀n m,coeff n f m≠0 → 0≤δ m ∧ 0≤κ m ∧ (n:ℤ)=δ m+κ mlemma BiSupported.zero : BiSupported v Ω δ κ 0 := by intro n m h; simp at hlemma BiSupported.one : BiSupported v Ω δ κ 1 := by intro n m hm have hn : n=0:=by by_contra hn; simp [coeff_one,hn] at hm subst n have hm0 : m=0:=by by_contra hm0 apply hm rw [coeff_one,ite_eq_left rfl] exact Finsupp.single_eq_of_ne hm0 subst m simplemma BiSupported.add {f g : PowerSeries (Torus v Ω)} (hf : BiSupported v Ω δ κ f) (hg : BiSupported v Ω δ κ g) : BiSupported v Ω δ κ (f+g) := by intro n m hm have H : coeff n f m≠0 ∨ coeff n g m≠0:=by by_contra hh push Not at hh simp [hh.1,hh.2] at hm exact H.elim (hf n m) (hg n m)lemma BiSupported.mul {f g : PowerSeries (Torus v Ω)} (hf : BiSupported v Ω δ κ f) (hg : BiSupported v Ω δ κ g) : BiSupported v Ω δ κ (f*g) := by intro j r hr obtain ⟨a,b,m,n,hab,hm,hn,rfl⟩:=series_product_nonzero v Ω f g j r hr obtain ⟨hdm,hkm,hem⟩:=hf a m hm obtain ⟨hdn,hkn,hen⟩:=hg b n hn simp only [map_add] exact ⟨add_nonneg hdm hdn,add_nonneg hkm hkn,by rw [←hab,Nat.cast_add,hem,hen]; ring⟩lemma BiSupported.bi_vanish {f : PowerSeries (Torus v Ω)} (hf : BiSupported v Ω δ κ f) (d e n : ℕ) (hne : n≠d+e) : coeff e (coeff d (biHomogenize v Ω δ κ (coeff n f)))=0 := by ext m rw [biHomogenize_coeff] split_ifs with hh · by_contra hz obtain ⟨hd,hk,he⟩:=hf n m hz have hD : δ m=(d:ℤ):=by rw [hh.1,Int.toNat_of_nonneg hd] have hK : κ m=(e:ℤ):=by rw [hh.2,Int.toNat_of_nonneg hk] apply hne omega · rfllemma BiSupported.bi_product_vanish {f g : PowerSeries (Torus v Ω)} (hf : BiSupported v Ω δ κ f) (hg : BiSupported v Ω δ κ g) (d e a b : ℕ) (ha : d+e<a ∨ d+e<b) : coeff e (coeff d (biHomogenize v Ω δ κ (coeff a f)* biHomogenize v Ω δ κ (coeff b g)))=0 := by rw [coeff_mul,map_sum] apply Finset.sum_eq_zero intro ij hij rw [coeff_mul] apply Finset.sum_eq_zero intro kl hkl have H1:=Finset.HasAntidiagonal.mem_antidiagonal.mp hij have H2:=Finset.HasAntidiagonal.mem_antidiagonal.mp hkl rcases ha with ha|ha · rw [hf.bi_vanish v Ω δ κ ij.1 kl.1 a (by omega),Torus.zero_mul] · rw [hg.bi_vanish v Ω δ κ ij.2 kl.2 b (by omega),Torus.mul_zero]endend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183import Mathlibimport OAI.Combinatorics.Chromatic.QuantumTorus.RationalFiberTorusimport OAI.Combinatorics.Chromatic.Walls.RationalFiberReciprocalimport OAI.Combinatorics.Chromatic.Walls.LaurentRayEmbedding
namespace OAI
sectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus HahnSeriesnoncomputable sectionvariable {K : Type*} [Field K]lemma ratFunc_hom_ext_ring {A : Type*} [Ring A] (f g : RatFunc K →+* A) (hpoly : ∀p : Polynomial K,f (algebraMap (Polynomial K) (RatFunc K) p)= g (algebraMap (Polynomial K) (RatFunc K) p)) : f=g := by apply RingHom.ext intro x induction x using RatFunc.induction_on with | f p q hq=> have hu : IsUnit (f (algebraMap (Polynomial K) (RatFunc K) q)):= (isUnit_iff_ne_zero.mpr (RatFunc.algebraMap_ne_zero hq)).map f apply hu.mul_right_cancel rw [←map_mul,div_mul_cancel₀ _ (RatFunc.algebraMap_ne_zero hq),hpoly p,hpoly q, ←map_mul,div_mul_cancel₀ _ (RatFunc.algebraMap_ne_zero hq)]def innerHom {A : Type*} [Ring A] (u : Aˣ) : A →+* A where toFun a:=(↑u:A)*a*(↑(u⁻¹):A) map_zero':=by simp map_one':=by simp map_add' a b:=by simp [mul_add,add_mul] map_mul' a b:=by simp [mul_assoc]variable {M : Type*} [AddCommGroup M]variable (v : Kˣ) (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0) (p : M)local instance : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance : NonUnitalSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalSemiringlocal instance : NonUnitalNonAssocSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalNonAssocSemiring
def expandScalar : RatFunc K →+* HahnSeries ℤ (Torus v Ω) := (laurentRayHom v Ω p (hΩ p)).comp expandZerolemma expandScalar_C (a : K) : expandScalar v Ω hΩ p (RatFunc.C a)=HahnSeries.single 0 (Torus.monomial v Ω 0 a) := by simp only [expandScalar,RingHom.comp_apply,expandZero_constant] change laurentRay v Ω p (HahnSeries.single 0 a)=_ rw [laurentRay_single,zero_smul]lemma expandScalar_X : expandScalar v Ω hΩ p RatFunc.X=HahnSeries.single 1 (Torus.X v Ω p) := by change laurentRay v Ω p (expandZero RatFunc.X)=_ have H:=expandZero_X_zpow (K:=K) (1:ℤ) simp only [zpow_one] at H rw [H,laurentRay_single,one_smul] rflinclude hΩ inlemma torus_X_unit (m : M) : Torus.X v Ω m*Torus.X v Ω (-m)=1 := by rw [Torus.X_mul_X_of_pairing_zero v Ω m (-m) (by simp [hΩ]),add_neg_cancel,Torus.X_zero]def constUnit (m : M) : (HahnSeries ℤ (Torus v Ω))ˣ where val:=HahnSeries.single 0 (Torus.X v Ω m) inv:=HahnSeries.single 0 (Torus.X v Ω (-m)) val_inv:=by rw [HahnSeries.single_mul_single,zero_add,torus_X_unit v Ω hΩ]; rfl inv_val:=by rw [HahnSeries.single_mul_single,zero_add] have H:=torus_X_unit v Ω hΩ (-m) simpa using congrArg (HahnSeries.single (0:ℤ)) Hinclude hΩ inlemma pairing_swap (a b : M) : Ω a b= -Ω b a := by have H:=hΩ (a+b) simp only [map_add,AddMonoidHom.add_apply,hΩ] at H omegalemma constUnit_conj_C (m : M) (a : K) : innerHom (constUnit v Ω hΩ m) (expandScalar v Ω hΩ p (RatFunc.C a))= expandScalar v Ω hΩ p (RatFunc.C a) := by rw [expandScalar_C] dsimp only [innerHom, constUnit, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk, Units.val_mk, Units.inv_mk] rw [HahnSeries.single_mul_single,HahnSeries.single_mul_single] simp [Torus.X,Torus.monomial_mul_monomial,hΩ]lemma constUnit_conj_X (m : M) : innerHom (constUnit v Ω hΩ m) (expandScalar v Ω hΩ p RatFunc.X)= expandScalar v Ω hΩ p (RatFunc.C (↑(v^(-2*Ω p m)):K)*RatFunc.X) := by rw [map_mul,expandScalar_C,expandScalar_X] dsimp only [innerHom, constUnit, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk, Units.val_mk, Units.inv_mk] simp only [HahnSeries.single_mul_single,zero_add,add_zero,Torus.X,Torus.monomial_mul_monomial, map_add,AddMonoidHom.add_apply,map_neg,hΩ,map_zero,AddMonoidHom.zero_apply, zpow_zero,Units.val_one,mul_one,one_mul,zero_add] have he : m+p+-m=p:=by abel rw [he,←Units.val_mul,←zpow_add,pairing_swap Ω hΩ m p] congr 3 ring_nflemma scalar_commutation (m : M) (a : RatFunc K) : HahnSeries.single 0 (Torus.X v Ω m)*expandScalar v Ω hΩ p a= expandScalar v Ω hΩ p (scale (v^(-2*Ω p m)) a)*HahnSeries.single 0 (Torus.X v Ω m) := by have HE : (innerHom (constUnit v Ω hΩ m)).comp (expandScalar v Ω hΩ p)= (expandScalar v Ω hΩ p).comp (scale (v^(-2*Ω p m))) := by apply ratFunc_hom_ext_ring have HP : ((innerHom (constUnit v Ω hΩ m)).comp (expandScalar v Ω hΩ p)).comp (algebraMap (Polynomial K) (RatFunc K))= ((expandScalar v Ω hΩ p).comp (scale (v^(-2*Ω p m)))).comp (algebraMap (Polynomial K) (RatFunc K)) := by apply Polynomial.ringHom_ext · intro a change innerHom _ (expandScalar v Ω hΩ p (RatFunc.C a))= expandScalar v Ω hΩ p (scale _ (RatFunc.C a)) rw [scale_constant,constUnit_conj_C] · change innerHom _ (expandScalar v Ω hΩ p RatFunc.X)= expandScalar v Ω hΩ p (scale _ RatFunc.X) rw [scale_X,constUnit_conj_X] exact fun q=>congrArg (fun f : Polynomial K →+* HahnSeries ℤ (Torus v Ω)=>f q) HP have H:=congrArg (fun f : RatFunc K →+* HahnSeries ℤ (Torus v Ω)=>f a) HE change ↑(constUnit v Ω hΩ m)*expandScalar v Ω hΩ p a*↑((constUnit v Ω hΩ m)⁻¹)= expandScalar v Ω hΩ p (scale _ a) at H have HH:=congrArg (fun x : HahnSeries ℤ (Torus v Ω)=>x*(↑(constUnit v Ω hΩ m):HahnSeries ℤ (Torus v Ω))) H have hu : (↑((constUnit v Ω hΩ m)⁻¹):HahnSeries ℤ (Torus v Ω))*↑(constUnit v Ω hΩ m)=1 := (constUnit v Ω hΩ m).inv_val rw [mul_assoc, mul_assoc, hu, mul_one] at HH exact HHendend ElementaryPositivity.RationalFiber
endsectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus HahnSeriesnoncomputable sectionvariable {K M : Type*} [Field K] [AddCommGroup M]variable (v : Kˣ) (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (k : M →+ ℤ) (p : M) (hp : k p=1)local instance : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance : NonUnitalSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalSemiringlocal instance : NonUnitalNonAssocSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalNonAssocSemiring
def expandFiberTerm (l : k.ker) : RatFunc K →+ HahnSeries ℤ (Torus v Ω) where toFun a:=expandScalar v Ω hΩ p a*HahnSeries.single 0 (Torus.X v Ω l) map_zero':=by simp map_add' a b:=by simp [add_mul]def expandFiberAdd : FiberTorus v (complementOmega k Ω) (complementAlpha k p Ω) →+ HahnSeries ℤ (Torus v Ω) := Finsupp.liftAddHom (expandFiberTerm v Ω hΩ k p)lemma expandFiberAdd_monomial (l : k.ker) (a : RatFunc K) : expandFiberAdd v Ω hΩ k p (FiberTorus.monomial v _ _ l a)= expandScalar v Ω hΩ p a*HahnSeries.single 0 (Torus.X v Ω l) := Finsupp.liftAddHom_apply_single _ _ _lemma const_torus_product (m n : M) : HahnSeries.single (0:ℤ) (Torus.X v Ω m)*HahnSeries.single 0 (Torus.X v Ω n)= expandScalar v Ω hΩ p (RatFunc.C (↑(v^(Ω m n)):K))* HahnSeries.single 0 (Torus.X v Ω (m+n)) := by rw [expandScalar_C] simp [HahnSeries.single_mul_single,Torus.X,Torus.monomial_mul_monomial]lemma expandFiberAdd_monomial_mul (l j : k.ker) (a b : RatFunc K) : expandFiberAdd v Ω hΩ k p (FiberTorus.monomial v _ _ l a*FiberTorus.monomial v _ _ j b)= expandFiberAdd v Ω hΩ k p (FiberTorus.monomial v _ _ l a)* expandFiberAdd v Ω hΩ k p (FiberTorus.monomial v _ _ j b) := by rw [FiberTorus.monomial_mul,expandFiberAdd_monomial,expandFiberAdd_monomial,expandFiberAdd_monomial] simp only [_root_.map_mul,FiberTorus.twist] change (expandScalar v Ω hΩ p a*expandScalar v Ω hΩ p (scale (v^(-2*Ω p l)) b)* expandScalar v Ω hΩ p (RatFunc.C (↑(v^(Ω l j)):K)))* HahnSeries.single 0 (Torus.X v Ω ((l:M)+(j:M)))=_ simp only [mul_assoc] rw [←const_torus_product] rw [←mul_assoc (expandScalar v Ω hΩ p (scale _ b)),←scalar_commutation] simp only [mul_assoc]
lemma expandFiberAdd_mul (f g : FiberTorus v (complementOmega k Ω) (complementAlpha k p Ω)) : expandFiberAdd v Ω hΩ k p (f*g)=expandFiberAdd v Ω hΩ k p f*expandFiberAdd v Ω hΩ k p g := by classical induction f using Finsupp.induction_linear with | zero=>simp | add f f' hf hf'=>simp only [_root_.add_mul,map_add,hf,hf'] | single l a=> induction g using Finsupp.induction_linear with | zero=>simp | add g g' hg hg'=>simp only [_root_.mul_add,map_add,hg,hg'] | single j b=>exact expandFiberAdd_monomial_mul v Ω hΩ k p l j a blemma expandFiberAdd_one : expandFiberAdd v Ω hΩ k p 1=1 := by change expandFiberAdd v Ω hΩ k p (FiberTorus.monomial v _ _ 0 1)=_ rw [expandFiberAdd_monomial,map_one,one_mul] rfldef expandFiber : FiberTorus v (complementOmega k Ω) (complementAlpha k p Ω) →+* HahnSeries ℤ (Torus v Ω) where __:=expandFiberAdd v Ω hΩ k p map_one':=expandFiberAdd_one v Ω hΩ k p map_mul':=expandFiberAdd_mul v Ω hΩ k pendend ElementaryPositivity.RationalFiber
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140import Mathlib
namespace OAI
sectionnamespace ElementaryPositivity.SymbolCoordinatesopen MvPolynomialvariable {σ A : Type*} [CommRing A] [Algebra ℚ A]
noncomputable def coefficientMap (l : A →ₗ[ℚ] ℚ) : MvPolynomial σ A →ₗ[ℚ] MvPolynomial σ ℚ := (AddMonoidAlgebra.coeffLinearEquiv ℚ).symm.toLinearMap.comp ((Finsupp.mapRange.linearMap l).comp (AddMonoidAlgebra.coeffLinearEquiv ℚ).toLinearMap)
@[simp] lemma coeff_coefficientMap (l : A →ₗ[ℚ] ℚ) (f : MvPolynomial σ A) (m : σ →₀ ℕ) : (coefficientMap l f).coeff m=l (f.coeff m) := rfl
lemma coefficientMap_scalar_mul (l : A →ₗ[ℚ] ℚ) (p : MvPolynomial σ ℚ) (f : MvPolynomial σ A) : coefficientMap l (MvPolynomial.map (algebraMap ℚ A) p * f) = p * coefficientMap l f := by classical ext m simp only [coeff_coefficientMap,coeff_mul,coeff_map,map_sum] apply Finset.sum_congr rfl intro x hx simpa [Algebra.smul_def,smul_eq_mul] using l.map_smul (p.coeff x.1) (f.coeff x.2)
variable {ι : Type*} (b : Module.Basis ι ℚ A)
noncomputable def coordinate (i : ι) : MvPolynomial σ A →ₗ[ℚ] MvPolynomial σ ℚ := coefficientMap ((Finsupp.lapply i).comp b.repr.toLinearMap)
@[simp] lemma coeff_coordinate (i : ι) (f : MvPolynomial σ A) (m : σ →₀ ℕ) : (coordinate b i f).coeff m=b.repr (f.coeff m) i := rfl
lemma coordinate_scalar_mul (i : ι) (p : MvPolynomial σ ℚ) (f : MvPolynomial σ A) : coordinate b i (MvPolynomial.map (algebraMap ℚ A) p * f) = p * coordinate b i f := coefficientMap_scalar_mul _ _ _
lemma coordinates_detect (f : MvPolynomial σ A) (h : ∀ i,coordinate b i f=0) : f=0 := by ext m apply b.repr.injective ext i have hh:=congrArg (fun polynomial : MvPolynomial σ ℚ => polynomial.coeff m) (h i) simpa using hh
noncomputable def coordinateSupport (f : MvPolynomial σ A) : Finset ι := by classical exact f.support.biUnion (fun m=>(b.repr (f.coeff m)).support)
lemma coordinate_support_subset (f : MvPolynomial σ A) (m : σ →₀ ℕ) : (b.repr (f.coeff m)).support ⊆ coordinateSupport b f := by classical intro i hi by_cases hm : m∈f.support · exact Finset.mem_biUnion.mpr ⟨m,hm,hi⟩ · have hzero:=notMem_support_iff.mp hm simp [hzero] at hi
lemma reconstruct (f : MvPolynomial σ A) : (∑ i ∈ coordinateSupport b f,C (b i)*MvPolynomial.map (algebraMap ℚ A) (coordinate b i f))=f := by classical ext m simp only [coeff_sum,coeff_C_mul,coeff_map,coeff_coordinate] calc (∑ i ∈ coordinateSupport b f,b i * algebraMap ℚ A (b.repr (f.coeff m) i)) = ∑ i ∈ (b.repr (f.coeff m)).support,b.repr (f.coeff m) i • b i := by simp only [Algebra.smul_def,mul_comm] exact (Finset.sum_subset (coordinate_support_subset b f m) (by intro i hi hni simp [Finsupp.notMem_support_iff.mp hni])).symm _ = f.coeff m := b.linearCombination_repr _
theorem scalar_mul_eq_zero_iff (p : MvPolynomial σ ℚ) (hp : p≠0) (f : MvPolynomial σ A) : MvPolynomial.map (algebraMap ℚ A) p * f=0 ↔ f=0 := by constructor · intro hf apply coordinates_detect (Module.Free.chooseBasis ℚ A) intro i have h:=congrArg (coordinate (Module.Free.chooseBasis ℚ A) i) hf rw [coordinate_scalar_mul,map_zero] at h exact (mul_eq_zero.mp h).resolve_left hp · rintro rfl exact mul_zero _
theorem scalar_dvd_iff (p : MvPolynomial σ ℚ) (f : MvPolynomial σ A) : MvPolynomial.map (algebraMap ℚ A) p ∣ f ↔ ∀ i,p ∣ coordinate b i f := by classical constructor · rintro ⟨g,rfl⟩ i rw [coordinate_scalar_mul] exact dvd_mul_right p _ · intro h choose g hg using h refine ⟨∑ i ∈ coordinateSupport b f,C (b i)*MvPolynomial.map (algebraMap ℚ A) (g i),?_⟩ calc f = ∑ i ∈ coordinateSupport b f,C (b i)*MvPolynomial.map (algebraMap ℚ A) (coordinate b i f) := (reconstruct b f).symm _ = _ := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i hi rw [hg i,map_mul] ring
end ElementaryPositivity.SymbolCoordinates
namespace ElementaryPositivity.CenterCalculusopen MvPolynomial ElementaryPositivity.SymbolCoordinatesvariable {A σ : Type*} [CommRing A] [Algebra ℚ A]
theorem product_dvd_of_scalar_factors {κ : Type*} (s : Finset κ) (p : κ → MvPolynomial σ ℚ) (q : MvPolynomial σ A) (hrel : (s : Set κ).Pairwise (fun i j => IsRelPrime (p i) (p j))) (h : ∀ i∈s, map (algebraMap ℚ A) (p i) ∣ q) : map (algebraMap ℚ A) (∏ i∈s,p i) ∣ q := by let b := Module.Free.chooseBasis ℚ A apply (scalar_dvd_iff b _ q).mpr intro k apply Finset.prod_dvd_of_isRelPrime hrel intro i hi exact (scalar_dvd_iff b (p i) q).mp (h i hi) k
theorem scalar_mul_eq_zero (p : MvPolynomial σ ℚ) (hp : p≠0) (q : MvPolynomial σ A) (h : map (algebraMap ℚ A) p*q=0) : q=0 := (scalar_mul_eq_zero_iff p hp q).mp h
theorem scalar_mul_injective (p : MvPolynomial σ ℚ) (hp : p≠0) : Function.Injective (fun q : MvPolynomial σ A=>map (algebraMap ℚ A) p*q) := by intro q r h dsimp only at h apply sub_eq_zero.mp apply scalar_mul_eq_zero p hp rw [mul_sub,h,sub_self]
end ElementaryPositivity.CenterCalculus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141import Mathlibimport OAI.Combinatorics.Chromatic.QuantumTorus.RationalTorusFaithfulimport OAI.Combinatorics.Chromatic.GradedAlgebra.RationalCenteredActionimport OAI.Combinatorics.Chromatic.Walls.CenteredUnitRatio
namespace OAI
sectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus WallUnits PowerSeriesnoncomputable sectionvariable {K M : Type*} [Field K] [AddCommGroup M]variable (v : Kˣ)def centeredRatio (t : ℤ) : PowerSeries K := rescale (↑(v^(-t)):K) (rescale (↑(v^(2*t)):K) (elementary (↑(v^(-2:ℤ)):K) (↑(v⁻¹):K))* (elementary (↑(v^(-2:ℤ)):K) (↑(v⁻¹):K))⁻¹)lemma centeredRatio_eq (t : ℤ) : centeredRatio v t= rescale (↑(v^t):K) (elementary (↑(v^(-2:ℤ)):K) (↑(v⁻¹):K)* (shiftedElementary v t)⁻¹) := by have hc := shiftedElementary_constant v t unfold shiftedElementary at hc unfold centeredRatio shiftedElementary rw [map_mul,map_mul,rescale_inv_of_const_one _ _ (constant_elementary _ _), rescale_inv_of_const_one _ _ hc,rescale_rescale,rescale_rescale] congr 1 · rw [←Units.val_mul,←zpow_add] congr 2 ring_nf · rw [←Units.val_mul,←zpow_add] congr 3 ring_nfvariable (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (k : M →+ ℤ) (p : M) (hp : k p=1)include hΩ inlemma read_pure_monomial_shift (hq : ∀n : ℕ,1-(↑(v^(-2:ℤ)):K)^(n+1)≠0) (m : M) (j : ℕ) : readFiber v Ω k p hp (m+j • p) (pureAction v (complementOmega k Ω) (complementAlpha k p Ω) (embed v Ω hΩ k p hp (Torus.X v Ω m)))=coeff j (centeredRatio v (Ω p m)) := by rw [Torus.X,embed_monomial,pureAction_monomial,map_one,one_mul, complement_pairing Ω hΩ k p hp m] change (expandZero ((Finsupp.single (off k p hp m) (centeredScalar v (k m) (Ω p m)*(pureRatio v (Ω p m):RatFunc K))) (off k p hp (m+j • p)))).coeff (k (m+j • p))* (↑(v^(k (m+j • p)*complementAlpha k p Ω (off k p hp (m+j • p)))):K)=_ simp only [map_add,map_nsmul,off_p,smul_zero,add_zero,hp,nsmul_eq_mul,mul_one, Finsupp.single_eq_same,complement_pairing Ω hΩ k p hp m] rw [map_mul,show expandZero (centeredScalar v (k m) (Ω p m))= HahnSeries.single (k m) (↑(v^(-k m*Ω p m)):K) by simpa using expand_centeredScalar v (k m) (Ω p m) (1:K), expandedPure_ratio v hq] rw [add_comm (k m),HahnSeries.coeff_single_mul_add,HahnSeries.ofPowerSeries_apply_coeff, centeredRatio_eq,coeff_rescale] rw [mul_assoc, mul_comm (coeff j _),←mul_assoc,←Units.val_mul,←zpow_add] rw [show -k m*Ω p m+((j:ℤ)+k m)*Ω p m=(Ω p m)*(j:ℤ) by ring, zpow_mul,zpow_natCast,Units.val_pow_eq_pow_val]include hΩ inlemma old_pure_coeff (m : M) (j : ℕ) : coeff j ((rayUnit v Ω p (hΩ p) (elementary (↑(v^(-2:ℤ)):K) (↑(v⁻¹):K)) (constant_elementary _ _)).val*PowerSeries.C (Torus.X v Ω m)* (rayUnit v Ω p (hΩ p) (elementary (↑(v^(-2:ℤ)):K) (↑(v⁻¹):K)) (constant_elementary _ _)).inv)= Torus.monomial v Ω (m+j • p) (coeff j (centeredRatio v (Ω p m))) := by rw [ray_adjoint v Ω hΩ,ray_twisted_coefficient v Ω hΩ] rflinclude hΩ inlemma rational_pure_old_coefficient (hq : ∀n : ℕ,1-(↑(v^(-2:ℤ)):K)^(n+1)≠0) (m : M) (j : ℕ) : readFiber v Ω k p hp (m+j • p) (pureAction v (complementOmega k Ω) (complementAlpha k p Ω) (embed v Ω hΩ k p hp (Torus.X v Ω m)))= (coeff j ((rayUnit v Ω p (hΩ p) (elementary (↑(v^(-2:ℤ)):K) (↑(v⁻¹):K)) (constant_elementary _ _)).val*PowerSeries.C (Torus.X v Ω m)* (rayUnit v Ω p (hΩ p) (elementary (↑(v^(-2:ℤ)):K) (↑(v⁻¹):K)) (constant_elementary _ _)).inv)) (m+j • p) := by rw [read_pure_monomial_shift v Ω hΩ k p hp hq,old_pure_coeff v Ω hΩ] exact (Finsupp.single_eq_same).symmendend ElementaryPositivity.RationalFiber
endsectionnamespace ElementaryPositivity.QuantumTorusnoncomputable sectionvariable {K M : Type*} [Field K] [AddCommGroup M]variable (v : Kˣ) (Ω : M →+ M →+ ℤ)local instance : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGrouplocal instance : NonUnitalSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalSemiringlocal instance : NonUnitalNonAssocSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalNonAssocSemiring
lemma mul_X_coeff (f : Torus v Ω) (r m : M) : (f*Torus.X v Ω m) (r+m)=f r*(↑(v^(Ω r m)):K) := by classical induction f using Finsupp.induction_linear with | zero=>simp | add f g hf hg=>simp only [add_mul,Finsupp.add_apply,hf,hg] | single t a=> change (Torus.monomial v Ω t a*Torus.monomial v Ω m 1) (r+m)=_ rw [Torus.monomial_mul_monomial] by_cases ht : t=r · subst t; simp [Torus.monomial] · simp [Torus.monomial,Ne.symm ht]
lemma X_mul_coeff (f : Torus v Ω) (r m : M) : (Torus.X v Ω m*f) (r+m)=f r*(↑(v^(Ω m r)):K) := by classical induction f using Finsupp.induction_linear with | zero=>simp | add f g hf hg=>simpa only [mul_add,Finsupp.add_apply,hf,hg] using (_root_.add_mul (f r) (g r) _).symm | single t a=> change (Torus.monomial v Ω m 1*Torus.monomial v Ω t a) (r+m)=_ rw [Torus.monomial_mul_monomial] by_cases ht : t=r · subst t; simp [Torus.monomial,add_comm] · have hmt : m+t≠r+m:=by intro hh; apply ht; simpa only [add_comm m t,add_right_cancel_iff] using hh simp [Torus.monomial,Ne.symm ht,Ne.symm hmt]
include v Ω inlemma central_support_zero (hv : Function.Injective (fun z : ℤ=>(↑(v^z):K))) (hΩ : ∀m,Ω m m=0) (hnd : ∀r≠0,∃m,Ω r m≠0) (f : Torus v Ω) (hf : ∀m,f*Torus.X v Ω m=Torus.X v Ω m*f) : ∀r≠0,f r=0 := by intro r hr obtain ⟨m,hm⟩:=hnd r hr have H:=congrArg (fun t : Torus v Ω=>t (r+m)) (hf m) rw [mul_X_coeff,X_mul_coeff] at H by_contra hf have he : Ω r m=Ω m r:=hv (mul_left_cancel₀ hf H) have hs:=alternating_skew Ω hΩ r m omegaendend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566import Mathlibimport OAI.Combinatorics.Chromatic.QuantumTorus.RationalTorusFaithfulimport OAI.Combinatorics.Chromatic.GradedAlgebra.NonpRegradeFaithful
namespace OAI
sectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorus PowerSeriesnoncomputable sectionvariable {K M : Type*} [Field K] [AddCommGroup M]variable (v : Kˣ) (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (k : M →+ ℤ) (p : M) (hp : k p=1)variable (δ : M →+ ℤ) (B : ℕ)def rationalRegrade (f : PowerSeries (Torus v Ω)) : PowerSeries (FiberTorus v (complementOmega k Ω) (complementAlpha k p Ω)) := PowerSeries.map (embed v Ω hΩ k p hp) (regrade v Ω δ B f)def rationalRegradeHom : boundedRegradeSubring v Ω δ B →+* PowerSeries (FiberTorus v (complementOmega k Ω) (complementAlpha k p Ω)) := (PowerSeries.map (embed v Ω hΩ k p hp)).comp (regradeHom v Ω δ B)lemma rationalRegrade_mul {f g : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hg : RegradeBound v Ω δ B g) : rationalRegrade v Ω hΩ k p hp δ B (f*g)= rationalRegrade v Ω hΩ k p hp δ B f*rationalRegrade v Ω hΩ k p hp δ B g := by unfold rationalRegrade rw [regrade_mul v Ω δ B hf hg,_root_.map_mul]lemma rationalRegrade_one : rationalRegrade v Ω hΩ k p hp δ B 1=1 := by unfold rationalRegrade rw [regrade_one,_root_.map_one]lemma rationalRegrade_inverse_mul {f : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hc : constantCoeff f=1) : rationalRegrade v Ω hΩ k p hp δ B (PowerSeries.invOfUnit f 1)* rationalRegrade v Ω hΩ k p hp δ B f=1 := by unfold rationalRegrade rw [←_root_.map_mul,regrade_inverse_mul v Ω δ B hf hc,_root_.map_one]lemma rationalRegrade_mul_inverse {f : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hc : constantCoeff f=1) : rationalRegrade v Ω hΩ k p hp δ B f* rationalRegrade v Ω hΩ k p hp δ B (PowerSeries.invOfUnit f 1)=1 := by unfold rationalRegrade rw [←_root_.map_mul,regrade_mul_inverse v Ω δ B hf hc,_root_.map_one]lemma rationalRegrade_read (τ : M →+ ℤ) {f : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hτ : FullHomogeneous v Ω τ f) (n : ℕ) (m : M) (hm : τ m=(n:ℤ)) : readFiber v Ω k p hp m (coeff (δ m).toNat (rationalRegrade v Ω hΩ k p hp δ B f))=coeff n f m := by rw [rationalRegrade,coeff_map] change readFiber v Ω k p hp m (embedAdd v Ω k p hp _)=_ rw [readFiber_embedAdd,regrade_read v Ω δ B τ hf hτ n m hm]lemma rationalRegrade_injective (τ : M →+ ℤ) {f g : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (hg : RegradeBound v Ω δ B g) (hτf : FullHomogeneous v Ω τ f) (hτg : FullHomogeneous v Ω τ g) (he : rationalRegrade v Ω hΩ k p hp δ B f= rationalRegrade v Ω hΩ k p hp δ B g) : f=g := by apply regrade_injective_homogeneous v Ω δ B τ hf hg hτf hτg apply PowerSeries.ext intro d apply embed_injective v Ω hΩ k p hp have H:=congrArg (coeff d) he simpa only [rationalRegrade,coeff_map] using Hendend ElementaryPositivity.RationalFiber
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162import Mathlibimport OAI.Combinatorics.Chromatic.Walls.RationalPureCocycle
namespace OAI
sectionnamespace ElementaryPositivity.RationalFibernoncomputable sectionvariable {K : Type*} [Field K]def coefficientUnit (v : Kˣ) : (RatFunc K)ˣ := Units.map RatFunc.C.toMonoidHom vdef variableUnit : (RatFunc K)ˣ := Units.mk0 RatFunc.X RatFunc.X_ne_zero@[simp] lemma coefficientUnit_val (v : Kˣ) : (coefficientUnit v:RatFunc K)=RatFunc.C (v:K) := rfl@[simp] lemma variableUnit_val : (variableUnit (K:=K):RatFunc K)=RatFunc.X := rfl@[simp] lemma scaleAction_coefficientUnit (v w : Kˣ) (t : ℤ) : scaleAction v (Multiplicative.ofAdd t) (coefficientUnit w)=coefficientUnit w := by apply Units.ext simp@[simp] lemma scaleAction_variableUnit (v : Kˣ) (t : ℤ) : scaleAction v (Multiplicative.ofAdd t) variableUnit=coefficientUnit v^(-2*t)*variableUnit := by apply Units.ext simp [scale_X,Units.val_zpow_eq_zpow_val,map_zpow₀]
def shearRatio (v : Kˣ) (t : ℤ) : (RatFunc K)ˣ := coefficientUnit v^(t*t)*variableUnit^(-t)@[simp] lemma shearRatio_zero (v : Kˣ) : shearRatio v 0=1 := by simp [shearRatio]lemma shearRatio_add (v : Kˣ) (t u : ℤ) : shearRatio v (t+u)=shearRatio v t*scaleAction v (Multiplicative.ofAdd t) (shearRatio v u) := by simp only [shearRatio,map_mul,map_zpow,scaleAction_coefficientUnit,scaleAction_variableUnit,mul_zpow] rw [←zpow_mul,show (t+u)*(t+u)=t*t+u*u+(-2*t)*(-u) by ring, show -(t+u)= -t+ -u by ring,zpow_add,zpow_add,zpow_add] simp only [mul_assoc, mul_left_comm, mul_comm]@[simp] lemma shearRatio_val (v : Kˣ) (t : ℤ) : (shearRatio v t:RatFunc K)=RatFunc.C (↑(v^(t*t)):K)*RatFunc.X^(-t) := by simp [shearRatio,Units.val_zpow_eq_zpow_val,map_zpow₀]
def reciprocalUnit : (RatFunc K)ˣ ≃* (RatFunc K)ˣ := Units.mapEquiv reciprocalEquiv.toMulEquiv@[simp] lemma reciprocalUnit_val (a : (RatFunc K)ˣ) : (reciprocalUnit a:RatFunc K)=reciprocal (a:RatFunc K) := rfllemma reciprocalUnit_scaleAction (v : Kˣ) (t : ℤ) (a : (RatFunc K)ˣ) : reciprocalUnit (scaleAction v (Multiplicative.ofAdd (-t)) a)= scaleAction v (Multiplicative.ofAdd t) (reciprocalUnit a) := by apply Units.ext simp only [reciprocalUnit_val,scaleAction_val] have H:=congrArg (fun f : RatFunc K →+* RatFunc K=>f (a:RatFunc K)) (reciprocal_scale (v^(-2*(-t)))) dsimp only [RingHom.comp_apply] at H rw [←zpow_neg,show -(-2*(-t))= -2*t by ring] at H exact H
def oppositeInverseRatio (v : Kˣ) (t : ℤ) : (RatFunc K)ˣ := reciprocalUnit (pureRatio v (-t))⁻¹@[simp] lemma oppositeInverseRatio_zero (v : Kˣ) : oppositeInverseRatio v 0=1 := by simp [oppositeInverseRatio]lemma oppositeInverseRatio_add (v : Kˣ) (t u : ℤ) : oppositeInverseRatio v (t+u)= oppositeInverseRatio v t*scaleAction v (Multiplicative.ofAdd t) (oppositeInverseRatio v u) := by simp only [oppositeInverseRatio,neg_add,pureRatio_add,map_mul,reciprocalUnit_scaleAction, mul_inv_rev,map_inv] exact mul_comm _ _endend ElementaryPositivity.RationalFiber
end
end OAI1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.RationalCenteredAction
namespace OAI
sectionnamespace ElementaryPositivity.RationalFiberopen QuantumTorusnoncomputable sectionvariable {K M : Type*} [Field K] [AddCommGroup M]variable (v : Kˣ) (Ω : M →+ M →+ ℤ) (hΩ : ∀m,Ω m m=0)variable (k : M →+ ℤ) (p : M) (hp : k p=1)lemma centeredScalar_shear (n t : ℤ) : centeredScalar v (n-t) t=centeredScalar v n t*(shearRatio v t:RatFunc K) := by rw [shearRatio_val,centeredScalar,centeredScalar] rw [show -(n-t)*t= -n*t+t*t by ring,zpow_add,Units.val_mul,map_mul, sub_eq_add_neg,zpow_add₀ RatFunc.X_ne_zero] ringinclude hΩ inlemma shearAction_embed_monomial (m : M) (a : K) : shearActionHom v (complementOmega k Ω) (complementAlpha k p Ω) (embed v Ω hΩ k p hp (Torus.monomial v Ω m a))= embed v Ω hΩ k p hp (Torus.monomial v Ω (mutationShear Ω p m) a) := by rw [embed_monomial,embed_monomial] change FiberTorus.gauge v _ _ _ _ _ (FiberTorus.monomial v _ _ _ _)=_ rw [FiberTorus.gauge_monomial] have Hoff : off k p hp (mutationShear Ω p m)=off k p hp m := by change off k p hp (m-Ω p m • p)=_ rw [map_sub,map_zsmul,off_p,smul_zero,sub_zero] have Hk : k (mutationShear Ω p m)=k m-Ω p m := by change k (m-Ω p m • p)=_ rw [map_sub,map_zsmul,hp,smul_eq_mul,mul_one] rw [Hoff,Hk,complement_pairing Ω hΩ k p hp m,centeredScalar_shear] rw [mul_assoc]include hΩ inlemma shearAction_embed (f : Torus v Ω) : shearActionHom v (complementOmega k Ω) (complementAlpha k p Ω) (embed v Ω hΩ k p hp f)= embed v Ω hΩ k p hp (Torus.push v Ω Ω (mutationShear Ω p) (mutationShear_pairing Ω hΩ p) f) := by induction f using Finsupp.induction_linear with | zero=>simp | add f g hf hg=>simp only [map_add,hf,hg] | single m a=> change _=embed v Ω hΩ k p hp (Torus.push v Ω Ω _ _ (Torus.monomial v Ω m a)) rw [Torus.push_monomial] exact shearAction_embed_monomial v Ω hΩ k p hp m aendend ElementaryPositivity.RationalFiber
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.MutationCoordinates
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusnoncomputable sectionvariable {M E I : Type*} [AddCommGroup M] [AddCommGroup E] [Module ℝ E] [Fintype I] [DecidableEq I]variable (C : (I → ℤ) →+ M) (e : M →+ E)
lemma coefficient_simple_expansion (a:I → ℤ) : C a=∑i,a i • simpleRoot C i := by have ha : a=∑i,a i • (Pi.single i 1:I → ℤ):=by ext j simp only [Finset.sum_apply,Pi.smul_apply,smul_eq_mul] rw [Finset.sum_eq_single j] · simp · intro i hi hij; simp [Ne.symm hij] · simp conv_lhs=>rw [ha,map_sum] simp only [map_zsmul,simpleRoot]
lemma realRootCoordinates_exists (hC:LinearIndependent ℝ (fun i=>e (simpleRoot C i))) : ∃D:E →ₗ[ℝ] (I → ℝ),∀a,D (e (C a))=fun i=>(a i:ℝ) := by let f:=Finsupp.linearCombination ℝ (fun i=>e (simpleRoot C i)) obtain ⟨g,hg⟩:=f.exists_leftInverse_of_injective (LinearMap.ker_eq_bot.mpr hC) let D:E →ₗ[ℝ] (I → ℝ):=LinearMap.pi (fun i=>(Finsupp.lapply i).comp g) have hd (i:I) : D (e (simpleRoot C i))=Pi.single i 1:=by have H:=LinearMap.congr_fun hg (Finsupp.single i 1) simp only [LinearMap.comp_apply,LinearMap.id_apply,f,Finsupp.linearCombination_single,one_smul] at H funext j change g (e (simpleRoot C i)) j=(Pi.single i 1:I → ℝ) j rw [H] simp [Finsupp.single_apply,Pi.single_apply,eq_comm] refine ⟨D,fun a=>?_⟩ rw [coefficient_simple_expansion C,map_sum,map_sum] simp only [map_zsmul,hd] ext j simp only [Finset.sum_apply,zsmul_eq_mul] rw [Finset.sum_eq_single j] · simp · intro i hi hij; simp [Ne.symm hij] · simp
lemma covector_root_eval (h:Module.Dual ℝ E) (hh:∀i,h (e (simpleRoot C i))=1) {n:ℕ} {m:M} (hm:HasRootDegree C n m) : h (e m)=(n:ℝ) := by obtain ⟨a,ha,rfl⟩:=hm rw [coefficient_simple_expansion C,map_sum,map_sum] simp only [map_zsmul,hh,zsmul_eq_mul,mul_one] exact_mod_cast ha
omit [Fintype I] inlemma real_coordinate_simple (D:E →ₗ[ℝ] (I → ℝ)) (hD:∀a,D (e (C a))=fun i=>(a i:ℝ)) (i:I) : D (e (simpleRoot C i))=Pi.single i 1 := by rw [simpleRoot,hD] ext j simp [Pi.single_apply]endend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.PowerSeriesSplitLeadingimport OAI.Combinatorics.Chromatic.GradedAlgebra.NoncommSeriesCalculusimport OAI.Combinatorics.Chromatic.GradedAlgebra.NonpRegradeFaithfulimport OAI.Combinatorics.Chromatic.GradedAlgebra.QuantumTorusAlgebra
namespace OAI
sectionnamespace ElementaryPositivity.FormalLogopen PowerSeriesnoncomputable sectionvariable {A : Type*} [Ring A] [Algebra ℚ A]def logPolynomial (F : PowerSeries A) (N : ℕ) : PowerSeries A := ∑k∈Finset.range N,((-1:ℚ)^k/(k+1:ℕ)) • (F-1)^(k+1)lemma logPolynomial_coeff (F : PowerSeries A) (hf : constantCoeff F=1) (N n : ℕ) (hn : n≤N) : coeff n (logPolynomial F N)=coeff n (FormalLog.log F) := by simp only [logPolynomial,FormalLog.log,coeff_mk,map_sum,coeff_smul] symm apply Finset.sum_subset (Finset.range_mono hn) intro k hk hkn rw [coeff_power_vanish (F-1) (by simp [hf]) (k+1) n (by simp only [Finset.mem_range,not_lt] at hkn; omega),smul_zero]endend ElementaryPositivity.FormalLognamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M : Type*} [CommRing R] [Algebra ℚ R] [AddCommGroup M]variable (v : Rˣ) (Ω : M →+ M →+ ℤ) (δ : M →+ ℤ) (B : ℕ)local instance regradeLogRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance regradeLogNonUnitalSemiring : NonUnitalSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalSemiringlocal instance regradeLogNonUnitalNonAssocSemiring : NonUnitalNonAssocSemiring (Torus v Ω) := (Torus.instRing v Ω).toNonUnitalNonAssocSemiringlocal instance regradeLogAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance regradeLogAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGrouplocal instance regradeLogAddCommGroup : AddCommGroup (Torus v Ω) := (Torus.instRing v Ω).toAddCommGrouplocal instance regradeLogSub : Sub (Torus v Ω) := (Torus.instRing v Ω).toSublemma homogenize_smul (q : ℚ) (f : Torus v Ω) : homogenize v Ω δ (q • f)=q • homogenize v Ω δ f := by ext n m simp only [homogenize_coeff,coeff_smul,Finsupp.smul_apply] split_ifs <;> simp
def regradeLinear : PowerSeries (Torus v Ω) →ₗ[ℚ] PowerSeries (Torus v Ω) where toFun:=regrade v Ω δ B map_add' f g:=by apply PowerSeries.ext intro n ext m simp only [regrade_coeff,nonp_torus_eval_sum,homogenize_coeff,_root_.map_add,Finsupp.add_apply] rw [←Finset.sum_add_distrib] apply Finset.sum_congr rfl intro j hj split_ifs <;> simp map_smul' q f:=by apply PowerSeries.ext intro n simp only [regrade_coeff,coeff_smul,homogenize_smul,Finset.smul_sum,RingHom.id_apply]
omit [Algebra ℚ R] inlemma RegradeBound.pow {f : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B f) (k : ℕ) : RegradeBound v Ω δ B (f^k) := by induction k with | zero=>simpa using RegradeBound.one v Ω δ B | succ k ih=>exact ih.mul v Ω δ B hf
omit [Algebra ℚ R] inlemma regrade_pow {F : PowerSeries (Torus v Ω)} (hf : RegradeBound v Ω δ B F) (k : ℕ) : regrade v Ω δ B (F^k)=(regrade v Ω δ B F)^k := by induction k with | zero=>simpa using regrade_one v Ω δ B | succ k ih=>rw [pow_succ,regrade_mul v Ω δ B (hf.pow v Ω δ B k) hf,ih,pow_succ]lemma regrade_logPolynomial (F : PowerSeries (Torus v Ω)) (hf : RegradeBound v Ω δ B F) (N : ℕ) : regrade v Ω δ B (FormalLog.logPolynomial F N)= FormalLog.logPolynomial (regrade v Ω δ B F) N := by change regradeLinear v Ω δ B (FormalLog.logPolynomial F N)=_ rw [FormalLog.logPolynomial,map_sum] apply Finset.sum_congr rfl intro k hk rw [map_smul] congr 1 change regrade v Ω δ B ((F-1)^(k+1))=_ rw [regrade_pow v Ω δ B (by intro j m hm by_cases hF : coeff j F m=0 · apply RegradeBound.one v Ω δ B j m intro h1 apply hm rw [map_sub,sub_eq_add_neg] change coeff j F m+ -(coeff j (1 : PowerSeries (Torus v Ω)) m)=0 rw [hF,h1,neg_zero,add_zero] · exact hf j m hF)] congr 1 change regradeLinear v Ω δ B (F-1)=_ rw [map_sub] change regrade v Ω δ B F-regrade v Ω δ B 1=_ rw [regrade_one]omit [Algebra ℚ R] inlemma regrade_constant (F : PowerSeries (Torus v Ω)) (hf : constantCoeff F=1) : constantCoeff (regrade v Ω δ B F)=1 := by rw [←coeff_zero_eq_constantCoeff_apply,regrade_coeff] simp only [mul_zero,zero_add,Finset.sum_range_one,coeff_zero_eq_constantCoeff,hf, homogenize_one,constantCoeff_one]omit [Algebra ℚ R] inlemma regrade_coeff_congr (F G : PowerSeries (Torus v Ω)) (d : ℕ) (H : ∀n≤B*d,coeff n F=coeff n G) : coeff d (regrade v Ω δ B F)=coeff d (regrade v Ω δ B G) := by rw [regrade_coeff,regrade_coeff] apply Finset.sum_congr rfl intro n hn rw [H n (by simpa only [Finset.mem_range,Nat.lt_succ_iff] using hn)]lemma regrade_log (F : PowerSeries (Torus v Ω)) (hf : RegradeBound v Ω δ B F) (hc : constantCoeff F=1) : regrade v Ω δ B (FormalLog.log F)=FormalLog.log (regrade v Ω δ B F) := by apply PowerSeries.ext intro d let N:=max d (B*d) calc coeff d (regrade v Ω δ B (FormalLog.log F))= coeff d (regrade v Ω δ B (FormalLog.logPolynomial F N)) := by apply regrade_coeff_congr intro n hn exact (FormalLog.logPolynomial_coeff F hc N n (hn.trans (le_max_right _ _))).symm _ = coeff d (FormalLog.logPolynomial (regrade v Ω δ B F) N) := by rw [regrade_logPolynomial v Ω δ B F hf N] _ = coeff d (FormalLog.log (regrade v Ω δ B F)) := FormalLog.logPolynomial_coeff _ (regrade_constant v Ω δ B F hc) N d (le_max_left _ _)endend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.RootSectionHalfspace
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeries PowerSeriesAdjoint WallUnitsopen scoped BigOperatorsopen Classicalnoncomputable sectionvariable {M I:Type*} [AddCommGroup M] [Fintype I] [DecidableEq I]variable (Ω:M →+ M →+ ℤ) (hΩ:∀m,Ω m m=0)variable (C:(I → ℤ) →+ M) (coord:M →+ (I → ℤ)) (hcoord:∀d,coord (C d)=d)local instance rootCoefficientLocalityRing : Ring (Torus LaurentRay.vUnit Ω) := Torus.instRing LaurentRay.vUnit Ωlocal instance rootCoefficientLocalityAddCommMonoid : AddCommMonoid (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddCommMonoidlocal instance rootCoefficientLocalityAddGroup : AddGroup (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddGroup
include hcoord inlemma root_interval_orthogonal (base m b r s:M) (d:I → ℕ) (hm:m=base+C (fun i=>(d i:ℤ))) (hb:∃k,HasRootDegree C k (b-base)) (hr:∃k,HasRootDegree C k r) (hs:∃k,HasRootDegree C k s) (he:r+(s+b)=m) (ho:∀i,0<d i → Ω (simpleRoot C i) m=0) : Ω r m=0 := by obtain ⟨kb,hb⟩:=hb obtain ⟨kr,hr⟩:=hr obtain ⟨ks,hs⟩:=hs obtain ⟨ab,_,hcb,_⟩:=root_coordinates C coord hcoord hb obtain ⟨ar,_,hcr,_⟩:=root_coordinates C coord hcoord hr obtain ⟨as',_,hcs,_⟩:=root_coordinates C coord hcoord hs have hc:coord r+(coord s+coord (b-base))=(fun i=>(d i:ℤ)) := by rw [←map_add,←map_add] have he':r+(s+(b-base))=C (fun i=>(d i:ℤ)):=by rw [←add_sub_assoc,←add_sub_assoc,he,hm]; abel rw [he',hcoord] have hid:∀i,(ar i:ℤ)+(as' i:ℤ)+(ab i:ℤ)=(d i:ℤ):=by intro i have H:=congrFun hc i simp only [Pi.add_apply] at H rw [hcb,hcr,hcs] at H omega rw [root_simple_expansion C coord hcoord hr,map_sum] simp only [AddMonoidHom.finsetSum_apply,map_zsmul,AddMonoidHom.zsmul_apply,smul_eq_mul] apply Finset.sum_eq_zero intro i _ by_cases hi:0<d i · rw [ho i hi,mul_zero] · have hai:ar i=0:=by have H:=hid i; omega rw [hcr,hai,Int.natCast_zero,zero_mul]
include hΩ hcoord inlemma actualMonomialAdjoint_locality (f:CompletedPositive LaurentRay.vUnit Ω C) (base m b:M) (d:I → ℕ) (hm:m=base+C (fun i=>(d i:ℤ))) (hb:∃k,HasRootDegree C k (b-base)) (ho:∀i,0<d i → Ω (simpleRoot C i) m=0) : actualMonomialAdjointCoefficient Ω (rootOrder coord) f.val b m= actualMonomialAdjointCoefficient Ω (rootOrder coord) 1 b m := by have H:∀N,coeff N (adjoint f.val (PowerSeries.C (Torus.X LaurentRay.vUnit Ω b))) m= coeff N (PowerSeries.C (Torus.X LaurentRay.vUnit Ω b)) m := by intro N apply adjoint_target_cyclic LaurentRay.vUnit Ω hΩ f.val b m N f.property.1 intro i j hij r hr s hs he apply root_interval_orthogonal Ω C coord hcoord base m b r s d hm hb ⟨i,chart_root_of_ne LaurentRay.vUnit Ω C f i r (Finsupp.mem_support_iff.mp hr)⟩ ⟨j,?_⟩ he ho by_contra hh exact (Finsupp.mem_support_iff.mp hs) (SeriesGraded.inverse LaurentRay.vUnit Ω C f.property.2 j s hh) unfold actualMonomialAdjointCoefficient actualRootCoefficient split_ifs · have H1:=adjoint_monomial_coeff LaurentRay.vUnit Ω hΩ f.val b (m-b) ((rootOrder coord (m-b)).toNat) have H2:=adjoint_monomial_coeff LaurentRay.vUnit Ω hΩ 1 b (m-b) ((rootOrder coord (m-b)).toNat) rw [sub_add_cancel] at H1 H2 rw [←H1,←H2,H] have hI:invOfUnit (1:PowerSeries (Torus LaurentRay.vUnit Ω)) 1=1 := by simpa only [mul_one] using (invOfUnit_mul (1:PowerSeries (Torus LaurentRay.vUnit Ω)) 1 (by simp)) simp only [adjoint,hI,one_mul,mul_one] · rfl
include hΩ hcoord inlemma actualPolynomialAdjoint_locality (f:CompletedPositive LaurentRay.vUnit Ω C) (base m:M) (d:I → ℕ) (hm:m=base+C (fun i=>(d i:ℤ))) (F:Torus LaurentRay.vUnit Ω) (hF:∀b∈F.support,∃k,HasRootDegree C k (b-base)) (ho:∀i,0<d i → Ω (simpleRoot C i) m=0) : actualPolynomialAdjointCoefficient Ω (rootOrder coord) f.val F m=F m := by rw [←actualPolynomialAdjointCoefficient_one Ω hΩ (rootOrder coord) F m] unfold actualPolynomialAdjointCoefficient Finsupp.sum apply Finset.sum_congr rfl intro b hb change F b*actualMonomialAdjointCoefficient Ω (rootOrder coord) f.val b m= F b*actualMonomialAdjointCoefficient Ω (rootOrder coord) 1 b m exact congrArg (fun x=>F b*x) (actualMonomialAdjoint_locality Ω hΩ C coord hcoord f base m b d hm (hF b hb) ho)endend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.NonpRegradeFaithful
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeriesnoncomputable sectionvariable {R M:Type*} [CommRing R] [AddCommGroup M]variable (v:Rˣ) (Ω:M →+ M →+ ℤ)local instance rootCoefficientsRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance rootCoefficientsAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance rootCoefficientsAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroup
def actualRootCoefficient (τ:M →+ ℤ) (f:PowerSeries (Torus v Ω)) (m:M) : R := if 0≤τ m then coeff (τ m).toNat f m else 0
lemma actualRootCoefficient_read (τ:M →+ ℤ) (f:PowerSeries (Torus v Ω)) (n:ℕ) (m:M) (hm:τ m=(n:ℤ)) : actualRootCoefficient v Ω τ f m=coeff n f m := by simp only [actualRootCoefficient,hm,Int.natCast_nonneg,ite_true,Int.toNat_natCast]
lemma regrade_actualRootCoefficient (τ δ:M →+ ℤ) (B:ℕ) (f:PowerSeries (Torus v Ω)) (hf:RegradeBound v Ω δ B f) (hτ:FullHomogeneous v Ω τ f) (m:M) : actualRootCoefficient v Ω δ (regrade v Ω δ B f) m=actualRootCoefficient v Ω τ f m := by classical by_cases ht:0≤τ m · by_cases hd:0≤δ m · simp only [actualRootCoefficient,ite_eq_left ht,ite_eq_left hd] exact regrade_read v Ω δ B τ hf hτ _ m (Int.toNat_of_nonneg ht).symm · have hz:coeff (τ m).toNat f m=0:=by by_contra hh exact hd (hf _ m hh).1 simp only [actualRootCoefficient,ite_eq_left ht,ite_eq_right hd,hz] · have hz:∀n,coeff n f m=0:=by intro n by_contra hh have H:=hτ n m hh exact ht (H ▸ Int.natCast_nonneg n) simp only [actualRootCoefficient,ite_eq_right ht,regrade_coeff_eval] split_ifs <;> simp only [hz,Finset.sum_const_zero]endend ElementaryPositivity.QuantumTorus
end
end OAI12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576import Mathlibimport OAI.Combinatorics.Chromatic.Walls.TriangularLevelQueues
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen Classicalnoncomputable sectionvariable {M I : Type*} [AddCommGroup M] [Fintype I] [DecidableEq I]variable (Ω : M →+ M →+ ℤ) (C : (I → ℤ) →+ M) (coord : M →+ (I → ℤ))variable (hcoord : ∀d,coord (C d)=d) (pc : I)
omit [Fintype I] ininclude hcoord inlemma simpleRoot_injective : Function.Injective (simpleRoot C) := by intro i j h have H:=congrArg coord h change coord (C (Pi.single i 1))=coord (C (Pi.single j 1)) at H rw [hcoord,hcoord] at H by_contra hn have HH:=congrFun H i simp [hn] at HH
def rootMutation (p r : M) : M := if r=p then -p else ForwardChain.positiveMutate Ω p r
include hcoord inlemma mutatedRoot_inventory (i : I) : simpleRoot (mutatedRoots Ω C pc) i=rootMutation Ω (simpleRoot C pc) (simpleRoot C i) := by by_cases hi : i=pc · subst i rw [mutatedRoot_p] simp [rootMutation] · have hn : simpleRoot C i≠simpleRoot C pc := fun hh=>hi (simpleRoot_injective C coord hcoord hh) rw [mutatedRoot_off Ω C pc i hi] simp only [rootMutation,hn,ite_false,ForwardChain.positiveMutate,mutationPairing,max_comm]
include hcoord inlemma mutatedRoot_list (is : List I) : is.map (simpleRoot (mutatedRoots Ω C pc))= (is.map (simpleRoot C)).map (rootMutation Ω (simpleRoot C pc)) := by rw [List.map_map] exact List.map_congr_left fun i _=>mutatedRoot_inventory Ω C coord hcoord pc i
lemma rootMutation_map_off (p : M) (l : List M) (hp : p∉l) : l.map (rootMutation Ω p)=l.map (ForwardChain.positiveMutate Ω p) := by apply List.map_congr_left intro r hr have hn:r≠p:=by intro h; subst r; exact hp hr simp [rootMutation,hn]
lemma rootMutation_rotation_perm (p a b c : M) (bs : List M) (hp : p=b-a) (ha : Ω p a=1) (hb : Ω p b=1) (hc : Ω p c= -1) (hs : ∀x∈bs,Ω p x=0) (hnd : (ForwardChain.gaps a (b::bs) c).Nodup) : ((ForwardChain.gaps a (b::bs) c).map (rootMutation Ω p)).Perm (ForwardChain.gaps a (bs++[c+p]) c) := by change ((b-a)::ForwardChain.gaps b bs c).Nodup at hnd have hnot : p∉ForwardChain.gaps b bs c := by rw [hp]; exact (List.nodup_cons.mp hnd).1 simp only [ForwardChain.gaps,List.map_cons,←hp,rootMutation] rw [rootMutation_map_off Ω p _ hnot] exact ForwardChain.gaps_rotation_perm Ω p a b c bs hp ha hb hc hs
lemma rootMutation_gaps_fixed (p a c : M) (bs : List M) (ha : Ω p a≤0) (hc : 0≤Ω p c) (hb : ∀b∈bs,Ω p b=0) (hp : p∉ForwardChain.gaps a bs c) : (ForwardChain.gaps a bs c).map (rootMutation Ω p)=ForwardChain.gaps a bs c := by rw [rootMutation_map_off Ω p _ hp] exact ForwardChain.gaps_mutate_fixed Ω p a c bs ha hc hbendend ElementaryPositivity.QuantumTorus
end
end OAI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148import Mathlibimport OAI.Combinatorics.Chromatic.GradedAlgebra.HalfspacePolynomialCoefficients
namespace OAI
sectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeries PowerSeriesAdjoint WallUnitsopen Classicalnoncomputable sectionvariable {M I:Type*} [AddCommGroup M] [Fintype I] [DecidableEq I]variable (Ω:M →+ M →+ ℤ) (C:(I → ℤ) →+ M)local instance rootSectionHalfspaceRing : Ring (Torus LaurentRay.vUnit Ω) := Torus.instRing LaurentRay.vUnit Ωlocal instance rootSectionHalfspaceAddCommMonoid : AddCommMonoid (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddCommMonoidlocal instance rootSectionHalfspaceAddGroup : AddGroup (Torus LaurentRay.vUnit Ω) := (Torus.instRing LaurentRay.vUnit Ω).toAddGroup
lemma rootSectionChart_outer (h:M →+ ℝ) : (rootSectionChart Ω C h).val=invOfUnit ((chartPositive LaurentRay.vUnit Ω C h (simpleTotalTransport Ω C)).val* (chartZero LaurentRay.vUnit Ω C h (simpleTotalTransport Ω C)).val) 1 := by unfold rootSectionChart dsimp only conv_lhs => arg 2; arg 1; rw [←chart_three_factorization LaurentRay.vUnit Ω C h (simpleTotalTransport Ω C)] rw [inverse_mul _ _ (by simp only [map_mul, (chartPositive LaurentRay.vUnit Ω C h (simpleTotalTransport Ω C)).property.1, (chartZero LaurentRay.vUnit Ω C h (simpleTotalTransport Ω C)).property.1,mul_one]) (chartNegative LaurentRay.vUnit Ω C h (simpleTotalTransport Ω C)).property.1, ←mul_assoc,mul_invOfUnit _ 1 (chartNegative LaurentRay.vUnit Ω C h (simpleTotalTransport Ω C)).property.1,one_mul]
omit [DecidableEq I] inlemma chartPositive_nonnegative [DecidableEq I] (h:M →+ ℝ) (F:CompletedPositive LaurentRay.vUnit Ω C) (k:ℕ) (m:M) (hm:coeff k (chartPositive LaurentRay.vUnit Ω C h F).val m≠0) : 0 ≤ h m := by cases k with | zero=> rw [coeff_zero_eq_constantCoeff,(chartPositive LaurentRay.vUnit Ω C h F).property.1] at hm have he:m=0:=by by_contra hn exact hm (Finsupp.single_eq_of_ne hn) rw [he,map_zero] | succ k=> exact (chart_three_support LaurentRay.vUnit Ω C h F).1 k m hm |>.le
omit [DecidableEq I] inlemma chartZero_nonnegative [DecidableEq I] (h:M →+ ℝ) (F:CompletedPositive LaurentRay.vUnit Ω C) (k:ℕ) (m:M) (hm:coeff k (chartZero LaurentRay.vUnit Ω C h F).val m≠0) : 0 ≤ h m := by cases k with | zero=> rw [coeff_zero_eq_constantCoeff,(chartZero LaurentRay.vUnit Ω C h F).property.1] at hm have he:m=0:=by by_contra hn exact hm (Finsupp.single_eq_of_ne hn) rw [he,map_zero] | succ k=> rw [(chart_three_support LaurentRay.vUnit Ω C h F).2.1 k m hm]
lemma rootSectionChart_nonnegative (h:M →+ ℝ) (k:ℕ) (m:M) (hm:coeff k (rootSectionChart Ω C h).val m≠0) : 0 ≤ h m := by rw [rootSectionChart_outer] at hm let P:=nonpositiveCone (-h) have hs:∀d x,coeff d ((chartPositive LaurentRay.vUnit Ω C h (simpleTotalTransport Ω C)).val* (chartZero LaurentRay.vUnit Ω C h (simpleTotalTransport Ω C)).val) x≠0 → x∈P:=by intro d x hx obtain ⟨i,j,a,b,hij,ha,hb,he⟩:=series_product_nonzero LaurentRay.vUnit Ω _ _ d x hx change (-h) x ≤ 0 rw [←he,map_add,AddMonoidHom.neg_apply,AddMonoidHom.neg_apply] linarith [chartPositive_nonnegative Ω C h (simpleTotalTransport Ω C) i a ha, chartZero_nonnegative Ω C h (simpleTotalTransport Ω C) j b hb] have H:=inverse_support_addSubmonoid LaurentRay.vUnit Ω P _ hs k m hm change -h m ≤ 0 at H linarithendend ElementaryPositivity.QuantumTorus
endsectionnamespace ElementaryPositivity.QuantumTorusopen PowerSeries PowerSeriesAdjointopen scoped BigOperatorsopen Classicalnoncomputable sectionvariable {K M:Type*} [Field K] [AddCommGroup M]variable (v:Kˣ) (Ω:M →+ M →+ ℤ) (hΩ:∀m,Ω m m=0)local instance targetCyclicRing : Ring (Torus v Ω) := Torus.instRing v Ωlocal instance targetCyclicAddCommMonoid : AddCommMonoid (Torus v Ω) := (Torus.instRing v Ω).toAddCommMonoidlocal instance targetCyclicAddGroup : AddGroup (Torus v Ω) := (Torus.instRing v Ω).toAddGroup
lemma torus_eval_finset_sum {J:Type*} (s:Finset J) (f:J → Torus v Ω) (m:M) : (∑j∈s,f j) m=∑j∈s,f j m := by induction s using Finset.induction_on with | empty=>rfl | @insert j s hj ih=> rw [Finset.sum_insert hj,Finset.sum_insert hj] change f j m+(∑j∈s,f j) m=_ rw [ih]include hΩ
lemma torus_target_cyclic (F G:Torus v Ω) (m:M) (h:∀r∈F.support,∀s∈G.support,r+s=m → Ω r m=0) : (F*G) m=(G*F) m := by change (Torus.multiply v Ω F G) m=(Torus.multiply v Ω G F) m simp only [Torus.multiply,Finsupp.sum,Finsupp.finsetSum_apply] conv_rhs => rw [Finset.sum_comm] apply Finset.sum_congr rfl intro r hr apply Finset.sum_congr rfl intro s hs by_cases he:r+s=m · have hrs:Ω r s=0 := by have H:=h r hr s hs he rw [←he,map_add,hΩ r,zero_add] at H exact H have hsr:Ω s r=0 := by rw [alternating_skew Ω hΩ,hrs,neg_zero] simp only [←he,Finsupp.single_eq_same,add_comm s r,hrs,hsr,zpow_zero, Units.val_one,mul_comm] · have he':s+r≠m:=by simpa only [add_comm s r] using he rw [Finsupp.single_eq_of_ne (Ne.symm he),Finsupp.single_eq_of_ne (Ne.symm he')]
lemma series_target_cyclic (F G:PowerSeries (Torus v Ω)) (N:ℕ) (m:M) (h:∀i j,i+j=N → ∀r∈(coeff i F).support,∀s∈(coeff j G).support,r+s=m → Ω r m=0) : coeff N (F*G) m=coeff N (G*F) m := by simp only [coeff_mul,torus_eval_finset_sum] rw [←Finset.Nat.sum_antidiagonal_swap (f:=fun p:ℕ×ℕ=>(coeff p.1 G*coeff p.2 F) m)] apply Finset.sum_congr rfl intro p hp exact torus_target_cyclic v Ω hΩ _ _ m (h p.1 p.2 (Finset.HasAntidiagonal.mem_antidiagonal.mp hp))
lemma adjoint_target_cyclic (F:PowerSeries (Torus v Ω)) (b m:M) (N:ℕ) (hF:constantCoeff F=1) (h:∀i j,i+j=N → ∀r∈(coeff i F).support, ∀s∈(coeff j (invOfUnit F 1)).support,r+(s+b)=m → Ω r m=0) : coeff N (adjoint F (PowerSeries.C (Torus.X v Ω b))) m= coeff N (PowerSeries.C (Torus.X v Ω b)) m := by rw [adjoint,mul_assoc] rw [series_target_cyclic v Ω hΩ F (PowerSeries.C (Torus.X v Ω b)*invOfUnit F 1) N m] · rw [mul_assoc,invOfUnit_mul F 1 hF,mul_one] · intro i j hij r hr s hs he have hs':coeff j (invOfUnit F 1) (s-b)≠0 := by have H:=Finsupp.mem_support_iff.mp hs rw [coeff_C_mul] at H have Hread:=X_mul_coeff v Ω (coeff j (invOfUnit F 1)) (s-b) b rw [sub_add_cancel] at Hread rw [Hread] at H exact (mul_ne_zero_iff.mp H).1 exact h i j hij r hr (s-b) (Finsupp.mem_support_iff.mpr hs') (by simpa only [sub_add_cancel] using he)endend ElementaryPositivity.QuantumTorus
end
end OAIlean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentMapNaturality.leanAdded+25
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentProductNaturality.leanAdded+16
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentPureAction.leanAdded+177
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentRectangularKernel.leanAdded+144
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentRegrade.leanAdded+291
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentRegradeFinite.leanAdded+79
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentRegradePure.leanAdded+62
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentScalarNaturality.leanAdded+26
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentSigns.leanAdded+23
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/LaurentUnitSigns.leanAdded+24
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutatedEndpoint.leanAdded+85
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutatedNoCutCone.leanAdded+126
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutatedPureFace.leanAdded+107
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutationCoordinates.leanAdded+89
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutationDegreeBound.leanAdded+89
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutationLaurentTransport.leanAdded+100
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutationOrientedCompatibility.leanAdded+108
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/MutationRootMap.leanAdded+175
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NilpotentLogarithm.leanAdded+245
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NilpotentSeriesInverse.leanAdded+37
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NoncommExpand.leanAdded+108
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NoncommSeriesCalculus.leanAdded+148
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NonpHomogenize.leanAdded+182
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NonpRegrade.leanAdded+189
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/NonpRegradeFaithful.leanAdded+164
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PowerSeriesProductLeading.leanAdded+70
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PowerSeriesSplit.leanAdded+168
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PowerSeriesSplitLeading.leanAdded+164
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/Product.leanAdded+146
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/ProjectionRecursion.leanAdded+41
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PureCoefficient.leanAdded+59
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PureComparisonIdentification.leanAdded+212
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PureFaceLog.leanAdded+114
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/PurePolynomialCoefficients.leanAdded+85
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/QuantumTorusAlgebra.leanAdded+51
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/QuantumTorusSignFactors.leanAdded+101
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalCenteredAction.leanAdded+91
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalLaurentFaithful.leanAdded+164
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalLaurentScalars.leanAdded+183
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalPolynomialDivisibility.leanAdded+140
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalPureCoefficients.leanAdded+141
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalRegrade.leanAdded+66
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalShearCocycle.leanAdded+62
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RationalShearEmbedding.leanAdded+53
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RealRootCoordinates.leanAdded+64
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RegradeLog.leanAdded+133
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RootCoefficientLocality.leanAdded+102
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RootCoefficients.leanAdded+48
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RootMutationInventory.leanAdded+76
lean/OAI/Combinatorics/Chromatic/GradedAlgebra/RootSectionHalfspace.leanAdded+148