NumberHelperSharpFractionBytes

Lean checked

Statement

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

Lemma · Certified sharp fractional byte list

There exists a byte list equal to 9223372036854120450 copies of ASCII 1 followed by the eight ASCII bytes of e-655359, and its length is 9223372036854120458.

Lean statement

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

import Tablet.Preamble

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: NumberHelperSharpFractionBytes]
theorem NumberHelperSharpFractionBytes : exists l : List Std.U8,
    l = List.replicate 9223372036854120450 49#u8 ++
      [101#u8, 45#u8, 54#u8, 53#u8, 53#u8, 51#u8, 53#u8, 57#u8] /\
    l.length = 9223372036854120458 := 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

Let E be the eight-byte list for e-655359, and take
l=(\operatorname{reverse}(E)\mathbin{++} \operatorname{replicate}(9223372036854120450,49))^{\mathrm{reverse}}.
Reversal of an append swaps its operands, reversal leaves a replicated constant list unchanged, and reversing E twice restores E. Hence l is the required replicated prefix followed by E. Reversal preserves length, so
|l|=|E|+9223372036854120450 =8+9223372036854120450=9223372036854120458.
Thus this l has both asserted properties.

Lean proof


  let tail : List Std.U8 :=
    [101#u8, 45#u8, 54#u8, 53#u8, 53#u8, 51#u8, 53#u8, 57#u8]
  let bs : List Std.U8 :=
    (tail.reverse ++ List.replicate 9223372036854120450 49#u8).reverse
  have hlen : bs.length = 9223372036854120458 := by
    simp only [bs, List.length_reverse, List.length_append,
      List.length_replicate, tail, List.length_cons, List.length_nil]
  refine ⟨bs, ?_, hlen⟩
  simp only [bs, List.reverse_append, List.reverse_replicate,
    List.reverse_reverse, tail]

end dec2flt_model

Download Lean source · Download TeX source

Complete Lean module
import Tablet.Preamble

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: NumberHelperSharpFractionBytes]
theorem NumberHelperSharpFractionBytes : exists l : List Std.U8,
    l = List.replicate 9223372036854120450 49#u8 ++
      [101#u8, 45#u8, 54#u8, 53#u8, 53#u8, 51#u8, 53#u8, 57#u8] /\
    l.length = 9223372036854120458 := by
-- BODY
  let tail : List Std.U8 :=
    [101#u8, 45#u8, 54#u8, 53#u8, 53#u8, 51#u8, 53#u8, 57#u8]
  let bs : List Std.U8 :=
    (tail.reverse ++ List.replicate 9223372036854120450 49#u8).reverse
  have hlen : bs.length = 9223372036854120458 := by
    simp only [bs, List.length_reverse, List.length_append,
      List.length_replicate, tail, List.length_cons, List.length_nil]
  refine ⟨bs, ?_, hlen⟩
  simp only [bs, List.reverse_append, List.reverse_replicate,
    List.reverse_reverse, tail]

end dec2flt_model

Proof structure

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

Explore this dependency tree

Inspect related source (44)
More program dependencies (11)
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": "NumberHelperSharpFractionBytes",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "4a22fdd9bcb9d86a0366058d454a8dcefb07d8931d2d11c498d73ef20087b004",
  "active_statement_hash": "9da0b9ffc0f9e96466f7a1d37eda3071f53c23533703180a072f50f6473e11e2",
  "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-111",
  "boundary_theorems": {},
  "strict_theorem_deps": {},
  "strict_definition_deps": {}
}
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:5a549b0d34f1944e113146d8ec6b6cf9943b0b0ab06035e4027587c53cc4672c",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "substantiveness_status": "Pass"
}