/-- For `f : Lp E p μ`, we can define an element of `Lp E p (μ.restrict s)` by
`(Lp.memℒp f).restrict s).toLp f`. This map is additive. -/
theorem Lp_toLp_restrict_add (f g : Lp E p μ) (s : Set X) :
    ((Lp.memℒp (f + g)).restrict s).toLp (⇑(f + g)) =
      ((Lp.memℒp f).restrict s).toLp f + ((Lp.memℒp g).restrict s).toLp g

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure X}
(f g : ↥(MeasureTheory.Lp E p μ))
(s : Set X)

MeasureTheory.Memℒp.toLp ↑↑(f + g) ⋯ = MeasureTheory.Memℒp.toLp ↑↑f ⋯ + MeasureTheory.Memℒp.toLp ↑↑g ⋯


protected lemma eq_div_of_mul_eq_right (hc : c ≠ 0) (h : c * a = b) : a = b / c

{a b c : ℕ}
(hc : c ≠ 0)
(h : c * a = b)


theorem incidenceSet_inter_incidenceSet_subset (h : a ≠ b) :
    G.incidenceSet a ∩ G.incidenceSet b ⊆ {s(a, b)}

{V : Type u}
(G : SimpleGraph V)
{a b : V}
(h : a ≠ b)


theorem isClosed_ball_top : IsClosed (ball x ⊤)

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


theorem IsTop.prod_mk (ha : IsTop a) (hb : IsTop b) : IsTop (a, b)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{a : α}
{b : β}
(ha : IsTop a)
(hb : IsTop b)


theorem isStronglyAtomic_dual_iff_is_stronglyCoatomic :
    IsStronglyAtomic αᵒᵈ ↔ IsStronglyCoatomic α


theorem elem_cons [BEq α] {a : α} :
    (b::bs).elem a = match a == b with | true => true | false => bs.elem a

{α : Type u}
{b : α}
{bs : List α}
[BEq α]
{a : α}

List.elem a (b :: bs) =
  match a == b with
  | true => true
  | false => List.elem a bs


@[to_additive (attr := simp) zero_zsmul] theorem zpow_zero (a : G) : a ^ (0 : ℤ) = 1


theorem tendsto_IicSnd_atTop {s : Set α} (hs : MeasurableSet s) :
    Tendsto (fun r : ℚ ↦ ρ.IicSnd r s) atTop (𝓝 (ρ.fst s))

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
{s : Set α}
(hs : MeasurableSet s)

Filter.Tendsto (fun r => (ρ.IicSnd ↑r) s) Filter.atTop (𝓝 (ρ.fst s))


theorem root_X_sub_C : IsRoot (X - C a) b ↔ a = b

(Polynomial.X - Polynomial.C a).IsRoot b ↔ a = b


lemma c_iso' {V : Opens Y} (U : Opens X) (h : V = (opensFunctor f).obj U) :
    IsIso (f.c.app (Opposite.op V))

{X Y : AlgebraicGeometry.PresheafedSpace C}

[H : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]

(h : V = (AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor f).obj U)

CategoryTheory.IsIso (f.c.app (Opposite.op V))


@[simp]
lemma shift_add (a : ℤ) :
    (γ₁ + γ₂).shift a = γ₁.shift a + γ₂.shift a

(γ₁ γ₂ : CochainComplex.HomComplex.Cochain K L n)


@[simp]
theorem coe_toContinuousLinearEquiv' (e : E ≃ₗ[𝕜] F) : (e.toContinuousLinearEquiv : E → F) = e

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
{F : Type w}
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousSMul 𝕜 F]
[CompleteSpace 𝕜]
[T2Space E]
[T2Space F]
[FiniteDimensional 𝕜 E]
(e : E ≃ₗ[𝕜] F)


theorem _root_.IsSMulRegular.finsupp [Zero M] [SMulZeroClass R M] {k : R}
    (hk : IsSMulRegular M k) : IsSMulRegular (α →₀ M) k

{α : Type u_1}
{M : Type u_5}
{R : Type u_11}
[Zero M]
[SMulZeroClass R M]
{k : R}
(hk : IsSMulRegular M k)


@[simp] theorem exists_eq_right_right : (∃ (a : α), p a ∧ q a ∧ a = a') ↔ p a' ∧ q a'

{α : Sort u_1}
{p q : α → Prop}
{a' : α}


protected theorem «forall» {q : p → Prop} : (∀ x, q x) ↔ ∀ (x : B) (h : x ∈ p), q ⟨x, ‹_›⟩

{A : Type u_1}
{B : Type u_2}
[i : SetLike A B]
{p : A}
{q : ↥p → Prop}

(∀ (x : ↥p), q x) ↔ ∀ (x : B) (h : x ∈ p), q ⟨x, h⟩


/-- A small set of pre-games is bounded below. -/
lemma bddBelow_of_small (s : Set PGame.{u}) [Small.{u} s] : BddBelow s

(s : Set SetTheory.PGame)
[Small.{u, u + 1} ↑s]


/-- Sends a complex `X` with objects in `Vᵒᵖ` to the corresponding complex with objects in `V`. -/
@[simps]
protected def unop (X : HomologicalComplex Vᵒᵖ c) : HomologicalComplex V c.symm


theorem frequently_odd : ∃ᶠ m : ℕ in atTop, Odd m


/-- Symmetric statement to `Set.image2_image_left_comm`. -/
theorem image_image2_distrib_left {g : γ → δ} {f' : α' → β → δ} {g' : α → α'}
    (h_distrib : ∀ a b, g (f a b) = f' (g' a) b) :
    (image2 f s t).image g = image2 f' (s.image g') t

{f : α → β → γ}

(h_distrib : ∀ (a : α) (b : β), g (f a b) = f' (g' a) b)

g '' Set.image2 f s t = Set.image2 f' (g' '' s) t


theorem nonarchimedean : @NonarchimedeanRing A _ hB.topology

{A : Type u_1}
{ι : Type u_2}
[Ring A]
[Nonempty ι]
{B : ι → AddSubgroup A}
(hB : RingSubgroupsBasis B)


theorem op_adjoin (s : Set A) :
    (Algebra.adjoin R s).op = Algebra.adjoin R (MulOpposite.unop ⁻¹' s)

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(s : Set A)


/-- The bottom-left evaluation `Square C ⥤ C`. -/
@[simps]
def evaluation₃ : Square C ⥤ C

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

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), CategoryTheory.Square.evaluation₃.map φ = φ.τ₃


@[simp]
theorem ofEq_symm (h : p = q) : (ofEq p q h).symm = ofEq q p h.symm

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
{p q : Submodule R M}
(h : p = q)

(LinearEquiv.ofEq p q h).symm = LinearEquiv.ofEq q p ⋯


/-- `toSimpleFunc f` satisfies the predicate `Memℒp`. -/
protected theorem memℒp (f : Lp.simpleFunc E p μ) : Memℒp (toSimpleFunc f) p μ

(f : ↥(MeasureTheory.Lp.simpleFunc E p μ))

MeasureTheory.Memℒp (↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc f)) p μ


@[to_additive]
theorem units_of_val : Commute (u₁ : M) u₂ → Commute u₁ u₂


theorem mul_le_of_le_div (h : a ≤ b / c) : a * c ≤ b


theorem MapsTo.mono_left (hf : MapsTo f s₁ t) (hs : s₂ ⊆ s₁) : MapsTo f s₂ t

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Set α}
{t : Set β}
{f : α → β}
(hf : Set.MapsTo f s₁ t)
(hs : s₂ ⊆ s₁)


@[simp]
theorem apply_one [DecidableEq E] (x : E) :
    (1 : NonarchAddGroupNorm E) x = if x = 0 then 0 else 1

{E : Type u_4}
[AddGroup E]
[DecidableEq E]
(x : E)


/-- The natural isomorphism `(K⟦n⟧).sc' i j k ≅ K.sc' i' j' k'` when `n + i = i'`,
`n + j = j'` and `n + k = k'`. -/
@[simps!]
def shiftShortComplexFunctor' (n i j k i' j' k' : ℤ)
    (hi : n + i = i') (hj : n + j = j') (hk : n + k = k') :
    (CategoryTheory.shiftFunctor (CochainComplex C ℤ) n) ⋙ shortComplexFunctor' C _ i j k ≅
      shortComplexFunctor' C _ i' j' k'

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(n i j k i' j' k' : ℤ)
(hi : n + i = i')
(hj : n + j = j')
(hk : n + k = k')
(X : CochainComplex C ℤ)

((CochainComplex.shiftShortComplexFunctor' C n i j k i' j' k' hi hj hk).hom.app X).τ₃ =
  n.negOnePow • (HomologicalComplex.XIsoOfEq X ⋯).hom


@[simp]
theorem dom_mk (p : α → Prop) (f : ∀ a, p a → β) : (PFun.Dom fun x => ⟨p x, f x⟩) = { x | p x }

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

(PFun.Dom fun x => { Dom := p x, get := f x }) = {x | p x}


theorem measure_inter_eq_zero_of_restrict (h : μ.restrict s t = 0) : μ (t ∩ s) = 0

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(h : (μ.restrict s) t = 0)


@[simp]
protected theorem map_smul (r : R) : (r • p).map f = f r • p.map f

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

Polynomial.map f (r • p) = f r • Polynomial.map f p


theorem projIic_eq_self : projIic b x = ⟨b, le_rfl⟩ ↔ b ≤ x

{α : Type u_1}
[LinearOrder α]
{b x : α}


theorem IccExtend_of_right_le (f : Icc a b → β) (hx : b ≤ x) :
    IccExtend h f x = f ⟨b, right_mem_Icc.2 h⟩

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
{a b : α}
(h : a ≤ b)
{x : α}
(f : ↑(Set.Icc a b) → β)
(hx : b ≤ x)


theorem commutator_def (H₁ H₂ : Subgroup G) :
    ⁅H₁, H₂⁆ = closure { g | ∃ g₁ ∈ H₁, ∃ g₂ ∈ H₂, ⁅g₁, g₂⁆ = g }

{G : Type u_1}
[Group G]
(H₁ H₂ : Subgroup G)

⁅H₁, H₂⁆ = Subgroup.closure {g | ∃ g₁ ∈ H₁, ∃ g₂ ∈ H₂, ⁅g₁, g₂⁆ = g}


theorem disjSups_inter_subset_left : (s₁ ∩ s₂) ○ t ⊆ s₁ ○ t ∩ s₂ ○ t

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

(s₁ ∩ s₂).disjSups t ⊆ s₁.disjSups t ∩ s₂.disjSups t


theorem cos_two_mul' : cos (2 * x) = cos x ^ 2 - sin x ^ 2

Complex.cos (2 * x) = Complex.cos x ^ 2 - Complex.sin x ^ 2


/-- The forgetful functor from `PresheafedSpace` to `TopCat`. -/
@[simps]
def forget : PresheafedSpace C ⥤ TopCat

(X : AlgebraicGeometry.PresheafedSpace C)

(AlgebraicGeometry.PresheafedSpace.forget C).obj X = ↑X


protected theorem continuous (hf : Inducing f) : Continuous f

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


theorem foldr_ext (f g : α → β → β) (b : β) {l : List α} (H : ∀ a ∈ l, ∀ b : β, f a b = g a b) :
    foldr f b l = foldr g b l

(f g : α → β → β)

(H : ∀ (a : α), a ∈ l → ∀ (b : β), f a b = g a b)


@[simp]
theorem pred_eval (v) : pred.eval v = pure [v.headI.pred]

Turing.ToPartrec.Code.pred.eval v = pure [v.headI.pred]


protected theorem IsCompact.insert (hs : IsCompact s) (a) : IsCompact (insert a s)

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


/-- A `MulEquiv` `φ` between two semigroups `M` and `N` induces a `MulEquiv` between
a subsemigroup `S ≤ M` and the subsemigroup `φ(S) ≤ N`.
See `MulHom.subsemigroupMap` for a variant for `MulHom`s. -/
@[to_additive (attr := simps)
      "An `AddEquiv` `φ` between two additive semigroups `M` and `N` induces an `AddEquiv`
      between a subsemigroup `S ≤ M` and the subsemigroup `φ(S) ≤ N`.
      See `AddHom.addSubsemigroupMap` for a variant for `AddHom`s."]
def subsemigroupMap (e : M ≃* N) (S : Subsemigroup M) : S ≃* S.map (e : M →ₙ* N)

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(e : M ≃+ N)
(S : AddSubsemigroup M)
(x : ↥(AddSubsemigroup.map (↑e) S))

↑((e.subsemigroupMap S).symm x) = e.symm ↑x


theorem iSup_eq_if {p : Prop} [Decidable p] (a : α) : ⨆ _ : p, a = if p then a else ⊥

{α : Type u_1}
[CompleteLattice α]
{p : Prop}
[Decidable p]
(a : α)


@[norm_cast]  -- @[simp] -- Porting note (#10618): simp can prove this
theorem to_nat_to_int (n : Num) : ((n : ℕ) : ℤ) = n


lemma _root_.Real.spectralRadius_mem_spectrum_or {A : Type*} [NormedRing A] [NormedAlgebra ℝ A]
    [CompleteSpace A] {a : A} (ha : (spectrum ℝ a).Nonempty) :
    (spectralRadius ℝ a).toReal ∈ spectrum ℝ a ∨ -(spectralRadius ℝ a).toReal ∈ spectrum ℝ a

{A : Type u_4}
[NormedRing A]
[NormedAlgebra ℝ A]
[CompleteSpace A]
{a : A}
(ha : (spectrum ℝ a).Nonempty)


@[to_additive]
theorem continuousMul_induced {M N F : Type*} [Mul M] [Mul N] [FunLike F M N] [MulHomClass F M N]
    [TopologicalSpace N] [ContinuousMul N] (f : F) : @ContinuousMul M (induced f ‹_›) _

{M : Type u_6}
{N : Type u_7}
{F : Type u_8}
[Add M]
[Add N]
[FunLike F M N]
[AddHomClass F M N]
[TopologicalSpace N]
[ContinuousAdd N]
(f : F)


@[deprecated get_permutations'Aux (since := "2024-04-23")]
theorem nthLe_permutations'Aux (s : List α) (x : α) (n : ℕ)
    (hn : n < length (permutations'Aux x s)) :
    (permutations'Aux x s).nthLe n hn = s.insertNth n x

(hn : n < (List.permutations'Aux x s).length)

(List.permutations'Aux x s).nthLe n hn = List.insertNth n x s


theorem ball_subset_of_comp_subset {V W : Set (β × β)} {x y} (h : x ∈ ball y W) (h' : W ○ W ⊆ V) :
    ball x W ⊆ ball y V

{β : Type ub}
{V W : Set (β × β)}
{x y : β}
(h : x ∈ UniformSpace.ball y W)
(h' : W ○ W ⊆ V)

UniformSpace.ball x W ⊆ UniformSpace.ball y V


lemma dens_sdiff_comm (h : card s = card t) : dens (s \ t) = dens (t \ s)

{α : Type u_2}
[Fintype α]
{s t : Finset α}
[DecidableEq α]
(h : s.card = t.card)


theorem tsub_apply (f g : ι →₀ α) (a : ι) : (f - g) a = f a - g a

{ι : Type u_1}
{α : Type u_2}
[CanonicallyOrderedAddCommMonoid α]
[Sub α]
[OrderedSub α]
(f g : ι →₀ α)
(a : ι)


theorem inv_mul_lt_iff' (h : 0 < b) : b⁻¹ * a < c ↔ a < c * b

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


@[simp]
theorem eqOn_univ (f₁ f₂ : α → β) : EqOn f₁ f₂ univ ↔ f₁ = f₂

{α : Type u_1}
{β : Type u_2}
(f₁ f₂ : α → β)


theorem smooth_subtype_iff {U : Opens M} {f : M → M'} {x : U} :
    SmoothAt I I' (fun x : U ↦ f x) x ↔ SmoothAt I I' f 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]
{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']
{U : TopologicalSpace.Opens M}
{f : M → M'}
{x : ↥U}

SmoothAt I I' (fun x => f ↑x) x ↔ SmoothAt I I' f ↑x


@[simp, norm_cast]
theorem coe_ennreal_lt_coe_ennreal_iff {x y : ℝ≥0∞} : (x : EReal) < (y : EReal) ↔ x < y


theorem sinh_conj : sinh (conj x) = conj (sinh x)

Complex.sinh ((starRingEnd ℂ) x) = (starRingEnd ℂ) (Complex.sinh x)


@[simp]
theorem compl_empty : (∅ : Set α)ᶜ = univ


theorem Filter.Eventually.union_nhdsSet {p : X → Prop} :
    (∀ᶠ x in 𝓝ˢ (s ∪ t), p x) ↔ (∀ᶠ x in 𝓝ˢ s, p x) ∧ ∀ᶠ x in 𝓝ˢ t, p x

{X : Type u_1}
[TopologicalSpace X]
{s t : Set X}
{p : X → Prop}

(∀ᶠ (x : X) in 𝓝ˢ (s ∪ t), p x) ↔ (∀ᶠ (x : X) in 𝓝ˢ s, p x) ∧ ∀ᶠ (x : X) in 𝓝ˢ t, p x


@[simp]
theorem bot_coe_submodule : ((⊥ : LieSubalgebra R L) : Submodule R L) = ⊥

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


/--
Preliminary statement of the comultiplication for a tensor product of comonoids.
This version is the definitional equality provided by transport, and not quite as good as
the version provided in `tensorObj_comul` below.
-/
theorem tensorObj_comul' (A B : Comon_ C) :
    (A ⊗ B).comul =
      (A.comul ⊗ B.comul) ≫ (tensor_μ Cᵒᵖ (op A.X, op B.X) (op A.X, op B.X)).unop

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(A B : Comon_ C)

(A ⊗ B).comul =
  (A.comul ⊗ B.comul) ≫
    (CategoryTheory.tensor_μ Cᵒᵖ (Opposite.op A.X, Opposite.op B.X) (Opposite.op A.X, Opposite.op B.X)).unop


theorem ofFn_blocksFun : ofFn c.blocksFun = c.blocks


lemma stableUnderSpecialization_empty : StableUnderSpecialization (∅ : Set X)


{I : Type u}
[LinearOrder I]
[IsWellOrder I fun x x_1 => x < x_1]


theorem IsGδ.inter {s t : Set X} (hs : IsGδ s) (ht : IsGδ t) : IsGδ (s ∩ t)

{X : Type u_1}
[TopologicalSpace X]
{s t : Set X}
(hs : IsGδ s)
(ht : IsGδ t)


lemma mor₁_eq_zero_of_epi₃ (h : Epi T.mor₃) : T.mor₁ = 0

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


@[simp]
theorem Units.mk0_mul (x y : G₀) (hxy) :
    Units.mk0 (x * y) hxy =
      Units.mk0 x (mul_ne_zero_iff.mp hxy).1 * Units.mk0 y (mul_ne_zero_iff.mp hxy).2

{G₀ : Type u_3}
[GroupWithZero G₀]
(x y : G₀)
(hxy : x * y ≠ 0)

Units.mk0 (x * y) hxy = Units.mk0 x ⋯ * Units.mk0 y ⋯


/-- Non-unital ring homomorphism between the function spaces `I → α` and `I → β`, induced by a
non-unital ring homomorphism `f` between `α` and `β`. -/
@[simps]
protected def NonUnitalRingHom.compLeft {α β : Type*} [NonUnitalNonAssocSemiring α]
    [NonUnitalNonAssocSemiring β] (f : α →ₙ+* β) (I : Type*) : (I → α) →ₙ+* I → β

{α : Type u_1}
{β : Type u_2}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
(f : α →ₙ+* β)
(I : Type u_3)
(h : I → α)

∀ (a : I), (f.compLeft I) h a = (⇑f ∘ h) a


/-- Suppose that `Q` is a statement about Laurent polynomials such that
* `Q` is true on *ordinary* polynomials;
* `Q (f * T)` implies `Q f`;
it follow that `Q` is true on all Laurent polynomials. -/
theorem reduce_to_polynomial_of_mul_T (f : R[T;T⁻¹]) {Q : R[T;T⁻¹] → Prop}
    (Qf : ∀ f : R[X], Q (toLaurent f)) (QT : ∀ f, Q (f * T 1) → Q f) : Q f

(Qf : ∀ (f : R[X]), Q (Polynomial.toLaurent f))

(QT : ∀ (f : R[T;T⁻¹]), Q (f * LaurentPolynomial.T 1) → Q f)


theorem homCongr_refl {X Y : C} (f : X ⟶ Y) : (Iso.refl X).homCongr (Iso.refl Y) f = f

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

((CategoryTheory.Iso.refl X).homCongr (CategoryTheory.Iso.refl Y)) f = f


theorem le_add_left (a b : Ordinal) : a ≤ b + a


theorem IsLowerSet.memberSubfamily_subset_nonMemberSubfamily (h : IsLowerSet (𝒜 : Set (Finset α))) :
    𝒜.memberSubfamily a ⊆ 𝒜.nonMemberSubfamily a

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{a : α}
(h : IsLowerSet ↑𝒜)

Finset.memberSubfamily a 𝒜 ⊆ Finset.nonMemberSubfamily a 𝒜


/-- The integral of the derivative of a product of two maps.
For improper integrals, see `MeasureTheory.integral_deriv_mul_eq_sub`,
`MeasureTheory.integral_Ioi_deriv_mul_eq_sub`, and `MeasureTheory.integral_Iic_deriv_mul_eq_sub`. -/
theorem integral_deriv_mul_eq_sub_of_hasDeriv_right {u v u' v' : ℝ → A}
    (hu : ContinuousOn u [[a, b]])
    (hv : ContinuousOn v [[a, b]])
    (huu' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt u (u' x) (Ioi x) x)
    (hvv' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt v (v' x) (Ioi x) x)
    (hu' : IntervalIntegrable u' volume a b)
    (hv' : IntervalIntegrable v' volume a b) :
    ∫ x in a..b, u' x * v x + u x * v' x = u b * v b - u a * v a

(huu' : ∀ x ∈ Set.Ioo (min a b) (max a b), HasDerivWithinAt u (u' x) (Set.Ioi x) x)

(hvv' : ∀ x ∈ Set.Ioo (min a b) (max a b), HasDerivWithinAt v (v' x) (Set.Ioi x) x)

(hu' : IntervalIntegrable u' MeasureTheory.volume a b)

(hv' : IntervalIntegrable v' MeasureTheory.volume a b)

∫ (x : ℝ) in a..b, u' x * v x + u x * v' x = u b * v b - u a * v a


@[simp]
theorem refl_toEmbedding : (refl L M).toEmbedding = Embedding.refl L M

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

(FirstOrder.Language.Equiv.refl L M).toEmbedding = FirstOrder.Language.Embedding.refl L M


theorem MeasurableEmbedding.essSup_map_measure (hf : MeasurableEmbedding f) :
    essSup g (Measure.map f μ) = essSup (g ∘ f) μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[CompleteLattice β]
{γ : Type u_3}
{mγ : MeasurableSpace γ}
{f : α → γ}
{g : γ → β}
(hf : MeasurableEmbedding f)

essSup g (MeasureTheory.Measure.map f μ) = essSup (g ∘ f) μ


@[measurability]
theorem AEMeasurable.const_inner {m : MeasurableSpace α} [MeasurableSpace E]
    [OpensMeasurableSpace E] [SecondCountableTopology E]
    {μ : MeasureTheory.Measure α} {f : α → E} {c : E} (hf : AEMeasurable f μ) :
    AEMeasurable (fun x => ⟪c, f x⟫) μ

{α : Type u_1}
{𝕜 : Type u_2}
{E : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{m : MeasurableSpace α}
[MeasurableSpace E]
[OpensMeasurableSpace E]
[SecondCountableTopology E]
{μ : MeasureTheory.Measure α}
{f : α → E}
{c : E}
(hf : AEMeasurable f μ)


theorem ofFunction_eq_sSup : OuterMeasure.ofFunction m m_empty = sSup { μ | ∀ s, μ s ≤ m s }

{α : Type u_1}
{m : Set α → ℝ≥0∞}
{m_empty : m ∅ = 0}

MeasureTheory.OuterMeasure.ofFunction m m_empty = sSup {μ | ∀ (s : Set α), μ s ≤ m s}


protected theorem closure (hf : LocallyFinite f) : LocallyFinite fun i => closure (f i)

{ι : Type u_1}
{X : Type u_4}
[TopologicalSpace X]
{f : ι → Set X}
(hf : LocallyFinite f)


@[deprecated (since := "2022-12-31")]
theorem two_smul' : (2 : R) • x = (2 : ℕ) • x

(R : Type u_2)
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(x : M)


@[simp]
theorem relabel_comp_relabel (f : α → β) (g : β → γ) :
    (Term.relabel g ∘ Term.relabel f : L.Term α → L.Term γ) = Term.relabel (g ∘ f)

{L : FirstOrder.Language}
{α : Type u'}
{β : Type v'}
{γ : Type u_3}
(f : α → β)
(g : β → γ)

FirstOrder.Language.Term.relabel g ∘ FirstOrder.Language.Term.relabel f = FirstOrder.Language.Term.relabel (g ∘ f)


@[to_additive]
nonrec theorem IsUnit.unop {M} [Monoid M] {m : Mᵐᵒᵖ} (h : IsUnit m) : IsUnit (unop m)

{M : Type u_2}
[Monoid M]
{m : Mᵐᵒᵖ}
(h : IsUnit m)


@[simp]
theorem coe_continuous_linearProjOfClosedCompl' (h : IsCompl p q) (hp : IsClosed (p : Set E))
    (hq : IsClosed (q : Set E)) :
    ⇑(p.linearProjOfClosedCompl q h hp hq) = p.linearProjOfIsCompl q h

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{p q : Subspace 𝕜 E}
(h : IsCompl p q)
(hp : IsClosed ↑p)
(hq : IsClosed ↑q)

⇑(Submodule.linearProjOfClosedCompl p q h hp hq) = ⇑(Submodule.linearProjOfIsCompl p q h)


@[simp]
theorem lift_unique (f : X → L) (g : FreeLieAlgebra R X →ₗ⁅R⁆ L) : g ∘ of R = f ↔ g = lift R f

{R : Type u}
{X : Type v}
[CommRing R]
{L : Type w}
[LieRing L]
[LieAlgebra R L]
(f : X → L)
(g : FreeLieAlgebra R X →ₗ⁅R⁆ L)

⇑g ∘ FreeLieAlgebra.of R = f ↔ g = (FreeLieAlgebra.lift R) f


/-- Auxiliary definition for `CategoryTheory.Functor.closed`.
The unit for the adjunction `(tensorLeft F) ⊣ (ihom F)`. -/
@[simps]
def closedUnit (F : D ⥤ C) : 𝟭 (D ⥤ C) ⟶ tensorLeft F ⋙ closedIhom F

{D : Type u_1}
{C : Type u_2}
[CategoryTheory.Groupoid D]
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.MonoidalClosed C]
(F G : D ⥤ C)
(X : D)

(F.closedUnit.app G).app X = (CategoryTheory.ihom.coev (F.obj X)).app (G.obj X)


lemma not_adj_iff_part_eq : ¬G.Adj s t ↔ h.finpartition.part s = h.finpartition.part t

{V : Type u_1}
[Fintype V]
[DecidableEq V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{r : ℕ}
{s t : V}
(h : G.IsTuranMaximal r)


theorem comap_const (f : R →+* S) (U : Opens (PrimeSpectrum.Top R))
    (V : Opens (PrimeSpectrum.Top S)) (hUV : V.1 ⊆ PrimeSpectrum.comap f ⁻¹' U.1) (a b : R)
    (hb : ∀ x : PrimeSpectrum R, x ∈ U → b ∈ x.asIdeal.primeCompl) :
    comap f U V hUV (const R a b U hb) =
      const S (f a) (f b) V fun p hpV => hb (PrimeSpectrum.comap f p) (hUV hpV)

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(V : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top S))

(hUV : V.carrier ⊆ ⇑(PrimeSpectrum.comap f) ⁻¹' U.carrier)

(hb : ∀ x ∈ U, b ∈ x.asIdeal.primeCompl)

(AlgebraicGeometry.StructureSheaf.comap f U V hUV) (AlgebraicGeometry.StructureSheaf.const R a b U hb) =
  AlgebraicGeometry.StructureSheaf.const S (f a) (f b) V ⋯


theorem mk_Iio_ord_out_α {c : Cardinal} (i : c.ord.out.α) : #(Iio i) < c

{c : Cardinal.{u_3}}
(i : (Quotient.out c.ord).α)


theorem isBigO_const_of_tendsto {y : E''} (h : Tendsto f'' l (𝓝 y)) {c : F''} (hc : c ≠ 0) :
    f'' =O[l] fun _x => c

{α : Type u_1}
{E'' : Type u_9}
{F'' : Type u_10}
[NormedAddCommGroup E'']
[NormedAddCommGroup F'']
{f'' : α → E''}
{l : Filter α}
{y : E''}
(h : Filter.Tendsto f'' l (𝓝 y))
{c : F''}
(hc : c ≠ 0)


theorem inf'_sup_distrib_right (f : ι → α) (a : α) : s.inf' hs f ⊔ a = s.inf' hs fun i => f i ⊔ a

{α : Type u_2}
{ι : Type u_5}
[DistribLattice α]
{s : Finset ι}
(hs : s.Nonempty)
(f : ι → α)
(a : α)


theorem le_of_forall_lt_one_mul_le {x y : ℝ≥0∞} (h : ∀ a < 1, a * x ≤ y) : x ≤ y


@[to_additive]
theorem range_top_iff_surjective {N} [Group N] {f : G →* N} :
    f.range = (⊤ : Subgroup N) ↔ Function.Surjective f

{G : Type u_1}
[AddGroup G]
{N : Type u_7}
[AddGroup N]
{f : G →+ N}


/-- If two continuous functions are equal on a dense set, then they are equal. -/
theorem Continuous.ext_on [T2Space X] {s : Set Y} (hs : Dense s) {f g : Y → X} (hf : Continuous f)
    (hg : Continuous g) (h : EqOn f g s) : f = g

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T2Space X]
{s : Set Y}
(hs : Dense s)
{f g : Y → X}
(hf : Continuous f)
(hg : Continuous g)
(h : Set.EqOn f g s)


lemma KaehlerDifferential.polynomial_D_apply (P : R[X]) :
    D R R[X] P = derivative P • D R R[X] X

(R : Type u)
[CommRing R]
(P : Polynomial R)

(KaehlerDifferential.D R (Polynomial R)) P =
  Polynomial.derivative P • (KaehlerDifferential.D R (Polynomial R)) Polynomial.X


theorem exists_prod_set {p : α × β → Prop} : (∃ x ∈ s ×ˢ t, p x) ↔ ∃ x ∈ s, ∃ y ∈ t, p (x, y)

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{p : α × β → Prop}


@[simp] lemma right_mem_uIcc : b ∈ [[a, b]]


@[ext]
theorem ext (h : ∀ x, x ∈ p ↔ x ∈ q) : p = q

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p q : Submodule R M}
(h : ∀ (x : M), x ∈ p ↔ x ∈ q)


theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n

(bif n.bodd then 1 else 0) + 2 * n.div2 = n


@[simp]
theorem single_eq_zero {a : G} {b : k} : single a b = 0 ↔ b = 0

{k : Type u₁}
{G : Type u₂}
[Semiring k]
{a : G}
{b : k}


protected theorem fix_def {x : α} (h' : ∃ i, (Fix.approx f i x).Dom) :
    Part.fix f x = Fix.approx f (Nat.succ (Nat.find h')) x

(f : ((a : α) → Part (β a)) → (a : α) → Part (β a))

Part.fix f x = Part.Fix.approx f (Nat.find h').succ x


theorem Ioc_ofDual (a b : αᵒᵈ) : Ioc (ofDual a) (ofDual b) = (Ico b a).map ofDual.toEmbedding

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
(a b : αᵒᵈ)

Finset.Ioc (OrderDual.ofDual a) (OrderDual.ofDual b) = Finset.map OrderDual.ofDual.toEmbedding (Finset.Ico b a)


theorem sup'_inf_distrib_right (f : ι → α) (a : α) :
    s.sup' hs f ⊓ a = s.sup' hs fun i => f i ⊓ a


@[simp]
theorem whiskerLeft_id (F : C ⥤ D) {G : D ⥤ E} :
    whiskerLeft F (NatTrans.id G) = NatTrans.id (F.comp G)

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

CategoryTheory.whiskerLeft F (CategoryTheory.NatTrans.id G) = CategoryTheory.NatTrans.id (F.comp G)


@[to_additive (attr := simp)] lemma hasProd_unique [Unique β] (f : β → α) : HasProd f (f default)

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
[Unique β]
(f : β → α)


theorem map₂_pure : map₂ m (pure a) (pure b) = pure (m a b)

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{m : α → β → γ}
{a : α}
{b : β}

Filter.map₂ m (pure a) (pure b) = pure (m a b)


@[simp] lemma head_append (p q : RelSeries r) (connect : r p.last q.head) :
    (p.append q connect).head = p.head

{α : Type u_1}
{r : Rel α α}
(p q : RelSeries r)
(connect : r p.last q.head)


lemma Antivary.div_right₀ (hg₁ : 0 ≤ g₁) (hg₂ : StrongLT 0 g₂) (h₁ : Antivary f g₁)
    (h₂ : Monovary f g₂) : Antivary f (g₁ / g₂)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemifield α]
[LinearOrderedSemifield β]
{f : ι → α}
{g₁ g₂ : ι → β}
(hg₁ : 0 ≤ g₁)
(hg₂ : StrongLT 0 g₂)
(h₁ : Antivary f g₁)
(h₂ : Monovary f g₂)


theorem mul_lt_of_lt_div' (h : a < b / c) : c * a < b


theorem Disjoint.disjoint_sdiff_left (h : Disjoint a b) : Disjoint (a \ c) b

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


theorem opCoproductIsoProduct_inv_comp_ι [HasCoproduct Z] (b : α) :
    (opCoproductIsoProduct Z).inv ≫ (Sigma.ι Z b).op = Pi.π (op <| Z ·) b

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{α : Type u_1}
(Z : α → C)
[CategoryTheory.Limits.HasCoproduct Z]
(b : α)

(CategoryTheory.Limits.opCoproductIsoProduct Z).inv ≫ (CategoryTheory.Limits.Sigma.ι Z b).op =
  CategoryTheory.Limits.Pi.π (fun x => Opposite.op (Z x)) b


@[simp] lemma length_withLength [InfiniteDimensionalOrder α] (n : ℕ) :
    (LTSeries.withLength α n).length = n

(α : Type u_1)
[Preorder α]
[InfiniteDimensionalOrder α]
(n : ℕ)


protected theorem Bijective.surjective {f : α → β} (hf : Bijective f) : Surjective f

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
(hf : Function.Bijective f)


theorem hasDerivAt_of_tendstoUniformlyOnFilter [NeBot l]
    (hf' : TendstoUniformlyOnFilter f' g' l (𝓝 x))
    (hf : ∀ᶠ n : ι × 𝕜 in l ×ˢ 𝓝 x, HasDerivAt (f n.1) (f' n.1 n.2) n.2)
    (hfg : ∀ᶠ y in 𝓝 x, Tendsto (fun n => f n y) l (𝓝 (g y))) : HasDerivAt g (g' x) x

(hf : ∀ᶠ (n : ι × 𝕜) in l ×ˢ 𝓝 x, HasDerivAt (f n.1) (f' n.1 n.2) n.2)

(hfg : ∀ᶠ (y : 𝕜) in 𝓝 x, Filter.Tendsto (fun n => f n y) l (𝓝 (g y)))


theorem RingHom.ext_zmod {n : ℕ} {R : Type*} [Semiring R] (f g : ZMod n →+* R) : f = g

{n : ℕ}
{R : Type u_1}
[Semiring R]
(f g : ZMod n →+* R)


theorem orientation_map (e : Basis ι R M) (f : M ≃ₗ[R] N) :
    (e.map f).orientation = Orientation.map ι f e.orientation

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

(e.map f).orientation = (Orientation.map ι f) e.orientation


/-- A short complex `S` has left homology when there exists a `S.LeftHomologyData` -/
class HasLeftHomology : Prop where
  condition : Nonempty S.LeftHomologyData


theorem LipschitzWith.completion_map [PseudoMetricSpace β] {f : α → β} {K : ℝ≥0}
    (h : LipschitzWith K f) : LipschitzWith K (Completion.map f)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{f : α → β}
{K : ℝ≥0}
(h : LipschitzWith K f)

LipschitzWith K (UniformSpace.Completion.map f)


@[simp]
theorem ExactFunctor.forget_map {F G : C ⥤ₑ D} (α : F ⟶ G) : (ExactFunctor.forget C D).map α = α

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

(CategoryTheory.ExactFunctor.forget C D).map α = α


@[simp]
theorem isoMk_hom_right {f g : Under X} (hr : f.right ≅ g.right) (hw : f.hom ≫ hr.hom = g.hom) :
    (isoMk hr hw).hom.right = hr.hom

(hw : CategoryTheory.CategoryStruct.comp f.hom hr.hom = g.hom)

(CategoryTheory.Under.isoMk hr hw).hom.right = hr.hom


/-- A convex body that is symmetric contains `0`. -/
theorem zero_mem_of_symmetric (K : ConvexBody V) (h_symm : ∀ x ∈ K, - x ∈ K) : 0 ∈ K

{V : Type u_1}
[TopologicalSpace V]
[AddCommGroup V]
[Module ℝ V]
(K : ConvexBody V)
(h_symm : ∀ x ∈ K, -x ∈ K)


@[simp]
theorem upperCentralSeries_nilpotencyClass : upperCentralSeries G (Group.nilpotencyClass G) = ⊤

{G : Type u_1}
[Group G]
[hG : Group.IsNilpotent G]


/-- The L-series of the (convolution) product of two `ℂ`-valued arithmetic functions `f` and `g`
equals the product of their L-series, assuming both L-series converge. -/
lemma LSeriesHasSum_mul {f g : ArithmeticFunction ℂ} {s a b : ℂ} (hf : LSeriesHasSum ↗f s a)
    (hg : LSeriesHasSum ↗g s b) :
    LSeriesHasSum ↗(f * g) s (a * b)

{f g : ArithmeticFunction ℂ}
{s a b : ℂ}
(hf : LSeriesHasSum (fun n => f n) s a)
(hg : LSeriesHasSum (fun n => g n) s b)

LSeriesHasSum (fun n => (f * g) n) s (a * b)


/-- The Hausdorff distance satisfies the triangle inequality. -/
theorem hausdorffEdist_triangle : hausdorffEdist s u ≤ hausdorffEdist s t + hausdorffEdist t u

{α : Type u}
[PseudoEMetricSpace α]
{s t u : Set α}

EMetric.hausdorffEdist s u ≤ EMetric.hausdorffEdist s t + EMetric.hausdorffEdist t u


lemma mk_lt_mk_of_lt_of_le (h₁ : a₁ < a₂) (h₂ : b₁ ≤ b₂) : (a₁, b₁) < (a₂, b₂)

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{a₁ a₂ : α}
{b₁ b₂ : β}
(h₁ : a₁ < a₂)
(h₂ : b₁ ≤ b₂)


/-- For `r` strictly smaller than the radius of `p`, then `‖pₙ‖ rⁿ` tends to zero exponentially:
for some `0 < a < 1`, `‖p n‖ rⁿ = o(aⁿ)`. -/
theorem isLittleO_of_lt_radius (h : ↑r < p.radius) :
    ∃ a ∈ Ioo (0 : ℝ) 1, (fun n => ‖p n‖ * (r : ℝ) ^ n) =o[atTop] (a ^ ·)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{r : ℝ≥0}
(h : ↑r < p.radius)

∃ a ∈ Set.Ioo 0 1, (fun n => ‖p n‖ * ↑r ^ n) =o[Filter.atTop] fun x => a ^ x


theorem catalan_succ' (n : ℕ) :
    catalan (n + 1) = ∑ ij ∈ antidiagonal n, catalan ij.1 * catalan ij.2

catalan (n + 1) = ∑ ij ∈ Finset.antidiagonal n, catalan ij.1 * catalan ij.2


/-- If a function is `C^n` with `1 ≤ n` on a domain with unique derivatives, then its bundled
derivative is continuous. In this auxiliary lemma, we prove this fact when the source and target
space are model spaces in models with corners. The general fact is proved in
`ContMDiffOn.continuousOn_tangentMapWithin`-/
theorem ContMDiffOn.continuousOn_tangentMapWithin_aux {f : H → H'} {s : Set H}
    (hf : ContMDiffOn I I' n f s) (hn : 1 ≤ n) (hs : UniqueMDiffOn I s) :
    ContinuousOn (tangentMapWithin I I' f s) (π E (TangentSpace I) ⁻¹' s)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{n : ℕ∞}
{f : H → H'}
{s : Set H}
(hf : ContMDiffOn I I' n f s)
(hn : 1 ≤ n)
(hs : UniqueMDiffOn I s)

ContinuousOn (tangentMapWithin I I' f s) (Bundle.TotalSpace.proj ⁻¹' s)


theorem span_insert (x) (s : Set M) : span R (insert x s) = (R ∙ x) ⊔ span R s

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(x : M)
(s : Set M)

Submodule.span R (insert x s) = Submodule.span R {x} ⊔ Submodule.span R s


theorem enumerate_eq_none :
    ∀ {s n₁ n₂}, enumerate sel s n₁ = none → n₁ ≤ n₂ → enumerate sel s n₂ = none

{α : Type u_1}
(sel : Set α → Option α)
{s : Set α}
{n₁ n₂ : ℕ}

Set.enumerate sel s n₁ = none → n₁ ≤ n₂ → Set.enumerate sel s n₂ = none


lemma abs_eq_sqrt_sq_add_sq (z : ℂ) : abs z = (z.re ^ 2 + z.im ^ 2).sqrt


/-- Equivalence of categories is symmetric. -/
@[symm, simps]
def symm (e : C ≌ D) : D ≌ C

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


protected theorem coe_sub {R : Type u} {A : Type v} [CommRing R] [Ring A] [Algebra R A]
    {S : Subalgebra R A} (x y : S) : (↑(x - y) : A) = ↑x - ↑y

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
{S : Subalgebra R A}
(x y : ↥S)


@[simp]
lemma measure_compl_sigmaFiniteSet (μ : Measure α) [SigmaFinite μ] : μ μ.sigmaFiniteSetᶜ = 0

{α : Type u_1}
{mα : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]


/-- `SatisfiesM` distributes over `>>=`, weakest precondition version. -/
protected theorem bind_pre [Monad m] [LawfulMonad m] {f : α → m β}
    (hx : SatisfiesM (fun a => SatisfiesM q (f a)) x) :
    SatisfiesM q (x >>= f)


/-- The **lower Lebesgue integral** of a function `f` with respect to a measure `μ`. -/
irreducible_def lintegral {_ : MeasurableSpace α} (μ : Measure α) (f : α → ℝ≥0∞) : ℝ≥0∞

∀ {x : MeasurableSpace α} (μ : MeasureTheory.Measure α) (f : α → ℝ≥0∞),
  MeasureTheory.lintegral μ f = ⨆ g, ⨆ (_ : ↑g ≤ f), g.lintegral μ


@[simp]
theorem schwartzSeminormFamily_apply_zero :
    schwartzSeminormFamily 𝕜 E F 0 = SchwartzMap.seminorm 𝕜 0 0

(𝕜 : Type u_1)
(E : Type u_4)
(F : Type u_5)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[NormedField 𝕜]
[NormedSpace 𝕜 F]
[SMulCommClass ℝ 𝕜 F]


@[simp] theorem exists_unique_eq' {a' : α} : ∃! a, a' = a


theorem eval_surjective (n : ℕ) : Function.Surjective (eval I M n)

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

Function.Surjective ⇑(AdicCompletion.eval I M n)


/-- Construct a left lift along `g : c ⟶ a` from a left lift along `𝟙 c ≫ g`. -/
@[simps!]
def ofIdComp (t : LeftLift f (𝟙 c ≫ g)) : LeftLift f g

(t : CategoryTheory.Bicategory.LeftLift f (CategoryTheory.CategoryStruct.comp (CategoryTheory.CategoryStruct.id c) g))


@[simp]
theorem enumFrom_singleton (x : α) (n : ℕ) : enumFrom n [x] = [(n, x)]


theorem iUnion_nonempty_index (s : Set α) (t : s.Nonempty → Set β) :
    ⋃ h, t h = ⋃ x ∈ s, t ⟨x, ‹_›⟩

{α : Type u_1}
{β : Type u_2}
(s : Set α)
(t : s.Nonempty → Set β)

⋃ (h : s.Nonempty), t h = ⋃ x, ⋃ (h : x ∈ s), t ⋯


private theorem sinh_add_aux {a b c d : ℂ} :
    (a - b) * (c + d) + (a + b) * (c - d) = 2 * (a * c - b * d)


/-- Being étale is transported via algebra isomorphisms. -/
theorem of_equiv [Etale R A] (e : A ≃ₐ[R] B) : Etale R B

{R : Type u}
[CommRing R]
{A B : Type u}
[CommRing A]
[Algebra R A]
[CommRing B]
[Algebra R B]
[Algebra.Etale R A]
(e : A ≃ₐ[R] B)


theorem append_right_cons {n m} {α : Type*} (xs : Fin n → α) (y : α) (ys : Fin m → α) :
    Fin.append xs (Fin.cons y ys) =
      Fin.append (Fin.snoc xs y) ys ∘ Fin.cast (Nat.succ_add_eq_add_succ ..).symm

{n m : ℕ}
{α : Type u_1}
(xs : Fin n → α)
(y : α)
(ys : Fin m → α)

Fin.append xs (Fin.cons y ys) = Fin.append (Fin.snoc xs y) ys ∘ Fin.cast ⋯


/-- Makes a multiplicative inverse from a bijection which preserves multiplication. -/
@[to_additive (attr := simps)
  "Makes an additive inverse from a bijection which preserves addition."]
def MulHom.inverse [Mul M] [Mul N] (f : M →ₙ* N) (g : N → M)
    (h₁ : Function.LeftInverse g f)
    (h₂ : Function.RightInverse g f) : N →ₙ* M

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(f : M →ₙ* N)
(g : N → M)
(h₁ : Function.LeftInverse g ⇑f)
(h₂ : Function.RightInverse g ⇑f)


/-- Let `X` be a topological space, `𝔖` a family of compact subsets of `X`, `α` a uniform space,
and `F : ι → (X → α)` a family which is equicontinuous on each `K ∈ 𝔖`. Then, the topologies
of uniform convergence on `𝔖` and pointwise convergence on `⋃₀ 𝔖` induce the same topology on  `ι`.

In particular, pointwise convergence and compact convergence coincide on an equicontinuous
subset of `X → α`.

This is a consequence of `EquicontinuousOn.comap_uniformOnFun_eq` stated in terms of `Inducing`
for convenuence. -/
lemma EquicontinuousOn.inducing_uniformOnFun_iff_pi' [TopologicalSpace ι]
    {𝔖 : Set (Set X)} (𝔖_compact : ∀ K ∈ 𝔖, IsCompact K)
    (F_eqcont : ∀ K ∈ 𝔖, EquicontinuousOn F K) :
    Inducing (UniformOnFun.ofFun 𝔖 ∘ F) ↔
    Inducing ((⋃₀ 𝔖).restrict ∘ F)

Inducing (⇑(UniformOnFun.ofFun 𝔖) ∘ F) ↔ Inducing ((⋃₀ 𝔖).restrict ∘ F)


theorem infinitePos_add_not_infinite {x y : ℝ*} :
    InfinitePos x → ¬Infinite y → InfinitePos (x + y)

x.InfinitePos → ¬y.Infinite → (x + y).InfinitePos


@[simp]
theorem round_add_one (a : α) : round (a + 1) = round a + 1

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


theorem biInter_range {f : ι → α} {g : α → Set β} : ⋂ x ∈ range f, g x = ⋂ y, g (f y)

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


theorem iff_addGroup_fg {G : Type*} [AddCommGroup G] : Module.Finite ℤ G ↔ AddGroup.FG G


theorem preimage_subset_core (f : α →. β) (s : Set β) : f.preimage s ⊆ f.core s

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


theorem pso_inv {i : R} (hi : i * i = -1) : Pso p q R i * Pso p q R (-i) = 1

(p : Type u_2)
(q : Type u_3)
(R : Type u₂)
[DecidableEq p]
[DecidableEq q]
[CommRing R]
[Fintype p]
[Fintype q]
{i : R}
(hi : i * i = -1)

LieAlgebra.Orthogonal.Pso p q R i * LieAlgebra.Orthogonal.Pso p q R (-i) = 1


@[simp]
theorem leftComm_tmul (m : M) (p : P) (q : Q) :
    leftComm R A M P Q (m ⊗ₜ (p ⊗ₜ q)) = p ⊗ₜ (m ⊗ₜ q)

(R : Type uR)
(A : Type uA)
{M : Type uM}
{P : Type uP}
{Q : Type uQ}
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid P]
[Module R P]
[Module A P]
[IsScalarTower R A P]
[AddCommMonoid Q]
[Module R Q]
(m : M)
(p : P)
(q : Q)

(TensorProduct.AlgebraTensorModule.leftComm R A M P Q) (m ⊗ₜ[A] p ⊗ₜ[R] q) = p ⊗ₜ[A] m ⊗ₜ[R] q


/-- If `f : P ⟶ R` and `g : Q ⟶ R` are morphisms and `p : P` and `q : Q` are pseudoelements such
    that `f p = g q`, then there is some `s : pullback f g` such that `fst s = p` and `snd s = q`.

    Remark: Borceux claims that `s` is unique, but this is false. See
    `Counterexamples/Pseudoelement.lean` for details. -/
theorem pseudo_pullback {P Q R : C} {f : P ⟶ R} {g : Q ⟶ R} {p : P} {q : Q} :
    f p = g q →
      ∃ s, pullback.fst f g s = p ∧ pullback.snd f g s = q

{p : CategoryTheory.Abelian.Pseudoelement P}

{q : CategoryTheory.Abelian.Pseudoelement Q}

CategoryTheory.Abelian.Pseudoelement.pseudoApply f p = CategoryTheory.Abelian.Pseudoelement.pseudoApply g q →
  ∃ s,
    CategoryTheory.Abelian.Pseudoelement.pseudoApply (CategoryTheory.Limits.pullback.fst f g) s = p ∧
      CategoryTheory.Abelian.Pseudoelement.pseudoApply (CategoryTheory.Limits.pullback.snd f g) s = q


@[simp]
lemma compLeft_iso (W) (F : D ⥤ E) : Localization.Lifting.iso L W (L ⋙ F) F = Iso.refl _

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

CategoryTheory.Localization.Lifting.iso L W (L.comp F) F = CategoryTheory.Iso.refl (L.comp F)


theorem mk_quot_le {α : Type u} {r : α → α → Prop} : #(Quot r) ≤ #α


/-- Given a type `E` equipped with a fiber bundle structure, this is a `Prop` typeclass
for trivializations of `E`, expressing that a trivialization is in the designated atlas for the
bundle.  This is needed because lemmas about the linearity of trivializations or the continuity (as
functions to `F →L[R] F`, where `F` is the model fiber) of the transition functions are only
expected to hold for trivializations in the designated atlas. -/
@[mk_iff]
class MemTrivializationAtlas [FiberBundle F E] (e : Trivialization F (π F E)) : Prop where
  out : e ∈ trivializationAtlas F E

[TopologicalSpace (Bundle.TotalSpace F E)]

{e : Trivialization F Bundle.TotalSpace.proj}


@[simp]
theorem volume_Ici {a : ℝ} : volume (Ici a) = ∞


/-- Reflection in the `Submodule.map` of a subspace. -/
theorem reflection_map_apply {E E' : Type*} [NormedAddCommGroup E] [NormedAddCommGroup E']
    [InnerProductSpace 𝕜 E] [InnerProductSpace 𝕜 E'] (f : E ≃ₗᵢ[𝕜] E') (K : Submodule 𝕜 E)
    [HasOrthogonalProjection K] (x : E') :
    reflection (K.map (f.toLinearEquiv : E →ₗ[𝕜] E')) x = f (reflection K (f.symm x))

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_4}
{E' : Type u_5}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 E']
(f : E ≃ₗᵢ[𝕜] E')
(K : Submodule 𝕜 E)
[HasOrthogonalProjection K]
(x : E')

(reflection (Submodule.map (↑f.toLinearEquiv) K)) x = f ((reflection K) (f.symm x))


@[simp]
theorem norm_zero [Nontrivial S] [Module.Free R S] [Module.Finite R S] : norm R (0 : S) = 0

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
[Nontrivial S]
[Module.Free R S]
[Module.Finite R S]


@[simp]
theorem basisFun_apply [DecidableEq η] (i) : basisFun R η i = stdBasis R (fun _ : η => R) i 1

(R : Type u_1)
(η : Type u_2)
[Semiring R]
[Finite η]
[DecidableEq η]
(i : η)

(Pi.basisFun R η) i = (LinearMap.stdBasis R (fun x => R) i) 1


theorem isCoseparator_iff_faithful_preadditiveYoneda (G : C) :
    IsCoseparator G ↔ (preadditiveYoneda.obj G).Faithful

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

CategoryTheory.IsCoseparator G ↔ (CategoryTheory.preadditiveYoneda.obj G).Faithful


theorem preservesEpimorphsisms_of_adjunction {F : C ⥤ D} {G : D ⥤ C} (adj : F ⊣ G) :
    PreservesEpimorphisms F

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


@[to_additive]
theorem eq_comp_symm {α : Type*} (e : M ≃* N) (f : N → α) (g : M → α) :
    f = g ∘ e.symm ↔ f ∘ e = g

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
{α : Type u_12}
(e : M ≃* N)
(f : N → α)
(g : M → α)


theorem succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul (hp : Prime p) {a b : α} {k l : ℕ} :
    p ^ k ∣ a → p ^ l ∣ b → p ^ (k + l + 1) ∣ a * b → p ^ (k + 1) ∣ a ∨ p ^ (l + 1) ∣ b

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p : α}
(hp : Prime p)
{a b : α}
{k l : ℕ}


lemma addContent_biUnion_le {ι : Type*} (hC : IsSetRing C) {s : ι → Set α}
    {S : Finset ι} (hs : ∀ n ∈ S, s n ∈ C) :
    m (⋃ i ∈ S, s i) ≤ ∑ i ∈ S, m (s i)

{α : Type u_1}
{C : Set (Set α)}
{m : MeasureTheory.AddContent C}
{ι : Type u_2}
(hC : MeasureTheory.IsSetRing C)
{s : ι → Set α}
{S : Finset ι}
(hs : ∀ n ∈ S, s n ∈ C)


/-- Two ring homomorphisms into `ZMod n` with equal kernels are equal. -/
theorem ZMod.ringHom_eq_of_ker_eq {n : ℕ} {R : Type*} [CommRing R] (f g : R →+* ZMod n)
    (h : RingHom.ker f = RingHom.ker g) : f = g

{n : ℕ}
{R : Type u_1}
[CommRing R]
(f g : R →+* ZMod n)
(h : RingHom.ker f = RingHom.ker g)


/-- Given a collection of isomorphisms between corresponding summands of a pair of biproducts
indexed by the same type, we obtain an isomorphism between the biproducts. -/
@[simps]
def biproduct.mapIso {f g : J → C} [HasBiproduct f] [HasBiproduct g] (p : ∀ b, f b ≅ g b) :
    ⨁ f ≅ ⨁ g

(CategoryTheory.Limits.biproduct.mapIso p).inv = CategoryTheory.Limits.biproduct.map fun b => (p b).inv


/-- The functional equation for the Jacobi theta function: `jacobiTheta₂ z τ` is an explict factor
times `jacobiTheta₂ (z / τ) (-1 / τ)`. This is the key lemma behind the proof of the functional
equation for L-series of even Dirichlet characters. -/
theorem jacobiTheta₂_functional_equation (z τ : ℂ) : jacobiTheta₂ z τ =
    1 / (-I * τ) ^ (1 / 2 : ℂ) * cexp (-π * I * z ^ 2 / τ) * jacobiTheta₂ (z / τ) (-1 / τ)

jacobiTheta₂ z τ = 1 / (-Complex.I * τ) ^ (1 / 2) * cexp (-↑π * Complex.I * z ^ 2 / τ) * jacobiTheta₂ (z / τ) (-1 / τ)


theorem Basis.isScalarTower_finsupp {ι} (b : Basis ι S A) : IsScalarTower R S (ι →₀ S)

(R : Type u)
{S : Type v}
{A : Type w}
[Semiring R]
[Semiring S]
[AddCommMonoid A]
[Module R S]
[Module S A]
[Module R A]
[IsScalarTower R S A]
{ι : Type u_1}
(b : Basis ι S A)


@[simp]
theorem app_left_eq_ι (a) : K.π.app (WalkingMulticospan.left a) = K.ι a

{I : CategoryTheory.Limits.MulticospanIndex C}

K.π.app (CategoryTheory.Limits.WalkingMulticospan.left a) = K.ι a


theorem toOuterMeasure_le : μ₁.toOuterMeasure ≤ μ₂.toOuterMeasure ↔ μ₁ ≤ μ₂

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ₁ μ₂ : MeasureTheory.Measure α}


theorem _root_.IsSMulRegular.polynomial {S : Type*} [Monoid S] [DistribMulAction S R] {a : S}
    (ha : IsSMulRegular R a) : IsSMulRegular R[X] a

{R : Type u}
[Semiring R]
{S : Type u_1}
[Monoid S]
[DistribMulAction S R]
{a : S}
(ha : IsSMulRegular R a)


@[to_additive (attr := simp)]
theorem sym_one [One α] : sym (1 : α) = 1


lemma hasHomology_of_isIso_leftRightHomologyComparison'
    (h₁ : S.LeftHomologyData) (h₂ : S.RightHomologyData)
    [IsIso (leftRightHomologyComparison' h₁ h₂)] :
    S.HasHomology

[CategoryTheory.IsIso (CategoryTheory.ShortComplex.leftRightHomologyComparison' h₁ h₂)]


/--
Consider the contravariant functors between compact Hausdorff spaces and commutative unital
C⋆algebras `F : Cpct → CommCStarAlg := X ↦ C(X, ℂ)` and
`G : CommCStarAlg → Cpct := A → characterSpace ℂ A` whose actions on morphisms are given by
`WeakDual.CharacterSpace.compContinuousMap` and `ContinuousMap.compStarAlgHom'`, respectively.

Then `η : id → G ∘ F := WeakDual.CharacterSpace.homeoEval` is a natural isomorphism implementing
(half of) the duality between these categories. That is, for compact Hausdorff spaces `X` and `Y`,
`f : C(X, Y)` the following diagram commutes:

```
X  --- η X ---> characterSpace ℂ C(X, ℂ)

|                     |

f                  (G ∘ F) f

|                     |
V                     V

Y  --- η Y ---> characterSpace ℂ C(Y, ℂ)
```
-/
lemma WeakDual.CharacterSpace.homeoEval_naturality {X Y 𝕜 : Type*} [RCLike 𝕜] [TopologicalSpace X]
    [CompactSpace X] [T2Space X] [TopologicalSpace Y] [CompactSpace Y] [T2Space Y] (f : C(X, Y)) :
    (homeoEval Y 𝕜 : C(_, _)).comp f =
      (f.compStarAlgHom' 𝕜 𝕜 |> compContinuousMap).comp (homeoEval X 𝕜 : C(_, _))

{X : Type u_1}
{Y : Type u_2}
{𝕜 : Type u_3}
[RCLike 𝕜]
[TopologicalSpace X]
[CompactSpace X]
[T2Space X]
[TopologicalSpace Y]
[CompactSpace Y]
[T2Space Y]
(f : C(X, Y))

(WeakDual.CharacterSpace.homeoEval Y 𝕜).toContinuousMap.comp f =
  (WeakDual.CharacterSpace.compContinuousMap (ContinuousMap.compStarAlgHom' 𝕜 𝕜 f)).comp
    (WeakDual.CharacterSpace.homeoEval X 𝕜).toContinuousMap


/-- Isomorphic monads give equivalent categories of algebras. Furthermore, they are equivalent as
categories over `C`, that is, we have `algebraEquivOfIsoMonads h ⋙ forget = forget`.
-/
@[simps]
def algebraEquivOfIsoMonads {T₁ T₂ : Monad C} (h : T₁ ≅ T₂) : Algebra T₁ ≌ Algebra T₂

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T₁ T₂ : CategoryTheory.Monad C}
(h : T₁ ≅ T₂)

(CategoryTheory.Monad.algebraEquivOfIsoMonads h).unitIso =
  CategoryTheory.Monad.algebraFunctorOfMonadHomId.symm ≪≫
    CategoryTheory.Monad.algebraFunctorOfMonadHomEq ⋯ ≪≫ CategoryTheory.Monad.algebraFunctorOfMonadHomComp h.hom h.inv


@[simp]
theorem ofLinear_apply {h₁ h₂} (x : M) : (ofLinear f g h₁ h₂ : M ≃ₛₗ[σ₁₂] M₂) x = f x

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_M₂ : Module R₂ M₂}
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
(f : M →ₛₗ[σ₁₂] M₂)
(g : M₂ →ₛₗ[σ₂₁] M)
{h₁ : f.comp g = LinearMap.id}
{h₂ : g.comp f = LinearMap.id}
(x : M)

(LinearEquiv.ofLinear f g h₁ h₂) x = f x


theorem birkhoffAverage_congr_ring' (S : Type*) [DivisionSemiring S] [Module S M] :
    birkhoffAverage (α := α) (M := M) R = birkhoffAverage S

(R : Type u_1)
{α : Type u_2}
{M : Type u_3}
[DivisionSemiring R]
[AddCommMonoid M]
[Module R M]
(S : Type u_4)
[DivisionSemiring S]
[Module S M]


@[to_additive (attr := simp, norm_cast)]
theorem coe_centralizer : ↑(centralizer S) = S.centralizer

{M : Type u_1}
(S : Set M)
[AddMonoid M]

↑(AddSubmonoid.centralizer S) = S.addCentralizer


private lemma y_spec : S.a + η * S.b = λ * S.y

(S : FermatLastTheoremForThreeGen.Solution hζ)

S.a + ↑⋯.unit * S.b = (hζ.toInteger - 1) * FermatLastTheoremForThreeGen.Solution.y S


theorem integral_map {β} [MeasurableSpace β] {φ : α → β} (hφ : AEMeasurable φ μ) {f : β → G}
    (hfm : AEStronglyMeasurable f (Measure.map φ μ)) :
    ∫ y, f y ∂Measure.map φ μ = ∫ x, f (φ x) ∂μ

(hfm : MeasureTheory.AEStronglyMeasurable f (MeasureTheory.Measure.map φ μ))

∫ (y : β), f y ∂MeasureTheory.Measure.map φ μ = ∫ (x : α), f (φ x) ∂μ


@[to_additive (attr := simp)]
lemma mulEquivOfOrderOfEq_symm :
    (mulEquivOfOrderOfEq hg hg' h).symm = mulEquivOfOrderOfEq hg' hg h.symm

(hg : ∀ (x : G), x ∈ AddSubgroup.zmultiples g)

(hg' : ∀ (x : G'), x ∈ AddSubgroup.zmultiples g')

(addEquivOfAddOrderOfEq hg hg' h).symm = addEquivOfAddOrderOfEq hg' hg ⋯


/-- See also `measure_preimage_smul_of_nullMeasurableSet` and `measure_preimage_smul`. -/
@[to_additive "See also `measure_preimage_smul_of_nullMeasurableSet` and `measure_preimage_smul`."]
theorem measure_preimage_smul_le (c : G) (s : Set α) : μ ((c • ·) ⁻¹' s) ≤ μ s

[MeasureTheory.VAddInvariantMeasure G α μ]


/-- An image map is a morphism `image f → image g` fitting into a commutative square and satisfying
    the obvious commutativity conditions. -/
structure ImageMap {f g : Arrow C} [HasImage f.hom] [HasImage g.hom] (sq : f ⟶ g) where
  map : image f.hom ⟶ image g.hom
  map_ι : map ≫ image.ι g.hom = image.ι f.hom ≫ sq.right := by aesop

(self : CategoryTheory.Limits.ImageMap sq)

self.map ≫ CategoryTheory.Limits.image.ι g.hom = CategoryTheory.Limits.image.ι f.hom ≫ sq.right


/-- Division `y ↦ x / y` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply symm_apply toEquiv)
  "Subtraction `y ↦ x - y` as an `IsometryEquiv`."]
def divLeft (c : G) : G ≃ᵢ G

{G : Type v}
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul G G]
[IsometricSMul Gᵐᵒᵖ G]
(c b : G)

(IsometryEquiv.divLeft c).symm b = b⁻¹ * c


theorem to_dual [LE α] (hs : IsAntichain (· ≤ ·) s) : @IsAntichain αᵒᵈ (· ≤ ·) s

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


@[simp]
theorem toFun_eq_coe (f : L₁ →ₗ⁅R⁆ L₂) : f.toFun = ⇑f

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieAlgebra R L₁]
[LieRing L₂]
[LieAlgebra R L₂]
(f : L₁ →ₗ⁅R⁆ L₂)


/-- Transferring from `Semifield` to `IsField`. -/
theorem Semifield.toIsField (R : Type u) [Semifield R] : IsField R


@[to_additive]
theorem prod_induction (p : α → Prop) (s : Multiset α) (p_mul : ∀ a b, p a → p b → p (a * b))
    (p_one : p 1) (p_s : ∀ a ∈ s, p a) : p s.prod

(p_mul : ∀ (a b : α), p a → p b → p (a + b))


theorem vsub_iInter₂_subset (s : Set β) (t : ∀ i, κ i → Set β) :
    (s -ᵥ ⋂ (i) (j), t i j) ⊆ ⋂ (i) (j), s -ᵥ t i j

{α : Type u_2}
{β : Type u_3}
{ι : Sort u_5}
{κ : ι → Sort u_6}
[VSub α β]
(s : Set β)
(t : (i : ι) → κ i → Set β)

s -ᵥ ⋂ i, ⋂ j, t i j ⊆ ⋂ i, ⋂ j, s -ᵥ t i j


@[to_additive (attr := simp)]
lemma coe_id {X : CommGrp} : (𝟙 X : X → X) = id


/-- If the indexing order has the discrete topology, then the stopped process of an adapted process
is adapted. -/
theorem Adapted.stoppedProcess_of_discrete [DiscreteTopology ι] (hu : Adapted f u)
    (hτ : IsStoppingTime f τ) : Adapted f (MeasureTheory.stoppedProcess u τ)

{u : ι → Ω → β}

MeasureTheory.Adapted f (MeasureTheory.stoppedProcess u τ)


theorem Valid.mk (cs cs' : List Char) : Valid ⟨cs ++ cs'⟩ ⟨utf8Len cs⟩

String.Pos.Valid { data := cs ++ cs' } { byteIdx := String.utf8Len cs }


@[to_additive]
theorem smul_orbit_subset (m : M) (a : α) : m • orbit M a ⊆ orbit M a

{M : Type u}
[AddMonoid M]
{α : Type v}
[AddAction M α]
(m : M)
(a : α)

m +ᵥ AddAction.orbit M a ⊆ AddAction.orbit M a


/-- Homotopy between morphisms of short complexes is compatible with postcomposition. -/
@[simps]
def compRight (h : Homotopy φ₁ φ₂) (ψ : S₂ ⟶ S₃) : Homotopy (φ₁ ≫ ψ) (φ₂ ≫ ψ)

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

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

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

(h.compRight ψ).h₂ = CategoryTheory.CategoryStruct.comp h.h₂ ψ.τ₂


@[gcongr] protected theorem div_le_div (hab : a ≤ b) (hdc : d ≤ c) : a / c ≤ b / d

{a b c d : ENNReal}
(hab : a ≤ b)
(hdc : d ≤ c)


lemma isLUB_range_ωSup (c : Chain α) : IsLUB (Set.range c) (ωSup c)

{α : Type u}
[OmegaCompletePartialOrder α]
(c : OmegaCompletePartialOrder.Chain α)

IsLUB (Set.range ⇑c) (OmegaCompletePartialOrder.ωSup c)


theorem mem_maximals_setOf_iff {P : α → Prop} :
    x ∈ maximals r (setOf P) ↔ P x ∧ ∀ ⦃y⦄, P y → r x y → x = y

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

x ∈ maximals r (setOf P) ↔ P x ∧ ∀ ⦃y : α⦄, P y → r x y → x = y


@[to_additive]
theorem not_one_le_div_iff : ¬1 ≤ f / g ↔ Disjoint f g

{α : Type u_2}
[AddGroup α]
{f g : Filter α}


@[to_additive]
lemma pow_injOn_Iio_orderOf : (Set.Iio <| orderOf x).InjOn (x ^ ·)

Set.InjOn (fun x_1 => x_1 • x) (Set.Iio (addOrderOf x))


@[simp]
theorem natDegree_basis (hvs : Set.InjOn v s) (hi : i ∈ s) :
    (Lagrange.basis s v i).natDegree = s.card - 1

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


@[simp] lemma toMonoidHomEquiv_apply (ψ : AddChar A M) (a : Multiplicative A) :
    toMonoidHomEquiv ψ a = ψ (Multiplicative.toAdd a)

{A : Type u_1}
{M : Type u_3}
[AddMonoid A]
[Monoid M]
(ψ : AddChar A M)
(a : Multiplicative A)

(AddChar.toMonoidHomEquiv ψ) a = ψ (Multiplicative.toAdd a)


lemma reverse_charpoly (M : Matrix n n R) :
    M.charpoly.reverse = M.charpolyRev

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
(M : Matrix n n R)


theorem IsTrail.of_append_left {u v w : V} {p : G.Walk u v} {q : G.Walk v w}
    (h : (p.append q).IsTrail) : p.IsTrail

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
{p : G.Walk u v}
{q : G.Walk v w}
(h : (p.append q).IsTrail)


theorem natTrans_app_f_app (P : Karoubi (SimplicialObject C)) :
    Γ₂N₂.natTrans.app P =
      (N₂ ⋙ Γ₂).map P.decompId_i ≫
        (Γ₂N₂ToKaroubiIso.hom ≫ Γ₂N₁.natTrans).app P.X ≫ P.decompId_p

(P : CategoryTheory.Idempotents.Karoubi (CategoryTheory.SimplicialObject C))

AlgebraicTopology.DoldKan.Γ₂N₂.natTrans.app P =
  (AlgebraicTopology.DoldKan.N₂ ⋙ AlgebraicTopology.DoldKan.Γ₂).map P.decompId_i ≫
    (AlgebraicTopology.DoldKan.Γ₂N₂ToKaroubiIso.hom ≫ AlgebraicTopology.DoldKan.Γ₂N₁.natTrans).app P.X ≫ P.decompId_p


theorem ndinter_eq_zero_iff_disjoint {s t : Multiset α} : ndinter s t = 0 ↔ Disjoint s t

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


/-- The relationship between `IsPrimitiveRoot.autToPow` and
`ModularCyclotomicCharacter`. Note that `IsPrimitiveRoot.autToPow`
needs an explicit root of unity, and also an auxiliary "base ring" `R`. -/
lemma IsPrimitiveRoot.autToPow_eq_ModularCyclotomicCharacter (n : ℕ+)
    (R : Type*) [CommRing R] [Algebra R L] {μ : L} (hμ : IsPrimitiveRoot μ n) (g : L ≃ₐ[R] L) :
    hμ.autToPow R g = ModularCyclotomicCharacter L hμ.card_rootsOfUnity g

{L : Type u}
[CommRing L]
[IsDomain L]
(n : ℕ+)
(R : Type u_1)
[CommRing R]
[Algebra R L]
{μ : L}
(hμ : IsPrimitiveRoot μ ↑n)
(g : L ≃ₐ[R] L)

(IsPrimitiveRoot.autToPow R hμ) g = (ModularCyclotomicCharacter L ⋯) ↑g


theorem inner_smul_left (x y : F) {r : 𝕜} : ⟪r • x, y⟫ = r† * ⟪x, y⟫

{𝕜 : Type u_1}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
[c : InnerProductSpace.Core 𝕜 F]
(x y : F)
{r : 𝕜}

⟪r • x, y⟫_𝕜 = (starRingEnd 𝕜) r * ⟪x, y⟫_𝕜


theorem adj_injective : Injective (Adj : SimpleGraph V → V → V → Prop)


@[simp]
theorem length_comp (p : Path a b) : ∀ {c} (q : Path b c), (p.comp q).length = p.length + q.length

{V : Type u}
[Quiver V]
{a b : V}
(p : Quiver.Path a b)
{c : V}
(q : Quiver.Path b c)


theorem lt_of_lt_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a < 0) (hb : b = 0) : a + b < 0

{α : Type u_1}
[OrderedSemiring α]
{a b : α}
(ha : a < 0)
(hb : b = 0)


theorem uniformContinuous_ofAdd : UniformContinuous (ofAdd : α → Multiplicative α)


theorem finsetIntegerMultiple_image [DecidableEq R] (s : Finset S) :
    algebraMap R S '' finsetIntegerMultiple M s = commonDenomOfFinset M s • (s : Set S)

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
[DecidableEq R]
(s : Finset S)

⇑(algebraMap R S) '' ↑(IsLocalization.finsetIntegerMultiple M s) = IsLocalization.commonDenomOfFinset M s • ↑s


@[simp]
lemma comp_zero [∀ (a : M), (shiftFunctor C a).PreservesZeroMorphisms]
    {a : M} (β : ShiftedHom X Y a) {b c : M} (h : b + a = c) :
    β.comp (0 : ShiftedHom Y Z b) h = 0

[∀ (a : M), (CategoryTheory.shiftFunctor C a).PreservesZeroMorphisms]


@[norm_cast] -- @[simp] -- Porting note (#10618): simp can prove this
theorem to_nat_to_int (n : PosNum) : ((n : ℕ) : ℤ) = n


theorem finite_stableUnderBaseChange : StableUnderBaseChange @Finite


@[simp]
theorem Groupoid.reverse_eq_inv (f : X ⟶ Y) : Quiver.reverse f = Groupoid.inv f

{C : Type u}
[CategoryTheory.Groupoid C]
{X Y : C}
(f : X ⟶ Y)

Quiver.reverse f = CategoryTheory.Groupoid.inv f


/-- The seminorm of an element in a product space is `≤ r` if and only if the norm of each
component is. -/
@[to_additive pi_norm_le_iff_of_nonneg "The seminorm of an element in a product space is `≤ r` if
and only if the norm of each component is."]
lemma pi_norm_le_iff_of_nonneg' (hr : 0 ≤ r) : ‖x‖ ≤ r ↔ ∀ i, ‖x i‖ ≤ r

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedGroup (π i)]
{x : (i : ι) → π i}
{r : ℝ}
(hr : 0 ≤ r)


lemma strictMono_castSucc : StrictMono (castSucc : Fin n → Fin (n + 1))


@[simp]
theorem Differentiable.log (hf : Differentiable ℝ f) (hx : ∀ x, f x ≠ 0) :
    Differentiable ℝ fun x => log (f x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
(hf : Differentiable ℝ f)
(hx : ∀ (x : E), f x ≠ 0)

Differentiable ℝ fun x => Real.log (f x)


theorem log_doublingGamma_eq :
    EqOn (log ∘ doublingGamma)
      (fun s => log (Gamma (s / 2)) + log (Gamma (s / 2 + 1 / 2)) + s * log 2 - log (2 * √π))
      (Ioi 0)

Set.EqOn (Real.log ∘ Real.doublingGamma)
  (fun s => Real.log (Real.Gamma (s / 2)) + Real.log (Real.Gamma (s / 2 + 1 / 2)) + s * Real.log 2 - Real.log (2 * √π))
  (Set.Ioi 0)


theorem independent_of_dfinsupp_sumAddHom_injective (p : ι → AddSubmonoid N)
    (h : Function.Injective (sumAddHom fun i => (p i).subtype)) : Independent p

(h : Function.Injective ⇑(DFinsupp.sumAddHom fun i => (p i).subtype))


theorem derivative_zero : derivative (0 : R[X]) = 0


theorem span_minpoly_eq_annihilator {M} [AddCommGroup M] [Module 𝕜 M] (f : Module.End 𝕜 M) :
    Ideal.span {minpoly 𝕜 f} = Module.annihilator 𝕜[X] (Module.AEval' f)

(𝕜 : Type u_1)
[Field 𝕜]
{M : Type u_3}
[AddCommGroup M]
[Module 𝕜 M]
(f : Module.End 𝕜 M)


lemma HasEigenvalue.pow {f : End R M} {μ : R} (h : f.HasEigenvalue μ) (n : ℕ) :
    (f ^ n).HasEigenvalue (μ ^ n)

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : Module.End R M}
{μ : R}
(h : f.HasEigenvalue μ)
(n : ℕ)


theorem or_iff_not_and_not : a ∨ b ↔ ¬(¬a ∧ ¬b)

a ∨ b ↔ ¬(¬a ∧ ¬b)


theorem map_adj_iff {v w : V} : G'.Adj (f v) (f w) ↔ G.Adj v w

{V : Type u_1}
{W : Type u_2}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G ≃g G')
{v w : V}


theorem drop_suffix (n) (l : List α) : drop n l <:+ l


@[simp]
theorem le_zero_iff : a ≤ 0 ↔ a = 0

{α : Type u_1}
[LinearOrderedCommMonoidWithZero α]
{a : α}


@[simp] theorem append_data (arr arr' : Array α) :
    (arr ++ arr').data = arr.data ++ arr'.data


theorem SemilatticeSup.dual_dual (α : Type*) [H : SemilatticeSup α] :
    OrderDual.instSemilatticeSup αᵒᵈ = H


lemma surjective_transitionMap (n : ℕ) : Function.Surjective (S.transitionMap n)


/-- Test for convergence of the `p`-series: the real-valued series `∑' n : ℕ, 1 / n ^ p` converges
if and only if `1 < p`. -/
theorem summable_one_div_nat_pow {p : ℕ} :
    Summable (fun n => 1 / (n : ℝ) ^ p : ℕ → ℝ) ↔ 1 < p


@[to_additive sub_nsmul]
lemma pow_sub (a : G) {m n : ℕ} (h : n ≤ m) : a ^ (m - n) = a ^ m * (a ^ n)⁻¹

{G : Type u_3}
[Group G]
(a : G)
{m n : ℕ}
(h : n ≤ m)


@[to_additive (attr := simp, norm_cast)]
theorem coe_eq_univ {H : Subgroup G} : (H : Set G) = Set.univ ↔ H = ⊤

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


@[fun_prop]
theorem HasStrictFDerivAt.star (h : HasStrictFDerivAt f f' x) :
    HasStrictFDerivAt (fun x => star (f x)) (((starL' 𝕜 : F ≃L[𝕜] F) : F →L[𝕜] F) ∘L f') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[StarRing 𝕜]
[TrivialStar 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[StarAddMonoid F]
[NormedSpace 𝕜 F]
[StarModule 𝕜 F]
[ContinuousStar F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
(h : HasStrictFDerivAt f f' x)

HasStrictFDerivAt (fun x => star (f x)) ((↑(starL' 𝕜)).comp f') x


@[simp]
theorem coe_equivInteger_apply (a : A) : (equivInteger A K a : K) = algebraMap A K a

(A : Type u)
[CommRing A]
(K : Type v)
[Field K]
[Algebra A K]
[IsDomain A]
[ValuationRing A]
[IsFractionRing A K]
(a : A)

↑((ValuationRing.equivInteger A K) a) = (algebraMap A K) a


@[simp]
theorem spanExt_hom_app_zero : (spanExt iX iY iZ wf wg).hom.app WalkingSpan.zero = iX.hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z X' Y' Z' : C}
(iX : X ≅ X')
(iY : Y ≅ Y')
(iZ : Z ≅ Z')
{f : X ⟶ Y}
{g : X ⟶ Z}
{f' : X' ⟶ Y'}
{g' : X' ⟶ Z'}
(wf : iX.hom ≫ f' = f ≫ iY.hom)
(wg : iX.hom ≫ g' = g ≫ iZ.hom)

(CategoryTheory.Limits.spanExt iX iY iZ wf wg).hom.app CategoryTheory.Limits.WalkingSpan.zero = iX.hom


@[simp, reassoc]
theorem p_comp_d : P.p.f n ≫ f.f.f n = f.f.f n

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

CategoryTheory.CategoryStruct.comp (P.p.f n) (f.f.f n) = f.f.f n


theorem degree_lt_wf : WellFounded fun p q : R[X] => degree p < degree q

WellFounded fun p q => p.degree < q.degree


nonrec theorem gcd_mul_right {a : α} : (s.gcd fun x ↦ f x * a) = s.gcd f * normalize a

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f : β → α}
{a : α}

(s.gcd fun x => f x * a) = s.gcd f * normalize a


theorem image_restrict (f : α → β) (s t : Set α) :
    s.restrict f '' (Subtype.val ⁻¹' t) = f '' (t ∩ s)

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


@[simp]
lemma sum_elim_vecMul_fromRows (B₁ : Matrix m₁ n R) (B₂ : Matrix m₂ n R)
    (v₁ : m₁ → R) (v₂ : m₂ → R) :
    Sum.elim v₁ v₂ ᵥ* fromRows B₁ B₂ = v₁ ᵥ* B₁ + v₂ ᵥ* B₂

{R : Type u_1}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n : Type u_5}
[Fintype m₁]
[Fintype m₂]
[Semiring R]
(B₁ : Matrix m₁ n R)
(B₂ : Matrix m₂ n R)
(v₁ : m₁ → R)
(v₂ : m₂ → R)

Matrix.vecMul (Sum.elim v₁ v₂) (B₁.fromRows B₂) = Matrix.vecMul v₁ B₁ + Matrix.vecMul v₂ B₂


theorem graph_injective (α M) [Zero M] : Injective (@graph α M _)

(α : Type u_13)
(M : Type u_14)
[Zero M]


theorem exists_seq_strictAnti_strictMono_tendsto [DenselyOrdered α] [FirstCountableTopology α]
    {x y : α} (h : x < y) :
    ∃ u v : ℕ → α, StrictAnti u ∧ StrictMono v ∧ (∀ k, u k ∈ Ioo x y) ∧ (∀ l, v l ∈ Ioo x y) ∧
      (∀ k l, u k < v l) ∧ Tendsto u atTop (𝓝 x) ∧ Tendsto v atTop (𝓝 y)

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[FirstCountableTopology α]
{x y : α}
(h : x < y)

∃ u v,
  StrictAnti u ∧
    StrictMono v ∧
      (∀ (k : ℕ), u k ∈ Set.Ioo x y) ∧
        (∀ (l : ℕ), v l ∈ Set.Ioo x y) ∧
          (∀ (k l : ℕ), u k < v l) ∧ Filter.Tendsto u Filter.atTop (𝓝 x) ∧ Filter.Tendsto v Filter.atTop (𝓝 y)


theorem pbind_eq_none {f : ∀ a : α, a ∈ x → Option β}
    (h' : ∀ a (H : a ∈ x), f a H = none → x = none) : x.pbind f = none ↔ x = none

(h' : ∀ (a : α) (H : a ∈ x), f a H = none → x = none)


theorem lipschitzWith_compLp [Fact (1 ≤ p)] (hg : LipschitzWith c g) (g0 : g 0 = 0) :
    LipschitzWith c (hg.compLp g0 : Lp E p μ → Lp F p μ)

{α : Type u_1}
{E : Type u_2}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
{g : E → F}
{c : ℝ≥0}
[Fact (1 ≤ p)]
(hg : LipschitzWith c g)
(g0 : g 0 = 0)


@[to_additive]
theorem smul_pi_subset [∀ i, SMul K (R i)] (r : K) (s : Set ι) (t : ∀ i, Set (R i)) :
    r • pi s t ⊆ pi s (r • t)

{K : Type u_1}
{ι : Type u_2}
{R : ι → Type u_3}
[(i : ι) → VAdd K (R i)]
(r : K)
(s : Set ι)
(t : (i : ι) → Set (R i))


/-- If `∑' i, ‖f i‖` is summable, then `‖∑' i, f i‖ ≤ (∑' i, ‖f i‖)`. Note that we do not assume
that `∑' i, f i` is summable, and it might not be the case if `α` is not a complete space. -/
theorem norm_tsum_le_tsum_norm {f : ι → E} (hf : Summable fun i => ‖f i‖) :
    ‖∑' i, f i‖ ≤ ∑' i, ‖f i‖

{ι : Type u_1}
{E : Type u_3}
[SeminormedAddCommGroup E]
{f : ι → E}
(hf : Summable fun i => ‖f i‖)


@[simp]
theorem isCokernelEpiComp_desc {c : CokernelCofork f} (i : IsColimit c) {W} (g : W ⟶ X) [hg : Epi g]
    {h : W ⟶ Y} (hh : h = g ≫ f) (s : CokernelCofork h) :
    (isCokernelEpiComp i g hh).desc s =
      i.desc
        (Cofork.ofπ s.π
          (by
            rw [← cancel_epi g, ← Category.assoc, ← hh]
            simp))

{c : CategoryTheory.Limits.CokernelCofork f}

(s : CategoryTheory.Limits.CokernelCofork h)

(CategoryTheory.Limits.isCokernelEpiComp i g hh).desc s =
  i.desc (CategoryTheory.Limits.Cofork.ofπ (CategoryTheory.Limits.Cofork.π s) ⋯)


theorem comap_injective_of_surjective : Function.Injective (comap f)

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}
(hf : Function.Surjective ⇑f)


@[reassoc]
theorem δ_comp_σ_of_gt' {n} {i : Fin (n + 3)} {j : Fin (n + 2)} (H : j.succ < i) :
    δ i ≫ σ j = σ (j.castLT ((add_lt_add_iff_right 1).mp (lt_of_lt_of_le H i.is_le))) ≫
      δ (i.pred fun (hi : i = 0) => by simp only [Fin.not_lt_zero, hi] at H)

SimplexCategory.δ i ≫ SimplexCategory.σ j = SimplexCategory.σ (j.castLT ⋯) ≫ SimplexCategory.δ (i.pred ⋯)


/-- Extensionality for arrows -/
@[ext]
theorem Arrow.ext {α β : TypeVec n} (f g : α ⟹ β) :
    (∀ i, f i = g i) → f = g

{n : ℕ}
{α : TypeVec.{u_1} n}
{β : TypeVec.{u_2} n}
(f g : α.Arrow β)


@[simp]
theorem sign_mul_self (x : α) : sign x * x = |x|

{α : Type u_1}
[LinearOrderedRing α]
(x : α)


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


theorem topologicalSpace_eq [UniformSpace F] [UniformAddGroup F] (𝔖 : Set (Set E)) :
    instTopologicalSpace σ F 𝔖 = TopologicalSpace.induced DFunLike.coe
      (UniformOnFun.topologicalSpace E F 𝔖)

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NormedField 𝕜₁]
[NormedField 𝕜₂]
(σ : 𝕜₁ →+* 𝕜₂)
{E : Type u_3}
(F : Type u_4)
[AddCommGroup E]
[Module 𝕜₁ E]
[TopologicalSpace E]
[AddCommGroup F]
[Module 𝕜₂ F]
[UniformSpace F]
[UniformAddGroup F]
(𝔖 : Set (Set E))

UniformConvergenceCLM.instTopologicalSpace σ F 𝔖 =
  TopologicalSpace.induced DFunLike.coe (UniformOnFun.topologicalSpace E F 𝔖)


theorem Base.basis_ground (hB : M.Base B) : M.Basis B M.E

{α : Type u_1}
{M : Matroid α}
{B : Set α}
(hB : M.Base B)


theorem minCardFinsetOfMemConvexHull_nonempty : (minCardFinsetOfMemConvexHull hx).Nonempty

{𝕜 : Type u_1}
{E : Type u}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
{x : E}
(hx : x ∈ (convexHull 𝕜) s)


lemma Finset.nat_divisors_prod {ι : Type*} (s : Finset ι) (f : ι → ℕ) :
    divisors (∏ i ∈ s, f i) = ∏ i ∈ s, divisors (f i)

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

(∏ i ∈ s, f i).divisors = ∏ i ∈ s, (f i).divisors


theorem AntioneOn.integrableOn_isCompact [IsFiniteMeasureOnCompacts μ] (hs : IsCompact s)
    (hanti : AntitoneOn f s) : IntegrableOn f s μ


@[simp]
theorem transpose_transpose (μ : YoungDiagram) : μ.transpose.transpose = μ


theorem prod_primeFactors_sdiff_of_squarefree {n : ℕ} (hn : Squarefree n) {t : Finset ℕ}
    (ht : t ⊆ n.primeFactors) :
    ∏ a ∈ (n.primeFactors \ t), a = n / ∏ a ∈ t, a

∏ a ∈ n.primeFactors \ t, a = n / ∏ a ∈ t, a


/-- In a linearly ordered field with the order topology, if `f` tends to a positive constant `C` and
`g` tends to `Filter.atBot` then `f * g` tends to `Filter.atBot`. -/
theorem Filter.Tendsto.mul_atBot {C : 𝕜} (hC : 0 < C) (hf : Tendsto f l (𝓝 C))
    (hg : Tendsto g l atBot) : Tendsto (fun x => f x * g x) l atBot

{𝕜 : Type u_1}
{α : Type u_2}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{l : Filter α}
{f g : α → 𝕜}
{C : 𝕜}
(hC : 0 < C)
(hf : Filter.Tendsto f l (𝓝 C))
(hg : Filter.Tendsto g l Filter.atBot)

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


theorem length_sym {n : ℕ} {xs : List α} :
    (xs.sym n).length = Nat.multichoose xs.length n

(List.sym n xs).length = xs.length.multichoose n


theorem isLocalization_stalk' (y : PrimeSpectrum Γ(X, U)) (hy : hU.fromSpec.1.base y ∈ U) :
    @IsLocalization.AtPrime
      (R := Γ(X, U))
      (S := X.presheaf.stalk <| hU.fromSpec.1.base y) _ _
      ((TopCat.Presheaf.algebra_section_stalk X.presheaf _)) y.asIdeal _

(y : PrimeSpectrum ↑(X.presheaf.obj (Opposite.op U)))

IsLocalization.AtPrime (↑(X.presheaf.stalk (hU.fromSpec.val.base y))) y.asIdeal


/-- An algebra of sets is a family of sets containing the empty set and closed by complement and
union. Consequently it is also closed by difference (see `IsSetAlgebra.diff_mem`) and intersection
(see `IsSetAlgebra.inter_mem`). -/
structure IsSetAlgebra (𝒜 : Set (Set α)) : Prop where
  empty_mem : ∅ ∈ 𝒜
  compl_mem : ∀ ⦃s⦄, s ∈ 𝒜 → sᶜ ∈ 𝒜
  union_mem : ∀ ⦃s t⦄, s ∈ 𝒜 → t ∈ 𝒜 → s ∪ t ∈ 𝒜

{α : Type u_1}
{𝒜 : Set (Set α)}
(self : MeasureTheory.IsSetAlgebra 𝒜)
⦃s t : Set α⦄

s ∈ 𝒜 → t ∈ 𝒜 → s ∪ t ∈ 𝒜


theorem isIntegral_root' (hg : g.Monic) : IsIntegral R (root g)

{R : Type u}
[CommRing R]
{g : R[X]}
(hg : g.Monic)


/-- If `S` is the localization of the Jacobson ring `R` at the submonoid generated by `y : R`, then
`S` is Jacobson. -/
theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
(y : R)
[Algebra R S]
[IsLocalization.Away y S]
[H : Ideal.IsJacobson R]


theorem toPGame_lf {a b : Ordinal} (h : a < b) : a.toPGame ⧏ b.toPGame


theorem RePred.of_eq {α} [Primcodable α] {p q : α → Prop} (hp : RePred p) (H : ∀ a, p a ↔ q a) :
    RePred q

{α : Type u_1}
[Primcodable α]
{p q : α → Prop}
(hp : RePred p)
(H : ∀ (a : α), p a ↔ q a)


/-- Uniform convergence on a filter `p'` to a constant function is equivalent to convergence in
`p ×ˢ p'`. -/
theorem tendsto_prod_filter_iff {c : β} :
    Tendsto (↿F) (p ×ˢ p') (𝓝 c) ↔ TendstoUniformlyOnFilter F (fun _ => c) p p'

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{p : Filter ι}
{p' : Filter α}
{c : β}

Filter.Tendsto (↿F) (p ×ˢ p') (𝓝 c) ↔ TendstoUniformlyOnFilter F (fun x => c) p p'


theorem eq_of_isSt_real {r s : ℝ} : IsSt r s → r = s


@[simp] lemma forall_mem_not_eq' {s : Finset α} {a : α} : (∀ b ∈ s, ¬ b = a) ↔ a ∉ s


theorem eq_of_mem_singleton {x y : α} (h : x ∈ ({y} : Set α)) : x = y


/-- If a group exponent exists, the group is torsion. -/
@[to_additive ExponentExists.is_add_torsion
      "If a group exponent exists, the group is additively torsion."]
theorem ExponentExists.isTorsion (h : ExponentExists G) : IsTorsion G

{G : Type u_1}
[AddGroup G]
(h : AddMonoid.ExponentExists G)


/-- The spectrum, as a contravariant functor from commutative rings to topological spaces.
-/
@[simps! obj map]
def Spec.toTop : CommRingCat.{u}ᵒᵖ ⥤ TopCat

AlgebraicGeometry.Spec.toTop.obj R = AlgebraicGeometry.Spec.topObj (Opposite.unop R)


@[fun_prop]
theorem Differentiable.const_sub (hf : Differentiable 𝕜 f) (c : F) :
    Differentiable 𝕜 fun y => c - f y

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


theorem mem_posTangentConeAt_of_frequently_mem (h : ∃ᶠ t : ℝ in 𝓝[>] 0, x + t • y ∈ s) :
    y ∈ posTangentConeAt s x

(h : ∃ᶠ (t : ℝ) in 𝓝[>] 0, x + t • y ∈ s)


/-- The data of a monad on C consists of an endofunctor T together with natural transformations
η : 𝟭 C ⟶ T and μ : T ⋙ T ⟶ T satisfying three equations:
- T μ_X ≫ μ_X = μ_(TX) ≫ μ_X (associativity)
- η_(TX) ≫ μ_X = 1_X (left unit)
- Tη_X ≫ μ_X = 1_X (right unit)
-/
structure Monad extends C ⥤ C where
  /-- The unit for the monad. -/
  η : 𝟭 _ ⟶ toFunctor
  /-- The multiplication for the monad. -/
  μ : toFunctor ⋙ toFunctor ⟶ toFunctor
  assoc : ∀ X, toFunctor.map (NatTrans.app μ X) ≫ μ.app _ = μ.app _ ≫ μ.app _ := by aesop_cat
  left_unit : ∀ X : C, η.app (toFunctor.obj X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
  right_unit : ∀ X : C, toFunctor.map (η.app X) ≫ μ.app _ = 𝟙 _ := by aesop_cat

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

CategoryTheory.CategoryStruct.comp (self.map (self.μ.app X)) (self.μ.app X) =
  CategoryTheory.CategoryStruct.comp (self.μ.app (self.obj X)) (self.μ.app X)


theorem compl_ne_univ : sᶜ ≠ univ ↔ s.Nonempty


/-- Sections of `F ⋙ coyoneda.obj (op X)` identify to natural
transformations `(const J).obj X ⟶ F`. -/
@[simps]
def compCoyonedaSectionsEquiv (F : J ⥤ C) (X : C) :
    (F ⋙ coyoneda.obj (op X)).sections ≃ ((const J).obj X ⟶ F)

(s : ↑(F ⋙ CategoryTheory.coyoneda.obj (Opposite.op X)).sections)

((CategoryTheory.Limits.compCoyonedaSectionsEquiv F X) s).app j = ↑s j


/-- The Monge point of an (n+2)-simplex, minus the centroid of an
n-dimensional face, is orthogonal to the difference of the two
vertices not in that face. -/
theorem inner_mongePoint_vsub_face_centroid_vsub {n : ℕ} (s : Simplex ℝ P (n + 2))
    {i₁ i₂ : Fin (n + 3)} :
    ⟪s.mongePoint -ᵥ ({i₁, i₂}ᶜ : Finset (Fin (n + 3))).centroid ℝ s.points,
        s.points i₁ -ᵥ s.points i₂⟫ =
      0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P (n + 2))
{i₁ i₂ : Fin (n + 3)}

⟪s.mongePoint -ᵥ Finset.centroid ℝ {i₁, i₂}ᶜ s.points, s.points i₁ -ᵥ s.points i₂⟫_ℝ = 0


theorem Convex.linear_preimage {s : Set F} (hs : Convex 𝕜 s) (f : E →ₗ[𝕜] F) :
    Convex 𝕜 (f ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{s : Set F}
(hs : Convex 𝕜 s)
(f : E →ₗ[𝕜] F)


lemma withDensity_rnDeriv_of_subset_compl_mutuallySingularSetSlice
    [IsFiniteKernel κ] [IsFiniteKernel η] {a : α} {s : Set γ} (hsm : MeasurableSet s)
    (hs : s ⊆ (mutuallySingularSetSlice κ η a)ᶜ) :
    withDensity η (rnDeriv κ η) a s = κ a s

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

(hs : s ⊆ (κ.mutuallySingularSetSlice η a)ᶜ)

((η.withDensity (κ.rnDeriv η)) a) s = (κ a) s


@[simp] lemma mapₗ_eq_zero_iff (hf : Measurable f) : Measure.mapₗ f μ = 0 ↔ μ = 0

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{f : α → β}
(hf : Measurable f)

(MeasureTheory.Measure.mapₗ f) μ = 0 ↔ μ = 0


@[simp] lemma Lex.forall {p : Lex α → Prop} : (∀ a, p a) ↔ ∀ a, p (toLex a)

(∀ (a : Lex α), p a) ↔ ∀ (a : α), p (toLex a)


theorem ΓSpecIso_obj_hom {X : Scheme.{u}} (U : X.Opens) :
    (Scheme.ΓSpecIso Γ(X, U)).hom = (Spec.map U.topIso.inv).app ⊤ ≫
      (ΓSpec.adjunction.unit.app U).app ⊤ ≫ U.topIso.hom

{X : AlgebraicGeometry.Scheme}
(U : X.Opens)

(AlgebraicGeometry.Scheme.ΓSpecIso (X.presheaf.obj (Opposite.op U))).hom =
  CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.Scheme.Hom.app (AlgebraicGeometry.Spec.map U.topIso.inv) ⊤)
    (CategoryTheory.CategoryStruct.comp
      (AlgebraicGeometry.Scheme.Hom.app (AlgebraicGeometry.ΓSpec.adjunction.unit.app ↑U) ⊤) U.topIso.hom)


theorem symm_trans_rev (f : α ≃. β) (g : β ≃. γ) : (f.trans g).symm = g.symm.trans f.symm

{α : Type u}
{β : Type v}
{γ : Type w}
(f : α ≃. β)
(g : β ≃. γ)


theorem measurable_to_bool {f : α → Bool} (h : MeasurableSet (f ⁻¹' {true})) : Measurable f

{α : Type u_1}
[MeasurableSpace α]
{f : α → Bool}
(h : MeasurableSet (f ⁻¹' {true}))


theorem isClosedMap_toAdd : IsClosedMap (toAdd : Multiplicative X → X)


@[simp]
theorem rotate'_zero (l : List α) : l.rotate' 0 = l


theorem sub_one_pow_totient_lt_natAbs_cyclotomic_eval {n : ℕ} {q : ℕ} (hn' : 1 < n) (hq : q ≠ 1) :
    (q - 1) ^ totient n < ((cyclotomic n ℤ).eval ↑q).natAbs

(q - 1) ^ n.totient < (Polynomial.eval (↑q) (Polynomial.cyclotomic n ℤ)).natAbs


@[simp]
theorem symm_dual_id :
    CompleteLatticeHom.dual.symm (CompleteLatticeHom.id _) = CompleteLatticeHom.id α

CompleteLatticeHom.dual.symm (CompleteLatticeHom.id αᵒᵈ) = CompleteLatticeHom.id α


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


/-- If `s` is a dense set in a magma `M`, `Subsemigroup.closure s = ⊤`, then in order to prove that
some predicate `p` holds for all `x : M` it suffices to verify `p x` for `x ∈ s`,
and verify that `p x` and `p y` imply `p (x * y)`. -/
@[to_additive (attr := elab_as_elim) "If `s` is a dense set in an additive monoid `M`,
  `AddSubsemigroup.closure s = ⊤`, then in order to prove that some predicate `p` holds
  for all `x : M` it suffices to verify `p x` for `x ∈ s`, and verify that `p x` and `p y` imply
  `p (x + y)`."]
theorem dense_induction {p : M → Prop} (x : M) {s : Set M} (hs : closure s = ⊤)
    (mem : ∀ x ∈ s, p x)
    (mul : ∀ x y, p x → p y → p (x * y)) : p x

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


theorem bddBelow_image_norm (s : Set M) : BddBelow (norm '' s)

{M : Type u_1}
[SeminormedAddCommGroup M]
(s : Set M)


lemma wcovBy_eq_reflGen_covBy [PartialOrder α] : ((· : α) ⩿ ·) = ReflGen (· ⋖ ·)

(fun x x_1 => x ⩿ x_1) = Relation.ReflGen fun x x_1 => x ⋖ x_1


@[to_additive (attr := simp)]
theorem symm_inv {G} [MeasurableSpace G] [InvolutiveInv G] [MeasurableInv G] :
    (inv G).symm = inv G

{G : Type u_4}
[MeasurableSpace G]
[InvolutiveInv G]
[MeasurableInv G]

(MeasurableEquiv.inv G).symm = MeasurableEquiv.inv G


theorem convex_convexHull : Convex 𝕜 (convexHull 𝕜 s)

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


theorem contMDiffOn_fst {s : Set (M × N)} : ContMDiffOn (I.prod J) I n Prod.fst s

{𝕜 : 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]
{F : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
{s : Set (M × N)}


theorem mapRange.linearEquiv_trans (f : ∀ i, β i ≃ₗ[R] β₁ i) (f₂ : ∀ i, β₁ i ≃ₗ[R] β₂ i) :
    (mapRange.linearEquiv fun i => (f i).trans (f₂ i)) =
      (mapRange.linearEquiv f).trans (mapRange.linearEquiv f₂)

{ι : Type u_1}
{R : Type u_2}
[Semiring R]
{β : ι → Type u_6}
{β₁ : ι → Type u_7}
{β₂ : ι → Type u_8}
[(i : ι) → AddCommMonoid (β i)]
[(i : ι) → AddCommMonoid (β₁ i)]
[(i : ι) → AddCommMonoid (β₂ i)]
[(i : ι) → Module R (β i)]
[(i : ι) → Module R (β₁ i)]
[(i : ι) → Module R (β₂ i)]
(f : (i : ι) → β i ≃ₗ[R] β₁ i)
(f₂ : (i : ι) → β₁ i ≃ₗ[R] β₂ i)

(DFinsupp.mapRange.linearEquiv fun i => f i ≪≫ₗ f₂ i) =
  DFinsupp.mapRange.linearEquiv f ≪≫ₗ DFinsupp.mapRange.linearEquiv f₂


@[simp]
theorem eval₂_C_X : eval₂ C X p = p

Polynomial.eval₂ Polynomial.C Polynomial.X p = p


theorem perm_nodupKeys {l₁ l₂ : List (Sigma β)} (h : l₁ ~ l₂) : NodupKeys l₁ ↔ NodupKeys l₂

{α : Type u}
{β : α → Type v}
{l₁ l₂ : List (Sigma β)}
(h : l₁.Perm l₂)


theorem totalOn_range (s : Set α) : LinearMap.range (Finsupp.totalOn α M R v s) = ⊤

{α : Type u_1}
{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{v : α → M}
(s : Set α)


theorem Iio_add_bij : BijOn (· + a) (Iio b) (Iio (b + a))

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

Set.BijOn (fun x => x + a) (Set.Iio b) (Set.Iio (b + a))


@[to_additive]
theorem IsOpen.closure_div (ht : IsOpen t) (s : Set G) : closure s / t = s / t

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


theorem coe_toSubmodule_mk (p : Submodule R M) (h) :
    (({ p with lie_mem := h } : LieSubmodule R L M) : Submodule R M) = p

(h : ∀ {x : L} {m : M}, m ∈ p.carrier → ⁅x, m⁆ ∈ p.carrier)


theorem continuousWithinAt_prod_of_discrete_left [DiscreteTopology α]
    {f : α × β → γ} {s : Set (α × β)} {x : α × β} :
    ContinuousWithinAt f s x ↔ ContinuousWithinAt (f ⟨x.1, ·⟩) {b | (x.1, b) ∈ s} x.2

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[DiscreteTopology α]
{f : α × β → γ}
{s : Set (α × β)}
{x : α × β}

ContinuousWithinAt f s x ↔ ContinuousWithinAt (fun x_1 => f (x.1, x_1)) {b | (x.1, b) ∈ s} x.2


theorem singleton_infs_singleton : ({a} ⊼ {b} : Finset α) = {a ⊓ b}

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{a b : α}


@[simp]
theorem conjLIE_symm : conjLIE.symm = conjLIE


@[simp]
theorem sInf_toAddSubgroup (s : Set (Subring R)) :
    (sInf s).toAddSubgroup = ⨅ t ∈ s, Subring.toAddSubgroup t

{R : Type u}
[Ring R]
(s : Set (Subring R))

(sInf s).toAddSubgroup = ⨅ t ∈ s, t.toAddSubgroup


@[to_additive]
theorem mulIndicator_biUnion_finset_eventuallyEq {ι} [One β] (s : ι → Set α) (f : α → β) (a : α) :
    (fun n : Finset ι => mulIndicator (⋃ i ∈ n, s i) f a) =ᶠ[atTop]
      fun _ ↦ mulIndicator (iUnion s) f a

{α : Type u_1}
{β : Type u_2}
{ι : Type u_5}
[Zero β]
(s : ι → Set α)
(f : α → β)
(a : α)

(fun n => (⋃ i ∈ n, s i).indicator f a) =ᶠ[Filter.atTop] fun x => (Set.iUnion s).indicator f a


theorem lt_trichotomy (a b : α) : a < b ∨ a = b ∨ b < a


/-- The composition of `C^∞` functions within domains at points is `C^∞`. -/
nonrec theorem SmoothWithinAt.comp' {t : Set M'} {g : M' → M''} (x : M)
    (hg : SmoothWithinAt I' I'' g t (f x)) (hf : SmoothWithinAt I I' f s x) :
    SmoothWithinAt I I'' (g ∘ f) (s ∩ f ⁻¹' t) 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]
{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']
{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'']
{f : M → M'}
{s : Set M}
{t : Set M'}
{g : M' → M''}
(x : M)
(hg : SmoothWithinAt I' I'' g t (f x))
(hf : SmoothWithinAt I I' f s x)


theorem shift_shiftFunctorCompIsoId_inv_app (n m : A) (h : n + m = 0) (X : C) :
    ((shiftFunctorCompIsoId C n m h).inv.app X)⟦n⟧' =
    ((shiftFunctorCompIsoId C m n
      (by rw [← neg_eq_of_add_eq_zero_left h, add_right_neg])).inv.app (X⟦n⟧))

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddGroup A]
[CategoryTheory.HasShift C A]
(n m : A)
(h : n + m = 0)
(X : C)

(CategoryTheory.shiftFunctor C n).map ((CategoryTheory.shiftFunctorCompIsoId C n m h).inv.app X) =
  (CategoryTheory.shiftFunctorCompIsoId C m n ⋯).inv.app ((CategoryTheory.shiftFunctor C n).obj X)


theorem lookup_replicate {k : α} :
    (replicate n (a,b)).lookup k = if n = 0 then none else if k == a then some b else none

{α : Type u_2}
[BEq α]
[LawfulBEq α]
{n : Nat}
{a : α}

∀ {α_1 : Type u_1} {b : α_1} {k : α},
  List.lookup k (List.replicate n (a, b)) = if n = 0 then none else if (k == a) = true then some b else none


theorem lex_lt_of_lt_of_preorder [∀ i, Preorder (β i)] {r} (hwf : WellFounded r) {x y : ∀ i, β i}
    (hlt : x < y) : ∃ i, (∀ j, r j i → x j ≤ y j ∧ y j ≤ x j) ∧ x i < y i

{ι : Type u_1}
{β : ι → Type u_2}
[(i : ι) → Preorder (β i)]
{r : ι → ι → Prop}
(hwf : WellFounded r)
{x y : (i : ι) → β i}
(hlt : x < y)

∃ i, (∀ (j : ι), r j i → x j ≤ y j ∧ y j ≤ x j) ∧ x i < y i


theorem isCompl_range_coe_infty : IsCompl (range ((↑) : X → OnePoint X)) {∞}

IsCompl (Set.range OnePoint.some) {OnePoint.infty}


@[simp]
theorem nat_add_iff : LiouvilleWith p (n + x) ↔ LiouvilleWith p x

LiouvilleWith p (↑n + x) ↔ LiouvilleWith p x


@[simp]
theorem comap_fst : p.comap (fst R M M₂) = prod p ⊤

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(p : Submodule R M)

Submodule.comap (LinearMap.fst R M M₂) p = p.prod ⊤


theorem div_lt_div_iff (b0 : 0 < b) (d0 : 0 < d) : a / b < c / d ↔ a * d < c * b

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


lemma cast_card_inter [AddGroupWithOne R] :
    ((s ∩ t).card : R) = s.card + t.card - (s ∪ t).card

{α : Type u_1}
{R : Type u_3}
{s t : Finset α}
[DecidableEq α]
[AddGroupWithOne R]

↑(s ∩ t).card = ↑s.card + ↑t.card - ↑(s ∪ t).card


@[simp]
theorem addValuation.apply {x : ℚ_[p]} (hx : x ≠ 0) :
    Padic.addValuation x = (x.valuation : WithTop ℤ)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{x : ℚ_[p]}
(hx : x ≠ 0)


theorem ofReal_lt_coe_iff {a : ℝ} {b : ℝ≥0} (ha : 0 ≤ a) : ENNReal.ofReal a < b ↔ a < b


/--
In a `LocalRing R`, split any `Prop` over `R` into the three cases:
- *prime power* characteristic.
- equal characteristic zero.
- mixed characteristic `(0, p)`.
-/
theorem split_by_characteristic_localRing [LocalRing R]
    (h_pos : ∀ p : ℕ, IsPrimePow p → CharP R p → P) (h_equal : Algebra ℚ R → P)
    (h_mixed : ∀ p : ℕ, Nat.Prime p → MixedCharZero R p → P) : P

(h_pos : ∀ (p : ℕ), IsPrimePow p → CharP R p → P)

(h_mixed : ∀ (p : ℕ), Nat.Prime p → MixedCharZero R p → P)


@[to_additive]
theorem singleton_mul_singleton : ({a} : Set α) * {b} = {a * b}


@[to_additive]
theorem exponent_pos_of_exists (n : ℕ) (hpos : 0 < n) (hG : ∀ g : G, g ^ n = 1) :
    0 < exponent G

{G : Type u}
[Monoid G]
(n : ℕ)
(hpos : 0 < n)
(hG : ∀ (g : G), g ^ n = 1)


/-- Given two bundled monotone maps `f`, `g`, `f.prod g` is the map `x ↦ (f x, g x)` bundled as a
`OrderHom`. This is a fully bundled version. -/
@[simps!]
def prodₘ : (α →o β) →o (α →o γ) →o α →o β × γ

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

∀ (a : α →o γ) (x_1 : α), ((OrderHom.prodₘ x) a) x_1 = (x x_1, a x_1)


@[simp]
theorem sumDualDistrib_inl : sumDualDistrib α β (toDual (inl a)) = inl (toDual a)

{α : Type u_1}
{β : Type u_2}
[LE α]
[LE β]
(a : α)

(OrderIso.sumDualDistrib α β) (OrderDual.toDual (Sum.inl a)) = Sum.inl (OrderDual.toDual a)


lemma uniq (F₁ F₂ : Localization W ⥤ E) (h : Q W ⋙ F₁ = Q W ⋙ F₂) : F₁ = F₂

(F₁ F₂ : CategoryTheory.Functor (CategoryTheory.MorphismProperty.LeftFraction.Localization W) E)

(h :
  (CategoryTheory.MorphismProperty.LeftFraction.Localization.Q W).comp F₁ =
    (CategoryTheory.MorphismProperty.LeftFraction.Localization.Q W).comp F₂)


theorem mem_of_min {s : Finset α} : ∀ {a : α}, s.min = a → a ∈ s

{α : Type u_2}
[LinearOrder α]
{s : Finset α}
{a : α}


/-- The weighted degree of a nonzero weighted homogeneous polynomial is well-defined. -/
theorem inj_right {w : σ → M} (hφ : φ ≠ 0) (hm : IsWeightedHomogeneous w φ m)
    (hn : IsWeightedHomogeneous w φ n) : m = n

(hm : MvPolynomial.IsWeightedHomogeneous w φ m)

(hn : MvPolynomial.IsWeightedHomogeneous w φ n)


@[simp]
theorem eval_append_singleton (x : List α) (a : α) : M.eval (x ++ [a]) = M.stepSet (M.eval x) a

{α : Type u}
{σ : Type v}
(M : εNFA α σ)
(x : List α)
(a : α)


theorem sup_mem_sups : a ∈ s → b ∈ t → a ⊔ b ∈ s ⊻ t

{α : Type u_2}
[SemilatticeSup α]
{s t : Set α}
{a b : α}


@[simp]
theorem isPeriodicPt_prod_map (x : α × β) :
    IsPeriodicPt (Prod.map f g) n x ↔ IsPeriodicPt f n x.1 ∧ IsPeriodicPt g n x.2

{α : Type u_1}
{β : Type u_2}
{f : α → α}
{g : β → β}
{n : ℕ}
(x : α × β)

Function.IsPeriodicPt (Prod.map f g) n x ↔ Function.IsPeriodicPt f n x.1 ∧ Function.IsPeriodicPt g n x.2


theorem _root_.MeasurableEmbedding.memℒp_map_measure_iff {g : β → F} (hf : MeasurableEmbedding f) :
    Memℒp g p (Measure.map f μ) ↔ Memℒp (g ∘ f) p μ

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{β : Type u_5}
{mβ : MeasurableSpace β}
{f : α → β}
{g : β → F}
(hf : MeasurableEmbedding f)

MeasureTheory.Memℒp g p (MeasureTheory.Measure.map f μ) ↔ MeasureTheory.Memℒp (g ∘ f) p μ


@[simp]
theorem lift_ord (c) : Ordinal.lift.{u,v} (ord c) = ord (lift.{u,v} c)

Ordinal.lift.{u, v} c.ord = (Cardinal.lift.{u, v} c).ord


theorem upcrossingsBefore_lt_of_exists_upcrossing (hab : a < b) {N₁ N₂ : ℕ} (hN₁ : N ≤ N₁)
    (hN₁' : f N₁ ω < a) (hN₂ : N₁ ≤ N₂) (hN₂' : b < f N₂ ω) :
    upcrossingsBefore a b f N ω < upcrossingsBefore a b f (N₂ + 1) ω

{Ω : Type u_1}
{a b : ℝ}
{f : ℕ → Ω → ℝ}
{N : ℕ}
{ω : Ω}
(hab : a < b)
{N₁ N₂ : ℕ}
(hN₁ : N ≤ N₁)
(hN₁' : f N₁ ω < a)
(hN₂ : N₁ ≤ N₂)
(hN₂' : b < f N₂ ω)

MeasureTheory.upcrossingsBefore a b f N ω < MeasureTheory.upcrossingsBefore a b f (N₂ + 1) ω


/-- For finite `E`, finitely many matroids have ground set `E`. -/
theorem finite_setOf_matroid' {E : Set α} (hE : E.Finite) : {M : Matroid α | M.E = E}.Finite

{α : Type u_1}
{E : Set α}
(hE : E.Finite)


theorem iterate_pos_eq_iff_map_eq (h : Commute f g) (hf : Monotone f) (hg : StrictMono g) {x n}
    (hn : 0 < n) : f^[n] x = g^[n] x ↔ f x = g x

{α : Type u_1}
[LinearOrder α]
{f g : α → α}
(h : Function.Commute f g)
(hf : Monotone f)
(hg : StrictMono g)
{x : α}
{n : ℕ}
(hn : 0 < n)


@[simp]
theorem toIdeal_bot : (⊥ : HomogeneousIdeal 𝒜).toIdeal = (⊥ : Ideal A)

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


/-- If the `p ^ n`th cyclotomic polynomial is irreducible, so is the `p ^ m`th, for `m ≤ n`. -/
theorem cyclotomic_irreducible_pow_of_irreducible_pow {p : ℕ} (hp : Nat.Prime p) {R} [CommRing R]
    [IsDomain R] {n m : ℕ} (hmn : m ≤ n) (h : Irreducible (cyclotomic (p ^ n) R)) :
    Irreducible (cyclotomic (p ^ m) R)

(h : Irreducible (Polynomial.cyclotomic (p ^ n) R))

Irreducible (Polynomial.cyclotomic (p ^ m) R)


/-- If `f` is a smooth bump function and `s` closed subset of the support of `f` (i.e., of the open
ball of radius `f.rOut`), then there exists `0 < r < f.rOut` such that `s` is a subset of the open
ball of radius `r`. Formally, `s ⊆ e.source ∩ e ⁻¹' (ball (e c) r)`, where `e = extChartAt I c`. -/
theorem exists_r_pos_lt_subset_ball {s : Set M} (hsc : IsClosed s) (hs : s ⊆ support f) :
    ∃ r ∈ Ioo 0 f.rOut,
      s ⊆ (chartAt H c).source ∩ extChartAt I c ⁻¹' ball (extChartAt I c c) r

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)
{s : Set M}
(hsc : IsClosed s)
(hs : s ⊆ Function.support ↑f)

∃ r ∈ Set.Ioo 0 f.rOut, s ⊆ (chartAt H c).source ∩ ↑(extChartAt I c) ⁻¹' Metric.ball (↑(extChartAt I c) c) r


@[reassoc (attr := simp)]
theorem μ_inv_naturalityᵣ {m n n' : M} (g : n ⟶ n') (X : C) :
    (F.μIso m n).inv.app X ≫ (F.map g).app ((F.obj m).obj X) =
      (F.map (m ◁ g)).app X ≫ (F.μIso m n').inv.app X

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

CategoryTheory.CategoryStruct.comp ((F.μIso m n).inv.app X) ((F.map g).app ((F.obj m).obj X)) =
  CategoryTheory.CategoryStruct.comp ((F.map (CategoryTheory.MonoidalCategory.whiskerLeft m g)).app X)
    ((F.μIso m n').inv.app X)


@[simp]
theorem toFinsupp_inj {a b : R[X]} : a.toFinsupp = b.toFinsupp ↔ a = b


/-- One direction of `div_le_iff` where `c` is allowed to be `0` (but `b` must be nonnegative) -/
lemma mul_le_of_nonneg_of_le_div (hb : 0 ≤ b) (hc : 0 ≤ c) (h : a ≤ b / c) : a * c ≤ b

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


theorem sq_mul_squarefree_of_pos {n : ℕ} (hn : 0 < n) :
    ∃ a b : ℕ, 0 < a ∧ 0 < b ∧ b ^ 2 * a = n ∧ Squarefree a

∃ a b, 0 < a ∧ 0 < b ∧ b ^ 2 * a = n ∧ Squarefree a


/-- The composition of right homology map data. -/
@[simps]
def comp {φ : S₁ ⟶ S₂} {φ' : S₂ ⟶ S₃} {h₁ : S₁.RightHomologyData}
    {h₂ : S₂.RightHomologyData} {h₃ : S₃.RightHomologyData}
    (ψ : RightHomologyMapData φ h₁ h₂) (ψ' : RightHomologyMapData φ' h₂ h₃) :
    RightHomologyMapData (φ ≫ φ') h₁ h₃

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

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

(ψ' : CategoryTheory.ShortComplex.RightHomologyMapData φ' h₂ h₃)

(ψ.comp ψ').φH = CategoryTheory.CategoryStruct.comp ψ.φH ψ'.φH


/-- The `MonoidHom` from the preimage of a submonoid to itself. -/
@[to_additive (attr := simps)
      "the `AddMonoidHom` from the preimage of an additive submonoid to itself."]
def submonoidComap (f : M →* N) (N' : Submonoid N) :
    N'.comap f →* N'

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(f : M →+ N)
(N' : AddSubmonoid N)
(x : ↥(AddSubmonoid.comap f N'))


theorem differentiableAt_iff_restrictScalars (hf : DifferentiableAt 𝕜 f x) :
    DifferentiableAt 𝕜' f x ↔ ∃ g' : E →L[𝕜'] F, g'.restrictScalars 𝕜 = fderiv 𝕜 f x

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜 𝕜' E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{f : E → F}
{x : E}
(hf : DifferentiableAt 𝕜 f x)

DifferentiableAt 𝕜' f x ↔ ∃ g', ContinuousLinearMap.restrictScalars 𝕜 g' = fderiv 𝕜 f x


theorem mrange_eq_iSup {N} [Monoid N] (f : ∀ i, M i →* N) :
    MonoidHom.mrange (lift f) = ⨆ i, MonoidHom.mrange (f i)

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{N : Type u_4}
[Monoid N]
(f : (i : ι) → M i →* N)

MonoidHom.mrange (Monoid.CoprodI.lift f) = ⨆ i, MonoidHom.mrange (f i)


@[reassoc (attr := simp)]
lemma lift_snd {T X Y : C} (f : T ⟶ X) (g : T ⟶ Y) : lift f g ≫ snd _ _ = g

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.ChosenFiniteProducts.lift f g)
    (CategoryTheory.ChosenFiniteProducts.snd X Y) =
  g


@[simp]
theorem toNNReal_add {r p : ℝ} (hr : 0 ≤ r) (hp : 0 ≤ p) :
    Real.toNNReal (r + p) = Real.toNNReal r + Real.toNNReal p

(r + p).toNNReal = r.toNNReal + p.toNNReal


lemma IsNilpotent.smul [MonoidWithZero R] [MonoidWithZero S] [MulActionWithZero R S]
    [SMulCommClass R S S] [IsScalarTower R S S] {a : S} (ha : IsNilpotent a) (t : R) :
    IsNilpotent (t • a)

{R : Type u_1}
{S : Type u_2}
[MonoidWithZero R]
[MonoidWithZero S]
[MulActionWithZero R S]
[SMulCommClass R S S]
[IsScalarTower R S S]
{a : S}
(ha : IsNilpotent a)
(t : R)


theorem le_of_eqLocus_ge {f g : E →ₗ.[R] F} (H : f.domain ≤ f.eqLocus g) : f ≤ g

{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 g : E →ₗ.[R] F}
(H : f.domain ≤ f.eqLocus g)


theorem lookup_eq_none {a} {s : Finmap β} : lookup a s = none ↔ a ∉ s

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{s : Finmap β}


@[to_additive]
theorem smul_inter_subset : s • (t₁ ∩ t₂) ⊆ s • t₁ ∩ s • t₂

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{s : Finset α}
{t₁ t₂ : Finset β}


theorem SurjOn.cancel_right (hf : s.SurjOn f t) (hf' : s.MapsTo f t) :
    s.EqOn (g₁ ∘ f) (g₂ ∘ f) ↔ t.EqOn g₁ g₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
{t : Set β}
{f : α → β}
{g₁ g₂ : β → γ}
(hf : Set.SurjOn f s t)
(hf' : Set.MapsTo f s t)

Set.EqOn (g₁ ∘ f) (g₂ ∘ f) s ↔ Set.EqOn g₁ g₂ t


/-- The cosine of the oriented angle between two nonzero vectors equals that of the unoriented
angle. -/
theorem cos_oangle_eq_cos_angle {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    Real.Angle.cos (o.oangle x y) = Real.cos (InnerProductGeometry.angle x y)

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

(o.oangle x y).cos = Real.cos (InnerProductGeometry.angle x y)


/-- Arithmetic progressions of length three are preserved under `2`-Freiman isomorphisms. -/
@[to_additive
"Arithmetic progressions of length three are preserved under `2`-Freiman isomorphisms."]
lemma threeGPFree_image (hf : IsMulFreimanIso 2 s t f) (hAs : A ⊆ s) :
    ThreeGPFree (f '' A) ↔ ThreeGPFree A

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{s A : Set α}
{t : Set β}
{f : α → β}
(hf : IsAddFreimanIso 2 s t f)
(hAs : A ⊆ s)


@[simp] lemma dens_empty : dens (∅ : Finset α) = 0


@[to_additive]
theorem mem_normalizer_iff' {g : G} : g ∈ H.normalizer ↔ ∀ n, n * g ∈ H ↔ g * n ∈ H

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
{g : G}

g ∈ H.normalizer ↔ ∀ (n : G), n + g ∈ H ↔ g + n ∈ H


@[to_additive (attr := simp) add_mem_addCentralizer]
lemma mul_mem_centralizer (ha : a ∈ centralizer S) (hb : b ∈ centralizer S) :
    a * b ∈ centralizer S

{M : Type u_1}
{S : Set M}
[AddSemigroup M]
{a b : M}
(ha : a ∈ S.addCentralizer)
(hb : b ∈ S.addCentralizer)


theorem Valid'.rotateL_lemma₂ {a b c : ℕ} (H3 : 2 * (b + c) ≤ 9 * a + 3) (h : b < 2 * c) :
    b < 3 * a + 1


@[to_additive (attr := simp)]
theorem mem_mulAntidiagonal : x ∈ mulAntidiagonal s t a ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ x.1 * x.2 = a

{α : Type u_1}
[Add α]
{s t : Set α}
{a : α}
{x : α × α}

x ∈ s.addAntidiagonal t a ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ x.1 + x.2 = a


/-- If a product of a `Finset` of a subsingleton type has a given
value, so do the terms in that product. -/
@[to_additive "If a sum of a `Finset` of a subsingleton type has a given
  value, so do the terms in that sum."]
theorem eq_of_subsingleton_of_prod_eq {ι : Type*} [Subsingleton ι] {s : Finset ι} {f : ι → M}
    {b : M} (h : ∏ i ∈ s, f i = b) : ∀ i ∈ s, f i = b

{M : Type u_4}
[AddCommMonoid M]
{ι : Type u_5}
[Subsingleton ι]
{s : Finset ι}
{f : ι → M}
{b : M}
(h : ∑ i ∈ s, f i = b)
(i : ι)


/-- A biproduct over an index type with exactly one term is just the object over that term. -/
@[simps!]
def biproductUniqueIso : ⨁ f ≅ f default

(CategoryTheory.Limits.biproductUniqueIso f).inv =
  CategoryTheory.Limits.biproduct.lift (CategoryTheory.Limits.limitBiconeOfUnique f).bicone.π


theorem log_mul [DecidableEq M] {n : M} (h : Function.Injective fun m : ℕ => n ^ m)
    (x y : powers (n : M)) : log (x * y) = log x + log y

{M : Type u_1}
[Monoid M]
[DecidableEq M]
{n : M}
(h : Function.Injective fun m => n ^ m)
(x y : ↥(Submonoid.powers n))

Submonoid.log (x * y) = Submonoid.log x + Submonoid.log y


/-- An adjunction `adj : G ⊣ F` with `F : D ⥤ E` and `G : E ⥤ D` induces an adjunction
between `Sheaf J D` and `Sheaf J E`, in contexts where one can sheafify `D`-valued presheaves,
and `F` preserves the correct limits. -/
@[simps! unit_app_val counit_app_val]
def adjunction [HasSheafCompose J F] (adj : G ⊣ F) :
    composeAndSheafify J G ⊣ sheafCompose J F

(J : CategoryTheory.GrothendieckTopology C)

((CategoryTheory.Sheaf.adjunction J adj).counit.app Y).val =
  CategoryTheory.sheafifyLift J
    (((CategoryTheory.Adjunction.whiskerRight Cᵒᵖ adj).homEquiv (Y.val.comp F) Y.val).symm
      (CategoryTheory.CategoryStruct.id (Y.val.comp F)))
    ⋯