Zulip Chat Archive

Stream: general

Topic: set theory grunt work


Patrick Massot (Jun 25 2020 at 20:30):

I need to prove the following (hoping I didn't mess up my lemma extraction):

example {α : Type*}
  (U₁ V₁ U₂ V₂ : set α)
  (VU₁ : V₁  U₁)
  (VU₂ : V₂  U₂)
  (H : U₁  U₂ = )
  (u v w : α)
  (u_in : u  V₁)
  (v_in : v  V₂)
  (huw : (u, w)  (U₁.prod U₁)  (U₂.prod U₂)  ((-(V₁  V₂)).prod $ -(V₁  V₂)))
  (hwv : (w, v)  (U₁.prod U₁)  (U₂.prod U₂)  ((-(V₁  V₂)).prod $ -(V₁  V₂))) :
  (u, w)  U₁.prod U₁ :=
sorry

Is there anything smart I could do here (besides taking an intern to prove it)?

Patrick Massot (Jun 25 2020 at 20:31):

The real world proof is to draw four circles on a piece of paper.

Patrick Massot (Jun 25 2020 at 20:31):

Or, if you have strong opinion about pictures like Bourbaki, not doing anything.

Rob Lewis (Jun 25 2020 at 20:38):

I didn't even try to process what this is saying, but are you sure it's stated right? simp [set.prod] at *, tauto! reduces it to something unprovable.

Rob Lewis (Jun 25 2020 at 20:39):

tauto being the usual go-to for set theory grunt work.

Patrick Massot (Jun 25 2020 at 20:41):

Yes, it's correct, although I forgot to remove that last assumption which is useless (it's used for the variant you have to prove next).

Patrick Massot (Jun 25 2020 at 20:42):

Because V1 is disjoint from U2 and U3.

Rob Lewis (Jun 25 2020 at 20:43):

Oh, sorry, the result of tauto is provable (there's a contradiction in the hypotheses).

Patrick Massot (Jun 25 2020 at 20:44):

Indeed.

Alistair Tucker (Jun 25 2020 at 21:01):

What's U\3? I don't see it

Patrick Massot (Jun 25 2020 at 21:07):

Sorry, U3 is -(V₁ ∩ V₂)

Patrick Massot (Jun 25 2020 at 21:07):

Wait, I messed up something.

Patrick Massot (Jun 25 2020 at 21:08):

I meant union of V1 and V2, not intersection.

Chris Hughes (Jun 25 2020 at 21:09):

example : ¬  {α : Type*}
  (U₁ V₁ U₂ V₂ : set α)
  (VU₁ : V₁  U₁)
  (VU₂ : V₂  U₂)
  (H : U₁  U₂ = )
  (u v w : α)
  (u_in : u  V₁)
  (v_in : v  V₂)
  (huw : (u, w)  (U₁.prod U₁)  (U₂.prod U₂)  ((-(V₁  V₂)).prod $ -(V₁  V₂)))
  (hwv : (w, v)  (U₁.prod U₁)  (U₂.prod U₂)  ((-(V₁  V₂)).prod $ -(V₁  V₂))),
  (u, w)  U₁.prod U₁ :=
begin
  assume h,
  simpa using @h bool {tt} {tt} {ff} {ff} (by simp) (by simp)
    (by simp [set.ext_iff]) tt ff ff (by simp) (by simp)
end

Chris Hughes (Jun 25 2020 at 21:09):

It's false

Patrick Massot (Jun 25 2020 at 21:10):

Yes, I messed up the statement, as I wrote above.

Patrick Massot (Jun 25 2020 at 21:10):

Sorry about that.

Patrick Massot (Jun 25 2020 at 21:10):

It's too hot here.

Chris Hughes (Jun 25 2020 at 21:11):

In that case finish [set.ext_iff, set.subset_def] works

Patrick Massot (Jun 25 2020 at 21:12):

Thanks!

Patrick Massot (Jun 25 2020 at 21:14):

My computer is stupid, but fortunately Chris isn't.

Patrick Massot (Jun 25 2020 at 21:17):

(But Kenny will hate you for that)

Jalex Stark (Jun 25 2020 at 21:21):

if you post the correct statement i'll look for something faster than finish

Patrick Massot (Jun 25 2020 at 21:23):

The correct statement is:

example {α : Type*}
  (U₁ V₁ U₂ V₂ : set α)
  (VU₁ : V₁  U₁)
  (VU₂ : V₂  U₂)
  (H : U₁  U₂ = )
  (u v w : α)
  (u_in : u  V₁)
  (v_in : v  V₂)
  (huw : (u, w)  (U₁.prod U₁)  (U₂.prod U₂)  ((-(V₁  V₂)).prod $ -(V₁  V₂))) :
  (u, w)  U₁.prod U₁ :=
sorry

Chris Hughes (Jun 25 2020 at 21:28):

set.mem_prod.2 ((huw.resolve_right (λ h, (h.1 $ or.inl u_in))).resolve_right
    (λ h, have u  U₁  U₂, from VU₁ u_in, h.1, by rwa H at this))

Patrick Massot (Jun 25 2020 at 21:29):

I knew the smart thing do to was to take an intern.

Patrick Massot (Jun 25 2020 at 21:30):

It's still a bit sad. Let's say finish will be fast in Lean 4.

Patrick Massot (Jun 25 2020 at 21:30):

Thank you very much Chris!

Jalex Stark (Jun 25 2020 at 21:32):

fwiw here's what I ended up with; i am a worse intern than chris

example {α : Type*}
  (U₁ V₁ U₂ V₂ : set α)
  (VU₁ : V₁  U₁)
  (VU₂ : V₂  U₂)
  (H : U₁  U₂ = )
  (u v w : α)
  (u_in : u  V₁)
  (v_in : v  V₂)
  (huw : (u, w)  (U₁.prod U₁)  (U₂.prod U₂)  ((-(V₁  V₂)).prod $ -(V₁  V₂))) :
  (u, w)  U₁.prod U₁ :=
begin
  simp only [set.ext_iff, set.subset_def, set.mem_empty_eq, set.compl_union, set.mem_inter_eq, not_and, set.prod_mk_mem_set_prod_eq,
 set.mem_union_eq, set.mem_compl_eq, iff_false] at *,
  split, { tauto },
  have := H u,
  tauto,
end

Patrick Massot (Jun 25 2020 at 21:35):

Thanks anyway. tauto is way faster than finish

Patrick Massot (Jun 25 2020 at 21:35):

And I wouldn't be worried to be a worse intern that Chris...

Bryan Gin-ge Chen (Jun 25 2020 at 21:45):

Working through this was kind of relaxing...

import tactic

example {α : Type*}
  (U₁ V₁ U₂ V₂ : set α)
  (VU₁ : V₁  U₁)
  (VU₂ : V₂  U₂)
  (H : U₁  U₂ = )
  (u v w : α)
  (u_in : u  V₁)
  (v_in : v  V₂)
  (huw : (u, w)  (U₁.prod U₁)  (U₂.prod U₂)  ((-(V₁  V₂)).prod $ -(V₁  V₂))) :
  (u, w)  U₁.prod U₁ :=
begin
simp only [set.ext_iff, set.subset_def, set.mem_empty_eq, set.compl_union, set.mem_inter_eq, not_and, set.prod_mk_mem_set_prod_eq,
  set.mem_union_eq, set.mem_compl_eq, iff_false] at *,
  rcases huw with ⟨⟨_, _⟩ | ⟨_, _⟩⟩ | ⟨⟨_, _⟩, _, _⟩,
  { split, assumption', },
  { have h := H u (VU₁ u u_in), contradiction, },
  { contradiction, },
end

Patrick Massot (Jun 25 2020 at 21:46):

We should collaborate more, we have very complementary ways of relaxing.

Patrick Massot (Jun 29 2020 at 21:35):

I have another one: what is the automated procedure that should have avoided proving by hand:

lemma chore {α : Type*} {U V S A B : set α} : (U  S  A)  (V  S  B) = ((U  A)  (V  B))  S :=
by  rw [inter_right_comm, inter_right_comm V, union_inter_distrib_right]

Rob Lewis (Jun 29 2020 at 21:39):

by { ext, simp, tauto! }

Patrick Massot (Jun 29 2020 at 22:21):

Thanks! I didn't try the right combination. I still wish it could be only one tactic.

Simon Hudon (Jun 29 2020 at 22:22):

you could have meta def set_theory := `[ext; simp; tauto!]. It's a pretty flexible approach


Last updated: Dec 20 2023 at 11:08 UTC