/- Copyright (c) 2026 Dan Abramov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dan Abramov -/ module public import ConwayRefinement.HahnSeries.Germ.AlgebraicIndependence.LeadingCoefficient public import ConwayRefinement.HahnSeries.Germ.AlgebraicIndependence.LinearMaximal public import ConwayRefinement.HahnSeries.Germ.AlgebraicIndependence.Obligations public import ConwayRefinement.HahnSeries.Germ.AlgebraicIndependence.PartialDerivativesAtLimitOrdinal public import ConwayRefinement.HahnSeries.Germ.AlgebraicIndependence.Scalar public import ConwayRefinement.Topology.Order.ArchimedeanBallBase public import Mathlib.RingTheory.AlgebraicIndependent.Defs import ConwayRefinement.Blueprint /-! # Algebraic independence for the Cantor--Bendixson degree A minimal system of homogeneous generators is algebraically independent. Equivalently, polynomial evaluation at the generators is injective. The proof is a transfinite induction on weighted degree. Degree zero is scalar. A successor weighted degree is handled by the lowering derivation. At a non-zero limit weighted degree, maximal-variable linearity and the required partial-derivative identities are established together. The argument for a successor degree is stated over an arbitrary filter. The argument for a limit ordinal degree uses the hypotheses supplied by its ordered-group setting. This file records what the induction needs and does not otherwise depend on the setting, so that what remains for the Cantor--Bendixson degree is exactly the list of hypotheses below. -/ universe u v w x open scoped NatOrdinal Topology open Filter MvPolynomial HahnSeries HahnSeries.Nonpositive public noncomputable section namespace HahnSeries.Germ variable {G : Type u} {K : Type v} variable [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] [UniformSpace G] [IsUniformAddGroup G] [OrderTopology G] [Nontrivial G] [CompleteSpace G] [Field K] [CharZero K] local notation "ν" => (cantorBendixsonDegreeValuation (G := G) (R := K)) variable {ι : Type w} {wt : ι → NatOrdinal.{u}} {xg : ι → (cantorBendixsonDegreeValuation (G := G) (R := K)).AssociatedGraded} variable (σ : LiftFamily wt xg) variable (hx : OrdinalGraded.IsMinimalSystem (DirectSum.rangeLof K (cantorBendixsonDegreeValuation (G := G) (R := K)).Component) wt xg) include hx /-- **Polynomiality, degree by degree.** Evaluation at a minimal system is injective in every degree, given the successor step and the three inputs of the limit step in every degree below. -/ theorem injectiveAt_of_isMinimalSystem (hleading : ∀ α : NatOrdinal.{u}, (∀ β < α, OrdinalGraded.InjectiveAt K wt xg β) → ∀ {F : MvPolynomial ι K}, IsWeightedHomogeneous wt F α → aeval xg F = 0 → ∀ {B₀ : ι}, B₀ ∈ F.vars → (∀ i ∈ F.vars, wt i ≤ wt B₀) → wt B₀ < α → ∀ {degHD : NatOrdinal.{u}}, degHD + degreeOf B₀ F • wt B₀ = α → (degHD = 0 ∨ NatOrdinal.leastTerm degHD ≤ NatOrdinal.leastTerm (wt B₀)) → False) (hlin : ∀ α : NatOrdinal.{u}, (∀ β < α, OrdinalGraded.InjectiveAt K wt xg β) → ∀ S : LimitOrdinalRelationAtCutoff σ α, degreeOf S.B₀ S.F = 1) (hpartials : ∀ α : NatOrdinal.{u}, (∀ β < α, OrdinalGraded.InjectiveAt K wt xg β) → ∀ S : LimitOrdinalRelationAtCutoff σ α, ∀ v', v' ∈ S.F.vars → S.LowDegreePartAlgebraicLE v' → ∃ (s : Finset ι) (U : ι → MvPolynomial ι K), (∀ v ∈ s, S.ContributesToPartialDerivativeAt v' v) ∧ (∀ v ∈ s, pderiv S.B₀ (U v) = 0) ∧ pderiv v' S.F = ∑ v ∈ s, pderiv v S.F * U v) (α : NatOrdinal.{u}) : OrdinalGraded.InjectiveAt K wt xg α := by letI : Nontrivial ((cantorBendixsonDegreeValuation (G := G) (R := K)).Component 0) := Function.Injective.nontrivial (cantorBendixsonLayerScalarHom_injective (G := G) (K := K)) letI : Nontrivial (cantorBendixsonDegreeValuation (G := G) (R := K)).AssociatedGraded := Function.Injective.nontrivial (DirectSum.of_injective 0) exact OrdinalGraded.injectiveAt_of_zero_successor_limit (OrdinalGraded.injectiveAt_zero hx.ne_zero) (fun _ hcc ih ↦ HahnSeries.Nonpositive.injectiveAt_of_forall_lt hx (pos_iff_ne_zero.mpr hcc) ih) (fun α hα hcc ih ↦ injectiveAt_of_limit σ hx (hleading α ih) (hlin α ih) (hpartials α ih) hα hcc) α /-- **Polynomiality, degree by degree.** The leading-coefficient obstruction has been discharged; only linearity of the maximal variable and the partial-derivative identities remain. -/ @[blueprint "lem:cantor-bendixson-degree-induction" (phase := "Algebraic independence in graded rings") (title := "Degreewise injectivity of homogeneous evaluation") (statement := /-- Let $K$ be a field of characteristic zero and $G$ a nontrivial complete ordered abelian group with compatible additive uniformity and order topology. Let $\nu$ be the Cantor--Bendixson degree on $K((G^{\le0}))$. Let $x_i\in(\operatorname{gr}_\nu)_{w_i}$ be a minimal homogeneous generating system, and choose series $b_i$ representing $x_i$ in degree $w_i$. Suppose \[ \nu(b_i)\le w_i, \qquad \nu(b_i^{\vert y})