/-- A group homomorphism (a bundled morphism of a type that implements `MonoidHomClass`) between
two uniform groups is uniformly continuous provided that it is continuous at one. See also
`continuous_of_continuousAt_one`. -/
@[to_additive "An additive group homomorphism (a bundled morphism of a type that implements
`AddMonoidHomClass`) between two uniform additive groups is uniformly continuous provided that it
is continuous at zero. See also `continuous_of_continuousAt_zero`."]
theorem uniformContinuous_of_continuousAt_one {hom : Type*} [UniformSpace β] [Group β]
    [UniformGroup β] [FunLike hom α β] [MonoidHomClass hom α β]
    (f : hom) (hf : ContinuousAt f 1) :
    UniformContinuous f

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
{hom : Type u_3}
[UniformSpace β]
[AddGroup β]
[UniformAddGroup β]
[FunLike hom α β]
[AddMonoidHomClass hom α β]
(f : hom)
(hf : ContinuousAt (⇑f) 0)


/-- A map is proper if and only if it is closed and its fibers are compact. -/
theorem isProperMap_iff_isClosedMap_and_compact_fibers :
    IsProperMap f ↔ Continuous f ∧ IsClosedMap f ∧ ∀ y, IsCompact (f ⁻¹' {y})

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

IsProperMap f ↔ Continuous f ∧ IsClosedMap f ∧ ∀ (y : Y), IsCompact (f ⁻¹' {y})


@[simp]
theorem mulRight_eq_zero_iff (a : A) : mulRight R a = 0 ↔ a = 0

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


@[simp]
theorem image_fst_graph [DecidableEq α] (f : α →₀ M) : f.graph.image Prod.fst = f.support

{α : Type u_1}
{M : Type u_5}
[Zero M]
[DecidableEq α]
(f : α →₀ M)

Finset.image Prod.fst f.graph = f.support


@[to_additive]
theorem SemiconjBy.pi {x y z : ∀ i, f i} (h : ∀ i, SemiconjBy (x i) (y i) (z i)) :
    SemiconjBy x y z

(h : ∀ (i : I), AddSemiconjBy (x i) (y i) (z i))


/-- An isometric automorphism of an oriented real inner product space of dimension 2 (usual notation
`J`). This automorphism squares to -1. We will define rotations in such a way that this
automorphism is equal to rotation by 90 degrees. -/
irreducible_def rightAngleRotation : E ≃ₗᵢ[ℝ] E

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

o.rightAngleRotation = LinearIsometryEquiv.ofLinearIsometry o.rightAngleRotationAux₂ (-o.rightAngleRotationAux₁) ⋯ ⋯


@[simp]
theorem darts_nil {u : V} : (nil : G.Walk u u).darts = []

{V : Type u}
{G : SimpleGraph V}
{u : V}


@[to_additive (attr := simp)]
theorem mul_bind (f : α → FreeSemigroup β) (x y : FreeSemigroup α) :
    x * y >>= f = (x >>= f) * (y >>= f)

{α β : Type u}
(f : α → FreeAddSemigroup β)
(x y : FreeAddSemigroup α)


@[to_additive]
theorem div_ball_one : s / ball 1 δ = thickening δ s

{E : Type u_1}
[SeminormedCommGroup E]
(δ : ℝ)
(s : Set E)

s / Metric.ball 1 δ = Metric.thickening δ s


theorem CG.sup {N₁ N₂ : L.Substructure M} (hN₁ : N₁.CG) (hN₂ : N₂.CG) : (N₁ ⊔ N₂).CG

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
{N₁ N₂ : L.Substructure M}
(hN₁ : N₁.CG)
(hN₂ : N₂.CG)


@[to_additive]
theorem pow_smul_mem_closure_smul {N : Type*} [CommMonoid N] [MulAction M N] [IsScalarTower M N N]
    (r : M) (s : Set N) {x : N} (hx : x ∈ closure s) : ∃ n : ℕ, r ^ n • x ∈ closure (r • s)

{M : Type u_3}
[AddMonoid M]
{N : Type u_6}
[AddCommMonoid N]
[AddAction M N]
[VAddAssocClass M N N]
(r : M)
(s : Set N)
{x : N}
(hx : x ∈ AddSubmonoid.closure s)

∃ n, n • r +ᵥ x ∈ AddSubmonoid.closure (r +ᵥ s)


@[to_additive exists_pos_of_sum_zero_of_exists_nonzero]
theorem exists_one_lt_of_prod_one_of_exists_ne_one' (f : ι → M) (h₁ : ∏ i ∈ s, f i = 1)
    (h₂ : ∃ i ∈ s, f i ≠ 1) : ∃ i ∈ s, 1 < f i

{ι : Type u_1}
{M : Type u_4}
[LinearOrderedCancelAddCommMonoid M]
{s : Finset ι}
(f : ι → M)
(h₁ : ∑ i ∈ s, f i = 0)
(h₂ : ∃ i ∈ s, f i ≠ 0)


/-- Construct `I`-adic cauchy sequence from sequence satisfying the successive cauchy condition. -/
@[simps]
def AdicCauchySequence.mk (f : ℕ → M)
    (h : ∀ n, f n ≡ f (n + 1) [SMOD (I ^ n • ⊤ : Submodule R M)]) : AdicCauchySequence I M

(h : ∀ (n : ℕ), f n ≡ f (n + 1) [SMOD I ^ n • ⊤])

∀ (a : ℕ), ↑(AdicCompletion.AdicCauchySequence.mk I M f h) a = f a


theorem IsReduced.nodup_leftInvSeq {ω : List B} (rω : cs.IsReduced ω) : List.Nodup (lis ω)

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
{ω : List B}
(rω : cs.IsReduced ω)


@[to_additive]
theorem toMap_injective : Function.Injective (@LocalizationMap.toMap _ _ S N _)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]


lemma associated_den_num_inv (x : K) (hx : x ≠ 0) : Associated (den A x : A) (num A x⁻¹)

{A : Type u_4}
[CommRing A]
[IsDomain A]
[UniqueFactorizationMonoid A]
{K : Type u_5}
[Field K]
[Algebra A K]
[IsFractionRing A K]
(x : K)
(hx : x ≠ 0)

Associated (↑(IsFractionRing.den A x)) (IsFractionRing.num A x⁻¹)


theorem hasSum_iteratedFDeriv [CharZero 𝕜] {y : E} (hy : y ∈ EMetric.ball 0 r) :
    HasSum (fun n ↦ (n ! : 𝕜)⁻¹ • iteratedFDeriv 𝕜 n f x fun _ ↦ y) (f (x + y))

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : FormalMultilinearSeries 𝕜 E F}
{f : E → F}
{x : E}
{r : ℝ≥0∞}
(h : HasFPowerSeriesOnBall f p x r)
[CompleteSpace F]
[CharZero 𝕜]
{y : E}
(hy : y ∈ EMetric.ball 0 r)

HasSum (fun n => (↑n.factorial)⁻¹ • (iteratedFDeriv 𝕜 n f x) fun x => y) (f (x + y))


/-- If `E / F` is separable, then the perfect closure of `F` in `E` is equal to `F`. Note that
  the converse is not necessarily true (see https://math.stackexchange.com/a/3009197)
  even when `E / F` is algebraic. -/
theorem perfectClosure.eq_bot_of_isSeparable [Algebra.IsSeparable F E] : perfectClosure F E = ⊥

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
[Algebra.IsSeparable F E]


@[simp]
theorem constantCoeff_coe : PowerSeries.constantCoeff R φ = φ.coeff 0

{R : Type u_2}
[CommSemiring R]
(φ : Polynomial R)

(PowerSeries.constantCoeff R) ↑φ = φ.coeff 0


theorem cardinal_mk_lift_le_mul :
    Cardinal.lift.{u} #{ x : A // IsAlgebraic R x } ≤ Cardinal.lift.{v} #R[X] * ℵ₀

(R : Type u)
(A : Type v)
[CommRing R]
[CommRing A]
[IsDomain A]
[Algebra R A]
[NoZeroSMulDivisors R A]

Cardinal.lift.{u, v} #{ x // IsAlgebraic R x } ≤ Cardinal.lift.{v, u} #R[X] * ℵ₀


@[to_additive]
theorem invRev_injective : Function.Injective (@invRev α)


theorem mem_segment_sub_add [Invertible (2 : 𝕜)] (x y : E) : x ∈ [x - y -[𝕜] x + y]

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Invertible 2]
(x y : E)


@[simp]
theorem apply_apply' (v : E) (f : E →SL[σ₁₂] F) : apply' F σ₁₂ v f = f v

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(v : E)
(f : E →SL[σ₁₂] F)

((ContinuousLinearMap.apply' F σ₁₂) v) f = f v


/-- The set of points which are isolated on the right is countable when the space is
second-countable. -/
theorem countable_setOf_covBy_right [OrderTopology α] [SecondCountableTopology α] :
    Set.Countable { x : α | ∃ y, x ⋖ y }

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]


theorem Minpoly.toAdjoin.surjective : Function.Surjective (Minpoly.toAdjoin R x)

(R : Type u)
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(x : S)

Function.Surjective ⇑(AdjoinRoot.Minpoly.toAdjoin R x)


theorem LipschitzWith.integrable_comp_iff_of_antilipschitz {K K'} {f : α → β} {g : β → γ}
    (hg : LipschitzWith K g) (hg' : AntilipschitzWith K' g) (g0 : g 0 = 0) :
    Integrable (g ∘ f) μ ↔ Integrable f μ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
[NormedAddCommGroup γ]
{K K' : ℝ≥0}
{f : α → β}
{g : β → γ}
(hg : LipschitzWith K g)
(hg' : AntilipschitzWith K' g)
(g0 : g 0 = 0)

MeasureTheory.Integrable (g ∘ f) μ ↔ MeasureTheory.Integrable f μ


@[local simp] protected theorem neg_mul (a b : Int) : -a * b = -(a * b)


theorem HasFiniteIntegral.congr' {f : α → β} {g : α → γ} (hf : HasFiniteIntegral f μ)
    (h : ∀ᵐ a ∂μ, ‖f a‖ = ‖g a‖) : HasFiniteIntegral g μ

(hf : MeasureTheory.HasFiniteIntegral f μ)


lemma fermatLastTheoremWith_nat_int_rat_tfae (n : ℕ) :
    TFAE [FermatLastTheoremWith ℕ n, FermatLastTheoremWith ℤ n, FermatLastTheoremWith ℚ n]

[FermatLastTheoremWith ℕ n, FermatLastTheoremWith ℤ n, FermatLastTheoremWith ℚ n].TFAE


@[simp]
theorem matPolyEquiv_symm_apply_coeff (p : (Matrix n n R)[X]) (i j : n) (k : ℕ) :
    coeff (matPolyEquiv.symm p i j) k = coeff p k i j

{R : Type u_1}
[CommSemiring R]
{n : Type w}
[DecidableEq n]
[Fintype n]
(p : (Matrix n n R)[X])
(i j : n)
(k : ℕ)

(matPolyEquiv.symm p i j).coeff k = p.coeff k i j


@[simp, norm_cast]
theorem coe_nsmul (n : ℕ) (x : R) : (↑(n • x) : c.Quotient) = n • (x : c.Quotient)

{R : Type u_2}
[AddMonoid R]
[Mul R]
(c : RingCon R)
(n : ℕ)
(x : R)


/-- A module `M` is precomplete with respect to an ideal `I` if every Cauchy sequence converges. -/
class IsPrecomplete : Prop where
  prec' : ∀ f : ℕ → M, (∀ {m n}, m ≤ n → f m ≡ f n [SMOD (I ^ m • ⊤ : Submodule R M)]) →
    ∃ L : M, ∀ n, f n ≡ L [SMOD (I ^ n • ⊤ : Submodule R M)]

{R : Type u_1}
[CommRing R]
{I : Ideal R}
{M : Type u_2}
[AddCommGroup M]
[Module R M]
[self : IsPrecomplete I M]
(f : ℕ → M)

(∀ {m n : ℕ}, m ≤ n → f m ≡ f n [SMOD I ^ m • ⊤]) → ∃ L, ∀ (n : ℕ), f n ≡ L [SMOD I ^ n • ⊤]


theorem iSup_map_single [DecidableEq ι] [Finite ι] :
    ⨆ i, map (LinearMap.single i : φ i →ₗ[R] (i : ι) → φ i) (p i) = pi Set.univ p

{R : Type u}
{ι : Type x}
[Semiring R]
{φ : ι → Type u_1}
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
{p : (i : ι) → Submodule R (φ i)}
[DecidableEq ι]
[Finite ι]

⨆ i, Submodule.map (LinearMap.single i) (p i) = Submodule.pi Set.univ p


@[simp]
theorem map_sup : (I ⊔ I₂).map f = I.map f ⊔ I₂.map f

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L →ₗ⁅R⁆ L'}
{I I₂ : LieIdeal R L}

LieIdeal.map f (I ⊔ I₂) = LieIdeal.map f I ⊔ LieIdeal.map f I₂


@[to_additive (attr := simp)]
theorem mk_coe' (e : M ≃* N) (f h₁ h₂ h₃) : (MulEquiv.mk ⟨f, e, h₁, h₂⟩ h₃ : N ≃* M) = e.symm

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

{ toFun := f, invFun := ⇑e, left_inv := h₁, right_inv := h₂, map_mul' := h₃ } = e.symm


theorem nndist_inv_inv₀ {z w : α} (hz : z ≠ 0) (hw : w ≠ 0) :
    nndist z⁻¹ w⁻¹ = nndist z w / (‖z‖₊ * ‖w‖₊)

{α : Type u_1}
[NormedDivisionRing α]
{z w : α}
(hz : z ≠ 0)
(hw : w ≠ 0)


@[aesop safe apply]
theorem conjugate' {x : R} (hx : IsSelfAdjoint x) (z : R) : IsSelfAdjoint (star z * x * z)

{R : Type u_1}
[Semigroup R]
[StarMul R]
{x : R}
(hx : IsSelfAdjoint x)
(z : R)


theorem locallyConvexSpace_induced {t : TopologicalSpace F} [LocallyConvexSpace 𝕜 F]
    (f : E →ₗ[𝕜] F) : @LocallyConvexSpace 𝕜 E _ _ _ (t.induced f)

{𝕜 : Type u_2}
{E : Type u_3}
{F : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
[AddCommMonoid F]
[Module 𝕜 F]
{t : TopologicalSpace F}
[LocallyConvexSpace 𝕜 F]
(f : E →ₗ[𝕜] F)


theorem Irreducible.ne_zero [MonoidWithZero α] : ∀ {p : α}, Irreducible p → p ≠ 0

{α : Type u_1}
[MonoidWithZero α]
{p : α}


/-- `Fintype.prod_bijective` is a variant of `Finset.prod_bij` that accepts `Function.Bijective`.

See `Function.Bijective.prod_comp` for a version without `h`. -/
@[to_additive "`Fintype.sum_bijective` is a variant of `Finset.sum_bij` that accepts
`Function.Bijective`.

See `Function.Bijective.sum_comp` for a version without `h`. "]
lemma prod_bijective (e : ι → κ) (he : e.Bijective) (f : ι → α) (g : κ → α)
    (h : ∀ x, f x = g (e x)) : ∏ x, f x = ∏ x, g x

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[Fintype ι]
[Fintype κ]
[AddCommMonoid α]
(e : ι → κ)
(he : Function.Bijective e)
(f : ι → α)
(g : κ → α)
(h : ∀ (x : ι), f x = g (e x))


lemma factorial_le_pow : ∀ n, n ! ≤ n ^ n


theorem contMDiffOn_iff_contDiffOn {f : E → E'} {s : Set E} :
    ContMDiffOn 𝓘(𝕜, E) 𝓘(𝕜, E') n f s ↔ ContDiffOn 𝕜 n f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{n : ℕ∞}
{f : E → E'}
{s : Set E}


theorem hyperfilter_le_cofinite : ↑(hyperfilter α) ≤ @cofinite α

↑(Filter.hyperfilter α) ≤ Filter.cofinite


@[reassoc]
theorem id_whiskerLeft_symm {X X' : C} (f : X ⟶ X') :
    f = (λ_ X).inv ≫ 𝟙_ C ◁ f ≫ (λ_ X').hom

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

f =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.leftUnitor X).inv
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft (𝟙_ C) f)
      (CategoryTheory.MonoidalCategory.leftUnitor X').hom)


theorem RingHom.isSemisimpleRing_of_surjective (f : R →+* S) (hf : Function.Surjective f)
    [IsSemisimpleRing R] : IsSemisimpleRing S

{R : Type u_2}
{S : Type u_3}
[Ring R]
[Ring S]
(f : R →+* S)
(hf : Function.Surjective ⇑f)
[IsSemisimpleRing R]


theorem cprankMax_sum [Ring α] {β} {n : ℕ} (s : Finset β) (f : β → Holor α ds) :
    (∀ x ∈ s, CPRankMax n (f x)) → CPRankMax (s.card * n) (∑ x ∈ s, f x)

{α : Type}
{ds : List ℕ}
[Ring α]
{β : Type u_1}
{n : ℕ}
(s : Finset β)
(f : β → Holor α ds)

(∀ x ∈ s, Holor.CPRankMax n (f x)) → Holor.CPRankMax (s.card * n) (∑ x ∈ s, f x)


@[simp]
theorem deriv_arctan : deriv arctan = fun (x : ℝ) => 1 / (1 + x ^ 2)

deriv Real.arctan = fun x => 1 / (1 + x ^ 2)


@[to_additive (attr := simp) AddMonoid.addOrderOf_eq_one_iff]
theorem orderOf_eq_one_iff : orderOf x = 1 ↔ x = 1


theorem borel_eq_generateFrom_isClosed [TopologicalSpace α] :
    borel α = .generateFrom { s | IsClosed s }

borel α = MeasurableSpace.generateFrom {s | IsClosed s}


private lemma isCoprime_helper {r s t w : 𝓞 K} (hr : ¬ λ ∣ r) (hs : ¬ λ ∣ s)
    (Hp : ∀ {p}, Prime p → p ∣ t → p ∣ w → Associated p λ) (H₁ : ∀ {q}, q ∣ r → q ∣ t)
    (H₂ : ∀ {q}, q ∣ s → q ∣ w) : IsCoprime r s

{r s t w : NumberField.RingOfIntegers K}

(Hp : ∀ {p : NumberField.RingOfIntegers K}, Prime p → p ∣ t → p ∣ w → Associated p (hζ.toInteger - 1))

(H₁ : ∀ {q : NumberField.RingOfIntegers K}, q ∣ r → q ∣ t)

(H₂ : ∀ {q : NumberField.RingOfIntegers K}, q ∣ s → q ∣ w)


theorem IsPiSystem.insert_empty {α} {S : Set (Set α)} (h_pi : IsPiSystem S) :
    IsPiSystem (insert ∅ S)

{α : Type u_1}
{S : Set (Set α)}
(h_pi : IsPiSystem S)


theorem tendsto_nat_floor_mul_div_atTop {a : R} (ha : 0 ≤ a) :
    Tendsto (fun x ↦ (⌊a * x⌋₊ : R) / x) atTop (𝓝 a)

{R : Type u_4}
[TopologicalSpace R]
[LinearOrderedField R]
[OrderTopology R]
[FloorRing R]
{a : R}
(ha : 0 ≤ a)

Filter.Tendsto (fun x => ↑⌊a * x⌋₊ / x) Filter.atTop (𝓝 a)


@[simp] theorem sign_eq_zero_iff_zero (a : Int) : sign a = 0 ↔ a = 0


/-- The open cover associated to an affine open cover. -/
@[simps]
def openCover {X : Scheme.{u}} (𝓤 : X.AffineOpenCover) : X.OpenCover

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

𝓤.openCover.obj j = AlgebraicGeometry.Spec (𝓤.obj j)


lemma cons' {r : R} {rs : List R} (h1 : IsSMulRegular M r)
    (h2 : IsRegular (QuotSMulTop r M) (rs.map (Ideal.Quotient.mk (Ideal.span {r})))) :
    IsRegular M (r :: rs)

(h2 : RingTheory.Sequence.IsRegular (QuotSMulTop r M) (List.map (⇑(Ideal.Quotient.mk (Ideal.span {r}))) rs))

RingTheory.Sequence.IsRegular M (r :: rs)


@[simp, norm_cast]
theorem coe_fst' : ⇑(fst R A B) = Prod.fst

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

⇑(ContinuousAlgHom.fst R A B) = Prod.fst


@[simp]
theorem mem_zeroLocus (x : PrimeSpectrum R) (s : Set R) : x ∈ zeroLocus s ↔ s ⊆ x.asIdeal

{R : Type u}
[CommSemiring R]
(x : PrimeSpectrum R)
(s : Set R)

x ∈ PrimeSpectrum.zeroLocus s ↔ s ⊆ ↑x.asIdeal


@[simp] lemma unop_tensorHom {X₁ Y₁ X₂ Y₂ : Cᵒᵖ} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    (f ⊗ g).unop = f.unop ⊗ g.unop

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

(CategoryTheory.MonoidalCategory.tensorHom f g).unop = CategoryTheory.MonoidalCategory.tensorHom f.unop g.unop


theorem darts_bypass_subset {u v : V} (p : G.Walk u v) : p.bypass.darts ⊆ p.darts

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


@[instance]
theorem isCountablyGenerated_top : IsCountablyGenerated (⊤ : Filter α)


/-- If the map $M' \otimes N \to M \otimes N$ is injective for every finitely generated submodule
$M' \subseteq M$, then it is in fact injective for every submodule $M' \subseteq M$. -/
theorem rTensor_injective_of_forall_FG_rTensor_injective
    (hMN : ∀ (M' : Submodule R M) (_ : M'.FG), Injective (rTensor N M'.subtype))
    (M' : Submodule R M) : Injective (rTensor N M'.subtype)

(hMN : ∀ (M' : Submodule R M), M'.FG → Function.Injective ⇑(LinearMap.rTensor N M'.subtype))


/-- Two linear maps (M ⊗ N) ⊗ (P ⊗ Q) → S which agree on all elements of the
form (m ⊗ₜ n) ⊗ₜ (p ⊗ₜ q) are equal. -/
theorem ext_fourfold' {φ ψ : (M ⊗[R] N) ⊗[R] P ⊗[R] Q →ₗ[R] S}
    (H : ∀ w x y z, φ (w ⊗ₜ x ⊗ₜ (y ⊗ₜ z)) = ψ (w ⊗ₜ x ⊗ₜ (y ⊗ₜ z))) : φ = ψ

{φ ψ : TensorProduct R (TensorProduct R M N) (TensorProduct R P Q) →ₗ[R] S}

(H : ∀ (w : M) (x : N) (y : P) (z : Q), φ ((w ⊗ₜ[R] x) ⊗ₜ[R] y ⊗ₜ[R] z) = ψ ((w ⊗ₜ[R] x) ⊗ₜ[R] y ⊗ₜ[R] z))


lemma mono_iff_isIso_fst (hc : IsLimit c) : Mono f ↔ IsIso c.fst

{c : CategoryTheory.Limits.PullbackCone f f}

CategoryTheory.Mono f ↔ CategoryTheory.IsIso c.fst


@[simp]
theorem num_algebraMap (p : K[X]) : num (algebraMap _ _ p) = p

((algebraMap K[X] (RatFunc K)) p).num = p


/-- Existence of minimizers
Let `u` be a point in a real inner product space, and let `K` be a nonempty complete convex subset.
Then there exists a (unique) `v` in `K` that minimizes the distance `‖u - v‖` to `u`.
 -/
theorem exists_norm_eq_iInf_of_complete_convex {K : Set F} (ne : K.Nonempty) (h₁ : IsComplete K)
    (h₂ : Convex ℝ K) : ∀ u : F, ∃ v ∈ K, ‖u - v‖ = ⨅ w : K, ‖u - w‖

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{K : Set F}
(ne : K.Nonempty)
(h₁ : IsComplete K)
(h₂ : Convex ℝ K)
(u : F)


theorem rep_nonzero (v : ℙ K V) : v.rep ≠ 0

{K : Type u_1}
{V : Type u_2}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(v : Projectivization K V)


theorem continuous_eraseIdx {n : ℕ} : Continuous fun l : List α => eraseIdx l n

{α : Type u_1}
[TopologicalSpace α]
{n : ℕ}


nonrec theorem integral_ofReal {a b : ℝ} {μ : Measure ℝ} {f : ℝ → ℝ} :
    (∫ x in a..b, (f x : ℂ) ∂μ) = ↑(∫ x in a..b, f x ∂μ)

{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
{f : ℝ → ℝ}

∫ (x : ℝ) in a..b, ↑(f x) ∂μ = ↑(∫ (x : ℝ) in a..b, f x ∂μ)


theorem unpair_add_le (n : ℕ) : (unpair n).1 + (unpair n).2 ≤ n


lemma HasRightDerivedFunctor.hasLeftKanExtension [HasRightDerivedFunctor F W] :
    HasLeftKanExtension L F

{C : Type u_1}
{D : Type u_5}
{H : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_6, u_5} D]
[CategoryTheory.Category.{u_4, u_2} H]
(F : CategoryTheory.Functor C H)
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[F.HasRightDerivedFunctor W]


@[simp]
theorem realize_imp : (φ.imp ψ).Realize v ↔ φ.Realize v → ψ.Realize v

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


theorem trailingCoeff_nonzero_iff_nonzero : trailingCoeff p ≠ 0 ↔ p ≠ 0


protected theorem not_lt_zero (o : Ordinal) : ¬o < 0


theorem mono_comp {X Y Z : C} (f : X ⟶ Y) [Mono f] (g : Y ⟶ Z) [Mono g] : Mono (f ≫ g)

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

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


/-- Makes a group homomorphism from a proof that the map preserves multiplication. -/
@[to_additive (attr := simps (config := .asFn))
  "Makes an additive group homomorphism from a proof that the map preserves addition."]
def mk' (f : M → G) (map_mul : ∀ a b : M, f (a * b) = f a * f b) : M →* G

(map_mul : ∀ (a b : M), f (a * b) = f a * f b)


/-- Given a finite set `s`, the product of `f i * g i` over `i ∈ s` equals the product of `f i`
over `i ∈ s` times the product of `g i` over `i ∈ s`. -/
@[to_additive
      "Given a finite set `s`, the sum of `f i + g i` over `i ∈ s` equals the sum of `f i`
      over `i ∈ s` plus the sum of `g i` over `i ∈ s`."]
theorem finprod_mem_mul_distrib (hs : s.Finite) :
    ∏ᶠ i ∈ s, f i * g i = (∏ᶠ i ∈ s, f i) * ∏ᶠ i ∈ s, g i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f g : α → M}
{s : Set α}
(hs : s.Finite)

∑ᶠ (i : α) (_ : i ∈ s), (f i + g i) = ∑ᶠ (i : α) (_ : i ∈ s), f i + ∑ᶠ (i : α) (_ : i ∈ s), g i


theorem filter_product (p : α → Prop) (q : β → Prop) [DecidablePred p] [DecidablePred q] :
    ((s ×ˢ t).filter fun x : α × β => p x.1 ∧ q x.2) = s.filter p ×ˢ t.filter q

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
(p : α → Prop)
(q : β → Prop)
[DecidablePred p]
[DecidablePred q]

Finset.filter (fun x => p x.1 ∧ q x.2) (s ×ˢ t) = Finset.filter p s ×ˢ Finset.filter q t


@[to_additive (attr := simp)]
theorem mul_bind (f : α → FreeSemigroup β) (x y : FreeSemigroup α) :
    x * y >>= f = (x >>= f) * (y >>= f)

{α β : Type u}
(f : α → FreeSemigroup β)
(x y : FreeSemigroup α)


lemma BijOn.prodMap (h₁ : BijOn f₁ s₁ t₁) (h₂ : BijOn f₂ s₂ t₂) :
    BijOn (fun x ↦ (f₁ x.1, f₂ x.2)) (s₁ ×ˢ s₂) (t₁ ×ˢ t₂)

{α₁ : Type u_6}
{α₂ : Type u_7}
{β₁ : Type u_8}
{β₂ : Type u_9}
{s₁ : Set α₁}
{s₂ : Set α₂}
{t₁ : Set β₁}
{t₂ : Set β₂}
{f₁ : α₁ → β₁}
{f₂ : α₂ → β₂}
(h₁ : Set.BijOn f₁ s₁ t₁)
(h₂ : Set.BijOn f₂ s₂ t₂)

Set.BijOn (fun x => (f₁ x.1, f₂ x.2)) (s₁ ×ˢ s₂) (t₁ ×ˢ t₂)


/-- A finite family of ideals is pairwise coprime (that is, any two of them generate the whole ring)
iff when taking all the possible intersections of all but one of these ideals, the resulting family
of ideals still generate the whole ring.

For example with three ideals : `I ⊔ J = I ⊔ K = J ⊔ K = ⊤ ↔ (I ⊓ J) ⊔ (I ⊓ K) ⊔ (J ⊓ K) = ⊤`.

When ideals are all of the form `I i = R ∙ s i`, this is equivalent to the
`exists_sum_eq_one_iff_pairwise_coprime` lemma. -/
theorem iSup_iInf_eq_top_iff_pairwise {t : Finset ι} (h : t.Nonempty) (I : ι → Ideal R) :
    (⨆ i ∈ t, ⨅ (j) (_ : j ∈ t) (_ : j ≠ i), I j) = ⊤ ↔
      (t : Set ι).Pairwise fun i j => I i ⊔ I j = ⊤

{ι : Type u_1}
{R : Type u_2}
[CommSemiring R]
{t : Finset ι}
(h : t.Nonempty)
(I : ι → Ideal R)

⨆ i ∈ t, ⨅ j ∈ t, ⨅ (_ : j ≠ i), I j = ⊤ ↔ (↑t).Pairwise fun i j => I i ⊔ I j = ⊤


@[simp]
theorem interior_Ici' {a : α} (ha : (Iio a).Nonempty) : interior (Ici a) = Ioi a

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a : α}
(ha : (Set.Iio a).Nonempty)


theorem normed_sub (x : E) : f.normed μ (c - x) = f.normed μ (c + x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
[MeasurableSpace E]
{c : E}
(f : ContDiffBump c)
{μ : MeasureTheory.Measure E}
(x : E)


@[simp] theorem and_self_right : (a ∧ b) ∧ b ↔ a ∧ b


/-- **Disintegration** of finite kernels.
The composition-product of `fst κ` and `condKernel κ` is equal to `κ`. -/
@[deprecated Kernel.disintegrate (since := "2024-07-26")]
lemma compProd_fst_condKernel : fst κ ⊗ₖ condKernel κ = κ

[h : MeasurableSpace.CountableOrCountablyGenerated α β]

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


theorem OrthogonalFamily.norm_sum (l : ∀ i, G i) (s : Finset ι) :
    ‖∑ i ∈ s, V i (l i)‖ ^ 2 = ∑ i ∈ s, ‖l i‖ ^ 2

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{G : ι → Type u_5}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
{V : (i : ι) → G i →ₗᵢ[𝕜] E}
(hV : OrthogonalFamily 𝕜 G V)
(l : (i : ι) → G i)
(s : Finset ι)

‖∑ i ∈ s, (V i) (l i)‖ ^ 2 = ∑ i ∈ s, ‖l i‖ ^ 2


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

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Bornology α]
[Bornology β]
[Bornology γ]
{g₁ g₂ : LocallyBoundedMap β γ}
{f : LocallyBoundedMap α β}
(hf : Function.Surjective ⇑f)


theorem Subperm.trans {l₁ l₂ l₃ : List α} (s₁₂ : l₁ <+~ l₂) (s₂₃ : l₂ <+~ l₃) : l₁ <+~ l₃

{α : Type u_1}
{l₁ l₂ l₃ : List α}
(s₁₂ : l₁ <+~ l₂)
(s₂₃ : l₂ <+~ l₃)


@[simp]
theorem Quot.out_eq {r : α → α → Prop} (q : Quot r) : Quot.mk r q.out = q

{α : Sort u_1}
{r : α → α → Prop}
(q : Quot r)


theorem mapDomain_apply {f : α → β} (hf : Function.Injective f) (x : α →₀ M) (a : α) :
    mapDomain f x (f a) = x a

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
{f : α → β}
(hf : Function.Injective f)
(x : α →₀ M)
(a : α)


theorem lt_mul_of_lt_of_one_le' [PosMulMono α] [MulPosStrictMono α] (bc : b < c) (ha : 1 ≤ a)
    (a0 : 0 < a) (b0 : 0 ≤ b) : b < c * a

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


theorem Basis.opNorm_le {ι : Type*} [Fintype ι] (v : Basis ι 𝕜 E) {u : E →L[𝕜] F} {M : ℝ}
    (hM : 0 ≤ M) (hu : ∀ i, ‖u (v i)‖ ≤ M) :
    ‖u‖ ≤ Fintype.card ι • ‖v.equivFunL.toContinuousLinearMap‖ * M

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type w}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace 𝕜]
{ι : Type u_1}
[Fintype ι]
(v : Basis ι 𝕜 E)
{u : E →L[𝕜] F}
{M : ℝ}
(hM : 0 ≤ M)
(hu : ∀ (i : ι), ‖u (v i)‖ ≤ M)

‖u‖ ≤ Fintype.card ι • ‖↑v.equivFunL‖ * M


lemma isOpen_def {s : Set (WithUpper α)} : IsOpen s ↔ (upper α).IsOpen (toUpper ⁻¹' s)

{α : Type u_1}
[Preorder α]
{s : Set (Topology.WithUpper α)}

IsOpen s ↔ TopologicalSpace.IsOpen (⇑Topology.WithUpper.toUpper ⁻¹' s)


@[continuity]
theorem prod_continuous_equiv : Continuous (WithLp.equiv p (α × β))

(p : ℝ≥0∞)
(α : Type u_2)
(β : Type u_3)
[TopologicalSpace α]
[TopologicalSpace β]


theorem limit_ext_iff' (F : J ⥤ Type v) (x y : limit F) :
    x = y ↔ ∀ j, limit.π F j x = limit.π F j y

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ Type v)
(x y : CategoryTheory.Limits.limit F)

x = y ↔ ∀ (j : J), CategoryTheory.Limits.limit.π F j x = CategoryTheory.Limits.limit.π F j y


/-- Given `F : WalkingSpan ⥤ C`, which is really the same as `span (F.map fst) (F.map snd)`,
    and a cocone on `F`, we get a pushout cocone on `F.map fst` and `F.map snd`. -/
@[simps]
def PushoutCocone.ofCocone {F : WalkingSpan ⥤ C} (t : Cocone F) :
    PushoutCocone (F.map fst) (F.map snd)

{F : CategoryTheory.Limits.WalkingSpan ⥤ C}

(CategoryTheory.Limits.PushoutCocone.ofCocone t).pt = t.pt


/-- The composition of two ring homomorphisms is a ring homomorphism. -/
theorem comp (hf : IsRingHom f) {γ} [Ring γ] {g : β → γ} (hg : IsRingHom g) : IsRingHom (g ∘ f)

{α : Type u}
{β : Type v}
[Ring α]
[Ring β]
{f : α → β}
(hf : IsRingHom f)
{γ : Type u_1}
[Ring γ]
{g : β → γ}
(hg : IsRingHom g)


theorem IsRegularOfDegree.top [DecidableEq V] :
    (⊤ : SimpleGraph V).IsRegularOfDegree (Fintype.card V - 1)

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

⊤.IsRegularOfDegree (Fintype.card V - 1)


@[simp]
theorem hsum_add {s t : SummableFamily Γ R α} : (s + t).hsum = s.hsum + t.hsum

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddCommMonoid R]
{α : Type u_3}
{s t : HahnSeries.SummableFamily Γ R α}


/-- Multiplying by all the matrices either in `listTransvecCol M` and `listTransvecRow M` kills
all the coefficients in the last row but the last one. -/
theorem listTransvecCol_mul_mul_listTransvecRow_last_col (hM : M (inr unit) (inr unit) ≠ 0)
    (i : Fin r) :
    ((listTransvecCol M).prod * M * (listTransvecRow M).prod) (inr unit) (inl i) = 0

(M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜)

((Matrix.Pivot.listTransvecCol M).prod * M * (Matrix.Pivot.listTransvecRow M).prod) (Sum.inr ()) (Sum.inl i) = 0


/-- `Matrix.transpose` as a `RingEquiv` to the opposite ring -/
@[simps]
def transposeRingEquiv [AddCommMonoid α] [CommSemigroup α] [Fintype m] :
    Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ

(m : Type u_2)
(α : Type v)
[AddCommMonoid α]
[CommSemigroup α]
[Fintype m]
(M : Matrix m m α)

(Matrix.transposeRingEquiv m α) M = MulOpposite.op Mᵀ


theorem IsMinOn.isLocalMin (hf : IsMinOn f s a) (hs : s ∈ 𝓝 a) : IsLocalMin f a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}
(hf : IsMinOn f s a)
(hs : s ∈ 𝓝 a)


lemma div_conj_eq_sub_one : p / q = p - 1


theorem Perm.bind_right {l₁ l₂ : List α} (f : α → List β) (p : l₁ ~ l₂) : l₁.bind f ~ l₂.bind f

{α : Type u_1}
{β : Type u_2}
{l₁ l₂ : List α}
(f : α → List β)
(p : l₁ ~ l₂)


theorem unbounded_gt_of_forall_exists_ge [Preorder α] (h : ∀ a, ∃ b ∈ s, b ≤ a) :
    Unbounded (· > ·) s

{α : Type u_1}
{s : Set α}
[Preorder α]
(h : ∀ (a : α), ∃ b ∈ s, b ≤ a)


theorem mono {p : α → α → Prop} (hp : ∀ a b, r a b → p a b) : ∀ {a b}, ReflGen r a b → ReflGen p a b

{α : Type u_1}
{r p : α → α → Prop}
(hp : ∀ (a b : α), r a b → p a b)
{a b : α}

Relation.ReflGen r a b → Relation.ReflGen p a b


theorem prod_restrict (s : Set α) (t : Set β) :
    (μ.restrict s).prod (ν.restrict t) = (μ.prod ν).restrict (s ×ˢ t)

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
(s : Set α)
(t : Set β)


theorem le_gauge_of_not_mem (hs₀ : StarConvex ℝ 0 s) (hs₂ : Absorbs ℝ s {x}) (hx : x ∉ a • s) :
    a ≤ gauge s x

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
{x : E}
{a : ℝ}
(hs₀ : StarConvex ℝ 0 s)
(hs₂ : Absorbs ℝ s {x})
(hx : x ∉ a • s)


theorem Submodule.exists_finset_of_mem_iSup {ι : Sort _} (p : ι → Submodule R M) {m : M}
    (hm : m ∈ ⨆ i, p i) : ∃ s : Finset ι, m ∈ ⨆ i ∈ s, p i

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{ι : Type u_4}
(p : ι → Submodule R M)
{m : M}
(hm : m ∈ ⨆ i, p i)


lemma additive_of_preserves_binary_products
    [HasBinaryProducts C] [PreservesLimitsOfShape (Discrete WalkingPair) F]
    [F.PreservesZeroMorphisms] : F.Additive

[CategoryTheory.Limits.PreservesLimitsOfShape (CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair) F]


@[reassoc (attr := simp)]
theorem image.preComp_ι [HasImage g] [HasImage (f ≫ g)] :
    image.preComp f g ≫ image.ι g = image.ι (f ≫ g)

[CategoryTheory.Limits.HasImage (f ≫ g)]

CategoryTheory.Limits.image.preComp f g ≫ CategoryTheory.Limits.image.ι g = CategoryTheory.Limits.image.ι (f ≫ g)


theorem mapDomain_single {G' : Type*} {f : G → G'} {a : G} {b : k} :
    mapDomain f (single a b) = single (f a) b

{k : Type u₁}
{G : Type u₂}
[Semiring k]
{G' : Type u_3}
{f : G → G'}
{a : G}
{b : k}

AddMonoidAlgebra.mapDomain f (AddMonoidAlgebra.single a b) = AddMonoidAlgebra.single (f a) b


@[simp]
theorem comapDomain'_add [∀ i, AddZeroClass (β i)] (h : κ → ι) {h' : ι → κ}
    (hh' : Function.LeftInverse h' h) (f g : Π₀ i, β i) :
    comapDomain' h hh' (f + g) = comapDomain' h hh' f + comapDomain' h hh' g

{ι : Type u}
{β : ι → Type v}
{κ : Type u_1}
[(i : ι) → AddZeroClass (β i)]
(h : κ → ι)
{h' : ι → κ}
(hh' : Function.LeftInverse h' h)
(f g : Π₀ (i : ι), β i)

DFinsupp.comapDomain' h hh' (f + g) = DFinsupp.comapDomain' h hh' f + DFinsupp.comapDomain' h hh' g


theorem zero_left : (0 : VectorMeasure α M) ⟂ᵥ w

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[TopologicalSpace M]
[AddCommMonoid N]
[TopologicalSpace N]
{w : MeasureTheory.VectorMeasure α N}


theorem derivative_prod [DecidableEq ι] {s : Multiset ι} {f : ι → R[X]} :
    derivative (Multiset.map f s).prod =
      (Multiset.map (fun i => (Multiset.map f (s.erase i)).prod * derivative (f i)) s).sum

{R : Type u}
{ι : Type y}
[CommSemiring R]
[DecidableEq ι]
{s : Multiset ι}
{f : ι → R[X]}

Polynomial.derivative (Multiset.map f s).prod =
  (Multiset.map (fun i => (Multiset.map f (s.erase i)).prod * Polynomial.derivative (f i)) s).sum


@[bv_toNat] theorem msb_eq_decide (x : BitVec w) : BitVec.msb x = decide (2 ^ (w-1) ≤ x.toNat)


theorem exists_castSucc_eq_of_ne_last {x : Fin (n + 1)} (h : x ≠ (last _)) :
    ∃ y, Fin.castSucc y = x

{n : ℕ}
{x : Fin (n + 1)}
(h : x ≠ Fin.last n)


theorem Finite.Set.finite_of_finite_image (s : Set α) {f : α → β} (h : s.InjOn f)
    [Finite (f '' s)] : Finite s

{α : Type u}
{β : Type v}
(s : Set α)
{f : α → β}
(h : Set.InjOn f s)
[Finite ↑(f '' s)]


theorem summable_iff_not_tendsto_nat_atTop_of_nonneg {f : ℕ → ℝ} (hf : ∀ n, 0 ≤ f n) :
    Summable f ↔ ¬Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, f i) atTop atTop

Summable f ↔ ¬Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, f i) Filter.atTop Filter.atTop


@[to_additive (attr := simp)]
theorem kerLift_mk' (g : G) : (kerLift φ) (mk g) = φ g

{G : Type u}
[AddGroup G]
{H : Type v}
[AddGroup H]
(φ : G →+ H)
(g : G)


theorem IsInitial.isVanKampenColimit [HasStrictInitialObjects C] {X : C} (h : IsInitial X) :
    IsVanKampenColimit (asEmptyCocone X)


theorem union_eq_self_of_subset_right {s t : Set α} (h : t ⊆ s) : s ∪ t = s


theorem splitMany_le_split (I : Box ι) {s : Finset (ι × ℝ)} {p : ι × ℝ} (hp : p ∈ s) :
    splitMany I s ≤ split I p.1 p.2

{ι : Type u_1}
(I : BoxIntegral.Box ι)
{s : Finset (ι × ℝ)}
{p : ι × ℝ}
(hp : p ∈ s)

BoxIntegral.Prepartition.splitMany I s ≤ BoxIntegral.Prepartition.split I p.1 p.2


theorem eval_eq_eval_mv_eval' (s : Fin n → R) (y : R) (f : MvPolynomial (Fin (n + 1)) R) :
    eval (Fin.cons y s : Fin (n + 1) → R) f =
      Polynomial.eval y (Polynomial.map (eval s) (finSuccEquiv R n f))

{R : Type u}
[CommSemiring R]
{n : ℕ}
(s : Fin n → R)
(y : R)
(f : MvPolynomial (Fin (n + 1)) R)

(MvPolynomial.eval (Fin.cons y s)) f =
  Polynomial.eval y (Polynomial.map (MvPolynomial.eval s) ((MvPolynomial.finSuccEquiv R n) f))


/-- `Matrix.comp` as `RingEquiv` -/
@[simps!]
def compRingEquiv : Matrix I I (Matrix J J R) ≃+* Matrix (I × J) (I × J) R

(I : Type u_1)
(J : Type u_2)
(R : Type u_5)
[Semiring R]
[Fintype I]
[Fintype J]
(n : Matrix (I × J) (I × J) R)
(i j : I)
(k l : J)

(Matrix.compRingEquiv I J R).symm n i j k l = n (i, k) (j, l)


theorem asAlgebraHom_single_one (g : G) : asAlgebraHom ρ (Finsupp.single g 1) = ρ g

{k : Type u_1}
{G : Type u_2}
{V : Type u_3}
[CommSemiring k]
[Monoid G]
[AddCommMonoid V]
[Module k V]
(ρ : Representation k G V)
(g : G)

ρ.asAlgebraHom (Finsupp.single g 1) = ρ g


theorem lookmap_map_eq (g : α → β) (h : ∀ (a), ∀ b ∈ f a, g a = g b) :
    ∀ l : List α, map g (l.lookmap f) = map g l

{α : Type u}
{β : Type v}
(f : α → Option α)
(g : α → β)
(h : ∀ (a b : α), b ∈ f a → g a = g b)
(l : List α)

List.map g (List.lookmap f l) = List.map g l


theorem withDensity_absolutelyContinuous {m : MeasurableSpace α} (μ : Measure α) (f : α → ℝ≥0∞) :
    μ.withDensity f ≪ μ

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


/-- For maps between vector spaces, `mfderiv` and `fderiv` coincide -/
@[simp]
theorem mfderiv_eq_fderiv : mfderiv 𝓘(𝕜, E) 𝓘(𝕜, E') f x = fderiv 𝕜 f x

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


theorem isSupported_int {i : ℤ} {s : Set α} : IsSupported (↑i) s


@[to_additive add_const]
theorem Monotone.mul_const' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (hf : Monotone f) (a : α) :
    Monotone fun x => f x * a

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


@[simp]
lemma yonedaArrow_val {Y : C} {η : yoneda.obj Y ⟶ A} {X : C} {s : yoneda.obj X ⟶ A} {f : X ⟶ Y}
    (hf : yoneda.map f ≫ η = s) : (yonedaArrow f hf).val = f

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

(hf : CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map f) η = s)

(CategoryTheory.OverPresheafAux.OverArrows.yonedaArrow f hf).val = f


@[simp]
theorem HasShift.shift_obj_obj (n : A) (X : C) : (HasShift.shift.obj ⟨n⟩).obj X = X⟦n⟧

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddMonoid A]
[CategoryTheory.HasShift C A]
(n : A)
(X : C)

(CategoryTheory.HasShift.shift.obj { as := n }).obj X = (CategoryTheory.shiftFunctor C n).obj X


theorem foldr'Aux_apply_apply (f : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] N) (m : M) (x_fx) :
    foldr'Aux Q f m x_fx = (ι Q m * x_fx.1, f m x_fx)

((CliffordAlgebra.foldr'Aux Q f) m) x_fx = ((CliffordAlgebra.ι Q) m * x_fx.1, (f m) x_fx)


theorem smul_orthogonalProjection_singleton {v : E} (w : E) :
    ((‖v‖ ^ 2 : ℝ) : 𝕜) • (orthogonalProjection (𝕜 ∙ v) w : E) = ⟪v, w⟫ • v

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

↑(‖v‖ ^ 2) • ↑((orthogonalProjection (Submodule.span 𝕜 {v})) w) = ⟪v, w⟫_𝕜 • v


theorem curryFinFinset_apply_const (hk : s.card = k) (hl : sᶜ.card = l) (f : G[×n]→L[𝕜] G')
    (x y : G) : (curryFinFinset 𝕜 G G' hk hl f (fun _ => x) fun _ => y) =
      f (s.piecewise (fun _ => x) fun _ => y)

(f : ContinuousMultilinearMap 𝕜 (fun i => G) G')

((((ContinuousMultilinearMap.curryFinFinset 𝕜 G G' hk hl) f) fun x_1 => x) fun x => y) =
  f (s.piecewise (fun x_1 => x) fun x => y)


@[simp]
theorem coe_bot : ((⊥ : StarSubalgebra R A) : Set A) = Set.range (algebraMap R A)

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


@[reassoc (attr := simp)]
lemma inr_triangleδ : inr φ ≫ (triangle φ).mor₃ = 0

CochainComplex.mappingCone.inr φ ≫ (CochainComplex.mappingCone.triangle φ).mor₃ = 0


@[measurability]
protected theorem sub [AddGroup β] [ContinuousSub β] (hf : FinStronglyMeasurable f μ)
    (hg : FinStronglyMeasurable g μ) : FinStronglyMeasurable (f - g) μ

(hf : MeasureTheory.FinStronglyMeasurable f μ)

(hg : MeasureTheory.FinStronglyMeasurable g μ)

MeasureTheory.FinStronglyMeasurable (f - g) μ


/-- The shift functor on `DifferentialObject S C` is additive. -/
@[simps!]
nonrec def shiftFunctorAdd (m n : S) :
    shiftFunctor C (m + n) ≅ shiftFunctor C m ⋙ shiftFunctor C n

(X : CategoryTheory.DifferentialObject S C)

((CategoryTheory.DifferentialObject.shiftFunctorAdd C m n).inv.app X).f =
  (CategoryTheory.shiftFunctorAdd C m n).inv.app X.obj


/-- If a function `f` on `β × γ` has product `a` and for each `b` the restriction of `f` to
`{b} × γ` has product `g b`, then the function `g` has product `a`. -/
@[to_additive HasSum.prod_fiberwise "If a series `f` on `β × γ` has sum `a` and for each `b` the
restriction of `f` to `{b} × γ` has sum `g b`, then the series `g` has sum `a`."]
theorem HasProd.prod_fiberwise {f : β × γ → α} {g : β → α} {a : α} (ha : HasProd f a)
    (hf : ∀ b, HasProd (fun c ↦ f (b, c)) (g b)) : HasProd g a

{f : β × γ → α}

(hf : ∀ (b : β), HasProd (fun c => f (b, c)) (g b))


theorem indepSets_of_indepSets_of_le_left {s₁ s₂ s₃ : Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} (h_indep : IndepSets s₁ s₂ κ μ) (h31 : s₃ ⊆ s₁) :
    IndepSets s₃ s₂ κ μ

(h_indep : ProbabilityTheory.Kernel.IndepSets s₁ s₂ κ μ)

ProbabilityTheory.Kernel.IndepSets s₃ s₂ κ μ


@[simp]
theorem coe_toAddSubgroup (s : Subring R) : (s.toAddSubgroup : Set R) = s


@[to_additive]
theorem integral_eq_tsum (h : IsFundamentalDomain G s μ) (f : α → E) (hf : Integrable f μ) :
    ∫ x, f x ∂μ = ∑' g : G, ∫ x in g • s, f x ∂μ

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

∫ (x : α), f x ∂μ = ∑' (g : G), ∫ (x : α) in g +ᵥ s, f x ∂μ


protected theorem map_natCast [DecidableEq n] [AddMonoidWithOne α] [AddMonoidWithOne β]
    {f : α → β} (h : f 0 = 0) (d : ℕ) :
    (d : Matrix n n α).map f = diagonal (fun _ => f d)

{n : Type u_3}
{α : Type v}
{β : Type w}
[DecidableEq n]
[AddMonoidWithOne α]
[AddMonoidWithOne β]
{f : α → β}
(h : f 0 = 0)
(d : ℕ)

(↑d).map f = Matrix.diagonal fun x => f ↑d


@[simp]
lemma log_algebraMap {r : ℝ} : log (algebraMap ℝ A r) = algebraMap ℝ A (Real.log r)

CFC.log ((algebraMap ℝ A) r) = (algebraMap ℝ A) (Real.log r)


/-- An infinite sum of functions with summable sup norm is continuous on a set if each individual
function is. -/
theorem continuousOn_tsum [TopologicalSpace β] {f : α → β → F} {s : Set β}
    (hf : ∀ i, ContinuousOn (f i) s) (hu : Summable u) (hfu : ∀ n x, x ∈ s → ‖f n x‖ ≤ u n) :
    ContinuousOn (fun x => ∑' n, f n x) s

(hfu : ∀ (n : α), ∀ x ∈ s, ‖f n x‖ ≤ u n)

ContinuousOn (fun x => ∑' (n : α), f n x) s


theorem smul_coeff_left [SMulWithZero R V] {x : HahnSeries Γ R}
    {y : HahnModule Γ' R V} {a : Γ'} {s : Set Γ}
    (hs : s.IsPWO) (hxs : x.support ⊆ s) :
    ((of R).symm <| x • y).coeff a =
      ∑ ij ∈ VAddAntidiagonal hs ((of R).symm y).isPWO_support a,
        x.coeff ij.fst • ((of R).symm y).coeff ij.snd

{Γ : Type u_1}
{Γ' : Type u_2}
{R : Type u_3}
{V : Type u_4}
[PartialOrder Γ]
[PartialOrder Γ']
[VAdd Γ Γ']
[IsOrderedCancelVAdd Γ Γ']
[Zero R]
[AddCommMonoid V]
[SMulWithZero R V]
{x : HahnSeries Γ R}
{y : HahnModule Γ' R V}
{a : Γ'}
{s : Set Γ}
(hs : s.IsPWO)
(hxs : x.support ⊆ s)

((HahnModule.of R).symm (x • y)).coeff a =
  ∑ ij ∈ Finset.VAddAntidiagonal hs ⋯ a, x.coeff ij.1 • ((HahnModule.of R).symm y).coeff ij.2


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

{M : Type u_1}
[Monoid M]
(S : Subgroup Mˣ)
{x : M}
(h₁ : IsUnit x)
(h₂ : x ∈ S.ofUnits)


theorem essInf_const (c : β) (hμ : μ ≠ 0) : essInf (fun _ : α => c) μ = c

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[ConditionallyCompleteLattice β]
(c : β)
(hμ : μ ≠ 0)


/-- The inner product of two vectors, divided by the product of their
norms, has absolute value 1 if and only if they are nonzero and one is
a multiple of the other. One form of equality case for Cauchy-Schwarz. -/
theorem abs_real_inner_div_norm_mul_norm_eq_one_iff (x y : F) :
    |⟪x, y⟫_ℝ / (‖x‖ * ‖y‖)| = 1 ↔ x ≠ 0 ∧ ∃ r : ℝ, r ≠ 0 ∧ y = r • x

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(x y : F)

|⟪x, y⟫_ℝ / (‖x‖ * ‖y‖)| = 1 ↔ x ≠ 0 ∧ ∃ r, r ≠ 0 ∧ y = r • x


/-- Relate the integral `cos x ^ n` over `[0, π/2]` to the integral of `sin x ^ n` over `[0, π]`,
which is studied in `Data.Real.Pi.Wallis` and other places. -/
theorem integral_cos_pow_eq (n : ℕ) :
    (∫ x in (0 : ℝ)..π / 2, cos x ^ n) = 1 / 2 * ∫ x in (0 : ℝ)..π, sin x ^ n

∫ (x : ℝ) in 0 ..π / 2, Real.cos x ^ n = 1 / 2 * ∫ (x : ℝ) in 0 ..π, Real.sin x ^ n


theorem Fuzzy.swap_iff {x y : PGame} : x ‖ y ↔ y ‖ x


protected theorem stronglyMeasurable {i : ι} (hf : Adapted f u) : StronglyMeasurable[m] (u i)

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[Preorder ι]
{u : ι → Ω → β}
{f : MeasureTheory.Filtration ι m}
{i : ι}
(hf : MeasureTheory.Adapted f u)


theorem IsLittleO.smul_isBigO (h₁ : k₁ =o[l] k₂) (h₂ : f' =O[l] g') :
    (fun x => k₁ x • f' x) =o[l] fun x => k₂ x • g' x

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
{R : Type u_13}
{𝕜' : Type u_16}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
[SeminormedRing R]
[NormedDivisionRing 𝕜']
{f' : α → E'}
{g' : α → F'}
{l : Filter α}
[Module R E']
[BoundedSMul R E']
[Module 𝕜' F']
[BoundedSMul 𝕜' F']
{k₁ : α → R}
{k₂ : α → 𝕜'}
(h₁ : k₁ =o[l] k₂)
(h₂ : f' =O[l] g')


theorem takeWhile (p : Char → Bool) : ∀ {s}, ValidFor l m r s →
    ValidFor l (m.takeWhile p) (m.dropWhile p ++ r) (s.takeWhile p)

{l m r : List Char}
(p : Char → Bool)
{s : Substring}

Substring.ValidFor l m r s → Substring.ValidFor l (List.takeWhile p m) (List.dropWhile p m ++ r) (s.takeWhile p)


theorem wf (h : WellFounded r) : WellFounded (TC r)

{α : Sort u}
{r : α → α → Prop}
(h : WellFounded r)


theorem pred_strictMono : StrictMono (pred : α → α)

{α : Type u_1}
[Preorder α]
[PredOrder α]
[NoMinOrder α]


theorem id : FinitePresentation (AlgHom.id R A)

(R : Type u_1)
(A : Type u_2)
[CommRing R]
[CommRing A]
[Algebra R A]


@[simp] lemma invert_symm : (invert (R := R)).symm = invert


@[simp]
theorem eval₂_zero : (0 : R[X]).eval₂ f x = 0

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


/-- **Poisson's summation formula**, assuming that both `f` and its Fourier transform decay as
`|x| ^ (-b)` for some `1 < b`. (This is the one-dimensional case of Corollary VII.2.6 of Stein and
Weiss, *Introduction to Fourier analysis on Euclidean spaces*.) -/
theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay {f : ℝ → ℂ} (hc : Continuous f) {b : ℝ}
    (hb : 1 < b) (hf : f =O[cocompact ℝ] (|·| ^ (-b)))
    (hFf : (𝓕 f) =O[cocompact ℝ] (|·| ^ (-b))) (x : ℝ) :
    ∑' n : ℤ, f (x + n) = ∑' n : ℤ, 𝓕 f n * fourier n (x : UnitAddCircle)

(hf : f =O[Filter.cocompact ℝ] fun x => |x| ^ (-b))

(hFf : 𝓕 f =O[Filter.cocompact ℝ] fun x => |x| ^ (-b))

∑' (n : ℤ), f (x + ↑n) = ∑' (n : ℤ), 𝓕 f ↑n * (fourier n) ↑x


lemma quasiIso_iff (φ : S₁ ⟶ S₂) :
    QuasiIso φ ↔ IsIso (homologyMap φ)

CategoryTheory.ShortComplex.QuasiIso φ ↔ CategoryTheory.IsIso (CategoryTheory.ShortComplex.homologyMap φ)


@[to_additive]
theorem unop_iSup (S : ι → Subgroup Gᵐᵒᵖ) : (iSup S).unop = ⨆ i, (S i).unop

{ι : Sort u_1}
{G : Type u_2}
[AddGroup G]
(S : ι → AddSubgroup Gᵃᵒᵖ)


@[to_additive (attr := simp)]
lemma zpow_left (h : Commute a b) (m : ℤ) : Commute (a ^ m) b

{G : Type u_1}
[Group G]
{a b : G}
(h : Commute a b)
(m : ℤ)


/-- An abelian category has finite biproducts. -/
theorem hasFiniteBiproducts : HasFiniteBiproducts C

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


theorem take_theorem (s₁ s₂ : Stream' α) : (∀ n : ℕ, take n s₁ = take n s₂) → s₁ = s₂

(∀ (n : ℕ), Stream'.take n s₁ = Stream'.take n s₂) → s₁ = s₂


theorem add_def (l m : Language α) : l + m = (l ∪ m : Set (List α))


theorem add_eq_zero_iff {n m : WithBot ℕ} : n + m = 0 ↔ n = 0 ∧ m = 0


lemma natCast_ne (n : ℕ) (R) [AddMonoidWithOne R] [h : NeZero (n : R)] : (n : R) ≠ 0

(n : ℕ)
(R : Type u_1)
[AddMonoidWithOne R]
[h : NeZero ↑n]


theorem Finite.inter_of_right {s : Set α} (hs : s.Finite) (t : Set α) : (t ∩ s).Finite

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


theorem Disjoint.conj (H : Disjoint f g) (h : Perm α) : Disjoint (h * f * h⁻¹) (h * g * h⁻¹)

{α : Type u_1}
{f g : Equiv.Perm α}
(H : f.Disjoint g)
(h : Equiv.Perm α)


theorem sin_eq_zero_iff {θ : Angle} : sin θ = 0 ↔ θ = 0 ∨ θ = π


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

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


/-- `α →+o β` is the type of monotone functions `α → β` that preserve the `OrderedAddCommMonoid`
structure.

`OrderAddMonoidHom` is also used for ordered group homomorphisms.

When possible, instead of parametrizing results over `(f : α →+o β)`,
you should parametrize over `(F : Type*) [OrderAddMonoidHomClass F α β] (f : F)`.

When you extend this structure, make sure to extend `OrderAddMonoidHomClass`. -/
structure OrderAddMonoidHom (α β : Type*) [Preorder α] [Preorder β] [AddZeroClass α]
  [AddZeroClass β] extends α →+ β where
  /-- An `OrderAddMonoidHom` is a monotone function. -/
  monotone' : Monotone toFun

{α : Type u_6}
{β : Type u_7}
[Preorder α]
[Preorder β]
[AddZeroClass α]
[AddZeroClass β]
(self : α →+o β)


@[simp]
theorem Spec.sheafedSpaceMap_id {R : CommRingCat.{u}} :
    Spec.sheafedSpaceMap (𝟙 R) = 𝟙 (Spec.sheafedSpaceObj R)

AlgebraicGeometry.Spec.sheafedSpaceMap (CategoryTheory.CategoryStruct.id R) =
  CategoryTheory.CategoryStruct.id (AlgebraicGeometry.Spec.sheafedSpaceObj R)


lemma two_le_iff_pos_of_even {m : ℤ} (even : Even m) : 2 ≤ m ↔ 0 < m


@[simp]
theorem realize_varsToConstants [L[[α]].Structure M] [(lhomWithConstants L α).IsExpansionOn M]
    {t : L.Term (α ⊕ β)} {v : β → M} :
    t.varsToConstants.realize v = t.realize (Sum.elim (fun a => ↑(L.con a)) v)

FirstOrder.Language.Term.realize v t.varsToConstants =
  FirstOrder.Language.Term.realize (Sum.elim (fun a => ↑(L.con a)) v) t


@[simp]
theorem rpow_two (x : ℝ) : x ^ (2 : ℝ) = x ^ 2


theorem norm_setToL1_le (hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C) : ‖setToL1 hT‖ ≤ C

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)


@[simp]
theorem mergeSort_nil : [].mergeSort r = []

{α : Type u}
(r : α → α → Prop)
[DecidableRel r]


/-- A bicategory is called `Strict` if the left unitors, the right unitors, and the associators are
isomorphisms given by equalities.
-/
class Bicategory.Strict : Prop where
  /-- Identity morphisms are left identities for composition. -/
  id_comp : ∀ {a b : B} (f : a ⟶ b), 𝟙 a ≫ f = f := by aesop_cat
  /-- Identity morphisms are right identities for composition. -/
  comp_id : ∀ {a b : B} (f : a ⟶ b), f ≫ 𝟙 b = f := by aesop_cat
  /-- Composition in a bicategory is associative. -/
  assoc : ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), (f ≫ g) ≫ h = f ≫ g ≫ h := by
    aesop_cat
  /-- The left unitors are given by equalities -/
  leftUnitor_eqToIso : ∀ {a b : B} (f : a ⟶ b), λ_ f = eqToIso (id_comp f) := by aesop_cat
  /-- The right unitors are given by equalities -/
  rightUnitor_eqToIso : ∀ {a b : B} (f : a ⟶ b), ρ_ f = eqToIso (comp_id f) := by aesop_cat
  /-- The associators are given by equalities -/
  associator_eqToIso :
    ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), α_ f g h = eqToIso (assoc f g h) := by
    aesop_cat

[self : CategoryTheory.Bicategory.Strict B]

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


theorem inducing_of_inducing_compose
    (hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g ∘ f)) : Inducing f

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{f : X → Y}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(hf : Continuous f)
(hg : Continuous g)
(hgf : Inducing (g ∘ f))


theorem rel_act_of_act_rel_act_of_rel_act (ab : r (μ m a) (μ m b)) (rr : r b (μ m c)) :
    r a (μ m c)

{M : Type u_1}
{N : Type u_2}
{μ : M → N → N}
{r : N → N → Prop}
[ContravariantClass M N μ r]
[IsTrans N r]
(m : M)
{a b c : N}
(ab : r (μ m a) (μ m b))
(rr : r b (μ m c))


@[reassoc (attr := simp)]
theorem μ_naturalityₗ {m n m' : M} (f : m ⟶ m') (X : C) :
    (F.obj n).map ((F.map f).app X) ≫ (F.μ m' n).app X =
      (F.μ m n).app X ≫ (F.map (f ▷ n)).app X

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

CategoryTheory.CategoryStruct.comp ((F.obj n).map ((F.map f).app X)) ((F.μ m' n).app X) =
  CategoryTheory.CategoryStruct.comp ((F.μ m n).app X)
    ((F.map (CategoryTheory.MonoidalCategory.whiskerRight f n)).app X)


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

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

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


theorem threeAPFree_iff_eq_right {s : Set ℕ} :
    ThreeAPFree s ↔ ∀ ⦃a⦄, a ∈ s → ∀ ⦃b⦄, b ∈ s → ∀ ⦃c⦄, c ∈ s → a + c = b + b → a = c

ThreeAPFree s ↔ ∀ ⦃a : ℕ⦄, a ∈ s → ∀ ⦃b : ℕ⦄, b ∈ s → ∀ ⦃c : ℕ⦄, c ∈ s → a + c = b + b → a = c


/-- The nilpotency class of a product is the max of the nilpotency classes of the factors -/
theorem nilpotencyClass_prod [IsNilpotent G₁] [IsNilpotent G₂] :
    Group.nilpotencyClass (G₁ × G₂) =
    max (Group.nilpotencyClass G₁) (Group.nilpotencyClass G₂)

{G₁ : Type u_2}
{G₂ : Type u_3}
[Group G₁]
[Group G₂]
[Group.IsNilpotent G₁]
[Group.IsNilpotent G₂]


@[simp]
theorem codRestrict_apply (p) (f : r ≼i s) (H a) : codRestrict p f H a = ⟨f a, H a⟩

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(p : Set β)
(f : r ≼i s)
(H : ∀ (a : α), f a ∈ p)
(a : α)

(InitialSeg.codRestrict p f H) a = ⟨f a, ⋯⟩


/--
The category of subterminal objects is equivalent to the category of monomorphisms to the terminal
object (which is in turn equivalent to the subobjects of the terminal object).
-/
@[simps]
def subterminalsEquivMonoOverTerminal [HasTerminal C] : Subterminals C ≌ MonoOver (⊤_ C)

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

∀ {X Y : CategoryTheory.Subterminals C} (f : X ⟶ Y),
  (CategoryTheory.subterminalsEquivMonoOverTerminal C).functor.map f = CategoryTheory.MonoOver.homMk f ⋯


@[simp]
theorem zipWith_same (f : α → α → δ) : ∀ l : List α, zipWith f l l = l.map fun a => f a a

{α : Type u}
{δ : Type u_3}
(f : α → α → δ)
(l : List α)

List.zipWith f l l = List.map (fun a => f a a) l


@[simp]
theorem lTensorBot_symm_apply (a : A) : A.lTensorBot.symm a = 1 ⊗ₜ[R] a

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


/-- `MeasureTheory.OuterMeasure.mkMetric'.pre m r` is a trimmed measure provided that
`m (closure s) = m s` for any set `s`. -/
theorem trim_pre [MeasurableSpace X] [OpensMeasurableSpace X] (m : Set X → ℝ≥0∞)
    (hcl : ∀ s, m (closure s) = m s) (r : ℝ≥0∞) : (pre m r).trim = pre m r

(hcl : ∀ (s : Set X), m (closure s) = m s)

(MeasureTheory.OuterMeasure.mkMetric'.pre m r).trim = MeasureTheory.OuterMeasure.mkMetric'.pre m r


@[to_additive]
theorem hasProd_one_iff_of_one_le (hf : ∀ i, 1 ≤ f i) : HasProd f 1 ↔ f = 1

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
(hf : ∀ (i : ι), 0 ≤ f i)


/-- A functor `G : C ⥤ D` sends cones over `F` to cones over `F ⋙ G` functorially. -/
@[simps]
def functoriality : Cone F ⥤ Cone (F ⋙ G)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(F : J ⥤ C)
(G : C ⥤ D)

∀ {X Y : CategoryTheory.Limits.Cone F} (f : X ⟶ Y),
  ((CategoryTheory.Limits.Cones.functoriality F G).map f).hom = G.map f.hom


/-- **Liouville's Theorem** -/
protected theorem transcendental {x : ℝ} (lx : Liouville x) : Transcendental ℤ x


@[to_additive]
theorem QuotientGroup.isOpenMap_coe : IsOpenMap ((↑) : G → G ⧸ N)

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
(N : Subgroup G)


theorem mulPosReflectLE_iff_mulPosReflectLT : MulPosReflectLE α ↔ MulPosReflectLT α

{α : Type u_1}
[CancelMonoidWithZero α]
[PartialOrder α]


theorem of_isLocalizedModule [Module.Flat R M] (S : Submonoid R) [IsLocalization S Rp]
    (f : M →ₗ[R] Mp) [h : IsLocalizedModule S f] : Module.Flat Rp Mp

{R : Type u}
{M : Type u_1}
{Mp : Type u_2}
(Rp : Type v)
[CommRing R]
[AddCommGroup M]
[Module R M]
[CommRing Rp]
[Algebra R Rp]
[AddCommGroup Mp]
[Module R Mp]
[Module Rp Mp]
[IsScalarTower R Rp Mp]
[Module.Flat R M]
(S : Submonoid R)
[IsLocalization S Rp]
(f : M →ₗ[R] Mp)
[h : IsLocalizedModule S f]


lemma piFinset_filter_const [DecidableEq ι] [Fintype ι] :
    (Fintype.piFinset fun _ ↦ s).filter (∃ a ∈ s, const ι a = ·) = s.piDiag ι

{α : Type u_1}
{ι : Type u_2}
[DecidableEq (ι → α)]
{s : Finset α}
[DecidableEq ι]
[Fintype ι]

Finset.filter (fun x => ∃ a ∈ s, Function.const ι a = x) (Fintype.piFinset fun x => s) = s.piDiag ι


@[reassoc (attr := simp)]
theorem unit_rightAdjointUniq_hom {F : C ⥤ D} {G G' : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F ⊣ G') :
    adj1.unit ≫ whiskerLeft F (rightAdjointUniq adj1 adj2).hom = adj2.unit

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

adj1.unit ≫ CategoryTheory.whiskerLeft F (adj1.rightAdjointUniq adj2).hom = adj2.unit


theorem natDegree_basisDivisor_of_ne (hxy : x ≠ y) : (basisDivisor x y).natDegree = 1

{F : Type u_1}
[Field F]
{x y : F}
(hxy : x ≠ y)

(Lagrange.basisDivisor x y).natDegree = 1


@[simp]
theorem coe_add_linearMap (D1 D2 : Derivation R A M) : ↑(D1 + D2) = (D1 + D2 : A →ₗ[R] M)

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(D1 D2 : Derivation R A M)


theorem tendsto_prod_iff' {g' : Filter γ} {s : α → β × γ} :
    Tendsto s f (g ×ˢ g') ↔ Tendsto (fun n => (s n).1) f g ∧ Tendsto (fun n => (s n).2) f g'

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : Filter α}
{g : Filter β}
{g' : Filter γ}
{s : α → β × γ}

Filter.Tendsto s f (g ×ˢ g') ↔ Filter.Tendsto (fun n => (s n).1) f g ∧ Filter.Tendsto (fun n => (s n).2) f g'


theorem padicValNat_dvd_iff (n : ℕ) [hp : Fact p.Prime] (a : ℕ) :
    p ^ n ∣ a ↔ a = 0 ∨ n ≤ padicValNat p a

{p : ℕ}
(n : ℕ)
[hp : Fact (Nat.Prime p)]
(a : ℕ)


theorem algebraMap_snd (k : 𝕜) : (algebraMap 𝕜 𝓜(𝕜, A) k).snd = algebraMap 𝕜 _ k

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(k : 𝕜)

((algebraMap 𝕜 𝓜(𝕜, A)) k).toProd.2 = (algebraMap 𝕜 (A →L[𝕜] A)) k


/-- The total derivative of a function in two variables is the sum of the partial derivatives.
  Note that to state this (without casts) we need to be able to see through the definition of
  `TangentSpace`. -/
theorem mfderiv_prod_eq_add {f : M × M' → M''} {p : M × M'}
    (hf : MDifferentiableAt (I.prod I') I'' f p) :
    mfderiv (I.prod I') I'' f p =
      show E × E' →L[𝕜] E'' from
        mfderiv (I.prod I') I'' (fun z : M × M' => f (z.1, p.2)) p +
          mfderiv (I.prod I') I'' (fun z : M × M' => f (p.1, z.2)) p

mfderiv (I.prod I') I'' f p =
  let_fun this := mfderiv (I.prod I') I'' (fun z => f (z.1, p.2)) p + mfderiv (I.prod I') I'' (fun z => f (p.1, z.2)) p;
  this


/-- If a complex function `e` is differentiable at a real point, then its restriction to `ℝ` is
differentiable there as a function `ℝ → ℂ`, with the same derivative. -/
theorem HasDerivAt.comp_ofReal (hf : HasDerivAt e e' ↑z) : HasDerivAt (fun y : ℝ => e ↑y) e' z

{e : ℂ → ℂ}
{e' : ℂ}
{z : ℝ}
(hf : HasDerivAt e e' ↑z)


theorem bounded_gt_Ioi [Preorder α] (a : α) : Bounded (· > ·) (Ioi a)

Set.Bounded (fun x x_1 => x > x_1) (Set.Ioi a)


/-- The definition of `0 ⧏ x` on pre-games, in terms of `0 ⧏` two moves later. -/
theorem zero_lf {x : PGame} : 0 ⧏ x ↔ ∃ i, ∀ j, 0 ⧏ (x.moveLeft i).moveRight j

SetTheory.PGame.LF 0 x ↔ ∃ i, ∀ (j : (x.moveLeft i).RightMoves), SetTheory.PGame.LF 0 ((x.moveLeft i).moveRight j)


protected theorem Preconnected.ofBoxProdLeft [Nonempty β] (h : (G □ H).Preconnected) :
    G.Preconnected

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{H : SimpleGraph β}
[Nonempty β]
(h : (G □ H).Preconnected)


@[simp]
theorem _root_.Memℓp.star_iff {f : ∀ i, E i} : Memℓp (star f) p ↔ Memℓp f p

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
[(i : α) → StarAddMonoid (E i)]
[∀ (i : α), NormedStarGroup (E i)]
{f : (i : α) → E i}


theorem ContinuousAt.comp_upperSemicontinuousWithinAt_antitone {g : γ → δ} {f : α → γ}
    (hg : ContinuousAt g (f x)) (hf : UpperSemicontinuousWithinAt f s x) (gmon : Antitone g) :
    LowerSemicontinuousWithinAt (g ∘ f) s x


protected theorem neg_div_neg (a b : Int) : (-a).div (-b) = a.div b


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


lemma bound_of_shell_sup (p : ι → Seminorm 𝕜 E) (s : Finset ι)
    (q : Seminorm 𝕜 E) {ε : ℝ} {C : ℝ≥0} (ε_pos : 0 < ε) {c : 𝕜} (hc : 1 < ‖c‖)
    (hf : ∀ x, (∀ i ∈ s, p i x < ε) → ∀ j ∈ s, ε / ‖c‖ ≤ p j x → q x ≤ (C • p j) x)
    {x : E} (hx : ∃ j, j ∈ s ∧ p j x ≠ 0) :
    q x ≤ (C • s.sup p) x

(hf : ∀ (x : E), (∀ i ∈ s, (p i) x < ε) → ∀ j ∈ s, ε / ‖c‖ ≤ (p j) x → q x ≤ (C • p j) x)


theorem IsOpenMap.continuousOn_image_of_leftInvOn {f : α → β} {s : Set α}
    (h : IsOpenMap (s.restrict f)) {finv : β → α} (hleft : LeftInvOn finv f s) :
    ContinuousOn finv (f '' s)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
(h : IsOpenMap (s.restrict f))
{finv : β → α}
(hleft : Set.LeftInvOn finv f s)


theorem cutExpand_singleton {s x} (h : ∀ x' ∈ s, r x' x) : CutExpand r s {x}

{α : Type u_1}
{r : α → α → Prop}
{s : Multiset α}
{x : α}
(h : ∀ x' ∈ s, r x' x)


theorem strictConvex_empty : StrictConvex 𝕜 (∅ : Set E)

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[AddCommMonoid E]
[SMul 𝕜 E]


theorem mem_smul_pointwise_iff_exists (g : G) (x : K) (S : ValuationSubring K) :
    x ∈ g • S ↔ ∃ s : K, s ∈ S ∧ g • s = x

{K : Type u}
[Field K]
{G : Type u_1}
[Group G]
[MulSemiringAction G K]
(g : G)
(x : K)
(S : ValuationSubring K)


@[simp]
theorem sin_nat_mul_pi (n : ℕ) : sin (n * π) = 0


/-- Order isomorphism between the space of monotone maps to `β × γ` and the product of the spaces
of monotone maps to `β` and `γ`. -/
@[simps]
def prodIso : (α →o β × γ) ≃o (α →o β) × (α →o γ)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
(f : (α →o β) × (α →o γ))

(RelIso.symm OrderHom.prodIso) f = f.1.prod f.2


lemma _root_.MvPolynomial.isHomogeneous_C_mul_X_pow (r : R) (i : σ) (n : ℕ) :
    (C r * X i ^ n).IsHomogeneous n

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

(MvPolynomial.C r * MvPolynomial.X i ^ n).IsHomogeneous n


@[simp]
theorem comul_apply (r : R) : comul r = 1 ⊗ₜ[R] r


/-- Since the map `b ↦ cramer A b` is linear in `b`, it must be multiplication by some matrix. This
matrix is `A.adjugate`. -/
theorem cramer_eq_adjugate_mulVec (A : Matrix n n α) (b : n → α) :
    cramer A b = A.adjugate *ᵥ b

{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[CommRing α]
(A : Matrix n n α)
(b : n → α)


@[simp]
lemma neg_comp
    {a b c : M} (α : ShiftedHom X Y a) (β : ShiftedHom Y Z b) (h : b + a = c) :
    (-α).comp β h = -α.comp β h

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
{M : Type u_4}
[AddMonoid M]
[CategoryTheory.HasShift C M]
{X Y Z : C}
[CategoryTheory.Preadditive C]
{a b c : M}
(α : CategoryTheory.ShiftedHom X Y a)
(β : CategoryTheory.ShiftedHom Y Z b)
(h : b + a = c)


theorem StableUnderBaseChange.fst {P : MorphismProperty C} (hP : StableUnderBaseChange P)
    {X Y S : C} (f : X ⟶ S) (g : Y ⟶ S) [HasPullback f g] (H : P g) :
    P (pullback.fst f g)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P : CategoryTheory.MorphismProperty C}
(hP : P.StableUnderBaseChange)
{X Y S : C}
(f : X ⟶ S)
(g : Y ⟶ S)
[CategoryTheory.Limits.HasPullback f g]
(H : P g)

P (CategoryTheory.Limits.pullback.fst f g)


@[simp]
theorem coe_id : ⇑(OrderRingHom.id α) = id

(α : Type u_2)
[NonAssocSemiring α]
[Preorder α]


theorem Monotone.map_sInf_le [CompleteLattice β] {s : Set α} {f : α → β} (hf : Monotone f) :
    f (sInf s) ≤ ⨅ a ∈ s, f a

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
[CompleteLattice β]
{s : Set α}
{f : α → β}
(hf : Monotone f)


theorem sum_basis (hvs : Set.InjOn v s) (hs : s.Nonempty) :
    ∑ j ∈ s, Lagrange.basis s v j = 1

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
(hvs : Set.InjOn v ↑s)
(hs : s.Nonempty)


@[simp]
theorem Quotient.algebraMap_eq (I : Ideal R) : algebraMap R (R ⧸ I) = Quotient.mk I

algebraMap R (R ⧸ I) = Ideal.Quotient.mk I


@[simp] lemma bddBelow_smul_iff_of_pos (ha : 0 < a) : BddBelow (a • s) ↔ BddBelow s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[GroupWithZero α]
[Zero β]
[MulActionWithZero α β]
[PosSMulMono α β]
[PosSMulReflectLE α β]
{s : Set β}
{a : α}
(ha : 0 < a)


@[simp]
theorem foldl_algebraMap (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) (r : R) :
    foldl Q f hf n (algebraMap R _ r) = r • n

((CliffordAlgebra.foldl Q f hf) n) ((algebraMap R (CliffordAlgebra Q)) r) = r • n


@[to_additive]
theorem eq_bot_of_card_eq (h : Nat.card H = 1) : H = ⊥

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
(h : Nat.card ↥H = 1)


theorem numeric_of_isEmpty_rightMoves (x : PGame) [IsEmpty x.RightMoves]
    (H : ∀ i, Numeric (x.moveLeft i)) : Numeric x

(H : ∀ (i : x.LeftMoves), (x.moveLeft i).Numeric)


/-- **Divergence theorem** for functions on the plane. It is formulated in terms of two functions
`f g : ℝ × ℝ → E` and iterated integral `∫ x in a₁..b₁, ∫ y in a₂..b₂, _`, where
`a₁ a₂ b₁ b₂ : ℝ`. When thinking of `f` and `g` as the two coordinates of a single function
`F : ℝ × ℝ → E × E` and when `E = ℝ`, this is the usual statement that the integral of the
divergence of `F` inside the rectangle with vertices `(aᵢ, bⱼ)`, `i, j =1,2`, equals the integral of
the normal derivative of `F` along the boundary.

See also `MeasureTheory.integral_divergence_prod_Icc_of_hasFDerivWithinAt_off_countable_of_le`
for a version that uses an integral over `Icc a b`, where `a b : ℝ × ℝ`, `a ≤ b`. -/
theorem integral2_divergence_prod_of_hasFDerivWithinAt_off_countable (f g : ℝ × ℝ → E)
    (f' g' : ℝ × ℝ → ℝ × ℝ →L[ℝ] E) (a₁ a₂ b₁ b₂ : ℝ) (s : Set (ℝ × ℝ)) (hs : s.Countable)
    (Hcf : ContinuousOn f ([[a₁, b₁]] ×ˢ [[a₂, b₂]]))
    (Hcg : ContinuousOn g ([[a₁, b₁]] ×ˢ [[a₂, b₂]]))
    (Hdf : ∀ x ∈ Ioo (min a₁ b₁) (max a₁ b₁) ×ˢ Ioo (min a₂ b₂) (max a₂ b₂) \ s,
      HasFDerivAt f (f' x) x)
    (Hdg : ∀ x ∈ Ioo (min a₁ b₁) (max a₁ b₁) ×ˢ Ioo (min a₂ b₂) (max a₂ b₂) \ s,
      HasFDerivAt g (g' x) x)
    (Hi : IntegrableOn (fun x => f' x (1, 0) + g' x (0, 1)) ([[a₁, b₁]] ×ˢ [[a₂, b₂]])) :
    (∫ x in a₁..b₁, ∫ y in a₂..b₂, f' (x, y) (1, 0) + g' (x, y) (0, 1)) =
      (((∫ x in a₁..b₁, g (x, b₂)) - ∫ x in a₁..b₁, g (x, a₂)) + ∫ y in a₂..b₂, f (b₁, y)) -
        ∫ y in a₂..b₂, f (a₁, y)

(Hdf : ∀ x ∈ Set.Ioo (min a₁ b₁) (max a₁ b₁) ×ˢ Set.Ioo (min a₂ b₂) (max a₂ b₂) \ s, HasFDerivAt f (f' x) x)

(Hdg : ∀ x ∈ Set.Ioo (min a₁ b₁) (max a₁ b₁) ×ˢ Set.Ioo (min a₂ b₂) (max a₂ b₂) \ s, HasFDerivAt g (g' x) x)

(Hi :
  MeasureTheory.IntegrableOn (fun x => (f' x) (1, 0) + (g' x) (0, 1)) ([[a₁, b₁]] ×ˢ [[a₂, b₂]]) MeasureTheory.volume)


@[simp]
theorem preimage_empty {f : α → β} : preimage ∅ f (by simp [InjOn]) = ∅


/-- The functor from `Pointed` to `TwoP` which adds a second point. -/
@[simps]
noncomputable def pointedToTwoPFst : Pointed.{u} ⥤ TwoP

(pointedToTwoPFst.obj X).toTwoPointing.toProd = (some X.point, none)


theorem continuousOn_coordChange (a : VectorPrebundle R F E) {e e' : Pretrivialization F (π F E)}
    (he : e ∈ a.pretrivializationAtlas) (he' : e' ∈ a.pretrivializationAtlas) :
    ContinuousOn (a.coordChange he he') (e.baseSet ∩ e'.baseSet)

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


theorem eq_left_iff_getLeft_eq {a : α} : x = inl a ↔ ∃ h, x.getLeft h = a

{α : Type u}
{β : Type v}
{x : α ⊕ β}
{a : α}


protected theorem All.setRed {t : RBNode α} (h : t.All p) : (setRed t).All p

{α : Type u_1}
{p : α → Prop}
{t : Batteries.RBNode α}
(h : Batteries.RBNode.All p t)


theorem lift_unique (Φ : Push σ ⥤q W') (Φ₀ : Φ.obj = τ) (Φcomp : (of σ ⋙q Φ) = φ) :
    Φ = lift σ φ τ h

{V : Type u_1}
[Quiver V]
{W : Type u_2}
(σ : V → W)
{W' : Type u_3}
[Quiver W']
(φ : V ⥤q W')
(τ : W → W')
(h : ∀ (x : V), φ.obj x = τ (σ x))
(Φ : Quiver.Push σ ⥤q W')
(Φ₀ : Φ.obj = τ)
(Φcomp : Quiver.Push.of σ ⋙q Φ = φ)


theorem _root_.HasCompactSupport.convolutionExists_left_of_continuous_right
    (hcf : HasCompactSupport f) (hf : LocallyIntegrable f μ) (hg : Continuous g) :
    ConvolutionExists f g L μ

(hf : MeasureTheory.LocallyIntegrable f μ)


/-- If `μ` is a primitive `n`th root of unity in `R` and `k < n`, then `n` is divisible
by `(μ-1)^k` in `ℤ[μ] ⊆ R`. -/
lemma self_sub_one_pow_dvd_order {k n : ℕ} (hn : k < n) {μ : R} (hμ : IsPrimitiveRoot μ n) :
    ∃ z ∈ adjoin ℤ {μ}, n = z * (μ - 1) ^ k

{R : Type u_1}
[CommRing R]
[IsDomain R]
{k n : ℕ}
(hn : k < n)
{μ : R}
(hμ : IsPrimitiveRoot μ n)

∃ z ∈ Algebra.adjoin ℤ {μ}, ↑n = z * (μ - 1) ^ k


theorem le_max_of_le_right : a ≤ c → a ≤ max b c

{α : Type u}
[LinearOrder α]
{a b c : α}


@[simp]
theorem natDegree_map [Semiring S] [Nontrivial S] (f : R →+* S) :
    natDegree (p.map f) = natDegree p

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

(Polynomial.map f p).natDegree = p.natDegree


/-- Given a bifunctor `F : C₁ ⥤ C₂ ⥤ C₃` and a map `p : I × J → K`, this is the
functor `GradedObject I C₁ ⥤ GradedObject J C₂ ⥤ GradedObject K C₃` sending
`X : GradedObject I C₁` and `Y : GradedObject J C₂` to the `K`-graded object sending
`k` to the coproduct of `(F.obj (X i)).obj (Y j)` for `p ⟨i, j⟩ = k`. -/
@[simps]
noncomputable def mapBifunctorMap [∀ X Y, HasMap (((mapBifunctor F I J).obj X).obj Y) p] :
    GradedObject I C₁ ⥤ GradedObject J C₂ ⥤ GradedObject K C₃

(F : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ C₃))

[∀ (X : CategoryTheory.GradedObject I C₁) (Y : CategoryTheory.GradedObject J C₂),
    (((CategoryTheory.GradedObject.mapBifunctor F I J).obj X).obj Y).HasMap p]

((CategoryTheory.GradedObject.mapBifunctorMap F p).obj X).obj Y = CategoryTheory.GradedObject.mapBifunctorMapObj F p X Y


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

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {x_2 : NonAssocSemiring γ} {g₁ g₂ : β →+* γ} {f : α →+* β},
  Function.Surjective ⇑f → (g₁.comp f = g₂.comp f ↔ g₁ = g₂)


theorem Equiv.toEmbedding_apply (a : α) : f.toEmbedding a = f a

{α : Sort u}
{β : Sort v}
(f : α ≃ β)
(a : α)


@[to_additive neg_le_iff_add_nonneg']
theorem inv_le_iff_one_le_mul' : a⁻¹ ≤ b ↔ 1 ≤ a * b

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


/-- Analogue of `HasFPowerSeriesOnBall` where convergence is required only on a set `s`. -/
structure HasFPowerSeriesWithinOnBall (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (s : Set E)
    (x : E) (r : ℝ≥0∞) : Prop where
  /-- `p` converges on `ball 0 r` -/
  r_le : r ≤ p.radius
  /-- The radius of convergence is positive -/
  r_pos : 0 < r
  /-- `p converges to f` within `s` -/
  hasSum : ∀ {y}, x + y ∈ s → y ∈ EMetric.ball (0 : E) r →
    HasSum (fun n : ℕ => p n fun _ : Fin n => y) (f (x + y))
  /-- We require `ContinuousWithinAt f s x` to ensure `f x` is nice -/
  continuousWithinAt : ContinuousWithinAt f s x

(self : HasFPowerSeriesWithinOnBall f p s x r)


lemma Even.add_odd : Even a → Odd b → Odd (a + b)


theorem rotate'_nil (n : ℕ) : ([] : List α).rotate' n = []


@[simp] lemma down_comp {X Y Z : C} (f : of X ⟶ of Y) (g : of Y ⟶ of Z) :
    down (f ≫ g) = down f ≫ down g

(f : CategoryTheory.WithTerminal.of X ⟶ CategoryTheory.WithTerminal.of Y)

(g : CategoryTheory.WithTerminal.of Y ⟶ CategoryTheory.WithTerminal.of Z)

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


theorem intrinsicFrontier_subset_frontier : intrinsicFrontier 𝕜 s ⊆ frontier s

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_5}
[Ring 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
[TopologicalSpace P]
[AddTorsor V P]
{s : Set P}


theorem Disjoint.symmDiff_eq_sup {a b : α} (h : Disjoint a b) : a ∆ b = a ⊔ b

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


lemma zero_add_inv_app (h : ShiftMkCore C A) (n : A) (X : C) :
    (h.add 0 n).inv.app X = (h.F n).map (h.zero.hom.app X) ≫
      eqToHom (by dsimp; rw [zero_add])

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddMonoid A]
(h : CategoryTheory.ShiftMkCore C A)
(n : A)
(X : C)

(h.add 0 n).inv.app X = CategoryTheory.CategoryStruct.comp ((h.F n).map (h.zero.hom.app X)) (CategoryTheory.eqToHom ⋯)


/-- If `f` is monotone and antitone on a directed set `s`, then `f` is constant on `s`. -/
lemma constant_of_monotoneOn_antitoneOn (hf : MonotoneOn f s) (hf' : AntitoneOn f s)
    (hs : DirectedOn (· ≤ ·) s) : ∀ ⦃a⦄, a ∈ s → ∀ ⦃b⦄, b ∈ s → f a = f b

(hs : DirectedOn (fun x x_1 => x ≤ x_1) s)


@[simp]
theorem reverse_involutive : Involutive (@reverse α)


theorem coe_mul_eq_smul : ↑r * a = r • a

{R : Type u_3}
[CommRing R]
(r : R)
(a : ℍ[R])


theorem image_eq_range (f : α → β) (s : Set α) : f '' s = range fun x : s => f x

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


theorem union_eq_self_of_subset_left {s t : Set α} (h : s ⊆ t) : s ∪ t = t


/-- In a weakly locally compact R₁ space,
every point has an open neighborhood with compact closure. -/
theorem exists_isOpen_mem_isCompact_closure (x : X) :
    ∃ U : Set X, IsOpen U ∧ x ∈ U ∧ IsCompact (closure U)

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]
[WeaklyLocallyCompactSpace X]
(x : X)

∃ U, IsOpen U ∧ x ∈ U ∧ IsCompact (closure U)


/-- The identity function as an element of `C(s, R)₀` when `0 ∈ (s : Set R)`. -/
@[simps!]
protected def id {s : Set R} [Zero s] (h0 : ((0 : s) : R) = 0) : C(s, R)₀

{R : Type u_3}
[Zero R]
[TopologicalSpace R]
{s : Set R}
[Zero ↑s]
(h0 : ↑0 = 0)

∀ (a : ↑s), (ContinuousMapZero.id h0) a = ↑a


@[simp]
theorem lt_self_iff_false (x : α) : x < x ↔ False


@[csimp] theorem takeD_eq_takeDTR : @takeD = @takeDTR


theorem nhds_basis_ball : (𝓝 x).HasBasis (0 < ·) (ball x)

{α : Type u}
[PseudoMetricSpace α]
{x : α}

(𝓝 x).HasBasis (fun x => 0 < x) (Metric.ball x)


theorem rowLens_sorted (μ : YoungDiagram) : μ.rowLens.Sorted (· ≥ ·)

List.Sorted (fun x x_1 => x ≥ x_1) μ.rowLens


theorem opNorm_neg (f : NormedAddGroupHom V₁ V₂) : ‖-f‖ = ‖f‖

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


lemma descFun_apply_spec {x : c.pt} {y : lc.pt} : descFun hc lc x = y ↔ x ∈ descSet hc {y}

(hc : CategoryTheory.Limits.IsColimit c)

(lc : CategoryTheory.Limits.Cocone (K.comp CategoryTheory.uliftFunctor.{v, u}))

CategoryTheory.Limits.Types.descFun hc lc x = y ↔ x ∈ CategoryTheory.Limits.Types.descSet hc {y}


theorem eq_of_nonempty_of_subsingleton {α} [Subsingleton α] (s t : Set α) [Nonempty s]
    [Nonempty t] : s = t

{α : Type u_1}
[Subsingleton α]
(s t : Set α)
[Nonempty ↑s]
[Nonempty ↑t]


theorem enumFrom_map (n : ℕ) (l : List α) (f : α → β) :
    enumFrom n (l.map f) = (enumFrom n l).map (Prod.map id f)

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

List.enumFrom n (List.map f l) = List.map (Prod.map id f) (List.enumFrom n l)


@[simp, norm_cast]
theorem coe_toGenContFract {g : GenContFract α} :
    (g : GenContFract β) =
      ⟨(g.h : β), (g.s.map (↑) : Stream'.Seq <| Pair β)⟩

{α : Type u_1}
{β : Type u_2}
[Coe α β]
{g : GenContFract α}

↑g = { h := Coe.coe g.h, s := Stream'.Seq.map GenContFract.Pair.coeFn g.s }


protected theorem mk_one (h : ∀ x ∈ s, ∀ y ∈ s, dist (f x) (f y) ≤ dist x y) :
    LipschitzOnWith 1 f s


@[to_additive]
theorem mulSupport_subset_iff' {f : α → M} {s : Set α} :
    mulSupport f ⊆ s ↔ ∀ x ∉ s, f x = 1

{α : Type u_1}
{M : Type u_5}
[One M]
{f : α → M}
{s : Set α}

Function.mulSupport f ⊆ s ↔ ∀ x ∉ s, f x = 1


@[to_additive (attr := simp)]
theorem symm_trans_apply (e₁ : M ≃* N) (e₂ : N ≃* P) (p : P) :
    (e₁.trans e₂).symm p = e₁.symm (e₂.symm p)

{M : Type u_6}
{N : Type u_7}
{P : Type u_8}
[Add M]
[Add N]
[Add P]
(e₁ : M ≃+ N)
(e₂ : N ≃+ P)
(p : P)


protected theorem compl_sInf (S : Set (LowerSet α)) : (sInf S).compl = ⨅ s ∈ S, LowerSet.compl s

{α : Type u_1}
[LE α]
(S : Set (LowerSet α))


theorem smul_boundedBy {c : ℝ≥0∞} (hc : c ≠ ∞) : c • boundedBy m = boundedBy (c • m)

{α : Type u_1}
{m : Set α → ℝ≥0∞}
{c : ℝ≥0∞}
(hc : c ≠ ⊤)

c • MeasureTheory.OuterMeasure.boundedBy m = MeasureTheory.OuterMeasure.boundedBy (c • m)


@[mono]
protected theorem mono (hf : f ≤ g) (hμ : μ ≤ ν) : ν.FiniteAtFilter g → μ.FiniteAtFilter f

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{f g : Filter α}
(hf : f ≤ g)
(hμ : μ ≤ ν)


@[to_additive] lemma mabs_zpow (n : ℤ) (a : α) : |a ^ n|ₘ = |a|ₘ ^ |n|

{α : Type u_1}
[LinearOrderedCommGroup α]
(n : ℤ)
(a : α)


@[simp]
theorem preimage_const_sub_Icc : (fun x => a - x) ⁻¹' Icc b c = Icc (a - c) (a - b)

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

(fun x => a - x) ⁻¹' Set.Icc b c = Set.Icc (a - c) (a - b)


theorem of_comp (hgf : IsLocalHomeomorph (g ∘ f)) (hg : IsLocalHomeomorph g)
    (cont : Continuous f) : IsLocalHomeomorph f

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{g : Y → Z}
{f : X → Y}
(hgf : IsLocalHomeomorph (g ∘ f))
(hg : IsLocalHomeomorph g)
(cont : Continuous f)


theorem norm_setToFun_le_mul_norm (hT : DominatedFinMeasAdditive μ T C) (f : α →₁[μ] E)
    (hC : 0 ≤ C) : ‖setToFun μ T hT f‖ ≤ C * ‖f‖

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

‖MeasureTheory.setToFun μ T hT ↑↑f‖ ≤ C * ‖f‖


theorem le_cofinite_or_eq_pure (f : Ultrafilter α) : (f : Filter α) ≤ cofinite ∨ ∃ a, f = pure a


@[to_additive]
theorem IsOpen.div_left (ht : IsOpen t) : IsOpen (s / t)

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{s t : Set G}
(ht : IsOpen t)


@[to_additive neg_le_iff_add_nonneg']
theorem inv_le_iff_one_le_mul' : a⁻¹ ≤ b ↔ 1 ≤ a * b

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


theorem mapsTo_sin_Ioo : MapsTo sin (Ioo (-(π / 2)) (π / 2)) (Ioo (-1) 1)

Set.MapsTo Real.sin (Set.Ioo (-(π / 2)) (π / 2)) (Set.Ioo (-1) 1)


lemma tendsto_cofinite_cocompact_of_discrete [DiscreteTopology X]
    (hf : Tendsto f (cocompact _) (cocompact _)) :
    Tendsto f cofinite (cocompact _)

(hf : Filter.Tendsto f (Filter.cocompact X) (Filter.cocompact Y))

Filter.Tendsto f Filter.cofinite (Filter.cocompact Y)


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


theorem card_of_finset' {p : Set α} (s : Finset α) (H : ∀ x, x ∈ s ↔ x ∈ p) [Fintype p] :
    Fintype.card p = s.card

{α : Type u_1}
{p : Set α}
(s : Finset α)
(H : ∀ (x : α), x ∈ s ↔ x ∈ p)
[Fintype ↑p]


@[mono]
theorem spanNorm_mono {I J : Ideal S} (h : I ≤ J) : spanNorm R I ≤ spanNorm R J

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


@[simp, norm_cast] lemma cast_zero : ((0 : ℚ≥0) : α) = 0


theorem trace_eq_sum_roots_charpoly [IsAlgClosed R] : A.trace = (Matrix.charpoly A).roots.sum

{n : Type u_1}
[Fintype n]
[DecidableEq n]
{R : Type u_2}
[Field R]
(A : Matrix n n R)
[IsAlgClosed R]


@[to_additive]
theorem subset_mul_self (B : GroupFilterBasis G) {U : Set G} (h : U ∈ B) : U ⊆ U * U

{G : Type u}
[Group G]
(B : GroupFilterBasis G)
{U : Set G}
(h : U ∈ B)


theorem comp_assoc (f : P₃ →ᵃⁱ[𝕜] P₄) (g : P₂ →ᵃⁱ[𝕜] P₃) (h : P →ᵃⁱ[𝕜] P₂) :
    (f.comp g).comp h = f.comp (g.comp h)

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{V₃ : Type u_6}
{V₄ : Type u_7}
{P : Type u_10}
{P₂ : Type u_11}
{P₃ : Type u_12}
{P₄ : Type u_13}
[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₃]
[SeminormedAddCommGroup V₄]
[NormedSpace 𝕜 V₄]
[PseudoMetricSpace P₄]
[NormedAddTorsor V₄ P₄]
(f : P₃ →ᵃⁱ[𝕜] P₄)
(g : P₂ →ᵃⁱ[𝕜] P₃)
(h : P →ᵃⁱ[𝕜] P₂)


theorem lift'_bot (hh : Monotone h) : (⊥ : Filter α).lift' h = 𝓟 (h ∅)

{α : Type u_1}
{β : Type u_2}
{h : Set α → Set β}
(hh : Monotone h)


protected theorem tsum_eq_iSup_nat {f : ℕ → ℝ≥0∞} :
    ∑' i : ℕ, f i = ⨆ i : ℕ, ∑ a ∈ Finset.range i, f a

{f : ℕ → ℝ≥0∞}

∑' (i : ℕ), f i = ⨆ i, ∑ a ∈ Finset.range i, f a


theorem HasDerivWithinAt.deriv_eq_zero (hd : HasDerivWithinAt f 0 s x)
    (H : UniqueDiffWithinAt 𝕜 s x) : deriv f x = 0

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
(hd : HasDerivWithinAt f 0 s x)
(H : UniqueDiffWithinAt 𝕜 s x)


theorem count_pow [Nontrivial α] [DecidableEq (Associates α)] {a : Associates α} (ha : a ≠ 0)
    {p : Associates α} (hp : Irreducible p) (k : ℕ) :
    count p (a ^ k).factors = k * count p a.factors

[(p : Associates α) → Decidable (Irreducible p)]

p.count (a ^ k).factors = k * p.count a.factors


@[simp]
theorem prod_comp {P Q R : C} {S T U : D} (f : (P, S) ⟶ (Q, T)) (g : (Q, T) ⟶ (R, U)) :
    f ≫ g = (f.1 ≫ g.1, f.2 ≫ g.2)

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

CategoryTheory.CategoryStruct.comp f g =
  (CategoryTheory.CategoryStruct.comp f.1 g.1, CategoryTheory.CategoryStruct.comp f.2 g.2)


lemma IsCorner.mono (hAB : A ⊆ B) (hA : IsCorner A x₁ y₁ x₂ y₂) : IsCorner B x₁ y₁ x₂ y₂

{G : Type u_1}
[AddCommMonoid G]
{A B : Set (G × G)}
{x₁ y₁ x₂ y₂ : G}
(hAB : A ⊆ B)
(hA : IsCorner A x₁ y₁ x₂ y₂)


/-- If a finset `u` is contained in the pointwise subtraction of two sets `s -ᵥ t`, we can find two
finsets `s'`, `t'` such that `s' ⊆ s`, `t' ⊆ t` and `u ⊆ s' -ᵥ t'`. -/
theorem subset_vsub {s t : Set β} :
    ↑u ⊆ s -ᵥ t → ∃ s' t' : Finset β, ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' -ᵥ t'

{α : Type u_2}
{β : Type u_3}
[VSub α β]
[DecidableEq α]
{u : Finset α}
{s t : Set β}

↑u ⊆ s -ᵥ t → ∃ s' t', ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' -ᵥ t'


theorem Subsingleton.isWellOrder [Subsingleton α] (r : α → α → Prop) [hr : IsIrrefl α r] :
    IsWellOrder α r

{α : Type u}
[Subsingleton α]
(r : α → α → Prop)
[hr : IsIrrefl α r]


@[simp]
lemma trailingDegree_X_pow (n : ℕ) :
    (X ^ n : R[X]).trailingDegree = n

{R : Type u}
[Semiring R]
[Nontrivial R]
(n : ℕ)


theorem le_rootMultiplicity_map {p : A[X]} {f : A →+* B} (hmap : map f p ≠ 0) (a : A) :
    rootMultiplicity a p ≤ rootMultiplicity (f a) (p.map f)

{A : Type u_1}
{B : Type u_2}
[CommRing A]
[CommRing B]
{p : Polynomial A}
{f : A →+* B}
(hmap : Polynomial.map f p ≠ 0)
(a : A)

Polynomial.rootMultiplicity a p ≤ Polynomial.rootMultiplicity (f a) (Polynomial.map f p)


/-- A subgroup is closed under multiplication. -/
@[to_additive "An `AddSubgroup` is closed under addition."]
protected theorem mul_mem {x y : G} : x ∈ H → y ∈ H → x * y ∈ H

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
{x y : G}


lemma ΨSq_odd (m : ℕ) : W.ΨSq (2 * (m + 2) + 1) =
    (W.preΨ' (m + 4) * W.preΨ' (m + 2) ^ 3 * (if Even m then W.Ψ₂Sq ^ 2 else 1) -
      W.preΨ' (m + 1) * W.preΨ' (m + 3) ^ 3 * (if Even m then 1 else W.Ψ₂Sq ^ 2)) ^ 2

{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)
(m : ℕ)

W.ΨSq (2 * (↑m + 2) + 1) =
  ((W.preΨ' (m + 4) * W.preΨ' (m + 2) ^ 3 * if Even m then W.Ψ₂Sq ^ 2 else 1) -
      W.preΨ' (m + 1) * W.preΨ' (m + 3) ^ 3 * if Even m then 1 else W.Ψ₂Sq ^ 2) ^
    2


theorem AECover.integrable_of_lintegral_nnnorm_tendsto' [l.NeBot] [l.IsCountablyGenerated]
    {φ : ι → Set α} (hφ : AECover μ l φ) {f : α → E} (I : ℝ≥0) (hfm : AEStronglyMeasurable f μ)
    (htendsto : Tendsto (fun i => ∫⁻ x in φ i, ‖f x‖₊ ∂μ) l (𝓝 I)) : Integrable f μ

(hfm : MeasureTheory.AEStronglyMeasurable f μ)

(htendsto : Filter.Tendsto (fun i => ∫⁻ (x : α) in φ i, ↑‖f x‖₊ ∂μ) l (𝓝 ↑I))


/-- `IsAdjoinRoot S f` states that the ring `S` can be constructed by adjoining a specified root
of the polynomial `f : R[X]` to `R`.

Compare `PowerBasis R S`, which does not explicitly specify which polynomial we adjoin a root of
(in particular `f` does not need to be the minimal polynomial of the root we adjoin),
and `AdjoinRoot` which constructs a new type.

This is not a typeclass because the choice of root given `S` and `f` is not unique.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure IsAdjoinRoot {R : Type u} (S : Type v) [CommSemiring R] [Semiring S] [Algebra R S]
    (f : R[X]) : Type max u v where
  map : R[X] →+* S
  map_surjective : Function.Surjective map
  ker_map : RingHom.ker map = Ideal.span {f}
  algebraMap_eq : algebraMap R S = map.comp Polynomial.C

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{f : R[X]}
(self : IsAdjoinRoot S f)


@[to_additive (attr := gcongr) sub_le_sub_right]
theorem div_le_div_right' (h : a ≤ b) (c : α) : a / c ≤ b / c

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


theorem IsTop.snd (hx : IsTop x) : IsTop x.2

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{x : α × β}
(hx : IsTop x)


theorem of_length_zero {x : BitVec 0} : x = 0#0


protected theorem toFinset_empty (h : (∅ : Set α).Finite) : h.toFinset = ∅


theorem _root_.MeasurableEmbedding.exists_stronglyMeasurable_extend {f : α → β} {g : α → γ}
    {_ : MeasurableSpace α} {_ : MeasurableSpace γ} [TopologicalSpace β]
    (hg : MeasurableEmbedding g) (hf : StronglyMeasurable f) (hne : γ → Nonempty β) :
    ∃ f' : γ → β, StronglyMeasurable f' ∧ f' ∘ g = f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{g : α → γ}

∀ {x : MeasurableSpace α} {x_1 : MeasurableSpace γ} [inst : TopologicalSpace β],
  MeasurableEmbedding g →
    MeasureTheory.StronglyMeasurable f → (γ → Nonempty β) → ∃ f', MeasureTheory.StronglyMeasurable f' ∧ f' ∘ g = f


theorem nodup_iff_ne_cons_cons {s : Multiset α} : s.Nodup ↔ ∀ a t, s ≠ a ::ₘ a ::ₘ t

s.Nodup ↔ ∀ (a : α) (t : Multiset α), s ≠ a ::ₘ a ::ₘ t


theorem mul_sub_one (n m : Nat) : n * (m - 1) = n * m - n


theorem chartAt_comp (H : Type*) [TopologicalSpace H] (H' : Type*) [TopologicalSpace H']
    {M : Type*} [TopologicalSpace M] [ChartedSpace H H'] [ChartedSpace H' M] (x : M) :
    (letI := ChartedSpace.comp H H' M; chartAt H x) = chartAt H' x ≫ₕ chartAt H (chartAt H' x x)

(H : Type u_5)
[TopologicalSpace H]
(H' : Type u_6)
[TopologicalSpace H']
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H H']
[ChartedSpace H' M]
(x : M)

chartAt H x = chartAt H' x ≫ₕ chartAt H (↑(chartAt H' x) x)


@[simp] theorem exists_or_eq_right (y : α) (p : α → Prop) : ∃ x : α, p x ∨ x = y


theorem Sublist.reverse : l₁ <+ l₂ → l₁.reverse <+ l₂.reverse

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+ l₂ → l₁.reverse <+ l₂.reverse


theorem fst_injective : Injective fun c : Concept α β r => c.fst

{α : Type u_2}
{β : Type u_3}
{r : α → β → Prop}


@[simp]
theorem orthogonalComplement_eq_orthogonalComplement {L : Submodule 𝕜 E} [HasOrthogonalProjection K]
    [HasOrthogonalProjection L] : Kᗮ = Lᗮ ↔ K = L

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K L : Submodule 𝕜 E}
[HasOrthogonalProjection K]
[HasOrthogonalProjection L]


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

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

e ((Algebra.trace A C) x) = (Algebra.trace B C) x


/-- The group of `AffineEquiv`s are equivalent to the group of units of `AffineMap`.

This is the affine version of `LinearMap.GeneralLinearGroup.generalLinearEquiv`. -/
@[simps]
def equivUnitsAffineMap : (P₁ ≃ᵃ[k] P₁) ≃* (P₁ →ᵃ[k] P₁)ˣ

{k : Type u_1}
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(u : (P₁ →ᵃ[k] P₁)ˣ)
(a : P₁)

(AffineEquiv.equivUnitsAffineMap.symm u).invFun a = ↑u⁻¹ a


theorem map_coord_zero {m : ∀ i, M₁ i} (i : ι) (h : m i = 0) : f m = 0

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
{m : (i : ι) → M₁ i}
(i : ι)
(h : m i = 0)


theorem exists_pow_nat_eq [IsAlgClosed k] (x : k) {n : ℕ} (hn : 0 < n) : ∃ z, z ^ n = x

{k : Type u}
[Field k]
[IsAlgClosed k]
(x : k)
{n : ℕ}
(hn : 0 < n)


@[reassoc (attr := simp)]
theorem inr_isoIsPushout_inv (h : IsPushout f g inl inr) (h' : IsPushout f g inl' inr') :
    inr' ≫ (h.isoIsPushout h').inv = inr

(h : CategoryTheory.IsPushout f g inl inr)

(h' : CategoryTheory.IsPushout f g inl' inr')

inr' ≫ (CategoryTheory.IsPushout.isoIsPushout X Y h h').inv = inr


theorem trim_eq_self : v.trim le_rfl = v

{α : Type u_1}
{M : Type u_4}
[AddCommMonoid M]
[TopologicalSpace M]
{n : MeasurableSpace α}
{v : MeasureTheory.VectorMeasure α M}


@[to_additive]
theorem csInf_div (hs₀ : s.Nonempty) (hs₁ : BddBelow s) (ht₀ : t.Nonempty) (ht₁ : BddAbove t) :
    sInf (s / t) = sInf s / sSup t

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


/-- An `OrderedAddCommMonoid` with one-sided 'subtraction' in the sense that
if `a ≤ b`, then there is some `c` for which `a + c = b`. This is a weaker version
of the condition on canonical orderings defined by `CanonicallyOrderedAddCommMonoid`. -/
class ExistsAddOfLE (α : Type u) [Add α] [LE α] : Prop where
  /-- For `a ≤ b`, there is a `c` so `b = a + c`. -/
  exists_add_of_le : ∀ {a b : α}, a ≤ b → ∃ c : α, b = a + c

{α : Type u}
[Add α]
[LE α]
[self : ExistsAddOfLE α]
{a b : α}


@[to_additive]
theorem finprod_emb_domain (f : α ↪ β) [DecidablePred (· ∈ Set.range f)] (g : α → M) :
    (∏ᶠ b : β, if h : b ∈ Set.range f then g (Classical.choose h) else 1) = ∏ᶠ a : α, g a

[DecidablePred fun x => x ∈ Set.range ⇑f]

(∑ᶠ (b : β), if h : b ∈ Set.range ⇑f then g (Classical.choose h) else 0) = ∑ᶠ (a : α), g a


/-- The square of the smallest prime factor of a composite number `n` is at most `n`.
-/
theorem minFac_sq_le_self {n : ℕ} (w : 0 < n) (h : ¬Prime n) : minFac n ^ 2 ≤ n


theorem tsub_le_tsub_add_tsub : a - c ≤ a - b + (b - c)


@[simp]
theorem pathEquivList_nil : pathEquivList Path.nil = ([] : List α)

Quiver.SingleObj.pathEquivList Quiver.Path.nil = []


/-- The cartesian product of two natural transformations. -/
@[simps]
def prod {F G : A ⥤ B} {H I : C ⥤ D} (α : F ⟶ G) (β : H ⟶ I) : F.prod H ⟶ G.prod I

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
{F G : CategoryTheory.Functor A B}
{H I : CategoryTheory.Functor C D}
(α : F ⟶ G)
(β : H ⟶ I)
(X : A × C)

(CategoryTheory.NatTrans.prod α β).app X = (α.app X.1, β.app X.2)


/-- All values are accessible under the well-founded relation. -/
theorem apply : ∀ a, Acc r a

{α : Type u}
(r : α → α → Prop)
[IsWellFounded α r]
(a : α)


@[simp]
theorem relabel_sum_inl (φ : L.BoundedFormula α n) :
    (φ.relabel Sum.inl : L.BoundedFormula α (0 + n)) = φ.castLE (ge_of_eq (zero_add n))

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

FirstOrder.Language.BoundedFormula.relabel Sum.inl φ = FirstOrder.Language.BoundedFormula.castLE ⋯ φ


@[to_additive (attr := simp) nnnorm_pos]
lemma nnnorm_pos' : 0 < ‖a‖₊ ↔ a ≠ 1

{E : Type u_6}
[NormedAddGroup E]
{a : E}

0 < ‖a‖₊ ↔ a ≠ 0


private theorem eventually_imp {α : Type*} {p q : α → Prop} {f : Filter α}
    (hq : ∀ (x : α), p x → q x) (hp : ∀ᶠ (x : α) in f, p x) : ∀ᶠ (x : α) in f, q x

{α : Type u_1}
{p q : α → Prop}
{f : Filter α}
(hq : ∀ (x : α), p x → q x)
(hp : ∀ᶠ (x : α) in f, p x)


theorem prime_two_or_dvd_of_dvd_two_mul_pow_self_two {m : ℤ} {p : ℕ} (hp : Nat.Prime p)
    (h : (p : ℤ) ∣ 2 * m ^ 2) : p = 2 ∨ p ∣ Int.natAbs m

{m : ℤ}
{p : ℕ}
(hp : Nat.Prime p)
(h : ↑p ∣ 2 * m ^ 2)


theorem self_mem_adjoin_singleton (x : A) : x ∈ adjoin R ({x} : Set A)

(R : Type u_2)
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
(x : A)


theorem isBounded_sup {p : ι → Seminorm 𝕜 E} {q : ι' → Seminorm 𝕜₂ F} {f : E →ₛₗ[σ₁₂] F}
    (hf : IsBounded p q f) (s' : Finset ι') :
    ∃ (C : ℝ≥0) (s : Finset ι), (s'.sup q).comp f ≤ C • s.sup p

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_5}
{F : Type u_6}
{ι : Type u_8}
{ι' : Type u_9}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[NormedField 𝕜₂]
[AddCommGroup F]
[Module 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
{p : ι → Seminorm 𝕜 E}
{q : ι' → Seminorm 𝕜₂ F}
{f : E →ₛₗ[σ₁₂] F}
(hf : Seminorm.IsBounded p q f)
(s' : Finset ι')


@[elementwise (attr := simp)]
theorem binaryCoproductIso_inr_comp_inv (X Y : Type u) :
    ↾(Sum.inr : Y ⟶ X ⊕ Y) ≫ (binaryCoproductIso X Y).inv = Limits.coprod.inr

↾Sum.inr ≫ (CategoryTheory.Limits.Types.binaryCoproductIso X Y).inv = CategoryTheory.Limits.coprod.inr


@[simp]
lemma revOrderIso_symm_apply (i : Fin n) : revOrderIso.symm i = OrderDual.toDual (rev i)

Fin.revOrderIso.symm i = OrderDual.toDual i.rev


theorem toHamming_inj {x y : ∀ i, β i} : toHamming x = toHamming y ↔ x = y

{ι : Type u_2}
{β : ι → Type u_3}
{x y : (i : ι) → β i}

Hamming.toHamming x = Hamming.toHamming y ↔ x = y


theorem DifferentiableOn.clog {f : E → ℂ} {s : Set E} (h₁ : DifferentiableOn ℂ f s)
    (h₂ : ∀ x ∈ s, f x ∈ slitPlane) : DifferentiableOn ℂ (fun t => log (f t)) s

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{s : Set E}
(h₁ : DifferentiableOn ℂ f s)
(h₂ : ∀ x ∈ s, f x ∈ Complex.slitPlane)

DifferentiableOn ℂ (fun t => Complex.log (f t)) s


/-- The anti-equivalence between cosimplicial objects and simplicial objects. -/
@[simps!]
def cosimplicialSimplicialEquiv : (CosimplicialObject C)ᵒᵖ ≌ SimplicialObject Cᵒᵖ

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(F : SimplexCategoryᵒᵖ ⥤ Cᵒᵖ)

(CategoryTheory.cosimplicialSimplicialEquiv C).inverse.obj F = Opposite.op F.unop


/-- See also `Filter.Tendsto.atBot_mul_const` for a version of this lemma for
`LinearOrderedField`s which does not require the `Archimedean` assumption. -/
theorem Tendsto.atBot_mul_const' (hr : 0 < r) (hf : Tendsto f l atBot) :
    Tendsto (fun x => f x * r) l atBot

{α : Type u_1}
{R : Type u_2}
{l : Filter α}
{f : α → R}
{r : R}
[LinearOrderedRing R]
[Archimedean R]
(hr : 0 < r)
(hf : Filter.Tendsto f l Filter.atBot)

Filter.Tendsto (fun x => f x * r) l Filter.atBot


/-- The second projection `Triangle C ⥤ C`. -/
@[simps]
def π₂ : Triangle C ⥤ C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.HasShift C ℤ]

∀ {X Y : CategoryTheory.Pretriangulated.Triangle C} (f : X ⟶ Y),
  CategoryTheory.Pretriangulated.Triangle.π₂.map f = f.hom₂


@[simp]
theorem splitMany_empty (I : Box ι) : splitMany I ∅ = ⊤

BoxIntegral.Prepartition.splitMany I ∅ = ⊤


@[simp, norm_cast]
theorem coe_comap (S : NonUnitalSubalgebra R B) (f : F) : (comap f S : Set A) = f ⁻¹' (S : Set B)

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[NonUnitalNonAssocSemiring B]
[Module R A]
[Module R B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
(S : NonUnitalSubalgebra R B)
(f : F)

↑(NonUnitalSubalgebra.comap f S) = ⇑f ⁻¹' ↑S


theorem liftRel_of_mem {R : α → β → Prop} {a b ca cb} (ma : a ∈ ca) (mb : b ∈ cb) (ab : R a b) :
    LiftRel R ca cb

{α : Type u}
{β : Type v}
{R : α → β → Prop}
{a : α}
{b : β}
{ca : Computation α}
{cb : Computation β}
(ma : a ∈ ca)
(mb : b ∈ cb)
(ab : R a b)


lemma connected_induce_iff {s : Set V} :
    (G.induce s).Connected ↔ ((⊤ : G.Subgraph).induce s).Connected

{V : Type u}
{G : SimpleGraph V}
{s : Set V}

(SimpleGraph.induce s G).Connected ↔ (⊤.induce s).Connected


theorem lintegral_indicator_one_le (s : Set α) : ∫⁻ a, s.indicator 1 a ∂μ ≤ μ s

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s : Set α)


theorem arcsin_lt_iff_lt_sin {x y : ℝ} (hx : x ∈ Icc (-1 : ℝ) 1) (hy : y ∈ Icc (-(π / 2)) (π / 2)) :
    arcsin x < y ↔ x < sin y


@[simp]
theorem comap_subtype_eq_top {p p' : Submodule R M} : comap p.subtype p' = ⊤ ↔ p ≤ p'

{R : Type u_1}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p p' : Submodule R M}

Submodule.comap p.subtype p' = ⊤ ↔ p ≤ p'


@[simp]
theorem exp_ofReal_mul_I_re (x : ℝ) : (exp (x * I)).re = Real.cos x

(Complex.exp (↑x * Complex.I)).re = Real.cos x


@[to_additive (attr := simps tensorObj_as leftUnitor rightUnitor associator) Discrete.addMonoidal]
instance Discrete.monoidal : MonoidalCategory (Discrete M)

(M : Type u)
[AddMonoid M]
(X : CategoryTheory.Discrete M)

λ_ X = CategoryTheory.Discrete.eqToIso ⋯


theorem fderiv_const_sub (c : F) : fderiv 𝕜 (fun y => c - f y) x = -fderiv 𝕜 f x

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


theorem isCycle_swap (hxy : x ≠ y) : IsCycle (swap x y)

{α : Type u_2}
{x y : α}
[DecidableEq α]
(hxy : x ≠ y)


@[simp]
theorem coe_val : (S.val : S → A) = ((↑) : S → A)

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


@[simp]
theorem enum_typein (r : α → α → Prop) [IsWellOrder α r] (a : α) :
    enum r (typein r a) (typein_lt_type r a) = a

{α : Type u}
(r : α → α → Prop)
[IsWellOrder α r]
(a : α)

Ordinal.enum r (Ordinal.typein r a) ⋯ = a


theorem factorial_dvd_factorial {m n} (h : m ≤ n) : m ! ∣ n !


@[reassoc]
lemma ι_functorMapSrc (i : I) (t : A i ⟶ X) (b : B i ⟶ S) (w : t ≫ πX = f i ≫ b)
    (t' : A i ⟶ Y) (fac : t ≫ φ = t') :
    Sigma.ι _ (FunctorObjIndex.mk i t b w) ≫ functorMapSrc f πX πY φ hφ =
      Sigma.ι (functorObjSrcFamily f πY)
        (FunctorObjIndex.mk i t' b (by rw [← w, ← fac, assoc, hφ]))

[CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (CategoryTheory.SmallObject.FunctorObjIndex f πX)) C]

[CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (CategoryTheory.SmallObject.FunctorObjIndex f πY)) C]

(hφ : CategoryTheory.CategoryStruct.comp φ πY = πX)

(w : CategoryTheory.CategoryStruct.comp t πX = CategoryTheory.CategoryStruct.comp (f i) b)

(fac : CategoryTheory.CategoryStruct.comp t φ = t')

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Limits.Sigma.ι (CategoryTheory.SmallObject.functorObjSrcFamily f πX)
      { i := i, t := t, b := b, w := w })
    (CategoryTheory.SmallObject.functorMapSrc f πX πY φ hφ) =
  CategoryTheory.Limits.Sigma.ι (CategoryTheory.SmallObject.functorObjSrcFamily f πY)
    { i := i, t := t', b := b, w := ⋯ }


theorem add_sub_self_right (a b : Nat) : (a + b) - b = a


@[simp]
theorem map_cast_heq {α β} (h : α = β) (s : Finset α) :
    HEq (s.map (Equiv.cast h).toEmbedding) s

{α β : Type u_4}
(h : α = β)
(s : Finset α)

HEq (Finset.map (Equiv.cast h).toEmbedding s) s


@[simp] theorem filterMap_cons_some (f : α → Option β) (a : α) (l : List α) {b : β} (h : f a = some b) :
    filterMap f (a :: l) = b :: filterMap f l

{α : Type u_1}
{β : Type u_2}
(f : α → Option β)
(a : α)
(l : List α)
{b : β}
(h : f a = some b)

List.filterMap f (a :: l) = b :: List.filterMap f l


/-- The identification `- ⊗ mop X = mop (- ⊗ unmop X)` as a natural isomorphism. -/
@[simps!]
def MonoidalOpposite.tensorRightMopIso (X : C) :
    tensorRight (mop X) ≅ unmopFunctor C ⋙ tensorLeft X ⋙ mopFunctor C

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

∀ (X_1 : Cᴹᵒᵖ),
  ((CategoryTheory.MonoidalOpposite.tensorRightMopIso X).inv.app X_1).unmop =
    𝟙 (CategoryTheory.MonoidalCategory.tensorObj X X_1.unmop)


@[simp, norm_cast]
theorem coe_coe (h : M ≃ₘ^n⟮I, I'⟯ M') : ⇑(h : C^n⟮I, M; I', M'⟯) = h

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
(h : M ≃ₘ^n⟮I, I'⟯ M')


@[simp] theorem ForInStep.bind_yield [Monad m] (a : α) (f : α → m (ForInStep α)) :
    (ForInStep.yield a).bind (m := m) f = f a

{m : Type u_1 → Type u_2}
{α : Type u_1}
[Monad m]
(a : α)
(f : α → m (ForInStep α))