Mode of #cas
enclose
An interval that holds every value of an expression on a box, with upper, absolute and center bounds, all proved.
#cas [enclose x in [a, b]] e#cas [enclose x in [a, b], y in [c, d]] e#cas [enclose] ecega [enclose x in [a, b]] eWhen I want to know what a function does on a box, enclose is where I start, before I think about plotting it. You get an interval the function can’t leave, and a theorem about Mathlib’s real functions that says so. The same certificate gives the report three more statements: an upper bound, a bound on the absolute value, and a center with a radius.
Examples (21)#
Basic Examples (3)
A polynomial on , with its four bounds:
#cas [enclose x in [0, 1]] (x ^ 2 + x)
certified interval in ℝ
[0, 2]- Domain
x ∈ [0, 1] ⊆ ℝ- Upper bound
2- Absolute bound
2- Center and radius
1 ± 1
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc 0 1, 0 ≤ x ^ 2 + x ∧ x ^ 2 + x ≤ 2
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc 0 1, 0 ≤ x ^ 2 + x ∧ x ^ 2 + x ≤ 2
Upper bound of the input
∀ x ∈ Set.Icc 0 1, x ^ 2 + x ≤ 2
Absolute bound of the input
∀ x ∈ Set.Icc 0 1, |x ^ 2 + x| ≤ 2
Center and radius of the input
∀ x ∈ Set.Icc 0 1, |x ^ 2 + x - 1| ≤ 1
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn ((𝕏[0].pow 2).add 𝕏[0])) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑0 / ↑1) (↑2 / ↑1)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn ((𝕏[0].pow 2).add 𝕏[0])) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑2 / ↑1)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn ((𝕏[0].pow 2).add 𝕏[0]) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑2 / ↑1)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn ((𝕏[0].pow 2).add 𝕏[0])) (fun x ↦ ↑1 / ↑1) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑1)
The computation
Coordinates: x Certified domain: x ∈ [0, 1] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box
The sine on . Decimal endpoints are rounded outward:
#cas [enclose x in [0, 1]] (sin x)
certified interval in ℝ
[0, 0.841471]- Domain
x ∈ [0, 1] ⊆ ℝ- Upper bound
0.841471- Absolute bound
0.841471- Center and radius
≈0.420735 ± 0.420736
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc 0 1, 0 ≤ Real.sin x ∧ Real.sin x ≤ 0.841471
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc 0 1, 0 ≤ Real.sin x ∧ Real.sin x ≤ 0.841471
Upper bound of the input
∀ x ∈ Set.Icc 0 1, Real.sin x ≤ 0.841471
Absolute bound of the input
∀ x ∈ Set.Icc 0 1, |Real.sin x| ≤ 0.841471
Center and radius of the input
∀ x ∈ Set.Icc 0 1, |Real.sin x - 0.420735| ≤ 0.420736
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn 𝕏[0].sin) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑0 / ↑1) (↑286337738405724074564845076175058320435 / ↑340282366920938463463374607431768211456)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn 𝕏[0].sin) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑286337738405724074564845076175058320435 / ↑340282366920938463463374607431768211456)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn 𝕏[0].sin x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑286337738405724074564845076175058320435 / ↑340282366920938463463374607431768211456)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn 𝕏[0].sin) (fun x ↦ ↑286337738405724074564845076175058320435 / ↑680564733841876926926749214863536422912) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑286337738405724074564845076175058320435 / ↑680564733841876926926749214863536422912)
The computation
Coordinates: x Certified domain: x ∈ [0, 1] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box Decimal preview: outward-rounded to 6 places where it is a bound Exact certified output: [0, 286337738405724074564845076175058320435/340282366920938463463374607431768211456]
A closed expression needs no binding:
#cas [enclose] (sqrt 2)
certified interval in ℝ
[181/128, 5793/4096]- Domain
closed real expression- Upper bound
5793/4096- Absolute bound
5793/4096- Center and radius
11585/8192 ± 1/8192
Checked by Lean’s kernel: Enclosure of the input
181 / 128 ≤ √2 ∧ √2 ≤ 5793 / 4096
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
181 / 128 ≤ √2 ∧ √2 ≤ 5793 / 4096
Upper bound of the input
√2 ≤ 5793 / 4096
Absolute bound of the input
|√2| ≤ 5793 / 4096
Center and radius of the input
|√2 - 11585 / 8192| ≤ 1 / 8192
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn (CAS.Verified.Expr.nat 2).sqrt) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑181 / ↑128) (↑5793 / ↑4096)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn (CAS.Verified.Expr.nat 2).sqrt) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑5793 / ↑4096)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn (CAS.Verified.Expr.nat 2).sqrt x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑5793 / ↑4096)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn (CAS.Verified.Expr.nat 2).sqrt) (fun x ↦ ↑11585 / ↑8192) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑1 / ↑8192)
The computation
Coordinates: none Certified domain: closed real expression
Certified numerical guarantee
Guarantee: the real value lies in the output interval
Scope (4)
Two variables, each with its own interval:
#cas [enclose x in [0, 1], y in [0, 1]] (x * y + sin y)
certified interval in ℝ
[0, 1.841471]- Domain
x ∈ [0, 1], y ∈ [0, 1] ⊆ ℝ^2- Input (scalar map ℝ^2 → ℝ)
(x * y + sin y)- Upper bound
1.841471- Absolute bound
1.841471- Center and radius
≈0.920735 ± 0.920736
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc 0 1, ∀ y ∈ Set.Icc 0 1, 0 ≤ x * y + Real.sin y ∧ x * y + Real.sin y ≤ 1.841471
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc 0 1, ∀ y ∈ Set.Icc 0 1, 0 ≤ x * y + Real.sin y ∧ x * y + Real.sin y ≤ 1.841471
Upper bound of the input
∀ x ∈ Set.Icc 0 1, ∀ y ∈ Set.Icc 0 1, x * y + Real.sin y ≤ 1.841471
Absolute bound of the input
∀ x ∈ Set.Icc 0 1, ∀ y ∈ Set.Icc 0 1, |x * y + Real.sin y| ≤ 1.841471
Center and radius of the input
∀ x ∈ Set.Icc 0 1, ∀ y ∈ Set.Icc 0 1, |x * y + Real.sin y - 0.920735| ≤ 0.920736
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn ((𝕏[0].mul 𝕏[1]).add 𝕏[1].sin)) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯, CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑0 / ↑1) (↑626620105326662538028219683606826531891 / ↑340282366920938463463374607431768211456)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn ((𝕏[0].mul 𝕏[1]).add 𝕏[1].sin)) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯, CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑626620105326662538028219683606826531891 / ↑340282366920938463463374607431768211456)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn ((𝕏[0].mul 𝕏[1]).add 𝕏[1].sin) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯, CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑626620105326662538028219683606826531891 / ↑340282366920938463463374607431768211456)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn ((𝕏[0].mul 𝕏[1]).add 𝕏[1].sin)) (fun x ↦ ↑626620105326662538028219683606826531891 / ↑680564733841876926926749214863536422912) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯, CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑626620105326662538028219683606826531891 / ↑680564733841876926926749214863536422912)
The computation
Coordinates: x, y Certified domain: x ∈ [0, 1], y ∈ [0, 1] ⊆ ℝ^2
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box Decimal preview: outward-rounded to 6 places where it is a bound Exact certified output: [0, 626620105326662538028219683606826531891/340282366920938463463374607431768211456]
A rational function and an exponential:
#cas [enclose x in [0, 1]] (x / (1 + x))
certified interval in ℝ
[0, 1/2]- Domain
x ∈ [0, 1] ⊆ ℝ- Upper bound
1/2- Absolute bound
1/2- Center and radius
1/4 ± 1/4
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc 0 1, 0 ≤ x / (1 + x) ∧ x / (1 + x) ≤ 1 / 2
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc 0 1, 0 ≤ x / (1 + x) ∧ x / (1 + x) ≤ 1 / 2
Upper bound of the input
∀ x ∈ Set.Icc 0 1, x / (1 + x) ≤ 1 / 2
Absolute bound of the input
∀ x ∈ Set.Icc 0 1, |x / (1 + x)| ≤ 1 / 2
Center and radius of the input
∀ x ∈ Set.Icc 0 1, |x / (1 + x) - 1 / 4| ≤ 1 / 4
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add 𝕏[0]))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑0 / ↑1) (↑1 / ↑2)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add 𝕏[0]))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑2)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add 𝕏[0])) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑2)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add 𝕏[0]))) (fun x ↦ ↑1 / ↑4) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑4)
The computation
Coordinates: x Certified domain: x ∈ [0, 1] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box
#cas [enclose x in [9 / 10, 11 / 10]] (x * exp (-x))
certified interval in ℝ
[0.356443, 0.379316]- Domain
x ∈ [9/10, 11/10] ⊆ ℝ- Upper bound
0.379316- Absolute bound
0.379316- Center and radius
≈0.367879 ± 0.011437
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc (9 / 10) (11 / 10), 0.356443 ≤ x * Real.exp (-x) ∧ x * Real.exp (-x) ≤ 0.379316
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc (9 / 10) (11 / 10), 0.356443 ≤ x * Real.exp (-x) ∧ x * Real.exp (-x) ≤ 0.379316
Upper bound of the input
∀ x ∈ Set.Icc (9 / 10) (11 / 10), x * Real.exp (-x) ≤ 0.379316
Absolute bound of the input
∀ x ∈ Set.Icc (9 / 10) (11 / 10), |x * Real.exp (-x)| ≤ 0.379316
Center and radius of the input
∀ x ∈ Set.Icc (9 / 10) (11 / 10), |x * Real.exp (-x) - 0.367879| ≤ 11437e-6
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn (𝕏[0].mul 𝕏[0].neg.exp)) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (9 / 10) (11 / 10) ⋯].get coordinate) (↑6064578444609289948060458934526468133587 / ↑17014118346046923173168730371588410572800) (↑12907420930551572231962666464743635725551 / ↑34028236692093846346337460743176821145600)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn (𝕏[0].mul 𝕏[0].neg.exp)) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (9 / 10) (11 / 10) ⋯].get coordinate) (↑12907420930551572231962666464743635725551 / ↑34028236692093846346337460743176821145600)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn (𝕏[0].mul 𝕏[0].neg.exp) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (9 / 10) (11 / 10) ⋯].get coordinate) (↑12907420930551572231962666464743635725551 / ↑34028236692093846346337460743176821145600)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn (𝕏[0].mul 𝕏[0].neg.exp)) (fun x ↦ ↑1001463112790806085123343373351862879709 / ↑2722258935367507707706996859454145691648) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (9 / 10) (11 / 10) ⋯].get coordinate) (↑778264041332992335841748595690699458377 / ↑68056473384187692692674921486353642291200)
The computation
Coordinates: x Certified domain: x ∈ [9/10, 11/10] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box Decimal preview: outward-rounded to 6 places where it is a bound Exact certified output: [6064578444609289948060458934526468133587/17014118346046923173168730371588410572800, 12907420930551572231962666464743635725551/34028236692093846346337460743176821145600]
A narrow interval gives a narrow enclosure:
#cas [enclose x in [10, 1001 / 100]] (sin x)
certified interval in ℝ
[-0.552385, -0.544021]- Domain
x ∈ [10, 1001/100] ⊆ ℝ- Upper bound
-0.544021- Absolute bound
0.552385- Center and radius
≈-0.548203 ± 0.004182
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc 10 (1001 / 100), -0.552385 ≤ Real.sin x ∧ Real.sin x ≤ -0.544021
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc 10 (1001 / 100), -0.552385 ≤ Real.sin x ∧ Real.sin x ≤ -0.544021
Upper bound of the input
∀ x ∈ Set.Icc 10 (1001 / 100), Real.sin x ≤ -0.544021
Absolute bound of the input
∀ x ∈ Set.Icc 10 (1001 / 100), |Real.sin x| ≤ 0.552385
Center and radius of the input
∀ x ∈ Set.Icc 10 (1001 / 100), |Real.sin x + 0.548203| ≤ 4182e-6
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn 𝕏[0].sin) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 10 (1001 / 100) ⋯].get coordinate) (↑(-187966700178627751492036751887906017459) / ↑340282366920938463463374607431768211456) (↑(-92560395634196545154218951384246197009) / ↑170141183460469231731687303715884105728)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn 𝕏[0].sin) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 10 (1001 / 100) ⋯].get coordinate) (↑(-92560395634196545154218951384246197009) / ↑170141183460469231731687303715884105728)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn 𝕏[0].sin x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 10 (1001 / 100) ⋯].get coordinate) (↑187966700178627751492036751887906017459 / ↑340282366920938463463374607431768211456)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn 𝕏[0].sin) (fun x ↦ ↑(-373087491447020841800474654656398411477) / ↑680564733841876926926749214863536422912) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 10 (1001 / 100) ⋯].get coordinate) (↑2845908910234661183598849119413623441 / ↑680564733841876926926749214863536422912)
The computation
Coordinates: x Certified domain: x ∈ [10, 1001/100] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box Decimal preview: outward-rounded to 6 places where it is a bound Exact certified output: [-187966700178627751492036751887906017459/340282366920938463463374607431768211456, -92560395634196545154218951384246197009/170141183460469231731687303715884105728]
Absolute values, inverse and hyperbolic functions:
#cas [enclose x in [-2, 1]] (|x|)
certified interval in ℝ
[0, 2]- Domain
x ∈ [-2, 1] ⊆ ℝ- Upper bound
2- Absolute bound
2- Center and radius
1 ± 1
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc (-2) 1, 0 ≤ |x| ∧ |x| ≤ 2
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc (-2) 1, 0 ≤ |x| ∧ |x| ≤ 2
Upper bound of the input
∀ x ∈ Set.Icc (-2) 1, |x| ≤ 2
Absolute bound of the input
∀ x ∈ Set.Icc (-2) 1, |(|x|)| ≤ 2
Center and radius of the input
∀ x ∈ Set.Icc (-2) 1, ||x| - 1| ≤ 1
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn (𝕏[0].pow 2).sqrt) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 1 ⋯].get coordinate) (↑0 / ↑1) (↑2 / ↑1)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn (𝕏[0].pow 2).sqrt) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 1 ⋯].get coordinate) (↑2 / ↑1)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn (𝕏[0].pow 2).sqrt x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 1 ⋯].get coordinate) (↑2 / ↑1)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn (𝕏[0].pow 2).sqrt) (fun x ↦ ↑1 / ↑1) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 1 ⋯].get coordinate) (↑1 / ↑1)
The computation
Coordinates: x Certified domain: x ∈ [-2, 1] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box
#cas [enclose x in [-1 / 2, 1 / 2]] (arcsin x)
certified interval in ℝ
[-0.523599, 0.523599]- Domain
x ∈ [-1/2, 1/2] ⊆ ℝ- Upper bound
0.523599- Absolute bound
0.523599- Center and radius
0 ± 0.523599
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc (-1 / 2) (1 / 2), -0.523599 ≤ Real.arcsin x ∧ Real.arcsin x ≤ 0.523599
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc (-1 / 2) (1 / 2), -0.523599 ≤ Real.arcsin x ∧ Real.arcsin x ≤ 0.523599
Upper bound of the input
∀ x ∈ Set.Icc (-1 / 2) (1 / 2), Real.arcsin x ≤ 0.523599
Absolute bound of the input
∀ x ∈ Set.Icc (-1 / 2) (1 / 2), |Real.arcsin x| ≤ 0.523599
Center and radius of the input
∀ x ∈ Set.Icc (-1 / 2) (1 / 2), |Real.arcsin x - 0| ≤ 0.523599
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn 𝕏[0].asin) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-1 / 2) (1 / 2) ⋯].get coordinate) (↑(-178171430677865191171890821864242709953) / ↑340282366920938463463374607431768211456) (↑178171430677865191171890821864242709953 / ↑340282366920938463463374607431768211456)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn 𝕏[0].asin) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-1 / 2) (1 / 2) ⋯].get coordinate) (↑178171430677865191171890821864242709953 / ↑340282366920938463463374607431768211456)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn 𝕏[0].asin x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-1 / 2) (1 / 2) ⋯].get coordinate) (↑178171430677865191171890821864242709953 / ↑340282366920938463463374607431768211456)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn 𝕏[0].asin) (fun x ↦ ↑0 / ↑1) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-1 / 2) (1 / 2) ⋯].get coordinate) (↑178171430677865191171890821864242709953 / ↑340282366920938463463374607431768211456)
The computation
Coordinates: x Certified domain: x ∈ [-1/2, 1/2] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box Decimal preview: outward-rounded to 6 places where it is a bound Exact certified output: [-178171430677865191171890821864242709953/340282366920938463463374607431768211456, 178171430677865191171890821864242709953/340282366920938463463374607431768211456]
#cas [enclose x in [-5, 5]] (tanh x)
certified interval in ℝ
[-0.999910, 0.999910]- Domain
x ∈ [-5, 5] ⊆ ℝ- Upper bound
0.999910- Absolute bound
0.999910- Center and radius
≈-0.000001 ± 0.999911
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc (-5) 5, -0.999910 ≤ Real.tanh x ∧ Real.tanh x ≤ 0.999910
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc (-5) 5, -0.999910 ≤ Real.tanh x ∧ Real.tanh x ≤ 0.999910
Upper bound of the input
∀ x ∈ Set.Icc (-5) 5, Real.tanh x ≤ 0.999910
Absolute bound of the input
∀ x ∈ Set.Icc (-5) 5, |Real.tanh x| ≤ 0.999910
Center and radius of the input
∀ x ∈ Set.Icc (-5) 5, |Real.tanh x + 1e-6| ≤ 0.999911
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn (((𝕏[0].exp.sub 𝕏[0].neg.exp).div (CAS.Verified.Expr.nat 2)).div ((𝕏[0].exp.add 𝕏[0].neg.exp).div (CAS.Verified.Expr.nat 2)))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-5) 5 ⋯].get coordinate) (↑(-185792032812268841120352661050400084943005841151432191930040344956816538178694827660960473118578708278793672052285241976218393185506201563733907812904658906264481070343468634471638370977502450751537545313601233345966335) / ↑185808903465232841914589434357735480471843918754078541718075562553914089007724926174983043021839136189239245673053278781499290394997825072192033886672060060512211542539426701657678371580988990401920599782886238910287617) (↑4092341918708448340149001210283847666644878947375806173343262818303635370037695033668012011620822322951338872248882041944659401488188933413122025483232741329362395751913414586627864057087730027449957315924854519038208525185 / ↑4092713519644725841832036152379255802210293797135711684076910934211146100664881453421847955136962740795806905166607380465417119171769437439757951424932318048329172444526297481963993373830288518891110774069951006510464779137)Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn (((𝕏[0].exp.sub 𝕏[0].neg.exp).div (CAS.Verified.Expr.nat 2)).div ((𝕏[0].exp.add 𝕏[0].neg.exp).div (CAS.Verified.Expr.nat 2)))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-5) 5 ⋯].get coordinate) (↑4092341918708448340149001210283847666644878947375806173343262818303635370037695033668012011620822322951338872248882041944659401488188933413122025483232741329362395751913414586627864057087730027449957315924854519038208525185 / ↑4092713519644725841832036152379255802210293797135711684076910934211146100664881453421847955136962740795806905166607380465417119171769437439757951424932318048329172444526297481963993373830288518891110774069951006510464779137)Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn (((𝕏[0].exp.sub 𝕏[0].neg.exp).div (CAS.Verified.Expr.nat 2)).div ((𝕏[0].exp.add 𝕏[0].neg.exp).div (CAS.Verified.Expr.nat 2))) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-5) 5 ⋯].get coordinate) (↑185792032812268841120352661050400084943005841151432191930040344956816538178694827660960473118578708278793672052285241976218393185506201563733907812904658906264481070343468634471638370977502450751537545313601233345966335 / ↑185808903465232841914589434357735480471843918754078541718075562553914089007724926174983043021839136189239245673053278781499290394997825072192033886672060060512211542539426701657678371580988990401920599782886238910287617)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn (((𝕏[0].exp.sub 𝕏[0].neg.exp).div (CAS.Verified.Expr.nat 2)).div ((𝕏[0].exp.add 𝕏[0].neg.exp).div (CAS.Verified.Expr.nat 2)))) (fun x ↦ ↑(-6512688017056914857037300055267465500584054326244808679174828943748761220680546210331435763859664598217666340172559482054382857331046049260659816659199017867324807159667689354076009270447684185973030530468244560687360621717842069464257183961436793602404630066387461177043312872212526315421330709683453681773399333466535857842970561223948140085196339897642856013056498721630544592740552651716338233780297759378296918820167937109375) / ↑760462611282520200293139804711691710701242633696753894471636467197887745048351293017146354381430934444456210199885881057130347574316632991222374816049131367164013639877213849285676138125316352325759429574363474923497692410494745318766930355566685359944096916138241954563667301362060002749469521965676650009477288235687677625342816773946590892293127112465065202012319111916261897510662097761727221260822562458206771598114656229285969051046529) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-5) 5 ⋯].get coordinate) (↑760393564526536511859248838904815230965803867046899725972873301831762712497550525869889432606770404305635656884988489524090316480216776353050647150747842685622916932462397854443006666804997915119459918544254661063735386192271324041567867729824566008497794710179969909399208990124017991855707196315961945171113689885645860277187245660857790397834770754087082907657462020709989703682088726864240169804842661303244749095585860503694537675243520 / ↑760462611282520200293139804711691710701242633696753894471636467197887745048351293017146354381430934444456210199885881057130347574316632991222374816049131367164013639877213849285676138125316352325759429574363474923497692410494745318766930355566685359944096916138241954563667301362060002749469521965676650009477288235687677625342816773946590892293127112465065202012319111916261897510662097761727221260822562458206771598114656229285969051046529)
The computation
Coordinates: x Certified domain: x ∈ [-5, 5] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box Decimal preview: outward-rounded to 6 places where it is a bound Exact certified output: [-185792032812268841120352661050400084943005841151432191930040344956816538178694827660960473118578708278793672052285241976218393185506201563733907812904658906264481070343468634471638370977502450751537545313601233345966335/185808903465232841914589434357735480471843918754078541718075562553914089007724926174983043021839136189239245673053278781499290394997825072192033886672060060512211542539426701657678371580988990401920599782886238910287617, 4092341918708448340149001210283847666644878947375806173343262818303635370037695033668012011620822322951338872248882041944659401488188933413122025483232741329362395751913414586627864057087730027449957315924854519038208525185/4092713519644725841832036152379255802210293797135711684076910934211146100664881453421847955136962740795806905166607380465417119171769437439757951424932318048329172444526297481963993373830288518891110774069951006510464779137]
Options (3)
On the first enclosure of is loose:
#cas [enclose x in [-2, 2]] (x / (1 + x ^ 2))
certified interval in ℝ
[-2, 2]- Domain
x ∈ [-2, 2] ⊆ ℝ- Upper bound
2- Absolute bound
2- Center and radius
0 ± 2
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc (-2) 2, -2 ≤ x / (1 + x ^ 2) ∧ x / (1 + x ^ 2) ≤ 2
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc (-2) 2, -2 ≤ x / (1 + x ^ 2) ∧ x / (1 + x ^ 2) ≤ 2
Upper bound of the input
∀ x ∈ Set.Icc (-2) 2, x / (1 + x ^ 2) ≤ 2
Absolute bound of the input
∀ x ∈ Set.Icc (-2) 2, |x / (1 + x ^ 2)| ≤ 2
Center and radius of the input
∀ x ∈ Set.Icc (-2) 2, |x / (1 + x ^ 2) - 0| ≤ 2
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add (𝕏[0].pow 2)))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 2 ⋯].get coordinate) (↑(-2) / ↑1) (↑2 / ↑1)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add (𝕏[0].pow 2)))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 2 ⋯].get coordinate) (↑2 / ↑1)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add (𝕏[0].pow 2))) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 2 ⋯].get coordinate) (↑2 / ↑1)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add (𝕏[0].pow 2)))) (fun x ↦ ↑0 / ↑1) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 2 ⋯].get coordinate) (↑2 / ↑1)
The computation
Coordinates: x Certified domain: x ∈ [-2, 2] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box
With (depth := 2) the box is cut at 0 and at , the function is monotone on each piece, and the enclosure is its exact range:
#cas (depth := 2) [enclose x in [-2, 2]] (x / (1 + x ^ 2))
certified interval in ℝ
[-1/2, 1/2]- Domain
x ∈ [-2, 2] ⊆ ℝ- Upper bound
1/2- Absolute bound
1/2- Center and radius
0 ± 1/2
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc (-2) 2, -1 / 2 ≤ x / (1 + x ^ 2) ∧ x / (1 + x ^ 2) ≤ 1 / 2
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc (-2) 2, -1 / 2 ≤ x / (1 + x ^ 2) ∧ x / (1 + x ^ 2) ≤ 1 / 2
Upper bound of the input
∀ x ∈ Set.Icc (-2) 2, x / (1 + x ^ 2) ≤ 1 / 2
Absolute bound of the input
∀ x ∈ Set.Icc (-2) 2, |x / (1 + x ^ 2)| ≤ 1 / 2
Center and radius of the input
∀ x ∈ Set.Icc (-2) 2, |x / (1 + x ^ 2) - 0| ≤ 1 / 2
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add (𝕏[0].pow 2)))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 2 ⋯].get coordinate) (↑(-1) / ↑2) (↑1 / ↑2)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add (𝕏[0].pow 2)))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 2 ⋯].get coordinate) (↑1 / ↑2)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add (𝕏[0].pow 2))) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 2 ⋯].get coordinate) (↑1 / ↑2)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn (𝕏[0].div ((CAS.Verified.Expr.nat 1).add (𝕏[0].pow 2)))) (fun x ↦ ↑0 / ↑1) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (-2) 2 ⋯].get coordinate) (↑1 / ↑2)
The computation
Coordinates: x Certified domain: x ∈ [-2, 2] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box
(prec := n) raises the precision of the series and square roots. For the width of the interval goes from , in the third basic example, to :
#cas (prec := 16) [enclose] (sqrt 2)
certified interval in ℝ
[92681/65536, 46341/32768]- Domain
closed real expression- Upper bound
46341/32768- Absolute bound
46341/32768- Center and radius
185363/131072 ± 1/131072
Checked by Lean’s kernel: Enclosure of the input
92681 / 65536 ≤ √2 ∧ √2 ≤ 46341 / 32768
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
92681 / 65536 ≤ √2 ∧ √2 ≤ 46341 / 32768
Upper bound of the input
√2 ≤ 46341 / 32768
Absolute bound of the input
|√2| ≤ 46341 / 32768
Center and radius of the input
|√2 - 185363 / 131072| ≤ 1 / 131072
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn (CAS.Verified.Expr.nat 2).sqrt) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑92681 / ↑65536) (↑46341 / ↑32768)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn (CAS.Verified.Expr.nat 2).sqrt) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑46341 / ↑32768)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn (CAS.Verified.Expr.nat 2).sqrt x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑46341 / ↑32768)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn (CAS.Verified.Expr.nat 2).sqrt) (fun x ↦ ↑185363 / ↑131072) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑1 / ↑131072)
The computation
Coordinates: none Certified domain: closed real expression
Certified numerical guarantee
Guarantee: the real value lies in the output interval Precision policy: exp order 16, sqrt digits 16, log terms 16, subdivision depth 2
On a box, compare the exact output under “More details” without the option and with it:
#cas [enclose x in [0, 1]] (exp x)
certified interval in ℝ
[1, 2.718282]- Domain
x ∈ [0, 1] ⊆ ℝ- Upper bound
2.718282- Absolute bound
2.718282- Center and radius
≈1.859140 ± 0.859142
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc 0 1, 1 ≤ Real.exp x ∧ Real.exp x ≤ 2.718282
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc 0 1, 1 ≤ Real.exp x ∧ Real.exp x ≤ 2.718282
Upper bound of the input
∀ x ∈ Set.Icc 0 1, Real.exp x ≤ 2.718282
Absolute bound of the input
∀ x ∈ Set.Icc 0 1, |Real.exp x| ≤ 2.718282
Center and radius of the input
∀ x ∈ Set.Icc 0 1, |Real.exp x - 1.859140| ≤ 0.859142
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn 𝕏[0].exp) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑1) (↑462491687450482947330520547891995015533 / ↑170141183460469231731687303715884105728)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn 𝕏[0].exp) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑462491687450482947330520547891995015533 / ↑170141183460469231731687303715884105728)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn 𝕏[0].exp x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑462491687450482947330520547891995015533 / ↑170141183460469231731687303715884105728)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn 𝕏[0].exp) (fun x ↦ ↑632632870910952179062207851607879121261 / ↑340282366920938463463374607431768211456) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑292350503990013715598833244176110909805 / ↑340282366920938463463374607431768211456)
The computation
Coordinates: x Certified domain: x ∈ [0, 1] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box Decimal preview: outward-rounded to 6 places where it is a bound Exact certified output: [1, 462491687450482947330520547891995015533/170141183460469231731687303715884105728]
#cas (prec := 40) [enclose x in [0, 1]] (exp x)
certified interval in ℝ
[1, 2.718282]- Domain
x ∈ [0, 1] ⊆ ℝ- Upper bound
2.718282- Absolute bound
2.718282- Center and radius
≈1.859140 ± 0.859142
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc 0 1, 1 ≤ Real.exp x ∧ Real.exp x ≤ 2.718282
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc 0 1, 1 ≤ Real.exp x ∧ Real.exp x ≤ 2.718282
Upper bound of the input
∀ x ∈ Set.Icc 0 1, Real.exp x ≤ 2.718282
Absolute bound of the input
∀ x ∈ Set.Icc 0 1, |Real.exp x| ≤ 2.718282
Center and radius of the input
∀ x ∈ Set.Icc 0 1, |Real.exp x - 1.859140| ≤ 0.859142
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn 𝕏[0].exp) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑1) (↑115622921818277542143863879480417099385 / ↑42535295865117307932921825928971026432)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn 𝕏[0].exp) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑115622921818277542143863879480417099385 / ↑42535295865117307932921825928971026432)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn 𝕏[0].exp x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑115622921818277542143863879480417099385 / ↑42535295865117307932921825928971026432)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn 𝕏[0].exp) (fun x ↦ ↑158158217683394850076785705409388125817 / ↑85070591730234615865843651857942052864) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑73087625953160234210942053551446072953 / ↑85070591730234615865843651857942052864)
The computation
Coordinates: x Certified domain: x ∈ [0, 1] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box Decimal preview: outward-rounded to 6 places where it is a bound Exact certified output: [1, 115622921818277542143863879480417099385/42535295865117307932921825928971026432] Precision policy: exp order 40, sqrt digits 40, log terms 40, subdivision depth 2
Applications (3)
A bound in a proof. cas takes the box from the hypotheses and proves the bound by an enclosure, and cas? shows the query it ran:
example (x : ℝ) (h₀ : 0 ≤ x) (h₁ : x ≤ 1) : Real.exp x ≤ 3 := by cas?
Try this
cega
Lean checked the suggested replacement against the original goal. Selected route: CAS route: checked CEGA box enclosure of an ordinary inequality.cega [enclose ...] names the box and the expression itself. Here it proves on :
example (x : ℝ) (h0 : 0 ≤ x) (h1 : x ≤ 1) : x * (1 - x) ≤ 1 / 4 := by cega [enclose x in [0, 1]] (x * (1 - x))
Lean accepts the proof.
With (arith := binary64) the query computes with binary64 floats, rounded outward:
example (x : ℝ) (h₀ : 0 ≤ x) (h₁ : x ≤ 1) : Real.exp x ≤ 2.72 := by cega (arith := binary64) [enclose x in [0, 1]] (Real.exp x)
Lean accepts the proof.
Properties and Relations (3)
An identity encloses to a point:
#cas [enclose x in [0, 1]] (sin x ^ 2 + cos x ^ 2)
certified interval in ℝ
[1, 1]- Domain
x ∈ [0, 1] ⊆ ℝ- Upper bound
1- Absolute bound
1- Center and radius
1 ± 0
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc 0 1, 1 ≤ Real.sin x ^ 2 + Real.cos x ^ 2 ∧ Real.sin x ^ 2 + Real.cos x ^ 2 ≤ 1
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc 0 1, 1 ≤ Real.sin x ^ 2 + Real.cos x ^ 2 ∧ Real.sin x ^ 2 + Real.cos x ^ 2 ≤ 1
Upper bound of the input
∀ x ∈ Set.Icc 0 1, Real.sin x ^ 2 + Real.cos x ^ 2 ≤ 1
Absolute bound of the input
∀ x ∈ Set.Icc 0 1, |Real.sin x ^ 2 + Real.cos x ^ 2| ≤ 1
Center and radius of the input
∀ x ∈ Set.Icc 0 1, |Real.sin x ^ 2 + Real.cos x ^ 2 - 1| ≤ 0
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn ((𝕏[0].sin.pow 2).add (𝕏[0].cos.pow 2))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑1) (↑1 / ↑1)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn ((𝕏[0].sin.pow 2).add (𝕏[0].cos.pow 2))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑1)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn ((𝕏[0].sin.pow 2).add (𝕏[0].cos.pow 2)) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑1)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn ((𝕏[0].sin.pow 2).add (𝕏[0].cos.pow 2))) (fun x ↦ ↑1 / ↑1) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑0 / ↑1)
The computation
Coordinates: x Certified domain: x ∈ [0, 1] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box
maximize gives the largest value itself, and enclose only bounds it:
#cas [maximize x in [0, 1]] (x * (1 - x))
exact maximum on the interval
max = 1/4 at x = 1/2- Domain
x ∈ [0, 1]- Input (polynomial)
(x * (1 - x))
Checked by Lean’s kernel: Bound on the interval attained at the point
(∀ x ∈ Set.Icc 0 1, x * (1 - x) ≤ 1 / 4) ∧ 1 / 2 ∈ Set.Icc 0 1 ∧ (fun x ↦ x * (1 - x)) (1 / 2) = 1 / 4
The certificate: 1 checked step
Bound on the interval attained at the point
(∀ x ∈ Set.Icc 0 1, x * (1 - x) ≤ 1 / 4) ∧ 1 / 2 ∈ Set.Icc 0 1 ∧ (fun x ↦ x * (1 - x)) (1 / 2) = 1 / 4
The computation
Candidates
Endpoints and real roots of the derivative in the interval (not proof): 3
#cas [enclose x in [0, 1]] (x * (1 - x))
certified interval in ℝ
[0, 1/4]- Domain
x ∈ [0, 1] ⊆ ℝ- Upper bound
1/4- Absolute bound
1/4- Center and radius
1/8 ± 1/8
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc 0 1, 0 ≤ x * (1 - x) ∧ x * (1 - x) ≤ 1 / 4
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc 0 1, 0 ≤ x * (1 - x) ∧ x * (1 - x) ≤ 1 / 4
Upper bound of the input
∀ x ∈ Set.Icc 0 1, x * (1 - x) ≤ 1 / 4
Absolute bound of the input
∀ x ∈ Set.Icc 0 1, |x * (1 - x)| ≤ 1 / 4
Center and radius of the input
∀ x ∈ Set.Icc 0 1, |x * (1 - x) - 1 / 8| ≤ 1 / 8
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn (𝕏[0].mul ((CAS.Verified.Expr.nat 1).sub 𝕏[0]))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑0 / ↑1) (↑1 / ↑4)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn (𝕏[0].mul ((CAS.Verified.Expr.nat 1).sub 𝕏[0]))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑4)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn (𝕏[0].mul ((CAS.Verified.Expr.nat 1).sub 𝕏[0])) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑4)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn (𝕏[0].mul ((CAS.Verified.Expr.nat 1).sub 𝕏[0]))) (fun x ↦ ↑1 / ↑8) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 1 ⋯].get coordinate) (↑1 / ↑8)
The computation
Coordinates: x Certified domain: x ∈ [0, 1] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box
N gives digits of a closed expression, and enclose gives an interval:
#cas [N 10] (sqrt 2)
first 10 significant digits, truncated
1.414213562- Domain
closed real expression
Checked by Lean’s kernel: Certified decimal digits
1414213562 / 10 ^ 9 ≤ √2 ∧ √2 < (1414213562 + 1) / 10 ^ 9
from CAS.Continuum.DigitsEval.eval_sound
The certificate: 1 checked step
Certified decimal digits
1414213562 / 10 ^ 9 ≤ √2 ∧ √2 < (1414213562 + 1) / 10 ^ 9
The computation
Certified numerical evaluation
Working precision: 73 bits, 34 series terms, 62 logarithm terms Guarantee: every printed digit is a digit of the real value, truncated toward zero
Possible Issues (3)
is unbounded near 0, so no interval holds its values on . Enclose it on a box that leaves out 0, such as :
#cas [enclose x in [-1, 1]] (1 / x)
Error
no checked interval route succeeded on this box. Possible domain obstruction: check whether denominator intervals exclude zero. This is a search diagnostic, not a proof that the expression is singular. Restrict the domain or rewrite the expression to make these facts interval-visible. `(depth := n)` subdivision still needs a checked enclosure on every child box
#cas [enclose x in [1/10, 1]] (1 / x)
certified interval in ℝ
[1, 10]- Domain
x ∈ [1/10, 1] ⊆ ℝ- Upper bound
10- Absolute bound
10- Center and radius
11/2 ± 9/2
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc (1 / 10) 1, 1 ≤ 1 / x ∧ 1 / x ≤ 10
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc (1 / 10) 1, 1 ≤ 1 / x ∧ 1 / x ≤ 10
Upper bound of the input
∀ x ∈ Set.Icc (1 / 10) 1, 1 / x ≤ 10
Absolute bound of the input
∀ x ∈ Set.Icc (1 / 10) 1, |1 / x| ≤ 10
Center and radius of the input
∀ x ∈ Set.Icc (1 / 10) 1, |1 / x - 11 / 2| ≤ 9 / 2
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn ((CAS.Verified.Expr.nat 1).div 𝕏[0])) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (1 / 10) 1 ⋯].get coordinate) (↑1 / ↑1) (↑10 / ↑1)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn ((CAS.Verified.Expr.nat 1).div 𝕏[0])) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (1 / 10) 1 ⋯].get coordinate) (↑10 / ↑1)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn ((CAS.Verified.Expr.nat 1).div 𝕏[0]) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (1 / 10) 1 ⋯].get coordinate) (↑10 / ↑1)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn ((CAS.Verified.Expr.nat 1).div 𝕏[0])) (fun x ↦ ↑11 / ↑2) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds (1 / 10) 1 ⋯].get coordinate) (↑9 / ↑2)
The computation
Coordinates: x Certified domain: x ∈ [1/10, 1] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box
Endpoints are rational literals. For , use a rational interval that contains it, such as :
#cas [enclose x in [0, pi]] (sin x)
Error
interval endpoints must be exact rational literals, such as -1, 3/2, -1/10, or 0.1
#cas [enclose x in [0, 315/100]] (sin x)
certified interval in ℝ
[-0.575009, 1]- Domain
x ∈ [0, 63/20] ⊆ ℝ- Upper bound
1- Absolute bound
1- Center and radius
≈0.212495 ± 0.787505
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc 0 (63 / 20), -0.575009 ≤ Real.sin x ∧ Real.sin x ≤ 1
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc 0 (63 / 20), -0.575009 ≤ Real.sin x ∧ Real.sin x ≤ 1
Upper bound of the input
∀ x ∈ Set.Icc 0 (63 / 20), Real.sin x ≤ 1
Absolute bound of the input
∀ x ∈ Set.Icc 0 (63 / 20), |Real.sin x| ≤ 1
Center and radius of the input
∀ x ∈ Set.Icc 0 (63 / 20), |Real.sin x - 0.212495| ≤ 157501 / 200000
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn 𝕏[0].sin) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 (63 / 20) ⋯].get coordinate) (↑(-195665367517577221813521366733317542071) / ↑340282366920938463463374607431768211456) (↑1 / ↑1)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn 𝕏[0].sin) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 (63 / 20) ⋯].get coordinate) (↑1 / ↑1)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn 𝕏[0].sin x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 (63 / 20) ⋯].get coordinate) (↑1 / ↑1)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn 𝕏[0].sin) (fun x ↦ ↑144616999403361241649853240698450669385 / ↑680564733841876926926749214863536422912) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 (63 / 20) ⋯].get coordinate) (↑535947734438515685276895974165085753527 / ↑680564733841876926926749214863536422912)
The computation
Coordinates: x Certified domain: x ∈ [0, 63/20] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box Decimal preview: outward-rounded to 6 places where it is a bound Exact certified output: [-195665367517577221813521366733317542071/340282366920938463463374607431768211456, 1]
The smaller endpoint comes first:
#cas [enclose x in [1, 0]] (x)
Error
interval endpoints are reversed: 1 > 0
Neat Examples (2)
A tiny number is rounded outward to 6 places, and the radius covers the rounding of the center. In the theorem, Lean prints the decimals 0.000000 and 0.000001 as 0e-6 and 1e-6:
#cas [enclose] (1 / 1000000000000000000000000)
certified interval in ℝ
[0.000000, 0.000001]- Domain
closed real expression- Upper bound
0.000001- Absolute bound
0.000001- Center and radius
≈0.000000 ± 0.000001
Checked by Lean’s kernel: Enclosure of the input
0e-6 ≤ 1 / 1000000000000000000000000 ∧ 1 / 1000000000000000000000000 ≤ 1e-6
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
0e-6 ≤ 1 / 1000000000000000000000000 ∧ 1 / 1000000000000000000000000 ≤ 1e-6
Upper bound of the input
1 / 1000000000000000000000000 ≤ 1e-6
Absolute bound of the input
|1 / 1000000000000000000000000| ≤ 1e-6
Center and radius of the input
|1 / 1000000000000000000000000 - 0e-6| ≤ 1e-6
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn ((CAS.Verified.Expr.nat 1).div (CAS.Verified.Expr.nat 1000000000000000000000000))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑1 / ↑1000000000000000000000000) (↑1 / ↑1000000000000000000000000)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn ((CAS.Verified.Expr.nat 1).div (CAS.Verified.Expr.nat 1000000000000000000000000))) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑1 / ↑1000000000000000000000000)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn ((CAS.Verified.Expr.nat 1).div (CAS.Verified.Expr.nat 1000000000000000000000000)) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑1 / ↑1000000000000000000000000)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn ((CAS.Verified.Expr.nat 1).div (CAS.Verified.Expr.nat 1000000000000000000000000))) (fun x ↦ ↑1 / ↑1000000000000000000000000) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [].get coordinate) (↑0 / ↑1)
The computation
Coordinates: none Certified domain: closed real expression
Certified numerical guarantee
Guarantee: the real value lies in the output interval Decimal preview: outward-rounded to 6 places where it is a bound Exact certified output: [1/1000000000000000000000000, 1/1000000000000000000000000]
Three levels of bisection on :
#cas (depth := 3) [enclose x in [0, 2]] (sin x * cos x)
certified interval in ℝ
[-0.378402, 0.544012]- Domain
x ∈ [0, 2] ⊆ ℝ- Upper bound
0.544012- Absolute bound
0.544012- Center and radius
≈0.082805 ± 0.461207
Checked by Lean’s kernel: Enclosure of the input
∀ x ∈ Set.Icc 0 2, -0.378402 ≤ Real.sin x * Real.cos x ∧ Real.sin x * Real.cos x ≤ 0.544012
from CAS.Tactic.BoxInequality.mem_of_enclosedOn_box
The certificate: 8 checked steps
Enclosure of the input
∀ x ∈ Set.Icc 0 2, -0.378402 ≤ Real.sin x * Real.cos x ∧ Real.sin x * Real.cos x ≤ 0.544012
Upper bound of the input
∀ x ∈ Set.Icc 0 2, Real.sin x * Real.cos x ≤ 0.544012
Absolute bound of the input
∀ x ∈ Set.Icc 0 2, |Real.sin x * Real.cos x| ≤ 0.544012
Center and radius of the input
∀ x ∈ Set.Icc 0 2, |Real.sin x * Real.cos x - 82805e-6| ≤ 0.461207
Certified enclosure
CAS.Certificate.EnclosedOn (CAS.Exact.exprFn (𝕏[0].sin.mul 𝕏[0].cos)) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 2 ⋯].get coordinate) (↑(-2738491939741224980065545710511944340592687821623911616333681165377358429451) / ↑7237005577332262213973186563042994240829374041602535252466099000494570602496) (↑31496104119253840352539446916394688164217738877448090787965650547754896521097 / ↑57896044618658097711785492504343953926634992332820282019728792003956564819968)
Certified upper bound
CAS.Certificate.BoundOn (CAS.Exact.exprFn (𝕏[0].sin.mul 𝕏[0].cos)) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 2 ⋯].get coordinate) (↑31496104119253840352539446916394688164217738877448090787965650547754896521097 / ↑57896044618658097711785492504343953926634992332820282019728792003956564819968)
Certified absolute bound
CAS.Certificate.BoundOn (fun x ↦ |CAS.Exact.exprFn (𝕏[0].sin.mul 𝕏[0].cos) x|) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 2 ⋯].get coordinate) (↑31496104119253840352539446916394688164217738877448090787965650547754896521097 / ↑57896044618658097711785492504343953926634992332820282019728792003956564819968)
Certified center and radius
CAS.Certificate.ApproxOn (CAS.Exact.exprFn (𝕏[0].sin.mul 𝕏[0].cos)) (fun x ↦ ↑9588168601324040512015081232299133439476236304456797857296201224736029085489 / ↑115792089237316195423570985008687907853269984665640564039457584007913129639936) (CAS.Continuum.RationalInterval.boxDomain fun coordinate ↦ [CAS.Continuum.RationalInterval.ofBounds 0 2 ⋯].get coordinate) (↑53404039637183640193063812600490242888959241450439383718635099870773763956705 / ↑115792089237316195423570985008687907853269984665640564039457584007913129639936)
The computation
Coordinates: x Certified domain: x ∈ [0, 2] ⊆ ℝ
Certified numerical guarantee
Guarantee: the input lies in the output interval throughout the box Decimal preview: outward-rounded to 6 places where it is a bound Exact certified output: [-2738491939741224980065545710511944340592687821623911616333681165377358429451/7237005577332262213973186563042994240829374041602535252466099000494570602496, 31496104119253840352539446916394688164217738877448090787965650547754896521097/57896044618658097711785492504343953926634992332820282019728792003956564819968] Precision policy: exp order 8, sqrt digits 12, log terms 10, subdivision depth 3
