Library HoTT.Spaces.Finite.Tactics

Require Import HoTT.Basics Fin.

Tactics


Ltac FinIndOn X := repeat
  match type of X with
  | Fin 0 ⇒ destruct X
  | Emptydestruct X
  | Unitdestruct X
  | Fin ?ndestruct X as [X|X]
  | ?L + Unitdestruct X as [X|X]
  end.

This tactic can be used to generate n cases from a goal like forall (x : Fin n), _
Ltac FinInd := let X := fresh "X" in intro X; FinIndOn X.