(** ** 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_ind_subst :
forall P : forall f : logic, form f -> Prop,
(forall (b : logic) (t t0 : term), P b (Pr t t0)) ->
(forall b : logic, P b Q) ->
P full ⊥ ->
(forall (b : logic) (f2 : form b), P b f2 -> forall f3 : form b, P b f3 -> P b (f2 --> f3)) ->
(forall (b : logic) (n : var) (f4 : form b), (forall x, P b (subst n x f4)) -> P b (∀ n; f4)) -> forall (f5 : logic) (f6 : form f5), P f5 f6.