lib: add fun_upd_swap

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
This commit is contained in:
Michael McInerney 2024-01-10 00:00:06 +10:30 committed by Achim D. Brucker
parent a8d4685081
commit 0160613c1a
1 changed files with 4 additions and 0 deletions

View File

@ -2558,6 +2558,10 @@ lemma ranD:
"v \<in> ran f \<Longrightarrow> \<exists>x. f x = Some v"
by (auto simp: ran_def)
lemma fun_upd_swap:
"a \<noteq> c \<Longrightarrow> hp(c := d, a := b) = hp(a := b, c := d)"
by fastforce
text \<open>Prevent clarsimp and others from creating Some from not None by folding this and unfolding
again when safe.\<close>