Binary64IntPow10Index

Lean checked

Statement

This explanation was written alongside the formalization to describe the statement and its reasoning.

Lemma

For every unsigned-size index i\le15, indexing the extracted 16-entry INT_POW10 array succeeds and returns an unsigned word whose value is exactly 10^i.

Lean statement

Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.

import Tablet.num_imp_dec2flt_decimal_INT_POW10

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxRecDepth 100000

namespace dec2flt_model

-- [TABLET NODE: Binary64IntPow10Index]
theorem Binary64IntPow10Index :
    ∀ i : Std.Usize, i.val ≤ 15 →
      ∃ p : Std.U64,
        Array.index_usize num.imp.dec2flt.decimal.INT_POW10 i = ok p ∧
        p.val = 10 ^ i.val := by
Proof

Natural-language proof

The status above describes the Lean proof. Its explanatory prose may remain a sketch after that proof closes.

Explanatory prose status

Prose retained as authored. The explanatory prose is preserved as it stood when captured.

Proof

By num imp dec2flt decimal INT POW10, the array has exactly the displayed entries 1,10,100,\ldots,10^{15}. The bound leaves the sixteen cases i=0,\ldots,15. In each case the checked array index is below the length 16, so it returns the corresponding entry normally; direct natural exponentiation computes that displayed entry to 10^i.

Lean proof


  intro i hi
  have cases : i.val = 0 ∨ i.val = 1 ∨ i.val = 2 ∨ i.val = 3 ∨
      i.val = 4 ∨ i.val = 5 ∨ i.val = 6 ∨ i.val = 7 ∨
      i.val = 8 ∨ i.val = 9 ∨ i.val = 10 ∨ i.val = 11 ∨
      i.val = 12 ∨ i.val = 13 ∨ i.val = 14 ∨ i.val = 15 := by omega
  rcases cases with h | h | h | h | h | h | h | h | h | h | h | h | h | h | h | h <;>
    simp [h, num.imp.dec2flt.decimal.INT_POW10.eq_def, Array.index_usize] <;>
    rfl

end dec2flt_model

Download Lean source · Download TeX source

Complete Lean module
import Tablet.num_imp_dec2flt_decimal_INT_POW10

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxRecDepth 100000

namespace dec2flt_model

-- [TABLET NODE: Binary64IntPow10Index]
theorem Binary64IntPow10Index :
    ∀ i : Std.Usize, i.val ≤ 15 →
      ∃ p : Std.U64,
        Array.index_usize num.imp.dec2flt.decimal.INT_POW10 i = ok p ∧
        p.val = 10 ^ i.val := by
-- BODY
  intro i hi
  have cases : i.val = 0 ∨ i.val = 1 ∨ i.val = 2 ∨ i.val = 3 ∨
      i.val = 4 ∨ i.val = 5 ∨ i.val = 6 ∨ i.val = 7 ∨
      i.val = 8 ∨ i.val = 9 ∨ i.val = 10 ∨ i.val = 11 ∨
      i.val = 12 ∨ i.val = 13 ∨ i.val = 14 ∨ i.val = 15 := by omega
  rcases cases with h | h | h | h | h | h | h | h | h | h | h | h | h | h | h | h <;>
    simp [h, num.imp.dec2flt.decimal.INT_POW10.eq_def, Array.index_usize] <;>
    rfl

end dec2flt_model

Proof structure

Follow the declared dependencies to read the supporting statements and proofs.

Explore this dependency tree

Inspect related source (45)
More program dependencies (12)
Standard-library dependencies (30)

Related source and models come from the extraction records and declared dependencies.

Proof assumptions and review

Lean checks the formal proof. Trellis also reviews how the statement corresponds to the intended requirement.

Transitive assumptions

This list combines the assumptions recorded for this declaration and its dependencies. It may include assumptions used by auxiliary declarations in those modules.

Helper theorems included
Technical checking records
Local closure summary
{
  "node": "Binary64IntPow10Index",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "d2f1d0cad77fae9ca2429061ee912c3a50b24e9ff47ae0b6082735a54ffa0260",
  "active_statement_hash": "e8592043f869eac5349cab2736db65d1ea73ad6c7ae865988464ca0a6b840559",
  "kernel_axioms": [
    "Classical.choice",
    "Quot.sound",
    "propext"
  ],
  "toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
  "lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
  "checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
  "approved_axioms_hash": "ab64d13f256386ee0e494a5abcc6a5db49512cf3d90bbdfcabd6327793a31f95",
  "axcheck_status": "Agreed",
  "accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-131",
  "boundary_theorems": {},
  "strict_theorem_deps": {
    "num_imp_dec2flt_decimal_INT_POW10": "65d9b056ee859df5"
  },
  "strict_definition_deps": {
    "num_imp_dec2flt_decimal_INT_POW10": "48c78c3dca210847"
  }
}
Prose assessment
{
  "label": "Lean proof closed; predictive prose review no longer required",
  "assessment_status": null,
  "fingerprint_relation": "unknown",
  "assessment_fingerprint": null,
  "current_fingerprint": "sound-v2:92ae69965add8d24c10379500e72004c7cc2b130c0480930156a7628362ae8c0",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "substantiveness_status": "Pass"
}