Download data/lean/ComparatorChallenges/Nagata.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 16.4 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/ComparatorChallenges/Nagata.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/ComparatorChallenges/Nagata.lean
-
curl -L -o Nagata.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/ComparatorChallenges/Nagata.lean
16.4 kB
| import Mathlib.Algebra.CharZero.Infinite | |
| import Mathlib.Algebra.Group.Irreducible.Defs | |
| import Mathlib.Algebra.MvPolynomial.Eval | |
| import Mathlib.Algebra.MvPolynomial.NoZeroDivisors | |
| import Mathlib.Algebra.MvPolynomial.Rename | |
| import Mathlib.Analysis.Real.Sqrt | |
| import Mathlib.Basic.Complex.Basic | |
| import Mathlib.Data.Fin.SuccPred | |
| import Mathlib.Data.Fin.Tuple.Basic | |
| import Mathlib.Data.Fintype.BigOperators | |
| import Mathlib.LinearAlgebra.Projectivization.Basic | |
| import Mathlib.RingTheory.GradedAlgebra.Homogeneous.Ideal | |
| import Mathlib.RingTheory.Ideal.Height | |
| import Mathlib.RingTheory.Ideal.IsPrincipal | |
| import Mathlib.RingTheory.Ideal.Maps | |
| import Mathlib.RingTheory.Ideal.Maximal | |
| import Mathlib.RingTheory.Localization.AtPrime.Basic | |
| import Mathlib.RingTheory.MvPolynomial.Homogeneous | |
| import Mathlib.RingTheory.MvPolynomial.Ideal | |
| import Mathlib.RingTheory.Polynomial.UniqueFactorization | |
| import Mathlib.RingTheory.UniqueFactorizationDomain.Basic | |
| import Mathlib.RingTheory.UniqueFactorizationDomain.Finsupp | |
| namespace OAI | |
| /-! | |
| # Nagata's strict inequality for very general complex plane configurations | |
| The exceptional family is chosen before every curve and multiplicity vector. | |
| Closedness means common multihomogeneous zero loci on the product of projective | |
| planes, restricted to the open set of ordered distinct configurations. | |
| -/ | |
| noncomputable section | |
| open scoped BigOperators | |
| namespace Nagata.AffineMultiplicity | |
| variable {Ο K : Type*} [CommRing K] | |
| def pointIdeal (point : Ο β K) : Ideal (MvPolynomial Ο K) := | |
| RingHom.ker (MvPolynomial.eval point) | |
| def orderAtLeast (point : Ο β K) (multiplicity : β) | |
| (polynomial : MvPolynomial Ο K) : Prop := | |
| polynomial β pointIdeal point ^ multiplicity | |
| def translateHom (point : Ο β K) : MvPolynomial Ο K β+* MvPolynomial Ο K := | |
| MvPolynomial.evalβHom MvPolynomial.C | |
| (fun index => MvPolynomial.X index + MvPolynomial.C (point index)) | |
| theorem translateHom_C (point : Ο β K) (coefficient : K) : | |
| translateHom point (MvPolynomial.C coefficient) = MvPolynomial.C coefficient := by | |
| simp [translateHom] | |
| theorem translateHom_X (point : Ο β K) (index : Ο) : | |
| translateHom point (MvPolynomial.X index) = MvPolynomial.X index + MvPolynomial.C (point index) := by | |
| simp [translateHom] | |
| theorem translateHom_neg_comp (point : Ο β K) : | |
| (translateHom (-point)).comp (translateHom point) = RingHom.id _ := by | |
| apply MvPolynomial.ringHom_ext | |
| Β· intro coefficient; simp | |
| Β· intro index; simp [add_assoc] | |
| theorem translateHom_comp_neg (point : Ο β K) : | |
| (translateHom point).comp (translateHom (-point)) = RingHom.id _ := by | |
| simpa only [neg_neg] using translateHom_neg_comp (-point) | |
| def translateEquiv (point : Ο β K) : MvPolynomial Ο K β+* MvPolynomial Ο K := | |
| { translateHom point with | |
| invFun := translateHom (-point) | |
| left_inv := fun polynomial => RingHom.congr_fun (translateHom_neg_comp point) polynomial | |
| right_inv := fun polynomial => RingHom.congr_fun (translateHom_comp_neg point) polynomial } | |
| theorem translateEquiv_apply (point : Ο β K) (polynomial : MvPolynomial Ο K) : | |
| translateEquiv point polynomial = translateHom point polynomial := rfl | |
| theorem translate_ne_zero (point : Ο β K) (polynomial : MvPolynomial Ο K) | |
| (nonzero : polynomial β 0) : translateHom point polynomial β 0 := by | |
| intro translated_zero | |
| apply nonzero | |
| apply (translateEquiv point).injective | |
| simpa only [translateEquiv_apply, map_zero] using translated_zero | |
| theorem translated_support_nonempty (point : Ο β K) (polynomial : MvPolynomial Ο K) | |
| (nonzero : polynomial β 0) : (translateHom point polynomial).support.Nonempty := | |
| MvPolynomial.support_nonempty.mpr (translate_ne_zero point polynomial nonzero) | |
| /-- The least total degree of a nonzero Taylor coefficient. -/ | |
| def ordinaryMultiplicity (point : Ο β K) (polynomial : MvPolynomial Ο K) | |
| (nonzero : polynomial β 0) : β := | |
| (translateHom point polynomial).support.inf' | |
| (translated_support_nonempty point polynomial nonzero) Finsupp.degree | |
| end Nagata.AffineMultiplicity | |
| namespace Nagata.ProjectiveGeometry | |
| abbrev PlanePoint := Projectivization β (Fin 3 β β) | |
| abbrev OrderedDistinctPoints (count : β) := | |
| {points : Fin count β PlanePoint // Function.Injective points} | |
| structure MultihomogeneousEquation (count : β) where | |
| polynomial : MvPolynomial (Fin count Γ Fin 3) β | |
| multidegree : Fin count β β | |
| homogeneous : β exponent β polynomial.support, β index, | |
| (β coordinate : Fin 3, exponent (index, coordinate)) = multidegree index | |
| def equationVanishes {count : β} (equation : MultihomogeneousEquation count) | |
| (points : Fin count β PlanePoint) : Prop := | |
| β (vectors : Fin count β Fin 3 β β) (nonzero : β index, vectors index β 0), | |
| (β index, Projectivization.mk β (vectors index) (nonzero index) = points index) β | |
| MvPolynomial.eval (fun index => vectors index.1 index.2) equation.polynomial = 0 | |
| def IsProductZariskiClosed {count : β} (locus : Set (Fin count β PlanePoint)) : Prop := | |
| β equations : Set (MultihomogeneousEquation count), | |
| β points, points β locus β β equation β equations, equationVanishes equation points | |
| def IsConfigurationZariskiClosed {count : β} | |
| (locus : Set (OrderedDistinctPoints count)) : Prop := | |
| β ambient : Set (Fin count β PlanePoint), IsProductZariskiClosed ambient β§ | |
| β points, points β locus β points.val β ambient | |
| abbrev ChartVariables (chart : Fin 3) := {coordinate : Fin 3 // coordinate β chart} | |
| def dehomogenize (chart : Fin 3) (polynomial : MvPolynomial (Fin 3) β) : | |
| MvPolynomial (ChartVariables chart) β := | |
| MvPolynomial.evalβ MvPolynomial.C | |
| (fun coordinate => if equal : coordinate = chart then 1 | |
| else MvPolynomial.X β¨coordinate, equalβ©) polynomial | |
| def chartCoordinates (chart : Fin 3) (point : PlanePoint) : ChartVariables chart β β := | |
| fun coordinate => point.rep coordinate.val / point.rep chart | |
| /-- Local multiplicity lower bounds are membership in powers of the point ideal. -/ | |
| def multiplicityAtLeast (polynomial : MvPolynomial (Fin 3) β) | |
| (point : PlanePoint) (multiplicity : β) : Prop := | |
| β chart : Fin 3, point.rep chart β 0 β | |
| AffineMultiplicity.orderAtLeast (chartCoordinates chart point) multiplicity | |
| (dehomogenize chart polynomial) | |
| theorem chart_exists (point : PlanePoint) : β chart : Fin 3, point.rep chart β 0 := by | |
| by_contra absent | |
| apply point.rep_nonzero | |
| funext chart | |
| exact Classical.not_not.mp (fun nonzero => absent β¨chart, nonzeroβ©) | |
| end Nagata.ProjectiveGeometry | |
| namespace Nagata.Workers.W30 | |
| open UniqueFactorizationMonoid | |
| abbrev TernaryPolynomial := MvPolynomial (Fin 3) β | |
| local instance : DecidableEq (Associates TernaryPolynomial) := Classical.decEq _ | |
| def equationMultiplicity (polynomial : TernaryPolynomial) : | |
| Associates TernaryPolynomial ββ β := | |
| factorization (Associates.mk polynomial) | |
| def associatePrincipalIdeal (associate : Associates TernaryPolynomial) : | |
| Ideal TernaryPolynomial := | |
| (Ideal.associatesEquivIsPrincipal TernaryPolynomial associate).val | |
| def equationIdealCycle (polynomial : TernaryPolynomial) : Ideal TernaryPolynomial ββ β := | |
| (equationMultiplicity polynomial).mapDomain associatePrincipalIdeal | |
| MvPolynomial.gradedAlgebra | |
| theorem exists_positive_degree_equation_of_homogeneous_cycle | |
| (cycle : Ideal TernaryPolynomial ββ β) (nonzero : cycle β 0) | |
| (homogeneous : β ideal β cycle.support, | |
| ideal.IsPrime β§ ideal β β₯ β§ ideal.IsPrincipal β§ | |
| ideal.IsHomogeneous (MvPolynomial.homogeneousSubmodule (Fin 3) β)) : | |
| β polynomial : TernaryPolynomial, | |
| polynomial β 0 β§ polynomial.IsHomogeneous polynomial.totalDegree β§ | |
| 0 < polynomial.totalDegree β§ equationIdealCycle polynomial = cycle := by | |
| sorry | |
| end Nagata.Workers.W30 | |
| namespace Nagata.W16 | |
| abbrev PlanePolynomial := MvPolynomial (Fin 3) β | |
| structure NonzeroHomogeneousForm (degree : β) where | |
| polynomial : PlanePolynomial | |
| homogeneous : polynomial.IsHomogeneous degree | |
| nonzero : polynomial β 0 | |
| theorem homogeneous_eval_scale {Variables Coefficient : Type*} [CommSemiring Coefficient] | |
| {polynomial : MvPolynomial Variables Coefficient} {degree : β} | |
| (homogeneous : polynomial.IsHomogeneous degree) | |
| (coordinates : Variables β Coefficient) (scalar : Coefficient) : | |
| MvPolynomial.eval (fun index => scalar * coordinates index) polynomial = | |
| scalar ^ degree * MvPolynomial.eval coordinates polynomial := by | |
| classical | |
| simp only [MvPolynomial.eval_eq, Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro exponent supported | |
| simp only [mul_pow, Finset.prod_mul_distrib, Finset.prod_pow_eq_pow_sum] | |
| rw [β homogeneous.degree_eq_sum_deg_support supported] | |
| ac_rfl | |
| open Nagata.ProjectiveGeometry | |
| theorem eval_dehomogenize (chart : Fin 3) (polynomial : PlanePolynomial) | |
| (coordinates : ChartVariables chart β β) : | |
| MvPolynomial.eval coordinates (dehomogenize chart polynomial) = | |
| MvPolynomial.eval | |
| (fun index => if equal : index = chart then 1 else coordinates β¨index, equalβ©) | |
| polynomial := by | |
| classical | |
| unfold dehomogenize | |
| rw [β MvPolynomial.eval_assoc] | |
| apply congrArg (fun values : Fin 3 β β => MvPolynomial.eval values polynomial) | |
| funext index | |
| by_cases equal : index = chart <;> simp [equal, Function.comp_apply] | |
| theorem eval_dehomogenize_normalized {degree : β} {polynomial : PlanePolynomial} | |
| (homogeneous : polynomial.IsHomogeneous degree) (chart : Fin 3) | |
| (coordinates : Fin 3 β β) (chart_nonzero : coordinates chart β 0) : | |
| MvPolynomial.eval (fun index : ChartVariables chart => coordinates index.val / coordinates chart) | |
| (dehomogenize chart polynomial) = | |
| (coordinates chart)β»ΒΉ ^ degree * MvPolynomial.eval coordinates polynomial := by | |
| classical | |
| rw [eval_dehomogenize] | |
| have normalized : | |
| (fun index : Fin 3 => if equal : index = chart then (1 : β) | |
| else coordinates index / coordinates chart) = | |
| fun index => (coordinates chart)β»ΒΉ * coordinates index := by | |
| funext index | |
| by_cases equal : index = chart | |
| Β· subst index | |
| simp [chart_nonzero] | |
| Β· simp [equal, div_eq_mul_inv, mul_comm] | |
| rw [normalized] | |
| exact homogeneous_eval_scale homogeneous coordinates (coordinates chart)β»ΒΉ | |
| theorem eval_eq_zero_of_dehomogenize_eq_zero {degree : β} {polynomial : PlanePolynomial} | |
| (homogeneous : polynomial.IsHomogeneous degree) (chart : Fin 3) | |
| (chart_zero : dehomogenize chart polynomial = 0) | |
| (coordinates : Fin 3 β β) (chart_nonzero : coordinates chart β 0) : | |
| MvPolynomial.eval coordinates polynomial = 0 := by | |
| have evaluated := congrArg | |
| (MvPolynomial.eval (fun index : ChartVariables chart => coordinates index.val / coordinates chart)) | |
| chart_zero | |
| rw [eval_dehomogenize_normalized homogeneous chart coordinates chart_nonzero, map_zero] at evaluated | |
| exact (mul_eq_zero.mp evaluated).resolve_left (pow_ne_zero degree (inv_ne_zero chart_nonzero)) | |
| theorem eq_zero_of_dehomogenize_eq_zero {degree : β} {polynomial : PlanePolynomial} | |
| (homogeneous : polynomial.IsHomogeneous degree) (chart : Fin 3) | |
| (chart_zero : dehomogenize chart polynomial = 0) : polynomial = 0 := by | |
| have multiplied : MvPolynomial.X chart * polynomial = 0 := by | |
| apply ((MvPolynomial.isHomogeneous_X β chart).mul homogeneous).eq_zero_of_forall_eval_eq_zero | |
| intro coordinates | |
| rw [MvPolynomial.eval_mul, MvPolynomial.eval_X] | |
| by_cases chart_nonzero : coordinates chart = 0 | |
| Β· simp [chart_nonzero] | |
| Β· rw [eval_eq_zero_of_dehomogenize_eq_zero homogeneous chart chart_zero coordinates chart_nonzero, | |
| mul_zero] | |
| exact (mul_eq_zero.mp multiplied).resolve_left (MvPolynomial.X_ne_zero chart) | |
| theorem dehomogenize_ne_zero {degree : β} {polynomial : PlanePolynomial} | |
| (homogeneous : polynomial.IsHomogeneous degree) (nonzero : polynomial β 0) | |
| (chart : Fin 3) : ProjectiveGeometry.dehomogenize chart polynomial β 0 := by | |
| intro chart_zero | |
| exact nonzero (eq_zero_of_dehomogenize_eq_zero homogeneous chart chart_zero) | |
| end Nagata.W16 | |
| namespace Nagata.Workers.W10 | |
| open Nagata.Workers.W30 Nagata.W16 | |
| MvPolynomial.gradedAlgebra | |
| /-- Nonzero finite cycles of homogeneous prime plane ideals, with natural weights. -/ | |
| def EffectivePlaneCurve := {cycle : Ideal TernaryPolynomial ββ β // | |
| cycle β 0 β§ β ideal β cycle.support, | |
| ideal.IsPrime β§ ideal β β₯ β§ ideal.IsPrincipal β§ | |
| ideal.IsHomogeneous (MvPolynomial.homogeneousSubmodule (Fin 3) β)} | |
| /-- An equation realizing the entire cycle, including repeated components. -/ | |
| def curveEquation (curve : EffectivePlaneCurve) : TernaryPolynomial := | |
| Classical.choose (exists_positive_degree_equation_of_homogeneous_cycle | |
| curve.val curve.property.1 curve.property.2) | |
| theorem curveEquation_spec (curve : EffectivePlaneCurve) : | |
| curveEquation curve β 0 β§ | |
| (curveEquation curve).IsHomogeneous (curveEquation curve).totalDegree β§ | |
| 0 < (curveEquation curve).totalDegree β§ equationIdealCycle (curveEquation curve) = curve.val := | |
| Classical.choose_spec (exists_positive_degree_equation_of_homogeneous_cycle | |
| curve.val curve.property.1 curve.property.2) | |
| theorem curveEquation_nonzero (curve : EffectivePlaneCurve) : curveEquation curve β 0 := | |
| (curveEquation_spec curve).1 | |
| def curveDegree (curve : EffectivePlaneCurve) : β := (curveEquation curve).totalDegree | |
| theorem curveEquation_homogeneous (curve : EffectivePlaneCurve) : | |
| (curveEquation curve).IsHomogeneous (curveDegree curve) := | |
| (curveEquation_spec curve).2.1 | |
| def curveForm (curve : EffectivePlaneCurve) : NonzeroHomogeneousForm (curveDegree curve) := | |
| β¨curveEquation curve, curveEquation_homogeneous curve, curveEquation_nonzero curveβ© | |
| end Nagata.Workers.W10 | |
| namespace Nagata.ProjectiveGeometry | |
| def formOrdinaryMultiplicity {degree : β} (form : W16.NonzeroHomogeneousForm degree) | |
| (point : PlanePoint) : β := | |
| let chart := Classical.choose (chart_exists point) | |
| AffineMultiplicity.ordinaryMultiplicity (chartCoordinates chart point) | |
| (dehomogenize chart form.polynomial) | |
| (W16.dehomogenize_ne_zero form.homogeneous form.nonzero chart) | |
| end Nagata.ProjectiveGeometry | |
| namespace Nagata.W15 | |
| open Nagata.Workers.W10 Nagata.ProjectiveGeometry | |
| def curveOrdinaryMultiplicity (curve : EffectivePlaneCurve) (point : PlanePoint) : β := | |
| formOrdinaryMultiplicity (curveForm curve) point | |
| end Nagata.W15 | |
| namespace Nagata | |
| open ProjectiveGeometry | |
| def FullNagata : Prop := | |
| β count : β, 10 β€ count β | |
| β exceptional : β β Set (OrderedDistinctPoints count), | |
| (β index, IsConfigurationZariskiClosed (exceptional index) β§ | |
| exceptional index β Set.univ) β§ | |
| (β points : OrderedDistinctPoints count, β index, points β exceptional index) β§ | |
| β points : OrderedDistinctPoints count, (β index, points β exceptional index) β | |
| β degree : β, 1 β€ degree β | |
| β polynomial : MvPolynomial (Fin 3) β, | |
| polynomial β 0 β polynomial.IsHomogeneous degree β | |
| β multiplicities : Fin count β β, | |
| (β index, multiplicityAtLeast polynomial (points.val index) (multiplicities index)) β | |
| (β index, (multiplicities index : β)) < (degree : β) * Real.sqrt (count : β) | |
| theorem nagata_conjecture : | |
| β count : β, 10 β€ count β | |
| β exceptional : β β Set (OrderedDistinctPoints count), | |
| (β index, IsConfigurationZariskiClosed (exceptional index) β§ | |
| exceptional index β Set.univ) β§ | |
| (β points : OrderedDistinctPoints count, β index, points β exceptional index) β§ | |
| β points : OrderedDistinctPoints count, (β index, points β exceptional index) β | |
| β curve : Workers.W10.EffectivePlaneCurve, β multiplicities : Fin count β β, | |
| (β index, multiplicities index β€ W15.curveOrdinaryMultiplicity curve (points.val index)) β | |
| (β index, (multiplicities index : β)) < | |
| (Workers.W10.curveDegree curve : β) * Real.sqrt (count : β) := by | |
| sorry | |
| theorem nagata_conjecture_coordinates : FullNagata := by | |
| sorry | |
| end Nagata | |
| end | |
| end OAI | |