Skip to content

Instantly share code, notes, and snippets.

@vlj
Created February 17, 2020 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlj/ee3fd2c568cfd976e710a344b302910a to your computer and use it in GitHub Desktop.
Save vlj/ee3fd2c568cfd976e710a344b302910a to your computer and use it in GitHub Desktop.
From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq choice path.
From mathcomp Require Import div fintype tuple finfun bigop finset fingroup perm.
From mathcomp Require Import div prime binomial ssralg finalg zmodp countalg ssrnum.
From mathcomp Require Import ssrint matrix order ssrint order.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Local Open Scope ring_scope.
Import Order.Theory.
Import GRing.Theory.
Import Num.Theory.
Lemma tmp0: forall (x p :int), x - p - x = -p.
Unset Printing Notations.
move => x p.
rewrite addrAC.
rewrite subrr.
by rewrite sub0r.
Qed.
Lemma tmp:
forall (p:nat) (q:nat) (x:int) (y:int), `|x - p%:Z - x| <= (Num.max p%:Z q)%R /\ `|y - q%:Z - y| <= (Num.max p%:Z q).
Proof.
move => p q x y.
split.
rewrite tmp0.
have: forall a:nat, `|-a%:Z| = a.
move => a.
rewrite -[a]absz_nat.
rewrite {1}absz_nat.
rewrite -abszE.
by rewrite abszN.
move => ->.
rewrite ler_maxr.
Unset Printing Notations.
rewrite (le_refl p).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment