Skip to content
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

generalize indexing in lemmas for series #1397

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

Conversation

t6s
Copy link
Member

@t6s t6s commented Nov 15, 2024

Motivation for this change

There are several lemmas for series stated with zero-based indexing
0 <= k < n and n <oo.
This PR generalizes them to m <= k < n and m <= n<oo.

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

Reference: How to document

Reminder to reviewers

@t6s
Copy link
Member Author

t6s commented Nov 15, 2024

Two lemmas for orderTypes are added in mathcomp_extra.v too.

@t6s t6s requested a review from affeldt-aist November 15, 2024 01:51
Copy link
Member

@affeldt-aist affeldt-aist left a comment

Choose a reason for hiding this comment

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

Excellent! No doubt it will be useful at some point. Just need a rebase for the changelog.

Comment on lines 543 to 549
Lemma eq_lt_total {disp : unit} {T : orderType disp} (x y : T) :
[|| x == y, (x < y)%O | (y < x)%O].
Proof. by case/boolP: (x == y)=> // ?; apply/orP; right; exact:lt_total. Qed.

Lemma le_lt_total {disp : unit} {T : orderType disp} (x y : T) :
(x <= y)%O || (y < x)%O.
Proof. by rewrite le_eqVlt -orbA eq_lt_total. Qed.
Copy link
Member

Choose a reason for hiding this comment

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

The idiomatic ways to deal with this is to use case: ltgtP or case: leP.

Copy link
Member Author

Choose a reason for hiding this comment

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

!

@@ -951,13 +951,15 @@ rewrite -(subrr (limn (series u_))).
by apply: cvgB => //; rewrite ?cvg_shiftS.
Qed.

Lemma nondecreasing_series (R : numFieldType) (u_ : R ^nat) (P : pred nat) :
Lemma nondecreasing_series (R : numFieldType) (u_ : R ^nat) (P : pred nat) m :
(forall n, P n -> 0 <= u_ n)%R ->
Copy link
Member

Choose a reason for hiding this comment

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

Why not having

Suggested change
(forall n, P n -> 0 <= u_ n)%R ->
(forall n, m <= n -> P n -> 0 <= u_ n)%R ->

instead as a side-condition ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed. Several other statements can be similarly generalized. I'll work on that.

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.

3 participants