ParserNumericPublicOverflowWitness

Lean checked

Statement

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

Lemma · Public numeric overflow witness

There are an Aeneas string s and a decimal lexeme x with the following properties. The bytes of s are
[48,46]\mathbin{++}\operatorname{replicate}(11,48) \mathbin{++}\operatorname{bytes}(\texttt{1000000000000000080}) \mathbin{++}\operatorname{replicate}(2147483618,48), \tag{1}
and their length is 2147483650. The lexeme x has no leading sign, integer digits [0], fractional digits consisting of eleven zeroes, the nineteen digits of 1000000000000000080, and 2147483618 further zeroes, and no exponent. Moreover, s is a source-valid Rust string, x is a valid numeric lexeme, the complete bytes of s are exactly the numeric rendering of x, and the extracted public binary64 parser satisfies
\texttt{dec2flt}(s)=\texttt{fail integerOverflow}. \tag{2}

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.F64_Insts_CoreOpsArithDivF64F64
import Tablet.F64_Insts_CoreOpsArithMulF64F64
import Tablet.F64_Insts_CoreOpsArithNegF64
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64
import Tablet.ModelSliceFirst
import Tablet.ModelStrAsBytes
import Tablet.ParserNumericSlowPathOverflowWitness
import Tablet.num_imp_dec2flt_dec2flt
import Tablet.num_imp_dec2flt_dec2flt_with_trace

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxRecDepth 10000

namespace dec2flt_model

-- [TABLET NODE: ParserNumericPublicOverflowWitness]
theorem ParserNumericPublicOverflowWitness :
    exists (s : Str) (x : DecimalLexeme),
      s.val = [48#u8, 46#u8] ++ List.replicate 11 48#u8 ++
        [49#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
          48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
          48#u8, 48#u8, 48#u8, 56#u8, 48#u8] ++
        List.replicate 2147483618 48#u8 /\
      s.val.length = 2147483650 /\
      x = {
        leadingSign := none
        integerDigits := [0]
        fractionDigits := some (List.replicate 11 0 ++
          [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0] ++
          List.replicate 2147483618 0)
        exponent := none
      } /\
      DecimalGoalVocabularyDefault.sourceString s /\
      DecimalGoalVocabularyDefault.validNumeric x /\
      DecimalGoalVocabularyDefault.bytes s =
        DecimalGoalVocabularyDefault.renderNumeric x /\
      num.imp.dec2flt.dec2flt
        F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
        F64.Insts.CoreOpsArithDivF64F64
        F64.Insts.CoreOpsArithMulF64F64
        F64.Insts.CoreOpsArithNegF64 s = fail integerOverflow := 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

Put K=2147483618. Instantiate ParserNumericSlowPathOverflowWitness; call the supplied body slice b. Its statement gives
b.\mathit{val}=[48,46]\mathbin{++}\operatorname{replicate}(11,48) \mathbin{++}\operatorname{bytes}(\texttt{1000000000000000080}) \mathbin{++}\operatorname{replicate}(K,48), \qquad |b|=2147483650. \tag{3}
Use the same Aeneas slice carrier as a Str and call it s. Define x to have no leading sign, integer list [0], the fractional list of eleven zeroes followed by
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0]
followed by K zeroes, and no exponent. These choices establish the first three conjuncts of the statement directly from (3).
We next prove the three lexical conjuncts. Every entry of both digit lists is one of 0,1,8, hence is strictly below ten, and the integer list is nonempty. There is no exponent condition. Unfolding DecimalGoalVocabularyDefault therefore proves validNumeric x. The same definition renders the absent sign as the empty list, the integer zero as byte 48, the point as byte 46, every fractional digit d as byte 48+d, and the absent exponent as the empty list. Distribution of List.map over the three fractional-list appends, and its value on a replicated zero list, gives exactly (1). Thus bytes s = renderNumeric x.
For source validity, 2147483650<9223372036854775807, so the length conjunct in DecimalGoalVocabularyDefault follows from (3). For its UTF-8 conjunct, take the Lean string obtained by String.ofList from the character list 0., then eleven 0 characters, the nineteen characters of 1000000000000000080, and K further 0 characters. Each displayed character is ASCII and encodes to its single byte in (1). Induction on each List.replicate, together with UTF-8 encoding over list append, shows that this string's UTF-8 byte list is exactly (1). Mapping its UInt8 values to naturals agrees entrywise with mapping the Aeneas u8 values to naturals. This is the required string witness, so sourceString s holds.
It remains to establish the public execution equation (2). By ModelStrAsBytes, the first bind of num imp dec2flt dec2flt with trace returns the complete slice (3). It is nonempty and begins with byte 48, so ModelSliceFirst returns some 48. This byte is neither 45 nor 43. Both sign tests are therefore false, no range slice is taken, the unsigned body is exactly b, and its emptiness test is false.
The remaining fixed-width facts now come solely from ParserNumericSlowPathOverflowWitness. Its statement says that parse_number(b) is ok (some d), where d has mantissa 1000000000000000080, exponent -30, negative flag false, and many-digits flag true. It also says that try_fast_path(d) is ok none; because the lexical minus test was false, the record update performed by the dispatcher leaves this d unchanged. The two stated compute_float results are respectively (448160529771025,983) and (448160529771026,983). Since many_digits is true and 983\geq0, the second-computation guard in num imp dec2flt dec2flt with trace is true. Incrementing the mantissa gives 1000000000000000081<2^{64}, so that checked addition succeeds, and the witness statement gives the second result and says their extracted comparison is ok false.
Consequently the false-comparison branch replaces the first pair's biased power by -1 and records forced deferral. Since -1<0, the next branch in num imp dec2flt dec2flt with trace invokes parse_long_mantissa(b). The slow-path witness states that this exact call is fail integerOverflow; in particular, its fractional slice has length 2^{31}, the truncating cast is i32::MIN, and the checked subtraction 0-\texttt{i32::MIN} fails. Result-monad binding propagates that same failure out of dec2flt_with_trace before assembly or lexical sign application. Finally, num imp dec2flt dec2flt binds the traced call before projecting its ordinary result, so it propagates the identical failure. This proves (2) and all conjuncts of the lemma.

Lean proof


  obtain ⟨body, first, remainder, d, hfirst, hbody, hremainder,
    hbodyLen, hfirstLen, hremainderLen, hparse, hd, hfast,
    hcompute0, hcompute1, hne, heq, hcast, hsub, hdecimal, hslow⟩ :=
    ParserNumericSlowPathOverflowWitness
  let s : Str := body
  let x : DecimalLexeme := {
    leadingSign := none
    integerDigits := [0]
    fractionDigits := some (List.replicate 11 0 ++
      [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0] ++
      List.replicate 2147483618 0)
    exponent := none
  }
  have hsVal : s.val = [48#u8, 46#u8] ++ List.replicate 11 48#u8 ++
      [49#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
        48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
        48#u8, 48#u8, 48#u8, 56#u8, 48#u8] ++
      List.replicate 2147483618 48#u8 := by
    simp only [s]
    rw [hbody, hfirst]
    simp only [List.append_assoc]
  have hsLen : s.val.length = 2147483650 := by
    simpa only [s] using hbodyLen
  have hsource : DecimalGoalVocabularyDefault.sourceString s := by
    as_aux_lemma =>
      have byteArray_toList_eq_data (b : ByteArray) :
          b.toList = b.data.toList := by
        have aux (i : Nat) (r : List UInt8) (hi : i ≤ b.size) :
            ByteArray.toList.loop b i r =
              r.reverse ++ b.data.toList.drop i := by
          fun_induction ByteArray.toList.loop b i r with
          | case1 i r h ih =>
              rw [ih (by omega)]
              simp only [List.reverse_cons, List.append_assoc,
                List.singleton_append]
              have hlen : i < b.data.toList.length := by simpa using h
              rw [List.drop_eq_getElem_cons hlen]
              congr
              cases b
              rename_i data
              exact getElem!_pos data i (by simpa using h)
          | case2 i r h =>
              have hieq : i = b.size := by omega
              simp [hieq]
        unfold ByteArray.toList
        simpa using aux 0 [] (Nat.zero_le _)
      have utf8_ofList (l : List Char) :
          (String.ofList l).toUTF8.toList =
            l.flatMap String.utf8EncodeChar := by
        rw [String.toUTF8, String.toByteArray_ofList]
        rw [byteArray_toList_eq_data]
        simp only [List.utf8Encode, List.toList_data_toByteArray]
      have utf8_zeros (n : Nat) :
          (List.replicate n '0').flatMap String.utf8EncodeChar =
            List.replicate n (48 : UInt8) := by
        rw [List.flatMap_replicate]
        have h : String.utf8EncodeChar '0' = [(48 : UInt8)] := by decide
        rw [h, List.flatten_replicate_singleton]
      dsimp only [DecimalGoalVocabularyDefault]
      constructor
      · rw [hsLen]
        norm_num
      · refine ⟨String.ofList
            (['0', '.'] ++ List.replicate 11 '0' ++
              ['1', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                '0', '0', '0', '0', '0', '0', '0', '8', '0'] ++
              List.replicate 2147483618 '0'), ?_⟩
        rw [hsVal, utf8_ofList]
        simp only [List.flatMap_append, utf8_zeros, List.flatMap_cons,
          List.flatMap_nil, List.map_append, List.map_replicate,
          List.map_cons, List.map_nil]
        have h0 : (String.utf8EncodeChar '0').map UInt8.toNat = [48] := by
          decide
        have h1 : (String.utf8EncodeChar '1').map UInt8.toNat = [49] := by
          decide
        have h8 : (String.utf8EncodeChar '8').map UInt8.toNat = [56] := by
          decide
        have hpoint : (String.utf8EncodeChar '.').map UInt8.toNat = [46] := by
          decide
        rw [h0, h1, h8, hpoint]
        have u48 : (48#u8 : Std.U8).val = 48 := by decide
        have u46 : (46#u8 : Std.U8).val = 46 := by decide
        have u49 : (49#u8 : Std.U8).val = 49 := by decide
        have u56 : (56#u8 : Std.U8).val = 56 := by decide
        have ui48 : UInt8.toNat (48 : UInt8) = 48 := by decide
        rw [u48, u46, u49, u56, ui48]
        simp only [List.singleton_append, List.append_nil, List.append_assoc]
  have hvalid : DecimalGoalVocabularyDefault.validNumeric x := by
    as_aux_lemma =>
      dsimp only [DecimalGoalVocabularyDefault]
      constructor
      · intro digit hdigit
        simp only [x] at hdigit
        simp at hdigit
        omega
      constructor
      · intro digit hdigit
        rcases List.mem_append.mp hdigit with hdigit | hdigit
        · rcases List.mem_append.mp hdigit with hdigit | hdigit
          · have hz : digit = 0 := (List.mem_replicate.mp hdigit).2
            omega
          · simp at hdigit
            omega
        · have hz : digit = 0 := (List.mem_replicate.mp hdigit).2
          omega
      constructor
      · left
        simp only [x]
        exact List.cons_ne_nil _ _
      · trivial
  have hrenders : DecimalGoalVocabularyDefault.bytes s =
      DecimalGoalVocabularyDefault.renderNumeric x := by
    as_aux_lemma =>
      rw [show DecimalGoalVocabularyDefault.bytes s =
          ([48#u8, 46#u8] ++ List.replicate 11 48#u8 ++
            [49#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
              48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
              48#u8, 48#u8, 48#u8, 56#u8, 48#u8] ++
            List.replicate 2147483618 48#u8).map
              (fun b : Std.U8 => b.val) by
          dsimp only [DecimalGoalVocabularyDefault]
          rw [hsVal]]
      rw [List.map_append, List.map_append, List.map_append,
        List.map_replicate]
      have hprefix : [48#u8, 46#u8].map (fun b : Std.U8 => b.val) =
          [48, 46] := by decide
      have hfixed :
          [49#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
            48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
            48#u8, 48#u8, 48#u8, 56#u8, 48#u8].map
              (fun b : Std.U8 => b.val) =
          [49, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
            48, 48, 48, 56, 48] := by decide
      have hu48 : (48#u8 : Std.U8).val = 48 := by decide
      rw [List.map_replicate, hprefix, hfixed, hu48]
      rw [show DecimalGoalVocabularyDefault.renderNumeric x =
          [48, 46] ++ List.replicate 11 48 ++
            [49, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
              48, 48, 48, 56, 48] ++ List.replicate 2147483618 48 by
          simp only [x]
          dsimp only [DecimalGoalVocabularyDefault]
          rw [List.map_append, List.map_append, List.map_replicate,
            List.map_replicate]
          simp only [List.nil_append, List.cons_append, List.append_nil]
          norm_num]
  subst d
  have hpublic : num.imp.dec2flt.dec2flt
      F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
      F64.Insts.CoreOpsArithDivF64F64
      F64.Insts.CoreOpsArithMulF64F64
      F64.Insts.CoreOpsArithNegF64 s = fail integerOverflow := by
    have hcompact : s.val = 48#u8 :: 46#u8 :: first.val := by
      simp only [s]
      rw [hbody]
      rfl
    have hadd : (1000000000000000080#u64 + 1#u64) =
        ok 1000000000000000081#u64 := by
      rfl
    simp [s, num.imp.dec2flt.dec2flt,
      num.imp.dec2flt.dec2flt_with_trace, core.str.Str.as_bytes,
      core.slice.Slice.first, ModelStrAsBytes, ModelSliceFirst, hcompact,
      hparse, hfast, hcompute0, hadd, hcompute1, heq, hslow]
  exact ⟨s, x, hsVal, hsLen, rfl, hsource, hvalid, hrenders, hpublic⟩

Download Lean source · Download TeX source

Complete Lean module
import Tablet.DecimalGoalVocabularyDefault
import Tablet.F64_Insts_CoreOpsArithDivF64F64
import Tablet.F64_Insts_CoreOpsArithMulF64F64
import Tablet.F64_Insts_CoreOpsArithNegF64
import Tablet.F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64
import Tablet.ModelSliceFirst
import Tablet.ModelStrAsBytes
import Tablet.ParserNumericSlowPathOverflowWitness
import Tablet.num_imp_dec2flt_dec2flt
import Tablet.num_imp_dec2flt_dec2flt_with_trace

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxRecDepth 10000

namespace dec2flt_model

-- [TABLET NODE: ParserNumericPublicOverflowWitness]
theorem ParserNumericPublicOverflowWitness :
    exists (s : Str) (x : DecimalLexeme),
      s.val = [48#u8, 46#u8] ++ List.replicate 11 48#u8 ++
        [49#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
          48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
          48#u8, 48#u8, 48#u8, 56#u8, 48#u8] ++
        List.replicate 2147483618 48#u8 /\
      s.val.length = 2147483650 /\
      x = {
        leadingSign := none
        integerDigits := [0]
        fractionDigits := some (List.replicate 11 0 ++
          [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0] ++
          List.replicate 2147483618 0)
        exponent := none
      } /\
      DecimalGoalVocabularyDefault.sourceString s /\
      DecimalGoalVocabularyDefault.validNumeric x /\
      DecimalGoalVocabularyDefault.bytes s =
        DecimalGoalVocabularyDefault.renderNumeric x /\
      num.imp.dec2flt.dec2flt
        F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
        F64.Insts.CoreOpsArithDivF64F64
        F64.Insts.CoreOpsArithMulF64F64
        F64.Insts.CoreOpsArithNegF64 s = fail integerOverflow := by
-- BODY
  obtain ⟨body, first, remainder, d, hfirst, hbody, hremainder,
    hbodyLen, hfirstLen, hremainderLen, hparse, hd, hfast,
    hcompute0, hcompute1, hne, heq, hcast, hsub, hdecimal, hslow⟩ :=
    ParserNumericSlowPathOverflowWitness
  let s : Str := body
  let x : DecimalLexeme := {
    leadingSign := none
    integerDigits := [0]
    fractionDigits := some (List.replicate 11 0 ++
      [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0] ++
      List.replicate 2147483618 0)
    exponent := none
  }
  have hsVal : s.val = [48#u8, 46#u8] ++ List.replicate 11 48#u8 ++
      [49#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
        48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
        48#u8, 48#u8, 48#u8, 56#u8, 48#u8] ++
      List.replicate 2147483618 48#u8 := by
    simp only [s]
    rw [hbody, hfirst]
    simp only [List.append_assoc]
  have hsLen : s.val.length = 2147483650 := by
    simpa only [s] using hbodyLen
  have hsource : DecimalGoalVocabularyDefault.sourceString s := by
    as_aux_lemma =>
      have byteArray_toList_eq_data (b : ByteArray) :
          b.toList = b.data.toList := by
        have aux (i : Nat) (r : List UInt8) (hi : i ≤ b.size) :
            ByteArray.toList.loop b i r =
              r.reverse ++ b.data.toList.drop i := by
          fun_induction ByteArray.toList.loop b i r with
          | case1 i r h ih =>
              rw [ih (by omega)]
              simp only [List.reverse_cons, List.append_assoc,
                List.singleton_append]
              have hlen : i < b.data.toList.length := by simpa using h
              rw [List.drop_eq_getElem_cons hlen]
              congr
              cases b
              rename_i data
              exact getElem!_pos data i (by simpa using h)
          | case2 i r h =>
              have hieq : i = b.size := by omega
              simp [hieq]
        unfold ByteArray.toList
        simpa using aux 0 [] (Nat.zero_le _)
      have utf8_ofList (l : List Char) :
          (String.ofList l).toUTF8.toList =
            l.flatMap String.utf8EncodeChar := by
        rw [String.toUTF8, String.toByteArray_ofList]
        rw [byteArray_toList_eq_data]
        simp only [List.utf8Encode, List.toList_data_toByteArray]
      have utf8_zeros (n : Nat) :
          (List.replicate n '0').flatMap String.utf8EncodeChar =
            List.replicate n (48 : UInt8) := by
        rw [List.flatMap_replicate]
        have h : String.utf8EncodeChar '0' = [(48 : UInt8)] := by decide
        rw [h, List.flatten_replicate_singleton]
      dsimp only [DecimalGoalVocabularyDefault]
      constructor
      · rw [hsLen]
        norm_num
      · refine ⟨String.ofList
            (['0', '.'] ++ List.replicate 11 '0' ++
              ['1', '0', '0', '0', '0', '0', '0', '0', '0', '0',
                '0', '0', '0', '0', '0', '0', '0', '8', '0'] ++
              List.replicate 2147483618 '0'), ?_⟩
        rw [hsVal, utf8_ofList]
        simp only [List.flatMap_append, utf8_zeros, List.flatMap_cons,
          List.flatMap_nil, List.map_append, List.map_replicate,
          List.map_cons, List.map_nil]
        have h0 : (String.utf8EncodeChar '0').map UInt8.toNat = [48] := by
          decide
        have h1 : (String.utf8EncodeChar '1').map UInt8.toNat = [49] := by
          decide
        have h8 : (String.utf8EncodeChar '8').map UInt8.toNat = [56] := by
          decide
        have hpoint : (String.utf8EncodeChar '.').map UInt8.toNat = [46] := by
          decide
        rw [h0, h1, h8, hpoint]
        have u48 : (48#u8 : Std.U8).val = 48 := by decide
        have u46 : (46#u8 : Std.U8).val = 46 := by decide
        have u49 : (49#u8 : Std.U8).val = 49 := by decide
        have u56 : (56#u8 : Std.U8).val = 56 := by decide
        have ui48 : UInt8.toNat (48 : UInt8) = 48 := by decide
        rw [u48, u46, u49, u56, ui48]
        simp only [List.singleton_append, List.append_nil, List.append_assoc]
  have hvalid : DecimalGoalVocabularyDefault.validNumeric x := by
    as_aux_lemma =>
      dsimp only [DecimalGoalVocabularyDefault]
      constructor
      · intro digit hdigit
        simp only [x] at hdigit
        simp at hdigit
        omega
      constructor
      · intro digit hdigit
        rcases List.mem_append.mp hdigit with hdigit | hdigit
        · rcases List.mem_append.mp hdigit with hdigit | hdigit
          · have hz : digit = 0 := (List.mem_replicate.mp hdigit).2
            omega
          · simp at hdigit
            omega
        · have hz : digit = 0 := (List.mem_replicate.mp hdigit).2
          omega
      constructor
      · left
        simp only [x]
        exact List.cons_ne_nil _ _
      · trivial
  have hrenders : DecimalGoalVocabularyDefault.bytes s =
      DecimalGoalVocabularyDefault.renderNumeric x := by
    as_aux_lemma =>
      rw [show DecimalGoalVocabularyDefault.bytes s =
          ([48#u8, 46#u8] ++ List.replicate 11 48#u8 ++
            [49#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
              48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
              48#u8, 48#u8, 48#u8, 56#u8, 48#u8] ++
            List.replicate 2147483618 48#u8).map
              (fun b : Std.U8 => b.val) by
          dsimp only [DecimalGoalVocabularyDefault]
          rw [hsVal]]
      rw [List.map_append, List.map_append, List.map_append,
        List.map_replicate]
      have hprefix : [48#u8, 46#u8].map (fun b : Std.U8 => b.val) =
          [48, 46] := by decide
      have hfixed :
          [49#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
            48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8, 48#u8,
            48#u8, 48#u8, 48#u8, 56#u8, 48#u8].map
              (fun b : Std.U8 => b.val) =
          [49, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
            48, 48, 48, 56, 48] := by decide
      have hu48 : (48#u8 : Std.U8).val = 48 := by decide
      rw [List.map_replicate, hprefix, hfixed, hu48]
      rw [show DecimalGoalVocabularyDefault.renderNumeric x =
          [48, 46] ++ List.replicate 11 48 ++
            [49, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
              48, 48, 48, 56, 48] ++ List.replicate 2147483618 48 by
          simp only [x]
          dsimp only [DecimalGoalVocabularyDefault]
          rw [List.map_append, List.map_append, List.map_replicate,
            List.map_replicate]
          simp only [List.nil_append, List.cons_append, List.append_nil]
          norm_num]
  subst d
  have hpublic : num.imp.dec2flt.dec2flt
      F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
      F64.Insts.CoreOpsArithDivF64F64
      F64.Insts.CoreOpsArithMulF64F64
      F64.Insts.CoreOpsArithNegF64 s = fail integerOverflow := by
    have hcompact : s.val = 48#u8 :: 46#u8 :: first.val := by
      simp only [s]
      rw [hbody]
      rfl
    have hadd : (1000000000000000080#u64 + 1#u64) =
        ok 1000000000000000081#u64 := by
      rfl
    simp [s, num.imp.dec2flt.dec2flt,
      num.imp.dec2flt.dec2flt_with_trace, core.str.Str.as_bytes,
      core.slice.Slice.first, ModelStrAsBytes, ModelSliceFirst, hcompact,
      hparse, hfast, hcompute0, hadd, hcompute1, heq, hslow]
  exact ⟨s, x, hsVal, hsLen, rfl, hsource, hvalid, hrenders, hpublic⟩

Proof structure

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

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 175 entries
Technical checking records
Local closure summary
{
  "node": "ParserNumericPublicOverflowWitness",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "e713a93b4de265cb9d9f0e487c51c66e20175754ce20878a7d97980bd3213439",
  "active_statement_hash": "366c40e81bdaffc6a976682de80c09f1e2155c24b52777283a3da68dcdff0526",
  "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-127",
  "boundary_theorems": {},
  "strict_theorem_deps": {
    "ParserNumericSlowPathOverflowWitness": "bb78a45fa5798f9c",
    "num_imp_dec2flt_dec2flt_with_trace": "8f54814ba9c190ea",
    "num_imp_traits_Float_SIG_BITS_default": "9ab622d85ef04d94"
  },
  "strict_definition_deps": {
    "DecimalGoalVocabulary": "c08dd4b4aea4abb4",
    "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_modelNumImpTraitsFloatExtU64": "60afe26c6a80cf0f",
    "F64_Insts_Dec2flt_modelNumImpTraitsFloatU64": "94095c9bf79da164",
    "F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SIG_TOTAL_BITS": "887b52d84a3fc9c4",
    "ModelSliceFirst": "a31394b3c1080f71",
    "ModelStrAsBytes": "024fe35b4dbfa9a3",
    "Preamble": "7a79218b23bce03e",
    "core_ops_arith_Div": "6e5df64b87169aa0",
    "core_ops_arith_Mul": "6e5df64b87169aa0",
    "core_ops_arith_Neg": "0ff07135a60bcbf9",
    "num_float_parse_ParseFloatError": "c43614ff2149ecf2",
    "num_imp_dec2flt_Dec2FltAssemblyTrace": "7bda5de02611ad76",
    "num_imp_dec2flt_Dec2FltTrace": "8fa376ebb5c489ee",
    "num_imp_dec2flt_Lemire": "1923f90c53d323e6",
    "num_imp_dec2flt_biased_fp_to_float": "acdde060e8d35ca7",
    "num_imp_dec2flt_common_BiasedFp": "31d81cf1cf22709f",
    "num_imp_dec2flt_common_BiasedFp_Insts_CoreCmpPartialEqBiasedFp_eq": "fbbf553e3c502a05",
    "num_imp_dec2flt_dec2flt": "f9f7d93449a25efa",
    "num_imp_dec2flt_dec2flt_with_trace": "5665189e0304a27e",
    "num_imp_dec2flt_decimal_Decimal": "63fd2f021dd0ef41",
    "num_imp_dec2flt_decimal_Decimal_try_fast_path": "2e4888f65a06b49f",
    "num_imp_dec2flt_decimal_seq_DecimalSeq": "c43614ff2149ecf2",
    "num_imp_dec2flt_decimal_seq_parse_decimal_seq": "244cf8318357caab",
    "num_imp_dec2flt_lemire_compute_float": "39d89e3f0a8a9d4c",
    "num_imp_dec2flt_parse_parse_inf_nan": "85655c19a8791b54",
    "num_imp_dec2flt_parse_parse_number": "f73f8bc11faa6db3",
    "num_imp_dec2flt_pfe_empty": "89046d1da5ac1ce2",
    "num_imp_dec2flt_pfe_invalid": "21db875427d92c6d",
    "num_imp_dec2flt_slow_parse_long_mantissa": "cd8af64c3688b60f",
    "num_imp_traits_Float": "02acccb9db3e30f2",
    "num_imp_traits_FloatExt": "f996e5400649797d"
  }
}
Prose assessment
{
  "label": "Recorded Sound: VerifierPass",
  "assessment_status": "VerifierPass",
  "fingerprint_relation": "matches current fingerprint",
  "assessment_fingerprint": "sound-v2:0fcd0df93fcfa74d83b5e5579d837900a24471f75c6885cc14125bd2e58974bf",
  "current_fingerprint": "sound-v2:0fcd0df93fcfa74d83b5e5579d837900a24471f75c6885cc14125bd2e58974bf",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "sound_status": "Pass",
  "substantiveness_status": "Pass"
}