For some iff thms generated from induction, it will obviously loop when we expend it, say:
height_le ?r ?Op ?R ?a1.0 ?a2.0 =
(?a1.0 = ?r ∧ ?a2.0 = 0 ∨
(∃w n m vl v.
?a1.0 = v ∧ ?a2.0 = n + 1 ∧ height_le ?r ?Op ?R w n ∧ m ∈ ?Op ∧ ?R m (w # vl) ∧ v ∈ set vl))
But sometimes I would still want to expand it only once to see how the goal looks like. Is there anything that only apply the unfolding/rw only once?
apply (subst ...)
(possibly with position specification like subst (asm)(4)
) or apply (rewrite ....)
(possibly with rewrite at ... in ...
)
Mathias Fleury said:
apply (subst ...)
(possibly with position specification likesubst (asm)(4)
) orapply (rewrite ....)
(possibly withrewrite at ... in ...
)
subst works for me in the sense that
...
then have hle_v_suc_n:"height_le r τ R v (n + 1)"
apply (subst height_le.simps)
gives
w ∈ generated_set τ R {r} ⟹
v = r ∧ n + 1 = 0 ∨
(∃w na m vl va.
v = va ∧ n + 1 = na + 1 ∧ height_le r τ R w na ∧ m ∈ τ ∧ R m (w # vl) ∧ va ∈ set vl)
rewrite reports error
Undefined method: "rewrite"⌂
Oh maybe imports...
yeah rewrite is somewhere
https://isabelle.in.tum.de/website-Isabelle2020/dist/library/HOL/HOL-ex/Rewrite_Examples.html
Great! Thanks!
HOL-Library.Rewrite
and the link is the tutorial
Nice to see it exists!
Last updated: Dec 21 2024 at 16:20 UTC