import Mathlib import OAI.Algebra.FiniteTensor.ClosedSpecialization import OAI.Algebra.FiniteTensor.CoefficientDescent import OAI.Algebra.FiniteTensor.KernelRelations namespace OAI /-! Finite-type algebraic coefficient descent and the algebraic tensor contradiction. -/ noncomputable section open scoped BigOperators namespace PD4Tensor.Spreading open scoped BigOperators variable {K σ : Type*} [Field K] [Finite σ] def truncSeries (n : ℕ) (f : MvPowerSeries σ K) : MvPowerSeries σ K := (MvPowerSeries.truncTotal n f : MvPolynomial σ K) theorem coeff_truncSeries (n : ℕ) (f : MvPowerSeries σ K) (d : σ →₀ ℕ) : MvPowerSeries.coeff d (truncSeries n f)= if d.degree simp_all theorem homogeneous_root_equation (P : Polynomial (MvPowerSeries σ K)) (f : MvPowerSeries σ K) (hf : P.eval f=0) (r n : ℕ) (hrn : r (seriesOver A).mul_mem (hP i) ((seriesOver A).pow_mem hf i)) theorem homogeneous_mem_seriesOver (A : Subring K) (f : MvPowerSeries σ K) (hf : f∈seriesOver A) (n : ℕ) : MvPowerSeries.homogeneousComponent n f∈seriesOver A := by rw [mem_seriesOver] at hf ⊢ intro d rw [MvPowerSeries.coeff_homogeneousComponent] split_ifs · exact hf d · exact A.zero_mem variable [Finite σ] [LinearOrder σ] [WellFoundedGT σ] theorem coefficients_root_mem (A : Subring K) (P : Polynomial (MvPowerSeries σ K)) (f : MvPowerSeries σ K) (hf : P.eval f=0) (r : ℕ) (hDr : (r : ℕ∞)≤(P.derivative.eval f).order) (a : σ →₀ ℕ) (ha : MvPowerSeries.coeff a (MvPowerSeries.homogeneousComponent r (P.derivative.eval f))≠0) (hmin : ∀ u,toLex u intro b hb by_cases hn : n≤r · exact hlow b (hb ▸ hn) have hrn : r (P.coeff i).coeffs) let sl : Finset K := (finite_of_degree_le r).toFinset.image (fun d => MvPowerSeries.coeff d f) let sd : Finset K := (finite_of_degree_le r).toFinset.image (fun d => MvPowerSeries.coeff d H) let s : Finset K := sp ∪ sl ∪ sd ∪ {(MvPowerSeries.coeff (ofLex a) H)⁻¹} let A := Algebra.adjoin ℤ (s : Set K) have hgen {x : K} (hx : x∈s) : x∈A.toSubring := Algebra.subset_adjoin hx refine ⟨A,Algebra.FiniteType.adjoin_of_finite s.finite_toSet,?_⟩ have hout : f∈seriesOver A.toSubring := by apply coefficients_root_mem A.toSubring Q f hQf r (le_of_eq hr) (ofLex a) ha · intro u hu by_contra h exact hminimal (toLex u) h (by simpa only [toLex_ofLex] using hu) · intro i rw [mem_seriesOver] intro d simp only [Q,Polynomial.coeff_map,MvPowerSeries.algebraMap_apply', Algebra.algebraMap_self,MvPowerSeries.map_id,RingHom.id_apply,MvPolynomial.coeff_coe] by_cases hc : (P.coeff i).coeff d=0 · rw [hc] exact A.zero_mem · apply hgen have hp : P.coeff i≠0 := by intro h; exact hc (by simp [h]) have hh : (P.coeff i).coeff d∈sp := Finset.mem_biUnion.mpr ⟨i,Polynomial.mem_support_iff.mpr hp, MvPolynomial.coeff_mem_coeffs d hc⟩ exact Finset.mem_union_left _ (Finset.mem_union_left _ (Finset.mem_union_left _ hh)) · rw [mem_seriesOver] intro d change MvPowerSeries.coeff d H∈A.toSubring by_cases hd : d.degree=r · apply hgen have hh : MvPowerSeries.coeff d H∈sd := Finset.mem_image.mpr ⟨d,(finite_of_degree_le r).mem_toFinset.mpr (le_of_eq hd),rfl⟩ exact Finset.mem_union_left _ (Finset.mem_union_right _ hh) · have hh : MvPowerSeries.coeff d H=0 := by simp only [H,MvPowerSeries.coeff_homogeneousComponent,ite_eq_right hd] rw [hh] exact A.zero_mem · exact hgen (Finset.mem_union_right _ (Finset.mem_singleton_self _)) · intro d hd apply hgen have hh : MvPowerSeries.coeff d f∈sl := Finset.mem_image.mpr ⟨d,(finite_of_degree_le r).mem_toFinset.mpr hd,rfl⟩ exact Finset.mem_union_left _ (Finset.mem_union_left _ (Finset.mem_union_right _ hh)) exact (mem_seriesOver A.toSubring f).mp hout end PD4Tensor.Spreading namespace PD4Tensor.Spreading variable {K ι : Type*} [Field K] [CharZero K] [Fintype ι] theorem algebraic_family_finiteType (n : ι → ℕ) (f : ∀ i,MvPowerSeries (Fin (n i)) K) (hf : ∀ i,IsAlgebraic (MvPolynomial (Fin (n i)) K) (f i)) (extra : Finset K) : ∃ A : Subalgebra ℤ K, Algebra.FiniteType ℤ A ∧ (∀ x∈extra,x∈A) ∧ ∀ i d,MvPowerSeries.coeff d (f i)∈A := by classical choose B hB hcoef using fun i => algebraic_series_finiteType (f i) (hf i) have hfg : ∀ i,(B i).FG := fun i => (Subalgebra.fg_iff_finiteType (B i)).mpr (hB i) choose gens hgens using hfg let s := Finset.univ.biUnion gens ∪ extra let A := Algebra.adjoin ℤ (s : Set K) have hBA : ∀ i,B i≤A := by intro i rw [←hgens i] apply Algebra.adjoin_mono intro x hx exact Finset.mem_union_left _ (Finset.mem_biUnion.mpr ⟨i,Finset.mem_univ i,hx⟩) refine ⟨A,Algebra.FiniteType.adjoin_of_finite s.finite_toSet,?_,?_⟩ · intro x hx exact Algebra.subset_adjoin (Finset.mem_union_right _ hx) · intro i d exact hBA i (hcoef i d) end PD4Tensor.Spreading namespace PD4Tensor.Spreading noncomputable section open scoped BigOperators variable {K : Type*} [Field K] [CharZero K] {l m d c : ℕ} {n : Fin l → ℕ} {e : ((i : Fin l) × Fin (n i)) ≃ Fin d ⊕ Fin c} {active : Fin m ↪ Fin l} structure AlgebraicData (M : TensorModel K (fun i=>Fin (n i)) m d c e active) (W : TensorPrimitives K (fun i=>Fin (n i)) m M) : Prop where F : ∀ i,IsAlgebraic (MvPolynomial (Fin (n i)) K) (M.F i) b : ∀ i,IsAlgebraic (MvPolynomial (Fin (n (active i))) K) (M.b i) H : ∀ v q,IsAlgebraic (MvPolynomial (Fin d) K) (boxSeries K m q (M.H v)) G : ∀ v,IsAlgebraic (MvPolynomial (Fin c) K) (M.G v) left : ∀ t v q,IsAlgebraic (MvPolynomial (Fin d) K) (boxSeries K m q (W.left t v)) right : ∀ t v,IsAlgebraic (MvPolynomial (Fin c) K) (W.right t v) theorem algebraic_data_descends (M : TensorModel K (fun i=>Fin (n i)) m d c e active) (W : TensorPrimitives K (fun i=>Fin (n i)) m M) (h : AlgebraicData M W) : ∃ A : Subalgebra ℤ K, Algebra.FiniteType ℤ A.toSubring ∧ IsUnit (2 : A.toSubring) ∧ Nonempty (TensorModel A.toSubring (fun i=>Fin (n i)) m d c e active) := by classical let V := (i : Fin l) × Fin (n i) let I := Fin l ⊕ Fin m ⊕ (V × Box m) ⊕ V ⊕ (Triple m × V × Box m) ⊕ (Triple m × V) let size : I → ℕ := Sum.elim n (Sum.elim (fun i=>n (active i)) (Sum.elim (fun _=>d) (Sum.elim (fun _=>c) (Sum.elim (fun _=>d) (fun _=>c))))) let f : ∀ i:I,MvPowerSeries (Fin (size i)) K := fun i=> match i with | .inl i => M.F i | .inr (.inl i) => M.b i | .inr (.inr (.inl (v,q))) => boxSeries K m q (M.H v) | .inr (.inr (.inr (.inl v))) => M.G v | .inr (.inr (.inr (.inr (.inl (t,v,q))))) => boxSeries K m q (W.left t v) | .inr (.inr (.inr (.inr (.inr (t,v))))) => W.right t v have hf : ∀ i,IsAlgebraic (MvPolynomial (Fin (size i)) K) (f i) := by rintro (i|i) · exact h.F i rcases i with i|i · exact h.b i rcases i with i|i · exact h.H i.1 i.2 rcases i with i|i · exact h.G i rcases i with i|i · exact h.left i.1 i.2.1 i.2.2 · exact h.right i.1 i.2 let det := (tangent K (fun i=>Fin (n i)) m e M.H M.G).det obtain ⟨A,hA,hex,hcoef⟩ := algebraic_family_finiteType size f hf {(2:K)⁻¹,det⁻¹} have h2inv : (2:K)⁻¹∈A := hex _ (Finset.mem_insert_self _ _) have hdetinv : det⁻¹∈A := hex _ (Finset.mem_insert_of_mem (Finset.mem_singleton_self _)) have hc : CoefficientsIn A.toSubring M W := { F := fun i b=>hcoef (.inl i) b b := fun i a=>hcoef (.inr (.inl i)) a H := fun v q b=>hcoef (.inr (.inr (.inl (v,q)))) b G := fun v b=>hcoef (.inr (.inr (.inr (.inl v)))) b left := fun t v q b=>hcoef (.inr (.inr (.inr (.inr (.inl (t,v,q)))))) b right := fun t v b=>hcoef (.inr (.inr (.inr (.inr (.inr (t,v)))))) b det_inv := hdetinv } refine ⟨A,hA,?_,⟨descendTensorModel A.toSubring M W hc⟩⟩ apply isUnit_iff_exists_inv.mpr refine ⟨⟨(2:K)⁻¹,h2inv⟩,?_⟩ apply Subtype.val_injective change (2:K)*(2:K)⁻¹=1 exact mul_inv_cancel₀ (by norm_num) end end PD4Tensor.Spreading namespace PD4Tensor.Spreading noncomputable section variable {K : Type*} [Field K] [CharZero K] {l m d c : ℕ} {n : Fin l → ℕ} {e : ((i : Fin l) × Fin (n i)) ≃ Fin d ⊕ Fin c} {active : Fin m ↪ Fin l} theorem no_algebraic_tensor_model (hm : 5 ≤ m) (M : TensorModel K (fun i=>Fin (n i)) m d c e active) (W : TensorPrimitives K (fun i=>Fin (n i)) m M) (h : AlgebraicData M W) : False := by obtain ⟨A,hA,h2,⟨M'⟩⟩ := algebraic_data_descends M W h let : Algebra.FiniteType ℤ A.toSubring := hA exact (no_tensor_model_finiteType (fun i=>Fin (n i)) A.toSubring h2 e hm active).false M' end end PD4Tensor.Spreading end end OAI