lemma finite_effectiveEpiFamily_of_map (F : C ⥤ D) [ReflectsFiniteEffectiveEpiFamilies F]
    {α : Type} [Finite α] {B : C} (X : α → C) (π : (a : α) → (X a ⟶ B))
    (h : EffectiveEpiFamily (fun a ↦ F.obj (X a)) (fun a  ↦ F.map (π a))) :
    EffectiveEpiFamily X π

(h : CategoryTheory.EffectiveEpiFamily (fun a => F.obj (X a)) fun a => F.map (π a))


/-- This lemma has an abbreviated name because it is used frequently. -/
theorem cancel_of_lt {a : ℝ≥0∞} (h : a < ∞) : AddLECancellable a


/-- The composition of a binary polynomial function
 with a unary polynomial function in the second argument is polynomial. -/
theorem compRight {g f} [IsPoly₂ p g] [IsPoly p f] :
    IsPoly₂ p fun _R _Rcr x y => g x (f y)

{g : ⦃R : Type u_3⦄ → [inst : CommRing R] → WittVector p R → WittVector p R → WittVector p R}

{f : ⦃R : Type u_3⦄ → [inst : CommRing R] → WittVector p R → WittVector p R}

WittVector.IsPoly₂ p fun _R _Rcr x y => g x (f y)


@[ext]
theorem ext ⦃f g : r →r s⦄ (h : ∀ x, f x = g x) : f = g

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
⦃f g : r →r s⦄
(h : ∀ (x : α), f x = g x)


lemma monotone_ofReal : Monotone ofReal'


/-- If `c ∉ {0, ∞}` and `m₁ d ≤ c * m₂ d` for `d < ε` for some `ε > 0`
(we use `≤ᶠ[𝓝[≥] 0]` to state this), then `mkMetric m₁ hm₁ ≤ c • mkMetric m₂ hm₂`. -/
theorem mkMetric_mono_smul {m₁ m₂ : ℝ≥0∞ → ℝ≥0∞} {c : ℝ≥0∞} (hc : c ≠ ∞) (h0 : c ≠ 0)
    (hle : m₁ ≤ᶠ[𝓝[≥] 0] c • m₂) : (mkMetric m₁ : OuterMeasure X) ≤ c • mkMetric m₂

{X : Type u_2}
[EMetricSpace X]
{m₁ m₂ : ℝ≥0∞ → ℝ≥0∞}
{c : ℝ≥0∞}
(hc : c ≠ ⊤)
(h0 : c ≠ 0)
(hle : m₁ ≤ᶠ[𝓝[≥] 0] c • m₂)

MeasureTheory.OuterMeasure.mkMetric m₁ ≤ c • MeasureTheory.OuterMeasure.mkMetric m₂


theorem hasBasis_uniformity : (uniformity R).HasBasis (fun _ => True)
    fun γ : Γ₀ˣ => { p : R × R | v (p.2 - p.1) < (γ : Γ₀) }

(R : Type u)
[Ring R]
(Γ₀ : Type v)
[LinearOrderedCommGroupWithZero Γ₀]
[_i : Valued R Γ₀]

(uniformity R).HasBasis (fun x => True) fun γ => {p | Valued.v (p.2 - p.1) < ↑γ}


lemma add_of_Y_ne' {x₁ x₂ y₁ y₂ : F} {h₁ : W.Nonsingular x₁ y₁} {h₂ : W.Nonsingular x₂ y₂}
    (hy : y₁ ≠ W.negY x₂ y₂) :
    some h₁ + some h₂ = -some (nonsingular_negAdd h₁ h₂ fun _ ↦ hy)

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

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


@[to_additive (attr := simp)]
theorem nontrivial_iff : Nontrivial (Subgroup G) ↔ Nontrivial G


theorem equiv_lpPiLp_norm [Fintype α] (f : lp E p) : ‖Equiv.lpPiLp f‖ = ‖f‖

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
{p : ℝ≥0∞}
[Fintype α]
(f : ↥(lp E p))


theorem coinduced_compose [tα : TopologicalSpace α] {f : α → β} {g : β → γ} :
    (tα.coinduced f).coinduced g = tα.coinduced (g ∘ f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[tα : TopologicalSpace α]
{f : α → β}
{g : β → γ}

TopologicalSpace.coinduced g (TopologicalSpace.coinduced f tα) = TopologicalSpace.coinduced (g ∘ f) tα


theorem num_mul_eq_mul_denom_iff {x : RatFunc K} {p q : K[X]} (hq : q ≠ 0) :
    x.num * q = p * x.denom ↔ x = algebraMap _ _ p / algebraMap _ _ q

{K : Type u}
[Field K]
{x : RatFunc K}
{p q : K[X]}
(hq : q ≠ 0)

x.num * q = p * x.denom ↔ x = (algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q


theorem tendsto_of_isEmpty [IsEmpty α] {f : α → β} {la : Filter α} {lb : Filter β} :
    Tendsto f la lb

{α : Type u}
{β : Type v}
[IsEmpty α]
{f : α → β}
{la : Filter α}
{lb : Filter β}


theorem of_isEmpty [IsEmpty X] (f : X → Y) : OpenEmbedding f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[IsEmpty X]
(f : X → Y)


/-- `g` converges to `f.smallSets` if for all `s ∈ f`, eventually we have `g x ⊆ s`. -/
theorem tendsto_smallSets_iff {f : α → Set β} :
    Tendsto f la lb.smallSets ↔ ∀ t ∈ lb, ∀ᶠ x in la, f x ⊆ t

{α : Type u_1}
{β : Type u_2}
{la : Filter α}
{lb : Filter β}
{f : α → Set β}

Filter.Tendsto f la lb.smallSets ↔ ∀ t ∈ lb, ∀ᶠ (x : α) in la, f x ⊆ t


lemma succ_natCast (n : ℕ) : Order.succ (n : Cardinal) = n + 1


/-- The equivalence of functor categories induced by `op` and `unop`.
-/
@[simps]
def opUnopEquiv : (C ⥤ D)ᵒᵖ ≌ Cᵒᵖ ⥤ Dᵒᵖ

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

(CategoryTheory.Functor.opUnopEquiv C D).functor = CategoryTheory.Functor.opHom C D


/-- A lemma that tells us that, in the case where Bertrand's postulate does not hold, the prime
factorization of the central binomial coefficent only has factors at most `2 * n / 3 + 1`.
-/
theorem centralBinom_factorization_small (n : ℕ) (n_large : 2 < n)
    (no_prime : ¬∃ p : ℕ, p.Prime ∧ n < p ∧ p ≤ 2 * n) :
    centralBinom n = ∏ p ∈ Finset.range (2 * n / 3 + 1), p ^ (centralBinom n).factorization p

(no_prime : ¬∃ p, Nat.Prime p ∧ n < p ∧ p ≤ 2 * n)

n.centralBinom = ∏ p ∈ Finset.range (2 * n / 3 + 1), p ^ n.centralBinom.factorization p


theorem tan_mul_cos {x : ℝ} (hx : cos x ≠ 0) : tan x * cos x = sin x


@[to_additive]
theorem outerMeasure_pos_of_is_mul_left_invariant [Group G] [TopologicalGroup G]
    (h3 : ∀ (g : G) {K : Compacts G}, μ (K.map _ <| continuous_mul_left g) = μ K) (K : Compacts G)
    (hK : μ K ≠ 0) {U : Set G} (h1U : IsOpen U) (h2U : U.Nonempty) : 0 < μ.outerMeasure U

(h3 :
  ∀ (g : G) {K : TopologicalSpace.Compacts G},
    (fun s => ↑(μ.toFun s)) (TopologicalSpace.Compacts.map (fun b => g * b) ⋯ K) = (fun s => ↑(μ.toFun s)) K)


@[simp]
theorem aequiv_map (h : IsAdjoinRoot S f) (h' : IsAdjoinRoot T f) (z : R[X]) :
    h.aequiv h' (h.map z) = h'.map z

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{f : R[X]}
{T : Type u_1}
[CommRing T]
[Algebra R T]
(h : IsAdjoinRoot S f)
(h' : IsAdjoinRoot T f)
(z : R[X])


theorem iInter₂_subset {s : ∀ i, κ i → Set α} (i : ι) (j : κ i) : ⋂ (i) (j), s i j ⊆ s i j

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{s : (i : ι) → κ i → Set α}
(i : ι)
(j : κ i)


/-- A nowhere dense set `s` is contained in a closed nowhere dense set (namely, its closure). -/
lemma IsNowhereDense.subset_of_closed_isNowhereDense {s : Set X} (hs : IsNowhereDense s) :
    ∃ t : Set X, s ⊆ t ∧ IsNowhereDense t ∧ IsClosed t

{X : Type u_5}
[TopologicalSpace X]
{s : Set X}
(hs : IsNowhereDense s)

∃ t, s ⊆ t ∧ IsNowhereDense t ∧ IsClosed t


@[to_additive]
lemma isMulFreimanHom_const {b : β} (hb : b ∈ B) : IsMulFreimanHom n A B fun _ ↦ b

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{A : Set α}
{B : Set β}
{n : ℕ}
{b : β}
(hb : b ∈ B)


theorem polarBilin_toQuadraticMap : polarBilin (toQuadraticMap B) = B + flip B

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
{B : LinearMap.BilinMap R M N}

B.toQuadraticMap.polarBilin = B + LinearMap.flip B


@[simp] theorem nnnorm_inl (r : R) : ‖(inl r : tsze R M)‖₊ = ‖r‖₊

{R : Type u_3}
{M : Type u_4}
[SeminormedRing R]
[SeminormedAddCommGroup M]
(r : R)


@[simp]
lemma Sigma.map'_id {f g : α → C} [HasCoproduct f] [HasCoproduct g] (p : ∀ b, f b ⟶ g b) :
    Sigma.map' id p = Sigma.map p

{α : Type w₂}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f g : α → C}
[CategoryTheory.Limits.HasCoproduct f]
[CategoryTheory.Limits.HasCoproduct g]
(p : (b : α) → f b ⟶ g b)

CategoryTheory.Limits.Sigma.map' id p = CategoryTheory.Limits.Sigma.map p


lemma Sheaf.isSeparated [ConcreteCategory A] [J.HasSheafCompose (forget A)]
    (F : Sheaf J A) : Presheaf.IsSeparated J F.val

{J : CategoryTheory.GrothendieckTopology C}


@[csimp] theorem set_eq_setTR : @set = @setTR


theorem universallyClosed_respectsIso : RespectsIso @UniversallyClosed


@[to_additive]
theorem prod_finset_product (r : Finset (γ × α)) (s : Finset γ) (t : γ → Finset α)
    (h : ∀ p : γ × α, p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1) {f : γ × α → β} :
    ∏ p ∈ r, f p = ∏ c ∈ s, ∏ a ∈ t c, f (c, a)

(h : ∀ (p : γ × α), p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1)

{f : γ × α → β}

∑ p ∈ r, f p = ∑ c ∈ s, ∑ a ∈ t c, f (c, a)


@[to_additive (attr := simp)]
lemma prod_diag [DecidableEq α] (s : Finset α) (f : α × α → β) :
    ∏ i ∈ s.diag, f i = ∏ i ∈ s, f (i, i)

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


@[simp]
theorem rank_one [StrongRankCondition R] [DecidableEq n] :
    rank (1 : Matrix n n R) = Fintype.card n

{n : Type u_3}
{R : Type u_5}
[Fintype n]
[CommRing R]
[StrongRankCondition R]
[DecidableEq n]


theorem T_neg_two : T R (-2) = 2 * X ^ 2 - 1

Polynomial.Chebyshev.T R (-2) = 2 * Polynomial.X ^ 2 - 1


theorem tsub_lt_iff_left (hbc : b ≤ a) : a - b < c ↔ a < b + c

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

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


theorem le_pow_clog {b : ℕ} (hb : 1 < b) (x : ℕ) : x ≤ b ^ clog b x


@[simp]
lemma digits_of_two_le_of_pos {b : ℕ} (hb : 2 ≤ b) (hn : 0 < n) :
    Nat.digits b n = n % b :: Nat.digits b (n / b)


@[to_additive (attr := simp)]
lemma finEquivPowers_apply (x : G) (hx) {n : Fin (orderOf x)} :
    finEquivPowers x hx n = ⟨x ^ (n : ℕ), n, rfl⟩

{G : Type u_1}
[AddLeftCancelMonoid G]
(x : G)
(hx : IsOfFinAddOrder x)
{n : Fin (addOrderOf x)}

(finEquivMultiples x hx) n = ⟨↑n • x, ⋯⟩


theorem zero_ne_one_iff {I : Ideal R} : (0 : R ⧸ I) ≠ 1 ↔ I ≠ ⊤

0 ≠ 1 ↔ I ≠ ⊤


/-- The space `Bundle.TotalSpace F E` (for `E : B → Type*` such that each `E x` is a topological
vector space) has a topological vector space structure with fiber `F` (denoted with
`VectorBundle R F E`) if around every point there is a fiber bundle trivialization which is linear
in the fibers. -/
class VectorBundle : Prop where
  trivialization_linear' : ∀ (e : Trivialization F (π F E)) [MemTrivializationAtlas e], e.IsLinear R
  continuousOn_coordChange' :
    ∀ (e e' : Trivialization F (π F E)) [MemTrivializationAtlas e] [MemTrivializationAtlas e'],
      ContinuousOn (fun b => Trivialization.coordChangeL R e e' b : B → F →L[R] F)
        (e.baseSet ∩ e'.baseSet)

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)


@[to_additive two_nsmul_sup_eq_add_add_abs_sub]
lemma sup_sq_eq_mul_mul_mabs_div (a b : α) : (a ⊔ b) ^ 2 = a * b * |b / a|ₘ


theorem smul_def (a : ℚ) (x : K) : a • x = ↑a * x

{K : Type u_3}
[DivisionRing K]
(a : ℚ)
(x : K)


@[simp]
theorem mem_support_toFun (f : Π₀ i, β i) (i) : i ∈ f.support ↔ f i ≠ 0

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]


theorem smul_measure (c : ℝ≥0∞) (hc_ne_zero : c ≠ 0) (hT : FinMeasAdditive μ T) :
    FinMeasAdditive (c • μ) T

(hT : MeasureTheory.FinMeasAdditive μ T)


theorem AEStronglyMeasurable.convolution_integrand_swap_snd' {x : G}
    (hf : AEStronglyMeasurable f <| map (fun t => x - t) μ) (hg : AEStronglyMeasurable g μ) :
    AEStronglyMeasurable (fun t => L (f (x - t)) (g t)) μ

(hf : MeasureTheory.AEStronglyMeasurable f (MeasureTheory.Measure.map (fun t => x - t) μ))

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.AEStronglyMeasurable (fun t => (L (f (x - t))) (g t)) μ


/-- The obvious functor `(WidePushoutShape J)ᵒᵖ ⥤ WidePullbackShape J` -/
@[simps!]
def widePushoutShapeUnop : (WidePushoutShape J)ᵒᵖ ⥤ WidePullbackShape J

(X : (CategoryTheory.Limits.WidePushoutShape J)ᵒᵖ)

(CategoryTheory.Limits.widePushoutShapeUnop J).obj X = Opposite.unop X


@[to_additive (attr := simp)]
theorem inv_mul_cancel_right (a : α) (b : αˣ) : a * ↑b⁻¹ * b = a

{α : Type u}
[AddMonoid α]
(a : α)
(b : AddUnits α)


theorem inter_inter_inter_comm (s t u v : Set α) : s ∩ t ∩ (u ∩ v) = s ∩ u ∩ (t ∩ v)


@[simp] lemma uzpow_zero (s : ℤˣ) : (s ^ (0 : R) : ℤˣ) = (1 : ℤˣ)

{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(s : ℤˣ)


@[simp]
theorem dist_center_dist (z w : ℍ) :
    dist (z : ℂ) (w.center (dist z w)) = w.im * Real.sinh (dist z w)

dist ↑z ↑(w.center (dist z w)) = w.im * Real.sinh (dist z w)


/-- The data of generating sections of the restriction of a sheaf of modules
over a covering of the terminal object. -/
structure LocalGeneratorsData where
  /-- the index type of the covering -/
  I : Type u'
  /-- a family of objects which cover the terminal object -/
  X : I → C
  coversTop : J.CoversTop X
  /-- the data of sections of `M` over `X i` which generate `M.over (X i)` -/
  generators (i : I) : (M.over (X i)).GeneratingSections

{J : CategoryTheory.GrothendieckTopology C}

[∀ (X : C), CategoryTheory.HasWeakSheafify (J.over X) AddCommGrp]

[∀ (X : C), (J.over X).WEqualsLocallyBijective AddCommGrp]

[∀ (X : C), (J.over X).HasSheafCompose (CategoryTheory.forget₂ RingCat AddCommGrp)]


theorem Valid'.node4L_lemma₅ {a b c d : ℕ} (lr₂ : 3 * (b + c + 1 + d) ≤ 16 * a + 9)
    (mr₁ : 2 * d ≤ b + c + 1) (mm₂ : c ≤ 3 * b) : c + d + 1 ≤ 3 * (a + b + 1)


@[simp]
theorem cancel_natIso_inv_right {X : D} {Y : C} (f f' : X ⟶ G.obj Y) :
    f ≫ α.inv.app Y = f' ≫ α.inv.app Y ↔ f = f'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : C ⥤ D}
(α : F ≅ G)
{X : D}
{Y : C}
(f f' : X ⟶ G.obj Y)


theorem Continuous.update [DecidableEq ι] (hf : Continuous f) (i : ι) {g : X → π i}
    (hg : Continuous g) : Continuous fun a => update (f a) i (g a)

{X : Type u}
{ι : Type u_5}
{π : ι → Type u_6}
[TopologicalSpace X]
[T : (i : ι) → TopologicalSpace (π i)]
{f : X → (i : ι) → π i}
[DecidableEq ι]
(hf : Continuous f)
(i : ι)
{g : X → π i}
(hg : Continuous g)

Continuous fun a => Function.update (f a) i (g a)


lemma Antitone.partBind (hf : Antitone f) (hg : Antitone g) :
    Antitone fun x ↦ (f x).bind (g x)

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


@[simp]
theorem rootsExpandEquivRoots_apply (x) : (rootsExpandEquivRoots p f x : R) = x ^ p

(x : { x // x ∈ ((Polynomial.expand R p) f).roots.toFinset })

↑((Polynomial.rootsExpandEquivRoots p f) x) = ↑x ^ p


@[reassoc (attr := simp)]
theorem Cotrident.app_one (s : Cotrident f) (j : J) : f j ≫ s.ι.app one = s.ι.app zero

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

CategoryTheory.CategoryStruct.comp (f j) (s.ι.app CategoryTheory.Limits.WalkingParallelFamily.one) =
  s.ι.app CategoryTheory.Limits.WalkingParallelFamily.zero


theorem ne_of_isReal_isComplex {w w' : InfinitePlace K} (h : IsReal w) (h' : IsComplex w') :
    w ≠ w'

{K : Type u_2}
[Field K]
{w w' : NumberField.InfinitePlace K}
(h : w.IsReal)
(h' : w'.IsComplex)


theorem stoppedProcess_eq_of_ge {u : ι → Ω → β} {τ : Ω → ι} {i : ι} {ω : Ω} (h : τ ω ≤ i) :
    stoppedProcess u τ i ω = u (τ ω) ω

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[LinearOrder ι]
{u : ι → Ω → β}
{τ : Ω → ι}
{i : ι}
{ω : Ω}
(h : τ ω ≤ i)

MeasureTheory.stoppedProcess u τ i ω = u (τ ω) ω


theorem lineMap_le_right_iff_le (h : r < 1) : lineMap a b r ≤ b ↔ a ≤ b

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{a b : E}
{r : k}
(h : r < 1)


protected theorem isCompact [ProperSpace 𝕜] (a : A) : IsCompact (σ a)

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
[ProperSpace 𝕜]
(a : A)


theorem isComplete_aeStronglyMeasurable' [hp : Fact (1 ≤ p)] [CompleteSpace F] (hm : m ≤ m0) :
    IsComplete {f : Lp F p μ | AEStronglyMeasurable' m f μ}

{α : Type u_1}
{F : Type u_3}
{p : ℝ≥0∞}
[NormedAddCommGroup F]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[hp : Fact (1 ≤ p)]
[CompleteSpace F]
(hm : m ≤ m0)

IsComplete {f | MeasureTheory.AEStronglyMeasurable' m (↑↑f) μ}


protected theorem max_eq_right {a b : Nat} (h : a ≤ b) : max a b = b


theorem _root_.IsCoprime.codisjoint (h : IsCoprime I J) : Codisjoint I J

{R : Type u}
[CommSemiring R]
{I J : Ideal R}
(h : IsCoprime I J)


@[simp]
theorem round_add_nat (x : α) (y : ℕ) : round (x + y) = round x + y

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(x : α)
(y : ℕ)


theorem Continuous.strictMono_of_inj_boundedOrder' [BoundedOrder α] {f : α → δ}
    (hf_c : Continuous f) (hf_i : Injective f) : StrictMono f ∨ StrictAnti f

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{δ : Type u_1}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderClosedTopology δ]
[BoundedOrder α]
{f : α → δ}
(hf_c : Continuous f)
(hf_i : Function.Injective f)


/-- A slight variant of `hasDerivAt_of_tendstoLocallyUniformlyOn` with the assumption stated in
terms of `DifferentiableOn` rather than `HasDerivAt`. This makes a few proofs nicer in complex
analysis where holomorphicity is assumed but the derivative is not known a priori. -/
theorem hasDerivAt_of_tendsto_locally_uniformly_on' [NeBot l] {s : Set 𝕜} (hs : IsOpen s)
    (hf' : TendstoLocallyUniformlyOn (deriv ∘ f) g' l s)
    (hf : ∀ᶠ n in l, DifferentiableOn 𝕜 (f n) s)
    (hfg : ∀ x ∈ s, Tendsto (fun n => f n x) l (𝓝 (g x))) (hx : x ∈ s) : HasDerivAt g (g' x) x

(hf : ∀ᶠ (n : ι) in l, DifferentiableOn 𝕜 (f n) s)

(hfg : ∀ x ∈ s, Filter.Tendsto (fun n => f n x) l (𝓝 (g x)))


@[simp]
theorem mem_top (x : M) : x ∈ (⊤ : L.ElementarySubstructure M)

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


theorem _root_.MeasureTheory.Memℒp.neg_part {f : α → ℝ} (hf : Memℒp f p μ) :
    Memℒp (fun x => max (-f x) 0) p μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
(hf : MeasureTheory.Memℒp f p μ)

MeasureTheory.Memℒp (fun x => max (-f x) 0) p μ


lemma isUnramified_iff_card_stabilizer_eq_one [IsGalois k K] :
    IsUnramified k w ↔ Nat.card (Stab w) = 1

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
[Algebra k K]
{w : NumberField.InfinitePlace K}
[IsGalois k K]

NumberField.InfinitePlace.IsUnramified k w ↔ Nat.card ↥(MulAction.stabilizer (K ≃ₐ[k] K) w) = 1


/-- Let `f` be a function which is sufficiently close (in the Lipschitz sense) to a given linear
map `A`. Then it expands the volume of any set by at most `m` for any `m > det A`. -/
theorem addHaar_image_le_mul_of_det_lt (A : E →L[ℝ] E) {m : ℝ≥0}
    (hm : ENNReal.ofReal |A.det| < m) :
    ∀ᶠ δ in 𝓝[>] (0 : ℝ≥0),
      ∀ (s : Set E) (f : E → E), ApproximatesLinearOn f A s δ → μ (f '' s) ≤ m * μ s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
(A : E →L[ℝ] E)
{m : ℝ≥0}
(hm : ENNReal.ofReal |A.det| < ↑m)

∀ᶠ (δ : ℝ≥0) in 𝓝[>] 0, ∀ (s : Set E) (f : E → E), ApproximatesLinearOn f A s δ → μ (f '' s) ≤ ↑m * μ s


@[simp]
theorem coe_invMonoidHom : (invMonoidHom : α → α) = Inv.inv


@[norm_cast, simp]
theorem coe_pow (n : ℕ) : (↑(x ^ n) : ℍ[R]) = (x : ℍ[R]) ^ n

{R : Type u_3}
[CommRing R]
(x : R)
(n : ℕ)


/-- In the characteristic zero case, the centroid lies in the affine
span if the set is nonempty. -/
theorem centroid_mem_affineSpan_of_nonempty [CharZero k] {s : Finset ι} (p : ι → P)
    (h : s.Nonempty) : s.centroid k p ∈ affineSpan k (range p)

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
[CharZero k]
{s : Finset ι}
(p : ι → P)
(h : s.Nonempty)

Finset.centroid k s p ∈ affineSpan k (Set.range p)


@[simp]
theorem toSphere_apply_univ : μ.toSphere univ = dim E * μ (ball 0 1)

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

μ.toSphere Set.univ = ↑(dim E) * μ (Metric.ball 0 1)


@[simp]
theorem ofSigma_toSigma : ∀ w : WType β, ofSigma (toSigma w) = w

{α : Type u_1}
{β : α → Type u_2}
(w : WType β)


theorem IsGreatest.maximals_eq [PartialOrder α] (h : IsGreatest s a) : maximals (· ≤ ·) s = {a}

{α : Type u_1}
{s : Set α}
{a : α}
[PartialOrder α]
(h : IsGreatest s a)


/-- If `x` is not an isolated point of a topological space, then the interior of `{x}` is empty. -/
@[simp]
theorem interior_singleton (x : X) [NeBot (𝓝[≠] x)] : interior {x} = (∅ : Set X)

{X : Type u}
[TopologicalSpace X]
(x : X)
[(𝓝[≠] x).NeBot]


theorem ord_isLimit {c} (co : ℵ₀ ≤ c) : (ord c).IsLimit


theorem pow_natDegree_le_of_aeval_zero_of_monic_mem_map {x : S} (hx : aeval x f = 0)
    (hmo : f.Monic) :
    ∀ i, (f.map (algebraMap R S)).natDegree ≤ i → x ^ i ∈ 𝓟.map (algebraMap R S)

{R : Type u}
[CommRing R]
{𝓟 : Ideal R}
{f : R[X]}
(hf : f.IsWeaklyEisensteinAt 𝓟)
{S : Type v}
[CommRing S]
[Algebra R S]
{x : S}
(hx : (Polynomial.aeval x) f = 0)
(hmo : f.Monic)
(i : ℕ)

(Polynomial.map (algebraMap R S) f).natDegree ≤ i → x ^ i ∈ Ideal.map (algebraMap R S) 𝓟


theorem filter_of_true {p : Box ι → Prop} (hp : ∀ J ∈ π, p J) : π.filter p = π

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)
{p : BoxIntegral.Box ι → Prop}
(hp : ∀ J ∈ π, p J)


theorem of_mul [Mul R] [IsScalarTower R R M] (ab : IsSMulRegular M (a * b)) :
    IsSMulRegular M b

{R : Type u_1}
{M : Type u_3}
{a b : R}
[SMul R M]
[Mul R]
[IsScalarTower R R M]
(ab : IsSMulRegular M (a * b))


theorem mem_def {a : α} {s : Finset α} : a ∈ s ↔ a ∈ s.1


lemma toSpec_bijective {f : A} {m : ℕ} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) :
    Function.Bijective (toSpec (𝒜 := 𝒜) (f := f))

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
{f : A}
{m : ℕ}
(f_deg : f ∈ 𝒜 m)
(hm : 0 < m)

Function.Bijective ⇑(AlgebraicGeometry.ProjIsoSpecTopComponent.toSpec 𝒜 f)


@[simp]
theorem refl_symm : (StarRingEquiv.refl : A ≃⋆+* A).symm = StarRingEquiv.refl


theorem sigmaFinite_bot_iff (μ : @Measure α ⊥) : SigmaFinite μ ↔ IsFiniteMeasure μ

{α : Type u_1}
(μ : MeasureTheory.Measure α)

MeasureTheory.SigmaFinite μ ↔ MeasureTheory.IsFiniteMeasure μ


theorem natDegree_hasseDeriv_le (p : R[X]) (n : ℕ) :
    natDegree (hasseDeriv n p) ≤ natDegree p - n

{R : Type u_1}
[Semiring R]
(p : Polynomial R)
(n : ℕ)

((Polynomial.hasseDeriv n) p).natDegree ≤ p.natDegree - n


theorem Memℒp.indicator (hs : MeasurableSet s) (hf : Memℒp f p μ) : Memℒp (s.indicator f) p μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : α → E}
{s : Set α}
(hs : MeasurableSet s)
(hf : MeasureTheory.Memℒp f p μ)


theorem coe_ringEquiv_injective : Function.Injective ((↑) : (A₁ ≃ₐ[R] A₂) → A₁ ≃+* A₂)

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


theorem embDomain_notin_range (f : α ↪ β) (v : α →₀ M) (a : β) (h : a ∉ Set.range f) :
    embDomain f v a = 0

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[Zero M]
(f : α ↪ β)
(v : α →₀ M)
(a : β)
(h : a ∉ Set.range ⇑f)


/-- Multiplying each column by a fixed `v j` multiplies the determinant by
the product of the `v`s. -/
theorem det_mul_column (v : n → R) (A : Matrix n n R) :
    det (of fun i j => v i * A i j) = (∏ i, v i) * det A

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(v : n → R)
(A : Matrix n n R)

(Matrix.of fun i j => v i * A i j).det = (∏ i : n, v i) * A.det


theorem setLIntegral_lt_top_of_isCompact [TopologicalSpace α] {s : Set α}
    (hs : μ s ≠ ∞) (hsc : IsCompact s) {f : α → ℝ≥0} (hf : Continuous f) :
    ∫⁻ x in s, f x ∂μ < ∞

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[TopologicalSpace α]
{s : Set α}
(hs : μ s ≠ ⊤)
(hsc : IsCompact s)
{f : α → ℝ≥0}
(hf : Continuous f)


@[simp] lemma ofENat_le_ofNat {m : ℕ∞} {n : ℕ} [n.AtLeastTwo] :
    ofENat m ≤ no_index (OfNat.ofNat n) ↔ m ≤ OfNat.ofNat n


@[simp] theorem forgetMonoidal_ε : (forgetMonoidal C).ε = 𝟙 (𝟙_ C)

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


@[to_additive]
theorem units_inv_left : Commute (↑u) a → Commute (↑u⁻¹) a

{M : Type u_1}
[Monoid M]
{a : M}
{u : Mˣ}


@[simp]
theorem inter_singleton_nonempty : (s ∩ {a}).Nonempty ↔ a ∈ s


/-- Matroids obey the maximality axiom -/
theorem existsMaximalSubsetProperty_indep (M : Matroid α) :
    ∀ X, X ⊆ M.E → ExistsMaximalSubsetProperty M.Indep X

{α : Type u_1}
(M : Matroid α)
(X : Set α)

X ⊆ M.E → Matroid.ExistsMaximalSubsetProperty M.Indep X


theorem segment_eq_image (x y : E) :
    [x -[𝕜] y] = (fun θ : 𝕜 => (1 - θ) • x + θ • y) '' Icc (0 : 𝕜) 1

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(x y : E)


theorem tensorObj_X (A B : Comon_ C) : (A ⊗ B).X = A.X ⊗ B.X

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(A B : Comon_ C)


theorem zero_apply (x : P) : (0 : P →ᴬ[R] W) x = 0

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace W]
(x : P)


/-- The data of a monad on C consists of an endofunctor T together with natural transformations
η : 𝟭 C ⟶ T and μ : T ⋙ T ⟶ T satisfying three equations:
- T μ_X ≫ μ_X = μ_(TX) ≫ μ_X (associativity)
- η_(TX) ≫ μ_X = 1_X (left unit)
- Tη_X ≫ μ_X = 1_X (right unit)
-/
structure Monad extends C ⥤ C where
  /-- The unit for the monad. -/
  η : 𝟭 _ ⟶ toFunctor
  /-- The multiplication for the monad. -/
  μ : toFunctor ⋙ toFunctor ⟶ toFunctor
  assoc : ∀ X, toFunctor.map (NatTrans.app μ X) ≫ μ.app _ = μ.app _ ≫ μ.app _ := by aesop_cat
  left_unit : ∀ X : C, η.app (toFunctor.obj X) ≫ μ.app _ = 𝟙 _ := by aesop_cat
  right_unit : ∀ X : C, toFunctor.map (η.app X) ≫ μ.app _ = 𝟙 _ := by aesop_cat

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

CategoryTheory.CategoryStruct.comp (self.map (self.η.app X)) (self.μ.app X) =
  CategoryTheory.CategoryStruct.id (self.obj ((CategoryTheory.Functor.id C).obj X))


theorem or_iff_right (ha : ¬a) : a ∨ b ↔ b


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) toLex_smul]
theorem toLex_pow [Pow α β] (a : α) (b : β) : toLex (a ^ b) = toLex a ^ b

{α : Type u_1}
{β : Type u_2}
[Pow α β]
(a : α)
(b : β)


@[to_additive]
theorem sInf_div : sInf (s / t) = sInf s / sSup 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 nonzeroMinimum_le_iff {xs : List Nat} {y : Nat} :
    xs.nonzeroMinimum ≤ y ↔ xs.nonzeroMinimum = 0 ∨ ∃ x ∈ xs, x ≤ y ∧ x ≠ 0

xs.nonzeroMinimum ≤ y ↔ xs.nonzeroMinimum = 0 ∨ ∃ x, x ∈ xs ∧ x ≤ y ∧ x ≠ 0


theorem map_one_of_isMulOneCocycle {f : G → M} (hf : IsMulOneCocycle f) :
    f 1 = 1

(hf : groupCohomology.IsMulOneCocycle f)


/-- A `red` node with the red-red invariant has balanced children. -/
protected theorem RedRed.of_red : RedRed p (node red a x b) n →
    ∃ c₁ c₂, Balanced a c₁ n ∧ Balanced b c₂ n

∀ {α : Type u_1} {a : Batteries.RBNode α} {x : α} {b : Batteries.RBNode α} {n : Nat},
  Batteries.RBNode.RedRed p (Batteries.RBNode.node Batteries.RBColor.red a x b) n →
    ∃ c₁ c₂, a.Balanced c₁ n ∧ b.Balanced c₂ n


theorem edgeDensity_nonneg (s : Finset α) (t : Finset β) : 0 ≤ edgeDensity r s t

{α : Type u_4}
{β : Type u_5}
(r : α → β → Prop)
[(a : α) → DecidablePred (r a)]
(s : Finset α)
(t : Finset β)


@[to_additive (attr := simp)] lemma mulDissociated_inv : MulDissociated s⁻¹ ↔ MulDissociated s

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


/-- If `x` and `y` are joined in the set `F`, then they are joined in the subtype `F`. -/
theorem JoinedIn.joined_subtype (h : JoinedIn F x y) :
    Joined (⟨x, h.source_mem⟩ : F) (⟨y, h.target_mem⟩ : F)

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{F : Set X}
(h : JoinedIn F x y)


@[simp]
theorem BinaryCofan.mk_inl {P : C} (ι₁ : X ⟶ P) (ι₂ : Y ⟶ P) : (BinaryCofan.mk ι₁ ι₂).inl = ι₁

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y P : C}
(ι₁ : X ⟶ P)
(ι₂ : Y ⟶ P)

(CategoryTheory.Limits.BinaryCofan.mk ι₁ ι₂).inl = ι₁


/-- The total complex of a bicomplex. -/
@[simps d]
noncomputable def total : HomologicalComplex C c₁₂

{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₁₂)

(K.total c₁₂).d i₁₂ i₁₂' = K.D₁ c₁₂ i₁₂ i₁₂' + K.D₂ c₁₂ i₁₂ i₁₂'


/--
Two elements `a` and `b` commute if `a * b = b * a`.
-/
@[to_additive]
theorem commute_iff_eq [Mul S] (a b : S) : Commute a b ↔ a * b = b * a


@[simp]
theorem inr_sub [SubNegZeroMonoid R] [Sub M] (m₁ m₂ : M) :
    (inr (m₁ - m₂) : tsze R M) = inr m₁ - inr m₂

(R : Type u)
{M : Type v}
[SubNegZeroMonoid R]
[Sub M]
(m₁ m₂ : M)

TrivSqZeroExt.inr (m₁ - m₂) = TrivSqZeroExt.inr m₁ - TrivSqZeroExt.inr m₂


lemma natCast_dvd {m : ℕ} : (m : ℤ) ∣ n ↔ m ∣ n.natAbs


theorem tendsto_norm_zpow_nhdsWithin_0_atTop {𝕜 : Type*} [NormedDivisionRing 𝕜] {m : ℤ}
    (hm : m < 0) :
    Tendsto (fun x : 𝕜 ↦ ‖x ^ m‖) (𝓝[≠] 0) atTop

{𝕜 : Type u_4}
[NormedDivisionRing 𝕜]
{m : ℤ}
(hm : m < 0)

Filter.Tendsto (fun x => ‖x ^ m‖) (𝓝[≠] 0) Filter.atTop


theorem mem_nhds_iff' {l : Filter α} {S : Set (Filter α)} :
    S ∈ 𝓝 l ↔ ∃ t ∈ l, ∀ ⦃l' : Filter α⦄, t ∈ l' → l' ∈ S

{α : Type u_2}
{l : Filter α}
{S : Set (Filter α)}


lemma AddMonoidHom.mulLeft_eq_mulRight_iff_forall_commute {a : R} :
    mulLeft a = mulRight a ↔ ∀ b, Commute a b

{R : Type u_1}
[NonUnitalNonAssocSemiring R]
{a : R}

AddMonoidHom.mulLeft a = AddMonoidHom.mulRight a ↔ ∀ (b : R), Commute a b


@[to_additive]
theorem Filter.Tendsto.pow {l : Filter α} {f : α → M} {x : M} (hf : Tendsto f l (𝓝 x)) (n : ℕ) :
    Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n))

{α : Type u_2}
{M : Type u_3}
[TopologicalSpace M]
[Monoid M]
[ContinuousMul M]
{l : Filter α}
{f : α → M}
{x : M}
(hf : Filter.Tendsto f l (𝓝 x))
(n : ℕ)

Filter.Tendsto (fun x => f x ^ n) l (𝓝 (x ^ n))


/-- `orthogonal.orthogonal` preserves the `≤` ordering of two
subspaces. -/
theorem orthogonal_orthogonal_monotone {K₁ K₂ : Submodule 𝕜 E} (h : K₁ ≤ K₂) : K₁ᗮᗮ ≤ K₂ᗮᗮ

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K₁ K₂ : Submodule 𝕜 E}
(h : K₁ ≤ K₂)


theorem suppBddBelow_supp_PWO (f : Γ → R) (hf : BddBelow (Function.support f)) :
    (Function.support f).IsPWO

{Γ : Type u_1}
{R : Type u_2}
[Zero R]
[LinearOrder Γ]
[LocallyFiniteOrder Γ]
(f : Γ → R)
(hf : BddBelow (Function.support f))


@[to_additive (attr := simp, norm_cast)]
theorem mem_toSubgroup : g ∈ (U : Subgroup G) ↔ g ∈ U

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

g ∈ ↑U ↔ g ∈ U


@[nolint unusedHavesSuffices] -- Porting note: false positive
theorem denumerable_list_aux : ∀ n : ℕ, ∃ a ∈ @decodeList α _ n, encodeList a = n

∃ a ∈ Encodable.decodeList n, Encodable.encodeList a = n


protected theorem mul_inv {a b : ℝ≥0∞} (ha : a ≠ 0 ∨ b ≠ ∞) (hb : a ≠ ∞ ∨ b ≠ 0) :
    (a * b)⁻¹ = a⁻¹ * b⁻¹

{a b : ENNReal}
(ha : a ≠ 0 ∨ b ≠ ⊤)
(hb : a ≠ ⊤ ∨ b ≠ 0)


@[to_additive]
theorem dist_mul_mul_le_of_le (h₁ : dist a₁ b₁ ≤ r₁) (h₂ : dist a₂ b₂ ≤ r₂) :
    dist (a₁ * a₂) (b₁ * b₂) ≤ r₁ + r₂

{E : Type u_3}
[SeminormedAddCommGroup E]
{a₁ a₂ b₁ b₂ : E}
{r₁ r₂ : ℝ}
(h₁ : dist a₁ b₁ ≤ r₁)
(h₂ : dist a₂ b₂ ≤ r₂)


/-- The type of bounded maps from `α` to `β`, the maps which send a bounded set to a bounded set. -/
structure LocallyBoundedMap (α β : Type*) [Bornology α] [Bornology β] where
  /-- The function underlying a locally bounded map -/
  toFun : α → β
  /-- The pullback of the `Bornology.cobounded` filter under the function is contained in the
  cobounded filter. Equivalently, the function maps bounded sets to bounded sets. -/
  comap_cobounded_le' : (cobounded β).comap toFun ≤ cobounded α

{α : Type u_6}
{β : Type u_7}
[Bornology α]
[Bornology β]
(self : LocallyBoundedMap α β)

Filter.comap self.toFun (Bornology.cobounded β) ≤ Bornology.cobounded α


/--
If `s ⊆ fixedBy α g`, then `g • s = s`, which means that `s ∈ fixedBy (Set α) g`.

Note that the reverse implication is in general not true, as `s ∈ fixedBy (Set α) g` is a
weaker statement (it allows for points `x ∈ s` for which `g • x ≠ x` and `g • x ∈ s`).
-/
@[to_additive "If `s ⊆ fixedBy α g`, then `g +ᵥ s = s`, which means that `s ∈ fixedBy (Set α) g`.

Note that the reverse implication is in general not true, as `s ∈ fixedBy (Set α) g` is a
weaker statement (it allows for points `x ∈ s` for which `g +ᵥ x ≠ x` and `g +ᵥ x ∈ s`)."]
theorem set_mem_fixedBy_of_subset_fixedBy {s : Set α} {g : G} (s_ss_fixedBy : s ⊆ fixedBy α g) :
    s ∈ fixedBy (Set α) g

(s_ss_fixedBy : s ⊆ MulAction.fixedBy α g)


theorem eq_one_of_map_eq_one {S : Type*} [Semiring S] [Nontrivial S] (f : R →+* S) (hp : p.Monic)
    (map_eq : p.map f = 1) : p = 1

{R : Type u}
[Semiring R]
{p : R[X]}
{S : Type u_1}
[Semiring S]
[Nontrivial S]
(f : R →+* S)
(hp : p.Monic)
(map_eq : Polynomial.map f p = 1)


@[to_additive]
theorem lt_of_mul_lt_of_one_le_right [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c : α}
    (h : a * b < c) (hle : 1 ≤ a) :
    b < c

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


theorem union_comm_of_disjoint {s₁ s₂ : AList β} (h : Disjoint s₁ s₂) :
    (s₁ ∪ s₂).entries ~ (s₂ ∪ s₁).entries

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{s₁ s₂ : AList β}
(h : s₁.Disjoint s₂)


/-- If `f` is locally integrable, and `f =O[cocompact] g` for some `g` integrable at `cocompact`,
then `f` is integrable. -/
theorem LocallyIntegrable.integrable_of_isBigO_cocompact [IsMeasurablyGenerated (cocompact α)]
    (hf : LocallyIntegrable f μ) (ho : f =O[cocompact α] g)
    (hg : IntegrableAtFilter g (cocompact α) μ) : Integrable f μ

(hf : MeasureTheory.LocallyIntegrable f μ)

(hg : MeasureTheory.IntegrableAtFilter g (Filter.cocompact α) μ)


@[to_additive (attr := simp)]
theorem mulSingle_eq_same (i : I) (x : f i) : mulSingle i x i = x

{I : Type u}
{f : I → Type v₁}
[DecidableEq I]
[(i : I) → Zero (f i)]
(i : I)
(x : f i)


theorem le_of_tendsto {x : Filter β} [NeBot x] (lim : Tendsto f x (𝓝 a))
    (h : ∀ᶠ c in x, f c ≤ b) : a ≤ b

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder α]
[ClosedIicTopology α]
{f : β → α}
{a b : α}
{x : Filter β}
[x.NeBot]
(lim : Filter.Tendsto f x (𝓝 a))
(h : ∀ᶠ (c : β) in x, f c ≤ b)


@[simp]
theorem toSesqForm_apply_coe (f : E →L[𝕜] E') (x : E') : toSesqForm f x = (innerSL 𝕜 x).comp f

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{E' : Type u_4}
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
(f : E →L[𝕜] E')
(x : E')

(ContinuousLinearMap.toSesqForm f) x = ((innerSL 𝕜) x).comp f


@[simp]
theorem closure_union : closure (s ∪ t) = closure s ∪ closure t

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


theorem uIcc_eq_union : [[a, b]] = Icc a b ∪ Icc b a

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

[[a, b]] = Finset.Icc a b ∪ Finset.Icc b a


@[to_additive leftAddCoset_rightAddCoset]
theorem leftCoset_rightCoset (s : Set α) (a b : α) : op b • a • s = a • (op b • s)

{α : Type u_1}
[Semigroup α]
(s : Set α)
(a b : α)

MulOpposite.op b • a • s = a • MulOpposite.op b • s


@[to_additive (attr := simp)]
theorem map.id (x : FreeGroup α) : map id x = x


theorem nhds_basis_closed_eball : (𝓝 x).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) (closedBall x)

{α : Type u}
[PseudoEMetricSpace α]
{x : α}

(𝓝 x).HasBasis (fun ε => 0 < ε) (EMetric.closedBall x)


theorem AEDisjoint.preimage {ν : Measure β} {f : α → β} {s t : Set β} (ht : AEDisjoint ν s t)
    (hf : QuasiMeasurePreserving f μ ν) : AEDisjoint μ (f ⁻¹' s) (f ⁻¹' t)

(hf : MeasureTheory.Measure.QuasiMeasurePreserving f μ ν)

MeasureTheory.AEDisjoint μ (f ⁻¹' s) (f ⁻¹' t)


theorem coe_charFn (hU : IsClopen U) : (charFn Y hU : X → Y) = Set.indicator U 1

{X : Type u_1}
(Y : Type u_2)
[TopologicalSpace X]
[MulZeroOneClass Y]
{U : Set X}
(hU : IsClopen U)

⇑(LocallyConstant.charFn Y hU) = U.indicator 1


lemma isLocallyClosed_iff_isOpen_coborder : IsLocallyClosed s ↔ IsOpen (coborder s)

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


@[simp]
theorem preimage_floor_zero : (floor : α → ℕ) ⁻¹' {0} = Iio 1

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]


@[to_additive]
theorem one_iff_ker_inv {f : G → H} (hf : IsGroupHom f) (a b : G) : f a = f b ↔ f (a * b⁻¹) = 1

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]
{f : G → H}
(hf : IsAddGroupHom f)
(a b : G)


theorem nnnorm_ofSubsingleton_id_le [Subsingleton ι] (i : ι) :
    ‖ofSubsingleton 𝕜 G G i (.id _ _)‖₊ ≤ 1

(𝕜 : Type u)
{ι : Type v}
(G : Type wG)
[Fintype ι]
[NontriviallyNormedField 𝕜]
[SeminormedAddCommGroup G]
[NormedSpace 𝕜 G]
[Subsingleton ι]
(i : ι)

‖(ContinuousMultilinearMap.ofSubsingleton 𝕜 G G i) (ContinuousLinearMap.id 𝕜 G)‖₊ ≤ 1


{α : Type u_1}
[Preorder α]
{s : LowerSet α}
{t : Set α}


/-- The sets of `N`-smooth and of `(N+1)`-smooth numbers are the same when `N` is not prime.
See `Nat.equivProdNatSmoothNumbers` for when `N` is prime. -/
lemma smoothNumbers_succ {N : ℕ} (hN : ¬ N.Prime) : N.succ.smoothNumbers = N.smoothNumbers


theorem Iic_eq_powerset : Iic s = s.powerset

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


lemma tilted_apply_eq_ofReal_integral [SFinite μ] (f : α → ℝ) (s : Set α) :
    μ.tilted f s = ENNReal.ofReal (∫ a in s, exp (f a) / ∫ x, exp (f x) ∂μ ∂μ)

{α : Type u_1}
{mα : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.SFinite μ]
(f : α → ℝ)
(s : Set α)

(μ.tilted f) s = ENNReal.ofReal (∫ (a : α) in s, rexp (f a) / ∫ (x : α), rexp (f x) ∂μ ∂μ)


theorem range_comp_val : (f.comp S.val).range = S.map f

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

(f.comp S.val).range = Subalgebra.map f S


theorem mem_lowerBounds_image (Hf : AntitoneOn f t) (Hst : s ⊆ t) :
    a ∈ upperBounds s → a ∈ t → f a ∈ lowerBounds (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s t : Set α}
{a : α}
(Hf : AntitoneOn f t)
(Hst : s ⊆ t)


@[simp]
theorem bind_smul (κ : Kernel α β) (μ : Measure α) (r : ℝ≥0∞) : (r • μ).bind κ = r • μ.bind κ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ : ProbabilityTheory.Kernel α β)
(μ : MeasureTheory.Measure α)
(r : ℝ≥0∞)


theorem add_le_right_iff_mul_omega_le {a b : Ordinal} : a + b ≤ b ↔ a * omega ≤ b


theorem mkInductiveAux₃ (i j : ℕ) (h : i + 1 = j) :
    (mkInductiveAux₂ e zero comm_zero one comm_one succ i).2.1 ≫ (Q.xPrevIso h).hom =
      (P.xNextIso h).inv ≫ (mkInductiveAux₂ e zero comm_zero one comm_one succ j).1

(comm_one : e.f 1 = P.d 1 0 ≫ zero + one ≫ Q.d 2 1)

(Homotopy.mkInductiveAux₂ e zero comm_zero one comm_one succ i).snd.fst ≫ (HomologicalComplex.xPrevIso Q h).hom =
  (HomologicalComplex.xNextIso P h).inv ≫ (Homotopy.mkInductiveAux₂ e zero comm_zero one comm_one succ j).fst


theorem integrable_map_measure {f : α → δ} {g : δ → β}
    (hg : AEStronglyMeasurable g (Measure.map f μ)) (hf : AEMeasurable f μ) :
    Integrable g (Measure.map f μ) ↔ Integrable (g ∘ f) μ

(hg : MeasureTheory.AEStronglyMeasurable g (MeasureTheory.Measure.map f μ))

MeasureTheory.Integrable g (MeasureTheory.Measure.map f μ) ↔ MeasureTheory.Integrable (g ∘ f) μ


lemma toMvPolynomial_add (f g : M₁ →ₗ[R] M₂) :
    (f + g).toMvPolynomial b₁ b₂ = f.toMvPolynomial b₁ b₂ + g.toMvPolynomial b₁ b₂

{R : Type u_1}
{M₁ : Type u_2}
{M₂ : Type u_3}
{ι₁ : Type u_4}
{ι₂ : Type u_5}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
[Fintype ι₁]
[Finite ι₂]
[DecidableEq ι₁]
(b₁ : Basis ι₁ R M₁)
(b₂ : Basis ι₂ R M₂)
(f g : M₁ →ₗ[R] M₂)

LinearMap.toMvPolynomial b₁ b₂ (f + g) = LinearMap.toMvPolynomial b₁ b₂ f + LinearMap.toMvPolynomial b₁ b₂ g


@[to_additive]
theorem cauchySeq_finset_iff_tprod_vanishing :
    (CauchySeq fun s : Finset β ↦ ∏ b ∈ s, f b) ↔
      ∀ e ∈ 𝓝 (1 : α), ∃ s : Finset β, ∀ t : Set β, Disjoint t s → (∏' b : t, f b) ∈ e

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
{f : β → α}

(CauchySeq fun s => ∑ b ∈ s, f b) ↔ ∀ e ∈ 𝓝 0, ∃ s, ∀ (t : Set β), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e


theorem χ₈'_nat_eq_if_mod_eight (n : ℕ) :
    χ₈' n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 3 then 1 else -1

ZMod.χ₈' ↑n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 3 then 1 else -1


/-- Given a Localization map `f : M →* N` for a Submonoid `S ⊆ M`, for all `x₁ : M` and `y₁ ∈ S`,
if `x₂ : M, y₂ ∈ S` are such that `f x₁ * (f y₁)⁻¹ * f y₂ = f x₂`, then there exists `c ∈ S`
such that `x₁ * y₂ * c = x₂ * y₁ * c`. -/
@[to_additive
    "Given a Localization map `f : M →+ N` for a Submonoid `S ⊆ M`, for all `x₁ : M`
and `y₁ ∈ S`, if `x₂ : M, y₂ ∈ S` are such that `(f x₁ - f y₁) + f y₂ = f x₂`, then there exists
`c ∈ S` such that `x₁ + y₂ + c = x₂ + y₁ + c`."]
theorem exists_of_sec_mk' (x) (y : S) :
    ∃ c : S, ↑c * (↑(f.sec <| f.mk' x y).2 * x) = c * (y * (f.sec <| f.mk' x y).1)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(x : M)
(y : ↥S)

∃ c, ↑c + (↑(f.sec (f.mk' x y)).2 + x) = ↑c + (↑y + (f.sec (f.mk' x y)).1)


@[to_additive]
theorem IsOpen.smul {s : Set α} (hs : IsOpen s) (c : G) : IsOpen (c • s)

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


theorem le_iff_val_le_val {a b : Fin n} : a ≤ b ↔ (a : ℕ) ≤ b

a ≤ b ↔ ↑a ≤ ↑b


theorem blockDiagonal'_eq_blockDiagonal (M : o → Matrix m n α) {k k'} (i j) :
    blockDiagonal M (i, k) (j, k') = blockDiagonal' M ⟨k, i⟩ ⟨k', j⟩

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[DecidableEq o]
[Zero α]
(M : o → Matrix m n α)
{k k' : o}
(i : m)
(j : n)

Matrix.blockDiagonal M (i, k) (j, k') = Matrix.blockDiagonal' M ⟨k, i⟩ ⟨k', j⟩


@[simp]
theorem coe_extendScalars : (extendScalars h : Set L) = (E : Set L)

{L : Type u_2}
[Field L]
{F E : Subfield L}
(h : F ≤ E)


{K : Type u}
[Field K]
{L : Type u}
[Field L]
(f : K →+* L)
(a : L)


theorem pullbackConeOfLeftLift_fst :
    pullbackConeOfLeftLift f g s ≫ (pullbackConeOfLeft f g).fst = s.fst

{X Y Z : AlgebraicGeometry.PresheafedSpace C}

[hf : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]

(s : CategoryTheory.Limits.PullbackCone f g)

AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftLift f g s ≫
    (AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.pullbackConeOfLeft f g).fst =
  s.fst


theorem algebraMap_eq_diagonalRingHom :
    algebraMap R (Matrix n n α) = (diagonalRingHom n α).comp (algebraMap R _)

{n : Type u_3}
{R : Type u_7}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommSemiring R]
[Semiring α]
[Algebra R α]

algebraMap R (Matrix n n α) = (Matrix.diagonalRingHom n α).comp (algebraMap R (n → α))


@[to_additive (attr := simp)]
theorem inv_mk [Inv G] [Inv H] (a : G) (b : H) : (a, b)⁻¹ = (a⁻¹, b⁻¹)

{G : Type u_3}
{H : Type u_4}
[Neg G]
[Neg H]
(a : G)
(b : H)


/-- If there is a scalar `c` with `‖c‖>1`, then any element with nonzero norm can be
moved by scalar multiplication to any shell of width `‖c‖`. Also recap information on the norm of
the rescaling element that shows up in applications. -/
lemma rescale_to_shell_semi_normed {c : 𝕜} (hc : 1 < ‖c‖) {ε : ℝ} (εpos : 0 < ε)
    {x : E} (hx : ‖x‖ ≠ 0) :
    ∃d : 𝕜, d ≠ 0 ∧ ‖d • x‖ < ε ∧ (ε/‖c‖ ≤ ‖d • x‖) ∧ (‖d‖⁻¹ ≤ ε⁻¹ * ‖c‖ * ‖x‖)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
{c : 𝕜}
(hc : 1 < ‖c‖)
{ε : ℝ}
(εpos : 0 < ε)
{x : E}
(hx : ‖x‖ ≠ 0)

∃ d, d ≠ 0 ∧ ‖d • x‖ < ε ∧ ε / ‖c‖ ≤ ‖d • x‖ ∧ ‖d‖⁻¹ ≤ ε⁻¹ * ‖c‖ * ‖x‖


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

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


/-- The resolution maps intertwine the descent of a morphism and that morphism. -/
@[reassoc (attr := simp)]
theorem desc_commutes {Y Z : C} (f : Z ⟶ Y) (I : InjectiveResolution Y)
    (J : InjectiveResolution Z) : J.ι ≫ desc f I J = (CochainComplex.single₀ C).map f ≫ I.ι

(I : CategoryTheory.InjectiveResolution Y)

(J : CategoryTheory.InjectiveResolution Z)

J.ι ≫ CategoryTheory.InjectiveResolution.desc f I J = (CochainComplex.single₀ C).map f ≫ I.ι


theorem Indep.subset_basis'_of_subset (hI : M.Indep I) (hIX : I ⊆ X) :
    ∃ J, M.Basis' J X ∧ I ⊆ J

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


/-- If `F` creates colimits, and `D` has all colimits, then `C` has all colimits. -/
theorem hasColimits_of_hasColimits_createsColimits (F : C ⥤ D) [HasColimitsOfSize.{w, w'} D]
    [CreatesColimitsOfSize.{w, w'} F] : HasColimitsOfSize.{w, w'} C

[CategoryTheory.Limits.HasColimitsOfSize.{w, w', v₂, u₂} D]

[CategoryTheory.CreatesColimitsOfSize.{w, w', v₁, v₂, u₁, u₂} F]

CategoryTheory.Limits.HasColimitsOfSize.{w, w', v₁, u₁} C


@[simp] theorem map_empty (f : α → β) : map f #[] = #[]

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


/-- Equation theorem for `Int.mod` -/
private theorem Int.negSucc_emod (m : Nat) (n : Int) :
    -(m + 1) % n = Int.subNatNat (Int.natAbs n) ((m % Int.natAbs n) + 1)

-(↑m + 1) % n = Int.subNatNat n.natAbs (m % n.natAbs + 1)


theorem coe_sInf' (S : Set L) : (↑(sInf S) : α) = ⨅ N ∈ S, (N : α)

{α : Type u_1}
[CompleteLattice α]
{L : CompleteSublattice α}
(S : Set ↥L)


theorem eval_eq_zero_of_eval₂_denom_eq_zero {x : RatFunc K}
    (h : Polynomial.eval₂ f a (denom x) = 0) : eval f a x = 0

{K : Type u}
[Field K]
{L : Type u}
[Field L]
{f : K →+* L}
{a : L}
{x : RatFunc K}
(h : Polynomial.eval₂ f a x.denom = 0)


theorem eq_pow_of_pell_lem {a y k : ℕ} (hy0 : y ≠ 0) (hk0 : k ≠ 0) (hyk : y ^ k < a) :
    (↑(y ^ k) : ℤ) < 2 * a * y - y * y - 1


/-- If a bounded linear map is a bijection, then its inverse is also a bounded linear map. -/
@[continuity]
theorem continuous_symm (e : E ≃ₛₗ[σ] F) (h : Continuous e) : Continuous e.symm

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{σ' : 𝕜' →+* 𝕜}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
[RingHomIsometric σ]
[RingHomIsometric σ']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
[CompleteSpace F]
[CompleteSpace E]
(e : E ≃ₛₗ[σ] F)
(h : Continuous ⇑e)


@[simp]
theorem Dart.edge_mem (d : G.Dart) : d.edge ∈ G.edgeSet

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


theorem cauchySeq_iff_tendsto_dist_atTop_0 [Nonempty β] [SemilatticeSup β] {u : β → α} :
    CauchySeq u ↔ Tendsto (fun n : β × β => dist (u n.1) (u n.2)) atTop (𝓝 0)

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

CauchySeq u ↔ Filter.Tendsto (fun n => dist (u n.1) (u n.2)) Filter.atTop (𝓝 0)


/-- A base angle of an isosceles triangle is acute, oriented angle-at-point form. -/
theorem abs_oangle_left_toReal_lt_pi_div_two_of_dist_eq {p₁ p₂ p₃ : P}
    (h : dist p₁ p₂ = dist p₁ p₃) : |(∡ p₂ p₃ p₁).toReal| < π / 2

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


/-- The order embedding sending `b` to `a * b`, for some fixed `a`.
See also `OrderIso.mulLeft` when working in an ordered group. -/
@[to_additive (attr := simps!)
      "The order embedding sending `b` to `a + b`, for some fixed `a`.
       See also `OrderIso.addLeft` when working in an additive ordered group."]
def OrderEmbedding.mulLeft {α : Type*} [Mul α] [LinearOrder α]
    [CovariantClass α α (· * ·) (· < ·)] (m : α) : α ↪o α

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


@[simp]
theorem ι_comp_lift : lift R f ∘ ι R = f

(R : Type u₁)
{L : Type u₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{A : Type u₃}
[Ring A]
[Algebra R A]
(f : L →ₗ⁅R⁆ A)

⇑((UniversalEnvelopingAlgebra.lift R) f) ∘ ⇑(UniversalEnvelopingAlgebra.ι R) = ⇑f


/-- `Equiv.mulLeft` as an `OrderIso`. See also `OrderEmbedding.mulLeft`. -/
@[to_additive (attr := simps! (config := { simpRhs := true }) toEquiv apply)
  "`Equiv.addLeft` as an `OrderIso`. See also `OrderEmbedding.addLeft`."]
def OrderIso.mulLeft (a : α) : α ≃o α

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

(OrderIso.mulLeft a).toEquiv = Equiv.mulLeft a


@[simp high]
protected theorem toFinset_setOf [Fintype α] (p : α → Prop) [DecidablePred p]
    (h : { x | p x }.Finite) : h.toFinset = Finset.univ.filter p

{α : Type u}
[Fintype α]
(p : α → Prop)
[DecidablePred p]
(h : {x | p x}.Finite)

h.toFinset = Finset.filter p Finset.univ


theorem monic_ascPochhammer (n : ℕ) [Nontrivial S] [NoZeroDivisors S] :
    Monic <| ascPochhammer S n

(S : Type u)
[Semiring S]
(n : ℕ)
[Nontrivial S]
[NoZeroDivisors S]


theorem IsQF.isPrenex {φ : L.BoundedFormula α n} : IsQF φ → IsPrenex φ

{L : FirstOrder.Language}
{α : Type u'}
{n : ℕ}
{φ : L.BoundedFormula α n}


/-- If the indicators of measurable sets `Aᵢ` tend pointwise almost everywhere to the indicator
of a measurable set `A` and we eventually have `Aᵢ ⊆ B` for some set `B` of finite measure, then
the measures of `Aᵢ` tend to the measure of `A`. -/
lemma tendsto_measure_of_ae_tendsto_indicator {μ : Measure α} (A_mble : MeasurableSet A)
    (As_mble : ∀ i, MeasurableSet (As i)) {B : Set α} (B_mble : MeasurableSet B)
    (B_finmeas : μ B ≠ ∞) (As_le_B : ∀ᶠ i in L, As i ⊆ B)
    (h_lim : ∀ᵐ x ∂μ, ∀ᶠ i in L, x ∈ As i ↔ x ∈ A) :
    Tendsto (fun i ↦ μ (As i)) L (𝓝 (μ A))

(As_mble : ∀ (i : ι), MeasurableSet (As i))

(h_lim : ∀ᵐ (x : α) ∂μ, ∀ᶠ (i : ι) in L, x ∈ As i ↔ x ∈ A)

Filter.Tendsto (fun i => μ (As i)) L (𝓝 (μ A))


theorem degree_ne_bot : degree p ≠ ⊥ ↔ p ≠ 0


@[to_additive (attr := simp)]
theorem MonoidHom.comp_id [MulOneClass M] [MulOneClass N] (f : M →* N) :
    f.comp (MonoidHom.id M) = f

{M : Type u_4}
{N : Type u_5}
[MulOneClass M]
[MulOneClass N]
(f : M →* N)


theorem nonempty_Ioo_subtype [DenselyOrdered α] (h : a < b) : Nonempty (Ioo a b)

{α : Type u_1}
[Preorder α]
{a b : α}
[DenselyOrdered α]
(h : a < b)


lemma _root_.Function.HasTemperateGrowth.const (c : F) :
    Function.HasTemperateGrowth (fun _ : E ↦ c)

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(c : F)


@[simp]
theorem symm_comp_self : e.symm ∘ e = id

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


theorem list_foldl {f : α → List β} {g : α → σ} {h : α → σ × β → σ} :
    Primrec f →
      Primrec g → Primrec₂ h → Primrec fun a => (f a).foldl (fun s b => h a (s, b)) (g a)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → List β}
{g : α → σ}
{h : α → σ × β → σ}

Primrec f → Primrec g → Primrec₂ h → Primrec fun a => List.foldl (fun s b => h a (s, b)) (g a) (f a)


@[simp]
theorem Multiset.map_univ_coe (m : Multiset α) :
    (Finset.univ : Finset m).val.map (fun x : m ↦ (x : α)) = m

{α : Type u_1}
[DecidableEq α]
(m : Multiset α)

Multiset.map (fun x => x.fst) Finset.univ.val = m


@[to_additive]
theorem smul_lt_smul_of_le_of_lt [LE G] [Preorder P] [SMul G P] [IsOrderedCancelSMul G P]
    {a b : G} {c d : P} (h₁ : a ≤ b) (h₂ : c < d) :
  a • c < b • d

{G : Type u_1}
{P : Type u_2}
[LE G]
[Preorder P]
[VAdd G P]
[IsOrderedCancelVAdd G P]
{a b : G}
{c d : P}
(h₁ : a ≤ b)
(h₂ : c < d)


theorem back_push [Inhabited α] (a : Array α) : (a.push x).back = x

{α : Type u_1}
{x : α}
[Inhabited α]
(a : Array α)


@[to_additive]
theorem exponent_eq_zero_iff_range_orderOf_infinite (h : ∀ g : G, 0 < orderOf g) :
    exponent G = 0 ↔ (Set.range (orderOf : G → ℕ)).Infinite

{G : Type u}
[AddMonoid G]
(h : ∀ (g : G), 0 < addOrderOf g)

AddMonoid.exponent G = 0 ↔ (Set.range addOrderOf).Infinite


/-- The embedding of `H` into `G □ H` given by `a`. -/
@[simps]
def boxProdRight (a : α) : H ↪g G □ H

{α : Type u_1}
{β : Type u_2}
(G : SimpleGraph α)
(H : SimpleGraph β)
(a : α)
(snd : β)


theorem mapBiprod_hom : (mapBiprod F X Y).hom = biprod.lift (F.map biprod.fst) (F.map biprod.snd)

[CategoryTheory.Limits.PreservesBinaryBiproduct X Y F]

(F.mapBiprod X Y).hom =
  CategoryTheory.Limits.biprod.lift (F.map CategoryTheory.Limits.biprod.fst) (F.map CategoryTheory.Limits.biprod.snd)


@[simp]
theorem biprod.inrCokernelCofork_π : Cofork.π (biprod.inrCokernelCofork X Y) = biprod.fst

CategoryTheory.Limits.Cofork.π (CategoryTheory.Limits.biprod.inrCokernelCofork X Y) = CategoryTheory.Limits.biprod.fst


@[reassoc]
theorem uncurry_natural_left (f : X ⟶ X') (g : X' ⟶ A ⟶[C] Y) :
    uncurry (f ≫ g) = _ ◁ f ≫ uncurry g

(g : X' ⟶ (CategoryTheory.ihom A).obj Y)

CategoryTheory.MonoidalClosed.uncurry (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft A f)
    (CategoryTheory.MonoidalClosed.uncurry g)


/-- The unit of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` is indeed iso. -/
theorem from_toCostructuredArrow_eq (F : Cᵒᵖ ⥤ Type v) :
    (toCostructuredArrow F).rightOp ⋙ fromCostructuredArrow F = 𝟭 _

(F : CategoryTheory.Functor Cᵒᵖ (Type v))

(CategoryTheory.CategoryOfElements.toCostructuredArrow F).rightOp.comp
    (CategoryTheory.CategoryOfElements.fromCostructuredArrow F) =
  CategoryTheory.Functor.id F.Elements


theorem adjoin_mono (H : s ⊆ t) : adjoin R s ≤ adjoin R t

{R : Type uR}
{A : Type uA}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{s t : Set A}
(H : s ⊆ t)


theorem add_nat (h : LiouvilleWith p x) (n : ℕ) : LiouvilleWith p (x + n)

{p x : ℝ}
(h : LiouvilleWith p x)
(n : ℕ)


@[simp]
theorem map_id' (f : Ultrafilter α) : (f.map fun x => x) = f


@[to_additive]
lemma prod_union_eq_left [DecidableEq α] (hs : ∀ a ∈ s₂, a ∉ s₁ → f a = 1) :
    ∏ a ∈ s₁ ∪ s₂, f a = ∏ a ∈ s₁, f a

{α : Type u_3}
{β : Type u_4}
{s₁ s₂ : Finset α}
{f : α → β}
[CommMonoid β]
[DecidableEq α]
(hs : ∀ a ∈ s₂, a ∉ s₁ → f a = 1)


/-- A variant of `app_inv_app` that gives an `eqToHom` instead of `homOfLe`. -/
@[reassoc]
theorem app_inv_app' (U : Opens Y) (hU : (U : Set Y) ⊆ Set.range f.base) :
    f.c.app (op U) ≫ invApp f ((Opens.map f.base).obj U) =
      Y.presheaf.map
        (eqToHom
            (le_antisymm (Set.image_preimage_subset f.base U.1) <|
              (Set.image_preimage_eq_inter_range (f := f.base) (t := U.1)).symm ▸
                Set.subset_inter_iff.mpr ⟨fun _ h => h, hU⟩)).op

{X Y : AlgebraicGeometry.PresheafedSpace C}

[H : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]

f.c.app (Opposite.op U) ≫
    AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp f ((TopologicalSpace.Opens.map f.base).obj U) =
  Y.presheaf.map (CategoryTheory.eqToHom ⋯).op


theorem continuous_ofReal : Continuous ENNReal.ofReal


theorem Nonempty.vsub : s.Nonempty → t.Nonempty → (s -ᵥ t : Set α).Nonempty

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

s.Nonempty → t.Nonempty → (s -ᵥ t).Nonempty


@[to_additive]
theorem mul_right_cancel_iff : b * a = c * a ↔ b = c

{G : Type u_1}
[Mul G]
[IsRightCancelMul G]
{a b c : G}


/-- If an initial object `I` exists in a CCC, then `A ⨯ I ≅ I`. -/
@[simps]
def zeroMul {I : C} (t : IsInitial I) : A ⨯ I ≅ I

(CategoryTheory.zeroMul t).hom = CategoryTheory.Limits.prod.snd


theorem Separable.isCoprime {f g : R[X]} (h : (f * g).Separable) : IsCoprime f g

{R : Type u}
[CommSemiring R]
{f g : R[X]}
(h : (f * g).Separable)


protected lemma _root_.MeasurableEmbedding.isProbabilityMeasure_comap (hf : MeasurableEmbedding f)
    (hf' : ∀ᵐ a ∂μ, a ∈ range f) : IsProbabilityMeasure (μ.comap f)

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsProbabilityMeasure μ]
{f : β → α}
(hf : MeasurableEmbedding f)
(hf' : ∀ᵐ (a : α) ∂μ, a ∈ Set.range f)

MeasureTheory.IsProbabilityMeasure (MeasureTheory.Measure.comap f μ)


/-- An `R`-module `M` is flat iff for all ideals `I` of `R`, the tensor product of the
inclusion `I → R` and the identity `M → M` is injective. See `iff_rTensor_injective` to
restrict to finitely generated ideals `I`. --/
theorem iff_rTensor_injective' :
    Flat R M ↔ ∀ I : Ideal R, 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), Function.Injective ⇑(LinearMap.rTensor M (Submodule.subtype I))


lemma finiteCoproduct.ι_jointly_surjective (R : finiteCoproduct X) :
    ∃ (a : α) (r : X a), R = finiteCoproduct.ι X a r

(R : ↑(CompHaus.finiteCoproduct X).toTop)

∃ a r, R = (CompHaus.finiteCoproduct.ι X a) r


/-- The proof that `a` is a solution to the Pell equation `x^2 - d*y^2 = 1` -/
theorem prop (a : Solution₁ d) : a.x ^ 2 - d * a.y ^ 2 = 1


theorem lid_eq_rid : TensorProduct.lid R R = TensorProduct.rid R R


theorem and_elim_left : ∀ {a b : Bool}, a && b → a


/-- Pull-out property of the conditional expectation. -/
theorem condexp_stronglyMeasurable_mul {f g : α → ℝ} (hf : StronglyMeasurable[m] f)
    (hfg : Integrable (f * g) μ) (hg : Integrable g μ) : μ[f * g|m] =ᵐ[μ] f * μ[g|m]

(hf : MeasureTheory.StronglyMeasurable f)

(hfg : MeasureTheory.Integrable (f * g) μ)


/-- Riesz content λ (associated with a positive linear functional Λ) is
monotone: if `K₁ ⊆ K₂` are compact subsets in X, then `λ(K₁) ≤ λ(K₂)`. -/
theorem rieszContentAux_mono {K₁ K₂ : Compacts X} (h : K₁ ≤ K₂) :
    rieszContentAux Λ K₁ ≤ rieszContentAux Λ K₂

{X : Type u_1}
[TopologicalSpace X]
(Λ : (X →ᵇ ℝ≥0) →ₗ[ℝ≥0] ℝ≥0)
{K₁ K₂ : TopologicalSpace.Compacts X}
(h : K₁ ≤ K₂)


theorem IsMaxOn.lineDeriv_eq_zero (h : IsMaxOn f s a) (h' : ∀ᶠ t : ℝ in 𝓝 0, a + t • b ∈ s) :
    lineDeriv ℝ f a b = 0

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


theorem mulMap_comp_lTensor {N' : Submodule R S} (hN : N' ≤ N) :
    mulMap M N ∘ₗ (inclusion hN).lTensor M = mulMap M N'

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
(M : Submodule R S)
{N N' : Submodule R S}
(hN : N' ≤ N)

M.mulMap N ∘ₗ LinearMap.lTensor (↥M) (Submodule.inclusion hN) = M.mulMap N'


theorem hasGradientWithinAt_iff_isLittleO :
    HasGradientWithinAt f f' s x ↔
    (fun x' : F => f x' - f x - ⟪f', x' - x⟫) =o[𝓝[s] x] fun x' => x' - x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
{s : Set F}

HasGradientWithinAt f f' s x ↔ (fun x' => f x' - f x - ⟪f', x' - x⟫_𝕜) =o[𝓝[s] x] fun x' => x' - x


@[simp]
theorem abs_coe_circle (z : circle) : abs z = 1


theorem range_val : S.val.range = S.toSubalgebra

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)


@[to_additive le_of_add_le_add_left]
theorem le_of_mul_le_mul_left' [ContravariantClass α α (· * ·) (· ≤ ·)] {a b c : α}
    (bc : a * b ≤ a * c) :
    b ≤ c

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


theorem mul_zero_subset (s : Set α) : s * 0 ⊆ 0

{α : Type u_2}
[MulZeroClass α]
(s : Set α)


@[to_additive (attr := simp)]
theorem div_singleton : s / {b} = (· / b) '' s

{α : Type u_2}
[Div α]
{s : Set α}
{b : α}


theorem neg_emod {a b : Int} : -a % b = (b - a) % b


theorem forall_finite_image_eval_iff {δ : Type*} [Finite δ] {κ : δ → Type*} {s : Set (∀ d, κ d)} :
    (∀ d, (eval d '' s).Finite) ↔ s.Finite

{δ : Type u_1}
[Finite δ]
{κ : δ → Type u_2}
{s : Set ((d : δ) → κ d)}

(∀ (d : δ), (Function.eval d '' s).Finite) ↔ s.Finite


lemma cast_dvd_cast (h : m ∣ n) : (m : α) ∣ (n : α)

{α : Type u_1}
[Semiring α]
{m n : ℕ}
(h : m ∣ n)


@[norm_cast]
theorem coe_mul (n m : ℤ) : ((n * m : ℤ) : X q) = (n : X q) * (m : X q)


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

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

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


@[simp]
theorem relMap_leSymb [LE M] [L.OrderedStructure M] {a b : M} :
    RelMap (leSymb : L.Relations 2) ![a, b] ↔ a ≤ b

{L : FirstOrder.Language}
{M : Type w'}
[L.IsOrdered]
[L.Structure M]
[LE M]
[L.OrderedStructure M]
{a b : M}

FirstOrder.Language.Structure.RelMap FirstOrder.Language.leSymb ![a, b] ↔ a ≤ b


@[simp]
theorem mk_mem_iff {x y : PSet} : mk x ∈ mk y ↔ x ∈ y


@[simp]
theorem nonempty_toSet_iff {u : ZFSet} : u.toSet.Nonempty ↔ u.Nonempty


@[to_additive]
lemma IsClosed.mul_closure_one_eq {F : Set G} (hF : IsClosed F) :
    F * (closure {1} : Set G) = F

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{F : Set G}
(hF : IsClosed F)


/-- Suppose a set of vectors spans `V`.  Then a point `p`, together with those vectors added to `p`,
spans `P`. -/
theorem affineSpan_singleton_union_vadd_eq_top_of_span_eq_top {s : Set V} (p : P)
    (h : Submodule.span k (Set.range ((↑) : s → V)) = ⊤) :
    affineSpan k ({p} ∪ (fun v => v +ᵥ p) '' s) = ⊤

(h : Submodule.span k (Set.range Subtype.val) = ⊤)


/-- A Scheme is affine if the canonical map `X ⟶ Spec Γ(X)` is an isomorphism. -/
class IsAffine (X : Scheme) : Prop where
  affine : IsIso (ΓSpec.adjunction.unit.app X)

{X : AlgebraicGeometry.Scheme}
[self : AlgebraicGeometry.IsAffine X]


theorem exists_unique_equiv (a : ℤ) {b : ℤ} (hb : 0 < b) :
    ∃ z : ℤ, 0 ≤ z ∧ z < b ∧ z ≡ a [ZMOD b]


lemma scottHausdorff_le_lower : scottHausdorff α ≤ lower α

Topology.scottHausdorff α ≤ Topology.lower α


/--
[Lemma 3.8](https://ncatlab.org/nlab/show/injective+object#preservation_of_injective_objects)
-/
lemma EnoughInjectives.of_adjunction {C : Type u₁} {D : Type u₂}
    [Category.{v₁} C] [Category.{v₂} D]
    {L : C ⥤ D} {R : D ⥤ C} (adj : L ⊣ R) [L.PreservesMonomorphisms] [L.ReflectsMonomorphisms]
    [EnoughInjectives D] : EnoughInjectives C

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


theorem IsOrtho.comap (f : E →ₗᵢ[𝕜] F) {U V : Submodule 𝕜 F} (h : U ⟂ V) :
    U.comap f ⟂ V.comap f

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
(f : E →ₗᵢ[𝕜] F)
{U V : Submodule 𝕜 F}
(h : U ⟂ V)

Submodule.comap f U ⟂ Submodule.comap f V


theorem integrableOn_Ioc_of_intervalIntegral_norm_bounded {I a₀ b₀ : ℝ}
    (hfi : ∀ i, IntegrableOn f <| Ioc (a i) (b i)) (ha : Tendsto a l <| 𝓝 a₀)
    (hb : Tendsto b l <| 𝓝 b₀) (h : ∀ᶠ i in l, (∫ x in Ioc (a i) (b i), ‖f x‖) ≤ I) :
    IntegrableOn f (Ioc a₀ b₀)

(hfi : ∀ (i : ι), MeasureTheory.IntegrableOn f (Set.Ioc (a i) (b i)) MeasureTheory.volume)

(h : ∀ᶠ (i : ι) in l, ∫ (x : ℝ) in Set.Ioc (a i) (b i), ‖f x‖ ≤ I)

MeasureTheory.IntegrableOn f (Set.Ioc a₀ b₀) MeasureTheory.volume


@[reassoc (attr := simp)]
theorem inl_isoPushout_inv (h : IsPushout f g inl inr) [HasPushout f g] :
    pushout.inl _ _ ≫ h.isoPushout.inv = inl

(h : CategoryTheory.IsPushout f g inl inr)

CategoryTheory.Limits.pushout.inl f g ≫ h.isoPushout.inv = inl


theorem fderiv_list_prod' {l : List ι} {x : E}
    (h : ∀ i ∈ l, DifferentiableAt 𝕜 (f i ·) x) :
    fderiv 𝕜 (fun x ↦ (l.map (f · x)).prod) x =
      ∑ i : Fin l.length, ((l.take i).map (f · x)).prod •
        smulRight (fderiv 𝕜 (fun x ↦ f (l.get i) x) x)
          ((l.drop (.succ i)).map (f · x)).prod

(h : ∀ i ∈ l, DifferentiableAt 𝕜 (fun x => f i x) x)

fderiv 𝕜 (fun x => (List.map (fun x_1 => f x_1 x) l).prod) x =
  ∑ i : Fin l.length,
    (List.map (fun x_1 => f x_1 x) (List.take (↑i) l)).prod •
      (fderiv 𝕜 (fun x => f (l.get i) x) x).smulRight (List.map (fun x_1 => f x_1 x) (List.drop (↑i).succ l)).prod


@[deprecated getElem_zipWith (since := "2024-06-12")]
theorem get_zipWith {f : α → β → γ} {l : List α} {l' : List β} {i : Fin (zipWith f l l').length} :
    (zipWith f l l').get i =
      f (l.get ⟨i, lt_length_left_of_zipWith i.isLt⟩)
        (l'.get ⟨i, lt_length_right_of_zipWith i.isLt⟩)

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
{f : α → β → γ}
{l : List α}
{l' : List β}
{i : Fin (List.zipWith f l l').length}

(List.zipWith f l l').get i = f (l.get ⟨↑i, ⋯⟩) (l'.get ⟨↑i, ⋯⟩)


@[simp]
theorem integralNormalization_zero : integralNormalization (0 : R[X]) = 0


theorem coe_inv (e : X ≃ᵈ X) : ⇑(e⁻¹) = e.symm

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


@[simp]
theorem le_iff_le {a b} : f a ≤ f b ↔ a ≤ b

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(f : α ↪o β)
{a b : α}


/-- The scalar multiplication of two `C^n` functions within a set at a point is `C^n` within this
set at this point. -/
theorem ContDiffWithinAt.smul {s : Set E} {f : E → 𝕜} {g : E → F} (hf : ContDiffWithinAt 𝕜 n f s x)
    (hg : ContDiffWithinAt 𝕜 n g s x) : ContDiffWithinAt 𝕜 n (fun x => f x • g x) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
{n : ℕ∞}
{s : Set E}
{f : E → 𝕜}
{g : E → F}
(hf : ContDiffWithinAt 𝕜 n f s x)
(hg : ContDiffWithinAt 𝕜 n g s x)


@[to_additive (attr := simp)]
theorem map_comap_map {f : F} : ((S.map f).comap f).map f = S.map f

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(S : AddSubmonoid M)
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{f : F}

AddSubmonoid.map f (AddSubmonoid.comap f (AddSubmonoid.map f S)) = AddSubmonoid.map f S


@[simp]
theorem mem_cons {a b : α} {s : Multiset α} : a ∈ b ::ₘ s ↔ a = b ∨ a ∈ s

{α : Type u_1}
{a b : α}
{s : Multiset α}


@[gcongr]
theorem Ioc_subset_Ioc_right (h : b₁ ≤ b₂) : Ioc a b₁ ⊆ Ioc a b₂

{α : Type u_1}
[Preorder α]
{a b₁ b₂ : α}
(h : b₁ ≤ b₂)


theorem none_eq_top : (none : WithTop α) = (⊤ : WithTop α)


theorem lsub_eq_of_range_eq {ι ι'} {f : ι → Ordinal} {g : ι' → Ordinal}
    (h : Set.range f = Set.range g) : lsub.{u, max v w} f = lsub.{v, max u w} g

{ι : Type u}
{ι' : Type v}
{f : ι → Ordinal.{max (max u v) w}}
{g : ι' → Ordinal.{max (max u v) w}}
(h : Set.range f = Set.range g)


theorem _root_.stronglyMeasurable_const_smul_iff₀ {_ : MeasurableSpace α} {c : G₀} (hc : c ≠ 0) :
    (StronglyMeasurable fun x => c • f x) ↔ StronglyMeasurable f

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{G₀ : Type u_7}
[TopologicalSpace β]
[GroupWithZero G₀]
[MulAction G₀ β]
[ContinuousConstSMul G₀ β]

∀ {x : MeasurableSpace α} {c : G₀},
  c ≠ 0 → ((MeasureTheory.StronglyMeasurable fun x => c • f x) ↔ MeasureTheory.StronglyMeasurable f)


@[fun_prop, measurability]
theorem AEMeasurable.pow_const (hf : AEMeasurable f μ) (c : γ) :
    AEMeasurable (fun x => f x ^ c) μ

{β : Type u_2}
{γ : Type u_3}
{α : Type u_4}
[MeasurableSpace β]
[MeasurableSpace γ]
[Pow β γ]
[MeasurablePow β γ]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → β}
(hf : AEMeasurable f μ)
(c : γ)


@[to_additive]
theorem map_ne_zero_iff_ne_one : f x ≠ 0 ↔ x ≠ 1

{F : Type u_2}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[Group α]
[OrderedAddCommMonoid β]
[GroupNormClass F α β]
(f : F)
{x : α}


theorem le_ofDual_iff {a : WithTop α} {b : WithBot αᵒᵈ} :
    a ≤ WithBot.ofDual b ↔ b ≤ WithTop.toDual a

{α : Type u_1}
[LE α]
{a : WithTop α}
{b : WithBot αᵒᵈ}


/-- Subtracting the `orthogonalProjection` from a point in the given
subspace produces a result in the direction of the given subspace. -/
theorem vsub_orthogonalProjection_mem_direction {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] {p1 : P} (p2 : P) (hp1 : p1 ∈ s) :
    ↑((⟨p1, hp1⟩ : s) -ᵥ orthogonalProjection s p2 : s.direction) ∈ s.direction

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
{p1 : P}
(p2 : P)
(hp1 : p1 ∈ s)

↑(⟨p1, hp1⟩ -ᵥ (EuclideanGeometry.orthogonalProjection s) p2) ∈ s.direction


theorem Dense.borel_eq_generateFrom_Ico_mem_aux {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] [SecondCountableTopology α] {s : Set α} (hd : Dense s)
    (hbot : ∀ x, IsBot x → x ∈ s) (hIoo : ∀ x y : α, x < y → Ioo x y = ∅ → y ∈ s) :
    borel α = .generateFrom { S : Set α | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S }

(hIoo : ∀ (x y : α), x < y → Set.Ioo x y = ∅ → y ∈ s)

borel α = MeasurableSpace.generateFrom {S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Set.Ico l u = S}


@[simp] theorem toHopfAlgEquiv_toBialgHom (i : X ≅ Y) :
    (i.toHopfAlgEquiv : X →ₐc[R] Y) = i.hom.1

{R : Type u}
[CommRing R]
{X Y : HopfAlgebraCat R}
(i : X ≅ Y)


theorem FG.cg {N : L.Substructure M} (h : N.FG) : N.CG

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
{N : L.Substructure M}
(h : N.FG)


theorem HasDerivWithinAt.continuousWithinAt (h : HasDerivWithinAt f f' s x) :
    ContinuousWithinAt f s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s : Set 𝕜}
(h : HasDerivWithinAt f f' s x)


theorem aux_inj_roots_of_min_poly : Injective (rootsOfMinPolyPiType F E K)

(F : Type u_3)
(E : Type u_4)
(K : Type u_5)
[Field F]
[Ring E]
[CommRing K]
[IsDomain K]
[Algebra F E]
[Algebra F K]
[FiniteDimensional F E]

Function.Injective (minpoly.rootsOfMinPolyPiType F E K)


theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (fun x ↦ ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν

(f : ℕ → α → ℝ≥0∞)

(hf : ∀ (n : ℕ), f n ∈ MeasureTheory.Measure.LebesgueDecomposition.measurableLE μ ν)

(fun x => ⨆ k, ⨆ (_ : k ≤ n), f k x) ∈ MeasureTheory.Measure.LebesgueDecomposition.measurableLE μ ν


theorem IsGLB.exists_between (h : IsGLB s a) (hb : a < b) : ∃ c ∈ s, a ≤ c ∧ c < b

{α : Type u}
[LinearOrder α]
{s : Set α}
{a b : α}
(h : IsGLB s a)
(hb : a < b)


protected theorem smul {α} [Monoid α] [DistribMulAction α R] [SMulCommClass R α R] (a : α)
    {B : BilinForm R M} (hB : B.IsSymm) : (a • B).IsSymm

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_9}
[Monoid α]
[DistribMulAction α R]
[SMulCommClass R α R]
(a : α)
{B : LinearMap.BilinForm R M}
(hB : B.IsSymm)


theorem count_false_le_count_true_add_one (hl : Chain' (· ≠ ·) l) :
    count false l ≤ count true l + 1

(hl : List.Chain' (fun x x_1 => x ≠ x_1) l)

List.count false l ≤ List.count true l + 1


theorem inducedMap_mono : Monotone (inducedMap α β)

Monotone (LinearOrderedField.inducedMap α β)


@[to_additive]
lemma prod_Iio_mul_eq_prod_Iic (a : α) : (∏ x ∈ Iio a, f x) * f a = ∏ x ∈ Iic a, f x

{α : Type u_1}
{M : Type u_2}
[PartialOrder α]
[CommMonoid M]
{f : α → M}
[LocallyFiniteOrderBot α]
(a : α)

(∏ x ∈ Finset.Iio a, f x) * f a = ∏ x ∈ Finset.Iic a, f x


theorem two_zsmul_eq_pi_iff {θ : Angle} : (2 : ℤ) • θ = π ↔ θ = (π / 2 : ℝ) ∨ θ = (-π / 2 : ℝ)


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

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
{f g : CentroidHom α}
(h : ∀ (a : α), f a = g a)


theorem sin_pi_sub (x : ℂ) : sin (π - x) = sin x

Complex.sin (↑Real.pi - x) = Complex.sin x


/-- A content is an additive function on compact sets taking values in `ℝ≥0`. It is a device
from which one can define a measure. -/
structure Content (G : Type w) [TopologicalSpace G] where
  toFun : Compacts G → ℝ≥0
  mono' : ∀ K₁ K₂ : Compacts G, (K₁ : Set G) ⊆ K₂ → toFun K₁ ≤ toFun K₂
  sup_disjoint' :
    ∀ K₁ K₂ : Compacts G, Disjoint (K₁ : Set G) K₂ → IsClosed (K₁ : Set G) → IsClosed (K₂ : Set G)
      → toFun (K₁ ⊔ K₂) = toFun K₁ + toFun K₂
  sup_le' : ∀ K₁ K₂ : Compacts G, toFun (K₁ ⊔ K₂) ≤ toFun K₁ + toFun K₂

{G : Type w}
[TopologicalSpace G]
(self : MeasureTheory.Content G)
(K₁ K₂ : TopologicalSpace.Compacts G)

↑K₁ ⊆ ↑K₂ → self.toFun K₁ ≤ self.toFun K₂


@[simp]
lemma comp_app (f : P ⟶ Q) (g : Q ⟶ T) (X : Cᵒᵖ) :
    (f ≫ g).app X = (g.app X).comp (f.app X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
{P Q T : PresheafOfModules R}
(f : P ⟶ Q)
(g : Q ⟶ T)
(X : Cᵒᵖ)

PresheafOfModules.Hom.app (f ≫ g) X = PresheafOfModules.Hom.app g X ∘ₗ PresheafOfModules.Hom.app f X


theorem erase_right_comm {a b : α} {s : Finset α} : erase (erase s a) b = erase (erase s b) a

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

(s.erase a).erase b = (s.erase b).erase a


theorem wEquiv.symm {α : TypeVec n} (x y : q.P.W α) : WEquiv x y → WEquiv y x

{n : ℕ}
{F : TypeVec.{u} (n + 1) → Type u}
[q : MvQPF F]
{α : TypeVec.{u} n}
(x y : (MvQPF.P F).W α)


@[simp]
theorem integral_inv_of_pos (ha : 0 < a) (hb : 0 < b) : ∫ x in a..b, x⁻¹ = log (b / a)

∫ (x : ℝ) in a..b, x⁻¹ = Real.log (b / a)


theorem toPrefunctor_comp (f : α → β) (g : β → γ) :
    toPrefunctor (g ∘ f) = toPrefunctor f ⋙q toPrefunctor g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β)
(g : β → γ)

Quiver.SingleObj.toPrefunctor (g ∘ f) = Quiver.SingleObj.toPrefunctor f ⋙q Quiver.SingleObj.toPrefunctor g


@[simp]
theorem row_apply (v : n → α) (i : ι) (j) : row ι v i j = v j

{n : Type u_3}
{α : Type v}
{ι : Type u_6}
(v : n → α)
(i : ι)
(j : n)


lemma HasLineDerivWithinAt.congr_of_eventuallyEq (hf : HasLineDerivWithinAt 𝕜 f f' s x v)
    (h'f : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : HasLineDerivWithinAt 𝕜 f₁ f' s x v


theorem dvd_gcd_iff {a : α} : a ∣ s.gcd f ↔ ∀ b ∈ s, a ∣ f b

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f : β → α}
{a : α}


/-- The centroid lies in the affine span if the number of points,
converted to `k`, is not zero. -/
theorem centroid_mem_affineSpan_of_cast_card_ne_zero {s : Finset ι} (p : ι → P)
    (h : (card s : k) ≠ 0) : s.centroid k p ∈ affineSpan k (range p)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
{s : Finset ι}
(p : ι → P)
(h : ↑s.card ≠ 0)

Finset.centroid k s p ∈ affineSpan k (Set.range p)


theorem splits_X_pow_card_sub_X : Splits (algebraMap (ZMod p) K) (X ^ Fintype.card K - X)

(p : ℕ)
[h_prime : Fact (Nat.Prime p)]
{K : Type u_1}
[Field K]
[Fintype K]
[Algebra (ZMod p) K]

Polynomial.Splits (algebraMap (ZMod p) K) (Polynomial.X ^ Fintype.card K - Polynomial.X)


theorem aestronglyMeasurable_lineDeriv [SecondCountableTopologyEither E F]
    (hf : Continuous f) (μ : Measure E) :
    AEStronglyMeasurable (fun x ↦ lineDeriv 𝕜 f x v) μ

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[LocallyCompactSpace 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[MeasurableSpace E]
[OpensMeasurableSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f : E → F}
{v : E}
[SecondCountableTopologyEither E F]
(hf : Continuous f)
(μ : MeasureTheory.Measure E)

MeasureTheory.AEStronglyMeasurable (fun x => lineDeriv 𝕜 f x v) μ


@[simp]
theorem comp_sub [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [TopologicalAddGroup M₂] [TopologicalAddGroup M₃]
    (g : M₂ →SL[σ₂₃] M₃) (f₁ f₂ : M →SL[σ₁₂] M₂) : g.comp (f₁ - f₂) = g.comp f₁ - g.comp f₂

{R : Type u_1}
[Ring R]
{R₂ : Type u_2}
[Ring R₂]
{R₃ : Type u_3}
[Ring R₃]
{M : Type u_4}
[TopologicalSpace M]
[AddCommGroup M]
{M₂ : Type u_5}
[TopologicalSpace M₂]
[AddCommGroup M₂]
{M₃ : Type u_6}
[TopologicalSpace M₃]
[AddCommGroup M₃]
[Module R M]
[Module R₂ M₂]
[Module R₃ M₃]
{σ₁₂ : R →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[TopologicalAddGroup M₂]
[TopologicalAddGroup M₃]
(g : M₂ →SL[σ₂₃] M₃)
(f₁ f₂ : M →SL[σ₁₂] M₂)


@[simp]
theorem mapRange.linearEquiv_refl :
    (mapRange.linearEquiv fun i => LinearEquiv.refl R (β₁ i)) = LinearEquiv.refl _ _

{ι : Type u_1}
{R : Type u_2}
[Semiring R]
{β₁ : ι → Type u_7}
[(i : ι) → AddCommMonoid (β₁ i)]
[(i : ι) → Module R (β₁ i)]

(DFinsupp.mapRange.linearEquiv fun i => LinearEquiv.refl R (β₁ i)) = LinearEquiv.refl R (Π₀ (i : ι), β₁ i)


/-- If the angle between two vectors is `-π / 2`, the first vector is nonzero. -/
theorem left_ne_zero_of_oangle_eq_neg_pi_div_two {x y : V} (h : o.oangle x y = (-π / 2 : ℝ)) :
    x ≠ 0

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


/-- Rotating triangles gives an endofunctor on the category of triangles in `C`.
-/
@[simps]
def rotate : Triangle C ⥤ Triangle C

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.HasShift C ℤ]

∀ {X Y : CategoryTheory.Pretriangulated.Triangle C} (f : X ⟶ Y),
  ((CategoryTheory.Pretriangulated.rotate C).map f).hom₁ = f.hom₂


lemma isOpen_B_with_param {r s t : ℝ} (hf : Continuous f.uncurry) (K : Set (E →L[𝕜] F)) :
    IsOpen {p : α × E | p.2 ∈ B (f p.1) K r s t}

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[LocallyCompactSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{α : Type u_4}
[TopologicalSpace α]
{f : α → E → F}
{r s t : ℝ}
(hf : Continuous (Function.uncurry f))
(K : Set (E →L[𝕜] F))

IsOpen {p | p.2 ∈ FDerivMeasurableAux.B (f p.1) K r s t}


theorem range_dualMap_eq_dualAnnihilator_ker_of_subtype_range_surjective (f : M →ₗ[R] M')
    (hf : Function.Surjective f.range.subtype.dualMap) :
    LinearMap.range f.dualMap = f.ker.dualAnnihilator

(hf : Function.Surjective ⇑(LinearMap.range f).subtype.dualMap)

LinearMap.range f.dualMap = (LinearMap.ker f).dualAnnihilator


theorem ContMDiffWithinAt.clm_precomp {f : M → F₁ →L[𝕜] F₂} {s : Set M} {x : M}
    (hf : ContMDiffWithinAt I 𝓘(𝕜, F₁ →L[𝕜] F₂) n f s x) :
    ContMDiffWithinAt I 𝓘(𝕜, (F₂ →L[𝕜] F₃) →L[𝕜] (F₁ →L[𝕜] F₃)) n
      (fun y ↦ (f y).precomp F₃ : M → (F₂ →L[𝕜] F₃) →L[𝕜] (F₁ →L[𝕜] F₃)) s x

ContMDiffWithinAt I 𝓘(𝕜, (F₂ →L[𝕜] F₃) →L[𝕜] F₁ →L[𝕜] F₃) n (fun y => ContinuousLinearMap.precomp F₃ (f y)) s x


/-- From a functor `F : J ⥤ C`, given a terminal object of `J`, construct a cone for `J`,
provided that the morphisms in the diagram are isomorphisms.
In `limitOfDiagramTerminal` we show it is a limit cone. -/
@[simps]
def coneOfDiagramTerminal {X : J} (hX : IsTerminal X) (F : J ⥤ C)
    [∀ (i j : J) (f : i ⟶ j), IsIso (F.map f)] : Cone F

(hX : CategoryTheory.Limits.IsTerminal X)

[∀ (i j : J) (f : i ⟶ j), CategoryTheory.IsIso (F.map f)]

(CategoryTheory.Limits.coneOfDiagramTerminal hX F).π.app i = CategoryTheory.inv (F.map (hX.from i))


@[simp]
protected theorem ENNReal.tendsto_pow_atTop_nhds_zero_iff {r : ℝ≥0∞} :
    Tendsto (fun n : ℕ => r ^ n) atTop (𝓝 0) ↔ r < 1

Filter.Tendsto (fun n => r ^ n) Filter.atTop (𝓝 0) ↔ r < 1


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

`castLEEmb h i` embeds `i` into a larger `Fin` type. -/
@[simps! apply toEmbedding]
def castLEOrderEmb (h : n ≤ m) : Fin n ↪o Fin m

(Fin.castLEOrderEmb h) i = Fin.castLE h i


/-- An isomorphism of short complexes `S₁ ≅ S₂` induces an isomorphism on the `H` fields
of right homology data of `S₁` and `S₂`. -/
@[simps]
def rightHomologyMapIso' (e : S₁ ≅ S₂) (h₁ : S₁.RightHomologyData)
    (h₂ : S₂.RightHomologyData) : h₁.H ≅ h₂.H

(CategoryTheory.ShortComplex.rightHomologyMapIso' e h₁ h₂).hom =
  CategoryTheory.ShortComplex.rightHomologyMap' e.hom h₁ h₂


theorem Sized.subsingleton' [Fintype α] (hA : A.Sized (Fintype.card α)) : A.Subsingleton

{α : Type u_1}
{A : Set (Finset α)}
[Fintype α]
(hA : Set.Sized (Fintype.card α) A)


@[simp]
lemma quotTensorEquivQuotSMul_mk_tmul (I : Ideal R) (r : R) (x : M) :
    quotTensorEquivQuotSMul M I (Ideal.Quotient.mk I r ⊗ₜ[R] x) =
      Submodule.Quotient.mk (r • x)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(I : Ideal R)
(r : R)
(x : M)

(quotTensorEquivQuotSMul M I) ((Ideal.Quotient.mk I) r ⊗ₜ[R] x) = Submodule.Quotient.mk (r • x)


theorem Basis.inter_eq_of_subset_indep (hIX : M.Basis I X) (hIJ : I ⊆ J) (hJ : M.Indep J) :
    J ∩ X = I

{α : Type u_1}
{M : Matroid α}
{I J X : Set α}
(hIX : M.Basis I X)
(hIJ : I ⊆ J)
(hJ : M.Indep J)


@[simp]
theorem mem_map {m : α → β} {f : Ultrafilter α} {s : Set β} : s ∈ map m f ↔ m ⁻¹' s ∈ f

{α : Type u}
{β : Type v}
{m : α → β}
{f : Ultrafilter α}
{s : Set β}


/-- `tensorLeftHomEquiv` commutes with tensoring on the right -/
theorem tensorLeftHomEquiv_tensor {X X' Y Y' Z Z' : C} [ExactPairing Y Y'] (f : X ⟶ Y ⊗ Z)
    (g : X' ⟶ Z') :
    (tensorLeftHomEquiv (X ⊗ X') Y Y' (Z ⊗ Z')).symm ((f ⊗ g) ≫ (α_ _ _ _).hom) =
      (α_ _ _ _).inv ≫ ((tensorLeftHomEquiv X Y Y' Z).symm f ⊗ g)

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

(CategoryTheory.tensorLeftHomEquiv (X ⊗ X') Y Y' (Z ⊗ Z')).symm ((f ⊗ g) ≫ (α_ Y Z Z').hom) =
  (α_ Y' X X').inv ≫ ((CategoryTheory.tensorLeftHomEquiv X Y Y' Z).symm f ⊗ g)


theorem primitive_element_iff_minpoly_degree_eq (α : E) :
    F⟮α⟯ = ⊤ ↔ (minpoly F α).degree = finrank F E

(F : Type u_3)
{E : Type u_4}
[Field F]
[Field E]
[Algebra F E]
[FiniteDimensional F E]
(α : E)

F⟮α⟯ = ⊤ ↔ (minpoly F α).degree = ↑(FiniteDimensional.finrank F E)


@[reassoc]
theorem uncurry_natural_right (f : X ⟶ A ⟶[C] Y) (g : Y ⟶ Y') :
    uncurry (f ≫ (ihom _).map g) = uncurry f ≫ g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{A X Y Y' : C}
[CategoryTheory.Closed A]
(f : X ⟶ (CategoryTheory.ihom A).obj Y)
(g : Y ⟶ Y')

CategoryTheory.MonoidalClosed.uncurry (CategoryTheory.CategoryStruct.comp f ((CategoryTheory.ihom A).map g)) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalClosed.uncurry f) g


theorem rpow_lt_one_of_one_lt_of_neg {x z : ℝ} (hx : 1 < x) (hz : z < 0) : x ^ z < 1


theorem card_compl_support_modEq [DecidableEq α] {p n : ℕ} [hp : Fact p.Prime] {σ : Perm α}
    (hσ : σ ^ p ^ n = 1) : σ.supportᶜ.card ≡ Fintype.card α [MOD p]

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{p n : ℕ}
[hp : Fact (Nat.Prime p)]
{σ : Equiv.Perm α}
(hσ : σ ^ p ^ n = 1)


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


theorem codisjoint_hnot_left : Codisjoint (￢a) a

{α : Type u_2}
[CoheytingAlgebra α]
{a : α}


@[simp] theorem lcm_zero_right (m : Nat) : lcm m 0 = 0


lemma integrable [IsFiniteMeasure μ] (f : X →ᵇ E) :
    Integrable f μ

{X : Type u_1}
[MeasurableSpace X]
[TopologicalSpace X]
[OpensMeasurableSpace X]
(μ : MeasureTheory.Measure X)
{E : Type u_2}
[NormedAddCommGroup E]
[SecondCountableTopology E]
[MeasurableSpace E]
[BorelSpace E]
[MeasureTheory.IsFiniteMeasure μ]
(f : X →ᵇ E)


theorem smul_apply (r : S) (D : Derivation R A M) : (r • D) a = r • D a

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(a : A)
{S : Type u_5}
[Monoid S]
[DistribMulAction S M]
[SMulCommClass R S M]
[SMulCommClass S A M]
(r : S)
(D : Derivation R A M)


@[to_additive]
theorem prod_isUnit : ∀ {L : List M}, (∀ m ∈ L, IsUnit m) → IsUnit L.prod


@[simp]
lemma reflection_apply_self (h : f x = 2) :
    reflection h x = - x

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{x : M}
{f : Module.Dual R M}
(h : f x = 2)


/-- If `s` is a convex set, then `a • s + b • interior s ⊆ interior s` for all `0 ≤ a`, `0 < b`,
`a + b = 1`. See also `Convex.combo_closure_interior_subset_interior` for a stronger version. -/
theorem Convex.combo_self_interior_subset_interior {s : Set E} (hs : Convex 𝕜 s) {a b : 𝕜}
    (ha : 0 ≤ a) (hb : 0 < b) (hab : a + b = 1) : a • s + b • interior s ⊆ interior s

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
{a b : 𝕜}
(ha : 0 ≤ a)
(hb : 0 < b)
(hab : a + b = 1)


/-- Scalar multiplication of a self-adjoint element by a skew-adjoint element produces a
skew-adjoint element. -/
theorem IsSelfAdjoint.smul_mem_skewAdjoint [Ring R] [AddCommGroup A] [Module R A] [StarAddMonoid R]
    [StarAddMonoid A] [StarModule R A] {r : R} (hr : r ∈ skewAdjoint R) {a : A}
    (ha : IsSelfAdjoint a) : r • a ∈ skewAdjoint A

{R : Type u_1}
{A : Type u_2}
[Ring R]
[AddCommGroup A]
[Module R A]
[StarAddMonoid R]
[StarAddMonoid A]
[StarModule R A]
{r : R}
(hr : r ∈ skewAdjoint R)
{a : A}
(ha : IsSelfAdjoint a)


@[simp]
theorem coe_comp_expOrderIso : (↑) ∘ expOrderIso = exp

Subtype.val ∘ ⇑Real.expOrderIso = Real.exp


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

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

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


theorem Real.uniformContinuous_mul (s : Set (ℝ × ℝ)) {r₁ r₂ : ℝ}
    (H : ∀ x ∈ s, |(x : ℝ × ℝ).1| < r₁ ∧ |x.2| < r₂) :
    UniformContinuous fun p : s => p.1.1 * p.1.2

(s : Set (ℝ × ℝ))
{r₁ r₂ : ℝ}
(H : ∀ x ∈ s, |x.1| < r₁ ∧ |x.2| < r₂)

UniformContinuous fun p => (↑p).1 * (↑p).2


@[simp] theorem coordinate_eval (i : Nat) (v : Coeffs) :
    (coordinate i).eval v = v.get i

(Lean.Omega.LinearCombo.coordinate i).eval v = v.get i


theorem comp_apply (f : Q →ᴬ[R] Q₂) (g : P →ᴬ[R] Q) (x : P) : f.comp g x = f (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]
{W₂ : Type u_6}
{Q₂ : Type u_7}
[AddCommGroup W₂]
[Module R W₂]
[TopologicalSpace Q₂]
[AddTorsor W₂ Q₂]
(f : Q →ᴬ[R] Q₂)
(g : P →ᴬ[R] Q)
(x : P)


theorem of_hasBinaryBiproduct (X Y : C) [HasBinaryBiproduct X Y] :
    IsPullback (0 : 0 ⟶ X) (0 : 0 ⟶ Y) biprod.inl biprod.inr

CategoryTheory.IsPullback 0 0 CategoryTheory.Limits.biprod.inl CategoryTheory.Limits.biprod.inr


theorem Int.sq_ne_two_mod_four (z : ℤ) : z * z % 4 ≠ 2


lemma projective_of_extrDisc {X : Profinite.{u}} (hX : ExtremallyDisconnected X) :
    Projective X

{X : Profinite}
(hX : ExtremallyDisconnected ↑X.toTop)


/-- The inverse associator functor `C × (D × E) ⥤ (C × D) × E `.
-/
@[simps]
def inverseAssociator : C × D × E ⥤ (C × D) × E

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

∀ (x x_1 : C × D × E) (f : x ⟶ x_1), (CategoryTheory.prod.inverseAssociator C D E).map f = ((f.1, f.2.1), f.2.2)


@[to_additive]
theorem eq_of_eqOn_top {f g : G →* M} (h : Set.EqOn f g (⊤ : Subgroup G)) : f = g

{G : Type u_1}
[AddGroup G]
{M : Type u_7}
[AddMonoid M]
{f g : G →+ M}
(h : Set.EqOn ⇑f ⇑g ↑⊤)


theorem Finite.bind {α β} {s : Set α} {f : α → Set β} (h : s.Finite) (hf : ∀ a ∈ s, (f a).Finite) :
    (s >>= f).Finite

{α β : Type u_1}
{s : Set α}
{f : α → Set β}
(h : s.Finite)
(hf : ∀ a ∈ s, (f a).Finite)


theorem flat_iff_lan_flat (F : C ⥤ D) :
    RepresentablyFlat F ↔ RepresentablyFlat (F.op.lan : _ ⥤ Dᵒᵖ ⥤ Type u₁)

CategoryTheory.RepresentablyFlat F ↔ CategoryTheory.RepresentablyFlat F.op.lan


theorem natCast_eq_natCast_iff (a b c : ℕ) : (a : ZMod c) = (b : ZMod c) ↔ a ≡ b [MOD c]


@[to_additive]
theorem sup_eq_range (s t : Submonoid N) : s ⊔ t = mrange (s.subtype.coprod t.subtype)

{N : Type u_4}
[CommMonoid N]
(s t : Submonoid N)

s ⊔ t = MonoidHom.mrange (s.subtype.coprod t.subtype)


theorem isSuccLimitRecOn_succ' (hs : ∀ a, ¬IsMax a → C (succ a)) (hl : ∀ a, IsSuccLimit a → C a)
    {b : α} (hb : ¬IsMax b) : @isSuccLimitRecOn α _ _ C (succ b) hs hl = hs b hb

(hs : (a : α) → ¬IsMax a → C (Order.succ a))

(hl : (a : α) → Order.IsSuccLimit a → C a)

Order.isSuccLimitRecOn (Order.succ b) hs hl = hs b hb


/-- Any injective polynomial map over an algebraic extension of a finite field is surjective. -/
theorem ax_grothendieck_of_locally_finite {ι K R : Type*} [Field K] [Finite K] [CommRing R]
    [Finite ι] [Algebra K R] [Algebra.IsAlgebraic K R] (ps : ι → MvPolynomial ι R)
    (hinj : Injective fun v i => MvPolynomial.eval v (ps i)) :
    Surjective fun v i => MvPolynomial.eval v (ps i)

(hinj : Function.Injective fun v i => (MvPolynomial.eval v) (ps i))

Function.Surjective fun v i => (MvPolynomial.eval v) (ps i)


@[to_additive (attr := simp)]
theorem pow_mod_period_smul (n : ℕ) {m : M} {a : α} :
    m ^ (n % period m a) • a = m ^ n • a

{α : Type v}
{M : Type u}
[Monoid M]
[MulAction M α]
(n : ℕ)
{m : M}
{a : α}

m ^ (n % MulAction.period m a) • a = m ^ n • a


/-- Scalar multiplication (by possibly different types) of a balanced set is monotone. -/
theorem Balanced.smul_mono (hs : Balanced 𝕝 s) {a : 𝕝} {b : 𝕜} (h : ‖a‖ ≤ ‖b‖) : a • s ⊆ b • s

{𝕜 : Type u_1}
{𝕝 : Type u_2}
{E : Type u_3}
[NormedField 𝕜]
[NormedRing 𝕝]
[NormedSpace 𝕜 𝕝]
[AddCommGroup E]
[Module 𝕜 E]
[SMulWithZero 𝕝 E]
[IsScalarTower 𝕜 𝕝 E]
{s : Set E}
(hs : Balanced 𝕝 s)
{a : 𝕝}
{b : 𝕜}
(h : ‖a‖ ≤ ‖b‖)


theorem IsLittleO.add_isEquivalent (hu : u =o[l] w) (hv : v ~[l] w) : u + v ~[l] w

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u v w : α → β}
{l : Filter α}
(hu : u =o[l] w)
(hv : v ~[l] w)


@[to_additive]
theorem mulIndicator_eventuallyEq (hf : f =ᶠ[l ⊓ 𝓟 s] g) (hs : s =ᶠ[l] t) :
    mulIndicator s f =ᶠ[l] mulIndicator t g

{α : Type u_1}
{M : Type u_3}
[One M]
{s t : Set α}
{f g : α → M}
{l : Filter α}
(hf : f =ᶠ[l ⊓ 𝓟 s] g)
(hs : s =ᶠ[l] t)


@[simp]
theorem tensorObj_map {F G : C ⥤ D} {X Y} {f : X ⟶ Y} : (F ⊗ G).map f = F.map f ⊗ G.map f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
{F G : C ⥤ D}
{X Y : C}
{f : X ⟶ Y}


@[to_additive]
theorem centralizer_univ : centralizer Set.univ = center G

Subgroup.centralizer Set.univ = Subgroup.center G


lemma BddAbove.isBounded_inter (hs : BddAbove s) (ht : BddBelow t) : IsBounded (s ∩ t)

{α : Type u_1}
[Bornology α]
{s t : Set α}
[Preorder α]
[IsOrderBornology α]
(hs : BddAbove s)
(ht : BddBelow t)


/-- Copy of a `Dilation` with a new `toFun` equal to the old one. Useful to fix definitional
equalities. -/
@[simps (config := .asFn)]
protected def copy (f : α →ᵈ β) (f' : α → β) (h : f' = ⇑f) : α →ᵈ β

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(f : α →ᵈ β)
(f' : α → β)
(h : f' = ⇑f)


@[simp]
theorem coe_zero : ⇑(0 : Cₛ^n⟮I; F, V⟯) = 0

[TopologicalSpace (Bundle.TotalSpace F V)]


protected theorem Computable.partrec {α σ} [Primcodable α] [Primcodable σ] {f : α → σ}
    (hf : Computable f) : Partrec (f : α →. σ)

{α : Type u_1}
{σ : Type u_2}
[Primcodable α]
[Primcodable σ]
{f : α → σ}
(hf : Computable f)


theorem Additive.isNormalAddSubgroup_iff [Group G] {s : Set G} :
    @IsNormalAddSubgroup (Additive G) _ s ↔ IsNormalSubgroup s

IsNormalAddSubgroup s ↔ IsNormalSubgroup s


lemma mem_exterior : a ∈ exterior s ↔ ∀ U, IsOpen U → s ⊆ U → a ∈ U

{α : Type u_3}
[TopologicalSpace α]
{s : Set α}
{a : α}

a ∈ exterior s ↔ ∀ (U : Set α), IsOpen U → s ⊆ U → a ∈ U


/-- The finrank of `M →ₗ[R] N` as an `S`-module is `(finrank R M) * (finrank S N)`. -/
theorem FiniteDimensional.finrank_linearMap :
    finrank S (M →ₗ[R] N) = finrank R M * finrank S N

(R : Type u)
(S : Type u')
(M : Type v)
(N : Type w)
[Ring R]
[Ring S]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
[AddCommGroup N]
[Module R N]
[Module S N]
[SMulCommClass R S N]
[StrongRankCondition R]
[StrongRankCondition S]
[Module.Free S N]

FiniteDimensional.finrank S (M →ₗ[R] N) = FiniteDimensional.finrank R M * FiniteDimensional.finrank S N


@[to_additive]
theorem prod_mul_tprod_nat_add [T2Space G] {f : ℕ → G} (k : ℕ) (h : Multipliable f) :
    ((∏ i ∈ range k, f i) * ∏' i, f (i + k)) = ∏' i, f i

{G : Type u_2}
[AddCommGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
[T2Space G]
{f : ℕ → G}
(k : ℕ)
(h : Summable f)

∑ i ∈ Finset.range k, f i + ∑' (i : ℕ), f (i + k) = ∑' (i : ℕ), f i


lemma support_one_subset [One G] : (1 : MonoidAlgebra k G).support ⊆ 1

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[One G]


@[simp]
theorem count_cons_of_ne {a b : α} (h : a ≠ b) (s : Multiset α) : count a (b ::ₘ s) = count a s

{α : Type u_1}
[DecidableEq α]
{a b : α}
(h : a ≠ b)
(s : Multiset α)

Multiset.count a (b ::ₘ s) = Multiset.count a s


/-- A type class for topological spaces in which the indicator functions of closed sets can be
approximated pointwise from above by a sequence of bounded continuous functions. -/
class HasOuterApproxClosed (X : Type*) [TopologicalSpace X] : Prop where
  exAppr : ∀ (F : Set X), IsClosed F → ∃ (fseq : ℕ → (X →ᵇ ℝ≥0)),
    (∀ n x, fseq n x ≤ 1) ∧ (∀ n x, x ∈ F → 1 ≤ fseq n x) ∧
    Tendsto (fun n : ℕ ↦ (fun x ↦ fseq n x)) atTop (𝓝 (indicator F fun _ ↦ (1 : ℝ≥0)))

{X : Type u_1}
[TopologicalSpace X]
[self : HasOuterApproxClosed X]
(F : Set X)

IsClosed F →
  ∃ fseq,
    (∀ (n : ℕ) (x : X), (fseq n) x ≤ 1) ∧
      (∀ (n : ℕ), ∀ x ∈ F, 1 ≤ (fseq n) x) ∧
        Filter.Tendsto (fun n x => (fseq n) x) Filter.atTop (𝓝 (F.indicator fun x => 1))


/-- Any ring homomorphism into `ZMod n` is surjective. -/
theorem ringHom_surjective [Ring R] (f : R →+* ZMod n) : Function.Surjective f

{n : ℕ}
{R : Type u_1}
[Ring R]
(f : R →+* ZMod n)


theorem hasSum_conj' {f : α → 𝕜} {x : 𝕜} : HasSum (fun x => conj (f x)) (conj x) ↔ HasSum f x

{α : Type u_1}
(𝕜 : Type u_2)
[RCLike 𝕜]
{f : α → 𝕜}
{x : 𝕜}

HasSum (fun x => (starRingEnd 𝕜) (f x)) ((starRingEnd 𝕜) x) ↔ HasSum f x


@[to_additive]
theorem mul_ciInf (hf : BddBelow (range f)) (a : G) : (a * ⨅ i, f i) = ⨅ i, a * f i

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


lemma eval_polynomial (P : Fin 3 → R) : eval P W'.polynomial =
    P y ^ 2 + W'.a₁ * P x * P y * P z + W'.a₃ * P y * P z ^ 3
      - (P x ^ 3 + W'.a₂ * P x ^ 2 * P z ^ 2 + W'.a₄ * P x * P z ^ 4 + W'.a₆ * P z ^ 6)

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P : Fin 3 → R)

(MvPolynomial.eval P) W'.polynomial =
  P y ^ 2 + W'.a₁ * P x * P y * P z + W'.a₃ * P y * P z ^ 3 -
    (P x ^ 3 + W'.a₂ * P x ^ 2 * P z ^ 2 + W'.a₄ * P x * P z ^ 4 + W'.a₆ * P z ^ 6)


theorem infinitePos_mul_infinitePos {x y : ℝ*} :
    InfinitePos x → InfinitePos y → InfinitePos (x * y)

x.InfinitePos → y.InfinitePos → (x * y).InfinitePos


theorem add_emod_eq_add_emod_right {m n k : Int} (i : Int)
    (H : m % n = k % n) : (m + i) % n = (k + i) % n


theorem then_eq_eq {o₁ o₂ : Ordering} : o₁.then o₂ = eq ↔ o₁ = eq ∧ o₂ = eq

o₁.then o₂ = Ordering.eq ↔ o₁ = Ordering.eq ∧ o₂ = Ordering.eq


theorem isRefl (H : B₁.IsAlt) : B₁.IsRefl

{R₁ : Type u_3}
{M₁ : Type u_4}
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
{B₁ : LinearMap.BilinForm R₁ M₁}
(H : B₁.IsAlt)


@[simp]
theorem directSumLeft_tmul_lof (i : ι₁) (x : M₁ i) (y : M₂') :
    directSumLeft R M₁ M₂' (DirectSum.lof R _ _ i x ⊗ₜ[R] y) =
    DirectSum.lof R _ _ i (x ⊗ₜ[R] y)

(R : Type u)
[CommSemiring R]
{ι₁ : Type v₁}
[DecidableEq ι₁]
{M₁ : ι₁ → Type w₁}
{M₂' : Type w₂'}
[(i₁ : ι₁) → AddCommMonoid (M₁ i₁)]
[AddCommMonoid M₂']
[(i₁ : ι₁) → Module R (M₁ i₁)]
[Module R M₂']
(i : ι₁)
(x : M₁ i)
(y : M₂')

(TensorProduct.directSumLeft R M₁ M₂') ((DirectSum.lof R ι₁ M₁ i) x ⊗ₜ[R] y) =
  (DirectSum.lof R ι₁ (fun i => TensorProduct R (M₁ i) M₂') i) (x ⊗ₜ[R] y)


/-- If you actually have an element of `Fin n`, then the `n` is always positive -/
theorem size_pos (i : Fin n) : 0 < n


@[simp]
lemma rightUnitor_inv_app_apply (K : SSet.{u}) {Δ : SimplexCategoryᵒᵖ} (x : K.obj Δ) :
    (ρ_ K).inv.app Δ x = ⟨x, PUnit.unit⟩

(K : SSet)
{Δ : SimplexCategoryᵒᵖ}
(x : K.obj Δ)


private theorem le_sum_card_subset_chunk_parts (h𝒜 : 𝒜 ⊆ (chunk hP G ε hU).parts) (hs : s ∈ 𝒜) :
    (𝒜.card : ℝ) * s.card * (m / (m + 1)) ≤ (𝒜.sup id).card

(h𝒜 : 𝒜 ⊆ (SzemerediRegularity.chunk hP G ε hU).parts)

↑𝒜.card * ↑s.card *
    (↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card) /
      (↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card) + 1)) ≤
  ↑(𝒜.sup id).card


@[simp]
theorem map_top [RingHomSurjective τ₁₂] (f : F) : map f ⊤ = range f

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_11}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
[RingHomSurjective τ₁₂]
(f : F)


theorem hausdorffMeasure_preimage_le (hf : AntilipschitzWith K f) (hd : 0 ≤ d) (s : Set Y) :
    μH[d] (f ⁻¹' s) ≤ (K : ℝ≥0∞) ^ d * μH[d] s

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
[MeasurableSpace X]
[BorelSpace X]
[MeasurableSpace Y]
[BorelSpace Y]
{f : X → Y}
{K : ℝ≥0}
{d : ℝ}
(hf : AntilipschitzWith K f)
(hd : 0 ≤ d)
(s : Set Y)


@[to_additive (attr := simp)]
theorem infEdist_inv_inv (x : E) (s : Set E) : infEdist x⁻¹ s⁻¹ = infEdist x s

{E : Type u_1}
[SeminormedCommGroup E]
(x : E)
(s : Set E)

EMetric.infEdist x⁻¹ s⁻¹ = EMetric.infEdist x s


theorem cancel_factors_lt {α} [LinearOrderedField α] {a b ad bd a' b' gcd : α}
    (ha : ad * a = a') (hb : bd * b = b') (had : 0 < ad) (hbd : 0 < bd) (hgcd : 0 < gcd) :
    (a < b) = (1 / gcd * (bd * a') < 1 / gcd * (ad * b'))

{α : Type u_1}
[LinearOrderedField α]
{a b ad bd a' b' gcd : α}
(ha : ad * a = a')
(hb : bd * b = b')
(had : 0 < ad)
(hbd : 0 < bd)
(hgcd : 0 < gcd)


theorem restrict_zero_set {s : Set α} (h : μ s = 0) : μ.restrict s = 0

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(h : μ s = 0)


theorem R1Space.t2Space_iff_t0Space [R1Space X] : T2Space X ↔ T0Space X

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]


theorem comp_symm_equiv {π : P →+* R} (m : PerfectionMap p π) (f : Ring.Perfection R p) :
    π (m.equiv.symm f) = Perfection.coeff R p 0 f

{p : ℕ}
[Fact (Nat.Prime p)]
{R : Type u₁}
[CommSemiring R]
[CharP R p]
{P : Type u₃}
[CommSemiring P]
[CharP P p]
[PerfectRing P p]
{π : P →+* R}
(m : PerfectionMap p π)
(f : Ring.Perfection R p)

π (m.equiv.symm f) = (Perfection.coeff R p 0) f


@[simp] theorem IsOrtho.inl_inr {Q₁ : QuadraticMap R M₁ P} {Q₂ : QuadraticMap R M₂ P}
    (m₁ : M₁) (m₂ : M₂) :
    (Q₁.prod Q₂).IsOrtho (m₁, 0) (0, m₂)

{R : Type u_2}
{M₁ : Type u_3}
{M₂ : Type u_4}
{P : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid P]
[Module R M₁]
[Module R M₂]
[Module R P]
{Q₁ : QuadraticMap R M₁ P}
{Q₂ : QuadraticMap R M₂ P}
(m₁ : M₁)
(m₂ : M₂)


@[instance]
theorem comap_snd_neBot [Nonempty α] {f : Filter β} [NeBot f] :
    (f.comap (Prod.snd : α × β → β)).NeBot

{α : Type u}
{β : Type v}
[Nonempty α]
{f : Filter β}
[f.NeBot]


/-- The sine of an angle in a right-angled triangle as a ratio of sides. -/
theorem sin_oangle_left_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) :
    Real.Angle.sin (∡ p₃ p₁ p₂) = dist p₃ p₂ / dist p₁ p₃

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

(∡ p₃ p₁ p₂).sin = dist p₃ p₂ / dist p₁ p₃