Statement
This explanation was written alongside the formalization to describe the statement and its reasoning.
Theorem · Execution-based decimal-sequence reconstruction
Lean statement
Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.
import Tablet.P495_T1_SignificandScan
import Tablet.P495_T1_ExponentSuffix
import Tablet.P495_T1_TrailingCount
import Tablet.P495_T1_FinalizationExact
import Tablet.P800_T1_ParserFactorization
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: P495_T1_DecimalSeqReconstruction]
theorem P495_T1_DecimalSeqReconstruction (s : Slice Std.U8) (x : DecimalLexeme)
(hsource : SourceValidByteSlice s) (hsign : x.leadingSign = none)
(hvalid : DecimalGoalVocabularyDefault.validNumeric x)
(hbytes : DecimalGoalVocabularyDefault.renderNumeric x =
DecimalGoalVocabularyDefault.bytes s) :
let F := match x.fractionDigits with | none => [] | some ds => ds
let S := x.integerDigits ++ F
let C := S.dropWhile (fun z => z == 0)
let T := (C.reverse.dropWhile (fun z => z == 0)).reverse
exists (d scan : num.imp.dec2flt.decimal_seq.DecimalSeq)
(n f : Std.Usize) (e : Std.I64),
num.imp.dec2flt.decimal_seq.parse_decimal_seq s = ok d /\
n = scan.num_digits /\ n.val = C.length /\ f.val = F.length /\
e.val = DecimalGoalVocabularyDefault.accumulatedExplicitExponent x /\
n.val <= s.val.length /\ f.val <= s.val.length /\ S.length <= s.val.length /\
num.imp.dec2flt.decimal_seq.final_decimal_point n f e = ok d.decimal_point /\
d.decimal_point.val = (if C.length = 0 then 0 else
max (-2047) (min 2047 ((C.length : Int) - F.length +
DecimalGoalVocabularyDefault.accumulatedExplicitExponent x))) /\
d.num_digits.val = min T.length 768 /\ d.num_digits.val <= 768 /\
(d.digits.val.take d.num_digits.val).map (fun b => b.val) =
T.take d.num_digits.val /\
(d.truncated = true <-> 768 < T.length) /\
scan.decimal_point = 0#i32 /\ scan.truncated = false /\
(scan.digits.val.take (min C.length 768)).map (fun b => b.val) =
C.take (min C.length 768) /\
d.digits.val.take d.num_digits.val = scan.digits.val.take d.num_digits.val /\
(forall j, j < 768 -> d.digits.val[j]? =
if d.num_digits.val <= j /\ j < 19 then some 0#u8 else scan.digits.val[j]?) /\
(forall b, b ∈ d.digits.val -> b.val < 10) /\
(C = [] <-> d.num_digits.val = 0) /\
(C = [] -> d.decimal_point = 0#i32 /\ d.truncated = false /\
forall j, j < 19 -> d.digits.val[j]? = some 0#u8) /\
(C ≠ [] -> exists digit : Nat,
C[0]? = some digit /\ 1 <= digit /\ digit < 10 /\
(d.digits.val[0]?).map (fun b => b.val) = some digit) := 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
Lean proof
classical
dsimp only
let F := match x.fractionDigits with | none => [] | some ds => ds
let S := x.integerDigits ++ F
let C := S.dropWhile (fun z => z == 0)
let T := (C.reverse.dropWhile (fun z => z == 0)).reverse
obtain ⟨rest, scan, f, hscan, hrest, hcount, hfval, hcursorBound,
hfsource, hSsource, hscanpoint, hscanflag, hscancells, hscandigits⟩ :=
P495_T1_SignificandScan s x hsource hsign hvalid hbytes
change scan.num_digits.val = C.length at hcount
change f.val = F.length at hfval
change S.length <= s.val.length at hSsource
change (forall j, j < 768 -> (scan.digits.val[j]?).map (fun b => b.val) =
if j < min C.length 768 then C[j]? else some 0) at hscancells
obtain ⟨e, hexp, heval⟩ := P495_T1_ExponentSuffix rest x hvalid hrest
have hstored : (scan.digits.val.take (min C.length 768)).map (fun b => b.val) =
C.take (min C.length 768) := by
apply List.ext_getElem?
intro j
by_cases hj : j < min C.length 768
· have hj768 : j < 768 := lt_of_lt_of_le hj (Nat.min_le_right _ _)
simpa only [List.getElem?_map, List.getElem?_take, hj, if_true] using
(hscancells j hj768)
· simp only [List.getElem?_map, List.getElem?_take, hj, if_false, Option.map_none]
have hnsource : scan.num_digits.val <= s.val.length := by omega
have hrestle : rest.val.length <= s.val.length := by omega
obtain ⟨consumed, hconsumed, _⟩ := WP.spec_imp_exists
(UScalar.sub_spec (x := Slice.len s) (y := Slice.len rest) (by
simpa only [Slice.len_val] using hrestle))
obtain ⟨ell, q, hell, hq, hSsplit, hCsplit, hChead, hTlast⟩ :=
DecimalDigitTrimDecomposition S
change C = T ++ List.replicate q 0 at hCsplit
change q = C.length - T.length at hq
change C = [] ∨ C.head? ≠ some 0 at hChead
have hzerosExists : exists zeros : Std.Usize,
C = T ++ List.replicate zeros.val 0 /\
(C ≠ [] -> num.imp.dec2flt.decimal_seq.count_trailing_zeros s consumed =
ok zeros) := by
by_cases hC : C = []
· refine ⟨0#usize, ?_, ?_⟩
· have hT : T = [] := by simp only [T, hC, List.reverse_nil, List.dropWhile_nil]
simp [hC, hT]
· intro hne
exact False.elim (hne hC)
· obtain ⟨c, zeros, hc, hz, hzval, _, _⟩ :=
P495_T1_TrailingCount s rest x hsource hsign hvalid hbytes hrest hC
have hcEq : consumed = c := Result.ok.inj (hconsumed.symm.trans hc)
refine ⟨zeros, ?_, ?_⟩
· change zeros.val = C.length - T.length at hzval
rw [hzval, ← hq]
exact hCsplit
· intro _
simpa only [hcEq] using hz
obtain ⟨zeros, hsplit, hzeros⟩ := hzerosExists
obtain ⟨d, hfinish, hpoint, hpointval, hdcount, hdprefix, hdflag,
hpreserved, hcells, hdigits⟩ :=
P495_T1_FinalizationExact s rest scan f e consumed zeros C T hcount
(le_trans hnsource hsource) (le_trans hfsource hsource) hscanflag hsplit
hconsumed hzeros hstored hscandigits
have hfactor := P800_T1_ParserFactorization s
dsimp only at hfactor
simp only [hscan, bind_tc_ok, uncurry_apply_pair, hexp] at hfactor
have hparse : num.imp.dec2flt.decimal_seq.parse_decimal_seq s = ok d :=
hfactor.trans hfinish
have hTzero (hC : C = []) : T = [] := by
simp only [T, hC, List.reverse_nil, List.dropWhile_nil]
have hTnonzero (hC : C ≠ []) : T ≠ [] := by
intro hT
have hrep : C = List.replicate zeros.val 0 := by
simpa only [hT, List.nil_append] using hsplit
have hhead := hChead.resolve_left hC
cases hz : zeros.val with
| zero => exact hC (by simpa only [hz, List.replicate_zero] using hrep)
| succ k =>
apply hhead
simp only [hrep, hz, List.replicate_succ, List.head?_cons]
have hcountpos (hC : C ≠ []) : 0 < d.num_digits.val := by
have hTpos : 0 < T.length := List.length_pos_iff.mpr (hTnonzero hC)
rw [hdcount]
omega
refine ⟨d, scan, scan.num_digits, f, e, hparse, rfl, hcount, hfval, heval,
hnsource, hfsource, hSsource, hpoint, ?_, hdcount, ?_, hdprefix, hdflag,
hscanpoint, hscanflag, hstored, hpreserved, hcells, hdigits, ?_, ?_, ?_⟩
· simpa only [hfval, heval] using hpointval
· rw [hdcount]
exact Nat.min_le_right _ _
· constructor
· intro hC
simp only [hdcount, hTzero hC, List.length_nil, Nat.zero_min]
· intro hz
by_contra hC
have := hcountpos hC
omega
· intro hC
change C = [] at hC
have hz : d.num_digits.val = 0 := by
simp only [hdcount, hTzero hC, List.length_nil, Nat.zero_min]
refine ⟨?_, ?_, ?_⟩
· apply IScalar.eq_of_val_eq
simpa only [hC, List.length_nil, if_true] using hpointval
· have hnot : ¬ d.truncated = true := by
rw [hdflag, hTzero hC]
simp only [List.length_nil]
omega
cases hb : d.truncated
· rfl
· exact False.elim (hnot hb)
· intro j hj
have hj768 : j < 768 := by omega
simpa only [hz, Nat.zero_le, hj, and_self, if_true] using hcells j hj768
· intro hC
change C ≠ [] at hC
have hpositive := hcountpos hC
cases hc : C with
| nil => exact False.elim (hC hc)
| cons digit tail =>
have hdne : digit ≠ 0 := by
have hh := hChead.resolve_left hC
simpa only [hc, List.head?_cons, ne_eq, Option.some.injEq] using hh
have hscan0 : (scan.digits.val[0]?).map (fun b => b.val) = some digit := by
have hj : 0 < min C.length 768 := by simp only [hc, List.length_cons]; omega
have hcell := hscancells 0 (by omega)
rw [if_pos hj] at hcell
simpa only [hc, List.getElem?_cons_zero] using hcell
have hdlt : digit < 10 := by
cases hb : scan.digits.val[0]? with
| none =>
simp only [hb, Option.map_none] at hscan0
cases hscan0
| some b =>
have hbval : b.val = digit := by
simpa only [hb, Option.map_some, Option.some.injEq] using hscan0
rw [← hbval]
exact hscandigits b (List.mem_of_getElem? hb)
refine ⟨digit, ?_, by omega, hdlt, ?_⟩
· change C[0]? = some digit
rw [hc]
rfl
· have hpreserve0 : d.digits.val[0]? = scan.digits.val[0]? := by
have hnot : ¬ (d.num_digits.val <= 0 /\ 0 < 19) := by omega
simpa only [hnot, if_false] using hcells 0 (by omega)
rw [hpreserve0]
exact hscan0
end dec2flt_model
Download Lean source · Download TeX source
Complete Lean module
import Tablet.P495_T1_SignificandScan
import Tablet.P495_T1_ExponentSuffix
import Tablet.P495_T1_TrailingCount
import Tablet.P495_T1_FinalizationExact
import Tablet.P800_T1_ParserFactorization
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: P495_T1_DecimalSeqReconstruction]
theorem P495_T1_DecimalSeqReconstruction (s : Slice Std.U8) (x : DecimalLexeme)
(hsource : SourceValidByteSlice s) (hsign : x.leadingSign = none)
(hvalid : DecimalGoalVocabularyDefault.validNumeric x)
(hbytes : DecimalGoalVocabularyDefault.renderNumeric x =
DecimalGoalVocabularyDefault.bytes s) :
let F := match x.fractionDigits with | none => [] | some ds => ds
let S := x.integerDigits ++ F
let C := S.dropWhile (fun z => z == 0)
let T := (C.reverse.dropWhile (fun z => z == 0)).reverse
exists (d scan : num.imp.dec2flt.decimal_seq.DecimalSeq)
(n f : Std.Usize) (e : Std.I64),
num.imp.dec2flt.decimal_seq.parse_decimal_seq s = ok d /\
n = scan.num_digits /\ n.val = C.length /\ f.val = F.length /\
e.val = DecimalGoalVocabularyDefault.accumulatedExplicitExponent x /\
n.val <= s.val.length /\ f.val <= s.val.length /\ S.length <= s.val.length /\
num.imp.dec2flt.decimal_seq.final_decimal_point n f e = ok d.decimal_point /\
d.decimal_point.val = (if C.length = 0 then 0 else
max (-2047) (min 2047 ((C.length : Int) - F.length +
DecimalGoalVocabularyDefault.accumulatedExplicitExponent x))) /\
d.num_digits.val = min T.length 768 /\ d.num_digits.val <= 768 /\
(d.digits.val.take d.num_digits.val).map (fun b => b.val) =
T.take d.num_digits.val /\
(d.truncated = true <-> 768 < T.length) /\
scan.decimal_point = 0#i32 /\ scan.truncated = false /\
(scan.digits.val.take (min C.length 768)).map (fun b => b.val) =
C.take (min C.length 768) /\
d.digits.val.take d.num_digits.val = scan.digits.val.take d.num_digits.val /\
(forall j, j < 768 -> d.digits.val[j]? =
if d.num_digits.val <= j /\ j < 19 then some 0#u8 else scan.digits.val[j]?) /\
(forall b, b ∈ d.digits.val -> b.val < 10) /\
(C = [] <-> d.num_digits.val = 0) /\
(C = [] -> d.decimal_point = 0#i32 /\ d.truncated = false /\
forall j, j < 19 -> d.digits.val[j]? = some 0#u8) /\
(C ≠ [] -> exists digit : Nat,
C[0]? = some digit /\ 1 <= digit /\ digit < 10 /\
(d.digits.val[0]?).map (fun b => b.val) = some digit) := by
-- BODY
classical
dsimp only
let F := match x.fractionDigits with | none => [] | some ds => ds
let S := x.integerDigits ++ F
let C := S.dropWhile (fun z => z == 0)
let T := (C.reverse.dropWhile (fun z => z == 0)).reverse
obtain ⟨rest, scan, f, hscan, hrest, hcount, hfval, hcursorBound,
hfsource, hSsource, hscanpoint, hscanflag, hscancells, hscandigits⟩ :=
P495_T1_SignificandScan s x hsource hsign hvalid hbytes
change scan.num_digits.val = C.length at hcount
change f.val = F.length at hfval
change S.length <= s.val.length at hSsource
change (forall j, j < 768 -> (scan.digits.val[j]?).map (fun b => b.val) =
if j < min C.length 768 then C[j]? else some 0) at hscancells
obtain ⟨e, hexp, heval⟩ := P495_T1_ExponentSuffix rest x hvalid hrest
have hstored : (scan.digits.val.take (min C.length 768)).map (fun b => b.val) =
C.take (min C.length 768) := by
apply List.ext_getElem?
intro j
by_cases hj : j < min C.length 768
· have hj768 : j < 768 := lt_of_lt_of_le hj (Nat.min_le_right _ _)
simpa only [List.getElem?_map, List.getElem?_take, hj, if_true] using
(hscancells j hj768)
· simp only [List.getElem?_map, List.getElem?_take, hj, if_false, Option.map_none]
have hnsource : scan.num_digits.val <= s.val.length := by omega
have hrestle : rest.val.length <= s.val.length := by omega
obtain ⟨consumed, hconsumed, _⟩ := WP.spec_imp_exists
(UScalar.sub_spec (x := Slice.len s) (y := Slice.len rest) (by
simpa only [Slice.len_val] using hrestle))
obtain ⟨ell, q, hell, hq, hSsplit, hCsplit, hChead, hTlast⟩ :=
DecimalDigitTrimDecomposition S
change C = T ++ List.replicate q 0 at hCsplit
change q = C.length - T.length at hq
change C = [] ∨ C.head? ≠ some 0 at hChead
have hzerosExists : exists zeros : Std.Usize,
C = T ++ List.replicate zeros.val 0 /\
(C ≠ [] -> num.imp.dec2flt.decimal_seq.count_trailing_zeros s consumed =
ok zeros) := by
by_cases hC : C = []
· refine ⟨0#usize, ?_, ?_⟩
· have hT : T = [] := by simp only [T, hC, List.reverse_nil, List.dropWhile_nil]
simp [hC, hT]
· intro hne
exact False.elim (hne hC)
· obtain ⟨c, zeros, hc, hz, hzval, _, _⟩ :=
P495_T1_TrailingCount s rest x hsource hsign hvalid hbytes hrest hC
have hcEq : consumed = c := Result.ok.inj (hconsumed.symm.trans hc)
refine ⟨zeros, ?_, ?_⟩
· change zeros.val = C.length - T.length at hzval
rw [hzval, ← hq]
exact hCsplit
· intro _
simpa only [hcEq] using hz
obtain ⟨zeros, hsplit, hzeros⟩ := hzerosExists
obtain ⟨d, hfinish, hpoint, hpointval, hdcount, hdprefix, hdflag,
hpreserved, hcells, hdigits⟩ :=
P495_T1_FinalizationExact s rest scan f e consumed zeros C T hcount
(le_trans hnsource hsource) (le_trans hfsource hsource) hscanflag hsplit
hconsumed hzeros hstored hscandigits
have hfactor := P800_T1_ParserFactorization s
dsimp only at hfactor
simp only [hscan, bind_tc_ok, uncurry_apply_pair, hexp] at hfactor
have hparse : num.imp.dec2flt.decimal_seq.parse_decimal_seq s = ok d :=
hfactor.trans hfinish
have hTzero (hC : C = []) : T = [] := by
simp only [T, hC, List.reverse_nil, List.dropWhile_nil]
have hTnonzero (hC : C ≠ []) : T ≠ [] := by
intro hT
have hrep : C = List.replicate zeros.val 0 := by
simpa only [hT, List.nil_append] using hsplit
have hhead := hChead.resolve_left hC
cases hz : zeros.val with
| zero => exact hC (by simpa only [hz, List.replicate_zero] using hrep)
| succ k =>
apply hhead
simp only [hrep, hz, List.replicate_succ, List.head?_cons]
have hcountpos (hC : C ≠ []) : 0 < d.num_digits.val := by
have hTpos : 0 < T.length := List.length_pos_iff.mpr (hTnonzero hC)
rw [hdcount]
omega
refine ⟨d, scan, scan.num_digits, f, e, hparse, rfl, hcount, hfval, heval,
hnsource, hfsource, hSsource, hpoint, ?_, hdcount, ?_, hdprefix, hdflag,
hscanpoint, hscanflag, hstored, hpreserved, hcells, hdigits, ?_, ?_, ?_⟩
· simpa only [hfval, heval] using hpointval
· rw [hdcount]
exact Nat.min_le_right _ _
· constructor
· intro hC
simp only [hdcount, hTzero hC, List.length_nil, Nat.zero_min]
· intro hz
by_contra hC
have := hcountpos hC
omega
· intro hC
change C = [] at hC
have hz : d.num_digits.val = 0 := by
simp only [hdcount, hTzero hC, List.length_nil, Nat.zero_min]
refine ⟨?_, ?_, ?_⟩
· apply IScalar.eq_of_val_eq
simpa only [hC, List.length_nil, if_true] using hpointval
· have hnot : ¬ d.truncated = true := by
rw [hdflag, hTzero hC]
simp only [List.length_nil]
omega
cases hb : d.truncated
· rfl
· exact False.elim (hnot hb)
· intro j hj
have hj768 : j < 768 := by omega
simpa only [hz, Nat.zero_le, hj, and_self, if_true] using hcells j hj768
· intro hC
change C ≠ [] at hC
have hpositive := hcountpos hC
cases hc : C with
| nil => exact False.elim (hC hc)
| cons digit tail =>
have hdne : digit ≠ 0 := by
have hh := hChead.resolve_left hC
simpa only [hc, List.head?_cons, ne_eq, Option.some.injEq] using hh
have hscan0 : (scan.digits.val[0]?).map (fun b => b.val) = some digit := by
have hj : 0 < min C.length 768 := by simp only [hc, List.length_cons]; omega
have hcell := hscancells 0 (by omega)
rw [if_pos hj] at hcell
simpa only [hc, List.getElem?_cons_zero] using hcell
have hdlt : digit < 10 := by
cases hb : scan.digits.val[0]? with
| none =>
simp only [hb, Option.map_none] at hscan0
cases hscan0
| some b =>
have hbval : b.val = digit := by
simpa only [hb, Option.map_some, Option.some.injEq] using hscan0
rw [← hbval]
exact hscandigits b (List.mem_of_getElem? hb)
refine ⟨digit, ?_, by omega, hdlt, ?_⟩
· change C[0]? = some digit
rw [hc]
rfl
· have hpreserve0 : d.digits.val[0]? = scan.digits.val[0]? := by
have hnot : ¬ (d.num_digits.val <= 0 /\ 0 < 19) := by omega
simpa only [hnot, if_false] using hcells 0 (by omega)
rw [hpreserve0]
exact hscan0
end dec2flt_model
Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Inspect related source (79)
- final_decimal_point · dec2flt/decimal_seq.rs:269 Program Rust
- parse_decimal_seq · dec2flt/decimal_seq.rs:288 Program Rust
- parse_decimal_seq_loop0 · dec2flt/decimal_seq.rs:296 Program Rust
More program dependencies (46)
- body · dec2flt/decimal_seq.rs:296 Program Rust
- parse_decimal_seq_loop1 · dec2flt/decimal_seq.rs:368 Program Rust
- body · dec2flt/decimal_seq.rs:368 Program Rust
- parse_decimal_seq_loop2 · dec2flt/decimal_seq.rs:309 Program Rust
- body · dec2flt/decimal_seq.rs:309 Program Rust
- parse_decimal_seq_loop3 · dec2flt/decimal_seq.rs:313 Program Rust
- body · dec2flt/decimal_seq.rs:313 Program Rust
- parse_decimal_seq_loop4 · dec2flt/decimal_seq.rs:368 Program Rust
- body · dec2flt/decimal_seq.rs:368 Program Rust
- parse_decimal_seq_loop5 · dec2flt/decimal_seq.rs:313 Program Rust
- body · dec2flt/decimal_seq.rs:313 Program Rust
- parse_decimal_seq_loop6 · dec2flt/decimal_seq.rs:368 Program Rust
- body · dec2flt/decimal_seq.rs:368 Program Rust
- parse_decimal_seq_loop7 · dec2flt/decimal_seq.rs:368 Program Rust
- body · dec2flt/decimal_seq.rs:368 Program Rust
- parse_digits_into_seq · dec2flt/decimal_seq.rs:257 Program Rust
- parse_digits_into_seq_loop · dec2flt/decimal_seq.rs:259 Program Rust
- body · dec2flt/decimal_seq.rs:259 Program Rust
- from_u64 · dec2flt/mod.rs:263 Program Rust
- read_u64 · dec2flt/common.rs:22 Program Rust
- write_u64 · dec2flt/common.rs:29 Program Rust
- FloatErrorKind · num/mod.rs:18 Program Rust
- ParseFloatError · num/mod.rs:13 Program Rust
- Dec2FltAssemblyTrace · dec2flt/mod.rs:329 Program Rust
- Dec2FltTrace · dec2flt/mod.rs:295 Program Rust
- Lemire · dec2flt/mod.rs:115 Program Rust
- BiasedFp · dec2flt/common.rs:56 Program Rust
- ByteSlice · dec2flt/common.rs:4 Program Rust
- is_8digits · dec2flt/common.rs:44 Program Rust
- Decimal · dec2flt/decimal.rs:32 Program Rust
- DecimalSeq · dec2flt/decimal_seq.rs:22 Program Rust
- DECIMAL_POINT_RANGE · dec2flt/decimal_seq.rs:68 Program Rust
- default · dec2flt/decimal_seq.rs:34 Program Rust
- MAX_DIGITS · dec2flt/decimal_seq.rs:64 Program Rust
- MAX_DIGITS_WITHOUT_OVERFLOW · dec2flt/decimal_seq.rs:67 Program Rust
- try_add_digit · dec2flt/decimal_seq.rs:74 Program Rust
- count_trailing_zeros · dec2flt/decimal_seq.rs:236 Program Rust
- count_trailing_zeros_loop · dec2flt/decimal_seq.rs:240 Program Rust
- body · dec2flt/decimal_seq.rs:240 Program Rust
- parse_scientific · dec2flt/parse.rs:121 Program Rust
- parse_scientific_loop · dec2flt/parse.rs:145 Program Rust
- body · dec2flt/parse.rs:145 Program Rust
- CastInto · traits.rs:18 Program Rust
- Float · traits.rs:74 Program Rust
- FloatExt · traits.rs:170 Program Rust
- Int · traits.rs:27 Program Rust
Standard-library dependencies (30)
- clone · core/src/clone.rs:698 Rust library
- div · core/src/ops/arith.rs:515 Rust library
- mul · core/src/ops/arith.rs:350 Rust library
- neg · core/src/ops/arith.rs:719 Rust library
- bitand · core/src/ops/bit.rs:178 Rust library
- bitor · core/src/ops/bit.rs:282 Rust library
- shl · core/src/ops/bit.rs:489 Rust library
- shr · core/src/ops/bit.rs:612 Rust library
- EXPONENT_MASK · core/src/num/f64.rs:615 Rust library
- INFINITY · core/src/num/f64.rs:512 Rust library
- MANTISSA_DIGITS · core/src/num/f64.rs:412 Rust library
- MANTISSA_MASK · core/src/num/f64.rs:637 Rust library
- NAN · core/src/num/f64.rs:509 Rust library
- NEG_INFINITY · core/src/num/f64.rs:515 Rust library
- classify · core/src/num/f64.rs:782 Rust library
- from_bits · core/src/num/f64.rs:1269 Rust library
- to_bits · core/src/num/f64.rs:1223 Rust library
- is_ascii_digit · core/src/num/mod.rs:958 Rust library
- from_residual · core/src/option.rs:2793 Rust library
- branch · core/src/option.rs:2779 Rust library
- first · core/src/slice/mod.rs:155 Rust library
- split_first · core/src/slice/mod.rs:198 Rust library
- as_bytes · core/src/str/mod.rs:498 Rust library
- FpCategory · core/src/num/mod.rs:1522 Rust library
- Div · core/src/ops/arith.rs:460 Rust library
- Mul · core/src/ops/arith.rs:322 Rust library
- Neg · core/src/ops/arith.rs:690 Rust library
- BitOr · core/src/ops/bit.rs:254 Rust library
- Shl · core/src/ops/bit.rs:461 Rust library
- Shr · core/src/ops/bit.rs:584 Rust library
Related source and models come from the extraction records and declared dependencies.
Proof assumptions and review
Lean checks the formal proof. Trellis also reviews how the statement corresponds to the intended requirement.
Transitive assumptions
- Classical.choice
- Dec2Flt.P340_T1_selected_target_numBits
- Quot.sound
- propext
This list combines the assumptions recorded for this declaration and its dependencies. It may include assumptions used by auxiliary declarations in those modules.
Helper theorems included
- Binary64Model
- Binary64ModelDefault
- DecimalDigitTrimDecomposition
- DecimalGoalVocabulary
- DecimalGoalVocabularyDefault
- DecimalLexeme
All 79 entries
- Binary64Model
- Binary64ModelDefault
- DecimalDigitTrimDecomposition
- DecimalGoalVocabulary
- DecimalGoalVocabularyDefault
- DecimalLexeme
- DecimalSeqBulkLaneSubtraction
- DecimalSeqDuplicateLoops
- DecimalSeqLeadingZeroLoopExact
- DecimalSeqLittleEndianLane
- DecimalSeqRenderedSplit
- DecimalSeqTrailingZeroLoopExact
- DecimalSeqTrailingZeroValues
- DecimalSeqWriteU64Exact
- F64
- ModelF64Classify
- ModelF64Clone
- ModelF64Div
- ModelF64ExponentMask
- ModelF64FromBits
- ModelF64FromU64
- ModelF64Infinity
- ModelF64MantissaDigits
- ModelF64MantissaMask
- ModelF64Mul
- ModelF64Nan
- ModelF64Neg
- ModelF64NegInfinity
- ModelF64ToBits
- ModelOptionBranch
- ModelOptionFromResidual
- ModelSliceFirst
- ModelSliceSplitFirst
- ModelStrAsBytes
- ModelU64BitAnd
- ModelU64BitOr
- ModelU64Shl
- ModelU64Shr
- ModelU8IsAsciiDigit
- NumberHelperEightDigitWord
- NumberHelperEightDigitWordAccepted
- NumberHelperReadEightBytes
- NumberHelperSplitExponentSuffix
- BulkLoopExact
- BulkMixedStop
- BulkStepExact
- DecimalSeqReconstruction
- DigitRunExact
- ExponentSuffix
- FillExact
- FinalizationExact
- ScalarScanExact
- SignificandScan
- TrailingCount
- ParserFactorization
- FinalPointArithmetic
- FinalPointExact
- ScientificLoopFold
- ScientificScannerFold
- ScientificVocabularyFold
- Preamble
- SliceU8 Insts Dec2flt modelNumImpDec2fltCommonByteSlice read u64
- SliceU8 Insts Dec2flt modelNumImpDec2fltCommonByteSlice write u64
- SourceValidByteSlice
- core num FpCategory
- num imp dec2flt common BiasedFp
- num imp dec2flt common is 8digits
- num imp dec2flt decimal Decimal
- num imp dec2flt decimal seq DecimalSeq
- num imp dec2flt decimal seq DecimalSeq DECIMAL POINT RANGE
- num imp dec2flt decimal seq DecimalSeq Insts CoreDefaultDefault default
- num imp dec2flt decimal seq DecimalSeq MAX DIGITS
- num imp dec2flt decimal seq DecimalSeq MAX DIGITS WITHOUT OVERFLOW
- num imp dec2flt decimal seq DecimalSeq try add digit
- num imp dec2flt decimal seq count trailing zeros
- num imp dec2flt decimal seq final decimal point
- num imp dec2flt decimal seq parse decimal seq
- num imp dec2flt decimal seq parse digits into seq
- num imp dec2flt parse parse scientific
Technical checking records
Local closure summary
{
"node": "P495_T1_DecimalSeqReconstruction",
"closure_version": "patch_c_v1",
"active_decl_hash": "699ff912602cb5491e81f0291c95b8de7855abb9b872abf214a16393a7233fab",
"active_statement_hash": "ce8a8ee04db04bc0a3d7f863dc840cd9439747ff3afe495d133cb849e07b10f6",
"kernel_axioms": [
"Classical.choice",
"Quot.sound",
"propext"
],
"toolchain_hash": "ce4c4e3d87434b9663f46de25ce34b48a0cf0d392e0a320a0787b4674a2d7b61",
"lean_executable_hash": "3e0d0d3d801675359f2d4cf9815bfdb417b20b92fdd9d48b3b14c95bbae28bbf",
"checker_script_hash": "c8e4a03273e23b9a8f2e141020652a4e0b7b0a8ab0883366ea9d031ca3f37aa1",
"approved_axioms_hash": "576e6bf9480cfd32f53c309c7ac8fb115c1ba6e413f299ed5ff9fa7c647e6769",
"axcheck_status": "Agreed",
"accepted_at_snapshot_id": "worker-result-local-closure-issuance-cycle-189",
"boundary_theorems": {},
"strict_theorem_deps": {
"DecimalDigitTrimDecomposition": "74d5424585de54f0",
"P495_T1_ExponentSuffix": "8623b3a9ab4699aa",
"P495_T1_FinalizationExact": "5357e368ceddec3e",
"P495_T1_SignificandScan": "ba2621f7b2882a3d",
"P495_T1_TrailingCount": "fc2f48988132719a",
"P800_T1_ParserFactorization": "e622a8cbbd0f7b00"
},
"strict_definition_deps": {
"DecimalGoalVocabulary": "4da7f295a9b85b50",
"DecimalGoalVocabularyDefault": "71a18a6c119a3cdc",
"DecimalLexeme": "303e59678842cea4",
"P495_T1_SignificandScan": "55eb6bce0e8a4131",
"P495_T1_TrailingCount": "55eb6bce0e8a4131",
"SourceValidByteSlice": "3dc42716a6378d26",
"num_imp_dec2flt_decimal_seq_DecimalSeq": "13e3cec939d02f51",
"num_imp_dec2flt_decimal_seq_DecimalSeq_Insts_CoreDefaultDefault_default": "7b9921904495bc2a",
"num_imp_dec2flt_decimal_seq_DecimalSeq_MAX_DIGITS": "39f6cb231ef80388",
"num_imp_dec2flt_decimal_seq_DecimalSeq_MAX_DIGITS_WITHOUT_OVERFLOW": "65634ac95536dcca",
"num_imp_dec2flt_decimal_seq_count_trailing_zeros": "7a77bc9e01c1a09b",
"num_imp_dec2flt_decimal_seq_final_decimal_point": "4f8088dec06d629a",
"num_imp_dec2flt_decimal_seq_parse_decimal_seq": "89c1cc8d6b6338d0",
"num_imp_dec2flt_decimal_seq_parse_digits_into_seq": "8b2cc3a350f40ce1",
"num_imp_dec2flt_parse_parse_scientific": "447f722d5841d2c5"
}
}Prose assessment
{
"label": "Recorded Sound: VerifierPass",
"assessment_status": "VerifierPass",
"fingerprint_relation": "matches current fingerprint",
"assessment_fingerprint": "sound-v2:c068b23e9086013bea50998082090fe208da2705454b93c70a916488bcdef6d9",
"current_fingerprint": "sound-v2:c068b23e9086013bea50998082090fe208da2705454b93c70a916488bcdef6d9",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"sound_status": "Pass",
"substantiveness_status": "Pass"
}