mathlib documentation

tactic.​fin_cases

tactic.​fin_cases

Checks that the expression looks like x ∈ A for A : finset α, multiset α or A : list α, and returns the type α.

fin_cases h performs case analysis on a hypothesis of the form h : A, where [fintype A] is available, or h ∈ A, where A : finset X, A : multiset X or A : list X.

fin_cases * performs case analysis on all suitable hypotheses.

As an example, in

example (f :   Prop) (p : fin 3) (h0 : f 0) (h1 : f 1) (h2 : f 2) : f p.val :=
begin
  fin_cases *; simp,
  all_goals { assumption }
end

after fin_cases p; simp, there are three goals, f 0, f 1, and f 2.