Definition and explanation
This explanation was written alongside the formalization to describe the statement and its reasoning.
Definition
Lean definition
Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.
import Aeneas
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: F64]
abbrev F64 : Type :=
-- BODY
Std.U64
end dec2flt_model
Preservation and explanation
Natural-language argument
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.
Preservation argument
Claim
f64 by its complete to_bits word loses
no source encoding or public bit-level observation: on the full 64-bit domain,
including every NaN encoding, from_bits interprets every carrier word
and is inverse to to_bits at the level of raw encodings.Proof
f64 specialization sets Int = u64; its
to_bits method calls f64::to_bits, and its
from_u64_bits method passes the complete u64 to
f64::from_bits. Rust implements those two operations as the opposite
same-size transmutations and explicitly specifies exact-bit preservation,
including NaN payloads. The exact excerpts, hashes, tool identities, and
reproduction commands are recorded in
reference/model-evidence/float-carriers.txt.f64 with raw memory
word w. Transmutation by to_bits returns that same w, and
transmutation of w by from_bits creates an f64 with the
same raw memory word. Thus
from_bits(to_bits(x)) has exactly the encoding of x; this is a
bitwise statement and does not incorrectly use Rust floating-point equality on
NaNs. For the other direction, take any of the 2^{64} words w.
from_bits(w) creates the float encoding w, so applying
to_bits returns exactly w. This includes all words with an
all-ones exponent and nonzero fraction, regardless of sign, quiet/signaling
bit, or payload.Std.U64 a structure with one
BitVec 64 field, and every such bit vector is admitted. Therefore the
model carrier contains exactly the words in the two inverse arguments. The
carrier correspondence retains every raw encoding; meanings of classification
and operations on those words are supplied by their separate bindings.Requirement: parser totality
f64 intermediate and result in a parser execution has exactly one carrier word, and every carrier word represents a source f64 encoding. Thus this representation adds neither a restriction on those values nor a representation failure. Panic versus normal return, Ok versus Err, floating-point operation behavior, and control choices are established by the separate operation-binding and dispatcher preservation owners, not by this bijection.Requirement: parser numeric acceptance
f64 intermediate and result in a numeric parse has exactly one carrier word, and every carrier word represents a source f64 encoding, so the representation adds no restriction or failure. Normal return, production of Ok, operation behavior, and branch choices remain obligations of the separate operation-binding and dispatcher preservation owners.Requirement: parser invalid rejection
f64 intermediate produced before rejection has exactly one carrier word, every carrier word is source-representable, and an Err payload itself contains no float. Hence the carrier creates no representation restriction or failure; whether the parser returns normally with Err, and the operations and control choices leading there, are left to their separate preservation owners.Requirement: parser nan acceptance
Ok, and the operations constructing the result are left to their separate preservation owners.Requirement: parser infinity
Requirement: parser non nan results
Requirement: parser numeric sign
Requirement: parser signed zero
Requirement: parser exact rounding
f64 intermediate or result has exactly one retained word, and every carrier word, including every binary64 rounding target of DecimalGoalVocabularyDefault, is representable by a source f64. Thus comparison with the exact target introduces no carrier restriction or representation failure. Successful return and rounding-operation correctness are left to their separate preservation owners.Requirement: parser selected exponent
Requirement: parser selected magnitude sign
Requirement: dispatch abstract composition
f64 intermediate and result used by the native arithmetic, assembly, sign operation, and dispatcher has exactly one carrier word, and every carrier word represents a source f64 encoding. Hence the representation adds no restriction or representation failure to any contract implementation. Component behavior, normal returns, operation semantics, and dispatcher control choices are left to their separate preservation owners.Requirement: dispatch component compliance
f64 intermediate and result of the actual native, assembly, negation, and dispatcher calls has exactly one carrier word, and every carrier word is source-representable. Thus representing component values and rounding targets introduces no restriction or representation failure. Agreement of actual calls with their contracts, normal-return and deferral distinctions, operation behavior, and call-site control choices are left to the separate operation-binding and dispatcher preservation owners.Requirement: parser accumulated rounding
f64 intermediate and result has exactly one retained word, and every accumulated-value rounding target of DecimalGoalVocabularyDefault is a carrier word representable by a source f64. Hence target comparison adds no representation restriction or failure. Successful return and rounding correctness are left to their separate preservation owners.Requirement: parser equal target rounding
f64 intermediate and result has exactly one retained word, and every exact- or accumulated-value target of DecimalGoalVocabularyDefault is source-representable. Equality of targets and observation of the result are therefore exact complete-word observations with no representation restriction or failure. Successful return, rounding, and lexical-sign application are left to their separate preservation owners.Requirement: number helper acceptance
Requirement: number helper rejection
Requirement: number helper record bounds
negative, mantissa, and other fields are distinct source observations and do not use this float carrier.Requirement: number helper accumulated value
Requirement: special helper infinity
Some, and construction of the infinity are left to their separate preservation owners.Requirement: special helper nan
Some, and result construction are left to their separate preservation owners.Requirement: special helper rejection
None result contains no float, and any source f64 intermediate has exactly one carrier word with no representation failure. The carrier claim does not establish that the helper returns normally with None; that outcome and the branch behavior leading to it are left to their separate preservation owners.Requirement: native correct or defer
f64 input, arithmetic intermediate, and Some result in either native path has exactly one carrier word, and every carrier word, including each rounding target of DecimalGoalVocabularyDefault, is source-representable. Thus the carrier adds no value restriction or representation failure. Multiplication, division, sign application, normal return, and None/Some behavior are left to their separate operation-binding preservation owners.Requirement: integer correct or defer
f64, so interpreting a nondeferred pair adds no restriction or representation failure. The integer computation, deferral test, and correctness of the assembly operation are left to their separate preservation owners.Requirement: slow accumulated rounding
f64; its bits are retained exactly for comparison with the accumulated-value target. Thus interpretation adds no restriction or representation failure. Normal return, raw-pair computation, and assembly behavior are left to their separate preservation owners.Requirement: assembly correspondence
f64, and the returned float has that unique retained word. Hence the carrier adds no well-formedness condition or representation failure. Normal return and correctness of the cast, shift, OR, and from_bits operations are left to their separate operation-binding preservation owners.Requirement: classification totality
Requirement: classification determinism
Requirement: classification significand digit
Requirement: rounding totality
f64, so the carrier places no additional restriction on the target relation. Existence of a target is a property of that separate mathematical relation, not a consequence of the carrier bijection.Requirement: rounding determinism
f64; the bijection neither identifies distinct words nor excludes any word. Thus target equality is preserved exactly, while uniqueness itself remains a property of the separate rounding relation.Requirement: exponent value agreement
Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Uses
No declared dependencies.
Used by
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": "F64",
"closure_version": "patch_c_v1",
"active_decl_hash": "a6a7d00f8900da0428b974265c175ade7b4387dbbdb4a3cf8d99e4047458a178",
"active_statement_hash": "4f819467a6312039c7cf776828d79ddfb4a4ea32cb3c0bd1a241d54703504673",
"kernel_axioms": [],
"toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
"lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
"checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
"approved_axioms_hash": "d5c04ffa333d9b33b238a527f5beaa2be82e021d3e9c0bbe01b1310280f7f55a",
"axcheck_status": "Agreed",
"accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-12",
"boundary_theorems": {},
"strict_theorem_deps": {},
"strict_definition_deps": {}
}Prose assessment
{
"label": "Recorded Sound: VerifierPass",
"assessment_status": "VerifierPass",
"fingerprint_relation": "matches current fingerprint",
"assessment_fingerprint": "preservation-v1:e4a7dfa423d0306b5090cba9ceaba481dd2af1949a3affd30be8bee5d1dc28cb",
"current_fingerprint": "preservation-v1:e4a7dfa423d0306b5090cba9ceaba481dd2af1949a3affd30be8bee5d1dc28cb",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"sound_status": "Pass",
"substantiveness_status": "Pass"
}