NativeCorrectOrDefer

Lean checked

Statement

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

Theorem

For every unrestricted source Decimal record, any normal return of try_fast_path is either None, or Some of its sign applied to the binary64 rounding of the exact real value \mathit{mantissa}\,10^{\mathit{exponent}}; a Some return also has many_digits = false. This covers both ordinary and disguised native paths.

Lean statement

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

import Tablet.DecimalGoalVocabularyDefault
import Tablet.Binary64ModelDefault
import Tablet.Binary64NativeCallDomain
import Tablet.Binary64ApplySign
import Tablet.Binary64ExactPositiveDivRounds
import Tablet.Binary64ExactPositiveMulRounds
import Tablet.Binary64FastPathGuard
import Tablet.Binary64FastPathIndexCasts
import Tablet.Binary64FromU64Exact
import Tablet.Binary64IntPow10Index
import Tablet.Binary64Pow10FastPathExact
import Tablet.Binary64ZeroDivRounds
import Tablet.Binary64ZeroMulRounds
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64_MAX_EXPONENT_FAST_PATH
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64_MAX_EXPONENT_DISGUISED_FAST_PATH
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64_pow10_fast_path
import Tablet.F64_Insts_CoreOpsArithDivF64F64
import Tablet.F64_Insts_CoreOpsArithMulF64F64
import Tablet.F64_Insts_CoreOpsArithNegF64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatExtU64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SIG_TOTAL_BITS
import Tablet.ModelF64MantissaDigits
import Tablet.ModelF64FromBits
import Tablet.ModelF64FromU64
import Tablet.ModelF64Mul
import Tablet.ModelF64Div
import Tablet.ModelF64Neg
import Tablet.ModelOptionBranch
import Tablet.ModelOptionFromResidual
import Tablet.ModelU64Shl
import Tablet.num_imp_dec2flt_Lemire_MIN_EXPONENT_FAST_PATH_default
import Tablet.num_imp_dec2flt_Lemire_MAX_MANTISSA_FAST_PATH_default
import Tablet.num_imp_dec2flt_dec2flt
import Tablet.num_imp_dec2flt_dec2flt_with_trace
import Tablet.num_imp_dec2flt_parse_parse_number
import Tablet.num_imp_dec2flt_parse_parse_inf_nan
import Tablet.num_imp_dec2flt_decimal_Decimal_can_use_fast_path
import Tablet.num_imp_dec2flt_decimal_Decimal_try_fast_path
import Tablet.num_imp_dec2flt_decimal_INT_POW10
import Tablet.num_imp_dec2flt_fpu_fpu_precision_set_precision
import Tablet.num_imp_dec2flt_lemire_compute_float
import Tablet.num_imp_dec2flt_slow_parse_long_mantissa
import Tablet.num_imp_dec2flt_biased_fp_to_float

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxRecDepth 1000000
set_option maxHeartbeats 1999999

namespace dec2flt_model

-- [TABLET NODE: NativeCorrectOrDefer]
theorem NativeCorrectOrDefer :
    ∀ (d : num.imp.dec2flt.decimal.Decimal) out,
      num.imp.dec2flt.decimal.Decimal.try_fast_path
        F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
        F64.Insts.CoreOpsArithDivF64F64 F64.Insts.CoreOpsArithMulF64F64
        F64.Insts.CoreOpsArithNegF64 d = ok out ->
      out = none ∨ ∃ (f magnitude : F64), out = some f ∧ d.many_digits = false ∧
        DecimalGoalVocabularyDefault.roundsMagnitude (DecimalGoalVocabularyDefault.decimalMagnitude d) magnitude ∧
        DecimalGoalVocabularyDefault.signedMagnitude d.negative magnitude f := by
Proof

Natural-language proof

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.

Proof

Fix an arbitrary record d, write m=d.\mathit{mantissa} and e=d.\mathit{exponent} for their mathematical integer values, and suppose the displayed call returns normally as ok out. We first reduce all constants and the outer guard, then follow the two executable arms of the extracted body.

Constants and the guard.

Unfolding the selected Lemire implementation F64 Insts Dec2flt modelNumImpDec2fltLemireU64, its maximum ordinary exponent is the literal 22 from F64 Insts Dec2flt modelNumImpDec2fltLemireU64 MAX EXPONENT FAST PATH, and its maximum disguised exponent is the literal 37 from F64 Insts Dec2flt modelNumImpDec2fltLemireU64 MAX EXPONENT DISGUISED FAST PATH. The minimum default num imp dec2flt Lemire MIN EXPONENT FAST PATH default first obtains 22 and performs checked signed negation. Since 22 is not -2^{63}, that operation succeeds and gives -22. For the mantissa bound, the selected float-extension and float records F64 Insts Dec2flt modelNumImpTraitsFloatExtU64 and F64 Insts Dec2flt modelNumImpTraitsFloatU64 select F64 Insts Dec2flt modelNumImpTraitsFloatU64 SIG TOTAL BITS; that definition selects the modeled mantissa-digits operation, which is 53 by ModelF64MantissaDigits. Thus the default num imp dec2flt Lemire MAX MANTISSA FAST PATH default executes the unsigned shift 1\ll53. The count 53<64, so the bounded-shift semantics ModelU64Shl makes the operation succeed with exactly 2^{53}, without discarded high bits.
Now unfold can_use_fast_path using num imp dec2flt decimal Decimal can use fast path. Its three nested comparisons and final Boolean negation say exactly
-22\le e,\qquad e\le37,\qquad m\le2^{53},\qquad d.\mathit{many\_digits}=\mathsf{false} \tag{1}
when its returned Boolean is true. Indeed, failure of any of the first three comparisons returns false, while after they all hold the returned Boolean is \neg d.\mathit{many\_digits}, which is true precisely for d.\mathit{many\_digits}=\mathsf{false}. All constant computations just checked return normally, so this is an equivalence, not only a one-way approximation.
Unfold try_fast_path from num imp dec2flt decimal Decimal try fast path. Its initial precision operation is unconditionally ok () by num imp dec2flt fpu fpu precision set precision. If the guard is false, the next branch is literally ok none; hence out = none, proving the first disjunct. We may consequently assume the guard is true and retain all four facts (1). At every later ordinary monadic bind, a checked failure would propagate a fail result and would contradict the assumed equality with ok out; below we identify the stronger in-range reason for every operation that is reached. The sole exception is the deliberately handled Option residual in the disguised branch, which returns ok none rather than a failure.

A rounding bridge used by both arms.

We record explicitly why the rounding operation below proves the relation in the theorem rather than merely producing some finite word. Unfold Binary64ModelDefault. Its nonnegative finite decoder is exactly the decoder in DecimalGoalVocabularyDefault: a word with exponent field zero and fraction a has value a2^{-1074}, while a word with exponent field E\in\{1,\ldots,2046\} and fraction a has value (2^{52}+a)2^{E-1075}. Its encoder first compares with the common overflow midpoint 2^{1024}-2^{970}. Below that midpoint, it either scales a subnormal input by 2^{1074} or chooses the unique normal field E with
2^{E-1023}\le x<2^{E-1022}
and scales by 2^{1075-E}. In either case it divides the exact nonnegative rational numerator by its positive denominator, obtaining quotient q and remainder r, and selects q+1 exactly if the upper integer is closer, or if 2r equals the denominator and q is odd. It otherwise selects q.
Here is the promised comparison with every competitor. In the subnormal case, consecutive decoded words, starting with the zero word, are separated by 2^{-1074}. The quotient places x between the two consecutive values for q and q+1; every earlier word, including zero when it is not one of those two, is no closer than the lower endpoint, and every later finite word is no closer than the upper endpoint. If q=0, this same argument explicitly compares the selected word with zero itself: zero wins below the half-way point, loses above it, and wins the exact tie because its low bit is even. In a normal binade, consecutive significands at the chosen scale are likewise separated by 2^{E-1075}. At the lower boundary the selected value is the boundary itself and its predecessor is strictly farther for every larger x; at an upper carry, the word for significand 2^{53} is exactly the first word of the next binade. Thus the two quotient neighbors bracket x in the globally strictly increasing list of all finite magnitude words, across both the subnormal/normal and adjacent-binade boundaries. Every other finite word v, including zero, lies weakly farther away than the selected word w. On an exact half-way point the rule chooses the even one: for an uncarried word its raw low bit is the low bit of the selected significand, and a carried word has low bit zero. Therefore, for every v with v.\mathit{val}<2047\,2^{52} and v\ne w,
|x-\mathit{finiteMagnitudeValue}(w)| \le |x-\mathit{finiteMagnitudeValue}(v)|,
and equality implies w.\mathit{val}\bmod2=0. The rational inputs used below embed into the reals without changing powers of two and ten, order, subtraction, or absolute values, so these inequalities are precisely the quantified finite-competitor and parity clauses of roundsMagnitude. The encoder returns positive infinity at and above the shared midpoint. Consequently, for every nonnegative rational input, the raw magnitude word returned by this encoder satisfies DecimalGoalVocabularyDefault's roundsMagnitude; below the midpoint it is finite and in particular has raw word <2047\,2^{52}<2^{63}.
We shall also use exact table values, not merely their finiteness. The extracted definition F64 Insts Dec2flt modelNumImpDec2fltLemireU64 pow10 fast path masks its index by 31 and lists one raw word for each index 0 through 22. On that interval the mask is the identity. Each of those 23 extracted branches calls the bound from_bits operation on its displayed constant. By ModelF64FromBits, that operation succeeds and returns an F64 whose raw word is exactly the displayed constant; thus no identity of raw words is being inferred from the weaker call-domain lemma. Decoding those returned raw words with Binary64ModelDefault's field formula then gives exactly 10^k: equivalently, 10^k=5^k2^k, and for k\le22 the odd significand 5^k has at most 52 bits, so the value is exactly representable; direct field division and remainder of each listed word give that significand and scale. This calculation strengthens the successful, positive, nonzero, finite, clear-sign conclusion already stated by Binary64NativeCallDomain for every such table call; that latter lemma supplies those domain properties, but not the raw-word identity used in the decoding.

The ordinary arm.

Suppose first e\le22. The extracted body calls from_u64 on m. By (1), m\le2^{53}, so ModelF64FromU64 succeeds and returns the exact positive-sign encoding of the integer m; this is also the first clause of Binary64NativeCallDomain. The selected arithmetic instances F64 Insts CoreOpsArithDivF64F64 and F64 Insts CoreOpsArithMulF64F64 use respectively ModelF64Div and ModelF64Mul. Their exact-rational and IEEE zero branch semantics are those of Binary64ModelDefault; the applicable division branch is determined below before any exact-rational conclusion is drawn.
If e<0, (1) gives -22\le e\le-1. Checked negation succeeds because this range excludes -2^{63} and yields k=-e\in\{1,\ldots,22\}. Its checked cast to the 64-bit unsigned usize succeeds and preserves k. The power-table call therefore succeeds with exact value 10^k and returns a positive-sign, finite, nonzero divisor. At this point split on the unsigned mantissa m.
If m=0, ModelF64FromU64 returns the exact positive-zero word. The division does not enter an exact-rational fall-through case: by ModelF64Div it is the division operation of Binary64ModelDefault, whose zero-numerator, positive-nonzero-divisor branch returns a signed zero with the xor of the operand signs. Both operand signs are clear here, so the returned pre-sign word w is positive zero, w.\mathit{val}=0. On the other hand
\texttt{decimalMagnitude d}=0\cdot10^e=0.
This word directly satisfies roundsMagnitude at zero. Indeed, 0\le0, its raw word is below the infinity word, and zero is below the positive overflow midpoint. Its decoded finite magnitude is zero. Every finite competitor has nonnegative decoded magnitude, so its absolute distance from zero is at least the selected word's distance 0; and whenever equality holds, the required selected-word parity clause holds because w.\mathit{val}\bmod2=0. These are exactly the zero-word minimizer and even-tie clauses in DecimalGoalVocabularyDefault. Also w.\mathit{val}<2^{63}, so the later sign branch leaves this positive zero unchanged when d.\mathit{negative} is false and, by the cited modeled negation, toggles bit 63 to negative zero when it is true; either result satisfies the stated signedMagnitude relation.
If m>0, its exact conversion is positive, finite, and nonzero, while the divisor just established is also positive, finite, and nonzero. The special zero, infinity, and NaN cases are therefore all false, so ModelF64Div and Binary64ModelDefault make division take its exact-rational case. It encodes
m/10^k=m\,10^{-k}=m\,10^e.
The alternatives m=0 and m>0 exhaust the unsigned mantissa domain, so they exhaust the negative-exponent arm. If instead 0\le e\le22, the checked cast of e to usize likewise succeeds unchanged, the table gives exact 10^e, and modeled multiplication encodes the exact product m10^e. These cases include e=0, where the table entry is exactly one, and m=0, where the encoder argument and selected word are both zero.
In every case other than the just-verified zero-numerator division, the encoder input x=m10^e is nonnegative. It is also strictly below the overflow midpoint: for e<0, x\le2^{53}, and for 0\le e\le22, x\le2^{53}10^{22}<2^{128}<2^{1023}< 2^{1024}-2^{970}. The rounding bridge therefore supplies a finite positive-sign word w with
\texttt{roundsMagnitude}(m10^e,w) \quad\hbox{and}\quad w.\mathit{val}<2^{63}. \tag{2}
Unfolding the concrete vocabulary identifies m10^e with decimalMagnitude d. The zero-numerator division already supplied the same two conclusions directly, so (2) holds throughout the ordinary arm.

The disguised arm.

It remains to treat the branch e>22. Combining this strict integer inequality with (1) gives 23\le e\le37. The checked signed subtraction s=e-22 cannot overflow and gives 1\le s\le15; its checked cast to usize is exact. Thus the index is within the length-16 extracted table num imp dec2flt decimal INT POW10. Inspecting its displayed entries at indices 0,\ldots,15 gives entry s exactly 10^s.
The next operation is checked unsigned multiplication. If the mathematical product m10^s exceeds 2^{64}-1, U64.checked_mul returns none. The exact option branch ModelOptionBranch then returns Continue only for a present product and returns Break none here; the residual conversion ModelOptionFromResidual turns that residual into ok none. Hence this case proves the theorem's first disjunct. If multiplication succeeds, its present value n is exactly m10^s with no modular truncation. The following comparison returns ok none when n>2^{53}, again proving the first disjunct. We may therefore assume n\le2^{53}; (1) already provides d.\mathit{many\_digits}=\mathsf{false}.
Now ModelF64FromU64 succeeds with the exact positive-sign encoding of n. The constant i=22 casts exactly to usize; the power-table call at index 22 succeeds with the exact positive nonzero finite value 10^{22} by the table calculation and Binary64NativeCallDomain. The selected multiplication operation ModelF64Mul therefore encodes the exact rational product
n10^{22}=(m10^s)10^{22}=m10^{s+22}=m10^e,
where the last equality uses the already established checked equation s=e-22. This value is at most 2^{53}10^{22}, so the same explicit overflow-midpoint estimate applies. The rounding bridge again supplies a finite positive-sign word w satisfying exactly (2).

The sign and conclusion.

In either successful arm, before the final sign branch the body has produced the magnitude word w of (2). If d.\mathit{negative} is false, the body returns some w. The definition of signedMagnitude in DecimalGoalVocabularyDefault holds because w.\mathit{val}<2^{63} and the required added sign contribution is zero. If it is true, the selected negation instance F64 Insts CoreOpsArithNegF64 invokes ModelF64Neg, which succeeds and toggles exactly bit 63. Since w.\mathit{val}<2^{63}, that bit was clear, so toggling it gives the raw word w.\mathit{val}+2^{63} while leaving all magnitude bits fixed. This is precisely signedMagnitude true w f. No hypothesis from a parser or from another theorem has been used.
Taking the returned value as f and the pre-sign word as magnitude, we have out = some f, the guard fact d.\mathit{many\_digits}=\mathsf{false}, the rounding fact for decimalMagnitude d, and the required signed-magnitude equation. This proves the second disjunct in every Some case; all remaining normal returns were shown to be None. The two disjuncts exhaust the unrestricted record and every normal execution of the extracted body.

Lean proof


  intro d out hout
  obtain ⟨guard, hguard, hguard_spec⟩ := Binary64FastPathGuard d
  have hmax22 :
      F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.MAX_EXPONENT_FAST_PATH =
        22#i64 := by
    rw [F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.MAX_EXPONENT_FAST_PATH.eq_def]
  have hmax22Field :
      (F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64 :
        num.imp.dec2flt.Lemire F64 Std.U64).MAX_EXPONENT_FAST_PATH =
        ok 22#i64 := by
    rw [F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.eq_def, hmax22]
  have hmaxMantissaField :
      (F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64 :
        num.imp.dec2flt.Lemire F64 Std.U64).MAX_MANTISSA_FAST_PATH =
        ok 9007199254740992#u64 := by
    rw [F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.eq_def]
    change (do
      let i ← F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.SIG_TOTAL_BITS
      1#u64 <<< i) = ok 9007199254740992#u64
    rw [F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.SIG_TOTAL_BITS.eq_def]
    rfl
  unfold num.imp.dec2flt.decimal.Decimal.try_fast_path at hout
  rw [show num.imp.dec2flt.fpu.fpu_precision.set_precision F64 = ok () by rfl,
    hguard] at hout
  cases guard with
  | false =>
      left
      have hnone : none = out := by simpa using hout
      exact hnone.symm
  | true =>
      have hbounds := hguard_spec.mp rfl
      obtain ⟨hmin, hmax, hmant, hmanyeq⟩ := hbounds
      simp at hout
      rw [hmax22] at hout
      rw [show (22#i64).val = 22 by rfl] at hout
      by_cases ordinary : d.exponent.val ≤ 22
      · have ordinary' : d.exponent ≤ 22#i64 := by exact ordinary
        rw [if_pos ordinary] at hout
        obtain ⟨a, hfrom, haFinite, haDecode, haRound⟩ :=
          Binary64FromU64Exact d.mantissa hmant
        have haBound : a.val < 2 ^ 63 := by omega
        have hfromField :
            F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.from_u64
              d.mantissa = ok a := by
          exact hfrom
        rw [hfromField] at hout
        simp at hout
        by_cases negativeExponent : d.exponent.val < 0
        · rw [if_pos negativeExponent] at hout
          obtain ⟨negated, i, hnegated, hcast, hnegatedVal, hiVal,
              hiLower, hiUpper⟩ :=
            Binary64FastPathIndexCasts.1 d.exponent hmin negativeExponent
          rw [hnegated] at hout
          simp at hout
          rw [hcast] at hout
          simp at hout
          obtain ⟨p, hpow, hpBound, hpDecode⟩ :=
            Binary64Pow10FastPathExact i hiUpper
          rw [hpow] at hout
          simp at hout
          by_cases mantissaZero : d.mantissa.val = 0
          · have haZero : a.val = 0 := by
              have deq : d.mantissa = 0#u64 := UScalar.eq_of_val_eq mantissaZero
              have hzero : ModelF64FromU64 0#u64 =
                  ok (⟨BitVec.ofNat 64 0⟩ : F64) := by
                set_option exponentiation.threshold 2048 in
                  norm_num [ModelF64FromU64, Binary64ModelDefault, zpow_neg]
              rw [deq, hzero] at hfrom
              cases hfrom
              rfl
            have hpPositive : (0 : Rat) < (10 : Rat) ^ i.val := by positivity
            obtain ⟨hdiv, hmagBound, hmagRound⟩ :=
              Binary64ZeroDivRounds a p ((10 : Rat) ^ i.val)
                haZero hpBound hpDecode hpPositive
            have hdivField : F64.Insts.CoreOpsArithDivF64F64.div a p = ok a := by
              change ModelF64Div a p = ok a
              exact hdiv
            rw [hdivField] at hout
            simp at hout
            obtain ⟨f, hsign, hsigned⟩ := Binary64ApplySign d.negative a hmagBound
            have hsignField :
                (if d.negative then
                  do let t ← F64.Insts.CoreOpsArithNegF64.neg a; ok (some t)
                 else ok (some a)) = ok (some f) := by
              change (if d.negative then
                do let t ← ModelF64Neg a; ok (some t)
               else ok (some a)) = ok (some f)
              exact hsign
            rw [hsignField] at hout
            have houtEq : out = some f := by cases hout; rfl
            right
            refine ⟨f, a, houtEq, hmanyeq, ?_, hsigned⟩
            simpa [DecimalGoalVocabularyDefault, mantissaZero] using hmagRound
          · have hmPositive : (0 : Rat) < (d.mantissa.val : Rat) := by
              exact_mod_cast (Nat.zero_lt_of_ne_zero mantissaZero)
            have hpPositive : (0 : Rat) < (10 : Rat) ^ i.val := by positivity
            have hquotLower : (2 : Rat) ^ (-1022 : Int) ≤
                (d.mantissa.val : Rat) / (10 : Rat) ^ i.val := by
              apply (le_div_iff₀ hpPositive).2
              have hpowLe : (10 : Rat) ^ i.val ≤ (10 : Rat) ^ (22 : Nat) :=
                pow_le_pow_right₀ (by norm_num) hiUpper
              have hbase : (2 : Rat) ^ (-1022 : Int) * (10 : Rat) ^ (22 : Nat) ≤ 1 := by
                set_option exponentiation.threshold 2048 in
                  norm_num [zpow_neg]
              calc
                (2 : Rat) ^ (-1022 : Int) * (10 : Rat) ^ i.val ≤
                    (2 : Rat) ^ (-1022 : Int) * (10 : Rat) ^ (22 : Nat) :=
                  mul_le_mul_of_nonneg_left hpowLe (zpow_pos (by norm_num) _).le
                _ ≤ 1 := hbase
                _ ≤ (d.mantissa.val : Rat) := by exact_mod_cast
                  (Nat.one_le_iff_ne_zero.mpr mantissaZero)
            have hquotUpper : (d.mantissa.val : Rat) / (10 : Rat) ^ i.val <
                (2 : Rat) ^ (128 : Nat) := by
              have hdenOne : (1 : Rat) ≤ (10 : Rat) ^ i.val := one_le_pow₀ (by norm_num)
              calc
                (d.mantissa.val : Rat) / (10 : Rat) ^ i.val ≤
                    (d.mantissa.val : Rat) := div_le_self hmPositive.le hdenOne
                _ ≤ (2 : Rat) ^ (53 : Nat) := by exact_mod_cast hmant
                _ < (2 : Rat) ^ (128 : Nat) := pow_lt_pow_right₀ (by norm_num) (by omega)
            obtain ⟨magnitude, hdiv, hmagBound, hmagRound⟩ :=
              Binary64ExactPositiveDivRounds a p (d.mantissa.val : Rat)
                ((10 : Rat) ^ i.val) haFinite hpBound haDecode hpDecode
                hmPositive hpPositive hquotLower hquotUpper
            have hdivField :
                F64.Insts.CoreOpsArithDivF64F64.div a p = ok magnitude := by
              change ModelF64Div a p = ok magnitude
              exact hdiv
            rw [hdivField] at hout
            simp at hout
            obtain ⟨f, hsign, hsigned⟩ :=
              Binary64ApplySign d.negative magnitude hmagBound
            have hsignField :
                (if d.negative then
                  do let t ← F64.Insts.CoreOpsArithNegF64.neg magnitude; ok (some t)
                 else ok (some magnitude)) = ok (some f) := by
              change (if d.negative then
                do let t ← ModelF64Neg magnitude; ok (some t)
               else ok (some magnitude)) = ok (some f)
              exact hsign
            rw [hsignField] at hout
            have houtEq : out = some f := by cases hout; rfl
            have hvalue : DecimalGoalVocabularyDefault.decimalMagnitude d =
                (((d.mantissa.val : Rat) / (10 : Rat) ^ i.val : Rat) : Real) := by
              dsimp [DecimalGoalVocabularyDefault]
              have heq : d.exponent.val = -(i.val : Int) := by omega
              rw [heq, zpow_neg, zpow_natCast]
              push_cast
              rw [div_eq_mul_inv]
            right
            refine ⟨f, magnitude, houtEq, hmanyeq, ?_, hsigned⟩
            rw [hvalue]
            exact hmagRound
        · have nonnegativeExponent : 0 ≤ d.exponent.val := by omega
          rw [if_neg negativeExponent] at hout
          obtain ⟨i, hcast, hiVal, hiUpper⟩ :=
            Binary64FastPathIndexCasts.2.1 d.exponent nonnegativeExponent ordinary
          rw [hcast] at hout
          simp at hout
          obtain ⟨p, hpow, hpBound, hpDecode⟩ :=
            Binary64Pow10FastPathExact i hiUpper
          rw [hpow] at hout
          simp at hout
          by_cases mantissaZero : d.mantissa.val = 0
          · have haZero : a.val = 0 := by
              have deq : d.mantissa = 0#u64 := UScalar.eq_of_val_eq mantissaZero
              have hzero : ModelF64FromU64 0#u64 =
                  ok (⟨BitVec.ofNat 64 0⟩ : F64) := by
                set_option exponentiation.threshold 2048 in
                  norm_num [ModelF64FromU64, Binary64ModelDefault, zpow_neg]
              rw [deq, hzero] at hfrom
              cases hfrom
              rfl
            have hpPositive : (0 : Rat) < (10 : Rat) ^ i.val := by positivity
            obtain ⟨hmul, hmagBound, hmagRound⟩ :=
              Binary64ZeroMulRounds a p ((10 : Rat) ^ i.val)
                haZero hpBound hpDecode hpPositive
            have hmulField : F64.Insts.CoreOpsArithMulF64F64.mul a p = ok a := by
              change ModelF64Mul a p = ok a
              exact hmul
            rw [hmulField] at hout
            simp at hout
            obtain ⟨f, hsign, hsigned⟩ := Binary64ApplySign d.negative a hmagBound
            have hsignField :
                (if d.negative then
                  do let t ← F64.Insts.CoreOpsArithNegF64.neg a; ok (some t)
                 else ok (some a)) = ok (some f) := by
              change (if d.negative then
                do let t ← ModelF64Neg a; ok (some t)
               else ok (some a)) = ok (some f)
              exact hsign
            rw [hsignField] at hout
            have houtEq : out = some f := by cases hout; rfl
            right
            refine ⟨f, a, houtEq, hmanyeq, ?_, hsigned⟩
            simpa [DecimalGoalVocabularyDefault, mantissaZero] using hmagRound
          · have hmPositive : (0 : Rat) < (d.mantissa.val : Rat) := by
              exact_mod_cast (Nat.zero_lt_of_ne_zero mantissaZero)
            have hpPositive : (0 : Rat) < (10 : Rat) ^ i.val := by positivity
            have hprodLower : (2 : Rat) ^ (-1022 : Int) ≤
                (d.mantissa.val : Rat) * (10 : Rat) ^ i.val := by
              have hbase : (2 : Rat) ^ (-1022 : Int) ≤ 1 := by
                rw [zpow_neg]
                exact (inv_le_one₀ (pow_pos (by norm_num : (0 : Rat) < 2) _)).2
                  (one_le_pow₀ (by norm_num))
              have hmOne : (1 : Rat) ≤ d.mantissa.val := by
                exact_mod_cast (Nat.one_le_iff_ne_zero.mpr mantissaZero)
              have hpOne : (1 : Rat) ≤ (10 : Rat) ^ i.val := one_le_pow₀ (by norm_num)
              calc
                (2 : Rat) ^ (-1022 : Int) ≤ 1 := hbase
                _ = 1 * 1 := by ring
                _ ≤ (d.mantissa.val : Rat) * (10 : Rat) ^ i.val :=
                  mul_le_mul hmOne hpOne (by norm_num) (by norm_num)
            have hprodUpper : (d.mantissa.val : Rat) * (10 : Rat) ^ i.val <
                (2 : Rat) ^ (128 : Nat) := by
              have hmLe : (d.mantissa.val : Rat) ≤ (2 : Rat) ^ (53 : Nat) := by
                exact_mod_cast hmant
              have hpLe : (10 : Rat) ^ i.val ≤ (10 : Rat) ^ (22 : Nat) :=
                pow_le_pow_right₀ (by norm_num) hiUpper
              calc
                (d.mantissa.val : Rat) * (10 : Rat) ^ i.val ≤
                    (2 : Rat) ^ (53 : Nat) * (10 : Rat) ^ (22 : Nat) :=
                  mul_le_mul hmLe hpLe (by positivity) (by positivity)
                _ < (2 : Rat) ^ (128 : Nat) := by norm_num
            obtain ⟨magnitude, hmul, hmagBound, hmagRound⟩ :=
              Binary64ExactPositiveMulRounds a p (d.mantissa.val : Rat)
                ((10 : Rat) ^ i.val) haFinite hpBound haDecode hpDecode
                hprodLower hprodUpper
            have hmulField :
                F64.Insts.CoreOpsArithMulF64F64.mul a p = ok magnitude := by
              change ModelF64Mul a p = ok magnitude
              exact hmul
            rw [hmulField] at hout
            simp at hout
            obtain ⟨f, hsign, hsigned⟩ :=
              Binary64ApplySign d.negative magnitude hmagBound
            have hsignField :
                (if d.negative then
                  do let t ← F64.Insts.CoreOpsArithNegF64.neg magnitude; ok (some t)
                 else ok (some magnitude)) = ok (some f) := by
              change (if d.negative then
                do let t ← ModelF64Neg magnitude; ok (some t)
               else ok (some magnitude)) = ok (some f)
              exact hsign
            rw [hsignField] at hout
            have houtEq : out = some f := by cases hout; rfl
            have hvalue : DecimalGoalVocabularyDefault.decimalMagnitude d =
                (((d.mantissa.val : Rat) * (10 : Rat) ^ i.val : Rat) : Real) := by
              dsimp [DecimalGoalVocabularyDefault]
              have heq : d.exponent.val = (i.val : Int) := by omega
              rw [heq, zpow_natCast]
              push_cast
              rfl
            right
            refine ⟨f, magnitude, houtEq, hmanyeq, ?_, hsigned⟩
            rw [hvalue]
            exact hmagRound
      · have ordinary' : ¬d.exponent ≤ 22#i64 := by exact ordinary
        rw [if_neg ordinary] at hout
        have exponentAbove22 : 22 < d.exponent.val := by omega
        obtain ⟨shift, i, hsub, hcast, hshiftVal, hiVal, hiLower, hiUpper⟩ :=
          Binary64FastPathIndexCasts.2.2 d.exponent exponentAbove22 hmax
        rw [hsub] at hout
        simp at hout
        rw [hcast] at hout
        simp at hout
        obtain ⟨factor, hlookup, hfactorVal⟩ := Binary64IntPow10Index i hiUpper
        rw [hlookup] at hout
        simp at hout
        cases hmul : d.mantissa.checked_mul factor with
        | none =>
            rw [hmul] at hout
            have hlift : (lift (none : Option Std.U64) : Result (Option Std.U64)) =
                ok none := by rfl
            rw [hlift] at hout
            simp [core.option.Option.Insts.CoreOpsTry_traitTry.branch,
              core.option.Option.Insts.CoreOpsTry_traitFromResidualOptionInfallible.from_residual,
              ModelOptionBranch, ModelOptionFromResidual] at hout
            left
            exact hout.symm
        | some product =>
            rw [hmul] at hout
            have hlift : (lift (some product) : Result (Option Std.U64)) =
                ok (some product) := by rfl
            rw [hlift] at hout
            simp [core.option.Option.Insts.CoreOpsTry_traitTry.branch,
              ModelOptionBranch] at hout
            rw [F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.SIG_TOTAL_BITS.eq_def] at hout
            have hmantDigits : core.f64.F64.MANTISSA_DIGITS = ok 53#u32 := by rfl
            rw [hmantDigits] at hout
            simp at hout
            have hshl : (1#u64 <<< 53#u32) = ok 9007199254740992#u64 := by rfl
            rw [hshl] at hout
            simp at hout
            have hmulSpec := U64.checked_mul_bv_spec d.mantissa factor
            rw [hmul] at hmulSpec
            have hproductEq : product.val = d.mantissa.val * factor.val :=
              hmulSpec.2.1
            by_cases productLarge : 9007199254740992 < product.val
            · rw [if_pos productLarge] at hout
              left
              cases hout
              rfl
            · rw [if_neg productLarge] at hout
              have hproductSmall : product.val ≤ 2 ^ 53 := by norm_num at productLarge ⊢; omega
              obtain ⟨a, hfrom, haFinite, haDecode, haRound⟩ :=
                Binary64FromU64Exact product hproductSmall
              have hfromField :
                  F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.from_u64
                    product = ok a := by
                exact hfrom
              rw [hfromField] at hout
              simp at hout
              obtain ⟨j, hcast22, hjVal, hjUpper⟩ :=
                Binary64FastPathIndexCasts.2.1 22#i64 (by norm_num) (by norm_num)
              rw [hcast22] at hout
              simp at hout
              obtain ⟨p, hpow, hpBound, hpDecode⟩ :=
                Binary64Pow10FastPathExact j hjUpper
              rw [hpow] at hout
              simp at hout
              have hjValNat : j.val = 22 := by
                norm_num at hjVal
                exact_mod_cast hjVal
              by_cases productZero : product.val = 0
              · have haZero : a.val = 0 := by
                  have peq : product = 0#u64 := UScalar.eq_of_val_eq productZero
                  have hzero : ModelF64FromU64 0#u64 =
                      ok (⟨BitVec.ofNat 64 0⟩ : F64) := by
                    set_option exponentiation.threshold 2048 in
                      norm_num [ModelF64FromU64, Binary64ModelDefault, zpow_neg]
                  rw [peq, hzero] at hfrom
                  cases hfrom
                  rfl
                have hpPositive : (0 : Rat) < (10 : Rat) ^ j.val := by positivity
                obtain ⟨hmulFloat, hmagBound, hmagRound⟩ :=
                  Binary64ZeroMulRounds a p ((10 : Rat) ^ j.val)
                    haZero hpBound hpDecode hpPositive
                have hmulField :
                    F64.Insts.CoreOpsArithMulF64F64.mul a p = ok a := by
                  change ModelF64Mul a p = ok a
                  exact hmulFloat
                rw [hmulField] at hout
                simp at hout
                obtain ⟨f, hsign, hsigned⟩ :=
                  Binary64ApplySign d.negative a hmagBound
                have hsignField :
                    (if d.negative then
                      do let t ← F64.Insts.CoreOpsArithNegF64.neg a; ok (some t)
                     else ok (some a)) = ok (some f) := by
                  change (if d.negative then
                    do let t ← ModelF64Neg a; ok (some t)
                   else ok (some a)) = ok (some f)
                  exact hsign
                rw [hsignField] at hout
                have houtEq : out = some f := by cases hout; rfl
                have hfactorPositive : 0 < factor.val := by
                  rw [hfactorVal]
                  positivity
                have mantissaZero : d.mantissa.val = 0 := by
                  have hprodNat : d.mantissa.val * factor.val = 0 := by
                    rw [← hproductEq, productZero]
                  exact (Nat.mul_eq_zero.mp hprodNat).resolve_right
                    (Nat.ne_of_gt hfactorPositive)
                right
                refine ⟨f, a, houtEq, hmanyeq, ?_, hsigned⟩
                simpa [DecimalGoalVocabularyDefault, mantissaZero] using hmagRound
              · have hproductPositive : (0 : Rat) < (product.val : Rat) := by
                  exact_mod_cast (Nat.zero_lt_of_ne_zero productZero)
                have hpPositive : (0 : Rat) < (10 : Rat) ^ j.val := by positivity
                have hprodLower : (2 : Rat) ^ (-1022 : Int) ≤
                    (product.val : Rat) * (10 : Rat) ^ j.val := by
                  have hbase : (2 : Rat) ^ (-1022 : Int) ≤ 1 := by
                    rw [zpow_neg]
                    exact (inv_le_one₀ (pow_pos (by norm_num : (0 : Rat) < 2) _)).2
                      (one_le_pow₀ (by norm_num))
                  have hproductOne : (1 : Rat) ≤ product.val := by
                    exact_mod_cast (Nat.one_le_iff_ne_zero.mpr productZero)
                  have hpOne : (1 : Rat) ≤ (10 : Rat) ^ j.val :=
                    one_le_pow₀ (by norm_num)
                  calc
                    (2 : Rat) ^ (-1022 : Int) ≤ 1 := hbase
                    _ = 1 * 1 := by ring
                    _ ≤ (product.val : Rat) * (10 : Rat) ^ j.val :=
                      mul_le_mul hproductOne hpOne (by norm_num) (by norm_num)
                have hprodUpper : (product.val : Rat) * (10 : Rat) ^ j.val <
                    (2 : Rat) ^ (128 : Nat) := by
                  have hproductLe : (product.val : Rat) ≤ (2 : Rat) ^ (53 : Nat) := by
                    exact_mod_cast hproductSmall
                  have hpLe : (10 : Rat) ^ j.val ≤ (10 : Rat) ^ (22 : Nat) :=
                    pow_le_pow_right₀ (by norm_num) hjUpper
                  calc
                    (product.val : Rat) * (10 : Rat) ^ j.val ≤
                        (2 : Rat) ^ (53 : Nat) * (10 : Rat) ^ (22 : Nat) :=
                      mul_le_mul hproductLe hpLe (by positivity) (by positivity)
                    _ < (2 : Rat) ^ (128 : Nat) := by norm_num
                obtain ⟨magnitude, hmulFloat, hmagBound, hmagRound⟩ :=
                  Binary64ExactPositiveMulRounds a p (product.val : Rat)
                    ((10 : Rat) ^ j.val) haFinite hpBound haDecode hpDecode
                    hprodLower hprodUpper
                have hmulField :
                    F64.Insts.CoreOpsArithMulF64F64.mul a p = ok magnitude := by
                  change ModelF64Mul a p = ok magnitude
                  exact hmulFloat
                rw [hmulField] at hout
                simp at hout
                obtain ⟨f, hsign, hsigned⟩ :=
                  Binary64ApplySign d.negative magnitude hmagBound
                have hsignField :
                    (if d.negative then
                      do let t ← F64.Insts.CoreOpsArithNegF64.neg magnitude; ok (some t)
                     else ok (some magnitude)) = ok (some f) := by
                  change (if d.negative then
                    do let t ← ModelF64Neg magnitude; ok (some t)
                   else ok (some magnitude)) = ok (some f)
                  exact hsign
                rw [hsignField] at hout
                have houtEq : out = some f := by cases hout; rfl
                have hproductReal : (product.val : Real) =
                    (d.mantissa.val : Real) * (10 : Real) ^ i.val := by
                  rw [hproductEq, hfactorVal]
                  push_cast
                  rfl
                have hvalue : DecimalGoalVocabularyDefault.decimalMagnitude d =
                    (((product.val : Rat) * (10 : Rat) ^ j.val : Rat) : Real) := by
                  dsimp [DecimalGoalVocabularyDefault]
                  push_cast
                  have heq : d.exponent.val = (i.val : Int) + (j.val : Int) := by
                    omega
                  rw [heq, zpow_add₀ (by norm_num : (10 : Real) ≠ 0),
                    zpow_natCast, zpow_natCast, hproductReal]
                  ring
                right
                refine ⟨f, magnitude, houtEq, hmanyeq, ?_, hsigned⟩
                rw [hvalue]
                exact hmagRound

end dec2flt_model

Download Lean source · Download TeX source

Complete Lean module
import Tablet.DecimalGoalVocabularyDefault
import Tablet.Binary64ModelDefault
import Tablet.Binary64NativeCallDomain
import Tablet.Binary64ApplySign
import Tablet.Binary64ExactPositiveDivRounds
import Tablet.Binary64ExactPositiveMulRounds
import Tablet.Binary64FastPathGuard
import Tablet.Binary64FastPathIndexCasts
import Tablet.Binary64FromU64Exact
import Tablet.Binary64IntPow10Index
import Tablet.Binary64Pow10FastPathExact
import Tablet.Binary64ZeroDivRounds
import Tablet.Binary64ZeroMulRounds
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64_MAX_EXPONENT_FAST_PATH
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64_MAX_EXPONENT_DISGUISED_FAST_PATH
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64_pow10_fast_path
import Tablet.F64_Insts_CoreOpsArithDivF64F64
import Tablet.F64_Insts_CoreOpsArithMulF64F64
import Tablet.F64_Insts_CoreOpsArithNegF64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatExtU64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64
import Tablet.F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SIG_TOTAL_BITS
import Tablet.ModelF64MantissaDigits
import Tablet.ModelF64FromBits
import Tablet.ModelF64FromU64
import Tablet.ModelF64Mul
import Tablet.ModelF64Div
import Tablet.ModelF64Neg
import Tablet.ModelOptionBranch
import Tablet.ModelOptionFromResidual
import Tablet.ModelU64Shl
import Tablet.num_imp_dec2flt_Lemire_MIN_EXPONENT_FAST_PATH_default
import Tablet.num_imp_dec2flt_Lemire_MAX_MANTISSA_FAST_PATH_default
import Tablet.num_imp_dec2flt_dec2flt
import Tablet.num_imp_dec2flt_dec2flt_with_trace
import Tablet.num_imp_dec2flt_parse_parse_number
import Tablet.num_imp_dec2flt_parse_parse_inf_nan
import Tablet.num_imp_dec2flt_decimal_Decimal_can_use_fast_path
import Tablet.num_imp_dec2flt_decimal_Decimal_try_fast_path
import Tablet.num_imp_dec2flt_decimal_INT_POW10
import Tablet.num_imp_dec2flt_fpu_fpu_precision_set_precision
import Tablet.num_imp_dec2flt_lemire_compute_float
import Tablet.num_imp_dec2flt_slow_parse_long_mantissa
import Tablet.num_imp_dec2flt_biased_fp_to_float

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxRecDepth 1000000
set_option maxHeartbeats 1999999

namespace dec2flt_model

-- [TABLET NODE: NativeCorrectOrDefer]
theorem NativeCorrectOrDefer :
    ∀ (d : num.imp.dec2flt.decimal.Decimal) out,
      num.imp.dec2flt.decimal.Decimal.try_fast_path
        F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
        F64.Insts.CoreOpsArithDivF64F64 F64.Insts.CoreOpsArithMulF64F64
        F64.Insts.CoreOpsArithNegF64 d = ok out ->
      out = none ∨ ∃ (f magnitude : F64), out = some f ∧ d.many_digits = false ∧
        DecimalGoalVocabularyDefault.roundsMagnitude (DecimalGoalVocabularyDefault.decimalMagnitude d) magnitude ∧
        DecimalGoalVocabularyDefault.signedMagnitude d.negative magnitude f := by
-- BODY
  intro d out hout
  obtain ⟨guard, hguard, hguard_spec⟩ := Binary64FastPathGuard d
  have hmax22 :
      F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.MAX_EXPONENT_FAST_PATH =
        22#i64 := by
    rw [F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.MAX_EXPONENT_FAST_PATH.eq_def]
  have hmax22Field :
      (F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64 :
        num.imp.dec2flt.Lemire F64 Std.U64).MAX_EXPONENT_FAST_PATH =
        ok 22#i64 := by
    rw [F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.eq_def, hmax22]
  have hmaxMantissaField :
      (F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64 :
        num.imp.dec2flt.Lemire F64 Std.U64).MAX_MANTISSA_FAST_PATH =
        ok 9007199254740992#u64 := by
    rw [F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.eq_def]
    change (do
      let i ← F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.SIG_TOTAL_BITS
      1#u64 <<< i) = ok 9007199254740992#u64
    rw [F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.SIG_TOTAL_BITS.eq_def]
    rfl
  unfold num.imp.dec2flt.decimal.Decimal.try_fast_path at hout
  rw [show num.imp.dec2flt.fpu.fpu_precision.set_precision F64 = ok () by rfl,
    hguard] at hout
  cases guard with
  | false =>
      left
      have hnone : none = out := by simpa using hout
      exact hnone.symm
  | true =>
      have hbounds := hguard_spec.mp rfl
      obtain ⟨hmin, hmax, hmant, hmanyeq⟩ := hbounds
      simp at hout
      rw [hmax22] at hout
      rw [show (22#i64).val = 22 by rfl] at hout
      by_cases ordinary : d.exponent.val ≤ 22
      · have ordinary' : d.exponent ≤ 22#i64 := by exact ordinary
        rw [if_pos ordinary] at hout
        obtain ⟨a, hfrom, haFinite, haDecode, haRound⟩ :=
          Binary64FromU64Exact d.mantissa hmant
        have haBound : a.val < 2 ^ 63 := by omega
        have hfromField :
            F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.from_u64
              d.mantissa = ok a := by
          exact hfrom
        rw [hfromField] at hout
        simp at hout
        by_cases negativeExponent : d.exponent.val < 0
        · rw [if_pos negativeExponent] at hout
          obtain ⟨negated, i, hnegated, hcast, hnegatedVal, hiVal,
              hiLower, hiUpper⟩ :=
            Binary64FastPathIndexCasts.1 d.exponent hmin negativeExponent
          rw [hnegated] at hout
          simp at hout
          rw [hcast] at hout
          simp at hout
          obtain ⟨p, hpow, hpBound, hpDecode⟩ :=
            Binary64Pow10FastPathExact i hiUpper
          rw [hpow] at hout
          simp at hout
          by_cases mantissaZero : d.mantissa.val = 0
          · have haZero : a.val = 0 := by
              have deq : d.mantissa = 0#u64 := UScalar.eq_of_val_eq mantissaZero
              have hzero : ModelF64FromU64 0#u64 =
                  ok (⟨BitVec.ofNat 64 0⟩ : F64) := by
                set_option exponentiation.threshold 2048 in
                  norm_num [ModelF64FromU64, Binary64ModelDefault, zpow_neg]
              rw [deq, hzero] at hfrom
              cases hfrom
              rfl
            have hpPositive : (0 : Rat) < (10 : Rat) ^ i.val := by positivity
            obtain ⟨hdiv, hmagBound, hmagRound⟩ :=
              Binary64ZeroDivRounds a p ((10 : Rat) ^ i.val)
                haZero hpBound hpDecode hpPositive
            have hdivField : F64.Insts.CoreOpsArithDivF64F64.div a p = ok a := by
              change ModelF64Div a p = ok a
              exact hdiv
            rw [hdivField] at hout
            simp at hout
            obtain ⟨f, hsign, hsigned⟩ := Binary64ApplySign d.negative a hmagBound
            have hsignField :
                (if d.negative then
                  do let t ← F64.Insts.CoreOpsArithNegF64.neg a; ok (some t)
                 else ok (some a)) = ok (some f) := by
              change (if d.negative then
                do let t ← ModelF64Neg a; ok (some t)
               else ok (some a)) = ok (some f)
              exact hsign
            rw [hsignField] at hout
            have houtEq : out = some f := by cases hout; rfl
            right
            refine ⟨f, a, houtEq, hmanyeq, ?_, hsigned⟩
            simpa [DecimalGoalVocabularyDefault, mantissaZero] using hmagRound
          · have hmPositive : (0 : Rat) < (d.mantissa.val : Rat) := by
              exact_mod_cast (Nat.zero_lt_of_ne_zero mantissaZero)
            have hpPositive : (0 : Rat) < (10 : Rat) ^ i.val := by positivity
            have hquotLower : (2 : Rat) ^ (-1022 : Int) ≤
                (d.mantissa.val : Rat) / (10 : Rat) ^ i.val := by
              apply (le_div_iff₀ hpPositive).2
              have hpowLe : (10 : Rat) ^ i.val ≤ (10 : Rat) ^ (22 : Nat) :=
                pow_le_pow_right₀ (by norm_num) hiUpper
              have hbase : (2 : Rat) ^ (-1022 : Int) * (10 : Rat) ^ (22 : Nat) ≤ 1 := by
                set_option exponentiation.threshold 2048 in
                  norm_num [zpow_neg]
              calc
                (2 : Rat) ^ (-1022 : Int) * (10 : Rat) ^ i.val ≤
                    (2 : Rat) ^ (-1022 : Int) * (10 : Rat) ^ (22 : Nat) :=
                  mul_le_mul_of_nonneg_left hpowLe (zpow_pos (by norm_num) _).le
                _ ≤ 1 := hbase
                _ ≤ (d.mantissa.val : Rat) := by exact_mod_cast
                  (Nat.one_le_iff_ne_zero.mpr mantissaZero)
            have hquotUpper : (d.mantissa.val : Rat) / (10 : Rat) ^ i.val <
                (2 : Rat) ^ (128 : Nat) := by
              have hdenOne : (1 : Rat) ≤ (10 : Rat) ^ i.val := one_le_pow₀ (by norm_num)
              calc
                (d.mantissa.val : Rat) / (10 : Rat) ^ i.val ≤
                    (d.mantissa.val : Rat) := div_le_self hmPositive.le hdenOne
                _ ≤ (2 : Rat) ^ (53 : Nat) := by exact_mod_cast hmant
                _ < (2 : Rat) ^ (128 : Nat) := pow_lt_pow_right₀ (by norm_num) (by omega)
            obtain ⟨magnitude, hdiv, hmagBound, hmagRound⟩ :=
              Binary64ExactPositiveDivRounds a p (d.mantissa.val : Rat)
                ((10 : Rat) ^ i.val) haFinite hpBound haDecode hpDecode
                hmPositive hpPositive hquotLower hquotUpper
            have hdivField :
                F64.Insts.CoreOpsArithDivF64F64.div a p = ok magnitude := by
              change ModelF64Div a p = ok magnitude
              exact hdiv
            rw [hdivField] at hout
            simp at hout
            obtain ⟨f, hsign, hsigned⟩ :=
              Binary64ApplySign d.negative magnitude hmagBound
            have hsignField :
                (if d.negative then
                  do let t ← F64.Insts.CoreOpsArithNegF64.neg magnitude; ok (some t)
                 else ok (some magnitude)) = ok (some f) := by
              change (if d.negative then
                do let t ← ModelF64Neg magnitude; ok (some t)
               else ok (some magnitude)) = ok (some f)
              exact hsign
            rw [hsignField] at hout
            have houtEq : out = some f := by cases hout; rfl
            have hvalue : DecimalGoalVocabularyDefault.decimalMagnitude d =
                (((d.mantissa.val : Rat) / (10 : Rat) ^ i.val : Rat) : Real) := by
              dsimp [DecimalGoalVocabularyDefault]
              have heq : d.exponent.val = -(i.val : Int) := by omega
              rw [heq, zpow_neg, zpow_natCast]
              push_cast
              rw [div_eq_mul_inv]
            right
            refine ⟨f, magnitude, houtEq, hmanyeq, ?_, hsigned⟩
            rw [hvalue]
            exact hmagRound
        · have nonnegativeExponent : 0 ≤ d.exponent.val := by omega
          rw [if_neg negativeExponent] at hout
          obtain ⟨i, hcast, hiVal, hiUpper⟩ :=
            Binary64FastPathIndexCasts.2.1 d.exponent nonnegativeExponent ordinary
          rw [hcast] at hout
          simp at hout
          obtain ⟨p, hpow, hpBound, hpDecode⟩ :=
            Binary64Pow10FastPathExact i hiUpper
          rw [hpow] at hout
          simp at hout
          by_cases mantissaZero : d.mantissa.val = 0
          · have haZero : a.val = 0 := by
              have deq : d.mantissa = 0#u64 := UScalar.eq_of_val_eq mantissaZero
              have hzero : ModelF64FromU64 0#u64 =
                  ok (⟨BitVec.ofNat 64 0⟩ : F64) := by
                set_option exponentiation.threshold 2048 in
                  norm_num [ModelF64FromU64, Binary64ModelDefault, zpow_neg]
              rw [deq, hzero] at hfrom
              cases hfrom
              rfl
            have hpPositive : (0 : Rat) < (10 : Rat) ^ i.val := by positivity
            obtain ⟨hmul, hmagBound, hmagRound⟩ :=
              Binary64ZeroMulRounds a p ((10 : Rat) ^ i.val)
                haZero hpBound hpDecode hpPositive
            have hmulField : F64.Insts.CoreOpsArithMulF64F64.mul a p = ok a := by
              change ModelF64Mul a p = ok a
              exact hmul
            rw [hmulField] at hout
            simp at hout
            obtain ⟨f, hsign, hsigned⟩ := Binary64ApplySign d.negative a hmagBound
            have hsignField :
                (if d.negative then
                  do let t ← F64.Insts.CoreOpsArithNegF64.neg a; ok (some t)
                 else ok (some a)) = ok (some f) := by
              change (if d.negative then
                do let t ← ModelF64Neg a; ok (some t)
               else ok (some a)) = ok (some f)
              exact hsign
            rw [hsignField] at hout
            have houtEq : out = some f := by cases hout; rfl
            right
            refine ⟨f, a, houtEq, hmanyeq, ?_, hsigned⟩
            simpa [DecimalGoalVocabularyDefault, mantissaZero] using hmagRound
          · have hmPositive : (0 : Rat) < (d.mantissa.val : Rat) := by
              exact_mod_cast (Nat.zero_lt_of_ne_zero mantissaZero)
            have hpPositive : (0 : Rat) < (10 : Rat) ^ i.val := by positivity
            have hprodLower : (2 : Rat) ^ (-1022 : Int) ≤
                (d.mantissa.val : Rat) * (10 : Rat) ^ i.val := by
              have hbase : (2 : Rat) ^ (-1022 : Int) ≤ 1 := by
                rw [zpow_neg]
                exact (inv_le_one₀ (pow_pos (by norm_num : (0 : Rat) < 2) _)).2
                  (one_le_pow₀ (by norm_num))
              have hmOne : (1 : Rat) ≤ d.mantissa.val := by
                exact_mod_cast (Nat.one_le_iff_ne_zero.mpr mantissaZero)
              have hpOne : (1 : Rat) ≤ (10 : Rat) ^ i.val := one_le_pow₀ (by norm_num)
              calc
                (2 : Rat) ^ (-1022 : Int) ≤ 1 := hbase
                _ = 1 * 1 := by ring
                _ ≤ (d.mantissa.val : Rat) * (10 : Rat) ^ i.val :=
                  mul_le_mul hmOne hpOne (by norm_num) (by norm_num)
            have hprodUpper : (d.mantissa.val : Rat) * (10 : Rat) ^ i.val <
                (2 : Rat) ^ (128 : Nat) := by
              have hmLe : (d.mantissa.val : Rat) ≤ (2 : Rat) ^ (53 : Nat) := by
                exact_mod_cast hmant
              have hpLe : (10 : Rat) ^ i.val ≤ (10 : Rat) ^ (22 : Nat) :=
                pow_le_pow_right₀ (by norm_num) hiUpper
              calc
                (d.mantissa.val : Rat) * (10 : Rat) ^ i.val ≤
                    (2 : Rat) ^ (53 : Nat) * (10 : Rat) ^ (22 : Nat) :=
                  mul_le_mul hmLe hpLe (by positivity) (by positivity)
                _ < (2 : Rat) ^ (128 : Nat) := by norm_num
            obtain ⟨magnitude, hmul, hmagBound, hmagRound⟩ :=
              Binary64ExactPositiveMulRounds a p (d.mantissa.val : Rat)
                ((10 : Rat) ^ i.val) haFinite hpBound haDecode hpDecode
                hprodLower hprodUpper
            have hmulField :
                F64.Insts.CoreOpsArithMulF64F64.mul a p = ok magnitude := by
              change ModelF64Mul a p = ok magnitude
              exact hmul
            rw [hmulField] at hout
            simp at hout
            obtain ⟨f, hsign, hsigned⟩ :=
              Binary64ApplySign d.negative magnitude hmagBound
            have hsignField :
                (if d.negative then
                  do let t ← F64.Insts.CoreOpsArithNegF64.neg magnitude; ok (some t)
                 else ok (some magnitude)) = ok (some f) := by
              change (if d.negative then
                do let t ← ModelF64Neg magnitude; ok (some t)
               else ok (some magnitude)) = ok (some f)
              exact hsign
            rw [hsignField] at hout
            have houtEq : out = some f := by cases hout; rfl
            have hvalue : DecimalGoalVocabularyDefault.decimalMagnitude d =
                (((d.mantissa.val : Rat) * (10 : Rat) ^ i.val : Rat) : Real) := by
              dsimp [DecimalGoalVocabularyDefault]
              have heq : d.exponent.val = (i.val : Int) := by omega
              rw [heq, zpow_natCast]
              push_cast
              rfl
            right
            refine ⟨f, magnitude, houtEq, hmanyeq, ?_, hsigned⟩
            rw [hvalue]
            exact hmagRound
      · have ordinary' : ¬d.exponent ≤ 22#i64 := by exact ordinary
        rw [if_neg ordinary] at hout
        have exponentAbove22 : 22 < d.exponent.val := by omega
        obtain ⟨shift, i, hsub, hcast, hshiftVal, hiVal, hiLower, hiUpper⟩ :=
          Binary64FastPathIndexCasts.2.2 d.exponent exponentAbove22 hmax
        rw [hsub] at hout
        simp at hout
        rw [hcast] at hout
        simp at hout
        obtain ⟨factor, hlookup, hfactorVal⟩ := Binary64IntPow10Index i hiUpper
        rw [hlookup] at hout
        simp at hout
        cases hmul : d.mantissa.checked_mul factor with
        | none =>
            rw [hmul] at hout
            have hlift : (lift (none : Option Std.U64) : Result (Option Std.U64)) =
                ok none := by rfl
            rw [hlift] at hout
            simp [core.option.Option.Insts.CoreOpsTry_traitTry.branch,
              core.option.Option.Insts.CoreOpsTry_traitFromResidualOptionInfallible.from_residual,
              ModelOptionBranch, ModelOptionFromResidual] at hout
            left
            exact hout.symm
        | some product =>
            rw [hmul] at hout
            have hlift : (lift (some product) : Result (Option Std.U64)) =
                ok (some product) := by rfl
            rw [hlift] at hout
            simp [core.option.Option.Insts.CoreOpsTry_traitTry.branch,
              ModelOptionBranch] at hout
            rw [F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.SIG_TOTAL_BITS.eq_def] at hout
            have hmantDigits : core.f64.F64.MANTISSA_DIGITS = ok 53#u32 := by rfl
            rw [hmantDigits] at hout
            simp at hout
            have hshl : (1#u64 <<< 53#u32) = ok 9007199254740992#u64 := by rfl
            rw [hshl] at hout
            simp at hout
            have hmulSpec := U64.checked_mul_bv_spec d.mantissa factor
            rw [hmul] at hmulSpec
            have hproductEq : product.val = d.mantissa.val * factor.val :=
              hmulSpec.2.1
            by_cases productLarge : 9007199254740992 < product.val
            · rw [if_pos productLarge] at hout
              left
              cases hout
              rfl
            · rw [if_neg productLarge] at hout
              have hproductSmall : product.val ≤ 2 ^ 53 := by norm_num at productLarge ⊢; omega
              obtain ⟨a, hfrom, haFinite, haDecode, haRound⟩ :=
                Binary64FromU64Exact product hproductSmall
              have hfromField :
                  F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.from_u64
                    product = ok a := by
                exact hfrom
              rw [hfromField] at hout
              simp at hout
              obtain ⟨j, hcast22, hjVal, hjUpper⟩ :=
                Binary64FastPathIndexCasts.2.1 22#i64 (by norm_num) (by norm_num)
              rw [hcast22] at hout
              simp at hout
              obtain ⟨p, hpow, hpBound, hpDecode⟩ :=
                Binary64Pow10FastPathExact j hjUpper
              rw [hpow] at hout
              simp at hout
              have hjValNat : j.val = 22 := by
                norm_num at hjVal
                exact_mod_cast hjVal
              by_cases productZero : product.val = 0
              · have haZero : a.val = 0 := by
                  have peq : product = 0#u64 := UScalar.eq_of_val_eq productZero
                  have hzero : ModelF64FromU64 0#u64 =
                      ok (⟨BitVec.ofNat 64 0⟩ : F64) := by
                    set_option exponentiation.threshold 2048 in
                      norm_num [ModelF64FromU64, Binary64ModelDefault, zpow_neg]
                  rw [peq, hzero] at hfrom
                  cases hfrom
                  rfl
                have hpPositive : (0 : Rat) < (10 : Rat) ^ j.val := by positivity
                obtain ⟨hmulFloat, hmagBound, hmagRound⟩ :=
                  Binary64ZeroMulRounds a p ((10 : Rat) ^ j.val)
                    haZero hpBound hpDecode hpPositive
                have hmulField :
                    F64.Insts.CoreOpsArithMulF64F64.mul a p = ok a := by
                  change ModelF64Mul a p = ok a
                  exact hmulFloat
                rw [hmulField] at hout
                simp at hout
                obtain ⟨f, hsign, hsigned⟩ :=
                  Binary64ApplySign d.negative a hmagBound
                have hsignField :
                    (if d.negative then
                      do let t ← F64.Insts.CoreOpsArithNegF64.neg a; ok (some t)
                     else ok (some a)) = ok (some f) := by
                  change (if d.negative then
                    do let t ← ModelF64Neg a; ok (some t)
                   else ok (some a)) = ok (some f)
                  exact hsign
                rw [hsignField] at hout
                have houtEq : out = some f := by cases hout; rfl
                have hfactorPositive : 0 < factor.val := by
                  rw [hfactorVal]
                  positivity
                have mantissaZero : d.mantissa.val = 0 := by
                  have hprodNat : d.mantissa.val * factor.val = 0 := by
                    rw [← hproductEq, productZero]
                  exact (Nat.mul_eq_zero.mp hprodNat).resolve_right
                    (Nat.ne_of_gt hfactorPositive)
                right
                refine ⟨f, a, houtEq, hmanyeq, ?_, hsigned⟩
                simpa [DecimalGoalVocabularyDefault, mantissaZero] using hmagRound
              · have hproductPositive : (0 : Rat) < (product.val : Rat) := by
                  exact_mod_cast (Nat.zero_lt_of_ne_zero productZero)
                have hpPositive : (0 : Rat) < (10 : Rat) ^ j.val := by positivity
                have hprodLower : (2 : Rat) ^ (-1022 : Int) ≤
                    (product.val : Rat) * (10 : Rat) ^ j.val := by
                  have hbase : (2 : Rat) ^ (-1022 : Int) ≤ 1 := by
                    rw [zpow_neg]
                    exact (inv_le_one₀ (pow_pos (by norm_num : (0 : Rat) < 2) _)).2
                      (one_le_pow₀ (by norm_num))
                  have hproductOne : (1 : Rat) ≤ product.val := by
                    exact_mod_cast (Nat.one_le_iff_ne_zero.mpr productZero)
                  have hpOne : (1 : Rat) ≤ (10 : Rat) ^ j.val :=
                    one_le_pow₀ (by norm_num)
                  calc
                    (2 : Rat) ^ (-1022 : Int) ≤ 1 := hbase
                    _ = 1 * 1 := by ring
                    _ ≤ (product.val : Rat) * (10 : Rat) ^ j.val :=
                      mul_le_mul hproductOne hpOne (by norm_num) (by norm_num)
                have hprodUpper : (product.val : Rat) * (10 : Rat) ^ j.val <
                    (2 : Rat) ^ (128 : Nat) := by
                  have hproductLe : (product.val : Rat) ≤ (2 : Rat) ^ (53 : Nat) := by
                    exact_mod_cast hproductSmall
                  have hpLe : (10 : Rat) ^ j.val ≤ (10 : Rat) ^ (22 : Nat) :=
                    pow_le_pow_right₀ (by norm_num) hjUpper
                  calc
                    (product.val : Rat) * (10 : Rat) ^ j.val ≤
                        (2 : Rat) ^ (53 : Nat) * (10 : Rat) ^ (22 : Nat) :=
                      mul_le_mul hproductLe hpLe (by positivity) (by positivity)
                    _ < (2 : Rat) ^ (128 : Nat) := by norm_num
                obtain ⟨magnitude, hmulFloat, hmagBound, hmagRound⟩ :=
                  Binary64ExactPositiveMulRounds a p (product.val : Rat)
                    ((10 : Rat) ^ j.val) haFinite hpBound haDecode hpDecode
                    hprodLower hprodUpper
                have hmulField :
                    F64.Insts.CoreOpsArithMulF64F64.mul a p = ok magnitude := by
                  change ModelF64Mul a p = ok magnitude
                  exact hmulFloat
                rw [hmulField] at hout
                simp at hout
                obtain ⟨f, hsign, hsigned⟩ :=
                  Binary64ApplySign d.negative magnitude hmagBound
                have hsignField :
                    (if d.negative then
                      do let t ← F64.Insts.CoreOpsArithNegF64.neg magnitude; ok (some t)
                     else ok (some magnitude)) = ok (some f) := by
                  change (if d.negative then
                    do let t ← ModelF64Neg magnitude; ok (some t)
                   else ok (some magnitude)) = ok (some f)
                  exact hsign
                rw [hsignField] at hout
                have houtEq : out = some f := by cases hout; rfl
                have hproductReal : (product.val : Real) =
                    (d.mantissa.val : Real) * (10 : Real) ^ i.val := by
                  rw [hproductEq, hfactorVal]
                  push_cast
                  rfl
                have hvalue : DecimalGoalVocabularyDefault.decimalMagnitude d =
                    (((product.val : Rat) * (10 : Rat) ^ j.val : Rat) : Real) := by
                  dsimp [DecimalGoalVocabularyDefault]
                  push_cast
                  have heq : d.exponent.val = (i.val : Int) + (j.val : Int) := by
                    omega
                  rw [heq, zpow_add₀ (by norm_num : (10 : Real) ≠ 0),
                    zpow_natCast, zpow_natCast, hproductReal]
                  ring
                right
                refine ⟨f, magnitude, houtEq, hmanyeq, ?_, hsigned⟩
                rw [hvalue]
                exact hmagRound

end dec2flt_model

Proof structure

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

Uses

All 45 entries

Explore this dependency tree

Inspect related source (201)
More program dependencies (159)
Standard-library dependencies (39)

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
All 107 entries
Technical checking records
Local closure summary
{
  "node": "NativeCorrectOrDefer",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "03a8d3899e7ea22ddac4339884157a24d6af163775d2f4f6231a78fa012842e9",
  "active_statement_hash": "3e732c08404fda52201c3376df141e4640c4336550d79da6ec8bd71f0c66af50",
  "kernel_axioms": [
    "Classical.choice",
    "Quot.sound",
    "propext"
  ],
  "toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
  "lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
  "checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
  "approved_axioms_hash": "ab64d13f256386ee0e494a5abcc6a5db49512cf3d90bbdfcabd6327793a31f95",
  "axcheck_status": "Agreed",
  "accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-131",
  "boundary_theorems": {},
  "strict_theorem_deps": {
    "Binary64ApplySign": "d55a8c73d5261f86",
    "Binary64ExactPositiveDivRounds": "976564ebe4044467",
    "Binary64ExactPositiveMulRounds": "a05b820da3503675",
    "Binary64FastPathGuard": "c1391b605f3cfebb",
    "Binary64FastPathIndexCasts": "417e901cdb7e8e95",
    "Binary64FromU64Exact": "f1dc380dae903c52",
    "Binary64IntPow10Index": "335765edc9734a2e",
    "Binary64ModelDefault": "c722a2c00805b545",
    "Binary64Pow10FastPathExact": "93bbdd6f862814f8",
    "Binary64ZeroDivRounds": "dbd86a5562b82095",
    "Binary64ZeroMulRounds": "c57caade6d34c32a",
    "DecimalGoalVocabularyDefault": "94cb4c406f8efb78",
    "F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64_MAX_EXPONENT_FAST_PATH": "6bf5ea9f18f5e8dc",
    "num_imp_dec2flt_Lemire_MAX_MANTISSA_FAST_PATH_default": "32d9110750ebf062",
    "num_imp_dec2flt_decimal_Decimal_try_fast_path": "ba81300a2601d639"
  },
  "strict_definition_deps": {
    "Binary64Model": "c98c2c511cf0ced6",
    "Binary64ModelDefault": "dc548d1e27696ba4",
    "DecimalGoalVocabulary": "c43614ff2149ecf2",
    "DecimalGoalVocabularyDefault": "512f8d0aea894250",
    "DecimalLexeme": "8127b3eaeae00dd2",
    "F64": "ec4e25fbaf4e11d4",
    "F64_Insts_CoreOpsArithDivF64F64": "dc44e13a99fc6bed",
    "F64_Insts_CoreOpsArithMulF64F64": "1ae1a9021a654abd",
    "F64_Insts_CoreOpsArithNegF64": "2d9be310c546ea2e",
    "F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64": "30963b4ef656cc79",
    "F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64_MAX_EXPONENT_DISGUISED_FAST_PATH": "238680a0d0ed48da",
    "F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64_MAX_EXPONENT_FAST_PATH": "c8b07a02533b83c6",
    "F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64_pow10_fast_path": "c0ce6fdd5caeca22",
    "F64_Insts_Dec2flt_modelNumImpTraitsFloatExtU64": "60afe26c6a80cf0f",
    "F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SIG_TOTAL_BITS": "887b52d84a3fc9c4",
    "ModelF64Div": "f8da2e585a4f4183",
    "ModelF64FromU64": "97a26f5bc593ff7a",
    "ModelF64Mul": "ba97971db93c2ae2",
    "ModelF64Neg": "78a021de99eb373b",
    "ModelOptionBranch": "2b227898dbe15e59",
    "ModelOptionFromResidual": "6d48ecfbc617744f",
    "Preamble": "4adf4172ae751d7d",
    "core_num_FpCategory": "f500de642a5d5148",
    "core_ops_arith_Div": "2704fb3c3065e0f5",
    "core_ops_arith_Mul": "91e8d5ef661a3d2a",
    "core_ops_arith_Neg": "0ff07135a60bcbf9",
    "num_imp_dec2flt_Lemire": "94ab5f784cdf5db8",
    "num_imp_dec2flt_common_BiasedFp": "c43614ff2149ecf2",
    "num_imp_dec2flt_decimal_Decimal": "fe99f3f976739f2d",
    "num_imp_dec2flt_decimal_Decimal_can_use_fast_path": "11145d187f88b02e",
    "num_imp_dec2flt_decimal_Decimal_try_fast_path": "063a63057ba134c8",
    "num_imp_dec2flt_decimal_INT_POW10": "48c78c3dca210847",
    "num_imp_dec2flt_fpu_fpu_precision_set_precision": "73042c31057f9ab9",
    "num_imp_traits_Float": "22e97e73b1292e80",
    "num_imp_traits_FloatExt": "f996e5400649797d"
  }
}
Prose assessment
{
  "label": "Recorded Sound: VerifierPass",
  "assessment_status": "VerifierPass",
  "fingerprint_relation": "matches current fingerprint",
  "assessment_fingerprint": "sound-v2:238da8f44bc18410018d89d9afbe87afc27300a5caea097ba3c20ca803dcd422",
  "current_fingerprint": "sound-v2:238da8f44bc18410018d89d9afbe87afc27300a5caea097ba3c20ca803dcd422",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "sound_status": "Pass",
  "substantiveness_status": "Pass"
}