(** ** Generalised Induction *)
Fixpoint size {b} (phi : form b) :=
match phi with
| Pr _ _ | Q | Fal => 1
| Impl phi1 phi2 => 1 + size phi1 + size phi2
| All n phi => 1 + size phi
end.

Lemma form_logic_ind_subst :
forall P : form frag -> Prop,
(forall t t0 : term, P (Pr t t0)) ->
P Q ->
(forall f3 : form frag, P f3 -> forall f4 : form frag, P f4 -> P (f3 --> f4)) ->
(forall (n : var) (f6 : form frag), (forall x, P (subst n x f6)) -> P (∀ n; f6)) -> forall f8 : form frag, P f8.