Zulip Chat Archive

Stream: new members

Topic: Custom cases


Gareth Ma (Feb 02 2023 at 17:34):

Hi. I have the following code:

example {p : [X]} (h : p = (3 / 2) * X ^ 2 + 1) : p.support = {0, 2} :=
begin
  rw finset.ext_iff,
  intro a, -- a ∈ p.support ↔ a ∈ {0, 2}
end

And I would like to prove the goal by applying cases, splitting on whether a ∈ {0, 2} or not. How can I do this?
(My plan afterwards it to split the polynomial into sum of many monomials, then p.coeff n = sum (pi.coeff n), which is 0 if n is not in {0, 2}.

Kevin Buzzard (Feb 02 2023 at 22:32):

by_cases h : a \in {0,2}

Kevin Buzzard (Feb 02 2023 at 22:32):

But there's little point splitting on this because it's one of the sides of the iff. Just do split.


Last updated: Dec 20 2023 at 11:08 UTC