Skip to content

Commit

Permalink
delta_eps_bound
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtrager committed Dec 22, 2023
1 parent 075274b commit 718ec65
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 7 deletions.
85 changes: 81 additions & 4 deletions coq/QLearn/jaakkola_vector.v
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,84 @@ Proof.
now apply (lemma2_n0_w x w X XX Y G C).
Qed.





Lemma gamma_C :
0 < gamma < 1 ->
forall (C : R),
C > gamma / (1-gamma) ->
0 < C /\
gamma * (C + 1)/C < 1.
Proof.
intros.
assert (0 < C).
{
apply Rgt_lt in H0.
eapply Rlt_trans; [|apply H0].
apply Rdiv_lt_0_compat; lra.
}
split; trivial.
apply Rmult_lt_reg_r with (r := C); trivial.
unfold Rdiv.
rewrite Rmult_assoc.
rewrite <- Rinv_l_sym; try lra.
rewrite Rmult_1_l.
rewrite Rmult_1_r.
apply Rmult_gt_compat_r with (r := (1 - gamma)) in H0; try lra.
unfold Rdiv in H0.
rewrite Rmult_assoc in H0.
rewrite <- Rinv_l_sym in H0; lra.
Qed.

Lemma Rvector_scale_const {n : nat} (c1 c2 : R) :
Rvector_scale c1 (vector_const c2 n) = vector_const (c1 * c2) n.
Proof.
Admitted.

Lemma Rvector_max_abs_const {n : nat} (c : R) :
Rvector_max_abs (vector_const c n) = Rabs c.
Proof.
Admitted.


Lemma delta_eps_bound (eps : posreal) (C : posreal) {N} (delta : vector R N) :
0 < gamma ->
Rvector_max_abs delta > C * eps ->
gamma * Rvector_max_abs (Rvector_plus delta (vector_const (pos eps) N)) <=
gamma * (C + 1)/ C * Rvector_max_abs delta.
Proof.
intros.
unfold Rdiv.
rewrite Rmult_assoc.
rewrite Rmult_assoc.
apply Rmult_le_compat_l; try lra.
rewrite <- Rmult_1_l at 1.
rewrite (Rinv_l_sym C) at 1.
- rewrite <- Rmult_assoc.
rewrite (Rmult_comm (C + 1) _).
rewrite Rmult_assoc.
rewrite Rmult_assoc.
apply Rmult_le_compat_l.
+ left.
apply Rinv_pos.
apply cond_pos.
+ replace (pos C) with (Rabs C) at 1.
* rewrite <- Rvector_max_abs_scale.
rewrite Rvector_scale_plus_l.
eapply Rle_trans.
-- apply Rvector_max_abs_triang.
-- rewrite Rvector_scale_const.
rewrite Rvector_max_abs_const.
rewrite Rabs_right.
++ apply Rgt_lt in H0.
apply Rplus_lt_compat_l with (r := Rvector_max_abs (Rvector_scale C delta)) in H0.
eapply Rle_trans.
** left; apply H0.
** rewrite Rvector_max_abs_scale.
right.
rewrite Rabs_right; try lra.
left; apply cond_pos.
++ apply Rle_ge.
apply Rmult_le_pos; left; apply cond_pos.
* apply Rabs_right; apply Rle_ge; left; apply cond_pos.
- apply Rgt_not_eq.
apply cond_pos.
Qed.
5 changes: 2 additions & 3 deletions coq/QLearn/vecslln.v
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ Section conv_as.
destruct (conv_as_prob_1_eps (fun n => rvmaxabs (f n)) H0 eps eps).
exists x.
intros.
specialize (H1 n H2).

eapply Rge_trans; [| apply H1].
eapply Rge_trans; [|now apply (H1 _ H2)].
right.
apply ps_proper.
intros ?.
Expand All @@ -235,6 +233,7 @@ Section conv_as.
now rewrite H3.
Qed.


End conv_as.

Section vec_cauchy.
Expand Down

0 comments on commit 718ec65

Please sign in to comment.