P9_T1_AbstractComponents

Lean checked

Definition and explanation

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

Definition

A total abstract component record consists of the same seven input/output value functions as DispatchOperations, with the outer Result removed. Numeric, special and native results are still optional; integer and slow results are unrestricted BiasedFp pairs; assembly and negation produce complete binary64 words. Operations and compatible laws are separate: this data record asserts no law, no source termination and no existence of a compatible package.

Lean definition

Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.

import Tablet.P9_T1_DispatchOperations
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: P9_T1_AbstractComponents]
structure P9_T1_AbstractComponents where
-- BODY
  parseNumber : Slice Std.U8 -> Option num.imp.dec2flt.decimal.Decimal
  parseSpecial : Slice Std.U8 -> Bool -> Option F64
  native : num.imp.dec2flt.decimal.Decimal -> Option F64
  integer : Std.I64 -> Std.U64 -> num.imp.dec2flt.common.BiasedFp
  slow : Slice Std.U8 -> num.imp.dec2flt.common.BiasedFp
  assemble : num.imp.dec2flt.common.BiasedFp -> F64
  negate : F64 -> F64
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

The total abstract carrier retains exactly the seven component operands and normally returned value carriers, including None/Some and all pair and word fields. It is a presentation of abstract values, not a replacement for concrete outer failure/divergence or a claim of compatible-package inhabitability, actual compliance or actual liveness.

Proof

Compare its fields with DispatchOperations. Only the outer Result is omitted. Byte slices, the independent special sign, Decimal fields, machine integer operands, unrestricted pairs and complete binary64 words are unchanged. In particular numeric, special and native None remain represented; neither pair fields nor NaN payloads are lost. An abstract function specifies a value at each input but asserts no equation with any actual Result-valued call. The compatible laws are the separate proposition DispatchContracts, whose satisfaction and inhabitability still require proof.
Concrete helper subjects continue to use ActualDispatchOperations. Concrete public observations are identified by ActualDispatchFrameEquality and the public result projection, independently of any chosen abstract record. Thus a failed or diverging actual call is not silently completed by the total carrier. The source domains and call evidence used in these distinctions are in reference/model-evidence/dispatch-contracts.txt.

Requirement: parser nan acceptance

Every complete source-valid Rust string spelling a NaN literal must yield outer normal return containing Rust Ok of a NaN; success is a conclusion, not a premise, and no A/B restriction is added. The actual-frame equality and public projection preserve this return-existence assertion and the NaN word predicate on the same bytes. Abstract values and reached events do not discharge that assertion.

Requirement: parser infinity

Every complete source-valid Rust infinity literal must return normally with Rust Ok of infinity bearing its leading lexical sign, without an A/B bound or a prior-success premise. The actual-frame equality preserves the whole input, sign stripping, separate special sign and returned word, so the required existence and signed-infinity predicate are unchanged. Neither abstract totality nor a reached special event proves this return.

Requirement: parser non nan results

Here normal Rust Ok really is a hypothesis. On the same complete source-valid Rust input, exclusion of all signed NaN spellings and the returned word's non-NaN predicate are unchanged. Actual-frame equality transports that successful result without imposing an A/B bound or requiring a selected pair on native or special direct returns.

Requirement: parser numeric sign

This is conditional on a normally successful numeric parse on any complete source-valid Rust string, with no A/B bound. The preserved leading sign, sign-overwritten native input, pre-sign assembly word and final word express exactly the original lexical-sign conclusion, including zero and infinity. An exponent's sign is not the leading sign. Observation preservation does not assume or prove that conclusion.

Requirement: parser signed zero

Normal acceptance remains the hypothesis for a numeric literal of exact value zero on any source-valid Rust string, without an A/B bound. Whole-input numeric content, zero magnitude and the leading lexical sign are unchanged. Actual-frame equality preserves the complete returned word, hence distinguishes positive and negative zero instead of identifying their magnitudes or adding an acceptance obligation.

Requirement: parser selected exponent

Normal numeric success remains the hypothesis, without an A/B bound. Actual-frame equality preserves each genuinely selected raw pair and its biased-exponent field. The conclusion is still that these fields lie in 0,\ldots,2047, not an assumed bound on every component pair. Native direct returns supply no artificial pair; checked increment, comparison and slow replacement retain exactly which pair is selected.

Requirement: parser selected magnitude sign

For a normally successful numeric parse, without an A/B bound, the observation is the cast/shift/OR word of the actual selected pair before lexical signing. The same trace and word are retained by actual-frame equality, so the clear-sign-bit conclusion remains unchanged. It is not a hypothesis on all BiasedFp inputs, nor a claim that the final negatively signed public word has a clear sign bit.

Requirement: number helper record bounds

The domain is every nonempty source-valid byte slice with arbitrary contents, no UTF-8, unsigned-grammar or A/B restriction. An actual normal Some record is the legitimate premise; its unchanged fields must have negative false and mantissa below 10^{19}. The direct call and complete record are retained, so the representation does not turn this conditional field law into universal helper termination or restrict it to dispatcher-reached inputs.

Requirement: special helper infinity

For every source-valid byte slice spelling an unsigned infinity keyword and either independent sign argument, the actual helper must return normally with Some infinity of that sign. Both normal return and Some are conclusions. The unchanged slice, case-insensitive keyword and Boolean argument retain this requirement without UTF-8, reachability or A/B restrictions; no current-call success is assumed.

Requirement: special helper nan

For every source-valid byte slice spelling an unsigned NaN keyword and either independent sign argument, the actual helper must return normally with Some of a NaN. No normal-return or Some premise is introduced. The unchanged byte list, keyword predicate, separate sign and NaN word observation preserve this requirement on its full domain, independently of dispatcher reachability and without UTF-8 or A/B restrictions.

Requirement: special helper rejection

On every source-valid arbitrary-byte slice not spelling an unsigned inf, infinity or nan keyword, and for either independent sign argument, the actual helper must return normally with None. This includes empty and otherwise invalid slices, with no UTF-8 or A/B restriction. The retained ok none conclusion is not outer failure or divergence; the direct obligation is not conditioned on a reached or successful call.

Requirement: native correct or defer

The input remains every Decimal, including both ordinary and disguised native paths. An actual outer normal return is the original hypothesis: None defers, while Some must round exact mantissa times 10^{\mathrm{exponent}} with the record's sign and implies many_digits false. The same optional value and fields are retained, without a length, record-bounds or reachability premise and without asserting unrestricted native termination.

Requirement: integer correct or defer

The domain remains every I64 exponent and U64 mantissa. Conditional on the actual call's normal pair, negative biased exponent is deferral; otherwise its unrestricted assembled word must be the clear-sign binary64 rounding of exact w10^q. No biased-exponent upper bound, dispatcher reachability or termination premise is added. Retaining both operands and all pair fields preserves exactly this on-normal alternative.

Requirement: slow accumulated rounding

For every source-valid unsigned numeric slice, without an A or B limit, an actual normal slow pair must assemble to the nonnegative binary64 rounding of the full-significand accumulated-exponent value. The unchanged body retains every significand and exponent digit and the independent exponent sign. No dispatcher-reachability, truncated-record or exact-value premise replaces this domain, and unrestricted actual termination is not asserted.

Requirement: assembly correspondence

For every unrestricted BiasedFp, actual assembly must return normally with bits equal to mantissa OR the Rust I32-to-U64 cast of biased exponent shifted left by 52, using bounded 64-bit word operations. Normal return is a conclusion, not a premise. Retaining both complete fields and the same assembly call preserves this assertion without well-formedness, exponent-range, clear-sign, selection or reachability assumptions.

Requirement: classification totality

Every finite byte string retains the same whole-input numeric, special and invalid classification relation. This mathematical relation executes no dispatcher component; the present definition adds neither Rust source-validity, UTF-8, an A/B bound nor a compatible-package premise. Thus the existence of a classification remains the original unrestricted mathematical conclusion.

Requirement: classification determinism

The unchanged whole-input grammar still determines the classification and complete numeric lexeme whose uniqueness is asserted for every finite byte string. No dispatcher result or event identifies different digit lists, signs, decimal-point positions or exponent contents. This definition supplies no computation or hypothesis to that mathematical uniqueness claim and adds no Rust-domain or A/B restriction.

Requirement: classification significand digit

Validity still requires at least one digit in the combined integer and fractional significand, irrespective of the separately recorded exponent digits. The mathematical claim refers to that unchanged grammar, not to successful parsing, a reached numeric event or an abstract component law. Its unrestricted numeric-literal domain therefore gains no source, UTF-8 or A/B condition.

Requirement: rounding totality

The target relation remains nearest-even binary64 magnitude rounding for every nonnegative real, including subnormals, zero and overflow to infinity. It has no source execution or input-length domain. This dispatcher definition cannot supply a target by abstract function totality or add a compatible-package assumption; the original mathematical target-existence claim and relation are unchanged.

Requirement: rounding determinism

Both candidate targets are still measured by the same unchanged nearest-even magnitude relation on each nonnegative real. Neither dispatcher selection nor a chosen abstract conversion function defines this relation or fixes its answer. Consequently the mathematical uniqueness claim keeps its unrestricted real domain and acquires no component, successful-return or length premise.

Requirement: exponent value agreement

For every valid numeric lexeme, equality of the accumulated and mathematical explicit exponents remains the hypothesis. All significand digits, fractional length and the exponent sign are retained in the two value interpretations, with the same rounding relation. This mathematical bridge uses no source call or dispatcher success and has no A/B restriction; neither value is replaced by a truncated record.

Requirement: dispatch abstract composition

The compatible-package existence claim remains separate from the conditional claims for every package satisfying the laws. On every complete source-valid Rust string through A=3458764513820540928, a normal abstract output must be established, and its classification, accumulated rounding and lexical sign must satisfy the reference; a Rust Err counts as normal, outer failure/divergence do not. Numeric complete strings through B=576460752303421440 additionally require the exact target.
The component laws keep nonempty arbitrary-byte numeric lexical slices through A, returned-record bounds on the unrestricted nonempty source domain, representation through A, and exact transport through B. Special, native, integer and unrestricted assembly retain their full domains, as does the source-valid unsigned numeric slow diagnostic with no A/B bound. The fixed frame retains native shortcut, integer operands, guarded checked increment, exact comparison, forced deferral, fallback, selected pair and signing. Total functions and their ok embedding alone prove neither compatible-package existence nor normal whole-frame output. The abstract values do not replace the actual Result in this obligation.

Requirement: dispatch component compliance

The actual-source obligation still requires an inhabited compatible package, its value laws, normal refinement and realization at every reached call on every complete source-valid Rust string through A=3458764513820540928. A reached event uses successful prior calls, not current-call or whole-dispatch success. Thus current-call normal agreement, helper preconditions, successful checked increment and exact comparison are conclusions still to be proved.
Numeric lexical acceptance/rejection and representation keep nonempty source-valid slices through A; returned-record bounds retain their unrestricted domain. Exact-target transport remains through B=576460752303421440, also measured on complete public strings. Special and unrestricted assembly require normal returns on their full domains; native/integer correctness remains on normal return, and slow correctness remains on normal return for every source-valid unsigned numeric slice without an A/B bound. Original operands, guards, forced deferral, fallback body, selected pair and sign observations are unchanged by actual-frame equality, independently of these correctness and liveness conclusions. The abstract values do not replace the actual Result in this obligation.

Requirement: number helper acceptance

Every nonempty source-valid arbitrary-byte slice through A=3458764513820540928 matching the whole unsigned numeric grammar must yield an actual normal Some record, including checked-arithmetic executions. Normal return and Some are conclusions. The slice has no leading sign, but its exponent may have either sign and any digit count or mathematical value within A. No UTF-8, reachability or prior-success condition is introduced.

Requirement: number helper rejection

Every nonempty source-valid arbitrary-byte slice through A=3458764513820540928 outside the whole unsigned numeric grammar must yield actual normal None, including checked-arithmetic executions. The same full slice is tested, including malformed exponent digits and characters after exponent accumulation stops. No UTF-8 or successful-call premise is added; ok none, outer checked failure and divergence remain distinct outcomes.

Requirement: parser exact rounding

Normal numeric acceptance remains the hypothesis, with B=576460752303421440 bounding the complete source-valid Rust string, including its optional leading sign. The target uses every significand digit and the ordinary mathematical explicit exponent, not its bounded accumulation. Actual-frame equality preserves the returned word and lexical sign, including subnormal results, signed zero and signed infinity, without adding an exponent-digit or value restriction.

Requirement: parser invalid rejection

Every complete source-valid Rust string through A=3458764513820540928 outside both whole-input grammars must yield outer normal return containing Rust Err, without panic, including checked executions. This is not conditional on dispatcher success. The same bytes include empty/sign-only cases and suffixes after exponent saturation. Actual-frame equality preserves the required return equation, not a replacement by outer failure, helper None or divergence.

Requirement: parser numeric acceptance

Every complete source-valid Rust numeric string through A=3458764513820540928, including its optional leading sign, must yield outer normal return containing Rust Ok without panic in checked executions. No current-call or whole-dispatch success is a premise. The unchanged whole-input grammar permits all exponent digit counts and mathematical values within A; observation equality retains the acceptance assertion without deriving it from abstract component totality.

Requirement: parser totality

For every complete source-valid Rust string through A=3458764513820540928, normal termination with a Rust Ok float or Rust Err is the conclusion, including empty, sign-only, numeric, special and invalid inputs and checked executions. There is no normal-return premise. Actual-frame equality and projection preserve this output-existence requirement as well as failures/divergence; neither of the latter, nor normal helper None by itself, counts as the required public result. The abstract values do not replace the actual Result in this obligation.

Requirement: parser accumulated rounding

Normal numeric acceptance remains the hypothesis, with A=3458764513820540928 bounding the complete source-valid Rust string. The unchanged diagnostic retains every significand digit and the bounded explicit-exponent fold, including its independent sign. Actual-frame equality preserves the word and leading lexical sign required for the accumulated target, including zero and infinity; it neither substitutes the exact value nor supplies an acceptance premise elsewhere.

Requirement: parser equal target rounding

On a normally accepted numeric complete source-valid Rust string through A=3458764513820540928, equality of the ordinary exact and accumulated binary64 targets remains a separate hypothesis. Both full-significand values and the returned word are unchanged, so the common-target and leading-lexical-sign conclusions retain their meanings, including zero and infinity. No B bound or extra exponent restriction is imposed.

Requirement: number helper accumulated value

On every source-valid unsigned numeric slice through A=3458764513820540928, a returned normal Some record is the legitimate premise. With many_digits false it must exactly represent the full-significand accumulated value; otherwise that value must lie in [\mathit{mantissa}10^q,(\mathit{mantissa}+1)10^q). The upper endpoint uses mathematical addition, not an assumed successful machine increment. The complete slice and record fields are retained, with no UTF-8 or dispatcher-reachability premise.

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": "P9_T1_AbstractComponents",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "4db6fc868ba05ac588875e9c80fee55e4be5b79b4b874c1de8b227b6be13410e",
  "active_statement_hash": "ecadb0a2a79a8704f5430eaa18e916b42448ea38c239546a77af309bc096d778",
  "kernel_axioms": [
    "propext"
  ],
  "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-14",
  "boundary_theorems": {},
  "strict_theorem_deps": {},
  "strict_definition_deps": {
    "F64": "ec4e25fbaf4e11d4",
    "num_imp_dec2flt_common_BiasedFp": "c43614ff2149ecf2",
    "num_imp_dec2flt_decimal_Decimal": "c43614ff2149ecf2"
  }
}
Prose assessment
{
  "label": "Recorded Sound: VerifierPass",
  "assessment_status": "VerifierPass",
  "fingerprint_relation": "matches current fingerprint",
  "assessment_fingerprint": "preservation-v1:c6aa1593474d801cb3a4a5eb48e0bd2b4a9abf8e9aaf0b6bfab2709a024168b3",
  "current_fingerprint": "preservation-v1:c6aa1593474d801cb3a4a5eb48e0bd2b4a9abf8e9aaf0b6bfab2709a024168b3",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "sound_status": "Pass",
  "substantiveness_status": "Pass"
}