From Undecidability.FOL Require Import FSAT.
From Undecidability.FOL.Util Require Import Syntax_facts FullTarski_facts sig_bin.
Require Import Undecidability.Synthetic.Definitions.
Require Import Vector Lia.

Set Default Goal Selector "!".

Definition exclosure phi : form :=
  let (N, _) := find_bounded in exist_times N .

Lemma exclosure_closed phi :
  bounded 0 (exclosure ).
Proof.
  unfold exclosure. destruct find_bounded as [N HN]. now apply exists_close_form.
Qed.


Definition form2cform phi : cform :=
  exist _ (exclosure ) (exclosure_closed ).

Theorem reduction :
  FSATd FSATdc.
Proof.
  exists form2cform. intros ; unfold FSATdc; cbn.
  unfold exclosure. destruct find_bounded as [N HN].
  split; intros (D & M & & & & & ); exists D, M.
  - exists . repeat split; trivial. eapply subst_exist_sat; eauto.
  - apply subst_exist_sat2 in as [ H]. exists . repeat split; trivial.
Qed.