DecimalSeqFinalizationExact

Lean checked

Statement

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

Lemma · Exact common decimal-sequence finalization

Let start and rest be modeled byte slices, let scan and out be decimal-sequence records, let S,R,X,Y,T be finite lists of natural numbers, let q be natural, let P,E be integers, and let f map I32 values to modeled results. Assume all of the following:
  • the natural values in start are X\mathbin{++}Y\mathbin{++}T and those in rest are T;
  • X is empty or has the form X_0\mathbin{++}[b] with b\ne48 and b\ne46, every member of Y is 48 or 46, and Y.\operatorname{count}(48)=q;
  • \texttt{scan.num\_digits.val}=|S| and, for some integer k,
    \texttt{scan.decimal\_point.val}+q+|R|=P+k2^{32};
  • \texttt{scan.truncated}=\mathsf{false} and S=R\mathbin{++}[0]^q;
  • after taking the first \min(|S|,768) cells of scan.digits and replacing each modeled byte by its natural value, the resulting list is S.\operatorname{take}(\min(|S|,768));
  • for every I32 values base and result, f(\texttt{base})=\operatorname{ok}(\texttt{result}) implies \texttt{result.val}=\texttt{base.val}+E; and
  • the following checked monadic computation returns \operatorname{ok}(\texttt{out}): subtract the two slice lengths; count trailing zeroes in start up to that difference; cast that count to I32 and add it to scan.decimal_point; subtract the count from scan.num_digits; cast the retained count to I32 and add it to the intermediate point; cap the count at 768 and set the flag to true exactly in the branch where the retained count is greater than 768, otherwise keep the count and scan.truncated; apply f to the point; run extracted fill loop~1 on scan.digits from the selected count to MAX_DIGITS_WITHOUT_OVERFLOW; and construct out from the selected count, final point, selected flag, and returned array.
Then
\texttt{out.num\_digits.val}=\min(|R|,768),
the natural values of its first out.num_digits.val cells equal R.\operatorname{take}(\texttt{out.num\_digits.val}), \texttt{out.truncated}=\mathsf{true} if and only if 768<|R|, and there is an integer k such that
\texttt{out.decimal\_point.val}=P+E+k2^{32}.

Lean statement

Trellis authored these statements and proofs. Lean checks the formal proofs; the assumptions used by each proof are listed below.

import Tablet.DecimalSeqTrailingZeroValues
import Tablet.DecimalSeqFillPrefixPreserved
import Tablet.DecimalSeqI32HCastCongruence
import Tablet.DecimalSeqDuplicateLoops

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxHeartbeats 2000000
namespace dec2flt_model

-- [TABLET NODE: DecimalSeqFinalizationExact]
theorem DecimalSeqFinalizationExact (start rest : Slice Std.U8)
    (scan out : num.imp.dec2flt.decimal_seq.DecimalSeq)
    (sig trim : List Nat) (prefx suffix tail : List Nat) (q : Nat)
    (P E : Int) (suffixEval : Std.I32 -> Result Std.I32)
    (hstart : start.val.map (fun b => b.val) = prefx ++ suffix ++ tail)
    (hrest : rest.val.map (fun b => b.val) = tail)
    (hprefx : prefx = [] ∨ exists pre b,
      prefx = pre ++ [b] /\ b ≠ 48 /\ b ≠ 46)
    (hsuffix : forall b, b ∈ suffix -> b = 48 ∨ b = 46)
    (hq : suffix.count 48 = q)
    (hscanCount : scan.num_digits.val = sig.length)
    (hscanPoint : exists k : Int,
      scan.decimal_point.val + (q : Int) + (trim.length : Int) =
        P + k * 4294967296)
    (hscanTrunc : scan.truncated = false)
    (hsig : sig = trim ++ List.replicate q 0)
    (hscanDigits :
      (scan.digits.val.take (min sig.length 768)).map (fun b => b.val) =
        sig.take (min sig.length 768))
    (hsuffixValue : forall base result,
      suffixEval base = ok result -> result.val = base.val + E)
    (hcore :
      (do
        let consumed <- Slice.len start - Slice.len rest
        let trailing <-
          num.imp.dec2flt.decimal_seq.count_trailing_zeros start consumed
        let p1 <- scan.decimal_point + UScalar.hcast .I32 trailing
        let kept <- scan.num_digits - trailing
        let point <- p1 + UScalar.hcast .I32 kept
        let (nDigits, flag) <-
          if kept > num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS
          then ok (num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS, true)
          else ok (kept, scan.truncated)
        let finalPoint <- suffixEval point
        let a <- num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1
          { start := nDigits,
            «end» :=
              num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS_WITHOUT_OVERFLOW }
          scan.digits
        ok (num.imp.dec2flt.decimal_seq.DecimalSeq.mk
          nDigits finalPoint flag a)) = ok out) :
    out.num_digits.val = min trim.length 768 /\
      (out.digits.val.take out.num_digits.val).map (fun z => z.val) =
        trim.take out.num_digits.val /\
      (out.truncated = true <-> 768 < trim.length) /\
      exists k : Int,
        out.decimal_point.val = P + E + k * 4294967296 := 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

The two supplied slice decompositions identify the consumed prefix as X\mathbin{++}Y. Apply DecimalSeqTrailingZeroValues to these decompositions and to the stated conditions on X and Y. It returns the number of 48 entries in Y, which is q by hypothesis. The logical-count equation and S=R\mathbin{++}[0]^q make the successful checked subtraction return |R|.
Apply DecimalSeqI32HCastCongruence to both the zero count and the retained count. Inverting the two successful checked additions and using the supplied congruence for scan.decimal_point shows that the point passed to f is congruent to P modulo 2^{32}. The supplied equation for every successful result of f then adds E. The cap branch returns 768 and true exactly when 768<|R|; otherwise it returns |R| and preserves the supplied false scan flag. Since S=R\mathbin{++}[0]^q, taking no more than |R| entries from the stored prefix of S gives the corresponding prefix of R. Finally DecimalSeqFillPrefixPreserved shows that fill loop~1 does not change that prefix. These facts give all four conclusions.

Lean proof


  have hlenStart : start.val.length =
      prefx.length + suffix.length + tail.length := by
    have h := congrArg List.length hstart
    simpa [Nat.add_assoc] using h
  have hlenRest : rest.val.length = tail.length := by
    have h := congrArg List.length hrest
    simpa using h
  have hsubbound : (Slice.len rest).val <= (Slice.len start).val := by
    simp [Slice.len, hlenStart, hlenRest]
  obtain ⟨consumed, hconsumed, hconsumedVal, _⟩ :=
    Aeneas.Std.WP.spec_imp_exists
      (UScalar.sub_spec (x := Slice.len start) (y := Slice.len rest) hsubbound)
  have hconsumedPrefix : consumed.val = (prefx ++ suffix).length := by
    simpa [Slice.len, hlenStart, hlenRest] using hconsumedVal
  have htrailBound : suffix.count 48 <= UScalar.max .Usize := by
    have hle : suffix.count 48 <= start.val.length := by
      rw [hlenStart]
      have hc : suffix.count 48 <= suffix.length := List.count_le_length
      omega
    have hsmax : start.val.length <= UScalar.max .Usize := by
      simpa [UScalar.max, Usize.max, Usize.numBits,
        Dec2Flt.configured_x86_64_numBits] using start.property
    exact le_trans hle hsmax
  obtain ⟨trailing, htrailLoop, htrailingVal⟩ :=
    DecimalSeqTrailingZeroValues start prefx suffix tail 0#usize consumed
      hstart hprefx hsuffix hconsumedPrefix (by simpa using htrailBound)
  have htrailingQ : trailing.val = q := by
    simpa [hq] using htrailingVal
  have htrail :
      num.imp.dec2flt.decimal_seq.count_trailing_zeros start consumed =
        ok trailing := by
    unfold num.imp.dec2flt.decimal_seq.count_trailing_zeros
    simpa using htrailLoop
  rw [hconsumed] at hcore
  simp only [bind_tc_ok] at hcore
  rw [htrail] at hcore
  simp only [bind_tc_ok, Aeneas.Std.lift] at hcore
  have hqle : q <= sig.length := by
    have h := congrArg List.length hsig
    simp at h
    omega
  have htrailLe : trailing.val <= scan.num_digits.val := by
    rw [htrailingQ, hscanCount]
    exact hqle
  obtain ⟨kept, hkeep, hkeepVal, _⟩ :=
    Aeneas.Std.WP.spec_imp_exists
      (UScalar.sub_spec (x := scan.num_digits) (y := trailing) htrailLe)
  have hkeepTrim : kept.val = trim.length := by
    rw [hkeepVal, htrailingQ, hscanCount]
    have h := congrArg List.length hsig
    simp at h
    omega
  cases ha : scan.decimal_point + UScalar.hcast .I32 trailing with
  | fail err => rw [ha] at hcore; simp at hcore
  | div => rw [ha] at hcore; simp at hcore
  | ok p1 =>
    rw [ha] at hcore
    simp only [bind_tc_ok] at hcore
    rw [hkeep] at hcore
    simp only [bind_tc_ok, Aeneas.Std.lift] at hcore
    cases hp : p1 + UScalar.hcast .I32 kept with
    | fail err => rw [hp] at hcore; simp at hcore
    | div => rw [hp] at hcore; simp at hcore
    | ok point =>
      rw [hp] at hcore
      simp only [bind_tc_ok] at hcore
      cases he : suffixEval point with
      | fail err =>
        rw [he] at hcore
        split at hcore <;> simp_all
      | div =>
        rw [he] at hcore
        split at hcore <;> simp_all
      | ok finalPoint =>
        rw [he] at hcore
        simp only [bind_tc_ok] at hcore
        obtain ⟨kq, hkq⟩ := DecimalSeqI32HCastCongruence trailing
        obtain ⟨kt, hkt⟩ := DecimalSeqI32HCastCongruence kept
        have haVal : p1.val = scan.decimal_point.val +
            (UScalar.hcast .I32 trailing).val := by
          have hh := IScalar.add_equiv scan.decimal_point
            (UScalar.hcast .I32 trailing)
          rw [ha] at hh
          exact hh.2.1
        have hpVal : point.val = p1.val +
            (UScalar.hcast .I32 kept).val := by
          have hh := IScalar.add_equiv p1 (UScalar.hcast .I32 kept)
          rw [hp] at hh
          exact hh.2.1
        have heVal : finalPoint.val = point.val + E :=
          hsuffixValue point finalPoint he
        rcases hscanPoint with ⟨kb, hkb⟩
        have hpointCong : exists k : Int,
            finalPoint.val = P + E + k * 4294967296 := by
          refine ⟨kb + kq + kt, ?_⟩
          rw [heVal, hpVal, haVal, hkq, hkt, htrailingQ, hkeepTrim]
          push_cast
          ring_nf at hkb ⊢
          omega
        have hdigitPrefix :
            (scan.digits.val.take (min trim.length 768)).map
                (fun b => b.val) =
              trim.take (min trim.length 768) := by
          have htrimLe : trim.length <= sig.length := by
            rw [hsig]
            simp
          have hm : min trim.length 768 <= min sig.length 768 := by omega
          have hd := congrArg (List.take (min trim.length 768)) hscanDigits
          rw [← List.map_take] at hd
          simp only [List.take_take, min_eq_left hm] at hd
          rw [hsig] at hd
          simpa [List.take_append_of_le_length (Nat.min_le_left _ _)] using hd
        by_cases hcap : 768 < trim.length
        · obtain ⟨a', hfill, hpref⟩ := DecimalSeqFillPrefixPreserved
              num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS scan.digits
          simp [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def,
            hkeepTrim, hcap, hscanTrunc] at hcore
          have hfill768 :
              num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1
                { start := 768#usize,
                  «end» :=
                    num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS_WITHOUT_OVERFLOW }
                scan.digits = ok a' := by
            simpa [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def]
              using hfill
          rw [hfill768] at hcore
          simp at hcore
          subst out
          refine ⟨?_, ?_, ?_, hpointCong⟩
          · change 768 = min trim.length 768
            omega
          · change (a'.val.take 768).map (fun z => z.val) = trim.take 768
            have hpref768 : a'.val.take 768 =
                scan.digits.val.take 768 := by
              simpa [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def]
                using hpref
            rw [hpref768]
            have hd := hdigitPrefix
            rw [Nat.min_eq_right (by omega)] at hd
            exact hd
          · simp only [Bool.true_eq, true_iff]
            exact hcap
        · obtain ⟨a', hfill, hpref⟩ :=
              DecimalSeqFillPrefixPreserved kept scan.digits
          have hle : trim.length <= 768 := by omega
          simp [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def,
            hkeepTrim, hcap, hscanTrunc] at hcore
          rw [hfill] at hcore
          simp at hcore
          subst out
          refine ⟨?_, ?_, ?_, hpointCong⟩
          · change kept.val = min trim.length 768
            rw [hkeepTrim, Nat.min_eq_left hle]
          · rw [hpref]
            simpa [hkeepTrim, Nat.min_eq_left hle] using hdigitPrefix
          · simp
            exact hle

end dec2flt_model

Download Lean source · Download TeX source

Complete Lean module
import Tablet.DecimalSeqTrailingZeroValues
import Tablet.DecimalSeqFillPrefixPreserved
import Tablet.DecimalSeqI32HCastCongruence
import Tablet.DecimalSeqDuplicateLoops

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false
set_option maxHeartbeats 2000000
namespace dec2flt_model

-- [TABLET NODE: DecimalSeqFinalizationExact]
theorem DecimalSeqFinalizationExact (start rest : Slice Std.U8)
    (scan out : num.imp.dec2flt.decimal_seq.DecimalSeq)
    (sig trim : List Nat) (prefx suffix tail : List Nat) (q : Nat)
    (P E : Int) (suffixEval : Std.I32 -> Result Std.I32)
    (hstart : start.val.map (fun b => b.val) = prefx ++ suffix ++ tail)
    (hrest : rest.val.map (fun b => b.val) = tail)
    (hprefx : prefx = [] ∨ exists pre b,
      prefx = pre ++ [b] /\ b ≠ 48 /\ b ≠ 46)
    (hsuffix : forall b, b ∈ suffix -> b = 48 ∨ b = 46)
    (hq : suffix.count 48 = q)
    (hscanCount : scan.num_digits.val = sig.length)
    (hscanPoint : exists k : Int,
      scan.decimal_point.val + (q : Int) + (trim.length : Int) =
        P + k * 4294967296)
    (hscanTrunc : scan.truncated = false)
    (hsig : sig = trim ++ List.replicate q 0)
    (hscanDigits :
      (scan.digits.val.take (min sig.length 768)).map (fun b => b.val) =
        sig.take (min sig.length 768))
    (hsuffixValue : forall base result,
      suffixEval base = ok result -> result.val = base.val + E)
    (hcore :
      (do
        let consumed <- Slice.len start - Slice.len rest
        let trailing <-
          num.imp.dec2flt.decimal_seq.count_trailing_zeros start consumed
        let p1 <- scan.decimal_point + UScalar.hcast .I32 trailing
        let kept <- scan.num_digits - trailing
        let point <- p1 + UScalar.hcast .I32 kept
        let (nDigits, flag) <-
          if kept > num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS
          then ok (num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS, true)
          else ok (kept, scan.truncated)
        let finalPoint <- suffixEval point
        let a <- num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1
          { start := nDigits,
            «end» :=
              num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS_WITHOUT_OVERFLOW }
          scan.digits
        ok (num.imp.dec2flt.decimal_seq.DecimalSeq.mk
          nDigits finalPoint flag a)) = ok out) :
    out.num_digits.val = min trim.length 768 /\
      (out.digits.val.take out.num_digits.val).map (fun z => z.val) =
        trim.take out.num_digits.val /\
      (out.truncated = true <-> 768 < trim.length) /\
      exists k : Int,
        out.decimal_point.val = P + E + k * 4294967296 := by
-- BODY
  have hlenStart : start.val.length =
      prefx.length + suffix.length + tail.length := by
    have h := congrArg List.length hstart
    simpa [Nat.add_assoc] using h
  have hlenRest : rest.val.length = tail.length := by
    have h := congrArg List.length hrest
    simpa using h
  have hsubbound : (Slice.len rest).val <= (Slice.len start).val := by
    simp [Slice.len, hlenStart, hlenRest]
  obtain ⟨consumed, hconsumed, hconsumedVal, _⟩ :=
    Aeneas.Std.WP.spec_imp_exists
      (UScalar.sub_spec (x := Slice.len start) (y := Slice.len rest) hsubbound)
  have hconsumedPrefix : consumed.val = (prefx ++ suffix).length := by
    simpa [Slice.len, hlenStart, hlenRest] using hconsumedVal
  have htrailBound : suffix.count 48 <= UScalar.max .Usize := by
    have hle : suffix.count 48 <= start.val.length := by
      rw [hlenStart]
      have hc : suffix.count 48 <= suffix.length := List.count_le_length
      omega
    have hsmax : start.val.length <= UScalar.max .Usize := by
      simpa [UScalar.max, Usize.max, Usize.numBits,
        Dec2Flt.configured_x86_64_numBits] using start.property
    exact le_trans hle hsmax
  obtain ⟨trailing, htrailLoop, htrailingVal⟩ :=
    DecimalSeqTrailingZeroValues start prefx suffix tail 0#usize consumed
      hstart hprefx hsuffix hconsumedPrefix (by simpa using htrailBound)
  have htrailingQ : trailing.val = q := by
    simpa [hq] using htrailingVal
  have htrail :
      num.imp.dec2flt.decimal_seq.count_trailing_zeros start consumed =
        ok trailing := by
    unfold num.imp.dec2flt.decimal_seq.count_trailing_zeros
    simpa using htrailLoop
  rw [hconsumed] at hcore
  simp only [bind_tc_ok] at hcore
  rw [htrail] at hcore
  simp only [bind_tc_ok, Aeneas.Std.lift] at hcore
  have hqle : q <= sig.length := by
    have h := congrArg List.length hsig
    simp at h
    omega
  have htrailLe : trailing.val <= scan.num_digits.val := by
    rw [htrailingQ, hscanCount]
    exact hqle
  obtain ⟨kept, hkeep, hkeepVal, _⟩ :=
    Aeneas.Std.WP.spec_imp_exists
      (UScalar.sub_spec (x := scan.num_digits) (y := trailing) htrailLe)
  have hkeepTrim : kept.val = trim.length := by
    rw [hkeepVal, htrailingQ, hscanCount]
    have h := congrArg List.length hsig
    simp at h
    omega
  cases ha : scan.decimal_point + UScalar.hcast .I32 trailing with
  | fail err => rw [ha] at hcore; simp at hcore
  | div => rw [ha] at hcore; simp at hcore
  | ok p1 =>
    rw [ha] at hcore
    simp only [bind_tc_ok] at hcore
    rw [hkeep] at hcore
    simp only [bind_tc_ok, Aeneas.Std.lift] at hcore
    cases hp : p1 + UScalar.hcast .I32 kept with
    | fail err => rw [hp] at hcore; simp at hcore
    | div => rw [hp] at hcore; simp at hcore
    | ok point =>
      rw [hp] at hcore
      simp only [bind_tc_ok] at hcore
      cases he : suffixEval point with
      | fail err =>
        rw [he] at hcore
        split at hcore <;> simp_all
      | div =>
        rw [he] at hcore
        split at hcore <;> simp_all
      | ok finalPoint =>
        rw [he] at hcore
        simp only [bind_tc_ok] at hcore
        obtain ⟨kq, hkq⟩ := DecimalSeqI32HCastCongruence trailing
        obtain ⟨kt, hkt⟩ := DecimalSeqI32HCastCongruence kept
        have haVal : p1.val = scan.decimal_point.val +
            (UScalar.hcast .I32 trailing).val := by
          have hh := IScalar.add_equiv scan.decimal_point
            (UScalar.hcast .I32 trailing)
          rw [ha] at hh
          exact hh.2.1
        have hpVal : point.val = p1.val +
            (UScalar.hcast .I32 kept).val := by
          have hh := IScalar.add_equiv p1 (UScalar.hcast .I32 kept)
          rw [hp] at hh
          exact hh.2.1
        have heVal : finalPoint.val = point.val + E :=
          hsuffixValue point finalPoint he
        rcases hscanPoint with ⟨kb, hkb⟩
        have hpointCong : exists k : Int,
            finalPoint.val = P + E + k * 4294967296 := by
          refine ⟨kb + kq + kt, ?_⟩
          rw [heVal, hpVal, haVal, hkq, hkt, htrailingQ, hkeepTrim]
          push_cast
          ring_nf at hkb ⊢
          omega
        have hdigitPrefix :
            (scan.digits.val.take (min trim.length 768)).map
                (fun b => b.val) =
              trim.take (min trim.length 768) := by
          have htrimLe : trim.length <= sig.length := by
            rw [hsig]
            simp
          have hm : min trim.length 768 <= min sig.length 768 := by omega
          have hd := congrArg (List.take (min trim.length 768)) hscanDigits
          rw [← List.map_take] at hd
          simp only [List.take_take, min_eq_left hm] at hd
          rw [hsig] at hd
          simpa [List.take_append_of_le_length (Nat.min_le_left _ _)] using hd
        by_cases hcap : 768 < trim.length
        · obtain ⟨a', hfill, hpref⟩ := DecimalSeqFillPrefixPreserved
              num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS scan.digits
          simp [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def,
            hkeepTrim, hcap, hscanTrunc] at hcore
          have hfill768 :
              num.imp.dec2flt.decimal_seq.parse_decimal_seq_loop1
                { start := 768#usize,
                  «end» :=
                    num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS_WITHOUT_OVERFLOW }
                scan.digits = ok a' := by
            simpa [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def]
              using hfill
          rw [hfill768] at hcore
          simp at hcore
          subst out
          refine ⟨?_, ?_, ?_, hpointCong⟩
          · change 768 = min trim.length 768
            omega
          · change (a'.val.take 768).map (fun z => z.val) = trim.take 768
            have hpref768 : a'.val.take 768 =
                scan.digits.val.take 768 := by
              simpa [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def]
                using hpref
            rw [hpref768]
            have hd := hdigitPrefix
            rw [Nat.min_eq_right (by omega)] at hd
            exact hd
          · simp only [Bool.true_eq, true_iff]
            exact hcap
        · obtain ⟨a', hfill, hpref⟩ :=
              DecimalSeqFillPrefixPreserved kept scan.digits
          have hle : trim.length <= 768 := by omega
          simp [num.imp.dec2flt.decimal_seq.DecimalSeq.MAX_DIGITS.eq_def,
            hkeepTrim, hcap, hscanTrunc] at hcore
          rw [hfill] at hcore
          simp at hcore
          subst out
          refine ⟨?_, ?_, ?_, hpointCong⟩
          · change kept.val = min trim.length 768
            rw [hkeepTrim, Nat.min_eq_left hle]
          · rw [hpref]
            simpa [hkeepTrim, Nat.min_eq_left hle] using hdigitPrefix
          · simp
            exact hle

end dec2flt_model

Proof structure

Follow the declared dependencies to read the supporting statements and proofs.

Explore this dependency tree

Inspect related source (77)
More program dependencies (44)
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
All 17 entries
Technical checking records
Local closure summary
{
  "node": "DecimalSeqFinalizationExact",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "fe6730bda071d74b0b931bcbd12f4a6de936a0c721bb94eeb82e9335b9ed9410",
  "active_statement_hash": "04328448af6518e5b0e6ede2dc89c45741bb75973ca10845085544608642620d",
  "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-169",
  "boundary_theorems": {},
  "strict_theorem_deps": {
    "DecimalSeqFillPrefixPreserved": "4eabf1d65bab5e95",
    "DecimalSeqI32HCastCongruence": "bedcc032e9d40104",
    "DecimalSeqTrailingZeroValues": "9bf98eea90c6e7c3",
    "num_imp_dec2flt_decimal_seq_DecimalSeq_MAX_DIGITS": "0eb6fb2627d0ff5c"
  },
  "strict_definition_deps": {
    "num_imp_dec2flt_decimal_seq_DecimalSeq": "c43614ff2149ecf2",
    "num_imp_dec2flt_decimal_seq_DecimalSeq_MAX_DIGITS": "39f6cb231ef80388",
    "num_imp_dec2flt_decimal_seq_DecimalSeq_MAX_DIGITS_WITHOUT_OVERFLOW": "65634ac95536dcca",
    "num_imp_dec2flt_decimal_seq_count_trailing_zeros": "7a77bc9e01c1a09b",
    "num_imp_dec2flt_decimal_seq_parse_decimal_seq": "9f2c4f5675cad683"
  }
}
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:9701e0bb35c31aa2d2b6cf01908fd1d576a9e9c69b6a0b780120205d0b0d7970",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "substantiveness_status": "Pass"
}