ParserSlowInfinityMantissa

Lean checked

Statement

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

Helper

For every byte slice and biased pair b, if the extracted binary64 slow conversion parse_long_mantissa returns b normally and b has biased exponent 2047, then b has zero mantissa.

Lean statement

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

import Tablet.ParserExponentConstants
import Tablet.ParserSlowLoopZeroResult
import Tablet.ParserSlowLoopInfinityResult
import Tablet.ParserSlowLoopMinimumExponent

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: ParserSlowInfinityMantissa]
theorem ParserSlowInfinityMantissa (s : Slice U8)
    (b : num.imp.dec2flt.common.BiasedFp)
    (h : num.imp.dec2flt.slow.parse_long_mantissa
      F64.Insts.Dec2flt_modelNumImpTraitsFloatU64 s = ok b) :
    b.p_biased.val = 2047 -> b.m.val = 0 := 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

Use ParserExponentConstants, which evaluates infinite power to 2047, minimum exponent to -1022, and significand width to 52. Unfold num imp dec2flt slow parse long mantissa and invert each successful result bind. The eager zero and infinity sentinels are (0,0) and (0,2047). Thus zero digits and decimal points below -324 cannot meet the exponent hypothesis, while points at least 310 return the required zero-mantissa infinity pair.
On the remaining path apply ParserSlowLoopZeroResult. A present first-loop result is exactly the zero sentinel. Otherwise apply ParserSlowLoopInfinityResult; a present second-loop result is exactly the infinity sentinel. If neither result is present, invert the checked decrement and the third loop. By ParserSlowLoopMinimumExponent, its exponent e is at least -1022. The next successful subtraction and addition calculate x=e-(-1022)+1. If x\ge2047, the function returns the infinity sentinel. Otherwise x<2047 and execution continues to rounding.
In the noncarry rounding branch the final exponent is either the recomputed x or the successful checked value x-1. Both are strictly below 2047, so neither can satisfy the exponent hypothesis. In the carry branch the successful increment gives e'=e+1 and the second saturation candidate is x'=e'-(-1022)+1. If x'\ge2047, the function again returns the infinity sentinel. On the other branch, the final exponent is either x' or the successful checked value x'-1, both strictly below 2047. The remaining shifts, mask subtraction, and bitwise conjunction affect only the mantissa; any failed operation propagates rather than producing the assumed result. Consequently every successful result with exponent 2047 is one of the zero-mantissa infinity-sentinel exits.

Lean proof


  intro hp
  have bind_ok_inv : ∀ {α β : Type} (r : Result α) (f : α → Result β) y,
      Bind.bind r f = ok y → ∃ x, r = ok x ∧ f x = ok y := by
    intro α β r f y hr
    cases r with
    | fail err => simp [Bind.bind, Aeneas.Std.bind] at hr
    | div => simp [Bind.bind, Aeneas.Std.bind] at hr
    | ok x => exact ⟨x, rfl, hr⟩
  rcases ParserExponentConstants with
    ⟨hbits, htotal, hsig, hexpbits, hexpsat, hinf, hbias, hmin,
      hsmall, hlarge, hroundmin, hroundmax⟩
  have hzero : num.imp.dec2flt.common.BiasedFp.zero_pow2 0#i32 =
      ok { m := 0#u64, p_biased := 0#i32 } := by rfl
  have hinfFp : num.imp.dec2flt.common.BiasedFp.zero_pow2 2047#i32 =
      ok { m := 0#u64, p_biased := 2047#i32 } := by rfl
  unfold num.imp.dec2flt.slow.parse_long_mantissa at h
  rw [hzero, hinf] at h
  simp only [bind_tc_ok] at h
  rw [hinfFp] at h
  simp only [bind_tc_ok] at h
  obtain ⟨d, hd, h⟩ := bind_ok_inv _ _ _ h
  by_cases hempty : d.num_digits = 0#usize
  · simp only [hempty, if_true] at h
    cases h
    norm_num at hp
  simp only [hempty, if_false] at h
  by_cases hsmallp : d.decimal_point < (-324)#i32
  · simp only [hsmallp, if_true] at h
    cases h
    norm_num at hp
  simp only [hsmallp, if_false] at h
  by_cases hlargep : d.decimal_point ≥ 310#i32
  · simp only [hlargep, if_true] at h
    cases h
    rfl
  simp only [hlargep, if_false] at h
  obtain ⟨out0, hout0, h⟩ := bind_ok_inv _ _ _ h
  rcases out0 with ⟨i1, i2, t, a, exp2, lr0⟩
  have hlr0 := ParserSlowLoopZeroResult
    F64.Insts.Dec2flt_modelNumImpTraitsFloatU64
    ({ m := 0#u64, p_biased := 0#i32 } :
      num.imp.dec2flt.common.BiasedFp)
    d.num_digits d.decimal_point d.truncated d.digits 0#i32
    (i1, i2, t, a, exp2, lr0) hout0
  cases lr0 with
  | some result =>
    rcases hlr0 with hnone | hsome
    · contradiction
    · simp only [Option.some.injEq] at hsome
      subst result
      cases h
      norm_num at hp
  | none =>
    obtain ⟨out1, hout1, h⟩ := bind_ok_inv _ _ _ h
    rcases out1 with ⟨i3, i4, t1, a1, exp21, lr1⟩
    have hlr1 := ParserSlowLoopInfinityResult
      F64.Insts.Dec2flt_modelNumImpTraitsFloatU64
      ({ m := 0#u64, p_biased := 2047#i32 } :
        num.imp.dec2flt.common.BiasedFp)
      i1 i2 t a exp2 (i3, i4, t1, a1, exp21, lr1) hout1
    cases lr1 with
    | some result =>
      rcases hlr1 with hnone | hsome
      · contradiction
      · simp only [Option.some.injEq] at hsome
        subst result
        cases h
        rfl
    | none =>
      obtain ⟨exp22, hexp22, h⟩ := bind_ok_inv _ _ _ h
      obtain ⟨out2, hout2, h⟩ := bind_ok_inv _ _ _ h
      rcases out2 with ⟨d1, exp23⟩
      have hexp23 : -1022 ≤ exp23.val :=
        ParserSlowLoopMinimumExponent _ _ _ hout2
      change (do
        let i5 ← F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.EXP_MIN
        _) = ok b at h
      rw [hmin] at h
      simp only [bind_tc_ok] at h
      obtain ⟨i6, hi6, h⟩ := bind_ok_inv _ _ _ h
      obtain ⟨i7, hi7, h⟩ := bind_ok_inv _ _ _ h
      have hi6v : i6.val = exp23.val - (-1022) := by
        have he := IScalar.sub_equiv exp23 ((-1022)#i32)
        rw [hi6] at he
        exact he.2.1
      have hi7v : i7.val = i6.val + 1 := by
        have he := IScalar.add_equiv i6 (1#i32)
        rw [hi7] at he
        exact he.2.1
      by_cases hsat : i7 ≥ 2047#i32
      · simp only [hsat, if_true] at h
        cases h
        rfl
      · simp only [hsat, if_false] at h
        change (do
          let i8 ← F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.SIG_BITS
          _) = ok b at h
        rw [hsig] at h
        simp only [lift, bind_tc_ok] at h
        obtain ⟨i9, hi9, h⟩ := bind_ok_inv _ _ _ h
        obtain ⟨i10, hi10, h⟩ := bind_ok_inv _ _ _ h
        obtain ⟨d2, hd2, h⟩ := bind_ok_inv _ _ _ h
        obtain ⟨mantissa, hmantissa, h⟩ := bind_ok_inv _ _ _ h
        obtain ⟨i11, hi11, h⟩ := bind_ok_inv _ _ _ h
        by_cases hcarry : d2 ≥ i11
        · simp only [hcarry, if_true] at h
          obtain ⟨d3, hd3, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨exp24, hexp24, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨mantissa1, hmantissa1, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨i13, hi13, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨i14, hi14, h⟩ := bind_ok_inv _ _ _ h
          by_cases hsat2 : i14 ≥ 2047#i32
          · simp only [hsat2, if_true] at h
            cases h
            norm_num
          · simp only [hsat2, if_false] at h
            obtain ⟨i15, hi15, h⟩ := bind_ok_inv _ _ _ h
            obtain ⟨power2, hpower2, h⟩ := bind_ok_inv _ _ _ h
            obtain ⟨i16, hi16, h⟩ := bind_ok_inv _ _ _ h
            by_cases hlow : mantissa1 < i16
            · simp only [hlow, if_true] at h
              obtain ⟨power21, hpower21, h⟩ := bind_ok_inv _ _ _ h
              obtain ⟨i17, hi17, h⟩ := bind_ok_inv _ _ _ h
              obtain ⟨i18, hi18, h⟩ := bind_ok_inv _ _ _ h
              cases h
              change power21.val = 2047 at hp
              have hexp24v : exp24.val = exp23.val + 1 := by
                have he := IScalar.add_equiv exp23 (1#i32)
                rw [hexp24] at he
                exact he.2.1
              have hi13v : i13.val = exp24.val - (-1022) := by
                have he := IScalar.sub_equiv exp24 ((-1022)#i32)
                rw [hi13] at he
                exact he.2.1
              have hi14v : i14.val = i13.val + 1 := by
                have he := IScalar.add_equiv i13 (1#i32)
                rw [hi14] at he
                exact he.2.1
              have hi15v : i15.val = exp24.val - (-1022) := by
                have he := IScalar.sub_equiv exp24 ((-1022)#i32)
                rw [hi15] at he
                exact he.2.1
              have hpower2v : power2.val = i15.val + 1 := by
                have he := IScalar.add_equiv i15 (1#i32)
                rw [hpower2] at he
                exact he.2.1
              have hpower21v : power21.val = power2.val - 1 := by
                have he := IScalar.sub_equiv power2 (1#i32)
                rw [hpower21] at he
                exact he.2.1
              change ¬ 2047 ≤ i14.val at hsat2
              exfalso
              omega
            · simp only [hlow, if_false, bind_tc_ok] at h
              obtain ⟨i17, hi17, h⟩ := bind_ok_inv _ _ _ h
              obtain ⟨i18, hi18, h⟩ := bind_ok_inv _ _ _ h
              cases h
              change power2.val = 2047 at hp
              have hexp24v : exp24.val = exp23.val + 1 := by
                have he := IScalar.add_equiv exp23 (1#i32)
                rw [hexp24] at he
                exact he.2.1
              have hi13v : i13.val = exp24.val - (-1022) := by
                have he := IScalar.sub_equiv exp24 ((-1022)#i32)
                rw [hi13] at he
                exact he.2.1
              have hi14v : i14.val = i13.val + 1 := by
                have he := IScalar.add_equiv i13 (1#i32)
                rw [hi14] at he
                exact he.2.1
              have hi15v : i15.val = exp24.val - (-1022) := by
                have he := IScalar.sub_equiv exp24 ((-1022)#i32)
                rw [hi15] at he
                exact he.2.1
              have hpower2v : power2.val = i15.val + 1 := by
                have he := IScalar.add_equiv i15 (1#i32)
                rw [hpower2] at he
                exact he.2.1
              change ¬ 2047 ≤ i14.val at hsat2
              exfalso
              omega
        · simp only [hcarry, if_false] at h
          obtain ⟨i13, hi13, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨power2, hpower2, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨i14, hi14, h⟩ := bind_ok_inv _ _ _ h
          by_cases hlow : d2 < i14
          · simp only [hlow, if_true] at h
            obtain ⟨power21, hpower21, h⟩ := bind_ok_inv _ _ _ h
            obtain ⟨i15, hi15, h⟩ := bind_ok_inv _ _ _ h
            obtain ⟨i16, hi16, h⟩ := bind_ok_inv _ _ _ h
            cases h
            change power21.val = 2047 at hp
            have hi13v : i13.val = exp23.val - (-1022) := by
              have he := IScalar.sub_equiv exp23 ((-1022)#i32)
              rw [hi13] at he
              exact he.2.1
            have hpower2v : power2.val = i13.val + 1 := by
              have he := IScalar.add_equiv i13 (1#i32)
              rw [hpower2] at he
              exact he.2.1
            have hpower21v : power21.val = power2.val - 1 := by
              have he := IScalar.sub_equiv power2 (1#i32)
              rw [hpower21] at he
              exact he.2.1
            change ¬ 2047 ≤ i7.val at hsat
            exfalso
            omega
          · simp only [hlow, if_false, bind_tc_ok] at h
            obtain ⟨i15, hi15, h⟩ := bind_ok_inv _ _ _ h
            obtain ⟨i16, hi16, h⟩ := bind_ok_inv _ _ _ h
            cases h
            change power2.val = 2047 at hp
            have hi13v : i13.val = exp23.val - (-1022) := by
              have he := IScalar.sub_equiv exp23 ((-1022)#i32)
              rw [hi13] at he
              exact he.2.1
            have hpower2v : power2.val = i13.val + 1 := by
              have he := IScalar.add_equiv i13 (1#i32)
              rw [hpower2] at he
              exact he.2.1
            change ¬ 2047 ≤ i7.val at hsat
            exfalso
            omega

end dec2flt_model

Download Lean source · Download TeX source

Complete Lean module
import Tablet.ParserExponentConstants
import Tablet.ParserSlowLoopZeroResult
import Tablet.ParserSlowLoopInfinityResult
import Tablet.ParserSlowLoopMinimumExponent

open Aeneas Aeneas.Std Result ControlFlow Error
set_option autoImplicit false

namespace dec2flt_model

-- [TABLET NODE: ParserSlowInfinityMantissa]
theorem ParserSlowInfinityMantissa (s : Slice U8)
    (b : num.imp.dec2flt.common.BiasedFp)
    (h : num.imp.dec2flt.slow.parse_long_mantissa
      F64.Insts.Dec2flt_modelNumImpTraitsFloatU64 s = ok b) :
    b.p_biased.val = 2047 -> b.m.val = 0 := by
-- BODY
  intro hp
  have bind_ok_inv : ∀ {α β : Type} (r : Result α) (f : α → Result β) y,
      Bind.bind r f = ok y → ∃ x, r = ok x ∧ f x = ok y := by
    intro α β r f y hr
    cases r with
    | fail err => simp [Bind.bind, Aeneas.Std.bind] at hr
    | div => simp [Bind.bind, Aeneas.Std.bind] at hr
    | ok x => exact ⟨x, rfl, hr⟩
  rcases ParserExponentConstants with
    ⟨hbits, htotal, hsig, hexpbits, hexpsat, hinf, hbias, hmin,
      hsmall, hlarge, hroundmin, hroundmax⟩
  have hzero : num.imp.dec2flt.common.BiasedFp.zero_pow2 0#i32 =
      ok { m := 0#u64, p_biased := 0#i32 } := by rfl
  have hinfFp : num.imp.dec2flt.common.BiasedFp.zero_pow2 2047#i32 =
      ok { m := 0#u64, p_biased := 2047#i32 } := by rfl
  unfold num.imp.dec2flt.slow.parse_long_mantissa at h
  rw [hzero, hinf] at h
  simp only [bind_tc_ok] at h
  rw [hinfFp] at h
  simp only [bind_tc_ok] at h
  obtain ⟨d, hd, h⟩ := bind_ok_inv _ _ _ h
  by_cases hempty : d.num_digits = 0#usize
  · simp only [hempty, if_true] at h
    cases h
    norm_num at hp
  simp only [hempty, if_false] at h
  by_cases hsmallp : d.decimal_point < (-324)#i32
  · simp only [hsmallp, if_true] at h
    cases h
    norm_num at hp
  simp only [hsmallp, if_false] at h
  by_cases hlargep : d.decimal_point ≥ 310#i32
  · simp only [hlargep, if_true] at h
    cases h
    rfl
  simp only [hlargep, if_false] at h
  obtain ⟨out0, hout0, h⟩ := bind_ok_inv _ _ _ h
  rcases out0 with ⟨i1, i2, t, a, exp2, lr0⟩
  have hlr0 := ParserSlowLoopZeroResult
    F64.Insts.Dec2flt_modelNumImpTraitsFloatU64
    ({ m := 0#u64, p_biased := 0#i32 } :
      num.imp.dec2flt.common.BiasedFp)
    d.num_digits d.decimal_point d.truncated d.digits 0#i32
    (i1, i2, t, a, exp2, lr0) hout0
  cases lr0 with
  | some result =>
    rcases hlr0 with hnone | hsome
    · contradiction
    · simp only [Option.some.injEq] at hsome
      subst result
      cases h
      norm_num at hp
  | none =>
    obtain ⟨out1, hout1, h⟩ := bind_ok_inv _ _ _ h
    rcases out1 with ⟨i3, i4, t1, a1, exp21, lr1⟩
    have hlr1 := ParserSlowLoopInfinityResult
      F64.Insts.Dec2flt_modelNumImpTraitsFloatU64
      ({ m := 0#u64, p_biased := 2047#i32 } :
        num.imp.dec2flt.common.BiasedFp)
      i1 i2 t a exp2 (i3, i4, t1, a1, exp21, lr1) hout1
    cases lr1 with
    | some result =>
      rcases hlr1 with hnone | hsome
      · contradiction
      · simp only [Option.some.injEq] at hsome
        subst result
        cases h
        rfl
    | none =>
      obtain ⟨exp22, hexp22, h⟩ := bind_ok_inv _ _ _ h
      obtain ⟨out2, hout2, h⟩ := bind_ok_inv _ _ _ h
      rcases out2 with ⟨d1, exp23⟩
      have hexp23 : -1022 ≤ exp23.val :=
        ParserSlowLoopMinimumExponent _ _ _ hout2
      change (do
        let i5 ← F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.EXP_MIN
        _) = ok b at h
      rw [hmin] at h
      simp only [bind_tc_ok] at h
      obtain ⟨i6, hi6, h⟩ := bind_ok_inv _ _ _ h
      obtain ⟨i7, hi7, h⟩ := bind_ok_inv _ _ _ h
      have hi6v : i6.val = exp23.val - (-1022) := by
        have he := IScalar.sub_equiv exp23 ((-1022)#i32)
        rw [hi6] at he
        exact he.2.1
      have hi7v : i7.val = i6.val + 1 := by
        have he := IScalar.add_equiv i6 (1#i32)
        rw [hi7] at he
        exact he.2.1
      by_cases hsat : i7 ≥ 2047#i32
      · simp only [hsat, if_true] at h
        cases h
        rfl
      · simp only [hsat, if_false] at h
        change (do
          let i8 ← F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.SIG_BITS
          _) = ok b at h
        rw [hsig] at h
        simp only [lift, bind_tc_ok] at h
        obtain ⟨i9, hi9, h⟩ := bind_ok_inv _ _ _ h
        obtain ⟨i10, hi10, h⟩ := bind_ok_inv _ _ _ h
        obtain ⟨d2, hd2, h⟩ := bind_ok_inv _ _ _ h
        obtain ⟨mantissa, hmantissa, h⟩ := bind_ok_inv _ _ _ h
        obtain ⟨i11, hi11, h⟩ := bind_ok_inv _ _ _ h
        by_cases hcarry : d2 ≥ i11
        · simp only [hcarry, if_true] at h
          obtain ⟨d3, hd3, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨exp24, hexp24, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨mantissa1, hmantissa1, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨i13, hi13, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨i14, hi14, h⟩ := bind_ok_inv _ _ _ h
          by_cases hsat2 : i14 ≥ 2047#i32
          · simp only [hsat2, if_true] at h
            cases h
            norm_num
          · simp only [hsat2, if_false] at h
            obtain ⟨i15, hi15, h⟩ := bind_ok_inv _ _ _ h
            obtain ⟨power2, hpower2, h⟩ := bind_ok_inv _ _ _ h
            obtain ⟨i16, hi16, h⟩ := bind_ok_inv _ _ _ h
            by_cases hlow : mantissa1 < i16
            · simp only [hlow, if_true] at h
              obtain ⟨power21, hpower21, h⟩ := bind_ok_inv _ _ _ h
              obtain ⟨i17, hi17, h⟩ := bind_ok_inv _ _ _ h
              obtain ⟨i18, hi18, h⟩ := bind_ok_inv _ _ _ h
              cases h
              change power21.val = 2047 at hp
              have hexp24v : exp24.val = exp23.val + 1 := by
                have he := IScalar.add_equiv exp23 (1#i32)
                rw [hexp24] at he
                exact he.2.1
              have hi13v : i13.val = exp24.val - (-1022) := by
                have he := IScalar.sub_equiv exp24 ((-1022)#i32)
                rw [hi13] at he
                exact he.2.1
              have hi14v : i14.val = i13.val + 1 := by
                have he := IScalar.add_equiv i13 (1#i32)
                rw [hi14] at he
                exact he.2.1
              have hi15v : i15.val = exp24.val - (-1022) := by
                have he := IScalar.sub_equiv exp24 ((-1022)#i32)
                rw [hi15] at he
                exact he.2.1
              have hpower2v : power2.val = i15.val + 1 := by
                have he := IScalar.add_equiv i15 (1#i32)
                rw [hpower2] at he
                exact he.2.1
              have hpower21v : power21.val = power2.val - 1 := by
                have he := IScalar.sub_equiv power2 (1#i32)
                rw [hpower21] at he
                exact he.2.1
              change ¬ 2047 ≤ i14.val at hsat2
              exfalso
              omega
            · simp only [hlow, if_false, bind_tc_ok] at h
              obtain ⟨i17, hi17, h⟩ := bind_ok_inv _ _ _ h
              obtain ⟨i18, hi18, h⟩ := bind_ok_inv _ _ _ h
              cases h
              change power2.val = 2047 at hp
              have hexp24v : exp24.val = exp23.val + 1 := by
                have he := IScalar.add_equiv exp23 (1#i32)
                rw [hexp24] at he
                exact he.2.1
              have hi13v : i13.val = exp24.val - (-1022) := by
                have he := IScalar.sub_equiv exp24 ((-1022)#i32)
                rw [hi13] at he
                exact he.2.1
              have hi14v : i14.val = i13.val + 1 := by
                have he := IScalar.add_equiv i13 (1#i32)
                rw [hi14] at he
                exact he.2.1
              have hi15v : i15.val = exp24.val - (-1022) := by
                have he := IScalar.sub_equiv exp24 ((-1022)#i32)
                rw [hi15] at he
                exact he.2.1
              have hpower2v : power2.val = i15.val + 1 := by
                have he := IScalar.add_equiv i15 (1#i32)
                rw [hpower2] at he
                exact he.2.1
              change ¬ 2047 ≤ i14.val at hsat2
              exfalso
              omega
        · simp only [hcarry, if_false] at h
          obtain ⟨i13, hi13, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨power2, hpower2, h⟩ := bind_ok_inv _ _ _ h
          obtain ⟨i14, hi14, h⟩ := bind_ok_inv _ _ _ h
          by_cases hlow : d2 < i14
          · simp only [hlow, if_true] at h
            obtain ⟨power21, hpower21, h⟩ := bind_ok_inv _ _ _ h
            obtain ⟨i15, hi15, h⟩ := bind_ok_inv _ _ _ h
            obtain ⟨i16, hi16, h⟩ := bind_ok_inv _ _ _ h
            cases h
            change power21.val = 2047 at hp
            have hi13v : i13.val = exp23.val - (-1022) := by
              have he := IScalar.sub_equiv exp23 ((-1022)#i32)
              rw [hi13] at he
              exact he.2.1
            have hpower2v : power2.val = i13.val + 1 := by
              have he := IScalar.add_equiv i13 (1#i32)
              rw [hpower2] at he
              exact he.2.1
            have hpower21v : power21.val = power2.val - 1 := by
              have he := IScalar.sub_equiv power2 (1#i32)
              rw [hpower21] at he
              exact he.2.1
            change ¬ 2047 ≤ i7.val at hsat
            exfalso
            omega
          · simp only [hlow, if_false, bind_tc_ok] at h
            obtain ⟨i15, hi15, h⟩ := bind_ok_inv _ _ _ h
            obtain ⟨i16, hi16, h⟩ := bind_ok_inv _ _ _ h
            cases h
            change power2.val = 2047 at hp
            have hi13v : i13.val = exp23.val - (-1022) := by
              have he := IScalar.sub_equiv exp23 ((-1022)#i32)
              rw [hi13] at he
              exact he.2.1
            have hpower2v : power2.val = i13.val + 1 := by
              have he := IScalar.add_equiv i13 (1#i32)
              rw [hpower2] at he
              exact he.2.1
            change ¬ 2047 ≤ i7.val at hsat
            exfalso
            omega

end dec2flt_model

Proof structure

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

Explore this dependency tree

Inspect related source (151)
More program dependencies (109)
Standard-library dependencies (39)

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 106 entries
Technical checking records
Local closure summary
{
  "node": "ParserSlowInfinityMantissa",
  "closure_version": "patch_c_v1",
  "active_decl_hash": "e00d8a4fd776f420985aab54c77be07be6732234eaeae4454d4b070a928c2fa7",
  "active_statement_hash": "2f7b1d8a0cc922b8090c5656937ebef74d6dd9f7a7a221dc015de3a3c95aa4dc",
  "kernel_axioms": [
    "Classical.choice",
    "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-136",
  "boundary_theorems": {},
  "strict_theorem_deps": {
    "ParserExponentConstants": "e2a30a7b0c5e9c91",
    "ParserSlowLoopInfinityResult": "aa891aefb58dedf9",
    "ParserSlowLoopMinimumExponent": "276f4842202df35f",
    "ParserSlowLoopZeroResult": "9260d2d32b2b038c",
    "num_imp_dec2flt_slow_parse_long_mantissa": "0eb6fb2627d0ff5c",
    "num_imp_traits_Float_EXP_BIAS_default": "39417be39e20ce5d",
    "num_imp_traits_Float_EXP_BITS_default": "9ab622d85ef04d94",
    "num_imp_traits_Float_EXP_MIN_default": "39417be39e20ce5d",
    "num_imp_traits_Float_EXP_SAT_default": "9ab622d85ef04d94",
    "num_imp_traits_Float_SIG_BITS_default": "9ab622d85ef04d94"
  },
  "strict_definition_deps": {
    "F64": "ec4e25fbaf4e11d4",
    "F64_Insts_Dec2flt_modelNumImpTraitsFloatU64": "94095c9bf79da164",
    "F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_BITS": "d9fd91641cb78c5e",
    "F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SIG_TOTAL_BITS": "887b52d84a3fc9c4",
    "num_imp_dec2flt_common_BiasedFp": "31d81cf1cf22709f",
    "num_imp_dec2flt_common_BiasedFp_zero_pow2": "0f99ae12c6707137",
    "num_imp_dec2flt_decimal_seq_DecimalSeq": "59bf1ff9fe88fa8d",
    "num_imp_dec2flt_decimal_seq_DecimalSeq_left_shift": "fd298e37d5ae4f86",
    "num_imp_dec2flt_decimal_seq_DecimalSeq_right_shift": "1aaf1bb11c0b6a49",
    "num_imp_dec2flt_decimal_seq_DecimalSeq_round": "8ea3c058fea09978",
    "num_imp_dec2flt_decimal_seq_parse_decimal_seq": "244cf8318357caab",
    "num_imp_dec2flt_slow_parse_long_mantissa": "f4b1825aa46c08b9",
    "num_imp_traits_Float": "426bf608517697dc"
  }
}
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:d2578f8e74f3678978e8e78ef7275a2b13a66010c8c9766ee45ec09be3cbd8db",
  "superseded_for_theorem_closure": false
}
Review verdicts
{
  "corr_status": "Pass",
  "substantiveness_status": "Pass"
}