theorem basis_repr_symm_apply' (a : A) (i : ι) : a • basis A b i = a ⊗ₜ b i

{R : Type uR}
{A : Type uA}
{M : Type uM}
{ι : Type uι}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(a : A)
(i : ι)

a • (Algebra.TensorProduct.basis A b) i = a ⊗ₜ[R] b i


@[simp]
theorem dual_comp (g : CompleteLatticeHom β γ) (f : CompleteLatticeHom α β) :
    CompleteLatticeHom.dual (g.comp f) =
      (CompleteLatticeHom.dual g).comp (CompleteLatticeHom.dual f)

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


@[to_additive]
protected theorem mul_le_mul_iff_left [Mul α] [CovariantClass α α (· * ·) (· ≤ ·)] {a b c : α}
    (ha : MulLECancellable a) : a * b ≤ a * c ↔ b ≤ c

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


/-- If `0 < n`, then `r 1` has order `n`.
-/
@[simp]
theorem orderOf_r_one : orderOf (r 1 : DihedralGroup n) = n


theorem toMeasure_apply₀ (m : OuterMeasure α) (h : ms ≤ m.caratheodory) {s : Set α}
    (hs : NullMeasurableSet s (m.toMeasure h)) : m.toMeasure h s = m s

(hs : MeasureTheory.NullMeasurableSet s (m.toMeasure h))


/-- Multiplication `y ↦ x * y` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply toEquiv) "Addition `y ↦ x + y` as an `IsometryEquiv`."]
def mulLeft [IsometricSMul G G] (c : G) : G ≃ᵢ G

{G : Type v}
[AddGroup G]
[PseudoEMetricSpace G]
[IsometricVAdd G G]
(c : G)

(IsometryEquiv.addLeft c).toEquiv = Equiv.addLeft c


@[simp]
theorem lift_comp_inl : (lift f₁ f₂ h).comp inl = f₁

(h : ∀ (g : G), f₁.comp (MulEquiv.toMonoidHom (φ g)) = (MulEquiv.toMonoidHom (MulAut.conj (f₂ g))).comp f₁)

(SemidirectProduct.lift f₁ f₂ h).comp SemidirectProduct.inl = f₁


@[simp]
theorem map_const (g : β → γ) (b : β) : (const α b).map g = const α (g b)

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

MeasureTheory.SimpleFunc.map g (MeasureTheory.SimpleFunc.const α b) = MeasureTheory.SimpleFunc.const α (g b)


theorem tendsto_insertNth {β} {n : ℕ} {a : α} {l : List α} {f : β → α} {g : β → List α}
    {b : Filter β} (hf : Tendsto f b (𝓝 a)) (hg : Tendsto g b (𝓝 l)) :
    Tendsto (fun b : β => insertNth n (f b) (g b)) b (𝓝 (insertNth n a l))

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_3}
{n : ℕ}
{a : α}
{l : List α}
{f : β → α}
{g : β → List α}
{b : Filter β}
(hf : Filter.Tendsto f b (𝓝 a))
(hg : Filter.Tendsto g b (𝓝 l))

Filter.Tendsto (fun b => List.insertNth n (f b) (g b)) b (𝓝 (List.insertNth n a l))


theorem minFac_le_div {n : ℕ} (pos : 0 < n) (np : ¬Prime n) : minFac n ≤ n / minFac n

{n : ℕ}
(pos : 0 < n)
(np : ¬Nat.Prime n)


theorem Filter.EventuallyEq.isLocalExtr_iff {f g : α → β} {a : α} (heq : f =ᶠ[𝓝 a] g) :
    IsLocalExtr f a ↔ IsLocalExtr g a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{f g : α → β}
{a : α}
(heq : f =ᶠ[𝓝 a] g)


theorem trans_symm_eq_iff_forall_isSome {f : α ≃. β} :
    f.trans f.symm = PEquiv.refl α ↔ ∀ a, isSome (f a)

f.trans f.symm = PEquiv.refl α ↔ ∀ (a : α), (f a).isSome = true


/-- Under a dense continuous algebra map, a subalgebra
whose `TopologicalClosure` is `⊤` is sent to another such submodule.
That is, the image of a dense subalgebra under a map with dense range is dense.
-/
theorem _root_.DenseRange.topologicalClosure_map_subalgebra
    [TopologicalSemiring B] {f : A →A[R] B}  (hf' : DenseRange f) {s : Subalgebra R A}
    (hs : s.topologicalClosure = ⊤) : (s.map (f : A →ₐ[R] B)).topologicalClosure = ⊤

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
[TopologicalSemiring A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
[TopologicalSemiring B]
{f : A →A[R] B}
(hf' : DenseRange ⇑f)
{s : Subalgebra R A}
(hs : s.topologicalClosure = ⊤)

(Subalgebra.map (↑f) s).topologicalClosure = ⊤


theorem support_curry [DecidableEq α] (f : α × β →₀ M) :
    f.curry.support ⊆ f.support.image Prod.fst

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
[DecidableEq α]
(f : α × β →₀ M)

f.curry.support ⊆ Finset.image Prod.fst f.support


@[simp]
theorem commProb_eq_zero_of_infinite [Infinite M] : commProb M = 0


theorem isPreconnected_Iio : IsPreconnected (Iio a)

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{a : α}


theorem trace_mul_cycle' [NonUnitalCommSemiring R] (A : Matrix m n R) (B : Matrix n p R)
    (C : Matrix p m R) : trace (A * (B * C)) = trace (C * (A * B))

{m : Type u_2}
{n : Type u_3}
{p : Type u_4}
{R : Type u_6}
[Fintype m]
[Fintype n]
[Fintype p]
[NonUnitalCommSemiring R]
(A : Matrix m n R)
(B : Matrix n p R)
(C : Matrix p m R)

(A * (B * C)).trace = (C * (A * B)).trace


@[to_additive]
theorem prod_congr {f : α →₀ M} {g1 g2 : α → M → N} (h : ∀ x ∈ f.support, g1 x (f x) = g2 x (f x)) :
    f.prod g1 = f.prod g2


lemma _root_.finCongr_symm_apply_coe (h : m = n) (k : Fin n) : ((finCongr h).symm k : ℕ) = k


/-- If `f` and `g` are isomorphic arrows, then an image factorisation of `f`
gives an image factorisation of `g` -/
@[simps]
def ofArrowIso {f g : Arrow C} (F : ImageFactorisation f.hom) (sq : f ⟶ g) [IsIso sq] :
    ImageFactorisation g.hom

(F : CategoryTheory.Limits.ImageFactorisation f.hom)


theorem integral_gaussian_Ioi (b : ℝ) :
    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = √(π / b) / 2

∫ (x : ℝ) in Set.Ioi 0, rexp (-b * x ^ 2) = √(π / b) / 2


theorem num_lt_succ_floor_mul_den (q : ℚ) : q.num < (⌊q⌋ + 1) * q.den


/-- If `f b = 1`, then the product of `f a` with `a ∈ s` is the same as the product of `f a` for
`a ∈ s ∖ {b}`. -/
@[to_additive "If `f b = 0`, then the sum of `f a` with `a ∈ s` is the same as the sum of `f a`
for `a ∈ s ∖ {b}`."]
lemma tprod_eq_tprod_diff_singleton {f : β → α} (s : Set β) {b : β} (hf₀ : f b = 1) :
    ∏' a : s, f a = ∏' a : (s \ {b} : Set β), f a

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
(s : Set β)
{b : β}
(hf₀ : f b = 1)


@[simp]
theorem simple_mul_simple_self (i : B) : s i * s i = 1

{B : Type u_1}
{W : Type u_3}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(i : B)


theorem Filter.HasBasis.cauchySeq_iff' {γ} [Nonempty β] [SemilatticeSup β] {u : β → α}
    {p : γ → Prop} {s : γ → Set (α × α)} (H : (𝓤 α).HasBasis p s) :
    CauchySeq u ↔ ∀ i, p i → ∃ N, ∀ n ≥ N, (u n, u N) ∈ s i

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
{γ : Sort u_1}
[Nonempty β]
[SemilatticeSup β]
{u : β → α}
{p : γ → Prop}
{s : γ → Set (α × α)}
(H : (𝓤 α).HasBasis p s)

CauchySeq u ↔ ∀ (i : γ), p i → ∃ N, ∀ n ≥ N, (u n, u N) ∈ s i


@[simp]
theorem map_restrictScalars_comp_includeRight (f : A →ₐ[S] B) (g : C →ₐ[R] D) :
    ((map f g).restrictScalars R).comp includeRight = includeRight.comp g

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

(AlgHom.restrictScalars R (Algebra.TensorProduct.map f g)).comp Algebra.TensorProduct.includeRight =
  Algebra.TensorProduct.includeRight.comp g


theorem offDiag_insert (ha : a ∉ s) : (insert a s).offDiag = s.offDiag ∪ {a} ×ˢ s ∪ s ×ˢ {a}

{α : Type u_1}
{s : Set α}
{a : α}
(ha : a ∉ s)


theorem eq_one_of_dvd_one {a : Int} (H : 0 ≤ a) (H' : a ∣ 1) : a = 1


/-- Implementation of `SheafConditionPairwiseIntersections.coneEquiv`. -/
@[simps!]
def coneEquivInverse :
    Limits.Cone (SheafConditionEqualizerProducts.diagram F U) ⥤
      Limits.Cone ((diagram U).op ⋙ F)

{c c' : CategoryTheory.Limits.Cone (TopCat.Presheaf.SheafConditionEqualizerProducts.diagram F U)}

((TopCat.Presheaf.SheafConditionPairwiseIntersections.coneEquivInverse F U).map f).hom = f.hom


@[simp]
theorem inf_ndunion (s₁ s₂ : Multiset α) : (ndunion s₁ s₂).inf = s₁.inf ⊓ s₂.inf

{α : Type u_1}
[SemilatticeInf α]
[OrderTop α]
[DecidableEq α]
(s₁ s₂ : Multiset α)


theorem integral_of_ge (h : b ≤ a) : ∫ x in a..b, f x ∂μ = -∫ x in Ioc b a, f x ∂μ

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

∫ (x : ℝ) in a..b, f x ∂μ = -∫ (x : ℝ) in Set.Ioc b a, f x ∂μ


/-- `p` is a Taylor series of `f` up to `n+1` if and only if `p` is a Taylor series up to `n`, and
`p (n + 1)` is a derivative of `p n`. -/
theorem hasFTaylorSeriesUpToOn_succ_iff_left {n : ℕ} :
    HasFTaylorSeriesUpToOn (n + 1) f p s ↔
      HasFTaylorSeriesUpToOn n f p s ∧
        (∀ x ∈ s, HasFDerivWithinAt (fun y => p y n) (p x n.succ).curryLeft s x) ∧
          ContinuousOn (fun x => p x (n + 1)) s

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

HasFTaylorSeriesUpToOn (↑n + 1) f p s ↔
  HasFTaylorSeriesUpToOn (↑n) f p s ∧
    (∀ x ∈ s, HasFDerivWithinAt (fun y => p y n) (p x n.succ).curryLeft s x) ∧ ContinuousOn (fun x => p x (n + 1)) s


theorem WCovBy.le_and_le_iff (h : a ⩿ b) : a ≤ c ∧ c ≤ b ↔ c = a ∨ c = b

{α : Type u_1}
[PartialOrder α]
{a b c : α}
(h : a ⩿ b)


@[to_additive]
theorem inclusion_injective {H K : Subgroup G} (h : H ≤ K) : Function.Injective <| inclusion h

{G : Type u_1}
[Group G]
{H K : Subgroup G}
(h : H ≤ K)


@[reassoc]
theorem associator_inv_naturality {X Y Z X' Y' Z' : C} (f : X ⟶ X') (g : Y ⟶ Y') (h : Z ⟶ Z') :
    (f ⊗ g ⊗ h) ≫ (α_ X' Y' Z').inv = (α_ X Y Z).inv ≫ ((f ⊗ g) ⊗ h)

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

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.tensorHom f (CategoryTheory.MonoidalCategory.tensorHom g h))
    (CategoryTheory.MonoidalCategory.associator X' Y' Z').inv =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).inv
    (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.MonoidalCategory.tensorHom f g) h)


lemma comap_id (w : InfinitePlace K) : w.comap (RingHom.id K) = w

{K : Type u_2}
[Field K]
(w : NumberField.InfinitePlace K)


theorem map_surjective (hf : Function.Surjective f) : Function.Surjective (map f)

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(f : R →+* S)
(hf : Function.Surjective ⇑f)


@[to_additive]
theorem Submonoid.top_closure_mul_self_subset (s : Submonoid M) :
    _root_.closure (s : Set M) * _root_.closure s ⊆ _root_.closure s

{M : Type u_3}
[TopologicalSpace M]
[AddMonoid M]
[ContinuousAdd M]
(s : AddSubmonoid M)


@[to_additive MeasureTheory.NullMeasurableSet.addFundamentalFrontier]
protected theorem NullMeasurableSet.fundamentalFrontier (hs : NullMeasurableSet s μ) :
    NullMeasurableSet (fundamentalFrontier G s) μ

[MeasureTheory.SMulInvariantMeasure G α μ]

(hs : MeasureTheory.NullMeasurableSet s μ)

MeasureTheory.NullMeasurableSet (MeasureTheory.fundamentalFrontier G s) μ


theorem updateColumn_transpose [DecidableEq m] : updateColumn Mᵀ i b = (updateRow M i b)ᵀ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{M : Matrix m n α}
{i : m}
{b : n → α}
[DecidableEq m]

M.transpose.updateColumn i b = (M.updateRow i b).transpose


lemma isCoboundedUnder_le_of_eventually_le [Preorder α] (l : Filter ι) [NeBot l] {f : ι → α} {x : α}
    (hf : ∀ᶠ i in l, x ≤ f i) :
    IsCoboundedUnder (· ≤ ·) l f

{α : Type u_1}
{ι : Type u_4}
[Preorder α]
(l : Filter ι)
[l.NeBot]
{f : ι → α}
{x : α}
(hf : ∀ᶠ (i : ι) in l, x ≤ f i)

Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) l f


@[simp]
theorem isOrtho_bot_left {V : Submodule 𝕜 E} : ⊥ ⟂ V

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


@[to_additive (attr := ext)]
theorem ext : Function.Injective (val : αˣ → α)


@[gcongr]
theorem union_subset_union_left {s₁ s₂ : Set α} (t) (h : s₁ ⊆ s₂) : s₁ ∪ t ⊆ s₂ ∪ t

{α : Type u}
{s₁ s₂ : Set α}
(t : Set α)
(h : s₁ ⊆ s₂)

s₁ ∪ t ⊆ s₂ ∪ t


@[simp]
theorem himp_bihimp_eq_inf : (b ⇨ a) ⇔ b = a ⊓ b

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


@[simp] theorem sizeOf_nat (n : Nat) : sizeOf n = n


theorem indep_iff_forall_indepSet (m₁ m₂ : MeasurableSpace Ω) {_m0 : MeasurableSpace Ω}
    (κ : Kernel α Ω) (μ : Measure α) :
    Indep m₁ m₂ κ μ ↔ ∀ s t, MeasurableSet[m₁] s → MeasurableSet[m₂] t → IndepSet s t κ μ

{α : Type u_1}
{Ω : Type u_2}
{_mα : MeasurableSpace α}
(m₁ m₂ : MeasurableSpace Ω)
{_m0 : MeasurableSpace Ω}
(κ : ProbabilityTheory.Kernel α Ω)
(μ : MeasureTheory.Measure α)

ProbabilityTheory.Kernel.Indep m₁ m₂ κ μ ↔
  ∀ (s t : Set Ω), MeasurableSet s → MeasurableSet t → ProbabilityTheory.Kernel.IndepSet s t κ μ


theorem not_mem_subset (h : s ⊆ t) : a ∉ t → a ∉ s

{α : Type u}
{a : α}
{s t : Set α}
(h : s ⊆ t)


theorem ContinuousLinearMap.norm_map_tail_le
    (f : Ei 0 →L[𝕜] ContinuousMultilinearMap 𝕜 (fun i : Fin n => Ei i.succ) G) (m : ∀ i, Ei i) :
    ‖f (m 0) (tail m)‖ ≤ ‖f‖ * ∏ i, ‖m i‖

[(i : Fin n.succ) → NormedAddCommGroup (Ei i)]

[(i : Fin n.succ) → NormedSpace 𝕜 (Ei i)]

(f : Ei 0 →L[𝕜] ContinuousMultilinearMap 𝕜 (fun i => Ei i.succ) G)

‖(f (m 0)) (Fin.tail m)‖ ≤ ‖f‖ * ∏ i : Fin n.succ, ‖m i‖


/-- **Krein-Milman theorem**: In a LCTVS, any compact convex set is the closure of the convex hull
    of its extreme points. -/
theorem closure_convexHull_extremePoints (hscomp : IsCompact s) (hAconv : Convex ℝ s) :
    closure (convexHull ℝ <| s.extremePoints ℝ) = s

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[T2Space E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
[LocallyConvexSpace ℝ E]
{s : Set E}
(hscomp : IsCompact s)
(hAconv : Convex ℝ s)

closure ((convexHull ℝ) (Set.extremePoints ℝ s)) = s


@[simp] theorem getLsb_ushiftRight (x : BitVec n) (i j : Nat) :
    getLsb (x >>> i) j = getLsb x (i+j)


theorem btw_coe_iff {x₁ x₂ x₃ : α} :
    Btw.btw (x₁ : α ⧸ AddSubgroup.zmultiples p) x₂ x₃ ↔
      toIcoMod hp'.out x₁ x₂ ≤ toIocMod hp'.out x₁ x₃

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
[hp' : Fact (0 < p)]
{x₁ x₂ x₃ : α}

btw ↑x₁ ↑x₂ ↑x₃ ↔ toIcoMod ⋯ x₁ x₂ ≤ toIocMod ⋯ x₁ x₃


/-- A Cartan subalgebra is a nilpotent, self-normalizing subalgebra.

A _splitting_ Cartan subalgebra can be defined by mixing in `LieModule.IsTriangularizable R H L`. -/
class IsCartanSubalgebra : Prop where
  nilpotent : LieAlgebra.IsNilpotent R H
  self_normalizing : H.normalizer = H

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{H : LieSubalgebra R L}
[self : H.IsCartanSubalgebra]


theorem dist_lt_of_nonempty_compact [Nonempty α] [CompactSpace α]
    (w : ∀ x : α, dist (f x) (g x) < C) : dist f g < C

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{f g : BoundedContinuousFunction α β}
{C : ℝ}
[Nonempty α]
[CompactSpace α]
(w : ∀ (x : α), dist (f x) (g x) < C)


@[simp]
theorem ofComplex_toComplex (c : CliffordAlgebra Q) : ofComplex (toComplex c) = c

(c : CliffordAlgebra CliffordAlgebraComplex.Q)

CliffordAlgebraComplex.ofComplex (CliffordAlgebraComplex.toComplex c) = c


@[simp, norm_cast]
theorem coe_inv (hr : r ≠ 0) : (↑r⁻¹ : ℝ≥0∞) = (↑r)⁻¹

↑r⁻¹ = (↑r)⁻¹


protected theorem LocallyIntegrable.neg (hf : LocallyIntegrable f μ) :
    LocallyIntegrable (-f) μ

(hf : MeasureTheory.LocallyIntegrable f μ)


protected theorem liftIndepPr1
    (f : (a : α) → motive (Quot.mk r a))
    (h : ∀ (a b : α) (p : r a b), Eq.ndrec (f a) (sound p) = f b)
    (q : Quot r)
    : (lift (Quot.indep f) (Quot.indepCoherent f h) q).1 = q

(h : ∀ (a b : α) (p : r a b), Eq.ndrec (f a) ⋯ = f b)


theorem filter_add_not (s : Multiset α) : filter p s + filter (fun a => ¬p a) s = s

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

Multiset.filter p s + Multiset.filter (fun a => ¬p a) s = s


theorem cond_pos_of_inter_ne_zero [IsFiniteMeasure μ]
    (hms : MeasurableSet s) (hci : μ (s ∩ t) ≠ 0) : 0 < μ[|s] t

{Ω : Type u_1}
{m : MeasurableSpace Ω}
(μ : MeasureTheory.Measure Ω)
{s t : Set Ω}
[MeasureTheory.IsFiniteMeasure μ]
(hms : MeasurableSet s)
(hci : μ (s ∩ t) ≠ 0)


@[elab_as_elim]
theorem induction_on_prime {P : α → Prop} (a : α) (h₁ : P 0) (h₂ : ∀ x : α, IsUnit x → P x)
    (h₃ : ∀ a p : α, a ≠ 0 → Prime p → P a → P (p * a)) : P a

(h₃ : ∀ (a p : α), a ≠ 0 → Prime p → P a → P (p * a))


lemma comp_v {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂) (h : n₁ + n₂ = n₁₂)
    (p₁ p₂ p₃ : ℤ) (h₁ : p₁ + n₁ = p₂) (h₂ : p₂ + n₂ = p₃) :
    (z₁.comp z₂ h).v p₁ p₃ (by rw [← h₂, ← h₁, ← h, add_assoc]) =
      z₁.v p₁ p₂ h₁ ≫ z₂.v p₂ p₃ h₂

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

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

(z₁.comp z₂ h).v p₁ p₃ ⋯ = z₁.v p₁ p₂ h₁ ≫ z₂.v p₂ p₃ h₂


/-- The triangle in `CochainComplex C ℤ` attached to a degreewise split short exact sequence
of cochain complexes. -/
@[simps! obj₁ obj₂ obj₃ mor₁ mor₂ mor₃]
def triangleOfDegreewiseSplit : Triangle (CochainComplex C ℤ)

(S : CategoryTheory.ShortComplex (CochainComplex C ℤ))

(σ : (n : ℤ) → (S.map (HomologicalComplex.eval C (ComplexShape.up ℤ) n)).Splitting)

(CochainComplex.triangleOfDegreewiseSplit S σ).mor₁ = S.f


lemma exists_card_eq [Infinite α] : ∀ n : ℕ, ∃ s : Finset α, s.card = n


/-- The `x`-neighbourhoods of a space whose topology is induced by a family of seminorms
are exactly the sets which contain seminorm balls around `x`. -/
theorem WithSeminorms.mem_nhds_iff (hp : WithSeminorms p) (x : E) (U : Set E) :
    U ∈ 𝓝 x ↔ ∃ s : Finset ι, ∃ r > 0, (s.sup p).ball x r ⊆ U

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
[TopologicalSpace E]
{p : SeminormFamily 𝕜 E ι}
(hp : WithSeminorms p)
(x : E)
(U : Set E)

U ∈ 𝓝 x ↔ ∃ s, ∃ r > 0, (s.sup p).ball x r ⊆ U


theorem continuous_inf_dom_right {t₁ t₂ : TopologicalSpace α} {t₃ : TopologicalSpace β} :
    Continuous[t₂, t₃] f → Continuous[t₁ ⊓ t₂, t₃] f

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


/-- The group exponent exists for any bounded torsion group. -/
@[to_additive IsAddTorsion.exponentExists
      "The group exponent exists for any bounded additive torsion group."]
theorem IsTorsion.exponentExists (tG : IsTorsion G)
    (bounded : (Set.range fun g : G => orderOf g).Finite) : ExponentExists G

(bounded : (Set.range fun g => orderOf g).Finite)


@[simp] theorem Function.Embedding.sumSet_preimage_inr (h : Disjoint s t) :
    .inr ⁻¹' (Function.Embedding.sumSet h ⁻¹' r) = r ∩ t

{α : Type u_1}
{s t r : Set α}
(h : Disjoint s t)

↑(Sum.inr ⁻¹' (⇑(Function.Embedding.sumSet h) ⁻¹' r)) = r ∩ t


@[simp]
theorem consRecOn_ofGroup {motive : NormalWord d → Sort*}
    (g : G) (ofGroup : ∀g, motive (ofGroup g))
    (cons : ∀ (g : G) (u : ℤˣ) (w : NormalWord d) (h1 : w.head ∈ d.set u)
      (h2 : ∀ u' ∈ Option.map Prod.fst w.toList.head?, w.head
        ∈ toSubgroup A B u → u = u'),
      motive w → motive (cons g u w h1 h2)) :
    consRecOn (.ofGroup g) ofGroup cons = ofGroup g

{d : HNNExtension.NormalWord.TransversalPair G A B}

{motive : HNNExtension.NormalWord d → Sort u_4}

(ofGroup : (g : G) → motive (HNNExtension.NormalWord.ofGroup g))

(cons :
  (g : G) →
    (u : ℤˣ) →
      (w : HNNExtension.NormalWord d) →
        (h1 : w.head ∈ d.set u) →
          (h2 : ∀ u' ∈ Option.map Prod.fst w.toList.head?, w.head ∈ HNNExtension.toSubgroup A B u → u = u') →
            motive w → motive (HNNExtension.NormalWord.cons g u w h1 h2))

HNNExtension.NormalWord.consRecOn (HNNExtension.NormalWord.ofGroup g) ofGroup cons = ofGroup g


theorem Raised.dist_le' {n m} (H : Raised n m) : Nat.dist m n ≤ 1


theorem frequently_atBot [SemilatticeInf α] [Nonempty α] {p : α → Prop} :
    (∃ᶠ x in atBot, p x) ↔ ∀ a, ∃ b ≤ a, p b

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

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


/-- The induced map for spanning subgraphs, which is the identity on vertices. -/
@[simps]
def mapSpanningSubgraphs {G G' : SimpleGraph V} (h : G ≤ G') : G →g G'

{V : Type u_1}
{G G' : SimpleGraph V}
(h : G ≤ G')
(x : V)

(SimpleGraph.Hom.mapSpanningSubgraphs h) x = x


@[to_additive]
theorem comap_equiv_eq_map_symm (f : N ≃* M) (K : Subsemigroup M) :
    K.comap (f : N →ₙ* M) = K.map (f.symm : M →ₙ* N)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(f : N ≃* M)
(K : Subsemigroup M)

Subsemigroup.comap (↑f) K = Subsemigroup.map (↑f.symm) K


theorem IsSubfield.pow_mem {a : F} {n : ℤ} {s : Set F} (hs : IsSubfield s) (h : a ∈ s) :
    a ^ n ∈ s

{F : Type u_1}
[Field F]
{a : F}
{n : ℤ}
{s : Set F}
(hs : IsSubfield s)
(h : a ∈ s)


theorem norm_iteratedFDerivWithin_prod_le [DecidableEq ι] [NormOneClass A'] {u : Finset ι}
    {f : ι → E → A'} {N : ℕ∞} (hf : ∀ i ∈ u, ContDiffOn 𝕜 N (f i) s) (hs : UniqueDiffOn 𝕜 s) {x : E}
    (hx : x ∈ s) {n : ℕ} (hn : (n : ℕ∞) ≤ N) :
    ‖iteratedFDerivWithin 𝕜 n (∏ j ∈ u, f j ·) s x‖ ≤
      ∑ p ∈ u.sym n, (p : Multiset ι).multinomial *
        ∏ j ∈ u, ‖iteratedFDerivWithin 𝕜 (Multiset.count j p) (f j) s x‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
{ι : Type u_2}
{A' : Type u_4}
[NormedCommRing A']
[NormedAlgebra 𝕜 A']
[DecidableEq ι]
[NormOneClass A']
{u : Finset ι}
{f : ι → E → A'}
{N : ℕ∞}
(hf : ∀ i ∈ u, ContDiffOn 𝕜 N (f i) s)
(hs : UniqueDiffOn 𝕜 s)
{x : E}
(hx : x ∈ s)
{n : ℕ}
(hn : ↑n ≤ N)

‖iteratedFDerivWithin 𝕜 n (fun x => ∏ j ∈ u, f j x) s x‖ ≤
  ∑ p ∈ u.sym n, ↑(↑p).multinomial * ∏ j ∈ u, ‖iteratedFDerivWithin 𝕜 (Multiset.count j ↑p) (f j) s x‖


theorem le_def : p ≤ q ↔ (p : E → ℝ) ≤ q

{E : Type u_4}
[AddGroup E]
{p q : NonarchAddGroupNorm E}

p ≤ q ↔ ⇑p ≤ ⇑q


@[ext]
protected theorem ext {ω : Type u} (x x' : WriterT ω M α) (h : x.run = x'.run) : x = x'

{M : Type u → Type v}
{α ω : Type u}
(x x' : WriterT ω M α)
(h : x.run = x'.run)


theorem norm_mkPiAlgebraFin_zero : ‖ContinuousMultilinearMap.mkPiAlgebraFin 𝕜 0 A‖ = ‖(1 : A)‖

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{A : Type u_1}
[NormedRing A]
[NormedAlgebra 𝕜 A]

‖ContinuousMultilinearMap.mkPiAlgebraFin 𝕜 0 A‖ = ‖1‖


/-- **First moment method**. The maximum of a measurable function is greater than its integral,
while avoiding a null set. -/
theorem exists_not_mem_null_lintegral_le (hint : ∫⁻ a, f a ∂μ ≠ ∞) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ ∫⁻ a, f a ∂μ ≤ f x

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{N : Set α}
{f : α → ℝ≥0∞}
[MeasureTheory.IsProbabilityMeasure μ]
(hint : ∫⁻ (a : α), f a ∂μ ≠ ⊤)
(hN : μ N = 0)


theorem Poly.add_denote (ctx : Context) (p₁ p₂ : Poly) : (p₁.add p₂).denote ctx = p₁.denote ctx + p₂.denote ctx

(ctx : Nat.Linear.Context)
(p₁ p₂ : Nat.SOM.Poly)

Nat.SOM.Poly.denote ctx (p₁.add p₂) = Nat.SOM.Poly.denote ctx p₁ + Nat.SOM.Poly.denote ctx p₂


theorem continuous_symm_of_mem_pretrivializationAtlas (he : e ∈ a.pretrivializationAtlas) :
    @ContinuousOn _ _ _ a.totalSpaceTopology e.toPartialEquiv.symm e.target

{e : Pretrivialization F Bundle.TotalSpace.proj}


theorem tendsto_iff_forall_eval_tendsto_topDualPairing {l : Filter α} {f : α → WeakDual 𝕜 E}
    {x : WeakDual 𝕜 E} :
    Tendsto f l (𝓝 x) ↔
      ∀ y, Tendsto (fun i => topDualPairing 𝕜 E (f i) y) l (𝓝 (topDualPairing 𝕜 E x y))

{α : Type u_1}
{𝕜 : Type u_2}
{E : Type u_5}
[CommSemiring 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
[TopologicalSpace E]
{l : Filter α}
{f : α → WeakDual 𝕜 E}
{x : WeakDual 𝕜 E}

Filter.Tendsto f l (𝓝 x) ↔
  ∀ (y : E), Filter.Tendsto (fun i => ((topDualPairing 𝕜 E) (f i)) y) l (𝓝 (((topDualPairing 𝕜 E) x) y))


@[to_additive]
theorem continuousOn_multiset_prod {f : ι → X → M} (s : Multiset ι) {t : Set X} :
    (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (s.map fun i => f i a).prod) t

{ι : Type u_1}
{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[CommMonoid M]
[ContinuousMul M]
{f : ι → X → M}
(s : Multiset ι)
{t : Set X}

(∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => (Multiset.map (fun i => f i a) s).prod) t


/-- Helper lemma for the evaluation of `prec` in the base case. -/
@[simp]
theorem eval_prec_zero (cf cg : Code) (a : ℕ) : eval (prec cf cg) (Nat.pair a 0) = eval cf a

(cf.prec cg).eval (Nat.pair a 0) = cf.eval a


theorem tendsto_nhdsWithin_mono_right {f : β → α} {l : Filter β} {a : α} {s t : Set α} (hst : s ⊆ t)
    (h : Tendsto f l (𝓝[s] a)) : Tendsto f l (𝓝[t] a)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
{f : β → α}
{l : Filter β}
{a : α}
{s t : Set α}
(hst : s ⊆ t)
(h : Filter.Tendsto f l (𝓝[s] a))


@[simp]
lemma castOrderIso_refl (h : n = n := rfl) : castOrderIso h = OrderIso.refl (Fin n)

Fin.castOrderIso h = OrderIso.refl (Fin n)


theorem isRightDescent_iff_not_isRightDescent_mul {w : W} {i : B} :
    cs.IsRightDescent w i ↔ ¬cs.IsRightDescent (w * s i) i

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
{w : W}
{i : B}

cs.IsRightDescent w i ↔ ¬cs.IsRightDescent (w * cs.simple i) i


/-- `sectl C Z` is the functor `C ⥤ C × D` given by `X ↦ (X, Z)`. -/
@[simps]
def sectl (C : Type u₁) [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] (Z : D) : C ⥤ C × D

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

∀ {X Y : C} (f : X ⟶ Y), (CategoryTheory.Prod.sectl C Z).map f = (f, CategoryTheory.CategoryStruct.id Z)


@[simp]
theorem mirror_zero : (0 : R[X]).mirror = 0


lemma integrable_pow_neg_integrablePower
    (μ : Measure D) [h : μ.HasTemperateGrowth] :
    Integrable (fun x ↦ (1 + ‖x‖) ^ (- (μ.integrablePower : ℝ))) μ

{D : Type u_3}
[NormedAddCommGroup D]
[MeasurableSpace D]
(μ : MeasureTheory.Measure D)
[h : μ.HasTemperateGrowth]

MeasureTheory.Integrable (fun x => (1 + ‖x‖) ^ (-↑μ.integrablePower)) μ


/-- A `Monoid` is a `Semigroup` with an element `1` such that `1 * a = a * 1 = a`. -/
@[to_additive]
class Monoid (M : Type u) extends Semigroup M, MulOneClass M where
  /-- Raising to the power of a natural number. -/
  protected npow : ℕ → M → M := npowRec
  /-- Raising to the power `(0 : ℕ)` gives `1`. -/
  protected npow_zero : ∀ x, npow 0 x = 1 := by intros; rfl
  /-- Raising to the power `(n + 1 : ℕ)` behaves as expected. -/
  protected npow_succ : ∀ (n : ℕ) (x), npow (n + 1) x = npow n x * x := by intros; rfl

{M : Type u}
[self : Monoid M]
(n : ℕ)
(x : M)

Monoid.npow (n + 1) x = Monoid.npow n x * x


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

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


theorem inf_uniformity {u v : UniformSpace α} : 𝓤[u ⊓ v] = 𝓤[u] ⊓ 𝓤[v]

𝓤 α = 𝓤 α ⊓ 𝓤 α


theorem IsCompl.symmDiff_eq_top {a b : α} (h : IsCompl a b) : a ∆ b = ⊤

{α : Type u_2}
[CoheytingAlgebra α]
{a b : α}
(h : IsCompl a b)


/-- A structure designed to hold the hypotheses for the Mellin-functional-equation argument
(most general version: rapid decay at `∞` up to constant terms) -/
structure WeakFEPair where
  /-- The functions whose Mellin transform we study -/
  (f g : ℝ → E)
  /-- Weight (exponent in the functional equation) -/
  (k : ℝ)
  /-- Root number -/
  (ε : ℂ)
  /-- Constant terms at `∞` -/
  (f₀ g₀ : E)
  (hf_int : LocallyIntegrableOn f (Ioi 0))
  (hg_int : LocallyIntegrableOn g (Ioi 0))
  (hk : 0 < k)
  (hε : ε ≠ 0)
  (h_feq : ∀ x ∈ Ioi 0, f (1 / x) = (ε * ↑(x ^ k)) • g x)
  (hf_top (r : ℝ) : (f · - f₀) =O[atTop] (· ^ r))
  (hg_top (r : ℝ) : (g · - g₀) =O[atTop] (· ^ r))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(self : WeakFEPair E)

MeasureTheory.LocallyIntegrableOn self.g (Set.Ioi 0) MeasureTheory.volume


/-- Being finitely-presented is stable under base change. -/
theorem finitePresentation_stableUnderBaseChange : StableUnderBaseChange @FinitePresentation


@[to_additive (attr := simp)]
theorem mulETransformRight_inv : mulETransformRight e⁻¹ x = (mulETransformLeft e x.swap).swap

{α : Type u_1}
[DecidableEq α]
[CommGroup α]
(e : α)
(x : Finset α × Finset α)

Finset.mulETransformRight e⁻¹ x = (Finset.mulETransformLeft e x.swap).swap


lemma eq_of_sq_eq_sq {B : Matrix n n 𝕜} (hB : PosSemidef B) (hAB : A ^ 2 = B ^ 2) : A = B

{n : Type u_2}
{𝕜 : Type u_4}
[Fintype n]
[RCLike 𝕜]
[DecidableEq n]
{A : Matrix n n 𝕜}
(hA : A.PosSemidef)
{B : Matrix n n 𝕜}
(hB : B.PosSemidef)
(hAB : A ^ 2 = B ^ 2)


@[to_additive]
theorem dense_of_nonempty_smul_invariant [IsMinimal M α] {s : Set α} (hne : s.Nonempty)
    (hsmul : ∀ c : M, c • s ⊆ s) : Dense s

(M : Type u_1)
{α : Type u_3}
[AddMonoid M]
[TopologicalSpace α]
[AddAction M α]
[AddAction.IsMinimal M α]
{s : Set α}
(hne : s.Nonempty)
(hsmul : ∀ (c : M), c +ᵥ s ⊆ s)


@[to_additive]
protected lemma div_mul_cancel_left (h : IsUnit a) (b : α) : a / (a * b) = b⁻¹

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


@[to_additive]
theorem of_mulOpposite (h : UniqueProds Gᵐᵒᵖ) : UniqueProds G

{G : Type u}
[Mul G]
(h : UniqueProds Gᵐᵒᵖ)


@[to_additive]
theorem iInter_mul_subset (s : ι → Set α) (t : Set α) : (⋂ i, s i) * t ⊆ ⋂ i, s i * t

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


theorem Antiperiodic.sub [AddGroup α] [InvolutiveNeg β] (h1 : Antiperiodic f c₁)
    (h2 : Antiperiodic f c₂) : Periodic f (c₁ - c₂)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c₁ c₂ : α}
[AddGroup α]
[InvolutiveNeg β]
(h1 : Function.Antiperiodic f c₁)
(h2 : Function.Antiperiodic f c₂)


theorem absolutelyContinuous_of_le (h : μ ≤ ν) : μ ≪ ν

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(h : μ ≤ ν)


theorem comap_unop_pow (n : ℕ) :
    comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) (M ^ n) =
      comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) M ^ n

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

Submodule.comap (↑(MulOpposite.opLinearEquiv R).symm) (M ^ n) =
  Submodule.comap (↑(MulOpposite.opLinearEquiv R).symm) M ^ n


theorem frequently_of_forall {f : Filter α} [NeBot f] {p : α → Prop} (h : ∀ x, p x) :
    ∃ᶠ x in f, p x

{α : Type u}
{f : Filter α}
[f.NeBot]
{p : α → Prop}
(h : ∀ (x : α), p x)


theorem comap_id' : comap (fun x => x) f = f


@[deprecated tendsto_iff_tendstoLocallyUniformly (since := "2023-09-03")]
theorem tendstoLocallyUniformly_of_tendsto [WeaklyLocallyCompactSpace α] (h : Tendsto F p (𝓝 f)) :
    TendstoLocallyUniformly (fun i a => F i a) f p

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

TendstoLocallyUniformly (fun i a => (F i) a) (⇑f) p


@[simp] lemma sup_Iic [OrderBot α] (a : α) : (Iic a).sup id = a

{α : Type u_2}
[SemilatticeSup α]
[LocallyFiniteOrderBot α]
[OrderBot α]
(a : α)


theorem isOpen_extend_source : IsOpen (f.extend I).source

{𝕜 : 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)


/-- Equivalence of categories is reflexive. -/
@[refl, simps]
def refl : C ≌ C

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

CategoryTheory.Equivalence.refl.unitIso = CategoryTheory.Iso.refl (CategoryTheory.Functor.id C)


@[simp]
protected lemma div_left_inj (hda : d ∣ a) (hdb : d ∣ b) : a / d = b / d ↔ a = b


/-- In a nontrivial real normed space, a sphere is nonempty if and only if its radius is
nonnegative. -/
@[simp]
theorem NormedSpace.sphere_nonempty [Nontrivial E] {x : E} {r : ℝ} :
    (sphere x r).Nonempty ↔ 0 ≤ r

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[Nontrivial E]
{x : E}
{r : ℝ}


theorem mem_pure (x y : α) : x ∈ (pure y : List α) ↔ x = y


@[to_additive]
theorem smul_mem_nhds (a : α) {x : β} (ht : t ∈ 𝓝 x) : a • t ∈ 𝓝 (a • x)

{α : Type u}
{β : Type v}
[TopologicalSpace β]
[Group α]
[MulAction α β]
[ContinuousConstSMul α β]
{t : Set β}
(a : α)
{x : β}
(ht : t ∈ 𝓝 x)


@[simp]
theorem inclusion_inclusion {E F G : IntermediateField K L} (hEF : E ≤ F) (hFG : F ≤ G) (x : E) :
    inclusion hFG (inclusion hEF x) = inclusion (le_trans hEF hFG) x

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{E F G : IntermediateField K L}
(hEF : E ≤ F)
(hFG : F ≤ G)
(x : ↥E)

(IntermediateField.inclusion hFG) ((IntermediateField.inclusion hEF) x) = (IntermediateField.inclusion ⋯) x


theorem nonneg_iff : 0 ≤ z ↔ 0 ≤ re z ∧ im z = 0

0 ≤ z ↔ 0 ≤ RCLike.re z ∧ RCLike.im z = 0


theorem mapTR_loop_eq (f : α → β) (as : List α) (bs : List β) :
    mapTR.loop f as bs = bs.reverse ++ map f as

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

List.mapTR.loop f as bs = bs.reverse ++ List.map f as


@[simp]
theorem cast_div [DivisionSemiring α] {m n : ℕ} (n_dvd : n ∣ m) (hn : (n : α) ≠ 0) :
    ((m / n : ℕ) : α) = m / n

{α : Type u_1}
[DivisionSemiring α]
{m n : ℕ}
(n_dvd : n ∣ m)
(hn : ↑n ≠ 0)


theorem Ioi_ae_eq_Ici' (ha : μ {a} = 0) : Ioi a =ᵐ[μ] Ici a

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[PartialOrder α]
{a : α}
(ha : μ {a} = 0)


/-- Every presheaf is a sheaf for the maximal sieve.

[Elephant] C2.1.5(ii)
-/
theorem isSheafFor_top_sieve (P : Cᵒᵖ ⥤ Type w) : IsSheafFor P ((⊤ : Sieve X) : Presieve X)

(P : CategoryTheory.Functor Cᵒᵖ (Type w))


theorem Function.Surjective.le_map_cofinite {f : α → β} (hf : Surjective f) :
    cofinite ≤ map f cofinite

{α : Type u_2}
{β : Type u_3}
{f : α → β}
(hf : Function.Surjective f)

Filter.cofinite ≤ Filter.map f Filter.cofinite


theorem isCycle_of_prime_order'' {σ : Perm α} (h1 : (Fintype.card α).Prime)
    (h2 : orderOf σ = Fintype.card α) : σ.IsCycle

{α : Type u_1}
[Fintype α]
{σ : Equiv.Perm α}
(h1 : Nat.Prime (Fintype.card α))
(h2 : orderOf σ = Fintype.card α)


theorem _root_.Finset.eventually_cocardinal_nmem (s : Finset α) :
    ∀ᶠ x in cocardinal α hreg, x ∉ s

{α : Type u}
{c : Cardinal.{u}}
{hreg : c.IsRegular}
(s : Finset α)

∀ᶠ (x : α) in Filter.cocardinal α hreg, x ∉ s


/-- **Fundamental theorem of calculus-1**, strict differentiability in the left endpoint.

If `f : ℝ → E` is integrable on `a..b` and `f` is continuous at `a`, then `u ↦ ∫ x in u..b, f x` has
derivative `-f a` at `a` in the sense of strict differentiability. -/
theorem integral_hasStrictDerivAt_left (hf : IntervalIntegrable f volume a b)
    (hmeas : StronglyMeasurableAtFilter f (𝓝 a)) (ha : ContinuousAt f a) :
    HasStrictDerivAt (fun u => ∫ x in u..b, f x) (-f a) a

(hf : IntervalIntegrable f MeasureTheory.volume a b)

(hmeas : StronglyMeasurableAtFilter f (𝓝 a) MeasureTheory.volume)

HasStrictDerivAt (fun u => ∫ (x : ℝ) in u..b, f x) (-f a) a


/-- Additive coercion from `CuspForm` to `ℍ → ℂ`. -/
@[simps]
def coeHom : CuspForm Γ k →+ ℍ → ℂ

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f : CuspForm Γ k)
(a : ℍ)


/-- To every monoid object in `C ⥤ C` we associate a `Monad C`. -/
@[simps η μ]
def ofMon (M : Mon_ (C ⥤ C)) : Monad C

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

(CategoryTheory.Monad.ofMon M).μ = M.mul


theorem geom_sum₂_Ico [Field α] {x y : α} (hxy : x ≠ y) {m n : ℕ} (hmn : m ≤ n) :
    (∑ i ∈ Finset.Ico m n, x ^ i * y ^ (n - 1 - i)) = (x ^ n - y ^ (n - m) * x ^ m) / (x - y)

{α : Type u}
[Field α]
{x y : α}
(hxy : x ≠ y)
{m n : ℕ}
(hmn : m ≤ n)

∑ i ∈ Finset.Ico m n, x ^ i * y ^ (n - 1 - i) = (x ^ n - y ^ (n - m) * x ^ m) / (x - y)


/-- `F.flip` composed with evaluation is the same as evaluating `F`. -/
@[simps!]
def flipCompEvaluation (F : A ⥤ B ⥤ C) (a) : F.flip ⋙ (evaluation _ _).obj a ≅ F.obj a

(F : CategoryTheory.Functor A (CategoryTheory.Functor B C))

(CategoryTheory.flipCompEvaluation F a).inv.app X = CategoryTheory.CategoryStruct.id ((F.obj a).obj X)


theorem eq_true_of_decide {p : Prop} [Decidable p] (h : decide p = true) : p = True


@[to_additive (attr := simp, norm_cast)]
theorem coe_div [Div β] (f g : α →ₛ β) : ⇑(f / g) = ⇑f / ⇑g

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


@[simp] lemma card_piFinset (s : ∀ i, Finset (α i)) :
    (piFinset s).card = ∏ i, (s i).card

{ι : Type u_4}
{α : ι → Type u_6}
[DecidableEq ι]
[Fintype ι]
(s : (i : ι) → Finset (α i))

(Fintype.piFinset s).card = ∏ i : ι, (s i).card


theorem not_isField : ¬IsField (ringOfIntegers Fq F)

(Fq F : Type)
[Field Fq]
[Field F]
[Algebra Fq[X] F]
[Algebra (RatFunc Fq) F]
[IsScalarTower Fq[X] (RatFunc Fq) F]

¬IsField ↥(FunctionField.ringOfIntegers Fq F)


theorem trace_prod [Module.Free R S] [Module.Free R T] [Module.Finite R S] [Module.Finite R T] :
    trace R (S × T) = (trace R S).coprod (trace R T)

{R : Type u_1}
{S : Type u_2}
{T : Type u_3}
[CommRing R]
[CommRing S]
[CommRing T]
[Algebra R S]
[Algebra R T]
[Module.Free R S]
[Module.Free R T]
[Module.Finite R S]
[Module.Finite R T]

Algebra.trace R (S × T) = (Algebra.trace R S).coprod (Algebra.trace R T)


/-- An algebra morphism with an underlying monomorphism hom in `C` is an algebra monomorphism. -/
theorem mono_of_mono {X Y : Algebra F} (f : X ⟶ Y) [h : Mono f.1] : Mono f

{X Y : CategoryTheory.Endofunctor.Algebra F}


/-- The cokernel of `biprod.inr : Y ⟶ X ⊞ Y` is `X`. -/
@[simps!]
def cokernelBiprodInrIso : cokernel (biprod.inr : Y ⟶ X ⊞ Y) ≅ X

CategoryTheory.Limits.cokernelBiprodInrIso.inv =
  (CategoryTheory.Limits.biprod.isCokernelInrCokernelFork X Y).desc
    (CategoryTheory.Limits.colimit.cocone (CategoryTheory.Limits.parallelPair CategoryTheory.Limits.biprod.inr 0))


@[simp]
theorem sum_zero [Zero M] [AddCommMonoid N] {f : α →₀ M} : (f.sum fun _ _ => (0 : N)) = 0

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[AddCommMonoid N]
{f : α →₀ M}


theorem mem_supp {α : Type u} (x : F α) (u : α) :
    u ∈ supp x ↔ ∀ a f, abs ⟨a, f⟩ = x → u ∈ f '' univ

{F : Type u → Type u}
[q : QPF F]
{α : Type u}
(x : F α)
(u : α)

u ∈ Functor.supp x ↔ ∀ (a : (QPF.P F).A) (f : (QPF.P F).B a → α), QPF.abs ⟨a, f⟩ = x → u ∈ f '' Set.univ


[Submodule.IsPrincipal (Ideal.span {x, y})]


@[simp]
theorem exp_sub_cosh : exp x - cosh x = sinh x

Complex.exp x - Complex.cosh x = Complex.sinh x


/-- This combines `Nat.iInf_of_empty` with `ciInf_const`. -/
@[simp]
lemma iInf_const_zero {ι : Sort*} : ⨅ i : ι, 0 = 0


/-- Taking a product over `f : α →₀ M` is the same as multiplying the value on a single element
`y ∈ f.support` by the product over `erase y f`. -/
@[to_additive
      " Taking a sum over `f : α →₀ M` is the same as adding the value on a
      single element `y ∈ f.support` to the sum over `erase y f`. "]
theorem mul_prod_erase (f : α →₀ M) (y : α) (g : α → M → N) (hyf : y ∈ f.support) :
    g y (f y) * (erase y f).prod g = f.prod g

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[AddCommMonoid N]
(f : α →₀ M)
(y : α)
(g : α → M → N)
(hyf : y ∈ f.support)

g y (f y) + (Finsupp.erase y f).sum g = f.sum g


theorem isTorsionBy_iff_mem_ker_lsmul :
    IsTorsionBy R M a ↔ a ∈ LinearMap.ker (LinearMap.lsmul R M)

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

Module.IsTorsionBy R M a ↔ a ∈ LinearMap.ker (LinearMap.lsmul R M)


@[simp]
protected theorem map_neg (a : R) : abv (-a) = abv a

{R : Type u_3}
{S : Type u_4}
[OrderedCommRing S]
[Ring R]
(abv : AbsoluteValue R S)
[NoZeroDivisors S]
(a : R)


/-- Specialization of `Finset.card_nbij` that automatically fills in most arguments.

See `Fintype.card_bijective` for the version where `s` and `t` are `univ`. -/
lemma card_bijective (e : α → β) (he : e.Bijective) (hst : ∀ i, i ∈ s ↔ e i ∈ t) :
    s.card = t.card

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
(e : α → β)
(he : Function.Bijective e)
(hst : ∀ (i : α), i ∈ s ↔ e i ∈ t)


lemma map_comp_mkQ (f : M →ₗ[R] M') :
    map r f ∘ₗ mkQ (r • ⊤) = mkQ (r • ⊤) ∘ₗ f

{R : Type u_2}
[CommRing R]
(r : R)
{M : Type u_1}
{M' : Type u_3}
[AddCommGroup M]
[Module R M]
[AddCommGroup M']
[Module R M']
(f : M →ₗ[R] M')

(QuotSMulTop.map r) f ∘ₗ (r • ⊤).mkQ = (r • ⊤).mkQ ∘ₗ f


@[to_additive (attr := simp)]
theorem toList_symm : (@toList α).symm = ofList


/-- `Fin.natAdd` as an `OrderEmbedding`.

`natAddOrderEmb n i` adds `n` to `i` "on the left". -/
@[simps! apply toEmbedding]
def natAddOrderEmb (n) : Fin m ↪o Fin (n + m)

(Fin.natAddOrderEmb n) i = Fin.natAdd n i


theorem Associated.prime_iff [CommMonoidWithZero α] {p q : α} (h : p ~ᵤ q) : Prime p ↔ Prime q

{α : Type u_1}
[CommMonoidWithZero α]
{p q : α}
(h : p ~ᵤ q)


theorem bot_arrow_eq_zero [HasZeroMorphisms C] {B : C} : (⊥ : MonoOver B).arrow = 0


theorem add_log_le_log_mul {x y : Ordinal} (b : Ordinal) (hx : x ≠ 0) (hy : y ≠ 0) :
    log b x + log b y ≤ log b (x * y)

{x y : Ordinal.{u_1}}
(b : Ordinal.{u_1})
(hx : x ≠ 0)
(hy : y ≠ 0)

Ordinal.log b x + Ordinal.log b y ≤ Ordinal.log b (x * y)


lemma dual_surjective_iff_injective {f : A →ₗ[R] A'} :
    Function.Surjective (dual f) ↔ Function.Injective f

{R : Type uR}
[CommRing R]
{A : Type uA}
[AddCommGroup A]
{A' : Type u_1}
[AddCommGroup A']
[Module R A]
[Module R A']
{f : A →ₗ[R] A'}

Function.Surjective ⇑(CharacterModule.dual f) ↔ Function.Injective ⇑f


@[simp]
theorem basis_pair_left (hij : i ≠ j) : Lagrange.basis {i, j} v i = basisDivisor (v i) (v j)

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{v : ι → F}
{i j : ι}
(hij : i ≠ j)

Lagrange.basis {i, j} v i = Lagrange.basisDivisor (v i) (v j)


/-- The morphism of sheaves of modules `sheafify α φ ⟶ sheafify α φ'`
induced by morphisms `τ₀ : M₀ ⟶ M₀'` and `τ : A ⟶ A'`
which satisfy `τ₀.hom ≫ φ' = φ ≫ τ.val`. -/
@[simps]
def sheafifyMap : sheafify α φ ⟶ sheafify α φ'

{J : CategoryTheory.GrothendieckTopology C}

{A' : CategoryTheory.Sheaf J AddCommGrp}

(PresheafOfModules.sheafifyMap α φ φ' τ₀ τ fac).val.hom = τ.val


theorem natDegree_mul_C_le (f : R[X]) (a : R) : (f * C a).natDegree ≤ f.natDegree

{R : Type u}
[Semiring R]
(f : R[X])
(a : R)

(f * Polynomial.C a).natDegree ≤ f.natDegree


lemma Infinite.preimage' (hs : (s ∩ range f).Infinite) : (f ⁻¹' s).Infinite

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


@[to_additive (attr := simp) MeasureTheory.addFundamentalFrontier_vadd]
theorem fundamentalFrontier_smul [Group H] [MulAction H α] [SMulCommClass H G α] (g : H) :
    fundamentalFrontier G (g • s) = g • fundamentalFrontier G s

(G : Type u_1)
{H : Type u_2}
{α : Type u_3}
[Group G]
[MulAction G α]
(s : Set α)
[Group H]
[MulAction H α]
[SMulCommClass H G α]
(g : H)

MeasureTheory.fundamentalFrontier G (g • s) = g • MeasureTheory.fundamentalFrontier G s


/-- A variation around the pseudometric characterization of Cauchy sequences -/
theorem Metric.cauchySeq_iff' {u : β → α} :
    CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, dist (u n) (u N) < ε

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[Nonempty β]
[SemilatticeSup β]
{u : β → α}


@[simp]
theorem subtypePerm_pow (f : Perm α) (n : ℕ) (hf) :
    (f.subtypePerm hf : Perm { x // p x }) ^ n = (f ^ n).subtypePerm (pow_aux hf)

{α : Type u}
{p : α → Prop}
(f : Equiv.Perm α)
(n : ℕ)
(hf : ∀ (x : α), p x ↔ p (f x))

f.subtypePerm hf ^ n = (f ^ n).subtypePerm ⋯


@[simp]
theorem pred_lt_iff_not_isMin : pred a < a ↔ ¬IsMin a

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


@[to_additive]
theorem Nonempty.of_smul_left : (s • t).Nonempty → s.Nonempty

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


@[simp]
theorem Ico_diff_Iio : Ico a b \ Iio c = Ico (max a c) b

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

Set.Ico a b \ Set.Iio c = Set.Ico (max a c) b


theorem ordConnected_iff_uIcc_subset :
    OrdConnected s ↔ ∀ ⦃x⦄ (_ : x ∈ s) ⦃y⦄ (_ : y ∈ s), [[x, y]] ⊆ s

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

s.OrdConnected ↔ ∀ ⦃x : α⦄, x ∈ s → ∀ ⦃y : α⦄, y ∈ s → [[x, y]] ⊆ s


lemma setLIntegral_condKernel_univ_left (hf : Measurable f) {t : Set Ω}
    (ht : MeasurableSet t) :
    ∫⁻ b, ∫⁻ ω in t, f (b, ω) ∂(ρ.condKernel b) ∂ρ.fst
      = ∫⁻ x in Set.univ ×ˢ t, f x ∂ρ

{β : Type u_2}
{Ω : Type u_3}
{mβ : MeasurableSpace β}
[MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{ρ : MeasureTheory.Measure (β × Ω)}
[MeasureTheory.IsFiniteMeasure ρ]
{f : β × Ω → ℝ≥0∞}
(hf : Measurable f)
{t : Set Ω}
(ht : MeasurableSet t)

∫⁻ (b : β), ∫⁻ (ω : Ω) in t, f (b, ω) ∂ρ.condKernel b ∂ρ.fst = ∫⁻ (x : β × Ω) in Set.univ ×ˢ t, f x ∂ρ


theorem closedEmbedding_comap_of_surjective (hf : Surjective f) : ClosedEmbedding (comap f)

{R : Type u}
(S : Type v)
[CommRing R]
[CommRing S]
(f : R →+* S)
(hf : Function.Surjective ⇑f)


/-- The equivalence between `NonemptyFinLinOrd` and itself induced by `OrderDual` both ways. -/
@[simps functor inverse]
def dualEquiv : NonemptyFinLinOrd ≌ NonemptyFinLinOrd


/-- The `n`th coefficient of `id 𝕜 E` is the identity when `n = 1`. We state this in a dependent
way, as it will often appear in this form. -/
theorem id_apply_one' {n : ℕ} (h : n = 1) (v : Fin n → E) :
    (id 𝕜 E) n v = v ⟨0, h.symm ▸ zero_lt_one⟩

(𝕜 : Type u_1)
(E : Type u_2)
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{n : ℕ}
(h : n = 1)
(v : Fin n → E)

(FormalMultilinearSeries.id 𝕜 E n) v = v ⟨0, ⋯⟩


@[to_additive]
theorem of_leftInverse [MonoidHomClass G N M] {f : F} {x : M} (g : G)
    (hfg : Function.LeftInverse g f) (h : IsUnit (f x)) : IsUnit x

{F : Type u_1}
{G : Type u_2}
{M : Type u_4}
{N : Type u_5}
[FunLike F M N]
[FunLike G N M]
[Monoid M]
[Monoid N]
[MonoidHomClass G N M]
{f : F}
{x : M}
(g : G)
(hfg : Function.LeftInverse ⇑g ⇑f)
(h : IsUnit (f x))


@[nontriviality, continuity, fun_prop]
theorem continuous_of_discreteTopology [TopologicalSpace β] {f : α → β} : Continuous f

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


/-- The sine of an angle in a right-angled triangle as a ratio of sides, version subtracting
vectors. -/
theorem sin_oangle_sub_right_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    Real.Angle.sin (o.oangle y (y - x)) = ‖x‖ / ‖y - x‖

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

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


theorem dist_center_eq_dist_center_of_mem_sphere' {p₁ p₂ : P} {s : Sphere P} (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) : dist s.center p₁ = dist s.center p₂

{P : Type u_2}
[MetricSpace P]
{p₁ p₂ : P}
{s : EuclideanGeometry.Sphere P}
(hp₁ : p₁ ∈ s)
(hp₂ : p₂ ∈ s)


theorem smul_fst (s : S) (a : 𝓜(𝕜, A)) : (s • a).fst = s • a.fst

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
{S : Type u_3}
[Monoid S]
[DistribMulAction S A]
[SMulCommClass 𝕜 S A]
[ContinuousConstSMul S A]
[IsScalarTower S A A]
[SMulCommClass S A A]
(s : S)
(a : 𝓜(𝕜, A))


theorem holderOnWith_univ {C r : ℝ≥0} {f : X → Y} : HolderOnWith C r f univ ↔ HolderWith C r f

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}

HolderOnWith C r f Set.univ ↔ HolderWith C r f


theorem not_lt_of_le {x y : Int} (h : y ≤ x) : ¬ (x < y)


theorem eq_replicate {a : α} {n} {l : List α} :
    l = replicate n a ↔ length l = n ∧ ∀ (b) (_ : b ∈ l), b = a

{α : Type u_1}
{a : α}
{n : Nat}
{l : List α}

l = List.replicate n a ↔ l.length = n ∧ ∀ (b : α), b ∈ l → b = a


@[to_additive (attr := simp 1100)]
protected theorem one_le_div_iff : 1 ≤ f / g ↔ ¬Disjoint f g

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


theorem piCongrLeft_symm_preimage_univ_pi (f : ι' ≃ ι) (t : ∀ i, Set (α i)) :
    (f.piCongrLeft α).symm ⁻¹' univ.pi (fun i' => t <| f i') = univ.pi t

{ι : Type u_1}
{ι' : Type u_2}
{α : ι → Type u_3}
(f : ι' ≃ ι)
(t : (i : ι) → Set (α i))

(⇑(Equiv.piCongrLeft α f).symm ⁻¹' Set.univ.pi fun i' => t (f i')) = Set.univ.pi t


theorem ManyOneEquiv.of_equiv {α β} [Primcodable α] [Primcodable β] {e : α ≃ β} (h : e.Computable)
    {p} : ManyOneEquiv (p ∘ e) p

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{e : α ≃ β}
(h : e.Computable)
{p : β → Prop}


theorem Filter.Tendsto.congr_germ {f g : β → γ} {l : Filter α} {l' : Filter β} (h : f =ᶠ[l'] g)
    {φ : α → β} (hφ : Tendsto φ l l') : (f ∘ φ : Germ l γ) = g ∘ φ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f g : β → γ}
{l : Filter α}
{l' : Filter β}
(h : f =ᶠ[l'] g)
{φ : α → β}
(hφ : Filter.Tendsto φ l l')


theorem isAssociative_right [Std.Associative ga] (h : Semiconj₂ f ga gb) (h_surj : Surjective f) :
    Std.Associative gb

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{ga : α → α → α}
{gb : β → β → β}
[Std.Associative ga]
(h : Function.Semiconj₂ f ga gb)
(h_surj : Function.Surjective f)


theorem updateRow_transpose [DecidableEq n] : updateRow Mᵀ j c = (updateColumn M j c)ᵀ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{M : Matrix m n α}
{j : n}
{c : m → α}
[DecidableEq n]

M.transpose.updateRow j c = (M.updateColumn j c).transpose


@[simp]
theorem deriv_exp (hc : DifferentiableAt ℝ f x) :
    deriv (fun x => Real.exp (f x)) x = Real.exp (f x) * deriv f x

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


private lemma isCoprime_Y_Z : IsCoprime S.Y S.Z

(S : FermatLastTheoremForThreeGen.Solution hζ)

IsCoprime (FermatLastTheoremForThreeGen.Solution.Y S) (FermatLastTheoremForThreeGen.Solution.Z S)


@[to_additive]
theorem toEquiv_apply {f : G ⧸ H → G} (hf : ∀ q, (f q : G ⧸ H) = q) (q : G ⧸ H) :
    (toEquiv (range_mem_leftTransversals hf) q : G) = f q

{G : Type u_1}
[Group G]
{H : Subgroup G}
{f : G ⧸ H → G}
(hf : ∀ (q : G ⧸ H), ↑(f q) = q)
(q : G ⧸ H)

↑((Subgroup.MemLeftTransversals.toEquiv ⋯) q) = f q


@[simp]
theorem symm_comp (e : R ≃+* S) : (e.symm : S →+* R).comp (e : R →+* S) = RingHom.id R

{R : Type u_4}
{S : Type u_5}
[NonAssocSemiring R]
[NonAssocSemiring S]
(e : R ≃+* S)


@[simp] theorem elem_nil [BEq α] : ([] : List α).elem a = false


theorem tmul_sum (m : M) {α : Type*} (s : Finset α) (n : α → N) :
    (m ⊗ₜ[R] ∑ a ∈ s, n a) = ∑ a ∈ s, m ⊗ₜ[R] n a

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(m : M)
{α : Type u_10}
(s : Finset α)
(n : α → N)

m ⊗ₜ[R] ∑ a ∈ s, n a = ∑ a ∈ s, m ⊗ₜ[R] n a


@[to_additive]
theorem UniformGroup.toUniformSpace_eq {G : Type*} [u : UniformSpace G] [Group G]
    [UniformGroup G] : TopologicalGroup.toUniformSpace G = u

{G : Type u_2}
[u : UniformSpace G]
[Group G]
[UniformGroup G]


theorem lintegral_nnnorm_condexpIndSMul_le (hm : m ≤ m0) (hs : MeasurableSet s) (hμs : μ s ≠ ∞)
    (x : G) [SigmaFinite (μ.trim hm)] : ∫⁻ a, ‖condexpIndSMul hm hs hμs x a‖₊ ∂μ ≤ μ s * ‖x‖₊

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[NormedSpace ℝ G]
(hm : m ≤ m0)
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(x : G)
[MeasureTheory.SigmaFinite (μ.trim hm)]

∫⁻ (a : α), ↑‖↑↑(MeasureTheory.condexpIndSMul hm hs hμs x) a‖₊ ∂μ ≤ μ s * ↑‖x‖₊


theorem op_le_iff {S₁ : Subalgebra R A} {S₂ : Subalgebra R Aᵐᵒᵖ} : S₁.op ≤ S₂ ↔ S₁ ≤ S₂.unop

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{S₁ : Subalgebra R A}
{S₂ : Subalgebra R Aᵐᵒᵖ}


/-- Homotopy between morphisms of short complexes is compatible with postcomposition. -/
@[simps]
def compRight (h : Homotopy φ₁ φ₂) (ψ : S₂ ⟶ S₃) : Homotopy (φ₁ ≫ ψ) (φ₂ ≫ ψ)

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

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

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

(h.compRight ψ).h₀ = CategoryTheory.CategoryStruct.comp h.h₀ ψ.τ₁


/-- Recurrence formula for the Beta function. -/
theorem betaIntegral_recurrence {u v : ℂ} (hu : 0 < re u) (hv : 0 < re v) :
    u * betaIntegral u (v + 1) = v * betaIntegral (u + 1) v

u * u.betaIntegral (v + 1) = v * (u + 1).betaIntegral v


lemma abs_eq_one_iff' : abs x = 1 ↔ ∃ θ ∈ Set.Ioc (-π) π, exp (θ * I) = x

Complex.abs x = 1 ↔ ∃ θ ∈ Set.Ioc (-π) π, Complex.exp (↑θ * Complex.I) = x


@[ext]
theorem ext (e₁ e₂ : M ≃ₗ⁅R,L⁆ N) (h : ∀ m, e₁ m = e₂ m) : e₁ = e₂

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
(e₁ e₂ : M ≃ₗ⁅R,L⁆ N)
(h : ∀ (m : M), e₁ m = e₂ m)


theorem of_isBilimit {b : BinaryBicone X Y} (h : b.IsBilimit) :
    IsPushout (0 : 0 ⟶ X) (0 : 0 ⟶ Y) b.inl b.inr

{b : CategoryTheory.Limits.BinaryBicone X Y}

CategoryTheory.IsPushout 0 0 b.inl b.inr


@[simp]
theorem transFiberHomeomorph_apply {F' : Type*} [TopologicalSpace F'] (e : Trivialization F proj)
    (h : F ≃ₜ F') (x : Z) : e.transFiberHomeomorph h x = ((e x).1, h (e x).2)

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
{F' : Type u_6}
[TopologicalSpace F']
(e : Trivialization F proj)
(h : F ≃ₜ F')
(x : Z)

↑(e.transFiberHomeomorph h) x = ((↑e x).1, h (↑e x).2)


/-- If `r ≠ 0` and `‖pₙ‖ rⁿ = O(aⁿ)` for some `-1 < a < 1`, then `r < p.radius`. -/
theorem lt_radius_of_isBigO (h₀ : r ≠ 0) {a : ℝ} (ha : a ∈ Ioo (-1 : ℝ) 1)
    (hp : (fun n => ‖p n‖ * (r : ℝ) ^ n) =O[atTop] (a ^ ·)) : ↑r < p.radius

(hp : (fun n => ‖p n‖ * ↑r ^ n) =O[Filter.atTop] fun x => a ^ x)


@[simp]
theorem det_vandermonde_sub {n : ℕ} (v : Fin n → R) (a : R) :
    (Matrix.vandermonde fun i ↦ v i - a).det = (Matrix.vandermonde v).det

{R : Type u_1}
[CommRing R]
{n : ℕ}
(v : Fin n → R)
(a : R)

(Matrix.vandermonde fun i => v i - a).det = (Matrix.vandermonde v).det


/-- When a function is `C^n` in a set `s` of unique differentiability, it admits
`ftaylorSeriesWithin 𝕜 f s` as a Taylor series up to order `n` in `s`. -/
protected theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn 𝕜 n f s) (hs : UniqueDiffOn 𝕜 s) :
    HasFTaylorSeriesUpToOn n f (ftaylorSeriesWithin 𝕜 f s) s

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


@[to_additive]
theorem iSup_comap_le {ι : Sort*} (f : G →* N) (s : ι → Subgroup N) :
    ⨆ i, (s i).comap f ≤ (iSup s).comap f

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{ι : Sort u_7}
(f : G →+ N)
(s : ι → AddSubgroup N)

⨆ i, AddSubgroup.comap f (s i) ≤ AddSubgroup.comap f (iSup s)


{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)


lemma IsRatCondKernelCDFAux.tendsto_atTop_one (hf : IsRatCondKernelCDFAux f κ ν) [IsFiniteKernel ν]
    (a : α) :
    ∀ᵐ t ∂(ν a), Tendsto (f (a, t)) atTop (𝓝 1)

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

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)

∀ᵐ (t : β) ∂ν a, Filter.Tendsto (f (a, t)) Filter.atTop (𝓝 1)


@[simp]
theorem symm_trans_apply (e₁ : R ≃+* S) (e₂ : S ≃+* S') (a : S') :
    (e₁.trans e₂).symm a = e₁.symm (e₂.symm a)

{R : Type u_4}
{S : Type u_5}
{S' : Type u_6}
[Mul R]
[Mul S]
[Add R]
[Add S]
[Mul S']
[Add S']
(e₁ : R ≃+* S)
(e₂ : S ≃+* S')
(a : S')


theorem first_mem_of_cons_mem_sym {xs : List α} {n : ℕ} {a : α} {z : Sym α n}
    (h : a ::ₛ z ∈ xs.sym (n + 1)) : a ∈ xs

{α : Type u_1}
{xs : List α}
{n : ℕ}
{a : α}
{z : Sym α n}
(h : a ::ₛ z ∈ List.sym (n + 1) xs)


/-- The category of coalgebras over an additive comonad on a preadditive category is preadditive. -/
@[simps]
instance Comonad.coalgebraPreadditive : Preadditive (Comonad.Coalgebra U)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
(U : CategoryTheory.Comonad C)
[U.Additive]
(F G : U.Coalgebra)
(α β : F ⟶ G)


@[deprecated map_smul (since := "2024-06-26")]
protected theorem map_smul (r : R) (x : A) : φ (r • x) = r • φ x

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(φ : A →ₐ[R] B)
(r : R)
(x : A)


theorem gcd_zero_right' [GCDMonoid α] (a : α) : Associated (gcd a 0) a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
(a : α)


@[simp]
theorem ite_empty_right (t s : Set α) : t.ite s ∅ = s ∩ t


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

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f g : CocompactMap α β}
(h : ∀ (x : α), f x = g x)


lemma rTensor_apply_monomial_tmul (e : σ →₀ ℕ) (s : S) (n : N) (d : σ →₀ ℕ) :
    rTensor (monomial e s ⊗ₜ[R] n) d = if e = d then s ⊗ₜ[R] n else 0

{R : Type u}
{N : Type w}
[CommSemiring R]
{σ : Type u_1}
[DecidableEq σ]
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[AddCommMonoid N]
[Module R N]
(e : σ →₀ ℕ)
(s : S)
(n : N)
(d : σ →₀ ℕ)

(MvPolynomial.rTensor ((MvPolynomial.monomial e) s ⊗ₜ[R] n)) d = if e = d then s ⊗ₜ[R] n else 0


/-- Lemma to normalize a vector in a normed space `E` over either `ℂ` or `ℝ` to unit length. -/
@[simp]
theorem norm_smul_inv_norm {x : E} (hx : x ≠ 0) : ‖(‖x‖⁻¹ : 𝕜) • x‖ = 1

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

‖(↑‖x‖)⁻¹ • x‖ = 1


lemma top_connected [Nonempty V] : (⊤ : SimpleGraph V).Connected


theorem finsum_mul {R : Type*} [Semiring R] (f : α → R) (r : R) (h : (support f).Finite) :
    (∑ᶠ a : α, f a) * r = ∑ᶠ a : α, f a * r

{α : Type u_1}
{R : Type u_7}
[Semiring R]
(f : α → R)
(r : R)
(h : (Function.support f).Finite)

(∑ᶠ (a : α), f a) * r = ∑ᶠ (a : α), f a * r


theorem rpow_mul (x : ℝ≥0∞) (y z : ℝ) : x ^ (y * z) = (x ^ y) ^ z


/-- A bijection between two sets `s : Set α` and `t : Set β` provides a partial equivalence
between `α` and `β`. -/
@[simps (config := .asFn)]
noncomputable def BijOn.toPartialEquiv [Nonempty α] (f : α → β) (s : Set α) (t : Set β)
    (hf : BijOn f s t) : PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
[Nonempty α]
(f : α → β)
(s : Set α)
(t : Set β)
(hf : Set.BijOn f s t)

↑(Set.BijOn.toPartialEquiv f s t hf).symm = Function.invFunOn f s


/-- The obvious functor `ShortComplex Cᵒᵖ ⥤ (ShortComplex C)ᵒᵖ`. -/
@[simps]
def unopFunctor : ShortComplex Cᵒᵖ ⥤ (ShortComplex C)ᵒᵖ

(CategoryTheory.ShortComplex.unopFunctor C).obj S = Opposite.op S.unop


@[simp]
theorem mul_apply (e₁ e₂ : A₁ ≃ₐ[R] A₁) (x : A₁) : (e₁ * e₂) x = e₁ (e₂ x)

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


/-- A structure containing informations on the way a space `H` embeds in a
model vector space `E` over the field `𝕜`. This is all what is needed to
define a smooth manifold with model space `H`, and model vector space `E`.
-/
@[ext] -- Porting note(#5171): was nolint has_nonempty_instance
structure ModelWithCorners (𝕜 : Type*) [NontriviallyNormedField 𝕜] (E : Type*)
    [NormedAddCommGroup E] [NormedSpace 𝕜 E] (H : Type*) [TopologicalSpace H] extends
    PartialEquiv H E where
  source_eq : source = univ
  unique_diff' : UniqueDiffOn 𝕜 toPartialEquiv.target
  continuous_toFun : Continuous toFun := by continuity
  continuous_invFun : Continuous invFun := by continuity

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(self : ModelWithCorners 𝕜 E H)


/-- `C(X, ·)` is a functor. -/
theorem continuous_comp (g : C(Y, Z)) : Continuous (ContinuousMap.comp g : C(X, Y) → C(X, Z))

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(g : C(Y, Z))


nonrec theorem comp {f : β → γ →. σ} {g : α → β} {h : α → γ} (hf : Partrec₂ f) (hg : Computable g)
    (hh : Computable h) : Partrec fun a => f (g a) (h a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{σ : Type u_5}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
[Primcodable σ]
{f : β → γ →. σ}
{g : α → β}
{h : α → γ}
(hf : Partrec₂ f)
(hg : Computable g)
(hh : Computable h)


@[simp]
theorem pmap_eq_map (p : α → Prop) (f : α → β) (l : List α) (H) :
    @pmap _ _ p (fun a _ => f a) l H = map f l

{α : Type u}
{β : Type v}
(p : α → Prop)
(f : α → β)
(l : List α)
(H : ∀ (a : α), a ∈ l → p a)

List.pmap (fun a x => f a) l H = List.map f l


@[simp]
theorem mul_eq_mul_left_iff : a * b = a * c ↔ b = c ∨ a = 0

{M₀ : Type u_2}
[CancelMonoidWithZero M₀]
{a b c : M₀}


theorem coeff_list_prod_of_natDegree_le (l : List S[X]) (n : ℕ) (hl : ∀ p ∈ l, natDegree p ≤ n) :
    coeff (List.prod l) (l.length * n) = (l.map fun p => coeff p n).prod

{S : Type u_1}
[Semiring S]
(l : List S[X])
(n : ℕ)
(hl : ∀ p ∈ l, p.natDegree ≤ n)

l.prod.coeff (l.length * n) = (List.map (fun p => p.coeff n) l).prod


@[simp]
theorem coe_restrict (f : C(α, β)) : ⇑(f.restrict s) = f ∘ ((↑) : s → α)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(s : Set α)
(f : C(α, β))

⇑(ContinuousMap.restrict s f) = ⇑f ∘ Subtype.val


@[to_additive]
theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
    [DecidablePred fun x => ¬p x] (f : ∀ x : α, p x → γ) (g : ∀ x : α, ¬p x → γ) (h : γ → β) :
    (∏ x ∈ s, h (if hx : p x then f x hx else g x hx)) =
      (∏ x ∈ (s.filter p).attach, h (f x.1 <| by simpa using (mem_filter.mp x.2).2)) *
        ∏ x ∈ (s.filter fun x => ¬p x).attach, h (g x.1 <| by simpa using (mem_filter.mp x.2).2)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[CommMonoid β]
{s : Finset α}
{p : α → Prop}
{hp : DecidablePred p}
[DecidablePred fun x => ¬p x]
(f : (x : α) → p x → γ)
(g : (x : α) → ¬p x → γ)
(h : γ → β)

∏ x ∈ s, h (if hx : p x then f x hx else g x hx) =
  (∏ x ∈ (Finset.filter p s).attach, h (f ↑x ⋯)) * ∏ x ∈ (Finset.filter (fun x => ¬p x) s).attach, h (g ↑x ⋯)


protected lemma lt_or_eq_of_le : a ≤ b → a < b ∨ a = b


/-- A group of order `p ^ 2` is commutative. See also `IsPGroup.commGroupOfCardEqPrimeSq`
for the `CommGroup` instance. -/
theorem commutative_of_card_eq_prime_sq (hG : Nat.card G = p ^ 2) : ∀ a b : G, a * b = b * a

{p : ℕ}
{G : Type u_1}
[Group G]
[Fact (Nat.Prime p)]
(hG : Nat.card G = p ^ 2)
(a b : G)


/-- The adjunction between the cofree and forgetful constructions for Eilenberg-Moore coalgebras
for a comonad.
-/
@[simps! unit counit]
def adj : G.forget ⊣ G.cofree

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

G.adj.counit = { app := fun Y => G.ε.app Y, naturality := ⋯ }


theorem iso_apply_mk (m : M) (s : S) :
    iso S f (LocalizedModule.mk m s) = (IsLocalizedModule.map_units f s).unit⁻¹.val (f m)

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

(IsLocalizedModule.iso S f) (LocalizedModule.mk m s) = ↑⋯.unit⁻¹ (f m)


theorem ker_unitGroupToResidueFieldUnits :
    A.unitGroupToResidueFieldUnits.ker = A.principalUnitGroup.comap A.unitGroup.subtype

{K : Type u}
[Field K]
(A : ValuationSubring K)

A.unitGroupToResidueFieldUnits.ker = Subgroup.comap A.unitGroup.subtype A.principalUnitGroup


theorem Iic_union_Ioi_of_le (h : a ≤ b) : Iic b ∪ Ioi a = univ

{α : Type u_1}
[LinearOrder α]
{a b : α}
(h : a ≤ b)


theorem Poly.denote_toExpr_go (ctx : Context) (e : Expr) (p : Poly) : (toExpr.go e p).denote ctx = e.denote ctx + p.denote ctx

(ctx : Nat.Linear.Context)
(e : Nat.Linear.Expr)
(p : Nat.Linear.Poly)

Nat.Linear.Expr.denote ctx (Nat.Linear.Poly.toExpr.go e p) = Nat.Linear.Expr.denote ctx e + Nat.Linear.Poly.denote ctx p


theorem map_range : f.range.map g = (g.comp f).range

{R : Type u}
{S : Type v}
{T : Type u_1}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
[NonUnitalNonAssocRing T]
(g : S →ₙ+* T)
(f : R →ₙ+* S)

NonUnitalSubring.map g f.range = (g.comp f).range


theorem children_mk {a} (x : F.B a → M F) (i : F.B (head (M.mk ⟨a, x⟩))) :
    children (M.mk ⟨a, x⟩) i = x (cast (by rw [head_mk]) i)

{F : PFunctor.{u}}
{a : F.A}
(x : F.B a → F.M)
(i : F.B (PFunctor.M.mk ⟨a, x⟩).head)

(PFunctor.M.mk ⟨a, x⟩).children i = x (cast ⋯ i)


@[to_additive]
theorem ofMulEquivOfDom_eq {k : P ≃* M} (H : T.map k.toMonoidHom = S) :
    (f.ofMulEquivOfDom H).toMap = f.toMap.comp k.toMonoidHom

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

(f.ofAddEquivOfDom H).toMap = f.toMap.comp k.toAddMonoidHom


/-- If `R → A → B` is an algebra tower, `C` is the integral closure of `R` in `B`
and `A` is integral over `R`, then `C` is the integral closure of `A` in `B`. -/
lemma IsIntegralClosure.tower_top {B C : Type*} [CommRing C] [CommRing B]
    [Algebra R B] [Algebra A B] [Algebra C B] [IsScalarTower R A B]
    [IsIntegralClosure C R B] [Algebra.IsIntegral R A] :
    IsIntegralClosure C A B

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
{B : Type u_6}
{C : Type u_7}
[CommRing C]
[CommRing B]
[Algebra R B]
[Algebra A B]
[Algebra C B]
[IsScalarTower R A B]
[IsIntegralClosure C R B]
[Algebra.IsIntegral R A]


theorem SmoothWithinAt.div₀ (hf : SmoothWithinAt I' I f s a)
    (hg : SmoothWithinAt I' I g s a) (h₀ : g a ≠ 0) : SmoothWithinAt I' I (f / g) s a

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[GroupWithZero G]
[SmoothInv₀ I G]
[SmoothMul I G]
{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 g : M → G}
{s : Set M}
{a : M}
(hf : SmoothWithinAt I' I f s a)
(hg : SmoothWithinAt I' I g s a)
(h₀ : g a ≠ 0)


@[simp]
theorem ofDual_bot [Top α] : ofDual ⊥ = (⊤ : α)


protected lemma existsUnique_congr_right : (∃! a, q (e a)) ↔ ∃! b, q b

{α : Sort u}
{β : Sort v}
{q : β → Prop}
(e : α ≃ β)


lemma pairwise_disjoint_supp_connectedComponent (G : SimpleGraph V) :
    Pairwise fun c c' : ConnectedComponent G ↦ Disjoint c.supp c'.supp

Pairwise fun c c' => Disjoint c.supp c'.supp


@[mono]
theorem prod_mono ⦃s₁ s₂ : NonUnitalSubsemiring R⦄ (hs : s₁ ≤ s₂) ⦃t₁ t₂ : NonUnitalSubsemiring S⦄
    (ht : t₁ ≤ t₂) : s₁.prod t₁ ≤ s₂.prod t₂

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
⦃s₁ s₂ : NonUnitalSubsemiring R⦄
(hs : s₁ ≤ s₂)
⦃t₁ t₂ : NonUnitalSubsemiring S⦄
(ht : t₁ ≤ t₂)


lemma diffs_right_comm : s \\ t \\ u = s \\ u \\ t

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

(s.diffs t).diffs u = (s.diffs u).diffs t


lemma pow_lt_pow_iff_right (h : 1 < a) : a ^ n < a ^ m ↔ n < m

{R : Type u_3}
[StrictOrderedSemiring R]
{a : R}
{n m : ℕ}
(h : 1 < a)


theorem addBottom_map (L : ListBlank (∀ k, Option (Γ k))) :
    (addBottom L).map ⟨Prod.snd, by rfl⟩ = L

(L : Turing.ListBlank ((k : K) → Option (Γ k)))

Turing.ListBlank.map { f := Prod.snd, map_pt' := ⋯ } (Turing.TM2to1.addBottom L) = L


lemma strictMono_succ : StrictMono (succ : Fin n → Fin (n + 1))


theorem factors_congr {X : C} {f g : MonoOver X} {Y : C} (h : Y ⟶ X) (e : f ≅ g) :
    f.Factors h ↔ g.Factors h

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


protected theorem uniformContinuous_of_continuousAt_zero [UniformSpace E] [UniformAddGroup E]
    {p : Seminorm 𝕝 E} (hp : ContinuousAt p 0) : UniformContinuous p

{𝕝 : Type u_6}
{E : Type u_7}
[SeminormedRing 𝕝]
[AddCommGroup E]
[Module 𝕝 E]
[UniformSpace E]
[UniformAddGroup E]
{p : Seminorm 𝕝 E}
(hp : ContinuousAt (⇑p) 0)


/-- (Implementation). The `pushforwardFamily` defined is compatible. -/
theorem pushforwardFamily_compatible {X} (x : ℱ.obj (op X)) :
    (pushforwardFamily α x).Compatible

{K : CategoryTheory.GrothendieckTopology D}

{ℱ : CategoryTheory.Functor Dᵒᵖ (Type v)}


@[reassoc (attr := simp, nolint unusedHavesSuffices)]
lemma ι_mapBifunctorAssociator_hom (i₁ : I₁) (i₂ : I₂) (i₃ : I₃) (j : J) (h : r (i₁, i₂, i₃) = j) :
    ιMapBifunctor₁₂BifunctorMapObj F₁₂ G ρ₁₂ X₁ X₂ X₃ i₁ i₂ i₃ j h ≫
      (mapBifunctorAssociator associator ρ₁₂ ρ₂₃ X₁ X₂ X₃).hom j =
        ((associator.hom.app (X₁ i₁)).app (X₂ i₂)).app (X₃ i₃) ≫
          ιMapBifunctorBifunctor₂₃MapObj F G₂₃ ρ₂₃ X₁ X₂ X₃ i₁ i₂ i₃ j h

{F₁₂ : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ C₁₂)}

{G : CategoryTheory.Functor C₁₂ (CategoryTheory.Functor C₃ C₄)}

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

{G₂₃ : CategoryTheory.Functor C₂ (CategoryTheory.Functor C₃ C₂₃)}

(associator : CategoryTheory.bifunctorComp₁₂ F₁₂ G ≅ CategoryTheory.bifunctorComp₂₃ F G₂₃)

(ρ₁₂ : CategoryTheory.GradedObject.BifunctorComp₁₂IndexData r)

(ρ₂₃ : CategoryTheory.GradedObject.BifunctorComp₂₃IndexData r)

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

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

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

[(((CategoryTheory.GradedObject.mapBifunctor F₁₂ I₁ I₂).obj X₁).obj X₂).HasMap ρ₁₂.p]

[(((CategoryTheory.GradedObject.mapBifunctor G ρ₁₂.I₁₂ I₃).obj
            (CategoryTheory.GradedObject.mapBifunctorMapObj F₁₂ ρ₁₂.p X₁ X₂)).obj
        X₃).HasMap
    ρ₁₂.q]

[(((CategoryTheory.GradedObject.mapBifunctor G₂₃ I₂ I₃).obj X₂).obj X₃).HasMap ρ₂₃.p]

[(((CategoryTheory.GradedObject.mapBifunctor F I₁ ρ₂₃.I₂₃).obj X₁).obj
        (CategoryTheory.GradedObject.mapBifunctorMapObj G₂₃ ρ₂₃.p X₂ X₃)).HasMap
    ρ₂₃.q]

[H₁₂ : CategoryTheory.GradedObject.HasGoodTrifunctor₁₂Obj F₁₂ G ρ₁₂ X₁ X₂ X₃]

[H₂₃ : CategoryTheory.GradedObject.HasGoodTrifunctor₂₃Obj F G₂₃ ρ₂₃ X₁ X₂ X₃]

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.GradedObject.ιMapBifunctor₁₂BifunctorMapObj F₁₂ G ρ₁₂ X₁ X₂ X₃ i₁ i₂ i₃ j h)
    ((CategoryTheory.GradedObject.mapBifunctorAssociator associator ρ₁₂ ρ₂₃ X₁ X₂ X₃).hom j) =
  CategoryTheory.CategoryStruct.comp (((associator.hom.app (X₁ i₁)).app (X₂ i₂)).app (X₃ i₃))
    (CategoryTheory.GradedObject.ιMapBifunctorBifunctor₂₃MapObj F G₂₃ ρ₂₃ X₁ X₂ X₃ i₁ i₂ i₃ j h)


theorem transpose_mem (hA : A ∈ symplecticGroup l R) : Aᵀ ∈ symplecticGroup l R

{l : Type u_1}
{R : Type u_2}
[DecidableEq l]
[Fintype l]
[CommRing R]
{A : Matrix (l ⊕ l) (l ⊕ l) R}
(hA : A ∈ Matrix.symplecticGroup l R)


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

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

(fun x => a + x) '' t = (fun x => -a + x) ⁻¹' t


lemma isometry_mul : Isometry (mul 𝕜 𝕜')

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(𝕜' : Type u_3)
[NonUnitalSeminormedRing 𝕜']
[NormedSpace 𝕜 𝕜']
[IsScalarTower 𝕜 𝕜' 𝕜']
[SMulCommClass 𝕜 𝕜' 𝕜']
[RegularNormedAlgebra 𝕜 𝕜']

Isometry ⇑(ContinuousLinearMap.mul 𝕜 𝕜')


/-- Given `f : α → β`, if `α` is nonempty then `β` is also nonempty.
  `Nonempty` cannot be a `functor`, because `Functor` is restricted to `Type`. -/
theorem Nonempty.map {α β} (f : α → β) : Nonempty α → Nonempty β

{α : Sort u_3}
{β : Sort u_4}
(f : α → β)


@[simp]
theorem mem_vanishingIdeal_iff {V : Set (σ → k)} {p : MvPolynomial σ k} :
    p ∈ vanishingIdeal V ↔ ∀ x ∈ V, eval x p = 0

{k : Type u_1}
[Field k]
{σ : Type u_2}
{V : Set (σ → k)}
{p : MvPolynomial σ k}

p ∈ MvPolynomial.vanishingIdeal V ↔ ∀ x ∈ V, (MvPolynomial.eval x) p = 0


@[to_additive]
theorem mulEquivOfLocalizations_left_inv (k : N ≃* P) :
    f.mulEquivOfLocalizations (f.ofMulEquivOfLocalizations k) = k

{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)
(k : N ≃+ P)

f.addEquivOfLocalizations (f.ofAddEquivOfLocalizations k) = k


theorem encodek₂ [Encodable α] (a : α) : decode₂ α (encode a) = some a

Encodable.decode₂ α (Encodable.encode a) = some a


/-- `MultilinearMap.domDomCongr` as an equivalence.

This is declared separately because it does not work with dot notation. -/
@[simps apply symm_apply]
def domDomCongrEquiv (σ : ι₁ ≃ ι₂) :
    MultilinearMap R (fun _ : ι₁ => M₂) M₃ ≃+ MultilinearMap R (fun _ : ι₂ => M₂) M₃

{R : Type uR}
{M₂ : Type v₂}
{M₃ : Type v₃}
[Semiring R]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M₂]
[Module R M₃]
{ι₁ : Type u_1}
{ι₂ : Type u_2}
(σ : ι₁ ≃ ι₂)
(m : MultilinearMap R (fun x => M₂) M₃)

(MultilinearMap.domDomCongrEquiv σ).symm m = MultilinearMap.domDomCongr σ.symm m


/-- Swaps the pointed elements of a two-pointed type. `TwoPointing.swap` as a functor. -/
@[simps]
noncomputable def swap : TwoP ⥤ TwoP


@[deprecated OrderBot.atBot_eq (since := "2024-02-14")]
theorem atBot_le_nhds_bot [OrderBot α] : (atBot : Filter α) ≤ 𝓝 ⊥

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderBot α]


lemma sections_ext_iff {F : J ⥤ Type w} {x y : F.sections} : x = y ↔ ∀ j, x.val j = y.val j

{J : Type u}
[CategoryTheory.Category.{v, u} J]
{F : CategoryTheory.Functor J (Type w)}
{x y : ↑F.sections}


@[simp]
theorem divisors_zero : divisors 0 = ∅


protected theorem Antitone.Ioc (hf : Antitone f) (hg : Monotone g) :
    Monotone fun x => Ioc (f x) (g x)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f g : α → β}
(hf : Antitone f)
(hg : Monotone g)


/-- **Steinhaus Theorem** In any locally compact group `G` with an inner regular Haar measure `μ`,
for any measurable set `E` of positive measure, the set `E / E` is a neighbourhood of `1`. -/
@[to_additive
"**Steinhaus Theorem** In any locally compact group `G` with an inner regular Haar measure `μ`,
for any measurable set `E` of positive measure, the set `E - E` is a neighbourhood of `0`."]
theorem div_mem_nhds_one_of_haar_pos (μ : Measure G) [IsHaarMeasure μ] [LocallyCompactSpace G]
    [InnerRegular μ] (E : Set G) (hE : MeasurableSet E) (hEpos : 0 < μ E) :
    E / E ∈ 𝓝 (1 : G)

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
[MeasurableSpace G]
[BorelSpace G]
(μ : MeasureTheory.Measure G)
[μ.IsAddHaarMeasure]
[LocallyCompactSpace G]
[μ.InnerRegular]
(E : Set G)
(hE : MeasurableSet E)
(hEpos : 0 < μ E)


theorem hasBasis_nhdsSet_thickening {K : Set α} (hK : IsCompact K) :
    (𝓝ˢ K).HasBasis (fun δ : ℝ => 0 < δ) fun δ => thickening δ K

{α : Type u}
[PseudoEMetricSpace α]
{K : Set α}
(hK : IsCompact K)

(𝓝ˢ K).HasBasis (fun δ => 0 < δ) fun δ => Metric.thickening δ K


@[to_additive]
theorem mem_sInf {S : Set (Subsemigroup M)} {x : M} : x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p

{M : Type u_1}
[Add M]
{S : Set (AddSubsemigroup M)}
{x : M}


@[simp]
theorem bind_ret (f : α → β) (s) : bind s (ret ∘ f) ~ʷ map f s

{α : Type u}
{β : Type v}
(f : α → β)
(s : Stream'.WSeq α)

s.bind (Stream'.WSeq.ret ∘ f) ~ʷ Stream'.WSeq.map f s


/-- if `-a ≤ b` then `-b ≤ a` on `EReal`. -/
protected theorem neg_le_of_neg_le {a b : EReal} (h : -a ≤ b) : -b ≤ a


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

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

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


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem sups_nonempty : (s ⊻ t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

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


@[to_additive] theorem closedEmbedding_mk : ClosedEmbedding (@mk M)


/-- The closure of a set equals the intersection of its (open) thickenings of positive radii. -/
theorem closure_eq_iInter_thickening (E : Set α) :
    closure E = ⋂ (δ : ℝ) (_ : 0 < δ), thickening δ E

{α : Type u}
[PseudoEMetricSpace α]
(E : Set α)

closure E = ⋂ δ, ⋂ (_ : 0 < δ), Metric.thickening δ E


theorem smooth_subtype_val {U : Opens M} : Smooth I I (Subtype.val : U → 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]
{U : TopologicalSpace.Opens M}


theorem Perm.kunion_left :
    ∀ (l) {l₁ l₂ : List (Sigma β)}, l₁.NodupKeys → l₁ ~ l₂ → kunion l l₁ ~ kunion l l₂

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

l₁.NodupKeys → l₁.Perm l₂ → (l.kunion l₁).Perm (l.kunion l₂)


/-- A continuous function with compact support belongs to `L^∞`.
See `Continuous.memℒp_of_hasCompactSupport` for a version for `L^p`. -/
theorem _root_.Continuous.memℒp_top_of_hasCompactSupport
    {X : Type*} [TopologicalSpace X] [MeasurableSpace X] [OpensMeasurableSpace X]
    {f : X → E} (hf : Continuous f) (h'f : HasCompactSupport f) (μ : Measure X) : Memℒp f ⊤ μ

{E : Type u_2}
[NormedAddCommGroup E]
{X : Type u_5}
[TopologicalSpace X]
[MeasurableSpace X]
[OpensMeasurableSpace X]
{f : X → E}
(hf : Continuous f)
(h'f : HasCompactSupport f)
(μ : MeasureTheory.Measure X)


theorem coeff_mul (n : ℕ) (φ ψ : R⟦X⟧) :
    coeff R n (φ * ψ) = ∑ p ∈ antidiagonal n, coeff R p.1 φ * coeff R p.2 ψ

{R : Type u_1}
[Semiring R]
(n : ℕ)
(φ ψ : PowerSeries R)

(PowerSeries.coeff R n) (φ * ψ) = ∑ p ∈ Finset.antidiagonal n, (PowerSeries.coeff R p.1) φ * (PowerSeries.coeff R p.2) ψ


/-- If a map between pseudometric spaces is a uniform embedding then the distance between `f x`
and `f y` is controlled in terms of the distance between `x` and `y`. -/
theorem controlled_of_uniformEmbedding [PseudoMetricSpace β] {f : α → β} (h : UniformEmbedding f) :
    (∀ ε > 0, ∃ δ > 0, ∀ {a b : α}, dist a b < δ → dist (f a) (f b) < ε) ∧
      ∀ δ > 0, ∃ ε > 0, ∀ {a b : α}, dist (f a) (f b) < ε → dist a b < δ

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{f : α → β}
(h : UniformEmbedding f)


@[simp]
theorem Ici_erase [DecidableEq α] (a : α) : (Ici a).erase a = Ioi a

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


@[to_additive]
theorem pi_top (I : Set η) : (pi I fun i => (⊤ : Subgroup (f i))) = ⊤

{η : Type u_7}
{f : η → Type u_8}
[(i : η) → AddGroup (f i)]
(I : Set η)


lemma toAffine_some {X Y : F} (h : W.Nonsingular ![X, Y, 1]) :
    toAffine W ![X, Y, 1] = .some ((nonsingular_some ..).mp h)

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{X Y : F}
(h : W.Nonsingular ![X, Y, 1])

WeierstrassCurve.Jacobian.Point.toAffine W ![X, Y, 1] = WeierstrassCurve.Affine.Point.some ⋯


theorem pow_le_pow_of_le_right {n : Nat} (hx : n > 0) {i : Nat} : ∀ {j}, i ≤ j → n^i ≤ n^j


/-- A split coequalizer clearly induces a cofork. -/
@[simps! pt]
def IsSplitCoequalizer.asCofork {Z : C} {h : Y ⟶ Z} (t : IsSplitCoequalizer f g h) :
    Cofork f g

(t : CategoryTheory.IsSplitCoequalizer f g h)


@[to_additive]
theorem coe_pow_interval [OrderedCommMonoid α] (s : NonemptyInterval α) (n : ℕ) :
    ↑(s ^ n) = (s : Interval α) ^ n

{α : Type u_2}
[OrderedCommMonoid α]
(s : NonemptyInterval α)
(n : ℕ)


/-- Arithmetic progressions of length three are preserved under `2`-Freiman isomorphisms. -/
@[to_additive]
lemma IsMulFreimanIso.threeGPFree_congr (hf : IsMulFreimanIso 2 s t f) :
    ThreeGPFree s ↔ ThreeGPFree t

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{s : Set α}
{t : Set β}
{f : α → β}
(hf : IsAddFreimanIso 2 s t f)


@[to_additive (attr := simp)]
theorem coe_top : ((⊤ : Subgroup G) : Set G) = Set.univ


theorem le_self_mul_self {I : FractionalIdeal S P} (hI : 1 ≤ I) : I ≤ I * I

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{I : FractionalIdeal S P}
(hI : 1 ≤ I)


@[simp]
theorem weightedVSubOfPoint_apply (w : ι → k) (p : ι → P) (b : P) :
    s.weightedVSubOfPoint p b w = ∑ i ∈ s, w i • (p i -ᵥ b)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p : ι → P)
(b : P)

(s.weightedVSubOfPoint p b) w = ∑ i ∈ s, w i • (p i -ᵥ b)


@[simp]
theorem exists_subset_range_and_iff {f : α → β} {p : Set β → Prop} :
    (∃ s, s ⊆ range f ∧ p s) ↔ ∃ s, p (f '' s)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{p : Set β → Prop}

(∃ s ⊆ Set.range f, p s) ↔ ∃ s, p (f '' s)


@[to_additive]
lemma val_mem_of_mem_units (S : Submonoid M) {x : Mˣ} (h : x ∈ S.units) : (x : M) ∈ S

{M : Type u_1}
[AddMonoid M]
(S : AddSubmonoid M)
{x : AddUnits M}
(h : x ∈ S.addUnits)


@[to_additive]
theorem prod_apply_dite {s : Finset α} {p : α → Prop} {hp : DecidablePred p}
    [DecidablePred fun x => ¬p x] (f : ∀ x : α, p x → γ) (g : ∀ x : α, ¬p x → γ) (h : γ → β) :
    (∏ x ∈ s, h (if hx : p x then f x hx else g x hx)) =
      (∏ x ∈ (s.filter p).attach, h (f x.1 <| by simpa using (mem_filter.mp x.2).2)) *
        ∏ x ∈ (s.filter fun x => ¬p x).attach, h (g x.1 <| by simpa using (mem_filter.mp x.2).2)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[AddCommMonoid β]
{s : Finset α}
{p : α → Prop}
{hp : DecidablePred p}
[DecidablePred fun x => ¬p x]
(f : (x : α) → p x → γ)
(g : (x : α) → ¬p x → γ)
(h : γ → β)

∑ x ∈ s, h (if hx : p x then f x hx else g x hx) =
  ∑ x ∈ (Finset.filter p s).attach, h (f ↑x ⋯) + ∑ x ∈ (Finset.filter (fun x => ¬p x) s).attach, h (g ↑x ⋯)


@[simp] lemma rpow_rpow_inv {y : ℝ} (hy : y ≠ 0) (x : ℝ≥0∞) : (x ^ y) ^ y⁻¹ = x


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

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)

MeasureTheory.StronglyMeasurable (f * g)


@[simp, norm_cast]
theorem coe_sInf (S : Set (NonUnitalSubring R)) :
    ((sInf S : NonUnitalSubring R) : Set R) = ⋂ s ∈ S, ↑s

{R : Type u}
[NonUnitalNonAssocRing R]
(S : Set (NonUnitalSubring R))


/-- An encoding of terms as lists. -/
@[simps]
protected def encoding : Encoding (L.Term α)

FirstOrder.Language.Term.encoding.Γ = (α ⊕ (i : ℕ) × L.Functions i)


@[continuity, fun_prop]
theorem Continuous.inf [Inf L] [ContinuousInf L] {f g : X → L} (hf : Continuous f)
    (hg : Continuous g) : Continuous fun x => f x ⊓ g x

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
[Inf L]
[ContinuousInf L]
{f g : X → L}
(hf : Continuous f)
(hg : Continuous g)


lemma Hom.toIsometry_injective (V W : QuadraticModuleCat.{v} R) :
    Function.Injective (Hom.toIsometry : Hom V W → _)

{R : Type u}
[CommRing R]
(V W : QuadraticModuleCat R)


@[simp]
theorem spanCompIso_app_zero : (spanCompIso F f g).app WalkingSpan.zero = Iso.refl _

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

(CategoryTheory.Limits.spanCompIso F f g).app CategoryTheory.Limits.WalkingSpan.zero =
  CategoryTheory.Iso.refl ((CategoryTheory.Limits.span f g ⋙ F).obj CategoryTheory.Limits.WalkingSpan.zero)


/-- A compact set is bounded below -/
theorem IsCompact.bddBelow [ClosedIicTopology α] [Nonempty α] {s : Set α} (hs : IsCompact s) :
    BddBelow s

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


theorem lintegral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
    ∫⁻ a, ENNReal.ofReal (condCDF ρ a x) ∂ρ.fst = ρ (univ ×ˢ Iic x)

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

∫⁻ (a : α), ENNReal.ofReal (↑(ProbabilityTheory.condCDF ρ a) x) ∂ρ.fst = ρ (Set.univ ×ˢ Set.Iic x)


/-- An action is pretransitive if and only if the quotient by `MulAction.orbitRel` is a
subsingleton. -/
@[to_additive "An additive action is pretransitive if and only if the quotient by
`AddAction.orbitRel` is a subsingleton."]
theorem pretransitive_iff_subsingleton_quotient :
    IsPretransitive G α ↔ Subsingleton (orbitRel.Quotient G α)

(G : Type u_1)
(α : Type u_2)
[AddGroup G]
[AddAction G α]

AddAction.IsPretransitive G α ↔ Subsingleton (AddAction.orbitRel.Quotient G α)


/-- The canonical extension of a functor `C ⥤ Karoubi D` to a functor
`Karoubi C ⥤ Karoubi D` -/
@[simps]
def obj (F : C ⥤ Karoubi D) : Karoubi C ⥤ Karoubi D

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

∀ {X Y : CategoryTheory.Idempotents.Karoubi C} (f : X ⟶ Y),
  ((CategoryTheory.Idempotents.FunctorExtension₁.obj F).map f).f = (F.map f.f).f


/-- Baby version of the **Whitney weak embedding theorem**: if `M` admits a finite covering by
supports of bump functions, then for some `n` it can be immersed into the `n`-dimensional
Euclidean space. -/
theorem exists_immersion_euclidean [Finite ι] (f : SmoothBumpCovering ι I M) :
    ∃ (n : ℕ) (e : M → EuclideanSpace ℝ (Fin n)),
      Smooth I (𝓡 n) e ∧ Injective e ∧ ∀ x : M, Injective (mfderiv I (𝓡 n) e x)

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
[T2Space M]
[Finite ι]
(f : SmoothBumpCovering ι I M)

∃ n e,
  Smooth I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) e ∧
    Function.Injective e ∧ ∀ (x : M), Function.Injective ⇑(mfderiv I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) e x)


@[to_additive (attr := ext)]
theorem CommMonoid.ext {M : Type*} ⦃m₁ m₂ : CommMonoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) : m₁ = m₂

{M : Type u_1}
⦃m₁ m₂ : AddCommMonoid M⦄
(h_mul : HAdd.hAdd = HAdd.hAdd)


@[to_additive]
private lemma wellFoundedOn_devosMulRel :
    {x : Finset α × Finset α | x.1.Nonempty ∧ x.2.Nonempty}.WellFoundedOn
      (DevosMulRel : Finset α × Finset α → Finset α × Finset α → Prop)

{α : Type u_1}
[Group α]
[DecidableEq α]

{x | x.1.Nonempty ∧ x.2.Nonempty}.WellFoundedOn DevosMulRel


theorem mem_uniformity_of_eq {x y : α} {s : Set (α × α)} (h : s ∈ 𝓤 α) (hx : x = y) : (x, y) ∈ s

{α : Type ua}
[UniformSpace α]
{x y : α}
{s : Set (α × α)}
(h : s ∈ 𝓤 α)
(hx : x = y)


/-- The equivalence between the opposite of a product and the product of the opposites. -/
@[simps]
def prodOpEquiv : (C × D)ᵒᵖ ≌ Cᵒᵖ × Dᵒᵖ

(C : Type u₃)
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(X : (C × D)ᵒᵖ)

(CategoryTheory.prodOpEquiv C).functor.obj X = (Opposite.op (Opposite.unop X).1, Opposite.op (Opposite.unop X).2)


theorem coinduced_le_iff_le_induced {f : α → β} {tα : TopologicalSpace α}
    {tβ : TopologicalSpace β} : tα.coinduced f ≤ tβ ↔ tα ≤ tβ.induced f

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{tα : TopologicalSpace α}
{tβ : TopologicalSpace β}

TopologicalSpace.coinduced f tα ≤ tβ ↔ tα ≤ TopologicalSpace.induced f tβ


@[simp]
theorem toFinset_eq_nil {s : Cycle α} : s.toFinset = ∅ ↔ s = Cycle.nil

{α : Type u_1}
[DecidableEq α]
{s : Cycle α}


/-- The functor from `Pointed` to `TwoP` which adds a first point. -/
@[simps]
noncomputable def pointedToTwoPSnd : Pointed.{u} ⥤ TwoP

(pointedToTwoPSnd.obj X).toTwoPointing.toProd = (none, some X.point)


@[simp] theorem getRight_inr (h : (inr x : α ⊕ β).isRight) : (inr x).getRight h = x

{α : Type u_1}
{β : Type u_2}
{x : β}
(h : (Sum.inr x).isRight = true)


/-- `Real.sinh` as an `OrderIso`. -/
@[simps! (config := .asFn)]
def sinhOrderIso : ℝ ≃o ℝ

⇑(RelIso.symm Real.sinhOrderIso) = Real.arsinh


/-- If a function `f` to a T₃ space `Y` has a limit within a
dense set `A` for any `x`, then `extendFrom A f` is continuous. -/
theorem continuous_extendFrom [RegularSpace Y] {f : X → Y} {A : Set X} (hA : Dense A)
    (hf : ∀ x, ∃ y, Tendsto f (𝓝[A] x) (𝓝 y)) : Continuous (extendFrom A f)

(hf : ∀ (x : X), ∃ y, Filter.Tendsto f (𝓝[A] x) (𝓝 y))


@[fun_prop]
theorem DifferentiableOn.continuousOn (h : DifferentiableOn 𝕜 f s) : ContinuousOn f s

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


/-- `HasColimit F` represents the mere existence of a colimit for `F`. -/
class HasColimit (F : J ⥤ C) : Prop where mk' ::
  /-- There exists a colimit for `F` -/
  exists_colimit : Nonempty (ColimitCocone F)

[self : CategoryTheory.Limits.HasColimit F]


/-- A bound on any top part of the sum in LYM in terms of the size of `falling k 𝒜`. -/
theorem le_card_falling_div_choose [Fintype α] (hk : k ≤ Fintype.card α)
    (h𝒜 : IsAntichain (· ⊆ ·) (𝒜 : Set (Finset α))) :
    (∑ r ∈ range (k + 1),
        ((𝒜 # (Fintype.card α - r)).card : 𝕜) / (Fintype.card α).choose (Fintype.card α - r)) ≤
      (falling (Fintype.card α - k) 𝒜).card / (Fintype.card α).choose (Fintype.card α - k)

(h𝒜 : IsAntichain (fun x x_1 => x ⊆ x_1) ↑𝒜)

∑ r ∈ Finset.range (k + 1), ↑(𝒜 # (Fintype.card α - r)).card / ↑((Fintype.card α).choose (Fintype.card α - r)) ≤
  ↑(Finset.falling (Fintype.card α - k) 𝒜).card / ↑((Fintype.card α).choose (Fintype.card α - k))


@[simp]
theorem AffineEquiv.coe_toHomeomorphOfFiniteDimensional (f : PE ≃ᵃ[𝕜] PF) :
    ⇑f.toHomeomorphOfFiniteDimensional = f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type w}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace 𝕜]
{PE : Type u_1}
{PF : Type u_2}
[MetricSpace PE]
[NormedAddTorsor E PE]
[MetricSpace PF]
[NormedAddTorsor F PF]
[FiniteDimensional 𝕜 E]
(f : PE ≃ᵃ[𝕜] PF)


@[to_additive]
theorem orbit_subgroup_eq_self_of_mem {a : α} (ha : a ∈ s) : MulAction.orbit s a = s

{α : Type u_1}
[Group α]
(s : Subgroup α)
{a : α}
(ha : a ∈ s)


@[to_additive]
theorem map_comap_eq_self {f : G →* N} {H : Subgroup N} (h : H ≤ f.range) :
    map f (comap f H) = H

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
{H : Subgroup N}
(h : H ≤ f.range)


protected theorem add_lt_add_right {x y z : PartENat} (h : x < y) (hz : z ≠ ⊤) : x + z < y + z


/-- A measure on a product space equals the product measure of sigma-finite measures if they are
equal on rectangles. -/
theorem prod_eq {μ : Measure α} [SigmaFinite μ] {ν : Measure β} [SigmaFinite ν]
    {μν : Measure (α × β)}
    (h : ∀ s t, MeasurableSet s → MeasurableSet t → μν (s ×ˢ t) = μ s * ν t) : μ.prod ν = μν

(h : ∀ (s : Set α) (t : Set β), MeasurableSet s → MeasurableSet t → μν (s ×ˢ t) = μ s * ν t)


/-- If `f` has sum `a`, then `exp ∘ f` has product `exp a`. -/
lemma HasSum.rexp {ι} {f : ι → ℝ} {a : ℝ} (h : HasSum f a) : HasProd (rexp ∘ f) (rexp a)

{ι : Type u_1}
{f : ι → ℝ}
{a : ℝ}
(h : HasSum f a)


theorem coordinate_eval_7 :
    (coordinate 7).eval
      (.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: a6 :: a7 :: t)) = a7

{a0 a1 a2 a3 a4 a5 a6 a7 : Int}
{t : List Int}

(Lean.Omega.LinearCombo.coordinate 7).eval
    (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: a6 :: a7 :: t)) =
  a7


theorem strongLT_of_le_of_strongLT (hab : a ≤ b) (hbc : b ≺ c) : a ≺ c

{ι : Type u_1}
{π : ι → Type u_4}
[(i : ι) → Preorder (π i)]
{a b c : (i : ι) → π i}
(hab : a ≤ b)
(hbc : StrongLT b c)


theorem not_isSuccLimit_succ_of_not_isMax (ha : ¬IsMax a) : ¬IsSuccLimit (succ a)

{α : Type u_1}
[Preorder α]
{a : α}
[SuccOrder α]
(ha : ¬IsMax a)


@[to_additive]
theorem range_smul_range {ι κ : Type*} [SMul α β] (b : ι → α) (c : κ → β) :
    range b • range c = range fun p : ι × κ ↦ b p.1 • c p.2

{α : Type u_2}
{β : Type u_3}
{ι : Type u_5}
{κ : Type u_6}
[SMul α β]
(b : ι → α)
(c : κ → β)

Set.range b • Set.range c = Set.range fun p => b p.1 • c p.2


@[simp] lemma subset_compl_singleton : s ⊆ {a}ᶜ ↔ a ∉ s

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


theorem CofreeEqualizer.condition :
    CofreeEqualizer.ι X ≫ CofreeEqualizer.topMap X =
      CofreeEqualizer.ι X ≫ CofreeEqualizer.bottomMap X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T : CategoryTheory.Comonad C}
(X : T.Coalgebra)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Comonad.CofreeEqualizer.ι X)
    (CategoryTheory.Comonad.CofreeEqualizer.topMap X) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Comonad.CofreeEqualizer.ι X)
    (CategoryTheory.Comonad.CofreeEqualizer.bottomMap X)


theorem HasAntitoneBasis.tendsto_smallSets {ι} [Preorder ι] {s : ι → Set α}
    (hl : l.HasAntitoneBasis s) : Tendsto s atTop l.smallSets

{α : Type u_1}
{l : Filter α}
{ι : Type u_4}
[Preorder ι]
{s : ι → Set α}
(hl : l.HasAntitoneBasis s)

Filter.Tendsto s Filter.atTop l.smallSets


/-- Congruence relation of a ring preserves finite sum indexed by a list. -/
protected lemma listSum {ι S : Type*} [AddMonoid S] [Mul S]
    (t : RingCon S) (l : List ι) {f g : ι → S} (h : ∀ i ∈ l, t (f i) (g i)) :
    t (l.map f).sum (l.map g).sum

{ι : Type u_1}
{S : Type u_2}
[AddMonoid S]
[Mul S]
(t : RingCon S)
(l : List ι)
{f g : ι → S}
(h : ∀ i ∈ l, t (f i) (g i))


@[simp]
theorem pullbackConeOfRightIso_x : (pullbackConeOfRightIso f g).pt = X

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

(CategoryTheory.Limits.pullbackConeOfRightIso f g).pt = X


lemma SymmetricCategory.braiding_swap_eq_inv_braiding {C : Type u₁}
    [Category.{v₁} C] [MonoidalCategory C] [SymmetricCategory C] (X Y : C) :
    (β_ Y X).hom = (β_ X Y).inv

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


theorem Bounded.trans_right {t₁ t₂ : Ordnode α} {x : α} :
    ∀ {o₁ o₂}, Bounded t₁ o₁ x → Bounded t₂ x o₂ → Bounded t₁ o₁ o₂

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

t₁.Bounded o₁ ↑x → t₂.Bounded (↑x) o₂ → t₁.Bounded o₁ o₂


private theorem norm_nonarchimedean_aux {f g : PadicSeq p} (hfg : ¬f + g ≈ 0) (hf : ¬f ≈ 0)
    (hg : ¬g ≈ 0) : (f + g).norm ≤ max f.norm g.norm

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{f g : PadicSeq p}
(hfg : ¬f + g ≈ 0)
(hf : ¬f ≈ 0)
(hg : ¬g ≈ 0)


/-- Scaling by an element `k` of the scalar ring as a `DilationEquiv` with ratio `‖k‖₊`, mapping
from a normed space to a normed torsor over that space sending `0` to `c`. -/
@[simps]
def DilationEquiv.smulTorsor (c : P) {k : 𝕜} (hk : k ≠ 0) : E ≃ᵈ P

{𝕜 : Type u_1}
{E : Type u_2}
[NormedDivisionRing 𝕜]
[SeminormedAddCommGroup E]
[Module 𝕜 E]
[BoundedSMul 𝕜 E]
{P : Type u_3}
[PseudoMetricSpace P]
[NormedAddTorsor E P]
(c : P)
{k : 𝕜}
(hk : k ≠ 0)

∀ (x : E), (DilationEquiv.smulTorsor c hk) x = k • x +ᵥ c


@[simp]
theorem Tape.write_nth {Γ} [Inhabited Γ] (b : Γ) :
    ∀ (T : Tape Γ) {i : ℤ}, (T.write b).nth i = if i = 0 then b else T.nth i

{Γ : Type u_1}
[Inhabited Γ]
(b : Γ)
(T : Turing.Tape Γ)
{i : ℤ}

(Turing.Tape.write b T).nth i = if i = 0 then b else T.nth i


theorem KaehlerDifferential.ideal_fg [EssFiniteType R S] :
    (KaehlerDifferential.ideal R S).FG

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]
[Algebra.EssFiniteType R S]


/-- A more workable definition for `enumOrd`. -/
theorem enumOrd_def (o) : enumOrd S o = sInf (S ∩ { b | ∀ c, c < o → enumOrd S c < b })

Ordinal.enumOrd S o = sInf (S ∩ {b | ∀ c < o, Ordinal.enumOrd S c < b})


@[simp] theorem mem_principal : x ∈ principal y ↔ y ≤ x


theorem WCovBy.image (f : α ↪o β) (hab : a ⩿ b) (h : (range f).OrdConnected) : f a ⩿ f b

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{a b : α}
(f : α ↪o β)
(hab : a ⩿ b)
(h : (Set.range ⇑f).OrdConnected)


theorem isCompactElement_finsetSup {α β : Type*} [CompleteLattice α] {f : β → α} (s : Finset β)
    (h : ∀ x ∈ s, IsCompactElement (f x)) : IsCompactElement (s.sup f)

(h : ∀ x ∈ s, CompleteLattice.IsCompactElement (f x))


protected theorem differentiableOn : DifferentiableOn 𝕜 f s

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


theorem IsOpen.frontier_eq (hs : IsOpen s) : frontier s = closure s \ s

{X : Type u}
{s : Set X}
[TopologicalSpace X]
(hs : IsOpen s)


lemma exists' (R : Type*) [NonAssocRing R] [NoZeroDivisors R] [Nontrivial R] :
    CharZero R ∨ ∃ p : ℕ, Fact p.Prime ∧ CharP R p

(R : Type u_2)
[NonAssocRing R]
[NoZeroDivisors R]
[Nontrivial R]

CharZero R ∨ ∃ p, Fact (Nat.Prime p) ∧ CharP R p


/-- The function `coeff n : R⟦X⟧ → R` is continuous. I.e. `coeff n f` depends only on a sufficiently
long truncation of the power series `f`. -/
theorem coeff_coe_trunc_of_lt {n m} {f : R⟦X⟧} (h : n < m) :
    coeff R n (trunc m f) = coeff R n f

{R : Type u_2}
[CommSemiring R]
{n m : ℕ}
{f : PowerSeries R}
(h : n < m)

(PowerSeries.coeff R n) ↑(PowerSeries.trunc m f) = (PowerSeries.coeff R n) f


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

ExistsContDiffBumpBase.u (-x) = ExistsContDiffBumpBase.u x


theorem le_of_mod_lt {a b : Nat} (h : a % b < a) : b ≤ a


@[simp]
theorem map_zero [∀ i j, Zero (α i j)] {β : m → n → Type w} [∀ i j, Zero (β i j)]
    {f : ∀ ⦃i j⦄, α i j → β i j} (h : ∀ i j, f (0 : α i j) = 0) :
    (0 : DMatrix m n α).map f = 0

{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[(i : m) → (j : n) → Zero (α i j)]
{β : m → n → Type w}
[(i : m) → (j : n) → Zero (β i j)]
{f : ⦃i : m⦄ → ⦃j : n⦄ → α i j → β i j}
(h : ∀ (i : m) (j : n), f 0 = 0)


theorem zipWith_foldr_eq_zip_foldr {f : α → β → γ} (i : δ):
    (zipWith f l₁ l₂).foldr g i = (zip l₁ l₂).foldr (fun p r => g (f p.1 p.2) r) i

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{l₁ : List α}
{l₂ : List β}
{g : γ → δ → δ}
{f : α → β → γ}
(i : δ)

List.foldr g i (List.zipWith f l₁ l₂) = List.foldr (fun p r => g (f p.fst p.snd) r) i (l₁.zip l₂)


@[continuity]
theorem continuous_tan : Continuous fun x : {x | cos x ≠ 0} => tan x


/-- If a function `f` is differentiable and `f'` is antitone on `ℝ` then `f` is concave. -/
theorem Antitone.concaveOn_univ_of_deriv {f : ℝ → ℝ} (hf : Differentiable ℝ f)
    (hf'_anti : Antitone (deriv f)) : ConcaveOn ℝ univ f


/-- The norm of the extension is bounded by `‖fr‖`. -/
theorem norm_extendTo𝕜'_bound (fr : F →L[ℝ] ℝ) (x : F) :
    ‖(fr.toLinearMap.extendTo𝕜' x : 𝕜)‖ ≤ ‖fr‖ * ‖x‖

{𝕜 : Type u_1}
[RCLike 𝕜]
{F : Type u_2}
[SeminormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedSpace ℝ F]
[IsScalarTower ℝ 𝕜 F]
(fr : F →L[ℝ] ℝ)
(x : F)


theorem NonUnitalSubalgebra.toSubalgebra_toNonUnitalSubalgebra (S : NonUnitalSubalgebra R A)
    (h1 : (1 : A) ∈ S) : (NonUnitalSubalgebra.toSubalgebra S h1).toNonUnitalSubalgebra = S

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : NonUnitalSubalgebra R A)
(h1 : 1 ∈ S)

(S.toSubalgebra h1).toNonUnitalSubalgebra = S


@[simp] theorem coe_smul' [Semiring R] [AddCommMonoid M] [Module R M] :
    ⇑(.smul : R →+ M →+ M) = AddMonoidHom.smulLeft

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


@[simp]
lemma autMulEquivAutGalois_symm_app (x : AutGalois F) (A : C) [IsGalois A] (a : F.obj A) :
    ((autMulEquivAutGalois F).symm ⟨x⟩).hom.app A a =
      F.map (AutGalois.π F ⟨A, a, inferInstance⟩ x).hom a

(F : CategoryTheory.Functor C FintypeCat)

(x : CategoryTheory.PreGaloisCategory.AutGalois F)

((CategoryTheory.PreGaloisCategory.autMulEquivAutGalois F).symm { unop' := x }).hom.app A a =
  F.map ((CategoryTheory.PreGaloisCategory.AutGalois.π F { obj := A, pt := a, isGalois := ⋯ }) x).hom a


@[local simp]
theorem splitWrtCompositionAux_cons (l : List α) (n ns) :
    l.splitWrtCompositionAux (n::ns) = take n l::(drop n l).splitWrtCompositionAux ns

{α : Type u_1}
(l : List α)
(n : ℕ)
(ns : List ℕ)

l.splitWrtCompositionAux (n :: ns) = List.take n l :: (List.drop n l).splitWrtCompositionAux ns


/-- The measurability of a set `A` is equivalent to the measurability of the indicator function
which takes a constant value `b ≠ 0` on a set `A` and `0` elsewhere. -/
lemma measurable_indicator_const_iff [Zero β] [MeasurableSingletonClass β] (b : β) [NeZero b] :
    Measurable (s.indicator (fun (_ : α) ↦ b)) ↔ MeasurableSet s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
[Zero β]
[MeasurableSingletonClass β]
(b : β)
[NeZero b]

Measurable (s.indicator fun x => b) ↔ MeasurableSet s