Options

Options

The settings of cas, cega and #cas: the budget of a call, what a report shows, and the trace classes.

set_option name value in command
sets an option for one command, declaration or tactic.
set_option name value
sets it to the end of the section or file.
set_option trace.class true in command
prints the messages of a trace class under the call.

SymLean works within budgets, because I’d rather have an expensive call stop and say so than hang. When a call would need more work than its budget allows, it stops, and the message names the budget. A box query that is too big is refused before the kernel starts, so it fails at once instead of stalling a build. Two more options choose what a report shows, and the trace classes print the steps of a route.

Details and Options

  • An option is an ordinary Lean option. With in it holds for the next command, and without it to the end of the section or file.
  • A trace class is an option whose name starts with trace.. Set to true, it prints its messages under the call, in the InfoView (the editor panel where Lean shows its messages) and in the output of lake build.
  • Heartbeats are Lean’s count of the work of a command, and Lean’s option maxHeartbeats is their limit.

Options of cas and #cas#

OptionDefaultWhat it sets
cas.verbosefalseShows the full report under a suggestion of cas? and cega?, and the derivation trees of #cas reports.
cas.suggestfalseOffers the first checked statement of a #cas report as an example to paste in place of the command.
cas.maxDigits2000The most decimal digits that a #cas command or a CEGA query may ask for.
cas.maxDerivativeSteps512The most goals that a proof by the derivative rules may have. The goals of a failed attempt are not counted.
cas.grindHeartbeats20000The heartbeats, in thousands, of the grind and norm_num fallbacks of bare cas. 0 turns them off.
cas.maxReadBackWork100000The most read-back steps for checked data over variable types other than Fin.

Options of cega#

OptionDefaultWhat it sets
cega.maxRefinementWork4096The most planner calls of a subdivided query, estimated before any kernel work. Raising it permits a larger search and never changes the depth.
cega.maxPrecision256The largest Taylor order, number of logarithm terms or number of square-root digits in a query.
cega.maxDimension8The most coordinates of a box query.
cega.maxFaceReductions5The most nested reductions by monotonicity. Each one roughly doubles the kernel work.
cega.maxIntegrationPanels256The most panels of the doubling search of bare cega on an integral. (panels := n) is not capped.
cega.arithmetic"exact"The arithmetic in which cega and cega? compute their enclosures: "exact" for integers and rationals, or an IEEE binary format of FloatLib, such as "binary64", "binary128" or "binary(p := 113, emax := 16383)", for intervals with float ends, rounded outward and checked in the kernel. A call overrides it with [use_floats := false], [use_floats := true] or (arith := F). A project sets it for a whole build with weak.cega.arithmetic in the Lean options of its lakefile, as Certificates shows. cas and #cas compute with exact rationals whatever its value.
cega.nativeCertificatesfalseLets cega [fast] and cega [fast, batch := n] check finite certificates with compiled code, which also trusts Lean’s compiler. The tests of the certificates of any size follow it too: cert_eval, and with it cert_shard, cert_cond, cert_scalar, cert_decide and cert_reduce. lake build -R -Kcertificates=fast builds SymLean with it on.

Options of the optional libraries#

OptionDefaultWhat it sets
cas.oracle.timeout120000With CASOracle: the deadline of one oracle run, in milliseconds.

Trace classes#

Trace classWhat it prints
trace.cega.statedEach kernel check of a stated bound, and its outcome. A check in a float arithmetic names the format, as in bound query in binary64.
trace.cega.integrationFor bare cega on an integral: the panel count, the method and the precision of the quadrature, and the enclosure.
trace.cega.nativeThe stages of a finite native certificate.
trace.cas.fallbackThe complete diagnostics of the grind and norm_num fallbacks in a failure report of cas.
trace.cas.derivativeRulesThe rules tried on each HasDerivAt goal, and the error of each rule that fails.
trace.cas.validationThe validation of a proof before it closes a goal, and the replay of a cas? or cega? suggestion.
trace.cas.profileKernel evaluations, proof validations and axiom checks, each as a profile node of its own. trace.profiler shows them too.

Examples (13)#

Basic Examples (3)

cas.suggest turns a report into an example to paste in place of the command:

In[1]:=
set_option cas.suggest true in
#cas [derive x] (tan x)
Out[1]=
1cos2(x)
1/cos(x)^2
Conditions
cos(x)≠0

Checked by Lean’s kernel: Derivative of the input

∀ (x : ℝ), Real.cos x ≠ 0 → HasDerivAt (fun x ↦ Real.tan x) (1 / Real.cos x ^ 2) x

from CAS.Command.hasDerivAt_of_displayRoute

The certificate: 5 checked steps
  1. Derivative of the input

    ∀ (x : ℝ), Real.cos x ≠ 0 → HasDerivAt (fun x ↦ Real.tan x) (1 / Real.cos x ^ 2) x

    Checked by Lean’s kernel · CAS.Command.hasDerivAt_of_displayRoute

  2. Partial derivative in x: indexed rules compute Expr.diff

    (CAS.Verified.Expr.DiffDerivation.build 0 (𝕏[0].sin.div 𝕏[0].cos)).rawDerivative =
      CAS.Verified.Expr.diff 0 (𝕏[0].sin.div 𝕏[0].cos)

    Checked by Lean’s kernel · CAS.Verified.Expr.DiffDerivation.rawDerivative_eq_diff

  3. Partial derivative in x: normalization preserves evaluation

    ∀ (ρ : Fin 1 → ℝ),
      CAS.Verified.Expr.eval ρ
          (CAS.Verified.Expr.DiffDerivation.build 0 (𝕏[0].sin.div 𝕏[0].cos)).simplifiedDerivative =
        CAS.Verified.Expr.eval ρ (CAS.Verified.Expr.DiffDerivation.build 0 (𝕏[0].sin.div 𝕏[0].cos)).rawDerivative

    Checked by Lean’s kernel · CAS.Verified.Expr.DiffDerivation.eval_simplifiedDerivative_eq_rawDerivative

  4. Partial derivative in x: side-conditioned display normalization

    ∀ (ρ : Fin 1 → ℝ),
      CAS.Verified.Expr.Alg.SideHolds ρ
          (CAS.Command.displayDerivativeRoute
              (CAS.Verified.Expr.DiffDerivation.build 0 (𝕏[0].sin.div 𝕏[0].cos))).nonzero →
        CAS.Verified.Expr.eval ρ
            (CAS.Command.displayDerivativeRoute
                (CAS.Verified.Expr.DiffDerivation.build 0 (𝕏[0].sin.div 𝕏[0].cos))).rhs =
          CAS.Verified.Expr.eval ρ
            (CAS.Verified.Expr.DiffDerivation.build 0 (𝕏[0].sin.div 𝕏[0].cos)).simplifiedDerivative

    Checked by Lean’s kernel · CAS.Command.displayDerivativeRoute_sound

  5. Partial derivative in x: analytic semantics of the displayed result

    ∀ (x : ℝ^1),
      CAS.Verified.Expr.ValidAt x.ofLp (𝕏[0].sin.div 𝕏[0].cos) →
        CAS.Verified.Expr.Alg.SideHolds x.ofLp
            (CAS.Command.displayDerivativeRoute
                (CAS.Verified.Expr.DiffDerivation.build 0 (𝕏[0].sin.div 𝕏[0].cos))).nonzero →
          (fderiv ℝ (fun y ↦ CAS.Verified.Expr.eval y.ofLp (𝕏[0].sin.div 𝕏[0].cos)) x) (EuclideanSpace.single 0 1) =
            CAS.Verified.Expr.eval x.ofLp
              (CAS.Command.displayDerivativeRoute
                  (CAS.Verified.Expr.DiffDerivation.build 0 (𝕏[0].sin.div 𝕏[0].cos))).rhs

    Checked by Lean’s kernel · CAS.Command.fderiv_apply_single_eq_eval_displayDerivative

The computation
  • Variables: x
  • Analytic domain conditions

    Raw checked nonzero requirements: cos(x)
    Raw checked positivity requirements: (none)
  • Partial derivative in x

    • 1. Apply symbolic differentiation rules

      raw result: (cos(x)*1*cos(x) - sin(x)*-sin(x)*1)/cos(x)^2
    • 2. Normalize the symbolic derivative unconditionally

      normalized result: 1/cos(x)^2
    • 3. Apply checked side-conditioned cleanup

      displayed result: 1/cos(x)^2
      additional nonzero requirements: (none)

Try this

example (x : ℝ) (h : Real.cos x ≠ 0) :
      HasDerivAt (fun x ↦ Real.tan x) (1 / Real.cos x ^ 2) x := by
    cas

The suggestion, pasted:

In[2]:=
example (x : ℝ) (h : Real.cos x ≠ 0) :
    HasDerivAt (fun x ↦ Real.tan x) (1 / Real.cos x ^ 2) x := by
  cas
Out[2]=

Lean accepts the proof.


trace.cega.stated shows the bound that the kernel checked:

In[3]:=
set_option trace.cega.stated true in
example (x : ℝ) (h0 : 0 ≤ x) (h1 : x ≤ 1) : x * (1 - x) ≤ 1 / 4 := by
  cega
Out[3]=
[cega.stated] bound query, stated bound ≤ 1/4: checked by the kernel

Scope (3)

trace.cega.integration shows the quadrature behind a bound on an integral:

In[4]:=
set_option trace.cega.integration true in
example : |(∫ x in (0 : ℝ)..1, x ^ 2) - 1 / 3| ≤ 1 / 100 := by
  cega
Out[4]=
[cega.integration] 1 Simpson panels at the precision (16, 6, 12) put the integral in [0.33, 0.34]

cega.arithmetic sets the arithmetic of the cega calls after it. The trace names the format of the check:

In[5]:=
set_option cega.arithmetic "binary64" in
set_option trace.cega.stated true in
example (x : ℝ) (h0 : 0 ≤ x) (h1 : x ≤ 1) : Real.exp x ≤ 2.72 := by
  cega
Out[5]=

Lean accepts the proof.


cas.verbose shows the full report under a suggestion:

In[6]:=
set_option cas.verbose true in
example (x : ℝ) (h0 : 0 ≤ x) (h1 : x ≤ 1) : x * (1 - x) ≤ 1 / 4 := by
  cega?
Out[6]=

Try this

cega [enclose x in [0, 1]] (x * (1 - x))

[CAS.explanation] Proof evidence
  [CAS.explanation.checkedEvidence] Checked proof steps
    [CAS.explanation.checkedStep] final proof assigned to the original goal
      Proposition: x * (1 - x) ≤ 1 / 4
      Validation: completed proof checked by the elaborator; kernel check occurs when the declaration is accepted
  [CAS.explanation.plannerMetadata] Planner metadata (not proof)
    [CAS.explanation.plannerStep] CEGA route: checked box enclosure of an ordinary inequality: selected
    [CAS.explanation.plannerStep] arithmetic: exact rationals: selected

Options (1)

Without in, an option holds to the end of the section:

In[7]:=
section
set_option cas.suggest true

#cas [simplify] (x + x)

end
Out[7]=
2*x

Checked by Lean’s kernel: Identity with the simplified form

∀ (x : ℝ), x + x = 2 * x

from CAS.Command.eq_of_simplifyFinDisplayRoute

The certificate: 2 checked steps
  1. Identity with the simplified form

    ∀ (x : ℝ), x + x = 2 * x

    Checked by Lean’s kernel · CAS.Command.eq_of_simplifyFinDisplayRoute

  2. Simplification under generated rewrite assumptions

    ∀ (ρ : Fin 1 → ℝ),
      CAS.Verified.Expr.Alg.SideHolds ρ (𝕏[0].add 𝕏[0]).simplifyFinDisplayRoute.nonzero →
        CAS.Verified.Expr.eval ρ (𝕏[0].add 𝕏[0]).simplifyFinDisplayRoute.rhs =
          CAS.Verified.Expr.eval ρ (𝕏[0].add 𝕏[0]).simplifyFinDisplayRoute.lhs

    Checked by Lean’s kernel · CAS.Verified.Expr.SideClaimRoute.sound

The computation
  • Variables: x
  • Checked symbolic computation

    Raw checked nonzero requirements: (none)
    Guarantee: these assumptions justify conditional rewrites and preserve real evaluation

Try this

example (x : ℝ) : x + x = 2 * x := by cas

Applications (1)

Five bounds in one conjunction, each proved by cega. The trace shows the kind of query and the bound that each check proved:

In[8]:=
set_option trace.cega.stated true in
example (x : ℝ) (h0 : 0 ≤ x) (h1 : x ≤ 1) :
    x * (1 - x) < 1 / 3 ∧ 0 ≤ x * (1 - x) ∧ x * (1 - x) > -1 / 2 ∧ |x - 1 / 2| < 1 ∧
      3 / 10 ≥ x * (1 - x) :=
  ⟨by cega, by cega, by cega, by cega, by cega⟩
Out[8]=

Lean accepts the proof.

Properties and Relations (1)

The options in parentheses belong to one call, where set_option holds for a whole command. Here the digits of findRoot:

In[9]:=
#cas (digits := 30) [findRoot x in [1, 2]] (x^2 - 2)
Out[9]=

certified simple root

x=1.414213562373095048801688724210±10−30
x = 1.414213562373095048801688724210 ± 10^-30
Domain
x ∈ [1, 2]

Checked by Lean’s kernel: Unique root in the interval

∃! x,
  x ∈ Set.Icc (1414213562373095048801688724209 / 10 ^ 30) (1414213562373095048801688724211 / 10 ^ 30) ∧
    x ^ 2 - 2 = 0
The certificate: 1 checked step
  1. Unique root in the interval

    ∃! x,
      x ∈ Set.Icc (1414213562373095048801688724209 / 10 ^ 30) (1414213562373095048801688724211 / 10 ^ 30) ∧
        x ^ 2 - 2 = 0

    Checked by Lean’s kernel

The computation
  • Certified root

    Sign change found by interval sampling and bisection (not proof)
    Unique root in [1.414213562373095048801688724209, 1.414213562373095048801688724211], within 10^-30 of 1.414213562373095048801688724210: endpoint signs and a derivative of one sign, checked by the kernel

Possible Issues (3)

A fallback that runs out of its budget says so. Here grind gets a thousand heartbeats:

In[10]:=
set_option cas.grindHeartbeats 1 in
example (x : ℝ) (h₁ : x - 1 ≠ 0) (h₂ : x + 1 ≠ 0) :
    (x ^ 3 - 1) / (x ^ 2 - 1) = (x ^ 2 + x + 1) / (x + 1) := by
  cas
Out[10]=

Error

cas could not close this ordinary arithmetic goal.
This goal contains branch-sensitive operations and may need nonzero denominator hypotheses. Put those facts in the local context; pass one explicit fact as `cas using h` when needed. The corresponding `#cas [simplify]` report shows the exact generated conditions. Detected candidate conditions: x ^ 2 - 1 ≠ 0, x + 1 ≠ 0.
The rest of the message
Polynomial equation route:
  `grind` failed
  case grind
  x : ℝ
  h₁ : x - 1 ≠ 0
  h₂ : x + 1 ≠ 0
  h : ¬(x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ = x * (x + 1) + 1
  ⊢ False
  [grind] Goal diagnostics
    [facts] Asserted facts
      [prop] ¬x - 1 = 0
      [prop] ¬x + 1 = 0
      [prop] ¬(x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ = x * (x + 1) + 1
      [prop] if x ^ 2 - 1 = 0 then (x ^ 2 - 1)⁻¹ = 0 else (x ^ 2 - 1) * (x ^ 2 - 1)⁻¹ = 1
    [eqc] True propositions
      [prop] if x ^ 2 - 1 = 0 then (x ^ 2 - 1)⁻¹ = 0 else (x ^ 2 - 1) * (x ^ 2 - 1)⁻¹ = 1
    [eqc] False propositions
      [prop] x + 1 = 0
      [prop] (x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ = x * (x + 1) + 1
      [prop] x - 1 = 0
    [eqc] Equivalence classes
      [eqc] {1,
          (x + 1) * (x + 1)⁻¹,
          (x - 1) * (x - 1)⁻¹,
          ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1)) *
            ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹}
    [ematch] E-matching patterns
      [thm] Nat.pow_pos: [@HPow.hPow `[ℕ] `[ℕ] `[ℕ] `[instHPow] #2 #1]
      [thm] Nat.div_pow_of_pos: [@HPow.hPow `[ℕ] `[ℕ] `[ℕ] `[instHPow] #2 #1]
    [ring] Ring `ℝ`
      [basis] Basis
        [_] 2 * (x ^ 2 * (x ^ 2 - 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                            2 * (x * (x ^ 2 - 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                          -3 * ((x - 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                        (x + 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹ +
                      2 * ((x ^ 2 - 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                    -1 * (x - 1)⁻¹ +
                  (x + 1)⁻¹ +
                -2 * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹ =
              0
        [_] 6 * ((x - 1)⁻¹ ^ 2 * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                              -4 * (x * (x ^ 2 - 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                            -12 *
                              ((x - 1)⁻¹ * (x ^ 2 - 1)⁻¹ *
                                ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                          2 * (x - 1)⁻¹ ^ 2 +
                        3 * ((x - 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                      (x + 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹ +
                    -8 * ((x ^ 2 - 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                  -1 * (x - 1)⁻¹ +
                (x + 1)⁻¹ =
              0
        [_] 2 * ((x + 1)⁻¹ ^ 2 * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                            4 * (x * (x ^ 2 - 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                          4 *
                            ((x + 1)⁻¹ * (x ^ 2 - 1)⁻¹ *
                              ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                        2 * (x + 1)⁻¹ ^ 2 +
                      -3 * ((x - 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                    -1 * ((x + 1)⁻¹ * ((x ^ 3 - 1) * (x + 1) * (x ^ 2 - 1)⁻¹ - (x * (x + 1) + 1))⁻¹) +
                  -1 * (x - 1)⁻¹ +
                (x + 1)⁻¹ =
              0
        [_] x * (x - 1)⁻¹ + -1 * (x - 1)⁻¹ + -1 = 0
        [_] x * (x + 1)⁻¹ + (x + 1)⁻¹ + -1 = 0
        [_] 2 * ((x - 1)⁻¹ * (x + 1)⁻¹) + -1 * (x - 1)⁻¹ + (x + 1)⁻¹ = 0
    [limits] Thresholds reached
      [limit] maximum number of E-matching rounds has been reached, threshold: `(ematch := 0)`
      [limit] maximum number of case-splits has been reached, threshold: `(splits := 0)`
Checked identity route:
  cas could not prove the real analytic domain conditions.
  A denominator or logarithm argument may need to be nonzero, a square-root argument may need to be positive, or an inverse-trigonometric argument may need to avoid a branch endpoint. Supply the relevant ordinary hypothesis with `cas using h`.
  Unproved conditions:
    x * x + ↑(-1) ≠ 0
Grind fallback:
  grind did not finish within its budget of 1 thousand heartbeats (option `cas.grindHeartbeats`)

A box with nine coordinates is over cega.maxDimension. FloatLib’s interval, which cega tries next, has no such limit, and it proves x0+…+x8≤9 on [0,1]9. The bound below is sharp at xi=12, and interval evaluation does not reach it:

In[11]:=
example (x0 x1 x2 x3 x4 x5 x6 x7 x8 : ℝ) (h0 : x0 ∈ Set.Icc (0 : ℝ) 1)
    (h1 : x1 ∈ Set.Icc (0 : ℝ) 1) (h2 : x2 ∈ Set.Icc (0 : ℝ) 1) (h3 : x3 ∈ Set.Icc (0 : ℝ) 1)
    (h4 : x4 ∈ Set.Icc (0 : ℝ) 1) (h5 : x5 ∈ Set.Icc (0 : ℝ) 1) (h6 : x6 ∈ Set.Icc (0 : ℝ) 1)
    (h7 : x7 ∈ Set.Icc (0 : ℝ) 1) (h8 : x8 ∈ Set.Icc (0 : ℝ) 1) :
    x0 * (1 - x0) + x1 * (1 - x1) + x2 * (1 - x2) + x3 * (1 - x3) + x4 * (1 - x4) +
      x5 * (1 - x5) + x6 * (1 - x6) + x7 * (1 - x7) + x8 * (1 - x8) ≤ 9 / 4 := by
  cega
Out[11]=

Error

CEGA box query with 9 coordinates exceeds cega.maxDimension (8); bound fewer variables at once, or explicitly increase that resource budget
The rest of the message
Other routes:
  carrier search:
    cega found no registered checked carrier or direct certificate matching the target
  interval route:
    interval could not certify: the enclosure of (((((((((x0 * (1 - x0) + (x1 * (1 - x1))) + (x2 * (1 - x2))) + (x3 * (1 - x3))) + (x4 * (1 - …))) + …) + …) + …) + …) - …) is [-9/4, 11/4]; its upper endpoint does not establish ≤ 0.
    Box: x0 in [0, 1/2], x1 in [0, 1/2], x2 in [0, 1/2], x3 in [0, 1/2], x4 in [0, 1/2], x5 in [0, 1/2], … (3 more coordinates). Subdivision depth 8 exhausted after 8 splits on this branch.
    Try tighter input bounds or more subdivision depth.
Bare `cega` proves an ordinary real inequality (`f x ≤ c`, `f x < c`, `c ≤ f x`, `c < f x` (also with `≥` and `>`), `|f x| ≤ c`, `|f x| < c`, `a ≤ f x ∧ f x ≤ b` (also with `<`), `f x ∈ Set.Icc a b` (also `Set.Ioo`, `Set.Ico`, `Set.Ioc`), `f x ≤ g x`, `f x < g x`, and conjunctions of these, with `c`, `a`, `b` closed and every real variable bounded by hypotheses `a ≤ x` and `x ≤ b`, `x ∈ Set.Icc a b`, or `|x| ≤ r` with rational literal endpoints), a bound on an interval integral `∫ x in a..b, f x` with rational limits, a certificate goal (`EnclosedOn f s lo hi`, `BoundOn f s c`, `ApproxOn f g s ε`, `ResidualBound r s ε`) on a coordinate box or from a checked carrier in the local context or the goal, a closed decidable statement about floats, which `float_decide` decides, a real inequality that FloatLib's `interval` proves, on finite sums and norms too, and a closed goal that interval evaluation proves.

Twenty thousand digits of π are over cas.maxDigits:

In[12]:=
example : (3 : ℝ) ≤ Real.pi ∧ Real.pi ≤ 4 := by
  cega (digits := 20000) [enclose] Real.pi
Out[12]=

Error

CEGA query with 20000 digits exceeds cas.maxDigits (2000); request fewer digits or explicitly increase that resource budget

Neat Examples (1)

A sum of six terms xi(2−xi) on [0,1]6, at most 6, with equality at (1,…,1). FloatLib’s check, which runs first, does not reach a sharp bound like this one. Each term increases in its coordinate, so the box query could reduce every coordinate by monotonicity, and cega.maxFaceReductions refuses it at once:

In[13]:=
example (x0 x1 x2 x3 x4 x5 : ℝ) (h0 : x0 ∈ Set.Icc (0 : ℝ) 1) (h1 : x1 ∈ Set.Icc (0 : ℝ) 1)
    (h2 : x2 ∈ Set.Icc (0 : ℝ) 1) (h3 : x3 ∈ Set.Icc (0 : ℝ) 1) (h4 : x4 ∈ Set.Icc (0 : ℝ) 1)
    (h5 : x5 ∈ Set.Icc (0 : ℝ) 1) :
    x0 * (2 - x0) + x1 * (2 - x1) + x2 * (2 - x2) + x3 * (2 - x3) + x4 * (2 - x4) +
      x5 * (2 - x5) ≤ 6 := by
  cega
Out[13]=

Error

CEGA box query could reduce 6 coordinates by monotonicity, which exceeds cega.maxFaceReductions (5). Each reduction reruns the planner on two faces, so its kernel work doubles with each one (a sum of six squares on a six-dimensional box took minutes and tens of gigabytes); bound fewer variables at once, or explicitly increase that resource budget
The rest of the message
Other routes:
  carrier search:
    cega found no registered checked carrier or direct certificate matching the target
  interval route:
    interval could not certify: the enclosure of ((((((x0 * (2 - x0) + (x1 * (2 - x1))) + (x2 * (2 - x2))) + (x3 * (2 - x3))) + (x4 * (2 - x4))) + (x5 * …)) - …) is [-19/4, 1/4]; its upper endpoint does not establish ≤ 0.
    Box: x0 in [1/4, 1/2], x1 in [1/4, 1/2], x2 in [0, 1/2], x3 in [0, 1/2], x4 in [0, 1/2], x5 in [1/2, 1]. Subdivision depth 8 exhausted after 8 splits on this branch.
    Try tighter input bounds or more subdivision depth.
Bare `cega` proves an ordinary real inequality (`f x ≤ c`, `f x < c`, `c ≤ f x`, `c < f x` (also with `≥` and `>`), `|f x| ≤ c`, `|f x| < c`, `a ≤ f x ∧ f x ≤ b` (also with `<`), `f x ∈ Set.Icc a b` (also `Set.Ioo`, `Set.Ico`, `Set.Ioc`), `f x ≤ g x`, `f x < g x`, and conjunctions of these, with `c`, `a`, `b` closed and every real variable bounded by hypotheses `a ≤ x` and `x ≤ b`, `x ∈ Set.Icc a b`, or `|x| ≤ r` with rational literal endpoints), a bound on an interval integral `∫ x in a..b, f x` with rational limits, a certificate goal (`EnclosedOn f s lo hi`, `BoundOn f s c`, `ApproxOn f g s ε`, `ResidualBound r s ε`) on a coordinate box or from a checked carrier in the local context or the goal, a closed decidable statement about floats, which `float_decide` decides, a real inequality that FloatLib's `interval` proves, on finite sums and norms too, and a closed goal that interval evaluation proves.

See Also

cas · cega · cas? · cega? · #cas