Section CONSTRUCTIVE_FACTS.
Variant Th (X : ensemble formula) (b : formula) : Prop :=
| In_Th
(INFERS : X ⊢ b)
: b \in Th X.
#[local] Hint Constructors Th : core.
#[global]
Add Parametric Morphism :
Th with signature (eqProp ==> eqProp)
as Th_lifts_eqProp.
Proof with reflexivity || eauto.
eapply isFilter_intro.
- exists trueB. econstructor.
eapply ImplicationI, ByAssumption; done!.
- intros x1 x2 [INFERS1] [INFERS2].
econstructor. eapply ConjunctionI; done!.
- intros x [INFERS] x' x_le_x'. apply leB_iff in x_le_x'.
econstructor. eapply Cut_property. exact INFERS.
eapply extend_infers with (Gamma := E.singleton x); done!.
Qed.
Proof with eauto.
intros b [xs ?]; des. apply andsB_le_iff in andsB_LE.
destruct andsB_LE as [X' [xs_repr_X' INFERS]].
econstructor. eapply extend_infers...
intros z z_in. eapply FINITE_SUBSET, xs_repr_X'...
Qed.
#[local] Hint Resolve fact1_of_1_2_8 fact2_of_1_2_8 fact3_of_1_2_8 fact4_of_1_2_8 fact5_of_1_2_8 lemma1_of_1_2_11 inconsistent_compatWith_isSubsetOf inconsistent_cl_iff : core.
Proof with eauto with *.
split; intros INCONSISTENT.
- eapply inconsistent_cl_iff.
eapply inconsistent_compatWith_isSubsetOf with (X := F)...
- eapply inconsistent_compatWith_isSubsetOf with (X := cl F)...
eapply inconsistent_cl_iff...
Qed.
Fixpoint axiom_set (X : ensemble formula) (n : nat) {struct n} : ensemble formula :=
match n with
| O => X
| S n' => E.union (axiom_set X n') (insertion (improveFilter (Th X) n') n')
end.
Proof with eauto with *.
revert X. induction n as [ | n IH]; [reflexivity | intros X b].
simpl. unfold Insertion. rewrite cl_eq_Th, IH. split; intros b_in.
- rewrite <- cl_eq_Th. rewrite <- cl_eq_Th in b_in. revert b b_in.
change ((cl (E.union (Th (axiom_set X n)) (insertion (Th (axiom_set X n)) n))) \subseteq (cl (E.union (axiom_set X n) (insertion (Th (axiom_set X n)) n)))).
transitivity (cl (cl (E.union (axiom_set X n) (insertion (Th (axiom_set X n)) n)))).
+ eapply fact4_of_1_2_8. intros b [b_in | b_in].
* rewrite <- cl_eq_Th in b_in. revert b b_in. eapply fact4_of_1_2_8. ii; left...
* rewrite cl_eq_Th. econstructor. eapply ByAssumption. right...
+ eapply fact5_of_1_2_8...
- rewrite <- cl_eq_Th. rewrite <- cl_eq_Th in b_in. revert b b_in.
eapply fact4_of_1_2_8. intros b [b_in | b_in].
+ left. econstructor. eapply ByAssumption...
+ right...
Qed.

Lemma completeness_theorem_prototype (X : ensemble formula) (b : formula) (env : propLetter -> Prop)
(ENTAILS : X ⊨ b)
(EQUICONSISTENT : equiconsistent (Th (E.insert (NegationF b) X)) (evalFormula env))
(SUBSET : Th (E.insert (NegationF b) X) \subseteq evalFormula env)
(IS_FILTER : isFilter (evalFormula env))
: X ⊢ b.