(** * FOL Reductions *)
Require Export FOL.PCP Deduction.
(** ** Validity *)
Section validity.
Notation u := 0. Notation v := 1.
Context {b : logic}.
Variable R : BSRS.
Definition prep (x : string bool) (t : term) : term := fold_right t_f t x.
Definition iprep domain eta {I : interp domain eta} (x : list bool) (y : domain) := fold_right i_f y x.
Definition enc s := (prep s t_e).
Definition F1 := map (fun '(x,y) => Pr (enc x) (enc y)) R.
Definition F2 := map (fun '(x, y) => ∀ u; ∀ v; Pr u v --> Pr (prep x u) (prep y v)) R.
Definition F3 := (∀ u; Pr u u --> Q).
Definition F : form b := F1 ==> F2 ==> F3 --> Q.

Lemma prep_subst y t1 x t :
subst_t y t1 (prep x t) = prep x (subst_t y t1 t).