I have the following goal:
image.png
It seems to be straightforward but all of simp/auto/metis fails.
As a naive guess, I think it is because the implications here are all meta-implications and I maybe they have to be put in the assumption list before automatic tools can use them in the intended way. So how should I do this?
First it is easier to include the code here for copy-paste
forall x. P x \/ Q x
is not the same as (forall x. P x) \/ (forall x. Q x)
datatype form = VAR "num"
| FALSE
| DISJ "form" "form"
| NOT "form"
| DIAM "form"
record 'a frame =
world :: "'a ⇒ bool"
rel :: "'a ⇒ 'a ⇒ bool"
record 'a model = "'a frame" +
valt :: "num ⇒ 'a ⇒ bool"
fun satis :: "'a model ⇒ 'a ⇒ form ⇒ bool"
where
"satis M w (VAR p) ⟷ (valt M p w ∧ world M w)"
| "satis M w FALSE ⟷ False"
| "satis M w (NOT f) ⟷ world M w ∧ ¬ satis M w f"
| "satis M w (DISJ f1 f2) ⟷ satis M w f1 ∨ satis M w f2"
| "satis M w (DIAM f) ⟷ world M w ∧ (∃ v. rel M w v ∧ world M v ∧ satis M v f)"
lemma satis_only_in_worlds: "∀w. satis M w f ⟹ world M w"
proof (induct rule:form.induct)
case (VAR x)
then show ?case by simp
next
case FALSE
then show ?case by simp
next
case (DISJ x1a x2)
then show ?case apply simp done sorry
next
case (NOT x)
then show ?case by simp
next
case (DIAM x)
then show ?case simp
qed
think of forall n::natural number. even n \/ odd n
.
Oh the second w is blue!
I see, I need more parentheses.
Actually, the easiest solution is to drop the forall completely
stuff get explicitly meta-quantified
and yes green = bound, blue = free
case (DISJ x1a x2)
then show ?case apply simp
by blast
That works. But how would a mature user write it?
"by" should be an abbreviation of apply and done. But if I change it, Isabelle complains about the syntax again.
Mathias Fleury said:
stuff get explicitly meta-quantified
Great reminder, I should do that.
lemma satis_only_in_worlds: "satis M w f ⟹ world M w"
proof (induct rule:form.induct)
case (VAR x)
then show ?case by simp
next
case FALSE
then show ?case by simp
next
case (DISJ x1a x2)
then show ?case apply simp by blast
next
case (NOT x)
then show ?case by simp
next
case (DIAM x)
then show ?case
by fastforce
qed
So here is a complete Isar proof that merely works! I had no experience with Isar and actually, any theorem prover that supports forward, readable proof. I would like suggestions to make this proof neater according to Isar conventions.
What I usually do in cases like this where I have a bunch of cases that are just calls to simp
, is to do them all at the end:
lemma satis_only_in_worlds: "satis M w f ⟹ world M w"
proof (induct rule:form.induct)
- case (VAR x)
- then show ?case by simp
-next
- case FALSE
- then show ?case by simp
-next
case (DISJ x1a x2)
- then show ?case apply simp by blast
+ then show ?case by auto (* not sure if this works, but auto is roughly simp + blast *)
-next
- case (NOT x)
- then show ?case by simp
next
case (DIAM x)
then show ?case
by fastforce
-qed
+qed simp_all
Jan van Brügge said:
What I usually do in cases like this where I have a bunch of cases that are just calls to
simp
, is to do them all at the end:lemma satis_only_in_worlds: "satis M w f ⟹ world M w" proof (induct rule:form.induct) - case (VAR x) - then show ?case by simp -next - case FALSE - then show ?case by simp -next case (DISJ x1a x2) - then show ?case apply simp by blast + then show ?case by auto (* not sure if this works, but auto is roughly simp + blast *) -next - case (NOT x) - then show ?case by simp next case (DIAM x) then show ?case by fastforce -qed +qed simp_all
Thanks! The auto works. That is good to know.
in general you can use try0
at a proof to see what isabelle methods can finish the proof
Thanks! I will try out how powerful it is soon.
Last updated: Dec 21 2024 at 16:20 UTC