match performs case analysis on one or more expressions.
See Induction and Recursion.
The syntax for the match tactic is the same as term-mode match, except that
the match arms are tactics instead of expressions.
example (n : Nat) : n = n := by
match n with
| 0 => rfl
| i+1 => simp
Equations
Instances For
Introduces one or more hypotheses, optionally naming and/or pattern-matching them.
For each hypothesis to be introduced, the remaining main goal's target type must
be a let or function type.
introby itself introduces one anonymous hypothesis, which can be accessed by e.g.assumption. It is equivalent tointro _.intro x yintroduces two hypotheses and names them. Individual hypotheses can be anonymized via_, given a type ascription, or matched against a pattern:-- ... ⊢ α × β → ... intro (a, b) -- ..., a : α, b : β ⊢ ...intro rflis short forintro h; subst h, ifhis an equality where the left-hand or right-hand side is a variable.- Alternatively,
introcan be combined with pattern matching much likefun:intro | n + 1, 0 => tac | ...