Given a goal like this:
⋀a x. f x ⟹ x = T a ⟹ Q
what is the best way to rewrite the premises to
⋀a. f (T a) ⟹ Q
? I could hack something together with SUBPROOF
but there has to be a better way
You could do this:
lemma a: "(⋀a x. f x ⟹ x = T a ⟹ PROP Q) ≡ (⋀a. f (T a) ⟹ PROP Q)"
proof
fix a assume "⋀a x. f x ⟹ x = T a ⟹ PROP Q" "f (T a)"
from this(1)[OF this(2), of a] show "PROP Q" by simp
next
fix a x assume "⋀a. f (T a) ⟹ PROP Q" "f x" "x = T a"
from this(1)[of a] this(2,3) show "PROP Q" by simp
qed
lemma "⋀a x. f x ⟹ x = T a ⟹ Q"
apply(tactic ‹CONVERSION (Conv.rewr_conv @{thm a}) 1›)
I don't know f
nor T
statically, so this won't work. I guess the SUBPROOF
hack it is
But this works for any f and T?
oh, yes of course, I am stupid
Weird, now I am at ⋀b3 z3. b3 = z3 ⟹ b3 = z3
but assume_tac
fails
The types do match, right?
yes
all are 'c
You can try printing the term literally without pretty-printing. Also the context you pass in is the right one?
Const ("Pure.all", "('c ⇒ prop) ⇒ prop") $
Abs ("b3", "'c",
Const ("Pure.all", "('c ⇒ prop) ⇒ prop") $
Abs ("z3", "'c",
Const ("Pure.imp", "prop ⇒ prop ⇒ prop") $
(Const ("HOL.Trueprop", "bool ⇒ prop") $ (Const ("HOL.eq", "'c ⇒ 'c ⇒ bool") $ Bound 1 $ Bound 0)) $
(Const ("HOL.Trueprop", "bool ⇒ prop") $
(Const ("HOL.eq", "'c ⇒ 'c ⇒ bool") $ Bound 1 $ Bound 0))))
Yes, there is only one context. Also apply assumption
after the tactic solves the goal as expected
Last updated: Jul 15 2022 at 23:21 UTC