Mathlib.Algebraic­Geometry

Algebraic-geometry infrastructure for affine Zariski closures, coordinate rings, and exact dimension of polynomial images.

Polynomial­Image­Dimension 28 core · 42 supporting · 14 submodules Reusable bridges from coordinate-ring, transcendence-degree, and Jacobian certificates to exact affine Zariski dimension over the complex numbers, together with the underlying closure, irreducibility, affine-space, polyn
Rational­Derivative 7 core · 4 supporting This module compiles vanishing of the full Fréchet derivative of a finite-dimensional real rational scalar coordinate into one polynomial equation. ★ derivative_zero_locus

Rational scalar derivative compiler

This module compiles vanishing of the full Fréchet derivative of a finite-dimensional real rational scalar coordinate into one polynomial equation. The quotient-rule numerators are combined by a sum of squares; nonzeroness follows either from formal nonconstancy, an explicit derivative witness, or semantic nonconstancy on a convex domain.

structure RationalScalar reviewed
Causalean.Mathlib.AlgebraicGeometry

A real rational scalar coordinate is a numerator and denominator multivariate polynomial.

Definition (Lean source)
S :
Type*
num :
den :
Causalean.Mathlib.AlgebraicGeometry.RationalScalar · Causalean/Mathlib/AlgebraicGeometry/RationalDerivative.lean:23
def eval reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalScalar

For a rational scalar and source assignment, the evaluated scalar is its numerator evaluation divided by its denominator evaluation. Division is total: where the denominator vanishes the value is zero, so this is the rational function's value only on points where it is defined.

Definition (Lean source)
S :
Type u_1
shared
x :
S → ℝ
eval r x :
eval x r.num / eval x r.den
Causalean.Mathlib.AlgebraicGeometry.RationalScalar.eval · Causalean/Mathlib/AlgebraicGeometry/RationalDerivative.lean:30 · uses RationalScalar
def DefinedOn reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalScalar

For a rational scalar and domain, being defined on the domain means that its denominator never vanishes there.

Definition (Lean source)
S :
Type u_1
shared
D :
Set (S → ℝ)
x ∈ D :
DefinedOn r D :
Prop
eval x r.den ≠ 0
Causalean.Mathlib.AlgebraicGeometry.RationalScalar.DefinedOn · Causalean/Mathlib/AlgebraicGeometry/RationalDerivative.lean:37 · uses RationalScalar
def derivativeNumerator reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalScalar

For a rational scalar and source coordinate, the cleared quotient-rule numerator is the polynomial numerator of that coordinate derivative.

Definition (Lean source)
S :
Type u_1
shared
i :
S
derivativeNumerator r i :
pderiv i r.num * r.den - r.num * pderiv i r.den
Causalean.Mathlib.AlgebraicGeometry.RationalScalar.derivativeNumerator · Causalean/Mathlib/AlgebraicGeometry/RationalDerivative.lean:42 · uses RationalScalar
def IsFormallyNonconstant reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalScalar

For a rational scalar, formal nonconstancy means that at least one cleared partial-derivative numerator is a nonzero polynomial.

Definition (Lean source)
S :
Type u_1
shared
IsFormallyNonconstant r :
Prop
∃ i, r.derivativeNumerator i ≠ 0
Causalean.Mathlib.AlgebraicGeometry.RationalScalar.IsFormallyNonconstant · Causalean/Mathlib/AlgebraicGeometry/RationalDerivative.lean:48 · uses RationalScalar
def derivativePolynomial reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalScalar

For a rational scalar, the full derivative certificate polynomial is the sum of squares of all cleared quotient-rule partial numerators.

Definition (Lean source)
S :
Type u_1
shared
derivativePolynomial r :
conjunctionPolynomial r.derivativeNumerator
Causalean.Mathlib.AlgebraicGeometry.RationalScalar.derivativePolynomial · Causalean/Mathlib/AlgebraicGeometry/RationalDerivative.lean:53 · uses RationalScalar
theorem derivative_zero_locus reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalScalar

Given a rational scalar coordinate r on a domain where its denominator does not vanish, the points where its full Fréchet derivative vanishes are exactly one real polynomial zero locus within that domain.

Formal statement
S :
Type u_1
shared
D :
Set (S → ℝ)
hD :
r.DefinedOn D
{x | x ∈ D ∧ fderiv ℝ r.eval x = 0}
= D ∩ mvPolynomialZeroLocus r.derivativePolynomial
Proof (Lean source)
theorem derivative_zero_locus [Fintype S] [DecidableEq S] (r : RationalScalar S) (D : Set (S → ℝ)) (hD : r.DefinedOn D) : {x | x ∈ D ∧ fderiv ℝ r.eval x = 0} = D ∩ mvPolynomialZeroLocus r.derivativePolynomial := by ext x simp only [Set.mem_ofPred_eq, Set.mem_inter_iff, mvPolynomialZeroLocus] apply and_congr_right intro hx exact fderiv_eq_zero_iff_derivativePolynomial_eq_zero r x (hD x hx)
4 supporting declarations (lemmas, instances)
Rational­Map 17 core · 13 supporting This module represents coordinate-indexed real rational maps by numerator and denominator polynomials (the locus compilers below assume finitely many output coordinates). ★ rationalMap_eq_locus

Rational maps and algebraic-locus compilers

This module represents coordinate-indexed real rational maps by numerator and denominator polynomials (the locus compilers below assume finitely many output coordinates). It clears coordinatewise equality, compiles finite conjunctions by sums of squares and finite unions by products, and supplies polynomial-matrix and adjugate/determinant inverse specializations.

structure RationalMap reviewed
Causalean.Mathlib.AlgebraicGeometry

A real rational map with an arbitrary index set of output coordinates stores one numerator and denominator multivariate polynomial for each output coordinate.

Definition (Lean source)
S T :
Type*
num :
T → MvPolynomial S ℝ
den :
T → MvPolynomial S ℝ
Causalean.Mathlib.AlgebraicGeometry.RationalMap · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:22
def eval reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalMap

Evaluating a rational map substitutes the source coordinates into each numerator and denominator and divides coordinatewise. Division is total: a coordinate whose denominator vanishes evaluates to zero, so this agrees with the rational map only where it is defined in the sense of DefinedOn.

Definition (Lean source)
S :
Type u_1
shared
T :
Type u_2
shared
f :
x :
S → ℝ
eval f x :
T → ℝ
fun t => eval x (f.num t) / eval x (f.den t)
Causalean.Mathlib.AlgebraicGeometry.RationalMap.eval · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:30 · uses RationalMap
def DefinedOn reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalMap

A rational map is defined on a domain when every coordinate denominator is nonzero at every point of that domain.

Definition (Lean source)
S :
Type u_1
shared
T :
Type u_2
shared
f :
D :
Set (S → ℝ)
x ∈ D :
t :
DefinedOn f D :
Prop
eval x (f.den t) ≠ 0
Causalean.Mathlib.AlgebraicGeometry.RationalMap.DefinedOn · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:37 · uses RationalMap
def ofPolynomial reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalMap

A polynomial coordinate map is viewed as a rational map with denominator one in every coordinate.

Definition (Lean source)
S :
Type u_1
shared
T :
Type u_2
shared
p :
T → MvPolynomial S ℝ
ofPolynomial p :
clause 1
num := p
clause 2
den := fun _ => 1
Causalean.Mathlib.AlgebraicGeometry.RationalMap.ofPolynomial · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:42 · uses RationalMap
def equalityPolynomial reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalMap

The cleared numerator for equality of one coordinate of two rational maps is the cross-product of their numerators and denominators.

Definition (Lean source)
S :
Type u_1
shared
T :
Type u_2
shared
f g :
t :
T
equalityPolynomial f g t :
f.num t * g.den t - g.num t * f.den t
Causalean.Mathlib.AlgebraicGeometry.RationalMap.equalityPolynomial · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:55 · uses RationalMap
def conjunctionPolynomial reviewed
Causalean.Mathlib.AlgebraicGeometry

The conjunction polynomial of finitely many real polynomials is their sum of squares.

Definition (Lean source)
S :
Type u_1
shared
T :
Type u_2
shared
p :
T → MvPolynomial S ℝ
conjunctionPolynomial p :
∑ t, (p t) ^ 2
Causalean.Mathlib.AlgebraicGeometry.conjunctionPolynomial · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:75
def unionConjunctionPolynomial reviewed
Causalean.Mathlib.AlgebraicGeometry

The union-of-conjunctions polynomial multiplies the sum-of-squares certificate for every branch.

Definition (Lean source)
S :
Type u_1
shared
T :
Type u_2
shared
B :
Type u_4
shared
p :
B → T → MvPolynomial S ℝ
unionConjunctionPolynomial p :
Causalean.Mathlib.AlgebraicGeometry.unionConjunctionPolynomial · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:110
theorem rationalMap_eq_locus reviewed
Causalean.Mathlib.AlgebraicGeometry

Given two finite-coordinate rational maps f and g on a common domain where the denominators of the first map do not vanish and the denominators of the second map do not vanish, the whole-output equality condition is one real polynomial zero locus.

Formal statement
S :
Type u_1
shared
T :
Type u_2
shared
f g :
D :
Set (S → ℝ)
hf :
f.DefinedOn D
hg :
g.DefinedOn D
{x | x ∈ D ∧ f.eval x = g.eval x}
= D ∩ mvPolynomialZeroLocus (conjunctionPolynomial (RationalMap.equalityPolynomial f g))
Proof (Lean source)
theorem rationalMap_eq_locus [Fintype T] (f g : RationalMap S T) (D : Set (S → ℝ)) (hf : f.DefinedOn D) (hg : g.DefinedOn D) : {x | x ∈ D ∧ f.eval x = g.eval x} = D ∩ mvPolynomialZeroLocus (conjunctionPolynomial (RationalMap.equalityPolynomial f g)) := by ext x simp only [Set.mem_ofPred_eq, Set.mem_inter_iff, mvPolynomialZeroLocus] apply and_congr_right intro hx rw [eval_conjunctionPolynomial_eq_zero_iff] constructor · intro h t exact (RationalMap.eval_eq_iff_equalityPolynomial_eq_zero f g x t (hf x hx t) (hg x hx t)).mp (congrFun h t) · intro h funext t exact (RationalMap.eval_eq_iff_equalityPolynomial_eq_zero f g x t (hf x hx t) (hg x hx t)).mpr (h t)
abbrev RationalMatrixMap reviewed
Causalean.Mathlib.AlgebraicGeometry

A rational matrix map is a rational map whose output coordinates are row-column pairs.

Definition (Lean source)
S T U :
Type*
RationalMatrixMap S T U :
Type (max u_5 u_7 u_6)
RationalMap S (T × U)
Causalean.Mathlib.AlgebraicGeometry.RationalMatrixMap · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:194
def evalMatrix reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalMatrixMap

Evaluating a rational matrix map and reshaping its pair-indexed output gives an ordinary matrix-valued function.

Definition (Lean source)
S :
Type u_1
shared
T :
Type u_2
shared
U :
Type u_3
shared
f :
x :
S → ℝ
evalMatrix f x :
Matrix T U ℝ
of fun i j => f.eval x (i, j)
Causalean.Mathlib.AlgebraicGeometry.RationalMatrixMap.evalMatrix · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:197 · uses RationalMatrixMap
def evalPolynomialMatrix reviewed
Causalean.Mathlib.AlgebraicGeometry

Evaluating a matrix of multivariate polynomials substitutes the source point in every matrix entry.

Definition (Lean source)
S :
Type u_1
shared
T :
Type u_2
shared
U :
Type u_3
shared
A :
Matrix T U (MvPolynomial S ℝ)
x :
S → ℝ
evalPolynomialMatrix A x :
Matrix T U ℝ
A.map (eval x)
Causalean.Mathlib.AlgebraicGeometry.evalPolynomialMatrix · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:203
def polynomialMatrixRationalMap reviewed
Causalean.Mathlib.AlgebraicGeometry

A polynomial matrix is represented as a rational matrix map with denominator one entrywise.

Definition (Lean source)
S :
Type u_1
shared
T :
Type u_2
shared
U :
Type u_3
shared
A :
Matrix T U (MvPolynomial S ℝ)
polynomialMatrixRationalMap A :
RationalMap.ofPolynomial (fun ij => A ij.1 ij.2)
Causalean.Mathlib.AlgebraicGeometry.polynomialMatrixRationalMap · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:209 · uses RationalMatrixMap
def polynomialMatrixInverseRationalMap reviewed
Causalean.Mathlib.AlgebraicGeometry

The adjugate-over-determinant representation is the rational matrix map associated with the inverse of a square polynomial matrix.

Definition (Lean source)
S :
Type u_1
shared
T :
Type u_2
shared
A :
Matrix T T (MvPolynomial S ℝ)
polynomialMatrixInverseRationalMap A :
clause 1
num := fun ij => A.adjugate ij.1 ij.2
clause 2
den := fun _ => A.det
Causalean.Mathlib.AlgebraicGeometry.polynomialMatrixInverseRationalMap · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:223 · uses RationalMatrixMap
def renameSource reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalMap

Renaming the source variables of a rational map along a coordinate map renames every numerator and denominator polynomial.

Definition (Lean source)
S :
Type u_5
shared
U :
Type u_6
shared
T :
Type u_7
shared
f :
e :
S → U
renameSource f e :
clause 1
num := fun t => MvPolynomial.rename e (f.num t)
clause 2
den := fun t => MvPolynomial.rename e (f.den t)
Causalean.Mathlib.AlgebraicGeometry.RationalMap.renameSource · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:264 · uses RationalMap
def leftLift reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalMap

The left lift of a rational map makes it depend on the left coordinates of a disjoint-sum parameter space.

Definition (Lean source)
S :
Type u_5
shared
U :
Type u_6
shared
T :
Type u_7
shared
f :
leftLift f :
RationalMap (S ⊕ U) T
f.renameSource inl
Causalean.Mathlib.AlgebraicGeometry.RationalMap.leftLift · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:277 · uses RationalMap
def rightLift reviewed
Causalean.Mathlib.AlgebraicGeometry.RationalMap

The right lift of a rational map makes it depend on the right coordinates of a disjoint-sum parameter space.

Definition (Lean source)
S :
Type u_5
shared
U :
Type u_6
shared
T :
Type u_7
shared
g :
rightLift g :
RationalMap (S ⊕ U) T
g.renameSource inr
Causalean.Mathlib.AlgebraicGeometry.RationalMap.rightLift · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:282 · uses RationalMap
def sumProductDomain reviewed
Causalean.Mathlib.AlgebraicGeometry

The sum-coordinate form of a product domain requires the left and right restrictions of one assignment to lie in their respective domains.

Definition (Lean source)
S :
Type u_5
shared
U :
Type u_6
shared
D :
Set (S → ℝ)
E :
Set (U → ℝ)
sumProductDomain D E :
Set ((S ⊕ U) → ℝ)
{z | (z ∘ inl) ∈ D ∧ (z ∘ inr) ∈ E}
Causalean.Mathlib.AlgebraicGeometry.sumProductDomain · Causalean/Mathlib/AlgebraicGeometry/RationalMap.lean:289
13 supporting declarations (lemmas, instances)