F64

Lean checked

Definition and explanation

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

Definition

The model carrier \mathsf{F64} is the set of unsigned 64-bit words. A word records the complete IEEE-754 binary64 representation, including its sign bit, exponent, significand, signed-zero distinction, infinities, and NaN payload.

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

Representing a Rust f64 by its complete to_bits word loses no source value or public bit-level observation: from_bits supplies the inverse interpretation of every 64-bit word.

Proof

The source fixes the unsigned companion of f64 to u64, uses to_bits for observation, and uses from_bits for assembly. The Aeneas scalar chosen here contains exactly one 64-bit vector. Consequently the model carrier is in bijection with all binary64 encodings and retains sign, signed zero, finite values, infinities, and every NaN payload. This claim is about representation only; meanings of arithmetic, comparison, classification, and casts remain separate model-support obligations. The source excerpts and the Aeneas carrier definition are recorded in reference/model-evidence/float-carriers.txt.

Requirement: parser totality

Changing only the representation of returned floats to their complete words neither removes nor adds a normal return or error.

Requirement: parser numeric acceptance

The carrier represents every possible accepted binary64 result, so acceptance is not restricted.

Requirement: parser invalid rejection

Errors carry no float, so the carrier choice does not alter rejection.

Requirement: parser nan acceptance

All binary64 NaN encodings are retained and can be recognized from their exponent and significand fields.

Requirement: parser infinity

The positive and negative infinity words, including their distinct sign bits, are retained exactly.

Requirement: parser non nan results

Because every exponent and significand bit is retained, the NaN/non-NaN distinction can be stated without loss.

Requirement: parser numeric sign

The lexical-sign observation is the most significant bit of the retained word, including zero and infinity.

Requirement: parser signed zero

The distinct positive- and negative-zero words are retained rather than identified by numerical equality.

Requirement: parser exact rounding

Every binary64 rounding target is an exact 64-bit encoding in this carrier; the separate rounding definition supplies its numerical meaning.

Requirement: parser selected exponent

This property concerns a raw pair before conversion to the float carrier, so the representation does not weaken it.

Requirement: parser selected magnitude sign

The assembled magnitude word is directly an element of this carrier and its sign bit is observable exactly.

Requirement: dispatch abstract composition

The result side of every component contract can retain the complete binary64 word, including all classifications and signs.

Requirement: dispatch component compliance

The actual component outputs and final result can be related bit-for-bit through this carrier.

Requirement: parser accumulated rounding

Every binary64 target for the accumulated value has an exact carrier word.

Requirement: parser equal target rounding

Equality of rounding targets may be expressed as equality of their retained binary64 words.

Requirement: number helper acceptance

The numeric helper returns only a decimal record, so the float carrier is noninterfering.

Requirement: number helper rejection

The numeric helper returns only an optional decimal record, so the float carrier is noninterfering.

Requirement: number helper record bounds

The record fields are integers and a Boolean, so the float carrier is noninterfering.

Requirement: number helper accumulated value

The diagnostic value is determined by decimal-record fields, so the float carrier is noninterfering.

Requirement: special helper infinity

Both signed infinity encodings are retained exactly, so the helper's result and separate sign remain observable.

Requirement: special helper nan

Every returned NaN encoding remains representable and classifiable from its retained fields.

Requirement: special helper rejection

A None result contains no float, so the carrier choice does not alter rejection.

Requirement: native correct or defer

Every possible Some binary64 result, including its sign, is represented by its exact word; None is unchanged.

Requirement: integer correct or defer

The helper returns a raw pair rather than an f64, so this carrier is used only when interpreting its assembled word.

Requirement: slow accumulated rounding

The helper returns a raw pair rather than an f64, so this carrier is used only when interpreting its assembled word.

Requirement: assembly correspondence

The source assembles a u64 word and reinterprets it as f64; this carrier keeps precisely that word.

Requirement: classification totality

Literal classification is over byte strings and does not depend on the float representation.

Requirement: classification determinism

Literal classification is over byte strings and does not depend on the float representation.

Requirement: classification significand digit

The grammar property is over byte strings and does not depend on the float representation.

Requirement: rounding totality

Every finite or infinite binary64 magnitude target has a unique standard word retained by this carrier.

Requirement: rounding determinism

A unique binary64 magnitude target is faithfully observable as its unique retained word.

Requirement: exponent value agreement

Agreement of binary64 targets can be expressed without representational loss as agreement of retained words.

Download Lean source · Download TeX source

Proof structure

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

Uses

Dependency links are unavailable for this declaration.

Explore this dependency tree

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": "b3d2e5a7a57ad9d2abdfb1c60bd76050a5cafa6a2be969c219d3ae71b2a8ade5",
  "axcheck_status": "Agreed",
  "accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-1",
  "boundary_theorems": {},
  "strict_theorem_deps": {},
  "strict_definition_deps": {}
}
Prose assessment
{
  "label": "Prose review has no verdict in this snapshot",
  "assessment_status": null,
  "fingerprint_relation": "unknown",
  "assessment_fingerprint": null,
  "current_fingerprint": "preservation-v1:4161f85784ae9eea264253ecad8b88714279984dab8d3e0df1fb5ac039e73e55",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "substantiveness_status": "Pass"
}