NumberHelperAdjustManyExact

Lean checked

Statement

This explanation was written alongside the formalization to describe the statement and its reasoning.

Lemma · Exact many-digit adjustment

Let s be a modeled source byte slice, let n be a modeled 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
|s.\mathsf{val}|\le 9223372036854775807,\qquad 0\le n.\mathsf{val}\le |s.\mathsf{val}|,
and
\mathsf{isize}_{\min}\le n.\mathsf{val}-\mathsf{count}(P,48).
Then there exists a modeled isize a such that
\texttt{adjust\_many\_digit\_count}(s,n)=\texttt{ok}(a) \quad\text{and}\quad a.\mathsf{val}=n.\mathsf{val}-\mathsf{count}(P,48).

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

Unfold num imp dec2flt parse adjust many digit count. In its loop, maintain a decomposition P=QR, an index equal to |Q|, and a count equal to n minus the number of zero bytes in Q. While scanning is true and R starts with byte 48, the extracted subtraction by one, saturated subtraction from 47, and cast compute the signed value one; the checked count subtraction therefore changes the count by exactly one. When R starts with byte 46, the same operations compute zero, so the count is unchanged. In both cases the checked index increment succeeds because the indexed byte is present and |s|\le2^{63}-1<2^{64}, and the remaining source length strictly decreases.
All intermediate count subtractions are in range. Their final lower bound is the assumed lower bound on n.\mathsf{val}-\mathsf{count}(P,48); before the final zero byte, the count is larger by the number of zero bytes still in R. Their upper bound follows from n.\mathsf{val}\le |s.\mathsf{val}|\le2^{63}-1. Thus every checked signed operation succeeds.
When R is empty, the maintained prefix is all of P. If T is empty, the length guard returns immediately. Otherwise its first byte is neither 48 nor 46, so that byte changes the scanning flag to false without changing the index or count; the next iteration returns. In either case the returned count has value n.\mathsf{val}-\mathsf{count}(P,48). This also proves termination, since consuming a prefix byte strictly decreases twice the remaining length, and clearing the scanning flag decreases the Boolean component of the loop measure.

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.

Explore this dependency tree

Inspect related source (47)
More program dependencies (14)
Standard-library dependencies (30)

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

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"
}