DecimalSeqDuplicateLoops

Lean checked

Statement

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

Lemma · Identity of duplicated decimal-sequence loops

The extracted fractional-leading-zero loop is extensionally equal to the initial leading-zero loop. The fractional bulk loop is extensionally equal to the first bulk loop. Each of the three copied final zero-fill loops is extensionally equal to the first final zero-fill loop, at every slice, word, range, and 768-cell array argument of the appropriate type.

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_seq_parse_decimal_seq

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: DecimalSeqDuplicateLoops]
theorem DecimalSeqDuplicateLoops :
    (forall s : Slice Std.U8,
      num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop2 s =
        num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop0 s) /\
    (forall (s : Slice Std.U8) (i : Std.Usize)
        (a : Array Std.U8 768#usize),
      num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop5 s i a =
        num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop3 s i a) /\
    (forall (r : core.ops.range.Range Std.Usize)
        (a : Array Std.U8 768#usize),
      num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop4 r a =
        num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1 r a) /\
    (forall (r : core.ops.range.Range Std.Usize)
        (a : Array Std.U8 768#usize),
      num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop6 r a =
        num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1 r a) /\
    (forall (r : core.ops.range.Range Std.Usize)
        (a : Array Std.U8 768#usize),
      num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop7 r a =
        num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1 r a) := 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

Unfold the five pairs of extracted declarations in num imp dec2flt decimal seq parse decimal seq. In each pair the loop is the same Aeneas loop combinator with the same initial state. The two body declarations being supplied are definitionally identical: they perform the same emptiness/read/drop transition for leading zeroes, the same eight-byte guard/read/digit-test/write/drop transition for bulk scanning, or the same range-next/array-update transition for filling. Hence each pair of applications is definitionally equal, proving all five clauses.

Lean proof


  repeat' apply And.intro
  all_goals intros
  all_goals rfl

end dec2flt_model

Download Lean source · Download TeX source

Complete Lean module
import Tablet.num_imp_dec2flt_decimal_seq_parse_decimal_seq

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: DecimalSeqDuplicateLoops]
theorem DecimalSeqDuplicateLoops :
    (forall s : Slice Std.U8,
      num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop2 s =
        num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop0 s) /\
    (forall (s : Slice Std.U8) (i : Std.Usize)
        (a : Array Std.U8 768#usize),
      num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop5 s i a =
        num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop3 s i a) /\
    (forall (r : core.ops.range.Range Std.Usize)
        (a : Array Std.U8 768#usize),
      num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop4 r a =
        num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1 r a) /\
    (forall (r : core.ops.range.Range Std.Usize)
        (a : Array Std.U8 768#usize),
      num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop6 r a =
        num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1 r a) /\
    (forall (r : core.ops.range.Range Std.Usize)
        (a : Array Std.U8 768#usize),
      num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop7 r a =
        num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1 r a) := by
-- BODY
  repeat' apply And.intro
  all_goals intros
  all_goals rfl

end dec2flt_model

Proof structure

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

Explore this dependency tree

Inspect related source (79)
More program dependencies (46)
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
All 44 entries
Technical checking records
Local closure summary
{
  "node": "DecimalSeqDuplicateLoops",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "bc54f271c1989a8be5fec4e3d420930d72ca27e6d4ae5d0a39cd92f3e4cf4092",
  "active_statement_hash": "dd8843292523dc95677658ee39424c4e9842501a52b12037f99fd28482c0d9a2",
  "kernel_axioms": [
    "Classical.choice",
    "Quot.sound",
    "propext"
  ],
  "toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
  "lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
  "checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
  "approved_axioms_hash": "576e6bf9480cfd32f53c309c7ac8fb115c1ba6e413f299ed5ff9fa7c647e6769",
  "axcheck_status": "Agreed",
  "accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-181",
  "boundary_theorems": {},
  "strict_theorem_deps": {},
  "strict_definition_deps": {
    "num_imp_dec2flt_decimal_seq_parse_decimal_seq": "9e7517221a9d9566"
  }
}
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:09bfb71c1a5c67b0a648f2bf3dbb5102d6aa3ff4209802f968c9bb40c393aa26",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "substantiveness_status": "Pass"
}