Stream: Beginner Questions

Topic: ✔ Why is this not working?


view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:32):

image.png

view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:40):

curiously, it works if I use auto instead of .. (or more explicitly conjI) which is very weird

view this post on Zulip Kevin Kappelmann (Jul 15 2026 at 14:41):

B, C is not the same as B /\ C, and conjI is exactly the theorem allowing you to prove the latter from the former.

view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:42):

I am trying to prove B /\ C from B, C using conjI and it is not working as you can see in the screenshot. Maybe this is a bug.

view this post on Zulip Kevin Kappelmann (Jul 15 2026 at 14:46):

You're passing C, B not B, C:

notepad
begin
  assume "A" "B"
  from ‹A› ‹B› have "A ∧ B" .. (*OK*)
  from ‹B› ‹A› have "A ∧ B" .. (*not OK*)
end

view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:48):

I guess there is no rule overloading in isabelle, but is there really no conjI2 or something for these cases?

view this post on Zulip Kevin Kappelmann (Jul 15 2026 at 14:50):

You can prove that lemma if you like it.
In practice, people don't write such proofs because automation takes care of such irrelevances (so nobody misses the rule).
I don't know what you mean by rule overloading.

view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:51):

rule overloading is where you cite the same rule and it functions as different rules depending on certain other factors. for example, one might cite iffD and it will choose iffD1 or iffD2 based on context (or something)

view this post on Zulip Notification Bot (Jul 15 2026 at 14:53):

Yoav Cohen has marked this topic as resolved.

view this post on Zulip Kevin Kappelmann (Jul 15 2026 at 14:54):

You can make a theorem collection iffD which contains iffD1 and iffD2: lemmas iffD = iffD1 iffD2.

view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:54):

And then I can cite it as a rule?

view this post on Zulip Kevin Kappelmann (Jul 15 2026 at 14:55):

if by rule you mean an argument passed to the rule method, then yes.

view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:55):

I am not sure what that means, I was just thinking like "by"

view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:55):

oh you mean like (rule something)?

view this post on Zulip Kevin Kappelmann (Jul 15 2026 at 14:55):

like this:

lemma conj_swapI: "A ⟹ B ⟹ B ∧ A" by auto
lemmas conj_intros = conjI conj_swapI

notepad
begin
  assume "A" "B"
  from ‹A› ‹B› have "A ∧ B" by (rule conj_intros) (*OK*)
  from ‹B› ‹A› have "A ∧ B" by (rule conj_intros) (*OK*)
end

view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:56):

omg that is so cool, double thanks

view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:56):

also so for my thing I wanted conj_swapI?

view this post on Zulip Kevin Kappelmann (Jul 15 2026 at 14:57):

I suppose so.

view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:57):

does this work with like modus ponens too?

view this post on Zulip Kevin Kappelmann (Jul 15 2026 at 14:59):

yes: lemmas mps = mp rev_mp

view this post on Zulip Yoav Cohen (Jul 15 2026 at 14:59):

why is this one swap and this one rev??

view this post on Zulip Kevin Kappelmann (Jul 15 2026 at 15:01):

Because those are human made-up names. You can name them in any way you like.

view this post on Zulip Yoav Cohen (Jul 15 2026 at 15:02):

like why is it not consistent though?

view this post on Zulip Kevin Kappelmann (Jul 15 2026 at 15:03):

Because I just gave conj_swapI some name without having consistency of naming wrt rev_mp in mind. Don't overthink it.

view this post on Zulip Yoav Cohen (Jul 15 2026 at 15:04):

oh wait I just realized my confusion. I am very sorry, I thought those were built-in because I missed the line in which you defined it.


Last updated: Jul 17 2026 at 17:14 UTC