(************************************************************************)
(*         *      The Rocq Prover / The Rocq Development Team           *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
Require Export Wf_nat.
Local Open Scope Z_scope.
(** Well-founded relations on Z. *)
(** We define the following family of relations on [Z x Z]:  [x (Zwf c) y]   iff   [x < y & c <= y] *)
Definition Zwf (c x y:Z) := c <= y /\ x < y.
(** and we prove that [(Zwf c)] is well founded *)
Section wf_proof.
Variable c : Z.
(** The proof of well-foundness is classic: we do the proof by induction on a measure in nat, which is here [|x-c|] *)
Let f (z:Z) := Z.abs_nat (z - c).

(* Specifications: *)
Lemma Zwf_well_founded : well_founded (Zwf c).
red; intros.