/-- Consider a series of smooth functions, with summable uniform bounds on the successive
derivatives. Then the iterated derivative of the sum is the sum of the iterated derivative. -/
theorem iteratedFDeriv_tsum_apply (hf : ∀ i, ContDiff 𝕜 N (f i))
    (hv : ∀ k : ℕ, (k : ℕ∞) ≤ N → Summable (v k))
    (h'f : ∀ (k : ℕ) (i : α) (x : E), (k : ℕ∞) ≤ N → ‖iteratedFDeriv 𝕜 k (f i) x‖ ≤ v k i) {k : ℕ}
    (hk : (k : ℕ∞) ≤ N) (x : E) :
    iteratedFDeriv 𝕜 k (fun y => ∑' n, f n y) x = ∑' n, iteratedFDeriv 𝕜 k (f n) x

{v : ℕ → α → ℝ}

(hv : ∀ (k : ℕ), ↑k ≤ N → Summable (v k))

(h'f : ∀ (k : ℕ) (i : α) (x : E), ↑k ≤ N → ‖iteratedFDeriv 𝕜 k (f i) x‖ ≤ v k i)

iteratedFDeriv 𝕜 k (fun y => ∑' (n : α), f n y) x = ∑' (n : α), iteratedFDeriv 𝕜 k (f n) x


theorem Set.OrdConnected.upperClosure_inter_lowerClosure (h : s.OrdConnected) :
    ↑(upperClosure s) ∩ ↑(lowerClosure s) = s

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


@[simp]
theorem mem_comap {s : NonUnitalSubsemiring S} {f : F} {x : R} : x ∈ s.comap f ↔ f x ∈ s

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
{s : NonUnitalSubsemiring S}
{f : F}
{x : R}

x ∈ NonUnitalSubsemiring.comap f s ↔ f x ∈ s


@[to_additive]
theorem mclosure_preimage_le (f : M →ₙ* N) (s : Set N) : closure (f ⁻¹' s) ≤ (closure s).comap f

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(f : M →ₙ* N)
(s : Set N)

Subsemigroup.closure (⇑f ⁻¹' s) ≤ Subsemigroup.comap f (Subsemigroup.closure s)


theorem lTensor_trans : (f ≪≫ₗ g).lTensor M = f.lTensor M ≪≫ₗ g.lTensor M

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

LinearEquiv.lTensor M (f ≪≫ₗ g) = LinearEquiv.lTensor M f ≪≫ₗ LinearEquiv.lTensor M g


@[simp, norm_cast]
theorem toWithTop_ofENat (n : ℕ∞) {_ : Decidable (n : PartENat).Dom} : toWithTop (↑n) = n

∀ {x : Decidable (↑n).Dom}, (↑n).toWithTop = n


@[to_additive]
lemma mem_stabilizer_finset {s : Finset α} : a ∈ stabilizer G s ↔ ∀ b, a • b ∈ s ↔ b ∈ s

{G : Type u_1}
{α : Type u_3}
[Group G]
[MulAction G α]
{a : G}
[DecidableEq α]
{s : Finset α}

a ∈ MulAction.stabilizer G s ↔ ∀ (b : α), a • b ∈ s ↔ b ∈ s


@[simp]
theorem mem_cIoo {a b x : α} : x ∈ cIoo a b ↔ sbtw a x b

{α : Type u_1}
[CircularPreorder α]
{a b x : α}


theorem StrictConvexSpace.of_norm_combo_ne_one
    (h :
      ∀ x y : E,
        ‖x‖ = 1 → ‖y‖ = 1 → x ≠ y → ∃ a b : ℝ, 0 ≤ a ∧ 0 ≤ b ∧ a + b = 1 ∧ ‖a • x + b • y‖ ≠ 1) :
    StrictConvexSpace ℝ E

(h : ∀ (x y : E), ‖x‖ = 1 → ‖y‖ = 1 → x ≠ y → ∃ a b, 0 ≤ a ∧ 0 ≤ b ∧ a + b = 1 ∧ ‖a • x + b • y‖ ≠ 1)


/-- A natural isomorphism `L₁ ≅ L₂` induces an equivalence of categories
    `Comma L₁ R ≌ Comma L₂ R`. -/
@[simps!]
def mapLeftIso (i : L₁ ≅ L₂) : Comma L₁ R ≌ Comma L₂ R

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

((CategoryTheory.Comma.mapLeftIso R i).unitIso.inv.app X).right = CategoryTheory.CategoryStruct.id X.right


theorem uniformCauchySeqOn_ball_of_deriv {r : ℝ} (hf' : UniformCauchySeqOn f' l (Metric.ball x r))
    (hf : ∀ n : ι, ∀ y : 𝕜, y ∈ Metric.ball x r → HasDerivAt (f n) (f' n y) y)
    (hfg : Cauchy (map (fun n => f n x) l)) : UniformCauchySeqOn f l (Metric.ball x r)

(hf : ∀ (n : ι), ∀ y ∈ Metric.ball x r, HasDerivAt (f n) (f' n y) y)

(hfg : Cauchy (Filter.map (fun n => f n x) l))


lemma root_X_pow_sub_C_ne_zero_iff {n : ℕ} {a : K} (H : Irreducible (X ^ n - C a)) :
    (AdjoinRoot.root (X ^ n - C a)) ≠ 0 ↔ a ≠ 0

(H : Irreducible (Polynomial.X ^ n - Polynomial.C a))

AdjoinRoot.root (Polynomial.X ^ n - Polynomial.C a) ≠ 0 ↔ a ≠ 0


@[simp]
theorem mk_lt_mk : (a₁, b₁) < (a₂, b₂) ↔ a₁ < a₂ ∧ b₁ ≤ b₂ ∨ a₁ ≤ a₂ ∧ b₁ < b₂

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


/-- See `add_tsub_assoc_of_le` for the equality. -/
theorem add_tsub_le_assoc : a + b - c ≤ a + (b - c)

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


theorem MapsTo.union (h₁ : MapsTo f s₁ t) (h₂ : MapsTo f s₂ t) : MapsTo f (s₁ ∪ s₂) t

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Set α}
{t : Set β}
{f : α → β}
(h₁ : Set.MapsTo f s₁ t)
(h₂ : Set.MapsTo f s₂ t)


theorem supp_subset_range (h : natDegree p < m) : p.support ⊆ Finset.range m

{R : Type u}
{m : ℕ}
[Semiring R]
{p : R[X]}
(h : p.natDegree < m)


@[simp]
theorem mem_comap {f : E →ₗ[𝕜] F} {S : PointedCone 𝕜 F} {x : E} : x ∈ S.comap f ↔ f x ∈ S

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
[AddCommMonoid F]
[Module 𝕜 F]
{f : E →ₗ[𝕜] F}
{S : PointedCone 𝕜 F}
{x : E}


theorem Bool.of_not_eq_true : {b : Bool} → ¬ (b = true) → b = false


@[simp]
theorem setLIntegral_restrict (κ : Kernel α β) (hs : MeasurableSet s) (a : α) (f : β → ℝ≥0∞)
    (t : Set β) : ∫⁻ b in t, f b ∂κ.restrict hs a = ∫⁻ b in t ∩ s, f b ∂κ a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{s : Set β}
(κ : ProbabilityTheory.Kernel α β)
(hs : MeasurableSet s)
(a : α)
(f : β → ℝ≥0∞)
(t : Set β)

∫⁻ (b : β) in t, f b ∂(κ.restrict hs) a = ∫⁻ (b : β) in t ∩ s, f b ∂κ a


theorem associated_iff_eq {x y : α} : x ~ᵤ y ↔ x = y

{α : Type u_1}
[Monoid α]
[Unique αˣ]
{x y : α}


lemma hasDerivAt_Gamma_nat (n : ℕ) :
    HasDerivAt Gamma (n ! * (-γ + harmonic n)) (n + 1)

HasDerivAt Complex.Gamma (↑n ! * (-↑γ + ↑(harmonic n))) (↑n + 1)


@[to_additive]
theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
    Finset.image (fun i => a ^ i) (range (orderOf a)) = univ

(ha : ∀ (x : α), x ∈ AddSubgroup.zmultiples a)

Finset.image (fun i => i • a) (Finset.range (addOrderOf a)) = Finset.univ


/-- Composing a multilinear map with the identity linear map in each argument. -/
@[simp]
theorem compLinearMap_id (g : MultilinearMap R M₁' M₂) :
    (g.compLinearMap fun _ => LinearMap.id) = g

{R : Type uR}
{ι : Type uι}
{M₂ : Type v₂}
[Semiring R]
[AddCommMonoid M₂]
[Module R M₂]
{M₁' : ι → Type u_1}
[(i : ι) → AddCommMonoid (M₁' i)]
[(i : ι) → Module R (M₁' i)]
(g : MultilinearMap R M₁' M₂)

(g.compLinearMap fun x => LinearMap.id) = g


theorem cg_def : CG L M ↔ (⊤ : L.Substructure M).CG

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]

FirstOrder.Language.Structure.CG L M ↔ ⊤.CG


theorem rotation_ne_conjLIE (a : circle) : rotation a ≠ conjLIE


@[reassoc]
lemma add_comp (f₁ f₂ : X' ⟶ Y') (g : Y' ⟶ Z') :
    add W eX eY f₁ f₂ ≫ g = add W eX eZ (f₁ ≫ g) (f₂ ≫ g)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive C]
{L : CategoryTheory.Functor C D}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y Z : C}
{X' Y' Z' : D}
(eX : L.obj X ≅ X')
(eY : L.obj Y ≅ Y')
(eZ : L.obj Z ≅ Z')
(f₁ f₂ : X' ⟶ Y')
(g : Y' ⟶ Z')

CategoryTheory.CategoryStruct.comp (CategoryTheory.Localization.Preadditive.add W eX eY f₁ f₂) g =
  CategoryTheory.Localization.Preadditive.add W eX eZ (CategoryTheory.CategoryStruct.comp f₁ g)
    (CategoryTheory.CategoryStruct.comp f₂ g)


theorem codisjoint_bihimp_sup : Codisjoint (a ⇔ b) (a ⊔ b)

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


theorem div_tendsto_atTop_of_degree_gt' (hdeg : Q.degree < P.degree)
    (hpos : 0 < P.leadingCoeff / Q.leadingCoeff) :
    Tendsto (fun x => eval x P / eval x Q) atTop atTop

Filter.Tendsto (fun x => Polynomial.eval x P / Polynomial.eval x Q) Filter.atTop Filter.atTop


@[simp]
theorem repr_fract_apply (m : E) (i : ι) : b.repr (fract b m) i = Int.fract (b.repr m i)

{E : Type u_1}
{ι : Type u_2}
{K : Type u_3}
[NormedLinearOrderedField K]
[NormedAddCommGroup E]
[NormedSpace K E]
(b : Basis ι K E)
[FloorRing K]
[Fintype ι]
(m : E)
(i : ι)

(b.repr (Zspan.fract b m)) i = Int.fract ((b.repr m) i)


@[reassoc (attr := simp)]
theorem imageMonoIsoSource_inv_ι [Mono f] : (imageMonoIsoSource f).inv ≫ image.ι f = f

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

(CategoryTheory.Limits.imageMonoIsoSource f).inv ≫ CategoryTheory.Limits.image.ι f = f


theorem _root_.Disjoint.edgeSet {H₁ H₂ : Subgraph G} (h : Disjoint H₁ H₂) :
    Disjoint H₁.edgeSet H₂.edgeSet

{V : Type u}
{G : SimpleGraph V}
{H₁ H₂ : G.Subgraph}
(h : Disjoint H₁ H₂)


theorem dvd_iff_content_dvd_content_and_primPart_dvd_primPart {p q : R[X]} (hq : q ≠ 0) :
    p ∣ q ↔ p.content ∣ q.content ∧ p.primPart ∣ q.primPart

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
{p q : Polynomial R}
(hq : q ≠ 0)


@[simp]
lemma toNNReal_smul (r : ℝ≥0) (f : C(X, ℝ)₀) : (r • f).toNNReal = r • f.toNNReal

{X : Type u_1}
[TopologicalSpace X]
[Zero X]
(r : NNReal)
(f : ContinuousMapZero X ℝ)


theorem isOrtho_zero_right (x : M) : IsOrtho B x (0 : M)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
(x : M)


theorem Exists₃.imp {p q : ∀ a b, γ a b → Prop} (h : ∀ a b c, p a b c → q a b c) :
    (∃ a b c, p a b c) → ∃ a b c, q a b c

{p q : (a : α) → (b : β a) → γ a b → Prop}

(h : ∀ (a : α) (b : β a) (c : γ a b), p a b c → q a b c)


theorem mem_cocompact' : s ∈ cocompact X ↔ ∃ t, IsCompact t ∧ sᶜ ⊆ t

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

s ∈ Filter.cocompact X ↔ ∃ t, IsCompact t ∧ sᶜ ⊆ t


theorem mem_image_val_of_mem (ha : a ∈ β) (ha' : ⟨a, ha⟩ ∈ γ) : a ∈ (γ : Set α)

{α : Type u}
{β : Set α}
{γ : Set ↑β}
{a : α}
(ha : a ∈ β)
(ha' : ⟨a, ha⟩ ∈ γ)


{α : Type u_1}
{β : Type u_4}
[Preorder α]
[Preorder β]
{u : β → α}
(l : LowerAdjoint u)


/-- A class stating that a ring with an absolute value is complete, i.e. every Cauchy
sequence has a limit. -/
class IsComplete : Prop where
  /-- Every Cauchy sequence has a limit. -/
  isComplete : ∀ s : CauSeq β abv, ∃ b : β, s ≈ const abv b

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
[self : CauSeq.IsComplete β abv]
(s : CauSeq β abv)


theorem IsBot.fst (hx : IsBot x) : IsBot x.1

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{x : α × β}
(hx : IsBot x)


theorem Iio_mem_atBot [Preorder α] [NoMinOrder α] (x : α) : Iio x ∈ (atBot : Filter α)

{α : Type u_3}
[Preorder α]
[NoMinOrder α]
(x : α)


/-- A category `IsCofilteredOrEmpty` if
1. for every pair of objects there exists another object "to the left", and
2. for every pair of parallel morphisms there exists a morphism to the left so the compositions
   are equal.
-/
class IsCofilteredOrEmpty : Prop where
  /-- for every pair of objects there exists another object "to the left" -/
  cone_objs : ∀ X Y : C, ∃ (W : _) (_ : W ⟶ X) (_ : W ⟶ Y), True
  /-- for every pair of parallel morphisms there exists a morphism to the left
    so the compositions are equal -/
  cone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (W : _) (h : W ⟶ X), h ≫ f = h ≫ g

[self : CategoryTheory.IsCofilteredOrEmpty C]


theorem ncard_eq_toFinset_card' (s : Set α) [Fintype s] :
    s.ncard = s.toFinset.card


theorem add_one_le_two_mul [LE α] [Semiring α] [CovariantClass α α (· + ·) (· ≤ ·)] {a : α}
    (a1 : 1 ≤ a) : a + 1 ≤ 2 * a

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


protected theorem add_assoc (x y z : X[S⁻¹]) : x + y + z = x + (y + z)

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[AddMonoid X]
[DistribMulAction R X]
(x y z : OreLocalization S X)


@[to_additive]
theorem image_range_orderOf [DecidableEq G] :
    Finset.image (fun i => x ^ i) (Finset.range (orderOf x)) = (zpowers x : Set G).toFinset

{G : Type u_1}
[AddGroup G]
[Fintype G]
{x : G}
[DecidableEq G]

Finset.image (fun i => i • x) (Finset.range (addOrderOf x)) = (↑(AddSubgroup.zmultiples x)).toFinset


@[simp]
theorem skewProd_apply (f : M →ₗ[R] M₄) (x) : e₁.skewProd e₂ f x = (e₁ x.1, e₂ x.2 + f x.1)

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
{M₄ : Type z}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommGroup M₄]
{module_M : Module R M}
{module_M₂ : Module R M₂}
{module_M₃ : Module R M₃}
{module_M₄ : Module R M₄}
(e₁ : M ≃ₗ[R] M₂)
(e₂ : M₃ ≃ₗ[R] M₄)
(f : M →ₗ[R] M₄)
(x : M × M₃)

(e₁.skewProd e₂ f) x = (e₁ x.1, e₂ x.2 + f x.1)


/-- An `AddGroupFilterBasis` on an additive group is a `FilterBasis` satisfying some additional
  axioms. Example : if `G` is a topological group then the neighbourhoods of the identity are an
  `AddGroupFilterBasis`. Conversely given an `AddGroupFilterBasis` one can define a topology
  compatible with the group structure on `G`. -/
class AddGroupFilterBasis (A : Type u) [AddGroup A] extends FilterBasis A where
  zero' : ∀ {U}, U ∈ sets → (0 : A) ∈ U
  add' : ∀ {U}, U ∈ sets → ∃ V ∈ sets, V + V ⊆ U
  neg' : ∀ {U}, U ∈ sets → ∃ V ∈ sets, V ⊆ (fun x ↦ -x) ⁻¹' U
  conj' : ∀ x₀, ∀ {U}, U ∈ sets → ∃ V ∈ sets, V ⊆ (fun x ↦ x₀ + x + -x₀) ⁻¹' U

{A : Type u}
[AddGroup A]
[self : AddGroupFilterBasis A]
{U : Set A}

U ∈ AddGroupFilterBasis.toFilterBasis.sets → 0 ∈ U


theorem rank_pos [Nontrivial M] : 0 < Module.rank R M

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
[NoZeroSMulDivisors R M]
[Nontrivial M]


theorem atTop_hasAntitoneBasis_of_archimedean [OrderedSemiring R] [Archimedean R] :
    (atTop : Filter R).HasAntitoneBasis fun n : ℕ => Ici n

{R : Type u_2}
[OrderedSemiring R]
[Archimedean R]

Filter.atTop.HasAntitoneBasis fun n => Set.Ici ↑n


theorem toReal_le_coe_of_le_coe {a : ℝ≥0∞} {b : ℝ≥0} (h : a ≤ b) : a.toReal ≤ b


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


/-- When the first map `S.f` is zero, this is the left homology data on `S` given
by any limit kernel fork of `S.g` -/
@[simps]
def ofIsLimitKernelFork (hf : S.f = 0) (c : KernelFork S.g) (hc : IsLimit c) :
    S.LeftHomologyData

(c : CategoryTheory.Limits.KernelFork S.g)

(CategoryTheory.ShortComplex.LeftHomologyData.ofIsLimitKernelFork S hf c hc).i = CategoryTheory.Limits.Fork.ι c


@[simp]
theorem SlashInvariantForm.coe_mk (f : ℍ → ℂ) (hf : ∀ γ : Γ, f ∣[k] γ = f) : ⇑(mk f hf) = f

{Γ : outParam (Subgroup SL(2, ℤ))}
{k : outParam ℤ}
(f : ℍ → ℂ)
(hf : ∀ (γ : ↥Γ), f ∣[k] γ = f)

⇑{ toFun := f, slash_action_eq' := hf } = f


theorem integralNormalization_coeff_ne_degree {f : R[X]} {i : ℕ} (hi : f.degree ≠ i) :
    coeff (integralNormalization f) i = coeff f i * f.leadingCoeff ^ (f.natDegree - 1 - i)

{R : Type u}
[Semiring R]
{f : R[X]}
{i : ℕ}
(hi : f.degree ≠ ↑i)

f.integralNormalization.coeff i = f.coeff i * f.leadingCoeff ^ (f.natDegree - 1 - i)


theorem eq_of_compareOfLessAndEq [LT α] [DecidableEq α] {a a' : α}
[Decidable (a < a')] (h : compareOfLessAndEq a a' = .eq) : a = a'

(h : compareOfLessAndEq a a' = Ordering.eq)


theorem analyticOn_congr' {s : Set E} (h : f =ᶠ[𝓝ˢ s] g) : AnalyticOn 𝕜 f s ↔ AnalyticOn 𝕜 g s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{s : Set E}
(h : f =ᶠ[𝓝ˢ s] g)


theorem ae_ae_of_ae_compProd {p : β × γ → Prop} (h : ∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc) :
    ∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c)

{η : ProbabilityTheory.Kernel (α × β) γ}

(h : ∀ᵐ (bc : β × γ) ∂(κ.compProd η) a, p bc)

∀ᵐ (b : β) ∂κ a, ∀ᵐ (c : γ) ∂η (a, b), p (b, c)


@[simp]
lemma span_eq_toSubmodule (s : NonUnitalStarSubalgebra R A) :
    Submodule.span R (s : Set A) = s.toSubmodule

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
(s : NonUnitalStarSubalgebra R A)


@[simp]
theorem sepDegree_bot' : sepDegree F (⊥ : IntermediateField E K) = sepDegree F E

{F : Type u}
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type v)
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]

Field.sepDegree F ↥⊥ = Field.sepDegree F E


@[to_additive (attr := simp)]
theorem prod_ite_mem [DecidableEq α] (s t : Finset α) (f : α → β) :
    ∏ i ∈ s, (if i ∈ t then f i else 1) = ∏ i ∈ s ∩ t, f i

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
(s t : Finset α)
(f : α → β)

(∏ i ∈ s, if i ∈ t then f i else 1) = ∏ i ∈ s ∩ t, f i


@[simp]
theorem comp_id : φ.comp (BialgHom.id R A) = φ

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(φ : A →ₐc[R] B)


theorem finsuppTensorFinsupp'_symm_single_mul (i : ι × κ) (r₁ r₂ : R) :
    (finsuppTensorFinsupp' R ι κ).symm (Finsupp.single i (r₁ * r₂)) =
      Finsupp.single i.1 r₁ ⊗ₜ Finsupp.single i.2 r₂

(R : Type u_1)
(ι : Type u_5)
(κ : Type u_6)
[CommSemiring R]
(i : ι × κ)
(r₁ r₂ : R)

(finsuppTensorFinsupp' R ι κ).symm (Finsupp.single i (r₁ * r₂)) = Finsupp.single i.1 r₁ ⊗ₜ[R] Finsupp.single i.2 r₂


@[simp]
lemma mkOfSMul'_smul (r : R) (x : mkOfSMul' φ) :
    r • x = (show A ⟶ A from φ r) x

{R : Type u}
[Ring R]
{A : AddCommGrp}
(φ : R →+* CategoryTheory.End A)
(r : R)
(x : ↑(ModuleCat.mkOfSMul' φ))

r • x =
  (let_fun this := φ r;
    this)
    x


/-- Horizontal composition of natural isomorphisms. -/
@[simps]
def hcomp {F G : C ⥤ D} {H I : D ⥤ E} (α : F ≅ G) (β : H ≅ I) : F ⋙ H ≅ G ⋙ I

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

(CategoryTheory.NatIso.hcomp α β).hom = α.hom ◫ β.hom


theorem imp_of_if_neg {c t e : Prop} [Decidable c] (h : ite c t e) (hnc : ¬c) : e

{c t e : Prop}
[Decidable c]
(h : if c then t else e)
(hnc : ¬c)


theorem power_mul {a b c : Cardinal} : a ^ (b * c) = (a ^ b) ^ c


@[simp] theorem isClosed_univ : IsClosed (univ : Set X)


theorem toReal_pos {a : ℝ≥0∞} (ha₀ : a ≠ 0) (ha_top : a ≠ ∞) : 0 < a.toReal

{a : ℝ≥0∞}
(ha₀ : a ≠ 0)
(ha_top : a ≠ ⊤)


/-- If `f` is a local homeomorphism and the point `a` is in its target,
and if `f` is `n` times continuously differentiable at `f.symm a`,
and if the derivative at `f.symm a` is a continuous linear equivalence,
then `f.symm` is `n` times continuously differentiable at the point `a`.

This is one of the easy parts of the inverse function theorem: it assumes that we already have
an inverse function. -/
theorem PartialHomeomorph.contDiffAt_symm [CompleteSpace E] (f : PartialHomeomorph E F)
    {f₀' : E ≃L[𝕜] F} {a : F} (ha : a ∈ f.target)
    (hf₀' : HasFDerivAt f (f₀' : E →L[𝕜] F) (f.symm a)) (hf : ContDiffAt 𝕜 n f (f.symm a)) :
    ContDiffAt 𝕜 n f.symm a

(hf₀' : HasFDerivAt (↑f) (↑f₀') (↑f.symm a))


theorem down_iSup [SupSet α] (f : ι → ULift.{v} α) : (⨆ i, f i).down = ⨆ i, (f i).down

{α : Type u_1}
{ι : Sort u_5}
[SupSet α]
(f : ι → ULift.{v, u_1} α)


@[simp]
theorem expand_C (r : R) : expand R p (C r) = C r

{R : Type u}
[CommSemiring R]
(p : ℕ)
(r : R)

(Polynomial.expand R p) (Polynomial.C r) = Polynomial.C r


theorem isPreconnected_Iic : IsPreconnected (Iic a)

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


@[to_additive (attr := simp)]
theorem coprod_inl_inr {M N : Type*} [CommMonoid M] [CommMonoid N] :
    (inl M N).coprod (inr M N) = id (M × N)

{M : Type u_8}
{N : Type u_9}
[AddCommMonoid M]
[AddCommMonoid N]

(AddMonoidHom.inl M N).coprod (AddMonoidHom.inr M N) = AddMonoidHom.id (M × N)


theorem Convex.affinity (hs : Convex 𝕜 s) (z : E) (c : 𝕜) :
    Convex 𝕜 ((fun x => z + c • x) '' s)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedCommSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
(z : E)
(c : 𝕜)


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

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

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


@[simp]
theorem mem_sublistsLen {n} {l l' : List α} :
    l' ∈ sublistsLen n l ↔ l' <+ l ∧ length l' = n

l' ∈ List.sublistsLen n l ↔ l'.Sublist l ∧ l'.length = n


theorem Sublist.countP_le (s : l₁ <+ l₂) : countP p l₁ ≤ countP p l₂

{α : Type u_1}
(p : α → Bool)
{l₁ l₂ : List α}
(s : l₁ <+ l₂)


theorem span_eq_top_of_isLocalizedModule {v : Set M} (hv : span R v = ⊤) :
    span Rₛ (f '' v) = ⊤

{R : Type u_1}
(Rₛ : Type u_2)
[CommSemiring R]
(S : Submonoid R)
[CommSemiring Rₛ]
[Algebra R Rₛ]
[hT : IsLocalization S Rₛ]
{M : Type u_3}
{M' : Type u_4}
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M']
[Module R M']
[Module Rₛ M']
[IsScalarTower R Rₛ M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
{v : Set M}
(hv : Submodule.span R v = ⊤)


@[simp]
theorem tensor_β (X Y : Center C) (U : C) :
    (X ⊗ Y).2.β U =
      α_ _ _ _ ≪≫
        (whiskerLeftIso X.1 (Y.2.β U)) ≪≫ (α_ _ _ _).symm ≪≫
          (whiskerRightIso (X.2.β U) Y.1) ≪≫ α_ _ _ _

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

(X ⊗ Y).snd.β U =
  α_ X.fst Y.fst U ≪≫
    CategoryTheory.MonoidalCategory.whiskerLeftIso X.fst (Y.snd.β U) ≪≫
      (α_ X.fst U Y.fst).symm ≪≫ CategoryTheory.MonoidalCategory.whiskerRightIso (X.snd.β U) Y.fst ≪≫ α_ U X.fst Y.fst


theorem union_vsub_inter_subset_union : s₁ ∪ s₂ -ᵥ t₁ ∩ t₂ ⊆ s₁ -ᵥ t₁ ∪ (s₂ -ᵥ t₂)

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{s₁ s₂ t₁ t₂ : Set β}


lemma ringHomComp_inv {R : Type*} [CommRing R] (χ : MulChar R R') (f : R' →+* R'') :
    (χ.ringHomComp f)⁻¹ = χ⁻¹.ringHomComp f

{R' : Type u_2}
[CommRing R']
{R'' : Type u_3}
[CommRing R'']
{R : Type u_4}
[CommRing R]
(χ : MulChar R R')
(f : R' →+* R'')


lemma CFC.spectrum_one_eq [Nontrivial A] :
    spectrum R (1 : A) = {1}

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
[Nontrivial A]


private theorem lt_two_pow_of_le {x m n : Nat} (lt : x < 2 ^ m) (le : m ≤ n) : x < 2 ^ n


@[simp]
theorem verts_top : (⊤ : G.Subgraph).verts = Set.univ


@[simp]
theorem Trident.ι_eq_app_zero (t : Trident f) : t.ι = t.π.app zero

{J : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f : J → (X ⟶ Y)}
(t : CategoryTheory.Limits.Trident f)

t.ι = t.π.app CategoryTheory.Limits.WalkingParallelFamily.zero


theorem HasIntegral.integral_eq (h : HasIntegral I l f vol y) : integral I l f vol = y

(h : BoxIntegral.HasIntegral I l f vol y)


@[continuity]
theorem Continuous.matrix_submatrix {A : X → Matrix l n R} (hA : Continuous A) (e₁ : m → l)
    (e₂ : p → n) : Continuous fun x => (A x).submatrix e₁ e₂

{X : Type u_1}
{l : Type u_3}
{m : Type u_4}
{n : Type u_5}
{p : Type u_6}
{R : Type u_8}
[TopologicalSpace X]
[TopologicalSpace R]
{A : X → Matrix l n R}
(hA : Continuous A)
(e₁ : m → l)
(e₂ : p → n)


theorem ι_jointly_surjective (x : 𝖣.glued) : ∃ (i : D.J) (y : D.U i), (𝖣.ι i).base y = x

(D : AlgebraicGeometry.SheafedSpace.GlueData C)


theorem add_descFactorial_eq_ascFactorial' (n : ℕ) :
    ∀ k : ℕ, (n + k - 1).descFactorial k = n.ascFactorial k


@[to_additive eq_zero_of_add_nonneg_left]
theorem eq_one_of_one_le_mul_left (ha : a ≤ 1) (hb : b ≤ 1) (hab : 1 ≤ a * b) : a = 1

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


theorem le_levenshtein_append (xs : List α) (ys₁ ys₂) :
    ∃ xs', xs' <:+ xs ∧ levenshtein C xs' ys₂ ≤ levenshtein C xs (ys₁ ++ ys₂)


@[simp]
theorem goldConj_mul_gold : ψ * φ = -1


lemma isContinuous_comp (F₁ : C ⥤ D) (F₂ : D ⥤ E) (J : GrothendieckTopology C)
    (K : GrothendieckTopology D) (L : GrothendieckTopology E)
    [Functor.IsContinuous.{t} F₁ J K] [Functor.IsContinuous.{t} F₂ K L] :
    Functor.IsContinuous.{t} (F₁ ⋙ F₂) J L

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

(L : CategoryTheory.GrothendieckTopology E)


/-- Variant of `mul_le_of_le_one_right` for `a` non-positive instead of non-negative. -/
theorem le_mul_of_le_one_right [ExistsAddOfLE α] [PosMulMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (ha : a ≤ 0) (h : b ≤ 1) : a ≤ a * b

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

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


@[simp]
theorem inclusion_self {E : IntermediateField K L} : inclusion (le_refl E) = AlgHom.id K E

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{E : IntermediateField K L}

IntermediateField.inclusion ⋯ = AlgHom.id K ↥E


theorem eventually_lt_nhds (hab : a < b) : ∀ᶠ x in 𝓝 a, x < b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{a b : α}
(hab : a < b)


@[to_additive]
theorem mem_smul_filter : s ∈ a • f ↔ (a • ·) ⁻¹' s ∈ f

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{f : Filter β}
{s : Set β}
{a : α}

s ∈ a +ᵥ f ↔ (fun x => a +ᵥ x) ⁻¹' s ∈ f


@[simp]
theorem counit_apply (r : R) : counit r = r


theorem OrderIso.liminf_apply {γ} [ConditionallyCompleteLattice β] [ConditionallyCompleteLattice γ]
    {f : Filter α} {u : α → β} (g : β ≃o γ)
    (hu : f.IsBoundedUnder (· ≥ ·) u := by isBoundedDefault)
    (hu_co : f.IsCoboundedUnder (· ≥ ·) u := by isBoundedDefault)
    (hgu : f.IsBoundedUnder (· ≥ ·) fun x => g (u x) := by isBoundedDefault)
    (hgu_co : f.IsCoboundedUnder (· ≥ ·) fun x => g (u x) := by isBoundedDefault) :
    g (liminf u f) = liminf (fun x => g (u x)) f

(hu : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f u := by isBoundedDefault)

(hu_co : Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) f u := by isBoundedDefault)

(hgu : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f fun x => g (u x) := by isBoundedDefault)

(hgu_co : Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) f fun x => g (u x) := by isBoundedDefault)

g (Filter.liminf u f) = Filter.liminf (fun x => g (u x)) f


@[simp]
theorem congr_refl : congr (.refl : A ≃ₐ[S] A) (.refl : C ≃ₐ[R] C) = .refl

{R : Type uR}
{S : Type uS}
{A : Type uA}
{C : Type uC}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
[Semiring A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
[Semiring C]
[Algebra R C]

Algebra.TensorProduct.congr AlgEquiv.refl AlgEquiv.refl = AlgEquiv.refl


@[to_additive]
lemma Commute.smul_left [Mul α] [SMulCommClass M α α] [IsScalarTower M α α] {a b : α}
    (h : Commute a b) (r : M) : Commute (r • a) b

{M : Type u_1}
{α : Type u_7}
[SMul M α]
[Mul α]
[SMulCommClass M α α]
[IsScalarTower M α α]
{a b : α}
(h : Commute a b)
(r : M)


@[to_additive (attr := simp)]
theorem map_comp : (f.map hy k).comp f.toMap = k.toMap.comp g

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{g : M →* P}
{T : Submonoid P}
(hy : ∀ (y : ↥S), g ↑y ∈ T)
{Q : Type u_4}
[CommMonoid Q]
{k : T.LocalizationMap Q}


@[simp]
theorem smul_snd : (c • x).snd = c • x.snd

{p : ℝ≥0∞}
{𝕜 : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Semiring 𝕜]
[AddCommGroup α]
[AddCommGroup β]
(x : WithLp p (α × β))
(c : 𝕜)
[Module 𝕜 α]
[Module 𝕜 β]


@[simp] theorem elim_some (x : β) (f : α → β) (a : α) : (some a).elim x f = f a

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


lemma le_sum_distinctPairs_edgeDensity_sq (x : {i // i ∈ P.parts.offDiag}) (hε₁ : ε ≤ 1)
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5) :
    (G.edgeDensity x.1.1 x.1.2 : ℝ) ^ 2 +
      ((if G.IsUniform ε x.1.1 x.1.2 then 0 else ε ^ 4 / 3) - ε ^ 5 / 25) ≤
    (∑ i ∈ distinctPairs hP G ε x, G.edgeDensity i.1 i.2 ^ 2 : ℝ) / 16 ^ P.parts.card

(hPα : P.parts.card * 16 ^ P.parts.card ≤ Fintype.card α)

↑(G.edgeDensity (↑x).1 (↑x).2) ^ 2 + ((if G.IsUniform ε (↑x).1 (↑x).2 then 0 else ε ^ 4 / 3) - ε ^ 5 / 25) ≤
  (∑ i ∈ SzemerediRegularity.distinctPairs hP G ε x, ↑(G.edgeDensity i.1 i.2) ^ 2) / 16 ^ P.parts.card


theorem iteratedFDeriv_const_of_ne {n : ℕ} (hn : n ≠ 0) (c : F) :
    (iteratedFDeriv 𝕜 n fun _ : E ↦ c) = 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
(hn : n ≠ 0)
(c : F)


theorem prod_mul_reverse_inv_prod (L : List (TransvectionStruct n R)) :
    (L.map toMatrix).prod * (L.reverse.map (toMatrix ∘ TransvectionStruct.inv)).prod = 1

(L : List (Matrix.TransvectionStruct n R))

(List.map Matrix.TransvectionStruct.toMatrix L).prod *
    (List.map (Matrix.TransvectionStruct.toMatrix ∘ Matrix.TransvectionStruct.inv) L.reverse).prod =
  1


theorem IsCoprime.isUnit_of_dvd' {a b x : R} (h : IsCoprime a b) (ha : x ∣ a) (hb : x ∣ b) :
    IsUnit x

{R : Type u}
[CommSemiring R]
{a b x : R}
(h : IsCoprime a b)
(ha : x ∣ a)
(hb : x ∣ b)


@[simp]
theorem zero_sub (a : Ordinal) : 0 - a = 0


lemma smul_top_le_comap_smul_top [CommSemiring R] [AddCommMonoid M]
    [AddCommMonoid M₂] [Module R M] [Module R M₂] (I : Ideal R)
    (f : M →ₗ[R] M₂) : I • ⊤ ≤ comap f (I • ⊤)

{R : Type u_1}
{M : Type u_3}
{M₂ : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(I : Ideal R)
(f : M →ₗ[R] M₂)


@[reassoc]
lemma v_comp_XIsoOfEq_inv
    (γ : Cochain F G n) (p q q' : ℤ) (hpq : p + n = q) (hq' : q' = q) :
    γ.v p q hpq ≫ (HomologicalComplex.XIsoOfEq G hq').inv = γ.v p q' (by rw [hq', hpq])

(γ : CochainComplex.HomComplex.Cochain F G n)

γ.v p q hpq ≫ (HomologicalComplex.XIsoOfEq G hq').inv = γ.v p q' ⋯


theorem IsCompact.tendsto_subseq {s : Set X} {x : ℕ → X} (hs : IsCompact s) (hx : ∀ n, x n ∈ s) :
    ∃ a ∈ s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (x ∘ φ) atTop (𝓝 a)

{X : Type u_1}
[TopologicalSpace X]
[FirstCountableTopology X]
{s : Set X}
{x : ℕ → X}
(hs : IsCompact s)
(hx : ∀ (n : ℕ), x n ∈ s)

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


lemma slope_lt_of_hasDerivWithinAt (hfc : StrictConcaveOn ℝ S f)
    (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y) (hfd : HasDerivWithinAt f f' S x) :
    slope f x y < f'

{S : Set ℝ}
{f : ℝ → ℝ}
{x y f' : ℝ}
(hfc : StrictConcaveOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hfd : HasDerivWithinAt f f' S x)


/-- If `s ≤ t` in colex and `s.card ≤ t.card`, then `s \ {a} ≤ t \ {min t}` for any `a ∈ s`. -/
lemma erase_le_erase_min' (hst : toColex s ≤ toColex t) (hcard : s.card ≤ t.card) (ha : a ∈ s) :
    toColex (s.erase a) ≤
      toColex (t.erase <| min' t <| card_pos.1 <| (card_pos.2 ⟨a, ha⟩).trans_le hcard)

(hst : { ofColex := s } ≤ { ofColex := t })

{ ofColex := s.erase a } ≤ { ofColex := t.erase (t.min' ⋯) }


theorem openEmbedding_of_embedding_open (h₁ : Embedding f) (h₂ : IsOpenMap f) :
    OpenEmbedding f

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(h₁ : Embedding f)
(h₂ : IsOpenMap f)


theorem extend_preimage_mem_nhds {x : M} (h : x ∈ f.source) (ht : t ∈ 𝓝 x) :
    (f.extend I).symm ⁻¹' t ∈ 𝓝 (f.extend I x)

{𝕜 : 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)
{t : Set M}
{x : M}
(h : x ∈ f.source)
(ht : t ∈ 𝓝 x)

↑(f.extend I).symm ⁻¹' t ∈ 𝓝 (↑(f.extend I) x)


@[simp]
theorem closure_empty : closure (∅ : Set R) = ⊥


/-- The restriction of scalars by a composition of ring morphisms identify to the
composition of the restriction of scalars functors. -/
@[simps! hom_app inv_app]
def restrictScalarsComp' :
    ModuleCat.restrictScalars.{v} gf ≅
      ModuleCat.restrictScalars g ⋙ ModuleCat.restrictScalars f

{R₁ : Type u₁}
{R₂ : Type u₂}
{R₃ : Type u₃}
[Ring R₁]
[Ring R₂]
[Ring R₃]
(f : R₁ →+* R₂)
(g : R₂ →+* R₃)
(gf : R₁ →+* R₃)
(hgf : gf = g.comp f)
(X : ModuleCat R₃)

(ModuleCat.restrictScalarsComp' f g gf hgf).inv.app X = (ModuleCat.restrictScalarsComp'App f g gf hgf X).inv


@[simp, norm_cast]
protected theorem coe_div (r₁ r₂ : ℝ≥0) : ((r₁ / r₂ : ℝ≥0) : ℝ) = (r₁ : ℝ) / r₂


@[simp] theorem coe_punitProd : ⇑(punitProd X) = Prod.snd


@[simp]
theorem unpair_zero : unpair 0 = 0


@[to_additive (attr := simp, norm_cast)]
theorem coe_div (x y : H) : (x / y).1 = x.1 / y.1

{G : Type u_1}
[AddGroup G]
{S : Type u_6}
{H : S}
[SetLike S G]
[AddSubgroupClass S G]
(x y : ↥H)


theorem totalSpaceMk_closedEmbedding [T1Space B] (x : B) :
    ClosedEmbedding (@TotalSpace.mk B F E x)

[TopologicalSpace (Bundle.TotalSpace F E)]


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

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


protected lemma xor_assoc (n m k : ℕ) : (n ^^^ m) ^^^ k = n ^^^ (m ^^^ k)


theorem edgeFinset_deleteEdges [DecidableEq V] [Fintype G.edgeSet] (s : Finset (Sym2 V))
    [Fintype (G.deleteEdges s).edgeSet] :
    (G.deleteEdges s).edgeFinset = G.edgeFinset \ s

{V : Type u_1}
(G : SimpleGraph V)
[DecidableEq V]
[Fintype ↑G.edgeSet]
(s : Finset (Sym2 V))
[Fintype ↑(G.deleteEdges ↑s).edgeSet]

(G.deleteEdges ↑s).edgeFinset = G.edgeFinset \ s


@[simp, norm_cast]
theorem val_one : ↑(1 : selfAdjoint R) = (1 : R)


@[simp, norm_cast]
theorem withBotCoe_inj {I J : WithBot (Box ι)} : (I : Set (ι → ℝ)) = J ↔ I = J

{ι : Type u_1}
{I J : WithBot (BoxIntegral.Box ι)}


protected theorem add {f : α → E} {s : Set α} (hf : LocallyBoundedVariationOn f s) {a b c : α}
    (ha : a ∈ s) (hb : b ∈ s) (hc : c ∈ s) :
    variationOnFromTo f s a b + variationOnFromTo f s b c = variationOnFromTo f s a c

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{f : α → E}
{s : Set α}
(hf : LocallyBoundedVariationOn f s)
{a b c : α}
(ha : a ∈ s)
(hb : b ∈ s)
(hc : c ∈ s)


/-- A measure on a finite product space equals the product measure if they are equal on
  rectangles. -/
theorem pi_eq {μ' : Measure (∀ i, α i)}
    (h : ∀ s : ∀ i, Set (α i), (∀ i, MeasurableSet (s i)) → μ' (pi univ s) = ∏ i, μ i (s i)) :
    Measure.pi μ = μ'

{μ : (i : ι) → MeasureTheory.Measure (α i)}

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

{μ' : MeasureTheory.Measure ((i : ι) → α i)}

(h : ∀ (s : (i : ι) → Set (α i)), (∀ (i : ι), MeasurableSet (s i)) → μ' (Set.univ.pi s) = ∏ i : ι, (μ i) (s i))


theorem encard_insert_of_not_mem {a : α} (has : a ∉ s) : (insert a s).encard = s.encard + 1

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


@[simp]
nonrec theorem sum_bernoulli (n : ℕ) :
    (∑ k ∈ range (n + 1), ((n + 1).choose k : ℚ) • bernoulli k) = monomial n (n + 1 : ℚ)

∑ k ∈ Finset.range (n + 1), ↑((n + 1).choose k) • Polynomial.bernoulli k = (Polynomial.monomial n) (↑n + 1)


/-- A bilinear form is nondegenerate if and only if it has a trivial kernel. -/
theorem nondegenerate_iff_ker_eq_bot {B : BilinForm R M} :
    B.Nondegenerate ↔ LinearMap.ker B = ⊥

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}


theorem NeZero.nat_of_injective {n : ℕ} [h : NeZero (n : R)] [RingHomClass F R S] {f : F}
    (hf : Function.Injective f) : NeZero (n : S)

{R : Type u_3}
{S : Type u_4}
{F : Type u_5}
[NonAssocSemiring R]
[NonAssocSemiring S]
[FunLike F R S]
{n : ℕ}
[h : NeZero ↑n]
[RingHomClass F R S]
{f : F}
(hf : Function.Injective ⇑f)


protected lemma IsOfFinOrder.norm_eq_one (ha : IsOfFinOrder a) : ‖a‖ = 1

{α : Type u_1}
[NormedDivisionRing α]
{a : α}
(ha : IsOfFinOrder a)


/-- The unit for the equivalence `Comon_ (C ⥤ D) ≌ C ⥤ Comon_ D`.
-/
@[simps!]
private def unitIso : 𝟭 (Comon_ (C ⥤ D)) ≅ functor ⋙ inverse

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
(X : Comon_ (C ⥤ D))

∀ (x : C), (CategoryTheory.Monoidal.ComonFunctorCategoryEquivalence.unitIso.hom.app X).hom.app x = 𝟙 (X.X.obj x)


theorem degree_add_div (hq0 : q ≠ 0) (hpq : degree q ≤ degree p) :
    degree q + degree (p / q) = degree p

{R : Type u}
[Field R]
{p q : R[X]}
(hq0 : q ≠ 0)
(hpq : q.degree ≤ p.degree)


theorem Real.sInf_smul_of_nonpos (ha : a ≤ 0) (s : Set ℝ) : sInf (a • s) = a • sSup s

{α : Type u_2}
[LinearOrderedField α]
[Module α ℝ]
[OrderedSMul α ℝ]
{a : α}
(ha : a ≤ 0)
(s : Set ℝ)


@[simp] theorem bne_self_left  : ∀(a b : Bool), (a != (a != b)) = b


theorem card_fintypeIco : Fintype.card (Set.Ico a b) = b - a


/-- A structure groupoid is a set of partial homeomorphisms of a topological space stable under
composition and inverse. They appear in the definition of the smoothness class of a manifold. -/
structure StructureGroupoid (H : Type u) [TopologicalSpace H] where
  /-- Members of the structure groupoid are partial homeomorphisms. -/
  members : Set (PartialHomeomorph H H)
  /-- Structure groupoids are stable under composition. -/
  trans' : ∀ e e' : PartialHomeomorph H H, e ∈ members → e' ∈ members → e ≫ₕ e' ∈ members
  /-- Structure groupoids are stable under inverse. -/
  symm' : ∀ e : PartialHomeomorph H H, e ∈ members → e.symm ∈ members
  /-- The identity morphism lies in the structure groupoid. -/
  id_mem' : PartialHomeomorph.refl H ∈ members
  /-- Let `e` be a partial homeomorphism. If for every `x ∈ e.source`, the restriction of e to some
  open set around `x` lies in the groupoid, then `e` lies in the groupoid. -/
  locality' : ∀ e : PartialHomeomorph H H,
    (∀ x ∈ e.source, ∃ s, IsOpen s ∧ x ∈ s ∧ e.restr s ∈ members) → e ∈ members
  /-- Membership in a structure groupoid respects the equivalence of partial homeomorphisms. -/
  mem_of_eqOnSource' : ∀ e e' : PartialHomeomorph H H, e ∈ members → e' ≈ e → e' ∈ members

{H : Type u}
[TopologicalSpace H]
(self : StructureGroupoid H)


/-- A function in `Lp` can be approximated in `Lp` by continuous functions. -/
theorem boundedContinuousFunction_dense [SecondCountableTopologyEither α E] [Fact (1 ≤ p)]
    (hp : p ≠ ∞) [μ.WeaklyRegular] :
    Dense (boundedContinuousFunction E p μ : Set (Lp E p μ))

{α : Type u_1}
[TopologicalSpace α]
[NormalSpace α]
[MeasurableSpace α]
[BorelSpace α]
(E : Type u_2)
[NormedAddCommGroup E]
(μ : MeasureTheory.Measure α)
{p : ℝ≥0∞}
[NormedSpace ℝ E]
[SecondCountableTopologyEither α E]
[Fact (1 ≤ p)]
(hp : p ≠ ⊤)
[μ.WeaklyRegular]

Dense ↑(MeasureTheory.Lp.boundedContinuousFunction E p μ)


@[simp]
theorem inv_fun_map (F : C ⥤ D) [IsEquivalence F] (X Y : C) (f : X ⟶ Y) :
    F.inv.map (F.map f) = F.asEquivalence.unitInv.app X ≫ f ≫ F.asEquivalence.unit.app Y

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

F.inv.map (F.map f) =
  CategoryTheory.CategoryStruct.comp (F.asEquivalence.unitInv.app X)
    (CategoryTheory.CategoryStruct.comp f (F.asEquivalence.unit.app Y))


theorem blsub_le_of_brange_subset {o o'} {f : ∀ a < o, Ordinal} {g : ∀ a < o', Ordinal}
    (h : brange o f ⊆ brange o' g) : blsub.{u, max v w} o f ≤ blsub.{v, max u w} o' g

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

{g : (a : Ordinal.{v}) → a < o' → Ordinal.{max (max u v) w}}


@[parity_simps] lemma odd_sub (h : n ≤ m) : Odd (m - n) ↔ (Odd m ↔ Even n)


lemma P_zero : (P 0 : K[X] ⟶ K[X]) = 𝟙 _

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


theorem lt_wf : @WellFounded NONote (· < ·)


@[simp]
theorem Matrix.reindexLieEquiv_apply (M : Matrix n n R) :
    Matrix.reindexLieEquiv e M = Matrix.reindex e e M

{R : Type u}
[CommRing R]
{n : Type w}
[DecidableEq n]
[Fintype n]
{m : Type w₁}
[DecidableEq m]
[Fintype m]
(e : n ≃ m)
(M : Matrix n n R)

(Matrix.reindexLieEquiv e) M = (Matrix.reindex e e) M


@[simp]
theorem isAtom_dual_iff_isCoatom [OrderTop α] {a : α} :
    IsAtom (OrderDual.toDual a) ↔ IsCoatom a

{α : Type u_2}
[Preorder α]
[OrderTop α]
{a : α}


theorem sqrt_two_inv_mul_self : (√2)⁻¹ * (√2)⁻¹ = (2⁻¹ : ℝ)


lemma exists_oneHypercover {X : C} (S : Sieve X) (hS : S ∈ J X) :
    ∃ (E : J.OneHypercover X) (_ : H E), E.sieve₀ ≤ S

{J : CategoryTheory.GrothendieckTopology C}


@[reassoc (attr := simp)]
theorem image.fac_lift (F' : MonoFactorisation f) : factorThruImage f ≫ image.lift F' = F'.e

(F' : CategoryTheory.Limits.MonoFactorisation f)

CategoryTheory.Limits.factorThruImage f ≫ CategoryTheory.Limits.image.lift F' = F'.e


theorem Prime.not_dvd_finset_prod {S : Finset α} {p : M} (pp : Prime p) {g : α → M}
    (hS : ∀ a ∈ S, ¬p ∣ g a) : ¬p ∣ S.prod g

{α : Type u_1}
{M : Type u_5}
[CommMonoidWithZero M]
{S : Finset α}
{p : M}
(pp : Prime p)
{g : α → M}
(hS : ∀ a ∈ S, ¬p ∣ g a)


@[to_additive (attr := simp)]
theorem prod_erase [DecidableEq α] (h : a ∈ s) : a * (s.erase a).prod = s.prod

{α : Type u_3}
[CommMonoid α]
{s : Multiset α}
{a : α}
[DecidableEq α]
(h : a ∈ s)


theorem inverse_mul_cancel_left (x y : M₀) (h : IsUnit x) : inverse x * (x * y) = y

{M₀ : Type u_2}
[MonoidWithZero M₀]
(x y : M₀)
(h : IsUnit x)


theorem limit.pre_post {D : Type u'} [Category.{v'} D] (E : K ⥤ J) (F : J ⥤ C) (G : C ⥤ D)
    [HasLimit F] [HasLimit (E ⋙ F)] [HasLimit (F ⋙ G)]
    [h : HasLimit ((E ⋙ F) ⋙ G)] :-- G (limit F) ⟶ G (limit (E ⋙ F)) ⟶ limit ((E ⋙ F) ⋙ G) vs
            -- G (limit F) ⟶ limit F ⋙ G ⟶ limit (E ⋙ (F ⋙ G)) or
    haveI : HasLimit (E ⋙ F ⋙ G) := h
    G.map (limit.pre F E) ≫ limit.post (E ⋙ F) G = limit.post F G ≫ limit.pre (F ⋙ G) E

[CategoryTheory.Limits.HasLimit (E ⋙ F)]

[CategoryTheory.Limits.HasLimit (F ⋙ G)]

[h : CategoryTheory.Limits.HasLimit ((E ⋙ F) ⋙ G)]

G.map (CategoryTheory.Limits.limit.pre F E) ≫ CategoryTheory.Limits.limit.post (E ⋙ F) G =
  CategoryTheory.Limits.limit.post F G ≫ CategoryTheory.Limits.limit.pre (F ⋙ G) E


theorem eval₂_eq_sum {f : R →+* S} {x : S} : p.eval₂ f x = p.sum fun e a => f a * x ^ e

{R : Type u}
{S : Type v}
[Semiring R]
{p : R[X]}
[Semiring S]
{f : R →+* S}
{x : S}

Polynomial.eval₂ f x p = p.sum fun e a => f a * x ^ e


theorem submonoid_map_le_is_unit : M.map (algebraMap R S) ≤ IsUnit.submonoid S

{R : Type u_1}
[CommRing R]
(M : Submonoid R)
(S : Type u_2)
[CommRing S]
[Algebra R S]
[IsLocalization M S]

Submonoid.map (algebraMap R S) M ≤ IsUnit.submonoid S


@[simp]
theorem toList_cons (a : α) (s) : toList (cons a s) = (List.cons a <$> toList s).think

{α : Type u}
(a : α)
(s : Stream'.WSeq α)

(Stream'.WSeq.cons a s).toList = (List.cons a <$> s.toList).think


theorem upperSemicontinuous_iff_limsup_le {f : α → γ} :
    UpperSemicontinuous f ↔ ∀ x, limsup f (𝓝 x) ≤ f x

{α : Type u_1}
[TopologicalSpace α]
{γ : Type u_3}
[CompleteLinearOrder γ]
[DenselyOrdered γ]
{f : α → γ}

UpperSemicontinuous f ↔ ∀ (x : α), Filter.limsup f (𝓝 x) ≤ f x


theorem Nat.encard_range (k : ℕ) : {i | i < k}.encard = k


@[simp]
theorem coe_toStarSubalgebra (S : VonNeumannAlgebra H) :
    (S.toStarSubalgebra : Set (H →L[ℂ] H)) = S

{H : Type u}
[NormedAddCommGroup H]
[InnerProductSpace ℂ H]
[CompleteSpace H]
(S : VonNeumannAlgebra H)


theorem nth_eq_zero {n} :
    nth p n = 0 ↔ p 0 ∧ n = 0 ∨ ∃ hf : (setOf p).Finite, hf.toFinset.card ≤ n

Nat.nth p n = 0 ↔ p 0 ∧ n = 0 ∨ ∃ (hf : (setOf p).Finite), hf.toFinset.card ≤ n


theorem segment_subset_convexHull (hx : x ∈ s) (hy : y ∈ s) : segment 𝕜 x y ⊆ convexHull 𝕜 s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s : Set E}
{x y : E}
(hx : x ∈ s)
(hy : y ∈ s)


theorem of_irreducible_expand {p : ℕ} (hp : p ≠ 0) {f : R[X]} (hf : Irreducible (expand R p f)) :
    Irreducible f

(hf : Irreducible ((Polynomial.expand R p) f))


@[simp]
theorem sub_re (z w : ℂ) : (z - w).re = z.re - w.re


@[to_additive] lemma inf_eq_div_oneLePart_div (a b : α) : a ⊓ b = a / (a / b)⁺ᵐ

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


/-- The conditional expectation of a function `f` of the product `(X, Y)` is almost everywhere equal
to the integral of `y ↦ f(X, y)` against the `condDistrib` kernel. -/
theorem condexp_prod_ae_eq_integral_condDistrib [NormedSpace ℝ F] [CompleteSpace F]
    (hX : Measurable X) (hY : AEMeasurable Y μ) (hf : StronglyMeasurable f)
    (hf_int : Integrable (fun a => f (X a, Y a)) μ) :
    μ[fun a => f (X a, Y a)|mβ.comap X] =ᵐ[μ] fun a => ∫ y, f (X a, y) ∂condDistrib Y X μ (X a)

(hf : MeasureTheory.StronglyMeasurable f)

(hf_int : MeasureTheory.Integrable (fun a => f (X a, Y a)) μ)

μ[fun a => f (X a, Y a)|MeasurableSpace.comap X mβ] =ᵐ[μ] fun a =>
  ∫ (y : Ω), f (X a, y) ∂(ProbabilityTheory.condDistrib Y X μ) (X a)


theorem integrable_iff_integrableAtFilter_cocompact :
    Integrable f μ ↔ (IntegrableAtFilter f (cocompact X) μ ∧ LocallyIntegrable f μ)

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[TopologicalSpace X]
[NormedAddCommGroup E]
{f : X → E}
{μ : MeasureTheory.Measure X}

MeasureTheory.Integrable f μ ↔
  MeasureTheory.IntegrableAtFilter f (Filter.cocompact X) μ ∧ MeasureTheory.LocallyIntegrable f μ


theorem pred_eq_iff_not_succ {o} : pred o = o ↔ ¬∃ a, o = succ a


theorem card_rootSet_eq_natDegree_iff_of_splits [Algebra F K] {f : F[X]} (hf : f ≠ 0)
    (h : f.Splits (algebraMap F K)) : Fintype.card (f.rootSet K) = f.natDegree ↔ f.Separable

(h : Polynomial.Splits (algebraMap F K) f)

Fintype.card ↑(f.rootSet K) = f.natDegree ↔ f.Separable


theorem Faithful.div_faithful (F : C ⥤ E) [F.Faithful] (G : D ⥤ E) [G.Faithful] (obj : C → D)
    (h_obj : ∀ X, G.obj (obj X) = F.obj X) (map : ∀ {X Y}, (X ⟶ Y) → (obj X ⟶ obj Y))
    (h_map : ∀ {X Y} {f : X ⟶ Y}, HEq (G.map (map f)) (F.map f)) :
    Functor.Faithful (Faithful.div F G obj @h_obj @map @h_map)

(h_obj : ∀ (X : C), G.obj (obj X) = F.obj X)

(map : {X Y : C} → (X ⟶ Y) → (obj X ⟶ obj Y))

(h_map : ∀ {X Y : C} {f : X ⟶ Y}, HEq (G.map (map f)) (F.map f))

(CategoryTheory.Functor.Faithful.div F G obj h_obj map h_map).Faithful


/-- The elliptic curve over `R` induced by an admissible linear change of variables
$(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$.
When `R` is a field, any two Weierstrass equations isomorphic to `E` are related by this. -/
@[simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
def variableChange : EllipticCurve R

{R : Type u}
[CommRing R]
(E : EllipticCurve R)
(C : WeierstrassCurve.VariableChange R)

(E.variableChange C).a₁ = ↑C.u⁻¹ * (E.a₁ + 2 * C.s)


/-- When `S₁.g` and `S₂.g` are zero and we have chosen colimit cokernel coforks `c₁` and `c₂`
for `S₁.f` and `S₂.f` respectively, the action on right homology of a morphism `φ : S₁ ⟶ S₂` of
short complexes is given by the unique morphism `f : c₁.pt ⟶ c₂.pt` such that
`φ.τ₂ ≫ c₂.π = c₁.π ≫ f`. -/
@[simps]
def ofIsColimitCokernelCofork (φ : S₁ ⟶ S₂)
    (hg₁ : S₁.g = 0) (c₁ : CokernelCofork S₁.f) (hc₁ : IsColimit c₁)
    (hg₂ : S₂.g = 0) (c₂ : CokernelCofork S₂.f) (hc₂ : IsColimit c₂) (f : c₁.pt ⟶ c₂.pt)
    (comm : φ.τ₂ ≫ c₂.π = c₁.π ≫ f) :
    RightHomologyMapData φ (RightHomologyData.ofIsColimitCokernelCofork S₁ hg₁ c₁ hc₁)
      (RightHomologyData.ofIsColimitCokernelCofork S₂ hg₂ c₂ hc₂)

(c₁ : CategoryTheory.Limits.CokernelCofork S₁.f)

(hc₁ : CategoryTheory.Limits.IsColimit c₁)

(c₂ : CategoryTheory.Limits.CokernelCofork S₂.f)

(hc₂ : CategoryTheory.Limits.IsColimit c₂)

(comm :
  CategoryTheory.CategoryStruct.comp φ.τ₂ (CategoryTheory.Limits.Cofork.π c₂) =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Cofork.π c₁) f)

(CategoryTheory.ShortComplex.RightHomologyMapData.ofIsColimitCokernelCofork φ hg₁ c₁ hc₁ hg₂ c₂ hc₂ f comm).φQ = f


@[simp]
theorem sInf_coe_toSubmodule (S : Set (LieSubmodule R L M)) :
    (↑(sInf S) : Submodule R M) = sInf {(s : Submodule R M) | s ∈ S}

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(S : Set (LieSubmodule R L M))


theorem reflexive_left : IsReflexive R M

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(p : PerfectPairing R M N)


/-- If `‖v‖^n * ‖f v‖` is integrable, then the `n`-th derivative of the Fourier transform of `f` is
  the Fourier transform of `fun v ↦ (-2 * π * I) ^ n ⟪v, ⬝⟫^n f v`. -/
theorem iteratedFDeriv_fourierIntegral {N : ℕ∞}
    (hf : ∀ (n : ℕ), n ≤ N → Integrable (fun v ↦ ‖v‖^n * ‖f v‖))
    (h'f : AEStronglyMeasurable f) {n : ℕ} (hn : n ≤ N) :
    iteratedFDeriv ℝ n (𝓕 f) = 𝓕 (fun v ↦ fourierPowSMulRight (innerSL ℝ) f v n)

(hf : ∀ (n : ℕ), ↑n ≤ N → MeasureTheory.Integrable (fun v => ‖v‖ ^ n * ‖f v‖) MeasureTheory.volume)

(h'f : MeasureTheory.AEStronglyMeasurable f MeasureTheory.volume)

iteratedFDeriv ℝ n (𝓕 f) = 𝓕 fun v => VectorFourier.fourierPowSMulRight (innerSL ℝ) f v n


theorem arctan_inv_of_neg {x : ℝ} (h : x < 0) : arctan x⁻¹ = -(π / 2) - arctan x

Real.arctan x⁻¹ = -(Real.pi / 2) - Real.arctan x


theorem Heap.realSize_deleteMin {s : Heap α} (eq : s.deleteMin le = some (a, s')) :
    s.realSize = s'.realSize + 1

{s' s : Batteries.BinomialHeap.Imp.Heap α}

(eq : Batteries.BinomialHeap.Imp.Heap.deleteMin le s = some (a, s'))


lemma one_tmul_sub_tmul_one_mul_elem
    (s : S) : (1 ⊗ₜ s - s ⊗ₜ 1) * elem R S = 0

{R S : Type u_2}
[CommRing R]
[CommRing S]
[Algebra R S]
[Algebra.FormallyUnramified R S]
[Algebra.EssFiniteType R S]
(s : S)

(1 ⊗ₜ[R] s - s ⊗ₜ[R] 1) * Algebra.FormallyUnramified.elem R S = 0


lemma iSup_partitionFiltration (ht : ∀ n, MeasurableSet (t n))
    (ht_range : generateFrom (Set.range t) = m) :
    ⨆ n, partitionFiltration ht n = m

(ht_range : MeasurableSpace.generateFrom (Set.range t) = m)

⨆ n, ↑(ProbabilityTheory.partitionFiltration ht) n = m


(h :
  ((∀ (k : ℤ), x ≠ (2 * ↑k + 1) * ↑Real.pi / 2) ∧ ∀ (l : ℤ), y * Complex.I ≠ (2 * ↑l + 1) * ↑Real.pi / 2) ∨
    (∃ k, x = (2 * ↑k + 1) * ↑Real.pi / 2) ∧ ∃ l, y * Complex.I = (2 * ↑l + 1) * ↑Real.pi / 2)

Complex.tan (x + y * Complex.I) =
  (Complex.tan x + Complex.tanh y * Complex.I) / (1 - Complex.tan x * Complex.tanh y * Complex.I)


lemma evalEval_polynomialY (x y : R) :
    W.polynomialY.evalEval x y = 2 * y + W.a₁ * x + W.a₃

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

Polynomial.evalEval x y W.polynomialY = 2 * y + W.a₁ * x + W.a₃


@[simp] lemma grade_eq (m : Multiset α) : grade ℕ m = card m


@[simp]
theorem transpose_eq_intCast [DecidableEq n] [AddGroupWithOne α]
    {M : Matrix n n α} {d : ℤ} :
    Mᵀ = d ↔ M = d

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[AddGroupWithOne α]
{M : Matrix n n α}
{d : ℤ}


/-- If `i : K →+* L` is a ring homomorphism of characteristic `p` rings, then it is called
`p`-radical if the following conditions are satisfied:

- For any element `x` of `L` there is `n : ℕ` such that `x ^ (p ^ n)` is contained in `K`.
- The kernel of `i` is contained in the `p`-nilradical of `K`.

It is a generalization of purely inseparable extension for fields. -/
@[mk_iff]
class IsPRadical : Prop where
  pow_mem' : ∀ x : L, ∃ (n : ℕ) (y : K), i y = x ^ p ^ n
  ker_le' : RingHom.ker i ≤ pNilradical K p

{K : Type u_1}
{L : Type u_2}
[CommSemiring K]
[CommSemiring L]
{i : K →+* L}
{p : ℕ}
[self : IsPRadical i p]
(x : L)


theorem coe_eq_inv_of_sq_eq_one (hφ : FixedPointFree φ) (h2 : φ^[2] = _root_.id) : ⇑φ = (·⁻¹)

{G : Type u_1}
[Group G]
{φ : G →* G}
[Finite G]
(hφ : MonoidHom.FixedPointFree ⇑φ)
(h2 : (⇑φ)^[2] = id)


theorem le_sSup_iff : a ≤ sSup s ↔ ∀ b ∈ upperBounds s, a ≤ b

{α : Type u_1}
[CompleteSemilatticeSup α]
{s : Set α}
{a : α}


/-- Multiplying by all the matrices in `listTransvecRow M` does not change the last column. -/
theorem mul_listTransvecRow_last_col (i : Fin r ⊕ Unit) :
    (M * (listTransvecRow M).prod) i (inr unit) = M i (inr unit)

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

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


/-- Auxiliary theorem used to prove `toBaseChange_reverse` without needing induction. -/
theorem toBaseChange_comp_reverseOp (Q : QuadraticForm R V) :
    (toBaseChange A Q).op.comp reverseOp =
      ((Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q)).toAlgHom.comp <|
        (Algebra.TensorProduct.map
          (AlgEquiv.toOpposite A A).toAlgHom (reverseOp (Q := Q))).comp
        (toBaseChange A Q))

{R : Type u_1}
(A : Type u_2)
{V : Type u_3}
[CommRing R]
[CommRing A]
[AddCommGroup V]
[Algebra R A]
[Module R V]
[Invertible 2]
(Q : QuadraticForm R V)

(AlgHom.op (CliffordAlgebra.toBaseChange A Q)).comp CliffordAlgebra.reverseOp =
  (↑(Algebra.TensorProduct.opAlgEquiv R A A (CliffordAlgebra Q))).comp
    ((Algebra.TensorProduct.map (↑(AlgEquiv.toOpposite A A)) CliffordAlgebra.reverseOp).comp
      (CliffordAlgebra.toBaseChange A Q))


theorem reverse_comp_involute :
    reverse.comp involute.toLinearMap =
      (involute.toLinearMap.comp reverse : _ →ₗ[R] CliffordAlgebra Q)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}

CliffordAlgebra.reverse ∘ₗ CliffordAlgebra.involute.toLinearMap =
  CliffordAlgebra.involute.toLinearMap ∘ₗ CliffordAlgebra.reverse


theorem aeval_unique (φ : MvPolynomial σ R →ₐ[R] S₁) : φ = aeval (φ ∘ X)

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[Algebra R S₁]
(φ : MvPolynomial σ R →ₐ[R] S₁)

φ = MvPolynomial.aeval (⇑φ ∘ MvPolynomial.X)


theorem denseRange_pureCauchy : DenseRange (pureCauchy : α → CauchyFilter α)


@[to_additive (attr := simp)]
theorem one_lt_mul_self_iff : 1 < a * a ↔ 1 < a

{α : Type u_1}
[LinearOrderedCommMonoid α]
{a : α}


@[to_additive]
lemma prod_mulIndicator_eq_prod_filter (s : Finset ι) (f : ι → κ → β) (t : ι → Set κ) (g : ι → κ)
    [DecidablePred fun i ↦ g i ∈ t i] :
    ∏ i ∈ s, mulIndicator (t i) (f i) (g i) = ∏ i ∈ s.filter fun i ↦ g i ∈ t i, f i (g i)

{ι : Type u_1}
{β : Type u_4}
[CommMonoid β]
{κ : Type u_6}
(s : Finset ι)
(f : ι → κ → β)
(t : ι → Set κ)
(g : ι → κ)
[DecidablePred fun i => g i ∈ t i]

∏ i ∈ s, (t i).mulIndicator (f i) (g i) = ∏ i ∈ Finset.filter (fun i => g i ∈ t i) s, f i (g i)


/-- The identity in the "underlying" category of an enriched category. -/
@[simp]
theorem forgetEnrichment_id (X : ForgetEnrichment W C) :
    ForgetEnrichment.homTo W (𝟙 X) = eId W (ForgetEnrichment.to W X : C)

(X : CategoryTheory.ForgetEnrichment W C)

CategoryTheory.ForgetEnrichment.homTo W (CategoryTheory.CategoryStruct.id X) =
  CategoryTheory.eId W (CategoryTheory.ForgetEnrichment.to W X)


@[simp]
theorem iInter_coe_set {α β : Type*} (s : Set α) (f : s → Set β) :
    ⋂ i, f i = ⋂ i ∈ s, f ⟨i, ‹i ∈ s›⟩

{α : Type u_11}
{β : Type u_12}
(s : Set α)
(f : ↑s → Set β)


/-- The Yoneda embedding for preadditive categories sends an object `Y` to the presheaf sending an
object `X` to the group of morphisms `X ⟶ Y`. At each point, we get an additional `End Y`-module
structure, see `preadditiveYonedaObj`.
-/
@[simps]
def preadditiveYoneda : C ⥤ Cᵒᵖ ⥤ AddCommGrp.{v}

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

∀ {X Y : C} (f : X ⟶ Y) (X_1 : Cᵒᵖ)
  (g :
    ↑(((fun Y =>
              (CategoryTheory.preadditiveYonedaObj Y).comp
                (CategoryTheory.forget₂ (ModuleCat (CategoryTheory.End Y)) AddCommGrp))
            X).obj
        X_1)),
  ((CategoryTheory.preadditiveYoneda.map f).app X_1) g = CategoryTheory.CategoryStruct.comp g f


theorem l_comm_of_u_comm {X : Type*} [Preorder X] {Y : Type*} [Preorder Y] {Z : Type*}
    [Preorder Z] {W : Type*} [PartialOrder W] {lYX : X → Y} {uXY : Y → X}
    (hXY : GaloisConnection lYX uXY) {lWZ : Z → W} {uZW : W → Z} (hZW : GaloisConnection lWZ uZW)
    {lWY : Y → W} {uYW : W → Y} (hWY : GaloisConnection lWY uYW) {lZX : X → Z} {uXZ : Z → X}
    (hXZ : GaloisConnection lZX uXZ) (h : ∀ w, uXZ (uZW w) = uXY (uYW w)) {x : X} :
    lWZ (lZX x) = lWY (lYX x)

(h : ∀ (w : W), uXZ (uZW w) = uXY (uYW w))


/-- There is an equivalence between the set of edges incident to a given
vertex and the set of vertices adjacent to the vertex. -/
@[simps]
def incidenceSetEquivNeighborSet (v : V) : G.incidenceSet v ≃ G.neighborSet v

{V : Type u}
(G : SimpleGraph V)
[DecidableEq V]
(v : V)
(e : ↑(G.incidenceSet v))

↑((G.incidenceSetEquivNeighborSet v) e) = G.otherVertexOfIncident ⋯


theorem forall_lt_iff_le' [LinearOrder α] {a b : α} : (∀ ⦃c⦄, a < c → b < c) ↔ b ≤ a

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


@[to_additive (attr := simp)]
theorem inv_comp [Inv γ] [ContinuousInv γ] (f : C(β, γ)) (g : C(α, β)) :
    f⁻¹.comp g = (f.comp g)⁻¹

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[Inv γ]
[ContinuousInv γ]
(f : C(β, γ))
(g : C(α, β))


lemma sq_ne_one_iff : a ^ 2 ≠ 1 ↔ a ≠ 1 ∧ a ≠ -1

{R : Type x}
[Ring R]
{a : R}
[NoZeroDivisors R]


@[simp] theorem forall_const (α : Sort _) [i : Nonempty α] : (α → b) ↔ b

{b : Prop}
(α : Sort u_1)
[i : Nonempty α]


@[simp]
theorem center_toSubring (R A : Type*) [CommRing R] [Ring A] [Algebra R A] :
    (center R A).toSubring = Subring.center A

(R : Type u_1)
(A : Type u_2)
[CommRing R]
[Ring A]
[Algebra R A]

(Subalgebra.center R A).toSubring = Subring.center A


protected theorem le_of_not_ge : ∀{a b : Nat}, ¬(a ≥ b) → a ≤ b

¬a ≥ b → a ≤ b


/-- The morphism `C⁺ : Spec R[x] → Spec R` is open.
Stacks Project "Lemma 00FB", first part.

https://stacks.math.columbia.edu/tag/00FB
-/
theorem isOpenMap_comap_C : IsOpenMap (PrimeSpectrum.comap (C : R →+* R[X]))


theorem map_mod [Field k] (f : R →+* k) : (p % q).map f = p.map f % q.map f

{R : Type u}
{k : Type y}
[Field R]
{p q : R[X]}
[Field k]
(f : R →+* k)

Polynomial.map f (p % q) = Polynomial.map f p % Polynomial.map f q


/-- Pointwise, the multiplicative indicators of δ-thickenings of a set eventually coincide
with the multiplicative indicator of the set as δ>0 tends to zero. -/
@[to_additive "Pointwise, the indicators of δ-thickenings of a set eventually coincide
with the indicator of the set as δ>0 tends to zero."]
lemma mulIndicator_thickening_eventually_eq_mulIndicator_closure (f : α → β) (E : Set α) (x : α) :
    ∀ᶠ δ in 𝓝[>] (0 : ℝ),
      (Metric.thickening δ E).mulIndicator f x = (closure E).mulIndicator f x

{α : Type u_1}
[PseudoEMetricSpace α]
{β : Type u_2}
[Zero β]
(f : α → β)
(E : Set α)
(x : α)

∀ᶠ (δ : ℝ) in 𝓝[>] 0, (Metric.thickening δ E).indicator f x = (closure E).indicator f x


@[mfld_simps] theorem mem_range_self (i : ι) : f i ∈ range f

{α : Type u}
{ι : Sort u_1}
{f : ι → α}
(i : ι)


@[simp]
theorem theory_model_iff (S : L.ElementarySubstructure M) (T : L.Theory) : S ⊨ T ↔ M ⊨ T

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
(S : L.ElementarySubstructure M)
(T : L.Theory)

↥S ⊨ T ↔ M ⊨ T


theorem disjoint_cobounded_nhdsSet {s : Set α} (hs : IsCompact s) : Disjoint (cobounded α) (𝓝ˢ s)

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


/-- The braiding isomorphism which swaps a binary product. -/
@[simps]
def prod.braiding (P Q : C) [HasBinaryProduct P Q] [HasBinaryProduct Q P] : P ⨯ Q ≅ Q ⨯ P

(CategoryTheory.Limits.prod.braiding P Q).hom =
  CategoryTheory.Limits.prod.lift CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst


theorem ContDiff.cexp {n} (h : ContDiff 𝕜 n f) : ContDiff 𝕜 n fun x => Complex.exp (f x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[NormedAlgebra 𝕜 ℂ]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : E → ℂ}
{n : ℕ∞}
(h : ContDiff 𝕜 n f)


/-- (Impl) This new cone is used to construct the algebra structure -/
@[simps! π_app]
def newCone : Cone (D ⋙ forget T)

(D : CategoryTheory.Functor J T.Algebra)

(c : CategoryTheory.Limits.Cone (D.comp T.forget))

(CategoryTheory.Monad.ForgetCreatesLimits.newCone D c).π.app X =
  CategoryTheory.CategoryStruct.comp (T.map (c.π.app X)) (D.obj X).a


theorem StructureGroupoid.le_iff {G₁ G₂ : StructureGroupoid H} : G₁ ≤ G₂ ↔ ∀ e, e ∈ G₁ → e ∈ G₂

{H : Type u}
[TopologicalSpace H]
{G₁ G₂ : StructureGroupoid H}

G₁ ≤ G₂ ↔ ∀ e ∈ G₁, e ∈ G₂


theorem integral_Iic_eq_integral_Iio : ∫ t in Iic x, f t ∂μ = ∫ t in Iio x, f t ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{μ : MeasureTheory.Measure X}
[PartialOrder X]
{x : X}
[MeasureTheory.NoAtoms μ]

∫ (t : X) in Set.Iic x, f t ∂μ = ∫ (t : X) in Set.Iio x, f t ∂μ


@[simp]
theorem one_symm : (1 : Perm α).symm = 1


theorem HasBasis.liminf_eq_iSup_iInf {p : ι → Prop} {s : ι → Set β} {f : Filter β} {u : β → α}
    (h : f.HasBasis p s) : liminf u f = ⨆ (i) (_ : p i), ⨅ a ∈ s i, u a

{α : Type u_1}
{β : Type u_2}
{ι : Type u_4}
[CompleteLattice α]
{p : ι → Prop}
{s : ι → Set β}
{f : Filter β}
{u : β → α}
(h : f.HasBasis p s)

Filter.liminf u f = ⨆ i, ⨆ (_ : p i), ⨅ a ∈ s i, u a


/-- Variant of `mul_le_of_le_one_left` for `b` non-positive instead of non-negative.  -/
theorem le_mul_of_le_one_left [ExistsAddOfLE α] [MulPosMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (hb : b ≤ 0) (h : a ≤ 1) : b ≤ a * b

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

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


theorem ghostComponent_apply (n : ℕ) (x : 𝕎 R) : ghostComponent n x = aeval x.coeff (W_ ℤ n)

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

(WittVector.ghostComponent n) x = (MvPolynomial.aeval x.coeff) (W_ ℤ n)


lemma le_add_pred_of_pos (a : ℕ) (hb : b ≠ 0) : a ≤ b + (a - 1)


theorem eventuallyConst_pred {p : α → Prop} :
    EventuallyConst p l ↔ (∀ᶠ x in l, p x) ∨ (∀ᶠ x in l, ¬p x)

{α : Type u_1}
{l : Filter α}
{p : α → Prop}

Filter.EventuallyConst p l ↔ (∀ᶠ (x : α) in l, p x) ∨ ∀ᶠ (x : α) in l, ¬p x


/-- The reduction formula for the integral of `sin x ^ n` for any natural `n ≥ 2`. -/
theorem integral_sin_pow :
    (∫ x in a..b, sin x ^ (n + 2)) =
      (sin a ^ (n + 1) * cos a - sin b ^ (n + 1) * cos b) / (n + 2) +
        (n + 1) / (n + 2) * ∫ x in a..b, sin x ^ n

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


protected theorem map [OpensMeasurableSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] (f : α ≃ₜ β) (μ : Measure α) [OuterRegular μ] :
    (Measure.map f μ).OuterRegular

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[TopologicalSpace α]
[OpensMeasurableSpace α]
[MeasurableSpace β]
[TopologicalSpace β]
[BorelSpace β]
(f : α ≃ₜ β)
(μ : MeasureTheory.Measure α)
[μ.OuterRegular]


lemma cardinal_mk_closure [Infinite s] : #(closure s) = #s

{α : Type u}
(s : Set α)
[DivisionRing α]
[Infinite ↑s]

Cardinal.mk ↥(Subfield.closure s) = Cardinal.mk ↑s


theorem span_eq_iSup_of_singleton_spans (s : Set M) : span R s = ⨆ x ∈ s, R ∙ x

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(s : Set M)

Submodule.span R s = ⨆ x ∈ s, Submodule.span R {x}


/-- A separating family of seminorms induces a T₁ topology. -/
theorem WithSeminorms.T1_of_separating (hp : WithSeminorms p)
    (h : ∀ x, x ≠ 0 → ∃ i, p i x ≠ 0) : T1Space E

(h : ∀ (x : E), x ≠ 0 → ∃ i, (p i) x ≠ 0)


@[simp]
lemma LinearEquiv.extendScalarsOfSurjective_apply (f : M ≃ₗ[R] N) (x) :
    f.extendScalarsOfSurjective h x = f x

(h : Function.Surjective ⇑(algebraMap R S))

(LinearEquiv.extendScalarsOfSurjective h f) x = f x


/-- Given `w : TwoSquare T L R B` and a morphism `g : R.obj X₂ ⟶ B.obj X₃`, this is
the obvious equivalence of categories
`w.StructuredArrowRightwards g ≌ w.CostructuredArrowDownwards g`. -/
@[simps functor inverse unitIso counitIso]
def equivalenceJ : w.StructuredArrowRightwards g ≌ w.CostructuredArrowDownwards g

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

(w.equivalenceJ g).unitIso = CategoryTheory.Iso.refl (CategoryTheory.Functor.id (w.StructuredArrowRightwards g))


@[to_additive (attr := simp)] theorem swap_comp_inr : (swap M N).comp inr = inl

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

(Monoid.Coprod.swap M N).comp Monoid.Coprod.inr = Monoid.Coprod.inl


theorem snd_map_prod_mk₀ {X : α → β} {Y : α → γ} {μ : Measure α} (hX : AEMeasurable X μ) :
    (μ.map fun a => (X a, Y a)).snd = μ.map Y

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[MeasurableSpace α]
[MeasurableSpace β]
[MeasurableSpace γ]
{X : α → β}
{Y : α → γ}
{μ : MeasureTheory.Measure α}
(hX : AEMeasurable X μ)

(MeasureTheory.Measure.map (fun a => (X a, Y a)) μ).snd = MeasureTheory.Measure.map Y μ


/-- In a sequential space, a set is closed iff it's sequentially closed. -/
theorem isSeqClosed_iff_isClosed [SequentialSpace X] {M : Set X} : IsSeqClosed M ↔ IsClosed M

{X : Type u_1}
[TopologicalSpace X]
[SequentialSpace X]
{M : Set X}


theorem insert_ne_self : insert a s ≠ s ↔ a ∉ s

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


/-- An isometry from an emetric space is a uniform embedding -/
protected theorem uniformEmbedding (hf : Isometry f) : UniformEmbedding f

{α : Type u}
{β : Type v}
[EMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
(hf : Isometry f)


theorem ofDigits_zmod (b : ℤ) (k : ℕ) (L : List ℕ) : ofDigits b L % k = ofDigits (b % k) L % k

Nat.ofDigits b L % ↑k = Nat.ofDigits (b % ↑k) L % ↑k


theorem RightInverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β} (hf : RightInverse f g)
    (hh : RightInverse h i) : RightInverse (h ∘ f) (g ∘ i)

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
{g : β → α}
{h : β → γ}
{i : γ → β}
(hf : Function.RightInverse f g)
(hh : Function.RightInverse h i)


theorem trivialization.coordChangeL (b : B) :
    (trivialization B F).coordChangeL 𝕜 (trivialization B F) b =
      ContinuousLinearEquiv.refl 𝕜 F

{𝕜 : Type u_1}
(B : Type u_2)
(F : Type u_3)
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[TopologicalSpace B]
(b : B)

Trivialization.coordChangeL 𝕜 (Bundle.Trivial.trivialization B F) (Bundle.Trivial.trivialization B F) b =
  ContinuousLinearEquiv.refl 𝕜 F


@[to_additive]
theorem map_equiv_eq_comap_symm (f : G ≃* N) (K : Subgroup G) :
    K.map f = K.comap (G := N) f.symm

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(f : G ≃+ N)
(K : AddSubgroup G)

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


theorem getLsb_rev (x : BitVec w) (i : Fin w) :
    x.getLsb i.rev = x.getMsb i


lemma FullSubcategory.comp_def {X Y Z : FullSubcategory Z} (f : X ⟶ Y) (g : Y ⟶ Z) :
    f ≫ g = (f ≫ g : X.obj ⟶ Z.obj)

{X Y : CategoryTheory.FullSubcategory Z}

∀ {Z_1 : CategoryTheory.FullSubcategory Z} (f : X ⟶ Y) (g : Y ⟶ Z_1),
  CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.comp f g


@[reassoc, simp]
theorem leftUnitor_inv_whiskerRight (f : a ⟶ b) (g : b ⟶ c) :
    (λ_ f).inv ▷ g = (λ_ (f ≫ g)).inv ≫ (α_ (𝟙 a) f g).inv

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c : B}
(f : a ⟶ b)
(g : b ⟶ c)

CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.leftUnitor f).inv g =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.leftUnitor (CategoryTheory.CategoryStruct.comp f g)).inv
    (CategoryTheory.Bicategory.associator (CategoryTheory.CategoryStruct.id a) f g).inv


@[to_additive]
theorem map_le_of_le_comap {T : Submonoid N} {f : F} : S ≤ T.comap f → S.map f ≤ T

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(S : Submonoid M)
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{T : Submonoid N}
{f : F}

S ≤ Submonoid.comap f T → Submonoid.map f S ≤ T


@[to_additive Set.AddAntidiagonal.eq_of_snd_eq_snd]
theorem eq_of_snd_eq_snd (h : (x : α × α).snd = (y : α × α).snd) : x = y

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


@[to_additive]
theorem continuousOn_inv {s : Set G} : ContinuousOn Inv.inv s

{G : Type w}
[TopologicalSpace G]
[Inv G]
[ContinuousInv G]
{s : Set G}


@[simp] theorem or_iff_right_iff_imp : ∀(a b : Bool), ((a || b) = b) ↔ (a → b)


@[simp]
theorem range_sin : range sin = (Icc (-1) 1 : Set ℝ)


/-- The function `expNegInvGlue` is positive on `(0, +∞)`. -/
theorem pos_of_pos {x : ℝ} (hx : 0 < x) : 0 < expNegInvGlue x


@[simp, mfld_simps]
theorem pi_refl : (PartialEquiv.pi fun i ↦ PartialEquiv.refl (αi i)) = .refl (∀ i, αi i)

(PartialEquiv.pi fun i => PartialEquiv.refl (αi i)) = PartialEquiv.refl ((i : ι) → αi i)


theorem principalUnitGroup_symm_apply (a : (Units.map (LocalRing.residue A).toMonoidHom).ker) :
    ((A.principalUnitGroupEquiv.symm a : Kˣ) : K) = ((a : Aˣ) : A)

(a : ↥(Units.map ↑(LocalRing.residue ↥A)).ker)

↑↑(A.principalUnitGroupEquiv.symm a) = ↑↑↑a


theorem smul_set_univ₀ (ha : a ≠ 0) : a • (univ : Set β) = univ

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


theorem StrictAnti.apply_eq_top_iff (hf : StrictAnti f) : f a = f ⊤ ↔ a = ⊤

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


/-- `Matrix.diag` as a `LinearMap`. -/
@[simps]
def diagLinearMap [Semiring R] [AddCommMonoid α] [Module R α] : Matrix n n α →ₗ[R] n → α

(n : Type u_3)
(R : Type u_7)
(α : Type v)
[Semiring R]
[AddCommMonoid α]
[Module R α]

∀ (a : Matrix n n α) (a_1 : n), (Matrix.diagLinearMap n R α) a a_1 = (↑(Matrix.diagAddMonoidHom n α)).toFun a a_1


/-- This is an internal lemma used inside the default of `PseudoMetricSpace.edist`. -/
private theorem dist_nonneg' {α} {x y : α} (dist : α → α → ℝ)
    (dist_self : ∀ x : α, dist x x = 0) (dist_comm : ∀ x y : α, dist x y = dist y x)
    (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) : 0 ≤ dist x y

(dist_comm : ∀ (x y : α), dist x y = dist y x)

(dist_triangle : ∀ (x y z : α), dist x z ≤ dist x y + dist y z)


@[simp]
theorem vsub_pure : f -ᵥ pure b = f.map (· -ᵥ b)

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

f -ᵥ pure b = Filter.map (fun x => x -ᵥ b) f


theorem nmul_add_one : ∀ a b, a ⨳ (b + 1) = a ⨳ b ♯ a


theorem eq_aleph'_of_eq_card_ord {o : Ordinal} (ho : o.card.ord = o) : ∃ a, (aleph' a).ord = o

{o : Ordinal.{u_1}}
(ho : o.card.ord = o)


theorem preimage_ceil_of_ne_zero (hn : n ≠ 0) : (Nat.ceil : α → ℕ) ⁻¹' {n} = Ioc (↑(n - 1) : α) n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{n : ℕ}
(hn : n ≠ 0)


theorem frequently_nhds_iff {p : X → Prop} :
    (∃ᶠ y in 𝓝 x, p y) ↔ ∀ U : Set X, x ∈ U → IsOpen U → ∃ y ∈ U, p y

{X : Type u}
{x : X}
[TopologicalSpace X]
{p : X → Prop}

(∃ᶠ (y : X) in 𝓝 x, p y) ↔ ∀ (U : Set X), x ∈ U → IsOpen U → ∃ y ∈ U, p y


@[to_additive]
lemma prod_fiberwise_of_maps_to' {g : ι → κ} (h : ∀ i ∈ s, g i ∈ t) (f : κ → α) :
    ∏ j ∈ t, ∏ _i ∈ s.filter fun i ↦ g i = j, f j = ∏ i ∈ s, f (g i)

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[AddCommMonoid α]
{s : Finset ι}
{t : Finset κ}
[DecidableEq κ]
{g : ι → κ}
(h : ∀ i ∈ s, g i ∈ t)
(f : κ → α)

∑ j ∈ t, ∑ _i ∈ Finset.filter (fun i => g i = j) s, f j = ∑ i ∈ s, f (g i)


@[simp]
theorem functorPullback_id (R : Presieve X) : R.functorPullback (𝟭 _) = R

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

CategoryTheory.Presieve.functorPullback (CategoryTheory.Functor.id C) R = R


theorem mul_leftUnitor {M : Mon_ C} :
    (tensor_μ C (𝟙_ C, M.X) (𝟙_ C, M.X) ≫ ((λ_ (𝟙_ C)).hom ⊗ M.mul)) ≫ (λ_ M.X).hom =
      ((λ_ M.X).hom ⊗ (λ_ M.X).hom) ≫ M.mul

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
{M : Mon_ C}

(CategoryTheory.tensor_μ C (𝟙_ C, M.X) (𝟙_ C, M.X) ≫ ((λ_ (𝟙_ C)).hom ⊗ M.mul)) ≫ (λ_ M.X).hom =
  ((λ_ M.X).hom ⊗ (λ_ M.X).hom) ≫ M.mul


/-- The constant `C` provided by the definition of `LiouvilleWith` can be made positive.
We also add `1 ≤ n` to the list of assumptions about the denominator. While it is equivalent to
the original statement, the case `n = 0` breaks many arguments. -/
theorem exists_pos (h : LiouvilleWith p x) :
    ∃ (C : ℝ) (_h₀ : 0 < C),
      ∃ᶠ n : ℕ in atTop, 1 ≤ n ∧ ∃ m : ℤ, x ≠ m / n ∧ |x - m / n| < C / n ^ p

∃ C, ∃ (_ : 0 < C), ∃ᶠ (n : ℕ) in Filter.atTop, 1 ≤ n ∧ ∃ m, x ≠ ↑m / ↑n ∧ |x - ↑m / ↑n| < C / ↑n ^ p


/-- **Integration by parts**. Special case of
`intervalIntegrable.integral_mul_deriv_eq_deriv_mul_of_hasDeriv_right`
where the functions have a one-sided derivative at the endpoints. -/
theorem integral_mul_deriv_eq_deriv_mul_of_hasDerivWithinAt {u v u' v' : ℝ → A}
    (hu : ∀ x ∈ [[a, b]], HasDerivWithinAt u (u' x) [[a, b]] x)
    (hv : ∀ x ∈ [[a, b]], HasDerivWithinAt v (v' x) [[a, b]] x)
    (hu' : IntervalIntegrable u' volume a b)
    (hv' : IntervalIntegrable v' volume a b) :
    ∫ x in a..b, u x * v' x = u b * v b - u a * v a - ∫ x in a..b, u' x * v x

(hu' : IntervalIntegrable u' MeasureTheory.volume a b)

(hv' : IntervalIntegrable v' MeasureTheory.volume a b)

∫ (x : ℝ) in a..b, u x * v' x = u b * v b - u a * v a - ∫ (x : ℝ) in a..b, u' x * v x


/-- For functions to `ℝ`, it suffices to prove `f x ≤ f y + K * dist x y`; this version
doesn't assume `0≤K`. -/
protected theorem of_le_add_mul' {f : α → ℝ} (K : ℝ)
    (h : ∀ x ∈ s, ∀ y ∈ s, f x ≤ f y + K * dist x y) : LipschitzOnWith (Real.toNNReal K) f s


@[simp]
lemma quotientEquiv_mk (p : P.Ring) : P.quotientEquiv p = algebraMap P.Ring S p

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(P : Algebra.Presentation R S)
(p : P.Ring)

P.quotientEquiv ((Ideal.Quotient.mk P.ker) p) = (algebraMap P.Ring S) p


@[to_additive]
theorem mulIndicator_preimage (s : Set α) (f : α → M) (B : Set M) :
    mulIndicator s f ⁻¹' B = s.ite (f ⁻¹' B) (1 ⁻¹' B)

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

s.mulIndicator f ⁻¹' B = s.ite (f ⁻¹' B) (1 ⁻¹' B)


theorem not_isBoundedUnder_of_tendsto_atTop [Preorder β] [NoMaxOrder β] {f : α → β} {l : Filter α}
    [l.NeBot] (hf : Tendsto f l atTop) : ¬IsBoundedUnder (· ≤ ·) l f

{α : Type u_1}
{β : Type u_2}
[Preorder β]
[NoMaxOrder β]
{f : α → β}
{l : Filter α}
[l.NeBot]
(hf : Filter.Tendsto f l Filter.atTop)

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


/-- The inverse of a homotopy equivalence. -/
@[simps]
def symm (e : HomotopyEquiv S₁ S₂) : HomotopyEquiv S₂ S₁

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


@[simp]
theorem modByMonicHom_mk (hg : g.Monic) (f : R[X]) : modByMonicHom hg (mk g f) = f %ₘ g

{R : Type u}
[CommRing R]
{g : R[X]}
(hg : g.Monic)
(f : R[X])

(AdjoinRoot.modByMonicHom hg) ((AdjoinRoot.mk g) f) = f %ₘ g


theorem upperBounds_Ico {a b : γ} (hab : a < b) : upperBounds (Ico a b) = Ici b

{γ : Type w}
[SemilatticeInf γ]
[DenselyOrdered γ]
{a b : γ}
(hab : a < b)


/-- If all elements of a `Finset` satisfy the predicate `p`, a product
over `s.subtype p` equals that product over `s`. -/
@[to_additive "If all elements of a `Finset` satisfy the predicate `p`, a sum
over `s.subtype p` equals that sum over `s`."]
theorem prod_subtype_of_mem (f : α → β) {p : α → Prop} [DecidablePred p] (h : ∀ x ∈ s, p x) :
    ∏ x ∈ s.subtype p, f x = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
[AddCommMonoid β]
(f : α → β)
{p : α → Prop}
[DecidablePred p]
(h : ∀ x ∈ s, p x)

∑ x ∈ Finset.subtype p s, f ↑x = ∑ x ∈ s, f x


@[to_additive]
theorem smul_iUnion (s : Set α) (t : ι → Set β) : (s • ⋃ i, t i) = ⋃ i, s • t i

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


theorem csSup_eq_univ_of_not_bddAbove {s : Set α} (hs : ¬BddAbove s) : sSup s = sSup univ

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


theorem Base.compl_base_dual (h : M.Base B) : M✶.Base (M.E \ B)

{α : Type u_1}
{M : Matroid α}
{B : Set α}
(h : M.Base B)


@[norm_cast]
theorem coe_pow (e : X ≃ᵈ X) (n : ℕ) : ⇑(e ^ n) = e^[n]

{X : Type u_1}
[PseudoEMetricSpace X]
(e : X ≃ᵈ X)
(n : ℕ)


@[to_additive (attr := simp, norm_cast)]
theorem coe_toOpens : ((U : Opens G) : Set G) = U

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
{U : OpenAddSubgroup G}


theorem tendsto_arctan_atTop : Tendsto arctan atTop (𝓝[<] (π / 2))

Filter.Tendsto Real.arctan Filter.atTop (nhdsWithin (Real.pi / 2) (Set.Iio (Real.pi / 2)))


theorem of_horiz_isIso [IsIso fst] [IsIso g] (sq : CommSq fst snd f g) : IsPullback fst snd f g

(sq : CategoryTheory.CommSq fst snd f g)


theorem prime_iff {p : ℕ} : p.Prime ↔ _root_.Prime p


theorem map_sup (s t : Subfield K) (f : K →+* L) : (s ⊔ t).map f = s.map f ⊔ t.map f

{K : Type u}
{L : Type v}
[DivisionRing K]
[DivisionRing L]
(s t : Subfield K)
(f : K →+* L)

Subfield.map f (s ⊔ t) = Subfield.map f s ⊔ Subfield.map f t


theorem bliminf_antitone (h : ∀ x, p x → q x) : bliminf u f q ≤ bliminf u f p

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{p q : β → Prop}
{u : β → α}
(h : ∀ (x : β), p x → q x)

Filter.bliminf u f q ≤ Filter.bliminf u f p


@[simp]
theorem pellZd_re (n : ℕ) : (pellZd a1 n).re = xn a1 n


@[simp] lemma sqrt_eq_one : sqrt x = 1 ↔ x = 1


theorem HasFDerivAt.ccos (hf : HasFDerivAt f f' x) :
    HasFDerivAt (fun x => Complex.cos (f x)) (-Complex.sin (f x) • f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{f' : E →L[ℂ] ℂ}
{x : E}
(hf : HasFDerivAt f f' x)


@[simp] theorem foldrM_push' [Monad m] (f : α → β → m β) (init : β) (arr : Array α) (a : α) :
    (arr.push a).foldrM f init (start := arr.size + 1) = f a init >>= arr.foldrM f

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(f : α → β → m β)
(init : β)
(arr : Array α)
(a : α)

Array.foldrM f init (arr.push a) (arr.size + 1) = do
  let init ← f a init
  Array.foldrM f init arr arr.size


theorem aleph0_mul_mk_eq {α : Type*} [Infinite α] : ℵ₀ * #α = #α

ℵ₀ * #α = #α


theorem dvd_lcm_left {a b : Int} : a ∣ lcm a b


protected theorem left_distrib (x y z : R[S⁻¹]) : x * (y + z) = x * y + x * z

{R : Type u_1}
[Semiring R]
{S : Submonoid R}
[OreLocalization.OreSet S]
(x y z : OreLocalization S R)


@[simp]
theorem smeval_monomial (n : ℕ) :
    (monomial n r).smeval x = r • x ^ n

{R : Type u_1}
[Semiring R]
(r : R)
{S : Type u_2}
[AddCommMonoid S]
[Pow S ℕ]
[MulActionWithZero R S]
(x : S)
(n : ℕ)

((Polynomial.monomial n) r).smeval x = r • x ^ n


/-- The canonical isomorphism `G/(ker φ) ≃* H` induced by a homomorphism `φ : G →* H`
with a right inverse `ψ : H → G`. -/
@[to_additive (attr := simps) "The canonical isomorphism `G/(ker φ) ≃+ H` induced by a homomorphism
`φ : G →+ H` with a right inverse `ψ : H → G`."]
def quotientKerEquivOfRightInverse (ψ : H → G) (hφ : RightInverse ψ φ) : G ⧸ ker φ ≃* H

{G : Type u}
[Group G]
{H : Type v}
[Group H]
(φ : G →* H)
(ψ : H → G)
(hφ : Function.RightInverse ψ ⇑φ)

∀ (a : H), (QuotientGroup.quotientKerEquivOfRightInverse φ ψ hφ).symm a = (QuotientGroup.mk ∘ ψ) a


/-- The identity morphism in the Grothendieck category.
-/
@[simps]
def id (X : Grothendieck F) : Hom X X

{F : CategoryTheory.Functor C CategoryTheory.Cat}

X.id.base = CategoryTheory.CategoryStruct.id X.base


theorem cosh_mul_I : cosh (x * I) = cos x

Complex.cosh (x * Complex.I) = Complex.cos x


theorem alternatization_coe (m : MultilinearMap R (fun _ : ι => M) N') :
    ↑(alternatization m) = (∑ σ : Perm ι, Equiv.Perm.sign σ • m.domDomCongr σ : _)

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N' : Type u_6}
[AddCommGroup N']
[Module R N']
{ι : Type u_7}
[Fintype ι]
[DecidableEq ι]
(m : MultilinearMap R (fun x => M) N')

↑(MultilinearMap.alternatization m) = ∑ σ : Equiv.Perm ι, Equiv.Perm.sign σ • MultilinearMap.domDomCongr σ m


@[to_additive]
theorem map_mul [Mul β] [Mul γ] {g : β → γ} (hg : ∀ x y, g (x * y) = g x * g y) (f₁ f₂ : α →ₛ β) :
    (f₁ * f₂).map g = f₁.map g * f₂.map g

(hg : ∀ (x y : β), g (x * y) = g x * g y)

MeasureTheory.SimpleFunc.map g (f₁ * f₂) = MeasureTheory.SimpleFunc.map g f₁ * MeasureTheory.SimpleFunc.map g f₂


theorem IsConnected.union {s t : Set α} (H : (s ∩ t).Nonempty) (Hs : IsConnected s)
    (Ht : IsConnected t) : IsConnected (s ∪ t)

{α : Type u}
[TopologicalSpace α]
{s t : Set α}
(H : (s ∩ t).Nonempty)
(Hs : IsConnected s)
(Ht : IsConnected t)


theorem zipWith_distrib_tail : (zipWith f l l').tail = zipWith f l.tail l'.tail

∀ {α : Type u_1} {α_1 : Type u_2} {α_2 : Type u_3} {f : α → α_1 → α_2} {l : List α} {l' : List α_1},
  (List.zipWith f l l').tail = List.zipWith f l.tail l'.tail


/-- The associativity of the composition of cochains. -/
lemma comp_assoc {n₁ n₂ n₃ n₁₂ n₂₃ n₁₂₃ : ℤ}
    (z₁ : Cochain F G n₁) (z₂ : Cochain G K n₂) (z₃ : Cochain K L n₃)
    (h₁₂ : n₁ + n₂ = n₁₂) (h₂₃ : n₂ + n₃ = n₂₃) (h₁₂₃ : n₁ + n₂ + n₃ = n₁₂₃) :
    (z₁.comp z₂ h₁₂).comp z₃ (show n₁₂ + n₃ = n₁₂₃ by rw [← h₁₂, h₁₂₃]) =
      z₁.comp (z₂.comp z₃ h₂₃) (by rw [← h₂₃, ← h₁₂₃, add_assoc])

{n₁ n₂ n₃ n₁₂ n₂₃ n₁₂₃ : ℤ}

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

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

(z₃ : CochainComplex.HomComplex.Cochain K L n₃)

(z₁.comp z₂ h₁₂).comp z₃ ⋯ = z₁.comp (z₂.comp z₃ h₂₃) ⋯


theorem dslope_of_ne (f : 𝕜 → E) (h : b ≠ a) : dslope f a b = slope f a b

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{a b : 𝕜}
(f : 𝕜 → E)
(h : b ≠ a)


theorem dimH_univ_pi (ι : Type*) [Fintype ι] : dimH (univ : Set (ι → ℝ)) = Fintype.card ι


lemma lift' (hS : S.Exact) {A : C} (k : A ⟶ S.X₂) (hk : k ≫ S.g = 0) [Mono S.f] :
    ∃ (l : A ⟶ S.X₁), l ≫ S.f = k

(hk : CategoryTheory.CategoryStruct.comp k S.g = 0)

∃ l, CategoryTheory.CategoryStruct.comp l S.f = k


@[to_additive]
protected lemma MulAction.bijective (g : α) : Function.Bijective (g • · : β → β)

{α : Type u_1}
{β : Type u_2}
[Group α]
[MulAction α β]
(g : α)


@[simp]
theorem comp_id (f : α →ₙ+* β) : f.comp (NonUnitalRingHom.id α) = f

{α : Type u_2}
{β : Type u_3}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
(f : α →ₙ+* β)


protected theorem mul_le_mul_of_nonneg_right {a b c : Int}
    (h₁ : a ≤ b) (h₂ : 0 ≤ c) : a * c ≤ b * c


@[simp]
theorem coe_zero : ⇑(0 : M ≃ₛₗ[σ₁₂] M₂) = 0

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[Subsingleton M]
[Subsingleton M₂]


@[simps]
instance Endofunctor.coalgebraPreadditive : Preadditive (Endofunctor.Coalgebra F)

(A₁ A₂ : CategoryTheory.Endofunctor.Coalgebra F)


@[to_additive]
theorem LipschitzOnWith.norm_div_le_of_le {f : E → F} {C : ℝ≥0} (h : LipschitzOnWith C f s)
    (ha : a ∈ s) (hb : b ∈ s) (hr : ‖a / b‖ ≤ r) : ‖f a / f b‖ ≤ C * r

{E : Type u_3}
{F : Type u_4}
[SeminormedGroup E]
[SeminormedGroup F]
{s : Set E}
{a b : E}
{r : ℝ}
{f : E → F}
{C : ℝ≥0}
(h : LipschitzOnWith C f s)
(ha : a ∈ s)
(hb : b ∈ s)
(hr : ‖a / b‖ ≤ r)


@[to_additive (attr := simp)]
theorem comap_id (S : Subsemigroup P) : S.comap (MulHom.id _) = S

{P : Type u_3}
[Mul P]
(S : Subsemigroup P)


theorem coe_nonneg (r : ℝ≥0) : (0 : ℝ) ≤ r


theorem IsLimit.succ_lt {x c} (h : IsLimit c) : x < c → succ x < c


theorem splitLower_ne_splitUpper (I : Box ι) (i : ι) (x : ℝ) :
    I.splitLower i x ≠ I.splitUpper i x

{ι : Type u_1}
(I : BoxIntegral.Box ι)
(i : ι)
(x : ℝ)


theorem preCDF_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
    ∀ᵐ a ∂ρ.fst, ∀ r, preCDF ρ r a ≤ 1

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

∀ᵐ (a : α) ∂ρ.fst, ∀ (r : ℚ), ProbabilityTheory.preCDF ρ r a ≤ 1


lemma IsNilpotent.pow_succ (n : ℕ) {S : Type*} [MonoidWithZero S] {x : S}
    (hx : IsNilpotent x) : IsNilpotent (x ^ n.succ)

(n : ℕ)
{S : Type u_3}
[MonoidWithZero S]
{x : S}
(hx : IsNilpotent x)


theorem qRight_zero_right (t : I) :
    (qRight (t, 0) : ℝ) = if (t : ℝ) ≤ 1 / 2 then (2 : ℝ) * t else 1

↑(unitInterval.qRight (t, 0)) = if ↑t ≤ 1 / 2 then 2 * ↑t else 1


theorem ker_eq_bot_iff_eq_zero : ker f = ⊥ ↔ ∀ x, f x = 0 → x = 0

{R : Type u}
{S : Type v}
{F : Type u_1}
[Ring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)

RingHom.ker f = ⊥ ↔ ∀ (x : R), f x = 0 → x = 0


@[simp] lemma id_τ₂ : Hom.τ₂ (𝟙 S) = 𝟙 _

(CategoryTheory.CategoryStruct.id S).τ₂ = CategoryTheory.CategoryStruct.id S.X₂


lemma natAbs_eq_of_dvd_dvd (hmn : m ∣ n) (hnm : n ∣ m) : natAbs m = natAbs n


@[simp] theorem mem_diff {s t : Set α} (x : α) : x ∈ s \ t ↔ x ∈ s ∧ x ∉ t


/-- This property implies `IsRatCondKernelCDF`. The measurability, integrability and integral
conditions are the same, but the limit properties of `IsRatCondKernelCDF` are replaced by
limits of integrals. -/
structure IsRatCondKernelCDFAux (f : α × β → ℚ → ℝ) (κ : Kernel α (β × ℝ)) (ν : Kernel α β) :
    Prop :=
  measurable : Measurable f
  mono' (a : α) {q r : ℚ} (_hqr : q ≤ r) : ∀ᵐ c ∂(ν a), f (a, c) q ≤ f (a, c) r
  nonneg' (a : α) (q : ℚ) : ∀ᵐ c ∂(ν a), 0 ≤ f (a, c) q
  le_one' (a : α) (q : ℚ) : ∀ᵐ c ∂(ν a), f (a, c) q ≤ 1
  /- Same as `Tendsto (fun q : ℚ ↦ ∫ c, f (a, c) q ∂(ν a)) atBot (𝓝 0)` but slightly easier
  to prove in the current applications of this definition (some integral convergence lemmas
  currently apply only to `ℕ`, not `ℚ`) -/
  tendsto_integral_of_antitone (a : α) (seq : ℕ → ℚ) (_hs : Antitone seq)
    (_hs_tendsto : Tendsto seq atTop atBot) :
    Tendsto (fun m ↦ ∫ c, f (a, c) (seq m) ∂(ν a)) atTop (𝓝 0)
  /- Same as `Tendsto (fun q : ℚ ↦ ∫ c, f (a, c) q ∂(ν a)) atTop (𝓝 (ν a univ).toReal)` but
  slightly easier to prove in the current applications of this definition (some integral convergence
  lemmas currently apply only to `ℕ`, not `ℚ`) -/
  tendsto_integral_of_monotone (a : α) (seq : ℕ → ℚ) (_hs : Monotone seq)
    (_hs_tendsto : Tendsto seq atTop atTop) :
    Tendsto (fun m ↦ ∫ c, f (a, c) (seq m) ∂(ν a)) atTop (𝓝 (ν a univ).toReal)
  integrable (a : α) (q : ℚ) : Integrable (fun c ↦ f (a, c) q) (ν a)
  setIntegral (a : α) {A : Set β} (_hA : MeasurableSet A) (q : ℚ) :
    ∫ c in A, f (a, c) q ∂(ν a) = (κ a (A ×ˢ Iic ↑q)).toReal

{f : α × β → ℚ → ℝ}

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

(self : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)


/-- The canonical isomorphism `G/(ker φ) ≃* H` induced by a homomorphism `φ : G →* H`
with a right inverse `ψ : H → G`. -/
@[to_additive (attr := simps) "The canonical isomorphism `G/(ker φ) ≃+ H` induced by a homomorphism
`φ : G →+ H` with a right inverse `ψ : H → G`."]
def quotientKerEquivOfRightInverse (ψ : H → G) (hφ : RightInverse ψ φ) : G ⧸ ker φ ≃* H

{G : Type u}
[AddGroup G]
{H : Type v}
[AddGroup H]
(φ : G →+ H)
(ψ : H → G)
(hφ : Function.RightInverse ψ ⇑φ)
(a : G ⧸ φ.ker)

(QuotientAddGroup.quotientKerEquivOfRightInverse φ ψ hφ) a = (QuotientAddGroup.kerLift φ) a


@[simp]
lemma mapCotangent_toCotangent
    (I₁ : Ideal A) (I₂ : Ideal B) (f : A →ₐ[R] B) (h : I₁ ≤ I₂.comap f) (x : I₁) :
    Ideal.mapCotangent I₁ I₂ f h (Ideal.toCotangent I₁ x) = Ideal.toCotangent I₂ ⟨f x, h x.2⟩

{R : Type u}
[CommRing R]
{A : Type u_1}
{B : Type u_2}
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]
(I₁ : Ideal A)
(I₂ : Ideal B)
(f : A →ₐ[R] B)
(h : I₁ ≤ Ideal.comap f I₂)
(x : ↥I₁)

(I₁.mapCotangent I₂ f h) (I₁.toCotangent x) = I₂.toCotangent ⟨f ↑x, ⋯⟩


@[simp]
theorem coe_id : ⇑(BoundedLatticeHom.id α) = id

(α : Type u_3)
[Lattice α]
[BoundedOrder α]


@[reassoc (attr := simp)]
lemma Pi.isoLimit_hom_π (j : α) :
    (Pi.isoLimit X).hom ≫ limit.π _ (Discrete.mk j) = Pi.π _ j

[CategoryTheory.Limits.HasProduct fun j => X.obj { as := j }]

(CategoryTheory.Limits.Pi.isoLimit X).hom ≫ CategoryTheory.Limits.limit.π X { as := j } =
  CategoryTheory.Limits.Pi.π (fun j => X.obj { as := j }) j


theorem le_einfsep_pi_of_le {π : β → Type*} [Fintype β] [∀ b, PseudoEMetricSpace (π b)]
    {s : ∀ b : β, Set (π b)} {c : ℝ≥0∞} (h : ∀ b, c ≤ einfsep (s b)) :
    c ≤ einfsep (Set.pi univ s)

{β : Type u_2}
{π : β → Type u_3}
[Fintype β]
[(b : β) → PseudoEMetricSpace (π b)]
{s : (b : β) → Set (π b)}
{c : ENNReal}
(h : ∀ (b : β), c ≤ (s b).einfsep)


/-- The augmented Čech nerve associated to an arrow. -/
@[simps]
def augmentedCechNerve : SimplicialObject.Augmented C

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

f.augmentedCechNerve.hom.app i = CategoryTheory.Limits.WidePullback.base fun x => f.hom


theorem Continuous.frontier_preimage_subset (hf : Continuous f) (t : Set Y) :
    frontier (f ⁻¹' t) ⊆ f ⁻¹' frontier t

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : Continuous f)
(t : Set Y)


theorem isInt_zpow_neg {α : Type*} [DivisionRing α] {a : α} {b : ℤ} {nb ne : ℕ}
    (pb : IsInt b (Int.negOfNat nb)) (pe' : IsInt (a ^ nb)⁻¹ (Int.negOfNat ne)) :
    IsInt (a ^ b) (Int.negOfNat ne)

(pb : Mathlib.Meta.NormNum.IsInt b (Int.negOfNat nb))

(pe' : Mathlib.Meta.NormNum.IsInt (a ^ nb)⁻¹ (Int.negOfNat ne))

Mathlib.Meta.NormNum.IsInt (a ^ b) (Int.negOfNat ne)


@[simp]
theorem finrank_real_complex : finrank ℝ ℂ = 2


theorem Gamma_nat_eq_factorial (n : ℕ) : Gamma (n + 1) = n !


/-- See also `Ergodic.ae_empty_or_univ_of_image_ae_le`. -/
theorem ae_empty_or_univ_of_image_ae_le' (hf : Ergodic f μ) (hs : MeasurableSet s)
    (hs' : f '' s ≤ᵐ[μ] s) (h_fin : μ s ≠ ∞) : s =ᵐ[μ] (∅ : Set α) ∨ s =ᵐ[μ] univ

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → α}
{s : Set α}
{μ : MeasureTheory.Measure α}
(hf : Ergodic f μ)
(hs : MeasurableSet s)
(hs' : f '' s ≤ᵐ[μ] s)
(h_fin : μ s ≠ ⊤)


theorem rightInverse_symm (e : A ≃⋆ₐ[R] B) : Function.RightInverse e.symm e

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Add A]
[Add B]
[Mul A]
[Mul B]
[SMul R A]
[SMul R B]
[Star A]
[Star B]
(e : A ≃⋆ₐ[R] B)


lemma toSpec_fromSpec {f : A} {m : ℕ} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) (x : Spec.T (A⁰_ f)) :
    toSpec 𝒜 f (FromSpec.toFun f_deg hm x) = x

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

(AlgebraicGeometry.ProjIsoSpecTopComponent.toSpec 𝒜 f)
    (AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.toFun f_deg hm x) =
  x


protected theorem add (hf : UnifIntegrable f p μ) (hg : UnifIntegrable g p μ) (hp : 1 ≤ p)
    (hf_meas : ∀ i, AEStronglyMeasurable (f i) μ) (hg_meas : ∀ i, AEStronglyMeasurable (g i) μ) :
    UnifIntegrable (f + g) p μ

{f g : ι → α → β}

(hf : MeasureTheory.UnifIntegrable f p μ)

(hg : MeasureTheory.UnifIntegrable g p μ)

(hf_meas : ∀ (i : ι), MeasureTheory.AEStronglyMeasurable (f i) μ)

(hg_meas : ∀ (i : ι), MeasureTheory.AEStronglyMeasurable (g i) μ)

MeasureTheory.UnifIntegrable (f + g) p μ


theorem coe_sInf {s : Set ℝ≥0} (hs : s.Nonempty) : (↑(sInf s) : ℝ≥0∞) = ⨅ a ∈ s, ↑a


/-- `succ` commutes with `predAbove`. -/
@[simp] lemma succ_predAbove_succ (a : Fin n) (b : Fin (n + 1)) :
    a.succ.predAbove b.succ = (a.predAbove b).succ


@[simp, norm_cast]
theorem isBigO_ofReal_left {f : α → ℝ} {g : α → E} : (f · : α → ℂ) =O[l] g ↔ f =O[l] g

{α : Type u_1}
{E : Type u_2}
[Norm E]
{l : Filter α}
{f : α → ℝ}
{g : α → E}


@[simp]
theorem equivOfEq_trans {S T U : IntermediateField F E} (hST : S = T) (hTU : T = U) :
    (equivOfEq hST).trans (equivOfEq hTU) = equivOfEq (hST.trans hTU)

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{S T U : IntermediateField F E}
(hST : S = T)
(hTU : T = U)

(IntermediateField.equivOfEq hST).trans (IntermediateField.equivOfEq hTU) = IntermediateField.equivOfEq ⋯


lemma eventually_deriv_rpow_p_mul_one_add_smoothingFn (p : ℝ) :
    deriv (fun z => z ^ p * (1 + ε z))
      =ᶠ[atTop] fun z => p * z ^ (p-1) * (1 + ε z) - z ^ (p-1) / (log z ^ 2)

(deriv fun z => z ^ p * (1 + AkraBazziRecurrence.smoothingFn z)) =ᶠ[Filter.atTop] fun z =>
  p * z ^ (p - 1) * (1 + AkraBazziRecurrence.smoothingFn z) - z ^ (p - 1) / Real.log z ^ 2


theorem isBigO_congr (hf : f₁ =ᶠ[l] f₂) (hg : g₁ =ᶠ[l] g₂) : f₁ =O[l] g₁ ↔ f₂ =O[l] g₂

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{l : Filter α}
{f₁ f₂ : α → E}
{g₁ g₂ : α → F}
(hf : f₁ =ᶠ[l] f₂)
(hg : g₁ =ᶠ[l] g₂)


@[to_additive Iio_add_Iic_subset]
theorem Iio_mul_Iic_subset' (a b : α) : Iio a * Iic b ⊆ Iio (a * b)

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

[CovariantClass α α (Function.swap HMul.hMul) LT.lt]


/-- The cosine of the sum of the angles of a possibly degenerate
triangle (where two given sides are nonzero), vector angle form. -/
theorem cos_angle_add_angle_sub_add_angle_sub_eq_neg_one {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    Real.cos (angle x y + angle x (x - y) + angle y (y - x)) = -1

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

Real.cos
    (InnerProductGeometry.angle x y + InnerProductGeometry.angle x (x - y) + InnerProductGeometry.angle y (y - x)) =
  -1


@[simp]
theorem Fin.image_castSucc (n : ℕ) :
    (univ : Finset (Fin n)).image Fin.castSucc = {Fin.last n}ᶜ

Finset.image Fin.castSucc Finset.univ = {Fin.last n}ᶜ


@[to_additive]
theorem IsCompact.closedBall_one_div (hs : IsCompact s) (hδ : 0 ≤ δ) :
    closedBall 1 δ / s = cthickening δ s⁻¹

{E : Type u_1}
[SeminormedCommGroup E]
{δ : ℝ}
{s : Set E}
(hs : IsCompact s)
(hδ : 0 ≤ δ)

Metric.closedBall 1 δ / s = Metric.cthickening δ s⁻¹


@[reassoc (attr := simp)]
lemma pOpcycles_comp_fromLeftDerivedZero' {X : C}
    (P : ProjectiveResolution X) (F : C ⥤ D) [F.Additive] :
    HomologicalComplex.pOpcycles _ _ ≫ P.fromLeftDerivedZero' F = F.map (P.π.f 0)

(P : CategoryTheory.ProjectiveResolution X)

CategoryTheory.CategoryStruct.comp (((F.mapHomologicalComplex (ComplexShape.down ℕ)).obj P.complex).pOpcycles 0)
    (P.fromLeftDerivedZero' F) =
  F.map (P.π.f 0)


lemma leftShift_comp (a n' : ℤ) (hn' : n + a = n') {m t t' : ℤ} (γ' : Cochain L M m)
    (h : n + m = t) (ht' : t + a = t') :
    (γ.comp γ' h).leftShift a t' ht' = (a * m).negOnePow • (γ.leftShift a n' hn').comp γ'
      (by rw [← ht', ← h, ← hn', add_assoc, add_comm a, add_assoc])

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

(γ' : CochainComplex.HomComplex.Cochain L M m)

(γ.comp γ' h).leftShift a t' ht' = (a * m).negOnePow • (γ.leftShift a n' hn').comp γ' ⋯


/-- Neighborhoods in the quotient are precisely the map of neighborhoods in the prequotient. -/
@[to_additive
  "Neighborhoods in the quotient are precisely the map of neighborhoods in the prequotient."]
theorem QuotientGroup.nhds_eq (x : G) : 𝓝 (x : G ⧸ N) = Filter.map (↑) (𝓝 x)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
(N : AddSubgroup G)
(x : G)

𝓝 ↑x = Filter.map QuotientAddGroup.mk (𝓝 x)


theorem mk_algebraMap {A : Type*} [CommSemiring A] [Algebra A R] (m : A) :
    mk (algebraMap A R m) 1 = algebraMap A (Localization M) m

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{A : Type u_4}
[CommSemiring A]
[Algebra A R]
(m : A)

Localization.mk ((algebraMap A R) m) 1 = (algebraMap A (Localization M)) m


/-- A typeclass for subrings invariant under a `MulSemiringAction`. -/
class IsInvariantSubring : Prop where
  smul_mem : ∀ (m : M) {x : R}, x ∈ S → m • x ∈ S

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[Ring R]
[MulSemiringAction M R]
{S : Subring R}
[self : IsInvariantSubring M S]
(m : M)
{x : R}


/-- If a function `f` tends to infinity along a filter, then `f` multiplied by a positive
constant (on the right) also tends to infinity. For a version working in `ℕ` or `ℤ`, use
`Filter.Tendsto.atTop_mul_const'` instead. -/
theorem Tendsto.atTop_mul_const (hr : 0 < r) (hf : Tendsto f l atTop) :
    Tendsto (fun x => f x * r) l atTop

{α : Type u_3}
{β : Type u_4}
[LinearOrderedSemifield α]
{l : Filter β}
{f : β → α}
{r : α}
(hr : 0 < r)
(hf : Filter.Tendsto f l Filter.atTop)

Filter.Tendsto (fun x => f x * r) l Filter.atTop


@[simp, measurability]
theorem measurableSet_Ioc : MeasurableSet (Ioc a b)

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{a b : α}


@[simp]
theorem mem_Iio_iff : b ∈ Iio a ↔ b < a


@[to_additive]
theorem mem_map_equiv {f : M ≃* N} {K : Subsemigroup M} {x : N} :
    x ∈ K.map (f : M →ₙ* N) ↔ f.symm x ∈ K

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{f : M ≃+ N}
{K : AddSubsemigroup M}
{x : N}

x ∈ AddSubsemigroup.map (↑f) K ↔ f.symm x ∈ K


theorem ContinuousLinearMap.fderiv_of_bilinear {f : G' → E} {g : G' → F} {x : G'}
    (hf : DifferentiableAt 𝕜 f x) (hg : DifferentiableAt 𝕜 g x) :
    fderiv 𝕜 (fun y => B (f y) (g y)) x =
      B.precompR G' (f x) (fderiv 𝕜 g x) + B.precompL G' (fderiv 𝕜 f x) (g x)

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

fderiv 𝕜 (fun y => (B (f y)) (g y)) x =
  ((ContinuousLinearMap.precompR G' B) (f x)) (fderiv 𝕜 g x) +
    ((ContinuousLinearMap.precompL G' B) (fderiv 𝕜 f x)) (g x)


@[simp]
theorem commutatorElement_self : ⁅g, g⁆ = 1


@[simp]
theorem mem_coe {x : E} {K : ProperCone 𝕜 E} : x ∈ (K : PointedCone 𝕜 E) ↔ x ∈ K

{𝕜 : Type u_1}
[OrderedSemiring 𝕜]
{E : Type u_2}
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]
{x : E}
{K : ProperCone 𝕜 E}

x ∈ ↑K ↔ x ∈ K


@[instance]
theorem ordConnected_Iic {a : α} : OrdConnected (Iic a)


theorem lim_eq {x : X} [NeBot f] (h : f ≤ 𝓝 x) : @lim _ _ ⟨x⟩ f = x

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
{f : Filter X}
{x : X}
[f.NeBot]
(h : f ≤ 𝓝 x)


theorem Perm.inter_right {l₁ l₂ : List α} (t₁ : List α) : l₁ ~ l₂ → l₁ ∩ t₁ ~ l₂ ∩ t₁

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

l₁ ~ l₂ → l₁ ∩ t₁ ~ l₂ ∩ t₁


theorem dvd_gcd (hx : z ∣ x) (hy : z ∣ y) : z ∣ gcd x y

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


theorem pushforward_monotone (f : Y ⟶ X) : Monotone (Sieve.pushforward f)

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


protected lemma isNilpotent_iff :
    IsNilpotent P ↔ ∀ i, IsNilpotent (coeff P i)

{R : Type u_1}
[CommRing R]
{P : Polynomial R}

IsNilpotent P ↔ ∀ (i : ℕ), IsNilpotent (P.coeff i)


nonrec lemma ContDiffAt.contDiffOn {m : ℕ} (h : ContDiffAt 𝕜 n f x) (hm : m ≤ n) :
    ∃ u ∈ 𝓝 x, ContDiffOn 𝕜 m f u

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{n : ℕ∞}
{m : ℕ}
(h : ContDiffAt 𝕜 n f x)
(hm : ↑m ≤ n)


@[simp]
theorem lift_add (a b : Cardinal.{u}) : lift.{v} (a + b) = lift.{v} a + lift.{v} b

Cardinal.lift.{v, u} (a + b) = Cardinal.lift.{v, u} a + Cardinal.lift.{v, u} b


theorem range_toContinuousMultilinearMap :
    Set.range
        (toContinuousMultilinearMap :
          M [⋀^ι]→L[R] N → ContinuousMultilinearMap R (fun _ : ι => M) N) =
      {f | ∀ (v : ι → M) (i j : ι), v i = v j → i ≠ j → f v = 0}

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]

Set.range ContinuousAlternatingMap.toContinuousMultilinearMap =
  {f | ∀ (v : ι → M) (i j : ι), v i = v j → i ≠ j → f v = 0}


@[to_additive]
theorem min_le_mul_of_one_le_left [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a b : α}
    (ha : 1 ≤ a) : min a b ≤ a * b

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