theorem mulVec_surjective_iff_isUnit {A : Matrix m m R} :
    Function.Surjective A.mulVec ↔ IsUnit A

{m : Type u}
[DecidableEq m]
{R : Type u_2}
[CommRing R]
[Fintype m]
{A : Matrix m m R}


/-- A `weightedVSub` with sum of weights 0 is in the `vectorSpan` of
an indexed family. -/
theorem weightedVSub_mem_vectorSpan {s : Finset ι} {w : ι → k} (h : ∑ i ∈ s, w i = 0)
    (p : ι → P) : s.weightedVSub p w ∈ vectorSpan k (Set.range p)

{ι : Type u_1}
{k : Type u_2}
{V : Type u_3}
{P : Type u_4}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Finset ι}
{w : ι → k}
(h : ∑ i ∈ s, w i = 0)
(p : ι → P)

(s.weightedVSub p) w ∈ vectorSpan k (Set.range p)


/-- A `Finitary` matroid is one where a set is independent if and only if it all
  its finite subsets are independent, or equivalently a matroid whose circuits are finite. -/
class Finitary (M : Matroid α) : Prop where
  /-- `I` is independent if all its finite subsets are independent. -/
  indep_of_forall_finite : ∀ I, (∀ J, J ⊆ I → J.Finite → M.Indep J) → M.Indep I

{α : Type u_1}
{M : Matroid α}
[self : M.Finitary]
(I : Set α)

(∀ J ⊆ I, J.Finite → M.Indep J) → M.Indep I


/-- **Tietze extension theorem** for `TietzeExtension` spaces. Let `e` be a closed embedding of a
nonempty topological space `X₁` into a normal topological space `X`. Let `f` be a continuous
function on `X₁` with values in a `TietzeExtension` space `Y`. Then there exists a
continuous function `g : C(X, Y)` such that `g ∘ e = f`. -/
theorem ContinuousMap.exists_extension (f : C(X₁, Y)) :
    ∃ (g : C(X, Y)), g.comp ⟨e, he.continuous⟩ = f

{X₁ : Type u₁}
[TopologicalSpace X₁]
{X : Type u}
[TopologicalSpace X]
[NormalSpace X]
{e : X₁ → X}
(he : ClosedEmbedding e)
{Y : Type v}
[TopologicalSpace Y]
[TietzeExtension Y]
(f : C(X₁, Y))

∃ g, g.comp { toFun := e, continuous_toFun := ⋯ } = f


/-- Multiplying by all the matrices in `listTransvecRow M` kills all the coefficients in the
last row but the last one. -/
theorem mul_listTransvecRow_last_row (hM : M (inr unit) (inr unit) ≠ 0) (i : Fin r) :
    (M * (listTransvecRow M).prod) (inr unit) (inl i) = 0

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

(M * (Matrix.Pivot.listTransvecRow M).prod) (Sum.inr ()) (Sum.inl i) = 0


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

∃ a b, (b + 1) ^ 2 * (a + 1) = n ∧ Squarefree (a + 1)


theorem HasDerivAt.comp_hasDerivWithinAt_of_eq (hh₂ : HasDerivAt h₂ h₂' y)
    (hh : HasDerivWithinAt h h' s x) (hy : y = h x) :
    HasDerivWithinAt (h₂ ∘ h) (h₂' * h') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)
{s : Set 𝕜}
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{h : 𝕜 → 𝕜'}
{h₂ : 𝕜' → 𝕜'}
{h' h₂' y : 𝕜'}
(hh₂ : HasDerivAt h₂ h₂' y)
(hh : HasDerivWithinAt h h' s x)
(hy : y = h x)


@[simp]
theorem pi_empty {t : ∀ a : α, Finset (β a)} : pi (∅ : Finset α) t = singleton (Pi.empty β)

{α : Type u_1}
{β : α → Type u}
[DecidableEq α]
{t : (a : α) → Finset (β a)}


theorem mul_smul' {A : Type*} [Semiring A] [Algebra R A] (x : T) (p₁ p₂ : LocalizedModule S A) :
    p₁ * x • p₂ = x • (p₁ * p₂)

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{T : Type u_1}
[CommSemiring T]
[Algebra R T]
[IsLocalization S T]
{A : Type u_2}
[Semiring A]
[Algebra R A]
(x : T)
(p₁ p₂ : LocalizedModule S A)


@[simp]
theorem HomogeneousIdeal.coe_radical (I : HomogeneousIdeal 𝒜) :
    I.radical.toIdeal = I.toIdeal.radical

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_3}
[CommRing A]
[LinearOrderedCancelAddCommMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[GradedRing 𝒜]
(I : HomogeneousIdeal 𝒜)


@[simp, norm_cast]
theorem mul_to_int : ∀ m n, ((m * n : ZNum) : ℤ) = m * n


@[to_additive]
theorem comap_normalizer_eq_of_injective_of_le_range {N : Type*} [Group N] (H : Subgroup G)
    {f : N →* G} (hf : Function.Injective f) (h : H.normalizer ≤ f.range) :
    comap f H.normalizer = (comap f H).normalizer

{G : Type u_1}
[AddGroup G]
{N : Type u_6}
[AddGroup N]
(H : AddSubgroup G)
{f : N →+ G}
(hf : Function.Injective ⇑f)
(h : H.normalizer ≤ f.range)

AddSubgroup.comap f H.normalizer = (AddSubgroup.comap f H).normalizer


theorem zero_eq : vectorsProdEqOne G 0 = {Vector.nil}

Equiv.Perm.vectorsProdEqOne G 0 = {Mathlib.Vector.nil}


@[simp, norm_cast]
theorem coe_map : (map f s : Set β) = f '' s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α ≃o β)
(s : LowerSet α)


protected theorem LocallyIntegrableOn.sub
    (hf : LocallyIntegrableOn f s μ) (hg : LocallyIntegrableOn g s μ) :
    LocallyIntegrableOn (f - g) s μ

(hf : MeasureTheory.LocallyIntegrableOn f s μ)

(hg : MeasureTheory.LocallyIntegrableOn g s μ)

MeasureTheory.LocallyIntegrableOn (f - g) s μ


@[simp]
theorem DifferentiableAt.csinh (hc : DifferentiableAt ℂ f x) :
    DifferentiableAt ℂ (fun x => Complex.sinh (f x)) x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
(hc : DifferentiableAt ℂ f x)


@[simp]
theorem tensorTensorTensorComm_symm :
    (tensorTensorTensorComm R M N P Q).symm = tensorTensorTensorComm R M P N Q

(R : Type u_1)
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]

(TensorProduct.tensorTensorTensorComm R M N P Q).symm = TensorProduct.tensorTensorTensorComm R M P N Q


@[simp]
theorem toFinsupp_monomial (n : ℕ) (r : R) : (monomial n r).toFinsupp = Finsupp.single n r

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

((Polynomial.monomial n) r).toFinsupp = Finsupp.single n r


@[simp]
theorem AwayMap.lift_eq (hg : IsUnit (g x)) (a : M) : F.lift x hg (F.toMap a) = g a

(F : Submonoid.LocalizationMap.AwayMap x N)

(Submonoid.LocalizationMap.AwayMap.lift x F hg) ((Submonoid.LocalizationMap.toMap F) a) = g a


/-- Every functor indexing a (co)equalizer is naturally isomorphic (actually, equal) to a
    `parallelPair` -/
@[simps!]
def diagramIsoParallelPair (F : WalkingParallelPair ⥤ C) :
    F ≅ parallelPair (F.map left) (F.map right)

(F : CategoryTheory.Functor CategoryTheory.Limits.WalkingParallelPair C)

(CategoryTheory.Limits.diagramIsoParallelPair F).hom.app X = CategoryTheory.eqToHom ⋯


theorem IsSemisimple.of_mem_adjoin_singleton {a : End K M}
    (ha : a ∈ Algebra.adjoin K {f}) : a.IsSemisimple

{M : Type u_2}
[AddCommGroup M]
{K : Type u_3}
[Field K]
[Module K M]
{f : Module.End K M}
[FiniteDimensional K M]
(hf : f.IsSemisimple)
{a : Module.End K M}
(ha : a ∈ Algebra.adjoin K {f})


theorem hasSum_geometric_two : HasSum (fun n : ℕ ↦ ((1 : ℝ) / 2) ^ n) 2


theorem csSup_image2_eq_csInf_csInf (h₁ : ∀ b, GaloisConnection (swap l b ∘ ofDual) (toDual ∘ u₁ b))
    (h₂ : ∀ a, GaloisConnection (l a ∘ ofDual) (toDual ∘ u₂ a)) :
    s.Nonempty → BddBelow s → t.Nonempty → BddBelow t → sSup (image2 l s t) = l (sInf s) (sInf t)

{l : α → β → γ}

{u₁ : β → γ → α}

{u₂ : α → γ → β}

(h₁ : ∀ (b : β), GaloisConnection (Function.swap l b ∘ ⇑OrderDual.ofDual) (⇑OrderDual.toDual ∘ u₁ b))

(h₂ : ∀ (a : α), GaloisConnection (l a ∘ ⇑OrderDual.ofDual) (⇑OrderDual.toDual ∘ u₂ a))

s.Nonempty → BddBelow s → t.Nonempty → BddBelow t → sSup (Set.image2 l s t) = l (sInf s) (sInf t)


@[simp]
lemma count_attach (a : {x // x ∈ s}) : s.attach.count a = s.count ↑a

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

Multiset.count a s.attach = Multiset.count (↑a) s


@[simp] theorem isGLB_empty_iff : IsGLB ∅ a ↔ IsTop a


/-- The inverse of a multiplicative character `χ`, applied to `a`, is the inverse of `χ a`. -/
theorem inv_apply_eq_inv (χ : MulChar R R') (a : R) : χ⁻¹ a = Ring.inverse (χ a)

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
(χ : MulChar R R')
(a : R)


theorem isClosed_induced_iff [t : TopologicalSpace β] {s : Set α} {f : α → β} :
    IsClosed[t.induced f] s ↔ ∃ t, IsClosed t ∧ f ⁻¹' t = s

{α : Type u_1}
{β : Type u_2}
[t : TopologicalSpace β]
{s : Set α}
{f : α → β}

IsClosed s ↔ ∃ t_1, IsClosed t_1 ∧ f ⁻¹' t_1 = s


theorem zeroLocus_empty_iff_eq_top {I : Ideal R} : zeroLocus (I : Set R) = ∅ ↔ I = ⊤

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


theorem frequently_atTop [SemilatticeSup α] [Nonempty α] {p : α → Prop} :
    (∃ᶠ x in atTop, p x) ↔ ∀ a, ∃ b ≥ a, p b

{α : Type u_3}
[SemilatticeSup α]
[Nonempty α]
{p : α → Prop}

(∃ᶠ (x : α) in Filter.atTop, p x) ↔ ∀ (a : α), ∃ b ≥ a, p b


/-- The composition of two `Action V G` homomorphisms is the composition of the underlying maps.
-/
@[simps]
def comp {M N K : Action V G} (p : Action.Hom M N) (q : Action.Hom N K) : Action.Hom M K

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
{M N K : Action V G}
(p : M.Hom N)
(q : N.Hom K)


@[to_additive (attr := simp)]
lemma zpow_right (h : Commute a b) (m : ℤ) : Commute a (b ^ m)

{G : Type u_1}
[Group G]
{a b : G}
(h : Commute a b)
(m : ℤ)


theorem ContMDiff.contMDiffAt (h : ContMDiff I I' n f) : 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]
{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'}
{x : M}
{n : ℕ∞}
(h : ContMDiff I I' n f)


/-- The functor sending an arrow to its target. -/
@[simps!]
def rightFunc : Arrow C ⥤ C

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

∀ {X Y : CategoryTheory.Comma (CategoryTheory.Functor.id C) (CategoryTheory.Functor.id C)} (f : X ⟶ Y),
  CategoryTheory.Arrow.rightFunc.map f = f.right


/-- The minimal distance to a set (as `ℝ≥0`) is continuous in point -/
theorem continuous_infNndist_pt (s : Set α) : Continuous fun x => infNndist x s

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

Continuous fun x => Metric.infNndist x s


/-- Given a Localization map `f : M →* N` for a Submonoid `S ⊆ M`, if a `CommMonoid` map
`g : M →* P` induces a map `f.lift hg : N →* P` then for all `z : N, v : P`, we have
`f.lift hg z = v ↔ g x = g y * v`, where `x : M, y ∈ S` are such that `z * f y = f x`. -/
@[to_additive
    "Given a Localization map `f : M →+ N` for a Submonoid `S ⊆ M`, if an
`AddCommMonoid` map `g : M →+ P` induces a map `f.lift hg : N →+ P` then for all
`z : N, v : P`, we have `f.lift hg z = v ↔ g x = g y + v`, where `x : M, y ∈ S` are such that
`z + f y = f x`."]
theorem lift_spec (z v) : f.lift hg z = v ↔ g (f.sec z).1 = g (f.sec z).2 * v

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
{g : M →+ P}
(hg : ∀ (y : ↥S), IsAddUnit (g ↑y))
(z : N)
(v : P)

(f.lift hg) z = v ↔ g (f.sec z).1 = g ↑(f.sec z).2 + v


@[to_additive (attr := simp)]
theorem inv_eq {x : PUnit} : x⁻¹ = unit


@[simp]
theorem union_empty {s : AList β} : s ∪ (∅ : AList β) = s

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


theorem inf_assoc (a b c : α) : a ⊓ b ⊓ c = a ⊓ (b ⊓ c)

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


theorem zpow_strictAnti (h₀ : 0 < a) (h₁ : a < 1) : StrictAnti (a ^ · : ℤ → α)

{α : Type u_1}
[LinearOrderedSemifield α]
{a : α}
(h₀ : 0 < a)
(h₁ : a < 1)


@[simp]
theorem strictAntiOn_comp_ofDual_iff : StrictAntiOn (f ∘ ofDual) s ↔ StrictMonoOn f s

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

StrictAntiOn (f ∘ ⇑OrderDual.ofDual) s ↔ StrictMonoOn f s


@[simp]
theorem integral_Ioi_inv_one_add_sq {i : ℝ} :
    ∫ (x : ℝ) in Set.Ioi i, (1 + x ^ 2)⁻¹ = (π / 2) - arctan i

∫ (x : ℝ) in Set.Ioi i, (1 + x ^ 2)⁻¹ = π / 2 - Real.arctan i


@[to_additive]
theorem invRev_bijective : Function.Bijective (@invRev α)


theorem rotateL_node (l : Ordnode α) (x : α) (sz : ℕ) (m : Ordnode α) (y : α) (r : Ordnode α) :
    rotateL l x (node sz m y r) =
      if size m < ratio * size r then node3L l x m y r else node4L l x m y r

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

l.rotateL x (Ordnode.node sz m y r) = if m.size < Ordnode.ratio * r.size then l.node3L x m y r else l.node4L x m y r


@[simp]
theorem degree_restriction {p : R[X]} : (restriction p).degree = p.degree


@[simp]
theorem flip_isRefl_iff : B.flip.IsRefl ↔ B.IsRefl

{R : Type u_1}
{R₁ : Type u_2}
{M : Type u_5}
{M₁ : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
{I₁ I₂ : R₁ →+* R}
{B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M}


@[simp]
theorem lid_tmul (m : M) (r : R) : (TensorProduct.lid R M : R ⊗ M → M) (r ⊗ₜ m) = r • m

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
[AddCommMonoid M]
[Module R M]
(m : M)
(r : R)

(TensorProduct.lid R M) (r ⊗ₜ[R] m) = r • m


/-- The bottom submodule is linearly equivalent to punit as an `R`-module. -/
@[simps]
def botEquivPUnit : (⊥ : Submodule R M) ≃ₗ[R] PUnit.{v+1}

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]

∀ (x : PUnit.{v + 1}), Submodule.botEquivPUnit.symm x = 0


@[to_additive]
theorem epi_iff_range_eq_top : Epi f ↔ f.range = ⊤

CategoryTheory.Epi f ↔ MonoidHom.range f = ⊤


theorem xor_cancel_right (n m : ℕ) : (m ^^^ n) ^^^ n = m


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


@[simp]
theorem det_comp (f g : M →ₗ[A] M) :
    LinearMap.det (f.comp g) = LinearMap.det f * LinearMap.det g

{M : Type u_2}
[AddCommGroup M]
{A : Type u_5}
[CommRing A]
[Module A M]
(f g : M →ₗ[A] M)

LinearMap.det (f ∘ₗ g) = LinearMap.det f * LinearMap.det g


/-- The product of two strictly antitone functions is strictly antitone. -/
@[to_additive add "The sum of two strictly antitone functions is strictly antitone."]
theorem StrictAntiOn.mul' [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] (hf : StrictAntiOn f s) (hg : StrictAntiOn g s) :
    StrictAntiOn (fun x => f x * g x) s

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

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


theorem Nat.not_succ_le_self : (n : Nat) → Not (LE.le (succ n) n)


lemma iteratedFDeriv_two_apply (f : E → F) (z : E) (m : Fin 2 → E) :
    iteratedFDeriv 𝕜 2 f z m = fderiv 𝕜 (fderiv 𝕜 f) z (m 0) (m 1)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : E → F)
(z : E)
(m : Fin 2 → E)

(iteratedFDeriv 𝕜 2 f z) m = ((fderiv 𝕜 (fderiv 𝕜 f) z) (m 0)) (m 1)


/-- Composition of lax functors. -/
@[simps]
def comp {D : Type u₃} [Bicategory.{w₃, v₃} D] (F : LaxFunctor B C) (G : LaxFunctor C D) :
    LaxFunctor B D

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

(F.comp G).mapId a = CategoryTheory.CategoryStruct.comp (G.mapId (F.obj a)) (G.map₂ (F.mapId a))


protected theorem map_rel (f : r →r s) {a b} : r a b → s (f a) (f b)

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r →r s)
{a b : α}


lemma eisensteinSeries_slash_apply (k : ℤ) (γ : SL(2, ℤ)) :
    eisensteinSeries a k ∣[k] γ = eisensteinSeries (a ᵥ* γ) k

{N : ℕ}
(a : Fin 2 → ZMod N)
(k : ℤ)
(γ : SL(2, ℤ))

eisensteinSeries a k ∣[k] γ = eisensteinSeries (a ᵥ* ↑((Matrix.SpecialLinearGroup.map (Int.castRingHom (ZMod N))) γ)) k


/-- If `s` is a convex neighborhood of the origin in a topological real vector space, then `gauge s`
is continuous. If the ambient space is a normed space, then `gauge s` is Lipschitz continuous, see
`Convex.lipschitz_gauge`. -/
theorem continuousAt_gauge (hc : Convex ℝ s) (hs₀ : s ∈ 𝓝 0) : ContinuousAt (gauge s) x

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


@[reassoc (attr := simp)]
theorem QInfty_f_idem (n : ℕ) : (QInfty.f n : X _[n] ⟶ _) ≫ QInfty.f n = QInfty.f n

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

AlgebraicTopology.DoldKan.QInfty.f n ≫ AlgebraicTopology.DoldKan.QInfty.f n = AlgebraicTopology.DoldKan.QInfty.f n


theorem symm_bijective : Bijective (IsometryEquiv.symm : (α ≃ᵢ β) → β ≃ᵢ α)

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]


/-- Characterization of minimizers in the projection on a subspace, in the real case.
Let `u` be a point in a real inner product space, and let `K` be a nonempty subspace.
Then point `v` minimizes the distance `‖u - v‖` over points in `K` if and only if
for all `w ∈ K`, `⟪u - v, w⟫ = 0` (i.e., `u - v` is orthogonal to the subspace `K`).
This is superceded by `norm_eq_iInf_iff_inner_eq_zero` that gives the same conclusion over
any `RCLike` field.
-/
theorem norm_eq_iInf_iff_real_inner_eq_zero (K : Submodule ℝ F) {u : F} {v : F} (hv : v ∈ K) :
    (‖u - v‖ = ⨅ w : (↑K : Set F), ‖u - w‖) ↔ ∀ w ∈ K, ⟪u - v, w⟫_ℝ = 0

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(K : Submodule ℝ F)
{u v : F}
(hv : v ∈ K)

‖u - v‖ = ⨅ w, ‖u - ↑w‖ ↔ ∀ w ∈ K, ⟪u - v, w⟫_ℝ = 0


/-- A family of gluing data consists of
1. An index type `J`
2. A bundled topological space `U i` for each `i : J`.
3. An open set `V i j ⊆ U i` for each `i j : J`.
4. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `V i i = U i`.
7. `t i i` is the identity.
8. For each `x ∈ V i j ∩ V i k`, `t i j x ∈ V j k`.
9. `t j k (t i j x) = t i k x`.

We can then glue the topological spaces `U i` together by identifying `V i j` with `V j i`.
-/
-- Porting note(#5171): removed `@[nolint has_nonempty_instance]`
structure MkCore where
  {J : Type u}
  U : J → TopCat.{u}
  V : ∀ i, J → Opens (U i)
  t : ∀ i j, (Opens.toTopCat _).obj (V i j) ⟶ (Opens.toTopCat _).obj (V j i)
  V_id : ∀ i, V i i = ⊤
  t_id : ∀ i, ⇑(t i i) = id
  t_inter : ∀ ⦃i j⦄ (k) (x : V i j), ↑x ∈ V i k → (((↑) : (V j i) → (U j)) (t i j x)) ∈ V j k
  cocycle :
    ∀ (i j k) (x : V i j) (h : ↑x ∈ V i k),
      -- Porting note: the underscore in the next line was `↑(t i j x)`, but Lean type-mismatched
      (((↑) : (V k j) → (U k)) (t j k ⟨_, t_inter k x h⟩)) = ((↑) : (V k i) → (U k)) (t i k ⟨x, h⟩)

(self : TopCat.GlueData.MkCore)
(i : self.J)


theorem comp_const_apply_eq_bind (κ : Kernel α β) (μ : Measure α) (a : α) :
    (κ ∘ₖ const α μ) a = μ.bind κ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ : ProbabilityTheory.Kernel α β)
(μ : MeasureTheory.Measure α)
(a : α)

(κ ∘ₖ ProbabilityTheory.Kernel.const α μ) a = μ.bind ⇑κ


@[simp]
theorem ppow_zero {f : ArithmeticFunction R} : f.ppow 0 = ζ

{R : Type u_1}
[Semiring R]
{f : ArithmeticFunction R}


lemma rpow_natCast_mul (x : ℝ≥0∞) (n : ℕ) (z : ℝ) : x ^ (n * z) = (x ^ n) ^ z


@[simp]
theorem generalLinearEquiv_to_linearMap (f : GeneralLinearGroup R M) :
    (generalLinearEquiv R M f : M →ₗ[R] M) = f

(R : Type u_1)
(M : Type u_2)
[Semiring R]
[AddCommMonoid M]
[Module R M]
(f : LinearMap.GeneralLinearGroup R M)

↑((LinearMap.GeneralLinearGroup.generalLinearEquiv R M) f) = ↑f


@[reassoc]
theorem app_right_eq_ι_comp_snd (b) :
    K.π.app (WalkingMulticospan.right b) = K.ι (I.sndTo b) ≫ I.snd b

{I : CategoryTheory.Limits.MulticospanIndex C}

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


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

{α : Type u_2}
{β : Type u_3}
[Bot α]
[Bot β]
{f g : BotHom α β}
(h : ∀ (a : α), f a = g a)


/-- The canonical functor `(C ⥤ Karoubi D) ⥤ (Karoubi C ⥤ Karoubi D)` -/
@[simps]
def functorExtension₁ : (C ⥤ Karoubi D) ⥤ Karoubi C ⥤ Karoubi D

(C : Type u_1)
(D : Type u_2)
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]

∀ {X Y : CategoryTheory.Functor C (CategoryTheory.Idempotents.Karoubi D)} (φ : X ⟶ Y),
  (CategoryTheory.Idempotents.functorExtension₁ C D).map φ = CategoryTheory.Idempotents.FunctorExtension₁.map φ


@[to_additive]
theorem elim_inv_inv [Inv γ] : Sum.elim a⁻¹ b⁻¹ = (Sum.elim a b)⁻¹

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(a : α → γ)
(b : β → γ)
[Inv γ]


theorem lintegral_prod_swap [SFinite μ] (f : α × β → ℝ≥0∞) :
    ∫⁻ z, f z.swap ∂ν.prod μ = ∫⁻ z, f z ∂μ.prod ν

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
(f : α × β → ℝ≥0∞)

∫⁻ (z : β × α), f z.swap ∂ν.prod μ = ∫⁻ (z : α × β), f z ∂μ.prod ν


theorem volume_regionBetween_eq_integral' [SigmaFinite μ] (f_int : IntegrableOn f s μ)
    (g_int : IntegrableOn g s μ) (hs : MeasurableSet s) (hfg : f ≤ᵐ[μ.restrict s] g) :
    μ.prod volume (regionBetween f g s) = ENNReal.ofReal (∫ y in s, (g - f) y ∂μ)

(f_int : MeasureTheory.IntegrableOn f s μ)

(g_int : MeasureTheory.IntegrableOn g s μ)

(μ.prod MeasureTheory.volume) (regionBetween f g s) = ENNReal.ofReal (∫ (y : α) in s, (g - f) y ∂μ)


/-- A condensed object satisfies the equalizer condition. -/
theorem equalizerCondition (X : Condensed A) : EqualizerCondition X.val

{A : Type u_1}
[CategoryTheory.Category.{u_3, u_1} A]
(X : Condensed A)


@[simp]
theorem toOrdinal_cast_nat (n : ℕ) : toOrdinal n = n


lemma succ_div_of_dvd (hba : b ∣ a + 1) : (a + 1) / b = a / b + 1


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

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

x ∈ s.mulAntidiagonal t a ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ x.1 * x.2 = a


/-- If `GenContFract.of v` terminates, then its convergents will eventually always be `v`. -/
theorem of_correctness_atTop_of_terminates (terminates : (of v).Terminates) :
    ∀ᶠ n in atTop, v = (of v).convs n

(terminates : (GenContFract.of v).Terminates)

∀ᶠ (n : ℕ) in Filter.atTop, v = (GenContFract.of v).convs n


theorem map_sum₂ {ι : Type*} (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) (t : Finset ι) (x : ι → M) (y) :
    f (∑ i ∈ t, x i) y = ∑ i ∈ t, f (x i) y

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[Semiring S]
{R₂ : Type u_3}
[Semiring R₂]
{S₂ : Type u_4}
[Semiring S₂]
{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module S N]
[Module R₂ P]
[Module S₂ P]
[SMulCommClass S₂ R₂ P]
{ρ₁₂ : R →+* R₂}
{σ₁₂ : S →+* S₂}
{ι : Type u_16}
(f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P)
(t : Finset ι)
(x : ι → M)
(y : N)

(f (∑ i ∈ t, x i)) y = ∑ i ∈ t, (f (x i)) y


/-- A model of a theory is also a model of any subtheory. -/
@[simps]
def subtheoryModel (M : T.ModelType) {T' : L.Theory} (h : T' ⊆ T) : T'.ModelType

{L : FirstOrder.Language}
{T : L.Theory}
(M : T.ModelType)
{T' : L.Theory}
(h : T' ⊆ T)


/-- Reorder a product.

The difference with `Finset.prod_bij'` is that the bijection is specified as a surjective injection,
rather than by an inverse function.

The difference with `Finset.prod_nbij` is that the bijection is allowed to use membership of the
domain of the product, rather than being a non-dependent function. -/
@[to_additive "Reorder a sum.

The difference with `Finset.sum_bij'` is that the bijection is specified as a surjective injection,
rather than by an inverse function.

The difference with `Finset.sum_nbij` is that the bijection is allowed to use membership of the
domain of the sum, rather than being a non-dependent function."]
theorem prod_bij (i : ∀ a ∈ s, κ) (hi : ∀ a ha, i a ha ∈ t)
    (i_inj : ∀ a₁ ha₁ a₂ ha₂, i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)
    (i_surj : ∀ b ∈ t, ∃ a ha, i a ha = b) (h : ∀ a ha, f a = g (i a ha)) :
    ∏ x ∈ s, f x = ∏ x ∈ t, g x

(hi : ∀ (a : ι) (ha : a ∈ s), i a ha ∈ t)

(i_inj : ∀ (a₁ : ι) (ha₁ : a₁ ∈ s) (a₂ : ι) (ha₂ : a₂ ∈ s), i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)

(i_surj : ∀ b ∈ t, ∃ a, ∃ (ha : a ∈ s), i a ha = b)

(h : ∀ (a : ι) (ha : a ∈ s), f a = g (i a ha))


theorem ker_coprod_of_disjoint_range [ContinuousAdd M₃] (f : M →L[R] M₃) (g : M₂ →L[R] M₃)
    (hd : Disjoint (range f) (range g)) :
    LinearMap.ker (f.coprod g) = (LinearMap.ker f).prod (LinearMap.ker g)

(hd : Disjoint (LinearMap.range f) (LinearMap.range g))


theorem IsLeast.isGreatest_image2 (ha : IsLeast s a) (hb : IsLeast t b) :
    IsGreatest (Set.image2 f s t) (f a b)

{f : α → β → γ}

(h₀ : ∀ (b : β), Antitone (Function.swap f b))


theorem sum_apply {ι : Type*} (s : Finset ι) (f : ι → NormedAddGroupHom V₁ V₂) (v : V₁) :
    (∑ i ∈ s, f i) v = ∑ i ∈ s, f i v

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
{ι : Type u_5}
(s : Finset ι)
(f : ι → NormedAddGroupHom V₁ V₂)
(v : V₁)


@[simp]
theorem isMax_grade_iff : IsMax (grade 𝕆 a) ↔ IsMax a

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


theorem natPred_injective : Function.Injective natPred


theorem Memℒp.eLpNormEssSup_indicator_norm_ge_eq_zero (hf : Memℒp f ∞ μ)
    (hmeas : StronglyMeasurable f) :
    ∃ M : ℝ, eLpNormEssSup ({ x | M ≤ ‖f x‖₊ }.indicator f) μ = 0

(hmeas : MeasureTheory.StronglyMeasurable f)

∃ M, MeasureTheory.eLpNormEssSup ({x | M ≤ ↑‖f x‖₊}.indicator f) μ = 0


theorem biSup_adjoin_simple : ⨆ x ∈ S, F⟮x⟯ = adjoin F S

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

⨆ x ∈ S, F⟮x⟯ = IntermediateField.adjoin F S


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


@[simp]
theorem hsum_smul {x : HahnSeries Γ R} {s : SummableFamily Γ R α} : (x • s).hsum = x * s.hsum

{Γ : Type u_1}
{R : Type u_2}
[OrderedCancelAddCommMonoid Γ]
[Semiring R]
{α : Type u_3}
{x : HahnSeries Γ R}
{s : HahnSeries.SummableFamily Γ R α}


@[simp]
lemma charpoly_fromBlocks_zero₁₂ :
    (fromBlocks M₁₁ 0 M₂₁ M₂₂).charpoly = (M₁₁.charpoly * M₂₂.charpoly)

{R : Type u_1}
[CommRing R]
{m : Type u_3}
{n : Type u_4}
[DecidableEq m]
[DecidableEq n]
[Fintype m]
[Fintype n]
(M₁₁ : Matrix m m R)
(M₂₁ : Matrix n m R)
(M₂₂ : Matrix n n R)

(Matrix.fromBlocks M₁₁ 0 M₂₁ M₂₂).charpoly = M₁₁.charpoly * M₂₂.charpoly


theorem isBigOWith_zero (hc : 0 ≤ c) : IsBigOWith c l (fun _x => (0 : E')) g'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{c : ℝ}
(g' : α → F')
(l : Filter α)
(hc : 0 ≤ c)

Asymptotics.IsBigOWith c l (fun _x => 0) g'


@[ext]
theorem ext {f g : A →A[R] B} (h : ∀ x, f x = g x) : f = g

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
{f g : A →A[R] B}
(h : ∀ (x : A), f x = g x)


theorem stoppedValue_const (u : ι → Ω → β) (i : ι) : (stoppedValue u fun _ => i) = u i

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
(u : ι → Ω → β)
(i : ι)

(MeasureTheory.stoppedValue u fun x => i) = u i


@[to_additive (attr := simp)]
theorem traverse_pure (x) : traverse F (pure x : FreeSemigroup α) = pure <$> F x

{α β : Type u}
{m : Type u → Type u}
[Applicative m]
(F : α → m β)
(x : α)


theorem disjoint_iff_inter_eq_empty : Disjoint s t ↔ s ∩ t = ∅


/-- A strict affine subspace has measure zero. -/
theorem addHaar_affineSubspace {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] (μ : Measure E) [IsAddHaarMeasure μ]
    (s : AffineSubspace ℝ E) (hs : s ≠ ⊤) : μ s = 0

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
(s : AffineSubspace ℝ E)
(hs : s ≠ ⊤)


@[simp, nolint simpNF] -- Porting note (#10959): simp cannot prove this
theorem nnnorm_star (a : ℍ) : ‖star a‖₊ = ‖a‖₊


theorem mem_hyperfilter_of_finite_compl {s : Set α} (hf : Set.Finite sᶜ) : s ∈ hyperfilter α

{α : Type u}
[Infinite α]
{s : Set α}
(hf : sᶜ.Finite)


theorem unop_inr {X Y Z : Cᵒᵖ} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) :
    c.unop.inr = c.snd.unop

(c : CategoryTheory.Limits.PullbackCone f g)


/-- On objects, the functor which sends a formal direct factor `P` of a
functor `F : J ⥤ C` to the functor `J ⥤ Karoubi C` which sends `(j : J)` to
the corresponding direct factor of `F.obj j`. -/
@[simps]
def obj (P : Karoubi (J ⥤ C)) : J ⥤ Karoubi C

(P : CategoryTheory.Idempotents.Karoubi (J ⥤ C))

((CategoryTheory.Idempotents.KaroubiFunctorCategoryEmbedding.obj P).obj j).p = P.p.app j


theorem nonempty_of_affineSpan_eq_top {s : Set P} (h : affineSpan k s = ⊤) : s.Nonempty

(k : Type u_1)
(V : Type u_2)
(P : Type u_3)
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{s : Set P}
(h : affineSpan k s = ⊤)


theorem val_le_of_le {n : Nat} {a b : Fin n} (h : a ≤ b) : (a : Nat) ≤ (b : Nat)


theorem repeat_rev {α : Type*} (a : Fin n → α) (k : Fin (m * n)) :
    Fin.repeat m a k.rev = Fin.repeat m (a ∘ Fin.rev) k

{m n : ℕ}
{α : Type u_1}
(a : Fin n → α)
(k : Fin (m * n))


@[simp] lemma Set.Subsingleton.isCornerFree (hA : A.Subsingleton) : IsCornerFree A

{G : Type u_1}
[AddCommMonoid G]
{A : Set (G × G)}
(hA : A.Subsingleton)


@[to_additive (attr := simp)]
theorem edist_smul_left [SMul M X] [IsometricSMul M X] (c : M) (x y : X) :
    edist (c • x) (c • y) = edist x y

{M : Type u}
{X : Type w}
[PseudoEMetricSpace X]
[VAdd M X]
[IsometricVAdd M X]
(c : M)
(x y : X)


theorem Parallel.direction_eq {s₁ s₂ : AffineSubspace k P} (h : s₁ ∥ s₂) :
    s₁.direction = s₂.direction

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s₁ s₂ : AffineSubspace k P}
(h : s₁ ∥ s₂)


theorem condexpL2_comp_continuousLinearMap (hm : m ≤ m0) (T : E' →L[ℝ] E'') (f : α →₂[μ] E') :
    (condexpL2 E'' 𝕜' hm (T.compLp f) : α →₂[μ] E'') =ᵐ[μ]
    T.compLp (condexpL2 E' 𝕜 hm f : α →₂[μ] E')

{α : Type u_1}
{E' : Type u_3}
(𝕜 : Type u_7)
[RCLike 𝕜]
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
[CompleteSpace E']
[NormedSpace ℝ E']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E'' : Type u_8}
(𝕜' : Type u_9)
[RCLike 𝕜']
[NormedAddCommGroup E'']
[InnerProductSpace 𝕜' E'']
[CompleteSpace E'']
[NormedSpace ℝ E'']
(hm : m ≤ m0)
(T : E' →L[ℝ] E'')
(f : ↥(MeasureTheory.Lp E' 2 μ))

↑↑↑((MeasureTheory.condexpL2 E'' 𝕜' hm) (T.compLp f)) =ᵐ[μ] ↑↑(T.compLp ↑((MeasureTheory.condexpL2 E' 𝕜 hm) f))


@[to_additive]
theorem smooth_one [One M'] : Smooth I I' (1 : M → M')

{𝕜 : 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']
[Zero M']


theorem foldl_eq_foldlM (f : β → α → β) (b) (l : List α) :
    l.foldl f b = l.foldlM (m := Id) f b

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


@[to_additive (attr := measurability)]
theorem aestronglyMeasurable_one {α β} {_ : MeasurableSpace α} {μ : Measure α} [TopologicalSpace β]
    [One β] : AEStronglyMeasurable (1 : α → β) μ

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : TopologicalSpace β] [inst_1 : One β],
  MeasureTheory.AEStronglyMeasurable 1 μ


theorem uniqueDiffWithinAt_Ioi (a : ℝ) : UniqueDiffWithinAt ℝ (Ioi a) a


theorem MeasureTheory.AEStronglyMeasurable.comp_measurePreserving
    {γ : Type*} {_ : MeasurableSpace γ} {_ : MeasurableSpace α} {f : γ → α} {μ : Measure γ}
    {ν : Measure α} (hg : AEStronglyMeasurable g ν) (hf : MeasurePreserving f μ ν) :
    AEStronglyMeasurable (g ∘ f) μ

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace β]
{g : α → β}
{γ : Type u_4}

∀ {x : MeasurableSpace γ} {x_1 : MeasurableSpace α} {f : γ → α} {μ : MeasureTheory.Measure γ}
  {ν : MeasureTheory.Measure α},
  MeasureTheory.AEStronglyMeasurable g ν →
    MeasureTheory.MeasurePreserving f μ ν → MeasureTheory.AEStronglyMeasurable (g ∘ f) μ


theorem IsLocalMinOn.on_subset {t : Set α} (hf : IsLocalMinOn f t a) (h : s ⊆ t) :
    IsLocalMinOn f s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}
{t : Set α}
(hf : IsLocalMinOn f t a)
(h : s ⊆ t)


/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso [h' : Epi f.base] : IsIso f

{X Y : AlgebraicGeometry.PresheafedSpace C}

[H : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]


@[simp]
theorem toFinsupp_C (a : R) : (C a).toFinsupp = single 0 a

(Polynomial.C a).toFinsupp = AddMonoidAlgebra.single 0 a


@[to_additive] lemma AntivaryOn.mul_left (h₁ : AntivaryOn f₁ g s) (h₂ : AntivaryOn f₂ g s) :
    AntivaryOn (f₁ * f₂) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommGroup β]
{s : Set ι}
{f₁ f₂ : ι → α}
{g : ι → β}
(h₁ : AntivaryOn f₁ g s)
(h₂ : AntivaryOn f₂ g s)


@[to_additive]
theorem pairwise_disjoint_Ioo_zpow :
    Pairwise (Disjoint on fun n : ℤ => Ioo (b ^ n) (b ^ (n + 1)))

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

Pairwise (Disjoint on fun n => Set.Ioo (n • b) ((n + 1) • b))


theorem singleton_subset_set_iff {s : Set α} {a : α} : ↑({a} : Finset α) ⊆ s ↔ a ∈ s


@[to_additive]
theorem centralizer_le (h : S ⊆ T) : centralizer T ≤ centralizer S

{M : Type u_1}
{S T : Set M}
[Semigroup M]
(h : S ⊆ T)

Subsemigroup.centralizer T ≤ Subsemigroup.centralizer S


/-- A strong natural transformation between oplax functors `F` and `G` is a natural transformation
that is "natural up to 2-isomorphisms".

More precisely, it consists of the following:
* a 1-morphism `η.app a : F.obj a ⟶ G.obj a` for each object `a : B`.
* a 2-isomorphism `η.naturality f : F.map f ≫ app b ⟶ app a ≫ G.map f` for each 1-morphism
`f : a ⟶ b`.
* These 2-isomorphisms satisfy the naturality condition, and preserve the identities and the
compositions modulo some adjustments of domains and codomains of 2-morphisms.
-/
structure StrongOplaxNatTrans (F G : OplaxFunctor B C) where
  app (a : B) : F.obj a ⟶ G.obj a
  naturality {a b : B} (f : a ⟶ b) : F.map f ≫ app b ≅ app a ≫ G.map f
  naturality_naturality :
    ∀ {a b : B} {f g : a ⟶ b} (η : f ⟶ g),
      F.map₂ η ▷ app b ≫ (naturality g).hom = (naturality f).hom ≫ app a ◁ G.map₂ η := by
    aesop_cat
  naturality_id :
    ∀ a : B,
      (naturality (𝟙 a)).hom ≫ app a ◁ G.mapId a =
        F.mapId a ▷ app a ≫ (λ_ (app a)).hom ≫ (ρ_ (app a)).inv := by
    aesop_cat
  naturality_comp :
    ∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c),
      (naturality (f ≫ g)).hom ≫ app a ◁ G.mapComp f g =
        F.mapComp f g ▷ app c ≫ (α_ _ _ _).hom ≫ F.map f ◁ (naturality g).hom ≫
        (α_ _ _ _).inv ≫ (naturality f).hom ▷ G.map g ≫ (α_ _ _ _).hom := by
    aesop_cat

(self : CategoryTheory.StrongOplaxNatTrans F G)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (F.map₂ η) (self.app b))
    (self.naturality g).hom =
  CategoryTheory.CategoryStruct.comp (self.naturality f).hom
    (CategoryTheory.Bicategory.whiskerLeft (self.app a) (G.map₂ η))


@[to_additive]
theorem eq_of_eqOn_dense {s : Set G} (hs : closure s = ⊤) {f g : G →* M} (h : s.EqOn f g) : f = g

{G : Type u_1}
[Group G]
{M : Type u_7}
[Monoid M]
{s : Set G}
(hs : Subgroup.closure s = ⊤)
{f g : G →* M}
(h : Set.EqOn (⇑f) (⇑g) s)


lemma of_commSq {R S : 𝒮} {a b : 𝒳} (f : R ⟶ S) (φ : a ⟶ b) (ha : p.obj a = R) (hb : p.obj b = S)
    (h : CommSq (p.map φ) (eqToHom ha) (eqToHom hb) f) : p.IsHomLift f φ

(h : CategoryTheory.CommSq (p.map φ) (CategoryTheory.eqToHom ha) (CategoryTheory.eqToHom hb) f)


/-- `erase p n` is the polynomial `p` in which the `X^n` term has been erased. -/
irreducible_def erase (n : ℕ) : R[X] → R[X]

∀ (x : R[X]),
  Polynomial.erase n x =
    match x with
    | { toFinsupp := p } => { toFinsupp := Finsupp.erase n p }


@[to_additive const_smul]
theorem EventuallyEq.pow_const {γ} [Pow β γ] {f g : α → β} {l : Filter α} (h : f =ᶠ[l] g) (c : γ) :
    (fun x => f x ^ c) =ᶠ[l] fun x => g x ^ c

{α : Type u}
{β : Type v}
{γ : Type u_2}
[SMul γ β]
{f g : α → β}
{l : Filter α}
(h : f =ᶠ[l] g)
(c : γ)

(fun x => c • f x) =ᶠ[l] fun x => c • g x


/-- The *identity principle* for analytic functions, global version: if two functions are
analytic on a connected set `U` and coincide at points which accumulate to a point `z₀ ∈ U`, then
they coincide globally in `U`.
For higher-dimensional versions requiring that the functions coincide in a neighborhood of `z₀`,
see `AnalyticOn.eqOn_of_preconnected_of_eventuallyEq`. -/
theorem eqOn_of_preconnected_of_frequently_eq (hf : AnalyticOn 𝕜 f U) (hg : AnalyticOn 𝕜 g U)
    (hU : IsPreconnected U) (h₀ : z₀ ∈ U) (hfg : ∃ᶠ z in 𝓝[≠] z₀, f z = g z) : EqOn f g U

(hfg : ∃ᶠ (z : 𝕜) in 𝓝[≠] z₀, f z = g z)


theorem HasDerivAt.hasGradientAt (h : HasDerivAt g g' u) :
    HasGradientAt g (starRingEnd 𝕜 g') u

{𝕜 : Type u_1}
[RCLike 𝕜]
{g : 𝕜 → 𝕜}
{g' u : 𝕜}
(h : HasDerivAt g g' u)


/-- This calculates the differences between the values of a multilinear map at
two arguments that differ on a finset `s` of `ι`. It requires a
linear order on `ι` in order to express the result. -/
lemma map_piecewise_sub_map_piecewise [LinearOrder ι] (a b v : (i : ι) → M₁ i) (s : Finset ι) :
    f (s.piecewise a v) - f (s.piecewise b v) = ∑ i ∈ s, f
      fun j ↦ if j ∈ s then if j < i then a j else if j = i then a j - b j else b j else v j

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommGroup (M₁ i)]
[AddCommGroup M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
[LinearOrder ι]
(a b v : (i : ι) → M₁ i)
(s : Finset ι)

f (s.piecewise a v) - f (s.piecewise b v) =
  ∑ i ∈ s, f fun j => if j ∈ s then if j < i then a j else if j = i then a j - b j else b j else v j


/-- Given an ideal `I` of a Lie algebra `L`, the lower central series of `L ⧸ I` is the same
whether we regard `L ⧸ I` as an `L` module or an `L ⧸ I` module.

TODO: This result obviously generalises but the generalisation requires the missing definition of
morphisms between Lie modules over different Lie algebras. -/
-- Porting note: added `LieSubmodule.toSubmodule` in the statement
theorem coe_lowerCentralSeries_ideal_quot_eq {I : LieIdeal R L} (k : ℕ) :
    LieSubmodule.toSubmodule (lowerCentralSeries R L (L ⧸ I) k) =
      LieSubmodule.toSubmodule (lowerCentralSeries R (L ⧸ I) (L ⧸ I) k)

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

↑(LieModule.lowerCentralSeries R L (L ⧸ I) k) = ↑(LieModule.lowerCentralSeries R (L ⧸ I) (L ⧸ I) k)


@[simp]
lemma ofHomotopy_refl (φ : F ⟶ G) :
    ofHomotopy (Homotopy.refl φ) = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{F G : CochainComplex C ℤ}
(φ : F ⟶ G)

CochainComplex.HomComplex.Cochain.ofHomotopy (Homotopy.refl φ) = 0


theorem zero_not_mem_iff {a : A} : (0 : R) ∉ σ a ↔ IsUnit a

(R : Type u)
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
{a : A}


theorem le_card_nonuniformWitness (h : ¬G.IsUniform ε s t) :
    (s.card : 𝕜) * ε ≤ (G.nonuniformWitness ε s t).card

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : 𝕜}
{s t : Finset α}
(h : ¬G.IsUniform ε s t)

↑s.card * ε ≤ ↑(G.nonuniformWitness ε s t).card


/-- Constructor for a morphism `K ⟶ L` in the category `HomologicalComplex₂ C c₁ c₂` which
takes as inputs a morphism `f : K.toGradedObject ⟶ L.toGradedObject` and
the compatibilites with both horizontal and vertical differentials. -/
@[simps!]
def homMk {K L : HomologicalComplex₂ C c₁ c₂}
    (f : K.toGradedObject ⟶ L.toGradedObject)
    (comm₁ : ∀ i₁ i₁' i₂, c₁.Rel i₁ i₁' →
      f ⟨i₁, i₂⟩ ≫ (L.d i₁ i₁').f i₂ = (K.d i₁ i₁').f i₂ ≫ f ⟨i₁', i₂⟩)
    (comm₂ : ∀ i₁ i₂ i₂', c₂.Rel i₂ i₂' →
      f ⟨i₁, i₂⟩ ≫ (L.X i₁).d i₂ i₂' = (K.X i₁).d i₂ i₂' ≫ f ⟨i₁, i₂'⟩) : K ⟶ L

(comm₁ : ∀ (i₁ i₁' : I₁) (i₂ : I₂), c₁.Rel i₁ i₁' → f (i₁, i₂) ≫ (L.d i₁ i₁').f i₂ = (K.d i₁ i₁').f i₂ ≫ f (i₁', i₂))

(comm₂ : ∀ (i₁ : I₁) (i₂ i₂' : I₂), c₂.Rel i₂ i₂' → f (i₁, i₂) ≫ (L.X i₁).d i₂ i₂' = (K.X i₁).d i₂ i₂' ≫ f (i₁, i₂'))

((HomologicalComplex₂.homMk f comm₁ comm₂).f i₁).f i₂ = f (i₁, i₂)


@[simp]
lemma rightShift_smul (a n' : ℤ) (hn' : n' + a = n) (x : R) :
    (x • γ).rightShift a n' hn' = x • γ.rightShift a n' hn'

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


theorem sInter_union_sInter {S T : Set (Set α)} :
    ⋂₀ S ∪ ⋂₀ T = ⋂ p ∈ S ×ˢ T, (p : Set α × Set α).1 ∪ p.2


theorem ker_evalₗ [Finite σ] : ker (evalᵢ σ K) = ⊥

(σ K : Type u)
[Fintype K]
[Field K]
[Finite σ]

LinearMap.ker (MvPolynomial.evalᵢ σ K) = ⊥


/-- Given a linear map `f : M →ₗ[R] A` into an `R`-algebra `A`, which satisfies the condition:
`cond : ∀ m : M, f m * f m = 0`, this is the canonical lift of `f` to a morphism of `R`-algebras
from `ExteriorAlgebra R M` to `A`.
-/
@[simps! symm_apply]
def lift : { f : M →ₗ[R] A // ∀ m, f m * f m = 0 } ≃ (ExteriorAlgebra R M →ₐ[R] A)

(R : Type u1)
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{A : Type u_1}
[Semiring A]
[Algebra R A]

∀ (a : ExteriorAlgebra R M →ₐ[R] A), (ExteriorAlgebra.lift R).symm a = ⟨↑((CliffordAlgebra.lift 0).symm a), ⋯⟩


theorem Subalgebra.le_topologicalClosure (s : Subalgebra R A) : s ≤ s.topologicalClosure

{R : Type u_1}
[CommSemiring R]
{A : Type u}
[TopologicalSpace A]
[Semiring A]
[Algebra R A]
[TopologicalSemiring A]
(s : Subalgebra R A)


/-- The factorisation of a morphism through its abelian image. -/
@[simps]
def imageMonoFactorisation {X Y : C} (f : X ⟶ Y) : MonoFactorisation f

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

(CategoryTheory.Abelian.OfCoimageImageComparisonIsIso.imageMonoFactorisation f).m =
  CategoryTheory.Limits.kernel.ι (CategoryTheory.Limits.cokernel.π f)


/-- A version of `toNat_eq_iff` for literals -/
theorem toNat_eq_ofNat {n : ℕ} [Nat.AtLeastTwo n] :
    toNat c = OfNat.ofNat n ↔ c = OfNat.ofNat n

{c : Cardinal.{u}}
{n : ℕ}
[n.AtLeastTwo]

Cardinal.toNat c = OfNat.ofNat n ↔ c = OfNat.ofNat n


/-- The class `DFunLike F α β` expresses that terms of type `F` have an
injective coercion to (dependent) functions from `α` to `β`.

For non-dependent functions you can also use the abbreviation `FunLike`.

This typeclass is used in the definition of the homomorphism typeclasses,
such as `ZeroHomClass`, `MulHomClass`, `MonoidHomClass`, ....
-/
@[notation_class * toFun Simps.findCoercionArgs]
class DFunLike (F : Sort*) (α : outParam (Sort*)) (β : outParam <| α → Sort*) where
  /-- The coercion from `F` to a function. -/
  coe : F → ∀ a : α, β a
  /-- The coercion to functions must be injective. -/
  coe_injective' : Function.Injective coe

{F : Sort u_1}
{α : outParam (Sort u_2)}
{β : outParam (α → Sort u_3)}
[self : DFunLike F α β]


theorem elim_toOption {α β : Type*} (a : Part α) [Decidable a.Dom] (b : β) (f : α → β) :
    a.toOption.elim b f = if h : a.Dom then f (a.get h) else b

{α : Type u_4}
{β : Type u_5}
(a : Part α)
[Decidable a.Dom]
(b : β)
(f : α → β)


@[simp]
theorem filter_add [∀ i, AddZeroClass (β i)] (p : ι → Prop) [DecidablePred p] (f g : Π₀ i, β i) :
    (f + g).filter p = f.filter p + g.filter p

{ι : Type u}
{β : ι → Type v}
[(i : ι) → AddZeroClass (β i)]
(p : ι → Prop)
[DecidablePred p]
(f g : Π₀ (i : ι), β i)

DFinsupp.filter p (f + g) = DFinsupp.filter p f + DFinsupp.filter p g


@[to_additive]
theorem tendsto_div_nhds_one_iff {α : Type*} {l : Filter α} {x : G} {u : α → G} :
    Tendsto (u · / x) l (𝓝 1) ↔ Tendsto u l (𝓝 x)

{G : Type w}
[AddGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
{α : Type u_1}
{l : Filter α}
{x : G}
{u : α → G}

Filter.Tendsto (fun x_1 => u x_1 - x) l (𝓝 0) ↔ Filter.Tendsto u l (𝓝 x)


theorem GammaSeq_mul (z : ℂ) {n : ℕ} (hn : n ≠ 0) :
    GammaSeq z n * GammaSeq (1 - z) n =
      n / (n + ↑1 - z) * (↑1 / (z * ∏ j ∈ Finset.range n, (↑1 - z ^ 2 / ((j : ℂ) + 1) ^ 2)))

z.GammaSeq n * (1 - z).GammaSeq n = ↑n / (↑n + 1 - z) * (1 / (z * ∏ j ∈ Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)))


@[mono]
theorem map_le_map {g : α →o β} (h : f ≤ g) : c.map f ≤ c.map g

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
(c : OmegaCompletePartialOrder.Chain α)
{f g : α →o β}
(h : f ≤ g)


theorem le_multiplicity_of_pow_dvd {a b : α} {k : ℕ} (hk : a ^ k ∣ b) :
    (k : PartENat) ≤ multiplicity a b

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}
{k : ℕ}
(hk : a ^ k ∣ b)


@[simp] lemma map_apply (p : RelSeries r) (f : r →r s) (i : Fin (p.length + 1)) :
    p.map f i = f (p i)

{α : Type u_1}
{r : Rel α α}
{β : Type u_2}
{s : Rel β β}
(p : RelSeries r)
(f : r →r s)
(i : Fin (p.length + 1))


@[simp]
theorem coe_keys {l : List (Sigma β)} : keys (l : Multiset (Sigma β)) = (l.keys : Multiset α)

{α : Type u}
{β : α → Type v}
{l : List (Sigma β)}


theorem mem_fix_iff {f : α →. β ⊕ α} {a : α} {b : β} :
    b ∈ f.fix a ↔ Sum.inl b ∈ f a ∨ ∃ a', Sum.inr a' ∈ f a ∧ b ∈ f.fix a'

{α : Type u_1}
{β : Type u_2}
{f : α →. β ⊕ α}
{a : α}
{b : β}


lemma IsLocallyClosed.isOpen_preimage_val_closure (hs : IsLocallyClosed s) :
    IsOpen (closure s ↓∩ s)

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(hs : IsLocallyClosed s)


theorem _root_.Memℓp.infty_pow {f : ∀ i, B i} (hf : Memℓp f ∞) (n : ℕ) : Memℓp (f ^ n) ∞

{I : Type u_3}
{B : I → Type u_4}
[(i : I) → NormedRing (B i)]
[∀ (i : I), NormOneClass (B i)]
{f : (i : I) → B i}
(hf : Memℓp f ⊤)
(n : ℕ)


/-- **AM-GM inequality**: The geometric mean is less than or equal to the arithmetic mean, weighted
version for `NNReal`-valued functions. -/
theorem geom_mean_le_arith_mean_weighted (w z : ι → ℝ≥0) (hw' : ∑ i ∈ s, w i = 1) :
    (∏ i ∈ s, z i ^ (w i : ℝ)) ≤ ∑ i ∈ s, w i * z i

{ι : Type u}
(s : Finset ι)
(w z : ι → ℝ≥0)
(hw' : ∑ i ∈ s, w i = 1)

∏ i ∈ s, z i ^ ↑(w i) ≤ ∑ i ∈ s, w i * z i


lemma isIso_π (hf : S.f = 0) : IsIso h.π


@[simp]
theorem comap_bot (f : F) : comap f ⊥ = ker f

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_6}
{M₂ : Type u_8}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_12}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
(f : F)


theorem swap_eq_iff_eq_swap {o o' : Ordering} : o.swap = o' ↔ o = o'.swap


/-- The maximal atlas of a structure groupoid is stable under equivalence. -/
lemma StructureGroupoid.mem_maximalAtlas_of_eqOnSource {e e' : PartialHomeomorph M H} (h : e' ≈ e)
    (he : e ∈ G.maximalAtlas M) : e' ∈ G.maximalAtlas M

(he : e ∈ StructureGroupoid.maximalAtlas M G)


theorem pi_lt_sqrtTwoAddSeries (n : ℕ) :
    π < (2 : ℝ) ^ (n + 1) * √(2 - sqrtTwoAddSeries 0 n) + 1 / (4 : ℝ) ^ n

π < 2 ^ (n + 1) * √(2 - Real.sqrtTwoAddSeries 0 n) + 1 / 4 ^ n


theorem subsingleton_isTop (α : Type*) [PartialOrder α] : Set.Subsingleton { x : α | IsTop x }


@[simp]
theorem mapToFractionRing_apply {B : Type*} [CommRing B] [Algebra A B] [IsLocalization S B]
    (hS : S ≤ A⁰) (b : B) :
    mapToFractionRing K S B hS b = IsLocalization.lift (map_isUnit_of_le K S hS) b

{A : Type u_1}
(K : Type u_2)
[CommRing A]
(S : Submonoid A)
[CommRing K]
[Algebra A K]
[IsFractionRing A K]
{B : Type u_3}
[CommRing B]
[Algebra A B]
[IsLocalization S B]
(hS : S ≤ nonZeroDivisors A)
(b : B)

(Localization.mapToFractionRing K S B hS) b = (IsLocalization.lift ⋯) b


@[simp] lemma smoothSheafCommRing.evalHom_germ (U : Opens (TopCat.of M)) (x : U)
    (f : (smoothSheafCommRing IM I M R).presheaf.obj (op U)) :
    smoothSheafCommRing.evalHom IM I M R (x : TopCat.of M)
      ((smoothSheafCommRing IM I M R).presheaf.germ x f)
    = f x

(U : TopologicalSpace.Opens ↑(TopCat.of M))

(f : ↑((smoothSheafCommRing IM I M R).presheaf.obj (Opposite.op U)))

(smoothSheafCommRing.evalHom IM I M R ↑x) (((smoothSheafCommRing IM I M R).presheaf.germ x) f) = ↑f x


lemma biUnion_compl_eq_of_pairwise_disjoint_of_iUnion_eq_univ {ι : Type*} {Es : ι → Set α}
    (Es_union : ⋃ i, Es i = univ) (Es_disj : Pairwise fun i j ↦ Disjoint (Es i) (Es j))
    (I : Set ι) :
    (⋃ i ∈ I, Es i)ᶜ = ⋃ i ∈ Iᶜ, Es i

(Es_disj : Pairwise fun i j => Disjoint (Es i) (Es j))


@[to_additive]
theorem map_surjective_of_surjective : Function.Surjective (map f)

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


/-- A Grönwall-like inequality: if `f : ℝ → E` is continuous on `[a, b]`, has right derivative
`f' x` at every point `x ∈ [a, b)`, and satisfies the inequalities `‖f a‖ ≤ δ`,
`∀ x ∈ [a, b), ‖f' x‖ ≤ K * ‖f x‖ + ε`, then `‖f x‖` is bounded by `gronwallBound δ K ε (x - a)`
on `[a, b]`. -/
theorem norm_le_gronwallBound_of_norm_deriv_right_le {f f' : ℝ → E} {δ K ε : ℝ} {a b : ℝ}
    (hf : ContinuousOn f (Icc a b)) (hf' : ∀ x ∈ Ico a b, HasDerivWithinAt f (f' x) (Ici x) x)
    (ha : ‖f a‖ ≤ δ) (bound : ∀ x ∈ Ico a b, ‖f' x‖ ≤ K * ‖f x‖ + ε) :
    ∀ x ∈ Icc a b, ‖f x‖ ≤ gronwallBound δ K ε (x - a)

(hf' : ∀ x ∈ Set.Ico a b, HasDerivWithinAt f (f' x) (Set.Ici x) x)

(bound : ∀ x ∈ Set.Ico a b, ‖f' x‖ ≤ K * ‖f x‖ + ε)

x ∈ Set.Icc a b → ‖f x‖ ≤ gronwallBound δ K ε (x - a)


@[to_additive (attr := simp)] lemma inv_mul_cancel_comm (a b : G) : a⁻¹ * b * a = b


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

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

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


@[to_additive]
theorem one {U : Set G} : U ∈ B → (1 : G) ∈ U

{G : Type u}
[AddGroup G]
{B : AddGroupFilterBasis G}
{U : Set G}


/-- if we have a solution to `a ^ 4 + b ^ 4 = c ^ 2` then there must be a minimal one. -/
theorem exists_minimal {a b c : ℤ} (h : Fermat42 a b c) : ∃ a0 b0 c0, Minimal a0 b0 c0


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


/-- For the single implications with fewer assumptions, see `one_div_le_one_div_of_le` and
  `le_of_one_div_le_one_div` -/
theorem one_div_le_one_div (ha : 0 < a) (hb : 0 < b) : 1 / a ≤ 1 / b ↔ b ≤ a

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


/-- If `g, h ≤ f` and `g i + h i ≤ f i`, then the product of `f` over `s` is at least the
  sum of the products of `g` and `h`. This is the version for `OrderedCommSemiring`. -/
lemma prod_add_prod_le {i : ι} {f g h : ι → R} (hi : i ∈ s) (h2i : g i + h i ≤ f i)
    (hgf : ∀ j ∈ s, j ≠ i → g j ≤ f j) (hhf : ∀ j ∈ s, j ≠ i → h j ≤ f j) (hg : ∀ i ∈ s, 0 ≤ g i)
    (hh : ∀ i ∈ s, 0 ≤ h i) : ((∏ i ∈ s, g i) + ∏ i ∈ s, h i) ≤ ∏ i ∈ s, f i

{ι : Type u_1}
{R : Type u_2}
[OrderedCommSemiring R]
{s : Finset ι}
{i : ι}
{f g h : ι → R}
(hi : i ∈ s)
(h2i : g i + h i ≤ f i)
(hgf : ∀ j ∈ s, j ≠ i → g j ≤ f j)
(hhf : ∀ j ∈ s, j ≠ i → h j ≤ f j)
(hg : ∀ i ∈ s, 0 ≤ g i)
(hh : ∀ i ∈ s, 0 ≤ h i)

∏ i ∈ s, g i + ∏ i ∈ s, h i ≤ ∏ i ∈ s, f i


@[to_additive]
theorem injective_noncommPiCoprod_of_independent
    {hcomm : Pairwise fun i j : ι => ∀ (x : H i) (y : H j), Commute (ϕ i x) (ϕ j y)}
    (hind : CompleteLattice.Independent fun i => (ϕ i).range)
    (hinj : ∀ i, Function.Injective (ϕ i)) : Function.Injective (noncommPiCoprod ϕ hcomm)

{hcomm : Pairwise fun i j => ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y)}

(hinj : ∀ (i : ι), Function.Injective ⇑(ϕ i))

Function.Injective ⇑(MonoidHom.noncommPiCoprod ϕ hcomm)


theorem vecMul_sub [Fintype m] (A B : Matrix m n α) (x : m → α) :
    x ᵥ* (A - B) = x ᵥ* A - x ᵥ* B

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocRing α]
[Fintype m]
(A B : Matrix m n α)
(x : m → α)


theorem bound [RingHomIsometric σ₁₂] (f : E →SL[σ₁₂] F) : ∃ C, 0 < C ∧ ∀ x : E, ‖f x‖ ≤ C * ‖x‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)


@[to_additive]
theorem tprod_lt_tprod (h : f ≤ g) (hi : f i < g i) (hf : Multipliable f) (hg : Multipliable g) :
    ∏' n, f n < ∏' n, g n

{ι : Type u_1}
{α : Type u_3}
[OrderedCommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
[OrderClosedTopology α]
{f g : ι → α}
{i : ι}
(h : f ≤ g)
(hi : f i < g i)
(hf : Multipliable f)
(hg : Multipliable g)


theorem le_max_of_le_left : a ≤ b → a ≤ max b c

{α : Type u}
[LinearOrder α]
{a b c : α}


theorem regularSpace_iInf {ι X} {t : ι → TopologicalSpace X} (h : ∀ i, @RegularSpace X (t i)) :
    @RegularSpace X (iInf t)

{ι : Sort u_3}
{X : Type u_4}
{t : ι → TopologicalSpace X}
(h : ∀ (i : ι), RegularSpace X)


theorem two_sinh : 2 * sinh x = exp x - exp (-x)

2 * Complex.sinh x = Complex.exp x - Complex.exp (-x)


theorem continuous_uncurry : Continuous <| monotoneUncurry α β γ

[(x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)]

OmegaCompletePartialOrder.Continuous (Pi.monotoneUncurry α β γ)


theorem eq_univ_of_nonempty {s : Set α} : s.Nonempty → s = univ

{α : Type u_1}
[Subsingleton α]
{s : Set α}


theorem exp_list_sum (l : List ℝ) : exp l.sum = (l.map exp).prod

Real.exp l.sum = (List.map Real.exp l).prod


@[to_additive]
theorem Nonempty.inv (h : s.Nonempty) : s⁻¹.Nonempty

{α : Type u_2}
[InvolutiveInv α]
{s : Set α}
(h : s.Nonempty)


/-- An `M : IndepMatroid α` gives a `Matroid α` whose bases are the maximal `M`-independent sets. -/
@[simps] protected def matroid (M : IndepMatroid α) : Matroid α

∀ (x : Set α), M.matroid.Base x = (x ∈ maximals (fun x x_1 => x ⊆ x_1) {I | M.Indep I})


@[to_additive (attr := simp)]
theorem range_subtype (s : Subsemigroup M) : (MulMemClass.subtype s).srange = s

{M : Type u_1}
[Add M]
(s : AddSubsemigroup M)


theorem carrier.relevant : ¬HomogeneousIdeal.irrelevant 𝒜 ≤ carrier.asHomogeneousIdeal f_deg hm q

(q :
  ↑↑(AlgebraicGeometry.Spec.locallyRingedSpaceObj
          (CommRingCat.of (HomogeneousLocalization.Away 𝒜 f))).toPresheafedSpace)

¬HomogeneousIdeal.irrelevant 𝒜 ≤
    AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.carrier.asHomogeneousIdeal f_deg hm q


protected theorem le_antisymm {a b : Int} (h₁ : a ≤ b) (h₂ : b ≤ a) : a = b


lemma sum_map_mul_left : (l.map fun b ↦ r * f b).sum = r * (l.map f).sum

{ι : Type u_1}
{R : Type u_5}
[NonUnitalNonAssocSemiring R]
(l : List ι)
(f : ι → R)
(r : R)

(List.map (fun b => r * f b) l).sum = r * (List.map f l).sum


theorem Decidable.and_not_or_not_and_of_not_iff [Decidable a] [Decidable b]
    (h : ¬ (a ↔ b)) : a ∧ ¬b ∨ ¬a ∧ b

{a b : Prop}
[Decidable a]
[Decidable b]
(h : ¬(a ↔ b))

a ∧ ¬b ∨ ¬a ∧ b


theorem term_add_term {α} [AddCommMonoid α] (n₁ x a₁ n₂ a₂ n' a') (h₁ : n₁ + n₂ = n')
    (h₂ : a₁ + a₂ = a') : @term α _ n₁ x a₁ + @term α _ n₂ x a₂ = term n' x a'

{α : Type u_1}
[AddCommMonoid α]
(n₁ : ℕ)
(x a₁ : α)
(n₂ : ℕ)
(a₂ : α)
(n' : ℕ)
(a' : α)
(h₁ : n₁ + n₂ = n')
(h₂ : a₁ + a₂ = a')

Mathlib.Tactic.Abel.term n₁ x a₁ + Mathlib.Tactic.Abel.term n₂ x a₂ = Mathlib.Tactic.Abel.term n' x a'


theorem ACounit_C (a : A) : ACounit A B (C a) = algebraMap A B a

{A : Type u_1}
(B : Type u_2)
[CommSemiring A]
[CommSemiring B]
[Algebra A B]
(a : A)

(MvPolynomial.ACounit A B) (MvPolynomial.C a) = (algebraMap A B) a


@[csimp] theorem ofFn_eq_ofFnTR : @ofFn = @ofFnTR

(α : Type u_1)
(n : Nat)
(f : Fin n → α)
(i j : Nat)
(h : i + j = n)
(h' : j ≤ n)

List.ofFnTR.go f j h' (List.ofFn.go f i j h) = List.ofFn f


@[simp]
theorem fderiv_csinh (hc : DifferentiableAt ℂ f x) :
    fderiv ℂ (fun x => Complex.sinh (f x)) x = Complex.cosh (f x) • fderiv ℂ f x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
(hc : DifferentiableAt ℂ f x)


@[simp]
theorem comp_right_top (r : Rel α β) : r • (⊤ : Rel β γ) = fun x _ ↦ x ∈ r.dom

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(r : Rel α β)


theorem liftPropOn_chart [HasGroupoid M G] (hG : G.LocalInvariantProp G Q) (hQ : ∀ y, Q id univ y) :
    LiftPropOn Q (chartAt (H := H) x) (chartAt (H := H) x).source

{H : Type u_1}
{M : Type u_2}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
{G : StructureGroupoid H}
{x : M}
{Q : (H → H) → Set H → H → Prop}
[HasGroupoid M G]
(hG : G.LocalInvariantProp G Q)
(hQ : ∀ (y : H), Q id Set.univ y)

ChartedSpace.LiftPropOn Q (↑(chartAt H x)) (chartAt H x).source


theorem nndist_le (hf : HolderWith C r f) (x y : X) :
    nndist (f x) (f y) ≤ C * nndist x y ^ (r : ℝ)

{X : Type u_1}
{Y : Type u_2}
[PseudoMetricSpace X]
[PseudoMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
(hf : HolderWith C r f)
(x y : X)

nndist (f x) (f y) ≤ C * nndist x y ^ ↑r


/-- A family with at most one point is convex independent. -/
theorem Subsingleton.convexIndependent [Subsingleton ι] (p : ι → E) : ConvexIndependent 𝕜 p

{𝕜 : Type u_1}
{E : Type u_2}
{ι : Type u_3}
[OrderedSemiring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Subsingleton ι]
(p : ι → E)


@[instance]
theorem isCountablyGenerated_pure (a : α) : IsCountablyGenerated (pure a)


theorem condexp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.restrict s] 0) :
    μ[f|m] =ᵐ[μ.restrict s] 0

{α : Type u_1}
{E : Type u_3}
{m m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{μ : MeasureTheory.Measure α}
{f : α → E}
{s : Set α}
(hs : MeasurableSet s)
(hf : f =ᵐ[μ.restrict s] 0)


theorem add_sub_cancel (a b : Ordinal) : a + b - a = b


/-- A product of finite terms is finite. -/
lemma prod_lt_bot [CommMonoidWithZero α] [NoZeroDivisors α] [Nontrivial α] [DecidableEq α] [LT α]
    {s : Finset ι} {f : ι → WithBot α} (h : ∀ i ∈ s, f i ≠ ⊥) : ⊥ < ∏ i ∈ s, f i

{ι : Type u_1}
{α : Type u_2}
[CommMonoidWithZero α]
[NoZeroDivisors α]
[Nontrivial α]
[DecidableEq α]
[LT α]
{s : Finset ι}
{f : ι → WithBot α}
(h : ∀ i ∈ s, f i ≠ ⊥)


theorem blockDiagonal'_apply (M : ∀ i, Matrix (m' i) (n' i) α) (ik jk) :
    blockDiagonal' M ik jk =
      if h : ik.1 = jk.1 then M ik.1 ik.2 (cast (congr_arg n' h.symm) jk.2) else 0

{o : Type u_4}
{m' : o → Type u_7}
{n' : o → Type u_8}
{α : Type u_12}
[DecidableEq o]
[Zero α]
(M : (i : o) → Matrix (m' i) (n' i) α)
(ik : (i : o) × m' i)
(jk : (i : o) × n' i)

Matrix.blockDiagonal' M ik jk = if h : ik.fst = jk.fst then M ik.fst ik.snd (cast ⋯ jk.snd) else 0


theorem Valid'.balance' {l} {x : α} {r o₁ o₂} (hl : Valid' o₁ l x) (hr : Valid' x r o₂)
    (H : ∃ l' r', BalancedSz l' r' ∧
          (Nat.dist (size l) l' ≤ 1 ∧ size r = r' ∨ Nat.dist (size r) r' ≤ 1 ∧ size l = l')) :
    Valid' o₁ (@balance' α l x r) o₂

(H : ∃ l' r', Ordnode.BalancedSz l' r' ∧ (l.size.dist l' ≤ 1 ∧ r.size = r' ∨ r.size.dist r' ≤ 1 ∧ l.size = l'))


theorem normalizedFactors_irreducible {a : α} (ha : Irreducible a) :
    normalizedFactors a = {normalize a}

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]
{a : α}
(ha : Irreducible a)

UniqueFactorizationMonoid.normalizedFactors a = {normalize a}


theorem Real.Icc_eq_closedBall (x y : ℝ) : Icc x y = closedBall ((x + y) / 2) ((y - x) / 2)

Set.Icc x y = Metric.closedBall ((x + y) / 2) ((y - x) / 2)


@[simp]
theorem localization_toBasicOpen (f : R) :
    RingHom.comp (toBasicOpen R f) (algebraMap R (Localization.Away f)) =
    toOpen R (PrimeSpectrum.basicOpen f)

(AlgebraicGeometry.StructureSheaf.toBasicOpen R f).comp (algebraMap R (Localization.Away f)) =
  AlgebraicGeometry.StructureSheaf.toOpen R (PrimeSpectrum.basicOpen f)


@[simp] theorem ofBool_true  : ofBool true  = 1


theorem tsub_le_tsub_iff_left (h : c ≤ a) : a - b ≤ a - c ↔ c ≤ b

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


theorem mem_cons_self (a : α) (s : Finset α) {h} : a ∈ cons a s h

{α : Type u_1}
(a : α)
(s : Finset α)
{h : a ∉ s}


/-- A least element of a set is the infimum of this set. -/
theorem IsLeast.csInf_eq (H : IsLeast s a) : sInf s = a

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
{a : α}
(H : IsLeast s a)


theorem cgf_undef (hX : ¬Integrable (fun ω => exp (t * X ω)) μ) : cgf X μ t = 0

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


@[simp]
theorem id_f (X : DifferentialObject S C) : (𝟙 X : X ⟶ X).f = 𝟙 X.obj

(X : CategoryTheory.DifferentialObject S C)

(CategoryTheory.CategoryStruct.id X).f = CategoryTheory.CategoryStruct.id X.obj


@[simp]
lemma mul_fromColumns (A : Matrix m n R) (B₁ : Matrix n n₁ R) (B₂ : Matrix n n₂ R) :
    A * fromColumns B₁ B₂ = fromColumns (A * B₁) (A * B₂)

{R : Type u_1}
{m : Type u_2}
{n : Type u_5}
{n₁ : Type u_6}
{n₂ : Type u_7}
[Fintype n]
[Semiring R]
(A : Matrix m n R)
(B₁ : Matrix n n₁ R)
(B₂ : Matrix n n₂ R)

A * B₁.fromColumns B₂ = (A * B₁).fromColumns (A * B₂)


lemma exact_iff :
    Exact f g ↔ ker g = range f

{M : Type u_2}
{N : Type u_4}
{P : Type u_6}
[AddGroup M]
[AddGroup N]
[AddGroup P]
{f : M →+ N}
{g : N →+ P}


lemma div_div (a b c : EReal) : a / b / c = a / (b * c)


@[simp]
theorem empty_vsub (t : Finset β) : (∅ : Finset β) -ᵥ t = ∅

{α : Type u_2}
{β : Type u_3}
[VSub α β]
[DecidableEq α]
(t : Finset β)


theorem centerAndRescale_radius {N : ℕ} {τ : ℝ} (a : SatelliteConfig E N τ) :
    a.centerAndRescale.r (last N) = 1

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{N : ℕ}
{τ : ℝ}
(a : Besicovitch.SatelliteConfig E N τ)


protected theorem measurableSet_le' (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[hτ.measurableSpace] {ω | τ ω ≤ i}

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


theorem HasBasis.prod_same_index_anti {ι : Type*} [LinearOrder ι] {p : ι → Prop} {sa : ι → Set α}
    {sb : ι → Set β} (hla : la.HasBasis p sa) (hlb : lb.HasBasis p sb)
    (hsa : AntitoneOn sa { i | p i }) (hsb : AntitoneOn sb { i | p i }) :
    (la ×ˢ lb).HasBasis p fun i => sa i ×ˢ sb i

{α : Type u_1}
{β : Type u_2}
{la : Filter α}
{lb : Filter β}
{ι : Type u_6}
[LinearOrder ι]
{p : ι → Prop}
{sa : ι → Set α}
{sb : ι → Set β}
(hla : la.HasBasis p sa)
(hlb : lb.HasBasis p sb)
(hsa : AntitoneOn sa {i | p i})
(hsb : AntitoneOn sb {i | p i})


theorem card_support_eq' {n : ℕ} (k : Fin n → ℕ) (x : Fin n → R) (hk : Function.Injective k)
    (hx : ∀ i, x i ≠ 0) : (∑ i, C (x i) * X ^ k i).support.card = n

{R : Type u_1}
[Semiring R]
{n : ℕ}
(k : Fin n → ℕ)
(x : Fin n → R)
(hk : Function.Injective k)
(hx : ∀ (i : Fin n), x i ≠ 0)

(∑ i : Fin n, Polynomial.C (x i) * Polynomial.X ^ k i).support.card = n


/-- Given a point in an affine subspace, a result of subtracting that point on the left is in the
direction if and only if the other point is in the subspace. -/
theorem vsub_left_mem_direction_iff_mem {s : AffineSubspace k P} {p : P} (hp : p ∈ s) (p2 : P) :
    p -ᵥ p2 ∈ s.direction ↔ p2 ∈ s

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : AffineSubspace k P}
{p : P}
(hp : p ∈ s)
(p2 : P)


theorem Prod.isBot_iff : IsBot x ↔ IsBot x.1 ∧ IsBot x.2

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{x : α × β}


lemma le_of_smul_le_smul_right [SMulPosReflectLE α β] (h : a₁ • b ≤ a₂ • b) (hb : 0 < b) :
    a₁ ≤ a₂

{α : Type u_1}
{β : Type u_2}
{a₁ a₂ : α}
{b : β}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero β]
[SMulPosReflectLE α β]
(h : a₁ • b ≤ a₂ • b)
(hb : 0 < b)


@[to_additive] lemma prod_sdiff_lt_prod_sdiff :
    ∏ i ∈ s \ t, f i < ∏ i ∈ t \ s, f i ↔ ∏ i ∈ s, f i < ∏ i ∈ t, f i

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelAddCommMonoid M]
{f : ι → M}
{s t : Finset ι}
[DecidableEq ι]

∑ i ∈ s \ t, f i < ∑ i ∈ t \ s, f i ↔ ∑ i ∈ s, f i < ∑ i ∈ t, f i


theorem filter_product_card (s : Finset α) (t : Finset β) (p : α → Prop) (q : β → Prop)
    [DecidablePred p] [DecidablePred q] :
    ((s ×ˢ t).filter fun x : α × β => (p x.1) = (q x.2)).card =
      (s.filter p).card * (t.filter q).card +
        (s.filter (¬ p ·)).card * (t.filter (¬ q ·)).card

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

(Finset.filter (fun x => p x.1 = q x.2) (s ×ˢ t)).card =
  (Finset.filter p s).card * (Finset.filter q t).card +
    (Finset.filter (fun x => ¬p x) s).card * (Finset.filter (fun x => ¬q x) t).card


theorem multiplicity_pow {p m n : ℕ} (hp : p.Prime) :
    multiplicity p (m ^ n) = n • multiplicity p m


lemma Basis.subset_closure (h : M.Basis I X) : X ⊆ M.closure I

{α : Type u_2}
{M : Matroid α}
{X I : Set α}
(h : M.Basis I X)


protected theorem subset (hs : IsAntichain r s) (h : t ⊆ s) : IsAntichain r t

{α : Type u_1}
{r : α → α → Prop}
{s t : Set α}
(hs : IsAntichain r s)
(h : t ⊆ s)


@[csimp] theorem replicate_eq_replicateTR : @List.replicate = @List.replicateTR


protected theorem Disjoint.symmDiff_right (ha : Disjoint a b) (hb : Disjoint a c) :
    Disjoint a (b ∆ c)

{α : Type u_2}
[GeneralizedBooleanAlgebra α]
{a b c : α}
(ha : Disjoint a b)
(hb : Disjoint a c)


theorem sin_periodic : Function.Periodic sin (2 * π)

Function.Periodic Complex.sin (2 * ↑Real.pi)


theorem hom_elementwise {C : Type*} [Category C] [ConcreteCategory C]
    {X Y : C} {f g : X ⟶ Y} (h : f = g) (x : X) : f x = g x

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.ConcreteCategory C]
{X Y : C}
{f g : X ⟶ Y}
(h : f = g)
(x : (CategoryTheory.forget C).obj X)


theorem fderivWithin_subset (st : s ⊆ t) (ht : UniqueDiffWithinAt 𝕜 s x)
    (h : DifferentiableWithinAt 𝕜 f t x) : fderivWithin 𝕜 f s x = fderivWithin 𝕜 f t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{s t : Set E}
(st : s ⊆ t)
(ht : UniqueDiffWithinAt 𝕜 s x)
(h : DifferentiableWithinAt 𝕜 f t x)


@[to_additive (attr := simp)]
theorem smul_ball (c : G) (x : X) (r : ℝ) : c • ball x r = ball (c • x) r

{G : Type v}
{X : Type w}
[PseudoMetricSpace X]
[Group G]
[MulAction G X]
[IsometricSMul G X]
(c : G)
(x : X)
(r : ℝ)

c • Metric.ball x r = Metric.ball (c • x) r


lemma divInt_div_divInt_cancel_left {x : ℤ} (hx : x ≠ 0) (n d : ℤ) :
    n /. x / (d /. x) = n /. d

Rat.divInt n x / Rat.divInt d x = Rat.divInt n d


theorem factorization_ord_compl (n p : ℕ) :
    (ord_compl[p] n).factorization = n.factorization.erase p

(n / p ^ n.factorization p).factorization = Finsupp.erase p n.factorization


@[simp] lemma lift_sdiff_lift (a b : α) : lift a \ lift b = lift (a \ b)

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

Booleanisation.lift a \ Booleanisation.lift b = Booleanisation.lift (a \ b)


@[to_additive]
theorem Equiv.hasProd_iff (e : γ ≃ β) : HasProd (f ∘ e) a ↔ HasProd f a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}
(e : γ ≃ β)


theorem IsRadical.inf (hI : IsRadical I) (hJ : IsRadical J) : IsRadical (I ⊓ J)

{R : Type u}
[CommSemiring R]
{I J : Ideal R}
(hI : I.IsRadical)
(hJ : J.IsRadical)


/-- A module over a domain has `NoZeroSMulDivisors` iff its torsion submodule is trivial. -/
theorem noZeroSMulDivisors_iff_torsion_eq_bot : NoZeroSMulDivisors R M ↔ torsion R M = ⊥

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

NoZeroSMulDivisors R M ↔ Submodule.torsion R M = ⊥


@[to_additive]
protected theorem inv_eq_of_mul_eq_one_left {a : α} (h : a * u = 1) : ↑u⁻¹ = a

{α : Type u}
[Monoid α]
{u : αˣ}
{a : α}
(h : a * ↑u = 1)


theorem Set.Countable.measurableSet {s : Set α} (hs : s.Countable) : MeasurableSet s

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSingletonClass α]
{s : Set α}
(hs : s.Countable)


theorem sum_left (β) [Finite (α ⊕ β)] : Finite α

{α : Type u_1}
(β : Type u_4)
[Finite (α ⊕ β)]


/-- Fixed points of iSup of subgroups is intersection -/
theorem fixedPoints_subgroup_iSup {ι : Sort*} {P : ι → Subgroup M} :
    fixedPoints (↥(iSup P)) α = ⋂ i, fixedPoints (P i) α

(M : Type u_1)
(α : Type u_2)
[Group M]
[MulAction M α]
{ι : Sort u_3}
{P : ι → Subgroup M}

MulAction.fixedPoints (↥(iSup P)) α = ⋂ i, MulAction.fixedPoints (↥(P i)) α


theorem Decidable.or_iff_not_and_not [Decidable a] [Decidable b] : a ∨ b ↔ ¬(¬a ∧ ¬b)

{a b : Prop}
[Decidable a]
[Decidable b]

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


/-- In a `GroupWithZero` `α`, the unit group `αˣ` is equivalent to the subtype of nonzero
elements. -/
@[simps] def unitsEquivNeZero [GroupWithZero α] : αˣ ≃ {a : α // a ≠ 0}

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


/-- The condition that the image of the map `e.f` of an embedding of
complex shapes `e : Embedding c c'` is stable by `c'.next`. -/
class IsTruncGE extends e.IsRelIff : Prop where
  mem_next {j : ι} {k' : ι'} (h : c'.Rel (e.f j) k') :
    ∃ k, e.f k = k'

{ι : Type u_1}
{ι' : Type u_2}
{c : ComplexShape ι}
{c' : ComplexShape ι'}
{e : c.Embedding c'}
[self : e.IsTruncGE]
{j : ι}
{k' : ι'}
(h : c'.Rel (e.f j) k')


/-- The map taking the pi product of a family of fundamental groupoids to the fundamental
groupoid of the pi product. This is actually an isomorphism (see `piIso`)
-/
@[simps]
def piToPiTop : (∀ i, πₓ (X i)) ⥤ πₓ (TopCat.of (∀ i, X i))

{I : Type u}
(X : I → TopCat)
(g : (i : I) → ↑(π.obj (X i)))
(i : I)

((FundamentalGroupoidFunctor.piToPiTop X).obj g).as i = (g i).as


/-- An angle in a non-degenerate right-angled triangle is positive. -/
theorem angle_add_pos_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x = 0 ∨ y ≠ 0) :
    0 < angle x (x + y)

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)
(h0 : x = 0 ∨ y ≠ 0)

0 < InnerProductGeometry.angle x (x + y)


@[to_additive]
theorem trivial_normal : IsNormalSubgroup (trivial G)


theorem diam_closedBall {r : ℝ≥0∞} : diam (closedBall x r) ≤ 2 * r

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{r : ℝ≥0∞}

EMetric.diam (EMetric.closedBall x r) ≤ 2 * r


theorem Filter.HasBasis.lift'_interior {l : Filter X} {p : ι → Prop} {s : ι → Set X}
    (h : l.HasBasis p s) : (l.lift' interior).HasBasis p fun i => interior (s i)

{X : Type u}
{ι : Sort w}
[TopologicalSpace X]
{l : Filter X}
{p : ι → Prop}
{s : ι → Set X}
(h : l.HasBasis p s)


/-- `C_c(α, β)` is the type of continuous functions `α → β` with compact support from a topological
space to a topological space with a zero element.

When possible, instead of parametrizing results over `f : C_c(α, β)`,
you should parametrize over `{F : Type*} [CompactlySupportedContinuousMapClass F α β] (f : F)`.

When you extend this structure, make sure to extend `CompactlySupportedContinuousMapClass`. -/
structure CompactlySupportedContinuousMap (α β : Type*) [TopologicalSpace α] [Zero β]
    [TopologicalSpace β] extends ContinuousMap α β where
  /-- The function has compact support . -/
  hasCompactSupport' : HasCompactSupport toFun

{α : Type u_5}
{β : Type u_6}
[TopologicalSpace α]
[Zero β]
[TopologicalSpace β]
(self : α →C_c β)


@[measurability]
theorem Measurable.iterate {f : α → α} (hf : Measurable f) : ∀ n, Measurable f^[n]

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → α}
(hf : Measurable f)
(n : ℕ)


theorem mk_num_ne_zero_of_ne_zero {q : ℚ} {n d : ℤ} (hq : q ≠ 0) (hqnd : q = n /. d) : n ≠ 0

{q : ℚ}
{n d : ℤ}
(hq : q ≠ 0)
(hqnd : q = Rat.divInt n d)


/-- Restricting the domain and then the codomain is the same as `MapsTo.restrict`. -/
@[simp]
theorem codRestrict_restrict (h : ∀ x : s, f x ∈ t) :
    codRestrict (s.restrict f) t h = MapsTo.restrict f s t fun x hx => h ⟨x, hx⟩

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
(h : ∀ (x : ↑s), f ↑x ∈ t)

Set.codRestrict (s.restrict f) t h = Set.MapsTo.restrict f s t ⋯


theorem UInt32.toNat_zero : (0 : UInt32).toNat = 0


@[to_additive]
theorem interior_smul (c : G) (s : Set α) : interior (c • s) = c • interior s

{α : Type u_2}
{G : Type u_4}
[TopologicalSpace α]
[Group G]
[MulAction G α]
[ContinuousConstSMul G α]
(c : G)
(s : Set α)


@[simp]
theorem prodMkLeft_apply (κ : Kernel α β) (ca : γ × α) : prodMkLeft γ κ ca = κ ca.snd

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_5}
{mγ : MeasurableSpace γ}
(κ : ProbabilityTheory.Kernel α β)
(ca : γ × α)

(ProbabilityTheory.Kernel.prodMkLeft γ κ) ca = κ ca.2


theorem sign_prodCongrRight (σ : α → Perm β) : sign (prodCongrRight σ) = ∏ k, sign (σ k)

{α : Type u}
[DecidableEq α]
{β : Type v}
[Fintype α]
[DecidableEq β]
[Fintype β]
(σ : α → Equiv.Perm β)

Equiv.Perm.sign (Equiv.prodCongrRight σ) = ∏ k : α, Equiv.Perm.sign (σ k)


lemma stalkMap_toSpec (f) (x : pbo f) {m} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) :
    (toSpec 𝒜 f).stalkMap x =
      (specStalkEquiv 𝒜 f x f_deg hm).hom ≫ (Proj.stalkIso' 𝒜 x.1).toCommRingCatIso.inv ≫
      ((Proj.toLocallyRingedSpace 𝒜).restrictStalkIso (Opens.openEmbedding _) x).inv

(x : ↥(ProjectiveSpectrum.basicOpen 𝒜 f))

AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap (AlgebraicGeometry.ProjectiveSpectrum.Proj.toSpec 𝒜 f) x =
  CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.ProjectiveSpectrum.Proj.specStalkEquiv 𝒜 f x f_deg hm).hom
    (CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.Proj.stalkIso' 𝒜 ↑x).toCommRingCatIso.inv
      ((AlgebraicGeometry.Proj.toLocallyRingedSpace 𝒜).restrictStalkIso ⋯ x).inv)


lemma dblX_of_Y_eq [NoZeroDivisors R] {P Q : Fin 3 → R} (hQz : Q z ≠ 0)
    (hx : P x * Q z ^ 2 = Q x * P z ^ 2) (hy : P y * Q z ^ 3 = Q y * P z ^ 3)
    (hy' : P y * Q z ^ 3 = W'.negY Q * P z ^ 3) : W'.dblX P = W'.dblU P ^ 2


@[simp] theorem lTensor_symm_tmul : (f.lTensor M).symm (m ⊗ₜ p) = m ⊗ₜ f.symm p

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

(LinearEquiv.lTensor M f).symm (m ⊗ₜ[R] p) = m ⊗ₜ[R] f.symm p


theorem integrable_const (c : E) : Integrable I l (fun _ => c) vol

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}
(c : E)

BoxIntegral.Integrable I l (fun x => c) vol


theorem MDifferentiableOn.mul (hp : MDifferentiableOn I 𝓘(𝕜, F') p s)
    (hq : MDifferentiableOn I 𝓘(𝕜, F') q s) : MDifferentiableOn I 𝓘(𝕜, F') (p * q) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{s : Set M}
{F' : Type u_11}
[NormedRing F']
[NormedAlgebra 𝕜 F']
{p q : M → F'}
(hp : MDifferentiableOn I 𝓘(𝕜, F') p s)
(hq : MDifferentiableOn I 𝓘(𝕜, F') q s)


theorem coe_real_preimage_closedBall_inter_eq {x ε : ℝ} (s : Set ℝ)
    (hs : s ⊆ closedBall x (|p| / 2)) :
    (↑) ⁻¹' closedBall (x : AddCircle p) ε ∩ s = if ε < |p| / 2 then closedBall x ε ∩ s else s

(hs : s ⊆ Metric.closedBall x (|p| / 2))

QuotientAddGroup.mk ⁻¹' Metric.closedBall (↑x) ε ∩ s = if ε < |p| / 2 then Metric.closedBall x ε ∩ s else s


theorem coe_natCast (n : ℕ) : ((n : FractionalIdeal S P) : Submodule R P) = n

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
(n : ℕ)


theorem insert_eq (x : α) (s : Set α) : insert x s = ({x} : Set α) ∪ s


/-- Oriented vector angle version of "angles in same segment are equal" and "opposite angles of
a cyclic quadrilateral add to π", for oriented angles mod π (for which those are the same
result), represented here as equality of twice the angles. -/
theorem two_zsmul_oangle_sub_eq_two_zsmul_oangle_sub_of_norm_eq {x₁ x₂ y z : V} (hx₁yne : x₁ ≠ y)
    (hx₁zne : x₁ ≠ z) (hx₂yne : x₂ ≠ y) (hx₂zne : x₂ ≠ z) {r : ℝ} (hx₁ : ‖x₁‖ = r) (hx₂ : ‖x₂‖ = r)
    (hy : ‖y‖ = r) (hz : ‖z‖ = r) :
    (2 : ℤ) • o.oangle (y - x₁) (z - x₁) = (2 : ℤ) • o.oangle (y - x₂) (z - x₂)

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

2 • o.oangle (y - x₁) (z - x₁) = 2 • o.oangle (y - x₂) (z - x₂)


theorem comap_sSup {s : Set (Filter β)} {m : α → β} : comap m (sSup s) = ⨆ f ∈ s, comap m f

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

Filter.comap m (sSup s) = ⨆ f ∈ s, Filter.comap m f


/-- If `x` and `y` are both separable elements, then `F⟮x, y⟯ / F` is a separable extension.
As a consequence, any rational function of `x` and `y` is also a separable element. -/
theorem IntermediateField.isSeparable_adjoin_pair_of_isSeparable {x y : E}
    (hx : IsSeparable F x) (hy : IsSeparable F y) :
    Algebra.IsSeparable F F⟮x, y⟯

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
{x y : E}
(hx : IsSeparable F x)
(hy : IsSeparable F y)


@[elab_as_elim]
protected theorem ind_mk {C : Real → Prop} (x : Real) (h : ∀ y, C (mk y)) : C x

(h : ∀ (y : CauSeq ℚ abs), C (Real.mk y))


lemma of_spectrum_eq {a b : A} {f : S → R} (ha : SpectrumRestricts a f)
    (h : spectrum S a = spectrum S b) : SpectrumRestricts b f

{R : Type u_3}
{S : Type u_4}
{A : Type u_5}
[Semifield R]
[Semifield S]
[Ring A]
[Algebra R S]
[Algebra R A]
[Algebra S A]
{a b : A}
{f : S → R}
(ha : SpectrumRestricts a f)
(h : spectrum S a = spectrum S b)


theorem coe_monoidHom_injective : Function.Injective ((↑) : (A →ₐ[R] B) → A →* B)

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]


/-- The cokernel of `biproduct.fromSubtype f p` is `⨁ Subtype.restrict pᶜ f`. -/
@[simps!]
def cokernelBiproductFromSubtypeIso (p : Set K) :
    cokernel (biproduct.fromSubtype f p) ≅ ⨁ Subtype.restrict pᶜ f

(CategoryTheory.Limits.cokernelBiproductFromSubtypeIso f p).hom =
  CategoryTheory.Limits.colimit.desc
    (CategoryTheory.Limits.parallelPair (CategoryTheory.Limits.biproduct.fromSubtype f p) 0)
    (CategoryTheory.Limits.CokernelCofork.ofπ (CategoryTheory.Limits.biproduct.toSubtype f pᶜ) ⋯)


theorem pow_mem_of_pow_mem {m n : ℕ} (ha : a ^ m ∈ I) (h : m ≤ n) : a ^ n ∈ I

{α : Type u}
{a : α}
[CommSemiring α]
(I : Ideal α)
{m n : ℕ}
(ha : a ^ m ∈ I)
(h : m ≤ n)


/-- Given a function `f : E → F` and a formal multilinear series `p`, we say that `f` has `p` as
a power series on the ball of radius `r > 0` around `x` if `f (x + y) = ∑' pₙ yⁿ` for all `‖y‖ < r`.
-/
structure HasFPowerSeriesOnBall (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (x : E) (r : ℝ≥0∞) :
    Prop where
  r_le : r ≤ p.radius
  r_pos : 0 < r
  hasSum :
    ∀ {y}, y ∈ EMetric.ball (0 : E) r → HasSum (fun n : ℕ => p n fun _ : Fin n => y) (f (x + y))

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
(self : HasFPowerSeriesOnBall f p x r)


theorem vecMul_add [Fintype m] (A B : Matrix m n α) (x : m → α) :
    x ᵥ* (A + B) = x ᵥ* A + x ᵥ* B

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocSemiring α]
[Fintype m]
(A B : Matrix m n α)
(x : m → α)


/-- When you take a set `U` in `α`, push it down to the quotient, and pull back, you get the union
of the orbit of `U` under `G`. -/
@[to_additive
      "When you take a set `U` in `α`, push it down to the quotient, and pull back, you get the
      union of the orbit of `U` under `G`."]
theorem quotient_preimage_image_eq_union_mul (U : Set α) :
    letI := orbitRel G α
    Quotient.mk' ⁻¹' (Quotient.mk' '' U) = ⋃ g : G, (g • ·) '' U

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
(U : Set α)

Quotient.mk' ⁻¹' (Quotient.mk' '' U) = ⋃ g, (fun x => g +ᵥ x) '' U


theorem Ioi_ofDual (a : αᵒᵈ) : Ioi (ofDual a) = (Iio a).map ofDual.toEmbedding

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

Finset.Ioi (OrderDual.ofDual a) = Finset.map OrderDual.ofDual.toEmbedding (Finset.Iio a)


/-- If the `ChartedSpace` structure on a manifold `M` is given by an open embedding `e : M → H`,
then the inverse of `e` is smooth. -/
lemma contMDiffOn_openEmbedding_symm :
    haveI := h.singletonChartedSpace; ContMDiffOn I I
      n (OpenEmbedding.toPartialHomeomorph e h).symm (range e)

{𝕜 : 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]
[Nonempty M]
{e : M → H}
(h : OpenEmbedding e)
{n : WithTop ℕ}

ContMDiffOn I I n (↑(OpenEmbedding.toPartialHomeomorph e h).symm) (Set.range e)


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

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

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


theorem map_piecewise_add [DecidableEq ι] (m m' : ∀ i, M₁ i) (t : Finset ι) :
    f (t.piecewise (m + m') m') = ∑ s ∈ t.powerset, f (s.piecewise m m')

{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 m' : (i : ι) → M₁ i)
(t : Finset ι)


@[to_additive Set.AddAntidiagonal.fst_eq_fst_iff_snd_eq_snd]
theorem fst_eq_fst_iff_snd_eq_snd : (x : α × α).1 = (y : α × α).1 ↔ (x : α × α).2 = (y : α × α).2

{α : Type u_1}
[CancelCommMonoid α]
{s t : Set α}
{a : α}
{x y : ↑(s.mulAntidiagonal t a)}


theorem measure_biUnion₀ {s : Set β} {f : β → Set α} (hs : s.Countable)
    (hd : s.Pairwise (AEDisjoint μ on f)) (h : ∀ b ∈ s, NullMeasurableSet (f b) μ) :
    μ (⋃ b ∈ s, f b) = ∑' p : s, μ (f p)

(hd : s.Pairwise (MeasureTheory.AEDisjoint μ on f))

(h : ∀ b ∈ s, MeasureTheory.NullMeasurableSet (f b) μ)

μ (⋃ b ∈ s, f b) = ∑' (p : ↑s), μ (f ↑p)


/-- The functor `Square C ⥤ Arrow (Arrow C)` which sends a
commutative square `sq` to the obvious arrow from the left morphism of `sq`
to the right morphism of `sq`. -/
@[simps!]
def toArrowArrowFunctor : Square C ⥤ Arrow (Arrow C)

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

(CategoryTheory.Square.toArrowArrowFunctor.obj sq).left.right = sq.X₃


theorem tan_coe_pi : tan (π : Angle) = 0


theorem measurableSet_inter_le_iff [TopologicalSpace ι] [SecondCountableTopology ι]
    [OrderTopology ι] [MeasurableSpace ι] [BorelSpace ι] (hτ : IsStoppingTime f τ)
    (hπ : IsStoppingTime f π) (s : Set Ω) :
    MeasurableSet[hτ.measurableSpace] (s ∩ {ω | τ ω ≤ π ω}) ↔
      MeasurableSet[(hτ.min hπ).measurableSpace] (s ∩ {ω | τ ω ≤ π ω})

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ π : Ω → ι}
[TopologicalSpace ι]
[SecondCountableTopology ι]
[OrderTopology ι]
[MeasurableSpace ι]
[BorelSpace ι]
(hτ : MeasureTheory.IsStoppingTime f τ)
(hπ : MeasureTheory.IsStoppingTime f π)
(s : Set Ω)

MeasurableSet (s ∩ {ω | τ ω ≤ π ω}) ↔ MeasurableSet (s ∩ {ω | τ ω ≤ π ω})


theorem Separable.unit_mul {f g : R[X]} (hf : IsUnit f) (hg : g.Separable) : (f * g).Separable

{R : Type u}
[CommSemiring R]
{f g : R[X]}
(hf : IsUnit f)
(hg : g.Separable)


@[to_additive]
theorem Nonempty.one_mem_div (h : s.Nonempty) : (1 : α) ∈ s / s

{α : Type u_2}
[DecidableEq α]
[AddGroup α]
{s : Finset α}
(h : s.Nonempty)


@[simp]
theorem cast_sub (h : m ∣ n) (a b : ZMod n) : (cast (a - b : ZMod n) : R) = cast a - cast b

{n : ℕ}
{R : Type u_1}
[Ring R]
{m : ℕ}
[CharP R m]
(h : m ∣ n)
(a b : ZMod n)


lemma IsAbsoluteValue.map_prod [CommSemiring R] [Nontrivial R] [LinearOrderedCommRing S]
    (abv : R → S) [IsAbsoluteValue abv] (f : ι → R) (s : Finset ι) :
    abv (∏ i ∈ s, f i) = ∏ i ∈ s, abv (f i)

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[CommSemiring R]
[Nontrivial R]
[LinearOrderedCommRing S]
(abv : R → S)
[IsAbsoluteValue abv]
(f : ι → R)
(s : Finset ι)


@[simp]
lemma id_val (X : Condensed.{u} C) : (𝟙 X : X ⟶ X).val = 𝟙 _

{C : Type w}
[CategoryTheory.Category.{v, w} C]
(X : Condensed C)


/-- A version of `Continuous.tendsto` that allows one to specify a simpler form of the limit.
E.g., one can write `continuous_exp.tendsto' 0 1 exp_zero`. -/
theorem Continuous.tendsto' (hf : Continuous f) (x : X) (y : Y) (h : f x = y) :
    Tendsto f (𝓝 x) (𝓝 y)

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


theorem tendsto_atBot_add_right_of_ge (C : β) (hf : Tendsto f l atBot) (hg : ∀ x, g x ≤ C) :
    Tendsto (fun x => f x + g x) l atBot

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

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


/-- Elements of the `p`-primary component have order `p^n` for some `n`. -/
@[to_additive primaryComponent.exists_orderOf_eq_prime_nsmul
  "Elements of the `p`-primary component have additive order `p^n` for some `n`"]
theorem primaryComponent.exists_orderOf_eq_prime_pow (g : CommMonoid.primaryComponent G p) :
    ∃ n : ℕ, orderOf g = p ^ n

(g : ↥(CommMonoid.primaryComponent G p))


lemma piecewise_mem_Icc' (h : g ≤ f) : s.piecewise f g ∈ Set.Icc g f

{ι : Type u_1}
(s : Finset ι)
[(j : ι) → Decidable (j ∈ s)]
{π : ι → Type u_3}
{f g : (i : ι) → π i}
[(i : ι) → Preorder (π i)]
(h : g ≤ f)


theorem LeftInverse.rightInverse_of_injective {f : α → β} {g : β → α} (h : LeftInverse f g)
    (hf : Injective f) : RightInverse f g

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
{g : β → α}
(h : Function.LeftInverse f g)
(hf : Function.Injective f)


lemma secondCountableTopology_iInf {ι} [Countable ι] {t : ι → TopologicalSpace α}
    (ht : ∀ i, @SecondCountableTopology α (t i)) : @SecondCountableTopology α (⨅ i, t i)

(ht : ∀ (i : ι), SecondCountableTopology α)


/-- Recursion on `Nat.Partrec.Code` is primitive recursive. -/
theorem rec_prim {α σ} [Primcodable α] [Primcodable σ] {c : α → Code} (hc : Primrec c) {z : α → σ}
    (hz : Primrec z) {s : α → σ} (hs : Primrec s) {l : α → σ} (hl : Primrec l) {r : α → σ}
    (hr : Primrec r) {pr : α → Code → Code → σ → σ → σ}
    (hpr : Primrec fun a : α × Code × Code × σ × σ => pr a.1 a.2.1 a.2.2.1 a.2.2.2.1 a.2.2.2.2)
    {co : α → Code → Code → σ → σ → σ}
    (hco : Primrec fun a : α × Code × Code × σ × σ => co a.1 a.2.1 a.2.2.1 a.2.2.2.1 a.2.2.2.2)
    {pc : α → Code → Code → σ → σ → σ}
    (hpc : Primrec fun a : α × Code × Code × σ × σ => pc a.1 a.2.1 a.2.2.1 a.2.2.2.1 a.2.2.2.2)
    {rf : α → Code → σ → σ} (hrf : Primrec fun a : α × Code × σ => rf a.1 a.2.1 a.2.2) :
    let F (a : α) (c : Code) : σ :=
      Nat.Partrec.Code.recOn c (z a) (s a) (l a) (r a) (pr a) (co a) (pc a) (rf a)
    Primrec fun a => F a (c a)

{pr : α → Nat.Partrec.Code → Nat.Partrec.Code → σ → σ → σ}

{co : α → Nat.Partrec.Code → Nat.Partrec.Code → σ → σ → σ}

{pc : α → Nat.Partrec.Code → Nat.Partrec.Code → σ → σ → σ}

(hrf : Primrec fun a => rf a.1 a.2.1 a.2.2)

let F := fun a c => Nat.Partrec.Code.recOn c (z a) (s a) (l a) (r a) (pr a) (co a) (pc a) (rf a);
Primrec fun a => F a (c a)


@[simp]
theorem min_singleton {a : α} : Finset.min {a} = (a : WithTop α)


@[simp]
theorem neLocus_sub_left : neLocus (f - g₁) (f - g₂) = neLocus g₁ g₂

{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f g₁ g₂ : Π₀ (a : α), N a)

(f - g₁).neLocus (f - g₂) = g₁.neLocus g₂


@[simp]
theorem eval_map (f : M →ₗ[R] M') (q : PolynomialModule R M) (r : R) :
    eval (algebraMap R R' r) (map R' f q) = f (eval r q)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(R' : Type u_4)
{M' : Type u_5}
[CommRing R']
[AddCommGroup M']
[Module R' M']
[Algebra R R']
[Module R M']
[IsScalarTower R R' M']
(f : M →ₗ[R] M')
(q : PolynomialModule R M)
(r : R)

(PolynomialModule.eval ((algebraMap R R') r)) ((PolynomialModule.map R' f) q) = f ((PolynomialModule.eval r) q)


theorem cos_conj : cos (conj x) = conj (cos x)

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


protected theorem sub_lt_iff (a b c : Int) : a - b < c ↔ a < c + b


theorem coe_nonUnitalRingHom_inj_iff {R S : Type*} [NonUnitalNonAssocSemiring R]
    [NonUnitalNonAssocSemiring S] (f g : R ≃+* S) : f = g ↔ (f : R →ₙ+* S) = g

{R : Type u_7}
{S : Type u_8}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
(f g : R ≃+* S)


@[simp] theorem symm_trans_apply (f : α ≃ β) (g : β ≃ γ) (a : γ) :
    (f.trans g).symm a = f.symm (g.symm a)

{α : Sort u}
{β : Sort v}
{γ : Sort w}
(f : α ≃ β)
(g : β ≃ γ)
(a : γ)


@[simp]
theorem toOuterMeasure_bindOnSupport_apply :
    (p.bindOnSupport f).toOuterMeasure s =
      ∑' a, p a * if h : p a = 0 then 0 else (f a h).toOuterMeasure s

{α : Type u_1}
{β : Type u_2}
{p : PMF α}
(f : (a : α) → a ∈ p.support → PMF β)
(s : Set β)

(p.bindOnSupport f).toOuterMeasure s = ∑' (a : α), p a * if h : p a = 0 then 0 else (f a h).toOuterMeasure s


@[simp]
theorem finSuccEquiv'_succAbove (i : Fin (n + 1)) (j : Fin n) :
    finSuccEquiv' i (i.succAbove j) = some j

(finSuccEquiv' i) (i.succAbove j) = some j


lemma and_two_pow (n i : ℕ) : n &&& 2 ^ i = (n.testBit i).toNat * 2 ^ i


theorem symm_bijective : Function.Bijective (symm : (A₁ ≃ₐ[R] A₂) → A₂ ≃ₐ[R] A₁)

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]


protected theorem add_assoc : ∀ (n m k : Nat), (n + m) + k = n + (m + k)


@[to_additive (attr := simp)]
theorem smul_bot : f • (⊥ : Filter β) = ⊥

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


@[simp]
theorem inverseAssociator_map_inr_inl {X Y : D} (f : inr (inl X) ⟶ inr (inl Y)) :
    (inverseAssociator C D E).map f = f

(f : Sum.inr (Sum.inl X) ⟶ Sum.inr (Sum.inl Y))

(CategoryTheory.sum.inverseAssociator C D E).map f = f


protected theorem compl [BooleanAlgebra α] [BooleanAlgebra β] {l : α → β} {u : β → α}
    (gc : GaloisConnection l u) :
    GaloisConnection (compl ∘ u ∘ compl) (compl ∘ l ∘ compl)

{α : Type u}
{β : Type v}
[BooleanAlgebra α]
[BooleanAlgebra β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)


theorem star_exp [T2Space 𝔸] [StarRing 𝔸] [ContinuousStar 𝔸] (x : 𝔸) :
    star (exp 𝕂 x) = exp 𝕂 (star x)

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[Field 𝕂]
[Ring 𝔸]
[Algebra 𝕂 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]
[T2Space 𝔸]
[StarRing 𝔸]
[ContinuousStar 𝔸]
(x : 𝔸)

star (NormedSpace.exp 𝕂 x) = NormedSpace.exp 𝕂 (star x)


theorem isLUB_univ [OrderTop α] : IsLUB (univ : Set α) ⊤


theorem _root_.RCLike.im_eq_complex_im : ⇑(RCLike.im : ℂ →+ ℝ) = Complex.im


@[to_additive]
lemma mul_comp [MulOneClass P] (g₁ g₂ : M →* N) (f : P →* M) :
    (g₁ * g₂).comp f = g₁.comp f * g₂.comp f

{M : Type u_3}
{N : Type u_4}
{P : Type u_5}
[AddZeroClass M]
[AddCommMonoid N]
[AddZeroClass P]
(g₁ g₂ : M →+ N)
(f : P →+ M)

(g₁ + g₂).comp f = g₁.comp f + g₂.comp f


theorem truncate_surjective : Surjective (truncate n : 𝕎 R → TruncatedWittVector p n R)

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


@[simp]
theorem toAddMonoidAlgebra_mul [AddMonoid ι] [Semiring M]
    [∀ m : M, Decidable (m ≠ 0)] (f g : ⨁ _ : ι, M) :
    (f * g).toAddMonoidAlgebra = toAddMonoidAlgebra f * toAddMonoidAlgebra g

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[AddMonoid ι]
[Semiring M]
[(m : M) → Decidable (m ≠ 0)]
(f g : ⨁ (x : ι), M)

(f * g).toAddMonoidAlgebra = f.toAddMonoidAlgebra * g.toAddMonoidAlgebra


theorem mapM_map_eq_foldl (as : Array α) (f : α → β) (i) :
    mapM.map (m := Id) f as i b = as.foldl (start := i) (fun r a => r.push (f a)) b

{α : Type u_1}
{β : Type u_2}
{b : Array β}
(as : Array α)
(f : α → β)
(i : Nat)

Array.mapM.map f as i b = Array.foldl (fun r a => r.push (f a)) b as i


theorem Set.OrdConnected.isStronglyAtomic [IsStronglyAtomic α] {s : Set α}
    (h : Set.OrdConnected s) : IsStronglyAtomic s

{α : Type u_4}
[Preorder α]
[IsStronglyAtomic α]
{s : Set α}
(h : s.OrdConnected)


theorem ker_snd : ker (snd R M M₂) = range (inl R M M₂)

(R : Type u)
(M : Type v)
(M₂ : Type w)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

LinearMap.ker (LinearMap.snd R M M₂) = LinearMap.range (LinearMap.inl R M M₂)


/--
Another variant of the opposite of functor, turning a functor `C ⥤ Dᵒᵖ` into a functor `Cᵒᵖ ⥤ D`.
In informal mathematics no distinction is made.
-/
@[simps]
protected def leftOp (F : C ⥤ Dᵒᵖ) : Cᵒᵖ ⥤ D

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

F.leftOp.obj X = Opposite.unop (F.obj (Opposite.unop X))


lemma Connected.exists_path_of_dist (hconn : G.Connected) (u v : V) :
    ∃ (p : G.Walk u v), p.IsPath ∧ p.length = G.dist u v

{V : Type u_1}
{G : SimpleGraph V}
(hconn : G.Connected)
(u v : V)


theorem iInf_emptyset {f : β → α} : ⨅ x ∈ (∅ : Set β), f x = ⊤

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


/-- See `csSup_mem_of_not_isSuccLimit` for the `ConditionallyCompleteLinearOrder` version. -/
lemma csSup_mem_of_not_isSuccLimit'
    (hbdd : BddAbove s) (hlim : ¬ IsSuccLimit (sSup s)) :
    sSup s ∈ s

{α : Type u_2}
[ConditionallyCompleteLinearOrderBot α]
{s : Set α}
(hbdd : BddAbove s)
(hlim : ¬Order.IsSuccLimit (sSup s))


theorem coeFn_smul (c : S) (f : M [⋀^ι]→ₗ[R] N) : ⇑(c • f) = c • ⇑f

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
{S : Type u_10}
[Monoid S]
[DistribMulAction S N]
[SMulCommClass R S N]
(c : S)
(f : M [⋀^ι]→ₗ[R] N)


@[simp]
theorem translationNumber_units_inv (f : CircleDeg1Liftˣ) : τ ↑f⁻¹ = -τ f


@[simp]
theorem minimum_eq_top {l : List α} : l.minimum = ⊤ ↔ l = []

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


@[simp]
theorem support_eq_empty_iff {σ : Perm α} : σ.support = ∅ ↔ σ = 1

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


theorem map_extend_symm_nhdsWithin {y : M} (hy : y ∈ f.source) :
    map (f.extend I).symm (𝓝[(f.extend I).symm ⁻¹' s ∩ range I] f.extend I y) = 𝓝[s] y

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)
{s : Set M}
{y : M}
(hy : y ∈ f.source)

Filter.map (↑(f.extend I).symm) (𝓝[↑(f.extend I).symm ⁻¹' s ∩ Set.range ↑I] ↑(f.extend I) y) = 𝓝[s] y


theorem prodExtendRight_apply_ne {a a' : α₁} (h : a' ≠ a) (b : β₁) :
    prodExtendRight a e (a', b) = (a', b)

{α₁ : Type u_1}
{β₁ : Type u_2}
[DecidableEq α₁]
(e : Equiv.Perm β₁)
{a a' : α₁}
(h : a' ≠ a)
(b : β₁)

(Equiv.Perm.prodExtendRight a e) (a', b) = (a', b)


@[reassoc (attr := simp)]
lemma ιTensorObj₃'_associator_hom
    [HasGoodTensor₁₂Tensor X₁ X₂ X₃] [HasGoodTensorTensor₂₃ X₁ X₂ X₃]
    (i₁ i₂ i₃ j : I) (h : i₁ + i₂ + i₃ = j) :
    ιTensorObj₃' X₁ X₂ X₃ i₁ i₂ i₃ j h ≫ (associator X₁ X₂ X₃).hom j =
      (α_ _ _ _).hom ≫ ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h

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

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

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.ιTensorObj₃' X₁ X₂ X₃ i₁ i₂ i₃ j h)
    ((CategoryTheory.GradedObject.Monoidal.associator X₁ X₂ X₃).hom j) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator (X₁ i₁) (X₂ i₂) (X₃ i₃)).hom
    (CategoryTheory.GradedObject.Monoidal.ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h)


/-- A helper function used in defining the Čech adjunction. -/
@[simps]
def cechNerveEquiv (X : SimplicialObject.Augmented C) (F : Arrow C) :
    (Augmented.toArrow.obj X ⟶ F) ≃ (X ⟶ F.augmentedCechNerve)

[∀ (n : ℕ) (f : CategoryTheory.Arrow C), CategoryTheory.Limits.HasWidePullback f.right (fun x => f.left) fun x => f.hom]

(X : CategoryTheory.SimplicialObject.Augmented C)

(CategoryTheory.SimplicialObject.cechNerveEquiv X F).symm G =
  CategoryTheory.SimplicialObject.equivalenceRightToLeft X F G


@[to_additive (attr := simp)]
theorem lowerClosure_mul_distrib : lowerClosure (s * t) = lowerClosure s * lowerClosure t

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


theorem map_smul (f : F) (c : ZMod n) (x : M) : f (c • x) = c • f x

{n : ℕ}
{M : Type u_1}
{M₁ : Type u_2}
{F : Type u_3}
[AddCommGroup M]
[AddCommGroup M₁]
[FunLike F M M₁]
[AddMonoidHomClass F M M₁]
[Module (ZMod n) M]
[Module (ZMod n) M₁]
(f : F)
(c : ZMod n)
(x : M)


/-- Graph homomorphisms induce a covariant function on subgraphs. -/
@[simps]
protected def map {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) : G'.Subgraph

{V : Type u}
{W : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G →g G')
(H : G.Subgraph)

(SimpleGraph.Subgraph.map f H).verts = ⇑f '' H.verts


/-- A more convenient spelling of `Polynomial.ofFinsupp.injEq` in terms of `Iff`. -/
theorem ofFinsupp_inj {a b} : (⟨a⟩ : R[X]) = ⟨b⟩ ↔ a = b

{ toFinsupp := a } = { toFinsupp := b } ↔ a = b


/-- An outer measure constructed using `OuterMeasure.mkMetric'` is a metric outer measure. -/
theorem mkMetric'_isMetric (m : Set X → ℝ≥0∞) : (mkMetric' m).IsMetric

{X : Type u_2}
[EMetricSpace X]
(m : Set X → ℝ≥0∞)


/-- When `IsEmpty ι`, this lemma does not hold without the additional assumption `p ≠ ∞` because
the left-hand side simplifies to `0`, while the right-hand side simplifies to `‖b‖₊`. See
`PiLp.nnnorm_equiv_symm_const` for a version which exchanges the hypothesis `Nonempty ι`.
for `p ≠ ∞`. -/
theorem nnnorm_equiv_symm_const' {β} [SeminormedAddCommGroup β] [Nonempty ι] (b : β) :
    ‖(WithLp.equiv p (ι → β)).symm (Function.const _ b)‖₊ =
      (Fintype.card ι : ℝ≥0) ^ (1 / p).toReal * ‖b‖₊

{p : ℝ≥0∞}
{ι : Type u_2}
[Fact (1 ≤ p)]
[Fintype ι]
{β : Type u_5}
[SeminormedAddCommGroup β]
[Nonempty ι]
(b : β)

‖(WithLp.equiv p (ι → β)).symm (Function.const ι b)‖₊ = ↑(Fintype.card ι) ^ (1 / p).toReal * ‖b‖₊


@[simp]
theorem comp_apply (f : CocompactMap β γ) (g : CocompactMap α β) (a : α) : comp f g a = f (g a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
(f : CocompactMap β γ)
(g : CocompactMap α β)
(a : α)


/-- The circumsphere of a triangle may be expressed explicitly in terms of two points and the
angle at the third point. -/
theorem circumsphere_eq_of_dist_of_oangle (t : Triangle ℝ P) {i₁ i₂ i₃ : Fin 3} (h₁₂ : i₁ ≠ i₂)
    (h₁₃ : i₁ ≠ i₃) (h₂₃ : i₂ ≠ i₃) : t.circumsphere =
    ⟨((Real.Angle.tan (∡ (t.points i₁) (t.points i₂) (t.points i₃)))⁻¹ / 2) •
      o.rotation (π / 2 : ℝ) (t.points i₃ -ᵥ t.points i₁) +ᵥ midpoint ℝ (t.points i₁) (t.points i₃),
      dist (t.points i₁) (t.points i₃) /
        |Real.Angle.sin (∡ (t.points i₁) (t.points i₂) (t.points i₃))| / 2⟩

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

Affine.Simplex.circumsphere t =
  {
    center :=
      ((∡ (t.points i₁) (t.points i₂) (t.points i₃)).tan⁻¹ / 2) •
          (EuclideanGeometry.o.rotation ↑(π / 2)) (t.points i₃ -ᵥ t.points i₁) +ᵥ
        midpoint ℝ (t.points i₁) (t.points i₃),
    radius := dist (t.points i₁) (t.points i₃) / |(∡ (t.points i₁) (t.points i₂) (t.points i₃)).sin| / 2 }


theorem fderiv_mul_const (hc : DifferentiableAt 𝕜 c x) (d : 𝔸') :
    fderiv 𝕜 (fun y => c y * d) x = d • fderiv 𝕜 c x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸' : Type u_7}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
{c : E → 𝔸'}
(hc : DifferentiableAt 𝕜 c x)
(d : 𝔸')


@[simp] theorem some_bind (a) (f : α → Option β) : (some a).bind f = f a

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