/-- `mulEquivAut` as an isomorphism between automorphism groups. -/
@[simps!]
noncomputable def autMulEquivOfFullyFaithful (X : C) :
    Aut X ≃* Aut (f.obj X)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
{f : CategoryTheory.Functor C D}
(hf : f.FullyFaithful)
(X : C)
(e : f.obj X ≅ f.obj X)

((hf.autMulEquivOfFullyFaithful X).symm e).hom = hf.preimage e.hom


@[simp]
theorem coe_toOrderEmbedding (e : α ≃o β) : ⇑e.toOrderEmbedding = e

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
(e : α ≃o β)


@[to_additive (attr := simp)]
theorem smul_ball (c : G) (x : X) (r : ℝ≥0∞) : c • ball x r = ball (c • x) r

{G : Type v}
{X : Type w}
[PseudoEMetricSpace X]
[Group G]
[MulAction G X]
[IsometricSMul G X]
(c : G)
(x : X)
(r : ℝ≥0∞)

c • EMetric.ball x r = EMetric.ball (c • x) r


theorem fderiv_single {i : ι} (y : E i) :
    fderiv 𝕜 (Pi.single i) y = .pi (Pi.single i (.id 𝕜 (E i)))

{𝕜 : Type u_1}
{ι : Type u_2}
[DecidableEq ι]
[Fintype ι]
[NontriviallyNormedField 𝕜]
{E : ι → Type u_3}
[(i : ι) → NormedAddCommGroup (E i)]
[(i : ι) → NormedSpace 𝕜 (E i)]
{i : ι}
(y : E i)

fderiv 𝕜 (Pi.single i) y = ContinuousLinearMap.pi (Pi.single i (ContinuousLinearMap.id 𝕜 (E i)))


theorem span_singleton_mul_le_iff {x : R} {I J : Ideal R} :
    span {x} * I ≤ J ↔ ∀ z ∈ I, x * z ∈ J

{R : Type u}
[CommSemiring R]
{x : R}
{I J : Ideal R}

Ideal.span {x} * I ≤ J ↔ ∀ z ∈ I, x * z ∈ J


lemma unique (g : L ≃+* L) {c : ZMod n}  (hc : ∀ t ∈ rootsOfUnity n L, g t = t ^ c.val) :
    c = ModularCyclotomicCharacter L hn g

(hn : Fintype.card ↥(rootsOfUnity n L) = ↑n)

(hc : ∀ t ∈ rootsOfUnity n L, g ↑t = ↑t ^ c.val)

c = ↑((ModularCyclotomicCharacter L hn) g)


/-- **Young's inequality**, `ℝ≥0∞` version with real conjugate exponents. -/
theorem young_inequality (a b : ℝ≥0∞) {p q : ℝ} (hpq : p.IsConjExponent q) :
    a * b ≤ a ^ p / ENNReal.ofReal p + b ^ q / ENNReal.ofReal q


theorem mul_nonneg_of_nonpos_of_nonpos [ExistsAddOfLE α] [MulPosMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (ha : a ≤ 0) (hb : b ≤ 0) : 0 ≤ a * b

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

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


theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y

{α : Type u_1}
[LinearOrderedRing α]
(x y : α)

SignType.sign (x * y) = SignType.sign x * SignType.sign y


/-- In a separable pseudometric space, for any ε > 0 there exists a countable collection of
disjoint Borel measurable subsets of diameter at most ε that cover the whole space. -/
lemma SeparableSpace.exists_measurable_partition_diam_le {ε : ℝ} (ε_pos : 0 < ε) :
    ∃ (As : ℕ → Set Ω), (∀ n, MeasurableSet (As n)) ∧ (∀ n, Bornology.IsBounded (As n)) ∧
        (∀ n, diam (As n) ≤ ε) ∧ (⋃ n, As n = univ) ∧
        (Pairwise (fun (n m : ℕ) ↦ Disjoint (As n) (As m)))

(Ω : Type u_2)
[PseudoMetricSpace Ω]
[TopologicalSpace.SeparableSpace Ω]
[MeasurableSpace Ω]
[OpensMeasurableSpace Ω]
{ε : ℝ}
(ε_pos : 0 < ε)

∃ As,
  (∀ (n : ℕ), MeasurableSet (As n)) ∧
    (∀ (n : ℕ), Bornology.IsBounded (As n)) ∧
      (∀ (n : ℕ), Metric.diam (As n) ≤ ε) ∧ ⋃ n, As n = Set.univ ∧ Pairwise fun n m => Disjoint (As n) (As m)


@[simp]
theorem valuationSubring_valuation : A.valuation.valuationSubring = A

{K : Type u}
[Field K]
(A : ValuationSubring K)


theorem inter_cylinder_longestPrefix_nonempty {s : Set (∀ n, E n)} (hs : IsClosed s)
    (hne : s.Nonempty) (x : ∀ n, E n) : (s ∩ cylinder x (longestPrefix x s)).Nonempty

{E : ℕ → Type u_1}
[(n : ℕ) → TopologicalSpace (E n)]
[∀ (n : ℕ), DiscreteTopology (E n)]
{s : Set ((n : ℕ) → E n)}
(hs : IsClosed s)
(hne : s.Nonempty)
(x : (n : ℕ) → E n)

(s ∩ PiNat.cylinder x (PiNat.longestPrefix x s)).Nonempty


theorem coe_eq_iff {a : { a // p a }} {b : α} : ↑a = b ↔ ∃ h, a = ⟨b, h⟩

{α : Sort u_1}
{p : α → Prop}
{a : { a // p a }}
{b : α}


/-- We can turn any colimit cocone over a pair into a bicone. -/
@[simps]
def BinaryBicone.ofColimitCocone {X Y : C} {t : Cocone (pair X Y)} (ht : IsColimit t) :
    BinaryBicone X Y

{t : CategoryTheory.Limits.Cocone (CategoryTheory.Limits.pair X Y)}

(ht : CategoryTheory.Limits.IsColimit t)

(CategoryTheory.Limits.BinaryBicone.ofColimitCocone ht).inr = t.ι.app { as := CategoryTheory.Limits.WalkingPair.right }


@[simp]
theorem bind_eq_bind {α β} (f : α → List β) (l : List α) : l >>= f = l.bind f

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


@[to_additive (attr := simp)]
theorem mk_eq_one [One M] [One N] {x : M} {y : N} : (x, y) = 1 ↔ x = 1 ∧ y = 1

{M : Type u_5}
{N : Type u_6}
[One M]
[One N]
{x : M}
{y : N}


/-- In a semigroup, the product of regular elements is regular. -/
@[to_additive "In an additive semigroup, the sum of add-regular elements is add-regular."]
theorem IsRegular.mul (rra : IsRegular a) (rrb : IsRegular b) :
    IsRegular (a * b)

{R : Type u_1}
[AddSemigroup R]
{a b : R}
(rra : IsAddRegular a)
(rrb : IsAddRegular b)


@[to_additive]
theorem dist_prod_prod_le (s : Finset ι) (f a : ι → E) :
    dist (∏ b ∈ s, f b) (∏ b ∈ s, a b) ≤ ∑ b ∈ s, dist (f b) (a b)

{ι : Type u_4}
{E : Type u_6}
[SeminormedAddCommGroup E]
(s : Finset ι)
(f a : ι → E)

dist (∑ b ∈ s, f b) (∑ b ∈ s, a b) ≤ ∑ b ∈ s, dist (f b) (a b)


@[simp]
lemma id_comp (F : 𝒳 ⥤ᵇ 𝒴) : 𝟭 𝒳 ⋙ F = F

{𝒮 : Type u₁}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
{𝒳 : CategoryTheory.BasedCategory 𝒮}
{𝒴 : CategoryTheory.BasedCategory 𝒮}
(F : CategoryTheory.BasedFunctor 𝒳 𝒴)

(CategoryTheory.BasedFunctor.id 𝒳).comp F = F


theorem Algebra.isSeparable_iff :
    Algebra.IsSeparable F K ↔ ∀ x : K, IsIntegral F x ∧ IsSeparable F x

{F : Type u_1}
{K : Type u_2}
[CommRing F]
[Ring K]
[Algebra F K]

Algebra.IsSeparable F K ↔ ∀ (x : K), IsIntegral F x ∧ IsSeparable F x


theorem IsClosed.upperSemicontinuous_indicator (hs : IsClosed s) (hy : 0 ≤ y) :
    UpperSemicontinuous (indicator s fun _x => y)

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{s : Set α}
{y : β}
[Zero β]
(hs : IsClosed s)
(hy : 0 ≤ y)

UpperSemicontinuous (s.indicator fun _x => y)


theorem eq_jacobson_iff_sInf_maximal' :
    I.jacobson = I ↔ ∃ M : Set (Ideal R), (∀ J ∈ M, ∀ (K : Ideal R), J < K → K = ⊤) ∧ I = sInf M

I.jacobson = I ↔ ∃ M, (∀ J ∈ M, ∀ (K : Ideal R), J < K → K = ⊤) ∧ I = sInf M


theorem integral_eq_tsum (p : PMF α) (f : α → E) (hf : Integrable f p.toMeasure) :
    ∫ a, f a ∂(p.toMeasure) = ∑' a, (p a).toReal • f a

(hf : MeasureTheory.Integrable f p.toMeasure)

∫ (a : α), f a ∂p.toMeasure = ∑' (a : α), (p a).toReal • f a


@[to_additive (attr := simp) zero_mem_addCentralizer]
lemma one_mem_centralizer : (1 : M) ∈ centralizer S

{M : Type u_1}
{S : Set M}
[AddZeroClass M]


theorem sub_le_sub_iff_left (h : c ≤ a) (h' : a ≠ ∞) :
    (a - b ≤ a - c) ↔ c ≤ b


@[reassoc (attr := simp)]
lemma pullback.lift_snd {Z : LightProfinite.{u}} (a : Z ⟶ X) (b : Z ⟶ Y) (w : a ≫ f = b ≫ g) :
    pullback.lift f g a b w ≫ pullback.snd f g = b

(w : CategoryTheory.CategoryStruct.comp a f = CategoryTheory.CategoryStruct.comp b g)

CategoryTheory.CategoryStruct.comp (LightProfinite.pullback.lift f g a b w) (LightProfinite.pullback.snd f g) = b


/-- If `I` is an ideal such that there exists a set `{ r }` of `R` such
that the image of `I` in `Rᵣ` is finitely generated for each `r`, then `I` is finitely
generated. -/
lemma fg_of_localizationSpan {I : Ideal R} (t : Set R) (ht : Ideal.span t = ⊤)
    (H : ∀ (g : t), (I.map (algebraMap R (Localization.Away g.val))).FG) : I.FG

(H : ∀ (g : ↑t), (Ideal.map (algebraMap R (Localization.Away ↑g)) I).FG)


@[to_additive lt_of_nsmul_lt_nsmul_right]
theorem lt_of_pow_lt_pow_left' {a b : M} (n : ℕ) : a ^ n < b ^ n → a < b

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

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


lemma nonneg_and_nonneg_or_nonpos_and_nonpos_of_smul_nonneg (hab : 0 ≤ a • b) :
    0 ≤ a ∧ 0 ≤ b ∨ a ≤ 0 ∧ b ≤ 0

{α : Type u_1}
{β : Type u_2}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[PosSMulStrictMono α β]
{a : α}
{b : β}
(hab : 0 ≤ a • b)


@[reassoc (attr := simp)]
theorem Fork.condition (t : Fork f g) : t.ι ≫ f = t.ι ≫ g

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

CategoryTheory.CategoryStruct.comp t.ι f = CategoryTheory.CategoryStruct.comp t.ι g


theorem or_congr_left (h : a ↔ b) : a ∨ c ↔ b ∨ c


/--
Given a limit cone for the pair `f g : X ⟶ Y`, for any `Z`, morphisms from `Z` to its point are in
bijection with morphisms `h : Z ⟶ X` such that `h ≫ f = h ≫ g`.
Further, this bijection is natural in `Z`: see `Fork.IsLimit.homIso_natural`.
This is a special case of `IsLimit.homIso'`, often useful to construct adjunctions.
-/
@[simps]
def Fork.IsLimit.homIso {X Y : C} {f g : X ⟶ Y} {t : Fork f g} (ht : IsLimit t) (Z : C) :
    (Z ⟶ t.pt) ≃ { h : Z ⟶ X // h ≫ f = h ≫ g }

(h : { h // CategoryTheory.CategoryStruct.comp h f = CategoryTheory.CategoryStruct.comp h g })

(CategoryTheory.Limits.Fork.IsLimit.homIso ht Z).symm h = ↑(CategoryTheory.Limits.Fork.IsLimit.lift' ht ↑h ⋯)


theorem map_coord_zero {m : ι → M} (i : ι) (h : m i = 0) : f m = 0

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
(f : M [⋀^ι]→L[R] N)
{m : ι → M}
(i : ι)
(h : m i = 0)


theorem tendsto_cons {n : ℕ} {a : α} {l : Vector α n} :
    Tendsto (fun p : α × Vector α n => p.1 ::ᵥ p.2) (𝓝 a ×ˢ 𝓝 l) (𝓝 (a ::ᵥ l))

{α : Type u_1}
[TopologicalSpace α]
{n : ℕ}
{a : α}
{l : Mathlib.Vector α n}

Filter.Tendsto (fun p => p.1 ::ᵥ p.2) (𝓝 a ×ˢ 𝓝 l) (𝓝 (a ::ᵥ l))


theorem option_bind {f : α → Option β} {g : α → β → Option σ} (hf : Computable f)
    (hg : Computable₂ g) : Computable fun a => (f a).bind (g a)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → Option β}
{g : α → β → Option σ}
(hf : Computable f)
(hg : Computable₂ g)


theorem le_inv (ha : 0 < a) (hb : 0 < b) : a ≤ b⁻¹ ↔ b ≤ a⁻¹

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 < a)
(hb : 0 < b)

a ≤ b⁻¹ ↔ b ≤ a⁻¹


theorem strictMono_mul_left_of_pos [PosMulStrictMono α]
    (ha : 0 < a) : StrictMono fun x => a * x

{α : Type u}
[Semiring α]
[PartialOrder α]
{a : α}
[PosMulStrictMono α]
(ha : 0 < a)


theorem conjTranspose_list_prod [Semiring α] [StarRing α] [Fintype m] [DecidableEq m]
    (l : List (Matrix m m α)) : l.prodᴴ = (l.map conjTranspose).reverse.prod

{m : Type u_2}
{α : Type v}
[Semiring α]
[StarRing α]
[Fintype m]
[DecidableEq m]
(l : List (Matrix m m α))

l.prodᴴ = (List.map Matrix.conjTranspose l).reverse.prod


theorem OpenEmbedding.map_nhds_eq (hf : OpenEmbedding f) (x : X) :
    map f (𝓝 x) = 𝓝 (f x)

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


lemma Exact.hasHomology (h : S.Exact) : S.HasHomology


@[gcongr] protected theorem div_le_div_left (h : a ≤ b) (c : ℝ≥0∞) : c / b ≤ c / a

{a b : ENNReal}
(h : a ≤ b)
(c : ENNReal)


@[simp] theorem bitIndices_two_pow_mul (k n : ℕ) :
    bitIndices (2^k * n) = (bitIndices n).map (· + k)

(2 ^ k * n).bitIndices = List.map (fun x => x + k) n.bitIndices


lemma equation_of_Z_ne_zero {P : Fin 3 → F} (hPz : P z ≠ 0) :
    W.Equation P ↔ W.toAffine.Equation (P x / P z ^ 2) (P y / P z ^ 3)

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


/-- The Jacobi symbol `J(a | b)` depends only on `b` mod `4*a` (version for `a : ℕ`). -/
theorem mod_right' (a : ℕ) {b : ℕ} (hb : Odd b) : J(a | b) = J(a | b % (4 * a))

jacobiSym (↑a) b = jacobiSym (↑a) (b % (4 * a))


theorem addHaar_closedBall_eq_addHaar_ball [Nontrivial E] (x : E) (r : ℝ) :
    μ (closedBall x r) = μ (ball x r)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
[Nontrivial E]
(x : E)
(r : ℝ)

μ (Metric.closedBall x r) = μ (Metric.ball x r)


@[simp]
protected lemma comp_id {n : ℤ} (z₁ : Cochain F G n) :
    z₁.comp (Cochain.ofHom (𝟙 G)) (add_zero n) = z₁

(z₁ : CochainComplex.HomComplex.Cochain F G n)

z₁.comp (CochainComplex.HomComplex.Cochain.ofHom (𝟙 G)) ⋯ = z₁


@[simp]
theorem coe_repr_symm : ↑b.repr.symm = Finsupp.total ι M R b

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


/-- If `f : ℝ → ℝ` is strictly convex on `S` and differentiable within `S` at `y ∈ S`, then the
slope of any secant line with right endpoint at `y` is strictly less than the derivative of `f`
within `S` at `y`.

This is fractionally weaker than `StrictConvexOn.slope_lt_of_hasDerivWithinAt_Iio` but simpler to
apply under a `DifferentiableOn S` hypothesis.-/
lemma slope_lt_of_hasDerivWithinAt (hfc : StrictConvexOn ℝ S f)
    (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y) (hf' : HasDerivWithinAt f f' S y) :
    slope f x y < f'

{S : Set ℝ}
{f : ℝ → ℝ}
{x y f' : ℝ}
(hfc : StrictConvexOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hf' : HasDerivWithinAt f f' S y)


theorem coe_toSeminorm {f : E →ₗ[𝕜] 𝕜} : ⇑f.toSeminorm = fun x => ‖f x‖

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{f : E →ₗ[𝕜] 𝕜}


protected theorem le_def {α} {t s : TopologicalSpace α} : t ≤ s ↔ IsOpen[s] ≤ IsOpen[t]

{α : Type u_1}
{t s : TopologicalSpace α}


@[to_additive Icc_add_Icc_subset]
theorem Icc_mul_Icc_subset' (a b c d : α) : Icc a b * Icc c d ⊆ Icc (a * c) (b * d)

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

[CovariantClass α α (Function.swap HMul.hMul) LE.le]

Set.Icc a b * Set.Icc c d ⊆ Set.Icc (a * c) (b * d)


/-- An uncurried version of `Finset.prod_prod_type`. -/
@[to_additive Fintype.sum_prod_type' "An uncurried version of `Finset.sum_prod_type`"]
theorem Fintype.prod_prod_type' [CommMonoid γ] {f : α₁ → α₂ → γ} :
    ∏ x : α₁ × α₂, f x.1 x.2 = ∏ x, ∏ y, f x y

{γ : Type u_3}
{α₁ : Type u_4}
{α₂ : Type u_5}
[Fintype α₁]
[Fintype α₂]
[CommMonoid γ]
{f : α₁ → α₂ → γ}

∏ x : α₁ × α₂, f x.1 x.2 = ∏ x : α₁, ∏ y : α₂, f x y


theorem comp_whiskerLeft_bimod {W X Y Z : Mon_ C} (M : Bimod W X) (N : Bimod X Y)
    {P P' : Bimod Y Z} (f : P ⟶ P') :
    whiskerLeft (M.tensorBimod N) f =
      (associatorBimod M N P).hom ≫
        whiskerLeft M (whiskerLeft N f) ≫ (associatorBimod M N P').inv

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁} (CategoryTheory.MonoidalCategory.tensorLeft X)]

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁}
      (CategoryTheory.MonoidalCategory.tensorRight X)]

(M.tensorBimod N).whiskerLeft f =
  (M.associatorBimod N P).hom ≫ M.whiskerLeft (N.whiskerLeft f) ≫ (M.associatorBimod N P').inv


@[to_additive (attr := simp)]
theorem one_mem_div_iff : (1 : α) ∈ s / t ↔ ¬Disjoint s t


theorem cantorFunctionAux_zero (f : ℕ → Bool) : cantorFunctionAux c f 0 = cond (f 0) 1 0

Cardinal.cantorFunctionAux c f 0 = bif f 0 then 1 else 0


@[to_additive mem_rightAddCoset_rightAddCoset]
theorem mem_rightCoset_rightCoset {a : α} (ha : op a • (s : Set α) = s) : a ∈ s

{α : Type u_1}
[Monoid α]
(s : Submonoid α)
{a : α}
(ha : MulOpposite.op a • ↑s = ↑s)


@[simp] lemma bijOn_singleton : BijOn f {a} {b} ↔ f a = b

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{a : α}
{b : β}


@[norm_cast]
theorem dvd_to_nat (m n : Num) : (m : ℕ) ∣ n ↔ m ∣ n

↑m ∣ ↑n ↔ m ∣ n


@[simp, fun_prop, measurability]
theorem measurable_const {_ : MeasurableSpace α} {_ : MeasurableSpace β} {a : α} :
    Measurable fun _ : β => a

∀ {x : MeasurableSpace α} {x_1 : MeasurableSpace β} {a : α}, Measurable fun x => a


/-- Given a perfect nonempty set in a T2.5 space, we can find two disjoint perfect subsets.
This is the main inductive step in the proof of the Cantor-Bendixson Theorem. -/
theorem Perfect.splitting [T25Space α] (hC : Perfect C) (hnonempty : C.Nonempty) :
    ∃ C₀ C₁ : Set α,
    (Perfect C₀ ∧ C₀.Nonempty ∧ C₀ ⊆ C) ∧ (Perfect C₁ ∧ C₁.Nonempty ∧ C₁ ⊆ C) ∧ Disjoint C₀ C₁

{α : Type u_1}
[TopologicalSpace α]
{C : Set α}
[T25Space α]
(hC : Perfect C)
(hnonempty : C.Nonempty)

∃ C₀ C₁, (Perfect C₀ ∧ C₀.Nonempty ∧ C₀ ⊆ C) ∧ (Perfect C₁ ∧ C₁.Nonempty ∧ C₁ ⊆ C) ∧ Disjoint C₀ C₁


theorem zero_apply {a : α} : (0 : α →₀ M) a = 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
{a : α}


@[to_additive] lemma mabs_sup_div_sup_le_mabs (a b c : α) : |(a ⊔ c) / (b ⊔ c)|ₘ ≤ |a / b|ₘ

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


theorem card_image_le {s : Set α} [Finite s] (f : α → β) : Nat.card (f '' s) ≤ Nat.card s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
[Finite ↑s]
(f : α → β)


theorem weightedHomogeneousComponent_mem (w : σ → M) (φ : MvPolynomial σ R) (m : M) :
    weightedHomogeneousComponent w m φ ∈ weightedHomogeneousSubmodule R w m

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

(MvPolynomial.weightedHomogeneousComponent w m) φ ∈ MvPolynomial.weightedHomogeneousSubmodule R w m


@[to_additive]
theorem mul_comm : ∀ a b : G, a * b = b * a

{G : Type u_1}
[AddCommMagma G]
(a b : G)


@[to_additive]
lemma iCondIndepFun.indepFun_mul_mul (hf_indep : iCondIndepFun m' hm' (fun _ ↦ m) f μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    CondIndepFun m' hm' (f i * f j) (f k * f l) μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.iCondIndepFun m' hm' (fun x => m) f μ)

ProbabilityTheory.CondIndepFun m' hm' (f i * f j) (f k * f l) μ


theorem inv_le_one₀ (ha : a ≠ 0) : a⁻¹ ≤ 1 ↔ 1 ≤ a

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a : α}
(ha : a ≠ 0)

a⁻¹ ≤ 1 ↔ 1 ≤ a


protected theorem not_le_of_gt {n m : Nat} (h : n > m) : ¬ n ≤ m


@[simp] theorem preimage_Ico : e ⁻¹' Ico (e x) (e y) = Ico x y

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ↪o β)
(x y : α)

⇑e ⁻¹' Set.Ico (e x) (e y) = Set.Ico x y


/-- Compare with `Int.shiftRight_add`, which doesn't have the coercions `ℕ → ℤ`. -/
theorem shiftRight_add' : ∀ (m : ℤ) (n k : ℕ), m >>> (n + k : ℤ) = (m >>> (n : ℤ)) >>> (k : ℤ)


@[reassoc]
lemma fac' (i : E.I₀) :
    lift hP hE le F ≫ P.map (E.f i).op =
      F.ι ⟨_, E.f i, le _ (Sieve.ofArrows_mk _ _ _)⟩

{J : CategoryTheory.GrothendieckTopology C}

(hP : ∀ ⦃X : C⦄ (E : J.OneHypercover X), H E → Nonempty (CategoryTheory.Limits.IsLimit (E.multifork P)))

(F : CategoryTheory.Limits.Multifork (CategoryTheory.GrothendieckTopology.Cover.index ⟨S, ⋯⟩ P))

CategoryTheory.CategoryStruct.comp (CategoryTheory.GrothendieckTopology.OneHypercoverFamily.IsSheafIff.lift hP hE le F)
    (P.map (E.f i).op) =
  F.ι { Y := E.X i, f := E.f i, hf := ⋯ }


theorem IsClopen.compl (hs : IsClopen s) : IsClopen sᶜ

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : IsClopen s)


/-- The Taylor polynomial of order zero evaluates to `f x`. -/
@[simp]
theorem taylor_within_zero_eval (f : ℝ → E) (s : Set ℝ) (x₀ x : ℝ) :
    taylorWithinEval f 0 s x₀ x = f x₀

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(f : ℝ → E)
(s : Set ℝ)
(x₀ x : ℝ)


@[deprecated map_neg (since := "2024-06-20")]
protected theorem map_neg (x) : e (-x) = -e x

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


/-- Auxiliary simp lemma for the `coherence` tactic:
this move brackets to the left in order to expose a maximal prefix
built out of unitors and associators.
-/
@[nolint unusedArguments]
theorem assoc_liftHom₂ {f g h i : a ⟶ b} [LiftHom f] [LiftHom g] [LiftHom h]
    (η : f ⟶ g) (θ : g ⟶ h) (ι : h ⟶ i) [LiftHom₂ η] [LiftHom₂ θ] : η ≫ θ ≫ ι = (η ≫ θ) ≫ ι

η ≫ θ ≫ ι = (η ≫ θ) ≫ ι


theorem pderiv_monomial_single {i : σ} {n : ℕ} : pderiv i (monomial (single i n) a) =
    monomial (single i (n - 1)) (a * n)

{R : Type u}
{σ : Type v}
{a : R}
[CommSemiring R]
{i : σ}
{n : ℕ}

(MvPolynomial.pderiv i) ((MvPolynomial.monomial (Finsupp.single i n)) a) =
  (MvPolynomial.monomial (Finsupp.single i (n - 1))) (a * ↑n)


lemma le_piecewise_of_le_of_le (hf : h ≤ f) (hg : h ≤ g) : h ≤ s.piecewise f g

{ι : Type u_1}
(s : Finset ι)
[(j : ι) → Decidable (j ∈ s)]
{π : ι → Type u_3}
{f g h : (i : ι) → π i}
[(i : ι) → Preorder (π i)]
(hf : h ≤ f)
(hg : h ≤ g)


@[simp]
theorem thickening_closedBall (hε : 0 < ε) (hδ : 0 ≤ δ) (x : E) :
    thickening ε (closedBall x δ) = ball x (ε + δ)

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{δ ε : ℝ}
(hε : 0 < ε)
(hδ : 0 ≤ δ)
(x : E)

Metric.thickening ε (Metric.closedBall x δ) = Metric.ball x (ε + δ)


theorem lie_eq_smul (a : A) (m : M) : ⁅a, m⁆ = a • m

{A : Type v}
[Ring A]
{M : Type w}
[AddCommGroup M]
[Module A M]
(a : A)
(m : M)


theorem norm_def (A : Matrix m n α) : ‖A‖ = ‖fun i j => A i j‖

{m : Type u_3}
{n : Type u_4}
{α : Type u_5}
[Fintype m]
[Fintype n]
[SeminormedAddCommGroup α]
(A : Matrix m n α)


theorem isFixedPt_lfp : IsFixedPt f (lfp f)

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

Function.IsFixedPt (⇑f) (OrderHom.lfp f)


/--
(Implementation) Given the appropriate product and equalizer cones, build the cone for `F` which is
limiting if the given cones are also.
-/
@[simps]
def buildLimit
    (hs : ∀ f : Σp : J × J, p.1 ⟶ p.2, s ≫ c₂.π.app ⟨f⟩ = c₁.π.app ⟨f.1.1⟩ ≫ F.map f.2)
    (ht : ∀ f : Σp : J × J, p.1 ⟶ p.2, t ≫ c₂.π.app ⟨f⟩ = c₁.π.app ⟨f.1.2⟩)
    (i : Fork s t) : Cone F

{c₂ : CategoryTheory.Limits.Fan fun f => F.obj f.fst.2}

(hs : ∀ (f : (p : J × J) × (p.1 ⟶ p.2)), s ≫ c₂.π.app { as := f } = c₁.π.app { as := f.fst.1 } ≫ F.map f.snd)

(ht : ∀ (f : (p : J × J) × (p.1 ⟶ p.2)), t ≫ c₂.π.app { as := f } = c₁.π.app { as := f.fst.2 })

(CategoryTheory.Limits.HasLimitOfHasProductsOfHasEqualizers.buildLimit s t hs ht i).pt = i.pt


@[to_additive (attr := simp)]
theorem dist_self_mul_left (a b : E) : dist (a * b) a = ‖b‖

{E : Type u_3}
[SeminormedAddCommGroup E]
(a b : E)


@[simp]
theorem Subsequent.moveLeft {x : PGame} (i : x.LeftMoves) : Subsequent (x.moveLeft i) x


@[to_additive (attr := simp)]
theorem of_smul (f : α → β → β) (x : α) (y : β) :
    (haveI := mkMulAction f
    of x • y) = f x y

{α : Type u_1}
{β : Type u_2}
(f : α → β → β)
(x : α)
(y : β)


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


theorem comp_zsmul (n : ℤ) : f ≫ (n • g) = n • f ≫ g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{P Q R : C}
(f : P ⟶ Q)
(g : Q ⟶ R)
(n : ℤ)


protected theorem sInf_le {s : Set ℕ} {m : ℕ} (hm : m ∈ s) : sInf s ≤ m


/-- The frame homomorphism from a complete lattice `L` to the complete lattice of sets of
points of `L`. -/
@[simps]
def openOfElementHom : FrameHom L (Set (PT L))

(L : Type u_1)
[CompleteLattice L]
(u : L)

(Locale.openOfElementHom L) u = {x | x u}


@[to_additive]
theorem hasProd_prod_disjoint {ι} (s : Finset ι) {t : ι → Set β} {a : ι → α}
    (hs : (s : Set ι).Pairwise (Disjoint on t)) (hf : ∀ i ∈ s, HasProd (f ∘ (↑) : t i → α) (a i)) :
    HasProd (f ∘ (↑) : (⋃ i ∈ s, t i) → α) (∏ i ∈ s, a i)

(hf : ∀ i ∈ s, HasProd (f ∘ Subtype.val) (a i))

HasProd (f ∘ Subtype.val) (∏ i ∈ s, a i)


theorem Rel.addLeft (a : lib R X) {b c : lib R X} (h : Rel R X b c) : Rel R X (a + b) (a + c)

{R : Type u}
{X : Type v}
[CommRing R]
(a : lib R X)
{b c : lib R X}
(h : FreeLieAlgebra.Rel R X b c)


@[simp]
theorem _root_.Pi.exp_apply {ι : Type*} {𝔸 : ι → Type*} [Finite ι] [∀ i, NormedRing (𝔸 i)]
    [∀ i, NormedAlgebra 𝕂 (𝔸 i)] [∀ i, CompleteSpace (𝔸 i)] (x : ∀ i, 𝔸 i) (i : ι) :
    exp 𝕂 x i = exp 𝕂 (x i)

(𝕂 : Type u_1)
[RCLike 𝕂]
{ι : Type u_4}
{𝔸 : ι → Type u_5}
[Finite ι]
[(i : ι) → NormedRing (𝔸 i)]
[(i : ι) → NormedAlgebra 𝕂 (𝔸 i)]
[∀ (i : ι), CompleteSpace (𝔸 i)]
(x : (i : ι) → 𝔸 i)
(i : ι)

NormedSpace.exp 𝕂 x i = NormedSpace.exp 𝕂 (x i)


@[simp]
theorem quot_zero : Quot.mk Setoid.r zero = (0 : ColimitType F)

{J : Type v}
[CategoryTheory.SmallCategory J]
(F : J ⥤ CommRingCat)

Quot.mk Setoid.r CommRingCat.Colimits.Prequotient.zero = 0


@[norm_cast, simp]
theorem coe_comp (f : N →ₗ⁅R,L⁆ P) (g : M →ₗ⁅R,L⁆ N) : ⇑(f.comp g) = f ∘ g

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
{P : Type w₂}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
[LieRingModule L M]
[LieRingModule L N]
[LieRingModule L P]
(f : N →ₗ⁅R,L⁆ P)
(g : M →ₗ⁅R,L⁆ N)


@[simp]
theorem isLittleO_neg_left : (fun x => -f' x) =o[l] g ↔ f' =o[l] g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{g : α → F}
{f' : α → E'}
{l : Filter α}


@[simp]
theorem DifferentiableAt.div_const (hc : DifferentiableAt 𝕜 c x) (d : 𝕜') :
    DifferentiableAt 𝕜 (fun x => c x / d) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{c : 𝕜 → 𝕜'}
(hc : DifferentiableAt 𝕜 c x)
(d : 𝕜')


@[simp]
theorem linfty_opNNNorm_row (v : n → α) : ‖row ι v‖₊ = ∑ i, ‖v i‖₊

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


theorem mk_arrow_eq_zero_iff : #(α → β') = 0 ↔ #α ≠ 0 ∧ #β' = 0


/-- Predicate for an ordered topological space to be equipped with its Lawson topology.

The Lawson topology is defined as the meet of `Topology.lower` and the `Topology.scott`.
-/
class IsLawson : Prop where
  topology_eq_lawson : ‹TopologicalSpace α› = lawson α

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[self : Topology.IsLawson α]


theorem zoom_fill' (cut : α → Ordering) (t : RBNode α) (path : Path α) :
    fill' (zoom cut t path) = path.fill t

{α : Type u_1}
(cut : α → Ordering)
(t : Batteries.RBNode α)
(path : Batteries.RBNode.Path α)

Batteries.RBNode.Path.fill' (Batteries.RBNode.zoom cut t path) = path.fill t


/-- The preimage of a nilpotent group is nilpotent if the kernel of the homomorphism is contained
in the center -/
theorem isNilpotent_of_ker_le_center {H : Type*} [Group H] (f : G →* H) (hf1 : f.ker ≤ center G)
    (hH : IsNilpotent H) : IsNilpotent G

{G : Type u_1}
[Group G]
{H : Type u_2}
[Group H]
(f : G →* H)
(hf1 : f.ker ≤ Subgroup.center G)
(hH : Group.IsNilpotent H)


lemma zero [ClosedUnderIsomorphisms S.P] : S.P 0

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

(S : CategoryTheory.Triangulated.Subcategory C)


@[to_additive Summable.prod_factor]
theorem Multipliable.prod_factor {f : β × γ → α} (h : Multipliable f) (b : β) :
    Multipliable fun c ↦ f (b, c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
[CompleteSpace α]
{f : β × γ → α}
(h : Summable f)
(b : β)


@[simp, norm_cast]
theorem unop_coe (S : Subring Rᵐᵒᵖ) : S.unop = MulOpposite.op ⁻¹' (S : Set Rᵐᵒᵖ)

{R : Type u_2}
[Ring R]
(S : Subring Rᵐᵒᵖ)


theorem finiteDimensional (f : K[X]) [IsSplittingField K L f] : FiniteDimensional K L

{K : Type v}
(L : Type w)
[Field K]
[Field L]
[Algebra K L]
(f : K[X])
[Polynomial.IsSplittingField K L f]


theorem DimensionLEOne.not_lt_lt [Ring.DimensionLEOne R] (p₀ p₁ p₂ : Ideal R) [hp₁ : p₁.IsPrime]
    [hp₂ : p₂.IsPrime] : ¬(p₀ < p₁ ∧ p₁ < p₂)

{R : Type u_1}
[CommRing R]
[Ring.DimensionLEOne R]
(p₀ p₁ p₂ : Ideal R)
[hp₁ : p₁.IsPrime]
[hp₂ : p₂.IsPrime]


@[to_additive (attr := simp)]
lemma le_minOrder {n : ℕ∞} :
    n ≤ minOrder α ↔ ∀ ⦃a : α⦄, a ≠ 1 → IsOfFinOrder a → n ≤ orderOf a

n ≤ Monoid.minOrder α ↔ ∀ ⦃a : α⦄, a ≠ 1 → IsOfFinOrder a → n ≤ ↑(orderOf a)


lemma restrict_nondegenerate (I : LieIdeal K L) (hI : IsAtom I) :
    (Φ.restrict I).Nondegenerate

(hΦ_inv : LinearMap.BilinForm.lieInvariant L Φ)

(hL : ∀ (I : LieIdeal K L), IsAtom I → ¬IsLieAbelian ↥↑I)

(Φ.restrict (lieIdealSubalgebra K L I).toSubmodule).Nondegenerate


theorem nodup_iff_getElem?_ne_getElem? {l : List α} :
    l.Nodup ↔ ∀ i j : ℕ, i < j → j < l.length → l[i]? ≠ l[j]?

l.Nodup ↔ ∀ (i j : ℕ), i < j → j < l.length → l[i]? ≠ l[j]?


lemma finrank_of_isSplittingField_X_pow_sub_C : FiniteDimensional.finrank K L = n

(H : Irreducible (Polynomial.X ^ n - Polynomial.C a))

[Polynomial.IsSplittingField K L (Polynomial.X ^ n - Polynomial.C a)]


theorem image2_iUnion_right (s : Set α) (t : ι → Set β) :
    image2 f s (⋃ i, t i) = ⋃ i, image2 f s (t i)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{ι : Sort u_4}
(f : α → β → γ)
(s : Set α)
(t : ι → Set β)

Set.image2 f s (⋃ i, t i) = ⋃ i, Set.image2 f s (t i)


/-- **Jensen's inequality**, strict version: if an integrable function `f : α → E` takes values in a
convex closed set `s`, and `g : E → ℝ` is continuous and strictly convex on `s`, then
either `f` is a.e. equal to its average value, or `g (⨍ x, f x ∂μ) < ⨍ x, g (f x) ∂μ`. -/
theorem StrictConvexOn.ae_eq_const_or_map_average_lt [IsFiniteMeasure μ] (hg : StrictConvexOn ℝ s g)
    (hgc : ContinuousOn g s) (hsc : IsClosed s) (hfs : ∀ᵐ x ∂μ, f x ∈ s) (hfi : Integrable f μ)
    (hgi : Integrable (g ∘ f) μ) :
    f =ᵐ[μ] const α (⨍ x, f x ∂μ) ∨ g (⨍ x, f x ∂μ) < ⨍ x, g (f x) ∂μ

(hgi : MeasureTheory.Integrable (g ∘ f) μ)

f =ᵐ[μ] Function.const α (⨍ (x : α), f x ∂μ) ∨ g (⨍ (x : α), f x ∂μ) < ⨍ (x : α), g (f x) ∂μ


theorem cmp_refl [OrientedCmp cmp] : cmp x x = .eq

∀ {α : Sort u_1} {cmp : α → α → Ordering} {x : α} [inst : Batteries.OrientedCmp cmp], cmp x x = Ordering.eq


@[simp]
theorem inner_self_ofReal_re (x : E) : (re ⟪x, x⟫ : 𝕜) = ⟪x, x⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x : E)


/-- In a (possibly non-Hausdorff) locally compact regular space, for every containment `K ⊆ U` of
  a compact set `K` in an open set `U`, there is a compact closed neighborhood `L`
  such that `K ⊆ L ⊆ U`: equivalently, there is a compact closed set `L` such
  that `K ⊆ interior L` and `L ⊆ U`. -/
theorem exists_compact_closed_between [LocallyCompactSpace X] [RegularSpace X]
    {K U : Set X} (hK : IsCompact K) (hU : IsOpen U) (h_KU : K ⊆ U) :
    ∃ L, IsCompact L ∧ IsClosed L ∧ K ⊆ interior L ∧ L ⊆ U

{X : Type u_1}
[TopologicalSpace X]
[LocallyCompactSpace X]
[RegularSpace X]
{K U : Set X}
(hK : IsCompact K)
(hU : IsOpen U)
(h_KU : K ⊆ U)


private lemma ofTensorProductInvOfPiFintype_comp_ofTensorProduct :
    ofTensorProductInvOfPiFintype I ι ∘ₗ ofTensorProduct I (ι → R) = LinearMap.id

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(ι : Type u_4)
[Fintype ι]
[DecidableEq ι]

↑(AdicCompletion.ofTensorProductInvOfPiFintype I ι) ∘ₗ AdicCompletion.ofTensorProduct I (ι → R) = LinearMap.id


theorem IsTotal.directed [IsTotal α r] (f : ι → α) : Directed r f

{α : Type u}
{ι : Sort w}
{r : α → α → Prop}
[IsTotal α r]
(f : ι → α)


theorem bernoulli_def (n : ℕ) : bernoulli n =
    ∑ i ∈ range (n + 1), Polynomial.monomial i (_root_.bernoulli (n - i) * choose n i)

Polynomial.bernoulli n = ∑ i ∈ Finset.range (n + 1), (Polynomial.monomial i) (bernoulli (n - i) * ↑(n.choose i))


lemma pow_dvd_sub_pow_of_pow_eq_zero_left (hp : n + m ≤ p + 1) (h_comm : Commute x y)
    (hx : x ^ n = 0) : y ^ m ∣ (x - y) ^ p

{R : Type u_1}
{x y : R}
{n m p : ℕ}
[Ring R]
(hp : n + m ≤ p + 1)
(h_comm : Commute x y)
(hx : x ^ n = 0)


/-- A version of the **Arzela-Ascoli theorem**.

Let `X` be a topological space, `𝔖` a family of compact subsets of `X`, `α` a uniform space,
and `F : ι → (X → α)`. Assume that:
* `F`, viewed as a function `ι → (X →ᵤ[𝔖] α)`, is closed and inducing
* `F` is equicontinuous on each `K ∈ 𝔖`
* For all `x ∈ ⋃₀ 𝔖`, the range of `i ↦ F i x` is contained in some fixed compact subset.

Then `ι` is compact. -/
theorem ArzelaAscoli.compactSpace_of_closed_inducing' [TopologicalSpace ι] {𝔖 : Set (Set X)}
    (𝔖_compact : ∀ K ∈ 𝔖, IsCompact K) (F_ind : Inducing (UniformOnFun.ofFun 𝔖 ∘ F))
    (F_cl : IsClosed <| range <| UniformOnFun.ofFun 𝔖 ∘ F)
    (F_eqcont : ∀ K ∈ 𝔖, EquicontinuousOn F K)
    (F_pointwiseCompact : ∀ K ∈ 𝔖, ∀ x ∈ K, ∃ Q, IsCompact Q ∧ ∀ i, F i x ∈ Q) :
    CompactSpace ι

(F_ind : Inducing (⇑(UniformOnFun.ofFun 𝔖) ∘ F))

(F_cl : IsClosed (Set.range (⇑(UniformOnFun.ofFun 𝔖) ∘ F)))

(F_pointwiseCompact : ∀ K ∈ 𝔖, ∀ x ∈ K, ∃ Q, IsCompact Q ∧ ∀ (i : ι), F i x ∈ Q)


theorem comp_surjective {f : A →ₐ[R] B} {g : B →ₐ[R] C} (hf : f.FinitePresentation)
    (hg : Surjective g) (hker : g.toRingHom.ker.FG) : (g.comp f).FinitePresentation

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommRing R]
[CommRing A]
[CommRing B]
[CommRing C]
[Algebra R A]
[Algebra R B]
[Algebra R C]
{f : A →ₐ[R] B}
{g : B →ₐ[R] C}
(hf : f.FinitePresentation)
(hg : Function.Surjective ⇑g)
(hker : (RingHom.ker g.toRingHom).FG)


theorem OrderTop.tendsto_atTop_nhds [PartialOrder α] [OrderTop α] (f : α → X) :
    Tendsto f atTop (𝓝 (f ⊤))

{X : Type u}
{α : Type u_1}
[TopologicalSpace X]
[PartialOrder α]
[OrderTop α]
(f : α → X)


@[simp] lemma map_add_right_Ioo (a b c : α) :
    (Ioo a b).map (addRightEmbedding c) = Ioo (a + c) (b + c)

{α : Type u_2}
[OrderedCancelAddCommMonoid α]
[ExistsAddOfLE α]
[LocallyFiniteOrder α]
(a b c : α)

Finset.map (addRightEmbedding c) (Finset.Ioo a b) = Finset.Ioo (a + c) (b + c)


theorem comp_right_fderiv {f : F → G} {x : E} :
    fderiv 𝕜 (f ∘ iso) x = (fderiv 𝕜 f (iso x)).comp (iso : E →L[𝕜] F)

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

fderiv 𝕜 (f ∘ ⇑iso) x = (fderiv 𝕜 f (iso x)).comp ↑iso


lemma eventually_r_ge (C : ℝ) : ∀ᶠ (n : ℕ) in atTop, ∀ i, C ≤ r i n

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

∀ᶠ (n : ℕ) in Filter.atTop, ∀ (i : α), C ≤ ↑(r i n)


@[simp]
theorem bot_quotient_isMaximal_iff (I : Ideal R) : (⊥ : Ideal (R ⧸ I)).IsMaximal ↔ I.IsMaximal


@[simp]
theorem refl_symm : (StarAlgEquiv.refl : A ≃⋆ₐ[R] A).symm = StarAlgEquiv.refl

{R : Type u_2}
{A : Type u_3}
[Add A]
[Mul A]
[SMul R A]
[Star A]


protected theorem inv_neg (q : ℚ) : (-q)⁻¹ = -q⁻¹


theorem pow_dvd_of_le_of_pow_dvd {p m n k : Nat} (hmn : m ≤ n) (hdiv : p ^ n ∣ k) : p ^ m ∣ k


theorem max_def_lt (x y : α) : max x y = if x < y then y else x

{α : Type u_2}
[LinearOrder α]
(x y : α)


protected theorem HasStrictFDerivAt.hasStrictDerivAt {f' : 𝕜 →L[𝕜] F} :
    HasStrictFDerivAt f f' x → HasStrictDerivAt f (f' 1) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{f' : 𝕜 →L[𝕜] F}


@[simp]
theorem symm_symm (h : α ≃ᵢ β) : h.symm.symm = h

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(h : α ≃ᵢ β)


theorem HasDerivAtFilter.const_sub (c : F) (hf : HasDerivAtFilter f f' x L) :
    HasDerivAtFilter (fun x => c - f x) (-f') x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{L : Filter 𝕜}
(c : F)
(hf : HasDerivAtFilter f f' x L)


lemma quasiIso_iff_isIso_homologyMap' (φ : S₁ ⟶ S₂)
    (h₁ : S₁.HomologyData) (h₂ : S₂.HomologyData) :
    QuasiIso φ ↔ IsIso (homologyMap' φ h₁ h₂)

CategoryTheory.ShortComplex.QuasiIso φ ↔ CategoryTheory.IsIso (CategoryTheory.ShortComplex.homologyMap' φ h₁ h₂)


theorem Ico_filter_le_of_left_le [DecidablePred (c ≤ ·)] (hac : a ≤ c) :
    ((Ico a b).filter fun x => c ≤ x) = Ico c b

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b c : α}
[DecidablePred fun x => c ≤ x]
(hac : a ≤ c)

Multiset.filter (fun x => c ≤ x) (Multiset.Ico a b) = Multiset.Ico c b


@[to_additive]
theorem measurePreserving_div_right (μ : Measure G) [IsMulRightInvariant μ] (g : G) :
    MeasurePreserving (· / g) μ μ

{G : Type u_2}
[MeasurableSpace G]
[Group G]
[MeasurableMul G]
(μ : MeasureTheory.Measure G)
[μ.IsMulRightInvariant]
(g : G)

MeasureTheory.MeasurePreserving (fun x => x / g) μ μ


/-- The braiding isomorphism is symmetric. -/
@[reassoc]
theorem biprod.symmetry (P Q : C) :
    (biprod.braiding P Q).hom ≫ (biprod.braiding Q P).hom = 𝟙 _

(CategoryTheory.Limits.biprod.braiding P Q).hom ≫ (CategoryTheory.Limits.biprod.braiding Q P).hom = 𝟙 (P ⊞ Q)


theorem isPreconnected_of_isPreconnected_op [IsPreconnected Jᵒᵖ] : IsPreconnected J

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
[CategoryTheory.IsPreconnected Jᵒᵖ]


@[reassoc (attr := simp)]
lemma ιTensorObj₃_associator_inv
    [HasGoodTensor₁₂Tensor X₁ X₂ X₃] [HasGoodTensorTensor₂₃ X₁ X₂ X₃]
    (i₁ i₂ i₃ j : I) (h : i₁ + i₂ + i₃ = j) :
    ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h ≫ (associator X₁ X₂ X₃).inv j =
      (α_ _ _ _).inv ≫ ιTensorObj₃' X₁ X₂ X₃ i₁ i₂ i₃ j h

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

[(CategoryTheory.GradedObject.Monoidal.tensorObj X₁ X₂).HasTensor X₃]

[X₁.HasTensor (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃)]

CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h)
    ((CategoryTheory.GradedObject.Monoidal.associator X₁ X₂ X₃).inv j) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator (X₁ i₁) (X₂ i₂) (X₃ i₃)).inv
    (CategoryTheory.GradedObject.Monoidal.ιTensorObj₃' X₁ X₂ X₃ i₁ i₂ i₃ j h)


@[simp]
theorem mem_powersetCardAux {n} {l : List α} {s} : s ∈ powersetCardAux n l ↔ s ≤ ↑l ∧ card s = n

{α : Type u_1}
{n : ℕ}
{l : List α}
{s : Multiset α}

s ∈ Multiset.powersetCardAux n l ↔ s ≤ ↑l ∧ Multiset.card s = n


/-- As `x → 0`, `f x` decays faster than any power of `x`. -/
lemma hf_zero' (r : ℝ) : P.f =O[𝓝[>] 0] (· ^ r)

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


@[to_additive (attr := simp)]
theorem coe_top : ((⊤ : Submonoid M) : Set M) = Set.univ


lemma shiftFunctorAdd'_inv_app_f' (K : CochainComplex C ℤ) (a b ab : ℤ) (h : a + b = ab) (n : ℤ) :
    ((CategoryTheory.shiftFunctorAdd' (CochainComplex C ℤ) a b ab h).inv.app K).f n =
      (K.XIsoOfEq (by dsimp; rw [← h, add_assoc, add_comm a])).hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(K : CochainComplex C ℤ)
(a b ab : ℤ)
(h : a + b = ab)
(n : ℤ)

((CategoryTheory.shiftFunctorAdd' (CochainComplex C ℤ) a b ab h).inv.app K).f n = (HomologicalComplex.XIsoOfEq K ⋯).hom


@[to_additive]
theorem finprod_curry₃ {γ : Type*} (f : α × β × γ → M) (h : (mulSupport f).Finite) :
    ∏ᶠ abc, f abc = ∏ᶠ (a) (b) (c), f (a, b, c)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[CommMonoid M]
{γ : Type u_7}
(f : α × β × γ → M)
(h : (Function.mulSupport f).Finite)

∏ᶠ (abc : α × β × γ), f abc = ∏ᶠ (a : α) (b : β) (c : γ), f (a, b, c)


@[simp]
theorem uncurry_curry (f : A ⨯ X ⟶ Y) : uncurry (curry f) = f

CategoryTheory.CartesianClosed.uncurry (CategoryTheory.CartesianClosed.curry f) = f


theorem convexOn_of_convex_epigraph (h : Convex 𝕜 { p : E × β | p.1 ∈ s ∧ f p.1 ≤ p.2 }) :
    ConvexOn 𝕜 s f

(h : Convex 𝕜 {p | p.1 ∈ s ∧ f p.1 ≤ p.2})


/-- **Henstock-Sacks inequality**. Let `r : ℝⁿ → (0, ∞)` be a function such that for any tagged
*partition* of `I` subordinate to `r`, the integral sum of `f` over this partition differs from the
integral of `f` by at most `ε`. Then for any tagged *prepartition* `π` subordinate to `r`, the
integral sum of `f` over this prepartition differs from the integral of `f` over the part of `I`
covered by `π` by at most `ε`.

The actual statement

- uses `BoxIntegral.Integrable.convergenceR` instead of a predicate assumption on `r`;
- uses `BoxIntegral.IntegrationParams.MemBaseSet` instead of “subordinate to `r`” to
  account for additional requirements like being a Henstock partition or having a bounded
  distortion;
- takes an extra argument `π₀ : prepartition I` and an assumption `π.Union = π₀.Union` instead of
  using `π.to_prepartition`.
-/
theorem dist_integralSum_sum_integral_le_of_memBaseSet_of_iUnion_eq (h : Integrable I l f vol)
    (h0 : 0 < ε) (hπ : l.MemBaseSet I c (h.convergenceR ε c) π) {π₀ : Prepartition I}
    (hU : π.iUnion = π₀.iUnion) :
    dist (integralSum f vol π) (∑ J ∈ π₀.boxes, integral J l f vol) ≤ ε

dist (BoxIntegral.integralSum f vol π) (∑ J ∈ π₀.boxes, BoxIntegral.integral J l f vol) ≤ ε


theorem map_eq_cons' {f : α → β} {l : List α} :
    map f l = b :: l₂ ↔ ∃ a l₁, l = a :: l₁ ∧ f a = b ∧ map f l₁ = l₂

{α : Type u_1}
{β : Type u_2}
{b : β}
{l₂ : List β}
{f : α → β}
{l : List α}

List.map f l = b :: l₂ ↔ ∃ a l₁, l = a :: l₁ ∧ f a = b ∧ List.map f l₁ = l₂


/-- The sum of ordinals as games corresponds to natural addition of ordinals. -/
theorem toPGame_add : ∀ a b : Ordinal.{u}, a.toPGame + b.toPGame ≈ (a ♯ b).toPGame


theorem foldl_eq_foldl_list (f : α → Fin n → α) (x) : foldl n f x = (list n).foldl f x

{α : Type u_1}
{n : Nat}
(f : α → Fin n → α)
(x : α)

Fin.foldl n f x = List.foldl f x (Fin.list n)


/-- Consider a function `f : α × β → γ`. Suppose that it is continuous on each “vertical fiber”
`{a} × t`, `a ∈ s`, and is Lipschitz continuous on each “horizontal fiber” `s × {b}`, `b ∈ t`
with the same Lipschitz constant `K`. Then it is continuous on `s × t`. Moreover, it suffices
to require continuity on vertical fibers for `a` from a subset `s' ⊆ s` that is dense in `s`.

The actual statement uses (Lipschitz) continuity of `fun y ↦ f (a, y)` and `fun x ↦ f (x, b)`
instead of continuity of `f` on subsets of the product space. -/
theorem continuousOn_prod_of_subset_closure_continuousOn_lipschitzOnWith [PseudoEMetricSpace α]
    [TopologicalSpace β] [PseudoEMetricSpace γ] (f : α × β → γ) {s s' : Set α} {t : Set β}
    (hs' : s' ⊆ s) (hss' : s ⊆ closure s') (K : ℝ≥0)
    (ha : ∀ a ∈ s', ContinuousOn (fun y => f (a, y)) t)
    (hb : ∀ b ∈ t, LipschitzOnWith K (fun x => f (x, b)) s) : ContinuousOn f (s ×ˢ t)

(f : α × β → γ)


/-- To construct a groupoid, one may consider classes of partial homeomorphisms such that
both the function and its inverse have some property. If this property is stable under composition,
one gets a groupoid. `Pregroupoid` bundles the properties needed for this construction, with the
groupoid of smooth functions with smooth inverses as an application. -/
structure Pregroupoid (H : Type*) [TopologicalSpace H] where
  /-- Property describing membership in this groupoid: the pregroupoid "contains"
    all functions `H → H` having the pregroupoid property on some `s : Set H` -/
  property : (H → H) → Set H → Prop
  /-- The pregroupoid property is stable under composition -/
  comp : ∀ {f g u v}, property f u → property g v →
    IsOpen u → IsOpen v → IsOpen (u ∩ f ⁻¹' v) → property (g ∘ f) (u ∩ f ⁻¹' v)
  /-- Pregroupoids contain the identity map (on `univ`) -/
  id_mem : property id univ
  /-- The pregroupoid property is "local", in the sense that `f` has the pregroupoid property on `u`
  iff its restriction to each open subset of `u` has it -/
  locality :
    ∀ {f u}, IsOpen u → (∀ x ∈ u, ∃ v, IsOpen v ∧ x ∈ v ∧ property f (u ∩ v)) → property f u
  /-- If `f = g` on `u` and `property f u`, then `property g u` -/
  congr : ∀ {f g : H → H} {u}, IsOpen u → (∀ x ∈ u, g x = f x) → property f u → property g u

{H : Type u_5}
[TopologicalSpace H]
(self : Pregroupoid H)
{f g : H → H}
{u v : Set H}

self.property f u → self.property g v → IsOpen u → IsOpen v → IsOpen (u ∩ f ⁻¹' v) → self.property (g ∘ f) (u ∩ f ⁻¹' v)


@[to_additive] lemma mabs_le_mabs_of_one_le (ha : 1 ≤ a) (hab : a ≤ b) : |a|ₘ ≤ |b|ₘ

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


theorem nodup_iff_injective_getElem {l : List α} :
    Nodup l ↔ Function.Injective (fun i : Fin l.length => l[i.1])

l.Nodup ↔ Function.Injective fun i => l[↑i]


@[simp]
theorem countP_True {s : Multiset α} : countP (fun _ => True) s = card s

Multiset.countP (fun x => True) s = Multiset.card s


lemma ofReal_lt_ofReal_iff' {p q : ℝ} : ENNReal.ofReal p < .ofReal q ↔ p < q ∧ 0 < q

ENNReal.ofReal p < ENNReal.ofReal q ↔ p < q ∧ 0 < q


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

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


/-- `Matrix.toLin'` is a particular case of `Matrix.toLin`, for the standard basis
`Pi.basisFun R n`. -/
theorem Matrix.toLin_eq_toLin' : Matrix.toLin (Pi.basisFun R n) (Pi.basisFun R m) = Matrix.toLin'

{R : Type u_1}
[CommSemiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype n]
[Finite m]
[DecidableEq n]


/-- An isomorphism between `I`-indexed objects gives an isomorphism between each
pair of corresponding components. -/
@[simps]
def isoApp {X Y : ∀ i, C i} (f : X ≅ Y) (i : I) : X i ≅ Y i

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

(CategoryTheory.Pi.isoApp f i).hom = f.hom i


theorem Injective.image_injective (hf : Injective f) : Injective (image f)

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


theorem sup_himp_right (hs : s.Nonempty) (f : ι → α) (a : α) :
    (s.sup fun b => f b ⇨ a) = s.inf f ⇨ a

{α : Type u_2}
{ι : Type u_5}
[BooleanAlgebra α]
{s : Finset ι}
(hs : s.Nonempty)
(f : ι → α)
(a : α)


theorem gauge_neg_set_neg (x : E) : gauge (-s) (-x) = gauge s x

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
(x : E)


@[to_additive]
theorem relindex_dvd_of_le_left (hHK : H ≤ K) : K.relindex L ∣ H.relindex L

{G : Type u_1}
[AddGroup G]
{H K : AddSubgroup G}
(L : AddSubgroup G)
(hHK : H ≤ K)


/-- The functor `Comma L R ⥤ Comma L' R'` induced by three functors `F₁`, `F₂`, `F`
and two natural transformations `F₁ ⋙ L' ⟶ L ⋙ F` and `R ⋙ F ⟶ F₂ ⋙ R'`. -/
@[simps]
def map : Comma L R ⥤ Comma L' R'

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{A' : Type u_1}
{B' : Type u_2}
{T' : Type u_3}
[CategoryTheory.Category.{u_4, u_1} A']
[CategoryTheory.Category.{u_5, u_2} B']
[CategoryTheory.Category.{u_6, u_3} T']
{L : CategoryTheory.Functor A T}
{R : CategoryTheory.Functor B T}
{L' : CategoryTheory.Functor A' T'}
{R' : CategoryTheory.Functor B' T'}
{F₁ : CategoryTheory.Functor A A'}
{F₂ : CategoryTheory.Functor B B'}
{F : CategoryTheory.Functor T T'}
(α : F₁.comp L' ⟶ L.comp F)
(β : R.comp F ⟶ F₂.comp R')
(X : CategoryTheory.Comma L R)

((CategoryTheory.Comma.map α β).obj X).left = F₁.obj X.left


@[to_additive]
theorem isZero_of_subsingleton (G : Grp) [Subsingleton G] : IsZero G


@[simp] theorem get?_cons_succ : @get? α (a::l) (n+1) = get? l n

{α : Type u}
{a : α}
{l : List α}
{n : Nat}


theorem IsEquivalent.tendsto_nhds {c : β} (huv : u ~[l] v) (hu : Tendsto u l (𝓝 c)) :
    Tendsto v l (𝓝 c)

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u v : α → β}
{l : Filter α}
{c : β}
(huv : u ~[l] v)
(hu : Filter.Tendsto u l (nhds c))


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

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


/-- Negating the second vector passed to `oangle` negates the sign of the angle. -/
@[simp]
theorem oangle_sign_neg_right (x y : V) : (o.oangle x (-y)).sign = -(o.oangle x y).sign

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


theorem exists_measurableSet_of_ne [MeasurableSpace α] [SeparatesPoints α] {x y : α}
    (h : x ≠ y) : ∃ s, MeasurableSet s ∧ x ∈ s ∧ y ∉ s

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSpace.SeparatesPoints α]
{x y : α}
(h : x ≠ y)


@[simp]
theorem card_ofNat (n : ℕ) [n.AtLeastTwo] :
    card.{u} (no_index (OfNat.ofNat n)) = OfNat.ofNat n


@[simp]
theorem cmp_self_eq_eq : cmp x x = Ordering.eq


@[to_additive sum_div_divisors]
theorem prod_div_divisors {α : Type*} [CommMonoid α] (n : ℕ) (f : ℕ → α) :
    (∏ d ∈ n.divisors, f (n / d)) = n.divisors.prod f

{α : Type u_1}
[AddCommMonoid α]
(n : ℕ)
(f : ℕ → α)

∑ d ∈ n.divisors, f (n / d) = n.divisors.sum f


theorem exists_seq_strictMono_tendsto_nhdsWithin [DenselyOrdered α] [NoMinOrder α]
    [FirstCountableTopology α] (x : α) :
    ∃ u : ℕ → α, StrictMono u ∧ (∀ n, u n < x) ∧ Tendsto u atTop (𝓝[<] x)

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMinOrder α]
[FirstCountableTopology α]
(x : α)

∃ u, StrictMono u ∧ (∀ (n : ℕ), u n < x) ∧ Filter.Tendsto u Filter.atTop (𝓝[<] x)


theorem isUnit_to_basicOpen_self (f : R) : IsUnit (toOpen R (PrimeSpectrum.basicOpen f) f)

IsUnit ((AlgebraicGeometry.StructureSheaf.toOpen R (PrimeSpectrum.basicOpen f)) f)


/-- A version of `Set.mem_finset_prod` with a simpler RHS for products over a Fintype. -/
@[to_additive " A version of `Set.mem_finset_sum` with a simpler RHS for sums over a Fintype. "]
theorem mem_fintype_prod [Fintype ι] (f : ι → Set α) (a : α) :
    (a ∈ ∏ i, f i) ↔ ∃ (g : ι → α) (_ : ∀ i, g i ∈ f i), ∏ i, g i = a

{ι : Type u_1}
{α : Type u_2}
[CommMonoid α]
[Fintype ι]
(f : ι → Set α)
(a : α)

a ∈ ∏ i : ι, f i ↔ ∃ g, ∃ (_ : ∀ (i : ι), g i ∈ f i), ∏ i : ι, g i = a


theorem comp_of_isOpenImmersion [IsOpenImmersion f] (H : P g) :
    P (f ≫ g)

(P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme)

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


@[simp] theorem derivative_X : d⁄dX R (X : R⟦X⟧) = 1

(PowerSeries.derivative R) PowerSeries.X = 1


@[to_additive]
theorem orderOf_snd_dvd_orderOf : orderOf x.2 ∣ orderOf x

{α : Type u_4}
{β : Type u_5}
[Monoid α]
[Monoid β]
{x : α × β}


theorem arcsin_of_le_neg_one {x : ℝ} (hx : x ≤ -1) : arcsin x = -(π / 2)


theorem setAverage_sub_setAverage (hs : μ s ≠ ∞) (f : α → E) :
    ∫ x in s, f x - ⨍ a in s, f a ∂μ ∂μ = 0

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : μ s ≠ ⊤)
(f : α → E)

∫ (x : α) in s, f x - ⨍ (a : α) in s, f a ∂μ ∂μ = 0


theorem uniformEmbedding_coe [T0Space α] : UniformEmbedding ((↑) : α → Completion α)

(α : Type u_1)
[UniformSpace α]
[T0Space α]


/-- The value of a martingale `f` at a stopping time `τ` bounded by `n` is the conditional
expectation of `f n` with respect to the σ-algebra generated by `τ`. -/
theorem stoppedValue_ae_eq_condexp_of_le_const [Countable ι] (h : Martingale f ℱ μ)
    (hτ : IsStoppingTime ℱ τ) (hτ_le : ∀ x, τ x ≤ n)
    [SigmaFinite (μ.trim (hτ.measurableSpace_le_of_le hτ_le))] :
    stoppedValue f τ =ᵐ[μ] μ[f n|hτ.measurableSpace]

MeasureTheory.stoppedValue f τ =ᵐ[μ] μ[f n|hτ.measurableSpace]


lemma shiftIso_add_hom_app (n m a a' a'' : A) (ha' : n + a = a') (ha'' : m + a' = a'') (X : C) :
    (F.shiftIso (m + n) a a'' (by rw [add_assoc, ha', ha''])).hom.app X =
      (shiftFunctorAdd D m n).hom.app ((F.functor a'').obj X) ≫
        ((F.shiftIso m a' a'' ha'').hom.app X)⟦n⟧' ≫
        (F.shiftIso n a a' ha').hom.app X

(F : CategoryTheory.SingleFunctors C D A)

(F.shiftIso (m + n) a a'' ⋯).hom.app X =
  (CategoryTheory.shiftFunctorAdd D m n).hom.app ((F.functor a'').obj X) ≫
    (CategoryTheory.shiftFunctor D n).map ((F.shiftIso m a' a'' ha'').hom.app X) ≫ (F.shiftIso n a a' ha').hom.app X


theorem normalClosure_mono {s t : Set G} (h : s ⊆ t) : normalClosure s ≤ normalClosure t

{G : Type u_1}
[Group G]
{s t : Set G}
(h : s ⊆ t)

Subgroup.normalClosure s ≤ Subgroup.normalClosure t


theorem Ideal.exists_comap_eq_of_mem_minimalPrimes_of_injective {f : R →+* S}
    (hf : Function.Injective f) (p) (H : p ∈ minimalPrimes R) :
    ∃ p' : Ideal S, p'.IsPrime ∧ p'.comap f = p

{R : Type u_1}
{S : Type u_2}
[CommSemiring R]
[CommSemiring S]
{f : R →+* S}
(hf : Function.Injective ⇑f)
(p : Ideal R)
(H : p ∈ minimalPrimes R)


@[simp]
theorem smul_hom {X Y : Action V G} (r : R) (f : X ⟶ Y) : (r • f).hom = r • f.hom

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
[CategoryTheory.Preadditive V]
{R : Type u_1}
[Semiring R]
[CategoryTheory.Linear R V]
{X Y : Action V G}
(r : R)
(f : X ⟶ Y)


@[to_additive]
theorem mul_inf_assoc (A B C : Subgroup G) (h : A ≤ C) :
    (A : Set G) * ↑(B ⊓ C) = (A : Set G) * (B : Set G) ∩ C

{G : Type u_2}
[AddGroup G]
(A B C : AddSubgroup G)
(h : A ≤ C)


theorem ExceptT.goto_mkLabel {α β ε : Type _} (x : Label (Except.{u, u} ε α) m β) (i : α) :
    goto (ExceptT.mkLabel x) i = ExceptT.mk (Except.ok <$> goto x (Except.ok i))

{m : Type u → Type v}
[Monad m]
{α β ε : Type u}
(x : ContT.Label (Except ε α) m β)
(i : α)

ContT.goto (ExceptT.mkLabel x) i = ExceptT.mk (Except.ok <$> ContT.goto x (Except.ok i))


theorem ConcaveOn.left_lt_of_lt_right' (hf : ConcaveOn 𝕜 s f) {x y : E} (hx : x ∈ s) (hy : y ∈ s)
    {a b : 𝕜} (ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) (hfy : f (a • x + b • y) < f y) :
    f x < f (a • x + b • y)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedCancelAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)
{x y : E}
(hx : x ∈ s)
(hy : y ∈ s)
{a b : 𝕜}
(ha : 0 < a)
(hb : 0 < b)
(hab : a + b = 1)
(hfy : f (a • x + b • y) < f y)


@[to_additive (attr := simp) nsmul_sub]
lemma div_pow (a b : α) (n : ℕ) : (a / b) ^ n = a ^ n / b ^ n

{α : Type u_1}
[DivisionCommMonoid α]
(a b : α)
(n : ℕ)


theorem csInf_image2_eq_csInf_csSup (h₁ : ∀ b, GaloisConnection (l₁ b) (swap u b))
    (h₂ : ∀ a, GaloisConnection (toDual ∘ l₂ a) (u a ∘ ofDual)) :
    s.Nonempty → BddBelow s → t.Nonempty → BddAbove t → sInf (image2 u s t) = u (sInf s) (sSup t)

{u : α → β → γ}

{l₁ : β → γ → α}

{l₂ : α → γ → β}

(h₁ : ∀ (b : β), GaloisConnection (l₁ b) (Function.swap u b))

(h₂ : ∀ (a : α), GaloisConnection (⇑OrderDual.toDual ∘ l₂ a) (u a ∘ ⇑OrderDual.ofDual))

s.Nonempty → BddBelow s → t.Nonempty → BddAbove t → sInf (Set.image2 u s t) = u (sInf s) (sSup t)


@[to_additive (attr := simp)]
theorem image_inv : Inv.inv '' s = s⁻¹

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


@[continuity, fun_prop]
theorem Continuous.restrict {f : X → Y} {s : Set X} {t : Set Y} (h1 : MapsTo f s t)
    (h2 : Continuous f) : Continuous (h1.restrict f s t)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{s : Set X}
{t : Set Y}
(h1 : Set.MapsTo f s t)
(h2 : Continuous f)

Continuous (Set.MapsTo.restrict f s t h1)


/-- The intersection of a closed set and a Lindelöf set is a Lindelöf set. -/
theorem IsLindelof.inter_left (ht : IsLindelof t) (hs : IsClosed s) : IsLindelof (s ∩ t)

{X : Type u}
[TopologicalSpace X]
{s t : Set X}
(ht : IsLindelof t)
(hs : IsClosed s)


/-- An oplax functor `F` between bicategories `B` and `C` consists of a function between objects
`F.obj`, a function between 1-morphisms `F.map`, and a function between 2-morphisms `F.map₂`.

Unlike functors between categories, `F.map` do not need to strictly commute with the composition,
and do not need to strictly preserve the identity. Instead, there are specified 2-morphisms
`F.map (𝟙 a) ⟶ 𝟙 (F.obj a)` and `F.map (f ≫ g) ⟶ F.map f ≫ F.map g`.

`F.map₂` strictly commute with compositions and preserve the identity. They also preserve the
associator, the left unitor, and the right unitor modulo some adjustments of domains and codomains
of 2-morphisms.
-/
structure OplaxFunctor (B : Type u₁) [Bicategory.{w₁, v₁} B] (C : Type u₂)
  [Bicategory.{w₂, v₂} C] extends PrelaxFunctor B C where
  mapId (a : B) : map (𝟙 a) ⟶ 𝟙 (obj a)
  mapComp {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : map (f ≫ g) ⟶ map f ≫ map g
  mapComp_naturality_left :
    ∀ {a b c : B} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c),
      map₂ (η ▷ g) ≫ mapComp f' g = mapComp f g ≫ map₂ η ▷ map g := by
    aesop_cat
  mapComp_naturality_right :
    ∀ {a b c : B} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g'),
      map₂ (f ◁ η) ≫ mapComp f g' = mapComp f g ≫ map f ◁ map₂ η := by
    aesop_cat
  -- Porting note: `map₂_associator_aux` was used here in lean 3, but this was a hack
  -- to avoid a timeout; we revert this hack here (because it was causing other problems
  -- and was not necessary in lean 4)
  map₂_associator :
    ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d),
      map₂ (α_ f g h).hom ≫ mapComp f (g ≫ h) ≫ map f ◁ mapComp g h =
    mapComp (f ≫ g) h ≫ mapComp f g ▷ map h ≫ (α_ (map f) (map g) (map h)).hom := by
    aesop_cat
  map₂_leftUnitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (λ_ f).hom = mapComp (𝟙 a) f ≫ mapId a ▷ map f ≫ (λ_ (map f)).hom := by
    aesop_cat
  map₂_rightUnitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (ρ_ f).hom = mapComp f (𝟙 b) ≫ map f ◁ mapId b ≫ (ρ_ (map f)).hom := by
    aesop_cat

(self : CategoryTheory.OplaxFunctor B C)

CategoryTheory.CategoryStruct.comp (self.map₂ (CategoryTheory.Bicategory.whiskerLeft f η)) (self.mapComp f g') =
  CategoryTheory.CategoryStruct.comp (self.mapComp f g)
    (CategoryTheory.Bicategory.whiskerLeft (self.map f) (self.map₂ η))


protected theorem add_max_add_left (a b c : Nat) : max (a + b) (a + c) = a + max b c


@[simp]
theorem eval_sub (p q : R[X]) (x : R) : (p - q).eval x = p.eval x - q.eval x

{R : Type u}
[Ring R]
(p q : R[X])
(x : R)

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


theorem isGLB_iff_isLeast [LinearOrder α] (i : α) (s : Finset α) (hs : s.Nonempty) :
    IsGLB (s : Set α) i ↔ IsLeast (↑s) i

{α : Type u_2}
[LinearOrder α]
(i : α)
(s : Finset α)
(hs : s.Nonempty)


@[simp]
theorem realize_subst {t : L.Term α} {tf : α → L.Term β} {v : β → M} :
    (t.subst tf).realize v = t.realize fun a => (tf a).realize v

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

FirstOrder.Language.Term.realize v (t.subst tf) =
  FirstOrder.Language.Term.realize (fun a => FirstOrder.Language.Term.realize v (tf a)) t


theorem setToFun_finset_sum (hT : DominatedFinMeasAdditive μ T C) {ι} (s : Finset ι) {f : ι → α → E}
    (hf : ∀ i ∈ s, Integrable (f i) μ) :
    (setToFun μ T hT fun a => ∑ i ∈ s, f i a) = ∑ i ∈ s, setToFun μ T hT (f i)

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hf : ∀ i ∈ s, MeasureTheory.Integrable (f i) μ)

(MeasureTheory.setToFun μ T hT fun a => ∑ i ∈ s, f i a) = ∑ i ∈ s, MeasureTheory.setToFun μ T hT (f i)


lemma coreflection_apply (f : N) :
    P.coreflection i f = f - (P.toLin (P.root i) f) • P.coroot i

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i : ι)
(f : N)

(P.coreflection i) f = f - (P.toLin (P.root i)) f • P.coroot i


theorem content_X_mul {p : R[X]} : content (X * p) = content p

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


/-- A general version of the slash action of the space of modular forms. -/
class SlashAction (β G α γ : Type*) [Group G] [AddMonoid α] [SMul γ α] where
  map : β → G → α → α
  zero_slash : ∀ (k : β) (g : G), map k g 0 = 0
  slash_one : ∀ (k : β) (a : α), map k 1 a = a
  slash_mul : ∀ (k : β) (g h : G) (a : α), map k (g * h) a = map k h (map k g a)
  smul_slash : ∀ (k : β) (g : G) (a : α) (z : γ), map k g (z • a) = z • map k g a
  add_slash : ∀ (k : β) (g : G) (a b : α), map k g (a + b) = map k g a + map k g b

{β : Type u_1}
{G : Type u_2}
{α : Type u_3}
{γ : Type u_4}
[Group G]
[AddMonoid α]
[SMul γ α]
[self : SlashAction β G α γ]
(k : β)
(a : α)


@[simp]
theorem ite_eq_gt_distrib (c : Prop) [Decidable c] (a b : Ordering) :
    ((if c then a else b) = Ordering.gt) = if c then a = Ordering.gt else b = Ordering.gt


theorem ofBijective.symm_eq {φ : P₁ →ᵃ[k] P₂} (hφ : Function.Bijective φ) :
    (ofBijective hφ).symm.toEquiv = (Equiv.ofBijective _ hφ).symm

{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₂]
{φ : P₁ →ᵃ[k] P₂}
(hφ : Function.Bijective ⇑φ)

(AffineEquiv.ofBijective hφ).symm.toEquiv = (Equiv.ofBijective (⇑φ) hφ).symm


@[reassoc] lemma comp_τ₂ (φ₁₂ : S₁ ⟶ S₂) (φ₂₃ : S₂ ⟶ S₃) :
    (φ₁₂ ≫ φ₂₃).τ₂ = φ₁₂.τ₂ ≫ φ₂₃.τ₂

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

(φ₁₂ : S₁ ⟶ S₂)

(φ₂₃ : S₂ ⟶ S₃)

(CategoryTheory.CategoryStruct.comp φ₁₂ φ₂₃).τ₂ = CategoryTheory.CategoryStruct.comp φ₁₂.τ₂ φ₂₃.τ₂


theorem congr_nhdsWithin {s : Set H} {x : H} {f g : H → H'} (h1 : f =ᶠ[𝓝[s] x] g) (h2 : f x = g x)
    (hP : P f s x) : P g s x

{H : Type u_1}
{H' : Type u_3}
[TopologicalSpace H]
[TopologicalSpace H']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
(hG : G.LocalInvariantProp G' P)
{s : Set H}
{x : H}
{f g : H → H'}
(h1 : f =ᶠ[𝓝[s] x] g)
(h2 : f x = g x)
(hP : P f s x)


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

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


protected theorem mul_pos_of_neg_of_neg {a b : Int} (ha : a < 0) (hb : b < 0) : 0 < a * b


lemma OneHypercover.mem_sieve₁' {S : C} (E : J.OneHypercover S)
    (i₁ i₂ : E.I₀) [HasPullback (E.f i₁) (E.f i₂)] :
    E.sieve₁' i₁ i₂ ∈ J _

{J : CategoryTheory.GrothendieckTopology C}

[CategoryTheory.Limits.HasPullback (E.f i₁) (E.f i₂)]

E.sieve₁' i₁ i₂ ∈ J.sieves (CategoryTheory.Limits.pullback (E.f i₁) (E.f i₂))


/-- If `f` and `g` are two functions that are interval integrable on `a..b`, `a ≤ b`,
`f x ≤ g x` for a.e. `x ∈ Set.Ioc a b`, and `f x < g x` on a subset of `Set.Ioc a b`
of nonzero measure, then `∫ x in a..b, f x ∂μ < ∫ x in a..b, g x ∂μ`. -/
theorem integral_lt_integral_of_ae_le_of_measure_setOf_lt_ne_zero (hab : a ≤ b)
    (hfi : IntervalIntegrable f μ a b) (hgi : IntervalIntegrable g μ a b)
    (hle : f ≤ᵐ[μ.restrict (Ioc a b)] g) (hlt : μ.restrict (Ioc a b) {x | f x < g x} ≠ 0) :
    (∫ x in a..b, f x ∂μ) < ∫ x in a..b, g x ∂μ

(hle : f ≤ᵐ[μ.restrict (Set.Ioc a b)] g)

(hlt : (μ.restrict (Set.Ioc a b)) {x | f x < g x} ≠ 0)

∫ (x : ℝ) in a..b, f x ∂μ < ∫ (x : ℝ) in a..b, g x ∂μ


/-- Left-multiplying a permutation with `swap i j` twice gives the original permutation.

  This specialization of `swap_mul_self` is useful when using cosets of permutations.
-/
@[simp]
theorem swap_mul_self_mul (i j : α) (σ : Perm α) : Equiv.swap i j * (Equiv.swap i j * σ) = σ

{α : Type u}
[DecidableEq α]
(i j : α)
(σ : Equiv.Perm α)


lemma Integrable.measure_le_integral {f : X → ℝ} (f_int : Integrable f μ) (f_nonneg : 0 ≤ᵐ[μ] f)
    {s : Set X} (hs : ∀ x ∈ s, 1 ≤ f x) :
    μ s ≤ ENNReal.ofReal (∫ x, f x ∂μ)

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{f : X → ℝ}
(f_int : MeasureTheory.Integrable f μ)
(f_nonneg : 0 ≤ᵐ[μ] f)
{s : Set X}
(hs : ∀ x ∈ s, 1 ≤ f x)

μ s ≤ ENNReal.ofReal (∫ (x : X), f x ∂μ)


@[simp]
lemma id_f (L : Φ.LeftResolution X₂) : Hom.f (𝟙 L) = 𝟙 L.X₁

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}

(CategoryTheory.CategoryStruct.id L).f = CategoryTheory.CategoryStruct.id L.X₁


/-- The map `Square Cᵒᵖ → Square C` which switches `X₁` and `X₃`, but
does not move `X₂` and `X₃`. -/
@[simps]
protected def unop (sq : Square Cᵒᵖ) : Square C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(sq : CategoryTheory.Square Cᵒᵖ)


@[to_additive]
lemma mem_ofUnits_of_isUnit_of_unit_mem (S : Subgroup Mˣ) {x : M} (h₁ : IsUnit x)
    (h₂ : h₁.unit ∈ S) : x ∈ S.ofUnits

{M : Type u_1}
[AddMonoid M]
(S : AddSubgroup (AddUnits M))
{x : M}
(h₁ : IsAddUnit x)
(h₂ : h₁.addUnit ∈ S)


@[simp]
theorem map_map (f₁ : β → γ) (f₂ : α → β) :
    map f₁ (map f₂ xs) = map (fun x => f₁ <| f₂ x) xs

{α : Type u_3}
{n : ℕ}
{β : Type u_2}
{γ : Type u_1}
(xs : Mathlib.Vector α n)
(f₁ : β → γ)
(f₂ : α → β)

Mathlib.Vector.map f₁ (Mathlib.Vector.map f₂ xs) = Mathlib.Vector.map (fun x => f₁ (f₂ x)) xs


@[simp]
theorem dedup_cons_of_not_mem {a : α} {l : List α} (h : a ∉ l) : dedup (a :: l) = a :: dedup l

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


theorem StrictConvex.add_left (hs : StrictConvex 𝕜 s) (z : E) :
    StrictConvex 𝕜 ((fun x => z + x) '' s)

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[AddCommGroup E]
[Module 𝕜 E]
[ContinuousAdd E]
{s : Set E}
(hs : StrictConvex 𝕜 s)
(z : E)


/-- The functor `Fin n ⥤ Fin (n + 1)` which sends `i` to `i.castSucc`. -/
@[simps]
def _root_.Fin.castSuccFunctor (n : ℕ) : Fin n ⥤ Fin (n + 1)

(Fin.castSuccFunctor n).obj i = i.castSucc


/-- A closure operator is equal to the closure operator obtained by feeding `c.closed` into the
`ofPred` constructor. -/
theorem eq_ofPred_closed (c : ClosureOperator α) :
    c = ofPred c c.IsClosed c.le_closure c.isClosed_closure fun x y ↦ closure_min

{α : Type u_1}
[PartialOrder α]
(c : ClosureOperator α)

c = ClosureOperator.ofPred (⇑c) c.IsClosed ⋯ ⋯ ⋯


@[simp]
theorem gcd_add_mul_left_right (m n k : ℕ) : gcd m (n + m * k) = gcd m n


lemma AnalyticWithinAt.congr [CompleteSpace F] {f g : E → F} {s : Set E} {x : E}
    (hf : AnalyticWithinAt 𝕜 f s x) (hs : EqOn f g s) (hx : f x = g x) :
    AnalyticWithinAt 𝕜 g s x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f g : E → F}
{s : Set E}
{x : E}
(hf : AnalyticWithinAt 𝕜 f s x)
(hs : Set.EqOn f g s)
(hx : f x = g x)


theorem toPartialHomeomorph_apply (x : E) : φ.toPartialHomeomorph x = (φ.leftFun x, φ.rightFun x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[CompleteSpace G]
(φ : ImplicitFunctionData 𝕜 E F G)
(x : E)

↑φ.toPartialHomeomorph x = (φ.leftFun x, φ.rightFun x)


@[simp]
theorem max'_le_iff {x} : s.max' H ≤ x ↔ ∀ y ∈ s, y ≤ x

{α : Type u_2}
[LinearOrder α]
(s : Finset α)
(H : s.Nonempty)
{x : α}


@[simp]
theorem biInter_and' (p : ι' → Prop) (q : ι → ι' → Prop) (s : ∀ x y, p y ∧ q x y → Set α) :
    ⋂ (x : ι) (y : ι') (h : p y ∧ q x y), s x y h =
      ⋂ (y : ι') (hy : p y) (x : ι) (hx : q x y), s x y ⟨hy, hx⟩

(s : (x : ι) → (y : ι') → p y ∧ q x y → Set α)

⋂ x, ⋂ y, ⋂ (h : p y ∧ q x y), s x y h = ⋂ y, ⋂ (hy : p y), ⋂ x, ⋂ (hx : q x y), s x y ⋯


theorem indepSet_iff_measure_inter_eq_mul (hs_meas : MeasurableSet s)
    (ht_meas : MeasurableSet t) (μ : Measure Ω := by volume_tac)
    [IsProbabilityMeasure μ] : IndepSet s t μ ↔ μ (s ∩ t) = μ s * μ t

(μ : MeasureTheory.Measure Ω := by volume_tac)

ProbabilityTheory.IndepSet s t μ ↔ μ (s ∩ t) = μ s * μ t


theorem bihimp_left_surjective (a : α) : Surjective (· ⇔ a)

{α : Type u_2}
[BooleanAlgebra α]
(a : α)


@[simp]
theorem lim_nhdsWithin {x : X} {s : Set X} (h : x ∈ closure s) : @lim _ _ ⟨x⟩ (𝓝[s] x) = x

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
{x : X}
{s : Set X}
(h : x ∈ closure s)


theorem Ne.nhdsWithin_diff_singleton [T1Space X] {x y : X} (h : x ≠ y) (s : Set X) :
    𝓝[s \ {y}] x = 𝓝[s] x

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{x y : X}
(h : x ≠ y)
(s : Set X)


@[simp]
theorem comap_op_one :
    comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) (1 : Submodule R Aᵐᵒᵖ) = 1

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]

Submodule.comap (↑(MulOpposite.opLinearEquiv R)) 1 = 1


@[simp]
lemma symmetric_apply_eq_iff {α : Sort*} {f : α → α} : Symmetric (f · = ·) ↔ Involutive f

(Symmetric fun x x_1 => f x = x_1) ↔ Function.Involutive f


theorem ge_of_eq [Preorder α] {a b : α} (h : a = b) : a ≥ b

{α : Type u_2}
[Preorder α]
{a b : α}
(h : a = b)


theorem closure_iUnion {ι} (s : ι → Set K) : closure (⋃ i, s i) = ⨆ i, closure (s i)

{K : Type u}
[DivisionRing K]
{ι : Sort u_1}
(s : ι → Set K)

Subfield.closure (⋃ i, s i) = ⨆ i, Subfield.closure (s i)


/-- There is a natural equivalence when swapping the coefficients of a quaternion algebra. -/
@[simps]
def swapEquiv : ℍ[R,c₁,c₂] ≃ₐ[R] ℍ[R, c₂, c₁]

{R : Type u_3}
[CommRing R]
(c₁ c₂ : R)
(t : ℍ[R,c₁,c₂])

((QuaternionAlgebra.swapEquiv c₁ c₂) t).imK = -t.imK


@[simp]
theorem zeroLocus_pow (I : Ideal R) {n : ℕ} (hn : n ≠ 0) :
    zeroLocus ((I ^ n : Ideal R) : Set R) = zeroLocus I

{R : Type u}
[CommSemiring R]
(I : Ideal R)
{n : ℕ}
(hn : n ≠ 0)

PrimeSpectrum.zeroLocus ↑(I ^ n) = PrimeSpectrum.zeroLocus ↑I


/-- Interpret a functor that is an equivalence as an equivalence.

See <https://stacks.math.columbia.edu/tag/02C3>. -/
@[simps functor]
noncomputable def asEquivalence (F : C ⥤ D) [F.IsEquivalence] : C ≌ D

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


@[ext]
lemma ext {F : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {X : C} {s : yoneda.obj X ⟶ A}
    {u v : OverArrows η s} : u.val = v.val → u = v

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

{u v : CategoryTheory.OverPresheafAux.OverArrows η s}


/-- The value from `WellFoundedLT.fix` is built from the previous ones as specified. -/
theorem fix_eq {C : α → Sort*} (F : ∀ x : α, (∀ y : α, y < x → C y) → C x) :
    ∀ x, fix F x = F x fun y _ => fix F y

(F : (x : α) → ((y : α) → y < x → C y) → C x)

WellFoundedLT.fix F x = F x fun y x => WellFoundedLT.fix F y


lemma ringEquivCongr_val {a b : ℕ} (h : a = b) (x : ZMod a) :
    ZMod.val ((ZMod.ringEquivCongr h) x) = ZMod.val x


theorem toFinset_prod (s : Set α) (t : Set β) [Fintype s] [Fintype t] [Fintype (s ×ˢ t)] :
    (s ×ˢ t).toFinset = s.toFinset ×ˢ t.toFinset

{α : Type u_1}
{β : Type u_2}
(s : Set α)
(t : Set β)
[Fintype ↑s]
[Fintype ↑t]
[Fintype ↑(s ×ˢ t)]


/-- 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).hom.app X).τ₃ =
  n.negOnePow • (HomologicalComplex.XIsoOfEq X ⋯).hom


@[simp]
theorem mem_toAddSubgroup : x ∈ p.toAddSubgroup ↔ x ∈ p

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


theorem add : @Primrec' 2 fun v => v.head + v.tail.head

Nat.Primrec' fun v => v.head + v.tail.head


theorem dedup_map_dedup_eq [DecidableEq β] (f : α → β) (s : Multiset α) :
    dedup (map f (dedup s)) = dedup (map f s)

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

(Multiset.map f s.dedup).dedup = (Multiset.map f s).dedup


theorem Odd.add_dvd_pow_add_pow [CommRing α] (x y : α) {n : ℕ} (h : Odd n) :
    x + y ∣ x ^ n + y ^ n

{α : Type u}
[CommRing α]
(x y : α)
{n : ℕ}
(h : Odd n)


theorem injective_toPullbackDiag (f : X → Y) : (toPullbackDiag f).Injective

{X : Type u_1}
{Y : Sort u_2}
(f : X → Y)


@[to_additive existing (attr := simp) (reorder := 1 2) smul_down]
theorem pow_down [Pow α β] (a : ULift.{v} α) (b : β) : (a ^ b).down = a.down ^ b

{α : Type u}
{β : Type u_1}
[Pow α β]
(a : ULift.{v, u} α)
(b : β)


theorem diff_mem {s t : Set α} (hs : s ∈ f) (ht : tᶜ ∈ f) : s \ t ∈ f

{α : Type u}
{f : Filter α}
{s t : Set α}
(hs : s ∈ f)
(ht : tᶜ ∈ f)


@[simp]
theorem toEquiv_symm (e : α ≃o β) : e.toEquiv.symm = e.symm.toEquiv

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
(e : α ≃o β)


/-- Walks of length two from `u` to `v` correspond bijectively to common neighbours of `u` and `v`.
Note that `u` and `v` may be the same. -/
@[simps]
def walkLengthTwoEquivCommonNeighbors (u v : V) :
    {p : G.Walk u v // p.length = 2} ≃ G.commonNeighbors u v

{V : Type u}
(G : SimpleGraph V)
(u v : V)
(p : { p // p.length = 2 })

↑((G.walkLengthTwoEquivCommonNeighbors u v) p) = (↑p).getVert 1


theorem doubleFactorial_eq_prod_odd :
    ∀ n : ℕ, (2 * n + 1)‼ = ∏ i ∈ Finset.range n, (2 * (i + 1) + 1)


@[simp]
theorem prodProdProdComm_toAddEquiv :
    (prodProdProdComm R M M₂ M₃ M₄ : _ ≃+ _) = AddEquiv.prodProdProdComm M M₂ M₃ M₄

(R : Type u)
(M : Type v)
(M₂ : Type w)
(M₃ : Type y)
(M₄ : Type z)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommMonoid M₄]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module R M₄]

↑(LinearEquiv.prodProdProdComm R M M₂ M₃ M₄) = AddEquiv.prodProdProdComm M M₂ M₃ M₄


@[simp]
theorem map_mul : ∀ (x y : R), v (x * y) = v x + v y

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedAddCommMonoidWithTop Γ₀]
(v : AddValuation R Γ₀)
(x y : R)


@[simp]
theorem coeff_map (n : σ →₀ ℕ) (φ : MvPowerSeries σ R) : coeff S n (map σ f φ) = f (coeff R n φ)

{σ : Type u_1}
{R : Type u_2}
{S : Type u_3}
[Semiring R]
[Semiring S]
(f : R →+* S)
(n : σ →₀ ℕ)
(φ : MvPowerSeries σ R)

(MvPowerSeries.coeff S n) ((MvPowerSeries.map σ f) φ) = f ((MvPowerSeries.coeff R n) φ)


/-- If `f : 𝓕.stalk p₀ ⟶ c`, then a natural transformation `𝓕 ⟶ skyscraperPresheaf p₀ c` can be
defined by: `𝓕.germ p₀ ≫ f : 𝓕(U) ⟶ c` if `p₀ ∈ U` and the unique morphism to a terminal object
if `p₀ ∉ U`.
-/
@[simps]
def toSkyscraperPresheaf {𝓕 : Presheaf C X} {c : C} (f : 𝓕.stalk p₀ ⟶ c) :
    𝓕 ⟶ skyscraperPresheaf p₀ c

[(U : TopologicalSpace.Opens ↑X) → Decidable (p₀ ∈ U)]

(StalkSkyscraperPresheafAdjunctionAuxs.toSkyscraperPresheaf p₀ f).app U =
  if h : p₀ ∈ Opposite.unop U then 𝓕.germ ⟨p₀, h⟩ ≫ f ≫ CategoryTheory.eqToHom ⋯
  else (⋯ ▸ CategoryTheory.Limits.terminalIsTerminal).from (𝓕.obj U)


theorem map_eq_zero_of_not_injective (v : ι → M) (hv : ¬Function.Injective v) : f v = 0

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
(f : M [⋀^ι]→ₗ[R] N)
(v : ι → M)
(hv : ¬Function.Injective v)


/-- Construct a homeomorphism from an isomorphism. -/
@[simps]
def homeoOfIso {X Y : Sequential.{u}} (f : X ≅ Y) : X ≃ₜ Y

(a : (CategoryTheory.forget Sequential).obj X)


/-- Give a bound on `‖(1 + t * z)⁻¹‖` for `0 ≤ t ≤ 1` and `‖z‖ < 1`. -/
lemma norm_one_add_mul_inv_le {t : ℝ} (ht : t ∈ Set.Icc 0 1) {z : ℂ} (hz : ‖z‖ < 1) :
    ‖(1 + t * z)⁻¹‖ ≤ (1 - ‖z‖)⁻¹


theorem liftRingHom_apply_ofFractionRing_mk (φ : R[X] →+* L) (hφ : R[X]⁰ ≤ L⁰.comap φ) (n : R[X])
    (d : R[X]⁰) : liftRingHom φ hφ (ofFractionRing (Localization.mk n d)) = φ n / φ d

{L : Type u_2}
{R : Type u_3}
[Field L]
[CommRing R]
(φ : R[X] →+* L)
(hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰)
(n : R[X])
(d : ↥R[X]⁰)

(RatFunc.liftRingHom φ hφ) { toFractionRing := Localization.mk n d } = φ n / φ ↑d


theorem inv_hom_id : inv P ≫ hom P = 𝟙 _

Bimod.LeftUnitorBimod.inv P ≫ Bimod.LeftUnitorBimod.hom P = 𝟙 P.X


@[simp]
theorem res_const (f g : R) (U hu V hv i) :
    (structureSheaf R).1.map i (const R f g U hu) = const R f g V hv

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(hu : ∀ x ∈ U, g ∈ x.asIdeal.primeCompl)

(V : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(hv : ∀ x ∈ V, g ∈ x.asIdeal.primeCompl)

((AlgebraicGeometry.Spec.structureSheaf R).val.map i) (AlgebraicGeometry.StructureSheaf.const R f g U hu) =
  AlgebraicGeometry.StructureSheaf.const R f g V hv


@[simp]
theorem Q_zero : (Q 0 : K[X] ⟶ _) = 0

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}


protected theorem directedSystem [h : DirectedSystem G fun i j h => f i j h] :
    DirectedSystem G fun i j hij => (f i j hij).toIntLinearMap

[h : DirectedSystem G fun i j h => ⇑(f i j h)]

DirectedSystem G fun i j hij => ⇑(f i j hij).toIntLinearMap


theorem Nat.not_succ_le_zero : ∀ (n : Nat), LE.le (succ n) 0 → False


theorem nnnorm_surjective : Surjective (nnnorm : E → ℝ≥0)

(E : Type u_1)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[Nontrivial E]


theorem isUnit_comp (j : S →+* P) (y : M) : IsUnit (j.comp (algebraMap R S) y)

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
[IsLocalization M S]
(j : S →+* P)
(y : ↥M)


@[simp]
theorem prod_le_prod {f₁ f₂ : Filter α} {g₁ g₂ : Filter β} [NeBot f₁] [NeBot g₁] :
    f₁ ×ˢ g₁ ≤ f₂ ×ˢ g₂ ↔ f₁ ≤ f₂ ∧ g₁ ≤ g₂

{α : Type u_1}
{β : Type u_2}
{f₁ f₂ : Filter α}
{g₁ g₂ : Filter β}
[f₁.NeBot]
[g₁.NeBot]

f₁ ×ˢ g₁ ≤ f₂ ×ˢ g₂ ↔ f₁ ≤ f₂ ∧ g₁ ≤ g₂


theorem C1_projOrd {x : I → Bool} (hx : x ∈ C1 C ho) : SwapTrue o (Proj (ord I · < o) x) = x

(hsC : Profinite.NobelingProof.contained C (Order.succ o))

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

(hx : x ∈ Profinite.NobelingProof.C1 C ho)

Profinite.NobelingProof.SwapTrue o (Profinite.NobelingProof.Proj (fun x => Profinite.NobelingProof.ord I x < o) x) = x


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

{R : Type u}
[Ring R]
⦃s t : Set R⦄
(h : s ⊆ t)


theorem add_right (h₁ : μ ⟂ₘ ν₁) (h₂ : μ ⟂ₘ ν₂) : μ ⟂ₘ ν₁ + ν₂

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν₁ ν₂ : MeasureTheory.Measure α}
(h₁ : μ ⟂ₘ ν₁)
(h₂ : μ ⟂ₘ ν₂)

μ ⟂ₘ ν₁ + ν₂


@[simp]
theorem intCast_re (n : ℤ) : (n : ℤ√d).re = n


/-- Rewriting equality in the dependent type `Σ (a : composition n), composition a.length)` in
non-dependent terms with lists, requiring that the blocks coincide. -/
theorem sigma_composition_eq_iff (i j : Σ a : Composition n, Composition a.length) :
    i = j ↔ i.1.blocks = j.1.blocks ∧ i.2.blocks = j.2.blocks

(i j : (a : Composition n) × Composition a.length)

i = j ↔ i.fst.blocks = j.fst.blocks ∧ i.snd.blocks = j.snd.blocks


theorem sup_lt_ord_lift_of_isRegular {ι} {f : ι → Ordinal} {c} (hc : IsRegular c)
    (hι : Cardinal.lift.{v, u} #ι < c) : (∀ i, f i < c.ord) → Ordinal.sup.{u, v} f < c.ord

{ι : Type u}
{f : ι → Ordinal.{max u v}}
{c : Cardinal.{max u v}}
(hc : c.IsRegular)
(hι : Cardinal.lift.{v, u} #ι < c)

(∀ (i : ι), f i < c.ord) → Ordinal.sup f < c.ord


/-- In the trivial model with corners, the associated `PartialEquiv` is the identity. -/
@[simp, mfld_simps]
theorem modelWithCornersSelf_partialEquiv : 𝓘(𝕜, E).toPartialEquiv = PartialEquiv.refl E

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(E : Type u_2)
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]


theorem antidiagonal_succ (n : ℕ) :
    antidiagonal (n + 1) =
      cons (0, n + 1)
        ((antidiagonal n).map
          (Embedding.prodMap ⟨Nat.succ, Nat.succ_injective⟩ (Embedding.refl _)))
        (by simp)

Finset.antidiagonal (n + 1) =
  Finset.cons (0, n + 1)
    (Finset.map ({ toFun := Nat.succ, inj' := Nat.succ_injective }.prodMap (Function.Embedding.refl ℕ))
      (Finset.antidiagonal n))
    ⋯


@[simp]
theorem LeftExactFunctor.ofExact_obj (F : C ⥤ₑ D) :
    (LeftExactFunctor.ofExact C D).obj F = ⟨F.1, F.2.1⟩

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ₑ D)

(CategoryTheory.LeftExactFunctor.ofExact C D).obj F = { obj := F.obj, property := ⋯ }


/-- `Multifork.ofPiFork` as a functor. -/
@[simps]
noncomputable def ofPiForkFunctor : Fork I.fstPiMap I.sndPiMap ⥤ Multifork I

(I : CategoryTheory.Limits.MulticospanIndex C)

{K₁ K₂ : CategoryTheory.Limits.Fork I.fstPiMap I.sndPiMap}


@[measurability]
protected theorem Finset.measurableSet (s : Finset α) : MeasurableSet (↑s : Set α)

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSingletonClass α]
(s : Finset α)


theorem limsup_compl : (limsup u f)ᶜ = liminf (compl ∘ u) f

{α : Type u_1}
{β : Type u_2}
[CompleteBooleanAlgebra α]
(f : Filter β)
(u : β → α)

(Filter.limsup u f)ᶜ = Filter.liminf (compl ∘ u) f


@[simp]
theorem ofSubmodules_apply {p : Submodule R M} {q : Submodule R₂ M₂} (h : p.map ↑e = q) (x : p) :
    ↑(e.ofSubmodules p q h x) = e x

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_M₂ : Module R₂ M₂}
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
(e : M ≃ₛₗ[σ₁₂] M₂)
{p : Submodule R M}
{q : Submodule R₂ M₂}
(h : Submodule.map e p = q)
(x : ↥p)


@[simp]
lemma homologyMap'_nullHomotopic
    (H₁ : S₁.HomologyData) (H₂ : S₂.HomologyData)
    (h₀ : S₁.X₁ ⟶ S₂.X₁) (h₀_f : h₀ ≫ S₂.f = 0)
    (h₁ : S₁.X₂ ⟶ S₂.X₁) (h₂ : S₁.X₃ ⟶ S₂.X₂) (h₃ : S₁.X₃ ⟶ S₂.X₃) (g_h₃ : S₁.g ≫ h₃ = 0) :
    homologyMap' (nullHomotopic _ _ h₀ h₀_f h₁ h₂ h₃ g_h₃) H₁ H₂ = 0

(h₀_f : CategoryTheory.CategoryStruct.comp h₀ S₂.f = 0)

(g_h₃ : CategoryTheory.CategoryStruct.comp S₁.g h₃ = 0)

CategoryTheory.ShortComplex.homologyMap' (S₁.nullHomotopic S₂ h₀ h₀_f h₁ h₂ h₃ g_h₃) H₁ H₂ = 0


/-- If a topological group embeds into a nonarchimedean group, then it is nonarchimedean. -/
@[to_additive]
theorem nonarchimedean_of_emb (f : G →* H) (emb : OpenEmbedding f) : NonarchimedeanGroup H

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[NonarchimedeanAddGroup G]
{H : Type u_2}
[AddGroup H]
[TopologicalSpace H]
[TopologicalAddGroup H]
(f : G →+ H)
(emb : OpenEmbedding ⇑f)


theorem attach_ndinsert (a : α) (s : Multiset α) :
    (s.ndinsert a).attach =
      ndinsert ⟨a, mem_ndinsert_self a s⟩ (s.attach.map fun p => ⟨p.1, mem_ndinsert_of_mem p.2⟩)

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

(Multiset.ndinsert a s).attach = Multiset.ndinsert ⟨a, ⋯⟩ (Multiset.map (fun p => ⟨↑p, ⋯⟩) s.attach)


theorem Projective.of_equiv [Module.Projective R M]
    (e : M ≃ₗ[R] P) : Module.Projective R P

{R : Type u}
[Ring R]
{P : Type v}
[AddCommGroup P]
[Module R P]
{M : Type u_1}
[AddCommGroup M]
[Module R M]
[Module.Projective R M]
(e : M ≃ₗ[R] P)


@[simp] lemma comp_inf_comp (a b : α) : comp a ⊓ comp b = comp (a ⊔ b)

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

Booleanisation.comp a ⊓ Booleanisation.comp b = Booleanisation.comp (a ⊔ b)


@[simp] theorem recAuxOn_zero {motive : Nat → Sort _} (zero : motive 0)
    (succ : ∀ n, motive n → motive (n+1)) :
    Nat.recAuxOn 0 zero succ = zero

(succ : (n : Nat) → motive n → motive (n + 1))


@[to_additive (attr := simp, norm_cast)]
theorem coe_smul' [SMul M β] (c : α → M) (f : α → β) : ↑(c • f) = (c : Germ l M) • (f : Germ l β)

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{M : Type u_5}
[VAdd M β]
(c : α → M)
(f : α → β)


theorem ext_iff {f g : r ≃r s} : f = g ↔ ∀ x, f x = g x

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
{f g : r ≃r s}


@[simp]
theorem toTensorAlgebra_gMul {i j} (a : (⨂[R]^i) M) (b : (⨂[R]^j) M) :
    TensorPower.toTensorAlgebra (@GradedMonoid.GMul.mul _ (fun n => ⨂[R]^n M) _ _ _ _ a b) =
      TensorPower.toTensorAlgebra a * TensorPower.toTensorAlgebra b

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{i j : ℕ}
(a : ⨂[R]^i M)
(b : ⨂[R]^j M)

TensorPower.toTensorAlgebra (GradedMonoid.GMul.mul a b) = TensorPower.toTensorAlgebra a * TensorPower.toTensorAlgebra b


@[to_additive (attr := simp)]
theorem mulEquivOfLocalizations_symm_apply {k : LocalizationMap S P} {x} :
    (f.mulEquivOfLocalizations k).symm x = k.lift f.map_units x

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{k : S.LocalizationMap P}
{x : P}

(f.mulEquivOfLocalizations k).symm x = (k.lift ⋯) x


@[simp]
theorem Nat.not_irrational (m : ℕ) : ¬Irrational m


theorem StructureGroupoid.mem_of_eqOnSource (G : StructureGroupoid H) {e e' : PartialHomeomorph H H}
    (he : e ∈ G) (h : e' ≈ e) : e' ∈ G

{H : Type u}
[TopologicalSpace H]
(G : StructureGroupoid H)
{e e' : PartialHomeomorph H H}
(he : e ∈ G)
(h : e' ≈ e)


@[simp]
lemma OverArrows.yonedaCollectionPresheafToA_val_fst (s : yoneda.obj X ⟶ A)
    (p : OverArrows (yonedaCollectionPresheafToA F) s) : p.val.fst = s

{A : CategoryTheory.Functor Cᵒᵖ (Type v)}

{F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

(p : CategoryTheory.OverPresheafAux.OverArrows (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA F) s)

CategoryTheory.OverPresheafAux.YonedaCollection.fst p.val = s


{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f g : 𝕜 → E}
{U : Set 𝕜}
(hf : MeromorphicOn f U)
(hg : MeromorphicOn g U)


@[to_additive]
theorem swap_comp_map (f : M →* M') (g : N →* N') :
    (swap M' N').comp (map f g) = (map g f).comp (swap M N)

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass M']
[AddZeroClass N']
(f : M →+ M')
(g : N →+ N')

(AddMonoid.Coprod.swap M' N').comp (AddMonoid.Coprod.map f g) =
  (AddMonoid.Coprod.map g f).comp (AddMonoid.Coprod.swap M N)


@[simp] theorem lTensor_pow (f : N ≃ₗ[R] N) (n : ℕ) : f.lTensor M ^ n = (f ^ n).lTensor M

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(f : N ≃ₗ[R] N)
(n : ℕ)

LinearEquiv.lTensor M f ^ n = LinearEquiv.lTensor M (f ^ n)


/-- A chain of lifts has an upper bound. -/
theorem Lifts.exists_upper_bound (c : Set (Lifts F E K)) (hc : IsChain (· ≤ ·) c) :
    ∃ ub, ∀ a ∈ c, a ≤ ub

(c : Set (IntermediateField.Lifts F E K))


@[to_additive]
theorem exists_multiset_of_mem_closure {M : Type*} [CommMonoid M] {s : Set M} {x : M}
    (hx : x ∈ closure s) : ∃ l : Multiset M, (∀ y ∈ l, y ∈ s) ∧ l.prod = x

{M : Type u_4}
[AddCommMonoid M]
{s : Set M}
{x : M}
(hx : x ∈ AddSubmonoid.closure s)


lemma AnalyticWithinAt.comp [CompleteSpace F] [CompleteSpace G] {f : F → G} {g : E → F} {s : Set F}
    {t : Set E} {x : E} (hf : AnalyticWithinAt 𝕜 f s (g x)) (hg : AnalyticWithinAt 𝕜 g t x)
    (h : MapsTo g t s) : AnalyticWithinAt 𝕜 (f ∘ g) t x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
{G : Type u_5}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[CompleteSpace F]
[CompleteSpace G]
{f : F → G}
{g : E → F}
{s : Set F}
{t : Set E}
{x : E}
(hf : AnalyticWithinAt 𝕜 f s (g x))
(hg : AnalyticWithinAt 𝕜 g t x)
(h : Set.MapsTo g t s)


theorem Fintype.card_subtype_or (p q : α → Prop) [Fintype { x // p x }] [Fintype { x // q x }]
    [Fintype { x // p x ∨ q x }] :
    Fintype.card { x // p x ∨ q x } ≤ Fintype.card { x // p x } + Fintype.card { x // q x }

{α : Type u_1}
(p q : α → Prop)
[Fintype { x // p x }]
[Fintype { x // q x }]
[Fintype { x // p x ∨ q x }]


private theorem mul_unitOf (a : α) : a * unitOf a = algebraMap _ _ (‖a‖₊ : ℝ)

{α : Type u_5}
[NormedDivisionRing α]
[NormedAlgebra ℝ α]
(a : α)

a * Matrix.unitOf a = (algebraMap ℝ α) ↑‖a‖₊


@[nolint synTaut]
theorem evalComp_nil_nil {f g h : C} (α : f ⟶ g) (β : g ⟶ h) :
    α ≫ β = α ≫ β

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f g h : C}
(α : f ⟶ g)
(β : g ⟶ h)

CategoryTheory.CategoryStruct.comp α β = CategoryTheory.CategoryStruct.comp α β


/-- If `f : A →ₐ[R] B` is surjective with finitely generated kernel and `A` is finitely presented,
then so is `B`. -/
theorem of_surjective {f : A →ₐ[R] B} (hf : Function.Surjective f) (hker : f.toRingHom.ker.FG)
    [FinitePresentation R A] : FinitePresentation R B

{R : Type w₁}
{A : Type w₂}
{B : Type w₃}
[CommRing R]
[CommRing A]
[Algebra R A]
[CommRing B]
[Algebra R B]
{f : A →ₐ[R] B}
(hf : Function.Surjective ⇑f)
(hker : (RingHom.ker f.toRingHom).FG)
[Algebra.FinitePresentation R A]


/-- If a rational is not a p-adic integer, it is not an integer. -/
theorem not_int_of_not_padic_int (p : ℕ) {a : ℚ} [hp : Fact (Nat.Prime p)]
    (H : 1 < padicNorm p a) : ¬ a.isInt


theorem SuperpolynomialDecay.mul [ContinuousMul β] (hf : SuperpolynomialDecay l k f)
    (hg : SuperpolynomialDecay l k g) : SuperpolynomialDecay l k (f * g)

(hf : Asymptotics.SuperpolynomialDecay l k f)

(hg : Asymptotics.SuperpolynomialDecay l k g)

Asymptotics.SuperpolynomialDecay l k (f * g)


lemma hasDerivAt_Gamma_one : HasDerivAt Gamma (-γ) 1


theorem iSup_torsionBy_eq_torsionBy_prod :
    ⨆ i ∈ S, torsionBy R M (q i) = torsionBy R M (∏ i ∈ S, q i)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{ι : Type u_3}
{S : Finset ι}
{q : ι → R}
(hq : (↑S).Pairwise (IsCoprime on q))

⨆ i ∈ S, Submodule.torsionBy R M (q i) = Submodule.torsionBy R M (∏ i ∈ S, q i)


@[to_additive (attr := simp)]
theorem mul_get_eq [Mul α] (a b : Part α) (hab : Dom (a * b)) :
    (a * b).get hab = a.get (left_dom_of_mul_dom hab) * b.get (right_dom_of_mul_dom hab)

{α : Type u_1}
[Add α]
(a b : Part α)
(hab : (a + b).Dom)


protected theorem All.del : ∀ {t : RBNode α}, t.All p → (del cut t).All p

{α : Type u_1}
{p : α → Prop}
{cut : α → Ordering}
{t : Batteries.RBNode α}

Batteries.RBNode.All p t → Batteries.RBNode.All p (Batteries.RBNode.del cut t)


theorem toNonUnitalNonAssocSemiring_injective :
    Function.Injective (@toNonUnitalNonAssocSemiring R)


theorem uniformContinuous_completionSeparationQuotientEquiv :
    UniformContinuous (completionSeparationQuotientEquiv α)


@[elab_as_elim]
protected theorem Antisymmetrization.induction_on {p : Antisymmetrization α r → Prop}
    (a : Antisymmetrization α r) (h : ∀ a, p <| toAntisymmetrization r a) : p a

(h : ∀ (a : α), p (toAntisymmetrization r a))


theorem isFractional_of_le_one (I : Submodule R P) (h : I ≤ 1) : IsFractional S I

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
(I : Submodule R P)
(h : I ≤ 1)


/-- `p → q → r ↔ q → p → r` -/
theorem le_himp_comm : a ≤ b ⇨ c ↔ b ≤ a ⇨ c

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


protected theorem surjective : Surjective f

{α : Sort u}
{f : α → α}
(h : Function.Involutive f)


@[to_additive (attr := simp)]
theorem finprod_one : (∏ᶠ _ : α, (1 : M)) = 1

{M : Type u_2}
{α : Sort u_4}
[CommMonoid M]


@[simp]
theorem one_apply (x : A) : (1 : A →A[R] A) x = x

(R : Type u_1)
[CommSemiring R]
(A : Type u_2)
[Semiring A]
[TopologicalSpace A]
[Algebra R A]
(x : A)


@[simp, norm_cast]
theorem coe_vsub (s : AffineSubspace k P) [Nonempty s] (a b : s) : ↑(a -ᵥ b) = (a : P) -ᵥ (b : P)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(s : AffineSubspace k P)
[Nonempty ↥s]
(a b : ↥s)


theorem image_subset_image_iff {t : Finset α} (hf : Injective f) :
    s.image f ⊆ t.image f ↔ s ⊆ t

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α → β}
{s t : Finset α}
(hf : Function.Injective f)

Finset.image f s ⊆ Finset.image f t ↔ s ⊆ t


lemma fac (F : C ⥤ E) (hF : W.IsInvertedBy F) : Q W ⋙ lift F hF = F

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[W.HasLeftCalculusOfFractions]
{E : Type u_3}
[CategoryTheory.Category.{u_5, u_3} E]
(F : CategoryTheory.Functor C E)
(hF : W.IsInvertedBy F)

(CategoryTheory.MorphismProperty.LeftFraction.Localization.Q W).comp
    (CategoryTheory.MorphismProperty.LeftFraction.Localization.StrictUniversalPropertyFixedTarget.lift F hF) =
  F


lemma mono_inj (c : Cofan X) (h : IsColimit c) (i : I)
    [HasCoproduct (fun (k : ((Set.range (fun _ : Unit ↦ i))ᶜ : Set I)) => X k.1)] :
    Mono (Cofan.inj c i)

[CategoryTheory.Limits.HasCoproduct fun k => X ↑k]


@[simp]
theorem coe_natGT {f : ℕ → α} {H : ∀ n : ℕ, r (f (n + 1)) (f n)} : ⇑(natGT f H) = f

{α : Type u_1}
{r : α → α → Prop}
[IsStrictOrder α r]
{f : ℕ → α}
{H : ∀ (n : ℕ), r (f (n + 1)) (f n)}


theorem Nat.zero_lt_succ (n : Nat) : LT.lt 0 (succ n)


theorem Filter.Tendsto.eventually_ne [TopologicalSpace Y] [T1Space Y] {g : X → Y}
    {l : Filter X} {b₁ b₂ : Y} (hg : Tendsto g l (𝓝 b₁)) (hb : b₁ ≠ b₂) : ∀ᶠ z in l, g z ≠ b₂

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace Y]
[T1Space Y]
{g : X → Y}
{l : Filter X}
{b₁ b₂ : Y}
(hg : Filter.Tendsto g l (𝓝 b₁))
(hb : b₁ ≠ b₂)


lemma coe_comp {X Y Z : SemiRingCat} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g : X → Z) = g ∘ f


@[simp]
lemma leftUnshift_leftShift (a n' : ℤ) (hn' : n + a = n') :
    (γ.leftShift a n' hn').leftUnshift n hn' = γ

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


theorem mk_mem_product (ha : a ∈ s) (hb : b ∈ t) : (a, b) ∈ s ×ˢ t

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
{a : α}
{b : β}
(ha : a ∈ s)
(hb : b ∈ t)


theorem continuousOn_extend_symm : ContinuousOn (f.extend I).symm (f.extend I).target

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

ContinuousOn (↑(f.extend I).symm) (f.extend I).target


@[to_additive (attr := simp)]
theorem comap_mk.symm_nhds (x : M) : comap (mk.symm : Mᵈᵐᵃ → M) (𝓝 x) = 𝓝 (mk x)

{M : Type u_1}
[TopologicalSpace M]
(x : M)

Filter.comap (⇑DomAddAct.mk.symm) (𝓝 x) = 𝓝 (DomAddAct.mk x)


theorem congr_hom {F G : C ⥤ D} (h : F = G) {X Y} (f : X ⟶ Y) :
    F.map f = eqToHom (congr_obj h X) ≫ G.map f ≫ eqToHom (congr_obj h Y).symm

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

F.map f =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
    (CategoryTheory.CategoryStruct.comp (G.map f) (CategoryTheory.eqToHom ⋯))


theorem KaehlerDifferential.ker_map :
    LinearMap.ker (KaehlerDifferential.map R S A B) =
      (((kerTotal S B).restrictScalars A).comap finsupp_map).map
        (Finsupp.total A (Ω[A⁄R]) A (D R A))

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]
(A : Type u_2)
(B : Type u_3)
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]
[Algebra A B]
[Algebra S B]
[IsScalarTower R A B]
[IsScalarTower R S B]
[SMulCommClass S A B]

LinearMap.ker (KaehlerDifferential.map R S A B) =
  Submodule.map (Finsupp.total A (Ω[A⁄R]) A ⇑(KaehlerDifferential.D R A))
    (Submodule.comap (Finsupp.mapRange.linearMap (Algebra.linearMap A B) ∘ₗ Finsupp.lmapDomain A A ⇑(algebraMap A B))
      (Submodule.restrictScalars A (KaehlerDifferential.kerTotal S B)))


theorem supported_eq_adjoin_X : supported R s = Algebra.adjoin R (X '' s)

{σ : Type u_1}
{R : Type u}
[CommSemiring R]
(s : Set σ)

MvPolynomial.supported R s = Algebra.adjoin R (MvPolynomial.X '' s)


theorem factorial_eq_mul_doubleFactorial : ∀ n : ℕ, (n + 1)! = (n + 1)‼ * n‼


theorem IsSymm.ortho_comm (H : B.IsSymm) {x y : M} : IsOrtho B x y ↔ IsOrtho B y x

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
(H : B.IsSymm)
{x y : M}


/-- The obvious map `PushoutCocone f.op g.op → PullbackCone f g` -/
@[simps!]
def op {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) : PullbackCone f.op g.op

(c : CategoryTheory.Limits.PushoutCocone f g)


theorem Perm.join {l₁ l₂ : List (List α)} (h : l₁ ~ l₂) : l₁.join ~ l₂.join

{α : Type u_1}
{l₁ l₂ : List (List α)}
(h : l₁ ~ l₂)


theorem SurjOn.image_eq_of_mapsTo (h₁ : SurjOn f s t) (h₂ : MapsTo f s t) : f '' s = t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
(h₁ : Set.SurjOn f s t)
(h₂ : Set.MapsTo f s t)


protected theorem ContMDiff.coordChange (hf : ContMDiff IM IB n f)
    (hg : ContMDiff IM 𝓘(𝕜, F) n g) (he : ∀ x, f x ∈ e.baseSet) (he' : ∀ x, f x ∈ e'.baseSet) :
    ContMDiff IM 𝓘(𝕜, F) n (fun y ↦ e.coordChange e' (f y) (g y))

[TopologicalSpace (Bundle.TotalSpace F E)]

{e e' : Trivialization F Bundle.TotalSpace.proj}

ContMDiff IM 𝓘(𝕜, F) n fun y => e.coordChange e' (f y) (g y)


@[simp]
theorem mem_dualAnnihilator (φ : Module.Dual R M) : φ ∈ W.dualAnnihilator ↔ ∀ w ∈ W, φ w = 0

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{W : Submodule R M}
(φ : Module.Dual R M)


theorem rightInverse_list : Function.RightInverse (ofList γ) (toList _)

Function.RightInverse (WType.ofList γ) (WType.toList γ)


theorem Monotone.comp_le_comp_left
    [Preorder β] {f : β → α} {g h : γ → β} (hf : Monotone f) (le_gh : g ≤ h) :
    LE.le.{max w u} (f ∘ g) (f ∘ h)

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder α]
[Preorder β]
{f : β → α}
{g h : γ → β}
(hf : Monotone f)
(le_gh : g ≤ h)


/-- Forget the cocone structure and obtain just the cocone point. -/
@[simps]
def forget : Cocone F ⥤ C

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
(F : J ⥤ C)
(t : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Limits.Cocones.forget F).obj t = t.pt


theorem coe_eq (p : FractionalIdeal S P) (s : Set P) (hs : s = ↑p) : p.copy s hs = p

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
(p : FractionalIdeal S P)
(s : Set P)
(hs : s = ↑p)


@[simp]
theorem mapsTo_union : MapsTo f (s₁ ∪ s₂) t ↔ MapsTo f s₁ t ∧ MapsTo f s₂ t

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

Set.MapsTo f (s₁ ∪ s₂) t ↔ Set.MapsTo f s₁ t ∧ Set.MapsTo f s₂ t


theorem isNat_not_lucasLehmerTest : {p np : ℕ} →
    IsNat p np → ¬ LucasLehmerTest np → ¬ LucasLehmerTest p

Mathlib.Meta.NormNum.IsNat p np → ¬LucasLehmerTest np → ¬LucasLehmerTest p


theorem Or.resolve_right (h: Or a b) (nb : Not b) : a


@[to_additive]
theorem isCyclic_of_orderOf_eq_card [Fintype α] (x : α) (hx : orderOf x = Fintype.card α) :
    IsCyclic α

{α : Type u}
[Group α]
[Fintype α]
(x : α)
(hx : orderOf x = Fintype.card α)


theorem tendsto_iff_eventually {f : α → β} {l₁ : Filter α} {l₂ : Filter β} :
    Tendsto f l₁ l₂ ↔ ∀ ⦃p : β → Prop⦄, (∀ᶠ y in l₂, p y) → ∀ᶠ x in l₁, p (f x)

{α : Type u}
{β : Type v}
{f : α → β}
{l₁ : Filter α}
{l₂ : Filter β}

Filter.Tendsto f l₁ l₂ ↔ ∀ ⦃p : β → Prop⦄, (∀ᶠ (y : β) in l₂, p y) → ∀ᶠ (x : α) in l₁, p (f x)


/-- A power of a fundamental solution is never equal to the negative of a power of this
fundamental solution. -/
theorem zpow_ne_neg_zpow {a : Solution₁ d} (h : IsFundamental a) {n n' : ℤ} : a ^ n ≠ -a ^ n'

{d : ℤ}
{a : Pell.Solution₁ d}
(h : Pell.IsFundamental a)
{n n' : ℤ}


@[reassoc (attr := simp)]
theorem image.lift_fac (F' : MonoFactorisation f) : image.lift F' ≫ F'.m = image.ι f

(F' : CategoryTheory.Limits.MonoFactorisation f)

CategoryTheory.Limits.image.lift F' ≫ F'.m = CategoryTheory.Limits.image.ι f


lemma integral_le_measure {f : X → ℝ} {s : Set X}
    (hs : ∀ x ∈ s, f x ≤ 1) (h's : ∀ x ∈ sᶜ, f x ≤ 0) :
    ENNReal.ofReal (∫ x, f x ∂μ) ≤ μ s

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{f : X → ℝ}
{s : Set X}
(hs : ∀ x ∈ s, f x ≤ 1)
(h's : ∀ x ∈ sᶜ, f x ≤ 0)

ENNReal.ofReal (∫ (x : X), f x ∂μ) ≤ μ s


theorem iUnion_image_inf_right : ⋃ b ∈ t, (· ⊓ b) '' s = s ⊼ t

{α : Type u_2}
[SemilatticeInf α]
(s t : Set α)


/-- A space is simply connected iff it is path connected, and there is at most one path
  up to homotopy between any two points. -/
theorem simply_connected_iff_paths_homotopic {Y : Type*} [TopologicalSpace Y] :
    SimplyConnectedSpace Y ↔
      PathConnectedSpace Y ∧ ∀ x y : Y, Subsingleton (Path.Homotopic.Quotient x y)

SimplyConnectedSpace Y ↔ PathConnectedSpace Y ∧ ∀ (x y : Y), Subsingleton (Path.Homotopic.Quotient x y)


theorem map_bind' (f : β → γ) (x : Option α) (g : α → Option β) :
    Option.map f (x.bind g) = x.bind fun a ↦ Option.map f (g a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : β → γ)
(x : Option α)
(g : α → Option β)

Option.map f (x.bind g) = x.bind fun a => Option.map f (g a)


lemma gaussianReal_absolutelyContinuous (μ : ℝ) {v : ℝ≥0} (hv : v ≠ 0) :
    gaussianReal μ v ≪ volume

ProbabilityTheory.gaussianReal μ v ≪ MeasureTheory.volume


/-- Converting an augmented simplicial object to an augmented cosimplicial
object and back is isomorphic to the given object. -/
@[simps!]
def SimplicialObject.Augmented.rightOpLeftOpIso (X : SimplicialObject.Augmented C) :
    X.rightOp.leftOp ≅ X

(X : CategoryTheory.SimplicialObject.Augmented C)

∀ (X_1 : SimplexCategoryᵒᵖ), X.rightOpLeftOpIso.hom.left.app X_1 = 𝟙 (X.left.obj X_1)