Skip to content

[Merged by Bors] - feat: Lemmas DifferentiableAt.add_iff_left, DifferentiableAt.add_iff_right#14593

Closed
adomasbaliuka wants to merge 13 commits intomasterfrom
adomas_feat_DifferentiableAt_add_iff
Closed

[Merged by Bors] - feat: Lemmas DifferentiableAt.add_iff_left, DifferentiableAt.add_iff_right#14593
adomasbaliuka wants to merge 13 commits intomasterfrom
adomas_feat_DifferentiableAt_add_iff

Conversation

@adomasbaliuka
Copy link
Copy Markdown
Collaborator

@adomasbaliuka adomasbaliuka commented Jul 9, 2024

Given a function differentiable at a point, the result of adding a second function is differentiable (there) iff the second function is differentiable (there).


The part that's new is: at a point, the sum of a differentiable and a non-differentiable function is non-differentiable.
The other direction of the iff is already covered by DifferentiableAt.add.

Lemmas are marked @[simp] because other iff lemmas in that file are marked as such.

Needed for #9734

Open in Gitpod

Lemmas say: at a point, the sum of a differentiable and a non-differentiable function is non-differentiable
@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Jul 9, 2024
@adomasbaliuka adomasbaliuka added the t-analysis Analysis (normed *, calculus) label Jul 9, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 9, 2024

PR summary a5922d1d7b

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ Differentiable.add_iff_left
+ Differentiable.add_iff_right
+ Differentiable.sub_iff_left
+ Differentiable.sub_iff_right
+ DifferentiableAt.add_iff_left
+ DifferentiableAt.add_iff_right
+ DifferentiableAt.sub_iff_left
+ DifferentiableAt.sub_iff_right
+ DifferentiableOn.add_iff_left
+ DifferentiableOn.add_iff_right
+ DifferentiableOn.sub_iff_left
+ DifferentiableOn.sub_iff_right

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

@urkud
Copy link
Copy Markdown
Member

urkud commented Jul 10, 2024

Let's test if @[simp] causes troubles.

@urkud
Copy link
Copy Markdown
Member

urkud commented Jul 10, 2024

!bench

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
@urkud
Copy link
Copy Markdown
Member

urkud commented Jul 10, 2024

@YaelDillies Could you please remind me what's our convention about left/right in lemmas like these?

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit a839b02.
There were no significant changes against commit 5e75b54.

@urkud
Copy link
Copy Markdown
Member

urkud commented Jul 10, 2024

LGTM but I don't remember what's our convention about left/right here, so delegating to Yael who probably remembers it.
bors d=@YaelDillies

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jul 10, 2024

✌️ YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jul 10, 2024
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

binOp_iff_left should be of the form P (binOp f g) \iff P f, and binOp_iff_right should be of the form P (binOp f g) \iff P g.

Can you add the corresponding sub lemmas?

Also replaces simp by simp only. Those simps were terminal, so maybe OK, but I still like seeing what lemmas get used when reading a proof.
@adomasbaliuka
Copy link
Copy Markdown
Collaborator Author

adomasbaliuka commented Jul 10, 2024

Can you add the corresponding sub lemmas?

Now the linter complains that old lemmas (which concern the special case of subtracting constant) can be proved by simp. What to do?

  • Do not mark sub_iff_* as @[simp]
  • Remove the @[simp] mark from the old lemmas
  • ?

@YaelDillies
Copy link
Copy Markdown
Contributor

Remove the simp from the old lemmas (/deprecate the old lemmas since they are superseded?)

Can you also add the DifferentiableOn version of your new lemmas?

Because, e.g., differentiableAt_const also has it.
…ff and differentiable*_const_(sub|add)_iff

Because simp can prove these now using the more general lemmas
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Thanks!

maintainer merge

@github-actions
Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jul 12, 2024
Copy link
Copy Markdown
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

bors merge

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Jul 12, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jul 12, 2024
…ff_right` (#14593)

Given a function differentiable at a point, the result of adding a second function is differentiable (there) iff the second function is differentiable (there).
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jul 12, 2024

This PR was included in a batch that was canceled, it will be automatically retried

mathlib-bors bot pushed a commit that referenced this pull request Jul 12, 2024
…ff_right` (#14593)

Given a function differentiable at a point, the result of adding a second function is differentiable (there) iff the second function is differentiable (there).
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jul 12, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: Lemmas DifferentiableAt.add_iff_left, DifferentiableAt.add_iff_right [Merged by Bors] - feat: Lemmas DifferentiableAt.add_iff_left, DifferentiableAt.add_iff_right Jul 12, 2024
@mathlib-bors mathlib-bors bot closed this Jul 12, 2024
@mathlib-bors mathlib-bors bot deleted the adomas_feat_DifferentiableAt_add_iff branch July 12, 2024 15:30
@adomani adomani mentioned this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! ready-to-merge This PR has been sent to bors. t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants