/-- A `EuclideanDomain` is a non-trivial commutative ring with a division and a remainder,
  satisfying `b * (a / b) + a % b = a`.
  The definition of a Euclidean domain usually includes a valuation function `R → ℕ`.
  This definition is slightly generalised to include a well founded relation
  `r` with the property that `r (a % b) b`, instead of a valuation.  -/
class EuclideanDomain (R : Type u) extends CommRing R, Nontrivial R where
  /-- A division function (denoted `/`) on `R`.
    This satisfies the property `b * (a / b) + a % b = a`, where `%` denotes `remainder`. -/
  protected quotient : R → R → R
  /-- Division by zero should always give zero by convention. -/
  protected quotient_zero : ∀ a, quotient a 0 = 0
  /-- A remainder function (denoted `%`) on `R`.
    This satisfies the property `b * (a / b) + a % b = a`, where `/` denotes `quotient`. -/
  protected remainder : R → R → R
  /-- The property that links the quotient and remainder functions.
    This allows us to compute GCDs and LCMs. -/
  protected quotient_mul_add_remainder_eq : ∀ a b, b * quotient a b + remainder a b = a
  /-- A well-founded relation on `R`, satisfying `r (a % b) b`.
    This ensures that the GCD algorithm always terminates. -/
  protected r : R → R → Prop
  /-- The relation `r` must be well-founded.
    This ensures that the GCD algorithm always terminates. -/
  r_wellFounded : WellFounded r
  /-- The relation `r` satisfies `r (a % b) b`. -/
  protected remainder_lt : ∀ (a) {b}, b ≠ 0 → r (remainder a b) b
  /-- An additional constraint on `r`. -/
  mul_left_not_lt : ∀ (a) {b}, b ≠ 0 → ¬r (a * b) a

{R : Type u}
[self : EuclideanDomain R]
(a : R)
{b : R}

b ≠ 0 → EuclideanDomain.r (EuclideanDomain.remainder a b) b


/-- Given a linear map `f : N → P`, `f ⊗ M` is injective if and only if `M ⊗ f` is injective. -/
theorem lTensor_inj_iff_rTensor_inj :
    Function.Injective (lTensor M f) ↔ Function.Injective (rTensor M f)

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : N →ₗ[R] P)

Function.Injective ⇑(LinearMap.lTensor M f) ↔ Function.Injective ⇑(LinearMap.rTensor M f)


theorem le_hausdorffMeasure_image (hf : AntilipschitzWith K f) (hd : 0 ≤ d) (s : Set X) :
    μH[d] s ≤ (K : ℝ≥0∞) ^ d * μH[d] (f '' s)

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
[MeasurableSpace X]
[BorelSpace X]
[MeasurableSpace Y]
[BorelSpace Y]
{f : X → Y}
{K : ℝ≥0}
{d : ℝ}
(hf : AntilipschitzWith K f)
(hd : 0 ≤ d)
(s : Set X)


protected theorem linear [AddCommMonoid F] [Module R F] [∀ x, AddCommMonoid (E x)]
    [∀ x, Module R (E x)] [e.IsLinear R] {b : B} (hb : b ∈ e.baseSet) :
    IsLinearMap R fun y : E b => (e ⟨b, y⟩).2

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

IsLinearMap R fun y => (↑e { proj := b, snd := y }).2


/-- This structure contains the information left for a local trivialization (which is implemented
below as `Trivialization F proj`) if the total space has not been given a topology, but we
have a topology on both the fiber and the base space. Through the construction
`topological_fiber_prebundle F proj` it will be possible to promote a
`Pretrivialization F proj` to a `Trivialization F proj`. -/
structure Pretrivialization (proj : Z → B) extends PartialEquiv Z (B × F) where
  open_target : IsOpen target
  baseSet : Set B
  open_baseSet : IsOpen baseSet
  source_eq : source = proj ⁻¹' baseSet
  target_eq : target = baseSet ×ˢ univ
  proj_toFun : ∀ p ∈ source, (toFun p).1 = proj p

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
(self : Pretrivialization F proj)


@[simp]
lemma LSeries_neg (f : ℕ → ℂ) (s : ℂ) : LSeries (-f) s = -LSeries f s


@[to_additive]
theorem IsCompact.closedBall_div (hs : IsCompact s) (hδ : 0 ≤ δ) (x : E) :
    closedBall x δ * s = x • cthickening δ s

{E : Type u_1}
[SeminormedCommGroup E]
{δ : ℝ}
{s : Set E}
(hs : IsCompact s)
(hδ : 0 ≤ δ)
(x : E)

Metric.closedBall x δ * s = x • Metric.cthickening δ s


theorem ext_iff {inst₁ inst₂ : NonUnitalCommRing R} :
    inst₁ = inst₂ ↔
      (local_hAdd[R, inst₁] = local_hAdd[R, inst₂]) ∧
      (local_hMul[R, inst₁] = local_hMul[R, inst₂])

{R : Type u}
{inst₁ inst₂ : NonUnitalCommRing R}

inst₁ = inst₂ ↔ HAdd.hAdd = HAdd.hAdd ∧ HMul.hMul = HMul.hMul


theorem EqOn.comp_left (h : s.EqOn f₁ f₂) : s.EqOn (g ∘ f₁) (g ∘ f₂)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
{f₁ f₂ : α → β}
{g : β → γ}
(h : Set.EqOn f₁ f₂ s)


protected lemma Real.IsConjExponent.toNNReal {p q : ℝ} (hpq : p.IsConjExponent q) :
    p.toNNReal.IsConjExponent q.toNNReal


lemma sqrt_lt_sqrt : sqrt x < sqrt y ↔ x < y


@[to_additive]
theorem prod_pair (a b : α) : ({a, b} : Multiset α).prod = a * b


@[simp (high)]
theorem map_mem_nonunits_iff (f : R →+* S) [IsLocalRingHom f] (a) :
    f a ∈ nonunits S ↔ a ∈ nonunits R

{R : Type u_1}
{S : Type u_2}
[Semiring R]
[Semiring S]
(f : R →+* S)
[IsLocalRingHom f]
(a : R)


theorem extend_coe_symm : ⇑(f.extend I).symm = f.symm ∘ I.symm

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)


@[simp]
lemma ofTensorProductEquivOfFiniteNoetherian_apply [Module.Finite R M]
    (x : AdicCompletion I R ⊗[R] M) :
    ofTensorProductEquivOfFiniteNoetherian I M x = ofTensorProduct I M x

{R : Type u}
[CommRing R]
(I : Ideal R)
(M : Type u)
[AddCommGroup M]
[Module R M]
[IsNoetherianRing R]
[Module.Finite R M]
(x : AdicCompletion I R ⊗[R] M)

(AdicCompletion.ofTensorProductEquivOfFiniteNoetherian I M) x = (AdicCompletion.ofTensorProduct I M) x


/-- Substructure closure of a set is monotone in its argument: if `s ⊆ t`,
then `closure L s ≤ closure L t`. -/
theorem closure_mono ⦃s t : Set M⦄ (h : s ⊆ t) : closure L s ≤ closure L t

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
⦃s t : Set M⦄
(h : s ⊆ t)

(FirstOrder.Language.Substructure.closure L).toFun s ≤ (FirstOrder.Language.Substructure.closure L).toFun t


theorem tsum_toReal_eq {f : α → ℝ≥0∞} (hf : ∀ a, f a ≠ ∞) :
    (∑' a, f a).toReal = ∑' a, (f a).toReal

{α : Type u_1}
{f : α → ℝ≥0∞}
(hf : ∀ (a : α), f a ≠ ⊤)

(∑' (a : α), f a).toReal = ∑' (a : α), (f a).toReal


theorem isReflection_simple (i : B) : cs.IsReflection (s i)

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(i : B)


/-- Build an isomorphism in the category `CommGrp` from a `MulEquiv`
between `CommGroup`s. -/
@[to_additive (attr := simps)]
def MulEquiv.toCommGrpIso {X Y : CommGrp} (e : X ≃* Y) : X ≅ Y


theorem bddAbove_def : BddAbove s ↔ ∃ x, ∀ y ∈ s, y ≤ x


lemma norm_eq_of_ringEquiv {A B C : Type*} [CommRing A] [CommRing B] [Ring C]
    [Algebra A C] [Algebra B C] (e : A ≃+* B) (he : (algebraMap B C).comp e = algebraMap A C)
    (x : C) :
    e (Algebra.norm A x) = Algebra.norm B x

(he : (algebraMap B C).comp ↑e = algebraMap A C)

e ((Algebra.norm A) x) = (Algebra.norm B) x


theorem fold_eq_foldr (b : α) (s : Multiset α) :
    fold op b s = foldr op (left_comm _ hc.comm ha.assoc) b s

{α : Type u_1}
(op : α → α → α)
[hc : Std.Commutative op]
[ha : Std.Associative op]
(b : α)
(s : Multiset α)

Multiset.fold op b s = Multiset.foldr op ⋯ b s


theorem arcsin_projIcc (x : ℝ) :
    arcsin (projIcc (-1) 1 (neg_le_self zero_le_one) x) = arcsin x

Real.arcsin ↑(Set.projIcc (-1) 1 ⋯ x) = Real.arcsin x


@[to_additive] lemma AntivaryOn.mul_right (h₁ : AntivaryOn f g₁ s) (h₂ : AntivaryOn f g₂ s) :
    AntivaryOn f (g₁ * g₂) s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[LinearOrderedAddCommGroup β]
{s : Set ι}
{f : ι → α}
{g₁ g₂ : ι → β}
(h₁ : AntivaryOn f g₁ s)
(h₂ : AntivaryOn f g₂ s)


lemma one_lt_pow' (n m : ℕ) : 1 < (m + 2) ^ (n + 1)


theorem strictMonoOn_logb : StrictMonoOn (logb b) (Set.Ioi 0)


theorem preimage_subtype_coe_eq_compl {s u v : Set α} (hsuv : s ⊆ u ∪ v)
    (H : s ∩ (u ∩ v) = ∅) : ((↑) : s → α) ⁻¹' u = ((↑) ⁻¹' v)ᶜ

{α : Type u_1}
{s u v : Set α}
(hsuv : s ⊆ u ∪ v)
(H : s ∩ (u ∩ v) = ∅)

Subtype.val ⁻¹' u = (Subtype.val ⁻¹' v)ᶜ


theorem IndepFun.neg_right {_mβ : MeasurableSpace β} {_mβ' : MeasurableSpace β'} [Neg β']
    [MeasurableNeg β'] (hfg : IndepFun f g μ) :
    IndepFun f (-g) μ

(hfg : ProbabilityTheory.IndepFun f g μ)


{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{a : α}

0 ≤ ⌊a⌋ ↔ 0 ≤ a


/-- The canonical map from the adic completion of the product to the product of the
adic completions. -/
@[simps!]
def pi : AdicCompletion I (∀ j, M j) →ₗ[AdicCompletion I R] ∀ j, AdicCompletion I (M j)

{R : Type u_1}
[CommRing R]
(I : Ideal R)
{ι : Type u_6}
(M : ι → Type u_7)
[(i : ι) → AddCommGroup (M i)]
[(i : ι) → Module R (M i)]
(c : AdicCompletion I ((j : ι) → M j))
(i : ι)
(n : ℕ)

↑((AdicCompletion.pi I M) c i) n = (LinearMap.reduceModIdeal (I ^ n) (LinearMap.proj i)) (↑c n)


@[simp]
theorem _root_.Ideal.mem_colon_singleton {I : Ideal R} {x r : R} :
    r ∈ I.colon (Ideal.span {x}) ↔ r * x ∈ I

{R : Type u_1}
[CommRing R]
{I : Ideal R}
{x r : R}

r ∈ Submodule.colon I (Ideal.span {x}) ↔ r * x ∈ I


@[simp, mfld_simps]
theorem mem_localTriv_target (p : B × F) :
    p ∈ (Z.localTriv i).target ↔ p.1 ∈ (Z.localTriv i).baseSet

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
[NontriviallyNormedField R]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
{ι : Type u_5}
(Z : VectorBundleCore R B F ι)
(i : ι)
(p : B × F)


@[simp]
theorem ofDual_ofNat [NatCast α] (n : ℕ) [n.AtLeastTwo] :
    (ofDual (no_index (OfNat.ofNat n : αᵒᵈ))) = OfNat.ofNat n

{α : Type u_1}
[NatCast α]
(n : ℕ)
[n.AtLeastTwo]

OrderDual.ofDual (OfNat.ofNat n) = OfNat.ofNat n


theorem comap_comap (s : NonUnitalSubring T) (g : S →ₙ+* T) (f : R →ₙ+* S) :
    (s.comap g).comap f = s.comap (g.comp f)

{R : Type u}
{S : Type v}
{T : Type u_1}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
[NonUnitalNonAssocRing T]
(s : NonUnitalSubring T)
(g : S →ₙ+* T)
(f : R →ₙ+* S)

NonUnitalSubring.comap f (NonUnitalSubring.comap g s) = NonUnitalSubring.comap (g.comp f) s


@[refl] theorem Subperm.refl (l : List α) : l <+~ l


theorem contMDiffOn_chart_symm : ContMDiffOn I I n (chartAt H x).symm (chartAt H x).target

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{x : M}
{n : ℕ∞}

ContMDiffOn I I n (↑(chartAt H x).symm) (chartAt H x).target


/-- The functor `CostructuredArrow S T ⥤ CostructuredArrow U V` that is deduced from
a natural transformation `F ⋙ U ⟶ S ⋙ G` and a morphism `G.obj T ⟶ V` -/
@[simps!]
def map₂ : CostructuredArrow S T ⥤ CostructuredArrow U V

(X : CategoryTheory.Comma S (CategoryTheory.Functor.fromPUnit T))

((CategoryTheory.CostructuredArrow.map₂ α β).obj X).left = F.obj X.left


/-- An alternative definition of the norm on the quotient group: the norm of `((x : M) : M ⧸ S)` is
equal to the distance from `x` to `S`. -/
theorem QuotientAddGroup.norm_mk {S : AddSubgroup M} (x : M) :
    ‖(x : M ⧸ S)‖ = infDist x S

{M : Type u_1}
[SeminormedAddCommGroup M]
{S : AddSubgroup M}
(x : M)


/-- The complex hyperbolic cosine function is everywhere differentiable, with the derivative
`sinh x`. -/
theorem hasDerivAt_cosh (x : ℂ) : HasDerivAt cosh (sinh x) x

HasDerivAt Complex.cosh (Complex.sinh x) x


/-- Relation `fun f g ↦ Tendsto (fun x ↦ (f x, g x)) l (𝓤 α)` is reflexive. -/
theorem tendsto_diag_uniformity (f : β → α) (l : Filter β) :
    Tendsto (fun x => (f x, f x)) l (𝓤 α)

{α : Type ua}
{β : Type ub}
[UniformSpace α]
(f : β → α)
(l : Filter β)

Filter.Tendsto (fun x => (f x, f x)) l (𝓤 α)


/-- Isomorphic monads give equivalent categories of algebras. Furthermore, they are equivalent as
categories over `C`, that is, we have `algebraEquivOfIsoMonads h ⋙ forget = forget`.
-/
@[simps]
def algebraEquivOfIsoMonads {T₁ T₂ : Monad C} (h : T₁ ≅ T₂) : Algebra T₁ ≌ Algebra T₂

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T₁ T₂ : CategoryTheory.Monad C}
(h : T₁ ≅ T₂)

(CategoryTheory.Monad.algebraEquivOfIsoMonads h).counitIso =
  (CategoryTheory.Monad.algebraFunctorOfMonadHomComp h.inv h.hom).symm ≪≫
    CategoryTheory.Monad.algebraFunctorOfMonadHomEq ⋯ ≪≫ CategoryTheory.Monad.algebraFunctorOfMonadHomId


protected theorem ClosedEmbedding.compactSpace [h : CompactSpace Y] {f : X → Y}
    (hf : ClosedEmbedding f) : CompactSpace X

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
[h : CompactSpace Y]
{f : X → Y}
(hf : ClosedEmbedding f)


/--
If `Estimator.improveUntil a p e` returns `some e'`, then `bound a e'` satisfies `p`.
Otherwise, that value `a` must not satisfy `p`.
-/
theorem Estimator.improveUntil_spec
    (a : Thunk α) (p : α → Bool) [Estimator a ε] [WellFoundedGT (range (bound a : ε → α))] (e : ε) :
    match Estimator.improveUntil a p e with
    | .error _ => ¬ p a.get
    | .ok e' => p (bound a e')

[WellFoundedGT ↑(Set.range (EstimatorData.bound a))]

match Estimator.improveUntil a p e with
| Except.error a_1 => ¬p a.get = true
| Except.ok e' => p (EstimatorData.bound a e') = true


theorem contDiff_clm_apply_iff {n : ℕ∞} {f : E → F →L[𝕜] G} [FiniteDimensional 𝕜 F] :
    ContDiff 𝕜 n f ↔ ∀ y, ContDiff 𝕜 n fun x => f x y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[CompleteSpace 𝕜]
{n : ℕ∞}
{f : E → F →L[𝕜] G}
[FiniteDimensional 𝕜 F]

ContDiff 𝕜 n f ↔ ∀ (y : F), ContDiff 𝕜 n fun x => (f x) y


theorem closedBall_mono {p : Seminorm 𝕜 E} {r₁ r₂ : ℝ} (h : r₁ ≤ r₂) :
    p.closedBall x r₁ ⊆ p.closedBall x r₂

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
{x : E}
{p : Seminorm 𝕜 E}
{r₁ r₂ : ℝ}
(h : r₁ ≤ r₂)


/-- To prove a property of a finite product, it suffices to prove that the property is
multiplicative and holds on factors. -/
@[to_additive
      "To prove a property of a finite sum, it suffices to prove that the property is
      additive and holds on summands."]
theorem finprod_mem_induction (p : M → Prop) (hp₀ : p 1) (hp₁ : ∀ x y, p x → p y → p (x * y))
    (hp₂ : ∀ x ∈ s, p <| f x) : p (∏ᶠ i ∈ s, f i)

(hp₁ : ∀ (x y : M), p x → p y → p (x * y))


theorem eq_one_of_mul_eq_self_left {a b : Int} (Hpos : a ≠ 0) (H : b * a = a) : b = 1


@[simp] theorem cmp_iff_eq [LawfulCmpEq α cmp] : cmp a a' = .eq ↔ a = a'

{α : Type u_1}
{cmp : α → α → Ordering}
{a a' : α}
[Lake.LawfulCmpEq α cmp]


theorem fst_apply {s : Set α} (hs : MeasurableSet s) : ρ.fst s = ρ (Prod.fst ⁻¹' s)

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{ρ : MeasureTheory.Measure (α × β)}
{s : Set α}
(hs : MeasurableSet s)


protected theorem Antitone.Ioi (hf : Antitone f) : Monotone fun x => Ioi (f x)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : Antitone f)


@[to_additive is_left_invariant_addIndex]
theorem is_left_invariant_index {K : Set G} (hK : IsCompact K) (g : G) {V : Set G}
    (hV : (interior V).Nonempty) : index ((fun h => g * h) '' K) V = index K V

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
{K : Set G}
(hK : IsCompact K)
(g : G)
{V : Set G}
(hV : (interior V).Nonempty)

MeasureTheory.Measure.haar.addIndex ((fun h => g + h) '' K) V = MeasureTheory.Measure.haar.addIndex K V


theorem hasUnitMulPowIrreducibleFactorization :
    HasUnitMulPowIrreducibleFactorization k⟦X⟧


@[simp]
theorem mk_sub_mk [Sub α] {x y : α} (hx : 0 ≤ x) (hy : 0 ≤ y) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) - ⟨y, hy⟩ = toNonneg (x - y)

{α : Type u_1}
[Zero α]
[LinearOrder α]
[Sub α]
{x y : α}
(hx : 0 ≤ x)
(hy : 0 ≤ y)

⟨x, hx⟩ - ⟨y, hy⟩ = Nonneg.toNonneg (x - y)


@[simp, deprecated bot_le "Don't mix Option and WithBot" (since := "2024-05-27")]
theorem none_le {a : WithBot α} : @LE.le (WithBot α) _ none a


theorem eval_nodal_derivative_eval_node_eq [DecidableEq ι] {i : ι} (hi : i ∈ s) :
    eval (v i) (derivative (nodal s v)) = eval (v i) (nodal (s.erase i) v)

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
{s : Finset ι}
{v : ι → R}
[DecidableEq ι]
{i : ι}
(hi : i ∈ s)

Polynomial.eval (v i) (Polynomial.derivative (Lagrange.nodal s v)) =
  Polynomial.eval (v i) (Lagrange.nodal (s.erase i) v)


theorem isPreconnected_range [TopologicalSpace β] [PreconnectedSpace α] {f : α → β}
    (h : Continuous f) : IsPreconnected (range f)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[PreconnectedSpace α]
{f : α → β}
(h : Continuous f)


/-- **Tietze extension theorem** for `TietzeExtension` spaces, a version for a closed set. Let
`s` be a closed set in a normal topological space `X`. Let `f` be a continuous function
on `s` with values in a `TietzeExtension` space `Y`. Then there exists a continuous function
`g : C(X, Y)` such that `g.restrict s = f`. -/
theorem ContinuousMap.exists_restrict_eq (f : C(s, Y)) : ∃ (g : C(X, Y)), g.restrict s = f

{X : Type u}
[TopologicalSpace X]
[NormalSpace X]
{s : Set X}
(hs : IsClosed s)
{Y : Type v}
[TopologicalSpace Y]
[TietzeExtension Y]
(f : C(↑s, Y))


protected theorem map_sub : D (a - b) = D a - D b

{R : Type u_1}
[CommRing R]
{A : Type u_2}
[CommRing A]
[Algebra R A]
{M : Type u_3}
[AddCommGroup M]
[Module A M]
[Module R M]
(D : Derivation R A M)
(a b : A)


/-- A ring `R` is *Henselian* at an ideal `I` if the following condition holds:
for every polynomial `f` over `R`, with a *simple* root `a₀` over the quotient ring `R/I`,
there exists a lift `a : R` of `a₀` that is a root of `f`.

(Here, saying that a root `b` of a polynomial `g` is *simple* means that `g.derivative.eval b` is a
unit. Warning: if `R/I` is not a field then it is not enough to assume that `g` has a factorization
into monic linear factors in which `X - b` shows up only once; for example `1` is not a simple root
of `X^2-1` over `ℤ/4ℤ`.) -/
class HenselianRing (R : Type*) [CommRing R] (I : Ideal R) : Prop where
  jac : I ≤ Ideal.jacobson ⊥
  is_henselian :
    ∀ (f : R[X]) (_ : f.Monic) (a₀ : R) (_ : f.eval a₀ ∈ I)
      (_ : IsUnit (Ideal.Quotient.mk I (f.derivative.eval a₀))), ∃ a : R, f.IsRoot a ∧ a - a₀ ∈ I

{R : Type u_1}
[CommRing R]
{I : Ideal R}
[self : HenselianRing R I]


theorem isPrimePow_iff_minFac_pow_factorization_eq {n : ℕ} (hn : n ≠ 1) :
    IsPrimePow n ↔ n.minFac ^ n.factorization n.minFac = n


theorem kronecker_ofNat [Semiring α] [DecidableEq n] (A : Matrix l m α) (b : ℕ) [b.AtLeastTwo] :
    A ⊗ₖ (no_index (OfNat.ofNat b) : Matrix n n α) =
      blockDiagonal fun _ => A <• (OfNat.ofNat b : α)

{α : Type u_2}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
[Semiring α]
[DecidableEq n]
(A : Matrix l m α)
(b : ℕ)
[b.AtLeastTwo]

Matrix.kroneckerMap (fun x x_1 => x * x_1) A (OfNat.ofNat b) =
  Matrix.blockDiagonal fun x => MulOpposite.op (OfNat.ofNat b) • A


@[to_additive (attr := simp) MeasureTheory.sdiff_addFundamentalFrontier]
theorem sdiff_fundamentalFrontier : s \ fundamentalFrontier G s = fundamentalInterior G s

(G : Type u_1)
{α : Type u_3}
[Group G]
[MulAction G α]
(s : Set α)

s \ MeasureTheory.fundamentalFrontier G s = MeasureTheory.fundamentalInterior G s


/-- The natural embedding `H ⧸ (⨅ i, f i).subgroupOf H ↪ Π i, H ⧸ (f i).subgroupOf H`. -/
@[to_additive (attr := simps) "The natural embedding
 `H ⧸ (⨅ i, f i).addSubgroupOf H) ↪ Π i, H ⧸ (f i).addSubgroupOf H`."]
def quotientiInfSubgroupOfEmbedding {ι : Type*} (f : ι → Subgroup α) (H : Subgroup α) :
    H ⧸ (⨅ i, f i).subgroupOf H ↪ ∀ i, H ⧸ (f i).subgroupOf H

{α : Type u_1}
[Group α]
{ι : Type u_2}
(f : ι → Subgroup α)
(H : Subgroup α)
(q : ↥H ⧸ (⨅ i, f i).subgroupOf H)
(i : ι)

(Subgroup.quotientiInfSubgroupOfEmbedding f H) q i = Subgroup.quotientSubgroupOfMapOfLE H ⋯ q


/-- This is a relative version of
`ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem`, which we recover by setting
`f` to be the identity map. This is also a geometric interpretation of the Farkas' lemma
stated using proper cones. -/
theorem hyperplane_separation (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F} :
    b ∈ K.map f ↔ ∀ y : F, adjoint f y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
[CompleteSpace E]
{F : Type u_2}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
[CompleteSpace F]
(K : ProperCone ℝ E)
{f : E →L[ℝ] F}
{b : F}

b ∈ ProperCone.map f K ↔ ∀ (y : F), (ContinuousLinearMap.adjoint f) y ∈ K.dual → 0 ≤ ⟪y, b⟫_ℝ


@[simp]
theorem idRel_subset {s : Set (α × α)} : idRel ⊆ s ↔ ∀ a, (a, a) ∈ s


@[reassoc (attr := simp)]
theorem d_squared_apply {x : β} : X.d x ≫ X.d _ = 0

(X : CategoryTheory.DifferentialObject ℤ (CategoryTheory.GradedObjectWithShift b V))


theorem zpow_apply_eq_of_apply_apply_eq_self {x : α} (hffx : f (f x) = x) :
    ∀ i : ℤ, (f ^ i) x = x ∨ (f ^ i) x = f x

{α : Type u_1}
{f : Equiv.Perm α}
{x : α}
(hffx : f (f x) = x)
(i : ℤ)


lemma eq_of_measure_of_tendsto_atBot (g : StieltjesFunction) {l : ℝ}
    (hfg : f.measure = g.measure) (hfl : Tendsto f atBot (𝓝 l)) (hgl : Tendsto g atBot (𝓝 l)) :
    f = g

(hfl : Filter.Tendsto (↑f) Filter.atBot (𝓝 l))

(hgl : Filter.Tendsto (↑g) Filter.atBot (𝓝 l))


/-- The same-universe version of `Algebra.lift_rank_le_of_surjective_injective`. -/
theorem rank_le_of_surjective_injective
    (i : R →+* R') (j : S →+* S') (hi : Surjective i) (hj : Injective j)
    (hc : (algebraMap R' S').comp i = j.comp (algebraMap R S)) :
    Module.rank R S ≤ Module.rank R' S'


@[simp]
theorem star_rightMoves : star.RightMoves = PUnit

SetTheory.PGame.star.RightMoves = PUnit.{u_1 + 1}


/-- A point is in the inf of two affine subspaces if and only if it is in both of them. -/
theorem mem_inf_iff (p : P) (s1 s2 : AffineSubspace k P) : p ∈ s1 ⊓ s2 ↔ p ∈ s1 ∧ p ∈ s2

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
(p : P)
(s1 s2 : AffineSubspace k P)


/-- Bijection between a subsemiring `S` and its opposite. -/
@[simps!]
def addEquivOp (S : Subsemiring R) : S ≃+ S.op

(a : { a // (fun x => x ∈ S.toSubmonoid) a })


theorem lowerSemicontinuousAt_ciSup {f : ι → α → δ'}
    (bdd : ∀ᶠ y in 𝓝 x, BddAbove (range fun i => f i y)) (h : ∀ i, LowerSemicontinuousAt (f i) x) :
    LowerSemicontinuousAt (fun x' => ⨆ i, f i x') x

{f : ι → α → δ'}

(bdd : ∀ᶠ (y : α) in 𝓝 x, BddAbove (Set.range fun i => f i y))

(h : ∀ (i : ι), LowerSemicontinuousAt (f i) x)


lemma ContinuousAt.finset_sup_apply (hs : ∀ i ∈ s, ContinuousAt (f i) x) :
    ContinuousAt (fun a ↦ s.sup (f · a)) x

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
{ι : Type u_3}
[SemilatticeSup L]
[OrderBot L]
[ContinuousSup L]
{s : Finset ι}
{f : ι → X → L}
{x : X}
(hs : ∀ i ∈ s, ContinuousAt (f i) x)

ContinuousAt (fun a => s.sup fun x => f x a) x


theorem toList_chain_nonempty :
    ∀ {b} (p : Path a b), p.toList.Chain (fun x y => Nonempty (y ⟶ x)) b

{V : Type u}
[Quiver V]
{a b : V}
(p : Quiver.Path a b)

List.Chain (fun x y => Nonempty (y ⟶ x)) b p.toList


@[to_additive (attr := simp)]
theorem Homeomorph.shearMulRight_symm_coe :
    ⇑(Homeomorph.shearMulRight G).symm = fun z : G × G => (z.1, z.1⁻¹ * z.2)

(G : Type w)
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]

⇑(Homeomorph.shearMulRight G).symm = fun z => (z.1, z.1⁻¹ * z.2)


theorem integral_compLp (L : E →L[𝕜] F) (φ : Lp E p μ) :
    ∫ x, (L.compLp φ) x ∂μ = ∫ x, L (φ x) ∂μ

{X : Type u_1}
{E : Type u_3}
{F : Type u_4}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{𝕜 : Type u_5}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : ℝ≥0∞}
[NormedSpace ℝ F]
(L : E →L[𝕜] F)
(φ : ↥(MeasureTheory.Lp E p μ))

∫ (x : X), ↑↑(L.compLp φ) x ∂μ = ∫ (x : X), L (↑↑φ x) ∂μ


theorem le_inducedOuterMeasure {μ : OuterMeasure α} :
    μ ≤ inducedOuterMeasure m P0 m0 ↔ ∀ (s) (hs : P s), μ s ≤ m s hs

{α : Type u_1}
{P : Set α → Prop}
{m : (s : Set α) → P s → ℝ≥0∞}
{P0 : P ∅}
{m0 : m ∅ P0 = 0}
{μ : MeasureTheory.OuterMeasure α}

μ ≤ MeasureTheory.inducedOuterMeasure m P0 m0 ↔ ∀ (s : Set α) (hs : P s), μ s ≤ m s hs


@[simp]
lemma smul_pos_iff_of_pos_left [PosSMulStrictMono α β] [PosSMulReflectLT α β] (ha : 0 < a) :
    0 < a • b ↔ 0 < b

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Zero α]
[Zero β]
[SMulZeroClass α β]
[Preorder α]
[Preorder β]
[PosSMulStrictMono α β]
[PosSMulReflectLT α β]
(ha : 0 < a)


theorem NoZeroSMulDivisors.int_of_charZero
    (R) (M) [Ring R] [AddCommGroup M] [Module R M] [NoZeroSMulDivisors R M] [CharZero R] :
    NoZeroSMulDivisors ℤ M

(R : Type u_9)
(M : Type u_10)
[Ring R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
[CharZero R]


theorem stableUnderBaseChange (hP' : Q.StableUnderBaseChange) :
    P.StableUnderBaseChange

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}


theorem le_inf_const_le : a ≤ s.inf fun _ => a

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
{s : Finset β}
{a : α}


lemma abs_lt_of_sq_lt_sq (h : a ^ 2 < b ^ 2) (hb : 0 ≤ b) : |a| < b

{α : Type u_1}
[LinearOrderedRing α]
{a b : α}
(h : a ^ 2 < b ^ 2)
(hb : 0 ≤ b)


theorem incidenceFinset_eq_filter [DecidableEq V] [Fintype G.edgeSet] :
    G.incidenceFinset v = G.edgeFinset.filter (Membership.mem v)

{V : Type u_1}
(G : SimpleGraph V)
(v : V)
[Fintype ↑(G.neighborSet v)]
[DecidableEq V]
[Fintype ↑G.edgeSet]

G.incidenceFinset v = Finset.filter (Membership.mem v) G.edgeFinset


theorem dist_le_iff_dist_coe_center_le :
    dist z w ≤ r ↔ dist (z : ℂ) (w.center r) ≤ w.im * Real.sinh r

dist z w ≤ r ↔ dist ↑z ↑(w.center r) ≤ w.im * Real.sinh r


theorem ext_ker {φ ψ : characterSpace 𝕜 A} (h : RingHom.ker φ = RingHom.ker ψ) : φ = ψ

{𝕜 : Type u_1}
{A : Type u_2}
[CommRing 𝕜]
[NoZeroDivisors 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[TopologicalSpace A]
[Ring A]
[Algebra 𝕜 A]
{φ ψ : ↑(WeakDual.characterSpace 𝕜 A)}
(h : RingHom.ker φ = RingHom.ker ψ)


theorem spanSingleton_mul_inv {x : K} (hx : x ≠ 0) :
    spanSingleton R₁⁰ x * (spanSingleton R₁⁰ x)⁻¹ = 1

(K : Type u_3)
[Field K]
{R₁ : Type u_4}
[CommRing R₁]
[IsDomain R₁]
[Algebra R₁ K]
[IsFractionRing R₁ K]
{x : K}
(hx : x ≠ 0)

FractionalIdeal.spanSingleton R₁⁰ x * (FractionalIdeal.spanSingleton R₁⁰ x)⁻¹ = 1


theorem cos_eq_real_cos_iff_eq_or_eq_neg {θ : Angle} {ψ : ℝ} :
    cos θ = Real.cos ψ ↔ θ = ψ ∨ θ = -ψ


theorem monotone_fst [Preorder α] [LE β] (t c : α ×ₗ β) (h : t ≤ c) :
    (ofLex t).1 ≤ (ofLex c).1

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[LE β]
(t c : Lex (α × β))
(h : t ≤ c)


theorem subtypeDomain_eq_zero_iff {f : α →₀ M} (hf : ∀ x ∈ f.support, p x) :
    f.subtypeDomain p = 0 ↔ f = 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
{p : α → Prop}
{f : α →₀ M}
(hf : ∀ x ∈ f.support, p x)


@[simp]
theorem isEmpty_sigma {α} {E : α → Type*} : IsEmpty (Sigma E) ↔ ∀ a, IsEmpty (E a)

IsEmpty (Sigma E) ↔ ∀ (a : α), IsEmpty (E a)


@[simp]
theorem toLieHom_id : (AlgHom.id R A : A →ₗ⁅R⁆ A) = LieHom.id

{A : Type v}
[Ring A]
{R : Type u}
[CommRing R]
[Algebra R A]


theorem WOppSide.trans {s : AffineSubspace R P} {x y z : P} (hxy : s.WOppSide x y)
    (hyz : s.WOppSide y z) (hy : y ∉ s) : s.WSameSide x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(hxy : s.WOppSide x y)
(hyz : s.WOppSide y z)
(hy : y ∉ s)


@[to_additive (attr := simp)]
theorem pow_right (h : Commute a b) (n : ℕ) : Commute a (b ^ n)

{M : Type u_2}
[Monoid M]
{a b : M}
(h : Commute a b)
(n : ℕ)


@[to_additive (attr := deprecated (since := "2024-01-27"))]
theorem exponent_dvd_of_forall_orderOf_dvd (n : ℕ) (h : ∀ g : G, orderOf g ∣ n) : exponent G ∣ n

(G : Type u)
[Monoid G]
(n : ℕ)
(h : ∀ (g : G), orderOf g ∣ n)


theorem InfPrime.ne_top (ha : InfPrime a) : a ≠ ⊤

{α : Type u_2}
[SemilatticeInf α]
{a : α}
[OrderTop α]
(ha : InfPrime a)


/-- If a function is `C^n` with `1 ≤ n` around a point, and its derivative at that point is given to
us as `f'`, then `f'` is also a strict derivative. -/
theorem ContDiffAt.hasStrictFDerivAt' {f : E' → F'} {f' : E' →L[𝕂] F'} {x : E'}
    (hf : ContDiffAt 𝕂 n f x) (hf' : HasFDerivAt f f' x) (hn : 1 ≤ n) :
    HasStrictFDerivAt f f' x

{n : ℕ∞}
{𝕂 : Type u_1}
[RCLike 𝕂]
{E' : Type u_2}
[NormedAddCommGroup E']
[NormedSpace 𝕂 E']
{F' : Type u_3}
[NormedAddCommGroup F']
[NormedSpace 𝕂 F']
{f : E' → F'}
{f' : E' →L[𝕂] F'}
{x : E'}
(hf : ContDiffAt 𝕂 n f x)
(hf' : HasFDerivAt f f' x)
(hn : 1 ≤ n)


theorem AlgebraicIndependent.mvPolynomialOptionEquivPolynomialAdjoin_C
    (hx : AlgebraicIndependent R x) (r) :
    hx.mvPolynomialOptionEquivPolynomialAdjoin (C r) = Polynomial.C (algebraMap _ _ r)

{ι : Type u_1}
{R : Type u_3}
{A : Type u_5}
{x : ι → A}
[CommRing R]
[CommRing A]
[Algebra R A]
(hx : AlgebraicIndependent R x)
(r : R)

hx.mvPolynomialOptionEquivPolynomialAdjoin (MvPolynomial.C r) =
  Polynomial.C ((algebraMap R ↥(Algebra.adjoin R (Set.range x))) r)


theorem class_of {x : α} : setOf (hs.setoid.Rel x) = s (hs.index x)

{ι : Type u_1}
{α : Type u_2}
{s : ι → Set α}
(hs : IndexedPartition s)
{x : α}


@[simp]
protected theorem isTrail {u v : V} (p : G.Path u v) : (p : G.Walk u v).IsTrail

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(p : G.Path u v)


@[aesop safe 100 apply (rule_sets := [Measurable])]
theorem Measurable.eval {a : δ} {g : α → ∀ a, π a} (hg : Measurable g) :
    Measurable fun x => g x a

{α : Type u_1}
{δ : Type u_4}
{π : δ → Type u_6}
[MeasurableSpace α]
[(a : δ) → MeasurableSpace (π a)]
{a : δ}
{g : α → (a : δ) → π a}
(hg : Measurable g)


theorem uniformity_basis_edist_nnreal :
    (𝓤 α).HasBasis (fun ε : ℝ≥0 => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 < ε }

(𝓤 α).HasBasis (fun ε => 0 < ε) fun ε => {p | edist p.1 p.2 < ↑ε}


theorem exists_cthickening_tendstoUniformlyOn (hf : TendstoLocallyUniformlyOn F f φ U)
    (hF : ∀ᶠ n in φ, DifferentiableOn ℂ (F n) U) (hK : IsCompact K) (hU : IsOpen U) (hKU : K ⊆ U) :
    ∃ δ > 0, cthickening δ K ⊆ U ∧ TendstoUniformlyOn (deriv ∘ F) (cderiv δ f) φ K

(hF : ∀ᶠ (n : ι) in φ, DifferentiableOn ℂ (F n) U)

∃ δ > 0, Metric.cthickening δ K ⊆ U ∧ TendstoUniformlyOn (deriv ∘ F) (Complex.cderiv δ f) φ K


theorem exists_fin_succ {P : Fin (n + 1) → Prop} : (∃ i, P i) ↔ P 0 ∨ ∃ i : Fin n, P i.succ


/-- Auxiliary definition: the universal morphism to the proposed limit cone. -/
@[simps]
def limitConeLift (F : J ⥤ Cat.{v, v}) (s : Cone F) : s.pt ⟶ limitConeX F

(F : CategoryTheory.Functor J CategoryTheory.Cat)

∀ (a : { pt := ↑s.pt, π := { app := fun j => (s.π.app j).obj, naturality := ⋯ } }.pt),
  (CategoryTheory.Cat.HasLimits.limitConeLift F s).obj a =
    CategoryTheory.Limits.limit.lift (F.comp CategoryTheory.Cat.objects)
      { pt := ↑s.pt, π := { app := fun j => (s.π.app j).obj, naturality := ⋯ } } a


/-- An induction principle for the free algebra.

If `C` holds for the `algebraMap` of `r : R` into `FreeAlgebra R X`, the `ι` of `x : X`, and is
preserved under addition and muliplication, then it holds for all of `FreeAlgebra R X`.
-/
@[elab_as_elim, induction_eliminator]
theorem induction {C : FreeAlgebra R X → Prop}
    (h_grade0 : ∀ r, C (algebraMap R (FreeAlgebra R X) r)) (h_grade1 : ∀ x, C (ι R x))
    (h_mul : ∀ a b, C a → C b → C (a * b)) (h_add : ∀ a b, C a → C b → C (a + b))
    (a : FreeAlgebra R X) : C a

(h_grade0 : ∀ (r : R), C ((algebraMap R (FreeAlgebra R X)) r))

(h_grade1 : ∀ (x : X), C (FreeAlgebra.ι R x))

(h_mul : ∀ (a b : FreeAlgebra R X), C a → C b → C (a * b))

(h_add : ∀ (a b : FreeAlgebra R X), C a → C b → C (a + b))


theorem map_smul' (f : V →ₗ[K] V₂) (p : Submodule K V) (a : K) :
    p.map (a • f) = ⨆ _ : a ≠ 0, map f p

{K : Type u_9}
{V : Type u_10}
{V₂ : Type u_11}
[Semifield K]
[AddCommMonoid V]
[Module K V]
[AddCommMonoid V₂]
[Module K V₂]
(f : V →ₗ[K] V₂)
(p : Submodule K V)
(a : K)

Submodule.map (a • f) p = ⨆ (_ : a ≠ 0), Submodule.map f p


theorem divInt_self (a : Rat) : a.num /. a.den = a


theorem Poly.denote_mul (ctx : Context) (k : Nat) (p : Poly) : (p.mul k).denote ctx = k * p.denote ctx

(ctx : Nat.Linear.Context)
(k : Nat)
(p : Nat.Linear.Poly)

Nat.Linear.Poly.denote ctx (Nat.Linear.Poly.mul k p) = k * Nat.Linear.Poly.denote ctx p


@[to_additive (attr := simp)]
protected theorem SemiconjBy.of_map [MulHomClass F M N] (f : F) (hf : Function.Injective f)
    (h : SemiconjBy (f a) (f x) (f y)) : SemiconjBy a x y

{F : Type u_1}
{M : Type u_2}
{N : Type u_3}
[Mul M]
[Mul N]
{a x y : M}
[FunLike F M N]
[MulHomClass F M N]
(f : F)
(hf : Function.Injective ⇑f)
(h : SemiconjBy (f a) (f x) (f y))


theorem LinearIndependent.repr_eq {l : ι →₀ R} {x : span R (range v)}
    (eq : Finsupp.total ι M R v l = ↑x) : hv.repr x = l

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Ring R]
[AddCommGroup M]
[Module R M]
(hv : LinearIndependent R v)
{l : ι →₀ R}
{x : ↥(Submodule.span R (Set.range v))}
(eq : (Finsupp.total ι M R v) l = ↑x)


protected theorem sSup_le {c : Set (E →ₗ.[R] F)} (hc : DirectedOn (· ≤ ·) c) {g : E →ₗ.[R] F}
    (hg : ∀ f ∈ c, f ≤ g) : LinearPMap.sSup c hc ≤ g

(hc : DirectedOn (fun x x_1 => x ≤ x_1) c)


/-- Given an open cover `{ Xᵢ }` of `X` and an open cover `{ Yⱼ }` of `Y`, then
`X ×[Z] Y` is covered by `Xᵢ ×[Z] Yⱼ`. -/
@[simps! J obj map]
def openCoverOfLeftRight (𝒰X : X.OpenCover) (𝒰Y : Y.OpenCover) (f : X ⟶ Z) (g : Y ⟶ Z) :
    (pullback f g).OpenCover

{X Y Z : AlgebraicGeometry.Scheme}
(𝒰X : X.OpenCover)
(𝒰Y : Y.OpenCover)
(f : X ⟶ Z)
(g : Y ⟶ Z)
(ij : 𝒰X.J × 𝒰Y.J)

(AlgebraicGeometry.Scheme.Pullback.openCoverOfLeftRight 𝒰X 𝒰Y f g).map ij =
  CategoryTheory.Limits.pullback.map (𝒰X.map ij.1 ≫ f) (𝒰Y.map ij.2 ≫ g) f g (𝒰X.map ij.1) (𝒰Y.map ij.2) (𝟙 Z) ⋯ ⋯


lemma zero_point [Nontrivial R] : (0 : W'.Point).point = ⟦![1, 1, 0]⟧

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
[Nontrivial R]

WeierstrassCurve.Jacobian.Point.point 0 = ⟦![1, 1, 0]⟧


{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(f : BoundedContinuousFunction α β)


/-- An R-module is projective if it is a direct summand of a free module, or equivalently
  if maps from the module lift along surjections. There are several other equivalent
  definitions. -/
class Module.Projective (R : Type*) [Semiring R] (P : Type*) [AddCommMonoid P] [Module R P] :
    Prop where
  out : ∃ s : P →ₗ[R] P →₀ R, Function.LeftInverse (Finsupp.total P P R id) s

{R : Type u_1}
[Semiring R]
{P : Type u_2}
[AddCommMonoid P]
[Module R P]
[self : Module.Projective R P]

∃ s, Function.LeftInverse ⇑(Finsupp.total P P R id) ⇑s


/-- These are `SlashInvariantForm`s that are holomorphic and zero at infinity. -/
structure CuspForm extends SlashInvariantForm Γ k where
  holo' : MDifferentiable 𝓘(ℂ) 𝓘(ℂ) (toSlashInvariantForm : ℍ → ℂ)
  zero_at_infty' : ∀ A : SL(2, ℤ), IsZeroAtImInfty (toSlashInvariantForm ∣[k] A)

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(self : CuspForm Γ k)

MDifferentiable 𝓘(ℂ, ℂ) 𝓘(ℂ, ℂ) ⇑self.toSlashInvariantForm


@[measurability] lemma measurableSet_discrete (s : Set α) : MeasurableSet s

{α : Type u_1}
[MeasurableSpace α]
[DiscreteMeasurableSpace α]
(s : Set α)


/-- The chosen cokernels and kernels of the limits API give a `RightHomologyData` -/
@[simps]
noncomputable def ofHasCokernelOfHasKernel
    [HasCokernel S.f] [HasKernel (cokernel.desc S.f S.g S.zero)] :
    S.RightHomologyData

[CategoryTheory.Limits.HasKernel (CategoryTheory.Limits.cokernel.desc S.f S.g ⋯)]

(CategoryTheory.ShortComplex.RightHomologyData.ofHasCokernelOfHasKernel S).Q = CategoryTheory.Limits.cokernel S.f


@[to_additive]
theorem mulTSupport_eq_empty_iff {f : X → α} : mulTSupport f = ∅ ↔ f = 1

{X : Type u_1}
{α : Type u_2}
[One α]
[TopologicalSpace X]
{f : X → α}


theorem val_eq (h : v₁.IsEquiv v₂) {r s : R} : v₁ r = v₁ s ↔ v₂ r = v₂ s

{R : Type u_3}
{Γ₀ : Type u_4}
{Γ'₀ : Type u_5}
[LinearOrderedAddCommMonoidWithTop Γ₀]
[LinearOrderedAddCommMonoidWithTop Γ'₀]
[Ring R]
{v₁ : AddValuation R Γ₀}
{v₂ : AddValuation R Γ'₀}
(h : v₁.IsEquiv v₂)
{r s : R}


/-- Map `WithInitial` with respect to a functor `F : C ⥤ D`. -/
@[simps]
def map {D : Type*} [Category D] (F : C ⥤ D) : WithInitial C ⥤ WithInitial D

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
(F : CategoryTheory.Functor C D)
{X Y : CategoryTheory.WithInitial C}
(f : X ⟶ Y)

(CategoryTheory.WithInitial.map F).map f =
  match X, Y, f with
  | CategoryTheory.WithInitial.of x, CategoryTheory.WithInitial.of y, f => F.map (CategoryTheory.WithInitial.down f)
  | CategoryTheory.WithInitial.star, CategoryTheory.WithInitial.of a, x => PUnit.unit
  | CategoryTheory.WithInitial.star, CategoryTheory.WithInitial.star, x => PUnit.unit


/-- `if ... then ... else` characterization of a set of vectors being orthonormal.  (Inner product
equals Kronecker delta.) -/
theorem orthonormal_subtype_iff_ite [DecidableEq E] {s : Set E} :
    Orthonormal 𝕜 (Subtype.val : s → E) ↔ ∀ v ∈ s, ∀ w ∈ s, ⟪v, w⟫ = if v = w then 1 else 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[DecidableEq E]
{s : Set E}

Orthonormal 𝕜 Subtype.val ↔ ∀ v ∈ s, ∀ w ∈ s, ⟪v, w⟫_𝕜 = if v = w then 1 else 0


theorem of_lanLift_comp_iso [HasLeftKanLift f g]
    {x : B} {h : x ⟶ c} [HasLeftKanLift f (h ≫ g)]
    (i : f₊ (h ≫ g) ≅ h ≫ f₊ g)
    (w : lanLiftUnit f (h ≫ g) ≫ i.hom ▷ f = h ◁ lanLiftUnit f g ≫ (α_ _ _ _).inv) :
    LanLift.CommuteWith f g h

[CategoryTheory.Bicategory.HasLeftKanLift f (CategoryTheory.CategoryStruct.comp h g)]

(i :
  CategoryTheory.Bicategory.lanLift f (CategoryTheory.CategoryStruct.comp h g) ≅
    CategoryTheory.CategoryStruct.comp h (CategoryTheory.Bicategory.lanLift f g))

(w :
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.lanLiftUnit f (CategoryTheory.CategoryStruct.comp h g))
      (CategoryTheory.Bicategory.whiskerRight i.hom f) =
    CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.whiskerLeft h (CategoryTheory.Bicategory.lanLiftUnit f g))
      (CategoryTheory.Bicategory.associator h (CategoryTheory.Bicategory.lanLift f g) f).inv)

CategoryTheory.Bicategory.LanLift.CommuteWith f g h


theorem sub_martingale [Preorder E] [CovariantClass E E (· + ·) (· ≤ ·)] (hf : Submartingale f ℱ μ)
    (hg : Martingale g ℱ μ) : Submartingale (f - g) ℱ μ

[CovariantClass E E (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]

(hf : MeasureTheory.Submartingale f ℱ μ)


@[simp]
theorem cancel_right {g₁ g₂ : InfTopHom β γ} {f : InfTopHom α β} (hf : Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Inf α]
[Top α]
[Inf β]
[Top β]
[Inf γ]
[Top γ]
{g₁ g₂ : InfTopHom β γ}
{f : InfTopHom α β}
(hf : Function.Surjective ⇑f)


@[ext]
theorem derivation_ext {D₁ D₂ : Derivation R R[X] A} (h : D₁ X = D₂ X) : D₁ = D₂

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[Module (Polynomial R) A]
{D₁ D₂ : Derivation R (Polynomial R) A}
(h : D₁ Polynomial.X = D₂ Polynomial.X)


@[simp]
theorem adjunction_counit_app_self {X : TopCat} (U : Opens X) :
    U.openEmbedding.isOpenMap.adjunction.counit.app U = eqToHom (by simp)

{X : TopCat}
(U : TopologicalSpace.Opens ↑X)

⋯.adjunction.counit.app U = CategoryTheory.eqToHom ⋯


theorem bsup_lt_ord_of_isRegular {o : Ordinal} {f : ∀ a < o, Ordinal} {c} (hc : IsRegular c)
    (hι : o.card < c) : (∀ i hi, f i hi < c.ord) → Ordinal.bsup o f < c.ord

{f : (a : Ordinal.{max u_2 u_3}) → a < o → Ordinal.{max u_2 u_3}}

(∀ (i : Ordinal.{max u_2 u_3}) (hi : i < o), f i hi < c.ord) → o.bsup f < c.ord


theorem extend_eq_at [T2Space γ] {f : α → γ} {a : α} (hf : ContinuousAt f a) :
    di.extend f (i a) = f a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
{i : α → β}
(di : DenseInducing i)
[TopologicalSpace γ]
[T2Space γ]
{f : α → γ}
{a : α}
(hf : ContinuousAt f a)


theorem sqrt_inv (x : ℝ≥0) : sqrt x⁻¹ = (sqrt x)⁻¹


@[simp]
theorem le_one (a : SignType) : a ≤ 1


/-- If `F : D ⥤ E` is fully faithful, then so is
`(whiskeringRight C D E).obj F : (C ⥤ D) ⥤ C ⥤ E`. -/
@[simps]
def Functor.FullyFaithful.whiskeringRight {F : D ⥤ E} (hF : F.FullyFaithful)
    (C : Type*) [Category C] :
    ((whiskeringRight C D E).obj F).FullyFaithful

{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{F : CategoryTheory.Functor D E}
(hF : F.FullyFaithful)
(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]

∀ {X Y : CategoryTheory.Functor C D}
  (f : ((CategoryTheory.whiskeringRight C D E).obj F).obj X ⟶ ((CategoryTheory.whiskeringRight C D E).obj F).obj Y)
  (X_1 : C), ((hF.whiskeringRight C).preimage f).app X_1 = hF.preimage (f.app X_1)


theorem map_foldl_erase [DecidableEq β] {f : α → β} (finj : Injective f) {l₁ l₂ : List α} :
    map f (foldl List.erase l₁ l₂) = foldl (fun l a => l.erase (f a)) (map f l₁) l₂

{α : Type u}
{β : Type v}
[DecidableEq α]
[DecidableEq β]
{f : α → β}
(finj : Function.Injective f)
{l₁ l₂ : List α}

List.map f (List.foldl List.erase l₁ l₂) = List.foldl (fun l a => l.erase (f a)) (List.map f l₁) l₂


theorem unbounded_range_of_sup_ge {α β : Type u} (r : α → α → Prop) [IsWellOrder α r] (f : β → α)
    (h : type r ≤ sup.{u, u} (typein r ∘ f)) : Unbounded r (range f)

(h : Ordinal.type r ≤ Ordinal.sup (Ordinal.typein r ∘ f))


protected theorem comp {g : β → γ} {f : α → β} (hg : MeasurePreserving g μb μc)
    (hf : MeasurePreserving f μa μb) : MeasurePreserving (g ∘ f) μa μc

(hg : MeasureTheory.MeasurePreserving g μb μc)

(hf : MeasureTheory.MeasurePreserving f μa μb)

MeasureTheory.MeasurePreserving (g ∘ f) μa μc


theorem prevFixed_le {x : α} (hx : f x ≤ x) : ↑(f.prevFixed x hx) ≤ x

{α : Type u}
[CompleteLattice α]
(f : α →o α)
{x : α}
(hx : f x ≤ x)


@[ext]
theorem Algebra.IsPushout.algHom_ext [H : Algebra.IsPushout R S R' S'] {A : Type*} [Semiring A]
    [Algebra R A] {f g : S' →ₐ[R] A} (h₁ : f.comp (toAlgHom R R' S') = g.comp (toAlgHom R R' S'))
    (h₂ : f.comp (toAlgHom R S S') = g.comp (toAlgHom R S S')) : f = g

(h₁ : f.comp (IsScalarTower.toAlgHom R R' S') = g.comp (IsScalarTower.toAlgHom R R' S'))

(h₂ : f.comp (IsScalarTower.toAlgHom R S S') = g.comp (IsScalarTower.toAlgHom R S S'))


@[simp]
theorem differentiable_id' : Differentiable 𝕜 fun x : E => x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]


lemma cfcHom_id :
    cfcHom ha ((ContinuousMap.id R).restrict <| spectrum R a) = a

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
{a : A}
(ha : p a)

(cfcHom ha) (ContinuousMap.restrict (spectrum R a) (ContinuousMap.id R)) = a


/-- If A ≠ B and C ≠ B then ∠ABC = 0 if and only if (dist A C) = abs ((dist A B) - (dist B C)). -/
theorem dist_eq_abs_sub_dist_iff_angle_eq_zero {p1 p2 p3 : P} (hp1p2 : p1 ≠ p2) (hp3p2 : p3 ≠ p2) :
    dist p1 p3 = |dist p1 p2 - dist p3 p2| ↔ ∠ p1 p2 p3 = 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p1 p2 p3 : P}
(hp1p2 : p1 ≠ p2)
(hp3p2 : p3 ≠ p2)

dist p1 p3 = |dist p1 p2 - dist p3 p2| ↔ EuclideanGeometry.angle p1 p2 p3 = 0


theorem add_le_of_le_tsub_right_of_le (h : b ≤ c) (h2 : a ≤ c - b) : a + b ≤ c

[CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


/-- The product σ-algebra is generated from boxes, i.e. `s ×ˢ t` for sets `s : Set α` and
  `t : Set β`. -/
theorem generateFrom_prod :
    generateFrom (image2 (· ×ˢ ·) { s : Set α | MeasurableSet s } { t : Set β | MeasurableSet t }) =
      Prod.instMeasurableSpace

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]

MeasurableSpace.generateFrom (Set.image2 (fun x x_1 => x ×ˢ x_1) {s | MeasurableSet s} {t | MeasurableSet t}) =
  Prod.instMeasurableSpace


/-- The morphism `triangleh φ₁ ⟶ triangleh φ₂` that is induced by a square that
is commutative up to homotopy. -/
@[simps]
noncomputable def trianglehMapOfHomotopy :
    triangleh φ₁ ⟶ triangleh φ₂

{φ₁ : K₁ ⟶ L₁}

{φ₂ : K₂ ⟶ L₂}

(CochainComplex.mappingCone.trianglehMapOfHomotopy H).hom₂ = (HomotopyCategory.quotient C (ComplexShape.up ℤ)).map b


@[to_additive]
theorem continuousOn_zpow {s : Set G} (z : ℤ) : ContinuousOn (fun x => x ^ z) s

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{s : Set G}
(z : ℤ)


@[to_additive]
theorem ofInjective_apply {f : G →* N} (hf : Function.Injective f) {x : G} :
    ↑(ofInjective hf x) = f x

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
(hf : Function.Injective ⇑f)
{x : G}

↑((AddMonoidHom.ofInjective hf) x) = f x


@[simp]
theorem disjoint_cons_left {a : α} {s t : Multiset α} :
    Disjoint (a ::ₘ s) t ↔ a ∉ t ∧ Disjoint s t

{α : Type u_1}
{a : α}
{s t : Multiset α}

(a ::ₘ s).Disjoint t ↔ a ∉ t ∧ s.Disjoint t


theorem le.elim {a b : ℤ} (h : a ≤ b) {P : Prop} (h' : ∀ n : ℕ, a + ↑n = b → P) : P

{a b : ℤ}
(h : a ≤ b)
{P : Prop}
(h' : ∀ (n : ℕ), a + ↑n = b → P)


protected theorem exists_nat_gt {r : ℝ≥0∞} (h : r ≠ ∞) : ∃ n : ℕ, r < n


theorem Surjective.image_surjective (hf : Surjective f) : Surjective (image f)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Surjective f)


private theorem deriv_sq_norm_ne_zero : ‖F.derivative.eval a‖ ^ 2 ≠ 0

(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)

‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2 ≠ 0


@[simp]
theorem lift_lift.{u_1} (a : Cardinal.{u_1}) : lift.{w} (lift.{v} a) = lift.{max v w} a

Cardinal.lift.{w, max v u_1} (Cardinal.lift.{v, u_1} a) = Cardinal.lift.{max v w, u_1} a


@[simp]
theorem neg_fuzzy_zero_iff {x : PGame} : -x ‖ 0 ↔ x ‖ 0


protected theorem measurable [TopologicalSpace ι] [MeasurableSpace ι] [BorelSpace ι]
    [OrderTopology ι] [SecondCountableTopology ι] (hτ : IsStoppingTime f τ) :
    Measurable[hτ.measurableSpace] τ

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
[TopologicalSpace ι]
[MeasurableSpace ι]
[BorelSpace ι]
[OrderTopology ι]
[SecondCountableTopology ι]
(hτ : MeasureTheory.IsStoppingTime f τ)


@[simp]
lemma LeftHomologyData.homologyIso_leftHomologyData [S.HasHomology] :
    S.leftHomologyData.homologyIso = S.leftHomologyIso.symm


@[to_additive (attr := simp)]
lemma map_comp_div [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) (g h : ι → G) :
    f ∘ (g / h) = f ∘ g / f ∘ h

{ι : Type u_1}
{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[AddGroup G]
[SubtractionMonoid H]
[AddMonoidHomClass F G H]
(f : F)
(g h : ι → G)


@[to_additive (attr := simp)]
theorem mk_smul_of_tower_mk (r : M) (x : α) (hx : x ∈ s) :
    r • (⟨x, hx⟩ : s) = ⟨r • x, smul_one_smul N r x ▸ smul_mem _ hx⟩

{S : Type u'}
{M : Type v}
{N : Type u_1}
{α : Type u_2}
[SetLike S α]
[SMul M N]
[SMul M α]
[Monoid N]
[MulAction N α]
[SMulMemClass S N α]
[IsScalarTower M N α]
(s : S)
(r : M)
(x : α)
(hx : x ∈ s)


@[simp] lemma coe_mulLeft₀ {g : G₀} (hg : g ≠ 0) : ⇑(mulLeft₀ g hg) = (g * ·)

{G₀ : Type u_2}
[MeasurableSpace G₀]
[GroupWithZero G₀]
[MeasurableMul G₀]
{g : G₀}
(hg : g ≠ 0)

⇑(MeasurableEquiv.mulLeft₀ g hg) = fun x => g * x


protected theorem iInf {κ : Sort*} {f : κ → Ideal A} (h : ∀ i, (f i).IsHomogeneous 𝒜) :
    (⨅ i, f i).IsHomogeneous 𝒜

(h : ∀ (i : κ), Ideal.IsHomogeneous 𝒜 (f i))


protected theorem sub_left_cancel' (c : α) : c - a ≡ c - b [PMOD p] → a ≡ b [PMOD p]

{α : Type u_1}
[AddCommGroup α]
{p a b : α}
(c : α)


@[to_additive]
theorem prod_multiset_count [DecidableEq α] [CommMonoid α] (s : Multiset α) :
    s.prod = ∏ m ∈ s.toFinset, m ^ s.count m

{α : Type u_3}
[DecidableEq α]
[CommMonoid α]
(s : Multiset α)

s.prod = ∏ m ∈ s.toFinset, m ^ Multiset.count m s


theorem sUnion_inter_sUnion {s t : Set (Set α)} :
    ⋃₀s ∩ ⋃₀t = ⋃ p ∈ s ×ˢ t, (p : Set α × Set α).1 ∩ p.2


theorem Disjoint.mul_apply_eq_iff {σ τ : Perm α} (hστ : Disjoint σ τ) {a : α} :
    (σ * τ) a = a ↔ σ a = a ∧ τ a = a

{α : Type u_1}
{σ τ : Equiv.Perm α}
(hστ : σ.Disjoint τ)
{a : α}


/-- In a linearly ordered field with the order topology, if `f` tends to a negative constant `C` and
`g` tends to `Filter.atBot` then `f * g` tends to `Filter.atTop`. -/
theorem Filter.Tendsto.neg_mul_atBot {C : 𝕜} (hC : C < 0) (hf : Tendsto f l (𝓝 C))
    (hg : Tendsto g l atBot) : Tendsto (fun x => f x * g x) l atTop

{𝕜 : Type u_1}
{α : Type u_2}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{l : Filter α}
{f g : α → 𝕜}
{C : 𝕜}
(hC : C < 0)
(hf : Filter.Tendsto f l (𝓝 C))
(hg : Filter.Tendsto g l Filter.atBot)

Filter.Tendsto (fun x => f x * g x) l Filter.atTop


theorem cond_eq_ite {α} (b : Bool) (t e : α) : cond b t e = if b then t else e

(bif b then t else e) = if b = true then t else e


@[simp]
theorem eventually_eventuallyEq_nhds {f g : X → α} :
    (∀ᶠ y in 𝓝 x, f =ᶠ[𝓝 y] g) ↔ f =ᶠ[𝓝 x] g

{X : Type u}
{α : Type u_1}
{x : X}
[TopologicalSpace X]
{f g : X → α}

(∀ᶠ (y : X) in 𝓝 x, f =ᶠ[𝓝 y] g) ↔ f =ᶠ[𝓝 x] g


/-- Reindexing a simplex along an `Equiv` of index types does not change the circumradius. -/
@[simp]
theorem circumradius_reindex {m n : ℕ} (s : Simplex ℝ P m) (e : Fin (m + 1) ≃ Fin (n + 1)) :
    (s.reindex e).circumradius = s.circumradius

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{m n : ℕ}
(s : Affine.Simplex ℝ P m)
(e : Fin (m + 1) ≃ Fin (n + 1))


protected theorem map_sub (f : S →A[R] B) (x y : S) : f (x - y) = f x - f y

(R : Type u_1)
[CommSemiring R]
{S : Type u_3}
[Ring S]
[TopologicalSpace S]
[Algebra R S]
{B : Type u_4}
[Ring B]
[TopologicalSpace B]
[Algebra R B]
(f : S →A[R] B)
(x y : S)


theorem Γ_map_op {X Y : LocallyRingedSpace.{u}} (f : X ⟶ Y) : Γ.map f.op = f.1.c.app (op ⊤)

{X Y : AlgebraicGeometry.LocallyRingedSpace}

AlgebraicGeometry.LocallyRingedSpace.Γ.map f.op = f.val.c.app (Opposite.op ⊤)


theorem Perm.extendDomain_trans (e e' : Perm α') :
    (e.extendDomain f).trans (e'.extendDomain f) = Perm.extendDomain (e.trans e') f

{α' : Type u_1}
{β' : Type u_2}
{p : β' → Prop}
[DecidablePred p]
(f : α' ≃ Subtype p)
(e e' : Equiv.Perm α')

Equiv.trans (e.extendDomain f) (e'.extendDomain f) = Equiv.Perm.extendDomain (Equiv.trans e e') f


lemma EssFiniteType.comp_iff [EssFiniteType R S] :
    EssFiniteType R T ↔ EssFiniteType S T

(R : Type u_1)
(S : Type u_2)
(T : Type u_3)
[CommRing R]
[CommRing S]
[CommRing T]
[Algebra R S]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
[Algebra.EssFiniteType R S]

Algebra.EssFiniteType R T ↔ Algebra.EssFiniteType S T


@[gcongr]
theorem pow_lt_pow_left (h : x < y) (hx : 0 ≤ x) : ∀ {n : ℕ}, n ≠ 0 → x ^ n < y ^ n

{R : Type u_3}
[StrictOrderedSemiring R]
{x y : R}
(h : x < y)
(hx : 0 ≤ x)
{n : ℕ}


/--
The forgetful functor from presheaves of modules over a presheaf of rings `R` to presheaves of
`R(X)`-modules where `X` is an initial object.

The functor is implemented as, on object level `M ↦ (c ↦ M(c))` where the `R(X)`-module structure
on `M(c)` is given by restriction of scalars along the unique morphism `R(c) ⟶ R(X)`; and on
morphism level `(f : M ⟶ N) ↦ (c ↦ f(c))`.
-/
@[simps]
noncomputable def forgetToPresheafModuleCat (X : Cᵒᵖ) (hX : Limits.IsInitial X) :
    PresheafOfModules.{v} R ⥤ Cᵒᵖ ⥤ ModuleCat (R.1.obj X)

(hX : CategoryTheory.Limits.IsInitial X)

∀ {X_1 Y : PresheafOfModules R} (f : X_1 ⟶ Y),
  (PresheafOfModules.forgetToPresheafModuleCat X hX).map f = PresheafOfModules.forgetToPresheafModuleCatMap X hX f


theorem perpBisector_comm (p₁ p₂ : P) : perpBisector p₁ p₂ = perpBisector p₂ p₁

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(p₁ p₂ : P)

AffineSubspace.perpBisector p₁ p₂ = AffineSubspace.perpBisector p₂ p₁


@[simp]
theorem mul_moveLeft_inl {x y : PGame} {i j} :
    (x * y).moveLeft (toLeftMovesMul (Sum.inl (i, j))) =
      x.moveLeft i * y + x * y.moveLeft j - x.moveLeft i * y.moveLeft j

{x y : SetTheory.PGame}
{i : x.LeftMoves}
{j : y.LeftMoves}

(x * y).moveLeft (SetTheory.PGame.toLeftMovesMul (Sum.inl (i, j))) =
  x.moveLeft i * y + x * y.moveLeft j - x.moveLeft i * y.moveLeft j


@[to_additive]
theorem mk_pow (n : ℕ) (a : M) (b : S) : mk a b ^ n = mk (a ^ n) (b ^ n)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
(n : ℕ)
(a : M)
(b : ↥S)

n • AddLocalization.mk a b = AddLocalization.mk (n • a) (n • b)


@[simp]
theorem nodup_powerset {s : Multiset α} : Nodup (powerset s) ↔ Nodup s


theorem volume_face_mul {n} (i : Fin (n + 1)) (I : Box (Fin (n + 1))) :
    (∏ j, ((I.face i).upper j - (I.face i).lower j)) * (I.upper i - I.lower i) =
      ∏ j, (I.upper j - I.lower j)

{n : ℕ}
(i : Fin (n + 1))
(I : BoxIntegral.Box (Fin (n + 1)))

(∏ j : Fin n, ((I.face i).upper j - (I.face i).lower j)) * (I.upper i - I.lower i) =
  ∏ j : Fin (n + 1), (I.upper j - I.lower j)


theorem Iterator.sizeOf_eq (i : String.Iterator) : sizeOf i = i.1.utf8ByteSize - i.2.byteIdx

sizeOf i = i.s.utf8ByteSize - i.i.byteIdx


@[to_additive] lemma inv_sup (a b : α) : (a ⊔ b)⁻¹ = a⁻¹ ⊓ b⁻¹

[CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]

[CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


@[simp]
lemma exact_unop_iff (S : ShortComplex Cᵒᵖ) : S.unop.Exact ↔ S.Exact


theorem coe_mk {X Y : UniformSpaceCat} (f : X → Y) (hf : UniformContinuous f) :
    ((⟨f, hf⟩ : X ⟶ Y) : X → Y) = f

{X Y : UniformSpaceCat}
(f : ↑X → ↑Y)
(hf : UniformContinuous f)


@[simp]
theorem zipWith_eq_nil_iff {f : α → β → γ} {l l'} : zipWith f l l' = [] ↔ l = [] ∨ l' = []

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β → γ}
{l : List α}
{l' : List β}

List.zipWith f l l' = [] ↔ l = [] ∨ l' = []


theorem continuousOn_iff' {f : α → β} {s : Set α} :
    ContinuousOn f s ↔ ∀ t : Set β, IsOpen t → ∃ u, IsOpen u ∧ f ⁻¹' t ∩ s = u ∩ s

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}

ContinuousOn f s ↔ ∀ (t : Set β), IsOpen t → ∃ u, IsOpen u ∧ f ⁻¹' t ∩ s = u ∩ s


@[simp]
theorem filterMap_zero (f : α → Option β) : filterMap f 0 = 0

{α : Type u_1}
{β : Type v}
(f : α → Option β)


theorem map_parallel (f : α → β) (S) : map f (parallel S) = parallel (S.map (map f))

{α : Type u}
{β : Type v}
(f : α → β)
(S : Stream'.WSeq (Computation α))

Computation.map f (Computation.parallel S) = Computation.parallel (Stream'.WSeq.map (Computation.map f) S)


@[simp]
theorem simple_mul_simple_pow (i i' : B) : (s i * s i') ^ M i i' = 1

{B : Type u_1}
{W : Type u_3}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(i i' : B)

(cs.simple i * cs.simple i') ^ M.M i i' = 1


theorem image_minimals_of_rel_iff_rel : f '' minimals r x = minimals s (f '' x)

(hf : ∀ ⦃a a' : α⦄, a ∈ x → a' ∈ x → (r a a' ↔ s (f a) (f a')))


theorem nil_mem_kstar (l : Language α) : [] ∈ l∗


(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(S : Set E)


/-- The head of a vector obtained by prepending is the element prepended. -/
theorem head_cons (a : α) : ∀ v : Vector α n, head (cons a v) = a

{α : Type u}
{n : ℕ}
(a : α)
(v : Mathlib.Vector α n)


@[ext]
lemma ext {M N : ModuleCat.{v} R} {f₁ f₂ : M ⟶ N} (h : ∀ (x : M), f₁ x = f₂ x) : f₁ = f₂

(R : Type u)
[Ring R]
{M N : ModuleCat R}
{f₁ f₂ : M ⟶ N}
(h : ∀ (x : ↑M), f₁ x = f₂ x)


/-- The Frobenius automorphism for a perfect ring. -/
@[simps! apply]
noncomputable def frobeniusEquiv : R ≃+* R

(R : Type u_1)
(p : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]
(a : R)

(frobeniusEquiv R p) a = (frobenius R p) a


@[simp]
theorem toLp_coeFn (f : Lp E p μ) (hf : Memℒp f p μ) : hf.toLp f = f

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
(f : ↥(MeasureTheory.Lp E p μ))
(hf : MeasureTheory.Memℒp (↑↑f) p μ)


/-- A point belongs to the closure of `s` iff its infimum edistance to this set vanishes -/
theorem mem_closure_iff_infEdist_zero : x ∈ closure s ↔ infEdist x s = 0

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{s : Set α}

x ∈ closure s ↔ EMetric.infEdist x s = 0


@[fun_prop]
theorem hasFDerivAt_list_prod_attach' [DecidableEq ι] {l : List ι} {x : {i // i ∈ l} → 𝔸} :
    HasFDerivAt (𝕜 := 𝕜) (fun x ↦ (l.attach.map x).prod)
      (∑ i : Fin l.length, ((l.attach.take i).map x).prod •
        smulRight (proj (l.attach.get (i.cast l.length_attach.symm)))
          ((l.attach.drop (.succ i)).map x).prod) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{ι : Type u_6}
{𝔸 : Type u_7}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
[DecidableEq ι]
{l : List ι}
{x : { i // i ∈ l } → 𝔸}

HasFDerivAt (fun x => (List.map x l.attach).prod)
  (∑ i : Fin l.length,
    (List.map x (List.take (↑i) l.attach)).prod •
      (ContinuousLinearMap.proj (l.attach.get (Fin.cast ⋯ i))).smulRight
        (List.map x (List.drop (↑i).succ l.attach)).prod)
  x


lemma FiniteDimensional.of_fact_finrank_eq_two {K V : Type*} [DivisionRing K]
    [AddCommGroup V] [Module K V] [Fact (finrank K V = 2)] : FiniteDimensional K V

[Fact (FiniteDimensional.finrank K V = 2)]


@[to_additive]
theorem topologicalGroup_iInf {ts' : ι → TopologicalSpace G}
    (h' : ∀ i, @TopologicalGroup G (ts' i) _) : @TopologicalGroup G (⨅ i, ts' i) _

{G : Type w}
{ι : Sort u_1}
[AddGroup G]
{ts' : ι → TopologicalSpace G}
(h' : ∀ (i : ι), TopologicalAddGroup G)


theorem lowerBounds_Icc (h : a ≤ b) : lowerBounds (Icc a b) = Iic a

{α : Type u}
[Preorder α]
{a b : α}
(h : a ≤ b)


/-- Two multiplicative functions `f` and `g` are equal if and only if
they agree on prime powers -/
theorem eq_iff_eq_on_prime_powers [CommMonoidWithZero R] (f : ArithmeticFunction R)
    (hf : f.IsMultiplicative) (g : ArithmeticFunction R) (hg : g.IsMultiplicative) :
    f = g ↔ ∀ p i : ℕ, Nat.Prime p → f (p ^ i) = g (p ^ i)

{R : Type u_1}
[CommMonoidWithZero R]
(f : ArithmeticFunction R)
(hf : f.IsMultiplicative)
(g : ArithmeticFunction R)
(hg : g.IsMultiplicative)

f = g ↔ ∀ (p i : ℕ), Nat.Prime p → f (p ^ i) = g (p ^ i)


theorem sub_mem_iff_right (hx : x ∈ p) : x - y ∈ p ↔ y ∈ p

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
{module_M : Module R M}
(p : Submodule R M)
{x y : M}
(hx : x ∈ p)


private theorem two_pow_succ_sub_one_div_two : (2 ^ (n+1) - 1) / 2 = 2^n - 1


@[simp]
theorem _root_.ProbabilityMeasure.toFiniteMeasure_normalize_eq_self {m0 : MeasurableSpace Ω}
    (μ : ProbabilityMeasure Ω) : μ.toFiniteMeasure.normalize = μ

(μ : MeasureTheory.ProbabilityMeasure Ω)


theorem exp_zsmul (z : ℤ) (x : 𝔸) : exp 𝕂 (z • x) = exp 𝕂 x ^ z

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedDivisionRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(z : ℤ)
(x : 𝔸)

NormedSpace.exp 𝕂 (z • x) = NormedSpace.exp 𝕂 x ^ z


@[to_additive] lemma min_lt_max_of_mul_lt_mul
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    (h : a * b < c * d) : min a b < max c d

[CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]

[CovariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


protected theorem lt_or_gt_of_ne {a b : Nat} (ne : a ≠ b) : a < b ∨ a > b


lemma Produces.single {v w : List (Symbol T g.NT)} (hvw : g.Produces v w) : g.Derives v w

{T : Type uT}
{g : ContextFreeGrammar T}
{v w : List (Symbol T g.NT)}
(hvw : g.Produces v w)


@[to_additive]
theorem srange_top_iff_surjective {N} [Mul N] {f : M →ₙ* N} :
    f.srange = (⊤ : Subsemigroup N) ↔ Function.Surjective f

{M : Type u_1}
[Mul M]
{N : Type u_5}
[Mul N]
{f : M →ₙ* N}


@[simp]
theorem op_le_op_iff {S₁ S₂ : Subring R} : S₁.op ≤ S₂.op ↔ S₁ ≤ S₂

{R : Type u_2}
[Ring R]
{S₁ S₂ : Subring R}


/--
Equality is symmetric: if `a = b` then `b = a`.

Because this is in the `Eq` namespace, if you have a variable `h : a = b`,
`h.symm` can be used as shorthand for `Eq.symm h` as a proof of `b = a`.

For more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)
-/
theorem Eq.symm {α : Sort u} {a b : α} (h : Eq a b) : Eq b a


theorem div_congr {R} [DivisionRing R] {a a' b b' c : R} (_ : a = a') (_ : b = b')
    (_ : a' / b' = c) : (a / b : R) = c

{R : Type u_2}
[DivisionRing R]
{a a' b b' c : R}

a = a' → b = b' → a' / b' = c → a / b = c


@[trans]
theorem OneOneReducible.trans {α β γ} [Primcodable α] [Primcodable β] [Primcodable γ] {p : α → Prop}
    {q : β → Prop} {r : γ → Prop} : p ≤₁ q → q ≤₁ r → p ≤₁ r

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
{p : α → Prop}
{q : β → Prop}
{r : γ → Prop}

p ≤₁ q → q ≤₁ r → p ≤₁ r


theorem HasCountableSeparatingOn.of_subtype {α : Type*} {p : Set α → Prop} {t : Set α}
    {q : Set t → Prop} [h : HasCountableSeparatingOn t q univ]
    (hpq : ∀ U, q U → ∃ V, p V ∧ (↑) ⁻¹' V = U) : HasCountableSeparatingOn α p t

[h : HasCountableSeparatingOn (↑t) q Set.univ]

(hpq : ∀ (U : Set ↑t), q U → ∃ V, p V ∧ Subtype.val ⁻¹' V = U)


nonrec theorem SmoothWithinAt.smul {f : M → 𝕜} {g : M → V} (hf : SmoothWithinAt I 𝓘(𝕜) f s x)
    (hg : SmoothWithinAt I 𝓘(𝕜, V) g s x) : SmoothWithinAt I 𝓘(𝕜, V) (fun p => f p • g p) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
{x : M}
{V : Type u_18}
[NormedAddCommGroup V]
[NormedSpace 𝕜 V]
{f : M → 𝕜}
{g : M → V}
(hf : SmoothWithinAt I 𝓘(𝕜, 𝕜) f s x)
(hg : SmoothWithinAt I 𝓘(𝕜, V) g s x)


theorem dist_le_of_le (hf : HolderWith C r f) {x y : X} {d : ℝ} (hd : dist x y ≤ d) :
    dist (f x) (f y) ≤ C * d ^ (r : ℝ)

{X : Type u_1}
{Y : Type u_2}
[PseudoMetricSpace X]
[PseudoMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
(hf : HolderWith C r f)
{x y : X}
{d : ℝ}
(hd : dist x y ≤ d)


/-- The formula which characterises the output of `ModularCyclotomicCharacter g n`. -/
theorem toFun_spec (g : L ≃+* L) {n : ℕ+} (t : rootsOfUnity n L) :
    g (t : Lˣ) = (t ^ (χ₀ n g).val : Lˣ)

{L : Type u}
[CommRing L]
[IsDomain L]
(g : L ≃+* L)
{n : ℕ+}
(t : ↥(rootsOfUnity n L))

g ↑↑t = ↑(↑t ^ (ModularCyclotomicCharacter.toFun n g).val)


/-- The slit plane includes the open unit ball of radius `1` around `1`. -/
lemma mem_slitPlane_of_norm_lt_one {z : ℂ} (hz : ‖z‖ < 1) : 1 + z ∈ slitPlane


theorem tsum_iUnion_le {ι : Type*} [Fintype ι] (f : α → ℝ≥0∞) (t : ι → Set α) :
    ∑' x : ⋃ i, t i, f x ≤ ∑ i, ∑' x : t i, f x

{α : Type u_1}
{ι : Type u_4}
[Fintype ι]
(f : α → ℝ≥0∞)
(t : ι → Set α)

∑' (x : ↑(⋃ i, t i)), f ↑x ≤ ∑ i : ι, ∑' (x : ↑(t i)), f ↑x


nonrec theorem IsLocalMaxOn.inf (hf : IsLocalMaxOn f s a) (hg : IsLocalMaxOn g s a) :
    IsLocalMaxOn (fun x => f x ⊓ g x) s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SemilatticeInf β]
{f g : α → β}
{a : α}
{s : Set α}
(hf : IsLocalMaxOn f s a)
(hg : IsLocalMaxOn g s a)


theorem gauge_lt_one_of_mem_of_isOpen (hs₂ : IsOpen s) {x : E} (hx : x ∈ s) :
    gauge s x < 1

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
[TopologicalSpace E]
[ContinuousSMul ℝ E]
(hs₂ : IsOpen s)
{x : E}
(hx : x ∈ s)


theorem continuous_inf_rng {t₁ : TopologicalSpace α} {t₂ t₃ : TopologicalSpace β} :
    Continuous[t₁, t₂ ⊓ t₃] f ↔ Continuous[t₁, t₂] f ∧ Continuous[t₁, t₃] f

{α : Type u}
{β : Type v}
{f : α → β}
{t₁ : TopologicalSpace α}
{t₂ t₃ : TopologicalSpace β}

Continuous f ↔ Continuous f ∧ Continuous f


@[simp]
theorem map_exp_atTop : map exp atTop = atTop

Filter.map Real.exp Filter.atTop = Filter.atTop


/-- If the oriented angle between three points is `π / 2`, so is the unoriented angle. -/
theorem angle_eq_pi_div_two_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) :
    ∠ p₁ p₂ p₃ = π / 2

[hd2 : Fact (FiniteDimensional.finrank ℝ V = 2)]


@[simp]
theorem coe_linearEquivTuple : ⇑(linearEquivTuple c₁ c₂) = equivTuple c₁ c₂

⇑(QuaternionAlgebra.linearEquivTuple c₁ c₂) = ⇑(QuaternionAlgebra.equivTuple c₁ c₂)


lemma addMap_eq (P Q : Fin 3 → R) : W'.addMap ⟦P⟧ ⟦Q⟧ = ⟦W'.add P Q⟧

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P Q : Fin 3 → R)


/-- Create a copy of a `PartialEquiv` providing better definitional equalities. -/
@[simps (config := .asFn)]
def copy (e : PartialEquiv α β) (f : α → β) (hf : ⇑e = f) (g : β → α) (hg : ⇑e.symm = g) (s : Set α)
    (hs : e.source = s) (t : Set β) (ht : e.target = t) :
    PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
(f : α → β)
(hf : ↑e = f)
(g : β → α)
(hg : ↑e.symm = g)
(s : Set α)
(hs : e.source = s)
(t : Set β)
(ht : e.target = t)


/-- The weak convergence of finite measures to a nonzero limit can be characterized by the weak
convergence of both their normalized versions (probability measures) and their total masses. -/
theorem tendsto_normalize_iff_tendsto {γ : Type*} {F : Filter γ} {μs : γ → FiniteMeasure Ω}
    (nonzero : μ ≠ 0) :
    Tendsto (fun i => (μs i).normalize) F (𝓝 μ.normalize) ∧
        Tendsto (fun i => (μs i).mass) F (𝓝 μ.mass) ↔
      Tendsto μs F (𝓝 μ)

{μs : γ → MeasureTheory.FiniteMeasure Ω}

Filter.Tendsto (fun i => (μs i).normalize) F (𝓝 μ.normalize) ∧ Filter.Tendsto (fun i => (μs i).mass) F (𝓝 μ.mass) ↔
  Filter.Tendsto μs F (𝓝 μ)


@[simp] lemma sdiff_eq_left : x \ y = x ↔ Disjoint x y

{α : Type u}
{x y : α}
[GeneralizedBooleanAlgebra α]


@[simp]
theorem LinearMap.toMatrixAlgEquiv_toLinAlgEquiv (M : Matrix n n R) :
    LinearMap.toMatrixAlgEquiv v₁ (Matrix.toLinAlgEquiv v₁ M) = M

{R : Type u_1}
[CommSemiring R]
{n : Type u_4}
[Fintype n]
[DecidableEq n]
{M₁ : Type u_5}
[AddCommMonoid M₁]
[Module R M₁]
(v₁ : Basis n R M₁)
(M : Matrix n n R)

(LinearMap.toMatrixAlgEquiv v₁) ((Matrix.toLinAlgEquiv v₁) M) = M


@[simp]
theorem coe_addMonoidHom_id : (id α : α →+ α) = AddMonoidHom.id α

∀ {x : NonAssocSemiring α}, ↑(RingHom.id α) = AddMonoidHom.id α


theorem prod_primeFactorsList : ∀ {n}, n ≠ 0 → List.prod (primeFactorsList n) = n


lemma eval_minpolyDiv_self : (minpolyDiv R x).eval x = aeval x (derivative <| minpoly R x)

{R : Type u_2}
{S : Type u_1}
[CommRing R]
[CommRing S]
[Algebra R S]
{x : S}

Polynomial.eval x (minpolyDiv R x) = (Polynomial.aeval x) (Polynomial.derivative (minpoly R x))


@[to_additive]
theorem continuousAt_inv {x : G} : ContinuousAt Inv.inv x

{G : Type w}
[TopologicalSpace G]
[Neg G]
[ContinuousNeg G]
{x : G}


/-- The forward direction of the equivalence from algebras for the coproduct monad to the under
category.
-/
@[simps]
def algebraToUnder : Monad.Algebra (coprodMonad X) ⥤ Under X

∀ {X_1 Y : (CategoryTheory.coprodMonad X).Algebra} (f : X_1 ⟶ Y),
  (CategoryTheory.algebraToUnder X).map f = CategoryTheory.Under.homMk f.f ⋯


theorem ContDiff.log {n} (hf : ContDiff ℝ n f) (h : ∀ x, f x ≠ 0) :
    ContDiff ℝ n fun x => log (f x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{n : ℕ∞}
(hf : ContDiff ℝ n f)
(h : ∀ (x : E), f x ≠ 0)


/-- Vandermonde's identity -/
theorem Nat.add_choose_eq (m n k : ℕ) :
    (m + n).choose k = ∑ ij ∈ antidiagonal k, m.choose ij.1 * n.choose ij.2

(m + n).choose k = ∑ ij ∈ Finset.antidiagonal k, m.choose ij.1 * n.choose ij.2


theorem tendsto_floor_left' (n : ℤ) :
    Tendsto (fun x => floor x : α → α) (𝓝[<] n) (𝓝 (n - 1))

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
[OrderClosedTopology α]
(n : ℤ)

Filter.Tendsto (fun x => ↑⌊x⌋) (𝓝[<] ↑n) (𝓝 (↑n - 1))


/-- To construct a morphism of costructured arrows,
we need a morphism of the objects underlying the source,
and to check that the triangle commutes.
-/
@[simps!]
def homMk {f f' : CostructuredArrow S T} (g : f.left ⟶ f'.left)
    (w : S.map g ≫ f'.hom = f.hom := by aesop_cat) : f ⟶ f'

{f f' : CategoryTheory.CostructuredArrow S T}

(w : CategoryTheory.CategoryStruct.comp (S.map g) f'.hom = f.hom := by aesop_cat)

(CategoryTheory.CostructuredArrow.homMk g w).left = g


@[to_additive]
theorem mulSupport_const {c : M} (hc : c ≠ 1) : (mulSupport fun _ : α => c) = Set.univ

{α : Type u_1}
{M : Type u_5}
[Zero M]
{c : M}
(hc : c ≠ 0)

(Function.support fun x => c) = Set.univ


/-- A submonoid `H` of `G` determines a submonoid `H.op` of the opposite group `Gᵐᵒᵖ`. -/
@[to_additive (attr := simps) "A additive submonoid `H` of `G` determines an additive submonoid
`H.op` of the opposite group `Gᵐᵒᵖ`."]
def opEquiv : Submonoid M ≃o Submonoid Mᵐᵒᵖ

{M : Type u_2}
[AddZeroClass M]
(x : AddSubmonoid Mᵃᵒᵖ)

(RelIso.symm AddSubmonoid.opEquiv) x = x.unop


@[to_additive]
theorem div_mul_div_comm : a / b * (c / d) = a * c / (b * d)

{α : Type u_1}
[DivisionCommMonoid α]
(a b c d : α)


/-- If M is the midpoint of the segment AB, then ∠AMB = π. -/
theorem angle_midpoint_eq_pi (p1 p2 : P) (hp1p2 : p1 ≠ p2) : ∠ p1 (midpoint ℝ p1 p2) p2 = π

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(p1 p2 : P)
(hp1p2 : p1 ≠ p2)

EuclideanGeometry.angle p1 (midpoint ℝ p1 p2) p2 = π


lemma ConvexOn.pow (hf : ConvexOn 𝕜 s f) (hf₀ : ∀ ⦃x⦄, x ∈ s → 0 ≤ f x) :
    ∀ n, ConvexOn 𝕜 s (f ^ n)

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedCommRing 𝕜]
[LinearOrderedCommRing E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set 𝕜}
[IsScalarTower 𝕜 E E]
[SMulCommClass 𝕜 E E]
{f : 𝕜 → E}
(hf : ConvexOn 𝕜 s f)
(hf₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → 0 ≤ f x)
(n : ℕ)


/-- A point on a line through a point on a sphere equals that point or `secondInter`. -/
theorem Sphere.eq_or_eq_secondInter_of_mem_mk'_span_singleton_iff_mem {s : Sphere P} {p : P}
    (hp : p ∈ s) {v : V} {p' : P} (hp' : p' ∈ AffineSubspace.mk' p (ℝ ∙ v)) :
    p' = p ∨ p' = s.secondInter p v ↔ p' ∈ s

(hp' : p' ∈ AffineSubspace.mk' p (Submodule.span ℝ {v}))


/-- A local minimum of a convex function is a global minimum. -/
theorem IsMinOn.of_isLocalMin_of_convex_univ {f : E → β} {a : E} (h_local_min : IsLocalMin f a)
    (h_conv : ConvexOn ℝ univ f) : ∀ x, f a ≤ f x

{E : Type u_1}
{β : Type u_2}
[AddCommGroup E]
[TopologicalSpace E]
[Module ℝ E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
[OrderedAddCommGroup β]
[Module ℝ β]
[OrderedSMul ℝ β]
{f : E → β}
{a : E}
(h_local_min : IsLocalMin f a)
(h_conv : ConvexOn ℝ Set.univ f)
(x : E)


@[to_additive (attr := simp)]
lemma min_mul_max (a b : α) : min a b * max a b = a * b

{α : Type u_1}
[LinearOrder α]
[AddCommSemigroup α]
(a b : α)


protected theorem im {f : α → 𝕜} (hf : AEStronglyMeasurable f μ) :
    AEStronglyMeasurable (fun x => RCLike.im (f x)) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (fun x => RCLike.im (f x)) μ


/-- A set `s` is connected if and only if
for every cover by a finite collection of open sets that are pairwise disjoint on `s`,
it is contained in one of the members of the collection. -/
theorem isConnected_iff_sUnion_disjoint_open {s : Set α} :
    IsConnected s ↔
      ∀ U : Finset (Set α), (∀ u v : Set α, u ∈ U → v ∈ U → (s ∩ (u ∩ v)).Nonempty → u = v) →
        (∀ u ∈ U, IsOpen u) → (s ⊆ ⋃₀ ↑U) → ∃ u ∈ U, s ⊆ u

{α : Type u}
[TopologicalSpace α]
{s : Set α}

IsConnected s ↔
  ∀ (U : Finset (Set α)),
    (∀ (u v : Set α), u ∈ U → v ∈ U → (s ∩ (u ∩ v)).Nonempty → u = v) → (∀ u ∈ U, IsOpen u) → s ⊆ ⋃₀ ↑U → ∃ u ∈ U, s ⊆ u


/-- The `orthogonalProjectionFn` lies in the given subspace. This
lemma is only intended for use in setting up the bundled version and
should not be used once that is defined. -/
theorem orthogonalProjectionFn_mem {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] (p : P) : orthogonalProjectionFn s p ∈ s

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
(p : P)

EuclideanGeometry.orthogonalProjectionFn s p ∈ s


@[simp]
theorem coeff_truncateFun (x : 𝕎 R) (i : Fin n) : (truncateFun n x).coeff i = x.coeff i

{p n : ℕ}
{R : Type u_1}
(x : 𝕎 R)
(i : Fin n)

TruncatedWittVector.coeff i (WittVector.truncateFun n x) = x.coeff ↑i


lemma Submodule.mem_localized' (x : N) :
    x ∈ Submodule.localized' S p f M' ↔ ∃ m ∈ M', ∃ s : p, IsLocalizedModule.mk' f m s = x

{R : Type u}
(S : Type u')
{M : Type v}
{N : Type v'}
[CommRing R]
[CommRing S]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[Algebra R S]
[Module S N]
[IsScalarTower R S N]
(p : Submonoid R)
[IsLocalization p S]
(f : M →ₗ[R] N)
[IsLocalizedModule p f]
(M' : Submodule R M)
(x : N)

x ∈ Submodule.localized' S p f M' ↔ ∃ m ∈ M', ∃ s, IsLocalizedModule.mk' f m s = x


lemma mul (hf : IsCauSeq abv f) (hg : IsCauSeq abv g) : IsCauSeq abv (f * g)

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f g : ℕ → β}
(hf : IsCauSeq abv f)
(hg : IsCauSeq abv g)


theorem subsingleton_or_nnnorm_symm_pos [RingHomIsometric σ₁₂] (e : E ≃SL[σ₁₂] F) :
    Subsingleton E ∨ 0 < ‖(e.symm : F →SL[σ₂₁] E)‖₊

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{σ₂₁ : 𝕜₂ →+* 𝕜}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[RingHomIsometric σ₂₁]
[RingHomIsometric σ₁₂]
(e : E ≃SL[σ₁₂] F)


lemma sinh_eq_tsum (r : ℝ) : sinh r = ∑' n, r ^ (2 * n + 1) / ↑(2 * n + 1)!


(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)


/-- If `f : R → ℝ` is a nonzero, nonnegative, multiplicatively bounded function, then
  `seminormFromBounded' f 1 = 1`. -/
theorem seminormFromBounded_one (f_ne_zero : f ≠ 0) (f_nonneg : 0 ≤ f)
    (f_mul : ∀ x y : R, f (x * y) ≤ c * f x * f y) :
    seminormFromBounded' f 1 = 1

(f_mul : ∀ (x y : R), f (x * y) ≤ c * f x * f y)


/-- Finite products of analytic functions are analytic -/
theorem Finset.analyticAt_prod {A : Type*} [NormedCommRing A] [NormedAlgebra 𝕜 A]
    {f : α → E → A} {c : E} (N : Finset α) (h : ∀ n ∈ N, AnalyticAt 𝕜 (f n) c) :
    AnalyticAt 𝕜 (fun z ↦ ∏ n ∈ N, f n z) c

{α : Type u_1}
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{A : Type u_9}
[NormedCommRing A]
[NormedAlgebra 𝕜 A]
{f : α → E → A}
{c : E}
(N : Finset α)
(h : ∀ n ∈ N, AnalyticAt 𝕜 (f n) c)

AnalyticAt 𝕜 (fun z => ∏ n ∈ N, f n z) c


@[simp]
theorem eval_comp : (p.comp q).eval x = p.eval (q.eval x)

{R : Type u}
[CommSemiring R]
{p q : R[X]}
{x : R}

Polynomial.eval x (p.comp q) = Polynomial.eval (Polynomial.eval x q) p


@[simp] theorem testBit_or (x y i : Nat) : (x ||| y).testBit i = (x.testBit i || y.testBit i)


/-- The natural isomorphism between functors `G.unop ≅ F.unop` induced by a natural isomorphism
between the original functors `F ≅ G`. -/
@[simps]
protected def unop {F G : Cᵒᵖ ⥤ Dᵒᵖ} (α : F ≅ G) : G.unop ≅ F.unop

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : CategoryTheory.Functor Cᵒᵖ Dᵒᵖ}
(α : F ≅ G)

(CategoryTheory.NatIso.unop α).inv = CategoryTheory.NatTrans.unop α.inv


@[simp]
theorem mapEquiv_symm (g : P ≃ₐ[R] P') :
    ((mapEquiv g).symm : FractionalIdeal S P' ≃+* _) = mapEquiv g.symm

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{P' : Type u_3}
[CommRing P']
[Algebra R P']
(g : P ≃ₐ[R] P')

(FractionalIdeal.mapEquiv g).symm = FractionalIdeal.mapEquiv g.symm


theorem smoothAt_const : SmoothAt I I' (fun _ : M => c) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{x : M}
{c : M'}


@[simp]
theorem coe_of {V : Type u} [AddCommGroup V] [Module k V] (ρ : G →* V →ₗ[k] V) :
    (of ρ : Type u) = V

{k G : Type u}
[CommRing k]
[Monoid G]
{V : Type u}
[AddCommGroup V]
[Module k V]
(ρ : G →* V →ₗ[k] V)


@[to_additive]
theorem coe_div [Div Y] (f g : LocallyConstant X Y) : ⇑(f / g) = f / g

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[Div Y]
(f g : LocallyConstant X Y)


/-- Given `W` is a class of morphisms in a pretriangulated category `C`, this is the condition
that `W` is compatible with the triangulation on `C`. -/
class IsCompatibleWithTriangulation (W : MorphismProperty C)
    extends W.IsCompatibleWithShift ℤ : Prop where
  compatible_with_triangulation (T₁ T₂ : Triangle C)
    (_ : T₁ ∈ distTriang C) (_ : T₂ ∈ distTriang C)
    (a : T₁.obj₁ ⟶ T₂.obj₁) (b : T₁.obj₂ ⟶ T₂.obj₂) (_ : W a) (_ : W b)
    (_ : T₁.mor₁ ≫ b = a ≫ T₂.mor₁) :
      ∃ (c : T₁.obj₃ ⟶ T₂.obj₃) (_ : W c),
        (T₁.mor₂ ≫ c = b ≫ T₂.mor₂) ∧ (T₁.mor₃ ≫ a⟦1⟧' = c ≫ T₂.mor₃)

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T₁ T₂ : CategoryTheory.Pretriangulated.Triangle C)

T₁ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles →
  T₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles →
    ∀ (a : T₁.obj₁ ⟶ T₂.obj₁) (b : T₁.obj₂ ⟶ T₂.obj₂),
      W a →
        W b →
          CategoryTheory.CategoryStruct.comp T₁.mor₁ b = CategoryTheory.CategoryStruct.comp a T₂.mor₁ →
            ∃ c,
              ∃ (_ : W c),
                CategoryTheory.CategoryStruct.comp T₁.mor₂ c = CategoryTheory.CategoryStruct.comp b T₂.mor₂ ∧
                  CategoryTheory.CategoryStruct.comp T₁.mor₃ ((CategoryTheory.shiftFunctor C 1).map a) =
                    CategoryTheory.CategoryStruct.comp c T₂.mor₃


@[to_additive (attr := simp)]
theorem MulHom.toFun_eq_coe [Mul M] [Mul N] (f : M →ₙ* N) : f.toFun = f

{M : Type u_4}
{N : Type u_5}
[Add M]
[Add N]
(f : AddHom M N)


theorem fderiv_mem_iff {f : E → F} {s : Set (E →L[𝕜] F)} {x : E} : fderiv 𝕜 f x ∈ s ↔
    DifferentiableAt 𝕜 f x ∧ fderiv 𝕜 f x ∈ s ∨ ¬DifferentiableAt 𝕜 f x ∧ (0 : E →L[𝕜] F) ∈ s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set (E →L[𝕜] F)}
{x : E}

fderiv 𝕜 f x ∈ s ↔ DifferentiableAt 𝕜 f x ∧ fderiv 𝕜 f x ∈ s ∨ ¬DifferentiableAt 𝕜 f x ∧ 0 ∈ s


@[to_additive]
theorem subset_one_iff_eq : s ⊆ 1 ↔ s = ∅ ∨ s = 1


@[to_additive (attr := simp)]
theorem relindex_top_right : H.relindex ⊤ = H.index

{G : Type u_1}
[Group G]
(H : Subgroup G)


theorem succ_to_nat : ∀ n, (succ n : ℕ) = n + 1


theorem colon_mono (hn : N₁ ≤ N₂) (hp : P₁ ≤ P₂) : N₁.colon P₂ ≤ N₂.colon P₁

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{N₁ N₂ P₁ P₂ : Submodule R M}
(hn : N₁ ≤ N₂)
(hp : P₁ ≤ P₂)


/-- The span of every finite set of polynomials is contained in a `degreeLE n` for some `n`. -/
theorem span_le_degreeLE_of_finite {s : Set R[X]} (s_fin : s.Finite) :
    ∃ n : ℕ, Submodule.span R s ≤ degreeLE R n

{R : Type u}
[Semiring R]
{s : Set R[X]}
(s_fin : s.Finite)

∃ n, Submodule.span R s ≤ Polynomial.degreeLE R ↑n


theorem total_zero_apply (x : α →₀ R) : (Finsupp.total α M R 0) x = 0

{α : Type u_1}
{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
(x : α →₀ R)


theorem isArtinian_of_surjective (f : M →ₗ[R] P) (hf : Function.Surjective f) [IsArtinian R M] :
    IsArtinian R P

{R : Type u_1}
(M : Type u_2)
{P : Type u_3}
[Ring R]
[AddCommGroup M]
[AddCommGroup P]
[Module R M]
[Module R P]
(f : M →ₗ[R] P)
(hf : Function.Surjective ⇑f)
[IsArtinian R M]


/-- In a T1 space, being preperfect is equivalent to having perfect closure. -/
theorem preperfect_iff_perfect_closure [T1Space α] : Preperfect C ↔ Perfect (closure C)

{α : Type u_1}
[TopologicalSpace α]
{C : Set α}
[T1Space α]


@[simp]
theorem refl_apply (m : M) : (refl : M ≃ₗ⁅R,L⁆ M) m = m

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(m : M)


@[to_additive (attr := simp)]
theorem nonempty_inv : s⁻¹.Nonempty ↔ s.Nonempty

{α : Type u_2}
[InvolutiveInv α]
{s : Set α}


@[simp]
theorem coe_mul (f g) : ((f * g : Monoid.End M) : M → M) = f ∘ g

(M : Type u_4)
[MulOneClass M]
(f g : Monoid.End M)


@[to_additive]
theorem mclosure_preimage_le (f : F) (s : Set N) : closure (f ⁻¹' s) ≤ (closure s).comap f

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_5}
[FunLike F M N]
[mc : MonoidHomClass F M N]
(f : F)
(s : Set N)

Submonoid.closure (⇑f ⁻¹' s) ≤ Submonoid.comap f (Submonoid.closure s)


/-- Isomorphic `PresheafedSpace`s have naturally isomorphic presheaves. -/
@[simps]
def sheafIsoOfIso (H : X ≅ Y) : Y.2 ≅ H.hom.base _* X.2

{X Y : AlgebraicGeometry.PresheafedSpace C}

(AlgebraicGeometry.PresheafedSpace.sheafIsoOfIso H).inv =
  TopCat.Presheaf.pushforwardToOfIso ((AlgebraicGeometry.PresheafedSpace.forget C).mapIso H).symm H.inv.c


theorem Rel.sub_left {R : Type uR} [Ring R] {r : R → R → Prop} ⦃a b c : R⦄ (h : Rel r a b) :
    Rel r (a - c) (b - c)

{R : Type uR}
[Ring R]
{r : R → R → Prop}
⦃a b c : R⦄
(h : RingQuot.Rel r a b)


theorem exists_coeff_ne_zero {p : MvPolynomial σ R} (h : p ≠ 0) : ∃ d, coeff d p ≠ 0

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{p : MvPolynomial σ R}
(h : p ≠ 0)


private theorem aux (huv : ∀ x ∈ u, ∃ y ∈ v, IsCompressed (u.erase x) (v.erase y) 𝒜) :
    v = ∅ → u = ∅

(huv : ∀ x ∈ u, ∃ y ∈ v, UV.IsCompressed (u.erase x) (v.erase y) 𝒜)


@[simp] theorem if_true_left  (p : Prop) [h : Decidable p] (f : Bool) :
    (ite p true f) = (p || f)

(if p then true else f) = (decide p || f)


/-- A constant multiplier of the weights in `weightedVSub_of` may be moved outside the sum. -/
theorem weightedVSub_const_smul (w : ι → k) (p : ι → P) (c : k) :
    s.weightedVSub p (c • w) = c • s.weightedVSub p w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p : ι → P)
(c : k)

(s.weightedVSub p) (c • w) = c • (s.weightedVSub p) w


@[to_additive]
theorem inter_smul_union_subset_union : (s₁ ∩ s₂) • (t₁ ∪ t₂) ⊆ s₁ • t₁ ∪ s₂ • t₂

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{s₁ s₂ : Set α}
{t₁ t₂ : Set β}


lemma integral_const_sub (f : X →ᵇ ℝ) (c : ℝ) :
    ∫ x, (const X c - f) x ∂μ = ENNReal.toReal (μ (Set.univ)) • c - ∫ x, f x ∂μ

{X : Type u_1}
[TopologicalSpace X]
[MeasurableSpace X]
[OpensMeasurableSpace X]
{μ : MeasureTheory.Measure X}
[MeasureTheory.IsFiniteMeasure μ]
(f : X →ᵇ ℝ)
(c : ℝ)

∫ (x : X), (BoundedContinuousFunction.const X c - f) x ∂μ = (μ Set.univ).toReal • c - ∫ (x : X), f x ∂μ


theorem one_le_iff_pos {c : Cardinal} : 1 ≤ c ↔ 0 < c


/-- If the index type has cardinality equal to the finite dimension, any two orientations are
equal or negations. -/
theorem eq_or_eq_neg (x₁ x₂ : Orientation R M ι) (h : Fintype.card ι = finrank R M) :
    x₁ = x₂ ∨ x₁ = -x₂

(h : Fintype.card ι = FiniteDimensional.finrank R M)


@[to_additive]
theorem ofQuotientStabilizer_mem_orbit (g) : ofQuotientStabilizer α x g ∈ orbit α x

(α : Type u)
{β : Type v}
[Group α]
[MulAction α β]
(x : β)
(g : α ⧸ MulAction.stabilizer α x)

MulAction.ofQuotientStabilizer α x g ∈ MulAction.orbit α x


theorem continuousOn_pi {ι : Type*} {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    {f : α → ∀ i, π i} {s : Set α} : ContinuousOn f s ↔ ∀ i, ContinuousOn (fun y => f y i) s

{α : Type u_1}
[TopologicalSpace α]
{ι : Type u_7}
{π : ι → Type u_8}
[(i : ι) → TopologicalSpace (π i)]
{f : α → (i : ι) → π i}
{s : Set α}

ContinuousOn f s ↔ ∀ (i : ι), ContinuousOn (fun y => f y i) s


theorem IsBigO.mono (h : f =O[l'] g) (hl : l ≤ l') : f =O[l] g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
{l l' : Filter α}
(h : f =O[l'] g)
(hl : l ≤ l')


@[simp]
theorem mk_mul_mk {x y : α} (hx : 0 ≤ x) (hy : 0 ≤ y) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) * ⟨y, hy⟩ = ⟨x * y, mul_nonneg hx hy⟩

{α : Type u_1}
[MulZeroClass α]
[Preorder α]
[PosMulMono α]
{x y : α}
(hx : 0 ≤ x)
(hy : 0 ≤ y)


@[simp]
theorem diff_union_self {s t : Set α} : s \ t ∪ t = s ∪ t


theorem coe_le_one (x : Ioc (0 : α) 1) : (x : α) ≤ 1

{α : Type u_1}
[StrictOrderedSemiring α]
(x : ↑(Set.Ioc 0 1))


@[simp]
theorem _root_.BoundedContinuousFunction.dist_mkOfCompact (f g : C(α, β)) :
    dist (mkOfCompact f) (mkOfCompact g) = dist f g

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[CompactSpace α]
[MetricSpace β]
(f g : C(α, β))

dist (BoundedContinuousFunction.mkOfCompact f) (BoundedContinuousFunction.mkOfCompact g) = dist f g


theorem prod_quotient_preimage_eq_image [s : Setoid α] (g : Quotient s → β) {h : α → β}
    (Hh : h = g ∘ Quotient.mk'') (r : Set (β × β)) :
    { x : Quotient s × Quotient s | (g x.1, g x.2) ∈ r } =
      (fun a : α × α => (⟦a.1⟧, ⟦a.2⟧)) '' ((fun a : α × α => (h a.1, h a.2)) ⁻¹' r)

{α : Type u_1}
{β : Type u_2}
[s : Setoid α]
(g : Quotient s → β)
{h : α → β}
(Hh : h = g ∘ Quotient.mk'')
(r : Set (β × β))


/-- A projective plane is a nondegenerate configuration in which every pair of lines has
  an intersection point, every pair of points has a line through them,
  and which has three points in general position. -/
class ProjectivePlane extends HasPoints P L, HasLines P L where
  exists_config :
    ∃ (p₁ p₂ p₃ : P) (l₁ l₂ l₃ : L),
      p₁ ∉ l₂ ∧ p₁ ∉ l₃ ∧ p₂ ∉ l₁ ∧ p₂ ∈ l₂ ∧ p₂ ∈ l₃ ∧ p₃ ∉ l₁ ∧ p₃ ∈ l₂ ∧ p₃ ∉ l₃

[self : Configuration.ProjectivePlane P L]

∃ p₁ p₂ p₃ l₁ l₂ l₃, p₁ ∉ l₂ ∧ p₁ ∉ l₃ ∧ p₂ ∉ l₁ ∧ p₂ ∈ l₂ ∧ p₂ ∈ l₃ ∧ p₃ ∉ l₁ ∧ p₃ ∈ l₂ ∧ p₃ ∉ l₃


protected theorem rightOrdContinuous : RightOrdContinuous e

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
(e : α ≃o β)


theorem univ_pi_Ioo_ae_eq_Icc {f g : ∀ i, α i} :
    (pi univ fun i => Ioo (f i) (g i)) =ᵐ[Measure.pi μ] Icc f g

{μ : (i : ι) → MeasureTheory.Measure (α i)}

[∀ (i : ι), MeasureTheory.SigmaFinite (μ i)]

[∀ (i : ι), MeasureTheory.NoAtoms (μ i)]

(Set.univ.pi fun i => Set.Ioo (f i) (g i)) =ᵐ[MeasureTheory.Measure.pi μ] Set.Icc f g


@[simp high]
theorem toOuterMeasure_ofFintype_apply : (ofFintype f h).toOuterMeasure s = ∑' x, s.indicator f x

{α : Type u_1}
[Fintype α]
{f : α → ENNReal}
(h : ∑ a : α, f a = 1)
(s : Set α)

(PMF.ofFintype f h).toOuterMeasure s = ∑' (x : α), s.indicator f x


@[simp] lemma den_mk (q : ℚ) (hq : 0 ≤ q) : den ⟨q, hq⟩ = q.den


theorem Monotone.convex_lt (hf : Monotone f) (r : β) : Convex 𝕜 { x | f x ≤ r }

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{f : E → β}
(hf : Monotone f)
(r : β)


theorem comp₂Measurable_toGerm [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β]
    [PseudoMetrizableSpace γ] [SecondCountableTopologyEither β γ]
    [MeasurableSpace γ] [BorelSpace γ] [PseudoMetrizableSpace δ] [SecondCountableTopology δ]
    [MeasurableSpace δ] [OpensMeasurableSpace δ] (g : β → γ → δ) (hg : Measurable (uncurry g))
    (f₁ : α →ₘ[μ] β) (f₂ : α →ₘ[μ] γ) :
    (comp₂Measurable g hg f₁ f₂).toGerm = f₁.toGerm.map₂ g f₂.toGerm

(g : β → γ → δ)

(f₁ : α →ₘ[μ] β)

(f₂ : α →ₘ[μ] γ)

(MeasureTheory.AEEqFun.comp₂Measurable g hg f₁ f₂).toGerm = Filter.Germ.map₂ g f₁.toGerm f₂.toGerm


@[simp] lemma isUpperSet_ofEquiv_preimage [AlexandrovDiscrete α] {s : Set α} :
  IsUpperSet (ofEquiv ⁻¹' s) ↔ IsOpen s

{α : Type u_1}
[TopologicalSpace α]
[AlexandrovDiscrete α]
{s : Set α}

IsUpperSet (⇑Specialization.ofEquiv ⁻¹' s) ↔ IsOpen s


theorem mdifferentiableAt_iff (f : M → M') (x : M) :
    MDifferentiableAt I I' f x ↔ ContinuousAt f x ∧
    DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I' x f) (range I) ((extChartAt I x) x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
(f : M → M')
(x : M)

MDifferentiableAt I I' f x ↔
  ContinuousAt f x ∧ DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I' x f) (Set.range ↑I) (↑(extChartAt I x) x)


@[simp]
theorem Dart.edge_comp_symm : Dart.edge ∘ Dart.symm = (Dart.edge : G.Dart → Sym2 V)

SimpleGraph.Dart.edge ∘ SimpleGraph.Dart.symm = SimpleGraph.Dart.edge


@[simp]
theorem lcm_eq_one_iff [NormalizedGCDMonoid α] (a b : α) : lcm a b = 1 ↔ a ∣ 1 ∧ b ∣ 1

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
(a b : α)


theorem inv_mul' (u : G₀ˣ) : (u⁻¹ : G₀) * u = 1

{G₀ : Type u_3}
[GroupWithZero G₀]
(u : G₀ˣ)


@[reassoc]
lemma stalkMap_germ (U : Y.Opens) (x : f ⁻¹ᵁ U) :
    Y.presheaf.germ ⟨f.val.base x.val, x.property⟩ ≫ f.stalkMap x =
      f.app U ≫ X.presheaf.germ x

(x : ↥((TopologicalSpace.Opens.map f.val.base).obj U))

Y.presheaf.germ ⟨f.val.base ↑x, ⋯⟩ ≫ AlgebraicGeometry.Scheme.Hom.stalkMap f ↑x =
  AlgebraicGeometry.Scheme.Hom.app f U ≫ X.presheaf.germ x


theorem Tendsto.prod_atTop [SemilatticeSup α] [SemilatticeSup γ] {f g : α → γ}
    (hf : Tendsto f atTop atTop) (hg : Tendsto g atTop atTop) :
    Tendsto (Prod.map f g) atTop atTop

(hf : Filter.Tendsto f Filter.atTop Filter.atTop)

(hg : Filter.Tendsto g Filter.atTop Filter.atTop)

Filter.Tendsto (Prod.map f g) Filter.atTop Filter.atTop


@[simp]
theorem zeroRootSubalgebra_normalizer_eq_self :
    (zeroRootSubalgebra R L H).normalizer = zeroRootSubalgebra R L H

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(H : LieSubalgebra R L)
[LieAlgebra.IsNilpotent R ↥H]

(LieAlgebra.zeroRootSubalgebra R L H).normalizer = LieAlgebra.zeroRootSubalgebra R L H


/-- The second projection of a product is a non-unital alg_hom. -/
@[simps]
def snd : A × B →ₙₐ[R] B

(R : Type u)
[Monoid R]
(A : Type v)
(B : Type w)
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
(self : A × B)

(NonUnitalAlgHom.snd R A B) self = self.2


@[to_additive]
theorem finprod_eq_prod_of_mulSupport_subset (f : α → M) {s : Finset α} (h : mulSupport f ⊆ s) :
    ∏ᶠ i, f i = ∏ i ∈ s, f i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
(f : α → M)
{s : Finset α}
(h : Function.support f ⊆ ↑s)


theorem prod_rpow_of_nonneg {ι} {s : Finset ι} {f : ι → ℝ≥0∞} {r : ℝ} (hr : 0 ≤ r) :
    ∏ i ∈ s, f i ^ r = (∏ i ∈ s, f i) ^ r

{ι : Type u_1}
{s : Finset ι}
{f : ι → ℝ≥0∞}
{r : ℝ}
(hr : 0 ≤ r)


/-- The sum of the `k` initial terms of the Liouville number to base `m` is a ratio of natural
numbers where the denominator is `m ^ k!`. -/
theorem partialSum_eq_rat {m : ℕ} (hm : 0 < m) (k : ℕ) :
    ∃ p : ℕ, partialSum m k = p / ((m ^ k ! :) : ℝ)

∃ p, LiouvilleNumber.partialSum (↑m) k = ↑p / ↑(m ^ k !)


theorem le_coe_iff (x : PartENat) (n : ℕ) : x ≤ n ↔ ∃ h : x.Dom, x.get h ≤ n


lemma of_iSup_eq_top {ι} (U : ι → X.Opens) (hU : iSup U = ⊤)
    (H : ∀ i, P ((U i).ι ≫ f)) : P f

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}


/-- The equivalence `(∀ i, β i) ≃ β ⋆` when the domain of `β` only contains `⋆` -/
@[simps (config := .asFn)]
def piUnique [Unique α] (β : α → Sort*) : (∀ i, β i) ≃ β default

{α : Sort u}
[Unique α]
(β : α → Sort u_1)


@[to_additive]
theorem prod_empty {α β : Type*} [CommMonoid β] [IsEmpty α] [Fintype α] (f : α → β) :
    ∏ x : α, f x = 1

{α : Type u_9}
{β : Type u_10}
[CommMonoid β]
[IsEmpty α]
[Fintype α]
(f : α → β)


theorem Matrix.Represents.algebraMap (r : R) :
    (algebraMap _ (Matrix ι ι R) r).Represents b (algebraMap _ (Module.End R M) r)

{ι : Type u_1}
[Fintype ι]
{M : Type u_2}
[AddCommGroup M]
{R : Type u_3}
[CommRing R]
[Module R M]
{b : ι → M}
[DecidableEq ι]
(r : R)

Matrix.Represents b ((algebraMap R (Matrix ι ι R)) r) ((algebraMap R (Module.End R M)) r)


theorem add_lt_add {x y z t : EReal} (h1 : x < y) (h2 : z < t) : x + z < y + t


@[simp]
theorem mk_coe (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) : (⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) = f

(h₁ : ∀ (m : R) (x : A), f (m • x) = φ m • f x)

(h₂ : { toFun := ⇑f, map_smul' := h₁ }.toFun 0 = 0)

(h₃ :
  ∀ (x y : A),
    { toFun := ⇑f, map_smul' := h₁ }.toFun (x + y) =
      { toFun := ⇑f, map_smul' := h₁ }.toFun x + { toFun := ⇑f, map_smul' := h₁ }.toFun y)

(h₄ :
  ∀ (x y : A),
    { toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun (x * y) =
      { toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun x *
        { toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun y)

{ toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃, map_mul' := h₄ } = f


theorem exists_normalized {N : ℕ} {τ : ℝ} (a : SatelliteConfig E N τ) (lastc : a.c (last N) = 0)
    (lastr : a.r (last N) = 1) (hτ : 1 ≤ τ) (δ : ℝ) (hδ1 : τ ≤ 1 + δ / 4) (hδ2 : δ ≤ 1) :
    ∃ c' : Fin N.succ → E, (∀ n, ‖c' n‖ ≤ 2) ∧ Pairwise fun i j => 1 - δ ≤ ‖c' i - c' j‖

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{N : ℕ}
{τ : ℝ}
(a : Besicovitch.SatelliteConfig E N τ)
(lastc : a.c (Fin.last N) = 0)
(lastr : a.r (Fin.last N) = 1)
(hτ : 1 ≤ τ)
(δ : ℝ)
(hδ1 : τ ≤ 1 + δ / 4)
(hδ2 : δ ≤ 1)

∃ c', (∀ (n : Fin N.succ), ‖c' n‖ ≤ 2) ∧ Pairwise fun i j => 1 - δ ≤ ‖c' i - c' j‖


theorem mul_sub (h : 0 < c → c < b → a ≠ ∞) : a * (b - c) = a * b - a * c

{a b c : ℝ≥0∞}
(h : 0 < c → c < b → a ≠ ⊤)


@[simp]
theorem nndist_right_midpoint (p₁ p₂ : P) :
    nndist p₂ (midpoint 𝕜 p₁ p₂) = ‖(2 : 𝕜)‖₊⁻¹ * nndist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
[Invertible 2]
(p₁ p₂ : P)

nndist p₂ (midpoint 𝕜 p₁ p₂) = ‖2‖₊⁻¹ * nndist p₁ p₂


theorem natPow_one : Nat.pow a (nat_lit 1) = a


/-- See `intervalIntegrable_rpow` for a version applying to any locally finite measure, but with a
stronger hypothesis on `r`. -/
theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
    IntervalIntegrable (fun x => x ^ r) volume a b

IntervalIntegrable (fun x => x ^ r) MeasureTheory.volume a b


@[simp]
theorem splitOnP_cons (x : α) (xs : List α) :
    (x :: xs).splitOnP p =
      if p x then [] :: xs.splitOnP p else (xs.splitOnP p).modifyHead (cons x)

{α : Type u}
(p : α → Bool)
(x : α)
(xs : List α)

List.splitOnP p (x :: xs) =
  if p x = true then [] :: List.splitOnP p xs else List.modifyHead (List.cons x) (List.splitOnP p xs)


theorem testBit_two_pow (n m : ℕ) : testBit (2 ^ n) m = (n = m)


@[simp]
theorem mk_pow (n : ℕ) (f : CauSeq β abv) : mk f ^ n = mk (f ^ n)

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(n : ℕ)
(f : CauSeq β abv)

CauSeq.Completion.mk f ^ n = CauSeq.Completion.mk (f ^ n)


/-- Turning `p : Submodule R M` into an `S`-submodule gives the same module structure
as turning it into a type and adding a module structure. -/
@[simps (config := { simpRhs := true })]
def restrictScalarsEquiv (p : Submodule R M) : p.restrictScalars S ≃ₗ[R] p

(S : Type u_1)
(R : Type u_2)
(M : Type u_3)
[Semiring R]
[AddCommMonoid M]
[Semiring S]
[Module S M]
[Module R M]
[SMul S R]
[IsScalarTower S R M]
(p : Submodule R M)

∀ (a : ↥p), (Submodule.restrictScalarsEquiv S R M p) a = a


@[simp]
theorem mem_ofOption {a : α} : ∀ {o : Option α}, a ∈ ofOption o ↔ a ∈ o

a ∈ ↑o ↔ a ∈ o


theorem map_volume_mul_left {a : ℝ} (h : a ≠ 0) :
    Measure.map (a * ·) volume = ENNReal.ofReal |a⁻¹| • volume

MeasureTheory.Measure.map (fun x => a * x) MeasureTheory.volume = ENNReal.ofReal |a⁻¹| • MeasureTheory.volume


theorem Kernel.integral_fn_integral_add ⦃f g : β × γ → E⦄ (F : E → E')
    (hf : Integrable f ((κ ⊗ₖ η) a)) (hg : Integrable g ((κ ⊗ₖ η) a)) :
    ∫ x, F (∫ y, f (x, y) + g (x, y) ∂η (a, x)) ∂κ a =
      ∫ x, F (∫ y, f (x, y) ∂η (a, x) + ∫ y, g (x, y) ∂η (a, x)) ∂κ a

{η : ProbabilityTheory.Kernel (α × β) γ}

⦃f g : β × γ → E⦄

(hf : MeasureTheory.Integrable f ((κ ⊗ₖ η) a))

(hg : MeasureTheory.Integrable g ((κ ⊗ₖ η) a))


theorem Finite.map {α β} {s : Set α} : ∀ f : α → β, s.Finite → (f <$> s).Finite

{α β : Type u_1}
{s : Set α}
(f : α → β)


lemma discrim_le_zero_of_nonpos (h : ∀ x : K, a * x * x + b * x + c ≤ 0) : discrim a b c ≤ 0


@[to_additive]
theorem card_dvd_of_injective (f : α →* H) (hf : Function.Injective f) :
    Nat.card α ∣ Nat.card H

{α : Type u_1}
[Group α]
{H : Type u_2}
[Group H]
(f : α →* H)
(hf : Function.Injective ⇑f)


/-- Also see `LinearIndependent.pair_iff'` for a simpler version over fields. -/
lemma LinearIndependent.pair_iff {x y : M} :
    LinearIndependent R ![x, y] ↔ ∀ (s t : R), s • x + t • y = 0 → s = 0 ∧ t = 0

{R : Type u_2}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{x y : M}


theorem foldl_induction' (f : β → α → β) (H : RightCommutative f) (x : β) (q : α → Prop)
    (p : β → Prop) (s : Multiset α) (hpqf : ∀ a b, q a → p b → p (f b a)) (px : p x)
    (q_s : ∀ a ∈ s, q a) : p (foldl f H x s)

(f : β → α → β)

(hpqf : ∀ (a : α) (b : β), q a → p b → p (f b a))


@[simp]
theorem toAlgHom_eq_coe : e.toAlgHom = e

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)


/-- The existence of a left kan lift of `g` along `f`. -/
class HasLeftKanLift (f : b ⟶ a) (g : c ⟶ a) : Prop where mk' ::
  hasInitial : HasInitial <| LeftLift f g

[self : CategoryTheory.Bicategory.HasLeftKanLift f g]

CategoryTheory.Limits.HasInitial (CategoryTheory.Bicategory.LeftLift f g)


theorem areaForm_comp_rightAngleRotation (x y : E) : ω (J x) (J y) = ω x y

[Fact (FiniteDimensional.finrank ℝ E = 2)]

(o.areaForm (o.rightAngleRotation x)) (o.rightAngleRotation y) = (o.areaForm x) y


@[simp, norm_cast] lemma ofENat_top : ofENat ⊤ = ℵ₀


lemma stronglyMeasurable_stieltjesOfMeasurableRat (hf : Measurable f) (x : ℝ) :
    StronglyMeasurable fun a ↦ stieltjesOfMeasurableRat f hf a x

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℚ → ℝ}
(hf : Measurable f)
(x : ℝ)

MeasureTheory.StronglyMeasurable fun a => ↑(ProbabilityTheory.stieltjesOfMeasurableRat f hf a) x


theorem geom_lt {u : ℕ → ℝ} {c : ℝ} (hc : 0 ≤ c) {n : ℕ} (hn : 0 < n)
    (h : ∀ k < n, c * u k < u (k + 1)) : c ^ n * u 0 < u n


theorem Disjoint.pow_disjoint_pow {σ τ : Perm α} (hστ : Disjoint σ τ) (m n : ℕ) :
    Disjoint (σ ^ m) (τ ^ n)

{α : Type u_1}
{σ τ : Equiv.Perm α}
(hστ : σ.Disjoint τ)
(m n : ℕ)


@[to_additive] lemma mulEnergy_mono_right (ht : t₁ ⊆ t₂) : Eₘ[s, t₁] ≤ Eₘ[s, t₂]

{α : Type u_1}
[DecidableEq α]
[Mul α]
{s t₁ t₂ : Finset α}
(ht : t₁ ⊆ t₂)


protected theorem iterate {f : α → α} (hf : LeftOrdContinuous f) (n : ℕ) :
    LeftOrdContinuous f^[n]

{α : Type u}
[Preorder α]
{f : α → α}
(hf : LeftOrdContinuous f)
(n : ℕ)


lemma map_map_assoc (f : M →ₗ[R] Q) (g : N →ₗ[R] S) (h : P →ₗ[R] T) (x : (M ⊗[R] N) ⊗[R] P) :
    map f (map g h) (TensorProduct.assoc R M N P x) =
      TensorProduct.assoc R Q S T (map (map f g) h x)

(x : TensorProduct R (TensorProduct R M N) P)

(TensorProduct.map f (TensorProduct.map g h)) ((TensorProduct.assoc R M N P) x) =
  (TensorProduct.assoc R Q S T) ((TensorProduct.map (TensorProduct.map f g) h) x)


@[to_additive (attr := simp)]
theorem coe_equivMapOfInjective_apply (f : M →* N) (hf : Function.Injective f) (x : S) :
    (equivMapOfInjective S f hf x : N) = f x

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(S : Submonoid M)
(f : M →* N)
(hf : Function.Injective ⇑f)
(x : ↥S)

↑((S.equivMapOfInjective f hf) x) = f ↑x


theorem fromSpec_preimage_basicOpen :
    hU.fromSpec ⁻¹ᵁ X.basicOpen f = PrimeSpectrum.basicOpen f

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)
(f : ↑(X.presheaf.obj (Opposite.op U)))

(TopologicalSpace.Opens.map hU.fromSpec.val.base).obj (X.basicOpen f) = PrimeSpectrum.basicOpen f