Documentation

CslibFrontier.Logics.RealArithmetic.Basic

Integer polynomial formulas over the reals #

Expression trees contain integer constants, finite variable indices, addition and multiplication. Boolean formulas compare expressions with zero. Their semantics is a subset of real coordinate space; quantification is performed by the problem using the formula. This is the finite syntax and semantics of edemaine/lean-canny's formal abstract at 970f28a5ecefc1327402ade16c068aa4b1b2c183.

A dedicated expression grammar retains integer coefficients and a concrete input encoding; Term.toPolynomial connects it to Mathlib's mathematical polynomials.

Main definitions #

Main results #

Integer polynomial expressions use constants, variables, addition, and multiplication. In dimension n, variables are the indices Fin n.

Instances For
    def Cslib.Logic.RealArithmetic.instDecidableEqTerm.decEq {n✝ : ℕ} (x✝ x✝¹ : Term n✝) :
    Decidable (x✝ = x✝¹)
    @[instance_reducible]
    @[instance_reducible]

    Evaluate an integer polynomial expression at a real assignment x.

    A Boolean formula compares polynomial expressions with zero, using equality or strict inequality, and combines these assertions by negation, conjunction, and disjunction. ETR existentially quantifies all occurring variables; a free formula describes a subset of real coordinate space.

    Instances For
      @[instance_reducible]

      A formula describes a solution set in ℝⁿ, represented by Fin n → ℝ. Negation, conjunction, and disjunction give complement, intersection, and union.

      def Cslib.Logic.RealArithmetic.Term.rename {n m : ℕ} (f : Fin n → Fin m) :
      Term n → Term m

      Rename the variables in an expression.

      @[simp]
      theorem Cslib.Logic.RealArithmetic.Term.eval_rename {n m : ℕ} (f : Fin n → Fin m) (x : Fin m → ℝ) (t : Term n) :
      eval x (rename f t) = eval (x ∘ f) t

      Interpret an expression as a mathematical polynomial with integer coefficients.

      Rename the free coordinates of a formula.

      @[simp]
      theorem Cslib.Logic.RealArithmetic.Formula.solutionSet_rename {n m : ℕ} (f : Fin n → Fin m) (p : Formula n) :
      (rename f p).solutionSet = (fun (x : Fin m → ℝ) => x ∘ f) ⁻¹' p.solutionSet

      A renamed formula holds exactly when the original holds on the selected coordinates.

      The existential assignments for which a formula holds for every universal assignment. The existential coordinates precede the universal coordinates; either block may be empty.

      An injective renaming preserves whether the real solution set is nonempty.

      Adding unused universal coordinates preserves every existential solution.