Statement
This explanation was written alongside the formalization to describe the statement and its reasoning.
Lemma · Exact scientific-exponent scan
parse_scientific consumes all of s and
returns exponent E for no sign or a positive sign, and exponent -E for
a negative sign.Lean statement
Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.
import Tablet.Assumptions
import Tablet.ModelSliceSplitFirst
import Tablet.ModelU8IsAsciiDigit
import Tablet.num_imp_dec2flt_parse_parse_scientific
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: NumberHelperScientificExact]
theorem NumberHelperScientificExact
(s : Slice Std.U8) (sign : Option Bool) (digits : List Std.U8)
(hne : digits != [])
(hdigits : forall b, List.Mem b digits -> 48 <= b.val /\ b.val <= 57)
(hs : s.val =
(match sign with
| none => []
| some negative => [if negative then 45#u8 else 43#u8]) ++ digits) :
exists (exponent : Std.I64) (rest : Slice Std.U8),
num.imp.dec2flt.parse.parse_scientific s = ok (some exponent, rest) /\
rest.val = [] /\
exponent.val =
if sign = some true then
-((digits.foldl
(fun a b => if a < 65536 then 10 * a + (b.val - 48) else a)
0 : Nat) : Int)
else ((digits.foldl
(fun a b => if a < 65536 then 10 * a + (b.val - 48) else a)
0 : Nat) : Int) := 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
let digitStep : Nat -> Std.U8 -> Nat := fun a b =>
if a < 65536 then 10 * a + (b.val - 48) else a
have loop_exact : forall (t : Slice Std.U8),
(forall b, List.Mem b t.val -> 48 <= b.val /\ b.val <= 57) ->
num.imp.dec2flt.parse.parse_scientific_loop 0#i64 t 0#usize
⦃ p => p.2.val = t.length /\
p.1.val = ((t.val.foldl digitStep 0 : Nat) : Int) ⦄ := by
intro t htdigits
unfold num.imp.dec2flt.parse.parse_scientific_loop
apply Aeneas.Std.loop.spec_decr_nat
(fun p : Std.I64 × Std.Usize => t.length - p.2.val)
(fun p => p.2.val <= t.length /\
p.1.val = (((t.val.take p.2.val).foldl digitStep 0 : Nat) : Int))
(fun p => p.2.val = t.length /\
p.1.val = ((t.val.foldl digitStep 0 : Nat) : Int))
(fun p => num.imp.dec2flt.parse.parse_scientific_loop.body
t p.1 p.2)
(0#i64, 0#usize)
· intro p hp
rcases p with ⟨acc, count⟩
rcases hp with ⟨hcount, hx⟩
simp [num.imp.dec2flt.parse.parse_scientific_loop.body, WP.spec_ok]
split
· rename_i hinside
step
have hiMem : List.Mem i1 t.val := by
rw [i1_post]
exact List.getElem_mem _
have hiDigit := htdigits i1 hiMem
step
have hi2Val : i2.val = i1.val - 48 := by
rw [i2_post, core.num.U8.wrapping_sub_val_eq]
simp only [UScalar.size_UScalarTyU8, U8.size_eq]
norm_num
omega
have hi2Small : i2.val < 10 := by omega
simp [hi2Small]
step
by_cases hxsmall : acc.val < 65536
· simp only [if_pos hxsmall]
step
step
have hdigitVal : digit.val = i1.val - 48 := by
rw [digit_post, core.num.U8.wrapping_sub_val_eq]
simp only [UScalar.size_UScalarTyU8, U8.size_eq]
norm_num
omega
have hxcast : (UScalar.hcast .I64 digit).val = digit.val := by
have h := UScalar.hcast_inBounds_spec .I64 digit (by scalar_tac)
simpa [WP.spec_ok] using h
have hxVal : x.val = digit.val := by
rw [x_post, hxcast]
have hmax : exponent1.val + x.val <= I64.max := by
rw [I64.max_eq]
omega
step with IScalar.add_spec
step
have hcount1 : count1.val = count.val + 1 := by
simpa using count1_post
have hnextValue : exponent1.val =
10 * acc.val + (i1.val - 48) := by
rw [exponent1_post, hxVal, hdigitVal]
omega
constructor
· rw [hcount1]
omega
· constructor
· rw [hcount1, List.take_succ_eq_append_getElem hinside,
List.foldl_append, List.foldl_cons, List.foldl_nil,
← i1_post]
have hfoldsmall :
(t.val.take count.val).foldl digitStep 0 < 65536 := by
rw [hx] at hxsmall
exact_mod_cast hxsmall
simp only [digitStep, if_pos hfoldsmall]
rw [hnextValue, hx]
simp [Int.subNatNat_of_le (show 48 <= i1.val by omega),
Int.ofNat_sub (show 48 <= i1.val by omega)]
simp only [digitStep]
· rw [hcount1]
omega
· simp only [if_neg hxsmall]
have hcountMax : count.val + 1 <= UScalar.max .Usize := by
have ht := t.property
have hbits := Dec2Flt.configured_x86_64_numBits
simp [UScalar.max, Usize.max, Usize.numBits, hbits] at ht ⊢
omega
obtain ⟨nextCount, hnextCount, hcount1⟩ :=
Aeneas.Std.WP.spec_imp_exists
(UScalar.add_spec (x := count) (y := 1#usize) hcountMax)
rw [hnextCount]
norm_num at hcount1
constructor
· rw [hcount1]
omega
· constructor
· rw [hcount1, List.take_succ_eq_append_getElem hinside,
List.foldl_append, List.foldl_cons, List.foldl_nil, hx,
← i1_post]
have hfoldge : Not
((t.val.take count.val).foldl digitStep 0 < 65536) := by
intro hsmall
apply hxsmall
rw [hx]
exact_mod_cast hsmall
simp [digitStep, hfoldge]
· rw [hcount1]
omega
· have hcountEq : count.val = t.val.length := by
simp only [Slice.length] at hcount
omega
simp only [WP.spec_ok]
exact ⟨by simpa [Slice.length] using hcountEq,
by rw [hx, hcountEq, List.take_length]⟩
· norm_num [digitStep]
cases sign with
| none =>
simp only [List.nil_append] at hs
cases hd : digits with
| nil => simp_all
| cons c cs =>
have hsval : s.val = c :: cs := by simpa [hd] using hs
let body : Slice Std.U8 := ⟨c :: cs, by simpa [hsval] using s.property⟩
have hseq : s = body := (Slice.eq_iff _ _).2 (by simpa [body] using hsval)
have hc := hdigits c (by rw [hd]; exact List.mem_cons_self)
have hc45 : c ≠ 45#u8 := by scalar_tac
have hc43 : c ≠ 43#u8 := by scalar_tac
have hall : forall b, List.Mem b body.val ->
48 <= b.val /\ b.val <= 57 := by
intro b hb
apply hdigits b
simpa [body, hd] using hb
obtain ⟨p, hloop, hp⟩ := Aeneas.Std.WP.spec_imp_exists
(loop_exact body hall)
rcases p with ⟨e, count⟩
have hpCount : count.val = (c :: cs).length := by
simpa [body, Slice.length] using hp.1
rw [hseq]
simp [num.imp.dec2flt.parse.parse_scientific,
core.slice.Slice.split_first, dec2flt_model.ModelSliceSplitFirst,
core.num.U8.is_ascii_digit, dec2flt_model.ModelU8IsAsciiDigit,
Slice.index_usize, body, hc45, hc43]
simp only [if_pos hc]
rw [hloop]
simp [core.slice.index.SliceIndexRangeFromUsizeSlice.index,
Slice.drop, hp, hpCount, body, digitStep, hd]
| some negative =>
cases negative with
| false =>
simp at hs
cases hd : digits with
| nil => simp_all
| cons c cs =>
have hsval : s.val = 43#u8 :: c :: cs := by simpa [hd] using hs
have tailProp : (c :: cs).length <= Usize.max := by
have h := s.property
rw [hsval] at h
simp at h ⊢
omega
let body : Slice Std.U8 := ⟨c :: cs, tailProp⟩
have hc := hdigits c (by rw [hd]; exact List.mem_cons_self)
have hall : forall b, List.Mem b body.val ->
48 <= b.val /\ b.val <= 57 := by
intro b hb
apply hdigits b
simpa [body, hd] using hb
obtain ⟨p, hloop, hp⟩ := Aeneas.Std.WP.spec_imp_exists
(loop_exact body hall)
rcases p with ⟨e, count⟩
have hpCount : count.val = (c :: cs).length := by
simpa [body, Slice.length] using hp.1
let whole : Slice Std.U8 := ⟨43#u8 :: c :: cs, by
simpa [hsval] using s.property⟩
have hseq : s = whole := (Slice.eq_iff _ _).2 hsval
rw [hseq]
simp [num.imp.dec2flt.parse.parse_scientific,
core.slice.Slice.split_first, dec2flt_model.ModelSliceSplitFirst,
core.num.U8.is_ascii_digit, dec2flt_model.ModelU8IsAsciiDigit,
Slice.index_usize, whole, body]
simp only [if_pos hc]
rw [hloop]
simp [core.slice.index.SliceIndexRangeFromUsizeSlice.index,
Slice.drop, hp, hpCount, body, digitStep, hd]
| true =>
simp at hs
cases hd : digits with
| nil => simp_all
| cons c cs =>
have hsval : s.val = 45#u8 :: c :: cs := by simpa [hd] using hs
have tailProp : (c :: cs).length <= Usize.max := by
have h := s.property
rw [hsval] at h
simp at h ⊢
omega
let body : Slice Std.U8 := ⟨c :: cs, tailProp⟩
have hc := hdigits c (by rw [hd]; exact List.mem_cons_self)
have hall : forall b, List.Mem b body.val ->
48 <= b.val /\ b.val <= 57 := by
intro b hb
apply hdigits b
simpa [body, hd] using hb
obtain ⟨p, hloop, hp⟩ := Aeneas.Std.WP.spec_imp_exists
(loop_exact body hall)
rcases p with ⟨e, count⟩
have hpCount : count.val = (c :: cs).length := by
simpa [body, Slice.length] using hp.1
have heNonneg : 0 <= e.val := by rw [hp.2]; omega
have hnotmin : e.val ≠ IScalar.min .I64 := by
simp [IScalar.min, I64.min_eq]
omega
obtain ⟨ne, hneg, hne⟩ := Aeneas.Std.WP.spec_imp_exists
(HNeg.hNeg.step e hnotmin)
let whole : Slice Std.U8 := ⟨45#u8 :: c :: cs, by
simpa [hsval] using s.property⟩
have hseq : s = whole := (Slice.eq_iff _ _).2 hsval
rw [hseq]
simp [num.imp.dec2flt.parse.parse_scientific,
core.slice.Slice.split_first, dec2flt_model.ModelSliceSplitFirst,
core.num.U8.is_ascii_digit, dec2flt_model.ModelU8IsAsciiDigit,
Slice.index_usize, whole, body]
simp only [if_pos hc]
rw [hloop]
simp [hneg, core.slice.index.SliceIndexRangeFromUsizeSlice.index,
Slice.drop, hp, hpCount, hne, body, digitStep, hd]
end dec2flt_model
Download Lean source · Download TeX source
Complete Lean module
import Tablet.Assumptions
import Tablet.ModelSliceSplitFirst
import Tablet.ModelU8IsAsciiDigit
import Tablet.num_imp_dec2flt_parse_parse_scientific
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: NumberHelperScientificExact]
theorem NumberHelperScientificExact
(s : Slice Std.U8) (sign : Option Bool) (digits : List Std.U8)
(hne : digits != [])
(hdigits : forall b, List.Mem b digits -> 48 <= b.val /\ b.val <= 57)
(hs : s.val =
(match sign with
| none => []
| some negative => [if negative then 45#u8 else 43#u8]) ++ digits) :
exists (exponent : Std.I64) (rest : Slice Std.U8),
num.imp.dec2flt.parse.parse_scientific s = ok (some exponent, rest) /\
rest.val = [] /\
exponent.val =
if sign = some true then
-((digits.foldl
(fun a b => if a < 65536 then 10 * a + (b.val - 48) else a)
0 : Nat) : Int)
else ((digits.foldl
(fun a b => if a < 65536 then 10 * a + (b.val - 48) else a)
0 : Nat) : Int) := by
-- BODY
let digitStep : Nat -> Std.U8 -> Nat := fun a b =>
if a < 65536 then 10 * a + (b.val - 48) else a
have loop_exact : forall (t : Slice Std.U8),
(forall b, List.Mem b t.val -> 48 <= b.val /\ b.val <= 57) ->
num.imp.dec2flt.parse.parse_scientific_loop 0#i64 t 0#usize
⦃ p => p.2.val = t.length /\
p.1.val = ((t.val.foldl digitStep 0 : Nat) : Int) ⦄ := by
intro t htdigits
unfold num.imp.dec2flt.parse.parse_scientific_loop
apply Aeneas.Std.loop.spec_decr_nat
(fun p : Std.I64 × Std.Usize => t.length - p.2.val)
(fun p => p.2.val <= t.length /\
p.1.val = (((t.val.take p.2.val).foldl digitStep 0 : Nat) : Int))
(fun p => p.2.val = t.length /\
p.1.val = ((t.val.foldl digitStep 0 : Nat) : Int))
(fun p => num.imp.dec2flt.parse.parse_scientific_loop.body
t p.1 p.2)
(0#i64, 0#usize)
· intro p hp
rcases p with ⟨acc, count⟩
rcases hp with ⟨hcount, hx⟩
simp [num.imp.dec2flt.parse.parse_scientific_loop.body, WP.spec_ok]
split
· rename_i hinside
step
have hiMem : List.Mem i1 t.val := by
rw [i1_post]
exact List.getElem_mem _
have hiDigit := htdigits i1 hiMem
step
have hi2Val : i2.val = i1.val - 48 := by
rw [i2_post, core.num.U8.wrapping_sub_val_eq]
simp only [UScalar.size_UScalarTyU8, U8.size_eq]
norm_num
omega
have hi2Small : i2.val < 10 := by omega
simp [hi2Small]
step
by_cases hxsmall : acc.val < 65536
· simp only [if_pos hxsmall]
step
step
have hdigitVal : digit.val = i1.val - 48 := by
rw [digit_post, core.num.U8.wrapping_sub_val_eq]
simp only [UScalar.size_UScalarTyU8, U8.size_eq]
norm_num
omega
have hxcast : (UScalar.hcast .I64 digit).val = digit.val := by
have h := UScalar.hcast_inBounds_spec .I64 digit (by scalar_tac)
simpa [WP.spec_ok] using h
have hxVal : x.val = digit.val := by
rw [x_post, hxcast]
have hmax : exponent1.val + x.val <= I64.max := by
rw [I64.max_eq]
omega
step with IScalar.add_spec
step
have hcount1 : count1.val = count.val + 1 := by
simpa using count1_post
have hnextValue : exponent1.val =
10 * acc.val + (i1.val - 48) := by
rw [exponent1_post, hxVal, hdigitVal]
omega
constructor
· rw [hcount1]
omega
· constructor
· rw [hcount1, List.take_succ_eq_append_getElem hinside,
List.foldl_append, List.foldl_cons, List.foldl_nil,
← i1_post]
have hfoldsmall :
(t.val.take count.val).foldl digitStep 0 < 65536 := by
rw [hx] at hxsmall
exact_mod_cast hxsmall
simp only [digitStep, if_pos hfoldsmall]
rw [hnextValue, hx]
simp [Int.subNatNat_of_le (show 48 <= i1.val by omega),
Int.ofNat_sub (show 48 <= i1.val by omega)]
simp only [digitStep]
· rw [hcount1]
omega
· simp only [if_neg hxsmall]
have hcountMax : count.val + 1 <= UScalar.max .Usize := by
have ht := t.property
have hbits := Dec2Flt.configured_x86_64_numBits
simp [UScalar.max, Usize.max, Usize.numBits, hbits] at ht ⊢
omega
obtain ⟨nextCount, hnextCount, hcount1⟩ :=
Aeneas.Std.WP.spec_imp_exists
(UScalar.add_spec (x := count) (y := 1#usize) hcountMax)
rw [hnextCount]
norm_num at hcount1
constructor
· rw [hcount1]
omega
· constructor
· rw [hcount1, List.take_succ_eq_append_getElem hinside,
List.foldl_append, List.foldl_cons, List.foldl_nil, hx,
← i1_post]
have hfoldge : Not
((t.val.take count.val).foldl digitStep 0 < 65536) := by
intro hsmall
apply hxsmall
rw [hx]
exact_mod_cast hsmall
simp [digitStep, hfoldge]
· rw [hcount1]
omega
· have hcountEq : count.val = t.val.length := by
simp only [Slice.length] at hcount
omega
simp only [WP.spec_ok]
exact ⟨by simpa [Slice.length] using hcountEq,
by rw [hx, hcountEq, List.take_length]⟩
· norm_num [digitStep]
cases sign with
| none =>
simp only [List.nil_append] at hs
cases hd : digits with
| nil => simp_all
| cons c cs =>
have hsval : s.val = c :: cs := by simpa [hd] using hs
let body : Slice Std.U8 := ⟨c :: cs, by simpa [hsval] using s.property⟩
have hseq : s = body := (Slice.eq_iff _ _).2 (by simpa [body] using hsval)
have hc := hdigits c (by rw [hd]; exact List.mem_cons_self)
have hc45 : c ≠ 45#u8 := by scalar_tac
have hc43 : c ≠ 43#u8 := by scalar_tac
have hall : forall b, List.Mem b body.val ->
48 <= b.val /\ b.val <= 57 := by
intro b hb
apply hdigits b
simpa [body, hd] using hb
obtain ⟨p, hloop, hp⟩ := Aeneas.Std.WP.spec_imp_exists
(loop_exact body hall)
rcases p with ⟨e, count⟩
have hpCount : count.val = (c :: cs).length := by
simpa [body, Slice.length] using hp.1
rw [hseq]
simp [num.imp.dec2flt.parse.parse_scientific,
core.slice.Slice.split_first, dec2flt_model.ModelSliceSplitFirst,
core.num.U8.is_ascii_digit, dec2flt_model.ModelU8IsAsciiDigit,
Slice.index_usize, body, hc45, hc43]
simp only [if_pos hc]
rw [hloop]
simp [core.slice.index.SliceIndexRangeFromUsizeSlice.index,
Slice.drop, hp, hpCount, body, digitStep, hd]
| some negative =>
cases negative with
| false =>
simp at hs
cases hd : digits with
| nil => simp_all
| cons c cs =>
have hsval : s.val = 43#u8 :: c :: cs := by simpa [hd] using hs
have tailProp : (c :: cs).length <= Usize.max := by
have h := s.property
rw [hsval] at h
simp at h ⊢
omega
let body : Slice Std.U8 := ⟨c :: cs, tailProp⟩
have hc := hdigits c (by rw [hd]; exact List.mem_cons_self)
have hall : forall b, List.Mem b body.val ->
48 <= b.val /\ b.val <= 57 := by
intro b hb
apply hdigits b
simpa [body, hd] using hb
obtain ⟨p, hloop, hp⟩ := Aeneas.Std.WP.spec_imp_exists
(loop_exact body hall)
rcases p with ⟨e, count⟩
have hpCount : count.val = (c :: cs).length := by
simpa [body, Slice.length] using hp.1
let whole : Slice Std.U8 := ⟨43#u8 :: c :: cs, by
simpa [hsval] using s.property⟩
have hseq : s = whole := (Slice.eq_iff _ _).2 hsval
rw [hseq]
simp [num.imp.dec2flt.parse.parse_scientific,
core.slice.Slice.split_first, dec2flt_model.ModelSliceSplitFirst,
core.num.U8.is_ascii_digit, dec2flt_model.ModelU8IsAsciiDigit,
Slice.index_usize, whole, body]
simp only [if_pos hc]
rw [hloop]
simp [core.slice.index.SliceIndexRangeFromUsizeSlice.index,
Slice.drop, hp, hpCount, body, digitStep, hd]
| true =>
simp at hs
cases hd : digits with
| nil => simp_all
| cons c cs =>
have hsval : s.val = 45#u8 :: c :: cs := by simpa [hd] using hs
have tailProp : (c :: cs).length <= Usize.max := by
have h := s.property
rw [hsval] at h
simp at h ⊢
omega
let body : Slice Std.U8 := ⟨c :: cs, tailProp⟩
have hc := hdigits c (by rw [hd]; exact List.mem_cons_self)
have hall : forall b, List.Mem b body.val ->
48 <= b.val /\ b.val <= 57 := by
intro b hb
apply hdigits b
simpa [body, hd] using hb
obtain ⟨p, hloop, hp⟩ := Aeneas.Std.WP.spec_imp_exists
(loop_exact body hall)
rcases p with ⟨e, count⟩
have hpCount : count.val = (c :: cs).length := by
simpa [body, Slice.length] using hp.1
have heNonneg : 0 <= e.val := by rw [hp.2]; omega
have hnotmin : e.val ≠ IScalar.min .I64 := by
simp [IScalar.min, I64.min_eq]
omega
obtain ⟨ne, hneg, hne⟩ := Aeneas.Std.WP.spec_imp_exists
(HNeg.hNeg.step e hnotmin)
let whole : Slice Std.U8 := ⟨45#u8 :: c :: cs, by
simpa [hsval] using s.property⟩
have hseq : s = whole := (Slice.eq_iff _ _).2 hsval
rw [hseq]
simp [num.imp.dec2flt.parse.parse_scientific,
core.slice.Slice.split_first, dec2flt_model.ModelSliceSplitFirst,
core.num.U8.is_ascii_digit, dec2flt_model.ModelU8IsAsciiDigit,
Slice.index_usize, whole, body]
simp only [if_pos hc]
rw [hloop]
simp [hneg, core.slice.index.SliceIndexRangeFromUsizeSlice.index,
Slice.drop, hp, hpCount, hne, body, digitStep, hd]
end dec2flt_model
Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Inspect related source (47)
- parse_scientific · dec2flt/parse.rs:121 Program Rust
- parse_scientific_loop · dec2flt/parse.rs:142 Program Rust
- body · dec2flt/parse.rs:142 Program Rust
More program dependencies (14)
- from_u64 · dec2flt/mod.rs:263 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:52 Program Rust
- ByteSlice · dec2flt/common.rs:4 Program Rust
- Decimal · dec2flt/decimal.rs:32 Program Rust
- DecimalSeq · dec2flt/decimal_seq.rs:21 Program Rust
- CastInto · traits.rs:18 Program Rust
- Float · traits.rs:74 Program Rust
- FloatExt · traits.rs:170 Program Rust
- Int · traits.rs:27 Program Rust
Standard-library dependencies (30)
- is_ascii_digit · core/src/num/mod.rs:958 Rust library
- split_first · core/src/slice/mod.rs:198 Rust library
- 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
- 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
- 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.configured_x86_64_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
All 31 entries
- Binary64Model
- Binary64ModelDefault
- 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
- NumberHelperScientificExact
- Preamble
- core num FpCategory
- num imp dec2flt parse parse scientific
Technical checking records
Local closure summary
{
"node": "NumberHelperScientificExact",
"closure_version": "patch_c_v1",
"active_decl_hash": "451a9e6102fc1e9faea03560cbf43a5bf47562bf3e2fd101f6e24202cdba23fd",
"active_statement_hash": "9de86070ece56bae8a70ea4a0e7d908449950d9da70c77b9615da90ec97f9157",
"kernel_axioms": [
"Classical.choice",
"Dec2Flt.configured_x86_64_numBits",
"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-137",
"boundary_theorems": {},
"strict_theorem_deps": {
"ModelSliceSplitFirst": "f617ee05dd2925a9",
"num_imp_dec2flt_parse_parse_scientific": "ba81300a2601d639"
},
"strict_definition_deps": {
"ModelSliceSplitFirst": "4ed9c51a5bb9fb58",
"ModelU8IsAsciiDigit": "67d39fc6c37cfc41",
"Preamble": "956f3baee2191107",
"num_imp_dec2flt_parse_parse_scientific": "76b01b9377828a5f"
}
}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:329293bd87212a63f0420baddbc3ec8dfcc81d230b3848e09df23f9af1185971",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"substantiveness_status": "Pass"
}