0

I'm trying to prove the following lemma:

lemma myLemma6: "(∀x. A(x) ∧ B(x))= ((∀x. A(x)) ∧ (∀x. B(x)))"

I'm trying to start by eliminating the forall quantifiers, so here's what I tried:

lemma myLemma6: "(∀x. A(x) ∧ B(x))= ((∀x. A(x)) ∧ (∀x. B(x)))"
  apply(rule iffI)
  apply ( erule_tac x="x" in allE)
  apply (rule allE)
  (*goal now: get rid of conj on both sides and the quantifiers on right*)
  apply (erule conjE) (*isn't conjE supposed to be used with elim/erule?*)
  apply (rule allI)
  apply (assumption)
  
  
  apply ( rule conjI) (*at this point, the following starts to make no sense... *)
    
   apply (rule conjE) (*should be erule?*)
   apply ( rule conjI)
   apply ( rule conjI)

  ...

At the end I just started to act depending on the outcome of the previous apply, but it seems wrong to me, probably because there's some mistake in the beginning... Could someone please explain to me my error and how to finish this proof correctly?

Thanks in advance

1 Answer 1

3

Eliminating the universal quantifier at this early stage is not a good idea because you don't even have any value that you could plug in at that point (the x that you give is not in scope at that point, which is why it is printed with that orange background in Isabelle/jEdit).

After you do iffI you have two goals:

goal (2 subgoals):
 1. ∀x. A x ∧ B x ⟹ (∀x. A x) ∧ (∀x. B x)
 2. (∀x. A x) ∧ (∀x. B x) ⟹ ∀x. A x ∧ B x

Let's focus on the first one for now. You should first apply the introduction rules on the right-hand side, namely conjI and allI. That leaves you with

goal (3 subgoals):
 1. ⋀x. ∀x. A x ∧ B x ⟹ A x
 2. ⋀x. ∀x. A x ∧ B x ⟹ B x
 3. (∀x. A x) ∧ (∀x. B x) ⟹ ∀x. A x ∧ B x

Now you can apply allE instantiated with x and the first goal becomes ⋀x. A x ∧ B x ⟹ A x, which you can then solve with erule conjE and assumption. The second goal works similarly.

For the last goal, it is similar again: apply the introduction rules first, then apply the elimination rules and assumption and you're done.

Of course, all the standard provers for Isabelle such as auto, force, blast and even the simple ones like metis, meson, iprover can easily solve this automatically, but that's probably not what you were going for here.

5
  • Addendum: myLemma6 is already available from the standard library as all_conj_distrib: thus, it is possible to use by (rule all_conj_distrib) to prove it; also, it is possible to avoid explicit instantiations, resulting in a more concise proof of the entire theorem: by (rule iffI; (intro conjI allI; elim allE conjE)) (this comment is an amended variant of a previously posted comment that I deleted). Jan 15, 2021 at 19:37
  • I really appreciate the explanation between the lines of code. I understood the idea. The entire trick is not eliminate too early! Thanks a lot for this tip. Also Do you mind explaining what are the weird ?PXX I was getting when I did things in the wrong order? is that a kind of "placeholder" to be proven later or sth?
    – user206904
    Jan 15, 2021 at 20:59
  • @user9716869 , Thanks for the addendum, I appreciate it too. I'm taking things slow, this my first time learning Isabelle, so that's why I'm not using any "quick cheats" like all_conj_distrib, auto, blast, etc. But your tip will surely come in handy later when I start to use it for some real life usage and beyond the steps of learning. Also may I ask, if this how we do all_conj_distrib, is "ex_disj_distrib" similar? just changing all "conj" to "disj" and all "All" to "ex" ? or does require something smarter?
    – user206904
    Jan 15, 2021 at 21:02
  • nvm the last question about ex_disj_distrib, I just tried it myself :)
    – user206904
    Jan 15, 2021 at 22:26
  • 1
    Variables starting with a ? are schematic variables. These are basically things you can fill in as you go. You can avoid them by instantiating the rules you are applying with the right value for them. Generally, schematic variables in the goal state do not mix well with automation and I would say that people try to avoid them these days. Jan 15, 2021 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.