Skip to content

chore: add tag fun_prop to MeromorphicOn and AnalyticOnNhd - #42570

Open
kebekus wants to merge 7 commits into
leanprover-community:masterfrom
kebekus:kebekus/fun_prop.meromorphicOn
Open

chore: add tag fun_prop to MeromorphicOn and AnalyticOnNhd#42570
kebekus wants to merge 7 commits into
leanprover-community:masterfrom
kebekus:kebekus/fun_prop.meromorphicOn

Conversation

@kebekus

@kebekus kebekus commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

For improved proof automation, add tag fun_prop to MeromorphicOn and AnalyticOnNhd, provide transition lemmas, and golf existing call sites.


Open in Gitpod

kebekus and others added 7 commits August 8, 2026 10:36
`AnalyticAt` has been a registered `fun_prop` property for a while, but its
set-relative sibling `AnalyticOnNhd` was not, even though every lemma needed to
support it already existed. This registers the predicate and tags the lemmas
that `fun_prop` needs: the identity and constant lambda theorems, the
composition theorem, `Prod.mk`, and the arithmetic closure lemmas.

Follows the pattern already established for `ContinuousOn` and
`DifferentiableOn`: as for those, `AnalyticOnNhd` goals involving `inv`, `div`
or a composition need `fun_prop (disch := ...)` to discharge the non-vanishing
and `Set.MapsTo` side goals.

`AnalyticOnNhd.pi` is deliberately left untagged, mirroring `AnalyticAt.pi`:
its statement `fun x ↦ (f · x)` has the arguments in the opposite order to the
one `fun_prop` recognises as a pi theorem.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…um` signatures

`MeromorphicOn.logDeriv` took its hypothesis as `{hf : MeromorphicOn f U}`,
i.e. implicit, so it could never be inferred and the lemma was unusable. Make it
explicit, matching `Meromorphic.logDeriv`.

`MeromorphicOn.fun_sum` required `∀ σ, MeromorphicOn (f σ) U` where the
point-free `MeromorphicOn.sum` and the corresponding `MeromorphicAt.fun_sum`
both require only `∀ σ ∈ s, ...`. Weaken the hypothesis to match.

Neither lemma had any call site in Mathlib, so this breaks nothing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`MeromorphicAt.comp_analyticAt` states that the composition of a meromorphic
function with an analytic one is meromorphic, but there was no `On`-level
analogue. Add three:

* `MeromorphicOn.comp_analyticOnNhd`, with a `Set.MapsTo` hypothesis, modelled
  on `ContinuousOn.comp'` and `DifferentiableOn.fun_comp`;
* `MeromorphicOn.comp_analyticOnNhd_inter`, which trades that hypothesis for a
  smaller set, modelled on `ContinuousOn.comp_inter`;
* `Meromorphic.comp_analyticOnNhd`, for a globally meromorphic outer function,
  modelled on `Continuous.comp_continuousOn'`.

Note that the outer function must be the meromorphic one: the composition of an
analytic function with a meromorphic one need not be meromorphic, as
`fun z ↦ 1 / Complex.sin (π / z)` at `0` shows.

Also add the missing `Meromorphic.id`, so that the `Meromorphic` namespace has
both lambda theorems rather than just `Meromorphic.const`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`MeromorphicAt`, `Meromorphic` and `MeromorphicNFAt` have all been registered
`fun_prop` properties for a while; `MeromorphicOn` was the remaining gap, so
every `MeromorphicOn` goal had to be discharged by hand. Register the predicate
and tag the closure lemmas, which already existed and already carried `to_fun`.

Tagged:

* the `def` itself, plus the `id` and `const` lambda theorems;
* the arithmetic lemmas `add`, `sub`, `neg`, `smul`, `const_smul`, `mul`, `inv`,
  `div`, `pow`, `zpow` (switching `@[to_fun]` to `@[to_fun (attr := fun_prop)]`),
  the aggregates `sum`/`prod`/`finsum`/`finprod`, and `deriv`/`iterated_deriv`/
  `logDeriv`;
* the composition lemmas added in the previous commit;
* the transitions `Meromorphic.meromorphicOn` and `AnalyticOnNhd.meromorphicOn`,
  mirroring `Continuous.continuousOn` and `Differentiable.differentiableOn`. The
  latter is what makes analytic leaves reachable from a `MeromorphicOn` goal, so
  `fun_prop` now proves e.g. `MeromorphicOn (fun z ↦ (z ^ 2 - 1)⁻¹) U`.

Note that `MeromorphicOn.inv` and `.div` are unconditional, since `x⁻¹ = 0` for
`x = 0` makes the identically-zero case analytic. So, unlike `DifferentiableOn`,
meromorphic division needs no discharger.

Also tag the leaves `Meromorphic.Gamma`, `MeromorphicOn.Gamma` and
`meromorphic_digamma`: `fun_prop` previously could not prove anything at all
about `Γ` or `ψ`. `tan`/`tanh` already carried `Meromorphic` tags and are now
reachable for `MeromorphicOn` through the new transition.

`MeromorphicOn.mono_set` is deliberately left untagged: the larger set is not
determined by the goal, so unification cannot pick it. `ContinuousOn.continuousAt`
is untagged for the same reason.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…s, sinh, cosh

The `AnalyticAt` versions of these were already tagged `@[fun_prop]`, but the
`AnalyticOnNhd` versions were not, so `fun_prop` could not prove e.g.
`AnalyticOnNhd ℂ Complex.sin U`. With `AnalyticOnNhd` now a registered
`fun_prop` property this also makes these functions usable as leaves of a
`MeromorphicOn` goal, through the `AnalyticOnNhd.meromorphicOn` transition:
`fun_prop` now proves `MeromorphicOn (fun z ↦ Complex.exp z / (z ^ 2 - 1)) U`.

Tagging alone was not enough for `exp`: `analyticOnNhd_cexp` and
`analyticOnNhd_rexp` were stated only for `Set.univ`, so they could not match a
goal over an arbitrary set. Generalise both to an arbitrary set; the existing
call sites all still infer `univ`. The trigonometric and hyperbolic lemmas were
already stated for an arbitrary set.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`MathlibTest/FunProp.lean` had two `MeromorphicAt` tests and nothing for
`MeromorphicOn`, `Meromorphic` or the normal-form variants. Cover the newly
registered `MeromorphicOn` property: the lambda theorems, arithmetic from
hypotheses in context, `inv`/`div` needing no discharger, analytic leaves
reached through the `AnalyticOnNhd` transition, both composition routes,
`Finset.sum`, `logDeriv`, and `Γ`/`ψ`.

Also add a `#guard_msgs` test pinning down that `fun_prop` fails on
`MeromorphicOn (fun z ↦ Complex.exp (1 / z)) U`. This must keep failing: there
is no general composition rule for meromorphic functions, since the composite of
an analytic function with a meromorphic one need not be meromorphic.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replace hand-written closure bookkeeping with `fun_prop` now that
`MeromorphicOn` is a registered function property. The clearest case is in
`MeromorphicOn.circleIntegrable_log_norm`, where five lines of
`AnalyticOnNhd → MeromorphicOn` plumbing collapse to a single `fun_prop`.

For that one, `analyticOnNhd_circleMap` had to be generalised from `Set.univ`
to an arbitrary set and tagged, exactly as was done for `exp`; otherwise it
cannot match a goal stated over an interval.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

PR summary 8d7db6e33a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ comp_analyticOnNhd_inter
+ id
++ comp_analyticOnNhd

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 8d7db6e).

  • +8 new declarations
  • −0 removed declarations
+AnalyticOnNhd.fun_add
+AnalyticOnNhd.fun_comp
+AnalyticOnNhd.fun_neg
+AnalyticOnNhd.fun_sub
+Meromorphic.comp_analyticOnNhd
+Meromorphic.id
+MeromorphicOn.comp_analyticOnNhd
+MeromorphicOn.comp_analyticOnNhd_inter

No changes to strong technical debt.

No changes to weak technical debt.

Current commit 8d7db6e33a
Reference commit 87adeaebd3

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/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-measure-probability Measure theory / Probability theory label Aug 8, 2026
@kebekus
kebekus marked this pull request as ready for review August 8, 2026 10:17
@kebekus kebekus added t-analysis Analysis (normed *, calculus) and removed t-measure-probability Measure theory / Probability theory labels Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant