Statement
This explanation was written alongside the formalization to describe the statement and its reasoning.
Lemma
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.Binary64AdjacentNormalValues
import Tablet.Binary64FiniteMagnitudeStrictMono
import Tablet.ModelU64BitAnd
import Tablet.F64
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxHeartbeats 1500000
set_option maxRecDepth 1000000
namespace dec2flt_model
-- [TABLET NODE: P873_T1_IntegerNormalRounds]
theorem P873_T1_IntegerNormalRounds
(x : Real) (G : Nat) (p : Std.I32)
(S64 Sf oneU : Std.U64) (pf : Std.I32)
(fp : num.imp.dec2flt.common.BiasedFp) (target : F64)
(hxpos : 0 < x) (hpPos : 0 < p.val)
(hGLower : 2 ^ 53 ≤ G) (hGUpper : G < 2 ^ 54)
(honeUval : oneU.val = 2 ^ 52)
(hSfPf :
(S64.val = 2 ^ 53 ∧ Sf = oneU ∧ pf.val = p.val + 1) ∨
(S64.val < 2 ^ 53 ∧ Sf = S64 ∧ pf = p))
(htargetAssembly : DecimalGoalVocabularyDefault.assembledWord fp target)
(hfinal :
(if pf ≥ 2047#i32 then
ok { m := 0#u64, p_biased := 2047#i32 }
else ok { m := Sf &&& ~~~oneU, p_biased := pf }) = ok fp) :
let lowSig : Nat := G / 2
let deltaR : Real := (2 : Real) ^ (p.val - 1076)
let ulpR : Real := (2 : Real) ^ (p.val - 1075)
let tieLow : Prop := x = (G : Real) * deltaR ∧ G % 4 = 1
let chooseHigh : Prop := G % 2 = 1 ∧ ¬ tieLow
let lowBits : Nat := p.val.toNat * 2 ^ 52 + (lowSig - 2 ^ 52)
S64.val = (if chooseHigh then lowSig + 1 else lowSig) →
(G : Real) * deltaR ≤ x →
x < ((G + 1 : Nat) : Real) * deltaR →
(lowSig : Real) * ulpR ≤ x →
x ≤ ((lowSig + 1 : Nat) : Real) * ulpR →
(¬ chooseHigh →
abs (x - (lowSig : Real) * ulpR) ≤
abs (x - ((lowSig + 1 : Nat) : Real) * ulpR)) →
(chooseHigh →
abs (x - ((lowSig + 1 : Nat) : Real) * ulpR) ≤
abs (x - (lowSig : Real) * ulpR)) →
(¬ chooseHigh →
abs (x - (lowSig : Real) * ulpR) =
abs (x - ((lowSig + 1 : Nat) : Real) * ulpR) →
lowBits % 2 = 0) →
(chooseHigh →
abs (x - ((lowSig + 1 : Nat) : Real) * ulpR) =
abs (x - (lowSig : Real) * ulpR) →
(lowBits + 1) % 2 = 0) →
DecimalGoalVocabularyDefault.roundsMagnitude 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
dsimp only
let lowSig : Nat := G / 2
let deltaR : Real := (2 : Real) ^ (p.val - 1076)
let ulpR : Real := (2 : Real) ^ (p.val - 1075)
let tieLow : Prop := x = (G : Real) * deltaR ∧ G % 4 = 1
let chooseHigh : Prop := G % 2 = 1 ∧ ¬ tieLow
let lowBits : Nat := p.val.toNat * 2 ^ 52 + (lowSig - 2 ^ 52)
intro hSchoice hxcellLo' hxcellHi' hLowX hXHigh hLowNear hHighNear
hTieLowEven hTieHighEven
have hLowSigLower : 2 ^ 52 ≤ lowSig := by
dsimp only [lowSig]
omega
have hLowSigUpper : lowSig < 2 ^ 53 := by
dsimp only [lowSig]
omega
have hSBounds : 2 ^ 52 ≤ S64.val ∧ S64.val ≤ 2 ^ 53 := by
rw [hSchoice]
split <;> omega
have hGdecomp : G = 2 * lowSig + G % 2 := by
dsimp only [lowSig]
omega
have hrem2 : G % 2 ≤ 1 := Nat.le_pred_of_lt (Nat.mod_lt _ (by omega))
let pNat : Nat := p.val.toNat
have hpNatCast : (pNat : Int) = p.val := Int.toNat_of_nonneg hpPos.le
let selectedBits : Nat := if chooseHigh then lowBits + 1 else lowBits
have clearHidden (z one : Std.U64) (hone : one.val = 2 ^ 52)
(hlo : 2 ^ 52 ≤ z.val) (hhi : z.val < 2 ^ 53) :
(z &&& ~~~one).val = z.val - 2 ^ 52 := by as_aux_lemma =>
have clear52Nat (n : Nat) (hnlo : 2 ^ 52 ≤ n) (hnhi : n < 2 ^ 53) :
n &&& (2 ^ 64 - 1 - 2 ^ 52) = n - 2 ^ 52 := by
let mask := 2 ^ 64 - 1 - 2 ^ 52
have hlandlt : n &&& mask < 2 ^ 53 :=
lt_of_le_of_lt Nat.and_le_left hnhi
have hm : mask % 2 ^ 53 = 2 ^ 52 - 1 := by norm_num [mask]
have hc := Nat.and_mod_two_pow (a := n) (b := mask) (n := 53)
rw [Nat.mod_eq_of_lt hlandlt, Nat.mod_eq_of_lt hnhi, hm,
Nat.and_two_pow_sub_one_eq_mod] at hc
have hloDiv : 1 ≤ n / 2 ^ 52 :=
(Nat.le_div_iff_mul_le (by positivity)).2 (by simpa using hnlo)
have hhiDiv : n / 2 ^ 52 < 2 :=
(Nat.div_lt_iff_lt_mul (by positivity)).2 (by simpa using hnhi)
have hdiv : n / 2 ^ 52 = 1 := by omega
have hd := Nat.div_add_mod n (2 ^ 52)
have hnmod : n % 2 ^ 52 = n - 2 ^ 52 := by omega
exact hc.trans hnmod
have oneEq : one = 4503599627370496#u64 := by
apply UScalar.eq_of_val_eq
norm_num at hone ⊢
exact hone
rw [oneEq]
change (z.bv &&& ~~~(BitVec.ofNat 64 4503599627370496)).toNat =
z.bv.toNat - 2 ^ 52
rw [BitVec.toNat_and, BitVec.toNat_not, BitVec.toNat_ofNat]
norm_num
exact clear52Nat z.val hlo hhi
have fieldOr (a ef : Nat) (ha : a < 2 ^ 52)
(hef : ef * 2 ^ 52 < 2 ^ 64) :
a ||| (ef * 2 ^ 52) = a + ef * 2 ^ 52 := by as_aux_lemma =>
have hland : a &&& (ef * 2 ^ 52) = 0 := by
apply Nat.eq_of_testBit_eq
intro j
rw [Nat.testBit_land, Nat.testBit_mul_two_pow]
by_cases hj : j < 52
· simp [hj]
· have haj : a.testBit j = false := by
apply Nat.testBit_eq_false_of_lt
exact lt_of_lt_of_le ha (Nat.pow_le_pow_right (by omega) (by omega))
simp [haj]
let av : BitVec 64 := BitVec.ofNat 64 a
let ev : BitVec 64 := BitVec.ofNat 64 (ef * 2 ^ 52)
have hlandBV : av &&& ev = 0#64 := by
apply BitVec.eq_of_toNat_eq
simp only [av, ev, BitVec.toNat_and, BitVec.toNat_ofNat]
rw [Nat.mod_eq_of_lt (ha.trans (by norm_num)), Nat.mod_eq_of_lt hef,
hland]
calc
a ||| (ef * 2 ^ 52) = (av ||| ev).toNat := by
simp only [av, ev, BitVec.toNat_or, BitVec.toNat_ofNat]
rw [Nat.mod_eq_of_lt (ha.trans (by norm_num)), Nat.mod_eq_of_lt hef]
_ = (av + ev).toNat := by
rw [BitVec.add_eq_or_of_and_eq_zero av ev hlandBV]
_ = a + ef * 2 ^ 52 := by
rw [BitVec.toNat_add_of_and_eq_zero hlandBV]
simp only [av, ev, BitVec.toNat_ofNat]
rw [Nat.mod_eq_of_lt (ha.trans (by norm_num)), Nat.mod_eq_of_lt hef]
let unit : Nat := 2 ^ 52
let top : Nat := 2047 * unit
let threshold : Real := (2 : Real) ^ (1024 : Nat) - (2 : Real) ^ (970 : Nat)
let value : Nat → Real := fun n =>
let field := n / unit
let fraction := n % unit
if field = 0 then (fraction : Real) / (2 : Real) ^ (1074 : Nat)
else if 1075 ≤ field then
((unit + fraction : Nat) : Real) * (2 : Real) ^ (field - 1075)
else ((unit + fraction : Nat) : Real) / (2 : Real) ^ (1075 - field)
have hvalueMono : ∀ a b : Nat, a < b → b < top → value a < value b := by
simpa only [unit, top, value] using Binary64FiniteMagnitudeStrictMono
have cellRounds : ∀ (t : F64) (low bits : Nat),
t.val = bits → low + 1 < top →
value low ≤ x → x ≤ value (low + 1) →
(bits = low ∨ bits = low + 1) →
(bits = low →
abs (x - value low) ≤ abs (x - value (low + 1))) →
(bits = low + 1 →
abs (x - value (low + 1)) ≤ abs (x - value low)) →
(bits = low →
abs (x - value low) = abs (x - value (low + 1)) → bits % 2 = 0) →
(bits = low + 1 →
abs (x - value (low + 1)) = abs (x - value low) → bits % 2 = 0) →
x < threshold →
DecimalGoalVocabularyDefault.roundsMagnitude x t := by as_aux_lemma =>
intro t low bits ht hlow hxl hxh hchoice hnearLow hnearHigh
htieLow htieHigh hthreshold
dsimp only [DecimalGoalVocabularyDefault]
change 0 ≤ x ∧ t.val ≤ top ∧
(if t.val = top then threshold ≤ x else x < threshold ∧
∀ v : F64, v.val < top → v ≠ t →
abs (x - value t.val) ≤ abs (x - value v.val) ∧
(abs (x - value t.val) = abs (x - value v.val) → t.val % 2 = 0))
have hbits : bits < top := by rcases hchoice with h | h <;> omega
have htBound : t.val < top := by omega
refine ⟨hxpos.le, htBound.le, ?_⟩
rw [if_neg (by omega)]
refine ⟨hthreshold, ?_⟩
intro v hv hne
have hvne : v.val ≠ bits := by
intro heq
apply hne
apply UScalar.eq_of_val_eq
omega
rcases hchoice with hbitsLow | hbitsHigh
· have htlow : t.val = low := ht.trans hbitsLow
rw [htlow]
have hnear := hnearLow hbitsLow
have htie := htieLow hbitsLow
by_cases hvBelow : v.val < low
· have hvValue : value v.val < value low :=
hvalueMono _ _ hvBelow (by omega)
have hvx : value v.val < x := hvValue.trans_le hxl
have hstrict : abs (x - value low) < abs (x - value v.val) := by
rw [abs_of_nonneg (sub_nonneg.mpr hxl),
abs_of_nonneg (sub_nonneg.mpr hvx.le)]
linarith
exact ⟨hstrict.le, fun heq => (ne_of_lt hstrict heq).elim⟩
· have hvAbove : low < v.val := by omega
have hhighLe : low + 1 ≤ v.val := by omega
have hhighValue : value (low + 1) ≤ value v.val := by
rcases hhighLe.eq_or_lt with heq | hlt
· exact le_of_eq (congrArg value heq)
· exact (hvalueMono _ _ hlt hv).le
have hxv : x ≤ value v.val := hxh.trans hhighValue
have hhighDist : abs (x - value (low + 1)) ≤
abs (x - value v.val) := by
rw [abs_of_nonpos (sub_nonpos.mpr hxh),
abs_of_nonpos (sub_nonpos.mpr hxv)]
linarith
constructor
· exact hnear.trans hhighDist
· intro heq
have hreverse : abs (x - value (low + 1)) ≤
abs (x - value low) := hhighDist.trans_eq heq.symm
have heqCell := le_antisymm hnear hreverse
simpa only [hbitsLow] using htie heqCell
· have hthigh : t.val = low + 1 := ht.trans hbitsHigh
rw [hthigh]
have hnear := hnearHigh hbitsHigh
have htie := htieHigh hbitsHigh
by_cases hvAbove : low + 1 < v.val
· have hvValue : value (low + 1) < value v.val :=
hvalueMono _ _ hvAbove hv
have hxv : x < value v.val := hxh.trans_lt hvValue
have hstrict : abs (x - value (low + 1)) < abs (x - value v.val) := by
rw [abs_of_nonpos (sub_nonpos.mpr hxh),
abs_of_nonpos (sub_nonpos.mpr hxv.le)]
linarith
exact ⟨hstrict.le, fun heq => (ne_of_lt hstrict heq).elim⟩
· have hvBelow : v.val < low + 1 := by omega
have hvLow : v.val ≤ low := by omega
have hvValue : value v.val ≤ value low := by
rcases hvLow.eq_or_lt with heq | hlt
· exact le_of_eq (congrArg value heq)
· exact (hvalueMono _ _ hlt (by omega)).le
have hvx : value v.val ≤ x := hvValue.trans hxl
have hlowDist : abs (x - value low) ≤ abs (x - value v.val) := by
rw [abs_of_nonneg (sub_nonneg.mpr hxl),
abs_of_nonneg (sub_nonneg.mpr hvx)]
linarith
constructor
· exact hnear.trans hlowDist
· intro heq
have hreverse : abs (x - value low) ≤
abs (x - value (low + 1)) := hlowDist.trans_eq heq.symm
have heqCell := le_antisymm hnear hreverse
simpa only [hbitsHigh] using htie heqCell
have hfpResult :
(pf ≥ 2047#i32 → fp = { m := 0#u64, p_biased := 2047#i32 }) ∧
(¬ pf ≥ 2047#i32 →
fp = { m := Sf &&& ~~~oneU, p_biased := pf }) := by as_aux_lemma =>
constructor
· intro hover
have hr := hfinal
simp only [hover, if_true] at hr
exact (Result.ok.inj hr).symm
· intro hover
have hr := hfinal
simp only [hover, if_false] at hr
exact (Result.ok.inj hr).symm
by_cases hover : pf ≥ 2047#i32
· as_aux_lemma =>
have hfpEq : fp = { m := 0#u64, p_biased := 2047#i32 } := hfpResult.1 hover
have htargetTop : target.val = top := by
subst fp
dsimp only [DecimalGoalVocabularyDefault] at htargetAssembly
dsimp only [top, unit]
norm_num [Int.toNat] at htargetAssembly ⊢
exact htargetAssembly
have hpfGe : 2047 ≤ pf.val := by
simpa only [IScalar.le_equiv] using hover
have hthreshold : threshold ≤ x := by
rcases hSfPf with hcarryCase | hplainCase
· have hpGe : 2046 ≤ p.val := by omega
have hchoose : chooseHigh := by
by_contra hn
rw [hSchoice, if_neg hn] at hcarryCase
omega
have hlowMax : lowSig = 2 ^ 53 - 1 := by
rw [hSchoice, if_pos hchoose] at hcarryCase
omega
have hGmax : G = 2 ^ 54 - 1 := by
have hodd := hchoose.1
omega
have hdelta970 : (2 : Real) ^ (970 : Nat) ≤ deltaR := by
dsimp only [deltaR]
rw [← zpow_natCast]
exact zpow_le_zpow_right₀ (by norm_num) (by omega)
have hbase : threshold = ((2 ^ 54 - 1 : Nat) : Real) *
(2 : Real) ^ (970 : Nat) := by
dsimp only [threshold]
rw [show (2 : Real) ^ (1024 : Nat) =
(2 : Real) ^ (54 : Nat) * (2 : Real) ^ (970 : Nat) by
rw [← pow_add]]
rw [Nat.cast_sub (by norm_num : 1 ≤ (2 : Nat) ^ 54),
Nat.cast_pow, Nat.cast_ofNat, Nat.cast_one, sub_mul, one_mul]
rw [hbase, ← hGmax]
exact (mul_le_mul_of_nonneg_left hdelta970 (by positivity)).trans hxcellLo'
· have hpGe : 2047 ≤ p.val := by
rcases hplainCase with ⟨_, _, heq⟩
have := congrArg IScalar.val heq
omega
have hdelta971 : (2 : Real) ^ (971 : Nat) ≤ deltaR := by
dsimp only [deltaR]
rw [← zpow_natCast]
exact zpow_le_zpow_right₀ (by norm_num) (by omega)
calc
threshold ≤ (2 : Real) ^ (1024 : Nat) := by
dsimp only [threshold]
exact sub_le_self _ (by positivity)
_ = (2 : Real) ^ (53 : Nat) * (2 : Real) ^ (971 : Nat) := by
rw [← pow_add]
_ ≤ (G : Real) * deltaR := by
exact mul_le_mul (by exact_mod_cast hGLower) hdelta971
(by positivity) (by positivity)
_ ≤ x := hxcellLo'
dsimp only [DecimalGoalVocabularyDefault]
change 0 ≤ x ∧ target.val ≤ top ∧
(if target.val = top then threshold ≤ x else _)
rw [htargetTop, if_pos rfl]
exact ⟨hxpos.le, le_rfl, hthreshold⟩
· have hfiniteData :
target.val = pf.val.toNat * unit + (Sf.val - unit) ∧
target.val = selectedBits ∧ Sf.val < 2 ^ 53 ∧
pf.val.toNat ≤ 2046 ∧ pNat ≤ 2046 ∧
lowBits + 1 ≤ top := by as_aux_lemma =>
have hfpEq : fp = { m := Sf &&& ~~~oneU, p_biased := pf } :=
hfpResult.2 hover
have hpfLt : pf.val < 2047 := by
have hn : ¬2047 ≤ pf.val := by
simpa only [IScalar.le_equiv] using hover
omega
have hpfPos : 0 < pf.val := by
rcases hSfPf with hcarryCase | hplainCase
· omega
· have heq := congrArg IScalar.val hplainCase.2.2
omega
have hSfRange : 2 ^ 52 ≤ Sf.val ∧ Sf.val < 2 ^ 53 := by as_aux_lemma =>
rcases hSfPf with hcarryCase | hplainCase
· rw [hcarryCase.2.1, honeUval]
norm_num
· rw [hplainCase.2.1]
exact ⟨hSBounds.1, hplainCase.1⟩
have hmVal : (Sf &&& ~~~oneU).val = Sf.val - 2 ^ 52 :=
clearHidden Sf oneU honeUval hSfRange.1 hSfRange.2
have hpfEmod : pf.val.emod (2 ^ 64) = pf.val := by
apply Int.emod_eq_of_lt hpfPos.le
omega
have hpfNatCast : (pf.val.toNat : Int) = pf.val :=
Int.toNat_of_nonneg hpfPos.le
have hpfNatUpper : pf.val.toNat ≤ 2046 := by
rw [Int.toNat_le]
omega
have htargetFormula : target.val =
pf.val.toNat * unit + (Sf.val - unit) := by
have ha := htargetAssembly
dsimp only [DecimalGoalVocabularyDefault] at ha
rw [hfpEq, hpfEmod] at ha
have hmBound : Sf.val - unit < 2 ^ 52 := by
dsimp only [unit]
omega
have heBound : pf.val.toNat * 2 ^ 52 < 2 ^ 64 := by omega
have hor := fieldOr (Sf.val - unit) pf.val.toNat hmBound heBound
dsimp only [unit] at ha hor ⊢
rw [Nat.mod_eq_of_lt heBound, hmVal] at ha
exact ha.trans (hor.trans (Nat.add_comm _ _))
have htargetSelected : target.val = selectedBits := by as_aux_lemma =>
rw [htargetFormula]
rcases hSfPf with hcarryCase | hplainCase
· have hchoose : chooseHigh := by
by_contra hn
rw [hSchoice, if_neg hn] at hcarryCase
omega
have hlowMax : lowSig = 2 ^ 53 - 1 := by
rw [hSchoice, if_pos hchoose] at hcarryCase
omega
rw [hcarryCase.2.1, honeUval]
have hpfEq : pf.val.toNat = pNat + 1 := by
apply Nat.cast_injective (R := Int)
rw [hpfNatCast, Nat.cast_add, Nat.cast_one, hpNatCast]
omega
rw [hpfEq]
dsimp only [selectedBits, lowBits, unit]
rw [if_pos hchoose]
omega
· have hpfEq : pf.val.toNat = pNat := by
apply Nat.cast_injective (R := Int)
rw [hpfNatCast, hpNatCast]
have heq := congrArg IScalar.val hplainCase.2.2
omega
rw [hplainCase.2.1, hSchoice, hpfEq]
dsimp only [selectedBits, lowBits, unit]
split <;> omega
have hpNatUpper : pNat ≤ 2046 := by as_aux_lemma =>
rcases hSfPf with hcarryCase | hplainCase
· have hi : (pNat : Int) ≤ 2046 := by
rw [hpNatCast]
omega
exact_mod_cast hi
· have heq := congrArg IScalar.val hplainCase.2.2
have hi : (pNat : Int) ≤ 2046 := by
rw [hpNatCast]
omega
exact_mod_cast hi
have hlowSuccLe : lowBits + 1 ≤ top := by
dsimp only [lowBits, top, unit]
omega
exact ⟨htargetFormula, htargetSelected, hSfRange.2, hpfNatUpper, hpNatUpper,
hlowSuccLe⟩
rcases hfiniteData with
⟨htargetFormula, htargetSelected, hSfUpper, hpfNatUpper, hpNatUpper,
hlowSuccLe⟩
by_cases hboundary : lowBits + 1 = top
· as_aux_lemma =>
have hpEq : pNat = 2046 := by
dsimp only [lowBits, top, unit] at hboundary
omega
have hlowMax : lowSig = 2 ^ 53 - 1 := by
dsimp only [lowBits, top, unit] at hboundary
omega
have htargetLt : target.val < top := by
rw [htargetFormula]
dsimp only [top, unit]
omega
have hselectedLt : selectedBits < top := by omega
have hnotChoose : ¬chooseHigh := by
intro hc
dsimp only [selectedBits] at hselectedLt
rw [if_pos hc, hboundary] at hselectedLt
omega
have htargetLow : target.val = lowBits := by
rw [htargetSelected]
dsimp only [selectedBits]
rw [if_neg hnotChoose]
have hGremZero : G % 2 = 0 := by
by_contra hnzero
have hm := Nat.mod_lt G (by omega : 0 < 2)
have hodd : G % 2 = 1 := by omega
have ht : tieLow := by
by_contra hnt
exact hnotChoose ⟨hodd, hnt⟩
have hG : G = 2 * lowSig + 1 := by omega
dsimp only [tieLow] at ht
rw [hG, hlowMax] at ht
norm_num at ht
have hGEq : G = 2 * lowSig := by omega
have hulp2046 : ulpR = (2 : Real) ^ (971 : Nat) := by
dsimp only [ulpR]
rw [← hpNatCast, hpEq]
norm_num
exact zpow_natCast (2 : Real) 971
have hrem : lowSig - unit < unit := by
dsimp only [unit]
omega
have hlowDiv : lowBits / unit = pNat := by
dsimp only [lowBits]
rw [Nat.mul_comm pNat unit, Nat.mul_add_div (by
dsimp only [unit]
positivity), Nat.div_eq_of_lt hrem, Nat.add_zero]
have hlowMod : lowBits % unit = lowSig - unit := by
dsimp only [lowBits]
rw [Nat.mul_comm pNat unit, Nat.mul_add_mod,
Nat.mod_eq_of_lt hrem]
have hvalueLowEq : value lowBits = (lowSig : Real) * ulpR := by
dsimp only [value]
rw [hlowDiv, hlowMod, if_neg (by omega), if_pos (by omega),
hulp2046]
have hsum : unit + (lowSig - unit) = lowSig := by
dsimp only [unit]
omega
rw [hsum, hpEq]
have hvalueLow : value lowBits ≤ x := by
rw [hvalueLowEq]
exact hLowX
have hdelta2046 : deltaR = (2 : Real) ^ (970 : Nat) := by
dsimp only [deltaR]
rw [← hpNatCast, hpEq]
norm_num
exact zpow_natCast (2 : Real) 970
have hbelow : x < threshold := by
have htopCell : ((G + 1 : Nat) : Real) * deltaR = threshold := by
rw [hGEq, hlowMax, hdelta2046]
dsimp only [threshold]
have heq : (2 : Real) ^ (1024 : Nat) =
(2 : Real) ^ (54 : Nat) * (2 : Real) ^ (970 : Nat) := by
rw [← pow_add]
rw [heq]
have hcoeff : ((2 * (2 ^ 53 - 1) + 1 : Nat) : Real) =
(2 : Real) ^ (54 : Nat) - 1 := by norm_num
rw [hcoeff, sub_mul, one_mul]
exact hxcellHi'.trans_eq htopCell
dsimp only [DecimalGoalVocabularyDefault]
change 0 ≤ x ∧ target.val ≤ top ∧
(if target.val = top then threshold ≤ x else x < threshold ∧
∀ v : F64, v.val < top → v ≠ target →
abs (x - value target.val) ≤ abs (x - value v.val) ∧
(abs (x - value target.val) = abs (x - value v.val) →
target.val % 2 = 0))
refine ⟨hxpos.le, htargetLt.le, ?_⟩
rw [if_neg (by omega)]
refine ⟨hbelow, ?_⟩
intro v hv hne
have hvne : v.val ≠ lowBits := by
intro heq
apply hne
apply UScalar.eq_of_val_eq
omega
have hvlt : v.val < lowBits := by
dsimp only [top, unit, lowBits] at hv hboundary ⊢
omega
have hvValue : value v.val < value lowBits :=
hvalueMono _ _ hvlt (by omega)
have hvx : value v.val < x := hvValue.trans_le hvalueLow
have hstrict : abs (x - value lowBits) < abs (x - value v.val) := by
rw [abs_of_nonneg (sub_nonneg.mpr hvalueLow),
abs_of_nonneg (sub_nonneg.mpr hvx.le)]
linarith
rw [htargetLow]
exact ⟨hstrict.le, fun heq => (ne_of_lt hstrict heq).elim⟩
· as_aux_lemma =>
have hlowTop : lowBits + 1 < top := by omega
have hAdjacent :
value lowBits = (lowSig : Real) * ulpR ∧
value (lowBits + 1) = ((lowSig + 1 : Nat) : Real) * ulpR := by
by_cases hpSmall : pNat ≤ 2045
· simpa only [unit, lowBits, value, ulpR, hpNatCast] using
(Binary64AdjacentNormalValues pNat lowSig
(by dsimp only [pNat]; omega) hpSmall hLowSigLower hLowSigUpper)
· have hpEq : pNat = 2046 := by omega
have hsigSucc : lowSig + 1 < 2 ^ 53 := by
dsimp only [lowBits, top, unit] at hlowTop
omega
have hrem : lowSig - unit < unit := by
dsimp only [unit]
omega
have hremSucc : lowSig + 1 - unit < unit := by
refine (Nat.sub_lt_iff_lt_add ?_).2 ?_
· exact (by simpa only [unit] using
hLowSigLower.trans (Nat.le_add_right lowSig 1))
· norm_num [unit] at hsigSucc ⊢
exact hsigSucc
have hlowDiv : lowBits / unit = pNat := by
dsimp only [lowBits]
rw [Nat.mul_comm pNat unit, Nat.mul_add_div (by
dsimp only [unit]
positivity)]
rw [Nat.div_eq_of_lt hrem, Nat.add_zero]
have hlowMod : lowBits % unit = lowSig - unit := by
dsimp only [lowBits]
rw [Nat.mul_comm pNat unit, Nat.mul_add_mod,
Nat.mod_eq_of_lt hrem]
have hhighEq : lowBits + 1 =
pNat * unit + (lowSig + 1 - unit) := by
dsimp only [lowBits, unit]
omega
have hhighDiv : (lowBits + 1) / unit = pNat := by
rw [hhighEq, Nat.mul_comm pNat unit,
Nat.mul_add_div (by dsimp only [unit]; positivity),
Nat.div_eq_of_lt hremSucc, Nat.add_zero]
have hhighMod : (lowBits + 1) % unit = lowSig + 1 - unit := by
rw [hhighEq, Nat.mul_comm pNat unit, Nat.mul_add_mod,
Nat.mod_eq_of_lt hremSucc]
have hulp2046 : ulpR = (2 : Real) ^ (971 : Nat) := by
dsimp only [ulpR]
rw [← hpNatCast, hpEq]
norm_num
exact zpow_natCast (2 : Real) 971
constructor
· dsimp only [value]
rw [hlowDiv, hlowMod, if_neg (by omega), if_pos (by omega),
hulp2046]
have hsum : unit + (lowSig - unit) = lowSig := by
dsimp only [unit]
omega
rw [hsum]
rw [hpEq]
· dsimp only [value]
rw [hhighDiv, hhighMod, if_neg (by omega), if_pos (by omega),
hulp2046]
have hsum : unit + (lowSig + 1 - unit) = lowSig + 1 := by
dsimp only [unit]
omega
rw [hsum]
rw [hpEq]
have hvalueLow : value lowBits ≤ x := by
rw [hAdjacent.1]
exact hLowX
have hvalueHigh : x ≤ value (lowBits + 1) := by
rw [hAdjacent.2]
exact hXHigh
have hchoice : selectedBits = lowBits ∨ selectedBits = lowBits + 1 := by
dsimp only [selectedBits]
split <;> simp
have hbelow : x < threshold := by
by_cases hpSmall : pNat ≤ 2045
· have hulpBound : ulpR ≤ (2 : Real) ^ (970 : Nat) := by
dsimp only [ulpR]
rw [← zpow_natCast]
apply zpow_le_zpow_right₀ (by norm_num)
rw [← hpNatCast]
have hi : (pNat : Int) ≤ 2045 := by exact_mod_cast hpSmall
omega
have hpow1023 : (2 : Real) ^ (1023 : Nat) < threshold := by
have hp : (2 : Real) ^ (970 : Nat) < (2 : Real) ^ (1023 : Nat) :=
pow_lt_pow_right₀ (by norm_num) (by omega)
have heq : (2 : Real) ^ (1024 : Nat) =
2 * (2 : Real) ^ (1023 : Nat) := by
rw [show 1024 = 1023 + 1 by omega, pow_succ]
ring
dsimp only [threshold]
rw [heq]
rw [show 2 * (2 : Real) ^ (1023 : Nat) -
(2 : Real) ^ (970 : Nat) =
(2 : Real) ^ (1023 : Nat) +
((2 : Real) ^ (1023 : Nat) - (2 : Real) ^ (970 : Nat)) by ring]
exact lt_add_of_pos_right _ (sub_pos.mpr hp)
calc
x ≤ ((lowSig + 1 : Nat) : Real) * ulpR := hXHigh
_ ≤ (2 : Real) ^ (53 : Nat) * (2 : Real) ^ (970 : Nat) := by
apply mul_le_mul
· exact_mod_cast (show lowSig + 1 ≤ 2 ^ 53 by omega)
· exact hulpBound
· dsimp only [ulpR]
exact (zpow_pos (by norm_num) _).le
· positivity
_ = (2 : Real) ^ (1023 : Nat) := by rw [← pow_add]
_ < threshold := hpow1023
· have hpEq : pNat = 2046 := by omega
have hulpEq2046 : ulpR = (2 : Real) ^ (971 : Nat) := by
dsimp only [ulpR]
rw [← hpNatCast, hpEq]
norm_num
exact zpow_natCast (2 : Real) 971
have hsigBound : lowSig + 1 ≤ 2 ^ 53 - 1 := by
dsimp only [lowBits, top, unit] at hlowTop
omega
have hmaxBelow : ((2 ^ 53 - 1 : Nat) : Real) *
(2 : Real) ^ (971 : Nat) < threshold := by
have hp : (0 : Real) < (2 : Real) ^ (970 : Nat) := by positivity
have heq1024 : (2 : Real) ^ (1024 : Nat) =
(2 : Real) ^ (54 : Nat) * (2 : Real) ^ (970 : Nat) := by
rw [← pow_add]
have heq971 : (2 : Real) ^ (971 : Nat) =
2 * (2 : Real) ^ (970 : Nat) := by
rw [show 971 = 970 + 1 by omega, pow_succ]
ring
dsimp only [threshold]
rw [heq1024, heq971]
push_cast
have h54 : (2 : Real) ^ (54 : Nat) = 18014398509481984 := by
norm_num
rw [h54]
calc
(9007199254740991 : Real) * (2 * (2 : Real) ^ (970 : Nat)) =
18014398509481982 * (2 : Real) ^ (970 : Nat) := by ring
_ < 18014398509481983 * (2 : Real) ^ (970 : Nat) :=
mul_lt_mul_of_pos_right (by norm_num) hp
_ = 18014398509481984 * (2 : Real) ^ (970 : Nat) -
(2 : Real) ^ (970 : Nat) := by ring
calc
x ≤ ((lowSig + 1 : Nat) : Real) * ulpR := hXHigh
_ ≤ ((2 ^ 53 - 1 : Nat) : Real) *
(2 : Real) ^ (971 : Nat) := by
rw [hulpEq2046]
exact mul_le_mul_of_nonneg_right (by exact_mod_cast hsigBound)
(by positivity)
_ < threshold := hmaxBelow
apply cellRounds target lowBits selectedBits htargetSelected hlowTop
hvalueLow hvalueHigh hchoice
· intro hsel
rw [hAdjacent.1, hAdjacent.2]
exact hLowNear (by
dsimp only [selectedBits] at hsel
by_contra hc
rw [if_pos hc] at hsel
omega)
· intro hsel
rw [hAdjacent.1, hAdjacent.2]
exact hHighNear (by
dsimp only [selectedBits] at hsel
by_contra hc
rw [if_neg hc] at hsel
omega)
· intro hsel heq
rw [hAdjacent.1, hAdjacent.2] at heq
have hc : ¬chooseHigh := by
dsimp only [selectedBits] at hsel
by_contra hc
rw [if_pos hc] at hsel
omega
rw [hsel]
exact hTieLowEven hc heq
· intro hsel heq
rw [hAdjacent.1, hAdjacent.2] at heq
have hc : chooseHigh := by
dsimp only [selectedBits] at hsel
by_contra hc
rw [if_neg hc] at hsel
omega
rw [hsel]
exact hTieHighEven hc heq
· exact hbelow
end dec2flt_model
Download Lean source · Download TeX source
Complete Lean module
import Tablet.DecimalGoalVocabularyDefault
import Tablet.Binary64AdjacentNormalValues
import Tablet.Binary64FiniteMagnitudeStrictMono
import Tablet.ModelU64BitAnd
import Tablet.F64
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxHeartbeats 1500000
set_option maxRecDepth 1000000
namespace dec2flt_model
-- [TABLET NODE: P873_T1_IntegerNormalRounds]
theorem P873_T1_IntegerNormalRounds
(x : Real) (G : Nat) (p : Std.I32)
(S64 Sf oneU : Std.U64) (pf : Std.I32)
(fp : num.imp.dec2flt.common.BiasedFp) (target : F64)
(hxpos : 0 < x) (hpPos : 0 < p.val)
(hGLower : 2 ^ 53 ≤ G) (hGUpper : G < 2 ^ 54)
(honeUval : oneU.val = 2 ^ 52)
(hSfPf :
(S64.val = 2 ^ 53 ∧ Sf = oneU ∧ pf.val = p.val + 1) ∨
(S64.val < 2 ^ 53 ∧ Sf = S64 ∧ pf = p))
(htargetAssembly : DecimalGoalVocabularyDefault.assembledWord fp target)
(hfinal :
(if pf ≥ 2047#i32 then
ok { m := 0#u64, p_biased := 2047#i32 }
else ok { m := Sf &&& ~~~oneU, p_biased := pf }) = ok fp) :
let lowSig : Nat := G / 2
let deltaR : Real := (2 : Real) ^ (p.val - 1076)
let ulpR : Real := (2 : Real) ^ (p.val - 1075)
let tieLow : Prop := x = (G : Real) * deltaR ∧ G % 4 = 1
let chooseHigh : Prop := G % 2 = 1 ∧ ¬ tieLow
let lowBits : Nat := p.val.toNat * 2 ^ 52 + (lowSig - 2 ^ 52)
S64.val = (if chooseHigh then lowSig + 1 else lowSig) →
(G : Real) * deltaR ≤ x →
x < ((G + 1 : Nat) : Real) * deltaR →
(lowSig : Real) * ulpR ≤ x →
x ≤ ((lowSig + 1 : Nat) : Real) * ulpR →
(¬ chooseHigh →
abs (x - (lowSig : Real) * ulpR) ≤
abs (x - ((lowSig + 1 : Nat) : Real) * ulpR)) →
(chooseHigh →
abs (x - ((lowSig + 1 : Nat) : Real) * ulpR) ≤
abs (x - (lowSig : Real) * ulpR)) →
(¬ chooseHigh →
abs (x - (lowSig : Real) * ulpR) =
abs (x - ((lowSig + 1 : Nat) : Real) * ulpR) →
lowBits % 2 = 0) →
(chooseHigh →
abs (x - ((lowSig + 1 : Nat) : Real) * ulpR) =
abs (x - (lowSig : Real) * ulpR) →
(lowBits + 1) % 2 = 0) →
DecimalGoalVocabularyDefault.roundsMagnitude x target := by
-- BODY
dsimp only
let lowSig : Nat := G / 2
let deltaR : Real := (2 : Real) ^ (p.val - 1076)
let ulpR : Real := (2 : Real) ^ (p.val - 1075)
let tieLow : Prop := x = (G : Real) * deltaR ∧ G % 4 = 1
let chooseHigh : Prop := G % 2 = 1 ∧ ¬ tieLow
let lowBits : Nat := p.val.toNat * 2 ^ 52 + (lowSig - 2 ^ 52)
intro hSchoice hxcellLo' hxcellHi' hLowX hXHigh hLowNear hHighNear
hTieLowEven hTieHighEven
have hLowSigLower : 2 ^ 52 ≤ lowSig := by
dsimp only [lowSig]
omega
have hLowSigUpper : lowSig < 2 ^ 53 := by
dsimp only [lowSig]
omega
have hSBounds : 2 ^ 52 ≤ S64.val ∧ S64.val ≤ 2 ^ 53 := by
rw [hSchoice]
split <;> omega
have hGdecomp : G = 2 * lowSig + G % 2 := by
dsimp only [lowSig]
omega
have hrem2 : G % 2 ≤ 1 := Nat.le_pred_of_lt (Nat.mod_lt _ (by omega))
let pNat : Nat := p.val.toNat
have hpNatCast : (pNat : Int) = p.val := Int.toNat_of_nonneg hpPos.le
let selectedBits : Nat := if chooseHigh then lowBits + 1 else lowBits
have clearHidden (z one : Std.U64) (hone : one.val = 2 ^ 52)
(hlo : 2 ^ 52 ≤ z.val) (hhi : z.val < 2 ^ 53) :
(z &&& ~~~one).val = z.val - 2 ^ 52 := by as_aux_lemma =>
have clear52Nat (n : Nat) (hnlo : 2 ^ 52 ≤ n) (hnhi : n < 2 ^ 53) :
n &&& (2 ^ 64 - 1 - 2 ^ 52) = n - 2 ^ 52 := by
let mask := 2 ^ 64 - 1 - 2 ^ 52
have hlandlt : n &&& mask < 2 ^ 53 :=
lt_of_le_of_lt Nat.and_le_left hnhi
have hm : mask % 2 ^ 53 = 2 ^ 52 - 1 := by norm_num [mask]
have hc := Nat.and_mod_two_pow (a := n) (b := mask) (n := 53)
rw [Nat.mod_eq_of_lt hlandlt, Nat.mod_eq_of_lt hnhi, hm,
Nat.and_two_pow_sub_one_eq_mod] at hc
have hloDiv : 1 ≤ n / 2 ^ 52 :=
(Nat.le_div_iff_mul_le (by positivity)).2 (by simpa using hnlo)
have hhiDiv : n / 2 ^ 52 < 2 :=
(Nat.div_lt_iff_lt_mul (by positivity)).2 (by simpa using hnhi)
have hdiv : n / 2 ^ 52 = 1 := by omega
have hd := Nat.div_add_mod n (2 ^ 52)
have hnmod : n % 2 ^ 52 = n - 2 ^ 52 := by omega
exact hc.trans hnmod
have oneEq : one = 4503599627370496#u64 := by
apply UScalar.eq_of_val_eq
norm_num at hone ⊢
exact hone
rw [oneEq]
change (z.bv &&& ~~~(BitVec.ofNat 64 4503599627370496)).toNat =
z.bv.toNat - 2 ^ 52
rw [BitVec.toNat_and, BitVec.toNat_not, BitVec.toNat_ofNat]
norm_num
exact clear52Nat z.val hlo hhi
have fieldOr (a ef : Nat) (ha : a < 2 ^ 52)
(hef : ef * 2 ^ 52 < 2 ^ 64) :
a ||| (ef * 2 ^ 52) = a + ef * 2 ^ 52 := by as_aux_lemma =>
have hland : a &&& (ef * 2 ^ 52) = 0 := by
apply Nat.eq_of_testBit_eq
intro j
rw [Nat.testBit_land, Nat.testBit_mul_two_pow]
by_cases hj : j < 52
· simp [hj]
· have haj : a.testBit j = false := by
apply Nat.testBit_eq_false_of_lt
exact lt_of_lt_of_le ha (Nat.pow_le_pow_right (by omega) (by omega))
simp [haj]
let av : BitVec 64 := BitVec.ofNat 64 a
let ev : BitVec 64 := BitVec.ofNat 64 (ef * 2 ^ 52)
have hlandBV : av &&& ev = 0#64 := by
apply BitVec.eq_of_toNat_eq
simp only [av, ev, BitVec.toNat_and, BitVec.toNat_ofNat]
rw [Nat.mod_eq_of_lt (ha.trans (by norm_num)), Nat.mod_eq_of_lt hef,
hland]
calc
a ||| (ef * 2 ^ 52) = (av ||| ev).toNat := by
simp only [av, ev, BitVec.toNat_or, BitVec.toNat_ofNat]
rw [Nat.mod_eq_of_lt (ha.trans (by norm_num)), Nat.mod_eq_of_lt hef]
_ = (av + ev).toNat := by
rw [BitVec.add_eq_or_of_and_eq_zero av ev hlandBV]
_ = a + ef * 2 ^ 52 := by
rw [BitVec.toNat_add_of_and_eq_zero hlandBV]
simp only [av, ev, BitVec.toNat_ofNat]
rw [Nat.mod_eq_of_lt (ha.trans (by norm_num)), Nat.mod_eq_of_lt hef]
let unit : Nat := 2 ^ 52
let top : Nat := 2047 * unit
let threshold : Real := (2 : Real) ^ (1024 : Nat) - (2 : Real) ^ (970 : Nat)
let value : Nat → Real := fun n =>
let field := n / unit
let fraction := n % unit
if field = 0 then (fraction : Real) / (2 : Real) ^ (1074 : Nat)
else if 1075 ≤ field then
((unit + fraction : Nat) : Real) * (2 : Real) ^ (field - 1075)
else ((unit + fraction : Nat) : Real) / (2 : Real) ^ (1075 - field)
have hvalueMono : ∀ a b : Nat, a < b → b < top → value a < value b := by
simpa only [unit, top, value] using Binary64FiniteMagnitudeStrictMono
have cellRounds : ∀ (t : F64) (low bits : Nat),
t.val = bits → low + 1 < top →
value low ≤ x → x ≤ value (low + 1) →
(bits = low ∨ bits = low + 1) →
(bits = low →
abs (x - value low) ≤ abs (x - value (low + 1))) →
(bits = low + 1 →
abs (x - value (low + 1)) ≤ abs (x - value low)) →
(bits = low →
abs (x - value low) = abs (x - value (low + 1)) → bits % 2 = 0) →
(bits = low + 1 →
abs (x - value (low + 1)) = abs (x - value low) → bits % 2 = 0) →
x < threshold →
DecimalGoalVocabularyDefault.roundsMagnitude x t := by as_aux_lemma =>
intro t low bits ht hlow hxl hxh hchoice hnearLow hnearHigh
htieLow htieHigh hthreshold
dsimp only [DecimalGoalVocabularyDefault]
change 0 ≤ x ∧ t.val ≤ top ∧
(if t.val = top then threshold ≤ x else x < threshold ∧
∀ v : F64, v.val < top → v ≠ t →
abs (x - value t.val) ≤ abs (x - value v.val) ∧
(abs (x - value t.val) = abs (x - value v.val) → t.val % 2 = 0))
have hbits : bits < top := by rcases hchoice with h | h <;> omega
have htBound : t.val < top := by omega
refine ⟨hxpos.le, htBound.le, ?_⟩
rw [if_neg (by omega)]
refine ⟨hthreshold, ?_⟩
intro v hv hne
have hvne : v.val ≠ bits := by
intro heq
apply hne
apply UScalar.eq_of_val_eq
omega
rcases hchoice with hbitsLow | hbitsHigh
· have htlow : t.val = low := ht.trans hbitsLow
rw [htlow]
have hnear := hnearLow hbitsLow
have htie := htieLow hbitsLow
by_cases hvBelow : v.val < low
· have hvValue : value v.val < value low :=
hvalueMono _ _ hvBelow (by omega)
have hvx : value v.val < x := hvValue.trans_le hxl
have hstrict : abs (x - value low) < abs (x - value v.val) := by
rw [abs_of_nonneg (sub_nonneg.mpr hxl),
abs_of_nonneg (sub_nonneg.mpr hvx.le)]
linarith
exact ⟨hstrict.le, fun heq => (ne_of_lt hstrict heq).elim⟩
· have hvAbove : low < v.val := by omega
have hhighLe : low + 1 ≤ v.val := by omega
have hhighValue : value (low + 1) ≤ value v.val := by
rcases hhighLe.eq_or_lt with heq | hlt
· exact le_of_eq (congrArg value heq)
· exact (hvalueMono _ _ hlt hv).le
have hxv : x ≤ value v.val := hxh.trans hhighValue
have hhighDist : abs (x - value (low + 1)) ≤
abs (x - value v.val) := by
rw [abs_of_nonpos (sub_nonpos.mpr hxh),
abs_of_nonpos (sub_nonpos.mpr hxv)]
linarith
constructor
· exact hnear.trans hhighDist
· intro heq
have hreverse : abs (x - value (low + 1)) ≤
abs (x - value low) := hhighDist.trans_eq heq.symm
have heqCell := le_antisymm hnear hreverse
simpa only [hbitsLow] using htie heqCell
· have hthigh : t.val = low + 1 := ht.trans hbitsHigh
rw [hthigh]
have hnear := hnearHigh hbitsHigh
have htie := htieHigh hbitsHigh
by_cases hvAbove : low + 1 < v.val
· have hvValue : value (low + 1) < value v.val :=
hvalueMono _ _ hvAbove hv
have hxv : x < value v.val := hxh.trans_lt hvValue
have hstrict : abs (x - value (low + 1)) < abs (x - value v.val) := by
rw [abs_of_nonpos (sub_nonpos.mpr hxh),
abs_of_nonpos (sub_nonpos.mpr hxv.le)]
linarith
exact ⟨hstrict.le, fun heq => (ne_of_lt hstrict heq).elim⟩
· have hvBelow : v.val < low + 1 := by omega
have hvLow : v.val ≤ low := by omega
have hvValue : value v.val ≤ value low := by
rcases hvLow.eq_or_lt with heq | hlt
· exact le_of_eq (congrArg value heq)
· exact (hvalueMono _ _ hlt (by omega)).le
have hvx : value v.val ≤ x := hvValue.trans hxl
have hlowDist : abs (x - value low) ≤ abs (x - value v.val) := by
rw [abs_of_nonneg (sub_nonneg.mpr hxl),
abs_of_nonneg (sub_nonneg.mpr hvx)]
linarith
constructor
· exact hnear.trans hlowDist
· intro heq
have hreverse : abs (x - value low) ≤
abs (x - value (low + 1)) := hlowDist.trans_eq heq.symm
have heqCell := le_antisymm hnear hreverse
simpa only [hbitsHigh] using htie heqCell
have hfpResult :
(pf ≥ 2047#i32 → fp = { m := 0#u64, p_biased := 2047#i32 }) ∧
(¬ pf ≥ 2047#i32 →
fp = { m := Sf &&& ~~~oneU, p_biased := pf }) := by as_aux_lemma =>
constructor
· intro hover
have hr := hfinal
simp only [hover, if_true] at hr
exact (Result.ok.inj hr).symm
· intro hover
have hr := hfinal
simp only [hover, if_false] at hr
exact (Result.ok.inj hr).symm
by_cases hover : pf ≥ 2047#i32
· as_aux_lemma =>
have hfpEq : fp = { m := 0#u64, p_biased := 2047#i32 } := hfpResult.1 hover
have htargetTop : target.val = top := by
subst fp
dsimp only [DecimalGoalVocabularyDefault] at htargetAssembly
dsimp only [top, unit]
norm_num [Int.toNat] at htargetAssembly ⊢
exact htargetAssembly
have hpfGe : 2047 ≤ pf.val := by
simpa only [IScalar.le_equiv] using hover
have hthreshold : threshold ≤ x := by
rcases hSfPf with hcarryCase | hplainCase
· have hpGe : 2046 ≤ p.val := by omega
have hchoose : chooseHigh := by
by_contra hn
rw [hSchoice, if_neg hn] at hcarryCase
omega
have hlowMax : lowSig = 2 ^ 53 - 1 := by
rw [hSchoice, if_pos hchoose] at hcarryCase
omega
have hGmax : G = 2 ^ 54 - 1 := by
have hodd := hchoose.1
omega
have hdelta970 : (2 : Real) ^ (970 : Nat) ≤ deltaR := by
dsimp only [deltaR]
rw [← zpow_natCast]
exact zpow_le_zpow_right₀ (by norm_num) (by omega)
have hbase : threshold = ((2 ^ 54 - 1 : Nat) : Real) *
(2 : Real) ^ (970 : Nat) := by
dsimp only [threshold]
rw [show (2 : Real) ^ (1024 : Nat) =
(2 : Real) ^ (54 : Nat) * (2 : Real) ^ (970 : Nat) by
rw [← pow_add]]
rw [Nat.cast_sub (by norm_num : 1 ≤ (2 : Nat) ^ 54),
Nat.cast_pow, Nat.cast_ofNat, Nat.cast_one, sub_mul, one_mul]
rw [hbase, ← hGmax]
exact (mul_le_mul_of_nonneg_left hdelta970 (by positivity)).trans hxcellLo'
· have hpGe : 2047 ≤ p.val := by
rcases hplainCase with ⟨_, _, heq⟩
have := congrArg IScalar.val heq
omega
have hdelta971 : (2 : Real) ^ (971 : Nat) ≤ deltaR := by
dsimp only [deltaR]
rw [← zpow_natCast]
exact zpow_le_zpow_right₀ (by norm_num) (by omega)
calc
threshold ≤ (2 : Real) ^ (1024 : Nat) := by
dsimp only [threshold]
exact sub_le_self _ (by positivity)
_ = (2 : Real) ^ (53 : Nat) * (2 : Real) ^ (971 : Nat) := by
rw [← pow_add]
_ ≤ (G : Real) * deltaR := by
exact mul_le_mul (by exact_mod_cast hGLower) hdelta971
(by positivity) (by positivity)
_ ≤ x := hxcellLo'
dsimp only [DecimalGoalVocabularyDefault]
change 0 ≤ x ∧ target.val ≤ top ∧
(if target.val = top then threshold ≤ x else _)
rw [htargetTop, if_pos rfl]
exact ⟨hxpos.le, le_rfl, hthreshold⟩
· have hfiniteData :
target.val = pf.val.toNat * unit + (Sf.val - unit) ∧
target.val = selectedBits ∧ Sf.val < 2 ^ 53 ∧
pf.val.toNat ≤ 2046 ∧ pNat ≤ 2046 ∧
lowBits + 1 ≤ top := by as_aux_lemma =>
have hfpEq : fp = { m := Sf &&& ~~~oneU, p_biased := pf } :=
hfpResult.2 hover
have hpfLt : pf.val < 2047 := by
have hn : ¬2047 ≤ pf.val := by
simpa only [IScalar.le_equiv] using hover
omega
have hpfPos : 0 < pf.val := by
rcases hSfPf with hcarryCase | hplainCase
· omega
· have heq := congrArg IScalar.val hplainCase.2.2
omega
have hSfRange : 2 ^ 52 ≤ Sf.val ∧ Sf.val < 2 ^ 53 := by as_aux_lemma =>
rcases hSfPf with hcarryCase | hplainCase
· rw [hcarryCase.2.1, honeUval]
norm_num
· rw [hplainCase.2.1]
exact ⟨hSBounds.1, hplainCase.1⟩
have hmVal : (Sf &&& ~~~oneU).val = Sf.val - 2 ^ 52 :=
clearHidden Sf oneU honeUval hSfRange.1 hSfRange.2
have hpfEmod : pf.val.emod (2 ^ 64) = pf.val := by
apply Int.emod_eq_of_lt hpfPos.le
omega
have hpfNatCast : (pf.val.toNat : Int) = pf.val :=
Int.toNat_of_nonneg hpfPos.le
have hpfNatUpper : pf.val.toNat ≤ 2046 := by
rw [Int.toNat_le]
omega
have htargetFormula : target.val =
pf.val.toNat * unit + (Sf.val - unit) := by
have ha := htargetAssembly
dsimp only [DecimalGoalVocabularyDefault] at ha
rw [hfpEq, hpfEmod] at ha
have hmBound : Sf.val - unit < 2 ^ 52 := by
dsimp only [unit]
omega
have heBound : pf.val.toNat * 2 ^ 52 < 2 ^ 64 := by omega
have hor := fieldOr (Sf.val - unit) pf.val.toNat hmBound heBound
dsimp only [unit] at ha hor ⊢
rw [Nat.mod_eq_of_lt heBound, hmVal] at ha
exact ha.trans (hor.trans (Nat.add_comm _ _))
have htargetSelected : target.val = selectedBits := by as_aux_lemma =>
rw [htargetFormula]
rcases hSfPf with hcarryCase | hplainCase
· have hchoose : chooseHigh := by
by_contra hn
rw [hSchoice, if_neg hn] at hcarryCase
omega
have hlowMax : lowSig = 2 ^ 53 - 1 := by
rw [hSchoice, if_pos hchoose] at hcarryCase
omega
rw [hcarryCase.2.1, honeUval]
have hpfEq : pf.val.toNat = pNat + 1 := by
apply Nat.cast_injective (R := Int)
rw [hpfNatCast, Nat.cast_add, Nat.cast_one, hpNatCast]
omega
rw [hpfEq]
dsimp only [selectedBits, lowBits, unit]
rw [if_pos hchoose]
omega
· have hpfEq : pf.val.toNat = pNat := by
apply Nat.cast_injective (R := Int)
rw [hpfNatCast, hpNatCast]
have heq := congrArg IScalar.val hplainCase.2.2
omega
rw [hplainCase.2.1, hSchoice, hpfEq]
dsimp only [selectedBits, lowBits, unit]
split <;> omega
have hpNatUpper : pNat ≤ 2046 := by as_aux_lemma =>
rcases hSfPf with hcarryCase | hplainCase
· have hi : (pNat : Int) ≤ 2046 := by
rw [hpNatCast]
omega
exact_mod_cast hi
· have heq := congrArg IScalar.val hplainCase.2.2
have hi : (pNat : Int) ≤ 2046 := by
rw [hpNatCast]
omega
exact_mod_cast hi
have hlowSuccLe : lowBits + 1 ≤ top := by
dsimp only [lowBits, top, unit]
omega
exact ⟨htargetFormula, htargetSelected, hSfRange.2, hpfNatUpper, hpNatUpper,
hlowSuccLe⟩
rcases hfiniteData with
⟨htargetFormula, htargetSelected, hSfUpper, hpfNatUpper, hpNatUpper,
hlowSuccLe⟩
by_cases hboundary : lowBits + 1 = top
· as_aux_lemma =>
have hpEq : pNat = 2046 := by
dsimp only [lowBits, top, unit] at hboundary
omega
have hlowMax : lowSig = 2 ^ 53 - 1 := by
dsimp only [lowBits, top, unit] at hboundary
omega
have htargetLt : target.val < top := by
rw [htargetFormula]
dsimp only [top, unit]
omega
have hselectedLt : selectedBits < top := by omega
have hnotChoose : ¬chooseHigh := by
intro hc
dsimp only [selectedBits] at hselectedLt
rw [if_pos hc, hboundary] at hselectedLt
omega
have htargetLow : target.val = lowBits := by
rw [htargetSelected]
dsimp only [selectedBits]
rw [if_neg hnotChoose]
have hGremZero : G % 2 = 0 := by
by_contra hnzero
have hm := Nat.mod_lt G (by omega : 0 < 2)
have hodd : G % 2 = 1 := by omega
have ht : tieLow := by
by_contra hnt
exact hnotChoose ⟨hodd, hnt⟩
have hG : G = 2 * lowSig + 1 := by omega
dsimp only [tieLow] at ht
rw [hG, hlowMax] at ht
norm_num at ht
have hGEq : G = 2 * lowSig := by omega
have hulp2046 : ulpR = (2 : Real) ^ (971 : Nat) := by
dsimp only [ulpR]
rw [← hpNatCast, hpEq]
norm_num
exact zpow_natCast (2 : Real) 971
have hrem : lowSig - unit < unit := by
dsimp only [unit]
omega
have hlowDiv : lowBits / unit = pNat := by
dsimp only [lowBits]
rw [Nat.mul_comm pNat unit, Nat.mul_add_div (by
dsimp only [unit]
positivity), Nat.div_eq_of_lt hrem, Nat.add_zero]
have hlowMod : lowBits % unit = lowSig - unit := by
dsimp only [lowBits]
rw [Nat.mul_comm pNat unit, Nat.mul_add_mod,
Nat.mod_eq_of_lt hrem]
have hvalueLowEq : value lowBits = (lowSig : Real) * ulpR := by
dsimp only [value]
rw [hlowDiv, hlowMod, if_neg (by omega), if_pos (by omega),
hulp2046]
have hsum : unit + (lowSig - unit) = lowSig := by
dsimp only [unit]
omega
rw [hsum, hpEq]
have hvalueLow : value lowBits ≤ x := by
rw [hvalueLowEq]
exact hLowX
have hdelta2046 : deltaR = (2 : Real) ^ (970 : Nat) := by
dsimp only [deltaR]
rw [← hpNatCast, hpEq]
norm_num
exact zpow_natCast (2 : Real) 970
have hbelow : x < threshold := by
have htopCell : ((G + 1 : Nat) : Real) * deltaR = threshold := by
rw [hGEq, hlowMax, hdelta2046]
dsimp only [threshold]
have heq : (2 : Real) ^ (1024 : Nat) =
(2 : Real) ^ (54 : Nat) * (2 : Real) ^ (970 : Nat) := by
rw [← pow_add]
rw [heq]
have hcoeff : ((2 * (2 ^ 53 - 1) + 1 : Nat) : Real) =
(2 : Real) ^ (54 : Nat) - 1 := by norm_num
rw [hcoeff, sub_mul, one_mul]
exact hxcellHi'.trans_eq htopCell
dsimp only [DecimalGoalVocabularyDefault]
change 0 ≤ x ∧ target.val ≤ top ∧
(if target.val = top then threshold ≤ x else x < threshold ∧
∀ v : F64, v.val < top → v ≠ target →
abs (x - value target.val) ≤ abs (x - value v.val) ∧
(abs (x - value target.val) = abs (x - value v.val) →
target.val % 2 = 0))
refine ⟨hxpos.le, htargetLt.le, ?_⟩
rw [if_neg (by omega)]
refine ⟨hbelow, ?_⟩
intro v hv hne
have hvne : v.val ≠ lowBits := by
intro heq
apply hne
apply UScalar.eq_of_val_eq
omega
have hvlt : v.val < lowBits := by
dsimp only [top, unit, lowBits] at hv hboundary ⊢
omega
have hvValue : value v.val < value lowBits :=
hvalueMono _ _ hvlt (by omega)
have hvx : value v.val < x := hvValue.trans_le hvalueLow
have hstrict : abs (x - value lowBits) < abs (x - value v.val) := by
rw [abs_of_nonneg (sub_nonneg.mpr hvalueLow),
abs_of_nonneg (sub_nonneg.mpr hvx.le)]
linarith
rw [htargetLow]
exact ⟨hstrict.le, fun heq => (ne_of_lt hstrict heq).elim⟩
· as_aux_lemma =>
have hlowTop : lowBits + 1 < top := by omega
have hAdjacent :
value lowBits = (lowSig : Real) * ulpR ∧
value (lowBits + 1) = ((lowSig + 1 : Nat) : Real) * ulpR := by
by_cases hpSmall : pNat ≤ 2045
· simpa only [unit, lowBits, value, ulpR, hpNatCast] using
(Binary64AdjacentNormalValues pNat lowSig
(by dsimp only [pNat]; omega) hpSmall hLowSigLower hLowSigUpper)
· have hpEq : pNat = 2046 := by omega
have hsigSucc : lowSig + 1 < 2 ^ 53 := by
dsimp only [lowBits, top, unit] at hlowTop
omega
have hrem : lowSig - unit < unit := by
dsimp only [unit]
omega
have hremSucc : lowSig + 1 - unit < unit := by
refine (Nat.sub_lt_iff_lt_add ?_).2 ?_
· exact (by simpa only [unit] using
hLowSigLower.trans (Nat.le_add_right lowSig 1))
· norm_num [unit] at hsigSucc ⊢
exact hsigSucc
have hlowDiv : lowBits / unit = pNat := by
dsimp only [lowBits]
rw [Nat.mul_comm pNat unit, Nat.mul_add_div (by
dsimp only [unit]
positivity)]
rw [Nat.div_eq_of_lt hrem, Nat.add_zero]
have hlowMod : lowBits % unit = lowSig - unit := by
dsimp only [lowBits]
rw [Nat.mul_comm pNat unit, Nat.mul_add_mod,
Nat.mod_eq_of_lt hrem]
have hhighEq : lowBits + 1 =
pNat * unit + (lowSig + 1 - unit) := by
dsimp only [lowBits, unit]
omega
have hhighDiv : (lowBits + 1) / unit = pNat := by
rw [hhighEq, Nat.mul_comm pNat unit,
Nat.mul_add_div (by dsimp only [unit]; positivity),
Nat.div_eq_of_lt hremSucc, Nat.add_zero]
have hhighMod : (lowBits + 1) % unit = lowSig + 1 - unit := by
rw [hhighEq, Nat.mul_comm pNat unit, Nat.mul_add_mod,
Nat.mod_eq_of_lt hremSucc]
have hulp2046 : ulpR = (2 : Real) ^ (971 : Nat) := by
dsimp only [ulpR]
rw [← hpNatCast, hpEq]
norm_num
exact zpow_natCast (2 : Real) 971
constructor
· dsimp only [value]
rw [hlowDiv, hlowMod, if_neg (by omega), if_pos (by omega),
hulp2046]
have hsum : unit + (lowSig - unit) = lowSig := by
dsimp only [unit]
omega
rw [hsum]
rw [hpEq]
· dsimp only [value]
rw [hhighDiv, hhighMod, if_neg (by omega), if_pos (by omega),
hulp2046]
have hsum : unit + (lowSig + 1 - unit) = lowSig + 1 := by
dsimp only [unit]
omega
rw [hsum]
rw [hpEq]
have hvalueLow : value lowBits ≤ x := by
rw [hAdjacent.1]
exact hLowX
have hvalueHigh : x ≤ value (lowBits + 1) := by
rw [hAdjacent.2]
exact hXHigh
have hchoice : selectedBits = lowBits ∨ selectedBits = lowBits + 1 := by
dsimp only [selectedBits]
split <;> simp
have hbelow : x < threshold := by
by_cases hpSmall : pNat ≤ 2045
· have hulpBound : ulpR ≤ (2 : Real) ^ (970 : Nat) := by
dsimp only [ulpR]
rw [← zpow_natCast]
apply zpow_le_zpow_right₀ (by norm_num)
rw [← hpNatCast]
have hi : (pNat : Int) ≤ 2045 := by exact_mod_cast hpSmall
omega
have hpow1023 : (2 : Real) ^ (1023 : Nat) < threshold := by
have hp : (2 : Real) ^ (970 : Nat) < (2 : Real) ^ (1023 : Nat) :=
pow_lt_pow_right₀ (by norm_num) (by omega)
have heq : (2 : Real) ^ (1024 : Nat) =
2 * (2 : Real) ^ (1023 : Nat) := by
rw [show 1024 = 1023 + 1 by omega, pow_succ]
ring
dsimp only [threshold]
rw [heq]
rw [show 2 * (2 : Real) ^ (1023 : Nat) -
(2 : Real) ^ (970 : Nat) =
(2 : Real) ^ (1023 : Nat) +
((2 : Real) ^ (1023 : Nat) - (2 : Real) ^ (970 : Nat)) by ring]
exact lt_add_of_pos_right _ (sub_pos.mpr hp)
calc
x ≤ ((lowSig + 1 : Nat) : Real) * ulpR := hXHigh
_ ≤ (2 : Real) ^ (53 : Nat) * (2 : Real) ^ (970 : Nat) := by
apply mul_le_mul
· exact_mod_cast (show lowSig + 1 ≤ 2 ^ 53 by omega)
· exact hulpBound
· dsimp only [ulpR]
exact (zpow_pos (by norm_num) _).le
· positivity
_ = (2 : Real) ^ (1023 : Nat) := by rw [← pow_add]
_ < threshold := hpow1023
· have hpEq : pNat = 2046 := by omega
have hulpEq2046 : ulpR = (2 : Real) ^ (971 : Nat) := by
dsimp only [ulpR]
rw [← hpNatCast, hpEq]
norm_num
exact zpow_natCast (2 : Real) 971
have hsigBound : lowSig + 1 ≤ 2 ^ 53 - 1 := by
dsimp only [lowBits, top, unit] at hlowTop
omega
have hmaxBelow : ((2 ^ 53 - 1 : Nat) : Real) *
(2 : Real) ^ (971 : Nat) < threshold := by
have hp : (0 : Real) < (2 : Real) ^ (970 : Nat) := by positivity
have heq1024 : (2 : Real) ^ (1024 : Nat) =
(2 : Real) ^ (54 : Nat) * (2 : Real) ^ (970 : Nat) := by
rw [← pow_add]
have heq971 : (2 : Real) ^ (971 : Nat) =
2 * (2 : Real) ^ (970 : Nat) := by
rw [show 971 = 970 + 1 by omega, pow_succ]
ring
dsimp only [threshold]
rw [heq1024, heq971]
push_cast
have h54 : (2 : Real) ^ (54 : Nat) = 18014398509481984 := by
norm_num
rw [h54]
calc
(9007199254740991 : Real) * (2 * (2 : Real) ^ (970 : Nat)) =
18014398509481982 * (2 : Real) ^ (970 : Nat) := by ring
_ < 18014398509481983 * (2 : Real) ^ (970 : Nat) :=
mul_lt_mul_of_pos_right (by norm_num) hp
_ = 18014398509481984 * (2 : Real) ^ (970 : Nat) -
(2 : Real) ^ (970 : Nat) := by ring
calc
x ≤ ((lowSig + 1 : Nat) : Real) * ulpR := hXHigh
_ ≤ ((2 ^ 53 - 1 : Nat) : Real) *
(2 : Real) ^ (971 : Nat) := by
rw [hulpEq2046]
exact mul_le_mul_of_nonneg_right (by exact_mod_cast hsigBound)
(by positivity)
_ < threshold := hmaxBelow
apply cellRounds target lowBits selectedBits htargetSelected hlowTop
hvalueLow hvalueHigh hchoice
· intro hsel
rw [hAdjacent.1, hAdjacent.2]
exact hLowNear (by
dsimp only [selectedBits] at hsel
by_contra hc
rw [if_pos hc] at hsel
omega)
· intro hsel
rw [hAdjacent.1, hAdjacent.2]
exact hHighNear (by
dsimp only [selectedBits] at hsel
by_contra hc
rw [if_neg hc] at hsel
omega)
· intro hsel heq
rw [hAdjacent.1, hAdjacent.2] at heq
have hc : ¬chooseHigh := by
dsimp only [selectedBits] at hsel
by_contra hc
rw [if_pos hc] at hsel
omega
rw [hsel]
exact hTieLowEven hc heq
· intro hsel heq
rw [hAdjacent.1, hAdjacent.2] at heq
have hc : chooseHigh := by
dsimp only [selectedBits] at hsel
by_contra hc
rw [if_neg hc] at hsel
omega
rw [hsel]
exact hTieHighEven hc heq
· exact hbelow
end dec2flt_model
Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Uses
Used by
Inspect related source (44)
- BiasedFp · dec2flt/common.rs:56 Program Rust
- Decimal · dec2flt/decimal.rs:32 Program Rust
- from_u64 · dec2flt/mod.rs:263 Program Rust
More program dependencies (11)
- 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
- ByteSlice · dec2flt/common.rs:4 Program Rust
- DecimalSeq · dec2flt/decimal_seq.rs:22 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)
- bitand · core/src/ops/bit.rs:178 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
- 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
- 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
Technical checking records
Local closure summary
{
"node": "P873_T1_IntegerNormalRounds",
"closure_version": "patch_c_v1",
"active_decl_hash": "dabcbeb04ef40b5a514b778f10cad29f05bd2d629e6cf41d7709b9029d9a17f2",
"active_statement_hash": "46e6fcf4224bf2c5fa19105ceaca9d24879f0fe112c917895e6931bc581b8f47",
"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-202",
"boundary_theorems": {},
"strict_theorem_deps": {
"Binary64AdjacentNormalValues": "8495001b4edafedb",
"Binary64FiniteMagnitudeStrictMono": "ea630fa702fb7b61",
"DecimalGoalVocabularyDefault": "2bbf2be48b5a4a4b"
},
"strict_definition_deps": {
"DecimalGoalVocabulary": "f76c8174a4d58eb5",
"DecimalGoalVocabularyDefault": "71a18a6c119a3cdc",
"F64": "ec4e25fbaf4e11d4",
"num_imp_dec2flt_common_BiasedFp": "c43614ff2149ecf2"
}
}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:c9788eb64afe01b8795094511bed09f31e602aeb5c17b9a2ff7304f46bcbd266",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass"
}