/-- A `C^n` diffeomorphism is a local diffeomorphism. -/
lemma Diffeomorph.isLocalDiffeomorph (Φ : M ≃ₘ^n⟮I, J⟯ N) : IsLocalDiffeomorph I J n Φ

{𝕜 : 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 : ℕ∞}
(Φ : M ≃ₘ^n⟮I, J⟯ N)


theorem succ_le_or_le_castSucc (p : Fin (n + 1)) (i : Fin n) : succ i ≤ p ∨ p ≤ i.castSucc


theorem map_injective (f : P →ₐ[R] P') (h : Function.Injective f) :
    Function.Injective (map f : FractionalIdeal S P → FractionalIdeal S P')

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{P' : Type u_3}
[CommRing P']
[Algebra R P']
(f : P →ₐ[R] P')
(h : Function.Injective ⇑f)


@[simp]
theorem pi_coe (γ : ∀ i, Path (as i) (bs i)) : ⇑(Path.pi γ) = fun t i => γ i t

{ι : Type u_3}
{χ : ι → Type u_4}
[(i : ι) → TopologicalSpace (χ i)]
{as bs : (i : ι) → χ i}
(γ : (i : ι) → Path (as i) (bs i))


@[to_additive]
theorem prod_univ_eight [CommMonoid β] (f : Fin 8 → β) :
    ∏ i, f i = f 0 * f 1 * f 2 * f 3 * f 4 * f 5 * f 6 * f 7

{β : Type u_2}
[AddCommMonoid β]
(f : Fin 8 → β)


lemma PrimeSpectrum.embedding_tensorProductTo_of_surjectiveOnStalks_aux
    (p₁ p₂ : PrimeSpectrum (S ⊗[R] T))
    (h : tensorProductTo R S T p₁ = tensorProductTo R S T p₂) :
    p₁ ≤ p₂

(hRT : (algebraMap R T).SurjectiveOnStalks)

(h : PrimeSpectrum.tensorProductTo R S T p₁ = PrimeSpectrum.tensorProductTo R S T p₂)


/-- Two multivariate formal power series are equal if all their coefficients are equal. -/
@[ext]
theorem ext {φ ψ} (h : ∀ n : σ →₀ ℕ, coeff R n φ = coeff R n ψ) : φ = ψ

(h : ∀ (n : σ →₀ ℕ), (MvPowerSeries.coeff R n) φ = (MvPowerSeries.coeff R n) ψ)


theorem mono_blimsup (h : ∀ x, p x → u x ≤ v x) : blimsup u f p ≤ blimsup v f p

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{p : β → Prop}
{u v : β → α}
(h : ∀ (x : β), p x → u x ≤ v x)

Filter.blimsup u f p ≤ Filter.blimsup v f p


protected theorem map_pow (n : ℕ) : map f (I ^ n) = map f I ^ n

{R : Type u}
{S : Type v}
{F : Type u_1}
[CommRing R]
[CommRing S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
(I : Ideal R)
(n : ℕ)


lemma AlexandrovDiscrete.sup {t₁ t₂ : TopologicalSpace α} (_ : @AlexandrovDiscrete α t₁)
    (_ : @AlexandrovDiscrete α t₂) :
    @AlexandrovDiscrete α (t₁ ⊔ t₂)

{α : Type u_3}
{t₁ t₂ : TopologicalSpace α}

AlexandrovDiscrete α → AlexandrovDiscrete α → AlexandrovDiscrete α


theorem _root_.Set.Finite.measure_zero (h : s.Finite) (μ : Measure α) [NoAtoms μ] : μ s = 0

{α : Type u_1}
{m0 : MeasurableSpace α}
{s : Set α}
(h : s.Finite)
(μ : MeasureTheory.Measure α)
[MeasureTheory.NoAtoms μ]


lemma coe_toInteger {k : ℕ+} (hζ : IsPrimitiveRoot ζ k) : hζ.toInteger.1 = ζ

{K : Type u}
[Field K]
{ζ : K}
{k : ℕ+}
(hζ : IsPrimitiveRoot ζ ↑k)


theorem Basis.insert_basis_insert (hI : M.Basis I X) (h : M.Indep (insert e I)) :
    M.Basis (insert e I) (insert e X)

{α : Type u_1}
{M : Matroid α}
{I X : Set α}
{e : α}
(hI : M.Basis I X)
(h : M.Indep (insert e I))


/-- Given a sieve `S` on `X : C`, a presheaf `P : Cᵒᵖ ⥤ A`, and an object `E` of `A`,
    the cones over the natural diagram `S.arrows.diagram.op ⋙ P` associated to `S` and `P`
    with cone point `E` are in 1-1 correspondence with sieve_compatible family of elements
    for the sieve `S` and the presheaf of types `Hom (E, P -)`. -/
@[simps]
def conesEquivSieveCompatibleFamily :
    (S.arrows.diagram.op ⋙ P).cones.obj E ≃
      { x : FamilyOfElements (P ⋙ coyoneda.obj E) (S : Presieve X) // x.SieveCompatible }

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{A : Type u₂}
[CategoryTheory.Category.{v₂, u₂} A]
(P : CategoryTheory.Functor Cᵒᵖ A)
{X : C}
(S : CategoryTheory.Sieve X)
(E : Aᵒᵖ)
(x : { x // x.SieveCompatible })
(f : S.arrows.categoryᵒᵖ)

((CategoryTheory.Presheaf.conesEquivSieveCompatibleFamily P S E).symm x).app f = ↑x (Opposite.unop f).obj.hom ⋯


nonrec lemma anti {l'} (h : EventuallyConst f l) (hl' : l' ≤ l) : EventuallyConst f l'

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{f : α → β}
{l' : Filter α}
(h : Filter.EventuallyConst f l)
(hl' : l' ≤ l)


/-- A semiring homomorphism is an additive monoid homomorphism. -/
theorem to_isAddMonoidHom (hf : IsSemiringHom f) : IsAddMonoidHom f

{α : Type u}
{β : Type v}
[Semiring α]
[Semiring β]
{f : α → β}
(hf : IsSemiringHom f)


lemma bind_toFinset [DecidableEq α] (s : Multiset α) (t : α → Multiset β) :
    (s.bind t).toFinset = s.toFinset.biUnion fun a ↦ (t a).toFinset

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
[DecidableEq α]
(s : Multiset α)
(t : α → Multiset β)

(s.bind t).toFinset = s.toFinset.biUnion fun a => (t a).toFinset


@[to_additive (attr := measurability)]
theorem _root_.Multiset.aestronglyMeasurable_prod (s : Multiset (α → M))
    (hs : ∀ f ∈ s, AEStronglyMeasurable f μ) :
    AEStronglyMeasurable (fun x => (s.map fun f : α → M => f x).prod) μ

(hs : ∀ f ∈ s, MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (fun x => (Multiset.map (fun f => f x) s).sum) μ


theorem tendsto_atTop_of_eventually_const {ι : Type*} [SemilatticeSup ι] [Nonempty ι]
    {u : ι → X} {i₀ : ι} (h : ∀ i ≥ i₀, u i = x) : Tendsto u atTop (𝓝 x)

{X : Type u}
{x : X}
[TopologicalSpace X]
{ι : Type u_3}
[SemilatticeSup ι]
[Nonempty ι]
{u : ι → X}
{i₀ : ι}
(h : ∀ i ≥ i₀, u i = x)


@[simp]
theorem le_normalizer : N ≤ N.normalizer

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(N : LieSubmodule R L M)


lemma IsSMulRegular.rTensor : IsSMulRegular (M' ⊗[R] M) r

{R : Type u_1}
(M : Type u_3)
{M' : Type u_4}
[CommRing R]
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
[Module.Flat R M]
{r : R}
(h : IsSMulRegular M' r)


theorem inner_single_left (i : ι) (a : G i) (f : lp G 2) : ⟪lp.single 2 i a, f⟫ = ⟪a, f i⟫

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{G : ι → Type u_4}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
(i : ι)
(a : G i)
(f : ↥(lp G 2))


/-- A function `f : α × β → StieltjesFunction` is called a conditional kernel CDF of `κ` with
respect to `ν` if it is measurable, tends to to 0 at -∞ and to 1 at +∞ for all `p : α × β`,
`fun b ↦ f (a, b) x` is `(ν a)`-integrable for all `a : α` and `x : ℝ` and for all
measurable sets `s : Set β`, `∫ b in s, f (a, b) x ∂(ν a) = (κ a (s ×ˢ Iic x)).toReal`. -/
structure IsCondKernelCDF (f : α × β → StieltjesFunction) (κ : Kernel α (β × ℝ)) (ν : Kernel α β) :
    Prop :=
  measurable (x : ℝ) : Measurable fun p ↦ f p x
  integrable (a : α) (x : ℝ) : Integrable (fun b ↦ f (a, b) x) (ν a)
  tendsto_atTop_one (p : α × β) : Tendsto (f p) atTop (𝓝 1)
  tendsto_atBot_zero (p : α × β) : Tendsto (f p) atBot (𝓝 0)
  setIntegral (a : α) {s : Set β} (_hs : MeasurableSet s) (x : ℝ) :
    ∫ b in s, f (a, b) x ∂(ν a) = (κ a (s ×ˢ Iic x)).toReal

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

(self : ProbabilityTheory.IsCondKernelCDF f κ ν)

∫ (b : β) in s, ↑(f (a, b)) x ∂ν a = ((κ a) (s ×ˢ Set.Iic x)).toReal


theorem length_product (l₁ : List α) (l₂ : List β) :
    length (l₁ ×ˢ l₂) = length l₁ * length l₂

{α : Type u_1}
{β : Type u_2}
(l₁ : List α)
(l₂ : List β)

(l₁ ×ˢ l₂).length = l₁.length * l₂.length


@[to_additive]
theorem isComplement_singleton_left {g : G} : IsComplement {g} S ↔ S = univ

{G : Type u_1}
[AddGroup G]
{S : Set G}
{g : G}

AddSubgroup.IsComplement {g} S ↔ S = Set.univ


theorem mem_cocompact_of_closedBall_compl_subset [ProperSpace α] (c : α)
    (h : ∃ r, (closedBall c r)ᶜ ⊆ s) : s ∈ cocompact α

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
[ProperSpace α]
(c : α)
(h : ∃ r, (Metric.closedBall c r)ᶜ ⊆ s)


theorem some_injective : Injective (@Part.some α)


lemma StrictAnti.not_bddBelow_range [NoMaxOrder α] [PredOrder β] [IsPredArchimedean β]
    (hf : StrictAnti f) : ¬ BddBelow (Set.range f)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Nonempty α]
[Preorder β]
{f : α → β}
[NoMaxOrder α]
[PredOrder β]
[IsPredArchimedean β]
(hf : StrictAnti f)


/-- Vertical composition of 2-commutative squares -/
@[simps! iso'_hom_app iso'_inv_app]
def vComp (L₁ : C₁ ⥤ C₂) (L₂ : C₂ ⥤ C₃) (H₁ : C₁ ⥤ C₄) (H₂ : C₂ ⥤ C₅) (H₃ : C₃ ⥤ C₆)
    (R₁ : C₄ ⥤ C₅) (R₂ : C₅ ⥤ C₆) [CatCommSq H₁ L₁ R₁ H₂] [CatCommSq H₂ L₂ R₂ H₃] :
    CatCommSq H₁ (L₁ ⋙ L₂) (R₁ ⋙ R₂) H₃

CategoryTheory.CatCommSq.iso'.inv.app X =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.CatCommSq.iso H₂ L₂ R₂ H₃).inv.app (L₁.obj X))
    (R₂.map ((CategoryTheory.CatCommSq.iso H₁ L₁ R₁ H₂).inv.app X))


theorem transpose_list_sum [AddMonoid α] (l : List (Matrix m n α)) :
    l.sumᵀ = (l.map transpose).sum

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[AddMonoid α]
(l : List (Matrix m n α))

l.sumᵀ = (List.map Matrix.transpose l).sum


theorem HasBasis.filter_eq (h : l.HasBasis p s) : h.isBasis.filter = l

{α : Type u_1}
{ι : Sort u_4}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(h : l.HasBasis p s)


theorem isMinOn_univ_iff : IsMinOn f univ a ↔ ∀ x, f a ≤ f x

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{a : α}

IsMinOn f Set.univ a ↔ ∀ (x : α), f a ≤ f x


theorem ball_inter (x : β) (V W : Set (β × β)) : ball x (V ∩ W) = ball x V ∩ ball x W

{β : Type ub}
(x : β)
(V W : Set (β × β))

UniformSpace.ball x (V ∩ W) = UniformSpace.ball x V ∩ UniformSpace.ball x W


lemma mk_eq_zero_of_num (f : NumDenSameDeg 𝒜 x) (h : f.num = 0) : mk f = 0

(f : HomogeneousLocalization.NumDenSameDeg 𝒜 x)


@[simp]
theorem midpoint_sub_left (v₁ v₂ : V) : midpoint R v₁ v₂ - v₁ = (⅟ 2 : R) • (v₂ - v₁)

{R : Type u_1}
{V : Type u_2}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
(v₁ v₂ : V)


@[to_additive]
lemma IsCyclic.ext {G : Type*} [Group G] [Fintype G] [IsCyclic G] {d : ℕ} {a b : ZMod d}
    (hGcard : Fintype.card G = d) (h : ∀ t : G, t ^ a.val = t ^ b.val) : a = b

{G : Type u_1}
[Group G]
[Fintype G]
[IsCyclic G]
{d : ℕ}
{a b : ZMod d}
(hGcard : Fintype.card G = d)
(h : ∀ (t : G), t ^ a.val = t ^ b.val)


theorem ofTop_symm_apply {h} (x : M) : (ofTop p h).symm x = ⟨x, h.symm ▸ trivial⟩

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
(p : Submodule R M)
{h : p = ⊤}
(x : M)


@[to_additive (attr := simp, norm_cast) natCast_zsmul]
theorem zpow_natCast (a : G) : ∀ n : ℕ, a ^ (n : ℤ) = a ^ n

{G : Type u_1}
[DivInvMonoid G]
(a : G)
(n : ℕ)


theorem Measurable.of_uncurry_right {f : α → β → γ} (hf : Measurable (uncurry f)) {y : β} :
    Measurable fun x => f x y

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{mγ : MeasurableSpace γ}
{f : α → β → γ}
(hf : Measurable (Function.uncurry f))
{y : β}


lemma hasRightHomology_of_epi_of_isIso_of_mono' (φ : S₁ ⟶ S₂) [HasRightHomology S₂]
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] : HasRightHomology S₁


/-- `spanningCoe` is equivalent to `coe` for a subgraph that `IsSpanning`. -/
@[simps]
def spanningCoeEquivCoeOfSpanning (G' : Subgraph G) (h : G'.IsSpanning) :
    G'.spanningCoe ≃g G'.coe

{V : Type u}
{G : SimpleGraph V}
(G' : G.Subgraph)
(h : G'.IsSpanning)
(v : V)

↑((G'.spanningCoeEquivCoeOfSpanning h) v) = v


theorem appLE_comp_appLE {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) (U V W e₁ e₂) :
    g.appLE U V e₁ ≫ f.appLE V W e₂ =
      (f ≫ g).appLE U W (e₂.trans ((Opens.map f.1.base).map (homOfLE e₁)).le)

(e₁ : V ≤ (TopologicalSpace.Opens.map g.val.base).obj U)

(e₂ : W ≤ (TopologicalSpace.Opens.map f.val.base).obj V)

AlgebraicGeometry.Scheme.Hom.appLE g U V e₁ ≫ AlgebraicGeometry.Scheme.Hom.appLE f V W e₂ =
  AlgebraicGeometry.Scheme.Hom.appLE (f ≫ g) U W ⋯


/-- A 1-cochain of a presheaf of groups `G : Cᵒᵖ ⥤ Grp` on a family `U : I → C` of objects
consists of the data of an element in `G.obj (Opposite.op T)` whenever we have elements
`i` and `j` in `I` and maps `a : T ⟶ U i` and `b : T ⟶ U j`, and it must satisfy a compatibility
with respect to precomposition. (When the binary product of `U i` and `U j` exists, this
data for all `T`, `a` and `b` corresponds to the data of a section of `G` on this product.) -/
@[ext]
structure OneCochain where
  /-- the data involved in a 1-cochain -/
  ev (i j : I) ⦃T : C⦄ (a : T ⟶ U i) (b : T ⟶ U j) : G.obj (Opposite.op T)
  ev_precomp (i j : I) ⦃T T' : C⦄ (φ : T ⟶ T') (a : T' ⟶ U i) (b : T' ⟶ U j) :
    G.map φ.op (ev i j a b) = ev i j (φ ≫ a) (φ ≫ b) := by aesop

(self : CategoryTheory.PresheafOfGroups.OneCochain G U)

(G.map φ.op) (self.ev i j a b) =
  self.ev i j (CategoryTheory.CategoryStruct.comp φ a) (CategoryTheory.CategoryStruct.comp φ b)


protected theorem Nontrivial.nonempty (hs : s.Nontrivial) : s.Nonempty

{α : Type u}
{s : Set α}
(hs : s.Nontrivial)


@[simp] lemma factorization_floorRoot (n a : ℕ) :
    (floorRoot n a).factorization = a.factorization ⌊/⌋ n

(n.floorRoot a).factorization = a.factorization ⌊/⌋ n


theorem image_lowerBounds_subset_lowerBounds_image (Hf : MonotoneOn f t) (Hst : s ⊆ t) :
    f '' (lowerBounds s ∩ t) ⊆ lowerBounds (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s t : Set α}
(Hf : MonotoneOn f t)
(Hst : s ⊆ t)


@[reassoc (attr := simp)]
lemma d_comp_XIsoOfEq_inv (K : HomologicalComplex V c) {p₂ p₃ : ι} (h : p₃ = p₂) (p₁ : ι) :
    K.d p₁ p₂ ≫ (K.XIsoOfEq h).inv = K.d p₁ p₃


/-- The skew-adjoint part of an element of a star module, as a linear map. -/
@[simps]
def skewAdjointPart : A →ₗ[R] skewAdjoint A

(R : Type u_1)
{A : Type u_2}
[Semiring R]
[StarMul R]
[TrivialStar R]
[AddCommGroup A]
[Module R A]
[StarAddMonoid A]
[StarModule R A]
[Invertible 2]
(x : A)

↑((skewAdjointPart R) x) = ⅟2 • (x - star x)


theorem LipschitzOnWith.locallyBoundedVariationOn {f : ℝ → E} {C : ℝ≥0} {s : Set ℝ}
    (hf : LipschitzOnWith C f s) : LocallyBoundedVariationOn f s

{E : Type u_2}
[PseudoEMetricSpace E]
{f : ℝ → E}
{C : ℝ≥0}
{s : Set ℝ}
(hf : LipschitzOnWith C f s)


theorem smul_closedBall (c : 𝕜) (x : E) {r : ℝ} (hr : 0 ≤ r) :
    c • closedBall x r = closedBall (c • x) (‖c‖ * r)

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(c : 𝕜)
(x : E)
{r : ℝ}
(hr : 0 ≤ r)

c • Metric.closedBall x r = Metric.closedBall (c • x) (‖c‖ * r)


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

(K : ∀ n ∈ t, Order.succ n ∈ t → (s n ∩ s (Order.succ n)).Nonempty)


@[simp]
theorem mk_preimage_prod_right_eq_empty (ha : a ∉ s) : Prod.mk a ⁻¹' s ×ˢ t = ∅

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{a : α}
(ha : a ∉ s)


/-- For a quadratic character `χ` and when the characteristic `p` of the target ring
is a unit in the source ring, the `p`th power of the Gauss sum of`χ` and `ψ` is
`χ p` times the original Gauss sum. -/
theorem MulChar.IsQuadratic.gaussSum_frob (hp : IsUnit (p : R)) {χ : MulChar R R'}
    (hχ : IsQuadratic χ) (ψ : AddChar R R') :
    gaussSum χ ψ ^ p = χ p * gaussSum χ ψ

{R : Type u}
[CommRing R]
[Fintype R]
{R' : Type v}
[CommRing R']
(p : ℕ)
[fp : Fact (Nat.Prime p)]
[hch : CharP R' p]
(hp : IsUnit ↑p)
{χ : MulChar R R'}
(hχ : χ.IsQuadratic)
(ψ : AddChar R R')


/-- If a function is integrable on a set `s` and nonzero there, then the measurable hull of `s` is
well behaved: the restriction of the measure to `toMeasurable μ s` coincides with its restriction
to `s`. -/
theorem IntegrableOn.restrict_toMeasurable (hf : IntegrableOn f s μ) (h's : ∀ x ∈ s, f x ≠ 0) :
    μ.restrict (toMeasurable μ s) = μ.restrict s

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{s : Set α}
{μ : MeasureTheory.Measure α}
(hf : MeasureTheory.IntegrableOn f s μ)
(h's : ∀ x ∈ s, f x ≠ 0)

μ.restrict (MeasureTheory.toMeasurable μ s) = μ.restrict s


@[simp]
theorem sinh_neg_iff : sinh x < 0 ↔ x < 0


lemma stalkSpecializes_stalkMap_apply (x x' : X) (h : x ⤳ x') (y) :
    f.stalkMap x (Y.presheaf.stalkSpecializes (f.val.base.map_specializes h) y) =
      (X.presheaf.stalkSpecializes h (f.stalkMap x' y))

{X Y : AlgebraicGeometry.LocallyRingedSpace}

(y : ↑(Y.presheaf.stalk (f.val.base x')))

(AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap f x) ((Y.presheaf.stalkSpecializes ⋯) y) =
  (X.presheaf.stalkSpecializes h) ((AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap f x') y)


theorem ContMDiffWithinAt.contMDiffAt (h : ContMDiffWithinAt I I' n f s x) (ht : s ∈ 𝓝 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'}
{s : Set M}
{x : M}
{n : ℕ∞}
(h : ContMDiffWithinAt I I' n f s x)
(ht : s ∈ 𝓝 x)


theorem eq_reflection_of_eq_subspace {s s' : AffineSubspace ℝ P} [Nonempty s] [Nonempty s']
    [HasOrthogonalProjection s.direction] [HasOrthogonalProjection s'.direction] (h : s = s')
    (p : P) : (reflection s p : P) = (reflection s' p : P)

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

(EuclideanGeometry.reflection s) p = (EuclideanGeometry.reflection s') p


theorem IsTrail.count_edges_le_one [DecidableEq V] {u v : V} {p : G.Walk u v} (h : p.IsTrail)
    (e : Sym2 V) : p.edges.count e ≤ 1

{V : Type u}
{G : SimpleGraph V}
[DecidableEq V]
{u v : V}
{p : G.Walk u v}
(h : p.IsTrail)
(e : Sym2 V)


theorem sum_integral_adjacent_intervals {a : ℕ → ℝ} {n : ℕ}
    (hint : ∀ k < n, IntervalIntegrable f μ (a k) (a <| k + 1)) :
    ∑ k ∈ Finset.range n, ∫ x in a k..a <| k + 1, f x ∂μ = ∫ x in (a 0)..(a n), f x ∂μ

(hint : ∀ k < n, IntervalIntegrable f μ (a k) (a (k + 1)))

∑ k ∈ Finset.range n, ∫ (x : ℝ) in a k..a (k + 1), f x ∂μ = ∫ (x : ℝ) in a 0 ..a n, f x ∂μ


@[instance]
theorem isCountablyGenerated_principal (s : Set α) : IsCountablyGenerated (𝓟 s)


@[to_additive (attr := simp)]
theorem ofList_nil : ofList ([] : List α) = 1


theorem lt_translationNumber_of_forall_add_lt (hf : Continuous f) {z : ℝ} (hz : ∀ x, x + z < f x) :
    z < τ f

(f : CircleDeg1Lift)
(hf : Continuous ⇑f)
{z : ℝ}
(hz : ∀ (x : ℝ), x + z < f x)


lemma smul_top_inf_eq_smul_of_isSMulRegular_on_quot :
    IsSMulRegular (M ⧸ N) r → r • ⊤ ⊓ N ≤ r • N

{R : Type u_1}
{M : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
{N : Submodule R M}
{r : R}


/-- If a set `s` of semilinear functions is bounded and is closed in the weak-* topology, then its
image under coercion to functions `E → F` is a compact set. We don't have a name for `E →SL[σ] F`
with weak-* topology in `mathlib`, so we use an equivalent condition (see `isClosed_induced_iff'`).
-/
theorem isCompact_image_coe_of_bounded_of_weak_closed [ProperSpace F] {s : Set (E' →SL[σ₁₂] F)}
    (hb : IsBounded s) (hc : ∀ f : E' →SL[σ₁₂] F,
      (⇑f : E' → F) ∈ closure (((↑) : (E' →SL[σ₁₂] F) → E' → F) '' s) → f ∈ s) :
    IsCompact (((↑) : (E' →SL[σ₁₂] F) → E' → F) '' s)

{σ₁₂ : 𝕜 →+* 𝕜₂}

(hc : ∀ (f : E' →SL[σ₁₂] F), ⇑f ∈ closure (DFunLike.coe '' s) → f ∈ s)


@[to_additive]
theorem mulIndicator_div (s : Set α) (f g : α → G) :
    (mulIndicator s fun a => f a / g a) = fun a => mulIndicator s f a / mulIndicator s g a

{α : Type u_1}
{G : Type u_6}
[AddGroup G]
(s : Set α)
(f g : α → G)

(s.indicator fun a => f a - g a) = fun a => s.indicator f a - s.indicator g a


lemma sheafToPresheaf_map_sheafComposeNatTrans_eq_sheafifyCompIso_inv (P : Cᵒᵖ ⥤ D) :
    (sheafToPresheaf J E).map
      ((sheafComposeNatTrans J F (plusPlusAdjunction J D) (plusPlusAdjunction J E)).app P) =
      (sheafifyCompIso J F P).inv

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, u_3} D]

[CategoryTheory.Category.{max v u, u_4} E]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) D]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) E]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ E]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ F]

[(X : C) →
    (W : J.Cover X) →
      (P : CategoryTheory.Functor Cᵒᵖ D) → CategoryTheory.Limits.PreservesLimit (W.index P).multicospan F]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ (CategoryTheory.forget D)]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ (CategoryTheory.forget E)]

(CategoryTheory.sheafToPresheaf J E).map
    ((CategoryTheory.sheafComposeNatTrans J F (CategoryTheory.plusPlusAdjunction J D)
          (CategoryTheory.plusPlusAdjunction J E)).app
      P) =
  (J.sheafifyCompIso F P).inv


@[to_additive]
theorem prod_eq_single {f : α →₀ M} (a : α) {g : α → M → N}
    (h₀ : ∀ b, f b ≠ 0 → b ≠ a → g b (f b) = 1) (h₁ : f a = 0 → g a 0 = 1) :
    f.prod g = g a (f a)

(h₀ : ∀ (b : α), f b ≠ 0 → b ≠ a → g b (f b) = 1)


theorem norm_integral_le_of_norm_le_const_ae {a b C : ℝ} {f : ℝ → E}
    (h : ∀ᵐ x, x ∈ Ι a b → ‖f x‖ ≤ C) : ‖∫ x in a..b, f x‖ ≤ C * |b - a|

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b C : ℝ}
{f : ℝ → E}
(h : ∀ᵐ (x : ℝ), x ∈ Ι a b → ‖f x‖ ≤ C)


theorem Cofix.dest_corec' {α : TypeVec.{u} n} {β : Type u}
    (g : β → F (α.append1 (Cofix F α ⊕ β))) (x : β) :
    Cofix.dest (Cofix.corec' g x) =
      appendFun id (Sum.elim _root_.id (Cofix.corec' g)) <$$> g x

(g : β → F (α ::: (MvQPF.Cofix F α ⊕ β)))

(MvQPF.Cofix.corec' g x).dest = (TypeVec.id ::: Sum.elim id (MvQPF.Cofix.corec' g)) <$$> g x


theorem sin_eq_zero_iff {θ : ℂ} : sin θ = 0 ↔ ∃ k : ℤ, θ = k * π

Complex.sin θ = 0 ↔ ∃ k, θ = ↑k * ↑Real.pi


/-- A sequence that converges uniformly is also uniformly Cauchy -/
theorem TendstoUniformlyOn.uniformCauchySeqOn (hF : TendstoUniformlyOn F f p s) :
    UniformCauchySeqOn F p s

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{s : Set α}
{p : Filter ι}
(hF : TendstoUniformlyOn F f p s)


@[reassoc]
theorem condition (t : PullbackCone f g) : fst t ≫ f = snd t ≫ g

(t : CategoryTheory.Limits.PullbackCone f g)


theorem finite_of_fg_torsion [AddCommGroup M] [Module ℤ M] [Module.Finite ℤ M]
    (hM : Module.IsTorsion ℤ M) : _root_.Finite M

(M : Type u)
[AddCommGroup M]
[Module ℤ M]
[Module.Finite ℤ M]
(hM : Module.IsTorsion ℤ M)


@[simp]
theorem ofDual_le_ofDual_iff {a b : WithTop αᵒᵈ} : WithTop.ofDual a ≤ WithTop.ofDual b ↔ b ≤ a

{α : Type u_1}
[LE α]
{a b : WithTop αᵒᵈ}


@[simp]
theorem fst_kstar (a : α × β) : a∗.1 = a.1∗

{α : Type u_1}
{β : Type u_2}
[KleeneAlgebra α]
[KleeneAlgebra β]
(a : α × β)


@[to_additive]
theorem Nonempty.of_smul_right : (s • t).Nonempty → t.Nonempty

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


lemma StrictMonoOn.image_Ioo_subset (h : StrictMonoOn f (Icc a b)) :
    f '' Ioo a b ⊆ Ioo (f a) (f b)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{a b : α}
(h : StrictMonoOn f (Set.Icc a b))


@[to_additive]
theorem nhds_one_symm' : map Inv.inv (𝓝 (1 : G)) = 𝓝 (1 : G)

(G : Type w)
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]


@[simp]
theorem toNatOrdinal_toOrdinal (a : Ordinal) :  NatOrdinal.toOrdinal (toNatOrdinal a) = a

NatOrdinal.toOrdinal (Ordinal.toNatOrdinal a) = a


@[to_additive]
theorem HasProd.hasProd_of_prod_eq {g : γ → α}
    (h_eq : ∀ u : Finset γ, ∃ v : Finset β, ∀ v', v ⊆ v' →
      ∃ u', u ⊆ u' ∧ ∏ x ∈ u', g x = ∏ b ∈ v', f b)
    (hf : HasProd g a) : HasProd f a

(h_eq : ∀ (u : Finset γ), ∃ v, ∀ (v' : Finset β), v ⊆ v' → ∃ u', u ⊆ u' ∧ ∑ x ∈ u', g x = ∑ b ∈ v', f b)


private theorem exists_signed_sum_aux {α : Type u_1} [DecidableEq α] (s : Finset α) (f : α → ℤ) :
    ∃ (β : Type u_1) (t : Finset β) (sgn : β → SignType) (g : β → α),
      (∀ b, g b ∈ s) ∧
        (t.card = ∑ a ∈ s, (f a).natAbs) ∧
          ∀ a ∈ s, (∑ b ∈ t, if g b = a then (sgn b : ℤ) else 0) = f a

∃ β t sgn g,
  (∀ (b : β), g b ∈ s) ∧ t.card = ∑ a ∈ s, (f a).natAbs ∧ ∀ a ∈ s, (∑ b ∈ t, if g b = a then ↑(sgn b) else 0) = f a


theorem copy_eq {s : Set M} (hs : s = S) : S.copy s hs = S

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{S : L.Substructure M}
{s : Set M}
(hs : s = ↑S)


@[simp]
theorem exp_sub_cosh : exp x - cosh x = sinh x


@[simp, norm_cast]
theorem mod_to_int : ∀ n d, ((n % d : ZNum) : ℤ) = n % d


{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(P : StrongFEPair E)


lemma toContinuousMap_X_eq_id : X.toContinuousMap = .id R

{R : Type u_1}
[Semiring R]
[TopologicalSpace R]
[TopologicalSemiring R]

Polynomial.X.toContinuousMap = ContinuousMap.id R


@[to_additive]
theorem op_surjective : Surjective (op : α → αᵐᵒᵖ)


theorem mul_lt_of_le_of_lt_one_of_pos [PosMulStrictMono α] (bc : b ≤ c) (ha : a < 1) (b0 : 0 < b) :
    b * a < c

{α : Type u_1}
{a b c : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[PosMulStrictMono α]
(bc : b ≤ c)
(ha : a < 1)
(b0 : 0 < b)


@[simp]
theorem mapTermRel_id_id_id {n} (φ : L.BoundedFormula α n) :
    (φ.mapTermRel (fun _ => id) (fun _ => id) fun _ => id) = φ

{L : FirstOrder.Language}
{α : Type u'}
{n : ℕ}
(φ : L.BoundedFormula α n)

FirstOrder.Language.BoundedFormula.mapTermRel (fun x => id) (fun x => id) (fun x => id) φ = φ


theorem eq_of_subset_of_card_le {s t : Set α} [Fintype s] [Fintype t] (hsub : s ⊆ t)
    (hcard : Fintype.card t ≤ Fintype.card s) : s = t

(hcard : Fintype.card ↑t ≤ Fintype.card ↑s)


/-- If `f : α → α` is a morphism of complete lattices, then the limsup of its iterates of any
`a : α` is a fixed point. -/
@[simp]
theorem _root_.CompleteLatticeHom.apply_limsup_iterate (f : CompleteLatticeHom α α) (a : α) :
    f (limsup (fun n => f^[n] a) atTop) = limsup (fun n => f^[n] a) atTop

{α : Type u_1}
[CompleteLattice α]
(f : CompleteLatticeHom α α)
(a : α)

f (Filter.limsup (fun n => (⇑f)^[n] a) Filter.atTop) = Filter.limsup (fun n => (⇑f)^[n] a) Filter.atTop


/-- The coercion to the quotient of a congruence relation commutes with multiplication (by
    definition). -/
@[to_additive (attr := simp) "The coercion to the quotient of an additive congruence relation
commutes with addition (by definition)."]
theorem coe_mul (x y : M) : (↑(x * y) : c.Quotient) = ↑x * ↑y

{M : Type u_1}
[Add M]
{c : AddCon M}
(x y : M)


protected theorem Preconnected.boxProd (hG : G.Preconnected) (hH : H.Preconnected) :
    (G □ H).Preconnected

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{H : SimpleGraph β}
(hG : G.Preconnected)
(hH : H.Preconnected)


theorem expand_ne_zero {p : ℕ} (hp : 0 < p) {f : R[X]} : expand R p f ≠ 0 ↔ f ≠ 0

{R : Type u}
[CommSemiring R]
{p : ℕ}
(hp : 0 < p)
{f : R[X]}


@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem inf [Inf β] [ContinuousInf β] (hf : StronglyMeasurable f)
    (hg : StronglyMeasurable g) : StronglyMeasurable (f ⊓ g)

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)

MeasureTheory.StronglyMeasurable (f ⊓ g)


theorem hasDerivAt_bernoulliFun (k : ℕ) (x : ℝ) :
    HasDerivAt (bernoulliFun k) (k * bernoulliFun (k - 1) x) x

HasDerivAt (bernoulliFun k) (↑k * bernoulliFun (k - 1) x) x


theorem injective_sum_to : Function.Injective (sum_to C ho)

(ho : o < Ordinal.type fun x x_1 => x < x_1)

Function.Injective (Profinite.NobelingProof.GoodProducts.sum_to C ho)


/-- The first part of the third simplicial identity -/
@[reassoc]
theorem δ_comp_σ_self {n} {i : Fin (n + 1)} : X.σ i ≫ X.δ (Fin.castSucc i) = 𝟙 _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(X : CategoryTheory.SimplicialObject C)
{n : ℕ}
{i : Fin (n + 1)}

X.σ i ≫ X.δ i.castSucc = 𝟙 (X.obj (Opposite.op (SimplexCategory.mk n)))


@[simp] theorem connectedComponent_eq_singleton [TotallyDisconnectedSpace α] (x : α) :
    connectedComponent x = {x}

{α : Type u}
[TopologicalSpace α]
[TotallyDisconnectedSpace α]
(x : α)


@[simp]
theorem top_le_iff : ⊤ ≤ a ↔ a = ⊤

{α : Type u}
[PartialOrder α]
[OrderTop α]
{a : α}

⊤ ≤ a ↔ a = ⊤


theorem Iio_ssubset_Iic_self : Iio a ⊂ Iic a


theorem index (H : Subgroup G) [H.FiniteIndex] : ∃ n : ℕ, H.index = p ^ n

{p : ℕ}
{G : Type u_1}
[Group G]
(hG : IsPGroup p G)
[hp : Fact (Nat.Prime p)]
(H : Subgroup G)
[H.FiniteIndex]


/--
If `l` is good w.r.t. `π C (ord I · < o₁)` and `o₁ ≤ o₂`, then it is good w.r.t.
`π C (ord I · < o₂)`
-/
theorem isGood_mono {l : Products I} {o₁ o₂ : Ordinal} (h : o₁ ≤ o₂)
    (hl : l.isGood (π C (ord I · < o₁))) : l.isGood (π C (ord I · < o₂))

{l : Profinite.NobelingProof.Products I}

(hl :
  Profinite.NobelingProof.Products.isGood (Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o₁) l)

Profinite.NobelingProof.Products.isGood (Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o₂) l


theorem convexOn_univ_dist (z : E) : ConvexOn ℝ univ fun z' => dist z' z

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(z : E)


/-- The second projection `chosenProd F₁ F₂ ⟶ F₂`. -/
@[simps]
def snd : chosenProd F₁ F₂ ⟶ F₂

{J : Type u_1}
{C : Type u_2}
[CategoryTheory.Category.{u_3, u_1} J]
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.ChosenFiniteProducts C]
(F₁ F₂ : CategoryTheory.Functor J C)
(j : J)

(CategoryTheory.Functor.chosenProd.snd F₁ F₂).app j = CategoryTheory.ChosenFiniteProducts.snd (F₁.obj j) (F₂.obj j)


theorem WCovBy.sup_eq (hac : a ⩿ c) (hbc : b ⩿ c) (hab : a ≠ b) : a ⊔ b = c

{α : Type u_1}
[SemilatticeSup α]
{a b c : α}
(hac : a ⩿ c)
(hbc : b ⩿ c)
(hab : a ≠ b)


theorem finSuccAboveEquiv_apply (p : Fin (n + 1)) (i : Fin n) :
    finSuccAboveEquiv p i = ⟨p.succAbove i, p.succAbove_ne i⟩

(finSuccAboveEquiv p) i = ⟨p.succAbove i, ⋯⟩


/-- In a monoid, an element a divides an element b iff all associates of `a` divide `b`. -/
@[simp]
theorem mul_right_dvd (hu : IsUnit u) : a * u ∣ b ↔ a ∣ b

{α : Type u_1}
[Monoid α]
{a b u : α}
(hu : IsUnit u)


theorem intCast_zero : ((0 : Int) : Rat) = (0 : Rat)


/-- Unitary conjugation preserves the spectrum, star on right. -/
@[simp]
lemma spectrum.unitary_conjugate' {a : A} {u : unitary A} :
    spectrum R ((star u : A) * a * u) = spectrum R a

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Ring A]
[Algebra R A]
[StarMul A]
{a : A}
{u : ↥(unitary A)}

spectrum R (star ↑u * a * ↑u) = spectrum R a


lemma comp {UX : Scheme.{u}} (H : P f) (i : UX ⟶ X) [IsOpenImmersion i] :
    P (i ≫ f)

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}


@[simp]
theorem expand_X (p : ℕ) (i : σ) : expand p (X i : MvPolynomial σ R) = X i ^ p

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
(p : ℕ)
(i : σ)

(MvPolynomial.expand p) (MvPolynomial.X i) = MvPolynomial.X i ^ p


@[ext] lemma ext {f g : StieltjesFunction} (h : ∀ x, f x = g x) : f = g

{f g : StieltjesFunction}
(h : ∀ (x : ℝ), ↑f x = ↑g x)


/-- The equivalences given by `Pi.eqToEquivalence` are compatible with reindexing. -/
@[simps!]
def Pi.eqToEquivalenceFunctorIso (f : J → I) {i' j' : J} (h : i' = j') :
    (Pi.eqToEquivalence C (congr_arg f h)).functor ≅
      (Pi.eqToEquivalence (fun i' => C (f i')) h).functor

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

(CategoryTheory.Pi.eqToEquivalenceFunctorIso C f h).hom = CategoryTheory.eqToHom ⋯


lemma subset_antisymm [IsAntisymm α (· ⊆ ·)] : a ⊆ b → b ⊆ a → a = b

{α : Type u}
[HasSubset α]
{a b : α}
[IsAntisymm α fun x x_1 => x ⊆ x_1]


@[to_additive]
theorem finprod_pow (hf : (mulSupport f).Finite) (n : ℕ) : (∏ᶠ i, f i) ^ n = ∏ᶠ i, f i ^ n

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f : α → M}
(hf : (Function.mulSupport f).Finite)
(n : ℕ)

(∏ᶠ (i : α), f i) ^ n = ∏ᶠ (i : α), f i ^ n


/-- "iff" version of `Multipliable.of_nat_of_neg`. -/
@[to_additive "\"iff\" version of `Summable.of_nat_of_neg`."]
lemma multipliable_int_iff_multipliable_nat_and_neg {f : ℤ → G} :
    Multipliable f ↔ (Multipliable fun n : ℕ ↦ f n) ∧ (Multipliable fun n : ℕ ↦ f (-n))

{G : Type u_2}
[AddCommGroup G]
[UniformSpace G]
[UniformAddGroup G]
[CompleteSpace G]
{f : ℤ → G}

Summable f ↔ (Summable fun n => f ↑n) ∧ Summable fun n => f (-↑n)


/-- This is [bourbaki2007][] $9 Lemma 3. -/
theorem changeForm_changeForm (x : CliffordAlgebra Q) :
    changeForm h' (changeForm h x) = changeForm (changeForm.add_proof h h') x

(h : LinearMap.BilinMap.toQuadraticMap B = Q' - Q)

(h' : LinearMap.BilinMap.toQuadraticMap B' = Q'' - Q')

(CliffordAlgebra.changeForm h') ((CliffordAlgebra.changeForm h) x) = (CliffordAlgebra.changeForm ⋯) x


theorem StarAlgHom.restrictScalars_injective :
    Function.Injective (StarAlgHom.restrictScalars R : (A →⋆ₐ[S] B) → A →⋆ₐ[R] B)

(R : Type u_1)
{S : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Semiring B]
[Algebra R S]
[Algebra S A]
[Algebra S B]
[Algebra R A]
[Algebra R B]
[IsScalarTower R S A]
[IsScalarTower R S B]
[Star A]
[Star B]


theorem mem_cocompact : s ∈ cocompact X ↔ ∃ t, IsCompact t ∧ tᶜ ⊆ s

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

s ∈ Filter.cocompact X ↔ ∃ t, IsCompact t ∧ tᶜ ⊆ s


@[simp] lemma abs_apply (f : ∀ i, α i) (i : ι) : |f| i = |f i|

{ι : Type u_2}
{α : ι → Type u_3}
[(i : ι) → AddGroup (α i)]
[(i : ι) → Lattice (α i)]
(f : (i : ι) → α i)
(i : ι)


lemma abCyclesIso_inv_apply_iCycles (x : AddMonoidHom.ker S.g) :
    S.iCycles (S.abCyclesIso.inv x) = x

(S : CategoryTheory.ShortComplex Ab)
(x : ↥(AddMonoidHom.ker S.g))


/-- Scaling on the right is sent by `DualNumber.lift` to multiplication on the right -/
@[simp] theorem lift_op_smul (fe : {fe : (A →ₐ[R] B) × B // _}) (a : A) (ad : A[ε]) :
    lift fe (MulOpposite.op a • ad) = lift fe ad * fe.val.1 a

(fe : { fe // fe.2 * fe.2 = 0 ∧ ∀ (a : A), Commute fe.2 (fe.1 a) })

(DualNumber.lift fe) (MulOpposite.op a • ad) = (DualNumber.lift fe) ad * (↑fe).1 a


theorem Nat.rel_of_forall_rel_succ_of_lt (r : β → β → Prop) [IsTrans β r] {f : ℕ → β}
    (h : ∀ n, r (f n) (f (n + 1))) ⦃a b : ℕ⦄ (hab : a < b) : r (f a) (f b)

{β : Type v}
(r : β → β → Prop)
[IsTrans β r]
{f : ℕ → β}
(h : ∀ (n : ℕ), r (f n) (f (n + 1)))
⦃a b : ℕ⦄
(hab : a < b)


lemma isComplex_mk_iff {φ : K →+* ℂ} :
    IsComplex (mk φ) ↔ ¬ ComplexEmbedding.IsReal φ

(NumberField.InfinitePlace.mk φ).IsComplex ↔ ¬NumberField.ComplexEmbedding.IsReal φ


@[to_additive]
theorem snd_mul : (s * t).snd = s.snd * t.snd

[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]

(s * t).toProd.2 = s.toProd.2 * t.toProd.2


@[simp]
theorem lift_min {a b : Cardinal} : lift.{u, v} (min a b) = min (lift.{u, v} a) (lift.{u, v} b)

Cardinal.lift.{u, v} (min a b) = min (Cardinal.lift.{u, v} a) (Cardinal.lift.{u, v} b)


theorem smallSets_comap_eq_comap_image (l : Filter β) (f : α → β) :
    (comap f l).smallSets = comap (image f) l.smallSets

{α : Type u_1}
{β : Type u_2}
(l : Filter β)
(f : α → β)

(Filter.comap f l).smallSets = Filter.comap (Set.image f) l.smallSets


theorem mapClusterPt_comp {X α β : Type*} {x : X} [TopologicalSpace X] {F : Filter α} {φ : α → β}
    {u : β → X} : MapClusterPt x F (u ∘ φ) ↔ MapClusterPt x (map φ F) u

{X : Type u_3}
{α : Type u_4}
{β : Type u_5}
{x : X}
[TopologicalSpace X]
{F : Filter α}
{φ : α → β}
{u : β → X}

MapClusterPt x F (u ∘ φ) ↔ MapClusterPt x (Filter.map φ F) u


lemma cfc_nonneg {f : R → R} {a : A} (h : ∀ x ∈ spectrum R a, 0 ≤ f x) :
    0 ≤ cfc f a

[∀ (α : Type u_1) [inst : TopologicalSpace α], StarOrderedRing C(α, R)]


/-- If `f` takes a pair of states, but always returns the same value for both elements of the
    pair, then we can simplify to just a single element of state
  -/
@[simp]
theorem mapAccumr₂_redundant_pair (f : α → β → (σ × σ) → (σ × σ) × γ)
    (h : ∀ x y s, let s' := (f x y (s, s)).fst; s'.fst = s'.snd) :
    (mapAccumr₂ f xs ys (s, s)).snd = (mapAccumr₂ (fun x y (s : σ) =>
      (f x y (s, s) |>.fst.fst, f x y (s, s) |>.snd)
    ) xs ys s).snd

(f : α → β → σ × σ → (σ × σ) × γ)

(Mathlib.Vector.mapAccumr₂ f xs ys (s, s)).2 =
  (Mathlib.Vector.mapAccumr₂ (fun x y s => ((f x y (s, s)).1.1, (f x y (s, s)).2)) xs ys s).2


theorem summable_of_isBigO_nat {E} [SeminormedAddCommGroup E] [CompleteSpace E]
    {f : ℕ → E} {g : ℕ → ℝ} (hg : Summable g) (h : f =O[atTop] g) : Summable f

{E : Type u_1}
[SeminormedAddCommGroup E]
[CompleteSpace E]
{f : ℕ → E}
{g : ℕ → ℝ}
(hg : Summable g)
(h : f =O[Filter.atTop] g)


@[nontriviality]
theorem of_isEmpty [IsEmpty β] (f : α → β) (μa : Measure α) (μb : Measure β) :
    MeasurePreserving f μa μb

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
[IsEmpty β]
(f : α → β)
(μa : MeasureTheory.Measure α)
(μb : MeasureTheory.Measure β)


@[simp] lemma coe_mk (f h1 hmul) : (mk f h1 hmul : α → β) = (f : α → β)

(hmul : ∀ (x y : α), f.toFun (x * y) = f.toFun x * f.toFun y)

⇑{ toZeroHom := f, map_one' := h1, map_mul' := hmul } = ⇑f


/-- A comonoid object internal to a monoidal category.

When the monoidal category is preadditive, this is also sometimes called a "coalgebra object".
-/
structure Comon_ where
  /-- The underlying object of a comonoid object. -/
  X : C
  /-- The counit of a comonoid object. -/
  counit : X ⟶ 𝟙_ C
  /-- The comultiplication morphism of a comonoid object. -/
  comul : X ⟶ X ⊗ X
  counit_comul : comul ≫ (counit ▷ X) = (λ_ X).inv := by aesop_cat
  comul_counit : comul ≫ (X ◁ counit) = (ρ_ X).inv := by aesop_cat
  comul_assoc : comul ≫ (X ◁ comul) = comul ≫ (comul ▷ X) ≫ (α_ X X X).hom := by aesop_cat

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

self.comul ≫ self.counit ▷ self.X = (λ_ self.X).inv


/-- The units group of `S →ₐ[R] S` is `S ≃ₐ[R] S`.
See `LinearMap.GeneralLinearGroup.generalLinearEquiv` for the linear map version. -/
@[simps]
def algHomUnitsEquiv (R S : Type*) [CommSemiring R] [Semiring S] [Algebra R S] :
    (S →ₐ[R] S)ˣ ≃* (S ≃ₐ[R] S)

(R : Type u_1)
(S : Type u_2)
[CommSemiring R]
[Semiring S]
[Algebra R S]
(f : (S →ₐ[R] S)ˣ)
(a : S)

((AlgEquiv.algHomUnitsEquiv R S) f).symm a = ↑↑f⁻¹ a


theorem comp_val_base_apply {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) :
    (f ≫ g).val.base x = g.val.base (f.val.base x)

{X Y Z : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(g : Y ⟶ Z)
(x : ↑↑X.toPresheafedSpace)


lemma iInf_unique [Unique ι] (f : ι → α) : ⨅ i, f i = f default

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
[Unique ι]
(f : ι → α)


@[simp] theorem toFin_mul (x y : BitVec n) : (x * y).toFin = (x.toFin * y.toFin)


@[to_additive]
theorem mem_prod_list_ofFn {a : α} {s : Fin n → Set α} :
    a ∈ (List.ofFn s).prod ↔ ∃ f : ∀ i : Fin n, s i, (List.ofFn fun i ↦ (f i : α)).prod = a

{α : Type u_2}
[AddMonoid α]
{n : ℕ}
{a : α}
{s : Fin n → Set α}

a ∈ (List.ofFn s).sum ↔ ∃ f, (List.ofFn fun i => ↑(f i)).sum = a


@[simp]
theorem coe_copy (f : sSupHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

{α : Type u_2}
{β : Type u_3}
[SupSet α]
[SupSet β]
(f : sSupHom α β)
(f' : α → β)
(h : f' = ⇑f)


@[to_additive (attr := simp)]
theorem inv_down [Inv α] : x⁻¹.down = x.down⁻¹

{α : Type u}
{x : ULift.{v, u} α}
[Neg α]


theorem mk_mem_interedges_iff : (a, b) ∈ G.interedges s t ↔ a ∈ s ∧ b ∈ t ∧ G.Adj a b

{α : Type u_4}
(G : SimpleGraph α)
[DecidableRel G.Adj]
{s t : Finset α}
{a b : α}


theorem multiplicity_pow_self {p : α} (h0 : p ≠ 0) (hu : ¬IsUnit p) (n : ℕ) :
    multiplicity p (p ^ n) = n

{α : Type u_1}
[CancelCommMonoidWithZero α]
[DecidableRel fun x x_1 => x ∣ x_1]
{p : α}
(h0 : p ≠ 0)
(hu : ¬IsUnit p)
(n : ℕ)


@[to_additive]
protected lemma eq_inv_mul_iff_mul_eq (h : IsUnit b) : a = b⁻¹ * c ↔ b * a = c

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


theorem tsupport_normed_eq : tsupport (f.normed μ) = Metric.closedBall c f.rOut


theorem memberSubfamily_union_nonMemberSubfamily (a : α) (𝒜 : Finset (Finset α)) :
    𝒜.memberSubfamily a ∪ 𝒜.nonMemberSubfamily a = 𝒜.image fun s => s.erase a

{α : Type u_1}
[DecidableEq α]
(a : α)
(𝒜 : Finset (Finset α))

Finset.memberSubfamily a 𝒜 ∪ Finset.nonMemberSubfamily a 𝒜 = Finset.image (fun s => s.erase a) 𝒜


@[to_additive (attr := simp)]
theorem inf_subgroupOf_left (H K : Subgroup G) : (K ⊓ H).subgroupOf K = H.subgroupOf K

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


@[simp]
theorem map_hausdorffMeasure (e : X ≃ᵢ Y) (d : ℝ) : Measure.map e μH[d] = μH[d]

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
[MeasurableSpace X]
[BorelSpace X]
[MeasurableSpace Y]
[BorelSpace Y]
(e : X ≃ᵢ Y)
(d : ℝ)

MeasureTheory.Measure.map ⇑e μH[d] = μH[d]


@[simp]
protected lemma mem_prod {s : Clopens α} {t : Clopens β} {x : α × β} :
    x ∈ s ×ˢ t ↔ x.1 ∈ s ∧ x.2 ∈ t

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
{s : TopologicalSpace.Clopens α}
{t : TopologicalSpace.Clopens β}
{x : α × β}


@[simp]
theorem torsionOf_eq_bot_iff_of_noZeroSMulDivisors [Nontrivial R] [NoZeroSMulDivisors R M] (m : M) :
    torsionOf R M m = ⊥ ↔ m ≠ 0

(R : Type u_1)
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Nontrivial R]
[NoZeroSMulDivisors R M]
(m : M)


/-- The natural isomorphism `(K⟦n⟧).sc i ≅ K.sc i'` when `n + i = i'`. -/
@[simps!]
noncomputable def shiftShortComplexFunctorIso (n i i' : ℤ) (hi : n + i = i') :
    shiftFunctor C n ⋙ shortComplexFunctor C _ i ≅ shortComplexFunctor C _ i'

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(n i i' : ℤ)
(hi : n + i = i')
(X : CochainComplex C ℤ)

((CochainComplex.shiftShortComplexFunctorIso C n i i' hi).inv.app X).τ₂ = (HomologicalComplex.XIsoOfEq X ⋯).inv


@[simp] lemma map₂_coe_right (f : α → β → γ) (a) (b : β) : map₂ f a b = a.map (f · b)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β → γ)
(a : WithBot α)
(b : β)

WithBot.map₂ f a ↑b = WithBot.map (fun x => f x b) a


protected lemma DirectedOn.sSup_le (hd : DirectedOn (· ≤ ·) d) (ha : ∀ b ∈ d, b ≤ a) : sSup d ≤ a

(hd : DirectedOn (fun x x_1 => x ≤ x_1) d)


theorem nonempty_embedding_nat (α) [Countable α] : Nonempty (α ↪ ℕ)


/-- If `f x - x` is an integer number `m` for some point `x`, then `τ f = m`.
On the circle this means that a map with a fixed point has rotation number zero. -/
theorem translationNumber_of_eq_add_int {x : ℝ} {m : ℤ} (h : f x = x + m) : τ f = m

(f : CircleDeg1Lift)
{x : ℝ}
{m : ℤ}
(h : f x = x + ↑m)


@[to_additive (attr := simp)]
theorem mem_one : a ∈ (1 : Set α) ↔ a = 1


theorem mod_modEq (a n) : a % n ≡ a [MOD n]


theorem LiftRel.trans (R : α → α → Prop) (H : Transitive R) : Transitive (LiftRel R)

{α : Type u}
(R : α → α → Prop)
(H : Transitive R)


theorem comap_lift_eq2 {m : β → α} {g : Set β → Filter γ} (hg : Monotone g) :
    (comap m f).lift g = f.lift (g ∘ preimage m)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : Filter α}
{m : β → α}
{g : Set β → Filter γ}
(hg : Monotone g)

(Filter.comap m f).lift g = f.lift (g ∘ Set.preimage m)


/-- The infimum of the Rayleigh quotient of a symmetric operator `T` on a nontrivial
finite-dimensional vector space is an eigenvalue for that operator. -/
theorem hasEigenvalue_iInf_of_finiteDimensional (hT : T.IsSymmetric) :
    HasEigenvalue T ↑(⨅ x : { x : E // x ≠ 0 }, RCLike.re ⟪T x, x⟫ / ‖(x : E)‖ ^ 2 : ℝ)

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[FiniteDimensional 𝕜 E]
[_i : Nontrivial E]
{T : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)

Module.End.HasEigenvalue T ↑(⨅ x, RCLike.re ⟪T ↑x, ↑x⟫_𝕜 / ‖↑x‖ ^ 2)


lemma indicator_eq_zero_iff_not_mem : indicator s 1 i = (0 : M₀) ↔ i ∉ s

{ι : Type u_1}
(M₀ : Type u_4)
[MulZeroOneClass M₀]
{s : Set ι}
{i : ι}
[Nontrivial M₀]


theorem le_iInf_lintegral {ι : Sort*} (f : ι → α → ℝ≥0∞) :
    ∫⁻ a, ⨅ i, f i a ∂μ ≤ ⨅ i, ∫⁻ a, f i a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{ι : Sort u_5}
(f : ι → α → ℝ≥0∞)

∫⁻ (a : α), ⨅ i, f i a ∂μ ≤ ⨅ i, ∫⁻ (a : α), f i a ∂μ


theorem nhdsWithin_restrict' {a : α} (s : Set α) {t : Set α} (h : t ∈ 𝓝 a) : 𝓝[s] a = 𝓝[s ∩ t] a

{α : Type u_1}
[TopologicalSpace α]
{a : α}
(s : Set α)
{t : Set α}
(h : t ∈ 𝓝 a)


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

(A : (CategoryTheory.coprodMonad X).Algebra)

(CategoryTheory.algebraToUnder X).obj A =
  CategoryTheory.Under.mk (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.coprod.inl A.a)


@[simp]
theorem cast_inv_int (n : ℤ) : ((n⁻¹ : ℚ) : α) = (n : α)⁻¹

↑(↑n)⁻¹ = (↑n)⁻¹


@[simp]
theorem zsmul_modEq_zero (z : ℤ) : z • p ≡ 0 [PMOD p]

{α : Type u_1}
[AddCommGroup α]
{p : α}
(z : ℤ)


/-- A private lemma that rewrites the output of lemmas like `HasFDerivAt.cpow` to the form
expected by lemmas like `HasDerivAt.cpow`. -/
private theorem aux : ((g x * f x ^ (g x - 1)) • (1 : ℂ →L[ℂ] ℂ).smulRight f' +
    (f x ^ g x * log (f x)) • (1 : ℂ →L[ℂ] ℂ).smulRight g') 1 =
      g x * f x ^ (g x - 1) * f' + f x ^ g x * log (f x) * g'

((g x * f x ^ (g x - 1)) • ContinuousLinearMap.smulRight 1 f' +
      (f x ^ g x * Complex.log (f x)) • ContinuousLinearMap.smulRight 1 g')
    1 =
  g x * f x ^ (g x - 1) * f' + f x ^ g x * Complex.log (f x) * g'


@[simp]
lemma colimitCoyonedaHomIsoLimit_π_apply (f : colimit (D.rightOp ⋙ coyoneda) ⟶ F) (i : I) :
    limit.π (D ⋙ F ⋙ uliftFunctor.{u₁}) (op i) ((colimitCoyonedaHomIsoLimit D F).hom f)
      = ⟨f.app (D.obj (op i)) ((colimit.ι (D.rightOp ⋙ coyoneda) i).app (D.obj (op i))
          (𝟙 (D.obj (op i))))⟩

(F : CategoryTheory.Functor C (Type u₂))

[CategoryTheory.Limits.HasLimitsOfShape Iᵒᵖ (Type (max u₁ u₂))]

(f : CategoryTheory.Limits.colimit (D.rightOp.comp CategoryTheory.coyoneda) ⟶ F)

CategoryTheory.Limits.limit.π (D.comp (F.comp CategoryTheory.uliftFunctor.{u₁, u₂})) (Opposite.op i)
    ((CategoryTheory.Limits.colimitCoyonedaHomIsoLimit D F).hom f) =
  {
    down :=
      f.app (D.obj (Opposite.op i))
        ((CategoryTheory.Limits.colimit.ι (D.rightOp.comp CategoryTheory.coyoneda) i).app (D.obj (Opposite.op i))
          (CategoryTheory.CategoryStruct.id (D.obj (Opposite.op i)))) }


theorem isEmpty_or_nonempty : IsEmpty α ∨ Nonempty α


@[simp]
theorem linear_toAffineMap (e : P₁ ≃ᵃ[k] P₂) : e.toAffineMap.linear = e.linear

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(e : P₁ ≃ᵃ[k] P₂)


@[simp] theorem mul_fdiv_cancel_left (b : Int) (H : a ≠ 0) : fdiv (a * b) a = b


@[to_additive (attr := simp)]
theorem traverse_pure' : traverse F ∘ pure = fun x ↦ (pure <$> F x : m (FreeSemigroup β))

{α β : Type u}
{m : Type u → Type u}
[Applicative m]
(F : α → m β)

traverse F ∘ pure = fun x => pure <$> F x


@[reassoc (attr := simp)]
theorem colimit.ι_desc_app (H : J ⥤ K ⥤ C) [HasColimit H] (c : Cocone H) (j : J) (k : K) :
    (colimit.ι H j).app k ≫ (colimit.desc H c).app k = (c.ι.app j).app k

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
(H : J ⥤ K ⥤ C)
[CategoryTheory.Limits.HasColimit H]
(c : CategoryTheory.Limits.Cocone H)
(j : J)
(k : K)

(CategoryTheory.Limits.colimit.ι H j).app k ≫ (CategoryTheory.Limits.colimit.desc H c).app k = (c.ι.app j).app k


@[instance]
theorem nhdsWithin_Ioi_zero_neBot : (𝓝[>] (0 : ℝ≥0∞)).NeBot


@[simp]
lemma image_subtype_val_Icc_Ioi {a b : α} (c : Icc a b) : Subtype.val '' Ioi c = Ioc c.1 b

{α : Type u_1}
[Preorder α]
{a b : α}
(c : ↑(Set.Icc a b))

Subtype.val '' Set.Ioi c = Set.Ioc (↑c) b


theorem erase_mem_compression_of_mem_compression : s ∈ 𝓓 a 𝒜 → s.erase a ∈ 𝓓 a 𝒜

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{s : Finset α}
{a : α}

s ∈ Down.compression a 𝒜 → s.erase a ∈ Down.compression a 𝒜


theorem exists_eq_succ_of_ne_zero : ∀ {n}, n ≠ 0 → Exists fun k => n = succ k


theorem linearIndependent_rows_iff_isUnit {A : Matrix m m K} :
    LinearIndependent K (fun i ↦ A i) ↔ IsUnit A

{m : Type u}
[DecidableEq m]
{K : Type u_3}
[Field K]
[Fintype m]
{A : Matrix m m K}

(LinearIndependent K fun i => A i) ↔ IsUnit A


@[ext]
theorem ext {f g : α →ₘ[μ] β} (h : f =ᵐ[μ] g) : f = g

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
{f g : α →ₘ[μ] β}
(h : ↑f =ᵐ[μ] ↑g)


lemma comp_apply (g : β →*₀ γ) (f : α →*₀ β) (x : α) : g.comp f x = g (f x)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[MulZeroOneClass α]
[MulZeroOneClass β]
[MulZeroOneClass γ]
(g : β →*₀ γ)
(f : α →*₀ β)
(x : α)


@[simp]
lemma OpenCover.id_app {X : Scheme.{u}} (𝓤 : X.OpenCover) (j : 𝓤.J) :
    (𝟙 𝓤 : 𝓤 ⟶ 𝓤).app j = 𝟙 _

{X : AlgebraicGeometry.Scheme}
(𝓤 : X.OpenCover)
(j : 𝓤.J)


@[simp] theorem map_const {m} (b : β) : MeasurableSpace.map (fun _a : α ↦ b) m = ⊤

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
(b : β)


@[to_additive]
protected theorem Specializes.smul {a b : M} {x y : X} (h₁ : a ⤳ b) (h₂ : x ⤳ y) :
    (a • x) ⤳ (b • y)

{M : Type u_1}
{X : Type u_2}
[TopologicalSpace M]
[TopologicalSpace X]
[SMul M X]
[ContinuousSMul M X]
{a b : M}
{x y : X}
(h₁ : a ⤳ b)
(h₂ : x ⤳ y)


@[ghost_simps]
theorem ghostComponent_verschiebung (x : 𝕎 R) (n : ℕ) :
    ghostComponent (n + 1) (verschiebung x) = p * ghostComponent n x

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
(x : WittVector p R)
(n : ℕ)

(WittVector.ghostComponent (n + 1)) (WittVector.verschiebung x) = ↑p * (WittVector.ghostComponent n) x


protected theorem closedEmbedding (h : X ≃ₜ Y) : ClosedEmbedding h

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)


@[simp]
theorem lastFun_appendFun {α α' : TypeVec n} {β β' : Type*} (f : α ⟹ α') (g : β → β') :
    lastFun (f ::: g) = g

{n : ℕ}
{α : TypeVec.{u_1} n}
{α' : TypeVec.{u_2} n}
{β : Type u_1}
{β' : Type u_2}
(f : α.Arrow α')
(g : β → β')


theorem and_congr_left' (h : a ↔ b) : a ∧ c ↔ b ∧ c


/-- If `φ : a ⟶ b` lifts `f` and `ψ : b ⟶ c` lifts `𝟙 T`, then `φ ≫ ψ` lifts `f` -/
lemma comp_lift_id_right' {R S : 𝒮} {a b c : 𝒳} (f : R ⟶ S) (φ : a ⟶ b) [p.IsHomLift f φ]
    (T : 𝒮) (ψ : b ⟶ c) [p.IsHomLift (𝟙 T) ψ] : p.IsHomLift f (φ ≫ ψ)

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₂} 𝒳]
[CategoryTheory.Category.{v₂, u₁} 𝒮]
(p : 𝒳 ⥤ 𝒮)
{R S : 𝒮}
{a b c : 𝒳}
(f : R ⟶ S)
(φ : a ⟶ b)
[p.IsHomLift f φ]
(T : 𝒮)
(ψ : b ⟶ c)
[p.IsHomLift (𝟙 T) ψ]


theorem toAddSubmonoid_injective : Injective (toAddSubmonoid : Submodule R M → AddSubmonoid M)

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]


@[simp]
lemma NNReal.nndist_zero_eq_val (z : ℝ≥0) : nndist 0 z = z


theorem ndunion_le_add (s t : Multiset α) : ndunion s t ≤ s + t

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


@[simp]
lemma restrictScalars_apply (f : A →⋆ₙₐ[S] B) (x : A) : f.restrictScalars R x = f x

(R : Type u_1)
{S : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Monoid R]
[Monoid S]
[Star A]
[Star B]
[NonUnitalNonAssocSemiring A]
[NonUnitalNonAssocSemiring B]
[MulAction R S]
[DistribMulAction S A]
[DistribMulAction S B]
[DistribMulAction R A]
[DistribMulAction R B]
[IsScalarTower R S A]
[IsScalarTower R S B]
(f : A →⋆ₙₐ[S] B)
(x : A)

(NonUnitalStarAlgHom.restrictScalars R f) x = f x


theorem prod_comap_comap_eq.{u, v, w, x} {α₁ : Type u} {α₂ : Type v} {β₁ : Type w} {β₂ : Type x}
    {f₁ : Filter α₁} {f₂ : Filter α₂} {m₁ : β₁ → α₁} {m₂ : β₂ → α₂} :
    comap m₁ f₁ ×ˢ comap m₂ f₂ = comap (fun p : β₁ × β₂ => (m₁ p.1, m₂ p.2)) (f₁ ×ˢ f₂)

Filter.comap m₁ f₁ ×ˢ Filter.comap m₂ f₂ = Filter.comap (fun p => (m₁ p.1, m₂ p.2)) (f₁ ×ˢ f₂)


theorem gal_isSolvable_tower (p q : F[X]) (hpq : p.Splits (algebraMap F q.SplittingField))
    (hp : IsSolvable p.Gal) (hq : IsSolvable (q.map (algebraMap F p.SplittingField)).Gal) :
    IsSolvable q.Gal

(hpq : Polynomial.Splits (algebraMap F q.SplittingField) p)

(hq : IsSolvable (Polynomial.map (algebraMap F p.SplittingField) q).Gal)


/-- A finitely presented module is isomorphic to the quotient of a finite free module by a finitely
generated submodule. -/
theorem Module.FinitePresentation.equiv_quotient [fp : Module.FinitePresentation R M] :
    ∃ (L : Type u) (_ : AddCommGroup L) (_ : Module R L) (K : Submodule R L) (_ : M ≃ₗ[R] L ⧸ K),
      Module.Free R L ∧ Module.Finite R L ∧ K.FG

(R M : Type u)
[Ring R]
[AddCommGroup M]
[Module R M]
[fp : Module.FinitePresentation R M]

∃ L x x_1 K x_2, Module.Free R L ∧ Module.Finite R L ∧ K.FG


lemma truncGE'_d_eq_fromOpcycles {i j : ι} (hij : c.Rel i j) {i' j' : ι'}
    (hi' : e.f i = i') (hj' : e.f j = j') (hi : e.BoundaryGE i) :
    (K.truncGE' e).d i j = (K.truncGE'XIsoOpcycles e hi' hi).hom ≫ K.fromOpcycles i' j' ≫
      (K.truncGE'XIso e hj' (e.not_boundaryGE_next hij)).inv

(K.truncGE' e).d i j = (K.truncGE'XIsoOpcycles e hi' hi).hom ≫ K.fromOpcycles i' j' ≫ (K.truncGE'XIso e hj' ⋯).inv


@[to_additive (attr := simp)]
theorem coe_inv {G : Type*} [Group G] [TopologicalSpace G] [ChartedSpace H' G] [LieGroup I' G]
    (f : C^∞⟮I, N; I', G⟯) : ⇑f⁻¹ = (⇑f)⁻¹

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{H' : Type u_5}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{G : Type u_10}
[Group G]
[TopologicalSpace G]
[ChartedSpace H' G]
[LieGroup I' G]
(f : C^⊤⟮I, N; I', G⟯)

⇑f⁻¹ = (⇑f)⁻¹


/-- The ideal spanned by the variable in the power series ring
 over an integral domain is a prime ideal. -/
theorem span_X_isPrime : (Ideal.span ({X} : Set R⟦X⟧)).IsPrime

{R : Type u_1}
[CommRing R]
[IsDomain R]


theorem coeff_update (p : R[X]) (n : ℕ) (a : R) :
    (p.update n a).coeff = Function.update p.coeff n a

{R : Type u}
[Semiring R]
(p : R[X])
(n : ℕ)
(a : R)


@[to_additive]
theorem prod_finset_sum_index [AddCommMonoid M] [CommMonoid N] {s : Finset ι} {g : ι → α →₀ M}
    {h : α → M → N} (h_zero : ∀ a, h a 0 = 1) (h_add : ∀ a b₁ b₂, h a (b₁ + b₂) = h a b₁ * h a b₂) :
    (∏ i ∈ s, (g i).prod h) = (∑ i ∈ s, g i).prod h

{g : ι → α →₀ M}

(h_add : ∀ (a : α) (b₁ b₂ : M), h a (b₁ + b₂) = h a b₁ * h a b₂)

∏ i ∈ s, (g i).prod h = (∑ i ∈ s, g i).prod h


/-- Taking the product under `h` is an additive-to-multiplicative homomorphism of finsupps,
if `h` is an additive-to-multiplicative homomorphism on the support.
This is a more general version of `Finsupp.prod_add_index'`; the latter has simpler hypotheses. -/
@[to_additive
      "Taking the product under `h` is an additive homomorphism of finsupps,  if `h` is an
      additive homomorphism on the support. This is a more general version of
      `Finsupp.sum_add_index'`; the latter has simpler hypotheses."]
theorem prod_add_index [DecidableEq α] [AddZeroClass M] [CommMonoid N] {f g : α →₀ M}
    {h : α → M → N} (h_zero : ∀ a ∈ f.support ∪ g.support, h a 0 = 1)
    (h_add : ∀ a ∈ f.support ∪ g.support, ∀ (b₁ b₂), h a (b₁ + b₂) = h a b₁ * h a b₂) :
    (f + g).prod h = f.prod h * g.prod h

(h_add : ∀ a ∈ f.support ∪ g.support, ∀ (b₁ b₂ : M), h a (b₁ + b₂) = h a b₁ * h a b₂)


@[simp]
lemma bnot_isSome (a : Option α) : (! a.isSome) = a.isNone


theorem toRingHom_apply_symm_toRingHom_apply (e : R ≃+* S) :
    ∀ y : S, e.toRingHom (e.symm.toRingHom y) = y

{R : Type u_4}
{S : Type u_5}
[NonAssocSemiring R]
[NonAssocSemiring S]
(e : R ≃+* S)
(y : S)


@[simp]
theorem comap_iSup {β ι} (f : α → β) (m : ι → OuterMeasure β) :
    comap f (⨆ i, m i) = ⨆ i, comap f (m i)

{α : Type u_1}
{β : Type u_3}
{ι : Sort u_4}
(f : α → β)
(m : ι → MeasureTheory.OuterMeasure β)

(MeasureTheory.OuterMeasure.comap f) (⨆ i, m i) = ⨆ i, (MeasureTheory.OuterMeasure.comap f) (m i)


theorem image_coe_mem_of_mem_comap {f : Filter α} {U : Set α} (h : U ∈ f) {W : Set U}
    (W_in : W ∈ comap ((↑) : U → α) f) : (↑) '' W ∈ f

{α : Type u}
{f : Filter α}
{U : Set α}
(h : U ∈ f)
{W : Set ↑U}
(W_in : W ∈ Filter.comap Subtype.val f)


/-- A recurrence relation that expresses the `(n+1)`th term of the stream of `IntFractPair`s
of `v` for non-integer `v` in terms of the `n`th term of the stream associated to
the inverse of the fractional part of `v`.
-/
theorem stream_succ (h : Int.fract v ≠ 0) (n : ℕ) :
    IntFractPair.stream v (n + 1) = IntFractPair.stream (Int.fract v)⁻¹ n

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
{v : K}
(h : Int.fract v ≠ 0)
(n : ℕ)

GenContFract.IntFractPair.stream v (n + 1) = GenContFract.IntFractPair.stream (Int.fract v)⁻¹ n


theorem AECover.integral_tendsto_of_countably_generated [l.IsCountablyGenerated] {φ : ι → Set α}
    (hφ : AECover μ l φ) {f : α → E} (hfi : Integrable f μ) :
    Tendsto (fun i => ∫ x in φ i, f x ∂μ) l (𝓝 <| ∫ x, f x ∂μ)

{α : Type u_1}
{ι : Type u_2}
{E : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[l.IsCountablyGenerated]
{φ : ι → Set α}
(hφ : MeasureTheory.AECover μ l φ)
{f : α → E}
(hfi : MeasureTheory.Integrable f μ)

Filter.Tendsto (fun i => ∫ (x : α) in φ i, f x ∂μ) l (𝓝 (∫ (x : α), f x ∂μ))


@[simp]
theorem quotAnnihilatorEquiv_apply (W : Subspace K V) (φ : Module.Dual K V) :
    W.quotAnnihilatorEquiv (Submodule.Quotient.mk φ) = W.dualRestrict φ

{K : Type u}
{V : Type v}
[Field K]
[AddCommGroup V]
[Module K V]
(W : Subspace K V)
(φ : Module.Dual K V)

W.quotAnnihilatorEquiv (Submodule.Quotient.mk φ) = (Submodule.dualRestrict W) φ


@[simp, norm_cast]
theorem val_zpow (x : selfAdjoint R) (z : ℤ) : ↑(x ^ z) = (x : R) ^ z

{R : Type u_1}
[Field R]
[StarRing R]
(x : ↥(selfAdjoint R))
(z : ℤ)


@[elab_as_elim]
protected lemma inductionOn {motive : t2Quotient X → Prop} (q : t2Quotient X)
    (h : ∀ x, motive (t2Quotient.mk x)) : motive q

(h : ∀ (x : X), motive (t2Quotient.mk x))


theorem dist_map_zero_lt_of_semiconj {f g₁ g₂ : CircleDeg1Lift} (h : Function.Semiconj f g₁ g₂) :
    dist (g₁ 0) (g₂ 0) < 2

{f g₁ g₂ : CircleDeg1Lift}
(h : Function.Semiconj ⇑f ⇑g₁ ⇑g₂)


/--
If `F ⊣ G` and `F' ⊣ G'` are adjunctions, then giving a natural isomorphism `G ≅ G'` is the
same as giving a natural transformation `F' ≅ F`.
-/
@[simps]
def natIsoEquiv {F F' : C ⥤ D} {G G' : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G') :
    (G ≅ G') ≃ (F' ≅ F)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{F F' : C ⥤ D}
{G G' : D ⥤ C}
(adj1 : F ⊣ G)
(adj2 : F' ⊣ G')
(i : G ≅ G')

((adj1.natIsoEquiv adj2) i).inv = (adj2.natTransEquiv adj1) i.inv


/-- A prefunctor from a quiver `B` to a bicategory `C` can be lifted to a pseudofunctor from
`free_bicategory B` to `C`.
-/
@[simps]
def lift : Pseudofunctor (FreeBicategory B) C

{B : Type u₁}
[Quiver B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : B ⥤q C)
(a : CategoryTheory.FreeBicategory B)

(CategoryTheory.FreeBicategory.lift F).mapId a =
  CategoryTheory.Iso.refl
    ({ obj := F.obj, map := fun {X Y} => CategoryTheory.FreeBicategory.liftHom F,
          map₂ := fun {a b} {f g} => Quot.lift (CategoryTheory.FreeBicategory.liftHom₂ F) ⋯, map₂_id := ⋯,
          map₂_comp := ⋯ }.map
      (CategoryTheory.CategoryStruct.id a))


@[to_additive]
theorem map_le_map_iff' {f : G →* N} {H K : Subgroup G} :
    H.map f ≤ K.map f ↔ H ⊔ f.ker ≤ K ⊔ f.ker

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
{H K : Subgroup G}

Subgroup.map f H ≤ Subgroup.map f K ↔ H ⊔ f.ker ≤ K ⊔ f.ker


/-- An antitone function `f` sending `top` to `bot` and continuous at the infimum of a set sends
this infimum to the supremum of the image of this set. -/
theorem Antitone.map_sInf_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sInf s))
    (Af : Antitone f) (ftop : f ⊤ = ⊥) : f (sInf s) = sSup (f '' s)

{α : Type u_1}
{β : Type u_2}
[CompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[CompleteLinearOrder β]
[TopologicalSpace β]
[OrderClosedTopology β]
{f : α → β}
{s : Set α}
(Cf : ContinuousAt f (sInf s))
(Af : Antitone f)
(ftop : f ⊤ = ⊥)


theorem colorable_of_fintype (G : SimpleGraph V) [Fintype V] : G.Colorable (Fintype.card V)

{V : Type u}
(G : SimpleGraph V)
[Fintype V]


/-- The preimage of a compact set under `(c • ·)` is a compact set. -/
@[to_additive "The preimage of a compact set under `(c +ᵥ ·)` is a compact set."]
theorem IsCompact.preimage_smul {M X : Type*} [SMul M X] [TopologicalSpace X]
    [ProperConstSMul M X] {s : Set X} (hs : IsCompact s) (c : M) : IsCompact ((c • ·) ⁻¹' s)

{M : Type u_1}
{X : Type u_2}
[SMul M X]
[TopologicalSpace X]
[ProperConstSMul M X]
{s : Set X}
(hs : IsCompact s)
(c : M)


@[simp]
theorem mk_coe (f : MultilinearMap R M₁ M₂) (h₁ h₂) :
    (⟨f, h₁, h₂⟩ : MultilinearMap R M₁ M₂) = f

(h₁ :
  ∀ [inst : DecidableEq ι] (m : (i : ι) → M₁ i) (i : ι) (x y : M₁ i),
    f (Function.update m i (x + y)) = f (Function.update m i x) + f (Function.update m i y))

(h₂ :
  ∀ [inst : DecidableEq ι] (m : (i : ι) → M₁ i) (i : ι) (c : R) (x : M₁ i),
    f (Function.update m i (c • x)) = c • f (Function.update m i x))

{ toFun := ⇑f, map_add' := h₁, map_smul' := h₂ } = f


@[simp]
theorem sheafifyMap_comp {P Q R : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (γ : Q ⟶ R) :
    sheafifyMap J (η ≫ γ) = sheafifyMap J η ≫ sheafifyMap J γ

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.sheafifyMap J (CategoryTheory.CategoryStruct.comp η γ) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.sheafifyMap J η) (CategoryTheory.sheafifyMap J γ)


/-- No point making this an instance, as it requires `i` and `adj`. -/
theorem hasCokernels : HasCokernels C

(i : F.comp G ≅ CategoryTheory.Functor.id C)


theorem infPrime_iff_not_isMax : InfPrime a ↔ ¬IsMax a


/-- Given a right homology map data for morphism `φ`, this is the induced right homology
map data for `-φ`. -/
@[simps]
def neg : RightHomologyMapData (-φ) h₁ h₂

(γ : CategoryTheory.ShortComplex.RightHomologyMapData φ h₁ h₂)


@[simp]
theorem imageToKernel'_kernelSubobjectIso (w : f ≫ g = 0) :
    imageToKernel' f g w ≫ (kernelSubobjectIso g).inv =
      (imageSubobjectIso f).inv ≫ imageToKernel f g w

imageToKernel' f g w ≫ (CategoryTheory.Limits.kernelSubobjectIso g).inv =
  (CategoryTheory.Limits.imageSubobjectIso f).inv ≫ imageToKernel f g w


theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
    (zipWith swap l l').prod.support ≤ l.toFinset ⊔ l'.toFinset

{α : Type u_1}
[DecidableEq α]
[Fintype α]
(l l' : List α)

(List.zipWith Equiv.swap l l').prod.support ≤ l.toFinset ⊔ l'.toFinset


@[to_additive]
lemma HasProd.of_nat_of_neg {f : ℤ → G} (hf₁ : HasProd (fun n : ℕ ↦ f n) g)
    (hf₂ : HasProd (fun n : ℕ ↦ f (-n)) g') : HasProd f (g * g' / f 0)

{G : Type u_2}
[AddCommGroup G]
{g g' : G}
[TopologicalSpace G]
[TopologicalAddGroup G]
{f : ℤ → G}
(hf₁ : HasSum (fun n => f ↑n) g)
(hf₂ : HasSum (fun n => f (-↑n)) g')


theorem trans_ofSet (s : Set β) : e.trans (ofSet s) = e.restr (e ⁻¹' s)

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
(s : Set β)

e.trans (PartialEquiv.ofSet s) = e.restr (↑e ⁻¹' s)


theorem abs_def [LinearOrderedAddCommGroup β] (x : β*) : |x| = map abs x

{α : Type u}
{β : Type v}
{φ : Ultrafilter α}
[LinearOrderedAddCommGroup β]
(x : (↑φ).Germ β)


theorem funMulInvSnorm_rpow {p : ℝ} (hp0 : 0 < p) {f : α → ℝ≥0∞} {a : α} :
    funMulInvSnorm f p μ a ^ p = f a ^ p * (∫⁻ c, f c ^ p ∂μ)⁻¹

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{p : ℝ}
(hp0 : 0 < p)
{f : α → ENNReal}
{a : α}

ENNReal.funMulInvSnorm f p μ a ^ p = f a ^ p * (∫⁻ (c : α), f c ^ p ∂μ)⁻¹


/-- Multiplying the first vector passed to `oangle` by a nonzero real does not change twice the
angle. -/
@[simp]
theorem two_zsmul_oangle_smul_left_of_ne_zero (x y : V) {r : ℝ} (hr : r ≠ 0) :
    (2 : ℤ) • o.oangle (r • x) y = (2 : ℤ) • o.oangle x y

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

2 • o.oangle (r • x) y = 2 • o.oangle x y


@[to_additive]
theorem disjoint_image_image_iff {U V : Set α} :
    letI := orbitRel G α
    Disjoint (Quotient.mk' '' U) (Quotient.mk' '' V) ↔ ∀ x ∈ U, ∀ g : G, g • x ∉ V

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
{U V : Set α}

Disjoint (Quotient.mk' '' U) (Quotient.mk' '' V) ↔ ∀ x ∈ U, ∀ (g : G), g • x ∉ V


lemma tsum_dirichletSummand {N : ℕ} (χ : DirichletCharacter ℂ N) (hs : 1 < s.re) :
    ∑' (n : ℕ), dirichletSummandHom χ (ne_zero_of_one_lt_re hs) n = L ↗χ s

{s : ℂ}
{N : ℕ}
(χ : DirichletCharacter ℂ N)
(hs : 1 < s.re)

∑' (n : ℕ), (dirichletSummandHom χ ⋯) n = L (fun n => χ ↑n) s


theorem eq_singleton_bot_of_sSup_eq_bot_of_nonempty {s : Set α} (h_sup : sSup s = ⊥)
    (hne : s.Nonempty) : s = {⊥}

{α : Type u_1}
[CompleteLattice α]
{s : Set α}
(h_sup : sSup s = ⊥)
(hne : s.Nonempty)


/-- Given a MonoidHom `f : M →* N` and Submonoid `S ⊆ M` such that `f(S) ⊆ Nˣ`, for all
`w, z : N` and `y ∈ S`, we have `z = w * (f y)⁻¹ ↔ z * f y = w`. -/
@[to_additive
    "Given an AddMonoidHom `f : M →+ N` and Submonoid `S ⊆ M` such that
`f(S) ⊆ AddUnits N`, for all `w, z : N` and `y ∈ S`, we have `z = w - f y ↔ z + f y = w`."]
theorem mul_inv_right {f : M →* N} (h : ∀ y : S, IsUnit (f y)) (y : S) (w z : N) :
    z = w * (IsUnit.liftRight (f.restrict S) h y)⁻¹ ↔ z * f y = w

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{f : M →+ N}
(h : ∀ (y : ↥S), IsAddUnit (f ↑y))
(y : ↥S)
(w z : N)

z = w + ↑(-(IsAddUnit.liftRight (f.restrict S) h) y) ↔ z + f ↑y = w


theorem Embedding.map_nhdsWithin_eq {f : α → β} (hf : Embedding f) (s : Set α) (x : α) :
    map f (𝓝[s] x) = 𝓝[f '' s] f x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
(hf : Embedding f)
(s : Set α)
(x : α)


@[to_additive (attr := simp) coe_unzero]
lemma coe_unone : ∀ {x : WithOne α} (hx : x ≠ 1), unone hx = x

{α : Type u}
{x : WithZero α}
(hx : x ≠ 0)


@[to_additive]
theorem measurePreserving_div_left (μ : Measure G) [IsInvInvariant μ] [IsMulLeftInvariant μ]
    (g : G) : MeasurePreserving (fun t => g / t) μ μ

{G : Type u_2}
[MeasurableSpace G]
[SubtractionMonoid G]
[MeasurableAdd G]
[MeasurableNeg G]
(μ : MeasureTheory.Measure G)
[μ.IsNegInvariant]
[μ.IsAddLeftInvariant]
(g : G)

MeasureTheory.MeasurePreserving (fun t => g - t) μ μ


/-- A product over all subsets of `s ∪ {x}` is obtained by multiplying the product over all subsets
of `s`, and over all subsets of `s` to which one adds `x`. -/
@[to_additive "A sum over all subsets of `s ∪ {x}` is obtained by summing the sum over all subsets
of `s`, and over all subsets of `s` to which one adds `x`."]
lemma prod_powerset_insert [DecidableEq α] (ha : a ∉ s) (f : Finset α → β) :
    ∏ t ∈ (insert a s).powerset, f t =
      (∏ t ∈ s.powerset, f t) * ∏ t ∈ s.powerset, f (insert a t)

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{a : α}
[CommMonoid β]
[DecidableEq α]
(ha : a ∉ s)
(f : Finset α → β)


/-- Construct an isomorphism in `C × D` out of two isomorphisms in `C` and `D`. -/
@[simps]
def Iso.prod {P Q : C} {S T : D} (f : P ≅ Q) (g : S ≅ T) : (P, S) ≅ (Q, T)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{P Q : C}
{S T : D}
(f : P ≅ Q)
(g : S ≅ T)


protected theorem symm {x y} : c x y → c y x

{R : Type u_2}
[Add R]
[Mul R]
(c : RingCon R)
{x y : R}


theorem Codisjoint.himp_inf_cancel_right (h : Codisjoint a b) : a ⇨ a ⊓ b = b

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
{a b : α}
(h : Codisjoint a b)


/-- A version of `WithBot.map` for `AddHom`s. -/
@[simps (config := .asFn)]
protected def _root_.AddHom.withBotMap {M N : Type*} [Add M] [Add N] (f : AddHom M N) :
    AddHom (WithBot M) (WithBot N)

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(f : AddHom M N)


theorem neg_right {N : Type*} [AddCommGroup N] [TopologicalSpace N] [TopologicalAddGroup N]
    {v : VectorMeasure α M} {w : VectorMeasure α N} (h : v ≪ᵥ w) : v ≪ᵥ -w

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_4}
[AddCommMonoid M]
[TopologicalSpace M]
{N : Type u_6}
[AddCommGroup N]
[TopologicalSpace N]
[TopologicalAddGroup N]
{v : MeasureTheory.VectorMeasure α M}
{w : MeasureTheory.VectorMeasure α N}
(h : v ≪ᵥ w)


lemma iteratedDeriv_comp_neg (n : ℕ) (f : 𝕜 → F) (a : 𝕜) :
    iteratedDeriv n (fun x ↦ f (-x)) a = (-1 : 𝕜) ^ n • iteratedDeriv n f (-a)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(n : ℕ)
(f : 𝕜 → F)
(a : 𝕜)

iteratedDeriv n (fun x => f (-x)) a = (-1) ^ n • iteratedDeriv n f (-a)


theorem exists_inv_nat_lt {a : ℝ≥0∞} (h : a ≠ 0) : ∃ n : ℕ, (n : ℝ≥0∞)⁻¹ < a


theorem generateFrom_piiUnionInter_le {m : MeasurableSpace α} (π : ι → Set (Set α))
    (h : ∀ n, generateFrom (π n) ≤ m) (S : Set ι) : generateFrom (piiUnionInter π S) ≤ m

(h : ∀ (n : ι), MeasurableSpace.generateFrom (π n) ≤ m)

MeasurableSpace.generateFrom (piiUnionInter π S) ≤ m


@[continuity]
theorem continuous_integral : Continuous fun f : α →₁[μ] G => ∫ a, f a ∂μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}


/-- For a global integral curve `γ`, if it crosses itself at `a b : ℝ`, then it is periodic with
period `a - b`. -/
lemma IsIntegralCurve.periodic_of_eq [BoundarylessManifold I M]
    (hγ : IsIntegralCurve γ v)
    (hv : ContMDiff I I.tangent 1 (fun x => (⟨x, v x⟩ : TangentBundle I M)))
    (heq : γ a = γ b) : Periodic γ (a - b)

(hv : ContMDiff I I.tangent 1 fun x => { proj := x, snd := v x })


/-- Given a square from an arrow `i` to an isomorphism `p`, express the source part of `sq`
in terms of the inverse of `p`. -/
@[simp]
theorem square_to_iso_invert (i : Arrow T) {X Y : T} (p : X ≅ Y) (sq : i ⟶ Arrow.mk p.hom) :
    i.hom ≫ sq.right ≫ p.inv = sq.left

(sq : i ⟶ CategoryTheory.Arrow.mk p.hom)

CategoryTheory.CategoryStruct.comp i.hom (CategoryTheory.CategoryStruct.comp sq.right p.inv) = sq.left


theorem erase_injOn' (a : α) : { s : Finset α | a ∈ s }.InjOn fun s => erase s a

Set.InjOn (fun s => s.erase a) {s | a ∈ s}


@[simp] lemma Even.mul_left (ha : Even a) (b) : Even (b * a)

{α : Type u_2}
[Semiring α]
{a : α}
(ha : Even a)
(b : α)


theorem Decidable.by_contra [Decidable p] : (¬p → False) → p


/-- The `Bicone` used in order to obtain the existence of
the biproduct of a functor `J ⥤ Karoubi C` when the category `C` is additive. -/
@[simps]
def bicone [HasFiniteBiproducts C] {J : Type} [Finite J] (F : J → Karoubi C) : Bicone F

(F : J → CategoryTheory.Idempotents.Karoubi C)

((CategoryTheory.Idempotents.Karoubi.Biproducts.bicone F).ι j).f =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.biproduct.ι (fun j => (F j).X) j)
    (CategoryTheory.Limits.biproduct.map fun j => (F j).p)


@[simp]
lemma addSubmonoid_closure_range_mul_self : closure (range fun x : ℚ ↦ x * x) = nonneg _

AddSubmonoid.closure (Set.range fun x => x * x) = AddSubmonoid.nonneg ℚ


theorem le_fold_max : c ≤ s.fold max b f ↔ c ≤ b ∨ ∃ x ∈ s, c ≤ f x

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{b : β}
{s : Finset α}
[LinearOrder β]
(c : β)

c ≤ Finset.fold max b f s ↔ c ≤ b ∨ ∃ x ∈ s, c ≤ f x


@[to_additive]
theorem ball_one_div_singleton : ball 1 δ / {x} = ball x⁻¹ δ

{E : Type u_1}
[SeminormedAddCommGroup E]
(δ : ℝ)
(x : E)

Metric.ball 0 δ - {x} = Metric.ball (-x) δ


theorem continuousOn_prod_circle_transform_function {R r : ℝ} (hr : r < R) {z : ℂ} :
    ContinuousOn (fun w : ℂ × ℝ => (circleMap z R w.snd - w.fst)⁻¹ ^ 2)
      (closedBall z r ×ˢ univ)

ContinuousOn (fun w => (circleMap z R w.2 - w.1)⁻¹ ^ 2) (Metric.closedBall z r ×ˢ Set.univ)


lemma exact_of_comp_eq_zero_of_ker_le_range
    (h1 : g.comp f = 0) (h2 : ker g ≤ range f) : Exact f g

{M : Type u_2}
{N : Type u_4}
{P : Type u_6}
[AddGroup M]
[AddGroup N]
[AddGroup P]
{f : M →+ N}
{g : N →+ P}
(h1 : g.comp f = 0)
(h2 : g.ker ≤ f.range)


/-- Riemann-Lebesgue lemma for functions on a finite-dimensional inner-product space, formulated
via dual space. **Do not use** -- it is only a stepping stone to
`tendsto_integral_exp_smul_cocompact` where the inner-product-space structure isn't required. -/
theorem tendsto_integral_exp_smul_cocompact_of_inner_product (μ : Measure V) [μ.IsAddHaarMeasure] :
    Tendsto (fun w : V →L[ℝ] ℝ => ∫ v, 𝐞 (-w v) • f v ∂μ) (cocompact (V →L[ℝ] ℝ)) (𝓝 0)

{E : Type u_1}
{V : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(f : V → E)
[NormedAddCommGroup V]
[MeasurableSpace V]
[BorelSpace V]
[InnerProductSpace ℝ V]
[FiniteDimensional ℝ V]
(μ : MeasureTheory.Measure V)
[μ.IsAddHaarMeasure]

Filter.Tendsto (fun w => ∫ (v : V), 𝐞 (-w v) • f v ∂μ) (Filter.cocompact (V →L[ℝ] ℝ)) (𝓝 0)


@[simp]
theorem powerSeriesPart_eq_zero (x : LaurentSeries R) : x.powerSeriesPart = 0 ↔ x = 0

{R : Type u_1}
[Semiring R]
(x : LaurentSeries R)


@[simp, norm_cast] lemma coe_nsmul (a : α) (n : ℕ) : ↑(n • a) = n • (a : WithTop α)

{α : Type u}
[AddMonoid α]
(a : α)
(n : ℕ)


/-- The dimension of `E.solSpace` is `E.order`. -/
theorem solSpace_rank : Module.rank α E.solSpace = E.order

{α : Type u_1}
[CommRing α]
[StrongRankCondition α]
(E : LinearRecurrence α)


@[simp]
theorem toBoolRing_ofBoolRing (a : AsBoolRing α) : toBoolRing (ofBoolRing a) = a


theorem tsum_condensed_le (hf : ∀ ⦃m n⦄, 1 < m → m ≤ n → f n ≤ f m) :
    (∑' k : ℕ, 2 ^ k * f (2 ^ k)) ≤ f 1 + 2 * ∑' k, f k

(hf : ∀ ⦃m n : ℕ⦄, 1 < m → m ≤ n → f n ≤ f m)


protected lemma continuous_rng_iff {X : Type*} [TopologicalSpace X] {f : X → (α →ᵤ[𝔖] β)} :
    Continuous f ↔ ∀ s ∈ 𝔖,
      Continuous (UniformFun.ofFun ∘ s.restrict ∘ UniformOnFun.toFun 𝔖 ∘ f)

{α : Type u_1}
{β : Type u_2}
[UniformSpace β]
{𝔖 : Set (Set α)}
{X : Type u_5}
[TopologicalSpace X]
{f : X → α →ᵤ[𝔖] β}

Continuous f ↔ ∀ s ∈ 𝔖, Continuous (⇑UniformFun.ofFun ∘ s.restrict ∘ ⇑(UniformOnFun.toFun 𝔖) ∘ f)


protected theorem bijective (e : R ≃+* S) : Function.Bijective e

{R : Type u_4}
{S : Type u_5}
[Mul R]
[Mul S]
[Add R]
[Add S]
(e : R ≃+* S)


theorem fib_lt_fib_succ {n : ℕ} (hn : 2 ≤ n) : fib n < fib (n + 1)


theorem adjoin_simple_adjoin_simple (β : E) : F⟮α⟯⟮β⟯.restrictScalars F = F⟮α, β⟯

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(α β : E)

IntermediateField.restrictScalars F (↥F⟮α⟯)⟮β⟯ = F⟮α, β⟯


@[to_additive (attr := simp)]
theorem eventually_one {p : α → Prop} : (∀ᶠ x in 1, p x) ↔ p 1


theorem natAbs_mul (a b : Int) : natAbs (a * b) = natAbs a * natAbs b


theorem Continuous.map_eq_borel {X Y : Type*} [TopologicalSpace X] [PolishSpace X]
    [MeasurableSpace X] [BorelSpace X] [TopologicalSpace Y] [T0Space Y] [SecondCountableTopology Y]
    {f : X → Y} (hf : Continuous f) (hsurj : Surjective f) :
    MeasurableSpace.map f ‹MeasurableSpace X› = borel Y

{X : Type u_3}
{Y : Type u_4}
[TopologicalSpace X]
[PolishSpace X]
[MeasurableSpace X]
[BorelSpace X]
[TopologicalSpace Y]
[T0Space Y]
[SecondCountableTopology Y]
{f : X → Y}
(hf : Continuous f)
(hsurj : Function.Surjective f)


@[to_additive (attr := simp)]
theorem mem_fixedPoints {a : α} : a ∈ fixedPoints M α ↔ ∀ m : M, m • a = a

{M : Type u}
[AddMonoid M]
{α : Type v}
[AddAction M α]
{a : α}

a ∈ AddAction.fixedPoints M α ↔ ∀ (m : M), m +ᵥ a = a


@[simp] lemma fourierTransformCLE_apply (f : 𝓢(V, E)) :
    fourierTransformCLE 𝕜 f = 𝓕 f

(𝕜 : Type u_1)
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[NormedSpace 𝕜 E]
[SMulCommClass ℂ 𝕜 E]
{V : Type u_3}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[FiniteDimensional ℝ V]
[MeasurableSpace V]
[BorelSpace V]
[CompleteSpace E]
(f : SchwartzMap V E)

⇑((SchwartzMap.fourierTransformCLE 𝕜) f) = 𝓕 ⇑f


/-- The reverse direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`,
given by `CategoryTheory.yonedaEquiv`.
-/
@[simps]
def fromCostructuredArrow (F : Cᵒᵖ ⥤ Type v) : (CostructuredArrow yoneda F)ᵒᵖ ⥤ F.Elements

(F : CategoryTheory.Functor Cᵒᵖ (Type v))

(X : (CategoryTheory.CostructuredArrow CategoryTheory.yoneda F)ᵒᵖ)

((CategoryTheory.CategoryOfElements.fromCostructuredArrow F).obj X).snd =
  CategoryTheory.yonedaEquiv.toFun (Opposite.unop X).hom


theorem starRingEnd_self_apply (x : R) : starRingEnd R (starRingEnd R x) = x

{R : Type u}
[CommSemiring R]
[StarRing R]
(x : R)


/-- If `f : R → ℝ` is a nonnegative, multiplicatively bounded function, then the kernel of
  `seminormFromBounded' f` equals the kernel of `f`. -/
theorem seminormFromBounded_ker (f_nonneg : 0 ≤ f)
    (f_mul : ∀ x y : R, f (x * y) ≤ c * f x * f y) :
    seminormFromBounded' f ⁻¹' {0} = f ⁻¹' {0}

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


lemma Sigma.map'_comp_map' {f : α → C} {g : β → C} {h : γ → C} [HasCoproduct f] [HasCoproduct g]
    [HasCoproduct h] (p : α → β) (p' : β → γ) (q : ∀ (a : α), f a ⟶ g (p a))
    (q' : ∀ (b : β), g b ⟶ h (p' b)) :
    Sigma.map' p q ≫ Sigma.map' p' q' = Sigma.map' (p' ∘ p) (fun a => q a ≫ q' (p a))

{β : Type w}
{α : Type w₂}
{γ : Type w₃}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : α → C}
{g : β → C}
{h : γ → C}
[CategoryTheory.Limits.HasCoproduct f]
[CategoryTheory.Limits.HasCoproduct g]
[CategoryTheory.Limits.HasCoproduct h]
(p : α → β)
(p' : β → γ)
(q : (a : α) → f a ⟶ g (p a))
(q' : (b : β) → g b ⟶ h (p' b))

CategoryTheory.Limits.Sigma.map' p q ≫ CategoryTheory.Limits.Sigma.map' p' q' =
  CategoryTheory.Limits.Sigma.map' (p' ∘ p) fun a => q a ≫ q' (p a)


theorem dvd_mul_gcd_iff_dvd_mul [GCDMonoid α] {m n k : α} : k ∣ m * gcd k n ↔ k ∣ m * n

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
{m n k : α}


@[to_additive]
theorem multipliable_of_ne_finset_one (hf : ∀ b ∉ s, f b = 1) : Multipliable f

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{s : Finset β}
(hf : ∀ b ∉ s, f b = 0)


theorem mem_carrier {s : Subsemiring R} {x : R} : x ∈ s.carrier ↔ x ∈ s

{R : Type u}
[NonAssocSemiring R]
{s : Subsemiring R}
{x : R}


@[to_additive (attr := simp)]
theorem semiconjBy_op [Mul α] {a x y : α} : SemiconjBy (op a) (op y) (op x) ↔ SemiconjBy a x y

SemiconjBy (MulOpposite.op a) (MulOpposite.op y) (MulOpposite.op x) ↔ SemiconjBy a x y


protected theorem decode₂ : Primrec (decode₂ α)


theorem _root_.IsRelPrime.isCoprime (h : IsRelPrime x y) : IsCoprime x y

[Submodule.IsPrincipal (Ideal.span {x, y})]


theorem areaForm_map {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F]
    [hF : Fact (finrank ℝ F = 2)] (φ : E ≃ₗᵢ[ℝ] F) (x y : F) :
    (Orientation.map (Fin 2) φ.toLinearEquiv o).areaForm x y =
    o.areaForm (φ.symm x) (φ.symm y)

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

[hF : Fact (FiniteDimensional.finrank ℝ F = 2)]

(((Orientation.map (Fin 2) φ.toLinearEquiv) o).areaForm x) y = (o.areaForm (φ.symm x)) (φ.symm y)


theorem uniformity_basis_dist_pow {r : ℝ} (h0 : 0 < r) (h1 : r < 1) :
    (𝓤 α).HasBasis (fun _ : ℕ => True) fun n : ℕ => { p : α × α | dist p.1 p.2 < r ^ n }

{α : Type u}
[PseudoMetricSpace α]
{r : ℝ}
(h0 : 0 < r)
(h1 : r < 1)

(𝓤 α).HasBasis (fun x => True) fun n => {p | dist p.1 p.2 < r ^ n}


theorem multiplicity_ne_zero {a b : α} : multiplicity a b ≠ 0 ↔ a ∣ b

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}


theorem eq_iff_unitGroup {A B : ValuationSubring K} : A = B ↔ A.unitGroup = B.unitGroup

{K : Type u}
[Field K]
{A B : ValuationSubring K}


@[simp] theorem subNat_mk {i : Nat} (h₁ : i < n + m) (h₂ : m ≤ i) :
    subNat m ⟨i, h₁⟩ h₂ = ⟨i - m, Nat.sub_lt_right_of_lt_add h₂ h₁⟩

{n m i : Nat}
(h₁ : i < n + m)
(h₂ : m ≤ i)


@[simp] theorem mem_append {a : α} {s t : List α} : a ∈ s ++ t ↔ a ∈ s ∨ a ∈ t


@[to_additive]
theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x

{M : Type u_3}
[TopologicalSpace M]
[AddMonoid M]
[ContinuousAdd M]
(x : M)
(n : ℕ)


/-- A module is semisimple iff it is generated by its simple submodules. -/
theorem sSup_simples_eq_top_iff_isSemisimpleModule :
    sSup { m : Submodule R M | IsSimpleModule R m } = ⊤ ↔ IsSemisimpleModule R M

{R : Type u_2}
[Ring R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]

sSup {m | IsSimpleModule R ↥m} = ⊤ ↔ IsSemisimpleModule R M


theorem eq_const [PreconnectedSpace X] {f : X → Y} (hf : IsLocallyConstant f) (x : X) :
    f = Function.const X (f x)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[PreconnectedSpace X]
{f : X → Y}
(hf : IsLocallyConstant f)
(x : X)


lemma map_le_iff_le_comap {f : LatticeHom α β} {M : Sublattice β} : L.map f ≤ M ↔ L ≤ M.comap f

{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
{L : Sublattice α}
{f : LatticeHom α β}
{M : Sublattice β}

Sublattice.map f L ≤ M ↔ L ≤ Sublattice.comap f M


theorem graph_map_snd_eq_range (f : E →ₗ.[R] F) :
    f.graph.map (LinearMap.snd R E F) = LinearMap.range f.toFun

{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)

Submodule.map (LinearMap.snd R E F) f.graph = LinearMap.range f.toFun


@[simp]
theorem Ioo_pred_left (a b : α) : Ioo (pred a) b = Ico a b

{α : Type u_1}
[Preorder α]
[PredOrder α]
[NoMinOrder α]
(a b : α)


/-- The difference of `log (1+z)` and its `(n+1)`st Taylor polynomial can be bounded in
terms of `‖z‖`. -/
lemma norm_log_sub_logTaylor_le (n : ℕ) {z : ℂ} (hz : ‖z‖ < 1) :
    ‖log (1 + z) - logTaylor (n + 1) z‖ ≤ ‖z‖ ^ (n + 1) * (1 - ‖z‖)⁻¹ / (n + 1)

‖Complex.log (1 + z) - Complex.logTaylor (n + 1) z‖ ≤ ‖z‖ ^ (n + 1) * (1 - ‖z‖)⁻¹ / (↑n + 1)


theorem contMDiffWithinAt_inter' (ht : t ∈ 𝓝[s] x) :
    ContMDiffWithinAt I I' n f (s ∩ t) x ↔ ContMDiffWithinAt I I' n f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{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'}
{s t : Set M}
{x : M}
{n : ℕ∞}
(ht : t ∈ 𝓝[s] x)


@[simp]
theorem inf_toSubfield (S T : IntermediateField F E) :
    (S ⊓ T).toSubfield = S.toSubfield ⊓ T.toSubfield

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


@[to_additive]
theorem Set.piecewise_div [∀ i, Div (f i)] (s : Set I) [∀ i, Decidable (i ∈ s)]
    (f₁ f₂ g₁ g₂ : ∀ i, f i) :
    s.piecewise (f₁ / f₂) (g₁ / g₂) = s.piecewise f₁ g₁ / s.piecewise f₂ g₂

{I : Type u}
{f : I → Type v}
[(i : I) → Sub (f i)]
(s : Set I)
[(i : I) → Decidable (i ∈ s)]
(f₁ f₂ g₁ g₂ : (i : I) → f i)

s.piecewise (f₁ - f₂) (g₁ - g₂) = s.piecewise f₁ g₁ - s.piecewise f₂ g₂


theorem of_s_head_aux (v : K) : (of v).s.get? 0 = (IntFractPair.stream v 1).bind (some ∘ fun p =>
    { a := 1
      b := p.b })

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
(v : K)

(GenContFract.of v).s.get? 0 = (GenContFract.IntFractPair.stream v 1).bind (some ∘ fun p => { a := 1, b := ↑p.b })


theorem Nonempty.pairwise_iff_exists_forall [IsEquiv α r] {s : Set ι} (hs : s.Nonempty) :
    s.Pairwise (r on f) ↔ ∃ z, ∀ x ∈ s, r (f x) z

{α : Type u_1}
{ι : Type u_4}
{r : α → α → Prop}
{f : ι → α}
[IsEquiv α r]
{s : Set ι}
(hs : s.Nonempty)


@[simp]
protected theorem map_mul : (p * q).map f = p.map f * q.map f

{R : Type u}
{S : Type v}
[Semiring R]
{p q : R[X]}
[Semiring S]
(f : R →+* S)

Polynomial.map f (p * q) = Polynomial.map f p * Polynomial.map f q


@[simp]
theorem isTorsionBySet_singleton_iff : IsTorsionBySet R M {a} ↔ IsTorsionBy R M a

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(a : R)

Module.IsTorsionBySet R M {a} ↔ Module.IsTorsionBy R M a


protected lemma Infinite.mono {s t : Set α} (h : s ⊆ t) : s.Infinite → t.Infinite


theorem toList_insert [DecidableEq α] {a : α} {s : Finset α} (h : a ∉ s) :
    (insert a s).toList ~ a :: s.toList

{α : Type u_1}
[DecidableEq α]
{a : α}
{s : Finset α}
(h : a ∉ s)

(insert a s).toList.Perm (a :: s.toList)


@[to_additive]
theorem contMDiffOn_finset_prod (h : ∀ i ∈ t, ContMDiffOn I' I n (f i) s) :
    ContMDiffOn I' I n (fun x => ∏ i ∈ t, f i x) s


@[reassoc (attr := simp)]
lemma RightHomologyData.rightHomologyIso_hom_comp_homologyIso_inv (h : S.RightHomologyData) :
    h.rightHomologyIso.hom ≫ h.homologyIso.inv = S.rightHomologyIso.hom

CategoryTheory.CategoryStruct.comp h.rightHomologyIso.hom h.homologyIso.inv = S.rightHomologyIso.hom


theorem norm_apply_le_norm (hp : p ≠ 0) (f : lp E p) (i : α) : ‖f i‖ ≤ ‖f‖

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
(hp : p ≠ 0)
(f : ↥(lp E p))
(i : α)

‖↑f i‖ ≤ ‖f‖


theorem Continuous.le_induced (h : Continuous[t, t'] f) : t ≤ t'.induced f

{α : Type u_1}
{β : Type u_2}
{t : TopologicalSpace α}
{t' : TopologicalSpace β}
{f : α → β}
(h : Continuous f)


theorem integral_zero_ae (h : ∀ᵐ x ∂μ, x ∈ Ι a b → f x = 0) : ∫ x in a..b, f x ∂μ = 0

(h : ∀ᵐ (x : ℝ) ∂μ, x ∈ Ι a b → f x = 0)


@[simp]
theorem cos_pi_over_two_pow : ∀ n : ℕ, cos (π / 2 ^ (n + 1)) = sqrtTwoAddSeries 0 n / 2

Real.cos (Real.pi / 2 ^ (n + 1)) = Real.sqrtTwoAddSeries 0 n / 2


theorem opow_lt_opow_iff_right {a b c : Ordinal} (a1 : 1 < a) : a ^ b < a ^ c ↔ b < c


theorem lowerCrossingTime_lt_upperCrossingTime (hab : a < b)
    (hn : upperCrossingTime a b f N (n + 1) ω ≠ N) :
    lowerCrossingTime a b f N n ω < upperCrossingTime a b f N (n + 1) ω

{f : ℕ → Ω → ℝ}

(hn : MeasureTheory.upperCrossingTime a b f N (n + 1) ω ≠ N)

MeasureTheory.lowerCrossingTime a b f N n ω < MeasureTheory.upperCrossingTime a b f N (n + 1) ω


/-- If `Irreducible (cyclotomic (p ^ (k + 1)) K)` (in particular for `K = ℚ`) and `p` is a prime,
then the norm of `(zeta (p ^ (k + 1)) K L) ^ (p ^ s) - 1` is `p ^ (p ^ s)`
if `p ^ (k - s + 1) ≠ 2`. -/
theorem norm_zeta_pow_sub_one_of_prime_pow_ne_two {k : ℕ} [Fact (p : ℕ).Prime]
    [IsCyclotomicExtension {p ^ (k + 1)} K L]
    (hirr : Irreducible (cyclotomic (↑(p ^ (k + 1)) : ℕ) K)) {s : ℕ} (hs : s ≤ k)
    (htwo : p ^ (k - s + 1) ≠ 2) :
    norm K (zeta (p ^ (k + 1)) K L ^ (p : ℕ) ^ s - 1) = (p : K) ^ (p : ℕ) ^ s

(hirr : Irreducible (Polynomial.cyclotomic (↑(p ^ (k + 1))) K))

(Algebra.norm K) (IsCyclotomicExtension.zeta (p ^ (k + 1)) K L ^ ↑p ^ s - 1) = ↑↑p ^ ↑p ^ s


@[simp]
theorem forall_iff {p : α → Prop} : (∀ a, p a) ↔ True

{α : Sort u_1}
[IsEmpty α]
{p : α → Prop}


theorem exists_max_ideal_of_mem_nonunits [CommSemiring α] (h : a ∈ nonunits α) :
    ∃ I : Ideal α, I.IsMaximal ∧ a ∈ I

{α : Type u}
{a : α}
[CommSemiring α]
(h : a ∈ nonunits α)


{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
(W : CategoryTheory.MorphismProperty C)
[W.HasLeftCalculusOfFractions]


theorem count_dedup (l : List α) (a : α) : l.dedup.count a = if a ∈ l then 1 else 0

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

List.count a l.dedup = if a ∈ l then 1 else 0


@[to_additive]
theorem copy_eq (u : αˣ) (val hv inv hi) : u.copy val hv inv hi = u

{α : Type u}
[Monoid α]
(u : αˣ)
(val : α)
(hv : val = ↑u)
(inv : α)
(hi : inv = ↑u⁻¹)


theorem append_assoc {α} (xs ys zs : LazyList α) :
    (xs.append ys).append zs = xs.append (ys.append zs)

(xs.append { fn := fun x => ys }).append { fn := fun x => zs } =
  xs.append { fn := fun x => ys.append { fn := fun x => zs } }


@[to_additive]
theorem hasProd_of_isLUB_of_one_le [LinearOrderedCommMonoid α] [TopologicalSpace α]
    [OrderTopology α] {f : ι → α} (i : α) (h : ∀ i, 1 ≤ f i)
    (hf : IsLUB (Set.range fun s ↦ ∏ i ∈ s, f i) i) : HasProd f i

(hf : IsLUB (Set.range fun s => ∑ i ∈ s, f i) i)


theorem IsEquivalent.summable_iff {ι E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [FiniteDimensional ℝ E] {f : ι → E} {g : ι → E} (h : f ~[cofinite] g) :
    Summable f ↔ Summable g

{ι : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{f g : ι → E}
(h : f ~[Filter.cofinite] g)


theorem isLittleO_refl_left : (fun x => f' x - f' x) =o[l] g'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{f' : α → E'}
(g' : α → F')
(l : Filter α)


theorem stalkToFiber_injective (x : X) : Function.Injective (F.stalkToFiber x)

{X : TopCat}
(F : TopCat.Presheaf (Type v) X)
(x : ↑X)


theorem bind_decode_iff {f : α → β → Option σ} :
    (Computable₂ fun a n => (decode (α := β) n).bind (f a)) ↔ Computable₂ f

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → β → Option σ}

(Computable₂ fun a n => (Encodable.decode n).bind (f a)) ↔ Computable₂ f


theorem le_iterate_of_add_int_le_map {x : ℝ} {m : ℤ} (h : x + m ≤ f x) (n : ℕ) :
    x + n * m ≤ f^[n] x

(f : CircleDeg1Lift)
{x : ℝ}
{m : ℤ}
(h : x + ↑m ≤ f x)
(n : ℕ)


theorem inv_natCast_num_of_pos {a : ℕ} (ha0 : 0 < a) : (a : ℚ)⁻¹.num = 1


lemma subset_of_image_val_subset_image_val (h : (↑D : Set α) ⊆ ↑E) : D ⊆ E

(h : Subtype.val '' D ⊆ Subtype.val '' E)


@[simp]
theorem setOf_true : { _x : α | True } = univ


@[to_additive]
theorem Measurable.mul_iff_left {G : Type*} [MeasurableSpace G] [MeasurableSpace α] [CommGroup G]
    [MeasurableMul₂ G] [MeasurableInv G] {f g : α → G} (hf : Measurable f) :
    Measurable (g * f) ↔ Measurable g

{α : Type u_1}
{G : Type u_2}
[MeasurableSpace G]
[MeasurableSpace α]
[CommGroup G]
[MeasurableMul₂ G]
[MeasurableInv G]
{f g : α → G}
(hf : Measurable f)


theorem ofNat_mul_im (n : ℕ) [n.AtLeastTwo] (z : K) :
    im (OfNat.ofNat n * z) = OfNat.ofNat n * im z

{K : Type u_1}
[RCLike K]
(n : ℕ)
[n.AtLeastTwo]
(z : K)

RCLike.im (OfNat.ofNat n * z) = OfNat.ofNat n * RCLike.im z


theorem isSheaf_iso_iff {F G : Presheaf C X} (α : F ≅ G) : F.IsSheaf ↔ G.IsSheaf

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : TopCat}
{F G : TopCat.Presheaf C X}
(α : F ≅ G)


/-- A continuous function with compact support is bounded above. -/
@[to_additive " A continuous function with compact support is bounded above. "]
theorem Continuous.bddAbove_range_of_hasCompactMulSupport [ClosedIciTopology α] [One α]
    {f : β → α} (hf : Continuous f) (h : HasCompactMulSupport f) : BddAbove (range f)

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIciTopology α]
[Zero α]
{f : β → α}
(hf : Continuous f)
(h : HasCompactSupport f)


/-- The quaternion conjugate maps to the "clifford conjugate" (aka `star`). -/
@[simp]
theorem ofQuaternion_star (q : ℍ[R,c₁,c₂]) : ofQuaternion (star q) = star (ofQuaternion q)

{R : Type u_1}
[CommRing R]
{c₁ c₂ : R}
(q : QuaternionAlgebra R c₁ c₂)

CliffordAlgebraQuaternion.ofQuaternion (star q) = star (CliffordAlgebraQuaternion.ofQuaternion q)


theorem content_primPart (p : R[X]) : p.primPart.content = 1

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
(p : Polynomial R)


/-- A compact set is bounded above -/
theorem IsCompact.bddAbove [ClosedIciTopology α] [Nonempty α] {s : Set α} (hs : IsCompact s) :
    BddAbove s

{α : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[ClosedIciTopology α]
[Nonempty α]
{s : Set α}
(hs : IsCompact s)


/-- An iterated product is a product over a sigma type. -/
@[simps]
def piPiIso {ι : Type*} (f : ι → Type*) (g : (i : ι) → (f i) → C)
    [∀ i, HasProduct (g i)] [HasProduct fun i => ∏ᶜ g i] :
    (∏ᶜ fun i => ∏ᶜ g i) ≅ (∏ᶜ fun p : Σ i, f i => g p.1 p.2)

[∀ (i : ι), CategoryTheory.Limits.HasProduct (g i)]

[CategoryTheory.Limits.HasProduct fun i => ∏ᶜ g i]

(CategoryTheory.Limits.piPiIso f g).inv =
  CategoryTheory.Limits.Pi.lift fun i =>
    CategoryTheory.Limits.Pi.lift fun x => CategoryTheory.Limits.Pi.π (fun p => g p.fst p.snd) ⟨i, x⟩


theorem mem_prod_self_iff {s} : s ∈ la ×ˢ la ↔ ∃ t ∈ la, t ×ˢ t ⊆ s

{α : Type u_1}
{la : Filter α}
{s : Set (α × α)}


theorem card_support_C_mul_X_pow_le_one {c : R} {n : ℕ} : card (support (C c * X ^ n)) ≤ 1

{R : Type u}
[Semiring R]
{c : R}
{n : ℕ}

(Polynomial.C c * Polynomial.X ^ n).support.card ≤ 1


@[simp] theorem mersenne_zero : mersenne 0 = 0


theorem IsOpenMap.coverPreserving (hf : IsOpenMap f) :
    CoverPreserving (Opens.grothendieckTopology X) (Opens.grothendieckTopology Y) hf.functor

{X Y : TopCat}
{f : X ⟶ Y}
(hf : IsOpenMap ⇑f)

CategoryTheory.CoverPreserving (Opens.grothendieckTopology ↑X) (Opens.grothendieckTopology ↑Y) hf.functor


theorem ofReal_eq_zero {x : ℝ} : (x : K) = 0 ↔ x = 0


theorem map_mul_left_nhds_one₀ (ha : a ≠ 0) : map (a * ·) (𝓝 1) = 𝓝 (a)

{G₀ : Type u_3}
[TopologicalSpace G₀]
[GroupWithZero G₀]
[ContinuousMul G₀]
{a : G₀}
(ha : a ≠ 0)


@[simp]
theorem coe_to_linearMap_comp : (f.compDer D : A →ₗ[R] N) = (f : M →ₗ[R] N).comp (D : A →ₗ[R] M)

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(D : Derivation R A M)
{N : Type u_5}
[AddCommMonoid N]
[Module A N]
[Module R N]
[IsScalarTower R A M]
[IsScalarTower R A N]
(f : M →ₗ[A] N)


@[simp] lemma reverse_X_mul (p : R[X]) : reverse (X * p) = reverse p

{R : Type u_1}
[Semiring R]
(p : Polynomial R)


lemma mem_nonZeroSMulDivisors_iff {x : R} : x ∈ R⁰[M] ↔ ∀ (m : M), x • m = 0 → m = 0

{R : Type u_2}
{M : Type u_3}
[MonoidWithZero R]
[Zero M]
[MulAction R M]
{x : R}

x ∈ nonZeroSMulDivisors R M ↔ ∀ (m : M), x • m = 0 → m = 0


@[simp]
theorem bodd_one : bodd 1 = true


theorem Set.Finite.convexHull_eq {s : Set E} (hs : s.Finite) : convexHull R s =
    { x : E | ∃ w : E → R, (∀ y ∈ s, 0 ≤ w y) ∧ ∑ y ∈ hs.toFinset, w y = 1 ∧
      hs.toFinset.centerMass w id = x }

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
{s : Set E}
(hs : s.Finite)

(convexHull R) s = {x | ∃ w, (∀ y ∈ s, 0 ≤ w y) ∧ ∑ y ∈ hs.toFinset, w y = 1 ∧ hs.toFinset.centerMass w id = x}


@[simp]
theorem cast_pos [LinearOrderedSemiring α] (n : PosNum) : 0 < (n : α)

{α : Type u_1}
[LinearOrderedSemiring α]
(n : PosNum)


theorem integrable_cexp_neg_mul_sum_add {ι : Type*} [Fintype ι] (hb : 0 < b.re) (c : ι → ℂ) :
    Integrable (fun (v : ι → ℝ) ↦ cexp (- b * ∑ i, (v i : ℂ) ^ 2 + ∑ i, c i * v i))

{b : ℂ}
{ι : Type u_2}
[Fintype ι]
(hb : 0 < b.re)
(c : ι → ℂ)

MeasureTheory.Integrable (fun v => cexp (-b * ∑ i : ι, ↑(v i) ^ 2 + ∑ i : ι, c i * ↑(v i))) MeasureTheory.volume


theorem nat_card : Nat.card (DihedralGroup n) = 2 * n


theorem div_four_left {a : ℤ} {b : ℕ} (ha4 : a % 4 = 0) (hb2 : b % 2 = 1) :
    J(a / 4 | b) = J(a | b)


/-- A variant of `lift_unique` with `Z` an initial object. -/
@[simps!]
def liftToInitialUnique {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsInitial Z)
    (G : WithInitial C ⥤ D) (h : incl ⋙ G ≅ F) (hG : G.obj star ≅ Z) : G ≅ liftToInitial F hZ

(hZ : CategoryTheory.Limits.IsInitial Z)

(G : CategoryTheory.Functor (CategoryTheory.WithInitial C) D)

(h : CategoryTheory.WithInitial.incl.comp G ≅ F)

(hG : G.obj CategoryTheory.WithInitial.star ≅ Z)

(CategoryTheory.WithInitial.liftToInitialUnique F hZ G h hG).hom.app X =
  (match X with
    | CategoryTheory.WithInitial.of x => h.app x
    | CategoryTheory.WithInitial.star => hG).hom


lemma mul_def (a b : WithBot α) :
    a * b = if a = 0 ∨ b = 0 then 0 else WithBot.map₂ (· * ·) a b

{α : Type u_1}
[DecidableEq α]
[MulZeroClass α]
(a b : WithBot α)

a * b = if a = 0 ∨ b = 0 then 0 else WithBot.map₂ (fun x x_1 => x * x_1) a b


/-- The canonical `R`-linear projection `Unitization R A → A`. -/
@[simps apply]
def sndHom [Semiring R] [AddCommMonoid A] [Module R A] : Unitization R A →ₗ[R] A

(R : Type u_3)
(A : Type u_4)
[Semiring R]
[AddCommMonoid A]
[Module R A]
(x : Unitization R A)


@[simp] lemma ofList_cons (r : R) (rs : List R) :
    ofList (r::rs) = span {r} ⊔ ofList rs

{R : Type u_1}
[Semiring R]
(r : R)
(rs : List R)

Ideal.ofList (r :: rs) = Ideal.span {r} ⊔ Ideal.ofList rs


/-- If there is a primitive `n`-th root of unity in `K`, then
`∏ i ∈ Nat.divisors n, cyclotomic' i K = X ^ n - 1`. -/
theorem prod_cyclotomic'_eq_X_pow_sub_one {K : Type*} [CommRing K] [IsDomain K] {ζ : K} {n : ℕ}
    (hpos : 0 < n) (h : IsPrimitiveRoot ζ n) :
    ∏ i ∈ Nat.divisors n, cyclotomic' i K = X ^ n - 1

{K : Type u_2}
[CommRing K]
[IsDomain K]
{ζ : K}
{n : ℕ}
(hpos : 0 < n)
(h : IsPrimitiveRoot ζ n)

∏ i ∈ n.divisors, Polynomial.cyclotomic' i K = Polynomial.X ^ n - 1


/-- Coercion to a function as a `RingHom`. -/
@[simps]
def coeFnRingHom {R : Type*} [CommRing R] [TopologicalSpace R] [ChartedSpace H' R]
    [SmoothRing I' R] : C^∞⟮I, N; I', R⟯ →+* N → R

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{H' : Type u_5}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{R : Type u_10}
[CommRing R]
[TopologicalSpace R]
[ChartedSpace H' R]
[SmoothRing I' R]

∀ (a : C^⊤⟮I, N; I', R⟯) (a_1 : N), SmoothMap.coeFnRingHom a a_1 = a a_1


theorem Tendsto.prod_map_coprod {δ : Type*} {f : α → γ} {g : β → δ} {a : Filter α} {b : Filter β}
    {c : Filter γ} {d : Filter δ} (hf : Tendsto f a c) (hg : Tendsto g b d) :
    Tendsto (Prod.map f g) (a.coprod b) (c.coprod d)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_6}
{f : α → γ}
{g : β → δ}
{a : Filter α}
{b : Filter β}
{c : Filter γ}
{d : Filter δ}
(hf : Filter.Tendsto f a c)
(hg : Filter.Tendsto g b d)

Filter.Tendsto (Prod.map f g) (a.coprod b) (c.coprod d)


/-- The isomorphism between points of limit kernel forks induced by an isomorphism
in the category of arrows. -/
@[simps]
def mapIsoOfIsLimit {kf : KernelFork f} {kf' : KernelFork f'}
    (hf : IsLimit kf) (hf' : IsLimit kf')
    (φ : Arrow.mk f ≅ Arrow.mk f') : kf.pt ≅ kf'.pt

{kf : CategoryTheory.Limits.KernelFork f}

{kf' : CategoryTheory.Limits.KernelFork f'}

(hf' : CategoryTheory.Limits.IsLimit kf')

(φ : CategoryTheory.Arrow.mk f ≅ CategoryTheory.Arrow.mk f')

(CategoryTheory.Limits.KernelFork.mapIsoOfIsLimit hf hf' φ).hom = kf.mapOfIsLimit hf' φ.hom


/-- An open ball in a product space is a product of open balls. See also `ball_pi`
for a version assuming `0 < r` instead of `Nonempty β`. -/
lemma ball_pi' [Nonempty β] (x : ∀ b, π b) (r : ℝ) :
    ball x r = Set.pi univ fun b => ball (x b) r

{β : Type u_2}
{π : β → Type u_3}
[Fintype β]
[(b : β) → PseudoMetricSpace (π b)]
[Nonempty β]
(x : (b : β) → π b)
(r : ℝ)

Metric.ball x r = Set.univ.pi fun b => Metric.ball (x b) r


theorem Finite.seq' {α β : Type u} {f : Set (α → β)} {s : Set α} (hf : f.Finite) (hs : s.Finite) :
    (f <*> s).Finite


theorem degrees_indicator (c : σ → K) :
    degrees (indicator c) ≤ ∑ s : σ, (Fintype.card K - 1) • {s}

{K : Type u_1}
{σ : Type u_2}
[Fintype K]
[Fintype σ]
[CommRing K]
(c : σ → K)

(MvPolynomial.indicator c).degrees ≤ ∑ s : σ, (Fintype.card K - 1) • {s}


/-- Negating a matrix partitioned by rows is equivalent to negating each of the rows. -/
@[simp]
lemma fromRows_neg (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) :
    -fromRows A₁ A₂ = fromRows (-A₁) (-A₂)

{R : Type u_1}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n : Type u_5}
[Neg R]
(A₁ : Matrix m₁ n R)
(A₂ : Matrix m₂ n R)


theorem ReflTransGen.lift {p : β → β → Prop} {a b : α} (f : α → β)
    (h : ∀ a b, r a b → p (f a) (f b)) (hab : ReflTransGen r a b) : ReflTransGen p (f a) (f b)

(h : ∀ (a b : α), r a b → p (f a) (f b))


@[simp]
theorem one_le_chainHeight_iff : 1 ≤ s.chainHeight ↔ s.Nonempty