-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding lemmas about EVM state and addresses #7
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
lemma top_lt_UInt256_size : top < UInt256.size := by decide | ||
lemma top_le_UInt256_size : top ≤ UInt256.size := le_of_lt top_lt_UInt256_size | ||
|
||
lemma ofUInt256_lt_UInt256_size {u : UInt256} : ↑(ofUInt256 u) < UInt256.size := by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shorted version that doesn't use open simp
s:
lemma ofUInt256_lt_UInt256_size {u : UInt256} : ↑(ofUInt256 u) < UInt256.size := by
unfold ofUInt256 Fin.ofNat
trans (2 ^ 160) <;>
simp only [UInt256.size, Nat.reducePow, Nat.reduceAdd, gt_iff_lt, Nat.ofNat_pos, Nat.mod_lt, Nat.reduceLT]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, we have a strong preference for only using open simp
s as a closing tactic.
@jkopanski asked me to make a series of pull requests (#6 #7 #8 #9) bringing in work from the
erc20
branch that is applicable more generally. This one adds lemmas about the EVM state and addresses.All except #9 should be able to be merged in any order.
I have tested that
lake build
succeeds.