6

関係Rle (<=)に関して、 Rplus (+) とRminus (-) の内部で書き直すことができます。これは、両方の二項演算子の両方の位置が固定分散であるためです。

Require Import Setoid Relation_Definitions Reals.
Open Scope R.

Add Parametric Relation : R Rle
reflexivity proved by Rle_refl
transitivity proved by Rle_trans
as Rle_setoid_relation.

Add Parametric Morphism : Rplus with
signature Rle ++> Rle ++> Rle as Rplus_Rle_mor.
intros ; apply Rplus_le_compat ; assumption.
Qed.

Add Parametric Morphism : Rminus with
signature Rle ++> Rle --> Rle as Rminus_Rle_mor.
intros ; unfold Rminus ;
apply Rplus_le_compat;
[assumption | apply Ropp_le_contravar ; assumption].
Qed.

Goal forall (x1 x2 y1 y2 : R),
   x1 <= x2 -> y1 <= y2 ->
   x1 - y2 <= x2 - y1.
Proof.
  intros x1 x2 y1 y2 x1_le_x2 y1_le_y2;
  rewrite x1_le_x2; rewrite y1_le_y2;
  reflexivity.
Qed.

残念ながら、Rmult (*) にはこの特性がありません。分散は、他の被乗数が正か負かによって異なります。Coqが書き換えステップを実行し、被乗数の非負性を証明義務として単純に追加するように、条件付き射を定義することは可能ですか? ありがとう。

4

1 に答える 1