Skip to content
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

Fix default value for hash_collision in EVMState #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Coda-Coda
Copy link
Collaborator

This fixes the default value for hash_collision as defined in EVMState.lean

false is a Bool. The intended default value.
False is the Prop representing a contradiction, not the intended default value of hash_collision, but since False is a decidable proposition, Lean automatically treats this as decide False which is a Bool. Although we can actually prove false = False in Lean, using false directly is preferable.

The way this is handled in Lean leads to the following:
theorem false_eq_false : false = false := by rfl -- succeeds (of course)
theorem false_eq_False₁ : false = False := by rfl -- fails
theorem false_eq_False₂ : false = False := by simp -- succeeds

This has implications when doing proofs relating to the default value for hash_collision, such as here:

(currently in the branch WIP-erc20-daniel-3). Changing the default value for hash_collision back to False there causes lake build +Generated.erc20shim.ERC20Shim.fun_allowance_user to fail. We could work around this in the proof, but it seems better to fix EVMState.lean instead.

`false` is a `Bool`. The intended default value.
`False` is the `Prop` representing a contradiction, not the intended default value of `hash_collision`, but since `False` is a decidable proposition, Lean automatically treats this as `decide False` which is a `Bool`.
Although we can actually prove `false = False` in Lean, using `false` directly is preferable.
@Coda-Coda Coda-Coda requested a review from Julek October 29, 2024 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant