Definition and explanation
This explanation was written alongside the formalization to describe the statement and its reasoning.
Definition
Decimal record; binary64 magnitude
rounding; NaN, signed infinity, and sign-bit observations; application of a
lexical sign to a magnitude word; and unrestricted BiasedFp assembly.Lean definition
Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.
import Tablet.DecimalLexeme
import Tablet.F64
import Tablet.num_imp_dec2flt_common_BiasedFp
import Tablet.num_imp_dec2flt_decimal_Decimal
import Mathlib.Data.Real.Basic
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: DecimalGoalVocabulary]
structure DecimalGoalVocabulary where
-- BODY
bytes : Slice Std.U8 -> List Nat
sourceString : Str -> Prop
validNumeric : DecimalLexeme -> Prop
renderNumeric : DecimalLexeme -> List Nat
lexicalNegative : DecimalLexeme -> Bool
specialLiteral : List Nat -> Option Bool -> Bool -> Prop
classifies : List Nat -> Option (Sum DecimalLexeme (Option Bool × Bool)) -> Prop
mathExplicitExponent : DecimalLexeme -> Int
accumulatedExplicitExponent : DecimalLexeme -> Int
exactMagnitude : DecimalLexeme -> Real
accumulatedMagnitude : DecimalLexeme -> Real
decimalMagnitude : num.imp.dec2flt.decimal.Decimal -> Real
roundsMagnitude : Real -> F64 -> Prop
isNan : F64 -> Prop
isInfinity : Bool -> F64 -> Prop
isNegative : F64 -> Prop
signedMagnitude : Bool -> F64 -> F64 -> Prop
assembledWord : num.imp.dec2flt.common.BiasedFp -> F64 -> Prop
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
DecimalGoalVocabulary record is a noncomputational vocabulary
package. It supplies named fields for observing slice bytes, admitting source
strings, stating numeric and special grammar and classification, interpreting
explicit exponents and decimal values, relating real magnitudes to binary64
words, observing NaN, infinity, and sign bits, applying a lexical sign, and
interpreting raw-pair assembly. The record itself asserts no execution fact:
in particular it does not preserve termination, panic versus normal return,
the outer Aeneas Result versus the returned Rust Result,
Option/Result discriminants, returned Decimal
fields, selected-pair trace state, component compliance, deferral, or the
behavior of any extracted call.Proof
Str is
definitionally Slice U8, so those carrier types alone do not
distinguish Rust strings from byte slices. The sourceString field
receives its concrete length-bounded UTF-8 meaning only in
DecimalGoalVocabularyDefault; the complete arbitrary-byte Rust
&[u8] carrier is instead identified by the separate
SourceValidByteSlice definition. The bytes field is total
on every model slice and carries no source-length premise. Likewise,
classifies accepts every finite natural-number list and
roundsMagnitude accepts every real input. Thus the purely
mathematical list and real relations are not restricted to source-representable
inputs. Concrete grammar, value, rounding, word, sign, and assembly meanings
are supplied by DecimalGoalVocabularyDefault, not by an execution
claim in this record.Requirement: parser totality
sourceString predicate for the parser's source domain. Termination, panic versus normal return, and the distinction between the outer Aeneas result and returned Rust result belong to the source-model and operation-preservation owners.Requirement: parser numeric acceptance
sourceString, bytes, validNumeric, and renderNumeric to state the source domain and numeric grammar. Normal return and the returned Ok discriminant are left to the parser-operation owner.Requirement: parser invalid rejection
sourceString, bytes, and classifies to state complete-input invalidity. It makes no claim that the parser returns normally or returns Err; those are parser-operation facts.Requirement: parser nan acceptance
sourceString, bytes, specialLiteral, and isNan for NaN grammar and the word predicate. Acceptance, normal return, and Ok are left to the parser-operation owner.Requirement: parser infinity
sourceString, bytes, specialLiteral, and isInfinity for signed infinity grammar and words. It does not assert a normal or successful parser return.Requirement: parser non nan results
sourceString, bytes, specialLiteral, and isNan to state the input exclusion and output-word observation. The implication from a successful extracted return to a non-NaN word is left to parser preservation.Requirement: parser numeric sign
sourceString, the numeric grammar fields, lexicalNegative, and signedMagnitude. It does not assert that parsing succeeds or that an extracted return satisfies the sign relation.Requirement: parser signed zero
sourceString, the numeric grammar fields, exactMagnitude, lexicalNegative, and signedMagnitude to express zero and its lexical sign. Acceptance and the returned word remain parser-operation facts.Requirement: parser exact rounding
sourceString, the numeric grammar fields, exactMagnitude, roundsMagnitude, lexicalNegative, and signedMagnitude. It does not infer acceptance or connect an extracted return to those relations.Requirement: parser selected exponent
sourceString to this parser goal; it has no trace-selection or biased-exponent-range field. Normal success, selection of a raw pair, and its exponent bound belong to the traced source model and operation-preservation owners.Requirement: parser selected magnitude sign
sourceString and assembledWord to interpret a supplied raw pair and word. It does not establish successful execution, trace selection, or the selected word's clear sign bit.Requirement: dispatch abstract composition
Requirement: dispatch component compliance
Requirement: parser accumulated rounding
sourceString, the numeric grammar fields, accumulatedMagnitude, roundsMagnitude, lexicalNegative, and signedMagnitude. Acceptance and the relation of an extracted return to those fields remain parser-operation facts.Requirement: parser equal target rounding
sourceString, the numeric grammar fields, both magnitude interpretations, roundsMagnitude, lexicalNegative, and signedMagnitude. It neither asserts acceptance nor proves that a returned word is the common target.Requirement: number helper acceptance
bytes, validNumeric, and renderNumeric for the unsigned numeric grammar; normal return and Some are left to the numeric-helper operation owner.Requirement: number helper rejection
bytes, validNumeric, and renderNumeric to state failure of the unsigned grammar, not the helper's normal return or None.Requirement: number helper record bounds
bytes observation. Returned-record fields, the Some discriminant, normal return, negativity, and the mantissa bound are not fields or consequences of this vocabulary record.Requirement: number helper accumulated value
bytes, the unsigned numeric grammar, accumulatedMagnitude, and decimalMagnitude; the optional return and its record/value relationship belong to numeric-helper preservation.Requirement: special helper infinity
bytes, specialLiteral, and isInfinity; normal return, Some, and the helper's use of the separate sign argument are operation facts.Requirement: special helper nan
bytes, specialLiteral, and isNan; normal return and Some are left to special-helper preservation.Requirement: special helper rejection
bytes and specialLiteral for the keyword grammar; normal return and None remain special-helper operation facts.Requirement: native correct or defer
decimalMagnitude, roundsMagnitude, and signedMagnitude to express the record value, target, and sign. Normal return, None/Some, many_digits, and both native paths belong to native-operation preservation.Requirement: integer correct or defer
roundsMagnitude and assembledWord to interpret a real target and a supplied raw pair. It does not preserve normal return, deferral, or production of that pair by the integer operation.Requirement: slow accumulated rounding
accumulatedMagnitude, roundsMagnitude, and assembledWord; normal return and production of a raw pair are left to slow-operation preservation.Requirement: assembly correspondence
assembledWord as the relation between an unrestricted supplied raw pair and a word. Normal return and agreement of the extracted assembly call with that relation belong to assembly-operation preservation.Requirement: classification totality
classifies field has the unrestricted finite-list domain required by this mathematical goal, independently of Rust length or UTF-8 validity. Merely supplying that relation does not prove that every byte list has a classification.Requirement: classification determinism
classifies relation records complete numeric content on finite byte lists. This vocabulary contribution does not prove uniqueness of classifications or parsed lexemes.Requirement: classification significand digit
classifies and validNumeric fields provide the mathematical grammar vocabulary for significand digits. This node does not prove the claimed digit-existence theorem.Requirement: rounding totality
roundsMagnitude field is a relation on unrestricted real inputs and binary64 words, with no source-domain bound. Supplying the relation does not prove that a target exists for every nonnegative real.Requirement: rounding determinism
roundsMagnitude field supplies one unrestricted real-to-word relation for both target hypotheses. This vocabulary record does not prove uniqueness of the targets.Requirement: exponent value agreement
roundsMagnitude are separate unrestricted mathematical fields. This node does not prove that equality of exponents yields agreement of rounding targets.Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Used by
Inspect related source (44)
- BiasedFp · dec2flt/common.rs:52 Program Rust
- Decimal · dec2flt/decimal.rs:32 Program Rust
- from_u64 · dec2flt/mod.rs:263 Program Rust
More program dependencies (11)
- FloatErrorKind · num/mod.rs:18 Program Rust
- ParseFloatError · num/mod.rs:13 Program Rust
- Dec2FltAssemblyTrace · dec2flt/mod.rs:329 Program Rust
- Dec2FltTrace · dec2flt/mod.rs:295 Program Rust
- Lemire · dec2flt/mod.rs:115 Program Rust
- ByteSlice · dec2flt/common.rs:4 Program Rust
- DecimalSeq · dec2flt/decimal_seq.rs:21 Program Rust
- CastInto · traits.rs:18 Program Rust
- Float · traits.rs:74 Program Rust
- FloatExt · traits.rs:170 Program Rust
- Int · traits.rs:27 Program Rust
Standard-library dependencies (30)
- clone · core/src/clone.rs:698 Rust library
- div · core/src/ops/arith.rs:515 Rust library
- mul · core/src/ops/arith.rs:350 Rust library
- neg · core/src/ops/arith.rs:719 Rust library
- bitand · core/src/ops/bit.rs:178 Rust library
- bitor · core/src/ops/bit.rs:282 Rust library
- shl · core/src/ops/bit.rs:489 Rust library
- shr · core/src/ops/bit.rs:612 Rust library
- EXPONENT_MASK · core/src/num/f64.rs:615 Rust library
- INFINITY · core/src/num/f64.rs:512 Rust library
- MANTISSA_DIGITS · core/src/num/f64.rs:412 Rust library
- MANTISSA_MASK · core/src/num/f64.rs:637 Rust library
- NAN · core/src/num/f64.rs:509 Rust library
- NEG_INFINITY · core/src/num/f64.rs:515 Rust library
- classify · core/src/num/f64.rs:782 Rust library
- from_bits · core/src/num/f64.rs:1269 Rust library
- to_bits · core/src/num/f64.rs:1223 Rust library
- is_ascii_digit · core/src/num/mod.rs:958 Rust library
- from_residual · core/src/option.rs:2793 Rust library
- branch · core/src/option.rs:2779 Rust library
- first · core/src/slice/mod.rs:155 Rust library
- split_first · core/src/slice/mod.rs:198 Rust library
- as_bytes · core/src/str/mod.rs:498 Rust library
- FpCategory · core/src/num/mod.rs:1522 Rust library
- Div · core/src/ops/arith.rs:460 Rust library
- Mul · core/src/ops/arith.rs:322 Rust library
- Neg · core/src/ops/arith.rs:690 Rust library
- BitOr · core/src/ops/bit.rs:254 Rust library
- Shl · core/src/ops/bit.rs:461 Rust library
- Shr · core/src/ops/bit.rs:584 Rust library
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
- Classical.choice
- Quot.sound
- propext
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": "DecimalGoalVocabulary",
"closure_version": "patch_c_v1",
"active_decl_hash": "5601e4b8972898f281d0342a7ec52725dc401cb4f6791d2ebbedfd0b5f47a17a",
"active_statement_hash": "a980a77f6202d8b6641c6c672d63ec493e14295fdbdf5942b636290e1c1d5881",
"kernel_axioms": [
"Classical.choice",
"Quot.sound",
"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-13",
"boundary_theorems": {},
"strict_theorem_deps": {},
"strict_definition_deps": {
"DecimalLexeme": "c43614ff2149ecf2",
"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:4733cb7e92789f17477cf518ee1e5a6d85c8dfd98984b462ea6c73537ede06a2",
"current_fingerprint": "preservation-v1:4733cb7e92789f17477cf518ee1e5a6d85c8dfd98984b462ea6c73537ede06a2",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"sound_status": "Pass",
"substantiveness_status": "Pass"
}