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(Analysis/SpecificLimits/* and others): rename _0 -> _zero, _1 -> _one #10077

Closed
wants to merge 6 commits into from

Conversation

MichaelStollBayreuth
Copy link
Collaborator

See here on Zulip.

This PR changes a bunch of names containing nhds_0 or/and lt_1 to nhds_zero or/and lt_one.


Open in Gitpod

@MichaelStollBayreuth MichaelStollBayreuth added awaiting-review The author would like community review of the PR awaiting-CI t-analysis Analysis (normed *, calculus) labels Jan 28, 2024
Copy link
Member

@kbuzzard kbuzzard left a comment

Choose a reason for hiding this comment

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

This looks fine to me! Thanks a lot for doing it!

(tendsto_inv_atTop_zero.comp tendsto_exp_atTop).congr fun x => (exp_neg x).symm
#align real.tendsto_exp_neg_at_top_nhds_0 Real.tendsto_exp_neg_atTop_nhds_0
#align real.tendsto_exp_neg_at_top_nhds_0 Real.tendsto_exp_neg_atTop_nhds_zero
@[deprecated] alias tendsto_exp_neg_atTop_nhds_0 := tendsto_exp_neg_atTop_nhds_zero
Copy link
Member

Choose a reason for hiding this comment

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

I don't know enough about @[deprecated]: can you confirm that you don't need to put the Real namespace for this line to be effective? (in contrast to #align which does need them)

Thanks a lot for taking care of the #aligns and @[deprecated] by the way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it works (at least I got a bunch of warnings that stuff is deprecated).

theorem tsum_geometric_of_abs_lt_one {r : ℝ} (h : |r| < 1) : ∑' n : ℕ, r ^ n = (1 - r)⁻¹ :=
tsum_geometric_of_norm_lt_one h
#align tsum_geometric_of_abs_lt_1 tsum_geometric_of_abs_lt_one
@[deprecated] alias tsum_geometric_of_abs_lt_1 := tsum_geometric_of_abs_lt_one
Copy link
Member

Choose a reason for hiding this comment

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

Yikes, github making our life harder with this diff. @alexjbest can you use Leaff to confirm that this PR only does what it claims to do? Can you even check the @[deprecated] stuff does what it's supposed to do?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks fine to me from a visual inspection.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Frankly you could leave out the deprecated lines but it's probably kinder to keep them in I guess.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I imagine these results are likely to be used in downstream projects, and there it is nice to be told automatically after updating Mathlib that the names are now deprecated, with the offer of fixing them (rather than getting an "unknown identifier" error and having to consult the change log).

Copy link
Collaborator

Choose a reason for hiding this comment

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

As I say, it is kinder - I like that we have the option and I like that you've done it.

@adri326
Copy link
Collaborator

adri326 commented Jan 28, 2024

A clever grep search yields a few other theorem names that could receive the same treatment.
Here are the ripgrep commands I used:

# Clean output, whitelist-based
rg '^(?:protected\s+)?(?:theorem|lemma)\s+[\w_]+?(?:ge|lt|le|gt|eq|ne|at|tendsto|nhds|exp)(?<!image|[aA]lt|triangle)_?[0-5](?![0-9])' --pcre2

# More noisy, blacklist-based, but catches a few exceptions to the common patterns
rg '^(?:protected\s+)?(?:theorem|lemma)\s+[\w_]+(?<!bit|bitm|div|aleph|image|deriv|L|C|C_|[aA]ux|lem|sym|append|node|fold[lr]|[fF]in|vecAlt|Gamma|T)[0-3](?![0-9]|Space|_separation)' --pcre2

Mathlib/Analysis/ODE/Gronwall.lean

  • gronwallBound_of_K_ne_0

Mathlib/Logic/Function/Iterate.lean

  • involutive_iff_iter_2_eq_id

Mathlib/RingTheory/Polynomial/Bernstein.lean

  • eval_at_0
  • eval_at_1
  • iterate_derivative_at_0_eq_zero_of_lt
  • iterate_derivative_succ_at_0_eq_zero
  • iterate_derivative_at_0
  • iterate_derivative_at_0_ne_zero
  • iterate_derivative_at_1_eq_zero_of_lt
  • iterate_derivative_at_1
  • iterate_derivative_at_1_ne_zero

Mathlib/Algebra/GroupWithZero/Basic.lean

  • zero_ne_one_or_forall_eq_0

Mathlib/Topology/MetricSpace/Cauchy.lean

  • cauchySeq_of_le_tendsto_0'
  • cauchySeq_of_le_tendsto_0
  • cauchySeq_iff_le_tendsto_0

Mathlib/Topology/Instances/ENNReal.lean

  • tendsto_iff_edist_tendsto_0

Mathlib/Data/Set/Pointwise/Interval.lean

  • inv_Ioo_0_left

Mathlib/Analysis/Convex/Normed.lean

  • convexHull_exists_dist_ge2

Mathlib/Analysis/SpecialFunctions/Log/Deriv.lean

  • hasSum_pow_div_log_of_abs_lt_1
  • hasSum_log_sub_log_of_abs_lt_1

Mathlib/Analysis/SpecialFunctions/Exp.lean

  • tendsto_exp_neg_atTop_nhds_0
  • tendsto_exp_nhds_0_nhds_1
  • tendsto_pow_mul_exp_neg_atTop_nhds_0

Mathlib/LinearAlgebra/Eigenspace/Minpoly.lean

  • eigenspace_aeval_polynomial_degree_1

Mathlib/Analysis/SpecificLimits/Normed.lean

  • lots of them

Mathlib/Analysis/SpecificLimits/Basic.lean

  • also lots of them

Mathlib/Data/Complex/Exponential.lean

  • exp_1_approx_succ_eq

Mathlib/RingTheory/UniqueFactorizationDomain.lean

  • factors_0

Mathlib/AlgebraicTopology/ExtraDegeneracy.lean

  • shiftFun_0

@MichaelStollBayreuth
Copy link
Collaborator Author

@adri326 I'll leave cleaning up the remaining ones to somebody else. This PR was enough work for me 😄

@MichaelStollBayreuth
Copy link
Collaborator Author

Polynomial.C_0 and Polynomial.C_1 should probably also be renamed.

@semorrison
Copy link
Contributor

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Jan 31, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jan 31, 2024
…> _one (#10077)

See [here](https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/exact.3F.20failure/near/418443193) on Zulip.

This PR changes a bunch of names containing `nhds_0` or/and `lt_1` to `nhds_zero` or/and `lt_one`.
@mathlib-bors
Copy link

mathlib-bors bot commented Jan 31, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore(Analysis/SpecificLimits/* and others): rename _0 -> _zero, _1 -> _one [Merged by Bors] - chore(Analysis/SpecificLimits/* and others): rename _0 -> _zero, _1 -> _one Jan 31, 2024
@mathlib-bors mathlib-bors bot closed this Jan 31, 2024
@mathlib-bors mathlib-bors bot deleted the MS_SpecificLimits_01 branch January 31, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

5 participants