Zulip Chat Archive

Stream: general

Topic: Congruence closure


Yury G. Kudryashov (Jan 21 2020 at 16:17):

Hi, what cc tactic can do?

Yury G. Kudryashov (Jan 21 2020 at 16:17):

Docs say "Tries to prove the main goal using congruence closure."

Yury G. Kudryashov (Jan 21 2020 at 16:18):

But no examples

Reid Barton (Jan 21 2020 at 16:22):

Basically it can reason about equality

Patrick Massot (Jan 21 2020 at 16:31):

https://github.com/leanprover-community/mathlib/blob/master/docs/tactics.md#cc-congruence-closure

Rob Lewis (Jan 21 2020 at 16:41):

(or https://leanprover-community.github.io/mathlib_docs/tactics.html#cc%20(congruence%20closure) )

Moses Schönfinkel (Jan 21 2020 at 16:44):

I've also grep'd for cc in whatever file I currently have open to give you a practical example. These are the kinds of things I use it for normally.

this : l₂h = y
 (x, y) = (x, l₂h)
eq₁ : {x := a, y := r} = hd,
h₁ : {x := px, y := py} = hd
 py = r

I am not sure whether it's an overkill for these but there you go - I use it to show equality "through" structures.

Jesse Michael Han (Jan 21 2020 at 16:49):

cc can also discharge some otherwise gnarly heterogeneous equality goals

Mario Carneiro (Jan 21 2020 at 21:40):

both of those are cases, refl for me


Last updated: Dec 20 2023 at 11:08 UTC