Statement
This explanation was written alongside the formalization to describe the statement and its reasoning.
Lemma · Full-significand exact transport through B
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.DecimalDigitTrimDecomposition
import Tablet.P472_T1_DecimalValueBounds
import Tablet.P616_T1_CutoffFoldComparison
import Tablet.P616_T1_BinaryDecimalSeparation
import Tablet.P616_T1_ExtremeRounding
import Tablet.ExponentValueAgreement
import Tablet.RoundingDeterminism
import Mathlib.Tactic.NormNum
import Mathlib.Tactic.Positivity
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: P616_T1_LexemeExactTransportB]
theorem P616_T1_LexemeExactTransportB (x : DecimalLexeme)
(hx : DecimalGoalVocabularyDefault.validNumeric x)
(hB : (DecimalGoalVocabularyDefault.renderNumeric x).length <= 576460752303421440) :
forall target : F64,
DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.accumulatedMagnitude x) target ↔
DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.exactMagnitude x) target := 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 S := x.integerDigits ++
match x.fractionDigits with | none => [] | some ds => ds
let f := match x.fractionDigits with | none => 0 | some ds => ds.length
let C := S.dropWhile (fun d => d == 0)
let M := C.foldl (fun n d => 10 * n + d) 0
have hSL : S.length <= (DecimalGoalVocabularyDefault.renderNumeric x).length := by
cases hf : x.fractionDigits <;>
simp only [S, DecimalGoalVocabularyDefault, hf, List.length_append,
List.length_map, List.length_nil, List.length_cons] <;> omega
have hCL : C.length <= 576460752303421440 :=
le_trans (List.length_dropWhile_le _ _) (le_trans hSL hB)
have hfL : f <= 576460752303421440 := by
have hsf : f <= S.length := by
cases hf : x.fractionDigits <;> simp [f, S, hf]
exact le_trans hsf (le_trans hSL hB)
have hfold (ds : List Nat) :
(ds.dropWhile (fun d => d == 0)).foldl (fun n d => 10 * n + d) 0 =
ds.foldl (fun n d => 10 * n + d) 0 := by
induction ds with
| nil => rfl
| cons d ds ih =>
by_cases hz : d = 0
· subst d; simpa using ih
· simp [List.dropWhile, beq_eq_false_iff_ne.mpr hz]
have hacc : DecimalGoalVocabularyDefault.accumulatedMagnitude x =
(M : Real) * (10 : Real) ^
(DecimalGoalVocabularyDefault.accumulatedExplicitExponent x - (f : Int)) := by
simp only [DecimalGoalVocabularyDefault]
cases hf : x.fractionDigits <;>
simp only [S, f, M, C, hf, hfold, List.append_nil, Nat.cast_zero]
have hexact : DecimalGoalVocabularyDefault.exactMagnitude x =
(M : Real) * (10 : Real) ^
(DecimalGoalVocabularyDefault.mathExplicitExponent x - (f : Int)) := by
simp only [DecimalGoalVocabularyDefault]
cases hf : x.fractionDigits <;>
simp only [S, f, M, C, hf, hfold, List.append_nil, Nat.cast_zero]
have hacc0 : 0 <= DecimalGoalVocabularyDefault.accumulatedMagnitude x := by
rw [hacc]
exact mul_nonneg (Nat.cast_nonneg _) (le_of_lt (zpow_pos (by norm_num) _))
have hexact0 : 0 <= DecimalGoalVocabularyDefault.exactMagnitude x := by
rw [hexact]
exact mul_nonneg (Nat.cast_nonneg _) (le_of_lt (zpow_pos (by norm_num) _))
have common (w : F64)
(ha : DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.accumulatedMagnitude x) w)
(hb : DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.exactMagnitude x) w) :
forall target : F64,
DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.accumulatedMagnitude x) target ↔
DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.exactMagnitude x) target := by
intro target
constructor
· intro ht
have heq := RoundingDeterminism _ target w hacc0 ht ha
simpa [heq] using hb
· intro ht
have heq := RoundingDeterminism _ target w hexact0 ht hb
simpa [heq] using ha
by_cases hC : C = []
· have hM : M = 0 := by simp [M, hC]
intro target
rw [hacc, hexact, hM]
simp only [Nat.cast_zero, zero_mul]
have hdS : ∀ d ∈ S, d < 10 := by
have hvalid := hx
dsimp only [DecimalGoalVocabularyDefault] at hvalid
intro d hd
obtain hi | hf := List.mem_append.mp hd
· exact hvalid.1 d hi
· cases hfrac : x.fractionDigits with
| none => simp [hfrac] at hf
| some ds =>
have hd : ∀ d ∈ ds, d < 10 := by simpa only [hfrac] using hvalid.2.1
exact hd d (by simpa only [hfrac] using hf)
have hdC : ∀ d ∈ C, d < 10 := fun d hd => hdS d (List.dropWhile_subset _ hd)
obtain ⟨z, zs, hc⟩ := List.exists_cons_of_ne_nil hC
have hz : 1 <= z := by
have hs := List.head_dropWhile_not (fun d => d == 0) (l := S) hC
have hh : C.head hC = z := by simp [hc]
change (C.head hC == 0) = false at hs
rw [hh] at hs
have hz0 : z ≠ 0 := by simpa using hs
omega
have hbnd (p : Int) :
(10 : Real) ^ (p - 1) <= (M : Real) * (10 : Real) ^ (p - (C.length : Int)) ∧
(M : Real) * (10 : Real) ^ (p - (C.length : Int)) < (10 : Real) ^ p := by
have hh := P472_T1_DecimalValueBounds C z zs hc hz hdC p
dsimp only at hh
have hzR : (1 : Real) <= z := by exact_mod_cast hz
have hpow := mul_le_mul_of_nonneg_right hzR
(le_of_lt (zpow_pos (show (0 : Real) < 10 by norm_num) (p - 1)))
refine ⟨?_, hh.2⟩
exact le_trans (by simpa only [one_mul] using hpow) hh.1
have hOver (p : Int) (hp : 2049 <= p) :
(2 : Real)^1024 - (2 : Real)^970 <=
(M : Real) * (10 : Real)^(p - (C.length : Int)) := by
have hbase : (2 : Real)^(1024 : Nat) < (10 : Real)^(309 : Nat) := by
exact_mod_cast P616_T1_BinaryDecimalSeparation.1
have hten : (10 : Real)^(309 : Nat) <= (10 : Real)^(p-1) := by
have hh := zpow_le_zpow_right₀ (show (1 : Real) <= 10 by norm_num)
(show (309 : Int) <= p - 1 by omega)
simpa only [zpow_natCast] using hh
exact le_trans (sub_le_self _ (by positivity))
(le_trans (le_of_lt hbase) (le_trans hten (hbnd p).1))
have hUnder (p : Int) (hp : p <= -2048) :
(M : Real) * (10 : Real)^(p - (C.length : Int)) <=
1 / (2 : Real)^(1075 : Nat) := by
have hbase : (2 : Real)^(1075 : Nat) < (10 : Real)^(325 : Nat) := by
exact_mod_cast P616_T1_BinaryDecimalSeparation.2
have hten := zpow_le_zpow_right₀ (show (1 : Real) <= 10 by norm_num)
(show p <= (-325 : Int) by omega)
have hinv : (10 : Real)^(-325 : Int) = 1 / (10 : Real)^(325 : Nat) := by
rw [zpow_neg, inv_eq_one_div]
rfl
have hrecip : 1 / (10 : Real)^(325 : Nat) < 1 / (2 : Real)^(1075 : Nat) :=
one_div_lt_one_div_of_lt (by positivity) hbase
exact le_of_lt (lt_trans (lt_of_lt_of_le (hbnd p).2 hten)
(by simpa only [hinv] using hrecip))
cases he : x.exponent with
| none =>
have heq : DecimalGoalVocabularyDefault.accumulatedExplicitExponent x =
DecimalGoalVocabularyDefault.mathExplicitExponent x := by
simp [DecimalGoalVocabularyDefault, he]
intro target
exact (ExponentValueAgreement x hx heq target).symm
| some exponent =>
obtain ⟨upper, sign, ds⟩ := exponent
let a := ds.foldl (fun n d => if n < 576460752303423488 then 10 * n + d else n) 0
let b := ds.foldl (fun n d => 10 * n + d) 0
have heacc : DecimalGoalVocabularyDefault.accumulatedExplicitExponent x =
if sign = some true then -(a : Int) else (a : Int) := by
cases sign with
| none => simp [DecimalGoalVocabularyDefault, he, a]
| some neg => cases neg <;> simp [DecimalGoalVocabularyDefault, he, a]
have hemath : DecimalGoalVocabularyDefault.mathExplicitExponent x =
if sign = some true then -(b : Int) else (b : Int) := by
cases sign with
| none => simp [DecimalGoalVocabularyDefault, he, b]
| some neg => cases neg <;> simp [DecimalGoalVocabularyDefault, he, b]
have hcFold := P616_T1_CutoffFoldComparison 576460752303423488 ds
change a <= b ∧ (a = b ∨ 576460752303423488 <= a) at hcFold
obtain ⟨hab, heq | hcap⟩ := hcFold
· have heqexp : DecimalGoalVocabularyDefault.accumulatedExplicitExponent x =
DecimalGoalVocabularyDefault.mathExplicitExponent x := by
rw [heacc, hemath, heq]
intro target
exact (ExponentValueAgreement x hx heqexp target).symm
· by_cases hneg : sign = some true
· let pa : Int := (C.length : Int) - f - a
let pb : Int := (C.length : Int) - f - b
have hpa : pa <= -2048 := by dsimp [pa]; omega
have hpb : pb <= -2048 := by dsimp [pb]; omega
have haccP : DecimalGoalVocabularyDefault.accumulatedMagnitude x =
(M : Real) * (10 : Real)^(pa - (C.length : Int)) := by
rw [hacc, heacc, if_pos hneg]
congr 1
congr 1
dsimp [pa]; omega
have hexactP : DecimalGoalVocabularyDefault.exactMagnitude x =
(M : Real) * (10 : Real)^(pb - (C.length : Int)) := by
rw [hexact, hemath, if_pos hneg]
congr 1
congr 1
dsimp [pb]; omega
apply common (0#u64)
· apply P616_T1_ExtremeRounding.2 _ hacc0
rw [haccP]
exact hUnder pa hpa
· apply P616_T1_ExtremeRounding.2 _ hexact0
rw [hexactP]
exact hUnder pb hpb
· let pa : Int := (C.length : Int) - f + a
let pb : Int := (C.length : Int) - f + b
have hn : 1 <= C.length := by rw [hc]; simp
have hpa : 2049 <= pa := by dsimp [pa]; omega
have hpb : 2049 <= pb := by dsimp [pb]; omega
have haccP : DecimalGoalVocabularyDefault.accumulatedMagnitude x =
(M : Real) * (10 : Real)^(pa - (C.length : Int)) := by
rw [hacc, heacc, if_neg hneg]
congr 1
congr 1
dsimp [pa]; omega
have hexactP : DecimalGoalVocabularyDefault.exactMagnitude x =
(M : Real) * (10 : Real)^(pb - (C.length : Int)) := by
rw [hexact, hemath, if_neg hneg]
congr 1
congr 1
dsimp [pb]; omega
apply common (9218868437227405312#u64)
· apply P616_T1_ExtremeRounding.1 _ hacc0
rw [haccP]
exact hOver pa hpa
· apply P616_T1_ExtremeRounding.1 _ hexact0
rw [hexactP]
exact hOver pb hpb
end dec2flt_model
Download Lean source · Download TeX source
Complete Lean module
import Tablet.DecimalGoalVocabularyDefault
import Tablet.DecimalDigitTrimDecomposition
import Tablet.P472_T1_DecimalValueBounds
import Tablet.P616_T1_CutoffFoldComparison
import Tablet.P616_T1_BinaryDecimalSeparation
import Tablet.P616_T1_ExtremeRounding
import Tablet.ExponentValueAgreement
import Tablet.RoundingDeterminism
import Mathlib.Tactic.NormNum
import Mathlib.Tactic.Positivity
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: P616_T1_LexemeExactTransportB]
theorem P616_T1_LexemeExactTransportB (x : DecimalLexeme)
(hx : DecimalGoalVocabularyDefault.validNumeric x)
(hB : (DecimalGoalVocabularyDefault.renderNumeric x).length <= 576460752303421440) :
forall target : F64,
DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.accumulatedMagnitude x) target ↔
DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.exactMagnitude x) target := by
-- BODY
let S := x.integerDigits ++
match x.fractionDigits with | none => [] | some ds => ds
let f := match x.fractionDigits with | none => 0 | some ds => ds.length
let C := S.dropWhile (fun d => d == 0)
let M := C.foldl (fun n d => 10 * n + d) 0
have hSL : S.length <= (DecimalGoalVocabularyDefault.renderNumeric x).length := by
cases hf : x.fractionDigits <;>
simp only [S, DecimalGoalVocabularyDefault, hf, List.length_append,
List.length_map, List.length_nil, List.length_cons] <;> omega
have hCL : C.length <= 576460752303421440 :=
le_trans (List.length_dropWhile_le _ _) (le_trans hSL hB)
have hfL : f <= 576460752303421440 := by
have hsf : f <= S.length := by
cases hf : x.fractionDigits <;> simp [f, S, hf]
exact le_trans hsf (le_trans hSL hB)
have hfold (ds : List Nat) :
(ds.dropWhile (fun d => d == 0)).foldl (fun n d => 10 * n + d) 0 =
ds.foldl (fun n d => 10 * n + d) 0 := by
induction ds with
| nil => rfl
| cons d ds ih =>
by_cases hz : d = 0
· subst d; simpa using ih
· simp [List.dropWhile, beq_eq_false_iff_ne.mpr hz]
have hacc : DecimalGoalVocabularyDefault.accumulatedMagnitude x =
(M : Real) * (10 : Real) ^
(DecimalGoalVocabularyDefault.accumulatedExplicitExponent x - (f : Int)) := by
simp only [DecimalGoalVocabularyDefault]
cases hf : x.fractionDigits <;>
simp only [S, f, M, C, hf, hfold, List.append_nil, Nat.cast_zero]
have hexact : DecimalGoalVocabularyDefault.exactMagnitude x =
(M : Real) * (10 : Real) ^
(DecimalGoalVocabularyDefault.mathExplicitExponent x - (f : Int)) := by
simp only [DecimalGoalVocabularyDefault]
cases hf : x.fractionDigits <;>
simp only [S, f, M, C, hf, hfold, List.append_nil, Nat.cast_zero]
have hacc0 : 0 <= DecimalGoalVocabularyDefault.accumulatedMagnitude x := by
rw [hacc]
exact mul_nonneg (Nat.cast_nonneg _) (le_of_lt (zpow_pos (by norm_num) _))
have hexact0 : 0 <= DecimalGoalVocabularyDefault.exactMagnitude x := by
rw [hexact]
exact mul_nonneg (Nat.cast_nonneg _) (le_of_lt (zpow_pos (by norm_num) _))
have common (w : F64)
(ha : DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.accumulatedMagnitude x) w)
(hb : DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.exactMagnitude x) w) :
forall target : F64,
DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.accumulatedMagnitude x) target ↔
DecimalGoalVocabularyDefault.roundsMagnitude
(DecimalGoalVocabularyDefault.exactMagnitude x) target := by
intro target
constructor
· intro ht
have heq := RoundingDeterminism _ target w hacc0 ht ha
simpa [heq] using hb
· intro ht
have heq := RoundingDeterminism _ target w hexact0 ht hb
simpa [heq] using ha
by_cases hC : C = []
· have hM : M = 0 := by simp [M, hC]
intro target
rw [hacc, hexact, hM]
simp only [Nat.cast_zero, zero_mul]
have hdS : ∀ d ∈ S, d < 10 := by
have hvalid := hx
dsimp only [DecimalGoalVocabularyDefault] at hvalid
intro d hd
obtain hi | hf := List.mem_append.mp hd
· exact hvalid.1 d hi
· cases hfrac : x.fractionDigits with
| none => simp [hfrac] at hf
| some ds =>
have hd : ∀ d ∈ ds, d < 10 := by simpa only [hfrac] using hvalid.2.1
exact hd d (by simpa only [hfrac] using hf)
have hdC : ∀ d ∈ C, d < 10 := fun d hd => hdS d (List.dropWhile_subset _ hd)
obtain ⟨z, zs, hc⟩ := List.exists_cons_of_ne_nil hC
have hz : 1 <= z := by
have hs := List.head_dropWhile_not (fun d => d == 0) (l := S) hC
have hh : C.head hC = z := by simp [hc]
change (C.head hC == 0) = false at hs
rw [hh] at hs
have hz0 : z ≠ 0 := by simpa using hs
omega
have hbnd (p : Int) :
(10 : Real) ^ (p - 1) <= (M : Real) * (10 : Real) ^ (p - (C.length : Int)) ∧
(M : Real) * (10 : Real) ^ (p - (C.length : Int)) < (10 : Real) ^ p := by
have hh := P472_T1_DecimalValueBounds C z zs hc hz hdC p
dsimp only at hh
have hzR : (1 : Real) <= z := by exact_mod_cast hz
have hpow := mul_le_mul_of_nonneg_right hzR
(le_of_lt (zpow_pos (show (0 : Real) < 10 by norm_num) (p - 1)))
refine ⟨?_, hh.2⟩
exact le_trans (by simpa only [one_mul] using hpow) hh.1
have hOver (p : Int) (hp : 2049 <= p) :
(2 : Real)^1024 - (2 : Real)^970 <=
(M : Real) * (10 : Real)^(p - (C.length : Int)) := by
have hbase : (2 : Real)^(1024 : Nat) < (10 : Real)^(309 : Nat) := by
exact_mod_cast P616_T1_BinaryDecimalSeparation.1
have hten : (10 : Real)^(309 : Nat) <= (10 : Real)^(p-1) := by
have hh := zpow_le_zpow_right₀ (show (1 : Real) <= 10 by norm_num)
(show (309 : Int) <= p - 1 by omega)
simpa only [zpow_natCast] using hh
exact le_trans (sub_le_self _ (by positivity))
(le_trans (le_of_lt hbase) (le_trans hten (hbnd p).1))
have hUnder (p : Int) (hp : p <= -2048) :
(M : Real) * (10 : Real)^(p - (C.length : Int)) <=
1 / (2 : Real)^(1075 : Nat) := by
have hbase : (2 : Real)^(1075 : Nat) < (10 : Real)^(325 : Nat) := by
exact_mod_cast P616_T1_BinaryDecimalSeparation.2
have hten := zpow_le_zpow_right₀ (show (1 : Real) <= 10 by norm_num)
(show p <= (-325 : Int) by omega)
have hinv : (10 : Real)^(-325 : Int) = 1 / (10 : Real)^(325 : Nat) := by
rw [zpow_neg, inv_eq_one_div]
rfl
have hrecip : 1 / (10 : Real)^(325 : Nat) < 1 / (2 : Real)^(1075 : Nat) :=
one_div_lt_one_div_of_lt (by positivity) hbase
exact le_of_lt (lt_trans (lt_of_lt_of_le (hbnd p).2 hten)
(by simpa only [hinv] using hrecip))
cases he : x.exponent with
| none =>
have heq : DecimalGoalVocabularyDefault.accumulatedExplicitExponent x =
DecimalGoalVocabularyDefault.mathExplicitExponent x := by
simp [DecimalGoalVocabularyDefault, he]
intro target
exact (ExponentValueAgreement x hx heq target).symm
| some exponent =>
obtain ⟨upper, sign, ds⟩ := exponent
let a := ds.foldl (fun n d => if n < 576460752303423488 then 10 * n + d else n) 0
let b := ds.foldl (fun n d => 10 * n + d) 0
have heacc : DecimalGoalVocabularyDefault.accumulatedExplicitExponent x =
if sign = some true then -(a : Int) else (a : Int) := by
cases sign with
| none => simp [DecimalGoalVocabularyDefault, he, a]
| some neg => cases neg <;> simp [DecimalGoalVocabularyDefault, he, a]
have hemath : DecimalGoalVocabularyDefault.mathExplicitExponent x =
if sign = some true then -(b : Int) else (b : Int) := by
cases sign with
| none => simp [DecimalGoalVocabularyDefault, he, b]
| some neg => cases neg <;> simp [DecimalGoalVocabularyDefault, he, b]
have hcFold := P616_T1_CutoffFoldComparison 576460752303423488 ds
change a <= b ∧ (a = b ∨ 576460752303423488 <= a) at hcFold
obtain ⟨hab, heq | hcap⟩ := hcFold
· have heqexp : DecimalGoalVocabularyDefault.accumulatedExplicitExponent x =
DecimalGoalVocabularyDefault.mathExplicitExponent x := by
rw [heacc, hemath, heq]
intro target
exact (ExponentValueAgreement x hx heqexp target).symm
· by_cases hneg : sign = some true
· let pa : Int := (C.length : Int) - f - a
let pb : Int := (C.length : Int) - f - b
have hpa : pa <= -2048 := by dsimp [pa]; omega
have hpb : pb <= -2048 := by dsimp [pb]; omega
have haccP : DecimalGoalVocabularyDefault.accumulatedMagnitude x =
(M : Real) * (10 : Real)^(pa - (C.length : Int)) := by
rw [hacc, heacc, if_pos hneg]
congr 1
congr 1
dsimp [pa]; omega
have hexactP : DecimalGoalVocabularyDefault.exactMagnitude x =
(M : Real) * (10 : Real)^(pb - (C.length : Int)) := by
rw [hexact, hemath, if_pos hneg]
congr 1
congr 1
dsimp [pb]; omega
apply common (0#u64)
· apply P616_T1_ExtremeRounding.2 _ hacc0
rw [haccP]
exact hUnder pa hpa
· apply P616_T1_ExtremeRounding.2 _ hexact0
rw [hexactP]
exact hUnder pb hpb
· let pa : Int := (C.length : Int) - f + a
let pb : Int := (C.length : Int) - f + b
have hn : 1 <= C.length := by rw [hc]; simp
have hpa : 2049 <= pa := by dsimp [pa]; omega
have hpb : 2049 <= pb := by dsimp [pb]; omega
have haccP : DecimalGoalVocabularyDefault.accumulatedMagnitude x =
(M : Real) * (10 : Real)^(pa - (C.length : Int)) := by
rw [hacc, heacc, if_neg hneg]
congr 1
congr 1
dsimp [pa]; omega
have hexactP : DecimalGoalVocabularyDefault.exactMagnitude x =
(M : Real) * (10 : Real)^(pb - (C.length : Int)) := by
rw [hexact, hemath, if_neg hneg]
congr 1
congr 1
dsimp [pb]; omega
apply common (9218868437227405312#u64)
· apply P616_T1_ExtremeRounding.1 _ hacc0
rw [haccP]
exact hOver pa hpa
· apply P616_T1_ExtremeRounding.1 _ hexact0
rw [hexactP]
exact hOver pb hpb
end dec2flt_model
Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Uses
Used by
Inspect related source (199)
- Dec2flt_modelNumImpDec2fltLemireU64 · dec2flt/mod.rs:217 Program Rust
- Dec2flt_modelNumImpTraitsFloatExtU64 · traits.rs:339 Program Rust
- biased_fp_to_float · dec2flt/mod.rs:282 Program Rust
More program dependencies (157)
- dec2flt · dec2flt/mod.rs:508 Program Rust
- dec2flt_with_trace · dec2flt/mod.rs:355 Program Rust
- try_fast_path · dec2flt/decimal.rs:59 Program Rust
- compute_float · dec2flt/lemire.rs:26 Program Rust
- parse_inf_nan · dec2flt/parse.rs:244 Program Rust
- parse_number · dec2flt/parse.rs:234 Program Rust
- parse_long_mantissa · dec2flt/slow.rs:27 Program Rust
- parse_long_mantissa_loop0 · dec2flt/slow.rs:51 Program Rust
- body · dec2flt/slow.rs:51 Program Rust
- parse_long_mantissa_loop1 · dec2flt/slow.rs:69 Program Rust
- body · dec2flt/slow.rs:69 Program Rust
- parse_long_mantissa_loop2 · dec2flt/slow.rs:94 Program Rust
- body · dec2flt/slow.rs:94 Program Rust
- MAX_EXPONENT_DISGUISED_FAST_PATH · dec2flt/mod.rs:220 Program Rust
- MAX_EXPONENT_FAST_PATH · dec2flt/mod.rs:219 Program Rust
- from_u64 · dec2flt/mod.rs:263 Program Rust
- pow10_fast_path · dec2flt/mod.rs:222 Program Rust
- from_u64_bits · traits.rs:341 Program Rust
- integer_decode · traits.rs:348 Program Rust
- Dec2flt_modelNumImpTraitsFloatU64 · traits.rs:309 Program Rust
- read_u64 · dec2flt/common.rs:22 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
- default · dec2flt/mod.rs:128 Program Rust
- default · dec2flt/mod.rs:121 Program Rust
- BiasedFp · dec2flt/common.rs:56 Program Rust
- eq · dec2flt/common.rs:55 Program Rust
- zero_pow2 · dec2flt/common.rs:66 Program Rust
- ByteSlice · dec2flt/common.rs:4 Program Rust
- Decimal · dec2flt/decimal.rs:32 Program Rust
- can_use_fast_path · dec2flt/decimal.rs:42 Program Rust
- INT_POW10 · dec2flt/decimal.rs:8 Program Rust
- DecimalSeq · dec2flt/decimal_seq.rs:22 Program Rust
- DECIMAL_POINT_RANGE · dec2flt/decimal_seq.rs:68 Program Rust
- left_shift · dec2flt/decimal_seq.rs:130 Program Rust
- left_shift_loop0 · dec2flt/decimal_seq.rs:139 Program Rust
- body · dec2flt/decimal_seq.rs:139 Program Rust
- left_shift_loop1 · dec2flt/decimal_seq.rs:153 Program Rust
- body · dec2flt/decimal_seq.rs:153 Program Rust
- right_shift · dec2flt/decimal_seq.rs:176 Program Rust
- right_shift_loop0 · dec2flt/decimal_seq.rs:181 Program Rust
- body · dec2flt/decimal_seq.rs:181 Program Rust
- right_shift_loop0_loop0 · dec2flt/decimal_seq.rs:191 Program Rust
- body · dec2flt/decimal_seq.rs:191 Program Rust
- right_shift_loop1 · dec2flt/decimal_seq.rs:210 Program Rust
- body · dec2flt/decimal_seq.rs:210 Program Rust
- right_shift_loop2 · dec2flt/decimal_seq.rs:217 Program Rust
- body · dec2flt/decimal_seq.rs:217 Program Rust
- round · dec2flt/decimal_seq.rs:97 Program Rust
- round_loop · dec2flt/decimal_seq.rs:107 Program Rust
- body · dec2flt/decimal_seq.rs:107 Program Rust
- parse_decimal_seq · dec2flt/decimal_seq.rs:288 Program Rust
- parse_decimal_seq_loop0 · dec2flt/decimal_seq.rs:296 Program Rust
- 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
- set_precision · dec2flt/fpu.rs:99 Program Rust
- compute_product_approx · dec2flt/lemire.rs:134 Program Rust
- power · dec2flt/lemire.rs:121 Program Rust
- parse_partial_number · dec2flt/parse.rs:164 Program Rust
- pfe_empty · dec2flt/mod.rs:270 Program Rust
- pfe_invalid · dec2flt/mod.rs:277 Program Rust
- MAX_SHIFT · dec2flt/slow.rs:28 Program Rust
- call · dec2flt/slow.rs:33 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
- BITS · traits.rs:319 Program Rust
- EXP_MASK · traits.rs:321 Program Rust
- INFINITY · traits.rs:312 Program Rust
- LARGEST_POWER_OF_TEN · traits.rs:327 Program Rust
- MAX_EXPONENT_ROUND_TO_EVEN · traits.rs:325 Program Rust
- MIN_EXPONENT_ROUND_TO_EVEN · traits.rs:324 Program Rust
- NAN · traits.rs:314 Program Rust
- NEG_INFINITY · traits.rs:313 Program Rust
- NEG_NAN · traits.rs:317 Program Rust
- SIG_MASK · traits.rs:322 Program Rust
- SIG_TOTAL_BITS · traits.rs:320 Program Rust
- SMALLEST_POWER_OF_TEN · traits.rs:328 Program Rust
- classify · traits.rs:334 Program Rust
- to_bits · traits.rs:330 Program Rust
- offset_from · dec2flt/common.rs:34 Program Rust
- write_u64 · dec2flt/common.rs:29 Program Rust
- Dec2flt_modelNumImpTraitsInt · traits.rs:51 Program Rust
- is_8digits · dec2flt/common.rs:44 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
- trim · dec2flt/decimal_seq.rs:83 Program Rust
- trim_loop · dec2flt/decimal_seq.rs:92 Program Rust
- body · dec2flt/decimal_seq.rs:92 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
- final_decimal_point · dec2flt/decimal_seq.rs:269 Program Rust
- number_of_digits_decimal_left_shift · dec2flt/decimal_seq.rs:375 Program Rust
- number_of_digits_decimal_left_shift_loop · dec2flt/decimal_seq.rs:441 Program Rust
- body · dec2flt/decimal_seq.rs:441 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
- full_multiplication · dec2flt/lemire.rs:126 Program Rust
- adjust_many_digit_count · dec2flt/parse.rs:86 Program Rust
- adjust_many_digit_count_loop · dec2flt/parse.rs:89 Program Rust
- body · dec2flt/parse.rs:89 Program Rust
- parse_many_digits · dec2flt/parse.rs:104 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
- try_parse_digits · dec2flt/parse.rs:30 Program Rust
- try_parse_digits_loop0 · dec2flt/parse.rs:33 Program Rust
- body · dec2flt/parse.rs:33 Program Rust
- try_parse_digits_loop1 · dec2flt/parse.rs:50 Program Rust
- body · dec2flt/parse.rs:50 Program Rust
- NUM_POWERS · dec2flt/slow.rs:29 Program Rust
- POWERS · dec2flt/slow.rs:30 Program Rust
- closure · dec2flt/slow.rs:33 Program Rust
- LARGEST_POWER_OF_FIVE · dec2flt/table.rs:10 Program Rust
- POWER_OF_FIVE_128 · dec2flt/table.rs:19 Program Rust
- SMALLEST_POWER_OF_FIVE · dec2flt/table.rs:9 Program Rust
- default · traits.rs:116 Program Rust
- default · traits.rs:104 Program Rust
- default · traits.rs:119 Program Rust
- default · traits.rs:110 Program Rust
- default · traits.rs:113 Program Rust
- default · traits.rs:101 Program Rust
- Dec2flt_modelNumImpTraitsCastIntoI16 · traits.rs:45 Program Rust
- ONE · traits.rs:53 Program Rust
- ZERO · traits.rs:52 Program Rust
- try_add_digit · dec2flt/decimal_seq.rs:74 Program Rust
- TABLE · dec2flt/decimal_seq.rs:377 Program Rust
- TABLE_POW5 · dec2flt/decimal_seq.rs:386 Program Rust
- MIN_19DIGIT_INT · dec2flt/parse.rs:8 Program Rust
- parse_8digits · dec2flt/parse.rs:18 Program Rust
- try_parse_19digits · dec2flt/parse.rs:61 Program Rust
- try_parse_19digits_loop · dec2flt/parse.rs:64 Program Rust
- body · dec2flt/parse.rs:64 Program Rust
- cast · traits.rs:46 Program Rust
- MASK · dec2flt/parse.rs:19 Program Rust
- MUL1 · dec2flt/parse.rs:20 Program Rust
- MUL2 · dec2flt/parse.rs:21 Program Rust
Standard-library dependencies (39)
- 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
- CoreOpsArithDivF64F64 · core/src/ops/arith.rs:511 Rust library
- CoreOpsArithMulF64F64 · core/src/ops/arith.rs:344 Rust library
- CoreOpsArithNegF64 · core/src/ops/arith.rs:713 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
- CoreMarkerCopy · core/src/marker.rs:57 Rust library
- CoreCloneClone · core/src/clone.rs:696 Rust library
- CoreOpsBitBitAndU64U64 · core/src/ops/bit.rs:174 Rust library
- CoreOpsBitBitOrU64U64 · core/src/ops/bit.rs:278 Rust library
- CoreOpsBitShlU32U64 · core/src/ops/bit.rs:483 Rust library
- CoreOpsBitShrU32U64 · core/src/ops/bit.rs:606 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
- 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
- Binary64FiniteMagnitudeStrictMono
- DecimalGoalVocabulary
- DecimalGoalVocabularyDefault
- DecimalLexeme
- ExponentValueAgreement
- F64
All 15 entries
- Binary64FiniteMagnitudeStrictMono
- DecimalGoalVocabulary
- DecimalGoalVocabularyDefault
- DecimalLexeme
- ExponentValueAgreement
- F64
- DecimalValueBounds
- BinaryDecimalSeparation
- CutoffFoldComparison
- ExtremeRounding
- LexemeExactTransportB
- DecimalFoldBounds
- RoundingDeterminism
- num imp dec2flt common BiasedFp
- num imp dec2flt decimal Decimal
Technical checking records
Local closure summary
{
"node": "P616_T1_LexemeExactTransportB",
"closure_version": "patch_c_v1",
"active_decl_hash": "f6618f5b87c2afe0a55626e98e3de827516015d3b0af5a2a3cb9b54b429a0298",
"active_statement_hash": "01bc932db26e437f235859ed87f7e1baec91b3ecf754dc05a9903e6df5a90fe3",
"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-181",
"boundary_theorems": {},
"strict_theorem_deps": {
"DecimalGoalVocabularyDefault": "94cb4c406f8efb78",
"ExponentValueAgreement": "4586adc775a37002",
"P472_T1_DecimalValueBounds": "4b5c924b5d52bc9d",
"P616_T1_BinaryDecimalSeparation": "d033f207ea8cdfae",
"P616_T1_CutoffFoldComparison": "b78dbd9d3d465fe8",
"P616_T1_ExtremeRounding": "23833a96cb991f3a",
"RoundingDeterminism": "6500074d31847e13"
},
"strict_definition_deps": {
"DecimalGoalVocabulary": "c08dd4b4aea4abb4",
"DecimalGoalVocabularyDefault": "55eb6bce0e8a4131",
"DecimalLexeme": "8127b3eaeae00dd2",
"F64": "ec4e25fbaf4e11d4",
"num_imp_dec2flt_common_BiasedFp": "c43614ff2149ecf2",
"num_imp_dec2flt_decimal_Decimal": "63fd2f021dd0ef41"
}
}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:8a72ab481ed012d65a63cee19ec259cdf5be784d518f526c4e47677b9cd3772e",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"substantiveness_status": "Pass"
}