1

I want to prove following.

Require Import Coq.Reals.Reals.
Require Import Coquelicot.Coquelicot.

Goal forall x y:R, is_derive (fun x:R => (1/2)*(x-y)^2) x (x-y).
intros x y.
evar (e:R).
replace (x-y) with e.
apply is_derive_scal.
apply is_derive_pow.

I know that differentiation of x - y on x is 1, but I can not find the lemma which represents it.

How do I prove it?

Daisuke Sugawara
  • 311
  • 4
  • 20

1 Answers1

2

Most of the tedious work can be done with Coquelicot's auto_derive tactic.

Require Import Coq.Reals.Reals.
Require Import Coquelicot.Coquelicot.
Require Import Lra.
       
Goal forall x y:R, is_derive (fun x:R => (1/2)*(x-y)^2) x (x-y).

  intros.
  auto_derive.
  auto.
  lra.
Qed.

However, the lemma that you are asking for can be built from is_derive_plus, because subtraction is just addition with negative values.

Variables x y:R.
Check is_derive_plus (fun x => x) (fun x => - y) x 1 0 (is_derive_id _) (is_derive_const _ _) 
     : is_derive (fun x => x - y)  x (1+0).
larsr
  • 5,447
  • 19
  • 38