(** * Various generic lemmas that aren't present in the standard library *)
From BusyCoq Require Export LibTactics.
Set Default Goal Selector "!".
(* We are currently in a deprecation cycle where this gets changed from [auto with *] to [auto]. Opt in to silence the warning. *)
Ltac Tauto.intuition_solver ::= auto.
(* sig *)
Notation "[: x :]" := (exist _ x _).
(* sumbool *)
Notation Yes := (left _ _).
Notation No := (right _ _).
Notation Reduce x := (if x then Yes else No).
Notation "a && b" := (if a then b else No).
(* sumor *)
Notation "!!" := (inright _).
Notation "[|| x ||]" := (inleft [: x :]).
Notation "'bind' x <- a ; b" := (match a with | [|| x ||] => b | !! => No end)
(right associativity, at level 60, x pattern).
Notation "'bind' x <-- a ; b" := (match a with | [|| x ||] => b | !! => !! end)
(right associativity, at level 60, x pattern).
Fixpoint lpow {A} (l : list A) (n : nat) : list A :=
match n with
| O => []
| S n => l ++ lpow l n
end.
Notation "l ^^ n" := (lpow l n) (at level 20).

Lemma lpow_add : forall A n m (xs : list A),
xs^^(n + m) = xs^^n ++ xs^^m.