ModelF64Div

Lean checked

Definition and explanation

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

Definition

\mathsf{ModelF64Div} is the exact binary64 division operation supplied by Binary64ModelDefault.

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: ModelF64Div]
def ModelF64Div : F64 -> F64 -> Result F64 :=
-- BODY
  Binary64ModelDefault.div
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

This binding agrees with source binary64 division on finite operands with nonzero divisor and implements the IEEE zero, infinity, and source-permitted NaN cases elsewhere.

Proof

The definition is the exact-rational division field of Binary64ModelDefault. Its field decoding, nearest-even rounding, signed-zero handling, special cases, and permitted NaN choice are justified by reference/model-evidence/binary64-boundary.txt.
It remains to establish the narrower fact needed at every source call site. The frozen source in that evidence record has exactly one binary64 division expression: the negative-exponent branch of the ordinary try_fast_path arm. Thus, in every execution of a pursued source subject, either that expression is not reached and no binary64 division result is replaced, or it is reached after the can_use_fast_path guards. In the latter case those guards give \mathit{mantissa}\leq 2^{53} and -22\leq\mathit{exponent}<0, so the negated power-table index is in 1,\ldots,22. Applying Binary64NativeCallDomain to these derived bounds shows that conversion of the mantissa returns a finite, non-NaN numerator and that the selected table entry returns a finite, non-NaN, positive, nonzero divisor. The exact finite-operand, nonzero-divisor clause of Binary64ModelDefault therefore makes ModelF64Div return exactly the source binary64 quotient, including its sign and rounded raw word. Consequently, on every source execution, replacing the bound division has the following local effect only: an executed division returns the same value and the subsequent execution is unchanged, while an execution with no division call is unaffected.

Requirement: assembly correspondence

The subject is biased_fp_to_float, whose source body only casts the biased exponent, shifts it, ORs it with the mantissa, and calls from_u64_bits; it never invokes binary64 division, as recorded in reference/model-evidence/binary64-boundary.txt. This binding therefore cannot affect the claimed assembled word.

Requirement: classification determinism

This is a mathematical uniqueness statement about the decimal classification relation. That relation performs no source execution and contains no binary64 division, so this operational binding is irrelevant to its classification and parsed-content observations.

Requirement: classification significand digit

This is a mathematical statement about the grammar of a classified numeric lexeme. Its significand-digit observation neither executes the parser nor uses binary64 division, so this binding cannot affect it.

Requirement: classification totality

This is a mathematical exhaustiveness statement for the decimal classification relation on finite byte strings. The relation has no binary64 operation or program execution, so division is absent from the goal's subject.

Requirement: dispatch abstract composition

The common local-replacement fact applies to every actual dispatcher execution relevant to modeling this statement: an execution with no division is unaffected, and any executed division returns exactly its source value. A purely abstract implication over arbitrary components does not invoke this source binding. This application asserts neither that the component contracts are inhabited nor that the source supplies an inhabitant; those are the positive GOAL's own obligations, not premises of this preservation argument.

Requirement: dispatch component compliance

For every actual component execution considered by this statement, the common local-replacement fact preserves the execution: absence of a division call is unaffected, and an executed call returns exactly the same source binary64 value. This establishes only preservation of the component's source behavior; it does not assert that the behavior satisfies, agrees with, or inhabits any contract. Those compliance and call-site claims remain the unchanged positive GOAL obligations.

Requirement: exponent value agreement

This is a mathematical comparison of exact and bounded-accumulation decimal values and their rounding targets. It executes no source code and uses no binary64 division operation, so the binding has no observation in this goal.

Requirement: integer correct or defer

The subject is compute_float. Its source body performs integer table arithmetic and returns a raw BiasedFp; the exact source excerpt in reference/model-evidence/binary64-boundary.txt records that it contains no primitive float division. This binding therefore cannot change either deferral or the returned raw pair.

Requirement: native correct or defer

For every try_fast_path execution, the common exhaustive split applies: if the source makes no binary64 division call this binding is irrelevant, and if it makes the call ModelF64Div returns exactly the executed source quotient. Hence this local replacement preserves the actual None or Some result without assuming that the positive correctness-or-defer conclusion holds.

Requirement: number helper acceptance

The goal's subject is parse_number. Its recorded source body only accepts a complete Decimal returned by parse_partial_number; it has no float type parameter and executes no float operation, including division (reference/model-evidence/binary64-boundary.txt).

Requirement: number helper accumulated value

This goal observes only the Decimal record returned by parse_number. The recorded source boundary shows that this helper has no float type parameter or float operation, so no binary64 division can affect the record or its represented interval (reference/model-evidence/binary64-boundary.txt).

Requirement: number helper record bounds

The relevant execution ends when parse_number returns its Decimal record. As its exact source body in reference/model-evidence/binary64-boundary.txt shows, it invokes no float conversion or arithmetic, hence no binary64 division can affect the record's sign or mantissa bound.

Requirement: number helper rejection

Rejection is decided entirely inside parse_number: the helper returns None unless parse_partial_number consumed the entire slice. The recorded body has no float type parameter or float operation, so this division binding is not reached (reference/model-evidence/binary64-boundary.txt).

Requirement: parser accumulated rounding

For every public-parser execution quantified by this statement, the common local-replacement fact applies without assuming which route the input takes: an execution with no division is unaffected, and any executed division returns exactly its source result. Thus the binding preserves the returned word for the accumulated-value observation without assuming that the observation satisfies the positive GOAL.

Requirement: parser equal target rounding

For every public-parser execution quantified by this conditional statement, the common local-replacement fact applies independently of its route: no-call executions are unaffected, and an executed division returns exactly its source value. The binding therefore preserves the returned raw word to which the equal-target condition is applied, without assuming the bridge conclusion.

Requirement: parser exact rounding

For every public-parser execution in this statement's domain, the common local-replacement fact applies without assuming acceptance or a particular conversion route. Executions with no division are unchanged, and every executed division returns the same source raw word. This preserves the result whose exact-rounding property is stated, but does not establish that property.

Requirement: parser infinity

For every source execution on an infinity literal, without assuming how parse_number or parse_partial_number routes that input, the common local-replacement fact applies. If no division is reached the execution is unaffected; if one is reached it returns exactly its source value. Thus the binding preserves the actual returned result and sign without assuming the positive infinity conclusion.

Requirement: parser invalid rejection

For every source execution on a string outside the stated grammar, without assuming any parse_number or parse_partial_number routing fact, the common local-replacement fact applies. An execution with no division is unaffected, and any division that is reached returns exactly its source value. Hence this binding preserves the actual result or error without assuming the positive rejection conclusion.

Requirement: parser nan acceptance

For every source execution on a NaN literal, without assuming how parse_number or parse_partial_number routes that input, the common local-replacement fact applies. An execution with no division is unaffected, and any executed division returns exactly its source value. This preserves the actual result and its category without assuming acceptance or the positive NaN conclusion.

Requirement: parser non nan results

For every public-parser execution quantified by this statement, the common local-replacement fact applies independently of whether it succeeds or which route it takes. No-call executions are unchanged, and every executed division returns the same source word, hence has the same NaN classification. This preserves the observation without assuming the positive no-spurious-NaNs conclusion.

Requirement: parser numeric acceptance

For every source execution on a numeric literal, the common local-replacement fact applies without assuming that parsing succeeds or which conversion route is selected. If the execution makes no division call it is unaffected; if it makes the call, the binding returns exactly the source quotient. The actual result or error is therefore preserved without assuming numeric acceptance.

Requirement: parser numeric sign

For every public-parser execution in this statement's domain, the common local-replacement fact applies without assuming success or a particular route. Executions without division are unchanged, while an executed division returns the identical source word, including its sign bit. Thus the binding preserves the actual sign observation without assuming the positive sign conclusion.

Requirement: parser selected exponent

For every public-parser execution quantified by this trace statement, the common local-replacement fact applies without assuming that a pair is selected or which route is taken. A no-division execution is unchanged; an executed division returns the same source value and therefore leaves all subsequent control flow and trace observations unchanged. This does not assume the positive exponent-range conclusion.

Requirement: parser selected magnitude sign

For every public-parser execution quantified by this trace statement, the common local-replacement fact applies without assuming that assembly is reached or a pair is selected. Executions without division are unaffected; an executed division returns exactly its source value and preserves later control flow and trace data. This preserves the magnitude-word observation without assuming that its sign bit is clear.

Requirement: parser signed zero

For every public-parser execution in this statement's domain, including any execution whose exact input value is zero, the common local-replacement fact applies without assuming acceptance or a route. A no-call execution is unaffected; an executed division returns the identical source word, including its zero and sign bits. The binding therefore preserves the observed result without assuming the positive signed-zero conclusion.

Requirement: parser totality

For every public-parser execution on every Rust string, the common local-replacement fact applies without assuming termination or a particular route. A no-division execution is unaffected. Whenever division is reached, the binding returns normally with exactly the source quotient, so this local replacement introduces neither a new failure nor changed control flow. This preserves the source execution's termination behavior without asserting the positive totality conclusion.

Requirement: rounding determinism

The goal concerns uniqueness in the mathematical binary64 magnitude-rounding relation for nonnegative reals. It neither runs the source parser nor invokes an arithmetic operation, so this division binding is absent from its subject.

Requirement: rounding totality

The goal is an existence statement in the mathematical binary64 magnitude-rounding relation. It contains no source execution and no binary64 division call, so the binding cannot affect its target witness.

Requirement: slow accumulated rounding

The subject is parse_long_mantissa. Its recorded source body uses decimal-sequence shifts and integer rounding and returns a raw BiasedFp; it contains no primitive float division or other float arithmetic (reference/model-evidence/binary64-boundary.txt). Thus this binding cannot affect its returned pair.

Requirement: special helper infinity

The subject is parse_inf_nan. For an infinity keyword its exact source path selects the infinity constant and conditionally applies negation; it contains no division call, as recorded in reference/model-evidence/binary64-boundary.txt.

Requirement: special helper nan

The subject is parse_inf_nan. For a NaN keyword its exact source path selects the NaN constant and conditionally applies negation; it contains no division call, as recorded in reference/model-evidence/binary64-boundary.txt. This application asserts only the NaN category, not equality of any arithmetic NaN raw word.

Requirement: special helper rejection

The subject is parse_inf_nan; an unrecognized keyword takes its None branch before any special constant or negation is returned. The recorded source body contains no binary64 division on either success or rejection (reference/model-evidence/binary64-boundary.txt).

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": "ModelF64Div",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "0c948ac9bf01c866651ba1387d8a45f1f14c0ea412262fa7db522286e4ea43e4",
  "active_statement_hash": "3ab9296c58d0bfdb06c8341d7d869514b59a5b1ab139ef7eeb299b9f05df0d27",
  "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": "11d6f0ac18a2ac43",
    "Binary64ModelDefault": "47013ebe5c83894c",
    "F64": "ec4e25fbaf4e11d4"
  }
}
Prose assessment
{
  "label": "Recorded Sound: VerifierPass",
  "assessment_status": "VerifierPass",
  "fingerprint_relation": "matches current fingerprint",
  "assessment_fingerprint": "preservation-v1:090c7e07ff2c70e7fa9e3afeb3fae23146b6aacbeedb6887a6d4e224a7d726eb",
  "current_fingerprint": "preservation-v1:090c7e07ff2c70e7fa9e3afeb3fae23146b6aacbeedb6887a6d4e224a7d726eb",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "sound_status": "Pass",
  "substantiveness_status": "Pass"
}