ParserExactRoundingWitness

Lean checked

Statement

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

Theorem · Concrete failure of exact rounding

There are a model string s, a decimal lexeme x, and a binary64 value f with the following concrete values and properties. The bytes of s are the ASCII encoding of
0.\underbrace{00\cdots0}_{65535\text{ zeros}}1e655360.
The lexeme x has no sign, integer digits [0], fractional digits consisting of 65535 zeros followed by 1, and the unsigned decimal exponent 655360. The value f has binary64 word 4607182418800017408, namely the word for 1.0. The string is a source string, the lexeme is valid, rendering the lexeme gives exactly the bytes of s, and the extracted public parser returns f successfully on s. Nevertheless, there is no binary64 magnitude which both rounds the exact magnitude of x according to roundsMagnitude and acquires the lexical sign of x to yield f.

Lean statement

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

import Tablet.Binary64ModelDefault
import Tablet.DecimalGoalVocabularyDefault
import Tablet.ParserExactRoundingExecution

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

namespace dec2flt_model

-- [TABLET NODE: ParserExactRoundingWitness]
theorem ParserExactRoundingWitness :
    exists (s : Str) (x : DecimalLexeme) (f : F64),
      s.val = [48#u8, 46#u8] ++ List.replicate 65535 48#u8 ++
        [49#u8, 101#u8, 54#u8, 53#u8, 53#u8, 51#u8, 54#u8, 48#u8] /\
      x = {
        leadingSign := none
        integerDigits := [0]
        fractionDigits := some (List.replicate 65535 0 ++ [1])
        exponent := some (false, none, [6, 5, 5, 3, 6, 0])
      } /\
      f = (⟨BitVec.ofNat 64 4607182418800017408⟩ : F64) /\
      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 =
        ok (core.result.Result.Ok f) /\
      Not (exists magnitude : F64,
        DecimalGoalVocabularyDefault.roundsMagnitude
            (DecimalGoalVocabularyDefault.exactMagnitude x) magnitude /\
          DecimalGoalVocabularyDefault.signedMagnitude
            (DecimalGoalVocabularyDefault.lexicalNegative x) 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

Let s, x, and f have the concrete values in the statement. Their byte, lexeme, and word equalities are definitional. The byte list has length 65545, hence satisfies the model string bound. Encode the displayed ASCII string character by character. ASCII 0', .', 1', e', 6', 5', and `3' encode respectively to bytes 48,46,49,101,54,53,51; mapping the repeated zero characters therefore gives precisely the symbolic repeated-byte segment. This supplies the string required by sourceString in DecimalGoalVocabularyDefault.
Every integer and fractional digit lies below ten, the integer part is nonempty, and the exponent digit list is nonempty, so x satisfies validNumeric. Expanding renderNumeric and the ASCII digit encoding yields the stated bytes. The parser execution is exactly ParserExactRoundingExecution: its hypothesis is the concrete byte equality already established, and its conclusion is the required successful return of the word for 1.0.
It remains to show that the contract conclusion is false. Folding the 65535 fractional zeros leaves zero, appending the final digit gives significand 1, and the fractional length is 65536. Thus exactMagnitude from DecimalGoalVocabularyDefault is 10^{655360-65536}=10^{589824}.
Suppose some binary64 magnitude rounded that real and then, with the positive lexical sign, yielded f. By Binary64ModelDefault, every finite binary64 value represented by a word other than positive infinity denotes a real strictly below 2^{1024}-2^{970}. But
2^{1024}-2^{970}\le 2^{1024}\le 10^{1024}\le 10^{589824}.
Consequently the strict upper condition in roundsMagnitude rules out every non-infinity word, so the magnitude word must be the positive-infinity word 2047\cdot2^{52}. Since x is nonnegative, signedMagnitude would then require that word to equal the word of f, namely 4607182418800017408. Direct arithmetic shows these words are unequal. This contradiction proves the final negation and hence all clauses of the witness theorem.

Lean proof


  let zeros : List Nat := List.replicate 65535 0
  let fraction : List Nat := zeros ++ [1]
  let lexeme : DecimalLexeme := {
    leadingSign := none
    integerDigits := [0]
    fractionDigits := some fraction
    exponent := some (false, none, [6, 5, 5, 3, 6, 0])
  }
  let witnessBytes : List Std.U8 :=
    [48#u8, 46#u8] ++ List.replicate 65535 48#u8 ++
      [49#u8, 101#u8, 54#u8, 53#u8, 53#u8, 51#u8, 54#u8, 48#u8]
  have witnessBytes_length : witnessBytes.length = 65545 := by
    simp only [witnessBytes, List.length_append, List.length_replicate,
      List.length_cons, List.length_nil]
  let witness : Str :=
    ⟨witnessBytes, by
      rw [witnessBytes_length]
      rcases Usize.bounds_eq with q | q <;>
        norm_num [q, U32.max_eq, U64.max_eq]⟩
  let one : F64 := ⟨BitVec.ofNat 64 4607182418800017408⟩
  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 _)
  let witnessString : String :=
    String.ofList (['0', '.'] ++ List.replicate 65535 '0' ++
      ['1', 'e', '6', '5', '5', '3', '6', '0'])
  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]
  have witness_source : DecimalGoalVocabularyDefault.sourceString witness := by
    dsimp only [DecimalGoalVocabularyDefault]
    constructor
    · change witnessBytes.length ≤ 9223372036854775807
      rw [witnessBytes_length]
      norm_num
    · refine ⟨witnessString, ?_⟩
      simp only [witnessString]
      rw [utf8_ofList]
      simp only [witness, witnessBytes, 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 hd : (String.utf8EncodeChar '.').map UInt8.toNat = [46] := by decide
      have h1 : (String.utf8EncodeChar '1').map UInt8.toNat = [49] := by decide
      have he : (String.utf8EncodeChar 'e').map UInt8.toNat = [101] := by decide
      have h6 : (String.utf8EncodeChar '6').map UInt8.toNat = [54] := by decide
      have h5 : (String.utf8EncodeChar '5').map UInt8.toNat = [53] := by decide
      have h3 : (String.utf8EncodeChar '3').map UInt8.toNat = [51] := by decide
      rw [h0, hd, h1, he, h6, h5, h3]
      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 u101 : (101#u8 : Std.U8).val = 101 := by decide
      have u54 : (54#u8 : Std.U8).val = 54 := by decide
      have u53 : (53#u8 : Std.U8).val = 53 := by decide
      have u51 : (51#u8 : Std.U8).val = 51 := by decide
      have ui48 : UInt8.toNat (48 : UInt8) = 48 := by decide
      rw [u48, u46, u49, u101, u54, u53, u51, ui48]
      rfl
  have zeros_fold :
      zeros.foldl (fun a d => 10 * a + d) 0 = 0 := by
    have fold_zeros (k : Nat) :
        (List.replicate k 0).foldl (fun a d => 10 * a + d) 0 = 0 := by
      induction k with
      | zero => rfl
      | succ k ih => simpa [List.replicate_succ] using ih
    exact fold_zeros 65535
  have fraction_length : fraction.length = 65536 := by
    simp only [fraction, zeros, List.length_append, List.length_replicate,
      List.length_cons, List.length_nil]
  have significand_fold :
      ([0] ++ fraction).foldl (fun a d => 10 * a + d) 0 = 1 := by
    rw [List.foldl_append]
    simp only [List.foldl_cons, List.foldl_nil, mul_zero, zero_add]
    simp only [fraction]
    rw [List.foldl_append, zeros_fold]
    rfl
  have lexeme_valid : DecimalGoalVocabularyDefault.validNumeric lexeme := by
    have zeros_mem {d : Nat} (h : d ∈ zeros) : d = 0 := by
      simp only [zeros, List.mem_replicate] at h
      exact h.2
    dsimp only [DecimalGoalVocabularyDefault]
    constructor
    · simp [lexeme]
    constructor
    · simp only [lexeme]
      intro d hd
      simp only [fraction] at hd
      rcases List.mem_append.mp hd with hd | hd
      · rw [zeros_mem hd]
        norm_num
      · simp only [List.mem_singleton] at hd
        omega
    constructor
    · left
      simp [lexeme]
    · simp [lexeme]
  have lexeme_render :
      DecimalGoalVocabularyDefault.bytes witness =
        DecimalGoalVocabularyDefault.renderNumeric lexeme := by
    dsimp only [DecimalGoalVocabularyDefault]
    simp only [lexeme, witness, witnessBytes, fraction, zeros, List.map_append,
      List.map_cons, List.map_nil, List.map_replicate, Bool.false_eq_true,
      reduceIte, Nat.reduceAdd, List.nil_append, List.cons_append]
    norm_num
  have lexeme_exact :
      DecimalGoalVocabularyDefault.exactMagnitude lexeme =
        (10 : Real) ^ (589824 : Nat) := by
    dsimp only [DecimalGoalVocabularyDefault, lexeme]
    rw [significand_fold, fraction_length]
    norm_num
    rfl
  let infinityBits : Nat := 2047 * 2 ^ 52
  have huge_target_is_infinity (w : F64)
      (hw : DecimalGoalVocabularyDefault.roundsMagnitude
        ((10 : Real) ^ (589824 : Nat)) w) :
      w.val = infinityBits := by
    dsimp only [DecimalGoalVocabularyDefault] at hw
    rcases hw with ⟨_, _, hw⟩
    by_contra hne
    have hne' : w.val ≠ 2047 * 2 ^ 52 := by
      simpa [infinityBits] using hne
    rw [if_neg hne'] at hw
    have hthreshold :
        ((2 : Real) ^ (1024 : Nat)) - ((2 : Real) ^ (970 : Nat)) ≤
          (10 : Real) ^ (589824 : Nat) := by
      calc
        (2 : Real) ^ 1024 - 2 ^ 970 ≤ 2 ^ 1024 :=
          sub_le_self _ (by positivity)
        _ ≤ 10 ^ 1024 := by gcongr <;> norm_num
        _ ≤ 10 ^ 589824 := by
          rw [show (589824 : Nat) = 1024 + 588800 by norm_num, pow_add]
          exact le_mul_of_one_le_right (by positivity) (one_le_pow₀ (by norm_num))
    exact (not_lt_of_ge hthreshold) hw.1
  have hRun :
      num.imp.dec2flt.dec2flt F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
        F64.Insts.CoreOpsArithDivF64F64 F64.Insts.CoreOpsArithMulF64F64
        F64.Insts.CoreOpsArithNegF64 witness =
          ok (core.result.Result.Ok one) := by
    exact ParserExactRoundingExecution witness (by rfl)
  refine ⟨witness, lexeme, one, ?_, ?_, rfl, witness_source, lexeme_valid,
    lexeme_render, hRun, ?_⟩
  · rfl
  · rfl
  · rintro ⟨magnitude, hround, hsigned⟩
    rw [lexeme_exact] at hround
    have hinf := huge_target_is_infinity magnitude hround
    dsimp only [DecimalGoalVocabularyDefault, lexeme, one] at hsigned
    rw [hinf] at hsigned
    have bad := hsigned.2
    change (4607182418800017408 : Nat) = infinityBits + 0 at bad
    norm_num [infinityBits] at bad

Download Lean source · Download TeX source

Complete Lean module
import Tablet.Binary64ModelDefault
import Tablet.DecimalGoalVocabularyDefault
import Tablet.ParserExactRoundingExecution

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

namespace dec2flt_model

-- [TABLET NODE: ParserExactRoundingWitness]
theorem ParserExactRoundingWitness :
    exists (s : Str) (x : DecimalLexeme) (f : F64),
      s.val = [48#u8, 46#u8] ++ List.replicate 65535 48#u8 ++
        [49#u8, 101#u8, 54#u8, 53#u8, 53#u8, 51#u8, 54#u8, 48#u8] /\
      x = {
        leadingSign := none
        integerDigits := [0]
        fractionDigits := some (List.replicate 65535 0 ++ [1])
        exponent := some (false, none, [6, 5, 5, 3, 6, 0])
      } /\
      f = (⟨BitVec.ofNat 64 4607182418800017408⟩ : F64) /\
      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 =
        ok (core.result.Result.Ok f) /\
      Not (exists magnitude : F64,
        DecimalGoalVocabularyDefault.roundsMagnitude
            (DecimalGoalVocabularyDefault.exactMagnitude x) magnitude /\
          DecimalGoalVocabularyDefault.signedMagnitude
            (DecimalGoalVocabularyDefault.lexicalNegative x) magnitude f) := by
-- BODY
  let zeros : List Nat := List.replicate 65535 0
  let fraction : List Nat := zeros ++ [1]
  let lexeme : DecimalLexeme := {
    leadingSign := none
    integerDigits := [0]
    fractionDigits := some fraction
    exponent := some (false, none, [6, 5, 5, 3, 6, 0])
  }
  let witnessBytes : List Std.U8 :=
    [48#u8, 46#u8] ++ List.replicate 65535 48#u8 ++
      [49#u8, 101#u8, 54#u8, 53#u8, 53#u8, 51#u8, 54#u8, 48#u8]
  have witnessBytes_length : witnessBytes.length = 65545 := by
    simp only [witnessBytes, List.length_append, List.length_replicate,
      List.length_cons, List.length_nil]
  let witness : Str :=
    ⟨witnessBytes, by
      rw [witnessBytes_length]
      rcases Usize.bounds_eq with q | q <;>
        norm_num [q, U32.max_eq, U64.max_eq]⟩
  let one : F64 := ⟨BitVec.ofNat 64 4607182418800017408⟩
  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 _)
  let witnessString : String :=
    String.ofList (['0', '.'] ++ List.replicate 65535 '0' ++
      ['1', 'e', '6', '5', '5', '3', '6', '0'])
  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]
  have witness_source : DecimalGoalVocabularyDefault.sourceString witness := by
    dsimp only [DecimalGoalVocabularyDefault]
    constructor
    · change witnessBytes.length ≤ 9223372036854775807
      rw [witnessBytes_length]
      norm_num
    · refine ⟨witnessString, ?_⟩
      simp only [witnessString]
      rw [utf8_ofList]
      simp only [witness, witnessBytes, 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 hd : (String.utf8EncodeChar '.').map UInt8.toNat = [46] := by decide
      have h1 : (String.utf8EncodeChar '1').map UInt8.toNat = [49] := by decide
      have he : (String.utf8EncodeChar 'e').map UInt8.toNat = [101] := by decide
      have h6 : (String.utf8EncodeChar '6').map UInt8.toNat = [54] := by decide
      have h5 : (String.utf8EncodeChar '5').map UInt8.toNat = [53] := by decide
      have h3 : (String.utf8EncodeChar '3').map UInt8.toNat = [51] := by decide
      rw [h0, hd, h1, he, h6, h5, h3]
      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 u101 : (101#u8 : Std.U8).val = 101 := by decide
      have u54 : (54#u8 : Std.U8).val = 54 := by decide
      have u53 : (53#u8 : Std.U8).val = 53 := by decide
      have u51 : (51#u8 : Std.U8).val = 51 := by decide
      have ui48 : UInt8.toNat (48 : UInt8) = 48 := by decide
      rw [u48, u46, u49, u101, u54, u53, u51, ui48]
      rfl
  have zeros_fold :
      zeros.foldl (fun a d => 10 * a + d) 0 = 0 := by
    have fold_zeros (k : Nat) :
        (List.replicate k 0).foldl (fun a d => 10 * a + d) 0 = 0 := by
      induction k with
      | zero => rfl
      | succ k ih => simpa [List.replicate_succ] using ih
    exact fold_zeros 65535
  have fraction_length : fraction.length = 65536 := by
    simp only [fraction, zeros, List.length_append, List.length_replicate,
      List.length_cons, List.length_nil]
  have significand_fold :
      ([0] ++ fraction).foldl (fun a d => 10 * a + d) 0 = 1 := by
    rw [List.foldl_append]
    simp only [List.foldl_cons, List.foldl_nil, mul_zero, zero_add]
    simp only [fraction]
    rw [List.foldl_append, zeros_fold]
    rfl
  have lexeme_valid : DecimalGoalVocabularyDefault.validNumeric lexeme := by
    have zeros_mem {d : Nat} (h : d ∈ zeros) : d = 0 := by
      simp only [zeros, List.mem_replicate] at h
      exact h.2
    dsimp only [DecimalGoalVocabularyDefault]
    constructor
    · simp [lexeme]
    constructor
    · simp only [lexeme]
      intro d hd
      simp only [fraction] at hd
      rcases List.mem_append.mp hd with hd | hd
      · rw [zeros_mem hd]
        norm_num
      · simp only [List.mem_singleton] at hd
        omega
    constructor
    · left
      simp [lexeme]
    · simp [lexeme]
  have lexeme_render :
      DecimalGoalVocabularyDefault.bytes witness =
        DecimalGoalVocabularyDefault.renderNumeric lexeme := by
    dsimp only [DecimalGoalVocabularyDefault]
    simp only [lexeme, witness, witnessBytes, fraction, zeros, List.map_append,
      List.map_cons, List.map_nil, List.map_replicate, Bool.false_eq_true,
      reduceIte, Nat.reduceAdd, List.nil_append, List.cons_append]
    norm_num
  have lexeme_exact :
      DecimalGoalVocabularyDefault.exactMagnitude lexeme =
        (10 : Real) ^ (589824 : Nat) := by
    dsimp only [DecimalGoalVocabularyDefault, lexeme]
    rw [significand_fold, fraction_length]
    norm_num
    rfl
  let infinityBits : Nat := 2047 * 2 ^ 52
  have huge_target_is_infinity (w : F64)
      (hw : DecimalGoalVocabularyDefault.roundsMagnitude
        ((10 : Real) ^ (589824 : Nat)) w) :
      w.val = infinityBits := by
    dsimp only [DecimalGoalVocabularyDefault] at hw
    rcases hw with ⟨_, _, hw⟩
    by_contra hne
    have hne' : w.val ≠ 2047 * 2 ^ 52 := by
      simpa [infinityBits] using hne
    rw [if_neg hne'] at hw
    have hthreshold :
        ((2 : Real) ^ (1024 : Nat)) - ((2 : Real) ^ (970 : Nat)) ≤
          (10 : Real) ^ (589824 : Nat) := by
      calc
        (2 : Real) ^ 1024 - 2 ^ 970 ≤ 2 ^ 1024 :=
          sub_le_self _ (by positivity)
        _ ≤ 10 ^ 1024 := by gcongr <;> norm_num
        _ ≤ 10 ^ 589824 := by
          rw [show (589824 : Nat) = 1024 + 588800 by norm_num, pow_add]
          exact le_mul_of_one_le_right (by positivity) (one_le_pow₀ (by norm_num))
    exact (not_lt_of_ge hthreshold) hw.1
  have hRun :
      num.imp.dec2flt.dec2flt F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
        F64.Insts.CoreOpsArithDivF64F64 F64.Insts.CoreOpsArithMulF64F64
        F64.Insts.CoreOpsArithNegF64 witness =
          ok (core.result.Result.Ok one) := by
    exact ParserExactRoundingExecution witness (by rfl)
  refine ⟨witness, lexeme, one, ?_, ?_, rfl, witness_source, lexeme_valid,
    lexeme_render, hRun, ?_⟩
  · rfl
  · rfl
  · rintro ⟨magnitude, hround, hsigned⟩
    rw [lexeme_exact] at hround
    have hinf := huge_target_is_infinity magnitude hround
    dsimp only [DecimalGoalVocabularyDefault, lexeme, one] at hsigned
    rw [hinf] at hsigned
    have bad := hsigned.2
    change (4607182418800017408 : Nat) = infinityBits + 0 at bad
    norm_num [infinityBits] at bad

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 159 entries
Technical checking records
Local closure summary
{
  "node": "ParserExactRoundingWitness",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "6806a5eeb7087f965f630ea161391c6811f32f673228e9ba58fddcb28fcf1193",
  "active_statement_hash": "0265b4dca15e45f3361f5792d97f7ba5742e93fd8fde250c48b07aec542d0ed3",
  "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-128",
  "boundary_theorems": {},
  "strict_theorem_deps": {
    "DecimalGoalVocabularyDefault": "94cb4c406f8efb78",
    "ParserExactRoundingExecution": "29e27a892a7fec3d"
  },
  "strict_definition_deps": {
    "DecimalGoalVocabulary": "c08dd4b4aea4abb4",
    "DecimalGoalVocabularyDefault": "3016c00221d29252",
    "DecimalLexeme": "bf0c609978369054",
    "F64": "ec4e25fbaf4e11d4",
    "F64_Insts_CoreOpsArithDivF64F64": "dc44e13a99fc6bed",
    "F64_Insts_CoreOpsArithMulF64F64": "1ae1a9021a654abd",
    "F64_Insts_CoreOpsArithNegF64": "2d9be310c546ea2e",
    "F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64": "30963b4ef656cc79",
    "num_float_parse_ParseFloatError": "c43614ff2149ecf2",
    "num_imp_dec2flt_dec2flt": "f9f7d93449a25efa"
  }
}
Prose assessment
{
  "label": "Lean proof closed; predictive prose review no longer required",
  "assessment_status": null,
  "fingerprint_relation": "unknown",
  "assessment_fingerprint": null,
  "current_fingerprint": "sound-v2:2df07c116c1c972d306b86af84f30f72dadbb01ed5aa1b0bc180e5e94cf8441a",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "substantiveness_status": "Pass"
}