(* R* fermeture reflexive-transitive d une relation binaire R *)

Inductive explicit_star (R : A -> A -> Prop) : A -> A -> Prop :=
  | star_refl : forall x : A, explicit_star R x x
  | star_trans1 :
      forall x y z : A, R x y -> explicit_star R y z -> explicit_star R x z.(* R* fermeture reflexive-transitive d une relation binaire R *)

Inductive explicit_star (R : A -> A -> Prop) : A -> A -> Prop :=
  | star_refl : forall x : A, explicit_star R x x
  | star_trans1 :
      forall x y z : A, R x y -> explicit_star R y z -> explicit_star R x z.(* R* fermeture reflexive-transitive d une relation binaire R *)

Inductive explicit_star (R : A -> A -> Prop) : A -> A -> Prop :=
  | star_refl : forall x : A, explicit_star R x x
  | star_trans1 :
      forall x y z : A, R x y -> explicit_star R y z -> explicit_star R x z.(* composition de deux relations *)

Inductive explicit_comp_rel (R1 R2 : A -> A -> Prop) : A -> A -> Prop :=
    comp_2rel :
      forall x y z : A, R1 x y -> R2 y z -> explicit_comp_rel R1 R2 x z.(* composition de deux relations *)

Inductive explicit_comp_rel (R1 R2 : A -> A -> Prop) : A -> A -> Prop :=
    comp_2rel :
      forall x y z : A, R1 x y -> R2 y z -> explicit_comp_rel R1 R2 x z.(* R+ frmeture transitive de R *)

Inductive explicit_rel_plus (R : A -> A -> Prop) : A -> A -> Prop :=
  | relplus_1step : forall x y : A, R x y -> explicit_rel_plus R x y
  | relplus_trans1 :
      forall x y z : A,
      R x y -> explicit_rel_plus R y z -> explicit_rel_plus R x z.(* R+ frmeture transitive de R *)

Inductive explicit_rel_plus (R : A -> A -> Prop) : A -> A -> Prop :=
  | relplus_1step : forall x y : A, R x y -> explicit_rel_plus R x y
  | relplus_trans1 :
      forall x y z : A,
      R x y -> explicit_rel_plus R y z -> explicit_rel_plus R x z.(* R+ frmeture transitive de R *)

Inductive explicit_rel_plus (R : A -> A -> Prop) : A -> A -> Prop :=
  | relplus_1step : forall x y : A, R x y -> explicit_rel_plus R x y
  | relplus_trans1 :
      forall x y z : A,
      R x y -> explicit_rel_plus R y z -> explicit_rel_plus R x z.Notation star := (explicit_star _) (only parsing).(* <Warning> : Syntax is discontinued *)

Notation comp_rel := (explicit_comp_rel _) (only parsing).(* <Warning> : Syntax is discontinued *)

Notation rel_plus := (explicit_rel_plus _) (only parsing).(* R confluente *)

Definition confluence_en (x : A) :=
  forall y z : A,
  explicit_star _ R x y ->
  explicit_star _ R x z ->
  exists u : A, explicit_star _ R y u /\ explicit_star _ R z u.Definition explicit_confluence := forall x : A, confluence_en x.(* R localement confluente *)

Definition local_confluence_en (x : A) :=
  forall y z : A,
  R x y ->
  R x z -> exists u : A, explicit_star _ R y u /\ explicit_star _ R z u.Definition explicit_local_confluence := forall x : A, local_confluence_en x.(* R fortement confluente *)

Definition strong_confluence_en (x : A) :=
  forall y z : A, R x y -> R x z -> exists u : A, R y u /\ R z u.Definition explicit_strong_confluence := forall x : A, strong_confluence_en x.Notation confluence := (explicit_confluence _) (only parsing).(* <Warning> : Syntax is discontinued *)

Notation local_confluence := (explicit_local_confluence _) (only parsing).(* <Warning> : Syntax is discontinued *)

Notation strong_confluence := (explicit_strong_confluence _) (only parsing).(* <Warning> : Syntax is discontinued *)

(* inclusion de relations binaires, R1 inclus dans R2: R1 incl R2*)

Definition explicit_inclus (A : Set) (R1 R2 : A -> A -> Prop) :=
  forall x y : A, R1 x y -> R2 x y.Notation inclus := (explicit_inclus _) (only parsing).(* Sets as characteristic predicates over universe U *)
Definition a_set := U -> Prop.(* A is a subset of B *)
Definition sub (A B : a_set) := forall x : U, A x -> B x.(* The full universe *)
Definition universal (A : a_set) := forall x : U, A x.(* Adjoint map *)
Definition adjoint (A : a_set) : a_set := fun x : U => sub (R x) A.Definition hereditary (A : a_set) := sub (adjoint A) A.(*  i.e  (hereditary A) <-> (x:A)(sub (R x) A)->(A x) *)

Definition explicit_noetherian :=
  forall A : a_set, hereditary A -> universal A.Notation noetherian := (explicit_noetherian _) (only parsing).(* <Warning> : Syntax is discontinued *)

(**********************)
(* quelques resultats *)

(* sur le Ex *)

Goal
forall (A : Set) (P Q : A -> Prop),
(exists u : A, P u /\ Q u) -> exists u : A, Q u /\ P u.Save Ex_PQ.

(* Specifications: *)
Lemma star_trans : forall (A : Set) (R : A -> A -> Prop) (x y z : A), explicit_star _ R x y -> explicit_star _ R y z -> explicit_star _ R x z.