Zulip Chat Archive

Stream: std4

Topic: rcases?


Scott Morrison (Apr 09 2023 at 08:02):

Could we have rcases? again? I found it very helpful navigating rcases.

Scott Morrison (Apr 09 2023 at 08:03):

My current pain point is just translating

import tactic.rcases

example {α : Type} {x a : α} {L : list α} (h : x  a :: L) : x = a  x  L :=
begin
  rcases h with rfl | m,
  { left, refl, },
  { right, exact m, },
end

into Lean 4... I know the definition of List.Mem is new and different, but surely I should be able to use rcases somehow? I can't find any pattern that works:

import Std.Tactic.RCases
import Mathlib.Tactic.LeftRight

example (h : x  a :: L) : x = a  x  L := by
  rcases h with _ | m    -- not this!
  · left
    rfl
  · right
    exact m

Kevin Buzzard (Apr 09 2023 at 08:08):

What happens if you just do cases' h, then edit to cases' h with <stuff>, then cases' <whatever just appeared> etc etc

Mario Carneiro (Apr 09 2023 at 08:13):

rcases h with _ | ⟨_, m⟩


Last updated: Dec 20 2023 at 11:08 UTC