Skip to content

natural logarithm for extended real numbers #1649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

affeldt-aist
Copy link
Member

Motivation for this change

closes draft PR #1613

@jmmarulang : I have duplicated your PR to avoid pushing on your master

Checklist
  • added corresponding entries in CHANGELOG_UNRELEASED.md
  • added corresponding documentation in the headers

Reference: How to document

Merge policy

As a rule of thumb:

  • PRs with several commits that make sense individually and that
    all compile are preferentially merged into master.
  • PRs with disorganized commits are very likely to be squash-rebased.
Reminder to reviewers

@affeldt-aist
Copy link
Member Author

Note that the last commit changes the definition of lne so that lne -oo = -oo
and then we can write

Lemma lne_div : {in `]0, +oo] &, {morph lne : x y / x / y >-> x - y}}.

instead of

Lemma lne_div x y :
  0 < x -> 0 < y -> lne (x * (fine y)^-1%:E) = lne x - lne y.

(fyi: @CohenCyril)

@jmmarulang It looks a bit better but is it as useful to you?

@affeldt-aist affeldt-aist changed the title natural logarithme for extended real numbers natural logarithm for extended real numbers Jul 7, 2025
Copy link
Member

@hoheinzollern hoheinzollern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@@ -21,7 +21,8 @@ From mathcomp Require Import realfun interval_inference convex.
(* pseries_diffs f i == (i + 1) * f (i + 1) *)
(* *)
(* expeR x == extended real number-valued exponential function *)
(* ln x == the natural logarithm *)
(* ln x == the natural logarithm, in ring_scope *)
(* lne x == the natural logarithm, in ereal_scope *)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather align the == than the function names

by rewrite in_itv //= leey andbT addrC -(oppeK 1) sube_ge0.
Qed.

Lemma lne_sublinear x : 0 < x < +oo -> lne x < x.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably true for all finite x?

by rewrite lne_EFin// lte_fin ln_sublinear.
Qed.

Lemma lne_ge0 x : 1 <= x -> 0 <= lne x.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably an equivalence?

by rewrite lne_EFin// ?(lt_le_trans _ r1)// lee_fin ln_ge0.
Qed.

Lemma lne_lt0 x : 0 < x < 1 -> lne x < 0.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a consequence of the following equivalence:

Suggested change
Lemma lne_lt0 x : 0 < x < 1 -> lne x < 0.
Lemma lne_lt0 x : (lne x < 0) = (x < 1).

by move=> /andP[? ?]; rewrite -lte_expeR expeR0 lneK ?in_itv//= leey andbT ?ltW.
Qed.

Lemma lne_gt0 x : 1 < x -> 0 < lne x.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably an equivalence

by rewrite (le_trans _ (ltW x1)).
Qed.

Fact le1_lne_le0 x : x <= 1 -> lne x <= 0.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

by rewrite expeS lneM ?ih ?muleS// in_itv/= ?expe_gt0// ?x0/= leey.
Qed.

Lemma le_lne1Dx x : - 1%E <= x -> lne (1 + x) <= x.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

equivalence too? (and why %E?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants