/-- A morphism of comonads is a natural transformation compatible with ε and δ. -/
@[ext]
structure ComonadHom (M N : Comonad C) extends NatTrans (M : C ⥤ C) N where
  app_ε : ∀ X, app X ≫ N.ε.app X = M.ε.app X := by aesop_cat
  app_δ : ∀ X, app X ≫ N.δ.app X = M.δ.app X ≫ app _ ≫ N.map (app X) := by aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{M N : CategoryTheory.Comonad C}
(self : CategoryTheory.ComonadHom M N)
(X : C)

CategoryTheory.CategoryStruct.comp (self.app X) (N.ε.app X) = M.ε.app X


@[to_additive]
theorem prod_map_hom (L : List ι) (f : ι → M) {G : Type*} [FunLike G M N] [MonoidHomClass G M N]
    (g : G) :
    (L.map (g ∘ f)).prod = g (L.map f).prod

{ι : Type u_1}
{M : Type u_4}
{N : Type u_5}
[Monoid M]
[Monoid N]
(L : List ι)
(f : ι → M)
{G : Type u_8}
[FunLike G M N]
[MonoidHomClass G M N]
(g : G)

(List.map (⇑g ∘ f) L).prod = g (List.map f L).prod


theorem convexHull_smul (a : 𝕜) (s : Set E) : convexHull 𝕜 (a • s) = a • convexHull 𝕜 s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedCommSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(a : 𝕜)
(s : Set E)

(convexHull 𝕜) (a • s) = a • (convexHull 𝕜) s


theorem monic_mul_C_of_leadingCoeff_mul_eq_one {b : R} (hp : p.leadingCoeff * b = 1) :
    Monic (p * C b)

{R : Type u}
[Semiring R]
{p : R[X]}
{b : R}
(hp : p.leadingCoeff * b = 1)


theorem Certificate.of_combine_isUnsat (ctx : Context) (cs : Certificate) (h : cs.combine.isUnsat) : cs.denote ctx

(ctx : Nat.Linear.Context)
(cs : Nat.Linear.Certificate)
(h : cs.combine.isUnsat = true)


@[simp]
theorem toIcoDiv_add_left (a b : α) : toIcoDiv hp a (p + b) = toIcoDiv hp a b + 1

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


theorem lintegral_fst (κ : Kernel α (β × γ)) (a : α) {g : β → ℝ≥0∞} (hg : Measurable g) :
    ∫⁻ c, g c ∂fst κ a = ∫⁻ bc : β × γ, g bc.fst ∂κ a

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

{g : β → ℝ≥0∞}

∫⁻ (c : β), g c ∂κ.fst a = ∫⁻ (bc : β × γ), g bc.1 ∂κ a


@[to_additive]
theorem UniformGroup.uniformity_countably_generated [(𝓝 (1 : α)).IsCountablyGenerated] :
    (𝓤 α).IsCountablyGenerated

{α : Type u_1}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
[(𝓝 0).IsCountablyGenerated]


theorem image_prod_mk_subset_prod_right (ha : a ∈ s) : Prod.mk a '' t ⊆ s ×ˢ t

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


theorem Set.Nonempty.bddBelow_upperBounds (hs : s.Nonempty) : BddBelow (upperBounds s)

{α : Type u}
[Preorder α]
{s : Set α}
(hs : s.Nonempty)


theorem real_inner_comm (x y : F) : ⟪y, x⟫_ℝ = ⟪x, y⟫_ℝ

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


theorem continuous_inl [Zero M] : Continuous (inl : R → tsze R M)

{R : Type u_3}
{M : Type u_4}
[TopologicalSpace R]
[TopologicalSpace M]
[Zero M]


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


theorem coind_injective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Injective f) :
    Injective (coind f h)

{α : Sort u_4}
{β : Sort u_5}
{f : α → β}
{p : β → Prop}
(h : ∀ (a : α), p (f a))
(hf : Function.Injective f)


theorem toAlgHom_unop (f : Aᵐᵒᵖ ≃ₐ[R] Bᵐᵒᵖ) : f.unop.toAlgHom = AlgHom.unop f.toAlgHom

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : Aᵐᵒᵖ ≃ₐ[R] Bᵐᵒᵖ)


@[simp]
theorem _root_.map_finset_sup [SemilatticeSup β] [OrderBot β]
    [FunLike F α β] [SupBotHomClass F α β]
    (f : F) (s : Finset ι) (g : ι → α) : f (s.sup g) = s.sup (f ∘ g)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
{ι : Type u_5}
[SemilatticeSup α]
[OrderBot α]
[SemilatticeSup β]
[OrderBot β]
[FunLike F α β]
[SupBotHomClass F α β]
(f : F)
(s : Finset ι)
(g : ι → α)


@[to_additive]
lemma IsOfFinOrder.powers_eq_zpowers (hx : IsOfFinOrder x) : (powers x : Set G) = zpowers x

{G : Type u_1}
[AddGroup G]
{x : G}
(hx : IsOfFinAddOrder x)

↑(AddSubmonoid.multiples x) = ↑(AddSubgroup.zmultiples x)


@[simp]
theorem cycleOf_pow_apply_self (f : Perm α) [DecidableRel f.SameCycle] (x : α) :
    ∀ n : ℕ, (cycleOf f x ^ n) x = (f ^ n) x

{α : Type u_2}
(f : Equiv.Perm α)
[DecidableRel f.SameCycle]
(x : α)
(n : ℕ)


lemma lintegral_tilted (f : α → ℝ) (g : α → ℝ≥0∞) :
    ∫⁻ x, g x ∂(μ.tilted f)
      = ∫⁻ x, ENNReal.ofReal (exp (f x) / ∫ x, exp (f x) ∂μ) * (g x) ∂μ

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

∫⁻ (x : α), g x ∂μ.tilted f = ∫⁻ (x : α), ENNReal.ofReal (rexp (f x) / ∫ (x : α), rexp (f x) ∂μ) * g x ∂μ


theorem hasBasis_toFilterDistortioniUnion (l : IntegrationParams) (I : Box ι) (c : ℝ≥0)
    (π₀ : Prepartition I) :
    (l.toFilterDistortioniUnion I c π₀).HasBasis l.RCond fun r =>
      { π | l.MemBaseSet I c r π ∧ π.iUnion = π₀.iUnion }

{ι : Type u_1}
[Fintype ι]
(l : BoxIntegral.IntegrationParams)
(I : BoxIntegral.Box ι)
(c : ℝ≥0)
(π₀ : BoxIntegral.Prepartition I)

(l.toFilterDistortioniUnion I c π₀).HasBasis l.RCond fun r => {π | l.MemBaseSet I c r π ∧ π.iUnion = π₀.iUnion}


theorem lt_of_lt_of_eq' : b < c → a = b → a < c


theorem lt_succ (s : CompositionSeries X) (i : Fin s.length) :
    s (Fin.castSucc i) < s (Fin.succ i)

{X : Type u}
[Lattice X]
[JordanHolderLattice X]
(s : CompositionSeries X)
(i : Fin s.length)


theorem HasStrictFDerivAt.log (hf : HasStrictFDerivAt f f' x) (hx : f x ≠ 0) :
    HasStrictFDerivAt (fun x => log (f x)) ((f x)⁻¹ • f') x

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

HasStrictFDerivAt (fun x => Real.log (f x)) ((f x)⁻¹ • f') x


@[fun_prop]
theorem ContinuousAt.prod {f : X → Y} {g : X → Z} {x : X} (hf : ContinuousAt f x)
    (hg : ContinuousAt g x) : ContinuousAt (fun x => (f x, g x)) x

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X → Y}
{g : X → Z}
{x : X}
(hf : ContinuousAt f x)
(hg : ContinuousAt g x)


protected theorem inf_comm (a b : CauSeq α abs) : a ⊓ b = b ⊓ a

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


@[simp]
theorem nonempty_star [InvolutiveStar α] {s : Set α} : s⋆.Nonempty ↔ s.Nonempty

{α : Type u_1}
[InvolutiveStar α]
{s : Set α}


lemma shortExact_iff_degreewise_shortExact :
    S.ShortExact ↔ ∀ (i : ι), (S.map (eval C c i)).ShortExact

(S : CategoryTheory.ShortComplex (HomologicalComplex C c))

S.ShortExact ↔ ∀ (i : ι), (S.map (HomologicalComplex.eval C c i)).ShortExact


nonrec lemma _root_.ContinuousAt.compCM (hg : ContinuousAt g a) (hf : ContinuousAt f a) :
    ContinuousAt (fun x ↦ (g x).comp (f x)) a

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[LocallyCompactPair Y Z]
{X' : Type u_6}
[TopologicalSpace X']
{a : X'}
{g : X' → C(Y, Z)}
{f : X' → C(X, Y)}
(hg : ContinuousAt g a)
(hf : ContinuousAt f a)

ContinuousAt (fun x => (g x).comp (f x)) a


/-- To every `Monad C` we associated a monoid object in `C ⥤ C`. -/
@[simps]
def toMon (M : Monad C) : Mon_ (C ⥤ C)

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


theorem lift_principal {s : Set α} (hg : Monotone g) : (𝓟 s).lift g = g s

{α : Type u_1}
{β : Type u_2}
{g : Set α → Filter β}
{s : Set α}
(hg : Monotone g)


/-- The order of the `↔` has been chosen so that `rw [sbtw_cyclic]` cycles to the right while
`rw [← sbtw_cyclic]` cycles to the left (thus following the prepended arrow). -/
theorem sbtw_cyclic {a b c : α} : sbtw a b c ↔ sbtw c a b

{α : Type u_1}
[CircularPreorder α]
{a b c : α}


theorem _root_.Matrix.Nondegenerate.toLinearMap₂ {M : Matrix ι ι R₁} (h : M.Nondegenerate)
    (b : Basis ι R₁ M₁) : (toLinearMap₂ b b M).SeparatingLeft

{R₁ : Type u_2}
{M₁ : Type u_7}
{ι : Type u_16}
[CommRing R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[DecidableEq ι]
[Fintype ι]
{M : Matrix ι ι R₁}
(h : M.Nondegenerate)
(b : Basis ι R₁ M₁)

((Matrix.toLinearMap₂ b b) M).SeparatingLeft


@[simp]
theorem AddMonoidHom.coe_flip_mul :
    ⇑(AddMonoidHom.mul : R →+ R →+ R).flip = AddMonoidHom.mulRight

{R : Type u_1}
[NonUnitalNonAssocSemiring R]


theorem card_Ioc :
    (Finset.Ioc s t).card = ∏ i ∈ s.toFinset ∪ t.toFinset, (t.count i + 1 - s.count i) - 1

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

(Finset.Ioc s t).card = ∏ i ∈ s.toFinset ∪ t.toFinset, (Multiset.count i t + 1 - Multiset.count i s) - 1


/-- `Finsupp.split` is an additive equivalence between `(Σ i, η i) →₀ N` and `Π₀ i, (η i →₀ N)`. -/
@[simps]
def sigmaFinsuppAddEquivDFinsupp [AddZeroClass N] : ((Σi, η i) →₀ N) ≃+ Π₀ i, η i →₀ N

{ι : Type u_1}
{η : ι → Type u_4}
{N : Type u_5}
[AddZeroClass N]
(a : Π₀ (i : ι), η i →₀ N)

sigmaFinsuppAddEquivDFinsupp.symm a = sigmaFinsuppEquivDFinsupp.symm a


/-- Local equivalence between subsets `source` and `target` of `α` and `β` respectively. The
(global) maps `toFun : α → β` and `invFun : β → α` map `source` to `target` and conversely, and are
inverse to each other there. The values of `toFun` outside of `source` and of `invFun` outside of
`target` are irrelevant. -/
structure PartialEquiv (α : Type*) (β : Type*) where
  /-- The global function which has a partial inverse. Its value outside of the `source` subset is
  irrelevant. -/
  toFun : α → β
  /-- The partial inverse to `toFun`. Its value outside of the `target` subset is irrelevant. -/
  invFun : β → α
  /-- The domain of the partial equivalence. -/
  source : Set α
  /-- The codomain of the partial equivalence. -/
  target : Set β
  /-- The proposition that elements of `source` are mapped to elements of `target`. -/
  map_source' : ∀ ⦃x⦄, x ∈ source → toFun x ∈ target
  /-- The proposition that elements of `target` are mapped to elements of `source`. -/
  map_target' : ∀ ⦃x⦄, x ∈ target → invFun x ∈ source
  /-- The proposition that `invFun` is a left-inverse of `toFun` on `source`. -/
  left_inv' : ∀ ⦃x⦄, x ∈ source → invFun (toFun x) = x
  /-- The proposition that `invFun` is a right-inverse of `toFun` on `target`. -/
  right_inv' : ∀ ⦃x⦄, x ∈ target → toFun (invFun x) = x

{α : Type u_5}
{β : Type u_6}
(self : PartialEquiv α β)
⦃x : α⦄

x ∈ self.source → self.invFun (↑self x) = x


theorem tendsto_atBot_atBot_iff_of_monotone [Nonempty α] [SemilatticeInf α] [Preorder β] {f : α → β}
    (hf : Monotone f) : Tendsto f atBot atBot ↔ ∀ b : β, ∃ a : α, f a ≤ b

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

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


/-- Construct a natural transformation between functors `SingleObj M ⥤ C` by
giving a compatible morphism `SingleObj.star M`. -/
@[simps]
def natTrans {F G : SingleObj M ⥤ C} (u : F.obj (SingleObj.star M) ⟶ G.obj (SingleObj.star M))
    (h : ∀ a : M, F.map a ≫ u = u ≫ G.map a) : F ⟶ G

(u : F.obj (CategoryTheory.SingleObj.star M) ⟶ G.obj (CategoryTheory.SingleObj.star M))

(h : ∀ (a : M), F.map a ≫ u = u ≫ G.map a)

∀ (x : CategoryTheory.SingleObj M), (CategoryTheory.SingleObj.natTrans u h).app x = u


theorem torsionBy.mk_smul (a b : R) (x : torsionBy R M a) :
    Ideal.Quotient.mk (R ∙ a) b • x = b • x

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(a b : R)
(x : ↥(Submodule.torsionBy R M a))

(Ideal.Quotient.mk (Submodule.span R {a})) b • x = b • x


@[simp]
theorem lookup_union_eq_some {a} {b : β a} {s₁ s₂ : AList β} :
    lookup a (s₁ ∪ s₂) = some b ↔ lookup a s₁ = some b ∨ a ∉ s₁ ∧ lookup a s₂ = some b

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{s₁ s₂ : AList β}

AList.lookup a (s₁ ∪ s₂) = some b ↔ AList.lookup a s₁ = some b ∨ a ∉ s₁ ∧ AList.lookup a s₂ = some b


theorem span_pair_mul_span_pair (w x y z : R) :
    (span {w, x} : Ideal R) * span {y, z} = span {w * y, w * z, x * y, x * z}

{R : Type u}
[CommSemiring R]
(w x y z : R)

Ideal.span {w, x} * Ideal.span {y, z} = Ideal.span {w * y, w * z, x * y, x * z}


/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the
terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : ℕ`, `y : E`. -/
theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries 𝕜 E F} {x : E}
    (h : HasFPowerSeriesAt 0 p x) (n : ℕ) : ∀ y : E, (p n fun _ => y) = 0

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
(h : HasFPowerSeriesAt 0 p x)
(n : ℕ)
(y : E)


/-- If `f` is continuous on the circle `|z - c| = R`, `R > 0`, the `‖f z‖` is less than or equal to
`C : ℝ` on this circle, and this norm is strictly less than `C` at some point `z` of the circle,
then `‖∮ z in C(c, R), f z‖ < 2 * π * R * C`. -/
theorem norm_integral_lt_of_norm_le_const_of_lt {f : ℂ → E} {c : ℂ} {R C : ℝ} (hR : 0 < R)
    (hc : ContinuousOn f (sphere c R)) (hf : ∀ z ∈ sphere c R, ‖f z‖ ≤ C)
    (hlt : ∃ z ∈ sphere c R, ‖f z‖ < C) : ‖∮ z in C(c, R), f z‖ < 2 * π * R * C

(hc : ContinuousOn f (Metric.sphere c R))

(hf : ∀ z ∈ Metric.sphere c R, ‖f z‖ ≤ C)

(hlt : ∃ z ∈ Metric.sphere c R, ‖f z‖ < C)

‖∮ (z : ℂ) in C(c, R), f z‖ < 2 * π * R * C


theorem derivative_bernoulli (k : ℕ) :
    Polynomial.derivative (bernoulli k) = k * bernoulli (k - 1)

Polynomial.derivative (Polynomial.bernoulli k) = ↑k * Polynomial.bernoulli (k - 1)


theorem sInf_coe_toSubmodule' (S : Set (LieSubmodule R L M)) :
    (↑(sInf S) : Submodule R M) = ⨅ N ∈ S, (N : Submodule R M)

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(S : Set (LieSubmodule R L M))


theorem gcd_eq_left {m n : ℕ+} : m ∣ n → m.gcd n = m


protected theorem mul_dvd_mul_left (a : Nat) (h : b ∣ c) : a * b ∣ a * c


/-- Original version `ContDiff.differentiable_iteratedDeriv` introduces a new variable `(n:ℕ∞)`
and `funProp` can't work with such theorem. The theorem should be state where `n` is explicitly
the smallest possible value i.e. `n=m+1`.

In conjunction with `ContDiff.of_le` we can recover the full power of the original theorem.  -/
theorem ContDiff.differentiable_iteratedDeriv' {m : ℕ} {f : K → F}
    (hf : ContDiff K (m+1) f) : Differentiable K (iteratedDeriv m f)

{K : Type u_1}
[NontriviallyNormedField K]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace K F]
{m : ℕ}
{f : K → F}
(hf : ContDiff K (↑m + 1) f)


/-- The minimal distance to a singleton is the distance to the unique point in this singleton. -/
@[simp]
theorem infDist_singleton : infDist x {y} = dist x y

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


@[simp]
theorem comap_iSup {m : ι → MeasurableSpace α} : (⨆ i, m i).comap g = ⨆ i, (m i).comap g

{α : Type u_1}
{β : Type u_2}
{ι : Sort uι}
{g : β → α}
{m : ι → MeasurableSpace α}

MeasurableSpace.comap g (⨆ i, m i) = ⨆ i, MeasurableSpace.comap g (m i)


/-- If a power series converges at `w`, it converges absolutely at all `z` of smaller norm. -/
theorem summable_powerSeries_of_norm_lt {w z : α}
    (h : CauchySeq fun n ↦ ∑ i ∈ range n, f i * w ^ i) (hz : ‖z‖ < ‖w‖) :
    Summable fun n ↦ f n * z ^ n

(h : CauchySeq fun n => ∑ i ∈ Finset.range n, f i * w ^ i)


theorem singletonChartedSpace_mem_atlas_eq (h : e.source = Set.univ) (e' : PartialHomeomorph α H)
    (h' : e' ∈ (e.singletonChartedSpace h).atlas) : e' = e

{H : Type u}
[TopologicalSpace H]
{α : Type u_5}
[TopologicalSpace α]
(e : PartialHomeomorph α H)
(h : e.source = Set.univ)
(e' : PartialHomeomorph α H)
(h' : e' ∈ ChartedSpace.atlas)


/-- laws for `MvFunctor` -/
class LawfulMvFunctor {n : ℕ} (F : TypeVec n → Type*) [MvFunctor F] : Prop where
  /-- `map` preserved identities, i.e., maps identity on `α` to identity on `F α` -/
  id_map : ∀ {α : TypeVec n} (x : F α), TypeVec.id <$$> x = x
  /-- `map` preserves compositions -/
  comp_map :
    ∀ {α β γ : TypeVec n} (g : α ⟹ β) (h : β ⟹ γ) (x : F α), (h ⊚ g) <$$> x = h <$$> g <$$> x

{n : ℕ}
{F : TypeVec.{u_2} n → Type u_1}
[MvFunctor F]
[self : LawfulMvFunctor F]
{α : TypeVec.{u_2} n}
(x : F α)


@[to_additive]
theorem continuous_coe_inv : Continuous (fun u => ↑u⁻¹ : Mˣ → M)

{M : Type u_1}
[TopologicalSpace M]
[AddMonoid M]


@[simp]
theorem finrank_finsupp {ι : Type v} [Fintype ι] : finrank R (ι →₀ M) = card ι * finrank R M

(R : Type u)
(M : Type v)
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
[Module.Free R M]
{ι : Type v}
[Fintype ι]

FiniteDimensional.finrank R (ι →₀ M) = Fintype.card ι * FiniteDimensional.finrank R M


theorem normalCore_mono {H K : Subgroup G} (h : H ≤ K) : H.normalCore ≤ K.normalCore

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


theorem lieCharacter_apply_of_mem_derived (χ : LieCharacter R L) {x : L}
    (h : x ∈ derivedSeries R L 1) : χ x = 0

(h : x ∈ LieAlgebra.derivedSeries R L 1)


@[to_additive]
theorem IsWF.mul (hs : s.IsWF) (ht : t.IsWF) : IsWF (s * t)

{α : Type u_1}
{s t : Set α}
[LinearOrderedCancelCommMonoid α]
(hs : s.IsWF)
(ht : t.IsWF)


theorem isSt_st' {x : ℝ*} (hx : ¬Infinite x) : IsSt x (st x)


@[simp, rclike_simps]
theorem conj_im (z : K) : im (conj z) = -im z

RCLike.im ((starRingEnd K) z) = -RCLike.im z


@[simp 1100]
theorem unop_mem_unop {s : Set αᵒᵖ} {a : αᵒᵖ} : unop a ∈ s.unop ↔ a ∈ s


@[simp]
theorem coe_npowRec (f : α →ᵇ R) : ∀ n, ⇑(npowRec n f) = (⇑f) ^ n

{α : Type u}
[TopologicalSpace α]
{R : Type u_2}
[SeminormedRing R]
(f : BoundedContinuousFunction α R)
(n : ℕ)


private theorem div_nat_pos (n : ℕ) : 0 < 1 / (n + 1 : ℚ)


theorem eventually_nhdsWithin_pos_mul_left {x : 𝕜} (hx : 0 < x) {p : 𝕜 → Prop}
    (h : ∀ᶠ ε in 𝓝[>] 0, p ε) : ∀ᶠ ε in 𝓝[>] 0, p (x * ε)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{x : 𝕜}
(hx : 0 < x)
{p : 𝕜 → Prop}
(h : ∀ᶠ (ε : 𝕜) in 𝓝[>] 0, p ε)


theorem degree_div_le (p q : R[X]) : degree (p / q) ≤ degree p


theorem inv_rpow (x : ℝ≥0) (y : ℝ) : x⁻¹ ^ y = (x ^ y)⁻¹


@[simp]
theorem toDualRight_apply (a : N) : p.toDualRight a = p.flip a

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(p : PerfectPairing R M N)
(a : N)


lemma Ico_inr_inr :
    Ico (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ico b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[OrderTop α]
[OrderBot β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
(b₁ b₂ : β)

Finset.Ico (Sum.inrₗ b₁) (Sum.inrₗ b₂) = Finset.map (Function.Embedding.inr.trans toLex.toEmbedding) (Finset.Ico b₁ b₂)


lemma prod_eq_zero (hi : i ∈ s) (h : f i = 0) : ∏ j ∈ s, f j = 0

{ι : Type u_1}
{M₀ : Type u_4}
[CommMonoidWithZero M₀]
{f : ι → M₀}
{s : Finset ι}
{i : ι}
(hi : i ∈ s)
(h : f i = 0)


theorem diag_injective : Function.Injective (Sym2.diag : α → Sym2 α)


@[simp]
lemma nonempty_divisors : (divisors n).Nonempty ↔ n ≠ 0


theorem IsBigO.pow {f : α → R} {g : α → 𝕜} (h : f =O[l] g) (n : ℕ) :
    (fun x => f x ^ n) =O[l] fun x => g x ^ n

{α : Type u_1}
{R : Type u_13}
{𝕜 : Type u_15}
[SeminormedRing R]
[NormedDivisionRing 𝕜]
{l : Filter α}
{f : α → R}
{g : α → 𝕜}
(h : f =O[l] g)
(n : ℕ)


theorem lift_mul (x y : ℍ[R,c₁,c₂]) : q.lift (x * y) = q.lift x * q.lift y

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
{c₁ c₂ : R}
(q : QuaternionAlgebra.Basis A c₁ c₂)
(x y : ℍ[R,c₁,c₂])


@[simp]
lemma natTransLift_id (F : Quotient r ⥤ D) :
    natTransLift r (𝟙 (Quotient.functor r ⋙ F)) = 𝟙 _

(F : CategoryTheory.Functor (CategoryTheory.Quotient r) D)

CategoryTheory.Quotient.natTransLift r (CategoryTheory.CategoryStruct.id ((CategoryTheory.Quotient.functor r).comp F)) =
  CategoryTheory.CategoryStruct.id F


/-- A partial homeomorphism defines a homeomorphism between its source and target. -/
@[simps!] -- Porting note: new `simps`
def toHomeomorphSourceTarget : e.source ≃ₜ e.target

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

∀ (a : ↑e.target), ↑(e.toHomeomorphSourceTarget.symm a) = ↑e.symm ↑a


@[to_additive]
lemma Monovary.div_left (h₁ : Monovary f₁ g) (h₂ : Antivary f₂ g) : Monovary (f₁ / f₂) g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommGroup β]
{f₁ f₂ : ι → α}
{g : ι → β}
(h₁ : Monovary f₁ g)
(h₂ : Antivary f₂ g)


@[to_additive]
theorem mul_mul_mul_comm (a b c d : G) : a * b * (c * d) = a * c * (b * d)

{G : Type u_3}
[AddCommSemigroup G]
(a b c d : G)


theorem hnot_le_iff_codisjoint_left : ￢a ≤ b ↔ Codisjoint b a

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


/-- Bounding the norm of the iterated derivative of `B (f x) (g x)` in terms of the
iterated derivatives of `f` and `g` when `B` is bilinear of norm at most `1`:
`‖D^n (x ↦ B (f x) (g x))‖ ≤ ∑_{k ≤ n} n.choose k ‖D^k f‖ ‖D^{n-k} g‖` -/
theorem ContinuousLinearMap.norm_iteratedFDeriv_le_of_bilinear_of_le_one (B : E →L[𝕜] F →L[𝕜] G)
    {f : D → E} {g : D → F} {N : ℕ∞} (hf : ContDiff 𝕜 N f) (hg : ContDiff 𝕜 N g) (x : D) {n : ℕ}
    (hn : (n : ℕ∞) ≤ N) (hB : ‖B‖ ≤ 1) : ‖iteratedFDeriv 𝕜 n (fun y => B (f y) (g y)) x‖ ≤
      ∑ i ∈ Finset.range (n + 1),
        (n.choose i : ℝ) * ‖iteratedFDeriv 𝕜 i f x‖ * ‖iteratedFDeriv 𝕜 (n - i) g x‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{D : Type uD}
[NormedAddCommGroup D]
[NormedSpace 𝕜 D]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(B : E →L[𝕜] F →L[𝕜] G)
{f : D → E}
{g : D → F}
{N : ℕ∞}
(hf : ContDiff 𝕜 N f)
(hg : ContDiff 𝕜 N g)
(x : D)
{n : ℕ}
(hn : ↑n ≤ N)
(hB : ‖B‖ ≤ 1)

‖iteratedFDeriv 𝕜 n (fun y => (B (f y)) (g y)) x‖ ≤
  ∑ i ∈ Finset.range (n + 1), ↑(n.choose i) * ‖iteratedFDeriv 𝕜 i f x‖ * ‖iteratedFDeriv 𝕜 (n - i) g x‖


theorem liftPropOn_congr_iff (h₁ : ∀ y ∈ s, g' y = g y) : LiftPropOn P g' s ↔ LiftPropOn P g s

{H : Type u_1}
{M : Type u_2}
{H' : Type u_3}
{M' : Type u_4}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
{g g' : M → M'}
{s : Set M}
(hG : G.LocalInvariantProp G' P)
(h₁ : ∀ y ∈ s, g' y = g y)

ChartedSpace.LiftPropOn P g' s ↔ ChartedSpace.LiftPropOn P g s


lemma natCast_nonneg (α : Type u) [OrderedSemiring α] (n : ℕ) : (0 : α) ≤ n


theorem isAlgebraic_zero [Nontrivial R] : IsAlgebraic R (0 : A)

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
[Nontrivial R]


theorem le_of_ceil_le (h : ⌈a⌉₊ ≤ n) : a ≤ n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
{n : ℕ}
(h : ⌈a⌉₊ ≤ n)


theorem exists_lt_of_directed_le [IsDirected β (· ≤ ·)] [Nontrivial β] : ∃ a b : β, a < b

(β : Type v)
[PartialOrder β]
[IsDirected β fun x x_1 => x ≤ x_1]
[Nontrivial β]


/-- If `f : 𝕜 → 𝕜` is concave, then for any three points `x < y < z` the slope of the secant line of
`f` on `[x, y]` is greater than the slope of the secant line of `f` on `[y, z]`. -/
theorem ConcaveOn.slope_anti_adjacent (hf : ConcaveOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s) (hz : z ∈ s)
    (hxy : x < y) (hyz : y < z) : (f z - f y) / (z - y) ≤ (f y - f x) / (y - x)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{s : Set 𝕜}
{f : 𝕜 → 𝕜}
(hf : ConcaveOn 𝕜 s f)
{x y z : 𝕜}
(hx : x ∈ s)
(hz : z ∈ s)
(hxy : x < y)
(hyz : y < z)


theorem copy_eq (f : SupBotHom α β) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Bot α]
[Sup β]
[Bot β]
(f : SupBotHom α β)
(f' : α → β)
(h : f' = ⇑f)


/-- If there is a homomorphism `f : α →+* β` and `β` is nontrivial, then `α` is nontrivial. -/
theorem domain_nontrivial [Nontrivial β] : Nontrivial α

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β}, (α →+* β) → ∀ [inst : Nontrivial β], Nontrivial α


/-- `Option` as a functor from types to pointed types. This is the free functor. -/
@[simps]
def typeToPointed : Type u ⥤ Pointed.{u}


/-- Construct a natural isomorphism between functors out of the walking parallel pair from
its components. -/
@[simps!]
def parallelPair.ext {F G : WalkingParallelPair ⥤ C} (zero : F.obj zero ≅ G.obj zero)
    (one : F.obj one ≅ G.obj one) (left : F.map left ≫ one.hom = zero.hom ≫ G.map left)
    (right : F.map right ≫ one.hom = zero.hom ≫ G.map right) : F ≅ G

{F G : CategoryTheory.Functor CategoryTheory.Limits.WalkingParallelPair C}

(zero : F.obj CategoryTheory.Limits.WalkingParallelPair.zero ≅ G.obj CategoryTheory.Limits.WalkingParallelPair.zero)

(one : F.obj CategoryTheory.Limits.WalkingParallelPair.one ≅ G.obj CategoryTheory.Limits.WalkingParallelPair.one)

(left :
  CategoryTheory.CategoryStruct.comp (F.map CategoryTheory.Limits.WalkingParallelPairHom.left) one.hom =
    CategoryTheory.CategoryStruct.comp zero.hom (G.map CategoryTheory.Limits.WalkingParallelPairHom.left))

(right :
  CategoryTheory.CategoryStruct.comp (F.map CategoryTheory.Limits.WalkingParallelPairHom.right) one.hom =
    CategoryTheory.CategoryStruct.comp zero.hom (G.map CategoryTheory.Limits.WalkingParallelPairHom.right))

(CategoryTheory.Limits.parallelPair.ext zero one left right).hom.app X =
  (CategoryTheory.Limits.WalkingParallelPair.rec zero one X).hom


@[to_additive (attr := simp, norm_cast) coe_nonneg]
theorem one_le_coe [LE α] {a : α} : 1 ≤ (a : WithTop α) ↔ 1 ≤ a

0 ≤ ↑a ↔ 0 ≤ a


theorem IsCoatom.of_isCoatom_coe_Ici {a : Set.Ici x} (ha : IsCoatom a) : IsCoatom (a : α)

{α : Type u_2}
[Preorder α]
[OrderTop α]
{x : α}
{a : ↑(Set.Ici x)}
(ha : IsCoatom a)


/-- The short complex `L₀.X₂ ⟶ L₀.X₃ ⟶ L₃.X₁`. -/
@[simps]
noncomputable def L₁' : ShortComplex C

(S : CategoryTheory.ShortComplex.SnakeInput C)


@[parity_simps] lemma odd_add : Odd (m + n) ↔ (Odd m ↔ Even n)


/-- Embedding `Fin n` into `Fin (n + 1)` with a hole around zero embeds by `succ`. -/
@[simp] lemma succAbove_zero : succAbove (0 : Fin (n + 1)) = Fin.succ


protected theorem isAtom (f : Ultrafilter α) : IsAtom (f : Filter α)


lemma nonsingularLift_iff (P : Fin 3 → R) : W'.NonsingularLift ⟦P⟧ ↔ W'.Nonsingular P

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P : Fin 3 → R)


@[to_additive]
lemma tprod_subtype_le {κ γ : Type*} [OrderedCommGroup γ] [UniformSpace γ] [UniformGroup γ]
    [OrderClosedTopology γ] [CompleteSpace γ] (f : κ → γ) (β : Set κ) (h : ∀ a : κ, 1 ≤ f a)
    (hf : Multipliable f) : (∏' (b : β), f b) ≤ (∏' (a : κ), f a)

{κ : Type u_4}
{γ : Type u_5}
[OrderedCommGroup γ]
[UniformSpace γ]
[UniformGroup γ]
[OrderClosedTopology γ]
[CompleteSpace γ]
(f : κ → γ)
(β : Set κ)
(h : ∀ (a : κ), 1 ≤ f a)
(hf : Multipliable f)


@[simp]
theorem neg_one_le (a : SignType) : -1 ≤ a


/-- In a complex Banach algebra, the spectral radius is always attained by some element of the
spectrum. -/
theorem exists_nnnorm_eq_spectralRadius : ∃ z ∈ spectrum ℂ a, (‖z‖₊ : ℝ≥0∞) = spectralRadius ℂ a

{A : Type u_2}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[Nontrivial A]
(a : A)

∃ z ∈ spectrum ℂ a, ↑‖z‖₊ = spectralRadius ℂ a


@[simp]
theorem mem_cofinite {s : Set α} : s ∈ @cofinite α ↔ sᶜ.Finite


/-- The `ShortComplex` in `C` associated to a short complex in `Cᵒᵖ`. -/
@[simps]
def unop (S : ShortComplex Cᵒᵖ) : ShortComplex C


@[simp]
theorem consRecOn_cons {motive : Word M → Sort*} (i) (m : M i) (w : Word M) h1 h2
    (h_empty : motive empty)
    (h_cons : ∀ (i) (m : M i) (w) h1 h2, motive w → motive (cons m w h1 h2)) :
    consRecOn (cons m w h1 h2) h_empty h_cons = h_cons i m w h1 h2
      (consRecOn w h_empty h_cons)

{motive : Monoid.CoprodI.Word M → Sort u_4}

(h_empty : motive Monoid.CoprodI.Word.empty)

(h_cons :
  (i : ι) →
    (m : M i) →
      (w : Monoid.CoprodI.Word M) →
        (h1 : w.fstIdx ≠ some i) → (h2 : m ≠ 1) → motive w → motive (Monoid.CoprodI.Word.cons m w h1 h2))

Monoid.CoprodI.Word.consRecOn (Monoid.CoprodI.Word.cons m w h1 h2) h_empty h_cons =
  h_cons i m w h1 h2 (Monoid.CoprodI.Word.consRecOn w h_empty h_cons)


lemma Multiset.range_succ' {n nn n' : ℕ} (pn : NormNum.IsNat n nn) (pn' : nn = Nat.succ n') :
    Multiset.range n = n' ::ₘ Multiset.range n'

{n nn n' : ℕ}
(pn : Mathlib.Meta.NormNum.IsNat n nn)
(pn' : nn = n'.succ)


theorem multichoose_neg_self (n : ℕ) : multichoose (-n : ℤ) n = (-1)^n


/-- See also `Finset.prod_boole`. -/
@[to_additive "See also `Finset.sum_boole`."]
theorem prod_ite_one (s : Finset α) (p : α → Prop) [DecidablePred p]
    (h : ∀ i ∈ s, ∀ j ∈ s, p i → p j → i = j) (a : β) :
    ∏ i ∈ s, ite (p i) a 1 = ite (∃ i ∈ s, p i) a 1

(∏ i ∈ s, if p i then a else 1) = if ∃ i ∈ s, p i then a else 1


@[to_additive]
theorem iUnion_smul_eq_setOf_exists {s : Set β} : ⋃ g : α, g • s = { a | ∃ g : α, g • a ∈ s }

{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[AddAction α β]
{s : Set β}


@[simp]
theorem lift_inl (n : N) : lift f₁ f₂ h (inl n) = f₁ n

(h : ∀ (g : G), f₁.comp (MulEquiv.toMonoidHom (φ g)) = (MulEquiv.toMonoidHom (MulAut.conj (f₂ g))).comp f₁)

(SemidirectProduct.lift f₁ f₂ h) (SemidirectProduct.inl n) = f₁ n


theorem eventuallyEq_inf_principal_iff {F : Filter α} {s : Set α} {f g : α → β} :
    f =ᶠ[F ⊓ 𝓟 s] g ↔ ∀ᶠ x in F, x ∈ s → f x = g x

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

f =ᶠ[F ⊓ 𝓟 s] g ↔ ∀ᶠ (x : α) in F, x ∈ s → f x = g x


@[simp]
theorem deriv_star (P : RegularExpression α) (a : α) : deriv P.star a = deriv P a * star P

{α : Type u_1}
[dec : DecidableEq α]
(P : RegularExpression α)
(a : α)


theorem basis_toMatrix_mul [Fintype κ] [Finite ι] [DecidableEq κ]
    (b₁ : Basis ι R M) (b₂ : Basis ι' R M) (b₃ : Basis κ R N) (A : Matrix ι' κ R) :
    b₁.toMatrix b₂ * A = LinearMap.toMatrix b₃ b₁ (toLin b₃ b₂ A)

{ι : Type u_1}
{ι' : Type u_2}
{κ : Type u_3}
{R : Type u_5}
{M : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{N : Type u_9}
[AddCommMonoid N]
[Module R N]
[Fintype ι']
[Fintype κ]
[Finite ι]
[DecidableEq κ]
(b₁ : Basis ι R M)
(b₂ : Basis ι' R M)
(b₃ : Basis κ R N)
(A : Matrix ι' κ R)

b₁.toMatrix ⇑b₂ * A = (LinearMap.toMatrix b₃ b₁) ((Matrix.toLin b₃ b₂) A)


@[simp]
theorem coe_comp_orderHom (g : PseudoEpimorphism β γ) (f : PseudoEpimorphism α β) :
    (g.comp f : α →o γ) = (g : β →o γ).comp f

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


theorem toDual_inj (m : M) (a : b.toDual m = 0) : m = 0

{R : Type uR}
{M : Type uM}
{ι : Type uι}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[DecidableEq ι]
(b : Basis ι R M)
(m : M)
(a : b.toDual m = 0)


protected lemma refl (hr : ∀ a : α, r₁₁ a a) :
    LeftTotal r₁₁

{α : Type u_5}
{r₁₁ : α → α → Prop}
(hr : ∀ (a : α), r₁₁ a a)


lemma Algebra.algebraMap_intNorm_of_isGalois
    [IsDomain A] [IsIntegrallyClosed A] [IsDomain B] [IsIntegrallyClosed B]
    [Module.Finite A B] [NoZeroSMulDivisors A B] [IsGalois (FractionRing A) (FractionRing B)]
    {x : B} :
    algebraMap A B (Algebra.intNorm A B x) = ∏ σ : B ≃ₐ[A] B, σ x

(algebraMap A B) ((Algebra.intNorm A B) x) = ∏ σ : B ≃ₐ[A] B, σ x


@[to_additive]
theorem mem_sSup_of_mem {S : Set (Submonoid M)} {s : Submonoid M} (hs : s ∈ S) :
    ∀ {x : M}, x ∈ s → x ∈ sSup S

{M : Type u_1}
[MulOneClass M]
{S : Set (Submonoid M)}
{s : Submonoid M}
(hs : s ∈ S)
{x : M}


@[simp]
theorem length_eraseP_add_one {l : List α} {a} (al : a ∈ l) (pa : p a) :
    (l.eraseP p).length + 1 = l.length

{α : Type u}
{p : α → Bool}
{l : List α}
{a : α}
(al : a ∈ l)
(pa : p a = true)


theorem Array.of_push_eq_push {as bs : Array α} (h : as.push a = bs.push b) : as = bs ∧ a = b

{α : Type u_1}
{a b : α}
{as bs : Array α}
(h : as.push a = bs.push b)


@[simp] lemma div_dvd_iff_dvd_mul (h : b ∣ a) (hb : b ≠ 0) : a / b ∣ c ↔ a ∣ b * c


/-- A functor `G : C ⥤ D` sends bicones over `F` to bicones over `G.obj ∘ F` functorially. -/
@[simps]
def functoriality (G : C ⥤ D) [Functor.PreservesZeroMorphisms G] :
    Bicone F ⥤ Bicone (G.obj ∘ F)

((CategoryTheory.Limits.Bicones.functoriality F G).obj A).π j = G.map (A.π j)


/-- A compact exhaustion eventually covers any compact set. -/
theorem exists_superset_of_isCompact {s : Set X} (hs : IsCompact s) : ∃ n, s ⊆ K n

{X : Type u_1}
[TopologicalSpace X]
(K : CompactExhaustion X)
{s : Set X}
(hs : IsCompact s)


theorem head?_append_of_ne_nil :
    ∀ (l₁ : List α) {l₂ : List α} (_ : l₁ ≠ []), head? (l₁ ++ l₂) = head? l₁

{α : Type u}
(l₁ : List α)
{l₂ : List α}


theorem isMaxFilter_dual_iff : IsMaxFilter (toDual ∘ f) l a ↔ IsMinFilter f l a

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

IsMaxFilter (⇑OrderDual.toDual ∘ f) l a ↔ IsMinFilter f l a


/-- To construct an isomorphism between coforks,
it suffices to give an isomorphism between the cocone points
and check that it commutes with the `π` morphisms.
-/
@[simps]
def Cofork.ext {s t : Cofork f g} (i : s.pt ≅ t.pt) (w : s.π ≫ i.hom = t.π := by aesop_cat) :
    s ≅ t

{s t : CategoryTheory.Limits.Cofork f g}

(w : CategoryTheory.CategoryStruct.comp s.π i.hom = t.π := by aesop_cat)

(CategoryTheory.Limits.Cofork.ext i w).inv = CategoryTheory.Limits.Cofork.mkHom i.inv ⋯


@[to_additive (attr := simp)]
theorem toList_of (x : α) : toList (of x) = [x]

FreeMonoid.toList (FreeMonoid.of x) = [x]


theorem adjoin_rootSet (f : K[X]) [IsSplittingField K L f] :
    Algebra.adjoin K (f.rootSet L : Set L) = ⊤

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


@[simp, mfld_simps]
theorem localTrivAt_def (b : B) : Z.localTriv (Z.indexAt b) = Z.localTrivAt b

{ι : Type u_1}
{B : Type u_2}
{F : Type u_3}
[TopologicalSpace B]
[TopologicalSpace F]
(Z : FiberBundleCore ι B F)
(b : B)


@[simp]
theorem mem_weightedHomogeneousSubmodule (w : σ → M) (m : M) (p : MvPolynomial σ R) :
    p ∈ weightedHomogeneousSubmodule R w m ↔ p.IsWeightedHomogeneous w m

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

p ∈ MvPolynomial.weightedHomogeneousSubmodule R w m ↔ MvPolynomial.IsWeightedHomogeneous w p m


/-- An integral domain in which there is an irreducible element `p`
such that every nonzero element is associated to a power of `p`
is a discrete valuation ring.
-/
theorem ofHasUnitMulPowIrreducibleFactorization {R : Type u} [CommRing R] [IsDomain R]
    (hR : HasUnitMulPowIrreducibleFactorization R) : DiscreteValuationRing R

(hR : DiscreteValuationRing.HasUnitMulPowIrreducibleFactorization R)


@[simp]
theorem liftAlternating_comp (g : N →ₗ[R] N') (f : ∀ i, M [⋀^Fin i]→ₗ[R] N) :
    (liftAlternating (R := R) (M := M) (N := N') fun i => g.compAlternatingMap (f i)) =
    g ∘ₗ liftAlternating (R := R) (M := M) (N := N) f

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{N' : Type u_4}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup N']
[Module R M]
[Module R N]
[Module R N']
(g : N →ₗ[R] N')
(f : (i : ℕ) → M [⋀^Fin i]→ₗ[R] N)

(ExteriorAlgebra.liftAlternating fun i => g.compAlternatingMap (f i)) = g ∘ₗ ExteriorAlgebra.liftAlternating f


theorem stepNormal.is_ret (c k v) : ∃ k' v', stepNormal c k v = Cfg.ret k' v'

(c : Turing.ToPartrec.Code)
(k : Turing.ToPartrec.Cont)
(v : List ℕ)

∃ k' v', Turing.ToPartrec.stepNormal c k v = Turing.ToPartrec.Cfg.ret k' v'


theorem takeWhile_takeWhile (p q : α → Bool) (l : List α) :
    takeWhile p (takeWhile q l) = takeWhile (fun a => p a ∧ q a) l

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

List.takeWhile p (List.takeWhile q l) = List.takeWhile (fun a => decide (p a = true ∧ q a = true)) l


theorem map_mk_disjoint_sym2 (x : α) (xs : List α) (h : x ∉ xs) :
    (map (fun y ↦ s(x, y)) xs).Disjoint xs.sym2

{α : Type u_1}
(x : α)
(xs : List α)
(h : x ∉ xs)

(List.map (fun y => s(x, y)) xs).Disjoint xs.sym2


@[to_additive]
protected theorem div_mul_div_comm (hbd : Commute b d) (hbc : Commute b⁻¹ c) :
    a / b * (c / d) = a * c / (b * d)

{G : Type u_1}
[DivisionMonoid G]
{a b c d : G}
(hbd : Commute b d)
(hbc : Commute b⁻¹ c)


/-- A space is totally separated if any two points can be separated by two disjoint open sets
covering the whole space. -/
class TotallySeparatedSpace (α : Type u) [TopologicalSpace α] : Prop where
  /-- The universal set `Set.univ` in a totally separated space is totally separated. -/
  isTotallySeparated_univ : IsTotallySeparated (univ : Set α)

{α : Type u}
[TopologicalSpace α]
[self : TotallySeparatedSpace α]


/-- Naturally isomorphic endofunctors give equivalent categories of algebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Algebra F ≌ Algebra G

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

(CategoryTheory.Endofunctor.Algebra.equivOfNatIso α).counitIso =
  (CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp α.inv α.hom).symm ≪≫
    CategoryTheory.Endofunctor.Algebra.functorOfNatTransEq ⋯ ≪≫ CategoryTheory.Endofunctor.Algebra.functorOfNatTransId


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

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


theorem mono_lie_right (h : N ≤ N') : ⁅I, N⁆ ≤ ⁅I, N'⁆

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{N N' : LieSubmodule R L M}
(I : LieIdeal R L)
(h : N ≤ N')


/-- If the same point subtracted from two points produces equal
results, those points are equal. -/
theorem vsub_left_cancel {p₁ p₂ p : P} (h : p₁ -ᵥ p = p₂ -ᵥ p) : p₁ = p₂

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[T : AddTorsor G P]
{p₁ p₂ p : P}
(h : p₁ -ᵥ p = p₂ -ᵥ p)


@[to_additive]
theorem map_sup (S T : Subsemigroup M) (f : M →ₙ* N) : (S ⊔ T).map f = S.map f ⊔ T.map f

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

AddSubsemigroup.map f (S ⊔ T) = AddSubsemigroup.map f S ⊔ AddSubsemigroup.map f T


@[simp] lemma Spec.preimage_map : Spec.preimage (Spec.map φ) = φ

AlgebraicGeometry.Spec.preimage (AlgebraicGeometry.Spec.map φ) = φ


theorem ne_bot_iff {f : Filter α} (F : f.Realizer) : f ≠ ⊥ ↔ ∀ a : F.σ, (F.F a).Nonempty

{α : Type u_1}
{f : Filter α}
(F : f.Realizer)


/-- If the image of a morphism falls in a subpresheaf, then the morphism factors through it. -/
@[simps!]
def Subpresheaf.lift (f : F' ⟶ F) (hf : ∀ U x, f.app U x ∈ G.obj U) : F' ⟶ G.toPresheaf

(G : CategoryTheory.GrothendieckTopology.Subpresheaf F)

(hf : ∀ (U : Cᵒᵖ) (x : F'.obj U), f.app U x ∈ G.obj U)


@[simp]
theorem revAt_invol {N i : ℕ} : (revAt N) (revAt N i) = i

(Polynomial.revAt N) ((Polynomial.revAt N) i) = i


/-- If `f` is a strictly monotone map and `x < f x` at some point `x`, then the iterates `f^[n] x`
form a strictly monotone sequence. -/
theorem strictMono_iterate_of_lt_map (hf : StrictMono f) (hx : x < f x) :
    StrictMono fun n => f^[n] x

{α : Type u_1}
[Preorder α]
{f : α → α}
{x : α}
(hf : StrictMono f)
(hx : x < f x)


theorem sup_inf_assoc_of_le {x : α} (y : α) {z : α} (h : x ≤ z) : (x ⊔ y) ⊓ z = x ⊔ y ⊓ z

{α : Type u_1}
[Lattice α]
[IsModularLattice α]
{x : α}
(y : α)
{z : α}
(h : x ≤ z)


theorem eraseLead_natDegree_le (f : R[X]) : (eraseLead f).natDegree ≤ f.natDegree - 1


theorem degreeOf_mul_le (i : σ) (f g : MvPolynomial σ R) :
    degreeOf i (f * g) ≤ degreeOf i f + degreeOf i g

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(i : σ)
(f g : MvPolynomial σ R)

MvPolynomial.degreeOf i (f * g) ≤ MvPolynomial.degreeOf i f + MvPolynomial.degreeOf i g


@[to_additive]
theorem monotone_comap {f : F} : Monotone (comap f)

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{f : F}


theorem Perm.append_right {l₁ l₂ : List α} (t₁ : List α) (p : l₁ ~ l₂) : l₁ ++ t₁ ~ l₂ ++ t₁

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


@[to_additive (attr := simp) fst_comp_prod]
theorem fst_comp_prod (f : M →* N) (g : M →* P) : (fst N P).comp (f.prod g) = f

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[MulOneClass M]
[MulOneClass N]
[MulOneClass P]
(f : M →* N)
(g : M →* P)


@[to_additive]
theorem prod_congr' {M : Type*} [CommMonoid M] {a b : ℕ} (f : Fin b → M) (h : a = b) :
    (∏ i : Fin a, f (cast h i)) = ∏ i : Fin b, f i

{M : Type u_3}
[CommMonoid M]
{a b : ℕ}
(f : Fin b → M)
(h : a = b)

∏ i : Fin a, f (Fin.cast h i) = ∏ i : Fin b, f i


@[simp]
theorem transpose_empty_cols (A : Matrix (Fin 0) m' α) : Aᵀ = of fun _ => ![]

{α : Type u}
{m' : Type uₘ}
(A : Matrix (Fin 0) m' α)


@[simp]
protected theorem not_top_lt (a : WithTop α) : ¬⊤ < a


/-- If `M` is a finite `R`-module, then the canonical map
`AdicCompletion I R ⊗[R] M →ₗ AdicCompletion I M` is surjective. -/
lemma ofTensorProduct_surjective_of_finite [Module.Finite R M] :
    Function.Surjective (ofTensorProduct I M)

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(M : Type u_2)
[AddCommGroup M]
[Module R M]
[Module.Finite R M]

Function.Surjective ⇑(AdicCompletion.ofTensorProduct I M)


/-- See also `smul_finsum` for a version that works even when the support of `f` is not finite,
but with slightly stronger typeclass requirements. -/
theorem smul_finsum' {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] (c : R) {f : ι → M}
    (hf : (support f).Finite) : (c • ∑ᶠ i, f i) = ∑ᶠ i, c • f i

{ι : Type u_3}
{R : Type u_7}
{M : Type u_8}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(c : R)
{f : ι → M}
(hf : (Function.support f).Finite)

c • ∑ᶠ (i : ι), f i = ∑ᶠ (i : ι), c • f i


/-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F

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

(CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).functor.obj X =
  CategoryTheory.CostructuredArrow.mk (CategoryTheory.yonedaEquiv.symm (Opposite.unop X).snd)


@[simp, mfld_simps]
theorem prod_symm (e : PartialEquiv α β) (e' : PartialEquiv γ δ) :
    (e.prod e').symm = e.symm.prod e'.symm

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(e : PartialEquiv α β)
(e' : PartialEquiv γ δ)


@[simp]
theorem nonempty_iff {α} : Nonempty (Erased α) ↔ Nonempty α


theorem ncard_union_le (s t : Set α) : (s ∪ t).ncard ≤ s.ncard + t.ncard


theorem image_div : (s / t).image (f : α → β) = s.image f / t.image f

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[DecidableEq β]
[Group α]
[DivisionMonoid β]
[FunLike F α β]
[MonoidHomClass F α β]
(f : F)
{s t : Finset α}

Finset.image (⇑f) (s / t) = Finset.image (⇑f) s / Finset.image (⇑f) t


@[to_additive]
lemma inv_mul_cancel_assoc (h : Commute a b) : a⁻¹ * (b * a) = b

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


lemma gcd_div_id_eq_one {s : Finset α} {a : α} (has : a ∈ s) (ha : a ≠ 0) :
    s.gcd (fun b ↦ b / s.gcd id) = 1

{α : Type u_2}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
[Div α]
[MulDivCancelClass α]
{s : Finset α}
{a : α}
(has : a ∈ s)
(ha : a ≠ 0)


@[simp]
theorem mem_dualCoannihilator {Φ : Submodule R (Module.Dual R M)} (x : M) :
    x ∈ Φ.dualCoannihilator ↔ ∀ φ ∈ Φ, (φ x : R) = 0

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

x ∈ Φ.dualCoannihilator ↔ ∀ φ ∈ Φ, φ x = 0


theorem deriv_cos {x : ℂ} : deriv cos x = -sin x


@[to_additive]
lemma preimage_div (hm : Injective m) {s t : Set β} (hs : s ⊆ range m) (ht : t ⊆ range m) :
    m ⁻¹' (s / t) = m ⁻¹' s / m ⁻¹' t

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Group α]
[DivisionMonoid β]
[FunLike F α β]
[MonoidHomClass F α β]
(m : F)
(hm : Function.Injective ⇑m)
{s t : Set β}
(hs : s ⊆ Set.range ⇑m)
(ht : t ⊆ Set.range ⇑m)


theorem algebraMap_surjective
    [IsSepClosed k] [Algebra k K] [Algebra.IsSeparable k K] :
    Function.Surjective (algebraMap k K)

(k : Type u)
[Field k]
(K : Type v)
[Field K]
[IsSepClosed k]
[Algebra k K]
[Algebra.IsSeparable k K]


lemma in₂₀_iff' :
    (graph t).Adj (in₂ c) (in₀ a) ↔ ∃ x : α × β × γ, x ∈ t ∧ x.2.2 = c ∧ x.1 = a

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

(SimpleGraph.TripartiteFromTriangles.graph t).Adj (Sum3.in₂ c) (Sum3.in₀ a) ↔ ∃ x ∈ t, x.2.2 = c ∧ x.1 = a


/-- `Function.const` as a `NonUnitalRingHom`. -/
@[simps]
def Pi.constNonUnitalRingHom (α β : Type*) [NonUnitalNonAssocSemiring β] : β →ₙ+* α → β

(α : Type u_1)
(β : Type u_2)
[NonUnitalNonAssocSemiring β]
(a : β)

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


/-- A topological space is locally path connected, at every point, path connected
neighborhoods form a neighborhood basis. -/
class LocPathConnectedSpace (X : Type*) [TopologicalSpace X] : Prop where
  /-- Each neighborhood filter has a basis of path-connected neighborhoods. -/
  path_connected_basis : ∀ x : X, (𝓝 x).HasBasis (fun s : Set X => s ∈ 𝓝 x ∧ IsPathConnected s) id

{X : Type u_4}
[TopologicalSpace X]
[self : LocPathConnectedSpace X]
(x : X)

(𝓝 x).HasBasis (fun s => s ∈ 𝓝 x ∧ IsPathConnected s) id


/-- A transvection matrix is obtained from the identity by adding `c` times the `j`-th row to
the `i`-th row. -/
theorem updateRow_eq_transvection [Finite n] (c : R) :
    updateRow (1 : Matrix n n R) i ((1 : Matrix n n R) i + c • (1 : Matrix n n R) j) =
      transvection i j c

{n : Type u_1}
{R : Type u₂}
[DecidableEq n]
[CommRing R]
(i j : n)
[Finite n]
(c : R)

Matrix.updateRow 1 i (1 i + c • 1 j) = Matrix.transvection i j c


theorem restrict_eq_iff {f : ∀ a, π a} {s : Set α} {g : ∀ a : s, π a} :
    restrict s f = g ↔ ∀ (a) (ha : a ∈ s), f a = g ⟨a, ha⟩

{α : Type u_1}
{π : α → Type u_5}
{f : (a : α) → π a}
{s : Set α}
{g : (a : ↑s) → π ↑a}

s.restrict f = g ↔ ∀ (a : α) (ha : a ∈ s), f a = g ⟨a, ha⟩


@[simp]
theorem _root_.MvPolynomial.isSymmetric_rename {e : σ ≃ τ} :
    (MvPolynomial.rename e φ).IsSymmetric ↔ φ.IsSymmetric

{σ : Type u_1}
{R : Type u_2}
{τ : Type u_3}
[CommSemiring R]
{φ : MvPolynomial σ R}
{e : σ ≃ τ}

((MvPolynomial.rename ⇑e) φ).IsSymmetric ↔ φ.IsSymmetric


/-- An open embedding of `X` into `Y`, with `X` nonempty, defines a partial homeomorphism
whose source is all of `X`. The converse is also true; see `PartialHomeomorph.to_openEmbedding`. -/
@[simps! (config := mfld_cfg) apply source target]
noncomputable def toPartialHomeomorph [Nonempty X] : PartialHomeomorph X Y

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(f : X → Y)
(h : OpenEmbedding f)
[Nonempty X]

(OpenEmbedding.toPartialHomeomorph f h).source = Set.univ


@[ext] theorem ext : ∀ {o₁ o₂ : Option α}, (∀ a, a ∈ o₁ ↔ a ∈ o₂) → o₁ = o₂


theorem not_le_of_gt {a b : α} (h : a > b) : ¬a ≤ b

{α : Type u}
[Preorder α]
{a b : α}
(h : a > b)


theorem of_iterate (n : ℕ) (hf : PreErgodic f^[n] μ) : PreErgodic f μ

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → α}
{μ : MeasureTheory.Measure α}
(n : ℕ)
(hf : PreErgodic f^[n] μ)


theorem continuous_matrix_diag : Continuous (Matrix.diag : Matrix n n R → n → R)

{n : Type u_5}
{R : Type u_8}
[TopologicalSpace R]


@[simp]
theorem codisjoint_ofDual_iff [SemilatticeSup α] [OrderTop α] {a b : αᵒᵈ} :
    Codisjoint (ofDual a) (ofDual b) ↔ Disjoint a b

{α : Type u_1}
[SemilatticeSup α]
[OrderTop α]
{a b : αᵒᵈ}

Codisjoint (OrderDual.ofDual a) (OrderDual.ofDual b) ↔ Disjoint a b


protected theorem ind₂ {X : C} (p : Subobject X → Subobject X → Prop)
    (h : ∀ ⦃A B : C⦄ (f : A ⟶ X) (g : B ⟶ X) [Mono f] [Mono g],
      p (Subobject.mk f) (Subobject.mk g))
    (P Q : Subobject X) : p P Q

(p : CategoryTheory.Subobject X → CategoryTheory.Subobject X → Prop)

(h :
  ∀ ⦃A B : C⦄ (f : A ⟶ X) (g : B ⟶ X) [inst : CategoryTheory.Mono f] [inst_1 : CategoryTheory.Mono g],
    p (CategoryTheory.Subobject.mk f) (CategoryTheory.Subobject.mk g))


@[simp]
theorem invFunIdAssoc_inv_app (e : C ≌ D) (F : D ⥤ E) (X : D) :
    (invFunIdAssoc e F).inv.app X = F.map (e.counitInv.app X)

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

(e.invFunIdAssoc F).inv.app X = F.map (e.counitInv.app X)


@[simp high] theorem imp_self : (a → a) ↔ True


@[simp]
theorem smul_comp (c : S₃) (h : M₂ →SL[σ₂₃] M₃) (f : M →SL[σ₁₂] M₂) :
    (c • h).comp f = c • h.comp f

{R : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
{S₃ : Type u_5}
[Semiring R]
[Semiring R₂]
[Semiring R₃]
[Monoid S₃]
{M : Type u_6}
[TopologicalSpace M]
[AddCommMonoid M]
[Module R M]
{M₂ : Type u_7}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{M₃ : Type u_8}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
[Module R₃ M₃]
[DistribMulAction S₃ M₃]
[SMulCommClass R₃ S₃ M₃]
[ContinuousConstSMul S₃ M₃]
{σ₁₂ : R →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(c : S₃)
(h : M₂ →SL[σ₂₃] M₃)
(f : M →SL[σ₁₂] M₂)


lemma appLE_eq_away_map {X Y : Scheme.{u}} (f : X ⟶ Y) {U : Y.Opens} (hU : IsAffineOpen U)
    {V : X.Opens} (hV : IsAffineOpen V) (e) (r : Γ(Y, U)) :
    letI := hU.isLocalization_basicOpen r
    letI := hV.isLocalization_basicOpen (f.appLE U V e r)
    f.appLE (Y.basicOpen r) (X.basicOpen (f.appLE U V e r)) (by simp [Scheme.Hom.appLE]) =
        IsLocalization.Away.map _ _ (f.appLE U V e) r

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

AlgebraicGeometry.Scheme.Hom.appLE f (Y.basicOpen r) (X.basicOpen ((AlgebraicGeometry.Scheme.Hom.appLE f U V e) r)) ⋯ =
  IsLocalization.Away.map (↑(Y.presheaf.obj (Opposite.op (Y.basicOpen r))))
    (↑(X.presheaf.obj (Opposite.op (X.basicOpen ((AlgebraicGeometry.Scheme.Hom.appLE f U V e) r)))))
    (AlgebraicGeometry.Scheme.Hom.appLE f U V e) r


@[simp]
lemma ofHom_desc :
    Cochain.ofHom (desc φ α β eq) = descCochain φ α (Cochain.ofHom β) (neg_add_self 1)

(α : CochainComplex.HomComplex.Cochain F K (-1))

(eq : CochainComplex.HomComplex.δ (-1) 0 α = CochainComplex.HomComplex.Cochain.ofHom (φ ≫ β))

CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.desc φ α β eq) =
  CochainComplex.mappingCone.descCochain φ α (CochainComplex.HomComplex.Cochain.ofHom β) ⋯


@[to_additive (attr := fun_prop)]
nonrec theorem ContinuousAt.const_smul (hg : ContinuousAt g b) (c : M) :
    ContinuousAt (fun x => c • g x) b

{M : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[VAdd M α]
[ContinuousConstVAdd M α]
[TopologicalSpace β]
{g : β → α}
{b : β}
(hg : ContinuousAt g b)
(c : M)


theorem liftp_iff' {α : Type u} (p : α → Prop) (x : F α) :
    Liftp p x ↔ ∃ u : q.P α, abs u = x ∧ ∀ i, p (u.snd i)

{F : Type u → Type u}
[q : QPF F]
{α : Type u}
(p : α → Prop)
(x : F α)

Functor.Liftp p x ↔ ∃ u, QPF.abs u = x ∧ ∀ (i : (QPF.P F).B u.fst), p (u.snd i)


theorem card_mono {a : α} {P Q : Finpartition a} (h : P ≤ Q) : Q.parts.card ≤ P.parts.card

{α : Type u_1}
[DistribLattice α]
[OrderBot α]
{a : α}
{P Q : Finpartition a}
(h : P ≤ Q)


/-- A prefunctor induces a map of `Quiver.Costar` at every vertex. -/
@[simps]
def Prefunctor.costar (u : U) : Quiver.Costar u → Quiver.Costar (φ.obj u)

{U : Type u_1}
[Quiver U]
{V : Type u_2}
[Quiver V]
(φ : U ⥤q V)
(u : U)

∀ (a : Quiver.Costar u), (φ.costar u a).fst = φ.obj a.fst


@[simp]
theorem zeta_pmul (f : ArithmeticFunction R) : (ζ : ArithmeticFunction R).pmul f = f

{R : Type u_1}
[NonAssocSemiring R]
(f : ArithmeticFunction R)


private lemma nonsingular_add_of_Z_ne_zero {P Q : Fin 3 → F} (hP : W.Nonsingular P)
    (hQ : W.Nonsingular Q) (hPz : P z ≠ 0) (hQz : Q z ≠ 0)
    (hxy : P x * Q z ^ 2 = Q x * P z ^ 2 → P y * Q z ^ 3 ≠ W.negY Q * P z ^ 3) : W.Nonsingular
      ![W.toAffine.addX (P x / P z ^ 2) (Q x / Q z ^ 2)
          (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
        W.toAffine.addY (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3)
          (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)), 1]


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


/-- In an ordered commutative monoid, if each factor `f i` of one finite product is less than or
equal to the corresponding factor `g i` of another finite product, then `s.prod f ≤ s.prod g`.

This is a variant (beta-reduced) version of the standard lemma `Finset.prod_le_prod'`, convenient
for the `gcongr` tactic. -/
@[to_additive (attr := gcongr) GCongr.sum_le_sum]
theorem _root_.GCongr.prod_le_prod' (h : ∀ i ∈ s, f i ≤ g i) : s.prod f ≤ s.prod g

{ι : Type u_1}
{N : Type u_5}
[OrderedAddCommMonoid N]
{f g : ι → N}
{s : Finset ι}
(h : ∀ i ∈ s, f i ≤ g i)


@[simp]
theorem apply_inv_self (e : MulAut M) (m : M) : e (e⁻¹ m) = m

(M : Type u_2)
[Mul M]
(e : MulAut M)
(m : M)


@[to_additive]
theorem NeBot.of_mul_right : (f * g).NeBot → g.NeBot


@[simp]
theorem disjSups_empty_left : ∅ ○ t = ∅

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
[OrderBot α]
[DecidableRel Disjoint]
{t : Finset α}


theorem norm_coe_eq_abs_iff {x : ℝ} (hp : p ≠ 0) : ‖(x : AddCircle p)‖ = |x| ↔ |x| ≤ |p| / 2


private lemma LSeries.LSeriesSummable_logMul_and_hasDerivAt {f : ℕ → ℂ} {s : ℂ}
    (h : abscissaOfAbsConv f < s.re) :
    LSeriesSummable (logMul f) s ∧ HasDerivAt (LSeries f) (-LSeries (logMul f) s) s

(h : LSeries.abscissaOfAbsConv f < ↑s.re)

LSeriesSummable (LSeries.logMul f) s ∧ HasDerivAt (LSeries f) (-LSeries (LSeries.logMul f) s) s


@[simp]
theorem cast_neg (h : m ∣ n) (a : ZMod n) : (cast (-a : ZMod n) : R) = -(cast a)

{n : ℕ}
{R : Type u_1}
[Ring R]
{m : ℕ}
[CharP R m]
(h : m ∣ n)
(a : ZMod n)


@[to_additive]
theorem orbit_subgroup_eq_rightCoset (a : α) : MulAction.orbit s a = op a • s

{α : Type u_1}
[AddGroup α]
(s : AddSubgroup α)
(a : α)

AddAction.orbit (↥s) a = AddOpposite.op a +ᵥ ↑s


@[to_additive]
theorem closure_subset {s t : Set G} (ht : IsSubgroup t) (h : s ⊆ t) : closure s ⊆ t

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


lemma map_map_assoc_symm (f : M →ₗ[R] Q) (g : N →ₗ[R] S) (h : P →ₗ[R] T) (x : M ⊗[R] (N ⊗[R] P)) :
    map (map f g) h ((TensorProduct.assoc R M N P).symm x) =
      (TensorProduct.assoc R Q S T).symm (map f (map g h) x)

(x : TensorProduct R M (TensorProduct R N P))

(TensorProduct.map (TensorProduct.map f g) h) ((TensorProduct.assoc R M N P).symm x) =
  (TensorProduct.assoc R Q S T).symm ((TensorProduct.map f (TensorProduct.map g h)) x)


@[simp]
theorem range_normSq : range normSq = Ici 0


lemma sum_prod_piFinset {κ : Type*} [Fintype ι] (s : Finset κ) (g : ι → κ → α) :
    ∑ f ∈ piFinset fun _ : ι ↦ s, ∏ i, g i (f i) = ∏ i, ∑ j ∈ s, g i j

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

∑ f ∈ Fintype.piFinset fun x => s, ∏ i : ι, g i (f i) = ∏ i : ι, ∑ j ∈ s, g i j


@[simps (config := .lemmasOnly) toSemigroup_toMul_mul toOne_one]
instance End : Monoid (A →ₗc[R] A)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[CoalgebraStruct R A]


theorem tsub_tsub (b a c : α) : b - a - c = b - (a + c)

{α : Type u_1}
[PartialOrder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
(b a c : α)


theorem coeff_zero_mem_comap_of_root_mem_of_eval_mem {r : S} (hr : r ∈ I) {p : R[X]}
    (hp : p.eval₂ f r ∈ I) : p.coeff 0 ∈ I.comap f

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
{f : R →+* S}
{I : Ideal S}
{r : S}
(hr : r ∈ I)
{p : Polynomial R}
(hp : Polynomial.eval₂ f r p ∈ I)


theorem pi_Ioo_ae_eq_pi_Ioc {s : Set ι} {f g : ∀ i, α i} :
    (pi s fun i => Ioo (f i) (g i)) =ᵐ[Measure.pi μ] pi s fun i => Ioc (f i) (g i)

{μ : (i : ι) → MeasureTheory.Measure (α i)}

[∀ (i : ι), MeasureTheory.SigmaFinite (μ i)]

[∀ (i : ι), MeasureTheory.NoAtoms (μ i)]

(s.pi fun i => Set.Ioo (f i) (g i)) =ᵐ[MeasureTheory.Measure.pi μ] s.pi fun i => Set.Ioc (f i) (g i)


@[to_additive]
protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1

{α : Type u_2}
[OrderedCommGroup α]
{s t : NonemptyInterval α}

s * t = 1 ↔ ∃ a b, s = NonemptyInterval.pure a ∧ t = NonemptyInterval.pure b ∧ a * b = 1


theorem Ico_subset_Iio_self : Ico a b ⊆ Iio b


theorem inv_single {R} [DivisionRing R] {a b : R}
    (_ : (a : R)⁻¹ = b) : (a + 0)⁻¹ = b + 0

{R : Type u_2}
[DivisionRing R]
{a b : R}


/-- If every element belongs to exactly `n` Finsets, then the sum of their sizes is `n` times how
many they are. -/
theorem sum_card [Fintype α] (h : ∀ a, (B.filter (a ∈ ·)).card = n) :
    ∑ s ∈ B, s.card = Fintype.card α * n

(h : ∀ (a : α), (Finset.filter (fun x => a ∈ x) B).card = n)


theorem exists_ne_odd_degree_of_exists_odd_degree [Fintype V] [DecidableRel G.Adj] (v : V)
    (h : Odd (G.degree v)) : ∃ w : V, w ≠ v ∧ Odd (G.degree w)

{V : Type u}
(G : SimpleGraph V)
[Fintype V]
[DecidableRel G.Adj]
(v : V)
(h : Odd (G.degree v))


theorem mem_finPairsLT {n : ℕ} {a : Σ_ : Fin n, Fin n} : a ∈ finPairsLT n ↔ a.2 < a.1

a ∈ Equiv.Perm.finPairsLT n ↔ a.snd < a.fst


theorem negSucc_emod (m : Nat) {b : Int} (bpos : 0 < b) : -[m+1] % b = b - 1 - m % b


/-- In the canonical isometric isomorphism between a Hilbert sum `E` of `G : ι → Type*` and
`lp G 2`, a finitely-supported vector in `lp G 2` is the image of the associated finite sum of
elements of `E`. -/
protected theorem IsHilbertSum.linearIsometryEquiv_symm_apply_dfinsupp_sum_single
    (hV : IsHilbertSum 𝕜 G V) (W₀ : Π₀ i : ι, G i) :
    hV.linearIsometryEquiv.symm (W₀.sum (lp.single 2)) = W₀.sum fun i => V i

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[cplt : CompleteSpace E]
{G : ι → Type u_4}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
{V : (i : ι) → G i →ₗᵢ[𝕜] E}
(hV : IsHilbertSum 𝕜 G V)
(W₀ : Π₀ (i : ι), G i)

hV.linearIsometryEquiv.symm (W₀.sum (lp.single 2)) = W₀.sum fun i => ⇑(V i)


@[simp, bv_toNat] theorem toInt_mul (x y : BitVec w) :
  (x * y).toInt = (x.toInt * y.toInt).bmod (2^w)

(x * y).toInt = (x.toInt * y.toInt).bmod (2 ^ w)


lemma exists_prime_iff :
    (∃ (p : α), Prime p) ↔ ∃ (x : α), x ≠ 0 ∧ ¬ IsUnit x

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]


/-- Equivalent characterizations of split exact sequences. Also known as the **Splitting lemma**. -/
theorem Exact.split_tfae
    {R M N P} [Semiring R] [AddCommGroup M] [AddCommGroup N]
    [AddCommGroup P] [Module R M] [Module R N] [Module R P] {f : M →ₗ[R] N} {g : N →ₗ[R] P}
    (h : Function.Exact f g) (hf : Function.Injective f) (hg : Function.Surjective g) :
    List.TFAE [
      ∃ l, g ∘ₗ l = LinearMap.id,
      ∃ l, l ∘ₗ f = LinearMap.id,
      ∃ e : N ≃ₗ[R] M × P, f = e.symm ∘ₗ LinearMap.inl R M P ∧ g = LinearMap.snd R M P ∘ₗ e]

{R : Type u_8}
{M : Type u_9}
{N : Type u_10}
{P : Type u_11}
[Semiring R]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
{f : M →ₗ[R] N}
{g : N →ₗ[R] P}
(h : Function.Exact ⇑f ⇑g)
(hf : Function.Injective ⇑f)
(hg : Function.Surjective ⇑g)

[∃ l, g ∘ₗ l = LinearMap.id, ∃ l, l ∘ₗ f = LinearMap.id,
    ∃ e, f = ↑e.symm ∘ₗ LinearMap.inl R M P ∧ g = LinearMap.snd R M P ∘ₗ ↑e].TFAE


lemma ContinuousWithinAt.finset_inf' (hne : s.Nonempty)
    (hs : ∀ i ∈ s, ContinuousWithinAt (f i) t x) : ContinuousWithinAt (s.inf' hne f) t x


@[simp]
theorem constantCoeff_wittAdd (n : ℕ) : constantCoeff (wittAdd p n) = 0

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

MvPolynomial.constantCoeff (WittVector.wittAdd p n) = 0


@[simp]
theorem smul_bot (a : M) : a • (⊥ : Subring R) = ⊥

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[Ring R]
[MulSemiringAction M R]
(a : M)


@[fun_prop]
theorem hasFDerivWithinAt_pi''
    (hφ : ∀ i, HasFDerivWithinAt (fun x => Φ x i) ((proj i).comp Φ') s x) :
    HasFDerivWithinAt Φ Φ' s x

(hφ : ∀ (i : ι), HasFDerivWithinAt (fun x => Φ x i) ((ContinuousLinearMap.proj i).comp Φ') s x)


/-- The identity map as a `Function.Embedding`. -/
@[refl, simps (config := { simpRhs := true })]
protected def refl (α : Sort*) : α ↪ α


theorem normal_le_normalCore {H : Subgroup G} {N : Subgroup G} [hN : N.Normal] :
    N ≤ H.normalCore ↔ N ≤ H

{G : Type u_1}
[Group G]
{H N : Subgroup G}
[hN : N.Normal]


lemma toColex_lt_toColex_iff_max'_mem :
    toColex s < toColex t ↔ ∃ hst : s ≠ t, (s ∆ t).max' (symmDiff_nonempty.2 hst) ∈ t

{α : Type u_1}
[LinearOrder α]
{s t : Finset α}

{ ofColex := s } < { ofColex := t } ↔ ∃ (hst : s ≠ t), (symmDiff s t).max' ⋯ ∈ t


/-- Representable presheaves are (trivially) ind-objects. -/
@[simps]
def yoneda (X : C) : IndObjectPresentation (yoneda.obj X)

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

(CategoryTheory.Limits.IndObjectPresentation.yoneda X).ℐ = CategoryTheory.discreteCategory PUnit.{v + 1}


theorem StrictConvex.linear_image [Semiring 𝕝] [Module 𝕝 E] [Module 𝕝 F]
    [LinearMap.CompatibleSMul E F 𝕜 𝕝] (hs : StrictConvex 𝕜 s) (f : E →ₗ[𝕝] F) (hf : IsOpenMap f) :
    StrictConvex 𝕜 (f '' s)

{𝕜 : Type u_1}
{𝕝 : Type u_2}
{E : Type u_3}
{F : Type u_4}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[TopologicalSpace F]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{s : Set E}
[Semiring 𝕝]
[Module 𝕝 E]
[Module 𝕝 F]
[LinearMap.CompatibleSMul E F 𝕜 𝕝]
(hs : StrictConvex 𝕜 s)
(f : E →ₗ[𝕝] F)
(hf : IsOpenMap ⇑f)


/-- A `Primcodable` type is an `Encodable` type for which
  the encode/decode functions are primitive recursive. -/
class Primcodable (α : Type*) extends Encodable α where
  -- Porting note: was `prim [] `.
  -- This means that `prim` does not take the type explicitly in Lean 4
  prim : Nat.Primrec fun n => Encodable.encode (decode n)

Nat.Primrec fun n => Encodable.encode (Encodable.decode n)


/-- The empty reduced word. -/
@[simps]
def empty : Word M

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


theorem LeftLift.IsAbsKan.hasAbsLeftKanLift {t : LeftLift f g} (H : IsAbsKan t) :
    HasAbsLeftKanLift f g

{t : CategoryTheory.Bicategory.LeftLift f g}


@[to_additive]
lemma mulIndicator_le {s : Set α} {f g : α → M} (hfg : ∀ a ∈ s, f a ≤ g a) :
    mulIndicator s f ≤ g

{α : Type u_2}
{M : Type u_4}
[CanonicallyOrderedCommMonoid M]
{s : Set α}
{f g : α → M}
(hfg : ∀ a ∈ s, f a ≤ g a)


theorem tendsto_iff_tendsto_subseq_of_antitone {ι₁ ι₂ α : Type*} [SemilatticeSup ι₁] [Preorder ι₂]
    [Nonempty ι₁] [TopologicalSpace α] [ConditionallyCompleteLinearOrder α] [OrderTopology α]
    [NoMinOrder α] {f : ι₂ → α} {φ : ι₁ → ι₂} {l : α} (hf : Antitone f)
    (hg : Tendsto φ atTop atTop) : Tendsto f atTop (𝓝 l) ↔ Tendsto (f ∘ φ) atTop (𝓝 l)

{f : ι₂ → α}

{φ : ι₁ → ι₂}

(hg : Filter.Tendsto φ Filter.atTop Filter.atTop)

Filter.Tendsto f Filter.atTop (𝓝 l) ↔ Filter.Tendsto (f ∘ φ) Filter.atTop (𝓝 l)


@[simp]
theorem disjoint_nhds_atTop_iff : Disjoint (𝓝 a) atTop ↔ ¬IsTop a

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[ClosedIciTopology α]
{a : α}


/-- A helper construction: given a square between `i` and `f ≫ g`, produce a square between
`i` and `g`, whose top leg uses `f`:
A  → X
     ↓f
↓i   Y             --> A → Y
     ↓g                ↓i  ↓g
B  → Z                 B → Z
 -/
@[simps]
def squareToSnd {X Y Z : C} {i : Arrow C} {f : X ⟶ Y} {g : Y ⟶ Z} (sq : i ⟶ Arrow.mk (f ≫ g)) :
    i ⟶ Arrow.mk g

(sq : i ⟶ CategoryTheory.Arrow.mk (CategoryTheory.CategoryStruct.comp f g))

(CategoryTheory.Arrow.squareToSnd sq).left = CategoryTheory.CategoryStruct.comp sq.left f


@[to_additive] lemma left_inv_eq_right_inv (hba : b * a = 1) (hac : a * c = 1) : b = c

{M : Type u_2}
[Monoid M]
{a b c : M}
(hba : b * a = 1)
(hac : a * c = 1)


@[simp, norm_cast]
lemma toAlgHom_toRingHom : ((e : A₁ →ₐ[R] A₂) : A₁ →+* A₂) = e

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


theorem Iic_subset_Iio : Iic a ⊆ Iio b ↔ a < b


lemma Ico_filter_modEq_eq (v : ℤ) : (Ico a b).filter (· ≡ v [ZMOD r]) =
    ((Ico (a - v) (b - v)).filter (r ∣ ·)).map ⟨(· + v), add_left_injective v⟩

Finset.filter (fun x => x ≡ v [ZMOD r]) (Finset.Ico a b) =
  Finset.map { toFun := fun x => x + v, inj' := ⋯ } (Finset.filter (fun x => r ∣ x) (Finset.Ico (a - v) (b - v)))


theorem card_erase_le : (s.erase a).card ≤ s.card

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


lemma self_mem_engel (x : L) : x ∈ engel R x

(R : Type u_1)
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(x : L)


@[simp]
theorem coeff_update_same (p : R[X]) (n : ℕ) (a : R) : (p.update n a).coeff n = a

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


/-- The functor sending each quiver to its path category. -/
@[simps]
def free : Quiv.{v, u} ⥤ Cat.{max u v, u}

∀ {X Y : CategoryTheory.Quiv} (F : X ⟶ Y) {X_1 Y_1 : ↑((fun V => CategoryTheory.Cat.of (CategoryTheory.Paths ↑V)) X)}
  (f : X_1 ⟶ Y_1), (CategoryTheory.Cat.free.map F).map f = Prefunctor.mapPath F f


theorem subset_cons (s : Multiset α) (a : α) : s ⊆ a ::ₘ s


@[reassoc (attr := simp)]
theorem dFrom_comp_xNextIsoSelf {i : ι} (h : ¬c.Rel i (c.next i)) :
    C.dFrom i ≫ (C.xNextIsoSelf h).hom = 0


theorem open_source' (he : e ∈ c.atlas) : IsOpen[c.toTopologicalSpace] e.source

{H : Type u}
{M : Type u_2}
[TopologicalSpace H]
(c : ChartedSpaceCore H M)
{e : PartialEquiv M H}
(he : e ∈ c.atlas)


@[to_additive (attr := simp) neg_zsmul]
lemma zpow_neg (a : α) : ∀ n : ℤ, a ^ (-n) = (a ^ n)⁻¹

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


theorem cancel_epi_id (f : X ⟶ Y) [Epi f] {h : Y ⟶ Y} : f ≫ h = f ↔ h = 𝟙 Y

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

CategoryTheory.CategoryStruct.comp f h = f ↔ h = CategoryTheory.CategoryStruct.id Y


@[simp]
theorem mem_inter {a : α} {s₁ s₂ : Finset α} : a ∈ s₁ ∩ s₂ ↔ a ∈ s₁ ∧ a ∈ s₂

{α : Type u_1}
[DecidableEq α]
{a : α}
{s₁ s₂ : Finset α}

a ∈ s₁ ∩ s₂ ↔ a ∈ s₁ ∧ a ∈ s₂


theorem Ioc_bot_coe : Ioc (⊥ : WithBot α) b = (Iic b).map Embedding.some

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

Finset.Ioc ⊥ ↑b = Finset.map Function.Embedding.some (Finset.Iic b)


theorem update_preimage_univ_pi [DecidableEq ι] {f : ∀ i, α i} (hf : ∀ j ≠ i, f j ∈ t j) :
    update f i ⁻¹' pi univ t = t i

{ι : Type u_1}
{α : ι → Type u_2}
{t : (i : ι) → Set (α i)}
{i : ι}
[DecidableEq ι]
{f : (i : ι) → α i}
(hf : ∀ (j : ι), j ≠ i → f j ∈ t j)

Function.update f i ⁻¹' Set.univ.pi t = t i


/-- `Matrix.comp` as `LinearEquiv` -/
@[simps!]
def compLinearEquiv : Matrix I J (Matrix K L R) ≃ₗ[K] Matrix (I × K) (J × L) R

(I : Type u_1)
(J : Type u_2)
(L : Type u_4)
(R : Type u_5)
(K : Type u_6)
[CommSemiring K]
[AddCommMonoid R]
[Module K R]

∀ (a : Matrix I J (Matrix K L R)), (Matrix.compLinearEquiv I J L R K) a = (Matrix.compAddEquiv I J K L R) a


@[simp]
theorem coe_invEmbedding (j : Fin n) : (c.invEmbedding j : ℕ) = j - c.sizeUpTo (c.index j)

↑(c.invEmbedding j) = ↑j - c.sizeUpTo ↑(c.index j)


@[simp] lemma neg_mk (x : K) (hx) : (-⟨x, hx⟩ : 𝓞 K) = ⟨-x, neg_mem hx⟩

{K : Type u_1}
[Field K]
(x : K)
(hx : x ∈ integralClosure ℤ K)


theorem noncommProd_erase_mul [DecidableEq α] (s : Multiset α) {a : α} (h : a ∈ s) (comm)
    (comm' := fun x hx y hy hxy ↦ comm (s.mem_of_mem_erase hx) (s.mem_of_mem_erase hy) hxy) :
    (s.erase a).noncommProd comm' * a = s.noncommProd comm

(comm' : ∀ x ∈ {x | x ∈ s.erase a}, ∀ y ∈ {x | x ∈ s.erase a}, x ≠ y → Commute x y := ⋯)


theorem IsComplement'.disjoint (h : IsComplement' H K) : Disjoint H K

{G : Type u_1}
[Group G]
{H K : Subgroup G}
(h : H.IsComplement' K)


lemma exists_isRegular_of_finrank_le_card (h : finrank R M ≤ #R) :
    ∃ x : L, IsRegular R M x

(h : ↑(FiniteDimensional.finrank R M) ≤ Cardinal.mk R)


@[simp]
theorem piQuotientLift_single [Fintype ι] [DecidableEq ι] (p : ∀ i, Submodule R (Ms i))
    (q : Submodule R N) (f : ∀ i, Ms i →ₗ[R] N) (hf : ∀ i, p i ≤ q.comap (f i)) (i)
    (x : Ms i ⧸ p i) : piQuotientLift p q f hf (Pi.single i x) = mapQ _ _ (f i) (hf i) x

(hf : ∀ (i : ι), p i ≤ Submodule.comap (f i) q)

(Submodule.piQuotientLift p q f hf) (Pi.single i x) = ((p i).mapQ q (f i) ⋯) x


/-- The conjugate of a multiplicative character with values in `ℂ` is its inverse. -/
lemma star_eq_inv (χ : MulChar R ℂ) : star χ = χ⁻¹

{R : Type u_1}
[CommRing R]
[Finite Rˣ]
(χ : MulChar R ℂ)


/-- Upper sets are order-isomorphic to lower sets under complementation. -/
@[simps]
def upperSetIsoLowerSet : UpperSet α ≃o LowerSet α


lemma lipschitzOnWith_restrict {t : Set s} :
    LipschitzOnWith K (s.restrict f) t ↔ LipschitzOnWith K f (s ∩ Subtype.val '' t)

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{s : Set α}
{f : α → β}
{t : Set ↑s}


theorem norm_setIntegral_le_of_norm_le_const_ae' {C : ℝ} (hs : μ s < ∞)
    (hC : ∀ᵐ x ∂μ, x ∈ s → ‖f x‖ ≤ C) (hfm : AEStronglyMeasurable f (μ.restrict s)) :
    ‖∫ x in s, f x ∂μ‖ ≤ C * (μ s).toReal

(hfm : MeasureTheory.AEStronglyMeasurable f (μ.restrict s))

‖∫ (x : X) in s, f x ∂μ‖ ≤ C * (μ s).toReal


@[simp] theorem findIdx?_succ :
    (xs : List α).findIdx? p (i+1) = (xs.findIdx? p i).map fun i => i + 1

{α : Type u_1}
{xs : List α}
{p : α → Bool}
{i : Nat}

List.findIdx? p xs (i + 1) = Option.map (fun i => i + 1) (List.findIdx? p xs i)


theorem lift_add (x y : ℍ[R,c₁,c₂]) : q.lift (x + y) = q.lift x + q.lift y

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
{c₁ c₂ : R}
(q : QuaternionAlgebra.Basis A c₁ c₂)
(x y : ℍ[R,c₁,c₂])


/-- Power series expansion of the logarithm around `1`. -/
theorem hasSum_pow_div_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
    HasSum (fun n : ℕ => x ^ (n + 1) / (n + 1)) (-log (1 - x))

HasSum (fun n => x ^ (n + 1) / (↑n + 1)) (-Real.log (1 - x))


@[reassoc]
lemma D₁_totalShift₂XIso_hom (n₀ n₁ n₀' n₁' : ℤ) (h₀ : n₀ + y = n₀') (h₁ : n₁ + y = n₁') :
    ((shiftFunctor₂ C y).obj K).D₁ (up ℤ) n₀ n₁ ≫ (K.totalShift₂XIso y n₁ n₁' h₁).hom =
      y.negOnePow • ((K.totalShift₂XIso y n₀ n₀' h₀).hom ≫ K.D₁ (up ℤ) n₀' n₁')

(K : HomologicalComplex₂ C (ComplexShape.up ℤ) (ComplexShape.up ℤ))

((HomologicalComplex₂.shiftFunctor₂ C y).obj K).D₁ (ComplexShape.up ℤ) n₀ n₁ ≫ (K.totalShift₂XIso y n₁ n₁' h₁).hom =
  y.negOnePow • (K.totalShift₂XIso y n₀ n₀' h₀).hom ≫ K.D₁ (ComplexShape.up ℤ) n₀' n₁'


@[rclike_simps]
theorem conj_smul (r : ℝ) (z : K) : conj (r • z) = r • conj z

{K : Type u_1}
[RCLike K]
(r : ℝ)
(z : K)

(starRingEnd K) (r • z) = r • (starRingEnd K) z


theorem mk_eq_zero {x} (h : x ∈ N) : (⟨x, h⟩ : N) = 0 ↔ x = 0

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(N : LieSubmodule R L M)
{x : M}
(h : x ∈ N)


protected theorem aemeasurable {f : α → β} (hf : MeasurePreserving f μa μb) : AEMeasurable f μa

(hf : MeasureTheory.MeasurePreserving f μa μb)


theorem Integrable.locallyIntegrable (hf : Integrable f μ) : LocallyIntegrable f μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[TopologicalSpace X]
[NormedAddCommGroup E]
{f : X → E}
{μ : MeasureTheory.Measure X}
(hf : MeasureTheory.Integrable f μ)


theorem Nontrivial.not_subset_singleton {x} (hs : s.Nontrivial) : ¬s ⊆ {x}

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


@[simp]
theorem bot_apply [Bot β] (a : α) : (⊥ : SupHom α β) a = ⊥

{α : Type u_3}
{β : Type u_4}
[Sup α]
[SemilatticeSup β]
[Bot β]
(a : α)


theorem norm_eq_zero {x : L} (hx : norm x = 0) : x = 0

{L : Type u_2}
[Field L]
{Γ₀ : Type u_3}
[LinearOrderedCommGroupWithZero Γ₀]
[val : Valued L Γ₀]
[hv : Valued.v.RankOne]
{x : L}
(hx : Valued.norm x = 0)


/-- Auxiliary lemma in the proof of `integral_eq_sub_of_hasDeriv_right_of_le`. -/
theorem integral_le_sub_of_hasDeriv_right_of_le (hab : a ≤ b) (hcont : ContinuousOn g (Icc a b))
    (hderiv : ∀ x ∈ Ioo a b, HasDerivWithinAt g (g' x) (Ioi x) x) (φint : IntegrableOn φ (Icc a b))
    (hφg : ∀ x ∈ Ioo a b, φ x ≤ g' x) : (∫ y in a..b, φ y) ≤ g b - g a

(hderiv : ∀ x ∈ Set.Ioo a b, HasDerivWithinAt g (g' x) (Set.Ioi x) x)

(φint : MeasureTheory.IntegrableOn φ (Set.Icc a b) MeasureTheory.volume)


@[simp]
theorem rTensor_id : (id : N →ₗ[R] N).rTensor M = id

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
(N : Type u_5)
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]

LinearMap.rTensor M LinearMap.id = LinearMap.id


theorem exists_iff {p : α → Prop} : Exists p ↔ p default

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


theorem any_eq_not_all_not (l : List α) (p : α → Bool) : l.any p = !l.all (!p .)

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


@[simp]
theorem comp_apply {X Y Z : ∀ i, C i} (f : X ⟶ Y) (g : Y ⟶ Z) (i) :
    (f ≫ g : ∀ i, X i ⟶ Z i) i = f i ≫ g i

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

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


/-- The constructed `sheafHom α` is equal to `α` when restricted onto `C`. -/
theorem sheafHom_restrict_eq (α : G.op ⋙ ℱ ⟶ G.op ⋙ ℱ'.val) :
    whiskerLeft G.op (sheafHom α) = α

{K : CategoryTheory.GrothendieckTopology D}

CategoryTheory.whiskerLeft G.op (CategoryTheory.Functor.IsCoverDense.sheafHom α) = α


@[simp]
theorem ofRelIsoLT_symm {α β} [PartialOrder α] [PartialOrder β]
    (e : ((· < ·) : α → α → Prop) ≃r ((· < ·) : β → β → Prop)) :
    (ofRelIsoLT e).symm = ofRelIsoLT e.symm

(OrderIso.ofRelIsoLT e).symm = OrderIso.ofRelIsoLT e.symm


theorem innerContent_exists_compact {U : Opens G} (hU : μ.innerContent U ≠ ∞) {ε : ℝ≥0}
    (hε : ε ≠ 0) : ∃ K : Compacts G, (K : Set G) ⊆ U ∧ μ.innerContent U ≤ μ K + ε

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
{U : TopologicalSpace.Opens G}
(hU : μ.innerContent U ≠ ⊤)
{ε : ℝ≥0}
(hε : ε ≠ 0)

∃ K, ↑K ⊆ ↑U ∧ μ.innerContent U ≤ (fun s => ↑(μ.toFun s)) K + ↑ε


theorem list_sum_sq (l : List R) : l.sum ^ 2 = (l.map (· ^ 2)).sum

{R : Type u_1}
[CommSemiring R]
[CharP R 2]
(l : List R)

l.sum ^ 2 = (List.map (fun x => x ^ 2) l).sum


/-- A natural transformation induces a natural transformation between
  the induced functors on the homotopy category. -/
@[simps]
def NatTrans.mapHomotopyCategory {F G : V ⥤ W} [F.Additive] [G.Additive] (α : F ⟶ G)
    (c : ComplexShape ι) : F.mapHomotopyCategory c ⟶ G.mapHomotopyCategory c

{ι : Type u_2}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{W : Type u_3}
[CategoryTheory.Category.{u_4, u_3} W]
[CategoryTheory.Preadditive W]
{F G : V ⥤ W}
[F.Additive]
[G.Additive]
(α : F ⟶ G)
(c : ComplexShape ι)
(C : HomotopyCategory V c)

(CategoryTheory.NatTrans.mapHomotopyCategory α c).app C =
  (HomotopyCategory.quotient W c).map ((CategoryTheory.NatTrans.mapHomologicalComplex α c).app C.as)


theorem comp_inverse' {f : X →ₑ[φ] Y} {g : Y → X}
    {k₁ : Function.LeftInverse φ' φ} {k₂ : Function.RightInverse φ' φ}
    {h₁ : Function.LeftInverse g f} {h₂ : Function.RightInverse g f} :
    (inverse' f g k₂ h₁ h₂).comp f (κ := CompTriple.comp_inv k₁)
      = MulActionHom.id M

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

(f.inverse' g k₂ h₁ h₂).comp f = MulActionHom.id M


/-- The element `0` is right-regular if and only if `R` is trivial. -/
theorem IsRightRegular.subsingleton (h : IsRightRegular (0 : R)) : Subsingleton R

{R : Type u_1}
[MulZeroClass R]
(h : IsRightRegular 0)


theorem univ_eq_true_false : univ = ({True, False} : Set Prop)


@[gcongr]
theorem inter_subset_inter_right {s t : Set α} (u : Set α) (H : s ⊆ t) : u ∩ s ⊆ u ∩ t

{α : Type u}
{s t : Set α}
(u : Set α)
(H : s ⊆ t)


theorem iInter_eq_empty_iff {f : ι → Set α} : ⋂ i, f i = ∅ ↔ ∀ x, ∃ i, x ∉ f i

{α : Type u_1}
{ι : Sort u_4}
{f : ι → Set α}


theorem tendsto_prod_iff {f : α × β → γ} {x : Filter α} {y : Filter β} {z : Filter γ} :
    Tendsto f (x ×ˢ y) z ↔ ∀ W ∈ z, ∃ U ∈ x, ∃ V ∈ y, ∀ x y, x ∈ U → y ∈ V → f (x, y) ∈ W

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α × β → γ}
{x : Filter α}
{y : Filter β}
{z : Filter γ}

Filter.Tendsto f (x ×ˢ y) z ↔ ∀ W ∈ z, ∃ U ∈ x, ∃ V ∈ y, ∀ (x : α) (y : β), x ∈ U → y ∈ V → f (x, y) ∈ W


@[simp]
theorem fourier_neg' {n : ℤ} {x : AddCircle T} : @toCircle T (-(n • x)) = conj (fourier n x)

↑(-(n • x)).toCircle = (starRingEnd ℂ) ((fourier n) x)


theorem union_distrib_iInter_left (s : ι → Set α) (t : Set α) : (t ∪ ⋂ i, s i) = ⋂ i, t ∪ s i

{α : Type u_1}
{ι : Sort u_4}
(s : ι → Set α)
(t : Set α)


@[to_additive (attr := simp)]
theorem Homeomorph.shearMulRight_symm_coe :
    ⇑(Homeomorph.shearMulRight G).symm = fun z : G × G => (z.1, z.1⁻¹ * z.2)

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

⇑(Homeomorph.shearAddRight G).symm = fun z => (z.1, -z.1 + z.2)


theorem union_right_idem (s t : Finset α) : s ∪ t ∪ t = s ∪ t

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


theorem linearIndependent_comp_of_eval
    (h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C (ord I · < o))))) :
    LinearIndependent ℤ (eval (C' C ho)) →
    LinearIndependent ℤ (ModuleCat.ofHom (Linear_CC' C hsC ho) ∘ SumEval C ho ∘ Sum.inr)

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

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

(h₁ :
  ⊤ ≤
    Submodule.span ℤ
      (Set.range
        (Profinite.NobelingProof.GoodProducts.eval
          (Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o))))

LinearIndependent ℤ (Profinite.NobelingProof.GoodProducts.eval (Profinite.NobelingProof.C' C ho)) →
  LinearIndependent (ι := ↑(Profinite.NobelingProof.GoodProducts.MaxProducts C ho)) ℤ
    (⇑(ModuleCat.ofHom (Profinite.NobelingProof.Linear_CC' C hsC ho)) ∘
      Profinite.NobelingProof.GoodProducts.SumEval C ho ∘ Sum.inr)


/-- Reflection is involutive. -/
theorem reflection_involutive : Function.Involutive (reflection K)

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


theorem independent_iff_pairwiseDisjoint {f : ι → α} : Independent f ↔ Pairwise (Disjoint on f)

{α : Type u_1}
{ι : Type u_3}
[Order.Frame α]
{f : ι → α}

CompleteLattice.Independent f ↔ Pairwise (Disjoint on f)


@[simp] lemma ker_principal (s : Set α) : ker (𝓟 s) = s


theorem LF.not_gt {x y : PGame} (h : x ⧏ y) : ¬y < x


theorem sub_floor_div_mul_nonneg (a : k) (hb : 0 < b) : 0 ≤ a - ⌊a / b⌋ * b

{k : Type u_4}
[LinearOrderedField k]
[FloorRing k]
{b : k}
(a : k)
(hb : 0 < b)


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

(ht : CategoryTheory.Limits.IsColimit t)

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

(CategoryTheory.Limits.Cofork.IsColimit.homIso ht Z).symm h = ↑(CategoryTheory.Limits.Cofork.IsColimit.desc' ht ↑h ⋯)


@[mfld_simps]
theorem mem_image_of_mem (f : α → β) {x : α} {a : Set α} (h : x ∈ a) : f x ∈ f '' a

{α : Type u}
{β : Type v}
(f : α → β)
{x : α}
{a : Set α}
(h : x ∈ a)


@[simp] theorem Ultrafilter.tendsto_pure_self (b : Ultrafilter α) : Tendsto pure b (𝓝 b)


@[simp]
theorem coeff_neg (m : σ →₀ ℕ) (p : MvPolynomial σ R) : coeff m (-p) = -coeff m p

{R : Type u}
(σ : Type u_1)
[CommRing R]
(m : σ →₀ ℕ)
(p : MvPolynomial σ R)

MvPolynomial.coeff m (-p) = -MvPolynomial.coeff m p


@[to_additive] lemma image_op_inv (s : Finset α) : s⁻¹.image op = (s.image op)⁻¹

{α : Type u_2}
[DecidableEq α]
[Inv α]
(s : Finset α)

Finset.image MulOpposite.op s⁻¹ = (Finset.image MulOpposite.op s)⁻¹


@[simp]
theorem monomial_mul_modMonomial (s : σ →₀ ℕ) (x : MvPolynomial σ R) :
    monomial s 1 * x %ᵐᵒⁿᵒᵐⁱᵃˡ s = 0

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(s : σ →₀ ℕ)
(x : MvPolynomial σ R)

((MvPolynomial.monomial s) 1 * x).modMonomial s = 0


theorem Dense.nonempty_iff (hs : Dense s) : s.Nonempty ↔ Nonempty X

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


theorem continuousOn_univBall_symm (c : P) (r : ℝ) : ContinuousOn (univBall c r).symm (ball c r)

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{P : Type u_2}
[PseudoMetricSpace P]
[NormedAddTorsor E P]
(c : P)
(r : ℝ)

ContinuousOn (↑(PartialHomeomorph.univBall c r).symm) (Metric.ball c r)


theorem isIntegral_zero : IsIntegral R (0 : B)

{R : Type u_1}
{B : Type u_3}
[CommRing R]
[Ring B]
[Algebra R B]


lemma growsPolynomially_deriv_rpow_p_mul_one_sub_smoothingFn (p : ℝ) :
    GrowsPolynomially fun x => ‖deriv (fun z => z ^ p * (1 - ε z)) x‖

AkraBazziRecurrence.GrowsPolynomially fun x => ‖deriv (fun z => z ^ p * (1 - AkraBazziRecurrence.smoothingFn z)) x‖


/-- Right scalar multiplication as an order isomorphism. -/
@[simps] def Equiv.smulRight (ha : a ≠ 0) : β ≃ β

{α : Type u}
{β : Type v}
[GroupWithZero α]
[MulAction α β]
{a : α}
(ha : a ≠ 0)
(b : β)


protected theorem beq_iff_eq {m n : Name} : m == n ↔ m = n


@[simp]
theorem AddValuation.map_one : addValuationDef (1 : ℚ_[p]) = 0


theorem UniformSpace.mem_nhds_iff {x : α} {s : Set α} : s ∈ 𝓝 x ↔ ∃ V ∈ 𝓤 α, ball x V ⊆ s

{α : Type ua}
[UniformSpace α]
{x : α}
{s : Set α}

s ∈ 𝓝 x ↔ ∃ V ∈ 𝓤 α, UniformSpace.ball x V ⊆ s


theorem isIntegral_root (hf : f ≠ 0) : IsIntegral K (root f)

{K : Type w}
[Field K]
{f : K[X]}
(hf : f ≠ 0)


@[simp] theorem runK_get (s : σ) (k : σ → σ → m β) : (get : StateCpsT σ m σ).runK s k = k s s

{σ : Type u}
{m : Type u → Type v}
{β : Type u}
(s : σ)
(k : σ → σ → m β)


theorem IsExtrOn.inter (hf : IsExtrOn f s a) (t) : IsExtrOn f (s ∩ t) a

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


@[nontriviality, simp]
theorem rank_subsingleton [Subsingleton R] : Module.rank R M = 1

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Subsingleton R]


/-- Length of the list obtained by `mapAccumr`. -/
@[simp]
theorem length_mapAccumr :
    ∀ (f : α → σ → σ × β) (x : List α) (s : σ), length (mapAccumr f x s).2 = length x

{α : Type u}
{β : Type v}
{σ : Type w₂}
(f : α → σ → σ × β)
(x : List α)
(s : σ)

(List.mapAccumr f x s).snd.length = x.length


/-- The functor which sends `X, Y` to the product type `X × Y`. -/
@[simps]
def binaryProductFunctor : Type u ⥤ Type u ⥤ Type u

{X₁ X₂ : Type u}
(f : X₁ ⟶ X₂)
(Y : Type u)

∀ (a : (CategoryTheory.Limits.BinaryFan.mk (Prod.fst ≫ f) Prod.snd).pt),
  (CategoryTheory.Limits.Types.binaryProductFunctor.map f).app Y a =
    (CategoryTheory.Limits.Types.binaryProductLimit X₂ Y).lift
      (CategoryTheory.Limits.BinaryFan.mk (Prod.fst ≫ f) Prod.snd) a


theorem finSuccEquiv_eq :
    (finSuccEquiv R n : MvPolynomial (Fin (n + 1)) R →+* Polynomial (MvPolynomial (Fin n) R)) =
      eval₂Hom (Polynomial.C.comp (C : R →+* MvPolynomial (Fin n) R)) fun i : Fin (n + 1) =>
        Fin.cases Polynomial.X (fun k => Polynomial.C (X k)) i

↑(MvPolynomial.finSuccEquiv R n) =
  MvPolynomial.eval₂Hom (Polynomial.C.comp MvPolynomial.C) fun i =>
    Fin.cases Polynomial.X (fun k => Polynomial.C (MvPolynomial.X k)) i


@[simp]
theorem fst_comp_prod : (fst S T).comp (f.prod g) = f

{R : Type u_3}
{S : Type u_5}
{T : Type u_7}
[NonAssocSemiring R]
[NonAssocSemiring S]
[NonAssocSemiring T]
(f : R →+* S)
(g : R →+* T)


@[simp, norm_cast]
theorem one_le_cast : 1 ≤ (n : α) ↔ 1 ≤ n

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

1 ≤ ↑n ↔ 1 ≤ n


@[mono, gcongr]
theorem factorial_le {m n} (h : m ≤ n) : m ! ≤ n !


protected theorem ClosedEmbedding.locallyCompactSpace [LocallyCompactSpace Y] {f : X → Y}
    (hf : ClosedEmbedding f) : LocallyCompactSpace X

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


theorem le_iff_uniformContinuous_id {u v : UniformSpace α} :
    u ≤ v ↔ @UniformContinuous _ _ u v id


private lemma comp_map (C' : VariableChange R) : (C.comp C').map φ = (C.map φ).comp (C'.map φ)

(C C' : WeierstrassCurve.VariableChange R)

WeierstrassCurve.VariableChange.map φ (C.comp C') =
  (WeierstrassCurve.VariableChange.map φ C).comp (WeierstrassCurve.VariableChange.map φ C')


theorem mul_isLimit {a b : Ordinal} (a0 : 0 < a) : IsLimit b → IsLimit (a * b)


lemma hasRightExtension_iff_postcomp₁ :
    HasRightKanExtension L' F ↔ HasRightKanExtension L F

{C : Type u_1}
{H : Type u_3}
{D : Type u_5}
{D' : Type u_6}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_8, u_3} H]
[CategoryTheory.Category.{u_10, u_5} D]
[CategoryTheory.Category.{u_9, u_6} D']
{L : CategoryTheory.Functor C D}
{L' : CategoryTheory.Functor C D'}
{G : CategoryTheory.Functor D D'}
[G.IsEquivalence]
(e : L.comp G ≅ L')
(F : CategoryTheory.Functor C H)

L'.HasRightKanExtension F ↔ L.HasRightKanExtension F


@[ext]
theorem ext {X Y : PresheafedSpace C} (α β : X ⟶ Y) (w : α.base = β.base)
    (h : α.c ≫ whiskerRight (eqToHom (by rw [w])) _ = β.c) : α = β

{X Y : AlgebraicGeometry.PresheafedSpace C}

(h : α.c ≫ CategoryTheory.whiskerRight (CategoryTheory.eqToHom ⋯) X.presheaf = β.c)


@[to_additive]
theorem mk_mul (a c : M) (b d : S) : mk a b * mk c d = mk (a * c) (b * d)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
(a c : M)
(b d : ↥S)

AddLocalization.mk a b + AddLocalization.mk c d = AddLocalization.mk (a + c) (b + d)


/-- `μ` has finite spanning sets in `C` if there is a countable sequence of sets in `C` that have
  finite measures. This structure is a type, which is useful if we want to record extra properties
  about the sets, such as that they are monotone.
  `SigmaFinite` is defined in terms of this: `μ` is σ-finite if there exists a sequence of
  finite spanning sets in the collection of all measurable sets. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure FiniteSpanningSetsIn {m0 : MeasurableSpace α} (μ : Measure α) (C : Set (Set α)) where
  protected set : ℕ → Set α
  protected set_mem : ∀ i, set i ∈ C
  protected finite : ∀ i, μ (set i) < ∞
  protected spanning : ⋃ i, set i = univ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{C : Set (Set α)}
(self : μ.FiniteSpanningSetsIn C)


/-- The right options of `x * y` are the left options of `x * (-y)` and of `(-x) * y` of the first
  kind, up to equivalence. -/
lemma rightMoves_mul_iff {x y : PGame} (P : Game → Prop) :
    (∀ k, P ⟦(x * y).moveRight k⟧) ↔
    (∀ i j, P (-⟦mulOption x (-y) i j⟧)) ∧ (∀ i j, P (-⟦mulOption (-x) y i j⟧))

{x y : SetTheory.PGame}
(P : SetTheory.Game → Prop)

(∀ (k : (x * y).RightMoves), P ⟦(x * y).moveRight k⟧) ↔
  (∀ (i : x.LeftMoves) (j : (-y).LeftMoves), P (-⟦x.mulOption (-y) i j⟧)) ∧
    ∀ (i : (-x).LeftMoves) (j : y.LeftMoves), P (-⟦(-x).mulOption y i j⟧)


@[simp] lemma coe_coe [MonoidWithZeroHomClass F α β] (f : F) : ((f : α →*₀ β) : α → β) = f

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[MulZeroOneClass α]
[MulZeroOneClass β]
[FunLike F α β]
[MonoidWithZeroHomClass F α β]
(f : F)


theorem perm_union {s₁ s₂ s₃ s₄ : AList β} (p₁₂ : s₁.entries ~ s₂.entries)
    (p₃₄ : s₃.entries ~ s₄.entries) : (s₁ ∪ s₃).entries ~ (s₂ ∪ s₄).entries

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{s₁ s₂ s₃ s₄ : AList β}
(p₁₂ : s₁.entries ~ s₂.entries)
(p₃₄ : s₃.entries ~ s₄.entries)


/-- If a reflexive relation `r : α → α → Prop` holds over `x y : α`,
then it holds whether or not `x ≠ y`. -/
theorem Reflexive.ne_imp_iff (h : Reflexive r) {x y : α} : x ≠ y → r x y ↔ r x y

{α : Type u_1}
{r : α → α → Prop}
(h : Reflexive r)
{x y : α}


@[simp]
theorem reduceModIdeal_apply (f : M →ₗ[R] N) (x : M) :
    (f.reduceModIdeal I) (Submodule.Quotient.mk (p := (I • ⊤ : Submodule R M)) x) =
      Submodule.Quotient.mk (p := (I • ⊤ : Submodule R N)) (f x)

{R : Type u_1}
[CommRing R]
(I : Ideal R)
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Type u_3}
[AddCommGroup N]
[Module R N]
(f : M →ₗ[R] N)
(x : M)

(LinearMap.reduceModIdeal I f) (Submodule.Quotient.mk x) = Submodule.Quotient.mk (f x)


(v : ↑(Equiv.Perm.vectorsProdEqOne G n))

Equiv.Perm.VectorsProdEqOne.rotate v 0 = v


theorem invOf_exp_of_mem_ball [CharZero 𝕂] {x : 𝔸}
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) [Invertible (exp 𝕂 x)] :
    ⅟ (exp 𝕂 x) = exp 𝕂 (-x)

(hx : x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

⅟(NormedSpace.exp 𝕂 x) = NormedSpace.exp 𝕂 (-x)


theorem gcd_dvd_right (m n : Nat) : gcd m n ∣ n


@[to_additive]
theorem uniformContinuous_op [UniformSpace α] : UniformContinuous (op : α → αᵐᵒᵖ)


@[simp]
theorem lcomp_apply (f : M →ₗ[R] Nₗ) (g : Nₗ →ₗ[R] Pₗ) (x : M) : lcomp _ _ f g x = g (f x)

{R : Type u_1}
[CommSemiring R]
{M : Type u_5}
{Nₗ : Type u_10}
{Pₗ : Type u_11}
[AddCommMonoid M]
[AddCommMonoid Nₗ]
[AddCommMonoid Pₗ]
[Module R M]
[Module R Nₗ]
[Module R Pₗ]
(f : M →ₗ[R] Nₗ)
(g : Nₗ →ₗ[R] Pₗ)
(x : M)

((LinearMap.lcomp R Pₗ f) g) x = g (f x)


theorem lim_of_mem_C (c : CU P) (x : X) (h : x ∈ c.C) : c.lim x = 0

{X : Type u_1}
[TopologicalSpace X]
{P : Set X → Prop}
(c : Urysohns.CU P)
(x : X)
(h : x ∈ c.C)


/-- Flipping a square by switching the top-right and the bottom-left objects. -/
@[simps]
def flip (sq : Square C) : Square C

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


@[to_additive]
theorem subset_upperBounds_mul (s t : Set M) :
    upperBounds s * upperBounds t ⊆ upperBounds (s * t)

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

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


/-- A homotopy between two morphisms of short complexes `S₁ ⟶ S₂` consists of various
maps and conditions which will be sufficient to show that they induce the same morphism
in homology. -/
@[ext]
structure Homotopy where
  /-- a morphism `S₁.X₁ ⟶ S₂.X₁` -/
  h₀ : S₁.X₁ ⟶ S₂.X₁
  h₀_f : h₀ ≫ S₂.f = 0 := by aesop_cat
  /-- a morphism `S₁.X₂ ⟶ S₂.X₁` -/
  h₁ : S₁.X₂ ⟶ S₂.X₁
  /-- a morphism `S₁.X₃ ⟶ S₂.X₂` -/
  h₂ : S₁.X₃ ⟶ S₂.X₂
  /-- a morphism `S₁.X₃ ⟶ S₂.X₃` -/
  h₃ : S₁.X₃ ⟶ S₂.X₃
  g_h₃ : S₁.g ≫ h₃ = 0 := by aesop_cat
  comm₁ : φ₁.τ₁ = S₁.f ≫ h₁ + h₀ + φ₂.τ₁ := by aesop_cat
  comm₂ : φ₁.τ₂ = S₁.g ≫ h₂ + h₁ ≫ S₂.f + φ₂.τ₂ := by aesop_cat
  comm₃ : φ₁.τ₃ = h₃ + h₂ ≫ S₂.g + φ₂.τ₃ := by aesop_cat

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

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

CategoryTheory.CategoryStruct.comp self.h₀ S₂.f = 0


lemma Exact.δ₀ {S : ComposableArrows C (n + 2)} (hS : S.Exact) :
    S.δ₀.Exact

{S : CategoryTheory.ComposableArrows C (n + 2)}


protected theorem inseparable (h : IsGenericPoint x S) (h' : IsGenericPoint y S) :
    Inseparable x y

{α : Type u_1}
[TopologicalSpace α]
{x y : α}
{S : Set α}
(h : IsGenericPoint x S)
(h' : IsGenericPoint y S)


@[simp]
theorem _root_.MulAut.conjNormal_inv_apply {H : Subgroup G} [H.Normal] (g : G) (h : H) :
    ↑((MulAut.conjNormal g)⁻¹ h) = g⁻¹ * h * g

{G : Type u_3}
[Group G]
{H : Subgroup G}
[H.Normal]
(g : G)
(h : ↥H)

↑((MulAut.conjNormal g)⁻¹ h) = g⁻¹ * ↑h * g


/-- If `S` is order-connected and contains two points `x < y`, then `S` is a punctured left
neighbourhood of `y`. -/
lemma mem_nhdsWithin_Iio [NoMinOrder α] {S : Set α} (hS : OrdConnected S)
    {x y : α} (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y) :
    S ∈ 𝓝[<] y

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMinOrder α]
{S : Set α}
(hS : S.OrdConnected)
{x y : α}
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)


@[simp]
theorem mkOfCompact_sub [CompactSpace α] (f g : C(α, β)) :
    mkOfCompact (f - g) = mkOfCompact f - mkOfCompact g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
[CompactSpace α]
(f g : C(α, β))

BoundedContinuousFunction.mkOfCompact (f - g) =
  BoundedContinuousFunction.mkOfCompact f - BoundedContinuousFunction.mkOfCompact g


/-- The averaging of a uniformly integrable real-valued sequence is also uniformly integrable. -/
theorem uniformIntegrable_average_real (hp : 1 ≤ p) {f : ℕ → α → ℝ} (hf : UniformIntegrable f p μ) :
    UniformIntegrable (fun n => (∑ i ∈ Finset.range n, f i) / (n : α → ℝ)) p μ

{f : ℕ → α → ℝ}

(hf : MeasureTheory.UniformIntegrable f p μ)

MeasureTheory.UniformIntegrable (fun n => (∑ i ∈ Finset.range n, f i) / ↑n) p μ


/-- `cyclotomic n ℚ` is irreducible. -/
theorem cyclotomic.irreducible_rat {n : ℕ} (hpos : 0 < n) : Irreducible (cyclotomic n ℚ)


@[simp]
theorem arg_nonneg_iff {z : ℂ} : 0 ≤ arg z ↔ 0 ≤ z.im


@[simp]
theorem ForgetEnrichment.homTo_homOf {X Y : C} (f : 𝟙_ W ⟶ X ⟶[W] Y) :
    ForgetEnrichment.homTo W (ForgetEnrichment.homOf W f) = f

(f : 𝟙_ W ⟶ CategoryTheory.EnrichedCategory.Hom X Y)

CategoryTheory.ForgetEnrichment.homTo W (CategoryTheory.ForgetEnrichment.homOf W f) = f


/-- The type of homomorphisms between two pointed Galois objects. This is a homomorphism
of the underlying objects of `C` that maps the distinguished points to each other. -/
@[ext]
structure Hom (A B : PointedGaloisObject F) where
  /-- The underlying homomorphism of `C`. -/
  val : A.obj ⟶ B.obj
  /-- The distinguished point of `A` is mapped to the distinguished point of `B`. -/
  comp : F.map val A.pt = B.pt := by simp

{F : CategoryTheory.Functor C FintypeCat}

{A B : CategoryTheory.PreGaloisCategory.PointedGaloisObject F}


@[simp, norm_cast]
theorem coe_imJ : (x : ℍ[R,c₁,c₂]).imJ = 0

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(x : R)


theorem bounded_ge_Ioo [Preorder α] (a b : α) : Bounded (· ≥ ·) (Ioo a b)

Set.Bounded (fun x x_1 => x ≥ x_1) (Set.Ioo a b)


/-- The points with `v.limRatioMeas hρ x = 0` have measure `0` for `ρ`. -/
theorem measure_limRatioMeas_zero : ρ {x | v.limRatioMeas hρ x = 0} = 0

(hρ : ρ ≪ μ)


theorem isValidUInt32 (n : Nat) (h : isValidCharNat n) : n < UInt32.size


@[simp]
theorem equiv_comp_equiv : (equiv i j p).trans (equiv j k p) = equiv i k p

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing K]
[CommRing L]
[CommRing M]
[CommRing N]
(i : K →+* L)
(j : K →+* M)
(k : K →+* N)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[ExpChar M p]
[ExpChar N p]
[PerfectRing L p]
[IsPerfectClosure i p]
[PerfectRing M p]
[IsPerfectClosure j p]
[PerfectRing N p]
[IsPerfectClosure k p]

(IsPerfectClosure.equiv i j p).trans (IsPerfectClosure.equiv j k p) = IsPerfectClosure.equiv i k p


theorem UInt32.toNat_div (x y : UInt32) : (x / y).toNat = x.toNat / y.toNat


@[simp]
theorem coe_mk (e : α ≃ β) (h1 : Measurable e) (h2 : Measurable e.symm) :
    ((⟨e, h1, h2⟩ : α ≃ᵐ β) : α → β) = e

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(e : α ≃ β)
(h1 : Measurable ⇑e)
(h2 : Measurable ⇑e.symm)

⇑{ toEquiv := e, measurable_toFun := h1, measurable_invFun := h2 } = ⇑e


/-- The cosine of an angle in a right-angled triangle multiplied by the hypotenuse equals the
adjacent side. -/
theorem cos_oangle_right_mul_dist_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P}
    (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) : Real.Angle.cos (∡ p₂ p₃ p₁) * dist p₁ p₃ = dist p₃ p₂

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

(∡ p₂ p₃ p₁).cos * dist p₁ p₃ = dist p₃ p₂


/-- A left homology map data for a morphism of short complexes induces
a right homology map data in the opposite category. -/
@[simps]
def LeftHomologyMapData.op {S₁ S₂ : ShortComplex C} {φ : S₁ ⟶ S₂}
    {h₁ : S₁.LeftHomologyData} {h₂ : S₂.LeftHomologyData}
    (ψ : LeftHomologyMapData φ h₁ h₂) : RightHomologyMapData (opMap φ) h₂.op h₁.op

(ψ : CategoryTheory.ShortComplex.LeftHomologyMapData φ h₁ h₂)


theorem Ioc_union_Ioc' (h₁ : c ≤ b) (h₂ : a ≤ d) : Ioc a b ∪ Ioc c d = Ioc (min a c) (max b d)

{α : Type u_1}
[LinearOrder α]
{a b c d : α}
(h₁ : c ≤ b)
(h₂ : a ≤ d)

Set.Ioc a b ∪ Set.Ioc c d = Set.Ioc (min a c) (max b d)


theorem nhds_eq_uniformity_prod {a b : α} :
    𝓝 (a, b) =
      (𝓤 α).lift' fun s : Set (α × α) => { y : α | (y, a) ∈ s } ×ˢ { y : α | (b, y) ∈ s }

{α : Type ua}
[UniformSpace α]
{a b : α}

𝓝 (a, b) = (𝓤 α).lift' fun s => {y | (y, a) ∈ s} ×ˢ {y | (b, y) ∈ s}


theorem IsMaximal.isCoatom' [IsMaximal I] : IsCoatom I

{P : Type u_1}
[LE P]
[IsDirected P fun x x_1 => x ≤ x_1]
[Nonempty P]
{I : Order.Ideal P}
[I.IsMaximal]


theorem size_eq_zero {n : ℕ} : size n = 0 ↔ n = 0


@[simp, norm_cast]
theorem toENNReal_le : (m : ℝ≥0∞) ≤ n ↔ m ≤ n

↑m ≤ ↑n ↔ m ≤ n


theorem Integrable.ae_eq_zero_of_forall_setIntegral_eq_zero {f : α → E} (hf : Integrable f μ)
    (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = 0) : f =ᵐ[μ] 0

(hf_zero : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∫ (x : α) in s, f x ∂μ = 0)


@[simp]
lemma restrict_compl_nullSet (h : μ ⟂ₘ ν) : ν.restrict h.nullSetᶜ = 0

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


/-- A *circuit* at `u : V` is a nonempty trail beginning and ending at `u`. -/
@[mk_iff isCircuit_def]
structure IsCircuit {u : V} (p : G.Walk u u) extends IsTrail p : Prop where
  ne_nil : p ≠ nil

{V : Type u}
{G : SimpleGraph V}
{u : V}
{p : G.Walk u u}
(self : p.IsCircuit)


theorem Ico_eq_locus_Ioc_eq_iUnion_Ioo :
    { b | toIcoMod hp a b = toIocMod hp a b } = ⋃ z : ℤ, Set.Ioo (a + z • p) (a + p + z • p)

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

{b | toIcoMod hp a b = toIocMod hp a b} = ⋃ z, Set.Ioo (a + z • p) (a + p + z • p)


@[mono]
theorem clog_mono_right (b : ℕ) {n m : ℕ} (h : n ≤ m) : clog b n ≤ clog b m


@[simp]
theorem eval_mul : (p * q).eval x = p.eval x * q.eval x

{R : Type u}
[CommSemiring R]
{p q : R[X]}
{x : R}

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


@[to_additive]
theorem unsym_ne_one_iff [One α] (a : αˢʸᵐ) : unsym a ≠ (1 : α) ↔ a ≠ (1 : αˢʸᵐ)


@[simp]
theorem coe_top : ((⊤ : L.Substructure M) : Set M) = Set.univ

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]


@[simp]
theorem forall_mem_ne {a : α} {l : List α} : (∀ a' : α, a' ∈ l → ¬a = a') ↔ a ∉ l


theorem count_le_iff_le_nth (hp : (setOf p).Infinite) {a b : ℕ} : count p a ≤ b ↔ a ≤ nth p b

{p : ℕ → Prop}
[DecidablePred p]
(hp : (setOf p).Infinite)
{a b : ℕ}


lemma mor₃_eq_zero_of_mono₁ (h : Mono T.mor₁) : T.mor₃ = 0

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


@[simp]
theorem bits_append_bit (n : ℕ) (b : Bool) (hn : n = 0 → b = true) :
    (bit b n).bits = b :: n.bits


theorem le_mul_of_le_of_one_le_of_nonneg [PosMulMono α] (h : b ≤ c) (ha : 1 ≤ a) (hc : 0 ≤ c) :
    b ≤ c * a

{α : Type u_1}
{a b c : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[PosMulMono α]
(h : b ≤ c)
(ha : 1 ≤ a)
(hc : 0 ≤ c)


@[simp]
theorem valuation_p : valuation (p : ℤ_[p]) = 1


@[simp] lemma isNilpotent_X_mul_iff :
    IsNilpotent (X * P) ↔ IsNilpotent P

{R : Type u_1}
[Semiring R]
{P : Polynomial R}

IsNilpotent (Polynomial.X * P) ↔ IsNilpotent P


theorem convex_iInter₂ {ι : Sort*} {κ : ι → Sort*} {s : ∀ i, κ i → Set E}
    (h : ∀ i j, Convex 𝕜 (s i j)) : Convex 𝕜 (⋂ (i) (j), s i j)

(h : ∀ (i : ι) (j : κ i), Convex 𝕜 (s i j))


@[to_additive]
theorem div_subset_div_right : s₁ ⊆ s₂ → s₁ / t ⊆ s₂ / t

{α : Type u_2}
[DecidableEq α]
[Div α]
{s₁ s₂ t : Finset α}