Zulip Chat Archive

Stream: new members

Topic: How to split union in universal statement


Shadman Sakib (Jun 15 2021 at 15:34):

import tactic

open set

variables α I : Type*
variable  A : I  set α
variable  s : set α

-- BEGIN
open_locale classical

example : s  ( i, A i) =  i, (A i  s) :=
begin
  ext,
  rw [mem_union_eq, mem_Inter],
  rw mem_Inter,
  split,
  { intros h i,
    cases h with xs xAi,
    { rw mem_union_eq,
      right,
      exact xs, },
    { rw mem_union_eq,
      left,
      exact xAi i, }, },
  { intros h,
    right,
    intro i,
    sorry,
  },
end
-- END

Shadman Sakib (Jun 15 2021 at 15:35):

Im trying to define the union at the universal statement h, but lean will not let me. How do I define the union with the variable i and split the hypothesis?

Ruben Van de Velde (Jun 15 2021 at 15:39):

Do you want to do have h' := h i,?

Ruben Van de Velde (Jun 15 2021 at 15:40):

Oh, you went down a wrong path before that

Kevin Buzzard (Jun 15 2021 at 15:41):

left and right are dangerous tactics :-)

Shadman Sakib (Jun 15 2021 at 15:41):

Which path should I have taken?

Kevin Buzzard (Jun 15 2021 at 15:41):

both paths lead the wrong way

Shadman Sakib (Jun 15 2021 at 15:41):

And your suggestion worked, thanks

Shadman Sakib (Jun 15 2021 at 15:42):

There is a way to do the proof without specifying left or right?

Ruben Van de Velde (Jun 15 2021 at 15:43):

No, but neither is correct in all cases. Do you know the pen-and-paper proof?

Kevin Buzzard (Jun 15 2021 at 15:43):

the problem is that you don't know which way to go yet. Do you know a maths proof of what you're trying to do?

Shadman Sakib (Jun 15 2021 at 15:47):

Well h says that for all x x in s or x in A i. So I would do cases on that then prove x in s with one case and x in A i with the other

Ruben Van de Velde (Jun 15 2021 at 15:48):

Indeed - do you know how to do a case split in lean?

Kevin Buzzard (Jun 15 2021 at 15:48):

but the statement you want to do a case split on depends on a variable i

Shadman Sakib (Jun 15 2021 at 15:48):

But I cant introduce a variable i, so I settled for choosing a path

Shadman Sakib (Jun 15 2021 at 15:48):

And no I thought cases h with ... was splitting?

Kevin Buzzard (Jun 15 2021 at 15:49):

yes, the problem is that you might want to go one way for some i, and the other way for other i. So it seems to me that you don't have a pen-and-paper proof yet.

Shadman Sakib (Jun 15 2021 at 15:51):

Well not really, I would go one way based on the case x in s or x in A i. Not depending on i

Shadman Sakib (Jun 15 2021 at 15:51):

Im a bit confused about what you mean sorry

Heather Macbeth (Jun 15 2021 at 15:53):

Shadman Sakib said:

I would go one way based on the case x in s or x in A i. Not depending on i

Read what you said ... it does depend on i! :)

Ruben Van de Velde (Jun 15 2021 at 15:54):

I can't figure out the proof @Kevin Buzzard has in mind either; I managed to finish using by_cases

Shadman Sakib (Jun 15 2021 at 15:55):

by_cases xs : x in s?


Last updated: Dec 20 2023 at 11:08 UTC