Stream: Archive Mirror: Isabelle Users Mailing List

Topic: [isabelle] Mistakes in Proving


view this post on Zulip Email Gateway (Aug 18 2022 at 16:13):

From: miramirkhani@ce.sharif.edu
Dear All,

I want to prove a simple theorem. The proof seems to be straightforward
but I can’t figure out the mistakes I’m making.

The first three lemmas bellow are proved and I want to prove the 4th
lemma. P is a predicate and f,g,h and r are functions.

  1. [iff] "P(x) -> f(x) \<in> g(x)"

  2. [iff]"P(x)-> ( f(x) \<in> r(g((x)) )"

  3. "y \<in> r(g(z)) => y \<in> h(w)"

  4. "P(x) -> f(x) \<in> h(w)"

I give the first two to the simplifier by using the iff attribute, then I
add the 3rd lemma to the simplification rules and use the simp method but
it fails and I get :
“Empty result sequence
.”.

What’s wrong with my proof?

Any hints would be of a great help to me

view this post on Zulip Email Gateway (Aug 18 2022 at 16:13):

From: Lukas Bulwahn <bulwahn@in.tum.de>
Hello Najma,

I copied your lemmas to Isabelle, corrected the syntax and used the
counterexample generators refute and nitpick (based on SAT solving
technology) to find an counterexample why the fourth does not follow
from the first three:

lemma
assumes "P x --> f x \<in> g x"
assumes "P x --> f x \<in> r (g x)"
assumes "y \<in> r(g z) --> y \<in> h w"
shows "P x --> f x \<in> h w"
refute
nitpick[show_consts]

Both tools output a model that show that you cannot derive the fourth
from the first three in general.

refute says:

* Model found: *
Size of types: 'a: 2, 'b: 1, 'c: 1
w: c0
h: {(c0, {(b0, False)})}
y: b0
z: a0
r: {({(b0, True)}, {(b0, True)}), ({(b0, False)}, {(b0, False)})}
f: {(a0, b0), (a1, b0)}
g: {(a0, {(b0, False)}), (a1, {(b0, True)})}
x: a1
P: {(a0, False), (a1, True)}

and nitpick says:

Nitpick found a counterexample for card 'a = 2, card 'b = 2, and card 'c
= 2:

Constants:
P = {a1, a2?}
f = (%x. _)(a1 := b1)
g = (%x. _)(a1 := {b1}, a2 := {})
h = (%x. _)(c1 := {b2?}, c2 := ?)
r = (%x. _)({b1, b2} := ?, {b1} := {b1, b2?}, {b2} := ?, {} := {b1?})
w = c1
x = a1
y = b2
z = a2

But just try it yourself...

So in your case, you are either trying to prove something that does not
hold (the counterexample should give you a hint why not) or
the proof is really dependent on the definitions of the functions f,
g,h,r and predicate P.

I hope this helps.

Lukas

view this post on Zulip Email Gateway (Aug 18 2022 at 16:13):

From: Viorel Preoteasa <viorel.preoteasa@abo.fi>
Hello Najma, Lukas,

It seems that Lukas' counter example is for a different problem
than the original one.

It is important what are constants and what are variables in
the original lemmas of Najma. If P, f, g, r and h are constants,
and all other are variables, than lemma 4 is provable using lemmas
2 and 3.

consts
f1 :: "'a => 'b"
g1 :: "'a => 'b set"
r1 :: "'b set => 'b set"
h1 :: "'c => 'b set"
P1 :: "'a => bool";

lemma B1: "P1(x) ==> ( f1(x) \<in> r1(g1((x)) ))";
sorry;

lemma C1: "y \<in> r1(g1(z)) ==> y \<in> h1(w)";
sorry;

lemma "P1(x) ==> f1(x) \<in> h1(w)"
apply (rule C1);
apply (rule B1);
by simp;

Automating this proof is a different problem that I don't know how
to answer.

Best regards,

Viorel

view this post on Zulip Email Gateway (Aug 18 2022 at 16:13):

From: Lars Noschinski <noschinl@in.tum.de>
In this case it would by solved "by (auto intro: B1 C1).

view this post on Zulip Email Gateway (Aug 18 2022 at 16:14):

From: Lars Noschinski <noschinl@in.tum.de>
The simplifier can only make use of the third lemma if it can prove its
precondition to be true (to see why it cannot solve this, you can look
at the simplifier's trace). As the third lemma is not an equation, you
are better off using it as an introduction rule (using the rule method
or e.g. the intro: option of auto).

view this post on Zulip Email Gateway (Aug 18 2022 at 16:14):

From: miramirkhani@ce.sharif.edu
Thanks so much to Lukas and Viorel for their help. According to the
Viorel’s post, the lemma could be proved easily but my first two lemmas
use longrightarrow (-->) instead of Longrightarrow( ==>)and that was the
point that made me confused about the proof and I thought it should be
proved. So using refute I got a counter example.


Last updated: Mar 28 2024 at 20:16 UTC