ModelF64Mul

Lean checked

Definition and explanation

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

Definition

\mathsf{ModelF64Mul} is the exact binary64 multiplication 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: ModelF64Mul]
def ModelF64Mul : F64 -> F64 -> Result F64 :=
-- BODY
  Binary64ModelDefault.mul
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 multiplication on all finite operands and returns a source-permitted quiet NaN in NaN-producing cases.

Proof

The definition is the exact-rational multiplication field of Binary64ModelDefault. Its field decoding, nearest-even rounding, signed-zero handling, infinity cases, and permitted NaN choice are justified by reference/model-evidence/binary64-boundary.txt.

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 multiplication, 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 multiplication, 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 multiplication, 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 multiplication is absent from the goal's subject.

Requirement: dispatch abstract composition

The abstract implication over arbitrary components does not invoke this source binding. For every actual dispatcher execution, binary64 multiplication is either not reached or occurs in one of the two native arms. In the ordinary arm, the source guards recorded in reference/model-evidence/binary64-boundary.txt give \mathit{mantissa}\leq2^{53} and a power-table index in 0,\ldots,22; in the disguised arm, the checked multiplied mantissa is at most 2^{53} and the table index is 22. By Binary64NativeCallDomain, both operands are finite and non-NaN in either case, so the exact finite-operand clause above reproduces every multiplication that is actually reached. This application asserts neither that the component contracts are inhabited nor that the source supplies a witness; those remain obligations of the positive GOAL.

Requirement: dispatch component compliance

For every actual component execution, the same source guards and Binary64NativeCallDomain show that each multiplication that is reached has finite, non-NaN operands, so the exact finite-operand clause above returns exactly the source binary64 value; an execution with no multiplication call is unaffected. This source/model equality preserves the component execution and therefore preserves the truth value of any later claim that its result agrees with a contract. It does not assert that a compliant contract instance exists or that the source agrees with one.

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 multiplication 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 multiplication. This binding therefore cannot change either deferral or the returned raw pair.

Requirement: native correct or defer

Binary64 multiplication is reached in the ordinary native arm when the exponent is nonnegative and in the disguised native arm. In the ordinary arm, the can_use_fast_path guards in reference/model-evidence/binary64-boundary.txt give \mathit{mantissa}\leq2^{53} and 0\leq\mathit{exponent}\leq22. In the disguised arm, checked_mul must succeed and the resulting mantissa is explicitly checked to be at most 2^{53} before multiplication by table entry 22. Applying Binary64NativeCallDomain gives finite non-NaN operands in both arms, so the exact finite-operand multiplication clause above agrees with the source on every executed binary64 multiplication; the negative-exponent ordinary arm divides instead.

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 multiplication (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 multiplication 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 multiplication 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 multiplication binding is not reached (reference/model-evidence/binary64-boundary.txt).

Requirement: parser accumulated rounding

A numeric dispatcher execution can multiply in the ordinary native arm with a nonnegative exponent or in the disguised native arm. The source guards in reference/model-evidence/binary64-boundary.txt respectively give \mathit{mantissa}\leq2^{53} and a table index in 0,\ldots,22, or a checked multiplied mantissa at most 2^{53} and table index 22. Applying Binary64NativeCallDomain yields finite non-NaN operands in both cases. Hence the exact finite-operand multiplication clause above preserves the native result whose accumulated-value rounding is observed; every non-native path avoids float multiplication.

Requirement: parser equal target rounding

The relevant multiplication is in the nonnegative-exponent ordinary native arm or the disguised native arm. The source guards in reference/model-evidence/binary64-boundary.txt bound the ordinary converted mantissa by 2^{53} and its table index by 22; in the disguised arm they bound the checked multiplied mantissa by 2^{53} and fix the table index at 22. By Binary64NativeCallDomain, both operands are finite and non-NaN in either case, so the exact finite-operand multiplication clause above preserves the returned word used by the equal-target bridge. Other dispatcher paths do not perform float multiplication.

Requirement: parser exact rounding

An accepted numeric execution can multiply in the nonnegative-exponent ordinary native arm or in the disguised native arm. Its source guards, recorded in reference/model-evidence/binary64-boundary.txt, give the ordinary arm a mantissa at most 2^{53} and table index in 0,\ldots,22; the disguised arm checks its multiplied mantissa at most 2^{53} and uses table index 22. Applying Binary64NativeCallDomain makes both operands finite and non-NaN in each arm. Therefore the exact finite-operand multiplication clause above preserves the native rounded word; the integer/slow assembly route performs no float multiplication.

Requirement: parser infinity

For an infinity literal, numeric parsing returns None and the dispatcher takes the special-helper branch. The source excerpt in reference/model-evidence/binary64-boundary.txt shows that this branch selects the infinity constant and conditionally negates it; it never calls try_fast_path or binary64 multiplication.

Requirement: parser invalid rejection

On the invalid branch, parse_number and then parse_inf_nan both return None, after which the dispatcher returns the parsing error. The former has no float operation and the latter only selects a special constant and conditionally negates on success, as recorded in reference/model-evidence/binary64-boundary.txt; this branch never reaches try_fast_path or binary64 multiplication.

Requirement: parser nan acceptance

For a NaN literal, numeric parsing returns None and the dispatcher takes the special-helper branch. That branch selects the NaN constant and conditionally negates it, as recorded in reference/model-evidence/binary64-boundary.txt; it does not call try_fast_path or binary64 multiplication, and no raw-word identity for an arithmetic NaN is asserted.

Requirement: parser non nan results

A successful non-NaN parse can reach binary64 multiplication only through the nonnegative-exponent ordinary native arm or the disguised native arm. The source guards in reference/model-evidence/binary64-boundary.txt give the ordinary arm a mantissa at most 2^{53} and a table index in 0,\ldots,22; the disguised arm has a checked multiplied mantissa at most 2^{53} and table index 22. Applying Binary64NativeCallDomain yields finite non-NaN operands in either case. Thus the exact finite-operand multiplication clause above preserves the source result and cannot introduce NaN; infinity-special and non-native paths do not perform float multiplication.

Requirement: parser numeric acceptance

The only binary64 multiplication reachable while parsing a numeric literal is in the nonnegative-exponent ordinary native arm or the disguised native arm. Their guards, recorded in reference/model-evidence/binary64-boundary.txt, respectively give a mantissa at most 2^{53} with table index in 0,\ldots,22, or a successfully checked multiplied mantissa at most 2^{53} with table index 22. By Binary64NativeCallDomain, both operands are finite and non-NaN in either arm, so the exact finite-operand multiplication clause above preserves the normal native return. All remaining numeric paths avoid float multiplication.

Requirement: parser numeric sign

A numeric execution performs binary64 multiplication only in the nonnegative-exponent ordinary native arm or the disguised native arm. The source guards in reference/model-evidence/binary64-boundary.txt establish the ordinary bounds \mathit{mantissa}\leq2^{53} and table index 0,\ldots,22, and the disguised bounds of a checked multiplied mantissa at most 2^{53} and table index 22. Applying Binary64NativeCallDomain gives positive-sign finite non-NaN operands in both cases, so the exact finite-operand multiplication clause above preserves the product's magnitude sign; the record's lexical sign is applied afterward. Non-native paths do not perform float multiplication.

Requirement: parser selected exponent

This goal observes only an Assembled trace. The source dispatcher records such a trace only after try_fast_path returned None; an executed float multiplication belongs to a successful ordinary or disguised native arm and returns directly as Some. Thus no execution relevant to the selected-pair exponent observation executes binary64 multiplication, as the dispatcher excerpt in reference/model-evidence/binary64-boundary.txt records.

Requirement: parser selected magnitude sign

The assembled-word observation exists only on the dispatcher's Assembled route, reached after the native shortcut returned None. Every executed float multiplication is in an ordinary or disguised native arm that returns its value directly rather than selecting or assembling a raw pair. Consequently this binding cannot affect the selected pair or its clear sign bit (reference/model-evidence/binary64-boundary.txt).

Requirement: parser signed zero

When the mantissa is zero, either multiplication arm has a converted mantissa of positive zero: the ordinary arm uses the original zero, while the disguised arm's checked integer product is zero. The ordinary table index is in 0,\ldots,22, and the disguised index is 22, as recorded in reference/model-evidence/binary64-boundary.txt. By Binary64NativeCallDomain, the zero operand and positive power of ten are finite and non-NaN. The exact finite-operand multiplication clause above therefore preserves positive zero before the lexical sign is applied; all other routes avoid float multiplication.

Requirement: parser totality

Binary64 multiplication can be reached only after numeric parsing, in the nonnegative-exponent ordinary native arm or the disguised native arm. The source guards recorded in reference/model-evidence/binary64-boundary.txt bound the ordinary mantissa by 2^{53} and its table index by 22; the disguised branch reaches float multiplication only after checked_mul succeeded and the resulting mantissa passed the 2^{53} bound, and it uses table index 22. Applying Binary64NativeCallDomain gives finite non-NaN operands in both arms, so the exact finite-operand multiplication clause above supplies the same normal source result. Every other dispatcher branch makes no float multiplication call, so the binding introduces no panic or divergence on any source input.

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 multiplication 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 multiplication 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 multiplication 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 binary64 multiplication 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 binary64 multiplication 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 multiplication 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": "ModelF64Mul",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "90623feb4a9a220ef2707a72c5b7b46fbdd846aac5c41525104ee13abe62d723",
  "active_statement_hash": "86db438a5daa834ba4a3d061478bcba22bf49222e0e28b8967b1fa028ab44374",
  "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": "ae6452fb03126e3f",
    "Binary64ModelDefault": "47013ebe5c83894c",
    "F64": "ec4e25fbaf4e11d4"
  }
}
Prose assessment
{
  "label": "Recorded Sound: VerifierPass",
  "assessment_status": "VerifierPass",
  "fingerprint_relation": "matches current fingerprint",
  "assessment_fingerprint": "preservation-v1:9e6cf3cf564919615ed0dcf30f9c7bee804aceab10da22aeb00e8bc5e8f8d7a9",
  "current_fingerprint": "preservation-v1:9e6cf3cf564919615ed0dcf30f9c7bee804aceab10da22aeb00e8bc5e8f8d7a9",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "sound_status": "Pass",
  "substantiveness_status": "Pass"
}