@[simp]
theorem comap_coe_nhds_infty : comap ((↑) : X → OnePoint X) (𝓝 ∞) = coclosedCompact X

Filter.comap OnePoint.some (𝓝 OnePoint.infty) = Filter.coclosedCompact X


theorem sigma_sub_ext {m₁ m₂ : Σi : Fin (n + 1), Sym α (n - i)} (h : (m₁.2 : Multiset α) = m₂.2) :
    m₁ = m₂

{m₁ m₂ : (i : Fin (n + 1)) × Sym α (n - ↑i)}


@[simp]
theorem of_ρ {V : Type u} [AddCommGroup V] [Module k V] (ρ : G →* V →ₗ[k] V) : (of ρ).ρ = ρ

{k G : Type u}
[CommRing k]
[Monoid G]
{V : Type u}
[AddCommGroup V]
[Module k V]
(ρ : G →* V →ₗ[k] V)


@[simp]
theorem leadingCoeff_pow (p : R[X]) (n : ℕ) : leadingCoeff (p ^ n) = leadingCoeff p ^ n

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
(p : R[X])
(n : ℕ)

(p ^ n).leadingCoeff = p.leadingCoeff ^ n


theorem rotate'_mod (l : List α) (n : ℕ) : l.rotate' (n % l.length) = l.rotate' n


theorem deriv_eq {f' : 𝕜 → F} (h : ∀ x, HasDerivAt f (f' x) x) : deriv f = f'

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f' : 𝕜 → F}
(h : ∀ (x : 𝕜), HasDerivAt f (f' x) x)


theorem image2_inter_union_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
    image2 f (s ∩ t) (s ∪ t) ⊆ image2 f s t

{α : Type u_1}
{β : Type u_3}
{f : α → α → β}
{s t : Set α}
(hf : ∀ (a b : α), f a b = f b a)

Set.image2 f (s ∩ t) (s ∪ t) ⊆ Set.image2 f s t


theorem op_sInf (S : Set (Subsemiring R)) : (sInf S).op = sInf (.unop ⁻¹' S)

{R : Type u_2}
[NonAssocSemiring R]
(S : Set (Subsemiring R))

(sInf S).op = sInf (Subsemiring.unop ⁻¹' S)


@[monad_norm]
theorem map_eq_bind_pure_comp (m : Type u → Type v) [Monad m] [LawfulMonad m]
    (f : α → β) (x : m α) : f <$> x = x >>= pure ∘ f

{α β : Type u}
(m : Type u → Type v)
[Monad m]
[LawfulMonad m]
(f : α → β)
(x : m α)


theorem HasDerivAt.differentiableAt (h : HasDerivAt f f' x) : DifferentiableAt 𝕜 f x

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


@[reassoc (attr := simp)]
lemma isoOfQuasiIsoAt_inv_hom_id (f : K ⟶ L) (i : ι) [K.HasHomology i] [L.HasHomology i]
    [QuasiIsoAt f i] :
    (isoOfQuasiIsoAt f i).inv ≫ homologyMap f i = 𝟙 _

(isoOfQuasiIsoAt f i).inv ≫ HomologicalComplex.homologyMap f i = 𝟙 (L.homology i)


/-- Like `Finsupp.mapDomain_add`, but for the convolutive multiplication we define in this file -/
theorem mapDomain_mul {α : Type*} {β : Type*} {α₂ : Type*} [Semiring β] [Add α] [Add α₂]
    {F : Type*} [FunLike F α α₂] [AddHomClass F α α₂] (f : F) (x y : AddMonoidAlgebra β α) :
    mapDomain f (x * y) = mapDomain f x * mapDomain f y

{α : Type u_3}
{β : Type u_4}
{α₂ : Type u_5}
[Semiring β]
[Add α]
[Add α₂]
{F : Type u_6}
[FunLike F α α₂]
[AddHomClass F α α₂]
(f : F)
(x y : AddMonoidAlgebra β α)

AddMonoidAlgebra.mapDomain (⇑f) (x * y) = AddMonoidAlgebra.mapDomain (⇑f) x * AddMonoidAlgebra.mapDomain (⇑f) y


@[simp]
theorem monotoneOn_comp_ofDual_iff : MonotoneOn (f ∘ ofDual) s ↔ AntitoneOn f s

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

MonotoneOn (f ∘ ⇑OrderDual.ofDual) s ↔ AntitoneOn f s


@[simp]
theorem toLex_apply (x : ∀ i, β i) (i : ι) : toLex x i = x i

{ι : Type u_1}
{β : ι → Type u_2}
(x : (i : ι) → β i)
(i : ι)


@[simp]
theorem BinaryFan.swap_snd {P Q : C} (t : BinaryFan P Q) : t.swap.snd = t.fst

(t : CategoryTheory.Limits.BinaryFan P Q)


@[to_additive]
theorem Set.OrdConnected.smul (hs : s.OrdConnected) : (a • s).OrdConnected

{α : Type u_1}
[OrderedCommGroup α]
{s : Set α}
{a : α}
(hs : s.OrdConnected)


lemma baseChange_comp (g : N →ₗ[R] P) :
    (g ∘ₗ f).baseChange A = g.baseChange A ∘ₗ f.baseChange A

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : M →ₗ[R] N)
(g : N →ₗ[R] P)

LinearMap.baseChange A (g ∘ₗ f) = LinearMap.baseChange A g ∘ₗ LinearMap.baseChange A f


/-- The L-series of the constant sequence `1` equals the Riemann zeta function on its
domain of convergence `1 < re s`. -/
lemma LSeriesHasSum_one {s : ℂ} (hs : 1 < s.re) : LSeriesHasSum 1 s (riemannZeta s)


/-- The affine open sets of an open subscheme corresponds to
the affine open sets containing in the image. -/
@[simps]
def _root_.AlgebraicGeometry.IsOpenImmersion.affineOpensEquiv (f : X ⟶ Y) [H : IsOpenImmersion f] :
    X.affineOpens ≃ { U : Y.affineOpens // U ≤ f.opensRange }

[H : AlgebraicGeometry.IsOpenImmersion f]

(U : { U // ↑U ≤ AlgebraicGeometry.Scheme.Hom.opensRange f })

↑((AlgebraicGeometry.IsOpenImmersion.affineOpensEquiv f).symm U) = (TopologicalSpace.Opens.map f.val.base).obj ↑↑U


theorem finrank_right_dvd_finrank_sup_of_free :
    finrank R B ∣ finrank R ↥(A ⊔ B)

[Module.Free ↥B ↥(Algebra.adjoin ↥B ↑A)]

FiniteDimensional.finrank R ↥B ∣ FiniteDimensional.finrank R ↥(A ⊔ B)


theorem inf_inf : s.inf (f ⊓ g) = s.inf f ⊓ s.inf g

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
{s : Finset β}
{f g : β → α}


theorem descPochhammer_succ_left (n : ℕ) :
    descPochhammer R (n + 1) = X * (descPochhammer R n).comp (X - 1)

descPochhammer R (n + 1) = Polynomial.X * (descPochhammer R n).comp (Polynomial.X - 1)


@[simp]
theorem zeroth_contAux_eq_one_zero : g.contsAux 0 = ⟨1, 0⟩

{K : Type u_1}
{g : GenContFract K}
[DivisionRing K]


@[simp]
theorem AddMonoidHom.coe_mul : ⇑(AddMonoidHom.mul : R →+ R →+ R) = AddMonoidHom.mulLeft

{R : Type u_1}
[NonUnitalNonAssocSemiring R]


lemma Function.HasMaxCutProperty.forbids_commutativeFractionalPolymorphism
    {f : (Fin 2 → D) → C} (mcf : f.HasMaxCutProperty)
    {ω : FractionalOperation D 2} (valid : ω.IsValid) (symmega : ω.IsSymmetric) :
    ¬ f.AdmitsFractional ω

{D : Type u_1}
{C : Type u_3}
[OrderedCancelAddCommMonoid C]
{f : (Fin 2 → D) → C}
(mcf : Function.HasMaxCutProperty f)
{ω : FractionalOperation D 2}
(valid : ω.IsValid)
(symmega : ω.IsSymmetric)


@[to_additive Icc_add_Ico_subset]
theorem Icc_mul_Ico_subset' (a b c d : α) : Icc a b * Ico c d ⊆ Ico (a * c) (b * d)

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

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

Set.Icc a b * Set.Ico c d ⊆ Set.Ico (a * c) (b * d)


@[to_additive] lemma oneLePart_eq_one : a⁺ᵐ = 1 ↔ a ≤ 1

{α : Type u_1}
[Lattice α]
[AddGroup α]
{a : α}


theorem polynomialFunctions_separatesPoints (X : Set R) : (polynomialFunctions X).SeparatesPoints

{R : Type u_1}
[CommSemiring R]
[TopologicalSpace R]
[TopologicalSemiring R]
(X : Set R)


@[simp]
theorem lift_eq_nat_iff {a : Cardinal.{u}} {n : ℕ} : lift.{v} a = n ↔ a = n


/-- A self-map preserving a finite measure is conservative. -/
protected theorem MeasurePreserving.conservative [IsFiniteMeasure μ] (h : MeasurePreserving f μ μ) :
    Conservative f μ

(h : MeasureTheory.MeasurePreserving f μ μ)


theorem hasse_preconnected_of_pred [PredOrder α] [IsPredArchimedean α] : (hasse α).Preconnected

(α : Type u_1)
[LinearOrder α]
[PredOrder α]
[IsPredArchimedean α]


theorem gronwallBound_continuous_ε (δ K x : ℝ) : Continuous fun ε => gronwallBound δ K ε x


@[simp, norm_cast]
theorem coe_refl' : ⇑(ContinuousLinearEquiv.refl R₁ M₁) = id

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]


protected theorem le_sup_left (f g : α →ₘ[μ] β) : f ≤ f ⊔ g

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
[SemilatticeSup β]
[ContinuousSup β]
(f g : α →ₘ[μ] β)


/-- A ring homomorphism `f : R →+* S` such that `f x` commutes with `f y` for all `x, y` defines
a ring homomorphism from `Rᵐᵒᵖ`. -/
@[simps (config := .asFn)]
def RingHom.fromOpposite {R S : Type*} [Semiring R] [Semiring S] (f : R →+* S)
    (hf : ∀ x y, Commute (f x) (f y)) : Rᵐᵒᵖ →+* S

{R : Type u_2}
{S : Type u_3}
[Semiring R]
[Semiring S]
(f : R →+* S)
(hf : ∀ (x y : R), Commute (f x) (f y))

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


/-- If the angle between three points is `π`, the first and third points are not equal. -/
theorem left_ne_right_of_oangle_eq_pi {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = π) : p₁ ≠ p₃

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


@[to_additive (attr := gcongr) add_le_add_left]
theorem mul_le_mul_left' [CovariantClass α α (· * ·) (· ≤ ·)] {b c : α} (bc : b ≤ c) (a : α) :
    a * b ≤ a * c

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


theorem iInf_sup_of_antitone {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] {f g : ι → α}
    (hf : Antitone f) (hg : Antitone g) : ⨅ i, f i ⊔ g i = (⨅ i, f i) ⊔ ⨅ i, g i

{α : Type u}
[Order.Coframe α]
{ι : Type u_1}
[Preorder ι]
[IsDirected ι fun x x_1 => x ≤ x_1]
{f g : ι → α}
(hf : Antitone f)
(hg : Antitone g)


@[simp]
theorem coe_natLT {f : ℕ → α} {H : ∀ n : ℕ, r (f n) (f (n + 1))} : ⇑(natLT f H) = f

{α : Type u_1}
{r : α → α → Prop}
[IsStrictOrder α r]
{f : ℕ → α}
{H : ∀ (n : ℕ), r (f n) (f (n + 1))}


@[to_additive (attr := simp)]
theorem mker_one : mker (1 : M →* N) = ⊤

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


@[simp]
theorem supPrime_toDual {a : α} : SupPrime (toDual a) ↔ InfPrime a

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

SupPrime (OrderDual.toDual a) ↔ InfPrime a


@[simp]
theorem isOrtho_top_right {U : Submodule 𝕜 E} : U ⟂ ⊤ ↔ U = ⊥

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

U ⟂ ⊤ ↔ U = ⊥


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

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{s : Set M}
(hs : AddSubmonoid.closure s = ⊤)
{f g : M →+ N}
(h : Set.EqOn (⇑f) (⇑g) s)


theorem apply_piecewise₂ {δ' δ'' : α → Sort*} (f' g' : ∀ i, δ' i) (h : ∀ i, δ i → δ' i → δ'' i)
    {x : α} :
    h x (s.piecewise f g x) (s.piecewise f' g' x) =
      s.piecewise (fun x => h x (f x) (f' x)) (fun x => h x (g x) (g' x)) x

{α : Type u_1}
{δ : α → Sort u_6}
(s : Set α)
(f g : (i : α) → δ i)
[(j : α) → Decidable (j ∈ s)]
{δ' : α → Sort u_7}
{δ'' : α → Sort u_8}
(f' g' : (i : α) → δ' i)
(h : (i : α) → δ i → δ' i → δ'' i)
{x : α}


/-- The rank of a free module `M` over `R` is the cardinality of `ChooseBasisIndex R M`. -/
theorem rank_eq_card_chooseBasisIndex : Module.rank R M = #(ChooseBasisIndex R M)

(R : Type u)
(M : Type v)
[Ring R]
[StrongRankCondition R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]

Module.rank R M = #(Module.Free.ChooseBasisIndex R M)


@[to_additive (attr := simp (default + 1))]
lemma le_inf_div [SemilatticeInf β] [OrderTop β] {s t : Finset α} {f : α → β} {a : β} :
    a ≤ inf (s / t) f ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ f (x / y)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Sub α]
[SemilatticeInf β]
[OrderTop β]
{s t : Finset α}
{f : α → β}
{a : β}

a ≤ (s - t).inf f ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ f (x - y)


theorem Icc_succ_right (h : a ≤ succ b) : Icc a (succ b) = insert (succ b) (Icc a b)

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a b : α}
(h : a ≤ Order.succ b)

Set.Icc a (Order.succ b) = insert (Order.succ b) (Set.Icc a b)


lemma isIso_homologyι : IsIso (K.homologyι i)


theorem anyM_loop_iff_exists (p : α → Bool) (as : Array α) (start stop) (h : stop ≤ as.size) :
    anyM.loop (m := Id) p as stop h start = true ↔
      ∃ i : Fin as.size, start ≤ ↑i ∧ ↑i < stop ∧ p as[i] = true

{α : Type u_1}
(p : α → Bool)
(as : Array α)
(start stop : Nat)
(h : stop ≤ as.size)

Array.anyM.loop p as stop h start = true ↔ ∃ i, start ≤ ↑i ∧ ↑i < stop ∧ p as[i] = true


theorem ae_restrict_iff_subtype {m0 : MeasurableSpace α} {μ : Measure α} {s : Set α}
    (hs : MeasurableSet s) {p : α → Prop} :
    (∀ᵐ x ∂μ.restrict s, p x) ↔ ∀ᵐ (x : s) ∂comap ((↑) : s → α) μ, p x

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

(∀ᵐ (x : α) ∂μ.restrict s, p x) ↔ ∀ᵐ (x : ↑s) ∂MeasureTheory.Measure.comap Subtype.val μ, p ↑x


/-- If `s` is a measurable set, then `𝓝[s] a` is a measurably generated filter for
each `a`. This cannot be an `instance` because it depends on a non-instance `hs : MeasurableSet s`.
-/
theorem MeasurableSet.nhdsWithin_isMeasurablyGenerated {s : Set α} (hs : MeasurableSet s) (a : α) :
    (𝓝[s] a).IsMeasurablyGenerated

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
{s : Set α}
(hs : MeasurableSet s)
(a : α)


theorem IsMaxChain.bot_mem [LE α] [OrderBot α] (h : IsMaxChain (· ≤ ·) s) : ⊥ ∈ s

(h : IsMaxChain (fun x x_1 => x ≤ x_1) s)


theorem balancedCoreAux_balanced (h0 : (0 : E) ∈ balancedCoreAux 𝕜 s) :
    Balanced 𝕜 (balancedCoreAux 𝕜 s)

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(h0 : 0 ∈ balancedCoreAux 𝕜 s)


theorem Intersecting.exists_mem_set {𝒜 : Set (Set α)} (h𝒜 : 𝒜.Intersecting) {s t : Set α}
    (hs : s ∈ 𝒜) (ht : t ∈ 𝒜) : ∃ a, a ∈ s ∧ a ∈ t

{α : Type u_1}
{𝒜 : Set (Set α)}
(h𝒜 : 𝒜.Intersecting)
{s t : Set α}
(hs : s ∈ 𝒜)
(ht : t ∈ 𝒜)


theorem conformalFactorAt_pos {f : E → F} {x : E} (h : ConformalAt f x) : 0 < conformalFactorAt h

{E : Type u_1}
{F : Type u_2}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace ℝ E]
[InnerProductSpace ℝ F]
{f : E → F}
{x : E}
(h : ConformalAt f x)


@[simp, norm_cast]
lemma coe_iSup {ι : Sort*} (f : ι → G.Finsubgraph) : ⨆ i, f i = (⨆ i, f i : G.Subgraph)

{V : Type u}
{G : SimpleGraph V}
[Finite V]
{ι : Sort u_1}
(f : ι → G.Finsubgraph)


theorem tendsto_atTop_isLUB (h_mono : Monotone f) (ha : IsLUB (Set.range f) a) :
    Tendsto f atTop (𝓝 a)

{α : Type u_1}
{ι : Type u_3}
[Preorder ι]
[TopologicalSpace α]
[Preorder α]
[SupConvergenceClass α]
{f : ι → α}
{a : α}
(h_mono : Monotone f)
(ha : IsLUB (Set.range f) a)


@[continuity, fun_prop]
theorem Continuous.sum_map {f : X → Y} {g : Z → W} (hf : Continuous f) (hg : Continuous g) :
    Continuous (Sum.map f g)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
{W : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace W]
{f : X → Y}
{g : Z → W}
(hf : Continuous f)
(hg : Continuous g)


lemma ne_and_eq_iff_right {a b c : α} (h : b ≠ c) : a ≠ b ∧ a = c ↔ a = c


@[simp]
theorem inv_tensor {W X Y Z : C} (f : W ⟶ X) [IsIso f] (g : Y ⟶ Z) [IsIso g] :
    inv (f ⊗ g) = inv f ⊗ inv g

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

CategoryTheory.inv (CategoryTheory.MonoidalCategory.tensorHom f g) =
  CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.inv f) (CategoryTheory.inv g)


lemma rpow_lt_top_iff_of_pos {x : ℝ≥0∞} {y : ℝ} (hy : 0 < y) : x ^ y < ∞ ↔ x < ∞


/-- An embedding of a complex shape `c : ComplexShape ι` into a complex shape
`c' : ComplexShape ι'` consists of a injective map `f : ι → ι'` which satisfies
a compatiblity with respect to the relations `c.Rel` and `c'.Rel`. -/
structure Embedding where
  /-- the map between the underlying types of indices -/
  f : ι → ι'
  injective_f : Function.Injective f
  rel {i₁ i₂ : ι} (h : c.Rel i₁ i₂) : c'.Rel (f i₁) (f i₂)

{ι : Type u_1}
{ι' : Type u_2}
{c : ComplexShape ι}
{c' : ComplexShape ι'}
(self : c.Embedding c')


@[reassoc (attr := simp)]
theorem imageSubobjectCompIso_inv_arrow (f : X ⟶ Y) [HasImage f] {Y' : C} (h : Y ⟶ Y') [IsIso h] :
    (imageSubobjectCompIso f h).inv ≫ (imageSubobject (f ≫ h)).arrow =
      (imageSubobject f).arrow ≫ h

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
[CategoryTheory.Limits.HasEqualizers C]
(f : X ⟶ Y)
[CategoryTheory.Limits.HasImage f]
{Y' : C}
(h : Y ⟶ Y')
[CategoryTheory.IsIso h]

(CategoryTheory.Limits.imageSubobjectCompIso f h).inv ≫ (CategoryTheory.Limits.imageSubobject (f ≫ h)).arrow =
  (CategoryTheory.Limits.imageSubobject f).arrow ≫ h


@[simp]
theorem sign_sumCongr (σa : Perm α) (σb : Perm β) : sign (sumCongr σa σb) = sign σa * sign σb

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

Equiv.Perm.sign (σa.sumCongr σb) = Equiv.Perm.sign σa * Equiv.Perm.sign σb


theorem lineMap_apply (p₀ p₁ : P1) (c : k) : lineMap p₀ p₁ c = c • (p₁ -ᵥ p₀) +ᵥ p₀

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
(p₀ p₁ : P1)
(c : k)

(AffineMap.lineMap p₀ p₁) c = c • (p₁ -ᵥ p₀) +ᵥ p₀


@[to_additive (attr := aesop safe apply (rule_sets := [SetLike]))]
theorem zpow_mem {x : M} (hx : x ∈ K) : ∀ n : ℤ, x ^ n ∈ K

{M : Type u_5}
{S : Type u_6}
[DivInvMonoid M]
[SetLike S M]
[hSM : SubgroupClass S M]
{K : S}
{x : M}
(hx : x ∈ K)
(n : ℤ)


lemma finsuppAntidiag_empty (n : μ) :
    finsuppAntidiag (∅ : Finset ι) n = if n = 0 then {0} else ∅

{ι : Type u_1}
{μ : Type u_2}
[DecidableEq ι]
[AddCommMonoid μ]
[Finset.HasAntidiagonal μ]
[DecidableEq μ]
(n : μ)

∅.finsuppAntidiag n = if n = 0 then {0} else ∅


/-- An affine subspace constructed from a point and a direction contains that point. -/
theorem self_mem_mk' (p : P) (direction : Submodule k V) : p ∈ mk' p direction

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(p : P)
(direction : Submodule k V)


@[simp] theorem one_apply : ⇑(1 : unitaryGroup n α) = (1 : Matrix n n α)

{n : Type u}
[DecidableEq n]
[Fintype n]
{α : Type v}
[CommRing α]
[StarRing α]


theorem gramSchmidtNormed_unit_length_coe {f : ι → E} (n : ι)
    (h₀ : LinearIndependent 𝕜 (f ∘ ((↑) : Set.Iic n → ι))) : ‖gramSchmidtNormed 𝕜 f n‖ = 1

(h₀ : LinearIndependent (ι := { x // x ∈ Set.Iic n }) 𝕜 (f ∘ Subtype.val))


theorem convex_halfspace_im_ge (r : ℝ) : Convex ℝ { c : ℂ | r ≤ c.im }


theorem list_prod_apply (x : C) (l : List (LocallyConstant C ℤ)) :
    l.prod x = (l.map (LocallyConstant.evalMonoidHom x)).prod

{I : Type u}
(C : Set (I → Bool))
(x : ↑C)
(l : List (LocallyConstant ↑C ℤ))

l.prod x = (List.map (⇑(LocallyConstant.evalMonoidHom x)) l).prod


@[simp, measurability]
protected theorem MeasurableSet.disjointed {f : ℕ → Set α} (h : ∀ i, MeasurableSet (f i)) (n) :
    MeasurableSet (disjointed f n)

{α : Type u_1}
{m : MeasurableSpace α}
{f : ℕ → Set α}
(h : ∀ (i : ℕ), MeasurableSet (f i))
(n : ℕ)


lemma surjectiveOnStalks_iff_forall_maximal :
    f.SurjectiveOnStalks ↔ ∀ (I : Ideal S) (_ : I.IsMaximal),
      Function.Surjective (Localization.localRingHom _ I f rfl)

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
{f : R →+* S}

f.SurjectiveOnStalks ↔
  ∀ (I : Ideal S) (x : I.IsMaximal), Function.Surjective ⇑(Localization.localRingHom (Ideal.comap f I) I f ⋯)


/-- Self-adjoint elements commute if and only if their product is self-adjoint. -/
lemma commute_iff {R : Type*} [Mul R] [StarMul R] {x y : R}
    (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) : Commute x y ↔ IsSelfAdjoint (x * y)

{R : Type u_3}
[Mul R]
[StarMul R]
{x y : R}
(hx : IsSelfAdjoint x)
(hy : IsSelfAdjoint y)


lemma eval_image_piFinset_const {β} [DecidableEq β] (t : Finset β) (a : α) :
    ((piFinset fun _i : α ↦ t).image fun f ↦ f a) = t

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{β : Type u_4}
[DecidableEq β]
(t : Finset β)
(a : α)

Finset.image (fun f => f a) (Fintype.piFinset fun _i => t) = t


@[simp]
theorem trop_inj_iff (x y : R) : trop x = trop y ↔ x = y

Tropical.trop x = Tropical.trop y ↔ x = y


/-- **Triangle inequality** for the norm. -/
@[to_additive norm_add_le "**Triangle inequality** for the norm."]
theorem norm_mul_le' (a b : E) : ‖a * b‖ ≤ ‖a‖ + ‖b‖

{E : Type u_6}
[SeminormedGroup E]
(a b : E)

‖a * b‖ ≤ ‖a‖ + ‖b‖


/-- **Rolle's Theorem** `HasDerivAt` version -/
theorem exists_hasDerivAt_eq_zero (hab : a < b) (hfc : ContinuousOn f (Icc a b)) (hfI : f a = f b)
    (hff' : ∀ x ∈ Ioo a b, HasDerivAt f (f' x) x) : ∃ c ∈ Ioo a b, f' c = 0

(hff' : ∀ x ∈ Set.Ioo a b, HasDerivAt f (f' x) x)


@[simp, norm_cast]
theorem const_lt_iff [Preorder β] {x y : β} : (↑x : β*) < ↑y ↔ x < y

{α : Type u}
{β : Type v}
{φ : Ultrafilter α}
[Preorder β]
{x y : β}


/-- Reinterpret `G ≃+ Additive H` as `Multiplicative G ≃* H`. -/
@[simps]
def AddEquiv.toMultiplicative'' [AddZeroClass G] [MulOneClass H] :
    G ≃+ Additive H ≃ (Multiplicative G ≃* H)

{G : Type u_1}
{H : Type u_2}
[AddZeroClass G]
[MulOneClass H]
(f : Multiplicative G ≃* H)
(a : Additive H)

(AddEquiv.toMultiplicative''.symm f).symm a = (AddMonoidHom.toMultiplicative'.symm f.symm.toMonoidHom) a


@[to_additive]
theorem prod_eq_fold [CommMonoid β] (s : Finset α) (f : α → β) :
    ∏ x ∈ s, f x = s.fold ((· * ·) : β → β → β) 1 f

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

∑ x ∈ s, f x = Finset.fold (fun x x_1 => x + x_1) 0 f s


theorem measurable_of_measurable_coe (f : β → Measure α)
    (h : ∀ (s : Set α), MeasurableSet s → Measurable fun b => f b s) : Measurable f

(h : ∀ (s : Set α), MeasurableSet s → Measurable fun b => (f b) s)


protected theorem Filter.EventuallyEq.gradient (h : f₁ =ᶠ[𝓝 x] f) : ∇ f₁ =ᶠ[𝓝 x] ∇ f

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{x : F}
{f₁ : F → 𝕜}
(h : f₁ =ᶠ[𝓝 x] f)


theorem one_def : (1 : k[G]) = single 0 1

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


/-- A version of `LawfulSingleton.insert_emptyc_eq` that works with `dsimp`. -/
@[simp] lemma insert_empty : insert a (∅ : Finset α) = {a}


/-- The natural functor that forgets the action of `L` as an order embedding. -/
@[simps] def toSubmodule_orderEmbedding : LieSubmodule R L M ↪o Submodule R M

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(self : LieSubmodule R L M)

(LieSubmodule.toSubmodule_orderEmbedding R L M) self = ↑self


@[simp, rclike_simps]
theorem im_to_real {x : ℝ} : imR x = 0


theorem Iio_mem_nhds (h : a < b) : Iio b ∈ 𝓝 a

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


theorem mem_inv_pointwise_smul_iff {a : M} {S : Ideal R} {x : R} : x ∈ a⁻¹ • S ↔ a • x ∈ S

{M : Type u_1}
{R : Type u_2}
[Group M]
[CommRing R]
[MulSemiringAction M R]
{a : M}
{S : Ideal R}
{x : R}

x ∈ a⁻¹ • S ↔ a • x ∈ S


theorem rootMultiplicity_le_iff {p : R[X]} (p0 : p ≠ 0) (a : R) (n : ℕ) :
    rootMultiplicity a p ≤ n ↔ ¬(X - C a) ^ (n + 1) ∣ p

{R : Type u}
[CommRing R]
{p : R[X]}
(p0 : p ≠ 0)
(a : R)
(n : ℕ)

Polynomial.rootMultiplicity a p ≤ n ↔ ¬(Polynomial.X - Polynomial.C a) ^ (n + 1) ∣ p


@[simp] theorem preimage_Ici : e ⁻¹' Ici (e x) = Ici x

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ↪o β)
(x : α)


@[simp]
theorem cosh_add_sinh : cosh x + sinh x = exp x


@[simp] theorem exists_and_left : (∃ x, b ∧ p x) ↔ b ∧ (∃ x, p x)

{α : Sort u_1}
{p : α → Prop}
{b : Prop}


theorem C_add : (C (a + a') : MvPolynomial σ R) = C a + C a'

{R : Type u}
{σ : Type u_1}
{a a' : R}
[CommSemiring R]

MvPolynomial.C (a + a') = MvPolynomial.C a + MvPolynomial.C a'


theorem convolution_congr [MeasurableAdd₂ G] [MeasurableNeg G] [SFinite μ]
    [IsAddRightInvariant μ] (h1 : f =ᵐ[μ] f') (h2 : g =ᵐ[μ] g') : f ⋆[L, μ] g = f' ⋆[L, μ] g'

{𝕜 : Type u𝕜}
{G : Type uG}
{E : Type uE}
{E' : Type uE'}
{F : Type uF}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[NormedAddCommGroup F]
{f f' : G → E}
{g g' : G → E'}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 E']
[NormedSpace 𝕜 F]
(L : E →L[𝕜] E' →L[𝕜] F)
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[NormedSpace ℝ F]
[AddGroup G]
[MeasurableAdd₂ G]
[MeasurableNeg G]
[MeasureTheory.SFinite μ]
[μ.IsAddRightInvariant]
(h1 : f =ᵐ[μ] f')
(h2 : g =ᵐ[μ] g')

MeasureTheory.convolution f g L μ = MeasureTheory.convolution f' g' L μ


/-- **Rolle's Theorem**, a version for a function on an open interval: if `f` has derivative `f'`
on `(a, b)` and has the same limit `l` at `𝓝[>] a` and `𝓝[<] b`, then `f' c = 0`
for some `c ∈ (a, b)`.  -/
theorem exists_hasDerivAt_eq_zero' (hab : a < b) (hfa : Tendsto f (𝓝[>] a) (𝓝 l))
    (hfb : Tendsto f (𝓝[<] b) (𝓝 l)) (hff' : ∀ x ∈ Ioo a b, HasDerivAt f (f' x) x) :
    ∃ c ∈ Ioo a b, f' c = 0


theorem trans_source' : (e.trans e').source = e.source ∩ e ⁻¹' (e.target ∩ e'.source)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : PartialEquiv α β)
(e' : PartialEquiv β γ)

(e.trans e').source = e.source ∩ ↑e ⁻¹' (e.target ∩ e'.source)


theorem range_comp_le_range (f : A →ₐ[R] B) (g : B →ₐ[R] C) : (g.comp f).range ≤ g.range

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


@[continuity]
theorem continuous_re : Continuous fun q : ℍ => q.re


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

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


@[simp]
theorem powersetCardAux_zero (l : List α) : powersetCardAux 0 l = [0]


theorem isNoetherian_zero : IsNoetherian R₁ (0 : FractionalIdeal R₁⁰ K)

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]


@[simp]
theorem integralPowerBasis'_gen [hcycl : IsCyclotomicExtension {p} ℚ K] (hζ : IsPrimitiveRoot ζ p) :
    hζ.integralPowerBasis'.gen = hζ.toInteger

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


lemma map_inr :
    (H.mapHomologicalComplex (ComplexShape.up ℤ)).map (inr φ) ≫
      (mapHomologicalComplexIso φ H).hom =
    inr ((Functor.mapHomologicalComplex H (ComplexShape.up ℤ)).map φ)

[HomologicalComplex.HasHomotopyCofiber ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)]

(H.mapHomologicalComplex (ComplexShape.up ℤ)).map (CochainComplex.mappingCone.inr φ) ≫
    (CochainComplex.mappingCone.mapHomologicalComplexIso φ H).hom =
  CochainComplex.mappingCone.inr ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)


@[simp] theorem join_replicate_nil : (replicate n ([] : List α)).join = []


theorem all_node4R {P l x m y r} :
    @All α P (node4R l x m y r) ↔ All P l ∧ P x ∧ All P m ∧ P y ∧ All P r

{α : Type u_1}
{P : α → Prop}
{l : Ordnode α}
{x : α}
{m : Ordnode α}
{y : α}
{r : Ordnode α}

Ordnode.All P (l.node4R x m y r) ↔ Ordnode.All P l ∧ P x ∧ Ordnode.All P m ∧ P y ∧ Ordnode.All P r


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

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

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


theorem right [hf : FiniteDimensional F A] : FiniteDimensional K A

(F : Type u)
(K : Type v)
(A : Type w)
[DivisionRing F]
[DivisionRing K]
[AddCommGroup A]
[Module F K]
[Module K A]
[Module F A]
[IsScalarTower F K A]
[hf : FiniteDimensional F A]


/--
`LawfulRightIdentify op o` indicates `o` is a verified right identity of
`op`.
-/
class LawfulRightIdentity (op : α → β → α) (o : outParam β) extends RightIdentity op o : Prop where
  /-- Right identity `o` is an identity. -/
  right_id : ∀ a, op a o = a

{α : Sort u}
{β : Sort u_1}
{op : α → β → α}
{o : outParam β}
[self : Std.LawfulRightIdentity op o]
(a : α)


lemma isBoundedUnder_ge_sum {κ : Type*} [AddCommMonoid R]
    [CovariantClass R R (fun a b ↦ a + b) (· ≤ ·)] [CovariantClass R R (fun a b ↦ b + a) (· ≤ ·)]
    {u : κ → α → R} (s : Finset κ) :
    (∀ k ∈ s, f.IsBoundedUnder (· ≥ ·) (u k)) →
      f.IsBoundedUnder (· ≥ ·) (∑ k ∈ s, u k)

[CovariantClass R R (fun a b => a + b) fun x x_1 => x ≤ x_1]

[CovariantClass R R (fun a b => b + a) fun x x_1 => x ≤ x_1]

(∀ k ∈ s, Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f (u k)) →
  Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f (∑ k ∈ s, u k)


theorem FinMeasSupp.integrable {f : α →ₛ E} (h : f.FinMeasSupp μ) : Integrable f μ

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
{f : MeasureTheory.SimpleFunc α E}
(h : f.FinMeasSupp μ)


theorem cthickening_eq_iInter_thickening {δ : ℝ} (δ_nn : 0 ≤ δ) (E : Set α) :
    cthickening δ E = ⋂ (ε : ℝ) (_ : δ < ε), thickening ε E

{α : Type u}
[PseudoEMetricSpace α]
{δ : ℝ}
(δ_nn : 0 ≤ δ)
(E : Set α)

Metric.cthickening δ E = ⋂ ε, ⋂ (_ : δ < ε), Metric.thickening ε E


theorem usize_size_eq : Or (Eq USize.size 4294967296) (Eq USize.size 18446744073709551616)


@[simp]
lemma Quot.map_ι {j j' : J} {f : j ⟶ j'} (x : F.obj j) : Quot.ι F j' (F.map f x) = Quot.ι F j x

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

CategoryTheory.Limits.Types.Quot.ι F j' (F.map f x) = CategoryTheory.Limits.Types.Quot.ι F j x


theorem embedding_coeFn : Embedding (UniformFun.ofFun ∘ (⇑) : (α →ᵇ β) → α →ᵤ β)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]

Embedding (⇑UniformFun.ofFun ∘ DFunLike.coe)


@[simp]
theorem nullHomotopicMap_f {k₂ k₁ k₀ : ι} (r₂₁ : c.Rel k₂ k₁) (r₁₀ : c.Rel k₁ k₀)
    (hom : ∀ i j, C.X i ⟶ D.X j) :
    (nullHomotopicMap hom).f k₁ = C.d k₁ k₀ ≫ hom k₀ k₁ + hom k₁ k₂ ≫ D.d k₂ k₁

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
{k₂ k₁ k₀ : ι}
(r₂₁ : c.Rel k₂ k₁)
(r₁₀ : c.Rel k₁ k₀)
(hom : (i j : ι) → C.X i ⟶ D.X j)

(Homotopy.nullHomotopicMap hom).f k₁ = C.d k₁ k₀ ≫ hom k₀ k₁ + hom k₁ k₂ ≫ D.d k₂ k₁


theorem martingale_iff [PartialOrder E] :
    Martingale f ℱ μ ↔ Supermartingale f ℱ μ ∧ Submartingale f ℱ μ

{Ω : Type u_1}
{E : Type u_2}
{ι : Type u_3}
[Preorder ι]
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{f : ι → Ω → E}
{ℱ : MeasureTheory.Filtration ι m0}
[PartialOrder E]

MeasureTheory.Martingale f ℱ μ ↔ MeasureTheory.Supermartingale f ℱ μ ∧ MeasureTheory.Submartingale f ℱ μ


@[to_additive]
theorem Left.inv_lt_self (h : 1 < a) : a⁻¹ < a

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


/-- The morphism of short complexes `S.map F ⟶ S.map G` induced by
a natural transformation `F ⟶ G`. -/
@[simps]
def mapNatTrans {F G : C ⥤ D} [F.PreservesZeroMorphisms] [G.PreservesZeroMorphisms] (τ : F ⟶ G) :
    S.map F ⟶ S.map G


theorem X_dvd_iff {f : R[X]} : X ∣ f ↔ f.coeff 0 = 0


@[simp]
theorem toFun_eq_coe {α β} (f : α ↪ β) : toFun f = f

{α : Sort u_1}
{β : Sort u_2}
(f : α ↪ β)


theorem carrier.denom_not_mem : f ∉ carrier.asIdeal f_deg hm q

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

f ∉ AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.carrier.asIdeal f_deg hm q


protected theorem mul_left' (c : ℕ) (h : a ≡ b [MOD n]) : c * a ≡ c * b [MOD c * n]


@[simp]
theorem sort_sorted (s : Multiset α) : Sorted r (sort r s)

{α : Type u_1}
(r : α → α → Prop)
[DecidableRel r]
[IsTrans α r]
[IsAntisymm α r]
[IsTotal α r]
(s : Multiset α)


@[ext]
theorem ext (h : ∀ x, f x = g x) : f = g

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{H' : Type u_5}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
{f g : C^n⟮I, M; I', M'⟯}
(h : ∀ (x : M), f x = g x)


/-- A variant of `of_is_coproduct` that is more useful with `apply`. -/
theorem of_is_coproduct' (h : Limits.IsColimit (BinaryCofan.mk inl inr)) (t : IsInitial Z) :
    IsPushout (t.to _) (t.to _) inl inr

(h : CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.BinaryCofan.mk inl inr))

CategoryTheory.IsPushout (t.to X) (t.to Y) inl inr


@[to_additive]
theorem lift_apply (f : α → M) (l : FreeMonoid α) : lift f l = ((toList l).map f).prod

{α : Type u_1}
{M : Type u_4}
[Monoid M]
(f : α → M)
(l : FreeMonoid α)

(FreeMonoid.lift f) l = (List.map f (FreeMonoid.toList l)).prod


theorem eq_zero_of_measure_zero {β : Type*} [NormedAddCommGroup β] {T : Set α → β} {C : ℝ}
    (hT : DominatedFinMeasAdditive μ T C) {s : Set α} (hs : MeasurableSet s) (hs_zero : μ s = 0) :
    T s = 0

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)


theorem SSameSide.not_wOppSide {s : AffineSubspace R P} {x y : P} (h : s.SSameSide x y) :
    ¬s.WOppSide x y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y : P}
(h : s.SSameSide x y)


private theorem one_def : 1 = mk (abv := abv) 1

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]


@[ext] lemma Hom.ext' (X Y : LocallyRingedSpace.{u}) {f g : X ⟶ Y} (h : f.val = g.val) : f = g

(X Y : AlgebraicGeometry.LocallyRingedSpace)


/-- In an s-finite space, among disjoint null-measurable sets, only countably many can have positive
measure. -/
theorem countable_meas_pos_of_disjoint_iUnion₀ {ι : Type*} {_ : MeasurableSpace α} {μ : Measure α}
    [SFinite μ] {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) :
    Set.Countable { i : ι | 0 < μ (As i) }

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : MeasureTheory.SFinite μ] {As : ι → Set α},
  (∀ (i : ι), MeasureTheory.NullMeasurableSet (As i) μ) →
    Pairwise (MeasureTheory.AEDisjoint μ on As) → {i | 0 < μ (As i)}.Countable


theorem Prefunctor.IsCovering.comp (hφ : φ.IsCovering) (hψ : ψ.IsCovering) : (φ ⋙q ψ).IsCovering

{U : Type u_1}
[Quiver U]
{V : Type u_2}
[Quiver V]
(φ : U ⥤q V)
{W : Type u_3}
[Quiver W]
(ψ : V ⥤q W)
(hφ : φ.IsCovering)
(hψ : ψ.IsCovering)


@[simp] lemma val_sub : (x - y).val = x.val - y.val

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
(x y : P.Cotangent)


theorem csInf_of_not_bdd_below {s : Set ℤ} (h : ¬BddBelow s) : sInf s = 0


theorem mem_implicitToPartialHomeomorph_target (hf : HasStrictFDerivAt f f' a)
    (hf' : range f' = ⊤) : (f a, (0 : ker f')) ∈ (hf.implicitToPartialHomeomorph f f' hf').target

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[FiniteDimensional 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{a : E}
(hf : HasStrictFDerivAt f f' a)
(hf' : LinearMap.range f' = ⊤)

(f a, 0) ∈ (HasStrictFDerivAt.implicitToPartialHomeomorph f f' hf hf').target


@[simp]
theorem leftOp_comp (α : F ⟶ G) (β : G ⟶ H) : NatTrans.leftOp (α ≫ β) =
    NatTrans.leftOp β ≫ NatTrans.leftOp α

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G H : CategoryTheory.Functor C Dᵒᵖ}
(α : F ⟶ G)
(β : G ⟶ H)

CategoryTheory.NatTrans.leftOp (CategoryTheory.CategoryStruct.comp α β) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.NatTrans.leftOp β) (CategoryTheory.NatTrans.leftOp α)


theorem mul_dvd_mul_left (a : α) (h : b ∣ c) : a * b ∣ a * c

{α : Type u_1}
[Monoid α]
{b c : α}
(a : α)
(h : b ∣ c)


theorem diff_eq (s t : Set α) : s \ t = s ∩ tᶜ


@[to_additive]
theorem exponent_dvd {n : ℕ} : exponent G ∣ n ↔ ∀ g : G, orderOf g ∣ n

AddMonoid.exponent G ∣ n ↔ ∀ (g : G), addOrderOf g ∣ n


@[simp]
theorem toHomeomorph_refl : (refl 𝕜 P).toHomeomorph = Homeomorph.refl P

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_10}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]

(AffineIsometryEquiv.refl 𝕜 P).toHomeomorph = Homeomorph.refl P


lemma ext_succ {F G : ComposableArrows C (n + 1)} (h₀ : F.obj' 0 = G.obj' 0)
    (h : F.δ₀ = G.δ₀) (w : F.map' 0 1 = eqToHom h₀ ≫ G.map' 0 1 ≫
      eqToHom (Functor.congr_obj h.symm 0)) : F = G

{F G : CategoryTheory.ComposableArrows C (n + 1)}

(w :
  F.map' 0 1 ⋯ ⋯ =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom h₀)
      (CategoryTheory.CategoryStruct.comp (G.map' 0 1 ⋯ ⋯) (CategoryTheory.eqToHom ⋯)))


theorem toFun_eq_coe {f : HeytingHom α β} : f.toFun = ⇑f

{α : Type u_2}
{β : Type u_3}
[HeytingAlgebra α]
[HeytingAlgebra β]
{f : HeytingHom α β}


theorem is_transcendental_of_subsingleton [Subsingleton R] (x : A) : Transcendental R x

(R : Type u)
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
[Subsingleton R]
(x : A)


@[simp]
theorem PartialHomeomorph.univUnitBall_apply_zero : univUnitBall (0 : E) = 0

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]


@[simp]
theorem coeff_zero (n : ℕ) : coeff (0 : R[X]) n = 0


/-- A continuous function whose support is contained in a compact set is strongly measurable. -/
@[to_additive]
theorem _root_.Continuous.stronglyMeasurable_of_mulSupport_subset_isCompact
    [MeasurableSpace α] [TopologicalSpace α] [OpensMeasurableSpace α] [MeasurableSpace β]
    [TopologicalSpace β] [PseudoMetrizableSpace β] [BorelSpace β] [One β] {f : α → β}
    (hf : Continuous f) {k : Set α} (hk : IsCompact k)
    (h'f : mulSupport f ⊆ k) : StronglyMeasurable f


lemma zpow_zpow₀ (h : Commute a b) (m n : ℤ) : Commute (a ^ m) (b ^ n)

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b : G₀}
(h : Commute a b)
(m n : ℤ)


theorem succ_sub {m n : Nat} (h : n ≤ m) : succ m - n = succ (m - n)


@[norm_cast]
theorem ofReal_tsum (f : α → ℝ) : (↑(∑' a, f a) : ℂ) = ∑' a, ↑(f a)


theorem EventuallyLE.le_sup_of_le_right [SemilatticeSup β] {l : Filter α} {f g h : α → β}
    (hg : h ≤ᶠ[l] g) : h ≤ᶠ[l] f ⊔ g

{α : Type u}
{β : Type v}
[SemilatticeSup β]
{l : Filter α}
{f g h : α → β}
(hg : h ≤ᶠ[l] g)


private theorem rexp_neg_deriv_aux :
    ∀ x ∈ univ, HasDerivWithinAt (rexp ∘ Neg.neg) (-rexp (-x)) univ x

x ∈ Set.univ → HasDerivWithinAt (rexp ∘ Neg.neg) (-rexp (-x)) Set.univ x


theorem HasLeftInverse.injective {f : α → β} : HasLeftInverse f → Injective f

Function.HasLeftInverse f → Function.Injective f


@[simp]
theorem isOrtho_bot_right {U : Submodule 𝕜 E} : U ⟂ ⊥

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


@[simp]
theorem quotientQuotientEquivQuotientAux_mk (x : M ⧸ S) :
    quotientQuotientEquivQuotientAux S T h (Quotient.mk x) = mapQ S T LinearMap.id h x

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(S T : Submodule R M)
(h : S ≤ T)
(x : M ⧸ S)

(S.quotientQuotientEquivQuotientAux T h) (Submodule.Quotient.mk x) = (S.mapQ T LinearMap.id h) x


theorem rightDistributor_assoc {J : Type} [Fintype J] (f : J → C) (X Y : C) :
    (rightDistributor f X ⊗ asIso (𝟙 Y)) ≪≫ rightDistributor _ Y =
      α_ (⨁ f) X Y ≪≫ rightDistributor f (X ⊗ Y) ≪≫ biproduct.mapIso fun j => (α_ _ X Y).symm

(CategoryTheory.rightDistributor f X ⊗ CategoryTheory.asIso (CategoryTheory.CategoryStruct.id Y)) ≪≫
    CategoryTheory.rightDistributor (fun j => CategoryTheory.MonoidalCategory.tensorObj (f j) X) Y =
  CategoryTheory.MonoidalCategory.associator (⨁ f) X Y ≪≫
    CategoryTheory.rightDistributor f (CategoryTheory.MonoidalCategory.tensorObj X Y) ≪≫
      CategoryTheory.Limits.biproduct.mapIso fun j => (CategoryTheory.MonoidalCategory.associator (f j) X Y).symm


theorem log_le_clog (b n : ℕ) : log b n ≤ clog b n


lemma withDensity_inv_same {μ : Measure α} {f : α → ℝ≥0∞}
    (hf : Measurable f) (hf_ne_zero : ∀ᵐ x ∂μ, f x ≠ 0) (hf_ne_top : ∀ᵐ x ∂μ, f x ≠ ∞) :
    (μ.withDensity f).withDensity (fun x ↦ (f x)⁻¹) = μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : Measurable f)
(hf_ne_zero : ∀ᵐ (x : α) ∂μ, f x ≠ 0)
(hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤)

((μ.withDensity f).withDensity fun x => (f x)⁻¹) = μ


/-- `Multiplicative (Additive H)` is just `H`. -/
@[simps!]
def MulEquiv.multiplicativeAdditive [MulOneClass H] : Multiplicative (Additive H) ≃* H

(H : Type u_2)
[MulOneClass H]
(a : Multiplicative (Additive H))

(MulEquiv.multiplicativeAdditive H) a = Additive.toMul (Multiplicative.toAdd a)


theorem normalize_monic [DecidableEq R] (h : Monic p) : normalize p = p

{R : Type u}
[Field R]
{p : R[X]}
[DecidableEq R]
(h : p.Monic)


@[simp, deprecated (since := "2023-02-11")]
theorem nthLe_mapIdx (l : List α) (f : ℕ → α → β) (i : ℕ) (h : i < l.length)
    (h' : i < (l.mapIdx f).length := h.trans_le (l.length_mapIdx f).ge) :
    (l.mapIdx f).nthLe i h' = f i (l.nthLe i h)

(f : ℕ → α → β)

(h' : i < (List.mapIdx f l).length := ⋯)

(List.mapIdx f l).nthLe i h' = f i (l.nthLe i h)


lemma uIcc_of_gt (h : b < a) : [[a, b]] = Icc b a

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


@[to_additive]
theorem prod_Ico_eq_mul_inv {δ : Type*} [CommGroup δ] (f : ℕ → δ) {m n : ℕ} (h : m ≤ n) :
    ∏ k ∈ Ico m n, f k = (∏ k ∈ range n, f k) * (∏ k ∈ range m, f k)⁻¹

{δ : Type u_3}
[CommGroup δ]
(f : ℕ → δ)
{m n : ℕ}
(h : m ≤ n)

∏ k ∈ Finset.Ico m n, f k = (∏ k ∈ Finset.range n, f k) * (∏ k ∈ Finset.range m, f k)⁻¹


/-- The symmetric definition of convolution where the bilinear operator is scalar multiplication. -/
theorem convolution_lsmul_swap {f : G → 𝕜} {g : G → F} :
    (f ⋆[lsmul 𝕜 𝕜, μ] g : G → F) x = ∫ t, f (x - t) • g t ∂μ

{𝕜 : Type u𝕜}
{G : Type uG}
{F : Type uF}
[NormedAddCommGroup F]
{x : G}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 F]
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[NormedSpace ℝ F]
[AddCommGroup G]
[μ.IsAddLeftInvariant]
[μ.IsNegInvariant]
[MeasurableNeg G]
[MeasurableAdd G]
{f : G → 𝕜}
{g : G → F}

MeasureTheory.convolution f g (ContinuousLinearMap.lsmul 𝕜 𝕜) μ x = ∫ (t : G), f (x - t) • g t ∂μ


@[simp]
theorem toMeasure_apply_fintype [Fintype α] : p.toMeasure s = ∑ x, s.indicator p x

{α : Type u_1}
[MeasurableSpace α]
(p : PMF α)
(s : Set α)
[MeasurableSingletonClass α]
[Fintype α]

p.toMeasure s = ∑ x : α, s.indicator (⇑p) x


@[simp]
theorem powersetCard_zero (s : Finset α) : s.powersetCard 0 = {∅}


@[to_additive]
theorem isPWO_support_smulAntidiagonal {hs : s.IsPWO} {ht : t.IsPWO} :
    { a | (SMulAntidiagonal hs ht a).Nonempty }.IsPWO

{G : Type u_1}
{P : Type u_2}
[PartialOrder G]
[PartialOrder P]
[VAdd G P]
[IsOrderedCancelVAdd G P]
{s : Set G}
{t : Set P}
{hs : s.IsPWO}
{ht : t.IsPWO}

{a | (Finset.VAddAntidiagonal hs ht a).Nonempty}.IsPWO


theorem snd_eq_coprod : snd R M M₂ = coprod 0 LinearMap.id

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

LinearMap.snd R M M₂ = LinearMap.coprod 0 LinearMap.id


@[simp]
theorem map_zero (f : α → β) : map f 0 = 0


/-- **Minkowski inequality**: the `L_p` seminorm of the sum of two vectors is less than or equal
to the sum of the `L_p`-seminorms of the summands. A version for `Real`-valued functions. -/
theorem Lp_add_le (hp : 1 ≤ p) :
    (∑ i ∈ s, |f i + g i| ^ p) ^ (1 / p) ≤
      (∑ i ∈ s, |f i| ^ p) ^ (1 / p) + (∑ i ∈ s, |g i| ^ p) ^ (1 / p)

{ι : Type u}
(s : Finset ι)
(f g : ι → ℝ)
{p : ℝ}
(hp : 1 ≤ p)


/-- This structure contains the information left for a local trivialization (which is implemented
below as `Trivialization F proj`) if the total space has not been given a topology, but we
have a topology on both the fiber and the base space. Through the construction
`topological_fiber_prebundle F proj` it will be possible to promote a
`Pretrivialization F proj` to a `Trivialization F proj`. -/
structure Pretrivialization (proj : Z → B) extends PartialEquiv Z (B × F) where
  open_target : IsOpen target
  baseSet : Set B
  open_baseSet : IsOpen baseSet
  source_eq : source = proj ⁻¹' baseSet
  target_eq : target = baseSet ×ˢ univ
  proj_toFun : ∀ p ∈ source, (toFun p).1 = proj p

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
(self : Pretrivialization F proj)


@[simp]
theorem count_bagInter {a : α} :
    ∀ {l₁ l₂ : List α}, count a (l₁.bagInter l₂) = min (count a l₁) (count a l₂)

{α : Type u_1}
[DecidableEq α]
{a : α}
{l₁ l₂ : List α}

List.count a (l₁.bagInter l₂) = min (List.count a l₁) (List.count a l₂)


@[simp]
theorem iUnion_ofWithBot (boxes : Finset (WithBot (Box ι)))
    (le_of_mem : ∀ J ∈ boxes, (J : WithBot (Box ι)) ≤ I)
    (pairwise_disjoint : Set.Pairwise (boxes : Set (WithBot (Box ι))) Disjoint) :
    (ofWithBot boxes le_of_mem pairwise_disjoint).iUnion = ⋃ J ∈ boxes, ↑J

(boxes : Finset (WithBot (BoxIntegral.Box ι)))

(pairwise_disjoint : (↑boxes).Pairwise Disjoint)

(BoxIntegral.Prepartition.ofWithBot boxes le_of_mem pairwise_disjoint).iUnion = ⋃ J ∈ boxes, ↑J


lemma commProb_nil : commProb (Product []) = 1


theorem IsCycle.existsUnique_cycle {f : Perm α} (hf : IsCycle f) :
    ∃! s : Cycle α, ∃ h : s.Nodup, s.formPerm h = f

{α : Type u_1}
[Finite α]
[DecidableEq α]
{f : Equiv.Perm α}
(hf : f.IsCycle)


@[to_additive Icc_add_Ico_subset]
theorem Icc_mul_Ico_subset' [LocallyFiniteOrder α] (a b c d : α) :
    Icc a b * Ico c d ⊆ Ico (a * c) (b * d)

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

[CovariantClass α α (Function.swap HAdd.hAdd) LT.lt]

Finset.Icc a b + Finset.Ico c d ⊆ Finset.Ico (a + c) (b + d)


/-- A.e. stabilizer of a set under a group action. -/
@[to_additive (attr := simps) "A.e. stabilizer of a set under an additive group action."]
def aestabilizer (s : Set α) : Subgroup G

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

∀ {x : MeasurableSpace α} (μ : MeasureTheory.Measure α) [inst : MeasureTheory.SMulInvariantMeasure G α μ] (s : Set α),
  ↑(MulAction.aestabilizer G μ s) = {g | g • s =ᵐ[μ] s}


@[simp]
theorem mem_skewAdjointMatricesLieSubalgebra (A : Matrix n n R) :
    A ∈ skewAdjointMatricesLieSubalgebra J ↔ A ∈ skewAdjointMatricesSubmodule J

{R : Type u}
{n : Type w}
[CommRing R]
[DecidableEq n]
[Fintype n]
(J A : Matrix n n R)


@[to_additive]
theorem finprod_inv_distrib [DivisionCommMonoid G] (f : α → G) : (∏ᶠ x, (f x)⁻¹) = (∏ᶠ x, f x)⁻¹

{G : Type u_1}
{α : Sort u_4}
[DivisionCommMonoid G]
(f : α → G)

∏ᶠ (x : α), (f x)⁻¹ = (∏ᶠ (x : α), f x)⁻¹


/-- A Galois insertion is a Galois connection where `l ∘ u = id`. It also contains a constructive
choice function, to give better definitional equalities when lifting order structures. Dual
to `GaloisCoinsertion` -/
structure GaloisInsertion {α β : Type*} [Preorder α] [Preorder β] (l : α → β) (u : β → α) where
  /-- A contructive choice function for images of `l`. -/
  choice : ∀ x : α, u (l x) ≤ x → β
  /-- The Galois connection associated to a Galois insertion. -/
  gc : GaloisConnection l u
  /-- Main property of a Galois insertion. -/
  le_l_u : ∀ x, x ≤ l (u x)
  /-- Property of the choice function. -/
  choice_eq : ∀ a h, choice a h = l a

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(self : GaloisInsertion l u)
(a : α)
(h : u (l a) ≤ a)


/-- `exists_finset_rename` for two polynomials at once: for any two polynomials `p₁`, `p₂` in a
  polynomial semiring `R[σ]` of possibly infinitely many variables, `exists_finset_rename₂` yields
  a finite subset `s` of `σ` such that both `p₁` and `p₂` are contained in the polynomial semiring
  `R[s]` of finitely many variables. -/
theorem exists_finset_rename₂ (p₁ p₂ : MvPolynomial σ R) :
    ∃ (s : Finset σ) (q₁ q₂ : MvPolynomial s R), p₁ = rename (↑) q₁ ∧ p₂ = rename (↑) q₂

{σ : Type u_1}
{R : Type u_4}
[CommSemiring R]
(p₁ p₂ : MvPolynomial σ R)

∃ s q₁ q₂, p₁ = (MvPolynomial.rename Subtype.val) q₁ ∧ p₂ = (MvPolynomial.rename Subtype.val) q₂


/-- The map sending a congruence relation to its underlying equivalence relation is injective. -/
@[to_additive "The map sending an additive congruence relation to its underlying equivalence
relation is injective."]
theorem toSetoid_inj {c d : Con M} (H : c.toSetoid = d.toSetoid) : c = d

{M : Type u_1}
[Add M]
{c d : AddCon M}
(H : c.toSetoid = d.toSetoid)


@[simp] lemma uniformConcaveOn_zero : UniformConcaveOn s 0 f ↔ ConcaveOn ℝ s f

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{s : Set E}
{f : E → ℝ}


@[reassoc (attr := simp)]
theorem pullbackIsoUnopPushout_hom_inl {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) [HasPullback f g]
    [HasPushout f.op g.op] :
    pushout.inl _ _ ≫ (pullbackIsoUnopPushout f g).hom.op = (pullback.fst f g).op

CategoryTheory.Limits.pushout.inl f.op g.op ≫ (CategoryTheory.Limits.pullbackIsoUnopPushout f g).hom.op =
  (CategoryTheory.Limits.pullback.fst f g).op


theorem coe_ne_zero (z : ℤ_[p]) : (z : ℚ_[p]) ≠ 0 ↔ z ≠ 0

{p : ℕ}
[Fact (Nat.Prime p)]
(z : ℤ_[p])

↑z ≠ 0 ↔ z ≠ 0


@[simp]
theorem coe_one : ⇑(1 : P →ᵃⁱ[𝕜] P) = _root_.id

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_10}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]


lemma mem_of_isIso [ClosedUnderIsomorphisms P] {X Y : C} (f : X ⟶ Y) [IsIso f] (hX : P X) : P Y


@[to_additive]
theorem norm_le_mul_norm_add (u v : E) : ‖u‖ ≤ ‖u * v‖ + ‖v‖

{E : Type u_6}
[SeminormedAddGroup E]
(u v : E)

‖u‖ ≤ ‖u + v‖ + ‖v‖


/-- Comparison test of convergence of `ℝ≥0`-valued series. -/
theorem summable_of_le {f g : β → ℝ≥0} (hgf : ∀ b, g b ≤ f b) : Summable f → Summable g

{β : Type u_2}
{f g : β → ℝ≥0}
(hgf : ∀ (b : β), g b ≤ f b)


@[to_additive (attr := ext)]
theorem MulHom.ext [Mul M] [Mul N] ⦃f g : M →ₙ* N⦄ (h : ∀ x, f x = g x) : f = g

{M : Type u_4}
{N : Type u_5}
[Mul M]
[Mul N]
⦃f g : M →ₙ* N⦄
(h : ∀ (x : M), f x = g x)


@[simp]
theorem curryFinFinset_apply_const_aux {k l n : ℕ} {s : Finset (Fin n)} (hk : s.card = k)
    (hl : sᶜ.card = l) (f : MultilinearMap R (fun _ : Fin n => M') M₂) (x y : M') :
    (f fun i => Sum.elim (fun _ => x) (fun _ => y) ((⇑ (Equiv.symm (finSumEquivOfFinset hk hl))) i))
      = f (s.piecewise (fun _ => x) fun _ => y)

{R : Type uR}
{M₂ : Type v₂}
{M' : Type v'}
[CommSemiring R]
[AddCommMonoid M']
[AddCommMonoid M₂]
[Module R M']
[Module R M₂]
{k l n : ℕ}
{s : Finset (Fin n)}
(hk : s.card = k)
(hl : sᶜ.card = l)
(f : MultilinearMap R (fun x => M') M₂)
(x y : M')

(f fun i => Sum.elim (fun x_1 => x) (fun x => y) ((finSumEquivOfFinset hk hl).symm i)) =
  f (s.piecewise (fun x_1 => x) fun x => y)


@[to_additive]
lemma _root_.Function.Bijective.prod_comp {e : ι → κ} (he : e.Bijective) (g : κ → α) :
    ∏ i, g (e i) = ∏ i, g i

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[Fintype ι]
[Fintype κ]
[AddCommMonoid α]
{e : ι → κ}
(he : Function.Bijective e)
(g : κ → α)


theorem encard_add_encard_compl (s : Set α) : s.encard + sᶜ.encard = (univ : Set α).encard


@[to_additive (attr := simp)]
theorem div_eq_empty : s / t = ∅ ↔ s = ∅ ∨ t = ∅

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


theorem eq_thinkN' (s : Computation α) [_h : Terminates s] :
    s = thinkN (pure (get s)) (length s)

{α : Type u}
(s : Computation α)
[_h : s.Terminates]

s = (Computation.pure s.get).thinkN s.length


@[simp]
theorem minFac_to_nat : ∀ n : Num, (minFac n : ℕ) = Nat.minFac n


@[to_additive]
theorem comp_mul (g : β →*o γ) (f₁ f₂ : α →*o β) : g.comp (f₁ * f₂) = g.comp f₁ * g.comp f₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[OrderedCommMonoid α]
[OrderedCommMonoid β]
[OrderedCommMonoid γ]
(g : β →*o γ)
(f₁ f₂ : α →*o β)


@[simp]
theorem preimage_coe_Iio : (some : α → WithBot α) ⁻¹' Iio a = Iio a


theorem ContDiffOn.contDiffWithinAt (h : ContDiffOn 𝕜 n f s) (hx : x ∈ s) :
    ContDiffWithinAt 𝕜 n f s x

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


theorem coeLinearMap_eq_dfinsupp_sum [DecidableEq M] (x : DirectSum ι fun i => A i) :
    coeLinearMap A x = DFinsupp.sum x fun i => (fun x : A i => ↑x)

{R : Type u}
[Semiring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : Type u_1}
[AddCommMonoid M]
[Module R M]
(A : ι → Submodule R M)
[DecidableEq M]
(x : DirectSum ι fun i => ↥(A i))

(DirectSum.coeLinearMap A) x = DFinsupp.sum x fun i x => ↑x


@[simp]
theorem zero_le_neg_iff {x : PGame} : 0 ≤ -x ↔ x ≤ 0


/-- Auxiliary definition for `bifunctorComp₁₂`. -/
@[simps]
def bifunctorComp₁₂Obj (X₁ : C₁) : C₂ ⥤ C₃ ⥤ C₄

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

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

((CategoryTheory.bifunctorComp₁₂Obj F₁₂ G X₁).obj X₂).map φ = (G.obj ((F₁₂.obj X₁).obj X₂)).map φ


/-- When a group acts, we can lift the action to the group of automorphisms. -/
@[simps]
def ρAut {G : Grp.{u}} (A : Action V (MonCat.of G)) : G ⟶ Grp.of (Aut A.V)

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : Grp}
(A : Action V (MonCat.of ↑G))
(g : ↑G)


@[simp, norm_cast]
theorem coe_singleton (a : α) : ([a] : Multiset α) = {a}


theorem exists_measurable_subset_ae_eq (h : NullMeasurableSet s μ) :
    ∃ t ⊆ s, MeasurableSet t ∧ t =ᵐ[μ] s

(h : MeasureTheory.NullMeasurableSet s μ)


@[to_additive UniformContinuous.const_nsmul]
theorem UniformContinuous.pow_const [UniformSpace β] {f : β → α} (hf : UniformContinuous f) :
    ∀ n : ℕ, UniformContinuous fun x => f x ^ n

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
[UniformSpace β]
{f : β → α}
(hf : UniformContinuous f)
(n : ℕ)


@[simp]
theorem neg_bot : -(⊥ : Submodule R M) = ⊥

{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommGroup M]
[Module R M]


theorem extract_zero_endPos : ∀ (s : String), s.extract 0 (endPos s) = s


@[to_additive]
protected theorem inv [Group β] [TopologicalGroup β] (hu : ProgMeasurable f u) :
    ProgMeasurable f fun i ω => (u i ω)⁻¹

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[Preorder ι]
{u : ι → Ω → β}
{f : MeasureTheory.Filtration ι m}
[MeasurableSpace ι]
[Group β]
[TopologicalGroup β]
(hu : MeasureTheory.ProgMeasurable f u)

MeasureTheory.ProgMeasurable f fun i ω => (u i ω)⁻¹


theorem naturality_1 (α : F ≅ G) (f : X ⟶ Y) : α.inv.app X ≫ F.map f ≫ α.hom.app Y = G.map f

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


/-- Let `u : Fin (rank K) → (𝓞 K)ˣ` be a family of units and let `w₁` and `w₂` be two infinite
places. Then, the two square matrices with entries `(mult w * log w (u i))_i, {w ≠ w_i}`, `i = 1,2`,
have the same determinant in absolute value. -/
theorem abs_det_eq_abs_det (u : Fin (rank K) → (𝓞 K)ˣ)
    {w₁ w₂ : InfinitePlace K} (e₁ : {w // w ≠ w₁} ≃ Fin (rank K))
    (e₂ : {w // w ≠ w₂} ≃ Fin (rank K)) :
    |(Matrix.of fun i w : {w // w ≠ w₁} ↦ (mult w.val : ℝ) * (w.val (u (e₁ i) : K)).log).det| =
    |(Matrix.of fun i w : {w // w ≠ w₂} ↦ (mult w.val : ℝ) * (w.val (u (e₂ i) : K)).log).det|

(u : Fin (NumberField.Units.rank K) → (𝓞 K)ˣ)

(e₁ : { w // w ≠ w₁ } ≃ Fin (NumberField.Units.rank K))

(e₂ : { w // w ≠ w₂ } ≃ Fin (NumberField.Units.rank K))

|(Matrix.of fun i w => ↑(↑w).mult * Real.log (↑w ((algebraMap (𝓞 K) K) ↑(u (e₁ i))))).det| =
  |(Matrix.of fun i w => ↑(↑w).mult * Real.log (↑w ((algebraMap (𝓞 K) K) ↑(u (e₂ i))))).det|


@[simp, nolint simpNF]
theorem equiv_mul_left (h : H) (g : G) :
    hHT.equiv (h * g) = (h * (hHT.equiv g).fst, (hHT.equiv g).snd)

{G : Type u_1}
[Group G]
{H : Subgroup G}
{T : Set G}
(hHT : Subgroup.IsComplement (↑H) T)
(h : ↥H)
(g : G)

hHT.equiv (↑h * g) = (h * (hHT.equiv g).1, (hHT.equiv g).2)


/-- A single point is concyclic. -/
theorem concyclic_singleton (p : P) : Concyclic ({p} : Set P)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(p : P)


@[simp]
theorem zeroLocus_span (s : Set R) : zeroLocus (Ideal.span s : Set R) = zeroLocus s

{R : Type u}
[CommSemiring R]
(s : Set R)

PrimeSpectrum.zeroLocus ↑(Ideal.span s) = PrimeSpectrum.zeroLocus s


@[simp] theorem coe_comp_of {X Y Z : Type u} [CommSemiring X] [CommSemiring Y] [CommSemiring Z]
    (f : X →+* Y) (g : Y →+* Z) :
    @DFunLike.coe no_index (CommSemiRingCat.of X ⟶ CommSemiRingCat.of Z) X
      (fun _ ↦ Z) _
      (CategoryStruct.comp (X := CommSemiRingCat.of X) (Y := CommSemiRingCat.of Y)
        (Z := CommSemiRingCat.of Z) f g) =
    @DFunLike.coe (X →+* Z) X (fun _ ↦ Z) _ (RingHom.comp g f)


@[simp]
theorem toReal_prod {ι : Type*} {s : Finset ι} {f : ι → ℝ≥0∞} :
    (∏ i ∈ s, f i).toReal = ∏ i ∈ s, (f i).toReal

{ι : Type u_1}
{s : Finset ι}
{f : ι → ℝ≥0∞}


theorem _root_.Antitone.set_prod (hf : Antitone f) (hg : Antitone g) :
    Antitone fun x => f x ×ˢ g x

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


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

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


@[simp]
theorem realize_iInf (s : Finset β) (f : β → L.BoundedFormula α n)
    (v : α → M) (v' : Fin n → M) :
    (iInf s f).Realize v v' ↔ ∀ b ∈ s, (f b).Realize v v'

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{β : Type v'}
{n : ℕ}
(s : Finset β)
(f : β → L.BoundedFormula α n)
(v : α → M)
(v' : Fin n → M)

(FirstOrder.Language.BoundedFormula.iInf s f).Realize v v' ↔ ∀ b ∈ s, (f b).Realize v v'


theorem card_sigmaLift :
    (sigmaLift f a b).card = dite (a.1 = b.1) (fun h => (f (h ▸ a.2) b.2).card) fun _ => 0

(f : ⦃i : ι⦄ → α i → β i → Finset (γ i))

(Finset.sigmaLift f a b).card = if h : a.fst = b.fst then (f (h ▸ a.snd) b.snd).card else 0


@[to_additive]
theorem centralizer_le {s t : Set G} (h : s ⊆ t) : centralizer t ≤ centralizer s

{G : Type u_1}
[Group G]
{s t : Set G}
(h : s ⊆ t)

Subgroup.centralizer t ≤ Subgroup.centralizer s


theorem lfp_induction {p : α → Prop} (step : ∀ a, p a → a ≤ lfp f → p (f a))
    (hSup : ∀ s, (∀ a ∈ s, p a) → p (sSup s)) : p (lfp f)

(step : ∀ (a : α), p a → a ≤ OrderHom.lfp f → p (f a))

(hSup : ∀ (s : Set α), (∀ a ∈ s, p a) → p (sSup s))


theorem mem_map {x : L} (hx : x ∈ I) : f x ∈ map f I

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L →ₗ⁅R⁆ L'}
{I : LieIdeal R L}
{x : L}
(hx : x ∈ I)


lemma continuous_mul_log : Continuous fun x ↦ x * log x


theorem toPGame_injective : Function.Injective Ordinal.toPGame


/-- Suppose `f : [a, b] → δ` is continuous and injective. Then `f` is strictly monotone
or antitone (increasing or decreasing). -/
theorem ContinuousOn.strictMonoOn_of_injOn_Icc' {a b : α} {f : α → δ} (hab : a ≤ b)
    (hf_c : ContinuousOn f (Icc a b)) (hf_i : InjOn f (Icc a b)) :
    StrictMonoOn f (Icc a b) ∨ StrictAntiOn f (Icc a b)

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{δ : Type u_1}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderClosedTopology δ]
{a b : α}
{f : α → δ}
(hab : a ≤ b)
(hf_c : ContinuousOn f (Set.Icc a b))
(hf_i : Set.InjOn f (Set.Icc a b))

StrictMonoOn f (Set.Icc a b) ∨ StrictAntiOn f (Set.Icc a b)


@[to_additive]
theorem coe_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty)
    (hS : DirectedOn (· ≤ ·) S) : (↑(sSup S) : Set M) = ⋃ s ∈ S, ↑s

(hS : DirectedOn (fun x x_1 => x ≤ x_1) S)


protected theorem min_eq_min (a : Nat) : Nat.min a b = min a b


@[simp]
theorem zero_shiftRight (n : Nat) : (0 : Int) >>> n = 0


/-- The identity isometry between equal quadratic forms. -/
@[simps!]
def ofEq {Q₁ Q₂ : QuadraticMap R M₁ N} (h : Q₁ = Q₂) : Q₁ →qᵢ Q₂

{R : Type u_2}
{M₁ : Type u_4}
{N : Type u_8}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid N]
[Module R M₁]
[Module R N]
{Q₁ Q₂ : QuadraticMap R M₁ N}
(h : Q₁ = Q₂)
(a : M₁)


/-- If `a` is even, then `n` is even iff `n % a` is even. -/
lemma Even.mod_even_iff (ha : Even a) : Even (n % a) ↔ Even n


theorem gcd_eq_gcd_filter_ne_zero [DecidablePred fun x : β ↦ f x = 0] :
    s.gcd f = (s.filter fun x ↦ f x ≠ 0).gcd f

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f : β → α}
[DecidablePred fun x => f x = 0]

s.gcd f = (Finset.filter (fun x => f x ≠ 0) s).gcd f


@[simp]
theorem ACounit_X (b : B) : ACounit A B (X b) = b

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

(MvPolynomial.ACounit A B) (MvPolynomial.X b) = b


theorem auxEquiv_tmul (a : A) (b : B) :
    auxEquiv R 𝒜 ℬ (a ᵍ⊗ₜ b) = decompose 𝒜 a ⊗ₜ decompose ℬ b

{R : Type u_1}
{ι : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring ι]
[DecidableEq ι]
[CommRing R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
(𝒜 : ι → Submodule R A)
(ℬ : ι → Submodule R B)
[GradedAlgebra 𝒜]
[GradedAlgebra ℬ]
(a : A)
(b : B)

(GradedTensorProduct.auxEquiv R 𝒜 ℬ) (a ᵍ⊗ₜ[R] b) = (DirectSum.decompose 𝒜) a ⊗ₜ[R] (DirectSum.decompose ℬ) b


/-- Given congruence relations `c, d` on a monoid such that `d` contains `c`, the definition of
    the homomorphism from the quotient by `c` to the quotient by `d` induced by `d`'s quotient
    map. -/
@[to_additive "Given additive congruence relations `c, d` on an `AddMonoid` such that `d`
contains `c`, the definition of the homomorphism from the quotient by `c` to the quotient by `d`
induced by `d`'s quotient map."]
theorem map_apply {c d : Con M} (h : c ≤ d) (x) :
    c.map d h x = c.lift d.mk' (fun _ _ hc => d.eq.2 <| h hc) x

{M : Type u_1}
[MulOneClass M]
{c d : Con M}
(h : c ≤ d)
(x : c.Quotient)


/-- `snd` is analytic -/
theorem analyticAt_snd {p : E × F} : AnalyticAt 𝕜 (fun p : E × F ↦ p.snd) p

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : E × F}


theorem isometry_toBCF : Isometry (toBCF : C₀(α, β) → α →ᵇ β)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[Zero β]


theorem union_diff_cancel_left {s t : Set α} (h : s ∩ t ⊆ ∅) : (s ∪ t) \ s = t

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


protected theorem orderDual : RightOrdContinuous f → LeftOrdContinuous (toDual ∘ f ∘ ofDual)

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

RightOrdContinuous f → LeftOrdContinuous (⇑OrderDual.toDual ∘ f ∘ ⇑OrderDual.ofDual)


/-- The set of `k`-smooth numbers `≤ N` is contained in the set of numbers of the form `m^2 * P`,
where `m ≤ √N` and `P` is a product of distinct primes `< k`. -/
lemma smoothNumbersUpTo_subset_image (N k : ℕ) :
    smoothNumbersUpTo N k ⊆ Finset.image (fun (s, m) ↦ m ^ 2 * (s.prod id))
      (k.primesBelow.powerset ×ˢ (Finset.range N.sqrt.succ).erase 0)

N.smoothNumbersUpTo k ⊆
  Finset.image
    (fun x =>
      match x with
      | (s, m) => m ^ 2 * s.prod id)
    (k.primesBelow.powerset ×ˢ (Finset.range N.sqrt.succ).erase 0)


theorem limsSup_le_limsSup_of_le {f g : Filter α} (h : f ≤ g)
    (hf : f.IsCobounded (· ≤ ·) := by isBoundedDefault)
    (hg : g.IsBounded (· ≤ ·) := by isBoundedDefault) :
    limsSup f ≤ limsSup g

(hf : Filter.IsCobounded (fun x x_1 => x ≤ x_1) f := by isBoundedDefault)

(hg : Filter.IsBounded (fun x x_1 => x ≤ x_1) g := by isBoundedDefault)


@[simp]
theorem iUnion_biUnionTagged (π : Prepartition I) (πi : ∀ J, TaggedPrepartition J) :
    (π.biUnionTagged πi).iUnion = ⋃ J ∈ π, (πi J).iUnion

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


theorem taylor_mem_nonZeroDivisors (hp : p ∈ R[X]⁰) : taylor r p ∈ R[X]⁰

(hp : p ∈ nonZeroDivisors (Polynomial R))

(Polynomial.taylor r) p ∈ nonZeroDivisors (Polynomial R)


lemma isIso_counit_app_of_iso [L.Faithful] [L.Full] {X : D} {Y : C} (e : X ≅ L.obj Y) :
    IsIso (h.counit.app X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : C ⥤ D}
{R : D ⥤ C}
(h : L ⊣ R)
[L.Faithful]
[L.Full]
{X : D}
{Y : C}
(e : X ≅ L.obj Y)


theorem modEq_iff_toIocMod_eq_right : a ≡ b [PMOD p] ↔ toIocMod hp a b = a + p

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


/-- Given a tower of scalar actions `M → α → β`, if we use `SMul.comp`
to pull back both of `M`'s actions by a map `g : N → M`, then we obtain a new
tower of scalar actions `N → α → β`.

This cannot be an instance because it can cause infinite loops whenever the `SMul` arguments
are still metavariables. -/
@[to_additive
"Given a tower of additive actions `M → α → β`, if we use `SMul.comp` to pull back both of
`M`'s actions by a map `g : N → M`, then we obtain a new tower of scalar actions `N → α → β`.

This cannot be an instance because it can cause infinite loops whenever the `SMul` arguments
are still metavariables."]
lemma comp.isScalarTower [SMul M β] [SMul α β] [IsScalarTower M α β] (g : N → M) : by
    haveI := comp α g; haveI := comp β g; exact IsScalarTower N α β

{M : Type u_1}
{N : Type u_2}
{α : Type u_7}
{β : Type u_8}
[SMul M α]
[SMul M β]
[SMul α β]
[IsScalarTower M α β]
(g : N → M)


/-- An open neighborhood of the identity in the cartesian square of a nonarchimedean group
contains the cartesian square of an open neighborhood in the group. -/
@[to_additive NonarchimedeanAddGroup.prod_self_subset "An open neighborhood of the identity in
the cartesian square of a nonarchimedean group contains the cartesian square of
an open neighborhood in the group."]
theorem prod_self_subset {U} (hU : U ∈ 𝓝 (1 : G × G)) :
    ∃ V : OpenSubgroup G, (V : Set G) ×ˢ (V : Set G) ⊆ U

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[NonarchimedeanGroup G]
{U : Set (G × G)}
(hU : U ∈ 𝓝 1)

∃ V, ↑V ×ˢ ↑V ⊆ U


/-- The functor `HomologicalComplex C c ⥤ ShortComplex C` which sends a homological
complex `K` to the short complex `K.X (c.prev i) ⟶ K.X i ⟶ K.X (c.next i)`. -/
@[simps!]
noncomputable def shortComplexFunctor (i : ι)

((HomologicalComplex.shortComplexFunctor C c i).obj K).g = K.d i (c.next i)


@[to_additive Ici_add_Ioi_subset]
theorem Ici_mul_Ioi_subset' [LocallyFiniteOrderTop α] (a b : α) : Ici a * Ioi b ⊆ Ioi (a * b)

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

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

Finset.Ici a * Finset.Ioi b ⊆ Finset.Ioi (a * b)


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

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

∀ {X Y : CategoryTheory.Comma L R₁} (f : X ⟶ Y), ((CategoryTheory.Comma.mapRightIso L i).functor.map f).right = f.right


@[to_additive (attr := simp)]
theorem inv_sup (S T : Submonoid G) : (S ⊔ T)⁻¹ = S⁻¹ ⊔ T⁻¹

{G : Type u_2}
[AddGroup G]
(S T : AddSubmonoid G)


/-- If `Fₙ` converges locally uniformly on a neighborhood of `x` within a set `s` to a function `f`
which is continuous at `x` within `s`, and `gₙ` tends to `x` within `s`, then `Fₙ (gₙ)` tends
to `f x`. -/
theorem tendsto_comp_of_locally_uniform_limit_within (h : ContinuousWithinAt f s x)
    (hg : Tendsto g p (𝓝[s] x))
    (hunif : ∀ u ∈ 𝓤 β, ∃ t ∈ 𝓝[s] x, ∀ᶠ n in p, ∀ y ∈ t, (f y, F n y) ∈ u) :
    Tendsto (fun n => F n (g n)) p (𝓝 (f x))

{F : ι → α → β}

(hunif : ∀ u ∈ 𝓤 β, ∃ t ∈ 𝓝[s] x, ∀ᶠ (n : ι) in p, ∀ y ∈ t, (f y, F n y) ∈ u)

Filter.Tendsto (fun n => F n (g n)) p (𝓝 (f x))


theorem Wequiv.abs' (x y : q.P.W) (h : QPF.abs x.dest = QPF.abs y.dest) : Wequiv x y

{F : Type u → Type u}
[q : QPF F]
(x y : (QPF.P F).W)
(h : QPF.abs x.dest = QPF.abs y.dest)


@[simp]
theorem subsingleton_bot : Filter.Subsingleton (⊥ : Filter α)


@[simp] theorem mem_principal {s t : Set α} : s ∈ 𝓟 t ↔ t ⊆ s

s ∈ 𝓟 t ↔ t ⊆ s


/-- If `i : D ⥤ C` is reflective, the inverse functor of `i ≌ F.essImage` can be explicitly
defined by the reflector. -/
@[simps]
def equivEssImageOfReflective [Reflective i] : D ≌ i.EssImageSubcategory

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
{i : CategoryTheory.Functor D C}
[CategoryTheory.Reflective i]

CategoryTheory.equivEssImageOfReflective.counitIso =
  CategoryTheory.NatIso.ofComponents CategoryTheory.equivEssImageOfReflective_counitIso_app ⋯


theorem add_lt_add_left_coe {x y : EReal} (h : x < y) (z : ℝ) : (z : EReal) + x < z + y


/-- In a nonempty type, a filter is a subsingleton iff
it is less than or equal to a pure filter. -/
theorem subsingleton_iff_exists_le_pure [Nonempty α] : l.Subsingleton ↔ ∃ a, l ≤ pure a

{α : Type u_1}
{l : Filter α}
[Nonempty α]


/-- The Lax functor associated with a pseudofunctor. -/
@[simps]
def toLax : LaxFunctor B C

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.Pseudofunctor B C)


@[simp, norm_cast]
theorem coe_to_mulHom (f : A →ₛₙₐ[φ] B) : ⇑(f : A →ₙ* B) = f

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


theorem isPredLimit_iff_lt_pred : IsPredLimit a ↔ ∀ ⦃b⦄, a < b → a < pred b

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

Order.IsPredLimit a ↔ ∀ ⦃b : α⦄, a < b → a < Order.pred b


theorem Filter.Eventually.germ_congr_set
    {P : ∀ x : X, Germ (𝓝 x) Y → Prop} (hf : ∀ᶠ x in 𝓝ˢ A, P x f)
    (h : ∀ᶠ z in 𝓝ˢ A, g z = f z) : ∀ᶠ x in 𝓝ˢ A, P x g

{X : Type u_3}
{Y : Type u_4}
[TopologicalSpace X]
{f g : X → Y}
{A : Set X}
{P : (x : X) → (𝓝 x).Germ Y → Prop}
(hf : ∀ᶠ (x : X) in 𝓝ˢ A, P x ↑f)
(h : ∀ᶠ (z : X) in 𝓝ˢ A, g z = f z)


theorem holderWith_id : HolderWith 1 1 (id : X → X)


@[simp]
theorem unitsEquivAut_symm_apply (e : R ≃L[R] R) : ↑((unitsEquivAut R).symm e) = e 1

{R : Type u_1}
[Ring R]
[TopologicalSpace R]
[ContinuousMul R]
(e : R ≃L[R] R)

↑((ContinuousLinearEquiv.unitsEquivAut R).symm e) = e 1


@[reassoc]
lemma LeftFraction.rightFraction_fac [W.HasRightCalculusOfFractions] {X Y : C}
    (φ : W.LeftFraction X Y) : φ.rightFraction.s ≫ φ.f = φ.rightFraction.f ≫ φ.s

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[W.HasRightCalculusOfFractions]
{X Y : C}
(φ : W.LeftFraction X Y)

CategoryTheory.CategoryStruct.comp φ.rightFraction.s φ.f = CategoryTheory.CategoryStruct.comp φ.rightFraction.f φ.s


theorem lf_of_lt {x y : PGame} (h : x < y) : x ⧏ y


@[simp]
theorem convexJoin_union_right (s t₁ t₂ : Set E) :
    convexJoin 𝕜 s (t₁ ∪ t₂) = convexJoin 𝕜 s t₁ ∪ convexJoin 𝕜 s t₂

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(s t₁ t₂ : Set E)


/-- An upper block-triangular matrix is invertible iff both elements of its diagonal are.

This is a propositional form of `Matrix.fromBlocksZero₂₁InvertibleEquiv`. -/
@[simp]
theorem isUnit_fromBlocks_zero₂₁ {A : Matrix m m α} {B : Matrix m n α} {D : Matrix n n α} :
    IsUnit (fromBlocks A B 0 D) ↔ IsUnit A ∧ IsUnit D

{m : Type u_2}
{n : Type u_3}
{α : Type u_4}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing α]
{A : Matrix m m α}
{B : Matrix m n α}
{D : Matrix n n α}

IsUnit (Matrix.fromBlocks A B 0 D) ↔ IsUnit A ∧ IsUnit D


theorem vars_map_of_injective (hf : Injective f) : (map f p).vars = p.vars

{R : Type u}
{S : Type v}
{σ : Type u_1}
[CommSemiring R]
(p : MvPolynomial σ R)
[CommSemiring S]
{f : R →+* S}
(hf : Function.Injective ⇑f)


/-- The canonical natural transformation from
`(whiskeringRight Cᵒᵖ A B).obj F ⋙ presheafToSheaf J B` to
`presheafToSheaf J A ⋙ Sheaf.composeAndSheafify J F`. -/
@[simps!]
noncomputable def toPresheafToSheafCompComposeAndSheafify :
    (whiskeringRight Cᵒᵖ A B).obj F ⋙ presheafToSheaf J B ⟶
      presheafToSheaf J A ⋙ Sheaf.composeAndSheafify J F

(J : CategoryTheory.GrothendieckTopology C)

(CategoryTheory.toPresheafToSheafCompComposeAndSheafify J F).app X =
  (CategoryTheory.presheafToSheaf J B).map (CategoryTheory.whiskerRight (CategoryTheory.toSheafify J X) F)


theorem dvd_sub_comm : a ∣ b - c ↔ a ∣ c - b

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


lemma hasDerivAt_fourierChar (x : ℝ) : HasDerivAt (𝐞 · : ℝ → ℂ) (2 * π * I * 𝐞 x) x

HasDerivAt (fun x => ↑(𝐞 x)) (2 * ↑π * Complex.I * ↑(𝐞 x)) x


/-- If `f : α → ℝ≥0∞` has finite integral, then there exists a measurable set `s` of finite measure
such that the integral of `f` over `sᶜ` is less than a given positive number.

Also used to prove an `Lᵖ`-norm version in
`MeasureTheory.Memℒp.exists_eLpNorm_indicator_compl_le`. -/
theorem exists_setLintegral_compl_lt {f : α → ℝ≥0∞} (hf : ∫⁻ a, f a ∂μ ≠ ∞)
    {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ s : Set α, MeasurableSet s ∧ μ s < ∞ ∧ ∫⁻ a in sᶜ, f a ∂μ < ε

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : ∫⁻ (a : α), f a ∂μ ≠ ⊤)
{ε : ℝ≥0∞}
(hε : ε ≠ 0)

∃ s, MeasurableSet s ∧ μ s < ⊤ ∧ ∫⁻ (a : α) in sᶜ, f a ∂μ < ε


lemma dens_lt_dens (h : s ⊂ t) : dens s < dens t

{α : Type u_2}
[Fintype α]
{s t : Finset α}
(h : s ⊂ t)


@[simp]
theorem mapTermRel_mapTermRel {L'' : Language}
    (ft : ∀ n, L.Term (α ⊕ (Fin n)) → L'.Term (β ⊕ (Fin n)))
    (fr : ∀ n, L.Relations n → L'.Relations n)
    (ft' : ∀ n, L'.Term (β ⊕ Fin n) → L''.Term (γ ⊕ (Fin n)))
    (fr' : ∀ n, L'.Relations n → L''.Relations n) {n} (φ : L.BoundedFormula α n) :
    ((φ.mapTermRel ft fr fun _ => id).mapTermRel ft' fr' fun _ => id) =
      φ.mapTermRel (fun _ => ft' _ ∘ ft _) (fun _ => fr' _ ∘ fr _) fun _ => id

(ft : (n : ℕ) → L.Term (α ⊕ Fin n) → L'.Term (β ⊕ Fin n))

(fr : (n : ℕ) → L.Relations n → L'.Relations n)

(ft' : (n : ℕ) → L'.Term (β ⊕ Fin n) → L''.Term (γ ⊕ Fin n))

(fr' : (n : ℕ) → L'.Relations n → L''.Relations n)

FirstOrder.Language.BoundedFormula.mapTermRel ft' fr' (fun x => id)
    (FirstOrder.Language.BoundedFormula.mapTermRel ft fr (fun x => id) φ) =
  FirstOrder.Language.BoundedFormula.mapTermRel (fun x => ft' x ∘ ft x) (fun x => fr' x ∘ fr x) (fun x => id) φ


@[simp]
theorem id_hom_app {X : TopCat.{w}} (ℱ : X.Presheaf C) (U) : (id ℱ).hom.app U = 𝟙 _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : TopCat}
(ℱ : TopCat.Presheaf C X)
(U : (TopologicalSpace.Opens ↑X)ᵒᵖ)

(TopCat.Presheaf.Pushforward.id ℱ).hom.app U = 𝟙 (((TopCat.Presheaf.pushforward C (𝟙 X)).obj ℱ).obj U)


theorem surjective_rangeRestrict : Function.Surjective f.rangeRestrict

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{L₂ : Type w}
[LieRing L₂]
[LieAlgebra R L₂]
(f : L →ₗ⁅R⁆ L₂)


theorem mem_span_pair {x y z : M} :
    z ∈ span R ({x, y} : Set M) ↔ ∃ a b : R, a • x + b • y = z

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{x y z : M}

z ∈ Submodule.span R {x, y} ↔ ∃ a b, a • x + b • y = z


theorem eq_or_gt_of_le [PartialOrder α] {a b : α} (h : a ≤ b) : b = a ∨ a < b

{α : Type u_2}
[PartialOrder α]
{a b : α}
(h : a ≤ b)


/-- An alternative description of the slit plane as consisting of nonzero complex numbers
whose argument is not π. -/
lemma mem_slitPlane_iff_arg {z : ℂ} : z ∈ slitPlane ↔ z.arg ≠ π ∧ z ≠ 0

z ∈ Complex.slitPlane ↔ z.arg ≠ π ∧ z ≠ 0


theorem closedBall_smul_ball (p : Seminorm 𝕜 E) {r₁ : ℝ} (hr₁ : r₁ ≠ 0) (r₂ : ℝ) :
    Metric.closedBall (0 : 𝕜) r₁ • p.ball 0 r₂ ⊆ p.ball 0 (r₁ * r₂)

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : Seminorm 𝕜 E)
{r₁ : ℝ}
(hr₁ : r₁ ≠ 0)
(r₂ : ℝ)

Metric.closedBall 0 r₁ • p.ball 0 r₂ ⊆ p.ball 0 (r₁ * r₂)


/-- Reinterpret `Additive G ≃+ H` as `G ≃* Multiplicative H`. -/
@[simps]
def AddEquiv.toMultiplicative' [MulOneClass G] [AddZeroClass H] :
    Additive G ≃+ H ≃ (G ≃* Multiplicative H)

{G : Type u_1}
{H : Type u_2}
[MulOneClass G]
[AddZeroClass H]
(f : Additive G ≃+ H)
(a : G)

(AddEquiv.toMultiplicative' f) a = (AddMonoidHom.toMultiplicative' f.toAddMonoidHom) a


lemma range_mapIncl (p : Submodule R P) (q : Submodule R Q) :
    LinearMap.range (mapIncl p q) = Submodule.span R (Set.image2 (· ⊗ₜ ·) p q)

{R : Type u_1}
[CommSemiring R]
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R P]
[Module R Q]
(p : Submodule R P)
(q : Submodule R Q)

LinearMap.range (TensorProduct.mapIncl p q) = Submodule.span R (Set.image2 (fun x x_1 => x ⊗ₜ[R] x_1) ↑p ↑q)


@[simp]
theorem image_Iio (e : α ≃o β) (a : α) : e '' Iio a = Iio (e a)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ≃o β)
(a : α)


/-- **Class formula** for a finite group acting on a finite type. See
`MulAction.card_eq_sum_card_group_div_card_stabilizer` for a specialized version using
`Quotient.out'`. -/
@[to_additive
      "**Class formula** for a finite group acting on a finite type. See
      `AddAction.card_eq_sum_card_addGroup_div_card_stabilizer` for a specialized version using
      `Quotient.out'`."]
theorem card_eq_sum_card_group_div_card_stabilizer' [Fintype α] [Fintype β] [Fintype Ω]
    [∀ b : β, Fintype <| stabilizer α b] {φ : Ω → β} (hφ : LeftInverse Quotient.mk'' φ) :
    Fintype.card β = ∑ ω : Ω, Fintype.card α / Fintype.card (stabilizer α (φ ω))

[Fintype (Quotient (AddAction.orbitRel α β))]

[(b : β) → Fintype ↥(AddAction.stabilizer α b)]

{φ : Quotient (AddAction.orbitRel α β) → β}

(hφ : Function.LeftInverse Quotient.mk'' φ)

Fintype.card β = ∑ ω : Quotient (AddAction.orbitRel α β), Fintype.card α / Fintype.card ↥(AddAction.stabilizer α (φ ω))


@[simp] lemma toENat_le_one {a : Cardinal} : toENat a ≤ 1 ↔ a ≤ 1


theorem _root_.WellFounded.transGen (h : WellFounded r) : WellFounded (TransGen r)

{α : Type u_1}
{r : α → α → Prop}
(h : WellFounded r)


theorem cont_eval_fix {f k v} (fok : Code.Ok f) :
    Turing.eval step (stepNormal f (Cont.fix f k) v) =
      f.fix.eval v >>= fun v => Turing.eval step (Cfg.ret k v)

{f : Turing.ToPartrec.Code}
{k : Turing.ToPartrec.Cont}
{v : List ℕ}
(fok : f.Ok)

Turing.eval Turing.ToPartrec.step (Turing.ToPartrec.stepNormal f (Turing.ToPartrec.Cont.fix f k) v) = do
  let v ← f.fix.eval v
  Turing.eval Turing.ToPartrec.step (Turing.ToPartrec.Cfg.ret k v)


/-- If a normed ring `𝔸` is a normed algebra over two fields, then they define the same
exponential function on `𝔸`. -/
theorem exp_eq_exp : (exp 𝕂 : 𝔸 → 𝔸) = exp 𝕂'

(𝕂 : Type u_1)
(𝕂' : Type u_2)
(𝔸 : Type u_3)
[Field 𝕂]
[Field 𝕂']
[Ring 𝔸]
[Algebra 𝕂 𝔸]
[Algebra 𝕂' 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]


@[simp]
theorem coe_lift₂_symm_apply (F : Sym2 α → Sym2 β → γ) (a₁ a₂ : α) (b₁ b₂ : β) :
    (lift₂.symm F : α → α → β → β → γ) a₁ a₂ b₁ b₂ = F s(a₁, a₂) s(b₁, b₂)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(F : Sym2 α → Sym2 β → γ)
(a₁ a₂ : α)
(b₁ b₂ : β)

↑(Sym2.lift₂.symm F) a₁ a₂ b₁ b₂ = F s(a₁, a₂) s(b₁, b₂)


/-- This is the version of **Hall's Marriage Theorem** in terms of indexed
families of finite sets `t : ι → Finset α`.  It states that there is a
set of distinct representatives if and only if every union of `k` of the
sets has at least `k` elements.

Recall that `s.biUnion t` is the union of all the sets `t i` for `i ∈ s`.

This theorem is bootstrapped from `Finset.all_card_le_biUnion_card_iff_exists_injective'`,
which has the additional constraint that `ι` is a `Fintype`.
-/
theorem Finset.all_card_le_biUnion_card_iff_exists_injective {ι : Type u} {α : Type v}
    [DecidableEq α] (t : ι → Finset α) :
    (∀ s : Finset ι, s.card ≤ (s.biUnion t).card) ↔
      ∃ f : ι → α, Function.Injective f ∧ ∀ x, f x ∈ t x

(∀ (s : Finset ι), s.card ≤ (s.biUnion t).card) ↔ ∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x


@[simp]
theorem coe_add [AddZeroClass β] [ContinuousAdd β] (f g : C₀(α, β)) : ⇑(f + g) = f + g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[AddZeroClass β]
[ContinuousAdd β]
(f g : α →C₀ β)


protected lemma xor_comm (n m : ℕ) : n ^^^ m = m ^^^ n


@[simp] lemma dvd_mul_leadingCoeff_inv {p q : K[X]} (hp0 : p ≠ 0) :
    q ∣ p * C (leadingCoeff p)⁻¹ ↔ q ∣ p

{K : Type u_1}
[DivisionRing K]
{p q : K[X]}
(hp0 : p ≠ 0)

q ∣ p * Polynomial.C p.leadingCoeff⁻¹ ↔ q ∣ p


/--
Two compatible families on the sieve generated by a presieve `R` are equal if and only if they are
equal when restricted to `R`.
-/
theorem restrict_inj {x₁ x₂ : FamilyOfElements P (generate R)} (t₁ : x₁.Compatible)
    (t₂ : x₂.Compatible) : x₁.restrict (le_generate R) = x₂.restrict (le_generate R) → x₁ = x₂

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

{x₁ x₂ : CategoryTheory.Presieve.FamilyOfElements P (CategoryTheory.Sieve.generate R).arrows}

CategoryTheory.Presieve.FamilyOfElements.restrict ⋯ x₁ = CategoryTheory.Presieve.FamilyOfElements.restrict ⋯ x₂ →
  x₁ = x₂


@[simp]
theorem smul_apply (c : S) (m : ι → M) : (c • f) m = c • f m

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


@[simp]
theorem sqrtd_re : (sqrtd : ℤ√d).re = 0


@[simp]
theorem not_isReal_iff_isComplex {w : InfinitePlace K} : ¬IsReal w ↔ IsComplex w

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


theorem tan_sub_pi (x : ℂ) : tan (x - π) = tan x

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


@[to_additive (attr := simp) abs_norm]
theorem abs_norm' (z : E) : |‖z‖| = ‖z‖

{E : Type u_6}
[SeminormedGroup E]
(z : E)


/-- An element is right-regular if and only if multiplying it on the right with a right-regular
element is right-regular. -/
@[to_additive (attr := simp)
"An element is add-right-regular if and only if adding it on the right to
an add-right-regular element is add-right-regular."]
theorem mul_isRightRegular_iff (b : R) (ha : IsRightRegular a) :
    IsRightRegular (b * a) ↔ IsRightRegular b

{R : Type u_1}
[AddSemigroup R]
{a : R}
(b : R)
(ha : IsAddRightRegular a)

IsAddRightRegular (b + a) ↔ IsAddRightRegular b


/-- The functor which sends `S : SnakeInput C` to its second line `S.L₂`. -/
@[simps]
def functorL₂ : SnakeInput C ⥤ ShortComplex C

(S : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.ShortComplex.SnakeInput.functorL₂.obj S = S.L₂


@[to_additive]
theorem rank_closure_finite_le_nat_card (s : Set G) [Finite s] :
    Group.rank (closure s) ≤ Nat.card s

{G : Type u_3}
[Group G]
(s : Set G)
[Finite ↑s]

Group.rank ↥(Subgroup.closure s) ≤ Nat.card ↑s


@[simp]
theorem edges_nil {u : V} : (nil : G.Walk u u).edges = []

{V : Type u}
{G : SimpleGraph V}
{u : V}


theorem sum_powerset_apply_card {α β : Type*} [AddCommMonoid α] (f : ℕ → α) {x : Finset β} :
    ∑ m ∈ x.powerset, f m.card = ∑ m ∈ range (x.card + 1), x.card.choose m • f m

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
(f : ℕ → α)
{x : Finset β}

∑ m ∈ x.powerset, f m.card = ∑ m ∈ Finset.range (x.card + 1), x.card.choose m • f m


theorem support_indicator_subset : ((indicator s f).support : Set ι) ⊆ s

{ι : Type u_1}
{α : Type u_2}
[Zero α]
(s : Finset ι)
(f : (i : ι) → i ∈ s → α)


private lemma image_T_subset_S (v) (hv : v ∈ T) : A *ᵥ v ∈ S

(hv :
  v ∈
    Finset.Icc 0 fun x =>
      ↑⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊)

A *ᵥ v ∈
  Finset.Icc
    (fun i =>
      ∑ j : β,
        ↑⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊ * -(A i j)⁻)
    fun i =>
    ∑ j : β,
      ↑⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊ * (A i j)⁺


theorem setLIntegral_subtype {s : Set α} (hs : MeasurableSet s) (t : Set s) (f : α → ℝ≥0∞) :
    ∫⁻ x in t, f x ∂(μ.comap (↑)) = ∫⁻ x in (↑) '' t, f x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : MeasurableSet s)
(t : Set ↑s)
(f : α → ℝ≥0∞)

∫⁻ (x : ↑s) in t, f ↑x ∂MeasureTheory.Measure.comap Subtype.val μ = ∫⁻ (x : α) in Subtype.val '' t, f x ∂μ


@[simp]
theorem mk''_eq_mk {p : Submodule R M} (x : M) : (Quotient.mk'' x : M ⧸ p) = (mk : M → M ⧸ p) x

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
{p : Submodule R M}
(x : M)

Quotient.mk'' x = Submodule.Quotient.mk x


@[simp]
lemma functorMap_id : functorMap f πX πX (𝟙 X) (by simp) = 𝟙 _

[CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (CategoryTheory.SmallObject.FunctorObjIndex f πX)) C]

[CategoryTheory.Limits.HasPushout (CategoryTheory.SmallObject.functorObjTop f πX)
    (CategoryTheory.SmallObject.functorObjLeft f πX)]

CategoryTheory.SmallObject.functorMap f πX πX (CategoryTheory.CategoryStruct.id X) ⋯ =
  CategoryTheory.CategoryStruct.id (CategoryTheory.SmallObject.functorObj f πX)


/-- If a fundamental domain has volume 0, then `QuotientMeasureEqMeasurePreimage` holds. -/
@[to_additive]
theorem IsFundamentalDomain.quotientMeasureEqMeasurePreimage_of_zero
    {s : Set α} (fund_dom_s : IsFundamentalDomain G s ν)
    (vol_s : ν s = 0) :
    QuotientMeasureEqMeasurePreimage ν (0 : Measure (Quotient α_mod_G))

[MeasureTheory.VAddInvariantMeasure G α ν]

(fund_dom_s : MeasureTheory.IsAddFundamentalDomain G s ν)


/-- If `C` has finite coproducts and filtered colimits, we can construct arbitrary coproducts by
    taking the colimit of the diagram formed by the coproducts of finite sets over the indexing
    type. -/
@[simps!]
def liftToFinsetColimitCocone [HasFiniteCoproducts C] [HasFilteredColimitsOfSize.{w, w} C]
    (F : Discrete α ⥤ C) : ColimitCocone F

[CategoryTheory.Limits.HasFilteredColimitsOfSize.{w, w, v, u} C]

(CategoryTheory.Limits.CoproductsFromFiniteFiltered.liftToFinsetColimitCocone F).isColimit.desc s =
  CategoryTheory.Limits.colimit.desc (CategoryTheory.Limits.CoproductsFromFiniteFiltered.liftToFinset F)
    { pt := s.pt, ι := { app := fun t => CategoryTheory.Limits.Sigma.desc fun x => s.ι.app ↑x, naturality := ⋯ } }


/-- Three points are collinear if and only if they are not affinely independent. -/
theorem collinear_iff_not_affineIndependent_of_ne {p : Fin 3 → P} {i₁ i₂ i₃ : Fin 3} (h₁₂ : i₁ ≠ i₂)
    (h₁₃ : i₁ ≠ i₃) (h₂₃ : i₂ ≠ i₃) :
    Collinear k ({p i₁, p i₂, p i₃} : Set P) ↔ ¬AffineIndependent k p

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p : Fin 3 → P}
{i₁ i₂ i₃ : Fin 3}
(h₁₂ : i₁ ≠ i₂)
(h₁₃ : i₁ ≠ i₃)
(h₂₃ : i₂ ≠ i₃)

Collinear k {p i₁, p i₂, p i₃} ↔ ¬AffineIndependent k p


@[to_additive (attr := simp)]
theorem mem_mk {s : Set G} {x : G} (h_one) (h_mul) (h_inv) :
    x ∈ mk ⟨⟨s, h_one⟩, h_mul⟩ h_inv ↔ x ∈ s

(h_one : ∀ {a b : G}, a ∈ s → b ∈ s → a * b ∈ s)

(h_inv :
  ∀ {x : G},
    x ∈ { carrier := s, mul_mem' := h_one, one_mem' := h_mul }.carrier →
      x⁻¹ ∈ { carrier := s, mul_mem' := h_one, one_mem' := h_mul }.carrier)

x ∈ { carrier := s, mul_mem' := h_one, one_mem' := h_mul, inv_mem' := h_inv } ↔ x ∈ s


lemma isClosed_iUnion (hf : ∀ i, IsClosed (f i)) : IsClosed (⋃ i, f i)

{ι : Sort u_1}
{α : Type u_3}
[TopologicalSpace α]
[AlexandrovDiscrete α]
{f : ι → Set α}
(hf : ∀ (i : ι), IsClosed (f i))


@[simp]
theorem support_zero : support (0 : HahnSeries Γ R) = ∅

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]


@[reassoc (attr := simp)]
lemma associator_hom_fst (X Y Z : C) :
    (α_ X Y Z).hom ≫ fst _ _ = fst _ _ ≫ fst _ _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.ChosenFiniteProducts C]
(X Y Z : C)

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).hom
    (CategoryTheory.ChosenFiniteProducts.fst X (CategoryTheory.MonoidalCategory.tensorObj Y Z)) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.ChosenFiniteProducts.fst (CategoryTheory.MonoidalCategory.tensorObj X Y) Z)
    (CategoryTheory.ChosenFiniteProducts.fst X Y)


theorem Inducing.codRestrict {e : X → Y} (he : Inducing e) {s : Set Y} (hs : ∀ x, e x ∈ s) :
    Inducing (codRestrict e s hs)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{e : X → Y}
(he : Inducing e)
{s : Set Y}
(hs : ∀ (x : X), e x ∈ s)


@[to_additive, simp]
lemma smul_mk_apply {M α : Type*} [Monoid M] [SMul M α] (m n : M) (h₁) (h₂) (a : α) :
    (⟨m, n, h₁, h₂⟩ : Mˣ) • a = m • a

{M : Type u_6}
{α : Type u_7}
[AddMonoid M]
[VAdd M α]
(m n : M)
(h₁ : m + n = 0)
(h₂ : n + m = 0)
(a : α)

{ val := m, neg := n, val_neg := h₁, neg_val := h₂ } +ᵥ a = m +ᵥ a


@[simp]
theorem range_coeSubmodule : (f.range : Submodule R L') = LinearMap.range (f : L →ₗ[R] L')

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
(f : L →ₗ⁅R⁆ L')

f.range.toSubmodule = LinearMap.range ↑f


@[simp]
theorem mapBilinear_apply (f : M →ₗ[R] P) (g : N →ₗ[R] Q) : mapBilinear R M N P Q f g = map f g

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

((TensorProduct.mapBilinear R M N P Q) f) g = TensorProduct.map f g


/-- A triangulated subcategory of a pretriangulated category `C` consists of
a predicate `P : C → Prop` which contains a zero object, is stable by shifts, and such that
if `X₁ ⟶ X₂ ⟶ X₃ ⟶ X₁⟦1⟧` is a distinguished triangle such that if `X₁` and `X₃` satisfy
`P` then `X₂` is isomorphic to an object satisfying `P`. -/
structure Subcategory where
  /-- the underlying predicate on objects of a triangulated subcategory -/
  P : C → Prop
  zero' : ∃ (Z : C) (_ : IsZero Z), P Z
  shift (X : C) (n : ℤ) : P X → P (X⟦n⟧)
  ext₂' (T : Triangle C) (_ : T ∈ distTriang C) : P T.obj₁ → P T.obj₃ → isoClosure P T.obj₂

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(self : CategoryTheory.Triangulated.Subcategory C)

self.P X → self.P ((CategoryTheory.shiftFunctor C n).obj X)


@[simp]
theorem mem_seq_iff {s : Set (α → β)} {t : Set α} {b : β} :
    b ∈ seq s t ↔ ∃ f ∈ s, ∃ a ∈ t, (f : α → β) a = b

{α : Type u}
{β : Type v}
{s : Set (α → β)}
{t : Set α}
{b : β}

b ∈ s.seq t ↔ ∃ f, f ∈ s ∧ ∃ a, a ∈ t ∧ f a = b


theorem ContMDiffOn.clm_comp {g : M → F₁ →L[𝕜] F₃} {f : M → F₂ →L[𝕜] F₁} {s : Set M}
    (hg : ContMDiffOn I 𝓘(𝕜, F₁ →L[𝕜] F₃) n g s) (hf : ContMDiffOn I 𝓘(𝕜, F₂ →L[𝕜] F₁) n f s) :
    ContMDiffOn I 𝓘(𝕜, F₂ →L[𝕜] F₃) n (fun x => (g x).comp (f x)) s


theorem tendsto_one_div_add_atTop_nhds_zero_nat :
    Tendsto (fun n : ℕ ↦ 1 / ((n : ℝ) + 1)) atTop (𝓝 0)

Filter.Tendsto (fun n => 1 / (↑n + 1)) Filter.atTop (𝓝 0)


/-- A complete sublattice is a subset of a complete lattice that is closed under arbitrary suprema
and infima. -/
structure CompleteSublattice extends Sublattice α where
  sSupClosed' : ∀ ⦃s : Set α⦄, s ⊆ carrier → sSup s ∈ carrier
  sInfClosed' : ∀ ⦃s : Set α⦄, s ⊆ carrier → sInf s ∈ carrier

{α : Type u_1}
[CompleteLattice α]
(self : CompleteSublattice α)
⦃s : Set α⦄

s ⊆ self.carrier → sInf s ∈ self.carrier


/-- Let `f : α → β` be a null measurable function
such that a.e. all values of `f` belong to a set `t`
such that the restriction of the `σ`-algebra in the codomain to `t` is countably generated,
then `f` is a.e.-measurable. -/
lemma MeasureTheory.NullMeasurable.aemeasurable_of_aerange {f : α → β} {t : Set β}
    [MeasurableSpace.CountablyGenerated t] (h : NullMeasurable f μ) (hft : ∀ᵐ x ∂μ, f x ∈ t) :
    AEMeasurable f μ

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{f : α → β}
{t : Set β}
[MeasurableSpace.CountablyGenerated ↑t]
(h : MeasureTheory.NullMeasurable f μ)
(hft : ∀ᵐ (x : α) ∂μ, f x ∈ t)


theorem functorPullback_pushforward_covering [G.IsLocallyFull K] {X : C}
    (T : K (G.obj X)) : (T.val.functorPullback G).functorPushforward G ∈ K (G.obj X)

{K : CategoryTheory.GrothendieckTopology D}

CategoryTheory.Sieve.functorPushforward G (CategoryTheory.Sieve.functorPullback G ↑T) ∈ K.sieves (G.obj X)


@[to_additive]
theorem isUnit_pure (a : α) : IsUnit (pure a : Filter α)


/-- The nerve of a category -/
@[simps]
def nerve (C : Type u) [Category.{v} C] : SSet.{max u v}

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(Δ : SimplexCategoryᵒᵖ)

(CategoryTheory.nerve C).obj Δ = CategoryTheory.ComposableArrows C (Opposite.unop Δ).len


@[to_additive add_neg_le_add_neg_iff]
theorem mul_inv_le_mul_inv_iff' : a * b⁻¹ ≤ c * d⁻¹ ↔ a * d ≤ c * b

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


@[simp]
theorem refl_inv : (Equiv.refl α : Perm α)⁻¹ = 1


@[simp]
theorem AddMonoidHom.coe_toIntLinearMap_comap {A A₂ : Type*} [AddCommGroup A] [AddCommGroup A₂]
    (f : A →+ A₂) (s : AddSubgroup A₂) :
    (AddSubgroup.toIntSubmodule s).comap f.toIntLinearMap =
      AddSubgroup.toIntSubmodule (s.comap f)

{A : Type u_10}
{A₂ : Type u_11}
[AddCommGroup A]
[AddCommGroup A₂]
(f : A →+ A₂)
(s : AddSubgroup A₂)

Submodule.comap f.toIntLinearMap (AddSubgroup.toIntSubmodule s) = AddSubgroup.toIntSubmodule (AddSubgroup.comap f s)


/-- The supremum of two equivalence relations r and s is the equivalence closure of the binary
    relation `x is related to y by r or s`. -/
theorem sup_eq_eqvGen (r s : Setoid α) :
    r ⊔ s = EqvGen.Setoid fun x y => r.Rel x y ∨ s.Rel x y


theorem add_ediv_of_dvd_right {a b c : Int} (H : c ∣ b) : (a + b) / c = a / c + b / c


theorem is_greatest' {a b : α} {m : ℕ} (h : Finite a b) (hm : get (multiplicity a b) h < m) :
    ¬a ^ m ∣ b

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


theorem BisimO.imp {R S : WSeq α → WSeq α → Prop} (H : ∀ s t, R s t → S s t) {o p} :
    BisimO R o p → BisimO S o p

{R S : Stream'.WSeq α → Stream'.WSeq α → Prop}

(H : ∀ (s t : Stream'.WSeq α), R s t → S s t)

Stream'.WSeq.BisimO R o p → Stream'.WSeq.BisimO S o p


/-- **Ruzsa's covering lemma**. -/
@[to_additive "**Ruzsa's covering lemma**"]
theorem exists_subset_mul_div (ht : t.Nonempty) :
    ∃ u : Finset α, u.card * t.card ≤ (s * t).card ∧ s ⊆ u * t / t

{α : Type u_1}
[DecidableEq α]
[AddCommGroup α]
(s : Finset α)
{t : Finset α}
(ht : t.Nonempty)

∃ u, u.card * t.card ≤ (s + t).card ∧ s ⊆ u + t - t


theorem projIcc_surjective : Surjective (projIcc a b h)

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


lemma re_mul_ofReal (z : ℂ) (r : ℝ) : (z * r).re = z.re *  r


@[to_additive]
theorem ContMDiffWithinAt.mul (hf : ContMDiffWithinAt I' I n f s x)
    (hg : ContMDiffWithinAt I' I n g s x) : ContMDiffWithinAt I' I n (f * g) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Add G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{s : Set M}
{x : M}
{n : ℕ∞}
(hf : ContMDiffWithinAt I' I n f s x)
(hg : ContMDiffWithinAt I' I n g s x)


/-- A `NormedLinearOrderedField` is a field that is both a `NormedField` and a
    `LinearOrderedField`. This class is necessary to avoid diamonds. -/
class NormedLinearOrderedField (α : Type*) extends LinearOrderedField α, Norm α,
  MetricSpace α where
  /-- The distance function is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = ‖x - y‖ := by aesop
  /-- The norm is multiplicative. -/
  norm_mul' : ∀ x y : α, ‖x * y‖ = ‖x‖ * ‖y‖

{α : Type u_2}
[self : NormedLinearOrderedField α]
(x y : α)


@[simp]
theorem toAut_hom (x : Mˣ) : (toAut M x).hom = SingleObj.toEnd M x

((Units.toAut M) x).hom = (CategoryTheory.SingleObj.toEnd M) ↑x


@[to_additive (attr := measurability)]
theorem const_mul [Mul β] [ContinuousMul β] (hf : StronglyMeasurable f) (c : β) :
    StronglyMeasurable fun x => c * f x

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable fun x => c * f x


@[mono]
theorem ord_strictMono : StrictMono ord


/-- The `I`-adic valuation of a generator of `I` equals `(-1 : ℤₘ₀)` -/
theorem intValuation_singleton {r : R} (hr : r ≠ 0) (hv : v.asIdeal = Ideal.span {r}) :
    v.intValuation r = Multiplicative.ofAdd (-1 : ℤ)

(v : IsDedekindDomain.HeightOneSpectrum R)

v.intValuation r = ↑(Multiplicative.ofAdd (-1))


lemma coversTop_iff_of_isTerminal (X : C) (hX : IsTerminal X)
    {I : Type*} (Y : I → C) :
    J.CoversTop Y ↔ Sieve.ofObjects Y X ∈ J X

(J : CategoryTheory.GrothendieckTopology C)

(hX : CategoryTheory.Limits.IsTerminal X)

J.CoversTop Y ↔ CategoryTheory.Sieve.ofObjects Y X ∈ J.sieves X


theorem map_map (f : α ↪ β) (g : β ↪ γ) (s : Finset α) : (s.map f).map g = s.map (f.trans g)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α ↪ β)
(g : β ↪ γ)
(s : Finset α)

Finset.map g (Finset.map f s) = Finset.map (f.trans g) s


theorem ExtensionOfMaxAdjoin.extendIdealTo_is_extension (h : Module.Baer R Q) (y : N) :
    ∀ (x : R) (mem : x ∈ ExtensionOfMaxAdjoin.ideal i f y),
      ExtensionOfMaxAdjoin.extendIdealTo i f h y x = ExtensionOfMaxAdjoin.idealTo i f y ⟨x, mem⟩

(mem : x ∈ Module.Baer.ExtensionOfMaxAdjoin.ideal i f y)

(Module.Baer.ExtensionOfMaxAdjoin.extendIdealTo i f h y) x = (Module.Baer.ExtensionOfMaxAdjoin.idealTo i f y) ⟨x, mem⟩


protected theorem add_mem_iff_left : y ∈ p → (x + y ∈ p ↔ x ∈ p)

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
{module_M : Module R M}
(p : Submodule R M)
{x y : M}


@[simp]
theorem relMap_quotient_mk'_sigma_mk' {n : ℕ} {R : L.Relations n} {i : ι} {x : Fin n → G i} :
    RelMap R (fun a => (⟦.mk f i (x a)⟧ : DirectLimit G f)) = RelMap R x

[DirectedSystem G fun i j h => ⇑(f i j h)]

(FirstOrder.Language.Structure.RelMap R fun a => ⟦FirstOrder.Language.Structure.Sigma.mk f i (x a)⟧) =
  FirstOrder.Language.Structure.RelMap R x


theorem isSheafFor_arrows_iff_pullbacks : (ofArrows X π).IsSheafFor P ↔
    (∀ (x : (i : I) → P.obj (op (X i))), Arrows.PullbackCompatible P π x →
    ∃! t, ∀ i, P.map (π i).op t = x i)

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

CategoryTheory.Presieve.IsSheafFor P (CategoryTheory.Presieve.ofArrows X π) ↔
  ∀ (x : (i : I) → P.obj (Opposite.op (X i))),
    CategoryTheory.Presieve.Arrows.PullbackCompatible P π x → ∃! t, ∀ (i : I), P.map (π i).op t = x i


@[to_additive]
theorem le_one_of_mul_le_left [ContravariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α}
    (h : a * b ≤ b) :
    a ≤ 1

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


theorem isLUB_empty [OrderBot α] : IsLUB ∅ (⊥ : α)


theorem lift_unique (F : DirectLimit G f ↪[L] P) (x) :
    F x =
      lift L ι G f (fun i => F.comp <| of L ι G f i)
        (fun i j hij x => by rw [F.comp_apply, F.comp_apply, of_f]) x

(F : FirstOrder.Language.DirectLimit G f ↪[L] P)

(x : FirstOrder.Language.DirectLimit G f)

F x =
  (FirstOrder.Language.DirectLimit.lift L ι G f (fun i => F.comp (FirstOrder.Language.DirectLimit.of L ι G f i)) ⋯) x


/-- If the union of a.e.-disjoint null-measurable sets has finite measure, then there are only
countably many members of the union whose measure is positive. -/
theorem countable_meas_pos_of_disjoint_of_meas_iUnion_ne_top₀ {ι : Type*} {_ : MeasurableSpace α}
    (μ : Measure α) {As : ι → Set α} (As_mble : ∀ i : ι, NullMeasurableSet (As i) μ)
    (As_disj : Pairwise (AEDisjoint μ on As)) (Union_As_finite : μ (⋃ i, As i) ≠ ∞) :
    Set.Countable { i : ι | 0 < μ (As i) }

∀ {x : MeasurableSpace α} (μ : MeasureTheory.Measure α) {As : ι → Set α},
  (∀ (i : ι), MeasureTheory.NullMeasurableSet (As i) μ) →
    Pairwise (MeasureTheory.AEDisjoint μ on As) → μ (⋃ i, As i) ≠ ⊤ → {i | 0 < μ (As i)}.Countable


/-- The image of a commutative square by a functor. -/
@[simps]
def map (sq : Square C) (F : C ⥤ D) : Square D

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


@[to_additive]
theorem subsingleton (h : UniqueMul A B a0 b0) :
    Subsingleton { ab : G × G // ab.1 ∈ A ∧ ab.2 ∈ B ∧ ab.1 * ab.2 = a0 * b0 }

{G : Type u_1}
[Add G]
{A B : Finset G}
{a0 b0 : G}
(h : UniqueAdd A B a0 b0)

Subsingleton { ab // ab.1 ∈ A ∧ ab.2 ∈ B ∧ ab.1 + ab.2 = a0 + b0 }


@[to_additive]
theorem smul_set_inter_subset : a • (t₁ ∩ t₂) ⊆ a • t₁ ∩ a • t₂

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{t₁ t₂ : Set β}
{a : α}