theorem deriv_inner_apply {f g : ℝ → E} {x : ℝ} (hf : DifferentiableAt ℝ f x)
    (hg : DifferentiableAt ℝ g x) :
    deriv (fun t => ⟪f t, g t⟫) x = ⟪f x, deriv g x⟫ + ⟪deriv f x, g x⟫

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{f g : ℝ → E}
{x : ℝ}
(hf : DifferentiableAt ℝ f x)
(hg : DifferentiableAt ℝ g x)

deriv (fun t => ⟪f t, g t⟫_𝕜) x = ⟪f x, deriv g x⟫_𝕜 + ⟪deriv f x, g x⟫_𝕜


@[simp]
theorem symm_symm (c : ComplexShape ι) : c.symm.symm = c


theorem _root_.MeasureTheory.AEStronglyMeasurable.comp_snd_map_prod_mk
    {Ω F} {mΩ : MeasurableSpace Ω} (X : Ω → β) {μ : Measure Ω} [TopologicalSpace F] {f : Ω → F}
    (hf : AEStronglyMeasurable f μ) :
    AEStronglyMeasurable (fun x : β × Ω => f x.2) (μ.map fun ω => (X ω, ω))

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (fun x => f x.2) (MeasureTheory.Measure.map (fun ω => (X ω, ω)) μ)


/-- The `Set.image2` version of `Set.image_eq_iUnion` -/
theorem image2_eq_iUnion (s : Set α) (t : Set β) : image2 f s t = ⋃ (i ∈ s) (j ∈ t), {f i j}

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

Set.image2 f s t = ⋃ i ∈ s, ⋃ j ∈ t, {f i j}


theorem coe_ssubset_coe : (s : Set P) ⊂ t ↔ s < t

{P : Type u_1}
[LE P]
{s t : Order.Ideal P}


/-- The `Finset` version of `Equiv.symm_image_subset`. -/
theorem map_symm_subset {t : Finset β} {f : α ≃ β} : t.map f.symm ⊆ s ↔ t ⊆ s.map f

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
{f : α ≃ β}

Finset.map f.symm.toEmbedding t ⊆ s ↔ t ⊆ Finset.map f.toEmbedding s


@[simp]
theorem id_apply (a : α) : InfHom.id α a = a


/--
An isomorphism of groups gives an order isomorphism between the lattices of subgroups,
defined by sending subgroups to their forward images.

See also `MulEquiv.comapSubgroup` which maps subgroups to their inverse images.
-/
@[simps]
def mapSubgroup {H : Type*} [Group H] (f : G ≃* H) : Subgroup G ≃o Subgroup H

{G : Type u_1}
[Group G]
{H : Type u_6}
[Group H]
(f : G ≃* H)

∀ (H_1 : Subgroup G), f.mapSubgroup H_1 = Subgroup.map (↑f) H_1


protected theorem bounded (f : α →ᵇ β) : ∃ C, ∀ x y : α, dist (f x) (f y) ≤ C

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
(f : BoundedContinuousFunction α β)


theorem image_sdiff [DecidableEq α] {f : α → β} (s t : Finset α) (hf : Injective f) :
    (s \ t).image f = s.image f \ t.image f

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
[DecidableEq α]
{f : α → β}
(s t : Finset α)
(hf : Function.Injective f)

Finset.image f (s \ t) = Finset.image f s \ Finset.image f t


theorem map_mono (f : α → β) : Monotone (map f)


theorem Function.Surjective.connectedSpace [ConnectedSpace α] [TopologicalSpace β]
    {f : α → β} (hf : Surjective f) (hf' : Continuous f) : ConnectedSpace β

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[ConnectedSpace α]
[TopologicalSpace β]
{f : α → β}
(hf : Function.Surjective f)
(hf' : Continuous f)


/-- The type of Heyting homomorphisms from `α` to `β`. Bounded lattice homomorphisms that preserve
Heyting implication. -/
structure HeytingHom (α β : Type*) [HeytingAlgebra α] [HeytingAlgebra β] extends
  LatticeHom α β where
  /-- The proposition that a Heyting homomorphism preserves the bottom element. -/
  protected map_bot' : toFun ⊥ = ⊥
  /-- The proposition that a Heyting homomorphism preserves the Heyting implication. -/
  protected map_himp' : ∀ a b, toFun (a ⇨ b) = toFun a ⇨ toFun b

{α : Type u_6}
{β : Type u_7}
[HeytingAlgebra α]
[HeytingAlgebra β]
(self : HeytingHom α β)
(a b : α)

self.toFun (a ⇨ b) = self.toFun a ⇨ self.toFun b


theorem rfind' {f} (hf : Nat.Partrec f) :
    Nat.Partrec
      (Nat.unpaired fun a m =>
        (Nat.rfind fun n => (fun m => m = 0) <$> f (Nat.pair a (n + m))).map (· + m))

Nat.Partrec
  (Nat.unpaired fun a m =>
    Part.map (fun x => x + m) (Nat.rfind fun n => (fun m => decide (m = 0)) <$> f (Nat.pair a (n + m))))


lemma measurable_countableFiltration_densityProcess (κ : Kernel α (γ × β)) (ν : Kernel α γ) (n : ℕ)
    (a : α) {s : Set β} (hs : MeasurableSet s) :
    Measurable[countableFiltration γ n] (fun x ↦ densityProcess κ ν n a x s)

(κ : ProbabilityTheory.Kernel α (γ × β))

Measurable fun x => κ.densityProcess ν n a x s


/-- If the right cosets of `s` by elements of `t` are disjoint (but not necessarily distinct!), then
the size of `s` divides the size of `s * t`. -/
@[to_additive "If the right cosets of `s` by elements of `t` are disjoint (but not necessarily
distinct!), then the size of `s` divides the size of `s + t`."]
theorem card_dvd_card_mul_left {s t : Finset α} :
    ((fun b => s.image fun a => a * b) '' (t : Set α)).PairwiseDisjoint id →
      s.card ∣ (s * t).card

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

((fun b => Finset.image (fun a => a + b) s) '' ↑t).PairwiseDisjoint id → s.card ∣ (s + t).card


lemma DifferentiableWithinAt.isBigO_sub {f : E → F} {s : Set E} {x₀ : E}
    (h : DifferentiableWithinAt 𝕜 f s x₀) : (f · - f x₀) =O[𝓝[s] x₀] (· - x₀)

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

(fun x => f x - f x₀) =O[𝓝[s] x₀] fun x => x - x₀


@[simp] theorem equivCongr_trans {δ ε ζ} (ab : α ≃ β) (de : δ ≃ ε) (bc : β ≃ γ) (ef : ε ≃ ζ) :
    (ab.equivCongr de).trans (bc.equivCongr ef) = (ab.trans bc).equivCongr (de.trans ef)

{α : Sort u}
{β : Sort v}
{γ : Sort w}
{δ : Sort u_1}
{ε : Sort u_2}
{ζ : Sort u_3}
(ab : α ≃ β)
(de : δ ≃ ε)
(bc : β ≃ γ)
(ef : ε ≃ ζ)


theorem xn_succ_succ (n) : xn a1 (n + 2) + xn a1 n = 2 * a * xn a1 (n + 1)

Pell.xn a1 (n + 2) + Pell.xn a1 n = 2 * a * Pell.xn a1 (n + 1)


/-- The formal concepts of a relation. A concept of `r : α → β → Prop` is a pair of sets `s`, `t`
such that `s` is the set of all elements that are `r`-related to all of `t` and `t` is the set of
all elements that are `r`-related to all of `s`. -/
structure Concept extends Set α × Set β where
  /-- The axiom of a `Concept` stating that the closure of the first set is the second set. -/
  closure_fst : intentClosure r fst = snd
  /-- The axiom of a `Concept` stating that the closure of the second set is the first set. -/
  closure_snd : extentClosure r snd = fst

{α : Type u_2}
{β : Type u_3}
{r : α → β → Prop}
(self : Concept α β r)

intentClosure r self.toProd.1 = self.toProd.2


theorem bihimp_bihimp_bihimp_comm : a ⇔ b ⇔ (c ⇔ d) = a ⇔ c ⇔ (b ⇔ d)

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


theorem insert_union_distrib (a : α) (s t : Set α) : insert a (s ∪ t) = insert a s ∪ insert a t


theorem memℒp_of_isFiniteMeasure (f : α →ₛ E) (p : ℝ≥0∞) (μ : Measure α) [IsFiniteMeasure μ] :
    Memℒp f p μ

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
(f : MeasureTheory.SimpleFunc α E)
(p : ℝ≥0∞)
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]


lemma eventually_atTop_zero_or_pos_or_neg (hf : GrowsPolynomially f) :
    (∀ᶠ x in atTop, f x = 0) ∨ (∀ᶠ x in atTop, 0 < f x) ∨ (∀ᶠ x in atTop, f x < 0)

(hf : AkraBazziRecurrence.GrowsPolynomially f)

(∀ᶠ (x : ℝ) in Filter.atTop, f x = 0) ∨ (∀ᶠ (x : ℝ) in Filter.atTop, 0 < f x) ∨ ∀ᶠ (x : ℝ) in Filter.atTop, f x < 0


@[simp]
theorem subset_sInter_iff {S : Set (Set α)} {t : Set α} : t ⊆ ⋂₀ S ↔ ∀ t' ∈ S, t ⊆ t'

{α : Type u_1}
{S : Set (Set α)}
{t : Set α}


@[simp]
theorem adjoin_natCast (n : ℕ) : F⟮(n : E)⟯ = ⊥

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


theorem C_eq_algebraMap : C = algebraMap R (HahnSeries Γ R)

{Γ : Type u_1}
{R : Type u_3}
[OrderedCancelAddCommMonoid Γ]
[CommSemiring R]

HahnSeries.C = algebraMap R (HahnSeries Γ R)


theorem addHaar_ball_mul_of_pos (x : E) {r : ℝ} (hr : 0 < r) (s : ℝ) :
    μ (ball x (r * s)) = ENNReal.ofReal (r ^ finrank ℝ E) * μ (ball 0 s)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
(x : E)
{r : ℝ}
(hr : 0 < r)
(s : ℝ)

μ (Metric.ball x (r * s)) = ENNReal.ofReal (r ^ FiniteDimensional.finrank ℝ E) * μ (Metric.ball 0 s)


@[simp]
theorem foldl_cons (f : β → α → β) (H b a s) : foldl f H b (a ::ₘ s) = foldl f H (f b a) s

{α : Type u_1}
{β : Type v}
(f : β → α → β)
(H : RightCommutative f)
(b : β)
(a : α)
(s : Multiset α)

Multiset.foldl f H b (a ::ₘ s) = Multiset.foldl f H (f b a) s


theorem StrictConvex.linear_preimage {s : Set F} (hs : StrictConvex 𝕜 s) (f : E →ₗ[𝕜] F)
    (hf : Continuous f) (hfinj : Injective f) : StrictConvex 𝕜 (s.preimage f)

{𝕜 : Type u_1}
{E : Type u_3}
{F : Type u_4}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[TopologicalSpace F]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{s : Set F}
(hs : StrictConvex 𝕜 s)
(f : E →ₗ[𝕜] F)
(hf : Continuous ⇑f)
(hfinj : Function.Injective ⇑f)


@[simp]
theorem map_coe (f : F) (p : Submodule R M) : (map f p : Set M₂) = f '' p

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


@[to_additive]
theorem inducing_toContinuousMap : Inducing (toContinuousMap : ContinuousMonoidHom A B → C(A, B))

(A : Type u_2)
(B : Type u_3)
[AddMonoid A]
[AddMonoid B]
[TopologicalSpace A]
[TopologicalSpace B]


@[to_additive]
theorem Integrable.comp_div_right {f : G → F} [IsMulRightInvariant μ] (hf : Integrable f μ)
    (g : G) : Integrable (fun t => f (t / g)) μ

{G : Type u_4}
{F : Type u_6}
[MeasurableSpace G]
[NormedAddCommGroup F]
{μ : MeasureTheory.Measure G}
[AddGroup G]
[MeasurableAdd G]
{f : G → F}
[μ.IsAddRightInvariant]
(hf : MeasureTheory.Integrable f μ)
(g : G)

MeasureTheory.Integrable (fun t => f (t - g)) μ


theorem LinearMap.extendTo𝕜_apply (fr : RestrictScalars ℝ 𝕜 F →ₗ[ℝ] ℝ) (x : F) :
    fr.extendTo𝕜 x = (fr x : 𝕜) - (I : 𝕜) * (fr ((I : 𝕜) • x) : 𝕜)

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

fr.extendTo𝕜 x = ↑(fr x) - RCLike.I * ↑(fr (RCLike.I • x))


/-- If `e : A ≃ₐ[R] B` and `A` is finitely presented, then so is `B`. -/
theorem equiv [FinitePresentation R A] (e : A ≃ₐ[R] B) : FinitePresentation R B

{R : Type w₁}
{A : Type w₂}
{B : Type w₃}
[CommRing R]
[CommRing A]
[Algebra R A]
[CommRing B]
[Algebra R B]
[Algebra.FinitePresentation R A]
(e : A ≃ₐ[R] B)


theorem le_inf : a ≤ b → a ≤ c → a ≤ b ⊓ c

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


theorem Infinite.exists_subset_card_eq {s : Set α} (hs : s.Infinite) (n : ℕ) :
    ∃ t : Finset α, ↑t ⊆ s ∧ t.card = n

{α : Type u}
{s : Set α}
(hs : s.Infinite)
(n : ℕ)


theorem continuous_of_le [TopologicalSpace E] [TopologicalAddGroup E]
    {p q : Seminorm 𝕝 E} (hq : Continuous q) (hpq : p ≤ q) : Continuous p

{𝕝 : Type u_6}
{E : Type u_7}
[SeminormedRing 𝕝]
[AddCommGroup E]
[Module 𝕝 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
{p q : Seminorm 𝕝 E}
(hq : Continuous ⇑q)
(hpq : p ≤ q)


theorem card_aut_eq_finrank [FiniteDimensional F E] [IsGalois F E] :
    Fintype.card (E ≃ₐ[F] E) = finrank F E

(F : Type u_1)
[Field F]
(E : Type u_2)
[Field E]
[Algebra F E]
[FiniteDimensional F E]
[IsGalois F E]

Fintype.card (E ≃ₐ[F] E) = FiniteDimensional.finrank F E


theorem isGalois_iff_isGalois_bot : IsGalois (⊥ : IntermediateField F E) E ↔ IsGalois F E

{F : Type u_1}
{E : Type u_3}
[Field F]
[Field E]
[Algebra F E]


@[simp]
lemma preNormEDS_ofNat (n : ℕ) : preNormEDS b c d n = preNormEDS' b c d n

{R : Type u}
[CommRing R]
(b c d : R)
(n : ℕ)

preNormEDS b c d ↑n = preNormEDS' b c d n


@[simp]
theorem repr_ceil_apply (m : E) (i : ι) : b.repr (ceil b m) i = ⌈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.ceil b m)) i = ↑⌈(b.repr m) i⌉


{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{t : Finset (α × β × γ)}


lemma P1_of_lt (h₁ : P3 x₃ x₂ y₂ y₃) (h₂ : P3 x₁ x₃ y₂ y₁) : P1 x₁ x₂ x₃ y₁ y₂ y₃

(h₁ : Surreal.Multiplication.P3 x₃ x₂ y₂ y₃)

(h₂ : Surreal.Multiplication.P3 x₁ x₃ y₂ y₁)

Surreal.Multiplication.P1 x₁ x₂ x₃ y₁ y₂ y₃


theorem Odd.nat_add_dvd_pow_add_pow (x y : ℕ) {n : ℕ} (h : Odd n) : x + y ∣ x ^ n + y ^ n


/-- To every `S : J.Cover X` and presheaf `P`, associate a `MulticospanIndex`. -/
@[simps]
def index {D : Type u₁} [Category.{v₁} D] (S : J.Cover X) (P : Cᵒᵖ ⥤ D) :
    Limits.MulticospanIndex D

{J : CategoryTheory.GrothendieckTopology C}

(S.index P).left I = P.obj (Opposite.op I.Y)


theorem ConcaveOn.quasiconcaveOn (hf : ConcaveOn 𝕜 s f) : QuasiconcaveOn 𝕜 s f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)


@[reassoc (attr := simp)]
lemma ι_mapBifunctorMap (i₁ : I₁) (i₂ : I₂) (j : J)
    (h : ComplexShape.π c₁ c₂ c (i₁, i₂) = j) :
    ιMapBifunctor K₁ K₂ F c i₁ i₂ j h ≫ (mapBifunctorMap f₁ f₂ F c).f j =
      (F.map (f₁.f i₁)).app (K₂.X i₂) ≫ (F.obj (L₁.X i₁)).map (f₂.f i₂) ≫
        ιMapBifunctor L₁ L₂ F c i₁ i₂ j h

[∀ (X₁ : C₁), (F.obj X₁).PreservesZeroMorphisms]

K₁.ιMapBifunctor K₂ F c i₁ i₂ j h ≫ (HomologicalComplex.mapBifunctorMap f₁ f₂ F c).f j =
  (F.map (f₁.f i₁)).app (K₂.X i₂) ≫ (F.obj (L₁.X i₁)).map (f₂.f i₂) ≫ L₁.ιMapBifunctor L₂ F c i₁ i₂ j h


theorem not_modEq_iff_toIcoDiv_eq_toIocDiv :
    ¬a ≡ b [PMOD p] ↔ toIcoDiv hp a b = toIocDiv hp a b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
{a b : α}


theorem ext_iff {f g : P →ᴬ[R] Q} : f = g ↔ ∀ x, f x = g x

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
{Q : Type u_5}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace Q]
[AddTorsor W Q]
{f g : P →ᴬ[R] Q}


lemma ShortComplex.Exact.exact_up_to_refinements
    (hS : S.Exact) {A : C} (x₂ : A ⟶ S.X₂) (hx₂ : x₂ ≫ S.g = 0) :
    ∃ (A' : C) (π : A' ⟶ A) (_ : Epi π) (x₁ : A' ⟶ S.X₁), π ≫ x₂ = x₁ ≫ S.f

(hx₂ : CategoryTheory.CategoryStruct.comp x₂ S.g = 0)

∃ A' π,
  ∃ (_ : CategoryTheory.Epi π),
    ∃ x₁, CategoryTheory.CategoryStruct.comp π x₂ = CategoryTheory.CategoryStruct.comp x₁ S.f


/-- An injective continuous function on a Polish space is a measurable embedding. -/
theorem _root_.Continuous.measurableEmbedding [BorelSpace β]
    [TopologicalSpace γ] [PolishSpace γ] [MeasurableSpace γ] [BorelSpace γ]
    (f_cont : Continuous f) (f_inj : Injective f) :
    MeasurableEmbedding f

{γ : Type u_3}
{β : Type u_5}
[tβ : TopologicalSpace β]
[T2Space β]
[MeasurableSpace β]
{f : γ → β}
[BorelSpace β]
[TopologicalSpace γ]
[PolishSpace γ]
[MeasurableSpace γ]
[BorelSpace γ]
(f_cont : Continuous f)
(f_inj : Function.Injective f)


theorem commMap_apply_of_isComplex (x : (K →+* ℂ) → ℂ) {w : InfinitePlace K} (hw : IsComplex w) :
    (commMap K x).2 ⟨w, hw⟩ = x w.embedding

(K : Type u_1)
[Field K]
(x : (K →+* ℂ) → ℂ)
{w : NumberField.InfinitePlace K}
(hw : w.IsComplex)

((NumberField.mixedEmbedding.commMap K) x).2 ⟨w, hw⟩ = x w.embedding


theorem Set.EqOn.eventuallyEq_nhdsWithin {f g : α → β} {s : Set α} {a : α} (h : EqOn f g s) :
    f =ᶠ[𝓝[s] a] g

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
{f g : α → β}
{s : Set α}
{a : α}
(h : Set.EqOn f g s)


/-- Additive submonoids of an additive monoid `A` are isomorphic to
multiplicative submonoids of `Multiplicative A`. -/
@[simps]
def AddSubmonoid.toSubmonoid : AddSubmonoid A ≃o Submonoid (Multiplicative A)

{A : Type u_4}
[AddZeroClass A]
(S : AddSubmonoid A)

↑(AddSubmonoid.toSubmonoid S) = ⇑Multiplicative.toAdd ⁻¹' ↑S


theorem sep_false : { x ∈ s | False } = ∅


/-- 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).inverse = CategoryTheory.TwoSquare.EquivalenceJ.inverse w g


/-- `LiftPropWithinAt P f s x` is equivalent to a definition where we restrict the set we are
  considering to the domain of the charts at `x` and `f x`. -/
theorem liftPropWithinAt_iff {f : M → M'} :
    LiftPropWithinAt P f s x ↔
      ContinuousWithinAt f s x ∧
        P (chartAt H' (f x) ∘ f ∘ (chartAt H x).symm)
          ((chartAt H x).target ∩ (chartAt H x).symm ⁻¹' (s ∩ f ⁻¹' (chartAt H' (f x)).source))
          (chartAt H x x)

{H : Type u_1}
{M : Type u_2}
{H' : Type u_3}
{M' : Type u_4}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
{s : Set M}
{x : M}
(hG : G.LocalInvariantProp G' P)
{f : M → M'}

ChartedSpace.LiftPropWithinAt P f s x ↔
  ContinuousWithinAt f s x ∧
    P (↑(chartAt H' (f x)) ∘ f ∘ ↑(chartAt H x).symm)
      ((chartAt H x).target ∩ ↑(chartAt H x).symm ⁻¹' (s ∩ f ⁻¹' (chartAt H' (f x)).source)) (↑(chartAt H x) x)


theorem taylorWithin_succ (f : ℝ → E) (n : ℕ) (s : Set ℝ) (x₀ : ℝ) :
    taylorWithin f (n + 1) s x₀ = taylorWithin f n s x₀ +
      PolynomialModule.comp (Polynomial.X - Polynomial.C x₀)
      (PolynomialModule.single ℝ (n + 1) (taylorCoeffWithin f (n + 1) s x₀))

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(f : ℝ → E)
(n : ℕ)
(s : Set ℝ)
(x₀ : ℝ)

taylorWithin f (n + 1) s x₀ =
  taylorWithin f n s x₀ +
    (PolynomialModule.comp (Polynomial.X - Polynomial.C x₀))
      ((PolynomialModule.single ℝ (n + 1)) (taylorCoeffWithin f (n + 1) s x₀))


theorem reduce_a {u : XgcdType} (h : u.r = 0) : u.reduce = u.finish


@[simp]
theorem sign_eq_zero_iff {r : ℝ} : sign r = 0 ↔ r = 0


theorem isAlt_iff_eq_neg_flip [NoZeroDivisors R] [CharZero R] {B : M₁ →ₛₗ[I] M₁ →ₛₗ[I] R} :
    B.IsAlt ↔ B = -B.flip

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


theorem IsBigO.prod_rightr (h : f =O[l] g') : f =O[l] fun x => (f' x, g' x)

{α : Type u_1}
{E : Type u_3}
{E' : Type u_6}
{F' : Type u_7}
[Norm E]
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{f : α → E}
(f' : α → E')
{g' : α → F'}
{l : Filter α}
(h : f =O[l] g')


theorem ContinuousMultilinearMap.norm_map_cons_le (f : ContinuousMultilinearMap 𝕜 Ei G) (x : Ei 0)
    (m : ∀ i : Fin n, Ei i.succ) : ‖f (cons x m)‖ ≤ ‖f‖ * ‖x‖ * ∏ i, ‖m i‖

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

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

‖f (Fin.cons x m)‖ ≤ ‖f‖ * ‖x‖ * ∏ i : Fin n, ‖m i‖


theorem truncateFun_pow (x : 𝕎 R) (m : ℕ) : truncateFun n (x ^ m) = truncateFun n x ^ m

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

WittVector.truncateFun n (x ^ m) = WittVector.truncateFun n x ^ m


@[simp]
theorem BinaryFan.assoc_fst {X Y Z : C} {sXY : BinaryFan X Y} {sYZ : BinaryFan Y Z}
    (Q : IsLimit sYZ) (s : BinaryFan sXY.pt Z) : (BinaryFan.assoc Q s).fst = s.fst ≫ sXY.fst

{sXY : CategoryTheory.Limits.BinaryFan X Y}

{sYZ : CategoryTheory.Limits.BinaryFan Y Z}

(s : CategoryTheory.Limits.BinaryFan sXY.pt Z)

(CategoryTheory.Limits.BinaryFan.assoc Q s).fst = CategoryTheory.CategoryStruct.comp s.fst sXY.fst


theorem symmDiff_sdiff : a ∆ b \ c = a \ (b ⊔ c) ⊔ b \ (a ⊔ c)

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


theorem restrict_preimage_singleton (f : α →ₛ β) {s : Set α} (hs : MeasurableSet s) {r : β}
    (hr : r ≠ 0) : restrict f s ⁻¹' {r} = s ∩ f ⁻¹' {r}

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Zero β]
(f : MeasureTheory.SimpleFunc α β)
{s : Set α}
(hs : MeasurableSet s)
{r : β}
(hr : r ≠ 0)

↑(f.restrict s) ⁻¹' {r} = s ∩ ↑f ⁻¹' {r}


@[simp] lemma prod_eq_univ [Nonempty α] [Nonempty β] : s ×ˢ t = univ ↔ s = univ ∧ t = univ

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
[Nonempty α]
[Nonempty β]

s ×ˢ t = Set.univ ↔ s = Set.univ ∧ t = Set.univ


theorem smooth_iff :
    Smooth I I' f ↔
      Continuous f ∧
        ∀ (x : M) (y : M'),
          ContDiffOn 𝕜 ⊤ (extChartAt I' y ∘ f ∘ (extChartAt I x).symm)
            ((extChartAt I x).target ∩
              (extChartAt I x).symm ⁻¹' (f ⁻¹' (extChartAt I' y).source))

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

Smooth I I' f ↔
  Continuous f ∧
    ∀ (x : M) (y : M'),
      ContDiffOn 𝕜 ⊤ (↑(extChartAt I' y) ∘ f ∘ ↑(extChartAt I x).symm)
        ((extChartAt I x).target ∩ ↑(extChartAt I x).symm ⁻¹' (f ⁻¹' (extChartAt I' y).source))


@[simp]
theorem bind₁_id : bind₁ (@id (MvPolynomial σ R)) = join₁

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

MvPolynomial.bind₁ id = MvPolynomial.join₁


@[to_additive]
lemma le_centralizer_centralizer {s : Submonoid M} : s ≤ centralizer (centralizer (s : Set M))

(M : Type u_1)
[AddMonoid M]
{s : AddSubmonoid M}

s ≤ AddSubmonoid.centralizer ↑(AddSubmonoid.centralizer ↑s)


lemma PairwiseDisjoint.eq_or_disjoint
    (h : s.PairwiseDisjoint f) {i j : ι} (hi : i ∈ s) (hj : j ∈ s) :
    i = j ∨ Disjoint (f i) (f j)

{α : Type u_1}
{ι : Type u_4}
[PartialOrder α]
[OrderBot α]
{s : Set ι}
{f : ι → α}
(h : s.PairwiseDisjoint f)
{i j : ι}
(hi : i ∈ s)
(hj : j ∈ s)


/-- A purely inseparable extension has finite inseparable degree equal to degree. -/
theorem IsPurelyInseparable.finInsepDegree_eq [IsPurelyInseparable F E] :
    finInsepDegree F E = finrank F E

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
[IsPurelyInseparable F E]

Field.finInsepDegree F E = FiniteDimensional.finrank F E


lemma isLeftKanExtension_of_iso {F' : D ⥤ H} {F'' : D ⥤ H} (e : F' ≅ F'')
    {L : C ⥤ D} {F : C ⥤ H} (α : F ⟶ L ⋙ F') (α' : F ⟶ L ⋙ F'')
    (comm : α ≫ whiskerLeft L e.hom = α') [F'.IsLeftKanExtension α] :
    F''.IsLeftKanExtension α'

(comm : CategoryTheory.CategoryStruct.comp α (CategoryTheory.whiskerLeft L e.hom) = α')


/-- If a function `f` is continuous on a convex set `D ⊆ ℝ` and `f'` is strictly antitone on the
interior, then `f` is strictly concave on `D`.
Note that we don't require differentiability, since it is guaranteed at all but at most
one point by the strict antitonicity of `f'`. -/
theorem StrictAntiOn.strictConcaveOn_of_deriv {D : Set ℝ} (hD : Convex ℝ D) {f : ℝ → ℝ}
    (hf : ContinuousOn f D) (h_anti : StrictAntiOn (deriv f) (interior D)) :
    StrictConcaveOn ℝ D f


theorem lt_self_pow (h : 1 < a) (hm : 1 < m) : a < a ^ m

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


/-- Forgetting the multiplicative structures, an equivalence of algebras is a linear equivalence. -/
@[simps apply]
def toLinearEquiv (e : A₁ ≃ₐ[R] A₂) : A₁ ≃ₗ[R] A₂

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


@[aesop apply safe (rule_sets := [CategoryTheory])]
theorem inv_ext {f : X ≅ Y} {g : Y ⟶ X} (hom_inv_id : f.hom ≫ g = 𝟙 X) : f.inv = g

(hom_inv_id : CategoryTheory.CategoryStruct.comp f.hom g = CategoryTheory.CategoryStruct.id X)


@[simps]
instance homCategory (𝒳 : BasedCategory.{v₂, u₂} 𝒮) (𝒴 : BasedCategory.{v₃, u₃} 𝒮) :
    Category (𝒳 ⥤ᵇ 𝒴)

{𝒮 : Type u₁}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
(𝒳 : CategoryTheory.BasedCategory 𝒮)
(𝒴 : CategoryTheory.BasedCategory 𝒮)

∀ {X Y Z : CategoryTheory.BasedFunctor 𝒳 𝒴} (α : CategoryTheory.BasedNatTrans X Y)
  (β : CategoryTheory.BasedNatTrans Y Z), CategoryTheory.CategoryStruct.comp α β = α.comp β


lemma Set.finite_diff_iUnion_Ioo' (s : Set α) : (s \ ⋃ x : s × s, Ioo x.1 x.2).Finite

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


theorem Nat.le_of_lt_succ {m n : Nat} : LT.lt m (succ n) → LE.le m n


@[simp]
theorem map_monomial {n a} : (monomial n a).map f = monomial n (f a)

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(f : R →+* S)
{n : ℕ}
{a : R}

Polynomial.map f ((Polynomial.monomial n) a) = (Polynomial.monomial n) (f a)


theorem zipLeft'_cons_nil :
    zipLeft' (a :: as) ([] : List β) = ((a, none) :: as.map fun a => (a, none), [])

{α : Type u}
{β : Type v}
(a : α)
(as : List α)

(a :: as).zipLeft' [] = ((a, none) :: List.map (fun a => (a, none)) as, [])


/-- If a category has all coproducts then in particular it has finite coproducts.
-/
theorem hasFiniteCoproducts_of_hasCoproducts [HasCoproducts.{w} C] : HasFiniteCoproducts C

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


theorem equivMapDomain_trans' (f : α ≃ β) (g : β ≃ γ) :
    @equivMapDomain _ _ M _ (f.trans g) = equivMapDomain g ∘ equivMapDomain f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{M : Type u_5}
[Zero M]
(f : α ≃ β)
(g : β ≃ γ)

Finsupp.equivMapDomain (f.trans g) = Finsupp.equivMapDomain g ∘ Finsupp.equivMapDomain f


theorem WithSeminorms.isVonNBounded_iff_finset_seminorm_bounded {s : Set E} (hp : WithSeminorms p) :
    Bornology.IsVonNBounded 𝕜 s ↔ ∀ I : Finset ι, ∃ r > 0, ∀ x ∈ s, I.sup p x < r

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

Bornology.IsVonNBounded 𝕜 s ↔ ∀ (I : Finset ι), ∃ r > 0, ∀ x ∈ s, (I.sup p) x < r


@[to_additive Summable.of_nat_of_neg_add_one]
lemma Multipliable.of_nat_of_neg_add_one {f : ℤ → M}
    (hf₁ : Multipliable fun n : ℕ ↦ f n)  (hf₂ : Multipliable fun n : ℕ ↦ f (-(n + 1))) :
    Multipliable f

(hf₂ : Multipliable fun n => f (-(↑n + 1)))


@[simp] lemma ofEpiOfIsIsoOfMono_ι : (ofEpiOfIsIsoOfMono φ h).ι = h.ι

(CategoryTheory.ShortComplex.RightHomologyData.ofEpiOfIsIsoOfMono φ h).ι = h.ι


theorem exists_mul_lt_apply_of_lt_opNNNorm (f : E →SL[σ₁₂] F) {r : ℝ≥0} (hr : r < ‖f‖₊) :
    ∃ x, r * ‖x‖₊ < ‖f x‖₊

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)
{r : ℝ≥0}
(hr : r < ‖f‖₊)


theorem union_diff_cancel' {s t u : Set α} (h₁ : s ⊆ t) (h₂ : t ⊆ u) : t ∪ u \ s = u

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


/-- The functor which flips commutative squares. -/
@[simps]
def flipFunctor : Square C ⥤ Square C

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

CategoryTheory.Square.flipFunctor.obj sq = sq.flip


@[simp]
theorem ker_nhds [T1Space X] (x : X) : (𝓝 x).ker = {x}

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
(x : X)


theorem bounded_lt_Ioc [Preorder α] [NoMaxOrder α] (a b : α) : Bounded (· < ·) (Ioc a b)

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

Set.Bounded (fun x x_1 => x < x_1) (Set.Ioc a b)


@[nontriviality]
theorem subsingleton [Subsingleton B] : minpoly A x = 1

(A : Type u_1)
{B : Type u_2}
[CommRing A]
[Ring B]
[Algebra A B]
(x : B)
[Subsingleton B]


/-- Two coproducts which differ by an equivalence in the indexing type,
and up to isomorphism in the factors, are isomorphic.
-/
@[simps]
def Sigma.whiskerEquiv {J K : Type*} {f : J → C} {g : K → C} (e : J ≃ K) (w : ∀ j, g (e j) ≅ f j)
    [HasCoproduct f] [HasCoproduct g] : ∐ f ≅ ∐ g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{J : Type u_1}
{K : Type u_2}
{f : J → C}
{g : K → C}
(e : J ≃ K)
(w : (j : J) → g (e j) ≅ f j)
[CategoryTheory.Limits.HasCoproduct f]
[CategoryTheory.Limits.HasCoproduct g]

(CategoryTheory.Limits.Sigma.whiskerEquiv e w).inv =
  CategoryTheory.Limits.Sigma.map' ⇑e.symm fun k => CategoryTheory.eqToHom ⋯ ≫ (w (e.symm k)).hom


theorem IsNormal.le_iff_deriv {f} (H : IsNormal f) {a} : f a ≤ a ↔ ∃ o, deriv f o = a

{f : Ordinal.{u_1} → Ordinal.{u_1}}
(H : Ordinal.IsNormal f)
{a : Ordinal.{u_1}}


@[simp]
theorem distortion_biUnionPrepartition (π : TaggedPrepartition I) (πi : ∀ J, Prepartition J) :
    (π.biUnionPrepartition πi).distortion = π.boxes.sup fun J => (πi J).distortion

(πi : (J : BoxIntegral.Box ι) → BoxIntegral.Prepartition J)


theorem noetherianSpace_TFAE :
    TFAE [NoetherianSpace α,
      WellFounded fun s t : Closeds α => s < t,
      ∀ s : Set α, IsCompact s,
      ∀ s : Opens α, IsCompact (s : Set α)]

[TopologicalSpace.NoetherianSpace α, WellFounded fun s t => s < t, ∀ (s : Set α), IsCompact s,
    ∀ (s : TopologicalSpace.Opens α), IsCompact ↑s].TFAE


@[simp]
theorem types_comp_apply {X Y Z : Type u} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : (f ≫ g) x = g (f x)

CategoryTheory.CategoryStruct.comp f g x = g (f x)


@[to_additive]
theorem period_le_orderOf {m : M} (order_pos : 0 < orderOf m) (a : α) :
    period m a ≤ orderOf m

{α : Type v}
{M : Type u}
[AddMonoid M]
[AddAction M α]
{m : M}
(order_pos : 0 < addOrderOf m)
(a : α)


theorem map_coord_zero {m : ι → M} (i : ι) (h : m i = 0) : f m = 0

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
(f : M [⋀^ι]→ₗ[R] N)
{m : ι → M}
(i : ι)
(h : m i = 0)


/-- The embedding from `down ℕ` to `up ℤ` which sends `n : ℕ` to `p - n`. -/
@[simps!]
def embeddingUpIntLE : Embedding (down ℕ) (up ℤ)

(ComplexShape.embeddingUpIntLE p).f n = p - ↑n


@[to_additive]
theorem prod_sigma' {σ : α → Type*} (s : Finset α) (t : ∀ a, Finset (σ a)) (f : ∀ a, σ a → β) :
    (∏ a ∈ s, ∏ s ∈ t a, f a s) = ∏ x ∈ s.sigma t, f x.1 x.2

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
{σ : α → Type u_6}
(s : Finset α)
(t : (a : α) → Finset (σ a))
(f : (a : α) → σ a → β)

∑ a ∈ s, ∑ s ∈ t a, f a s = ∑ x ∈ s.sigma t, f x.fst x.snd


/-- If `π` is a partition of `I`, then there exists a finite set `s` of hyperplanes such that
`splitMany I s ≤ π`. -/
theorem IsPartition.exists_splitMany_le {I : Box ι} {π : Prepartition I} (h : IsPartition π) :
    ∃ s, splitMany I s ≤ π

{ι : Type u_1}
[Finite ι]
{I : BoxIntegral.Box ι}
{π : BoxIntegral.Prepartition I}
(h : π.IsPartition)

∃ s, BoxIntegral.Prepartition.splitMany I s ≤ π


theorem Coprime.coprime_mul_right (H : Coprime (m * k) n) : Coprime m n


theorem lie_top_eq_of_span_sup_eq_top (N : LieSubmodule R L M) :
    (↑⁅(⊤ : LieIdeal R L), N⁆ : Submodule R M) =
      (N : Submodule R M).map (toEnd R L M x) ⊔ (↑⁅I, N⁆ : Submodule R M)

(hxI : Submodule.span R {x} ⊔ (lieIdealSubalgebra R L I).toSubmodule = ⊤)

↑⁅⊤, N⁆ = Submodule.map ((LieModule.toEnd R L M) x) ↑N ⊔ ↑⁅I, N⁆


@[simp]
theorem map_nil (f : α → β) : map f nil = nil

Stream'.WSeq.map f Stream'.WSeq.nil = Stream'.WSeq.nil


@[simp]
theorem sign_extendDomain (e : Perm α) {p : β → Prop} [DecidablePred p] (f : α ≃ Subtype p) :
    Equiv.Perm.sign (e.extendDomain f) = Equiv.Perm.sign e

{α : Type u}
[DecidableEq α]
{β : Type v}
[Fintype α]
[DecidableEq β]
[Fintype β]
(e : Equiv.Perm α)
{p : β → Prop}
[DecidablePred p]
(f : α ≃ Subtype p)


theorem isCoprime_mul_unit_right : IsCoprime (y * x) (z * x) ↔ IsCoprime y z

{R : Type u_1}
[CommSemiring R]
{x : R}
(hu : IsUnit x)
(y z : R)


/-- An `R`-module `M` is flat iff for all finitely generated ideals `I` of `R`, the
tensor product of the inclusion `I → R` and the identity `M → M` is injective. See
`iff_rTensor_injective'` to extend to all ideals `I`. --/
lemma iff_rTensor_injective :
    Flat R M ↔ ∀ ⦃I : Ideal R⦄ (_ : I.FG), Function.Injective (rTensor M I.subtype)

(R : Type u)
(M : Type v)
[CommRing R]
[AddCommGroup M]
[Module R M]

Module.Flat R M ↔ ∀ ⦃I : Ideal R⦄, I.FG → Function.Injective ⇑(LinearMap.rTensor M (Submodule.subtype I))


theorem integral_Ioi_cpow_of_lt {a : ℂ} (ha : a.re < -1) {c : ℝ} (hc : 0 < c) :
    (∫ t : ℝ in Ioi c, (t : ℂ) ^ a) = -(c : ℂ) ^ (a + 1) / (a + 1)

∫ (t : ℝ) in Set.Ioi c, ↑t ^ a = -↑c ^ (a + 1) / (a + 1)


theorem Measurable.prod_map [MeasurableSpace δ] {f : α → β} {g : γ → δ} (hf : Measurable f)
    (hg : Measurable g) : Measurable (Prod.map f g)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{mγ : MeasurableSpace γ}
[MeasurableSpace δ]
{f : α → β}
{g : γ → δ}
(hf : Measurable f)
(hg : Measurable g)


lemma Indep.not_mem_closure_iff_of_not_mem (hI : M.Indep I) (heI : e ∉ I)
    (he : e ∈ M.E := by aesop_mat) : e ∉ M.closure I ↔ M.Indep (insert e I)

{α : Type u_2}
{M : Matroid α}
{e : α}
{I : Set α}
(hI : M.Indep I)
(heI : e ∉ I)
(he : e ∈ M.E := by aesop_mat)


theorem floor_congr (h : ∀ n : ℤ, (n : α) ≤ a ↔ (n : β) ≤ b) : ⌊a⌋ = ⌊b⌋

{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedRing β]
[FloorRing α]
[FloorRing β]
{a : α}
{b : β}
(h : ∀ (n : ℤ), ↑n ≤ a ↔ ↑n ≤ b)


theorem dens_stable_of_terminated (n_le_m : n ≤ m) (terminatedAt_n : g.TerminatedAt n) :
    g.dens m = g.dens n

{K : Type u_1}
{g : GenContFract K}
{n m : ℕ}
[DivisionRing K]
(n_le_m : n ≤ m)
(terminatedAt_n : g.TerminatedAt n)


theorem length_eraseIdx_add_one {l : List ι} {i : ℕ} (h : i < l.length) :
    (l.eraseIdx i).length + 1 = l.length

{ι : Type u_1}
{l : List ι}
{i : ℕ}
(h : i < l.length)


theorem sqrt_eq_iff_mul_self_eq (hx : 0 ≤ x) (hy : 0 ≤ y) : √x = y ↔ y * y = x


private theorem eisenstein_lemma_aux₁ (p : ℕ) [Fact p.Prime] [hp2 : Fact (p % 2 = 1)] {a : ℕ}
    (hap : (a : ZMod p) ≠ 0) : ((∑ x ∈ Ico 1 (p / 2).succ, a * x : ℕ) : ZMod 2) =
    ((Ico 1 (p / 2).succ).filter fun x : ℕ => p / 2 < (a * x : ZMod p).val).card +
      ∑ x ∈ Ico 1 (p / 2).succ, x + (∑ x ∈ Ico 1 (p / 2).succ, a * x / p : ℕ)

(p : ℕ)
[Fact (Nat.Prime p)]
[hp2 : Fact (p % 2 = 1)]
{a : ℕ}
(hap : ↑a ≠ 0)

↑(∑ x ∈ Finset.Ico 1 (p / 2).succ, a * x) =
  ↑(Finset.filter (fun x => p / 2 < (↑a * ↑x).val) (Finset.Ico 1 (p / 2).succ)).card +
      ↑(∑ x ∈ Finset.Ico 1 (p / 2).succ, x) +
    ↑(∑ x ∈ Finset.Ico 1 (p / 2).succ, a * x / p)


theorem HasStrictFDerivAt.isBigO_sub (hf : HasStrictFDerivAt f f' x) :
    (fun p : E × E => f p.1 - f p.2) =O[𝓝 (x, x)] fun p : E × E => p.1 - p.2

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


theorem smooth_smul {g : M → F} {i} (hg : ∀ x ∈ tsupport (f i), SmoothAt I 𝓘(ℝ, F) g x) :
    Smooth I 𝓘(ℝ, F) fun x => f i x • g x

(hg : ∀ x ∈ tsupport ⇑(f i), SmoothAt I 𝓘(ℝ, F) g x)


theorem derivative_coe (f : R[X]) : d⁄dX R f = Polynomial.derivative f

{R : Type u_1}
[CommSemiring R]
(f : Polynomial R)

(PowerSeries.derivative R) ↑f = ↑(Polynomial.derivative f)


theorem smul_sup : I • (N ⊔ P) = I • N ⊔ I • P

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(I : Ideal R)
(N P : Submodule R M)


theorem mapIdx_append (K L : List α) (f : ℕ → α → β) :
    (K ++ L).mapIdx f = K.mapIdx f ++ L.mapIdx fun i a ↦ f (i + K.length) a

{α : Type u}
{β : Type v}
(K L : List α)
(f : ℕ → α → β)

List.mapIdx f (K ++ L) = List.mapIdx f K ++ List.mapIdx (fun i a => f (i + K.length) a) L


lemma ltByCases_congr {x' y' : α} {h₁ : x < y → P} {h₂ : x = y → P} {h₃ : y < x → P}
    {h₁' : x' < y' → P} {h₂' : x' = y' → P} {h₃' : y' < x' → P} (ltc : (x < y) ↔ (x' < y'))
    (gtc : (y < x) ↔ (y' < x')) (hh'₁ : ∀ (h : x' < y'), h₁ (ltc.mpr h) = h₁' h)
    (hh'₂ : ∀ (h : x' = y'), h₂ ((eq_iff_eq_of_lt_iff_lt_of_gt_iff_gt ltc gtc).mpr h) = h₂' h)
    (hh'₃ : ∀ (h : y' < x'), h₃ (gtc.mpr h) = h₃' h) :
    ltByCases x y h₁ h₂ h₃ = ltByCases x' y' h₁' h₂' h₃'

{α : Type u_2}
[LinearOrder α]
{P : Sort u_5}
{x y x' y' : α}
{h₁ : x < y → P}
{h₂ : x = y → P}
{h₃ : y < x → P}
{h₁' : x' < y' → P}
{h₂' : x' = y' → P}
{h₃' : y' < x' → P}
(ltc : x < y ↔ x' < y')
(gtc : y < x ↔ y' < x')
(hh'₁ : ∀ (h : x' < y'), h₁ ⋯ = h₁' h)
(hh'₂ : ∀ (h : x' = y'), h₂ ⋯ = h₂' h)
(hh'₃ : ∀ (h : y' < x'), h₃ ⋯ = h₃' h)


theorem eq_pure_of_finite_mem (h : s.Finite) (h' : s ∈ f) : ∃ x ∈ s, f = pure x

{α : Type u}
{f : Ultrafilter α}
{s : Set α}
(h : s.Finite)
(h' : s ∈ f)


private irreducible_def one : RingQuot r

{R : Type u_1}
[Semiring R]
(r : R → R → Prop)

RingQuot.one r = { toQuot := Quot.mk (RingQuot.Rel r) 1 }


@[to_additive] lemma zpow_le_zpow_iff' (hn : 0 < n) : a ^ n ≤ b ^ n ↔ a ≤ b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{n : ℤ}
{a b : α}
(hn : 0 < n)


@[simp]
theorem rootSpaceProduct_def : rootSpaceProduct R L H = rootSpaceWeightSpaceProduct R L H L

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(H : LieSubalgebra R L)
[LieAlgebra.IsNilpotent R ↥H]

LieAlgebra.rootSpaceProduct R L H = LieAlgebra.rootSpaceWeightSpaceProduct R L H L


/-- The inf of a set of orthogonal subspaces equals the subspace orthogonal to the sup. -/
theorem sInf_orthogonal (s : Set <| Submodule 𝕜 E) : ⨅ K ∈ s, Kᗮ = (sSup s)ᗮ

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(s : Set (Submodule 𝕜 E))


lemma Odd.eval_neg (x : ZMod m) (hψ : ψ.Odd) : ψ (- x) = - ψ x

{S : Type}
[CommRing S]
{m : ℕ}
(ψ : DirichletCharacter S m)
(x : ZMod m)
(hψ : ψ.Odd)


@[simp]
theorem supSpanSingleton_apply_mk (f : E →ₗ.[K] F) (x : E) (y : F) (hx : x ∉ f.domain) (x' : E)
    (hx' : x' ∈ f.domain) (c : K) :
    f.supSpanSingleton x y hx
        ⟨x' + c • x, mem_sup.2 ⟨x', hx', _, mem_span_singleton.2 ⟨c, rfl⟩, rfl⟩⟩ =
      f ⟨x', hx'⟩ + c • y

{E : Type u_2}
[AddCommGroup E]
{F : Type u_3}
[AddCommGroup F]
{K : Type u_5}
[DivisionRing K]
[Module K E]
[Module K F]
(f : E →ₗ.[K] F)
(x : E)
(y : F)
(hx : x ∉ f.domain)
(x' : E)
(hx' : x' ∈ f.domain)
(c : K)

↑(f.supSpanSingleton x y hx) ⟨x' + c • x, ⋯⟩ = ↑f ⟨x', hx'⟩ + c • y


theorem QuasiconvexOn.convex_lt (hf : QuasiconvexOn 𝕜 s f) (r : β) :
    Convex 𝕜 ({ x ∈ s | f x < r })

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrder β]
[SMul 𝕜 E]
{s : Set E}
{f : E → β}
(hf : QuasiconvexOn 𝕜 s f)
(r : β)


theorem infs_inter_subset_left : (s₁ ∩ s₂) ⊼ t ⊆ s₁ ⊼ t ∩ s₂ ⊼ t

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

(s₁ ∩ s₂) ⊼ t ⊆ s₁ ⊼ t ∩ s₂ ⊼ t


theorem inf'_le_of_le {a : α} {b : β} (hb : b ∈ s) (h : f b ≤ a) :
    s.inf' ⟨b, hb⟩ f ≤ a

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
{s : Finset β}
(f : β → α)
{a : α}
{b : β}
(hb : b ∈ s)
(h : f b ≤ a)


theorem integrableOn_Ioi_cpow_of_lt {a : ℂ} (ha : a.re < -1) {c : ℝ} (hc : 0 < c) :
    IntegrableOn (fun t : ℝ => (t : ℂ) ^ a) (Ioi c)

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


/-- Constants are `C^∞`.
-/
theorem contDiff_const {c : F} : ContDiff 𝕜 n fun _ : E => c

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{c : F}


theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b)
    (hf : f =O[atBot] fun x : ℝ => |x| ^ (-b)) (R S : ℝ) :
    (fun x : ℝ => ‖f.restrict (Icc (x + R) (x + S))‖) =O[atBot] fun x : ℝ => |x| ^ (-b)

(hf : ⇑f =O[Filter.atBot] fun x => |x| ^ (-b))

(fun x => ‖ContinuousMap.restrict (Set.Icc (x + R) (x + S)) f‖) =O[Filter.atBot] fun x => |x| ^ (-b)


theorem comp_right {α β γ δ : Sort*} {f : α → β} {g : α → γ} (h : FactorsThrough g f) (g' : δ → α) :
    FactorsThrough (g ∘ g') (f ∘ g')

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{δ : Sort u_4}
{f : α → β}
{g : α → γ}
(h : Function.FactorsThrough g f)
(g' : δ → α)

Function.FactorsThrough (g ∘ g') (f ∘ g')


protected theorem Adj.snd_mem {H : G.Subgraph} {u v : V} (h : H.Adj u v) : v ∈ H.verts

{V : Type u}
{G : SimpleGraph V}
{H : G.Subgraph}
{u v : V}
(h : H.Adj u v)


theorem comp₁ {n} (f : ℕ →. ℕ) {g : Vector ℕ n → ℕ} (hf : @Partrec' 1 fun v => f v.head)
    (hg : @Partrec' n g) : @Partrec' n fun v => f (g v)

{n : ℕ}
(f : ℕ →. ℕ)
{g : Mathlib.Vector ℕ n → ℕ}
(hf : Nat.Partrec' fun v => f v.head)
(hg : Nat.Partrec' ↑g)


@[measurability, fun_prop]
lemma AEMeasurable.ennreal_ofReal {f : α → ℝ} {μ : Measure α} (hf : AEMeasurable f μ) :
    AEMeasurable (fun x ↦ ENNReal.ofReal (f x)) μ

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℝ}
{μ : MeasureTheory.Measure α}
(hf : AEMeasurable f μ)

AEMeasurable (fun x => ENNReal.ofReal (f x)) μ


/-- A set is ample iff its image under a continuous affine equivalence is. -/
theorem image_iff {s : Set E} (L : E ≃ᵃL[ℝ] F) :
    AmpleSet (L '' s) ↔ AmpleSet s

{F : Type u_1}
[AddCommGroup F]
[Module ℝ F]
[TopologicalSpace F]
{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
{s : Set E}
(L : E ≃ᵃL[ℝ] F)


@[simp]
theorem pi_univ (s : Set ι) : (pi s fun i => (univ : Set (α i))) = univ

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


theorem signBijAux_mem {n : ℕ} {f : Perm (Fin n)} :
    ∀ a : Σ_ : Fin n, Fin n, a ∈ finPairsLT n → signBijAux f a ∈ finPairsLT n

{n : ℕ}
{f : Equiv.Perm (Fin n)}
(a : (_ : Fin n) × Fin n)

a ∈ Equiv.Perm.finPairsLT n → f.signBijAux a ∈ Equiv.Perm.finPairsLT n


theorem conj_cpow (x : ℂ) (n : ℂ) (hx : x.arg ≠ π) : conj x ^ n = conj (x ^ conj n)

(starRingEnd ℂ) x ^ n = (starRingEnd ℂ) (x ^ (starRingEnd ℂ) n)


theorem continuousOn_ceil (n : ℤ) :
    ContinuousOn (fun x => ceil x : α → α) (Ioc (n - 1) n : Set α)

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
(n : ℤ)

ContinuousOn (fun x => ↑⌈x⌉) (Set.Ioc (↑n - 1) ↑n)


theorem measure_sum_seq (κ : Kernel α β) [h : IsSFiniteKernel κ] (a : α) :
    (Measure.sum fun n => seq κ n a) = κ a

[h : ProbabilityTheory.IsSFiniteKernel κ]

(MeasureTheory.Measure.sum fun n => (κ.seq n) a) = κ a


theorem zpow_add_of_nonpos {A : M} {m n : ℤ} (hm : m ≤ 0) (hn : n ≤ 0) :
    A ^ (m + n) = A ^ m * A ^ n

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
{A : Matrix n' n' R}
{m n : ℤ}
(hm : m ≤ 0)
(hn : n ≤ 0)


theorem lt_aleph0_of_finite {ι : Type w}
    [Module.Finite R M] {v : ι → M} (h : LinearIndependent R v) : #ι < ℵ₀

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
{ι : Type w}
[Module.Finite R M]
{v : ι → M}
(h : LinearIndependent R v)


theorem _root_.LieModule.isNilpotent_iff_exists_ucs_eq_top :
    LieModule.IsNilpotent R L M ↔ ∃ k, (⊥ : LieSubmodule R L M).ucs k = ⊤

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]

LieModule.IsNilpotent R L M ↔ ∃ k, LieSubmodule.ucs k ⊥ = ⊤


theorem algebra_adjoin_le_adjoin : Algebra.adjoin F S ≤ (adjoin F S).toSubalgebra

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

Algebra.adjoin F S ≤ (IntermediateField.adjoin F S).toSubalgebra


@[simp]
-- Porting note: `simp`-normal form of `coe_comp_inf_hom`
theorem coe_comp_inf_hom' (f : BoundedLatticeHom β γ) (g : BoundedLatticeHom α β) :
    ⟨f ∘ g, map_inf (f.comp g)⟩ = (f : InfHom β γ).comp g

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Lattice α]
[Lattice β]
[Lattice γ]
[BoundedOrder α]
[BoundedOrder β]
[BoundedOrder γ]
(f : BoundedLatticeHom β γ)
(g : BoundedLatticeHom α β)

{ toFun := ⇑f ∘ ⇑g, map_inf' := ⋯ } = { toFun := ⇑f, map_inf' := ⋯ }.comp { toFun := ⇑g, map_inf' := ⋯ }


theorem coyonedaEquiv_apply {X : C} {F : C ⥤ Type v₁} (f : coyoneda.obj (op X) ⟶ F) :
    coyonedaEquiv f = f.app X (𝟙 X)

{F : CategoryTheory.Functor C (Type v₁)}

(f : CategoryTheory.coyoneda.obj (Opposite.op X) ⟶ F)

CategoryTheory.coyonedaEquiv f = f.app X (CategoryTheory.CategoryStruct.id X)


@[simp]
theorem toFun_eq_coe (f : A →ₛₙₐ[φ] B) : f.toFun = ⇑f

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


@[simp]
lemma sUnion_memPartition (f : ℕ → Set α) (n : ℕ) : ⋃₀ memPartition f n = univ


@[simps (config := .lemmasOnly)]
instance instMonoidalCategoryStruct : MonoidalCategoryStruct (ModuleCat.{u} R)

∀ {X₁ X₂ : ModuleCat R} (f : X₁ ⟶ X₂) (N : ModuleCat R),
  CategoryTheory.MonoidalCategory.whiskerRight f N = ModuleCat.MonoidalCategory.whiskerRight f N


@[simp]
theorem numDerangements_zero : numDerangements 0 = 1


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

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

((CategoryTheory.Idempotents.KaroubiKaroubi.inverse C).obj P).p = P.p.f


@[simp]
theorem det_fin_two_of (a b c d : R) : Matrix.det !![a, b; c, d] = a * d - b * c


lemma primesBelow_succ (n : ℕ) :
    primesBelow n.succ = if n.Prime then insert n (primesBelow n) else primesBelow n

n.succ.primesBelow = if Nat.Prime n then insert n n.primesBelow else n.primesBelow


theorem map_modByMonic [Ring S] (f : R →+* S) (hq : Monic q) :
    (p %ₘ q).map f = p.map f %ₘ q.map f

{R : Type u}
{S : Type v}
[Ring R]
{p q : R[X]}
[Ring S]
(f : R →+* S)
(hq : q.Monic)

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


theorem iUnion_Ico_add_intCast : ⋃ n : ℤ, Ico (a + n) (a + n + 1) = Set.univ

{α : Type u_1}
[LinearOrderedRing α]
[Archimedean α]
(a : α)

⋃ n, Set.Ico (a + ↑n) (a + ↑n + 1) = Set.univ


theorem ne_zero_of_finite {a b : α} (h : Finite a b) : b ≠ 0

{α : Type u_1}
[MonoidWithZero α]
{a b : α}
(h : multiplicity.Finite a b)


theorem cos_pi_div_two_sub (θ : Angle) : cos (↑(π / 2) - θ) = sin θ


@[to_additive]
theorem prod_map_inv' (m : Multiset α) : (m.map Inv.inv).prod = m.prod⁻¹

{α : Type u_3}
[SubtractionCommMonoid α]
(m : Multiset α)


@[simp] lemma coe_toLatticeHom (f : BoundedLatticeHom α β) : ⇑f.toLatticeHom = f

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
[BoundedOrder α]
[BoundedOrder β]
(f : BoundedLatticeHom α β)


@[simp]
theorem inclusion_mk {S T : NonUnitalSubalgebra R A} (h : S ≤ T) (x : A) (hx : x ∈ S) :
    inclusion h ⟨x, hx⟩ = ⟨x, h hx⟩

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{S T : NonUnitalSubalgebra R A}
(h : S ≤ T)
(x : A)
(hx : x ∈ S)

(NonUnitalSubalgebra.inclusion h) ⟨x, hx⟩ = ⟨x, ⋯⟩


theorem isScalarTower_of_algebra_moduleCat (M : ModuleCat.{v} A) : IsScalarTower k A M

{k : Type u}
[Field k]
{A : Type w}
[Ring A]
[Algebra k A]
(M : ModuleCat A)


@[simp]
theorem const.mk_get (x : const n A α) : const.mk n (const.get x) = x

{n : ℕ}
{A : Type u}
{α : TypeVec.{u} n}
(x : ↑(MvPFunctor.const n A) α)

MvPFunctor.const.mk n (MvPFunctor.const.get x) = x


@[to_additive]
theorem mk_lt_mk : mk a₁ a₂ < mk b₁ b₂ ↔ ↑b₂ * a₁ < a₂ * b₁

{α : Type u_1}
[OrderedCancelCommMonoid α]
{s : Submonoid α}
{a₁ b₁ : α}
{a₂ b₂ : ↥s}

Localization.mk a₁ a₂ < Localization.mk b₁ b₂ ↔ ↑b₂ * a₁ < ↑a₂ * b₁


theorem starConvex_zero_iff :
    StarConvex 𝕜 0 s ↔ ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃a : 𝕜⦄, 0 ≤ a → a ≤ 1 → a • x ∈ s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommMonoid E]
[SMulWithZero 𝕜 E]
{s : Set E}


/-- Taking a product over `univ.pi t` is the same as taking the product over `Fintype.piFinset t`.
`univ.pi t` and `Fintype.piFinset t` are essentially the same `Finset`, but differ
in the type of their element, `univ.pi t` is a `Finset (Π a ∈ univ, t a)` and
`Fintype.piFinset t` is a `Finset (Π a, t a)`. -/
@[to_additive "Taking a sum over `univ.pi t` is the same as taking the sum over
`Fintype.piFinset t`. `univ.pi t` and `Fintype.piFinset t` are essentially the same `Finset`,
but differ in the type of their element, `univ.pi t` is a `Finset (Π a ∈ univ, t a)` and
`Fintype.piFinset t` is a `Finset (Π a, t a)`."]
lemma prod_univ_pi [DecidableEq ι] [Fintype ι] {κ : ι → Type*} (t : ∀ i, Finset (κ i))
    (f : (∀ i ∈ (univ : Finset ι), κ i) → β) :
    ∏ x ∈ univ.pi t, f x = ∏ x ∈ Fintype.piFinset t, f fun a _ ↦ x a

(f : ((i : ι) → i ∈ Finset.univ → κ i) → β)

∑ x ∈ Finset.univ.pi t, f x = ∑ x ∈ Fintype.piFinset t, f fun a x_1 => x a


@[to_additive sum_nonneg]
theorem one_le_prod' (h : ∀ i ∈ s, 1 ≤ f i) : 1 ≤ ∏ i ∈ s, f i

{ι : Type u_1}
{N : Type u_5}
[OrderedCommMonoid N]
{f : ι → N}
{s : Finset ι}
(h : ∀ i ∈ s, 1 ≤ f i)


theorem map_mk_nhdsWithin_preimage (s : Set (SeparationQuotient X)) (x : X) :
    map mk (𝓝[mk ⁻¹' s] x) = 𝓝[s] mk x

{X : Type u_1}
[TopologicalSpace X]
(s : Set (SeparationQuotient X))
(x : X)

Filter.map SeparationQuotient.mk (𝓝[SeparationQuotient.mk ⁻¹' s] x) = 𝓝[s] SeparationQuotient.mk x


theorem integralClosure_eq_bot_iff (hRA : Function.Injective (algebraMap R A)) :
    integralClosure R A = ⊥ ↔ IsIntegrallyClosedIn R A

(hRA : Function.Injective ⇑(algebraMap R A))


theorem embedding_subtype_val : Embedding ((↑) : Subtype p → X)

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


@[to_additive (attr := simp)]
theorem inv_le_inv_iff : a⁻¹ ≤ b⁻¹ ↔ b ≤ a

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

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

a⁻¹ ≤ b⁻¹ ↔ b ≤ a


/-- Given a short exact short complex `S : HomologicalComplex C c`, and degrees `i` and `j`
such that `c.Rel i j`, this is the snake diagram whose four lines are respectively
obtained by applying the functors `homologyFunctor C c i`, `opcyclesFunctor C c i`,
`cyclesFunctor C c j`, `homologyFunctor C c j` to `S`. Applying the snake lemma to this
gives the homology sequence of `S`. -/
@[simps]
noncomputable def snakeInput : ShortComplex.SnakeInput C

{S : CategoryTheory.ShortComplex (HomologicalComplex C c)}

(HomologicalComplex.HomologySequence.snakeInput hS i j hij).v₁₂ =
  S.mapNatTrans (HomologicalComplex.natTransOpCyclesToCycles C c i j)


@[simp]
theorem mem_lists_iff_coe_eq {s : Cycle α} {l : List α} : l ∈ s.lists ↔ (l : Cycle α) = s

{α : Type u_1}
{s : Cycle α}
{l : List α}


theorem isUnit_or_isUnit [Monoid α] {p : α} (hp : Irreducible p) {a b : α} (h : p = a * b) :
    IsUnit a ∨ IsUnit b

{α : Type u_1}
[Monoid α]
{p : α}
(hp : Irreducible p)
{a b : α}
(h : p = a * b)


/-- The function type `Bool → α` is equivalent to `α × α`. -/
@[simps]
def boolArrowEquivProd (α) : (Bool → α) ≃ α × α

(Equiv.boolArrowEquivProd α) f = (f false, f true)


/-- The product of group homomorphisms is a group homomorphism if the target is commutative. -/
@[to_additive
      "The sum of two additive group homomorphisms is an additive group homomorphism
      if the target is commutative."]
theorem mul {α β} [Group α] [CommGroup β] {f g : α → β} (hf : IsGroupHom f) (hg : IsGroupHom g) :
    IsGroupHom fun a => f a * g a

{α : Type u_1}
{β : Type u_2}
[AddGroup α]
[AddCommGroup β]
{f g : α → β}
(hf : IsAddGroupHom f)
(hg : IsAddGroupHom g)


/-- The kernel of `biprod.fst : X ⊞ Y ⟶ X` is `Y`. -/
@[simps!]
def kernelBiprodFstIso : kernel (biprod.fst : X ⊞ Y ⟶ X) ≅ Y

CategoryTheory.Limits.kernelBiprodFstIso.inv =
  CategoryTheory.Limits.limit.lift (CategoryTheory.Limits.parallelPair CategoryTheory.Limits.biprod.fst 0)
    (CategoryTheory.Limits.biprod.fstKernelFork X Y)


@[to_additive]
protected theorem div_le_div : f₁ ≤ f₂ → g₁ ≤ g₂ → f₁ / g₁ ≤ f₂ / g₂

{α : Type u_2}
[Sub α]
{f₁ f₂ g₁ g₂ : Filter α}

f₁ ≤ f₂ → g₁ ≤ g₂ → f₁ - g₁ ≤ f₂ - g₂


/-- `Opens.map f` and `OpenNhds.map f` form a commuting square (up to natural isomorphism)
with the inclusion functors into `Opens X`. -/
@[simps! hom_app inv_app]
def inclusionMapIso (x : X) : inclusion (f x) ⋙ Opens.map f ≅ map f x ⋙ inclusion x

∀ (X_1 : TopologicalSpace.OpenNhds (f x)),
  (TopologicalSpace.OpenNhds.inclusionMapIso f x).hom.app X_1 =
    𝟙 ((TopologicalSpace.Opens.map f).obj ((TopologicalSpace.OpenNhds.inclusion (f x)).obj X_1))


@[simp]
theorem vadd_segment [AddTorsor G E] [VAddCommClass G E E] (a : G) (b c : E) :
    a +ᵥ [b -[𝕜] c] = [a +ᵥ b -[𝕜] a +ᵥ c]

(𝕜 : Type u_1)
{E : Type u_2}
{G : Type u_4}
[OrderedRing 𝕜]
[AddCommGroup E]
[AddCommGroup G]
[Module 𝕜 E]
[AddTorsor G E]
[VAddCommClass G E E]
(a : G)
(b c : E)


@[simp]
theorem llcomp_apply (f : Nₗ →ₗ[R] Pₗ) (g : M →ₗ[R] Nₗ) (x : M) :
    llcomp R M Nₗ Pₗ f g x = f (g x)

{R : Type u_1}
[CommSemiring R]
{M : Type u_5}
{Nₗ : Type u_10}
{Pₗ : Type u_11}
[AddCommMonoid M]
[AddCommMonoid Nₗ]
[AddCommMonoid Pₗ]
[Module R M]
[Module R Nₗ]
[Module R Pₗ]
(f : Nₗ →ₗ[R] Pₗ)
(g : M →ₗ[R] Nₗ)
(x : M)

(((LinearMap.llcomp R M Nₗ Pₗ) f) g) x = f (g x)


/--  `Fin.succAbove p` as an `Embedding`. -/
@[simps!]
def succAboveEmb (p : Fin (n + 1)) : Fin n ↪ Fin (n + 1)


theorem antidiagonal.fst_lt {n : ℕ} {kl : ℕ × ℕ} (hlk : kl ∈ antidiagonal n) : kl.1 < n + 1

{n : ℕ}
{kl : ℕ × ℕ}
(hlk : kl ∈ Finset.antidiagonal n)


/-- The norm of a function is controlled by the supremum of the pointwise norms. -/
theorem norm_le {C : ℝ} (C0 : (0 : ℝ) ≤ C) : ‖f‖ ≤ C ↔ ∀ x : α, ‖f x‖ ≤ C

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
(f : C(α, E))
{C : ℝ}
(C0 : 0 ≤ C)


theorem Monic.nextCoeff_multiset_prod (t : Multiset ι) (f : ι → R[X]) (h : ∀ i ∈ t, Monic (f i)) :
    nextCoeff (t.map f).prod = (t.map fun i => nextCoeff (f i)).sum

{R : Type u}
{ι : Type y}
[CommSemiring R]
(t : Multiset ι)
(f : ι → R[X])
(h : ∀ i ∈ t, (f i).Monic)

(Multiset.map f t).prod.nextCoeff = (Multiset.map (fun i => (f i).nextCoeff) t).sum


theorem dart_card_eq_twice_card_edges : Fintype.card G.Dart = 2 * G.edgeFinset.card

{V : Type u}
(G : SimpleGraph V)
[Fintype V]
[DecidableRel G.Adj]
[Fintype (Sym2 V)]


theorem ae_eq_set_union {s' t' : Set α} (h : s =ᵐ[μ] t) (h' : s' =ᵐ[μ] t') :
    (s ∪ s' : Set α) =ᵐ[μ] (t ∪ t' : Set α)

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


theorem minimalPeriod_apply (hx : x ∈ periodicPts f) : minimalPeriod f (f x) = minimalPeriod f x

{α : Type u_1}
{f : α → α}
{x : α}
(hx : x ∈ Function.periodicPts f)

Function.minimalPeriod f (f x) = Function.minimalPeriod f x


@[simp]
theorem preimage_mul_const_Ico (a b : α) {c : α} (h : 0 < c) :
    (fun x => x * c) ⁻¹' Ico a b = Ico (a / c) (b / c)

{α : Type u_1}
[LinearOrderedField α]
(a b : α)
{c : α}
(h : 0 < c)

(fun x => x * c) ⁻¹' Set.Ico a b = Set.Ico (a / c) (b / c)


lemma d₂_eq' (i₁ : I₁) {i₂ i₂' : I₂} (h : c₂.Rel i₂ i₂') (i₁₂ : I₁₂) :
    K.d₂ c₁₂ i₁ i₂ i₁₂ = ComplexShape.ε₂ c₁ c₂ c₁₂ ⟨i₁, i₂⟩ • ((K.X i₁).d i₂ i₂' ≫
    K.toGradedObject.ιMapObjOrZero (ComplexShape.π c₁ c₂ c₁₂) ⟨i₁, i₂'⟩ i₁₂)

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]
(i₁ : I₁)
{i₂ i₂' : I₂}
(h : c₂.Rel i₂ i₂')
(i₁₂ : I₁₂)

K.d₂ c₁₂ i₁ i₂ i₁₂ =
  c₁.ε₂ c₂ c₁₂ (i₁, i₂) • (K.X i₁).d i₂ i₂' ≫ K.toGradedObject.ιMapObjOrZero (c₁.π c₂ c₁₂) (i₁, i₂') i₁₂


@[simp]
theorem colimitEquivQuot_symm_apply (j : J) (x : F.obj j) :
    (colimitEquivQuot F).symm (Quot.mk _ ⟨j, x⟩) = colimit.ι F j x

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ Type u)
[CategoryTheory.Limits.HasColimit F]
(j : J)
(x : F.obj j)

(CategoryTheory.Limits.Types.colimitEquivQuot F).symm (Quot.mk (CategoryTheory.Limits.Types.Quot.Rel F) ⟨j, x⟩) =
  CategoryTheory.Limits.colimit.ι F j x


/-- We do not get `ae_fin_strongly_measurable f (μ.trim hm)`, since we don't have
`f =ᵐ[μ.trim hm] Lp_meas_to_Lp_trim F 𝕜 p μ hm f` but only the weaker
`f =ᵐ[μ] Lp_meas_to_Lp_trim F 𝕜 p μ hm f`. -/
theorem lpMeas.ae_fin_strongly_measurable' (hm : m ≤ m0) (f : lpMeas F 𝕜 m p μ) (hp_ne_zero : p ≠ 0)
    (hp_ne_top : p ≠ ∞) :
    -- Porting note: changed `f` to `f.1` in the next line. Not certain this is okay.
    ∃ g, FinStronglyMeasurable g (μ.trim hm) ∧ f.1 =ᵐ[μ] g

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

∃ g, MeasureTheory.FinStronglyMeasurable g (μ.trim hm) ∧ ↑↑↑f =ᵐ[μ] g


lemma HurwitzZeta.completedHurwitzZetaEven₀_zero (s : ℂ) :
    completedHurwitzZetaEven₀ 0 s = completedRiemannZeta₀ s

HurwitzZeta.completedHurwitzZetaEven₀ 0 s = completedRiemannZeta₀ s


/-- `point_weights_with_circumcenter` sums to 1. -/
@[simp]
theorem sum_pointWeightsWithCircumcenter {n : ℕ} (i : Fin (n + 1)) :
    ∑ j, pointWeightsWithCircumcenter i j = 1

∑ j : Affine.Simplex.PointsWithCircumcenterIndex n, Affine.Simplex.pointWeightsWithCircumcenter i j = 1


theorem rightOp {W : MorphismProperty C} {L : Cᵒᵖ ⥤ D} (h : W.op.IsInvertedBy L) :
    W.IsInvertedBy L.rightOp

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
{W : CategoryTheory.MorphismProperty C}
{L : CategoryTheory.Functor Cᵒᵖ D}
(h : W.op.IsInvertedBy L)


@[to_additive]
lemma isCompact_preimage [TopologicalSpace β]
    (h'f : HasCompactMulSupport f) (hf : Continuous f) {k : Set β} (hk : IsClosed k)
    (h'k : 1 ∉ k) : IsCompact (f ⁻¹' k)

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[Zero β]
{f : α → β}
[TopologicalSpace β]
(h'f : HasCompactSupport f)
(hf : Continuous f)
{k : Set β}
(hk : IsClosed k)
(h'k : 0 ∉ k)


@[to_additive (attr := simp)]
theorem OneHom.comp_one [One M] [One N] [One P] (f : OneHom N P) : f.comp (1 : OneHom M N) = 1

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[One M]
[One N]
[One P]
(f : OneHom N P)


lemma coverPreserving : haveI := F.reflects_precoherent
    CoverPreserving (coherentTopology _) (coherentTopology _) F

CategoryTheory.CoverPreserving (CategoryTheory.coherentTopology C) (CategoryTheory.coherentTopology D) F


@[simp]
theorem extension_comp_coe {f : Completion α → β} (hf : UniformContinuous f) :
    Completion.extension (f ∘ (↑)) = f

{α : Type u_1}
[UniformSpace α]
{β : Type u_2}
[UniformSpace β]
[T0Space β]
[CompleteSpace β]
{f : UniformSpace.Completion α → β}
(hf : UniformContinuous f)

UniformSpace.Completion.extension (f ∘ ↑α) = f


/-- The inverse in the equivalence of sheaf categories. -/
@[simps!]
def sheafCongr.inverse : Sheaf K A ⥤ Sheaf J A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[CategoryTheory.Equivalence.TransportsGrothendieckTopology J K e]

∀ {X Y : Cᵒᵖ} (f : X ⟶ Y),
  ((CategoryTheory.Equivalence.sheafCongr.inverse J K e A).obj F).val.map f = F.val.map (e.functor.map f.unop).op


theorem diagonal_hadamard_diagonal (v : n → α) (w : n → α) :
    diagonal v ⊙ diagonal w = diagonal (v * w)

{α : Type u_1}
{n : Type u_5}
[DecidableEq n]
[MulZeroClass α]
(v w : n → α)

(Matrix.diagonal v).hadamard (Matrix.diagonal w) = Matrix.diagonal (v * w)


lemma hasZeroObject_of_additive [HasZeroObject C] :
    HasZeroObject D

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
(F : CategoryTheory.Functor C D)
[F.Additive]
[CategoryTheory.Limits.HasZeroObject C]


/-- Given a natural transformation `τ : F ⟶ G` between functors `C ⥤ D` which preserve
the right homology of a short complex `S`, and a right homology data for `S`,
this is the right homology map data for the morphism `S.mapNatTrans τ`
obtained by evaluating `τ`. -/
@[simps]
def RightHomologyMapData.natTransApp (h : RightHomologyData S) (τ : F ⟶ G) :
    RightHomologyMapData (S.mapNatTrans τ) (h.map F) (h.map G)

(CategoryTheory.ShortComplex.RightHomologyMapData.natTransApp h τ).φQ = τ.app h.Q


theorem mem_set (l : List α) (n : Nat) (h : n < l.length) (a : α) :
    a ∈ l.set n a

{α : Type u_1}
(l : List α)
(n : Nat)
(h : n < l.length)
(a : α)


theorem coe_mul (f g : Module.End R M) : ⇑(f * g) = f ∘ g

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(f g : Module.End R M)


/-- A monoid homomorphism `f : M →* N` such that `f x` commutes with `f y` for all `x, y` defines
a monoid homomorphism from `Mᵐᵒᵖ`. -/
@[to_additive (attr := simps (config := .asFn))
      "An additive monoid homomorphism `f : M →+ N` such that `f x` additively commutes
      with `f y` for all `x`, `y` defines an additive monoid homomorphism from `Mᵃᵒᵖ`."]
def MonoidHom.fromOpposite {M N : Type*} [MulOneClass M] [MulOneClass N] (f : M →* N)
    (hf : ∀ x y, Commute (f x) (f y)) : Mᵐᵒᵖ →* N

{M : Type u_2}
{N : Type u_3}
[MulOneClass M]
[MulOneClass N]
(f : M →* N)
(hf : ∀ (x y : M), Commute (f x) (f y))

⇑(f.fromOpposite hf) = ⇑f ∘ MulOpposite.unop


theorem up_bijective : Bijective (@up α)


@[to_additive (attr := simp)]
theorem mul_bind (f : α → FreeGroup β) (x y : FreeGroup α) : x * y >>= f = (x >>= f) * (y >>= f)

{α β : Type u}
(f : α → FreeGroup β)
(x y : FreeGroup α)


theorem denseEmbedding_coe [T0Space α] : DenseEmbedding ((↑) : α → Completion α)

{α : Type u_1}
[UniformSpace α]
[T0Space α]


theorem le_translationNumber_of_add_le {z : ℝ} (hz : ∀ x, x + z ≤ f x) : z ≤ τ f

(f : CircleDeg1Lift)
{z : ℝ}
(hz : ∀ (x : ℝ), x + z ≤ f x)


/-- Reindex a categorical biproduct via an equivalence of the index types. -/
@[simps]
def biproduct.reindex {β γ : Type} [Finite β] (ε : β ≃ γ)
    (f : γ → C) [HasBiproduct f] [HasBiproduct (f ∘ ε)] : ⨁ f ∘ ε ≅ ⨁ f

[CategoryTheory.Limits.HasBiproduct (f ∘ ⇑ε)]

(CategoryTheory.Limits.biproduct.reindex ε f).inv =
  CategoryTheory.Limits.biproduct.lift fun b => CategoryTheory.Limits.biproduct.π f (ε b)


lemma univ_map_map :
    (univ R n).map (MvPolynomial.map f) = univ S n

{R : Type u_1}
{S : Type u_2}
(n : Type u_3)
[CommRing R]
[CommRing S]
[Fintype n]
[DecidableEq n]
(f : R →+* S)

Polynomial.map (MvPolynomial.map f) (Matrix.charpoly.univ R n) = Matrix.charpoly.univ S n


@[simp]
theorem continuousOn_lift {hf : ∀ x y, (x ~ᵢ y) → f x = f y} {s : Set (SeparationQuotient X)} :
    ContinuousOn (lift f hf) s ↔ ContinuousOn f (mk ⁻¹' s)

{hf : ∀ (x y : X), (x ~ᵢ y) → f x = f y}

ContinuousOn (SeparationQuotient.lift f hf) s ↔ ContinuousOn f (SeparationQuotient.mk ⁻¹' s)


/-- In a `p`-th cyclotomic extension of `ℚ `, we have that `ζ` is not congruent to an
  integer modulo `p` if `p ≠ 2`. -/
theorem not_exists_int_prime_dvd_sub_of_prime_ne_two'
    [hcycl : IsCyclotomicExtension {p} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑p) (hodd : p ≠ 2) :
    ¬(∃ n : ℤ, (p : 𝓞 K) ∣ (hζ.toInteger - n : 𝓞 K))

{p : ℕ+}
{K : Type u}
[Field K]
[CharZero K]
{ζ : K}
[hp : Fact (Nat.Prime ↑p)]
[hcycl : IsCyclotomicExtension {p} ℚ K]
(hζ : IsPrimitiveRoot ζ ↑p)
(hodd : p ≠ 2)


lemma ne_of_eq_of_ne {α : Sort*} {a b c : α} (h₁ : a = b) (h₂ : b ≠ c) : a ≠ c

{α : Sort u_1}
{a b c : α}
(h₁ : a = b)
(h₂ : b ≠ c)


theorem sign_apply : sign a = ite (0 < a) 1 (ite (a < 0) (-1) 0)

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

SignType.sign a = if 0 < a then 1 else if a < 0 then -1 else 0


@[to_additive]
theorem comap_iInf {ι : Sort*} (f : F) (s : ι → Submonoid N) :
    (iInf s).comap f = ⨅ i, (s i).comap f

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{ι : Sort u_5}
(f : F)
(s : ι → Submonoid N)

Submonoid.comap f (iInf s) = ⨅ i, Submonoid.comap f (s i)


lemma rel_imp : (Iff ⇒ (Iff ⇒ Iff)) (· → ·) (· → ·)

(Iff ⇒ Iff ⇒ Iff) (fun x x_1 => x → x_1) fun x x_1 => x → x_1


/-- If we consider an arithmetic function just as a function and turn it back into an
arithmetic function, it is the same as before. -/
@[simp]
lemma ArithmeticFunction.toArithmeticFunction_eq_self {R : Type*} [Zero R]
    (f : ArithmeticFunction R) :
    toArithmeticFunction f = f

{R : Type u_1}
[Zero R]
(f : ArithmeticFunction R)


/-- A continuous multilinear function `f` admits a Taylor series, whose successive terms are given
by `f.iteratedFDeriv n`. This is the point of the definition of `f.iteratedFDeriv`. -/
theorem hasFTaylorSeriesUpTo_iteratedFDeriv :
    HasFTaylorSeriesUpTo ⊤ f (fun v n ↦ f.iteratedFDeriv n v)

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

HasFTaylorSeriesUpTo ⊤ ⇑f fun v n => f.iteratedFDeriv n v


@[deprecated map_neg (since := "2024-06-26")]
protected theorem map_neg (x) : φ (-x) = -φ x

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


theorem comp_holderWith {Cg rg : ℝ≥0} {g : Y → Z} {t : Set Y} (hg : HolderOnWith Cg rg g t)
    {Cf rf : ℝ≥0} {f : X → Y} (hf : HolderWith Cf rf f) (ht : ∀ x, f x ∈ t) :
    HolderWith (Cg * Cf ^ (rg : ℝ)) (rg * rf) (g ∘ f)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
[PseudoEMetricSpace Z]
{Cg rg : ℝ≥0}
{g : Y → Z}
{t : Set Y}
(hg : HolderOnWith Cg rg g t)
{Cf rf : ℝ≥0}
{f : X → Y}
(hf : HolderWith Cf rf f)
(ht : ∀ (x : X), f x ∈ t)

HolderWith (Cg * Cf ^ ↑rg) (rg * rf) (g ∘ f)


/-- `∏ i ∈ Nat.divisors n, cyclotomic i R = X ^ n - 1`. -/
theorem prod_cyclotomic_eq_X_pow_sub_one {n : ℕ} (hpos : 0 < n) (R : Type*) [CommRing R] :
    ∏ i ∈ Nat.divisors n, cyclotomic i R = X ^ n - 1

{n : ℕ}
(hpos : 0 < n)
(R : Type u_1)
[CommRing R]

∏ i ∈ n.divisors, Polynomial.cyclotomic i R = Polynomial.X ^ n - 1


/-- Type class for noetherian spaces. It is defined to be spaces whose open sets satisfies ACC. -/
@[mk_iff]
class NoetherianSpace : Prop where
  wellFounded_opens : WellFounded ((· > ·) : Opens α → Opens α → Prop)

[self : TopologicalSpace.NoetherianSpace α]


@[simp]
theorem mapMatrix_symm (f : α ≃+* β) : f.mapMatrix.symm = (f.symm.mapMatrix : Matrix m m β ≃+* _)

{m : Type u_2}
{α : Type v}
{β : Type w}
[Fintype m]
[DecidableEq m]
[NonAssocSemiring α]
[NonAssocSemiring β]
(f : α ≃+* β)


theorem EqOn.mapsTo_iff (H : EqOn f₁ f₂ s) : MapsTo f₁ s t ↔ MapsTo f₂ s t

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


@[simp] lemma head_snoc (p : RelSeries r) (newLast : α) (rel : r p.last newLast) :
    (p.snoc newLast rel).head = p.head

{α : Type u_1}
{r : Rel α α}
(p : RelSeries r)
(newLast : α)
(rel : r p.last newLast)


theorem ContDiff.contDiffAt (h : ContDiff 𝕜 n f) : ContDiffAt 𝕜 n f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{n : ℕ∞}
(h : ContDiff 𝕜 n f)


theorem insert_pos [DecidableEq α] {x : α} {l : List α} (h : x ∈ l) : Insert.insert x l = l

{α : Type u}
[DecidableEq α]
{x : α}
{l : List α}
(h : x ∈ l)


@[simp]
lemma piecewise'_apply_right {C₀ C₁ C₂ : Set X} (h₀ : C₀ ⊆ C₁ ∪ C₂) (h₁ : IsClosed C₁)
    (h₂ : IsClosed C₂) (f₁ : LocallyConstant C₁ Z) (f₂ : LocallyConstant C₂ Z)
    [DecidablePred (· ∈ C₁)] (hf : ∀ x (hx : x ∈ C₁ ∩ C₂), f₁ ⟨x, hx.1⟩ = f₂ ⟨x, hx.2⟩)
    (x : C₀) (hx : x.val ∈ C₂) :
    piecewise' h₀ h₁ h₂ f₁ f₂ hf x = f₂ ⟨x.val, hx⟩

(hf : ∀ (x : X) (hx : x ∈ C₁ ∩ C₂), f₁ ⟨x, ⋯⟩ = f₂ ⟨x, ⋯⟩)

(LocallyConstant.piecewise' h₀ h₁ h₂ f₁ f₂ hf) x = f₂ ⟨↑x, hx⟩


@[simp]
theorem reindex_trans (e : ι ≃ ι₂) (e' : ι₂ ≃ ι₃) :
    (reindex R s e).trans (reindex R _ e') = reindex R s (e.trans e')

{ι : Type u_1}
{ι₂ : Type u_2}
{ι₃ : Type u_3}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
(e : ι ≃ ι₂)
(e' : ι₂ ≃ ι₃)

PiTensorProduct.reindex R s e ≪≫ₗ PiTensorProduct.reindex R (fun i => s (e.symm i)) e' =
  PiTensorProduct.reindex R s (e.trans e')


@[simp]
theorem eraseLead_monomial (i : ℕ) (r : R) : eraseLead (monomial i r) = 0

{R : Type u_1}
[Semiring R]
(i : ℕ)
(r : R)

((Polynomial.monomial i) r).eraseLead = 0


@[deprecated Differentiable.sub_iff_left (since := "2024-07-11")]
theorem differentiable_sub_const_iff (c : F) :
    (Differentiable 𝕜 fun y => f y - c) ↔ Differentiable 𝕜 f

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


theorem coeff_eq_zero_of_natDegree_lt {p : R[X]} {n : ℕ} (h : p.natDegree < n) :
    p.coeff n = 0

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


@[simp]
theorem comp_assoc (h : EsakiaHom γ δ) (g : EsakiaHom β γ) (f : EsakiaHom α β) :
    (h.comp g).comp f = h.comp (g.comp f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{δ : Type u_5}
[TopologicalSpace α]
[Preorder α]
[TopologicalSpace β]
[Preorder β]
[TopologicalSpace γ]
[Preorder γ]
[TopologicalSpace δ]
[Preorder δ]
(h : EsakiaHom γ δ)
(g : EsakiaHom β γ)
(f : EsakiaHom α β)


/-- The map sending a binary relation to the smallest congruence relation in which it is
    contained is idempotent. -/
theorem ringConGen_idem (r : R → R → Prop) : ringConGen (ringConGen r) = ringConGen r

{R : Type u_2}
[Add R]
[Mul R]
(r : R → R → Prop)

ringConGen ⇑(ringConGen r) = ringConGen r


theorem ergodic_nsmul_add (x : AddCircle T) {n : ℕ} (h : 1 < n) : Ergodic fun y => n • y + x

{T : ℝ}
[hT : Fact (0 < T)]
(x : AddCircle T)
{n : ℕ}
(h : 1 < n)

Ergodic (fun y => n • y + x) MeasureTheory.volume


theorem NeBot.mul_zero_nonneg (hf : f.NeBot) : 0 ≤ f * 0

{α : Type u_2}
[MulZeroClass α]
{f : Filter α}
(hf : f.NeBot)


@[simp]
theorem blockDiagonal_neg [AddGroup α] (M : o → Matrix m n α) :
    blockDiagonal (-M) = -blockDiagonal M

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[DecidableEq o]
[AddGroup α]
(M : o → Matrix m n α)

Matrix.blockDiagonal (-M) = -Matrix.blockDiagonal M


{p : ℕ}
{R : Type u_1}
{S : Type u_2}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CommRing S]
(f : R →+* S)


@[simp]
theorem zero_mulVec [Fintype n] (v : n → α) : (0 : Matrix m n α) *ᵥ v = 0

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


theorem Pairwise.and (hR : Pairwise R l) (hS : Pairwise S l) :
    l.Pairwise fun a b => R a b ∧ S a b

∀ {α : Type u_1} {R : α → α → Prop} {l : List α} {S : α → α → Prop},
  List.Pairwise R l → List.Pairwise S l → List.Pairwise (fun a b => R a b ∧ S a b) l


theorem exists_memBaseSet_isPartition (l : IntegrationParams) (I : Box ι) (hc : I.distortion ≤ c)
    (r : (ι → ℝ) → Ioi (0 : ℝ)) : ∃ π, l.MemBaseSet I c r π ∧ π.IsPartition

{ι : Type u_1}
[Fintype ι]
{c : ℝ≥0}
(l : BoxIntegral.IntegrationParams)
(I : BoxIntegral.Box ι)
(hc : I.distortion ≤ c)
(r : (ι → ℝ) → ↑(Set.Ioi 0))


theorem exists_Icc_mem_subset_of_mem_nhdsWithin_Ici [OrderTopology α] {a : α} {s : Set α}
    (hs : s ∈ 𝓝[≥] a) : ∃ b, a ≤ b ∧ Icc a b ∈ 𝓝[≥] a ∧ Icc a b ⊆ s

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
{s : Set α}
(hs : s ∈ 𝓝[≥] a)

∃ b, a ≤ b ∧ Set.Icc a b ∈ 𝓝[≥] a ∧ Set.Icc a b ⊆ s


/-- If `s ∈ 𝓤 α`, then for a subset `t` of a sufficiently small set in `𝓤 α`,
we have `t ○ t ⊆ s`. -/
theorem eventually_uniformity_comp_subset {s : Set (α × α)} (hs : s ∈ 𝓤 α) :
    ∀ᶠ t in (𝓤 α).smallSets, t ○ t ⊆ s

{α : Type ua}
[UniformSpace α]
{s : Set (α × α)}
(hs : s ∈ 𝓤 α)

∀ᶠ (t : Set (α × α)) in (𝓤 α).smallSets, t ○ t ⊆ s


/-- The functor from presheaves of modules over a specified presheaf of rings,
to presheaves of abelian groups.
-/
@[simps obj]
def toPresheaf : PresheafOfModules.{v} R ⥤ (Cᵒᵖ ⥤ AddCommGrp.{v})

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(R : Cᵒᵖ ⥤ RingCat)
(P : PresheafOfModules R)

(PresheafOfModules.toPresheaf R).obj P = P.presheaf


theorem chain_iff_forall₂ :
    ∀ {a : α} {l : List α}, Chain R a l ↔ l = [] ∨ Forall₂ R (a :: dropLast l) l

{α : Type u}
{R : α → α → Prop}
{a : α}
{l : List α}

List.Chain R a l ↔ l = [] ∨ List.Forall₂ R (a :: l.dropLast) l


theorem kernel_from_eq_kernel [HasKernels V] {i j : ι} (r : c.Rel i j) :
    kernelSubobject (C.dFrom i) = kernelSubobject (C.d i j)

CategoryTheory.Limits.kernelSubobject (C.dFrom i) = CategoryTheory.Limits.kernelSubobject (C.d i j)


@[simp]
theorem cons_val_succ (x : α) (u : Fin m → α) (i : Fin m) : vecCons x u i.succ = u i

{α : Type u}
{m : ℕ}
(x : α)
(u : Fin m → α)
(i : Fin m)


@[to_additive]
lemma Function.Surjective.smulCommClass [SMul M α] [SMul N α] [SMul M β] [SMul N β]
    [SMulCommClass M N α] {f : α → β} (hf : Surjective f) (h₁ : ∀ (c : M) x, f (c • x) = c • f x)
    (h₂ : ∀ (c : N) x, f (c • x) = c • f x) : SMulCommClass M N β

(h₁ : ∀ (c : M) (x : α), f (c • x) = c • f x)

(h₂ : ∀ (c : N) (x : α), f (c • x) = c • f x)


/-- Valid fractional operation contains an operation. -/
lemma FractionalOperation.IsValid.contains {ω : FractionalOperation D m} (valid : ω.IsValid) :
    ∃ g : (Fin m → D) → D, g ∈ ω

{D : Type u_1}
{m : ℕ}
{ω : FractionalOperation D m}
(valid : ω.IsValid)


theorem singletonSubgraph_snd_le_subgraphOfAdj {u v : V} {h : G.Adj u v} :
    G.singletonSubgraph v ≤ G.subgraphOfAdj h

{V : Type u}
{G : SimpleGraph V}
{u v : V}
{h : G.Adj u v}


@[simp]
theorem refl_symm : (UniformEquiv.refl α).symm = UniformEquiv.refl α


lemma orthogonal_isCompl (I : LieIdeal K L) (hI : IsAtom I) :
    IsCompl I (orthogonal Φ hΦ_inv I)

(hΦ_inv : LinearMap.BilinForm.lieInvariant L Φ)

(hL : ∀ (I : LieIdeal K L), IsAtom I → ¬IsLieAbelian ↥↑I)

IsCompl I (LieAlgebra.InvariantForm.orthogonal Φ hΦ_inv I)


lemma eLpNorm_densityProcess_le (hκν : fst κ ≤ ν) (n : ℕ) (a : α) (s : Set β) :
    eLpNorm (fun x ↦ densityProcess κ ν n a x s) 1 (ν a) ≤ ν a univ

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

MeasureTheory.eLpNorm (fun x => κ.densityProcess ν n a x s) 1 (ν a) ≤ (ν a) Set.univ


@[to_additive sum_div_divisors]
theorem prod_div_divisors {α : Type*} [CommMonoid α] (n : ℕ) (f : ℕ → α) :
    (∏ d ∈ n.divisors, f (n / d)) = n.divisors.prod f

{α : Type u_1}
[CommMonoid α]
(n : ℕ)
(f : ℕ → α)

∏ d ∈ n.divisors, f (n / d) = n.divisors.prod f


theorem IsMinOn.lineDerivWithin_eq_zero (h : IsMinOn f s a)
    (h' : ∀ᶠ t : ℝ in 𝓝 0, a + t • b ∈ s) : lineDerivWithin ℝ f s a b = 0

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
{f : E → ℝ}
{s : Set E}
{a b : E}
(h : IsMinOn f s a)
(h' : ∀ᶠ (t : ℝ) in 𝓝 0, a + t • b ∈ s)


@[to_additive]
theorem mulDysonETransform.card :
    (mulDysonETransform e x).1.card + (mulDysonETransform e x).2.card = x.1.card + x.2.card

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

(Finset.addDysonETransform e x).1.card + (Finset.addDysonETransform e x).2.card = x.1.card + x.2.card


theorem maybeNormalize_eq_normalize {num : Int} {den g : Nat} (den_nz reduced)
    (hn : ↑g ∣ num) (hd : g ∣ den) :
    maybeNormalize num den g den_nz reduced = normalize num den (mt (by simp [·]) den_nz)

(reduced : (num.div ↑g).natAbs.Coprime (den / g))

Rat.maybeNormalize num den g den_nz reduced = Rat.normalize num den ⋯


protected theorem image_eq_preimage {α β} (e : α ≃ β) (s : Set α) : e '' s = e.symm ⁻¹' s

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


/--
For an additive functor `F : C ⥤ D` between abelian categories, the following are equivalent:
- `F` preserves short exact sequences, i.e. if `0 ⟶ A ⟶ B ⟶ C ⟶ 0` is exact then
  `0 ⟶ F(A) ⟶ F(B) ⟶ F(C) ⟶ 0` is exact.
- `F` preserves exact sequences, i.e. if `A ⟶ B ⟶ C` is exact then `F(A) ⟶ F(B) ⟶ F(C)` is exact.
- `F` preserves homology.
- `F` preserves both finite limits and finite colimits.
-/
lemma exact_tfae : List.TFAE
    [
      ∀ (S : ShortComplex C), S.ShortExact → (S.map F).ShortExact,
      ∀ (S : ShortComplex C), S.Exact → (S.map F).Exact,
      Nonempty (PreservesHomology F),
      Nonempty (PreservesFiniteLimits F) ∧ Nonempty (PreservesFiniteColimits F)
    ]

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
[CategoryTheory.Abelian C]
[CategoryTheory.Abelian D]
(F : CategoryTheory.Functor C D)
[F.Additive]

[∀ (S : CategoryTheory.ShortComplex C), S.ShortExact → (S.map F).ShortExact,
    ∀ (S : CategoryTheory.ShortComplex C), S.Exact → (S.map F).Exact, Nonempty F.PreservesHomology,
    Nonempty (CategoryTheory.Limits.PreservesFiniteLimits F) ∧
      Nonempty (CategoryTheory.Limits.PreservesFiniteColimits F)].TFAE


@[simp]
theorem antidiagonalTuple_zero_succ (n : ℕ) : antidiagonalTuple 0 n.succ = 0

Multiset.Nat.antidiagonalTuple 0 n.succ = 0


theorem sphere_subset_closedBall : sphere x ε ⊆ closedBall x ε

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{ε : ℝ}

Metric.sphere x ε ⊆ Metric.closedBall x ε


theorem smul_iInf_le [SMul M α] [CompleteLattice α] [CovariantClass M α HSMul.hSMul LE.le]
    {m : M} {t : ι → α} :
    m • iInf t ≤ ⨅ i, m • t i

{ι : Sort u_1}
{M : Type u_2}
{α : Type u_3}
[SMul M α]
[CompleteLattice α]
[CovariantClass M α HSMul.hSMul LE.le]
{m : M}
{t : ι → α}


@[to_additive (attr := simp)]
theorem image_one {f : α → β} : f '' 1 = {f 1}

{α : Type u_2}
{β : Type u_3}
[Zero α]
{f : α → β}


theorem condCount_compl (t : Set Ω) (hs : s.Finite) (hs' : s.Nonempty) :
    condCount s t + condCount s tᶜ = 1

{Ω : Type u_1}
[MeasurableSpace Ω]
[MeasurableSingletonClass Ω]
{s : Set Ω}
(t : Set Ω)
(hs : s.Finite)
(hs' : s.Nonempty)

(ProbabilityTheory.condCount s) t + (ProbabilityTheory.condCount s) tᶜ = 1


@[simp]
lemma toNNReal_le_ofNat {r : ℝ} {n : ℕ} [n.AtLeastTwo] :
    r.toNNReal ≤ no_index (OfNat.ofNat n) ↔ r ≤ n


/-- A monotone map sends a least element of a set to a least element of its image. -/
theorem map_isLeast (Ha : IsLeast s a) : IsLeast (f '' s) (f a)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
(Hf : Monotone f)
{a : α}
{s : Set α}
(Ha : IsLeast s a)


/-- If there is an injective map `R/p → S/P` such that following diagram commutes:
```
R   → S
↓     ↓
R/p → S/P
```
then `P` lies over `p`.
-/
theorem comap_eq_of_scalar_tower_quotient [Algebra R S] [Algebra (R ⧸ p) (S ⧸ P)]
    [IsScalarTower R (R ⧸ p) (S ⧸ P)] (h : Function.Injective (algebraMap (R ⧸ p) (S ⧸ P))) :
    comap (algebraMap R S) P = p

(h : Function.Injective ⇑(algebraMap (R ⧸ p) (S ⧸ P)))


/-- The equivalence `Nat.equivBitIndices` enumerates `Finset ℕ` in colexicographic order. -/
@[simps] def orderIsoColex : ℕ ≃o Colex ℕ

(RelIso.symm Finset.orderIsoColex) s = Finset.equivBitIndices.symm s.ofColex


/-- If `C` is filtered, then we can give an explicit condition for a functor `F : C ⥤ D` to
    be final. -/
theorem Functor.final_iff_of_isFiltered [IsFilteredOrEmpty C] :
    Final F ↔ (∀ d, ∃ c, Nonempty (d ⟶ F.obj c)) ∧ (∀ {d : D} {c : C} (s s' : d ⟶ F.obj c),
      ∃ (c' : C) (t : c ⟶ c'), s ≫ F.map t = s' ≫ F.map t)

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

F.Final ↔
  (∀ (d : D), ∃ c, Nonempty (d ⟶ F.obj c)) ∧
    ∀ {d : D} {c : C} (s s' : d ⟶ F.obj c),
      ∃ c' t, CategoryTheory.CategoryStruct.comp s (F.map t) = CategoryTheory.CategoryStruct.comp s' (F.map t)


@[simp]
theorem sum_map_inr (F : A ⥤ B) (G : C ⥤ D) {c c' : C} (f : inr c ⟶ inr c') :
    (F.sum G).map f = G.map f

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor C D)
{c c' : C}
(f : Sum.inr c ⟶ Sum.inr c')


lemma δ_apply' (x₃ : (forget₂ C Ab).obj (S.X₃.homology i))
    (x₂ : (forget₂ C Ab).obj (S.X₂.opcycles i))
    (x₁ : (forget₂ C Ab).obj (S.X₁.cycles j))
    (h₂ : (forget₂ C Ab).map (HomologicalComplex.opcyclesMap S.g i) x₂ =
      (forget₂ C Ab).map (S.X₃.homologyι i) x₃)
    (h₁ : (forget₂ C Ab).map (HomologicalComplex.cyclesMap S.f j) x₁ =
      (forget₂ C Ab).map (S.X₂.opcyclesToCycles i j) x₂) :
    (forget₂ C Ab).map (hS.δ i j hij) x₃ = (forget₂ C Ab).map (S.X₁.homologyπ j) x₁

{S : CategoryTheory.ShortComplex (HomologicalComplex C c)}

(x₃ : ↑((CategoryTheory.forget₂ C Ab).obj (S.X₃.homology i)))

(x₂ : ↑((CategoryTheory.forget₂ C Ab).obj (S.X₂.opcycles i)))

(x₁ : ↑((CategoryTheory.forget₂ C Ab).obj (S.X₁.cycles j)))

(h₂ :
  ((CategoryTheory.forget₂ C Ab).map (HomologicalComplex.opcyclesMap S.g i)) x₂ =
    ((CategoryTheory.forget₂ C Ab).map (S.X₃.homologyι i)) x₃)

(h₁ :
  ((CategoryTheory.forget₂ C Ab).map (HomologicalComplex.cyclesMap S.f j)) x₁ =
    ((CategoryTheory.forget₂ C Ab).map (S.X₂.opcyclesToCycles i j)) x₂)

((CategoryTheory.forget₂ C Ab).map (hS.δ i j hij)) x₃ = ((CategoryTheory.forget₂ C Ab).map (S.X₁.homologyπ j)) x₁


/-- Preparatory lemma for `inducedOrderRingHom`. -/
theorem le_inducedMap_mul_self_of_mem_cutMap (ha : 0 < a) (b : β) (hb : b ∈ cutMap β (a * a)) :
    b ≤ inducedMap α β a * inducedMap α β a

(hb : b ∈ LinearOrderedField.cutMap β (a * a))

b ≤ LinearOrderedField.inducedMap α β a * LinearOrderedField.inducedMap α β a


theorem StrictAnti.wellFoundedLT [WellFoundedGT β] (hf : StrictAnti f) : WellFoundedLT α

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
[WellFoundedGT β]
(hf : StrictAnti f)


theorem ContinuousOn.circleIntegrable' {f : ℂ → E} {c : ℂ} {R : ℝ}
    (hf : ContinuousOn f (sphere c |R|)) : CircleIntegrable f c R

(hf : ContinuousOn f (Metric.sphere c |R|))


@[simp]
theorem dest_mk (x : F (M F)) : dest (M.mk x) = x


/-- Shows `prodToProdTop` is an isomorphism, whose inverse is precisely the product
of the induced left and right projections.
-/
@[simps]
def prodIso : CategoryTheory.Grpd.of (πₓ A × πₓ B) ≅ πₓ (TopCat.of (A × B))

(FundamentalGroupoidFunctor.prodIso A B).inv =
  (FundamentalGroupoidFunctor.projLeft A B).prod' (FundamentalGroupoidFunctor.projRight A B)


theorem nodup_of_pairwise_disjoint_cycles {l : List (Perm β)} (h1 : ∀ f ∈ l, IsCycle f)
    (h2 : l.Pairwise Disjoint) : l.Nodup

(h2 : List.Pairwise Equiv.Perm.Disjoint l)


theorem Nontrivial.infsep_lt_iff {d} (hs : s.Nontrivial) :
    s.infsep < d ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ dist x y < d

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


theorem rightInverse_surjInv (hf : Surjective f) : RightInverse (surjInv hf) f

{α : Sort u}
{β : Sort v}
{f : α → β}
(hf : Function.Surjective f)

Function.RightInverse (Function.surjInv hf) f


theorem Zigzag.of_hom_hom {j₁ j₂ j₃ : J} (f₁₂ : j₁ ⟶ j₂) (f₂₃ : j₂ ⟶ j₃) : Zigzag j₁ j₃

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{j₁ j₂ j₃ : J}
(f₁₂ : j₁ ⟶ j₂)
(f₂₃ : j₂ ⟶ j₃)


@[norm_cast]
theorem coe_zero : (↑(0 : ℚ) : ℚ_[p]) = 0


private theorem iunfoldr.eq_test
    {f : Fin w → α → α × Bool} (state : Nat → α) (value : BitVec w) (a : α)
    (init : state 0 = a)
    (step : ∀(i : Fin w), f i (state i.val) = (state (i.val+1), value.getLsb i.val)) :
    iunfoldr f a = (state w, BitVec.truncate w value)

(step : ∀ (i : Fin w), f i (state ↑i) = (state (↑i + 1), value.getLsb ↑i))

BitVec.iunfoldr f a = (state w, BitVec.truncate w value)


theorem coordinate_eval_8 :
    (coordinate 8).eval
      (.ofList (a0 :: a1 :: a2 :: a3 :: a4 :: a5 :: a6 :: a7 :: a8 :: t)) = a8

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

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


/-- An `r + 1`-cliquefree Turán-maximal graph is _not_ `r`-cliquefree
if it can accommodate such a clique. -/
theorem not_cliqueFree_of_isTuranMaximal (hn : r ≤ Fintype.card V) (hG : G.IsTuranMaximal r) :
    ¬G.CliqueFree r

{V : Type u_1}
[Fintype V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{r : ℕ}
(hr : 0 < r)
(hn : r ≤ Fintype.card V)
(hG : G.IsTuranMaximal r)


theorem pow_multiplicity_dvd {a b : α} (h : Finite a b) : a ^ get (multiplicity a b) h ∣ b

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}
(h : multiplicity.Finite a b)


theorem integrable_withDensity_iff_integrable_smul' {f : α → ℝ≥0∞} (hf : Measurable f)
    (hflt : ∀ᵐ x ∂μ, f x < ∞) {g : α → E} :
    Integrable g (μ.withDensity f) ↔ Integrable (fun x => (f x).toReal • g x) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : α → ℝ≥0∞}
(hf : Measurable f)
(hflt : ∀ᵐ (x : α) ∂μ, f x < ⊤)
{g : α → E}

MeasureTheory.Integrable g (μ.withDensity f) ↔ MeasureTheory.Integrable (fun x => (f x).toReal • g x) μ


theorem c_of_eq (h : P.toPoly = Q.toPoly) : P.c = Q.c

{R : Type u_1}
{P Q : Cubic R}
[Semiring R]
(h : P.toPoly = Q.toPoly)


@[to_additive]
theorem nontrivial_iff_exists_ne_one (H : Subgroup G) : Nontrivial H ↔ ∃ x ∈ H, x ≠ (1 : G)

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


theorem TopologicalSpace.IsTopologicalBasis.borel_eq_generateFrom [TopologicalSpace α]
    [SecondCountableTopology α] {s : Set (Set α)} (hs : IsTopologicalBasis s) :
    borel α = .generateFrom s

(hs : TopologicalSpace.IsTopologicalBasis s)

borel α = MeasurableSpace.generateFrom s


protected theorem injective : Injective f₁

{𝕜 : Type u_1}
{V₁' : Type u_4}
{V₂ : Type u_5}
{P₁' : Type u_9}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V₁']
[NormedSpace 𝕜 V₁']
[MetricSpace P₁']
[NormedAddTorsor V₁' P₁']
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(f₁ : P₁' →ᵃⁱ[𝕜] P₂)


/-- Given a basis, an orientation equals the negation of that given by that basis if and only
if it does not equal that given by that basis. -/
theorem orientation_ne_iff_eq_neg (e : Basis ι R M) (x : Orientation R M ι) :
    x ≠ e.orientation ↔ x = -e.orientation

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_3}
[Fintype ι]
[DecidableEq ι]
(e : Basis ι R M)
(x : Orientation R M ι)


theorem isCompact_univ [h : CompactSpace X] : IsCompact (univ : Set X)

{X : Type u}
[TopologicalSpace X]
[h : CompactSpace X]


/-- If `η` is an oplax natural transformation between `F` and `G`, we have a 1-morphism
`η.app a : F.obj a ⟶ G.obj a` for each object `a : B`. We also have a 2-morphism
`η.naturality f : F.map f ≫ app b ⟶ app a ≫ G.map f` for each 1-morphism `f : a ⟶ b`.
These 2-morphisms satisfies the naturality condition, and preserve the identities and
the compositions modulo some adjustments of domains and codomains of 2-morphisms.
-/
structure OplaxNatTrans (F G : OplaxFunctor B C) where
  app (a : B) : F.obj a ⟶ G.obj a
  naturality {a b : B} (f : a ⟶ b) : F.map f ≫ app b ⟶ app a ≫ G.map f
  naturality_naturality :
    ∀ {a b : B} {f g : a ⟶ b} (η : f ⟶ g),
      F.map₂ η ▷ app b ≫ naturality g = naturality f ≫ app a ◁ G.map₂ η := by
    aesop_cat
  naturality_id :
    ∀ a : B,
      naturality (𝟙 a) ≫ app a ◁ G.mapId a =
        F.mapId a ▷ app a ≫ (λ_ (app a)).hom ≫ (ρ_ (app a)).inv := by
    aesop_cat
  naturality_comp :
    ∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c),
      naturality (f ≫ g) ≫ app a ◁ G.mapComp f g =
        F.mapComp f g ▷ app c ≫
          (α_ _ _ _).hom ≫
            F.map f ◁ naturality g ≫ (α_ _ _ _).inv ≫ naturality f ▷ G.map g ≫ (α_ _ _ _).hom := by
    aesop_cat

(self : CategoryTheory.OplaxNatTrans F G)

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


/-- Given `u : α → γ` a uniform inducing map, a family `𝓕 : ι → β → α` is uniformly equicontinuous
on a subset `S : Set β` iff the family `𝓕'`, obtained by composing each function of `𝓕` by `u`,
is uniformly equicontinuous on `S`. -/
theorem UniformInducing.uniformEquicontinuousOn_iff {F : ι → β → α} {S : Set β} {u : α → γ}
    (hu : UniformInducing u) :
    UniformEquicontinuousOn F S ↔ UniformEquicontinuousOn ((u ∘ ·) ∘ F) S

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
{γ : Type u_11}
[uα : UniformSpace α]
[uβ : UniformSpace β]
[uγ : UniformSpace γ]
{F : ι → β → α}
{S : Set β}
{u : α → γ}
(hu : UniformInducing u)

UniformEquicontinuousOn F S ↔ UniformEquicontinuousOn ((fun x => u ∘ x) ∘ F) S


theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) :
    HasFPowerSeriesAt (f - g) (pf - pg) x

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


@[to_additive continuous_of_continuousAt_zero₂]
theorem continuous_of_continuousAt_one₂ {H M : Type*} [CommMonoid M] [TopologicalSpace M]
    [ContinuousMul M] [Group H] [TopologicalSpace H] [TopologicalGroup H] (f : G →* H →* M)
    (hf : ContinuousAt (fun x : G × H ↦ f x.1 x.2) (1, 1))
    (hl : ∀ x, ContinuousAt (f x) 1) (hr : ∀ y, ContinuousAt (f · y) 1) :
    Continuous (fun x : G × H ↦ f x.1 x.2)

(hf : ContinuousAt (fun x => (f x.1) x.2) (1, 1))

(hl : ∀ (x : G), ContinuousAt (⇑(f x)) 1)

(hr : ∀ (y : H), ContinuousAt (fun x => (f x) y) 1)


/-- **Chebyshev's Sum Inequality**: When `f` and `g` monovary together (eg they are both
monotone/antitone), the scalar product of their sum is less than the size of the set times their
scalar product. -/
theorem Monovary.sum_smul_sum_le_card_smul_sum (hfg : Monovary f g) :
    ((∑ i, f i) • ∑ i, g i) ≤ Fintype.card ι • ∑ i, f i • g i

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{f : ι → α}
{g : ι → β}
[Fintype ι]
(hfg : Monovary f g)

(∑ i : ι, f i) • ∑ i : ι, g i ≤ Fintype.card ι • ∑ i : ι, f i • g i


@[simps!]
instance : MonoidalCategoryStruct (Dial C)

(CategoryTheory.MonoidalCategory.associator X Y Z).inv.f =
  CategoryTheory.Limits.prod.lift
    (CategoryTheory.Limits.prod.lift CategoryTheory.Limits.prod.fst
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst))
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd)


theorem succ_descFactorial_succ (n : ℕ) :
    ∀ k : ℕ, (n + 1).descFactorial (k + 1) = (n + 1) * n.descFactorial k


@[simp] theorem getLastD_map (f : α → β) (l : List α) (a : α) : getLastD (map f l) (f a) = f (getLastD l a)

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

(List.map f l).getLastD (f a) = f (l.getLastD a)


theorem iSup_iInf_le_iInf_iSup (f : ι → ι' → α) : ⨆ i, ⨅ j, f i j ≤ ⨅ j, ⨆ i, f i j

{α : Type u_1}
{ι : Sort u_5}
{ι' : Sort u_6}
[CompleteLattice α]
(f : ι → ι' → α)


theorem RingHom.map_geom_sum [Semiring α] [Semiring β] (x : α) (n : ℕ) (f : α →+* β) :
    f (∑ i ∈ range n, x ^ i) = ∑ i ∈ range n, f x ^ i

{α : Type u}
{β : Type u_1}
[Semiring α]
[Semiring β]
(x : α)
(n : ℕ)
(f : α →+* β)

f (∑ i ∈ Finset.range n, x ^ i) = ∑ i ∈ Finset.range n, f x ^ i


theorem diagonal_injective [Zero α] : Function.Injective (diagonal : (n → α) → Matrix n n α)

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]


theorem mergeSort_eq_self [IsAntisymm α r] {l : List α} : Sorted r l → mergeSort r l = l

{α : Type u}
(r : α → α → Prop)
[DecidableRel r]
[IsTotal α r]
[IsTrans α r]
[IsAntisymm α r]
{l : List α}

List.Sorted r l → List.mergeSort r l = l


lemma map_polynomialY : (W'.map f).toJacobian.polynomialY = MvPolynomial.map f W'.polynomialY

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{S : Type u_1}
[CommRing S]
(f : R →+* S)

(WeierstrassCurve.map W' f).toJacobian.polynomialY = (MvPolynomial.map f) W'.polynomialY


@[to_additive]
lemma mulIndicator_le_mulIndicator (h : f a ≤ g a) : mulIndicator s f a ≤ mulIndicator s g a

{α : Type u_2}
{M : Type u_4}
[Preorder M]
[One M]
{s : Set α}
{f g : α → M}
{a : α}
(h : f a ≤ g a)


/-- A monotone surjective function with a densely ordered codomain is continuous. -/
theorem Monotone.continuous_of_surjective [DenselyOrdered β] {f : α → β} (h_mono : Monotone f)
    (h_surj : Function.Surjective f) : Continuous f

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[LinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
[DenselyOrdered β]
{f : α → β}
(h_mono : Monotone f)
(h_surj : Function.Surjective f)


@[simp] theorem getRight?_eq_some_iff : x.getRight? = some b ↔ x = inr b

∀ {β : Type u_1} {b : β} {α : Type u_2} {x : α ⊕ β}, x.getRight? = some b ↔ x = Sum.inr b


@[simp]
theorem casesOn'_coe (x : β) (f : α → β) (a : α) : casesOn' (a : Option α) x f = f a

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


theorem comap {f : M →ₗ[R] N} (hxy : f x ≡ f y [SMOD V]) : x ≡ y [SMOD V.comap f]

{R : Type u_1}
[Ring R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{x y : M}
{N : Type u_4}
[AddCommGroup N]
[Module R N]
(V : Submodule R N)
{f : M →ₗ[R] N}
(hxy : f x ≡ f y [SMOD V])


theorem injective_comp (e : α ≃ β) (f : β → γ) : Injective (f ∘ e) ↔ Injective f

{α : Sort u}
{β : Sort v}
{γ : Sort w}
(e : α ≃ β)
(f : β → γ)

Function.Injective (f ∘ ⇑e) ↔ Function.Injective f


@[simp]
theorem sInf_insert {a : α} {s : Set α} : sInf (insert a s) = a ⊓ sInf s

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


/-- Let `s` be a finite set of boxes in `ℝⁿ = ι → ℝ`. Then there exists a finite set `t₀` of
hyperplanes (namely, the set of all hyperfaces of boxes in `s`) such that for any `t ⊇ t₀`
and any box `I` in `ℝⁿ` the following holds. The hyperplanes from `t` split `I` into subboxes.
Let `J'` be one of them, and let `J` be one of the boxes in `s`. If these boxes have a nonempty
intersection, then `J' ≤ J`. -/
theorem eventually_not_disjoint_imp_le_of_mem_splitMany (s : Finset (Box ι)) :
    ∀ᶠ t : Finset (ι × ℝ) in atTop, ∀ (I : Box ι), ∀ J ∈ s, ∀ J' ∈ splitMany I t,
      ¬Disjoint (J : WithBot (Box ι)) J' → J' ≤ J

{ι : Type u_1}
[Finite ι]
(s : Finset (BoxIntegral.Box ι))

∀ᶠ (t : Finset (ι × ℝ)) in Filter.atTop,
  ∀ (I J : BoxIntegral.Box ι), J ∈ s → ∀ J' ∈ BoxIntegral.Prepartition.splitMany I t, ¬Disjoint ↑J ↑J' → J' ≤ J


/-- An isometry is continuous. -/
protected theorem continuous (hf : Isometry f) : Continuous f

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


@[simp]
lemma fiberEqualizerEquiv_symm_ι_apply {X Y : C} {f g : X ⟶ Y} (x : F.obj X)
    (h : F.map f x = F.map g x) :
    F.map (equalizer.ι f g) ((fiberEqualizerEquiv F f g).symm ⟨x, h⟩) = x

(F : CategoryTheory.Functor C FintypeCat)

F.map (CategoryTheory.Limits.equalizer.ι f g)
    ((CategoryTheory.PreGaloisCategory.fiberEqualizerEquiv F f g).symm ⟨x, h⟩) =
  x


theorem gramSchmidt_def' (f : ι → E) (n : ι) :
    f n = gramSchmidt 𝕜 f n + ∑ i ∈ Iio n, orthogonalProjection (𝕜 ∙ gramSchmidt 𝕜 f i) (f n)

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_3}
[LinearOrder ι]
[LocallyFiniteOrderBot ι]
[IsWellOrder ι fun x x_1 => x < x_1]
(f : ι → E)
(n : ι)

f n = gramSchmidt 𝕜 f n + ∑ i ∈ Finset.Iio n, ↑((orthogonalProjection (Submodule.span 𝕜 {gramSchmidt 𝕜 f i})) (f n))


@[reassoc (attr := simp)]
lemma homologyπ_singleObjHomologySelfIso_hom :
    ((single C c j).obj A).homologyπ j ≫ (singleObjHomologySelfIso _ _ _).hom =
      (singleObjCyclesSelfIso _ _ _).hom

((HomologicalComplex.single C c j).obj A).homologyπ j ≫ (HomologicalComplex.singleObjHomologySelfIso c j A).hom =
  (HomologicalComplex.singleObjCyclesSelfIso c j A).hom


/-- See note [partially-applied ext lemmas] -/
theorem ringHom_ext ⦃j k : S →+* P⦄ (h : j.comp (algebraMap R S) = k.comp (algebraMap R S)) :
    j = k


@[to_additive (attr := simp)]
theorem bot_mul : ⊥ * t = ⊥

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

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


theorem intermediate_value_univ₂_eventually₂ [PreconnectedSpace X] {l₁ l₂ : Filter X} [NeBot l₁]
    [NeBot l₂] {f g : X → α} (hf : Continuous f) (hg : Continuous g) (he₁ : f ≤ᶠ[l₁] g)
    (he₂ : g ≤ᶠ[l₂] f) : ∃ x, f x = g x

{X : Type u}
{α : Type v}
[TopologicalSpace X]
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[PreconnectedSpace X]
{l₁ l₂ : Filter X}
[l₁.NeBot]
[l₂.NeBot]
{f g : X → α}
(hf : Continuous f)
(hg : Continuous g)
(he₁ : f ≤ᶠ[l₁] g)
(he₂ : g ≤ᶠ[l₂] f)


theorem map_add_lt {x y g} (hx : v x < g) (hy : v y < g) : v (x + y) < g

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


@[simp]
theorem comp_apply (g : N →[L] P) (f : M →[L] N) (x : M) : g.comp f x = g (f x)

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
{P : Type u_1}
[L.Structure P]
(g : L.Hom N P)
(f : L.Hom M N)
(x : M)


lemma uIcc_subset_uIcc (h₁ : a₁ ∈ [[a₂, b₂]]) (h₂ : b₁ ∈ [[a₂, b₂]]) :
    [[a₁, b₁]] ⊆ [[a₂, b₂]]

{α : Type u_1}
[Lattice α]
{a₁ a₂ b₁ b₂ : α}
(h₁ : a₁ ∈ Set.uIcc a₂ b₂)
(h₂ : b₁ ∈ Set.uIcc a₂ b₂)


theorem ae_restrict_union_iff (s t : Set α) (p : α → Prop) :
    (∀ᵐ x ∂μ.restrict (s ∪ t), p x) ↔ (∀ᵐ x ∂μ.restrict s, p x) ∧ ∀ᵐ x ∂μ.restrict t, p x

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s t : Set α)
(p : α → Prop)

(∀ᵐ (x : α) ∂μ.restrict (s ∪ t), p x) ↔ (∀ᵐ (x : α) ∂μ.restrict s, p x) ∧ ∀ᵐ (x : α) ∂μ.restrict t, p x


theorem content_dvd_coeff {p : R[X]} (n : ℕ) : p.content ∣ p.coeff n

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
{p : Polynomial R}
(n : ℕ)


@[simp]
theorem toCocone_ι_app_right (c : BinaryBicone P Q) :
    c.toCocone.ι.app ⟨WalkingPair.right⟩ = c.inr

(c : CategoryTheory.Limits.BinaryBicone P Q)

c.toCocone.ι.app { as := CategoryTheory.Limits.WalkingPair.right } = c.inr


theorem rel_join : (Forall₂ (Forall₂ R) ⇒ Forall₂ R) join join

{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}

(List.Forall₂ (List.Forall₂ R) ⇒ List.Forall₂ R) List.join List.join


/-- `OrderDual` as a functor. -/
@[simps]
def dual : DistLat ⥤ DistLat


/-- `prod F G` is a limit cone. -/
@[simps]
def binaryProductLimit : IsLimit (binaryProductCone F G)

(F G : CategoryTheory.Functor C (Type w))

(s : CategoryTheory.Limits.BinaryFan F G)

(CategoryTheory.FunctorToTypes.binaryProductLimit F G).lift s = CategoryTheory.FunctorToTypes.prod.lift s.fst s.snd


theorem mem_bot {x : E} : x ∈ (⊥ : IntermediateField F E) ↔ x ∈ Set.range (algebraMap F E)

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{x : E}


theorem natSepDegree_mul_eq_iff (g : F[X]) :
    (f * g).natSepDegree = f.natSepDegree + g.natSepDegree ↔ (f = 0 ∧ g = 0) ∨ IsCoprime f g

(f * g).natSepDegree = f.natSepDegree + g.natSepDegree ↔ f = 0 ∧ g = 0 ∨ IsCoprime f g


/-- `(fun x ↦ c) =O[l] f` if and only if `f` is bounded away from zero. -/
theorem isBigO_const_left_iff_pos_le_norm {c : E''} (hc : c ≠ 0) :
    (fun _x => c) =O[l] f' ↔ ∃ b, 0 < b ∧ ∀ᶠ x in l, b ≤ ‖f' x‖

{α : Type u_1}
{E' : Type u_6}
{E'' : Type u_9}
[SeminormedAddCommGroup E']
[NormedAddCommGroup E'']
{f' : α → E'}
{l : Filter α}
{c : E''}
(hc : c ≠ 0)

(fun _x => c) =O[l] f' ↔ ∃ b, 0 < b ∧ ∀ᶠ (x : α) in l, b ≤ ‖f' x‖


@[simp]
theorem ofInjectiveEndo_right_inv (f : V →ₗ[K] V) (h_inj : Injective f) :
    f * (ofInjectiveEndo f h_inj).symm = 1

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
(f : V →ₗ[K] V)
(h_inj : Function.Injective ⇑f)

f * ↑(LinearEquiv.ofInjectiveEndo f h_inj).symm = 1