Zulip Chat Archive

Stream: new members

Topic: Is there a way to "name" the arguments to a theorem?


kvanvels (Aug 16 2022 at 16:43):

I am trying prove the following (rather trivial) statement. Let AA and BB be sets. Then the sets ABA\setminus B, ABA\cap B, and BAB\setminus A are pairwise disjoint and their union is ABA \cup B.

If I was doing this on pen and paper, I would name the sets something like P1=ABP_1 = A \setminus B, P2=ABP_2 = A \cap B and P3=BAP_3 = B\setminus A. And show that P1P2=P_1\cap P_2 = \emptyset, P1P3=P_1\cap P_3 = \emptyset, P2P3=P_2\cap P_3 = \emptyset and P1P2P3=ABP_1\cup P_2\cup P_3 = A\cup B. Is there a way to do this (name the arguments in this way) in lean? Is there a tactic/best practice of which I should know about regarding disjoint sets?

I appreciate any help and direction.

Yaël Dillies (Aug 16 2022 at 16:45):

docs#tactic.interactive.set is what you want if you're talking about naming the sets within the proofs. If you want to name the sets within the statement, you will instead need let bindings.

kvanvels (Aug 16 2022 at 17:01):

Thank you, I will follow up if I have more questions.


Last updated: Dec 20 2023 at 11:08 UTC