Zulip Chat Archive

Stream: general

Topic: induction variables


Thorsten Altenkirch (Feb 21 2021 at 13:55):

What is the recommended way to supply variable name to induction and cases? I have been using with but this becomes unwieldy for more complicated inductive types.

Mario Carneiro (Feb 21 2021 at 14:10):

You can also use case, which reads better especially for big inductive types

Mario Carneiro (Feb 21 2021 at 14:12):

inductive foo
| a : ℕ → foo
| b : ℕ → ℕ → foo
| c : foo → ℕ → foo

example : foo → false :=
begin
  intro x,
  induction x,
  case a : n {
    sorry, },
  case b : m n {
    sorry, },
  case c : x n IH {
    sorry, },
end

Last updated: Feb 28 2026 at 14:05 UTC