theorem moveLeft_smaller {b : Board} {m : ℤ × ℤ} (h : m ∈ left b) :
    Finset.card (moveLeft b m) / 2 < Finset.card b / 2

(h : m ∈ SetTheory.PGame.Domineering.left b)

Finset.card (SetTheory.PGame.Domineering.moveLeft b m) / 2 < Finset.card b / 2


theorem get?_take_succ (n : ℕ) (s : Stream' α) :
    List.get? (take (succ n) s) n = some (get s n)

(Stream'.take n.succ s).get? n = some (s.get n)


/-- The length of an element of a free magma is positive. -/
@[to_additive "The length of an element of a free additive magma is positive."]
lemma FreeMagma.length_pos {α : Type u} (x : FreeMagma α) : 0 < x.length


theorem Pairwise.mono (h : t ⊆ s) (hs : s.Pairwise r) : t.Pairwise r

{α : Type u_1}
{r : α → α → Prop}
{s t : Set α}
(h : t ⊆ s)
(hs : s.Pairwise r)


theorem ProdLex_iff [PartialOrder α] [Preorder β] {s : Set (α ×ₗ β)} :
    s.IsPWO ↔
      ((fun (x : α ×ₗ β) ↦ (ofLex x).1) '' s).IsPWO ∧ ∀ a, {y | toLex (a, y) ∈ s}.IsPWO

{α : Type u_2}
{β : Type u_3}
[PartialOrder α]
[Preorder β]
{s : Set (Lex (α × β))}

s.IsPWO ↔ ((fun x => (ofLex x).1) '' s).IsPWO ∧ ∀ (a : α), {y | toLex (a, y) ∈ s}.IsPWO


/-- Construct a bundled `LaxMonoidalFunctor` from the object level function
and `Functorial` and `LaxMonoidal` typeclasses.
-/
@[simps]
def of (F : C → D) [I₁ : Functorial.{v₁, v₂} F] [I₂ : LaxMonoidal.{v₁, v₂} F] :
    LaxMonoidalFunctor.{v₁, v₂} C D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
(F : C → D)
[I₁ : CategoryTheory.Functorial F]
[I₂ : CategoryTheory.LaxMonoidal F]
{X Y : C}

∀ (a : X ⟶ Y), (CategoryTheory.LaxMonoidalFunctor.of F).map a = CategoryTheory.Functorial.map' a


/-- The (colimit) cocone for `F : J ⥤ PresheafOfModules.{v} R` that is constructed from
the colimit of `F ⋙ evaluation R X` for all `X`. -/
@[simps]
noncomputable def colimitCocone : Cocone F

[{X Y : Cᵒᵖ} →
    (f : X ⟶ Y) →
      CategoryTheory.Limits.PreservesColimit (F ⋙ PresheafOfModules.evaluation R Y)
        (ModuleCat.restrictScalars (R.map f))]

[∀ (X : Cᵒᵖ), CategoryTheory.Limits.HasColimit (F ⋙ PresheafOfModules.evaluation R X)]

(PresheafOfModules.colimitCocone F).ι.app j = PresheafOfModules.colimitCoconeιApp F j


/-- The first isomorphism theorem for monoids in the case of a homomorphism with right inverse. -/
@[to_additive (attr := simps)
  "The first isomorphism theorem for `AddMonoid`s in the case of a homomorphism
  with right inverse."]
def quotientKerEquivOfRightInverse (f : M →* P) (g : P → M) (hf : Function.RightInverse g f) :
    (ker f).Quotient ≃* P

{M : Type u_1}
{P : Type u_3}
[MulOneClass M]
[MulOneClass P]
(f : M →* P)
(g : P → M)
(hf : Function.RightInverse g ⇑f)

∀ (a : P), (Con.quotientKerEquivOfRightInverse f g hf).symm a = (Con.toQuotient ∘ g) a


theorem isMaximal_comap_C_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈ P → x = 0) :
    IsMaximal (comap (C : R →+* R[X]) P : Ideal R)

(hP' : ∀ (x : R), Polynomial.C x ∈ P → x = 0)


/-- If `g : α → β` is a measurable embedding and `f : β → ℝ≥0∞` is any function (not necessarily
measurable), then `∫⁻ a, f a ∂(map g μ) = ∫⁻ a, f (g a) ∂μ`. Compare with `lintegral_map` which
applies to any measurable `g : α → β` but requires that `f` is measurable as well. -/
theorem _root_.MeasurableEmbedding.lintegral_map [MeasurableSpace β] {g : α → β}
    (hg : MeasurableEmbedding g) (f : β → ℝ≥0∞) : ∫⁻ a, f a ∂map g μ = ∫⁻ a, f (g a) ∂μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasurableSpace β]
{g : α → β}
(hg : MeasurableEmbedding g)
(f : β → ℝ≥0∞)

∫⁻ (a : β), f a ∂MeasureTheory.Measure.map g μ = ∫⁻ (a : α), f (g a) ∂μ


theorem BijOn.bijective (h : BijOn f s t) : Bijective (h.mapsTo.restrict f s t)

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
(h : Set.BijOn f s t)

Function.Bijective (Set.MapsTo.restrict f s t ⋯)


protected theorem add_le_of_le_sub_right {a b c : Int} (h : a ≤ c - b) : a + b ≤ c


lemma appLE_congr (e : V ≤ f ⁻¹ᵁ U) (e₁ : U = U') (e₂ : V = V')
    (P : ∀ {R S : Type u} [CommRing R] [CommRing S] (_ : R →+* S), Prop) :
    P (f.appLE U V e) ↔ P (f.appLE U' V' (e₁ ▸ e₂ ▸ e))

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

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


/-- All the `P q` coincide with `𝟙 _` in degree 0. -/
@[simp]
theorem P_f_0_eq (q : ℕ) : ((P q).f 0 : X _[0] ⟶ X _[0]) = 𝟙 _

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

(AlgebraicTopology.DoldKan.P q).f 0 = 𝟙 (K[X].X 0)


theorem coe_min' {s : Finset α} (hs : s.Nonempty) : ↑(s.min' hs) = s.min

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


@[simp]
lemma mk₀_hom [HasDerivedCategory.{w'} C] (f : X ⟶ Y) :
    (mk₀ f).hom = ShiftedHom.mk₀ _ (by simp) ((DerivedCategory.singleFunctor C 0).map f)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
{X Y : C}
[HasDerivedCategory C]
(f : X ⟶ Y)

(CategoryTheory.Abelian.Ext.mk₀ f).hom = CategoryTheory.ShiftedHom.mk₀ ↑0 ⋯ ((DerivedCategory.singleFunctor C 0).map f)


@[gcongr] protected theorem mul_lt_mul_right' (h0 : a ≠ 0) (hinf : a ≠ ⊤) (bc : b < c) :
    b * a < c * a

{a b c : ℝ≥0∞}
(h0 : a ≠ 0)
(hinf : a ≠ ⊤)
(bc : b < c)


@[simp]
-- Porting note (#11215): TODO: should use `E ≃ₘ^n[𝕜] F` notation
theorem uniqueDiffOn_preimage (h : E ≃ₘ^n⟮𝓘(𝕜, E), 𝓘(𝕜, F)⟯ F) (hn : 1 ≤ n) {s : Set F} :
    UniqueDiffOn 𝕜 (h ⁻¹' s) ↔ UniqueDiffOn 𝕜 s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
(h : E ≃ₘ^n⟮𝓘(𝕜, E), 𝓘(𝕜, F)⟯ F)
(hn : 1 ≤ n)
{s : Set F}

UniqueDiffOn 𝕜 (⇑h ⁻¹' s) ↔ UniqueDiffOn 𝕜 s


theorem wPathDestRight_wPathCasesOn {α : TypeVec n} {a : P.A} {f : P.last.B a → P.last.W}
    (g' : P.drop.B a ⟹ α) (g : ∀ j : P.last.B a, P.WPath (f j) ⟹ α) :
    P.wPathDestRight (P.wPathCasesOn g' g) = g

(g : (j : P.last.B a) → TypeVec.Arrow (P.WPath (f j)) α)


/-- Given `Fintype ι`, `equivFunOnFintype` is the `Equiv` between `Π₀ i, β i` and `Π i, β i`.
  (All dependent functions on a finite type are finitely supported.) -/
@[simps apply]
def equivFunOnFintype [Fintype ι] : (Π₀ i, β i) ≃ ∀ i, β i

{ι : Type u}
{β : ι → Type v}
[(i : ι) → Zero (β i)]
[Fintype ι]

∀ (a : Π₀ (i : ι), β i) (a_1 : ι), DFinsupp.equivFunOnFintype a a_1 = a a_1


private theorem pentagon_aux (W X Y Z : Type*) [AddCommMonoid W] [AddCommMonoid X]
    [AddCommMonoid Y] [AddCommMonoid Z] [Module R W] [Module R X] [Module R Y] [Module R Z] :
    (((assoc R X Y Z).toLinearMap.lTensor W).comp
            (assoc R W (X ⊗[R] Y) Z).toLinearMap).comp
        ((assoc R W X Y).toLinearMap.rTensor Z) =
      (assoc R W X (Y ⊗[R] Z)).toLinearMap.comp (assoc R (W ⊗[R] X) Y Z).toLinearMap

(R : Type u)
[CommRing R]
(W : Type u_1)
(X : Type u_2)
(Y : Type u_3)
(Z : Type u_4)
[AddCommMonoid W]
[AddCommMonoid X]
[AddCommMonoid Y]
[AddCommMonoid Z]
[Module R W]
[Module R X]
[Module R Y]
[Module R Z]

(LinearMap.lTensor W ↑(TensorProduct.assoc R X Y Z) ∘ₗ ↑(TensorProduct.assoc R W (TensorProduct R X Y) Z)) ∘ₗ
    LinearMap.rTensor Z ↑(TensorProduct.assoc R W X Y) =
  ↑(TensorProduct.assoc R W X (TensorProduct R Y Z)) ∘ₗ ↑(TensorProduct.assoc R (TensorProduct R W X) Y Z)


theorem principal_add_omega_opow (o : Ordinal) : Principal (· + ·) (omega^o)

Ordinal.Principal (fun x x_1 => x + x_1) (Ordinal.omega ^ o)


theorem ker_toAddSubmonoid (f : M →ₛₗ[τ₁₂] M₂) : f.ker.toAddSubmonoid = (AddMonoidHom.mker f)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_6}
{M₂ : Type u_8}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
(f : M →ₛₗ[τ₁₂] M₂)

(LinearMap.ker f).toAddSubmonoid = AddMonoidHom.mker f


theorem MDifferentiableAt.mfderiv_prod {f : M → M'} {g : M → M''} {x : M}
    (hf : MDifferentiableAt I I' f x) (hg : MDifferentiableAt I I'' g x) :
    mfderiv I (I'.prod I'') (fun x => (f x, g x)) x =
      (mfderiv I I' f x).prod (mfderiv I I'' g x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
{E'' : Type u_8}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_9}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{M'' : Type u_10}
[TopologicalSpace M'']
[ChartedSpace H'' M'']
[SmoothManifoldWithCorners I'' M'']
{f : M → M'}
{g : M → M''}
{x : M}
(hf : MDifferentiableAt I I' f x)
(hg : MDifferentiableAt I I'' g x)


@[simp]
theorem pairwise_ofFn {R : α → α → Prop} {n} {f : Fin n → α} :
    (ofFn f).Pairwise R ↔ ∀ ⦃i j⦄, i < j → R (f i) (f j)

{α : Type u}
{R : α → α → Prop}
{n : ℕ}
{f : Fin n → α}

List.Pairwise R (List.ofFn f) ↔ ∀ ⦃i j : Fin n⦄, i < j → R (f i) (f j)


lemma HurwitzZeta.cosZeta_zero : cosZeta 0 = riemannZeta


theorem sup_def [Sup α] [Sup β] (p q : α × β) : p ⊔ q = (p.fst ⊔ q.fst, p.snd ⊔ q.snd)

(α : Type u)
(β : Type v)
[Sup α]
[Sup β]
(p q : α × β)


@[to_additive]
theorem measurable_mul_unop {α : Type*} [MeasurableSpace α] : Measurable (unop : αᵐᵒᵖ → α)


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

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

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


lemma singularPart_eq_zero_of_ac (h : μ ≪ ν) : μ.singularPart ν = 0

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(h : μ ≪ ν)


theorem mem_of_subset {a} {l₁ l₂ : Lists' α true} (s : l₁ ⊆ l₂) : a ∈ l₁ → a ∈ l₂

{α : Type u_1}
{a : Lists α}
{l₁ l₂ : Lists' α true}
(s : l₁ ⊆ l₂)

a ∈ l₁ → a ∈ l₂


@[to_additive (attr := simp)]
lemma range_mk : range (QuotientGroup.mk (s := s)) = univ

{α : Type u_1}
[Group α]
{s : Subgroup α}


@[simp]
theorem image_val (f : α → β) (s : Finset α) : (image f s).1 = (s.1.map f).dedup

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

(Finset.image f s).val = (Multiset.map f s.val).dedup


theorem subsingleton_of_length_eq_zero (hs : s.length = 0) : {x | x ∈ s}.Subsingleton

{α : Type u_1}
{r : Rel α α}
{s : RelSeries r}
(hs : s.length = 0)


theorem div_eq_sub_div (h₁ : 0 < b) (h₂ : b ≤ a) : a / b = (a - b) / b + 1


@[simp] theorem swap_inr : swap (inr x : α ⊕ β) = inl x


/-- Given a symmetric generating set of a permutation group, if T is a nonempty proper subset of
an orbit, then there exists a generator that sends some element of T into the complement of T. -/
theorem exists_smul_not_mem_of_subset_orbit_closure (S : Set G) (T : Set α) {a : α}
    (hS : ∀ g ∈ S, g⁻¹ ∈ S) (subset : T ⊆ orbit (closure S) a) (not_mem : a ∉ T)
    (nonempty : T.Nonempty) : ∃ σ ∈ S, ∃ a ∈ T, σ • a ∉ T

(subset : T ⊆ MulAction.orbit (↥(Subgroup.closure S)) a)

∃ σ ∈ S, ∃ a ∈ T, σ • a ∉ T


@[simp, norm_cast]
theorem isCompl_coe : IsCompl (a : α) b ↔ IsCompl a b

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{a b : Complementeds α}


/--
Formula for `hurwitzZetaEven` as a Dirichlet series in the convergence range, with sum over `ℤ`.
-/
lemma hasSum_int_hurwitzZetaEven (a : ℝ) {s : ℂ} (hs : 1 < re s) :
    HasSum (fun n : ℤ ↦ 1 / (↑|n + a| : ℂ) ^ s / 2) (hurwitzZetaEven a s)

HasSum (fun n => 1 / ↑|↑n + a| ^ s / 2) (HurwitzZeta.hurwitzZetaEven (↑a) s)


@[simp]
theorem mem_neighborSet (G' : Subgraph G) (v w : V) : w ∈ G'.neighborSet v ↔ G'.Adj v w

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


@[simp]
theorem ofArity_zero (α β : Type u) : OfArity α β 0 = β


@[to_additive]
theorem comap_sup_eq_of_le_range {H K : Subgroup N} (hH : H ≤ f.range) (hK : K ≤ f.range) :
    comap f H ⊔ comap f K = comap f (H ⊔ K)

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)
{H K : Subgroup N}
(hH : H ≤ f.range)
(hK : K ≤ f.range)

Subgroup.comap f H ⊔ Subgroup.comap f K = Subgroup.comap f (H ⊔ K)


@[simp] theorem ncard_pair {a b : α} (h : a ≠ b) : ({a, b} : Set α).ncard = 2


/-- If `E / F` is purely inseparable, then for any reduced ring `L`, the map `(E →+* L) → (F →+* L)`
induced by `algebraMap F E` is injective. In particular, a purely inseparable field extension
is an epimorphism in the category of fields. -/
theorem IsPurelyInseparable.injective_comp_algebraMap [IsPurelyInseparable F E]
    (L : Type w) [CommRing L] [IsReduced L] :
    Function.Injective fun f : E →+* L ↦ f.comp (algebraMap F E)

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
[IsPurelyInseparable F E]
(L : Type w)
[CommRing L]
[IsReduced L]

Function.Injective fun f => f.comp (algebraMap F E)


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


@[simp] lemma smul_empty (x : M) (v : Fin 0 → α) : x • v = ![]

{α : Type u_1}
{M : Type u_2}
[SMul M α]
(x : M)
(v : Fin 0 → α)


@[to_additive]
lemma IsPretransitive.of_smul_eq {M N α : Type*} [SMul M α] [SMul N α] [IsPretransitive M α]
    (f : M → N) (hf : ∀ {c : M} {x : α}, f c • x = c • x) : IsPretransitive N α

(hf : ∀ {c : M} {x : α}, f c +ᵥ x = c +ᵥ x)


/-- If `G` has `n` commutators `[g₁, g₂]`, then `|G'| ∣ [G : Z(G)] ^ ([G : Z(G)] * n + 1)`,
where `G'` denotes the commutator of `G`. -/
theorem card_commutator_dvd_index_center_pow [Finite (commutatorSet G)] :
    Nat.card (_root_.commutator G) ∣
      (center G).index ^ ((center G).index * Nat.card (commutatorSet G) + 1)

(G : Type u_1)
[Group G]
[Finite ↑(commutatorSet G)]

Nat.card ↥(commutator G) ∣ (Subgroup.center G).index ^ ((Subgroup.center G).index * Nat.card ↑(commutatorSet G) + 1)


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

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


theorem StrictConvexOn.congr (hf : StrictConvexOn 𝕜 s f) (hfg : EqOn f g s) :
    StrictConvexOn 𝕜 s g

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[SMul 𝕜 β]
{s : Set E}
{f g : E → β}
(hf : StrictConvexOn 𝕜 s f)
(hfg : Set.EqOn f g s)


theorem div_opow_log_lt {b : Ordinal} (o : Ordinal) (hb : 1 < b) : o / (b ^ log b o) < b

{b : Ordinal.{u_1}}
(o : Ordinal.{u_1})
(hb : 1 < b)


lemma constantSheafAdj_counit_app {T : C} (hT : IsTerminal T) (F : Sheaf J D) :
    (constantSheafAdj J D hT).counit.app F =
      (presheafToSheaf J D).map ((constantPresheafAdj D hT).counit.app F.val) ≫
        (sheafificationAdjunction J D).counit.app F

(J : CategoryTheory.GrothendieckTopology C)

(hT : CategoryTheory.Limits.IsTerminal T)

(CategoryTheory.constantSheafAdj J D hT).counit.app F =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.presheafToSheaf J D).map ((CategoryTheory.constantPresheafAdj D hT).counit.app F.val))
    ((CategoryTheory.sheafificationAdjunction J D).counit.app F)


theorem MonotoneOn.sum_le_integral (hf : MonotoneOn f (Icc x₀ (x₀ + a))) :
    (∑ i ∈ Finset.range a, f (x₀ + i)) ≤ ∫ x in x₀..x₀ + a, f x

(hf : MonotoneOn f (Set.Icc x₀ (x₀ + ↑a)))

∑ i ∈ Finset.range a, f (x₀ + ↑i) ≤ ∫ (x : ℝ) in x₀..x₀ + ↑a, f x


theorem isComplete_range [CompleteSpace α] (hf : AntilipschitzWith K f)
    (hfc : UniformContinuous f) : IsComplete (range f)

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
[CompleteSpace α]
(hf : AntilipschitzWith K f)
(hfc : UniformContinuous f)


/-- A graded version of `NonUnitalNonAssocSemiring`. -/
class GNonUnitalNonAssocSemiring [Add ι] [∀ i, AddCommMonoid (A i)] extends
  GradedMonoid.GMul A where
  /-- Multiplication from the right with any graded component's zero vanishes. -/
  mul_zero : ∀ {i j} (a : A i), mul a (0 : A j) = 0
  /-- Multiplication from the left with any graded component's zero vanishes. -/
  zero_mul : ∀ {i j} (b : A j), mul (0 : A i) b = 0
  /-- Multiplication from the right between graded components distributes with respect to
  addition. -/
  mul_add : ∀ {i j} (a : A i) (b c : A j), mul a (b + c) = mul a b + mul a c
  /-- Multiplication from the left between graded components distributes with respect to
  addition. -/
  add_mul : ∀ {i j} (a b : A i) (c : A j), mul (a + b) c = mul a c + mul b c

[self : DirectSum.GNonUnitalNonAssocSemiring A]


theorem cprankMax_mul [Ring α] :
    ∀ (n : ℕ) (x : Holor α [d]) (y : Holor α ds), CPRankMax n y → CPRankMax n (x ⊗ y)

{α : Type}
{d : ℕ}
{ds : List ℕ}
[Ring α]
(n : ℕ)
(x : Holor α [d])
(y : Holor α ds)

Holor.CPRankMax n y → Holor.CPRankMax n (x.mul y)


theorem map_add_of_distinct_val (h : v x ≠ v y) : v (x + y) = @Min.min Γ₀ _ (v x) (v y)

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


/-- The fractional part of `a` is positive if and only if `a ≠ ⌊a⌋`. -/
lemma fract_pos : 0 < fract a ↔ a ≠ ⌊a⌋

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{a : α}


/-- A measurable set `s` is a *fundamental domain* for an action of a group `G` on a measurable
space `α` with respect to a measure `α` if the sets `g • s`, `g : G`, are pairwise a.e. disjoint and
cover the whole space. -/
@[to_additive IsAddFundamentalDomain]
structure IsFundamentalDomain (G : Type*) {α : Type*} [One G] [SMul G α] [MeasurableSpace α]
    (s : Set α) (μ : Measure α := by volume_tac) : Prop where
  protected nullMeasurableSet : NullMeasurableSet s μ
  protected ae_covers : ∀ᵐ x ∂μ, ∃ g : G, g • x ∈ s
  protected aedisjoint : Pairwise <| (AEDisjoint μ on fun g : G => g • s)

{μ : autoParam (MeasureTheory.Measure α) _auto✝}

(self : MeasureTheory.IsFundamentalDomain G s μ)


@[simp]
theorem csSup_empty : sSup (∅ : Set ℤ) = 0


lemma RightFractionRel.unop {W : MorphismProperty Cᵒᵖ} {X Y : Cᵒᵖ}
    {z₁ z₂ : W.RightFraction X Y}
    (h : RightFractionRel z₁ z₂) : LeftFractionRel z₁.unop z₂.unop

{W : CategoryTheory.MorphismProperty Cᵒᵖ}

(h : CategoryTheory.MorphismProperty.RightFractionRel z₁ z₂)


theorem prime_def_le_sqrt {p : ℕ} : Prime p ↔ 2 ≤ p ∧ ∀ m, 2 ≤ m → m ≤ sqrt p → ¬m ∣ p

Nat.Prime p ↔ 2 ≤ p ∧ ∀ (m : ℕ), 2 ≤ m → m ≤ p.sqrt → ¬m ∣ p


@[simp]
theorem lift_comp_ι (g : ExteriorAlgebra R M →ₐ[R] A) :
    lift R ⟨g.toLinearMap.comp (ι R), comp_ι_sq_zero _⟩ = g

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{A : Type u_1}
[Semiring A]
[Algebra R A]
(g : ExteriorAlgebra R M →ₐ[R] A)

(ExteriorAlgebra.lift R) ⟨g.toLinearMap ∘ₗ ExteriorAlgebra.ι R, ⋯⟩ = g


theorem add_eq_add_ge (a c : Nat) {b d : Nat} (h : b ≥ d) : (a + b = c + d) = (a + (b - d) = c)


/-- Describes the property of a functor to "preserve sheaves". -/
class GrothendieckTopology.HasSheafCompose : Prop where
  /-- For every sheaf `P`, `P ⋙ F` is a sheaf. -/
  isSheaf (P : Cᵒᵖ ⥤ A) (hP : Presheaf.IsSheaf J P) : Presheaf.IsSheaf J (P ⋙ F)

{J : CategoryTheory.GrothendieckTopology C}

(hP : CategoryTheory.Presheaf.IsSheaf J P)

CategoryTheory.Presheaf.IsSheaf J (P.comp F)


theorem eq_of_abs_sub_eq_zero {a b : α} (h : |a - b| = 0) : a = b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{a b : α}
(h : |a - b| = 0)


@[to_additive]
theorem unop_closure (s : Set Gᵐᵒᵖ) : (closure s).unop = closure (MulOpposite.op ⁻¹' s)

(Subgroup.closure s).unop = Subgroup.closure (MulOpposite.op ⁻¹' s)


theorem exists_mem_eq_sup [OrderBot α] (s : Finset ι) (h : s.Nonempty) (f : ι → α) :
    ∃ i, i ∈ s ∧ s.sup f = f i

{α : Type u_2}
{ι : Type u_5}
[LinearOrder α]
[OrderBot α]
(s : Finset ι)
(h : s.Nonempty)
(f : ι → α)


/-- Two vertices are adjacent iff there is an edge between them. The
condition `v ≠ w` ensures they are different endpoints of the edge,
which is necessary since when `v = w` the existential
`∃ (e ∈ G.edgeSet), v ∈ e ∧ w ∈ e` is satisfied by every edge
incident to `v`. -/
theorem adj_iff_exists_edge {v w : V} : G.Adj v w ↔ v ≠ w ∧ ∃ e ∈ G.edgeSet, v ∈ e ∧ w ∈ e

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


/-- The isomorphism between `(X.1, X.2)` and `X`. -/
@[simps]
def prod.etaIso (X : C × D) : (X.1, X.2) ≅ X

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

(CategoryTheory.prod.etaIso X).hom =
  (CategoryTheory.CategoryStruct.id (X.1, X.2).1, CategoryTheory.CategoryStruct.id (X.1, X.2).2)


/-- Given a localization map `f : M →* N` for a submonoid `S ⊆ M`, for all `z : N` we have that if
`x : M, y ∈ S` are such that `z * f y = f x`, then `f x * (f y)⁻¹ = z`. -/
@[to_additive (attr := simp)
    "Given a localization map `f : M →+ N` for a Submonoid `S ⊆ M`, for all `z : N`
we have that if `x : M, y ∈ S` are such that `z + f y = f x`, then `f x - f y = z`."]
theorem mk'_sec (z : N) : f.mk' (f.sec z).1 (f.sec z).2 = z

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(z : N)


theorem subtype_coe_map_comap (s : Set α) (f : Filter α) :
    map ((↑) : s → α) (comap ((↑) : s → α) f) = f ⊓ 𝓟 s

Filter.map Subtype.val (Filter.comap Subtype.val f) = f ⊓ 𝓟 s


@[ext]
theorem ext {f g : L₁ →ₗ⁅R⁆ L₂} (h : ∀ x, f x = g x) : f = g

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieAlgebra R L₁]
[LieRing L₂]
[LieAlgebra R L₂]
{f g : L₁ →ₗ⁅R⁆ L₂}
(h : ∀ (x : L₁), f x = g x)


/--
The distance between vertices is equal to `1` if and only if these vertices are adjacent.
-/
@[simp]
theorem dist_eq_one_iff_adj : G.dist u v = 1 ↔ G.Adj u v

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


/-- The spectrum of a selfadjoint is real -/
theorem selfAdjoint.val_re_map_spectrum [StarModule ℂ A] (a : selfAdjoint A) :
    spectrum ℂ (a : A) = ((↑) ∘ re '' spectrum ℂ (a : A) : Set ℂ)

{A : Type u_1}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[StarModule ℂ A]
(a : ↥(selfAdjoint A))

spectrum ℂ ↑a = Complex.ofReal' ∘ Complex.re '' spectrum ℂ ↑a


theorem eval₂_mem {f : R →+* S} {p : MvPolynomial σ R} {s : subS}
    (hs : ∀ i ∈ p.support, f (p.coeff i) ∈ s) {v : σ → S} (hv : ∀ i, v i ∈ s) :
    MvPolynomial.eval₂ f v p ∈ s

(hs : ∀ i ∈ p.support, f (MvPolynomial.coeff i p) ∈ s)


@[simp]
theorem trop_zero [Zero R] : trop (0 : R) = 1


/-- Given groups `G H` with `G` acting on `A`, `G` acts by
  multiplicative automorphisms on `A → H`. -/
@[simps!]
def mulAutArrow {G A H} [Group G] [MulAction G A] [Monoid H] : G →* MulAut (A → H)

{G : Type u_1}
{A : Type u_2}
{H : Type u_3}
[Group G]
[MulAction G A]
[Monoid H]
(x : G)

∀ (a : A → H) (a_1 : A), (MulEquiv.symm (mulAutArrow x)) a a_1 = (x⁻¹ • a) a_1


theorem sbtw_irrefl_right {a b : α} : ¬sbtw a b b

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


theorem descPochhammer_eval_zero {n : ℕ} :
    (descPochhammer R n).eval 0 = if n = 0 then 1 else 0

Polynomial.eval 0 (descPochhammer R n) = if n = 0 then 1 else 0


@[simp]
theorem Finsupp.toDFinsupp_coe [Zero M] (f : ι →₀ M) : ⇑f.toDFinsupp = f

{ι : Type u_1}
{M : Type u_3}
[Zero M]
(f : ι →₀ M)


theorem mem_range_iff {f : E →ₗ.[R] F} {y : F} : y ∈ Set.range f ↔ ∃ x : E, (x, y) ∈ f.graph

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{f : E →ₗ.[R] F}
{y : F}

y ∈ Set.range ↑f ↔ ∃ x, (x, y) ∈ f.graph


theorem disjoint_iff_disjoint_support : Disjoint f g ↔ _root_.Disjoint f.support g.support

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{f g : Equiv.Perm α}

f.Disjoint g ↔ Disjoint f.support g.support


/-- A space is sober if every irreducible closed subset has a generic point. -/
@[mk_iff]
class QuasiSober (α : Type*) [TopologicalSpace α] : Prop where
  sober : ∀ {S : Set α}, IsIrreducible S → IsClosed S → ∃ x, IsGenericPoint x S

QuasiSober α ↔ ∀ {S : Set α}, IsIrreducible S → IsClosed S → ∃ x, IsGenericPoint x S


theorem intervalIntegrable_const : IntervalIntegrable (fun _ => c) μ a b


theorem measure_support_lt_top [Zero β] (f : α →ₛ β) (hf : ∀ y, y ≠ 0 → μ (f ⁻¹' {y}) < ∞) :
    μ (support f) < ∞

(hf : ∀ (y : β), y ≠ 0 → μ (↑f ⁻¹' {y}) < ⊤)


theorem rank_pow_quot [IsDedekindDomain S] [p.IsMaximal] [P.IsPrime] (hP0 : P ≠ ⊥)
    (i : ℕ) (hi : i ≤ e) :
    Module.rank (R ⧸ p) (Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ i)) =
      (e - i) • Module.rank (R ⧸ p) (S ⧸ P)

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

Module.rank (R ⧸ p) ↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ i)) =
  (Ideal.ramificationIdx f p P - i) • Module.rank (R ⧸ p) (S ⧸ P)


@[to_additive (attr := simp)]
theorem bot_div : ⊥ / g = ⊥


theorem filter_eq (s : Multiset α) (b : α) : s.filter (Eq b) = replicate (count b s) b

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

Multiset.filter (Eq b) s = Multiset.replicate (Multiset.count b s) b


theorem re_sq_le_normSq (z : ℂ) : z.re * z.re ≤ normSq z


@[simp]
theorem prod_rcons {i} (p : Pair M i) : prod (rcons p) = of p.head * prod p.tail

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
[(i : ι) → DecidableEq (M i)]
{i : ι}
(p : Monoid.CoprodI.Word.Pair M i)

(Monoid.CoprodI.Word.rcons p).prod = Monoid.CoprodI.of p.head * p.tail.prod


@[simp]
lemma monotone_vecCons : Monotone (vecCons a f) ↔ a ≤ f 0 ∧ Monotone f

{α : Type u_1}
[Preorder α]
{n : ℕ}
{f : Fin (n + 1) → α}
{a : α}

Monotone (Matrix.vecCons a f) ↔ a ≤ f 0 ∧ Monotone f


theorem periodicOrbit_chain' (r : α → α → Prop) {f : α → α} {x : α} (hx : x ∈ periodicPts f) :
    (periodicOrbit f x).Chain r ↔ ∀ n, r (f^[n] x) (f^[n + 1] x)

{α : Type u_1}
(r : α → α → Prop)
{f : α → α}
{x : α}
(hx : x ∈ Function.periodicPts f)

Cycle.Chain r (Function.periodicOrbit f x) ↔ ∀ (n : ℕ), r (f^[n] x) (f^[n + 1] x)


theorem bounded_self (a : α) : Bounded r { b | r b a }

{α : Type u_1}
{r : α → α → Prop}
(a : α)


theorem bernoulli'_def (n : ℕ) :
    bernoulli' n = 1 - ∑ k ∈ range n, n.choose k / (n - k + 1) * bernoulli' k

bernoulli' n = 1 - ∑ k ∈ Finset.range n, ↑(n.choose k) / (↑n - ↑k + 1) * bernoulli' k


theorem abs_add_three (a b c : α) : |a + b + c| ≤ |a| + |b| + |c|

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


/-- If a function is countably sub-multiplicative then it is binary sub-multiplicative -/
@[to_additive "If a function is countably sub-additive then it is binary sub-additive"]
theorem rel_sup_mul [CompleteLattice α] (m : α → M) (m0 : m ⊥ = 1) (R : M → M → Prop)
    (m_iSup : ∀ s : ℕ → α, R (m (⨆ i, s i)) (∏' i, m (s i))) (s₁ s₂ : α) :
    R (m (s₁ ⊔ s₂)) (m s₁ * m s₂)

(m_iSup : ∀ (s : ℕ → α), R (m (⨆ i, s i)) (∏' (i : ℕ), m (s i)))


@[simp]
lemma isRegular_cons_iff (r : R) (rs : List R) :
    IsRegular M (r :: rs) ↔
      IsSMulRegular M r ∧ IsRegular (QuotSMulTop r M) rs

{R : Type u_1}
(M : Type u_3)
[CommRing R]
[AddCommGroup M]
[Module R M]
(r : R)
(rs : List R)

RingTheory.Sequence.IsRegular M (r :: rs) ↔ IsSMulRegular M r ∧ RingTheory.Sequence.IsRegular (QuotSMulTop r M) rs


/-- The real exponential function tends to `+∞` at `+∞`. -/
theorem tendsto_exp_atTop : Tendsto exp atTop atTop

Filter.Tendsto Real.exp Filter.atTop Filter.atTop


theorem isIdempotentElem_apply_one_iff {f : Module.End R R} :
    IsIdempotentElem (f 1) ↔ IsIdempotentElem f

{R : Type u_1}
[Semiring R]
{f : Module.End R R}


@[simp]
theorem ofBoolRing_mul (a b : AsBoolRing α) : ofBoolRing (a * b) = ofBoolRing a ⊓ ofBoolRing b

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


/-- All elements of a partition of α are the equivalence class of some y ∈ α. -/
theorem exists_of_mem_partition {c : Set (Set α)} (hc : IsPartition c) {s} (hs : s ∈ c) :
    ∃ y, s = { x | (mkClasses c hc.2).Rel x y }

{α : Type u_1}
{c : Set (Set α)}
(hc : Setoid.IsPartition c)
{s : Set α}
(hs : s ∈ c)

∃ y, s = {x | (Setoid.mkClasses c ⋯).Rel x y}


theorem Smooth.inv₀ (hf : Smooth I' I f) (h0 : ∀ x, f x ≠ 0) : Smooth I' I fun x => (f x)⁻¹

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Inv G]
[Zero G]
[SmoothInv₀ I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f : M → G}
(hf : Smooth I' I f)
(h0 : ∀ (x : M), f x ≠ 0)


@[simp]
theorem map_integerMultiple {ι : Type*} (s : Finset ι) (f : ι → S) (i : s) :
    algebraMap R S (integerMultiple M s f i) = commonDenom M s f • f i

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
{ι : Type u_4}
(s : Finset ι)
(f : ι → S)
(i : { x // x ∈ s })

(algebraMap R S) (IsLocalization.integerMultiple M s f i) = IsLocalization.commonDenom M s f • f ↑i


theorem mk_lt_of_lt_val {b : Fin n} {a : Nat} (h : a < b) :
    (⟨a, Nat.lt_trans h b.is_lt⟩ : Fin n) < b

{n : Nat}
{b : Fin n}
{a : Nat}
(h : a < ↑b)


/-- The space of affine maps between two modules is linearly equivalent to the product of the
domain with the space of linear maps, by taking the value of the affine map at `(0 : V1)` and the
linear part.

See note [bundled maps over different rings]-/
@[simps]
def toConstProdLinearMap : (V1 →ᵃ[k] V2) ≃ₗ[R] V2 × (V1 →ₗ[k] V2)

(R : Type u_1)
{k : Type u_2}
{V1 : Type u_3}
{V2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[AddCommGroup V2]
[Module k V1]
[Module k V2]
[Semiring R]
[Module R V2]
[SMulCommClass k R V2]
(p : V2 × (V1 →ₗ[k] V2))

(AffineMap.toConstProdLinearMap R).symm p = p.2.toAffineMap + AffineMap.const k V1 p.1


/-- A family `F` of functions in `C(X, Y)` converges in the compact-open topology, if and only if
it converges in the compact-open topology on each compact subset of `X`. -/
theorem exists_tendsto_compactOpen_iff_forall [WeaklyLocallyCompactSpace X] [T2Space Y]
    {ι : Type*} {l : Filter ι} [Filter.NeBot l] (F : ι → C(X, Y)) :
    (∃ f, Filter.Tendsto F l (𝓝 f)) ↔
      ∀ s : Set X, IsCompact s → ∃ f, Filter.Tendsto (fun i => (F i).restrict s) l (𝓝 f)

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[WeaklyLocallyCompactSpace X]
[T2Space Y]
{ι : Type u_6}
{l : Filter ι}
[l.NeBot]
(F : ι → C(X, Y))

(∃ f, Filter.Tendsto F l (𝓝 f)) ↔
  ∀ (s : Set X), IsCompact s → ∃ f, Filter.Tendsto (fun i => ContinuousMap.restrict s (F i)) l (𝓝 f)


@[simp] theorem or_cast {x y : BitVec w} (h : w = w') : cast h x ||| cast h y = cast h (x ||| y)

{w w' : Nat}
{x y : BitVec w}
(h : w = w')

BitVec.cast h x ||| BitVec.cast h y = BitVec.cast h (x ||| y)


theorem sum_le (f : α → E) {s : Set α} (n : ℕ) {u : ℕ → α} (hu : Monotone u) (us : ∀ i, u i ∈ s) :
    (∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i))) ≤ eVariationOn f s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
(f : α → E)
{s : Set α}
(n : ℕ)
{u : ℕ → α}
(hu : Monotone u)
(us : ∀ (i : ℕ), u i ∈ s)

∑ i ∈ Finset.range n, edist (f (u (i + 1))) (f (u i)) ≤ eVariationOn f s


theorem extend_symm_preimage_inter_range_eventuallyEq_aux {s : Set M} {x : M} (hx : x ∈ f.source) :
    ((f.extend I).symm ⁻¹' s ∩ range I : Set _) =ᶠ[𝓝 (f.extend I x)]
      ((f.extend I).target ∩ (f.extend I).symm ⁻¹' s : Set _)

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)
{s : Set M}
{x : M}
(hx : x ∈ f.source)

↑(f.extend I).symm ⁻¹' s ∩ Set.range ↑I =ᶠ[𝓝 (↑(f.extend I) x)] (f.extend I).target ∩ ↑(f.extend I).symm ⁻¹' s


/-- Split the sum defining a Liouville number into the first `k` terms and the rest. -/
theorem partialSum_add_remainder {m : ℝ} (hm : 1 < m) (k : ℕ) :
    partialSum m k + remainder m k = liouvilleNumber m

LiouvilleNumber.partialSum m k + LiouvilleNumber.remainder m k = liouvilleNumber m


theorem comap_map_eq_of_injective (p : Submodule R M) : (p.map f).comap f = p

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
{f : F}
(hf : Function.Injective ⇑f)
(p : Submodule R M)

Submodule.comap f (Submodule.map f p) = p


@[simp] theorem length_mk (s : List Char) : (String.mk s).length = s.length


@[simp] theorem fst_smul [∀ i, SMul α (A i)] (a : α) (x : GradedMonoid A) :
    (a • x).fst = x.fst

{ι : Type u_1}
{α : Type u_3}
{A : ι → Type u_2}
[(i : ι) → SMul α (A i)]
(a : α)
(x : GradedMonoid A)


theorem CPolynomialOn_const {v : F} {s : Set E} : CPolynomialOn 𝕜 (fun _ => v) s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{v : F}
{s : Set E}


lemma AnalyticWithinOn.mono {f : E → F} {s t : Set E} (h : AnalyticWithinOn 𝕜 f t)
    (hs : s ⊆ t) : AnalyticWithinOn 𝕜 f s

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s t : Set E}
(h : AnalyticWithinOn 𝕜 f t)
(hs : s ⊆ t)


@[simp]
lemma Φ_two : W.Φ 2 = X ^ 4 - C W.b₄ * X ^ 2 - C (2 * W.b₆) * X - C W.b₈

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

W.Φ 2 =
  Polynomial.X ^ 4 - Polynomial.C W.b₄ * Polynomial.X ^ 2 - Polynomial.C (2 * W.b₆) * Polynomial.X - Polynomial.C W.b₈


lemma quasiIso_map_iff_of_preservesRightHomology
    [F.PreservesRightHomologyOf S₁] [F.PreservesRightHomologyOf S₂]
    [F.ReflectsIsomorphisms] :
    QuasiIso (F.mapShortComplex.map φ) ↔ QuasiIso φ

CategoryTheory.ShortComplex.QuasiIso (F.mapShortComplex.map φ) ↔ CategoryTheory.ShortComplex.QuasiIso φ


@[to_additive]
theorem mul_singleton_mem_nhds_of_nhds_one (a : α) (h : s ∈ 𝓝 (1 : α)) : s * {a} ∈ 𝓝 a

{α : Type u}
[TopologicalSpace α]
[Group α]
[ContinuousConstSMul αᵐᵒᵖ α]
{s : Set α}
(a : α)
(h : s ∈ 𝓝 1)


theorem inclusion_comp_embedding {S T : Subgroupoid C} (h : S ≤ T) : inclusion h ⋙ T.hom = S.hom

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

(CategoryTheory.Subgroupoid.inclusion h).comp T.hom = S.hom


@[simp]
theorem piCongrRight_trans {R ι : Type*} {A₁ A₂ A₃ : ι → Type*} [CommSemiring R]
    [∀ i, Semiring (A₁ i)] [∀ i, Semiring (A₂ i)] [∀ i, Semiring (A₃ i)] [∀ i, Algebra R (A₁ i)]
    [∀ i, Algebra R (A₂ i)] [∀ i, Algebra R (A₃ i)] (e₁ : ∀ i, A₁ i ≃ₐ[R] A₂ i)
    (e₂ : ∀ i, A₂ i ≃ₐ[R] A₃ i) :
    (piCongrRight e₁).trans (piCongrRight e₂) = piCongrRight fun i => (e₁ i).trans (e₂ i)

{R : Type u_1}
{ι : Type u_2}
{A₁ : ι → Type u_3}
{A₂ : ι → Type u_4}
{A₃ : ι → Type u_5}
[CommSemiring R]
[(i : ι) → Semiring (A₁ i)]
[(i : ι) → Semiring (A₂ i)]
[(i : ι) → Semiring (A₃ i)]
[(i : ι) → Algebra R (A₁ i)]
[(i : ι) → Algebra R (A₂ i)]
[(i : ι) → Algebra R (A₃ i)]
(e₁ : (i : ι) → A₁ i ≃ₐ[R] A₂ i)
(e₂ : (i : ι) → A₂ i ≃ₐ[R] A₃ i)

(AlgEquiv.piCongrRight e₁).trans (AlgEquiv.piCongrRight e₂) = AlgEquiv.piCongrRight fun i => (e₁ i).trans (e₂ i)


/-- Alternative description of `χ₄ n` for odd `n : ℕ` in terms of powers of `-1` -/
theorem χ₄_eq_neg_one_pow {n : ℕ} (hn : n % 2 = 1) : χ₄ n = (-1) ^ (n / 2)


theorem id_apply (M : Mat_ C) (i j : M.ι) :
    (𝟙 M : Hom M M) i j = if h : i = j then eqToHom (congr_arg M.X h) else 0

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
(M : CategoryTheory.Mat_ C)
(i j : M.ι)

𝟙 M i j = if h : i = j then CategoryTheory.eqToHom ⋯ else 0


@[simp]
theorem map_comp_map (f : X ⟶ Y) (g : Y ⟶ Z) {U V} (i : U ⟶ V) :
    (map (f ≫ g)).map i = (map f).map ((map g).map i)

{X Y Z : TopCat}
(f : X ⟶ Y)
(g : Y ⟶ Z)
{U V : TopologicalSpace.Opens ↑Z}
(i : U ⟶ V)

(TopologicalSpace.Opens.map (f ≫ g)).map i = (TopologicalSpace.Opens.map f).map ((TopologicalSpace.Opens.map g).map i)


@[simp]
theorem orElse_eq_none' (o o' : Option α) : o.orElse (fun _ ↦ o') = none ↔ o = none ∧ o' = none

(o.orElse fun x => o') = none ↔ o = none ∧ o' = none


@[simp]
theorem descPochhammer_zero : descPochhammer R 0 = 1


/--
If `P` is a sheaf for the sieve `S` on `X`, then if two natural transformations from `yoneda.obj X`
to `P` agree when restricted to the subfunctor given by `S`, they are equal.
-/
theorem IsSheafFor.hom_ext {P : Cᵒᵖ ⥤ Type v₁} (h : IsSheafFor P (S : Presieve X))
    (t₁ t₂ : yoneda.obj X ⟶ P) (ht : S.functorInclusion ≫ t₁ = S.functorInclusion ≫ t₂) :
    t₁ = t₂

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

(h : CategoryTheory.Presieve.IsSheafFor P S.arrows)

(t₁ t₂ : CategoryTheory.yoneda.obj X ⟶ P)

(ht :
  CategoryTheory.CategoryStruct.comp S.functorInclusion t₁ = CategoryTheory.CategoryStruct.comp S.functorInclusion t₂)


theorem star_sum_elim {I J α : Type*} (x : I → α) (y : J → α) [Star α] :
    star (Sum.elim x y) = Sum.elim (star x) (star y)

{I : Type u_1}
{J : Type u_2}
{α : Type u_3}
(x : I → α)
(y : J → α)
[Star α]


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

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


@[reassoc (attr := simp)]
theorem π_comp_cokernelIsoOfEq_hom {f g : X ⟶ Y} [HasCokernel f] [HasCokernel g] (h : f = g) :
    cokernel.π f ≫ (cokernelIsoOfEq h).hom = cokernel.π g

CategoryTheory.Limits.cokernel.π f ≫ (CategoryTheory.Limits.cokernelIsoOfEq h).hom = CategoryTheory.Limits.cokernel.π g


theorem supermartingale_of_setIntegral_succ_le [IsFiniteMeasure μ] {f : ℕ → Ω → ℝ}
    (hadp : Adapted 𝒢 f) (hint : ∀ i, Integrable (f i) μ)
    (hf : ∀ i, ∀ s : Set Ω, MeasurableSet[𝒢 i] s → ∫ ω in s, f (i + 1) ω ∂μ ≤ ∫ ω in s, f i ω ∂μ) :
    Supermartingale f 𝒢 μ

{f : ℕ → Ω → ℝ}

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

(hf : ∀ (i : ℕ) (s : Set Ω), MeasurableSet s → ∫ (ω : Ω) in s, f (i + 1) ω ∂μ ≤ ∫ (ω : Ω) in s, f i ω ∂μ)


/-- The sphere of radius `r = ‖y‖` is tangent to the plane `⟪x, y⟫ = ‖y‖ ^ 2` at `x = y`. -/
theorem eq_of_norm_le_re_inner_eq_norm_sq {x y : E} (hle : ‖x‖ ≤ ‖y‖) (h : re ⟪x, y⟫ = ‖y‖ ^ 2) :
    x = y

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{x y : E}
(hle : ‖x‖ ≤ ‖y‖)
(h : RCLike.re ⟪x, y⟫_𝕜 = ‖y‖ ^ 2)


theorem ContinuousOn.inner (hf : ContinuousOn f s) (hg : ContinuousOn g s) :
    ContinuousOn (fun t => ⟪f t, g t⟫) s

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{α : Type u_4}
[TopologicalSpace α]
{f g : α → E}
{s : Set α}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)


/-- Equivalence of categories is reflexive. -/
@[refl, simps]
def refl : C ≌ C

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

CategoryTheory.Equivalence.refl.inverse = CategoryTheory.Functor.id C


theorem fderivWithin_const_smul (hxs : UniqueDiffWithinAt 𝕜 s x)
    (h : DifferentiableWithinAt 𝕜 f s x) (c : R) :
    fderivWithin 𝕜 (fun y => c • f y) s x = c • fderivWithin 𝕜 f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{s : Set E}
{R : Type u_6}
[Semiring R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
(hxs : UniqueDiffWithinAt 𝕜 s x)
(h : DifferentiableWithinAt 𝕜 f s x)
(c : R)


/-- `unop` induces morphisms of monoids on hom groups of a preadditive category -/
@[simps!]
def unopHom (X Y : Cᵒᵖ) : (X ⟶ Y) →+ (Opposite.unop Y ⟶ Opposite.unop X)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(X Y : Cᵒᵖ)
(f : X ⟶ Y)


/-- The functor `Karoubi (HomologicalComplex C c) ⥤ HomologicalComplex (Karoubi C) c`,
on morphisms. -/
@[simps]
def map {P Q : Karoubi (HomologicalComplex C c)} (f : P ⟶ Q) : obj P ⟶ obj Q

{P Q : CategoryTheory.Idempotents.Karoubi (HomologicalComplex C c)}

((CategoryTheory.Idempotents.KaroubiHomologicalComplexEquivalence.Functor.map f).f n).f = f.f.f n


@[simp] theorem mod_self {a : Int} : a.mod a = 0


@[simp] lemma multinomial_empty : multinomial ∅ f = 1


theorem summable_of_ratio_norm_eventually_le {α : Type*} [SeminormedAddCommGroup α]
    [CompleteSpace α] {f : ℕ → α} {r : ℝ} (hr₁ : r < 1)
    (h : ∀ᶠ n in atTop, ‖f (n + 1)‖ ≤ r * ‖f n‖) : Summable f

(h : ∀ᶠ (n : ℕ) in Filter.atTop, ‖f (n + 1)‖ ≤ r * ‖f n‖)


theorem pathComponent_symm : x ∈ pathComponent y ↔ y ∈ pathComponent x

{X : Type u_1}
[TopologicalSpace X]
{x y : X}


/-- A family of monoid homomorphisms `f a : γ →* β a` defines a monoid homomorphism
`Pi.monoidHom f : γ →* Π a, β a` given by `Pi.monoidHom f x b = f b x`. -/
@[to_additive (attr := simps)
  "A family of additive monoid homomorphisms `f a : γ →+ β a` defines a monoid homomorphism
  `Pi.addMonoidHom f : γ →+ Π a, β a` given by `Pi.addMonoidHom f x b = f b x`."]
def Pi.monoidHom {γ : Type w} [∀ i, MulOneClass (f i)] [MulOneClass γ] (g : ∀ i, γ →* f i) :
    γ →* ∀ i, f i

{I : Type u}
{f : I → Type v}
{γ : Type w}
[(i : I) → MulOneClass (f i)]
[MulOneClass γ]
(g : (i : I) → γ →* f i)
(x : γ)
(i : I)


theorem mem_sumLift₂ :
    c ∈ sumLift₂ f g a b ↔
      (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f a₁ b₁) ∨
        ∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ g a₂ b₂

{α₁ : Type u_1}
{α₂ : Type u_2}
{β₁ : Type u_3}
{β₂ : Type u_4}
{γ₁ : Type u_5}
{γ₂ : Type u_6}
{f : α₁ → β₁ → Finset γ₁}
{g : α₂ → β₂ → Finset γ₂}
{a : α₁ ⊕ α₂}
{b : β₁ ⊕ β₂}
{c : γ₁ ⊕ γ₂}

c ∈ Finset.sumLift₂ f g a b ↔
  (∃ a₁ b₁ c₁, a = Sum.inl a₁ ∧ b = Sum.inl b₁ ∧ c = Sum.inl c₁ ∧ c₁ ∈ f a₁ b₁) ∨
    ∃ a₂ b₂ c₂, a = Sum.inr a₂ ∧ b = Sum.inr b₂ ∧ c = Sum.inr c₂ ∧ c₂ ∈ g a₂ b₂


@[simp]
theorem coe_sumCoords : (b.sumCoords : M → R) = fun m => (b.repr m).sum fun _ => id

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

⇑b.sumCoords = fun m => (b.repr m).sum fun x => id


theorem pairwise_union_of_symmetric (hr : Symmetric r) :
    (s ∪ t).Pairwise r ↔ s.Pairwise r ∧ t.Pairwise r ∧ ∀ a ∈ s, ∀ b ∈ t, a ≠ b → r a b

{α : Type u_1}
{r : α → α → Prop}
{s t : Set α}
(hr : Symmetric r)


theorem abs_edgeDensity_sub_edgeDensity_le_one_sub_mul (hs : s₂ ⊆ s₁) (ht : t₂ ⊆ t₁)
    (hs₂ : s₂.Nonempty) (ht₂ : t₂.Nonempty) :
    |edgeDensity r s₂ t₂ - edgeDensity r s₁ t₁| ≤ 1 - s₂.card / s₁.card * (t₂.card / t₁.card)

{α : Type u_4}
{β : Type u_5}
(r : α → β → Prop)
[(a : α) → DecidablePred (r a)]
{s₁ s₂ : Finset α}
{t₁ t₂ : Finset β}
(hs : s₂ ⊆ s₁)
(ht : t₂ ⊆ t₁)
(hs₂ : s₂.Nonempty)
(ht₂ : t₂.Nonempty)

|Rel.edgeDensity r s₂ t₂ - Rel.edgeDensity r s₁ t₁| ≤ 1 - ↑s₂.card / ↑s₁.card * (↑t₂.card / ↑t₁.card)


/-- The forgetful functor from the category of algebras, forgetting the algebraic structure. -/
@[simps]
def forget (F : C ⥤ C) : Algebra F ⥤ C

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

∀ {X Y : CategoryTheory.Endofunctor.Algebra F} (self : X.Hom Y),
  (CategoryTheory.Endofunctor.Algebra.forget F).map self = self.f


theorem measure_union' (hd : Disjoint s₁ s₂) (h : MeasurableSet s₁) : μ (s₁ ∪ s₂) = μ s₁ + μ s₂

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s₁ s₂ : Set α}
(hd : Disjoint s₁ s₂)
(h : MeasurableSet s₁)

μ (s₁ ∪ s₂) = μ s₁ + μ s₂


theorem app_hom {F G : C ⥤ D} (α : F ≅ G) (X : C) : (α.app X).hom = α.hom.app X

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


theorem ite_subset_union (t s s' : Set α) : t.ite s s' ⊆ s ∪ s'


@[simp]
theorem Theory.simpleGraph_model_iff [Language.graph.Structure V] :
    V ⊨ Theory.simpleGraph ↔
      (Irreflexive fun x y : V => RelMap adj ![x, y]) ∧
        Symmetric fun x y : V => RelMap adj ![x, y]

{V : Type w'}
[FirstOrder.Language.graph.Structure V]

V ⊨ FirstOrder.Language.Theory.simpleGraph ↔
  (Irreflexive fun x y => FirstOrder.Language.Structure.RelMap FirstOrder.Language.adj ![x, y]) ∧
    Symmetric fun x y => FirstOrder.Language.Structure.RelMap FirstOrder.Language.adj ![x, y]


lemma Gammaℂ_def (s : ℂ) : Gammaℂ s = 2 * (2 * π) ^ (-s) * Gamma s

s.Gammaℂ = 2 * (2 * ↑π) ^ (-s) * Complex.Gamma s


@[simp]
theorem support_toSubring : support (toSubring p T hp) = support p

{R : Type u}
[Ring R]
(p : R[X])
(T : Subring R)
(hp : ↑p.coeffs ⊆ ↑T)


theorem coe_equiv_fst_eq_one_iff_mem {g : G} (h1 : 1 ∈ S) :
    ((hST.equiv g).fst : G) = 1 ↔ g ∈ T

{G : Type u_1}
[Group G]
{S T : Set G}
(hST : Subgroup.IsComplement S T)
{g : G}
(h1 : 1 ∈ S)


theorem add_sub_of_le {a b : Nat} (h : a ≤ b) : a + (b - a) = b


@[simp, norm_cast]
theorem nnnorm_int (n : ℤ) : ‖(n : ℂ)‖₊ = ‖n‖₊

‖↑n‖₊ = ‖n‖₊


theorem condIndep_iSup_limsup [StandardBorelSpace Ω] [Nonempty Ω]
    (hm : m ≤ m0) [IsFiniteMeasure μ]
    (h_le : ∀ n, s n ≤ m0) (h_indep : iCondIndep m hm s μ) (hf : ∀ t, p t → tᶜ ∈ f)
    (hns : Directed (· ≤ ·) ns) (hnsp : ∀ a, p (ns a)) (hns_univ : ∀ n, ∃ a, n ∈ ns a) :
    CondIndep m (⨆ n, s n) (limsup s f) hm μ

(h_indep : ProbabilityTheory.iCondIndep m hm s μ)

(hns : Directed (fun x x_1 => x ≤ x_1) ns)

ProbabilityTheory.CondIndep m (⨆ n, s n) (Filter.limsup s f) hm μ


@[simp]
theorem equivOfIsometry_trans (e₁₂ : Q₁.IsometryEquiv Q₂) (e₂₃ : Q₂.IsometryEquiv Q₃) :
    (equivOfIsometry e₁₂).trans (equivOfIsometry e₂₃) = equivOfIsometry (e₁₂.trans e₂₃)

(e₁₂ : QuadraticMap.IsometryEquiv Q₁ Q₂)

(e₂₃ : QuadraticMap.IsometryEquiv Q₂ Q₃)

(CliffordAlgebra.equivOfIsometry e₁₂).trans (CliffordAlgebra.equivOfIsometry e₂₃) =
  CliffordAlgebra.equivOfIsometry (e₁₂.trans e₂₃)


@[to_additive (attr := simp)]
theorem leftInvEquiv_symm_mul (x : S) : ((S.leftInvEquiv hS).symm x : M) * x = 1

{M : Type u_1}
[AddCommMonoid M]
(S : AddSubmonoid M)
(hS : S ≤ IsAddUnit.addSubmonoid M)
(x : ↥S)


@[to_additive]
theorem tprod_even_mul_odd {f : ℕ → M} (he : Multipliable fun k ↦ f (2 * k))
    (ho : Multipliable fun k ↦ f (2 * k + 1)) :
    (∏' k, f (2 * k)) * ∏' k, f (2 * k + 1) = ∏' k, f k

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
[T2Space M]
[ContinuousAdd M]
{f : ℕ → M}
(he : Summable fun k => f (2 * k))
(ho : Summable fun k => f (2 * k + 1))


lemma postcomp_iff {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (hg : W g) :
    W (f ≫ g) ↔ W f

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

W (CategoryTheory.CategoryStruct.comp f g) ↔ W f


@[simp]
theorem limitCurrySwapCompLimIsoLimitCurryCompLim_hom_π_π {j} {k} :
    (limitCurrySwapCompLimIsoLimitCurryCompLim G).hom ≫ limit.π _ j ≫ limit.π _ k =
      (limit.π _ k ≫ limit.π _ j : limit (_ ⋙ lim) ⟶ _)

{J K : Type v}
[CategoryTheory.SmallCategory J]
[CategoryTheory.SmallCategory K]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
(G : J × K ⥤ C)
[CategoryTheory.Limits.HasLimits C]
{j : J}
{k : K}

(CategoryTheory.Limits.limitCurrySwapCompLimIsoLimitCurryCompLim G).hom ≫
    CategoryTheory.Limits.limit.π (CategoryTheory.curry.obj G ⋙ CategoryTheory.Limits.lim) j ≫
      CategoryTheory.Limits.limit.π ((CategoryTheory.curry.obj G).obj j) k =
  CategoryTheory.Limits.limit.π
      (CategoryTheory.curry.obj (CategoryTheory.Prod.swap K J ⋙ G) ⋙ CategoryTheory.Limits.lim) k ≫
    CategoryTheory.Limits.limit.π ((CategoryTheory.curry.obj (CategoryTheory.Prod.swap K J ⋙ G)).obj k) j


/-- A functor to the category of comonoid objects can be translated as a comonoid object
in the functor category. -/
@[simps]
def inverseObj (F : C ⥤ Comon_ D) : Comon_ (C ⥤ D)

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

(CategoryTheory.Monoidal.ComonFunctorCategoryEquivalence.inverseObj F).comul.app X = (F.obj X).comul


theorem xor_ne_zero {n m : ℕ} : n ^^^ m ≠ 0 ↔ n ≠ m


theorem uniformity_basis_dist_inv_nat_pos :
    (𝓤 α).HasBasis (fun n : ℕ => 0 < n) fun n : ℕ => { p : α × α | dist p.1 p.2 < 1 / ↑n }

(𝓤 α).HasBasis (fun n => 0 < n) fun n => {p | dist p.1 p.2 < 1 / ↑n}


@[ext]
theorem from_zero_ext {X : C} (f g : 0 ⟶ X) : f = g

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


@[simp]
theorem Ioo_mk_mk : Ioo (⟨i, a⟩ : Sigma α) ⟨i, b⟩ = (Ioo a b).map (Embedding.sigmaMk i)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → Preorder (α i)]
[(i : ι) → LocallyFiniteOrder (α i)]
(i : ι)
(a b : α i)

Finset.Ioo ⟨i, a⟩ ⟨i, b⟩ = Finset.map (Function.Embedding.sigmaMk i) (Finset.Ioo a b)


@[simp]
theorem merge_nil_right (t : Ordnode α) : merge nil t = t


/-- `comp p q` is the composition of `p : R[X]` and `q : M[X]` as `q(p(x))`.  -/
@[simps!]
noncomputable def comp (p : R[X]) : PolynomialModule R M →ₗ[R] PolynomialModule R M

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(p : R[X])

∀ (a : PolynomialModule R M),
  (PolynomialModule.comp p) a = (PolynomialModule.eval p) ((PolynomialModule.map R[X] (PolynomialModule.lsingle R 0)) a)


theorem support_binomial {k m : ℕ} (hkm : k ≠ m) {x y : R} (hx : x ≠ 0) (hy : y ≠ 0) :
    support (C x * X ^ k + C y * X ^ m) = {k, m}

{R : Type u}
[Semiring R]
{k m : ℕ}
(hkm : k ≠ m)
{x y : R}
(hx : x ≠ 0)
(hy : y ≠ 0)

(Polynomial.C x * Polynomial.X ^ k + Polynomial.C y * Polynomial.X ^ m).support = {k, m}


lemma algebraMap_le_of_le_spectrum {r : R} {a : A} (h : ∀ x ∈ spectrum R a, r ≤ x)
    (ha : p a := by cfc_tac) : algebraMap R A r ≤ a

[∀ (α : Type u_1) [inst : TopologicalSpace α], StarOrderedRing C(α, R)]


{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(M : Submodule R A)


theorem toReal_max (hr : a ≠ ∞) (hp : b ≠ ∞) :
    ENNReal.toReal (max a b) = max (ENNReal.toReal a) (ENNReal.toReal b)

(max a b).toReal = max a.toReal b.toReal


@[simp]
theorem modOf_apply_of_exists_add (x : k[G]) (g : G) (g' : G)
    (h : ∃ d, g' = g + d) : (x %ᵒᶠ g) g' = 0

{k : Type u_1}
{G : Type u_2}
[Semiring k]
[AddCancelCommMonoid G]
(x : AddMonoidAlgebra k G)
(g g' : G)
(h : ∃ d, g' = g + d)


lemma IndepFun_iff {β γ} [mβ : MeasurableSpace β] [mγ : MeasurableSpace γ]
    (f : Ω → β) (g : Ω → γ) (μ : Measure Ω) :
    IndepFun f g μ ↔ ∀ t1 t2, MeasurableSet[MeasurableSpace.comap f mβ] t1
      → MeasurableSet[MeasurableSpace.comap g mγ] t2 → μ (t1 ∩ t2) = μ t1 * μ t2

∀ {x : MeasurableSpace Ω} {β : Type u_6} {γ : Type u_7} [mβ : MeasurableSpace β] [mγ : MeasurableSpace γ] (f : Ω → β)
  (g : Ω → γ) (μ : MeasureTheory.Measure Ω),
  ProbabilityTheory.IndepFun f g μ ↔ ∀ (t1 t2 : Set Ω), MeasurableSet t1 → MeasurableSet t2 → μ (t1 ∩ t2) = μ t1 * μ t2


@[to_additive (attr := simp)]
protected theorem div_eq_one {s : S} : (s : R) /ₒ s = 1

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
{s : ↥S}


/-- `Fin.rev` as an `Equiv.Perm`, the antitone involution `Fin n → Fin n` given by
`i ↦ n-(i+1)`. -/
@[simps! apply symm_apply]
def revPerm : Equiv.Perm (Fin n)


theorem mem_span_singleton {x y : α} : x ∈ span ({y} : Set α) ↔ y ∣ x


{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
(x : α)
[AddGroup β]
[TopologicalAddGroup β]
(f : α →C₀ β)


/-- Subsets of a given closed subset form a closed set -/
theorem isClosed_subsets_of_isClosed (hs : IsClosed s) :
    IsClosed { t : Closeds α | (t : Set α) ⊆ s }

{α : Type u}
[EMetricSpace α]
{s : Set α}
(hs : IsClosed s)


/-- A side of a right-angled triangle divided by the tangent of the opposite angle equals the
adjacent side, version subtracting vectors. -/
theorem norm_div_tan_angle_sub_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x = 0 ∨ y ≠ 0) :
    ‖y‖ / Real.tan (angle x (x - y)) = ‖x‖

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)
(h0 : x = 0 ∨ y ≠ 0)

‖y‖ / Real.tan (InnerProductGeometry.angle x (x - y)) = ‖x‖


theorem ae_eq_trim_iff_of_aeStronglyMeasurable' {α β} [TopologicalSpace β] [MetrizableSpace β]
    {m m0 : MeasurableSpace α} {μ : Measure α} {f g : α → β} (hm : m ≤ m0)
    (hfm : AEStronglyMeasurable' m f μ) (hgm : AEStronglyMeasurable' m g μ) :
    hfm.mk f =ᵐ[μ.trim hm] hgm.mk g ↔ f =ᵐ[μ] g

(hfm : MeasureTheory.AEStronglyMeasurable' m f μ)

(hgm : MeasureTheory.AEStronglyMeasurable' m g μ)

MeasureTheory.AEStronglyMeasurable'.mk f hfm =ᵐ[μ.trim hm] MeasureTheory.AEStronglyMeasurable'.mk g hgm ↔ f =ᵐ[μ] g


@[to_additive (attr := simp)]
lemma not_mulDissociated :
    ¬ MulDissociated s ↔
      ∃ t : Finset α, ↑t ⊆ s ∧ ∃ u : Finset α, ↑u ⊆ s ∧ t ≠ u ∧ ∏ x in t, x = ∏ x in u, x

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

¬MulDissociated s ↔ ∃ t, ↑t ⊆ s ∧ ∃ u, ↑u ⊆ s ∧ t ≠ u ∧ ∏ x ∈ t, x = ∏ x ∈ u, x


theorem IsTopologicalBasis.iInf_induced {β : Type*} {ι : Type*} {X : ι → Type*}
    [t : Π i, TopologicalSpace (X i)] {T : Π i, Set (Set (X i))}
    (cond : ∀ i, IsTopologicalBasis (T i)) (f : Π i, β → X i) :
    IsTopologicalBasis (t := ⨅ i, induced (f i) (t i))
      { S | ∃ (U : ∀ i, Set (X i)) (F : Finset ι),
        (∀ i, i ∈ F → U i ∈ T i) ∧ S = ⋂ (i) (_ : i ∈ F), f i ⁻¹' U i }

(cond : ∀ (i : ι), TopologicalSpace.IsTopologicalBasis (T i))

TopologicalSpace.IsTopologicalBasis {S | ∃ U F, (∀ i ∈ F, U i ∈ T i) ∧ S = ⋂ i ∈ F, f i ⁻¹' U i}


/-- A function between linear orders which is neither monotone nor antitone makes a dent upright or
downright. -/
lemma not_monotone_not_antitone_iff_exists_lt_lt :
    ¬ Monotone f ∧ ¬ Antitone f ↔ ∃ a b c, a < b ∧ b < c ∧
    (f a < f b ∧ f c < f b ∨ f b < f a ∧ f b < f c)

{α : Type u}
{β : Type v}
[LinearOrder α]
[LinearOrder β]
{f : α → β}

¬Monotone f ∧ ¬Antitone f ↔ ∃ a b c, a < b ∧ b < c ∧ (f a < f b ∧ f c < f b ∨ f b < f a ∧ f b < f c)


/-- If `F` is of exponential characteristic `q`, then `F⟮x⟯ / F` is a purely inseparable extension
if and only if `x ^ (q ^ n)` is contained in `F` for some `n : ℕ`. -/
theorem isPurelyInseparable_adjoin_simple_iff_pow_mem (q : ℕ) [hF : ExpChar F q] {x : E} :
    IsPurelyInseparable F F⟮x⟯ ↔ ∃ n : ℕ, x ^ q ^ n ∈ (algebraMap F E).range

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(q : ℕ)
[hF : ExpChar F q]
{x : E}

IsPurelyInseparable F ↥F⟮x⟯ ↔ ∃ n, x ^ q ^ n ∈ (algebraMap F E).range


theorem irreducible_of_normalized_factor {a : α} :
    ∀ x : α, x ∈ normalizedFactors a → Irreducible x

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]
{a : α}
(x : α)

x ∈ UniqueFactorizationMonoid.normalizedFactors a → Irreducible x


theorem le_bind {α β : Type*} {f : α → Multiset β} (S : Multiset α) {x : α} (hx : x ∈ S) :
    f x ≤ S.bind f

{α : Type u_4}
{β : Type u_5}
{f : α → Multiset β}
(S : Multiset α)
{x : α}
(hx : x ∈ S)


/-- A `JordanHolderLattice` is the class for which the Jordan Hölder theorem is proved. A
Jordan Hölder lattice is a lattice equipped with a notion of maximality, `IsMaximal`, and a notion
of isomorphism of pairs `Iso`. In the example of subgroups of a group, `IsMaximal H K` means that
`H` is a maximal normal subgroup of `K`, and `Iso (H₁, K₁) (H₂, K₂)` means that the quotient
`H₁ / K₁` is isomorphic to the quotient `H₂ / K₂`. `Iso` must be symmetric and transitive and must
satisfy the second isomorphism theorem `Iso (H, H ⊔ K) (H ⊓ K, K)`.
Examples include `Subgroup G` if `G` is a group, and `Submodule R M` if `M` is an `R`-module.
-/
class JordanHolderLattice (X : Type u) [Lattice X] where
  IsMaximal : X → X → Prop
  lt_of_isMaximal : ∀ {x y}, IsMaximal x y → x < y
  sup_eq_of_isMaximal : ∀ {x y z}, IsMaximal x z → IsMaximal y z → x ≠ y → x ⊔ y = z
  isMaximal_inf_left_of_isMaximal_sup :
    ∀ {x y}, IsMaximal x (x ⊔ y) → IsMaximal y (x ⊔ y) → IsMaximal (x ⊓ y) x
  Iso : X × X → X × X → Prop
  iso_symm : ∀ {x y}, Iso x y → Iso y x
  iso_trans : ∀ {x y z}, Iso x y → Iso y z → Iso x z
  second_iso : ∀ {x y}, IsMaximal x (x ⊔ y) → Iso (x, x ⊔ y) (x ⊓ y, y)

{X : Type u}
[Lattice X]
[self : JordanHolderLattice X]
{x y : X}

JordanHolderLattice.IsMaximal x (x ⊔ y) → JordanHolderLattice.Iso (x, x ⊔ y) (x ⊓ y, y)


@[simp]
theorem taylor_X : taylor r X = X + C r

(Polynomial.taylor r) Polynomial.X = Polynomial.X + Polynomial.C r


theorem coe_iSup_of_directed (dir : Directed (· ≤ ·) K) : ↑(iSup K) = ⋃ i, (K i : Set A)

(dir : Directed (fun x x_1 => x ≤ x_1) K)


/-- A homeomorphism of spaces gives an equivalence of categories of presheaves. -/
@[simps!]
def presheafEquivOfIso {X Y : TopCat} (H : X ≅ Y) : X.Presheaf C ≌ Y.Presheaf C

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

∀ {X_1 Y_1 : (TopologicalSpace.Opens ↑X)ᵒᵖ ⥤ C} (α : X_1 ⟶ Y_1) (X_2 : (TopologicalSpace.Opens ↑Y)ᵒᵖ),
  ((TopCat.Presheaf.presheafEquivOfIso C H).functor.map α).app X_2 =
    α.app (Opposite.op ((TopologicalSpace.Opens.map H.hom).obj (Opposite.unop X_2)))


theorem ContinuousLinearMap.contMDiffWithinAt (L : E →L[𝕜] F) {s x} :
    ContMDiffWithinAt 𝓘(𝕜, E) 𝓘(𝕜, F) n L s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_8}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
(L : E →L[𝕜] F)
{s : Set E}
{x : E}

ContMDiffWithinAt 𝓘(𝕜, E) 𝓘(𝕜, F) n (⇑L) s x


theorem rel_map : ((R ⇒ P) ⇒ Forall₂ R ⇒ Forall₂ P) map map

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{R : α → β → Prop}
{P : γ → δ → Prop}

((R ⇒ P) ⇒ List.Forall₂ R ⇒ List.Forall₂ P) List.map List.map


lemma succAbove_eq_zero_iff [NeZero n] {a : Fin (n + 1)} {b : Fin n} (ha : a ≠ 0) :
    a.succAbove b = 0 ↔ b = 0

{n : ℕ}
[NeZero n]
{a : Fin (n + 1)}
{b : Fin n}
(ha : a ≠ 0)


lemma mod_two_of_bodd (n : ℕ) : n % 2 = cond (bodd n) 1 0


theorem of_map_sup [SemilatticeSup α] [SemilatticeSup β]
    (h : ∀ x ∈ s, ∀ y ∈ s, f (x ⊔ y) = f x ⊔ f y) : MonotoneOn f s

(h : ∀ (x : α), x ∈ s → ∀ (y : α), y ∈ s → f (x ⊔ y) = f x ⊔ f y)


theorem isAdjointPair_inner (A : E →ₗ[𝕜] F) :
    IsAdjointPair (sesqFormOfInner : E →ₗ[𝕜] E →ₗ⋆[𝕜] 𝕜) (sesqFormOfInner : F →ₗ[𝕜] F →ₗ⋆[𝕜] 𝕜) A
      (LinearMap.adjoint A)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
[FiniteDimensional 𝕜 E]
[FiniteDimensional 𝕜 F]
(A : E →ₗ[𝕜] F)

sesqFormOfInner.IsAdjointPair sesqFormOfInner A (LinearMap.adjoint A)


theorem image2_upperBounds_lowerBounds_subset_lowerBounds_image2 :
    image2 f (upperBounds s) (lowerBounds t) ⊆ lowerBounds (image2 f s t)

{f : α → β → γ}

(h₀ : ∀ (b : β), Antitone (Function.swap f b))

Set.image2 f (upperBounds s) (lowerBounds t) ⊆ lowerBounds (Set.image2 f s t)


lemma Complex.coe_realPart (z : ℂ) : (ℜ z : ℂ) = z.re


theorem pullbackIsoProdSubtype_inv_fst_apply (f : X ⟶ Z) (g : Y ⟶ Z)
    (x : { p : X × Y // f p.1 = g p.2 }) :
    pullback.fst f g ((pullbackIsoProdSubtype f g).inv x) = (x : X × Y).fst

{X Y Z : TopCat}
(f : X ⟶ Z)
(g : Y ⟶ Z)
(x : { p // f p.1 = g p.2 })

(CategoryTheory.Limits.pullback.fst f g) ((TopCat.pullbackIsoProdSubtype f g).inv x) = (↑x).1


theorem _root_.NNReal.natCast_natAbs (n : ℤ) : (n.natAbs : ℝ≥0) = ‖n‖₊


theorem norm_lt_one_add {z1 z2 : ℤ_[p]} (hz1 : ‖z1‖ < 1) (hz2 : ‖z2‖ < 1) : ‖z1 + z2‖ < 1

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{z1 z2 : ℤ_[p]}
(hz1 : ‖z1‖ < 1)
(hz2 : ‖z2‖ < 1)


lemma mul_mul_conjTranspose_same {A : Matrix n n R} (hA : PosSemidef A)
    {m : Type*} [Fintype m] (B : Matrix m n R) :
    PosSemidef (B * A * Bᴴ)

{n : Type u_2}
{R : Type u_3}
[Fintype n]
[CommRing R]
[PartialOrder R]
[StarRing R]
{A : Matrix n n R}
(hA : A.PosSemidef)
{m : Type u_5}
[Fintype m]
(B : Matrix m n R)


@[to_additive (attr := simp) negPart_pos] lemma one_lt_ltOnePart (ha : a < 1) : 1 < a⁻ᵐ

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


theorem midpoint_eq_iff {x y z : P} : midpoint R x y = z ↔ pointReflection R z x = y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}

midpoint R x y = z ↔ (AffineEquiv.pointReflection R z) x = y


@[simp]
theorem mem_mk_iff {p : Prop} {o : p → α} {a : α} : a ∈ Part.mk p o ↔ ∃ h, o h = a

{α : Type u_1}
{p : Prop}
{o : p → α}
{a : α}

a ∈ { Dom := p, get := o } ↔ ∃ (h : p), o h = a


@[simp]
theorem mk_div_mk (hx : 0 ≤ x) (hy : 0 ≤ y) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) / ⟨y, hy⟩ = ⟨x / y, div_nonneg hx hy⟩

{α : Type u_1}
[LinearOrderedSemifield α]
{x y : α}
(hx : 0 ≤ x)
(hy : 0 ≤ y)


@[to_additive]
theorem inv_div_left : a⁻¹ / b = (b * a)⁻¹

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


lemma harmonic_pos {n : ℕ} (Hn : n ≠ 0) : 0 < harmonic n


/-- If `Y` is a zero object, `X ≅ X ⊞ Y` for any `X`. -/
@[simps!]
def isoBiprodZero {X Y : C} [HasBinaryBiproduct X Y] (hY : IsZero Y) : X ≅ X ⊞ Y

(CategoryTheory.Limits.isoBiprodZero hY).hom = CategoryTheory.Limits.biprod.inl


{R : Type u_1}
[CommSemiring R]
{a a' c : R}
{b b' : ℕ}

a = a' → b = b' → a' ^ b' = c → a ^ b = c


theorem lcm_eq_of_associated_right [NormalizedGCDMonoid α] {m n : α} (h : Associated m n) (k : α) :
    lcm k m = lcm k n

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{m n : α}
(h : Associated m n)
(k : α)


theorem fderivWithin_csinh (hf : DifferentiableWithinAt ℂ f s x) (hxs : UniqueDiffWithinAt ℂ s x) :
    fderivWithin ℂ (fun x => Complex.sinh (f x)) s x = Complex.cosh (f x) • fderivWithin ℂ f s x

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


/-- The map from the empty scheme. -/
@[simps]
def Scheme.emptyTo (X : Scheme.{u}) : ∅ ⟶ X

(X : AlgebraicGeometry.Scheme)
(x : ↑↑∅.toPresheafedSpace)


theorem sup_not_succ_of_ne_sup {ι : Type u} {f : ι → Ordinal.{max u v}}
    (hf : ∀ i, f i ≠ sup.{_, v} f) {a} (hao : a < sup.{_, v} f) : succ a < sup.{_, v} f

{ι : Type u}
{f : ι → Ordinal.{max u v}}
(hf : ∀ (i : ι), f i ≠ Ordinal.sup f)
{a : Ordinal.{max u v}}
(hao : a < Ordinal.sup f)


@[norm_cast]
theorem coe_natCast (a : ℕ) : (↑(a : R) : A) = a

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


theorem IsPrime.mem_or_mem_of_mul_eq_zero {I : Ideal α} (hI : I.IsPrime) {x y : α} (h : x * y = 0) :
    x ∈ I ∨ y ∈ I

{α : Type u}
[Semiring α]
{I : Ideal α}
(hI : I.IsPrime)
{x y : α}
(h : x * y = 0)


/-- The composition of two homs. -/
@[simps]
noncomputable def Hom.comp (f : Hom P' P'') (g : Hom P P') : 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']
{R'' : Type u_4}
{S'' : Type u_5}
[CommRing R'']
[CommRing S'']
[Algebra R'' S'']
{P'' : Algebra.Generators R'' S''}
[Algebra S S'']
[Algebra R' R'']
[Algebra S' S'']
[Algebra R' S'']
[IsScalarTower R' R'' S'']
[IsScalarTower R' S' S'']
[IsScalarTower S S' S'']
(f : P'.Hom P'')
(g : P.Hom P')
(x : P.vars)

(f.comp g).val x = (MvPolynomial.aeval f.val) (g.val x)


@[to_additive (attr := simp)]
theorem measure_preimage_mul_right (μ : Measure G) [IsMulRightInvariant μ] (g : G) (A : Set G) :
    μ ((fun h => h * g) ⁻¹' A) = μ A

{G : Type u_2}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd G]
(μ : MeasureTheory.Measure G)
[μ.IsAddRightInvariant]
(g : G)
(A : Set G)


@[simp]
theorem toAffineEquiv_refl : (refl k P₁).toAffineEquiv = AffineEquiv.refl k P₁

{k : Type u_1}
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[TopologicalSpace P₁]

↑(ContinuousAffineEquiv.refl k P₁) = AffineEquiv.refl k P₁


theorem IsClosed.isCompact [CompactSpace X] (h : IsClosed s) : IsCompact s

{X : Type u}
[TopologicalSpace X]
{s : Set X}
[CompactSpace X]
(h : IsClosed s)


theorem sSup_inter_le {s t : Set α} : sSup (s ∩ t) ≤ sSup s ⊓ sSup t

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


/-- In a finite-dimensional space, if linear maps are inverse to each other on one side then they
are also inverse to each other on the other side. -/
theorem mul_eq_one_of_mul_eq_one [FiniteDimensional K V] {f g : V →ₗ[K] V} (hfg : f * g = 1) :
    g * f = 1

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{f g : V →ₗ[K] V}
(hfg : f * g = 1)


/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c

[∀ (a b : C), CategoryTheory.Limits.HasCoproductsOfShape (a ⟶ b) D]

(CategoryTheory.evaluationAdjunctionRight D c).unit.app X =
  CategoryTheory.Limits.Sigma.ι (fun x => X) (CategoryTheory.CategoryStruct.id c)


theorem isBigO_const_mul_left_iff {f : α → 𝕜} {c : 𝕜} (hc : c ≠ 0) :
    (fun x => c * f x) =O[l] g ↔ f =O[l] g

{α : Type u_1}
{F : Type u_4}
{𝕜 : Type u_15}
[Norm F]
[NormedDivisionRing 𝕜]
{g : α → F}
{l : Filter α}
{f : α → 𝕜}
{c : 𝕜}
(hc : c ≠ 0)


/-- `CuspFormClass F Γ k` says that `F` is a type of bundled functions that extend
`SlashInvariantFormClass` by requiring that the functions be holomorphic and zero
at infinity. -/
class CuspFormClass (F : Type*) (Γ : outParam <| Subgroup (SL(2, ℤ))) (k : outParam ℤ)
    [FunLike F ℍ ℂ] extends SlashInvariantFormClass F Γ k : Prop where
  holo : ∀ f : F, MDifferentiable 𝓘(ℂ) 𝓘(ℂ) (f : ℍ → ℂ)
  zero_at_infty : ∀ (f : F) (A : SL(2, ℤ)), IsZeroAtImInfty (f ∣[k] A)

{F : Type u_2}
{Γ : outParam (Subgroup SL(2, ℤ))}
{k : outParam ℤ}
[FunLike F ℍ ℂ]
[self : CuspFormClass F Γ k]
(f : F)


@[simp]
theorem prod_assoc_symm_preimage {α β γ} {s : Set α} {t : Set β} {u : Set γ} :
    (Equiv.prodAssoc α β γ).symm ⁻¹' (s ×ˢ t) ×ˢ u = s ×ˢ t ×ˢ u

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
{t : Set β}
{u : Set γ}

⇑(Equiv.prodAssoc α β γ).symm ⁻¹' (s ×ˢ t) ×ˢ u = s ×ˢ t ×ˢ u


theorem nndist_coe_le_nndist (x : α) : nndist (f x) (g x) ≤ nndist f g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{f g : BoundedContinuousFunction α β}
(x : α)


theorem isUnit_of_self_mul_dvd_separable {p q : R[X]} (hp : p.Separable) (hq : q * q ∣ p) :
    IsUnit q

{R : Type u}
[CommSemiring R]
{p q : R[X]}
(hp : p.Separable)
(hq : q * q ∣ p)


/-- Being filtered is preserved by equivalence of categories. -/
theorem of_equivalence (h : C ≌ D) : IsFiltered D

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


/-- If A is an algebraic algebra over R, then A is algebraic over S when S is an extension of R,
  and the map from `R` to `S` is injective. -/
theorem Algebra.IsAlgebraic.tower_top_of_injective (hinj : Function.Injective (algebraMap R S))
    [Algebra.IsAlgebraic R A] : Algebra.IsAlgebraic S A

(hinj : Function.Injective ⇑(algebraMap R S))


@[simp]
theorem lid_symm_apply (a : A) : (TensorProduct.lid R A).symm a = 1 ⊗ₜ a

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

(Algebra.TensorProduct.lid R A).symm a = 1 ⊗ₜ[R] a


lemma posSMulStrictMono_iff_PosSMulReflectLE : PosSMulStrictMono α β ↔ PosSMulReflectLE α β

{α : Type u_1}
{β : Type u_2}
[SMul α β]
[Preorder α]
[LinearOrder β]
[Zero α]


/-- Given a weakly regular measure, any measurable set of finite mass can be approximated from
inside by closed sets. -/
theorem _root_.MeasurableSet.exists_lt_isClosed_of_ne_top [WeaklyRegular μ] ⦃A : Set α⦄
    (hA : MeasurableSet A) (h'A : μ A ≠ ∞) {r : ℝ≥0∞} (hr : r < μ A) :
    ∃ K, K ⊆ A ∧ IsClosed K ∧ r < μ K

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[μ.WeaklyRegular]
⦃A : Set α⦄
(hA : MeasurableSet A)
(h'A : μ A ≠ ⊤)
{r : ℝ≥0∞}
(hr : r < μ A)


theorem convs'Aux_stable_step_of_terminated {s : Stream'.Seq <| Pair K}
    (terminatedAt_n : s.TerminatedAt n) : convs'Aux s (n + 1) = convs'Aux s n

{K : Type u_1}
{n : ℕ}
[DivisionRing K]
{s : Stream'.Seq (GenContFract.Pair K)}
(terminatedAt_n : s.TerminatedAt n)

GenContFract.convs'Aux s (n + 1) = GenContFract.convs'Aux s n


@[simp]
theorem mul_empty [Fintype n'] (A : Matrix m' n' α) (B : Matrix n' (Fin 0) α) :
    A * B = of fun _ => ![]

{α : Type u}
{m' : Type uₘ}
{n' : Type uₙ}
[NonUnitalNonAssocSemiring α]
[Fintype n']
(A : Matrix m' n' α)
(B : Matrix n' (Fin 0) α)


@[to_additive (attr := simp)]
theorem OneHom.mulSingle_apply [∀ i, One <| f i] (i : I) (x : f i) :
    mulSingle f i x = Pi.mulSingle i x

{I : Type u}
(f : I → Type v)
[DecidableEq I]
[(i : I) → Zero (f i)]
(i : I)
(x : f i)


theorem discrete_isNormal : (@discrete C _).IsNormal

{C : Type u}
[CategoryTheory.Groupoid C]


theorem span_pair_comm {x y : α} : (span {x, y} : Ideal α) = span {y, x}


/-- **Harris-Kleitman inequality**: Any two lower sets of finsets correlate. -/
theorem IsLowerSet.le_card_inter_finset' (h𝒜 : IsLowerSet (𝒜 : Set (Finset α)))
    (hℬ : IsLowerSet (ℬ : Set (Finset α))) (h𝒜s : ∀ t ∈ 𝒜, t ⊆ s) (hℬs : ∀ t ∈ ℬ, t ⊆ s) :
    𝒜.card * ℬ.card ≤ 2 ^ s.card * (𝒜 ∩ ℬ).card

{α : Type u_1}
[DecidableEq α]
{𝒜 ℬ : Finset (Finset α)}
{s : Finset α}
(h𝒜 : IsLowerSet ↑𝒜)
(hℬ : IsLowerSet ↑ℬ)
(h𝒜s : ∀ t ∈ 𝒜, t ⊆ s)
(hℬs : ∀ t ∈ ℬ, t ⊆ s)


theorem prod_iInf_left [Nonempty ι] {f : ι → Filter α} {g : Filter β} :
    (⨅ i, f i) ×ˢ g = ⨅ i, f i ×ˢ g

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[Nonempty ι]
{f : ι → Filter α}
{g : Filter β}


@[simp]
theorem coe_flipₗᵢ : ⇑(flipₗᵢ 𝕜 E Fₗ Gₗ) = flip

{𝕜 : Type u_1}
{E : Type u_4}
{Fₗ : Type u_7}
{Gₗ : Type u_9}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup Fₗ]
[SeminormedAddCommGroup Gₗ]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 Fₗ]
[NormedSpace 𝕜 Gₗ]

⇑(ContinuousLinearMap.flipₗᵢ 𝕜 E Fₗ Gₗ) = ContinuousLinearMap.flip


/-- `norm` as a `MonoidWithZeroHom`. -/
@[simps]
def normHom : α →*₀ ℝ


@[simp]
theorem Subsequent.mk_left {xl xr} (xL : xl → PGame) (xR : xr → PGame) (i : xl) :
    Subsequent (xL i) (mk xl xr xL xR)

{xl xr : Type u_1}
(xL : xl → SetTheory.PGame)
(xR : xr → SetTheory.PGame)
(i : xl)

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


theorem Ioi_le_Ici (a : α) : Ioi a ≤ Ici a


@[simp]
theorem basicOpen_eq_zeroLocus_compl (r : R) :
    (basicOpen r : Set (PrimeSpectrum R)) = (zeroLocus {r})ᶜ

↑(PrimeSpectrum.basicOpen r) = (PrimeSpectrum.zeroLocus {r})ᶜ


theorem parallelepiped_basis_eq (b : Basis ι ℝ E) :
    parallelepiped b = {x | ∀ i, b.repr x i ∈ Set.Icc 0 1}

{ι : Type u_1}
{E : Type u_3}
[Fintype ι]
[AddCommGroup E]
[Module ℝ E]
(b : Basis ι ℝ E)

parallelepiped ⇑b = {x | ∀ (i : ι), (b.repr x) i ∈ Set.Icc 0 1}


@[simp]
theorem coe_mk' (f : P1 → P2) (f' : V1 →ₗ[k] V2) (p h) : ⇑(mk' f f' p h) = f


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

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

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


theorem mem_nhds_of_pi_mem_nhds {I : Set ι} {s : ∀ i, Set (π i)} (a : ∀ i, π i) (hs : I.pi s ∈ 𝓝 a)
    {i : ι} (hi : i ∈ I) : s i ∈ 𝓝 (a i)

{ι : Type u_5}
{π : ι → Type u_6}
[T : (i : ι) → TopologicalSpace (π i)]
{I : Set ι}
{s : (i : ι) → Set (π i)}
(a : (i : ι) → π i)
(hs : I.pi s ∈ 𝓝 a)
{i : ι}
(hi : i ∈ I)


@[deprecated getElem?_range (since := "2024-06-12")]
theorem get?_range {m n : Nat} (h : m < n) : get? (range n) m = some m


theorem congr_point {X Y : PresheafedSpace.{_, _, v} C}
    (α : X ⟶ Y) (x x' : X) (h : x = x') :
    α.stalkMap x ≫ eqToHom (show X.presheaf.stalk x = X.presheaf.stalk x' by rw [h]) =
      eqToHom (show Y.presheaf.stalk (α.base x) =
        Y.presheaf.stalk (α.base x') by rw [h]) ≫ α.stalkMap x'

{X Y : AlgebraicGeometry.PresheafedSpace C}

AlgebraicGeometry.PresheafedSpace.Hom.stalkMap α x ≫ CategoryTheory.eqToHom ⋯ =
  CategoryTheory.eqToHom ⋯ ≫ AlgebraicGeometry.PresheafedSpace.Hom.stalkMap α x'


@[simp]
protected theorem coe_toFinset : (hs.toFinset : Set α) = s

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


@[to_additive (attr := simp)]
theorem nnnorm_smul_Lp (c : Mᵈᵐᵃ) (f : Lp E p μ) : ‖c • f‖₊ = ‖f‖₊

[MeasureTheory.SMulInvariantMeasure M α μ]

‖c • f‖₊ = ‖f‖₊


theorem specializes_iff_pure : x ⤳ y ↔ pure x ≤ 𝓝 y

{X : Type u_1}
[TopologicalSpace X]
{x y : X}


theorem Sbtw.right_mem_image_Ioi {x y z : P} (h : Sbtw R x y z) :
    z ∈ lineMap x y '' Set.Ioi (1 : R)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}
(h : Sbtw R x y z)

z ∈ ⇑(AffineMap.lineMap x y) '' Set.Ioi 1


@[simp]
theorem deriv_sum (h : ∀ i ∈ u, DifferentiableAt 𝕜 (A i) x) :
    deriv (fun y => ∑ i ∈ u, A i y) x = ∑ i ∈ u, deriv (A i) x


theorem singletonSubgraph_connected {v : V} : (G.singletonSubgraph v).Connected

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


@[simp]
theorem coe_mk (f : M →ₗ[R] N) (h) : ((⟨f, h⟩ : M →ₗ⁅R,L⁆ N) : M → N) = f

(h : ∀ {x : L} {m : M}, f.toFun ⁅x, m⁆ = ⁅x, f.toFun m⁆)

⇑{ toLinearMap := f, map_lie' := h } = ⇑f


@[simp]
theorem sInf_empty : sInf (∅ : Set Ordinal) = 0


theorem codisjoint_right : Codisjoint s t ↔ ∀ ⦃a⦄, a ∉ t → a ∈ s

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

Codisjoint s t ↔ ∀ ⦃a : α⦄, a ∉ t → a ∈ s


theorem getD_append (l l' : List α) (d : α) (n : ℕ) (h : n < l.length) :
    (l ++ l').getD n d = l.getD n d

{α : Type u}
(l l' : List α)
(d : α)
(n : ℕ)
(h : n < l.length)


theorem coprod_zero_right (f : M →ₗ[R] M₃) : f.coprod (0 : M₂ →ₗ[R] M₃) = f.comp (fst R M M₂)

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
(f : M →ₗ[R] M₃)


@[simp] lemma sum_comp (s : Finset ι) (p : ι → R[X]) (q : R[X]) :
    (∑ i ∈ s, p i).comp q = ∑ i ∈ s, (p i).comp q

{R : Type u}
{ι : Type y}
[Semiring R]
(s : Finset ι)
(p : ι → R[X])
(q : R[X])


theorem eval_eq (l : Products I) (x : C) :
    l.eval C x = if ∀ i, i ∈ l.val → (x.val i = true) then 1 else 0

(l : Profinite.NobelingProof.Products I)

(Profinite.NobelingProof.Products.eval C l) x = if ∀ i ∈ ↑l, ↑x i = true then 1 else 0


/-- The product comparison morphism from `F(A ⨯ -)` to `FA ⨯ F-`, whose components are given by
`prodComparison`.
-/
@[simps]
def prodComparisonNatTrans [HasBinaryProducts C] [HasBinaryProducts D] (F : C ⥤ D) (A : C) :
    prod.functor.obj A ⋙ F ⟶ F ⋙ prod.functor.obj (F.obj A)

(CategoryTheory.Limits.prodComparisonNatTrans F A).app B = CategoryTheory.Limits.prodComparison F A B


lemma toNNRat_div (hp : 0 ≤ p) : toNNRat (p / q) = toNNRat p / toNNRat q


theorem ofNat_mod_ofNat (m n : Nat) : (m % n : Int) = ↑(m % n)


lemma cosh_eq_tsum (z : ℂ) : cosh z = ∑' n, z ^ (2 * n) / ↑(2 * n)!

Complex.cosh z = ∑' (n : ℕ), z ^ (2 * n) / ↑(2 * n)!


@[simp]
theorem star_ofNat [NonAssocSemiring R] [StarRing R] (n : ℕ) [n.AtLeastTwo] :
    star (no_index (OfNat.ofNat n) : R) = OfNat.ofNat n

{R : Type u}
[NonAssocSemiring R]
[StarRing R]
(n : ℕ)
[n.AtLeastTwo]


theorem accumulate_def [LE α] {x : α} : Accumulate s x = ⋃ y ≤ x, s y

{α : Type u_1}
{β : Type u_2}
{s : α → Set β}
[LE α]
{x : α}

Set.Accumulate s x = ⋃ y, ⋃ (_ : y ≤ x), s y


@[simp] theorem length_eq_zero : length l = 0 ↔ l = []

∀ {α : Type u_1} {l : List α}, l.length = 0 ↔ l = []


/-- The structure map of a compactum actually computes limits. -/
theorem lim_eq_str {X : Compactum} (F : Ultrafilter X) : F.lim = X.str F


theorem zero_not_mem_nonZeroDivisors [Nontrivial M] : 0 ∉ M⁰

{M : Type u_2}
[MonoidWithZero M]
[Nontrivial M]


theorem adjointAux_adjointAux (A : E →L[𝕜] F) : adjointAux (adjointAux A) = A

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
[CompleteSpace E]
[CompleteSpace F]
(A : E →L[𝕜] F)

ContinuousLinearMap.adjointAux (ContinuousLinearMap.adjointAux A) = A


theorem eq_insertNth_iff {p : Fin (n + 1)} {a : α p} {f : ∀ i, α (p.succAbove i)} {g : ∀ j, α j} :
    g = insertNth p a f ↔ g p = a ∧ removeNth p g = f

{n : ℕ}
{α : Fin (n + 1) → Type u}
{p : Fin (n + 1)}
{a : α p}
{f : (i : Fin n) → α (p.succAbove i)}
{g : (j : Fin (n + 1)) → α j}

g = p.insertNth a f ↔ g p = a ∧ p.removeNth g = f


@[to_additive]
protected theorem map_list_prod (f : M →* N) (l : List M) : f l.prod = (l.map f).prod

{M : Type u_4}
{N : Type u_5}
[AddMonoid M]
[AddMonoid N]
(f : M →+ N)
(l : List M)


@[norm_cast]
theorem coe_ne_zero {x : ℝ} : (x : ℝ*) ≠ 0 ↔ x ≠ 0

↑x ≠ 0 ↔ x ≠ 0


/-- Definition for a primitive additive character on a finite ring `R` into a cyclotomic extension
of a field `R'`. It records which cyclotomic extension it is, the character, and the
fact that the character is primitive. -/
-- Porting note(#5171): this linter isn't ported yet.
-- can't prove that they always exist (referring to providing an `Inhabited` instance)
-- @[nolint has_nonempty_instance]
structure PrimitiveAddChar (R : Type u) [CommRing R] (R' : Type v) [Field R'] where
  /-- The first projection from `PrimitiveAddChar`, giving the cyclotomic field. -/
  n : ℕ+
  /-- The second projection from `PrimitiveAddChar`, giving the character. -/
  char : AddChar R (CyclotomicField n R')
  /-- The third projection from `PrimitiveAddChar`, showing that `χ.char` is primitive. -/
  prim : IsPrimitive char

{R : Type u}
[CommRing R]
{R' : Type v}
[Field R']
(self : AddChar.PrimitiveAddChar R R')


lemma div_lt_comm₀ (hb : 0 < b) (hc : 0 < c) : a / b < c ↔ a / c < b

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


theorem coeff_mul_monomial (a : R) :
    coeff R m (φ * monomial R n a) = if n ≤ m then coeff R (m - n) φ * a else 0

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(m n : σ →₀ ℕ)
(φ : MvPowerSeries σ R)
(a : R)

(MvPowerSeries.coeff R m) (φ * (MvPowerSeries.monomial R n) a) =
  if n ≤ m then (MvPowerSeries.coeff R (m - n)) φ * a else 0


@[simp]
theorem vsub_eq_empty : s -ᵥ t = ∅ ↔ s = ∅ ∨ t = ∅

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


@[simp]
theorem inf_coe_to_submodule :
    (↑(K ⊓ K') : Submodule R L) = (K : Submodule R L) ⊓ (K' : Submodule R L)

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(K K' : LieSubalgebra R L)

(K ⊓ K').toSubmodule = K.toSubmodule ⊓ K'.toSubmodule


@[simp]
theorem Ioo_eq_empty_iff [DenselyOrdered α] : Ioo a b = ∅ ↔ ¬a < b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}
[DenselyOrdered α]


/-- A function on `[a, b]` with the norm of the derivative within `[a, b]`
bounded by `C` satisfies `‖f x - f a‖ ≤ C * (x - a)`, `HasDerivWithinAt`
version. -/
theorem norm_image_sub_le_of_norm_deriv_le_segment' {f' : ℝ → E} {C : ℝ}
    (hf : ∀ x ∈ Icc a b, HasDerivWithinAt f (f' x) (Icc a b) x)
    (bound : ∀ x ∈ Ico a b, ‖f' x‖ ≤ C) : ∀ x ∈ Icc a b, ‖f x - f a‖ ≤ C * (x - a)

(hf : ∀ x ∈ Set.Icc a b, HasDerivWithinAt f (f' x) (Set.Icc a b) x)

x ∈ Set.Icc a b → ‖f x - f a‖ ≤ C * (x - a)


lemma equivQuotTensor_naturality_mk (f : M →ₗ[R] M') (x : M) :
    equivQuotTensor r M' (map r f (Submodule.Quotient.mk x)) =
      f.lTensor (R ⧸ Ideal.span {r})
        (equivQuotTensor r M (Submodule.Quotient.mk x))

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

(QuotSMulTop.equivQuotTensor r M') (((QuotSMulTop.map r) f) (Submodule.Quotient.mk x)) =
  (LinearMap.lTensor (R ⧸ Ideal.span {r}) f) ((QuotSMulTop.equivQuotTensor r M) (Submodule.Quotient.mk x))


@[simp]
theorem bihimp_eq_top {a b : α} : a ⇔ b = ⊤ ↔ a = b

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


@[simp]
theorem conjTranspose_col [Star α] (v : m → α) : (col ι v)ᴴ = row ι (star v)

{m : Type u_2}
{α : Type v}
{ι : Type u_6}
[Star α]
(v : m → α)

(Matrix.col ι v).conjTranspose = Matrix.row ι (star v)


theorem MeasurableSpace.comap_compl {m' : MeasurableSpace β} [BooleanAlgebra β]
    (h : Measurable (compl : β → β)) (f : α → β) :
    MeasurableSpace.comap (fun a => (f a)ᶜ) inferInstance =
      MeasurableSpace.comap f inferInstance

{α : Type u_1}
{β : Type u_2}
{m' : MeasurableSpace β}
[BooleanAlgebra β]
(h : Measurable compl)
(f : α → β)


lemma boundedSub_of_lipschitzWith_sub [PseudoMetricSpace R] [Sub R] {K : NNReal}
    (lip : LipschitzWith K (fun (p : R × R) ↦ p.1 - p.2)) :
    BoundedSub R

(lip : LipschitzWith K fun p => p.1 - p.2)


theorem fromAddMonoid_of_apply (i : ι) (f : γ →+ β i) (x : γ) :
    fromAddMonoid (of _ i f) x = of _ i (f x)

{ι : Type v}
{β : ι → Type w}
[(i : ι) → AddCommMonoid (β i)]
[DecidableEq ι]
{γ : Type u₁}
[AddCommMonoid γ]
(i : ι)
(f : γ →+ β i)
(x : γ)

(DirectSum.fromAddMonoid ((DirectSum.of (fun i => γ →+ β i) i) f)) x = (DirectSum.of β i) (f x)


@[simp]
theorem type_lt (o : Ordinal) : type ((· < ·) : o.out.α → o.out.α → Prop) = o


@[to_additive mod_addOrderOf_zsmul]
lemma zpow_mod_orderOf (x : G) (z : ℤ) : x ^ (z % (orderOf x : ℤ)) = x ^ z

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


theorem Continuous.tendsto (hf : Continuous f) (x) : Tendsto f (𝓝 x) (𝓝 (f x))

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


/-- **Phragmen-Lindelöf principle** in the fourth quadrant. Let `f g : ℂ → E` be functions such that

* `f` and `g` are differentiable in the open fourth quadrant and are continuous on its closure;
* `‖f z‖` and `‖g z‖` are bounded from above by `A * exp(B * (abs z) ^ c)` on the open fourth
  quadrant for some `A`, `B`, and `c < 2`;
* `f` is equal to `g` on the boundary of the fourth quadrant.

Then `f` is equal to `g` on the closed fourth quadrant. -/
theorem eqOn_quadrant_IV (hdf : DiffContOnCl ℂ f (Ioi 0 ×ℂ Iio 0))
    (hBf : ∃ c < (2 : ℝ), ∃ B,
      f =O[cobounded ℂ ⊓ 𝓟 (Ioi 0 ×ℂ Iio 0)] fun z => expR (B * abs z ^ c))
    (hdg : DiffContOnCl ℂ g (Ioi 0 ×ℂ Iio 0))
    (hBg : ∃ c < (2 : ℝ), ∃ B,
      g =O[cobounded ℂ ⊓ 𝓟 (Ioi 0 ×ℂ Iio 0)] fun z => expR (B * abs z ^ c))
    (hre : ∀ x : ℝ, 0 ≤ x → f x = g x) (him : ∀ x : ℝ, x ≤ 0 → f (x * I) = g (x * I)) :
    EqOn f g {z | 0 ≤ z.re ∧ z.im ≤ 0}

(hdf : DiffContOnCl ℂ f (Set.Ioi 0 ×ℂ Set.Iio 0))

(hBf : ∃ c < 2, ∃ B, f =O[Bornology.cobounded ℂ ⊓ 𝓟 (Set.Ioi 0 ×ℂ Set.Iio 0)] fun z => expR (B * Complex.abs z ^ c))

(hdg : DiffContOnCl ℂ g (Set.Ioi 0 ×ℂ Set.Iio 0))

(hBg : ∃ c < 2, ∃ B, g =O[Bornology.cobounded ℂ ⊓ 𝓟 (Set.Ioi 0 ×ℂ Set.Iio 0)] fun z => expR (B * Complex.abs z ^ c))

(him : ∀ x ≤ 0, f (↑x * Complex.I) = g (↑x * Complex.I))


/-- This structure permits to define a fiber bundle when trivializations are given as local
equivalences but there is not yet a topology on the total space. The total space is hence given a
topology in such a way that there is a fiber bundle structure for which the partial equivalences
are also partial homeomorphisms and hence local trivializations. -/
-- Porting note (#5171): was @[nolint has_nonempty_instance]
structure FiberPrebundle where
  pretrivializationAtlas : Set (Pretrivialization F (π F E))
  pretrivializationAt : B → Pretrivialization F (π F E)
  mem_base_pretrivializationAt : ∀ x : B, x ∈ (pretrivializationAt x).baseSet
  pretrivialization_mem_atlas : ∀ x : B, pretrivializationAt x ∈ pretrivializationAtlas
  continuous_trivChange : ∀ e, e ∈ pretrivializationAtlas → ∀ e', e' ∈ pretrivializationAtlas →
    ContinuousOn (e ∘ e'.toPartialEquiv.symm) (e'.target ∩ e'.toPartialEquiv.symm ⁻¹' e.source)
  totalSpaceMk_inducing : ∀ b : B, Inducing (pretrivializationAt b ∘ TotalSpace.mk b)

(e : Pretrivialization F Bundle.TotalSpace.proj)

e ∈ self.pretrivializationAtlas →
  ∀ e' ∈ self.pretrivializationAtlas, ContinuousOn (↑e ∘ ↑e'.symm) (e'.target ∩ ↑e'.symm ⁻¹' e.source)


@[to_additive (attr := simp)]
theorem comap_unop_nhds (x : M) : comap (unop : Mᵐᵒᵖ → M) (𝓝 x) = 𝓝 (op x)

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

Filter.comap AddOpposite.unop (𝓝 x) = 𝓝 (AddOpposite.op x)


theorem Bijective.iterate (Hbij : Bijective f) (n : ℕ) : Bijective f^[n]

{α : Type u}
{f : α → α}
(Hbij : Function.Bijective f)
(n : ℕ)


theorem sub_mem_Icc_iff_right : a - b ∈ Set.Icc c d ↔ b ∈ Set.Icc (a - d) (a - c)

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


/-- If `H ≤ K`, then `G/H ≃ G/K × K/H` constructively, using the provided right inverse
of the quotient map `G → G/K`. The classical version is `Subgroup.quotientEquivProdOfLE`. -/
@[to_additive (attr := simps)
  "If `H ≤ K`, then `G/H ≃ G/K × K/H` constructively, using the provided right inverse
  of the quotient map `G → G/K`. The classical version is `AddSubgroup.quotientEquivSumOfLE`."]
def quotientEquivProdOfLE' (h_le : s ≤ t) (f : α ⧸ t → α)
    (hf : Function.RightInverse f QuotientGroup.mk) : α ⧸ s ≃ (α ⧸ t) × t ⧸ s.subgroupOf t

(hf : Function.RightInverse f QuotientAddGroup.mk)

(AddSubgroup.quotientEquivSumOfLE' h_le f hf).symm a = Quotient.map' (fun b => f a.1 + ↑b) ⋯ a.2


theorem diam_subsingleton (hs : s.Subsingleton) : diam s = 0

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(hs : s.Subsingleton)


@[simp]
theorem image_const_add_Ioi : (fun x => a + x) '' Ioi b = Ioi (a + b)

{M : Type u_1}
[OrderedCancelAddCommMonoid M]
[ExistsAddOfLE M]
(a b : M)

(fun x => a + x) '' Set.Ioi b = Set.Ioi (a + b)


theorem tendsto_logGammaSeq_of_le_one (hf_conv : ConvexOn ℝ (Ioi 0) f)
    (hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y) (hx : 0 < x) (hx' : x ≤ 1) :
    Tendsto (logGammaSeq x) atTop (𝓝 <| f x - f 1)

(hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + Real.log y)

Filter.Tendsto (Real.BohrMollerup.logGammaSeq x) Filter.atTop (𝓝 (f x - f 1))


theorem _root_.IsFractional.mul {I J : Submodule R P} :
    IsFractional S I → IsFractional S J → IsFractional S (I * J : Submodule R P)

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

IsFractional S I → IsFractional S J → IsFractional S (I * J)


/-- For 0 < x, we have sin x < x. -/
theorem sin_lt (h : 0 < x) : sin x < x


/-- The counit isomorphism of the equivalence `(C ⥤ Karoubi D) ≌ (Karoubi C ⥤ Karoubi D)`. -/
@[simps!]
def KaroubiUniversal₁.counitIso :
    (whiskeringLeft C (Karoubi C) (Karoubi D)).obj (toKaroubi C) ⋙ functorExtension₁ C D ≅ 𝟭 _

(X : CategoryTheory.Functor (CategoryTheory.Idempotents.Karoubi C) (CategoryTheory.Idempotents.Karoubi D))

(P : CategoryTheory.Idempotents.Karoubi C)

(((CategoryTheory.Idempotents.KaroubiUniversal₁.counitIso C D).hom.app X).app P).f = (X.map P.decompId_p).f


@[to_additive (attr := simp)]
theorem coe_fst : ⇑(fst M N) = Prod.fst

{M : Type u_5}
{N : Type u_6}
[AddZeroClass M]
[AddZeroClass N]


theorem liftOn_ofFractionRing_mk {P : Sort v} (n : K[X]) (d : K[X]⁰) (f : K[X] → K[X] → P)
    (H : ∀ {p q p' q'} (_hq : q ∈ K[X]⁰) (_hq' : q' ∈ K[X]⁰), q' * p = q * p' → f p q = f p' q') :
    RatFunc.liftOn (ofFractionRing (Localization.mk n d)) f @H = f n d

(H : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q')

{ toFractionRing := Localization.mk n d }.liftOn f H = f n ↑d


theorem degree_gcd_le_left {p : R[X]} (hp : p ≠ 0) (q) : (gcd p q).degree ≤ p.degree

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


/-- A minimal polynomial is irreducible. -/
theorem irreducible (hx : IsIntegral A x) : Irreducible (minpoly A x)

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


theorem forall₂_refl [IsRefl α Rₐ] (l : List α) : Forall₂ Rₐ l l

{α : Type u_1}
{Rₐ : α → α → Prop}
[IsRefl α Rₐ]
(l : List α)


theorem LinearMap.toMatrix₂_compl₂ (B : M₁ →ₗ[R] M₂ →ₗ[R] R) (f : M₂' →ₗ[R] M₂) :
    LinearMap.toMatrix₂ b₁ b₂' (B.compl₂ f) =
      LinearMap.toMatrix₂ b₁ b₂ B * toMatrix b₂' b₂ f

{R : Type u_1}
{M₁ : Type u_7}
{M₂ : Type u_8}
{M₂' : Type u_10}
{n : Type u_12}
{m : Type u_13}
{m' : Type u_15}
[CommSemiring R]
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
(b₁ : Basis n R M₁)
(b₂ : Basis m R M₂)
[AddCommMonoid M₂']
[Module R M₂']
(b₂' : Basis m' R M₂')
[Fintype m']
[DecidableEq m']
(B : M₁ →ₗ[R] M₂ →ₗ[R] R)
(f : M₂' →ₗ[R] M₂)

(LinearMap.toMatrix₂ b₁ b₂') (B.compl₂ f) = (LinearMap.toMatrix₂ b₁ b₂) B * (LinearMap.toMatrix b₂' b₂) f


theorem mk_injective (A B : T) :
    Function.Injective (Arrow.mk : (A ⟶ B) → Arrow T)

{T : Type u}
[CategoryTheory.Category.{v, u} T]
(A B : T)


@[simp]
theorem gcd_sub_self_right {m n : ℕ} (h : m ≤ n) : gcd m (n - m) = gcd m n


theorem BAll.imp_left (H : ∀ x, p x → q x) (h₁ : ∀ x, q x → r x) (x) (h : p x) : r x

{α : Sort u_1}
{r p q : α → Prop}
(H : ∀ (x : α), p x → q x)
(h₁ : ∀ (x : α), q x → r x)
(x : α)
(h : p x)


protected theorem pow_le_pow_iff_right {a n m : Nat} (h : 1 < a) :
    a ^ n ≤ a ^ m ↔ n ≤ m


theorem sup_factors_of_factors_right {A B : C} {X Y : Subobject B} {f : A ⟶ B} (P : Y.Factors f) :
    (X ⊔ Y).Factors f


@[simp]
theorem coe_copy (S : Subfield K) (s : Set K) (hs : s = ↑S) : (S.copy s hs : Set K) = s

{K : Type u}
[DivisionRing K]
(S : Subfield K)
(s : Set K)
(hs : s = ↑S)


theorem union_def (l₁ l₂ : List α)  : l₁ ∪ l₂ = foldr .insert l₂ l₁


theorem add_omega_opow {a b : Ordinal} (h : a < (omega^b)) : a + (omega^b) = (omega^b)

{a b : Ordinal.{u_1}}
(h : a < Ordinal.omega ^ b)

a + Ordinal.omega ^ b = Ordinal.omega ^ b


@[simp]
theorem support_uniformOfFintype (α : Type*) [Fintype α] [Nonempty α] :
    (uniformOfFintype α).support = ⊤


theorem dropn_add (s : WSeq α) (m) : ∀ n, drop s (m + n) = drop (drop s m) n

{α : Type u}
(s : Stream'.WSeq α)
(m n : ℕ)


@[simp, norm_cast] lemma coe_inj : (p : ℝ≥0∞) = q ↔ p = q


@[simp] lemma ker_iInf (f : ι → Filter α) : ker (⨅ i, f i) = ⨅ i, ker (f i)

{ι : Sort u_1}
{α : Type u_2}
(f : ι → Filter α)


theorem min_right_comm (a b c : α) : min (min a b) c = min (min a c) b

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


@[to_additive (attr := measurability)]
theorem _root_.Finset.aestronglyMeasurable_prod {ι : Type*} {f : ι → α → M} (s : Finset ι)
    (hf : ∀ i ∈ s, AEStronglyMeasurable (f i) μ) :
    AEStronglyMeasurable (fun a => ∏ i ∈ s, f i a) μ

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

MeasureTheory.AEStronglyMeasurable (fun a => ∏ i ∈ s, f i a) μ


@[simp]
theorem one_rpow (x : ℝ) : (1 : ℝ≥0∞) ^ x = 1


theorem den_mk (n d : ℤ) : (n /. d).den = if d = 0 then 1 else d.natAbs / n.gcd d

(Rat.divInt n d).den = if d = 0 then 1 else d.natAbs / n.gcd d


@[continuity]
theorem Continuous.Prod.mk_left (y : Y) : Continuous fun x : X => (x, y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
(y : Y)


/-- Given a Localization map `f : M →* N` for a Submonoid `S ⊆ M`, if a `CommMonoid` map
`g : M →* P` induces a map `f.lift hg : N →* P` then for all `z : N`, we have
`g y * f.lift hg z = g x`, where `x : M, y ∈ S` are such that `z * f y = f x`. -/
@[to_additive
    "Given a Localization map `f : M →+ N` for a Submonoid `S ⊆ M`, if an `AddCommMonoid` map
`g : M →+ P` induces a map `f.lift hg : N →+ P` then for all `z : N`, we have
`g y + f.lift hg z = g x`, where `x : M, y ∈ S` are such that `z + f y = f x`."]
theorem lift_mul_left (z) : g (f.sec z).2 * f.lift hg z = g (f.sec z).1

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{g : M →* P}
(hg : ∀ (y : ↥S), IsUnit (g ↑y))
(z : N)

g ↑(f.sec z).2 * (f.lift hg) z = g (f.sec z).1


@[simp]
theorem map_add [DecidableEq ι] (m : ∀ i, M₁ i) (i : ι) (x y : M₁ i) :
    f (update m i (x + y)) = f (update m i x) + f (update m i y)

{R : Type u}
{ι : Type v}
{M₁ : ι → Type w₁}
{M₂ : Type w₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
(f : ContinuousMultilinearMap R M₁ M₂)
[DecidableEq ι]
(m : (i : ι) → M₁ i)
(i : ι)
(x y : M₁ i)

f (Function.update m i (x + y)) = f (Function.update m i x) + f (Function.update m i y)


@[to_additive] lemma AntivaryOn.div_right (h₁ : AntivaryOn f g₁ s) (h₂ : MonovaryOn f g₂ s) :
    AntivaryOn f (g₁ / g₂) s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[LinearOrderedCommGroup β]
{s : Set ι}
{f : ι → α}
{g₁ g₂ : ι → β}
(h₁ : AntivaryOn f g₁ s)
(h₂ : MonovaryOn f g₂ s)


/-- Pointwise inversion of submonoids as an order isomorphism. -/
@[to_additive (attr := simps!) "Pointwise negation of additive submonoids as an order isomorphism"]
def invOrderIso : Submonoid G ≃o Submonoid G

∀ (a : Submonoid G), ↑((RelIso.symm Submonoid.invOrderIso) a) = (↑a)⁻¹


theorem injOn_subtype_val {s : Set { x // p x }} : Set.InjOn Subtype.val s

{γ : Type u_3}
{p : Set γ}
{s : Set { x // p x }}


/-- The change of variables mapped over a ring homomorphism `φ : R →+* A`. -/
@[simps]
def map : VariableChange A

{R : Type u}
[CommRing R]
{A : Type v}
[CommRing A]
(φ : R →+* A)
(C : WeierstrassCurve.VariableChange R)

(WeierstrassCurve.VariableChange.map φ C).u = (Units.map ↑φ) C.u


@[simp]
theorem withDensityᵥ_smul {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E]
    [SMulCommClass ℝ 𝕜 E] (f : α → E) (r : 𝕜) : μ.withDensityᵥ (r • f) = r • μ.withDensityᵥ f

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{𝕜 : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[SMulCommClass ℝ 𝕜 E]
(f : α → E)
(r : 𝕜)


theorem IsSRGWith.card_neighborFinset_union_of_adj {v w : V} (h : G.IsSRGWith n k ℓ μ)
    (ha : G.Adj v w) : (G.neighborFinset v ∪ G.neighborFinset w).card = 2 * k - ℓ

{V : Type u}
[Fintype V]
[DecidableEq V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{n k ℓ μ : ℕ}
{v w : V}
(h : G.IsSRGWith n k ℓ μ)
(ha : G.Adj v w)


theorem IsEquivalent.isLittleO (h : u ~[l] v) : (u - v) =o[l] v

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u v : α → β}
{l : Filter α}
(h : u ~[l] v)


@[simp]
theorem prodMap_zero : (0 : M →ₗ[R] M₂).prodMap (0 : M₃ →ₗ[R] M₄) = 0

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


theorem neg_eq_self_iff {θ : Angle} : -θ = θ ↔ θ = 0 ∨ θ = π

-θ = θ ↔ θ = 0 ∨ θ = ↑π


theorem Summable.tsum_mul_left (a) (hf : Summable f) : ∑' i, a * f i = a * ∑' i, f i

{ι : Type u_1}
{α : Type u_4}
[NonUnitalNonAssocSemiring α]
[TopologicalSpace α]
[TopologicalSemiring α]
{f : ι → α}
[T2Space α]
(a : α)
(hf : Summable f)


@[rclike_simps] -- porting note (#10618): was `simp`
theorem normSq_mul (z w : K) : normSq (z * w) = normSq z * normSq w

RCLike.normSq (z * w) = RCLike.normSq z * RCLike.normSq w


protected theorem hasCompactSupport [FiniteDimensional ℝ E] : HasCompactSupport f

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
{c : E}
(f : ContDiffBump c)
[FiniteDimensional ℝ E]


theorem subsingleton_of_no_eigenvalue_finiteDimensional (hT : T.IsSymmetric)
    (hT' : ∀ μ : 𝕜, Module.End.eigenspace (T : E →ₗ[𝕜] E) μ = ⊥) : Subsingleton E

(hT' : ∀ (μ : 𝕜), Module.End.eigenspace T μ = ⊥)


theorem Multiset.smul_sum {r : α} {s : Multiset β} : r • s.sum = (s.map (r • ·)).sum

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid β]
[DistribSMul α β]
{r : α}
{s : Multiset β}

r • s.sum = (Multiset.map (fun x => r • x) s).sum


@[to_additive]
theorem comap_injective {f : G →* N} (h : Function.Surjective f) : Function.Injective (comap f)

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


@[simp]
theorem smul_inv (r : k) (φ : MvPowerSeries σ k) : (r • φ)⁻¹ = r⁻¹ • φ⁻¹

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

(r • φ)⁻¹ = r⁻¹ • φ⁻¹


@[simp]
lemma id_hom₁ (A : Triangle C) : TriangleMorphism.hom₁ (𝟙 A) = 𝟙 _

(A : CategoryTheory.Pretriangulated.Triangle C)


theorem tendsto_atTop_add_nonneg_left' (hf : ∀ᶠ x in l, 0 ≤ f x) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x + g x) l atTop

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommMonoid β]
{l : Filter α}
{f g : α → β}
(hf : ∀ᶠ (x : α) in l, 0 ≤ f x)
(hg : Filter.Tendsto g l Filter.atTop)

Filter.Tendsto (fun x => f x + g x) l Filter.atTop


theorem IsIrrefl.swap (r) [IsIrrefl α r] : IsIrrefl α (swap r)

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


theorem isClopen_fiber {f : X → Y} (hf : IsLocallyConstant f) (y : Y) : IsClopen { x | f x = y }

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


protected theorem sub_le_sub_left {a b : Int} (h : a ≤ b) (c : Int) : c - b ≤ c - a


theorem toPlus_eq_mk {X : C} {P : Cᵒᵖ ⥤ D} (x : P.obj (op X)) :
    (J.toPlus P).app _ x = mk (Meq.mk ⊤ x)

{J : CategoryTheory.GrothendieckTopology C}

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

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

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

(x : (CategoryTheory.forget D).obj (P.obj (Opposite.op X)))

((J.toPlus P).app (Opposite.op X)) x = CategoryTheory.GrothendieckTopology.Plus.mk (CategoryTheory.Meq.mk ⊤ x)


/-- A family of multiplicative equivalences `Π j, (Ms j ≃* Ns j)` generates a
multiplicative equivalence between `Π j, Ms j` and `Π j, Ns j`.

This is the `MulEquiv` version of `Equiv.piCongrRight`, and the dependent version of
`MulEquiv.arrowCongr`.
-/
@[to_additive (attr := simps apply)
  "A family of additive equivalences `Π j, (Ms j ≃+ Ns j)`
  generates an additive equivalence between `Π j, Ms j` and `Π j, Ns j`.

  This is the `AddEquiv` version of `Equiv.piCongrRight`, and the dependent version of
  `AddEquiv.arrowCongr`."]
def piCongrRight {η : Type*} {Ms Ns : η → Type*} [∀ j, Mul (Ms j)] [∀ j, Mul (Ns j)]
    (es : ∀ j, Ms j ≃* Ns j) : (∀ j, Ms j) ≃* ∀ j, Ns j

{η : Type u_12}
{Ms : η → Type u_13}
{Ns : η → Type u_14}
[(j : η) → Mul (Ms j)]
[(j : η) → Mul (Ns j)]
(es : (j : η) → Ms j ≃* Ns j)
(x : (j : η) → Ms j)
(j : η)

(MulEquiv.piCongrRight es) x j = (es j) (x j)


lemma ConcaveOn.mul' (hf : ConcaveOn 𝕜 s f) (hg : ConcaveOn 𝕜 s g) (hf₀ : ∀ ⦃x⦄, x ∈ s → f x ≤ 0)
    (hg₀ : ∀ ⦃x⦄, x ∈ s → g x ≤ 0) (hfg : MonovaryOn f g s) :
    ConvexOn 𝕜 s (f * g)

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedCommRing 𝕜]
[LinearOrderedCommRing E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set 𝕜}
[IsScalarTower 𝕜 E E]
[SMulCommClass 𝕜 E E]
{f g : 𝕜 → E}
(hf : ConcaveOn 𝕜 s f)
(hg : ConcaveOn 𝕜 s g)
(hf₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → f x ≤ 0)
(hg₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → g x ≤ 0)
(hfg : MonovaryOn f g s)


theorem pderiv_map {S} [CommSemiring S] {φ : R →+* S} {f : MvPolynomial σ R} {i : σ} :
    pderiv i (map φ f) = map φ (pderiv i f)

{R : Type u}
{σ : Type v}
[CommSemiring R]
{S : Type u_1}
[CommSemiring S]
{φ : R →+* S}
{f : MvPolynomial σ R}
{i : σ}

(MvPolynomial.pderiv i) ((MvPolynomial.map φ) f) = (MvPolynomial.map φ) ((MvPolynomial.pderiv i) f)


@[simp]
theorem mem_val {a : α} {s : Finset α} : a ∈ s.1 ↔ a ∈ s


theorem add_lt_add_iff_left {a b : ℝ} (c : ℝ) : c + a < c + b ↔ a < b


/-- **Ruzsa's triangle inequality**. Div-mul-mul version. -/
@[to_additive "**Ruzsa's triangle inequality**. Sub-add-add version."]
theorem ruzsa_triangle_inequality_div_mul_mul (A B C : Finset α) :
    (A / C).card * B.card ≤ (A * B).card * (B * C).card

{α : Type u_1}
[AddCommGroup α]
[DecidableEq α]
(A B C : Finset α)

(A - C).card * B.card ≤ (A + B).card * (B + C).card


nonrec theorem tanh_eq_sinh_div_cosh : tanh x = sinh x / cosh x


theorem ascPochhammer_zero_eval_zero : (ascPochhammer S 0).eval 0 = 1

Polynomial.eval 0 (ascPochhammer S 0) = 1


theorem fract_lt_one (a : α) : fract a < 1

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)