1

I'm stuck with this very simple lemma, and wonder what is the best way to proceed.

From mathcomp Require Import ssrint rat ssralg ssrnum.

Import GRing.Theory.
Import Num.Theory.
Import Num.Def.

Open Scope ring_scope.

Lemma X (n m : nat) : (n <= m)%N -> n%:Q <= m%:Q.
Proof.
rewrite -lez_nat.
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Pierre Jouvelot
  • 901
  • 3
  • 13

2 Answers2

1

So, _%:Q is a notation for _%:R as documented in rat.v Then doing Search _ Num.le _%:R or Search _ (_%:R <= _%:R) leads to ler_nat which is the right lemma to apply, as in:

Lemma X (n m : nat) : (n <= m)%N -> n%:Q <= m%:Q.
Proof. by move=> le_nm; rewrite ler_nat. Qed.
Cyril
  • 367
  • 2
  • 7
  • Also note that the import line at the beginning of your question is not enough to get a working context, one must add at least `Require Import ssreflect ssrfun ssrbool ssrnat.` – Cyril Jan 19 '21 at 11:30
0
Lemma X (n m : nat) : (n <= m)%N -> n%:Q <= m%:Q.
Proof.
by rewrite -lez_nat -(ler_int rat_numDomainType).
Qed.
Pierre Jouvelot
  • 901
  • 3
  • 13
  • Please don't post only code as answer, but also provide an explanation what your code does and how it solves the problem of the question. Answers with an explanation are usually more helpful and of better quality, and are more likely to attract upvotes. – Mark Rotteveel Nov 26 '20 at 16:55