From: Patrick Nicodemus <gadget142@gmail.com>
I got a strange result from Nitpick.
theory ProductCategory
imports Main
begin
record ('obj, 'arr) Precategory =
hom :: "'obj ⇒ 'obj ⇒ 'arr set"
comp :: "'obj ⇒ 'obj ⇒ 'obj ⇒ 'arr ⇒ 'arr ⇒ 'arr"
locale Assoc =
fixes C :: "('obj, 'arr) Precategory"
assumes
comp_assoc : "⟦ f ∈ hom C w x ; g ∈ hom C x y ; h ∈ hom C y z ⟧ ⟹
comp C w y z (comp C w x y f g) h = comp C w x z f (comp C x y z g h)"
definition ProductPrecategory :: "('objC, 'arrC) Precategory ⇒ ('objD,
'arrD) Precategory ⇒
('objC × 'objD, 'arrC × 'arrD) Precategory" where
"ProductPrecategory C D ≡
⦇
hom = λ c1 c2. (hom C (fst c1) (fst c2)) × (hom D (snd c1) (snd c2)),
comp = λ c1 c2 c3 f g.
(comp C (fst c1) (fst c2) (fst c3) (fst f) (fst g),
comp D (snd c1) (snd c2) (snd c3) (snd f) (snd g))
⦈"
theorem test : "Assoc C ⟹
f ∈ hom (ProductPrecategory C D) x y ⟹ (fst f) ∈ hom C (fst x) (fst y)"
by (metis (no_types, lifting) ProductPrecategory_def SigmaD1 ext_inject
prod.exhaust_sel surjective)
theorem test2 : "Assoc C ⟹
f ∈ hom (ProductPrecategory C D) x y ⟹ (fst f) ∈ hom C (fst x) (fst y)"
nitpick
I wrote the following code. To my surprise Nitpick claims to find a
counterexample to the claim I just proved. What is going on here?
I originally posted this to the Isabelle zulip chat so apologies for
reposting it but Mathias Fleury also said it was weird.
From: Mathias Fleury <mathias.fleury12@gmail.com>
Just because I already looked a bit at that problem (see
https://isabelle.zulipchat.com/#narrow/stream/238552-Beginner-Questions/topic/Nitpick.3F).
By using:
|nitpick[eval="hom C (fst x) (fst y)"]|
it seems that nitpick believes that f is in the set, while auto can
prove that the set is actually empty |(hom (ProductPrecategory C D) x y)
= {}, so f cannot be in the set. I have no idea why this is the case…
|
Mathias |
---|
From: Jasmin Blanchette <jasmin.blanchette@ifi.lmu.de>
Dear Patrick, Mathias,
Yes, this is weird indeed. I knew after all these years that Nitpick isn't fully sound, so I'm not entirely surprised. The example is nicely self-contained, so I'll have a look in the coming days and see if I can isolate the issue.
Thanks for the report.
Best,
Jasmin
Last updated: Jan 04 2025 at 20:18 UTC