ModelF64Neg

Lean checked

Definition and explanation

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

Definition

\mathsf{ModelF64Neg}(x) successfully returns x with raw bit 63 toggled.

Lean definition

Trellis authored this Lean model for an operation outside the mechanical extraction. Modeling choices explains its behavior and review.

import Tablet.Binary64ModelDefault
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: ModelF64Neg]
def ModelF64Neg : F64 -> Result F64 :=
-- BODY
  Binary64ModelDefault.neg
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

For every binary64 word, including NaNs, this binding agrees with source negation by toggling exactly sign bit 63.

Proof

The frozen core source instantiates its scalar Neg implementation for f64, and that implementation's method is exactly fn neg(self) { -self }. The frozen extraction identifies F64.Insts.CoreOpsArithNegF64.neg with this exact Rust method, and the support manifest binds that external to this definition. These source, extraction, and binding identities, with their hashes, are recorded in reference/model-evidence/binary64-negation.txt.
For the operation's full word-level meaning, the frozen parser states that negation flips the sign bit in all edge cases, while the pinned primitive documentation guarantees that unary - preserves every other bit, including every NaN payload bit. The same evidence record retains a same-rustc, same-target symbolic probe whose input is an arbitrary u64 word and whose body applies that concrete trait method to f64::from_bits(w) before to_bits. Its optimized assembly loads 0x8000000000000000 and returns its xor with the symbolic input, with no branch or input restriction. Hence the result is w\mathbin{\mathsf{xor}}2^{63} for all 2^{64} words, including every signaling and quiet NaN payload. The definition is the neg field of Binary64ModelDefault, which returns exactly that xor word in ok; therefore it agrees extensionally with the extracted source operation on the entire modeled carrier.

Requirement: assembly correspondence

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: classification determinism

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: classification significand digit

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: classification totality

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: dispatch abstract composition

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: dispatch component compliance

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: exponent value agreement

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: integer correct or defer

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: native correct or defer

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: number helper acceptance

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: number helper accumulated value

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: number helper record bounds

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: number helper rejection

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser accumulated rounding

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser equal target rounding

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser exact rounding

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser infinity

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser invalid rejection

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser nan acceptance

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser non nan results

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser numeric acceptance

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser numeric sign

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser selected exponent

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser selected magnitude sign

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser signed zero

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: parser totality

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: rounding determinism

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: rounding totality

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: slow accumulated rounding

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: special helper infinity

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: special helper nan

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Requirement: special helper rejection

Because this binding is extensionally the cited source operation on the full modeled source domain, it changes none of this goal's executions or observations.

Download Lean source · Download TeX source

Proof structure

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

Explore this dependency tree

Inspect related source (2)

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": "ModelF64Neg",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "9d2ebb3e668687227a06d16f1e3573efd69337a0db62f346d757ea3b5fcc7af2",
  "active_statement_hash": "6f24f3eafc3d79986357df595e58376bcdee622dc020479bcf26d5ea4cca9a4f",
  "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-15",
  "boundary_theorems": {},
  "strict_theorem_deps": {},
  "strict_definition_deps": {
    "Binary64Model": "5786328d6a028d83",
    "Binary64ModelDefault": "47013ebe5c83894c",
    "F64": "ec4e25fbaf4e11d4"
  }
}
Prose assessment
{
  "label": "Recorded Sound: VerifierPass",
  "assessment_status": "VerifierPass",
  "fingerprint_relation": "matches current fingerprint",
  "assessment_fingerprint": "preservation-v1:8256e97f497b77c059eada8f9a0d514173fadb27e7b5f004cef81d1882a026e7",
  "current_fingerprint": "preservation-v1:8256e97f497b77c059eada8f9a0d514173fadb27e7b5f004cef81d1882a026e7",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "sound_status": "Pass",
  "substantiveness_status": "Pass"
}