Skip to content

Commit

Permalink
genharmonic_series_sq'
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtrager committed Dec 12, 2024
1 parent 4998d80 commit 34e672e
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions coq/QLearn/infprod.v
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,15 @@ Proof.
apply cond_pos.
Qed.

Lemma inv_bound_ge (a : posreal) (b : nonnegreal) :
/ a >= / (a + b).
Proof.
apply Rle_ge.
generalize (cond_pos a); intros.
generalize (cond_nonneg b); intros.
apply Rinv_le_contravar; lra.
Qed.

Lemma inv_bound_sq_gt (a b : posreal) :
Rsqr (/ a) > Rsqr (/ (a + b)).
Proof.
Expand All @@ -1394,6 +1403,21 @@ Proof.
apply Rinv_0_lt_compat; apply cond_pos.
Qed.

Lemma inv_bound_sq_ge (a : posreal) (b : nonnegreal) :
Rsqr (/ a) >= Rsqr (/ (a + b)).
Proof.
generalize (cond_pos a); intros.
generalize (cond_nonneg b); intros.
apply Rle_ge.
apply Rsqr_incr_1.
+ apply Rge_le.
apply inv_bound_ge.
+ left.
apply Rinv_0_lt_compat; lra.
+ left.
apply Rinv_0_lt_compat; lra.
Qed.

Lemma inv_bound_exists_lt (a b : posreal) :
exists (j : nat), forall (n:nat), / (a * (INR ((S n) + j))) < / (a * INR (S n) + b).
Proof.
Expand Down Expand Up @@ -1471,13 +1495,37 @@ Proof.
- apply genharmonic_series_sq0.
Qed.

Lemma genharmonic_series_sq' (b : nonnegreal) (c : posreal) :
ex_series (fun n => Rsqr (/ (b + c * INR (S n)))).
Proof.
apply (@ex_series_le R_AbsRing) with (b := fun n => Rsqr ( / (c * INR (S n)))).
- intros.
assert (0 < c * INR (S n)).
+ apply Rmult_lt_0_compat; [apply cond_pos | ].
apply lt_0_INR; lia.
+ rewrite Rabs_right.
* apply Rge_le.
rewrite Rplus_comm.
apply (inv_bound_sq_ge (mkposreal _ H) b).
* apply Rle_ge.
apply Rle_0_sqr.
- apply genharmonic_series_sq0.
Qed.

Lemma genharmonic_sq_lim (b c : posreal) :
is_lim_seq (fun n => Rsqr (/ (b + c * INR (S n)))) 0.
Proof.
apply ex_series_lim_0.
apply genharmonic_series_sq.
Qed.

Lemma genharmonic_sq_lim' (b : nonnegreal) (c : posreal) :
is_lim_seq (fun n => Rsqr (/ (b + c * INR (S n)))) 0.
Proof.
apply ex_series_lim_0.
apply genharmonic_series_sq'.
Qed.

Lemma harmonic_increasing :
let f := fun i => sum_f_R0' (fun n => 1 / INR (S n)) i in
forall n m : nat, (n <= m)%nat -> f n <= f m.
Expand Down

0 comments on commit 34e672e

Please sign in to comment.