Index of theproofnetwork/open-problems@860a535/Prove2Me/Definitions/Def_HilbertSixteenth_PolyFields.lean
qedmarket’s copy of theproofnetwork/open-problems@860a535, 3 Dec 2026original source ↗
/-From Prove2Me, definition `HilbertSixteenth_PolyFields` (https://prove2.me/definitions/4697324f-f882-4862-bd8c-a1abfb8f1371). Apache-2.0 per Prove2Me's terms.-/import Prove2Me.Definitions.Def_HilbertSixteenth_Dynamics /-!# Polynomial vector fields, invariant algebraic curves and algebraic limit cycles Source: J. Llibre, *Sobre el problema 16 de Hilbert*, La Gaceta de la RSME 18 (2015),no. 3, 543–554: equation (1), Problems 6–7 (algebraic limit cycles, algebraic Hilbertnumber), §7 equations (3)–(4) (invariant algebraic curves, cofactor), conditions (i)–(v)(generic invariant curves), and Theorem 2 (bounded components of an algebraic curve). Polynomials in `x, y` are elements of `MvPolynomial (Fin 2) ℝ`, with variable `0` playingthe role of `x` and variable `1` the role of `y`.-/ namespace HilbertSixteenth /-- Real polynomials in the two variables `x = X 0`, `y = X 1`. -/abbrev Poly2 := MvPolynomial (Fin 2) ℝ /-- Evaluation of a polynomial `f(x, y)` at the point `p = (x, y)`. -/noncomputable def evalAt (f : Poly2) (p : ℝ × ℝ) : ℝ := MvPolynomial.eval ![p.1, p.2] f /-- The real zero set `{(x, y) ∈ ℝ² : f(x, y) = 0}`. -/def zeroSet (f : Poly2) : Set (ℝ × ℝ) := {p | evalAt f p = 0} /-- A polynomial vector field `P ∂/∂x + Q ∂/∂y`, i.e. the system `ẋ = P(x,y), ẏ = Q(x,y)`. -/structure PolyField where /-- The `x`-component `P`. -/ P : Poly2 /-- The `y`-component `Q`. -/ Q : Poly2 /-- The degree of the polynomial vector field: the maximum of the degrees of `P` and `Q`. -/noncomputable def PolyField.degree (V : PolyField) : ℕ := max V.P.totalDegree V.Q.totalDegree /-- The polynomial vector field as a map `ℝ² → ℝ²`. -/noncomputable def PolyField.toField (V : PolyField) : ℝ × ℝ → ℝ × ℝ := fun p => (evalAt V.P p, evalAt V.Q p) /-- The action of the vector field on polynomials: `X f = P ∂f/∂x + Q ∂f/∂y`. -/noncomputable def PolyField.derivation (V : PolyField) (f : Poly2) : Poly2 := V.P * MvPolynomial.pderiv 0 f + V.Q * MvPolynomial.pderiv 1 f /-- `f = 0` is an invariant algebraic curve of `V` with cofactor `K`: `X f = K f`(equation (4) of the source). -/def IsInvariantCurve (V : PolyField) (f K : Poly2) : Prop := V.derivation f = K * f /-- An algebraic limit cycle: a limit cycle contained in the zero set of a non-zeropolynomial. -/def IsAlgebraicLimitCycle (V : PolyField) (O : Set (ℝ × ℝ)) : Prop := IsLimitCycle V.toField O ∧ ∃ f : Poly2, f ≠ 0 ∧ O ⊆ zeroSet f /-- The number of algebraic limit cycles of `V` (in `ℕ∞`; `⊤` if there are infinitely many). -/noncomputable def numAlgebraicLimitCycles (V : PolyField) : ℕ∞ := {O : Set (ℝ × ℝ) | IsAlgebraicLimitCycle V O}.encard /-- The algebraic Hilbert number `Hₐ(d)`: the supremum, over all polynomial vector fields ofdegree at most `d`, of the number of algebraic limit cycles (`⊤` if unbounded). -/noncomputable def algebraicHilbertNumber (d : ℕ) : ℕ∞ := ⨆ (V : PolyField) (_ : V.degree ≤ d), numAlgebraicLimitCycles V /-- The homogeneous part of highest degree of `f`. -/noncomputable def topForm (f : Poly2) : Poly2 := MvPolynomial.homogeneousComponent f.totalDegree f /-- Evaluation of a real polynomial at a complex point `z = (z₀, z₁) ∈ ℂ²`. -/noncomputable def cEval (f : Poly2) (z : Fin 2 → ℂ) : ℂ := MvPolynomial.aeval z f /-- A family `S` of algebraic curves is *generic* (conditions (i)–(v) of the source, withpoints of the affine plane taken in `ℂ²`; curves are distinct when they are notassociated, i.e. not scalar multiples of each other):(i) no curve has a singular point;(ii) the highest-degree homogeneous part of each curve is square-free;(iii) two distinct curves meet transversally (their gradients are independent at everycommon point);(iv) no point lies on three distinct curves;(v) the highest-degree homogeneous parts of two distinct curves have no common factor. -/def IsGenericFamily (S : Set Poly2) : Prop := (∀ f ∈ S, ∀ z : Fin 2 → ℂ, ¬ (cEval f z = 0 ∧ cEval (MvPolynomial.pderiv 0 f) z = 0 ∧ cEval (MvPolynomial.pderiv 1 f) z = 0)) ∧ (∀ f ∈ S, Squarefree (topForm f)) ∧ (∀ f ∈ S, ∀ g ∈ S, ¬ Associated f g → ∀ z : Fin 2 → ℂ, cEval f z = 0 → cEval g z = 0 → cEval (MvPolynomial.pderiv 0 f) z * cEval (MvPolynomial.pderiv 1 g) z - cEval (MvPolynomial.pderiv 1 f) z * cEval (MvPolynomial.pderiv 0 g) z ≠ 0) ∧ (∀ f ∈ S, ∀ g ∈ S, ∀ h ∈ S, ¬ Associated f g → ¬ Associated f h → ¬ Associated g h → ∀ z : Fin 2 → ℂ, ¬ (cEval f z = 0 ∧ cEval g z = 0 ∧ cEval h z = 0)) ∧ (∀ f ∈ S, ∀ g ∈ S, ¬ Associated f g → IsRelPrime (topForm f) (topForm g)) /-- The irreducible invariant algebraic curves of `V`. -/def invariantIrreducibleCurves (V : PolyField) : Set Poly2 := {f | Irreducible f ∧ ∃ K : Poly2, IsInvariantCurve V f K} /-- All invariant algebraic curves of `V` are generic. -/def HasGenericInvariantCurves (V : PolyField) : Prop := IsGenericFamily (invariantIrreducibleCurves V) /-- The bound of Theorem 4: `1 + (d-1)(d-2)/2` for even `d`, `(d-1)(d-2)/2` for odd `d`. -/def genericAlgebraicBound (d : ℕ) : ℕ := if Even d then 1 + (d - 1) * (d - 2) / 2 else (d - 1) * (d - 2) / 2 /-- The bounded connected components of the real algebraic curve `f = 0`. -/def boundedComponents (f : Poly2) : Set (Set (ℝ × ℝ)) := {C | ∃ p ∈ zeroSet f, C = connectedComponentIn (zeroSet f) p ∧ Bornology.IsBounded C} end HilbertSixteenth