1
(************************************************************************)
2
(* v * The Coq Proof Assistant / The Coq Development Team *)
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
4
(* \VV/ **************************************************************)
5
(* // * This file is distributed under the terms of the *)
6
(* * GNU Lesser General Public License Version 2.1 *)
7
(************************************************************************)
8
(*i $Id: Zminmax.v 9245 2006-10-17 12:53:34Z notin $ i*)
10
Require Import Zmin Zmax.
11
Require Import BinInt Zorder.
13
Open Local Scope Z_scope.
15
(** Lattice properties of min and max on Z *)
19
Lemma Zmin_max_absorption_r_r : forall n m, Zmax n (Zmin n m) = n.
21
intros; apply Zmin_case_strong; intro; apply Zmax_case_strong; intro;
22
reflexivity || apply Zle_antisym; trivial.
25
Lemma Zmax_min_absorption_r_r : forall n m, Zmin n (Zmax n m) = n.
27
intros; apply Zmax_case_strong; intro; apply Zmin_case_strong; intro;
28
reflexivity || apply Zle_antisym; trivial.
33
Lemma Zmax_min_distr_r :
34
forall n m p, Zmax n (Zmin m p) = Zmin (Zmax n m) (Zmax n p).
37
repeat apply Zmax_case_strong; repeat apply Zmin_case_strong; intros;
39
apply Zle_antisym; (assumption || eapply Zle_trans; eassumption).
42
Lemma Zmin_max_distr_r :
43
forall n m p, Zmin n (Zmax m p) = Zmax (Zmin n m) (Zmin n p).
46
repeat apply Zmax_case_strong; repeat apply Zmin_case_strong; intros;
48
apply Zle_antisym; (assumption || eapply Zle_trans; eassumption).
53
Lemma Zmax_min_modular_r :
54
forall n m p, Zmax n (Zmin m (Zmax n p)) = Zmin (Zmax n m) (Zmax n p).
56
intros; repeat apply Zmax_case_strong; repeat apply Zmin_case_strong; intros;
58
apply Zle_antisym; (assumption || eapply Zle_trans; eassumption).
61
Lemma Zmin_max_modular_r :
62
forall n m p, Zmin n (Zmax m (Zmin n p)) = Zmax (Zmin n m) (Zmin n p).
64
intros; repeat apply Zmax_case_strong; repeat apply Zmin_case_strong; intros;
66
apply Zle_antisym; (assumption || eapply Zle_trans; eassumption).
69
(** Disassociativity *)
71
Lemma max_min_disassoc : forall n m p, Zmin n (Zmax m p) <= Zmax (Zmin n m) p.
73
intros; repeat apply Zmax_case_strong; repeat apply Zmin_case_strong; intros;
74
apply Zle_refl || (assumption || eapply Zle_trans; eassumption).