(**
This file is part of the Coquelicot formalization of real
analysis in Coq: http://coquelicot.saclay.inria.fr/

Copyright (C) 2011-2015 Sylvie Boldo
#<br />#
Copyright (C) 2011-2015 Catherine Lelay
#<br />#
Copyright (C) 2011-2015 Guillaume Melquiond
#<br />#
Copyright (C) 2014 Xavier Onfroy

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
COPYING file for more details.
*)

Require Import Reals mathcomp.ssreflect.ssreflect mathcomp.ssreflect.ssrbool mathcomp.ssreflect.seq.
Require Import Rcomplements Hierarchy SF_seq RInt.

(** This file describes the definition and properties of the
Henstock–Kurzweil (KH) integral. *)

Definition ith_step (ptd : @SF_seq R) i := nth 0 (SF_lx ptd) (S i) - nth 0 (SF_lx ptd) i.

Definition fine (delta : R -> posreal) ptd :=
  forall i : nat, (i < SF_size ptd)%nat -> ith_step ptd i < delta (nth 0 (SF_ly ptd) i).

Definition KH_filter (P : SF_seq -> Prop) :=
  exists delta, forall ptd, fine delta ptd -> P ptd.

Global Instance KH_filter_filter : Filter KH_filter.
Proof.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
exists (fun x => {| pos := 1; cond_pos := Rlt_0_1 |}).
intros ptd H.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
intros P Q HP HQ.
destruct HP as (deltaP, HP).
destruct HQ as (deltaQ, HQ).
exists (fun x => {| pos := Rmin (deltaP x) (deltaQ x) ; cond_pos := (Rmin_stable_in_posreal (deltaP x) (deltaQ x))|}).
(* Goal: forall ptd : @SF_seq R, not (and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b))))) *)
(* Goal: False *)
intros ptd Hptd.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
apply HP.
(* Goal: forall (i : nat) (_ : lt i (S (@SF_size R s'))), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intros i Hi.
eapply Rlt_le_trans.
now apply (Hptd i).
(* Goal: Rle e (Rminus (Rmax a b) b') *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rmin_l.
apply HQ.
(* Goal: forall (i : nat) (_ : lt i (S (@SF_size R s'))), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intros i Hi.
eapply Rlt_le_trans.
now apply (Hptd i).
(* Goal: Rle e (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rmin_r.
intros P Q HPQ HP.
destruct HP as (delta, HP).
exists delta.
(* Goal: forall ptd : @SF_seq R, not (and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b))))) *)
(* Goal: False *)
intros ptd Hptd.
apply HPQ ; now apply HP.
Qed.

Definition KH_fine (a b : R) :=
  within (fun ptd => pointed_subdiv ptd /\ SF_h ptd = Rmin a b /\ last (SF_h ptd) (SF_lx ptd) = Rmax a b) KH_filter.

Lemma lub_cara :
  forall E l, is_lub E l -> forall e : posreal, ~ ~ (exists x, E x /\ l - e < x).
Proof.
(* Goal: forall (E : forall _ : R, Prop) (l : R) (_ : is_lub E l) (e : posreal), not (not (@ex R (fun x : R => and (E x) (Rlt (Rminus l (pos e)) x)))) *)
intros E l H e.
(* Goal: forall _ : E x, Rle x (Rminus l (pos e)) *)
(* Goal: False *)
intro H0.
(* Goal: False *)
assert (forall x, ~ (E x /\ l - e < x)) as H1.
(* Goal: is_upper_bound M (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intros x Hx.
(* Goal: False *)
(* Goal: False *)
apply H0 ; now exists x.
(* Goal: False *)
clear H0.
(* Goal: Rle y b' *)
(* Goal: Rle b' b' *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
unfold is_lub in H.
(* Goal: False *)
destruct H as (H, H0).
(* Goal: False *)
assert ( ~ is_upper_bound E (l-e)) as H2.
(* Goal: not (@ex R (fun y : R => and (M y) (Rlt (Rminus b' (pos (delta b'))) y))) *)
intro H2.
(* Goal: False *)
(* Goal: False *)
apply H0 in H2.
(* Goal: False *)
(* Goal: False *)
assert (0 < e) as H3.
(* Goal: Rlt (IZR Z0) (pos e) *)
(* Goal: False *)
(* Goal: False *)
apply (cond_pos e).
(* Goal: False *)
(* Goal: False *)
assert (l > l - e) as H4.
(* Goal: Rgt l (Rminus l (pos e)) *)
(* Goal: False *)
(* Goal: False *)
apply tech_Rgt_minus.
(* Goal: Rle e (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: Rlt (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) (pos (delta b')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assumption.
(* Goal: False *)
(* Goal: False *)
unfold Rgt in H4.
(* Goal: False *)
(* Goal: False *)
destruct H2 as [H2 | H2].
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
assert (l < l) as H5.
(* Goal: Rlt l l *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
now apply Rlt_trans with (l-e).
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
apply Rlt_irrefl in H5 ; contradiction.
(* Goal: False *)
(* Goal: False *)
rewrite <- H2 in H4.
(* Goal: False *)
(* Goal: False *)
apply Rlt_irrefl in H4 ; contradiction.
(* Goal: False *)
unfold is_upper_bound in H2.
(* Goal: False *)
assert (forall x : R, E x -> x <= l-e) as H3.
(* Goal: forall (x : R) (_ : E x), Rle x (Rminus l (pos e)) *)
(* Goal: False *)
clear H0 ; clear H.
(* Goal: forall (x : R) (_ : E x), Rle x (Rminus l (pos e)) *)
(* Goal: False *)
intro x.
(* Goal: forall _ : E x, Rle x (Rminus l (pos e)) *)
(* Goal: False *)
assert (~ (E x /\ l - e < x)) as H.
(* Goal: not (and (E x) (Rlt (Rminus l (pos e)) x)) *)
(* Goal: forall _ : E x, Rle x (Rminus l (pos e)) *)
(* Goal: False *)
apply H1.
(* Goal: False *)
clear H1.
(* Goal: forall _ : E x, Rle x (Rminus l (pos e)) *)
(* Goal: False *)
intro H0.
(* Goal: Rle x (Rminus l (pos e)) *)
(* Goal: False *)
assert ({l-e<x}+{l-e=x}+{l-e>x}).
(* Goal: sumor (sumbool (Rlt b' (Rmax a b)) (@eq R b' (Rmax a b))) (Rgt b' (Rmax a b)) *)
(* Goal: @eq R b' (Rmax a b) *)
apply total_order_T.
(* Goal: Rle x (Rminus l (pos e)) *)
(* Goal: Rle x (Rminus l (pos e)) *)
(* Goal: False *)
destruct H1 as [H1 | H1].
(* Goal: Rle x (Rminus l (pos e)) *)
(* Goal: Rle x (Rminus l (pos e)) *)
(* Goal: False *)
destruct H1 as [H1 | H1].
(* Goal: Rle x (Rminus l (pos e)) *)
(* Goal: Rle x (Rminus l (pos e)) *)
(* Goal: Rle x (Rminus l (pos e)) *)
(* Goal: False *)
assert (E x /\ l-e < x).
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
now split.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
(* Goal: Rle x (Rminus l (pos e)) *)
(* Goal: Rle x (Rminus l (pos e)) *)
(* Goal: False *)
right ; rewrite H1 ; trivial.
(* Goal: Rle x (Rminus l (pos e)) *)
(* Goal: False *)
now left.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
Qed.

Lemma cousin :
  forall a b delta, ~ ~ exists ptd,
  pointed_subdiv ptd /\ fine delta ptd /\
  SF_h ptd = Rmin a b /\ last (SF_h ptd) (SF_lx ptd) = Rmax a b.
Proof.
(* Goal: forall (a b : R) (delta : forall _ : R, posreal), not (not (@ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b))))))) *)
intros a b delta H.
(* Goal: False *)
assert (forall ptd, ~ (pointed_subdiv ptd /\ fine delta ptd /\ SF_h ptd = Rmin a b /\ last (SF_h ptd) (SF_lx ptd) = Rmax a b)) as Hdelta.
(* Goal: forall ptd : @SF_seq R, not (and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b))))) *)
(* Goal: False *)
intros ptd Hptd.
(* Goal: False *)
(* Goal: False *)
apply H ; now exists ptd.
(* Goal: False *)
clear H.
set (M := fun y => Rmin a b <= y <= Rmax a b /\ exists ptd, (pointed_subdiv ptd /\
        fine delta ptd /\ SF_h ptd = Rmin a b /\ last (SF_h ptd) (SF_lx ptd) = y)).
(* Goal: False *)
assert (exists b', is_lub M b') as Hb'.
(* Goal: @ex R (fun b' : R => is_lub M b') *)
(* Goal: False *)
apply completeness_weak.
(* Goal: bound M *)
(* Goal: @ex R (fun x : R => M x) *)
(* Goal: False *)
exists (Rmax a b).
(* Goal: is_upper_bound M (Rmax a b) *)
(* Goal: @ex R (fun x : R => M x) *)
(* Goal: False *)
intros y Hy.
(* Goal: M y *)
(* Goal: Rle b' b' *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply Hy.
(* Goal: @ex R (fun x : R => M x) *)
(* Goal: False *)
exists (Rmin a b).
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: Rle b' b' *)
(* Goal: Rle b' (Rplus b' e) *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rle_refl.
(* Goal: Rle (Rmin a b) (Rmax a b) *)
(* Goal: @ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmin a b))))) *)
(* Goal: False *)
apply Rmin_Rmax.
(* Goal: @ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmin a b))))) *)
(* Goal: False *)
exists (SF_nil (Rmin a b)).
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (Init.Nat.pred (S (@SF_size R s)))) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
simpl.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: forall (i : nat) (_ : lt i (S (@SF_size R s'))), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intros i Hi.
(* Goal: Rlt (ith_step (@SF_nil R (Rmin a b)) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_nil R (Rmin a b))) i))) *)
(* Goal: and (@eq R (Rmin a b) (Rmin a b)) (@eq R (Rmin a b) (Rmin a b)) *)
(* Goal: False *)
apply lt_n_0 in Hi ; destruct Hi.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: forall (i : nat) (_ : lt i (S (@SF_size R s'))), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intros i Hi.
(* Goal: Rlt (ith_step (@SF_nil R (Rmin a b)) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_nil R (Rmin a b))) i))) *)
(* Goal: and (@eq R (Rmin a b) (Rmin a b)) (@eq R (Rmin a b) (Rmin a b)) *)
(* Goal: False *)
apply lt_n_0 in Hi ; destruct Hi.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
split ; easy.
(* Goal: False *)
destruct Hb' as (b', H).
(* Goal: False *)
assert (forall e : posreal, ~ ~ (exists y, M y /\ b' - e < y)) as H1.
(* Goal: forall e : posreal, not (not (@ex R (fun y : R => and (M y) (Rlt (Rminus b' (pos e)) y)))) *)
(* Goal: False *)
now apply lub_cara.
(* Goal: False *)
apply (H1 (delta b')).
(* Goal: not (@ex R (fun y : R => and (M y) (Rlt (Rminus b' (pos (delta b'))) y))) *)
intro H2.
(* Goal: False *)
destruct H2 as (y, H2).
(* Goal: False *)
clear H1.
(* Goal: False *)
destruct H2 as (H2, H1).
(* Goal: False *)
assert (M y) as Hy.
(* Goal: Rle e (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: Rlt (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) (pos (delta b')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assumption.
(* Goal: False *)
destruct H2 as (H3, H2).
(* Goal: False *)
destruct H2 as (s, H2).
(* Goal: False *)
destruct H2 as (H2,H4).
(* Goal: False *)
destruct H4 as (H4, H0).
(* Goal: False *)
destruct H0 as (H5, H0).
(* Goal: False *)
set (s' := SF_rcons s (b',b')).
(* Goal: False *)
assert (pointed_subdiv s' /\ SF_h s' = Rmin a b /\ last (SF_h s') (SF_lx s') = b') as HH.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: pointed_subdiv s' *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
unfold pointed_subdiv ; unfold s'.
(* Goal: forall (i : nat) (_ : lt i (S (@SF_size R s'))), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intros i Hi.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_rcons in Hi.
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply lt_n_Sm_le in Hi.
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
case (eq_nat_dec i (SF_size s)) => His.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite His.
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s))) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S (@SF_size R s)))) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
replace (nth 0 (SF_lx (SF_rcons s (b', b'))) (SF_size s)) with (last (SF_h s) (SF_lx s)).
(* Goal: Rlt (Rminus b' y) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)))) *)
(* Goal: @eq R y (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (SF_ly (SF_rcons s (b', b'))) (SF_size s)) with b'.
(* Goal: and (Rle (@last R (@SF_h R s) (@SF_lx R s)) b') (Rle b' (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S (@SF_size R s)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
replace (nth 0 (SF_lx (SF_rcons s (b', b'))) (S (SF_size s))) with b'.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite H0.
(* Goal: Rle y b' *)
(* Goal: Rle b' b' *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
unfold is_lub in H.
(* Goal: Rle b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply H.
(* Goal: M y *)
(* Goal: Rle b' b' *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply Hy.
(* Goal: Rle b' b' *)
(* Goal: Rle b' (Rplus b' e) *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rle_refl.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons.
(* Goal: and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
simpl fst.
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') (S (@SF_size R s))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
replace (S (SF_size s)) with (Peano.pred (size (rcons (SF_lx s) b')) ).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite last_rcons.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite size_rcons.
(* Goal: @eq nat (Init.Nat.pred (S (@size R (@SF_lx R s)))) (S (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
rewrite <- SF_size_lx.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
simpl ; easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_ly_rcons.
(* Goal: and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
simpl snd.
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s) b') (@SF_size R s)) *)
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
replace (SF_size s) with (Peano.pred (size (rcons (SF_ly s) b'))).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite last_rcons.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite size_rcons.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (Init.Nat.pred (S (@SF_size R s)))) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
simpl.
(* Goal: @eq nat (@size R (@SF_ly R s)) (@SF_size R s) *)
(* Goal: @eq R y (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply SF_size_ly.
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (if ssrnat.leq (S (@SF_size R s)) (@size R (@SF_lx R s)) then @nth R (IZR Z0) (@SF_lx R s) (@SF_size R s) else if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (@size R (@SF_lx R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite <- nth_last.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (Init.Nat.pred (S (@SF_size R s)))) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
simpl.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons.
(* Goal: and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
simpl fst.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) (@last R (IZR Z0) (@SF_lx R s')) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case Hleq : ssrnat.leq.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (@SF_size R s)) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (@SF_size R s)) (if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
assert (Peano.pred(size (SF_lx s)) = size (SF_t s)) as Hlxsize.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
simpl ; unfold SF_size ; simpl ; easy.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (@SF_size R s)) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (@SF_size R s)) (if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
unfold SF_size.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (@size (prod R R) (@SF_t R s))) (@nth R (IZR Z0) (@SF_lx R s) (@size (prod R R) (@SF_t R s))) *)
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (@SF_size R s)) (if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
rewrite <- Hlxsize.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (@last R (IZR Z0) (@SF_lx R s)) *)
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (@SF_size R s)) (if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
unfold SF_lx.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite last_cons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite last_cons.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx in Hleq.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
by rewrite ssrnat.leqnn in Hleq.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_ly_rcons.
(* Goal: and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
simpl fst.
(* Goal: and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
simpl snd.
(* Goal: and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) b') i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s) b') i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
assert (i < SF_size s)%nat as Hsi.
(* Goal: lt i (@SF_size R s) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) b') i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s) b') i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply le_lt_eq_dec in Hi.
(* Goal: lt i (@SF_size R s) *)
(* Goal: and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) b') i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s) b') i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
now destruct Hi.
(* Goal: and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) b') i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s) b') i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) b') (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
split ; rewrite nth_rcons ; case Hcase : ssrnat.leq ; rewrite nth_rcons ; case Hcase2 : ssrnat.leq.
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
now apply (H2 i).
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) (@last R (IZR Z0) (@SF_lx R s')) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case Hcase3 : eqtype.eq_op.
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) b' *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply Rle_trans with (last (SF_h s) (SF_lx s)).
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (@last R (@SF_h R s) (@SF_lx R s)) *)
(* Goal: Rle (@last R (@SF_h R s) (@SF_lx R s)) b' *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
replace (last (SF_h s) (SF_lx s)) with (last 0 (SF_lx s)).
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (@last R (IZR Z0) (@SF_lx R s)) *)
(* Goal: @eq R (@last R (IZR Z0) (@SF_lx R s)) (@last R (@SF_h R s) (@SF_lx R s)) *)
(* Goal: Rle (@last R (@SF_h R s) (@SF_lx R s)) b' *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply sorted_last.
(* Goal: @sorted R Rle (@SF_lx R s) *)
(* Goal: lt i (@size R (@SF_lx R s)) *)
(* Goal: @eq R (@last R (IZR Z0) (@SF_lx R s)) (@last R (@SF_h R s) (@SF_lx R s)) *)
(* Goal: Rle (@last R (@SF_h R s) (@SF_lx R s)) b' *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply ptd_sort.
(* Goal: pointed_subdiv s *)
(* Goal: lt i (@size R (@SF_lx R s)) *)
(* Goal: @eq R (@last R (IZR Z0) (@SF_lx R s)) (@last R (@SF_h R s) (@SF_lx R s)) *)
(* Goal: Rle (@last R (@SF_h R s) (@SF_lx R s)) b' *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply H2.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: forall (i : nat) (_ : lt i (S (@SF_size R s))), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
unfold lt.
(* Goal: le (S i) (S (@SF_size R s)) *)
(* Goal: @eq R (@last R (IZR Z0) (@SF_lx R s)) (@last R (@SF_h R s) (@SF_lx R s)) *)
(* Goal: Rle (@last R (@SF_h R s) (@SF_lx R s)) b' *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply le_n_S.
(* Goal: le (S i) (S (@SF_size R s')) *)
(* Goal: forall _ : lt i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Hi.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) (@last R (IZR Z0) (@SF_lx R s')) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case Hs : (SF_lx s).
(* Goal: @eq R (@last R (IZR Z0) (@Datatypes.nil R)) (@last R (@SF_h R s) (@Datatypes.nil R)) *)
(* Goal: @eq R (@last R (IZR Z0) (@Datatypes.cons R _a_ _l_)) (@last R (@SF_h R s) (@Datatypes.cons R _a_ _l_)) *)
(* Goal: Rle (@last R (@SF_h R s) (@SF_lx R s)) b' *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
assert (size (SF_lx s) = 0%nat) as Hss.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite Hs ; simpl ; easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx in Hss.
(* Goal: @eq R (@last R (IZR Z0) (@Datatypes.nil R)) (@last R (@SF_h R s) (@Datatypes.nil R)) *)
(* Goal: @eq R (@last R (IZR Z0) (@Datatypes.cons R _a_ _l_)) (@last R (@SF_h R s) (@Datatypes.cons R _a_ _l_)) *)
(* Goal: Rle (@last R (@SF_h R s) (@SF_lx R s)) b' *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply MyNat.neq_succ_0 in Hss ; destruct Hss.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite last_cons ; rewrite last_cons ; easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite H0.
(* Goal: Rle y b' *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
destruct H as (H, H').
(* Goal: Rle b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
now apply H.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move :Hcase2 => /ssrnat.leP Hcase2.
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply not_le in Hcase2 ; unfold gt in Hcase2.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_ly in Hcase2.
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
unfold lt in Hcase2.
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply le_S_n in Hcase2.
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
unfold lt in Hsi.
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
assert (S i <= i)%nat as Hcase4.
(* Goal: le (S i) i *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
now apply le_trans with (SF_size s).
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply le_Sn_n in Hcase4 ; destruct Hcase4.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move :Hcase => /ssrnat.leP Hcase.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx in Hcase.
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s) i) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s) (S i)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
apply le_n_S in Hi.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move :Hcase => /ssrnat.leP Hcase.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx in Hcase.
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s) i) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s) (S i)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
apply le_n_S in Hi.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
now apply (H2 i).
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move :Hcase2 => /ssrnat.leP Hcase2.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx in Hcase2.
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
unfold lt in Hsi.
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply le_n_S in Hsi.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move :Hcase => /ssrnat.leP Hcase.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_ly in Hcase.
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
unfold lt in Hsi.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move :Hcase => /ssrnat.leP Hcase.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_ly in Hcase.
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
unfold lt in Hsi.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold s'.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: @eq R (@SF_h R (@SF_rcons R s (@pair R R b' b'))) (Rmin a b) *)
(* Goal: @eq R (@last R (@SF_h R (@SF_rcons R s (@pair R R b' b'))) (@SF_lx R (@SF_rcons R s (@pair R R b' b')))) b' *)
(* Goal: False *)
unfold SF_rcons.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (Init.Nat.pred (S (@SF_size R s)))) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
simpl.
(* Goal: @eq R (@SF_h R s) (Rmin a b) *)
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply H5.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite last_rcons.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
(* Goal: False *)
apply (Hdelta s').
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) b' *)
(* Goal: @eq R b' (Rmax a b) *)
apply HH.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: fine delta s' *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
unfold fine, s'.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_rcons.
(* Goal: forall (i : nat) (_ : lt i (S (@SF_size R s))), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
unfold lt.
(* Goal: forall (i : nat) (_ : lt i (S (@SF_size R s'))), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intros i Hi.
(* Goal: Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
apply le_S_n in Hi.
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case (le_lt_eq_dec i (SF_size s)).
(* Goal: Rle e (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: Rlt (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) (pos (delta b')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assumption.
(* Goal: forall _ : lt i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intro Hi2.
(* Goal: Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) (@SF_size R s')) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_size R s')))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold ith_step.
(* Goal: Rlt (Rminus (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i)) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
replace (nth 0 (SF_lx (SF_rcons s (b', b'))) (S i)) with (nth 0 (SF_lx s) (S i)).
(* Goal: Rlt (Rminus (@nth R (IZR Z0) (@SF_lx R s) (S i)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i)) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s) (S i)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
replace (nth 0 (SF_lx (SF_rcons s (b', b'))) i) with (nth 0 (SF_lx s) i).
(* Goal: Rlt (ith_step s i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: @eq R (ith_step s i) (ith_step (@SF_rcons R s (@pair R R b' b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (SF_ly (SF_rcons s (b', b'))) i) with (nth 0 (SF_ly s) i).
(* Goal: Rlt (ith_step s i) (pos (delta (@nth R (IZR Z0) (@SF_ly R s) i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) *)
(* Goal: @eq R (ith_step s i) (ith_step (@SF_rcons R s (@pair R R b' b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
now apply (H4 i).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_ly_rcons.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (Init.Nat.pred (S (@SF_size R s)))) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
simpl.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) (@last R (IZR Z0) (@SF_lx R s')) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case Hcase : ssrnat.leq.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move :Hcase => /ssrnat.leP Hcase.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_ly in Hcase.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) (@last R (IZR Z0) (@SF_lx R s')) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case Hcase : ssrnat.leq.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move :Hcase => /ssrnat.leP Hcase.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx in Hcase.
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s) i) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s) (S i)) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
apply le_n_S in Hi.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) (@last R (IZR Z0) (@SF_lx R s')) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case Hcase : ssrnat.leq.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move :Hcase => /ssrnat.leP Hcase.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx in Hcase.
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s) (S i)) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
apply le_n_S in Hi2.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
clear Hi ; intro Hi.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Hi.
(* Goal: Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) (@SF_size R s')) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_size R s')))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold ith_step.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_ly_rcons.
(* Goal: Rlt (Rminus (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s))) (pos (delta (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
replace (nth 0 (rcons (SF_lx s) (fst (b', b'))) (S (SF_size s))) with (last 0 (rcons (SF_lx s) (fst (b', b')))).
(* Goal: Rlt (Rminus b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s))) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_lx s) (fst (b', b'))) (SF_size s)) with y.
(* Goal: Rlt (Rminus (@last R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b')))) y) (pos (delta (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)))) *)
(* Goal: @eq R y (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
replace (nth 0 (rcons (SF_ly s) (snd (b', b'))) (SF_size s)) with (last 0 (rcons (SF_ly s) (snd (b', b')))).
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (Init.Nat.pred (S (@SF_size R s)))) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite last_rcons ; rewrite last_rcons ; simpl.
(* Goal: Rlt (Rminus b' y) (pos (delta b')) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R y (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
apply Rplus_lt_reg_l with y.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_comm.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_assoc.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_opp_l.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_0_r.
(* Goal: Rlt b' (Rplus y (pos (delta b'))) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R y (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
apply Rplus_lt_reg_l with (- delta b').
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_comm.
(* Goal: Rlt (Rplus b' (Ropp (pos (delta b')))) (Rplus (Ropp (pos (delta b'))) (Rplus y (pos (delta b')))) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R y (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
replace (- delta b' + (y + delta b')) with y.
(* Goal: Rle e (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: Rlt (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) (pos (delta b')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assumption.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite Rplus_comm ; rewrite Rplus_assoc ; rewrite Rplus_opp_r ; rewrite Rplus_0_r ; easy.
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (SF_size s) with (Peano.pred (size (rcons (SF_ly s) (snd (b', b'))))).
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite nth_last ; easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite size_rcons.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
simpl ; rewrite SF_size_ly ; easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) (@last R (IZR Z0) (@SF_lx R s')) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case Hcase : ssrnat.leq.
(* Goal: @eq R y (if ssrnat.leq (S (@SF_size R s)) (@size R (@SF_lx R s)) then @nth R (IZR Z0) (@SF_lx R s) (@SF_size R s) else if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (@size R (@SF_lx R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite <- H0.
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R y (if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (S (@SF_size R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
replace (SF_size s) with (Peano.pred (size (SF_lx s))).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) (@last R (IZR Z0) (@SF_lx R s')) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case Hs : (SF_lx s).
(* Goal: @eq R (@last R (@SF_h R s) (@Datatypes.nil R)) (@last R (IZR Z0) (@Datatypes.nil R)) *)
(* Goal: @eq R (@last R (@SF_h R s) (@Datatypes.cons R _a_ _l_)) (@last R (IZR Z0) (@Datatypes.cons R _a_ _l_)) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s))) (@SF_size R s) *)
(* Goal: @eq R y (if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (S (@SF_size R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
assert (size (SF_lx s) = S (SF_size s)) as Hss.
(* Goal: @eq nat (@size R (@SF_lx R s')) (S (@SF_size R s')) *)
(* Goal: @eq R (@last R (@SF_h R s') (@Datatypes.nil R)) (@last R (IZR Z0) (@Datatypes.nil R)) *)
(* Goal: @eq R (@last R (@SF_h R s') (@Datatypes.cons R _a_ _l_)) (@last R (IZR Z0) (@Datatypes.cons R _a_ _l_)) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply SF_size_lx.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Hs in Hss.
(* Goal: @eq R (@last R (@SF_h R s) (@Datatypes.nil R)) (@last R (IZR Z0) (@Datatypes.nil R)) *)
(* Goal: @eq R (@last R (@SF_h R s) (@Datatypes.cons R _a_ _l_)) (@last R (IZR Z0) (@Datatypes.cons R _a_ _l_)) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s))) (@SF_size R s) *)
(* Goal: @eq R y (if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (S (@SF_size R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
unfold size in Hss.
(* Goal: @eq R (@last R (@SF_h R s') (@Datatypes.nil R)) (@last R (IZR Z0) (@Datatypes.nil R)) *)
(* Goal: @eq R (@last R (@SF_h R s') (@Datatypes.cons R _a_ _l_)) (@last R (IZR Z0) (@Datatypes.cons R _a_ _l_)) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply O_S in Hss ; destruct Hss.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite last_cons ; rewrite last_cons ; easy.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite SF_size_lx ; simpl ; easy.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move :Hcase => /ssrnat.leP Hcase.
(* Goal: @eq R y (if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (S (@SF_size R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
absurd (S (SF_size s) <= S (SF_size s))%nat.
(* Goal: Rle e (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: Rlt (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) (pos (delta b')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assumption.
(* Goal: le (S (@SF_size R s)) (S (@SF_size R s)) *)
(* Goal: @eq R (@last R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b')))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b)) *)
apply le_refl.
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (S (SF_size s)) with (Peano.pred (size (rcons (SF_lx s) (fst (b', b'))))).
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite nth_last ; easy.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite size_rcons ; rewrite SF_size_lx ; simpl ; easy.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
destruct HH as (HH1, HH) ; split.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) b' *)
(* Goal: @eq R b' (Rmax a b) *)
apply HH.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) (Rmax a b) *)
replace (Rmax a b) with b'.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) b' *)
(* Goal: @eq R b' (Rmax a b) *)
apply HH.
(* Goal: @eq R b' (Rmax a b) *)
assert ({b' < Rmax a b} + {b' = Rmax a b} + {b' > Rmax a b}) as Hb'.
(* Goal: sumor (sumbool (Rlt b' (Rmax a b)) (@eq R b' (Rmax a b))) (Rgt b' (Rmax a b)) *)
(* Goal: @eq R b' (Rmax a b) *)
apply total_order_T.
(* Goal: @eq R b' (Rmax a b) *)
destruct Hb' as [Hb'1 | Hb'2].
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
destruct Hb'1 as [Hb'1 | Hb'3].
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
set (e:= Rmin ((Rmax a b) - b') ((delta b')/2) ).
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assert (0 < e) as He.
(* Goal: Rlt (IZR Z0) e *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rmin_pos.
(* Goal: Rlt (IZR Z0) (Rminus (Rmax a b) b') *)
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
now apply Rlt_Rminus.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rmult_lt_0_compat.
(* Goal: Rlt (IZR Z0) (pos (delta b')) *)
(* Goal: Rlt (IZR Z0) (Rinv (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply (cond_pos (delta b')).
(* Goal: Rlt (IZR Z0) (Rinv (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rinv_0_lt_compat.
(* Goal: Rlt (IZR Z0) (IZR (Zpos (xO xH))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply (Rlt_R0_R2).
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assert (e <= (delta b')/2) as Hed.
(* Goal: Rle e (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rmin_r.
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assert (e <= (Rmax a b) - b') as Hebb'.
(* Goal: Rle e (Rminus (Rmax a b) b') *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rmin_l.
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assert (M (b' + e)) as H42.
(* Goal: M (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold M.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: Rle (Rmin a b) (Rplus b' e) *)
(* Goal: Rle (Rplus b' e) (Rmax a b) *)
(* Goal: @ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rplus b' e))))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rle_trans with b'.
(* Goal: Rle (Rmin a b) b' *)
(* Goal: Rle b' (Rplus b' e) *)
(* Goal: Rle (Rplus b' e) (Rmax a b) *)
(* Goal: @ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rplus b' e))))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rle_trans with y.
(* Goal: Rle (Rmin a b) y *)
(* Goal: Rle y b' *)
(* Goal: Rle b' (Rplus b' e) *)
(* Goal: Rle (Rplus b' e) (Rmax a b) *)
(* Goal: @ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rplus b' e))))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply H3.
(* Goal: Rle b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
now apply H.
(* Goal: Rle (Rplus b' e) (Rmax a b) *)
(* Goal: @ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rplus b' e))))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rplus_le_reg_l with (- b').
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_opp_l.
(* Goal: Rle (Rplus (Ropp b') (Rplus b' e)) (Rplus (Ropp b') (Rmax a b)) *)
(* Goal: @ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rplus b' e))))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite <- Rplus_assoc.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_opp_l.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_0_l.
(* Goal: Rle (IZR Z0) e *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
now apply Rlt_le.
(* Goal: Rle (Rplus b' e) (Rmax a b) *)
(* Goal: @ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rplus b' e))))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rplus_le_reg_l with (- b').
(* Goal: Rle (Rplus (Ropp b') (Rplus b' e)) (Rplus (Ropp b') (Rmax a b)) *)
(* Goal: @ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rplus b' e))))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite <- Rplus_assoc.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_opp_l.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_0_l.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_comm.
(* Goal: Rle e (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: Rlt (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) (pos (delta b')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assumption.
(* Goal: @ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rplus b' e))))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
exists (SF_rcons s' (b'+e, b')).
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: pointed_subdiv (@SF_rcons R s' (@pair R R (Rplus b' e) b')) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold pointed_subdiv.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_rcons ; rewrite SF_lx_rcons ; rewrite SF_ly_rcons.
(* Goal: forall (i : nat) (_ : lt i (S (@SF_size R s'))), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intros i Hi.
(* Goal: Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case (le_lt_eq_dec i (SF_size s')).
(* Goal: le (S i) (S (@SF_size R s')) *)
(* Goal: forall _ : lt i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply le_S_n ; apply Hi.
(* Goal: forall _ : lt i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intro Hi2.
(* Goal: and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_lx s') (fst (b' + e, b'))) i) with (nth 0 (SF_lx s') i).
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R s') i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s') i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_ly s') (snd (b' + e, b'))) i) with (nth 0 (SF_ly s') i).
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R s') i) (@nth R (IZR Z0) (@SF_ly R s') i)) (Rle (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s') i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_lx s') (fst (b' + e, b'))) (S i)) with (nth 0 (SF_lx s') (S i)).
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R s') i) (@nth R (IZR Z0) (@SF_ly R s') i)) (Rle (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_lx R s') (S i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i)) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_lx R s') i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
now apply (HH1 i).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.ltnS.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
by move /ssrnat.ltP :Hi2 => ->.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_ly.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
by move /ssrnat.ltP :Hi2 => ->.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
by move /ssrnat.ltP :Hi => ->.
(* Goal: forall _ : lt i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intro Hi2.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Hi2.
(* Goal: Rlt (Rminus (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s'))) (pos (delta (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')))) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_lx s') (fst (b' + e, b'))) (SF_size s')) with b'.
(* Goal: and (Rle b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s'))) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s')))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_ly s') (snd (b' + e, b'))) (SF_size s')) with (nth 0 (rcons (SF_ly s') (snd (b' + e, b'))) (Peano.pred (size (rcons (SF_ly s') (snd (b' + e, b')))))).
(* Goal: and (Rle b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))))))) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s')))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_lx s') (fst (b' + e, b'))) (S (SF_size s'))) with (nth 0 (rcons (SF_lx s') (fst (b' + e, b'))) (Peano.pred (size (rcons (SF_lx s') (fst (b' + e, b')))))).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite last_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite last_rcons.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (Init.Nat.pred (S (@SF_size R s)))) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
simpl.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: Rle b' b' *)
(* Goal: Rle b' (Rplus b' e) *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rle_refl.
(* Goal: Rlt b' (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite <- (Rplus_0_r b') at 1.
(* Goal: Rle (Rplus b' (IZR Z0)) (Rplus b' e) *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rplus_le_compat_l.
(* Goal: Rle (IZR Z0) e *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (Init.Nat.pred (@size R (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b')))))) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
now apply Rlt_le.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite size_rcons ; rewrite SF_size_lx ; simpl ; easy.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite size_rcons ; rewrite SF_size_ly ; simpl ; easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.leqnn.
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold s'.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons ; rewrite SF_size_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite -SF_size_lx.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.ltnn.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
by rewrite eqtype.eq_refl.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b')) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intro i.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_rcons.
(* Goal: forall _ : lt i (S (@SF_size R s')), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intro Hi.
(* Goal: Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case (le_lt_eq_dec i (SF_size s')).
(* Goal: le i (@SF_size R s') *)
(* Goal: forall _ : lt i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply le_S_n.
(* Goal: le (S i) (S (@SF_size R s')) *)
(* Goal: forall _ : lt i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Hi.
(* Goal: forall _ : lt i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intro Hi2.
(* Goal: Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (ith_step (SF_rcons s' (b' + e, b')) i) with (ith_step s' i).
(* Goal: Rlt (ith_step s' i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (SF_ly (SF_rcons s' (b' + e, b'))) i) with (nth 0 (SF_ly s') i).
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold s'.
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case (le_lt_eq_dec i (SF_size s)).
(* Goal: le i (@SF_size R s) *)
(* Goal: forall _ : lt i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold s' in Hi2 ; rewrite SF_size_rcons in Hi2.
(* Goal: le i (@SF_size R s') *)
(* Goal: forall _ : lt i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
now apply le_S_n.
(* Goal: forall _ : lt i (@SF_size R s), @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intro Hi3.
(* Goal: Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (ith_step (SF_rcons s (b', b')) i) with (ith_step s i).
(* Goal: Rlt (ith_step s i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: @eq R (ith_step s i) (ith_step (@SF_rcons R s (@pair R R b' b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (SF_ly (SF_rcons s (b', b'))) i) with (nth 0 (SF_ly s) i).
(* Goal: Rlt (ith_step s i) (pos (delta (@nth R (IZR Z0) (@SF_ly R s) i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) *)
(* Goal: @eq R (ith_step s i) (ith_step (@SF_rcons R s (@pair R R b' b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), Rlt (ith_step (@SF_rcons R s (@pair R R b' b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
now apply (H4 i).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_ly_rcons ; rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_ly.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
by move /ssrnat.ltP :Hi3 => ->.
(* Goal: Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) (@SF_size R s')) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_size R s')))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold ith_step.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite 2!nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.ltnS.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move /ssrnat.ltP :(Hi3) => ->.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.ltnS.
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s) i) (if ssrnat.leq i (@SF_size R s) then @nth R (IZR Z0) (@SF_ly R s) i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s)) then @snd R R (@pair R R (Rplus b' e) b') else IZR Z0) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply lt_le_weak in Hi3.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
by move /ssrnat.leP :Hi3 => ->.
(* Goal: forall _ : lt i (@SF_size R s), @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intro Hi3.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Hi3.
(* Goal: Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) (@SF_size R s')) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_size R s')))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold ith_step.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons.
(* Goal: Rlt (Rminus (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s))) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_lx s) (fst (b', b'))) (S (SF_size s))) with b'.
(* Goal: Rlt (Rminus b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s))) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_lx s) (fst (b', b'))) (SF_size s)) with y.
(* Goal: Rlt (Rminus b' y) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)))) *)
(* Goal: @eq R y (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (SF_ly (SF_rcons s (b', b'))) (SF_size s)) with b'.
(* Goal: Rlt (Rminus b' y) (pos (delta b')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R y (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rplus_lt_reg_l with (y - delta b').
(* Goal: Rlt (Rplus (Rminus y (pos (delta b'))) (Rminus b' y)) (Rplus (Rminus y (pos (delta b'))) (pos (delta b'))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R y (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (y - delta b' + (b' - y)) with (b' - delta b') by ring.
(* Goal: Rlt (Rminus b' (pos (delta b'))) (Rplus (Rminus y (pos (delta b'))) (pos (delta b'))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R y (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
now replace (y - delta b' + delta b') with y by ring.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_ly_rcons.
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (SF_size s) with (Peano.pred (size (rcons (SF_ly s) (snd (b', b'))))).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite last_rcons.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite size_rcons.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (Init.Nat.pred (S (@SF_size R s)))) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
simpl.
(* Goal: @eq nat (@size R (@SF_ly R s)) (@SF_size R s) *)
(* Goal: @eq R y (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply SF_size_ly.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @eq R y (if ssrnat.leq (S (@SF_size R s)) (@size R (@SF_lx R s)) then @nth R (IZR Z0) (@SF_lx R s) (@SF_size R s) else if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (@size R (@SF_lx R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite <- H0.
(* Goal: @eq R (@last R (@SF_h R s) (@SF_lx R s)) (if ssrnat.leq (S (@SF_size R s)) (@size R (@SF_lx R s)) then @nth R (IZR Z0) (@SF_lx R s) (@SF_size R s) else if @eqtype.eq_op ssrnat.nat_eqType (@SF_size R s) (@size R (@SF_lx R s)) then @fst R R (@pair R R b' b') else IZR Z0) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite <- nth_last.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.leqnn.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (Init.Nat.pred (S (@SF_size R s)))) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
simpl.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (@SF_size R s)) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply set_nth_default.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: is_true (ssrnat.leq (S (@SF_size R s)) (S (@SF_size R s))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply ssrnat.leqnn.
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (S (SF_size s)) with (Peano.pred (size (rcons (SF_lx s) (fst (b', b'))))).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite last_rcons.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite size_rcons ; rewrite SF_size_lx ; simpl ; easy.
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold s'.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_ly_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_ly_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_ly_rcons.
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case (le_lt_eq_dec i (SF_size s)).
(* Goal: le i (@SF_size R s) *)
(* Goal: forall _ : lt i (@SF_size R s), @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold s' in Hi2 ; rewrite SF_size_rcons in Hi2 ; apply le_S_n ; apply Hi2.
(* Goal: forall _ : lt i (@SF_size R s), @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intro Hi3.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons ; rewrite nth_rcons ; rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_ly.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move /ssrnat.ltP :(Hi3) => ->.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite size_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.ltnS.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_ly.
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s) i) (if ssrnat.leq i (@SF_size R s) then @nth R (IZR Z0) (@SF_ly R s) i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s)) then @snd R R (@pair R R (Rplus b' e) b') else IZR Z0) *)
(* Goal: forall _ : @eq nat i (@SF_size R s), @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) i) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply lt_le_weak in Hi3.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
by move /ssrnat.leP :Hi3 => ->.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
intro Hi3 ; rewrite Hi3.
(* Goal: @eq R (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)) (@nth R (IZR Z0) (@rcons R (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s)) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_ly s) (snd (b', b'))) (SF_size s)) with b'.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite size_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_ly.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.leqnn.
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s) (@snd R R (@pair R R b' b'))) (@SF_size R s)) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (SF_size s) with (Peano.pred (size (rcons (SF_ly s) (snd (b', b'))))).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite last_rcons ; easy.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite size_rcons ; rewrite SF_size_ly ; simpl ; easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_ly.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.ltnn.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
by rewrite eqtype.eq_refl.
(* Goal: Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) (@SF_size R s')) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_size R s')))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold ith_step.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons ; rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.ltnS.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (if ssrnat.leq (S i) (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') (S i) else if @eqtype.eq_op ssrnat.nat_eqType (S i) (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0) (if ssrnat.leq (S i) (S (@SF_size R s')) then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
move /ssrnat.ltP :(Hi2) => ->.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.ltnS.
(* Goal: @eq R (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (@nth R (IZR Z0) (@SF_lx R s') i)) (Rminus (@nth R (IZR Z0) (@SF_lx R s') (S i)) (if ssrnat.leq i (@SF_size R s') then @nth R (IZR Z0) (@SF_lx R s') i else if @eqtype.eq_op ssrnat.nat_eqType i (S (@SF_size R s')) then @fst R R (@pair R R (Rplus b' e) b') else IZR Z0)) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply lt_le_weak in Hi2.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
by move /ssrnat.leP :Hi2 => ->.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
intro Hi2 ; rewrite Hi2.
(* Goal: Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) (@SF_size R s')) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_size R s')))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold ith_step.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_ly_rcons.
(* Goal: Rlt (Rminus (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s'))) (pos (delta (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_lx s') (fst (b' + e, b'))) (S (SF_size s'))) with (b' + e).
(* Goal: Rlt (Rminus (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s'))) (pos (delta (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')))) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_lx s') (fst (b' + e, b'))) (SF_size s')) with b'.
(* Goal: Rlt (Rminus (Rplus b' e) b') (pos (delta (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (nth 0 (rcons (SF_ly s') (snd (b' + e, b'))) (SF_size s')) with b'.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_comm.
(* Goal: Rlt (Rminus (Rplus e b') b') (pos (delta b')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold Rminus.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rplus_assoc ; rewrite Rplus_opp_r ; rewrite Rplus_0_r.
(* Goal: Rlt e (pos (delta b')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rle_lt_trans with (delta b' / 2).
(* Goal: Rle e (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: Rlt (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) (pos (delta b')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assumption.
(* Goal: Rlt (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) (pos (delta b')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rminus_lt_0 ; field_simplify ; rewrite Rdiv_1.
(* Goal: Rlt (IZR Z0) (Rdiv (pos (delta b')) (IZR (Zpos (xO xH)))) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
by apply is_pos_div_2.
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (SF_size s') with (Peano.pred (size (rcons (SF_ly s') (snd (b' + e, b'))))).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite last_rcons.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite size_rcons ; rewrite SF_size_ly ; simpl ; easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_rcons.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_lx.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite ssrnat.leqnn.
(* Goal: @eq R b' (@nth R (IZR Z0) (@SF_lx R s') (@SF_size R s')) *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (SF_size s') with (Peano.pred (size (SF_lx s'))).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite nth_last.
(* Goal: @eq R b' (@last R (IZR Z0) (@SF_lx R s')) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
destruct HH as (HH, HH') ; rewrite <- HH'.
(* Goal: @eq R (@last R (@SF_h R s') (@SF_lx R s')) (@last R (IZR Z0) (@SF_lx R s')) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
case Hcase2 : (SF_lx s').
(* Goal: @eq R (@last R (@SF_h R s') (@Datatypes.nil R)) (@last R (IZR Z0) (@Datatypes.nil R)) *)
(* Goal: @eq R (@last R (@SF_h R s') (@Datatypes.cons R _a_ _l_)) (@last R (IZR Z0) (@Datatypes.cons R _a_ _l_)) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assert (size (SF_lx s') = S (SF_size s')) as Hss.
(* Goal: @eq nat (@size R (@SF_lx R s')) (S (@SF_size R s')) *)
(* Goal: @eq R (@last R (@SF_h R s') (@Datatypes.nil R)) (@last R (IZR Z0) (@Datatypes.nil R)) *)
(* Goal: @eq R (@last R (@SF_h R s') (@Datatypes.cons R _a_ _l_)) (@last R (IZR Z0) (@Datatypes.cons R _a_ _l_)) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply SF_size_lx.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Hcase2 in Hss.
(* Goal: @eq R (@last R (@SF_h R s') (@Datatypes.nil R)) (@last R (IZR Z0) (@Datatypes.nil R)) *)
(* Goal: @eq R (@last R (@SF_h R s') (@Datatypes.cons R _a_ _l_)) (@last R (IZR Z0) (@Datatypes.cons R _a_ _l_)) *)
(* Goal: @eq nat (Init.Nat.pred (@size R (@SF_lx R s'))) (@SF_size R s') *)
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply O_S in Hss ; destruct Hss.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite last_cons ; rewrite last_cons ; easy.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite SF_size_lx ; simpl ; easy.
(* Goal: @eq R (Rplus b' e) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S (@SF_size R s'))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
replace (S (SF_size s')) with (Peano.pred (size (rcons (SF_lx s') (fst (b' + e, b'))))).
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite nth_last ; rewrite last_rcons ; easy.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite size_rcons ; rewrite SF_size_lx ; simpl ; easy.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_rcons ; rewrite last_rcons.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (Init.Nat.pred (S (@SF_size R s)))) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold SF_rcons ; simpl.
(* Goal: @eq R (@SF_h R s) (Rmin a b) *)
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply H5.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
easy.
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply H in H42.
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
assert (b' < b' + e) as H43.
(* Goal: Rlt b' (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite <- (Rplus_0_r b') at 1.
(* Goal: Rlt (Rplus b' (IZR Z0)) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
now apply Rplus_lt_compat_l.
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Rle_not_lt in H42.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Hb'3.
(* Goal: @eq R b' (Rmax a b) *)
assert (b' <= Rmax a b) as Hb'3.
(* Goal: Rle b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply H.
(* Goal: is_upper_bound M (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intros x Hx.
(* Goal: Rle x (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply Hx.
(* Goal: @eq R b' (Rmax a b) *)
apply Rle_not_gt in Hb'3.
(* Goal: @eq R b' (Rmax a b) *)
contradiction.
Qed.

Global Instance KH_fine_proper_filter a b : ProperFilter' (KH_fine a b).
Proof.
(* Goal: @ProperFilter' (@SF_seq R) (KH_fine a b) *)
constructor.
(* Goal: not (KH_fine a b (fun _ : @SF_seq R => False)) *)
(* Goal: @Filter (@SF_seq R) (KH_fine a b) *)
unfold KH_fine ; unfold within ; unfold KH_filter.
(* Goal: not (@ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b)))))) *)
(* Goal: @Filter (@SF_seq R) (KH_fine a b) *)
intro H.
(* Goal: False *)
(* Goal: @Filter (@SF_seq R) (KH_fine a b) *)
destruct H as (delta, Hdelta).
(* Goal: False *)
(* Goal: @Filter (@SF_seq R) (KH_fine a b) *)
apply (cousin a b delta).
(* Goal: not (@ex (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (fine delta ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b)))))) *)
(* Goal: @Filter (@SF_seq R) (KH_fine a b) *)
intro H.
(* Goal: False *)
(* Goal: @Filter (@SF_seq R) (KH_fine a b) *)
destruct H as (ptd, Hptd).
(* Goal: False *)
(* Goal: @Filter (@SF_seq R) (KH_fine a b) *)
apply (Hdelta ptd).
(* Goal: pointed_subdiv ptd *)
(* Goal: and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b)) *)
(* Goal: @Filter (@SF_seq R) (KH_fine a b) *)
apply Hptd.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: pointed_subdiv ptd *)
(* Goal: and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b)) *)
(* Goal: @Filter (@SF_seq R) (KH_fine a b) *)
apply Hptd.
(* Goal: pointed_subdiv ptd *)
(* Goal: and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b)) *)
(* Goal: @Filter (@SF_seq R) (KH_fine a b) *)
split ; apply Hptd.
(* Goal: @Filter (@SF_seq R) (KH_fine a b) *)
unfold KH_fine.
(* Goal: @Filter (@SF_seq R) (@within (@SF_seq R) (fun ptd : @SF_seq R => and (pointed_subdiv ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b)))) KH_filter) *)
apply within_filter.
(* Goal: @Filter (@SF_seq R) KH_filter *)
apply KH_filter_filter.
Qed.

Section is_KHInt.

Context {V : NormedModule R_AbsRing}.

Definition is_KHInt (f : R -> V) (a b : R) (If : V) :=
  filterlim (fun ptd => scal (sign (b-a)) (Riemann_sum f ptd)) (KH_fine a b) (locally If).

Definition ex_KHInt f a b :=
  exists If : V, is_KHInt f a b If.

Lemma is_KHInt_point :
  forall (f : R -> V) (a : R),
  is_KHInt f a a zero.
Proof.
(* Goal: forall (f : forall _ : R, CompleteNormedModule.sort R_AbsRing V) (a : R), @eq (CompleteSpace.sort (CompleteNormedModule.CompleteSpace R_AbsRing V)) (KHInt f a a) (@zero (CompleteNormedModule.AbelianGroup R_AbsRing V)) *)
intros f a.
(* Goal: is_KHInt f a a (@zero (NormedModule.AbelianGroup R_AbsRing V)) *)
unfold is_KHInt.
(* Goal: @filterlim (@SF_seq R) (ModuleSpace.sort R_Ring (NormedModule.ModuleSpace R_AbsRing V)) (fun ptd : @SF_seq R => @scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus a a)) (@Riemann_sum (NormedModule.ModuleSpace R_AbsRing V) f ptd)) (KH_fine a a) (@locally (NormedModule.UniformSpace R_AbsRing V) (@zero (NormedModule.AbelianGroup R_AbsRing V))) *)
apply filterlim_ext with (fun ptd : @SF_seq R => @zero V).
(* Goal: forall x : @SF_seq R, @eq (AbelianGroup.sort (NormedModule.AbelianGroup R_AbsRing V)) (@zero (NormedModule.AbelianGroup R_AbsRing V)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus a a)) (@Riemann_sum (NormedModule.ModuleSpace R_AbsRing V) f x)) *)
(* Goal: @filterlim (@SF_seq R) (AbelianGroup.sort (NormedModule.AbelianGroup R_AbsRing V)) (fun _ : @SF_seq R => @zero (NormedModule.AbelianGroup R_AbsRing V)) (KH_fine a a) (@locally (NormedModule.UniformSpace R_AbsRing V) (@zero (NormedModule.AbelianGroup R_AbsRing V))) *)
intro ptd.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rminus_eq_0 sign_0.
(* Goal: @eq R (@fst R R (@pair R R (Rplus b' e) b')) (Rplus b' e) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
rewrite scal_zero_l ; easy.
(* Goal: is_KHInt (fun _ : R => c) a b (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) *)
intros P HP.
(* Goal: @filtermap (@SF_seq R) (AbelianGroup.sort (NormedModule.AbelianGroup R_AbsRing V)) (fun _ : @SF_seq R => @zero (NormedModule.AbelianGroup R_AbsRing V)) (KH_fine a a) P *)
unfold filtermap.
(* Goal: @filtermap (@SF_seq R) (ModuleSpace.sort R_Ring (NormedModule.ModuleSpace R_AbsRing V)) (fun ptd : @SF_seq R => @scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@Riemann_sum (NormedModule.ModuleSpace R_AbsRing V) (fun _ : R => c) ptd)) (KH_fine a b) P *)
destruct HP as (eps, HPeps).
(* Goal: KH_fine a a (fun _ : @SF_seq R => P (@zero (NormedModule.AbelianGroup R_AbsRing V))) *)
exists (fun x : R => {| pos := 1 ; cond_pos := Rlt_0_1 |}).
(* Goal: forall (ptd : @SF_seq R) (_ : fine (fun _ : R => eps) ptd) (_ : and (pointed_subdiv ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b)))), P (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@Riemann_sum (NormedModule.ModuleSpace R_AbsRing V) (fun _ : R => c) ptd)) *)
intros ptd Hptd Hptd2.
(* Goal: P (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@Riemann_sum (NormedModule.ModuleSpace R_AbsRing V) (fun _ : R => c) ptd)) *)
apply HPeps.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) *)
(* Goal: @eq R (Rminus b a) (@mult R_Ring (sign (Rminus b a)) (Rminus (Rmax a b) (Rmin a b))) *)
apply ball_center.
Qed.

Lemma ex_KHInt_point :
  forall (f : R -> V) (a : R),
  ex_KHInt f a a.
Proof.
(* Goal: forall (f : forall _ : R, NormedModule.sort R_AbsRing V) (a : R), ex_KHInt f a a *)
intros f a ; exists zero ; now apply is_KHInt_point.
Qed.

Lemma is_KHInt_const :
  forall (a b : R) (c : V),
  is_KHInt (fun x : R => c) a b (scal (b-a) c).
Proof.
(* Goal: forall (a b : R) (c : NormedModule.sort R_AbsRing V), is_KHInt (fun _ : R => c) a b (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) *)
intros a b c.
(* Goal: is_KHInt (fun _ : R => c) a b (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) *)
intros P HP.
(* Goal: @filtermap (@SF_seq R) (ModuleSpace.sort R_Ring (NormedModule.ModuleSpace R_AbsRing V)) (fun ptd : @SF_seq R => @scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@Riemann_sum (NormedModule.ModuleSpace R_AbsRing V) (fun _ : R => c) ptd)) (KH_fine a b) P *)
destruct HP as (eps, HPeps).
(* Goal: @filtermap (@SF_seq R) (ModuleSpace.sort R_Ring (NormedModule.ModuleSpace R_AbsRing V)) (fun ptd : @SF_seq R => @scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@Riemann_sum (NormedModule.ModuleSpace R_AbsRing V) (fun _ : R => c) ptd)) (KH_fine a b) P *)
exists (fun x : R => eps).
(* Goal: forall (ptd : @SF_seq R) (_ : fine (fun _ : R => eps) ptd) (_ : and (pointed_subdiv ptd) (and (@eq R (@SF_h R ptd) (Rmin a b)) (@eq R (@last R (@SF_h R ptd) (@SF_lx R ptd)) (Rmax a b)))), P (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@Riemann_sum (NormedModule.ModuleSpace R_AbsRing V) (fun _ : R => c) ptd)) *)
intros ptd Hptd Hptd2.
(* Goal: P (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@Riemann_sum (NormedModule.ModuleSpace R_AbsRing V) (fun _ : R => c) ptd)) *)
apply HPeps.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Riemann_sum_const.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (@last R (@SF_h R ptd) (@SF_lx R ptd)) (@SF_h R ptd)) c)) *)
destruct Hptd2 as (Hptd0, Hptd1).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (@last R (@SF_h R ptd) (@SF_lx R ptd)) (@SF_h R ptd)) c)) *)
destruct Hptd1 as (Hptd1, Hptd2).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Hptd2.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Hptd1.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite scal_assoc.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (@mult R_Ring (sign (Rminus b a)) (Rminus (Rmax a b) (Rmin a b))) c) *)
replace (mult (sign (b - a)) (Rmax a b - Rmin a b)) with (b-a).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) *)
(* Goal: @eq R (Rminus b a) (@mult R_Ring (sign (Rminus b a)) (Rminus (Rmax a b) (Rmin a b))) *)
apply ball_center.
(* Goal: @eq R (Rminus b a) (@mult R_Ring (sign (Rminus b a)) (Rminus (Rmax a b) (Rmin a b))) *)
apply sym_eq, sign_min_max.
Qed.

Lemma ex_KHInt_const :
  forall (a b : R) (c : V),
  ex_KHInt (fun x : R => c) a b.
Proof.
(* Goal: forall (a b : R) (c : NormedModule.sort R_AbsRing V), ex_KHInt (fun _ : R => c) a b *)
intros a b c ; exists (scal (b-a) c) ; apply is_KHInt_const.
Qed.

End is_KHInt.

Section KHInt.

Context {V : CompleteNormedModule R_AbsRing}.

Definition KHInt (f : R -> V) (a b : R) :=
  iota (is_KHInt f a b).

Lemma KHInt_correct :
  forall (f : R -> V) (a b : R),
  ex_KHInt f a b -> is_KHInt f a b (KHInt f a b).
Proof.
(* Goal: forall (f : forall _ : R, CompleteNormedModule.sort R_AbsRing V) (a b : R) (_ : @ex_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b), @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b (KHInt f a b) *)
intros f a b [v Hv].
(* Goal: @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b (KHInt f a b) *)
unfold KHInt.
(* Goal: @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b (@iota (CompleteNormedModule.CompleteSpace R_AbsRing V) (@is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b)) *)
apply iota_correct.
(* Goal: @ex (CompleteNormedModule.sort R_AbsRing V) (@unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x)) *)
exists v.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b v *)
(* Goal: forall (x' : CompleteNormedModule.sort R_AbsRing V) (_ : @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x'), @eq (CompleteNormedModule.sort R_AbsRing V) v x' *)
exact Hv.
(* Goal: forall (x' : CompleteNormedModule.sort R_AbsRing V) (_ : @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x'), @eq (CompleteNormedModule.sort R_AbsRing V) v x' *)
intros w Hw.
(* Goal: @eq (CompleteNormedModule.sort R_AbsRing V) v w *)
apply filterlim_locally_unique with (1 := Hv) (2 := Hw).
Qed.

Lemma is_KHInt_unique :
  forall (f : R -> V) (a b : R) (l : V),
  is_KHInt f a b l -> KHInt f a b = l.
Proof.
(* Goal: forall (f : forall _ : R, CompleteNormedModule.sort R_AbsRing V) (a b : R) (l : CompleteNormedModule.sort R_AbsRing V) (_ : @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b l), @eq (CompleteSpace.sort (CompleteNormedModule.CompleteSpace R_AbsRing V)) (KHInt f a b) l *)
intros f a b l H.
(* Goal: @eq (CompleteSpace.sort (CompleteNormedModule.CompleteSpace R_AbsRing V)) (KHInt f a b) l *)
apply filterlim_locally_unique with (2 := H).
(* Goal: @filterlim (@SF_seq R) (NormedModule.sort R_AbsRing (CompleteNormedModule.NormedModule R_AbsRing V)) (fun ptd : @SF_seq R => @scal R_Ring (NormedModule.ModuleSpace R_AbsRing (CompleteNormedModule.NormedModule R_AbsRing V)) (sign (Rminus b a)) (@Riemann_sum (NormedModule.ModuleSpace R_AbsRing (CompleteNormedModule.NormedModule R_AbsRing V)) f ptd)) (KH_fine a b) (@locally (NormedModule.UniformSpace R_AbsRing (CompleteNormedModule.NormedModule R_AbsRing V)) (KHInt f a b)) *)
apply KHInt_correct.
(* Goal: @ex_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b *)
now exists l.
Qed.

Lemma KHInt_point :
  forall (f : R -> V) (a : R),
  KHInt f a a = zero.
Proof.
(* Goal: forall (f : forall _ : R, CompleteNormedModule.sort R_AbsRing V) (a : R), @eq (CompleteSpace.sort (CompleteNormedModule.CompleteSpace R_AbsRing V)) (KHInt f a a) (@zero (CompleteNormedModule.AbelianGroup R_AbsRing V)) *)
intros f a.
(* Goal: @eq (CompleteSpace.sort (CompleteNormedModule.CompleteSpace R_AbsRing V)) (KHInt (fun _ : R => v) a b) (@scal R_Ring (CompleteNormedModule.ModuleSpace R_AbsRing V) (Rminus b a) v) *)
apply is_KHInt_unique.
(* Goal: @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) (fun _ : R => v) a b (@scal R_Ring (CompleteNormedModule.ModuleSpace R_AbsRing V) (Rminus b a) v) *)
apply: is_KHInt_point.
Qed.

Lemma KHInt_const :
  forall (a b : R) (v : V),
  KHInt (fun _ => v) a b = scal (b - a) v.
Proof.
(* Goal: forall (a b : R) (v : CompleteNormedModule.sort R_AbsRing V), @eq (CompleteSpace.sort (CompleteNormedModule.CompleteSpace R_AbsRing V)) (KHInt (fun _ : R => v) a b) (@scal R_Ring (CompleteNormedModule.ModuleSpace R_AbsRing V) (Rminus b a) v) *)
intros a b v.
(* Goal: @eq (CompleteSpace.sort (CompleteNormedModule.CompleteSpace R_AbsRing V)) (KHInt (fun _ : R => v) a b) (@scal R_Ring (CompleteNormedModule.ModuleSpace R_AbsRing V) (Rminus b a) v) *)
apply is_KHInt_unique.
(* Goal: @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) (fun _ : R => v) a b (@scal R_Ring (CompleteNormedModule.ModuleSpace R_AbsRing V) (Rminus b a) v) *)
apply: is_KHInt_const.
Qed.

Lemma is_RInt_KHInt :
  forall (f : R -> V) (a b : R) (l : V),
  is_RInt f a b l -> is_KHInt f a b l.
Proof.
intros f a b I.
unfold is_RInt, is_KHInt.
apply filterlim_filter_le_1.
unfold filter_le, Riemann_fine, KH_fine, within, KH_filter, locally_dist.
intros P [delta HPdelta].
exists (fun _ => delta).
intros ptd Hptd1 Hptd2.
apply HPdelta.
2: exact Hptd2.
clear -Hptd1 Hptd2.
unfold fine in Hptd1.
revert Hptd1 Hptd2.
assert ((forall i : nat, (i < SF_size ptd)%nat -> ith_step ptd i < delta) ->
pointed_subdiv ptd /\
SF_h ptd >= Rmin a b /\ last (SF_h ptd) (SF_lx ptd) = Rmax a b ->
seq_step (SF_lx ptd) < delta) as H0.
(* Goal: and (Rle (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i)) (Rle (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s (@pair R R b' b'))) i) (@nth R (IZR Z0) (@SF_lx R (@SF_rcons R s (@pair R R b' b'))) (S i))) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply SF_cons_ind with (s := ptd) => {ptd} [x0 | h ptd IH] H.
intros H0.
apply cond_pos.
(* Goal: forall _ : E x, Rle x (Rminus l (pos e)) *)
(* Goal: False *)
intro H0.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_cons.
(* Goal: @eq R (@nth R (@SF_h R s) (@SF_lx R s) (Init.Nat.pred (S (@SF_size R s)))) (@nth R (IZR Z0) (@SF_lx R s) (@SF_size R s)) *)
(* Goal: @eq R b' (@nth R (IZR Z0) (@rcons R (@SF_lx R s) (@fst R R (@pair R R b' b'))) (S (@SF_size R s))) *)
(* Goal: @eq R (@nth R (IZR Z0) (@SF_ly R s') i) (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i) *)
(* Goal: @eq R (ith_step s' i) (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) *)
(* Goal: forall _ : @eq nat i (@SF_size R s'), Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) i) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) i))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold seq_step ; simpl.
apply Rmax_case.
specialize (H 0%nat).
unfold ith_step in H.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_lx_cons in H.
simpl in H.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite Rabs_right.
(* Goal: Rle b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply H.
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite SF_size_cons.
apply lt_0_Sn.
destruct H0 as (H0, H1).
unfold pointed_subdiv in H0.
apply Rge_minus.
apply Rle_ge.
specialize (H0 0%nat).
apply Rle_trans with (nth 0 (SF_ly (SF_cons h ptd)) 0) ; apply H0 ; rewrite SF_size_cons ; apply lt_0_Sn.
apply IH.
(* Goal: forall (i : nat) (_ : lt i (S (@SF_size R s'))), and (Rle (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i)) (Rle (@nth R (IZR Z0) (@rcons R (@SF_ly R s') (@snd R R (@pair R R (Rplus b' e) b'))) i) (@nth R (IZR Z0) (@rcons R (@SF_lx R s') (@fst R R (@pair R R (Rplus b' e) b'))) (S i))) *)
(* Goal: and (fine delta (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e))) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
intros i Hi.
specialize (H (S i)).
(* Goal: Rlt (ith_step (@SF_rcons R s' (@pair R R (Rplus b' e) b')) (@SF_size R s')) (pos (delta (@nth R (IZR Z0) (@SF_ly R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_size R s')))) *)
(* Goal: and (@eq R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (Rmin a b)) (@eq R (@last R (@SF_h R (@SF_rcons R s' (@pair R R (Rplus b' e) b'))) (@SF_lx R (@SF_rcons R s' (@pair R R (Rplus b' e) b')))) (Rplus b' e)) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
unfold ith_step.
unfold ith_step in H.
change (nth 0 (SF_lx ptd) (S i)) with (nth 0 (SF_lx (SF_cons h ptd)) (S (S i))).
change (nth 0 (SF_lx ptd) i) with (nth 0 (SF_lx (SF_cons h ptd)) (S i)).
(* Goal: Rle b' (Rmax a b) *)
(* Goal: @eq R b' (Rmax a b) *)
apply H.
rewrite SF_size_cons ; now apply lt_n_S.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
apply ptd_cons with h.
apply H0.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
apply Rge_trans with (SF_h (SF_cons h ptd)).
2:apply H0.
2:apply H0.
apply Rle_ge.
destruct H0 as (H0, H1).
unfold pointed_subdiv in H0.
specialize (H0 0%nat).
change (SF_h (SF_cons h ptd)) with (nth 0 (SF_lx (SF_cons h ptd)) 0).
change (SF_h ptd) with (nth 0 (SF_lx (SF_cons h ptd)) 1).
apply Rle_trans with (nth 0 (SF_ly (SF_cons h ptd)) 0) ; apply H0 ; rewrite SF_size_cons ; apply lt_0_Sn.
intros H1 H2.
apply H0.
(* Goal: not (and (E x) (Rlt (Rminus l (pos e)) x)) *)
(* Goal: forall _ : E x, Rle x (Rminus l (pos e)) *)
(* Goal: False *)
apply H1.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
(* Goal: pointed_subdiv s *)
(* Goal: lt i (@size R (@SF_lx R s)) *)
(* Goal: @eq R (@last R (IZR Z0) (@SF_lx R s)) (@last R (@SF_h R s) (@SF_lx R s)) *)
(* Goal: Rle (@last R (@SF_h R s) (@SF_lx R s)) b' *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply H2.
(* Goal: @unique (CompleteNormedModule.sort R_AbsRing V) (fun x : CompleteNormedModule.sort R_AbsRing V => @is_KHInt (CompleteNormedModule.NormedModule R_AbsRing V) f a b x) v *)
split.
destruct H2 as (H2, (H3, H4)).
(* Goal: @ball (NormedModule.UniformSpace R_AbsRing V) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus b a) c) (pos eps) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (sign (Rminus b a)) (@scal R_Ring (NormedModule.ModuleSpace R_AbsRing V) (Rminus (Rmax a b) (Rmin a b)) c)) *)
rewrite H3.
apply Rge_refl.
(* Goal: pointed_subdiv s *)
(* Goal: lt i (@size R (@SF_lx R s)) *)
(* Goal: @eq R (@last R (IZR Z0) (@SF_lx R s)) (@last R (@SF_h R s) (@SF_lx R s)) *)
(* Goal: Rle (@last R (@SF_h R s) (@SF_lx R s)) b' *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_lx R s) i) (IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_ly R s) i) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_lx R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (@nth R (IZR Z0) (@SF_ly R s) i) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (@nth R (IZR Z0) (@SF_lx R s) (S i)) *)
(* Goal: Rle (if @eqtype.eq_op ssrnat.nat_eqType i (@size R (@SF_ly R s)) then b' else IZR Z0) (if @eqtype.eq_op ssrnat.nat_eqType (S i) (@size R (@SF_lx R s)) then b' else IZR Z0) *)
(* Goal: and (@eq R (@SF_h R s') (Rmin a b)) (@eq R (@last R (@SF_h R s') (@SF_lx R s')) b') *)
(* Goal: False *)
apply H2.
Qed.

End KHInt.
