Ltac fancy := case; last first.
Notation fancy := (ltac:( fancy )).
Ltac replicate n :=
let what := fresh "_replicate_" in
move=> what; do n! [ have := what ]; clear what.
Notation replicate n := (ltac:( replicate n )).

Lemma foo x (w : nat) (J : bool -> nat -> nat) : exists y, x=0+y.