Zulip Chat Archive

Stream: new members

Topic: Inverse of Quot.sound


Matei Adriel (Apr 18 2022 at 17:06):

Is there any way to go from Quot.mk r a = Quot.mk r b to r a b?

Chris B (Apr 18 2022 at 17:40):

Looks like docs#quotient.eq

Chris B (Apr 18 2022 at 17:42):

Actually docs#quotient.exact is just the direction you want. eq is iff.

Kevin Buzzard (Apr 18 2022 at 17:42):

[note that this is Lean 3]

Chris B (Apr 18 2022 at 17:47):

Oh right, capital letters. https://leanprover-community.github.io/mathlib4_docs/Init/Core.html#Quotient.exact

Henrik Böving (Apr 18 2022 at 17:47):

We've mapped the mathlib4_docs links to docs4# btw.

Kevin Buzzard (Apr 18 2022 at 18:00):

docs4#Quot.exact docs4#Quotient.exact

Kevin Buzzard (Apr 18 2022 at 18:03):

If Quot is "quotient by the equivalence relation generated by r" then it's not possible to go from Quot.mk r a = Quot.mk r b to r a b (because maybe r a c and r c b are true instead) but I'm not entirely sure what Quot is.

Chris B (Apr 18 2022 at 18:21):

Ah, good eye, I glossed over Quot as Quotient.

Mauricio Collares (Apr 18 2022 at 19:11):

Quot is defined in Lean core, and is explained in https://leanprover.github.io/theorem_proving_in_lean4/axioms_and_computation.html. But Kevin's point stands: If r is not already an equivalence relation, the converse might not be true. If r is an equivalence relation, you should use Quotient instead of Quot, which is also defined in core.

Mauricio Collares (Apr 18 2022 at 19:15):

@Matei Adriel There's some useful discussion in the above link if you Ctrl-F for "Given r as above".

Matei Adriel (Apr 18 2022 at 19:31):

Yep, I was using Quotient, but used simp to try and remove as many layers of function calls as possible. Quotient.exact looks exactly like what I need

Mario Carneiro (Apr 18 2022 at 19:39):

Matei Adriel said:

Yep, I was using Quotient, but used simp to try and remove as many layers of function calls as possible.

Don't do this, this is a common newbie mistake. Only unfold definitional layers if you have no other choice; if you unfold more than one layer of definitions then that means you are either missing an API lemma or are ignoring the one that exists


Last updated: Dec 20 2023 at 11:08 UTC