@[to_additive Prod.nnnorm_def']
lemma Prod.nnorm_def (x : E × F) : ‖x‖₊ = max ‖x.1‖₊ ‖x.2‖₊

{E : Type u_2}
{F : Type u_3}
[SeminormedGroup E]
[SeminormedGroup F]
(x : E × F)


@[simp, norm_cast]
theorem coe_compl (a : Regular α) : (↑aᶜ : α) = (a : α)ᶜ

{α : Type u_1}
[HeytingAlgebra α]
(a : Heyting.Regular α)


theorem IsTop.mono (ha : IsTop a) (h : a ≤ b) : IsTop b

{α : Type u_1}
[Preorder α]
{a b : α}
(ha : IsTop a)
(h : a ≤ b)


theorem mem_ball_self (h : 0 < ε) : x ∈ ball x ε

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{ε : ℝ≥0∞}
(h : 0 < ε)


/-- `Complex.inv_cpow_eq_ite` with the `ite` on the other side. -/
theorem inv_cpow_eq_ite' (x : ℂ) (n : ℂ) :
    (x ^ n)⁻¹ = if x.arg = π then conj (x⁻¹ ^ conj n) else x⁻¹ ^ n

(x ^ n)⁻¹ = if x.arg = π then (starRingEnd ℂ) (x⁻¹ ^ (starRingEnd ℂ) n) else x⁻¹ ^ n


theorem preimage_inversion_perpBisector (hR : R ≠ 0) (hy : y ≠ c) :
    inversion c R ⁻¹' perpBisector c y = sphere (inversion c R y) (R ^ 2 / dist y c) \ {c}

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{c y : P}
{R : ℝ}
(hR : R ≠ 0)
(hy : y ≠ c)

EuclideanGeometry.inversion c R ⁻¹' ↑(AffineSubspace.perpBisector c y) =
  Metric.sphere (EuclideanGeometry.inversion c R y) (R ^ 2 / dist y c) \ {c}


@[simp]
theorem minFac_one : minFac 1 = 1


@[to_additive (attr := simp)]
protected theorem one_div_mul {r : R} {s t : S} : (1 /ₒ t) * (r /ₒ s) = r /ₒ (s * t)

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{r : R}
{s t : ↥S}


@[simp]
theorem mem_measurableCylinders (t : Set (∀ i, α i)) :
    t ∈ measurableCylinders α ↔ ∃ s S, MeasurableSet S ∧ t = cylinder s S

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → MeasurableSpace (α i)]
(t : Set ((i : ι) → α i))

t ∈ MeasureTheory.measurableCylinders α ↔ ∃ s S, MeasurableSet S ∧ t = MeasureTheory.cylinder s S


@[simp]
theorem sdiff_symmDiff_eq_sup : (a \ b) ∆ b = a ⊔ b

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
(a b : α)


protected theorem fderiv : fderiv 𝕜 iso x = iso

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
(iso : E ≃L[𝕜] F)


theorem Continuous.image_connectedComponentIn_subset [TopologicalSpace β] {f : α → β} {s : Set α}
    {a : α} (hf : Continuous f) (hx : a ∈ s) :
    f '' connectedComponentIn s a ⊆ connectedComponentIn (f '' s) (f a)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
{a : α}
(hf : Continuous f)
(hx : a ∈ s)


theorem sec_snd_ne_zero [Nontrivial R] (hM : M ≤ nonZeroDivisors R) (x : S) :
    ((sec M x).snd : R) ≠ 0

{R : Type u_1}
[CommRing R]
{M : Submonoid R}
{S : Type u_2}
[CommRing S]
[Algebra R S]
[IsLocalization M S]
[Nontrivial R]
(hM : M ≤ nonZeroDivisors R)
(x : S)


protected theorem isometry [SemilinearIsometryClass 𝓕 σ₁₂ E E₂] (f : 𝓕) : Isometry f

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
{𝓕 : Type u_10}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
[FunLike 𝓕 E E₂]
[SemilinearIsometryClass 𝓕 σ₁₂ E E₂]
(f : 𝓕)


theorem nadd_left_cancel : ∀ {a b c}, a ♯ b = a ♯ c → b = c


theorem dvd_gcd_mul_iff_dvd_mul : x ∣ gcd x n * m ↔ x ∣ n * m


lemma toAffine_zero : toAffine W ![1, 1, 0] = 0

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}

WeierstrassCurve.Jacobian.Point.toAffine W ![1, 1, 0] = 0


/-- If `P` respects isos, then `stalkwise P` is local at the target. -/
lemma stalkwiseIsLocalAtTarget_of_respectsIso (hP : RingHom.RespectsIso P) :
    IsLocalAtTarget (stalkwise P)

{P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop}

(hP : RingHom.RespectsIso fun {R S} [CommRing R] [CommRing S] => P)

AlgebraicGeometry.IsLocalAtTarget (AlgebraicGeometry.stalkwise fun {R S} [CommRing R] [CommRing S] => P)


/-- Relation between two elements in `S.arrow`, the data of which
involves a commutative square. -/
@[ext]
structure Arrow.Relation {S : J.Cover X} (I₁ I₂ : S.Arrow) where
  /-- The source of the arrows defining the relation. -/
  Z : C
  /-- The first arrow defining the relation. -/
  g₁ : Z ⟶ I₁.Y
  /-- The second arrow defining the relation. -/
  g₂ : Z ⟶ I₂.Y
  /-- The relation itself. -/
  w : g₁ ≫ I₁.f = g₂ ≫ I₂.f := by aesop_cat

{J : CategoryTheory.GrothendieckTopology C}

CategoryTheory.CategoryStruct.comp self.g₁ I₁.f = CategoryTheory.CategoryStruct.comp self.g₂ I₂.f


@[simp] theorem zero_fst : (0 : X q).1 = 0


@[simp]
theorem mem_reverse_iff {a : α} {s : Cycle α} : a ∈ s.reverse ↔ a ∈ s


@[simp]
theorem preimage_add_const_Iio : (fun x => x + a) ⁻¹' Iio b = Iio (b - a)

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

(fun x => x + a) ⁻¹' Set.Iio b = Set.Iio (b - a)


theorem subset_def {x y : ZFSet.{u}} : x ⊆ y ↔ ∀ ⦃z⦄, z ∈ x → z ∈ y


/-- A choice-free shortcut instance. -/
@[to_additive "A choice-free shortcut instance."]
theorem OrderedCommGroup.to_contravariantClass_right_le (α : Type u) [OrderedCommGroup α] :
    ContravariantClass α α (swap (· * ·)) (· ≤ ·)

ContravariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1


lemma mul_delta_eq_smul_delta {f : ℕ → ℂ} : f * δ = f 1 • δ


theorem subset_iUnion : ∀ (s : ι → Set β) (i : ι), s i ⊆ ⋃ i, s i

{β : Type u_2}
{ι : Sort u_4}
(s : ι → Set β)
(i : ι)


@[to_additive]
theorem mem_sup' : x ∈ s ⊔ t ↔ ∃ (y : s) (z : t), (y : C) * z = x

{C : Type u_6}
[AddCommGroup C]
{s t : AddSubgroup C}
{x : C}


/-- A seminorm on an additive group `G` is a function `f : G → ℝ` that preserves zero, is
subadditive and such that `f (-x) = f x` for all `x`. -/
structure AddGroupSeminorm (G : Type*) [AddGroup G] where
  -- Porting note: can't extend `ZeroHom G ℝ` because otherwise `to_additive` won't work since
  -- we aren't using old structures
  /-- The bare function of an `AddGroupSeminorm`. -/
  protected toFun : G → ℝ
  /-- The image of zero is zero. -/
  protected map_zero' : toFun 0 = 0
  /-- The seminorm is subadditive. -/
  protected add_le' : ∀ r s, toFun (r + s) ≤ toFun r + toFun s
  /-- The seminorm is invariant under negation. -/
  protected neg' : ∀ r, toFun (-r) = toFun r

{G : Type u_7}
[AddGroup G]
(self : AddGroupSeminorm G)
(r s : G)

self.toFun (r + s) ≤ self.toFun r + self.toFun s


theorem exists_eq_aeval' (pb : PowerBasis R S) (y : S) : ∃ f : R[X], y = aeval pb.gen f

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
(pb : PowerBasis R S)
(y : S)


/--
Ring equivalence are isomorphisms in category of semirings
-/
@[simps]
def _root_.RingEquiv.toSemiRingCatIso {X Y : Type u} [Semiring X] [Semiring Y] (e : X ≃+* Y) :
    SemiRingCat.of X ≅ SemiRingCat.of Y


theorem powerlt_aleph0_le (c : Cardinal) : c ^< ℵ₀ ≤ max c ℵ₀


theorem integral_eq_norm_posPart_sub (f : α →₁ₛ[μ] ℝ) : integral f = ‖posPart f‖ - ‖negPart f‖

(f : ↥(MeasureTheory.Lp.simpleFunc ℝ 1 μ))

MeasureTheory.L1.SimpleFunc.integral f =
  ‖MeasureTheory.L1.SimpleFunc.posPart f‖ - ‖MeasureTheory.L1.SimpleFunc.negPart f‖


theorem xn_add (m n) : xn a1 (m + n) = xn a1 m * xn a1 n + d a1 * yn a1 m * yn a1 n

Pell.xn a1 (m + n) = Pell.xn a1 m * Pell.xn a1 n + Pell.d a1 * Pell.yn a1 m * Pell.yn a1 n


@[simp]
theorem mapRange_add {v w : VectorMeasure α M} {f : M →+ N} (hf : Continuous f) :
    (v + w).mapRange f hf = v.mapRange f hf + w.mapRange f hf

{α : Type u_1}
[MeasurableSpace α]
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
{N : Type u_4}
[AddCommMonoid N]
[TopologicalSpace N]
[ContinuousAdd M]
[ContinuousAdd N]
{v w : MeasureTheory.VectorMeasure α M}
{f : M →+ N}
(hf : Continuous ⇑f)


theorem Ideal.isPrime_of_prime {P : Ideal A} (h : Prime P) : IsPrime P

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
{P : Ideal A}
(h : Prime P)


lemma mapBifunctor_triangle :
    (mapBifunctorAssociator associator τ.ρ₁₂ τ.ρ₂₃ X₁ ((single₀ I₂).obj X₂) X₃).hom ≫
    mapBifunctorMapMap G π (𝟙 X₁) (mapBifunctorLeftUnitor F₂ X₂ e₂ τ.p₂₃ τ.h₃ X₃).hom =
      mapBifunctorMapMap G π (mapBifunctorRightUnitor F₁ X₂ e₁ τ.p₁₂ τ.h₁ X₁).hom (𝟙 X₃)

{F₁ : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ C₁)}

{F₂ : CategoryTheory.Functor C₂ (CategoryTheory.Functor C₃ C₃)}

{G : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₃ D)}

(associator : CategoryTheory.bifunctorComp₁₂ F₁ G ≅ CategoryTheory.bifunctorComp₂₃ G F₂)

(e₁ : F₁.flip.obj X₂ ≅ CategoryTheory.Functor.id C₁)

(e₂ : F₂.obj X₂ ≅ CategoryTheory.Functor.id C₃)

[(X₁ : C₁) → CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C₂) (F₁.obj X₁)]

[(X₃ : C₃) → CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C₂) (F₂.flip.obj X₃)]

(τ : CategoryTheory.GradedObject.TriangleIndexData r π)

(X₁ : CategoryTheory.GradedObject I₁ C₁)

(X₃ : CategoryTheory.GradedObject I₃ C₃)

[(((CategoryTheory.GradedObject.mapBifunctor F₁ I₁ I₂).obj X₁).obj
        ((CategoryTheory.GradedObject.single₀ I₂).obj X₂)).HasMap
    τ.p₁₂]

[(((CategoryTheory.GradedObject.mapBifunctor G I₁ I₃).obj
            (CategoryTheory.GradedObject.mapBifunctorMapObj F₁ τ.p₁₂ X₁
              ((CategoryTheory.GradedObject.single₀ I₂).obj X₂))).obj
        X₃).HasMap
    π]

[(((CategoryTheory.GradedObject.mapBifunctor F₂ I₂ I₃).obj ((CategoryTheory.GradedObject.single₀ I₂).obj X₂)).obj
        X₃).HasMap
    τ.p₂₃]

[(((CategoryTheory.GradedObject.mapBifunctor G I₁ I₃).obj X₁).obj
        (CategoryTheory.GradedObject.mapBifunctorMapObj F₂ τ.p₂₃ ((CategoryTheory.GradedObject.single₀ I₂).obj X₂)
          X₃)).HasMap
    π]

[CategoryTheory.GradedObject.HasGoodTrifunctor₁₂Obj F₁ G τ.ρ₁₂ X₁ ((CategoryTheory.GradedObject.single₀ I₂).obj X₂) X₃]

[CategoryTheory.GradedObject.HasGoodTrifunctor₂₃Obj G F₂ τ.ρ₂₃ X₁ ((CategoryTheory.GradedObject.single₀ I₂).obj X₂) X₃]

[(((CategoryTheory.GradedObject.mapBifunctor G I₁ I₃).obj X₁).obj X₃).HasMap π]

(triangle :
  ∀ (X₁ : C₁) (X₃ : C₃),
    CategoryTheory.CategoryStruct.comp (((associator.hom.app X₁).app X₂).app X₃) ((G.obj X₁).map (e₂.hom.app X₃)) =
      (G.map (e₁.hom.app X₁)).app X₃)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.GradedObject.mapBifunctorAssociator associator τ.ρ₁₂ τ.ρ₂₃ X₁
        ((CategoryTheory.GradedObject.single₀ I₂).obj X₂) X₃).hom
    (CategoryTheory.GradedObject.mapBifunctorMapMap G π (CategoryTheory.CategoryStruct.id X₁)
      (CategoryTheory.GradedObject.mapBifunctorLeftUnitor F₂ X₂ e₂ τ.p₂₃ ⋯ X₃).hom) =
  CategoryTheory.GradedObject.mapBifunctorMapMap G π
    (CategoryTheory.GradedObject.mapBifunctorRightUnitor F₁ X₂ e₁ τ.p₁₂ ⋯ X₁).hom (CategoryTheory.CategoryStruct.id X₃)


@[simp]
theorem id_apply (a : α) : BotHom.id α a = a


theorem hasBasis_coLindelof : (coLindelof X).HasBasis IsLindelof compl

(Filter.coLindelof X).HasBasis IsLindelof compl


protected theorem hasDerivWithinAt_aeval (x : 𝕜) (s : Set 𝕜) :
    HasDerivWithinAt (fun x => aeval x q) (aeval x (derivative q)) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{R : Type u_1}
[CommSemiring R]
[Algebra R 𝕜]
(q : R[X])
(x : 𝕜)
(s : Set 𝕜)

HasDerivWithinAt (fun x => (Polynomial.aeval x) q) ((Polynomial.aeval x) (Polynomial.derivative q)) s x


@[simp]
theorem unit_mul_mem_iff_mem {x y : α} (hy : IsUnit y) : y * x ∈ I ↔ x ∈ I

{α : Type u}
[Semiring α]
(I : Ideal α)
{x y : α}
(hy : IsUnit y)


@[simp]
theorem zero_div (a : G₀) : 0 / a = 0

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


@[to_additive (attr := simp)]
theorem mem_mk {s : Subsemigroup M} {x : M} (h_one) : x ∈ mk s h_one ↔ x ∈ s

{M : Type u_1}
[AddZeroClass M]
{s : AddSubsemigroup M}
{x : M}
(h_one : 0 ∈ s.carrier)

x ∈ { toAddSubsemigroup := s, zero_mem' := h_one } ↔ x ∈ s


@[simp]
theorem isMax_top : IsMax (⊤ : α)


@[to_additive addOrderOf_smul_dvd]
theorem orderOf_pow_dvd (n : ℕ) : orderOf (x ^ n) ∣ orderOf x

{G : Type u_1}
[Monoid G]
{x : G}
(n : ℕ)


/-- The equivalence of functor categories given by currying/uncurrying.
-/
@[simps!]
def currying : C ⥤ D ⥤ E ≌ C × D ⥤ E

{C : Type u₂}
[CategoryTheory.Category.{v₂, u₂} C]
{D : Type u₃}
[CategoryTheory.Category.{v₃, u₃} D]
{E : Type u₄}
[CategoryTheory.Category.{v₄, u₄} E]

∀ {X Y : CategoryTheory.Functor (C × D) E} (T : X ⟶ Y) (X_1 : C) (Y_1 : D),
  ((CategoryTheory.currying.inverse.map T).app X_1).app Y_1 = T.app (X_1, Y_1)


theorem of_isTerminal {X : C} (h : IsTerminal X) : IsFiltered C

(h : CategoryTheory.Limits.IsTerminal X)


@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x


theorem xor_iff_ne : ∀ {x y : Bool}, xor x y = true ↔ x ≠ y


theorem unop_eq_iff_eq_op {x} {y : α} : unop x = y ↔ x = op y


theorem iUnion_option {ι} (s : Option ι → Set α) : ⋃ o, s o = s none ∪ ⋃ i, s (some i)

{α : Type u_1}
{ι : Type u_11}
(s : Option ι → Set α)


theorem card_image_le [DecidableEq β] : (s.image f).card ≤ s.card

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{f : α → β}
[DecidableEq β]


theorem domRestrict_apply {f : E →ₗ.[R] F} {S : Submodule R E} ⦃x : ↥(S ⊓ f.domain)⦄ ⦃y : f.domain⦄
    (h : (x : E) = y) : f.domRestrict S x = f y

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{f : E →ₗ.[R] F}
{S : Submodule R E}
⦃x : ↥(S ⊓ f.domain)⦄
⦃y : ↥f.domain⦄
(h : ↑x = ↑y)


/-- The forgetful functor from monoid objects to the ambient category. -/
@[simps]
def forget : Mon_ C ⥤ C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
(A : Mon_ C)


theorem norm_im_le_norm (z : K) : ‖im z‖ ≤ ‖z‖


@[to_additive neg_one_zsmul]
lemma zpow_neg_one (x : G) : x ^ (-1 : ℤ) = x⁻¹


@[simp]
theorem sub_im (z w : ℂ) : (z - w).im = z.im - w.im


theorem ContMDiffAt.of_succ {n : ℕ} (h : ContMDiffAt I I' n.succ f x) : ContMDiffAt I I' n f 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}
{n : ℕ}
(h : ContMDiffAt I I' (↑n.succ) f x)


/-- Pointwise supremum of two antitone functions is an antitone function. -/
protected theorem sup [Preorder α] [SemilatticeSup β] {f g : α → β} {s : Set α}
    (hf : AntitoneOn f s) (hg : AntitoneOn g s) : AntitoneOn (f ⊔ g) s

{α : Type u}
{β : Type v}
[Preorder α]
[SemilatticeSup β]
{f g : α → β}
{s : Set α}
(hf : AntitoneOn f s)
(hg : AntitoneOn g s)


@[simp, mfld_simps]
theorem trans_transHomeomorph (e : PartialHomeomorph X Y) (e' : PartialHomeomorph Y Z)
    (f'' : Z ≃ₜ Z') :
    (e.trans e').transHomeomorph f'' = e.trans (e'.transHomeomorph f'')

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
{Z' : Type u_6}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace Z']
(e : PartialHomeomorph X Y)
(e' : PartialHomeomorph Y Z)
(f'' : Z ≃ₜ Z')


@[to_additive (attr := simp)]
theorem mulSupport_one : (mulSupport fun _ : α => (1 : M)) = ∅


@[simp]
theorem intervalIntegrable_id : IntervalIntegrable (fun x => x) μ a b


/-- If `s` is a dense set in a structure `M`, `Substructure.closure L s = ⊤`, then in order to prove
that some predicate `p` holds for all `x : M` it suffices to verify `p x` for `x ∈ s`, and verify
that `p` is preserved under function symbols. -/
@[elab_as_elim]
theorem dense_induction {p : M → Prop} (x : M) {s : Set M} (hs : closure L s = ⊤)
    (Hs : ∀ x ∈ s, p x) (Hfun : ∀ {n : ℕ} (f : L.Functions n), ClosedUnder f (setOf p)) : p x

(hs : (FirstOrder.Language.Substructure.closure L).toFun s = ⊤)

(Hfun : ∀ {n : ℕ} (f : L.Functions n), FirstOrder.Language.ClosedUnder f (setOf p))


@[simp]
theorem const_zero : const 0 = 0

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]


lemma _root_.AEMeasurable.nullMeasurableSet_preimage {f : α → β} {s : Set β}
    (hf : AEMeasurable f μ) (hs : MeasurableSet s) : NullMeasurableSet (f ⁻¹' s) μ

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{f : α → β}
{s : Set β}
(hf : AEMeasurable f μ)
(hs : MeasurableSet s)

MeasureTheory.NullMeasurableSet (f ⁻¹' s) μ


/-- An invariant block is a block -/
theorem IsInvariantBlock.isBlock {B : Set X} (hfB : IsInvariantBlock G B) :
    IsBlock G B

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{B : Set X}
(hfB : MulAction.IsInvariantBlock G B)


@[norm_cast]
theorem coe_pow (a : R) (n : ℕ) : (↑(a ^ n : R) : A) = (a : A) ^ n

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(a : R)
(n : ℕ)


/-- `p → q → p` -/
theorem le_himp : a ≤ b ⇨ a

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
{a b : α}


theorem IsBaseChange.lift_comp (g : M →ₗ[R] Q) : ((h.lift g).restrictScalars R).comp f = g

{R : Type u_1}
{M : Type v₁}
{N : Type v₂}
{S : Type v₃}
[AddCommMonoid M]
[AddCommMonoid N]
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
[Module R M]
[Module R N]
[Module S N]
[IsScalarTower R S N]
{f : M →ₗ[R] N}
(h : IsBaseChange S f)
{Q : Type u_3}
[AddCommMonoid Q]
[Module S Q]
[Module R Q]
[IsScalarTower R S Q]
(g : M →ₗ[R] Q)


theorem natDegree_sum_eq_of_disjoint (f : S → R[X]) (s : Finset S)
    (h : Set.Pairwise { i | i ∈ s ∧ f i ≠ 0 } (Ne on natDegree ∘ f)) :
    natDegree (s.sum f) = s.sup fun i => natDegree (f i)

(h : {i | i ∈ s ∧ f i ≠ 0}.Pairwise (Ne on Polynomial.natDegree ∘ f))

(s.sum f).natDegree = s.sup fun i => (f i).natDegree


lemma even_card_aut_of_not_isUnramified [IsGalois k K] [FiniteDimensional k K]
    (hw : ¬ IsUnramified k w) :
    Even (Fintype.card <| K ≃ₐ[k] K)

(hw : ¬NumberField.InfinitePlace.IsUnramified k w)


@[simp, rclike_simps]
theorem ofRealLI_apply : (ofRealLI : ℝ → K) = ofReal


/-- A module over a division ring is noetherian if and only if
its dimension (as a cardinal) is strictly less than the first infinite cardinal `ℵ₀`.
-/
theorem iff_rank_lt_aleph0 : IsNoetherian K V ↔ Module.rank K V < ℵ₀

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]


theorem coe_toReal {x : EReal} (hx : x ≠ ⊤) (h'x : x ≠ ⊥) : (x.toReal : EReal) = x


theorem get!_cons_succ [Inhabited α] (l : List α) (a : α) (n : Nat) :
    (a::l).get! (n+1) = get! l n

{α : Type u_1}
[Inhabited α]
(l : List α)
(a : α)
(n : Nat)


theorem _root_.Set.infinite_iff_frequently_cofinite {s : Set α} :
    Set.Infinite s ↔ ∃ᶠ x in cofinite, x ∈ s

s.Infinite ↔ ∃ᶠ (x : α) in Filter.cofinite, x ∈ s


/-- A morphism in the arrow category is a commutative square connecting two objects of the arrow
    category. -/
@[simps]
def homMk {f g : Arrow T} {u : f.left ⟶ g.left} {v : f.right ⟶ g.right}
    (w : u ≫ g.hom = f.hom ≫ v) : f ⟶ g

(w : CategoryTheory.CategoryStruct.comp u g.hom = CategoryTheory.CategoryStruct.comp f.hom v)


@[simp]
protected lemma «forall» {p : Additive α → Prop} : (∀ a, p a) ↔ ∀ a, p (ofMul a)

(∀ (a : Additive α), p a) ↔ ∀ (a : α), p (Additive.ofMul a)


lemma hasSmallLocalizedHom_iff_of_isos {X' Y' : C} (e : X ≅ X') (e' : Y ≅ Y') :
    HasSmallLocalizedHom.{w} W X Y ↔ HasSmallLocalizedHom.{w} W X' Y'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(W : CategoryTheory.MorphismProperty C)
{X Y X' Y' : C}
(e : X ≅ X')
(e' : Y ≅ Y')

CategoryTheory.Localization.HasSmallLocalizedHom W X Y ↔ CategoryTheory.Localization.HasSmallLocalizedHom W X' Y'


@[to_additive]
theorem mul_singleton_mem_nhds (a : α) {b : α} (h : s ∈ 𝓝 b) : s * {a} ∈ 𝓝 (b * a)

{α : Type u}
[TopologicalSpace α]
[Group α]
[ContinuousConstSMul αᵐᵒᵖ α]
{s : Set α}
(a : α)
{b : α}
(h : s ∈ 𝓝 b)


@[simp]
theorem nhds_mono {l₁ l₂ : Filter α} : 𝓝 l₁ ≤ 𝓝 l₂ ↔ l₁ ≤ l₂

𝓝 l₁ ≤ 𝓝 l₂ ↔ l₁ ≤ l₂


@[norm_cast]
theorem coe_smul (r : R) (x : p) : ((r • x : p) : M) = r • (x : M)

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
{p : Submodule R M}
(r : R)
(x : ↥p)


@[simp]
theorem diagonal_sub [SubNegZeroMonoid α] (d₁ d₂ : n → α) :
    diagonal d₁ - diagonal d₂ = diagonal fun i => d₁ i - d₂ i

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[SubNegZeroMonoid α]
(d₁ d₂ : n → α)

Matrix.diagonal d₁ - Matrix.diagonal d₂ = Matrix.diagonal fun i => d₁ i - d₂ i


/-- For a field extension `L/K`, the intermediate field `K` is finite-dimensional over `K` -/
theorem IntermediateField.finiteDimensional_bot (K L : Type*) [Field K] [Field L] [Algebra K L] :
    FiniteDimensional K (⊥ : IntermediateField K L)

(K : Type u_1)
(L : Type u_2)
[Field K]
[Field L]
[Algebra K L]


protected theorem div_le_iff_le_mul (hb0 : b ≠ 0 ∨ c ≠ ∞) (hbt : b ≠ ∞ ∨ c ≠ 0) :
    a / b ≤ c ↔ a ≤ c * b

{a b c : ENNReal}
(hb0 : b ≠ 0 ∨ c ≠ ⊤)
(hbt : b ≠ ⊤ ∨ c ≠ 0)


theorem isLinearMap_neg : IsLinearMap R fun z : M ↦ -z

{R : Type u_1}
{M : Type u_9}
[Semiring R]
[AddCommGroup M]
[Module R M]


lemma prod_swap : (μ.prod ν).map Prod.swap = ν.prod μ

{α : Type u_1}
[MeasurableSpace α]
{β : Type u_2}
[MeasurableSpace β]
(μ : MeasureTheory.FiniteMeasure α)
(ν : MeasureTheory.FiniteMeasure β)


@[to_additive min_le_of_add_le_two_nsmul]
theorem min_le_of_mul_le_sq {a b c : M} (h : a * b ≤ c ^ 2) : min a b ≤ c

[CovariantClass M M (fun x x_1 => x + x_1) fun x x_1 => x < x_1]

[CovariantClass M M (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1]


theorem one_gradedMul (x : (⨁ i, 𝒜 i) ⊗[R] (⨁ i, ℬ i)) :
    gradedMul R 𝒜 ℬ 1 x = x

((TensorProduct.gradedMul R 𝒜 ℬ) 1) x = x


theorem not_all_eq_any_not (l : List α) (p : α → Bool) : (!l.all p) = l.any fun a => !p a

{α : Type u_1}
(l : List α)
(p : α → Bool)


theorem ball_add_ball_subset (p : Seminorm 𝕜 E) (r₁ r₂ : ℝ) (x₁ x₂ : E) :
    p.ball (x₁ : E) r₁ + p.ball (x₂ : E) r₂ ⊆ p.ball (x₁ + x₂) (r₁ + r₂)

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

p.ball x₁ r₁ + p.ball x₂ r₂ ⊆ p.ball (x₁ + x₂) (r₁ + r₂)


theorem ContDiffAt.norm (hf : ContDiffAt ℝ n f x) (h0 : f x ≠ 0) :
    ContDiffAt ℝ n (fun y => ‖f y‖) x

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f : G → E}
{x : G}
{n : ℕ∞}
(hf : ContDiffAt ℝ n f x)
(h0 : f x ≠ 0)


lemma exp_sub_sum_range_isBigO_pow (n : ℕ) :
    (fun x ↦ exp x - ∑ i ∈ Finset.range n, x ^ i / i !) =O[𝓝 0] (· ^ n)

(fun x => Complex.exp x - ∑ i ∈ Finset.range n, x ^ i / ↑i !) =O[𝓝 0] fun x => x ^ n


/-- The cardinality of `X` is `q^2`. -/
theorem card_eq : Fintype.card (X q) = q ^ 2


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) toDual_smul]
theorem toDual_pow [Pow α β] (a : α) (b : β) : toDual (a ^ b) = toDual a ^ b

{β : Type u_2}
{α : Type u_1}
[VAdd β α]
(b : β)
(a : α)

OrderDual.toDual (b +ᵥ a) = b +ᵥ OrderDual.toDual a


@[simp] theorem range_zero : range 0 = []


@[simp]
theorem minFac_eq_one_iff {n : ℕ} : minFac n = 1 ↔ n = 1


@[to_additive]
theorem comp_mulIndicator_const (c : M) (f : M → N) (hf : f 1 = 1) :
    (fun x => f (s.mulIndicator (fun _ => c) x)) = s.mulIndicator fun _ => f c

{α : Type u_1}
{M : Type u_4}
{N : Type u_5}
[Zero M]
[Zero N]
{s : Set α}
(c : M)
(f : M → N)
(hf : f 0 = 0)

(fun x => f (s.indicator (fun x => c) x)) = s.indicator fun x => f c


/-- In a complete space, the sum of a converging power series `p` admits `p` as a power series.
This is not totally obvious as we need to check the convergence of the series. -/
protected theorem FormalMultilinearSeries.hasFPowerSeriesOnBall [CompleteSpace F]
    (p : FormalMultilinearSeries 𝕜 E F) (h : 0 < p.radius) :
    HasFPowerSeriesOnBall p.sum p 0 p.radius

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
(p : FormalMultilinearSeries 𝕜 E F)
(h : 0 < p.radius)


@[simp]
theorem rTensorBot_tmul (x : R) (a : A) : A.rTensorBot (a ⊗ₜ[R] algebraMap R _ x) = x • a

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{A : Subalgebra R S}
(x : R)
(a : ↥A)

A.rTensorBot (a ⊗ₜ[R] (algebraMap R ↥⊥) x) = x • a


theorem coeff_monomial_zero_mul (p : R[X]) (d : ℕ) (r : R) :
    coeff (monomial 0 r * p) d = r * coeff p d

{R : Type u}
[Semiring R]
(p : R[X])
(d : ℕ)
(r : R)

((Polynomial.monomial 0) r * p).coeff d = r * p.coeff d


@[simp]
theorem ofDual_sup [SemilatticeInf α] [OrderTop α] (s : Finset β) (f : β → αᵒᵈ) :
    ofDual (s.sup f) = s.inf (ofDual ∘ f)

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
(s : Finset β)
(f : β → αᵒᵈ)

OrderDual.ofDual (s.sup f) = s.inf (⇑OrderDual.ofDual ∘ f)


theorem of_not_le_right [LE α] (h : ¬(a:α) ≤ b) (eq : b = b') : ¬a ≤ b'

{α : Type u_1}
{a b b' : α}
[LE α]
(h : ¬a ≤ b)
(eq : b = b')


theorem Multiset.sum_smul {l : Multiset R} {x : M} : l.sum • x = (l.map fun r ↦ r • x).sum

{R : Type u_5}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{l : Multiset R}
{x : M}

l.sum • x = (Multiset.map (fun r => r • x) l).sum


theorem concat_inj {u v v' w : V} {p : G.Walk u v} {h : G.Adj v w} {p' : G.Walk u v'}
    {h' : G.Adj v' w} (he : p.concat h = p'.concat h') : ∃ hv : v = v', p.copy rfl hv = p'

{V : Type u}
{G : SimpleGraph V}
{u v v' w : V}
{p : G.Walk u v}
{h : G.Adj v w}
{p' : G.Walk u v'}
{h' : G.Adj v' w}
(he : p.concat h = p'.concat h')


@[simp]
theorem coinduced_sup : (t₁ ⊔ t₂).coinduced f = t₁.coinduced f ⊔ t₂.coinduced f

{α : Type u_1}
{β : Type u_2}
{t₁ t₂ : TopologicalSpace α}
{f : α → β}

TopologicalSpace.coinduced f (t₁ ⊔ t₂) = TopologicalSpace.coinduced f t₁ ⊔ TopologicalSpace.coinduced f t₂


/-- If `f` and `g` agree on large `n : ℕ`, then the `LSeries` of `f` converges at `s`
if and only if that of `g` does. -/
lemma LSeriesSummable_congr' {f g : ℕ → ℂ} (s : ℂ) (h : f =ᶠ[atTop] g) :
    LSeriesSummable f s ↔ LSeriesSummable g s

{f g : ℕ → ℂ}
(s : ℂ)
(h : f =ᶠ[Filter.atTop] g)


theorem eq_negSucc_of_lt_zero : ∀ {a : Int}, a < 0 → ∃ n : Nat, a = -[n+1]


theorem card_le_of_model_distinctConstantsTheory (s : Set α) (M : Type w) [L[[α]].Structure M]
    [h : M ⊨ L.distinctConstantsTheory s] : Cardinal.lift.{w} #s ≤ Cardinal.lift.{u'} #M

(L : FirstOrder.Language)
{α : Type u'}
(s : Set α)
(M : Type w)
[(L.withConstants α).Structure M]
[h : M ⊨ L.distinctConstantsTheory s]

Cardinal.lift.{w, u'} (Cardinal.mk ↑s) ≤ Cardinal.lift.{u', w} (Cardinal.mk M)


theorem IsMaxOn.comp_antitone (hf : IsMaxOn f s a) {g : β → γ} (hg : Antitone g) :
    IsMinOn (g ∘ f) s a

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder β]
[Preorder γ]
{f : α → β}
{s : Set α}
{a : α}
(hf : IsMaxOn f s a)
{g : β → γ}
(hg : Antitone g)


theorem card_nthRoots {n : ℕ} {ζ : R} (hζ : IsPrimitiveRoot ζ n) (a : R) :
    Multiset.card (nthRoots n a) = if ∃ α, α ^ n = a then n else 0

{R : Type u_4}
[CommRing R]
[IsDomain R]
{n : ℕ}
{ζ : R}
(hζ : IsPrimitiveRoot ζ n)
(a : R)

Multiset.card (Polynomial.nthRoots n a) = if ∃ α, α ^ n = a then n else 0


@[to_additive]
lemma iIndepFun.indepFun_mul_right (hf_indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hij : i ≠ j) (hik : i ≠ k) :
    IndepFun (f i) (f j * f k) κ μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.Kernel.iIndepFun (fun x => m) f κ μ)

ProbabilityTheory.Kernel.IndepFun (f i) (f j + f k) κ μ


@[simp, norm_cast] lemma coe_one : ((1 : ℚ≥0) : ℚ) = 1


@[simp]
theorem apply_of_row_ne {i i' : m} (hi : i ≠ i') (j j' : n) (a : α) :
    stdBasisMatrix i j a i' j' = 0

{m : Type u_2}
{n : Type u_3}
{α : Type u_5}
[DecidableEq m]
[DecidableEq n]
[Semiring α]
{i i' : m}
(hi : i ≠ i')
(j j' : n)
(a : α)


theorem integral_comp_sub_div (hc : c ≠ 0) (d) :
    (∫ x in a..b, f (d - x / c)) = c • ∫ x in d - b / c..d - a / c, f x

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b c : ℝ}
(f : ℝ → E)
(hc : c ≠ 0)
(d : ℝ)

∫ (x : ℝ) in a..b, f (d - x / c) = c • ∫ (x : ℝ) in d - b / c..d - a / c, f x


theorem continuousOn_Ioc_extendFrom_Ioo [TopologicalSpace α] [LinearOrder α] [DenselyOrdered α]
    [OrderTopology α] [TopologicalSpace β] [RegularSpace β] {f : α → β} {a b : α} {lb : β}
    (hab : a < b) (hf : ContinuousOn f (Ioo a b)) (hb : Tendsto f (𝓝[<] b) (𝓝 lb)) :
    ContinuousOn (extendFrom (Ioo a b) f) (Ioc a b)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrder α]
[DenselyOrdered α]
[OrderTopology α]
[TopologicalSpace β]
[RegularSpace β]
{f : α → β}
{a b : α}
{lb : β}
(hab : a < b)
(hf : ContinuousOn f (Set.Ioo a b))
(hb : Filter.Tendsto f (𝓝[<] b) (𝓝 lb))

ContinuousOn (extendFrom (Set.Ioo a b) f) (Set.Ioc a b)


@[simp, norm_cast]
lemma _root_.MonoidHom.coe_compAddChar {N : Type*} [Monoid N] (f : M →* N) (φ : AddChar A M) :
    f.compAddChar φ = f ∘ φ

{A : Type u_1}
{M : Type u_3}
[AddMonoid A]
[Monoid M]
{N : Type u_5}
[Monoid N]
(f : M →* N)
(φ : AddChar A M)


lemma even_mul_succ_self (n : ℤ) : Even (n * (n + 1))


@[simp]
theorem diff_empty {s : Set α} : s \ ∅ = s


theorem _root_.Function.Surjective.bijective_of_nat_card_le [Finite α] {f : α → β}
    (surj : Surjective f) (hc : Nat.card α ≤ Nat.card β) : Bijective f

{α : Type u_1}
{β : Type u_2}
[Finite α]
{f : α → β}
(surj : Function.Surjective f)
(hc : Nat.card α ≤ Nat.card β)


theorem MDifferentiableWithinAt.comp (hg : MDifferentiableWithinAt I' I'' g u (f x))
    (hf : MDifferentiableWithinAt I I' f s x) (h : s ⊆ f ⁻¹' u) :
    MDifferentiableWithinAt I I'' (g ∘ f) s x

[I''s : SmoothManifoldWithCorners I'' M'']


theorem id_nonzero (X : C) [Simple.{v} X] : 𝟙 X ≠ 0


theorem forall_prop_domain_congr {p₁ p₂ : Prop} {q₁ : p₁ → Prop} {q₂ : p₂ → Prop}
    (h₁ : p₁ = p₂)
    (h₂ : ∀ a : p₂, q₁ (h₁.substr a) = q₂ a)
    : (∀ a : p₁, q₁ a) = (∀ a : p₂, q₂ a)

{p₁ p₂ : Prop}
{q₁ : p₁ → Prop}
{q₂ : p₂ → Prop}
(h₁ : p₁ = p₂)
(h₂ : ∀ (a : p₂), q₁ ⋯ = q₂ a)


@[simp]
theorem funMap_apply₂ (f : f₂) (x y : M) :
    @Structure.funMap _ M (Structure.mk₂ c' f₁' f₂' r₁' r₂') 2 f ![x, y] = f₂' f x y

{M : Type w}
{c f₁ f₂ : Type u}
{r₁ r₂ : Type v}
{c' : c → M}
{f₁' : f₁ → M → M}
{f₂' : f₂ → M → M → M}
{r₁' : r₁ → Set M}
{r₂' : r₂ → M → M → Prop}
(f : f₂)
(x y : M)

FirstOrder.Language.Structure.funMap f ![x, y] = f₂' f x y


/-- If the Hausdorff distance is `< r`, any point in one of the sets is at distance
`< r` of a point in the other set. -/
theorem exists_dist_lt_of_hausdorffDist_lt' {r : ℝ} (h : y ∈ t) (H : hausdorffDist s t < r)
    (fin : hausdorffEdist s t ≠ ⊤) : ∃ x ∈ s, dist x y < r

{α : Type u}
[PseudoMetricSpace α]
{s t : Set α}
{y : α}
{r : ℝ}
(h : y ∈ t)
(H : Metric.hausdorffDist s t < r)
(fin : EMetric.hausdorffEdist s t ≠ ⊤)


lemma zeroLocus_minimalPrimes :
    zeroLocus ∘ (↑) '' minimalPrimes R =
    irreducibleComponents (PrimeSpectrum R)

PrimeSpectrum.zeroLocus ∘ SetLike.coe '' minimalPrimes R = irreducibleComponents (PrimeSpectrum R)


@[simp]
theorem cons_inter_of_pos {a} (s : Multiset α) {t} : a ∈ t → (a ::ₘ s) ∩ t = a ::ₘ s ∩ t.erase a

{α : Type u_1}
[DecidableEq α]
{a : α}
(s : Multiset α)
{t : Multiset α}


theorem IsCompact.exists_sSup_image_eq_and_ge [ClosedIciTopology α] {s : Set β}
    (hs : IsCompact s) (ne_s : s.Nonempty) {f : β → α} (hf : ContinuousOn f s) :
    ∃ x ∈ s, sSup (f '' s) = f x ∧ ∀ y ∈ s, f y ≤ f x

{α : Type u_2}
{β : Type u_3}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIciTopology α]
{s : Set β}
(hs : IsCompact s)
(ne_s : s.Nonempty)
{f : β → α}
(hf : ContinuousOn f s)


/-- The zeroth Pythagorean triple is all zeros. -/
theorem PythagoreanTriple.zero : PythagoreanTriple 0 0 0


theorem mem_of_mem_drop {n} {l : List α} (h : a ∈ l.drop n) : a ∈ l

{α : Type u_1}
{a : α}
{n : Nat}
{l : List α}
(h : a ∈ List.drop n l)


lemma exp_neg_llr' [SigmaFinite μ] [SigmaFinite ν] (hμν : ν ≪ μ) :
    (fun x ↦ exp (- llr μ ν x)) =ᵐ[ν] fun x ↦ (ν.rnDeriv μ x).toReal

{α : Type u_1}
{mα : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]
[MeasureTheory.SigmaFinite ν]
(hμν : ν.AbsolutelyContinuous μ)

(fun x => rexp (-MeasureTheory.llr μ ν x)) =ᵐ[ν] fun x => (ν.rnDeriv μ x).toReal


theorem isOpen_singleton_iff_punctured_nhds (x : X) : IsOpen ({x} : Set X) ↔ 𝓝[≠] x = ⊥

{X : Type u}
[TopologicalSpace X]
(x : X)


theorem isNoetherianRing_fin [IsNoetherianRing R] :
    ∀ {n : ℕ}, IsNoetherianRing (MvPolynomial (Fin n) R)

{R : Type u}
[CommRing R]
[IsNoetherianRing R]
{n : ℕ}


lemma comp_stabilizerEquiv_invFun (g : ∀ i, Perm {a // f a = i}) (a : α) :
    f (stabilizerEquiv_invFun g a) = f a

(g : (i : ι) → Equiv.Perm { a // f a = i })

f (DomMulAct.stabilizerEquiv_invFun g a) = f a


/-- A matroid defined purely in terms of its bases. -/
@[simps E] protected def ofBase (E : Set α) (Base : Set α → Prop) (exists_base : ∃ B, Base B)
    (base_exchange : ExchangeProperty Base)
    (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty (∃ B, Base B ∧ · ⊆ B) X)
    (subset_ground : ∀ B, Base B → B ⊆ E) : Matroid α

(base_exchange : Matroid.ExchangeProperty Base)

(maximality : ∀ X ⊆ E, Matroid.ExistsMaximalSubsetProperty (fun x => ∃ B, Base B ∧ x ⊆ B) X)

(subset_ground : ∀ (B : Set α), Base B → B ⊆ E)

(Matroid.ofBase E Base exists_base base_exchange maximality subset_ground).E = E


theorem oneCoboundariesOfEq_apply {f : G → A} {x : A} (hf : ∀ g, A.ρ g x - x = f g) :
    (oneCoboundariesOfEq hf).1.1 = f

{k G : Type u}
[CommRing k]
[Group G]
{A : Rep k G}
{f : G → CoeSort.coe A}
{x : CoeSort.coe A}
(hf : ∀ (g : G), (A.ρ g) x - x = f g)

↑↑(groupCohomology.oneCoboundariesOfEq hf) = f


theorem monotone_mem {f : Filter α} : Monotone fun s => s ∈ f


@[to_additive]
theorem min_one (a : α) : min a 1 = 1


@[simp]
theorem toPrefunctor_comp (F : C ⥤ D) (G : D ⥤ E) :
    F.toPrefunctor.comp G.toPrefunctor = (F ⋙ G).toPrefunctor

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(F : CategoryTheory.Functor C D)
(G : CategoryTheory.Functor D E)

F.toPrefunctor ⋙q G.toPrefunctor = (F.comp G).toPrefunctor


@[reassoc]
theorem lift_comp_conePointsIsoOfNatIso_inv {F G : J ⥤ C} {r s : Cone G} {t : Cone F}
    (P : IsLimit t) (Q : IsLimit s) (w : F ≅ G) :
    Q.lift r ≫ (conePointsIsoOfNatIso P Q w).inv = P.map r w.inv

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F G : J ⥤ C}
{r s : CategoryTheory.Limits.Cone G}
{t : CategoryTheory.Limits.Cone F}
(P : CategoryTheory.Limits.IsLimit t)
(Q : CategoryTheory.Limits.IsLimit s)
(w : F ≅ G)

Q.lift r ≫ (P.conePointsIsoOfNatIso Q w).inv = CategoryTheory.Limits.IsLimit.map r P w.inv


theorem vars_sum_of_disjoint [DecidableEq σ] (h : Pairwise <| (Disjoint on fun i => (φ i).vars)) :
    (∑ i ∈ t, φ i).vars = Finset.biUnion t fun i => (φ i).vars

(h : Pairwise (Disjoint on fun i => (φ i).vars))

(∑ i ∈ t, φ i).vars = t.biUnion fun i => (φ i).vars


/-- The tensor of a family of linear maps from `Eᵢ` to `E'ᵢ`, as a continuous multilinear map of
the family.
-/
@[simps!]
noncomputable def mapLMultilinear : ContinuousMultilinearMap 𝕜 (fun (i : ι) ↦ E i →L[𝕜] E' i)
    ((⨂[𝕜] i, E i) →L[𝕜] ⨂[𝕜] i, E' i)

[(i : ι) → SeminormedAddCommGroup (E i)]

[(i : ι) → SeminormedAddCommGroup (E' i)]

∀ (a : ⨂[𝕜] (i : ι), E i),
  ((PiTensorProduct.mapLMultilinear 𝕜 E E') f) a =
    (PiTensorProduct.liftAux ((PiTensorProduct.tprodL 𝕜).compContinuousLinearMap f).toMultilinearMap) a


theorem IsRegular.inf (ha : IsRegular a) (hb : IsRegular b) : IsRegular (a ⊓ b)

{α : Type u_1}
[HeytingAlgebra α]
{a b : α}
(ha : Heyting.IsRegular a)
(hb : Heyting.IsRegular b)


@[simp] theorem runK_bind_set (f : PUnit → StateCpsT σ m β) (s s' : σ) (k : β → σ → m γ) : (set s' >>= f).runK s k = (f ⟨⟩).runK s' k

{σ : Type u}
{m : Type u → Type v}
{β γ : Type u}
(f : PUnit → StateCpsT σ m β)
(s s' : σ)
(k : β → σ → m γ)

(set s' >>= f).runK s k = (f PUnit.unit).runK s' k


/-- If `R →+* A` is injective, then `R` is of exponential characteristic `p` if and only if `A` is
also of exponential characteristic `p`. Similar to `RingHom.charZero_iff`. -/
theorem RingHom.expChar_iff {R A : Type*} [Semiring R] [Semiring A] (f : R →+* A)
    (H : Function.Injective f) (p : ℕ) : ExpChar R p ↔ ExpChar A p

{R : Type u_1}
{A : Type u_2}
[Semiring R]
[Semiring A]
(f : R →+* A)
(H : Function.Injective ⇑f)
(p : ℕ)


theorem sigma_preimage_eq {f : ι' → ι} {g : ∀ i, β i → α i} :
    (f ⁻¹' s).sigma (fun i ↦ g (f i) ⁻¹' t (f i)) =
      (fun p : Σ i, β (f i) ↦ Sigma.mk _ (g _ p.2)) ⁻¹' s.sigma t

{ι : Type u_1}
{ι' : Type u_2}
{α : ι → Type u_3}
{s : Set ι}
{t : (i : ι) → Set (α i)}
{β : ι → Type u_7}
{f : ι' → ι}
{g : (i : ι) → β i → α i}

((f ⁻¹' s).sigma fun i => g (f i) ⁻¹' t (f i)) = (fun p => ⟨f p.fst, g (f p.fst) p.snd⟩) ⁻¹' s.sigma t


theorem comap_surjective (f : V ↪ W) : Function.Surjective (SimpleGraph.comap f)

{V : Type u_1}
{W : Type u_2}
(f : V ↪ W)


/-- This is not always a good idea as a `@[simp]` lemma,
as we lose the ability to use results that interact with `F`,
e.g. the naturality of a natural transformation.

In some files it may be appropriate to use `attribute [local simp] eqToHom_map`, however.
-/
theorem eqToHom_map (F : C ⥤ D) {X Y : C} (p : X = Y) :
    F.map (eqToHom p) = eqToHom (congr_arg F.obj p)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
{X Y : C}
(p : X = Y)

F.map (CategoryTheory.eqToHom p) = CategoryTheory.eqToHom ⋯


@[simp]
lemma shift_neg (a : ℤ) :
    (-γ).shift a = -γ.shift a

(γ : CochainComplex.HomComplex.Cochain K L n)


theorem IsBigO.prod_left (hf : f' =O[l] k') (hg : g' =O[l] k') : (fun x => (f' x, g' x)) =O[l] k'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
{G' : Type u_8}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
[SeminormedAddCommGroup G']
{f' : α → E'}
{g' : α → F'}
{k' : α → G'}
{l : Filter α}
(hf : f' =O[l] k')
(hg : g' =O[l] k')


@[simp] theorem lookup_nil [BEq α] : ([] : List (α × β)).lookup a = none

{α : Type u}
{β : Type v}
{a : α}
[BEq α]


theorem integrable_norm_iff {f : α → β} (hf : AEStronglyMeasurable f μ) :
    Integrable (fun a => ‖f a‖) μ ↔ Integrable f μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.Integrable (fun a => ‖f a‖) μ ↔ MeasureTheory.Integrable f μ


theorem ceil_congr (h : ∀ n : ℤ, a ≤ n ↔ b ≤ n) : ⌈a⌉ = ⌈b⌉

{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedRing β]
[FloorRing α]
[FloorRing β]
{a : α}
{b : β}
(h : ∀ (n : ℤ), a ≤ ↑n ↔ b ≤ ↑n)


theorem isBasis_basicOpen (X : Scheme) [IsAffine X] :
    Opens.IsBasis (Set.range (X.basicOpen : Γ(X, ⊤) → X.Opens))

(X : AlgebraicGeometry.Scheme)
[AlgebraicGeometry.IsAffine X]


theorem coeFn_compMeasurePreserving (g : β →ₘ[ν] γ) (hf : MeasurePreserving f μ ν) :
    g.compMeasurePreserving f hf =ᵐ[μ] g ∘ f

(hf : MeasureTheory.MeasurePreserving f μ ν)

↑(g.compMeasurePreserving f hf) =ᵐ[μ] ↑g ∘ f


@[simp] theorem homeomorph_mk_coe (a : X ≃ Y) (b c) : (Homeomorph.mk a b c : X → Y) = a

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(a : X ≃ Y)
(b : Continuous a.toFun)
(c : Continuous a.invFun)

⇑{ toEquiv := a, continuous_toFun := b, continuous_invFun := c } = ⇑a


/-- We can compute a right derived functor on a morphism using a descent of that morphism
to a cochain map between chosen injective resolutions.
-/
theorem Functor.rightDerived_map_eq (F : C ⥤ D) [F.Additive] (n : ℕ) {X Y : C} (f : X ⟶ Y)
    {P : InjectiveResolution X} {Q : InjectiveResolution Y} (g : P.cocomplex ⟶ Q.cocomplex)
    (w : P.ι ≫ g = (CochainComplex.single₀ C).map f ≫ Q.ι) :
    (F.rightDerived n).map f =
      (P.isoRightDerivedObj F n).hom ≫
        (F.mapHomologicalComplex _ ⋙ HomologicalComplex.homologyFunctor _ _ n).map g ≫
          (Q.isoRightDerivedObj F n).inv

{P : CategoryTheory.InjectiveResolution X}

{Q : CategoryTheory.InjectiveResolution Y}

(w :
  CategoryTheory.CategoryStruct.comp P.ι g = CategoryTheory.CategoryStruct.comp ((CochainComplex.single₀ C).map f) Q.ι)

(F.rightDerived n).map f =
  CategoryTheory.CategoryStruct.comp (P.isoRightDerivedObj F n).hom
    (CategoryTheory.CategoryStruct.comp
      (((F.mapHomologicalComplex (ComplexShape.up ℕ)).comp
            (HomologicalComplex.homologyFunctor D (ComplexShape.up ℕ) n)).map
        g)
      (Q.isoRightDerivedObj F n).inv)


@[simp]
theorem le_inv_iff_mul_le {r p : ℝ≥0} (h : p ≠ 0) : r ≤ p⁻¹ ↔ r * p ≤ 1


/-- Universe lift functor for commutative monoids. -/
@[to_additive (attr := simps)
  "Universe lift functor for additive commutative monoids."]
def uliftFunctor : CommMonCat.{u} ⥤ CommMonCat.{max u v}

AddCommMonCat.uliftFunctor.map f =
  AddCommMonCat.ofHom (AddEquiv.ulift.symm.toAddMonoidHom.comp (AddMonoidHom.comp f AddEquiv.ulift.toAddMonoidHom))


@[to_additive]
theorem coe_comp_rangeRestrict (f : G →* N) :
    ((↑) : f.range → N) ∘ (⇑f.rangeRestrict : G → f.range) = f

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)


lemma restrict_compl_sigmaFiniteSet [SFinite μ] :
    μ.restrict μ.sigmaFiniteSetᶜ = ∞ • μ.toFinite.restrict μ.sigmaFiniteSetᶜ

{α : Type u_1}
{mα : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.SFinite μ]

μ.restrict μ.sigmaFiniteSetᶜ = ⊤ • μ.toFinite.restrict μ.sigmaFiniteSetᶜ


theorem mkPiRing_eq_iff [Fintype ι] {z₁ z₂ : M₂} :
    MultilinearMap.mkPiRing R ι z₁ = MultilinearMap.mkPiRing R ι z₂ ↔ z₁ = z₂

{R : Type uR}
{ι : Type uι}
{M₂ : Type v₂}
[CommSemiring R]
[AddCommMonoid M₂]
[Module R M₂]
[Fintype ι]
{z₁ z₂ : M₂}


/-- A bicategory structure on the oplax functors between bicategories. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
instance OplaxFunctor.bicategory : Bicategory (OplaxFunctor B C)

(B : Type u₁)
[CategoryTheory.Bicategory B]
(C : Type u₂)
[CategoryTheory.Bicategory C]

∀ {X Y Z : CategoryTheory.OplaxFunctor B C} (η : CategoryTheory.OplaxNatTrans X Y)
  (θ : CategoryTheory.OplaxNatTrans Y Z) {a b : B} (f : a ⟶ b),
  (CategoryTheory.CategoryStruct.comp η θ).naturality f =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (X.map f) (η.app b) (θ.app b)).inv
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (η.naturality f) (θ.app b))
        (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (η.app a) (Y.map f) (θ.app b)).hom
          (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (η.app a) (θ.naturality f))
            (CategoryTheory.Bicategory.associator (η.app a) (θ.app a) (Z.map f)).inv)))


lemma d₂_eq_zero (h : ¬ c₂.Rel i₂ (c₂.next i₂)) :
    K.d₂ c₁₂ i₁ i₂ i₁₂ = 0

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]
(i₁ : I₁)
(i₂ : I₂)
(i₁₂ : I₁₂)
(h : ¬c₂.Rel i₂ (c₂.next i₂))


@[simp] theorem inl_getLeft : ∀ (x : α ⊕ β) (h : x.isLeft), inl (x.getLeft h) = x

{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)
(h : x.isLeft = true)


theorem mk_lt_mk_iff_right : (a, b₁) < (a, b₂) ↔ b₁ < b₂

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{a : α}
{b₁ b₂ : β}


lemma iInf_coe_eq_top : ⨅ x, (f x : WithTop α) = ⊤ ↔ IsEmpty ι

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLinearOrderBot α]
{f : ι → α}


/-- If `f` has formal power series `∑ n, pₙ` on a ball of radius `r`, then for `y, z` in any smaller
ball, the norm of the difference `f y - f z - p 1 (fun _ ↦ y - z)` is bounded above by
`C * (max ‖y - x‖ ‖z - x‖) * ‖y - z‖`. This lemma formulates this property using `IsBigO` and
`Filter.principal` on `E × E`. -/
theorem HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal
    (hf : HasFPowerSeriesOnBall f p x r) (hr : r' < r) :
    (fun y : E × E => f y.1 - f y.2 - p 1 fun _ => y.1 - y.2) =O[𝓟 (EMetric.ball (x, x) r')]
      fun y => ‖y - (x, x)‖ * ‖y.1 - y.2‖

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r r' : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f p x r)
(hr : r' < r)

(fun y => f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) =O[𝓟 (EMetric.ball (x, x) r')] fun y => ‖y - (x, x)‖ * ‖y.1 - y.2‖


theorem bddAbove_Ioc : BddAbove (Ioc a b)


theorem findSome?_replicate : findSome? f (replicate n a) = if n = 0 then none else f a

∀ {α : Type u_1} {α_1 : Type u_2} {f : α → Option α_1} {n : Nat} {a : α},
  List.findSome? f (List.replicate n a) = if n = 0 then none else f a


theorem bddAbove_of_small (s : Set Cardinal.{u}) [h : Small.{u} s] : BddAbove s

(s : Set Cardinal.{u})
[h : Small.{u, u + 1} ↑s]


theorem one_mem_one : (1 : P) ∈ (1 : FractionalIdeal S P)

{R : Type u_1}
[CommRing R]
(S : Submonoid R)
{P : Type u_2}
[CommRing P]
[Algebra R P]


@[to_additive]
theorem mulSupport_extend_one {f : α → M'} {g : α → N} (hf : f.Injective) :
    mulSupport (f.extend g 1) = f '' mulSupport g

{α : Type u_1}
{M' : Type u_6}
{N : Type u_7}
[Zero N]
{f : α → M'}
{g : α → N}
(hf : Function.Injective f)

Function.support (Function.extend f g 0) = f '' Function.support g


theorem toReal_smul (r : ℝ≥0) (s : ℝ≥0∞) : (r • s).toReal = r • s.toReal


@[simp] lemma diracProba_diracProbaInverse (μ : range (diracProba (X := X))) :
    diracProba (diracProbaInverse μ) = μ

(μ : ↑(Set.range MeasureTheory.diracProba))

MeasureTheory.diracProba (MeasureTheory.diracProbaInverse μ) = ↑μ


theorem shiftRight_add (i : Int) (m n : Nat) :
    i >>> (m + n) = i >>> m >>> n


theorem tendsto_atTop_add (hf : Tendsto f l atTop) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x + g x) l atTop

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommMonoid β]
{l : Filter α}
{f g : α → β}
(hf : Filter.Tendsto f l Filter.atTop)
(hg : Filter.Tendsto g l Filter.atTop)

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


theorem IsPoly.add {f g : (α → ℕ) → ℤ} (hf : IsPoly f) (hg : IsPoly g) : IsPoly (f + g)

{α : Type u_1}
{f g : (α → ℕ) → ℤ}
(hf : IsPoly f)
(hg : IsPoly g)


/-- The upper shadow is monotone. -/
@[mono]
theorem upShadow_monotone : Monotone (upShadow : Finset (Finset α) → Finset (Finset α))

{α : Type u_1}
[DecidableEq α]
[Fintype α]


@[simp]
theorem traverse_cons (a : α') (l : List α') :
    traverse f (a :: l) = (· :: ·) <$> f a <*> traverse f l

{F : Type u → Type u}
[Applicative F]
{α' β' : Type u}
(f : α' → F β')
(a : α')
(l : List α')

traverse f (a :: l) = Seq.seq ((fun x x_1 => x :: x_1) <$> f a) fun x => traverse f l


protected theorem sup_eq_left {a b : CauSeq α abs} (h : b ≤ a) : a ⊔ b ≈ a

{α : Type u_1}
[LinearOrderedField α]
{a b : CauSeq α abs}
(h : b ≤ a)


@[simp, norm_cast]
theorem toLinearMap_inj {e₁ e₂ : M ≃ₛₗ[σ] M₂} : (↑e₁ : M →ₛₗ[σ] M₂) = e₂ ↔ e₁ = e₂

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module S M₂]
{σ : R →+* S}
{σ' : S →+* R}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
{e₁ e₂ : M ≃ₛₗ[σ] M₂}

↑e₁ = ↑e₂ ↔ e₁ = e₂


/-- A simplicial complex in a `𝕜`-module is a collection of simplices which glue nicely together.
Note that the textbook meaning of "glue nicely" is given in
`Geometry.SimplicialComplex.disjoint_or_exists_inter_eq_convexHull`. It is mostly useless, as
`Geometry.SimplicialComplex.convexHull_inter_convexHull` is enough for all purposes. -/
@[ext]
structure SimplicialComplex where
  /-- the faces of this simplicial complex: currently, given by their spanning vertices -/
  faces : Set (Finset E)
  /-- the empty set is not a face: hence, all faces are non-empty -/
  not_empty_mem : ∅ ∉ faces
  /-- the vertices in each face are affine independent: this is an implementation detail -/
  indep : ∀ {s}, s ∈ faces → AffineIndependent 𝕜 ((↑) : s → E)
  /-- faces are downward closed: a non-empty subset of its spanning vertices spans another face -/
  down_closed : ∀ {s t}, s ∈ faces → t ⊆ s → t ≠ ∅ → t ∈ faces
  inter_subset_convexHull : ∀ {s t}, s ∈ faces → t ∈ faces →
    convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t ⊆ convexHull 𝕜 (s ∩ t : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(self : Geometry.SimplicialComplex 𝕜 E)
{s t : Finset E}

s ∈ self.faces → t ⊆ s → t ≠ ∅ → t ∈ self.faces


theorem isIso_op_iff {X Y : C} (f : X ⟶ Y) : IsIso f.op ↔ IsIso f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
(f : X ⟶ Y)

CategoryTheory.IsIso f.op ↔ CategoryTheory.IsIso f


@[simp]
theorem comp_f {P Q R : Karoubi C} (f : P ⟶ Q) (g : Q ⟶ R) : (f ≫ g).f = f.f ≫ g.f

{P Q R : CategoryTheory.Idempotents.Karoubi C}

(CategoryTheory.CategoryStruct.comp f g).f = CategoryTheory.CategoryStruct.comp f.f g.f


/-- A star `R`-algebra `A` has a *continuous functional calculus* for elements satisfying the
property `p : A → Prop` if

+ for every such element `a : A` there is a star algebra homomorphism
  `cfcHom : C(spectrum R a, R) →⋆ₐ[R] A` sending the (restriction of) the identity map to `a`.
+ `cfcHom` is a closed embedding for which the spectrum of the image of function `f` is its range.
+ `cfcHom` preserves the property `p`.
+ `p 0` is true, which ensures among other things that `p ≠ fun _ ↦ False`.

The property `p` is marked as an `outParam` so that the user need not specify it. In practice,

+ for `R := ℂ`, we choose `p := IsStarNormal`,
+ for `R := ℝ`, we choose `p := IsSelfAdjoint`,
+ for `R := ℝ≥0`, we choose `p := (0 ≤ ·)`.

Instead of directly providing the data we opt instead for a `Prop` class. In all relevant cases,
the continuous functional calculus is uniquely determined, and utilizing this approach
prevents diamonds or problems arising from multiple instances. -/
class ContinuousFunctionalCalculus (R : Type*) {A : Type*} (p : outParam (A → Prop))
    [CommSemiring R] [StarRing R] [MetricSpace R] [TopologicalSemiring R] [ContinuousStar R]
    [Ring A] [StarRing A] [TopologicalSpace A] [Algebra R A] : Prop where
  predicate_zero : p 0
  exists_cfc_of_predicate : ∀ a, p a → ∃ φ : C(spectrum R a, R) →⋆ₐ[R] A,
    ClosedEmbedding φ ∧ φ ((ContinuousMap.id R).restrict <| spectrum R a) = a ∧
      (∀ f, spectrum R (φ f) = Set.range f) ∧ ∀ f, p (φ f)

[self : ContinuousFunctionalCalculus R p]


theorem union_union_distrib_right (s t u : Set α) : s ∪ t ∪ u = s ∪ u ∪ (t ∪ u)


@[simp]
theorem realize_bot : (⊥ : L.Formula α).Realize v ↔ False

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{v : α → M}


theorem Sublist.map (f : α → β) {l₁ l₂ : List α} (s : l₁ <+ l₂) : map f l₁ <+ map f l₂

{α : Type u}
{β : Type v}
(f : α → β)
{l₁ l₂ : List α}
(s : l₁.Sublist l₂)


@[simp]
theorem Icc_diff_Ioo_same (h : a ≤ b) : Icc a b \ Ioo a b = {a, b}

{α : Type u_1}
[PartialOrder α]
{a b : α}
(h : a ≤ b)


/-- See `DFinsupp.infinite_of_right` for this in instance form, with the drawback that
it needs all `π i` to be infinite. -/
theorem DFinsupp.infinite_of_exists_right {ι : Sort _} {π : ι → Sort _} (i : ι) [Infinite (π i)]
    [∀ i, Zero (π i)] : Infinite (Π₀ i, π i)

{ι : Type u_1}
{π : ι → Type u_2}
(i : ι)
[Infinite (π i)]
[(i : ι) → Zero (π i)]


/-- Given an injective graph homomorphism, map paths to paths. -/
@[simps]
protected def map (f : G →g G') (hinj : Function.Injective f) {u v : V} (p : G.Path u v) :
    G'.Path (f u) (f v)

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
(f : G →g G')
(hinj : Function.Injective ⇑f)
{u v : V}
(p : G.Path u v)

↑(SimpleGraph.Path.map f hinj p) = SimpleGraph.Walk.map f ↑p


protected theorem dvd_refl (a : Nat) : a ∣ a


theorem IsBigO.exists_pos (h : f =O[l] g') : ∃ c > 0, IsBigOWith c l f g'

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

∃ c > 0, Asymptotics.IsBigOWith c l f g'


/-- If a preconnected set contains endpoints of an interval, then it includes the whole interval. -/
theorem IsPreconnected.Icc_subset {s : Set α} (hs : IsPreconnected s) {a b : α} (ha : a ∈ s)
    (hb : b ∈ s) : Icc a b ⊆ s

{α : Type v}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{s : Set α}
(hs : IsPreconnected s)
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)


lemma isLocalDiffeomorphOn_iff {f : M → N} (s : Set M) :
    IsLocalDiffeomorphOn I J n f s ↔ ∀ x : s, IsLocalDiffeomorphAt I J n f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_4}
[TopologicalSpace H]
{G : Type u_5}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_7}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
{f : M → N}
(s : Set M)

IsLocalDiffeomorphOn I J n f s ↔ ∀ (x : ↑s), IsLocalDiffeomorphAt I J n f ↑x


theorem IicExtend_apply (f : Iic b → β) (x : α) : IicExtend f x = f ⟨min b x, min_le_left _ _⟩

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
{b : α}
(f : ↑(Set.Iic b) → β)
(x : α)


theorem det_of_basisMatrix_non_zero : (basisMatrix K).det ≠ 0

(K : Type u_1)
[Field K]
[NumberField K]
[DecidableEq (K →+* ℂ)]


theorem sum_prob_mem_Ioc_le {X : Ω → ℝ} (hint : Integrable X) (hnonneg : 0 ≤ X) {K : ℕ} {N : ℕ}
    (hKN : K ≤ N) :
    ∑ j ∈ range K, ℙ {ω | X ω ∈ Set.Ioc (j : ℝ) N} ≤ ENNReal.ofReal (𝔼[X] + 1)

{Ω : Type u_1}
[MeasureTheory.MeasureSpace Ω]
[MeasureTheory.IsProbabilityMeasure ℙ]
{X : Ω → ℝ}
(hint : MeasureTheory.Integrable X ℙ)
(hnonneg : 0 ≤ X)
{K N : ℕ}
(hKN : K ≤ N)

∑ j ∈ Finset.range K, ℙ {ω | X ω ∈ Set.Ioc ↑j ↑N} ≤ ENNReal.ofReal ((∫ (a : Ω), X a) + 1)


theorem tendsto_atBot (e : α ≃o β) : Tendsto e atBot atBot

{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
(e : α ≃o β)

Filter.Tendsto (⇑e) Filter.atBot Filter.atBot


theorem isOpen_biUnion_countable [SecondCountableTopology α] {ι : Type*} (I : Set ι) (s : ι → Set α)
    (H : ∀ i ∈ I, IsOpen (s i)) : ∃ T ⊆ I, T.Countable ∧ ⋃ i ∈ T, s i = ⋃ i ∈ I, s i

{α : Type u}
[t : TopologicalSpace α]
[SecondCountableTopology α]
{ι : Type u_1}
(I : Set ι)
(s : ι → Set α)
(H : ∀ i ∈ I, IsOpen (s i))


theorem surjOn_Ici_of_monotone_surjective (h_mono : Monotone f) (h_surj : Function.Surjective f)
    (a : α) : SurjOn f (Ici a) (Ici (f a))

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[PartialOrder β]
{f : α → β}
(h_mono : Monotone f)
(h_surj : Function.Surjective f)
(a : α)

Set.SurjOn f (Set.Ici a) (Set.Ici (f a))


theorem equiv_of_eq {x y : PGame} (h : x = y) : x ≈ y


@[simp]
theorem norm_row (v : n → α) : ‖row ι v‖ = ‖v‖

{n : Type u_4}
{α : Type u_5}
{ι : Type u_7}
[Fintype n]
[Unique ι]
[SeminormedAddCommGroup α]
(v : n → α)


/-- The iUnion of connected sets indexed by a type with an archimedean successor (like `ℕ` or `ℤ`)
  such that any two neighboring sets meet is preconnected. -/
theorem IsPreconnected.iUnion_of_chain {s : β → Set α} (H : ∀ n, IsPreconnected (s n))
    (K : ∀ n, (s n ∩ s (succ n)).Nonempty) : IsPreconnected (⋃ n, s n)

(K : ∀ (n : β), (s n ∩ s (Order.succ n)).Nonempty)


@[simp]
theorem comap_top : (⊤ : Ideal S).comap f = ⊤

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
{f : F}


protected theorem Nat.eq_or_lt_of_le : {n m: Nat} → LE.le n m → Or (Eq n m) (LT.lt n m)


/-- Change a cone on `F : Jᵒᵖ ⥤ C` to a cocone on `F.rightOp : Jᵒᵖ ⥤ C`. -/
@[simps]
def coconeRightOpOfCone (c : Cone F) : Cocone F.rightOp

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : Jᵒᵖ ⥤ C}
(c : CategoryTheory.Limits.Cone F)

(CategoryTheory.Limits.coconeRightOpOfCone c).pt = Opposite.op c.pt


@[simp]
theorem coe_iSup_of_directed {ι} [Nonempty ι] (S : ι → Submodule R M)
    (H : Directed (· ≤ ·) S) : ((iSup S : Submodule R M) : Set M) = ⋃ i, S i

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{ι : Sort u_9}
[Nonempty ι]
(S : ι → Submodule R M)
(H : Directed (fun x x_1 => x ≤ x_1) S)


theorem Ioo_coe_coe : Ioo (a : WithBot α) b = (Ioo a b).map Embedding.some

(α : Type u_1)
[PartialOrder α]
[OrderBot α]
[LocallyFiniteOrder α]
(a b : α)

Finset.Ioo ↑a ↑b = Finset.map Function.Embedding.some (Finset.Ioo a b)


theorem le_def : π₁ ≤ π₂ ↔ ∀ J ∈ π₁, ∃ J' ∈ π₂, J ≤ J'

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{π₁ π₂ : BoxIntegral.Prepartition I}

π₁ ≤ π₂ ↔ ∀ J ∈ π₁, ∃ J' ∈ π₂, J ≤ J'


@[reassoc (attr := simp)]
theorem imageSubobject_arrow' :
    (imageSubobjectIso f).inv ≫ (imageSubobject f).arrow = image.ι f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
(f : X ⟶ Y)
[CategoryTheory.Limits.HasImage f]

(CategoryTheory.Limits.imageSubobjectIso f).inv ≫ (CategoryTheory.Limits.imageSubobject f).arrow =
  CategoryTheory.Limits.image.ι f


@[simp] lemma egirth_bot : egirth (⊥ : SimpleGraph α) = ⊤


/-- `ιInvApp` is the left inverse of `D.ι i` on `U`. -/
theorem ιInvApp_π {i : D.J} (U : Opens (D.U i).carrier) :
    ∃ eq, D.ιInvApp U ≫ D.diagramOverOpenπ U i = (D.U i).presheaf.map (eqToHom eq)

(D : AlgebraicGeometry.PresheafedSpace.GlueData C)

∃ (eq :
  Opposite.op U =
    Opposite.op
      ((TopologicalSpace.Opens.map
            (CategoryTheory.Limits.colimit.ι D.diagram.multispan
                (Opposite.unop (Opposite.op (CategoryTheory.Limits.WalkingMultispan.right i)))).base).obj
        (⋯.functor.obj U))),
  D.ιInvApp U ≫ D.diagramOverOpenπ U i = (D.U i).presheaf.map (CategoryTheory.eqToHom eq)


/-- The autoequivalence `Cᵒᵖ ≌ Cᵒᵖ` whose functor is `shiftFunctor Cᵒᵖ n` and whose inverse
functor is `(shiftFunctor C n).op`. Do not unfold the definitions of the unit and counit
isomorphisms: the compatibilities they satisfy are stated as separate lemmas. -/
@[simps functor inverse]
noncomputable def opShiftFunctorEquivalence (n : ℤ) : Cᵒᵖ ≌ Cᵒᵖ

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.HasShift C ℤ]
(n : ℤ)

(CategoryTheory.Pretriangulated.opShiftFunctorEquivalence C n).inverse = (CategoryTheory.shiftFunctor C n).op


theorem Lex.wellFounded' (hbot : ∀ ⦃n⦄, ¬s n 0) (hs : WellFounded s)
    [IsTrichotomous α r] (hr : WellFounded (Function.swap r)) : WellFounded (Finsupp.Lex r s)

{α : Type u_1}
{N : Type u_2}
[Zero N]
{r : α → α → Prop}
{s : N → N → Prop}
(hbot : ∀ ⦃n : N⦄, ¬s n 0)
(hs : WellFounded s)
[IsTrichotomous α r]
(hr : WellFounded (Function.swap r))


protected theorem map {g : β → γ} (hf : f.FinMeasSupp μ) (hg : g 0 = 0) : (f.map g).FinMeasSupp μ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{m : MeasurableSpace α}
[Zero β]
[Zero γ]
{μ : MeasureTheory.Measure α}
{f : MeasureTheory.SimpleFunc α β}
{g : β → γ}
(hf : f.FinMeasSupp μ)
(hg : g 0 = 0)

(MeasureTheory.SimpleFunc.map g f).FinMeasSupp μ


/-- A version of `lt_top_iff_ne_top` for `WithTop` that only requires `LT α`, not
`PartialOrder α`. -/
protected theorem lt_top_iff_ne_top {x : WithTop α} : x < ⊤ ↔ x ≠ ⊤

x < ⊤ ↔ x ≠ ⊤


protected theorem lt_tsub_iff_right_of_le (hc : AddLECancellable c) (h : c ≤ b) :
    a < b - c ↔ a + c < b

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


@[simp]
theorem comp_assoc (f : C →⋆ₙₐ[R] D) (g : B →⋆ₙₐ[R] C) (h : A →⋆ₙₐ[R] B) :
    (f.comp g).comp h = f.comp (g.comp h)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
{D : Type u_5}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
[NonUnitalNonAssocSemiring C]
[DistribMulAction R C]
[Star C]
[NonUnitalNonAssocSemiring D]
[DistribMulAction R D]
[Star D]
(f : C →⋆ₙₐ[R] D)
(g : B →⋆ₙₐ[R] C)
(h : A →⋆ₙₐ[R] B)


@[simp]
lemma comap_symm_apply (f : V ≃ W) (G : SimpleGraph W) (w : W) :
    (SimpleGraph.Iso.comap f G).symm w = f.symm w

{V : Type u_1}
{W : Type u_2}
(f : V ≃ W)
(G : SimpleGraph W)
(w : W)


private theorem matrixOf_eval_descPochhammer_eq_mul_matrixOf_choose {n : ℕ} (v : Fin n → ℕ) :
    (Matrix.of (fun (i j : Fin n) => (descPochhammer ℤ j).eval (v i : ℤ))).det =
    (∏ i : Fin n, Nat.factorial i) *
      (Matrix.of (fun (i j : Fin n) => (Nat.choose (v i) (j : ℕ) : ℤ))).det

(Matrix.of fun i j => Polynomial.eval (↑(v i)) (descPochhammer ℤ ↑j)).det =
  ↑(∏ i : Fin n, (↑i).factorial) * (Matrix.of fun i j => ↑((v i).choose ↑j)).det


theorem piecewise_eqOn (f g : α → β) : EqOn (s.piecewise f g) f s

{α : Type u_1}
{β : Type u_2}
(s : Set α)
[(j : α) → Decidable (j ∈ s)]
(f g : α → β)


theorem IsEquivalent.add_isLittleO (huv : u ~[l] v) (hwv : w =o[l] v) : u + w ~[l] v

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u v w : α → β}
{l : Filter α}
(huv : u ~[l] v)
(hwv : w =o[l] v)


@[simp]
theorem repr_total (v) : b.repr (Finsupp.total _ _ _ b v) = v

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(v : ι →₀ R)


theorem le_prevFixed {x : α} (hx : f x ≤ x) {y : fixedPoints f} (h : ↑y ≤ x) :
    y ≤ f.prevFixed x hx

{α : Type u}
[CompleteLattice α]
(f : α →o α)
{x : α}
(hx : f x ≤ x)
{y : ↑(Function.fixedPoints ⇑f)}
(h : ↑y ≤ x)


/-- `coeff g` as a linear map -/
@[simps]
def coeff.linearMap (g : Γ) : HahnSeries Γ V →ₗ[R] V

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Semiring R]
{V : Type u_3}
[AddCommMonoid V]
[Module R V]
(g : Γ)

∀ (a : HahnSeries Γ V), (HahnSeries.coeff.linearMap g) a = (↑(HahnSeries.coeff.addMonoidHom g)).toFun a


/-- The submodule generated by products `Pm * Pn` of weighted homogeneous polynomials of degrees `m`
  and `n` is contained in the submodule of weighted homogeneous polynomials of degree `m + n`. -/
theorem weightedHomogeneousSubmodule_mul (w : σ → M) (m n : M) :
    weightedHomogeneousSubmodule R w m * weightedHomogeneousSubmodule R w n ≤
      weightedHomogeneousSubmodule R w (m + n)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
{σ : Type u_3}
[AddCommMonoid M]
(w : σ → M)
(m n : M)

MvPolynomial.weightedHomogeneousSubmodule R w m * MvPolynomial.weightedHomogeneousSubmodule R w n ≤
  MvPolynomial.weightedHomogeneousSubmodule R w (m + n)


/-- The operator norm satisfies the triangle inequality. -/
theorem opNorm_add_le : ‖f + g‖ ≤ ‖f‖ + ‖g‖

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f g : NormedAddGroupHom V₁ V₂)

‖f + g‖ ≤ ‖f‖ + ‖g‖


@[simp]
theorem mk'_spec_mk (x) (y : R) (hy : y ∈ M) :
    mk' S x ⟨y, hy⟩ * algebraMap R S y = algebraMap R S x

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(x y : R)
(hy : y ∈ M)

IsLocalization.mk' S x ⟨y, hy⟩ * (algebraMap R S) y = (algebraMap R S) x


/-- If `s` is a splitting of a simplicial object `X` in a preadditive category,
`s.nondegComplex` is a chain complex which is given in degree `n` by
the nondegenerate `n`-simplices of `X`. -/
@[simps]
noncomputable def nondegComplex : ChainComplex C ℕ

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X : CategoryTheory.SimplicialObject C}
(s : SimplicialObject.Splitting X)
[CategoryTheory.Preadditive C]
(i j : ℕ)


/-- The compositum of two intermediate fields is equal to the compositum of them
as subalgebras, if one of them is algebraic over the base field. -/
theorem sup_toSubalgebra_of_isAlgebraic
    (halg : Algebra.IsAlgebraic K E1 ∨ Algebra.IsAlgebraic K E2) :
    (E1 ⊔ E2).toSubalgebra = E1.toSubalgebra ⊔ E2.toSubalgebra

(halg : Algebra.IsAlgebraic K ↥E1 ∨ Algebra.IsAlgebraic K ↥E2)


theorem isOpenMap_toAdd : IsOpenMap (toAdd : Multiplicative X → X)


@[to_additive]
theorem IsOpen.smul_left (ht : IsOpen t) : IsOpen (s • t)

{α : Type u}
{β : Type v}
[TopologicalSpace β]
[Group α]
[MulAction α β]
[ContinuousConstSMul α β]
{s : Set α}
{t : Set β}
(ht : IsOpen t)


theorem imageSubobject_le_mk {A B : C} {X : C} (g : X ⟶ B) [Mono g] (f : A ⟶ B) [HasImage f]
    (h : A ⟶ X) (w : h ≫ g = f) : imageSubobject f ≤ Subobject.mk g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{A B X : C}
(g : X ⟶ B)
[CategoryTheory.Mono g]
(f : A ⟶ B)
[CategoryTheory.Limits.HasImage f]
(h : A ⟶ X)
(w : h ≫ g = f)

CategoryTheory.Limits.imageSubobject f ≤ CategoryTheory.Subobject.mk g


@[simp]
theorem self_sub_toIcoMod (a b : α) : b - toIcoMod hp a b = toIcoDiv hp a b • p

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b : α)


theorem rangeS_le : (algebraMap R A).rangeS ≤ S.toSubsemiring

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)


/-- If `(x, y)` is a solution with `x` and `y` positive, then all its powers with positive
natural exponents have positive `y`. -/
theorem y_pow_succ_pos {a : Solution₁ d} (hax : 0 < a.x) (hay : 0 < a.y) (n : ℕ) :
    0 < (a ^ n.succ).y

{d : ℤ}
{a : Pell.Solution₁ d}
(hax : 0 < a.x)
(hay : 0 < a.y)
(n : ℕ)


@[simp]
theorem whiskering_linearCoyoneda₂ :
    linearCoyoneda R C ⋙
        (whiskeringRight _ _ _).obj (forget₂ (ModuleCat.{v} R) AddCommGrp.{v}) =
      preadditiveCoyoneda

(R : Type w)
[Ring R]
(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]

(CategoryTheory.linearCoyoneda R C).comp
    ((CategoryTheory.whiskeringRight C (ModuleCat R) AddCommGrp).obj
      (CategoryTheory.forget₂ (ModuleCat R) AddCommGrp)) =
  CategoryTheory.preadditiveCoyoneda


@[to_additive]
theorem mul_right_surjective (a : G) : Function.Surjective fun x ↦ x * a


@[to_additive]
lemma div_sup (a b c : α) : c / (a ⊔ b) = c / a ⊓ c / 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]


@[measurability]
theorem measurableSet_closure : MeasurableSet (closure s)

{α : Type u_1}
{s : Set α}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]


theorem Subpresheaf.eq_sheafify_iff (h : Presieve.IsSheaf J F) :
    G = G.sheafify J ↔ Presieve.IsSheaf J G.toPresheaf

{J : CategoryTheory.GrothendieckTopology C}

(G : CategoryTheory.GrothendieckTopology.Subpresheaf F)

(h : CategoryTheory.Presieve.IsSheaf J F)

G = CategoryTheory.GrothendieckTopology.Subpresheaf.sheafify J G ↔ CategoryTheory.Presieve.IsSheaf J G.toPresheaf


protected theorem map_neg (f : M →SL[σ₁₂] M₂) (x : M) : f (-x) = -f x

{R : Type u_1}
[Ring R]
{R₂ : Type u_2}
[Ring R₂]
{M : Type u_4}
[TopologicalSpace M]
[AddCommGroup M]
{M₂ : Type u_5}
[TopologicalSpace M₂]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
(f : M →SL[σ₁₂] M₂)
(x : M)


@[to_additive (attr := simp)]
theorem toList_mul (xs ys : FreeMonoid α) : toList (xs * ys) = toList xs ++ toList ys

FreeMonoid.toList (xs * ys) = FreeMonoid.toList xs ++ FreeMonoid.toList ys


theorem mapMono_δ₀' (i : Δ' ⟶ Δ) [Mono i] (hi : Isδ₀ i) : mapMono K i = K.d Δ.len Δ'.len

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(K : ChainComplex C ℕ)
{Δ Δ' : SimplexCategory}
(i : Δ' ⟶ Δ)
[CategoryTheory.Mono i]
(hi : AlgebraicTopology.DoldKan.Isδ₀ i)

AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K i = K.d Δ.len Δ'.len


/-- A partial diffeomorphism on `s` is a function `f : M → N` such that `f` restricts to a
diffeomorphism `s → t` between open subsets of `M` and `N`, respectively.
This is an auxiliary definition and should not be used outside of this file. -/
structure PartialDiffeomorph extends PartialEquiv M N where
  open_source : IsOpen source
  open_target : IsOpen target
  contMDiffOn_toFun : ContMDiffOn I J n toFun source
  contMDiffOn_invFun : ContMDiffOn J I n invFun target

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_4}
[TopologicalSpace H]
{G : Type u_5}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_7}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
(self : PartialDiffeomorph I J M N n)

ContMDiffOn I J n (↑self.toPartialEquiv) self.source


/-- Decomposition of a `k`-algebra homomorphism from `MonoidAlgebra k G` by
its values on `F (single a 1)`. -/
theorem lift_unique (F : MonoidAlgebra k G →ₐ[k] A) (f : MonoidAlgebra k G) :
    F f = f.sum fun a b => b • F (single a 1)

{k : Type u₁}
{G : Type u₂}
[CommSemiring k]
[Monoid G]
{A : Type u₃}
[Semiring A]
[Algebra k A]
(F : MonoidAlgebra k G →ₐ[k] A)
(f : MonoidAlgebra k G)

F f = Finsupp.sum f fun a b => b • F (MonoidAlgebra.single a 1)


@[simp]
theorem support_sup : (f ⊔ g).support = f.support ∪ g.support

[(i : ι) → CanonicallyLinearOrderedAddCommMonoid (α i)]


theorem IsMinOn.on_subset (hf : IsMinOn f t a) (h : s ⊆ t) : IsMinOn f s a

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}
{t : Set α}
(hf : IsMinOn f t a)
(h : s ⊆ t)


/-- The bifunctor combining an `I`-indexed family of objects with a `J`-indexed family of objects
to obtain an `I ⊕ J`-indexed family of objects.
-/
@[simps]
def sum : (∀ i, C i) ⥤ (∀ j, D j) ⥤ ∀ s : I ⊕ J, Sum.elim C D s

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

[(j : J) → CategoryTheory.Category.{v₁, u₁} (D j)]

((CategoryTheory.Pi.sum C).obj X).obj Y s =
  match s with
  | Sum.inl i => X i
  | Sum.inr j => Y j


theorem IsBigO.congr' (h : f₁ =O[l] g₁) (hf : f₁ =ᶠ[l] f₂) (hg : g₁ =ᶠ[l] g₂) : f₂ =O[l] g₂

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{l : Filter α}
{f₁ f₂ : α → E}
{g₁ g₂ : α → F}
(h : f₁ =O[l] g₁)
(hf : f₁ =ᶠ[l] f₂)
(hg : g₁ =ᶠ[l] g₂)


theorem toSpanSingleton_isIdempotentElem_iff {e : R} :
    IsIdempotentElem (toSpanSingleton R R e) ↔ IsIdempotentElem e

IsIdempotentElem (LinearMap.toSpanSingleton R R e) ↔ IsIdempotentElem e


/-- The inverse of a bijective equivariant map is equivariant. -/
@[simps]
def inverse' (f : X →ₑ[φ] Y) (g : Y → X) (k : Function.RightInverse φ' φ)
    (h₁ : Function.LeftInverse g f) (h₂ : Function.RightInverse g f) :
    Y →ₑ[φ'] X

{M : Type u_2}
{N : Type u_3}
{φ : M → N}
{X : Type u_5}
[SMul M X]
{Y : Type u_6}
[SMul N Y]
{φ' : N → M}
(f : X →ₑ[φ] Y)
(g : Y → X)
(k : Function.RightInverse φ' φ)
(h₁ : Function.LeftInverse g ⇑f)
(h₂ : Function.RightInverse g ⇑f)

∀ (a : Y), (f.inverse' g k h₁ h₂) a = g a


theorem Fix.ind_rec {β : Type u} (g₁ g₂ : Fix F α → β)
    (h :
      ∀ x : F (append1 α (Fix F α)),
        appendFun id g₁ <$$> x = appendFun id g₂ <$$> x → g₁ (Fix.mk x) = g₂ (Fix.mk x)) :
    ∀ x, g₁ x = g₂ x

(h :
  ∀ (x : F (α ::: MvQPF.Fix F α)),
    MvFunctor.map (TypeVec.id ::: g₁) x = MvFunctor.map (TypeVec.id ::: g₂) x →
      g₁ (MvQPF.Fix.mk x) = g₂ (MvQPF.Fix.mk x))


@[simp]
protected theorem coe_mk (hon : Orthonormal 𝕜 v) (hsp : ⊤ ≤ Submodule.span 𝕜 (Set.range v)) :
    ⇑(OrthonormalBasis.mk hon hsp) = v


theorem isIrreducible_zeroLocus_iff_of_radical (I : Ideal R) (hI : I.IsRadical) :
    IsIrreducible (zeroLocus (I : Set R)) ↔ I.IsPrime

{R : Type u}
[CommSemiring R]
(I : Ideal R)
(hI : I.IsRadical)

IsIrreducible (PrimeSpectrum.zeroLocus ↑I) ↔ I.IsPrime


@[simp]
theorem rank_self_mul_conjTranspose (A : Matrix m n R) : (A * Aᴴ).rank = A.rank

{m : Type u_2}
{n : Type u_3}
{R : Type u_5}
[Fintype n]
[Fintype m]
[Field R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
(A : Matrix m n R)


theorem isOpen_iff (h : e.IsImage s t) : IsOpen (e.source ∩ s) ↔ IsOpen (e.target ∩ t)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e : PartialHomeomorph X Y}
{s : Set X}
{t : Set Y}
(h : e.IsImage s t)


/-- **Abel-Ruffini Theorem** (one direction): An irreducible polynomial with an
`IsSolvableByRad` root has solvable Galois group -/
theorem isSolvable' {α : E} {q : F[X]} (q_irred : Irreducible q) (q_aeval : aeval α q = 0)
    (hα : IsSolvableByRad F α) : IsSolvable q.Gal

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{α : E}
{q : F[X]}
(q_irred : Irreducible q)
(q_aeval : (Polynomial.aeval α) q = 0)
(hα : IsSolvableByRad F α)


@[simp]
theorem isPWO_support (x : HahnSeries Γ R) : x.support.IsPWO

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
(x : HahnSeries Γ R)


theorem image2_subset_iff_right : image2 f s t ⊆ u ↔ ∀ b ∈ t, (fun a => f a b) '' s ⊆ u

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s : Set α}
{t : Set β}
{u : Set γ}

Set.image2 f s t ⊆ u ↔ ∀ b ∈ t, (fun a => f a b) '' s ⊆ u


private theorem deriv_sq_norm_pos : 0 < ‖F.derivative.eval a‖ ^ 2

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

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


@[to_additive card_le_one_iff_eq_bot]
theorem card_le_one_iff_eq_bot [Finite H] : Nat.card H ≤ 1 ↔ H = ⊥

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
[Finite ↥H]


/-- The operator norm of the projection is `0` if the subspace is dense. -/
theorem norm_trivial_quotient_mk (S : AddSubgroup M)
    (h : (S.topologicalClosure : Set M) = Set.univ) : ‖S.normedMk‖ = 0

{M : Type u_1}
[SeminormedAddCommGroup M]
(S : AddSubgroup M)
(h : ↑S.topologicalClosure = Set.univ)


@[simp] lemma monotone_vecEmpty : Monotone ![a]


@[simp]
theorem bot_parallel_iff_eq_bot {s : AffineSubspace k P} : ⊥ ∥ s ↔ s = ⊥

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : AffineSubspace k P}

⊥ ∥ s ↔ s = ⊥


@[to_additive]
theorem ContMDiff.div_const (hf : ContMDiff I' I n f) :
    ContMDiff I' I n (fun x ↦ f x / c)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[SubNegMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]
{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 → G}
{n : ℕ∞}
(c : G)
(hf : ContMDiff I' I n f)


@[to_additive]
protected lemma div_eq_of_eq_mul (h : IsUnit b) : a = c * b → a / b = c

{α : Type u}
[SubtractionMonoid α]
{a b c : α}
(h : IsAddUnit b)


theorem append_assoc {p : ℕ} {α : Type*} (a : Fin m → α) (b : Fin n → α) (c : Fin p → α) :
    append (append a b) c = append a (append b c) ∘ Fin.cast (Nat.add_assoc ..)

{m n p : ℕ}
{α : Type u_1}
(a : Fin m → α)
(b : Fin n → α)
(c : Fin p → α)

Fin.append (Fin.append a b) c = Fin.append a (Fin.append b c) ∘ Fin.cast ⋯


@[simp]
theorem restrictScalarsEquiv_mk [Ring S] [SMul S R] [Module S M] [IsScalarTower S R M]
    (P : Submodule R M) (x : M) :
    restrictScalarsEquiv S P (mk x : M ⧸ P) = (mk x : M ⧸ P)

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(S : Type u_3)
[Ring S]
[SMul S R]
[Module S M]
[IsScalarTower S R M]
(P : Submodule R M)
(x : M)

(Submodule.Quotient.restrictScalarsEquiv S P) (Submodule.Quotient.mk x) = Submodule.Quotient.mk x


/-- Two `LinearMap`s out of a direct sum are equal if they agree on the generators.

See note [partially-applied ext lemmas]. -/
@[ext]
theorem linearMap_ext ⦃ψ ψ' : (⨁ i, M i) →ₗ[R] N⦄
    (H : ∀ i, ψ.comp (lof R ι M i) = ψ'.comp (lof R ι M i)) : ψ = ψ'

⦃ψ ψ' : (DirectSum ι fun i => M i) →ₗ[R] N⦄

(H : ∀ (i : ι), ψ ∘ₗ DirectSum.lof R ι M i = ψ' ∘ₗ DirectSum.lof R ι M i)


/-- The factorisation of a morphism through its abelian image. -/
@[simps]
def imageMonoFactorisation {X Y : C} (f : X ⟶ Y) : MonoFactorisation f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Limits.HasKernels C]
[CategoryTheory.Limits.HasCokernels C]
{X Y : C}
(f : X ⟶ Y)

(CategoryTheory.Abelian.OfCoimageImageComparisonIsIso.imageMonoFactorisation f).e =
  CategoryTheory.Limits.kernel.lift (CategoryTheory.Limits.cokernel.π f) f ⋯


lemma bit_mod_two (a : Bool) (x : ℕ) :
    bit a x % 2 = if a then 1 else 0

Nat.bit a x % 2 = if a = true then 1 else 0


/-- The canonical isomorphism of triangles
`binaryProductTriangle X₁ X₂ ≅ binaryBiproductTriangle X₁ X₂`. -/
@[simps!]
def binaryProductTriangleIsoBinaryBiproductTriangle
    (X₁ X₂ : C) [HasZeroMorphisms C] [HasBinaryBiproduct X₁ X₂] :
    binaryProductTriangle X₁ X₂ ≅ binaryBiproductTriangle X₁ X₂

(CategoryTheory.Pretriangulated.binaryProductTriangleIsoBinaryBiproductTriangle X₁ X₂).inv.hom₃ = 𝟙 X₂


@[simp] theorem dist_ofMul (a b : X) : dist (ofMul a) (ofMul b) = dist a b

dist (Additive.ofMul a) (Additive.ofMul b) = dist a b


theorem finiteDimensional_iSup_of_finset'
    /- Porting note: this was the mathlib3 version. Using `[h : ...]`, as in mathlib3, causes the
    error "invalid parametric local instance". -/
    {s : Finset ι} (h : ∀ i ∈ s, FiniteDimensional K (t i)) :
    FiniteDimensional K (⨆ i ∈ s, t i : IntermediateField K L)

(h : ∀ i ∈ s, FiniteDimensional K ↥(t i))


@[simp, fun_prop]
theorem Differentiable.pow (ha : Differentiable 𝕜 a) (n : ℕ) : Differentiable 𝕜 fun x => a x ^ n

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a : E → 𝔸}
(ha : Differentiable 𝕜 a)
(n : ℕ)


{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
(a : β)


@[simp]
theorem unop_top : (⊤ : Subalgebra R Aᵐᵒᵖ).unop = ⊤

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]


@[simp]
theorem inf_ndinsert (a : α) (s : Multiset α) : (ndinsert a s).inf = a ⊓ s.inf

{α : Type u_1}
[SemilatticeInf α]
[OrderTop α]
[DecidableEq α]
(a : α)
(s : Multiset α)


@[simp]
theorem cospanExt_hom_app_right :
    (cospanExt iX iY iZ wf wg).hom.app WalkingCospan.right = iY.hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z X' Y' Z' : C}
(iX : X ≅ X')
(iY : Y ≅ Y')
(iZ : Z ≅ Z')
{f : X ⟶ Z}
{g : Y ⟶ Z}
{f' : X' ⟶ Z'}
{g' : Y' ⟶ Z'}
(wf : iX.hom ≫ f' = f ≫ iZ.hom)
(wg : iY.hom ≫ g' = g ≫ iZ.hom)

(CategoryTheory.Limits.cospanExt iX iY iZ wf wg).hom.app CategoryTheory.Limits.WalkingCospan.right = iY.hom


theorem exists_rat_pow_btwn_rat_aux (hn : n ≠ 0) (x y : ℝ) (h : x < y) (hy : 0 < y) :
    ∃ q : ℚ, 0 < q ∧ x < (q : ℝ) ^ n ∧ (q : ℝ) ^ n < y


theorem IsTopologicalBasis.of_hasBasis_nhds {s : Set (Set α)}
    (h_nhds : ∀ a, (𝓝 a).HasBasis (fun t ↦ t ∈ s ∧ a ∈ t) id) : IsTopologicalBasis s

(h_nhds : ∀ (a : α), (𝓝 a).HasBasis (fun t => t ∈ s ∧ a ∈ t) id)


theorem eq_zero [HasZeroMorphisms C] (o : HomOrthogonal s) {i j : ι} (w : i ≠ j) (f : s i ⟶ s j) :
    f = 0


theorem completion_apply {_ : MeasurableSpace α} (μ : Measure α) (s : Set α) :
    μ.completion s = μ s

∀ {x : MeasurableSpace α} (μ : MeasureTheory.Measure α) (s : Set α), μ.completion s = μ s


@[simp]
lemma comp_mem_iff (i : X ⟶ Y) (f : Y ⟶ Z) [IsIso i] (S : Sieve Z) :
    S (i ≫ f) ↔ S f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : C}
(i : X ⟶ Y)
(f : Y ⟶ Z)
[CategoryTheory.IsIso i]
(S : CategoryTheory.Sieve Z)

S.arrows (CategoryTheory.CategoryStruct.comp i f) ↔ S.arrows f


/-- Any two morphisms to a terminal object are equal. -/
theorem IsTerminal.hom_ext {X Y : C} (t : IsTerminal X) (f g : Y ⟶ X) : f = g

(t : CategoryTheory.Limits.IsTerminal X)


@[simp]
lemma inl_descCochain :
    (inl φ).comp (descCochain φ α β h) (by omega) = α

(α : CochainComplex.HomComplex.Cochain F K m)

(β : CochainComplex.HomComplex.Cochain G K n)

(CochainComplex.mappingCone.inl φ).comp (CochainComplex.mappingCone.descCochain φ α β h) ⋯ = α


@[to_additive]
theorem exponent_ne_zero_of_finite : exponent G ≠ 0

{G : Type u}
[LeftCancelMonoid G]
[Finite G]


theorem Lex.acc_zero (hbot : ∀ ⦃i a⦄, ¬s i a 0) : Acc (DFinsupp.Lex r s) 0

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Zero (α i)]
{r : ι → ι → Prop}
{s : (i : ι) → α i → α i → Prop}
(hbot : ∀ ⦃i : ι⦄ ⦃a : α i⦄, ¬s i a 0)


lemma le_biSup {ι : Type*} {s : Set ι} (f : ι → α) {i : ι} (hi : i ∈ s) :
    f i ≤ ⨆ i ∈ s, f i

{α : Type u_1}
[CompleteLattice α]
{ι : Type u_9}
{s : Set ι}
(f : ι → α)
{i : ι}
(hi : i ∈ s)


@[simp]
theorem infIrred_ofDual {a : αᵒᵈ} : InfIrred (ofDual a) ↔ SupIrred a

{α : Type u_2}
[SemilatticeInf α]
{a : αᵒᵈ}

InfIrred (OrderDual.ofDual a) ↔ SupIrred a


@[to_additive]
theorem prod_map_pow {n : ℕ} : (m.map fun i => f i ^ n).prod = (m.map f).prod ^ n

{ι : Type u_2}
{α : Type u_3}
[AddCommMonoid α]
{m : Multiset ι}
{f : ι → α}
{n : ℕ}

(Multiset.map (fun i => n • f i) m).sum = n • (Multiset.map f m).sum


theorem one_div_pow_le_one_div_pow_of_le (a1 : 1 ≤ a) {m n : ℕ} (mn : m ≤ n) :
    1 / a ^ n ≤ 1 / a ^ m

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}
(a1 : 1 ≤ a)
{m n : ℕ}
(mn : m ≤ n)


theorem map_inf [SemilatticeSup β] {f : α → β} (hf : Antitone f) (x y : α) :
    f (x ⊓ y) = f x ⊔ f y

{α : Type u}
{β : Type v}
[LinearOrder α]
[SemilatticeSup β]
{f : α → β}
(hf : Antitone f)
(x y : α)


theorem projIic_of_le (hx : b ≤ x) : projIic b x = ⟨b, le_rfl⟩

{α : Type u_1}
[LinearOrder α]
{b x : α}
(hx : b ≤ x)


/-- The value of `weightedVSubOfPoint`, where the given points are equal. -/
@[simp (high)]
theorem weightedVSubOfPoint_apply_const (w : ι → k) (p : P) (b : P) :
    s.weightedVSubOfPoint (fun _ => p) b w = (∑ i ∈ s, w i) • (p -ᵥ b)

{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 b : P)

(s.weightedVSubOfPoint (fun x => p) b) w = (∑ i ∈ s, w i) • (p -ᵥ b)


theorem Derivation.liftKaehlerDifferential_comp (D : Derivation R S M) :
    D.liftKaehlerDifferential.compDer (KaehlerDifferential.D R S) = D

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{M : Type u_1}
[AddCommGroup M]
[Module R M]
[Module S M]
[IsScalarTower R S M]
(D : Derivation R S M)


theorem ContinuousOn.div_const (hf : ContinuousOn f s) (y : G₀) :
    ContinuousOn (fun x => f x / y) s

{α : Type u_1}
{G₀ : Type u_3}
[DivInvMonoid G₀]
[TopologicalSpace G₀]
[ContinuousMul G₀]
{f : α → G₀}
{s : Set α}
[TopologicalSpace α]
(hf : ContinuousOn f s)
(y : G₀)


/-- Product of a multiset of elements in an intermediate field is in the intermediate_field. -/
protected theorem multiset_prod_mem (m : Multiset L) : (∀ a ∈ m, a ∈ S) → m.prod ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
(m : Multiset L)


lemma add_of_Z_eq_zero {P Q : Fin 3 → F} (hP : W.Nonsingular P) (hQ : W.Nonsingular Q)
    (hPz : P z = 0) (hQz : Q z = 0) : W.add P Q = P x ^ 2 • ![1, 1, 0]

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P Q : Fin 3 → F}
(hP : W.Nonsingular P)
(hQ : W.Nonsingular Q)
(hPz : P z = 0)
(hQz : Q z = 0)


@[simp]
lemma obj_one : obj F X 1 = F.obj' 0

(F : CategoryTheory.ComposableArrows C n)

CategoryTheory.ComposableArrows.Precomp.obj F X 1 = F.obj' 0 ⋯


theorem mem_toCotangent_ker {x : I} : x ∈ LinearMap.ker I.toCotangent ↔ (x : R) ∈ I ^ 2

{R : Type u}
[CommRing R]
(I : Ideal R)
{x : ↥I}

x ∈ LinearMap.ker I.toCotangent ↔ ↑x ∈ I ^ 2


/-- The injection of `Y` in the optimal coupling between `X` and `Y` is an isometry. -/
theorem isometry_optimalGHInjr : Isometry (optimalGHInjr X Y)

(X : Type u)
(Y : Type v)
[MetricSpace X]
[CompactSpace X]
[Nonempty X]
[MetricSpace Y]
[CompactSpace Y]
[Nonempty Y]

Isometry (GromovHausdorff.optimalGHInjr X Y)


lemma equiv_some_of_Z_ne_zero {P : Fin 3 → F} (hPz : P z ≠ 0) :
    P ≈ ![P x / P z ^ 2, P y / P z ^ 3, 1]

{F : Type v}
[Field F]
{P : Fin 3 → F}
(hPz : P z ≠ 0)


@[simp]
theorem id_comp (f : β →𝒄 γ) : id.comp f = f

{β : Type v}
{γ : Type u_3}
[OmegaCompletePartialOrder β]
[OmegaCompletePartialOrder γ]
(f : β →𝒄 γ)

OmegaCompletePartialOrder.ContinuousHom.id.comp f = f


theorem condexp_of_aestronglyMeasurable' (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] {f : α → F'}
    (hf : AEStronglyMeasurable' m f μ) (hfi : Integrable f μ) : μ[f|m] =ᵐ[μ] f

[hμm : MeasureTheory.SigmaFinite (μ.trim hm)]

(hf : MeasureTheory.AEStronglyMeasurable' m f μ)


theorem invEmbedding_comp (i : Fin c.length) (j : Fin (c.blocksFun i)) :
    (c.invEmbedding (c.embedding i j) : ℕ) = j

{n : ℕ}
(c : Composition n)
(i : Fin c.length)
(j : Fin (c.blocksFun i))

↑(c.invEmbedding ((c.embedding i) j)) = ↑j


/-- `WittVector.frobenius` as an equiv. -/
@[simps (config := .asFn)]
def frobeniusEquiv [PerfectRing R p] : WittVector p R ≃+* WittVector p R

(p : ℕ)
(R : Type u_1)
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CharP R p]
[PerfectRing R p]

⇑(WittVector.frobeniusEquiv p R).symm = ⇑(WittVector.map ↑(frobeniusEquiv R p).symm)


@[to_additive (attr := simp) zero_le]
theorem one_le (a : α) : 1 ≤ a

{α : Type u}
[CanonicallyOrderedCommMonoid α]
(a : α)


@[norm_cast]
theorem coe_toFinsupp : (l.toFinsupp : ℕ → M) = (l.getD · 0)

{M : Type u_1}
[Zero M]
(l : List M)
[DecidablePred fun x => l.getD x 0 ≠ 0]


theorem Icc_ssubset_Icc_left (hI : a₂ ≤ b₂) (ha : a₂ < a₁) (hb : b₁ ≤ b₂) :
    Icc a₁ b₁ ⊂ Icc a₂ b₂

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a₁ a₂ b₁ b₂ : α}
(hI : a₂ ≤ b₂)
(ha : a₂ < a₁)
(hb : b₁ ≤ b₂)


theorem DenseRange.nhdsWithin_neBot {ι : Type*} {f : ι → α} (h : DenseRange f) (x : α) :
    NeBot (𝓝[range f] x)

{α : Type u_1}
[TopologicalSpace α]
{ι : Type u_7}
{f : ι → α}
(h : DenseRange f)
(x : α)


@[to_additive (attr := simp)] lemma mabs_one : |(1 : α)|ₘ = 1

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


/-- The absolute value of the restricted sum is less than the full sum of the absolute values. -/
lemma abs_le_tsum_abs (N : ℕ) (a : Fin 2 → ZMod N) (k : ℤ) (hk : 3 ≤ k) (z : ℍ) :
    Complex.abs (eisensteinSeries a k z) ≤ ∑' (x : Fin 2 → ℤ), Complex.abs (eisSummand k x z)

Complex.abs (eisensteinSeries a k z) ≤ ∑' (x : Fin 2 → ℤ), Complex.abs (EisensteinSeries.eisSummand k x z)


private lemma pairMap_of_snd_nmem_fst {t : Finset σ × σ} (h : t.snd ∉ t.fst) :
    pairMap σ t = (t.fst.cons t.snd h, t.snd)

(σ : Type u_1)
[DecidableEq σ]
{t : Finset σ × σ}
(h : t.2 ∉ t.1)

MvPolynomial.NewtonIdentities.pairMap σ t = (Finset.cons t.2 t.1 h, t.2)


theorem pairwise_and_iff : l.Pairwise (fun a b => R a b ∧ S a b) ↔ Pairwise R l ∧ Pairwise S l

∀ {α : Type u_1} {R : α → α → Prop} {l : List α} {S : α → α → Prop},
  List.Pairwise (fun a b => R a b ∧ S a b) l ↔ List.Pairwise R l ∧ List.Pairwise S l


@[simp]
theorem coe_ndunion (l₁ l₂ : List α) : @ndunion α _ l₁ l₂ = (l₁ ∪ l₂ : List α)

{α : Type u_1}
[DecidableEq α]
(l₁ l₂ : List α)


protected theorem ContDiffWithinAt.insert (h : ContDiffWithinAt 𝕜 n f s x) :
    ContDiffWithinAt 𝕜 n f (insert x s) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ∞}
(h : ContDiffWithinAt 𝕜 n f s x)


lemma iIndep.iIndepSets' (hμ : iIndep m κ μ) :
    iIndepSets (fun x ↦ {s | MeasurableSet[m x] s}) κ μ

(hμ : ProbabilityTheory.Kernel.iIndep m κ μ)

ProbabilityTheory.Kernel.iIndepSets (fun x => {s | MeasurableSet s}) κ μ


theorem rightLim_le_leftLim (h : x ≤ y) : rightLim f y ≤ leftLim f x

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Antitone f)
{x y : α}
(h : x ≤ y)

Function.rightLim f y ≤ Function.leftLim f x


theorem of_leftInverse [DecidableEq ι] (i : ι) :
    Function.LeftInverse (lift <| Pi.mulSingle i (MonoidHom.id (M i))) of

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
[DecidableEq ι]
(i : ι)

Function.LeftInverse ⇑(Monoid.CoprodI.lift (Pi.mulSingle i (MonoidHom.id (M i)))) ⇑Monoid.CoprodI.of


@[to_additive]
theorem Subgroup.Normal.eq_bot_or_eq_top [IsSimpleGroup G] {H : Subgroup G} (Hn : H.Normal) :
    H = ⊥ ∨ H = ⊤

{G : Type u_1}
[Group G]
[IsSimpleGroup G]
{H : Subgroup G}
(Hn : H.Normal)


theorem comp_comp_symm_mem_uniformity_sets {s : Set (α × α)} (hs : s ∈ 𝓤 α) :
    ∃ t ∈ 𝓤 α, SymmetricRel t ∧ t ○ t ○ t ⊆ s

{α : Type ua}
[UniformSpace α]
{s : Set (α × α)}
(hs : s ∈ 𝓤 α)


theorem map_birkhoffSum {F N : Type*} [AddCommMonoid N] [FunLike F M N] [AddMonoidHomClass F M N]
    (g' : F) (f : α → α) (g : α → M) (n : ℕ) (x : α) :
    g' (birkhoffSum f g n x) = birkhoffSum f (g' ∘ g) n x

{α : Type u_1}
{M : Type u_2}
[AddCommMonoid M]
{F : Type u_3}
{N : Type u_4}
[AddCommMonoid N]
[FunLike F M N]
[AddMonoidHomClass F M N]
(g' : F)
(f : α → α)
(g : α → M)
(n : ℕ)
(x : α)

g' (birkhoffSum f g n x) = birkhoffSum f (⇑g' ∘ g) n x


theorem fst_lt_add_of_mem_enumFrom {x : ℕ × α} {n : ℕ} {l : List α} (h : x ∈ enumFrom n l) :
    x.1 < n + length l

{α : Type u_1}
{x : ℕ × α}
{n : ℕ}
{l : List α}
(h : x ∈ List.enumFrom n l)


@[simp]
theorem range_inl_inter_range_inr : range (Sum.inl : α → α ⊕ β) ∩ range Sum.inr = ∅

Set.range Sum.inl ∩ Set.range Sum.inr = ∅


@[simp]
theorem imageToKernel_epi_comp {Z : V} (h : Z ⟶ A) [Epi h] (w) :
    imageToKernel (h ≫ f) g w =
      Subobject.ofLE _ _ (imageSubobject_comp_le h f) ≫
        imageToKernel f g ((cancel_epi h).mp (by simpa using w : h ≫ f ≫ g = h ≫ 0))

imageToKernel (h ≫ f) g w =
  (CategoryTheory.Limits.imageSubobject (h ≫ f)).ofLE (CategoryTheory.Limits.imageSubobject f) ⋯ ≫ imageToKernel f g ⋯


/-- This follows this proof from
* Borceux, Handbook of categorical algebra 1, Theorem 2.13.4
although with different names.
-/
theorem colimitLimitToLimitColimit_surjective :
    Function.Surjective (colimitLimitToLimitColimit F)

{J : Type u₁}
{K : Type u₂}
[CategoryTheory.SmallCategory J]
[CategoryTheory.Category.{v₂, u₂} K]
[Small.{v, u₂} K]
[CategoryTheory.FinCategory J]
(F : J × K ⥤ Type v)
[CategoryTheory.IsFiltered K]


theorem addLECancellable_coe (x : ℝ) : AddLECancellable (x : EReal)


theorem measure_union_ne_top (hs : μ s ≠ ∞) (ht : μ t ≠ ∞) : μ (s ∪ t) ≠ ∞

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s t : Set α}
(hs : μ s ≠ ⊤)
(ht : μ t ≠ ⊤)

μ (s ∪ t) ≠ ⊤


/-- An algebra over a commutative semiring is `Algebra.FinitePresentation` if it is the quotient of
a polynomial ring in `n` variables by a finitely generated ideal. -/
class Algebra.FinitePresentation [CommSemiring R] [Semiring A] [Algebra R A] : Prop where
  out : ∃ (n : ℕ) (f : MvPolynomial (Fin n) R →ₐ[R] A), Surjective f ∧ f.toRingHom.ker.FG

{R : Type w₁}
{A : Type w₂}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[self : Algebra.FinitePresentation R A]

∃ n f, Function.Surjective ⇑f ∧ (RingHom.ker f.toRingHom).FG


theorem setLIntegral_deterministic' {f : β → ℝ≥0∞} {g : α → β} {a : α} (hg : Measurable g)
    (hf : Measurable f) {s : Set β} (hs : MeasurableSet s) [Decidable (g a ∈ s)] :
    ∫⁻ x in s, f x ∂deterministic g hg a = if g a ∈ s then f (g a) else 0

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{f : β → ℝ≥0∞}
{g : α → β}
{a : α}
(hg : Measurable g)
(hf : Measurable f)
{s : Set β}
(hs : MeasurableSet s)
[Decidable (g a ∈ s)]

∫⁻ (x : β) in s, f x ∂(ProbabilityTheory.Kernel.deterministic g hg) a = if g a ∈ s then f (g a) else 0


@[simp]
theorem nnnorm_fst (a : 𝓜(𝕜, A)) : ‖a.fst‖₊ = ‖a‖₊

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
[StarRing A]
[CstarRing A]
(a : 𝓜(𝕜, A))


theorem finite_isBot (α : Type*) [PartialOrder α] : { x : α | IsBot x }.Finite


/-- This lemma has an abbreviated name because it is used frequently. -/
theorem cancel_of_ne {a : ℝ≥0∞} (h : a ≠ ∞) : AddLECancellable a


@[simp]
theorem find_shiftr (x : X) : K.shiftr.find x = K.find x + 1

{X : Type u_1}
[TopologicalSpace X]
(K : CompactExhaustion X)
(x : X)


/-- Inversion on a group is a `MulEquiv` to the opposite group. When `G` is commutative, there is
`MulEquiv.inv`. -/
@[to_additive (attr := simps! (config := { fullyApplied := false, simpRhs := true }))
      "Negation on an additive group is an `AddEquiv` to the opposite group. When `G`
      is commutative, there is `AddEquiv.inv`."]
def MulEquiv.inv' (G : Type*) [DivisionMonoid G] : G ≃* Gᵐᵒᵖ

⇑(AddEquiv.neg' G).symm = Neg.neg ∘ AddOpposite.unop


theorem mul_floor_map_zero_le_floor_iterate_zero (n : ℕ) : ↑n * ⌊f 0⌋ ≤ ⌊f^[n] 0⌋


/-- If `CommSemiring` homs `g : R →+* P, l : P →+* A` induce maps of localizations, the composition
of the induced maps equals the map of localizations induced by `l ∘ g`. -/
theorem map_comp_map {A : Type*} [CommSemiring A] {U : Submonoid A} {W} [CommSemiring W]
    [Algebra A W] [IsLocalization U W] {l : P →+* A} (hl : T ≤ U.comap l) :
    (map W l hl).comp (map Q g hy : S →+* _) = map W (l.comp g) fun _ hx => hl (hy hx)

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
[IsLocalization M S]
{g : R →+* P}
{T : Submonoid P}
{Q : Type u_4}
[CommSemiring Q]
(hy : M ≤ Submonoid.comap g T)
[Algebra P Q]
[IsLocalization T Q]
{A : Type u_5}
[CommSemiring A]
{U : Submonoid A}
{W : Type u_6}
[CommSemiring W]
[Algebra A W]
[IsLocalization U W]
{l : P →+* A}
(hl : T ≤ Submonoid.comap l U)

(IsLocalization.map W l hl).comp (IsLocalization.map Q g hy) = IsLocalization.map W (l.comp g) ⋯


@[simp] lemma bot_mul_top : (⊥ : EReal) * ⊤ = ⊥


theorem HasStrictFDerivAt.exp (hf : HasStrictFDerivAt f f' x) :
    HasStrictFDerivAt (fun x => Real.exp (f x)) (Real.exp (f x) • f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{x : E}
(hf : HasStrictFDerivAt f f' x)


/-- Right Kan extensions of isomorphic functors are isomorphic. -/
@[simps]
noncomputable def rightKanExtensionUniqueOfIso {G : C ⥤ H} (i : F ≅ G) (G' : D ⥤ H)
    (β : L ⋙ G' ⟶ G) [G'.IsRightKanExtension β] : F' ≅ G'

{C : Type u_1}
{H : Type u_3}
{D : Type u_5}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_8, u_3} H]
[CategoryTheory.Category.{u_9, u_5} D]
(F' : CategoryTheory.Functor D H)
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
(α : L.comp F' ⟶ F)
[F'.IsRightKanExtension α]
{G : CategoryTheory.Functor C H}
(i : F ≅ G)
(G' : CategoryTheory.Functor D H)
(β : L.comp G' ⟶ G)
[G'.IsRightKanExtension β]

(F'.rightKanExtensionUniqueOfIso α i G' β).inv =
  F'.liftOfIsRightKanExtension α G' (CategoryTheory.CategoryStruct.comp β i.inv)


@[simp]
theorem star_mul_self [Mul R] [StarMul R] (x : R) : IsSelfAdjoint (star x * x)

{R : Type u_1}
[Mul R]
[StarMul R]
(x : R)


theorem div_neg (a : K) : a / -b = -(a / b)

{K : Type u_3}
[DivisionMonoid K]
[HasDistribNeg K]
{b : K}
(a : K)


theorem lt_iff_exists_real_btwn :
    a < b ↔ ∃ r : ℝ, 0 ≤ r ∧ a < ENNReal.ofReal r ∧ (ENNReal.ofReal r : ℝ≥0∞) < b

a < b ↔ ∃ r, 0 ≤ r ∧ a < ENNReal.ofReal r ∧ ENNReal.ofReal r < b


theorem lcm_dvd_iff [GCDMonoid α] {a b c : α} : lcm a b ∣ c ↔ a ∣ c ∧ b ∣ c

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
{a b c : α}


/-- The derivative of `log ∘ f` is the logarithmic derivative provided `f` is differentiable and
`f x  ≠ 0`. -/
lemma Real.deriv_log_comp_eq_logDeriv {f : ℝ → ℝ} {x : ℝ} (h₁ : DifferentiableAt ℝ f x)
    (h₂ : f x ≠ 0) : deriv (log ∘ f) x = logDeriv f x


@[simp]
theorem star_empty [Star α] : (∅ : Set α)⋆ = ∅


@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{X : Ω → ℝ}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsProbabilityMeasure μ]

ProbabilityTheory.centralMoment X 1 μ = 0


@[simp]
theorem not_mem_zero (a : α) : a ∉ (0 : Multiset α)


@[simp]
theorem comap_top {f : P₁ →ᵃ[k] P₂} : (⊤ : AffineSubspace k P₂).comap f = ⊤

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
{f : P₁ →ᵃ[k] P₂}


theorem inv_mul_lt_iff (h : 0 < b) : b⁻¹ * a < c ↔ a < b * c

{α : Type u_2}
[LinearOrderedSemifield α]
{a b c : α}
(h : 0 < b)


/-- A monomorphism in `SimplexCategory` must increase lengths-/
theorem len_le_of_mono {x y : SimplexCategory} {f : x ⟶ y} : Mono f → x.len ≤ y.len


/-- Build an isomorphism in the category `BialgebraCat R` from a
`BialgEquiv`. -/
@[simps]
def toBialgebraCatIso (e : X ≃ₐc[R] Y) : BialgebraCat.of R X ≅ BialgebraCat.of R Y

{R : Type u}
[CommRing R]
{X Y : Type v}
[Ring X]
[Ring Y]
[Bialgebra R X]
[Bialgebra R Y]
(e : X ≃ₐc[R] Y)


protected theorem nnnorm [NormedAddCommGroup γ] [BorelSpace γ] (h : IdentDistrib f g μ ν) :
    IdentDistrib (fun x => ‖f x‖₊) (fun x => ‖g x‖₊) μ ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)

ProbabilityTheory.IdentDistrib (fun x => ‖f x‖₊) (fun x => ‖g x‖₊) μ ν


/-- A morphism of schemes `X ⟶ Y` is a closed immersion if the underlying
topological map is a closed embedding and the induced stalk maps are surjective. -/
@[mk_iff]
class IsClosedImmersion {X Y : Scheme} (f : X ⟶ Y) : Prop where
  base_closed : ClosedEmbedding f.1.base
  surj_on_stalks : ∀ x, Function.Surjective (f.stalkMap x)

[self : AlgebraicGeometry.IsClosedImmersion f]


@[local simp] lemma emod_two_ne_zero : ¬n % 2 = 0 ↔ n % 2 = 1


/-- For maps between vector spaces, `MDifferentiableOn` and `DifferentiableOn` coincide -/
theorem mdifferentiableOn_iff_differentiableOn :
    MDifferentiableOn 𝓘(𝕜, E) 𝓘(𝕜, E') f s ↔ DifferentiableOn 𝕜 f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{f : E → E'}
{s : Set E}


/-- An Akra-Bazzi recurrence is a function that satisfies the recurrence
`T n = (∑ i, a i * T (r i n)) + g n`. -/
structure AkraBazziRecurrence {α : Type*} [Fintype α] [Nonempty α]
    (T : ℕ → ℝ) (g : ℝ → ℝ) (a : α → ℝ) (b : α → ℝ) (r : α → ℕ → ℕ) where
  /-- Point below which the recurrence is in the base case -/
  n₀ : ℕ
  /-- `n₀` is always `> 0` -/
  n₀_gt_zero : 0 < n₀
  /-- The `a`'s are nonzero -/
  a_pos : ∀ i, 0 < a i
  /-- The `b`'s are nonzero -/
  b_pos : ∀ i, 0 < b i
  /-- The b's are less than 1 -/
  b_lt_one : ∀ i, b i < 1
  /-- `g` is nonnegative -/
  g_nonneg : ∀ x ≥ 0, 0 ≤ g x
  /-- `g` grows polynomially -/
  g_grows_poly : AkraBazziRecurrence.GrowsPolynomially g
  /-- The actual recurrence -/
  h_rec (n : ℕ) (hn₀ : n₀ ≤ n) : T n = (∑ i, a i * T (r i n)) + g n
  /-- Base case: `T(n) > 0` whenever `n < n₀` -/
  T_gt_zero' (n : ℕ) (hn : n < n₀) : 0 < T n
  /-- The `r`'s always reduce `n` -/
  r_lt_n : ∀ i n, n₀ ≤ n → r i n < n
  /-- The `r`'s approximate the `b`'s -/
  dist_r_b : ∀ i, (fun n => (r i n : ℝ) - b i * n) =o[atTop] fun n => n / (log n) ^ 2

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(self : AkraBazziRecurrence T g a b r)
(i : α)


/-- If there is a diagram where the morphisms `W ⟶ Y` and `X ⟶ Z` are open embeddings, and `S ⟶ T`
is mono, then the induced morphism `W ×ₛ X ⟶ Y ×ₜ Z` is also an open embedding.

```
W ⟶ Y
 ↘   ↘
  S ⟶ T
 ↗   ↗
X ⟶ Z
```
-/
theorem pullback_map_openEmbedding_of_open_embeddings {W X Y Z S T : TopCat.{u}} (f₁ : W ⟶ S)
    (f₂ : X ⟶ S) (g₁ : Y ⟶ T) (g₂ : Z ⟶ T) {i₁ : W ⟶ Y} {i₂ : X ⟶ Z} (H₁ : OpenEmbedding i₁)
    (H₂ : OpenEmbedding i₂) (i₃ : S ⟶ T) [H₃ : Mono i₃] (eq₁ : f₁ ≫ i₃ = i₁ ≫ g₁)
    (eq₂ : f₂ ≫ i₃ = i₂ ≫ g₂) : OpenEmbedding (pullback.map f₁ f₂ g₁ g₂ i₁ i₂ i₃ eq₁ eq₂)

{W X Y Z S T : TopCat}
(f₁ : W ⟶ S)
(f₂ : X ⟶ S)
(g₁ : Y ⟶ T)
(g₂ : Z ⟶ T)
{i₁ : W ⟶ Y}
{i₂ : X ⟶ Z}
(H₁ : OpenEmbedding ⇑i₁)
(H₂ : OpenEmbedding ⇑i₂)
(i₃ : S ⟶ T)
[H₃ : CategoryTheory.Mono i₃]
(eq₁ : f₁ ≫ i₃ = i₁ ≫ g₁)
(eq₂ : f₂ ≫ i₃ = i₂ ≫ g₂)

OpenEmbedding ⇑(CategoryTheory.Limits.pullback.map f₁ f₂ g₁ g₂ i₁ i₂ i₃ eq₁ eq₂)


theorem HasMFDerivAt.congr_of_eventuallyEq (h : HasMFDerivAt I I' f x f') (h₁ : f₁ =ᶠ[𝓝 x] f) :
    HasMFDerivAt I I' f₁ x f'

{f' : TangentSpace I x →L[𝕜] TangentSpace I' (f x)}