I want to use ex_neg_all_pos to refine the following goal:
proof (state)
goal (2 subgoals):
1. ⋀M w. (⋀f1 f2. (f1, f2) ∈ set (zip fl1 fl2) ⟹ ∀M w. asatis M w f1 = asatis M w f2) ⟹
length fl1 = length fl2 ⟹
(⋀f1 f2. (f1, f2) ∈ set (zip fl1 fl2) ⟹ ∀M w. asatis M w f1 = asatis M w f2) ⟹
length fl1 = length fl2 ⟹
w ∈ world M ⟹
∃vl. length vl = length fl1 ∧ rel M m (w # vl) ∧ (∀x y. (x, y) ∈ set (zip vl fl1) ⟶ asatis M x y) ⟹
w ∈ world M ∧
(∃vl. length vl = length fl2 ∧ rel M m (w # vl) ∧ (∀x y. (x, y) ∈ set (zip vl fl2) ⟶ asatis M x y))
I unfold with ex_neg_all_pos, and want to eliminate the ∃vl.
in
∃vl. length vl = length fl1 ∧ rel M m (w # vl) ∧ (∀x y. (x, y) ∈ set (zip vl fl1) ⟶ asatis M x y)
It does not work. How can I get it to work, in the sense of pulling the existential to the very front?
Ideally I want the same effect as rewriting with PULL_EXISTS in HOL4:
PULL_EXISTS;
val it =
⊢ ∀P Q.
((∃x. P x) ⇒ Q ⇔ ∀x. P x ⇒ Q) ∧ ((∃x. P x) ∧ Q ⇔ ∃x. P x ∧ Q) ∧
(Q ∧ (∃x. P x) ⇔ ∃x. Q ∧ P x): them
Another example that I want to use ex_neg_all_pos:
proof (prove)
using this:
∃m fl. phi = ♢m fl ∧ m ∈ ops sig ∧ length fl = arity sig m ∧ (∀f. f ∈ set fl ⟶ f ∈ deg_wffs n sig)
?c ∈ quotient' (deg_wffs n sig) (cequivr TYPE('a)) ⟹ f ?c ∈ ?c
goal (1 subgoal):
1. ∃phi0. phi0 ∈ cDIAMs_comb sig (f ` quotient' (deg_wffs n sig) (cequivr TYPE('a))) ∧ cequiv TYPE('a) phi phi0
I want to eliminate ?m fl
in
∃m fl. phi = ♢m fl ∧ m ∈ ops sig ∧ length fl = arity sig m ∧ (∀f. f ∈ set fl ⟶ f ∈ deg_wffs n sig)
When I see such a long goal, my reaction is:
1. either auto will solve it with some help (auto + sledgehammer + combining the two tactics in one line). In this case, the question is not really relevant
2. or auto will not work, in which case you want Isar. And in this case, the question is not really relevant either, because you can use obtain.
So, why?
For trying it out, this works:
lemma ‹P ⟹ (∃x. Q x ⟹ H) ›
apply clarify
But again, auto is doing it too
Clarify works, thanks and this is what I want. Just discovered that I can do:
proof (intro impI allI iffI,elim conjE, auto)
, i.e. use auto without the apply mode.
Yeah but no, do not do that
This is really bad for maintenance
So is clarify better?
The output of auto can change across version (or if you later add a simp rule)
Or I should just use "obtain" to make it easier for maintenance?
obtain is better
Mathias Fleury said:
The output of auto can change across version (or if you later add a simp rule)
How can I add a simp rule that pulling all the existential to the very top?
clarify is useful for exploration (is there a way to get this done fast?)
I think I like the aspect of Isar that keeps critical points of proofs clearer, but I am annoyed when I need to use Isar just to treat the logical operations.
Yiming Xu said:
Mathias Fleury said:
The output of auto can change across version (or if you later add a simp rule)
How can I add a simp rule that pulling all the existential to the very top?
The very point of simp rules is that they work for HOL stuff, aka not across ==>
(yes there is a Pure.simp, but it is very limited)
Not across ==>
is very unfortunate...
Should not be too hard to get some volunteer implement it. But it would be another story.
Yiming Xu said:
I think I like the aspect of Isar that keeps critical points of proofs clearer, but I am annoyed when I need to use Isar just to treat the logical operations.
why would you? For such a goal, I would:
Especially since the original goal looks like an induction of some sort, using (is _)
to name things is not hard at all.
I would think an ideal way of using Isar is "only write the steps that tells the real story of the proof". But I will admit that this is my excuse of being lazy.
I will learn to live with it. I do use some "is", but often forget that.
Also: you are not using list_induct2
for the prof right?
No, but what's the story of list_induct2
?
Yiming Xu said:
I will learn to live with it. I do use some "is", but often forget that.
BTW, one trick that I learned after way too long: is _ is _ is _
works
for naming several things at once
Ha? What is the syntax?
Yiming Xu said:
No, but what's the story of
list_induct2
?
It should just be a better induction principle for what you are trying to do
I was not using any sort of induction but this principle sounds sensible. I think I can do a inductive argument using this as well... Let me try.
lemma
assumes ‹((f1, f2) ∈ set (zip fl1 fl2) ⟹ ∀M w. asatis M w f1 = asatis M w f2)› (is ‹?P ⟹ ?Q› is ‹_ ∈ ?H ⟹ _›)
shows P
proof -
term ?H
term ?P
term ?Q
Yiming Xu said:
I was not using any sort of induction but this principle sounds sensible. I think I can do a inductive argument using this as well... Let me try.
(⋀f1 f2. (f1, f2) ∈ set (zip fl1 fl2) ⟹ ∀M w. asatis M w f1 = asatis M w f2)
looks a lot like an induction principle to me
Mathias Fleury said:
lemma assumes ‹((f1, f2) ∈ set (zip fl1 fl2) ⟹ ∀M w. asatis M w f1 = asatis M w f2)› (is ‹?P ⟹ ?Q› is ‹_ ∈ ?H ⟹ _›) shows P proof - term ?H term ?P term ?Q
I see this is wonderful.
Mathias Fleury said:
Yiming Xu said:
I was not using any sort of induction but this principle sounds sensible. I think I can do a inductive argument using this as well... Let me try.
(⋀f1 f2. (f1, f2) ∈ set (zip fl1 fl2) ⟹ ∀M w. asatis M w f1 = asatis M w f2)
looks a lot like an induction principle to me
I think you are right, lists sort-of born for an induction.
Last updated: Dec 30 2024 at 16:22 UTC