@[simp]
theorem idealRange_eq_top_of_surjective (h : Function.Surjective f) : f.idealRange = ⊤

{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')
(h : Function.Surjective ⇑f)


@[simp]
theorem image_Iic (e : α ≃o β) (a : α) : e '' Iic a = Iic (e a)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ≃o β)
(a : α)


theorem lf_iff_sub_zero_lf {x y : PGame} : x ⧏ y ↔ 0 ⧏ y - x


/-- Two formal power series are equal if all their coefficients are equal. -/
theorem ext_iff {φ ψ : R⟦X⟧} : φ = ψ ↔ ∀ n, coeff R n φ = coeff R n ψ

{R : Type u_1}
[Semiring R]
{φ ψ : PowerSeries R}

φ = ψ ↔ ∀ (n : ℕ), (PowerSeries.coeff R n) φ = (PowerSeries.coeff R n) ψ


@[to_additive (attr := simp)]
lemma map_comp_pow [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) (g : ι → G) (n : ℕ) :
    f ∘ (g ^ n) = f ∘ g ^ n

{ι : Type u_1}
{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[Group G]
[DivisionMonoid H]
[MonoidHomClass F G H]
(f : F)
(g : ι → G)
(n : ℕ)


private theorem leftInv_eq_rightInv_aux (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F)
    (h : p 1 = (continuousMultilinearCurryFin1 𝕜 E F).symm i) (h0 : p 0 = 0) :
    leftInv p i = rightInv p i

(h : p 1 = (continuousMultilinearCurryFin1 𝕜 E F).symm ↑i)


theorem cos_sq' : cos x ^ 2 = 1 - sin x ^ 2


@[simp] lemma map_add_left_Ico (a b c : α) :
    (Ico a b).map (addLeftEmbedding c) = Ico (c + a) (c + b)

{α : Type u_2}
[OrderedCancelAddCommMonoid α]
[ExistsAddOfLE α]
[LocallyFiniteOrder α]
(a b c : α)

Finset.map (addLeftEmbedding c) (Finset.Ico a b) = Finset.Ico (c + a) (c + b)


/-- **Cauchy integral formula**: if `f : ℂ → E` is complex differentiable on an open disc and is
continuous on its closure, then for any `w` in this open ball we have
$\oint_{|z-c|=R}(z-w)^{-1}f(z)\,dz=2πif(w)$. -/
theorem _root_.DiffContOnCl.circleIntegral_sub_inv_smul {R : ℝ} {c w : ℂ} {f : ℂ → E}
    (h : DiffContOnCl ℂ f (ball c R)) (hw : w ∈ ball c R) :
    (∮ z in C(c, R), (z - w)⁻¹ • f z) = (2 * π * I : ℂ) • f w

(h : DiffContOnCl ℂ f (Metric.ball c R))

(∮ (z : ℂ) in C(c, R), (z - w)⁻¹ • f z) = (2 * ↑π * Complex.I) • f w


theorem zsmul_apply (z : ℤ) (f : M →ₗ⁅R,L⁆ N) (m : M) : (z • f) m = z • f m

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
(z : ℤ)
(f : M →ₗ⁅R,L⁆ N)
(m : M)


theorem Nontrivial.einfsep_ne_top (hs : s.Nontrivial) : s.einfsep ≠ ∞

{α : Type u_1}
[PseudoMetricSpace α]
{s : Set α}
(hs : s.Nontrivial)


@[measurability]
theorem aemeasurable_id : AEMeasurable id μ

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


theorem HasStrictDerivAt.clog_real {f : ℝ → ℂ} {x : ℝ} {f' : ℂ} (h₁ : HasStrictDerivAt f f' x)
    (h₂ : f x ∈ slitPlane) : HasStrictDerivAt (fun t => log (f t)) (f' / f x) x

{f : ℝ → ℂ}
{x : ℝ}
{f' : ℂ}
(h₁ : HasStrictDerivAt f f' x)
(h₂ : f x ∈ Complex.slitPlane)

HasStrictDerivAt (fun t => Complex.log (f t)) (f' / f x) x


/-- A morphism between target objects `T ⟶ T'`
covariantly induces a functor between costructured arrows,
`CostructuredArrow S T ⥤ CostructuredArrow S T'`.

Ideally this would be described as a 2-functor from `D`
(promoted to a 2-category with equations as 2-morphisms)
to `Cat`.
-/
@[simps!]
def map (f : T ⟶ T') : CostructuredArrow S T ⥤ CostructuredArrow S T'

(X : CategoryTheory.Comma S (CategoryTheory.Functor.fromPUnit T))

((CategoryTheory.CostructuredArrow.map f).obj X).right = X.right


protected theorem mul_left_cancel_iff {n: Nat} (p : 0 < n) (m k : Nat) : n * m = n * k ↔ m = k


theorem integral_truncation_eq_intervalIntegral_of_nonneg (hf : AEStronglyMeasurable f μ) {A : ℝ}
    (h'f : 0 ≤ f) : ∫ x, truncation f A x ∂μ = ∫ y in (0)..A, y ∂Measure.map f μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

∫ (x : α), ProbabilityTheory.truncation f A x ∂μ = ∫ (y : ℝ) in 0 ..A, y ∂MeasureTheory.Measure.map f μ


lemma eq_zero_of_dvd_of_nonneg_of_lt (hm : 0 ≤ m) (hmn : m < n) (hnm : n ∣ m) : m = 0

{m n : ℤ}
(hm : 0 ≤ m)
(hmn : m < n)
(hnm : n ∣ m)


lemma exists_mem_ne (hs : 1 < s.card) (a : α) : ∃ b ∈ s, b ≠ a

{α : Type u_1}
{s : Finset α}
(hs : 1 < s.card)
(a : α)


@[to_additive] lemma leOnePart_def (f : ∀ i, α i) : f⁻ = fun i ↦ (f i)⁻

{ι : Type u_3}
{α : ι → Type u_4}
[(i : ι) → Lattice (α i)]
[(i : ι) → AddCommGroup (α i)]
(f : (i : ι) → α i)


@[continuity, fun_prop]
theorem continuous_bot {t : TopologicalSpace β} : Continuous[⊥, t] f

{α : Type u}
{β : Type v}
{f : α → β}
{t : TopologicalSpace β}


/-- If `f` and `g` are two equal morphisms of monads, then the functors of algebras induced by them
are isomorphic.
We define it like this as opposed to using `eqToIso` so that the components are nicer to prove
lemmas about.
-/
@[simps (config := { rhsMd := .default })]
def algebraFunctorOfMonadHomEq {T₁ T₂ : Monad C} {f g : T₁ ⟶ T₂} (h : f = g) :
    algebraFunctorOfMonadHom f ≅ algebraFunctorOfMonadHom g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T₁ T₂ : CategoryTheory.Monad C}
{f g : T₁ ⟶ T₂}
(h : f = g)
(X : T₂.Algebra)

((CategoryTheory.Monad.algebraFunctorOfMonadHomEq h).hom.app X).f =
  (CategoryTheory.Iso.refl ((CategoryTheory.Monad.algebraFunctorOfMonadHom f).obj X).A).hom


@[reassoc] -- Porting note: simp can solve both versions
theorem biprod.inl_snd {X Y : C} [HasBinaryBiproduct X Y] :
    (biprod.inl : X ⟶ X ⊞ Y) ≫ (biprod.snd : X ⊞ Y ⟶ Y) = 0

CategoryTheory.Limits.biprod.inl ≫ CategoryTheory.Limits.biprod.snd = 0


/-- If the sign of the angle between three points is negative, the first two points are not
equal. -/
theorem left_ne_of_oangle_sign_eq_neg_one {p₁ p₂ p₃ : P} (h : (∡ p₁ p₂ p₃).sign = -1) : p₁ ≠ p₂

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


theorem AEMeasurable.prod_swap [SFinite μ] [SFinite ν] {f : β × α → γ}
    (hf : AEMeasurable f (ν.prod μ)) : AEMeasurable (fun z : α × β => f z.swap) (μ.prod ν)

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[MeasurableSpace α]
[MeasurableSpace β]
[MeasurableSpace γ]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite μ]
[MeasureTheory.SFinite ν]
{f : β × α → γ}
(hf : AEMeasurable f (ν.prod μ))

AEMeasurable (fun z => f z.swap) (μ.prod ν)


theorem smul_eval_comm (lc : LinearCombo) (i : Int) (v : Coeffs) :
    (i * lc).eval v = lc.eval v * i

(lc : Lean.Omega.LinearCombo)
(i : Int)
(v : Lean.Omega.Coeffs)


protected theorem acc [IsTrans β s] (f : r ≺i s) (a : α) : Acc r a ↔ Acc s (f a)

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
[IsTrans β s]
(f : r ≺i s)
(a : α)


@[simp]
theorem isOrtho_smul_left {x y : M₄} {a : R₄} (ha : a ≠ 0) :
    IsOrtho G (a • x) y ↔ IsOrtho G x y

{R₄ : Type u_7}
{M₄ : Type u_8}
[CommRing R₄]
[IsDomain R₄]
[AddCommGroup M₄]
[Module R₄ M₄]
{G : LinearMap.BilinForm R₄ M₄}
{x y : M₄}
{a : R₄}
(ha : a ≠ 0)


protected theorem eventually_smallSets (hf : LocallyFinite f) (x : X) :
    ∀ᶠ s in (𝓝 x).smallSets, { i | (f i ∩ s).Nonempty }.Finite

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

∀ᶠ (s : Set X) in (𝓝 x).smallSets, {i | (f i ∩ s).Nonempty}.Finite


/-- Second Fundamental Domain Lemma: if both `z` and `g • z` are in the open domain `𝒟ᵒ`,
where `z : ℍ` and `g : SL(2,ℤ)`, then `z = g • z`. -/
theorem eq_smul_self_of_mem_fdo_mem_fdo (hz : z ∈ 𝒟ᵒ) (hg : g • z ∈ 𝒟ᵒ) : z = g • z

{g : SL(2, ℤ)}
{z : ℍ}
(hz : z ∈ ModularGroup.fdo)
(hg : g • z ∈ ModularGroup.fdo)


theorem vadd_apply (f : E →ₗ[R] F) (g : E →ₗ.[R] F) (x : (f +ᵥ g).domain) :
    (f +ᵥ g) x = f x + g x

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(f : E →ₗ[R] F)
(g : E →ₗ.[R] F)
(x : ↥(f +ᵥ g).domain)


lemma W.isLocallySurjective (hf : J.W f) : Presheaf.IsLocallySurjective J f

{J : CategoryTheory.GrothendieckTopology C}


@[reassoc (attr := simp)]
lemma ι_descMapObj {A : C} {j : J}
    (φ : ∀ (i : I) (_ : p i = j), X i ⟶ A) (i : I) (hi : p i = j) :
    X.ιMapObj p i j hi ≫ X.descMapObj p φ = φ i hi

{I : Type u_1}
{J : Type u_2}
{C : Type u_4}
[CategoryTheory.Category.{u_5, u_4} C]
(X : CategoryTheory.GradedObject I C)
(p : I → J)
[X.HasMap p]
{A : C}
{j : J}
(φ : (i : I) → p i = j → (X i ⟶ A))
(i : I)
(hi : p i = j)

CategoryTheory.CategoryStruct.comp (X.ιMapObj p i j hi) (X.descMapObj p φ) = φ i hi


theorem div_le_one_iff : a / b ≤ 1 ↔ 0 < b ∧ a ≤ b ∨ b = 0 ∨ b < 0 ∧ b ≤ a

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


@[reassoc (attr := simp)]
theorem app_invApp (U : Opens Y) :
    f.1.c.app (op U) ≫ H.invApp ((Opens.map f.1.base).obj U) =
      Y.presheaf.map
        ((homOfLE (Set.image_preimage_subset f.1.base U.1)).op :
          op U ⟶ op (opensFunctor f |>.obj ((Opens.map f.1.base).obj U)))

{X Y : AlgebraicGeometry.LocallyRingedSpace}

[H : AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion f]

(U : TopologicalSpace.Opens ↑Y.toTopCat)

f.val.c.app (Opposite.op U) ≫
    AlgebraicGeometry.LocallyRingedSpace.IsOpenImmersion.invApp f ((TopologicalSpace.Opens.map f.val.base).obj U) =
  Y.presheaf.map (CategoryTheory.homOfLE ⋯).op


theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint s t) :
    condCount s u * condCount (s ∪ t) s + condCount t u * condCount (s ∪ t) t =
      condCount (s ∪ t) u

{Ω : Type u_1}
[MeasurableSpace Ω]
[MeasurableSingletonClass Ω]
{s t u : Set Ω}
(hs : s.Finite)
(ht : t.Finite)
(hst : Disjoint s t)

(ProbabilityTheory.condCount s) u * (ProbabilityTheory.condCount (s ∪ t)) s +
    (ProbabilityTheory.condCount t) u * (ProbabilityTheory.condCount (s ∪ t)) t =
  (ProbabilityTheory.condCount (s ∪ t)) u


/-- We say that a 1-morphism `h` commutes with the left Kan extension `f⁺ g` if the whiskered
left extension for `f⁺ g` by `h` is a Kan extension of `g ≫ h` along `f`. -/
class Lan.CommuteWith
    (f : a ⟶ b) (g : a ⟶ c) [HasLeftKanExtension f g] {x : B} (h : c ⟶ x) : Prop where
  commute : Nonempty <| IsKan <| (lanLeftExtension f g).whisker h

[self : CategoryTheory.Bicategory.Lan.CommuteWith f g h]

Nonempty ((CategoryTheory.Bicategory.lanLeftExtension f g).whisker h).IsKan


/-- `OneHomClass F M N` states that `F` is a type of one-preserving homomorphisms.
You should extend this typeclass when you extend `OneHom`.
-/
@[to_additive]
class OneHomClass (F : Type*) (M N : outParam Type*) [One M] [One N] [FunLike F M N] : Prop where
  /-- The proposition that the function preserves 1 -/
  map_one : ∀ f : F, f 1 = 1

{F : Type u_10}
{M : outParam (Type u_11)}
{N : outParam (Type u_12)}
[One M]
[One N]
[FunLike F M N]
[self : OneHomClass F M N]
(f : F)


@[simp]
theorem levenshtein_cons_nil (x : α) (xs : List α) :
    levenshtein C (x :: xs) [] = C.delete x + levenshtein C xs []

{α : Type u_1}
{β : Type u_2}
{δ : Type u_3}
[AddZeroClass δ]
[Min δ]
{C : Levenshtein.Cost α β δ}
(x : α)
(xs : List α)


@[simp]
theorem map₂Right'_nil_left : map₂Right' f [] bs = (bs.map (f none), [])

{α : Type u}
{β : Type v}
{γ : Type w}
(f : Option α → β → γ)
(bs : List β)

List.map₂Right' f [] bs = (List.map (f none) bs, [])


@[norm_cast]
theorem coe_list_sum (l : List ℚ≥0) : (l.sum : ℚ) = (l.map (↑)).sum


theorem Ne.inf_lt_or_inf_lt : a ≠ b → a ⊓ b < a ∨ a ⊓ b < b

{α : Type u}
[SemilatticeInf α]
{a b : α}


/-- An uncurried version of `Finset.prod_product_right`. -/
@[to_additive "An uncurried version of `Finset.sum_product_right`"]
theorem prod_product_right' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
    ∏ x ∈ s ×ˢ t, f x.1 x.2 = ∏ y ∈ t, ∏ x ∈ s, f x y

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[AddCommMonoid β]
{s : Finset γ}
{t : Finset α}
{f : γ → α → β}

∑ x ∈ s ×ˢ t, f x.1 x.2 = ∑ y ∈ t, ∑ x ∈ s, f x y


lemma isConjExponent_iff_eq_conjExponent (hp : 1 < p) : p.IsConjExponent q ↔ q = p / (p - 1)


theorem iteratedDerivWithin_neg :
    iteratedDerivWithin n (-f) s x = -iteratedDerivWithin n f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{x : 𝕜}
{s : Set 𝕜}
(hx : x ∈ s)
(h : UniqueDiffOn 𝕜 s)
(f : 𝕜 → F)


theorem Quotient.eq_mk_iff_out [s : Setoid α] {x : Quotient s} {y : α} :
    x = ⟦y⟧ ↔ Quotient.out x ≈ y

{α : Sort u_1}
[s : Setoid α]
{x : Quotient s}
{y : α}


theorem mem_of_mem_getLast? {l : List α} {a : α} (ha : a ∈ l.getLast?) : a ∈ l

{α : Type u}
{l : List α}
{a : α}
(ha : a ∈ l.getLast?)


@[simp]
theorem comap_mk_nhds_mk : comap mk (𝓝 (mk x)) = 𝓝 x

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

Filter.comap SeparationQuotient.mk (𝓝 (SeparationQuotient.mk x)) = 𝓝 x


/-- If finsets `s` and `t` are interleaved, then `Finset.card s ≤ Finset.card (t \ s) + 1`. -/
theorem card_le_diff_of_interleaved {s t : Finset α}
    (h :
      ∀ᵉ (x ∈ s) (y ∈ s),
        x < y → (∀ z ∈ s, z ∉ Set.Ioo x y) → ∃ z ∈ t, x < z ∧ z < y) :
    s.card ≤ (t \ s).card + 1

(h : ∀ x ∈ s, ∀ y ∈ s, x < y → (∀ z ∈ s, z ∉ Set.Ioo x y) → ∃ z ∈ t, x < z ∧ z < y)


theorem map_ciSup (e : α ≃o β) {f : ι → α} (hf : BddAbove (range f)) :
    e (⨆ i, f i) = ⨆ i, e (f i)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
[ConditionallyCompleteLattice β]
[Nonempty ι]
(e : α ≃o β)
{f : ι → α}
(hf : BddAbove (Set.range f))


theorem memℓp_gen_iff (hp : 0 < p.toReal) {f : ∀ i, E i} :
    Memℓp f p ↔ Summable fun i => ‖f i‖ ^ p.toReal

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
(hp : 0 < p.toReal)
{f : (i : α) → E i}


theorem contDiffAt_pi' (hΦ : ∀ i, ContDiffAt K n (fun x => Φ x i) x) : ContDiffAt K n Φ x

(hΦ : ∀ (i : ι), ContDiffAt K n (fun x => Φ x i) x)


@[simp]
theorem verts_bot : (⊥ : G.Subgraph).verts = ∅


/-- The contravariant categorical equivalence between augmented simplicial
objects and augmented cosimplicial objects in the opposite category. -/
@[simps! functor inverse]
def simplicialCosimplicialAugmentedEquiv :
    (SimplicialObject.Augmented C)ᵒᵖ ≌ CosimplicialObject.Augmented Cᵒᵖ

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

(CategoryTheory.simplicialCosimplicialAugmentedEquiv C).functor = CategoryTheory.simplicialToCosimplicialAugmented C


@[simp]
theorem hom_eq_iff {X Y : StructuredArrow S T} (f g : X ⟶ Y) : f = g ↔ f.right = g.right

{X Y : CategoryTheory.StructuredArrow S T}


theorem alternatingWord_succ' (i i' : B) (m : ℕ) :
    alternatingWord i i' (m + 1) = (if Even m then i' else i) :: alternatingWord i i' m

CoxeterSystem.alternatingWord i i' (m + 1) = (if Even m then i' else i) :: CoxeterSystem.alternatingWord i i' m


@[to_additive IsAddHaarMeasure.smul]
theorem IsHaarMeasure.smul {c : ℝ≥0∞} (cpos : c ≠ 0) (ctop : c ≠ ∞) : IsHaarMeasure (c • μ)

{G : Type u_2}
[MeasurableSpace G]
[AddGroup G]
[TopologicalSpace G]
(μ : MeasureTheory.Measure G)
[μ.IsAddHaarMeasure]
{c : ℝ≥0∞}
(cpos : c ≠ 0)
(ctop : c ≠ ⊤)


/-- Giving a hom between two families of generators is equivalent to
giving an algebra homomorphism between the polynomial rings. -/
@[simps]
noncomputable
def Hom.equivAlgHom :
    Hom P P' ≃ { f : P.Ring →ₐ[R] P'.Ring //
      ∀ x, aeval P'.val (f x) = algebraMap S S' (aeval P.val x) }

(f : { f // ∀ (x : P.Ring), (MvPolynomial.aeval P'.val) (f x) = (algebraMap S S') ((MvPolynomial.aeval P.val) x) })

(Algebra.Generators.Hom.equivAlgHom.symm f).val i = ↑f (MvPolynomial.X i)


@[simp]
lemma equalizerSieve_self_eq_top {F : Cᵒᵖ ⥤ D} {X : Cᵒᵖ} (x : F.obj X) :
    equalizerSieve x x = ⊤

(x : (CategoryTheory.forget D).obj (F.obj X))

CategoryTheory.Presheaf.equalizerSieve x x = ⊤


@[simp] lemma head_smash {p q : RelSeries r} (h : p.last = q.head) :
    (smash p q h).head = p.head

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


@[simp]
theorem aleph_cof {o : Ordinal} (ho : o.IsLimit) : (aleph o).ord.cof = o.cof


lemma Fibration.isLowerSet_image [LE α] [LE β] (hf : Fibration (· ≤ ·) (· ≤ ·) f)
    {s : Set α} (hs : IsLowerSet s) : IsLowerSet (f '' s)

(hf : Relation.Fibration (fun x x_1 => x ≤ x_1) (fun x x_1 => x ≤ x_1) f)


@[reassoc]
theorem wideCoequalizer.condition (j₁ j₂ : J) :
    f j₁ ≫ wideCoequalizer.π f = f j₂ ≫ wideCoequalizer.π f

CategoryTheory.CategoryStruct.comp (f j₁) (CategoryTheory.Limits.wideCoequalizer.π f) =
  CategoryTheory.CategoryStruct.comp (f j₂) (CategoryTheory.Limits.wideCoequalizer.π f)


@[simp]
theorem toPGame_add_mk' (a b : Ordinal) : (⟦a.toPGame⟧ + ⟦b.toPGame⟧ : Game) = ⟦(a ♯ b).toPGame⟧

⟦a.toPGame⟧ + ⟦b.toPGame⟧ = ⟦(a ♯ b).toPGame⟧


theorem biUnion_congr_of_le (h : π₁ = π₂) (hi : ∀ J ≤ I, πi₁ J = πi₂ J) :
    π₁.biUnion πi₁ = π₂.biUnion πi₂

{πi₁ πi₂ : (J : BoxIntegral.Box ι) → BoxIntegral.Prepartition J}


@[simp]
theorem cardinal_mk_of_countable_of_charZero [CharZero A] [IsDomain R] :
    #{ x : A // IsAlgebraic R x } = ℵ₀

(R : Type u)
(A : Type v)
[CommRing R]
[CommRing A]
[IsDomain A]
[Algebra R A]
[NoZeroSMulDivisors R A]
[Countable R]
[CharZero A]
[IsDomain R]


@[simp]
lemma homMk₄_app_three :
    (homMk₄ app₀ app₁ app₂ app₃ app₄ w₀ w₁ w₂ w₃).app ⟨3, by valid⟩ = app₃

{f g : CategoryTheory.ComposableArrows C 4}

(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 ⋯ ⋯))

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

(w₃ :
  CategoryTheory.CategoryStruct.comp (f.map' 3 4 ⋯ ⋯) app₄ = CategoryTheory.CategoryStruct.comp app₃ (g.map' 3 4 ⋯ ⋯))

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


theorem ofNat_shiftLeft_eq {x y : Nat} : (x <<< y : Int) = (x : Int) * (2 ^ y : Nat)


theorem dist_eq_sub_of_le_right {n m : ℕ} (h : m ≤ n) : dist n m = n - m


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

(hfm : MeasureTheory.StronglyMeasurable f)

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


@[simp] lemma sub_τ₁ (φ φ' : S₁ ⟶ S₂) : (φ - φ').τ₁ = φ.τ₁ - φ'.τ₁

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ φ' : S₁ ⟶ S₂)

(φ - φ').τ₁ = φ.τ₁ - φ'.τ₁


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

{ι : Sort u_1}
{R : Type u_2}
[NonAssocSemiring R]
(S : ι → Subsemiring R)


protected theorem injective (e : L₁ ≃ₗ⁅R⁆ L₂) : Function.Injective ((e : L₁ →ₗ⁅R⁆ L₂) : L₁ → L₂)

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


theorem unit_right {a : α} (ha : ¬IsUnit a) (u : αˣ) : multiplicity a u = 0

{α : Type u_1}
[CommMonoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a : α}
(ha : ¬IsUnit a)
(u : αˣ)


theorem modEq_iff_dvd : a ≡ b [MOD n] ↔ (n : ℤ) ∣ b - a


/-- Hypothesis for `LinearPMap.sup` holds, if `f.domain` is disjoint with `g.domain`. -/
theorem sup_h_of_disjoint (f g : E →ₗ.[R] F) (h : Disjoint f.domain g.domain) (x : f.domain)
    (y : g.domain) (hxy : (x : E) = y) : f x = g y

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(f g : E →ₗ.[R] F)
(h : Disjoint f.domain g.domain)
(x : ↥f.domain)
(y : ↥g.domain)
(hxy : ↑x = ↑y)


theorem count_le_card (a : α) (s) : count a s ≤ card s

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


@[to_additive]
theorem coe_of (R : Type u) [CommMonoid R] : (CommMonCat.of R : Type u) = R


theorem MeasurePreserving.integrableOn_comp_preimage [MeasurableSpace β] {e : α → β} {ν}
    (h₁ : MeasurePreserving e μ ν) (h₂ : MeasurableEmbedding e) {f : β → E} {s : Set β} :
    IntegrableOn (f ∘ e) (e ⁻¹' s) μ ↔ IntegrableOn f s ν

(h₁ : MeasureTheory.MeasurePreserving e μ ν)

MeasureTheory.IntegrableOn (f ∘ e) (e ⁻¹' s) μ ↔ MeasureTheory.IntegrableOn f s ν


/-- A multiplicative analogue of `Equiv.arrowCongr`,
where the equivalence between the targets is multiplicative.
-/
@[to_additive (attr := simps apply) "An additive analogue of `Equiv.arrowCongr`,
  where the equivalence between the targets is additive."]
def arrowCongr {M N P Q : Type*} [Mul P] [Mul Q] (f : M ≃ N) (g : P ≃* Q) :
    (M → P) ≃* (N → Q)

{M : Type u_12}
{N : Type u_13}
{P : Type u_14}
{Q : Type u_15}
[Mul P]
[Mul Q]
(f : M ≃ N)
(g : P ≃* Q)
(h : M → P)
(n : N)

(MulEquiv.arrowCongr f g) h n = g (h (f.symm n))


@[simp]
theorem not_supIrred_bot : ¬SupIrred (⊥ : α)

{α : Type u_2}
[SemilatticeSup α]
[OrderBot α]


theorem union_add_inter (s t : Multiset α) : s ∪ t + s ∩ t = s + t

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


theorem minpoly_gen (α : E) :
    minpoly F (AdjoinSimple.gen F α) = minpoly F α

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(α : E)

minpoly F (IntermediateField.AdjoinSimple.gen F α) = minpoly F α


theorem Periodic.const_inv_smul [AddMonoid α] [Group γ] [DistribMulAction γ α] (h : Periodic f c)
    (a : γ) : Periodic (fun x => f (a⁻¹ • x)) (a • c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{c : α}
[AddMonoid α]
[Group γ]
[DistribMulAction γ α]
(h : Function.Periodic f c)
(a : γ)

Function.Periodic (fun x => f (a⁻¹ • x)) (a • c)


theorem coe_inj ⦃η η' : ApplicativeTransformation F G⦄ (h : (η : ∀ α, F α → G α) = η') :
    η = η'

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


/-- A component that corresponds to zero in the direct limit is already zero in some
bigger module in the directed system. -/
theorem of.zero_exact [IsDirected ι (· ≤ ·)] {i x} (H : of R ι G f i x = 0) :
    ∃ j hij, f i j hij x = (0 : G j)

[DirectedSystem G fun i j h => ⇑(f i j h)]

(H : (Module.DirectLimit.of R ι G f i) x = 0)


/-- If `f` and `g` are continuous on `[a, b]`, `a < b`, `f x ≤ g x` on this interval, and
`f c < g c` at some point `c ∈ [a, b]`, then `∫ x in a..b, f x < ∫ x in a..b, g x`. -/
theorem integral_lt_integral_of_continuousOn_of_le_of_exists_lt {f g : ℝ → ℝ} {a b : ℝ}
    (hab : a < b) (hfc : ContinuousOn f (Icc a b)) (hgc : ContinuousOn g (Icc a b))
    (hle : ∀ x ∈ Ioc a b, f x ≤ g x) (hlt : ∃ c ∈ Icc a b, f c < g c) :
    (∫ x in a..b, f x) < ∫ x in a..b, g x

{f g : ℝ → ℝ}
{a b : ℝ}
(hab : a < b)
(hfc : ContinuousOn f (Set.Icc a b))
(hgc : ContinuousOn g (Set.Icc a b))
(hle : ∀ x ∈ Set.Ioc a b, f x ≤ g x)
(hlt : ∃ c ∈ Set.Icc a b, f c < g c)

∫ (x : ℝ) in a..b, f x < ∫ (x : ℝ) in a..b, g x


lemma cfcₙ_star_id : cfcₙ (star · : R → R) a = star a


theorem disjiUnion_map {s : Finset α} {t : α → Finset β} {f : β ↪ γ} {h} :
    (s.disjiUnion t h).map f =
      s.disjiUnion (fun a => (t a).map f) (h.mono' fun _ _ ↦ (disjoint_map _).2)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Finset α}
{t : α → Finset β}
{f : β ↪ γ}
{h : (↑s).PairwiseDisjoint t}

Finset.map f (s.disjiUnion t h) = s.disjiUnion (fun a => Finset.map f (t a)) ⋯


theorem length_eq_zero_of_head_eq_head_of_last_eq_last_of_length_eq_zero
    {s₁ s₂ : CompositionSeries X} (hb : s₁.head = s₂.head)
    (ht : s₁.last = s₂.last) (hs₁ : s₁.length = 0) : s₂.length = 0

(hb : RelSeries.head s₁ = RelSeries.head s₂)

(ht : RelSeries.last s₁ = RelSeries.last s₂)


@[to_additive const_nonneg_of_nonneg]
theorem one_le_const_of_one_le (ha : 1 ≤ a) : 1 ≤ const β a

{α : Type u_3}
(β : Type u_4)
[Zero α]
[Preorder α]
{a : α}
(ha : 0 ≤ a)


@[to_additive (attr := simp)]
theorem snd_inv : s⁻¹.snd = s.fst⁻¹

{α : Type u_2}
[OrderedAddCommGroup α]
(s : NonemptyInterval α)


@[simp]
theorem mem_infs : c ∈ s ⊼ t ↔ ∃ a ∈ s, ∃ b ∈ t, a ⊓ b = c

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


theorem mul_pos (ha : a ≠ 0) (hb : b ≠ 0) : 0 < a * b


@[to_additive (attr := simp)]
theorem con_ker_mk : Con.ker mk = coprodCon M N

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]

Con.ker Monoid.Coprod.mk = Monoid.coprodCon M N


@[simp]
theorem prod_empty : s ×ˢ (∅ : Set β) = ∅

{α : Type u_1}
{β : Type u_2}
{s : Set α}


theorem toPartENat_apply_of_lt_aleph0 {c : Cardinal} (h : c < ℵ₀) : toPartENat c = toNat c

{c : Cardinal.{u_1}}
(h : c < Cardinal.aleph0)

Cardinal.toPartENat c = ↑(Cardinal.toNat c)


/-- The chosen binary product on `J ⥤ C`. -/
@[simps]
def chosenProd : J ⥤ C

{J : Type u_1}
{C : Type u_2}
[CategoryTheory.Category.{u_3, u_1} J]
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.ChosenFiniteProducts C]
(F₁ F₂ : CategoryTheory.Functor J C)

∀ {X Y : J} (φ : X ⟶ Y), (F₁.chosenProd F₂).map φ = CategoryTheory.MonoidalCategory.tensorHom (F₁.map φ) (F₂.map φ)


lemma iSup_coe_eq_top : ⨆ i, (f i : ℕ∞) = ⊤ ↔ ¬ BddAbove (range f)

⨆ i, ↑(f i) = ⊤ ↔ ¬BddAbove (Set.range f)


theorem equivalence₂UnitIso_eq : (equivalence₂ eB hF).unitIso = equivalence₂UnitIso eB hF

{A : Type u_1}
{A' : Type u_2}
{B : Type u_3}
{B' : Type u_4}
[CategoryTheory.Category.{u_5, u_1} A]
[CategoryTheory.Category.{u_7, u_2} A']
[CategoryTheory.Category.{u_6, u_3} B]
[CategoryTheory.Category.{u_8, u_4} B']
{eA : A ≌ A'}
(eB : B ≌ B')
{e' : A' ≌ B'}
{F : A ⥤ B'}
(hF : eA.functor ⋙ e'.functor ≅ F)

(AlgebraicTopology.DoldKan.Compatibility.equivalence₂ eB hF).unitIso =
  AlgebraicTopology.DoldKan.Compatibility.equivalence₂UnitIso eB hF


@[to_additive]
lemma IsMulFreimanIso.isMulFreimanHom (hf : IsMulFreimanIso n A B f) : IsMulFreimanHom n A B f

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


@[ext] theorem ext ⦃inst₁ inst₂ : NonUnitalNonAssocCommRing R⦄
    (h_add : local_hAdd[R, inst₁] = local_hAdd[R, inst₂])
    (h_mul : local_hMul[R, inst₁] = local_hMul[R, inst₂]) :
    inst₁ = inst₂


/-- Extending the domain of Hahn series is an algebra homomorphism. -/
@[simps!]
def embDomainAlgHom (f : Γ →+ Γ') (hfi : Function.Injective f)
    (hf : ∀ g g' : Γ, f g ≤ f g' ↔ g ≤ g') : HahnSeries Γ A →ₐ[R] HahnSeries Γ' A

(hf : ∀ (g g' : Γ), f g ≤ f g' ↔ g ≤ g')

∀ (a : HahnSeries Γ A) (b : Γ'),
  ((HahnSeries.embDomainAlgHom f hfi hf) a).coeff b =
    if h : ∃ x, ¬a.coeff x = 0 ∧ f x = b then a.coeff (Classical.choose ⋯) else 0


/-- The direction of `⊥` is the submodule `⊥`. -/
@[simp]
theorem direction_bot : (⊥ : AffineSubspace k P).direction = ⊥

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


lemma diracProbaInverse_eq [T0Space X] {x : X} {μ : range (diracProba (X := X))}
    (h : μ = diracProba x) :
    diracProbaInverse μ = x

{μ : ↑(Set.range MeasureTheory.diracProba)}


@[simp]
theorem id_fiber' (X : Grothendieck F) :
    Hom.fiber (𝟙 X) = eqToHom (by erw [CategoryTheory.Functor.map_id, Functor.id_obj X.fiber])

{F : CategoryTheory.Functor C CategoryTheory.Cat}

(CategoryTheory.CategoryStruct.id X).fiber = CategoryTheory.eqToHom ⋯


theorem nnnorm_le_iff {r : ℝ≥0} {A : Matrix m n α} : ‖A‖₊ ≤ r ↔ ∀ i j, ‖A i j‖₊ ≤ r

{m : Type u_3}
{n : Type u_4}
{α : Type u_5}
[Fintype m]
[Fintype n]
[SeminormedAddCommGroup α]
{r : ℝ≥0}
{A : Matrix m n α}

‖A‖₊ ≤ r ↔ ∀ (i : m) (j : n), ‖A i j‖₊ ≤ r


/-- A filter is disjoint from the cocompact filter if and only if it contains a compact set. -/
theorem disjoint_cocompact_right (f : Filter X) :
    Disjoint f (Filter.cocompact X) ↔ ∃ K ∈ f, IsCompact K

{X : Type u}
[TopologicalSpace X]
(f : Filter X)


@[simp]
theorem mapIso_refl (F : C ⥤ D) (X : C) : F.mapIso (Iso.refl X) = Iso.refl (F.obj X)

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

F.mapIso (CategoryTheory.Iso.refl X) = CategoryTheory.Iso.refl (F.obj X)


theorem bot_coprod_bot : (⊥ : Filter α).coprod (⊥ : Filter β) = ⊥


theorem HasFDerivWithinAt.rpow_const (hf : HasFDerivWithinAt f f' s x) (h : f x ≠ 0 ∨ 1 ≤ p) :
    HasFDerivWithinAt (fun x => f x ^ p) ((p * f x ^ (p - 1)) • f') s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{x : E}
{s : Set E}
{p : ℝ}
(hf : HasFDerivWithinAt f f' s x)
(h : f x ≠ 0 ∨ 1 ≤ p)


theorem apply_coe_mem_map (f : F) {p : Submodule R M} (r : p) : f r ∈ map f p

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


@[simp]
theorem supIrred_iff_not_isMin : SupIrred a ↔ ¬IsMin a


@[to_additive]
theorem inv_le (S T : Submonoid G) : S⁻¹ ≤ T ↔ S ≤ T⁻¹

{G : Type u_2}
[Group G]
(S T : Submonoid G)

S⁻¹ ≤ T ↔ S ≤ T⁻¹


lemma ιTensorObj₄_eq (i₁ i₂ i₃ i₄ j : I) (h : i₁ + i₂ + i₃ + i₄ = j) (i₂₃₄ : I)
    (hi : i₂ + i₃ + i₄ = i₂₃₄) :
    ιTensorObj₄ X₁ X₂ X₃ X₄ i₁ i₂ i₃ i₄ j h =
      (_ ◁ ιTensorObj₃ X₂ X₃ X₄ i₂ i₃ i₄ _ hi) ≫
        ιTensorObj X₁ (tensorObj X₂ (tensorObj X₃ X₄)) i₁ i₂₃₄ j
          (by rw [← hi, ← add_assoc, ← add_assoc, h])

(X₁ X₂ X₃ X₄ : CategoryTheory.GradedObject I C)

[X₂.HasTensor (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄)]

[X₁.HasTensor
    (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄))]

CategoryTheory.GradedObject.Monoidal.ιTensorObj₄ X₁ X₂ X₃ X₄ i₁ i₂ i₃ i₄ j h =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerLeft (X₁ i₁)
      (CategoryTheory.GradedObject.Monoidal.ιTensorObj₃ X₂ X₃ X₄ i₂ i₃ i₄ i₂₃₄ hi))
    (CategoryTheory.GradedObject.Monoidal.ιTensorObj X₁
      (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄)) i₁ i₂₃₄
      j ⋯)


@[simp]
protected theorem NNReal.tendsto_pow_atTop_nhds_zero_iff {r : ℝ≥0} :
    Tendsto (fun n : ℕ => r ^ n) atTop (𝓝 0) ↔ r < 1

Filter.Tendsto (fun n => r ^ n) Filter.atTop (𝓝 0) ↔ r < 1


lemma Module.FinitePresentation.fg_ker [Module.Finite R M]
    [h : Module.FinitePresentation R N] (l : M →ₗ[R] N) (hl : Function.Surjective l) :
    (LinearMap.ker l).FG

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[Ring R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[Module.Finite R M]
[h : Module.FinitePresentation R N]
(l : M →ₗ[R] N)
(hl : Function.Surjective ⇑l)


theorem factorial_mul_factorial_dvd_factorial {n k : ℕ} (hk : k ≤ n) : k ! * (n - k)! ∣ n !


theorem map_id_eq : map (𝟙 X) = 𝟭 (Opens X)

TopologicalSpace.Opens.map (𝟙 X) = 𝟭 (TopologicalSpace.Opens ↑X)


@[to_additive]
lemma ofUnits_inf (S T : Subgroup Mˣ) : (S ⊔ T).ofUnits = S.ofUnits ⊔ T.ofUnits

{M : Type u_1}
[AddMonoid M]
(S T : AddSubgroup (AddUnits M))

(S ⊔ T).ofAddUnits = S.ofAddUnits ⊔ T.ofAddUnits


@[simp] theorem not_beq_eq_true_eq (a b : Nat) : ((!(a == b)) = true) = ¬(a = b)


theorem ofReal_cinfi (f : α → ℝ) [Nonempty α] :
    ENNReal.ofReal (⨅ i, f i) = ⨅ i, ENNReal.ofReal (f i)


@[simp]
theorem ofSubsingleton_toAlternatingMap [Subsingleton ι] (i : ι) (f : M →L[R] N) :
    (ofSubsingleton R M N i f).toAlternatingMap = AlternatingMap.ofSubsingleton R M N i f

(R : Type u_1)
(M : Type u_2)
(N : Type u_4)
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
[Subsingleton ι]
(i : ι)
(f : M →L[R] N)

((ContinuousAlternatingMap.ofSubsingleton R M N i) f).toAlternatingMap = (AlternatingMap.ofSubsingleton R M N i) ↑f


/-- Multiplying by all the matrices either in `listTransvecCol M` and `listTransvecRow M` turns
the matrix in block-diagonal form. -/
theorem isTwoBlockDiagonal_listTransvecCol_mul_mul_listTransvecRow
    (hM : M (inr unit) (inr unit) ≠ 0) :
    IsTwoBlockDiagonal ((listTransvecCol M).prod * M * (listTransvecRow M).prod)

(M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜)

((Matrix.Pivot.listTransvecCol M).prod * M * (Matrix.Pivot.listTransvecRow M).prod).IsTwoBlockDiagonal


@[simp]
protected theorem lt_sup_iff : a < s.sup f ↔ ∃ b ∈ s, a < f b

{α : Type u_2}
{ι : Type u_5}
[LinearOrder α]
[OrderBot α]
{s : Finset ι}
{f : ι → α}
{a : α}


@[simp, rclike_simps]
theorem mul_im : ∀ z w : K, im (z * w) = re z * im w + im z * re w

RCLike.im (z * w) = RCLike.re z * RCLike.im w + RCLike.im z * RCLike.re w


theorem HasDerivWithinAt.Ioi_iff_Ioo [LinearOrder 𝕜] [OrderClosedTopology 𝕜] {x y : 𝕜} (h : x < y) :
    HasDerivWithinAt f f' (Ioo x y) x ↔ HasDerivWithinAt f f' (Ioi x) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
[LinearOrder 𝕜]
[OrderClosedTopology 𝕜]
{x y : 𝕜}
(h : x < y)

HasDerivWithinAt f f' (Set.Ioo x y) x ↔ HasDerivWithinAt f f' (Set.Ioi x) x


theorem append_of_mem {a : α} {l : List α} : a ∈ l → ∃ s t : List α, l = s ++ a :: t


theorem re_eq_add_conj (z : K) : ↑(re z) = (z + conj z) / 2

↑(RCLike.re z) = (z + (starRingEnd K) z) / 2


@[simp, norm_cast] lemma ofRat_nnratCast (q : ℚ≥0) : ofRat (q : β) = (q : Cauchy abv)

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[DivisionRing β]
{abv : β → α}
[IsAbsoluteValue abv]
(q : ℚ≥0)


lemma char_is_prime_of_pos (p : ℕ) [NeZero p] [CharP R p] : Fact p.Prime

(R : Type u_1)
[NonAssocSemiring R]
[NoZeroDivisors R]
[Nontrivial R]
(p : ℕ)
[NeZero p]
[CharP R p]


/-- The inner product of a nonzero vector with a negative multiple of
itself, divided by the product of their norms, has value -1. -/
theorem real_inner_div_norm_mul_norm_eq_neg_one_of_ne_zero_of_neg_mul {x : F} {r : ℝ} (hx : x ≠ 0)
    (hr : r < 0) : ⟪x, r • x⟫_ℝ / (‖x‖ * ‖r • x‖) = -1

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{x : F}
{r : ℝ}
(hx : x ≠ 0)
(hr : r < 0)


lemma comm_trans_lTensor_trans_comm_eq (g : N ≃ₗ[R] P) :
    TensorProduct.comm R N Q ≪≫ₗ lTensor Q g ≪≫ₗ TensorProduct.comm R Q P = rTensor Q g

{R : Type u_1}
[CommSemiring R]
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R N]
[Module R P]
[Module R Q]
(g : N ≃ₗ[R] P)

TensorProduct.comm R N Q ≪≫ₗ LinearEquiv.lTensor Q g ≪≫ₗ TensorProduct.comm R Q P = LinearEquiv.rTensor Q g


lemma IsTerminal.isZero {X : C} (hX : IsTerminal X) : IsZero X

(hX : CategoryTheory.Limits.IsTerminal X)


@[to_additive] lemma mabs_of_lt_one (h : a < 1) : |a|ₘ = a⁻¹

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


@[simp]
theorem id_comp (f : CompleteLatticeHom α β) : (CompleteLatticeHom.id β).comp f = f

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : CompleteLatticeHom α β)


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

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

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


lemma abs_eq_iff_mul_self_eq : |a| = |b| ↔ a * a = b * b

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


@[simp] lemma map_surjective :
    Surjective (ULift.map f : ULift.{u'} α → ULift.{v'} β) ↔ Surjective f

Function.Surjective (ULift.map f) ↔ Function.Surjective f


lemma preadditiveYoneda_map_distinguished
    (T : Triangle C) (hT : T ∈ distTriang C) (B : C) :
    ((shortComplexOfDistTriangle T hT).op.map (preadditiveYoneda.obj B)).Exact

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

((CategoryTheory.Pretriangulated.shortComplexOfDistTriangle T hT).op.map (CategoryTheory.preadditiveYoneda.obj B)).Exact


@[simp]
theorem comp_toNatTrans {F G H : LaxBraidedFunctor C D} {α : F ⟶ G} {β : G ⟶ H} :
    (α ≫ β).toNatTrans = @CategoryStruct.comp (C ⥤ D) _ _ _ _ α.toNatTrans β.toNatTrans

{F G H : CategoryTheory.LaxBraidedFunctor C D}

(α ≫ β).toNatTrans = α.toNatTrans ≫ β.toNatTrans


@[simp]
theorem support_zero [∀ (i : ι) (x : β i), Decidable (x ≠ 0)] : (0 : ⨁ i, β i).support = ∅

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]


@[simp]
theorem apply_at (φ : K →+* ℂ) (x : K) : (NumberField.canonicalEmbedding K x) φ = φ x

{K : Type u_1}
[Field K]
(φ : K →+* ℂ)
(x : K)

(NumberField.canonicalEmbedding K) x φ = φ x


theorem IsRelPrime.of_mul_add_left_right (h : IsRelPrime x (x * z + y)) : IsRelPrime x y

{R : Type u}
[CommSemiring R]
{x y z : R}
(h : IsRelPrime x (x * z + y))


/--
Given `R`-module X and `S`-module Y and a map `X ⟶ (restrictScalars f).obj Y`, i.e `R`-linear map
`X ⟶ Y`, there is a map `(extend_scalars f).obj X ⟶ Y`, i.e `S`-linear map `S ⨂ X → Y` by
`s ⊗ x ↦ s • g x`.
-/
@[simps apply]
def HomEquiv.fromExtendScalars {X Y} (g : X ⟶ (restrictScalars f).obj Y) :
    (extendScalars f).obj X ⟶ Y

(g : X ⟶ (ModuleCat.restrictScalars f).obj Y)

(z : ↑((ModuleCat.extendScalars f).obj X))

(ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.fromExtendScalars f g) z =
  (TensorProduct.lift
      { toFun := fun s => ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.evalAt f s g, map_add' := ⋯, map_smul' := ⋯ })
    z


theorem sub_pow_char_of_commute [Ring R] {p : ℕ} [Fact p.Prime] [CharP R p] (x y : R)
    (h : Commute x y) : (x - y) ^ p = x ^ p - y ^ p

(R : Type u_1)
[Ring R]
{p : ℕ}
[Fact (Nat.Prime p)]
[CharP R p]
(x y : R)
(h : Commute x y)


theorem leftInverse_rangeSplitting (f : α → β) :
    LeftInverse (rangeFactorization f) (rangeSplitting f)

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

Function.LeftInverse (Set.rangeFactorization f) (Set.rangeSplitting f)


@[to_additive (attr := simp)]
theorem image_mul_left : (a * ·) '' t = (a⁻¹ * ·) ⁻¹' t

{α : Type u_2}
[Group α]
{t : Set α}
{a : α}

(fun x => a * x) '' t = (fun x => a⁻¹ * x) ⁻¹' t


protected theorem dist_triangle (x y z : Completion α) : dist x z ≤ dist x y + dist y z

{α : Type u}
[PseudoMetricSpace α]
(x y z : UniformSpace.Completion α)


theorem inl_snd' {b : BinaryBicone X Y} (h : b.IsBilimit) :
    IsPushout b.inl (0 : X ⟶ 0) b.snd (0 : 0 ⟶ Y)

{b : CategoryTheory.Limits.BinaryBicone X Y}

CategoryTheory.IsPushout b.inl 0 b.snd 0


/-- A morphism of monoid objects induces a "restriction" or "comap" functor
between the categories of module objects.
-/
@[simps]
def comap {A B : Mon_ C} (f : A ⟶ B) : Mod_ B ⥤ Mod_ A

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{A B : Mon_ C}
(f : A ⟶ B)
(M : Mod_ B)


@[fun_prop]
theorem DifferentiableWithinAt.const_mul (ha : DifferentiableWithinAt 𝕜 a s x) (b : 𝔸) :
    DifferentiableWithinAt 𝕜 (fun y => b * a y) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s : Set E}
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a : E → 𝔸}
(ha : DifferentiableWithinAt 𝕜 a s x)
(b : 𝔸)


@[to_additive]
theorem mul_eq_map₂ [Mul β] (f g : α →ₛ β) : f * g = (pair f g).map fun p : β × β => p.1 * p.2

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Mul β]
(f g : MeasureTheory.SimpleFunc α β)

f * g = MeasureTheory.SimpleFunc.map (fun p => p.1 * p.2) (f.pair g)


@[simp]
theorem relNorm_eq_bot_iff {I : Ideal S} : relNorm R I = ⊥ ↔ I = ⊥

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
[Algebra R S]
[IsDomain R]
[IsDomain S]
[IsDedekindDomain R]
[IsDedekindDomain S]
[Module.Finite R S]
[Module.Free R S]
{I : Ideal S}


protected theorem Connected.ofBoxProdLeft (h : (G □ H).Connected) : G.Connected

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{H : SimpleGraph β}
(h : (G □ H).Connected)


theorem HasDerivAt.hasDerivAtFilter (h : HasDerivAt f f' x) (hL : L ≤ 𝓝 x) :
    HasDerivAtFilter f f' x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{L : Filter 𝕜}
(h : HasDerivAt f f' x)
(hL : L ≤ 𝓝 x)


@[simp] lemma toSubspaceUnit_isMono {C : (ι → α) → κ} : l.toSubspaceUnit.IsMono C ↔ l.IsMono C

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

Combinatorics.Subspace.IsMono C l.toSubspaceUnit ↔ Combinatorics.Line.IsMono C l


@[simp]
lemma ofColex_inj {s t : Colex α} : ofColex s = ofColex t ↔ s = t


theorem nat_gcd_helper_dvd_right (x y : ℕ) (h : x % y = 0) : Nat.gcd x y = y


/-- Ternary version of `fderivWithin.comp`, with equality assumptions of basepoints added, in
  order to apply more easily as a rewrite from right-to-left. -/
theorem fderivWithin.comp₃ {g' : G → G'} {g : F → G} {t : Set F} {u : Set G} {y : F} {y' : G}
    (hg' : DifferentiableWithinAt 𝕜 g' u y') (hg : DifferentiableWithinAt 𝕜 g t y)
    (hf : DifferentiableWithinAt 𝕜 f s x) (h2g : MapsTo g t u) (h2f : MapsTo f s t) (h3g : g y = y')
    (h3f : f x = y) (hxs : UniqueDiffWithinAt 𝕜 s x) :
    fderivWithin 𝕜 (g' ∘ g ∘ f) s x =
      (fderivWithin 𝕜 g' u y').comp ((fderivWithin 𝕜 g t y).comp (fderivWithin 𝕜 f s x))


@[simp]
theorem diagramNatTrans_zero [Preadditive D] (X : C) (P Q : Cᵒᵖ ⥤ D) :
    J.diagramNatTrans (0 : P ⟶ Q) X = 0

(J : CategoryTheory.GrothendieckTopology C)

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

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


/-- When we have an adjunction `G ⊣ F`, any commutative square where the left
map is of the form `i` and the right map is `F.map p` has an "adjoint" commutative
square whose left map is `G.map i` and whose right map is `p`. -/
theorem left_adjoint (sq : CommSq u i (F.map p) v) (adj : G ⊣ F) :
    CommSq ((adj.homEquiv _ _).symm u) (G.map i) p ((adj.homEquiv _ _).symm v)

(sq : CategoryTheory.CommSq u i (F.map p) v)

CategoryTheory.CommSq ((adj.homEquiv A X).symm u) (G.map i) p ((adj.homEquiv B Y).symm v)


lemma map_distinguished_exact [F.IsHomological] (T : Triangle C) (hT : T ∈ distTriang C) :
    ((shortComplexOfDistTriangle T hT).map F).Exact

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

((CategoryTheory.Pretriangulated.shortComplexOfDistTriangle T hT).map F).Exact


@[to_additive]
protected lemma eq_mul_inv_iff_mul_eq (h : IsUnit c) : a = b * c⁻¹ ↔ a * c = b

{α : Type u}
[DivisionMonoid α]
{a b c : α}
(h : IsUnit c)


@[simp]
theorem support_inv (σ : Perm α) : support σ⁻¹ = σ.support

{α : Type u_1}
[DecidableEq α]
[Fintype α]
(σ : Equiv.Perm α)


theorem prod_sup_eq_top {s : Finset ι} {J : ι → Ideal R} (h : ∀ i, i ∈ s → J i ⊔ I = ⊤) :
    (∏ i ∈ s, J i) ⊔ I = ⊤

{R : Type u}
{ι : Type u_1}
[CommSemiring R]
{I : Ideal R}
{s : Finset ι}
{J : ι → Ideal R}
(h : ∀ i ∈ s, J i ⊔ I = ⊤)


@[simp]
theorem equiv_of_fintype_self_embedding_to_embedding [Finite α] (e : α ↪ α) :
    e.equivOfFintypeSelfEmbedding.toEmbedding = e


theorem IsCompact.exists_isLUB [ClosedIciTopology α] {s : Set α} (hs : IsCompact s)
    (ne_s : s.Nonempty) : ∃ x ∈ s, IsLUB s x

{α : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[ClosedIciTopology α]
{s : Set α}
(hs : IsCompact s)
(ne_s : s.Nonempty)


theorem hasBasis_nhds_adic (I : Ideal R) (x : R) :
    HasBasis (@nhds R I.adicTopology x) (fun _n : ℕ => True) fun n =>
      (fun y => x + y) '' (I ^ n : Ideal R)

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(x : R)

(𝓝 x).HasBasis (fun _n => True) fun n => (fun y => x + y) '' ↑(I ^ n)


lemma groupCohomologyπ_comp_isoH2_hom  :
    groupCohomologyπ A 2 ≫ (isoH2 A).hom =
      (isoTwoCocycles A).hom ≫ (shortComplexH2 A).moduleCatHomologyπ

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

groupCohomologyπ A 2 ≫ (groupCohomology.isoH2 A).hom =
  (groupCohomology.isoTwoCocycles A).hom ≫ (groupCohomology.shortComplexH2 A).moduleCatHomologyπ


@[to_additive]
theorem sym_ne_one_iff [One α] (a : α) : sym a ≠ (1 : αˢʸᵐ) ↔ a ≠ (1 : α)


theorem even_interleave (s₁ s₂ : Stream' α) : even (s₁ ⋈ s₂) = s₁


theorem card_fintype_Ioo_of_lt (h : a < b) : (Fintype.card (Set.Ioo a b) : ℤ) = b - a - 1

↑(Fintype.card ↑(Set.Ioo a b)) = b - a - 1


@[reassoc]
theorem app_p_comm : P.p.app X ≫ f.f.app X = f.f.app X ≫ Q.p.app X

{P Q : CategoryTheory.Idempotents.Karoubi (J ⥤ C)}


@[simp]
lemma homMkSucc_app_succ (i : ℕ) (hi : i + 1 < n + 1 + 1) :
    (homMkSucc α β w).app ⟨i + 1, hi⟩ = app' β i

{F G : CategoryTheory.ComposableArrows C (n + 1)}

(w :
  CategoryTheory.CategoryStruct.comp (F.map' 0 1 ⋯ ⋯) (CategoryTheory.ComposableArrows.app' β 0 ⋯) =
    CategoryTheory.CategoryStruct.comp α (G.map' 0 1 ⋯ ⋯))

(CategoryTheory.ComposableArrows.homMkSucc α β w).app ⟨i + 1, hi⟩ = CategoryTheory.ComposableArrows.app' β i ⋯


theorem CPolynomialAt.analyticAt (hf : CPolynomialAt 𝕜 f x) : AnalyticAt 𝕜 f x

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


@[simp]
theorem BinaryCofan.mk_inr {P : C} (ι₁ : X ⟶ P) (ι₂ : Y ⟶ P) : (BinaryCofan.mk ι₁ ι₂).inr = ι₂

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

(CategoryTheory.Limits.BinaryCofan.mk ι₁ ι₂).inr = ι₂


theorem functor_obj_map_obj {X Y : TopCat} {f : X ⟶ Y} (hf : IsOpenMap f) (U : Opens Y) :
    hf.functor.obj ((Opens.map f).obj U) = hf.functor.obj ⊤ ⊓ U

{X Y : TopCat}
{f : X ⟶ Y}
(hf : IsOpenMap ⇑f)
(U : TopologicalSpace.Opens ↑Y)

hf.functor.obj ((TopologicalSpace.Opens.map f).obj U) = hf.functor.obj ⊤ ⊓ U


@[simp]
theorem coe_sum [AddCommMonoid β] [ContinuousAdd β] {ι : Type*} (s : Finset ι) (f : ι → C_c(α, β)) :
    ⇑(∑ i in s, f i) = ∑ i in s, (f i : α → β)

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[AddCommMonoid β]
[ContinuousAdd β]
{ι : Type u_5}
(s : Finset ι)
(f : ι → α →C_c β)


theorem productMap_range : (productMap f g).range = f.range ⊔ g.range

{R : Type uR}
{S : Type uS}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Semiring B]
[CommSemiring S]
[Algebra R A]
[Algebra R B]
[Algebra R S]
(f : A →ₐ[R] S)
(g : B →ₐ[R] S)

(Algebra.TensorProduct.productMap f g).range = f.range ⊔ g.range


@[simp]
lemma Cone.toStructuredArrow_comp_toUnder_comp_forget {F : J ⥤ C} (c : Cone F) :
    c.toStructuredArrow ⋙ StructuredArrow.toUnder _ _ ⋙ Under.forget _ = F

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : CategoryTheory.Functor J C}
(c : CategoryTheory.Limits.Cone F)

c.toStructuredArrow.comp ((CategoryTheory.StructuredArrow.toUnder c.pt F).comp (CategoryTheory.Under.forget c.pt)) = F


lemma mem_distTriang_op_iff' (T : Triangle Cᵒᵖ) :
    (T ∈ distTriang Cᵒᵖ) ↔ ∃ (T' : Triangle C) (_ : T' ∈ distTriang C),
      Nonempty (T ≅ (triangleOpEquivalence C).functor.obj (Opposite.op T'))

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

(T : CategoryTheory.Pretriangulated.Triangle Cᵒᵖ)

T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles ↔
  ∃ T',
    ∃ (_ : T' ∈ CategoryTheory.Pretriangulated.distinguishedTriangles),
      Nonempty (T ≅ (CategoryTheory.Pretriangulated.triangleOpEquivalence C).functor.obj (Opposite.op T'))


theorem toBoolAlg_inj {a b : α} : toBoolAlg a = toBoolAlg b ↔ a = b


lemma toMvPolynomial_eval_eq_apply (f : M₁ →ₗ[R] M₂) (i : ι₂) (c : ι₁ →₀ R) :
    eval c (f.toMvPolynomial b₁ b₂ i) = b₂.repr (f (b₁.repr.symm c)) i

{R : Type u_1}
{M₁ : Type u_2}
{M₂ : Type u_3}
{ι₁ : Type u_4}
{ι₂ : Type u_5}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
[Fintype ι₁]
[Finite ι₂]
[DecidableEq ι₁]
(b₁ : Basis ι₁ R M₁)
(b₂ : Basis ι₂ R M₂)
(f : M₁ →ₗ[R] M₂)
(i : ι₂)
(c : ι₁ →₀ R)

(MvPolynomial.eval ⇑c) (LinearMap.toMvPolynomial b₁ b₂ f i) = (b₂.repr (f (b₁.repr.symm c))) i


theorem measurable_condDistrib (hs : MeasurableSet s) :
    Measurable[mβ.comap X] fun a => condDistrib Y X μ (X a) s

{α : Type u_1}
{β : Type u_2}
{Ω : Type u_3}
[MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{mα : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
{X : α → β}
{Y : α → Ω}
{mβ : MeasurableSpace β}
{s : Set Ω}
(hs : MeasurableSet s)

Measurable fun a => ((ProbabilityTheory.condDistrib Y X μ) (X a)) s


theorem ediv_mul_cancel_of_emod_eq_zero {a b : Int} (H : a % b = 0) : a / b * b = a


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


theorem irreducible_iff_prime {p : ℕ} : Irreducible p ↔ _root_.Prime p


theorem one_le_abs {z : ℤ} (h₀ : z ≠ 0) : 1 ≤ |z|


@[simp]
theorem associated_apply (x y : M) : associatedHom S Q x y = ⅟ (2 : R) • (Q (x + y) - Q x - Q y)

(S : Type u_1)
{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[CommSemiring S]
[Algebra S R]
[Module S N]
[IsScalarTower S R N]
[Invertible 2]
(Q : QuadraticMap R M N)
(x y : M)

(((QuadraticMap.associatedHom S) Q) x) y = ⅟2 • (Q (x + y) - Q x - Q y)


/-- All n-simplices among cospherical points in an n-dimensional
subspace have the same circumcenter. -/
theorem exists_circumcenter_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P}
    (h : ps ⊆ s) [Nonempty s] {n : ℕ} [FiniteDimensional ℝ s.direction]
    (hd : finrank ℝ s.direction = n) (hc : Cospherical ps) :
    ∃ c : P, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumcenter = c

(hd : FiniteDimensional.finrank ℝ ↥s.direction = n)

∃ c, ∀ (sx : Affine.Simplex ℝ P n), Set.range sx.points ⊆ ps → sx.circumcenter = c


theorem IsMinOn.neg (hf : IsMinOn f s a) : IsMaxOn (fun x => -f x) s a

{α : Type u}
{β : Type v}
[OrderedAddCommGroup β]
{f : α → β}
{a : α}
{s : Set α}
(hf : IsMinOn f s a)


protected theorem injective [Nontrivial R] : Injective x

{ι : Type u_1}
{R : Type u_3}
{A : Type u_5}
{x : ι → A}
[CommRing R]
[CommRing A]
[Algebra R A]
(hx : AlgebraicIndependent R x)
[Nontrivial R]


@[to_additive]
theorem ite_one_mul {P : Prop} [Decidable P] {a b : M} :
    ite P 1 (a * b) = ite P 1 a * ite P 1 b

{M : Type u}
[AddZeroClass M]
{P : Prop}
[Decidable P]
{a b : M}

(if P then 0 else a + b) = (if P then 0 else a) + if P then 0 else b


@[to_additive]
theorem div_le_iff_le_mul' : a / b ≤ c ↔ a ≤ b * c

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


theorem coeff_X_pow (m n : ℕ) : coeff R m ((X : R⟦X⟧) ^ n) = if m = n then 1 else 0

(PowerSeries.coeff R m) (PowerSeries.X ^ n) = if m = n then 1 else 0


@[reassoc]
theorem leftUnitor_inv_tensor_id (X Y : C) : (λ_ X).inv ⊗ 𝟙 Y = (λ_ _).inv ≫ (α_ _ _ _).inv

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.MonoidalCategory C]
(X Y : C)

CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.MonoidalCategory.leftUnitor X).inv (𝟙 Y) =
  (CategoryTheory.MonoidalCategory.leftUnitor (CategoryTheory.MonoidalCategory.tensorObj X Y)).inv ≫
    (CategoryTheory.MonoidalCategory.associator (𝟙_ C) X Y).inv


@[to_additive]
theorem closure_subset {s t : Set G} (ht : IsSubgroup t) (h : s ⊆ t) : closure s ⊆ t

{G : Type u_1}
[AddGroup G]
{s t : Set G}
(ht : IsAddSubgroup t)
(h : s ⊆ t)


@[simp]
theorem norm_smulRightL_apply (c : E →L[𝕜] 𝕜) (f : Fₗ) : ‖smulRightL 𝕜 E Fₗ c f‖ = ‖c‖ * ‖f‖

{𝕜 : Type u_1}
{E : Type u_4}
{Fₗ : Type u_7}
[NormedAddCommGroup E]
[NormedAddCommGroup Fₗ]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 Fₗ]
(c : E →L[𝕜] 𝕜)
(f : Fₗ)

‖((ContinuousLinearMap.smulRightL 𝕜 E Fₗ) c) f‖ = ‖c‖ * ‖f‖


theorem continuousOn_extChartAt_symm (x : M) :
    ContinuousOn (extChartAt I x).symm (extChartAt I x).target

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
[ChartedSpace H M]
(x : M)

ContinuousOn (↑(extChartAt I x).symm) (extChartAt I x).target


theorem types_hom {α β : Type u} : (α ⟶ β) = (α → β)

(α ⟶ β) = (α → β)


theorem add_div_two_lt_right : (a + b) / 2 < b ↔ a < b

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


@[to_additive (attr := simp)]
theorem unit_of_val_units {a : Mˣ} (h : IsUnit (a : M)) : h.unit = a

{M : Type u_1}
[Monoid M]
{a : Mˣ}
(h : IsUnit ↑a)


lemma nonsingular_neg_of {x y : R} (h : W.Nonsingular x <| W.negY x y) : W.Nonsingular x y

{R : Type u}
[CommRing R]
{W : WeierstrassCurve.Affine R}
{x y : R}
(h : W.Nonsingular x (W.negY x y))


theorem pmap_res (l : Filter α) (s : Set α) (f : α → β) :
    pmap (PFun.res f s) l = map f (l ⊓ 𝓟 s)

{α : Type u}
{β : Type v}
(l : Filter α)
(s : Set α)
(f : α → β)

Filter.pmap (PFun.res f s) l = Filter.map f (l ⊓ Filter.principal s)


theorem IndepFun.mgf_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
    (hX : AEStronglyMeasurable (fun ω => exp (t * X ω)) μ)
    (hY : AEStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
    mgf (X + Y) μ t = mgf X μ t * mgf Y μ t

(h_indep : ProbabilityTheory.IndepFun X Y μ)

(hX : MeasureTheory.AEStronglyMeasurable (fun ω => rexp (t * X ω)) μ)

(hY : MeasureTheory.AEStronglyMeasurable (fun ω => rexp (t * Y ω)) μ)

ProbabilityTheory.mgf (X + Y) μ t = ProbabilityTheory.mgf X μ t * ProbabilityTheory.mgf Y μ t


/-- The downward **local LYM inequality**. `𝒜` takes up less of `α^(r)` (the finsets of card `r`)
than `∂𝒜` takes up of `α^(r - 1)`. -/
theorem card_div_choose_le_card_shadow_div_choose (hr : r ≠ 0)
    (h𝒜 : (𝒜 : Set (Finset α)).Sized r) : (𝒜.card : 𝕜) / (Fintype.card α).choose r
    ≤ (∂ 𝒜).card / (Fintype.card α).choose (r - 1)

{𝕜 : Type u_1}
{α : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
[Fintype α]
{𝒜 : Finset (Finset α)}
{r : ℕ}
(hr : r ≠ 0)
(h𝒜 : Set.Sized r ↑𝒜)

↑𝒜.card / ↑((Fintype.card α).choose r) ≤ ↑(∂ 𝒜).card / ↑((Fintype.card α).choose (r - 1))


/-- The `n`-th Chebyshev polynomial of the first kind evaluates on `cos θ` to the
value `cos (n * θ)`. -/
@[simp]
theorem T_complex_cos (n : ℤ) : (T ℂ n).eval (cos θ) = cos (n * θ)

Polynomial.eval (Complex.cos θ) (Polynomial.Chebyshev.T ℂ n) = Complex.cos (↑n * θ)


@[simp]
theorem Icc_diff_right : Icc a b \ {b} = Ico a b

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


theorem mem_of_pi_mem_pi [∀ i, NeBot (f i)] {I : Set ι} (h : I.pi s ∈ pi f) {i : ι} (hi : i ∈ I) :
    s i ∈ f i

{ι : Type u_1}
{α : ι → Type u_2}
{f : (i : ι) → Filter (α i)}
{s : (i : ι) → Set (α i)}
[∀ (i : ι), (f i).NeBot]
{I : Set ι}
(h : I.pi s ∈ Filter.pi f)
{i : ι}
(hi : i ∈ I)


@[to_additive]
theorem mul_mem_ball_iff_norm : a * b ∈ ball a r ↔ ‖b‖ < r

{E : Type u_6}
[SeminormedAddCommGroup E]
{a b : E}
{r : ℝ}


theorem two_lt_lineCount [Finite P] [Finite L] (p : P) : 2 < lineCount L p

{P : Type u_1}
(L : Type u_2)
[Membership P L]
[Configuration.ProjectivePlane P L]
[Finite P]
[Finite L]
(p : P)


/-- Every nonempty list satisfying the chain condition gives a relation series-/
@[simps]
def fromListChain' (x : List α) (x_ne_nil : x ≠ []) (hx : x.Chain' r) : RelSeries r

{α : Type u_1}
{r : Rel α α}
(x : List α)
(x_ne_nil : x ≠ [])
(hx : List.Chain' r x)

(RelSeries.fromListChain' x x_ne_nil hx).length = x.length.pred


@[simp] theorem mersenne_pos {p : ℕ} : 0 < mersenne p ↔ 0 < p


theorem condexp_stronglyMeasurable_mul_of_bound₀ (hm : m ≤ m0) [IsFiniteMeasure μ] {f g : α → ℝ}
    (hf : AEStronglyMeasurable' m f μ) (hg : Integrable g μ) (c : ℝ)
    (hf_bound : ∀ᵐ x ∂μ, ‖f x‖ ≤ c) : μ[f * g|m] =ᵐ[μ] f * μ[g|m]

(hf : MeasureTheory.AEStronglyMeasurable' m f μ)


/-- Equivalent definitions of a measure invariant under a multiplicative action of a group.

- 0: `SMulInvariantMeasure G α μ`;

- 1: for every `c : G` and a measurable set `s`, the measure of the preimage of `s` under scalar
     multiplication by `c` is equal to the measure of `s`;

- 2: for every `c : G` and a measurable set `s`, the measure of the image `c • s` of `s` under
     scalar multiplication by `c` is equal to the measure of `s`;

- 3, 4: properties 2, 3 for any set, including non-measurable ones;

- 5: for any `c : G`, scalar multiplication by `c` maps `μ` to `μ`;

- 6: for any `c : G`, scalar multiplication by `c` is a measure preserving map. -/
@[to_additive]
theorem smulInvariantMeasure_tfae :
    List.TFAE
      [SMulInvariantMeasure G α μ,
        ∀ (c : G) (s), MeasurableSet s → μ ((c • ·) ⁻¹' s) = μ s,
        ∀ (c : G) (s), MeasurableSet s → μ (c • s) = μ s,
        ∀ (c : G) (s), μ ((c • ·) ⁻¹' s) = μ s,
        ∀ (c : G) (s), μ (c • s) = μ s,
        ∀ c : G, Measure.map (c • ·) μ = μ,
        ∀ c : G, MeasurePreserving (c • ·) μ μ]

(G : Type u)
{α : Type w}
{m : MeasurableSpace α}
[Group G]
[MulAction G α]
[MeasurableSpace G]
[MeasurableSMul G α]
(μ : MeasureTheory.Measure α)

[MeasureTheory.SMulInvariantMeasure G α μ, ∀ (c : G) (s : Set α), MeasurableSet s → μ ((fun x => c • x) ⁻¹' s) = μ s,
    ∀ (c : G) (s : Set α), MeasurableSet s → μ (c • s) = μ s, ∀ (c : G) (s : Set α), μ ((fun x => c • x) ⁻¹' s) = μ s,
    ∀ (c : G) (s : Set α), μ (c • s) = μ s, ∀ (c : G), MeasureTheory.Measure.map (fun x => c • x) μ = μ,
    ∀ (c : G), MeasureTheory.MeasurePreserving (fun x => c • x) μ μ].TFAE


@[to_additive]
theorem threeGPFree_pi {ι : Type*} {α : ι → Type*} [∀ i, Monoid (α i)] {s : ∀ i, Set (α i)}
    (hs : ∀ i, ThreeGPFree (s i)) : ThreeGPFree ((univ : Set ι).pi s)

{ι : Type u_6}
{α : ι → Type u_7}
[(i : ι) → AddMonoid (α i)]
{s : (i : ι) → Set (α i)}
(hs : ∀ (i : ι), ThreeAPFree (s i))


theorem abs_integral_mono_interval {c d} (h : Ι a b ⊆ Ι c d) (hf : 0 ≤ᵐ[μ.restrict (Ι c d)] f)
    (hfi : IntervalIntegrable f μ c d) : |∫ x in a..b, f x ∂μ| ≤ |∫ x in c..d, f x ∂μ|

{f : ℝ → ℝ}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
{c d : ℝ}
(h : Ι a b ⊆ Ι c d)
(hf : 0 ≤ᵐ[μ.restrict (Ι c d)] f)
(hfi : IntervalIntegrable f μ c d)

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


/-- `f` is continuously differentiable if it is cont. differentiable at
each `x ∈ mulTSupport f`. -/
@[to_additive "`f` is continuously differentiable if it is continuously
differentiable at each `x ∈ tsupport f`."]
theorem contMDiff_of_mulTSupport [One M'] {f : M → M'}
    (hf : ∀ x ∈ mulTSupport f, ContMDiffAt I I' n f x) : ContMDiff I I' n f


theorem Basis.mk_range_eq_rank (v : Basis ι R M) : #(range v) = Module.rank R M

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
{ι : Type w}
[StrongRankCondition R]
(v : Basis ι R M)


/-- Reducible form of congrArg_mpr_hom_left -/
@[simp]
theorem congrArg_cast_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟶ Z) :
    cast (congrArg (fun W : C => W ⟶ Z) p.symm) q = eqToHom p ≫ q

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : C}
(p : X = Y)
(q : Y ⟶ Z)

cast ⋯ q = CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom p) q


/-- A (preadditive) category `C` is called abelian if it has all finite products,
all kernels and cokernels, and if every monomorphism is the kernel of some morphism
and every epimorphism is the cokernel of some morphism.

(This definition implies the existence of zero objects:
finite products give a terminal object, and in a preadditive category
any terminal object is a zero object.)
-/
class Abelian extends Preadditive C, NormalMonoCategory C, NormalEpiCategory C where
  [has_finite_products : HasFiniteProducts C]
  [has_kernels : HasKernels C]
  [has_cokernels : HasCokernels C]

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


@[simp] theorem loopyOn_empty (α : Type*) : loopyOn (∅ : Set α) = emptyOn α


@[simp]
theorem bot_add (x : EReal) : ⊥ + x = ⊥


theorem fderiv_sub (hf : DifferentiableAt 𝕜 f x) (hg : DifferentiableAt 𝕜 g x) :
    fderiv 𝕜 (fun y => f y - g y) x = fderiv 𝕜 f x - fderiv 𝕜 g x

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


theorem finrank_eq_card (G : Type u) (F : Type v) [Group G] [Field F] [Fintype G]
    [MulSemiringAction G F] [FaithfulSMul G F] :
    finrank (FixedPoints.subfield G F) F = Fintype.card G

FiniteDimensional.finrank (↥(FixedPoints.subfield G F)) F = Fintype.card G


theorem not_and_of_not_or_not (h : ¬a ∨ ¬b) : ¬(a ∧ b)


theorem mk_range_eq_lift {α : Type u} {β : Type v} {f : α → β} (hf : Injective f) :
    lift.{max u w} #(range f) = lift.{max v w} #α

{α : Type u}
{β : Type v}
{f : α → β}
(hf : Function.Injective f)

Cardinal.lift.{max u w, v} (Cardinal.mk ↑(Set.range f)) = Cardinal.lift.{max v w, u} (Cardinal.mk α)


/-- The prime case of the **Erdős–Ginzburg–Ziv theorem** for `ℤ/pℤ`.

Any sequence of `2 * p - 1` elements of `ZMod p` contains a subsequence of `p` elements whose sum is
zero. -/
private theorem ZMod.erdos_ginzburg_ziv_prime (a : ι → ZMod p) (hs : s.card = 2 * p - 1) :
    ∃ t ⊆ s, t.card = p ∧ ∑ i ∈ t, a i = 0

{ι : Type u_1}
{p : ℕ}
[Fact (Nat.Prime p)]
{s : Finset ι}
(a : ι → ZMod p)
(hs : s.card = 2 * p - 1)


/-- A common special case of `image2_congr` -/
theorem image2_congr' (h : ∀ a b, f a b = f' a b) : image2 f s t = image2 f' s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f f' : α → β → γ}
{s : Set α}
{t : Set β}
(h : ∀ (a : α) (b : β), f a b = f' a b)


protected theorem Monovary.monovaryOn (h : Monovary f g) (s : Set ι) : MonovaryOn f g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
(h : Monovary f g)
(s : Set ι)


theorem tendsto_nhds {f : Filter β} {u : β → α} {a : α} :
    Tendsto u f (𝓝 a) ↔ ∀ ε > 0, ∀ᶠ x in f, edist (u x) a < ε

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
{f : Filter β}
{u : β → α}
{a : α}

Filter.Tendsto u f (𝓝 a) ↔ ∀ ε > 0, ∀ᶠ (x : β) in f, edist (u x) a < ε


theorem lift_unique {B : Type u} [CommRing B] [_RB : Algebra R B]
    [FormallyUnramified R A] (I : Ideal B) (hI : IsNilpotent I) (g₁ g₂ : A →ₐ[R] B)
    (h : (Ideal.Quotient.mkₐ R I).comp g₁ = (Ideal.Quotient.mkₐ R I).comp g₂) : g₁ = g₂


protected theorem StrictAnti.antitone (hf : StrictAnti f) : Antitone f

{α : Type u}
{β : Type v}
[PartialOrder α]
[Preorder β]
{f : α → β}
(hf : StrictAnti f)


/-- Induct on two `EReal`s by performing case splits on the sign of one whenever the other is
infinite. -/
@[elab_as_elim]
theorem induction₂ {P : EReal → EReal → Prop} (top_top : P ⊤ ⊤) (top_pos : ∀ x : ℝ, 0 < x → P ⊤ x)
    (top_zero : P ⊤ 0) (top_neg : ∀ x : ℝ, x < 0 → P ⊤ x) (top_bot : P ⊤ ⊥)
    (pos_top : ∀ x : ℝ, 0 < x → P x ⊤) (pos_bot : ∀ x : ℝ, 0 < x → P x ⊥) (zero_top : P 0 ⊤)
    (coe_coe : ∀ x y : ℝ, P x y) (zero_bot : P 0 ⊥) (neg_top : ∀ x : ℝ, x < 0 → P x ⊤)
    (neg_bot : ∀ x : ℝ, x < 0 → P x ⊥) (bot_top : P ⊥ ⊤) (bot_pos : ∀ x : ℝ, 0 < x → P ⊥ x)
    (bot_zero : P ⊥ 0) (bot_neg : ∀ x : ℝ, x < 0 → P ⊥ x) (bot_bot : P ⊥ ⊥) : ∀ x y, P x y

{P : EReal → EReal → Prop}
(top_top : P ⊤ ⊤)
(top_pos : ∀ (x : ℝ), 0 < x → P ⊤ ↑x)
(top_zero : P ⊤ 0)
(top_neg : ∀ x < 0, P ⊤ ↑x)
(top_bot : P ⊤ ⊥)
(pos_top : ∀ (x : ℝ), 0 < x → P ↑x ⊤)
(pos_bot : ∀ (x : ℝ), 0 < x → P ↑x ⊥)
(zero_top : P 0 ⊤)
(coe_coe : ∀ (x y : ℝ), P ↑x ↑y)
(zero_bot : P 0 ⊥)
(neg_top : ∀ x < 0, P ↑x ⊤)
(neg_bot : ∀ x < 0, P ↑x ⊥)
(bot_top : P ⊥ ⊤)
(bot_pos : ∀ (x : ℝ), 0 < x → P ⊥ ↑x)
(bot_zero : P ⊥ 0)
(bot_neg : ∀ x < 0, P ⊥ ↑x)
(bot_bot : P ⊥ ⊥)
(x y : EReal)


theorem nfpBFamily_le {o : Ordinal} {f : ∀ b < o, Ordinal → Ordinal} {a b} :
    (∀ l, List.foldr (familyOfBFamily o f) a l ≤ b) → nfpBFamily.{u, v} o f a ≤ b

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

(∀ (l : List (Quotient.out o).α), List.foldr (o.familyOfBFamily f) a l ≤ b) → o.nfpBFamily f a ≤ b


@[to_additive]
theorem HasProd.unique {a₁ a₂ : α} [T2Space α] : HasProd f a₁ → HasProd f a₂ → a₁ = a₂

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a₁ a₂ : α}
[T2Space α]


@[simp]
theorem snd_one [One R] [Zero A] : (1 : Unitization R A).snd = 0

{R : Type u_1}
{A : Type u_2}
[One R]
[Zero A]


theorem add_mod_add_of_le_add_mod {a b c : ℕ} (hc : c ≤ a % c + b % c) :
    (a + b) % c + c = a % c + b % c


nonrec theorem le_div_iff' {a b r : ℝ≥0} (hr : r ≠ 0) : a ≤ b / r ↔ r * a ≤ b


/-- The conditional cdf is a measurable function of `a : α` for all `x : ℝ`. -/
theorem measurable_condCDF (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun a ↦ condCDF ρ a x

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
(x : ℝ)

Measurable fun a => ↑(ProbabilityTheory.condCDF ρ a) x


/-- If the second of three points is strictly between the other two, the angle at the third point
(reversed) is zero. -/
theorem _root_.Sbtw.angle₁₃₂_eq_zero {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) : ∠ p₁ p₃ p₂ = 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : Sbtw ℝ p₁ p₂ p₃)


@[to_additive]
theorem isUnit_iff_exists_inv [CommMonoid M] {a : M} : IsUnit a ↔ ∃ b, a * b = 1


@[to_additive (attr := simp)]
theorem mem_bot {x : M} : x ∈ (⊥ : Submonoid M) ↔ x = 1


theorem isOpen_sUnion_countable [SecondCountableTopology α] (S : Set (Set α))
    (H : ∀ s ∈ S, IsOpen s) : ∃ T : Set (Set α), T.Countable ∧ T ⊆ S ∧ ⋃₀ T = ⋃₀ S

{α : Type u}
[t : TopologicalSpace α]
[SecondCountableTopology α]
(S : Set (Set α))
(H : ∀ s ∈ S, IsOpen s)


protected theorem comp_id (F : C ⥤ D) : F ⋙ 𝟭 D = F

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

F.comp (CategoryTheory.Functor.id D) = F


@[simp]
theorem rightDualIso_id {X Y : C} (p : ExactPairing X Y) : rightDualIso p p = Iso.refl Y

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{X Y : C}
(p : CategoryTheory.ExactPairing X Y)

CategoryTheory.rightDualIso p p = CategoryTheory.Iso.refl Y


/-- Construct a continuous function from a bare function, a continuous function, and a proof that
they are equal. -/
-- Porting note: removed `@[reducible]`
@[simps!]
def copy (f : α → β) (g : α →𝒄 β) (h : f = g) : α →𝒄 β

{α : Type u}
{β : Type v}
[OmegaCompletePartialOrder α]
[OmegaCompletePartialOrder β]
(f : α → β)
(g : α →𝒄 β)
(h : f = ⇑g)

∀ (a : α), (OmegaCompletePartialOrder.ContinuousHom.copy f g h) a = f a


/-- Definition of `x ≤ y` on pre-games built using the constructor. -/
@[simp]
theorem mk_le_mk {xl xr xL xR yl yr yL yR} :
    mk xl xr xL xR ≤ mk yl yr yL yR ↔ (∀ i, xL i ⧏ mk yl yr yL yR) ∧ ∀ j, mk xl xr xL xR ⧏ yR j

{xl xr : Type u_1}
{xL : xl → SetTheory.PGame}
{xR : xr → SetTheory.PGame}
{yl yr : Type u_1}
{yL : yl → SetTheory.PGame}
{yR : yr → SetTheory.PGame}

SetTheory.PGame.mk xl xr xL xR ≤ SetTheory.PGame.mk yl yr yL yR ↔
  (∀ (i : xl), (xL i).LF (SetTheory.PGame.mk yl yr yL yR)) ∧ ∀ (j : yr), (SetTheory.PGame.mk xl xr xL xR).LF (yR j)


/-- The power basis given by `x` if `B.gen ∈ adjoin K {x}`. See `PowerBasis.ofGenMemAdjoin'`
for a version over a more general base ring. -/
@[simps!]
noncomputable def PowerBasis.ofGenMemAdjoin {x : S} (B : PowerBasis K S) (hint : IsIntegral K x)
    (hx : B.gen ∈ adjoin K ({x} : Set S)) : PowerBasis K S

{K : Type u_1}
{S : Type u_2}
[Field K]
[CommRing S]
[Algebra K S]
{x : S}
(B : PowerBasis K S)
(hint : IsIntegral K x)
(hx : B.gen ∈ Algebra.adjoin K {x})

(B.ofGenMemAdjoin hint hx).dim = (minpoly K x).natDegree


{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{a : α}


theorem ExistsUnique.exists₂ {α : Sort*} {p : α → Sort*} {q : ∀ (x : α) (_ : p x), Prop}
    (h : ∃! x, ∃! hx : p x, q x hx) : ∃ (x : _) (hx : p x), q x hx

{α : Sort u_3}
{p : α → Sort u_4}
{q : (x : α) → p x → Prop}
(h : ∃! x, ∃! hx, q x hx)


@[simp]
theorem isoWhiskerRight_hom {G H : C ⥤ D} (α : G ≅ H) (F : D ⥤ E) :
    (isoWhiskerRight α F).hom = whiskerRight α.hom F

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

(CategoryTheory.isoWhiskerRight α F).hom = CategoryTheory.whiskerRight α.hom F


theorem strictMonoOn_iff_strictMono : StrictMonoOn f s ↔
    StrictMono fun a : s => f a

{α : Type u}
{β : Type v}
{s : Set α}
[Preorder α]
[Preorder β]
{f : α → β}

StrictMonoOn f s ↔ StrictMono fun a => f ↑a


theorem Perm.diff {l₁ l₂ t₁ t₂ : List α} (hl : l₁ ~ l₂) (ht : t₁ ~ t₂) : l₁.diff t₁ ~ l₂.diff t₂

{α : Type u_1}
[DecidableEq α]
{l₁ l₂ t₁ t₂ : List α}
(hl : l₁ ~ l₂)
(ht : t₁ ~ t₂)


lemma rank_eq [Nontrivial R] [Module.Free R M] :
    Module.rank R (TensorAlgebra R M) = Cardinal.lift.{uR} (sum fun n ↦ Module.rank R M ^ n)

{R : Type uR}
{M : Type uM}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
[Module.Free R M]

Module.rank R (TensorAlgebra R M) = Cardinal.lift.{uR, uM} (Cardinal.sum fun n => Module.rank R M ^ n)


lemma abs_pow_eq_one (a : α) (h : n ≠ 0) : |a ^ n| = 1 ↔ |a| = 1

{α : Type u_1}
[LinearOrderedRing α]
{n : ℕ}
(a : α)
(h : n ≠ 0)


@[simp]
protected theorem smul_tmul {M : ModuleCat.{v} R} (s s' : S) (m : M) :
    s • (s'⊗ₜ[R,f]m : (extendScalars f).obj M) = (s * s')⊗ₜ[R,f]m

{R : Type u₁}
{S : Type u₂}
[CommRing R]
[CommRing S]
(f : R →+* S)
{M : ModuleCat R}
(s s' : S)
(m : ↑M)


lemma IsSelfAdjoint.coe_realPart {x : A} (hx : IsSelfAdjoint x) :
    (ℜ x : A) = x

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]
{x : A}
(hx : IsSelfAdjoint x)


/-- The diagram of the multifork attached to a presheaf
`F : Cᵒᵖ ⥤ A`, `S : C` and `E : PreOneHypercover S`. -/
@[simps]
def multicospanIndex (F : Cᵒᵖ ⥤ A) : MulticospanIndex A

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{A : Type u_1}
[CategoryTheory.Category.{u_2, u_1} A]
{S : C}
(E : CategoryTheory.PreOneHypercover S)
(F : CategoryTheory.Functor Cᵒᵖ A)
(i : E.I₀)

(E.multicospanIndex F).left i = F.obj (Opposite.op (E.X i))


@[reassoc (attr := simp)]
lemma biprod_lift_fst_f (α : M ⟶ K) (β : M ⟶ L) (i : ι) :
    (biprod.lift α β).f i ≫ (biprod.fst : K ⊞ L ⟶ K).f i = α.f i

[∀ (i : ι), CategoryTheory.Limits.HasBinaryBiproduct (K.X i) (L.X i)]

(CategoryTheory.Limits.biprod.lift α β).f i ≫ CategoryTheory.Limits.biprod.fst.f i = α.f i


theorem induced_orderTopology' {α : Type u} {β : Type v} [Preorder α] [ta : TopologicalSpace β]
    [Preorder β] [OrderTopology β] (f : α → β) (hf : ∀ {x y}, f x < f y ↔ x < y)
    (H₁ : ∀ {a x}, x < f a → ∃ b < a, x ≤ f b) (H₂ : ∀ {a x}, f a < x → ∃ b > a, f b ≤ x) :
    @OrderTopology _ (induced f ta) _

(H₁ : ∀ {a : α} {x : β}, x < f a → ∃ b < a, x ≤ f b)

(H₂ : ∀ {a : α} {x : β}, f a < x → ∃ b > a, f b ≤ x)


theorem ConvexOn.secant_mono_aux3 (hf : ConvexOn 𝕜 s f) {x y z : 𝕜} (hx : x ∈ s) (hz : z ∈ s)
    (hxy : x < y) (hyz : y < z) : (f z - f x) / (z - x) ≤ (f z - f y) / (z - y)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{s : Set 𝕜}
{f : 𝕜 → 𝕜}
(hf : ConvexOn 𝕜 s f)
{x y z : 𝕜}
(hx : x ∈ s)
(hz : z ∈ s)
(hxy : x < y)
(hyz : y < z)


/-- A uniform upper bound for `jacobiTheta₂_term` on compact subsets. -/
lemma norm_jacobiTheta₂_term_le {S T : ℝ} (hT : 0 < T) {z τ : ℂ}
    (hz : |im z| ≤ S) (hτ : T ≤ im τ) (n : ℤ) :
    ‖jacobiTheta₂_term n z τ‖ ≤ rexp (-π * (T * n ^ 2 - 2 * S * |n|))

{S T : ℝ}
(hT : 0 < T)
{z τ : ℂ}
(hz : |z.im| ≤ S)
(hτ : T ≤ τ.im)
(n : ℤ)

‖jacobiTheta₂_term n z τ‖ ≤ rexp (-π * (T * ↑n ^ 2 - 2 * S * ↑|n|))


@[simp]
lemma logDeriv_pow (x : 𝕜) (n : ℕ) : logDeriv (· ^ n) x = n / x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
(x : 𝕜)
(n : ℕ)


@[fun_prop]
theorem hasStrictFDerivAt_sub_const {x : F} (c : F) : HasStrictFDerivAt (· - c) (id 𝕜 F) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : F}
(c : F)

HasStrictFDerivAt (fun x => x - c) (ContinuousLinearMap.id 𝕜 F) x


theorem eventually_nhds_subtype_iff (s : Set α) (a : s) (P : α → Prop) :
    (∀ᶠ x : s in 𝓝 a, P x) ↔ ∀ᶠ x in 𝓝[s] a, P x

{α : Type u_1}
[TopologicalSpace α]
(s : Set α)
(a : ↑s)
(P : α → Prop)

(∀ᶠ (x : ↑s) in 𝓝 a, P ↑x) ↔ ∀ᶠ (x : α) in 𝓝[s] ↑a, P x


@[simp]
lemma comp_units_smul {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (k : Rˣ) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂ ) : z₁.comp (k • z₂) h = k • (z₁.comp z₂ h)

(z₁ : CochainComplex.HomComplex.Cochain F G n₁)

(z₂ : CochainComplex.HomComplex.Cochain G K n₂)


@[to_additive]
theorem card_pow_eq_card_pow_card_univ_aux {f : ℕ → ℕ} (h1 : Monotone f) {B : ℕ} (h2 : ∀ n, f n ≤ B)
    (h3 : ∀ n, f n = f (n + 1) → f (n + 1) = f (n + 2)) : ∀ k, B ≤ k → f k = f B


@[to_additive]
theorem iUnion_mul_left_image : ⋃ a ∈ s, (a * ·) '' t = s * t


@[simp]
protected theorem neg_mul (M : Matrix m n α) (N : Matrix n o α) : (-M) * N = -(M * N)

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[NonUnitalNonAssocRing α]
[Fintype n]
(M : Matrix m n α)
(N : Matrix n o α)


theorem const_add (x y : β) : const (x + y) = const x + const y

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(x y : β)

CauSeq.const abv (x + y) = CauSeq.const abv x + CauSeq.const abv y


nonrec theorem natDegree_mul' (hp : p.Monic) (hq : q ≠ 0) :
    (p * q).natDegree = p.natDegree + q.natDegree

{R : Type u}
[Semiring R]
{p q : R[X]}
(hp : p.Monic)
(hq : q ≠ 0)


@[simp]
theorem mk_preimage_prod_left_eq_empty (hb : b ∉ t) : (fun a => (a, b)) ⁻¹' s ×ˢ t = ∅

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{b : β}
(hb : b ∉ t)


theorem congr_fun {f g : A →ₛₙₐ[φ] B} (h : f = g) (x : A) : f x = g x

{R : Type u}
{S : Type u₁}
[Monoid R]
[Monoid S]
{φ : R →* S}
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction S B]
{f g : A →ₛₙₐ[φ] B}
(h : f = g)
(x : A)


@[simp, reassoc]
lemma iso_inv_app (a : A) (X : C) :
    (commShiftOfLocalization.iso L W F F' a).inv.app (L.obj X) =
        (shiftFunctor E a).map ((Lifting.iso L W F F').hom.app X) ≫
        (F.commShiftIso a).inv.app X ≫
      (Lifting.iso L W F F').inv.app (X⟦a⟧) ≫
      F'.map ((L.commShiftIso a).hom.app X)

[CategoryTheory.Localization.Lifting L W F F']

(CategoryTheory.Functor.commShiftOfLocalization.iso L W F F' a).inv.app (L.obj X) =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.shiftFunctor E a).map ((CategoryTheory.Localization.Lifting.iso L W F F').hom.app X))
    (CategoryTheory.CategoryStruct.comp ((F.commShiftIso a).inv.app X)
      (CategoryTheory.CategoryStruct.comp
        ((CategoryTheory.Localization.Lifting.iso L W F F').inv.app ((CategoryTheory.shiftFunctor C a).obj X))
        (F'.map ((L.commShiftIso a).hom.app X))))


theorem DifferentiableWithinAt.csinh (hf : DifferentiableWithinAt ℂ f s x) :
    DifferentiableWithinAt ℂ (fun x => Complex.sinh (f x)) s x

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


@[simp] lemma map₂_coe_left (f : α → β → γ) (a : α) (b) : map₂ f a b = b.map fun b ↦ f a b

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

WithTop.map₂ f (↑a) b = WithTop.map (fun b => f a b) b


theorem of_isIso_of_mono [IsIso a] [Mono f] : IsKernelPair f a a

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


theorem comap_hasBasis (f : α → β) (l : Filter β) :
    HasBasis (comap f l) (fun s : Set β => s ∈ l) fun s => f ⁻¹' s

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

(Filter.comap f l).HasBasis (fun s => s ∈ l) fun s => f ⁻¹' s


theorem not_tendsto_pow_atTop_atBot [LinearOrderedRing α] :
    ∀ {n : ℕ}, ¬Tendsto (fun x : α => x ^ n) atTop atBot

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

¬Filter.Tendsto (fun x => x ^ n) Filter.atTop Filter.atBot


theorem maxToGood_injective
    (h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C (ord I · < o))))) :
    (MaxToGood C hC hsC ho h₁).Injective

(hsC : Profinite.NobelingProof.contained C (Order.succ o))

(ho : o < Ordinal.type fun x x_1 => x < x_1)

(h₁ :
  ⊤ ≤
    Submodule.span ℤ
      (Set.range
        (Profinite.NobelingProof.GoodProducts.eval
          (Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o))))

Function.Injective (Profinite.NobelingProof.GoodProducts.MaxToGood C hC hsC ho h₁)


theorem IsEquivalent.inv (huv : u ~[l] v) : (fun x ↦ (u x)⁻¹) ~[l] fun x ↦ (v x)⁻¹

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

(fun x => (u x)⁻¹) ~[l] fun x => (v x)⁻¹


theorem lt_zpow_succ_log_self {b : ℕ} (hb : 1 < b) (r : R) : r < (b : R) ^ (log b r + 1)

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
{b : ℕ}
(hb : 1 < b)
(r : R)


@[to_additive]
theorem Multiset.prod_toEnumFinset {β : Type*} [CommMonoid β] (m : Multiset α) (f : α → ℕ → β) :
    ∏ x ∈ m.toEnumFinset, f x.1 x.2 = ∏ x : m, f x x.2

{α : Type u_1}
[DecidableEq α]
{β : Type u_2}
[AddCommMonoid β]
(m : Multiset α)
(f : α → ℕ → β)

∑ x ∈ m.toEnumFinset, f x.1 x.2 = ∑ x : m.ToType, f x.fst ↑x.snd


theorem toLp_congr {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) (hfg : f =ᵐ[μ] g) :
    hf.toLp f = hg.toLp g

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

MeasureTheory.Memℒp.toLp f hf = MeasureTheory.Memℒp.toLp g hg


theorem StrictAnti.imp (hf : StrictAnti f) (h : a < b) : f b < f a

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{a b : α}
(hf : StrictAnti f)
(h : a < b)


/-- A function `f` is an absolute value if it is nonnegative, zero only at 0, additive, and
multiplicative.

See also the type `AbsoluteValue` which represents a bundled version of absolute values.
-/
class IsAbsoluteValue {S} [OrderedSemiring S] {R} [Semiring R] (f : R → S) : Prop where
  /-- The absolute value is nonnegative -/
  abv_nonneg' : ∀ x, 0 ≤ f x
  /-- The absolute value is positive definitive -/
  abv_eq_zero' : ∀ {x}, f x = 0 ↔ x = 0
  /-- The absolute value satisfies the triangle inequality -/
  abv_add' : ∀ x y, f (x + y) ≤ f x + f y
  /-- The absolute value is multiplicative -/
  abv_mul' : ∀ x y, f (x * y) = f x * f y

{S : Type u_5}
[OrderedSemiring S]
{R : Type u_6}
[Semiring R]
{f : R → S}
[self : IsAbsoluteValue f]
(x y : R)


theorem sSup_mem_closure {s : Set α} (hs : s.Nonempty) : sSup s ∈ closure s

{α : Type u_1}
[CompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
{s : Set α}
(hs : s.Nonempty)


lemma limsup_sub_const (F : Filter ι) [NeBot F] (f : ι → ℝ≥0∞) (c : ℝ≥0∞) :
    Filter.limsup (fun i ↦ f i - c) F = Filter.limsup f F - c

{ι : Type u_4}
(F : Filter ι)
[F.NeBot]
(f : ι → ℝ≥0∞)
(c : ℝ≥0∞)

Filter.limsup (fun i => f i - c) F = Filter.limsup f F - c


theorem pairwise_coe_iff {r : α → α → Prop} {l : List α} :
    Multiset.Pairwise r l ↔ ∃ l' : List α, l ~ l' ∧ l'.Pairwise r

{α : Type u_1}
{r : α → α → Prop}
{l : List α}

Multiset.Pairwise r ↑l ↔ ∃ l', l ~ l' ∧ List.Pairwise r l'


theorem term_atom {α} [AddCommMonoid α] (x : α) : x = term 1 x 0

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


protected theorem map_smulₛₗ (c : R) (x : E) : f (c • x) = σ₁₂ c • f x

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(f : E →ₛₗᵢ[σ₁₂] E₂)
(c : R)
(x : E)


/-- This is the same as `Matrix.l2_opNorm_def`, but with a more bundled RHS for square matrices. -/
lemma cstar_norm_def (A : Matrix n n 𝕜) : ‖A‖ = ‖toEuclideanCLM (n := n) (𝕜 := 𝕜) A‖

{𝕜 : Type u_1}
{n : Type u_3}
[RCLike 𝕜]
[Fintype n]
[DecidableEq n]
(A : Matrix n n 𝕜)


/-- The `characterSpace 𝕜 A` along with `0` is always a closed set in `WeakDual 𝕜 A`. -/
theorem union_zero_isClosed [T2Space 𝕜] [ContinuousMul 𝕜] :
    IsClosed (characterSpace 𝕜 A ∪ {0})

(𝕜 : Type u_1)
(A : Type u_2)
[CommSemiring 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[NonUnitalNonAssocSemiring A]
[TopologicalSpace A]
[Module 𝕜 A]
[T2Space 𝕜]
[ContinuousMul 𝕜]

IsClosed (WeakDual.characterSpace 𝕜 A ∪ {0})


@[simp]
theorem RingHom.asBoolAlg_id : (RingHom.id α).asBoolAlg = BoundedLatticeHom.id _

(RingHom.id α).asBoolAlg = BoundedLatticeHom.id (AsBoolAlg α)


@[to_additive (attr := simp)]
lemma mul_smul_one {M N} [MulOneClass N] [SMul M N] [SMulCommClass M N N] (x : M) (y : N) :
    y * x • (1 : N) = x • y

{M : Type u_11}
{N : Type u_12}
[MulOneClass N]
[SMul M N]
[SMulCommClass M N N]
(x : M)
(y : N)


theorem KaehlerDifferential.kerTotal_mkQ_single_add (x y z) : (z𝖣x + y) = (z𝖣x) + z𝖣y

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]
(x y z : S)

(KaehlerDifferential.kerTotal R S).mkQ (Finsupp.single (x + y) z) =
  (KaehlerDifferential.kerTotal R S).mkQ (Finsupp.single x z) +
    (KaehlerDifferential.kerTotal R S).mkQ (Finsupp.single y z)


theorem smul_extend {R} [Zero R] [SMulWithZero R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞]
    [NoZeroSMulDivisors R ℝ≥0∞] {c : R} (hc : c ≠ 0) :
    c • extend m = extend fun s h => c • m s h

{α : Type u_1}
{P : α → Prop}
(m : (s : α) → P s → ℝ≥0∞)
{R : Type u_2}
[Zero R]
[SMulWithZero R ℝ≥0∞]
[IsScalarTower R ℝ≥0∞ ℝ≥0∞]
[NoZeroSMulDivisors R ℝ≥0∞]
{c : R}
(hc : c ≠ 0)

c • MeasureTheory.extend m = MeasureTheory.extend fun s h => c • m s h


/-- Translates of a block form a `block_system` -/
theorem IsBlock.isBlockSystem [hGX : MulAction.IsPretransitive G X]
    {B : Set X} (hB : IsBlock G B) (hBe : B.Nonempty) :
    IsBlockSystem G (Set.range fun g : G => g • B)

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
[hGX : MulAction.IsPretransitive G X]
{B : Set X}
(hB : MulAction.IsBlock G B)
(hBe : B.Nonempty)

MulAction.IsBlockSystem G (Set.range fun g => g • B)


theorem inv_def [Inv α] (a : Part α) : a⁻¹ = Part.map (· ⁻¹) a


/-- A functor `F` is additive provided `F.map` is an additive homomorphism. -/
class Functor.Additive {C D : Type*} [Category C] [Category D] [Preadditive C] [Preadditive D]
  (F : C ⥤ D) : Prop where
  /-- the addition of two morphisms is mapped to the sum of their images -/
  map_add : ∀ {X Y : C} {f g : X ⟶ Y}, F.map (f + g) = F.map f + F.map g := by aesop_cat

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
{F : CategoryTheory.Functor C D}
[self : F.Additive]
{X Y : C}
{f g : X ⟶ Y}


/-- Implementation: If each structured arrow category on `G` has an initial object, an equivalence
which is helpful for constructing a left adjoint to `G`.
-/
@[simps]
def leftAdjointOfStructuredArrowInitialsAux (A : C) (B : D) :
    ((⊥_ StructuredArrow A G).right ⟶ B) ≃ (A ⟶ G.obj B)

[∀ (A : C), CategoryTheory.Limits.HasInitial (CategoryTheory.StructuredArrow A G)]

(g : (⊥_ CategoryTheory.StructuredArrow A G).right ⟶ B)

(CategoryTheory.leftAdjointOfStructuredArrowInitialsAux G A B) g =
  CategoryTheory.CategoryStruct.comp (⊥_ CategoryTheory.StructuredArrow A G).hom (G.map g)


/-- If `0 < c`, then `(fun t : ℝ ↦ t ^ a)` is integrable on `(c, ∞)` for all `a < -1`. -/
theorem integrableOn_Ioi_rpow_of_lt {a : ℝ} (ha : a < -1) {c : ℝ} (hc : 0 < c) :
    IntegrableOn (fun t : ℝ => t ^ a) (Ioi c)

MeasureTheory.IntegrableOn (fun t => t ^ a) (Set.Ioi c) MeasureTheory.volume


theorem numDerangements_tendsto_inv_e :
    Tendsto (fun n => (numDerangements n : ℝ) / n.factorial) atTop (𝓝 (Real.exp (-1)))

Filter.Tendsto (fun n => ↑(numDerangements n) / ↑n.factorial) Filter.atTop (𝓝 (Real.exp (-1)))


theorem HasGradientAt.differentiableAt (h : HasGradientAt f f' x) :
    DifferentiableAt 𝕜 f x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
(h : HasGradientAt f f' x)


/-- If `edist (f n) (f (n+1))` is bounded by `C * r^n`, `C ≠ ∞`, `r < 1`,
then `f` is a Cauchy sequence. -/
theorem cauchySeq_of_edist_le_geometric : CauchySeq f

(hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * r ^ n)


theorem frobenius_eq_map_frobenius : @frobenius p R _ _ = map (_root_.frobenius R p)

(p : ℕ)
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CharP R p]

WittVector.frobenius = WittVector.map (frobenius R p)


/-- The fully faithful embedding of `CompHausLike P` in `TopCat`. -/
@[simps!]
def compHausLikeToTop : CompHausLike.{u} P ⥤ TopCat.{u}

(P : TopCat → Prop)
(self : CompHausLike P)

(CompHausLike.compHausLikeToTop P).obj self = self.toTop


@[simp]
theorem arcsin_eq_zero_iff {x : ℝ} : arcsin x = 0 ↔ x = 0


/-- See also `Nat.ofNat_nonneg`, specialised for an `OrderedSemiring`. -/
-- See note [no_index around OfNat.ofNat]
@[simp low]
theorem ofNat_nonneg' (n : ℕ) [n.AtLeastTwo] : 0 ≤ (no_index (OfNat.ofNat n : α))

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


@[ext] theorem UInt64.ext : {x y : UInt64} → x.toNat = y.toNat → x = y


theorem mono_iff_injective : Mono f ↔ Function.Injective f

{R : Type u}
[Ring R]
{X Y : ModuleCat R}
(f : X ⟶ Y)

CategoryTheory.Mono f ↔ Function.Injective ⇑f


/-- A ring is a Jacobson ring if and only if for all prime ideals `P`,
 the Jacobson radical of `P` is equal to `P`. -/
theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P → P.jacobson = P

Ideal.IsJacobson R ↔ ∀ (P : Ideal R), P.IsPrime → P.jacobson = P


@[simp]
theorem coe_snd : ⇑(snd R S) = Prod.snd

{R : Type u_3}
{S : Type u_5}
[NonAssocSemiring R]
[NonAssocSemiring S]


theorem _root_.MeasureTheory.Memℒp.variance_eq [IsFiniteMeasure μ] (hX : Memℒp X 2 μ) :
    variance X μ = μ[(X - fun _ => μ[X] :) ^ (2 : Nat)]

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{X : Ω → ℝ}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
(hX : MeasureTheory.Memℒp X 2 μ)

ProbabilityTheory.variance X μ = ∫ (x : Ω), ((X - fun x => ∫ (x : Ω), X x ∂μ) ^ 2) x ∂μ


theorem sum_le_iSup_lift {ι : Type u}
    (f : ι → Cardinal.{max u v}) : sum f ≤ Cardinal.lift #ι * iSup f

Cardinal.sum f ≤ Cardinal.lift.{v, u} (Cardinal.mk ι) * iSup f


@[simp, norm_cast] lemma cast_pow {R : Type*} [Ring R] (n : ℤ) (m : ℕ) :
    ↑(n ^ m) = (n ^ m : R)


theorem interval_average_eq_div (f : ℝ → ℝ) (a b : ℝ) :
    (⨍ x in a..b, f x) = (∫ x in a..b, f x) / (b - a)

⨍ (x : ℝ) in a..b, f x = (∫ (x : ℝ) in a..b, f x) / (b - a)


@[to_additive (attr := simp)]
theorem edist_div_right [DivInvMonoid M] [PseudoEMetricSpace M] [IsometricSMul Mᵐᵒᵖ M]
    (a b c : M) : edist (a / c) (b / c) = edist a b

{M : Type u}
[SubNegMonoid M]
[PseudoEMetricSpace M]
[IsometricVAdd Mᵃᵒᵖ M]
(a b c : M)


protected theorem BlockTriangular.transpose :
    M.BlockTriangular b → Mᵀ.BlockTriangular (toDual ∘ b)

{α : Type u_1}
{m : Type u_3}
{R : Type v}
[CommRing R]
{M : Matrix m m R}
{b : m → α}
[LT α]

M.BlockTriangular b → Mᵀ.BlockTriangular (⇑OrderDual.toDual ∘ b)


@[simp]
theorem aleph_toNat (o : Ordinal) : toNat (aleph o) = 0


theorem forall_rightMoves_fuzzy_iff_equiv_zero : (∀ j, G.moveRight j ‖ 0) ↔ (G ≈ 0)

(∀ (j : G.RightMoves), (G.moveRight j).Fuzzy 0) ↔ G ≈ 0


@[reassoc]
theorem δ_comp_δ'' {n} {i : Fin (n + 3)} {j : Fin (n + 2)} (H : i ≤ Fin.castSucc j) :
    X.δ (i.castLT (Nat.lt_of_le_of_lt (Fin.le_iff_val_le_val.mp H) j.is_lt)) ≫ X.δ j.succ =
      X.δ j ≫ X.δ i

(X : CategoryTheory.CosimplicialObject C)

X.δ (i.castLT ⋯) ≫ X.δ j.succ = X.δ j ≫ X.δ i


@[to_additive]
theorem TopologicalGroup.tendstoUniformlyOn_iff {ι α : Type*} (F : ι → α → G) (f : α → G)
    (p : Filter ι) (s : Set α) :
    @TendstoUniformlyOn α G ι (TopologicalGroup.toUniformSpace G) F f p s ↔
      ∀ u ∈ 𝓝 (1 : G), ∀ᶠ i in p, ∀ a ∈ s, F i a / f a ∈ u

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
{ι : Type u_2}
{α : Type u_3}
(F : ι → α → G)
(f : α → G)
(p : Filter ι)
(s : Set α)

TendstoUniformlyOn F f p s ↔ ∀ u ∈ 𝓝 1, ∀ᶠ (i : ι) in p, ∀ a ∈ s, F i a / f a ∈ u


protected theorem map_neg : X (-f) = -X f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(X : LeftInvariantDerivation I G)
(f : C^⊤⟮I, G; 𝓘(𝕜, 𝕜), 𝕜⟯)


theorem nhdsWithin_inter_of_mem' {a : α} {s t : Set α} (h : t ∈ 𝓝[s] a) : 𝓝[s ∩ t] a = 𝓝[s] a

{α : Type u_1}
[TopologicalSpace α]
{a : α}
{s t : Set α}
(h : t ∈ 𝓝[s] a)


theorem left_subset_compRel {s t : Set (α × α)} (h : idRel ⊆ t) : s ⊆ s ○ t

{α : Type ua}
{s t : Set (α × α)}
(h : idRel ⊆ t)


protected theorem comp {g : β → γ} {t : Set β} {Kg : ℝ≥0} (hg : LipschitzOnWith Kg g t)
    (hf : LipschitzOnWith K f s) (hmaps : MapsTo f s t) : LipschitzOnWith (Kg * K) (g ∘ f) s

{α : Type u}
{β : Type v}
{γ : Type w}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[PseudoEMetricSpace γ]
{K : ℝ≥0}
{s : Set α}
{f : α → β}
{g : β → γ}
{t : Set β}
{Kg : ℝ≥0}
(hg : LipschitzOnWith Kg g t)
(hf : LipschitzOnWith K f s)
(hmaps : Set.MapsTo f s t)


/-- Given a neighborhood `U` of the identity, one may find a neighborhood `V` of the identity which
is closed, symmetric, and satisfies `V * V ⊆ U`. -/
@[to_additive "Given a neighborhood `U` of the identity, one may find a neighborhood `V` of the
identity which is closed, symmetric, and satisfies `V + V ⊆ U`."]
theorem exists_closed_nhds_one_inv_eq_mul_subset {U : Set G} (hU : U ∈ 𝓝 1) :
    ∃ V ∈ 𝓝 1, IsClosed V ∧ V⁻¹ = V ∧ V * V ⊆ U

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{U : Set G}
(hU : U ∈ 𝓝 1)


@[simp]
theorem curry_apply (f : M ⊗ N →ₗ[R] P) (m : M) (n : N) : curry f m n = f (m ⊗ₜ n)

{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]
(f : TensorProduct R M N →ₗ[R] P)
(m : M)
(n : N)

((TensorProduct.curry f) m) n = f (m ⊗ₜ[R] n)


/-- This is the functor `F ↦ X ↦ YonedaCollection F X`. -/
@[simps]
def yonedaCollectionFunctor (A : Cᵒᵖ ⥤ Type v) :
    ((CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) ⥤ Cᵒᵖ ⥤ Type v

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

∀ {X Y : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)} (η : X ⟶ Y),
  (CategoryTheory.OverPresheafAux.yonedaCollectionFunctor A).map η =
    CategoryTheory.OverPresheafAux.yonedaCollectionPresheafMap₁ η


@[to_additive]
theorem map_finsupp_prod [Zero M] [CommMonoid N] [CommMonoid P] {H : Type*}
    [FunLike H N P] [MonoidHomClass H N P]
    (h : H) (f : α →₀ M) (g : α → M → N) : h (f.prod g) = f.prod fun a b => h (g a b)

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
{P : Type u_11}
[Zero M]
[AddCommMonoid N]
[AddCommMonoid P]
{H : Type u_16}
[FunLike H N P]
[AddMonoidHomClass H N P]
(h : H)
(f : α →₀ M)
(g : α → M → N)

h (f.sum g) = f.sum fun a b => h (g a b)


theorem insert_inj (ha : a ∉ s) : insert a s = insert b s ↔ a = b

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{a b : α}
(ha : a ∉ s)


theorem filter_apply (a : α) : f.filter p a = if p a then f a else 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
(p : α → Prop)
[DecidablePred p]
(f : α →₀ M)
(a : α)

(Finsupp.filter p f) a = if p a then f a else 0


/-- Similar to `ae_of_forall_measure_lt_top_ae_restrict`, but where you additionally get the
  hypothesis that another σ-finite measure has finite values on `s`. -/
theorem ae_of_forall_measure_lt_top_ae_restrict' {μ : Measure α} (ν : Measure α) [SigmaFinite μ]
    [SigmaFinite ν] (P : α → Prop)
    (h : ∀ s, MeasurableSet s → μ s < ∞ → ν s < ∞ → ∀ᵐ x ∂μ.restrict s, P x) : ∀ᵐ x ∂μ, P x

(h : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ν s < ⊤ → ∀ᵐ (x : α) ∂μ.restrict s, P x)


theorem aeval_algEquiv (f : A ≃ₐ[R] B) (x : A) : aeval (f x) = (f : A →ₐ[R] B).comp (aeval x)

{R : Type u}
{A : Type z}
{B : Type u_2}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A ≃ₐ[R] B)
(x : A)

Polynomial.aeval (f x) = (↑f).comp (Polynomial.aeval x)


@[simp] theorem cast_castAdd_right {n m m' : Nat} (i : Fin n) (h : n + m' = n + m) :
    cast h (castAdd m' i) = castAdd m i

Fin.cast h (Fin.castAdd m' i) = Fin.castAdd m i


lemma trace_comp_cycle' (f : M →ₗ[R] N) (g : N →ₗ[R] P) (h : P →ₗ[R] M) :
    trace R P ((g ∘ₗ f) ∘ₗ h) = trace R M ((h ∘ₗ g) ∘ₗ f)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Type u_3}
{P : Type u_4}
[AddCommGroup N]
[Module R N]
[AddCommGroup P]
[Module R P]
[Module.Free R M]
[Module.Finite R M]
[Module.Free R P]
[Module.Finite R P]
(f : M →ₗ[R] N)
(g : N →ₗ[R] P)
(h : P →ₗ[R] M)

(LinearMap.trace R P) ((g ∘ₗ f) ∘ₗ h) = (LinearMap.trace R M) ((h ∘ₗ g) ∘ₗ f)


@[simp]
theorem PartialHomeomorph.univUnitBall_symm_apply_zero : univUnitBall.symm (0 : E) = 0

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]

↑PartialHomeomorph.univUnitBall.symm 0 = 0


theorem map_le_iff_le_comap {f : F} {s : NonUnitalSubring R} {t : NonUnitalSubring S} :
    s.map f ≤ t ↔ s ≤ t.comap f

{F : Type w}
{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
[FunLike F R S]
[NonUnitalRingHomClass F R S]
{f : F}
{s : NonUnitalSubring R}
{t : NonUnitalSubring S}

NonUnitalSubring.map f s ≤ t ↔ s ≤ NonUnitalSubring.comap f t


@[higher_order snd_id]
theorem id_snd : ∀ {α β} (x : F α β), snd id x = x

{F : Type u₀ → Type u₁ → Type u₂}
[Bifunctor F]
[LawfulBifunctor F]
{α : Type u₀}
{β : Type u₁}
(x : F α β)


theorem Bounded.weak_right : ∀ {t : Ordnode α} {o₁ o₂}, Bounded t o₁ o₂ → Bounded t o₁ ⊤

{α : Type u_1}
[Preorder α]
{t : Ordnode α}
{o₁ : WithBot α}
{o₂ : WithTop α}


@[simp]
theorem BinaryFan.mk_fst {P : C} (π₁ : P ⟶ X) (π₂ : P ⟶ Y) : (BinaryFan.mk π₁ π₂).fst = π₁

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

(CategoryTheory.Limits.BinaryFan.mk π₁ π₂).fst = π₁


@[to_additive]
theorem mem_center_iff {z : M} : z ∈ center M ↔ ∀ g, g * z = z * g

z ∈ AddSubsemigroup.center M ↔ ∀ (g : M), g + z = z + g


@[simp]
theorem coord_self (x : E) (h : x ≠ 0) :
    (coord 𝕜 x h) (⟨x, Submodule.mem_span_singleton_self x⟩ : 𝕜 ∙ x) = 1

(𝕜 : Type u_1)
{E : Type u_2}
[NormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(x : E)
(h : x ≠ 0)

(ContinuousLinearEquiv.coord 𝕜 x h) ⟨x, ⋯⟩ = 1


/-- Let `{x | p x}` be a subsemigroup of a commutative monoid `M`. Let `f : M → N` be a map
submultiplicative on `{x | p x}`, i.e., `p x → p y → f (x * y) ≤ f x * f y`. Let `g i`, `i ∈ s`, be
a nonempty finite family of elements of `M` such that `∀ i ∈ s, p (g i)`. Then
`f (∏ x ∈ s, g x) ≤ ∏ x ∈ s, f (g x)`. -/
@[to_additive le_sum_nonempty_of_subadditive_on_pred]
theorem le_prod_nonempty_of_submultiplicative_on_pred (f : M → N) (p : M → Prop)
    (h_mul : ∀ x y, p x → p y → f (x * y) ≤ f x * f y) (hp_mul : ∀ x y, p x → p y → p (x * y))
    (g : ι → M) (s : Finset ι) (hs_nonempty : s.Nonempty) (hs : ∀ i ∈ s, p (g i)) :
    f (∏ i ∈ s, g i) ≤ ∏ i ∈ s, f (g i)

(h_mul : ∀ (x y : M), p x → p y → f (x + y) ≤ f x + f y)

(hp_mul : ∀ (x y : M), p x → p y → p (x + y))


theorem nat_gcd_helper_1 (d x y a b : ℕ) (hu : x % d = 0) (hv : y % d = 0)
    (h : y * b = x * a + d) : Nat.gcd x y = d


theorem eval₂_comp_left {S₂} [CommSemiring S₂] (k : S₁ →+* S₂) (f : R →+* S₁) (g : σ → S₁) (p) :
    k (eval₂ f g p) = eval₂ (k.comp f) (k ∘ g) p

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
{S₂ : Type u_2}
[CommSemiring S₂]
(k : S₁ →+* S₂)
(f : R →+* S₁)
(g : σ → S₁)
(p : MvPolynomial σ R)

k (MvPolynomial.eval₂ f g p) = MvPolynomial.eval₂ (k.comp f) (⇑k ∘ g) p


theorem nhdsWithin_prod_eq (x : X) (y : Y) (s : Set X) (t : Set Y) :
    𝓝[s ×ˢ t] (x, y) = 𝓝[s] x ×ˢ 𝓝[t] y

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
(x : X)
(y : Y)
(s : Set X)
(t : Set Y)


@[reassoc (attr := simp)]
lemma hom_inv_id_left (e : f ≅ g) : e.hom.left ≫ e.inv.left = 𝟙 _

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{f g : CategoryTheory.Arrow T}
(e : f ≅ g)

CategoryTheory.CategoryStruct.comp e.hom.left e.inv.left = CategoryTheory.CategoryStruct.id f.left


/-- A polynomial of degree 2 or 3 is irreducible iff it doesn't have roots. -/
theorem Monic.irreducible_iff_roots_eq_zero_of_degree_le_three {p : R[X]} (hp : p.Monic)
    (hp2 : 2 ≤ p.natDegree) (hp3 : p.natDegree ≤ 3) : Irreducible p ↔ p.roots = 0

{R : Type u_1}
[CommRing R]
[IsDomain R]
{p : Polynomial R}
(hp : p.Monic)
(hp2 : 2 ≤ p.natDegree)
(hp3 : p.natDegree ≤ 3)


/-- The integral of `sin x * cos x`, given in terms of cos².
See `integral_sin_mul_cos₁` above for the integral given in terms of sin². -/
theorem integral_sin_mul_cos₂ : ∫ x in a..b, sin x * cos x = (cos a ^ 2 - cos b ^ 2) / 2

∫ (x : ℝ) in a..b, Real.sin x * Real.cos x = (Real.cos a ^ 2 - Real.cos b ^ 2) / 2


/-- The inner product of two non-zero vectors equals the product of their norms
if and only if the angle between the two vectors is 0. -/
theorem inner_eq_mul_norm_iff_angle_eq_zero {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    ⟪x, y⟫ = ‖x‖ * ‖y‖ ↔ angle x y = 0

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(hx : x ≠ 0)
(hy : y ≠ 0)

⟪x, y⟫_ℝ = ‖x‖ * ‖y‖ ↔ InnerProductGeometry.angle x y = 0


/-- Concave **Jensen's inequality**, `Finset.centerMass` version. -/
theorem ConcaveOn.le_map_centerMass (hf : ConcaveOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i)
    (h₁ : 0 < ∑ i ∈ t, w i) (hmem : ∀ i ∈ t, p i ∈ s) :
    t.centerMass w (f ∘ p) ≤ f (t.centerMass w p)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
{ι : Type u_5}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[OrderedAddCommGroup β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
{t : Finset ι}
{w : ι → 𝕜}
{p : ι → E}
(hf : ConcaveOn 𝕜 s f)
(h₀ : ∀ i ∈ t, 0 ≤ w i)
(h₁ : 0 < ∑ i ∈ t, w i)
(hmem : ∀ i ∈ t, p i ∈ s)


theorem JoinedIn.mem (h : JoinedIn F x y) : x ∈ F ∧ y ∈ F

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{F : Set X}
(h : JoinedIn F x y)


theorem ord_eq_Inf (α : Type u) : ord #α = ⨅ r : { r // IsWellOrder α r }, @type α r.1 r.2


/-- A diagram `WalkingSpan ⥤ C` is isomorphic to some `PushoutCocone.mk` after composing with
`diagramIsoSpan`. -/
@[simps!]
def PushoutCocone.isoMk {F : WalkingSpan ⥤ C} (t : Cocone F) :
    (Cocones.precompose (diagramIsoSpan.{v} _).inv).obj t ≅
      PushoutCocone.mk (t.ι.app WalkingSpan.left) (t.ι.app WalkingSpan.right)
        ((t.ι.naturality fst).trans (t.ι.naturality snd).symm)

{F : CategoryTheory.Limits.WalkingSpan ⥤ C}

(CategoryTheory.Limits.PushoutCocone.isoMk t).inv.hom = 𝟙 t.pt


/--
A topological space `X` is compactly generated if its topology is finer than (and thus equal to)
the compactly generated topology, i.e. it is coinduced by the continuous maps from compact
Hausdorff spaces to `X`.
-/
class UCompactlyGeneratedSpace (X : Type w) [t : TopologicalSpace X] : Prop where
  /-- The topology of `X` is finer than the compactly generated topology. -/
  le_compactlyGenerated : t ≤ compactlyGenerated.{u} X

{X : Type w}
[t : TopologicalSpace X]
[self : UCompactlyGeneratedSpace X]

t ≤ TopologicalSpace.compactlyGenerated X


theorem _root_.Continuous.const_clm_comp {X} [TopologicalSpace X] {f : X → E →SL[σ₁₂] F}
    (hf : Continuous f) (g : F →SL[σ₂₃] G) :
    Continuous (fun x => g.comp (f x) : X → E →SL[σ₁₃] G)

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{𝕜₃ : Type u_3}
{E : Type u_4}
{F : Type u_6}
{G : Type u_8}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[SeminormedAddCommGroup G]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NontriviallyNormedField 𝕜₃]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜₃ G]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{σ₂₃ : 𝕜₂ →+* 𝕜₃}
{σ₁₃ : 𝕜 →+* 𝕜₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[RingHomIsometric σ₂₃]
[RingHomIsometric σ₁₃]
[RingHomIsometric σ₁₂]
{X : Type u_11}
[TopologicalSpace X]
{f : X → E →SL[σ₁₂] F}
(hf : Continuous f)
(g : F →SL[σ₂₃] G)


@[simp]
theorem toDual_apply {x y : E} : toDual 𝕜 E x y = ⟪x, y⟫

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

((InnerProductSpace.toDual 𝕜 E) x) y = ⟪x, y⟫_𝕜