Mode of #cas

N

The first digits of a closed real expression, with a theorem that every printed digit is right.

#cas [N d] e
gives the first d significant digits of the closed real expression e, truncated toward zero, with a theorem that they are the digits of the real number.

N returns a decimal approximation and a theorem enclosing the exact value of e between that decimal and the next one away from zero. The theorem is about Mathlib’s Real.pi, Real.exp and Real.sqrt, and Lean’s kernel checks its proof. For 2 to six digits the theorem is 1.41421≤2<1.41422.

Details and Options

  • For a positive value whose printed digits form the integer m, the theorem is m/10k≤e<(m+1)/10k. For a negative value it is −(m+1)/10k<e≤−m/10k. A value with more than d digits before the decimal point has m·10k in place of m/10k.
  • The digits are read from an interval that encloses the value. For a value with a short decimal expansion, such as cos(π/3)=12, the interval can fail to decide them. When four doublings of the working precision do not settle them, the report proves a decimal enclosure lo/10k≤e≤hi/10k instead.
  • e has no variables. It may use rational arithmetic, integer powers, sqrt, exp, log, sin, cos, tan, atan, asin, acos (also written arctan, arcsin, arccos), the hyperbolic functions, real powers with a positive base, and the constants pi (or π) and E.
  • BesselJ n q, erf q and the orthogonal polynomials at a rational point q have routes of their own. For BesselJ and erf the report gives a decimal enclosure of width at most 10−d, and d is at most 30.
  • d lies between 1 and the option cas.maxDigits, which is 2000 unless you set it.
  • The tactic cega proves the bounds that the digits imply, such as Real.sqrt 2 ≤ 1.415.

Examples (18)#

Basic Examples (3)

The square root of 2 to 20 digits:

In[1]:=
#cas [N 20] (sqrt 2)
Out[1]=

first 20 significant digits, truncated

1.4142135623730950488
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal digits

14142135623730950488 / 10 ^ 19 ≤ √2 ∧ √2 < (14142135623730950488 + 1) / 10 ^ 19

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal digits

    14142135623730950488 / 10 ^ 19 ≤ √2 ∧ √2 < (14142135623730950488 + 1) / 10 ^ 19

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

The computation
  • Certified numerical evaluation

    Working precision: 106 bits, 44 series terms, 84 logarithm terms
    Guarantee: every printed digit is a digit of the real value, truncated toward zero

A sum of two constants:

In[2]:=
#cas [N 10] (exp 1 + pi)
Out[2]=

first 10 significant digits, truncated

5.859874482
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal digits

5859874482 / 10 ^ 9 ≤ Real.exp 1 + Real.pi ∧ Real.exp 1 + Real.pi < (5859874482 + 1) / 10 ^ 9

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal digits

    5859874482 / 10 ^ 9 ≤ Real.exp 1 + Real.pi ∧ Real.exp 1 + Real.pi < (5859874482 + 1) / 10 ^ 9

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

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

Fifty digits of π:

In[3]:=
#cas [N 50] (pi)
Out[3]=

first 50 significant digits, truncated

3.1415926535897932384626433832795028841971693993751
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal digits

31415926535897932384626433832795028841971693993751 / 10 ^ 49 ≤ Real.pi ∧
  Real.pi < (31415926535897932384626433832795028841971693993751 + 1) / 10 ^ 49

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal digits

    31415926535897932384626433832795028841971693993751 / 10 ^ 49 ≤ Real.pi ∧
      Real.pi < (31415926535897932384626433832795028841971693993751 + 1) / 10 ^ 49

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

The computation
  • Certified numerical evaluation

    Working precision: 206 bits, 74 series terms, 150 logarithm terms
    Guarantee: every printed digit is a digit of the real value, truncated toward zero

Scope (6)

Trigonometric values, and an inverse function:

In[4]:=
#cas [N 30] (sin 1)
Out[4]=

first 30 significant digits, truncated

0.841470984807896506652502321630
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal digits

841470984807896506652502321630 / 10 ^ 30 ≤ Real.sin 1 ∧
  Real.sin 1 < (841470984807896506652502321630 + 1) / 10 ^ 30

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal digits

    841470984807896506652502321630 / 10 ^ 30 ≤ Real.sin 1 ∧
      Real.sin 1 < (841470984807896506652502321630 + 1) / 10 ^ 30

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

The computation
  • Certified numerical evaluation

    Working precision: 139 bits, 54 series terms, 106 logarithm terms
    Guarantee: every printed digit is a digit of the real value, truncated toward zero
In[5]:=
#cas [N 30] (sin (π / 7))
Out[5]=

first 30 significant digits, truncated

0.433883739117558120475768332848
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal digits

433883739117558120475768332848 / 10 ^ 30 ≤ Real.sin (Real.pi / 7) ∧
  Real.sin (Real.pi / 7) < (433883739117558120475768332848 + 1) / 10 ^ 30

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal digits

    433883739117558120475768332848 / 10 ^ 30 ≤ Real.sin (Real.pi / 7) ∧
      Real.sin (Real.pi / 7) < (433883739117558120475768332848 + 1) / 10 ^ 30

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

The computation
  • Certified numerical evaluation

    Working precision: 139 bits, 54 series terms, 106 logarithm terms
    Guarantee: every printed digit is a digit of the real value, truncated toward zero
In[6]:=
#cas [N 30] (arcsin (1 / 2))
Out[6]=

first 30 significant digits, truncated

0.523598775598298873077107230546
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal digits

523598775598298873077107230546 / 10 ^ 30 ≤ Real.arcsin (1 / 2) ∧
  Real.arcsin (1 / 2) < (523598775598298873077107230546 + 1) / 10 ^ 30

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal digits

    523598775598298873077107230546 / 10 ^ 30 ≤ Real.arcsin (1 / 2) ∧
      Real.arcsin (1 / 2) < (523598775598298873077107230546 + 1) / 10 ^ 30

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

The computation
  • Certified numerical evaluation

    Working precision: 139 bits, 54 series terms, 106 logarithm terms
    Guarantee: every printed digit is a digit of the real value, truncated toward zero

A cube root, written as a real power:

In[7]:=
#cas [N 30] (2 ^ (1 / 3 : ℝ))
Out[7]=

first 30 significant digits, truncated

1.25992104989487316476721060727
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal digits

125992104989487316476721060727 / 10 ^ 29 ≤ (2 : ℝ) ^ (1 / 3 : ℝ) ∧
  (2 : ℝ) ^ (1 / 3 : ℝ) < (125992104989487316476721060727 + 1) / 10 ^ 29

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal digits

    125992104989487316476721060727 / 10 ^ 29 ≤ (2 : ℝ) ^ (1 / 3 : ℝ) ∧
      (2 : ℝ) ^ (1 / 3 : ℝ) < (125992104989487316476721060727 + 1) / 10 ^ 29

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

The computation
  • Certified numerical evaluation

    Working precision: 139 bits, 54 series terms, 106 logarithm terms
    Guarantee: every printed digit is a digit of the real value, truncated toward zero

A negative value. Its digits are truncated toward zero too:

In[8]:=
#cas [N 25] (-log 2)
Out[8]=

first 25 significant digits, truncated

-0.6931471805599453094172321
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal digits

-(6931471805599453094172321 + 1) / 10 ^ 25 < -Real.log 2 ∧
  -Real.log 2 ≤ -6931471805599453094172321 / 10 ^ 25

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal digits

    -(6931471805599453094172321 + 1) / 10 ^ 25 < -Real.log 2 ∧
      -Real.log 2 ≤ -6931471805599453094172321 / 10 ^ 25

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

The computation
  • Certified numerical evaluation

    Working precision: 123 bits, 49 series terms, 95 logarithm terms
    Guarantee: every printed digit is a digit of the real value, truncated toward zero

A large value gets an exponent:

In[9]:=
#cas [N 20] (exp 100)
Out[9]=

first 20 significant digits, truncated

2.6881171418161354484×1043
2.6881171418161354484 × 10^43
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal digits

26881171418161354484 * 10 ^ 24 ≤ Real.exp 100 ∧ Real.exp 100 < (26881171418161354484 + 1) * 10 ^ 24

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal digits

    26881171418161354484 * 10 ^ 24 ≤ Real.exp 100 ∧ Real.exp 100 < (26881171418161354484 + 1) * 10 ^ 24

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

The computation
  • Certified numerical evaluation

    Working precision: 106 bits, 44 series terms, 84 logarithm terms
    Guarantee: every printed digit is a digit of the real value, truncated toward zero

The error function and a Bessel function have their own series. The report gives a decimal enclosure of width at most 10−d and the number of terms of the series:

In[10]:=
#cas [N 10] (erf (1/2))
Out[10]=

decimal enclosure of width at most 10^-10, with 10 terms of the series

[0.52049987781, 0.52049987782]
[0.52049987781, 0.52049987782]
Domain
error function erf x = 2/√π ∫₀ˣ e^(-t²) dt at a rational point

Checked by Lean’s kernel: Enclosure of erf 1/2

0.52049987781 ≤ CAS.erf (1 / 2) ∧
  CAS.erf (1 / 2) ≤ 0.52049987782 ∧ 0.52049987782 - 0.52049987781 ≤ 1 / 10 ^ 10

from CAS.erfCheck_sound

The certificate: 1 checked step
  1. Enclosure of erf 1/2

    0.52049987781 ≤ CAS.erf (1 / 2) ∧
      CAS.erf (1 / 2) ≤ 0.52049987782 ∧ 0.52049987782 - 0.52049987781 ≤ 1 / 10 ^ 10

    Checked by Lean’s kernel · CAS.erfCheck_sound

In[11]:=
#cas [N 10] (BesselJ 0 1)
Out[11]=

decimal enclosure of width at most 10^-10, with 8 terms of the series

[0.76519768655, 0.76519768656]
[0.76519768655, 0.76519768656]
Domain
Bessel function J_n at a rational point

Checked by Lean’s kernel: Enclosure of BesselJ 0 1

∃ r,
  Complex.besselJ ↑0 ↑1 = ↑r ∧
    ↑(15303953731 / 20000000000) ≤ r ∧
      r ≤ ↑(4782485541 / 6250000000) ∧ ↑(4782485541 / 6250000000) - ↑(15303953731 / 20000000000) ≤ 1 / 10 ^ 10
The certificate: 1 checked step
  1. Enclosure of BesselJ 0 1

    ∃ r,
      Complex.besselJ ↑0 ↑1 = ↑r ∧
        ↑(15303953731 / 20000000000) ≤ r ∧
          r ≤ ↑(4782485541 / 6250000000) ∧ ↑(4782485541 / 6250000000) - ↑(15303953731 / 20000000000) ≤ 1 / 10 ^ 10

    Checked by Lean’s kernel


An orthogonal polynomial at a rational point has an exact value, and you get it together with its digits:

In[12]:=
#cas [N 10] (ChebyshevT 5 (1/3))
Out[12]=

exact rational value and its first 10 significant digits, truncated

241243≈0.9917695473
241/243 ≈ 0.9917695473
Domain
ChebyshevT polynomial at a rational point

Checked by Lean’s kernel: Exact value and digits of ChebyshevT 5

Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) = 241 / 243 ∧
  9917695473 / 10 ^ 10 ≤ Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) ∧
    Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) < (9917695473 + 1) / 10 ^ 10
The certificate: 1 checked step
  1. Exact value and digits of ChebyshevT 5

    Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) = 241 / 243 ∧
      9917695473 / 10 ^ 10 ≤ Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) ∧
        Polynomial.eval (1 / 3) (Polynomial.Chebyshev.T ℝ 5) < (9917695473 + 1) / 10 ^ 10

    Checked by Lean’s kernel

Applications (2)

Digits in a proof. cega proves a bound that the printed digits of 2 imply. Only the three standard axioms are used:

In[13]:=
theorem digits_sqrt_two : Real.sqrt 2 ≤ 1.415 := by
  cega

#print axioms digits_sqrt_two
Out[13]=

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


A constant from a closed form. Here is arctan13+log3+5 to 40 digits:

In[14]:=
#cas [N 40] (atan (1 / 3) + log 3 + sqrt 5)
Out[14]=

first 40 significant digits, truncated

3.656430820564541581205823520012463259108
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal digits

3656430820564541581205823520012463259108 / 10 ^ 39 ≤ Real.arctan (1 / 3) + Real.log 3 + √5 ∧
  Real.arctan (1 / 3) + Real.log 3 + √5 < (3656430820564541581205823520012463259108 + 1) / 10 ^ 39

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal digits

    3656430820564541581205823520012463259108 / 10 ^ 39 ≤ Real.arctan (1 / 3) + Real.log 3 + √5 ∧
      Real.arctan (1 / 3) + Real.log 3 + √5 < (3656430820564541581205823520012463259108 + 1) / 10 ^ 39

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

The computation
  • Certified numerical evaluation

    Working precision: 172 bits, 64 series terms, 128 logarithm terms
    Guarantee: every printed digit is a digit of the real value, truncated toward zero

Properties and Relations (2)

enclose gives an interval with rational endpoints instead of digits. Its precision is set by (prec := n):

In[15]:=
#cas [enclose] (sqrt 2)
Out[15]=

certified interval in ℝ

[181128, 57934096]
[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
  1. Enclosure of the input

    181 / 128 ≤ √2 ∧ √2 ≤ 5793 / 4096

    Checked by Lean’s kernel · CAS.Tactic.BoxInequality.mem_of_enclosedOn_box

  2. Upper bound of the input

    √2 ≤ 5793 / 4096

    Checked by Lean’s kernel · CAS.Tactic.BoxInequality.le_of_boundOn_box

  3. Absolute bound of the input

    |√2| ≤ 5793 / 4096

    Checked by Lean’s kernel · CAS.Tactic.BoxInequality.abs_le_of_boundOn_abs_box

  4. Center and radius of the input

    |√2 - 11585 / 8192| ≤ 1 / 8192

    Checked by Lean’s kernel · CAS.Tactic.BoxInequality.abs_sub_le_of_approxOn_box

  5. 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)

    Checked by Lean’s kernel · CAS.Continuum.RationalInterval.EnclosureAttempt.enclosedOn_of_interval_eq

  6. 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)

    Checked by Lean’s kernel · CAS.Continuum.RationalInterval.EnclosureAttempt.boundOn_of_interval_eq

  7. 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)

    Checked by Lean’s kernel · CAS.Continuum.RationalInterval.EnclosureAttempt.boundOn_abs_of_interval_eq

  8. 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)

    Checked by Lean’s kernel · CAS.Continuum.RationalInterval.EnclosureAttempt.approxOn_center_of_interval_eq

The computation
  • Coordinates: none
    Certified domain: closed real expression
  • Certified numerical guarantee

    Guarantee: the real value lies in the output interval
In[16]:=
#cas (prec := 16) [enclose] (sqrt 2)
Out[16]=

certified interval in ℝ

[9268165536, 4634132768]
[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
  1. Enclosure of the input

    92681 / 65536 ≤ √2 ∧ √2 ≤ 46341 / 32768

    Checked by Lean’s kernel · CAS.Tactic.BoxInequality.mem_of_enclosedOn_box

  2. Upper bound of the input

    √2 ≤ 46341 / 32768

    Checked by Lean’s kernel · CAS.Tactic.BoxInequality.le_of_boundOn_box

  3. Absolute bound of the input

    |√2| ≤ 46341 / 32768

    Checked by Lean’s kernel · CAS.Tactic.BoxInequality.abs_le_of_boundOn_abs_box

  4. Center and radius of the input

    |√2 - 185363 / 131072| ≤ 1 / 131072

    Checked by Lean’s kernel · CAS.Tactic.BoxInequality.abs_sub_le_of_approxOn_box

  5. 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)

    Checked by Lean’s kernel · CAS.Continuum.RationalInterval.EnclosureAttempt.enclosedOn_of_interval_eq

  6. 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)

    Checked by Lean’s kernel · CAS.Continuum.RationalInterval.EnclosureAttempt.boundOn_of_interval_eq

  7. 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)

    Checked by Lean’s kernel · CAS.Continuum.RationalInterval.EnclosureAttempt.boundOn_abs_of_interval_eq

  8. 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)

    Checked by Lean’s kernel · CAS.Continuum.RationalInterval.EnclosureAttempt.approxOn_center_of_interval_eq

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

The value cos(π/3)=12 has a short decimal expansion, and the report gives an enclosure. Every interval around 12 that the evaluator finds holds numbers starting with 0.4 and numbers starting with 0.5, so no truncated digit can be proved:

In[17]:=
#cas [N 20] (cos (pi / 3))
Out[17]=

certified decimal enclosure

[0.49999999999999999999, 0.50000000000000000001]
[0.49999999999999999999, 0.50000000000000000001]
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal enclosure

49999999999999999999 / 10 ^ 20 ≤ Real.cos (Real.pi / 3) ∧
  Real.cos (Real.pi / 3) ≤ 50000000000000000001 / 10 ^ 20

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal enclosure

    49999999999999999999 / 10 ^ 20 ≤ Real.cos (Real.pi / 3) ∧
      Real.cos (Real.pi / 3) ≤ 50000000000000000001 / 10 ^ 20

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

The computation
  • Certified numerical evaluation

    Working precision: 106 bits, 44 series terms, 84 logarithm terms
    Guarantee: the real value lies in the printed decimal enclosure

Possible Issues (4)

N evaluates closed expressions only. For an expression with a variable, enclose works on a box:

In[18]:=
#cas [N 15] (x + 1)
Out[18]=

Error

N needs a closed expression; free symbols: x

At least one digit, and at most cas.maxDigits:

In[19]:=
#cas [N 0] (pi)
Out[19]=

Error

N accepts between 1 and 2000 digits
In[20]:=
set_option cas.maxDigits 10 in
#cas [N 20] (pi)
Out[20]=

Error

N accepts between 1 and 10 digits

The series of erf and BesselJ stop at 30 digits:

In[21]:=
#cas [N 31] (erf 1)
Out[21]=

Error

erf accepts at most 30 digits

Lean defines Real.log 0 = 0, but N evaluates a logarithm only when it has certified that the argument is positive:

In[22]:=
#cas [N 10] (log 0)
Out[22]=

Error

N could not enclose this expression: a logarithm or square root of a value not certified positive, a quotient by an interval containing zero, or a real power with a base not certified positive

Neat Examples (1)

A thousand digits of π, each one proved:

In[23]:=
#cas [N 1000] (pi)
Out[23]=

first 1000 significant digits, truncated

3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198
Domain
closed real expression

Checked by Lean’s kernel: Certified decimal digits

3141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198 /
      10 ^ 999 ≤
    Real.pi ∧
  Real.pi <
    (3141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198 +
        1) /
      10 ^ 999

from CAS.Continuum.DigitsEval.eval_sound

The certificate: 1 checked step
  1. Certified decimal digits

    3141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198 /
          10 ^ 999 ≤
        Real.pi ∧
      Real.pi <
        (3141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198 +
            1) /
          10 ^ 999

    Checked by Lean’s kernel · CAS.Continuum.DigitsEval.eval_sound

The computation
  • Certified numerical evaluation

    Working precision: 3362 bits, 1024 series terms, 2240 logarithm terms
    Guarantee: every printed digit is a digit of the real value, truncated toward zero

See Also

enclose · nintegrate · findRoot · cega · Options