theorem fold_disjiUnion {ι : Type*} {s : Finset ι} {t : ι → Finset α} {b : ι → β} {b₀ : β} (h) :
    (s.disjiUnion t h).fold op (s.fold op b₀ b) f = s.fold op b₀ fun i => (t i).fold op (b i) f

{α : Type u_1}
{β : Type u_2}
{op : β → β → β}
[hc : Std.Commutative op]
[ha : Std.Associative op]
{f : α → β}
{ι : Type u_4}
{s : Finset ι}
{t : ι → Finset α}
{b : ι → β}
{b₀ : β}
(h : (↑s).PairwiseDisjoint t)

Finset.fold op (Finset.fold op b₀ b s) f (s.disjiUnion t h) =
  Finset.fold op b₀ (fun i => Finset.fold op (b i) f (t i)) s


/-- `x ↦ a / x` as an order-reversing equivalence. -/
@[to_additive (attr := simps!) "`x ↦ a - x` as an order-reversing equivalence."]
def OrderIso.divLeft (a : α) : α ≃o αᵒᵈ

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

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

∀ (a_1 : α), (OrderIso.divLeft a) a_1 = OrderDual.toDual (a / a_1)


theorem LocallyIntegrableOn.mono_set (hf : LocallyIntegrableOn f s μ) {t : Set X}
    (hst : t ⊆ s) : LocallyIntegrableOn f t μ

(hf : MeasureTheory.LocallyIntegrableOn f s μ)


theorem contDiff_exp : ∀ {n}, ContDiff 𝕜 n exp

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[NormedAlgebra 𝕜 ℂ]
{n : ℕ∞}


theorem Icc_succ_left_of_not_isMax (ha : ¬IsMax a) : Icc (succ a) b = Ioc a b

{α : Type u_1}
[Preorder α]
[SuccOrder α]
{a b : α}
(ha : ¬IsMax a)


theorem order_eq_find' [DecidablePred fun n => p n ≠ 0] (hp : p ≠ 0) :
    p.order = Nat.find (FormalMultilinearSeries.ne_iff.mp hp)

{𝕜 : Type u}
{E : Type v}
{F : Type w}
[Ring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
{p : FormalMultilinearSeries 𝕜 E F}
[DecidablePred fun n => p n ≠ 0]
(hp : p ≠ 0)


@[simp]
theorem ciInf_pos {p : Prop} {f : p → α} (hp : p) : ⨅ h : p, f h = f hp

{α : Type u_1}
[ConditionallyCompleteLattice α]
{p : Prop}
{f : p → α}
(hp : p)


theorem mem_destutter' (a) : a ∈ l.destutter' R a

{α : Type u_1}
(l : List α)
(R : α → α → Prop)
[DecidableRel R]
(a : α)


theorem nfpFamily_fp {i} (H : IsNormal (f i)) (a) :
    f i (nfpFamily.{u, v} f a) = nfpFamily.{u, v} f a

{f : ι → Ordinal.{max u v} → Ordinal.{max u v}}

f i (Ordinal.nfpFamily f a) = Ordinal.nfpFamily f a


theorem smul (r : R) (hφ : IsSymmetric φ) : IsSymmetric (r • φ)

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
{φ : MvPolynomial σ R}
(r : R)
(hφ : φ.IsSymmetric)


theorem size_le_size {m n : ℕ} (h : m ≤ n) : size m ≤ size n


theorem mem_of_mem_cons_of_mem : ∀ {a b : α} {l : List α}, a ∈ b :: l → b ∈ l → a ∈ l


@[simp]
theorem Cocone.ofCotrident_ι {F : WalkingParallelFamily J ⥤ C}
    (t : Cotrident fun j => F.map (line j)) (j) :
    (Cocone.ofCotrident t).ι.app j = eqToHom (by cases j <;> aesop_cat) ≫ t.ι.app j

{F : CategoryTheory.Functor (CategoryTheory.Limits.WalkingParallelFamily J) C}

(t : CategoryTheory.Limits.Cotrident fun j => F.map (CategoryTheory.Limits.WalkingParallelFamily.Hom.line j))

(j : CategoryTheory.Limits.WalkingParallelFamily J)

(CategoryTheory.Limits.Cocone.ofCotrident t).ι.app j =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯) (t.ι.app j)


theorem Set.finite_iff_bddBelow_bddAbove [Nonempty α] [Lattice α] [LocallyFiniteOrder α] :
    s.Finite ↔ BddBelow s ∧ BddAbove s

{α : Type u_3}
{s : Set α}
[Nonempty α]
[Lattice α]
[LocallyFiniteOrder α]


@[simp]
theorem C_inv (r : k) : (C σ k r)⁻¹ = C σ k r⁻¹

{σ : Type u_1}
{k : Type u_3}
[Field k]
(r : k)

((MvPowerSeries.C σ k) r)⁻¹ = (MvPowerSeries.C σ k) r⁻¹


@[deprecated getElem?_take_eq_none (since := "2024-06-12")]
theorem get?_take_eq_none {l : List α} {n m : Nat} (h : n ≤ m) :
    (l.take n).get? m = none

{α : Type u_1}
{l : List α}
{n m : Nat}
(h : n ≤ m)


/-- `Function.const` as a `MulHom`. -/
@[to_additive (attr := simps) "`Function.const` as an `AddHom`."]
def Pi.constMulHom (α β : Type*) [Mul β] :
    β →ₙ* α → β

(α : Type u_3)
(β : Type u_4)
[Add β]
(a : β)

∀ (a_1 : α), (Pi.constAddHom α β) a a_1 = Function.const α a a_1


theorem Ideal.coprime_of_no_prime_ge {I J : Ideal R} (h : ∀ P, I ≤ P → J ≤ P → ¬IsPrime P) :
    IsCoprime I J

(h : ∀ (P : Ideal R), I ≤ P → J ≤ P → ¬P.IsPrime)


@[simp]
theorem coe_coeNatMonoidHom : (coeNatMonoidHom : PrimeMultiset → Multiset ℕ) = Coe.coe


/-- Variant of `IsPullback.of_right` where `h₁₁` is induced from a morphism `h₁₃ : X₁₁ ⟶ X₁₃`, and
the universal property of the right square.

The objects fit in the following diagram:
```
X₁₁ - h₁₁ -> X₁₂ - h₁₂ -> X₁₃
|            |            |
v₁₁          v₁₂          v₁₃
↓            ↓            ↓
X₂₁ - h₂₁ -> X₂₂ - h₂₂ -> X₂₃
```
-/
theorem of_right' {X₁₁ X₁₂ X₁₃ X₂₁ X₂₂ X₂₃ : C} {h₁₂ : X₁₂ ⟶ X₁₃} {h₂₁ : X₂₁ ⟶ X₂₂}
    {h₂₂ : X₂₂ ⟶ X₂₃} {h₁₃ : X₁₁ ⟶ X₁₃} {v₁₁ : X₁₁ ⟶ X₂₁} {v₁₂ : X₁₂ ⟶ X₂₂} {v₁₃ : X₁₃ ⟶ X₂₃}
    (s : IsPullback h₁₃ v₁₁ v₁₃ (h₂₁ ≫ h₂₂)) (t : IsPullback h₁₂ v₁₂ v₁₃ h₂₂) :
    IsPullback (t.lift h₁₃ (v₁₁ ≫ h₂₁) (by rw [s.w, Category.assoc])) v₁₁ v₁₂ h₂₁

{X₁₁ X₁₂ X₁₃ X₂₁ X₂₂ X₂₃ : C}

{h₁₂ : X₁₂ ⟶ X₁₃}

{h₂₁ : X₂₁ ⟶ X₂₂}

{h₂₂ : X₂₂ ⟶ X₂₃}

{h₁₃ : X₁₁ ⟶ X₁₃}

{v₁₁ : X₁₁ ⟶ X₂₁}

{v₁₂ : X₁₂ ⟶ X₂₂}

{v₁₃ : X₁₃ ⟶ X₂₃}

(s : CategoryTheory.IsPullback h₁₃ v₁₁ v₁₃ (h₂₁ ≫ h₂₂))

(t : CategoryTheory.IsPullback h₁₂ v₁₂ v₁₃ h₂₂)

CategoryTheory.IsPullback (t.lift h₁₃ (v₁₁ ≫ h₂₁) ⋯) v₁₁ v₁₂ h₂₁


@[simp]
theorem set_smul_subset_set_smul_iff₀ (ha : a ≠ 0) {A B : Set β} : a • A ⊆ a • B ↔ A ⊆ B

{α : Type u_2}
{β : Type u_3}
[GroupWithZero α]
[MulAction α β]
{a : α}
(ha : a ≠ 0)
{A B : Set β}


@[simp]
theorem denom_one : denom (1 : RatFunc K) = 1


/-- Technical lemma for `lift_projectQuotient`. -/
@[simp]
theorem unop_left_comp_underlyingIso_hom_unop {A : CostructuredArrow S T}
    {P : (CostructuredArrow S T)ᵒᵖ} (f : P ⟶ op A) [Mono f.unop.left.op] :
    f.unop.left ≫ (Subobject.underlyingIso f.unop.left.op).hom.unop =
      (Subobject.mk f.unop.left.op).arrow.unop

{A : CategoryTheory.CostructuredArrow S T}

{P : (CategoryTheory.CostructuredArrow S T)ᵒᵖ}

CategoryTheory.CategoryStruct.comp f.unop.left (CategoryTheory.Subobject.underlyingIso f.unop.left.op).hom.unop =
  (CategoryTheory.Subobject.mk f.unop.left.op).arrow.unop


/-- Auxiliary lemma for `biproduct.uniqueUpToIso`. -/
theorem biproduct.conePointUniqueUpToIso_hom (f : J → C) [HasBiproduct f] {b : Bicone f}
    (hb : b.IsBilimit) :
    (hb.isLimit.conePointUniqueUpToIso (biproduct.isLimit _)).hom = biproduct.lift b.π

(hb.isLimit.conePointUniqueUpToIso (CategoryTheory.Limits.biproduct.isLimit f)).hom =
  CategoryTheory.Limits.biproduct.lift b.π


theorem lub_Iio_le (a : α) (hb : IsLUB (Iio a) b) : b ≤ a

{α : Type u}
[Preorder α]
{b : α}
(a : α)
(hb : IsLUB (Set.Iio a) b)


@[simp] lemma one_eq_ofENat {m : ℕ∞} : 1 = (m : Cardinal) ↔ m = 1


@[simp]
lemma leadingCoeff_preΨ₄ (h : (2 : R) ≠ 0) : W.preΨ₄.leadingCoeff = 2

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(h : 2 ≠ 0)


@[simp]
theorem preimage_coe_Iic : (some : α → WithTop α) ⁻¹' Iic a = Iic a


@[simp]
theorem equivToOpposite_symm_coe : (equivToOpposite.symm : αᵒᵖ → α) = unop


lemma self_add_pred (n : ℕ) : n + pred n = (2 * n).pred


@[to_additive]
lemma card_mul_le : Nat.card (s * t) ≤ Nat.card s * Nat.card t

{α : Type u_2}
[Add α]
[IsCancelAdd α]
{s t : Set α}

Nat.card ↑(s + t) ≤ Nat.card ↑s * Nat.card ↑t


theorem dropLast_eq_take (l : List α) : l.dropLast = l.take l.length.pred


theorem Multiplicative.isSubmonoid {s : Set A} :
    IsAddSubmonoid s → @IsSubmonoid (Multiplicative A) _ s

{A : Type u_2}
[AddMonoid A]
{s : Set A}


/-- Construct an affine scheme from a scheme and the information that it is affine.
Also see `AffineScheme.of` for a typeclass version. -/
@[simps]
def AffineScheme.mk (X : Scheme) (_ : IsAffine X) : AffineScheme

∀ (x : AlgebraicGeometry.IsAffine X), (AlgebraicGeometry.AffineScheme.mk X x).obj = X


@[to_additive]
protected theorem congr_arg {f : MulEquiv M N} {x x' : M} : x = x' → f x = f x'

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
{f : M ≃* N}
{x x' : M}


@[norm_cast]
theorem coe_ratCast (q : ℚ) : ↑(q : R) = (q : A)

(R : Type u_1)
(A : Type u_2)
[Field R]
[DivisionRing A]
[Algebra R A]
(q : ℚ)


lemma isNilpotent_aeval_sub_of_isNilpotent_sub (h : IsNilpotent (a - b)) :
    IsNilpotent (aeval a P - aeval b P)

{R : Type u_2}
{S : Type u_3}
[CommRing R]
[CommRing S]
[Algebra R S]
(P : Polynomial R)
{a b : S}
(h : IsNilpotent (a - b))

IsNilpotent ((Polynomial.aeval a) P - (Polynomial.aeval b) P)


theorem lcm_assoc (m n k : Nat) : lcm (lcm m n) k = lcm m (lcm n k)


theorem Nodup.sigma {σ : α → Type*} {l₂ : ∀ a , List (σ a)} (d₁ : Nodup l₁)
    (d₂ : ∀ a , Nodup (l₂ a)) : (l₁.sigma l₂).Nodup

{α : Type u}
{l₁ : List α}
{σ : α → Type u_1}
{l₂ : (a : α) → List (σ a)}
(d₁ : l₁.Nodup)
(d₂ : ∀ (a : α), (l₂ a).Nodup)


theorem conformalAt_const_smul {c : ℝ} (h : c ≠ 0) (x : X) : ConformalAt (fun x' : X => c • x') x

{X : Type u_1}
[NormedAddCommGroup X]
[NormedSpace ℝ X]
{c : ℝ}
(h : c ≠ 0)
(x : X)


/-- [Stacks: Lemma 0052 (2)](https://stacks.math.columbia.edu/tag/0052) -/
theorem NoetherianSpace.finite_irreducibleComponents [NoetherianSpace α] :
    (irreducibleComponents α).Finite

{α : Type u_1}
[TopologicalSpace α]
[TopologicalSpace.NoetherianSpace α]


theorem natTrailingDegree_mul_mirror :
    (p * p.mirror).natTrailingDegree = 2 * p.natTrailingDegree

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


@[simp] theorem run_map [Monad m] [LawfulMonad m] (f : α → β) (x : ExceptT ε m α)
    : (f <$> x).run = Except.map f <$> x.run

{m : Type u_1 → Type u_2}
{α β ε : Type u_1}
[Monad m]
[LawfulMonad m]
(f : α → β)
(x : ExceptT ε m α)


@[reassoc (attr := simp)]
lemma coyonedaOpColimitIsoLimitCoyoneda'_hom_comp_π (i : I) :
    (coyonedaOpColimitIsoLimitCoyoneda' F).hom ≫ limit.π (F.rightOp ⋙ coyoneda) i
      = coyoneda.map (colimit.ι F ⟨i⟩).op

{C : Type u₁}
[CategoryTheory.Category.{u₂, u₁} C]
{I : Type v₁}
[CategoryTheory.Category.{v₂, v₁} I]
(F : CategoryTheory.Functor Iᵒᵖ C)
[CategoryTheory.Limits.HasColimit F]
(i : I)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.coyonedaOpColimitIsoLimitCoyoneda' F).hom
    (CategoryTheory.Limits.limit.π (F.rightOp.comp CategoryTheory.coyoneda) i) =
  CategoryTheory.coyoneda.map (CategoryTheory.Limits.colimit.ι F (Opposite.op i)).op


@[to_additive (attr := simp)]
theorem coe_toEquiv (f : M ≃* N) : ⇑(f : M ≃ N) = f

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(f : M ≃+ N)


/-- **Fermat's Theorem**: the derivative of a function at a local extremum equals zero. -/
theorem IsLocalExtr.hasDerivAt_eq_zero (h : IsLocalExtr f a) : HasDerivAt f f' a → f' = 0

{f : ℝ → ℝ}
{f' a : ℝ}
(h : IsLocalExtr f a)


theorem isSupported_one : IsSupported 1 s


theorem norm_real (r : ℝ) : ‖(r : ℂ)‖ = ‖r‖


/-- A CHSH tuple in a *-monoid consists of 4 self-adjoint involutions `A₀ A₁ B₀ B₁` such that
the `Aᵢ` commute with the `Bⱼ`.

The physical interpretation is that `A₀` and `A₁` are a pair of boolean observables which
are spacelike separated from another pair `B₀` and `B₁` of boolean observables.
-/
--@[nolint has_nonempty_instance] Porting note(#5171): linter not ported yet
structure IsCHSHTuple {R} [Monoid R] [StarMul R] (A₀ A₁ B₀ B₁ : R) : Prop where
  A₀_inv : A₀ ^ 2 = 1
  A₁_inv : A₁ ^ 2 = 1
  B₀_inv : B₀ ^ 2 = 1
  B₁_inv : B₁ ^ 2 = 1
  A₀_sa : star A₀ = A₀
  A₁_sa : star A₁ = A₁
  B₀_sa : star B₀ = B₀
  B₁_sa : star B₁ = B₁
  A₀B₀_commutes : A₀ * B₀ = B₀ * A₀
  A₀B₁_commutes : A₀ * B₁ = B₁ * A₀
  A₁B₀_commutes : A₁ * B₀ = B₀ * A₁
  A₁B₁_commutes : A₁ * B₁ = B₁ * A₁

{R : Type u_1}
[Monoid R]
[StarMul R]
{A₀ A₁ B₀ B₁ : R}
(self : IsCHSHTuple A₀ A₁ B₀ B₁)


theorem AECover.aestronglyMeasurable {β : Type*} [TopologicalSpace β] [PseudoMetrizableSpace β]
    [l.IsCountablyGenerated] [l.NeBot] {f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
    (hfm : ∀ i, AEStronglyMeasurable f (μ.restrict <| φ i)) : AEStronglyMeasurable f μ

(hfm : ∀ (i : ι), MeasureTheory.AEStronglyMeasurable f (μ.restrict (φ i)))


@[simp] theorem isOpen_univ : IsOpen (univ : Set X)


@[simp]
theorem choose_one_right' (r : R) : choose r 1 = r ^ 1

{R : Type u_1}
[NonAssocRing R]
[Pow R ℕ]
[BinomialRing R]
(r : R)


/-- The preimage of the normalizer is equal to the normalizer of the preimage of a surjective
  function. -/
@[to_additive
      "The preimage of the normalizer is equal to the normalizer of the preimage of
      a surjective function."]
theorem comap_normalizer_eq_of_surjective (H : Subgroup G) {f : N →* G}
    (hf : Function.Surjective f) : H.normalizer.comap f = (H.comap f).normalizer

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(H : Subgroup G)
{f : N →* G}
(hf : Function.Surjective ⇑f)

Subgroup.comap f H.normalizer = (Subgroup.comap f H).normalizer


@[norm_cast]
theorem eq_iff {x y : 𝓞 K} : (x : K) = (y : K) ↔ x = y

{K : Type u_1}
[Field K]
{x y : NumberField.RingOfIntegers K}


@[to_additive]
theorem smul_subset_of_coprime (han : (orderOf a).Coprime n) :
    a • approxOrderOf A n δ ⊆ approxOrderOf A (orderOf a * n) δ

{A : Type u_1}
[SeminormedAddCommGroup A]
{a : A}
{n : ℕ}
(δ : ℝ)
(han : (addOrderOf a).Coprime n)

a +ᵥ approxAddOrderOf A n δ ⊆ approxAddOrderOf A (addOrderOf a * n) δ


theorem RingHom.IsIntegralElem.sub {x y : S} (hx : f.IsIntegralElem x) (hy : f.IsIntegralElem y) :
    f.IsIntegralElem (x - y)

{R : Type u_1}
{S : Type u_4}
[CommRing R]
[CommRing S]
(f : R →+* S)
{x y : S}
(hx : f.IsIntegralElem x)
(hy : f.IsIntegralElem y)


lemma aeval_derivative_mem_differentIdeal [NoZeroSMulDivisors A B]
    (x : B) (hx : Algebra.adjoin K {algebraMap B L x} = ⊤) :
    aeval x (derivative (minpoly A x)) ∈ differentIdeal A B

(hx : Algebra.adjoin K {(algebraMap B L) x} = ⊤)

(Polynomial.aeval x) (Polynomial.derivative (minpoly A x)) ∈ differentIdeal A B


@[simp]
theorem mk_coe (e : A₁ ≃ₐ[R] A₂) (e' h₁ h₂ h₃ h₄ h₅) :
    (⟨⟨e, e', h₁, h₂⟩, h₃, h₄, h₅⟩ : A₁ ≃ₐ[R] A₂) = e

(h₃ :
  ∀ (x y : A₁),
    { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun (x * y) =
      { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun x *
        { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun y)

(h₄ :
  ∀ (x y : A₁),
    { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun (x + y) =
      { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun x +
        { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun y)

(h₅ :
  ∀ (r : R),
    { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun ((algebraMap R A₁) r) = (algebraMap R A₂) r)

{ toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄, commutes' := h₅ } = e


protected theorem pow_lt_pow_succ (h : 1 < a) : a ^ n < a ^ (n + 1)


/-- A semigroup homomorphism `f : M →ₙ* N` such that `f x` commutes with `f y` for all `x, y`
defines a semigroup homomorphism to `Nᵐᵒᵖ`. -/
@[to_additive (attr := simps (config := .asFn))
      "An additive semigroup homomorphism `f : AddHom M N` such that `f x` additively
      commutes with `f y` for all `x, y` defines an additive semigroup homomorphism to `Sᵃᵒᵖ`."]
def MulHom.toOpposite {M N : Type*} [Mul M] [Mul N] (f : M →ₙ* N)
    (hf : ∀ x y, Commute (f x) (f y)) : M →ₙ* Nᵐᵒᵖ

(hf : ∀ (x y : M), AddCommute (f x) (f y))

⇑(f.toOpposite hf) = AddOpposite.op ∘ ⇑f


protected theorem Codisjoint.bihimp_left (ha : Codisjoint a c) (hb : Codisjoint b c) :
    Codisjoint (a ⇔ b) c

{α : Type u_2}
[BooleanAlgebra α]
{a b c : α}
(ha : Codisjoint a c)
(hb : Codisjoint b c)


@[simp]
theorem X_dvd_monomial {i : σ} {j : σ →₀ ℕ} {r : R} :
    (X i : MvPolynomial σ R) ∣ monomial j r ↔ r = 0 ∨ j i ≠ 0

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
{i : σ}
{j : σ →₀ ℕ}
{r : R}

MvPolynomial.X i ∣ (MvPolynomial.monomial j) r ↔ r = 0 ∨ j i ≠ 0


/-- The embedding of `α` into the sum `α ⊕ β`. -/
@[simps]
def inl {α β : Type*} : α ↪ α ⊕ β

Function.Embedding.inl val = Sum.inl val


theorem liftPropWithinAt_self {f : H → H'} {s : Set H} {x : H} :
    LiftPropWithinAt P f s x ↔ ContinuousWithinAt f s x ∧ P f s x

{H : Type u_1}
{H' : Type u_3}
[TopologicalSpace H]
[TopologicalSpace H']
{P : (H → H') → Set H → H → Prop}
{f : H → H'}
{s : Set H}
{x : H}

ChartedSpace.LiftPropWithinAt P f s x ↔ ContinuousWithinAt f s x ∧ P f s x


lemma tendsto_densityProcess_limitProcess (hκν : fst κ ≤ ν)
    [IsFiniteKernel ν] (a : α) {s : Set β} (hs : MeasurableSet s) :
    ∀ᵐ x ∂(ν a), Tendsto (fun n ↦ densityProcess κ ν n a x s) atTop
      (𝓝 ((countableFiltration γ).limitProcess
      (fun n x ↦ densityProcess κ ν n a x s) (ν a) x))

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

∀ᵐ (x : γ) ∂ν a,
  Filter.Tendsto (fun n => κ.densityProcess ν n a x s) Filter.atTop
    (𝓝
      (MeasureTheory.Filtration.limitProcess (fun n x => κ.densityProcess ν n a x s)
        (ProbabilityTheory.countableFiltration γ) (ν a) x))


/-- A constructor for `IsSplitMono f` taking a `SplitMono f` as an argument -/
theorem IsSplitMono.mk' {X Y : C} {f : X ⟶ Y} (sm : SplitMono f) : IsSplitMono f

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


@[simp] lemma map'_coe (f : α →* β) (x : α) : map' f (x : WithZero α) = f x

{α : Type u_1}
{β : Type u_2}
[MulOneClass α]
[MulOneClass β]
(f : α →* β)
(x : α)


/-- Order equipped with a sensible predecessor function. -/
@[ext]
class PredOrder (α : Type*) [Preorder α] where
  /-- Predecessor function-/
  pred : α → α
  /-- Proof of basic ordering with respect to `pred`-/
  pred_le : ∀ a, pred a ≤ a
  /-- Proof of interaction between `pred` and minimal element-/
  min_of_le_pred {a} : a ≤ pred a → IsMin a
  /-- Proof that `pred` satisfies ordering invariants between `LT` and `LE`-/
  le_pred_of_lt {a b} : a < b → a ≤ pred b
  /-- Proof that `pred` satisfies ordering invariants between `LE` and `LT`-/
  le_of_pred_lt {a b} : pred a < b → a ≤ b

{α : Type u_3}
[Preorder α]
[self : PredOrder α]
{a : α}


theorem isNat_zero (α) [AddMonoidWithOne α] : IsNat (Zero.zero : α) (nat_lit 0)


theorem Periodic.sub_nat_mul_eq [Ring α] (h : Periodic f c) (n : ℕ) : f (x - n * c) = f x

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c x : α}
[Ring α]
(h : Function.Periodic f c)
(n : ℕ)


/-- The finrank of a free module `M` over `R` is the cardinality of `ChooseBasisIndex R M`. -/
theorem _root_.FiniteDimensional.finrank_eq_card_chooseBasisIndex [Module.Finite R M] :
    finrank R M = Fintype.card (ChooseBasisIndex R M)

(R : Type u)
(M : Type v)
[Ring R]
[StrongRankCondition R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]

FiniteDimensional.finrank R M = Fintype.card (Module.Free.ChooseBasisIndex R M)


/-- Construct limit data for a product in `ModuleCat R`, using `ModuleCat.of R (∀ j, F.obj j)`.
-/
@[simps]
def productLimitCone : Limits.LimitCone (Discrete.functor f)

{R : Type u}
[Ring R]
{J : Type w}
(f : J → ModuleCat R)

(ModuleCat.HasLimit.productLimitCone f).cone.pt = ModuleCat.of R ((j : J) → ↑(f j))


@[to_additive (attr := simp)]
theorem semiconjBy_iff_eq [CancelCommMonoid M] {a x y : M} : SemiconjBy a x y ↔ x = y

{M : Type u_2}
[AddCancelCommMonoid M]
{a x y : M}


/-- (Impl) Construct the lifted cocone in `Coalgebra T` which will be colimiting. -/
@[simps]
def liftedCocone : Cocone D

(D : CategoryTheory.Functor J T.Coalgebra)

(c : CategoryTheory.Limits.Cocone (D.comp T.forget))

((CategoryTheory.Comonad.ForgetCreatesColimits'.liftedCocone D c t).ι.app j).f = c.ι.app j


@[to_additive]
theorem of_mulOpposite (h : TwoUniqueProds Gᵐᵒᵖ) : TwoUniqueProds G

{G : Type u}
[Add G]
(h : TwoUniqueSums Gᵃᵒᵖ)


/-- `∏ i, (1 - f i) = 1 - ∑ i, f i * (∏ j < i, 1 - f j)`. This formula is useful in construction of
a partition of unity from a collection of “bump” functions.  -/
theorem prod_one_sub_ordered [LinearOrder ι] (s : Finset ι) (f : ι → α) :
    ∏ i ∈ s, (1 - f i) = 1 - ∑ i ∈ s, f i * ∏ j ∈ s.filter (· < i), (1 - f j)

{ι : Type u_1}
{α : Type u_2}
[CommRing α]
[LinearOrder ι]
(s : Finset ι)
(f : ι → α)

∏ i ∈ s, (1 - f i) = 1 - ∑ i ∈ s, f i * ∏ j ∈ Finset.filter (fun x => x < i) s, (1 - f j)


theorem mkContinuous₂_norm_le' (f : E →ₛₗ[σ₁₃] F →ₛₗ[σ₂₃] G) {C : ℝ}
    (hC : ∀ x y, ‖f x y‖ ≤ C * ‖x‖ * ‖y‖) : ‖f.mkContinuous₂ C hC‖ ≤ max C 0

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

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

(f : E →ₛₗ[σ₁₃] F →ₛₗ[σ₂₃] G)

(hC : ∀ (x : E) (y : F), ‖(f x) y‖ ≤ C * ‖x‖ * ‖y‖)


theorem measure_closedBall_pos (x : X) {r : ℝ≥0∞} (hr : r ≠ 0) : 0 < μ (closedBall x r)

{X : Type u_1}
[PseudoEMetricSpace X]
{m : MeasurableSpace X}
(μ : MeasureTheory.Measure X)
[μ.IsOpenPosMeasure]
(x : X)
{r : ℝ≥0∞}
(hr : r ≠ 0)


theorem power_lt_aleph0 {a b : Cardinal} (ha : a < ℵ₀) (hb : b < ℵ₀) : a ^ b < ℵ₀

{a b : Cardinal.{u_1}}
(ha : a < Cardinal.aleph0)
(hb : b < Cardinal.aleph0)


theorem iInf_univ {f : β → α} : ⨅ x ∈ (univ : Set β), f x = ⨅ x, f x

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : β → α}


/-- Bundled monotone right-continuous real functions, used to construct Stieltjes measures. -/
structure StieltjesFunction where
  toFun : ℝ → ℝ
  mono' : Monotone toFun
  right_continuous' : ∀ x, ContinuousWithinAt toFun (Ici x) x


@[simp]
theorem antivary_toDual_left : Antivary (toDual ∘ f) g ↔ Monovary f g

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}

Antivary (⇑OrderDual.toDual ∘ f) g ↔ Monovary f g


lemma measurable (κ : Kernel α β) : Measurable κ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ : ProbabilityTheory.Kernel α β)


@[simp]
protected theorem zero (a : α) : multiplicity a 0 = ⊤

{α : Type u_1}
[MonoidWithZero α]
[DecidableRel fun x x_1 => x ∣ x_1]
(a : α)


protected theorem mvPolynomial (ι : Type*) [Finite ι] : FiniteType R (MvPolynomial ι R)

(R : Type uR)
[CommSemiring R]
(ι : Type u_1)
[Finite ι]


theorem smul_vec3 {R : Type*} [SMul R α] (x : R) (a₀ a₁ a₂ : α) :
    x • ![a₀, a₁, a₂] = ![x • a₀, x • a₁, x • a₂]

{α : Type u}
{R : Type u_1}
[SMul R α]
(x : R)
(a₀ a₁ a₂ : α)


protected theorem IsNClique.map (h : G.IsNClique n s) {f : α ↪ β} :
    (G.map f).IsNClique n (s.map f)

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{n : ℕ}
{s : Finset α}
(h : G.IsNClique n s)
{f : α ↪ β}

(SimpleGraph.map f G).IsNClique n (Finset.map f s)


theorem liftPropWithinAt_self_source {f : H → M'} {s : Set H} {x : H} :
    LiftPropWithinAt P f s x ↔ ContinuousWithinAt f s x ∧ P (chartAt H' (f x) ∘ f) s x

{H : Type u_1}
{H' : Type u_3}
{M' : Type u_4}
[TopologicalSpace H]
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
{P : (H → H') → Set H → H → Prop}
{f : H → M'}
{s : Set H}
{x : H}

ChartedSpace.LiftPropWithinAt P f s x ↔ ContinuousWithinAt f s x ∧ P (↑(chartAt H' (f x)) ∘ f) s x


@[simp]
theorem mem_bind {s : Set β} {f : Filter α} {m : α → Filter β} :
    s ∈ bind f m ↔ ∃ t ∈ f, ∀ x ∈ t, s ∈ m x

{α : Type u}
{β : Type v}
{s : Set β}
{f : Filter α}
{m : α → Filter β}

s ∈ f.bind m ↔ ∃ t ∈ f, ∀ x ∈ t, s ∈ m x


theorem antitone_le {x : α} : Antitone (· ≤ x)


lemma tendsto_inv_iff₀ {l : Filter α} {f : α → G₀} (hx : x ≠ 0) :
    Tendsto (fun x ↦ (f x)⁻¹) l (𝓝 x⁻¹) ↔ Tendsto f l (𝓝 x)

{α : Type u_1}
{G₀ : Type u_3}
[GroupWithZero G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
{x : G₀}
{l : Filter α}
{f : α → G₀}
(hx : x ≠ 0)

Filter.Tendsto (fun x => (f x)⁻¹) l (𝓝 x⁻¹) ↔ Filter.Tendsto f l (𝓝 x)


theorem one_le {a : Associates α} : 1 ≤ a

{α : Type u_1}
[CommMonoid α]
{a : Associates α}


theorem ascFactorial_lt_pow_add (n : ℕ) : ∀ {k : ℕ}, 2 ≤ k → (n + 1).ascFactorial k < (n + k) ^ k


/-- The edist is antitone with respect to inclusion. -/
theorem infEdist_anti (h : s ⊆ t) : infEdist x t ≤ infEdist x s

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{s t : Set α}
(h : s ⊆ t)

EMetric.infEdist x t ≤ EMetric.infEdist x s


/-- A vector addition is cancellative if it is pointwise injective on the left and right. -/
class IsCancelVAdd (G P : Type*) [VAdd G P] : Prop where
  protected left_cancel : ∀ (a : G) (b c : P), a +ᵥ b = a +ᵥ c → b = c
  protected right_cancel : ∀ (a b : G) (c : P), a +ᵥ c = b +ᵥ c → a = b

{G : Type u_3}
{P : Type u_4}
[VAdd G P]
[self : IsCancelVAdd G P]
(a b : G)
(c : P)


@[simp]
theorem projIcc_eq_one {x : ℝ} : projIcc (0 : ℝ) 1 zero_le_one x = 1 ↔ 1 ≤ x


/-- Mapping an equivalence `α ≃ β` using `Sym.map` gives an equivalence between `Sym α n` and
`Sym β n`. -/
@[simps]
def equivCongr (e : α ≃ β) : Sym α n ≃ Sym β n

{α : Type u_1}
{β : Type u_2}
{n : ℕ}
(e : α ≃ β)
(x : Sym β n)

(Sym.equivCongr e).symm x = Sym.map (⇑e.symm) x


theorem separatesPoints_def [MeasurableSpace α] [hs : SeparatesPoints α] {x y : α}
    (h : ∀ s, MeasurableSet s → (x ∈ s → y ∈ s)) : x = y

[hs : MeasurableSpace.SeparatesPoints α]

(h : ∀ (s : Set α), MeasurableSet s → x ∈ s → y ∈ s)


@[ext]
lemma ext {X Y : ∀ i, C i} {f g : X ⟶ Y} (w : ∀ i, f i = g i) : f = g

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


@[simp]
theorem length_pure : (pure a).length = 0

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


@[to_additive (attr := simp)]
theorem curry_one [∀ a b, One (γ a b)] : Sigma.curry (1 : (i : Σ a, β a) → γ i.1 i.2) = 1

{α : Type u_3}
{β : α → Type u_4}
{γ : (a : α) → β a → Type u_5}
[(a : α) → (b : β a) → Zero (γ a b)]


@[simp]
theorem nfp_mul_zero (a : Ordinal) : nfp (a * ·) 0 = 0


theorem moment_truncation_eq_intervalIntegral_of_nonneg (hf : AEStronglyMeasurable f μ) {A : ℝ}
    {n : ℕ} (hn : n ≠ 0) (h'f : 0 ≤ f) :
    ∫ x, truncation f A x ^ n ∂μ = ∫ y in (0)..A, y ^ n ∂Measure.map f μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

∫ (x : α), ProbabilityTheory.truncation f A x ^ n ∂μ = ∫ (y : ℝ) in 0 ..A, y ^ n ∂MeasureTheory.Measure.map f μ


protected theorem loopless (G' : Subgraph G) : Irreflexive G'.Adj

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


/-- A `DivisionSemiring` is a `Semiring` with multiplicative inverses for nonzero elements.

An instance of `DivisionSemiring K` includes maps `nnratCast : ℚ≥0 → K` and `nnqsmul : ℚ≥0 → K → K`.
Those two fields are needed to implement the `DivisionSemiring K → Algebra ℚ≥0 K` instance since we
need to control the specific definitions for some special cases of `K` (in particular `K = ℚ≥0`
itself). See also note [forgetful inheritance].

If the division semiring has positive characteristic `p`, our division by zero convention forces
`nnratCast (1 / p) = 1 / 0 = 0`. -/
class DivisionSemiring (α : Type*) extends Semiring α, GroupWithZero α, NNRatCast α where
  protected nnratCast := NNRat.castRec
  /-- However `NNRat.cast` is defined, it must be propositionally equal to `a / b`.

  Do not use this lemma directly. Use `NNRat.cast_def` instead. -/
  protected nnratCast_def (q : ℚ≥0) : (NNRat.cast q : α) = q.num / q.den := by intros; rfl
  /-- Scalar multiplication by a nonnegative rational number.

  Unless there is a risk of a `Module ℚ≥0 _` instance diamond, write `nnqsmul := _`. This will set
  `nnqsmul` to `(NNRat.cast · * ·)` thanks to unification in the default proof of `nnqsmul_def`.

  Do not use directly. Instead use the `•` notation. -/
  protected nnqsmul : ℚ≥0 → α → α
  /-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.

  Do not use this lemma directly. Use `NNRat.smul_def` instead. -/
  protected nnqsmul_def (q : ℚ≥0) (a : α) : nnqsmul q a = NNRat.cast q * a := by intros; rfl

{α : Type u_4}
[self : DivisionSemiring α]
(q : ℚ≥0)
(a : α)


theorem disjoint_of_disjoint_cons_right {l₁ l₂} : Disjoint l₁ (a :: l₂) → Disjoint l₁ l₂

∀ {α : Type u_1} {a : α} {l₁ l₂ : List α}, l₁.Disjoint (a :: l₂) → l₁.Disjoint l₂


@[to_additive]
lemma inv_eq_self (x : G) : x⁻¹ = x

{G : Type u_1}
[Group G]
[IsKleinFour G]
(x : G)


theorem comp_aemeasurable {f : α → δ} {g : δ → β} (hg : AEMeasurable g (μ.map f))
    (hf : AEMeasurable f μ) : AEMeasurable (g ∘ f) μ

(hg : AEMeasurable g (MeasureTheory.Measure.map f μ))


@[to_additive (attr := simp) norm_neg]
theorem norm_inv' (a : E) : ‖a⁻¹‖ = ‖a‖

{E : Type u_6}
[SeminormedAddGroup E]
(a : E)


theorem listLookup [DecidableEq α] : Primrec₂ (List.lookup : α → List (α × β) → Option β)

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
[DecidableEq α]


@[simp]
theorem mk_coe {f : A →ₐc[R] B} (h₀ h₁ h₂ h₃ h₄ h₅) :
    (⟨⟨⟨⟨f, h₀⟩, h₁⟩, h₂, h₃⟩, h₄, h₅⟩ : A →ₐc[R] B) = f

(h₀ : ∀ (x y : A), f (x + y) = f x + f y)

(h₁ :
  ∀ (m : R) (x : A),
    { toFun := ⇑f, map_add' := h₀ }.toFun (m • x) = (RingHom.id R) m • { toFun := ⇑f, map_add' := h₀ }.toFun x)

(h₂ : Coalgebra.counit ∘ₗ { toFun := ⇑f, map_add' := h₀, map_smul' := h₁ } = Coalgebra.counit)

(h₃ :
  TensorProduct.map { toFun := ⇑f, map_add' := h₀, map_smul' := h₁ } { toFun := ⇑f, map_add' := h₀, map_smul' := h₁ } ∘ₗ
      Coalgebra.comul =
    Coalgebra.comul ∘ₗ { toFun := ⇑f, map_add' := h₀, map_smul' := h₁ })

(h₄ : { toFun := ⇑f, map_add' := h₀, map_smul' := h₁, counit_comp := h₂, map_comp_comul := h₃ }.toFun 1 = 1)

(h₅ :
  ∀ (x y : A),
    { toFun := ⇑f, map_add' := h₀, map_smul' := h₁, counit_comp := h₂, map_comp_comul := h₃ }.toFun (x * y) =
      { toFun := ⇑f, map_add' := h₀, map_smul' := h₁, counit_comp := h₂, map_comp_comul := h₃ }.toFun x *
        { toFun := ⇑f, map_add' := h₀, map_smul' := h₁, counit_comp := h₂, map_comp_comul := h₃ }.toFun y)

{ toFun := ⇑f, map_add' := h₀, map_smul' := h₁, counit_comp := h₂, map_comp_comul := h₃, map_one' := h₄,
    map_mul' := h₅ } =
  f


lemma coeIdeal_differentIdeal [NoZeroSMulDivisors A B] :
    ↑(differentIdeal A B) = (FractionalIdeal.dual A K (1 : FractionalIdeal B⁰ L))⁻¹

(A : Type u_1)
(K : Type u_2)
(L : Type u)
(B : Type u_3)
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[IsFractionRing B L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsDedekindDomain B]
[NoZeroSMulDivisors A B]

↑(differentIdeal A B) = (FractionalIdeal.dual A K 1)⁻¹


@[simp]
theorem adjoin_empty : adjoin R (∅ : Set A) = ⊥

(R : Type u)
(A : Type v)
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]


@[simp, norm_cast]
theorem ofENat_ofNat (n : Nat) [n.AtLeastTwo] : ofENat (no_index (OfNat.ofNat n)) = OfNat.ofNat n


theorem FarFromTriangleFree.cliqueFinset_nonempty [DecidableEq α]
    (hG : G.FarFromTriangleFree ε) (hε : 0 < ε) : (G.cliqueFinset 3).Nonempty

{α : Type u_1}
{𝕜 : Type u_3}
[LinearOrderedField 𝕜]
{G : SimpleGraph α}
{ε : 𝕜}
[Fintype α]
[DecidableRel G.Adj]
[Nonempty α]
[DecidableEq α]
(hG : G.FarFromTriangleFree ε)
(hε : 0 < ε)


/-- If the restriction to an `m`-measurable set `s` of a σ-algebra `m` is equal to the restriction
to `s` of another σ-algebra `m₂` (hypothesis `hs`), then `μ[f | m] =ᵐ[μ.restrict s] μ[f | m₂]`. -/
theorem condexp_ae_eq_restrict_of_measurableSpace_eq_on {m m₂ m0 : MeasurableSpace α}
    {μ : Measure α} (hm : m ≤ m0) (hm₂ : m₂ ≤ m0) [SigmaFinite (μ.trim hm)]
    [SigmaFinite (μ.trim hm₂)] (hs_m : MeasurableSet[m] s)
    (hs : ∀ t, MeasurableSet[m] (s ∩ t) ↔ MeasurableSet[m₂] (s ∩ t)) :
    μ[f|m] =ᵐ[μ.restrict s] μ[f|m₂]

(hs : ∀ (t : Set α), MeasurableSet (s ∩ t) ↔ MeasurableSet (s ∩ t))


@[simp] lemma image_toEnumFinset_fst (m : Multiset α) :
    m.toEnumFinset.image Prod.fst = m.toFinset

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

Finset.image Prod.fst m.toEnumFinset = m.toFinset


lemma coroot_eq_coreflection_of_root_eq
    {i j k : ι} (hk : P.root k = P.reflection i (P.root j)) :
    P.coroot k = P.coreflection i (P.coroot j)

(hk : P.root k = (P.reflection i) (P.root j))

P.coroot k = (P.coreflection i) (P.coroot j)


/-- Characterization of C^n sections of a smooth vector bundle. -/
theorem contMDiffAt_section (s : ∀ x, E x) (x₀ : B) :
    ContMDiffAt IB (IB.prod 𝓘(𝕜, F)) n (fun x => TotalSpace.mk' F x (s x)) x₀ ↔
      ContMDiffAt IB 𝓘(𝕜, F) n (fun x ↦ (trivializationAt F E x₀ ⟨x, s x⟩).2) x₀

[TopologicalSpace (Bundle.TotalSpace F E)]

ContMDiffAt IB (IB.prod 𝓘(𝕜, F)) n (fun x => Bundle.TotalSpace.mk' F x (s x)) x₀ ↔
  ContMDiffAt IB 𝓘(𝕜, F) n (fun x => (↑(trivializationAt F E x₀) { proj := x, snd := s x }).2) x₀


@[simp, reassoc]
theorem pullbackFstιToV_snd (i j : 𝒰.J) :
    pullbackFstιToV 𝒰 f g i j ≫ pullback.snd _ _ = pullback.fst _ _ ≫ pullback.snd _ _

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

AlgebraicGeometry.Scheme.Pullback.pullbackFstιToV 𝒰 f g i j ≫
    CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.fst (𝒰.map j ≫ f) g ≫ 𝒰.map j) (𝒰.map i) =
  CategoryTheory.Limits.pullback.fst
      (CategoryTheory.Limits.pullback.fst (AlgebraicGeometry.Scheme.Pullback.p1 𝒰 f g) (𝒰.map i))
      ((AlgebraicGeometry.Scheme.Pullback.gluing 𝒰 f g).ι j) ≫
    CategoryTheory.Limits.pullback.snd (AlgebraicGeometry.Scheme.Pullback.p1 𝒰 f g) (𝒰.map i)


theorem IsNormal.bsup_eq {f : Ordinal.{u} → Ordinal.{max u v}} (H : IsNormal f) {o : Ordinal.{u}}
    (h : IsLimit o) : (Ordinal.bsup.{_, v} o fun x _ => f x) = f o

{f : Ordinal.{u} → Ordinal.{max u v}}
(H : Ordinal.IsNormal f)
{o : Ordinal.{u}}
(h : o.IsLimit)


theorem mem_univ_Ioc {I : Box ι} : (x ∈ pi univ fun i ↦ Ioc (I.lower i) (I.upper i)) ↔ x ∈ I

{ι : Type u_1}
{x : ι → ℝ}
{I : BoxIntegral.Box ι}

(x ∈ Set.univ.pi fun i => Set.Ioc (I.lower i) (I.upper i)) ↔ x ∈ I


/-- If `f` has dense range and `s` is an open set in the codomain of `f`, then the image of the
preimage of `s` under `f` is dense in `s`. -/
theorem DenseRange.subset_closure_image_preimage_of_isOpen (hf : DenseRange f) (hs : IsOpen s) :
    s ⊆ closure (f '' (f ⁻¹' s))

{X : Type u_1}
[TopologicalSpace X]
{α : Type u_4}
{f : α → X}
{s : Set X}
(hf : DenseRange f)
(hs : IsOpen s)


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

{R₁ : Type u_3}
{M₁ : Type u_4}
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
{B₁ : LinearMap.BilinForm R₁ M₁}
(H : B₁.IsAlt)
{x y : M₁}


@[simp]
theorem DifferentiableAt.cexp (hc : DifferentiableAt 𝕜 f x) :
    DifferentiableAt 𝕜 (fun x => Complex.exp (f x)) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[NormedAlgebra 𝕜 ℂ]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : E → ℂ}
{x : E}
(hc : DifferentiableAt 𝕜 f x)


@[simp]
theorem «exists» {p : (Σa, β a) → Prop} : (∃ x, p x) ↔ ∃ a b, p ⟨a, b⟩

{α : Type u_1}
{β : α → Type u_4}
{p : (a : α) × β a → Prop}


/-- If `p` is a prime such that `¬ p ∣ n`, then
`expand R p (cyclotomic n R) = (cyclotomic (n * p) R) * (cyclotomic n R)`. -/
@[simp]
theorem cyclotomic_expand_eq_cyclotomic_mul {p n : ℕ} (hp : Nat.Prime p) (hdiv : ¬p ∣ n)
    (R : Type*) [CommRing R] :
    expand R p (cyclotomic n R) = cyclotomic (n * p) R * cyclotomic n R

{p n : ℕ}
(hp : Nat.Prime p)
(hdiv : ¬p ∣ n)
(R : Type u_1)
[CommRing R]

(Polynomial.expand R p) (Polynomial.cyclotomic n R) = Polynomial.cyclotomic (n * p) R * Polynomial.cyclotomic n R


@[to_additive (attr := ext 1100)]
theorem hom_ext {β : Type v} [Mul β] {f g : FreeMagma α →ₙ* β} (h : f ∘ of = g ∘ of) : f = g

(h : ⇑f ∘ FreeMagma.of = ⇑g ∘ FreeMagma.of)


theorem infiniteNeg_iff_infinite_of_neg {x : ℝ*} (hn : x < 0) : InfiniteNeg x ↔ Infinite x


@[simp]
theorem toContinuousAffineMap_map_zero (f : V →L[R] W) : f.toContinuousAffineMap 0 = 0

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace V]
[AddCommGroup W]
[Module R W]
[TopologicalSpace W]
(f : V →L[R] W)


theorem EqOn.piecewise_ite {f f' g : α → β} {t t'} (h : EqOn f g t) (h' : EqOn f' g t') :
    EqOn (s.piecewise f f') g (s.ite t t')

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

Set.EqOn (s.piecewise f f') g (s.ite t t')


/-- A Boolean algebra is a bounded distributive lattice with a complement operator `ᶜ` such that
`x ⊓ xᶜ = ⊥` and `x ⊔ xᶜ = ⊤`. For convenience, it must also provide a set difference operation `\`
and a Heyting implication `⇨` satisfying `x \ y = x ⊓ yᶜ` and `x ⇨ y = y ⊔ xᶜ`.

This is a generalization of (classical) logic of propositions, or the powerset lattice.

Since `BoundedOrder`, `OrderBot`, and `OrderTop` are mixins that require `LE`
to be present at define-time, the `extends` mechanism does not work with them.
Instead, we extend using the underlying `Bot` and `Top` data typeclasses, and replicate the
order axioms of those classes here. A "forgetful" instance back to `BoundedOrder` is provided.
-/
class BooleanAlgebra (α : Type u) extends
    DistribLattice α, HasCompl α, SDiff α, HImp α, Top α, Bot α where
  /-- The infimum of `x` and `xᶜ` is at most `⊥` -/
  inf_compl_le_bot : ∀ x : α, x ⊓ xᶜ ≤ ⊥
  /-- The supremum of `x` and `xᶜ` is at least `⊤` -/
  top_le_sup_compl : ∀ x : α, ⊤ ≤ x ⊔ xᶜ
  /-- `⊤` is the greatest element -/
  le_top : ∀ a : α, a ≤ ⊤
  /-- `⊥` is the least element -/
  bot_le : ∀ a : α, ⊥ ≤ a
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff := fun x y => x ⊓ yᶜ
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp := fun x y => y ⊔ xᶜ
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff_eq : ∀ x y : α, x \ y = x ⊓ yᶜ := by aesop
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp_eq : ∀ x y : α, x ⇨ y = y ⊔ xᶜ := by aesop

{α : Type u}
[self : BooleanAlgebra α]
(x : α)


@[simp, mfld_simps]
theorem invFun_eq_coe (e : PartialHomeomorph X Y) : e.invFun = e.symm

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)


theorem prod_factorial_dvd_factorial_sum : (∏ i ∈ s, (f i)!) ∣ (∑ i ∈ s, f i)!

{α : Type u_1}
(s : Finset α)
(f : α → ℕ)


/-- Constructor for isomorphisms in `GradedObject` -/
@[simps]
def isoMk (e : ∀ i, X i ≅ Y i) : X ≅ Y

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{β : Type u_1}
(X Y : CategoryTheory.GradedObject β C)
(e : (i : β) → X i ≅ Y i)
(i : β)


theorem eq_pow_of_pow_eq_one {k : ℕ} {ζ ξ : R} (h : IsPrimitiveRoot ζ k) (hξ : ξ ^ k = 1)
    (h0 : 0 < k) : ∃ i < k, ζ ^ i = ξ

{R : Type u_4}
[CommRing R]
[IsDomain R]
{k : ℕ}
{ζ ξ : R}
(h : IsPrimitiveRoot ζ k)
(hξ : ξ ^ k = 1)
(h0 : 0 < k)


@[continuity, fun_prop]
-- Porting note: the proof was `continuous_sup_rng_right continuous_coinduced_rng`
theorem continuous_inr : Continuous (@inr X Y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


/-- When the second map `S.g` is zero, this is the right homology data on `S` given
by any colimit cokernel cofork of `S.g` -/
@[simps]
def ofIsColimitCokernelCofork (hg : S.g = 0) (c : CokernelCofork S.f) (hc : IsColimit c) :
    S.RightHomologyData

(c : CategoryTheory.Limits.CokernelCofork S.f)

(hc : CategoryTheory.Limits.IsColimit c)

(CategoryTheory.ShortComplex.RightHomologyData.ofIsColimitCokernelCofork S hg c hc).H = c.pt


@[to_additive]
theorem eq_top_iff' : S = ⊤ ↔ ∀ x : M, x ∈ S

{M : Type u_1}
[Mul M]
(S : Subsemigroup M)


@[simp] lemma smul_invOf_smul : c • (⅟ c • x) = x

{α : Type u_1}
{β : Type u_2}
[Monoid α]
[MulAction α β]
(c : α)
(x : β)
[Invertible c]


@[simp]
theorem range_list_getI [Inhabited α] (l : List α) :
    range l.getI = insert default { x | x ∈ l }

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

Set.range l.getI = insert default {x | x ∈ l}


theorem forall₂_true_iff {β : α → Sort*} : (∀ a, β a → True) ↔ True


@[simp]
theorem coe_comp (f : sSupHom β γ) (g : sSupHom α β) : ⇑(f.comp g) = f ∘ g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SupSet α]
[SupSet β]
[SupSet γ]
(f : sSupHom β γ)
(g : sSupHom α β)


theorem union_cylinder_same (s : Finset ι) (S₁ : Set (∀ i : s, α i)) (S₂ : Set (∀ i : s, α i)) :
    cylinder s S₁ ∪ cylinder s S₂ = cylinder s (S₁ ∪ S₂)

(S₁ S₂ : Set ((i : { x // x ∈ s }) → α ↑i))

MeasureTheory.cylinder s S₁ ∪ MeasureTheory.cylinder s S₂ = MeasureTheory.cylinder s (S₁ ∪ S₂)


@[simp, mfld_simps]
theorem refl_symm : (PartialHomeomorph.refl X).symm = PartialHomeomorph.refl X


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

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


@[simp]
theorem empty_val : (∅ : Finset α).1 = 0


theorem ker_lsmul [NoZeroSMulDivisors R M] {a : R} (ha : a ≠ 0) :
    LinearMap.ker (LinearMap.lsmul R M a) = ⊥

{R : Type u_1}
{M : Type u_5}
[CommRing R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{a : R}
(ha : a ≠ 0)

LinearMap.ker ((LinearMap.lsmul R M) a) = ⊥


theorem liftIoc_coe_apply {f : 𝕜 → B} {x : 𝕜} (hx : x ∈ Ioc a (a + p)) :
    liftIoc p a f ↑x = f x

{𝕜 : Type u_1}
{B : Type u_2}
[LinearOrderedAddCommGroup 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{p : 𝕜}
[hp : Fact (0 < p)]
{a : 𝕜}
[Archimedean 𝕜]
{f : 𝕜 → B}
{x : 𝕜}
(hx : x ∈ Set.Ioc a (a + p))


/-- linear equivalences between `Module`s are the same as (isomorphic to) isomorphisms
in `ModuleCat` -/
@[simps]
def linearEquivIsoModuleIso {X Y : Type u} [AddCommGroup X] [AddCommGroup Y] [Module R X]
    [Module R Y] : (X ≃ₗ[R] Y) ≅ ModuleCat.of R X ≅ ModuleCat.of R Y

{R : Type u}
[Ring R]
{X Y : Type u}
[AddCommGroup X]
[AddCommGroup Y]
[Module R X]
[Module R Y]
(e : X ≃ₗ[R] Y)

linearEquivIsoModuleIso.hom e = e.toModuleIso


@[simp] theorem gaugeRescale_zero (s t : Set E) : gaugeRescale s t 0 = 0

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
(s t : Set E)


theorem rcomap_sets (r : Rel α β) (f : Filter β) :
    (rcomap r f).sets = Rel.image (fun s t => r.core s ⊆ t) f.sets

{α : Type u}
{β : Type v}
(r : Rel α β)
(f : Filter β)

(Filter.rcomap r f).sets = Rel.image (fun s t => r.core s ⊆ t) f.sets


@[to_additive (attr := simp)]
theorem one_comp [MulOneClass M] [MulOneClass N] [MulOneClass P] (f : M →* N) :
    (1 : N →* P).comp f = 1

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
(f : M →+ N)


theorem smul_monomial {S₁ : Type*} [SMulZeroClass S₁ R] (r : S₁) :
    r • monomial s a = monomial s (r • a)

{R : Type u}
{σ : Type u_1}
{a : R}
{s : σ →₀ ℕ}
[CommSemiring R]
{S₁ : Type u_2}
[SMulZeroClass S₁ R]
(r : S₁)

r • (MvPolynomial.monomial s) a = (MvPolynomial.monomial s) (r • a)


theorem false_of_a_eq_not_a {a : Prop} (h : a = Not a) : False


@[to_additive (attr := simp) mod_addOrderOf_nsmul]
lemma pow_mod_orderOf (x : G) (n : ℕ) : x ^ (n % orderOf x) = x ^ n

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


theorem Sphere.center_eq_iff_eq_of_mem {s₁ s₂ : Sphere P} {p : P} (hs₁ : p ∈ s₁) (hs₂ : p ∈ s₂) :
    s₁.center = s₂.center ↔ s₁ = s₂

{P : Type u_2}
[MetricSpace P]
{s₁ s₂ : EuclideanGeometry.Sphere P}
{p : P}
(hs₁ : p ∈ s₁)
(hs₂ : p ∈ s₂)


@[simp]
theorem coe_toNonUnitalStarAlgHom (f : A →⋆ₐ[R] B) : (f.toNonUnitalStarAlgHom : A → B) = f

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Star A]
[Semiring B]
[Algebra R B]
[Star B]
(f : A →⋆ₐ[R] B)


@[simp] lemma snd_prod (κ : Kernel α β) [IsMarkovKernel κ] (η : Kernel α γ) [IsSFiniteKernel η] :
    snd (κ ×ₖ η) = η

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
(κ : ProbabilityTheory.Kernel α β)
[ProbabilityTheory.IsMarkovKernel κ]
(η : ProbabilityTheory.Kernel α γ)
[ProbabilityTheory.IsSFiniteKernel η]


/-- There are several equivalent ways to say that a number `z` is in fact a real number. -/
theorem is_real_TFAE (z : K) : TFAE [conj z = z, ∃ r : ℝ, (r : K) = z, ↑(re z) = z, im z = 0]

[(starRingEnd K) z = z, ∃ r, ↑r = z, ↑(RCLike.re z) = z, RCLike.im z = 0].TFAE


theorem tendsto_atTop_atBot_iff_of_antitone [Nonempty α] [SemilatticeSup α] [Preorder β] {f : α → β}
    (hf : Antitone f) : Tendsto f atTop atBot ↔ ∀ b : β, ∃ a : α, f a ≤ b

{α : Type u_3}
{β : Type u_4}
[Nonempty α]
[SemilatticeSup α]
[Preorder β]
{f : α → β}
(hf : Antitone f)

Filter.Tendsto f Filter.atTop Filter.atBot ↔ ∀ (b : β), ∃ a, f a ≤ b


theorem integral_one_div_of_pos (ha : 0 < a) (hb : 0 < b) :
    ∫ x : ℝ in a..b, 1 / x = log (b / a)

∫ (x : ℝ) in a..b, 1 / x = Real.log (b / a)


theorem disjoint_pi_univ_Ioc_update_left_right {x y : ∀ i, α i} {i₀ : ι} {m : α i₀} :
    Disjoint (pi univ fun i ↦ Ioc (x i) (update y i₀ m i))
    (pi univ fun i ↦ Ioc (update x i₀ m i) (y i))

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Preorder (α i)]
[DecidableEq ι]
{x y : (i : ι) → α i}
{i₀ : ι}
{m : α i₀}

Disjoint (Set.univ.pi fun i => Set.Ioc (x i) (Function.update y i₀ m i))
  (Set.univ.pi fun i => Set.Ioc (Function.update x i₀ m i) (y i))


@[simp]
theorem deleteEdges_deleteEdges (s s' : Set (Sym2 V)) :
    (G'.deleteEdges s).deleteEdges s' = G'.deleteEdges (s ∪ s')

{V : Type u}
{G : SimpleGraph V}
{G' : G.Subgraph}
(s s' : Set (Sym2 V))


@[simp]
theorem coe_symm_trans (e₁ : P ≃ᵃⁱ[𝕜] P₂) (e₂ : P₂ ≃ᵃⁱ[𝕜] P₃) :
    ⇑(e₁.trans e₂).symm = e₁.symm ∘ e₂.symm

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{V₃ : Type u_6}
{P : Type u_10}
{P₂ : Type u_11}
{P₃ : Type u_12}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
[SeminormedAddCommGroup V₃]
[NormedSpace 𝕜 V₃]
[PseudoMetricSpace P₃]
[NormedAddTorsor V₃ P₃]
(e₁ : P ≃ᵃⁱ[𝕜] P₂)
(e₂ : P₂ ≃ᵃⁱ[𝕜] P₃)

⇑(e₁.trans e₂).symm = ⇑e₁.symm ∘ ⇑e₂.symm


theorem image_ι_comp_eq_zero {X Y Z : C} {f : X ⟶ Y} {g : Y ⟶ Z} [HasImage f]
    [Epi (factorThruImage f)] (h : f ≫ g = 0) : image.ι f ≫ g = 0


theorem algEquiv_mk (x y) : algEquiv M S (mk x y) = mk' S x y

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

(Localization.algEquiv M S) (Localization.mk x y) = IsLocalization.mk' S x y


theorem append_inj_left' (h : s₁ ++ t₁ = s₂ ++ t₂) (hl : length t₁ = length t₂) : s₁ = s₂

∀ {α : Type u_1} {s₁ t₁ s₂ t₂ : List α}, s₁ ++ t₁ = s₂ ++ t₂ → t₁.length = t₂.length → s₁ = s₂


@[simp] theorem ofBaseChange_tmul_ι (Q : QuadraticForm R V) (z : A) (v : V) :
    ofBaseChange A Q (z ⊗ₜ ι Q v) = ι (Q.baseChange A) (z ⊗ₜ v)

{R : Type u_1}
(A : Type u_2)
{V : Type u_3}
[CommRing R]
[CommRing A]
[AddCommGroup V]
[Algebra R A]
[Module R V]
[Invertible 2]
(Q : QuadraticForm R V)
(z : A)
(v : V)

(CliffordAlgebra.ofBaseChange A Q) (z ⊗ₜ[R] (CliffordAlgebra.ι Q) v) =
  (CliffordAlgebra.ι (QuadraticForm.baseChange A Q)) (z ⊗ₜ[R] v)


theorem setIntegral_neg_eq_setIntegral_nonpos [LinearOrder E] {f : X → E}
    (hf : AEStronglyMeasurable f μ) :
    ∫ x in {x | f x < 0}, f x ∂μ = ∫ x in {x | f x ≤ 0}, f x ∂μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

∫ (x : X) in {x | f x < 0}, f x ∂μ = ∫ (x : X) in {x | f x ≤ 0}, f x ∂μ


@[to_additive]
theorem ball_mul_singleton : ball x δ * {y} = ball (x * y) δ

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

Metric.ball x δ * {y} = Metric.ball (x * y) δ


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

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

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


@[to_additive (attr := simp, norm_cast)]
theorem min_val [Monoid α] [LinearOrder α] {a b : αˣ} : (min a b).val = min a.val b.val

{α : Type u_1}
[Monoid α]
[LinearOrder α]
{a b : αˣ}


theorem forall_sum {γ : α ⊕ β → Sort _} (p : (∀ ab, γ ab) → Prop) :
    (∀ fab, p fab) ↔ (∀ fa fb, p (Sum.rec fa fb))

{α : Type u_1}
{β : Type u_2}
{γ : α ⊕ β → Sort u_3}
(p : ((ab : α ⊕ β) → γ ab) → Prop)

(∀ (fab : (ab : α ⊕ β) → γ ab), p fab) ↔
  ∀ (fa : (val : α) → γ (Sum.inl val)) (fb : (val : β) → γ (Sum.inr val)), p fun t => Sum.rec fa fb t


theorem hitting_eq_end_iff {m : ι} : hitting u s n m ω = m ↔
    (∃ j ∈ Set.Icc n m, u j ω ∈ s) → sInf (Set.Icc n m ∩ {i : ι | u i ω ∈ s}) = m

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[ConditionallyCompleteLinearOrder ι]
{u : ι → Ω → β}
{s : Set β}
{n : ι}
{ω : Ω}
{m : ι}

MeasureTheory.hitting u s n m ω = m ↔ (∃ j ∈ Set.Icc n m, u j ω ∈ s) → sInf (Set.Icc n m ∩ {i | u i ω ∈ s}) = m


/-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories
    `Comma L R₁ ≌ Comma L R₂`. -/
@[simps!]
def mapRightIso (i : R₁ ≅ R₂) : 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]
(L : CategoryTheory.Functor A T)
{R₁ R₂ : CategoryTheory.Functor B T}
(i : R₁ ≅ R₂)
(X : CategoryTheory.Comma L R₂)

((CategoryTheory.Comma.mapRightIso L i).counitIso.hom.app X).left = CategoryTheory.CategoryStruct.id X.left


theorem exists_mem_of_measure_ne_zero_of_ae (hs : μ s ≠ 0) {p : α → Prop}
    (hp : ∀ᵐ x ∂μ.restrict s, p x) : ∃ x, x ∈ s ∧ p x

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : μ s ≠ 0)
{p : α → Prop}
(hp : ∀ᵐ (x : α) ∂μ.restrict s, p x)


@[ext]
lemma Hom.ext' (X Y : Coalgebra G) (f g : X ⟶ Y) (h : f.f = g.f) : f = g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{G : CategoryTheory.Comonad C}
(X Y : G.Coalgebra)
(f g : X ⟶ Y)
(h : f.f = g.f)


theorem DifferentiableWithinAt.exp (hf : DifferentiableWithinAt ℝ f s x) :
    DifferentiableWithinAt ℝ (fun x => Real.exp (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt ℝ f s x)


/-- Let `{x | p x}` be a subsemigroup of a commutative monoid `M`. Let `f : M → N` be a map
submultiplicative on `{x | p x}`, i.e., `p x → p y → f (x * y) ≤ f x * f y`. Let `g i`, `i ∈ s`, be
a nonempty finite family of elements of `M` such that `∀ i ∈ s, p (g i)`. Then
`f (∏ x ∈ s, g x) ≤ ∏ x ∈ s, f (g x)`. -/
@[to_additive le_sum_nonempty_of_subadditive_on_pred]
theorem le_prod_nonempty_of_submultiplicative_on_pred (f : M → N) (p : M → Prop)
    (h_mul : ∀ x y, p x → p y → f (x * y) ≤ f x * f y) (hp_mul : ∀ x y, p x → p y → p (x * y))
    (g : ι → M) (s : Finset ι) (hs_nonempty : s.Nonempty) (hs : ∀ i ∈ s, p (g i)) :
    f (∏ i ∈ s, g i) ≤ ∏ i ∈ s, f (g i)

(h_mul : ∀ (x y : M), p x → p y → f (x * y) ≤ f x * f y)

(hp_mul : ∀ (x y : M), p x → p y → p (x * y))


/-- Homotopy between morphisms of short complexes is compatible with the scalar multiplication. -/
@[simps]
def Homotopy.smul {φ₁ φ₂ : S₁ ⟶ S₂} (h : Homotopy φ₁ φ₂) (a : R) :
    Homotopy (a • φ₁) (a • φ₂)

{φ₁ φ₂ : S₁ ⟶ S₂}

(h : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)


theorem withDensityᵥ_eq_withDensity_pos_part_sub_withDensity_neg_part {f : α → ℝ}
    (hfi : Integrable f μ) :
    μ.withDensityᵥ f =
      @toSignedMeasure α _ (μ.withDensity fun x => ENNReal.ofReal <| f x)
          (isFiniteMeasure_withDensity_ofReal hfi.2) -
        @toSignedMeasure α _ (μ.withDensity fun x => ENNReal.ofReal <| -f x)
          (isFiniteMeasure_withDensity_ofReal hfi.neg.2)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
(hfi : MeasureTheory.Integrable f μ)

μ.withDensityᵥ f =
  (μ.withDensity fun x => ENNReal.ofReal (f x)).toSignedMeasure -
    (μ.withDensity fun x => ENNReal.ofReal (-f x)).toSignedMeasure


@[to_additive leftAddCoset_assoc]
theorem leftCoset_assoc (s : Set α) (a b : α) : a • (b • s) = (a * b) • s

{α : Type u_1}
[AddSemigroup α]
(s : Set α)
(a b : α)


/-- The binary coproduct functor. -/
@[simps]
def coprod.functor : C ⥤ C ⥤ C

(CategoryTheory.Limits.coprod.functor.obj X).map g = CategoryTheory.Limits.coprod.map (𝟙 X) g


/-- The degree of a minimal polynomial is positive. -/
theorem degree_pos [Nontrivial B] (hx : IsIntegral A x) : 0 < degree (minpoly A x)

{A : Type u_1}
{B : Type u_2}
[CommRing A]
[Ring B]
[Algebra A B]
{x : B}
[Nontrivial B]
(hx : IsIntegral A x)


/-- The centroid of two points indexed by `Fin 2`, expressed directly
as adding a vector to the first point. -/
theorem centroid_pair_fin [Invertible (2 : k)] (p : Fin 2 → P) :
    univ.centroid k p = (2⁻¹ : k) • (p 1 -ᵥ p 0) +ᵥ p 0

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[Invertible 2]
(p : Fin 2 → P)

Finset.centroid k Finset.univ p = 2⁻¹ • (p 1 -ᵥ p 0) +ᵥ p 0


theorem isClosed_setOf_lipschitzWith {α β} [PseudoEMetricSpace α] [PseudoEMetricSpace β] (K : ℝ≥0) :
    IsClosed { f : α → β | LipschitzWith K f }

{α : Type u_4}
{β : Type u_5}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(K : ℝ≥0)


/-- The **Fermat-Euler totient theorem**. `Nat.ModEq.pow_totient` is an alternative statement
  of the same theorem. -/
@[simp]
theorem ZMod.pow_totient {n : ℕ} (x : (ZMod n)ˣ) : x ^ φ n = 1


lemma Odd.pow_neg_iff (hn : Odd n) : a ^ n < 0 ↔ a < 0

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
{n : ℕ}
[ExistsAddOfLE R]
(hn : Odd n)


@[simp]
theorem fst_neg [Neg R] [Neg A] (x : Unitization R A) : (-x).fst = -x.fst

{R : Type u_3}
{A : Type u_4}
[Neg R]
[Neg A]
(x : Unitization R A)


/-- A generalisation of `LinearMap.id` that constructs the identity function
as a `σ`-semilinear map for any ring homomorphism `σ` which we know is the identity. -/
@[simps]
def id' {σ : R →+* R} [RingHomId σ] : M →ₛₗ[σ] M

{R : Type u_1}
{M : Type u_9}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{σ : R →+* R}
[RingHomId σ]
(x : M)


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

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


theorem Subtype.mono_coe [Preorder α] (t : Set α) : Monotone ((↑) : Subtype t → α)


@[simp]
theorem OrderTop.upperBounds_univ [PartialOrder γ] [OrderTop γ] :
    upperBounds (univ : Set γ) = {⊤}

{γ : Type w}
[PartialOrder γ]
[OrderTop γ]


theorem toAddMonoidHom_injective :
    Function.Injective (toAddMonoidHom : (M →ₛₗ[σ] M₃) → M →+ M₃)

{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₃ : Type u_12}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₃]
[Module R M]
[Module S M₃]
{σ : R →+* S}


/-- The bijection `(X ⟶ Z) ≃ (Y ⟶ Z)` induced by `α : X ≅ Y`. -/
@[simps]
def homFromEquiv (α : X ≅ Y) {Z : C} : (X ⟶ Z) ≃ (Y ⟶ Z)

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

α.homFromEquiv f = CategoryTheory.CategoryStruct.comp α.inv f


/-- In an algebraic extension L/K, an intermediate subalgebra is a field. -/
theorem Subalgebra.isField_of_algebraic [Algebra.IsAlgebraic K L] : IsField A

{K : Type u_3}
{L : Type u_4}
[Field K]
[Field L]
[Algebra K L]
(A : Subalgebra K L)
[Algebra.IsAlgebraic K L]


theorem IsEquivalent.smul {α E 𝕜 : Type*} [NormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E]
    {a b : α → 𝕜} {u v : α → E} {l : Filter α} (hab : a ~[l] b) (huv : u ~[l] v) :
    (fun x ↦ a x • u x) ~[l] fun x ↦ b x • v x

{α : Type u_1}
{E : Type u_2}
{𝕜 : Type u_3}
[NormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{a b : α → 𝕜}
{u v : α → E}
{l : Filter α}
(hab : a ~[l] b)
(huv : u ~[l] v)

(fun x => a x • u x) ~[l] fun x => b x • v x


/-- The lengths of the members of `l.ranges` are those given by `l` -/
theorem ranges_length (l : List ℕ) :
    l.ranges.map length = l


@[simp]
theorem symm_trans (e₁ : M ≃ₗ⁅R,L⁆ N) (e₂ : N ≃ₗ⁅R,L⁆ P) :
    (e₁.trans e₂).symm = e₂.symm.trans e₁.symm

{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]
(e₁ : M ≃ₗ⁅R,L⁆ N)
(e₂ : N ≃ₗ⁅R,L⁆ P)


@[simp]
theorem iUnion_single (hJ : J ≤ I) (h : x ∈ Box.Icc I) : (single I J hJ x h).iUnion = J

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
{x : ι → ℝ}
(hJ : J ≤ I)
(h : x ∈ BoxIntegral.Box.Icc I)

(BoxIntegral.TaggedPrepartition.single I J hJ x h).iUnion = ↑J


theorem exists_iff_of_forall {p : Prop} {q : p → Prop} (h : ∀ h, q h) : (∃ h, q h) ↔ p

{p : Prop}
{q : p → Prop}
(h : ∀ (h : p), q h)


theorem add (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C') :
    DominatedFinMeasAdditive μ (T + T') (C + C')

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT' : MeasureTheory.DominatedFinMeasAdditive μ T' C')

MeasureTheory.DominatedFinMeasAdditive μ (T + T') (C + C')


@[simp]
theorem preimage_cast_Ico (p q : ℚ≥0) : (↑) ⁻¹' Ico (p : K) q = Ico p q

{K : Type u_5}
[LinearOrderedSemifield K]
(p q : ℚ≥0)

NNRat.cast ⁻¹' Set.Ico ↑p ↑q = Set.Ico p q


@[reassoc (attr := simp)]
lemma p_comp_opcyclesIso_inv : h.p ≫ h.opcyclesIso.inv = S.pOpcycles

CategoryTheory.CategoryStruct.comp h.p h.opcyclesIso.inv = S.pOpcycles


theorem derivative_eval (p : R[X]) (x : R) :
    p.derivative.eval x = p.sum fun n a => a * n * x ^ (n - 1)

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

Polynomial.eval x (Polynomial.derivative p) = p.sum fun n a => a * ↑n * x ^ (n - 1)


@[simps!]
instance : Category (Augmented C)

(C : Type u)
[CategoryTheory.Category.{v, u} C]

∀ {X Y Z : CategoryTheory.Comma (CategoryTheory.CosimplicialObject.const C) (𝟭 (CategoryTheory.CosimplicialObject C))}
  (f : X ⟶ Y) (g : Y ⟶ Z) (X_1 : SimplexCategory), (f ≫ g).right.app X_1 = f.right.app X_1 ≫ g.right.app X_1


@[deprecated formPerm_apply_lt_get (since := "2024-05-30")]
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn

{α : Type u_1}
[DecidableEq α]
(xs : List α)
(h : xs.Nodup)
(n : ℕ)
(hn : n + 1 < xs.length)

xs.formPerm (xs.nthLe n ⋯) = xs.nthLe (n + 1) hn


@[to_additive]
theorem noncommProd_mul_distrib_aux {s : Finset α} {f : α → β} {g : α → β}
    (comm_ff : (s : Set α).Pairwise fun x y => Commute (f x) (f y))
    (comm_gg : (s : Set α).Pairwise fun x y => Commute (g x) (g y))
    (comm_gf : (s : Set α).Pairwise fun x y => Commute (g x) (f y)) :
    (s : Set α).Pairwise fun x y => Commute ((f * g) x) ((f * g) y)

(comm_ff : (↑s).Pairwise fun x y => AddCommute (f x) (f y))

(comm_gg : (↑s).Pairwise fun x y => AddCommute (g x) (g y))

(comm_gf : (↑s).Pairwise fun x y => AddCommute (g x) (f y))

(↑s).Pairwise fun x y => AddCommute ((f + g) x) ((f + g) y)


theorem iteratedSliceForward_forget :
    iteratedSliceForward f ⋙ forget f.left = forget f ⋙ forget X

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
(f : CategoryTheory.Over X)

f.iteratedSliceForward.comp (CategoryTheory.Over.forget f.left) =
  (CategoryTheory.Over.forget f).comp (CategoryTheory.Over.forget X)


@[to_additive]
theorem UniformContinuous.mul [UniformSpace β] {f : β → α} {g : β → α} (hf : UniformContinuous f)
    (hg : UniformContinuous g) : UniformContinuous fun x => f x * g x

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
[UniformSpace β]
{f g : β → α}
(hf : UniformContinuous f)
(hg : UniformContinuous g)


theorem JoinedIn.somePath_mem (h : JoinedIn F x y) (t : I) : h.somePath t ∈ F

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{F : Set X}
(h : JoinedIn F x y)
(t : ↑I)


theorem snd_mem_of_mem_enum {x : ℕ × α} {l : List α} (h : x ∈ enum l) : x.2 ∈ l

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


@[simp]
theorem convexHull_singleton (x : E) : convexHull 𝕜 ({x} : Set E) = {x}

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(x : E)


theorem integrableOn_rpow_mul_exp_neg_mul_rpow {p s b : ℝ} (hs : -1 < s) (hp : 1 ≤ p) (hb : 0 < b) :
    IntegrableOn (fun x : ℝ => x ^ s * exp (- b * x ^ p)) (Ioi 0)

MeasureTheory.IntegrableOn (fun x => x ^ s * rexp (-b * x ^ p)) (Set.Ioi 0) MeasureTheory.volume


theorem exists_normalized_aux2 {N : ℕ} {τ : ℝ} (a : SatelliteConfig E N τ)
    (lastc : a.c (last N) = 0) (lastr : a.r (last N) = 1) (hτ : 1 ≤ τ) (δ : ℝ) (hδ1 : τ ≤ 1 + δ / 4)
    (hδ2 : δ ≤ 1) (i j : Fin N.succ) (inej : i ≠ j) (hi : ‖a.c i‖ ≤ 2) (hj : 2 < ‖a.c j‖) :
    1 - δ ≤ ‖a.c i - (2 / ‖a.c j‖) • a.c j‖

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


@[simp, norm_cast] lemma ofNat_lt_ofENat {m : ℕ} [m.AtLeastTwo] {n : ℕ∞} :
  no_index (OfNat.ofNat m : Cardinal) < n ↔ OfNat.ofNat m < n


theorem casesOn1 {f} (m : ℕ) (hf : Nat.Primrec f) : Nat.Primrec (Nat.casesOn · m f)

{f : ℕ → ℕ}
(m : ℕ)
(hf : Nat.Primrec f)


/-- A structure extending partial homeomorphisms, defining a local trivialization of a projection
`proj : Z → B` with fiber `F`, as a partial homeomorphism between `Z` and `B × F` defined between
two sets of the form `proj ⁻¹' baseSet` and `baseSet × F`, acting trivially on the first coordinate.
-/
-- Porting note (#5171): was @[nolint has_nonempty_instance]
structure Trivialization (proj : Z → B) extends PartialHomeomorph Z (B × F) where
  baseSet : Set B
  open_baseSet : IsOpen baseSet
  source_eq : source = proj ⁻¹' baseSet
  target_eq : target = baseSet ×ˢ univ
  proj_toFun : ∀ p ∈ source, (toPartialHomeomorph p).1 = proj p

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


@[to_additive add_le_of_nonpos_left]
theorem mul_le_of_le_one_left' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α} (h : b ≤ 1) :
    b * a ≤ a

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


lemma ext₅ {f g : ComposableArrows C 5}
    (h₀ : f.obj' 0 = g.obj' 0) (h₁ : f.obj' 1 = g.obj' 1) (h₂ : f.obj' 2 = g.obj' 2)
    (h₃ : f.obj' 3 = g.obj' 3) (h₄ : f.obj' 4 = g.obj' 4) (h₅ : f.obj' 5 = g.obj' 5)
    (w₀ : f.map' 0 1 = eqToHom h₀ ≫ g.map' 0 1 ≫ eqToHom h₁.symm)
    (w₁ : f.map' 1 2 = eqToHom h₁ ≫ g.map' 1 2 ≫ eqToHom h₂.symm)
    (w₂ : f.map' 2 3 = eqToHom h₂ ≫ g.map' 2 3 ≫ eqToHom h₃.symm)
    (w₃ : f.map' 3 4 = eqToHom h₃ ≫ g.map' 3 4 ≫ eqToHom h₄.symm)
    (w₄ : f.map' 4 5 = eqToHom h₄ ≫ g.map' 4 5 ≫ eqToHom h₅.symm) :
    f = g

{f g : CategoryTheory.ComposableArrows C 5}

(w₀ :
  f.map' 0 1 ⋯ ⋯ =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom h₀)
      (CategoryTheory.CategoryStruct.comp (g.map' 0 1 ⋯ ⋯) (CategoryTheory.eqToHom ⋯)))

(w₁ :
  f.map' 1 2 ⋯ ⋯ =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom h₁)
      (CategoryTheory.CategoryStruct.comp (g.map' 1 2 ⋯ ⋯) (CategoryTheory.eqToHom ⋯)))

(w₂ :
  f.map' 2 3 ⋯ ⋯ =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom h₂)
      (CategoryTheory.CategoryStruct.comp (g.map' 2 3 ⋯ ⋯) (CategoryTheory.eqToHom ⋯)))

(w₃ :
  f.map' 3 4 ⋯ ⋯ =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom h₃)
      (CategoryTheory.CategoryStruct.comp (g.map' 3 4 ⋯ ⋯) (CategoryTheory.eqToHom ⋯)))

(w₄ :
  f.map' 4 5 ⋯ ⋯ =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom h₄)
      (CategoryTheory.CategoryStruct.comp (g.map' 4 5 ⋯ ⋯) (CategoryTheory.eqToHom ⋯)))


theorem tails_eq_inits : ∀ l : List α, l.tails = (reverse <| map reverse <| inits <| reverse l)

l.tails = (List.map List.reverse l.reverse.inits).reverse


/-- A functor induces a functor of matrix categories.
-/
@[simps]
def mapMat_ (F : C ⥤ D) [Functor.Additive F] : Mat_ C ⥤ Mat_ D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
{D : Type u_1}
[CategoryTheory.Category.{v₁, u_1} D]
[CategoryTheory.Preadditive D]
(F : C ⥤ D)
[F.Additive]
(M : CategoryTheory.Mat_ C)


theorem or_all_distrib_left (l : List α) (p : α → Bool) (q : Bool) :
    (q || l.all p) = l.all fun a => q || p a

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


lemma eigenvectorUnitary_coe {𝕜 : Type*} [RCLike 𝕜] {n : Type*} [Fintype n]
    {A : Matrix n n 𝕜} [DecidableEq n] (hA : Matrix.IsHermitian A) :
    eigenvectorUnitary hA =
      (EuclideanSpace.basisFun n 𝕜).toBasis.toMatrix (hA.eigenvectorBasis).toBasis

{𝕜 : Type u_3}
[RCLike 𝕜]
{n : Type u_4}
[Fintype n]
{A : Matrix n n 𝕜}
[DecidableEq n]
(hA : A.IsHermitian)

↑hA.eigenvectorUnitary = (EuclideanSpace.basisFun n 𝕜).toBasis.toMatrix ⇑hA.eigenvectorBasis.toBasis


/-- This lemma will be immediately superseded by `ext`, below. -/
private theorem ext_aux (I J : HasZeroMorphisms C)
    (w : ∀ X Y : C, (I.zero X Y).zero = (J.zero X Y).zero) : I = J

(I J : CategoryTheory.Limits.HasZeroMorphisms C)

(w : ∀ (X Y : C), Zero.zero = Zero.zero)


protected lemma zero : PosSemidef (0 : Matrix n n R)

{n : Type u_2}
{R : Type u_3}
[Fintype n]
[CommRing R]
[PartialOrder R]
[StarRing R]


protected theorem contMDiff (f : C^n⟮I, M; I', M'⟯) : ContMDiff I I' n f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{H' : Type u_5}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
(f : C^n⟮I, M; I', M'⟯)


theorem dslope_sub_smul [DecidableEq 𝕜] (f : 𝕜 → E) (a : 𝕜) :
    dslope (fun x => (x - a) • f x) a = update f a (deriv (fun x => (x - a) • f x) a)

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[DecidableEq 𝕜]
(f : 𝕜 → E)
(a : 𝕜)

dslope (fun x => (x - a) • f x) a = Function.update f a (deriv (fun x => (x - a) • f x) a)


@[to_additive]
theorem op_injective : Injective (op : α → αᵐᵒᵖ)


theorem extend_function_of_lt {α β : Type*} {s : Set α} (f : s ↪ β) (hs : #s < #α)
    (h : Nonempty (α ≃ β)) : ∃ g : α ≃ β, ∀ x : s, g x = f x

{α : Type u_1}
{β : Type u_2}
{s : Set α}
(f : ↑s ↪ β)
(hs : #↑s < #α)
(h : Nonempty (α ≃ β))


/-- A version of `Nat.div_lt_self` using successors, rather than additional hypotheses. -/
lemma div_lt_self' (a b : ℕ) : (a + 1) / (b + 2) < a + 1


theorem Poly.denote_eq_cancel {ctx : Context} {m₁ m₂ : Poly} (h : denote_eq ctx (m₁, m₂)) : denote_eq ctx (cancel m₁ m₂)

(h : Nat.Linear.Poly.denote_eq ctx (m₁, m₂))

Nat.Linear.Poly.denote_eq ctx (m₁.cancel m₂)


/-- Let `r > 1` and `1/r + 1/s = 1`. Then `B_r` and `B'_s` are disjoint (i.e. no collision exists).
-/
private theorem no_collision : Disjoint {beattySeq r k | k} {beattySeq' s k | k}

Disjoint {x | ∃ k, beattySeq r k = x} {x | ∃ k, beattySeq' s k = x}


@[simp]
lemma toNNReal_apply (f : C(X, ℝ)₀) (x : X) : f.toNNReal x = Real.toNNReal (f x)

{X : Type u_1}
[TopologicalSpace X]
[Zero X]
(f : ContinuousMapZero X ℝ)
(x : X)


lemma symm (ht : IsSl2Triple h e f) : IsSl2Triple (-h) f e

{L : Type u_2}
[LieRing L]
{h e f : L}
(ht : IsSl2Triple h e f)


protected theorem div_eq_iff_eq_mul_left {a b c : Nat} (H : 0 < b) (H' : b ∣ a) :
    a / b = c ↔ a = c * b


/-- The equivalence between isomorphisms in `Sequential` and homeomorphisms
of topological spaces. -/
@[simps]
def isoEquivHomeo {X Y : Sequential.{u}} : (X ≅ Y) ≃ (X ≃ₜ Y)

Sequential.isoEquivHomeo f = Sequential.homeoOfIso f


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

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{a b : α}
(h : StrictMono f)


/-- Dividing `a` by the result of dividing `a` by itself results in
`a` (whether or not `a` is zero). -/
@[simp]
theorem div_div_self (a : G₀) : a / (a / a) = a

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


@[simp]
theorem frobenius_comp_frobeniusEquiv_symm :
    (frobenius R p).comp (frobeniusEquiv R p).symm = RingHom.id R

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

(frobenius R p).comp ↑(frobeniusEquiv R p).symm = RingHom.id R


/-- Two `R`-`AlgHom` from `AdjoinRoot f` to the same `R`-algebra are the same iff
    they agree on `root f`. -/
@[ext]
theorem algHom_ext [Semiring S] [Algebra R S] {g₁ g₂ : AdjoinRoot f →ₐ[R] S}
    (h : g₁ (root f) = g₂ (root f)) : g₁ = g₂

(h : g₁ (AdjoinRoot.root f) = g₂ (AdjoinRoot.root f))


theorem Filter.Eventually.eventually_nhdsSet {p : X → Prop} (h : ∀ᶠ y in 𝓝ˢ s, p y) :
    ∀ᶠ y in 𝓝ˢ s, ∀ᶠ x in 𝓝 y, p x

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
{p : X → Prop}
(h : ∀ᶠ (y : X) in 𝓝ˢ s, p y)

∀ᶠ (y : X) in 𝓝ˢ s, ∀ᶠ (x : X) in 𝓝 y, p x


theorem one_def : (1 : M₁ →L[R₁] M₁) = id R₁ M₁

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]


lemma chainTopCoeff_of_eq_zsmul_add (β' : Weight K H L) (n : ℤ) (hβ' : (β' : H → K) = n • α + β) :
    chainTopCoeff α β' = chainTopCoeff α β - n

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
(α β : LieModule.Weight K (↥H) L)
(hα : α.IsNonZero)
(β' : LieModule.Weight K (↥H) L)
(n : ℤ)
(hβ' : ⇑β' = n • ⇑α + ⇑β)

↑(LieModule.chainTopCoeff (⇑α) β') = ↑(LieModule.chainTopCoeff (⇑α) β) - n


theorem any_eq {l : List α} : l.any p = decide (∃ x, x ∈ l ∧ p x)

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

l.any p = decide (∃ x, x ∈ l ∧ p x = true)


theorem hausdorffMeasure_le_one_of_subsingleton {s : Set X} (hs : s.Subsingleton) {d : ℝ}
    (hd : 0 ≤ d) : μH[d] s ≤ 1

{X : Type u_2}
[EMetricSpace X]
[MeasurableSpace X]
[BorelSpace X]
{s : Set X}
(hs : s.Subsingleton)
{d : ℝ}
(hd : 0 ≤ d)


@[simp]
theorem inter_self (a : Set α) : a ∩ a = a


@[to_additive]
protected theorem setLIntegral_eq (hs : IsFundamentalDomain G s μ) (ht : IsFundamentalDomain G t μ)
    (f : α → ℝ≥0∞) (hf : ∀ (g : G) (x), f (g • x) = f x) :
    ∫⁻ x in s, f x ∂μ = ∫⁻ x in t, f x ∂μ

[MeasureTheory.VAddInvariantMeasure G α μ]

(hs : MeasureTheory.IsAddFundamentalDomain G s μ)

(ht : MeasureTheory.IsAddFundamentalDomain G t μ)

(f : α → ℝ≥0∞)

∫⁻ (x : α) in s, f x ∂μ = ∫⁻ (x : α) in t, f x ∂μ


@[simp]
theorem zero_comp (f : M₁ →SL[σ₁₂] M₂) : (0 : M₂ →SL[σ₂₃] M₃).comp f = 0

{R₁ : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
[Module R₁ M₁]
[Module R₂ M₂]
[Module R₃ M₃]
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(f : M₁ →SL[σ₁₂] M₂)


protected theorem zero_mem : (0 : α) ∈ I


theorem nonempty_of_sInf_eq_succ {s : Set ℕ} {k : ℕ} (h : sInf s = k + 1) : s.Nonempty


/-- Unfolds the definition of the `p`-adic norm of `q` when `q ≠ 0`. -/
@[simp]
protected theorem eq_zpow_of_nonzero {q : ℚ} (hq : q ≠ 0) :
    padicNorm p q = (p : ℚ) ^ (-padicValRat p q)


/-- Multiplying by a nonzero element `a` of the field `K` is a linear equivalence. -/
@[simps!]
def smulOfNeZero (a : K) (ha : a ≠ 0) : M ≃ₗ[K] M

(K : Type u_6)
(M : Type u_8)
[Field K]
[AddCommGroup M]
[Module K M]
(a : K)
(ha : a ≠ 0)

∀ (a_1 : M), (LinearEquiv.smulOfNeZero K M a ha) a_1 = Units.mk0 a ha • a_1


theorem decide_true_eq_true (h : Decidable True) : @decide True h = true


theorem _root_.Disjoint.exists_cthickenings (hst : Disjoint s t) (hs : IsCompact s)
    (ht : IsClosed t) :
    ∃ δ, 0 < δ ∧ Disjoint (cthickening δ s) (cthickening δ t)

{α : Type u}
[PseudoEMetricSpace α]
{s t : Set α}
(hst : Disjoint s t)
(hs : IsCompact s)
(ht : IsClosed t)

∃ δ, 0 < δ ∧ Disjoint (Metric.cthickening δ s) (Metric.cthickening δ t)


@[simp]
theorem ack_lt_iff_right {m n₁ n₂ : ℕ} : ack m n₁ < ack m n₂ ↔ n₁ < n₂


@[simp]
theorem zeroCoprodIso_inv (X : C) : (zeroCoprodIso X).inv = coprod.inr

(CategoryTheory.Limits.zeroCoprodIso X).inv = CategoryTheory.Limits.coprod.inr


@[to_additive (attr := measurability)]
theorem Finset.measurable_prod' (s : Finset ι) (hf : ∀ i ∈ s, Measurable (f i)) :
    Measurable (∏ i ∈ s, f i)

{M : Type u_2}
{ι : Type u_3}
{α : Type u_4}
[AddCommMonoid M]
[MeasurableSpace M]
[MeasurableAdd₂ M]
{m : MeasurableSpace α}
{f : ι → α → M}
(s : Finset ι)
(hf : ∀ i ∈ s, Measurable (f i))


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


/-- The homology functor to graded objects. -/
@[simps]
noncomputable def gradedHomologyFunctor [CategoryWithHomology C] :
    HomologicalComplex C c ⥤ GradedObject ι C

∀ {X Y : HomologicalComplex C c} (f : X ⟶ Y) (i : ι),
  (HomologicalComplex.gradedHomologyFunctor C c).map f i = HomologicalComplex.homologyMap f i


/-- The inner content of a supremum of opens is at most the sum of the individual inner contents. -/
theorem innerContent_iSup_nat [R1Space G] (U : ℕ → Opens G) :
    μ.innerContent (⨆ i : ℕ, U i) ≤ ∑' i : ℕ, μ.innerContent (U i)

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
[R1Space G]
(U : ℕ → TopologicalSpace.Opens G)

μ.innerContent (⨆ i, U i) ≤ ∑' (i : ℕ), μ.innerContent (U i)


theorem ne_of_mem_of_not_mem (h : a ∈ s) : b ∉ s → a ≠ b

{α : Type u_1}
{β : Type u_2}
[Membership α β]
{s : β}
{a b : α}
(h : a ∈ s)

¬b ∈ s → a ≠ b


theorem withDensity_eq_iff {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ)
    (hg : AEMeasurable g μ) (hfi : ∫⁻ x, f x ∂μ ≠ ∞) :
    μ.withDensity f = μ.withDensity g ↔ f =ᵐ[μ] g

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → ℝ≥0∞}
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)
(hfi : ∫⁻ (x : α), f x ∂μ ≠ ⊤)


@[simp] protected theorem neg_eq_of_add_eq_zero {a b : Int} (h : a + b = 0) : -a = b


lemma injective_ringHomComp {f : R' →+* R''} (hf : Function.Injective f) :
    Function.Injective (ringHomComp (R := R) · f)

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommRing R']
{R'' : Type u_3}
[CommRing R'']
{f : R' →+* R''}
(hf : Function.Injective ⇑f)

Function.Injective fun x => x.ringHomComp f


@[to_additive]
theorem diff_mul_diff : diff ϕ R S * diff ϕ S T = diff ϕ R T

(R S T : ↑(Subgroup.leftTransversals ↑H))

Subgroup.leftTransversals.diff ϕ R S * Subgroup.leftTransversals.diff ϕ S T = Subgroup.leftTransversals.diff ϕ R T


@[norm_cast] lemma uzpow_natCast (u : ℤˣ) (n : ℕ) : u ^ (n : R) = u ^ n

{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(u : ℤˣ)
(n : ℕ)


theorem iterate_frobenius : (frobenius R p)^[n] x = x ^ p ^ n

{R : Type u}
[CommSemiring R]
(p n : ℕ)
[ExpChar R p]
(x : R)


@[simp]
theorem comapDomain_apply [Zero M] (f : α → β) (l : β →₀ M) (hf : Set.InjOn f (f ⁻¹' ↑l.support))
    (a : α) : comapDomain f l hf a = l (f a)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[Zero M]
(f : α → β)
(l : β →₀ M)
(hf : Set.InjOn f (f ⁻¹' ↑l.support))
(a : α)

(Finsupp.comapDomain f l hf) a = l (f a)


theorem add_one (a : ℕ+) : a + 1 = succPNat a


@[ext]
theorem ext {f g : P ⟶ Q} (w : ∀ X, f.app X = g.app X) : f = g

(w : ∀ (X : Cᵒᵖ), PresheafOfModules.Hom.app f X = PresheafOfModules.Hom.app g X)


theorem eventuallyConst_set' {s : Set α} :
    EventuallyConst s l ↔ (s =ᶠ[l] (∅ : Set α)) ∨ s =ᶠ[l] univ

{α : Type u_1}
{l : Filter α}
{s : Set α}

Filter.EventuallyConst s l ↔ s =ᶠ[l] ∅ ∨ s =ᶠ[l] Set.univ


lemma Functor.reflects_precoherent : Precoherent C


@[to_additive (attr := simp)]
theorem freeGroupCongr_symm {α β} (e : α ≃ β) : (freeGroupCongr e).symm = freeGroupCongr e.symm

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)

(FreeGroup.freeGroupCongr e).symm = FreeGroup.freeGroupCongr e.symm


/-- A specialization of `abs_sub_le_of_nonneg_of_le` for working with the signed subtraction
  of natural numbers. -/
theorem natAbs_coe_sub_coe_le_of_le {a b n : ℕ} (a_le_n : a ≤ n) (b_le_n : b ≤ n) :
    natAbs (a - b : ℤ) ≤ n


theorem int_sub (h : LiouvilleWith p x) (m : ℤ) : LiouvilleWith p (m - x)

{p x : ℝ}
(h : LiouvilleWith p x)
(m : ℤ)


@[simp] lemma iSup_of_isEmpty {α : Sort*} [IsEmpty α] (f : α → ℝ) : ⨆ i, f i = 0


@[simp, norm_cast]
theorem coeIdeal_sup (I J : Ideal R) : ↑(I ⊔ J) = (I + J : FractionalIdeal S P)

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


@[ext]
theorem biprod.hom_ext' {X Y Z : C} [HasBinaryBiproduct X Y] (f g : X ⊞ Y ⟶ Z)
    (h₀ : biprod.inl ≫ f = biprod.inl ≫ g) (h₁ : biprod.inr ≫ f = biprod.inr ≫ g) : f = g

(h₀ : CategoryTheory.Limits.biprod.inl ≫ f = CategoryTheory.Limits.biprod.inl ≫ g)

(h₁ : CategoryTheory.Limits.biprod.inr ≫ f = CategoryTheory.Limits.biprod.inr ≫ g)


/-- In a bicategory, we can compose the 1-morphisms `f : a ⟶ b` and `g : b ⟶ c` to obtain
a 1-morphism `f ≫ g : a ⟶ c`. This composition does not need to be strictly associative,
but there is a specified associator, `α_ f g h : (f ≫ g) ≫ h ≅ f ≫ (g ≫ h)`.
There is an identity 1-morphism `𝟙 a : a ⟶ a`, with specified left and right unitor
isomorphisms `λ_ f : 𝟙 a ≫ f ≅ f` and `ρ_ f : f ≫ 𝟙 a ≅ f`.
These associators and unitors satisfy the pentagon and triangle equations.

See https://ncatlab.org/nlab/show/bicategory.
-/
@[nolint checkUnivs]
class Bicategory (B : Type u) extends CategoryStruct.{v} B where
  -- category structure on the collection of 1-morphisms:
  homCategory : ∀ a b : B, Category.{w} (a ⟶ b) := by infer_instance
  -- left whiskering:
  whiskerLeft {a b c : B} (f : a ⟶ b) {g h : b ⟶ c} (η : g ⟶ h) : f ≫ g ⟶ f ≫ h
  -- right whiskering:
  whiskerRight {a b c : B} {f g : a ⟶ b} (η : f ⟶ g) (h : b ⟶ c) : f ≫ h ⟶ g ≫ h
  -- associator:
  associator {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) : (f ≫ g) ≫ h ≅ f ≫ g ≫ h
  -- left unitor:
  leftUnitor {a b : B} (f : a ⟶ b) : 𝟙 a ≫ f ≅ f
  -- right unitor:
  rightUnitor {a b : B} (f : a ⟶ b) : f ≫ 𝟙 b ≅ f
  -- axioms for left whiskering:
  whiskerLeft_id : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerLeft f (𝟙 g) = 𝟙 (f ≫ g) := by
    aesop_cat
  whiskerLeft_comp :
    ∀ {a b c} (f : a ⟶ b) {g h i : b ⟶ c} (η : g ⟶ h) (θ : h ⟶ i),
      whiskerLeft f (η ≫ θ) = whiskerLeft f η ≫ whiskerLeft f θ := by
    aesop_cat
  id_whiskerLeft :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerLeft (𝟙 a) η = (leftUnitor f).hom ≫ η ≫ (leftUnitor g).inv := by
    aesop_cat
  comp_whiskerLeft :
    ∀ {a b c d} (f : a ⟶ b) (g : b ⟶ c) {h h' : c ⟶ d} (η : h ⟶ h'),
      whiskerLeft (f ≫ g) η =
        (associator f g h).hom ≫ whiskerLeft f (whiskerLeft g η) ≫ (associator f g h').inv := by
    aesop_cat
  -- axioms for right whiskering:
  id_whiskerRight : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerRight (𝟙 f) g = 𝟙 (f ≫ g) := by
    aesop_cat
  comp_whiskerRight :
    ∀ {a b c} {f g h : a ⟶ b} (η : f ⟶ g) (θ : g ⟶ h) (i : b ⟶ c),
      whiskerRight (η ≫ θ) i = whiskerRight η i ≫ whiskerRight θ i := by
    aesop_cat
  whiskerRight_id :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerRight η (𝟙 b) = (rightUnitor f).hom ≫ η ≫ (rightUnitor g).inv := by
    aesop_cat
  whiskerRight_comp :
    ∀ {a b c d} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c) (h : c ⟶ d),
      whiskerRight η (g ≫ h) =
        (associator f g h).inv ≫ whiskerRight (whiskerRight η g) h ≫ (associator f' g h).hom := by
    aesop_cat
  -- associativity of whiskerings:
  whisker_assoc :
    ∀ {a b c d} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g') (h : c ⟶ d),
      whiskerRight (whiskerLeft f η) h =
        (associator f g h).hom ≫ whiskerLeft f (whiskerRight η h) ≫ (associator f g' h).inv := by
    aesop_cat
  -- exchange law of left and right whiskerings:
  whisker_exchange :
    ∀ {a b c} {f g : a ⟶ b} {h i : b ⟶ c} (η : f ⟶ g) (θ : h ⟶ i),
      whiskerLeft f θ ≫ whiskerRight η i = whiskerRight η h ≫ whiskerLeft g θ := by
    aesop_cat
  -- pentagon identity:
  pentagon :
    ∀ {a b c d e} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) (i : d ⟶ e),
      whiskerRight (associator f g h).hom i ≫
          (associator f (g ≫ h) i).hom ≫ whiskerLeft f (associator g h i).hom =
        (associator (f ≫ g) h i).hom ≫ (associator f g (h ≫ i)).hom := by
    aesop_cat
  -- triangle identity:
  triangle :
    ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c),
      (associator f (𝟙 b) g).hom ≫ whiskerLeft f (leftUnitor g).hom
      = whiskerRight (rightUnitor f).hom g := by
    aesop_cat

{B : Type u}
[self : CategoryTheory.Bicategory B]
{a b c d : B}
{f f' : a ⟶ b}
(η : f ⟶ f')
(g : b ⟶ c)
(h : c ⟶ d)

CategoryTheory.Bicategory.whiskerRight η (CategoryTheory.CategoryStruct.comp g h) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator f g h).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.whiskerRight η g) h)
      (CategoryTheory.Bicategory.associator f' g h).hom)


theorem snd_apply' (κ : Kernel α (β × γ)) (a : α) {s : Set γ} (hs : MeasurableSet s) :
    snd κ a s = κ a {p | p.2 ∈ s}

(κ : ProbabilityTheory.Kernel α (β × γ))


@[to_additive (attr := simp)]
lemma coe_comp {X Y Z : CommMonCat} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g : X → Z) = g ∘ f

{X Y Z : AddCommMonCat}
{f : X ⟶ Y}
{g : Y ⟶ Z}


lemma isAffineOpen_of_isAffineOpen_basicOpen_aux (s : Set Γ(X, ⊤))
    (hs : Ideal.span s = ⊤) (hs₂ : ∀ i ∈ s, IsAffineOpen (X.basicOpen i)) :
    QuasiSeparatedSpace X

(s : Set ↑(X.presheaf.obj (Opposite.op ⊤)))

(hs₂ : ∀ i ∈ s, AlgebraicGeometry.IsAffineOpen (X.basicOpen i))


/-- Let `E` be a TVS, `𝔖 : Set (Set α)` and `H` a submodule of `α →ᵤ[𝔖] E`. If the image of any
`S ∈ 𝔖` by any `u ∈ H` is bounded (in the sense of `Bornology.IsVonNBounded`), then `H`,
equipped with the topology of `𝔖`-convergence, is a TVS.

For convenience, we don't literally ask for `H : Submodule (α →ᵤ[𝔖] E)`. Instead, we prove the
result for any vector space `H` equipped with a linear inducing to `α →ᵤ[𝔖] E`, which is often
easier to use. We also state the `Submodule` version as
`UniformOnFun.continuousSMul_submodule_of_image_bounded`. -/
theorem UniformOnFun.continuousSMul_induced_of_image_bounded (φ : hom) (hφ : Inducing (ofFun 𝔖 ∘ φ))
    (h : ∀ u : H, ∀ s ∈ 𝔖, Bornology.IsVonNBounded 𝕜 ((φ u : α → E) '' s)) :
    ContinuousSMul 𝕜 H

(hφ : Inducing (⇑(UniformOnFun.ofFun 𝔖) ∘ ⇑φ))

(h : ∀ (u : H), ∀ s ∈ 𝔖, Bornology.IsVonNBounded 𝕜 (φ u '' s))


@[simp]
nonrec theorem Iic_top [OrderTop α] : Iic (⊤ : α) = ⊤

{α : Type u_1}
[Preorder α]
[OrderTop α]


/--
A presentation of an `R`-algebra `S` is a family of
generators with
1. `rels`: The type of relations.
2. `relation : relations → MvPolynomial vars R`: The assignment of
each relation to a polynomial in the generators.
-/
@[nolint checkUnivs]
structure Algebra.Presentation extends Algebra.Generators.{w} R S where
  /-- The type of relations.  -/
  rels : Type t
  /-- The assignment of each relation to a polynomial in the generators. -/
  relation : rels → toGenerators.Ring
  /-- The relations span the kernel of the canonical map. -/
  span_range_relation_eq_ker :
    Ideal.span (Set.range relation) = toGenerators.ker

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(self : Algebra.Presentation R S)

Ideal.span (Set.range self.relation) = self.ker


theorem cos_int_mul_two_pi (n : ℤ) : cos (n * (2 * π)) = 1


@[simp]
theorem comap_cocompact (h : X ≃ₜ Y) : comap h (cocompact Y) = cocompact X

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

Filter.comap (⇑h) (Filter.cocompact Y) = Filter.cocompact X


lemma IsEverywherePos.smul_measure_nnreal (hs : IsEverywherePos μ s) {c : ℝ≥0} (hc : c ≠ 0) :
    IsEverywherePos (c • μ) s

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : μ.IsEverywherePos s)
{c : ℝ≥0}
(hc : c ≠ 0)


@[simp]
theorem rpow_lt_rpow_left_iff (hx : 1 < x) : x ^ y < x ^ z ↔ y < z


@[to_additive]
theorem IsUpperSet.mul_left (ht : IsUpperSet t) : IsUpperSet (s * t)

{α : Type u_1}
[OrderedCommGroup α]
{s t : Set α}
(ht : IsUpperSet t)


theorem iter_deriv_pow (n : ℕ) (x : 𝕜) (k : ℕ) :
    deriv^[k] (fun x : 𝕜 => x ^ n) x = (∏ i ∈ Finset.range k, ((n : 𝕜) - i)) * x ^ (n - k)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(n : ℕ)
(x : 𝕜)
(k : ℕ)

deriv^[k] (fun x => x ^ n) x = (∏ i ∈ Finset.range k, (↑n - ↑i)) * x ^ (n - k)


/-- The `→` direction of this lemma is actually true without the `IsNoetherian` assumption. -/
theorem LieIdeal.solvable_iff_le_radical [IsNoetherian R L] (I : LieIdeal R L) :
    IsSolvable R I ↔ I ≤ radical R L

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[IsNoetherian R L]
(I : LieIdeal R L)

LieAlgebra.IsSolvable R ↥↑I ↔ I ≤ LieAlgebra.radical R L


/-- The translation of a convex set is also convex. -/
theorem Convex.translate_preimage_right (hs : Convex 𝕜 s) (z : E) :
    Convex 𝕜 ((fun x => z + x) ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
(z : E)


protected theorem PSigma.eta {α : Sort u} {β : α → Sort v} {a₁ a₂ : α} {b₁ : β a₁} {b₂ : β a₂}
    (h₁ : a₁ = a₂) (h₂ : Eq.ndrec b₁ h₁ = b₂) : PSigma.mk a₁ b₁ = PSigma.mk a₂ b₂

⟨a₁, b₁⟩ = ⟨a₂, b₂⟩


theorem dite_some_none_eq_none [Decidable P] {x : P → α} :
    (if h : P then some (x h) else none) = none ↔ ¬P

{P : Prop}
{α : Type u_1}
[Decidable P]
{x : P → α}


theorem mod_four_ne_three_of_sq_eq_neg_one {y : ZMod p} (hy : y ^ 2 = -1) : p % 4 ≠ 3

{p : ℕ}
[Fact (Nat.Prime p)]
{y : ZMod p}
(hy : y ^ 2 = -1)


theorem Ideal.toIdeal_homogeneousHull_eq_iSup :
    (I.homogeneousHull 𝒜).toIdeal = ⨆ i, Ideal.span (GradedRing.proj 𝒜 i '' I)

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[GradedRing 𝒜]
(I : Ideal A)

(Ideal.homogeneousHull 𝒜 I).toIdeal = ⨆ i, Ideal.span (⇑(GradedRing.proj 𝒜 i) '' ↑I)


lemma Exact.inl_snd : Function.Exact (LinearMap.inl R M N) (LinearMap.snd R M N)

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]

Function.Exact ⇑(LinearMap.inl R M N) ⇑(LinearMap.snd R M N)


theorem ssubset_univ_iff : s ⊂ univ ↔ s ≠ univ


theorem sum_finsupport (hx₀ : x₀ ∈ s) : ∑ i ∈ ρ.finsupport x₀, ρ i x₀ = 1

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(ρ : SmoothPartitionOfUnity ι I M s)
(x₀ : M)
(hx₀ : x₀ ∈ s)


theorem derivWithin_rpow_const (hf : DifferentiableWithinAt ℝ f s x) (hx : f x ≠ 0 ∨ 1 ≤ p)
    (hxs : UniqueDiffWithinAt ℝ s x) :
    derivWithin (fun x => f x ^ p) s x = derivWithin f s x * p * f x ^ (p - 1)

{f : ℝ → ℝ}
{x p : ℝ}
{s : Set ℝ}
(hf : DifferentiableWithinAt ℝ f s x)
(hx : f x ≠ 0 ∨ 1 ≤ p)
(hxs : UniqueDiffWithinAt ℝ s x)


@[nontriviality]
theorem StronglyMeasurable.of_finite [Finite α] {_ : MeasurableSpace α}
    [MeasurableSingletonClass α] [TopologicalSpace β]
    (f : α → β) : StronglyMeasurable f

{α : Type u_1}
{β : Type u_2}
[Finite α]

∀ {x : MeasurableSpace α} [inst : MeasurableSingletonClass α] [inst : TopologicalSpace β] (f : α → β),
  MeasureTheory.StronglyMeasurable f


theorem mul_mem_nonZeroDivisors {a b : M₁} : a * b ∈ M₁⁰ ↔ a ∈ M₁⁰ ∧ b ∈ M₁⁰

{M₁ : Type u_4}
[CommMonoidWithZero M₁]
{a b : M₁}

a * b ∈ M₁⁰ ↔ a ∈ M₁⁰ ∧ b ∈ M₁⁰


theorem iSup₂ {κ : Sort*} {κ' : κ → Sort*} {f : ∀ i, κ' i → Ideal A}
    (h : ∀ i j, (f i j).IsHomogeneous 𝒜) : (⨆ (i) (j), f i j).IsHomogeneous 𝒜

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


theorem findMin'_dual : ∀ (t) (x : α), findMin' (dual t) x = findMax' x t

t.dual.findMin' x = Ordnode.findMax' x t


@[simp, norm_cast]
theorem coe_nonneg {x : ℝ} : 0 ≤ (x : ℝ*) ↔ 0 ≤ x

0 ≤ ↑x ↔ 0 ≤ x


theorem isometry_compMeasurePreserving [Fact (1 ≤ p)] (hf : MeasurePreserving f μ μb) :
    Isometry (compMeasurePreserving f hf : Lp E p μb → Lp E p μ)

(hf : MeasureTheory.MeasurePreserving f μ μb)

Isometry ⇑(MeasureTheory.Lp.compMeasurePreserving f hf)


theorem gcd_det_eq : gcdW a b * gcdZ a b = succPNat (gcdX a b * gcdY a b)

a.gcdW b * a.gcdZ b = (a.gcdX b * a.gcdY b).succPNat


theorem embedding_coe : Embedding ((↑) : ℝ≥0 → ℝ≥0∞)


theorem dvd_iff_mod_eq_zero {m n : ZNum} : m ∣ n ↔ n % m = 0


theorem le_tsum_schlomilch (hf : ∀ ⦃m n⦄, 0 < m → m ≤ n → f n ≤ f m) (h_pos : ∀ n, 0 < u n)
    (hu : StrictMono u) :
    ∑' k , f k ≤ ∑ k ∈ range (u 0), f k + ∑' k : ℕ, (u (k + 1) - u k) * f (u k)

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

∑' (k : ℕ), f k ≤ ∑ k ∈ Finset.range (u 0), f k + ∑' (k : ℕ), (↑(u (k + 1)) - ↑(u k)) * f (u k)


theorem pre_comm_ihom_map {W X Y Z : C} [Closed W] [Closed X] (f : W ⟶ X) (g : Y ⟶ Z) :
    (pre f).app Y ≫ (ihom W).map g = (ihom X).map g ≫ (pre f).app Z

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{W X Y Z : C}
[CategoryTheory.Closed W]
[CategoryTheory.Closed X]
(f : W ⟶ X)
(g : Y ⟶ Z)

CategoryTheory.CategoryStruct.comp ((CategoryTheory.MonoidalClosed.pre f).app Y) ((CategoryTheory.ihom W).map g) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.ihom X).map g) ((CategoryTheory.MonoidalClosed.pre f).app Z)


@[deprecated measure_iUnion_null_iff (since := "2024-01-14")]
theorem measure_iUnion_null_iff' {ι : Prop} {s : ι → Set α} : μ (⋃ i, s i) = 0 ↔ ∀ i, μ (s i) = 0

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{ι : Prop}
{s : ι → Set α}


lemma IsColimit.isZero_pt {c : Cocone F} (hc : IsColimit c) (hF : IsZero F) : IsZero c.pt

(hc : CategoryTheory.Limits.IsColimit c)


/-- The `αˣ` type is equivalent to a subtype of `α × α`. -/
@[simps]
def unitsEquivProdSubtype [Monoid α] : αˣ ≃ {p : α × α // p.1 * p.2 = 1 ∧ p.2 * p.1 = 1}

↑((unitsEquivProdSubtype α).symm p) = (↑p).1


theorem Finite.inf_of_left {s : Set α} (h : s.Finite) (t : Set α) : (s ⊓ t).Finite

{α : Type u}
{s : Set α}
(h : s.Finite)
(t : Set α)


protected theorem add_left_cancel (h₁ : a ≡ b [ZMOD n]) (h₂ : a + c ≡ b + d [ZMOD n]) :
    c ≡ d [ZMOD n]

{n a b c d : ℤ}
(h₁ : a ≡ b [ZMOD n])
(h₂ : a + c ≡ b + d [ZMOD n])


theorem fromBlocks_multiply [Fintype l] [Fintype m] [NonUnitalNonAssocSemiring α] (A : Matrix n l α)
    (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α) (A' : Matrix l p α) (B' : Matrix l q α)
    (C' : Matrix m p α) (D' : Matrix m q α) :
    fromBlocks A B C D * fromBlocks A' B' C' D' =
      fromBlocks (A * A' + B * C') (A * B' + B * D') (C * A' + D * C') (C * B' + D * D')

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{p : Type u_5}
{q : Type u_6}
{α : Type u_12}
[Fintype l]
[Fintype m]
[NonUnitalNonAssocSemiring α]
(A : Matrix n l α)
(B : Matrix n m α)
(C : Matrix o l α)
(D : Matrix o m α)
(A' : Matrix l p α)
(B' : Matrix l q α)
(C' : Matrix m p α)
(D' : Matrix m q α)

Matrix.fromBlocks A B C D * Matrix.fromBlocks A' B' C' D' =
  Matrix.fromBlocks (A * A' + B * C') (A * B' + B * D') (C * A' + D * C') (C * B' + D * D')


@[simp] theorem abs_dist {a b : α} : |dist a b| = dist a b

{α : Type u}
[PseudoMetricSpace α]
{a b : α}


@[simp]
theorem constantCoeff_comp_C : (constantCoeff R).comp (C R) = RingHom.id R

(PowerSeries.constantCoeff R).comp (PowerSeries.C R) = RingHom.id R


protected theorem one_dvd (n : Int) : 1 ∣ n


/-- Lebesgue integral over a set is monotone in function.

This version assumes that the upper estimate is an a.e. measurable function
and the estimate holds a.e. on the set.
See also `setLIntegral_mono_ae'` for a version that assumes measurability of the set
but assumes no regularity of either function. -/
theorem setLIntegral_mono_ae {s : Set α} {f g : α → ℝ≥0∞} (hg : AEMeasurable g (μ.restrict s))
    (hfg : ∀ᵐ x ∂μ, x ∈ s → f x ≤ g x) : ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in s, g x ∂μ

(hfg : ∀ᵐ (x : α) ∂μ, x ∈ s → f x ≤ g x)

∫⁻ (x : α) in s, f x ∂μ ≤ ∫⁻ (x : α) in s, g x ∂μ


@[simp]
theorem sumProdDistrib_symm_apply_left (a : α × γ) :
    (sumProdDistrib α β γ).symm (inl a) = (inl a.1, a.2)

{α : Type u_1}
{γ : Type u_2}
{β : Type u_3}
(a : α × γ)

(Equiv.sumProdDistrib α β γ).symm (Sum.inl a) = (Sum.inl a.1, a.2)


@[to_additive (attr := simp)]
theorem colimit_inv_mk_eq (x : Σ j, F.obj j) : (G.mk.{v, u} F x)⁻¹ = G.mk F ⟨x.1, x.2⁻¹⟩

{J : Type v}
[CategoryTheory.SmallCategory J]
[CategoryTheory.IsFiltered J]
(F : J ⥤ Grp)
(x : (j : J) × ↑(F.obj j))

(Grp.FilteredColimits.G.mk F x)⁻¹ = Grp.FilteredColimits.G.mk F ⟨x.fst, x.snd⁻¹⟩


@[reassoc]
lemma descOpcycles_comp {A A' : C} (k : K.X i ⟶ A) (j : ι) (hj : c.prev i = j)
    (hk : K.d j i ≫ k = 0) (α : A ⟶ A') :
    K.descOpcycles k j hj hk ≫ α = K.descOpcycles (k ≫ α) j hj
      (by rw [reassoc_of% hk, zero_comp])

K.descOpcycles k j hj hk ≫ α = K.descOpcycles (k ≫ α) j hj ⋯


@[simp, norm_cast]
theorem coe_centralizer (s : Set A) : (centralizer R s : Set A) = s.centralizer

(R : Type u)
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(s : Set A)

↑(Subalgebra.centralizer R s) = s.centralizer


@[simp] theorem forall_apply_eq_imp_iff₂ {f : α → β} {p : α → Prop} {q : β → Prop} :
    (∀ b a, p a → f a = b → q b) ↔ ∀ a, p a → q (f a)

{α : Sort u_2}
{β : Sort u_1}
{f : α → β}
{p : α → Prop}
{q : β → Prop}

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


@[simp] lemma erase_idem (s : UpperSet α) (a : α) : (s.erase a).erase a = s.erase a

{α : Type u_1}
[Preorder α]
(s : UpperSet α)
(a : α)


@[simp]
theorem balancedCoreAux_empty : balancedCoreAux 𝕜 (∅ : Set E) = ∅

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


@[simp]
theorem expand_one : expand 1 = AlgHom.id R (MvPolynomial σ R)

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]

MvPolynomial.expand 1 = AlgHom.id R (MvPolynomial σ R)


theorem covBy_sup_of_inf_covBy_of_inf_covBy_left : a ⊓ b ⋖ a → a ⊓ b ⋖ b → a ⋖ a ⊔ b

{α : Type u_1}
[Lattice α]
[IsWeakUpperModularLattice α]
{a b : α}


theorem liminf_le_of_le {f : Filter β} {u : β → α} {a}
    (hf : f.IsBoundedUnder (· ≥ ·) u := by isBoundedDefault)
    (h : ∀ b, (∀ᶠ n in f, b ≤ u n) → b ≤ a) : liminf u f ≤ a

(hf : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f u := by isBoundedDefault)

(h : ∀ (b : α), (∀ᶠ (n : β) in f, b ≤ u n) → b ≤ a)


theorem OneOneEquiv.of_equiv {α β} [Primcodable α] [Primcodable β] {e : α ≃ β} (h : e.Computable)
    {p} : OneOneEquiv (p ∘ e) p

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{e : α ≃ β}
(h : e.Computable)
{p : β → Prop}


@[simp]
lemma const_zero : const α (0 : Measure β) = 0

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}


{S : Type u_5}
[OrderedSemiring S]
{R : Type u_6}
[Semiring R]
(abv : R → S)
[IsAbsoluteValue abv]
(x : R)


/-- `Equiv.Perm.sigmaCongrRight` as a `MonoidHom`.

This is particularly useful for its `MonoidHom.range` projection, which is the subgroup of
permutations which do not exchange elements between fibers. -/
@[simps]
def sigmaCongrRightHom {α : Type*} (β : α → Type*) : (∀ a, Perm (β a)) →* Perm (Σa, β a)

{α : Type u_1}
(β : α → Type u_2)
(F : (a : α) → Equiv.Perm (β a))

(Equiv.Perm.sigmaCongrRightHom β) F = Equiv.Perm.sigmaCongrRight F


lemma Measurable.forall [Countable ι] {p : ι → α → Prop} (hp : ∀ i, Measurable (p i)) :
    Measurable fun a ↦ ∀ i, p i a

{α : Type u_1}
{ι : Sort uι}
[MeasurableSpace α]
[Countable ι]
{p : ι → α → Prop}
(hp : ∀ (i : ι), Measurable (p i))


theorem Filter.HasBasis.uniformEquicontinuousOn_iff {κ₁ κ₂ : Type*} {p₁ : κ₁ → Prop}
    {s₁ : κ₁ → Set (β × β)} {p₂ : κ₂ → Prop} {s₂ : κ₂ → Set (α × α)} {F : ι → β → α}
    {S : Set β} (hβ : (𝓤 β ⊓ 𝓟 (S ×ˢ S)).HasBasis p₁ s₁) (hα : (𝓤 α).HasBasis p₂ s₂) :
    UniformEquicontinuousOn F S ↔
      ∀ k₂, p₂ k₂ → ∃ k₁, p₁ k₁ ∧ ∀ x y, (x, y) ∈ s₁ k₁ → ∀ i, (F i x, F i y) ∈ s₂ k₂

{F : ι → β → α}

(hβ : (uniformity β ⊓ Filter.principal (S ×ˢ S)).HasBasis p₁ s₁)

UniformEquicontinuousOn F S ↔
  ∀ (k₂ : κ₂), p₂ k₂ → ∃ k₁, p₁ k₁ ∧ ∀ (x y : β), (x, y) ∈ s₁ k₁ → ∀ (i : ι), (F i x, F i y) ∈ s₂ k₂


/-- `UniqueMul` is preserved by inverse images under injective, multiplicative maps. -/
@[to_additive "`UniqueAdd` is preserved by inverse images under injective, additive maps."]
theorem mulHom_preimage (f : G →ₙ* H) (hf : Function.Injective f) (a0 b0 : G) {A B : Finset H}
    (u : UniqueMul A B (f a0) (f b0)) :
    UniqueMul (A.preimage f hf.injOn) (B.preimage f hf.injOn) a0 b0

{G : Type u_1}
{H : Type u_2}
[Mul G]
[Mul H]
(f : G →ₙ* H)
(hf : Function.Injective ⇑f)
(a0 b0 : G)
{A B : Finset H}
(u : UniqueMul A B (f a0) (f b0))

UniqueMul (A.preimage ⇑f ⋯) (B.preimage ⇑f ⋯) a0 b0


@[simp]
theorem mem_one {x : A} : x ∈ (1 : Submodule R A) ↔ ∃ y, algebraMap R A y = x

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


@[simp]
theorem coe_IccExtend (f : C(Set.Icc a b, β)) :
    ((IccExtend h f : C(α, β)) : α → β) = Set.IccExtend h f

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[LinearOrder α]
[OrderTopology α]
{a b : α}
(h : a ≤ b)
(f : C(↑(Set.Icc a b), β))

⇑(ContinuousMap.IccExtend h f) = Set.IccExtend h ⇑f


theorem Filter.Tendsto.prod_mk_nhds {γ} {x : X} {y : Y} {f : Filter γ} {mx : γ → X} {my : γ → Y}
    (hx : Tendsto mx f (𝓝 x)) (hy : Tendsto my f (𝓝 y)) :
    Tendsto (fun c => (mx c, my c)) f (𝓝 (x, y))

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{γ : Type u_5}
{x : X}
{y : Y}
{f : Filter γ}
{mx : γ → X}
{my : γ → Y}
(hx : Filter.Tendsto mx f (𝓝 x))
(hy : Filter.Tendsto my f (𝓝 y))

Filter.Tendsto (fun c => (mx c, my c)) f (𝓝 (x, y))


@[simp]
theorem comp_restrict (f : R →+* S) (s' : σR) (s : σS) (h : ∀ x ∈ s', f x ∈ s) :
    (SubsemiringClass.subtype s).comp (f.restrict s' s h) = f.comp (SubsemiringClass.subtype s')

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
{σR : Type u_1}
{σS : Type u_2}
[SetLike σR R]
[SetLike σS S]
[SubsemiringClass σR R]
[SubsemiringClass σS S]
(f : R →+* S)
(s' : σR)
(s : σS)
(h : ∀ x ∈ s', f x ∈ s)


lemma ediv_dvd_of_dvd (hmn : m ∣ n) : n / m ∣ n


theorem filter_nsmul (s : Multiset α) (n : ℕ) : filter p (n • s) = n • filter p s

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
(s : Multiset α)
(n : ℕ)

Multiset.filter p (n • s) = n • Multiset.filter p s


lemma div_im (z w : ℂ) : (z / w).im = z.im * w.re / normSq w - z.re * w.im / normSq w

(z / w).im = z.im * w.re / Complex.normSq w - z.re * w.im / Complex.normSq w


theorem conts_stable_of_terminated (n_le_m : n ≤ m) (terminatedAt_n : g.TerminatedAt n) :
    g.conts m = g.conts n

{K : Type u_1}
{g : GenContFract K}
{n m : ℕ}
[DivisionRing K]
(n_le_m : n ≤ m)
(terminatedAt_n : g.TerminatedAt n)


@[to_additive (attr := simp)]
lemma fiberEquiv_symm_apply (f : α →* H) (a b : α) (g : f ⁻¹' {f b}) :
    (f.fiberEquiv a b).symm g = a * (b⁻¹ * g)

{α : Type u_1}
[AddGroup α]
{H : Type u_2}
[AddGroup H]
(f : α →+ H)
(a b : α)
(g : ↑(⇑f ⁻¹' {f b}))

↑((f.fiberEquiv a b).symm g) = a + (-b + ↑g)


@[to_additive sum_pos]
lemma one_lt_prod (hf : 1 < f) : 1 < ∏ i, f i

{ι : Type u_1}
{M : Type u_4}
[Fintype ι]
[OrderedCancelAddCommMonoid M]
{f : ι → M}
(hf : 0 < f)


theorem op_iInf (S : ι → Subsemiring R) : (iInf S).op = ⨅ i, (S i).op

{ι : Sort u_1}
{R : Type u_2}
[NonAssocSemiring R]
(S : ι → Subsemiring R)


theorem sdiff_def [SDiff α] (a b : Part α) : a \ b = bind a fun y => map (y \ ·) b

a \ b = do
  let y ← a
  Part.map (fun x => y \ x) b


theorem IsZero.hasZeroObject {X : C} (hX : IsZero X) : HasZeroObject C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : C}
(hX : CategoryTheory.Limits.IsZero X)


theorem isBoundedBilinearMap_comp :
    IsBoundedBilinearMap 𝕜 fun p : (F →L[𝕜] G) × (E →L[𝕜] F) => p.1.comp p.2

{𝕜 : 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]

IsBoundedBilinearMap 𝕜 fun p => p.1.comp p.2