Require Export Coq.Lists.List.
Section Lindenbaum.
Context {A: Type}
(CA: Countable A)
(init: Ensemble A)
(P: Ensemble A -> Prop).
Fixpoint LindenbaumChain (n: nat): Ensemble A :=
match n with
| 0 => init
| S n => fun a => LindenbaumChain n a \/ CA a n /\ P (Union _ (LindenbaumChain n) (Singleton _ a))
end.
Definition LindenbaumConstruction: Ensemble A :=
fun a => exists n, LindenbaumChain n a.

(* Specifications: *)
Lemma Lindenbaum_included_n_m: forall n m,
n <= m ->
Included _ (LindenbaumChain n) (LindenbaumChain m).
Lemma Lindenbaum_included_n_omega: forall n,
Included _ (LindenbaumChain n) LindenbaumConstruction.
Lemma Lindenbaum_included:
Included _ init LindenbaumConstruction.
Lemma Lindenbaum_pointwise_finite_decided: forall a n,
CA a n ->
(LindenbaumChain (S n) a) <-> (LindenbaumConstruction a).
Lemma Lindenbaum_finite_witness:
forall xs, Forall LindenbaumConstruction xs ->
exists n, Forall (LindenbaumChain n) xs.