Section WEAK_COMPLETENESS.
Definition ContradictionF_bool : bool :=
false.
Definition NegationF_bool (b1 : bool) : bool :=
match b1 with
| true => false
| false => true
end.
Definition ConjunctionF_bool (b1 : bool) (b2 : bool) : bool :=
match b1, b2 with
| true, true => true
| true, false => false
| false, true => false
| false, false => false
end.
Definition DisjunctionF_bool (b1 : bool) (b2 : bool) : bool :=
match b1, b2 with
| true, true => true
| true, false => true
| false, true => true
| false, false => false
end.
Definition ImplicationF_bool (b1 : bool) (b2 : bool) : bool :=
match b1, b2 with
| true, true => true
| true, false => false
| false, true => true
| false, false => true
end.
Definition BiconditionalF_bool (b1 : bool) (b2 : bool) : bool :=
match b1, b2 with
| true, true => true
| true, false => false
| false, true => false
| false, false => true
end.
Fixpoint eval_bool (env : propLetter -> bool) (p : formula) {struct p} : bool :=
match p with
| AtomF i => env i
| ContradictionF => ContradictionF_bool
| NegationF p1 => NegationF_bool (eval_bool env p1)
| ConjunctionF p1 p2 => ConjunctionF_bool (eval_bool env p1) (eval_bool env p2)
| DisjunctionF p1 p2 => DisjunctionF_bool (eval_bool env p1) (eval_bool env p2)
| ImplicationF p1 p2 => ImplicationF_bool (eval_bool env p1) (eval_bool env p2)
| BiconditionalF p1 p2 => BiconditionalF_bool (eval_bool env p1) (eval_bool env p2)
end.
Definition finite_entails (Gamma : list formula) (C : formula) : Prop :=
forall e : propLetter -> bool, (forall H, In H Gamma -> eval_bool e H = true) -> eval_bool e C = true.
#[local] Hint Unfold finite_entails : simplication_hints.
Fixpoint occurs (i : propLetter) (p : formula) {struct p} : Prop :=
match p with
| AtomF i' => i = i'
| ContradictionF => False
| NegationF p1 => occurs i p1
| ConjunctionF p1 p2 => occurs i p1 \/ occurs i p2
| DisjunctionF p1 p2 => occurs i p1 \/ occurs i p2
| ImplicationF p1 p2 => occurs i p1 \/ occurs i p2
| BiconditionalF p1 p2 => occurs i p1 \/ occurs i p2
end.
Definition gen_context_for (env : propLetter -> bool) : list propLetter -> list formula :=
L.map (fun i : propLetter => if env i then AtomF i else NegationF (AtomF i)).

Lemma is_theorem_if_is_deducible_for_any_gen_context (C : formula) (ls : list propLetter)
(OCCURS : forall i : propLetter, In i ls -> occurs i C)
(INFERS : forall e : propLetter -> bool, E.fromList (gen_context_for e ls) ⊢ C)
: E.fromList [] ⊢ C.