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

clr_match tactic #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Clear/State.lean
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,27 @@ lemma lookup_initcall_5 (ha : ve ≠ va) (hb : ve ≠ vb) (hc : ve ≠ vc) (hd :
rw [lookup_insert']
aesop

-- TODO: Option.get!_some in newer mathlib
theorem come_get!_some {α} [Inhabited α] {a : α} : (some a).get! = a := rfl

open Lean Meta Elab Tactic in
elab "clr_match" : tactic => do
evalTactic <| ← `(tactic| (
simp only [lookup!, setEvm, Fin.isValue, insert_of_ok,
multifill_cons, multifill_nil', Finmap.lookup_insert,
come_get!_some, isOk_Ok]
rw [← State.insert_of_ok]
))

open Lean Meta Elab Tactic in
elab "clr_match" "at" h:ident : tactic => do
evalTactic <| ← `(tactic| (
simp only [lookup!, setEvm, Fin.isValue, insert_of_ok,
multifill_cons, multifill_nil', Finmap.lookup_insert,
come_get!_some, isOk_Ok] at $h:ident
repeat rw [← State.insert_of_ok] at $h:ident
))

end

end State