Zulip Chat Archive
Stream: new members
Topic: Moetrash 2x
Moetrash 2x (Nov 07 2022 at 00:31):
hi can i get some help with a couple of lean problems?
Moetrash 2x (Nov 07 2022 at 00:32):
if anyone is willing to help me learn and understand please DM me. Thank you!
Eric Rodriguez (Nov 07 2022 at 00:33):
feel free to ask in #new members!
Moetrash 2x (Nov 07 2022 at 00:36):
got it thank you so much!
Moetrash 2x (Nov 07 2022 at 00:38):
Hi can someone please guide me step by step with this problem I have really been struggling with it?
Moetrash 2x (Nov 07 2022 at 00:38):
import data.set
open set
-- 1. Replace "sorry" in these examples.
section
variable {U : Type}
variables A B C : set U
example : ∀ x, x ∈ A ∩ C → x ∈ A ∪ B :=
sorry
example : ∀ x, x ∈ (A ∪ B)ᶜ → x ∈ Aᶜ :=
sorry
end
Eric Wieser (Nov 07 2022 at 00:53):
That problem looks the same as this homework question: https://www.chegg.com/homework-help/questions-and-answers/write-code-following-proofs-using-lean-theorem-prover-import-dataset-open-set-1-replace-so-q104337641.
Notification Bot (Nov 07 2022 at 00:54):
4 messages were moved here from #general > Lean in the wild by Eric Wieser.
Notification Bot (Nov 07 2022 at 00:54):
3 messages were moved here from #new members > How to check element is in set by Eric Wieser.
Moetrash 2x (Nov 07 2022 at 00:58):
it is but no answer is provided :C
Eric Wieser (Nov 07 2022 at 01:24):
Also here from two years ago
Eric Wieser (Nov 07 2022 at 01:28):
Is this a problem from a course, or from a text"book" / lean tutorial?
Moetrash 2x (Nov 07 2022 at 01:35):
hey it is from lean textbook example problem
Arien Malec (Nov 07 2022 at 02:41):
On this one
example : ∀ x, x ∈ A ∩ C → x ∈ A ∪ B :=
sorry
a logical first step is to pull out the premises, which in tactics mode is done via
example : ∀ x, x ∈ A ∩ C → x ∈ A ∪ B :=
begin
intros x h,
sorry
end
and in term is done
example : ∀ x, x ∈ A ∩ C → x ∈ A ∪ B :=
λ x, λ h: x ∈ A ∩ C, sorry
The actual proving is going to go from the hypothesis (that x ∈ A ∩ C
) and allow you to construct the conclusion. I'd highly recommend you look at the docs for data.set.basic
, particularly the theorems about intersections and unions. In general you want to use the the hypothesis to prove something the helps you construct the conclusion.
Arien Malec (Nov 07 2022 at 02:42):
I'm sure if you have a pen and pencil proof, or some sense for how you want the proof to go in Lean, and are struggling with syntax, you'd get plenty of help.
Yaël Dillies (Nov 07 2022 at 08:34):
I'm not sure that will help, @Arien Malec, those lemmas are almost all proved from lattice lemmas
Arien Malec (Nov 07 2022 at 16:42):
This is OP’s homework…
Last updated: Dec 20 2023 at 11:08 UTC