/-- Universal property from localized module:
If `(M', f : M ⟶ M')` is a localized module then it satisfies the following universal property:
For every `R`-module `M''` which every `s : S`-scalar multiplication is invertible and for every
`R`-linear map `g : M ⟶ M''`, there is a unique `R`-linear map `l : M' ⟶ M''` such that
`l ∘ f = g`.
```
M -----f----> M'
|           /
|g       /
|     /   l
v   /
M''
```
-/
theorem is_universal :
    ∀ (g : M →ₗ[R] M'') (_ : ∀ x : S, IsUnit ((algebraMap R (Module.End R M'')) x)),
      ∃! l : M' →ₗ[R] M'', l.comp f = g

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

(∀ (x : ↥S), IsUnit ((algebraMap R (Module.End R M'')) ↑x)) → ∃! l, l ∘ₗ f = g


@[to_additive]
theorem HasProd.hasProd_compl_iff {s : Set β} (hf : HasProd (f ∘ (↑) : s → α) a₁) :
    HasProd (f ∘ (↑) : ↑sᶜ → α) a₂ ↔ HasProd f (a₁ * a₂)

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
{f : β → α}
{a₁ a₂ : α}
{s : Set β}
(hf : HasSum (f ∘ Subtype.val) a₁)

HasSum (f ∘ Subtype.val) a₂ ↔ HasSum f (a₁ + a₂)


theorem volume_preserving_pi_empty {ι : Type u} (α : ι → Type v) [Fintype ι] [IsEmpty ι]
    [∀ i, MeasureSpace (α i)] :
    MeasurePreserving (MeasurableEquiv.ofUniqueOfUnique (∀ i, α i) Unit) volume volume

[(i : ι) → MeasureTheory.MeasureSpace (α i)]

MeasureTheory.MeasurePreserving (⇑(MeasurableEquiv.ofUniqueOfUnique ((i : ι) → α i) Unit)) MeasureTheory.volume
  MeasureTheory.volume


theorem dom_iff_mem : ∀ {o : Part α}, o.Dom ↔ ∃ y, y ∈ o


@[simp]
theorem isBigOWith_bot : IsBigOWith c ⊥ f g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
(c : ℝ)
(f : α → E)
(g : α → F)


@[to_additive (attr := simp)]
theorem infinite_smul_set : (a • s).Infinite ↔ s.Infinite

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


theorem dvd_bmod_dot_sub_dot_bmod (m : Nat) (xs ys : Coeffs) :
    (m : Int) ∣ bmod_dot_sub_dot_bmod m xs ys

↑m ∣ Lean.Omega.Coeffs.bmod_dot_sub_dot_bmod m xs ys


{α : Type u_1}
[LT α]
{a b : α}
(h : a ⋖ b)


theorem eq_get_iff_mem {o : Part α} {a : α} (h : o.Dom) : a = o.get h ↔ a ∈ o

{α : Type u_1}
{o : Part α}
{a : α}
(h : o.Dom)


/-- `s.subtype p` converts back to `s.filter p` with
`Embedding.subtype`. -/
@[simp]
theorem subtype_map (p : α → Prop) [DecidablePred p] {s : Finset α} :
    (s.subtype p).map (Embedding.subtype _) = s.filter p

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

Finset.map (Function.Embedding.subtype p) (Finset.subtype p s) = Finset.filter p s


theorem finite_def {R M} [Semiring R] [AddCommMonoid M] [Module R M] :
    Finite R M ↔ (⊤ : Submodule R M).FG

{R : Type u_6}
{M : Type u_7}
[Semiring R]
[AddCommMonoid M]
[Module R M]


@[simp] lemma op_neg [Neg α] (x : α) : op (-x) = -op x


/-- `SemilinearIsometryEquivClass F σ E E₂` asserts `F` is a type of bundled `σ`-semilinear
isometric equivs `E → E₂`.

See also `LinearIsometryEquivClass F R E E₂` for the case where `σ` is the identity map on `R`.

A map `f` between an `R`-module and an `S`-module over a ring homomorphism `σ : R →+* S`
is semilinear if it satisfies the two properties `f (x + y) = f x + f y` and
`f (c • x) = (σ c) • f x`. -/
class SemilinearIsometryEquivClass (𝓕 : Type*) {R R₂ : outParam Type*} [Semiring R]
  [Semiring R₂] (σ₁₂ : outParam <| R →+* R₂) {σ₂₁ : outParam <| R₂ →+* R} [RingHomInvPair σ₁₂ σ₂₁]
  [RingHomInvPair σ₂₁ σ₁₂] (E E₂ : outParam Type*) [SeminormedAddCommGroup E]
  [SeminormedAddCommGroup E₂] [Module R E] [Module R₂ E₂] [EquivLike 𝓕 E E₂]
  extends SemilinearEquivClass 𝓕 σ₁₂ E E₂ : Prop where
  norm_map : ∀ (f : 𝓕) (x : E), ‖f x‖ = ‖x‖

[self : SemilinearIsometryEquivClass 𝓕 σ₁₂ E E₂]


theorem card_disjSups_le : (s ○ t).card ≤ s.card * t.card

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


@[simp] theorem getLsb_shiftLeftZeroExtend (x : BitVec m) (n : Nat) :
    getLsb (shiftLeftZeroExtend x n) i = ((! decide (i < n)) && getLsb x (i - n))

(x.shiftLeftZeroExtend n).getLsb i = (!decide (i < n) && x.getLsb (i - n))


/-- If `g` tends to some `𝓝 x` along `f`, then it tends to `𝓝 (Filter.limUnder f g)`. We formulate
this lemma with a `[Nonempty X]` argument of `lim` derived from `h` to make it useful for types
without a `[Nonempty X]` instance. Because of the built-in proof irrelevance, Lean will unify this
instance with any other instance. -/
theorem tendsto_nhds_limUnder {f : Filter α} {g : α → X} (h : ∃ x, Tendsto g f (𝓝 x)) :
    Tendsto g f (𝓝 (@limUnder _ _ _ (nonempty_of_exists h) f g))

{X : Type u}
{α : Type u_1}
[TopologicalSpace X]
{f : Filter α}
{g : α → X}
(h : ∃ x, Filter.Tendsto g f (𝓝 x))


/-- A non-constant polynomial has non-zero separable degree. -/
theorem natSepDegree_ne_zero (h : f.natDegree ≠ 0) : f.natSepDegree ≠ 0

{F : Type u}
[Field F]
(f : F[X])
(h : f.natDegree ≠ 0)


/-- When `i = j`, projections `Pi.eval C i` and `Pi.eval C j` are related by the equivalence
`Pi.eqToEquivalence C h : C i ≌ C j`. -/
@[simps!]
def Pi.evalCompEqToEquivalenceFunctor {i j : I} (h : i = j) :
    Pi.eval C i ⋙ (Pi.eqToEquivalence C h).functor ≅
      Pi.eval C j

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

(CategoryTheory.Pi.evalCompEqToEquivalenceFunctor C h).hom = CategoryTheory.eqToHom ⋯


@[simp] theorem one_le_encard_iff_nonempty : 1 ≤ s.encard ↔ s.Nonempty


@[to_additive]
theorem mk'_eq_iff_eq_mul {x} {y : S} {z} : f.mk' x y = z ↔ f.toMap x = z * f.toMap y

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

f.mk' x y = z ↔ f.toMap x = z + f.toMap ↑y


@[simp]
theorem withBotCongr_refl : (OrderIso.refl α).withBotCongr = OrderIso.refl _

(OrderIso.refl α).withBotCongr = OrderIso.refl (WithBot α)


@[measurability, fun_prop]
lemma measurable_log : Measurable log


protected lemma iIndepFun.iIndep {m : ∀ i, MeasurableSpace (κ i)} {f : ∀ x : ι, Ω → κ x}
    (hf : iIndepFun m f μ) :
    iIndep (fun x ↦ (m x).comap (f x)) μ

{Ω : Type u_1}
{ι : Type u_2}
{κ : ι → Type u_5}

∀ {x : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} {m : (i : ι) → MeasurableSpace (κ i)} {f : (x : ι) → Ω → κ x},
  ProbabilityTheory.iIndepFun m f μ → ProbabilityTheory.iIndep (fun x => MeasurableSpace.comap (f x) (m x)) μ


theorem IsPathConnected.mem_pathComponent (h : IsPathConnected F) (x_in : x ∈ F) (y_in : y ∈ F) :
    y ∈ pathComponent x

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{F : Set X}
(h : IsPathConnected F)
(x_in : x ∈ F)
(y_in : y ∈ F)


/-- The **Cayley-Hamilton Theorem**, that the characteristic polynomial of a linear map, applied
to the linear map itself, is zero.

See `Matrix.aeval_self_charpoly` for the equivalent statement about matrices. -/
theorem aeval_self_charpoly : aeval f f.charpoly = 0

{R : Type u}
{M : Type v}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
(f : M →ₗ[R] M)


@[to_additive (attr := simp)]
lemma stabilizer_coe_finset (s : Finset α) : stabilizer G (s : Set α) = stabilizer G s

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]
[DecidableEq α]
(s : Finset α)

AddAction.stabilizer G ↑s = AddAction.stabilizer G s


@[simp] lemma findGreatest_zero : Nat.findGreatest P 0 = 0


theorem nonnegg_cases_right {c d} {a : ℕ} :
    ∀ {b : ℤ}, (∀ x : ℕ, b = -x → SqLe x c a d) → Nonnegg c d a b

(∀ (x : ℕ), b = -↑x → Zsqrtd.SqLe x c a d) → Zsqrtd.Nonnegg c d (↑a) b


/-- A mono factorisation of `f ≫ g`, where `g` is an isomorphism,
gives a mono factorisation of `f`. -/
@[simps]
def ofCompIso {Y' : C} {g : Y ⟶ Y'} [IsIso g] (F : MonoFactorisation (f ≫ g)) :
    MonoFactorisation f

(F : CategoryTheory.Limits.MonoFactorisation (f ≫ g))

F.ofCompIso.m = F.m ≫ CategoryTheory.inv g


/-- `nsmul` is equal to any other module structure via a cast. -/
lemma Nat.cast_smul_eq_nsmul (n : ℕ) (b : M) : (n : R) • b = n • b

(R : Type u_2)
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(n : ℕ)
(b : M)


lemma isLowerSet_of_isClosed : IsClosed s → IsLowerSet s

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsScott α]
{s : Set α}


theorem mem_prodLift {f : α →. β} {g : α →. γ} {x : α} {y : β × γ} :
    y ∈ f.prodLift g x ↔ y.1 ∈ f x ∧ y.2 ∈ g x

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α →. β}
{g : α →. γ}
{x : α}
{y : β × γ}


theorem Odd.neg_one_zpow (h : Odd n) : (-1 : α) ^ n = -1

{α : Type u_1}
[DivisionRing α]
{n : ℤ}
(h : Odd n)


@[to_additive zsmul_zero, simp]
lemma one_zpow : ∀ n : ℤ, (1 : α) ^ n = 1

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


/-- The functor `CostructuredArrow S T ⥤ CostructuredArrow U V` that is deduced from
a natural transformation `F ⋙ U ⟶ S ⋙ G` and a morphism `G.obj T ⟶ V` -/
@[simps!]
def map₂ : CostructuredArrow S T ⥤ CostructuredArrow U V

{X Y : CategoryTheory.Comma S (CategoryTheory.Functor.fromPUnit T)}

((CategoryTheory.CostructuredArrow.map₂ α β).map φ).right = CategoryTheory.CategoryStruct.id X.right


@[simp]
theorem fstIdx_cons {i} (m : M i) (w : Word M) (hmw : w.fstIdx ≠ some i) (h1 : m ≠ 1) :
    fstIdx (cons m w hmw h1) = some i

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{i : ι}
(m : M i)
(w : Monoid.CoprodI.Word M)
(hmw : w.fstIdx ≠ some i)
(h1 : m ≠ 1)

(Monoid.CoprodI.Word.cons m w hmw h1).fstIdx = some i


@[simp]
theorem NormedAddGroupHom.extension_coe (f : NormedAddGroupHom G H) (v : G) : f.extension v = f v

{G : Type u_1}
[SeminormedAddCommGroup G]
{H : Type u_2}
[SeminormedAddCommGroup H]
[T0Space H]
[CompleteSpace H]
(f : NormedAddGroupHom G H)
(v : G)


@[simp]
theorem realize_equivSentence_symm_con [L[[α]].Structure M]
    [(L.lhomWithConstants α).IsExpansionOn M] (φ : L[[α]].Sentence) :
    ((equivSentence.symm φ).Realize fun a => (L.con a : M)) ↔ φ.Realize M

((FirstOrder.Language.Formula.equivSentence.symm φ).Realize fun a => ↑(L.con a)) ↔ M ⊨ φ


lemma UniformConcaveOn.strictConcaveOn (hf : UniformConcaveOn s φ f) (hφ : ∀ r, r ≠ 0 → 0 < φ r) :
    StrictConcaveOn ℝ s f

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{φ : ℝ → ℝ}
{s : Set E}
{f : E → ℝ}
(hf : UniformConcaveOn s φ f)
(hφ : ∀ (r : ℝ), r ≠ 0 → 0 < φ r)


@[simp] lemma precompL_apply (L : E →L[𝕜] Fₗ →L[𝕜] Gₗ) (u : Eₗ →L[𝕜] E) (f : Fₗ) (g : Eₗ) :
    precompL Eₗ L u f g = L (u g) f

{𝕜 : Type u_1}
{E : Type u_4}
(Eₗ : Type u_5)
{Fₗ : Type u_7}
{Gₗ : Type u_9}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup Eₗ]
[SeminormedAddCommGroup Fₗ]
[SeminormedAddCommGroup Gₗ]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 Eₗ]
[NormedSpace 𝕜 Fₗ]
[NormedSpace 𝕜 Gₗ]
(L : E →L[𝕜] Fₗ →L[𝕜] Gₗ)
(u : Eₗ →L[𝕜] E)
(f : Fₗ)
(g : Eₗ)

(((ContinuousLinearMap.precompL Eₗ L) u) f) g = (L (u g)) f


@[simp]
lemma variableChange_c₆ : (W.variableChange C).c₆ = C.u⁻¹ ^ 6 * W.c₆

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(C : WeierstrassCurve.VariableChange R)

(W.variableChange C).c₆ = ↑C.u⁻¹ ^ 6 * W.c₆


theorem isCoseparator_prod_of_isCoseparator_right (G H : C) [HasBinaryProduct G H]
    (hH : IsCoseparator H) : IsCoseparator (G ⨯ H)


theorem derivWithin_pi (h : ∀ i, DifferentiableWithinAt 𝕜 (fun x => φ x i) s x)
    (hs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin φ s x = fun i => derivWithin (fun x => φ x i) s x

(h : ∀ (i : ι), DifferentiableWithinAt 𝕜 (fun x => φ x i) s x)


/-- This is "unbundled", because that is required for the API of `inducedOuterMeasure`. -/
theorem innerContent_mono ⦃U V : Set G⦄ (hU : IsOpen U) (hV : IsOpen V) (h2 : U ⊆ V) :
    μ.innerContent ⟨U, hU⟩ ≤ μ.innerContent ⟨V, hV⟩

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
⦃U V : Set G⦄
(hU : IsOpen U)
(hV : IsOpen V)
(h2 : U ⊆ V)

μ.innerContent { carrier := U, is_open' := hU } ≤ μ.innerContent { carrier := V, is_open' := hV }


@[simp]
lemma weightSpaceChain_neg :
    weightSpaceChain M (-χ₁) χ₂ (-q) (-p) = weightSpaceChain M χ₁ χ₂ p q

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(M : Type u_3)
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
(χ₁ χ₂ : L → R)
(p q : ℤ)

LieModule.weightSpaceChain M (-χ₁) χ₂ (-q) (-p) = LieModule.weightSpaceChain M χ₁ χ₂ p q


@[to_additive]
theorem smul_set_iUnion (a : α) (s : ι → Set β) : (a • ⋃ i, s i) = ⋃ i, a • s i

{α : Type u_2}
{β : Type u_3}
{ι : Sort u_5}
[SMul α β]
(a : α)
(s : ι → Set β)


theorem commutatorSet_def : commutatorSet G = { g | ∃ g₁ g₂ : G, ⁅g₁, g₂⁆ = g }

commutatorSet G = {g | ∃ g₁ g₂, ⁅g₁, g₂⁆ = g}


theorem ContDiffOn.cos {n} (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun x => Real.cos (f x)) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffOn ℝ n f s)


lemma lintegral_le_edist_mul (f : X →ᵇ ℝ≥0) (μ : Measure X) :
    (∫⁻ x, f x ∂μ) ≤ edist 0 f * (μ Set.univ)

{X : Type u_1}
[MeasurableSpace X]
[TopologicalSpace X]
(f : X →ᵇ ℝ≥0)
(μ : MeasureTheory.Measure X)

∫⁻ (x : X), ↑(f x) ∂μ ≤ edist 0 f * μ Set.univ


@[to_additive (attr := simp 1001)]
-- Porting note: increase priority so that the left-hand side doesn't simplify
theorem preimage_mul_ball (a b : E) (r : ℝ) : (b * ·) ⁻¹' ball a r = ball (a / b) r

{E : Type u_6}
[SeminormedCommGroup E]
(a b : E)
(r : ℝ)

(fun x => b * x) ⁻¹' Metric.ball a r = Metric.ball (a / b) r


/-- If `f x = O(g x)` along `cofinite`, then there exists a positive constant `C` such that
`‖f x‖ ≤ C * ‖g x‖` whenever `g x ≠ 0`. -/
theorem bound_of_isBigO_cofinite (h : f =O[cofinite] g'') :
    ∃ C > 0, ∀ ⦃x⦄, g'' x ≠ 0 → ‖f x‖ ≤ C * ‖g'' x‖

{α : Type u_1}
{E : Type u_3}
{F'' : Type u_10}
[Norm E]
[NormedAddCommGroup F'']
{f : α → E}
{g'' : α → F''}
(h : f =O[Filter.cofinite] g'')

∃ C > 0, ∀ ⦃x : α⦄, g'' x ≠ 0 → ‖f x‖ ≤ C * ‖g'' x‖


/-- The canonical morphism `A →ₐ[R₁] I.quotient` is surjective. -/
theorem Quotient.mkₐ_surjective (I : Ideal A) : Function.Surjective (Quotient.mkₐ R₁ I)

(R₁ : Type u_1)
{A : Type u_3}
[CommSemiring R₁]
[CommRing A]
[Algebra R₁ A]
(I : Ideal A)

Function.Surjective ⇑(Ideal.Quotient.mkₐ R₁ I)


/-- A morphism `f` is an epimorphism if it can be cancelled when precomposed:
`f ≫ g = f ≫ h` implies `g = h`.

See <https://stacks.math.columbia.edu/tag/003B>.
-/
class Epi (f : X ⟶ Y) : Prop where
  /-- A morphism `f` is an epimorphism if it can be cancelled when precomposed. -/
  left_cancellation : ∀ {Z : C} (g h : Y ⟶ Z), f ≫ g = f ≫ h → g = h

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

CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.comp f h → g = h


theorem derivedSeries_eq_derivedSeriesOfIdeal_map (k : ℕ) :
    (derivedSeries R I k).map I.incl = derivedSeriesOfIdeal R L k I

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)
(k : ℕ)

LieIdeal.map I.incl (LieAlgebra.derivedSeries R (↥↑I) k) = LieAlgebra.derivedSeriesOfIdeal R L k I


@[simp, norm_cast]
theorem add_coe (m n : ℕ+) : ((m + n : ℕ+) : ℕ) = m + n


theorem Inducing.inseparable_iff (hf : Inducing f) : (f x ~ᵢ f y) ↔ (x ~ᵢ y)

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


@[simp] lemma val_zero : (0 : P.Cotangent).val = 0

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}


/-- If being a sheaf for `J₁` is equivalent to being a sheaf for `J₂`, then `J₁ = J₂`. -/
theorem topology_eq_iff_same_sheaves {J₁ J₂ : GrothendieckTopology C} :
    J₁ = J₂ ↔ ∀ P : Cᵒᵖ ⥤ Type max v u, Presieve.IsSheaf J₁ P ↔ Presieve.IsSheaf J₂ P

{J₁ J₂ : CategoryTheory.GrothendieckTopology C}

J₁ = J₂ ↔
  ∀ (P : CategoryTheory.Functor Cᵒᵖ (Type (max v u))),
    CategoryTheory.Presieve.IsSheaf J₁ P ↔ CategoryTheory.Presieve.IsSheaf J₂ P


@[to_additive (attr := simp)]
theorem op_bot : (⊥ : Subgroup G).op = ⊥


theorem disjSum_mono (hs : s₁ ⊆ s₂) (ht : t₁ ⊆ t₂) : s₁.disjSum t₁ ⊆ s₂.disjSum t₂

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Finset α}
{t₁ t₂ : Finset β}
(hs : s₁ ⊆ s₂)
(ht : t₁ ⊆ t₂)


theorem isPiSystem_image_Ioi (s : Set α) : IsPiSystem (Ioi '' s)

{α : Type u_1}
[LinearOrder α]
(s : Set α)


@[ext]
theorem OverMorphism.ext {X : T} {U V : Over X} {f g : U ⟶ V} (h : f.left = g.left) : f = g

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
{U V : CategoryTheory.Over X}
{f g : U ⟶ V}
(h : f.left = g.left)


@[simp] lemma angle_mul_right (ha : a ≠ 0) (x y : ℂ) : angle (x * a) (y * a) = angle x y

InnerProductGeometry.angle (x * a) (y * a) = InnerProductGeometry.angle x y


@[simp]
theorem congr_symm_apply (f : M ≃ₗ[R] N) (x : AdicCompletion I N) :
    (congr I f).symm x = map I f.symm x

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

(AdicCompletion.congr I f).symm x = (AdicCompletion.map I ↑f.symm) x


protected theorem neg_pos_of_neg {a : Int} (h : a < 0) : 0 < -a


@[simp]
theorem le_pure_iff {f : Filter α} {a : α} : f ≤ pure a ↔ {a} ∈ f


/-- A bounded variation function into `ℝ` is differentiable almost everywhere. Superseded by
`ae_differentiableWithinAt_of_mem`. -/
theorem ae_differentiableWithinAt_of_mem_real {f : ℝ → ℝ} {s : Set ℝ}
    (h : LocallyBoundedVariationOn f s) : ∀ᵐ x, x ∈ s → DifferentiableWithinAt ℝ f s x

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


@[simp]
lemma Cotangent.val_smul' (r : P.Ring) (x : P.Cotangent) : (r • x).val = r • x.val

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
(r : P.Ring)
(x : P.Cotangent)


@[to_additive]
lemma prod_eq_pow_single [DecidableEq M] (a : M) (h : ∀ a', a' ≠ a → a' ∈ l → a' = 1) :
    l.prod = a ^ l.count a

(h : ∀ (a' : M), a' ≠ a → a' ∈ l → a' = 0)


@[simp]
theorem Icc_eq_empty_iff : Icc a b = ∅ ↔ ¬a ≤ b

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


/-- Reformulation of `equicontinuousAt_iff_pair` for families of functions taking values in a
(pseudo) metric space. -/
protected theorem equicontinuousAt_iff_pair {ι : Type*} [TopologicalSpace β] {F : ι → β → α}
    {x₀ : β} :
    EquicontinuousAt F x₀ ↔
      ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ i, dist (F i x) (F i x') < ε

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
{ι : Type u_4}
[TopologicalSpace β]
{F : ι → β → α}
{x₀ : β}

EquicontinuousAt F x₀ ↔ ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ (i : ι), dist (F i x) (F i x') < ε


/-- The canonical isomorphism of triangles
`binaryProductTriangle X₁ X₂ ≅ binaryBiproductTriangle X₁ X₂`. -/
@[simps!]
def binaryProductTriangleIsoBinaryBiproductTriangle
    (X₁ X₂ : C) [HasZeroMorphisms C] [HasBinaryBiproduct X₁ X₂] :
    binaryProductTriangle X₁ X₂ ≅ binaryBiproductTriangle X₁ X₂

(CategoryTheory.Pretriangulated.binaryProductTriangleIsoBinaryBiproductTriangle X₁ X₂).hom.hom₂ =
  CategoryTheory.Limits.biprod.lift CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.snd


protected theorem continuous' {g : X → Y} (hf : LocallyFinite f) (h_cov : ⋃ i, f i = univ)
    (hc : ∀ i x, x ∈ closure (f i) → ContinuousWithinAt g (f i) x) :
    Continuous g

(hc : ∀ (i : ι), ∀ x ∈ closure (f i), ContinuousWithinAt g (f i) x)


@[to_additive]
theorem HasProd.le_one (h : ∀ i, g i ≤ 1) (ha : HasProd g a) : a ≤ 1

{ι : Type u_1}
{α : Type u_3}
[OrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{g : ι → α}
{a : α}
(h : ∀ (i : ι), g i ≤ 1)
(ha : HasProd g a)


theorem lt_sSup_iff : b < sSup s ↔ ∃ a ∈ s, b < a

{α : Type u_1}
[CompleteLinearOrder α]
{s : Set α}
{b : α}


theorem iterate_eq_iterate_iff_of_lt_minimalPeriod {m n : ℕ} (hm : m < minimalPeriod f x)
    (hn : n < minimalPeriod f x) : f^[m] x = f^[n] x ↔ m = n

{α : Type u_1}
{f : α → α}
{x : α}
{m n : ℕ}
(hm : m < Function.minimalPeriod f x)
(hn : n < Function.minimalPeriod f x)


@[simp] lemma inter_eq_left : s ∩ t = s ↔ s ⊆ t

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


theorem IsQuasiSeparated.of_subset {s t : Set α} (ht : IsQuasiSeparated t) (h : s ⊆ t) :
    IsQuasiSeparated s

{α : Type u_1}
[TopologicalSpace α]
{s t : Set α}
(ht : IsQuasiSeparated t)
(h : s ⊆ t)


/-- The smallest congruence relation containing a binary relation `r` is contained in any
    congruence relation containing `r`. -/
@[to_additive addConGen_le "The smallest additive congruence relation containing a binary
relation `r` is contained in any additive congruence relation containing `r`."]
theorem conGen_le {r : M → M → Prop} {c : Con M} (h : ∀ x y, r x y → c x y) :
    conGen r ≤ c

{M : Type u_1}
[Mul M]
{r : M → M → Prop}
{c : Con M}
(h : ∀ (x y : M), r x y → c x y)


@[simp] lemma map_apply (b : FreeGroupBasis ι G) (e : G ≃* H) (x : ι) :
    b.map e x = e (b x)

{ι : Type u_1}
{G : Type u_3}
{H : Type u_4}
[Group G]
[Group H]
(b : FreeGroupBasis ι G)
(e : G ≃* H)
(x : ι)


@[simp, nolint simpNF] -- Added `nolint simpNF` to avoid a timeout #8386
theorem aux_algebraMap (r) (hr) : aux f ⟨algebraMap R _ r, hr⟩ = algebraMap R _ r

(hr : (algebraMap R (CliffordAlgebra Q)) r ∈ CliffordAlgebra.even Q)

(CliffordAlgebra.even.lift.aux f) ⟨(algebraMap R (CliffordAlgebra Q)) r, hr⟩ = (algebraMap R A) r


theorem OrderIso.map_sup [SemilatticeSup α] [SemilatticeSup β] (f : α ≃o β) (x y : α) :
    f (x ⊔ y) = f x ⊔ f y

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[SemilatticeSup β]
(f : α ≃o β)
(x y : α)


@[simp] theorem and_congr_left_iff : (a ∧ c ↔ b ∧ c) ↔ c → (a ↔ b)


private lemma card_S_eq : (Finset.Icc N P).card = ∏ i : α, (P i - N i + 1)

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(A : Matrix α β ℤ)
[DecidableEq α]

↑(Finset.Icc
        (fun i =>
          ∑ j : β,
            ↑⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊ *
              -(A i j)⁻)
        fun i =>
        ∑ j : β,
          ↑⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊ *
            (A i j)⁺).card =
  ∏ i : α,
    ((fun i =>
            ∑ j : β,
              ↑⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊ *
                (A i j)⁺)
          i -
        (fun i =>
            ∑ j : β,
              ↑⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊ *
                -(A i j)⁻)
          i +
      1)


/-- Integrability in the change of variable formula for differentiable functions (one-variable
version): if a function `f` is injective and differentiable on a measurable set `s ⊆ ℝ`, then a
function `g : ℝ → F` is integrable on `f '' s` if and only if `|(f' x)| • g ∘ f` is integrable on
`s`. -/
theorem integrableOn_image_iff_integrableOn_abs_deriv_smul {s : Set ℝ} {f : ℝ → ℝ} {f' : ℝ → ℝ}
    (hs : MeasurableSet s) (hf' : ∀ x ∈ s, HasDerivWithinAt f (f' x) s x) (hf : InjOn f s)
    (g : ℝ → F) : IntegrableOn g (f '' s) ↔ IntegrableOn (fun x => |f' x| • g (f x)) s

MeasureTheory.IntegrableOn g (f '' s) MeasureTheory.volume ↔
  MeasureTheory.IntegrableOn (fun x => |f' x| • g (f x)) s MeasureTheory.volume


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

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

(X₁ : CategoryTheory.GradedObject I₁ C₁)

[∀ (X₂ : CategoryTheory.GradedObject I₂ C₂) (X₃ : CategoryTheory.GradedObject I₃ C₃),
    ((((CategoryTheory.GradedObject.mapTrifunctor F I₁ I₂ I₃).obj X₁).obj X₂).obj X₃).HasMap p]

{X₂ Y₂ : CategoryTheory.GradedObject I₂ C₂}

((CategoryTheory.GradedObject.mapTrifunctorMapFunctorObj F p X₁).map φ).app X₃ i =
  CategoryTheory.GradedObject.mapTrifunctorMapMap F p (CategoryTheory.CategoryStruct.id X₁) φ
    (CategoryTheory.CategoryStruct.id X₃) i


@[simp]
theorem PreservesTerminal.iso_hom : (PreservesTerminal.iso G).hom = terminalComparison G

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Functor.empty C) G]

(CategoryTheory.Limits.PreservesTerminal.iso G).hom = CategoryTheory.Limits.terminalComparison G


@[simp]
theorem update_le_self_iff : update x i a ≤ x ↔ a ≤ x i

{ι : Type u_1}
{π : ι → Type u_4}
[DecidableEq ι]
[(i : ι) → Preorder (π i)]
{x : (i : ι) → π i}
{i : ι}
{a : π i}


@[simp]
lemma measure_smul (c : ℝ≥0) (f : StieltjesFunction) : (c • f).measure = c • f.measure


/-- `m` is `s`-factored if and only if `m ≠ 0` and its `Finset` of prime factors
is contained in `s`. -/
lemma mem_factoredNumbers_iff_primeFactors_subset {s : Finset ℕ} {m : ℕ} :
    m ∈ factoredNumbers s ↔ m ≠ 0 ∧ m.primeFactors ⊆ s

m ∈ Nat.factoredNumbers s ↔ m ≠ 0 ∧ m.primeFactors ⊆ s


/-- A measure `μ` is regular if
  - it is finite on all compact sets;
  - it is outer regular: `μ(A) = inf {μ(U) | A ⊆ U open}` for `A` measurable;
  - it is inner regular for open sets, using compact sets:
    `μ(U) = sup {μ(K) | K ⊆ U compact}` for `U` open. -/
class Regular (μ : Measure α) extends IsFiniteMeasureOnCompacts μ, OuterRegular μ : Prop where
  innerRegular : InnerRegularWRT μ IsCompact IsOpen

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[self : μ.Regular]


/-- Analytic functions on products are analytic in the second coordinate -/
theorem AnalyticOn.curry_right {f : E × F → G} {x : E} {s : Set (E × F)} (fa : AnalyticOn 𝕜 f s) :
    AnalyticOn 𝕜 (fun y ↦ f (x, y)) {y | (x, y) ∈ s}

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
{G : Type u_5}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E × F → G}
{x : E}
{s : Set (E × F)}
(fa : AnalyticOn 𝕜 f s)

AnalyticOn 𝕜 (fun y => f (x, y)) {y | (x, y) ∈ s}


theorem preimage_ball (x : ℕ) (r : ℝ) : (↑) ⁻¹' ball (x : ℝ) r = ball x r

Nat.cast ⁻¹' Metric.ball (↑x) r = Metric.ball x r


theorem clusterPt_iff {F : Filter X} :
    ClusterPt x F ↔ ∀ ⦃U : Set X⦄, U ∈ 𝓝 x → ∀ ⦃V⦄, V ∈ F → (U ∩ V).Nonempty

{X : Type u}
{x : X}
[TopologicalSpace X]
{F : Filter X}

ClusterPt x F ↔ ∀ ⦃U : Set X⦄, U ∈ 𝓝 x → ∀ ⦃V : Set X⦄, V ∈ F → (U ∩ V).Nonempty


@[simp]
theorem mem_preimage {f : α → β} {s : Finset β} {hf : Set.InjOn f (f ⁻¹' ↑s)} {x : α} :
    x ∈ preimage s f hf ↔ f x ∈ s

{α : Type u}
{β : Type v}
{f : α → β}
{s : Finset β}
{hf : Set.InjOn f (f ⁻¹' ↑s)}
{x : α}


@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.div [MeasurableDiv₂ G] (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    AEMeasurable (fun a => f a / g a) μ

{G : Type u_2}
{α : Type u_3}
[MeasurableSpace G]
[Sub G]
{m : MeasurableSpace α}
{f g : α → G}
{μ : MeasureTheory.Measure α}
[MeasurableSub₂ G]
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


@[simp] theorem swap_inj {o₁ o₂ : Ordering} : o₁.swap = o₂.swap ↔ o₁ = o₂


@[simp]
theorem coe_zero : ↑(0 : ℝ) = (0 : Angle)


/-- The forward direction of the equivalence between the decomposed category and the original. -/
@[simps!]
def decomposedTo (J : Type u₁) [Category.{v₁} J] : Decomposed J ⥤ J

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

∀ {X Y : (i : CategoryTheory.ConnectedComponents J) × CategoryTheory.Component i} (g : X ⟶ Y),
  (CategoryTheory.decomposedTo J).map g = CategoryTheory.Sigma.descMap CategoryTheory.Component.ι X Y g


theorem pi_comp (f : (i : ι) → M₂ →ₗ[R] φ i) (g : M₃ →ₗ[R] M₂) :
    (pi f).comp g = pi fun i => (f i).comp g

{R : Type u}
{M₂ : Type w}
{M₃ : Type y}
{ι : Type x}
[Semiring R]
[AddCommMonoid M₂]
[Module R M₂]
[AddCommMonoid M₃]
[Module R M₃]
{φ : ι → Type i}
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
(f : (i : ι) → M₂ →ₗ[R] φ i)
(g : M₃ →ₗ[R] M₂)

LinearMap.pi f ∘ₗ g = LinearMap.pi fun i => f i ∘ₗ g


@[simp]
lemma span_setOf_mem_eq_top :
    span R {x : span R s | (x : M) ∈ s} = ⊤

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


theorem swap_iSup [SupSet α] [SupSet β] (f : ι → α × β) : (iSup f).swap = ⨆ i, (f i).swap

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[SupSet α]
[SupSet β]
(f : ι → α × β)


theorem ContDiffOn.continuousOn (h : ContDiffOn 𝕜 n f s) : ContinuousOn f s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ∞}
(h : ContDiffOn 𝕜 n f s)


@[simp]
theorem unop_add {X Y : Cᵒᵖ} (f g : X ⟶ Y) : (f + g).unop = f.unop + g.unop

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


@[to_additive (attr := simp)]
theorem prod_univ_two [CommMonoid β] (f : Fin 2 → β) : ∏ i, f i = f 0 * f 1

{β : Type u_2}
[AddCommMonoid β]
(f : Fin 2 → β)


protected lemma add_posSemidef {A : Matrix m m R} {B : Matrix m m R}
    (hA : A.PosDef) (hB : B.PosSemidef) : (A + B).PosDef

{m : Type u_1}
{R : Type u_3}
[Fintype m]
[CommRing R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
{A B : Matrix m m R}
(hA : A.PosDef)
(hB : B.PosSemidef)


theorem inter_inter_distrib_right (s t u : Finset α) : s ∩ t ∩ u = s ∩ u ∩ (t ∩ u)

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


@[simp]
lemma LSeriesSummable.neg_iff {f : ℕ → ℂ} {s : ℂ} :
    LSeriesSummable (-f) s ↔ LSeriesSummable f s


theorem map_op_mul :
    map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) (M * N) =
      map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) N *
        map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) M

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

Submodule.map (↑(MulOpposite.opLinearEquiv R)) (M * N) =
  Submodule.map (↑(MulOpposite.opLinearEquiv R)) N * Submodule.map (↑(MulOpposite.opLinearEquiv R)) M


theorem applyComposition_ones (p : FormalMultilinearSeries 𝕜 E F) (n : ℕ) :
    p.applyComposition (Composition.ones n) = fun v i =>
      p 1 fun _ => v (Fin.castLE (Composition.length_le _) i)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[CommRing 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
[TopologicalSpace E]
[TopologicalSpace F]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(n : ℕ)

p.applyComposition (Composition.ones n) = fun v i => (p 1) fun x => v (Fin.castLE ⋯ i)


/-- The sum of the identity, the adjacency matrix, and its complement is the all-ones matrix. -/
theorem one_add_adjMatrix_add_compl_adjMatrix_eq_allOnes [DecidableEq V] [DecidableEq α]
    [NonAssocSemiring α] : 1 + G.adjMatrix α + (G.adjMatrix α).compl = Matrix.of fun _ _ ↦ 1

{V : Type u_1}
{α : Type u_2}
{G : SimpleGraph V}
[DecidableRel G.Adj]
[DecidableEq V]
[DecidableEq α]
[NonAssocSemiring α]

1 + SimpleGraph.adjMatrix α G + (SimpleGraph.adjMatrix α G).compl = Matrix.of fun x x => 1


theorem comap_inf (s t : AffineSubspace k P₂) (f : P₁ →ᵃ[k] P₂) :
    (s ⊓ t).comap f = s.comap f ⊓ t.comap f

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(s t : AffineSubspace k P₂)
(f : P₁ →ᵃ[k] P₂)

AffineSubspace.comap f (s ⊓ t) = AffineSubspace.comap f s ⊓ AffineSubspace.comap f t


@[simp]
theorem finSuccEquiv_symm_some (m : Fin n) : (finSuccEquiv n).symm (some m) = m.succ


/-- Localization at an element is smooth. -/
theorem of_isLocalization_Away (r : R) [IsLocalization.Away r A] : Smooth R A

{R : Type u}
[CommRing R]
{A : Type u}
[CommRing A]
[Algebra R A]
(r : R)
[IsLocalization.Away r A]


@[to_additive (attr := simp)]
lemma monovaryOn_inv_left : MonovaryOn f⁻¹ g s ↔ AntivaryOn f g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[OrderedCommGroup β]
{s : Set ι}
{f : ι → α}
{g : ι → β}


lemma pullback.hom_ext {Z : CompHausLike P} (a b : Z ⟶ pullback f g)
    (hfst : a ≫ pullback.fst f g = b ≫ pullback.fst f g)
    (hsnd : a ≫ pullback.snd f g = b ≫ pullback.snd f g) : a = b

(hfst :
  CategoryTheory.CategoryStruct.comp a (CompHausLike.pullback.fst f g) =
    CategoryTheory.CategoryStruct.comp b (CompHausLike.pullback.fst f g))

(hsnd :
  CategoryTheory.CategoryStruct.comp a (CompHausLike.pullback.snd f g) =
    CategoryTheory.CategoryStruct.comp b (CompHausLike.pullback.snd f g))


@[simp]
theorem range_castLE {n k : ℕ} (h : n ≤ k) : Set.range (castLE h) = { i : Fin k | (i : ℕ) < n }


theorem Nat.cauchy_induction' (seed : ℕ) (h : ∀ n, P (n + 1) → P n) (hs : P seed)
    (hi : ∀ x, seed ≤ x → P x → ∃ y, x < y ∧ P y) (n : ℕ) : P n

(hi : ∀ (x : ℕ), seed ≤ x → P x → ∃ y, x < y ∧ P y)


@[simp]
lemma singularPart_zero_right (μ : Measure α) : μ.singularPart 0 = μ

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


protected theorem le_min {a b c : Int} : a ≤ min b c ↔ a ≤ b ∧ a ≤ c


@[simp]
theorem parts_map {β : Type*} [Lattice β] [OrderBot β] {a : α} {e : α ≃o β} {P : Finpartition a} :
    (P.map e).parts = P.parts.map e

{α : Type u_1}
[Lattice α]
[OrderBot α]
{β : Type u_2}
[Lattice β]
[OrderBot β]
{a : α}
{e : α ≃o β}
{P : Finpartition a}

(Finpartition.map e P).parts = Finset.map (↑e).toEmbedding P.parts


theorem arccos_eq_pi_div_two_sub_arcsin (x : ℝ) : arccos x = π / 2 - arcsin x


@[to_additive]
theorem lt_or_lt_of_mul_lt_mul [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a₁ a₂ b₁ b₂ : α} :
    a₁ * b₁ < a₂ * b₂ → a₁ < a₂ ∨ b₁ < b₂

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

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


theorem support_update_ne_zero [DecidableEq α] (h : b ≠ 0) :
    support (f.update a b) = insert a f.support

{α : Type u_1}
{M : Type u_5}
[Zero M]
(f : α →₀ M)
(a : α)
{b : M}
[DecidableEq α]
(h : b ≠ 0)

(f.update a b).support = insert a f.support


@[to_additive (attr := simp)]
lemma prod_indicator_index [Zero M] [CommMonoid N]
    {s : Finset α} (f : α → M) {h : α → M → N} (h_zero : ∀ a ∈ s, h a 0 = 1) :
    (indicator s (fun x _ ↦ f x)).prod h = ∏ x ∈ s, h x (f x)

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[CommMonoid N]
{s : Finset α}
(f : α → M)
{h : α → M → N}
(h_zero : ∀ a ∈ s, h a 0 = 1)

(Finsupp.indicator s fun x x_1 => f x).prod h = ∏ x ∈ s, h x (f x)


theorem map₂_span_singleton_eq_map (f : M →ₗ[R] N →ₗ[R] P) (m : M) :
    map₂ f (span R {m}) = map (f m)

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : M →ₗ[R] N →ₗ[R] P)
(m : M)

Submodule.map₂ f (Submodule.span R {m}) = Submodule.map (f m)


theorem restrictScalars_one_smulRight' (x : E) :
    ContinuousLinearMap.restrictScalars ℝ ((1 : ℂ →L[ℂ] ℂ).smulRight x : ℂ →L[ℂ] E) =
      reCLM.smulRight x + I • imCLM.smulRight x

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℂ E]
(x : E)

ContinuousLinearMap.restrictScalars ℝ (ContinuousLinearMap.smulRight 1 x) =
  Complex.reCLM.smulRight x + Complex.I • Complex.imCLM.smulRight x


theorem tendsto_const_mul_pow_atTop_iff :
    Tendsto (fun x => c * x ^ n) atTop atTop ↔ n ≠ 0 ∧ 0 < c

{α : Type u_3}
[LinearOrderedSemifield α]
{c : α}
{n : ℕ}

Filter.Tendsto (fun x => c * x ^ n) Filter.atTop Filter.atTop ↔ n ≠ 0 ∧ 0 < c


@[simp]
theorem getLast?_isSome : ∀ {l : List α}, l.getLast?.isSome ↔ l ≠ []


theorem iInter_vsub_subset (s : ι → Set β) (t : Set β) : (⋂ i, s i) -ᵥ t ⊆ ⋂ i, s i -ᵥ t

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


protected theorem HasCompactSupport.deriv (hf : HasCompactSupport f) :
    HasCompactSupport (deriv f)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
(hf : HasCompactSupport f)


@[reassoc]
theorem p_comm {P Q : Karoubi C} (f : Hom P Q) : P.p ≫ f.f = f.f ≫ Q.p

{P Q : CategoryTheory.Idempotents.Karoubi C}

CategoryTheory.CategoryStruct.comp P.p f.f = CategoryTheory.CategoryStruct.comp f.f Q.p


theorem preimage_liftCover (t : Set β) : liftCover S f hf hS ⁻¹' t = ⋃ i, (↑) '' (f i ⁻¹' t)

{hf : ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j), f i ⟨x, hxi⟩ = f j ⟨x, hxj⟩}

Set.liftCover S f hf hS ⁻¹' t = ⋃ i, Subtype.val '' (f i ⁻¹' t)


@[aesop safe apply]
theorem pow {x : R} (hx : IsSelfAdjoint x) (n : ℕ) : IsSelfAdjoint (x ^ n)

{R : Type u_1}
[Monoid R]
[StarMul R]
{x : R}
(hx : IsSelfAdjoint x)
(n : ℕ)


lemma mapSetEmbedding_indep_iff' {f : M.E ↪ β} {I : Set β} :
    (M.mapSetEmbedding f).Indep I ↔ ∃ (I₀ : Set M.E), M.Indep ↑I₀ ∧ I = f '' I₀

{α : Type u_1}
{β : Type u_2}
{M : Matroid α}
{f : ↑M.E ↪ β}
{I : Set β}

(M.mapSetEmbedding f).Indep I ↔ ∃ I₀, M.Indep ↑I₀ ∧ I = ⇑f '' I₀


/-- We now have four different results that all encode the
 idea that inequality of multisets corresponds to divisibility
 of positive integers. -/
theorem factorMultiset_le_iff {m n : ℕ+} : factorMultiset m ≤ factorMultiset n ↔ m ∣ n

m.factorMultiset ≤ n.factorMultiset ↔ m ∣ n


/-- An alternative for `bitwise_bit` which replaces the `f false false = false` assumption
with assumptions that neither `bit a m` nor `bit b n` are `0`
(albeit, phrased as the implications `m = 0 → a = true` and `n = 0 → b = true`) -/
lemma bitwise_bit' {f : Bool → Bool → Bool} (a : Bool) (m : Nat) (b : Bool) (n : Nat)
    (ham : m = 0 → a = true) (hbn : n = 0 → b = true) :
    bitwise f (bit a m) (bit b n) = bit (f a b) (bitwise f m n)

{f : Bool → Bool → Bool}
(a : Bool)
(m : ℕ)
(b : Bool)
(n : ℕ)
(ham : m = 0 → a = true)
(hbn : n = 0 → b = true)

Nat.bitwise f (Nat.bit a m) (Nat.bit b n) = Nat.bit (f a b) (Nat.bitwise f m n)


@[to_additive]
theorem ofMulEquivOfLocalizations_eq_iff_eq {k : N ≃* P} {x y} :
    (f.ofMulEquivOfLocalizations k).toMap x = y ↔ f.toMap x = k.symm y

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{k : N ≃* P}
{x : M}
{y : P}


@[simp]
lemma div_bot {a : EReal} : a / ⊥ = 0


@[simp]
theorem directSumLeft_symm_lof_tmul (i : ι₁) (x : M₁ i) (y : M₂') :
    (directSumLeft R M₁ M₂').symm (DirectSum.lof R _ _ i (x ⊗ₜ[R] y)) =
      DirectSum.lof R _ _ i x ⊗ₜ[R] y

(R : Type u)
[CommSemiring R]
{ι₁ : Type v₁}
[DecidableEq ι₁]
{M₁ : ι₁ → Type w₁}
{M₂' : Type w₂'}
[(i₁ : ι₁) → AddCommMonoid (M₁ i₁)]
[AddCommMonoid M₂']
[(i₁ : ι₁) → Module R (M₁ i₁)]
[Module R M₂']
(i : ι₁)
(x : M₁ i)
(y : M₂')

(TensorProduct.directSumLeft R M₁ M₂').symm ((DirectSum.lof R ι₁ (fun i => TensorProduct R (M₁ i) M₂') i) (x ⊗ₜ[R] y)) =
  (DirectSum.lof R ι₁ M₁ i) x ⊗ₜ[R] y


/-- By definition, if `f` is not invertible then `inverse f = 0`. -/
@[simp]
theorem inverse_non_equiv (f : M →L[R] M₂) (h : ¬∃ e' : M ≃L[R] M₂, ↑e' = f) : inverse f = 0

{R : Type u_1}
{M : Type u_2}
{M₂ : Type u_3}
[TopologicalSpace M]
[TopologicalSpace M₂]
[Semiring R]
[AddCommMonoid M₂]
[Module R M₂]
[AddCommMonoid M]
[Module R M]
(f : M →L[R] M₂)
(h : ¬∃ e', ↑e' = f)


/-- `OrderDual` as a functor. -/
@[simps]
def dual : BddDistLat ⥤ BddDistLat

(a : BoundedLatticeHom ↑X.toBddLat.toLat ↑Y.toBddLat.toLat)

BddDistLat.dual.map a = BoundedLatticeHom.dual a


theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) :
    DifferentiableAt ℝ (fun y => ‖f y‖ ^ 2) x

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f : G → E}
{x : G}
(hf : DifferentiableAt ℝ f x)


theorem _root_.Sum.range_eq (f : α ⊕ β → γ) :
    range f = range (f ∘ Sum.inl) ∪ range (f ∘ Sum.inr)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α ⊕ β → γ)

Set.range f = Set.range (f ∘ Sum.inl) ∪ Set.range (f ∘ Sum.inr)


theorem gcd_pos_iff (a : ℤ√d) : 0 < Int.gcd a.re a.im ↔ a ≠ 0


nonrec theorem im_smul_eq_div_normSq :
    (g • z).im = z.im / Complex.normSq (denom g z)

(g • z).im = z.im / Complex.normSq (UpperHalfPlane.denom (↑g) z)


theorem ofArrows_pullback [HasPullbacks C] {ι : Type*} (Z : ι → C) (g : ∀ i : ι, Z i ⟶ X) :
    (ofArrows (fun i => pullback (g i) f) fun i => pullback.snd _ _) =
      pullbackArrows f (ofArrows Z g)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
(f : Y ⟶ X)
[CategoryTheory.Limits.HasPullbacks C]
{ι : Type u_1}
(Z : ι → C)
(g : (i : ι) → Z i ⟶ X)

(CategoryTheory.Presieve.ofArrows (fun i => CategoryTheory.Limits.pullback (g i) f) fun i =>
    CategoryTheory.Limits.pullback.snd (g i) f) =
  CategoryTheory.Presieve.pullbackArrows f (CategoryTheory.Presieve.ofArrows Z g)


theorem ne_zero_of_mem_factors {p a : α} (h : p ∈ factors a) : a ≠ 0

(h : p ∈ UniqueFactorizationMonoid.factors a)


theorem bind_pmap {α β γ} {p : α → Prop} (f : ∀ a, p a → β) (x : Option α) (g : β → Option γ) (H) :
    pmap f x H >>= g = x.pbind fun a h ↦ g (f a (H _ h))

{α : Type u_5}
{β γ : Type u_6}
{p : α → Prop}
(f : (a : α) → p a → β)
(x : Option α)
(g : β → Option γ)
(H : ∀ (a : α), a ∈ x → p a)

Option.pmap f x H >>= g = x.pbind fun a h => g (f a ⋯)


@[norm_cast] theorem Nat.cast_sub_of_add_le {m n k} (h : m + k ≤ n) :
    ((n - m : ℕ) : R) = n - m

{R : Type u_1}
[AddGroupWithOne R]
{m n k : ℕ}
(h : m + k ≤ n)


@[simp]
theorem derivative_ofNat (n : ℕ) [n.AtLeastTwo] :
    derivative (no_index (OfNat.ofNat n) : R[X]) = 0

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

Polynomial.derivative (OfNat.ofNat n) = 0


theorem mem_roots_map [CommRing k] [IsDomain k] {f : R →+* k} {x : k} (hp : p ≠ 0) :
    x ∈ (p.map f).roots ↔ p.eval₂ f x = 0

{R : Type u}
{k : Type y}
[Field R]
{p : R[X]}
[CommRing k]
[IsDomain k]
{f : R →+* k}
{x : k}
(hp : p ≠ 0)

x ∈ (Polynomial.map f p).roots ↔ Polynomial.eval₂ f x p = 0


theorem empty_mem_powerset (s : Finset α) : ∅ ∈ powerset s


@[to_additive]
theorem min_le_mul_of_one_le_right [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} (hb : 1 ≤ b) :
    min a b ≤ a * b

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


theorem le_of_fin_injective [StrongRankCondition R] {n m : ℕ} (f : (Fin n → R) →ₗ[R] Fin m → R) :
    Injective f → n ≤ m

(R : Type u)
[Semiring R]
[StrongRankCondition R]
{n m : ℕ}
(f : (Fin n → R) →ₗ[R] Fin m → R)


@[to_additive (attr := simp)]
lemma Units.pow_ofPowEqOne (ha : a ^ n = 1) (hn : n ≠ 0) :
    Units.ofPowEqOne _ n ha hn ^ n = 1

{M : Type u_1}
[Monoid M]
{n : ℕ}
{a : M}
(ha : a ^ n = 1)
(hn : n ≠ 0)


theorem setAverage_eq' (f : α → E) (s : Set α) :
    ⨍ x in s, f x ∂μ = ∫ x, f x ∂(μ s)⁻¹ • μ.restrict s

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(μ : MeasureTheory.Measure α)
(f : α → E)
(s : Set α)

⨍ (x : α) in s, f x ∂μ = ∫ (x : α), f x ∂(μ s)⁻¹ • μ.restrict s


theorem sdiff_sdiff_eq_self (h : y ≤ x) : x \ (x \ y) = y

{α : Type u}
{x y : α}
[GeneralizedBooleanAlgebra α]
(h : y ≤ x)


theorem Convex_subadditive_le [SMul 𝕜 E] {f : E → 𝕜} (hf1 : ∀ x y, f (x + y) ≤ (f x) + (f y))
    (hf2 : ∀ ⦃c⦄ x, 0 ≤ c → f (c • x) ≤ c * f x) (B : 𝕜) :
    Convex 𝕜 { x | f x ≤ B }

(hf1 : ∀ (x y : E), f (x + y) ≤ f x + f y)

(hf2 : ∀ ⦃c : 𝕜⦄ (x : E), 0 ≤ c → f (c • x) ≤ c * f x)


@[simp]
protected theorem inj (s : CompositionSeries X) {i j : Fin s.length.succ} : s i = s j ↔ i = j

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


lemma Multiset.insert_eq_cons {α : Type*} (a : α) (s : Multiset α) :
    insert a s = Multiset.cons a s


@[simp] lemma den_mul_eq_num (q : ℚ≥0) : q.den * q = q.num


lemma image_subset_sups_left : b ∈ t → s.image (· ⊔ b) ⊆ s ⊻ t

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
{s t : Finset α}
{b : α}

b ∈ t → Finset.image (fun x => x ⊔ b) s ⊆ s ⊻ t


@[simp]
theorem isometryEquivMap.toAffineMap_eq (φ : P₁' →ᵃⁱ[𝕜] P₂) (E : AffineSubspace 𝕜 P₁')
    [Nonempty E] :
    (E.isometryEquivMap φ).toAffineMap = E.equivMapOfInjective φ.toAffineMap φ.injective

{𝕜 : Type u_1}
{V₁' : Type u_4}
{V₂ : Type u_5}
{P₁' : Type u_9}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V₁']
[NormedSpace 𝕜 V₁']
[MetricSpace P₁']
[NormedAddTorsor V₁' P₁']
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(φ : P₁' →ᵃⁱ[𝕜] P₂)
(E : AffineSubspace 𝕜 P₁')
[Nonempty ↥E]

↑(AffineSubspace.isometryEquivMap φ E).toAffineEquiv = ↑(E.equivMapOfInjective φ.toAffineMap ⋯)


@[simp] theorem cond_eq_ite_iff (a : Bool) (p : Prop) [h : Decidable p] (x y u v : α) :
  (cond a x y = ite p u v) ↔ ite a x y = ite p u v

{α : Type u_1}
(a : Bool)
(p : Prop)
[h : Decidable p]
(x y u v : α)

((bif a then x else y) = if p then u else v) ↔ (if a = true then x else y) = if p then u else v


@[simp] theorem coe_continuousMap : ((f : C(X, Y)) : X → Y) = (f : X → Y)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(f : LocallyConstant X Y)


theorem lt_castPred_iff {j : Fin n} {i : Fin (n + 1)} (hi : i ≠ last n) :
    j < castPred i hi ↔ castSucc j < i

{n : ℕ}
{j : Fin n}
{i : Fin (n + 1)}
(hi : i ≠ Fin.last n)


@[simp]
theorem eval_singleton (a : α) : M.eval [a] = M.stepSet M.start a

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


/-- Pseudo metric and Metric spaces

A pseudo metric space is endowed with a distance for which the requirement `d(x,y)=0 → x = y` might
not hold. A metric space is a pseudo metric space such that `d(x,y)=0 → x = y`.
Each pseudo metric space induces a canonical `UniformSpace` and hence a canonical
`TopologicalSpace` This is enforced in the type class definition, by extending the `UniformSpace`
structure. When instantiating a `PseudoMetricSpace` structure, the uniformity fields are not
necessary, they will be filled in by default. In the same way, each (pseudo) metric space induces a
(pseudo) emetric space structure. It is included in the structure, but filled in by default.
-/
class PseudoMetricSpace (α : Type u) extends Dist α : Type u where
  dist_self : ∀ x : α, dist x x = 0
  dist_comm : ∀ x y : α, dist x y = dist y x
  dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z
  edist : α → α → ℝ≥0∞ := fun x y => ENNReal.ofNNReal ⟨dist x y, dist_nonneg' _ ‹_› ‹_› ‹_›⟩
  edist_dist : ∀ x y : α, edist x y = ENNReal.ofReal (dist x y) := by
    intros x y; exact ENNReal.coe_nnreal_eq _
  toUniformSpace : UniformSpace α := .ofDist dist dist_self dist_comm dist_triangle
  uniformity_dist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | dist p.1 p.2 < ε } := by intros; rfl
  toBornology : Bornology α := Bornology.ofDist dist dist_comm dist_triangle
  cobounded_sets : (Bornology.cobounded α).sets =
    { s | ∃ C : ℝ, ∀ x ∈ sᶜ, ∀ y ∈ sᶜ, dist x y ≤ C } := by intros; rfl

{α : Type u}
[self : PseudoMetricSpace α]
(x y z : α)


theorem rank_quotient_eq_of_le_torsion {R M} [CommRing R] [AddCommGroup M] [Module R M]
    {M' : Submodule R M} (hN : M' ≤ torsion R M) : Module.rank R (M ⧸ M') = Module.rank R M

{R : Type u_2}
{M : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
{M' : Submodule R M}
(hN : M' ≤ Submodule.torsion R M)


theorem martingale_condexp (f : Ω → E) (ℱ : Filtration ι m0) (μ : Measure Ω)
    [SigmaFiniteFiltration μ ℱ] : Martingale (fun i => μ[f|ℱ i]) ℱ μ

MeasureTheory.Martingale (fun i => μ[f|↑ℱ i]) ℱ μ


@[to_additive]
theorem mul_left_cancel_iff : a * b = a * c ↔ b = c

{G : Type u_1}
[Mul G]
[IsLeftCancelMul G]
{a b c : G}


theorem add_lt_top [LT α] {a b : WithTop α} : a + b < ⊤ ↔ a < ⊤ ∧ b < ⊤

{α : Type u}
[Add α]
[LT α]
{a b : WithTop α}


theorem finite_of_finite [Finite K] [FiniteDimensional K V] : Finite V

(K : Type u)
(V : Type v)
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[Finite K]
[FiniteDimensional K V]


@[simp]
theorem leadingCoeff_eq_zero : leadingCoeff p = 0 ↔ p = 0


theorem tsub_right_comm : a - b - c = a - c - b

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


@[simp]
theorem range_neg {R : Type*} {R₂ : Type*} {M : Type*} {M₂ : Type*} [Semiring R] [Ring R₂]
    [AddCommMonoid M] [AddCommGroup M₂] [Module R M] [Module R₂ M₂] {τ₁₂ : R →+* R₂}
    [RingHomSurjective τ₁₂] (f : M →ₛₗ[τ₁₂] M₂) : LinearMap.range (-f) = LinearMap.range f

{R : Type u_12}
{R₂ : Type u_13}
{M : Type u_14}
{M₂ : Type u_15}
[Semiring R]
[Ring R₂]
[AddCommMonoid M]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
(f : M →ₛₗ[τ₁₂] M₂)


@[simp]
theorem comap_top (f : F) : comap f ⊤ = ⊤

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
(f : F)


/-- if `r a b` then the rank of `a` is less than the rank of `b`. -/
theorem rank_lt_of_rel (hb : Acc r b) (h : r a b) : (hb.inv h).rank < hb.rank

{α : Type u}
{r : α → α → Prop}
{a b : α}
(hb : Acc r b)
(h : r a b)


theorem IntegrableOn.restrict (h : IntegrableOn f s μ) (hs : MeasurableSet s) :
    IntegrableOn f s (μ.restrict t)

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{s t : Set α}
{μ : MeasureTheory.Measure α}
(h : MeasureTheory.IntegrableOn f s μ)
(hs : MeasurableSet s)

MeasureTheory.IntegrableOn f s (μ.restrict t)


theorem PolyCnstr.eq_true_of_isValid (ctx : Context) {c : PolyCnstr} : c.isValid → c.denote ctx = True

(ctx : Nat.Linear.Context)
{c : Nat.Linear.PolyCnstr}

c.isValid = true → Nat.Linear.PolyCnstr.denote ctx c = True


/-- Möbius inversion for functions to an `AddCommGroup`. -/
theorem sum_eq_iff_sum_smul_moebius_eq [AddCommGroup R] {f g : ℕ → R} :
    (∀ n > 0, ∑ i ∈ n.divisors, f i = g n) ↔
      ∀ n > 0, ∑ x ∈ n.divisorsAntidiagonal, μ x.fst • g x.snd = f n

{R : Type u_1}
[AddCommGroup R]
{f g : ℕ → R}

(∀ n > 0, ∑ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, ∑ x ∈ n.divisorsAntidiagonal, ArithmeticFunction.moebius x.1 • g x.2 = f n


theorem nhdsWithin_biUnion {ι} {I : Set ι} (hI : I.Finite) (s : ι → Set α) (a : α) :
    𝓝[⋃ i ∈ I, s i] a = ⨆ i ∈ I, 𝓝[s i] a

{α : Type u_1}
[TopologicalSpace α]
{ι : Type u_5}
{I : Set ι}
(hI : I.Finite)
(s : ι → Set α)
(a : α)


@[simp, norm_cast]
theorem coe_algebraMap [CommSemiring R'] [SMul R' R] [Algebra R' A] [IsScalarTower R' R A]
    (r : R') : ↑(algebraMap R' S r) = algebraMap R' A r

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

↑((algebraMap R' ↥S) r) = (algebraMap R' A) r


theorem ne_empty_eq_nonempty (s : Set β) : (s ≠ ∅) = s.Nonempty


theorem t2Space_iff_nhds :
    T2Space X ↔ Pairwise fun x y : X => ∃ U ∈ 𝓝 x, ∃ V ∈ 𝓝 y, Disjoint U V

T2Space X ↔ Pairwise fun x y => ∃ U ∈ 𝓝 x, ∃ V ∈ 𝓝 y, Disjoint U V


theorem comul_comp_lsingle (i : ι) :
    comul ∘ₗ (lsingle i : A →ₗ[R] _) = TensorProduct.map (lsingle i) (lsingle i) ∘ₗ comul

(R : Type u)
(ι : Type v)
(A : Type w)
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[Coalgebra R A]
(i : ι)

Coalgebra.comul ∘ₗ Finsupp.lsingle i = TensorProduct.map (Finsupp.lsingle i) (Finsupp.lsingle i) ∘ₗ Coalgebra.comul


@[simp]
theorem isOpen_discrete (s : Set α) : IsOpen s

{α : Type u_1}
[TopologicalSpace α]
[DiscreteTopology α]
(s : Set α)


@[simp]
theorem pushforward_map_app' {X Y : TopCat.{w}} (f : X ⟶ Y) {ℱ 𝒢 : X.Presheaf C} (α : ℱ ⟶ 𝒢)
    {U : (Opens Y)ᵒᵖ} : ((pushforward C f).map α).app U = α.app (op <| (Opens.map f).obj U.unop)

(C : Type u)
[CategoryTheory.Category.{v, u} C]
{X Y : TopCat}
(f : X ⟶ Y)
{ℱ 𝒢 : TopCat.Presheaf C X}
(α : ℱ ⟶ 𝒢)
{U : (TopologicalSpace.Opens ↑Y)ᵒᵖ}

((TopCat.Presheaf.pushforward C f).map α).app U =
  α.app (Opposite.op ((TopologicalSpace.Opens.map f).obj (Opposite.unop U)))


/-- Proof follows from "The trace Cayley-Hamilton theorem" by Darij Grinberg, Section 5.3
-/
theorem adjugate_mul_distrib (A B : Matrix n n α) : adjugate (A * B) = adjugate B * adjugate A

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

(A * B).adjugate = B.adjugate * A.adjugate


@[to_additive (attr := simp)]
theorem closure_range_inl_union_inr :
    Subgroup.closure (range (inl : G →* G ∗ H) ∪ range inr) = ⊤

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

Subgroup.closure (Set.range ⇑Monoid.Coprod.inl ∪ Set.range ⇑Monoid.Coprod.inr) = ⊤


theorem le_comap_mkQ (p' : Submodule R (M ⧸ p)) : p ≤ comap p.mkQ p'

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)
(p' : Submodule R (M ⧸ p))


theorem mk_mul_mk {A : Type*} [Semiring A] [Algebra R A] {a₁ a₂ : A} {s₁ s₂ : S} :
    mk a₁ s₁ * mk a₂ s₂ = mk (a₁ * a₂) (s₁ * s₂)

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{A : Type u_2}
[Semiring A]
[Algebra R A]
{a₁ a₂ : A}
{s₁ s₂ : ↥S}

LocalizedModule.mk a₁ s₁ * LocalizedModule.mk a₂ s₂ = LocalizedModule.mk (a₁ * a₂) (s₁ * s₂)


theorem mapRange.equiv_trans (f : M ≃ N) (hf : f 0 = 0) (hf') (f₂ : N ≃ P) (hf₂ : f₂ 0 = 0) (hf₂') :
    (mapRange.equiv (f.trans f₂) (by rw [Equiv.trans_apply, hf, hf₂])
          (by rw [Equiv.symm_trans_apply, hf₂', hf']) :
        (α →₀ _) ≃ _) =
      (mapRange.equiv f hf hf').trans (mapRange.equiv f₂ hf₂ hf₂')

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
{P : Type u_8}
[Zero M]
[Zero N]
[Zero P]
(f : M ≃ N)
(hf : f 0 = 0)
(hf' : f.symm 0 = 0)
(f₂ : N ≃ P)
(hf₂ : f₂ 0 = 0)
(hf₂' : f₂.symm 0 = 0)

Finsupp.mapRange.equiv (f.trans f₂) ⋯ ⋯ = (Finsupp.mapRange.equiv f hf hf').trans (Finsupp.mapRange.equiv f₂ hf₂ hf₂')


theorem counit_tensorObj_tensorObj_right :
    Coalgebra.counit (R := R)
      (A := (CoalgebraCat.of R M ⊗ (CoalgebraCat.of R N ⊗ CoalgebraCat.of R P) : CoalgebraCat R))
      = Coalgebra.counit (A := M ⊗[R] (N ⊗[R] P))

{R : Type u}
[CommRing R]
{M N P : Type u}
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
[Coalgebra R M]
[Coalgebra R N]
[Coalgebra R P]


/-- The composition of a derivation with a linear map as a bilinear map -/
@[simps]
def llcomp : (M →ₗ[A] N) →ₗ[A] Derivation R A M →ₗ[R] Derivation R A N

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
{N : Type u_5}
[AddCommMonoid N]
[Module A N]
[Module R N]
[IsScalarTower R A M]
[IsScalarTower R A N]
(f : M →ₗ[A] N)


/-- **Equational criterion for flatness** [Stacks 00HK](https://stacks.math.columbia.edu/tag/00HK),
combined form.

Let $M$ be a module over a commutative ring $R$. The following are equivalent:
* $M$ is flat.
* For all ideals $I \subseteq R$, the map $I \otimes M \to M$ is injective.
* Every $\sum_i f_i \otimes x_i$ that vanishes in $R \otimes M$ vanishes trivially.
* Every relation $\sum_i f_i x_i = 0$ in $M$ is trivial.
* For all finite index types $\iota$, all elements $f \in R^{\iota}$, and all homomorphisms
$x \colon R^{\iota} \to M$ such that $x(f) = 0$, there exist a finite index type $\kappa$ and module
homomorphisms $a \colon R^{\iota} \to R^{\kappa}$ and $y \colon R^{\kappa} \to M$ such
that $x = y \circ a$ and $a(f) = 0$.
* For all finite free modules $N$, all elements $f \in N$, and all homomorphisms $x \colon N \to M$
such that $x(f) = 0$, there exist a finite index type $\kappa$ and module homomorphisms
$a \colon N \to R^{\kappa}$ and $y \colon R^{\kappa} \to M$ such that $x = y \circ a$ and
$a(f) = 0$. -/
theorem tfae_equational_criterion : List.TFAE [
    Flat R M,
    ∀ (I : Ideal R), Function.Injective ⇑(rTensor M (Submodule.subtype I)),
    ∀ {ι : Type u} [Fintype ι] {f : ι → R} {x : ι → M}, ∑ i, f i ⊗ₜ x i = (0 : R ⊗[R] M) →
      VanishesTrivially R f x,
    ∀ {ι : Type u} [Fintype ι] {f : ι → R} {x : ι → M}, ∑ i, f i • x i = 0 → IsTrivialRelation f x,
    ∀ {ι : Type u} [Fintype ι] {f : ι →₀ R} {x : (ι →₀ R) →ₗ[R] M}, x f = 0 →
      ∃ (κ : Type u) (_ : Fintype κ) (a : (ι →₀ R) →ₗ[R] (κ →₀ R)) (y : (κ →₀ R) →ₗ[R] M),
        x = y ∘ₗ a ∧ a f = 0,
    ∀ {N : Type u} [AddCommGroup N] [Module R N] [Free R N] [Finite R N] {f : N} {x : N →ₗ[R] M},
      x f = 0 →
        ∃ (κ : Type u) (_ : Fintype κ) (a : N →ₗ[R] (κ →₀ R)) (y : (κ →₀ R) →ₗ[R] M),
          x = y ∘ₗ a ∧ a f = 0]

(R M : Type u)
[CommRing R]
[AddCommGroup M]
[Module R M]

[Module.Flat R M, ∀ (I : Ideal R), Function.Injective ⇑(LinearMap.rTensor M (Submodule.subtype I)),
    ∀ {ι : Type u} [inst : Fintype ι] {f : ι → R} {x : ι → M},
      ∑ i : ι, f i ⊗ₜ[R] x i = 0 → TensorProduct.VanishesTrivially R f x,
    ∀ {ι : Type u} [inst : Fintype ι] {f : ι → R} {x : ι → M}, ∑ i : ι, f i • x i = 0 → Module.IsTrivialRelation f x,
    ∀ {ι : Type u} [inst : Fintype ι] {f : ι →₀ R} {x : (ι →₀ R) →ₗ[R] M}, x f = 0 → ∃ κ x_1 a y, x = y ∘ₗ a ∧ a f = 0,
    ∀ {N : Type u} [inst : AddCommGroup N] [inst_1 : Module R N] [inst_2 : Module.Free R N] [inst_3 : Module.Finite R N]
      {f : N} {x : N →ₗ[R] M}, x f = 0 → ∃ κ x_1 a y, x = y ∘ₗ a ∧ a f = 0].TFAE


theorem OpenEmbedding.continuousAt_iff (hf : OpenEmbedding f) {x : X} :
    ContinuousAt (g ∘ f) x ↔ ContinuousAt g (f x)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{f : X → Y}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(hf : OpenEmbedding f)
{x : X}


theorem compProd_eq_sum_compProd_left (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ) :
    κ ⊗ₖ η = Kernel.sum fun n => seq κ n ⊗ₖ η

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

κ.compProd η = ProbabilityTheory.Kernel.sum fun n => (κ.seq n).compProd η


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

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


lemma hausdorffMeasure_of_finrank_lt [MeasurableSpace E] [BorelSpace E] {d : ℝ}
    (hd : finrank ℝ E < d) : (μH[d] : Measure E) = 0

(hd : ↑(FiniteDimensional.finrank ℝ E) < d)


@[simp]
theorem preimage_cast_Ioc (p q : ℚ) : (↑) ⁻¹' Ioc (p : K) q = Ioc p q

{K : Type u_5}
[LinearOrderedField K]
(p q : ℚ)

Rat.cast ⁻¹' Set.Ioc ↑p ↑q = Set.Ioc p q


/-- The `sSup` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear
order takes values within `s`, for all nonempty bounded-above subsets of `s`. -/
theorem sSup_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty)
    (h_bdd : BddAbove t) : sSup ((↑) '' t : Set α) ∈ s

{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
[hs : s.OrdConnected]
⦃t : Set ↑s⦄
(ht : t.Nonempty)
(h_bdd : BddAbove t)


/-- If `G` is closed under restriction, the transition function between
  the restriction of two charts `e` and `e'` lies in `G`. -/
theorem StructureGroupoid.trans_restricted {e e' : PartialHomeomorph M H} {G : StructureGroupoid H}
    (he : e ∈ atlas H M) (he' : e' ∈ atlas H M)
    [HasGroupoid M G] [ClosedUnderRestriction G] {s : Opens M} (hs : Nonempty s) :
    (e.subtypeRestr hs).symm ≫ₕ e'.subtypeRestr hs ∈ G

{H : Type u}
{M : Type u_2}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
{e e' : PartialHomeomorph M H}
{G : StructureGroupoid H}
(he : e ∈ atlas H M)
(he' : e' ∈ atlas H M)
[HasGroupoid M G]
[ClosedUnderRestriction G]
{s : TopologicalSpace.Opens M}
(hs : Nonempty ↥s)


protected theorem IntegrableAtFilter.sub {f g : α → E}
    (hf : IntegrableAtFilter f l μ) (hg : IntegrableAtFilter g l μ) :
    IntegrableAtFilter (f - g) l μ

(hf : MeasureTheory.IntegrableAtFilter f l μ)

(hg : MeasureTheory.IntegrableAtFilter g l μ)

MeasureTheory.IntegrableAtFilter (f - g) l μ


/-- The generator of the kernel of the unique homomorphism ℕ → R for a semiring R.

*Warning*: for a semiring `R`, `CharP R 0` and `CharZero R` need not coincide.
* `CharP R 0` asks that only `0 : ℕ` maps to `0 : R` under the map `ℕ → R`;
* `CharZero R` requires an injection `ℕ ↪ R`.

For instance, endowing `{0, 1}` with addition given by `max` (i.e. `1` is absorbing), shows that
`CharZero {0, 1}` does not hold and yet `CharP {0, 1} 0` does.
This example is formalized in `Counterexamples/CharPZeroNeCharZero.lean`.
-/
@[mk_iff]
class _root_.CharP : Prop where
  cast_eq_zero_iff' : ∀ x : ℕ, (x : R) = 0 ↔ p ∣ x

(R : Type u_1)
[AddMonoidWithOne R]
(p : ℕ)


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

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

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


@[simp]
theorem measure_Ioo {a b : ℝ} : f.measure (Ioo a b) = ofReal (leftLim f b - f a)

f.measure (Set.Ioo a b) = ENNReal.ofReal (Function.leftLim (↑f) b - ↑f a)


@[to_additive le_add_of_nonneg_right]
theorem le_mul_of_one_le_right' [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} (h : 1 ≤ b) :
    a ≤ a * b

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


theorem PosMulReflectLT.toPosMulReflectLE [PosMulReflectLT α] : PosMulReflectLE α

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


theorem of_measure_le {μ' : Measure α} (h : μ ≤ μ') (hT : DominatedFinMeasAdditive μ T C)
    (hC : 0 ≤ C) : DominatedFinMeasAdditive μ' T C

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

MeasureTheory.DominatedFinMeasAdditive μ' T C


@[simp]
theorem argmax_eq_none : l.argmax f = none ↔ l = []

{α : Type u_1}
{β : Type u_2}
[Preorder β]
[DecidableRel fun x x_1 => x < x_1]
{f : α → β}
{l : List α}


@[to_additive]
theorem inv_le_iff_le_inv : f⁻¹ ≤ g ↔ f ≤ g⁻¹

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

f⁻¹ ≤ g ↔ f ≤ g⁻¹


theorem map_smul₂ (f : M₂ →ₗ[R] N₂ →ₛₗ[σ₁₂] P₂) (r : R) (x y) : f (r • x) y = r • f x y

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[Semiring S]
{S₂ : Type u_4}
[Semiring S₂]
{M₂ : Type u_8}
{N₂ : Type u_9}
{P₂ : Type u_10}
[AddCommMonoid M₂]
[AddCommMonoid N₂]
[AddCommMonoid P₂]
[Module R M₂]
[Module S N₂]
[Module R P₂]
[Module S₂ P₂]
[SMulCommClass S₂ R P₂]
{σ₁₂ : S →+* S₂}
(f : M₂ →ₗ[R] N₂ →ₛₗ[σ₁₂] P₂)
(r : R)
(x : M₂)
(y : N₂)


/-- Being cofiltered or empty is preserved by equivalence of categories. -/
theorem of_equivalence (h : C ≌ D) : IsCofilteredOrEmpty D

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


theorem congrFun₂ {β : α → Sort _} {γ : ∀ a, β a → Sort _}
    {f g : ∀ a b, γ a b} (h : f = g) (a : α) (b : β a) :
    f a b = g a b

{α : Sort u_1}
{β : α → Sort u_2}
{γ : (a : α) → β a → Sort u_3}
{f g : (a : α) → (b : β a) → γ a b}
(h : f = g)
(a : α)
(b : β a)


/-- The angle between a nonzero vector and its negation is `π`. -/
@[simp]
theorem oangle_neg_self_right {x : V} (hx : x ≠ 0) : o.oangle x (-x) = π

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


/-- Restricts a finpartition to avoid a given element. -/
@[simps!]
def avoid (b : α) : Finpartition (a \ b)

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableEq α]
{a : α}
(P : Finpartition a)
(b : α)

(P.avoid b).parts.val = (Multiset.map (fun x => x \ b) P.parts.val).dedup.erase ⊥


theorem Memℒp.memℒp_of_exponent_le {p q : ℝ≥0∞} [IsFiniteMeasure μ] {f : α → E} (hfq : Memℒp f q μ)
    (hpq : p ≤ q) : Memℒp f p μ

{α : Type u_1}
{E : Type u_2}
{m : MeasurableSpace α}
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
{p q : ℝ≥0∞}
[MeasureTheory.IsFiniteMeasure μ]
{f : α → E}
(hfq : MeasureTheory.Memℒp f q μ)
(hpq : p ≤ q)


/-- Auxiliary definition: the cone over the limit category. -/
@[simps]
def limitCone (F : J ⥤ Cat.{v, v}) : Cone F

(F : CategoryTheory.Functor J CategoryTheory.Cat)

∀ {X Y : ↑(((CategoryTheory.Functor.const J).obj (CategoryTheory.Cat.HasLimits.limitConeX F)).obj j)} (f : X ⟶ Y),
  ((CategoryTheory.Cat.HasLimits.limitCone F).π.app j).map f =
    CategoryTheory.Limits.limit.π (CategoryTheory.Cat.HasLimits.homDiagram X Y) j f


@[simp]
lemma bot_toAddSubgroup {R M} [Ring R] [AddCommGroup M] [Module R M] :
    (⊥ : Submodule R M).toAddSubgroup = ⊥

{R : Type u_4}
{M : Type u_5}
[Ring R]
[AddCommGroup M]
[Module R M]


theorem degree_le' (G' G'' : Subgraph G) (h : G' ≤ G'') (v : V) [Fintype (G'.neighborSet v)]
    [Fintype (G''.neighborSet v)] : G'.degree v ≤ G''.degree v

{V : Type u}
{G : SimpleGraph V}
(G' G'' : G.Subgraph)
(h : G' ≤ G'')
(v : V)
[Fintype ↑(G'.neighborSet v)]
[Fintype ↑(G''.neighborSet v)]


theorem Fin.preimage_apply_01_prod' {α : Type u} (s t : Set α) :
    (fun f : Fin 2 → α => (f 0, f 1)) ⁻¹' s ×ˢ t = Set.pi Set.univ ![s, t]

(fun f => (f 0, f 1)) ⁻¹' s ×ˢ t = Set.univ.pi ![s, t]


lemma conjBy_trans {α β γ} [Preorder α] [Preorder β] [Preorder γ]
    (e₁ : α ≃o β) (e₂ : β ≃o γ) (c : ClosureOperator α) :
    c.conjBy (e₁.trans e₂) = (c.conjBy e₁).conjBy e₂

{α : Type u_4}
{β : Type u_5}
{γ : Type u_6}
[Preorder α]
[Preorder β]
[Preorder γ]
(e₁ : α ≃o β)
(e₂ : β ≃o γ)
(c : ClosureOperator α)


@[simp]
theorem map_comap_map {f : M →[L] N} : ((S.map f).comap f).map f = S.map f

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

FirstOrder.Language.Substructure.map f
    (FirstOrder.Language.Substructure.comap f (FirstOrder.Language.Substructure.map f S)) =
  FirstOrder.Language.Substructure.map f S


lemma _root_.ContinuousLinearMap.hasTemperateGrowth (f : E →L[ℝ] F) :
    Function.HasTemperateGrowth f

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : E →L[ℝ] F)


theorem prec1 {f} (m : ℕ) (hf : Nat.Primrec f) :
    Nat.Primrec fun n => n.rec m fun y IH => f <| Nat.pair y IH

{f : ℕ → ℕ}
(m : ℕ)
(hf : Nat.Primrec f)

Nat.Primrec fun n => Nat.rec m (fun y IH => f (Nat.pair y IH)) n


theorem antideriv_cos_comp_const_mul (hz : z ≠ 0) (x : ℝ) :
    HasDerivAt (fun y : ℝ => Complex.sin (2 * z * y) / (2 * z)) (Complex.cos (2 * z * x)) x

HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x


/-- If `m` and `m'` are finite products in `M`, then so is `m * m'`, provided that `m'` is obtained
from a subsequence of `M` starting sufficiently late. -/
@[to_additive
      "If `m` and `m'` are finite sums in `M`, then so is `m + m'`, provided that `m'`
      is obtained from a subsequence of `M` starting sufficiently late."]
theorem FP.mul {M} [Semigroup M] {a : Stream' M} {m : M} (hm : m ∈ FP a) :
    ∃ n, ∀ m' ∈ FP (a.drop n), m * m' ∈ FP a

{M : Type u_1}
[AddSemigroup M]
{a : Stream' M}
{m : M}
(hm : m ∈ Hindman.FS a)

∃ n, ∀ m' ∈ Hindman.FS (Stream'.drop n a), m + m' ∈ Hindman.FS a


/-- The quotient map to `α ⧸ G` is measure-preserving between the restriction of `volume` to a
  fundamental domain in `α` and a related measure satisfying `QuotientMeasureEqMeasurePreimage`. -/
@[to_additive IsAddFundamentalDomain.measurePreserving_add_quotient_mk]
theorem IsFundamentalDomain.measurePreserving_quotient_mk
    {𝓕 : Set α} (h𝓕 : IsFundamentalDomain G 𝓕 ν)
    (μ : Measure (Quotient α_mod_G)) [QuotientMeasureEqMeasurePreimage ν μ] :
    MeasurePreserving π (ν.restrict 𝓕) μ

(h𝓕 : MeasureTheory.IsAddFundamentalDomain G 𝓕 ν)

(μ : MeasureTheory.Measure (Quotient (AddAction.orbitRel G α)))

MeasureTheory.MeasurePreserving (Quotient.mk (AddAction.orbitRel G α)) (ν.restrict 𝓕) μ


@[simp]
theorem pow_cast_right (a : Cardinal.{u}) (n : ℕ) : a ^ (↑n : Cardinal.{u}) = a ^ n


theorem HasSum.smul (hf : HasSum f s) (hg : HasSum g t)
    (hfg : Summable fun x : ι × κ ↦ f x.1 • g x.2) :
    HasSum (fun x : ι × κ ↦ f x.1 • g x.2) (s • t)

{ι : Type u_5}
{κ : Type u_6}
{R : Type u_7}
{M : Type u_9}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace R]
[TopologicalSpace M]
[T3Space M]
[ContinuousAdd M]
[ContinuousSMul R M]
{f : ι → R}
{g : κ → M}
{s : R}
{t : M}
(hf : HasSum f s)
(hg : HasSum g t)
(hfg : Summable fun x => f x.1 • g x.2)


@[to_additive (attr := simp)]
theorem pure_seq {f : α → β} {x : FreeSemigroup α} : pure f <*> x = f <$> x

{α β : Type u}
{f : α → β}
{x : FreeSemigroup α}

(Seq.seq (pure f) fun x_1 => x) = f <$> x


@[simp]
theorem equivOfEquiv_symm_comp_algebraMap (hSR : S ≃+* R) :
    ((equivOfEquiv L M hSR).symm : M →+* L).comp (algebraMap R M) =
      (algebraMap S L).comp hSR.symm

{R : Type u}
{S : Type u_3}
(L : Type v)
(M : Type w)
[CommRing R]
[CommRing S]
[Field L]
[Field M]
[Algebra R M]
[NoZeroSMulDivisors R M]
[IsAlgClosure R M]
[Algebra S L]
[NoZeroSMulDivisors S L]
[IsAlgClosure S L]
(hSR : S ≃+* R)

(↑(IsAlgClosure.equivOfEquiv L M hSR).symm).comp (algebraMap R M) = (algebraMap S L).comp ↑hSR.symm


@[simp] theorem and_pow_two_is_mod (x n : Nat) : x &&& (2^n-1) = x % 2^n


@[to_additive (attr := simp)]
theorem centralizer_univ : centralizer Set.univ = center M

AddSubsemigroup.centralizer Set.univ = AddSubsemigroup.center M


protected theorem strict_mono (hf : IsFundamentalSequence a o f) {i j} :
    ∀ hi hj, i < j → f i hi < f j hj

{f : (b : Ordinal.{u}) → b < o → Ordinal.{u}}


theorem mem_support_single (a a' : α) (b : M) : a ∈ (single a' b).support ↔ a = a' ∧ b ≠ 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
(a a' : α)
(b : M)

a ∈ (Finsupp.single a' b).support ↔ a = a' ∧ b ≠ 0


theorem tan_ne_zero_iff {θ : ℝ} : tan θ ≠ 0 ↔ ∀ k : ℤ, k * π / 2 ≠ θ

Real.tan θ ≠ 0 ↔ ∀ (k : ℤ), ↑k * Real.pi / 2 ≠ θ


@[simp]
theorem coe_mk (f : α → β) (h) : ⇑(⟨f, h⟩ : α →ᵈ β) = f

(h : ∃ r, r ≠ 0 ∧ ∀ (x y : α), edist (f x) (f y) = ↑r * edist x y)


theorem mul_def (e e' : E ≃ₗᵢ[R] E) : (e * e' : E ≃ₗᵢ[R] E) = e'.trans e

{R : Type u_1}
{E : Type u_5}
[Semiring R]
[SeminormedAddCommGroup E]
[Module R E]
(e e' : E ≃ₗᵢ[R] E)


/-- Basic hypothesis to talk about a smooth (Lie) monoid or a smooth semigroup.
A smooth monoid over `G`, for example, is obtained by requiring both the instances `Monoid G`
and `SmoothMul I G`. -/
@[to_additive]
class SmoothMul {𝕜 : Type*} [NontriviallyNormedField 𝕜] {H : Type*} [TopologicalSpace H]
    {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] (I : ModelWithCorners 𝕜 E H) (G : Type*)
    [Mul G] [TopologicalSpace G] [ChartedSpace H G] extends SmoothManifoldWithCorners I G :
    Prop where
  smooth_mul : Smooth (I.prod I) I fun p : G × G => p.1 * p.2

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Mul G]
[TopologicalSpace G]
[ChartedSpace H G]
[self : SmoothMul I G]


theorem continuousOn_stereoToFun :
    ContinuousOn (stereoToFun v) {x : E | innerSL _ v x ≠ (1 : ℝ)}

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{v : E}

ContinuousOn (stereoToFun v) {x | ((innerSL ℝ) v) x ≠ 1}


theorem eq_zero_of_not_dvd {n : ℕ} (h : ¬p ∣ n) : padicValNat p n = 0


theorem liftMonoidWithZeroHom_apply {L : Type*} [CommGroupWithZero L] (φ : K[X] →*₀ L)
    (hφ : K[X]⁰ ≤ L⁰.comap φ) (f : RatFunc K) :
    liftMonoidWithZeroHom φ hφ f = φ f.num / φ f.denom

{K : Type u}
[Field K]
{L : Type u_1}
[CommGroupWithZero L]
(φ : K[X] →*₀ L)
(hφ : K[X]⁰ ≤ Submonoid.comap φ L⁰)
(f : RatFunc K)

(RatFunc.liftMonoidWithZeroHom φ hφ) f = φ f.num / φ f.denom


/-- The square with `0 : 0 ⟶ 0` on the top and `𝟙 X` on the bottom is a pullback square. -/
@[simp]
theorem zero_top (X : C) : IsPullback (0 : (0 : C) ⟶ 0) (0 : 0 ⟶ X) (0 : 0 ⟶ X) (𝟙 X)


/-- `PInfty` induces a natural transformation, i.e. an endomorphism of
the functor `alternatingFaceMapComplex C`. -/
@[simps]
noncomputable def natTransPInfty : alternatingFaceMapComplex C ⟶ alternatingFaceMapComplex C

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

∀ (x : CategoryTheory.SimplicialObject C),
  (AlgebraicTopology.DoldKan.natTransPInfty C).app x = AlgebraicTopology.DoldKan.PInfty


theorem bsup_const {o : Ordinal.{u}} (ho : o ≠ 0) (a : Ordinal.{max u v}) :
    (bsup.{_, v} o fun _ _ => a) = a


/-- This lemma is impractical to state in the dependent case. -/
@[simp]
theorem reindex_symm (e : ι ≃ ι₂) :
    (reindex R (fun _ ↦ M) e).symm = reindex R (fun _ ↦ M) e.symm

{ι : Type u_1}
{ι₂ : Type u_2}
{R : Type u_4}
[CommSemiring R]
{M : Type u_8}
[AddCommMonoid M]
[Module R M]
(e : ι ≃ ι₂)

(PiTensorProduct.reindex R (fun x => M) e).symm = PiTensorProduct.reindex R (fun x => M) e.symm


theorem epi_snd_of_isLimit [Epi f] {s : PullbackCone f g} (hs : IsLimit s) : Epi s.snd

{s : CategoryTheory.Limits.PullbackCone f g}


/-- See `zero_lt_three'` for a version with the type explicit. -/
@[simp] lemma zero_lt_three : (0 : α) < 3

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


@[simp]
lemma functorPushforward_over_map {X Y : C} (f : X ⟶ Y) (Z : Over X) (S : Sieve Z.left) :
    Sieve.functorPushforward (Over.map f) ((Sieve.overEquiv Z).symm S) =
      (Sieve.overEquiv ((Over.map f).obj Z)).symm S

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
(f : X ⟶ Y)
(Z : CategoryTheory.Over X)
(S : CategoryTheory.Sieve Z.left)

CategoryTheory.Sieve.functorPushforward (CategoryTheory.Over.map f) ((CategoryTheory.Sieve.overEquiv Z).symm S) =
  (CategoryTheory.Sieve.overEquiv ((CategoryTheory.Over.map f).obj Z)).symm S


@[ext high]
theorem monoidWithZeroHom_ext ⦃f g : WithZero α →*₀ β⦄
    (h : f.toMonoidHom.comp coeMonoidHom = g.toMonoidHom.comp coeMonoidHom) :
    f = g

(h : (↑f).comp WithZero.coeMonoidHom = (↑g).comp WithZero.coeMonoidHom)


theorem sep_eq_of_subset (h : s ⊆ t) : { x ∈ t | x ∈ s } = s


lemma isFiniteMeasure [∀ i, IsFiniteMeasure (P i)] (hμ : IsProjectiveLimit μ P) :
    IsFiniteMeasure μ

{P : (J : Finset ι) → MeasureTheory.Measure ((j : { x // x ∈ J }) → α ↑j)}

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

[∀ (i : Finset ι), MeasureTheory.IsFiniteMeasure (P i)]

(hμ : MeasureTheory.IsProjectiveLimit μ P)


theorem ι_leftInverse : Function.LeftInverse ιInv (ι R : M → TensorAlgebra R M)

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

Function.LeftInverse ⇑TensorAlgebra.ιInv ⇑(TensorAlgebra.ι R)


/-- Given any adjunction `L ⊣ R`, there is a comparison functor `CategoryTheory.Monad.comparison R`
sending objects `Y : D` to Eilenberg-Moore algebras for `L ⋙ R` with underlying object `R.obj X`.

We later show that this is full when `R` is full, faithful when `R` is faithful,
and essentially surjective when `R` is reflective.
-/
@[simps]
def Monad.comparison (h : L ⊣ R) : D ⥤ h.toMonad.Algebra

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : CategoryTheory.Functor C D}
{R : CategoryTheory.Functor D C}
(h : L ⊣ R)
(X : D)

((CategoryTheory.Monad.comparison h).obj X).A = R.obj X


@[to_additive (attr := simp)]
protected theorem mul_inv_cancel : IsUnit a → a * a⁻¹ = 1


theorem supports_singleton {S q} : Supports {q} S ↔ TM2.SupportsStmt S (tr q)

{S : Finset Turing.PartrecToTM2.Λ'}
{q : Turing.PartrecToTM2.Λ'}

Turing.PartrecToTM2.Supports {q} S ↔ Turing.TM2.SupportsStmt S (Turing.PartrecToTM2.tr q)


@[to_additive]
theorem mem_map_equiv {f : G ≃* N} {K : Subgroup G} {x : N} :
    x ∈ K.map f.toMonoidHom ↔ f.symm x ∈ K

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G ≃+ N}
{K : AddSubgroup G}
{x : N}

x ∈ AddSubgroup.map f.toAddMonoidHom K ↔ f.symm x ∈ K


/-- Any descending central series for a group is bounded below by the lower central series. -/
theorem descending_central_series_ge_lower (H : ℕ → Subgroup G) (hH : IsDescendingCentralSeries H) :
    ∀ n : ℕ, lowerCentralSeries G n ≤ H n

{G : Type u_1}
[Group G]
(H : ℕ → Subgroup G)
(hH : IsDescendingCentralSeries H)
(n : ℕ)


theorem pos_of_mem_ball (hy : y ∈ ball x ε) : 0 < ε

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}
{ε : ℝ≥0∞}
(hy : y ∈ EMetric.ball x ε)


theorem mapsTo_ball (hf : Isometry f) (x : α) (r : ℝ) :
    MapsTo f (Metric.ball x r) (Metric.ball (f x) r)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{f : α → β}
(hf : Isometry f)
(x : α)
(r : ℝ)

Set.MapsTo f (Metric.ball x r) (Metric.ball (f x) r)


@[simp]
theorem closure_empty : closure (∅ : Set X) = ∅


@[simp] theorem zip_cons_cons : zip (a :: as) (b :: bs) = (a, b) :: zip as bs

∀ {α : Type u_1} {a : α} {as : List α} {α_1 : Type u_2} {b : α_1} {bs : List α_1},
  (a :: as).zip (b :: bs) = { fst := a, snd := b } :: as.zip bs


/-- `pred` commutes with `succAbove`. -/
lemma pred_succAbove_pred {a : Fin (n + 2)} {b : Fin (n + 1)} (ha : a ≠ 0) (hb : b ≠ 0)
    (hk := succAbove_ne_zero ha hb) :
    (a.pred ha).succAbove (b.pred hb) = (a.succAbove b).pred hk

{n : ℕ}
{a : Fin (n + 2)}
{b : Fin (n + 1)}
(ha : a ≠ 0)
(hb : b ≠ 0)
(hk : a.succAbove b ≠ 0 := ⋯)


@[simp] theorem not_or : ¬(p ∨ q) ↔ ¬p ∧ ¬q

¬(p ∨ q) ↔ ¬p ∧ ¬q


@[simp]
theorem adj_inj {G H : SimpleGraph V} : G.Adj = H.Adj ↔ G = H


lemma sheafCompose_reflects_discrete [(sheafCompose J U).ReflectsIsomorphisms]
    [((sheafCompose J U).obj F).IsDiscrete J ht] :
    F.IsDiscrete J ht

(J : CategoryTheory.GrothendieckTopology C)

(ht : CategoryTheory.Limits.IsTerminal t)

[CategoryTheory.Sheaf.IsDiscrete J ht ((CategoryTheory.sheafCompose J U).obj F)]


@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem mul [Mul β] [ContinuousMul β] (hf : StronglyMeasurable f)
    (hg : StronglyMeasurable g) : StronglyMeasurable (f * g)

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)

MeasureTheory.StronglyMeasurable (f + g)


protected theorem min_const [LinearOrder ι] {f : Filtration ι m} {τ : Ω → ι}
    (hτ : IsStoppingTime f τ) (i : ι) : IsStoppingTime f fun ω => min (τ ω) i

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
(hτ : MeasureTheory.IsStoppingTime f τ)
(i : ι)

MeasureTheory.IsStoppingTime f fun ω => min (τ ω) i


theorem IsBigO.mul {f₁ f₂ : α → R} {g₁ g₂ : α → 𝕜} (h₁ : f₁ =O[l] g₁) (h₂ : f₂ =O[l] g₂) :
    (fun x => f₁ x * f₂ x) =O[l] fun x => g₁ x * g₂ x

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


/-- The oriented angle between three points equals minus the unoriented angle if the sign is
negative. -/
theorem oangle_eq_neg_angle_of_sign_eq_neg_one {p₁ p₂ p₃ : P} (h : (∡ p₁ p₂ p₃).sign = -1) :
    ∡ p₁ p₂ p₃ = -∠ p₁ p₂ p₃

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


@[simp]
theorem id_comp (f : Q₁ →qᵢ Q₂) : (id Q₂).comp f = f

{R : Type u_2}
{M₁ : Type u_4}
{M₂ : Type u_5}
{N : Type u_8}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid N]
[Module R M₁]
[Module R M₂]
[Module R N]
{Q₁ : QuadraticMap R M₁ N}
{Q₂ : QuadraticMap R M₂ N}
(f : Q₁ →qᵢ Q₂)

(QuadraticMap.Isometry.id Q₂).comp f = f


theorem norm_sup_sub_sup_le_norm (x y z : α) : ‖x ⊔ z - y ⊔ z‖ ≤ ‖x - y‖

{α : Type u_1}
[NormedLatticeAddCommGroup α]
(x y z : α)


@[to_additive]
theorem NeBot.of_smul_filter : (a • f).NeBot → f.NeBot

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{f : Filter β}
{a : α}


theorem fract_eq_zero_or_add_one_sub_ceil (a : α) : fract a = 0 ∨ fract a = a + 1 - (⌈a⌉ : α)

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

Int.fract a = 0 ∨ Int.fract a = a + 1 - ↑⌈a⌉


theorem all_node' {P l x r} : @All α P (node' l x r) ↔ All P l ∧ P x ∧ All P r

{α : Type u_1}
{P : α → Prop}
{l : Ordnode α}
{x : α}
{r : Ordnode α}

Ordnode.All P (l.node' x r) ↔ Ordnode.All P l ∧ P x ∧ Ordnode.All P r


theorem modifyNth_eq_set_get? (f : α → α) :
    ∀ n (l : List α), l.modifyNth f n = ((fun a => l.set n (f a)) <$> l.get? n).getD l

{α : Type u_1}
(f : α → α)
(n : Nat)
(l : List α)

List.modifyNth f n l = ((fun a => l.set n (f a)) <$> l.get? n).getD l


@[simp]
theorem sup_inf_bihimp : (a ⊔ b) ⊓ a ⇔ b = a ⊓ b

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


@[simp]
theorem map_mul : (I * J).map g = I.map g * J.map g

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{P' : Type u_3}
[CommRing P']
[Algebra R P']
(I J : FractionalIdeal S P)
(g : P →ₐ[R] P')

FractionalIdeal.map g (I * J) = FractionalIdeal.map g I * FractionalIdeal.map g J


theorem eval_app (S₁ S₂ : SheafOfTypes.{u} typesGrothendieckTopology) (f : S₁ ⟶ S₂) (α : Type u)
    (s : S₁.1.obj (op α)) (x : α) :
    eval S₂.1 α (f.val.app (op α) s) x = f.val.app (op PUnit) (eval S₁.1 α s x)

(S₁ S₂ : CategoryTheory.SheafOfTypes CategoryTheory.typesGrothendieckTopology)

CategoryTheory.eval S₂.val α (f.val.app (Opposite.op α) s) x =
  f.val.app (Opposite.op PUnit.{u + 1}) (CategoryTheory.eval S₁.val α s x)


/-- A function applied to a `ite` is a `ite` of that function applied to each of the branches. -/
theorem apply_ite (f : α → β) (P : Prop) [Decidable P] (x y : α) :
    f (ite P x y) = ite P (f x) (f y)

{α : Sort u_1}
{β : Sort u_2}
(f : α → β)
(P : Prop)
[Decidable P]
(x y : α)

f (if P then x else y) = if P then f x else f y


theorem isOpenMap_sigmaMk {i : ι} : IsOpenMap (@Sigma.mk ι σ i)

{ι : Type u_5}
{σ : ι → Type u_7}
[(i : ι) → TopologicalSpace (σ i)]
{i : ι}


theorem conjugates_subset_normal {N : Subgroup G} [tn : N.Normal] {a : G} (h : a ∈ N) :
    conjugatesOf a ⊆ N

{G : Type u_1}
[Group G]
{N : Subgroup G}
[tn : N.Normal]
{a : G}
(h : a ∈ N)


@[to_additive]
theorem stronglyMeasurable_one {α β} {_ : MeasurableSpace α} [TopologicalSpace β] [One β] :
    StronglyMeasurable (1 : α → β)

∀ {x : MeasurableSpace α} [inst : TopologicalSpace β] [inst_1 : Zero β], MeasureTheory.StronglyMeasurable 0


nonrec theorem map_apply (hf : MeasurableEmbedding f) (μ : Measure α) (s : Set β) :
    μ.map f s = μ (f ⁻¹' s)

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
{m1 : MeasurableSpace β}
{f : α → β}
(hf : MeasurableEmbedding f)
(μ : MeasureTheory.Measure α)
(s : Set β)

(MeasureTheory.Measure.map f μ) s = μ (f ⁻¹' s)


theorem kstar_mul_le (hb : b ≤ c) (ha : a * c ≤ c) : a∗ * b ≤ c

{α : Type u_1}
[KleeneAlgebra α]
{a b c : α}
(hb : b ≤ c)
(ha : a * c ≤ c)


@[to_additive]
theorem coe_monoidHom_refl : (refl M : M →* M) = MonoidHom.id M


@[to_additive]
theorem denseRange_smul [IsMinimal M α] (x : α) : DenseRange fun c : M ↦ c • x

(M : Type u_1)
{α : Type u_3}
[AddMonoid M]
[TopologicalSpace α]
[AddAction M α]
[AddAction.IsMinimal M α]
(x : α)


theorem comp_nsmul (n : ℕ) : f ≫ (n • g) = n • f ≫ g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{P Q R : C}
(f : P ⟶ Q)
(g : Q ⟶ R)
(n : ℕ)


/-- `BipointedToPointed_fst` is inverse to `PointedToBipointed`. -/
@[simps!]
def pointedToBipointedCompBipointedToPointedFst :
    pointedToBipointed ⋙ bipointedToPointedFst ≅ 𝟭 _

(a : ((pointedToBipointed ⋙ bipointedToPointedFst).obj X).X)

(pointedToBipointedCompBipointedToPointedFst.hom.app X).toFun a = a


theorem Codisjoint.mono (h₁ : a ≤ b) (h₂ : c ≤ d) : Codisjoint a c → Codisjoint b d

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


/-- A left homology data for a short complex `S` induces a right homology data for `S.op`. -/
@[simps]
def op (h : S.LeftHomologyData) : S.op.RightHomologyData


theorem finiteInterClosure_finiteInter : FiniteInter (finiteInterClosure S)


@[to_additive (attr := simp)]
theorem coe_add : ⇑(p + q) = p + q

{E : Type u_4}
[AddGroup E]
(p q : AddGroupNorm E)


theorem divX_add : divX (p + q) = divX p + divX q


theorem _root_.Filter.HasBasis.compactConvergenceUniformity {ι : Type*} {pi : ι → Prop}
    {s : ι → Set (β × β)} (h : (𝓤 β).HasBasis pi s) :
    HasBasis (𝓤 C(α, β)) (fun p : Set α × ι => IsCompact p.1 ∧ pi p.2) fun p =>
      { fg : C(α, β) × C(α, β) | ∀ x ∈ p.1, (fg.1 x, fg.2 x) ∈ s p.2 }

{α : Type u₁}
{β : Type u₂}
[TopologicalSpace α]
[UniformSpace β]
{ι : Type u_1}
{pi : ι → Prop}
{s : ι → Set (β × β)}
(h : (𝓤 β).HasBasis pi s)

(𝓤 C(α, β)).HasBasis (fun p => IsCompact p.1 ∧ pi p.2) fun p => {fg | ∀ x ∈ p.1, (fg.1 x, fg.2 x) ∈ s p.2}


@[to_additive (attr := simp)]
theorem div_mul_mul_cancel (a b c : G) : a / c * (b * c) = a * b

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


@[simp]
theorem map_comp {f : S ⟶ S'} {f' : S' ⟶ S''} {h : StructuredArrow S'' T} :
    (map (f ≫ f')).obj h = (map f).obj ((map f').obj h)

{h : CategoryTheory.StructuredArrow S'' T}

(CategoryTheory.StructuredArrow.map (CategoryTheory.CategoryStruct.comp f f')).obj h =
  (CategoryTheory.StructuredArrow.map f).obj ((CategoryTheory.StructuredArrow.map f').obj h)


lemma IsSublattice.prod {t : Set β} (hs : IsSublattice s) (ht : IsSublattice t) :
    IsSublattice (s ×ˢ t)

{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
{s : Set α}
{t : Set β}
(hs : IsSublattice s)
(ht : IsSublattice t)


theorem implies_dep_congr_ctx {p₁ p₂ q₁ : Prop} (h₁ : p₁ = p₂) {q₂ : p₂ → Prop} (h₂ : (h : p₂) → q₁ = q₂ h) : (p₁ → q₁) = ((h : p₂) → q₂ h)

{p₁ p₂ q₁ : Prop}
(h₁ : p₁ = p₂)
{q₂ : p₂ → Prop}
(h₂ : ∀ (h : p₂), q₁ = q₂ h)


@[simp]
theorem ordConnectedComponent_ordConnectedProj (s : Set α) (x : s) :
    ordConnectedComponent s (ordConnectedProj s x) = ordConnectedComponent s x

{α : Type u_1}
[LinearOrder α]
(s : Set α)
(x : ↑s)

s.ordConnectedComponent (s.ordConnectedProj x) = s.ordConnectedComponent ↑x


@[simp]
theorem not_nil_right (r : α → α → Prop) (l : List α) : ¬Lex r l []

{α : Type u}
(r : α → α → Prop)
(l : List α)


theorem inl_aut (g : G) (n : N) : (inl (φ g n) : N ⋊[φ] G) = inr g * inl n * inr g⁻¹

{N : Type u_1}
{G : Type u_2}
[Group N]
[Group G]
{φ : G →* MulAut N}
(g : G)
(n : N)

SemidirectProduct.inl ((φ g) n) = SemidirectProduct.inr g * SemidirectProduct.inl n * SemidirectProduct.inr g⁻¹


@[to_additive zsmul_neg]
lemma inv_zpow (a : α) : ∀ n : ℤ, a⁻¹ ^ n = (a ^ n)⁻¹

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


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


lemma single_mul_right_apply (i j : ι) (f : ∀ i, α i) (a : α i) :
    single i (f i * a) j = f j * single i a j

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → MulZeroClass (α i)]
[DecidableEq ι]
(i j : ι)
(f : (i : ι) → α i)
(a : α i)

Pi.single i (f i * a) j = f j * Pi.single i a j


theorem mapDomain_comp {f : α → β} {g : β → γ} :
    mapDomain (g ∘ f) v = mapDomain g (mapDomain f v)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{M : Type u_5}
[AddCommMonoid M]
{v : α →₀ M}
{f : α → β}
{g : β → γ}

Finsupp.mapDomain (g ∘ f) v = Finsupp.mapDomain g (Finsupp.mapDomain f v)


/-- A set, considered as a subset of its spanned affine subspace, spans the whole subspace. -/
@[simp]
theorem affineSpan_coe_preimage_eq_top (A : Set P) [Nonempty A] :
    affineSpan k (((↑) : affineSpan k A → P) ⁻¹' A) = ⊤

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(A : Set P)
[Nonempty ↑A]


/-- The cofiltered limit of nonempty finite types is nonempty.

See `nonempty_sections_of_finite_inverse_system` for a specialization to inverse limits. -/
theorem nonempty_sections_of_finite_cofiltered_system {J : Type u} [Category.{w} J]
    [IsCofilteredOrEmpty J] (F : J ⥤ Type v) [∀ j : J, Finite (F.obj j)]
    [∀ j : J, Nonempty (F.obj j)] : F.sections.Nonempty

{J : Type u}
[CategoryTheory.Category.{w, u} J]
[CategoryTheory.IsCofilteredOrEmpty J]
(F : J ⥤ Type v)
[∀ (j : J), Finite (F.obj j)]
[∀ (j : J), Nonempty (F.obj j)]


theorem vsub_subset_vsub_right : s₁ ⊆ s₂ → s₁ -ᵥ t ⊆ s₂ -ᵥ t

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{s₁ s₂ t : Set β}

s₁ ⊆ s₂ → s₁ -ᵥ t ⊆ s₂ -ᵥ t


theorem inclusion_trans {R S T : Subgroupoid C} (k : R ≤ S) (h : S ≤ T) :
    inclusion (k.trans h) = inclusion k ⋙ inclusion h

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

CategoryTheory.Subgroupoid.inclusion ⋯ =
  (CategoryTheory.Subgroupoid.inclusion k).comp (CategoryTheory.Subgroupoid.inclusion h)


lemma eventually_deriv_one_sub_smoothingFn :
    deriv (fun x => 1 - ε x) =ᶠ[atTop] fun x => x⁻¹ / (log x ^ 2)

(deriv fun x => 1 - AkraBazziRecurrence.smoothingFn x) =ᶠ[Filter.atTop] fun x => x⁻¹ / Real.log x ^ 2


/-- The restriction of the Killing form to a Cartan subalgebra, as a linear equivalence to the
dual. -/
@[simps! apply_apply]
noncomputable def cartanEquivDual :
    H ≃ₗ[K] Module.Dual K H

{K : Type u_2}
{L : Type u_3}
[LieRing L]
[Field K]
[LieAlgebra K L]
[FiniteDimensional K L]
(H : LieSubalgebra K L)
[H.IsCartanSubalgebra]
[LieAlgebra.IsKilling K L]

∀ (a m : ↥H),
  ((LieAlgebra.IsKilling.cartanEquivDual H) a) m =
    (LinearMap.trace K L) ((LieModule.toEnd K (↥H) L) a * (LieModule.toEnd K (↥H) L) m)


@[simp]
theorem coe_mkContinuous (C : ℝ) (H : ∀ m, ‖f m‖ ≤ C * ∏ i, ‖m i‖) : ⇑(f.mkContinuous C H) = f

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

(H : ∀ (m : (i : ι) → E i), ‖f m‖ ≤ C * ∏ i : ι, ‖m i‖)


theorem isAtom_singleton (x : α) : IsAtom ({x} : Set α)


theorem Ioo_subset_Ioo (ha : a₂ ≤ a₁) (hb : b₁ ≤ b₂) : Ioo a₁ b₁ ⊆ Ioo a₂ b₂

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a₁ a₂ b₁ b₂ : α}
(ha : a₂ ≤ a₁)
(hb : b₁ ≤ b₂)


theorem isUnitTrinomial_iff'' (h : p * p.mirror = q * q.mirror) :
    p.IsUnitTrinomial ↔ q.IsUnitTrinomial

{p q : Polynomial ℤ}
(h : p * p.mirror = q * q.mirror)


theorem weightedSMul_null {s : Set α} (h_zero : μ s = 0) : (weightedSMul μ s : F →L[ℝ] F) = 0

{α : Type u_1}
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(h_zero : μ s = 0)


@[simp, norm_cast]
theorem coe_zero : ((0 : ℤ_[p]) : ℚ_[p]) = 0


/-- The iterated derivative of the composition with a linear map on the right is
obtained by composing the iterated derivative with the linear map. -/
theorem ContinuousLinearMap.iteratedFDeriv_comp_right (g : G →L[𝕜] E) {f : E → F}
    (hf : ContDiff 𝕜 n f) (x : G) {i : ℕ} (hi : (i : ℕ∞) ≤ n) :
    iteratedFDeriv 𝕜 i (f ∘ g) x =
      (iteratedFDeriv 𝕜 i f (g x)).compContinuousLinearMap fun _ => g

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ∞}
(g : G →L[𝕜] E)
{f : E → F}
(hf : ContDiff 𝕜 n f)
(x : G)
{i : ℕ}
(hi : ↑i ≤ n)

iteratedFDeriv 𝕜 i (f ∘ ⇑g) x = (iteratedFDeriv 𝕜 i f (g x)).compContinuousLinearMap fun x => g


theorem OrderBot.atBot_eq (α) [PartialOrder α] [OrderBot α] : (atBot : Filter α) = pure ⊥

(α : Type u_6)
[PartialOrder α]
[OrderBot α]


@[simp]
theorem intCast_apply [IntCast β] (n : ℤ) (x : α) : (n : C(α, β)) x = n

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[IntCast β]
(n : ℤ)
(x : α)


theorem isRoot_gcd_iff_isRoot_left_right [DecidableEq R] {f g : R[X]} {α : R} :
    (EuclideanDomain.gcd f g).IsRoot α ↔ f.IsRoot α ∧ g.IsRoot α

{R : Type u}
[Field R]
[DecidableEq R]
{f g : R[X]}
{α : R}


theorem delta_lt_false {a b : ℕ} (h₁ : delta * a < b) (h₂ : delta * b < a) : False

{a b : ℕ}
(h₁ : Ordnode.delta * a < b)
(h₂ : Ordnode.delta * b < a)


@[simp]
theorem reverse_foldl {l : List α} : reverse (foldl (fun t h => h :: t) [] l) = l

(List.foldl (fun t h => h :: t) [] l).reverse = l


/-- The natural homeomorphism between nonzero elements of a normed space `E`
and `Metric.sphere (0 : E) 1 × Set.Ioi (0 : ℝ)`.

The forward map sends `⟨x, hx⟩` to `⟨‖x‖⁻¹ • x, ‖x‖⟩`,
the inverse map sends `(x, r)` to `r • x`.

One may think about it as generalization of polar coordinates to any normed space. -/
@[simps apply_fst_coe apply_snd_coe symm_apply_coe]
noncomputable def homeomorphUnitSphereProd :
    ({0}ᶜ : Set E) ≃ₜ (sphere (0 : E) 1 × Ioi (0 : ℝ))

(x : ↑(Metric.sphere 0 1) × ↑(Set.Ioi 0))

↑((homeomorphUnitSphereProd E).symm x) = ↑x.2 • ↑x.1


theorem zero_ascFactorial : ∀ (k : ℕ), (0 : ℕ).ascFactorial k.succ = 0


@[to_additive (attr := simp)] lemma inv_symm_left_iff : SemiconjBy a⁻¹ y x ↔ SemiconjBy a x y

AddSemiconjBy (-a) y x ↔ AddSemiconjBy a x y


@[simp] theorem join_nil : List.join ([] : List (List α)) = []


@[to_additive]
protected theorem eq' {a₁ b₁} {a₂ b₂ : S} :
    f.mk' a₁ a₂ = f.mk' b₁ b₂ ↔ Localization.r S (a₁, a₂) (b₁, b₂)

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(f : S.LocalizationMap N)
{a₁ b₁ : M}
{a₂ b₂ : ↥S}

f.mk' a₁ a₂ = f.mk' b₁ b₂ ↔ (Localization.r S) (a₁, a₂) (b₁, b₂)


lemma _root_.Set.Countable.measure_restrict_compl (h : s.Countable) (μ : Measure α) [NoAtoms μ] :
    μ.restrict sᶜ = μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{s : Set α}
(h : s.Countable)
(μ : MeasureTheory.Measure α)
[MeasureTheory.NoAtoms μ]


theorem list_concat : Computable₂ fun l (a : α) => l ++ [a]


theorem braiding_naturality {X X' Y Y' : C} (f : X ⟶ Y) (g : X' ⟶ Y') :
    tensorHom ℬ f g ≫ (Limits.BinaryFan.braiding (ℬ Y Y').isLimit (ℬ Y' Y).isLimit).hom =
      (Limits.BinaryFan.braiding (ℬ X X').isLimit (ℬ X' X).isLimit).hom ≫ tensorHom ℬ g f

(ℬ : (X Y : C) → CategoryTheory.Limits.LimitCone (CategoryTheory.Limits.pair X Y))

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ f g)
    (CategoryTheory.Limits.BinaryFan.braiding (ℬ Y Y').isLimit (ℬ Y' Y).isLimit).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.BinaryFan.braiding (ℬ X X').isLimit (ℬ X' X).isLimit).hom
    (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ g f)


@[simp]
theorem divX_C (a : R) : divX (C a) = 0


/-- The canonical isomorphism `S.opcycles ≅ cokernel S.f`. -/
@[simps]
noncomputable def opcyclesIsoCokernel [HasCokernel S.f] : S.opcycles ≅ cokernel S.f

S.opcyclesIsoCokernel.inv = CategoryTheory.Limits.cokernel.desc S.f S.pOpcycles ⋯


theorem isAlgebraic_of_adjoin_eq_adjoin {α : E} {m n : ℕ} (hneq : m ≠ n)
    (heq : F⟮α ^ m⟯ = F⟮α ^ n⟯) : IsAlgebraic F α

(F : Type u_1)
(E : Type u_2)
[Field F]
[Field E]
[Algebra F E]
{α : E}
{m n : ℕ}
(hneq : m ≠ n)
(heq : F⟮α ^ m⟯ = F⟮α ^ n⟯)


@[to_additive (attr := simp)]
theorem smul_filter_eq_bot_iff : a • f = ⊥ ↔ f = ⊥

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f : Filter β}
{a : α}


/-- A sequentially continuous function defined on a sequential space is continuous. -/
protected theorem SeqContinuous.continuous [SequentialSpace X] {f : X → Y} (hf : SeqContinuous f) :
    Continuous f

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


protected theorem tendsto_atTop [Nonempty β] [SemilatticeSup β] {f : β → ℝ≥0∞} {a : ℝ≥0∞}
    (ha : a ≠ ∞) : Tendsto f atTop (𝓝 a) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, f n ∈ Icc (a - ε) (a + ε)

{β : Type u_2}
[Nonempty β]
[SemilatticeSup β]
{f : β → ℝ≥0∞}
{a : ℝ≥0∞}
(ha : a ≠ ⊤)

Filter.Tendsto f Filter.atTop (𝓝 a) ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, f n ∈ Set.Icc (a - ε) (a + ε)


@[to_additive]
theorem Equiv.hasProd_iff_of_mulSupport {g : γ → α} (e : mulSupport f ≃ mulSupport g)
    (he : ∀ x : mulSupport f, g (e x) = f x) : HasProd f a ↔ HasProd g a

(e : ↑(Function.support f) ≃ ↑(Function.support g))

(he : ∀ (x : ↑(Function.support f)), g ↑(e x) = f ↑x)


theorem isCoprime_one_left : IsCoprime 1 x


theorem single_ne_zero (h : r ≠ 0) : single a r ≠ 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{a : Γ}
{r : R}
(h : r ≠ 0)


theorem isCodetecting_empty_of_groupoid [∀ {X Y : C} (f : X ⟶ Y), IsIso f] :
    IsCodetecting (∅ : Set C)

[∀ {X Y : C} (f : X ⟶ Y), CategoryTheory.IsIso f]


theorem prod_top (s : Subring R) : s.prod (⊤ : Subring S) = s.comap (RingHom.fst R S)

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

s.prod ⊤ = Subring.comap (RingHom.fst R S) s


theorem image_eq_preimage (s : Set E) : e '' s = e.symm ⁻¹' s

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)
(s : Set E)


@[to_additive (attr := simp, norm_cast)]
theorem val_le_val [Monoid α] [Preorder α] {a b : αˣ} : (a : α) ≤ b ↔ a ≤ b

{α : Type u_1}
[Monoid α]
[Preorder α]
{a b : αˣ}

↑a ≤ ↑b ↔ a ≤ b


@[simp]
theorem isUnits_det_units (A : (Matrix n n α)ˣ) : IsUnit (A : Matrix n n α).det

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : (Matrix n n α)ˣ)


/-- A vector measure on a measurable space `α` is a σ-additive `M`-valued function (for some `M`
an add monoid) such that the empty set and non-measurable sets are mapped to zero. -/
structure VectorMeasure (α : Type*) [MeasurableSpace α] (M : Type*) [AddCommMonoid M]
    [TopologicalSpace M] where
  measureOf' : Set α → M
  empty' : measureOf' ∅ = 0
  not_measurable' ⦃i : Set α⦄ : ¬MeasurableSet i → measureOf' i = 0
  m_iUnion' ⦃f : ℕ → Set α⦄ : (∀ i, MeasurableSet (f i)) → Pairwise (Disjoint on f) →
    HasSum (fun i => measureOf' (f i)) (measureOf' (⋃ i, f i))

(self : MeasureTheory.VectorMeasure α M)


/-- The coproduct of the cofinite filters on two types is the cofinite filter on their product. -/
theorem coprod_cofinite : (cofinite : Filter α).coprod (cofinite : Filter β) = cofinite

Filter.cofinite.coprod Filter.cofinite = Filter.cofinite


/-- The arrow `A --dZero--> Fun(G, A)` is isomorphic to the differential
`(inhomogeneousCochains A).d 0 1` of the complex of inhomogeneous cochains of `A`. -/
@[simps! hom_left hom_right inv_left inv_right]
def dZeroArrowIso : Arrow.mk ((inhomogeneousCochains A).d 0 1) ≅
    Arrow.mk (ModuleCat.ofHom (dZero A))

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)

(groupCohomology.dZeroArrowIso A).hom.right = ↑(groupCohomology.oneCochainsLequiv A)


theorem lf_mk_of_le {x yl yr} {yL : yl → PGame} (yR) {i} : x ≤ yL i → x ⧏ mk yl yr yL yR

{x : SetTheory.PGame}
{yl yr : Type u_1}
{yL : yl → SetTheory.PGame}
(yR : yr → SetTheory.PGame)
{i : yl}

x ≤ yL i → x.LF (SetTheory.PGame.mk yl yr yL yR)


/-- The left fraction corresponding to a right fraction in the opposite category. -/
@[simps]
def RightFraction.unop {W : MorphismProperty Cᵒᵖ}
    {X Y : Cᵒᵖ} (φ : W.RightFraction X Y) :
    W.unop.LeftFraction (Opposite.unop Y) (Opposite.unop X)

{W : CategoryTheory.MorphismProperty Cᵒᵖ}


theorem castSucc_inj {a b : Fin n} : castSucc a = castSucc b ↔ a = b


theorem Ioo_add_bij : BijOn (· + d) (Ioo a b) (Ioo (a + d) (b + d))

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

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


theorem top_def [∀ i, Top (α' i)] : (⊤ : ∀ i, α' i) = fun _ => ⊤

{ι : Type u_3}
{α' : ι → Type u_4}
[(i : ι) → Top (α' i)]


/-- Turn a bounded lattice homomorphism from Boolean algebras `α` to `β` into a ring homomorphism
from `α` to `β` considered as Boolean rings. -/
@[simps]
protected def BoundedLatticeHom.asBoolRing (f : BoundedLatticeHom α β) :
    AsBoolRing α →+* AsBoolRing β

{α : Type u_1}
{β : Type u_2}
[BooleanAlgebra α]
[BooleanAlgebra β]
(f : BoundedLatticeHom α β)

∀ (a : AsBoolRing α), f.asBoolRing a = (⇑toBoolRing ∘ ⇑f ∘ ⇑ofBoolRing) a


/-- The functor from the canonical quotient of a path category of a category
to the original category. -/
@[simps!]
def quotientPathsTo : Quotient (pathsHomRel C) ⥤ C

(a b : CategoryTheory.Quotient (CategoryTheory.pathsHomRel C))

(CategoryTheory.quotientPathsTo C).map hf = Quot.liftOn hf (fun f => CategoryTheory.composePath f) ⋯


@[simp]
theorem getElem_cons_drop : ∀ (l : List α) (i : Nat) (h : i < l.length),
    l[i] :: drop (i + 1) l = drop i l

{α : Type u_1}
(l : List α)
(i : Nat)
(h : i < l.length)

l[i] :: List.drop (i + 1) l = List.drop i l


theorem eq_of_mem_of_mem {a : α} {o1 o2 : Option α} (h1 : a ∈ o1) (h2 : a ∈ o2) : o1 = o2

{α : Type u_1}
{a : α}
{o1 o2 : Option α}
(h1 : a ∈ o1)
(h2 : a ∈ o2)