/-- The product over `Option α` of `β a` is the binary product of the
product over `α` of `β (some α)` and `β none` -/
@[simps]
def piOptionEquivProd {β : Option α → Type*} :
    (∀ a : Option α, β a) ≃ β none × ∀ a : α, β (some a)

{α : Type u_2}
{β : Option α → Type u_1}
(x : β none × ((a : α) → β (some a)))
(a : Option α)

Equiv.piOptionEquivProd.symm x a = Option.casesOn a x.1 x.2


theorem reflectsEpimorphisms.iso_iff {F G : C ⥤ D} (α : F ≅ G) :
    ReflectsEpimorphisms F ↔ ReflectsEpimorphisms G

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


{α : Type u}
[SemilatticeInf α]
[OrderBot α]
(a : α)


theorem gal_X_pow_isSolvable (n : ℕ) : IsSolvable (X ^ n : F[X]).Gal


protected theorem edist_eq (h : α ≃ᵢ β) (x y : α) : edist (h x) (h y) = edist x y

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(h : α ≃ᵢ β)
(x y : α)


@[to_additive] theorem of_mulHom_image [DecidableEq H] (f : G →ₙ* H)
    (hf : ∀ ⦃a b c d : G⦄, a * b = c * d → f a = f c ∧ f b = f d → a = c ∧ b = d)
    (h : UniqueMul (A.image f) (B.image f) (f a0) (f b0)) : UniqueMul A B a0 b0

(h : UniqueMul (Finset.image (⇑f) A) (Finset.image (⇑f) B) (f a0) (f b0))


@[simp]
theorem Hom.realize_term (g : M →[L] N) {t : L.Term α} {v : α → M} :
    t.realize (g ∘ v) = g (t.realize v)

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{α : Type u'}
(g : L.Hom M N)
{t : L.Term α}
{v : α → M}

FirstOrder.Language.Term.realize (⇑g ∘ v) t = g (FirstOrder.Language.Term.realize v t)


theorem valuation_single_zpow (s : ℤ) :
    Valued.v (HahnSeries.single s (1 : K) : LaurentSeries K) =
      Multiplicative.ofAdd (-(s : ℤ))

Valued.v ((HahnSeries.single s) 1) = ↑(Multiplicative.ofAdd (-s))


theorem univ_pi_piecewise_univ {ι : Type*} {α : ι → Type*} (s : Set ι) (t : ∀ i, Set (α i))
    [∀ x, Decidable (x ∈ s)] : pi univ (s.piecewise t fun _ => univ) = pi s t

{ι : Type u_7}
{α : ι → Type u_8}
(s : Set ι)
(t : (i : ι) → Set (α i))
[(x : ι) → Decidable (x ∈ s)]

Set.univ.pi (s.piecewise t fun x => Set.univ) = s.pi t


/-- A `Matroid α` is a ground set `E` of type `Set α`, and a nonempty collection of its subsets
  satisfying the exchange property and the maximal subset property. Each such set is called a
  `Base` of `M`. An `Indep`endent set is just a set contained in a base, but we include this
  predicate as a structure field for better definitional properties.

  In most cases, using this definition directly is not the best way to construct a matroid,
  since it requires specifying both the bases and independent sets. If the bases are known,
  use `Matroid.ofBase` or a variant. If just the independent sets are known,
  define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
  -/
@[ext] structure Matroid (α : Type _) where
  /-- `M` has a ground set `E`. -/
  (E : Set α)
  /-- `M` has a predicate `Base` definining its bases. -/
  (Base : Set α → Prop)
  /-- `M` has a predicate `Indep` defining its independent sets. -/
  (Indep : Set α → Prop)
  /-- The `Indep`endent sets are those contained in `Base`s. -/
  (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B)
  /-- There is at least one `Base`. -/
  (exists_base : ∃ B, Base B)
  /-- For any bases `B`, `B'` and `e ∈ B \ B'`, there is some `f ∈ B' \ B` for which `B-e+f`
    is a base. -/
  (base_exchange : Matroid.ExchangeProperty Base)
  /-- Every independent subset `I` of a set `X` for is contained in a maximal independent
    subset of `X`. -/
  (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X)
  /-- Every base is contained in the ground set. -/
  (subset_ground : ∀ B, Base B → B ⊆ E)

{α : Type u_1}
(self : Matroid α)
(B : Set α)


@[simp]
theorem restrict_empty (m : OuterMeasure α) : restrict ∅ m = 0

{α : Type u_1}
(m : MeasureTheory.OuterMeasure α)

(MeasureTheory.OuterMeasure.restrict ∅) m = 0


theorem decidableEq_inr_neg {α : Sort u} [h : DecidableEq α] {a b : α}
    (n : a ≠ b) : h a b = isFalse n


/-- Ordinals that are cardinals are unbounded. -/
theorem ord_card_unbounded : Unbounded (· < ·) { b : Ordinal | b.card.ord = b }

Set.Unbounded (fun x x_1 => x < x_1) {b | b.card.ord = b}


@[simp]
theorem coe_restrictScalars (f : A ≃ₐ[S] B) : (f.restrictScalars R : A ≃+* B) = f

(R : Type u)
{S : Type v}
{A : Type w}
{B : Type u₁}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Semiring B]
[Algebra R S]
[Algebra S A]
[Algebra S B]
[Algebra R A]
[Algebra R B]
[IsScalarTower R S A]
[IsScalarTower R S B]
(f : A ≃ₐ[S] B)


@[simp] lemma mem_nonZeroDivisorsRight_iff {x : M₀} :
    x ∈ nonZeroDivisorsRight M₀ ↔ ∀ y, x * y = 0 → y = 0

(M₀ : Type u_1)
[MonoidWithZero M₀]
{x : M₀}

x ∈ nonZeroDivisorsRight M₀ ↔ ∀ (y : M₀), x * y = 0 → y = 0


theorem OrderBot.ext_bot {α} {hA : PartialOrder α} (A : OrderBot α) {hB : PartialOrder α}
    (B : OrderBot α) (H : ∀ x y : α, (haveI := hA; x ≤ y) ↔ x ≤ y) :
    (@Bot.bot α (@OrderBot.toBot α hA.toLE A)) = (@Bot.bot α (@OrderBot.toBot α hB.toLE B))

{α : Type u_3}
{hA : PartialOrder α}
(A : OrderBot α)
{hB : PartialOrder α}
(B : OrderBot α)
(H : ∀ (x y : α), x ≤ y ↔ x ≤ y)


theorem IsMinFilter.isExtr : IsMinFilter f l a → IsExtrFilter f l a

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


theorem bmod_le {x : Int} {m : Nat} (h : 0 < m) : bmod x m ≤ (m - 1) / 2


theorem abs_sub_lt_iff : |a - b| < c ↔ a - b < c ∧ b - a < c

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


/-- The orthogonal projection of the circumcenter onto a face is the
circumcenter of that face. -/
theorem orthogonalProjection_circumcenter {n : ℕ} (s : Simplex ℝ P n) {fs : Finset (Fin (n + 1))}
    {m : ℕ} (h : fs.card = m + 1) :
    ↑((s.face h).orthogonalProjectionSpan s.circumcenter) = (s.face h).circumcenter

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P n)
{fs : Finset (Fin (n + 1))}
{m : ℕ}
(h : fs.card = m + 1)


@[to_additive]
theorem ContMDiffWithinAt.inv {f : M → G} {s : Set M} {x₀ : M}
    (hf : ContMDiffWithinAt I' I n f s x₀) : ContMDiffWithinAt I' I n (fun x => (f x)⁻¹) s x₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[Group G]
[LieGroup I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{n : ℕ∞}
{f : M → G}
{s : Set M}
{x₀ : M}
(hf : ContMDiffWithinAt I' I n f s x₀)


theorem dickson_one_one_charP (p : ℕ) [Fact p.Prime] [CharP R p] : dickson 1 (1 : R) p = X ^ p

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

Polynomial.dickson 1 1 p = Polynomial.X ^ p


@[simp]
theorem intDegree_zero : intDegree (0 : RatFunc K) = 0


/-- The inclusion map `Fin n → ℕ` is an embedding. -/
@[simps apply]
def valEmbedding : Fin n ↪ ℕ


@[simp] theorem get_some (x : α) (h : isSome (some x)) : (some x).get h = x

{α : Type u_1}
(x : α)
(h : (some x).isSome = true)


theorem comp_mono {p q : Seminorm 𝕜₂ E₂} (f : E →ₛₗ[σ₁₂] E₂) (hp : p ≤ q) : p.comp f ≤ q.comp f

{𝕜 : Type u_3}
{𝕜₂ : Type u_4}
{E : Type u_7}
{E₂ : Type u_8}
[SeminormedRing 𝕜]
[SeminormedRing 𝕜₂]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
[AddCommGroup E]
[AddCommGroup E₂]
[Module 𝕜 E]
[Module 𝕜₂ E₂]
{p q : Seminorm 𝕜₂ E₂}
(f : E →ₛₗ[σ₁₂] E₂)
(hp : p ≤ q)


theorem DifferentiableAt.clog {f : E → ℂ} {x : E} (h₁ : DifferentiableAt ℂ f x)
    (h₂ : f x ∈ slitPlane) : DifferentiableAt ℂ (fun t => log (f t)) x

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
(h₁ : DifferentiableAt ℂ f x)
(h₂ : f x ∈ Complex.slitPlane)

DifferentiableAt ℂ (fun t => Complex.log (f t)) x


@[simp]
theorem conjTransposeLinearEquiv_symm [CommSemiring R] [StarRing R] [AddCommMonoid α]
    [StarAddMonoid α] [Module R α] [StarModule R α] :
    (conjTransposeLinearEquiv m n R α).symm = conjTransposeLinearEquiv n m R α

(m : Type u_2)
(n : Type u_3)
(R : Type u_7)
(α : Type v)
[CommSemiring R]
[StarRing R]
[AddCommMonoid α]
[StarAddMonoid α]
[Module R α]
[StarModule R α]

(Matrix.conjTransposeLinearEquiv m n R α).symm = Matrix.conjTransposeLinearEquiv n m R α


theorem not_solvable_of_mem_derivedSeries {g : G} (h1 : g ≠ 1)
    (h2 : ∀ n : ℕ, g ∈ derivedSeries G n) : ¬IsSolvable G

{G : Type u_1}
[Group G]
{g : G}
(h1 : g ≠ 1)
(h2 : ∀ (n : ℕ), g ∈ derivedSeries G n)


protected theorem Nodup.sym2 {m : Multiset α} (h : m.Nodup) : m.sym2.Nodup

{α : Type u_1}
{m : Multiset α}
(h : m.Nodup)


theorem Indep.diff (hI : M.Indep I) (X : Set α) : M.Indep (I \ X)

{α : Type u_1}
{M : Matroid α}
{I : Set α}
(hI : M.Indep I)
(X : Set α)


@[simp]
lemma add_self_of_Y_ne {x₁ y₁ : F} {h₁ : W.Nonsingular x₁ y₁} (hy : y₁ ≠ W.negY x₁ y₁) :
    some h₁ + some h₁ = some (nonsingular_add h₁ h₁ fun _ => hy)

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ y₁ : F}
{h₁ : W.Nonsingular x₁ y₁}
(hy : y₁ ≠ W.negY x₁ y₁)

WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₁ = WeierstrassCurve.Affine.Point.some ⋯


/-- This application lemma only works in special circumstances. Given knowledge of
when `μ ≤ ν` and `ν ≤ μ`, a more general application lemma can be written. -/
theorem sub_apply [IsFiniteMeasure ν] (h₁ : MeasurableSet s) (h₂ : ν ≤ μ) :
    (μ - ν) s = μ s - ν s

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{s : Set α}
[MeasureTheory.IsFiniteMeasure ν]
(h₁ : MeasurableSet s)
(h₂ : ν ≤ μ)


lemma fst (h : LeftFraction₂Rel z₁ z₂) : LeftFractionRel z₁.fst z₂.fst

(h : CategoryTheory.MorphismProperty.LeftFraction₂Rel z₁ z₂)


/-- Whiskering by an equivalence gives an equivalence between categories of cones.
-/
@[simps]
def whiskeringEquivalence (e : K ≌ J) : Cocone F ≌ Cocone (e.functor ⋙ F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(e : K ≌ J)

(CategoryTheory.Limits.Cocones.whiskeringEquivalence e).functor = CategoryTheory.Limits.Cocones.whiskering e.functor


theorem exists_factorization_lt_of_lt {a b : ℕ} (ha : a ≠ 0) (hab : a < b) :
    ∃ p : ℕ, a.factorization p < b.factorization p

∃ p, a.factorization p < b.factorization p


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

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

↑((ContinuousMap.unitsLift.symm f) x) = ↑f x


theorem nonzeroMinimum_eq_nonzero_iff {xs : List Nat} {y : Nat} (h : y ≠ 0) :
    xs.nonzeroMinimum = y ↔ y ∈ xs ∧ (∀ x ∈ xs, y ≤ x ∨ x = 0)

xs.nonzeroMinimum = y ↔ y ∈ xs ∧ ∀ (x : Nat), x ∈ xs → y ≤ x ∨ x = 0


@[to_additive (attr := simp)]
theorem unop_bot : (⊥ : Submonoid Mᵐᵒᵖ).unop = ⊥


theorem lsub_lt_ord_of_isRegular {ι} {f : ι → Ordinal} {c} (hc : IsRegular c) (hι : #ι < c) :
    (∀ i, f i < c.ord) → Ordinal.lsub f < c.ord

{ι : Type (max u_2 u_3)}
{f : ι → Ordinal.{max u_2 u_3}}
{c : Cardinal.{max u_2 u_3}}
(hc : c.IsRegular)
(hι : #ι < c)

(∀ (i : ι), f i < c.ord) → Ordinal.lsub f < c.ord


@[simp]
theorem coe_mul (e₁ e₂ : r ≃r r) : ((e₁ * e₂) : α → α) = e₁ ∘ e₂

{α : Type u_1}
{r : α → α → Prop}
(e₁ e₂ : r ≃r r)

⇑(e₁ * e₂) = ⇑e₁ ∘ ⇑e₂


theorem lpMeasToLpTrim_smul (hm : m ≤ m0) (c : 𝕜) (f : lpMeas F 𝕜 m p μ) :
    lpMeasToLpTrim F 𝕜 p μ hm (c • f) = c • lpMeasToLpTrim F 𝕜 p μ hm f

{α : Type u_1}
{F : Type u_3}
{𝕜 : Type u_5}
{p : ℝ≥0∞}
[RCLike 𝕜]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(hm : m ≤ m0)
(c : 𝕜)
(f : ↥(MeasureTheory.lpMeas F 𝕜 m p μ))

MeasureTheory.lpMeasToLpTrim F 𝕜 p μ hm (c • f) = c • MeasureTheory.lpMeasToLpTrim F 𝕜 p μ hm f


protected theorem IsStrongLimit.isSuccLimit {c} (H : IsStrongLimit c) : IsSuccLimit c

{c : Cardinal.{u_2}}
(H : c.IsStrongLimit)


theorem Coloring.odd_length_iff_not_congr {α} {G : SimpleGraph α}
    (c : G.Coloring Bool) {u v : α} (p : G.Walk u v) :
    Odd p.length ↔ (¬c u ↔ c v)

{α : Type u_1}
{G : SimpleGraph α}
(c : G.Coloring Bool)
{u v : α}
(p : G.Walk u v)

Odd p.length ↔ (¬c u = true ↔ c v = true)


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

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


lemma LinearEquiv.conj_exact_iff_exact (e : N ≃ₗ[R] N') :
    Function.Exact (e ∘ₗ f) (g ∘ₗ (e.symm : N' →ₗ[R] N)) ↔ Exact f g

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{N' : Type u_5}
{P : Type u_6}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid N']
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R N']
[Module R P]
(f : M →ₗ[R] N)
(g : N →ₗ[R] P)
(e : N ≃ₗ[R] N')

Function.Exact ⇑(↑e ∘ₗ f) ⇑(g ∘ₗ ↑e.symm) ↔ Function.Exact ⇑f ⇑g


theorem sdiff_eq_sdiff_iff_inf_eq_inf : y \ x = y \ z ↔ y ⊓ x = y ⊓ z

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]


/-- The `n`-th Fréchet derivative applied to a vector `(m 0, ..., m (n-1))` is the derivative
multiplied by the product of the `m i`s. -/
theorem iteratedFDeriv_apply_eq_iteratedDeriv_mul_prod {m : Fin n → 𝕜} :
    (iteratedFDeriv 𝕜 n f x : (Fin n → 𝕜) → F) m = (∏ i, m i) • iteratedDeriv n f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}
{x : 𝕜}
{m : Fin n → 𝕜}

(iteratedFDeriv 𝕜 n f x) m = (∏ i : Fin n, m i) • iteratedDeriv n f x


@[simp]
theorem self_sub_C_mul_X_pow {R : Type*} [Ring R] (f : R[X]) :
    f - C f.leadingCoeff * X ^ f.natDegree = f.eraseLead

f - Polynomial.C f.leadingCoeff * Polynomial.X ^ f.natDegree = f.eraseLead


@[simp]
theorem totalDegree_zero : (0 : MvPolynomial σ R).totalDegree = 0

{R : Type u}
{σ : Type u_1}
[CommSemiring R]


@[measurability]
theorem measurable_pdf {m : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω)
    (μ : Measure E := by volume_tac) : Measurable (pdf X ℙ μ)

(μ : MeasureTheory.Measure E := by volume_tac)


theorem restrict_iInf_restrict {ι} (s : Set α) (m : ι → OuterMeasure α) :
    restrict s (⨅ i, restrict s (m i)) = restrict s (⨅ i, m i)

{α : Type u_1}
{ι : Sort u_2}
(s : Set α)
(m : ι → MeasureTheory.OuterMeasure α)

(MeasureTheory.OuterMeasure.restrict s) (⨅ i, (MeasureTheory.OuterMeasure.restrict s) (m i)) =
  (MeasureTheory.OuterMeasure.restrict s) (⨅ i, m i)


@[simp]
theorem mapRange.linearEquiv_apply (e : M ≃ₗ[R] N) (g : α →₀ M) :
    mapRange.linearEquiv e g = mapRange.linearMap e.toLinearMap g

{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(e : M ≃ₗ[R] N)
(g : α →₀ M)

(Finsupp.mapRange.linearEquiv e) g = (Finsupp.mapRange.linearMap ↑e) g


@[simp]
theorem comp_apply (f : B →⋆ₙₐ[R] C) (g : A →⋆ₙₐ[R] B) (a : A) : comp f g a = f (g a)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
[NonUnitalNonAssocSemiring C]
[DistribMulAction R C]
[Star C]
(f : B →⋆ₙₐ[R] C)
(g : A →⋆ₙₐ[R] B)
(a : A)


theorem comap_generateFrom {f : α → β} {s : Set (Set β)} :
    (generateFrom s).comap f = generateFrom (preimage f '' s)

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

MeasurableSpace.comap f (MeasurableSpace.generateFrom s) = MeasurableSpace.generateFrom (Set.preimage f '' s)


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

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


@[simp]
theorem uniformOfFintype_apply (a : α) : uniformOfFintype α a = (Fintype.card α : ℝ≥0∞)⁻¹

{α : Type u_1}
[Fintype α]
[Nonempty α]
(a : α)

(PMF.uniformOfFintype α) a = (↑(Fintype.card α))⁻¹


/-- The sum of two upper semicontinuous functions is upper semicontinuous. Formulated with
`[ContinuousAdd]`. The primed version of the lemma uses an explicit continuity assumption on
addition, for application to `EReal`. -/
theorem UpperSemicontinuous.add {f g : α → γ} (hf : UpperSemicontinuous f)
    (hg : UpperSemicontinuous g) : UpperSemicontinuous fun z => f z + g z

{α : Type u_1}
[TopologicalSpace α]
{γ : Type u_4}
[LinearOrderedAddCommMonoid γ]
[TopologicalSpace γ]
[OrderTopology γ]
[ContinuousAdd γ]
{f g : α → γ}
(hf : UpperSemicontinuous f)
(hg : UpperSemicontinuous g)


theorem smul_monomial {S} [SMulZeroClass S R] (a : S) (n : ℕ) (b : R) :
    a • monomial n b = monomial n (a • b)

{R : Type u}
[Semiring R]
{S : Type u_1}
[SMulZeroClass S R]
(a : S)
(n : ℕ)
(b : R)

a • (Polynomial.monomial n) b = (Polynomial.monomial n) (a • b)


@[reassoc (attr := simp)]
lemma leftHomologyπ_naturality' :
    h₁.π ≫ leftHomologyMap' φ h₁ h₂ = cyclesMap' φ h₁ h₂ ≫ h₂.π

CategoryTheory.CategoryStruct.comp h₁.π (CategoryTheory.ShortComplex.leftHomologyMap' φ h₁ h₂) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.cyclesMap' φ h₁ h₂) h₂.π


theorem gauge_lt_one_eq_interior (hc : Convex ℝ s) (hs₀ : s ∈ 𝓝 0) :
    { x | gauge s x < 1 } = interior s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
(hc : Convex ℝ s)
(hs₀ : s ∈ 𝓝 0)


theorem forall_sups_iff {p : α → Prop} : (∀ c ∈ s ⊻ t, p c) ↔ ∀ a ∈ s, ∀ b ∈ t, p (a ⊔ b)

{α : Type u_2}
[SemilatticeSup α]
{s t : Set α}
{p : α → Prop}


@[to_additive (attr := simp)]
theorem map_id (z : N) : f.map (fun y ↦ show MonoidHom.id M y ∈ S from y.2) f z = z

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


theorem apply_total_id (f : M →ₗ[R] M') (l : M →₀ R) :
    f (Finsupp.total M M R _root_.id l) = Finsupp.total M M' R f l

{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_8}
[AddCommMonoid M']
[Module R M']
(f : M →ₗ[R] M')
(l : M →₀ R)

f ((Finsupp.total M M R id) l) = (Finsupp.total M M' R ⇑f) l


/-- If `M = R^ι`, `ofTensorProduct` is bijective. -/
lemma ofTensorProduct_bijective_of_pi_of_fintype [Finite ι] :
    Function.Bijective (ofTensorProduct I (ι → R))

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(ι : Type u_4)
[Finite ι]

Function.Bijective ⇑(AdicCompletion.ofTensorProduct I (ι → R))


theorem IsPathConnected.exists_path_through_family {n : ℕ}
    {s : Set X} (h : IsPathConnected s) (p : Fin (n + 1) → X) (hp : ∀ i, p i ∈ s) :
    ∃ γ : Path (p 0) (p n), range γ ⊆ s ∧ ∀ i, p i ∈ range γ

{X : Type u_1}
[TopologicalSpace X]
{n : ℕ}
{s : Set X}
(h : IsPathConnected s)
(p : Fin (n + 1) → X)
(hp : ∀ (i : Fin (n + 1)), p i ∈ s)

∃ γ, Set.range ⇑γ ⊆ s ∧ ∀ (i : Fin (n + 1)), p i ∈ Set.range ⇑γ


theorem update_inr_apply_inl [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : α} {j : β} {x : γ} :
    update f (inr j) x (inl i) = f (inl i)

{α : Type u}
{β : Type v}
{γ : Type u_1}
[DecidableEq (α ⊕ β)]
{f : α ⊕ β → γ}
{i : α}
{j : β}
{x : γ}

Function.update f (Sum.inr j) x (Sum.inl i) = f (Sum.inl i)


theorem integral_undef {f : α → G} (h : ¬Integrable f μ) : ∫ a, f a ∂μ = 0

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → G}
(h : ¬MeasureTheory.Integrable f μ)


theorem dlookup_kinsert {a} {b : β a} (l : List (Sigma β)) :
    dlookup a (kinsert a b l) = some b

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
(l : List (Sigma β))

List.dlookup a (List.kinsert a b l) = some b


theorem IsLittleO.pow {f : α → R} {g : α → 𝕜} (h : f =o[l] g) {n : ℕ} (hn : 0 < n) :
    (fun x => f x ^ n) =o[l] fun x => g x ^ n

{α : Type u_1}
{R : Type u_13}
{𝕜 : Type u_15}
[SeminormedRing R]
[NormedDivisionRing 𝕜]
{l : Filter α}
{f : α → R}
{g : α → 𝕜}
(h : f =o[l] g)
{n : ℕ}
(hn : 0 < n)


theorem bddAbove_Ico : BddAbove (Ico a b)


theorem multiset_sum_pow_char_pow (s : Multiset R) :
    s.sum ^ p ^ n = (s.map (· ^ p ^ n : R → R)).sum

{R : Type u}
[CommSemiring R]
(p : ℕ)
[ExpChar R p]
(n : ℕ)
(s : Multiset R)

s.sum ^ p ^ n = (Multiset.map (fun x => x ^ p ^ n) s).sum


@[simp]
theorem _root_.Cardinal.natCast_lt_toPartENat_iff {n : ℕ} {c : Cardinal} :
    ↑n < toPartENat c ↔ ↑n < c


theorem get?_take {s : Stream' α} : ∀ {k n}, k < n → (s.take n).get? k = s.get k

k < n → (Stream'.take n s).get? k = some (s.get k)


theorem le_generateFrom_piiUnionInter {π : ι → Set (Set α)} (S : Set ι) {x : ι} (hxS : x ∈ S) :
    generateFrom (π x) ≤ generateFrom (piiUnionInter π S)

{α : Type u_1}
{ι : Type u_2}
{π : ι → Set (Set α)}
(S : Set ι)
{x : ι}
(hxS : x ∈ S)

MeasurableSpace.generateFrom (π x) ≤ MeasurableSpace.generateFrom (piiUnionInter π S)


theorem Antitone.const_mul [PosMulMono α]
    (hf : Antitone f) (ha : 0 ≤ a) : Antitone fun x => a * f x

{α : Type u}
{β : Type u_1}
[Semiring α]
[Preorder α]
{a : α}
[Preorder β]
{f : β → α}
[PosMulMono α]
(hf : Antitone f)
(ha : 0 ≤ a)


theorem mapRange_neg [NegZeroClass G] [NegZeroClass H] {f : G → H} {hf : f 0 = 0}
    (hf' : ∀ x, f (-x) = -f x) (v : α →₀ G) : mapRange f hf (-v) = -mapRange f hf v

{α : Type u_1}
{G : Type u_9}
{H : Type u_10}
[NegZeroClass G]
[NegZeroClass H]
{f : G → H}
{hf : f 0 = 0}
(hf' : ∀ (x : G), f (-x) = -f x)
(v : α →₀ G)

Finsupp.mapRange f hf (-v) = -Finsupp.mapRange f hf v


@[simp]
theorem alephIdx_lt {a b} : alephIdx a < alephIdx b ↔ a < b


@[simp]
theorem frontier_Iio' {a : α} (ha : (Iio a).Nonempty) : frontier (Iio a) = {a}

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a : α}
(ha : (Set.Iio a).Nonempty)


theorem pullback_pushforward_le (f : Y ⟶ X) (R : Sieve X) : (R.pullback f).pushforward f ≤ R

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

CategoryTheory.Sieve.pushforward f (CategoryTheory.Sieve.pullback f R) ≤ R


theorem not_nonempty_iff_imp_false {α : Sort*} : ¬Nonempty α ↔ α → False


/-- A circulant of `v` is symmetric iff `v` equals its reverse. -/
theorem circulant_isSymm_iff [AddGroup n] {v : n → α} :
    (circulant v).IsSymm ↔ ∀ i, v (-i) = v i

{α : Type u_1}
{n : Type u_4}
[AddGroup n]
{v : n → α}

(Matrix.circulant v).IsSymm ↔ ∀ (i : n), v (-i) = v i


@[simp, norm_cast]
theorem coe_zero : ((0 : R) : ℍ[R]) = 0


@[simp]
theorem coeff_mul_C (p : R[X]) (n : ℕ) (a : R) : coeff (p * C a) n = coeff p n * a

{R : Type u}
[Semiring R]
(p : R[X])
(n : ℕ)
(a : R)

(p * Polynomial.C a).coeff n = p.coeff n * a


theorem getElem?_take_eq_if {l : List α} {n m : Nat} :
    (l.take n)[m]? = if m < n then l[m]? else none

(List.take n l)[m]? = if m < n then l[m]? else none


@[to_additive (attr := simp)]
theorem singletonMonoidHom_apply (a : α) : singletonMonoidHom a = {a}

{α : Type u_2}
[DecidableEq α]
[AddZeroClass α]
(a : α)


/-- Let the group `G` be the union of finitely many left cosets `g i • H i`. Then the
sum of the inverses of the indexes of the subgroups `H i` is greater than or equal to 1. -/
@[to_additive one_le_sum_inv_index_of_leftCoset_cover]
theorem one_le_sum_inv_index_of_leftCoset_cover :
    1 ≤ ∑ i ∈ s, ((H i).index : ℚ)⁻¹

(hcovers : ⋃ i ∈ s, g i +ᵥ ↑(H i) = Set.univ)


theorem join_ne_none' : ¬x.join = none ↔ ∃ z, x = some (some z)

∀ {α : Type u_1} {x : Option (Option α)}, ¬x.join = none ↔ ∃ z, x = some (some z)


@[simp]
lemma Gammaℂ_one : Gammaℂ 1 = 1 / π


@[fun_prop]
protected theorem HasFDerivAt.iterate {f : E → E} {f' : E →L[𝕜] E} (hf : HasFDerivAt f f' x)
    (hx : f x = x) (n : ℕ) : HasFDerivAt f^[n] (f' ^ n) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{f : E → E}
{f' : E →L[𝕜] E}
(hf : HasFDerivAt f f' x)
(hx : f x = x)
(n : ℕ)


/-- Up to rotation, the contractible triangle `X ⟶ X ⟶ 0 ⟶ X⟦1⟧` for `X : Cᵒᵖ` corresponds
to the contractible triangle for `X.unop` in `C`. -/
@[simps!]
noncomputable def contractibleTriangleIso (X : Cᵒᵖ) :
    contractibleTriangle X ≅ (triangleOpEquivalence C).functor.obj
      (Opposite.op (contractibleTriangle X.unop).invRotate)

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

(CategoryTheory.Pretriangulated.Opposite.contractibleTriangleIso X).inv.hom₃ = (⋯.iso ⋯).inv


@[simp] theorem add_def {a b : Int} : Int.add a b = a + b


/-- The orthogonal projections onto equal subspaces are coerced back to the same point in `E`. -/
theorem eq_orthogonalProjection_of_eq_submodule {K' : Submodule 𝕜 E} [HasOrthogonalProjection K']
    (h : K = K') (u : E) : (orthogonalProjection K u : E) = (orthogonalProjection K' u : E)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]
{K' : Submodule 𝕜 E}
[HasOrthogonalProjection K']
(h : K = K')
(u : E)

↑((orthogonalProjection K) u) = ↑((orthogonalProjection K') u)


lemma eq_lineMap_of_dist_eq_mul_of_dist_eq_mul (hxy : dist x y = r * dist x z)
    (hyz : dist y z = (1 - r) * dist x z) : y = AffineMap.lineMap x z r

{E : Type u_3}
{PE : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[StrictConvexSpace ℝ E]
[MetricSpace PE]
[NormedAddTorsor E PE]
{r : ℝ}
{x y z : PE}
(hxy : dist x y = r * dist x z)
(hyz : dist y z = (1 - r) * dist x z)


/-- For functors out of a discrete category,
a natural isomorphism is just a collection of isomorphisms,
as the naturality squares are trivial.
-/
@[simps!]
def natIso {I : Type u₁} {F G : Discrete I ⥤ C} (f : ∀ i : Discrete I, F.obj i ≅ G.obj i) :
    F ≅ G

{F G : CategoryTheory.Functor (CategoryTheory.Discrete I) C}

(f : (i : CategoryTheory.Discrete I) → F.obj i ≅ G.obj i)

(CategoryTheory.Discrete.natIso f).hom.app X = (f X).hom


theorem subset_intentClosure_iff_subset_extentClosure :
    t ⊆ intentClosure r s ↔ s ⊆ extentClosure r t

{α : Type u_2}
{β : Type u_3}
{r : α → β → Prop}
{s : Set α}
{t : Set β}


theorem inducing_prod_map {W X Y Z : TopCat.{u}} {f : W ⟶ X} {g : Y ⟶ Z} (hf : Inducing f)
    (hg : Inducing g) : Inducing (Limits.prod.map f g)

{W X Y Z : TopCat}
{f : W ⟶ X}
{g : Y ⟶ Z}
(hf : Inducing ⇑f)
(hg : Inducing ⇑g)

Inducing ⇑(CategoryTheory.Limits.prod.map f g)


/-- The counit isomorphism for `functorProdFunctorEquiv` -/
@[simps!]
def functorProdFunctorEquivCounitIso :
    functorProdToProdFunctor A B C ⋙ prodFunctorToFunctorProd A B C ≅ 𝟭 _

(A : Type u₁)
[CategoryTheory.Category.{v₁, u₁} A]
(B : Type u₂)
[CategoryTheory.Category.{v₂, u₂} B]
(C : Type u₃)
[CategoryTheory.Category.{v₃, u₃} C]
(X : CategoryTheory.Functor A (B × C))

∀ (X_1 : A),
  ((CategoryTheory.functorProdFunctorEquivCounitIso A B C).inv.app X).app X_1 =
    (CategoryTheory.CategoryStruct.id (X.obj X_1).1, CategoryTheory.CategoryStruct.id (X.obj X_1).2)


theorem isAcyclic_iff_forall_adj_isBridge :
    G.IsAcyclic ↔ ∀ ⦃v w : V⦄, G.Adj v w → G.IsBridge s(v, w)


@[simp]
theorem toEquiv_eq_coe : e.toEquiv = e

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)


theorem length_split_lt {a b} {l l₁ l₂ : List α} (h : split (a :: b :: l) = (l₁, l₂)) :
    length l₁ < length (a :: b :: l) ∧ length l₂ < length (a :: b :: l)

{α : Type u}
{a b : α}
{l l₁ l₂ : List α}
(h : (a :: b :: l).split = (l₁, l₂))

l₁.length < (a :: b :: l).length ∧ l₂.length < (a :: b :: l).length


/-- A scalar multiplication is cancellative if it is pointwise injective on the left and right. -/
@[to_additive]
class IsCancelSMul (G P : Type*) [SMul G P] : Prop where
  protected left_cancel : ∀ (a : G) (b c : P), a • b = a • c → b = c
  protected right_cancel : ∀ (a b : G) (c : P), a • c = b • c → a = b

{G : Type u_3}
{P : Type u_4}
[SMul G P]
[self : IsCancelSMul G P]
(a : G)
(b c : P)


/-- The right fraction from `X` to `Y` given by a morphism `s : Y ⟶ X` such that `W s`. -/
@[simps]
def ofInv (s : Y ⟶ X) (hs : W s) :
    W.RightFraction X Y

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
{X Y : C}
(s : Y ⟶ X)
(hs : W s)

(CategoryTheory.MorphismProperty.RightFraction.ofInv s hs).s = s


/-- A `BumpCovering ι X s` is an indexed family of functions `f i`, `i : ι`, such that

* the supports of `f i` form a locally finite family of sets, i.e., for every point `x : X` there
  exists a neighborhood `U ∋ x` such that all but finitely many functions `f i` are zero on `U`;
* for all `i`, `x` we have `0 ≤ f i x ≤ 1`;
* each point `x ∈ s` belongs to the interior of `{x | f i x = 1}` for some `i`.

One of the main use cases for a `BumpCovering` is to define a `PartitionOfUnity`, see
`BumpCovering.toPartitionOfUnity`, but some proofs can directly use a `BumpCovering` instead of
a `PartitionOfUnity`.

If `X` is a normal paracompact space, then `BumpCovering.exists_isSubordinate` guarantees that for
every open covering `U : Set (Set X)` of `s` there exists a `BumpCovering` of `s` that is
subordinate to `U`.
-/
structure BumpCovering (ι X : Type*) [TopologicalSpace X] (s : Set X := univ) where
  /-- The collections of continuous functions underlying this bump covering -/
  toFun : ι → C(X, ℝ)
  /-- the supports of the underlying functions are a locally finite family of sets -/
  locallyFinite' : LocallyFinite fun i => support (toFun i)
  /-- the functions are non-negative -/
  nonneg' : 0 ≤ toFun
  /-- the functions are each at most one -/
  le_one' : toFun ≤ 1
  /-- Each point `x ∈ s` belongs to the interior of `{x | f i x = 1}` for some `i`. -/
  eventuallyEq_one' : ∀ x ∈ s, ∃ i, toFun i =ᶠ[𝓝 x] 1

{ι : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{s : optParam (Set X) Set.univ}
(self : BumpCovering ι X s)


lemma inverse_pow (r : M₀) : ∀ n : ℕ, Ring.inverse r ^ n = Ring.inverse (r ^ n)

{M₀ : Type u_2}
[MonoidWithZero M₀]
(r : M₀)
(n : ℕ)


/-- A positive solution is a generator (up to sign) of the group of all solutions to the
Pell equation `x^2 - d*y^2 = 1` if and only if it is a fundamental solution. -/
theorem pos_generator_iff_fundamental (a : Solution₁ d) :
    (1 < a.x ∧ 0 < a.y ∧ ∀ b : Solution₁ d, ∃ n : ℤ, b = a ^ n ∨ b = -a ^ n) ↔ IsFundamental a

(1 < a.x ∧ 0 < a.y ∧ ∀ (b : Pell.Solution₁ d), ∃ n, b = a ^ n ∨ b = -a ^ n) ↔ Pell.IsFundamental a


lemma partialSups_iff_forall {f : ℕ → α} (p : α → Prop)
    (hp : ∀ {a b}, p (a ⊔ b) ↔ p a ∧ p b) : ∀ {n : ℕ}, p (partialSups f n) ↔ ∀ k ≤ n, p (f k)

(hp : ∀ {a b : α}, p (a ⊔ b) ↔ p a ∧ p b)

p ((partialSups f) n) ↔ ∀ k ≤ n, p (f k)


/-- Taking skyscraper presheaf at a point is functorial: `c ↦ skyscraper p₀ c` defines a functor by
sending every `f : a ⟶ b` to the natural transformation `α` defined as: `α(U) = f : a ⟶ b` if
`p₀ ∈ U` and the unique morphism to a terminal object in `C` if `p₀ ∉ U`.
-/
@[simps]
def skyscraperPresheafFunctor : C ⥤ Presheaf C X

[(U : TopologicalSpace.Opens ↑X) → Decidable (p₀ ∈ U)]

∀ {X_1 Y : C} (f : X_1 ⟶ Y), (skyscraperPresheafFunctor p₀).map f = SkyscraperPresheafFunctor.map' p₀ f


/-- Note: This does not hold for `n = ∞`. `f` being `C^∞` at `x` means that for every `n`, `f` is
`C^n` on some neighborhood of `x`, but this neighborhood can depend on `n`. -/
theorem contMDiffAt_iff_contMDiffAt_nhds {n : ℕ} :
    ContMDiffAt I I' n f x ↔ ∀ᶠ x' in 𝓝 x, ContMDiffAt I I' n f x'

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
{f : M → M'}
{x : M}
{n : ℕ}

ContMDiffAt I I' (↑n) f x ↔ ∀ᶠ (x' : M) in 𝓝 x, ContMDiffAt I I' (↑n) f x'


lemma nonUnitalStarAlgHom_id {a : A} {φ : C(σₙ S a, S)₀ →⋆ₙₐ[S] A} {f : C(S, R)}
    (h : QuasispectrumRestricts a f) (h_id : φ (.id rfl) = a) :
    h.nonUnitalStarAlgHom φ (.id rfl) = a

{φ : ContinuousMapZero (↑(quasispectrum S a)) S →⋆ₙₐ[S] A}

(QuasispectrumRestricts.nonUnitalStarAlgHom φ h) (ContinuousMapZero.id ⋯) = a


protected theorem sub_sub_self (a b : Int) : a - (a - b) = b


/-- We can clear the denominators of a finite set of fractions. -/
theorem exist_integer_multiples_of_finset (s : Finset M') :
    ∃ b : S, ∀ a ∈ s, IsInteger f ((b : R) • a)

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

∃ b, ∀ a ∈ s, IsLocalizedModule.IsInteger f (↑b • a)


/-- The additive equivalence `Cochain K L n ≃+ Cochain (K⟦a⟧) L n'` when `n + a = n'`. -/
@[simps]
def leftShiftAddEquiv (n a n' : ℤ) (hn' : n + a = n') :
    Cochain K L n ≃+ Cochain (K⟦a⟧) L n'

(γ : CochainComplex.HomComplex.Cochain ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) a).obj K) L n')

(CochainComplex.HomComplex.Cochain.leftShiftAddEquiv K L n a n' hn').symm γ = γ.leftUnshift n hn'


@[reassoc (attr := simp)]
theorem biprod.lift_desc {T U : C} {f : T ⟶ X} {g : T ⟶ Y} {h : X ⟶ U} {i : Y ⟶ U} :
    biprod.lift f g ≫ biprod.desc h i = f ≫ h + g ≫ i

CategoryTheory.Limits.biprod.lift f g ≫ CategoryTheory.Limits.biprod.desc h i = f ≫ h + g ≫ i


/-- Extract the functor `J ⥤ C` consisting of the cocone points and the maps between them,
from a `DiagramOfCocones`.
-/
@[simps]
def DiagramOfCocones.coconePoints (D : DiagramOfCocones F) : J ⥤ C

(D : CategoryTheory.Limits.DiagramOfCocones F)


theorem frobenius_neg : frobenius R p (-x) = -frobenius R p x

(R : Type u)
[CommRing R]
(p : ℕ)
[ExpChar R p]
(x : R)

(frobenius R p) (-x) = -(frobenius R p) x


theorem Nonempty.eq_one [Subsingleton α] [One α] {s : Set α} (h : s.Nonempty) :
    s = {1}

{α : Type u}
[Subsingleton α]
[One α]
{s : Set α}
(h : s.Nonempty)


theorem of_measurable_inverse_on_range {g : range f → α} (hf₁ : Measurable f)
    (hf₂ : MeasurableSet (range f)) (hg : Measurable g) (H : LeftInverse g (rangeFactorization f)) :
    MeasurableEmbedding f

(H : Function.LeftInverse g (Set.rangeFactorization f))


@[simp]
theorem arrowCongr_symm_apply {R M₁ M₂ M₂₁ M₂₂ : Sort _} [CommSemiring R] [AddCommMonoid M₁]
    [AddCommMonoid M₂] [AddCommMonoid M₂₁] [AddCommMonoid M₂₂] [Module R M₁] [Module R M₂]
    [Module R M₂₁] [Module R M₂₂] (e₁ : M₁ ≃ₗ[R] M₂) (e₂ : M₂₁ ≃ₗ[R] M₂₂) (f : M₂ →ₗ[R] M₂₂)
    (x : M₁) : (arrowCongr e₁ e₂).symm f x = e₂.symm (f (e₁ x))

{R : Type u_17}
{M₁ : Type u_18}
{M₂ : Type u_19}
{M₂₁ : Type u_20}
{M₂₂ : Type u_21}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M₂₁]
[AddCommMonoid M₂₂]
[Module R M₁]
[Module R M₂]
[Module R M₂₁]
[Module R M₂₂]
(e₁ : M₁ ≃ₗ[R] M₂)
(e₂ : M₂₁ ≃ₗ[R] M₂₂)
(f : M₂ →ₗ[R] M₂₂)
(x : M₁)

((e₁.arrowCongr e₂).symm f) x = e₂.symm (f (e₁ x))


theorem yang_baxter_iso (X Y Z : C) :
    (α_ X Y Z).symm ≪≫ whiskerRightIso (β_ X Y) Z ≪≫ α_ Y X Z ≪≫
    whiskerLeftIso Y (β_ X Z) ≪≫ (α_ Y Z X).symm ≪≫
    whiskerRightIso (β_ Y Z) X ≪≫ (α_ Z Y X) =
      whiskerLeftIso X (β_ Y Z) ≪≫ (α_ X Z Y).symm ≪≫
      whiskerRightIso (β_ X Z) Y ≪≫ α_ Z X Y ≪≫
      whiskerLeftIso Z (β_ X Y)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(X Y Z : C)

(α_ X Y Z).symm ≪≫
    CategoryTheory.MonoidalCategory.whiskerRightIso (β_ X Y) Z ≪≫
      α_ Y X Z ≪≫
        CategoryTheory.MonoidalCategory.whiskerLeftIso Y (β_ X Z) ≪≫
          (α_ Y Z X).symm ≪≫ CategoryTheory.MonoidalCategory.whiskerRightIso (β_ Y Z) X ≪≫ α_ Z Y X =
  CategoryTheory.MonoidalCategory.whiskerLeftIso X (β_ Y Z) ≪≫
    (α_ X Z Y).symm ≪≫
      CategoryTheory.MonoidalCategory.whiskerRightIso (β_ X Z) Y ≪≫
        α_ Z X Y ≪≫ CategoryTheory.MonoidalCategory.whiskerLeftIso Z (β_ X Y)


@[simp] theorem mod_mod (a n : Nat) : (a % n) % n = a % n


@[to_additive]
theorem smoothAt_finset_prod (h : ∀ i ∈ t, SmoothAt I' I (f i) x) :
    SmoothAt I' I (fun x => ∏ i ∈ t, f i x) x

{ι : Type u_1}
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{H : Type u_3}
[TopologicalSpace H]
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[AddCommMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{x : M}
{t : Finset ι}
{f : ι → M → G}
(h : ∀ i ∈ t, SmoothAt I' I (f i) x)

SmoothAt I' I (fun x => ∑ i ∈ t, f i x) x


theorem translationNumber_eq_of_tendsto₀' {τ' : ℝ}
    (h : Tendsto (fun n : ℕ => f^[n + 1] 0 / (n + 1)) atTop (𝓝 τ')) : τ f = τ'

(h : Filter.Tendsto (fun n => (⇑f)^[n + 1] 0 / (↑n + 1)) Filter.atTop (𝓝 τ'))


@[to_additive]
theorem mulIndicator_eq_one_or_self (s : Set α) (f : α → M) (a : α) :
    mulIndicator s f a = 1 ∨ mulIndicator s f a = f a

{α : Type u_1}
{M : Type u_4}
[Zero M]
(s : Set α)
(f : α → M)
(a : α)

s.indicator f a = 0 ∨ s.indicator f a = f a


theorem diff_diff_right_self (s t : Set α) : s \ (s \ t) = s ∩ t


theorem filter_mem_eq_inter {s t : Finset α} [∀ i, Decidable (i ∈ t)] :
    (s.filter fun i => i ∈ t) = s ∩ t

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
[(i : α) → Decidable (i ∈ t)]

Finset.filter (fun i => i ∈ t) s = s ∩ t


theorem normalClosure_eq_iInf :
    normalClosure s = ⨅ (N : Subgroup G) (_ : Normal N) (_ : s ⊆ N), N

Subgroup.normalClosure s = ⨅ N, ⨅ (_ : N.Normal), ⨅ (_ : s ⊆ ↑N), N


@[simp, mfld_simps]
theorem subtypeRestr_source : (e.subtypeRestr hs).source = (↑) ⁻¹' e.source

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{s : TopologicalSpace.Opens X}
(hs : Nonempty ↥s)

(e.subtypeRestr hs).source = Subtype.val ⁻¹' e.source


theorem mkContinuousLinear_norm_le' (f : G →ₗ[𝕜] MultilinearMap 𝕜 E G') (C : ℝ)
    (H : ∀ x m, ‖f x m‖ ≤ C * ‖x‖ * ∏ i, ‖m i‖) : ‖mkContinuousLinear f C H‖ ≤ max C 0

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

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

‖MultilinearMap.mkContinuousLinear f C H‖ ≤ max C 0


theorem lpMeasToLpTrimLie_symm_toLp [one_le_p : Fact (1 ≤ p)] [NormedSpace ℝ F] (hm : m ≤ m0)
    (f : α → F) (hf : Memℒp f p (μ.trim hm)) :
    ((lpMeasToLpTrimLie F ℝ p μ hm).symm (hf.toLp f) : Lp F p μ) =
      (memℒp_of_memℒp_trim hm hf).toLp f

(hf : MeasureTheory.Memℒp f p (μ.trim hm))

↑((MeasureTheory.lpMeasToLpTrimLie F ℝ p μ hm).symm (MeasureTheory.Memℒp.toLp f hf)) = MeasureTheory.Memℒp.toLp f ⋯


theorem closedBall_zero_eq_preimage_closedBall {r : ℝ} :
    p.closedBall 0 r = p ⁻¹' Metric.closedBall 0 r

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : Seminorm 𝕜 E)
{r : ℝ}

p.closedBall 0 r = ⇑p ⁻¹' Metric.closedBall 0 r


@[simp]
theorem range_quotient_lift_on' {s : Setoid ι} (hf) :
    (range fun x : Quotient s => Quotient.liftOn' x f hf) = range f

(hf : ∀ (a b : ι), Setoid.r a b → f a = f b)

(Set.range fun x => x.liftOn' f hf) = Set.range f


@[simp]
theorem symm_trans (e₁ : E ≃ₛₗᵢ[σ₁₂] E₂) (e₂ : E₂ ≃ₛₗᵢ[σ₂₃] E₃) :
    (e₁.trans e₂).symm = e₂.symm.trans e₁.symm

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


theorem continuous_right_toIcoMod : ContinuousWithinAt (toIcoMod hp a) (Ici x) x

{𝕜 : Type u_1}
[LinearOrderedAddCommGroup 𝕜]
[Archimedean 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{p : 𝕜}
(hp : 0 < p)
(a x : 𝕜)

ContinuousWithinAt (toIcoMod hp a) (Set.Ici x) x


theorem sum_curry_index (f : α × β →₀ M) (g : α → β → M → N) (hg₀ : ∀ a b, g a b 0 = 0)
    (hg₁ : ∀ a b c₀ c₁, g a b (c₀ + c₁) = g a b c₀ + g a b c₁) :
    (f.curry.sum fun a f => f.sum (g a)) = f.sum fun p c => g p.1 p.2 c

(f : α × β →₀ M)

(hg₁ : ∀ (a : α) (b : β) (c₀ c₁ : M), g a b (c₀ + c₁) = g a b c₀ + g a b c₁)


/-- A natural transformation `L₁ ⟶ L₂` induces a functor `Comma L₂ R ⥤ Comma L₁ R`. -/
@[simps]
def mapLeft (l : L₁ ⟶ L₂) : Comma L₂ R ⥤ Comma L₁ R

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(R : CategoryTheory.Functor B T)
{L₁ L₂ : CategoryTheory.Functor A T}
(l : L₁ ⟶ L₂)
(X : CategoryTheory.Comma L₂ R)

((CategoryTheory.Comma.mapLeft R l).obj X).left = X.left


theorem isPrimitive_of_dvd {p q : R[X]} (hp : IsPrimitive p) (hq : q ∣ p) : IsPrimitive q

{R : Type u_1}
[CommSemiring R]
{p q : Polynomial R}
(hp : p.IsPrimitive)
(hq : q ∣ p)


/-- If a function has a Taylor series at order at least 1, then at points in the interior of the
    domain of definition, the term of order 1 of this series is a strict derivative of `f`. -/
theorem HasFTaylorSeriesUpToOn.hasStrictFDerivAt {s : Set E'} {f : E' → F'} {x : E'}
    {p : E' → FormalMultilinearSeries 𝕂 E' F'} (hf : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≤ n)
    (hs : s ∈ 𝓝 x) : HasStrictFDerivAt f ((continuousMultilinearCurryFin1 𝕂 E' F') (p x 1)) x


/-- If the terms in the sum `∑' (i : ι), F i` are uniformly bounded on `U` by a
summable function, then the sum of `deriv F i` at a point in `U` is the derivative of the
sum. -/
theorem hasSum_deriv_of_summable_norm {u : ι → ℝ} (hu : Summable u)
    (hf : ∀ i : ι, DifferentiableOn ℂ (F i) U) (hU : IsOpen U)
    (hF_le : ∀ (i : ι) (w : ℂ), w ∈ U → ‖F i w‖ ≤ u i) (hz : z ∈ U) :
    HasSum (fun i : ι => deriv (F i) z) (deriv (fun w : ℂ => ∑' i : ι, F i w) z)

(hf : ∀ (i : ι), DifferentiableOn ℂ (F i) U)

(hF_le : ∀ (i : ι), ∀ w ∈ U, ‖F i w‖ ≤ u i)

HasSum (fun i => deriv (F i) z) (deriv (fun w => ∑' (i : ι), F i w) z)


theorem wbtw_or_wbtw_smul_vadd_of_nonneg (x : P) (v : V) {r₁ r₂ : R} (hr₁ : 0 ≤ r₁) (hr₂ : 0 ≤ r₂) :
    Wbtw R x (r₁ • v +ᵥ x) (r₂ • v +ᵥ x) ∨ Wbtw R x (r₂ • v +ᵥ x) (r₁ • v +ᵥ x)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(x : P)
(v : V)
{r₁ r₂ : R}
(hr₁ : 0 ≤ r₁)
(hr₂ : 0 ≤ r₂)


@[to_additive]
theorem MonoidHom.cancel_left [MulOneClass M] [MulOneClass N] [MulOneClass P]
    {g : N →* P} {f₁ f₂ : M →* N} (hg : Function.Injective g) : g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
{g : N →+ P}
{f₁ f₂ : M →+ N}
(hg : Function.Injective ⇑g)


theorem biUnion_diff_biUnion_eq {s t : Set ι} {f : ι → Set α} (h : (s ∪ t).PairwiseDisjoint f) :
    ((⋃ i ∈ s, f i) \ ⋃ i ∈ t, f i) = ⋃ i ∈ s \ t, f i

{α : Type u_1}
{ι : Type u_4}
{s t : Set ι}
{f : ι → Set α}
(h : (s ∪ t).PairwiseDisjoint f)

(⋃ i ∈ s, f i) \ ⋃ i ∈ t, f i = ⋃ i ∈ s \ t, f i


theorem mem_sym2_cons_iff {x : α} {xs : List α} {z : Sym2 α} :
    z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (∃ y, y ∈ xs ∧ z = s(x, y)) ∨ z ∈ xs.sym2

{α : Type u_1}
{x : α}
{xs : List α}
{z : Sym2 α}

z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (∃ y ∈ xs, z = s(x, y)) ∨ z ∈ xs.sym2


@[to_additive add_one_zsmul]
lemma zpow_add_one (a : G) : ∀ n : ℤ, a ^ (n + 1) = a ^ n * a

{G : Type u_3}
[Group G]
(a : G)
(n : ℤ)


theorem lmul'_toLinearMap : (lmul' R : _ →ₐ[R] S).toLinearMap = LinearMap.mul' R S

{R : Type uR}
{S : Type uS}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]

(Algebra.TensorProduct.lmul' R).toLinearMap = LinearMap.mul' R S


theorem pred_last (h := Fin.ext_iff.not.2 last_pos'.ne') :
    pred (last (n + 1)) h = last n


theorem le_comap_map {β} (f : α → β) (m : OuterMeasure α) : m ≤ comap f (map f m)

{α : Type u_1}
{β : Type u_3}
(f : α → β)
(m : MeasureTheory.OuterMeasure α)

m ≤ (MeasureTheory.OuterMeasure.comap f) ((MeasureTheory.OuterMeasure.map f) m)


/--
The upper topology is the topology generated by the complements of the right-closed left-infinite
intervals.
-/
class IsUpper (α : Type*) [t : TopologicalSpace α] [Preorder α] : Prop where
  topology_eq_upperTopology : t = upper α

{α : Type u_1}
[t : TopologicalSpace α]
[Preorder α]
[self : Topology.IsUpper α]


theorem _root_.CategoryTheory.Functor.ranges_directed (F : C ⥤ Type*) (j : C) :
    Directed (· ⊇ ·) fun f : Σ'i, i ⟶ j => Set.range (F.map f.2)

(F : CategoryTheory.Functor C (Type u_1))

Directed (fun x x_1 => x ⊇ x_1) fun f => Set.range (F.map f.snd)


@[simp] theorem reverseInduction_castSucc {n : Nat} {motive : Fin (n + 1) → Sort _} {zero succ}
    (i : Fin n) : reverseInduction (motive := motive) zero succ (castSucc i) =
      succ i (reverseInduction zero succ i.succ)

{succ : (i : Fin n) → motive i.succ → motive i.castSucc}

Fin.reverseInduction zero succ i.castSucc = succ i (Fin.reverseInduction zero succ i.succ)


theorem diff_ae_eq_self : (s \ t : Set α) =ᵐ[μ] s ↔ μ (s ∩ t) = 0

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{s t : Set α}


theorem npow_mul_assoc (k m n : ℕ) (x : M) :
    (x ^ k * x ^ m) * x ^ n = x ^ k * (x ^ m * x ^ n)

{M : Type u_1}
[MulOneClass M]
[Pow M ℕ]
[NatPowAssoc M]
(k m n : ℕ)
(x : M)


/-- For any element `x` of `M ⊗[R] N`, there exists a finite subset `{ (m_i, n_i) }`
of `M × N`, such that `x` is equal to the sum of `m_i ⊗ₜ[R] n_i`. -/
theorem exists_finset (x : M ⊗[R] N) :
    ∃ S : Finset (M × N), x = S.sum fun i ↦ i.1 ⊗ₜ[R] i.2

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(x : M ⊗[R] N)


theorem lt_or_ge : ∀ a b : α, a < b ∨ a ≥ b


theorem iSup_extend_bot {e : ι → β} (he : Injective e) (f : ι → α) :
    ⨆ j, extend e f ⊥ j = ⨆ i, f i

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[CompleteLattice α]
{e : ι → β}
(he : Function.Injective e)
(f : ι → α)


theorem _root_.Finset.measure_zero (s : Finset α) (μ : Measure α) [NoAtoms μ] : μ s = 0

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


theorem IsLocalMaxOn.isLocalMax (hf : IsLocalMaxOn f s a) (hs : s ∈ 𝓝 a) : IsLocalMax f a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}
(hf : IsLocalMaxOn f s a)
(hs : s ∈ 𝓝 a)


@[csimp] theorem fold_eq_foldTR : @fold = @foldTR


theorem Monic.comp_X_sub_C (hp : p.Monic) (r : R) : (p.comp (X - C r)).Monic

{R : Type u}
[CommRing R]
[IsDomain R]
{p : R[X]}
(hp : p.Monic)
(r : R)

(p.comp (Polynomial.X - Polynomial.C r)).Monic


/-- Auxiliary definition for `grothendieckTypeToCat`, to speed up elaboration. -/
-- Porting note:
-- `simps` is incorrectly producing Prop-valued projections here,
-- so we manually specify which ones to produce.
-- See https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/!4.233204.20simps.20bug.20.28Grothendieck.20construction.29
@[simps! obj_base obj_fiber_as map_base]
def grothendieckTypeToCatInverse : G.Elements ⥤ Grothendieck (G ⋙ typeToCat)

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(G : CategoryTheory.Functor C (Type w))
(X : G.Elements)

((CategoryTheory.Grothendieck.grothendieckTypeToCatInverse G).obj X).fiber.as = X.snd


theorem tendsto_atTop' [Nonempty α] [SemilatticeSup α] {f : α → β} {l : Filter β} :
    Tendsto f atTop l ↔ ∀ s ∈ l, ∃ a, ∀ b ≥ a, f b ∈ s

{α : Type u_3}
{β : Type u_4}
[Nonempty α]
[SemilatticeSup α]
{f : α → β}
{l : Filter β}

Filter.Tendsto f Filter.atTop l ↔ ∀ s ∈ l, ∃ a, ∀ b ≥ a, f b ∈ s


@[simp]
theorem map_smul [DecidableEq ι] (m : ∀ i, M₁ i) (i : ι) (c : R) (x : M₁ i) :
    f (update m i (c • x)) = c • f (update m i x)

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

f (Function.update m i (c • x)) = c • f (Function.update m i x)


{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{ι : Type u_2}
{E : ι → Type u_3}
[(i : ι) → NormedAddCommGroup (E i)]
[(i : ι) → NormedSpace 𝕜 (E i)]
[Fintype ι]
(f : ContinuousMultilinearMap 𝕜 E F)
{n : ℕ∞}


theorem pairwise_sameCycle_formPerm (hl : Nodup l) (hn : 2 ≤ l.length) :
    Pairwise l.formPerm.SameCycle l

{α : Type u_1}
[DecidableEq α]
{l : List α}
(hl : l.Nodup)
(hn : 2 ≤ l.length)


theorem isProper_of_not_mem {I : Ideal P} {p : P} (nmem : p ∉ I) : IsProper I

{P : Type u_1}
[LE P]
{I : Order.Ideal P}
{p : P}
(nmem : p ∉ I)


/-- If a colimit is nonempty, also its index category is nonempty. -/
theorem nonempty_of_nonempty_colimit {F : J ⥤ Type u} [HasColimit F] :
    Nonempty (colimit F) → Nonempty J

{J : Type v}
[CategoryTheory.Category.{w, v} J]
{F : J ⥤ Type u}
[CategoryTheory.Limits.HasColimit F]

Nonempty (CategoryTheory.Limits.colimit F) → Nonempty J


theorem toNonUnitalSubalgebra_mk (p : Submodule R A) hmul :
    p.toNonUnitalSubalgebra hmul =
      NonUnitalSubalgebra.mk ⟨⟨⟨p, p.add_mem⟩, p.zero_mem⟩, hmul _ _⟩ p.smul_mem'

(hmul : ∀ (x y : A), x ∈ p → y ∈ p → x * y ∈ p)

p.toNonUnitalSubalgebra hmul = { carrier := ↑p, add_mem' := ⋯, zero_mem' := ⋯, mul_mem' := ⋯, smul_mem' := ⋯ }


theorem leadingCoeff_X : leadingCoeff (X : R[X]) = 1


/-- The right unitor functor `C × 1 ⥤ C` -/
@[simps]
def rightUnitor : C × Discrete (PUnit : Type w) ⥤ C

(X : C × CategoryTheory.Discrete PUnit.{w + 1})

(CategoryTheory.prod.rightUnitor C).obj X = X.1


theorem ascPochhammer_nat_eq_ascFactorial (n : ℕ) :
    ∀ k, (ascPochhammer ℕ k).eval n = n.ascFactorial k

Polynomial.eval n (ascPochhammer ℕ k) = n.ascFactorial k


@[to_additive]
theorem inv_comp_inv : Inv.inv ∘ Inv.inv = @id G


theorem chain_map_of_chain {S : β → β → Prop} (f : α → β) (H : ∀ a b : α, R a b → S (f a) (f b))
    {a : α} {l : List α} (p : Chain R a l) : Chain S (f a) (map f l)

(H : ∀ (a b : α), R a b → S (f a) (f b))


theorem isPrimal_zero : IsPrimal (0 : α)


theorem upperSemicontinuousOn_univ_iff : UpperSemicontinuousOn f univ ↔ UpperSemicontinuous f

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{f : α → β}

UpperSemicontinuousOn f Set.univ ↔ UpperSemicontinuous f


theorem extendProp (F : HomotopyWith f₀ f₁ P) (t : ℝ) : P (F.toHomotopy.extend t)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}
{P : C(X, Y) → Prop}
(F : f₀.HomotopyWith f₁ P)
(t : ℝ)


/-- A composition of natural transformations gives the composition of corresponding functors. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransComp {F₀ F₁ F₂ : C ⥤ C} (α : F₀ ⟶ F₁) (β : F₁ ⟶ F₂) :
    functorOfNatTrans (α ≫ β) ≅ functorOfNatTrans α ⋙ functorOfNatTrans β

(X : CategoryTheory.Endofunctor.Coalgebra F₀)

((CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp α β).inv.app X).f = CategoryTheory.CategoryStruct.id X.V


theorem DenseRange.mem_nhds (h : DenseRange f) (hs : s ∈ 𝓝 x) :
    ∃ a, f a ∈ s

{X : Type u_1}
[TopologicalSpace X]
{x : X}
{α : Type u_4}
{f : α → X}
{s : Set X}
(h : DenseRange f)
(hs : s ∈ 𝓝 x)


@[simp] lemma ofEpiOfIsIsoOfMono'_p : (ofEpiOfIsIsoOfMono' φ h).p = φ.τ₂ ≫ h.p

(CategoryTheory.ShortComplex.RightHomologyData.ofEpiOfIsIsoOfMono' φ h).p = CategoryTheory.CategoryStruct.comp φ.τ₂ h.p


theorem covBy_iff_lt_covBy_grade : a ⋖ b ↔ a < b ∧ grade 𝕆 a ⋖ grade 𝕆 b

{𝕆 : Type u_1}
{α : Type u_3}
[Preorder 𝕆]
[Preorder α]
[GradeOrder 𝕆 α]
{a b : α}


/-- The volume on the real line (as a particular case of the volume on a finite-dimensional
inner product space) coincides with the Stieltjes measure coming from the identity function. -/
theorem volume_eq_stieltjes_id : (volume : Measure ℝ) = StieltjesFunction.id.measure


/-- If a function `f` is twice differentiable on `ℝ`, and `f''` is nonpositive on `ℝ`,
then `f` is concave on `ℝ`. -/
theorem concaveOn_univ_of_deriv2_nonpos {f : ℝ → ℝ} (hf' : Differentiable ℝ f)
    (hf'' : Differentiable ℝ (deriv f)) (hf''_nonpos : ∀ x, deriv^[2] f x ≤ 0) :
    ConcaveOn ℝ univ f

(hf''_nonpos : ∀ (x : ℝ), deriv^[2] f x ≤ 0)


/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to `C`
and `g` tends to `atTop` then `f + g` tends to `atTop`. -/
theorem Filter.Tendsto.add_atTop {C : α} (hf : Tendsto f l (𝓝 C)) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x + g x) l atTop

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrderedAddCommGroup α]
[OrderTopology α]
{l : Filter β}
{f g : β → α}
{C : α}
(hf : Filter.Tendsto f l (𝓝 C))
(hg : Filter.Tendsto g l Filter.atTop)

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


@[to_additive]
theorem subset_interior_smul_right : s • interior t ⊆ interior (s • t)

{α : Type u}
{β : Type v}
[TopologicalSpace β]
[Group α]
[MulAction α β]
[ContinuousConstSMul α β]
{s : Set α}
{t : Set β}


@[simp]
theorem app_right_eq_ι_comp_fst (b) :
    K.π.app (WalkingMulticospan.right b) = K.ι (I.fstTo b) ≫ I.fst b

{I : CategoryTheory.Limits.MulticospanIndex C}

K.π.app (CategoryTheory.Limits.WalkingMulticospan.right b) =
  CategoryTheory.CategoryStruct.comp (K.ι (I.fstTo b)) (I.fst b)


theorem eval_section_surjective_of_surjective (i : J) :
    (fun s : F.sections => s.val i).Surjective

(Fsur : ∀ ⦃i j : J⦄ (f : i ⟶ j), Function.Surjective (F.map f))


@[to_additive]
theorem map_mul_right_eq_self (μ : Measure G) [IsMulRightInvariant μ] (g : G) : map (· * g) μ = μ

{G : Type u_2}
[MeasurableSpace G]
[Mul G]
(μ : MeasureTheory.Measure G)
[μ.IsMulRightInvariant]
(g : G)

MeasureTheory.Measure.map (fun x => x * g) μ = μ


/-- A side of a right-angled triangle divided by the cosine of the adjacent angle equals the
hypotenuse, version subtracting vectors. -/
theorem norm_div_cos_oangle_sub_left_of_oangle_eq_pi_div_two {x y : V}
    (h : o.oangle x y = ↑(π / 2)) : ‖x‖ / Real.Angle.cos (o.oangle (x - y) x) = ‖x - y‖

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

‖x‖ / (o.oangle (x - y) x).cos = ‖x - y‖


@[simp] theorem snd_pow [AddMonoid ι] [GMonoid A] (x : GradedMonoid A) (n : ℕ) :
    (x ^ n).snd = GMonoid.gnpow n x.snd

{ι : Type u_1}
(A : ι → Type u_2)
[AddMonoid ι]
[GradedMonoid.GMonoid A]
(x : GradedMonoid A)
(n : ℕ)

(x ^ n).snd = GradedMonoid.GMonoid.gnpow n x.snd


protected theorem «exists» {p : WithBot α → Prop} : (∃ x, p x) ↔ p ⊥ ∨ ∃ x : α, p x


/--
Auxiliary simp lemma for the `coherence` tactic:
this moves brackets to the left in order to expose a maximal prefix
built out of unitors and associators.
-/
-- We have unused typeclass arguments here.
-- They are intentional, to ensure that `simp only [assoc_LiftHom]` only left associates
-- monoidal structural morphisms.
@[nolint unusedArguments]
lemma assoc_liftHom {W X Y Z : C} [LiftObj W] [LiftObj X] [LiftObj Y]
    (f : W ⟶ X) (g : X ⟶ Y) (h : Y ⟶ Z) [LiftHom f] [LiftHom g] :
    f ≫ (g ≫ h) = (f ≫ g) ≫ h

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{W X Y Z : C}
[Mathlib.Tactic.Coherence.LiftObj W]
[Mathlib.Tactic.Coherence.LiftObj X]
[Mathlib.Tactic.Coherence.LiftObj Y]
(f : W ⟶ X)
(g : X ⟶ Y)
(h : Y ⟶ Z)
[Mathlib.Tactic.Coherence.LiftHom f]
[Mathlib.Tactic.Coherence.LiftHom g]


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

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


lemma univ_shatters [Fintype α] : univ.Shatters s

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


lemma isEquivalent_deriv_rpow_p_mul_one_add_smoothingFn {p : ℝ} (hp : p ≠ 0) :
    deriv (fun z => z ^ p * (1 + ε z)) ~[atTop] fun z => p * z ^ (p-1)

(deriv fun z => z ^ p * (1 + AkraBazziRecurrence.smoothingFn z)) ~[Filter.atTop] fun z => p * z ^ (p - 1)


@[simp]
theorem symm_symm (e : M ≃ₛₗ[σ] M₂) : e.symm.symm = e

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_S_M₂ : Module S M₂}
{σ : R →+* S}
{σ' : S →+* R}
{re₁ : RingHomInvPair σ σ'}
{re₂ : RingHomInvPair σ' σ}
(e : M ≃ₛₗ[σ] M₂)


theorem _root_.LinearEquiv.annihilator_eq (e : M ≃ₗ[R] M') :
    Module.annihilator R M = Module.annihilator R M'

{R : Type u}
{M : Type v}
{M' : Type u_1}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M']
[Module R M']
(e : M ≃ₗ[R] M')


@[simp] lemma forget_map {X Y : Grp} (f : X ⟶ Y) : (forget Grp).map f = (f : X → Y)


theorem span_map_id {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) (w : WalkingSpan) :
    (span f g).map (WalkingSpan.Hom.id w) = 𝟙 _

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

(CategoryTheory.Limits.span f g).map (CategoryTheory.Limits.WalkingSpan.Hom.id w) =
  𝟙 ((CategoryTheory.Limits.span f g).obj w)


/-- The Radon-Nikodym derivative of a sigma-finite measure `μ` with respect to another
measure `ν` is `ν`-almost everywhere finite. -/
theorem rnDeriv_lt_top (μ ν : Measure α) [SigmaFinite μ] : ∀ᵐ x ∂ν, μ.rnDeriv ν x < ∞

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


@[simp]
lemma disjoint_singleton_right : Disjoint s {a} ↔ a ∉ s


theorem iterateFrobenius_one_apply : iterateFrobenius R p 1 x = x ^ p

(R : Type u)
[CommSemiring R]
(p : ℕ)
[ExpChar R p]
(x : R)


@[simp]
theorem spanCompIso_inv_app_zero : (spanCompIso F f g).inv.app WalkingSpan.zero = 𝟙 _

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

(CategoryTheory.Limits.spanCompIso F f g).inv.app CategoryTheory.Limits.WalkingSpan.zero =
  𝟙 ((CategoryTheory.Limits.span (F.map f) (F.map g)).obj CategoryTheory.Limits.WalkingSpan.zero)


theorem pure_injective : Injective (pure : α → Interval α)


theorem convexHull_toCone_eq_sInf (s : Set E) :
    (convex_convexHull 𝕜 s).toCone _ = sInf { t : ConvexCone 𝕜 E | s ⊆ t }

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(s : Set E)

Convex.toCone ((convexHull 𝕜) s) ⋯ = sInf {t | s ⊆ ↑t}


@[simp]
theorem rightUnitor_inv_apply {X : Type u} {x : X} :
    ((ρ_ X).inv : X ⟶ X ⊗ 𝟙_ (Type u)) x = (x, PUnit.unit)


theorem isSubring_image {R : Type u} {S : Type v} [Ring R] [Ring S] (f : R →+* S) {s : Set R}
    (hs : IsSubring s) : IsSubring (f '' s)


@[simp]
theorem leftInverse_trunc_toLaurent :
    Function.LeftInverse (trunc : R[T;T⁻¹] → R[X]) Polynomial.toLaurent


@[simp]
theorem coeff_monomial_mul (m) (s : σ →₀ ℕ) (r : R) (p : MvPolynomial σ R) :
    coeff (s + m) (monomial s r * p) = r * coeff m p

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

MvPolynomial.coeff (s + m) ((MvPolynomial.monomial s) r * p) = r * MvPolynomial.coeff m p


lemma edge_adj (v w : V) : (edge s t).Adj v w ↔ (v = s ∧ w = t ∨ v = t ∧ w = s) ∧ v ≠ w

(SimpleGraph.edge s t).Adj v w ↔ (v = s ∧ w = t ∨ v = t ∧ w = s) ∧ v ≠ w


theorem Base.diff_infinite_comm (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) :
    (B₁ \ B₂).Infinite ↔ (B₂ \ B₁).Infinite

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


/-- For an index `i : Fin n`, the nth element of `scanl` of a
vector `v : Vector α n` at `i.succ`, is equal to the application
function `f : β → α → β` of the `castSucc i` element of
`scanl f b v` and `get v i`.

This lemma is the `get` version of `scanl_cons`.
-/
@[simp]
theorem scanl_get (i : Fin n) :
    (scanl f b v).get i.succ = f ((scanl f b v).get (Fin.castSucc i)) (v.get i)

{n : ℕ}
{α : Type u_1}
{β : Type u_2}
(f : β → α → β)
(b : β)
(v : Mathlib.Vector α n)
(i : Fin n)

(Mathlib.Vector.scanl f b v).get i.succ = f ((Mathlib.Vector.scanl f b v).get i.castSucc) (v.get i)


theorem mem_mk_iff (S : Set M) (h₁ h₂ h₃ h₄) {x : M} :
    x ∈ (⟨⟨⟨⟨S, h₁⟩, h₂⟩, h₃⟩, h₄⟩ : LieSubmodule R L M) ↔ x ∈ S

(h₁ : ∀ {a b : M}, a ∈ S → b ∈ S → a + b ∈ S)

(h₃ :
  ∀ (c : R) {x : M},
    x ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂ }.carrier →
      c • x ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂ }.carrier)

(h₄ :
  ∀ {x : L} {m : M},
    m ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂, smul_mem' := h₃ }.carrier →
      ⁅x, m⁆ ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂, smul_mem' := h₃ }.carrier)

x ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂, smul_mem' := h₃, lie_mem := h₄ } ↔ x ∈ S


@[simp]
theorem succPNat_le_succPNat {m n : ℕ} : m.succPNat ≤ n.succPNat ↔ m ≤ n


theorem atom_pf' (p : (a : R) = a') :
    a = a' ^ (nat_lit 1).rawCast * (nat_lit 1).rawCast + 0

{R : Type u_1}
[CommSemiring R]
{a a' : R}
(p : a = a')

a = a' ^ Nat.rawCast 1 * Nat.rawCast 1 + 0


@[to_additive (attr := simp)]
theorem mrange_lift (f : M →* P) (g : N →* P) :
    MonoidHom.mrange (lift f g) = MonoidHom.mrange f ⊔ MonoidHom.mrange g

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass N]
[AddMonoid P]
(f : M →+ P)
(g : N →+ P)

AddMonoidHom.mrange (AddMonoid.Coprod.lift f g) = AddMonoidHom.mrange f ⊔ AddMonoidHom.mrange g


theorem CompactSpace.tendsto_subseq [CompactSpace X] (x : ℕ → X) :
    ∃ (a : _) (φ : ℕ → ℕ), StrictMono φ ∧ Tendsto (x ∘ φ) atTop (𝓝 a)

{X : Type u_1}
[TopologicalSpace X]
[FirstCountableTopology X]
[CompactSpace X]
(x : ℕ → X)

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


theorem lift_rank_add_lift_rank_le_rank_prod [Nontrivial R] :
    lift.{v'} (Module.rank R M) + lift.{v} (Module.rank R M') ≤ Module.rank R (M × M')

(R : Type u)
(M : Type v)
(M' : Type v')
[Ring R]
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
[Nontrivial R]

Cardinal.lift.{v', v} (Module.rank R M) + Cardinal.lift.{v, v'} (Module.rank R M') ≤ Module.rank R (M × M')


theorem factors_self {X : C} (P : Subobject X) : P.Factors P.arrow

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


theorem smul_add (a : M) (b₁ b₂ : A) : a • (b₁ + b₂) = a • b₁ + a • b₂

{M : Type u_1}
{A : Type u_4}
[AddZeroClass A]
[DistribSMul M A]
(a : M)
(b₁ b₂ : A)


theorem rpow_def (x y : ℝ) : x ^ y = ((x : ℂ) ^ (y : ℂ)).re


lemma comp_ofComplex (f : ℍ → ℂ) (z : ℍ) : (↑ₕ f) z = f z

(f ∘ ↑UpperHalfPlane.ofComplex) ↑z = f z


theorem transferTransversal_apply'' (q : orbitRel.Quotient (zpowers g) (G ⧸ H))
    (k : ZMod (minimalPeriod (g • ·) q.out')) :
    ↑(toEquiv (g • transferTransversal H g).2 (g ^ (cast k : ℤ) • q.out')) =
      if k = 0 then g ^ minimalPeriod (g • ·) q.out' * q.out'.out'
      else g ^ (cast k : ℤ) * q.out'.out'

(q : MulAction.orbitRel.Quotient (↥(Subgroup.zpowers g)) (G ⧸ H))

(k : ZMod (Function.minimalPeriod (fun x => g • x) (Quotient.out' q)))

↑((Subgroup.MemLeftTransversals.toEquiv ⋯) (g ^ k.cast • Quotient.out' q)) =
  if k = 0 then g ^ Function.minimalPeriod (fun x => g • x) (Quotient.out' q) * Quotient.out' (Quotient.out' q)
  else g ^ k.cast * Quotient.out' (Quotient.out' q)


@[simp]
theorem permutationsAux2_snd_nil (t : α) (ts : List α) (r : List β) (f : List α → β) :
    (permutationsAux2 t ts r [] f).2 = r

{α : Type u_1}
{β : Type u_2}
(t : α)
(ts : List α)
(r : List β)
(f : List α → β)

(List.permutationsAux2 t ts r [] f).2 = r


lemma Functor.map_comp_assoc {C : Type u₁} [Category C] {D : Type u₂} [Category D] (F : C ⥤ D)
    {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) {W : D} (h : F.obj Z ⟶ W) :
    (F.map (f ≫ g)) ≫ h = F.map f ≫ F.map g ≫ h

{C : Type u₁}
[CategoryTheory.Category.{u_1, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{u_2, u₂} D]
(F : CategoryTheory.Functor C D)
{X Y Z : C}
(f : X ⟶ Y)
(g : Y ⟶ Z)
{W : D}
(h : F.obj Z ⟶ W)

CategoryTheory.CategoryStruct.comp (F.map (CategoryTheory.CategoryStruct.comp f g)) h =
  CategoryTheory.CategoryStruct.comp (F.map f) (CategoryTheory.CategoryStruct.comp (F.map g) h)


theorem isTheta_ofReal (f : α → ℝ) (l : Filter α) : (f · : α → ℂ) =Θ[l] f

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


@[congr]
theorem map_congr {f g : α → β} {s t : Multiset α} :
    s = t → (∀ x ∈ t, f x = g x) → map f s = map g t

{α : Type u_1}
{β : Type v}
{f g : α → β}
{s t : Multiset α}

s = t → (∀ x ∈ t, f x = g x) → Multiset.map f s = Multiset.map g t


@[simp] theorem dropLast_cons_self_replicate (n) (a : α) :
    dropLast (a :: replicate n a) = replicate n a

(a :: List.replicate n a).dropLast = List.replicate n a


theorem mul_inv_lt_of_lt_mul₀ (h : a < b * c) : a * c⁻¹ < b

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a b c : α}
(h : a < b * c)


theorem cons_ne_zero_of_right (h : s ≠ 0) : cons y s ≠ 0

{n : ℕ}
{M : Type u_1}
[Zero M]
{y : M}
{s : Fin n →₀ M}
(h : s ≠ 0)


theorem coe_inj ⦃s t : Cₛ^n⟮I; F, V⟯⦄ (h : (s : ∀ x, V x) = t) : s = t

[TopologicalSpace (Bundle.TotalSpace F V)]


@[reassoc (attr := simp)]
lemma ι_mapBifunctorLeftUnitor_hom_apply (j : J) :
    ιMapBifunctorMapObj F p ((single₀ I).obj X) Y 0 j j (hp j) ≫
      (mapBifunctorLeftUnitor F X e p hp Y).hom j =
      (F.map (singleObjApplyIso (0 : I) X).hom).app _ ≫ e.hom.app (Y j)

(F : CategoryTheory.Functor C (CategoryTheory.Functor D D))

(e : F.obj X ≅ CategoryTheory.Functor.id D)

[(Y : D) → CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C) (F.flip.obj Y)]

[(((CategoryTheory.GradedObject.mapBifunctor F I J).obj ((CategoryTheory.GradedObject.single₀ I).obj X)).obj Y).HasMap
    p]

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.GradedObject.ιMapBifunctorMapObj F p ((CategoryTheory.GradedObject.single₀ I).obj X) Y 0 j j ⋯)
    ((CategoryTheory.GradedObject.mapBifunctorLeftUnitor F X e p hp Y).hom j) =
  CategoryTheory.CategoryStruct.comp ((F.map (CategoryTheory.GradedObject.singleObjApplyIso 0 X).hom).app (Y j))
    (e.hom.app (Y j))


theorem dual_node4L (l : Ordnode α) (x : α) (m : Ordnode α) (y : α) (r : Ordnode α) :
    dual (node4L l x m y r) = node4R (dual r) y (dual m) x (dual l)

{α : Type u_1}
(l : Ordnode α)
(x : α)
(m : Ordnode α)
(y : α)
(r : Ordnode α)

(l.node4L x m y r).dual = r.dual.node4R y m.dual x l.dual


theorem join_eq_bind (μ : Measure (Measure α)) : join μ = bind μ id

(μ : MeasureTheory.Measure (MeasureTheory.Measure α))


private lemma ite_ne_zero_of_pos_of_ne_zero [Preorder α] (ha : 0 < a) (hb : b ≠ 0) :
    ite p a b ≠ 0

{α : Type u_1}
[Zero α]
(p : Prop)
[Decidable p]
{a b : α}
[Preorder α]
(ha : 0 < a)
(hb : b ≠ 0)


theorem finMeasSupp_iff : f.FinMeasSupp μ ↔ ∀ y, y ≠ 0 → μ (f ⁻¹' {y}) < ∞

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
[Zero β]
{μ : MeasureTheory.Measure α}
{f : MeasureTheory.SimpleFunc α β}

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


theorem eqOn_comp_right_iff : s.EqOn (g₁ ∘ f) (g₂ ∘ f) ↔ (f '' s).EqOn g₁ g₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
{f : α → β}
{g₁ g₂ : β → γ}

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


theorem option_bind {f : α → Option β} {g : α → β → Option σ} (hf : Primrec f) (hg : Primrec₂ g) :
    Primrec fun a => (f a).bind (g a)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_5}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → Option β}
{g : α → β → Option σ}
(hf : Primrec f)
(hg : Primrec₂ g)


theorem aroots_C_mul_X_pow [CommRing S] [IsDomain S] [Algebra T S]
    [NoZeroSMulDivisors T S] {a : T} (ha : a ≠ 0) (n : ℕ) :
    (C a * X ^ n : T[X]).aroots S = n • ({0} : Multiset S)

{S : Type v}
{T : Type w}
[CommRing T]
[CommRing S]
[IsDomain S]
[Algebra T S]
[NoZeroSMulDivisors T S]
{a : T}
(ha : a ≠ 0)
(n : ℕ)

(Polynomial.C a * Polynomial.X ^ n).aroots S = n • {0}


@[to_additive prod_mk_sum]
theorem prod_mk_prod {α β γ : Type*} [CommMonoid α] [CommMonoid β] (s : Finset γ) (f : γ → α)
    (g : γ → β) : (∏ x ∈ s, f x, ∏ x ∈ s, g x) = ∏ x ∈ s, (f x, g x)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[CommMonoid β]
(s : Finset γ)
(f : γ → α)
(g : γ → β)


theorem frontier_subset_closure : frontier s ⊆ closure s

{X : Type u}
{s : Set X}
[TopologicalSpace X]


nonrec theorem star_mul_eq_coe : star a * a = (star a * a).re


@[simp]
theorem factorThru_mk_self (f : X ⟶ Y) [Mono f] :
    (mk f).factorThru f (mk_factors_self f) = (underlyingIso f).inv

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

(CategoryTheory.Subobject.mk f).factorThru f ⋯ = (CategoryTheory.Subobject.underlyingIso f).inv


/-- This lemma is useful in the manifold library in the case that `e` is a chart. It states that
  locally around `e x` the set `e.symm ⁻¹' s` is the same as the set intersected with the target
  of `e` and some other neighborhood of `f x` (which will be the source of a chart on `Z`).  -/
theorem preimage_eventuallyEq_target_inter_preimage_inter {e : PartialHomeomorph X Y} {s : Set X}
    {t : Set Z} {x : X} {f : X → Z} (hf : ContinuousWithinAt f s x) (hxe : x ∈ e.source)
    (ht : t ∈ 𝓝 (f x)) :
    e.symm ⁻¹' s =ᶠ[𝓝 (e x)] (e.target ∩ e.symm ⁻¹' (s ∩ f ⁻¹' t) : Set Y)

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{e : PartialHomeomorph X Y}
{s : Set X}
{t : Set Z}
{x : X}
{f : X → Z}
(hf : ContinuousWithinAt f s x)
(hxe : x ∈ e.source)
(ht : t ∈ 𝓝 (f x))

↑e.symm ⁻¹' s =ᶠ[𝓝 (↑e x)] e.target ∩ ↑e.symm ⁻¹' (s ∩ f ⁻¹' t)


@[simp]
theorem op_sum (X Y : C) {ι : Type*} (s : Finset ι) (f : ι → (X ⟶ Y)) :
    (s.sum f).op = s.sum fun i => (f i).op

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
(X Y : C)
{ι : Type u_2}
(s : Finset ι)
(f : ι → (X ⟶ Y))


@[simp]
theorem map_bot (f : R →+* S) : (⊥ : Subsemiring R).map f = ⊥

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
(f : R →+* S)


@[simp]
theorem preimage_inl_image_inr (s : Set β) : Sum.inl ⁻¹' (@Sum.inr α β '' s) = ∅

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


theorem drop : ∀ {s}, Valid s → ∀ n, Valid (s.drop n)


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

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


theorem mem_cocompact_iff_closedBall_compl_subset [ProperSpace α] (c : α) :
    s ∈ cocompact α ↔ ∃ r, (closedBall c r)ᶜ ⊆ s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
[ProperSpace α]
(c : α)

s ∈ Filter.cocompact α ↔ ∃ r, (Metric.closedBall c r)ᶜ ⊆ s


theorem injective_of_adjoint (adj : L ⊣ R) (J : D) [Injective J] : Injective <| R.obj J

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : C ⥤ D}
{R : D ⥤ C}
[L.PreservesMonomorphisms]
(adj : L ⊣ R)
(J : D)
[CategoryTheory.Injective J]


/-- Mapping an equivalence `α ≃ β` using `Sym.map` gives an equivalence between `Sym α n` and
`Sym β n`. -/
@[simps]
def equivCongr (e : α ≃ β) : Sym α n ≃ Sym β n

{α : Type u_1}
{β : Type u_2}
{n : ℕ}
(e : α ≃ β)
(x : Sym α n)


@[to_additive]
theorem smulAntidiagonal_mono_right {a : P} {hs : s.IsPWO} {ht : t.IsPWO} (h : v ⊆ t) :
    SMulAntidiagonal hs hv a ⊆ SMulAntidiagonal hs ht a

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

Finset.SMulAntidiagonal hs hv a ⊆ Finset.SMulAntidiagonal hs ht a


theorem zorn_nonempty_Ici₀ (a : α)
    (ih : ∀ c ⊆ Ici a, IsChain (· ≤ ·) c → ∀ y ∈ c, ∃ ub, ∀ z ∈ c, z ≤ ub)
    (x : α) (hax : a ≤ x) : ∃ m, x ≤ m ∧ ∀ z, m ≤ z → z ≤ m

(ih : ∀ c ⊆ Set.Ici a, IsChain (fun x x_1 => x ≤ x_1) c → ∀ y ∈ c, ∃ ub, ∀ z ∈ c, z ≤ ub)


/-- The fundamental property of the operator norm: `‖f x‖ ≤ ‖f‖ * ‖x‖`. -/
theorem le_opNorm (x : V₁) : ‖f x‖ ≤ ‖f‖ * ‖x‖

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f : NormedAddGroupHom V₁ V₂)
(x : V₁)

‖f x‖ ≤ ‖f‖ * ‖x‖


theorem nontrivial_of_nontrivial (hs : s.Nontrivial) : Nontrivial α

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


@[simp]
theorem smul_rayOfNeZero (g : G) (v : M) (hv) :
    g • rayOfNeZero R v hv = rayOfNeZero R (g • v) ((smul_ne_zero_iff_ne _).2 hv)

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{G : Type u_5}
[Group G]
[DistribMulAction G M]
[SMulCommClass R G M]
(g : G)
(v : M)
(hv : v ≠ 0)

g • rayOfNeZero R v hv = rayOfNeZero R (g • v) ⋯


theorem map_smul_of_tower {R S : Type*} [CommSemiring S] [SMul R A] [Algebra S A] [SMul R B]
    [Algebra S B] [MulActionHomClass (A →A[S] B) R A B] (f : A →A[S] B) (c : R) (x : A) :
    f (c • x) = c • f x

{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
{R : Type u_4}
{S : Type u_5}
[CommSemiring S]
[SMul R A]
[Algebra S A]
[SMul R B]
[Algebra S B]
[MulActionHomClass (A →A[S] B) R A B]
(f : A →A[S] B)
(c : R)
(x : A)


@[simp]
theorem mk_inr {W : C} (inl : Y ⟶ W) (inr : Z ⟶ W) (eq : f ≫ inl = g ≫ inr) :
    (mk inl inr eq).inr = inr

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : C}
{f : X ⟶ Y}
{g : X ⟶ Z}
{W : C}
(inl : Y ⟶ W)
(inr : Z ⟶ W)
(eq : f ≫ inl = g ≫ inr)

(CategoryTheory.Limits.PushoutCocone.mk inl inr eq).inr = inr


/-- When `S₁.f`, `S₁.g`, `S₂.f` and `S₂.g` are all zero, the action on homology of a
morphism `φ : S₁ ⟶ S₂` is given by the action `φ.τ₂` on the middle objects. -/
@[simps]
def ofZeros (φ : S₁ ⟶ S₂) (hf₁ : S₁.f = 0) (hg₁ : S₁.g = 0) (hf₂ : S₂.f = 0) (hg₂ : S₂.g = 0) :
    HomologyMapData φ (HomologyData.ofZeros S₁ hf₁ hg₁) (HomologyData.ofZeros S₂ hf₂ hg₂)

(CategoryTheory.ShortComplex.HomologyMapData.ofZeros φ hf₁ hg₁ hf₂ hg₂).right =
  CategoryTheory.ShortComplex.RightHomologyMapData.ofZeros φ hf₁ hg₁ hf₂ hg₂


/-- Bounding the Hausdorff edistance by exhibiting, for any point in each set,
another point in the other set at controlled distance -/
theorem hausdorffEdist_le_of_mem_edist {r : ℝ≥0∞} (H1 : ∀ x ∈ s, ∃ y ∈ t, edist x y ≤ r)
    (H2 : ∀ x ∈ t, ∃ y ∈ s, edist x y ≤ r) : hausdorffEdist s t ≤ r

{α : Type u}
[PseudoEMetricSpace α]
{s t : Set α}
{r : ℝ≥0∞}
(H1 : ∀ x ∈ s, ∃ y ∈ t, edist x y ≤ r)
(H2 : ∀ x ∈ t, ∃ y ∈ s, edist x y ≤ r)


theorem algebraMap_fst (k : 𝕜) : (algebraMap 𝕜 𝓜(𝕜, A) k).fst = algebraMap 𝕜 _ k

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(k : 𝕜)

((algebraMap 𝕜 𝓜(𝕜, A)) k).toProd.1 = (algebraMap 𝕜 (A →L[𝕜] A)) k


lemma cfc_smul_id {S : Type*} [SMul S R] [ContinuousConstSMul S R]
    [SMulZeroClass S A] [IsScalarTower S R A] [IsScalarTower S R (R → R)]
    (s : S) (a : A) (ha : p a := by cfc_tac) : cfc (s • · : R → R) a = s • a

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
{S : Type u_3}
[SMul S R]
[ContinuousConstSMul S R]
[SMulZeroClass S A]
[IsScalarTower S R A]
[IsScalarTower S R (R → R)]
(s : S)
(a : A)
(ha : p a := by cfc_tac)


theorem CovBy.nhdsWithin_Iio (h : a ⋖ b) : 𝓝[<] b = ⊥

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a b : α}
(h : a ⋖ b)


protected theorem StrictAnti.ite (hf : StrictAnti f) (hg : StrictAnti g) {p : α → Prop}
    [DecidablePred p] (hp : ∀ ⦃x y⦄, x < y → p y → p x) (hfg : ∀ x, g x ≤ f x) :
    StrictAnti fun x ↦ if p x then f x else g x

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f g : α → β}
(hf : StrictAnti f)
(hg : StrictAnti g)
{p : α → Prop}
[DecidablePred p]
(hp : ∀ ⦃x y : α⦄, x < y → p y → p x)
(hfg : ∀ (x : α), g x ≤ f x)

StrictAnti fun x => if p x then f x else g x


@[fun_prop]
theorem DifferentiableWithinAt.inverse (hf : DifferentiableWithinAt 𝕜 h S z) (hz : IsUnit (h z)) :
    DifferentiableWithinAt 𝕜 (fun x => Ring.inverse (h x)) S z

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{R : Type u_6}
[NormedRing R]
[NormedAlgebra 𝕜 R]
[CompleteSpace R]
{h : E → R}
{z : E}
{S : Set E}
(hf : DifferentiableWithinAt 𝕜 h S z)
(hz : IsUnit (h z))


protected theorem symm (h : IdentDistrib f g μ ν) : IdentDistrib g f ν μ

(h : ProbabilityTheory.IdentDistrib f g μ ν)


theorem PreconnectedSpace.trivial_of_discrete [PreconnectedSpace X] [DiscreteTopology X] :
    Subsingleton X

{X : Type u_1}
[TopologicalSpace X]
[PreconnectedSpace X]
[DiscreteTopology X]


theorem map_add : ∀ x y, v (x + y) ≤ max (v x) (v y)

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)
(x y : R)


@[reassoc (attr := simp)]
theorem QInfty_idem : (QInfty : K[X] ⟶ _) ≫ QInfty = QInfty

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

AlgebraicTopology.DoldKan.QInfty ≫ AlgebraicTopology.DoldKan.QInfty = AlgebraicTopology.DoldKan.QInfty


theorem isBigO_iff_div_isBoundedUnder {α : Type*} {l : Filter α} {f g : α → 𝕜}
    (hgf : ∀ᶠ x in l, g x = 0 → f x = 0) :
    f =O[l] g ↔ IsBoundedUnder (· ≤ ·) l fun x => ‖f x / g x‖

(hgf : ∀ᶠ (x : α) in l, g x = 0 → f x = 0)

f =O[l] g ↔ Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l fun x => ‖f x / g x‖


/-- When the group in question is the automorphisms, `•` coincides with `Basis.map`. -/
@[simp]
theorem smul_eq_map (g : M ≃ₗ[R] M) (b : Basis ι R M) : g • b = b.map g

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


/-- The Fourier coefficients of a function on `AddCircle T` can be computed as an integral
over `[a, a + T]`, for any real `a`. -/
theorem fourierCoeff_eq_intervalIntegral (f : AddCircle T → E) (n : ℤ) (a : ℝ) :
    fourierCoeff f n = (1 / T) • ∫ x in a..a + T, @fourier T (-n) x • f x

{T : ℝ}
[hT : Fact (0 < T)]
{E : Type}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(f : AddCircle T → E)
(n : ℤ)
(a : ℝ)

fourierCoeff f n = (1 / T) • ∫ (x : ℝ) in a..a + T, (fourier (-n)) ↑x • f ↑x


theorem mk_surjective : Function.Surjective (@ConjClasses.mk α _)


@[to_additive]
theorem isUnit_of_mul_isUnit_right [CommMonoid M] {x y : M} (hu : IsUnit (x * y)) : IsUnit y

{M : Type u_1}
[CommMonoid M]
{x y : M}
(hu : IsUnit (x * y))


theorem mk_out' (a : α) : @Setoid.r α s₁ (Quotient.mk'' a : Quotient s₁).out' a


theorem Independent.injOn (ht : Independent t) : InjOn t {i | t i ≠ ⊥}

{α : Type u_1}
{ι : Type u_3}
[CompleteLattice α]
{t : ι → α}
(ht : CompleteLattice.Independent t)


/--
The comap of the identity is the identity. In this variant of the lemma, two open subsets `U` and
`V` are given as arguments, together with a proof that `U = V`. This is useful when `U` and `V`
are not definitionally equal.
-/
theorem comap_id {U V : Opens (PrimeSpectrum.Top R)} (hUV : U = V) :
    (comap (RingHom.id R) U V fun p hpV => by rwa [hUV, PrimeSpectrum.comap_id]) =
      eqToHom (show (structureSheaf R).1.obj (op U) = _ by rw [hUV])

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

AlgebraicGeometry.StructureSheaf.comap (RingHom.id R) U V ⋯ = CategoryTheory.eqToHom ⋯


theorem convexBodySumFactor_ne_zero : convexBodySumFactor K ≠ 0

(K : Type u_1)
[Field K]
[NumberField K]

NumberField.mixedEmbedding.convexBodySumFactor K ≠ 0


theorem contMDiffOn_symm_coordChangeL :
    ContMDiffOn IB 𝓘(𝕜, F →L[𝕜] F) n (fun b : B => ((e.coordChangeL 𝕜 e' b).symm : F →L[𝕜] F))
      (e.baseSet ∩ e'.baseSet)

[TopologicalSpace (Bundle.TotalSpace F E)]

(e e' : Trivialization F Bundle.TotalSpace.proj)

ContMDiffOn IB 𝓘(𝕜, F →L[𝕜] F) n (fun b => ↑(Trivialization.coordChangeL 𝕜 e e' b).symm) (e.baseSet ∩ e'.baseSet)


theorem MDifferentiable.continuous (h : MDifferentiable I I' f) : Continuous f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
(h : MDifferentiable I I' f)


theorem sup_sup : s.sup (f ⊔ g) = s.sup f ⊔ s.sup g

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
{s : Finset β}
{f g : β → α}


@[simp]
lemma toEquiv_inj {e₁ e₂ : G ≃+c[a, b] H} : e₁.toEquiv = e₂.toEquiv ↔ e₁ = e₂

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
{e₁ e₂ : G ≃+c[a, b] H}


theorem prime_def_minFac {p : ℕ} : Prime p ↔ 2 ≤ p ∧ minFac p = p


lemma addZ_self {P : Fin 3 → R} : addZ P P = 0

{R : Type u}
[CommRing R]
{P : Fin 3 → R}


lemma integrable_stieltjesOfMeasurableRat [IsFiniteKernel κ] (hf : IsRatCondKernelCDF f κ ν)
    (a : α) (x : ℝ) :
    Integrable (fun b ↦ stieltjesOfMeasurableRat f hf.measurable (a, b) x) (ν a)

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDF f κ ν)

MeasureTheory.Integrable (fun b => ↑(ProbabilityTheory.stieltjesOfMeasurableRat f ⋯ (a, b)) x) (ν a)


protected theorem le_add_mul {f : α → ℝ} {K : ℝ≥0} (h : LipschitzWith K f) (x y) :
    f x ≤ f y + K * dist x y

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


theorem IntegralClosure.isMaximal_of_isMaximal_comap (I : Ideal (integralClosure R S)) [I.IsPrime]
    (hI : IsMaximal (I.comap (algebraMap R (integralClosure R S)))) : IsMaximal I

(hI : (Ideal.comap (algebraMap R ↥(integralClosure R S)) I).IsMaximal)


@[to_additive (attr := simp)] lemma zpow_right (h : SemiconjBy a x y) :
    ∀ m : ℤ, SemiconjBy a (x ^ m) (y ^ m)

{G : Type u_1}
[AddGroup G]
{a x y : G}
(h : AddSemiconjBy a x y)
(m : ℤ)


theorem measure_add_diff (hs : MeasurableSet s) (t : Set α) : μ s + μ (t \ s) = μ (s ∪ t)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : MeasurableSet s)
(t : Set α)


@[norm_cast] lemma coe_natCast (n : ℕ) : ((n : α) : WithBot α) = n

{α : Type u}
[AddMonoidWithOne α]
(n : ℕ)


theorem iInf_sets_eq {f : ι → Filter α} (h : Directed (· ≥ ·) f) [ne : Nonempty ι] :
    (iInf f).sets = ⋃ i, (f i).sets

{α : Type u}
{ι : Sort x}
{f : ι → Filter α}
(h : Directed (fun x x_1 => x ≥ x_1) f)
[ne : Nonempty ι]


protected theorem ext_iff {p q : FormalMultilinearSeries 𝕜 E F} : p = q ↔ ∀ n, p n = q n

{𝕜 : Type u}
{E : Type v}
{F : Type w}
[Ring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
{p q : FormalMultilinearSeries 𝕜 E F}


lemma isSeparable_pi {ι : Type*} [Countable ι] {α : ι → Type*} {s : ∀ i, Set (α i)}
    [∀ i, TopologicalSpace (α i)] (h : ∀ i, IsSeparable (s i)) :
    IsSeparable {f : ∀ i, α i | ∀ i, f i ∈ s i}

(h : ∀ (i : ι), TopologicalSpace.IsSeparable (s i))

TopologicalSpace.IsSeparable {f | ∀ (i : ι), f i ∈ s i}


theorem ofLex_inj {a b : Lex α} : ofLex a = ofLex b ↔ a = b


/-- This structure contains the data of two right fractions for
`W : MorphismProperty C` that have the same "denominator". -/
structure RightFraction₂ (X Y : C) where
  /-- the auxiliary object of right fractions -/
  {X' : C}
  /-- the denominator of the right fractions -/
  s : X' ⟶ X
  /-- the condition that the denominator belongs to the given morphism property -/
  hs : W s
  /-- the numerator of the first right fraction -/
  f : X' ⟶ Y
  /-- the numerator of the second right fraction -/
  f' : X' ⟶ Y

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
{X Y : C}
(self : W.RightFraction₂ X Y)


@[simp]
theorem Dart.symm_symm (d : G.Dart) : d.symm.symm = d

{V : Type u_1}
{G : SimpleGraph V}
(d : G.Dart)


@[simp]
theorem mem_inf (x : L) : x ∈ K ⊓ K' ↔ x ∈ K ∧ x ∈ K'

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


theorem lmarginal_image [DecidableEq δ'] {e : δ' → δ} (he : Injective e) (s : Finset δ')
    {f : (∀ i, π (e i)) → ℝ≥0∞} (hf : Measurable f) (x : ∀ i, π i) :
      (∫⋯∫⁻_s.image e, f ∘ (· ∘' e) ∂μ) x = (∫⋯∫⁻_s, f ∂μ ∘' e) (x ∘' e)

{μ : (i : δ) → MeasureTheory.Measure (π i)}

[∀ (i : δ), MeasureTheory.SigmaFinite (μ i)]

(∫⋯∫⁻_Finset.image e s, f ∘ fun x => (fun {x_1} => x) ∘' e ∂μ) x =
  (∫⋯∫⁻_s, f ∂(fun {x} => μ) ∘' e) ((fun {x_1} => x) ∘' e)


@[simp]
theorem coe_sigma (l₁ : List α) (l₂ : ∀ a, List (σ a)) :
    (@Multiset.sigma α σ l₁ fun a => l₂ a) = l₁.sigma l₂

{α : Type u_1}
{σ : α → Type u_4}
(l₁ : List α)
(l₂ : (a : α) → List (σ a))

((↑l₁).sigma fun a => ↑(l₂ a)) = ↑(l₁.sigma l₂)


theorem isClopen_setOf_rel (x : X) : IsClopen (setOf (S.Rel x))

{X : Type u_2}
[TopologicalSpace X]
(S : DiscreteQuotient X)
(x : X)


/-- A set `s` is `(invariants f)`-measurable
iff it is meaurable w.r.t. the canonical σ-algebra on `α` and `f ⁻¹' s = s`. -/
theorem measurableSet_invariants {f : α → α} {s : Set α} :
    MeasurableSet[invariants f] s ↔ MeasurableSet s ∧ f ⁻¹' s = s

{α : Type u_1}
[MeasurableSpace α]
{f : α → α}
{s : Set α}

MeasurableSet s ↔ MeasurableSet s ∧ f ⁻¹' s = s


theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2

(2 • θ).sign = θ.sign ↔ θ = ↑π ∨ |θ.toReal| < π / 2


protected theorem sub_right_cancel' (c : α) : a - c ≡ b - c [PMOD p] → a ≡ b [PMOD p]

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


@[simp]
theorem get_succ_cons (n : ℕ) (s : Stream' α) (x : α) : get (x::s) n.succ = get s n

{α : Type u}
(n : ℕ)
(s : Stream' α)
(x : α)


theorem Antiperiodic.const_smul [AddMonoid α] [Neg β] [Group γ] [DistribMulAction γ α]
    (h : Antiperiodic f c) (a : γ) : Antiperiodic (fun x => f (a • x)) (a⁻¹ • c)

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

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


/-- `liminf (c + xᵢ) = c + limsup xᵢ`. -/
lemma liminf_const_add (F : Filter ι) [NeBot F] [Add R] [ContinuousAdd R]
    [CovariantClass R R (fun x y ↦ x + y) fun x y ↦ x ≤ y]  (f : ι → R) (c : R)
    (cobdd : F.IsCoboundedUnder (· ≥ ·) f) (bdd_below : F.IsBoundedUnder (· ≥ ·) f) :
    Filter.liminf (fun i ↦ c + f i) F = c + Filter.liminf f F

[CovariantClass R R (fun x y => x + y) fun x y => x ≤ y]

(cobdd : Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) F f)

(bdd_below : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) F f)

Filter.liminf (fun i => c + f i) F = c + Filter.liminf f F


@[simp]
theorem PreservesPushout.iso_hom : (PreservesPushout.iso G f g).hom = pushoutComparison G f g

[CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.span f g) G]

[CategoryTheory.Limits.HasPushout (G.map f) (G.map g)]

(CategoryTheory.Limits.PreservesPushout.iso G f g).hom = CategoryTheory.Limits.pushoutComparison G f g


/-- The forgetful monoidal functor from a full monoidal subcategory into the original category
("forgetting" the condition).
-/
@[simps]
def fullMonoidalSubcategoryInclusion : MonoidalFunctor (FullSubcategory P) C

(X Y : CategoryTheory.FullSubcategory P)

(CategoryTheory.MonoidalCategory.fullMonoidalSubcategoryInclusion P).μ X Y =
  CategoryTheory.CategoryStruct.id
    (CategoryTheory.MonoidalCategory.tensorObj ((CategoryTheory.fullSubcategoryInclusion P).obj X)
      ((CategoryTheory.fullSubcategoryInclusion P).obj Y))


@[to_additive]
theorem sup_eq_closure_mul (H K : Subgroup G) : H ⊔ K = closure ((H : Set G) * (K : Set G))

{G : Type u_2}
[AddGroup G]
(H K : AddSubgroup G)


@[simp]
theorem monic_toSubring : Monic (toSubring p T hp) ↔ Monic p

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


protected theorem MulAction.injective₀ (ha : a ≠ 0) : Function.Injective (a • · : β → β)

{α : Type u}
{β : Type v}
[GroupWithZero α]
[MulAction α β]
{a : α}
(ha : a ≠ 0)


theorem mem_ball_self {x : E} {r : ℝ} (hr : 0 < r) : x ∈ ball x r

{E : Type u_1}
[AddCommGroup E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[T2Space E]
[Module ℝ E]
[ContinuousSMul ℝ E]
[FiniteDimensional ℝ E]
{x : E}
{r : ℝ}
(hr : 0 < r)


theorem restrict_finset_biUnion_congr {s : Finset ι} {t : ι → Set α} :
    μ.restrict (⋃ i ∈ s, t i) = ν.restrict (⋃ i ∈ s, t i) ↔
      ∀ i ∈ s, μ.restrict (t i) = ν.restrict (t i)

{α : Type u_2}
{ι : Type u_6}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{s : Finset ι}
{t : ι → Set α}


theorem HasStrictDerivAt.const_sub (c : F) (hf : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun x => c - f x) (-f') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
(c : F)
(hf : HasStrictDerivAt f f' x)


@[simp]
theorem zeroLocus_univ : zeroLocus 𝒜 (Set.univ : Set A) = ∅

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]

ProjectiveSpectrum.zeroLocus 𝒜 Set.univ = ∅


lemma conductor_mem_conductorSet : conductor χ ∈ conductorSet χ

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
(χ : DirichletCharacter R n)


protected lemma Infinite.preimage (hs : s.Infinite) (hf : s ⊆ range f) : (f ⁻¹' s).Infinite

{α : Type u}
{β : Type v}
{f : α → β}
{s : Set β}
(hs : s.Infinite)
(hf : s ⊆ Set.range f)


@[simp] lemma im_ofNat (n : ℕ) [n.AtLeastTwo] : (no_index (OfNat.ofNat n) : ℂ).im = 0


theorem conj_eq_iff_real {z : K} : conj z = z ↔ ∃ r : ℝ, z = (r : K)


theorem Ioc_def (a b : α) : { x | a < x ∧ x ≤ b } = Ioc a b


/-- To construct a `StarOrderedRing` instance it suffices to show that `x ≤ y` if and only if
`y = x + star s * s` for some `s : R`.

This is provided for convenience because it holds in some common scenarios (e.g.,`ℝ≥0`, `C(X, ℝ≥0)`)
and obviates the hassle of `AddSubmonoid.closure_induction` when creating those instances.

If you are working with a `NonUnitalRing` and not a `NonUnitalSemiring`, see
`StarOrderedRing.of_nonneg_iff` for a more convenient version.
 -/
lemma of_le_iff [NonUnitalSemiring R] [PartialOrder R] [StarRing R]
    (h_le_iff : ∀ x y : R, x ≤ y ↔ ∃ s, y = x + star s * s) : StarOrderedRing R

(h_le_iff : ∀ (x y : R), x ≤ y ↔ ∃ s, y = x + star s * s)


@[simp]
theorem not_inr_lt_inl [LT α] [LT β] {a : α} {b : β} : ¬inr b < inl a

{α : Type u_1}
{β : Type u_2}
[LT α]
[LT β]
{a : α}
{b : β}


lemma restrict_killingForm (H : LieSubalgebra R L) :
    (killingForm R L).restrict H = LieModule.traceForm R H L

(R : Type u_1)
(L : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(H : LieSubalgebra R L)

(killingForm R L).restrict H.toSubmodule = LieModule.traceForm R (↥H) L


/-- `ζ - 1` is prime if `ζ` is a primitive `2 ^ (k + 1)`-th root of unity.
  See `zeta_sub_one_prime` for a general statement. -/
theorem zeta_sub_one_prime_of_two_pow [IsCyclotomicExtension {(2 : ℕ+) ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑((2 : ℕ+) ^ (k + 1))) :
    Prime (hζ.toInteger - 1)

[IsCyclotomicExtension {2 ^ (k + 1)} ℚ K]


theorem le_sub_of_add_le_right (hb : b ≠ ∞) : a + b ≤ c → a ≤ c - b


theorem image_norm_nonempty {S : AddSubgroup M} (x : M ⧸ S) :
    (norm '' { m | mk' S m = x }).Nonempty

{M : Type u_1}
[SeminormedAddCommGroup M]
{S : AddSubgroup M}
(x : M ⧸ S)

(norm '' {m | (QuotientAddGroup.mk' S) m = x}).Nonempty


theorem nhds_eq_pure : 𝓝 a = pure a ↔ ¬IsLimit a


lemma generateFrom_insert_of_generateOpen {α : Type*} {s : Set (Set α)} {t : Set α}
    (ht : GenerateOpen s t) : generateFrom (insert t s) = generateFrom s

(ht : TopologicalSpace.GenerateOpen s t)

TopologicalSpace.generateFrom (insert t s) = TopologicalSpace.generateFrom s


/-- `val : αˣ → α` as an order embedding. -/
@[to_additive (attr := simps (config := .asFn))
  "`val : add_units α → α` as an order embedding."]
def orderEmbeddingVal [Monoid α] [LinearOrder α] : αˣ ↪o α

{α : Type u_1}
[Monoid α]
[LinearOrder α]


theorem set_walk_length_toFinset_eq (n : ℕ) (u v : V) :
    {p : G.Walk u v | p.length = n}.toFinset = G.finsetWalkLength n u v

{V : Type u}
(G : SimpleGraph V)
[DecidableEq V]
[G.LocallyFinite]
(n : ℕ)
(u v : V)

{p | p.length = n}.toFinset = G.finsetWalkLength n u v


theorem natCast_lt_coe {n : ℕ} : n < (r : ℝ≥0∞) ↔ n < r


/-- `QuaternionAlgebra.imI` as a `LinearMap`-/
@[simps]
def imIₗ : ℍ[R,c₁,c₂] →ₗ[R] R

{R : Type u_3}
[CommRing R]
(c₁ c₂ : R)
(self : ℍ[R,c₁,c₂])

(QuaternionAlgebra.imIₗ c₁ c₂) self = self.imI


/-- If `y : L` is a root of `minpoly K x`, then `minpoly K y = minpoly K x`. -/
theorem eq_of_root {x y : L} (hx : IsAlgebraic K x)
    (h_ev : (Polynomial.aeval y) (minpoly K x) = 0) : minpoly K y = minpoly K x


theorem hasMFDerivWithinAt_const (c : M') (s : Set M) (x : M) :
    HasMFDerivWithinAt I I' (fun _ : M => c) s x (0 : TangentSpace I x →L[𝕜] TangentSpace I' c)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
(c : M')
(s : Set M)
(x : M)

HasMFDerivWithinAt I I' (fun x => c) s x 0


@[simp, nolint unusedHavesSuffices] -- Porting note: false positive
theorem list_ofNat_succ (v : ℕ) :
    ofNat (List α) (succ v) = ofNat α v.unpair.1 :: ofNat (List α) v.unpair.2

Denumerable.ofNat (List α) v.succ = Denumerable.ofNat α (Nat.unpair v).1 :: Denumerable.ofNat (List α) (Nat.unpair v).2


theorem isCoprime_num_denom (x : RatFunc K) : IsCoprime x.num x.denom


nonrec theorem isThin_iff : S.IsThin ↔ ∀ c : S.objs, Subsingleton (S.arrows c c)

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

S.IsThin ↔ ∀ (c : ↑S.objs), Subsingleton ↑(S.arrows ↑c ↑c)


theorem insert_inj_on' (s : Finset α) : Set.InjOn (fun a => insert a s) (sᶜ : Finset α)

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


theorem all_eq_not_any_not (p : α → Bool) (as : Array α) (start stop) :
    all as p start stop = !(any as (!p ·) start stop)

{α : Type u_1}
(p : α → Bool)
(as : Array α)
(start stop : Nat)

as.all p start stop = !as.any (fun x => !p x) start stop


/--
Giving a continuous map out of a disjoint union is the same as giving a continuous map out of
each term. This is a version of `Equiv.piCurry` for continuous maps.
-/
@[simps]
def sigmaEquiv : (∀ i, C(X i, A)) ≃ C((Σ i, X i), A)

{I : Type u_5}
(A : Type u_6)
(X : I → Type u_7)
[TopologicalSpace A]
[(i : I) → TopologicalSpace (X i)]
(f : (i : I) → C(X i, A))

(ContinuousMap.sigmaEquiv A X) f = ContinuousMap.sigma f


@[simp]
theorem dist_lineMap_right (p₁ p₂ : P) (c : 𝕜) :
    dist (lineMap p₁ p₂ c) p₂ = ‖1 - c‖ * dist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
(p₁ p₂ : P)
(c : 𝕜)

dist ((AffineMap.lineMap p₁ p₂) c) p₂ = ‖1 - c‖ * dist p₁ p₂


theorem preimage_preimage {g : β → γ} {f : α → β} {s : Set γ} :
    f ⁻¹' (g ⁻¹' s) = (fun x => g (f x)) ⁻¹' s

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{g : β → γ}
{f : α → β}
{s : Set γ}


theorem asString_toList (s : String) : s.toList.asString = s


/-- A group is called *cyclic* if it is generated by a single element. -/
class IsAddCyclic (α : Type u) [AddGroup α] : Prop where
  exists_generator : ∃ g : α, ∀ x, x ∈ AddSubgroup.zmultiples g

{α : Type u}
[AddGroup α]
[self : IsAddCyclic α]

∃ g, ∀ (x : α), x ∈ AddSubgroup.zmultiples g


private theorem rel.refl {s : Setoid α} (q : Quotient s) : rel q q

{α : Sort u}
{s : Setoid α}
(q : Quotient s)


protected theorem inv_zero : (0 : R[R⁰⁻¹])⁻¹ = 0


theorem max_eq_bot {s : Finset α} : s.max = ⊥ ↔ s = ∅

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


/-- Change a cocone on `F : Jᵒᵖ ⥤ C` to a cone on `F.rightOp : J ⥤ Cᵒᵖ`. -/
@[simps]
def coneRightOpOfCocone (c : Cocone F) : Cone F.rightOp

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : Jᵒᵖ ⥤ C}
(c : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Limits.coneRightOpOfCocone c).π = CategoryTheory.NatTrans.rightOp c.ι


theorem Finite.eq_insert_of_subset_of_encard_eq_succ (hs : s.Finite) (h : s ⊆ t)
    (hst : t.encard = s.encard + 1) : ∃ a, t = insert a s

{α : Type u_1}
{s t : Set α}
(hs : s.Finite)
(h : s ⊆ t)
(hst : t.encard = s.encard + 1)


@[simp]
theorem gcd_add_mul_left_left (m n k : ℕ) : gcd (m + n * k) n = gcd m n


/-- Given a pullback square assembled from a commuting square on the top and
a pullback square on the bottom, the top square is a pullback square.

The objects in the statement fit into the following diagram:
```
X₁₁ - h₁₁ -> X₁₂
|            |
v₁₁          v₁₂
↓            ↓
X₂₁ - h₂₁ -> X₂₂
|            |
v₂₁          v₂₂
↓            ↓
X₃₁ - h₃₁ -> X₃₂
```
-/
theorem of_bot {X₁₁ X₁₂ X₂₁ X₂₂ X₃₁ X₃₂ : C} {h₁₁ : X₁₁ ⟶ X₁₂} {h₂₁ : X₂₁ ⟶ X₂₂} {h₃₁ : X₃₁ ⟶ X₃₂}
    {v₁₁ : X₁₁ ⟶ X₂₁} {v₁₂ : X₁₂ ⟶ X₂₂} {v₂₁ : X₂₁ ⟶ X₃₁} {v₂₂ : X₂₂ ⟶ X₃₂}
    (s : IsPullback h₁₁ (v₁₁ ≫ v₂₁) (v₁₂ ≫ v₂₂) h₃₁) (p : h₁₁ ≫ v₁₂ = v₁₁ ≫ h₂₁)
    (t : IsPullback h₂₁ v₂₁ v₂₂ h₃₁) : IsPullback h₁₁ v₁₁ v₁₂ h₂₁

{X₁₁ X₁₂ X₂₁ X₂₂ X₃₁ X₃₂ : C}

{h₁₁ : X₁₁ ⟶ X₁₂}

{h₂₁ : X₂₁ ⟶ X₂₂}

{h₃₁ : X₃₁ ⟶ X₃₂}

{v₁₁ : X₁₁ ⟶ X₂₁}

{v₁₂ : X₁₂ ⟶ X₂₂}

{v₂₁ : X₂₁ ⟶ X₃₁}

{v₂₂ : X₂₂ ⟶ X₃₂}

(s : CategoryTheory.IsPullback h₁₁ (v₁₁ ≫ v₂₁) (v₁₂ ≫ v₂₂) h₃₁)

(p : h₁₁ ≫ v₁₂ = v₁₁ ≫ h₂₁)

(t : CategoryTheory.IsPullback h₂₁ v₂₁ v₂₂ h₃₁)

CategoryTheory.IsPullback h₁₁ v₁₁ v₁₂ h₂₁


theorem le_ceil_map_map_zero : ⌈f 0⌉ + ⌊g 0⌋ ≤ ⌈(f * g) 0⌉


lemma eq_singleton_or_nontrivial (ha : a ∈ s) : s = {a} ∨ s.Nontrivial

{α : Type u}
{a : α}
{s : Set α}
(ha : a ∈ s)


lemma _root_.Real.spectralRadius_mem_spectrum {A : Type*} [NormedRing A] [NormedAlgebra ℝ A]
    [CompleteSpace A] {a : A} (ha : (spectrum ℝ a).Nonempty)
    (ha' : SpectrumRestricts a ContinuousMap.realToNNReal) :
    (spectralRadius ℝ a).toReal ∈ spectrum ℝ a

(ha' : SpectrumRestricts a ⇑ContinuousMap.realToNNReal)