Statement
This explanation was written alongside the formalization to describe the statement and its reasoning.
Lemma · Exact many-digit adjustment
isize,
and let P,T be byte lists such that
s.\mathsf{val}=P\mathbin{\texttt{++}}T. Suppose every byte in P is either
48 or 46, and suppose either T=[] or
T=b::R for some byte b and byte list R with b\ne48 and b\ne46.
Assume
isize a such that
Lean statement
Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.
import Tablet.num_imp_dec2flt_parse_adjust_many_digit_count
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: NumberHelperAdjustManyExact]
theorem NumberHelperAdjustManyExact
(start : Slice Std.U8) (n : Std.Isize)
(zeroPrefix tail : List Std.U8)
(hstart : start.val = zeroPrefix ++ tail)
(hprefix : forall b, List.Mem b zeroPrefix -> b = 48#u8 \/ b = 46#u8)
(htail : tail = [] \/ exists b rest, tail = b :: rest /\
b ≠ 48#u8 /\ b ≠ 46#u8)
(hlen : start.val.length <= 9223372036854775807)
(hnonneg : 0 <= n.val) (hnle : n.val <= start.val.length)
(hlower : IScalar.min .Isize <= n.val - (zeroPrefix.count 48#u8 : Int)) :
exists adjusted,
num.imp.dec2flt.parse.adjust_many_digit_count start n = ok adjusted /\
adjusted.val = n.val - (zeroPrefix.count 48#u8 : 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
have hloop : num.imp.dec2flt.parse.adjust_many_digit_count_loop
start n 0#usize true ⦃ adjusted =>
adjusted.val = n.val - (zeroPrefix.count 48#u8 : Int) ⦄ := by
unfold num.imp.dec2flt.parse.adjust_many_digit_count_loop
apply Aeneas.Std.loop.spec_decr_nat
(fun p : Std.Isize × Std.Usize × Bool =>
2 * (start.val.length - p.2.1.val) + if p.2.2 then 1 else 0)
(fun p =>
(p.2.2 = true /\ exists consumed remaining,
zeroPrefix = consumed ++ remaining /\
p.2.1.val = consumed.length /\
p.1.val = n.val - (consumed.count 48#u8 : Int)) \/
(p.2.2 = false /\ p.1.val =
n.val - (zeroPrefix.count 48#u8 : Int)))
(fun adjusted => adjusted.val =
n.val - (zeroPrefix.count 48#u8 : Int))
(fun p => num.imp.dec2flt.parse.adjust_many_digit_count_loop.body
start p.1 p.2.1 p.2.2)
(n, 0#usize, true)
· intro p hp
rcases p with ⟨count, index, scanning⟩
rcases hp with hscan | hdone
· rcases hscan with
⟨hscanning, consumed, remaining, hpart, hindex, hcount⟩
simp only [Prod.fst, Prod.snd] at hscanning hindex hcount ⊢
cases scanning <;> simp at hscanning
cases remaining with
| nil =>
have hconsumed : consumed = zeroPrefix := by
simpa using hpart.symm
subst consumed
rcases htail with htailnil | ⟨b, rest, htaileq, hb48, hb46⟩
· subst tail
have houtside : Not (index.val < start.val.length) := by
rw [hstart, hindex]
simp
simp [num.imp.dec2flt.parse.adjust_many_digit_count_loop.body,
WP.spec_ok, houtside, hcount]
· have hinside : index.val < start.val.length := by
rw [hstart, htaileq, hindex]
simp
have hread : Slice.index_usize start index = ok b := by
simp [Slice.index_usize, hstart, htaileq, hindex]
simp [num.imp.dec2flt.parse.adjust_many_digit_count_loop.body,
WP.spec_ok, hinside, hread, hb48, hb46]
exact hcount
| cons b rest =>
have hbmem : List.Mem b zeroPrefix := by
rw [hpart]
exact List.mem_append_right _ List.mem_cons_self
rcases hprefix b hbmem with hbzero | hbpoint
· subst b
have hinside : index.val < start.val.length := by
rw [hstart, hpart, hindex]
simp
have hread : Slice.index_usize start index = ok 48#u8 := by
simp [Slice.index_usize, hstart, hpart, hindex]
simp [num.imp.dec2flt.parse.adjust_many_digit_count_loop.body,
WP.spec_ok, hinside, hread]
rw [show (48#u8 - 1#u8) = ok 47#u8 by rfl]
change (do
let digit ← lift (core.num.U8.saturating_sub 48#u8 47#u8)
let digit' ← lift (UScalar.hcast .Isize digit)
let count1 ← count - digit'
let index1 ← index + 1#usize
ok (cont (count1, index1, true))) ⦃ _ ⦄
rw [show lift (core.num.U8.saturating_sub 48#u8 47#u8) =
ok 1#u8 by rfl]
have hcast1 : UScalar.hcast .Isize 1#u8 = 1#isize := by
apply IScalar.eq_of_val_eq
have h := UScalar.hcast_inBounds_spec .Isize (1#u8)
(by scalar_tac)
simpa [Aeneas.Std.lift, WP.spec_ok] using h
change (do
let digit' ← lift (UScalar.hcast .Isize 1#u8)
let count1 ← count - digit'
let index1 ← index + 1#usize
ok (cont (count1, index1, true))) ⦃ _ ⦄
rw [hcast1]
have hremainingCount :
(zeroPrefix.count 48#u8 : Int) =
(consumed.count 48#u8 : Int) + 1 +
(rest.count 48#u8 : Int) := by
rw [hpart, List.count_append]
simp
omega
have hsublo : IScalar.min .Isize <=
count.val - (1#isize).val := by
simp [IScalar.min, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits] at hlower ⊢
rw [hremainingCount] at hlower
rw [hcount]
omega
have hsubhi : count.val - (1#isize).val <=
IScalar.max .Isize := by
simp [IScalar.max, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits]
rw [hcount]
have hlen' : (start.val.length : Int) <=
9223372036854775807 := by exact_mod_cast hlen
have hnupper : n.val <= 9223372036854775807 := by
exact le_trans hnle hlen'
omega
obtain ⟨count1, hcount1, hcount1val⟩ :=
Aeneas.Std.WP.spec_imp_exists
(IScalar.sub_spec (x := count) (y := 1#isize)
(by simpa using hsublo) (by simpa using hsubhi))
rw [show lift (1#isize) = ok 1#isize by rfl]
simp only [bind_tc_ok]
rw [hcount1]
have hadd : index.val + 1 <= UScalar.max .Usize := by
have hbits := Dec2Flt.configured_x86_64_numBits
simp [UScalar.max, hbits]
rw [hstart, hpart] at hlen
simp only [List.length_append, List.length_cons] at hlen
omega
obtain ⟨index1, hindex1, hindex1val⟩ :=
Aeneas.Std.WP.spec_imp_exists
(UScalar.add_spec (x := index) (y := 1#usize) hadd)
rw [hindex1]
simp [WP.spec_ok]
constructor
· refine ⟨consumed ++ [48#u8], ?_, ?_, ?_⟩
· exact ⟨rest, by simpa [List.append_assoc] using hpart⟩
· norm_num at hindex1val
simp [hindex]
omega
· norm_num at hcount1val
simp [hcount]
omega
· norm_num at hindex1val
omega
· subst b
have hinside : index.val < start.val.length := by
rw [hstart, hpart, hindex]
simp
have hread : Slice.index_usize start index = ok 46#u8 := by
simp [Slice.index_usize, hstart, hpart, hindex]
simp [num.imp.dec2flt.parse.adjust_many_digit_count_loop.body,
WP.spec_ok, hinside, hread]
rw [show (48#u8 - 1#u8) = ok 47#u8 by rfl]
change (do
let digit ← lift (core.num.U8.saturating_sub 46#u8 47#u8)
let digit' ← lift (UScalar.hcast .Isize digit)
let count1 ← count - digit'
let index1 ← index + 1#usize
ok (cont (count1, index1, true))) ⦃ _ ⦄
rw [show lift (core.num.U8.saturating_sub 46#u8 47#u8) =
ok 0#u8 by rfl]
have hcast0 : UScalar.hcast .Isize 0#u8 = 0#isize := by
apply IScalar.eq_of_val_eq
have h := UScalar.hcast_inBounds_spec .Isize (0#u8)
(by scalar_tac)
simpa [Aeneas.Std.lift, WP.spec_ok] using h
change (do
let digit' ← lift (UScalar.hcast .Isize 0#u8)
let count1 ← count - digit'
let index1 ← index + 1#usize
ok (cont (count1, index1, true))) ⦃ _ ⦄
rw [hcast0]
have hsublo : IScalar.min .Isize <=
count.val - (0#isize).val := by
have hc := IScalar.hBounds count
simp [IScalar.min, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits] at hc ⊢
omega
have hsubhi : count.val - (0#isize).val <=
IScalar.max .Isize := by
have hc := IScalar.hBounds count
simp [IScalar.max, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits] at hc ⊢
omega
obtain ⟨count1, hcount1, hcount1val⟩ :=
Aeneas.Std.WP.spec_imp_exists
(IScalar.sub_spec (x := count) (y := 0#isize)
(by simpa using hsublo) (by simpa using hsubhi))
rw [show lift (0#isize) = ok 0#isize by rfl]
simp only [bind_tc_ok]
rw [hcount1]
have hadd : index.val + 1 <= UScalar.max .Usize := by
have hbits := Dec2Flt.configured_x86_64_numBits
simp [UScalar.max, hbits]
rw [hstart, hpart] at hlen
simp only [List.length_append, List.length_cons] at hlen
omega
obtain ⟨index1, hindex1, hindex1val⟩ :=
Aeneas.Std.WP.spec_imp_exists
(UScalar.add_spec (x := index) (y := 1#usize) hadd)
rw [hindex1]
simp [WP.spec_ok]
constructor
· refine ⟨consumed ++ [46#u8], ?_, ?_, ?_⟩
· exact ⟨rest, by simpa [List.append_assoc] using hpart⟩
· norm_num at hindex1val
simp [hindex]
omega
· norm_num at hcount1val
rw [hcount1val, hcount]
simp
· norm_num at hindex1val
omega
· rcases hdone with ⟨hscanning, hcount⟩
simp only [Prod.fst, Prod.snd] at hscanning hcount ⊢
cases scanning <;> simp at hscanning
simp [num.imp.dec2flt.parse.adjust_many_digit_count_loop.body,
WP.spec_ok, hcount]
· refine Or.inl ⟨rfl, [], zeroPrefix, by simp, by simp, ?_⟩
simpa using rfl
obtain ⟨adjusted, hadjusted, hvalue⟩ :=
Aeneas.Std.WP.spec_imp_exists hloop
refine ⟨adjusted, ?_, hvalue⟩
simpa [num.imp.dec2flt.parse.adjust_many_digit_count] using hadjusted
end dec2flt_model
Download Lean source · Download TeX source
Complete Lean module
import Tablet.num_imp_dec2flt_parse_adjust_many_digit_count
open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
namespace dec2flt_model
-- [TABLET NODE: NumberHelperAdjustManyExact]
theorem NumberHelperAdjustManyExact
(start : Slice Std.U8) (n : Std.Isize)
(zeroPrefix tail : List Std.U8)
(hstart : start.val = zeroPrefix ++ tail)
(hprefix : forall b, List.Mem b zeroPrefix -> b = 48#u8 \/ b = 46#u8)
(htail : tail = [] \/ exists b rest, tail = b :: rest /\
b ≠ 48#u8 /\ b ≠ 46#u8)
(hlen : start.val.length <= 9223372036854775807)
(hnonneg : 0 <= n.val) (hnle : n.val <= start.val.length)
(hlower : IScalar.min .Isize <= n.val - (zeroPrefix.count 48#u8 : Int)) :
exists adjusted,
num.imp.dec2flt.parse.adjust_many_digit_count start n = ok adjusted /\
adjusted.val = n.val - (zeroPrefix.count 48#u8 : Int) := by
-- BODY
have hloop : num.imp.dec2flt.parse.adjust_many_digit_count_loop
start n 0#usize true ⦃ adjusted =>
adjusted.val = n.val - (zeroPrefix.count 48#u8 : Int) ⦄ := by
unfold num.imp.dec2flt.parse.adjust_many_digit_count_loop
apply Aeneas.Std.loop.spec_decr_nat
(fun p : Std.Isize × Std.Usize × Bool =>
2 * (start.val.length - p.2.1.val) + if p.2.2 then 1 else 0)
(fun p =>
(p.2.2 = true /\ exists consumed remaining,
zeroPrefix = consumed ++ remaining /\
p.2.1.val = consumed.length /\
p.1.val = n.val - (consumed.count 48#u8 : Int)) \/
(p.2.2 = false /\ p.1.val =
n.val - (zeroPrefix.count 48#u8 : Int)))
(fun adjusted => adjusted.val =
n.val - (zeroPrefix.count 48#u8 : Int))
(fun p => num.imp.dec2flt.parse.adjust_many_digit_count_loop.body
start p.1 p.2.1 p.2.2)
(n, 0#usize, true)
· intro p hp
rcases p with ⟨count, index, scanning⟩
rcases hp with hscan | hdone
· rcases hscan with
⟨hscanning, consumed, remaining, hpart, hindex, hcount⟩
simp only [Prod.fst, Prod.snd] at hscanning hindex hcount ⊢
cases scanning <;> simp at hscanning
cases remaining with
| nil =>
have hconsumed : consumed = zeroPrefix := by
simpa using hpart.symm
subst consumed
rcases htail with htailnil | ⟨b, rest, htaileq, hb48, hb46⟩
· subst tail
have houtside : Not (index.val < start.val.length) := by
rw [hstart, hindex]
simp
simp [num.imp.dec2flt.parse.adjust_many_digit_count_loop.body,
WP.spec_ok, houtside, hcount]
· have hinside : index.val < start.val.length := by
rw [hstart, htaileq, hindex]
simp
have hread : Slice.index_usize start index = ok b := by
simp [Slice.index_usize, hstart, htaileq, hindex]
simp [num.imp.dec2flt.parse.adjust_many_digit_count_loop.body,
WP.spec_ok, hinside, hread, hb48, hb46]
exact hcount
| cons b rest =>
have hbmem : List.Mem b zeroPrefix := by
rw [hpart]
exact List.mem_append_right _ List.mem_cons_self
rcases hprefix b hbmem with hbzero | hbpoint
· subst b
have hinside : index.val < start.val.length := by
rw [hstart, hpart, hindex]
simp
have hread : Slice.index_usize start index = ok 48#u8 := by
simp [Slice.index_usize, hstart, hpart, hindex]
simp [num.imp.dec2flt.parse.adjust_many_digit_count_loop.body,
WP.spec_ok, hinside, hread]
rw [show (48#u8 - 1#u8) = ok 47#u8 by rfl]
change (do
let digit ← lift (core.num.U8.saturating_sub 48#u8 47#u8)
let digit' ← lift (UScalar.hcast .Isize digit)
let count1 ← count - digit'
let index1 ← index + 1#usize
ok (cont (count1, index1, true))) ⦃ _ ⦄
rw [show lift (core.num.U8.saturating_sub 48#u8 47#u8) =
ok 1#u8 by rfl]
have hcast1 : UScalar.hcast .Isize 1#u8 = 1#isize := by
apply IScalar.eq_of_val_eq
have h := UScalar.hcast_inBounds_spec .Isize (1#u8)
(by scalar_tac)
simpa [Aeneas.Std.lift, WP.spec_ok] using h
change (do
let digit' ← lift (UScalar.hcast .Isize 1#u8)
let count1 ← count - digit'
let index1 ← index + 1#usize
ok (cont (count1, index1, true))) ⦃ _ ⦄
rw [hcast1]
have hremainingCount :
(zeroPrefix.count 48#u8 : Int) =
(consumed.count 48#u8 : Int) + 1 +
(rest.count 48#u8 : Int) := by
rw [hpart, List.count_append]
simp
omega
have hsublo : IScalar.min .Isize <=
count.val - (1#isize).val := by
simp [IScalar.min, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits] at hlower ⊢
rw [hremainingCount] at hlower
rw [hcount]
omega
have hsubhi : count.val - (1#isize).val <=
IScalar.max .Isize := by
simp [IScalar.max, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits]
rw [hcount]
have hlen' : (start.val.length : Int) <=
9223372036854775807 := by exact_mod_cast hlen
have hnupper : n.val <= 9223372036854775807 := by
exact le_trans hnle hlen'
omega
obtain ⟨count1, hcount1, hcount1val⟩ :=
Aeneas.Std.WP.spec_imp_exists
(IScalar.sub_spec (x := count) (y := 1#isize)
(by simpa using hsublo) (by simpa using hsubhi))
rw [show lift (1#isize) = ok 1#isize by rfl]
simp only [bind_tc_ok]
rw [hcount1]
have hadd : index.val + 1 <= UScalar.max .Usize := by
have hbits := Dec2Flt.configured_x86_64_numBits
simp [UScalar.max, hbits]
rw [hstart, hpart] at hlen
simp only [List.length_append, List.length_cons] at hlen
omega
obtain ⟨index1, hindex1, hindex1val⟩ :=
Aeneas.Std.WP.spec_imp_exists
(UScalar.add_spec (x := index) (y := 1#usize) hadd)
rw [hindex1]
simp [WP.spec_ok]
constructor
· refine ⟨consumed ++ [48#u8], ?_, ?_, ?_⟩
· exact ⟨rest, by simpa [List.append_assoc] using hpart⟩
· norm_num at hindex1val
simp [hindex]
omega
· norm_num at hcount1val
simp [hcount]
omega
· norm_num at hindex1val
omega
· subst b
have hinside : index.val < start.val.length := by
rw [hstart, hpart, hindex]
simp
have hread : Slice.index_usize start index = ok 46#u8 := by
simp [Slice.index_usize, hstart, hpart, hindex]
simp [num.imp.dec2flt.parse.adjust_many_digit_count_loop.body,
WP.spec_ok, hinside, hread]
rw [show (48#u8 - 1#u8) = ok 47#u8 by rfl]
change (do
let digit ← lift (core.num.U8.saturating_sub 46#u8 47#u8)
let digit' ← lift (UScalar.hcast .Isize digit)
let count1 ← count - digit'
let index1 ← index + 1#usize
ok (cont (count1, index1, true))) ⦃ _ ⦄
rw [show lift (core.num.U8.saturating_sub 46#u8 47#u8) =
ok 0#u8 by rfl]
have hcast0 : UScalar.hcast .Isize 0#u8 = 0#isize := by
apply IScalar.eq_of_val_eq
have h := UScalar.hcast_inBounds_spec .Isize (0#u8)
(by scalar_tac)
simpa [Aeneas.Std.lift, WP.spec_ok] using h
change (do
let digit' ← lift (UScalar.hcast .Isize 0#u8)
let count1 ← count - digit'
let index1 ← index + 1#usize
ok (cont (count1, index1, true))) ⦃ _ ⦄
rw [hcast0]
have hsublo : IScalar.min .Isize <=
count.val - (0#isize).val := by
have hc := IScalar.hBounds count
simp [IScalar.min, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits] at hc ⊢
omega
have hsubhi : count.val - (0#isize).val <=
IScalar.max .Isize := by
have hc := IScalar.hBounds count
simp [IScalar.max, IScalarTy.numBits,
Dec2Flt.configured_x86_64_numBits] at hc ⊢
omega
obtain ⟨count1, hcount1, hcount1val⟩ :=
Aeneas.Std.WP.spec_imp_exists
(IScalar.sub_spec (x := count) (y := 0#isize)
(by simpa using hsublo) (by simpa using hsubhi))
rw [show lift (0#isize) = ok 0#isize by rfl]
simp only [bind_tc_ok]
rw [hcount1]
have hadd : index.val + 1 <= UScalar.max .Usize := by
have hbits := Dec2Flt.configured_x86_64_numBits
simp [UScalar.max, hbits]
rw [hstart, hpart] at hlen
simp only [List.length_append, List.length_cons] at hlen
omega
obtain ⟨index1, hindex1, hindex1val⟩ :=
Aeneas.Std.WP.spec_imp_exists
(UScalar.add_spec (x := index) (y := 1#usize) hadd)
rw [hindex1]
simp [WP.spec_ok]
constructor
· refine ⟨consumed ++ [46#u8], ?_, ?_, ?_⟩
· exact ⟨rest, by simpa [List.append_assoc] using hpart⟩
· norm_num at hindex1val
simp [hindex]
omega
· norm_num at hcount1val
rw [hcount1val, hcount]
simp
· norm_num at hindex1val
omega
· rcases hdone with ⟨hscanning, hcount⟩
simp only [Prod.fst, Prod.snd] at hscanning hcount ⊢
cases scanning <;> simp at hscanning
simp [num.imp.dec2flt.parse.adjust_many_digit_count_loop.body,
WP.spec_ok, hcount]
· refine Or.inl ⟨rfl, [], zeroPrefix, by simp, by simp, ?_⟩
simpa using rfl
obtain ⟨adjusted, hadjusted, hvalue⟩ :=
Aeneas.Std.WP.spec_imp_exists hloop
refine ⟨adjusted, ?_, hvalue⟩
simpa [num.imp.dec2flt.parse.adjust_many_digit_count] using hadjusted
end dec2flt_model
Proof structure
Follow the declared dependencies to read the supporting statements and proofs.
Inspect related source (47)
- 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
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)
- clone · core/src/clone.rs:698 Rust library
- div · core/src/ops/arith.rs:515 Rust library
- mul · core/src/ops/arith.rs:350 Rust library
- neg · core/src/ops/arith.rs:719 Rust library
- bitand · core/src/ops/bit.rs:178 Rust library
- bitor · core/src/ops/bit.rs:282 Rust library
- shl · core/src/ops/bit.rs:489 Rust library
- shr · core/src/ops/bit.rs:612 Rust library
- EXPONENT_MASK · core/src/num/f64.rs:615 Rust library
- INFINITY · core/src/num/f64.rs:512 Rust library
- MANTISSA_DIGITS · core/src/num/f64.rs:412 Rust library
- MANTISSA_MASK · core/src/num/f64.rs:637 Rust library
- NAN · core/src/num/f64.rs:509 Rust library
- NEG_INFINITY · core/src/num/f64.rs:515 Rust library
- classify · core/src/num/f64.rs:782 Rust library
- from_bits · core/src/num/f64.rs:1269 Rust library
- to_bits · core/src/num/f64.rs:1223 Rust library
- is_ascii_digit · core/src/num/mod.rs:958 Rust library
- from_residual · core/src/option.rs:2793 Rust library
- branch · core/src/option.rs:2779 Rust library
- first · core/src/slice/mod.rs:155 Rust library
- split_first · core/src/slice/mod.rs:198 Rust library
- as_bytes · core/src/str/mod.rs:498 Rust library
- FpCategory · core/src/num/mod.rs:1522 Rust library
- Div · core/src/ops/arith.rs:460 Rust library
- Mul · core/src/ops/arith.rs:322 Rust library
- Neg · core/src/ops/arith.rs:690 Rust library
- BitOr · core/src/ops/bit.rs:254 Rust library
- Shl · core/src/ops/bit.rs:461 Rust library
- Shr · core/src/ops/bit.rs:584 Rust library
Related source and models come from the extraction records and declared dependencies.
Proof assumptions and review
Lean checks the formal proof. Trellis also reviews how the statement corresponds to the intended requirement.
Transitive assumptions
- Classical.choice
- Dec2Flt.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
Technical checking records
Local closure summary
{
"node": "NumberHelperAdjustManyExact",
"closure_version": "patch_c_v1",
"active_decl_hash": "9c7be79878fd76e225bc5b3fe1f18a3eeb0e496ecd3ca8ca8229e6385375bd85",
"active_statement_hash": "bf02b2e5041d2a3842aa18634a6dc242cffebe831812a304f7415bf43373d147",
"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-138",
"boundary_theorems": {},
"strict_theorem_deps": {
"num_imp_dec2flt_parse_adjust_many_digit_count": "7a20708611001f01"
},
"strict_definition_deps": {
"num_imp_dec2flt_parse_adjust_many_digit_count": "1bc88a1b016164f3"
}
}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:1cbcef64357a312c4b1a4c5c46072f66605603b09ea78b3caa49cf0ec84e074e",
"superseded_for_theorem_closure": false
}Review verdicts
{
"corr_status": "Pass",
"substantiveness_status": "Pass"
}