Catalog entry
docs/lean4-proof-propositions.md lines 75-83:
SSZ-2: A Uint64 value lies in [0, 2^64)
- Source:
Uint64 (type definition)
theorem uint64_range (v : Uint64) :
v.toNat < 2 ^ 64 := by sorry
Goal
Commit the theorem:
theorem uint64_range (v : Uint64) : v.toNat < 2 ^ 64
Implementation notes
- The Lean type
Uint64 is defined in LeanSpec/Types/Uint.lean:37 as structure Uint64 where val : UInt64. The catalog uses v.toNat, which is not yet defined on the wrapper.
- Add a
toNat accessor on Uint8/16/32/64 in LeanSpec/Types/Uint.lean (consistent set across all four widths to avoid one-off divergence later):
namespace Uint64
@[inline] def toNat (v : Uint64) : Nat := v.val.toNat
end Uint64
- Prove
uint64_range using UInt64.toNat_lt (the exact lemma name should be confirmed by reading Init.Data.UInt.Basic at implementation time; an equivalent lemma like UInt64.toFin_lt may apply).
- Place the new theorem in
LeanSpec/Theorems/Uint.lean, alongside the existing length_law_Uint64 and encode_decode_Uint8.
- Update
docs/lean4-proof-propositions.md: replace the sorry stub with a pointer such as ✅ proved in `LeanSpec/Theorems/Uint.lean` as `uint64_range`. Bump the frontmatter last_updated.
Acceptance criteria
Catalog entry
docs/lean4-proof-propositions.mdlines 75-83:Goal
Commit the theorem:
Implementation notes
Uint64is defined inLeanSpec/Types/Uint.lean:37asstructure Uint64 where val : UInt64. The catalog usesv.toNat, which is not yet defined on the wrapper.toNataccessor onUint8/16/32/64inLeanSpec/Types/Uint.lean(consistent set across all four widths to avoid one-off divergence later):uint64_rangeusingUInt64.toNat_lt(the exact lemma name should be confirmed by readingInit.Data.UInt.Basicat implementation time; an equivalent lemma likeUInt64.toFin_ltmay apply).LeanSpec/Theorems/Uint.lean, alongside the existinglength_law_Uint64andencode_decode_Uint8.docs/lean4-proof-propositions.md: replace thesorrystub with a pointer such as✅ proved in `LeanSpec/Theorems/Uint.lean` as `uint64_range`.Bump the frontmatterlast_updated.Acceptance criteria
lake buildsucceeds.grep -n "sorry\|axiom" LeanSpec/Theorems/Uint.leanreturns nothing.docs/lean4-proof-propositions.mdSSZ-2 entry updated; frontmatterlast_updatedbumped.