(* propriété de chaine strictement croissante bornée *)
Definition bounded_sas_chain (A : Set) (T : mEnsemble A)
(r : mRelation A) (n : nat) : Prop :=
forall p : prechain A, sas_chain A T r p -> chain_length A p <= n.
Definition def_ok_app (A : Set) (T : mEnsemble A) (f : Map A -> Map A) :
Prop := forall x : Map A, T x -> T (f x).
Definition increasing_app (A : Set) (r : mRelation A)
(f : Map A -> Map A) : Prop := forall x y : Map A, r x y -> r (f x) (f y).
Definition fix_point (A : Set) (T : mEnsemble A) (f : Map A -> Map A)
(x : Map A) : Prop := T x /\ f x = x.
Definition inf_fix_points (A : Set) (T : mEnsemble A)
(r : mRelation A) (f : Map A -> Map A) (x : Map A) : Prop :=
forall y : Map A, fix_point A T f y -> r x y.
Definition lower_fix_point (A : Set) (T : mEnsemble A)
(r : mRelation A) (f : Map A -> Map A) (x : Map A) : Prop :=
fix_point A T f x /\ inf_fix_points A T r f x.
(* itération d'une fonction *)
Fixpoint iteres (A : Set) (f : Map A -> Map A) (x : Map A)
(n : nat) {struct n} : prechain A :=
match n with
| O => single A x
| S p =>
match iteres A f x p with
| single y => concat A (single A y) (f y)
| concat z y => concat A (concat A z y) (f y)
end
end.
Fixpoint power (A : Set) (f : A -> A) (x : A) (n : nat) {struct n} : A :=
match n with
| O => x
| S n => f (power A f x n)
end.
Inductive MapFlag (A : Set) : Set :=
| flag_true : Map A -> MapFlag A
| flag_false : Map A -> MapFlag A.

Lemma MapFlag_sum :
forall (A : Set) (f : MapFlag A),
exists x : Map A, f = flag_true A x \/ f = flag_false A x.