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

[Merged by Bors] - chore(Topology/PartitionOfUnity): shorten proof using ParitionOfUnity.le_one #19899

Closed
wants to merge 1 commit into from

Conversation

dwrensha
Copy link
Member

Replaces 11 lines of proof with a single invocation of ParitionOfUnity.le_one.

I observed this (via set_option trace.profiler true) to lower the elaboration time of this theorem from 0.20 seconds to 0.08 seconds.

This simplification was found by tryAtEachStep.


Open in Gitpod

Copy link

PR summary 5a6c9a4629

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

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>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions bot added the t-topology Topological spaces, uniform spaces, metric spaces, filters label Dec 11, 2024
· exact fun j _ _ => f.nonneg j x
simp only [Finset.singleton_subset_iff, Finset.mem_filter, Finset.mem_univ, true_and]
exact h0
exact ⟨f.nonneg i x, PartitionOfUnity.le_one f i x⟩
Copy link
Member Author

Choose a reason for hiding this comment

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

The type required for the second component here is (f i) x ≤ 1, which is exactly what PartitionOfUnity.le_one gives us. (No defeq shenanigans.)

@tb65536
Copy link
Collaborator

tb65536 commented Dec 11, 2024

Wow, this tryAtEachStep is great!

maintainer merge

Copy link

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

@urkud
Copy link
Member

urkud commented Dec 11, 2024

Thanks! 🎉
bors merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the ready-to-merge This PR has been sent to bors. label Dec 11, 2024
mathlib-bors bot pushed a commit that referenced this pull request Dec 11, 2024
….le_one (#19899)

Replaces 11 lines of proof with a single invocation of [`ParitionOfUnity.le_one`](https://github.com/leanprover-community/mathlib4/blob/4411562e4fd2d02aa31e413bc8e948829aa3a62d/Mathlib/Topology/PartitionOfUnity.lean#L171).

I observed this (via `set_option trace.profiler true`) to lower the elaboration time of this theorem from 0.20 seconds to 0.08 seconds.

This simplification was found by [`tryAtEachStep`](https://github.com/dwrensha/tryAtEachStep).
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Dec 11, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore(Topology/PartitionOfUnity): shorten proof using ParitionOfUnity.le_one [Merged by Bors] - chore(Topology/PartitionOfUnity): shorten proof using ParitionOfUnity.le_one Dec 11, 2024
@mathlib-bors mathlib-bors bot closed this Dec 11, 2024
@mathlib-bors mathlib-bors bot deleted the PartitionOfUnity-tryAtEachStep branch December 11, 2024 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer-merge ready-to-merge This PR has been sent to bors. t-topology Topological spaces, uniform spaces, metric spaces, filters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants