Mode of #cas

solve

Every real solution of a polynomial equation or system, with a theorem that the list is complete.

#cas [solve x] (lhs = rhs)
describes every real solution of a polynomial equation in x and proves that the description is complete.
#cas [solve x, y, …] (e₁ ∧ … ∧ eₘ)
lists every real solution of a system of equations in several unknowns, linear or polynomial, and proves that the list is complete.

solve finds all real solutions of a supported equation and proves that the list is complete. Checking that a value solves the equation is easy, since you can plug it back in. Knowing that you haven’t missed one is the harder half, and that is the half I wanted proved. So the theorem is an equivalence: the equation holds exactly when x is one of the printed values. False means that there is no real solution, and True that every real number is one.

Up to degree 2 the roots are written with square roots. From degree 3 on, a rational root is written exactly, and an irrational one as a named algebraic number ρ0, ρ1, … with an interval of width at most 10−8 that contains no other root.

Details and Options

  • For one unknown the theorem is ∀ x : ℝ, lhs = rhs ↔ P x, where P x is x = r₁ ∨ … ∨ x = rₖ, True or False. A multiple root is listed once.
  • lhs and rhs are polynomials in x alone with rational coefficients, of any degree. From degree 3 on, the search for the real roots works with cells, intervals with no root or exactly one, and an equation that needs more than 1024 cells is refused. An irrational root of an equation of degree 3 or more is AlgRoot.real a lo hi, the only root of the polynomial with coefficient list a in (lo,hi), and the theorem also states lo < AlgRoot.real a lo hi < hi.
  • A system is a conjunction of equations, with two or more unknowns in brackets, and the theorem is ∀ x y … : ℝ, e₁ ∧ … ∧ eₘ ↔ S for the printed solutions S.
  • A linear system with rational coefficients is solved by exact elimination, with free parameters when it has infinitely many solutions.
  • A square linear system whose coefficients are polynomials in one parameter is solved by the cases of the parameter. Its theorem covers every real value of the parameter when the determinant is constant or splits into rational linear factors. Otherwise the real roots of the remaining factor of the determinant are not treated, and the report says so. A system whose determinant vanishes for every value of the parameter is refused.
  • A polynomial system with finitely many complex solutions goes through a lexicographic Gröbner basis and the certified real roots of its eliminant, the polynomial of the basis in a single unknown or in one combination of the unknowns. The theorem names those roots with intervals of width at most 10−20. In the output, … marks a coordinate truncated from its enclosure, and ≈ a decimal value of the exact formula in the theorem. A system with a repeated complex solution may be refused: the search can then fail to find a basis of the form it needs.
  • There are no options. In a proof, cas proves the equivalence for one unknown. For inequalities, reduce is the mode, and for equations with other functions, findRoot certifies a root in an interval.
  • With CASOracle.Solve imported, #cas [solve x, y, oracle := sympy] (e₁ ∧ e₂) asks an external system for the real solutions of a system of equations. sage and giac work the same way. Lean proves that each solution satisfies every equation, with nonzero denominators, and does not check that the list is complete. See oracle.

Examples (19)#

Basic Examples (3)

A quadratic equation:

In[1]:=
#cas [solve x] (x ^ 2 = 1)
Out[1]=

equivalent real solution predicate

x=1∨x=−1
x = 1 ∨ x = -1
Input (real relation)
(x ^ 2 = 1)

Checked by Lean’s kernel: Complete solution predicate for every real value

∀ (x : ℝ), x ^ 2 = 1 ↔ x = 1 ∨ x = -1
The certificate: 1 checked step
  1. Complete solution predicate for every real value

    ∀ (x : ℝ), x ^ 2 = 1 ↔ x = 1 ∨ x = -1

    Checked by Lean’s kernel

The computation
  • Guarantee: the input and output are equivalent for every real value

A cubic with one irrational root, named ρ0 with its interval:

In[2]:=
#cas [solve x] (x ^ 3 - 2 = 0)
Out[2]=

equivalent real solution predicate

x=ρ0
x = ρ0
Input (real relation)
(x ^ 3 - 2 = 0)
ρ0
the root of x^3 - 2 in (1.25992104, 1.25992105)

Checked by Lean’s kernel: Complete list of real solutions

(125992104 / 10 ^ 8 < CAS.AlgRoot.real [-2, 0, 0, 1] (125992104 / 10 ^ 8) (125992105 / 10 ^ 8) ∧
    CAS.AlgRoot.real [-2, 0, 0, 1] (125992104 / 10 ^ 8) (125992105 / 10 ^ 8) < 125992105 / 10 ^ 8) ∧
  ∀ (x : ℝ), x ^ 3 - 2 = 0 ↔ x = CAS.AlgRoot.real [-2, 0, 0, 1] (125992104 / 10 ^ 8) (125992105 / 10 ^ 8)

from CAS.Polynomial.RealRoot.solve_of_solveCheck

The certificate: 1 checked step
  1. Complete list of real solutions

    (125992104 / 10 ^ 8 < CAS.AlgRoot.real [-2, 0, 0, 1] (125992104 / 10 ^ 8) (125992105 / 10 ^ 8) ∧
        CAS.AlgRoot.real [-2, 0, 0, 1] (125992104 / 10 ^ 8) (125992105 / 10 ^ 8) < 125992105 / 10 ^ 8) ∧
      ∀ (x : ℝ), x ^ 3 - 2 = 0 ↔ x = CAS.AlgRoot.real [-2, 0, 0, 1] (125992104 / 10 ^ 8) (125992105 / 10 ^ 8)

    Checked by Lean’s kernel · CAS.Polynomial.RealRoot.solve_of_solveCheck

The computation
  • Certified roots

    Square-free polynomial of degree 3, Cauchy bound 3, 4 cells
    Guarantee: the input and output are equivalent for every real value; each ρj is the algebraic number AlgRoot.real a lo hi, the only root of x^3 - 2 in the interval (lo, hi)

A linear system, with the theorem about all pairs (x,y):

In[3]:=
#cas [solve x, y] (2*x + y = 1 ∧ x - y = 2)
Out[3]=

unique solution

x=1∧y=−1
x = 1 ∧ y = -1
Input (linear system)
(2*x + y = 1 ∧ x - y = 2)

Checked by Lean’s kernel: Equivalence with the solved form for every real assignment

∀ (x y : ℝ), 2 * x + y = 1 ∧ x - y = 2 ↔ x = 1 ∧ y = -1
The certificate: 1 checked step
  1. Equivalence with the solved form for every real assignment

    ∀ (x y : ℝ), 2 * x + y = 1 ∧ x - y = 2 ↔ x = 1 ∧ y = -1

    Checked by Lean’s kernel

Scope (8)

Square roots from the quadratic formula:

In[4]:=
#cas [solve x] (x ^ 2 = 2)
Out[4]=

equivalent real solution predicate

x=2∨x=−2
x = sqrt(2) ∨ x = -sqrt(2)
Input (real relation)
(x ^ 2 = 2)

Checked by Lean’s kernel: Complete solution predicate for every real value

∀ (x : ℝ), x ^ 2 = 2 ↔ x = √2 ∨ x = -√2
The certificate: 1 checked step
  1. Complete solution predicate for every real value

    ∀ (x : ℝ), x ^ 2 = 2 ↔ x = √2 ∨ x = -√2

    Checked by Lean’s kernel

The computation
  • Guarantee: the input and output are equivalent for every real value

No real solution gives False, and every real number gives True:

In[5]:=
#cas [solve x] (x ^ 2 + 1 = 0)
Out[5]=

equivalent real solution predicate

False
Input (real relation)
(x ^ 2 + 1 = 0)

Checked by Lean’s kernel: Complete solution predicate for every real value

∀ (x : ℝ), x ^ 2 + 1 = 0 ↔ False
The certificate: 1 checked step
  1. Complete solution predicate for every real value

    ∀ (x : ℝ), x ^ 2 + 1 = 0 ↔ False

    Checked by Lean’s kernel

The computation
  • Guarantee: the input and output are equivalent for every real value
In[6]:=
#cas [solve x] (x = x)
Out[6]=

equivalent real solution predicate

True
Input (real relation)
(x = x)

Checked by Lean’s kernel: Complete solution predicate for every real value

∀ (x : ℝ), x = x ↔ True
The certificate: 1 checked step
  1. Complete solution predicate for every real value

    ∀ (x : ℝ), x = x ↔ True

    Checked by Lean’s kernel

The computation
  • Guarantee: the input and output are equivalent for every real value

Three unknowns:

In[7]:=
#cas [solve x, y, z] (x + y + z = 6 ∧ x - y = 0 ∧ x + 2*z = 7)
Out[7]=

unique solution

x=53∧y=53∧z=83
x = 5/3 ∧ y = 5/3 ∧ z = 8/3
Input (linear system)
(x + y + z = 6 ∧ x - y = 0 ∧ x + 2*z = 7)

Checked by Lean’s kernel: Equivalence with the solved form for every real assignment

∀ (x y z : ℝ), x + y + z = 6 ∧ x - y = 0 ∧ x + 2 * z = 7 ↔ x = 5 / 3 ∧ y = 5 / 3 ∧ z = 8 / 3
The certificate: 1 checked step
  1. Equivalence with the solved form for every real assignment

    ∀ (x y z : ℝ), x + y + z = 6 ∧ x - y = 0 ∧ x + 2 * z = 7 ↔ x = 5 / 3 ∧ y = 5 / 3 ∧ z = 8 / 3

    Checked by Lean’s kernel


A system with a free parameter, and one with no solution:

In[8]:=
#cas [solve x, y, z] (x + y + z = 1 ∧ x - z = 2)
Out[8]=

solutions with free parameters [z]

x=2+z∧y=−1−2z
x = 2 + z ∧ y = -1 - 2*z
Input (linear system)
(x + y + z = 1 ∧ x - z = 2)

Checked by Lean’s kernel: Equivalence with the solved form for every real assignment

∀ (x y z : ℝ), x + y + z = 1 ∧ x - z = 2 ↔ x = 2 + z ∧ y = -1 - 2 * z
The certificate: 1 checked step
  1. Equivalence with the solved form for every real assignment

    ∀ (x y z : ℝ), x + y + z = 1 ∧ x - z = 2 ↔ x = 2 + z ∧ y = -1 - 2 * z

    Checked by Lean’s kernel

In[9]:=
#cas [solve x, y, z] (x + y + z = 6 ∧ x - y = 0 ∧ 2*x + z = 5)
Out[9]=

equivalent real solution predicate

False
Input (linear system)
(x + y + z = 6 ∧ x - y = 0 ∧ 2*x + z = 5)

Checked by Lean’s kernel: The system has no real solution

∀ (x y z : ℝ), x + y + z = 6 ∧ x - y = 0 ∧ 2 * x + z = 5 → False
The certificate: 1 checked step
  1. The system has no real solution

    ∀ (x y z : ℝ), x + y + z = 6 ∧ x - y = 0 ∧ 2 * x + z = 5 → False

    Checked by Lean’s kernel


A parameter in the coefficients. The answer splits into the cases a≠±1, a=1 and a=−1:

In[10]:=
#cas [solve x, y] (a*x + y = 1 ∧ x + a*y = 1)
Out[10]=

solution by cases of the parameter

x = 1/(a + 1) ∧ y = 1/(a + 1) for a ≠ 1 ∧ a ≠ -1; a = 1: x = 1 - y; a = -1: no solution
Domain
(x, y) ∈ ℝ^2, a ∈ ℝ
Input (linear system with the parameter a)
(a*x + y = 1 ∧ x + a*y = 1)

Checked by Lean’s kernel: The solution for every value of the parameter

(∀ (a x y : ℝ),
    a ≠ 1 → a ≠ -1 → (a * x + y = 1 ∧ x + a * y = 1 ↔ x = 1 / (a + 1) ∧ y = 1 / (a + 1))) ∧
  (∀ (a x y : ℝ), a = 1 → (a * x + y = 1 ∧ x + a * y = 1 ↔ x = 1 - y)) ∧
    ∀ (a x y : ℝ), a = -1 → ¬(a * x + y = 1 ∧ x + a * y = 1)
The certificate: 1 checked step
  1. The solution for every value of the parameter

    (∀ (a x y : ℝ),
        a ≠ 1 → a ≠ -1 → (a * x + y = 1 ∧ x + a * y = 1 ↔ x = 1 / (a + 1) ∧ y = 1 / (a + 1))) ∧
      (∀ (a x y : ℝ), a = 1 → (a * x + y = 1 ∧ x + a * y = 1 ↔ x = 1 - y)) ∧
        ∀ (a x y : ℝ), a = -1 → ¬(a * x + y = 1 ∧ x + a * y = 1)

    Checked by Lean’s kernel


A polynomial system with four rational solutions:

In[11]:=
#cas [solve x, y] (x^2 + y^2 = 5 ∧ x * y = 2)
Out[11]=

complete list of real solutions

{x=−1, y=−2},{x=−2, y=−1},{x=2, y=1},{x=1, y=2}
{x = -1, y = -2}, {x = -2, y = -1}, {x = 2, y = 1}, {x = 1, y = 2}
Input (polynomial system)
(x^2 + y^2 = 5 ∧ x * y = 2)

Checked by Lean’s kernel: Complete list of real solutions

∀ (x y : ℝ),
  x ^ 2 + y ^ 2 = 5 ∧ x * y = 2 ↔ x = -1 ∧ y = -2 ∨ x = -2 ∧ y = -1 ∨ x = 2 ∧ y = 1 ∨ x = 1 ∧ y = 2
The certificate: 1 checked step
  1. Complete list of real solutions

    ∀ (x y : ℝ),
      x ^ 2 + y ^ 2 = 5 ∧ x * y = 2 ↔ x = -1 ∧ y = -2 ∨ x = -2 ∧ y = -1 ∨ x = 2 ∧ y = 1 ∨ x = 1 ∧ y = 2

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    lexicographic basis in shape position with respect to y; eliminant of degree 4, 4 real roots, 4 polynomials in the derivation

The circle and the parabola y=x2 meet at two irrational points:

In[12]:=
#cas [solve x, y] (x^2 + y^2 = 1 ∧ y = x^2)
Out[12]=

complete list of real solutions

{x=−0.78615137775742328606…, y≈0.618033988749895},{x=0.78615137775742328606…, y≈0.618033988749895}
{x = -0.78615137775742328606…, y ≈ 0.618033988749895}, {x = 0.78615137775742328606…, y ≈ 0.618033988749895}
Input (polynomial system)
(x^2 + y^2 = 1 ∧ y = x^2)

Checked by Lean’s kernel: Complete list of real solutions

∃ ρ,
  ((-78615137775742328607 / 10 ^ 20 < ρ 0 ∧ ρ 0 < -78615137775742328606 / 10 ^ 20) ∧
      78615137775742328606 / 10 ^ 20 < ρ 1 ∧ ρ 1 < 78615137775742328607 / 10 ^ 20) ∧
    ∀ (x y : ℝ), x ^ 2 + y ^ 2 = 1 ∧ y = x ^ 2 ↔ x = ρ 0 ∧ y = ρ 0 ^ 2 ∨ x = ρ 1 ∧ y = ρ 1 ^ 2
The certificate: 1 checked step
  1. Complete list of real solutions

    ∃ ρ,
      ((-78615137775742328607 / 10 ^ 20 < ρ 0 ∧ ρ 0 < -78615137775742328606 / 10 ^ 20) ∧
          78615137775742328606 / 10 ^ 20 < ρ 1 ∧ ρ 1 < 78615137775742328607 / 10 ^ 20) ∧
        ∀ (x y : ℝ), x ^ 2 + y ^ 2 = 1 ∧ y = x ^ 2 ↔ x = ρ 0 ∧ y = ρ 0 ^ 2 ∨ x = ρ 1 ∧ y = ρ 1 ^ 2

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    lexicographic basis in shape position with respect to x; eliminant of degree 4, 2 real roots, 3 polynomials in the derivation

Three unknowns, two of them fixed by the third:

In[13]:=
#cas [solve x, y, z] (x^2 + y^2 + z^2 = 3 ∧ x = y ∧ y = z)
Out[13]=

complete list of real solutions

{x=−1, y=−1, z=−1},{x=1, y=1, z=1}
{x = -1, y = -1, z = -1}, {x = 1, y = 1, z = 1}
Input (polynomial system)
(x^2 + y^2 + z^2 = 3 ∧ x = y ∧ y = z)

Checked by Lean’s kernel: Complete list of real solutions

∀ (x y z : ℝ),
  x ^ 2 + y ^ 2 + z ^ 2 = 3 ∧ x = y ∧ y = z ↔ x = -1 ∧ y = -1 ∧ z = -1 ∨ x = 1 ∧ y = 1 ∧ z = 1
The certificate: 1 checked step
  1. Complete list of real solutions

    ∀ (x y z : ℝ),
      x ^ 2 + y ^ 2 + z ^ 2 = 3 ∧ x = y ∧ y = z ↔ x = -1 ∧ y = -1 ∧ z = -1 ∨ x = 1 ∧ y = 1 ∧ z = 1

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    lexicographic basis in shape position with respect to z; eliminant of degree 2, 2 real roots, 5 polynomials in the derivation

Applications (1)

The equivalence for one unknown in a proof. cas proves it, and only the three standard axioms are used:

In[14]:=
theorem solve_square : ∀ x : ℝ, x ^ 2 = 1 ↔ x = 1 ∨ x = -1 := by
  cas

#print axioms solve_square
Out[14]=

solve_square depends on the axioms propext, Classical.choice, Quot.sound.

Properties and Relations (1)

For an inequality, reduce gives the equivalent condition, here between the two roots of x2=2:

In[15]:=
#cas [reduce x] (x^2 < 2)
Out[15]=

equivalent condition on the real roots

ρ0 < x < ρ1, where ρ0 = -1.41421356237309504880…, ρ1 = 1.41421356237309504880…
Input (polynomial relation)
(x^2 < 2)

Checked by Lean’s kernel: Solution set for every real value

∃ ρ,
  ((-141421356237309504881 / 10 ^ 20 < ρ 0 ∧ ρ 0 < -141421356237309504880 / 10 ^ 20) ∧
      141421356237309504880 / 10 ^ 20 < ρ 1 ∧ ρ 1 < 141421356237309504881 / 10 ^ 20) ∧
    ∀ (x : ℝ), x ^ 2 < 2 ↔ ρ 0 < x ∧ x < ρ 1
The certificate: 1 checked step
  1. Solution set for every real value

    ∃ ρ,
      ((-141421356237309504881 / 10 ^ 20 < ρ 0 ∧ ρ 0 < -141421356237309504880 / 10 ^ 20) ∧
          141421356237309504880 / 10 ^ 20 < ρ 1 ∧ ρ 1 < 141421356237309504881 / 10 ^ 20) ∧
        ∀ (x : ℝ), x ^ 2 < 2 ↔ ρ 0 < x ∧ x < ρ 1

    Checked by Lean’s kernel

The computation
  • Certified roots

    2 real roots of the polynomial, 6 cells; cuts [-3,
     -1767766952966368811/1250000000000000000,
     3]; signs [true, false, true]

Possible Issues (4)

Only polynomial equations. For other equations, the message points to findRoot:

In[16]:=
#cas [solve x] (sin x = 0)
Out[16]=

Error

supported fragment: polynomials with rational coefficients in one real variable; for other equations, #cas [findRoot x in [a, b]] (f = g) finds a certified root in an interval

An inequality is not an equation, and the message points to reduce:

In[17]:=
#cas [solve x] (x < 1)
Out[17]=

Error

solve expects an equation; use reduce for a comparison

A circle alone has infinitely many points, and the nonlinear solver needs finitely many complex solutions:

In[18]:=
#cas [solve x, y] (x^2 + y^2 = 1)
Out[18]=

Error

solve: the system has infinitely many complex solutions; the nonlinear solver takes systems with finitely many

A system with a repeated complex solution may be refused, as this one is. The method needs the complex solutions to be distinct in one combination of the unknowns:

In[19]:=
#cas [solve x, y] (x^2 = 0 ∧ y^2 = 0)
Out[19]=

Error

solve: no separating form x + c*y with c ≤ 7 gives a Gröbner basis in shape position, so the system has a repeated complex solution

Neat Examples (2)

The real and imaginary parts of (x+iy)3=1. The three solutions are the cube roots of unity:

In[20]:=
#cas [solve x, y] (x^3 - 3*x*y^2 = 1 ∧ 3*x^2*y - y^3 = 0)
Out[20]=

complete list of real solutions

{x≈−0.5, y≈−0.866025403784439},{x≈−0.5, y≈0.866025403784439},{x=1, y=0}
{x ≈ -0.5, y ≈ -0.866025403784439}, {x ≈ -0.5, y ≈ 0.866025403784439}, {x = 1, y = 0}
Input (polynomial system)
(x^3 - 3*x*y^2 = 1 ∧ 3*x^2*y - y^3 = 0)

Checked by Lean’s kernel: Complete list of real solutions

∃ ρ,
  ((-136602540378443864677 / 10 ^ 20 < ρ 0 ∧ ρ 0 < -136602540378443864676 / 10 ^ 20) ∧
      36602540378443864676 / 10 ^ 20 < ρ 1 ∧ ρ 1 < 36602540378443864677 / 10 ^ 20) ∧
    ∀ (x y : ℝ),
      x ^ 3 - 3 * x * y ^ 2 = 1 ∧ 3 * x ^ 2 * y - y ^ 3 = 0 ↔
        x = 8 / 9 * ρ 0 ^ 7 + 14 / 9 * ρ 0 ^ 4 - 13 / 9 * ρ 0 ∧
            y = -(8 / 9 * ρ 0 ^ 7) - 14 / 9 * ρ 0 ^ 4 + 22 / 9 * ρ 0 ∨
          x = 8 / 9 * ρ 1 ^ 7 + 14 / 9 * ρ 1 ^ 4 - 13 / 9 * ρ 1 ∧
              y = -(8 / 9 * ρ 1 ^ 7) - 14 / 9 * ρ 1 ^ 4 + 22 / 9 * ρ 1 ∨
            x = 1 ∧ y = 0
The certificate: 1 checked step
  1. Complete list of real solutions

    ∃ ρ,
      ((-136602540378443864677 / 10 ^ 20 < ρ 0 ∧ ρ 0 < -136602540378443864676 / 10 ^ 20) ∧
          36602540378443864676 / 10 ^ 20 < ρ 1 ∧ ρ 1 < 36602540378443864677 / 10 ^ 20) ∧
        ∀ (x y : ℝ),
          x ^ 3 - 3 * x * y ^ 2 = 1 ∧ 3 * x ^ 2 * y - y ^ 3 = 0 ↔
            x = 8 / 9 * ρ 0 ^ 7 + 14 / 9 * ρ 0 ^ 4 - 13 / 9 * ρ 0 ∧
                y = -(8 / 9 * ρ 0 ^ 7) - 14 / 9 * ρ 0 ^ 4 + 22 / 9 * ρ 0 ∨
              x = 8 / 9 * ρ 1 ^ 7 + 14 / 9 * ρ 1 ^ 4 - 13 / 9 * ρ 1 ∧
                  y = -(8 / 9 * ρ 1 ^ 7) - 14 / 9 * ρ 1 ^ 4 + 22 / 9 * ρ 1 ∨
                x = 1 ∧ y = 0

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    lexicographic basis in shape position with respect to the separating form x + y; eliminant of degree 9, 3 real roots, 11 polynomials in the derivation

The four points (±1/2,±1/2) share their coordinates in pairs, so neither x nor y tells them apart, and the report separates them by x+2y:

In[21]:=
#cas [solve x, y] (x^2 + y^2 = 1 ∧ x^2 - y^2 = 0)
Out[21]=

complete list of real solutions

{x≈−0.707106781186548, y≈−0.707106781186548},{x≈0.707106781186548, y≈−0.707106781186548},{x≈−0.707106781186548, y≈0.707106781186548},{x≈0.707106781186548, y≈0.707106781186548}
{x ≈ -0.707106781186548, y ≈ -0.707106781186548}, {x ≈ 0.707106781186548, y ≈ -0.707106781186548}, {x ≈ -0.707106781186548, y ≈ 0.707106781186548}, {x ≈ 0.707106781186548, y ≈ 0.707106781186548}
Input (polynomial system)
(x^2 + y^2 = 1 ∧ x^2 - y^2 = 0)

Checked by Lean’s kernel: Complete list of real solutions

∃ ρ,
  ((-212132034355964257321 / 10 ^ 20 < ρ 0 ∧ ρ 0 < -212132034355964257320 / 10 ^ 20) ∧
      (-70710678118654752441 / 10 ^ 20 < ρ 1 ∧ ρ 1 < -70710678118654752440 / 10 ^ 20) ∧
        (70710678118654752440 / 10 ^ 20 < ρ 2 ∧ ρ 2 < 70710678118654752441 / 10 ^ 20) ∧
          212132034355964257320 / 10 ^ 20 < ρ 3 ∧ ρ 3 < 212132034355964257321 / 10 ^ 20) ∧
    ∀ (x y : ℝ),
      x ^ 2 + y ^ 2 = 1 ∧ x ^ 2 - y ^ 2 = 0 ↔
        x = 1 / 3 * ρ 0 ^ 3 - 7 / 6 * ρ 0 ∧ y = -(1 / 6 * ρ 0 ^ 3) + 13 / 12 * ρ 0 ∨
          x = 1 / 3 * ρ 1 ^ 3 - 7 / 6 * ρ 1 ∧ y = -(1 / 6 * ρ 1 ^ 3) + 13 / 12 * ρ 1 ∨
            x = 1 / 3 * ρ 2 ^ 3 - 7 / 6 * ρ 2 ∧ y = -(1 / 6 * ρ 2 ^ 3) + 13 / 12 * ρ 2 ∨
              x = 1 / 3 * ρ 3 ^ 3 - 7 / 6 * ρ 3 ∧ y = -(1 / 6 * ρ 3 ^ 3) + 13 / 12 * ρ 3
The certificate: 1 checked step
  1. Complete list of real solutions

    ∃ ρ,
      ((-212132034355964257321 / 10 ^ 20 < ρ 0 ∧ ρ 0 < -212132034355964257320 / 10 ^ 20) ∧
          (-70710678118654752441 / 10 ^ 20 < ρ 1 ∧ ρ 1 < -70710678118654752440 / 10 ^ 20) ∧
            (70710678118654752440 / 10 ^ 20 < ρ 2 ∧ ρ 2 < 70710678118654752441 / 10 ^ 20) ∧
              212132034355964257320 / 10 ^ 20 < ρ 3 ∧ ρ 3 < 212132034355964257321 / 10 ^ 20) ∧
        ∀ (x y : ℝ),
          x ^ 2 + y ^ 2 = 1 ∧ x ^ 2 - y ^ 2 = 0 ↔
            x = 1 / 3 * ρ 0 ^ 3 - 7 / 6 * ρ 0 ∧ y = -(1 / 6 * ρ 0 ^ 3) + 13 / 12 * ρ 0 ∨
              x = 1 / 3 * ρ 1 ^ 3 - 7 / 6 * ρ 1 ∧ y = -(1 / 6 * ρ 1 ^ 3) + 13 / 12 * ρ 1 ∨
                x = 1 / 3 * ρ 2 ^ 3 - 7 / 6 * ρ 2 ∧ y = -(1 / 6 * ρ 2 ^ 3) + 13 / 12 * ρ 2 ∨
                  x = 1 / 3 * ρ 3 ^ 3 - 7 / 6 * ρ 3 ∧ y = -(1 / 6 * ρ 3 ^ 3) + 13 / 12 * ρ 3

    Checked by Lean’s kernel

The computation
  • Gröbner basis

    lexicographic basis in shape position with respect to the separating form x + 2*y; eliminant of degree 4, 4 real roots, 8 polynomials in the derivation

See Also

reduce · roots · findRoot · linearSolve · groebner · cas