@[deprecated getElem?_zipWithAll (since := "2024-06-12")]
theorem get?_zipWithAll {f : Option α → Option β → γ} :
    (zipWithAll f as bs).get? i = match as.get? i, bs.get? i with
      | none, none => .none | a?, b? => some (f a? b?)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{as : List α}
{bs : List β}
{i : Nat}
{f : Option α → Option β → γ}

(List.zipWithAll f as bs).get? i =
  match as.get? i, bs.get? i with
  | none, none => none
  | a?, b? => some (f a? b?)


theorem dimH_le {s : Set X} {d : ℝ≥0∞} (H : ∀ d' : ℝ≥0, μH[d'] s = ∞ → ↑d' ≤ d) : dimH s ≤ d

(H : ∀ (d' : ℝ≥0), μH[↑d'] s = ⊤ → ↑d' ≤ d)


/-- Left unit cancellation `1 ⊗ X ≅ X` in `Dial C`. -/
@[simps!] def leftUnitor (X : Dial C) : tensorObj tensorUnit X ≅ X


@[simp] theorem emptyOn_indep_iff : (emptyOn α).Indep I ↔ I = ∅


theorem corepresentable_of_natIso (F : C ⥤ Type v₁) {G} (i : F ≅ G) [F.Corepresentable] :
    G.Corepresentable

(F : CategoryTheory.Functor C (Type v₁))

{G : CategoryTheory.Functor C (Type v₁)}


theorem WellFounded.finite_of_setIndependent (h : WellFounded ((· > ·) : α → α → Prop)) {s : Set α}
    (hs : SetIndependent s) : s.Finite

{α : Type u_2}
[CompleteLattice α]
(h : WellFounded fun x x_1 => x > x_1)
{s : Set α}
(hs : CompleteLattice.SetIndependent s)


theorem of_injective : Function.Injective (of : G → HNNExtension G A B φ)

{G : Type u_1}
[Group G]
{A B : Subgroup G}
(φ : ↥A ≃* ↥B)


theorem iSup_insert {f : β → α} {s : Set β} {b : β} :
    ⨆ x ∈ insert b s, f x = f b ⊔ ⨆ x ∈ s, f x

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


theorem IsTensorProduct.map_eq (hf : IsTensorProduct f) (hg : IsTensorProduct g) (i₁ : M₁ →ₗ[R] N₁)
    (i₂ : M₂ →ₗ[R] N₂) (x₁ : M₁) (x₂ : M₂) : hf.map hg i₁ i₂ (f x₁ x₂) = g (i₁ x₁) (i₂ x₂)

{R : Type u_1}
[CommSemiring R]
{M₁ : Type u_2}
{M₂ : Type u_3}
{M : Type u_4}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M]
[Module R M₁]
[Module R M₂]
[Module R M]
{f : M₁ →ₗ[R] M₂ →ₗ[R] M}
{N₁ : Type u_6}
{N₂ : Type u_7}
{N : Type u_8}
[AddCommMonoid N₁]
[AddCommMonoid N₂]
[AddCommMonoid N]
[Module R N₁]
[Module R N₂]
[Module R N]
{g : N₁ →ₗ[R] N₂ →ₗ[R] N}
(hf : IsTensorProduct f)
(hg : IsTensorProduct g)
(i₁ : M₁ →ₗ[R] N₁)
(i₂ : M₂ →ₗ[R] N₂)
(x₁ : M₁)
(x₂ : M₂)

(hf.map hg i₁ i₂) ((f x₁) x₂) = (g (i₁ x₁)) (i₂ x₂)


@[simp]
theorem support_extend_domain (f : α ≃ Subtype p) {g : Perm α} :
    support (g.extendDomain f) = g.support.map f.asEmbedding

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{β : Type u_2}
[DecidableEq β]
[Fintype β]
{p : β → Prop}
[DecidablePred p]
(f : α ≃ Subtype p)
{g : Equiv.Perm α}

(g.extendDomain f).support = Finset.map f.asEmbedding g.support


/-- The quadratic character is `1` or `-1` on nonzero arguments. -/
theorem quadraticChar_dichotomy {a : F} (ha : a ≠ 0) :
    quadraticChar F a = 1 ∨ quadraticChar F a = -1

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]
{a : F}
(ha : a ≠ 0)

(quadraticChar F) a = 1 ∨ (quadraticChar F) a = -1


@[to_additive]
theorem univ_mul_of_one_mem [Fintype α] (ht : (1 : α) ∈ t) : univ * t = univ

{α : Type u_2}
[DecidableEq α]
[AddMonoid α]
{t : Finset α}
[Fintype α]
(ht : 0 ∈ t)


theorem typevecCasesNil₂_appendFun {β : Fin2.elim0 ⟹ Fin2.elim0 → Sort*} (f : β nilFun) :
    typevecCasesNil₂ f nilFun = f

{β : TypeVec.Arrow Fin2.elim0 Fin2.elim0 → Sort u_1}

TypeVec.typevecCasesNil₂ f TypeVec.nilFun = f


theorem le_of_dvd {p n pow : ℕ} (hp : 1 < p) (hn : 0 < n) (h : p ^ pow ∣ n) :
    pow ≤ p.maxPowDiv n


@[to_additive]
theorem centralizer_closure (S : Set G) :
    centralizer (closure S : Set G) = ⨅ g ∈ S, centralizer (zpowers g : Set G)

Subgroup.centralizer ↑(Subgroup.closure S) = ⨅ g ∈ S, Subgroup.centralizer ↑(Subgroup.zpowers g)


theorem nat_double : Primrec (fun n : ℕ => 2 * n)


theorem Filter.Eventually.curry_nhds {p : X × Y → Prop} {x : X} {y : Y}
    (h : ∀ᶠ x in 𝓝 (x, y), p x) : ∀ᶠ x' in 𝓝 x, ∀ᶠ y' in 𝓝 y, p (x', y')

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{p : X × Y → Prop}
{x : X}
{y : Y}
(h : ∀ᶠ (x : X × Y) in 𝓝 (x, y), p x)

∀ᶠ (x' : X) in 𝓝 x, ∀ᶠ (y' : Y) in 𝓝 y, p (x', y')


/-- If a measurable space admits a countable sequence of measurable sets separating points,
it admits a measurable injection into the Cantor space `ℕ → Bool`
(equipped with the product sigma algebra). -/
theorem measurable_injection_nat_bool_of_countablySeparated [MeasurableSpace α]
    [CountablySeparated α] : ∃ f : α → ℕ → Bool, Measurable f ∧ Injective f

(α : Type u_1)
[MeasurableSpace α]
[MeasurableSpace.CountablySeparated α]

∃ f, Measurable f ∧ Function.Injective f


/-- A family of gluing data consists of
1. An index type `J`
2. An object `U i` for each `i : J`.
3. An object `V i j` for each `i j : J`.
  (Note that this is `J × J → TopCat` rather than `J → J → TopCat` to connect to the
  limits library easier.)
4. An open embedding `f i j : V i j ⟶ U i` for each `i j : ι`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
    (This merely means that `V i j ∩ V i k ⊆ t i j ⁻¹' (V j i ∩ V j k)`.)
9. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.

We can then glue the topological spaces `U i` together by identifying `V i j` with `V j i`, such
that the `U i`'s are open subspaces of the glued space.

Most of the times it would be easier to use the constructor `TopCat.GlueData.mk'` where the
conditions are stated in a less categorical way.
-/
-- porting note (#5171): removed @[nolint has_nonempty_instance]
structure GlueData extends GlueData TopCat where
  f_open : ∀ i j, OpenEmbedding (f i j)
  f_mono := fun i j => (TopCat.mono_iff_injective _).mpr (f_open i j).toEmbedding.inj


theorem le_add_right : ∀ (n k : Nat), n ≤ n + k


@[simp]
theorem elim'_some {a : α} (b : β) (f : α → β) : Option.elim' b f (some a) = f a

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


@[simp] lemma reindex_apply (b : FreeGroupBasis ι G) (e : ι ≃ ι') (x : ι') :
    b.reindex e x = b (e.symm x)

{ι : Type u_1}
{ι' : Type u_2}
{G : Type u_3}
[Group G]
(b : FreeGroupBasis ι G)
(e : ι ≃ ι')
(x : ι')


/-- Suppose `α` is equipped with a conditionally complete linear dense order and `f : α → δ` is
continuous and injective. Then `f` is strictly monotone or antitone (increasing or decreasing). -/
theorem Continuous.strictMono_of_inj {f : α → δ}
    (hf_c : Continuous f) (hf_i : Injective f) : StrictMono f ∨ StrictAnti f

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{δ : Type u_1}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderClosedTopology δ]
{f : α → δ}
(hf_c : Continuous f)
(hf_i : Function.Injective f)


/-- The map between two sum-languages induced by maps on the two factors. -/
@[simps]
def sumMap : L.sum L₁ →ᴸ L'.sum L₂

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(ϕ : L →ᴸ L')
{L₁ : FirstOrder.Language}
{L₂ : FirstOrder.Language}
(ψ : L₁ →ᴸ L₂)
(_n : ℕ)

∀ (a : L.Functions _n ⊕ L₁.Functions _n),
  (ϕ.sumMap ψ).onFunction a = Sum.map (fun f => ϕ.onFunction f) (fun f => ψ.onFunction f) a


theorem separatingLeft_of_det_ne_zero {B : M₁ →ₗ[R₁] M₁ →ₗ[R₁] R₁} (b : Basis ι R₁ M₁)
    (h : (toMatrix₂ b b B).det ≠ 0) : B.SeparatingLeft

(h : ((LinearMap.toMatrix₂ b b) B).det ≠ 0)


@[simp]
theorem dual_id : TopHom.dual (TopHom.id α) = BotHom.id _

TopHom.dual (TopHom.id α) = BotHom.id αᵒᵈ


@[simp]
theorem neg_apply (f : M →ₛₗ[σ₁₂] N₂) (x : M) : (-f) x = -f x

{R₁ : Type u_2}
{R₂ : Type u_3}
{M : Type u_9}
{N₂ : Type u_14}
[Semiring R₁]
[Semiring R₂]
[AddCommMonoid M]
[AddCommGroup N₂]
[Module R₁ M]
[Module R₂ N₂]
{σ₁₂ : R₁ →+* R₂}
(f : M →ₛₗ[σ₁₂] N₂)
(x : M)


/-- Kernel of a product map (right-exactness of tensor product) -/
theorem TensorProduct.map_ker :
    ker (TensorProduct.map g g') = range (lTensor N f') ⊔ range (rTensor N' f)

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
{f : M →ₗ[R] N}
{g : N →ₗ[R] P}
(hfg : Function.Exact ⇑f ⇑g)
(hg : Function.Surjective ⇑g)
{M' : Type u_6}
{N' : Type u_7}
{P' : Type u_8}
[AddCommGroup M']
[AddCommGroup N']
[AddCommGroup P']
[Module R M']
[Module R N']
[Module R P']
{f' : M' →ₗ[R] N'}
{g' : N' →ₗ[R] P'}
(hfg' : Function.Exact ⇑f' ⇑g')
(hg' : Function.Surjective ⇑g')

LinearMap.ker (TensorProduct.map g g') =
  LinearMap.range (LinearMap.lTensor N f') ⊔ LinearMap.range (LinearMap.rTensor N' f)


@[simp]
theorem pmap_none (f : ∀ a : α, p a → β) {H} : pmap f (@none α) H = none

{α : Type u_1}
{β : Type u_2}
{p : α → Prop}
(f : (a : α) → p a → β)
{H : ∀ (a : α), a ∈ none → p a}


@[simp (default + 1)] -- otherwise `simp` doesn't use `forall_image₂_iff`
lemma le_inf'_image₂ {g : γ → δ} {a : δ} (h : (image₂ f s t).Nonempty) :
    a ≤ inf' (image₂ f s t) h g ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ g (f x y)

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{δ : Type u_7}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
[SemilatticeInf δ]
{g : γ → δ}
{a : δ}
(h : (Finset.image₂ f s t).Nonempty)

a ≤ (Finset.image₂ f s t).inf' h g ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ g (f x y)


theorem exists_smul_not_mem_of_rank_lt {N : Submodule R M} (h : Module.rank R N < Module.rank R M) :
    ∃ m : M, ∀ r : R, r ≠ 0 → r • m ∉ N

(h : Module.rank R ↥N < Module.rank R M)


theorem next_reverse_eq_prev (s : Cycle α) (hs : Nodup s) (x : α) (hx : x ∈ s) :
    s.reverse.next (nodup_reverse_iff.mpr hs) x (mem_reverse_iff.mpr hx) = s.prev hs x hx

{α : Type u_1}
[DecidableEq α]
(s : Cycle α)
(hs : s.Nodup)
(x : α)
(hx : x ∈ s)


theorem sInf_eq_iInf {s : Set α} : sInf s = ⨅ a ∈ s, a

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


/-- Two subsemigroups are equal if they have the same elements. -/
@[to_additive (attr := ext) "Two `AddSubsemigroup`s are equal if they have the same elements."]
theorem ext {S T : Subsemigroup M} (h : ∀ x, x ∈ S ↔ x ∈ T) : S = T

{M : Type u_1}
[Mul M]
{S T : Subsemigroup M}
(h : ∀ (x : M), x ∈ S ↔ x ∈ T)


/-- **Equational criterion for vanishing**
[A. Altman and S. Kleiman, *A term of commutative algebra* (Lemma 8.16)][altman2021term],
generalization.

Assume that the submodule $M' \subseteq M$ generated by the $m_i$ satisfies the
property that the map $M' \otimes N \to M \otimes N$ is injective. Then the expression
$\sum_i m_i \otimes n_i$ vanishes trivially if and only if it vanishes. -/
theorem vanishesTrivially_iff_sum_tmul_eq_zero_of_rTensor_injective
    (hm : Injective (rTensor N (span R (Set.range m)).subtype)) :
    VanishesTrivially R m n ↔ ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N)

(hm : Function.Injective ⇑(LinearMap.rTensor N (Submodule.span R (Set.range m)).subtype))

TensorProduct.VanishesTrivially R m n ↔ ∑ i : ι, m i ⊗ₜ[R] n i = 0


theorem Γ_def : Γ = forgetToSheafedSpace.op ⋙ SheafedSpace.Γ

AlgebraicGeometry.LocallyRingedSpace.Γ =
  AlgebraicGeometry.LocallyRingedSpace.forgetToSheafedSpace.op ⋙ AlgebraicGeometry.SheafedSpace.Γ


theorem rat_add (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (r + x)

{p x : ℝ}
(h : LiouvilleWith p x)
(r : ℚ)


@[simp]
theorem equivOfRoot_symm (pb : PowerBasis A S) (pb' : PowerBasis A S')
    (h₁ : aeval pb.gen (minpoly A pb'.gen) = 0) (h₂ : aeval pb'.gen (minpoly A pb.gen) = 0) :
    (pb.equivOfRoot pb' h₁ h₂).symm = pb'.equivOfRoot pb h₂ h₁

(h₁ : (Polynomial.aeval pb.gen) (minpoly A pb'.gen) = 0)

(h₂ : (Polynomial.aeval pb'.gen) (minpoly A pb.gen) = 0)


/-- An a.e. monotone adapted process `f` with uniformly bounded differences converges to `+∞` if
and only if its predictable part also converges to `+∞`. -/
theorem tendsto_sum_indicator_atTop_iff [IsFiniteMeasure μ]
    (hfmono : ∀ᵐ ω ∂μ, ∀ n, f n ω ≤ f (n + 1) ω) (hf : Adapted ℱ f) (hint : ∀ n, Integrable (f n) μ)
    (hbdd : ∀ᵐ ω ∂μ, ∀ n, |f (n + 1) ω - f n ω| ≤ R) :
    ∀ᵐ ω ∂μ, Tendsto (fun n => f n ω) atTop atTop ↔
      Tendsto (fun n => predictablePart f ℱ μ n ω) atTop atTop

{f : ℕ → Ω → ℝ}

(hfmono : ∀ᵐ (ω : Ω) ∂μ, ∀ (n : ℕ), f n ω ≤ f (n + 1) ω)

(hint : ∀ (n : ℕ), MeasureTheory.Integrable (f n) μ)

(hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (n : ℕ), |f (n + 1) ω - f n ω| ≤ ↑R)

∀ᵐ (ω : Ω) ∂μ,
  Filter.Tendsto (fun n => f n ω) Filter.atTop Filter.atTop ↔
    Filter.Tendsto (fun n => MeasureTheory.predictablePart f ℱ μ n ω) Filter.atTop Filter.atTop


theorem aeval_algebraMap_apply (x : A) (p : R[X]) :
    aeval (algebraMap A B x) p = algebraMap A B (aeval x p)

{R : Type u_1}
{A : Type u_2}
(B : Type u_3)
[CommSemiring R]
[CommSemiring A]
[Semiring B]
[Algebra R A]
[Algebra A B]
[Algebra R B]
[IsScalarTower R A B]
(x : A)
(p : R[X])

(Polynomial.aeval ((algebraMap A B) x)) p = (algebraMap A B) ((Polynomial.aeval x) p)


@[norm_cast]
theorem add_to_nat : ∀ m n, ((m + n : Num) : ℕ) = m + n


theorem not_iff : (¬ (p ↔ q)) = ((p ∧ ¬ q) ∨ (¬ p ∧ q))


@[simp]
theorem counitCoalgHom_apply (x : A) :
    counitCoalgHom R A x = counit x

(R : Type u)
(A : Type v)
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[Coalgebra R A]
(x : A)

(Coalgebra.counitCoalgHom R A) x = Coalgebra.counit x


/-- Map an `Arrow.Relation` along a refinement `S ⟶ T`. -/
@[simps]
def Arrow.Relation.map {S T : J.Cover X} {I₁ I₂ : S.Arrow}
    (r : I₁.Relation I₂) (f : S ⟶ T) : (I₁.map f).Relation (I₂.map f)

{J : CategoryTheory.GrothendieckTopology C}


/-- A non-unital seminormed ring is a not-necessarily-unital ring
endowed with a seminorm which satisfies the inequality `‖x y‖ ≤ ‖x‖ ‖y‖`. -/
class NonUnitalSeminormedRing (α : Type*) extends Norm α, NonUnitalRing α,
  PseudoMetricSpace α where
  /-- The distance is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = norm (x - y)
  /-- The norm is submultiplicative. -/
  norm_mul : ∀ a b, norm (a * b) ≤ norm a * norm b

{α : Type u_5}
[self : NonUnitalSeminormedRing α]
(x y : α)


/-- `@CoeFn (QuadraticMap R M)` as an `AddMonoidHom`.

This API mirrors `AddMonoidHom.coeFn`. -/
@[simps apply]
def coeFnAddMonoidHom : QuadraticMap R M N →+ M → N

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]

∀ (a : QuadraticMap R M N) (a_1 : M), QuadraticMap.coeFnAddMonoidHom a a_1 = a a_1


@[simp]
theorem gnpowRec_zero (a : GradedMonoid A) : GradedMonoid.mk _ (gnpowRec 0 a.snd) = 1

{ι : Type u_1}
{A : ι → Type u_2}
[AddMonoid ι]
[GradedMonoid.GMul A]
[GradedMonoid.GOne A]
(a : GradedMonoid A)

GradedMonoid.mk (0 • a.fst) (GradedMonoid.GMonoid.gnpowRec 0 a.snd) = 1


theorem Irreducible.gcd_eq_one_iff [NormalizedGCDMonoid α] {x y : α} (hx : Irreducible x) :
    gcd x y = 1 ↔ ¬(x ∣ y)

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{x y : α}
(hx : Irreducible x)


protected lemma eventually (h : Absorbs M s t) : ∀ᶠ a in cobounded M, t ⊆ a • s

{M : Type u_1}
{α : Type u_2}
[Bornology M]
[SMul M α]
{s t : Set α}
(h : Absorbs M s t)

∀ᶠ (a : M) in Bornology.cobounded M, t ⊆ a • s


theorem coeff_one {n : ℕ} : coeff (1 : R[X]) n = if n = 0 then 1 else 0

Polynomial.coeff 1 n = if n = 0 then 1 else 0


@[simp]
theorem coe_one : ((1 : L₁ →ₗ⁅R⁆ L₁) : L₁ → L₁) = _root_.id

{R : Type u}
{L₁ : Type v}
[CommRing R]
[LieRing L₁]
[LieAlgebra R L₁]


@[simp]
theorem leftZigzagIso_symm : (leftZigzagIso η ε).symm = rightZigzagIso ε.symm η.symm

(η : CategoryTheory.CategoryStruct.id a ≅ CategoryTheory.CategoryStruct.comp f g)

(ε : CategoryTheory.CategoryStruct.comp g f ≅ CategoryTheory.CategoryStruct.id b)

(CategoryTheory.Bicategory.leftZigzagIso η ε).symm = CategoryTheory.Bicategory.rightZigzagIso ε.symm η.symm


/-- Given two bifunctors `F₁₂ : C₁ ⥤ C₂ ⥤ C₁₂` and `G : C₁₂ ⥤ C₃ ⥤ C₄`, this is
the trifunctor `C₁ ⥤ C₂ ⥤ C₃ ⥤ C₄` obtained by composition. -/
@[simps]
def bifunctorComp₁₂ : C₁ ⥤ C₂ ⥤ C₃ ⥤ C₄

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

(G : CategoryTheory.Functor C₁₂ (CategoryTheory.Functor C₃ C₄))

(((CategoryTheory.bifunctorComp₁₂ F₁₂ G).map φ).app X₂).app X₃ = (G.map ((F₁₂.map φ).app X₂)).app X₃


theorem isClosed_le_of_isClosed_nonneg {G} [OrderedAddCommGroup G] [TopologicalSpace G]
    [ContinuousSub G] (h : IsClosed { x : G | 0 ≤ x }) :
    IsClosed { p : G × G | p.fst ≤ p.snd }

{G : Type u_2}
[OrderedAddCommGroup G]
[TopologicalSpace G]
[ContinuousSub G]
(h : IsClosed {x | 0 ≤ x})


@[to_additive]
theorem Fintype.prod_apply {α : Type*} {β : α → Type*} {γ : Type*} [Fintype γ]
    [∀ a, CommMonoid (β a)] (a : α) (g : γ → ∀ a, β a) : (∏ c, g c) a = ∏ c, g c a

{α : Type u_1}
{β : α → Type u_2}
{γ : Type u_3}
[Fintype γ]
[(a : α) → AddCommMonoid (β a)]
(a : α)
(g : γ → (a : α) → β a)


theorem le_iff (S T : Subgroupoid C) : S ≤ T ↔ ∀ {c d}, S.arrows c d ⊆ T.arrows c d

{C : Type u}
[CategoryTheory.Groupoid C]
(S T : CategoryTheory.Subgroupoid C)

S ≤ T ↔ ∀ {c d : C}, S.arrows c d ⊆ T.arrows c d


@[simp] lemma smulRightL_apply (f : ContinuousMultilinearMap 𝕜 E 𝕜) (z : G) :
  smulRightL 𝕜 E G f z = f.smulRight z

[(i : ι) → SeminormedAddCommGroup (E i)]

((ContinuousMultilinearMap.smulRightL 𝕜 E G) f) z = f.smulRight z


/-- `HasImageMap sq` means that there is an `ImageMap` for the square `sq`. -/
class HasImageMap {f g : Arrow C} [HasImage f.hom] [HasImage g.hom] (sq : f ⟶ g) : Prop where
mk' ::
  has_image_map : Nonempty (ImageMap sq)

[self : CategoryTheory.Limits.HasImageMap sq]


/-- The predicate on condensed abelian groups describing the property of being solid. -/
class CondensedMod.IsSolid (A : CondensedMod.{u} R) : Prop where
  isIso_solidification_map : ∀ X : Profinite.{u}, IsIso ((yoneda.obj A).map
    ((profiniteSolidification R).app X).op)

{R : Type (u + 1)}
[Ring R]
{A : CondensedMod R}
[self : CondensedMod.IsSolid R A]
(X : Profinite)

CategoryTheory.IsIso ((CategoryTheory.yoneda.obj A).map ((Condensed.profiniteSolidification R).app X).op)


lemma pairwiseDisjoint_insert_diffFinset (hC : IsSetSemiring C) (hs : s ∈ C) (ht : t ∈ C) :
    PairwiseDisjoint (insert t (hC.diffFinset hs ht) : Set (Set α)) id

{α : Type u_1}
{C : Set (Set α)}
{s t : Set α}
(hC : MeasureTheory.IsSetSemiring C)
(hs : s ∈ C)
(ht : t ∈ C)

(insert t ↑(hC.diffFinset hs ht)).PairwiseDisjoint id


/-- We can combine the logs in `log (1 + z * I) + -log (1 - z * I)` into one.
This is only used in `hasSum_arctan`. -/
lemma hasSum_arctan_aux {z : ℂ} (hz : ‖z‖ < 1) :
    log (1 + z * I) + -log (1 - z * I) = log ((1 + z * I) / (1 - z * I))

Complex.log (1 + z * Complex.I) + -Complex.log (1 - z * Complex.I) =
  Complex.log ((1 + z * Complex.I) / (1 - z * Complex.I))


theorem aestronglyMeasurable_derivWithin_Ioi (μ : Measure ℝ) :
    AEStronglyMeasurable (fun x => derivWithin f (Ioi x) x) μ

{F : Type u_1}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : ℝ → F)
[CompleteSpace F]
(μ : MeasureTheory.Measure ℝ)

MeasureTheory.AEStronglyMeasurable (fun x => derivWithin f (Set.Ioi x) x) μ


theorem eventually_mem_nhdsWithin {a : α} {s : Set α} : ∀ᶠ x in 𝓝[s] a, x ∈ s

{α : Type u_1}
[TopologicalSpace α]
{a : α}
{s : Set α}


theorem induction_on_monomial {M : MvPolynomial σ R → Prop} (h_C : ∀ a, M (C a))
    (h_X : ∀ p n, M p → M (p * X n)) : ∀ s a, M (monomial s a)

(h_X : ∀ (p : MvPolynomial σ R) (n : σ), M p → M (p * MvPolynomial.X n))

(s : σ →₀ ℕ)


/-- If we multiply a positive solution with the inverse of a fundamental solution,
the `x`-coordinate decreases. -/
theorem mul_inv_x_lt_x {a₁ : Solution₁ d} (h : IsFundamental a₁) {a : Solution₁ d} (hax : 1 < a.x)
    (hay : 0 < a.y) : (a * a₁⁻¹).x < a.x

{d : ℤ}
{a₁ : Pell.Solution₁ d}
(h : Pell.IsFundamental a₁)
{a : Pell.Solution₁ d}
(hax : 1 < a.x)
(hay : 0 < a.y)


@[simp]
theorem equivalenceSelfOfHasFiniteBiproducts_functor {C : Type (u₁ + 1)} [LargeCategory C]
    [Preadditive C] [HasFiniteBiproducts C] :
    (equivalenceSelfOfHasFiniteBiproducts C).functor = lift (𝟭 C)

(CategoryTheory.Mat_.equivalenceSelfOfHasFiniteBiproducts C).functor = CategoryTheory.Mat_.lift (𝟭 C)


theorem nndist_vadd_vadd_le (v v' : V) (p p' : P) :
    nndist (v +ᵥ p) (v' +ᵥ p') ≤ nndist v v' + nndist p p'

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(v v' : V)
(p p' : P)


@[simp]
theorem subOneIntegralPowerBasis'_gen [hcycl : IsCyclotomicExtension {p} ℚ K]
    (hζ : IsPrimitiveRoot ζ p) :
    hζ.subOneIntegralPowerBasis'.gen = hζ.toInteger - 1

{p : ℕ+}
{K : Type u}
[Field K]
[CharZero K]
{ζ : K}
[hp : Fact (Nat.Prime ↑p)]
[hcycl : IsCyclotomicExtension {p} ℚ K]
(hζ : IsPrimitiveRoot ζ ↑p)


theorem zero_le_restrict_subset (hi₁ : MeasurableSet i) (hij : j ⊆ i) (hi₂ : 0 ≤[i] v) : 0 ≤[j] v

(hi₂ : MeasureTheory.VectorMeasure.restrict 0 i ≤ v.restrict i)

MeasureTheory.VectorMeasure.restrict 0 j ≤ v.restrict j


theorem _root_.lexOrd_def [Ord α] [Ord β] :
    (lexOrd : Ord (α × β)).compare = compareLex (compareOn (·.1)) (compareOn (·.2))

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

compare = compareLex (compareOn fun x => x.fst) (compareOn fun x => x.snd)


@[reassoc (attr := simp)]
theorem pullbackIsoProdSubtype_inv_snd (f : X ⟶ Z) (g : Y ⟶ Z) :
    (pullbackIsoProdSubtype f g).inv ≫ pullback.snd _ _ = pullbackSnd f g

{X Y Z : TopCat}
(f : X ⟶ Z)
(g : Y ⟶ Z)

(TopCat.pullbackIsoProdSubtype f g).inv ≫ CategoryTheory.Limits.pullback.snd f g = TopCat.pullbackSnd f g


/-- If `A` and `B` are isomorphic, then an ind-object presentation of `A` can be extended to an
    ind-object presentation of `B`. -/
@[simps!]
noncomputable def extend {A B : Cᵒᵖ ⥤ Type v} (P : IndObjectPresentation A) (η : A ⟶ B) [IsIso η] :
    IndObjectPresentation B

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

(P : CategoryTheory.Limits.IndObjectPresentation A)


theorem coeff_zero_eq_aeval_zero (p : R[X]) : p.coeff 0 = aeval 0 p

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


/-- The diamond isomorphism between the intervals `[a ⊓ b, a]` and `[b, a ⊔ b]` -/
@[simps]
def infIccOrderIsoIccSup (a b : α) : Set.Icc (a ⊓ b) a ≃o Set.Icc b (a ⊔ b)

{α : Type u_1}
[Lattice α]
[IsModularLattice α]
(a b : α)
(x : ↑(Set.Icc b (a ⊔ b)))

↑((RelIso.symm (infIccOrderIsoIccSup a b)) x) = a ⊓ ↑x


theorem HasGradientAt.hasDerivAt' (h : HasGradientAt g g' u) :
    HasDerivAt g g' u

{g : ℝ → ℝ}
{g' u : ℝ}
(h : HasGradientAt g g' u)


/-- The functor from a category to its thin skeleton. -/
@[simps]
def toThinSkeleton : C ⥤ ThinSkeleton C

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

∀ {X Y : C} (f : X ⟶ Y), (CategoryTheory.toThinSkeleton C).map f = CategoryTheory.homOfLE ⋯


theorem countP_eq_length_filter (l) : countP p l = length (filter p l)

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

List.countP p l = (List.filter p l).length


theorem IsSt.st_eq {x : ℝ*} {r : ℝ} (hxr : IsSt x r) : st x = r


theorem measurable_sum {_ : MeasurableSpace γ} {f : α ⊕ β → γ} (hl : Measurable (f ∘ Sum.inl))
    (hr : Measurable (f ∘ Sum.inr)) : Measurable f

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

∀ {x : MeasurableSpace γ} {f : α ⊕ β → γ}, Measurable (f ∘ Sum.inl) → Measurable (f ∘ Sum.inr) → Measurable f


lemma OrthogonalIdempotents.unique [Unique I] :
    OrthogonalIdempotents e ↔ IsIdempotentElem (e default)

{R : Type u_1}
[Ring R]
{I : Type u_3}
{e : I → R}
[Unique I]


@[simp]
theorem self_mem_flag_iff [Nontrivial R] (b : Basis (Fin n) R M) {i : Fin n} {k : Fin (n + 1)} :
    b i ∈ b.flag k ↔ i.castSucc < k

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{n : ℕ}
[Nontrivial R]
(b : Basis (Fin n) R M)
{i : Fin n}
{k : Fin (n + 1)}


theorem model_iff_subset_completeTheory : M ⊨ T ↔ T ⊆ L.completeTheory M

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{T : L.Theory}


lemma div_natCast (z : ℂ) (n : ℕ) : z / n = ⟨z.re / n, z.im / n⟩

z / ↑n = { re := z.re / ↑n, im := z.im / ↑n }


theorem strictConcaveOn_cos_Icc : StrictConcaveOn ℝ (Icc (-(π / 2)) (π / 2)) cos

StrictConcaveOn ℝ (Set.Icc (-(π / 2)) (π / 2)) Real.cos


theorem quot_mul_assoc (x y z : PGame) : (⟦x * y * z⟧ : Game) = ⟦x * (y * z)⟧


@[simp]
theorem algebraMap_apply (r : R) : algebraMap R A[X] r = C (algebraMap R A r)

{R : Type u}
{A : Type z}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(r : R)

(algebraMap R A[X]) r = Polynomial.C ((algebraMap R A) r)


/-- Group homomorphisms preserve inverse. -/
@[to_additive "Additive group homomorphisms preserve negation."]
protected theorem map_inv [Group α] [DivisionMonoid β] (f : α →* β) (a : α) : f a⁻¹ = (f a)⁻¹

{α : Type u_2}
{β : Type u_3}
[Group α]
[DivisionMonoid β]
(f : α →* β)
(a : α)


@[simp]
theorem antivary_id_iff : Antivary f id ↔ Antitone f

{ι : Type u_1}
{α : Type u_3}
[Preorder α]
{f : ι → α}
[PartialOrder ι]


theorem sin_coe_pi : sin (π : Angle) = 0


@[simp]
theorem gcdA_zero_left {s : ℕ} : gcdA 0 s = 0


@[simp, norm_cast]
theorem coe_add : ((φ + ψ : R[X]) : PowerSeries R) = φ + ψ

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

↑(φ + ψ) = ↑φ + ↑ψ


/-- A continuous surjective map from a compact space to a Hausdorff space is a quotient map. -/
theorem QuotientMap.of_surjective_continuous [CompactSpace X] [T2Space Y] {f : X → Y}
    (hsurj : Surjective f) (hcont : Continuous f) : QuotientMap f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[CompactSpace X]
[T2Space Y]
{f : X → Y}
(hsurj : Function.Surjective f)
(hcont : Continuous f)


@[to_additive]
theorem op_smul_inter_ne_empty_iff {s t : Set α} {x : αᵐᵒᵖ} :
    x • s ∩ t ≠ ∅ ↔ ∃ a b, (a ∈ s ∧ b ∈ t) ∧ a⁻¹ * b = MulOpposite.unop x

{α : Type u_2}
[AddGroup α]
{s t : Set α}
{x : αᵃᵒᵖ}

(x +ᵥ s) ∩ t ≠ ∅ ↔ ∃ a b, (a ∈ s ∧ b ∈ t) ∧ -a + b = AddOpposite.unop x


@[simp]
theorem toIntLinearEquiv_trans (e₂ : M₂ ≃+ M₃) :
    e.toIntLinearEquiv.trans e₂.toIntLinearEquiv = (e.trans e₂).toIntLinearEquiv

{M : Type u_8}
{M₂ : Type u_10}
{M₃ : Type u_11}
[AddCommGroup M]
[AddCommGroup M₂]
[AddCommGroup M₃]
(e : M ≃+ M₂)
(e₂ : M₂ ≃+ M₃)

e.toIntLinearEquiv ≪≫ₗ e₂.toIntLinearEquiv = (e.trans e₂).toIntLinearEquiv


protected theorem smash {s₁ s₂ t₁ t₂ : CompositionSeries X}
    (hs : s₁.last = s₂.head) (ht : t₁.last = t₂.head)
    (h₁ : Equivalent s₁ t₁) (h₂ : Equivalent s₂ t₂) :
    Equivalent (smash s₁ s₂ hs) (smash t₁ t₂ ht)

(hs : RelSeries.last s₁ = RelSeries.head s₂)

(ht : RelSeries.last t₁ = RelSeries.head t₂)

CompositionSeries.Equivalent (RelSeries.smash s₁ s₂ hs) (RelSeries.smash t₁ t₂ ht)


theorem HasFDerivWithinAt.cosh (hf : HasFDerivWithinAt f f' s x) :
    HasFDerivWithinAt (fun x => Real.cosh (f x)) (Real.sinh (f x) • f') s x

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


@[fun_prop, measurability]
theorem measurable_circleMap (c : ℂ) (R : ℝ) : Measurable (circleMap c R)


theorem Ioo_subset_openSegment : Ioo x y ⊆ openSegment 𝕜 x y

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{x y : 𝕜}


theorem option_bind₁ {f : α → Option σ} (hf : Primrec f) : Primrec fun o => Option.bind o f

{α : Type u_1}
{σ : Type u_5}
[Primcodable α]
[Primcodable σ]
{f : α → Option σ}
(hf : Primrec f)


@[to_additive]
lemma IsMulFreimanIso.mono {hmn : m ≤ n} (hf : IsMulFreimanIso n A B f) :
    IsMulFreimanIso m A B f

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoid α]
[CancelCommMonoid β]
{A : Set α}
{B : Set β}
{f : α → β}
{m n : ℕ}
{hmn : m ≤ n}
(hf : IsMulFreimanIso n A B f)


@[simp] theorem RingHom.id_commSemiringCat_comp
    {G : Type u} [CommSemiring G] {H : CommSemiRingCat.{u}} (f : G →+* H) :
    RingHom.comp (𝟙 H) f = f

{G : Type u}
[CommSemiring G]
{H : CommSemiRingCat}
(f : G →+* ↑H)


@[simp 1100]
theorem op_mem_op {s : Set α} {a : α} : op a ∈ s.op ↔ a ∈ s


/-- The hom from `P` to `P'` given by the designated section of `P'`. -/
@[simps]
def defaultHom : Hom P P'

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(P : Algebra.Generators R S)
{R' : Type u_1}
{S' : Type u_2}
[CommRing R']
[CommRing S']
[Algebra R' S']
(P' : Algebra.Generators R' S')
[Algebra S S']

∀ (a : P.vars), (P.defaultHom P').val a = (P'.σ ∘ ⇑(algebraMap S S') ∘ P.val) a


/-- Convert a measurable involutive function `f` to a measurable permutation with
`toFun = invFun = f`. See also `Function.Involutive.toPerm`. -/
@[simps toEquiv]
def ofInvolutive (f : α → α) (hf : Involutive f) (hf' : Measurable f) : α ≃ᵐ α

{α : Type u_1}
[MeasurableSpace α]
(f : α → α)
(hf : Function.Involutive f)
(hf' : Measurable f)

(MeasurableEquiv.ofInvolutive f hf hf').toEquiv = Function.Involutive.toPerm f hf


@[to_additive]
theorem leftInvEquiv_mul (x : S.leftInv) : (S.leftInvEquiv hS x : M) * x = 1

{M : Type u_1}
[CommMonoid M]
(S : Submonoid M)
(hS : S ≤ IsUnit.submonoid M)
(x : ↥S.leftInv)


theorem Antitone.iInf_nat_add {f : ℕ → α} (hf : Antitone f) (k : ℕ) : ⨅ n, f (n + k) = ⨅ n, f n

{α : Type u_1}
[CompleteLattice α]
{f : ℕ → α}
(hf : Antitone f)
(k : ℕ)


@[simp]
theorem ofAdd_eq_one {A : Type*} [Zero A] {x : A} : Multiplicative.ofAdd x = 1 ↔ x = 0


@[to_additive]
theorem map_mk' (M : Subgroup H) [M.Normal] (f : G →* H) (h : N ≤ M.comap f) (x : G) :
    map N M f h (mk' _ x) = ↑(f x)

{G : Type u}
[AddGroup G]
(N : AddSubgroup G)
[nN : N.Normal]
{H : Type v}
[AddGroup H]
(M : AddSubgroup H)
[M.Normal]
(f : G →+ H)
(h : N ≤ AddSubgroup.comap f M)
(x : G)

(QuotientAddGroup.map N M f h) ((QuotientAddGroup.mk' N) x) = ↑(f x)


@[symm]
protected theorem symm (h : AEDisjoint μ s t) : AEDisjoint μ t s

{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(h : MeasureTheory.AEDisjoint μ s t)


theorem exists_Ico_subset_of_mem_nhds [OrderTopology α] {a : α} {s : Set α} (hs : s ∈ 𝓝 a)
    (h : ∃ u, a < u) : ∃ u, a < u ∧ Ico a u ⊆ s

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
{s : Set α}
(hs : s ∈ 𝓝 a)
(h : ∃ u, a < u)


@[simp] theorem or_false (p : Prop) : (p ∨ False) = p


@[to_additive]
theorem Pi.multipliable {f : ι → ∀ x, π x} : Multipliable f ↔ ∀ x, Multipliable fun i ↦ f i x

{α : Type u_1}
{ι : Type u_5}
{π : α → Type u_6}
[(x : α) → AddCommMonoid (π x)]
[(x : α) → TopologicalSpace (π x)]
{f : ι → (x : α) → π x}

Summable f ↔ ∀ (x : α), Summable fun i => f i x


theorem lintegral_map' {β} [MeasurableSpace β] {μ' : Measure β} (f : α →ₛ ℝ≥0∞) (g : β →ₛ ℝ≥0∞)
    (m' : α → β) (eq : ∀ a, f a = g (m' a)) (h : ∀ s, MeasurableSet s → μ' s = μ (m' ⁻¹' s)) :
    f.lintegral μ = g.lintegral μ'

(h : ∀ (s : Set β), MeasurableSet s → μ' s = μ (m' ⁻¹' s))


/-- In a finite field of characteristic `2`, all elements are squares. -/
theorem isSquare_of_char_two (hF : ringChar F = 2) (a : F) : IsSquare a

{F : Type u_3}
[Field F]
[Finite F]
(hF : ringChar F = 2)
(a : F)


theorem reflect_support (N : ℕ) (f : R[X]) :
    (reflect N f).support = Finset.image (revAt N) f.support

{R : Type u_1}
[Semiring R]
(N : ℕ)
(f : Polynomial R)

(Polynomial.reflect N f).support = Finset.image (⇑(Polynomial.revAt N)) f.support


theorem preperfect_iff_nhds : Preperfect C ↔ ∀ x ∈ C, ∀ U ∈ 𝓝 x, ∃ y ∈ U ∩ C, y ≠ x

{α : Type u_1}
[TopologicalSpace α]
{C : Set α}


/-- The (open) `δ`-thickening `Metric.thickening δ E` of a subset `E` in a metric space equals the
union of balls of radius `δ` centered at points of `E`. -/
theorem thickening_eq_biUnion_ball {δ : ℝ} {E : Set X} : thickening δ E = ⋃ x ∈ E, ball x δ

{X : Type u}
[PseudoMetricSpace X]
{δ : ℝ}
{E : Set X}

Metric.thickening δ E = ⋃ x ∈ E, Metric.ball x δ


theorem op_iSup (S : ι → Subring R) : (iSup S).op = ⨆ i, (S i).op

{ι : Sort u_1}
{R : Type u_2}
[Ring R]
(S : ι → Subring R)


theorem IsAffineOpen.primeIdealOf_genericPoint {X : Scheme} [IsIntegral X] {U : X.Opens}
    (hU : IsAffineOpen U) [h : Nonempty U] :
    hU.primeIdealOf
        ⟨genericPoint X,
          ((genericPoint_spec X).mem_open_set_iff U.isOpen).mpr (by simpa using h)⟩ =
      genericPoint (Spec Γ(X, U))

{X : AlgebraicGeometry.Scheme}
[AlgebraicGeometry.IsIntegral X]
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)
[h : Nonempty ↑↑(↑U).toPresheafedSpace]

hU.primeIdealOf ⟨genericPoint ↑↑X.toPresheafedSpace, ⋯⟩ =
  genericPoint ↑↑(AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op U))).toPresheafedSpace


theorem IsPrimitive.dvd_primPart_iff_dvd {p q : R[X]} (hp : p.IsPrimitive) (hq : q ≠ 0) :
    p ∣ q.primPart ↔ p ∣ q

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
{p q : Polynomial R}
(hp : p.IsPrimitive)
(hq : q ≠ 0)


@[simp]
theorem tendsto_pow_atTop_iff {n : ℕ} : Tendsto (fun x : α => x ^ n) atTop atTop ↔ n ≠ 0

{α : Type u_3}
[LinearOrderedSemiring α]
{n : ℕ}

Filter.Tendsto (fun x => x ^ n) Filter.atTop Filter.atTop ↔ n ≠ 0


@[simp] theorem mem_filterMap (f : α → Option β) (l : List α) {b : β} :
    b ∈ filterMap f l ↔ ∃ a, a ∈ l ∧ f a = some b

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

b ∈ List.filterMap f l ↔ ∃ a, a ∈ l ∧ f a = some b


@[simp]
theorem mem_mk (x : P) (I : Ideal Pᵒᵈ) : x ∈ (⟨I⟩ : PFilter P) ↔ toDual x ∈ I

{P : Type u_1}
[Preorder P]
(x : P)
(I : Order.Ideal Pᵒᵈ)

x ∈ { dual := I } ↔ OrderDual.toDual x ∈ I


@[simp]
theorem op_bot : (⊥ : Subsemiring R).op = ⊥


@[mono]
theorem apply_mono {f g : α →o β} {x y : α} (h₁ : f ≤ g) (h₂ : x ≤ y) : f x ≤ g y

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{f g : α →o β}
{x y : α}
(h₁ : f ≤ g)
(h₂ : x ≤ y)


theorem OrderIso.map_sSup [CompleteLattice β] (f : α ≃o β) (s : Set α) :
    f (sSup s) = ⨆ a ∈ s, f a

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
[CompleteLattice β]
(f : α ≃o β)
(s : Set α)


@[simp]
theorem mem_isPairSelfAdjointSubmodule (f : Module.End R M) :
    f ∈ isPairSelfAdjointSubmodule B F ↔ IsPairSelfAdjoint B F f

{R : Type u_1}
{M : Type u_5}
{M₂ : Type u_7}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₂]
[Module R M₂]
{B F : M →ₗ[R] M →ₗ[R] M₂}
(f : Module.End R M)

f ∈ B.isPairSelfAdjointSubmodule F ↔ B.IsPairSelfAdjoint F f


@[simp, norm_cast]
theorem coe_bot : (↑(⊥ : Closeds α) : Set α) = ∅


@[deprecated eq_rpow_inv_iff (since := "2024-07-10")]
theorem eq_rpow_one_div_iff {x y : ℝ≥0} {z : ℝ} (hz : z ≠ 0) : x = y ^ (1 / z) ↔ x ^ z = y


/-- If `P` is a presentation of `S` over `R` and `T` is an `R`-algebra, we
obtain a natural presentation of `T ⊗[R] S` over `T`. -/
@[simps relation, simps (config := .lemmasOnly) rels]
noncomputable
def baseChange : Presentation T (T ⊗[R] S)

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


/-- For any `x : M ⧸ S` and any `0 < ε`, there is `m : M` such that `mk' S m = x`
and `‖m‖ < ‖x‖ + ε`. -/
theorem norm_mk_lt {S : AddSubgroup M} (x : M ⧸ S) {ε : ℝ} (hε : 0 < ε) :
    ∃ m : M, mk' S m = x ∧ ‖m‖ < ‖x‖ + ε

{M : Type u_1}
[SeminormedAddCommGroup M]
{S : AddSubgroup M}
(x : M ⧸ S)
{ε : ℝ}
(hε : 0 < ε)

∃ m, (QuotientAddGroup.mk' S) m = x ∧ ‖m‖ < ‖x‖ + ε


/-- If `g` is a topological embedding, then `f` is strongly measurable iff `g ∘ f` is. -/
theorem _root_.Embedding.comp_stronglyMeasurable_iff {m : MeasurableSpace α} [TopologicalSpace β]
    [PseudoMetrizableSpace β] [TopologicalSpace γ] [PseudoMetrizableSpace γ] {g : β → γ} {f : α → β}
    (hg : Embedding g) : (StronglyMeasurable fun x => g (f x)) ↔ StronglyMeasurable f

(MeasureTheory.StronglyMeasurable fun x => g (f x)) ↔ MeasureTheory.StronglyMeasurable f


theorem has_fpower_series_iterate_dslope_fslope (n : ℕ) (hp : HasFPowerSeriesAt f p z₀) :
    HasFPowerSeriesAt ((swap dslope z₀)^[n] f) (fslope^[n] p) z₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{p : FormalMultilinearSeries 𝕜 𝕜 E}
{f : 𝕜 → E}
{z₀ : 𝕜}
(n : ℕ)
(hp : HasFPowerSeriesAt f p z₀)

HasFPowerSeriesAt ((Function.swap dslope z₀)^[n] f) (FormalMultilinearSeries.fslope^[n] p) z₀


theorem lt_iff_not_le [LinearOrder α] {x y : α} : x < y ↔ ¬y ≤ x

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


theorem finrank_add_eq_of_isCompl [FiniteDimensional K V] {U W : Submodule K V} (h : IsCompl U W) :
    finrank K U + finrank K W = finrank K V

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{U W : Submodule K V}
(h : IsCompl U W)

FiniteDimensional.finrank K ↥U + FiniteDimensional.finrank K ↥W = FiniteDimensional.finrank K V


/-- The homology map data associated to the zero morphism between two short complexes. -/
@[simps]
def zero (h₁ : S₁.HomologyData) (h₂ : S₂.HomologyData) :
    HomologyMapData 0 h₁ h₂

(CategoryTheory.ShortComplex.HomologyMapData.zero h₁ h₂).right =
  CategoryTheory.ShortComplex.RightHomologyMapData.zero h₁.right h₂.right


/-- The upper shadow of a family of `r`-sets is a family of `r + 1`-sets. -/
protected lemma _root_.Set.Sized.upShadow (h𝒜 : (𝒜 : Set (Finset α)).Sized r) :
    (∂⁺ 𝒜 : Set (Finset α)).Sized (r + 1)

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{𝒜 : Finset (Finset α)}
{r : ℕ}
(h𝒜 : Set.Sized r ↑𝒜)


protected theorem ClosureAntitone.antitone [TopologicalSpace α] (hA : ClosureAntitone A) :
    CantorScheme.Antitone A

{β : Type u_1}
{α : Type u_2}
{A : List β → Set α}
[TopologicalSpace α]
(hA : CantorScheme.ClosureAntitone A)


@[simp] theorem guard_eq_some [DecidablePred p] : guard p a = some b ↔ a = b ∧ p a

∀ {α : Type u_1} {p : α → Prop} {a b : α} [inst : DecidablePred p], Option.guard p a = some b ↔ a = b ∧ p a


/-- Affine equivalence between two equal affine subspace.

This is the affine version of `LinearEquiv.ofEq`. -/
@[simps linear]
def ofEq (h : S₁ = S₂) : S₁ ≃ᵃ[k] S₂

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(S₁ S₂ : AffineSubspace k P₁)
[Nonempty ↥S₁]
[Nonempty ↥S₂]
(h : S₁ = S₂)

(AffineEquiv.ofEq S₁ S₂ h).linear = LinearEquiv.ofEq S₁.direction S₂.direction ⋯


@[simp]
theorem Ioc_inr_inl : Ioc (inr b₁) (inl a₂) = ∅

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

Finset.Ioc (Sum.inr b₁) (Sum.inl a₂) = ∅


theorem expand_card (f : K[X]) : expand K q f = f ^ q

{K : Type u_1}
[Field K]
[Fintype K]
(f : K[X])


lemma negAddY_of_X_eq {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0)
    (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2) : W.negAddY P Q = (-addU P Q) ^ 3

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P Q : Fin 3 → F}
(hP : W.Equation P)
(hQ : W.Equation Q)
(hPz : P z ≠ 0)
(hQz : Q z ≠ 0)
(hx : P x * Q z ^ 2 = Q x * P z ^ 2)

W.negAddY P Q = (-WeierstrassCurve.Jacobian.addU P Q) ^ 3


lemma supSum_of_not_univ_mem (h𝒜₁ : 𝒜.Nonempty) (h𝒜₂ : univ ∉ 𝒜) :
    supSum 𝒜 = card α * ∑ k ∈ range (card α), (k : ℚ)⁻¹

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{𝒜 : Finset (Finset α)}
[Nonempty α]
(h𝒜₁ : 𝒜.Nonempty)
(h𝒜₂ : Finset.univ ∉ 𝒜)

AhlswedeZhang.supSum 𝒜 = ↑(Fintype.card α) * ∑ k ∈ Finset.range (Fintype.card α), (↑k)⁻¹


@[simp]
theorem ExactFunctor.of_fst (F : C ⥤ D) [PreservesFiniteLimits F] [PreservesFiniteColimits F] :
    (ExactFunctor.of F).obj = F

(CategoryTheory.ExactFunctor.of F).obj = F


/-- Pull back a `NoZeroDivisors` instance along an injective function. -/
protected theorem Function.Injective.noZeroDivisors [NoZeroDivisors M₀'] : NoZeroDivisors M₀

(mul : ∀ (x y : M₀), f (x * y) = f x * f y)


lemma eq_mul_inv_iff_mul_eq₀ (hc : c ≠ 0) : a = b * c⁻¹ ↔ a * c = b

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b c : G₀}
(hc : c ≠ 0)


@[simp]
theorem Subsequent.mk_right' (xL : xl → PGame) (xR : xr → PGame) (j : RightMoves (mk xl xr xL xR)) :
    Subsequent (xR j) (mk xl xr xL xR)

(j : (SetTheory.PGame.mk xl xr xL xR).RightMoves)

(xR j).Subsequent (SetTheory.PGame.mk xl xr xL xR)


theorem theory_model (g : M ≃[L] N) [M ⊨ T] : N ⊨ T

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{T : L.Theory}
(g : L.Equiv M N)
[M ⊨ T]


/-- The natural linear map $A ⊗ \text{Hom}_R(M, N) → \text{Hom}_A (M_A, N_A)$,
where $M_A$ and $N_A$ are the respective modules over $A$ obtained by extension of scalars.

See `LinearMap.tensorProductEnd` for this map specialized to endomorphisms,
and bundled as `A`-algebra homomorphism. -/
@[simps!]
noncomputable
def tensorProduct : A ⊗[R] (M →ₗ[R] N) →ₗ[A] (A ⊗[R] M) →ₗ[A] (A ⊗[R] N)

(R : Type u_1)
(A : Type u_2)
(M : Type u_3)
(N : Type u_4)
[CommRing R]
[CommRing A]
[Algebra R A]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]

∀ (a : A ⊗[R] (M →ₗ[R] N)),
  (LinearMap.tensorProduct R A M N) a =
    (TensorProduct.liftAux
        (↑R { toFun := fun a => a • LinearMap.baseChangeHom R A M N, map_add' := ⋯, map_smul' := ⋯ }))
      a


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

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

adj1.unit ≫ CategoryTheory.whiskerRight (adj1.leftAdjointUniq adj2).hom G = adj2.unit


@[simp]
theorem foldr_max_of_ne_nil (h : l ≠ []) : ↑(l.foldr max ⊥) = l.maximum

{α : Type u_1}
[LinearOrder α]
[OrderBot α]
{l : List α}
(h : l ≠ [])


@[simp]
theorem erase_singleton (a : α) : ({a} : Finset α).erase a = ∅


/-- A product taken over a conditional whose condition is an equality test on the index and whose
alternative is `1` has value either the term at that index or `1`.

The difference with `Finset.prod_ite_eq` is that the arguments to `Eq` are swapped. -/
@[to_additive (attr := simp) "A sum taken over a conditional whose condition is an equality
test on the index and whose alternative is `0` has value either the term at that index or `0`.

The difference with `Finset.sum_ite_eq` is that the arguments to `Eq` are swapped."]
theorem prod_ite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
    (∏ x ∈ s, ite (x = a) (b x) 1) = ite (a ∈ s) (b a) 1

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

(∏ x ∈ s, if x = a then b x else 1) = if a ∈ s then b a else 1


/-- Riesz's lemma, which usually states that it is possible to find a
vector with norm 1 whose distance to a closed proper subspace is
arbitrarily close to 1. The statement here is in terms of multiples of
norms, since in general the existence of an element of norm exactly 1
is not guaranteed. For a variant giving an element with norm in `[1, R]`, see
`riesz_lemma_of_norm_lt`. -/
theorem riesz_lemma {F : Subspace 𝕜 E} (hFc : IsClosed (F : Set E)) (hF : ∃ x : E, x ∉ F) {r : ℝ}
    (hr : r < 1) : ∃ x₀ : E, x₀ ∉ F ∧ ∀ y ∈ F, r * ‖x₀‖ ≤ ‖x₀ - y‖

{𝕜 : Type u_1}
[NormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Subspace 𝕜 E}
(hFc : IsClosed ↑F)
(hF : ∃ x, x ∉ F)
{r : ℝ}
(hr : r < 1)

∃ x₀ ∉ F, ∀ y ∈ F, r * ‖x₀‖ ≤ ‖x₀ - y‖


theorem tendsto_ratCast_atTop_iff [LinearOrderedField R] [Archimedean R] {f : α → ℚ}
    {l : Filter α} : Tendsto (fun n => (f n : R)) l atTop ↔ Tendsto f l atTop

{α : Type u_1}
{R : Type u_2}
[LinearOrderedField R]
[Archimedean R]
{f : α → ℚ}
{l : Filter α}

Filter.Tendsto (fun n => ↑(f n)) l Filter.atTop ↔ Filter.Tendsto f l Filter.atTop


/-- The characteristic predicate for localized module.
`IsLocalizedModule S f` describes that `f : M ⟶ M'` is the localization map identifying `M'` as
`LocalizedModule S M`.
-/
@[mk_iff] class IsLocalizedModule : Prop where
  map_units : ∀ x : S, IsUnit (algebraMap R (Module.End R M') x)
  surj' : ∀ y : M', ∃ x : M × S, x.2 • y = f x.1
  exists_of_eq : ∀ {x₁ x₂}, f x₁ = f x₂ → ∃ c : S, c • x₁ = c • x₂

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')

IsLocalizedModule S f ↔
  (∀ (x : ↥S), IsUnit ((algebraMap R (Module.End R M')) ↑x)) ∧
    (∀ (y : M'), ∃ x, x.2 • y = f x.1) ∧ ∀ {x₁ x₂ : M}, f x₁ = f x₂ → ∃ c, c • x₁ = c • x₂


@[simp]
theorem coe_toSubsemigroup (s : NonUnitalSubring R) : (s.toSubsemigroup : Set R) = s

{R : Type u}
[NonUnitalNonAssocRing R]
(s : NonUnitalSubring R)


theorem ContDiffOn.log {n} (hf : ContDiffOn ℝ n f s) (hs : ∀ x ∈ s, f x ≠ 0) :
    ContDiffOn ℝ n (fun x => log (f x)) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffOn ℝ n f s)
(hs : ∀ x ∈ s, f x ≠ 0)

ContDiffOn ℝ n (fun x => Real.log (f x)) s


theorem symm_trans_apply (c : M₃) :
    (e₁₂.trans e₂₃ : M₁ ≃ₛₗ[σ₁₃] M₃).symm c = e₁₂.symm (e₂₃.symm c)

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M₁ : Type u_9}
{M₂ : Type u_10}
{M₃ : Type u_11}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
{module_M₁ : Module R₁ M₁}
{module_M₂ : Module R₂ M₂}
{module_M₃ : Module R₃ M₃}
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
{σ₂₁ : R₂ →+* R₁}
{σ₃₂ : R₃ →+* R₂}
{σ₃₁ : R₃ →+* R₁}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[RingHomCompTriple σ₃₂ σ₂₁ σ₃₁]
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₃ : RingHomInvPair σ₂₃ σ₃₂}
[RingHomInvPair σ₁₃ σ₃₁]
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
{re₃₂ : RingHomInvPair σ₃₂ σ₂₃}
[RingHomInvPair σ₃₁ σ₁₃]
{e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂}
{e₂₃ : M₂ ≃ₛₗ[σ₂₃] M₃}
(c : M₃)

(e₁₂.trans e₂₃).symm c = e₁₂.symm (e₂₃.symm c)


theorem kroneckerMap_assoc {δ ξ ω ω' : Type*} (f : α → β → γ) (g : γ → δ → ω) (f' : α → ξ → ω')
    (g' : β → δ → ξ) (A : Matrix l m α) (B : Matrix n p β) (D : Matrix q r δ) (φ : ω ≃ ω')
    (hφ : ∀ a b d, φ (g (f a b) d) = f' a (g' b d)) :
    (reindex (Equiv.prodAssoc l n q) (Equiv.prodAssoc m p r)).trans (Equiv.mapMatrix φ)
        (kroneckerMap g (kroneckerMap f A B) D) =
      kroneckerMap f' A (kroneckerMap g' B D)

(f : α → β → γ)

(g : γ → δ → ω)

(g' : β → δ → ξ)

(φ : ω ≃ ω')

((Matrix.reindex (Equiv.prodAssoc l n q) (Equiv.prodAssoc m p r)).trans φ.mapMatrix)
    (Matrix.kroneckerMap g (Matrix.kroneckerMap f A B) D) =
  Matrix.kroneckerMap f' A (Matrix.kroneckerMap g' B D)


/--
A sieve belongs to the coherent topology if and only if it contains a finite
`EffectiveEpiFamily`.
-/
theorem coherentTopology.mem_sieves_iff_hasEffectiveEpiFamily (S : Sieve X) :
    (S ∈ GrothendieckTopology.sieves (coherentTopology C) X) ↔
    (∃ (α : Type) (_ : Finite α) (Y : α → C) (π : (a : α) → (Y a ⟶ X)),
        EffectiveEpiFamily Y π ∧ (∀ a : α, (S.arrows) (π a)) )

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Precoherent C]
{X : C}
(S : CategoryTheory.Sieve X)

S ∈ (CategoryTheory.coherentTopology C).sieves X ↔
  ∃ α, ∃ (_ : Finite α), ∃ Y π, CategoryTheory.EffectiveEpiFamily Y π ∧ ∀ (a : α), S.arrows (π a)


/-- A separable space is one with a countable dense subset, available through
`TopologicalSpace.exists_countable_dense`. If `α` is also known to be nonempty, then
`TopologicalSpace.denseSeq` provides a sequence `ℕ → α` with dense range, see
`TopologicalSpace.denseRange_denseSeq`.

If `α` is a uniform space with countably generated uniformity filter (e.g., an `EMetricSpace`), then
this condition is equivalent to `SecondCountableTopology α`. In this case the
latter should be used as a typeclass argument in theorems because Lean can automatically deduce
`TopologicalSpace.SeparableSpace` from `SecondCountableTopology` but it can't
deduce `SecondCountableTopology` from `TopologicalSpace.SeparableSpace`.

Porting note (#11215): TODO: the previous paragraph describes the state of the art in Lean 3.
We can have instance cycles in Lean 4 but we might want to
postpone adding them till after the port. -/
@[mk_iff] class SeparableSpace : Prop where
  /-- There exists a countable dense set. -/
  exists_countable_dense : ∃ s : Set α, s.Countable ∧ Dense s

TopologicalSpace.SeparableSpace α ↔ ∃ s, s.Countable ∧ Dense s


@[to_additive (attr := simp) nsmul_bot]
theorem bot_pow {n : ℕ} (hn : n ≠ 0) : (⊥ : Filter α) ^ n = ⊥

{α : Type u_2}
[Monoid α]
{n : ℕ}
(hn : n ≠ 0)


theorem hasSum_nat_jacobiTheta {τ : ℂ} (hτ : 0 < im τ) :
    HasSum (fun n : ℕ => cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)

HasSum (fun n => cexp (↑π * Complex.I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)


theorem exists_lowerCentralSeries_eq_bot_of_isNilpotent [IsNilpotent R L M] :
    ∃ k, lowerCentralSeries R L M k = ⊥

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule.IsNilpotent R L M]

∃ k, LieModule.lowerCentralSeries R L M k = ⊥


lemma natDegree_preΨ₄_pos (h : (2 : R) ≠ 0) : 0 < W.preΨ₄.natDegree

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


theorem polar_add (f g : M → N) (x y : M) : polar (f + g) x y = polar f x y + polar g x y

{M : Type u_4}
{N : Type u_5}
[AddCommGroup M]
[AddCommGroup N]
(f g : M → N)
(x y : M)

QuadraticMap.polar (f + g) x y = QuadraticMap.polar f x y + QuadraticMap.polar g x y


/-- `invertibleOfMulInvertible` and `invertibleMul` as an equivalence. -/
@[simps apply symm_apply]
def Invertible.mulRight (a : α) {b : α} (_ : Invertible b) : Invertible a ≃ Invertible (a * b)

∀ (x : Invertible b) (x_1 : Invertible (a * b)), (Invertible.mulRight a x).symm x_1 = invertibleOfMulInvertible a b


@[simp]
theorem weightedSMul_zero_measure {m : MeasurableSpace α} :
    weightedSMul (0 : Measure α) = (0 : Set α → F →L[ℝ] F)

{α : Type u_1}
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{m : MeasurableSpace α}


theorem Fin.preimage_apply_01_prod {α : Fin 2 → Type u} (s : Set (α 0)) (t : Set (α 1)) :
    (fun f : ∀ i, α i => (f 0, f 1)) ⁻¹' s ×ˢ t =
      Set.pi Set.univ (Fin.cons s <| Fin.cons t finZeroElim)

(fun f => (f 0, f 1)) ⁻¹' s ×ˢ t = Set.univ.pi (Fin.cons s (Fin.cons t finZeroElim))


theorem superset {φ ψ : ι → Set α} (hφ : AECover μ l φ) (hsub : ∀ i, φ i ⊆ ψ i)
    (hmeas : ∀ i, MeasurableSet (ψ i)) : AECover μ l ψ

(hmeas : ∀ (i : ι), MeasurableSet (ψ i))


theorem continuousAt_pi {f : X → ∀ i, π i} {x : X} :
    ContinuousAt f x ↔ ∀ i, ContinuousAt (fun y => f y i) x

{X : Type u}
{ι : Type u_5}
{π : ι → Type u_6}
[TopologicalSpace X]
[T : (i : ι) → TopologicalSpace (π i)]
{f : X → (i : ι) → π i}
{x : X}

ContinuousAt f x ↔ ∀ (i : ι), ContinuousAt (fun y => f y i) x


@[simp] lemma sum_zeckendorf_fib (n : ℕ) : (n.zeckendorf.map fib).sum = n


@[simp]
theorem mem_map : t ∈ map m f ↔ m ⁻¹' t ∈ f

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


@[to_additive (attr := simp)]
theorem eqLocus_same (f : G →* N) : f.eqLocus f = ⊤

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(f : G →+ N)


@[simp]
theorem LinearEquiv.finsuppUnique_apply (f : α →₀ M) :
    LinearEquiv.finsuppUnique R M α f = f default

{R : Type u_1}
{M : Type u_3}
[AddCommMonoid M]
[Semiring R]
[Module R M]
(α : Type u_4)
[Unique α]
(f : α →₀ M)

(Finsupp.LinearEquiv.finsuppUnique R M α) f = f default


theorem zero_apply (a : A) : (0 : A →⋆ₙ+* B) a = 0

{A : Type u_1}
{B : Type u_2}
[NonUnitalNonAssocSemiring A]
[StarAddMonoid A]
[NonUnitalNonAssocSemiring B]
[StarAddMonoid B]
(a : A)


theorem pcontinuous_iff' {f : X →. Y} :
    PContinuous f ↔ ∀ {x y} (h : y ∈ f x), PTendsto' f (𝓝 x) (𝓝 y)

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

PContinuous f ↔ ∀ {x : X} {y : Y}, y ∈ f x → Filter.PTendsto' f (𝓝 x) (𝓝 y)


/-- A version of the **Hahn-Banach theorem**: given disjoint convex sets `s`, `t` where `s` is
closed, and `t` is compact, there is a continuous linear functional which strongly separates them.
-/
theorem geometric_hahn_banach_closed_compact (hs₁ : Convex ℝ s) (hs₂ : IsClosed s)
    (ht₁ : Convex ℝ t) (ht₂ : IsCompact t) (disj : Disjoint s t) :
    ∃ (f : E →L[ℝ] ℝ) (u v : ℝ), (∀ a ∈ s, f a < u) ∧ u < v ∧ ∀ b ∈ t, v < f b

{E : Type u_2}
[TopologicalSpace E]
[AddCommGroup E]
[TopologicalAddGroup E]
[Module ℝ E]
[ContinuousSMul ℝ E]
{s t : Set E}
[LocallyConvexSpace ℝ E]
(hs₁ : Convex ℝ s)
(hs₂ : IsClosed s)
(ht₁ : Convex ℝ t)
(ht₂ : IsCompact t)
(disj : Disjoint s t)

∃ f u v, (∀ a ∈ s, f a < u) ∧ u < v ∧ ∀ b ∈ t, v < f b


lemma quasiIso_of_arrow_mk_iso (φ : K ⟶ L) (φ' : K' ⟶ L') (e : Arrow.mk φ ≅ Arrow.mk φ')
    [∀ i, K.HasHomology i] [∀ i, L.HasHomology i]
    [∀ i, K'.HasHomology i] [∀ i, L'.HasHomology i]
    [hφ : QuasiIso φ] : QuasiIso φ'

(e : CategoryTheory.Arrow.mk φ ≅ CategoryTheory.Arrow.mk φ')


/-- Reinterpreting an `F`-structured arrow `X ⟶ F.obj d` as an arrow under `X` induces a functor
    `StructuredArrow X F ⥤ Under X`. -/
@[simps!]
def toUnder (X : T) (F : D ⥤ T) : StructuredArrow X F ⥤ Under X

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

∀ {X_1 Y : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit X) (F.comp (CategoryTheory.Functor.id T))}
  (f : X_1 ⟶ Y), ((CategoryTheory.StructuredArrow.toUnder X F).map f).left = CategoryTheory.CategoryStruct.id X_1.left


theorem one_lt_card_iff : 1 < s.card ↔ ∃ a b, a ∈ s ∧ b ∈ s ∧ a ≠ b


theorem smallSets_iInf {f : ι → Filter α} : (iInf f).smallSets = ⨅ i, (f i).smallSets

{α : Type u_1}
{ι : Sort u_3}
{f : ι → Filter α}


/-- If a polynomial of degree 2 is always nonnegative, then its discriminant is nonpositive -/
theorem discrim_le_zero (h : ∀ x : K, 0 ≤ a * x * x + b * x + c) : discrim a b c ≤ 0


theorem iterate_right (h : Commute f g) (n : ℕ) : Commute f g^[n]

{α : Type u}
{f g : α → α}
(h : Function.Commute f g)
(n : ℕ)


lemma Antivary.pow_left₀ (hf : 0 ≤ f) (hfg : Antivary f g) (n : ℕ) : Antivary (f ^ n) g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedSemiring α]
[OrderedSemiring β]
{f : ι → α}
{g : ι → β}
(hf : 0 ≤ f)
(hfg : Antivary f g)
(n : ℕ)


theorem mapEquiv.injective (f : Type u₀ → Type u₁)
    [Applicative f] [LawfulApplicative f] {α β : Type u₀}
    (h : ∀ γ, Function.Injective (pure : γ → f γ)) :
      Function.Injective (@EquivFunctor.mapEquiv f _ α β)

(h : ∀ (γ : Type u₀), Function.Injective pure)


theorem IsIrreducible.nonempty (h : IsIrreducible s) : s.Nonempty

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(h : IsIrreducible s)


@[simp] theorem trans_refl (e : α ≃ β) : e.trans (Equiv.refl β) = e


@[simp] lemma lie_coe_lieDerivation_apply (x : L) (D : LieDerivation R L M) :
    ⁅x, (D : L →ₗ[R] M)⁆ = ⁅x, D⁆

(R : Type u_1)
(L : Type u_2)
(M : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x : L)
(D : LieDerivation R L M)


@[norm_cast]
theorem coe_zero : (↑(0 : R) : A) = 0

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


theorem map_le_gfp {a : α} (ha : a ≤ gfp f) : f a ≤ gfp f

{α : Type u}
[CompleteLattice α]
(f : α →o α)
{a : α}
(ha : a ≤ OrderHom.gfp f)


@[simp]
lemma harmonic_succ (n : ℕ) : harmonic (n + 1) = harmonic n + (↑(n + 1))⁻¹


/-- If `x ∈ s` and `x + y ∈ interior s`, then `x + t y ∈ interior s` for `t ∈ (0, 1]`. -/
theorem Convex.add_smul_mem_interior {s : Set E} (hs : Convex 𝕜 s) {x y : E} (hx : x ∈ s)
    (hy : x + y ∈ interior s) {t : 𝕜} (ht : t ∈ Ioc (0 : 𝕜) 1) : x + t • y ∈ interior s

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
{x y : E}
(hx : x ∈ s)
(hy : x + y ∈ interior s)
{t : 𝕜}
(ht : t ∈ Set.Ioc 0 1)


theorem mem_filter_of_mem {a : α} {l} (h₁ : a ∈ l) (h₂ : p a) : a ∈ filter p l

{α : Type u}
{p : α → Bool}
{a : α}
{l : List α}
(h₁ : a ∈ l)
(h₂ : p a = true)


@[simp]
theorem map_comp {Y₁ Y₂ Y₃ : Type*} (g : Y₂ → Y₃) (f : Y₁ → Y₂) :
    @map X _ _ _ g ∘ map f = map (g ∘ f)

{X : Type u_1}
[TopologicalSpace X]
{Y₁ : Type u_5}
{Y₂ : Type u_6}
{Y₃ : Type u_7}
(g : Y₂ → Y₃)
(f : Y₁ → Y₂)

LocallyConstant.map g ∘ LocallyConstant.map f = LocallyConstant.map (g ∘ f)


theorem ite_le_natDegree_coeff (p : R[X]) (n : ℕ) (I : Decidable (n < 1 + natDegree p)) :
    @ite _ (n < 1 + natDegree p) I (coeff p n) 0 = coeff p n

{R : Type u}
[Semiring R]
(p : R[X])
(n : ℕ)
(I : Decidable (n < 1 + p.natDegree))

(if n < 1 + p.natDegree then p.coeff n else 0) = p.coeff n


theorem foldr_concat
    (f : α → β → β) (b : β) (x : α) (xs : List α) :
    List.foldr f b (xs ++ [x]) = (List.foldr f (f x b) xs)

{α : Type u}
{β : Type v}
(f : α → β → β)
(b : β)
(x : α)
(xs : List α)

List.foldr f b (xs ++ [x]) = List.foldr f (f x b) xs


@[simp]
lemma realPart_imaginaryPart {x : A} : ℜ (ℑ x : A) = ℑ x

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]
{x : A}

realPart ↑(imaginaryPart x) = imaginaryPart x


theorem cast_natAdd_right {n n' m : Nat} (i : Fin n') (h : m + n' = m + n) :
    cast h (natAdd m i) = natAdd m (cast (Nat.add_left_cancel h) i)

Fin.cast h (Fin.natAdd m i) = Fin.natAdd m (Fin.cast ⋯ i)


theorem smul_diff' (h : H) :
    diff (MonoidHom.id H) α (op (h : G) • β) = diff (MonoidHom.id H) α β * h ^ H.index

Subgroup.leftTransversals.diff (MonoidHom.id ↥H) α (MulOpposite.op ↑h • β) =
  Subgroup.leftTransversals.diff (MonoidHom.id ↥H) α β * h ^ H.index


theorem _root_.RingEquiv.map_det (f : R ≃+* S) (M : Matrix n n R) :
    f M.det = Matrix.det (f.mapMatrix M)

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{S : Type w}
[CommRing S]
(f : R ≃+* S)
(M : Matrix n n R)


theorem _root_.Set.countable_infinite_iff_nonempty_denumerable {α : Type*} {s : Set α} :
    s.Countable ∧ s.Infinite ↔ Nonempty (Denumerable s)

s.Countable ∧ s.Infinite ↔ Nonempty (Denumerable ↑s)


theorem subset_ndunion_right (s t : Multiset α) : t ⊆ ndunion s t

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


theorem toOuterMeasure_apply_eq_one_iff : p.toOuterMeasure s = 1 ↔ p.support ⊆ s


theorem lintegral_zero : ∫⁻ _ : α, 0 ∂μ = 0

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}


protected theorem IsRegular.star [Mul R] [StarMul R] {x : R} (hx : IsRegular x) :
    IsRegular (star x)

{R : Type u}
[Mul R]
[StarMul R]
{x : R}
(hx : IsRegular x)


/-- `Part.bind` as a continuous function. -/
@[simps! apply] -- Porting note: removed `(config := { rhsMd := reducible })`
noncomputable def bind {β γ : Type v} (f : α →𝒄 Part β) (g : α →𝒄 β → Part γ) : α →𝒄 Part γ

{α : Type u}
[OmegaCompletePartialOrder α]
{β γ : Type v}
(f : α →𝒄 Part β)
(g : α →𝒄 β → Part γ)
(x : α)


theorem UniformIntegrable.ae_eq {g : ι → α → β} (hf : UniformIntegrable f p μ)
    (hfg : ∀ n, f n =ᵐ[μ] g n) : UniformIntegrable g p μ

{f g : ι → α → β}

(hf : MeasureTheory.UniformIntegrable f p μ)


/-- The isomorphism `S₁.opcycles ≅ S₂.opcycles` induced by an isomorphism
of short complexes `S₁ ≅ S₂`. -/
@[simps]
noncomputable def opcyclesMapIso (e : S₁ ≅ S₂) [S₁.HasRightHomology]
    [S₂.HasRightHomology] : S₁.opcycles ≅ S₂.opcycles

(CategoryTheory.ShortComplex.opcyclesMapIso e).inv = CategoryTheory.ShortComplex.opcyclesMap e.inv


/-- The equivalence between Boolean rings and Boolean algebras. This is actually an isomorphism. -/
@[simps functor inverse]
def boolRingCatEquivBoolAlg : BoolRing ≌ BoolAlg

boolRingCatEquivBoolAlg.functor = CategoryTheory.forget₂ BoolRing BoolAlg


theorem mem_center_iff {z : R} : z ∈ center R ↔ ∀ g, g * z = z * g

z ∈ Subring.center R ↔ ∀ (g : R), g * z = z * g


theorem functorPullback_pushforward_le (R : Sieve (F.obj X)) :
    (R.functorPullback F).functorPushforward F ≤ R

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

CategoryTheory.Sieve.functorPushforward F (CategoryTheory.Sieve.functorPullback F R) ≤ R


theorem CPolynomialOn.sub {s : Set E} (hf : CPolynomialOn 𝕜 f s) (hg : CPolynomialOn 𝕜 g s) :
    CPolynomialOn 𝕜 (f - g) s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{s : Set E}
(hf : CPolynomialOn 𝕜 f s)
(hg : CPolynomialOn 𝕜 g s)


lemma desc' (hS : S.Exact) {A : C} (k : S.X₂ ⟶ A) (hk : S.f ≫ k = 0) [Epi S.g] :
    ∃ (l : S.X₃ ⟶ A), S.g ≫ l = k

(hk : CategoryTheory.CategoryStruct.comp S.f k = 0)

∃ l, CategoryTheory.CategoryStruct.comp S.g l = k


lemma forall_ne_zero_iff (P : ℕ → Prop) :
    (∀ i, i ≠ 0 → P i) ↔ (∀ i, P (i + 1))


@[to_additive Summable.prod_symm]
theorem Multipliable.prod_symm {f : β × γ → α} (hf : Multipliable f) :
    Multipliable fun p : γ × β ↦ f p.swap

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β × γ → α}
(hf : Summable f)


@[deprecated DifferentiableOn.sub_iff_right (since := "2024-07-11")]
theorem differentiableOn_const_sub_iff (c : F) :
    DifferentiableOn 𝕜 (fun y => c - f y) s ↔ DifferentiableOn 𝕜 f s

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


@[simp] lemma nonempty_compl_of_nontrivial [Nontrivial α] (x : α) : Set.Nonempty {x}ᶜ


@[simp] theorem extractLsb_toNat (hi lo : Nat) (x : BitVec n) :
  (extractLsb hi lo x).toNat = (x.toNat >>> lo) % 2^(hi-lo+1)

(BitVec.extractLsb hi lo x).toNat = x.toNat >>> lo % 2 ^ (hi - lo + 1)


@[ext high]
theorem hom_ext_nonempty [hn : Nonempty ι]
    {f g : PushoutI φ →* K}
    (h : ∀ i, f.comp (of i : G i →* _) = g.comp (of i : G i →* _)) : f = g

(h : ∀ (i : ι), f.comp (Monoid.PushoutI.of i) = g.comp (Monoid.PushoutI.of i))


@[to_additive]
protected theorem Specializes.inv {x y : G} (h : x ⤳ y) : (x⁻¹) ⤳ (y⁻¹)

{G : Type w}
[TopologicalSpace G]
[Inv G]
[ContinuousInv G]
{x y : G}
(h : x ⤳ y)


/-- The equivalence between cubic polynomials and polynomials of degree at most three. -/
@[simps]
def equiv : Cubic R ≃ { p : R[X] // p.degree ≤ 3 }

{R : Type u_1}
[Semiring R]
(f : { p // p.degree ≤ 3 })


theorem coe_injective : Function.Injective ((↑) : LieSubalgebra R L → Set L)

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]


/-- A variant of `Matrix.det_units_conj`. -/
theorem det_conj {M : Matrix m m α} (h : IsUnit M) (N : Matrix m m α) :
    det (M * N * M⁻¹) = det N

{m : Type u}
{α : Type v}
[Fintype m]
[DecidableEq m]
[CommRing α]
{M : Matrix m m α}
(h : IsUnit M)
(N : Matrix m m α)


theorem RingHom.map_iterate_frobenius (n : ℕ) :
    g ((frobenius R p)^[n] x) = (frobenius S p)^[n] (g x)

{R : Type u}
[CommSemiring R]
{S : Type u_1}
[CommSemiring S]
(g : R →+* S)
(p : ℕ)
[ExpChar R p]
[ExpChar S p]
(x : R)
(n : ℕ)

g ((⇑(frobenius R p))^[n] x) = (⇑(frobenius S p))^[n] (g x)


/-- (Implementation Detail) The glue data associated to a disjoint union. -/
@[simps]
noncomputable
def disjointGlueData' : GlueData' Scheme

{ι : Type u}
(f : ι → AlgebraicGeometry.Scheme)

∀ (x x_1 : ι) (x_2 : x ≠ x_1), (AlgebraicGeometry.disjointGlueData' f).f x x_1 x_2 = (f x).emptyTo


/-- `C` has biproducts of shape `J` if we have
a limit and a colimit, with the same cone points,
of every function `F : J → C`.
-/
class HasBiproductsOfShape : Prop where
  has_biproduct : ∀ F : J → C, HasBiproduct F

[self : CategoryTheory.Limits.HasBiproductsOfShape J C]


@[simp]
lemma d_comp_ofHoms_v (ψ : ∀ (p : ℤ), F.X p ⟶ G.X p) (p' p q : ℤ) (hpq : p + 0 = q) :
    F.d p' p ≫ (ofHoms ψ).v p q hpq = F.d p' q ≫ ψ q

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{F G : CochainComplex C ℤ}
(ψ : (p : ℤ) → F.X p ⟶ G.X p)
(p' p q : ℤ)
(hpq : p + 0 = q)

F.d p' p ≫ (CochainComplex.HomComplex.Cochain.ofHoms ψ).v p q hpq = F.d p' q ≫ ψ q


@[simp] theorem toNat_eq_zero (b : Bool) : b.toNat = 0 ↔ b = false


@[simp]
theorem _root_.PredOrder.limitRecOn_limit (ha : IsPredLimit a) :
    PredOrder.limitRecOn a H_pred H_lim
      = H_lim a ha fun x _ ↦ PredOrder.limitRecOn x H_pred H_lim

(H_pred : (a : α) → ¬IsMin a → C a → C (Order.pred a))

(H_lim : (a : α) → Order.IsPredLimit a → ((b : α) → b > a → C b) → C a)

PredOrder.limitRecOn a H_pred H_lim = H_lim a ha fun x x_1 => PredOrder.limitRecOn x H_pred H_lim


@[to_additive]
theorem eq_inv_mul_of_mul_eq (h : b * a = c) : a = b⁻¹ * c

{G : Type u_3}
[Group G]
{a b c : G}
(h : b * a = c)


@[simp] theorem rev_bot [NeZero n] : rev (⊥ : Fin n) = ⊤


@[to_additive] lemma oneLePart_mul_leOnePart (a : α) : a⁺ᵐ * a⁻ᵐ = |a|ₘ

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

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


lemma pow (n : ℕ) : MeromorphicOn (s ^ n) U

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{s : 𝕜 → 𝕜}
{U : Set 𝕜}
(hs : MeromorphicOn s U)
(n : ℕ)


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

If an equicontinuous family of continuous functions is compact in the pointwise topology, then it
is compact in the compact open topology. -/
theorem ArzelaAscoli.isCompact_of_equicontinuous
    (S : Set C(X, α)) (hS1 : IsCompact (ContinuousMap.toFun '' S))
    (hS2 : Equicontinuous ((↑) : S → X → α)) : IsCompact S


@[simp]
theorem add_right [Distrib R] {a b c : R} : Commute a b → Commute a c → Commute a (b + c)


/-- If `g` has a closable extension `f`, then `g` itself is closable. -/
theorem IsClosable.leIsClosable {f g : E →ₗ.[R] F} (hf : f.IsClosable) (hfg : g ≤ f) :
    g.IsClosable

{R : Type u_1}
{E : Type u_2}
{F : Type u_3}
[CommRing R]
[AddCommGroup E]
[AddCommGroup F]
[Module R E]
[Module R F]
[TopologicalSpace E]
[TopologicalSpace F]
[ContinuousAdd E]
[ContinuousAdd F]
[TopologicalSpace R]
[ContinuousSMul R E]
[ContinuousSMul R F]
{f g : E →ₗ.[R] F}
(hf : f.IsClosable)
(hfg : g ≤ f)


@[simp]
theorem mk_option {α : Type u} : #(Option α) = #α + 1

Cardinal.mk (Option α) = Cardinal.mk α + 1


@[simp]
theorem sigmaUncurry_apply (f : ⨁ (i) (j), δ i j) (i : ι) (j : α i) :
    sigmaUncurry f ⟨i, j⟩ = f i j

[(i : ι) → (j : α i) → AddCommMonoid (δ i j)]

(f : DirectSum ι fun i => DirectSum (α i) fun j => δ i j)

(DirectSum.sigmaUncurry f) ⟨i, j⟩ = (f i) j


@[simp]
theorem _root_.AddMonoidHom.coe_toIntLinearMap_ker {M M₂ : Type*} [AddCommGroup M] [AddCommGroup M₂]
    (f : M →+ M₂) : LinearMap.ker f.toIntLinearMap = AddSubgroup.toIntSubmodule f.ker

{M : Type u_13}
{M₂ : Type u_14}
[AddCommGroup M]
[AddCommGroup M₂]
(f : M →+ M₂)


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

(R : Type uR)
(A : Type uA)
[CommSemiring R]
[Semiring A]
[Algebra R A]


theorem norm_self_mul_star {x : E} : ‖x * x⋆‖ = ‖x‖ * ‖x‖

{E : Type u_2}
[NonUnitalNormedRing E]
[StarRing E]
[CstarRing E]
{x : E}

‖x * x⋆‖ = ‖x‖ * ‖x‖


@[reassoc (attr := simp)]
theorem toPlus_plusLift {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (hQ : Presheaf.IsSheaf J Q) :
    J.toPlus P ≫ J.plusLift η hQ = η

(J : CategoryTheory.GrothendieckTopology C)

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

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

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

(hQ : CategoryTheory.Presheaf.IsSheaf J Q)

CategoryTheory.CategoryStruct.comp (J.toPlus P) (J.plusLift η hQ) = η


@[simp]
theorem prod'_toFunctor : (F.prod' G).toFunctor = F.toFunctor.prod' G.toFunctor

(F : CategoryTheory.LaxMonoidalFunctor C D)

(G : CategoryTheory.LaxMonoidalFunctor C E)

(F.prod' G).toFunctor = F.prod' G.toFunctor


@[to_additive] lemma zpow_zpow_self : Commute (a ^ m) (a ^ n)

{G : Type u_1}
[Group G]
(a : G)
(m n : ℤ)


theorem exists_seq_tendsto_sSup {α : Type*} [ConditionallyCompleteLinearOrder α]
    [TopologicalSpace α] [OrderTopology α] [FirstCountableTopology α] {S : Set α} (hS : S.Nonempty)
    (hS' : BddAbove S) : ∃ u : ℕ → α, Monotone u ∧ Tendsto u atTop (𝓝 (sSup S)) ∧ ∀ n, u n ∈ S

{α : Type u_4}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[FirstCountableTopology α]
{S : Set α}
(hS : S.Nonempty)
(hS' : BddAbove S)

∃ u, Monotone u ∧ Filter.Tendsto u Filter.atTop (𝓝 (sSup S)) ∧ ∀ (n : ℕ), u n ∈ S


@[simp]
theorem interior_Icc [NoMinOrder α] [NoMaxOrder α] {a b : α} : interior (Icc a b) = Ioo a b

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMinOrder α]
[NoMaxOrder α]
{a b : α}


@[simp]
theorem ker_toContinuousLinearMap (f : E →ₗ[𝕜] F') :
    ker (LinearMap.toContinuousLinearMap f) = ker f

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
{F' : Type x}
[AddCommGroup F']
[Module 𝕜 F']
[TopologicalSpace F']
[TopologicalAddGroup F']
[ContinuousSMul 𝕜 F']
[CompleteSpace 𝕜]
[T2Space E]
[FiniteDimensional 𝕜 E]
(f : E →ₗ[𝕜] F')

LinearMap.ker (LinearMap.toContinuousLinearMap f) = LinearMap.ker f


/-- Composing a `Prod.map` with another `Prod.map` is equal to
a single `Prod.map` of composed functions.
-/
theorem map_comp_map {ε ζ : Type*} (f : α → β) (f' : γ → δ) (g : β → ε) (g' : δ → ζ) :
    Prod.map g g' ∘ Prod.map f f' = Prod.map (g ∘ f) (g' ∘ f')

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{ε : Type u_5}
{ζ : Type u_6}
(f : α → β)
(f' : γ → δ)
(g : β → ε)
(g' : δ → ζ)


/-- The zeroth modified cyclotomic polyomial is `1`. -/
@[simp]
theorem cyclotomic'_zero (R : Type*) [CommRing R] [IsDomain R] : cyclotomic' 0 R = 1

(R : Type u_2)
[CommRing R]
[IsDomain R]


theorem forall_iff_forall_tuple {P : List α → Prop} :
    (∀ l : List α, P l) ↔ ∀ (n) (f : Fin n → α), P (List.ofFn f)

(∀ (l : List α), P l) ↔ ∀ (n : ℕ) (f : Fin n → α), P (List.ofFn f)


/-- **Poisson's summation formula**, assuming that `f` decays as
`|x| ^ (-b)` for some `1 < b` and its Fourier transform is summable. -/
theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable {f : ℝ → ℂ} (hc : Continuous f)
    {b : ℝ} (hb : 1 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b))
    (hFf : Summable fun n : ℤ => 𝓕 f n) (x : ℝ) :
    ∑' n : ℤ, f (x + n) = ∑' n : ℤ, 𝓕 f n * fourier n (x : UnitAddCircle)

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

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


/-- Isomorphic objects have equivalent `MonoOver` categories.
-/
@[simps]
def mapIso {A B : C} (e : A ≅ B) : MonoOver A ≌ MonoOver B

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{A B : C}
(e : A ≅ B)

(CategoryTheory.MonoOver.mapIso e).functor = CategoryTheory.MonoOver.map e.hom


@[to_additive (attr := simp)]
theorem inr_apply (y) : inr M N y = (1, y)

{M : Type u_5}
{N : Type u_6}
[MulOneClass M]
[MulOneClass N]
(y : N)


@[simp]
theorem Continuous.connectedComponentsLift_comp_coe (h : Continuous f) :
    h.connectedComponentsLift ∘ (↑) = f

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[TotallyDisconnectedSpace β]
{f : α → β}
(h : Continuous f)

h.connectedComponentsLift ∘ ConnectedComponents.mk = f


@[to_additive]
theorem copy_eq (K : Subgroup G) (s : Set G) (hs : s = ↑K) : K.copy s hs = K

{G : Type u_1}
[Group G]
(K : Subgroup G)
(s : Set G)
(hs : s = ↑K)


theorem symm_image_eq (h : e.IsImage s t) : e.symm '' (e.target ∩ t) = e.source ∩ s

{α : Type u_1}
{β : Type u_2}
{e : PartialEquiv α β}
{s : Set α}
{t : Set β}
(h : e.IsImage s t)

↑e.symm '' (e.target ∩ t) = e.source ∩ s


@[to_additive]
theorem eq_top_iff' : H = ⊤ ↔ ∀ x : G, x ∈ H

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


theorem hasLimitsOfShape_of_initial [HasLimitsOfShape C E] : HasLimitsOfShape D E


/-- The determinant of the change-of-basis matrix between two orthonormal bases `a`, `b` has
unit length. -/
@[simp]
theorem OrthonormalBasis.det_to_matrix_orthonormalBasis : ‖a.toBasis.det b‖ = 1

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
{E : Type u_4}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[Fintype ι]
[DecidableEq ι]
(a b : OrthonormalBasis ι 𝕜 E)


/-- The functor `Comma L R ⥤ Comma L R` induced by the identity natural transformation on `L` is
    naturally isomorphic to the identity functor. -/
@[simps!]
def mapLeftId : mapLeft R (𝟙 L) ≅ 𝟭 _

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
(R : CategoryTheory.Functor B T)
(X : CategoryTheory.Comma L R)

((CategoryTheory.Comma.mapLeftId L R).hom.app X).right = CategoryTheory.CategoryStruct.id X.right


theorem mem_sections_length {L : List (List α)} {f} (h : f ∈ sections L) : length f = length L

{α : Type u_1}
{L : List (List α)}
{f : List α}
(h : f ∈ L.sections)


theorem quotientToQuotientRangePowQuotSucc_mk {i : ℕ} {a : S} (a_mem : a ∈ P ^ i) (x : S) :
    quotientToQuotientRangePowQuotSucc f p P a_mem (Submodule.Quotient.mk x) =
      Submodule.Quotient.mk ⟨_, Ideal.mem_map_of_mem _ (Ideal.mul_mem_right x _ a_mem)⟩

[hfp : NeZero (Ideal.ramificationIdx f p P)]

(Ideal.quotientToQuotientRangePowQuotSucc f p P a_mem) (Submodule.Quotient.mk x) =
  Submodule.Quotient.mk ⟨(Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (a * x), ⋯⟩


theorem preimage_symm (h : α ≃ᵤ β) : preimage h.symm = image h

{α : Type u}
{β : Type u_1}
[UniformSpace α]
[UniformSpace β]
(h : α ≃ᵤ β)


@[to_additive (attr := simp)]
theorem mul_eq_one : a * b = 1 ↔ a = 1 ∧ b = 1

{α : Type u}
[AddCommMonoid α]
[Subsingleton (AddUnits α)]
{a b : α}


@[simp] theorem sub_re : (a - b).re = a.re - b.re

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


@[simp] theorem isPWO_of_finite [Finite α] : s.IsPWO

{α : Type u_2}
[Preorder α]
{s : Set α}
[Finite α]


/-- A `StrongFEPair` structure with `f = oddKernel a` and `g = sinKernel a`. -/
@[simps]
def hurwitzOddFEPair (a : UnitAddCircle) : StrongFEPair ℂ

(HurwitzZeta.hurwitzOddFEPair a).k = 3 / 2


protected theorem map {n f} {g : Vector ℕ (n + 1) → ℕ} (hf : @Partrec' n f)
    (hg : @Partrec' (n + 1) g) : @Partrec' n fun v => (f v).map fun a => g (a ::ᵥ v)

{n : ℕ}
{f : Mathlib.Vector ℕ n →. ℕ}
{g : Mathlib.Vector ℕ (n + 1) → ℕ}
(hf : Nat.Partrec' f)
(hg : Nat.Partrec' ↑g)

Nat.Partrec' fun v => Part.map (fun a => g (a ::ᵥ v)) (f v)


theorem mem_or_mem_of_zipWith_swap_prod_ne : ∀ {l l' : List α} {x : α},
    (zipWith swap l l').prod x ≠ x → x ∈ l ∨ x ∈ l'

{α : Type u_1}
[DecidableEq α]
{l l' : List α}
{x : α}

(List.zipWith Equiv.swap l l').prod x ≠ x → x ∈ l ∨ x ∈ l'


@[simp]
theorem closure_image (f : M →[L] N) : closure L (f '' s) = map f (closure L s)

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{s : Set M}
(f : L.Hom M N)

(FirstOrder.Language.Substructure.closure L).toFun (⇑f '' s) =
  FirstOrder.Language.Substructure.map f ((FirstOrder.Language.Substructure.closure L).toFun s)


theorem lift_sub_lift {X Y : C} (a b c d : X ⟶ Y) :
    prod.lift a b - prod.lift c d = prod.lift (a - c) (b - d)

CategoryTheory.Limits.prod.lift a b - CategoryTheory.Limits.prod.lift c d =
  CategoryTheory.Limits.prod.lift (a - c) (b - d)


@[simp]
theorem mem_pure' {a b : α} : a ∈ Semiquot.pure b ↔ a = b


¬a ∉ s ↔ a ∈ s


/-- The contrapositive of `List.nodup_iff_sublist`. -/
theorem duplicate_iff_sublist : x ∈+ l ↔ [x, x] <+ l


theorem Base.exists_insert_of_ssubset (hB : M.Base B) (hIB : I ⊂ B) (hB' : M.Base B') :
    ∃ e ∈ B' \ I, M.Indep (insert e I)

{α : Type u_1}
{M : Matroid α}
{B B' I : Set α}
(hB : M.Base B)
(hIB : I ⊂ B)
(hB' : M.Base B')


/-- The separable degree of a finite extension `E / F` is smaller than the degree of `E / F`. -/
theorem finSepDegree_le_finrank [FiniteDimensional F E] :
    finSepDegree F E ≤ finrank F E

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

Field.finSepDegree F E ≤ FiniteDimensional.finrank F E


theorem HeapNode.WF.rank_eq : ∀ {n} {s : HeapNode α}, s.WF le a n → s.rank = n

{s : Batteries.BinomialHeap.Imp.HeapNode α}

Batteries.BinomialHeap.Imp.HeapNode.WF le a s n → s.rank = n


@[reassoc (attr := simp)]
theorem equalizerSubobject_arrow' :
    (equalizerSubobjectIso f g).inv ≫ (equalizerSubobject f g).arrow = equalizer.ι f g

(CategoryTheory.Limits.equalizerSubobjectIso f g).inv ≫ (CategoryTheory.Limits.equalizerSubobject f g).arrow =
  CategoryTheory.Limits.equalizer.ι f g


theorem abs_im_le_abs (z : ℂ) : |z.im| ≤ Complex.abs z


theorem mulLeftMap_eq_mulRightMap {S : Type*} [CommSemiring S] [Module R S] [SMulCommClass R R S]
    [SMulCommClass R S S] [IsScalarTower R S S] {M : Submodule R S} (N : Submodule R S)
    {ι : Type*} (m : ι → M) : mulLeftMap N m = mulRightMap N m

{R : Type u_1}
[Semiring R]
{S : Type u_5}
[CommSemiring S]
[Module R S]
[SMulCommClass R R S]
[SMulCommClass R S S]
[IsScalarTower R S S]
{M : Submodule R S}
(N : Submodule R S)
{ι : Type u_6}
(m : ι → ↥M)

Submodule.mulLeftMap N m = N.mulRightMap m


theorem Sieve.effectiveEpimorphic_family {B : C} {α : Type*}
    (X : α → C) (π : (a : α) → (X a ⟶ B)) :
    (Presieve.ofArrows X π).EffectiveEpimorphic ↔ EffectiveEpiFamily X π

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{B : C}
{α : Type u_2}
(X : α → C)
(π : (a : α) → X a ⟶ B)

(CategoryTheory.Presieve.ofArrows X π).EffectiveEpimorphic ↔ CategoryTheory.EffectiveEpiFamily X π


/-- A real-valued function on a finite-dimensional space which is Lipschitz on a set is
differentiable almost everywere in this set. Superseded by
`LipschitzOnWith.ae_differentiableWithinAt_of_mem` which works for functions taking value in any
finite-dimensional space. -/
theorem ae_differentiableWithinAt_of_mem_of_real (hf : LipschitzOnWith C f s) :
    ∀ᵐ x ∂μ, x ∈ s → DifferentiableWithinAt ℝ f s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
{C : ℝ≥0}
{f : E → ℝ}
{s : Set E}
{μ : MeasureTheory.Measure E}
[μ.IsAddHaarMeasure]
(hf : LipschitzOnWith C f s)

∀ᵐ (x : E) ∂μ, x ∈ s → DifferentiableWithinAt ℝ f s x


/-- Pull an opposite submonoid back to a submonoid along `MulOpposite.op`-/
@[to_additive (attr := simps) "Pull an opposite additive submonoid back to a submonoid along
`AddOpposite.op`"]
protected def unop (x : Submonoid Mᵐᵒᵖ) : Submonoid M

{M : Type u_2}
[AddZeroClass M]
(x : AddSubmonoid Mᵃᵒᵖ)


@[simp]
theorem det_fromBlocks_one₁₁ (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) :
    (Matrix.fromBlocks 1 B C D).det = det (D - C * B)

{m : Type u_2}
{n : Type u_3}
{α : Type u_4}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing α]
(B : Matrix m n α)
(C : Matrix n m α)
(D : Matrix n n α)

(Matrix.fromBlocks 1 B C D).det = (D - C * B).det


/-- The base function from which one will construct a family of bump functions. One could
add more properties if they are useful and satisfied in the examples of inner product spaces
and finite dimensional vector spaces, notably derivative norm control in terms of `R - 1`.

TODO: do we ever need `f x = 1 ↔ ‖x‖ ≤ 1`? -/
-- Porting note(#5171): linter not yet ported; was @[nolint has_nonempty_instance]
structure ContDiffBumpBase (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] where
  /-- The function underlying this family of bump functions -/
  toFun : ℝ → E → ℝ
  mem_Icc : ∀ (R : ℝ) (x : E), toFun R x ∈ Icc (0 : ℝ) 1
  symmetric : ∀ (R : ℝ) (x : E), toFun R (-x) = toFun R x
  smooth : ContDiffOn ℝ ⊤ (uncurry toFun) (Ioi (1 : ℝ) ×ˢ (univ : Set E))
  eq_one : ∀ R : ℝ, 1 < R → ∀ x : E, ‖x‖ ≤ 1 → toFun R x = 1
  support : ∀ R : ℝ, 1 < R → Function.support (toFun R) = Metric.ball (0 : E) R

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(self : ContDiffBumpBase E)
(R : ℝ)

1 < R → Function.support (self.toFun R) = Metric.ball 0 R


@[to_additive]
theorem finprod_mem_eq_prod_of_subset (f : α → M) {s : Set α} {t : Finset α}
    (h₁ : s ∩ mulSupport f ⊆ t) (h₂ : ↑t ⊆ s) : ∏ᶠ i ∈ s, f i = ∏ i ∈ t, f i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
(f : α → M)
{s : Set α}
{t : Finset α}
(h₁ : s ∩ Function.support f ⊆ ↑t)
(h₂ : ↑t ⊆ s)

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


@[simp]
lemma of_counit {X : Type v} [Ring X] [HopfAlgebra R X] :
    Coalgebra.counit (A := of R X) = Coalgebra.counit (R := R) (A := X)

{R : Type u}
[CommRing R]
{X : Type v}
[Ring X]
[HopfAlgebra R X]


lemma Pi.isCompact_iff {ι : Type*} {π : ι → Type*} [∀ i, TopologicalSpace (π i)]
    [∀ i, T2Space (π i)] {s : Set (Π i, π i)} :
    IsCompact s ↔ IsClosed s ∧ ∀ i, IsCompact (eval i '' s)

{ι : Type u_4}
{π : ι → Type u_5}
[(i : ι) → TopologicalSpace (π i)]
[∀ (i : ι), T2Space (π i)]
{s : Set ((i : ι) → π i)}

IsCompact s ↔ IsClosed s ∧ ∀ (i : ι), IsCompact (Function.eval i '' s)


theorem toNNRat_mul (hp : 0 ≤ p) : toNNRat (p * q) = toNNRat p * toNNRat q


lemma supClosed_sInter (hS : ∀ s ∈ S, SupClosed s) : SupClosed (⋂₀ S)

{α : Type u_2}
[SemilatticeSup α]
{S : Set (Set α)}
(hS : ∀ s ∈ S, SupClosed s)


lemma FinitaryExtensive.isPullback_initial_to [FinitaryExtensive C]
    {ι : Type*} [Finite ι] {F : Discrete ι ⥤ C}
    {c : Cocone F} (hc : IsColimit c) (i j : Discrete ι) (e : i ≠ j) :
    IsPullback (initial.to _) (initial.to _) (c.ι.app i) (c.ι.app j)

{F : CategoryTheory.Functor (CategoryTheory.Discrete ι) C}

(hc : CategoryTheory.Limits.IsColimit c)

CategoryTheory.IsPullback (CategoryTheory.Limits.initial.to (F.obj i)) (CategoryTheory.Limits.initial.to (F.obj j))
  (c.ι.app i) (c.ι.app j)


@[to_additive]
theorem Nonempty.div : s.Nonempty → t.Nonempty → (s / t).Nonempty


theorem eval_apply_injective : Function.Injective (eval K V)

(K : Type uK)
{V : Type uV}
[CommRing K]
[AddCommGroup V]
[Module K V]
[Module.Free K V]

Function.Injective ⇑(Module.Dual.eval K V)


@[simp] lemma coe_algebraMap_apply (x : K) : ↑(algebraMap K S x) = algebraMap K L x

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
(x : K)

↑((algebraMap K ↥S) x) = (algebraMap K L) x


/-- The point of the augmentation. -/
@[simps!]
def point : Augmented C ⥤ C

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

∀ {X Y : CategoryTheory.Comma (𝟭 (CategoryTheory.SimplicialObject C)) (CategoryTheory.SimplicialObject.const C)}
  (f : X ⟶ Y), CategoryTheory.SimplicialObject.Augmented.point.map f = f.right


theorem Convex.exists_mem_add_smul_eq (h : Convex 𝕜 s) {x y : E} {p q : 𝕜} (hx : x ∈ s) (hy : y ∈ s)
    (hp : 0 ≤ p) (hq : 0 ≤ q) : ∃ z ∈ s, (p + q) • z = p • x + q • y

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(h : Convex 𝕜 s)
{x y : E}
{p q : 𝕜}
(hx : x ∈ s)
(hy : y ∈ s)
(hp : 0 ≤ p)
(hq : 0 ≤ q)


/-- Given a smooth bump function `f : SmoothBumpFunction I c`, the closed ball of radius `f.R` is
known to include the support of `f`. These closed balls (in the model normed space `E`) intersected
with `Set.range I` form a basis of `𝓝[range I] (extChartAt I c c)`. -/
theorem nhdsWithin_range_basis :
    (𝓝[range I] extChartAt I c c).HasBasis (fun _ : SmoothBumpFunction I c => True) fun f =>
      closedBall (extChartAt I c c) f.rOut ∩ range I

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}

(𝓝[Set.range ↑I] ↑(extChartAt I c) c).HasBasis (fun x => True) fun f =>
  Metric.closedBall (↑(extChartAt I c) c) f.rOut ∩ Set.range ↑I


/-- If the signs of two nondegenerate oriented angles between points are equal, the oriented
angles are equal if and only if the unoriented angles are equal. -/
theorem angle_eq_iff_oangle_eq_of_sign_eq {p₁ p₂ p₃ p₄ p₅ p₆ : P} (hp₁ : p₁ ≠ p₂) (hp₃ : p₃ ≠ p₂)
    (hp₄ : p₄ ≠ p₅) (hp₆ : p₆ ≠ p₅) (hs : (∡ p₁ p₂ p₃).sign = (∡ p₄ p₅ p₆).sign) :
    ∠ p₁ p₂ p₃ = ∠ p₄ p₅ p₆ ↔ ∡ p₁ p₂ p₃ = ∡ p₄ p₅ p₆

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


theorem ciInf_le_of_le {f : ι → α} (H : BddBelow (range f)) (c : ι) (h : f c ≤ a) : iInf f ≤ a

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
{a : α}
{f : ι → α}
(H : BddBelow (Set.range f))
(c : ι)
(h : f c ≤ a)


/-- Composing a basis with a linear equiv gives the negation of that orientation if and only if
the determinant is negative. -/
theorem orientation_comp_linearEquiv_eq_neg_iff_det_neg (e : Basis ι R M) (f : M ≃ₗ[R] M) :
    (e.map f).orientation = -e.orientation ↔ LinearMap.det (f : M →ₗ[R] M) < 0

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_3}
[Fintype ι]
[DecidableEq ι]
(e : Basis ι R M)
(f : M ≃ₗ[R] M)

(e.map f).orientation = -e.orientation ↔ LinearMap.det ↑f < 0


lemma chainTopCoeff_zero_right [Nontrivial L] :
    chainTopCoeff α (0 : Weight K H L) = 1

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
(α : LieModule.Weight K (↥H) L)
(hα : α.IsNonZero)
[Nontrivial L]


/-- The **extreme value theorem**: if a continuous function `f` tends to infinity away from compact
sets, then it has a global minimum. -/
theorem Continuous.exists_forall_le [ClosedIicTopology α] [Nonempty β] {f : β → α}
    (hf : Continuous f) (hlim : Tendsto f (cocompact β) atTop) : ∃ x, ∀ y, f x ≤ f y

(hlim : Filter.Tendsto f (Filter.cocompact β) Filter.atTop)


theorem unop_iInf (S : ι → Subring Rᵐᵒᵖ) : (iInf S).unop = ⨅ i, (S i).unop

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


@[to_additive] lemma zpow_le_zpow_iff' (hn : 0 < n) : a ^ n ≤ b ^ n ↔ a ≤ b

{α : Type u_1}
[LinearOrderedCommGroup α]
{n : ℤ}
{a b : α}
(hn : 0 < n)


@[simp]
theorem Fintype.univ_bool : @univ Bool _ = {true, false}


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


@[simp]
theorem volume_fundamentalDomain [Fintype ι] [DecidableEq ι] (b : Basis ι ℝ (ι → ℝ)) :
    volume (fundamentalDomain b) = ENNReal.ofReal |(Matrix.of b).det|

{ι : Type u_2}
[Fintype ι]
[DecidableEq ι]
(b : Basis ι ℝ (ι → ℝ))

MeasureTheory.volume (Zspan.fundamentalDomain b) = ENNReal.ofReal |(Matrix.of ⇑b).det|


theorem sign_surjective [Nontrivial α] : Function.Surjective (sign : Perm α → ℤˣ)

(α : Type u)
[DecidableEq α]
[Fintype α]
[Nontrivial α]


@[simp]
lemma totallyBounded_singleton (a : α) : TotallyBounded {a}

{α : Type u}
[uniformSpace : UniformSpace α]
(a : α)


lemma negDblY_of_Z_ne_zero {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q)
    (hPz : P z ≠ 0) (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2)
    (hy : P y * Q z ^ 3 ≠ W.negY Q * P z ^ 3) : W.negDblY P / W.dblZ P ^ 3 =
    W.toAffine.negAddY (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))


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the left side and `g` on the right side. -/
@[simps!]
def fromArrowArrowFunctor : Arrow (Arrow C) ⥤ Square C

(f : CategoryTheory.Arrow (CategoryTheory.Arrow C))

(CategoryTheory.Square.fromArrowArrowFunctor.obj f).f₂₄ = f.right.hom


@[simp] lemma toSubspace_isMono {l : Line (η → α) ι} {C : (ι × η → α) → κ} :
    l.toSubspace.IsMono C ↔ l.IsMono fun x : ι → η → α  ↦ C fun (i, e) ↦ x i e

{η : Type u_1}
{α : Type u_2}
{ι : Type u_3}
{κ : Type u_4}
{l : Combinatorics.Line (η → α) ι}
{C : (ι × η → α) → κ}

Combinatorics.Subspace.IsMono C l.toSubspace ↔
  Combinatorics.Line.IsMono
    (fun x =>
      C fun x_1 =>
        match x_1 with
        | (i, e) => x i e)
    l


@[simp]
theorem toOuterMeasure_ofMultiset_apply :
    (ofMultiset s hs).toOuterMeasure t =
      (∑' x, (s.filter (· ∈ t)).count x : ℝ≥0∞) / (Multiset.card s)

{α : Type u_1}
{s : Multiset α}
(hs : s ≠ 0)
(t : Set α)

(PMF.ofMultiset s hs).toOuterMeasure t =
  (∑' (x : α), ↑(Multiset.count x (Multiset.filter (fun x => x ∈ t) s))) / ↑(Multiset.card s)


theorem ExactFunctor.forget_obj_of (F : C ⥤ D) [PreservesFiniteLimits F]
    [PreservesFiniteColimits F] : (ExactFunctor.forget C D).obj (ExactFunctor.of F) = F

(CategoryTheory.ExactFunctor.forget C D).obj (CategoryTheory.ExactFunctor.of F) = F


@[to_additive (attr := simp)]
lemma mabs_apply (f : C(α, β)) (x : α) : |f|ₘ x = |f x|ₘ

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[TopologicalSpace β]
[AddGroup β]
[TopologicalAddGroup β]
[Lattice β]
[TopologicalLattice β]
(f : C(α, β))
(x : α)


@[simp] theorem cast_castSucc {n' : Nat} {h : n + 1 = n' + 1} {i : Fin n} :
    cast h (castSucc i) = castSucc (cast (Nat.succ.inj h) i)

Fin.cast h i.castSucc = (Fin.cast ⋯ i).castSucc


@[simp]
theorem star_natCast_smul [Semiring R] [AddCommMonoid M] [Module R M] [StarAddMonoid M] (n : ℕ)
    (x : M) : star ((n : R) • x) = (n : R) • star x

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[StarAddMonoid M]
(n : ℕ)
(x : M)


theorem Nodup.of_append_left : Nodup (l₁ ++ l₂) → Nodup l₁


@[simp]
theorem map_symmDiff (a b : α) : f (a ∆ b) = f a ∆ f b

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[FunLike F α β]
[CoheytingAlgebra α]
[CoheytingAlgebra β]
[CoheytingHomClass F α β]
(f : F)
(a b : α)


theorem iInf_inf_eq : ⨅ x, f x ⊓ g x = (⨅ x, f x) ⊓ ⨅ x, g x

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{f g : ι → α}


@[measurability]
theorem AEMeasurable.inf (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    AEMeasurable (fun a => f a ⊓ g a) μ

{M : Type u_1}
[MeasurableSpace M]
{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → M}
[Inf M]
[MeasurableInf₂ M]
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


theorem dirac_prod (x : α) : (dirac x).prod ν = map (Prod.mk x) ν

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
(x : α)

(MeasureTheory.Measure.dirac x).prod ν = MeasureTheory.Measure.map (Prod.mk x) ν


theorem lintegral_map {β} [MeasurableSpace β] (g : β →ₛ ℝ≥0∞) {f : α → β} (hf : Measurable f) :
    g.lintegral (Measure.map f μ) = (g.comp f hf).lintegral μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type u_5}
[MeasurableSpace β]
(g : MeasureTheory.SimpleFunc β ℝ≥0∞)
{f : α → β}
(hf : Measurable f)

g.lintegral (MeasureTheory.Measure.map f μ) = (g.comp f hf).lintegral μ


@[simp]
theorem coe_zero : ⇑(0 : ModularForm Γ k) = (0 : ℍ → ℂ)


theorem IntegrableOn.left_of_union (h : IntegrableOn f (s ∪ t) μ) : IntegrableOn f s μ

(h : MeasureTheory.IntegrableOn f (s ∪ t) μ)


theorem has_iUnion {β} [Countable β] {f : β → Set α} (hd : Pairwise (Disjoint on f))
    (h : ∀ i, d.Has (f i)) : d.Has (⋃ i, f i)

{α : Type u_1}
(d : MeasurableSpace.DynkinSystem α)
{β : Type u_2}
[Countable β]
{f : β → Set α}
(hd : Pairwise (Disjoint on f))
(h : ∀ (i : β), d.Has (f i))


/-- **Helly's theorem** for families of compact convex sets in its classical form.

If `F` is a (possibly infinite) family of more than `d + 1` compact convex sets in a vector space of
finite dimension `d`, and any `d + 1` sets of `F` intersect nontrivially,
then all sets of `F` intersect nontrivially. -/
theorem helly_theorem_compact [TopologicalSpace E] [T2Space E] {F : ι → Set E}
    (h_card : finrank 𝕜 E + 1 ≤ PartENat.card ι)
    (h_convex : ∀ i, Convex 𝕜 (F i)) (h_compact : ∀ i, IsCompact (F i))
    (h_inter : ∀ I : Finset ι, I.card = finrank 𝕜 E + 1 → (⋂ i ∈ I, F i).Nonempty) :
    (⋂ i, F i).Nonempty

(h_card : ↑(FiniteDimensional.finrank 𝕜 E) + 1 ≤ PartENat.card ι)

(h_compact : ∀ (i : ι), IsCompact (F i))

(h_inter : ∀ (I : Finset ι), I.card = FiniteDimensional.finrank 𝕜 E + 1 → (⋂ i ∈ I, F i).Nonempty)


@[simp]
theorem Q_apply (v : R × R) : Q c₁ c₂ v = c₁ * (v.1 * v.1) + c₂ * (v.2 * v.2)

{R : Type u_1}
[CommRing R]
(c₁ c₂ : R)
(v : R × R)

(CliffordAlgebraQuaternion.Q c₁ c₂) v = c₁ * (v.1 * v.1) + c₂ * (v.2 * v.2)


/-- Characterization of C^n functions into a smooth vector bundle. -/
theorem contMDiffAt_totalSpace (f : M → TotalSpace F E) (x₀ : M) :
    ContMDiffAt IM (IB.prod 𝓘(𝕜, F)) n f x₀ ↔
      ContMDiffAt IM IB n (fun x => (f x).proj) x₀ ∧
        ContMDiffAt IM 𝓘(𝕜, F) n (fun x => (trivializationAt F E (f x₀).proj (f x)).2) x₀

[TopologicalSpace (Bundle.TotalSpace F E)]

ContMDiffAt IM (IB.prod 𝓘(𝕜, F)) n f x₀ ↔
  ContMDiffAt IM IB n (fun x => (f x).proj) x₀ ∧
    ContMDiffAt IM 𝓘(𝕜, F) n (fun x => (↑(trivializationAt F E (f x₀).proj) (f x)).2) x₀


theorem IsNormal.self_le {f} (H : IsNormal f) (a) : a ≤ f a

{f : Ordinal.{u_4} → Ordinal.{u_4}}
(H : Ordinal.IsNormal f)
(a : Ordinal.{u_4})


theorem lapMatrix_toLin'_apply_eq_zero_iff_forall_reachable (x : V → ℝ) :
    Matrix.toLin' (G.lapMatrix ℝ) x = 0 ↔ ∀ i j : V, G.Reachable i j → x i = x j

{V : Type u_1}
[Fintype V]
[DecidableEq V]
(G : SimpleGraph V)
[DecidableRel G.Adj]
(x : V → ℝ)

(Matrix.toLin' (SimpleGraph.lapMatrix ℝ G)) x = 0 ↔ ∀ (i j : V), G.Reachable i j → x i = x j


/-- Auxiliary definition for `grothendieckTypeToCat`, to speed up elaboration. -/
@[simps!]
def grothendieckTypeToCatFunctor : Grothendieck (G ⋙ typeToCat) ⥤ G.Elements

(X : CategoryTheory.Grothendieck (G.comp CategoryTheory.typeToCat))

((CategoryTheory.Grothendieck.grothendieckTypeToCatFunctor G).obj X).snd = X.fiber.as


@[simp]
theorem imK_snd_dualNumberEquiv (q : Quaternion (DualNumber R)) :
    (dualNumberEquiv q).snd.imK = q.imK.snd

{R : Type u_1}
[CommRing R]
(q : Quaternion (DualNumber R))

(TrivSqZeroExt.snd (Quaternion.dualNumberEquiv q)).imK = TrivSqZeroExt.snd q.imK


/-- The natural isomorphism `single V c j ⋙ eval V c j ≅ 𝟭 V`. -/
@[simps!]
noncomputable def singleCompEvalIsoSelf (j : ι) : single V c j ⋙ eval V c j ≅ 𝟭 V

(HomologicalComplex.singleCompEvalIsoSelf V c j).hom.app X = (HomologicalComplex.singleObjXSelf c j X).hom


@[simp]
lemma val_one : (1 : PreQuasiregular R).val = 0


@[simp]
theorem compl_ne_eq_singleton (a : α) : ({ x | x ≠ a } : Set α)ᶜ = {a}


/-- The mean value theorem on a convex set: if the derivative of a function is bounded by `C`, then
the function is `C`-Lipschitz. Version with `HasFDerivWithinAt`. -/
theorem norm_image_sub_le_of_norm_hasFDerivWithin_le
    (hf : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (bound : ∀ x ∈ s, ‖f' x‖ ≤ C) (hs : Convex ℝ s)
    (xs : x ∈ s) (ys : y ∈ s) : ‖f y - f x‖ ≤ C * ‖y - x‖


@[instance]
theorem ordConnected_singleton {α : Type*} [PartialOrder α] {a : α} :
    OrdConnected ({a} : Set α)


@[simp]
theorem IsOrtho.map_iff (f : E ≃ₗᵢ[𝕜] F) {U V : Submodule 𝕜 E} : U.map f ⟂ V.map f ↔ U ⟂ V

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
(f : E ≃ₗᵢ[𝕜] F)
{U V : Submodule 𝕜 E}

Submodule.map f U ⟂ Submodule.map f V ↔ U ⟂ V


theorem formPerm_rotate (l : List α) (h : Nodup l) (n : ℕ) :
    formPerm (l.rotate n) = formPerm l

{α : Type u_1}
[DecidableEq α]
(l : List α)
(h : l.Nodup)
(n : ℕ)


theorem upperCrossingTime_lt_nonempty (hN : 0 < N) :
    {n | upperCrossingTime a b f N n ω < N}.Nonempty

{Ω : Type u_1}
{a b : ℝ}
{f : ℕ → Ω → ℝ}
{N : ℕ}
{ω : Ω}
(hN : 0 < N)

{n | MeasureTheory.upperCrossingTime a b f N n ω < N}.Nonempty


@[simp]
lemma homAddEquiv_apply (α : Ext X Y n) : homAddEquiv α = α.hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
{X Y : C}
{n : ℕ}
[HasDerivedCategory C]
(α : CategoryTheory.Abelian.Ext X Y n)

CategoryTheory.Abelian.Ext.homAddEquiv α = α.hom


theorem union_left_comm (s₁ s₂ s₃ : Set α) : s₁ ∪ (s₂ ∪ s₃) = s₂ ∪ (s₁ ∪ s₃)


lemma nhdsWithin_Ioi_basis [NoMaxOrder α] (a : α) : (𝓝[>] a).HasBasis (a < ·) (Ioo a)

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[NoMaxOrder α]
(a : α)

(𝓝[>] a).HasBasis (fun x => a < x) (Set.Ioo a)


@[simp]
theorem coeff_restriction {p : R[X]} {n : ℕ} : ↑(coeff (restriction p) n) = coeff p n

{R : Type u}
[Ring R]
{p : R[X]}
{n : ℕ}


{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}


@[to_additive]
theorem prod_univ_add {M : Type*} [CommMonoid M] {a b : ℕ} (f : Fin (a + b) → M) :
    (∏ i : Fin (a + b), f i) = (∏ i : Fin a, f (castAdd b i)) * ∏ i : Fin b, f (natAdd a i)

{M : Type u_3}
[AddCommMonoid M]
{a b : ℕ}
(f : Fin (a + b) → M)

∑ i : Fin (a + b), f i = ∑ i : Fin a, f (Fin.castAdd b i) + ∑ i : Fin b, f (Fin.natAdd a i)


theorem lcm_dvd_lcm_mul_left [GCDMonoid α] (m n k : α) : lcm m n ∣ lcm (k * m) n

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


@[to_additive]
theorem normal_subgroupOf_iff {H K : Subgroup G} (hHK : H ≤ K) :
    (H.subgroupOf K).Normal ↔ ∀ h k, h ∈ H → k ∈ K → k * h * k⁻¹ ∈ H

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

(H.subgroupOf K).Normal ↔ ∀ (h k : G), h ∈ H → k ∈ K → k * h * k⁻¹ ∈ H


@[to_additive]
theorem le_centralizer_iff : H ≤ centralizer K ↔ K ≤ centralizer H

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

H ≤ Subgroup.centralizer ↑K ↔ K ≤ Subgroup.centralizer ↑H


@[simp]
theorem LinearMap.BilinForm.toMatrixAux_stdBasis (B : BilinForm R₂ (n → R₂)) :
    -- Porting note: had to hint the base ring even though it should be clear from context...
    BilinForm.toMatrixAux (R₂ := R₂) (fun j => stdBasis R₂ (fun _ => R₂) j 1) B =
      BilinForm.toMatrix' B

{R₂ : Type u_5}
[CommSemiring R₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(B : LinearMap.BilinForm R₂ (n → R₂))

(BilinForm.toMatrixAux fun j => (LinearMap.stdBasis R₂ (fun x => R₂) j) 1) B = LinearMap.BilinForm.toMatrix' B


theorem degree_linear_lt_degree_C_mul_X_sq (ha : a ≠ 0) :
    degree (C b * X + C c) < degree (C a * X ^ 2)

{R : Type u}
{a b c : R}
[Semiring R]
(ha : a ≠ 0)

(Polynomial.C b * Polynomial.X + Polynomial.C c).degree < (Polynomial.C a * Polynomial.X ^ 2).degree


@[to_additive]
lemma prod_ite_eq_ite_exists (p : ι → Prop) [DecidablePred p] (h : ∀ i j, p i → p j → i = j)
    (a : α) : ∏ i, ite (p i) a 1 = ite (∃ i, p i) a 1

{ι : Type u_6}
{α : Type u_8}
[Fintype ι]
[AddCommMonoid α]
(p : ι → Prop)
[DecidablePred p]
(h : ∀ (i j : ι), p i → p j → i = j)
(a : α)

(∑ i : ι, if p i then a else 0) = if ∃ i, p i then a else 0


/-- The tangent cone of a product contains the tangent cone of each factor. -/
theorem mapsTo_tangentCone_pi {ι : Type*} [DecidableEq ι] {E : ι → Type*}
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] {s : ∀ i, Set (E i)} {x : ∀ i, E i}
    {i : ι} (hi : ∀ j ≠ i, x j ∈ closure (s j)) :
    MapsTo (LinearMap.single i : E i →ₗ[𝕜] ∀ j, E j) (tangentConeAt 𝕜 (s i) (x i))
      (tangentConeAt 𝕜 (Set.pi univ s) x)

(hi : ∀ (j : ι), j ≠ i → x j ∈ closure (s j))

Set.MapsTo (⇑(LinearMap.single i)) (tangentConeAt 𝕜 (s i) (x i)) (tangentConeAt 𝕜 (Set.univ.pi s) x)


/-- A permutation of a tuple `f` is `f` sorted if and only if it is monotone. -/
theorem comp_sort_eq_comp_iff_monotone : f ∘ σ = f ∘ sort f ↔ Monotone (f ∘ σ)

{n : ℕ}
{α : Type u_1}
[LinearOrder α]
{f : Fin n → α}
{σ : Equiv.Perm (Fin n)}

f ∘ ⇑σ = f ∘ ⇑(Tuple.sort f) ↔ Monotone (f ∘ ⇑σ)


theorem IsUniform.mono {ε' : 𝕜} (h : ε ≤ ε') (hε : IsUniform G ε s t) : IsUniform G ε' s t

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε : 𝕜}
{s t : Finset α}
{ε' : 𝕜}
(h : ε ≤ ε')
(hε : G.IsUniform ε s t)


@[simp, reassoc]
lemma map_restrictFullyFaithful_counit_app (X : D) :
    iD.map ((adj.restrictFullyFaithful hiC hiD comm1 comm2).counit.app X) =
    comm1.inv.app (R.obj X) ≫ L'.map (comm2.inv.app X) ≫ adj.counit.app (iD.obj X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{C' : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C']
{D' : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D']
{iC : CategoryTheory.Functor C C'}
{iD : CategoryTheory.Functor D D'}
{L' : CategoryTheory.Functor C' D'}
{R' : CategoryTheory.Functor D' C'}
(adj : L' ⊣ R')
(hiC : iC.FullyFaithful)
(hiD : iD.FullyFaithful)
{L : CategoryTheory.Functor C D}
{R : CategoryTheory.Functor D C}
(comm1 : iC.comp L' ≅ L.comp iD)
(comm2 : iD.comp R' ≅ R.comp iC)
(X : D)

iD.map ((adj.restrictFullyFaithful hiC hiD comm1 comm2).counit.app X) =
  CategoryTheory.CategoryStruct.comp (comm1.inv.app (R.obj X))
    (CategoryTheory.CategoryStruct.comp (L'.map (comm2.inv.app X)) (adj.counit.app (iD.obj X)))


theorem update_eq_add_sub_coeff {R : Type*} [Ring R] (p : R[X]) (n : ℕ) (a : R) :
    p.update n a = p + Polynomial.C (a - p.coeff n) * Polynomial.X ^ n

{R : Type u_1}
[Ring R]
(p : R[X])
(n : ℕ)
(a : R)