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 )).
Ltac unfld what := rewrite /what.
Notation "% n" := (ltac:( unfld n )) (at level 0) : ssripat_scope.
Notation "% n" := n : nat_scope.
Open Scope nat_scope.
Definition def := 4.

Lemma test : True -> def = 4.