theorem one_div_le (ha : 0 < a) (hb : 0 < b) : 1 / a ≤ b ↔ 1 / b ≤ a

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


lemma SMulPosMono.toSMulPosStrictMono [SMulPosMono α β] : SMulPosStrictMono α β

{α : Type u_1}
{β : Type u_2}
[Ring α]
[AddCommGroup β]
[Module α β]
[NoZeroSMulDivisors α β]
[PartialOrder α]
[PartialOrder β]
[SMulPosMono α β]


@[to_additive]
theorem of_mulEquivOfMulEquiv {k : LocalizationMap T Q} {j : M ≃* P} (H : S.map j.toMonoidHom = T) :
    (f.ofMulEquivOfLocalizations (f.mulEquivOfMulEquiv k H)).toMap = k.toMap.comp j.toMonoidHom

(H : AddSubmonoid.map j.toAddMonoidHom S = T)

(f.ofAddEquivOfLocalizations (f.addEquivOfAddEquiv k H)).toMap = k.toMap.comp j.toAddMonoidHom


theorem biprod.mapBiprod_inv_map_desc (f : X ⟶ W) (g : Y ⟶ W) :
    (F.mapBiprod X Y).inv ≫ F.map (biprod.desc f g) = biprod.desc (F.map f) (F.map g)

[CategoryTheory.Limits.PreservesBinaryBiproduct X Y F]

(F.mapBiprod X Y).inv ≫ F.map (CategoryTheory.Limits.biprod.desc f g) =
  CategoryTheory.Limits.biprod.desc (F.map f) (F.map g)


/-- `α ≃ β` is the type of functions from `α → β` with a two-sided inverse. -/
structure Equiv (α : Sort*) (β : Sort _) where
  protected toFun : α → β
  protected invFun : β → α
  protected left_inv : LeftInverse invFun toFun
  protected right_inv : RightInverse invFun toFun

{α : Sort u_1}
{β : Sort u_2}
(self : α ≃ β)


theorem orthonormal_iUnion_of_directed {η : Type*} {s : η → Set E} (hs : Directed (· ⊆ ·) s)
    (h : ∀ i, Orthonormal 𝕜 (fun x => x : s i → E)) :
    Orthonormal 𝕜 (fun x => x : (⋃ i, s i) → E)

(hs : Directed (fun x x_1 => x ⊆ x_1) s)

(h : ∀ (i : η), Orthonormal 𝕜 fun x => ↑x)


/-- Pointwise infimum of two antitone functions is an antitone function. -/
protected theorem inf [Preorder α] [SemilatticeInf β] {f g : α → β} {s : Set α}
    (hf : AntitoneOn f s) (hg : AntitoneOn g s) : AntitoneOn (f ⊓ g) s

{α : Type u}
{β : Type v}
[Preorder α]
[SemilatticeInf β]
{f g : α → β}
{s : Set α}
(hf : AntitoneOn f s)
(hg : AntitoneOn g s)


@[simp]
theorem quot_mk_eq_mk (f : α → β) (hf) :
    (Quot.mk (@Setoid.r _ <| μ.aeEqSetoid β) ⟨f, hf⟩ : α →ₘ[μ] β) = mk f hf

(hf : MeasureTheory.AEStronglyMeasurable f μ)

Quot.mk Setoid.r ⟨f, hf⟩ = MeasureTheory.AEEqFun.mk f hf


@[simp]
theorem Set.monotone_mem : Monotone (· ∈ s) ↔ IsUpperSet s

(Monotone fun x => x ∈ s) ↔ IsUpperSet s


@[simp]
theorem ratio_trans (e : X ≃ᵈ Y) (e' : Y ≃ᵈ Z) : ratio (e.trans e') = ratio e * ratio e'

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
[PseudoEMetricSpace Z]
(e : X ≃ᵈ Y)
(e' : Y ≃ᵈ Z)

Dilation.ratio (e.trans e') = Dilation.ratio e * Dilation.ratio e'


/-- An indexed family of points that is injective on the given
`Finset` has the same centroid as the image of that `Finset`.  This is
stated in terms of a set equal to the image to provide control of
definitional equality for the index type used for the centroid of the
image. -/
theorem centroid_eq_centroid_image_of_inj_on {p : ι → P}
    (hi : ∀ i ∈ s, ∀ j ∈ s, p i = p j → i = j) {ps : Set P} [Fintype ps]
    (hps : ps = p '' ↑s) : s.centroid k p = (univ : Finset ps).centroid k fun x => (x : P)

Finset.centroid k s p = Finset.centroid k Finset.univ fun x => ↑x


lemma mk (L : C ⥤ D) [L.IsLocalization W] (h : L.map f = L.map g) :
    AreEqualizedByLocalization W f g

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
(W : CategoryTheory.MorphismProperty C)
{X Y : C}
(f g : X ⟶ Y)
(L : CategoryTheory.Functor C D)
[L.IsLocalization W]
(h : L.map f = L.map g)

CategoryTheory.AreEqualizedByLocalization W f g


theorem lieSpan_mono {t : Set L} (h : s ⊆ t) : lieSpan R L s ≤ lieSpan R L t

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{s t : Set L}
(h : s ⊆ t)

LieSubalgebra.lieSpan R L s ≤ LieSubalgebra.lieSpan R L t


@[simp] lemma toNat_beq_zero (b : Bool) : (b.toNat == 0) = !b


theorem Nat.geom_sum_Ico_le {b : ℕ} (hb : 2 ≤ b) (a n : ℕ) :
    ∑ i ∈ Ico 1 n, a / b ^ i ≤ a / (b - 1)

∑ i ∈ Finset.Ico 1 n, a / b ^ i ≤ a / (b - 1)


@[to_additive]
theorem normalizer_eq_top : H.normalizer = ⊤ ↔ H.Normal

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


theorem irreducible_mul_units (a : αˣ) (b : α) : Irreducible (b * ↑a) ↔ Irreducible b

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


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

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


lemma frequently_cofinite_mem_iff_infinite {s : Set α} : (∃ᶠ x in cofinite, x ∈ s) ↔ s.Infinite

(∃ᶠ (x : α) in Filter.cofinite, x ∈ s) ↔ s.Infinite


@[simp, norm_cast]
theorem coe_centralizer {R} [NonUnitalSemiring R] (s : Set R) :
    (centralizer s : Set R) = s.centralizer

{R : Type u_1}
[NonUnitalSemiring R]
(s : Set R)

↑(NonUnitalSubsemiring.centralizer s) = s.centralizer


@[simp]
theorem wbtw_const_vadd_iff {x y z : P} (v : V) :
    Wbtw R (v +ᵥ x) (v +ᵥ y) (v +ᵥ z) ↔ Wbtw R x y z

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


theorem disjUnion_tag_of_mem_right (h : Disjoint π₁.iUnion π₂.iUnion) (hJ : J ∈ π₂) :
    (π₁.disjUnion π₂ h).tag J = π₂.tag J

{π₁ π₂ : BoxIntegral.TaggedPrepartition I}


protected theorem differentiableOn_aeval : DifferentiableOn 𝕜 (fun x => aeval x q) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{s : Set 𝕜}
{R : Type u_1}
[CommSemiring R]
[Algebra R 𝕜]
(q : R[X])

DifferentiableOn 𝕜 (fun x => (Polynomial.aeval x) q) s


/-- Casting out of `SignType` respects composition with functions preserving `0, 1, -1`. -/
lemma map_cast' {β : Type*} [One β] [Neg β] [Zero β]
    (f : α → β) (h₁ : f 1 = 1) (h₂ : f 0 = 0) (h₃ : f (-1) = -1) (s : SignType) :
    f s = s

{α : Type u_1}
[Zero α]
[One α]
[Neg α]
{β : Type u_2}
[One β]
[Neg β]
[Zero β]
(f : α → β)
(h₁ : f 1 = 1)
(h₂ : f 0 = 0)
(h₃ : f (-1) = -1)
(s : SignType)


lemma tilted_zero (μ : Measure α) [IsProbabilityMeasure μ] : μ.tilted 0 = μ

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


/-- The identity map between `R` and `PreQuasiregular R`. -/
@[simps]
def equiv : R ≃ PreQuasiregular R

{R : Type u_1}
(self : PreQuasiregular R)

PreQuasiregular.equiv.symm self = self.val


theorem NonTorsionWeight.ne_zero [NonTorsionWeight w] (s : σ) :
    w s ≠ 0

{σ : Type u_1}
{M : Type u_2}
(w : σ → M)
[AddCommMonoid M]
[Finsupp.NonTorsionWeight w]
(s : σ)


/-- The backward direction of the equivalence from algebras for the coproduct monad to the under
category.
-/
@[simps]
def underToAlgebra : Under X ⥤ Monad.Algebra (coprodMonad X)

((CategoryTheory.underToAlgebra X).obj f).a =
  CategoryTheory.Limits.coprod.desc f.hom (CategoryTheory.CategoryStruct.id f.right)


@[simp]
theorem adjugate_pow (A : Matrix n n α) (k : ℕ) : adjugate (A ^ k) = adjugate A ^ k

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


@[trans]
theorem IsTheta.trans_isLittleO {f : α → E} {g : α → F'} {k : α → G} (h₁ : f =Θ[l] g)
    (h₂ : g =o[l] k) : f =o[l] k

{α : Type u_1}
{E : Type u_3}
{G : Type u_5}
{F' : Type u_7}
[Norm E]
[Norm G]
[SeminormedAddCommGroup F']
{l : Filter α}
{f : α → E}
{g : α → F'}
{k : α → G}
(h₁ : f =Θ[l] g)
(h₂ : g =o[l] k)


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


@[simp]
lemma shiftFunctorAdd_eq (a b : ℤ) :
    CategoryTheory.shiftFunctorAdd (Triangle C) a b =
      Triangle.shiftFunctorAdd' C a b _ rfl

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

CategoryTheory.shiftFunctorAdd (CategoryTheory.Pretriangulated.Triangle C) a b =
  CategoryTheory.Pretriangulated.Triangle.shiftFunctorAdd' C a b (a + b) ⋯


theorem inner_self_ne_zero {x : E} : ⟪x, x⟫ ≠ 0 ↔ x ≠ 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{x : E}


theorem toPGame_le {a b : Ordinal} (h : a ≤ b) : a.toPGame ≤ b.toPGame


theorem im_T_zpow_smul (n : ℤ) : (T ^ n • z).im = z.im


theorem smallSets_comap (l : Filter β) (f : α → β) :
    (comap f l).smallSets = l.lift' (powerset ∘ preimage f)

{α : Type u_1}
{β : Type u_2}
(l : Filter β)
(f : α → β)

(Filter.comap f l).smallSets = l.lift' (Set.powerset ∘ Set.preimage f)


theorem add_eq_left {a b : Cardinal} (ha : ℵ₀ ≤ a) (hb : b ≤ a) : a + b = a

{a b : Cardinal.{u_1}}
(ha : ℵ₀ ≤ a)
(hb : b ≤ a)


/-- A version of **Bolzano-Weierstrass**: in a proper metric space (eg. $ℝ^n$),
every bounded sequence has a converging subsequence. -/
theorem tendsto_subseq_of_bounded (hs : IsBounded s) {x : ℕ → X} (hx : ∀ n, x n ∈ s) :
    ∃ a ∈ closure s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (x ∘ φ) atTop (𝓝 a)

{X : Type u_1}
[PseudoMetricSpace X]
[ProperSpace X]
{s : Set X}
(hs : Bornology.IsBounded s)
{x : ℕ → X}
(hx : ∀ (n : ℕ), x n ∈ s)

∃ a ∈ closure s, ∃ φ, StrictMono φ ∧ Filter.Tendsto (x ∘ φ) Filter.atTop (𝓝 a)


/-- A characterization lemma for the scalar multiplication on the Ore localization,
allowing for a choice of Ore numerator and Ore denominator. -/
@[to_additive "A characterization lemma for the vector addition on the Ore localization,
allowing for a choice of Ore minuend and Ore subtrahend."]
theorem oreDiv_smul_char (r₁ : R) (r₂ : X) (s₁ s₂ : S) (r' : R) (s' : S) (huv : s' * r₁ = r' * s₂) :
    (r₁ /ₒ s₁) • (r₂ /ₒ s₂) = r' • r₂ /ₒ (s' * s₁)

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
{X : Type u_2}
[AddAction R X]
(r₁ : R)
(r₂ : X)
(s₁ s₂ : ↥S)
(r' : R)
(s' : ↥S)
(huv : ↑s' + r₁ = r' + ↑s₂)

r₁ -ₒ s₁ +ᵥ (r₂ -ₒ s₂) = r' +ᵥ r₂ -ₒ (s' + s₁)


theorem ortho_comm {x y} : IsOrtho B x y ↔ IsOrtho B y x

{R : Type u_1}
{R₁ : Type u_2}
{M : Type u_5}
{M₁ : Type u_6}
[CommSemiring R]
[AddCommGroup M]
[Module R M]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
{I₁ I₂ : R₁ →+* R}
{B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M}
(H : B.IsAlt)
{x y : M₁}


theorem comap_embedding_atTop [Preorder β] [Preorder γ] {e : β → γ}
    (hm : ∀ b₁ b₂, e b₁ ≤ e b₂ ↔ b₁ ≤ b₂) (hu : ∀ c, ∃ b, c ≤ e b) : comap e atTop = atTop

(hm : ∀ (b₁ b₂ : β), e b₁ ≤ e b₂ ↔ b₁ ≤ b₂)

Filter.comap e Filter.atTop = Filter.atTop


theorem mem_iff_get (v : Vector α n) : a ∈ v.toList ↔ ∃ i, v.get i = a

{α : Type u_1}
{n : ℕ}
(a : α)
(v : Mathlib.Vector α n)


/-- Updating a nonzero element and taking the tail commute. -/
@[simp]
theorem tail_update_succ : tail (update q i.succ y) = update (tail q) i y

{n : ℕ}
{α : Fin (n + 1) → Type u}
(q : (i : Fin (n + 1)) → α i)
(i : Fin n)
(y : α i.succ)

Fin.tail (Function.update q i.succ y) = Function.update (Fin.tail q) i y


@[to_additive]
theorem prod_ofFn {n : ℕ} {f : Fin n → α} : (ofFn f).prod = ∏ i, f i

{α : Type u_1}
[CommMonoid α]
{n : ℕ}
{f : Fin n → α}


/-- A version of `measurable_const` that assumes `f x = f y` for all `x, y`. This version works
for functions between empty types. -/
theorem measurable_const' {f : β → α} (hf : ∀ x y, f x = f y) : Measurable f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{f : β → α}
(hf : ∀ (x y : β), f x = f y)


theorem continuousAt_rpow_const {x : ℝ≥0} {y : ℝ} (h : x ≠ 0 ∨ 0 ≤ y) :
    ContinuousAt (fun z => z ^ y) x


/-- Combine two `PartialEquiv`s with disjoint sources and disjoint targets. We reuse
`PartialEquiv.piecewise`, then override `source` and `target` to ensure better definitional
equalities. -/
@[simps! (config := .asFn)]
def disjointUnion (e e' : PartialEquiv α β) (hs : Disjoint e.source e'.source)
    (ht : Disjoint e.target e'.target) [∀ x, Decidable (x ∈ e.source)]
    [∀ y, Decidable (y ∈ e.target)] : PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
(e e' : PartialEquiv α β)
(hs : Disjoint e.source e'.source)
(ht : Disjoint e.target e'.target)
[(x : α) → Decidable (x ∈ e.source)]
[(y : β) → Decidable (y ∈ e.target)]

(e.disjointUnion e' hs ht).target = e.target ∪ e'.target


@[simp]
theorem bot_eq_zero : (⊥ : Ordinal) = 0


/-- A submodule has dimension at most `1` if and only if there is a
single vector in the submodule such that the submodule is contained in
its span. -/
theorem rank_submodule_le_one_iff (s : Submodule K V) [Module.Free K s] :
    Module.rank K s ≤ 1 ↔ ∃ v₀ ∈ s, s ≤ K ∙ v₀

{K : Type u}
{V : Type v}
[Ring K]
[StrongRankCondition K]
[AddCommGroup V]
[Module K V]
(s : Submodule K V)
[Module.Free K ↥s]

Module.rank K ↥s ≤ 1 ↔ ∃ v₀ ∈ s, s ≤ Submodule.span K {v₀}


@[simp]
theorem symm_trans_self (e : α ≃o β) : e.symm.trans e = OrderIso.refl β

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
(e : α ≃o β)


protected theorem of_edist_le (h : ∀ x y, edist (f x) (f y) ≤ edist x y) : LipschitzWith 1 f

(h : ∀ (x y : α), edist (f x) (f y) ≤ edist x y)


@[to_additive]
theorem ker_eq_bot_of_mono [Mono f] : f.ker = ⊥

{A B : Grp}
(f : A ⟶ B)
[CategoryTheory.Mono f]


@[to_additive (attr := simp) mod_card_nsmul]
lemma pow_mod_card (a : G) (n : ℕ) : a ^ (n % card G) = a ^ n

{G : Type u_1}
[Group G]
[Fintype G]
(a : G)
(n : ℕ)


protected theorem ne_iff_lt_or_gt {a b : Nat} : a ≠ b ↔ a < b ∨ b < a


theorem integrable_cexp_neg_mul_sq_add_real_mul_I (hb : 0 < b.re) (c : ℝ) :
    Integrable fun x : ℝ => cexp (-b * (x + c * I) ^ 2)

MeasureTheory.Integrable (fun x => cexp (-b * (↑x + ↑c * Complex.I) ^ 2)) MeasureTheory.volume


@[simp, norm_cast]
theorem coe_sigma (s : Finset ι) (t : ∀ i, Finset (α i)) :
    (s.sigma t : Set (Σ i, α i)) = (s : Set ι).sigma fun i ↦ (t i : Set (α i))

{ι : Type u_1}
{α : ι → Type u_2}
(s : Finset ι)
(t : (i : ι) → Finset (α i))

↑(s.sigma t) = (↑s).sigma fun i => ↑(t i)


theorem isPositive_iff_complex (T : E' →L[ℂ] E') :
    IsPositive T ↔ ∀ x, (re ⟪T x, x⟫_ℂ : ℂ) = ⟪T x, x⟫_ℂ ∧ 0 ≤ re ⟪T x, x⟫_ℂ

{E' : Type u_4}
[NormedAddCommGroup E']
[InnerProductSpace ℂ E']
[CompleteSpace E']
(T : E' →L[ℂ] E')

T.IsPositive ↔ ∀ (x : E'), ↑(RCLike.re ⟪T x, x⟫_ℂ) = ⟪T x, x⟫_ℂ ∧ 0 ≤ RCLike.re ⟪T x, x⟫_ℂ


theorem norm_smul_le (r : α) (x : β) : ‖r • x‖ ≤ ‖r‖ * ‖x‖

{α : Type u_1}
{β : Type u_2}
[SeminormedAddGroup α]
[SeminormedAddGroup β]
[SMulZeroClass α β]
[BoundedSMul α β]
(r : α)
(x : β)

‖r • x‖ ≤ ‖r‖ * ‖x‖


@[simp]
theorem coe_eq_bot_iff (Q : AffineSubspace k P) : (Q : Set P) = ∅ ↔ Q = ⊥

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
(Q : AffineSubspace k P)

↑Q = ∅ ↔ Q = ⊥


/-- The functor `(F ⋙ G, S) ⥤ (G, S)`. -/
@[simps!]
def pre (F : B ⥤ C) (G : C ⥤ D) (S : D) : CostructuredArrow (F ⋙ G) S ⥤ CostructuredArrow G S

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

∀ {X Y : CategoryTheory.Comma (F.comp G) (CategoryTheory.Functor.fromPUnit S)} (f : X ⟶ Y),
  ((CategoryTheory.CostructuredArrow.pre F G S).map f).left = F.map f.left


/-- Given two orthogonal vectors, their sum and difference have equal norms. -/
theorem norm_sub_eq_norm_add {v w : E} (h : ⟪v, w⟫ = 0) : ‖w - v‖ = ‖w + v‖

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{v w : E}
(h : ⟪v, w⟫_𝕜 = 0)


theorem zpow_le_max_of_min_le {x : α} (hx : 1 ≤ x) {a b c : ℤ} (h : min a b ≤ c) :
    x ^ (-c) ≤ max (x ^ (-a)) (x ^ (-b))

{α : Type u_1}
[LinearOrderedSemifield α]
{x : α}
(hx : 1 ≤ x)
{a b c : ℤ}
(h : min a b ≤ c)


theorem tan_eq_sin_div_cos (θ : Angle) : tan θ = sin θ / cos θ


theorem map_nhds_eq : map φ.leftFun (𝓝 φ.pt) = 𝓝 (φ.leftFun φ.pt)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[CompleteSpace G]
(φ : ImplicitFunctionData 𝕜 E F G)

Filter.map φ.leftFun (𝓝 φ.pt) = 𝓝 (φ.leftFun φ.pt)


theorem isSkewAdjoint_iff_neg_self_adjoint (f : Module.End R₁ M₁) :
    B₁.IsSkewAdjoint f ↔ IsAdjointPair (-B₁) B₁ f f

{R₁ : Type u_3}
{M₁ : Type u_4}
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
(B₁ : LinearMap.BilinForm R₁ M₁)
(f : Module.End R₁ M₁)

B₁.IsSkewAdjoint f ↔ (-B₁).IsAdjointPair B₁ f f


(X : CategoryTheory.Comma (F.comp G) (CategoryTheory.Functor.fromPUnit S))

((CategoryTheory.CostructuredArrow.pre F G S).obj X).right = X.right


@[simp]
theorem cons_ndinter_of_mem {a : α} (s : Multiset α) {t : Multiset α} (h : a ∈ t) :
    ndinter (a ::ₘ s) t = a ::ₘ ndinter s t

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


@[simp]
theorem normUnit_eq_one (x : α) : normUnit x = 1

{α : Type u_1}
[CancelCommMonoidWithZero α]
[Unique αˣ]
(x : α)


theorem Memℒp.smul_measure {f : α → E} {c : ℝ≥0∞} (hf : Memℒp f p μ) (hc : c ≠ ∞) :
    Memℒp f p (c • μ)

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : α → E}
{c : ℝ≥0∞}
(hf : MeasureTheory.Memℒp f p μ)
(hc : c ≠ ⊤)


/-- The first isomorphism theorem for morphisms of Lie algebras. -/
@[simps]
noncomputable def quotKerEquivRange : (L ⧸ f.ker) ≃ₗ⁅R⁆ f.range

{R : Type u_1}
{L : Type u_2}
{L' : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
(f : L →ₗ⁅R⁆ L')
(a : L ⧸ LinearMap.ker ↑f)

f.quotKerEquivRange a = (↑f).quotKerEquivRange a


@[simp]
lemma mem_map {f : R →+* S} {s : Subsemiring R} {y : S} : y ∈ s.map f ↔ ∃ x ∈ s, f x = y

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
{f : R →+* S}
{s : Subsemiring R}
{y : S}

y ∈ Subsemiring.map f s ↔ ∃ x ∈ s, f x = y


theorem le_inv_iff_le_inv : a ≤ b⁻¹ ↔ b ≤ a⁻¹

a ≤ b⁻¹ ↔ b ≤ a⁻¹


@[simp]
theorem dist_same (i : ι) (x y : E i) : dist (Sigma.mk i x) ⟨i, y⟩ = dist x y

{ι : Type u_1}
{E : ι → Type u_2}
[(i : ι) → MetricSpace (E i)]
(i : ι)
(x y : E i)


@[to_additive]
theorem mul_le_mul_three [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c d e f : α} (h₁ : a ≤ d) (h₂ : b ≤ e)
    (h₃ : c ≤ f) :
    a * b * c ≤ d * e * f

[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]


@[to_additive (attr := simp)]
theorem symm_trans_apply (e₁ : M ≃* N) (e₂ : N ≃* P) (p : P) :
    (e₁.trans e₂).symm p = e₁.symm (e₂.symm p)

{M : Type u_6}
{N : Type u_7}
{P : Type u_8}
[Mul M]
[Mul N]
[Mul P]
(e₁ : M ≃* N)
(e₂ : N ≃* P)
(p : P)


lemma IsGLB.exists_of_not_isPredLimit (hf : IsGLB (Set.range f) x) (hx : ¬ IsPredLimit x) :
    ∃ i, f i = x

{ι : Type u_1}
{α : Type u_2}
[CompleteLinearOrder α]
{f : ι → α}
{x : α}
(hf : IsGLB (Set.range f) x)
(hx : ¬Order.IsPredLimit x)


@[simp]
theorem assoc_tmul (m : M) (n : N) (p : P) :
    (TensorProduct.assoc R M N P) (m ⊗ₜ n ⊗ₜ p) = m ⊗ₜ (n ⊗ₜ p)

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(m : M)
(n : N)
(p : P)

(TensorProduct.assoc R M N P) ((m ⊗ₜ[R] n) ⊗ₜ[R] p) = m ⊗ₜ[R] n ⊗ₜ[R] p


theorem norm_integral_le_abs_integral_norm : ‖∫ x in a..b, f x ∂μ‖ ≤ |∫ x in a..b, ‖f x‖ ∂μ|

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b : ℝ}
{f : ℝ → E}
{μ : MeasureTheory.Measure ℝ}

‖∫ (x : ℝ) in a..b, f x ∂μ‖ ≤ |∫ (x : ℝ) in a..b, ‖f x‖ ∂μ|


protected theorem zero_ne_one : 0 ≠ (1 : Nat)


theorem card_of_subsingleton (a : α) [Subsingleton α] : Nat.card α = 1


@[simp]
theorem mul_aleph0_eq {a : Cardinal} (ha : ℵ₀ ≤ a) : a * ℵ₀ = a


/-- `∏ i, (f i - g i) = (∏ i, f i) - ∑ i, g i * (∏ j < i, f j - g j) * (∏ j > i, f j)`. -/
lemma prod_sub_ordered [LinearOrder ι] (s : Finset ι) (f g : ι → α) :
    ∏ i ∈ s, (f i - g i) =
      (∏ i ∈ s, f i) -
        ∑ i ∈ s,
          g i * (∏ j ∈ s.filter (· < i), (f j - g j)) * ∏ j ∈ s.filter fun j => i < j, f j

{ι : Type u_1}
{α : Type u_2}
[CommRing α]
[LinearOrder ι]
(s : Finset ι)
(f g : ι → α)

∏ i ∈ s, (f i - g i) =
  ∏ i ∈ s, f i -
    ∑ i ∈ s, (g i * ∏ j ∈ Finset.filter (fun x => x < i) s, (f j - g j)) * ∏ j ∈ Finset.filter (fun j => i < j) s, f j


theorem PLift.eq_up_iff_down_eq {x : PLift α} {y : α} : x = PLift.up y ↔ x.down = y


/-- Technical lemma to prove that candidates are Lipschitz -/
private theorem candidates_lipschitz_aux (fA : f ∈ candidates X Y) :
    f (x, y) - f (z, t) ≤ 2 * maxVar X Y * dist (x, y) (z, t)

(fA : f ∈ GromovHausdorff.candidates X Y)

f (x, y) - f (z, t) ≤ 2 * ↑(GromovHausdorff.maxVar X Y) * dist (x, y) (z, t)


theorem ne_of_not_le [Preorder α] {a b : α} (h : ¬a ≤ b) : a ≠ b

{α : Type u_2}
[Preorder α]
{a b : α}
(h : ¬a ≤ b)


/-- Drop the augmentation. -/
@[simps!]
def drop : Augmented C ⥤ CosimplicialObject C

(X : CategoryTheory.Comma (CategoryTheory.CosimplicialObject.const C) (𝟭 (CategoryTheory.CosimplicialObject C)))

CategoryTheory.CosimplicialObject.Augmented.drop.obj X = X.right


theorem HasDerivAt.sinh (hf : HasDerivAt f f' x) :
    HasDerivAt (fun x => Real.sinh (f x)) (Real.cosh (f x) * f') x

{f : ℝ → ℝ}
{f' x : ℝ}
(hf : HasDerivAt f f' x)


@[simp]
theorem round_sub_nat (x : α) (y : ℕ) : round (x - y) = round x - y

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(x : α)
(y : ℕ)


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

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

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


@[simp]
theorem pi_empty_univ {α : Type*} [Fintype α] [IsEmpty α] {β : α → Type*}
    {m : ∀ α, MeasurableSpace (β α)} (μ : ∀ a : α, Measure (β a)) :
    Measure.pi μ (Set.univ) = 1

(μ : (a : α) → MeasureTheory.Measure (β a))

(MeasureTheory.Measure.pi μ) Set.univ = 1


theorem Memℒp.norm_rpow_div {f : α → E} (hf : Memℒp f p μ) (q : ℝ≥0∞) :
    Memℒp (fun x : α => ‖f x‖ ^ q.toReal) (p / q) μ

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

MeasureTheory.Memℒp (fun x => ‖f x‖ ^ q.toReal) (p / q) μ


@[to_additive]
theorem prod_pair [DecidableEq α] {a b : α} (h : a ≠ b) :
    (∏ x ∈ ({a, b} : Finset α), f x) = f a * f b

{α : Type u_3}
{β : Type u_4}
{f : α → β}
[CommMonoid β]
[DecidableEq α]
{a b : α}
(h : a ≠ b)


theorem map_add (t₁ t₂ : τ) (x : α) : ϕ (t₁ + t₂) x = ϕ t₁ (ϕ t₂ x)

{τ : Type u_1}
[AddMonoid τ]
[TopologicalSpace τ]
[ContinuousAdd τ]
{α : Type u_2}
[TopologicalSpace α]
(ϕ : Flow τ α)
(t₁ t₂ : τ)
(x : α)

ϕ.toFun (t₁ + t₂) x = ϕ.toFun t₁ (ϕ.toFun t₂ x)


theorem isCoprime_tfae : TFAE [IsCoprime I J, Codisjoint I J, I + J = 1,
    ∃ i ∈ I, ∃ j ∈ J, i + j = 1, I ⊔ J = ⊤]

{R : Type u}
[CommSemiring R]
{I J : Ideal R}

[IsCoprime I J, Codisjoint I J, I + J = 1, ∃ i ∈ I, ∃ j ∈ J, i + j = 1, I ⊔ J = ⊤].TFAE


@[gcongr]
theorem Ico_subset_Ico (h₁ : a₂ ≤ a₁) (h₂ : b₁ ≤ b₂) : Ico a₁ b₁ ⊆ Ico a₂ b₂

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


@[reassoc (attr := simp)]
theorem conePointUniqueUpToIso_inv_comp {s t : Cone F} (P : IsLimit s) (Q : IsLimit t) (j : J) :
    (conePointUniqueUpToIso P Q).inv ≫ s.π.app j = t.π.app j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{s t : CategoryTheory.Limits.Cone F}
(P : CategoryTheory.Limits.IsLimit s)
(Q : CategoryTheory.Limits.IsLimit t)
(j : J)

(P.conePointUniqueUpToIso Q).inv ≫ s.π.app j = t.π.app j


@[simp]
theorem coe_reindex : (b.reindex e : ι' → M) = b ∘ e.symm

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


lemma ContinuousAt.finset_sup' (hne : s.Nonempty) (hs : ∀ i ∈ s, ContinuousAt (f i) x) :
    ContinuousAt (s.sup' hne f) x

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
{ι : Type u_3}
[SemilatticeSup L]
[ContinuousSup L]
{s : Finset ι}
{f : ι → X → L}
{x : X}
(hne : s.Nonempty)
(hs : ∀ i ∈ s, ContinuousAt (f i) x)


@[simp]
lemma homEquiv_id : homEquiv W L₁ L₂ (𝟙 (L₁.obj X)) = 𝟙 (L₂.obj X)

(CategoryTheory.Localization.homEquiv W L₁ L₂) (CategoryTheory.CategoryStruct.id (L₁.obj X)) =
  CategoryTheory.CategoryStruct.id (L₂.obj X)


theorem range_eq_top : f.range = ⊤ ↔ Function.Surjective f

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


theorem sum_mapRange_index.linearMap [DecidableEq ι] {f : ∀ i, β₁ i →ₗ[R] β₂ i}
    {h : ∀ i, β₂ i →ₗ[R] N} {l : Π₀ i, β₁ i} :
    DFinsupp.lsum ℕ h (mapRange.linearMap f l) = DFinsupp.lsum ℕ (fun i => (h i).comp (f i)) l

{ι : Type u_1}
{R : Type u_2}
{N : Type u_5}
[Semiring R]
[AddCommMonoid N]
[Module R N]
{β₁ : ι → Type u_7}
{β₂ : ι → Type u_8}
[(i : ι) → AddCommMonoid (β₁ i)]
[(i : ι) → AddCommMonoid (β₂ i)]
[(i : ι) → Module R (β₁ i)]
[(i : ι) → Module R (β₂ i)]
[DecidableEq ι]
{f : (i : ι) → β₁ i →ₗ[R] β₂ i}
{h : (i : ι) → β₂ i →ₗ[R] N}
{l : Π₀ (i : ι), β₁ i}

((DFinsupp.lsum ℕ) h) ((DFinsupp.mapRange.linearMap f) l) = ((DFinsupp.lsum ℕ) fun i => h i ∘ₗ f i) l


@[to_additive addProjection_respects_measure_apply]
lemma IsFundamentalDomain.projection_respects_measure_apply {ν : Measure α}
    (μ : Measure (Quotient α_mod_G)) [i : QuotientMeasureEqMeasurePreimage ν μ] {t : Set α}
    (fund_dom_t : IsFundamentalDomain G t ν) {U : Set (Quotient α_mod_G)}
    (meas_U : MeasurableSet U) : μ U = ν (π ⁻¹' U ∩ t)

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

[i : MeasureTheory.QuotientMeasureEqMeasurePreimage ν μ]

(fund_dom_t : MeasureTheory.IsFundamentalDomain G t ν)

{U : Set (Quotient (MulAction.orbitRel G α))}

μ U = ν (Quotient.mk (MulAction.orbitRel G α) ⁻¹' U ∩ t)


theorem IsVanKampenColimit.precompose_isIso_iff {F G : J ⥤ C} (α : F ⟶ G) [IsIso α]
    {c : Cocone G} : IsVanKampenColimit ((Cocones.precompose α).obj c) ↔ IsVanKampenColimit c

{J : Type v'}
[CategoryTheory.Category.{u', v'} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F G : CategoryTheory.Functor J C}
(α : F ⟶ G)
[CategoryTheory.IsIso α]
{c : CategoryTheory.Limits.Cocone G}

CategoryTheory.IsVanKampenColimit ((CategoryTheory.Limits.Cocones.precompose α).obj c) ↔
  CategoryTheory.IsVanKampenColimit c


theorem mem_dite_univ_right (p : Prop) [Decidable p] (t : p → Set α) (x : α) :
    (x ∈ if h : p then t h else univ) ↔ ∀ h : p, x ∈ t h

{α : Type u}
(p : Prop)
[Decidable p]
(t : p → Set α)
(x : α)

(x ∈ if h : p then t h else Set.univ) ↔ ∀ (h : p), x ∈ t h


theorem natCast_ceil_eq_intCast_ceil  (ha : 0 ≤ a) : (⌈a⌉₊ : α) = ⌈a⌉

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

↑⌈a⌉₊ = ↑⌈a⌉


/-- `AddMonoidAlgebra.toDirectSum` and `DirectSum.toAddMonoidAlgebra` together form an
equiv. -/
@[simps (config := .asFn)]
def addMonoidAlgebraEquivDirectSum [DecidableEq ι] [Semiring M] [∀ m : M, Decidable (m ≠ 0)] :
    AddMonoidAlgebra M ι ≃ ⨁ _ : ι, M

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Semiring M]
[(m : M) → Decidable (m ≠ 0)]


theorem IsVanKampenColimit.of_mapCocone (G : C ⥤ D) {F : J ⥤ C} {c : Cocone F}
    [∀ (i j : J) (X : C) (f : X ⟶ F.obj j) (g : i ⟶ j), PreservesLimit (cospan f (F.map g)) G]
    [∀ (i : J) (X : C) (f : X ⟶ c.pt), PreservesLimit (cospan f (c.ι.app i)) G]
    [ReflectsLimitsOfShape WalkingCospan G]
    [PreservesColimitsOfShape J G]
    [ReflectsColimitsOfShape J G]
    (H : IsVanKampenColimit (G.mapCocone c)) : IsVanKampenColimit c

[(i j : J) →
    (X : C) →
      (f : X ⟶ F.obj j) →
        (g : i ⟶ j) → CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f (F.map g)) G]

[(i : J) →
    (X : C) → (f : X ⟶ c.pt) → CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f (c.ι.app i)) G]

(H : CategoryTheory.IsVanKampenColimit (G.mapCocone c))


theorem tail_suffix (l : List α) : tail l <:+ l


theorem det_updateColumn_add_self (A : Matrix n n R) {i j : n} (hij : i ≠ j) :
    det (updateColumn A i fun k => A k i + A k j) = det A

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A : Matrix n n R)
{i j : n}
(hij : i ≠ j)

(A.updateColumn i fun k => A k i + A k j).det = A.det


@[simp]
theorem connectedComponentEquiv_refl :
    (Iso.refl : G ≃g G).connectedComponentEquiv = Equiv.refl _

SimpleGraph.Iso.refl.connectedComponentEquiv = Equiv.refl G.ConnectedComponent


theorem LineDifferentiableAt.smul (h : LineDifferentiableAt 𝕜 f x v) (c : 𝕜) :
    LineDifferentiableAt 𝕜 f x (c • v)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{x v : E}
(h : LineDifferentiableAt 𝕜 f x v)
(c : 𝕜)


@[simp]
lemma homMk₂_app_two : (homMk₂ app₀ app₁ app₂ w₀ w₁).app ⟨2, by valid⟩ = app₂

{f g : CategoryTheory.ComposableArrows C 2}

(w₀ :
  CategoryTheory.CategoryStruct.comp (f.map' 0 1 ⋯ ⋯) app₁ = CategoryTheory.CategoryStruct.comp app₀ (g.map' 0 1 ⋯ ⋯))

(w₁ :
  CategoryTheory.CategoryStruct.comp (f.map' 1 2 ⋯ ⋯) app₂ = CategoryTheory.CategoryStruct.comp app₁ (g.map' 1 2 ⋯ ⋯))

(CategoryTheory.ComposableArrows.homMk₂ app₀ app₁ app₂ w₀ w₁).app ⟨2, ⋯⟩ = app₂


theorem dNext_nat (C D : ChainComplex V ℕ) (i : ℕ) (f : ∀ i j, C.X i ⟶ D.X j) :
    dNext i f = C.d i (i - 1) ≫ f (i - 1) i

{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
(C D : ChainComplex V ℕ)
(i : ℕ)
(f : (i j : ℕ) → C.X i ⟶ D.X j)

(dNext i) f = C.d i (i - 1) ≫ f (i - 1) i


/-- The functor `G : C ⥤ D` exhibits `(C, J)` as a dense subsite of `(D, K)`
if `G` is cover-dense, locally fully-faithful,
and `S` is a cover of `C` if and only if the image of `S` in `D` is a cover. -/
class IsDenseSubsite : Prop where
  isCoverDense' : G.IsCoverDense K := by infer_instance
  isLocallyFull' : G.IsLocallyFull K := by infer_instance
  isLocallyFaithful' : G.IsLocallyFaithful K := by infer_instance
  functorPushforward_mem_iff : ∀ {X : C} {S : Sieve X}, S.functorPushforward G ∈ K _ ↔ S ∈ J _

(J : CategoryTheory.GrothendieckTopology C)

{K : CategoryTheory.GrothendieckTopology D}

[self : CategoryTheory.Functor.IsDenseSubsite J K G]


@[to_additive]
theorem characteristic_iff_comap_eq : H.Characteristic ↔ ∀ ϕ : G ≃* G, H.comap ϕ.toMonoidHom = H

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

H.Characteristic ↔ ∀ (ϕ : G ≃* G), Subgroup.comap ϕ.toMonoidHom H = H


theorem QuasiconvexOn.dual : QuasiconvexOn 𝕜 s f → QuasiconcaveOn 𝕜 s (toDual ∘ f)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LE β]
[SMul 𝕜 E]
{s : Set E}
{f : E → β}

QuasiconvexOn 𝕜 s f → QuasiconcaveOn 𝕜 s (⇑OrderDual.toDual ∘ f)


/-- Let `U : ι → Set α` be an open cover of a compact set `K`.
Then there exists an entourage `V`
such that for each `x ∈ K` its `V`-neighborhood is included in some `U i`.

Moreover, one can choose an entourage from a given basis. -/
protected theorem Filter.HasBasis.lebesgue_number_lemma {ι' ι : Sort*} {p : ι' → Prop}
    {V : ι' → Set (α × α)} {U : ι → Set α} (hbasis : (𝓤 α).HasBasis p V) (hK : IsCompact K)
    (hopen : ∀ j, IsOpen (U j)) (hcover : K ⊆ ⋃ j, U j) :
    ∃ i, p i ∧ ∀ x ∈ K, ∃ j, ball x (V i) ⊆ U j

{α : Type ua}
[UniformSpace α]
{K : Set α}
{ι' : Sort u_2}
{ι : Sort u_3}
{p : ι' → Prop}
{V : ι' → Set (α × α)}
{U : ι → Set α}
(hbasis : (𝓤 α).HasBasis p V)
(hK : IsCompact K)
(hopen : ∀ (j : ι), IsOpen (U j))
(hcover : K ⊆ ⋃ j, U j)

∃ i, p i ∧ ∀ x ∈ K, ∃ j, UniformSpace.ball x (V i) ⊆ U j


/-- Compact-open topology on `C(α, β)` agrees with the topology of uniform convergence on compacts:
a family of continuous functions `F i` tends to `f` in the compact-open topology
if and only if the `F i` tends to `f` uniformly on all compact sets. -/
theorem tendsto_iff_forall_compact_tendstoUniformlyOn
    {ι : Type u₃} {p : Filter ι} {F : ι → C(α, β)} {f} :
    Tendsto F p (𝓝 f) ↔ ∀ K, IsCompact K → TendstoUniformlyOn (fun i a => F i a) f p K

{α : Type u₁}
{β : Type u₂}
[TopologicalSpace α]
[UniformSpace β]
{ι : Type u₃}
{p : Filter ι}
{F : ι → C(α, β)}
{f : C(α, β)}

Filter.Tendsto F p (𝓝 f) ↔ ∀ (K : Set α), IsCompact K → TendstoUniformlyOn (fun i a => (F i) a) (⇑f) p K


theorem UniformSpace.mem_closure_iff_symm_ball {s : Set α} {x} :
    x ∈ closure s ↔ ∀ {V}, V ∈ 𝓤 α → SymmetricRel V → (s ∩ ball x V).Nonempty

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

x ∈ closure s ↔ ∀ {V : Set (α × α)}, V ∈ 𝓤 α → SymmetricRel V → (s ∩ UniformSpace.ball x V).Nonempty


theorem sub_one_mul (a b : α) : (a - 1) * b = a * b - b


theorem HasFTaylorSeriesUpTo.differentiable (h : HasFTaylorSeriesUpTo n f p) (hn : 1 ≤ n) :
    Differentiable 𝕜 f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ∞}
{p : E → FormalMultilinearSeries 𝕜 E F}
(h : HasFTaylorSeriesUpTo n f p)
(hn : 1 ≤ n)


theorem padicValNat_mul_pow_left {q : ℕ} [hp : Fact p.Prime] [hq : Fact q.Prime]
    (n m : ℕ) (neq : p ≠ q) : padicValNat p (p^n * q^m) = n

{p q : ℕ}
[hp : Fact (Nat.Prime p)]
[hq : Fact (Nat.Prime q)]
(n m : ℕ)
(neq : p ≠ q)


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

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


theorem gcd_dvd_gcd_mul_right_right [GCDMonoid α] (m n k : α) : gcd m n ∣ gcd m (n * k)

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


@[simp] theorem enumFrom_length : ∀ {n} {l : List α}, (enumFrom n l).length = l.length


theorem sqrt_one_add_norm_sq_le (x : E) : √((1 : ℝ) + ‖x‖ ^ 2) ≤ 1 + ‖x‖

{E : Type u_1}
[NormedAddCommGroup E]
(x : E)


@[simp]
theorem cancel_unit_right_assoc' {W X X' Y Y' Z : C} (f : W ⟶ X) (g : X ⟶ Y) (h : Y ⟶ Z)
    (f' : W ⟶ X') (g' : X' ⟶ Y') (h' : Y' ⟶ Z) :
    f ≫ g ≫ h ≫ e.unit.app Z = f' ≫ g' ≫ h' ≫ e.unit.app Z ↔ f ≫ g ≫ h = f' ≫ g' ≫ h'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)
{W X X' Y Y' Z : C}
(f : W ⟶ X)
(g : X ⟶ Y)
(h : Y ⟶ Z)
(f' : W ⟶ X')
(g' : X' ⟶ Y')
(h' : Y' ⟶ Z)

CategoryTheory.CategoryStruct.comp f
      (CategoryTheory.CategoryStruct.comp g (CategoryTheory.CategoryStruct.comp h (e.unit.app Z))) =
    CategoryTheory.CategoryStruct.comp f'
      (CategoryTheory.CategoryStruct.comp g' (CategoryTheory.CategoryStruct.comp h' (e.unit.app Z))) ↔
  CategoryTheory.CategoryStruct.comp f (CategoryTheory.CategoryStruct.comp g h) =
    CategoryTheory.CategoryStruct.comp f' (CategoryTheory.CategoryStruct.comp g' h')


@[simp]
theorem coe_top [CompactSpace α] : (↑(⊤ : Compacts α) : Set α) = univ

{α : Type u_1}
[TopologicalSpace α]
[CompactSpace α]


theorem le_pred_iff_of_not_isMin (ha : ¬IsMin a) : b ≤ pred a ↔ b < a

{α : Type u_1}
[Preorder α]
[PredOrder α]
{a b : α}
(ha : ¬IsMin a)


theorem rtakeWhile_concat (x : α) :
    rtakeWhile p (l ++ [x]) = if p x then rtakeWhile p l ++ [x] else []

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

List.rtakeWhile p (l ++ [x]) = if p x = true then List.rtakeWhile p l ++ [x] else []


theorem Nonempty.of_infs_right : (s ⊼ t).Nonempty → t.Nonempty

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


@[simp]
theorem sigmaCurry_single [∀ i, DecidableEq (α i)] [∀ i j, Zero (δ i j)]
    (ij : Σ i, α i) (x : δ ij.1 ij.2) :
    sigmaCurry (single ij x) = single ij.1 (single ij.2 x : Π₀ j, δ ij.1 j)

{ι : Type u}
[DecidableEq ι]
{α : ι → Type u_2}
{δ : (i : ι) → α i → Type v}
[(i : ι) → DecidableEq (α i)]
[(i : ι) → (j : α i) → Zero (δ i j)]
(ij : (i : ι) × α i)
(x : δ ij.fst ij.snd)

(DFinsupp.single ij x).sigmaCurry = DFinsupp.single ij.fst (DFinsupp.single ij.snd x)


theorem toMeasure_apply_eq_one_iff (hs : MeasurableSet s) : p.toMeasure s = 1 ↔ p.support ⊆ s

{α : Type u_1}
[MeasurableSpace α]
(p : PMF α)
(s : Set α)
(hs : MeasurableSet s)


@[to_additive VAddAntidiagonal.finite_of_isPWO]
theorem finite_of_isPWO (hs : s.IsPWO) (ht : t.IsPWO) (a) : (smulAntidiagonal s t a).Finite

{G : Type u_1}
{P : Type u_2}
{s : Set G}
{t : Set P}
[PartialOrder G]
[PartialOrder P]
[SMul G P]
[IsOrderedCancelSMul G P]
(hs : s.IsPWO)
(ht : t.IsPWO)
(a : P)


/-- Implementation of `CommMon_.equivLaxBraidedFunctorPUnit`. -/
@[simps!]
def unitIso :
    𝟭 (LaxBraidedFunctor (Discrete PUnit.{u + 1}) C) ≅
      laxBraidedToCommMon C ⋙ commMonToLaxBraided C

(X : CategoryTheory.LaxBraidedFunctor (CategoryTheory.Discrete PUnit.{u + 1}) C)

∀ (X_1 : CategoryTheory.Discrete PUnit.{u + 1}),
  ((CommMon_.EquivLaxBraidedFunctorPUnit.unitIso C).inv.app X).app X_1 =
    𝟙 (X.obj (𝟙_ (CategoryTheory.Discrete PUnit.{u + 1})))


/-- A function is `C^(n+1)` iff it has a `C^n` derivative. -/
theorem contDiff_succ_iff_hasFDerivAt {n : ℕ} :
    ContDiff 𝕜 (n + 1 : ℕ) f ↔
      ∃ f' : E → E →L[𝕜] F, ContDiff 𝕜 n f' ∧ ∀ x, HasFDerivAt f (f' x) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ}

ContDiff 𝕜 (↑(n + 1)) f ↔ ∃ f', ContDiff 𝕜 (↑n) f' ∧ ∀ (x : E), HasFDerivAt f (f' x) x


theorem floor_eq_on_Ico (n : ℕ) : ∀ a ∈ (Set.Ico n (n + 1) : Set α), ⌊a⌋₊ = n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
(n : ℕ)
(a : α)


@[to_additive (attr := simp)] lemma isSquare_inv : IsSquare a⁻¹ ↔ IsSquare a

{α : Type u_2}
[SubtractionMonoid α]
{a : α}


/-- The canonical morphism from a seminormed group `V` to its completion. -/
@[simps]
def completion.incl {V : SemiNormedGrp} : V ⟶ completion.obj V


@[to_additive]
theorem subset_interior_mul : interior s * interior t ⊆ interior (s * t)

{α : Type u}
[TopologicalSpace α]
[AddGroup α]
[ContinuousConstVAdd α α]
{s t : Set α}

interior s + interior t ⊆ interior (s + t)


theorem ring_closure_subset : Ring.closure S ⊆ closure S


@[simp] lemma ker_bot : ker (⊥ : Filter α) = ∅


@[to_additive]
lemma isCompact_preimage [TopologicalSpace β]
    (h'f : HasCompactMulSupport f) (hf : Continuous f) {k : Set β} (hk : IsClosed k)
    (h'k : 1 ∉ k) : IsCompact (f ⁻¹' k)

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[One β]
{f : α → β}
[TopologicalSpace β]
(h'f : HasCompactMulSupport f)
(hf : Continuous f)
{k : Set β}
(hk : IsClosed k)
(h'k : 1 ∉ k)


/-- **First moment method**. The maximum of an integrable function is greater than its integral,
while avoiding a null set. -/
theorem exists_not_mem_null_integral_le (hf : Integrable f μ) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ ∫ a, f a ∂μ ≤ f x

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{N : Set α}
{f : α → ℝ}
[MeasureTheory.IsProbabilityMeasure μ]
(hf : MeasureTheory.Integrable f μ)
(hN : μ N = 0)


/-- Galois connection between `a ↦ a ^ n : ℕ → ℕ` and `floorRoot n : ℕ → ℕ` where `ℕ` is ordered
by divisibility. -/
lemma pow_dvd_iff_dvd_floorRoot : a ^ n ∣ b ↔ a ∣ floorRoot n b


@[simp]
theorem xa_sq (i : ZMod (2 * n)) : xa i ^ 2 = a n

QuaternionGroup.xa i ^ 2 = QuaternionGroup.a ↑n


/-- The function `fun z ↦ (z - w) ^ n`, `n : ℤ`, is circle integrable on the circle with center `c`
and radius `|R|` if and only if `R = 0` or `0 ≤ n`, or `w` does not belong to this circle. -/
@[simp]
theorem circleIntegrable_sub_zpow_iff {c w : ℂ} {R : ℝ} {n : ℤ} :
    CircleIntegrable (fun z => (z - w) ^ n) c R ↔ R = 0 ∨ 0 ≤ n ∨ w ∉ sphere c |R|

CircleIntegrable (fun z => (z - w) ^ n) c R ↔ R = 0 ∨ 0 ≤ n ∨ w ∉ Metric.sphere c |R|


@[simp]
theorem const_lt_const : const β a < const β b ↔ a < b

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Nonempty β]
{a b : α}

Function.const β a < Function.const β b ↔ a < b


{𝕜 : Type u_1}
{V : Type u_2}
[NormedField 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
(e : ENorm 𝕜 V)


@[simp]
theorem empty_mul [Fintype n'] (A : Matrix (Fin 0) n' α) (B : Matrix n' o' α) : A * B = of ![]

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


theorem kernel.ι_unop :
    (kernel.ι g.unop).op = eqToHom (Opposite.op_unop _) ≫ cokernel.π g ≫ (kernelUnopOp g).inv

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{A B : Cᵒᵖ}
(g : A ⟶ B)

(CategoryTheory.Limits.kernel.ι g.unop).op =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.cokernel.π g) (CategoryTheory.kernelUnopOp g).inv)


theorem coe_eq : ((↑) : FreeRing α → FreeCommRing α) =
    @Functor.map FreeAbelianGroup _ _ _ fun l : List α => (l : Multiset α)

FreeRing.castFreeCommRing = Functor.map fun l => ↑l


theorem iSup₂_le_iff {f : ∀ i, κ i → α} : ⨆ (i) (j), f i j ≤ a ↔ ∀ i j, f i j ≤ a

{α : Type u_1}
{ι : Sort u_5}
{κ : ι → Sort u_7}
[CompleteLattice α]
{a : α}
{f : (i : ι) → κ i → α}

⨆ i, ⨆ j, f i j ≤ a ↔ ∀ (i : ι) (j : κ i), f i j ≤ a


/-- Swaps the pointed elements of a bipointed type. `Prod.swap` as a functor. -/
@[simps]
def swap : Bipointed ⥤ Bipointed


theorem preimage_nhds_coinduced [TopologicalSpace α] {π : α → β} {s : Set β} {a : α}
    (hs : s ∈ @nhds β (TopologicalSpace.coinduced π ‹_›) (π a)) : π ⁻¹' s ∈ 𝓝 a

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
{π : α → β}
{s : Set β}
{a : α}
(hs : s ∈ 𝓝 (π a))

π ⁻¹' s ∈ 𝓝 a


theorem norm_compContinuous_linearIsometry_le (g : ContinuousMultilinearMap 𝕜 E₁ G)
    (f : ∀ i, E i →ₗᵢ[𝕜] E₁ i) :
    ‖g.compContinuousLinearMap fun i => (f i).toContinuousLinearMap‖ ≤ ‖g‖

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

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


@[to_additive (attr := simp)]
theorem nhds_mul_nhds_one {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) :
    𝓝 a * 𝓝 1 = 𝓝 a

{M : Type u_6}
[AddZeroClass M]
[TopologicalSpace M]
[ContinuousAdd M]
(a : M)


@[to_additive]
theorem tprod_dite_right (P : Prop) [Decidable P] (x : β → ¬P → α) :
    ∏' b : β, (if h : P then (1 : α) else x b h) = if h : P then (1 : α) else ∏' b : β, x b h

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
(P : Prop)
[Decidable P]
(x : β → ¬P → α)

(∑' (b : β), if h : P then 0 else x b h) = if h : P then 0 else ∑' (b : β), x b h


theorem eq_empty_iff_forall_not_mem {s : Set α} : s = ∅ ↔ ∀ x, x ∉ s


lemma rel_add {p q : I} (hpq : c.Rel p q) (r : I) : c.Rel (p + r) (q + r)

{I : Type u_4}
[AddMonoid I]
(c : ComplexShape I)
[c.TensorSigns]
{p q : I}
(hpq : c.Rel p q)
(r : I)


@[to_additive]
theorem ofQuotientStabilizer_mem_orbit (g) : ofQuotientStabilizer α x g ∈ orbit α x

(α : Type u)
{β : Type v}
[AddGroup α]
[AddAction α β]
(x : β)
(g : α ⧸ AddAction.stabilizer α x)

AddAction.ofQuotientStabilizer α x g ∈ AddAction.orbit α x


@[simp]
lemma DifferentiableOn.add_iff_left (hg : DifferentiableOn 𝕜 g s) :
    DifferentiableOn 𝕜 (fun y => f y + g y) s ↔ DifferentiableOn 𝕜 f s

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


lemma setLIntegral_condKernel_eq_measure_prod {s : Set β} (hs : MeasurableSet s) {t : Set Ω}
    (ht : MeasurableSet t) :
    ∫⁻ b in s, ρ.condKernel b t ∂ρ.fst = ρ (s ×ˢ t)

{β : Type u_2}
{Ω : Type u_3}
{mβ : MeasurableSpace β}
[MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{ρ : MeasureTheory.Measure (β × Ω)}
[MeasureTheory.IsFiniteMeasure ρ]
{s : Set β}
(hs : MeasurableSet s)
{t : Set Ω}
(ht : MeasurableSet t)

∫⁻ (b : β) in s, (ρ.condKernel b) t ∂ρ.fst = ρ (s ×ˢ t)


theorem clog_of_right_le_one {n : ℕ} (hn : n ≤ 1) (b : ℕ) : clog b n = 0


/-- A finpartition gives rise to a setoid partition -/
theorem Finpartition.isPartition_parts {α} (f : Finpartition (Set.univ : Set α)) :
    Setoid.IsPartition (f.parts : Set (Set α))

{α : Type u_1}
(f : Finpartition Set.univ)


theorem apply_norm_sq_eq_inner_adjoint_left (A : E →L[𝕜] F) (x : E) :
    ‖A x‖ ^ 2 = re ⟪(A† ∘L A) x, x⟫

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

‖A x‖ ^ 2 = RCLike.re ⟪((ContinuousLinearMap.adjoint A).comp A) x, x⟫_𝕜


theorem log_intCast_nonneg (n : ℤ) : 0 ≤ log n


theorem coeff_monomial_mul' (m) (s : σ →₀ ℕ) (r : R) (p : MvPolynomial σ R) :
    coeff m (monomial s r * p) = if s ≤ m then r * coeff (m - s) p else 0

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

MvPolynomial.coeff m ((MvPolynomial.monomial s) r * p) = if s ≤ m then r * MvPolynomial.coeff (m - s) p else 0


theorem sub_rat (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (x - r)

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


theorem filtrationOfSet_eq_natural [MulZeroOneClass β] [Nontrivial β] {s : ι → Set Ω}
    (hsm : ∀ i, MeasurableSet[m] (s i)) :
    filtrationOfSet hsm = natural (fun i => (s i).indicator (fun _ => 1 : Ω → β)) fun i =>
      stronglyMeasurable_one.indicator (hsm i)

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[TopologicalSpace.MetrizableSpace β]
[mβ : MeasurableSpace β]
[BorelSpace β]
[Preorder ι]
[MulZeroOneClass β]
[Nontrivial β]
{s : ι → Set Ω}
(hsm : ∀ (i : ι), MeasurableSet (s i))

MeasureTheory.filtrationOfSet hsm = MeasureTheory.Filtration.natural (fun i => (s i).indicator fun x => 1) ⋯


theorem terminates_def (s : Computation α) : Terminates s ↔ ∃ n, (s.1 n).isSome

s.Terminates ↔ ∃ n, (↑s n).isSome = true


@[simp] theorem H0LequivOfIsTrivial_eq_subtype [A.IsTrivial] :
    H0LequivOfIsTrivial A = A.ρ.invariants.subtype

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

↑(groupCohomology.H0LequivOfIsTrivial A) = A.ρ.invariants.subtype


@[simp]
theorem coe_ne_bot (x : ℝ) : (x : EReal) ≠ ⊥


@[to_additive]
lemma sup_div_right [SemilatticeSup β] [OrderBot β] (s t : Finset α) (f : α → β) :
    sup (s / t) f = sup t fun y ↦ sup s (f <| · / y)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Div α]
[SemilatticeSup β]
[OrderBot β]
(s t : Finset α)
(f : α → β)

(s / t).sup f = t.sup fun y => s.sup fun x => f (x / y)


theorem mul_eq_zero_of_left {a : M₀} (h : a = 0) (b : M₀) : a * b = 0

{M₀ : Type u_1}
[MulZeroClass M₀]
{a : M₀}
(h : a = 0)
(b : M₀)


@[reassoc, elementwise]
lemma ΓIso_hom_map {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] (U : Y.Opens) :
    f.app U ≫ (ΓIso f U).hom = Y.presheaf.map (homOfLE inf_le_right).op

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
[AlgebraicGeometry.IsOpenImmersion f]
(U : Y.Opens)

AlgebraicGeometry.Scheme.Hom.app f U ≫ (AlgebraicGeometry.IsOpenImmersion.ΓIso f U).hom =
  Y.presheaf.map (CategoryTheory.homOfLE ⋯).op


@[to_additive]
theorem inclusion_right (h : H ≤ K) (x : K) (hx : (x : G) ∈ H) : inclusion h ⟨x, hx⟩ = x

{G : Type u_1}
[Group G]
{S : Type u_6}
{H K : S}
[SetLike S G]
[SubgroupClass S G]
(h : H ≤ K)
(x : ↥K)
(hx : ↑x ∈ H)

(SubgroupClass.inclusion h) ⟨↑x, hx⟩ = x


@[measurability, fun_prop]
theorem measurable_coe_real_ereal : Measurable ((↑) : ℝ → EReal)


@[simp]
theorem conjCLE_nnorm : ‖(conjCLE : ℂ →L[ℝ] ℂ)‖₊ = 1


lemma transGen_minimal {r' : α → α → Prop} (hr' : Transitive r') (h : ∀ x y, r x y → r' x y)
    {x y : α} (hxy : TransGen r x y) : r' x y

{α : Type u_1}
{r r' : α → α → Prop}
(hr' : Transitive r')
(h : ∀ (x y : α), r x y → r' x y)
{x y : α}
(hxy : Relation.TransGen r x y)


theorem Finite.toFinset_prod {s : Set α} {t : Set β} (hs : s.Finite) (ht : t.Finite) :
    hs.toFinset ×ˢ ht.toFinset = (hs.prod ht).toFinset

{α : Type u}
{β : Type v}
{s : Set α}
{t : Set β}
(hs : s.Finite)
(ht : t.Finite)


/-- If `r` is well-founded, the lexicographic order on `r`-decreasing chains is also. -/
theorem WellFounded.list_chain' (hwf : WellFounded r) :
    WellFounded (List.lex_chains r)

{α : Type u_1}
{r : α → α → Prop}
(hwf : WellFounded r)


theorem logb_pos_iff (hx : 0 < x) : 0 < logb b x ↔ 1 < x


theorem trans_refl_reparam (p : Path x₀ x₁) :
    p.trans (Path.refl x₁) =
      p.reparam (fun t => ⟨transReflReparamAux t, transReflReparamAux_mem_I t⟩) (by continuity)
        (Subtype.ext transReflReparamAux_zero) (Subtype.ext transReflReparamAux_one)

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ : X}
(p : Path x₀ x₁)

p.trans (Path.refl x₁) = p.reparam (fun t => ⟨Path.Homotopy.transReflReparamAux t, ⋯⟩) ⋯ ⋯ ⋯


private theorem rel_flip_aux {s t} (h : Rel r s t) : Rel (flip r) t s

{α : Type u_1}
{β : Type v}
{r : α → β → Prop}
{s : Multiset α}
{t : Multiset β}
(h : Multiset.Rel r s t)


theorem trans_target' : (e.trans e').target = e'.target ∩ e'.symm ⁻¹' (e'.source ∩ e.target)

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

(e.trans e').target = e'.target ∩ ↑e'.symm ⁻¹' (e'.source ∩ e.target)


protected theorem congr_fun (η η' : ApplicativeTransformation F G) (h : η = η') {α : Type u}
    (x : F α) : η x = η' x

{F : Type u → Type v}
[Applicative F]
{G : Type u → Type w}
[Applicative G]
(η η' : ApplicativeTransformation F G)
(h : η = η')
{α : Type u}
(x : F α)

(fun {α} => η.app α) x = (fun {α} => η'.app α) x


/-- Equivalence between continuous maps into the units of a monoid with continuous multiplication
and the units of the monoid of continuous maps. -/
-- Porting note: `simps` made bad `simp` lemmas (LHS simplifies) so we add them manually below
@[to_additive (attr := simps apply_val_apply symm_apply_apply_val)
"Equivalence between continuous maps into the additive units of an additive monoid with continuous
addition and the additive units of the additive monoid of continuous maps."]
def unitsLift : C(X, Mˣ) ≃ C(X, M)ˣ

{X : Type u_1}
{M : Type u_2}
[TopologicalSpace X]
[Monoid M]
[TopologicalSpace M]
[ContinuousMul M]
(f : C(X, Mˣ))
(x : X)


theorem cast_bijective {α β : Sort _} (h : α = β) : Function.Bijective (cast h)


@[to_additive (attr := simp)]
theorem coe_of (R : Type u) [Semigroup R] : (Semigrp.of R : Type u) = R


@[to_additive]
theorem eq_inv_iff_mul_eq_one : a = b⁻¹ ↔ a * b = 1


@[to_additive (attr := simp)]
theorem restrict_apply {N S : Type*} [MulOneClass N] [SetLike S M] [SubmonoidClass S M]
    (f : M →* N) (s : S) (x : s) : f.restrict s x = f x

{M : Type u_1}
[MulOneClass M]
{N : Type u_6}
{S : Type u_7}
[MulOneClass N]
[SetLike S M]
[SubmonoidClass S M]
(f : M →* N)
(s : S)
(x : ↥s)


/-- Let `V` be a vector space over `K = Frac(R)`, `S / R` a ring extension
and `V'` a module over `S`. If `b`, in the intersection `V''` of `V` and `V'`,
is linear independent over `S` in `V'`, then it is linear independent over `R` in `V`.

The statement we prove is actually slightly more general:
 * it suffices that the inclusion `algebraMap R S : R → S` is nontrivial
 * the function `f' : V'' → V'` doesn't need to be injective
-/
theorem FinrankQuotientMap.linearIndependent_of_nontrivial [IsDedekindDomain R]
    (hRS : RingHom.ker (algebraMap R S) ≠ ⊤) (f : V'' →ₗ[R] V) (hf : Function.Injective f)
    (f' : V'' →ₗ[R] V') {ι : Type*} {b : ι → V''} (hb' : LinearIndependent S (f' ∘ b)) :
    LinearIndependent K (f ∘ b)


@[simp]
theorem id_map {X Y : C} (f : X ⟶ Y) : (𝟭 C).map f = f

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


@[simp]
theorem coe_toContinuousLinearEquivOfDetNeZero (f : E →L[𝕜] E) (hf : f.det ≠ 0) :
    (f.toContinuousLinearEquivOfDetNeZero hf : E →L[𝕜] E) = f

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
[CompleteSpace 𝕜]
[T2Space E]
[FiniteDimensional 𝕜 E]
(f : E →L[𝕜] E)
(hf : f.det ≠ 0)

↑(f.toContinuousLinearEquivOfDetNeZero hf) = f


theorem comap_iInf {ι : Sort*} (f : R →+* S) (s : ι → Subsemiring S) :
    (iInf s).comap f = ⨅ i, (s i).comap f

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
{ι : Sort u_1}
(f : R →+* S)
(s : ι → Subsemiring S)

Subsemiring.comap f (iInf s) = ⨅ i, Subsemiring.comap f (s i)


/-- From a functor `F : J ⥤ C`, given a terminal object of `J`, construct a cone for `J`,
provided that the morphisms in the diagram are isomorphisms.
In `limitOfDiagramTerminal` we show it is a limit cone. -/
@[simps]
def coneOfDiagramTerminal {X : J} (hX : IsTerminal X) (F : J ⥤ C)
    [∀ (i j : J) (f : i ⟶ j), IsIso (F.map f)] : Cone F

(hX : CategoryTheory.Limits.IsTerminal X)

[∀ (i j : J) (f : i ⟶ j), CategoryTheory.IsIso (F.map f)]

(CategoryTheory.Limits.coneOfDiagramTerminal hX F).pt = F.obj X


@[simp] theorem toList_modify [BEq α] (a : α) (l : AssocList α β) :
    (modify a f l).toList =
    l.toList.replaceF fun (k, v) => bif k == a then some (a, f k v) else none

{α : Type u_1}
{β : Type u_2}
{f : α → β → β}
[BEq α]
(a : α)
(l : Batteries.AssocList α β)

(Batteries.AssocList.modify a f l).toList =
  List.replaceF
    (fun x =>
      match x with
      | (k, v) => bif k == a then some (a, f k v) else none)
    l.toList


@[ext]
theorem ext {f g : BoundedOrderHom α β} (h : ∀ a, f a = g a) : f = g

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[BoundedOrder α]
[BoundedOrder β]
{f g : BoundedOrderHom α β}
(h : ∀ (a : α), f a = g a)


@[simp] theorem zero_eq                                   : BitVec.zero n = 0#n


@[simp] theorem closure_discrete (s : Set α) : closure s = s

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


theorem partialSections.directed :
    Directed Superset fun G : FiniteDiagram J => partialSections F G.2

{J : Type u}
[CategoryTheory.SmallCategory J]
(F : J ⥤ TopCat)

Directed Superset fun G => TopCat.partialSections F G.snd


/-- For finite intervals, see: `intervalIntegral.integral_deriv_mul_eq_sub`. -/
theorem integral_deriv_mul_eq_sub [CompleteSpace A]
    (hu : ∀ x, HasDerivAt u (u' x) x) (hv : ∀ x, HasDerivAt v (v' x) x)
    (huv : Integrable (u' * v + u * v'))
    (h_bot : Tendsto (u * v) atBot (𝓝 a')) (h_top : Tendsto (u * v) atTop (𝓝 b')) :
    ∫ (x : ℝ), u' x * v x + u x * v' x = b' - a'

(huv : MeasureTheory.Integrable (u' * v + u * v') MeasureTheory.volume)

(h_bot : Filter.Tendsto (u * v) Filter.atBot (𝓝 a'))

(h_top : Filter.Tendsto (u * v) Filter.atTop (𝓝 b'))


theorem coverPreserving_opens_map : CoverPreserving (Opens.grothendieckTopology Y)
    (Opens.grothendieckTopology X) (Opens.map f)

CategoryTheory.CoverPreserving (Opens.grothendieckTopology ↑Y) (Opens.grothendieckTopology ↑X)
  (TopologicalSpace.Opens.map f)


lemma one_le_two [LE α] [ZeroLEOneClass α] [CovariantClass α α (·+·) (·≤·)] :
    (1 : α) ≤ 2

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


@[to_additive (attr := simp)]
theorem coe_inv [Inv Y] (f : LocallyConstant X Y) : ⇑(f⁻¹ : LocallyConstant X Y) = (f : X → Y)⁻¹

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


@[simp]
theorem deg_pow (c : NumDenSameDeg 𝒜 x) (n : ℕ) : (c ^ n).deg = n • c.deg

(c : HomogeneousLocalization.NumDenSameDeg 𝒜 x)


theorem lift_rank_lt_rank_dual' {V : Type v} [AddCommGroup V] [Module K V]
    (h : ℵ₀ ≤ Module.rank K V) :
    Cardinal.lift.{u} (Module.rank K V) < Module.rank Kᵐᵒᵖ (V →ₗ[K] K)

{K : Type u}
[DivisionRing K]
{V : Type v}
[AddCommGroup V]
[Module K V]
(h : ℵ₀ ≤ Module.rank K V)

Cardinal.lift.{u, v} (Module.rank K V) < Module.rank Kᵐᵒᵖ (V →ₗ[K] K)


/-- At `-n` for `n ∈ ℕ`, the Gamma function is undefined; by convention we assign it the value 0. -/
theorem Gamma_neg_nat_eq_zero (n : ℕ) : Gamma (-n) = 0


/-- The left inclusion of `F` into `coprod F G`. -/
@[simps]
def coprod.inl : F ⟶ coprod F G

{F G : CategoryTheory.Functor C (Type w)}

∀ (x : C) (x_1 : F.obj x), CategoryTheory.FunctorToTypes.coprod.inl.app x x_1 = Sum.inl x_1


@[simp] lemma isUnit_smul_iff (g : α) (m : β) : IsUnit (g • m) ↔ IsUnit m

{α : Type u_1}
{β : Type u_2}
[Group α]
[Monoid β]
[MulAction α β]
[SMulCommClass α β β]
[IsScalarTower α β β]
(g : α)
(m : β)


/-- The same-universe version of `lift_rank_eq_of_equiv_equiv`. -/
theorem rank_eq_of_equiv_equiv (i : ZeroHom R R') (j : M ≃+ M₁)
    (hi : Bijective i) (hc : ∀ (r : R) (m : M), j (r • m) = i r • j m) :
    Module.rank R M = Module.rank R' M₁


/-- A subset `v` of a null-set `w` has zero measure if `w` is a subset of a negative set `u`. -/
theorem subset_negative_null_set (hu : MeasurableSet u) (hv : MeasurableSet v)
    (hw : MeasurableSet w) (hsu : s ≤[u] 0) (hw₁ : s w = 0) (hw₂ : w ⊆ u) (hwt : v ⊆ w) :
    s v = 0

(hsu : MeasureTheory.VectorMeasure.restrict s u ≤ MeasureTheory.VectorMeasure.restrict 0 u)


@[mono]
theorem toSubsemiring_mono : Monotone (toSubsemiring : Subring R → Subsemiring R)


private lemma fermatLastTheoremThree_of_dvd_a_of_gcd_eq_one_of_case2 {a b c : ℤ} (ha : a ≠ 0)
    (h3a : 3 ∣ a) (Hgcd : Finset.gcd {a, b, c} id = 1)
    (H : ∀ a b c : ℤ, c ≠ 0 → ¬ 3 ∣ a → ¬ 3 ∣ b  → 3 ∣ c → IsCoprime a b → a ^ 3 + b ^ 3 ≠ c ^ 3) :
    a ^ 3 + b ^ 3 + c ^ 3 ≠ 0

(H : ∀ (a b c : ℤ), c ≠ 0 → ¬3 ∣ a → ¬3 ∣ b → 3 ∣ c → IsCoprime a b → a ^ 3 + b ^ 3 ≠ c ^ 3)


@[to_additive (attr := simp)]
theorem inv_mul_cancel_left (a : αˣ) (b : α) : (↑a⁻¹ : α) * (a * b) = b

{α : Type u}
[Monoid α]
(a : αˣ)
(b : α)


/-- Localizing a domain of Krull dimension `≤ 1` gives another ring of Krull dimension `≤ 1`.

Note that the same proof can/should be generalized to preserving any Krull dimension,
once we have a suitable definition.
-/
theorem Ring.DimensionLEOne.localization {R : Type*} (Rₘ : Type*) [CommRing R] [IsDomain R]
    [CommRing Rₘ] [Algebra R Rₘ] {M : Submonoid R} [IsLocalization M Rₘ] (hM : M ≤ R⁰)
    [h : Ring.DimensionLEOne R] : Ring.DimensionLEOne Rₘ

{R : Type u_4}
(Rₘ : Type u_5)
[CommRing R]
[IsDomain R]
[CommRing Rₘ]
[Algebra R Rₘ]
{M : Submonoid R}
[IsLocalization M Rₘ]
(hM : M ≤ R⁰)
[h : Ring.DimensionLEOne R]


theorem isClique_iff : G.IsClique s ↔ s.Pairwise G.Adj

{α : Type u_1}
(G : SimpleGraph α)
{s : Set α}


lemma IsSemisimple_smul_iff {t : K} (ht : t ≠ 0) :
    (t • f).IsSemisimple ↔ f.IsSemisimple

{M : Type u_2}
[AddCommGroup M]
{K : Type u_3}
[Field K]
[Module K M]
{f : Module.End K M}
{t : K}
(ht : t ≠ 0)


theorem mem_adjoint_domain_iff (y : F) : y ∈ T†.domain ↔ Continuous ((innerₛₗ 𝕜 y).comp T.toFun)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
(T : E →ₗ.[𝕜] F)
[CompleteSpace E]
(y : F)

y ∈ T.adjoint.domain ↔ Continuous ⇑((innerₛₗ 𝕜) y ∘ₗ T.toFun)


@[simp] protected theorem le_refl (a : Int) : a ≤ a


theorem le_csInf (h₁ : s.Nonempty) (h₂ : ∀ b ∈ s, a ≤ b) : a ≤ sInf s

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
{a : α}
(h₁ : s.Nonempty)
(h₂ : ∀ b ∈ s, a ≤ b)


@[simp]
theorem toConvexCone_pointed (S : PointedCone 𝕜 E) : (S : ConvexCone 𝕜 E).Pointed

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(S : PointedCone 𝕜 E)


/-- Expressing uniform convergence using `dist`. -/
theorem tendstoUniformly_iff {F : ι → β → α} {f : β → α} {p : Filter ι} :
    TendstoUniformly F f p ↔ ∀ ε > 0, ∀ᶠ n in p, ∀ x, dist (f x) (F n x) < ε

{α : Type u}
{β : Type v}
{ι : Type u_2}
[PseudoMetricSpace α]
{F : ι → β → α}
{f : β → α}
{p : Filter ι}

TendstoUniformly F f p ↔ ∀ ε > 0, ∀ᶠ (n : ι) in p, ∀ (x : β), dist (f x) (F n x) < ε


@[to_additive]
theorem mulSupport_update_one [DecidableEq α] (f : α → M) (x : α) :
    mulSupport (update f x 1) = mulSupport f \ {x}

{α : Type u_1}
{M : Type u_5}
[One M]
[DecidableEq α]
(f : α → M)
(x : α)

Function.mulSupport (Function.update f x 1) = Function.mulSupport f \ {x}


theorem nhdsWithin_pi_eq_bot {I : Set ι} {s : ∀ i, Set (π i)} {x : ∀ i, π i} :
    𝓝[pi I s] x = ⊥ ↔ ∃ i ∈ I, 𝓝[s i] x i = ⊥

{ι : Type u_5}
{π : ι → Type u_6}
[(i : ι) → TopologicalSpace (π i)]
{I : Set ι}
{s : (i : ι) → Set (π i)}
{x : (i : ι) → π i}

𝓝[I.pi s] x = ⊥ ↔ ∃ i ∈ I, 𝓝[s i] x i = ⊥


theorem cons_swap {a a' : α} {b : δ a} {b' : δ a'} {m : Multiset α} {f : ∀ a ∈ m, δ a}
    (h : a ≠ a') : HEq (Pi.cons (a' ::ₘ m) a b (Pi.cons m a' b' f))
      (Pi.cons (a ::ₘ m) a' b' (Pi.cons m a b f))

{α : Type u_1}
[DecidableEq α]
{δ : α → Sort u_2}
{a a' : α}
{b : δ a}
{b' : δ a'}
{m : Multiset α}
{f : (a : α) → a ∈ m → δ a}
(h : a ≠ a')

HEq (Multiset.Pi.cons (a' ::ₘ m) a b (Multiset.Pi.cons m a' b' f))
  (Multiset.Pi.cons (a ::ₘ m) a' b' (Multiset.Pi.cons m a b f))


/-- The image of a surjective torsion group homomorphism is torsion. -/
@[to_additive AddIsTorsion.of_surjective
      "The image of a surjective additive torsion group homomorphism is torsion."]
theorem IsTorsion.of_surjective {f : G →* H} (hf : Function.Surjective f) (tG : IsTorsion G) :
    IsTorsion H

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]
{f : G →+ H}
(hf : Function.Surjective ⇑f)
(tG : AddMonoid.IsTorsion G)


@[reassoc (attr := simp)]
lemma hom_inv_id : hom f g ≫ inv f g = 𝟙 _

CochainComplex.MappingConeCompHomotopyEquiv.hom f g ≫ CochainComplex.MappingConeCompHomotopyEquiv.inv f g =
  𝟙 (CochainComplex.mappingCone g)


@[simp, mfld_simps]
theorem refl_symm : (PartialEquiv.refl α).symm = PartialEquiv.refl α


theorem csInf_of_not_bddBelow {s : Set α} (hs : ¬BddBelow s) : sInf s = sInf ∅

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
(hs : ¬BddBelow s)


@[simp]
theorem bind_pure : p.bind pure = p


/-- A matrix is positive semidefinite if and only if it has the form `Bᴴ * B` for some `B`. -/
lemma posSemidef_iff_eq_transpose_mul_self {A : Matrix n n 𝕜} :
    PosSemidef A ↔ ∃ (B : Matrix n n 𝕜), A = Bᴴ * B

{n : Type u_2}
{𝕜 : Type u_4}
[Fintype n]
[RCLike 𝕜]
{A : Matrix n n 𝕜}

A.PosSemidef ↔ ∃ B, A = B.conjTranspose * B


theorem lintegral_finset_sum' (s : Finset β) {f : β → α → ℝ≥0∞}
    (hf : ∀ b ∈ s, AEMeasurable (f b) μ) :
    ∫⁻ a, ∑ b ∈ s, f b a ∂μ = ∑ b ∈ s, ∫⁻ a, f b a ∂μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s : Finset β)
{f : β → α → ℝ≥0∞}
(hf : ∀ b ∈ s, AEMeasurable (f b) μ)

∫⁻ (a : α), ∑ b ∈ s, f b a ∂μ = ∑ b ∈ s, ∫⁻ (a : α), f b a ∂μ


theorem IsDiag.transpose [Zero α] {A : Matrix n n α} (ha : A.IsDiag) : Aᵀ.IsDiag

{α : Type u_1}
{n : Type u_4}
[Zero α]
{A : Matrix n n α}
(ha : A.IsDiag)


{α : Type u_1}
[Preorder α]
[PredOrder α]
(a : α)


@[simp]
lemma sectionsEquiv_symm_apply_val (x : c.pt) (i : I.L) :
    ((sectionsEquiv hc).symm x).val i = c.ι i x

{I : CategoryTheory.Limits.MulticospanIndex (Type u)}

((CategoryTheory.Limits.Multifork.IsLimit.sectionsEquiv hc).symm x).val i = c.ι i x


@[simp]
lemma image_val_diff : (↑(D \ E) : Set α) = ↑D \ ↑E

{α : Type u_2}
{A : Set α}
{D E : Set ↑A}

Subtype.val '' (D \ E) = Subtype.val '' D \ Subtype.val '' E


@[to_additive (attr := simp)]
theorem coe_of {f : M → N} (hf : IsMonoidHom f) : ⇑(MonoidHom.of hf) = f

{M : Type u_1}
{N : Type u_2}
{mM : MulOneClass M}
{mN : MulOneClass N}
{f : M → N}
(hf : IsMonoidHom f)


@[simp]
theorem rotation_symm (a : circle) : (rotation a).symm = rotation a⁻¹


theorem IsFiniteKernel.bound_lt_top (κ : Kernel α β) [h : IsFiniteKernel κ] :
    IsFiniteKernel.bound κ < ∞

[h : ProbabilityTheory.IsFiniteKernel κ]

ProbabilityTheory.IsFiniteKernel.bound κ < ⊤


@[simp] theorem zero_imK : (0 : ℍ[R]).imK = 0


theorem imp_congr_right (h : a → (b ↔ c)) : (a → b) ↔ (a → c)


@[simp]
theorem mem_toLieSubmodule (x : L) : x ∈ K.toLieSubmodule ↔ x ∈ K

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


/-- The ring morphism `A →+* A ⊗[R] B` sending `a` to `a ⊗ₜ 1`. -/
@[simps]
def includeLeftRingHom : A →+* 𝒜 ᵍ⊗[R] ℬ

{R : Type u_1}
{ι : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
[CommRing R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
(𝒜 : ι → Submodule R A)
(ℬ : ι → Submodule R B)
[GradedAlgebra 𝒜]
[GradedAlgebra ℬ]
(a : A)

(GradedTensorProduct.includeLeftRingHom 𝒜 ℬ) a = a ᵍ⊗ₜ[R] 1


theorem isIrreducible_iff_vanishingIdeal_isPrime {s : Set (PrimeSpectrum R)} :
    IsIrreducible s ↔ (vanishingIdeal s).IsPrime

{R : Type u}
[CommSemiring R]
{s : Set (PrimeSpectrum R)}

IsIrreducible s ↔ (PrimeSpectrum.vanishingIdeal s).IsPrime


theorem Float.Zero.valid : ValidFinite emin 0


/-- Composition of pseudofunctors. -/
@[simps]
def comp (F : Pseudofunctor B C) (G : Pseudofunctor C D) : Pseudofunctor B D

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{D : Type u₃}
[CategoryTheory.Bicategory D]
(F : CategoryTheory.Pseudofunctor B C)
(G : CategoryTheory.Pseudofunctor C D)

(F.comp G).toPrelaxFunctor = F.comp G.toPrelaxFunctor


/-- Converting a monoid object in `ModuleCat R` to a bundled algebra.
-/
@[simps!]
def functor : Mon_ (ModuleCat.{u} R) ⥤ AlgebraCat R

{R : Type u}
[CommRing R]
{A B : Mon_ (ModuleCat R)}
(f : A ⟶ B)
(a : ↑A.X)

(ModuleCat.MonModuleEquivalenceAlgebra.functor.map f) a = f.hom a


theorem Order.radical_nongenerating [IsCoatomic α] {a : α} (h : a ⊔ radical α = ⊤) : a = ⊤

{α : Type u_1}
[CompleteLattice α]
[IsCoatomic α]
{a : α}
(h : a ⊔ Order.radical α = ⊤)


/-- **Phragmen-Lindelöf principle** in the right half-plane. Let `f : ℂ → E` be a function such that

* `f` is differentiable in the open right half-plane and is continuous on its closure;
* `‖f z‖` is bounded from above by `A * exp(B * (abs z) ^ c)` on the open right half-plane
  for some `c < 2`;
* `‖f z‖` is bounded from above by a constant on the imaginary axis;
* `f x`, `x : ℝ`, tends to zero superexponentially fast as `x → ∞`:
  for any natural `n`, `exp (n * x) * ‖f x‖` tends to zero as `x → ∞`.

Then `f` is equal to zero on the closed right half-plane. -/
theorem eq_zero_on_right_half_plane_of_superexponential_decay (hd : DiffContOnCl ℂ f {z | 0 < z.re})
    (hexp : ∃ c < (2 : ℝ), ∃ B,
      f =O[cobounded ℂ ⊓ 𝓟 {z | 0 < z.re}] fun z => expR (B * abs z ^ c))
    (hre : SuperpolynomialDecay atTop expR fun x => ‖f x‖) (him : ∃ C, ∀ x : ℝ, ‖f (x * I)‖ ≤ C) :
    EqOn f 0 {z : ℂ | 0 ≤ z.re}

(hexp : ∃ c < 2, ∃ B, f =O[Bornology.cobounded ℂ ⊓ 𝓟 {z | 0 < z.re}] fun z => expR (B * Complex.abs z ^ c))

(hre : Asymptotics.SuperpolynomialDecay Filter.atTop expR fun x => ‖f ↑x‖)

(him : ∃ C, ∀ (x : ℝ), ‖f (↑x * Complex.I)‖ ≤ C)


theorem inter_iUnion₂ (s : Set α) (t : ∀ i, κ i → Set α) :
    (s ∩ ⋃ (i) (j), t i j) = ⋃ (i) (j), s ∩ t i j

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

s ∩ ⋃ i, ⋃ j, t i j = ⋃ i, ⋃ j, s ∩ t i j


theorem transpose_apply (u : M →ₗ[R] M') (l : Dual R M') : transpose (R := R) u l = l.comp u

{R : Type uR}
{M : Type uM}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type uM'}
[AddCommMonoid M']
[Module R M']
(u : M →ₗ[R] M')
(l : Module.Dual R M')


@[to_additive IsClosed.right_addCoset]
theorem IsClosed.rightCoset {U : Set G} (h : IsClosed U) (x : G) : IsClosed (op x • U)

{G : Type w}
[TopologicalSpace G]
[Group G]
[ContinuousMul G]
{U : Set G}
(h : IsClosed U)
(x : G)


lemma defaultRatCDF_nonneg (q : ℚ) : 0 ≤ defaultRatCDF q


/-- `TStructure C` is the type of t-structures on the (pre)triangulated category `C`. -/
structure TStructure where
  /-- the predicate of objects that are `≤ n` for `n : ℤ`. -/
  LE (n : ℤ) : C → Prop
  /-- the predicate of objects that are `≥ n` for `n : ℤ`. -/
  GE (n : ℤ) : C → Prop
  LE_closedUnderIsomorphisms (n : ℤ) : ClosedUnderIsomorphisms (LE n) := by infer_instance
  GE_closedUnderIsomorphisms (n : ℤ) : ClosedUnderIsomorphisms (GE n) := by infer_instance
  LE_shift (n a n' : ℤ) (h : a + n' = n) (X : C) (hX : LE n X) : LE n' (X⟦a⟧)
  GE_shift (n a n' : ℤ) (h : a + n' = n) (X : C) (hX : GE n X) : GE n' (X⟦a⟧)
  zero' ⦃X Y : C⦄ (f : X ⟶ Y) (hX : LE 0 X) (hY : GE 1 Y) : f = 0
  LE_zero_le : LE 0 ≤ LE 1
  GE_one_le : GE 1 ≤ GE 0
  exists_triangle_zero_one (A : C) : ∃ (X Y : C) (_ : LE 0 X) (_ : GE 1 Y)
    (f : X ⟶ A) (g : A ⟶ Y) (h : Y ⟶ X⟦(1 : ℤ)⟧), Triangle.mk f g h ∈ distTriang C

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

(self : CategoryTheory.Triangulated.TStructure C)


theorem insertAt_boundary (i : N) {t₀ : I} {t}
    (H : (t₀ = 0 ∨ t₀ = 1) ∨ t ∈ boundary { j // j ≠ i }) : insertAt i ⟨t₀, t⟩ ∈ boundary N

(H : (t₀ = 0 ∨ t₀ = 1) ∨ t ∈ Cube.boundary { j // j ≠ i })

(Cube.insertAt i) (t₀, t) ∈ Cube.boundary N


/-- `Matrix.comp` as `AlgEquiv` -/
@[simps!]
def compAlgEquiv : Matrix I I (Matrix J J R) ≃ₐ[K] Matrix (I × J) (I × J) R

(I : Type u_1)
(J : Type u_2)
(R : Type u_5)
(K : Type u_6)
[CommSemiring K]
[Semiring R]
[Fintype I]
[Fintype J]
[Algebra K R]
[DecidableEq I]
[DecidableEq J]
(m : Matrix I I (Matrix J J R))
(ik jl : I × J)

(Matrix.compAlgEquiv I J R K) m ik jl = m ik.1 jl.1 ik.2 jl.2


@[simp]
theorem bernoulli_eval_one (n : ℕ) : (bernoulli n).eval 1 = bernoulli' n

Polynomial.eval 1 (Polynomial.bernoulli n) = bernoulli' n


theorem measure_symmDiff_ne_top (hs : μ s ≠ ∞) (ht : μ t ≠ ∞) : μ (s ∆ t) ≠ ∞

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s t : Set α}
(hs : μ s ≠ ⊤)
(ht : μ t ≠ ⊤)


@[to_additive]
private theorem inv_eq_of_mul (h : a * b = 1) : a⁻¹ = b

{G : Type u_1}
[AddGroup G]
{a b : G}
(h : a + b = 0)


theorem isLocallyClosed_iff_coe_preimage_of_iSup_eq_top (s : Set β) :
    IsLocallyClosed s ↔ ∀ i, IsLocallyClosed ((↑) ⁻¹' s : Set (U i))

{β : Type u_2}
[TopologicalSpace β]
{ι : Type u_3}
{U : ι → TopologicalSpace.Opens β}
(hU : iSup U = ⊤)
(s : Set β)

IsLocallyClosed s ↔ ∀ (i : ι), IsLocallyClosed (Subtype.val ⁻¹' s)


/-- The image of `(0, 2π]` under `circleMap c R` is the circle with center `c` and radius `|R|`. -/
@[simp]
theorem image_circleMap_Ioc (c : ℂ) (R : ℝ) : circleMap c R '' Ioc 0 (2 * π) = sphere c |R|

circleMap c R '' Set.Ioc 0 (2 * π) = Metric.sphere c |R|


theorem AnalyticSet.image_of_continuous {β : Type*} [TopologicalSpace β] {s : Set α}
    (hs : AnalyticSet s) {f : α → β} (hf : Continuous f) : AnalyticSet (f '' s)

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_3}
[TopologicalSpace β]
{s : Set α}
(hs : MeasureTheory.AnalyticSet s)
{f : α → β}
(hf : Continuous f)


@[simp]
theorem symm_image_image {α β} (e : α ≃ β) (s : Set α) : e.symm '' (e '' s) = s

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
(s : Set α)


theorem norm_integral_le_of_norm_le_const [IsFiniteMeasure μ] {f : α → G} {C : ℝ}
    (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) : ‖∫ x, f x ∂μ‖ ≤ C * (μ univ).toReal

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
{f : α → G}
{C : ℝ}
(h : ∀ᵐ (x : α) ∂μ, ‖f x‖ ≤ C)

‖∫ (x : α), f x ∂μ‖ ≤ C * (μ Set.univ).toReal


/-- **There is no universal set.**
This is stated as `univ ∉ univ`, meaning that `univ` (the class of all sets) is proper (does not
belong to the class of all sets). -/
theorem univ_not_mem_univ : univ ∉ univ


@[simp, norm_cast]
protected theorem coe_sub (x y : FreeRing α) : ↑(x - y) = (x : FreeCommRing α) - y


/-- If `B` is a cyclotomic extension of `A` given by roots of unity of order in `T` and `S ⊆ T`,
then `adjoin A { b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1 }` is a cyclotomic extension of `B`
given by roots of unity of order in `S`. -/
theorem union_left [h : IsCyclotomicExtension T A B] (hS : S ⊆ T) :
    IsCyclotomicExtension S A (adjoin A {b : B | ∃ a : ℕ+, a ∈ S ∧ b ^ (a : ℕ) = 1})

(S T : Set ℕ+)
(A : Type u)
(B : Type v)
[CommRing A]
[CommRing B]
[Algebra A B]
[h : IsCyclotomicExtension T A B]
(hS : S ⊆ T)

IsCyclotomicExtension S A ↥(Algebra.adjoin A {b | ∃ a ∈ S, b ^ ↑a = 1})


/-- A `FloorSemiring` is an ordered semiring over `α` with a function
`floor : α → ℕ` satisfying `∀ (n : ℕ) (x : α), n ≤ ⌊x⌋ ↔ (n : α) ≤ x)`.
Note that many lemmas require a `LinearOrder`. Please see the above `TODO`. -/
class FloorSemiring (α) [OrderedSemiring α] where
  /-- `FloorSemiring.floor a` computes the greatest natural `n` such that `(n : α) ≤ a`. -/
  floor : α → ℕ
  /-- `FloorSemiring.ceil a` computes the least natural `n` such that `a ≤ (n : α)`. -/
  ceil : α → ℕ
  /-- `FloorSemiring.floor` of a negative element is zero. -/
  floor_of_neg {a : α} (ha : a < 0) : floor a = 0
  /-- A natural number `n` is smaller than `FloorSemiring.floor a` iff its coercion to `α` is
  smaller than `a`. -/
  gc_floor {a : α} {n : ℕ} (ha : 0 ≤ a) : n ≤ floor a ↔ (n : α) ≤ a
  /-- `FloorSemiring.ceil` is the lower adjoint of the coercion `↑ : ℕ → α`. -/
  gc_ceil : GaloisConnection ceil (↑)

{α : Type u_4}
[OrderedSemiring α]
[self : FloorSemiring α]
{a : α}
(ha : a < 0)


theorem sqrtTwoAddSeries_step_down (a b : ℕ) {c d n : ℕ} {z : ℝ}
    (hz : z ≤ sqrtTwoAddSeries (a / b) n) (hb : 0 < b) (hd : 0 < d)
    (h : a ^ 2 * d ≤ (2 * d + c) * b ^ 2) : z ≤ sqrtTwoAddSeries (c / d) (n + 1)

(a b : ℕ)
{c d n : ℕ}
{z : ℝ}
(hz : z ≤ (↑a / ↑b).sqrtTwoAddSeries n)
(hb : 0 < b)
(hd : 0 < d)
(h : a ^ 2 * d ≤ (2 * d + c) * b ^ 2)


theorem getLast_mem : ∀ {l : List α} (h : l ≠ []), getLast l h ∈ l

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


theorem iInf_IicSnd_gt (t : ℚ) {s : Set α} (hs : MeasurableSet s) [IsFiniteMeasure ρ] :
    ⨅ r : { r' : ℚ // t < r' }, ρ.IicSnd r s = ρ.IicSnd t s

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


/-- If `f` is eventually differentiable along a nontrivial filter `l : Filter ℝ` that is generated
by convex sets, the norm of `f` tends to infinity along `l`, and `f' = O(g)` along `l`, where `f'`
is the derivative of `f`, then `g` is not integrable on any interval `a..b` such that
`[a, b] ∈ l`. -/
theorem not_intervalIntegrable_of_tendsto_norm_atTop_of_deriv_isBigO_filter {f : ℝ → E} {g : ℝ → F}
    {a b : ℝ} (l : Filter ℝ) [NeBot l] [TendstoIxxClass Icc l l] (hl : [[a, b]] ∈ l)
    (hd : ∀ᶠ x in l, DifferentiableAt ℝ f x) (hf : Tendsto (fun x => ‖f x‖) l atTop)
    (hfg : deriv f =O[l] g) : ¬IntervalIntegrable g volume a b

(hd : ∀ᶠ (x : ℝ) in l, DifferentiableAt ℝ f x)

(hf : Filter.Tendsto (fun x => ‖f x‖) l Filter.atTop)

¬IntervalIntegrable g MeasureTheory.volume a b


lemma dblU_ne_zero_of_Y_eq {P Q : Fin 3 → F} (hP : W.Nonsingular P) (hPz : P z ≠ 0) (hQz : Q z ≠ 0)
    (hx : P x * Q z ^ 2 = Q x * P z ^ 2) (hy : P y * Q z ^ 3 = Q y * P z ^ 3)
    (hy' : P y * Q z ^ 3 = W.negY Q * P z ^ 3) : W.dblU P ≠ 0


protected lemma GrowsPolynomially.pow (p : ℕ) (hf : GrowsPolynomially f)
    (hf_nonneg : ∀ᶠ x in atTop, 0 ≤ f x) : GrowsPolynomially fun x => (f x) ^ p

(hf : AkraBazziRecurrence.GrowsPolynomially f)

(hf_nonneg : ∀ᶠ (x : ℝ) in Filter.atTop, 0 ≤ f x)

AkraBazziRecurrence.GrowsPolynomially fun x => f x ^ p


theorem dualLift_of_mem {φ : Module.Dual K W} {w : V} (hw : w ∈ W) : W.dualLift φ w = φ ⟨w, hw⟩

{K : Type u}
{V : Type v}
[Field K]
[AddCommGroup V]
[Module K V]
{W : Subspace K V}
{φ : Module.Dual K ↥W}
{w : V}
(hw : w ∈ W)


theorem le_comap_pow (n : ℕ) : K.comap f ^ n ≤ (K ^ n).comap f

{R : Type u}
{S : Type v}
{F : Type u_1}
[CommRing R]
[CommRing S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
{K : Ideal S}
(n : ℕ)

Ideal.comap f K ^ n ≤ Ideal.comap f (K ^ n)


theorem ae_mem_or_ae_nmem (hf : PreErgodic f μ) (hsm : MeasurableSet s) (hs : f ⁻¹' s = s) :
    (∀ᵐ x ∂μ, x ∈ s) ∨ ∀ᵐ x ∂μ, x ∉ s

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → α}
{s : Set α}
{μ : MeasureTheory.Measure α}
(hf : PreErgodic f μ)
(hsm : MeasurableSet s)
(hs : f ⁻¹' s = s)

(∀ᵐ (x : α) ∂μ, x ∈ s) ∨ ∀ᵐ (x : α) ∂μ, x ∉ s


/-- Post-composition by a uniform embedding is
a uniform embedding for the uniform structures of uniform convergence.

More precisely, if `f : γ → β` is a uniform embedding,
then `(f ∘ ·) : (α →ᵤ γ) → (α →ᵤ β)` is a uniform embedding. -/
protected theorem postcomp_uniformEmbedding [UniformSpace γ] {f : γ → β} (hf : UniformEmbedding f) :
    UniformEmbedding (ofFun ∘ (f ∘ ·) ∘ toFun : (α →ᵤ γ) → α →ᵤ β)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[UniformSpace β]
[UniformSpace γ]
{f : γ → β}
(hf : UniformEmbedding f)

UniformEmbedding (⇑UniformFun.ofFun ∘ (fun x => f ∘ x) ∘ ⇑UniformFun.toFun)


/-- The product of two `C^n` functions within a set at a point is `C^n` within this set
at this point. -/
theorem ContDiffWithinAt.mul {s : Set E} {f g : E → 𝔸} (hf : ContDiffWithinAt 𝕜 n f s x)
    (hg : ContDiffWithinAt 𝕜 n g s x) : ContDiffWithinAt 𝕜 n (fun x => f x * g x) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{n : ℕ∞}
{𝔸 : Type u_3}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{s : Set E}
{f g : E → 𝔸}
(hf : ContDiffWithinAt 𝕜 n f s x)
(hg : ContDiffWithinAt 𝕜 n g s x)


@[simp]
theorem absNorm_top : absNorm (⊤ : Ideal S) = 1

{S : Type u_1}
[CommRing S]
[IsDomain S]
[Nontrivial S]
[IsDedekindDomain S]
[Module.Free ℤ S]


/-- The opposite `ShortComplex` in `Cᵒᵖ` associated to a short complex in `C`. -/
@[simps]
def op : ShortComplex Cᵒᵖ


@[to_additive DivisibleBy.surjective_smul]
theorem RootableBy.surjective_pow (A α : Type*) [Monoid A] [Pow A α] [Zero α] [RootableBy A α]
    {n : α} (hn : n ≠ 0) : Function.Surjective fun a : A => a ^ n

(A : Type u_4)
(α : Type u_5)
[Monoid A]
[Pow A α]
[Zero α]
[RootableBy A α]
{n : α}
(hn : n ≠ 0)


@[to_additive]
theorem map_le_map_iff_of_injective {S T : Submonoid M} : S.map f ≤ T.map f ↔ S ≤ T

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{f : F}
(hf : Function.Injective ⇑f)
{S T : AddSubmonoid M}

AddSubmonoid.map f S ≤ AddSubmonoid.map f T ↔ S ≤ T


theorem one_lt_div (hb : 0 < b) : 1 < a / b ↔ b < a

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


@[simp]
theorem gcd_one_left (a : R) : gcd 1 a = 1

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
(a : R)


@[simp]
theorem multinomial_insert_one [DecidableEq α] (h : a ∉ s) (h₁ : f a = 1) :
    multinomial (insert a s) f = (s.sum f).succ * multinomial s f

{α : Type u_1}
{s : Finset α}
{f : α → ℕ}
{a : α}
[DecidableEq α]
(h : a ∉ s)
(h₁ : f a = 1)

Nat.multinomial (insert a s) f = (s.sum f).succ * Nat.multinomial s f


theorem add_one : ∀ n : ZNum, n + 1 = succ n


lemma inf_eq_half_smul_add_sub_abs_sub' (x y : β) : x ⊓ y = (2⁻¹ : α) • (x + y - |y - x|)

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


theorem Option.traverse_eq_map_id {α β} (f : α → β) (x : Option α) :
    Option.traverse ((pure : _ → Id _) ∘ f) x = (pure : _ → Id _) (f <$> x)

{α β : Type u_1}
(f : α → β)
(x : Option α)

Option.traverse (pure ∘ f) x = pure (f <$> x)


theorem normAtPlace_eq_zero {x : E K} :
    (∀ w, normAtPlace w x = 0) ↔ x = 0

{x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ)}

(∀ (w : NumberField.InfinitePlace K), (NumberField.mixedEmbedding.normAtPlace w) x = 0) ↔ x = 0


@[simp]
theorem mk_im (z : ℂ) (h : 0 < z.im) : (mk z h).im = z.im


theorem union_pi_inter
    (ht₁ : ∀ i ∉ s₁, t₁ i = univ) (ht₂ : ∀ i ∉ s₂, t₂ i = univ) :
    (s₁ ∪ s₂).pi (fun i ↦ t₁ i ∩ t₂ i) = s₁.pi t₁ ∩ s₂.pi t₂

{ι : Type u_1}
{α : ι → Type u_2}
{s₁ s₂ : Set ι}
{t₁ t₂ : (i : ι) → Set (α i)}
(ht₁ : ∀ i ∉ s₁, t₁ i = Set.univ)
(ht₂ : ∀ i ∉ s₂, t₂ i = Set.univ)

((s₁ ∪ s₂).pi fun i => t₁ i ∩ t₂ i) = s₁.pi t₁ ∩ s₂.pi t₂


theorem StrongMono.of_arrow_iso {A B A' B' : C} {f : A ⟶ B} {g : A' ⟶ B'}
    (e : Arrow.mk f ≅ Arrow.mk g) [h : StrongMono f] : StrongMono g

(e : CategoryTheory.Arrow.mk f ≅ CategoryTheory.Arrow.mk g)


theorem mem_sup_left {S T : StarSubalgebra R A} : ∀ {x : A}, x ∈ S → x ∈ S ⊔ T

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
{S T : StarSubalgebra R A}
{x : A}


@[deprecated get_cons_length (since := "2023-01-05")]
theorem nthLe_cons_length : ∀ (x : α) (xs : List α) (n : ℕ) (h : n = xs.length),
    (x :: xs).nthLe n (by simp [h]) = (x :: xs).getLast (cons_ne_nil x xs)

{α : Type u}
(x : α)
(xs : List α)
(n : ℕ)
(h : n = xs.length)

(x :: xs).nthLe n ⋯ = (x :: xs).getLast ⋯


@[simp] lemma ofENat_lt_lift {x : Cardinal.{v}} {m : ℕ∞} : m < lift.{u} x ↔ m < x


lemma diffs_subset_left : t₁ ⊆ t₂ → s \\ t₁ ⊆ s \\ t₂

{α : Type u_2}
[DecidableEq α]
[GeneralizedBooleanAlgebra α]
{s t₁ t₂ : Finset α}


@[simp]
lemma lift_eqToHom_comp_iff {R' R S : 𝒮} {a b : 𝒳} (f : R ⟶ S) (φ : a ⟶ b) (h : R' = R) :
    p.IsHomLift (eqToHom h ≫ f) φ ↔ p.IsHomLift f φ

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₂} 𝒳]
[CategoryTheory.Category.{v₂, u₁} 𝒮]
(p : 𝒳 ⥤ 𝒮)
{R' R S : 𝒮}
{a b : 𝒳}
(f : R ⟶ S)
(φ : a ⟶ b)
(h : R' = R)

p.IsHomLift (CategoryTheory.eqToHom h ≫ f) φ ↔ p.IsHomLift f φ


@[simp 1100] theorem length_singleton (a : α) : length [a] = 1


theorem neg_apply (f : P →ᴬ[R] W) (x : P) : (-f) x = -f x

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace W]
[TopologicalAddGroup W]
(f : P →ᴬ[R] W)
(x : P)


@[simp]
theorem natTrailingDegree_one : natTrailingDegree (1 : R[X]) = 0


lemma homologyMap'_congr (h : Homotopy φ₁ φ₂) (h₁ : S₁.HomologyData)
    (h₂ : S₂.HomologyData) : homologyMap' φ₁ h₁ h₂ = homologyMap' φ₂ h₁ h₂

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

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

CategoryTheory.ShortComplex.homologyMap' φ₁ h₁ h₂ = CategoryTheory.ShortComplex.homologyMap' φ₂ h₁ h₂


/-- A nonempty set is scaled by zero to the singleton set containing zero. -/
@[simp] lemma zero_smul_finset {s : Finset β} (h : s.Nonempty) : (0 : α) • s = (0 : Finset β)

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
[DecidableEq β]
{s : Finset β}
(h : s.Nonempty)


@[to_additive]
theorem prod_multiset_count [DecidableEq α] [CommMonoid α] (s : Multiset α) :
    s.prod = ∏ m ∈ s.toFinset, m ^ s.count m

{α : Type u_3}
[DecidableEq α]
[AddCommMonoid α]
(s : Multiset α)

s.sum = ∑ m ∈ s.toFinset, Multiset.count m s • m


theorem mono (hs : IsStrongAntichain r₁ s) (h : r₂ ≤ r₁) : IsStrongAntichain r₂ s

{α : Type u_1}
{r₁ r₂ : α → α → Prop}
{s : Set α}
(hs : IsStrongAntichain r₁ s)
(h : r₂ ≤ r₁)


theorem AnalyticOn.eval_polynomial {A} [NormedCommRing A] [NormedAlgebra 𝕜 A] (p : A[X]) :
    AnalyticOn 𝕜 (eval · p) Set.univ

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{A : Type u_5}
[NormedCommRing A]
[NormedAlgebra 𝕜 A]
(p : Polynomial A)

AnalyticOn 𝕜 (fun x => Polynomial.eval x p) Set.univ


theorem add_mul_subset : (f + g) * h ≤ f * h + g * h

{α : Type u_2}
[Distrib α]
{f g h : Filter α}


theorem map_smul_of_tower [CommSemiring S] [Algebra S R] [Module S M] [IsScalarTower S R M]
    [Module S N] [IsScalarTower S R N] (a : S)
    (x : M) : Q (a • x) = (a * a) • Q x

{S : Type u_1}
{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(Q : QuadraticMap R M N)
[CommSemiring S]
[Algebra S R]
[Module S M]
[IsScalarTower S R M]
[Module S N]
[IsScalarTower S R N]
(a : S)
(x : M)


theorem integral_Ioc_eq_integral_Ioo' (hy : μ {y} = 0) :
    ∫ t in Ioc x y, f t ∂μ = ∫ t in Ioo x y, f t ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{μ : MeasureTheory.Measure X}
[PartialOrder X]
{x y : X}
(hy : μ {y} = 0)

∫ (t : X) in Set.Ioc x y, f t ∂μ = ∫ (t : X) in Set.Ioo x y, f t ∂μ


@[to_additive (attr := simp)]
theorem units_inv_left_iff : Commute (↑u⁻¹) a ↔ Commute (↑u) a

{M : Type u_1}
[Monoid M]
{a : M}
{u : Mˣ}


lemma predAbove_of_castSucc_lt (p : Fin n) (i : Fin (n + 1)) (h : castSucc p < i)
    (hi := Fin.ne_zero_of_lt h) : p.predAbove i = i.pred hi

{n : ℕ}
(p : Fin n)
(i : Fin (n + 1))
(h : p.castSucc < i)
(hi : i ≠ 0 := ⋯)


@[simp]
theorem PointedMap.map_pt {Γ Γ'} [Inhabited Γ] [Inhabited Γ'] (f : PointedMap Γ Γ') :
    f default = default

{Γ : Type u_1}
{Γ' : Type u_2}
[Inhabited Γ]
[Inhabited Γ']
(f : Turing.PointedMap Γ Γ')


/-- If `f` is a partition of unity on a set `s : Set X` and `g : ι → X → E` is a family of functions
such that each `g i` is continuous at every point of the topological support of `f i`, then the sum
`fun x ↦ ∑ᶠ i, f i x • g i x` is continuous on the whole space. -/
theorem continuous_finsum_smul [ContinuousAdd E] {g : ι → X → E}
    (hg : ∀ (i), ∀ x ∈ tsupport (f i), ContinuousAt (g i) x) :
    Continuous fun x => ∑ᶠ i, f i x • g i x

(hg : ∀ (i : ι), ∀ x ∈ tsupport ⇑(f i), ContinuousAt (g i) x)

Continuous fun x => ∑ᶠ (i : ι), (f i) x • g i x


@[to_additive]
theorem image_smul : (fun x ↦ a • x) '' t = a • t

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{t : Set β}
{a : α}


theorem union_right {t'} (h : IsMetricSeparated s t) (h' : IsMetricSeparated s t') :
    IsMetricSeparated s (t ∪ t')

{X : Type u_1}
[EMetricSpace X]
{s t t' : Set X}
(h : IsMetricSeparated s t)
(h' : IsMetricSeparated s t')


@[to_additive]
protected lemma div_eq_iff (h : IsUnit b) : a / b = c ↔ a = c * b

{α : Type u}
[SubtractionMonoid α]
{a b c : α}
(h : IsAddUnit b)


theorem integrable_exp_neg_mul_sq_iff {b : ℝ} :
    (Integrable fun x : ℝ => exp (-b * x ^ 2)) ↔ 0 < b

MeasureTheory.Integrable (fun x => rexp (-b * x ^ 2)) MeasureTheory.volume ↔ 0 < b


theorem hasDerivWithinAt_id : HasDerivWithinAt id 1 s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)
(s : Set 𝕜)


@[simp]
theorem ofBoolAlg_top : ofBoolAlg (⊤ : AsBoolAlg α) = 1


/-- The coercion from a non-unital `R`-algebra `A` to its unitization `unitization R A`
realized as a non-unital star algebra homomorphism. -/
@[simps!]
def inrNonUnitalStarAlgHom (R A : Type*) [CommSemiring R] [StarAddMonoid R]
    [NonUnitalSemiring A] [Star A] [Module R A] :
    A →⋆ₙₐ[R] Unitization R A

(R : Type u_1)
(A : Type u_2)
[CommSemiring R]
[StarAddMonoid R]
[NonUnitalSemiring A]
[Star A]
[Module R A]
(a : A)

(Unitization.inrNonUnitalStarAlgHom R A) a = ↑a


@[simp]
theorem nonempty_ulift : Nonempty (ULift α) ↔ Nonempty α

Nonempty (ULift.{u_4, u_1} α) ↔ Nonempty α


theorem univ_nonempty_iff : (univ : Finset α).Nonempty ↔ Nonempty α


@[to_additive (attr := simp)]
lemma oneHom_apply (X Y : MonCat.{u}) (x : X) : (1 : X ⟶ Y) x = 1


/-- Given a family of `n` linearly independent vectors in a finite-dimensional space of
dimension `> n`, one may extend the family by another vector while retaining linear independence. -/
theorem exists_linearIndependent_snoc_of_lt_finrank {n : ℕ} {v : Fin n → M}
    (hv : LinearIndependent R v) (h : n < finrank R M) :
    ∃ (x : M), LinearIndependent R (Fin.snoc v x)

{R : Type u_1}
{M : Type u}
[Ring R]
[AddCommGroup M]
[Module R M]
[HasRankNullity.{u, u_1} R]
[StrongRankCondition R]
{n : ℕ}
{v : Fin n → M}
(hv : LinearIndependent R v)
(h : n < FiniteDimensional.finrank R M)


/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem exists_right_complement'_of_coprime_aux' [Finite G] (hG : Nat.card G = n)
    {N : Subgroup G} [N.Normal] (hN : Nat.Coprime (Nat.card N) N.index) :
    ∃ H : Subgroup G, IsComplement' N H

{n : ℕ}
{G : Type u}
[Group G]
[Finite G]
(hG : Nat.card G = n)
{N : Subgroup G}
[N.Normal]
(hN : (Nat.card ↥N).Coprime N.index)


protected theorem mdifferentiableOn : MDifferentiableOn 𝓘(𝕜, E) 𝓘(𝕜, E') f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
(f : E →L[𝕜] E')
{s : Set E}

MDifferentiableOn 𝓘(𝕜, E) 𝓘(𝕜, E') (⇑f) s


@[simp]
theorem lift_comp_apply (x : K) : lift i j p (i x) = j x

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


@[reassoc]
lemma induced_shiftMap {n : M} {X Y : C} (f : X ⟶ Y⟦n⟧) (a a' : M) (h : n + a = a') :
    letI := induced e M F' e'
    F.shiftMap (L.map f ≫ (L.commShiftIso n).hom.app _) a a' h =
      (e' a).hom.app X ≫ G.shiftMap f a a' h ≫ (e' a').inv.app Y

[((CategoryTheory.whiskeringLeft C D A).obj L).Full]

[((CategoryTheory.whiskeringLeft C D A).obj L).Faithful]

(f : X ⟶ (CategoryTheory.shiftFunctor C n).obj Y)

F.shiftMap (L.map f ≫ (L.commShiftIso n).hom.app Y) a a' h = (e' a).hom.app X ≫ G.shiftMap f a a' h ≫ (e' a').inv.app Y


/-- The initial object in `Factorisation f`, with the domain of `f` as its midpoint. -/
@[simps]
protected def initial : Factorisation f

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


lemma toAffine_neg {P : Fin 3 → F} (hP : W.Nonsingular P) :
    toAffine W (W.neg P) = -toAffine W P

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P : Fin 3 → F}
(hP : W.Nonsingular P)

WeierstrassCurve.Jacobian.Point.toAffine W (W.neg P) = -WeierstrassCurve.Jacobian.Point.toAffine W P


theorem hasDerivAt : HasDerivAt f (f.linear 1) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(f : 𝕜 →ᵃ[𝕜] E)
{x : 𝕜}


theorem embeddingCongr_apply_trans {α₁ β₁ γ₁ α₂ β₂ γ₂ : Sort*} (ea : α₁ ≃ α₂) (eb : β₁ ≃ β₂)
    (ec : γ₁ ≃ γ₂) (f : α₁ ↪ β₁) (g : β₁ ↪ γ₁) :
    Equiv.embeddingCongr ea ec (f.trans g) =
      (Equiv.embeddingCongr ea eb f).trans (Equiv.embeddingCongr eb ec g)

{α₁ : Sort u_1}
{β₁ : Sort u_2}
{γ₁ : Sort u_3}
{α₂ : Sort u_4}
{β₂ : Sort u_5}
{γ₂ : Sort u_6}
(ea : α₁ ≃ α₂)
(eb : β₁ ≃ β₂)
(ec : γ₁ ≃ γ₂)
(f : α₁ ↪ β₁)
(g : β₁ ↪ γ₁)

(ea.embeddingCongr ec) (f.trans g) = ((ea.embeddingCongr eb) f).trans ((eb.embeddingCongr ec) g)


/-- If the left cosets of `t` by elements of `s` are disjoint (but not necessarily distinct!), then
the size of `t` divides the size of `s * t`. -/
@[to_additive "If the left cosets of `t` by elements of `s` are disjoint (but not necessarily
distinct!), then the size of `t` divides the size of `s + t`."]
theorem card_dvd_card_mul_right {s t : Finset α} :
    ((· • t) '' (s : Set α)).PairwiseDisjoint id → t.card ∣ (s * t).card

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

((fun x => x • t) '' ↑s).PairwiseDisjoint id → t.card ∣ (s * t).card


@[simp]
theorem deriv_ccosh (hc : DifferentiableAt ℂ f x) :
    deriv (fun x => Complex.cosh (f x)) x = Complex.sinh (f x) * deriv f x

{f : ℂ → ℂ}
{x : ℂ}
(hc : DifferentiableAt ℂ f x)


theorem IsClosable.closure_mono {f g : E →ₗ.[R] F} (hg : g.IsClosable) (h : f ≤ g) :
    f.closure ≤ g.closure

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


@[simp]
theorem MonovaryOn.empty : MonovaryOn f g ∅

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}


@[simp]
theorem integral_univ_inv_one_add_sq : ∫ (x : ℝ), (1 + x ^ 2)⁻¹ = π


@[to_additive]
theorem le_div_comm : a ≤ b / c ↔ c ≤ b / a

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


@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIso_inv_snd_fst :
    (pullbackDiagonalMapIso f i i₁ i₂).inv ≫ pullback.snd _ _ ≫ pullback.fst _ _ =
      pullback.fst _ _

(i₁ : V₁ ⟶ CategoryTheory.Limits.pullback f i)

(i₂ : V₂ ⟶ CategoryTheory.Limits.pullback f i)

(CategoryTheory.Limits.pullbackDiagonalMapIso f i i₁ i₂).inv ≫
    CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.diagonal f)
        (CategoryTheory.Limits.pullback.map (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
          (i₂ ≫ CategoryTheory.Limits.pullback.snd f i) f f (i₁ ≫ CategoryTheory.Limits.pullback.fst f i)
          (i₂ ≫ CategoryTheory.Limits.pullback.fst f i) i ⋯ ⋯) ≫
      CategoryTheory.Limits.pullback.fst (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
        (i₂ ≫ CategoryTheory.Limits.pullback.snd f i) =
  CategoryTheory.Limits.pullback.fst i₁ i₂


theorem mul_eq_top : a * b = ∞ ↔ a ≠ 0 ∧ b = ∞ ∨ a = ∞ ∧ b ≠ 0

a * b = ⊤ ↔ a ≠ 0 ∧ b = ⊤ ∨ a = ⊤ ∧ b ≠ 0


lemma isConnected_rightwards_iff_downwards :
    IsConnected (w.StructuredArrowRightwards g) ↔ IsConnected (w.CostructuredArrowDownwards g)

{C₁ : Type u₁}
{C₂ : Type u₂}
{C₃ : Type u₃}
{C₄ : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C₁]
[CategoryTheory.Category.{v₂, u₂} C₂]
[CategoryTheory.Category.{v₃, u₃} C₃]
[CategoryTheory.Category.{v₄, u₄} C₄]
{T : CategoryTheory.Functor C₁ C₂}
{L : CategoryTheory.Functor C₁ C₃}
{R : CategoryTheory.Functor C₂ C₄}
{B : CategoryTheory.Functor C₃ C₄}
(w : CategoryTheory.TwoSquare T L R B)
{X₂ : C₂}
{X₃ : C₃}
(g : R.obj X₂ ⟶ B.obj X₃)

CategoryTheory.IsConnected (w.StructuredArrowRightwards g) ↔ CategoryTheory.IsConnected (w.CostructuredArrowDownwards g)


theorem tendsto_nhds_unique_of_eventuallyEq [T2Space X] {f g : Y → X} {l : Filter Y} {a b : X}
    [NeBot l] (ha : Tendsto f l (𝓝 a)) (hb : Tendsto g l (𝓝 b)) (hfg : f =ᶠ[l] g) : a = b

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[T2Space X]
{f g : Y → X}
{l : Filter Y}
{a b : X}
[l.NeBot]
(ha : Filter.Tendsto f l (𝓝 a))
(hb : Filter.Tendsto g l (𝓝 b))
(hfg : f =ᶠ[l] g)


/-- A subgroup has index two if and only if there exists `a` such that for all `b`, exactly one
of `b * a` and `b` belong to `H`. -/
@[to_additive "An additive subgroup has index two if and only if there exists `a` such that
for all `b`, exactly one of `b + a` and `b` belong to `H`."]
theorem index_eq_two_iff : H.index = 2 ↔ ∃ a, ∀ b, Xor' (b * a ∈ H) (b ∈ H)

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

H.index = 2 ↔ ∃ a, ∀ (b : G), Xor' (b + a ∈ H) (b ∈ H)


theorem coe_center : ↑(center R) = Set.center R

↑(NonUnitalSubring.center R) = Set.center R


lemma Functor.commShiftIso_eq_ofInduced (a : A) :
    letI := HasShift.induced F A s i
    letI := Functor.CommShift.ofInduced F A s i
    F.commShiftIso a = (i a).symm

(i : (a : A) → F.comp (s a) ≅ (CategoryTheory.shiftFunctor C a).comp F)

[((CategoryTheory.whiskeringLeft C D D).obj F).Full]

[((CategoryTheory.whiskeringLeft C D D).obj F).Faithful]


@[simp] lemma birkhoffSet_sup (a b : α) : birkhoffSet (a ⊔ b) = birkhoffSet a ∪ birkhoffSet b

{α : Type u_1}
[DistribLattice α]
[Fintype α]
[DecidablePred SupIrred]
(a b : α)

OrderEmbedding.birkhoffSet (a ⊔ b) = OrderEmbedding.birkhoffSet a ∪ OrderEmbedding.birkhoffSet b


/-- Symmetric statement to `Filter.map_map₂_antidistrib_right`. -/
theorem map_map₂_right_anticomm {m : α → β' → γ} {n : β → β'} {m' : β → α → δ} {n' : δ → γ}
    (h_right_anticomm : ∀ a b, m a (n b) = n' (m' b a)) :
    map₂ m f (g.map n) = (map₂ m' g f).map n'

{m : α → β' → γ}

{m' : β → α → δ}

(h_right_anticomm : ∀ (a : α) (b : β), m a (n b) = n' (m' b a))

Filter.map₂ m f (Filter.map n g) = Filter.map n' (Filter.map₂ m' g f)


theorem toSimpleFunc_indicatorConst {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : E) :
    toSimpleFunc (indicatorConst p hs hμs c) =ᵐ[μ]
      (SimpleFunc.const _ c).piecewise s hs (SimpleFunc.const _ 0)

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(c : E)

↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc (MeasureTheory.Lp.simpleFunc.indicatorConst p hs hμs c)) =ᵐ[μ]
  ↑(MeasureTheory.SimpleFunc.piecewise s hs (MeasureTheory.SimpleFunc.const α c) (MeasureTheory.SimpleFunc.const α 0))


@[reassoc (attr := simp)]
lemma pullback.lift_snd {Z : CompHaus.{u}} (a : Z ⟶ X) (b : Z ⟶ Y) (w : a ≫ f = b ≫ g) :
    pullback.lift f g a b w ≫ pullback.snd f g = b

(w : CategoryTheory.CategoryStruct.comp a f = CategoryTheory.CategoryStruct.comp b g)

CategoryTheory.CategoryStruct.comp (CompHaus.pullback.lift f g a b w) (CompHaus.pullback.snd f g) = b


theorem sub_comp (f : M →ₛₗ[σ₁₂] M₂) (g h : M₂ →ₛₗ[σ₂₃] N₃) :
    (g - h).comp f = g.comp f - h.comp f

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M : Type u_9}
{M₂ : Type u_11}
{N₃ : Type u_15}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommGroup N₃]
[Module R₁ M]
[Module R₂ M₂]
[Module R₃ N₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(f : M →ₛₗ[σ₁₂] M₂)
(g h : M₂ →ₛₗ[σ₂₃] N₃)


theorem degree_of_a_eq_zero' : (toPoly ⟨0, b, c, d⟩).degree ≤ 2

{ a := 0, b := b, c := c, d := d }.toPoly.degree ≤ 2


theorem uniformity_eq : 𝓤 (SeparationQuotient α) = (𝓤 α).map (Prod.map mk mk)

𝓤 (SeparationQuotient α) = Filter.map (Prod.map SeparationQuotient.mk SeparationQuotient.mk) (𝓤 α)


@[simp]
theorem coe_toNonUnitalStarSubalgebra (s : NonUnitalSubalgebra R A) (h_star) :
    (s.toNonUnitalStarSubalgebra h_star : Set A) = s

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[Star A]
(s : NonUnitalSubalgebra R A)
(h_star : ∀ x ∈ s, star x ∈ s)

↑(s.toNonUnitalStarSubalgebra h_star) = ↑s


@[simp]
theorem finite_empty : (∅ : Set α).Finite


@[to_additive (attr := simp)]
theorem empty_div (s : Finset α) : ∅ / s = ∅

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


theorem eq_zero_iff (f : α → E) {s : Set α} :
    eVariationOn f s = 0 ↔ ∀ x ∈ s, ∀ y ∈ s, edist (f x) (f y) = 0

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
(f : α → E)
{s : Set α}


@[simp] lemma ofENat_eq_zero {m : ℕ∞} : (m : Cardinal) = 0 ↔ m = 0


/-- The image of a submonoid under a monoid hom is a submonoid of the codomain. -/
@[to_additive
      "The image of an `AddSubmonoid` under an `AddMonoid` hom is an `AddSubmonoid` of the
      codomain."]
theorem IsSubmonoid.image {γ : Type*} [Monoid γ] {f : M → γ} (hf : IsMonoidHom f) {s : Set M}
    (hs : IsSubmonoid s) : IsSubmonoid (f '' s)

{M : Type u_1}
[Monoid M]
{γ : Type u_3}
[Monoid γ]
{f : M → γ}
(hf : IsMonoidHom f)
{s : Set M}
(hs : IsSubmonoid s)


theorem top_pow (n : ℕ) : (⊤ ^ n : Ideal R) = ⊤


theorem biInf_prod {f : β × γ → α} {s : Set β} {t : Set γ} :
    ⨅ x ∈ s ×ˢ t, f x = ⨅ (a ∈ s) (b ∈ t), f (a, b)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_4}
[CompleteLattice α]
{f : β × γ → α}
{s : Set β}
{t : Set γ}

⨅ x ∈ s ×ˢ t, f x = ⨅ a ∈ s, ⨅ b ∈ t, f (a, b)


lemma toNat_lt' {n : ℕ} (hn : n ≠ 0) : m.toNat < n ↔ m < n


@[to_additive (attr := simp)]
theorem inv_bind (f : α → FreeGroup β) (x : FreeGroup α) : x⁻¹ >>= f = (x >>= f)⁻¹

{α β : Type u}
(f : α → FreeAddGroup β)
(x : FreeAddGroup α)


@[simp]
theorem pushoutCoconeOfLeftIso_inr : (pushoutCoconeOfLeftIso f g).inr = 𝟙 _

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

(CategoryTheory.Limits.pushoutCoconeOfLeftIso f g).inr = 𝟙 Z


theorem nonneg_iff [NonUnitalSemiring R] [PartialOrder R] [StarRing R] [StarOrderedRing R] {x : R} :
    0 ≤ x ↔ x ∈ AddSubmonoid.closure (Set.range fun s : R => star s * s)

{R : Type u}
[NonUnitalSemiring R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
{x : R}

0 ≤ x ↔ x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)


@[simp]
theorem destruct_cons (a : α) (s) : destruct (cons a s) = Computation.pure (some (a, s))

{α : Type u}
(a : α)
(s : Stream'.WSeq α)

(Stream'.WSeq.cons a s).destruct = Computation.pure (some (a, s))


@[simp]
theorem comap_bot : comap m ⊥ = ⊥


/-- If `p : W → Prop` holds for all simple reflections, it holds for the identity, and it is
preserved under multiplication, then it holds for all elements of `W`. -/
theorem simple_induction {p : W → Prop} (w : W) (simple : ∀ i : B, p (s i)) (one : p 1)
    (mul : ∀ w w' : W, p w → p w' → p (w * w')) : p w

(mul : ∀ (w w' : W), p w → p w' → p (w * w'))


@[simp] protected theorem lt_irrefl (a : Fin n) : ¬ a < a


theorem _root_.AddMonoidHom.map_trace [AddCommMonoid S] (f : R →+ S) (A : Matrix n n R) :
    f (trace A)  = trace (f.mapMatrix A)

{n : Type u_3}
{R : Type u_6}
{S : Type u_7}
[Fintype n]
[AddCommMonoid R]
[AddCommMonoid S]
(f : R →+ S)
(A : Matrix n n R)


@[to_additive (attr := simp)]
protected theorem map_one {β} (f : α → β) : (1 : WithTop α).map f = (f 1 : WithTop β)

{α : Type u}
[One α]
{β : Type u_1}
(f : α → β)