mathlib4 review helperopen PRs by @wwylele on leanprover-community/mathlib4

← queue

#39826 feat(Analysis): field of meromorphic functions

please-adopt merge-conflict t-topology draft CI success merge conflict

+954 −0 · 4 files · 1 commit · head 4caf289 · updated 56 days ago · Files changed on GitHub

In plain words

Defines MeromorphicFun, written : meromorphic functions modulo equality off a discrete set (the filter codiscreteWithin U). Each class has a canonical representative, the normal form toMeromorphicNFOn (used as the FunLike coercion), and a well-defined order orderAt x at accumulation points of . The quotient is an additive group and -module, a commutative -algebra when the target is a normed field , and a field when is nontrivial and preconnected (an instance for in a preconnected space). The derivative is a -linear map and a Derivation, with the product, power, inverse and quotient rules. Supporting lemmas go into NormalForm.lean (the value of the normal form at depends only on the germ on a punctured neighbourhood) and Order.lean (a meromorphic function on a preconnected set that is not a.e. zero has an inverse off a discrete set).

Notation for all sections: is a nontrivially normed field, are normed -spaces, is a nontrivially normed field that is a normed -algebra, , and is a normed ring acting boundedly on and commuting with . "" means equality on off a discrete set (=ᶠ[codiscreteWithin U]). " is good" means and is an accumulation point of .

Transcriptions are drafted with an LLM from the diff and are a reading aid, not a verified statement: the Lean code is the reference.

PR description

AI usage disclosure: used Aristotle to verify the correctness of a few lemma, but the proof have been rewritten


Things I have learned while experimenting with this

![Open in Gitpod](gitpod.io/from-referrer/)

Conversation on GitHub 7
github-actions[bot] · comment · 2026-05-25
PR summary 4caf28981c
Import changes for modified files

No significant changes to the import graph

<details><summary>Import changes for all files</summary>

|Files|Import difference| |-|-| | Mathlib.Analysis.Meromorphic.Field (new file)|1924|

</details>


<details><summary>

Declarations diff (regex)

</summary>

+ MeromorphicAt.exists_analytic_and_toMeromorphicNFAt_eventuallyEq + MeromorphicFun + MeromorphicFun.setoid + algebraMap_def + apply_eq + apply_eq_self + coeFn_add + coeFn_algebraMap + coeFn_comp + coeFn_comp₂ + coeFn_deriv + coeFn_div + coeFn_eq_self + coeFn_eq_toMeromorphicNFOn + coeFn_inv + coeFn_mk_eventuallyEq + coeFn_mul + coeFn_neg + coeFn_one + coeFn_pow + coeFn_smul + coeFn_sub + coeFn_zero + coeFn_zpow + comp + comp_mk + comp₂ + comp₂_mk + deriv + deriv_algebraMap + deriv_div + deriv_inv + deriv_mk + deriv_mul + deriv_natCast + deriv_one + deriv_pow + deriv_zpow + derivation + derivation_apply + div_zero + ext + field + ind + instance : Add (𝕜 →ℳ[U] E) + instance : AddCommGroup (𝕜 →ℳ[U] E) + instance : Algebra R (𝕜 →ℳ[U] 𝕜') + instance : CommRing (𝕜 →ℳ[U] 𝕜') + instance : Div (𝕜 →ℳ[U] 𝕜') + instance : DivInvOneMonoid (𝕜 →ℳ[U] 𝕜') + instance : FunLike (𝕜 →ℳ[U] E) 𝕜 E + instance : Inv (𝕜 →ℳ[U] 𝕜') + instance : Module R (𝕜 →ℳ[U] E) + instance : Mul (𝕜 →ℳ[U] 𝕜') + instance : NPow (𝕜 →ℳ[U] 𝕜') + instance : NSMul (𝕜 →ℳ[U] E) + instance : Neg (𝕜 →ℳ[U] E) + instance : SMul R (𝕜 →ℳ[U] E) + instance : Sub (𝕜 →ℳ[U] E) + instance : ZPow (𝕜 →ℳ[U] 𝕜') + instance : ZSMul (𝕜 →ℳ[U] E) + instance : Zero (𝕜 →ℳ[U] E) + instance [One E] : AddCommGroupWithOne (𝕜 →ℳ[U] E) + instance [PreconnectedSpace 𝕜] : Field (𝕜 →ℳ 𝕜') + inv_mk + inv_zero + lift + lift_mk + lift₂ + lift₂_mk + meromorphicNFOn_coeFn + meromorphicOn_coeFn + meromorphicOn_out + meromorphicOrderAt_eq_top_of_isPreconnected + meromorphic_coeFn + mk + mk_add_mk + mk_coeFn + mk_div_mk + mk_eq_mk + mk_mul_mk + mk_out + mk_pow + mk_sub_mk + mk_zpow + mul_inv_eventuallyEq + mul_inv_evnetuallyEq_of_meromorphicOrderAt_ne_top + natCast_eq + neg_mk + one_def + orderAt + orderAt_add + orderAt_add_eq_left_of_lt + orderAt_add_eq_right_of_lt + orderAt_add_of_ne + orderAt_deriv + orderAt_div + orderAt_eq_meromorphicOrder_coeFn + orderAt_eq_meromorphicOrder_coeFn_univ + orderAt_eq_zero_iff + orderAt_eq_zero_iff_univ + orderAt_inv + orderAt_mk + orderAt_mk_univ + orderAt_mul + orderAt_natCast + orderAt_neg + orderAt_nonneg_iff_analyticAt + orderAt_nonneg_iff_analyticAt_univ + orderAt_of_notMem + orderAt_of_not_accPt + orderAt_of_not_mem_and_accPt + orderAt_one + orderAt_pow + orderAt_zero + orderAt_zpow + out + out_mk_eventuallyEq + smul_mk + toMeromorphicNFAt_congr + toMeromorphicNFAt_of_meromorphicOrderAt_ne_zero + toNF + toNF_mk_eventuallyEq + zero_def <details> <summary>You can run this locally as follows</summary>

## 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>

</details>

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

</details>

<details><summary>

Declarations diff (Lean)

</summary>

✅ Lean-aware diff — post-build, computed from the Lean environment (commit 4caf289).

  • +130 new declarations
  • −0 removed declarations
+MeromorphicAt.exists_analytic_and_toMeromorphicNFAt_eventuallyEq
+MeromorphicFun
+MeromorphicFun.algebraMap_def
+MeromorphicFun.apply_eq
+MeromorphicFun.apply_eq_self
+MeromorphicFun.coeFn_add
+MeromorphicFun.coeFn_algebraMap
+MeromorphicFun.coeFn_comp
+MeromorphicFun.coeFn_comp₂
+MeromorphicFun.coeFn_deriv
+MeromorphicFun.coeFn_div
+MeromorphicFun.coeFn_eq_self
+MeromorphicFun.coeFn_eq_toMeromorphicNFOn
+MeromorphicFun.coeFn_inv
+MeromorphicFun.coeFn_mk_eventuallyEq
+MeromorphicFun.coeFn_mul
+MeromorphicFun.coeFn_neg
+MeromorphicFun.coeFn_one
+MeromorphicFun.coeFn_pow
+MeromorphicFun.coeFn_smul
+MeromorphicFun.coeFn_sub
+MeromorphicFun.coeFn_zero
+MeromorphicFun.coeFn_zpow
+MeromorphicFun.comp
+MeromorphicFun.comp_mk
+MeromorphicFun.comp₂
+MeromorphicFun.comp₂_mk
+MeromorphicFun.deriv
+MeromorphicFun.deriv.congr_simp
+MeromorphicFun.deriv_algebraMap
+MeromorphicFun.deriv_div
+MeromorphicFun.deriv_inv
+MeromorphicFun.deriv_mk
+MeromorphicFun.deriv_mul
+MeromorphicFun.deriv_natCast
+MeromorphicFun.deriv_one
+MeromorphicFun.deriv_pow
+MeromorphicFun.deriv_zpow
+MeromorphicFun.derivation
+MeromorphicFun.derivation.congr_simp
+MeromorphicFun.derivation_apply
+MeromorphicFun.div_zero
+MeromorphicFun.ext
+MeromorphicFun.ext_iff
+MeromorphicFun.field
+MeromorphicFun.ind
+MeromorphicFun.instAdd
+MeromorphicFun.instAddCommGroup
+MeromorphicFun.instAddCommGroupWithOneOfOne
+MeromorphicFun.instAlgebra
+MeromorphicFun.instCommRing
+MeromorphicFun.instDiv
+MeromorphicFun.instDivInvOneMonoid
+MeromorphicFun.instFieldUnivOfPreconnectedSpace
+MeromorphicFun.instFunLike
+MeromorphicFun.instInv
+MeromorphicFun.instModule
+MeromorphicFun.instMul
+MeromorphicFun.instNPow
+MeromorphicFun.instNSMul
+MeromorphicFun.instNeg
+MeromorphicFun.instSMul
+MeromorphicFun.instSub
+MeromorphicFun.instZPow
+MeromorphicFun.instZSMul
+MeromorphicFun.instZero
+MeromorphicFun.inv_mk
+MeromorphicFun.inv_zero
+MeromorphicFun.lift
+MeromorphicFun.lift.congr_simp
+MeromorphicFun.lift_mk
+MeromorphicFun.lift₂
+MeromorphicFun.lift₂_mk
+MeromorphicFun.meromorphicNFOn_coeFn
+MeromorphicFun.meromorphicOn_coeFn
+MeromorphicFun.meromorphicOn_out
+MeromorphicFun.meromorphic_coeFn
+MeromorphicFun.mk
+MeromorphicFun.mk.congr_simp
+MeromorphicFun.mk_add_mk
+MeromorphicFun.mk_coeFn
+MeromorphicFun.mk_div_mk
+MeromorphicFun.mk_eq_mk
+MeromorphicFun.mk_mul_mk
+MeromorphicFun.mk_out
+MeromorphicFun.mk_pow
+MeromorphicFun.mk_sub_mk
+MeromorphicFun.mk_zpow
+MeromorphicFun.natCast_eq
+MeromorphicFun.neg_mk
+MeromorphicFun.one_def
+MeromorphicFun.orderAt
+MeromorphicFun.orderAt_add
+MeromorphicFun.orderAt_add_eq_left_of_lt
+MeromorphicFun.orderAt_add_eq_right_of_lt
+MeromorphicFun.orderAt_add_of_ne
+MeromorphicFun.orderAt_deriv
+MeromorphicFun.orderAt_div
+MeromorphicFun.orderAt_eq_meromorphicOrder_coeFn
+MeromorphicFun.orderAt_eq_meromorphicOrder_coeFn_univ
+MeromorphicFun.orderAt_eq_zero_iff
+MeromorphicFun.orderAt_eq_zero_iff_univ
+MeromorphicFun.orderAt_inv
+MeromorphicFun.orderAt_mk
+MeromorphicFun.orderAt_mk_univ
+MeromorphicFun.orderAt_mul
+MeromorphicFun.orderAt_natCast
+MeromorphicFun.orderAt_neg
+MeromorphicFun.orderAt_nonneg_iff_analyticAt
+MeromorphicFun.orderAt_nonneg_iff_analyticAt_univ
+MeromorphicFun.orderAt_of_notMem
+MeromorphicFun.orderAt_of_not_accPt
+MeromorphicFun.orderAt_of_not_mem_and_accPt
+MeromorphicFun.orderAt_one
+MeromorphicFun.orderAt_pow
+MeromorphicFun.orderAt_zero
+MeromorphicFun.orderAt_zpow
+MeromorphicFun.out
+MeromorphicFun.out_mk_eventuallyEq
+MeromorphicFun.setoid
+MeromorphicFun.smul_mk
+MeromorphicFun.toNF
+MeromorphicFun.zero_def
+MeromorphicOn.meromorphicOrderAt_eq_top_of_isPreconnected
+MeromorphicOn.mul_inv_eventuallyEq
+mul_inv_evnetuallyEq_of_meromorphicOrderAt_ne_top
+toMeromorphicNFAt_congr
+toMeromorphicNFAt_of_meromorphicOrderAt_ne_zero
+«term_→ℳ[_]_»
+«term_→ℳ_»

</details>


No changes to strong technical debt.

<details><summary>Increase in weak tech debt: (relative, absolute) = (1.00, 0.00)</summary>

|Current number|Change|Type (weak)| |-:|:-:|:-| |5014|1|exposed public sections| </details>

Current commit 4caf28981c Reference commit 4851ebd9bf

This script lives in the undefined 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).
mathlib-merge-conflicts[bot] · comment · 2026-06-23

This pull request has conflicts, please merge master and resolve them.

CoolRmal · comment · 2026-07-11

To me it seems like that we should add APIs for MeromorphicWithinAt (similar to ContinuousWithinAt, DifferentiableWithinAt, ContDiffWithinAt, AnalyticWithinAt), and then use MeromorphicWithinAt to change the definition of MeromorphicOn.

wwylele · comment · 2026-07-17

To me it seems like that we should add APIs for MeromorphicWithinAt (similar to ContinuousWithinAt, DifferentiableWithinAt, ContDiffWithinAt, AnalyticWithinAt), and then use MeromorphicWithinAt to change the definition of MeromorphicOn.

Indeed. The question I have for this approach is whether it is worth it to duplicate API for another slightly different definition. Is there interesting math concerning functions meromorphic only on half of the neighborhood of a point? Or we would always want to extend such function to the full neighborhood, and the MeromorphicWithinAt property is never interesting?

mathlib-merge-conflicts[bot] · comment · 2026-07-22

This pull request has conflicts, please merge master and resolve them.

mathlib-dependent-issues[bot] · comment · 2026-08-18

This PR/issue depends on:

  • ~~leanprover-community/mathlib4#39828~~
  • ~~leanprover-community/mathlib4#39831~~
  • ~~leanprover-community/mathlib4#39833~~
  • ~~leanprover-community/mathlib4#39843~~
  • ~~leanprover-community/mathlib4#41092~~
  • ~~leanprover-community/mathlib4#41093~~

By Dependent Issues (🤖). Happy coding!

wwylele · comment · 2026-10-10

I marked this as please-adopt as I am unlikely to work on this in short term and I don't want to block anyone who might want to get this in

Mathlib.lean +1 −0

public import Mathlib.Analysis.Meromorphic.Basic
2114public import Mathlib.Analysis.Meromorphic.Complex
2115public import Mathlib.Analysis.Meromorphic.Divisor
2116public import Mathlib.Analysis.Meromorphic.FactorizedRational
2117public import Mathlib.Analysis.Meromorphic.Field
2118public import Mathlib.Analysis.Meromorphic.IsolatedZeros
2119public import Mathlib.Analysis.Meromorphic.NormalForm
2120public import Mathlib.Analysis.Meromorphic.Order

Mathlib/Analysis/Meromorphic/Field.lean +879 −0 new file

1/-
2Copyright (c) 2026 Weiyi Wang. All rights reserved.
3Released under Apache 2.0 license as described in the file LICENSE.
4Authors: Weiyi Wang
5-/
6
7module
8
9public import Mathlib.Analysis.Meromorphic.NormalForm
10public import Mathlib.RingTheory.Derivation.Basic
12/-!
13# The field of a meromorphic functions
15This file defines `MeromorphicFun`, the field of (equivalent classes of) functions `𝕜 → E`
16meromorphic on `U`, denoted as `𝕜 →ℳ[U] E` (or `𝕜 →ℳ E` when `U = Set.univ`).
17Meromorphic functions with pointwise equality is too large to be a field, so we construct the field
18on the quotient by `=ᶠ[codiscreteWithin U]` instead.
20A `MeromorphicFun` itself can also apply as a function, which acts as the normal form of the
21equivalent class: on accumulation points in `U`, this is exactly the `toMeromorphicNFOn f U` of any
22member `f` in the class. However, its value is not specified outside of `U` or at isolated points.
23-/
25@[expose] public section
27open Topology WithTop Filter
29variable
30 {𝕜 : Type*} [NontriviallyNormedField 𝕜]
31 {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
32 {E₂ : Type*} [NormedAddCommGroup E₂] [NormedSpace 𝕜 E₂]
33 {E₃ : Type*} [NormedAddCommGroup E₃] [NormedSpace 𝕜 E₃]
34 {𝕜' : Type*} [NontriviallyNormedField 𝕜'] [NormedAlgebra 𝕜 𝕜']
35 {f g : 𝕜 → E} {f₂ : 𝕜 → E₂} {U : Set 𝕜}
36 {R : Type*} [NormedRing R] [Module R E] [IsBoundedSMul R E] [SMulCommClass 𝕜 R E]
38variable (E U) in
def MeromorphicFun.setoid newL39–46
39/-- The equivalence of meromorphic functions `𝕜 → E` by `=ᶠ[codiscreteWithin U]`. -/
40def MeromorphicFun.setoid : Setoid {f : 𝕜 → E // MeromorphicOn f U} where
41 r := (·.val =ᶠ[codiscreteWithin U] ·.val)
42 iseqv := {
43 refl _ := rfl.eventuallyEq
44 symm h := h.symm
45 trans h₁ h₂ := h₁.trans h₂
46 }
48variable (E U) in
def MeromorphicFun newL49–53
49/-- Equivalence classes of meromorphic functions `𝕜 → E`, denoted as `𝕜 →ℳ[U] E` (or `𝕜 →ℳ E`
50when `U = Set.univ`). -/
51def MeromorphicFun := Quotient (MeromorphicFun.setoid E U)
53@[inherit_doc MeromorphicFun]
54notation:25 α " →ℳ[" U "] " β => MeromorphicFun β (U : Set α)
56@[inherit_doc MeromorphicFun]
57notation:25 α " →ℳ " β => MeromorphicFun β (Set.univ : Set α)
59namespace MeromorphicFun
def mk newL61–62
61/-- Get the `MeromophicFun` of a meromorphic function. -/
62def mk (f : 𝕜 → E) (hf : MeromorphicOn f U) : 𝕜 →ℳ[U] E := Quotient.mk _ ⟨f, hf⟩
def out newL64–66
64/-- Choose a representative function. This is only for intermediate definition. Use the
65`FunLike` coercion for a better representative that is `MeromorphicNFOn`. -/
66noncomputable def out (f : 𝕜 →ℳ[U] E) : 𝕜 → E := (Quotient.out f).val
theorem meromorphicOn_out newL68–68
68theorem meromorphicOn_out (f : 𝕜 →ℳ[U] E) : MeromorphicOn f.out U := (Quotient.out f).prop
theorem mk_out newL70–71
70@[simp]
71theorem mk_out (f : 𝕜 →ℳ[U] E) : mk f.out f.meromorphicOn_out = f := Quotient.out_eq f
theorem out_mk_eventuallyEq newL73–75
73theorem out_mk_eventuallyEq {f : 𝕜 → E} (hf : MeromorphicOn f U) :
74 (mk f hf).out =ᶠ[codiscreteWithin U] f :=
75 Quotient.mk_out ⟨f, hf⟩ (s := setoid E U)
theorem mk_eq_mk newL77–79
77@[simp]
78theorem mk_eq_mk (hf : MeromorphicOn f U) (hg : MeromorphicOn g U) :
79 mk f hf = mk g hg ↔ f =ᶠ[codiscreteWithin U] g := Quotient.eq
def lift newL81–86
81/-- Lift a function on meromorphic functions to `MeromophicFun` -/
82def lift {α : Type*} (F : {f : 𝕜 → E // MeromorphicOn f U} → α)
83 (h : ∀ f g : {f : 𝕜 → E // MeromorphicOn f U},
84 f.val =ᶠ[codiscreteWithin U] g.val → F f = F g) :
85 (𝕜 →ℳ[U] E) → α :=
86 Quotient.lift F h
theorem lift_mk newL88–93
88@[simp]
89theorem lift_mk {α : Type*} (F : {f : 𝕜 → E // MeromorphicOn f U} → α)
90 (h : ∀ f g : {f : 𝕜 → E // MeromorphicOn f U},
91 f.val =ᶠ[codiscreteWithin U] g.val → F f = F g) (hf : MeromorphicOn f U) :
92 lift F h (mk f hf) = F ⟨f, hf⟩ :=
93 rfl
def lift₂ newL95–101
95/-- Lift a binary function on meromorphic functions to `MeromophicFun`. -/
96def lift₂ {α : Type*} (F : {f : 𝕜 → E // MeromorphicOn f U} → {f : 𝕜 → E₂ // MeromorphicOn f U} → α)
97 (h : ∀ f₁ g₁ f₂ g₂,
98 f₁.val =ᶠ[codiscreteWithin U] f₂.val → g₁.val =ᶠ[codiscreteWithin U] g₂.val →
99 F f₁ g₁ = F f₂ g₂) :
100 (𝕜 →ℳ[U] E) → (𝕜 →ℳ[U] E₂) → α :=
101 Quotient.lift₂ F h
theorem lift₂_mk newL103–110
103@[simp]
104theorem lift₂_mk {α : Type*}
105 (F : {f : 𝕜 → E // MeromorphicOn f U} → {f : 𝕜 → E₂ // MeromorphicOn f U} → α)
106 (h : ∀ f₁ g₁ f₂ g₂,
107 f₁.val =ᶠ[codiscreteWithin U] f₂.val → g₁.val =ᶠ[codiscreteWithin U] g₂.val →
108 F f₁ g₁ = F f₂ g₂) (hf : MeromorphicOn f U) (hf₂ : MeromorphicOn f₂ U) :
109 lift₂ F h (mk f hf) (mk f₂ hf₂) = F ⟨f, hf⟩ ⟨f₂, hf₂⟩ :=
110 rfl
theorem ind newL112–115
112/-- The induction principal for `MeromophicFun`. -/
113@[elab_as_elim, induction_eliminator, cases_eliminator]
114theorem ind {motive : (𝕜 →ℳ[U] E) → Prop} (mk : ∀ f hf, motive (mk f hf)) :
115 ∀ f, motive f := Quotient.ind (fun f ↦ mk f.val f.prop)
117/-! ## Normal form -/
119/-- Choose a `MeromorphicNFOn` representative function. Do not use this directly. Use the coercion
120from `FunLike` instead. -/
121noncomputable
def toNF newL122–122
122def toNF (f : 𝕜 →ℳ[U] E) : 𝕜 → E := toMeromorphicNFOn f.out U
theorem toNF_mk_eventuallyEq newL124–133
124private theorem toNF_mk_eventuallyEq (hf : MeromorphicOn f U) :
125 (mk f hf).toNF =ᶠ[codiscreteWithin U] f := by
126 simpa [toNF] using (toMeromorphicNFOn_eqOn_codiscrete (mk f hf).meromorphicOn_out).symm.trans <|
127 out_mk_eventuallyEq hf
129/-- We create a `FunLike` instance for `MeromorphicFun` so it can be directly used as a
130function. This function is `MeromorphicNFOn`, and its value is canonically defined to equal to
131`toMeromorphicNFOn` of any member in the equivalence class for all accumulation points in `U`.
132See `MeromorphicFun.apply_eq` and `MeromorphicFun.coe_eq_toMeromorphicNFOn` that characterizes this.
133-/
134noncomputable
instance (anonymous instance) newL135–143
135instance : FunLike (𝕜 →ℳ[U] E) 𝕜 E where
136 coe := toNF
137 coe_injective f g h := by
138 cases f with | mk f hf
139 cases g with | mk g hg
140 rw [mk_eq_mk]
141 apply (toNF_mk_eventuallyEq hf).symm.trans
142 rw [h]
143 exact (toNF_mk_eventuallyEq hg)
theorem meromorphicNFOn_coeFn newL145–146
145theorem meromorphicNFOn_coeFn (f : 𝕜 →ℳ[U] E) : MeromorphicNFOn f U :=
146 meromorphicNFOn_toMeromorphicNFOn f.out U
theorem meromorphicOn_coeFn newL148–149
148theorem meromorphicOn_coeFn (f : 𝕜 →ℳ[U] E) : MeromorphicOn f U :=
149 f.meromorphicNFOn_coeFn.meromorphicOn
theorem meromorphic_coeFn newL151–153
151@[fun_prop]
152theorem meromorphic_coeFn (f : 𝕜 →ℳ E) : Meromorphic f := by
153 simpa using f.meromorphicOn_coeFn
theorem coeFn_mk_eventuallyEq newL155–156
155theorem coeFn_mk_eventuallyEq (hf : MeromorphicOn f U) : mk f hf =ᶠ[codiscreteWithin U] f :=
156 toNF_mk_eventuallyEq hf
theorem ext newL158–163
158@[ext]
159theorem ext {f g : 𝕜 →ℳ[U] E} (h : f =ᶠ[codiscreteWithin U] g) : f = g := by
160 cases f with | mk f hf
161 cases g with | mk g hg
162 grw [mk_eq_mk, ← coeFn_mk_eventuallyEq hf, ← coeFn_mk_eventuallyEq hg]
163 exact h
theorem mk_coeFn newL165–168
165@[simp]
166theorem mk_coeFn (f : 𝕜 →ℳ[U] E) : mk f f.meromorphicOn_coeFn = f := by
167 cases f with | mk f hf
168 simpa using coeFn_mk_eventuallyEq hf
theorem apply_eq newL170–179
170theorem apply_eq (hf : MeromorphicOn f U) {x : 𝕜} (hx : x ∈ U) (hacc : AccPt x (𝓟 U)) :
171 mk f hf x = toMeromorphicNFOn f U x := by
172 let g := (mk f hf).out
173 have hg : MeromorphicOn g U := (mk f hf).meromorphicOn_out
174 change toMeromorphicNFOn g U x = toMeromorphicNFOn f U x
175 rw [toMeromorphicNFOn_eq_toMeromorphicNFAt hg hx]
176 rw [toMeromorphicNFOn_eq_toMeromorphicNFAt hf hx]
177 apply toMeromorphicNFAt_congr
178 exact MeromorphicAt.eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin
179 (hg x hx) (hf x hx) hx hacc (out_mk_eventuallyEq hf)
theorem apply_eq_self newL181–185
181theorem apply_eq_self (hf : MeromorphicOn f U) {x : 𝕜} (hx : x ∈ U)
182 (h : MeromorphicNFAt f x) (hacc : AccPt x (𝓟 U)) :
183 mk f hf x = f x := by
184 rw [apply_eq hf hx hacc, toMeromorphicNFOn_eq_toMeromorphicNFAt hf hx,
185 toMeromorphicNFAt_eq_self.mpr h]
theorem coeFn_eq_toMeromorphicNFOn newL187–189
187theorem coeFn_eq_toMeromorphicNFOn (hf : MeromorphicOn f Set.univ) :
188 mk f hf = toMeromorphicNFOn f Set.univ :=
189 funext <| fun x ↦ apply_eq hf (Set.mem_univ x) <| PerfectSpace.univ_preperfect x (Set.mem_univ x)
theorem coeFn_eq_self newL191–193
191theorem coeFn_eq_self (hf : MeromorphicNFOn f Set.univ) : mk f hf.meromorphicOn = f :=
192 funext <| fun x ↦ apply_eq_self hf.meromorphicOn (Set.mem_univ x) (hf (Set.mem_univ x))
193 <| PerfectSpace.univ_preperfect x (Set.mem_univ x)
195/-! ## Composition with meromorphic-preserving functions -/
def comp newL197–201
197/-- Composition with a unary operator. -/
198def comp (o : E → E₂) (h : ∀ f, MeromorphicOn f U → MeromorphicOn (o ∘ f) U) (f : 𝕜 →ℳ[U] E) :
199 𝕜 →ℳ[U] E₂ :=
200 lift (fun f ↦ mk (o ∘ f.val) (h f.val f.prop))
201 (fun f g h ↦ by simpa using EventuallyEq.fun_comp h o) f
theorem comp_mk newL203–207
203@[simp]
204theorem comp_mk (o : E → E₂) (h : ∀ f, MeromorphicOn f U → MeromorphicOn (o ∘ f) U)
205 (hf : MeromorphicOn f U) :
206 (mk f hf).comp o h = mk (o ∘ f) (h f hf) :=
207 rfl
theorem coeFn_comp newL209–215
209theorem coeFn_comp (o : E → E₂) (h : ∀ f, MeromorphicOn f U → MeromorphicOn (o ∘ f) U)
210 (f : 𝕜 →ℳ[U] E) :
211 ⇑(f.comp o h) =ᶠ[codiscreteWithin U] o ∘ f := by
212 cases f with | mk f hf
213 rw [comp_mk]
214 apply (coeFn_mk_eventuallyEq _).trans
215 exact EventuallyEq.fun_comp (coeFn_mk_eventuallyEq hf).symm _
def comp₂ newL217–223
217/-- Composition with a binary operator. -/
218def comp₂ (o : E → E₂ → E₃)
219 (h : ∀ f g, MeromorphicOn f U → MeromorphicOn g U → MeromorphicOn (fun x ↦ o (f x) (g x)) U)
220 (f : 𝕜 →ℳ[U] E) (g : 𝕜 →ℳ[U] E₂) :
221 𝕜 →ℳ[U] E₃ :=
222 lift₂ (fun f g ↦ mk (fun x ↦ o (f.val x) (g.val x)) (h f.val g.val f.prop g.prop))
223 (fun f₁ g₁ f₂ g₂ hf hg ↦ by simpa using Filter.EventuallyEq.comp₂ hf o hg) f g
theorem comp₂_mk newL225–229
225theorem comp₂_mk (o : E → E₂ → E₃)
226 (h : ∀ f g, MeromorphicOn f U → MeromorphicOn g U → MeromorphicOn (fun x ↦ o (f x) (g x)) U)
227 (hf : MeromorphicOn f U) (hf₂ : MeromorphicOn f₂ U) :
228 (mk f hf).comp₂ o h (mk f₂ hf₂) = mk (fun x ↦ o (f x) (f₂ x)) (h f f₂ hf hf₂) :=
229 rfl
theorem coeFn_comp₂ newL231–239
231theorem coeFn_comp₂ (o : E → E₂ → E₃)
232 (h : ∀ f g, MeromorphicOn f U → MeromorphicOn g U → MeromorphicOn (fun x ↦ o (f x) (g x)) U)
233 (f : 𝕜 →ℳ[U] E) (g : 𝕜 →ℳ[U] E₂) :
234 ⇑(f.comp₂ o h g) =ᶠ[codiscreteWithin U] fun x ↦ o (f x) (g x):= by
235 cases f with | mk f hf
236 cases g with | mk g hg
237 rw [comp₂_mk]
238 apply (coeFn_mk_eventuallyEq _).trans
239 exact EventuallyEq.comp₂ (coeFn_mk_eventuallyEq hf).symm _ (coeFn_mk_eventuallyEq hg).symm
241/-! ## Order -/
243open Classical in
244/-- The meromorphic order at a point `x` for `MeromorphicFun E U`. If the point is outside of `U`,
245or it is not `AccPt x (𝓟 U)`, we return the junk value 0. -/
246noncomputable
def orderAt newL247–253
247def orderAt (f : 𝕜 →ℳ[U] E) (x : 𝕜) : WithTop ℤ :=
248 if hx : x ∈ U ∧ AccPt x (𝓟 U) then
249 lift (fun f ↦ meromorphicOrderAt f.val x) (fun f g h ↦ meromorphicOrderAt_congr <|
250 (f.prop x hx.1).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin (g.prop x hx.1)
251 hx.1 hx.2 h) f
252 else
253 0
theorem orderAt_of_notMem newL255–256
255theorem orderAt_of_notMem (f : 𝕜 →ℳ[U] E) {x : 𝕜} (hx : x ∉ U) : f.orderAt x = 0 := by
256 simp [orderAt, hx]
theorem orderAt_of_not_accPt newL258–259
258theorem orderAt_of_not_accPt (f : 𝕜 →ℳ[U] E) {x : 𝕜} (hx : ¬ AccPt x (𝓟 U)) : f.orderAt x = 0 := by
259 simp [orderAt, hx]
theorem orderAt_of_not_mem_and_accPt newL261–263
261theorem orderAt_of_not_mem_and_accPt (f : 𝕜 →ℳ[U] E) {x : 𝕜} (hx : ¬ (x ∈ U ∧ AccPt x (𝓟 U))) :
262 f.orderAt x = 0 := by
263 simp [orderAt, hx]
theorem orderAt_mk newL265–267
265theorem orderAt_mk (hf : MeromorphicOn f U) {x : 𝕜} (hx : x ∈ U) (hacc : AccPt x (𝓟 U)) :
266 (mk f hf).orderAt x = meromorphicOrderAt f x := by
267 simp [orderAt, hx, hacc]
theorem orderAt_mk_univ newL269–273
269@[simp]
270theorem orderAt_mk_univ (hf : MeromorphicOn f Set.univ) :
271 (mk f hf).orderAt = meromorphicOrderAt f := by
272 ext x
273 rw [orderAt_mk hf (Set.mem_univ x) (PerfectSpace.univ_preperfect x (Set.mem_univ x))]
theorem orderAt_eq_meromorphicOrder_coeFn newL275–282
275theorem orderAt_eq_meromorphicOrder_coeFn (f : 𝕜 →ℳ[U] E) {x : 𝕜} (hx : x ∈ U)
276 (hacc : AccPt x (𝓟 U)) :
277 f.orderAt x = meromorphicOrderAt f x := by
278 cases f with | mk f hf
279 rw [orderAt_mk hf hx hacc]
280 exact meromorphicOrderAt_congr <|
281 (hf x hx).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin (meromorphicOn_coeFn _ x hx)
282 hx hacc (coeFn_mk_eventuallyEq hf).symm
theorem orderAt_eq_meromorphicOrder_coeFn_univ newL284–287
284theorem orderAt_eq_meromorphicOrder_coeFn_univ (f : 𝕜 →ℳ E) : f.orderAt = meromorphicOrderAt f := by
285 ext x
286 rw [f.orderAt_eq_meromorphicOrder_coeFn (Set.mem_univ x)
287 (PerfectSpace.univ_preperfect x (Set.mem_univ x))]
theorem orderAt_eq_zero_iff newL289–292
289theorem orderAt_eq_zero_iff {f : 𝕜 →ℳ[U] E} {x : 𝕜} (hx : x ∈ U) (hacc : AccPt x (𝓟 U)) :
290 f.orderAt x = 0 ↔ f x ≠ 0 := by
291 rw [f.orderAt_eq_meromorphicOrder_coeFn hx hacc,
292 (f.meromorphicNFOn_coeFn hx).meromorphicOrderAt_eq_zero_iff]
theorem orderAt_eq_zero_iff_univ newL294–295
294theorem orderAt_eq_zero_iff_univ {f : 𝕜 →ℳ E} {x : 𝕜} : f.orderAt x = 0 ↔ f x ≠ 0 :=
295 f.orderAt_eq_zero_iff (Set.mem_univ x) (PerfectSpace.univ_preperfect x (Set.mem_univ x))
theorem orderAt_nonneg_iff_analyticAt newL297–300
297theorem orderAt_nonneg_iff_analyticAt {f : 𝕜 →ℳ[U] E} {x : 𝕜} (hx : x ∈ U) (hacc : AccPt x (𝓟 U)) :
298 0 ≤ f.orderAt x ↔ AnalyticAt 𝕜 f x := by
299 rw [f.orderAt_eq_meromorphicOrder_coeFn hx hacc,
300 (f.meromorphicNFOn_coeFn hx).meromorphicOrderAt_nonneg_iff_analyticAt]
theorem orderAt_nonneg_iff_analyticAt_univ newL302–304
302theorem orderAt_nonneg_iff_analyticAt_univ {f : 𝕜 →ℳ E} {x : 𝕜} :
303 0 ≤ f.orderAt x ↔ AnalyticAt 𝕜 f x :=
304 f.orderAt_nonneg_iff_analyticAt (Set.mem_univ x) (PerfectSpace.univ_preperfect x (Set.mem_univ x))
306/-! ## Add -/
instance (anonymous instance) newL308–309
308instance : Add (𝕜 →ℳ[U] E) where
309 add := comp₂ Add.add fun _ _ hf hg ↦ hf.add hg
theorem mk_add_mk newL311–313
311theorem mk_add_mk (hf : MeromorphicOn f U) (hg : MeromorphicOn g U) :
312 mk f hf + mk g hg = mk (f + g) (hf.add hg) :=
313 rfl
theorem coeFn_add newL315–316
315theorem coeFn_add (f g : 𝕜 →ℳ[U] E) : ⇑(f + g) =ᶠ[codiscreteWithin U] f + g :=
316 coeFn_comp₂ _ _ f g
theorem orderAt_add newL318–327
318theorem orderAt_add (f g : 𝕜 →ℳ[U] E) (x : 𝕜) :
319 min (f.orderAt x) (g.orderAt x) ≤ (f + g).orderAt x := by
320 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
321 · simp_rw [orderAt_eq_meromorphicOrder_coeFn _ hx.1 hx.2]
322 convert meromorphicOrderAt_add (f.meromorphicOn_coeFn x hx.1) (g.meromorphicOn_coeFn x hx.1)
323 using 1
324 apply meromorphicOrderAt_congr
325 exact ((f + g).meromorphicOn_coeFn x hx.1).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin
326 ((f.meromorphicOn_coeFn x hx.1).add (g.meromorphicOn_coeFn x hx.1)) hx.1 hx.2 (f.coeFn_add g)
327 · simp [orderAt_of_not_mem_and_accPt _ hx]
theorem orderAt_add_eq_left_of_lt newL329–338
329theorem orderAt_add_eq_left_of_lt {f g : 𝕜 →ℳ[U] E} {x : 𝕜} (h : f.orderAt x < g.orderAt x) :
330 (f + g).orderAt x = f.orderAt x := by
331 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
332 · simp_rw [orderAt_eq_meromorphicOrder_coeFn _ hx.1 hx.2] at ⊢ h
333 convert meromorphicOrderAt_add_eq_left_of_lt (g.meromorphicOn_coeFn x hx.1) h
334 using 1
335 apply meromorphicOrderAt_congr
336 exact ((f + g).meromorphicOn_coeFn x hx.1).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin
337 ((f.meromorphicOn_coeFn x hx.1).add (g.meromorphicOn_coeFn x hx.1)) hx.1 hx.2 (f.coeFn_add g)
338 · simp [orderAt_of_not_mem_and_accPt _ hx]
theorem orderAt_add_eq_right_of_lt newL340–349
340theorem orderAt_add_eq_right_of_lt {f g : 𝕜 →ℳ[U] E} {x : 𝕜} (h : g.orderAt x < f.orderAt x) :
341 (f + g).orderAt x = g.orderAt x := by
342 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
343 · simp_rw [orderAt_eq_meromorphicOrder_coeFn _ hx.1 hx.2] at ⊢ h
344 convert meromorphicOrderAt_add_eq_right_of_lt (f.meromorphicOn_coeFn x hx.1) h
345 using 1
346 apply meromorphicOrderAt_congr
347 exact ((f + g).meromorphicOn_coeFn x hx.1).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin
348 ((f.meromorphicOn_coeFn x hx.1).add (g.meromorphicOn_coeFn x hx.1)) hx.1 hx.2 (f.coeFn_add g)
349 · simp [orderAt_of_not_mem_and_accPt _ hx]
theorem orderAt_add_of_ne newL351–360
351theorem orderAt_add_of_ne {f g : 𝕜 →ℳ[U] E} {x : 𝕜} (h : f.orderAt x ≠ g.orderAt x) :
352 (f + g).orderAt x = min (f.orderAt x) (g.orderAt x) := by
353 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
354 · simp_rw [orderAt_eq_meromorphicOrder_coeFn _ hx.1 hx.2] at ⊢ h
355 convert meromorphicOrderAt_add_of_ne (f.meromorphicOn_coeFn x hx.1)
356 (g.meromorphicOn_coeFn x hx.1) h using 1
357 apply meromorphicOrderAt_congr
358 exact ((f + g).meromorphicOn_coeFn x hx.1).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin
359 ((f.meromorphicOn_coeFn x hx.1).add (g.meromorphicOn_coeFn x hx.1)) hx.1 hx.2 (f.coeFn_add g)
360 · simp [orderAt_of_not_mem_and_accPt _ hx]
instance (anonymous instance) newL362–363
362instance : Zero (𝕜 →ℳ[U] E) where
363 zero := mk 0 (.const 0)
theorem zero_def newL365–365
365theorem zero_def : (0 : 𝕜 →ℳ[U] E) = mk 0 (.const 0) := rfl
theorem coeFn_zero newL367–368
367theorem coeFn_zero : ⇑(0 : 𝕜 →ℳ[U] E) =ᶠ[codiscreteWithin U] 0 :=
368 coeFn_mk_eventuallyEq _
theorem orderAt_zero newL370–372
370theorem orderAt_zero {x : 𝕜} (hx : x ∈ U) (hacc : AccPt x (𝓟 U)) :
371 (0 : 𝕜 →ℳ[U] E).orderAt x = ⊤ := by
372 simp [zero_def, orderAt_mk _ hx hacc, meromorphicOrderAt_eq_top_iff]
374/-! ## Neg / Sub -/
instance (anonymous instance) newL376–377
376instance : Neg (𝕜 →ℳ[U] E) where
377 neg := comp Neg.neg fun _ h ↦ h.neg
theorem neg_mk newL379–380
379theorem neg_mk (hf : MeromorphicOn f U) : -mk f hf = mk (-f) hf.neg :=
380 rfl
theorem coeFn_neg newL382–383
382theorem coeFn_neg (f : 𝕜 →ℳ[U] E) : ⇑(-f) =ᶠ[codiscreteWithin U] -f:=
383 coeFn_comp _ _ f
theorem orderAt_neg newL385–393
385@[simp]
386theorem orderAt_neg (f : 𝕜 →ℳ[U] E) (x : 𝕜) : (-f).orderAt x = f.orderAt x := by
387 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
388 · simp_rw [orderAt_eq_meromorphicOrder_coeFn _ hx.1 hx.2]
389 refine Eq.trans ?_ meromorphicOrderAt_neg.symm
390 apply meromorphicOrderAt_congr
391 exact ((-f).meromorphicOn_coeFn x hx.1).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin
392 (f.meromorphicOn_coeFn x hx.1).neg hx.1 hx.2 f.coeFn_neg
393 · simp [orderAt_of_not_mem_and_accPt _ hx]
instance (anonymous instance) newL395–396
395instance : Sub (𝕜 →ℳ[U] E) where
396 sub := comp₂ Sub.sub fun _ _ hf hg ↦ hf.sub hg
theorem mk_sub_mk newL398–400
398theorem mk_sub_mk (hf : MeromorphicOn f U) (hg : MeromorphicOn g U) :
399 mk f hf - mk g hg = mk (f - g) (hf.sub hg) :=
400 rfl
theorem coeFn_sub newL402–403
402theorem coeFn_sub (f g : 𝕜 →ℳ[U] E) : ⇑(f - g) =ᶠ[codiscreteWithin U] f - g :=
403 coeFn_comp₂ _ _ f g
instance (anonymous instance) newL405–406
405instance : NSMul (𝕜 →ℳ[U] E) where
406 nsmul := nsmulRec
instance (anonymous instance) newL408–409
408instance : ZSMul (𝕜 →ℳ[U] E) where
409 zsmul := zsmulRec
instance (anonymous instance) newL411–433
411instance : AddCommGroup (𝕜 →ℳ[U] E) where
412 zero_add f := by
413 cases f with | mk f hf
414 simp [zero_def, mk_add_mk]
415 add_zero f := by
416 cases f with | mk f hf
417 simp [zero_def, mk_add_mk]
418 add_assoc f g h := by
419 cases f with | mk f hf
420 cases g with | mk g hg
421 cases h with | mk h hh
422 simp [mk_add_mk, add_assoc]
423 add_comm f g := by
424 cases f with | mk f hf
425 cases g with | mk g hg
426 simp [mk_add_mk, add_comm]
427 sub_eq_add_neg f g := by
428 cases f with | mk f hf
429 cases g with | mk g hg
430 simp [mk_sub_mk, neg_mk, mk_add_mk, sub_eq_add_neg]
431 neg_add_cancel f := by
432 cases f with | mk f hf
433 simp [neg_mk, mk_add_mk, zero_def]
435/-! ## SMul -/
instance (anonymous instance) newL437–438
437instance : SMul R (𝕜 →ℳ[U] E) where
438 smul c := comp (c • ·) fun _ h ↦ h.const_smul c
theorem smul_mk newL440–441
440theorem smul_mk (hf : MeromorphicOn f U) (c : R) : c • mk f hf = mk (c • f) (hf.const_smul c) :=
441 rfl
theorem coeFn_smul newL443–444
443theorem coeFn_smul (f : 𝕜 →ℳ[U] E) (c : R) : ⇑(c • f) =ᶠ[codiscreteWithin U] c • f:=
444 coeFn_comp _ _ f
instance (anonymous instance) newL446–464
446instance : Module R (𝕜 →ℳ[U] E) where
447 mul_smul c d f := by
448 cases f with | mk f hf
449 simp [smul_mk, mul_smul]
450 one_smul f := by
451 cases f with | mk f hf
452 simp [smul_mk]
453 smul_zero c := by
454 simp [zero_def, smul_mk]
455 zero_smul f := by
456 cases f with | mk f hf
457 simp [smul_mk, zero_def]
458 smul_add c f g := by
459 cases f with | mk f hf
460 cases g with | mk g hg
461 simp [mk_add_mk, smul_mk]
462 add_smul c d f := by
463 cases f with | mk f hf
464 simp [smul_mk, add_smul, mk_add_mk]
466/-! ## One -/
instance (anonymous instance) newL468–469
468instance [One E] : AddCommGroupWithOne (𝕜 →ℳ[U] E) where
469 one := mk 1 (.const 1)
theorem one_def newL471–471
471theorem one_def [One E] : (1 : 𝕜 →ℳ[U] E) = mk 1 (.const 1) := rfl
theorem coeFn_one newL473–474
473theorem coeFn_one [One E] : ⇑(1 : 𝕜 →ℳ[U] E) =ᶠ[codiscreteWithin U] 1 :=
474 coeFn_mk_eventuallyEq _
theorem orderAt_one newL476–481
476@[simp]
477theorem orderAt_one [One E] [NeZero (1 : E)] (x : 𝕜) : (1 : 𝕜 →ℳ[U] E).orderAt x = 0 := by
478 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
479 · classical
480 simp [one_def, orderAt_mk _ hx.1 hx.2, Pi.one_def, meromorphicOrderAt_const]
481 · simp [orderAt_of_not_mem_and_accPt _ hx]
theorem natCast_eq newL483–488
483theorem natCast_eq (n : ℕ) : (n : 𝕜 →ℳ[U] 𝕜') = mk (n : 𝕜 → 𝕜') (.const (n : 𝕜')) := by
484 induction n with
485 | zero =>
486 simp [zero_def, Pi.zero_def]
487 | succ n ih =>
488 simp only [Nat.cast_add, ih, Nat.cast_one, one_def, mk_add_mk]
theorem orderAt_natCast newL490–495
490@[simp]
491theorem orderAt_natCast {n : ℕ} (hn : (n : 𝕜') ≠ 0) (x : 𝕜) : (n : 𝕜 →ℳ[U] 𝕜').orderAt x = 0 := by
492 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
493 · classical
494 simpa [natCast_eq, orderAt_mk _ hx.1 hx.2, Pi.natCast_def, meromorphicOrderAt_const,] using hn
495 · simp [orderAt_of_not_mem_and_accPt _ hx]
497/-! ## Mul -/
instance (anonymous instance) newL499–500
499instance : Mul (𝕜 →ℳ[U] 𝕜') where
500 mul := comp₂ Mul.mul fun _ _ hf hg ↦ hf.mul hg
theorem mk_mul_mk newL502–504
502theorem mk_mul_mk {f : 𝕜 → 𝕜'} (hf : MeromorphicOn f U) {g : 𝕜 → 𝕜'} (hg : MeromorphicOn g U) :
503 mk f hf * mk g hg = mk (f * g) (hf.mul hg) :=
504 rfl
theorem coeFn_mul newL506–507
506theorem coeFn_mul (f g : 𝕜 →ℳ[U] 𝕜') : ⇑(f * g) =ᶠ[codiscreteWithin U] f * g :=
507 coeFn_comp₂ _ _ f g
theorem orderAt_mul newL509–517
509theorem orderAt_mul (f g : 𝕜 →ℳ[U] 𝕜') (x : 𝕜) : (f * g).orderAt x = f.orderAt x + g.orderAt x := by
510 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
511 · simp_rw [orderAt_eq_meromorphicOrder_coeFn _ hx.1 hx.2]
512 refine Eq.trans ?_ <|
513 meromorphicOrderAt_mul (f.meromorphicOn_coeFn x hx.1) (g.meromorphicOn_coeFn x hx.1)
514 apply meromorphicOrderAt_congr
515 exact ((f * g).meromorphicOn_coeFn x hx.1).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin
516 ((f.meromorphicOn_coeFn x hx.1).mul (g.meromorphicOn_coeFn x hx.1)) hx.1 hx.2 (f.coeFn_mul g)
517 · simp [orderAt_of_not_mem_and_accPt _ hx]
instance (anonymous instance) newL519–520
519instance : NPow (𝕜 →ℳ[U] 𝕜') where
520 npow n := comp (· ^ n) fun _ h ↦ h.pow n
theorem mk_pow newL522–524
522theorem mk_pow {f : 𝕜 → 𝕜'} (hf : MeromorphicOn f U) (n : ℕ) :
523 mk f hf ^ n = mk (f ^ n) (hf.pow n) :=
524 rfl
theorem coeFn_pow newL526–527
526theorem coeFn_pow (f : 𝕜 →ℳ[U] 𝕜') (n : ℕ) : ⇑(f ^ n) =ᶠ[codiscreteWithin U] f ^ n :=
527 coeFn_comp _ _ f
theorem orderAt_pow newL529–536
529theorem orderAt_pow (f : 𝕜 →ℳ[U] 𝕜') (n : ℕ) (x : 𝕜) : (f ^ n).orderAt x = n * f.orderAt x := by
530 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
531 · simp_rw [orderAt_eq_meromorphicOrder_coeFn _ hx.1 hx.2]
532 refine Eq.trans ?_ <| meromorphicOrderAt_pow (f.meromorphicOn_coeFn x hx.1)
533 apply meromorphicOrderAt_congr
534 exact ((f ^ n).meromorphicOn_coeFn x hx.1).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin
535 ((f.meromorphicOn_coeFn x hx.1).pow n) hx.1 hx.2 (f.coeFn_pow n)
536 · simp [orderAt_of_not_mem_and_accPt _ hx]
instance (anonymous instance) newL538–575
538instance : CommRing (𝕜 →ℳ[U] 𝕜') where
539 one_mul f := by
540 cases f with | mk f hf
541 simp [one_def, mk_mul_mk]
542 mul_one f := by
543 cases f with | mk f hf
544 simp [one_def, mk_mul_mk]
545 zero_mul f := by
546 cases f with | mk f hf
547 simp [zero_def, mk_mul_mk]
548 mul_zero f := by
549 cases f with | mk f hf
550 simp [zero_def, mk_mul_mk]
551 mul_assoc f g h := by
552 cases f with | mk f hf
553 cases g with | mk g hg
554 cases h with | mk h hh
555 simp [mk_mul_mk, mul_assoc]
556 left_distrib f g h := by
557 cases f with | mk f hf
558 cases g with | mk g hg
559 cases h with | mk h hh
560 simp [mk_mul_mk, mk_add_mk, mul_add]
561 right_distrib f g h := by
562 cases f with | mk f hf
563 cases g with | mk g hg
564 cases h with | mk h hh
565 simp [mk_mul_mk, mk_add_mk, add_mul]
566 mul_comm f g := by
567 cases f with | mk f hf
568 cases g with | mk g hg
569 simp [mk_mul_mk, mul_comm]
570 npow_zero f := by
571 cases f with | mk f hf
572 simp [one_def, mk_pow]
573 npow_succ n f := by
574 cases f with | mk f hf
575 simp [pow_succ, mk_mul_mk, mk_pow]
577variable {R : Type*} [NormedCommRing R] [Algebra R 𝕜'] [IsBoundedSMul R 𝕜'] [SMulCommClass 𝕜 R 𝕜']
instance (anonymous instance) newL579–603
579instance : Algebra R (𝕜 →ℳ[U] 𝕜') where
580 algebraMap := {
581 toFun c := mk (algebraMap R (𝕜 → 𝕜') c) (.const (algebraMap R 𝕜' c))
582 map_zero' := by simp [zero_def]
583 map_add' f g := by
584 simp_rw [map_add]
585 apply mk_add_mk
586 · exact MeromorphicOn.const (algebraMap R 𝕜' f)
587 · exact MeromorphicOn.const (algebraMap R 𝕜' g)
588 map_one' := by simp [one_def]
589 map_mul' f g := by
590 simp_rw [map_mul]
591 apply mk_mul_mk
592 · exact MeromorphicOn.const (algebraMap R 𝕜' f)
593 · exact MeromorphicOn.const (algebraMap R 𝕜' g)
594 }
595 commutes' c f := by
596 cases f with | mk f hf
597 simp [mul_comm]
598 smul_def' c f := by
599 cases f with | mk f hf
600 simp_rw [smul_mk, Pi.smul_def, Algebra.smul_def]
601 apply mk_mul_mk
602 · exact MeromorphicOn.const (algebraMap R 𝕜' c)
603 · exact hf
theorem algebraMap_def newL605–608
605theorem algebraMap_def (c : R) :
606 algebraMap R (𝕜 →ℳ[U] 𝕜') c =
607 mk (algebraMap R (𝕜 → 𝕜') c) (.const (algebraMap R 𝕜' c)) :=
608 rfl
theorem coeFn_algebraMap newL610–612
610theorem coeFn_algebraMap (c : R) :
611 ⇑(algebraMap R (𝕜 →ℳ[U] 𝕜') c) =ᶠ[codiscreteWithin U] (algebraMap R (𝕜 → 𝕜') c) :=
612 coeFn_mk_eventuallyEq _
614/-! ## Inv / Div -/
instance (anonymous instance) newL616–617
616instance : Inv (𝕜 →ℳ[U] 𝕜') where
617 inv := comp Inv.inv fun _ h ↦ h.inv
theorem inv_mk newL619–621
619theorem inv_mk {f : 𝕜 → 𝕜'} (hf : MeromorphicOn f U) :
620 (mk f hf)⁻¹ = mk f⁻¹ hf.inv :=
621 rfl
theorem inv_zero newL623–625
623@[simp]
624theorem inv_zero : (0 : 𝕜 →ℳ[U] 𝕜')⁻¹ = 0 := by
625 simp [zero_def, inv_mk, Pi.inv_def, Pi.zero_def]
theorem coeFn_inv newL627–628
627theorem coeFn_inv (f : 𝕜 →ℳ[U] 𝕜') : ⇑(f⁻¹) =ᶠ[codiscreteWithin U] f⁻¹ :=
628 coeFn_comp _ _ f
theorem orderAt_inv newL630–638
630@[simp]
631theorem orderAt_inv (f : 𝕜 →ℳ[U] 𝕜) (x : 𝕜) : (f⁻¹).orderAt x = -f.orderAt x := by
632 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
633 · simp_rw [orderAt_eq_meromorphicOrder_coeFn _ hx.1 hx.2]
634 refine Eq.trans ?_ meromorphicOrderAt_inv
635 apply meromorphicOrderAt_congr
636 exact ((f⁻¹).meromorphicOn_coeFn x hx.1).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin
637 (f.meromorphicOn_coeFn x hx.1).inv hx.1 hx.2 f.coeFn_inv
638 · simp [orderAt_of_not_mem_and_accPt _ hx]
instance (anonymous instance) newL640–641
640instance : Div (𝕜 →ℳ[U] 𝕜') where
641 div := comp₂ Div.div fun _ _ hf hg ↦ hf.div hg
theorem mk_div_mk newL643–645
643theorem mk_div_mk {f : 𝕜 → 𝕜'} (hf : MeromorphicOn f U) {g : 𝕜 → 𝕜'} (hg : MeromorphicOn g U) :
644 mk f hf / mk g hg = mk (f / g) (hf.div hg) :=
645 rfl
theorem coeFn_div newL647–648
647theorem coeFn_div (f g : 𝕜 →ℳ[U] 𝕜') : ⇑(f / g) =ᶠ[codiscreteWithin U] f / g :=
648 coeFn_comp₂ _ _ f g
theorem orderAt_div newL650–658
650theorem orderAt_div (f g : 𝕜 →ℳ[U] 𝕜') (x : 𝕜) : (f / g).orderAt x = f.orderAt x - g.orderAt x := by
651 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
652 · simp_rw [orderAt_eq_meromorphicOrder_coeFn _ hx.1 hx.2]
653 refine Eq.trans ?_ <|
654 meromorphicOrderAt_div (f.meromorphicOn_coeFn x hx.1) (g.meromorphicOn_coeFn x hx.1)
655 apply meromorphicOrderAt_congr
656 exact ((f / g).meromorphicOn_coeFn x hx.1).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin
657 ((f.meromorphicOn_coeFn x hx.1).div (g.meromorphicOn_coeFn x hx.1)) hx.1 hx.2 (f.coeFn_div g)
658 · simp [orderAt_of_not_mem_and_accPt _ hx]
theorem div_zero newL660–663
660@[simp]
661theorem div_zero (f : 𝕜 →ℳ[U] 𝕜') : f / 0 = 0 := by
662 cases f with | mk f hf
663 simp [zero_def, mk_div_mk, Pi.div_def, Pi.zero_def]
instance (anonymous instance) newL665–666
665instance : ZPow (𝕜 →ℳ[U] 𝕜') where
666 zpow n := comp (· ^ n) fun _ h ↦ h.zpow n
theorem mk_zpow newL668–670
668theorem mk_zpow {f : 𝕜 → 𝕜'} (hf : MeromorphicOn f U) (n : ℤ) :
669 (mk f hf) ^ n = mk (f ^ n) (hf.zpow n) :=
670 rfl
theorem coeFn_zpow newL672–673
672theorem coeFn_zpow (f : 𝕜 →ℳ[U] 𝕜') (n : ℤ) : ⇑(f ^ n) =ᶠ[codiscreteWithin U] f ^ n :=
673 coeFn_comp _ _ f
theorem orderAt_zpow newL675–683
675theorem orderAt_zpow (f : 𝕜 →ℳ[U] 𝕜') (n : ℤ) (x : 𝕜) :
676 (f ^ n).orderAt x = n * f.orderAt x := by
677 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
678 · simp_rw [orderAt_eq_meromorphicOrder_coeFn _ hx.1 hx.2]
679 refine Eq.trans ?_ <| meromorphicOrderAt_zpow (f.meromorphicOn_coeFn x hx.1)
680 apply meromorphicOrderAt_congr
681 exact ((f ^ n).meromorphicOn_coeFn x hx.1).eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin
682 ((f.meromorphicOn_coeFn x hx.1).zpow n) hx.1 hx.2 (f.coeFn_zpow n)
683 · simp [orderAt_of_not_mem_and_accPt _ hx]
instance (anonymous instance) newL685–710
685instance : DivInvOneMonoid (𝕜 →ℳ[U] 𝕜') where
686 div_eq_mul_inv f g := by
687 cases f with | mk f hf
688 cases g with | mk g hg
689 simp [mk_div_mk, inv_mk, mk_mul_mk, div_eq_mul_inv]
690 inv_one := by simp [one_def, inv_mk]
691 zpow_zero' f := by
692 cases f with | mk f hf
693 simp [one_def, mk_zpow]
694 zpow_succ' n f := by
695 cases f with | mk f hf
696 simp only [Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one, zpow_natCast, mk_mul_mk, mk_eq_mk,
697 mk_zpow]
698 apply EventuallyEq.of_eq
699 ext x
700 by_cases h : f x = 0
701 · simp [h, zero_zpow_eq]
702 grind
703 · simp [zpow_add_one₀ h]
704 zpow_neg' n f := by
705 cases f with | mk f hf
706 simp only [zpow_negSucc, Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one, inv_mk, mk_eq_mk,
707 mk_zpow]
708 apply EventuallyEq.of_eq
709 simp only [inv_inj]
710 norm_cast
def field newL712–727
712/-- All meromorphic functions on a nontrivial preconnected domain form a field. -/
713@[implicit_reducible]
714def field (hnontrivial : U.Nontrivial) (hc : IsPreconnected U) : Field (𝕜 →ℳ[U] 𝕜') where
715 nnqsmul := _
716 qsmul := _
717 exists_pair_ne := by
718 use 0, 1
719 simpa [zero_def, one_def, EventuallyEq, hc.isDiscrete_iff_subsingleton] using hnontrivial
720 mul_inv_cancel f h := by
721 cases f with | mk f hf
722 simp only [inv_mk, mk_mul_mk, one_def, mk_eq_mk]
723 exact hf.mul_inv_eventuallyEq hc (by simpa [zero_def] using h)
724 inv_zero := by
725 simp only [zero_def, inv_mk, mk_eq_mk]
726 apply Eventually.of_forall
727 simp
instance (anonymous instance) newL729–730
729instance [PreconnectedSpace 𝕜] : Field (𝕜 →ℳ 𝕜') :=
730 field (Set.nontrivial_univ_iff.mpr inferInstance) (preconnectedSpace_iff_univ.mp ‹_›)
732/-! ## Derivative -/
734/-- Derivative of the meromorphic function. -/
735protected noncomputable
def deriv newL736–750
736def deriv [CompleteSpace E] : (𝕜 →ℳ[U] E) →ₗ[𝕜] (𝕜 →ℳ[U] E) where
737 toFun := lift (fun f ↦ mk (deriv f.val) f.prop.deriv) (fun f g h ↦ by
738 simpa using MeromorphicOn.deriv_eventuallyEq_codiscreteWithin f.prop g.prop h)
739 map_add' f g := by
740 cases f with | mk f hf
741 cases g with | mk g hg
742 simp only [mk_add_mk, lift_mk, mk_eq_mk]
743 filter_upwards [hf.eventually_codiscreteWithin_analyticAt,
744 hg.eventually_codiscreteWithin_analyticAt] with x hf hg
745 using deriv_add hf.differentiableAt hg.differentiableAt
746 map_smul' c f := by
747 cases f with | mk f hf
748 simp only [smul_mk, lift_mk, RingHom.id_apply, mk_eq_mk]
749 filter_upwards [hf.eventually_codiscreteWithin_analyticAt] with x hf
750 using deriv_const_smul c hf.differentiableAt
theorem deriv_mk newL752–754
752theorem deriv_mk [CompleteSpace E] {f : 𝕜 → E} (hf : MeromorphicOn f U) :
753 (mk f hf).deriv = mk (deriv f) hf.deriv := by
754 rfl
theorem coeFn_deriv newL756–762
756theorem coeFn_deriv [CompleteSpace E] (f : 𝕜 →ℳ[U] E) :
757 f.deriv =ᶠ[codiscreteWithin U] deriv f := by
758 cases f with | mk f hf
759 rw [deriv_mk]
760 apply (coeFn_mk_eventuallyEq _).trans
761 apply MeromorphicOn.deriv_eventuallyEq_codiscreteWithin hf (meromorphicOn_coeFn _)
762 exact (coeFn_mk_eventuallyEq hf).symm
theorem deriv_natCast newL764–766
764@[simp]
765theorem deriv_natCast [CompleteSpace 𝕜'] (n : ℕ) : (n : 𝕜 →ℳ[U] 𝕜').deriv = 0 := by
766 simp [natCast_eq, deriv_mk, zero_def]
theorem deriv_one newL768–770
768@[simp]
769theorem deriv_one [CompleteSpace E] [One E] : (1 : 𝕜 →ℳ[U] E).deriv = 0 := by
770 simp [one_def, deriv_mk, zero_def]
theorem deriv_algebraMap newL772–776
772@[simp]
773theorem deriv_algebraMap [CompleteSpace 𝕜'] (c : R) : (algebraMap R (𝕜 →ℳ[U] 𝕜') c).deriv = 0 := by
774 simp [algebraMap_def, deriv_mk, Pi.algebraMap_def, ← Pi.zero_def, zero_def]
776/-- `MeromorphicFun.deriv` as a `Derivation`. -/
777noncomputable
def derivation newL778–788
778def derivation [CompleteSpace 𝕜'] : Derivation 𝕜 (𝕜 →ℳ[U] 𝕜') (𝕜 →ℳ[U] 𝕜') where
779 __ := MeromorphicFun.deriv
780 map_one_eq_zero' := deriv_one
781 leibniz' f g := by
782 cases f with | mk f hf
783 cases g with | mk g hg
784 simp only [smul_eq_mul, mk_mul_mk, deriv_mk, mk_add_mk, mk_eq_mk]
785 filter_upwards [hf.eventually_codiscreteWithin_analyticAt,
786 hg.eventually_codiscreteWithin_analyticAt] with x hf hg
787 rw [add_comm, mul_comm g]
788 simpa using deriv_mul hf.differentiableAt hg.differentiableAt
theorem derivation_apply newL790–791
790@[simp]
791theorem derivation_apply [CompleteSpace 𝕜'] (f : 𝕜 →ℳ[U] 𝕜') : derivation f = f.deriv := rfl
theorem deriv_mul newL793–797
793protected theorem deriv_mul [CompleteSpace 𝕜'] (f g : 𝕜 →ℳ[U] 𝕜') :
794 (f * g).deriv = f.deriv * g + f * g.deriv := by
795 rw [← derivation_apply, derivation.leibniz f g]
796 simp_rw [derivation_apply, smul_eq_mul]
797 ring
theorem deriv_pow newL799–801
799protected theorem deriv_pow [CompleteSpace 𝕜'] (f : 𝕜 →ℳ[U] 𝕜') (n : ℕ) :
800 (f ^ n).deriv = n * f ^ (n - 1) * f.deriv := by
801 simp [← derivation_apply, ← mul_assoc]
theorem deriv_inv newL803–834
803protected theorem deriv_inv [CompleteSpace 𝕜'] (f : 𝕜 →ℳ[U] 𝕜') :
804 (f⁻¹).deriv = -f.deriv / f ^ 2 := by
805 -- One might want to use `Derivation.leibniz_inv`, but the theorem here is slightly more general:
806 -- `𝕜 →ℳ[U] 𝕜'` is not required to be connected, and thus not necessarily a field.
807 cases f with | mk f hf
808 simp only [inv_mk, deriv_mk, neg_mk, mk_pow, mk_div_mk, mk_eq_mk]
809 filter_upwards [hf.eventually_codiscreteWithin_analyticAt] with x hf
810 by_cases h0 : f x = 0
811 · suffices deriv f⁻¹ x = 0 by simpa [h0]
812 by_cases hnhds : f =ᶠ[𝓝 x] 0
813 · rw [hnhds.inv.deriv_eq]
814 simp [Pi.inv_def]
815 simp_rw [EventuallyEq, Pi.zero_apply] at hnhds
816 have hnhds : ∀ᶠ z in 𝓝[≠] x, f z ≠ 0 :=
817 hf.eventually_eq_zero_or_eventually_ne_zero.resolve_left hnhds
818 have htop : meromorphicOrderAt f x ≠ ⊤ :=
819 (meromorphicOrderAt_ne_top_iff_eventually_ne_zero hf.meromorphicAt).mpr hnhds
820 obtain ⟨n, hn⟩ := WithTop.ne_top_iff_exists.mp htop
821 have hpos : 0 < meromorphicOrderAt f x := by
822 rw [← tendsto_zero_iff_meromorphicOrderAt_pos hf.meromorphicAt, ← h0]
823 exact (hf.continuousAt.tendsto).mono_left nhdsWithin_le_nhds
824 have hcobounded : Tendsto f⁻¹ (𝓝[≠] x) (Bornology.cobounded 𝕜') := by
825 rw [tendsto_cobounded_iff_meromorphicOrderAt_neg hf.meromorphicAt.inv, meromorphicOrderAt_inv]
826 rw [← hn] at ⊢ hpos
827 norm_cast at ⊢ hpos
828 simpa using hpos
829 refine deriv_zero_of_not_differentiableAt fun h ↦ ?_
830 have htendsto : Tendsto f⁻¹ (𝓝[≠] x) (𝓝 0) := by
831 simpa [h0] using h.continuousAt.tendsto.mono_left nhdsWithin_le_nhds
832 exact htendsto.not_tendsto (Metric.disjoint_nhds_cobounded 0) hcobounded
833 rw [inv_eq_one_div, deriv_div (by fun_prop) hf.differentiableAt h0]
834 simp
theorem deriv_div newL836–845
836protected theorem deriv_div [CompleteSpace 𝕜'] (f g : 𝕜 →ℳ[U] 𝕜') :
837 (f / g).deriv = (f.deriv * g - f * g.deriv) / g ^ 2 := by
838 suffices MeromorphicFun.deriv f * g⁻¹ = MeromorphicFun.deriv f * (g * (g ^ 2)⁻¹) by
839 simpa [div_eq_mul_inv, f.deriv_mul, g.deriv_inv, ← sub_eq_add_neg, sub_mul, mul_assoc]
840 congrm MeromorphicFun.deriv f * ?_
841 cases g with | mk g hg
842 simp only [inv_mk, mk_pow, mk_mul_mk, mk_eq_mk]
843 refine Eventually.of_forall fun x ↦ ?_
844 simp
845 field
theorem deriv_zpow newL847–866
847protected theorem deriv_zpow [CompleteSpace 𝕜'] (f : 𝕜 →ℳ[U] 𝕜') (n : ℤ) :
848 (f ^ n).deriv = n * f ^ (n - 1) * f.deriv := by
849 cases n with
850 | ofNat n =>
851 simp only [Int.ofNat_eq_natCast, zpow_natCast, f.deriv_pow, Int.cast_natCast]
852 cases n with
853 | zero => simp
854 | succ n => simp
855 | negSucc n =>
856 cases f with | mk f hf
857 simp only [zpow_negSucc, MeromorphicFun.deriv_inv, MeromorphicFun.deriv_pow, Nat.cast_add,
858 Nat.cast_one, add_tsub_cancel_right, deriv_mk, Int.cast_negSucc, neg_add_rev,
859 Int.negSucc_sub_one]
860 simp only [natCast_eq, one_def, mk_add_mk, mk_pow, mk_mul_mk, neg_mk, mk_div_mk, inv_mk,
861 mk_eq_mk]
862 refine Eventually.of_forall fun x ↦ ?_
863 by_cases h0 : f x = 0
864 · simp [h0]
865 simp
866 field
theorem orderAt_deriv newL868–877
868theorem orderAt_deriv [CompleteSpace E] {f : 𝕜 →ℳ[U] E} {x : 𝕜} {n : ℤ} (hn : (↑(n + 1) : 𝕜) ≠ 0)
869 (horder : f.orderAt x = ↑(n + 1)) :
870 f.deriv.orderAt x = ↑n := by
871 by_cases hx : x ∈ U ∧ AccPt x (𝓟 U)
872 · cases f with | mk f hf
873 simp_rw [deriv_mk, orderAt_mk _ hx.1 hx.2]
874 rw [orderAt_mk _ hx.1 hx.2] at horder
875 exact meromorphicOrderAt_deriv hn horder
876 · rw [f.orderAt_of_not_mem_and_accPt hx, zero_eq_coe] at horder
877 simp [horder] at hn
879end MeromorphicFun

Mathlib/Analysis/Meromorphic/NormalForm.lean +43 −0

lemma MeromorphicAt.eqOn_compl_singleton_toMeromorphicNFAt (hf : MeromorphicAt f
437 toMeromorphicNFAt f x = 0 := by
438 simp [toMeromorphicNFAt, hf]
lemma toMeromorphicNFAt_of_meromorphicOrderAt_ne_zero newL440–444
440@[simp] lemma toMeromorphicNFAt_of_meromorphicOrderAt_ne_zero
441 (horder : meromorphicOrderAt f x ≠ 0) : toMeromorphicNFAt f x x = 0 := by
442 by_cases hf : MeromorphicAt f x
443 · simp [toMeromorphicNFAt, hf, horder]
444 · simp [hf] at horder
lemma MeromorphicAt.exists_analytic_and_toMeromorphicNFAt_eventuallyEq newL446–461
446lemma MeromorphicAt.exists_analytic_and_toMeromorphicNFAt_eventuallyEq (hf : MeromorphicAt f x)
447 (horder : meromorphicOrderAt f x = 0) :
448 ∃ g : 𝕜 → E, AnalyticAt 𝕜 g x ∧ g x ≠ 0 ∧ toMeromorphicNFAt f x =ᶠ[𝓝 x] g := by
449 obtain ⟨hanalytic, hgx, hg⟩ := Classical.choose_spec <|
450 (meromorphicOrderAt_eq_int_iff hf).mp horder
451 refine ⟨Classical.choose <| (meromorphicOrderAt_eq_int_iff hf).mp horder, hanalytic, hgx, ?_⟩
452 apply eventuallyEq_nhds_of_eventuallyEq_nhdsNE
453 · simp only [toMeromorphicNFAt, hf, ↓reduceDIte, horder, coe_zero, ne_eq, zpow_zero, one_smul]
454 trans f
455 · classical
456 apply Function.update_eventuallyEq_nhdsNE
457 rw [Filter.EventuallyEq]
458 simp only [zpow_zero, ne_eq, one_smul] at hg
459 convert! hg
460 simp
461 · simp [toMeromorphicNFAt, hf, horder]
463/-- Conversion to normal form at `x` changes the value only at x. -/
464lemma MeromorphicAt.eq_nhdsNE_toMeromorphicNFAt (hf : MeromorphicAt f x) :
465 f =ᶠ[𝓝[≠] x] toMeromorphicNFAt f x :=
466 eventually_nhdsWithin_of_forall (fun _ hz ↦ hf.eqOn_compl_singleton_toMeromorphicNFAt hz)
lemma toMeromorphicNFAt_congr newL468–486
468lemma toMeromorphicNFAt_congr {f g : 𝕜 → E} (hfg : f =ᶠ[𝓝[≠] x] g) :
469 toMeromorphicNFAt f x x = toMeromorphicNFAt g x x := by
470 by_cases hf : MeromorphicAt f x
471 <;> obtain hg := (MeromorphicAt.meromorphicAt_congr hfg).eq ▸ hf
472 · by_cases hforder : meromorphicOrderAt f x = 0
473 <;> obtain hgorder := meromorphicOrderAt_congr hfg ▸ hforder
474 · obtain ⟨f', hf'anl, _, hf'⟩ :=
475 hf.exists_analytic_and_toMeromorphicNFAt_eventuallyEq hforder
476 obtain ⟨g', hg'anl, _, hg'⟩ :=
477 hg.exists_analytic_and_toMeromorphicNFAt_eventuallyEq hgorder
478 have hf'g' : f' =ᶠ[𝓝[≠] x] g' := (hf'.symm.filter_mono nhdsWithin_le_nhds).trans <|
479 hf.eq_nhdsNE_toMeromorphicNFAt.symm.trans <| hfg.trans <|
480 hg.eq_nhdsNE_toMeromorphicNFAt.trans <|
481 hg'.filter_mono nhdsWithin_le_nhds
482 have heq : f' x = g' x := Filter.EventuallyEq.eq_of_nhds
483 ((AnalyticAt.frequently_eq_iff_eventually_eq hf'anl hg'anl).mp hf'g'.frequently)
484 exact hf'.eq_of_nhds.trans <| heq.trans hg'.eq_of_nhds.symm
485 · simp [hforder, hgorder]
486 · simp [hf, hg]
488/-- After conversion to normal form at `x`, the function has normal form. -/
489theorem meromorphicNFAt_toMeromorphicNFAt :
490 MeromorphicNFAt (toMeromorphicNFAt f x) x := by

Mathlib/Analysis/Meromorphic/Order.lean +31 −0

theorem meromorphicOrderAt_add_of_ne
670 · simpa [h.le] using meromorphicOrderAt_add_eq_left_of_lt hf₂ h
671 · simpa [h.le] using meromorphicOrderAt_add_eq_right_of_lt hf₁ h
theorem mul_inv_evnetuallyEq_of_meromorphicOrderAt_ne_top newL673–679
673theorem mul_inv_evnetuallyEq_of_meromorphicOrderAt_ne_top {f : 𝕜 → 𝕜'} (hf₁ : MeromorphicAt f x)
674 (hf₂ : meromorphicOrderAt f x ≠ ⊤) :
675 f * f⁻¹ =ᶠ[𝓝[≠] x] 1 := by
676 suffices ∀ᶠ y in 𝓝[≠] x, f y ≠ 0 by
677 filter_upwards [this]
678 aesop
679 exact (meromorphicOrderAt_ne_top_iff_eventually_ne_zero hf₁).mp hf₂
681/-!
682## Level Sets of the Order Function
683-/
theorem meromorphicOrderAt_ne_top_of_isPreconnected (hf : MeromorphicOn f U) {y
782 (hf.exists_meromorphicOrderAt_ne_top_iff_forall ⟨nonempty_of_mem h₁x, hU⟩).1
783 (by use ⟨x, h₁x⟩) ⟨y, hy⟩
theorem meromorphicOrderAt_eq_top_of_isPreconnected newL785–789
785theorem meromorphicOrderAt_eq_top_of_isPreconnected (hf : MeromorphicOn f U) {y : 𝕜}
786 (hU : IsPreconnected U) (hx : x ∈ U) (hy : y ∈ U) (h₂x : meromorphicOrderAt f x = ⊤) :
787 meromorphicOrderAt f y = ⊤ := by
788 contrapose h₂x with h
789 exact hf.meromorphicOrderAt_ne_top_of_isPreconnected hU hy hx h
theorem mul_inv_eventuallyEq changedL791–810
791/-- On a preconnected set, a meromorphic function that's not constantly zero has a
792multiplicative inverse. In this version of the lemma, we relax the equality to
793`=ᶠ[codiscreteWithin U]`. -/
794theorem mul_inv_eventuallyEq {f : 𝕜 → 𝕜'} (hf : MeromorphicOn f U) (hU : IsPreconnected U)
795 (h0 : ¬f =ᶠ[codiscreteWithin U] 0) :
796 f * f⁻¹ =ᶠ[codiscreteWithin U] 1 := by
797 rw [EventuallyEq, Filter.Eventually, mem_codiscreteWithin_iff_forall_mem_nhdsNE]
798 intro x hx
799 rw [Set.union_comm, ← Filter.mem_inf_principal']
800 apply Filter.mem_inf_of_left <| mul_inv_evnetuallyEq_of_meromorphicOrderAt_ne_top (hf x hx) ?_
801 contrapose! h0
802 rw [EventuallyEq, Filter.Eventually, mem_codiscreteWithin_iff_forall_mem_nhdsNE]
803 intro y hy
804 rw [Set.union_comm, ← Filter.mem_inf_principal']
805 refine Filter.mem_inf_of_left <| meromorphicOrderAt_eq_top_iff.mp ?_
806 exact hf.meromorphicOrderAt_eq_top_of_isPreconnected hU hx hy h0
808/-- If a function is meromorphic on a set `U`, then for each point in `U`, it is analytic at nearby
809points in `U`. When the target space is complete, this can be strengthened to analyticity at all
810nearby points, see `MeromorphicAt.eventually_analyticAt`. -/
0/124 declarations checked

Your review, as Markdown

Paste it as a comment or a review on the PR. Line links to the head commit unfold into code snippets on GitHub.