/-- The definition of `x ≤ y` on pre-games, in terms of `≤` two moves later. -/
theorem le_def {x y : PGame} :
    x ≤ y ↔
      (∀ i, (∃ i', x.moveLeft i ≤ y.moveLeft i') ∨ ∃ j, (x.moveLeft i).moveRight j ≤ y) ∧
        ∀ j, (∃ i, x ≤ (y.moveRight j).moveLeft i) ∨ ∃ j', x.moveRight j' ≤ y.moveRight j

x ≤ y ↔
  (∀ (i : x.LeftMoves), (∃ i', x.moveLeft i ≤ y.moveLeft i') ∨ ∃ j, (x.moveLeft i).moveRight j ≤ y) ∧
    ∀ (j : y.RightMoves), (∃ i, x ≤ (y.moveRight j).moveLeft i) ∨ ∃ j', x.moveRight j' ≤ y.moveRight j


theorem sups_left_comm : s ⊻ (t ⊻ u) = t ⊻ (s ⊻ u)

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


@[trans]
theorem Subsequent.trans {x y z} : Subsequent x y → Subsequent y z → Subsequent x z

x.Subsequent y → y.Subsequent z → x.Subsequent z


@[to_additive]
theorem isOpenMap_smul (c : G) : IsOpenMap fun x : α => c • x

{α : Type u_2}
{G : Type u_4}
[TopologicalSpace α]
[AddGroup G]
[AddAction G α]
[ContinuousConstVAdd G α]
(c : G)


theorem mul_add_left_left : IsRelPrime (y * z + x) y

{R : Type u_1}
[CommRing R]
{x y : R}
(h : IsRelPrime x y)
(z : R)


theorem down_sSup [SupSet α] (s : Set (ULift.{v} α)) : (sSup s).down = sSup (ULift.up ⁻¹' s)

{α : Type u_1}
[SupSet α]
(s : Set (ULift.{v, u_1} α))


theorem congr_fun_rfl {α β : Sort*} (f : α → β) (a : α) : congr_fun (Eq.refl f) a = Eq.refl (f a)

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


theorem Ici_add_bij : BijOn (· + d) (Ici a) (Ici (a + d))

{M : Type u_1}
[OrderedCancelAddCommMonoid M]
[ExistsAddOfLE M]
(a d : M)

Set.BijOn (fun x => x + d) (Set.Ici a) (Set.Ici (a + d))


theorem range_restrictPreimage : range (t.restrictPreimage f) = Subtype.val ⁻¹' range f

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

Set.range (t.restrictPreimage f) = Subtype.val ⁻¹' Set.range f


/-- The truncation of an `ℕ`-indexed chain complex,
deleting the object at `0` and shifting everything else down.
-/
@[simps]
def truncate [HasZeroMorphisms V] : ChainComplex V ℕ ⥤ ChainComplex V ℕ

∀ {X Y : ChainComplex V ℕ} (f : X ⟶ Y) (i : ℕ), (ChainComplex.truncate.map f).f i = f.f (i + 1)


/-- Inversion is a group homomorphism if the group is commutative. -/
@[to_additive
      "Negation is an `AddGroup` homomorphism if the `AddGroup` is commutative."]
theorem Inv.isGroupHom [CommGroup α] : IsGroupHom (Inv.inv : α → α)


@[to_additive]
theorem invRev_surjective : Function.Surjective (@invRev α)


theorem neighborSet_subgraphOfAdj [DecidableEq V] {u v w : V} (hvw : G.Adj v w) :
    (G.subgraphOfAdj hvw).neighborSet u =
    (if u = v then {w} else ∅) ∪ if u = w then {v} else ∅

{V : Type u}
{G : SimpleGraph V}
[DecidableEq V]
{u v w : V}
(hvw : G.Adj v w)


@[to_additive (attr := simp)]
lemma toFun_apply (x : M) (y : α) : MulAction.toFun M α y x = x • y

{M : Type u_1}
{α : Type u_7}
[Monoid M]
[MulAction M α]
(x : M)
(y : α)


theorem not_and_or_eq : (¬ (p ∧ q)) = (¬ p ∨ ¬ q)


theorem map_swap_eq_comap_swap {f : Filter (α × β)} : Prod.swap <$> f = comap Prod.swap f

{α : Type u}
{β : Type v}
{f : Filter (α × β)}

Prod.swap <$> f = Filter.comap Prod.swap f


/-- For finsets of naturals, the colexicographic order is equivalent to the order induced by the
`n`-ary expansion. -/
lemma geomSum_le_geomSum_iff_toColex_le_toColex (hn : 2 ≤ n) :
    ∑ k ∈ s, n ^ k ≤ ∑ k ∈ t, n ^ k ↔ toColex s ≤ toColex t

∑ k ∈ s, n ^ k ≤ ∑ k ∈ t, n ^ k ↔ { ofColex := s } ≤ { ofColex := t }


theorem isSuccLimit_zero : IsSuccLimit (0 : Ordinal)


/-- A category is `MonoidalLinear R` if tensoring is `R`-linear in both factors.
-/
class MonoidalLinear [MonoidalPreadditive C] : Prop where
  whiskerLeft_smul : ∀ (X : C) {Y Z : C} (r : R) (f : Y ⟶ Z) , X ◁ (r • f) = r • (X ◁ f) := by
    aesop_cat
  smul_whiskerRight : ∀ (r : R) {Y Z : C} (f : Y ⟶ Z) (X : C), (r • f) ▷ X = r • (f ▷ X) := by
    aesop_cat

[self : CategoryTheory.MonoidalLinear R C]

CategoryTheory.MonoidalCategory.whiskerLeft X (r • f) = r • CategoryTheory.MonoidalCategory.whiskerLeft X f


theorem roots_def [DecidableEq R] (p : R[X]) [Decidable (p = 0)] :
    p.roots = if h : p = 0 then ∅ else Classical.choose (exists_multiset_roots h)

{R : Type u}
[CommRing R]
[IsDomain R]
[DecidableEq R]
(p : Polynomial R)
[Decidable (p = 0)]

p.roots = if h : p = 0 then ∅ else Classical.choose ⋯


@[to_additive Right.pow_nonpos]
theorem Right.pow_le_one_of_le (hx : x ≤ 1) : ∀ {n : ℕ}, x ^ n ≤ 1

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


@[ext]
lemma hom_ext {X Y : HopfAlgebraCat.{v} R} (f g : X ⟶ Y) (h : f.toBialgHom = g.toBialgHom) :
    f = g

{R : Type u}
[CommRing R]
{X Y : HopfAlgebraCat R}
(f g : X ⟶ Y)
(h : f.toBialgHom = g.toBialgHom)


theorem compl_image : image (compl : Set α → Set α) = preimage compl


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

(t : CategoryTheory.Triangulated.TStructure C)


@[simp]
theorem MultilinearMap.curry_uncurryRight
    (f : MultilinearMap R (fun i : Fin n => M (castSucc i)) (M (last n) →ₗ[R] M₂)) :
    f.uncurryRight.curryRight = f

[(i : Fin n.succ) → AddCommMonoid (M i)]

(f : MultilinearMap R (fun i => M i.castSucc) (M (Fin.last n) →ₗ[R] M₂))


theorem mul_div_eq_iff_isRoot : (X - C a) * (p / (X - C a)) = p ↔ IsRoot p a

{R : Type u}
{a : R}
[Field R]
{p : R[X]}

(Polynomial.X - Polynomial.C a) * (p / (Polynomial.X - Polynomial.C a)) = p ↔ p.IsRoot a


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


/-- A monotone real function is differentiable Lebesgue-almost everywhere. -/
theorem Monotone.ae_differentiableAt {f : ℝ → ℝ} (hf : Monotone f) :
    ∀ᵐ x, DifferentiableAt ℝ f x


theorem leadingCoeff_of_ne {x : HahnSeries Γ R} (hx : x ≠ 0) :
    x.leadingCoeff = x.coeff (x.isWF_support.min (support_nonempty_iff.2 hx))

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{x : HahnSeries Γ R}
(hx : x ≠ 0)


@[simp]
theorem coe_inf (p p' : Subfield K) : ((p ⊓ p' : Subfield K) : Set K) = p.carrier ∩ p'.carrier

{K : Type u}
[DivisionRing K]
(p p' : Subfield K)


theorem vecMul_mulVec [Fintype m] [Fintype n] (A : Matrix m n α) (B : Matrix m o α) (x : n → α) :
    (A *ᵥ x) ᵥ* B = x ᵥ* (Aᵀ * B)

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[NonUnitalCommSemiring α]
[Fintype m]
[Fintype n]
(A : Matrix m n α)
(B : Matrix m o α)
(x : n → α)


theorem biUnion_le_iff {πi : ∀ J, Prepartition J} {π' : Prepartition I} :
    π.biUnion πi ≤ π' ↔ ∀ J ∈ π, πi J ≤ π'.restrict J

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


theorem comap_coe_nhdsWithin_Ioi_of_Ioo_subset (ha : s ⊆ Ioi a)
    (hs : s.Nonempty → ∃ b > a, Ioo a b ⊆ s) : comap ((↑) : s → α) (𝓝[>] a) = atBot

(hs : s.Nonempty → ∃ b > a, Set.Ioo a b ⊆ s)

Filter.comap Subtype.val (𝓝[>] a) = Filter.atBot


protected theorem Sorted.nodup {r : α → α → Prop} [IsIrrefl α r] {l : List α} (h : Sorted r l) :
    Nodup l

{α : Type u}
{r : α → α → Prop}
[IsIrrefl α r]
{l : List α}
(h : List.Sorted r l)


@[reassoc]
lemma mapLeftHomologyIso_hom_naturality [S₁.HasLeftHomology] [S₂.HasLeftHomology]
    [F.PreservesLeftHomologyOf S₁] [F.PreservesLeftHomologyOf S₂] :
    leftHomologyMap (F.mapShortComplex.map φ) ≫ (S₂.mapLeftHomologyIso F).hom =
      (S₁.mapLeftHomologyIso F).hom ≫ F.map (leftHomologyMap φ)

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.leftHomologyMap (F.mapShortComplex.map φ))
    (S₂.mapLeftHomologyIso F).hom =
  CategoryTheory.CategoryStruct.comp (S₁.mapLeftHomologyIso F).hom
    (F.map (CategoryTheory.ShortComplex.leftHomologyMap φ))


@[to_additive (attr := simp, norm_cast)]
theorem coe_smul (c : M) (x : X) : (↑(c • x) : Completion X) = c • (x : Completion X)

{M : Type v}
{X : Type x}
[UniformSpace X]
[SMul M X]
[UniformContinuousConstSMul M X]
(c : M)
(x : X)


@[simp]
theorem KernelFork.ι_ofι {X Y P : C} (f : X ⟶ Y) (ι : P ⟶ X) (w : ι ≫ f = 0) :
    Fork.ι (KernelFork.ofι ι w) = ι

CategoryTheory.Limits.Fork.ι (CategoryTheory.Limits.KernelFork.ofι ι w) = ι


/-- Given a natural transformation `α : F ⟶ G`, for `F G : Cᵒᵖ ⥤ D`,
taking `op` of each component gives a natural transformation `G.rightOp ⟶ F.rightOp`.
-/
@[simps]
protected def rightOp (α : F ⟶ G) : G.rightOp ⟶ F.rightOp

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

(CategoryTheory.NatTrans.rightOp α).app X = (α.app (Opposite.op X)).op


theorem coe_nsmul (r : ℝ≥0) (n : ℕ) : ↑(n • r) = n • (r : ℝ)


lemma dotProduct_nonneg_of_nonneg {v w : n → R} (hv : 0 ≤ v) (hw : 0 ≤ w) : 0 ≤ dotProduct v w

{n : Type u_2}
{R : Type u_4}
[OrderedSemiring R]
[Fintype n]
{v w : n → R}
(hv : 0 ≤ v)
(hw : 0 ≤ w)


lemma measurableSet_bddAbove_range {ι} [Countable ι] {f : ι → δ → α} (hf : ∀ i, Measurable (f i)) :
    MeasurableSet {b | BddAbove (range (fun i ↦ f i b))}

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[MeasurableSpace δ]
[LinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
{ι : Sort u_5}
[Countable ι]
{f : ι → δ → α}
(hf : ∀ (i : ι), Measurable (f i))

MeasurableSet {b | BddAbove (Set.range fun i => f i b)}


@[simp]
theorem frontier_setOf_im_le (a : ℝ) : frontier { z : ℂ | z.im ≤ a } = { z | z.im = a }

frontier {z | z.im ≤ a} = {z | z.im = a}


@[simp]
theorem isOpen_preimage (h : X ≃ₜ Y) {s : Set Y} : IsOpen (h ⁻¹' s) ↔ IsOpen s

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)
{s : Set Y}


theorem zipWith_neLocus_eq_left [∀ a, DecidableEq (N a)] [∀ a, DecidableEq (P a)]
    {F : ∀ a, M a → N a → P a} (F0 : ∀ a, F a 0 0 = 0) (f : Π₀ a, M a) (g₁ g₂ : Π₀ a, N a)
    (hF : ∀ a f, Function.Injective fun g ↦ F a f g) :
    (zipWith F F0 f g₁).neLocus (zipWith F F0 f g₂) = g₁.neLocus g₂

(hF : ∀ (a : α) (f : M a), Function.Injective fun g => F a f g)

(DFinsupp.zipWith F F0 f g₁).neLocus (DFinsupp.zipWith F F0 f g₂) = g₁.neLocus g₂


theorem tail_apply : tail t i = t i.succ

{n : ℕ}
(i : Fin n)
{M : Type u_1}
[Zero M]
(t : Fin (n + 1) →₀ M)


@[simp, norm_cast] lemma coe_eq_one : (r : ℝ) = 1 ↔ r = 1


@[to_additive (attr := simp) pi_norm_const]
lemma pi_norm_const' [Nonempty ι] (a : E) : ‖fun _i : ι => a‖ = ‖a‖

{ι : Type u_1}
{E : Type u_2}
[Fintype ι]
[SeminormedAddGroup E]
[Nonempty ι]
(a : E)


theorem finiteType_of_monoid_fg [Monoid.FG M] : Algebra.FiniteType R S

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


/-- In the case that `n = ∞` we don't need the continuity assumption in
`HasFTaylorSeriesUpTo`. -/
theorem hasFTaylorSeriesUpTo_top_iff' :
    HasFTaylorSeriesUpTo ∞ f p ↔
      (∀ x, (p x 0).uncurry0 = f x) ∧
        ∀ (m : ℕ) (x), HasFDerivAt (fun y => p y m) (p x m.succ).curryLeft x

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

HasFTaylorSeriesUpTo ⊤ f p ↔
  (∀ (x : E), (p x 0).uncurry0 = f x) ∧ ∀ (m : ℕ) (x : E), HasFDerivAt (fun y => p y m) (p x m.succ).curryLeft x


theorem image2_iUnion₂_left (s : ∀ i, κ i → Set α) (t : Set β) :
    image2 f (⋃ (i) (j), s i j) t = ⋃ (i) (j), image2 f (s i j) t

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{ι : Sort u_4}
{κ : ι → Sort u_7}
(f : α → β → γ)
(s : (i : ι) → κ i → Set α)
(t : Set β)

Set.image2 f (⋃ i, ⋃ j, s i j) t = ⋃ i, ⋃ j, Set.image2 f (s i j) t


lemma hom_apply {X Y : TopCat} (f : X ⟶ Y) (x : X) : f x = ContinuousMap.toFun f x


/-- The product of homotopies `F` and `G`,
  where `F` takes `f₀` to `f₁` and `G` takes `g₀` to `g₁` -/
@[simps]
def Homotopy.prod (F : Homotopy f₀ f₁) (G : Homotopy g₀ g₁) :
    Homotopy (ContinuousMap.prodMk f₀ g₀) (ContinuousMap.prodMk f₁ g₁)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{A : Type u_3}
[TopologicalSpace A]
{f₀ f₁ : C(A, α)}
{g₀ g₁ : C(A, β)}
(F : f₀.Homotopy f₁)
(G : g₀.Homotopy g₁)
(t : ↑unitInterval × A)


/-- If a vector space has a finite basis, then it is finite-dimensional. -/
theorem of_fintype_basis {ι : Type w} [Finite ι] (h : Basis ι K V) : FiniteDimensional K V

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{ι : Type w}
[Finite ι]
(h : Basis ι K V)


@[simp]
theorem swap_smul_self_smul [MulAction (Perm α) β] (i j : α) (x : β) :
    swap i j • swap i j • x = x

{α : Type u}
{β : Type v}
[DecidableEq α]
[MulAction (Equiv.Perm α) β]
(i j : α)
(x : β)


lemma mem_upperBounds_iff_subset_Iic : a ∈ upperBounds s ↔ s ⊆ Iic a

{α : Type u}
[Preorder α]
{s : Set α}
{a : α}


@[mono]
theorem clog_anti_left {b c n : ℕ} (hc : 1 < c) (hb : c ≤ b) : clog b n ≤ clog c n


private theorem aux₃ :
    |(fract ξ)⁻¹ - v / (u - ⌊ξ⌋ * v)| < (((u : ℝ) - ⌊ξ⌋ * v) * (2 * (u - ⌊ξ⌋ * v) - 1))⁻¹

{ξ : ℝ}
{u v : ℤ}
(hv : 2 ≤ v)
(h : Real.ContfracLegendre.Ass ξ u v)

|(Int.fract ξ)⁻¹ - ↑v / (↑u - ↑⌊ξ⌋ * ↑v)| < ((↑u - ↑⌊ξ⌋ * ↑v) * (2 * (↑u - ↑⌊ξ⌋ * ↑v) - 1))⁻¹


@[reassoc (attr := simp)]
lemma inlX_desc_f (i j : ι) (hjk : c.Rel j i) :
    inlX φ i j hjk ≫ (desc φ α hα).f j = hα.hom i j

HomologicalComplex.homotopyCofiber.inlX φ i j hjk ≫ (HomologicalComplex.homotopyCofiber.desc φ α hα).f j = hα.hom i j


/--
The pair `f,g` is a split pair if there is an `h : Y ⟶ Z` so that `f, g, h` forms a split
coequalizer in `C`.
-/
class HasSplitCoequalizer : Prop where
  /-- There is some split coequalizer -/
  splittable : ∃ (Z : C) (h : Y ⟶ Z), Nonempty (IsSplitCoequalizer f g h)

[self : CategoryTheory.HasSplitCoequalizer f g]

∃ Z h, Nonempty (CategoryTheory.IsSplitCoequalizer f g h)


theorem div_le_iff {a b r : ℝ≥0} (hr : r ≠ 0) : a / r ≤ b ↔ a ≤ b * r


theorem nhds_list (as : List α) : 𝓝 as = traverse 𝓝 as

{α : Type u_1}
[TopologicalSpace α]
(as : List α)


lemma map_smul_of_iInf_genEigenspace_ne_bot [NoZeroSMulDivisors R M]
    {L F : Type*} [SMul R L] [FunLike F L (End R M)] [MulActionHomClass F R L (End R M)] (f : F)
    (μ : L → R) (h_ne : ⨅ x, ⨆ k, (f x).genEigenspace (μ x) k ≠ ⊥)
    (t : R) (x : L) :
    μ (t • x) = t • μ x

[MulActionHomClass F R L (Module.End R M)]

(h_ne : ⨅ x, ⨆ k, ((f x).genEigenspace (μ x)) k ≠ ⊥)


lemma PrimeSpectrum.embedding_tensorProductTo_of_surjectiveOnStalks :
    Embedding (tensorProductTo R S T)

(hRT : (algebraMap R T).SurjectiveOnStalks)

Embedding (PrimeSpectrum.tensorProductTo R S T)


@[simp]
theorem divOf_zero (x : k[G]) : x /ᵒᶠ 0 = x

{k : Type u_1}
{G : Type u_2}
[Semiring k]
[AddCancelCommMonoid G]
(x : AddMonoidAlgebra k G)


theorem bitwise_xor : bitwise xor = Int.xor


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

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

(fun x => x * c) ⁻¹' Set.Ici a = Set.Iic (a / c)


@[simp]
theorem mem_idRel {a b : α} : (a, b) ∈ @idRel α ↔ a = b


@[simp]
theorem zero_mk (s : S) : mk (0 : M) s = 0

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(s : ↥S)


@[simp]
theorem coe_zero : ((0 : A →⋆ₙ+* B) : A → B) = 0

{A : Type u_1}
{B : Type u_2}
[NonUnitalNonAssocSemiring A]
[StarAddMonoid A]
[NonUnitalNonAssocSemiring B]
[StarAddMonoid B]


@[to_additive (attr := simp)]
lemma val_smul [Group G] [Monoid M] [MulAction G M] [SMulCommClass G M M] [IsScalarTower G M M]
    (g : G) (m : Mˣ) : ↑(g • m) = g • (m : M)

{G : Type u_1}
{M : Type u_3}
[AddGroup G]
[AddMonoid M]
[AddAction G M]
[VAddCommClass G M M]
[VAddAssocClass G M M]
(g : G)
(m : AddUnits M)


@[to_additive]
theorem comap_strictMono_of_surjective : StrictMono (comap f)

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{f : F}
(hf : Function.Surjective ⇑f)


theorem coe_pnat_injective : Function.Injective ((↑) : Nat.Primes → ℕ+)


/-- See also `Nat.ofNat_pos`, specialised for an `OrderedSemiring`. -/
-- See note [no_index around OfNat.ofNat]
@[simp low]
theorem ofNat_pos' {n : ℕ} [n.AtLeastTwo] : 0 < (no_index (OfNat.ofNat n : α))

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


theorem get_eq_iff_eq_coe {a : PartENat} {ha : a.Dom} {b : ℕ} : a.get ha = b ↔ a = b


theorem Additive.isAddSubgroup_iff {s : Set G} : @IsAddSubgroup (Additive G) _ s ↔ IsSubgroup s


theorem card_interedges_finpartition [DecidableEq α] [DecidableEq β] (P : Finpartition s)
    (Q : Finpartition t) :
    (interedges r s t).card = ∑ ab ∈ P.parts ×ˢ Q.parts, (interedges r ab.1 ab.2).card

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

(Rel.interedges r s t).card = ∑ ab ∈ P.parts ×ˢ Q.parts, (Rel.interedges r ab.1 ab.2).card


theorem hasNext_cons_addChar (c : Char) (cs : List Char) (i : Pos) :
    hasNext ⟨⟨c :: cs⟩, i + c⟩ = hasNext ⟨⟨cs⟩, i⟩

(c : Char)
(cs : List Char)
(i : String.Pos)

{ s := { data := c :: cs }, i := i + c }.hasNext = { s := { data := cs }, i := i }.hasNext


theorem Rel.sub_right {R : Type uR} [Ring R] {r : R → R → Prop} ⦃a b c : R⦄ (h : Rel r b c) :
    Rel r (a - b) (a - c)

{R : Type uR}
[Ring R]
{r : R → R → Prop}
⦃a b c : R⦄
(h : RingQuot.Rel r b c)


protected theorem comm : a ≡ b [MOD n] ↔ b ≡ a [MOD n]


theorem adjugate_reindex (e : m ≃ n) (A : Matrix m m α) :
    adjugate (reindex e e A) = reindex e e (adjugate A)

{m : Type u}
{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
[CommRing α]
(e : m ≃ n)
(A : Matrix m m α)

((Matrix.reindex e e) A).adjugate = (Matrix.reindex e e) A.adjugate


@[to_additive (attr := simp)]
theorem mulIndicator_self_mul_compl (s : Set α) (f : α → M) :
    mulIndicator s f * mulIndicator sᶜ f = f

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

s.mulIndicator f * sᶜ.mulIndicator f = f


theorem hasCoproductsOfShape_of_small (β : Type w₂) [Small.{w₁} β] [HasCoproducts.{w₁} C] :
    HasCoproductsOfShape β C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(β : Type w₂)
[Small.{w₁, w₂} β]
[CategoryTheory.Limits.HasCoproducts C]


theorem Filter.Tendsto.rpow {l : Filter α} {f g : α → ℝ} {x y : ℝ} (hf : Tendsto f l (𝓝 x))
    (hg : Tendsto g l (𝓝 y)) (h : x ≠ 0 ∨ 0 < y) : Tendsto (fun t => f t ^ g t) l (𝓝 (x ^ y))

{α : Type u_1}
{l : Filter α}
{f g : α → ℝ}
{x y : ℝ}
(hf : Filter.Tendsto f l (𝓝 x))
(hg : Filter.Tendsto g l (𝓝 y))
(h : x ≠ 0 ∨ 0 < y)

Filter.Tendsto (fun t => f t ^ g t) l (𝓝 (x ^ y))


/-- Congruence relations equal the smallest congruence relation in which they are contained. -/
@[to_additive (attr := simp) addConGen_of_addCon "Additive congruence relations equal the smallest
additive congruence relation in which they are contained."]
theorem conGen_of_con (c : Con M) : conGen c = c


theorem mono_pre (m : Set X → ℝ≥0∞) {r r' : ℝ≥0∞} (h : r ≤ r') : pre m r' ≤ pre m r

{X : Type u_2}
[EMetricSpace X]
(m : Set X → ℝ≥0∞)
{r r' : ℝ≥0∞}
(h : r ≤ r')

MeasureTheory.OuterMeasure.mkMetric'.pre m r' ≤ MeasureTheory.OuterMeasure.mkMetric'.pre m r


/-- The infimum of a set of congruence relations is the same as the infimum of the set's image
    under the map to the underlying equivalence relation. -/
@[to_additive "The infimum of a set of additive congruence relations is the same as the infimum of
the set's image under the map to the underlying equivalence relation."]
theorem sInf_toSetoid (S : Set (Con M)) : (sInf S).toSetoid = sInf (toSetoid '' S)

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

(sInf S).toSetoid = sInf (AddCon.toSetoid '' S)


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

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Sup α]
[Sup β]
[Sup γ]
(g : SupHom β γ)
(f : SupHom α β)


theorem leadingCoeff_add_eq_left {Γ} [LinearOrder Γ] {x y : HahnSeries Γ R}
    (hxy : x.orderTop < y.orderTop) : (x + y).leadingCoeff = x.leadingCoeff

{R : Type u_2}
[AddMonoid R]
{Γ : Type u_3}
[LinearOrder Γ]
{x y : HahnSeries Γ R}
(hxy : x.orderTop < y.orderTop)


theorem principalUnitGroupEquiv_apply (a : A.principalUnitGroup) :
    (((principalUnitGroupEquiv A a : Aˣ) : A) : K) = (a : Kˣ)

{K : Type u}
[Field K]
(A : ValuationSubring K)
(a : ↥A.principalUnitGroup)


@[simp] theorem ofBaseChangeAux_ι (Q : QuadraticForm R V) (v : V) :
    ofBaseChangeAux A Q (ι Q v) = ι (Q.baseChange A) (1 ⊗ₜ v)

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

(CliffordAlgebra.ofBaseChangeAux A Q) ((CliffordAlgebra.ι Q) v) =
  (CliffordAlgebra.ι (QuadraticForm.baseChange A Q)) (1 ⊗ₜ[R] v)


@[simp]
theorem reindex_refl : reindex R s (Equiv.refl ι) = LinearEquiv.refl R _

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]

PiTensorProduct.reindex R s (Equiv.refl ι) = LinearEquiv.refl R (PiTensorProduct R fun i => s i)


theorem dcongr_arg {ι : Type*} {F G : ι → C} (α : ∀ i, F i ⟶ G i) {i j : ι} (h : i = j) :
    α i = eqToHom (congr_arg F h) ≫ α j ≫ eqToHom (congr_arg G h.symm)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{ι : Type u_2}
{F G : ι → C}
(α : (i : ι) → F i ⟶ G i)
{i j : ι}
(h : i = j)

α i =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
    (CategoryTheory.CategoryStruct.comp (α j) (CategoryTheory.eqToHom ⋯))


lemma homMk'_comp (f : StructuredArrow S T) (g : f.right ⟶ Y') (g' : Y' ⟶ Y'') :
    homMk' f (g ≫ g') = homMk' f g ≫ homMk' (mk (f.hom ≫ T.map g)) g' ≫ eqToHom (by simp)

(f : CategoryTheory.StructuredArrow S T)

f.homMk' (CategoryTheory.CategoryStruct.comp g g') =
  CategoryTheory.CategoryStruct.comp (f.homMk' g)
    (CategoryTheory.CategoryStruct.comp
      ((CategoryTheory.StructuredArrow.mk (CategoryTheory.CategoryStruct.comp f.hom (T.map g))).homMk' g')
      (CategoryTheory.eqToHom ⋯))


theorem select_add_select_not : ∀ x : 𝕎 R, select P x + select (fun i => ¬P i) x = x

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

WittVector.select P x + WittVector.select (fun i => ¬P i) x = x


theorem piIsoPi_inv_π_apply {ι : Type v} (α : ι → TopCat.{max v u}) (i : ι) (x : ∀ i, α i) :
    (Pi.π α i : _) ((piIsoPi α).inv x) = x i

{ι : Type v}
(α : ι → TopCat)
(i : ι)
(x : (i : ι) → ↑(α i))

(CategoryTheory.Limits.Pi.π α i) ((TopCat.piIsoPi α).inv x) = x i


nonrec theorem Polynomial.exists_of [Nonempty ι] [IsDirected ι (· ≤ ·)]
    (q : Polynomial (DirectLimit G fun i j h => f' i j h)) :
    ∃ i p, Polynomial.map (of G (fun i j h => f' i j h) i) p = q

(q : Polynomial (Ring.DirectLimit G fun i j h => ⇑(f' i j h)))

∃ i p, Polynomial.map (Ring.DirectLimit.of G (fun i j h => ⇑(f' i j h)) i) p = q


@[simp]
theorem add_eq_right ⦃x y : Tropical R⦄ (h : y ≤ x) : x + y = y

{R : Type u}
[LinearOrder R]
⦃x y : Tropical R⦄
(h : y ≤ x)


@[simp]
theorem nodup_sublists' {l : List α} : Nodup (sublists' l) ↔ Nodup l


lemma exactAt_iff_isZero_homology [K.HasHomology i] :
    K.ExactAt i ↔ IsZero (K.homology i)

K.ExactAt i ↔ CategoryTheory.Limits.IsZero (K.homology i)


@[to_additive (attr := ext)]
lemma ext {X Y : CommGrp} {f g : X ⟶ Y} (w : ∀ x : X, f x = g x) : f = g

{X Y : AddCommGrp}
{f g : X ⟶ Y}
(w : ∀ (x : ↑X), f x = g x)


lemma convolution_def {R : Type*} [Semiring R] (f g : ℕ → R) :
    f ⍟ g = fun n ↦ ∑ p ∈ n.divisorsAntidiagonal, f p.1 * g p.2

{R : Type u_1}
[Semiring R]
(f g : ℕ → R)

f ⍟ g = fun n => ∑ p ∈ n.divisorsAntidiagonal, f p.1 * g p.2


theorem not_nodup_pair : ∀ a : α, ¬Nodup (a ::ₘ a ::ₘ 0)


@[to_additive (attr := simp)]
theorem centralizer_eq_top_iff_subset {s : Set M} : centralizer s = ⊤ ↔ s ⊆ center M

Submonoid.centralizer s = ⊤ ↔ s ⊆ ↑(Submonoid.center M)


/-- If `h : a ∈ {x | p x}` then `h.out : p x`. These are definitionally equal, but this can
nevertheless be useful for various reasons, e.g. to apply further projection notation or in an
argument to `simp`. -/
theorem _root_.Membership.mem.out {p : α → Prop} {a : α} (h : a ∈ { x | p x }) : p a

{α : Type u}
{p : α → Prop}
{a : α}
(h : a ∈ {x | p x})


@[simp]
theorem restrictScalarsEquiv_symm_mk [Ring S] [SMul S R] [Module S M] [IsScalarTower S R M]
    (P : Submodule R M) (x : M) :
    (restrictScalarsEquiv S P).symm ((mk : M → M ⧸ P) x) = (mk : M → M ⧸ P) x

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(S : Type u_3)
[Ring S]
[SMul S R]
[Module S M]
[IsScalarTower S R M]
(P : Submodule R M)
(x : M)

(Submodule.Quotient.restrictScalarsEquiv S P).symm (Submodule.Quotient.mk x) = Submodule.Quotient.mk x


/-- The equivalence `Karoubi (CochainComplex C α) ≌ CochainComplex (Karoubi C) α`. -/
@[simps!]
def karoubiCochainComplexEquivalence :
    Karoubi (CochainComplex C α) ≌ CochainComplex (Karoubi C) α

(K : HomologicalComplex (CategoryTheory.Idempotents.Karoubi C) (ComplexShape.up α))

((CategoryTheory.Idempotents.karoubiCochainComplexEquivalence C α).inverse.obj K).X.X n = (K.X n).X


theorem nextCoeff_pow (hp : p.Monic) (n : ℕ) : (p ^ n).nextCoeff = n • p.nextCoeff

{R : Type u}
[Semiring R]
{p : R[X]}
(hp : p.Monic)
(n : ℕ)


theorem ncard_lt_ncard_iff_ncard_diff_lt_ncard_diff (hs : s.Finite := by toFinite_tac)
    (ht : t.Finite := by toFinite_tac) : s.ncard < t.ncard ↔ (s \ t).ncard < (t \ s).ncard

{α : Type u_1}
{s t : Set α}
(hs : s.Finite := by toFinite_tac)
(ht : t.Finite := by toFinite_tac)


@[simp] theorem isGLB_singleton : IsGLB {a} a


@[simp]
theorem argminOn_mem (s : Set α) (hs : s.Nonempty) : argminOn f h s hs ∈ s

{α : Type u_1}
{β : Type u_2}
(f : α → β)
[LT β]
(h : WellFounded fun x x_1 => x < x_1)
(s : Set α)
(hs : s.Nonempty)


theorem forall_imp (h : ∀ a, p a → q a) : (∀ a, p a) → ∀ a, q a

{α : Sort u_1}
{p q : α → Prop}
(h : ∀ (a : α), p a → q a)


theorem map_comap_le : (K.comap f).map f ≤ K

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
{f : F}
{K : Ideal S}


@[to_additive]
theorem isRegular_iff {c : R} : IsRegular c ↔ IsLeftRegular c ∧ IsRightRegular c


protected theorem Antitone.closureAntitone [TopologicalSpace α] (hanti : CantorScheme.Antitone A)
    (hclosed : ∀ l, IsClosed (A l)) : ClosureAntitone A

(hclosed : ∀ (l : List β), IsClosed (A l))


theorem Perm.swap' (x y : α) {l₁ l₂ : List α} (p : l₁ ~ l₂) : y :: x :: l₁ ~ x :: y :: l₂

{α : Type u_1}
(x y : α)
{l₁ l₂ : List α}
(p : l₁ ~ l₂)


theorem iUnion_eq (h : π.IsPartition) : π.iUnion = I

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


@[to_additive (attr := measurability)]
theorem AEMeasurable.const_mul [MeasurableMul M] (hf : AEMeasurable f μ) (c : M) :
    AEMeasurable (fun x => c * f x) μ

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Mul M]
{m : MeasurableSpace α}
{f : α → M}
{μ : MeasureTheory.Measure α}
[MeasurableMul M]
(hf : AEMeasurable f μ)
(c : M)


theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
    (∫ x in a..b, Complex.exp (c * x)) = (Complex.exp (c * b) - Complex.exp (c * a)) / c

∫ (x : ℝ) in a..b, Complex.exp (c * ↑x) = (Complex.exp (c * ↑b) - Complex.exp (c * ↑a)) / c


@[simp]
theorem pre_id (A : C) [Exponentiable A] : pre (𝟙 A) = 𝟙 _

CategoryTheory.pre (CategoryTheory.CategoryStruct.id A) = CategoryTheory.CategoryStruct.id (CategoryTheory.exp A)


theorem support_monomial_subset : (monomial s a).support ⊆ {s}

{R : Type u}
{σ : Type u_1}
{a : R}
{s : σ →₀ ℕ}
[CommSemiring R]

((MvPolynomial.monomial s) a).support ⊆ {s}


theorem _root_.fourierIntegral_gaussian (hb : 0 < b.re) (t : ℂ) :
    ∫ x : ℝ, cexp (I * t * x) * cexp (-b * x ^ 2) =
    (π / b) ^ (1 / 2 : ℂ) * cexp (-t ^ 2 / (4 * b))


/-- **Kolmogorov's 0-1 law** : any event in the tail σ-algebra of an independent sequence of
sub-σ-algebras has probability 0 or 1. -/
theorem measure_zero_or_one_of_measurableSet_limsup_atBot (h_le : ∀ n, s n ≤ m0)
    (h_indep : iIndep s μ) {t : Set Ω} (ht_tail : MeasurableSet[limsup s atBot] t) :
    μ t = 0 ∨ μ t = 1

(h_indep : ProbabilityTheory.iIndep s μ)


/-- If you do not localize at any zero-divisors, localization preserves cardinality. -/
theorem card (hS : S ≤ R⁰) : #R = #L

{R : Type u}
[CommRing R]
(S : Submonoid R)
(L : Type u)
[CommRing L]
[Algebra R L]
[IsLocalization S L]
(hS : S ≤ R⁰)


@[to_additive] lemma eq_iff_eq_of_mul_eq_mul (h : a * b = c * d) : a = c ↔ b = d

{α : Type u_1}
[AddCancelCommMonoid α]
{a b c d : α}
(h : a + b = c + d)


theorem instPartialOrder.dual_dual (α : Type*) [H : PartialOrder α] :
    OrderDual.instPartialOrder αᵒᵈ = H


@[to_additive zsmul_neg]
lemma inv_zpow (a : α) : ∀ n : ℤ, a⁻¹ ^ n = (a ^ n)⁻¹

{α : Type u_1}
[DivisionMonoid α]
(a : α)
(n : ℤ)


theorem slope_comm (f : k → PE) (a b : k) : slope f a b = slope f b a

{k : Type u_1}
{E : Type u_2}
{PE : Type u_3}
[Field k]
[AddCommGroup E]
[Module k E]
[AddTorsor E PE]
(f : k → PE)
(a b : k)


@[simp]
theorem pullbackConeOfLeftIso_x : (pullbackConeOfLeftIso f g).pt = Y

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

(CategoryTheory.Limits.pullbackConeOfLeftIso f g).pt = Y


theorem ext {A B : StructuredArrow S T} (f g : A ⟶ B) : f.right = g.right → f = g

{A B : CategoryTheory.StructuredArrow S T}


theorem prod_sup_prod : s₁ ×ˢ t₁ ⊔ s₂ ×ˢ t₂ = (s₁ ⊔ s₂) ×ˢ (t₁ ⊔ t₂)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(s₁ s₂ : UpperSet α)
(t₁ t₂ : UpperSet β)


@[simp]
theorem compContinuous_apply {δ : Type*} [TopologicalSpace δ] (f : α →ᵇ β) (g : C(δ, α)) (x : δ) :
    f.compContinuous g x = f (g x)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{δ : Type u_2}
[TopologicalSpace δ]
(f : BoundedContinuousFunction α β)
(g : C(δ, α))
(x : δ)


theorem Surjective.injective_comp_right (hf : Surjective f) : Injective fun g : β → γ ↦ g ∘ f

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
(hf : Function.Surjective f)


lemma arccos_eq_of_eq_cos (hy₀ : 0 ≤ y) (hy₁ : y ≤ π) (hxy : x = cos y) : arccos x = y

{x y : ℝ}
(hy₀ : 0 ≤ y)
(hy₁ : y ≤ π)
(hxy : x = Real.cos y)


theorem continuousAt_extend_symm' {x : E} (h : x ∈ (f.extend I).target) :
    ContinuousAt (f.extend I).symm x

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)
{x : E}
(h : x ∈ (f.extend I).target)


@[simp] lemma natDegree_mul_X (hp : p ≠ 0) : natDegree (p * X) = natDegree p + 1

{R : Type u}
[Semiring R]
[Nontrivial R]
{p : R[X]}
(hp : p ≠ 0)

(p * Polynomial.X).natDegree = p.natDegree + 1


@[simp]
lemma image_subtype_val_Ioo_Ici {a b : α} (c : Ioo a b) : Subtype.val '' Ici c = Ico c.1 b

{α : Type u_1}
[Preorder α]
{a b : α}
(c : ↑(Set.Ioo a b))

Subtype.val '' Set.Ici c = Set.Ico (↑c) b


/-- If `edist (f n) (f (n+1))` is bounded above by a function `d : ℕ → ℝ≥0∞`,
then the distance from `f 0` to the limit is bounded by `∑'_{k=0}^∞ d k`. -/
theorem edist_le_tsum_of_edist_le_of_tendsto₀ {f : ℕ → α} (d : ℕ → ℝ≥0∞)
    (hf : ∀ n, edist (f n) (f n.succ) ≤ d n) {a : α} (ha : Tendsto f atTop (𝓝 a)) :
    edist (f 0) a ≤ ∑' m, d m

(d : ℕ → ℝ≥0∞)

(hf : ∀ (n : ℕ), edist (f n) (f n.succ) ≤ d n)

(ha : Filter.Tendsto f Filter.atTop (𝓝 a))


theorem QuotedDefEq.rfl {u : Level} {α : Q(Sort u)} {a : Q($α)} : @QuotedDefEq u α a a

{u : Lean.Level}
{α : Q(Sort u)}
{a : Q(«$α»)}


/-- The typeclass `IsLocalization (M : Submonoid R) S` where `S` is an `R`-algebra
expresses that `S` is isomorphic to the localization of `R` at `M`. -/
@[mk_iff] class IsLocalization : Prop where
  -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit.
  /-- Everything in the image of `algebraMap` is a unit -/
  map_units' : ∀ y : M, IsUnit (algebraMap R S y)
  /-- The `algebraMap` is surjective -/
  surj' : ∀ z : S, ∃ x : R × M, z * algebraMap R S x.2 = algebraMap R S x.1
  /-- The kernel of `algebraMap` is contained in the annihilator of `M`;
      it is then equal to the annihilator by `map_units'` -/
  exists_of_eq : ∀ {x y}, algebraMap R S x = algebraMap R S y → ∃ c : M, ↑c * x = ↑c * y

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[self : IsLocalization M S]
(y : ↥M)


@[simp] theorem disjoint_append_right : Disjoint l (l₁ ++ l₂) ↔ Disjoint l l₁ ∧ Disjoint l l₂

∀ {α : Type u_1} {l l₁ l₂ : List α}, l.Disjoint (l₁ ++ l₂) ↔ l.Disjoint l₁ ∧ l.Disjoint l₂


/-- An algebraic integer whose conjugates are all of norm one is a root of unity. -/
theorem pow_eq_one_of_norm_eq_one {x : K} (hxi : IsIntegral ℤ x) (hx : ∀ φ : K →+* A, ‖φ x‖ = 1) :
    ∃ (n : ℕ) (_ : 0 < n), x ^ n = 1

(K : Type u_1)
[Field K]
[NumberField K]
(A : Type u_2)
[NormedField A]
[IsAlgClosed A]
[NormedAlgebra ℚ A]
{x : K}
(hxi : IsIntegral ℤ x)
(hx : ∀ (φ : K →+* A), ‖φ x‖ = 1)


lemma nil_ne_cons (p : Path a b) (e : b ⟶ a) : Path.nil ≠ p.cons e

{V : Type u}
[Quiver V]
{a b : V}
(p : Quiver.Path a b)
(e : b ⟶ a)


@[to_additive]
theorem mem_list_prod {l : List (Set α)} {a : α} :
    a ∈ l.prod ↔
      ∃ l' : List (Σs : Set α, ↥s),
        List.prod (l'.map fun x ↦ (Sigma.snd x : α)) = a ∧ l'.map Sigma.fst = l

{α : Type u_2}
[Monoid α]
{l : List (Set α)}
{a : α}

a ∈ l.prod ↔ ∃ l', (List.map (fun x => ↑x.snd) l').prod = a ∧ List.map Sigma.fst l' = l


@[simp] theorem natAbs_dvd_natAbs {a b : Int} : natAbs a ∣ natAbs b ↔ a ∣ b


@[simp]
theorem mk_inf_mk [Inf α] [Inf β] (a₁ a₂ : α) (b₁ b₂ : β) :
    (a₁, b₁) ⊓ (a₂, b₂) = (a₁ ⊓ a₂, b₁ ⊓ b₂)

(α : Type u)
(β : Type v)
[Inf α]
[Inf β]
(a₁ a₂ : α)
(b₁ b₂ : β)


theorem smul_Iic : r • Iic a = Iic (r • a)

{K : Type u_2}
[LinearOrderedField K]
{a r : K}
(hr : 0 < r)


theorem disjoint_sSup_iff {s : Set α} : Disjoint a (sSup s) ↔ ∀ b ∈ s, Disjoint a b

{α : Type u}
[Order.Frame α]
{a : α}
{s : Set α}


@[simp]
lemma tendsto_image_smallSets {f : α → β} :
    Tendsto (f '' ·) la.smallSets lb.smallSets ↔ Tendsto f la lb

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

Filter.Tendsto (fun x => f '' x) la.smallSets lb.smallSets ↔ Filter.Tendsto f la lb


lemma IsPushout.map (h : sq.IsPushout) (F : C ⥤ D) [PreservesColimit (span sq.f₁₂ sq.f₁₃) F] :
    (sq.map F).IsPushout

[CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.span sq.f₁₂ sq.f₁₃) F]


@[reassoc (attr := simp)]
lemma inlX_fstX (i j : ι ) (hij : c.Rel j i) :
    inlX φ i j hij ≫ fstX φ j i hij = 𝟙 _

HomologicalComplex.homotopyCofiber.inlX φ i j hij ≫ HomologicalComplex.homotopyCofiber.fstX φ j i hij = 𝟙 (F.X i)


protected theorem coe_mul (x y : S) : (↑(x * y) : A) = ↑x * ↑y

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)
(x y : ↥S)


theorem map_comp_eq (F : E ⥤ D) (G : D ⥤ C) : map (F ⋙ G) = map F ⋙ map G

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

CategoryTheory.ThinSkeleton.map (F.comp G) =
  (CategoryTheory.ThinSkeleton.map F).comp (CategoryTheory.ThinSkeleton.map G)


/-- The ring of submodules of the opposite algebra is isomorphic to the opposite ring of
submodules. -/
@[simps apply symm_apply]
def equivOpposite : Submodule R Aᵐᵒᵖ ≃+* (Submodule R A)ᵐᵒᵖ

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(p : (Submodule R A)ᵐᵒᵖ)

Submodule.equivOpposite.symm p = Submodule.comap (↑(MulOpposite.opLinearEquiv R).symm) (MulOpposite.unop p)


theorem gcd_eq_right {i j : ℤ} (H : j ∣ i) : gcd i j = natAbs j


@[simp] theorem add_ofFin (x : BitVec n) (y : Fin (2^n)) :
  x + .ofFin y = .ofFin (x.toFin + y)

{n : Nat}
(x : BitVec n)
(y : Fin (2 ^ n))

x + { toFin := y } = { toFin := x.toFin + y }


theorem gcd_greatest {a b d : ℕ} (hda : d ∣ a) (hdb : d ∣ b) (hd : ∀ e : ℕ, e ∣ a → e ∣ b → e ∣ d) :
    d = a.gcd b

{a b d : ℕ}
(hda : d ∣ a)
(hdb : d ∣ b)
(hd : ∀ (e : ℕ), e ∣ a → e ∣ b → e ∣ d)


/-- If `f` is integrable, then `∫ x in s, f x ∂μ` is absolutely continuous in `s`: it tends
to zero as `μ s` tends to zero. -/
theorem Integrable.tendsto_setIntegral_nhds_zero {ι} {f : α → G} (hf : Integrable f μ)
    {l : Filter ι} {s : ι → Set α} (hs : Tendsto (μ ∘ s) l (𝓝 0)) :
    Tendsto (fun i => ∫ x in s i, f x ∂μ) l (𝓝 0)

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{ι : Type u_6}
{f : α → G}
(hf : MeasureTheory.Integrable f μ)
{l : Filter ι}
{s : ι → Set α}
(hs : Filter.Tendsto (⇑μ ∘ s) l (𝓝 0))

Filter.Tendsto (fun i => ∫ (x : α) in s i, f x ∂μ) l (𝓝 0)


lemma map_preNormEDS (n : ℤ) : f (preNormEDS b c d n) = preNormEDS (f b) (f c) (f d) n

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
(f : R →+* S)
(b c d : R)
(n : ℤ)


/-- In a Polish space, a set is clopenable if and only if it is Borel-measurable. -/
theorem isClopenable_iff_measurableSet
    [tγ : TopologicalSpace γ] [PolishSpace γ] [MeasurableSpace γ] [BorelSpace γ] :
    IsClopenable s ↔ MeasurableSet s

{γ : Type u_3}
{s : Set γ}
[tγ : TopologicalSpace γ]
[PolishSpace γ]
[MeasurableSpace γ]
[BorelSpace γ]

PolishSpace.IsClopenable s ↔ MeasurableSet s


/-- The normal closure of the 5-cycle `finRotate 5` within $A_5$ is the whole group. This will be
  used to show that the normal closure of any 5-cycle within $A_5$ is the whole group. -/
theorem normalClosure_finRotate_five : normalClosure ({⟨finRotate 5,
    finRotate_bit1_mem_alternatingGroup (n := 2)⟩} : Set (alternatingGroup (Fin 5))) = ⊤

Subgroup.normalClosure {⟨finRotate 5, ⋯⟩} = ⊤


theorem SuperpolynomialDecay.mul_polynomial [ContinuousAdd β] [ContinuousMul β]
    (hf : SuperpolynomialDecay l k f) (p : β[X]) :
    SuperpolynomialDecay l k fun x => f x * (p.eval <| k x)

(hf : Asymptotics.SuperpolynomialDecay l k f)

Asymptotics.SuperpolynomialDecay l k fun x => f x * Polynomial.eval (k x) p


theorem coeff_C [DecidableEq σ] (n : σ →₀ ℕ) (a : R) :
    coeff R n (C σ R a) = if n = 0 then a else 0

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
[DecidableEq σ]
(n : σ →₀ ℕ)
(a : R)

(MvPowerSeries.coeff R n) ((MvPowerSeries.C σ R) a) = if n = 0 then a else 0


@[simp]
theorem curryLeft_compLinearMap {n : ℕ} (g : M₂'' →ₗ[R'] M'')
    (f : M'' [⋀^Fin n.succ]→ₗ[R'] N'') (m : M₂'') :
    (f.compLinearMap g).curryLeft m = (f.curryLeft (g m)).compLinearMap g

{R' : Type u_10}
{M'' : Type u_11}
{M₂'' : Type u_12}
{N'' : Type u_13}
[CommSemiring R']
[AddCommMonoid M'']
[AddCommMonoid M₂'']
[AddCommMonoid N'']
[Module R' M'']
[Module R' M₂'']
[Module R' N'']
{n : ℕ}
(g : M₂'' →ₗ[R'] M'')
(f : M'' [⋀^Fin n.succ]→ₗ[R'] N'')
(m : M₂'')


@[simp]
lemma KaehlerDifferential.polynomialEquiv_symm (P) :
    (polynomialEquiv R).symm P = P • D R R[X] X

(R : Type u)
[CommRing R]
(P : Polynomial R)

(KaehlerDifferential.polynomialEquiv R).symm P = P • (KaehlerDifferential.D R (Polynomial R)) Polynomial.X


/-- Constructor for a functor that is isomorphic to a given functor `F : C ⥤ D`,
while being definitionally equal on objects to a given map `obj : C → D`
such that for all `X : C`, we have an isomorphism `F.obj X ≅ obj X`. -/
@[simps obj]
def copyObj : C ⥤ D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
(obj : C → D)
(e : (X : C) → F.obj X ≅ obj X)

∀ (a : C), (F.copyObj obj e).obj a = obj a


protected theorem lipschitz : LipschitzWith 1 f

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


theorem Coindep.exists_subset_compl_base (h : M.Coindep X) : ∃ B, M.Base B ∧ X ⊆ M.E \ B

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


@[to_additive]
lemma mul_self (x : G) : x * x = 1

{G : Type u_1}
[AddGroup G]
[IsAddKleinFour G]
(x : G)


/-- The submonoid of elements greater than `1`. -/
@[to_additive (attr := simps) nonneg "The submonoid of nonnegative elements."]
def oneLE : Submonoid M

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


@[to_additive (attr := simp)] lemma one_ne_bot : (1 : WithBot α) ≠ ⊥


/-- Path composition commutes with products -/
theorem trans_prod_eq_prod_trans (γ₁ : Path a₁ a₂) (δ₁ : Path a₂ a₃) (γ₂ : Path b₁ b₂)
    (δ₂ : Path b₂ b₃) : (γ₁.prod γ₂).trans (δ₁.prod δ₂) = (γ₁.trans δ₁).prod (γ₂.trans δ₂)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{a₁ a₂ a₃ : X}
{b₁ b₂ b₃ : Y}
(γ₁ : Path a₁ a₂)
(δ₁ : Path a₂ a₃)
(γ₂ : Path b₁ b₂)
(δ₂ : Path b₂ b₃)


theorem sum_nonneg (x : M) : 0 ≤ ∑ᶠ i, f i x

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(f : SmoothPartitionOfUnity ι I M s)
(x : M)


@[to_additive]
theorem lipschitzOnWith_iff_norm_div_le {f : E → F} {C : ℝ≥0} :
    LipschitzOnWith C f s ↔ ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → ‖f x / f y‖ ≤ C * ‖x / y‖

{E : Type u_3}
{F : Type u_4}
[SeminormedGroup E]
[SeminormedGroup F]
{s : Set E}
{f : E → F}
{C : ℝ≥0}

LipschitzOnWith C f s ↔ ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃y : E⦄, y ∈ s → ‖f x / f y‖ ≤ ↑C * ‖x / y‖


theorem _root_.Finset.coe_infsep [DecidableEq α] (s : Finset α) : (s : Set α).infsep =
    if hs : s.offDiag.Nonempty then s.offDiag.inf' hs (uncurry dist) else 0

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

(↑s).infsep = if hs : s.offDiag.Nonempty then s.offDiag.inf' hs (Function.uncurry dist) else 0


theorem Icc_ssubset_Icc_left (hI : a₂ ≤ b₂) (ha : a₂ < a₁) (hb : b₁ ≤ b₂) : Icc a₁ b₁ ⊂ Icc a₂ b₂

{α : Type u_1}
[Preorder α]
{a₁ a₂ b₁ b₂ : α}
(hI : a₂ ≤ b₂)
(ha : a₂ < a₁)
(hb : b₁ ≤ b₂)


theorem mem_nhdsWithin_Ici_iff_exists_mem_Ioc_Ico_subset {a u' : α} {s : Set α} (hu' : a < u') :
    s ∈ 𝓝[≥] a ↔ ∃ u ∈ Ioc a u', Ico a u ⊆ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a u' : α}
{s : Set α}
(hu' : a < u')

s ∈ 𝓝[≥] a ↔ ∃ u ∈ Set.Ioc a u', Set.Ico a u ⊆ s


@[simp]
theorem Equiv.optionCongr_sign {α : Type*} [DecidableEq α] [Fintype α] (e : Perm α) :
    Perm.sign e.optionCongr = Perm.sign e

{α : Type u_1}
[DecidableEq α]
[Fintype α]
(e : Equiv.Perm α)

Equiv.Perm.sign (Equiv.optionCongr e) = Equiv.Perm.sign e


@[to_additive (attr := simp)]
theorem lift_mk {φ : G →* M} (HN : N ≤ φ.ker) (g : G) : lift N φ HN (g : Q) = φ g

{G : Type u}
[AddGroup G]
(N : AddSubgroup G)
[nN : N.Normal]
{M : Type x}
[AddMonoid M]
{φ : G →+ M}
(HN : N ≤ φ.ker)
(g : G)


/-- An antitone function between (conditionally) complete linear ordered spaces sends a
`Filter.limsSup` to the `Filter.liminf` of the image if the function is continuous at the `limsSup`
(and the filter is bounded from above and frequently bounded from below). -/
theorem Antitone.map_limsSup_of_continuousAt {F : Filter R} [NeBot F] {f : R → S}
    (f_decr : Antitone f) (f_cont : ContinuousAt f F.limsSup)
    (bdd_above : F.IsBounded (· ≤ ·) := by isBoundedDefault)
    (cobdd : F.IsCobounded (· ≤ ·) := by isBoundedDefault) :
    f F.limsSup = F.liminf f

(bdd_above : Filter.IsBounded (fun x x_1 => x ≤ x_1) F := by isBoundedDefault)

(cobdd : Filter.IsCobounded (fun x x_1 => x ≤ x_1) F := by isBoundedDefault)


theorem induction_on_adjoin [FiniteDimensional F E] (P : IntermediateField F E → Prop)
    (base : P ⊥) (ih : ∀ (K : IntermediateField F E) (x : E), P K → P (K⟮x⟯.restrictScalars F))
    (K : IntermediateField F E) : P K

(ih : ∀ (K : IntermediateField F E) (x : E), P K → P (IntermediateField.restrictScalars F (↥K)⟮x⟯))


@[to_additive]
theorem contMDiffWithinAt_finprod (lf : LocallyFinite fun i ↦ mulSupport <| f i) {x₀ : M}
    (h : ∀ i, ContMDiffWithinAt I' I n (f i) s x₀) :
    ContMDiffWithinAt I' I n (fun x ↦ ∏ᶠ i, f i x) s x₀

(lf : LocallyFinite fun i => Function.support (f i))

(h : ∀ (i : ι), ContMDiffWithinAt I' I n (f i) s x₀)

ContMDiffWithinAt I' I n (fun x => ∑ᶠ (i : ι), f i x) s x₀


@[simp]
theorem vonMangoldt_apply_one : Λ 1 = 0


lemma integrable_gaussianPDFReal (μ : ℝ) (v : ℝ≥0) :
    Integrable (gaussianPDFReal μ v)

MeasureTheory.Integrable (ProbabilityTheory.gaussianPDFReal μ v) MeasureTheory.volume


/-- If `B` is a block containing `a`, then the stabilizer of `B` contains the stabilizer of `a` -/
theorem IsBlock.stabilizer_le {B : Set X} (hB : IsBlock G B) {a : X} (ha : a ∈ B) :
    stabilizer G a ≤ stabilizer G B

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{B : Set X}
(hB : MulAction.IsBlock G B)
{a : X}
(ha : a ∈ B)

MulAction.stabilizer G a ≤ MulAction.stabilizer G B


lemma primeSpectrumProd_symm_inr (x) :
    (primeSpectrumProd R S).symm (.inr x) = comap (RingHom.snd R S) x

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
(x : PrimeSpectrum S)

(PrimeSpectrum.primeSpectrumProd R S).symm (Sum.inr x) = (PrimeSpectrum.comap (RingHom.snd R S)) x


/-- A completion of `α` is the data of a complete separated uniform space (from the same universe)
and a map from `α` with dense range and inducing the original uniform structure on `α`. -/
structure AbstractCompletion (α : Type u) [UniformSpace α] where
  /-- The underlying space of the completion. -/
  space : Type u
  /-- A map from a space to its completion. -/
  coe : α → space
  /-- The completion carries a uniform structure. -/
  uniformStruct : UniformSpace space
  /-- The completion is complete. -/
  complete : CompleteSpace space
  /-- The completion is a T₀ space. -/
  separation : T0Space space
  /-- The map into the completion is uniform-inducing. -/
  uniformInducing : UniformInducing coe
  /-- The map into the completion has dense range. -/
  dense : DenseRange coe

{α : Type u}
[UniformSpace α]
(self : AbstractCompletion α)


protected theorem mul_comm (x y : BitVec w) : x * y = y * x


@[simp]
theorem map_comp_ι (f : Q₁ →qᵢ Q₂) :
    (map f).toLinearMap ∘ₗ ι Q₁ = ι Q₂ ∘ₗ f.toLinearMap

{R : Type u_1}
[CommRing R]
{M₁ : Type u_4}
{M₂ : Type u_5}
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
{Q₁ : QuadraticForm R M₁}
{Q₂ : QuadraticForm R M₂}
(f : Q₁ →qᵢ Q₂)

(CliffordAlgebra.map f).toLinearMap ∘ₗ CliffordAlgebra.ι Q₁ = CliffordAlgebra.ι Q₂ ∘ₗ f.toLinearMap


theorem divX_C_mul_X_pow : divX (C a * X ^ n) = if n = 0 then 0 else C a * X ^ (n - 1)

{R : Type u}
{a : R}
{n : ℕ}
[Semiring R]

(Polynomial.C a * Polynomial.X ^ n).divX = if n = 0 then 0 else Polynomial.C a * Polynomial.X ^ (n - 1)


/-- Two points are collinear. -/
theorem collinear_pair (p₁ p₂ : P) : Collinear k ({p₁, p₂} : Set P)

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(p₁ p₂ : P)


/-- 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 : CategoryTheory.Comma L R₁)

((CategoryTheory.Comma.mapRightIso L i).unitIso.inv.app X).left = CategoryTheory.CategoryStruct.id X.left


/-- (Impl) A preliminary definition to avoid timeouts. -/
@[simps]
def conesEquivFunctor (B : C) {J : Type w} (F : Discrete J ⥤ Over B) :
    Cone (widePullbackDiagramOfDiagramOver B F) ⥤ Cone F

(F : CategoryTheory.Discrete J ⥤ CategoryTheory.Over B)

(c : CategoryTheory.Limits.Cone (CategoryTheory.Over.ConstructProducts.widePullbackDiagramOfDiagramOver B F))

∀ (x : CategoryTheory.Discrete J),
  ((CategoryTheory.Over.ConstructProducts.conesEquivFunctor B F).obj c).π.app x =
    match x with
    | { as := j } => CategoryTheory.Over.homMk (c.π.app (some j)) ⋯


theorem ascPochhammer_eval_succ (r n : ℕ) :
    (n : S) * (ascPochhammer S r).eval (n + 1 : S) =
    (n + r) * (ascPochhammer S r).eval (n : S)

↑n * Polynomial.eval (↑n + 1) (ascPochhammer S r) = (↑n + ↑r) * Polynomial.eval (↑n) (ascPochhammer S r)


@[simp]
theorem untrop_mul [Add R] (x y : Tropical R) : untrop (x * y) = untrop x + untrop y

Tropical.untrop (x * y) = Tropical.untrop x + Tropical.untrop y


theorem coe_subset_coe : (s : Set P) ⊆ t ↔ s ≤ t

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

↑s ⊆ ↑t ↔ s ≤ t


@[simp]
theorem compl_involutive : Function.Involutive (compl : α → α)


theorem mem_closure {x : R} {s : Set R} : x ∈ closure s ↔ ∀ S : NonUnitalSubring R, s ⊆ S → x ∈ S

{R : Type u}
[NonUnitalNonAssocRing R]
{x : R}
{s : Set R}

x ∈ NonUnitalSubring.closure s ↔ ∀ (S : NonUnitalSubring R), s ⊆ ↑S → x ∈ S


@[simp]
theorem not_mem_nil (a : α) : ¬ a ∈ (nil : Sym α 0)


/-- A group of order `p ^ 2` is not cyclic if and only if its exponent is `p`. -/
@[to_additive]
lemma not_isCyclic_iff_exponent_eq_prime [Group α] {p : ℕ} (hp : p.Prime)
    (hα : Nat.card α = p ^ 2) : ¬ IsCyclic α ↔ Monoid.exponent α = p

{α : Type u}
[AddGroup α]
{p : ℕ}
(hp : Nat.Prime p)
(hα : Nat.card α = p ^ 2)

¬IsAddCyclic α ↔ AddMonoid.exponent α = p


@[to_additive]
theorem mem_div : s ∈ f / g ↔ ∃ t₁ ∈ f, ∃ t₂ ∈ g, t₁ / t₂ ⊆ s

{α : Type u_2}
[Sub α]
{f g : Filter α}
{s : Set α}

s ∈ f - g ↔ ∃ t₁ ∈ f, ∃ t₂ ∈ g, t₁ - t₂ ⊆ s


theorem hasBasis_toFilterDistortion (l : IntegrationParams) (I : Box ι) (c : ℝ≥0) :
    (l.toFilterDistortion I c).HasBasis l.RCond fun r => { π | l.MemBaseSet I c r π }

{ι : Type u_1}
[Fintype ι]
(l : BoxIntegral.IntegrationParams)
(I : BoxIntegral.Box ι)
(c : ℝ≥0)

(l.toFilterDistortion I c).HasBasis l.RCond fun r => {π | l.MemBaseSet I c r π}


@[to_additive IsUpperSet.cthickening]
protected theorem IsUpperSet.cthickening' (hs : IsUpperSet s) (ε : ℝ) :
    IsUpperSet (cthickening ε s)

{α : Type u_1}
[NormedOrderedGroup α]
{s : Set α}
(hs : IsUpperSet s)
(ε : ℝ)


theorem affine_of_mapsTo_ball_of_exists_norm_dslope_eq_div' [CompleteSpace E]
    [StrictConvexSpace ℝ E] (hd : DifferentiableOn ℂ f (ball c R₁))
    (h_maps : Set.MapsTo f (ball c R₁) (ball (f c) R₂))
    (h_z₀ : ∃ z₀ ∈ ball c R₁, ‖dslope f c z₀‖ = R₂ / R₁) :
    ∃ C : E, ‖C‖ = R₂ / R₁ ∧ Set.EqOn f (fun z => f c + (z - c) • C) (ball c R₁)

(hd : DifferentiableOn ℂ f (Metric.ball c R₁))

(h_maps : Set.MapsTo f (Metric.ball c R₁) (Metric.ball (f c) R₂))

(h_z₀ : ∃ z₀ ∈ Metric.ball c R₁, ‖dslope f c z₀‖ = R₂ / R₁)

∃ C, ‖C‖ = R₂ / R₁ ∧ Set.EqOn f (fun z => f c + (z - c) • C) (Metric.ball c R₁)


@[simp]
theorem coe_coord_of_subsingleton_eq_one [Subsingleton ι] (i : ι) : (b.coord i : P → k) = 1

{ι : Type u_1}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)
[Subsingleton ι]
(i : ι)


@[reassoc (attr := simp)]
theorem P_f_idem (q n : ℕ) : ((P q).f n : X _[n] ⟶ _) ≫ (P q).f n = (P q).f n

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}
(q n : ℕ)

(AlgebraicTopology.DoldKan.P q).f n ≫ (AlgebraicTopology.DoldKan.P q).f n = (AlgebraicTopology.DoldKan.P q).f n


/-- `rpow` version of `List.prod_map_pow` for `Real`. -/
theorem _root_.Real.list_prod_map_rpow (l : List ℝ) (hl : ∀ x ∈ l, (0 : ℝ) ≤ x) (r : ℝ) :
    (l.map (· ^ r)).prod = l.prod ^ r

(l : List ℝ)
(hl : ∀ x ∈ l, 0 ≤ x)
(r : ℝ)

(List.map (fun x => x ^ r) l).prod = l.prod ^ r


@[simp]
theorem smul_stdBasisMatrix [SMulZeroClass R α] (r : R) (i : m) (j : n) (a : α) :
    r • stdBasisMatrix i j a = stdBasisMatrix i j (r • a)

{m : Type u_2}
{n : Type u_3}
{R : Type u_4}
{α : Type u_5}
[DecidableEq m]
[DecidableEq n]
[Semiring α]
[SMulZeroClass R α]
(r : R)
(i : m)
(j : n)
(a : α)

r • Matrix.stdBasisMatrix i j a = Matrix.stdBasisMatrix i j (r • a)


@[to_additive]
theorem of_injective : Function.Injective (@of α)


@[to_additive]
theorem mulIndicator_const_iff_of_ne (hc : c ≠ 1) :
    EventuallyConst (s.mulIndicator fun _ ↦ c) l ↔ EventuallyConst s l

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
[Zero β]
{s : Set α}
{c : β}
(hc : c ≠ 0)

Filter.EventuallyConst (s.indicator fun x => c) l ↔ Filter.EventuallyConst s l


/-- A sequence of uniformly integrable functions which converges μ-a.e. converges in Lp. -/
theorem tendsto_Lp_finite_of_tendsto_ae [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
    {f : ℕ → α → β} {g : α → β} (hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : Memℒp g p μ)
    (hui : UnifIntegrable f p μ) (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
    Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0)

{f : ℕ → α → β}

(hf : ∀ (n : ℕ), MeasureTheory.AEStronglyMeasurable (f n) μ)

(hui : MeasureTheory.UnifIntegrable f p μ)

(hfg : ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 (g x)))

Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - g) p μ) Filter.atTop (𝓝 0)


@[simp]
lemma map_const (μ : Measure α) {f : α → β} (hf : Measurable f) :
    map (const γ μ) f hf = const γ (μ.map f)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
(μ : MeasureTheory.Measure α)
{f : α → β}
(hf : Measurable f)

(ProbabilityTheory.Kernel.const γ μ).map f hf = ProbabilityTheory.Kernel.const γ (MeasureTheory.Measure.map f μ)


@[to_additive]
theorem sizeof_of_step : ∀ {L₁ L₂ : List (α × Bool)},
    Step L₁ L₂ → sizeOf L₂ < sizeOf L₁

FreeGroup.Red.Step L₁ L₂ → sizeOf L₂ < sizeOf L₁


lemma succAbove_lt_succAbove_iff : succAbove p i < succAbove p j ↔ i < j


theorem Ico_union_right (hab : a ≤ b) : Ico a b ∪ {b} = Icc a b

{α : Type u_1}
[PartialOrder α]
{a b : α}
(hab : a ≤ b)


theorem composition_card (n : ℕ) : Fintype.card (Composition n) = 2 ^ (n - 1)


@[simp]
theorem comap_id : v.comap (RingHom.id R) = v

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)


protected theorem mul {w x y z} : c w x → c y z → c (w * y) (x * z)

{R : Type u_2}
[Add R]
[Mul R]
(c : RingCon R)
{w x y z : R}


theorem nhds_eq_inf_comap {z : Z} (hz : z ∈ e.source) :
    𝓝 z = comap proj (𝓝 (proj z)) ⊓ comap (Prod.snd ∘ e) (𝓝 (e z).2)

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e : Trivialization F proj)
{z : Z}
(hz : z ∈ e.source)

𝓝 z = Filter.comap proj (𝓝 (proj z)) ⊓ Filter.comap (Prod.snd ∘ ↑e) (𝓝 (↑e z).2)


{R : Type u_1}
{R₁ : Type u_2}
{M : Type u_5}
{M₁ : Type u_6}
[CommSemiring R]
[AddCommGroup M]
[Module R M]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
{I₁ I₂ : R₁ →+* R}
{B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M}
(H : B.IsAlt)


theorem sqrt_le_iff : √x ≤ y ↔ 0 ≤ y ∧ x ≤ y ^ 2


theorem em (p : Prop) [Decidable p] : p ∨ ¬p


lemma iff_appLE : P f ↔ ∀ (U : Y.affineOpens) (V : X.affineOpens) (e), Q (f.appLE U V e)

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

{Q : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop}

P f ↔
  ∀ (U : ↑Y.affineOpens) (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ ↑U), Q (AlgebraicGeometry.Scheme.Hom.appLE f (↑U) (↑V) e)


/-- Suppose that a function `f : ℂ → E` is continuous on a closed rectangle with opposite corners at
`z w : ℂ`, is *real* differentiable on the corresponding open rectangle, and
$\frac{\partial f}{\partial \bar z}$ is integrable on this rectangle. Then the integral of `f` over
the boundary of the rectangle is equal to the integral of
$2i\frac{\partial f}{\partial \bar z}=i\frac{\partial f}{\partial x}-\frac{\partial f}{\partial y}$
over the rectangle. -/
theorem integral_boundary_rect_of_continuousOn_of_hasFDerivAt_real (f : ℂ → E) (f' : ℂ → ℂ →L[ℝ] E)
    (z w : ℂ) (Hc : ContinuousOn f ([[z.re, w.re]] ×ℂ [[z.im, w.im]]))
    (Hd : ∀ x ∈ Ioo (min z.re w.re) (max z.re w.re) ×ℂ Ioo (min z.im w.im) (max z.im w.im),
      HasFDerivAt f (f' x) x)
    (Hi : IntegrableOn (fun z => I • f' z 1 - f' z I) ([[z.re, w.re]] ×ℂ [[z.im, w.im]])) :
    (∫ x : ℝ in z.re..w.re, f (x + z.im * I)) - (∫ x : ℝ in z.re..w.re, f (x + w.im * I)) +
      I • (∫ y : ℝ in z.im..w.im, f (re w + y * I)) -
      I • (∫ y : ℝ in z.im..w.im, f (re z + y * I)) =
      ∫ x : ℝ in z.re..w.re, ∫ y : ℝ in z.im..w.im, I • f' (x + y * I) 1 - f' (x + y * I) I

(Hd : ∀ x ∈ Set.Ioo (min z.re w.re) (max z.re w.re) ×ℂ Set.Ioo (min z.im w.im) (max z.im w.im), HasFDerivAt f (f' x) x)

(Hi :
  MeasureTheory.IntegrableOn (fun z => Complex.I • (f' z) 1 - (f' z) Complex.I) ([[z.re, w.re]] ×ℂ [[z.im, w.im]])
    MeasureTheory.volume)

(((∫ (x : ℝ) in z.re..w.re, f (↑x + ↑z.im * Complex.I)) - ∫ (x : ℝ) in z.re..w.re, f (↑x + ↑w.im * Complex.I)) +
      Complex.I • ∫ (y : ℝ) in z.im..w.im, f (↑w.re + ↑y * Complex.I)) -
    Complex.I • ∫ (y : ℝ) in z.im..w.im, f (↑z.re + ↑y * Complex.I) =
  ∫ (x : ℝ) in z.re..w.re,
    ∫ (y : ℝ) in z.im..w.im, Complex.I • (f' (↑x + ↑y * Complex.I)) 1 - (f' (↑x + ↑y * Complex.I)) Complex.I


theorem support_toSmoothPartitionOfUnity_subset (i : ι) :
    support (fs.toSmoothPartitionOfUnity i) ⊆ support (fs i)

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

Function.support ⇑(fs.toSmoothPartitionOfUnity i) ⊆ Function.support ↑(fs.toFun i)


/-- Two finite cardinals are equal
iff they are equal their `Cardinal.toNat` projections are equal. -/
theorem toNat_eq_iff_eq_of_lt_aleph0 (hc : c < ℵ₀) (hd : d < ℵ₀) :
    toNat c = toNat d ↔ c = d

{c d : Cardinal.{u}}
(hc : c < Cardinal.aleph0)
(hd : d < Cardinal.aleph0)

Cardinal.toNat c = Cardinal.toNat d ↔ c = d


theorem d_comp_ε : (groupCohomology.resolution k G).d 1 0 ≫ ε k G = 0

(groupCohomology.resolution k G).d 1 0 ≫ groupCohomology.resolution.ε k G = 0


@[simp]
theorem distortion_disjUnion (h : Disjoint π₁.iUnion π₂.iUnion) :
    (π₁.disjUnion π₂ h).distortion = max π₁.distortion π₂.distortion

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{π₁ π₂ : BoxIntegral.Prepartition I}
[Fintype ι]
(h : Disjoint π₁.iUnion π₂.iUnion)


theorem repr_eq_iff' {b : Basis ι R M} {f : M ≃ₗ[R] ι →₀ R} :
    b.repr = f ↔ ∀ i, f (b i) = Finsupp.single i 1

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{b : Basis ι R M}
{f : M ≃ₗ[R] ι →₀ R}

b.repr = f ↔ ∀ (i : ι), f (b i) = Finsupp.single i 1


@[simp, norm_cast]
theorem coe_iSup {ι} (s : ι → Opens α) : ((⨆ i, s i : Opens α) : Set α) = ⋃ i, s i

{α : Type u_2}
[TopologicalSpace α]
{ι : Sort u_5}
(s : ι → TopologicalSpace.Opens α)


theorem mult_log_place_eq_zero {x : (𝓞 K)ˣ} {w : InfinitePlace K} :
    mult w * Real.log (w x) = 0 ↔ w x = 1

{K : Type u_1}
[Field K]
{x : (𝓞 K)ˣ}
{w : NumberField.InfinitePlace K}

↑w.mult * Real.log (w ((algebraMap (𝓞 K) K) ↑x)) = 0 ↔ w ((algebraMap (𝓞 K) K) ↑x) = 1


@[to_additive] lemma le_mabs_self (a : α) : a ≤ |a|ₘ

{α : Type u_1}
[Lattice α]
[Group α]
(a : α)


theorem IsRelPrime.of_dvd_left (h : IsRelPrime y z) (dvd : x ∣ y) : IsRelPrime x z

{α : Type u_1}
[CommMonoid α]
{x y z : α}
(h : IsRelPrime y z)
(dvd : x ∣ y)


lemma weightSpace_weightSpaceOf_map_incl (x : L) (χ : L → R) :
    (weightSpace (weightSpaceOf M (χ x) x) χ).map (weightSpaceOf M (χ x) x).incl =
    weightSpace M χ

{R : Type u_2}
{L : Type u_3}
{M : Type u_4}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x : L)
(χ : L → R)

LieSubmodule.map (LieModule.weightSpaceOf M (χ x) x).incl
    (LieModule.weightSpace (↥↑(LieModule.weightSpaceOf M (χ x) x)) χ) =
  LieModule.weightSpace M χ


/-- Adding a group element then subtracting the original point
produces that group element. -/
@[simp]
theorem vadd_vsub (g : G) (p : P) : g +ᵥ p -ᵥ p = g

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[T : AddTorsor G P]
(g : G)
(p : P)


theorem image₂_union_right [DecidableEq β] : image₂ f s (t ∪ t') = image₂ f s t ∪ image₂ f s t'

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t t' : Finset β}
[DecidableEq β]

Finset.image₂ f s (t ∪ t') = Finset.image₂ f s t ∪ Finset.image₂ f s t'


/-- The cocone for `CostructuredArrow.proj L Y ⋙ F` attached to `E : LeftExtension L F`.
The point of this cocone is `E.right.obj Y` -/
@[simps]
def coconeAt (Y : D) : Cocone (CostructuredArrow.proj L Y ⋙ F)

(g : CategoryTheory.CostructuredArrow L Y)

(E.coconeAt Y).ι.app g = CategoryTheory.CategoryStruct.comp (E.hom.app g.left) (E.right.map g.hom)


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

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

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


theorem log_pos_iff (hx : 0 < x) : 0 < log x ↔ 1 < x


theorem measurable_lineDeriv [MeasurableSpace F] [BorelSpace F]
    (hf : Continuous f) : Measurable (fun x ↦ lineDeriv 𝕜 f x v)

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


/-- The reification of a positive literal `¬⟦a⟧_v ≡ ¬a`. -/
theorem Literal.reify_pos {a : Prop} {n : ℕ} (h : v n ↔ a) : (Literal.pos n).reify v ¬a

{v : Sat.Valuation}
{a : Prop}
{n : ℕ}
(h : v n ↔ a)

Sat.Literal.reify v (Sat.Literal.pos n) ¬a


@[simp]
protected theorem map_add {F} [Add β] [FunLike F α β] [AddHomClass F α β]
    (f : F) (a b : WithTop α) :
    (a + b).map f = a.map f + b.map f

{α : Type u}
{β : Type v}
[Add α]
{F : Type u_1}
[Add β]
[FunLike F α β]
[AddHomClass F α β]
(f : F)
(a b : WithTop α)

WithTop.map (⇑f) (a + b) = WithTop.map (⇑f) a + WithTop.map (⇑f) b


theorem _root_.QuotientMap.separableSpace [SeparableSpace α] [TopologicalSpace β] {f : α → β}
    (hf : QuotientMap f) : SeparableSpace β

{α : Type u}
{β : Type u_1}
[t : TopologicalSpace α]
[TopologicalSpace.SeparableSpace α]
[TopologicalSpace β]
{f : α → β}
(hf : QuotientMap f)


theorem finPiFinEquiv_single {m : ℕ} {n : Fin m → ℕ} [∀ i, NeZero (n i)] (i : Fin m)
    (j : Fin (n i)) :
    (finPiFinEquiv (Pi.single i j : ∀ i : Fin m, Fin (n i)) : ℕ) =
      j * ∏ j, n (Fin.castLE i.is_lt.le j)

{m : ℕ}
{n : Fin m → ℕ}
[∀ (i : Fin m), NeZero (n i)]
(i : Fin m)
(j : Fin (n i))

↑(finPiFinEquiv (Pi.single i j)) = ↑j * ∏ j : Fin ↑i, n (Fin.castLE ⋯ j)


@[measurability]
theorem measurableSet_eq {a : α} : MeasurableSet { x | x = a }

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSingletonClass α]
{a : α}


/-- We may construct a glue data from a family of open sets. -/
@[simps! toGlueData_J toGlueData_U toGlueData_V toGlueData_t toGlueData_f]
def ofOpenSubsets : TopCat.GlueData.{u}

(i j :
  (TopCat.GlueData.MkCore.mk (fun i => (TopologicalSpace.Opens.toTopCat (TopCat.of α)).obj (U i))
      (fun i j => (TopologicalSpace.Opens.map (U i).inclusion).obj (U j))
      (fun i j => { toFun := fun x => ⟨⟨↑↑x, ⋯⟩, ⋯⟩, continuous_toFun := ⋯ }) ⋯ ⋯ ⋯ ⋯).J)

(TopCat.GlueData.ofOpenSubsets U).t i j = { toFun := fun x => ⟨⟨↑↑x, ⋯⟩, ⋯⟩, continuous_toFun := ⋯ }


theorem strictAntiOn_cos : StrictAntiOn cos (Icc 0 π)

StrictAntiOn Real.cos (Set.Icc 0 Real.pi)


theorem lineDeriv_smul {c : 𝕜} : lineDeriv 𝕜 f x (c • v) = c • lineDeriv 𝕜 f x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{x v : E}
{c : 𝕜}


/-- The Engel subalgebra `Engel R x` consists of
all `y : L` such that `(ad R L x)^n` kills `y` for some `n`.

Engel subalgebras are self-normalizing (`LieSubalgebra.normalizer_engel`),
and minimal ones are nilpotent, hence Cartan subalgebras. -/
@[simps!]
def engel (x : L) : LieSubalgebra R L

(R : Type u_1)
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(x : L)

↑(LieSubalgebra.engel R x) = ⋂ s ∈ fun x_1 => ∀ (a : ℕ), LinearMap.ker ((LieAlgebra.ad R L) x ^ a) ≤ x_1, ↑s


theorem vadd_eq_vadd_iff_sub_eq_vsub {v₁ v₂ : G} {p₁ p₂ : P} :
    v₁ +ᵥ p₁ = v₂ +ᵥ p₂ ↔ v₂ - v₁ = p₁ -ᵥ p₂

{G : Type u_1}
{P : Type u_2}
[AddCommGroup G]
[AddTorsor G P]
{v₁ v₂ : G}
{p₁ p₂ : P}


@[to_additive (attr := simp, norm_cast)]
theorem coe_smul_finset (a : α) (s : Finset β) : ↑(a • s) = a • (↑s : Set β)

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
(a : α)
(s : Finset β)


theorem union_left (hs : Disjoint s u) (ht : Disjoint t u) : Disjoint (s ∪ t) u

{α : Type u_1}
{s t u : Set α}
(hs : Disjoint s u)
(ht : Disjoint t u)


theorem MellinConvergent.comp_mul_left {f : ℝ → E} {s : ℂ} {a : ℝ} (ha : 0 < a) :
    MellinConvergent (fun t => f (a * t)) s ↔ MellinConvergent f s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : ℝ → E}
{s : ℂ}
{a : ℝ}
(ha : 0 < a)


lemma mkDerivation_one_eq_derivative (f : R[X]) : mkDerivation R (1 : R[X]) f = derivative f

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

((Polynomial.mkDerivation R) 1) f = Polynomial.derivative f


/-- If the second of three points is weakly between the other two, and not equal to the first,
the angle at the first point is zero. -/
theorem _root_.Wbtw.angle₂₁₃_eq_zero_of_ne {p₁ p₂ p₃ : P} (h : Wbtw ℝ p₁ p₂ p₃) (hp₂p₁ : p₂ ≠ p₁) :
    ∠ p₂ p₁ p₃ = 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : Wbtw ℝ p₁ p₂ p₃)
(hp₂p₁ : p₂ ≠ p₁)


theorem image_mem_nhdsWithin {x : H} {s : Set H} (hs : s ∈ 𝓝 x) : I '' s ∈ 𝓝[range I] I x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{x : H}
{s : Set H}
(hs : s ∈ 𝓝 x)


{I : Type u_4}
[AddMonoid I]
(c : ComplexShape I)
[c.TensorSigns]


@[to_additive]
theorem tprod_mul (hf : Multipliable f) (hg : Multipliable g) :
    ∏' b, (f b * g b) = (∏' b, f b) * ∏' b, g b

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f g : β → α}
[T2Space α]
[ContinuousAdd α]
(hf : Summable f)
(hg : Summable g)


/-- The categorical equivalence between `C` and `ULift C`. -/
@[simps]
def ULift.equivalence : C ≌ ULift.{u₂} C

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


theorem card_le_of_embedding [Finite β] (f : α ↪ β) : Nat.card α ≤ Nat.card β

{α : Type u_1}
{β : Type u_2}
[Finite β]
(f : α ↪ β)


@[simp]
theorem comap_fst_neBot_iff {f : Filter α} :
    (f.comap (Prod.fst : α × β → α)).NeBot ↔ f.NeBot ∧ Nonempty β

{α : Type u}
{β : Type v}
{f : Filter α}

(Filter.comap Prod.fst f).NeBot ↔ f.NeBot ∧ Nonempty β


/-- The `NormalWord` representing an element `g` of the group `G`, which is just the element `g`
itself. -/
@[simps]
def ofGroup (g : G) : NormalWord d

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

(HNNExtension.NormalWord.ofGroup g).head = g


theorem image_core_gc : GaloisConnection r.image r.core

{α : Type u_1}
{β : Type u_2}
(r : Rel α β)


lemma cfcₙ_comp' (g f : R → R) (a : A)
    (hg : ContinuousOn g (f '' σₙ R a) := by cfc_cont_tac) (hg0 : g 0 = 0 := by cfc_zero_tac)
    (hf : ContinuousOn f (σₙ R a) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac)
    (ha : p a := by cfc_tac) :
    cfcₙ (g <| f ·) a = cfcₙ g (cfcₙ f a)

cfcₙ (fun x => g (f x)) a = cfcₙ g (cfcₙ f a)


theorem IsRat.to_raw_eq {n : ℤ} {d : ℕ} [DivisionRing α] :
    ∀ {a}, IsRat (a : α) n d → a = Rat.rawCast n d

{α : Type u}
{n : ℤ}
{d : ℕ}
[DivisionRing α]
{a : α}

Mathlib.Meta.NormNum.IsRat a n d → a = Rat.rawCast n d


theorem isSkewAdjoint_iff_neg_self_adjoint (f : Module.End R M) :
    B.IsSkewAdjoint f ↔ IsAdjointPair (-B) B f f

{R : Type u_1}
{M : Type u_5}
{M₂ : Type u_7}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₂]
[Module R M₂]
{B : M →ₗ[R] M →ₗ[R] M₂}
(f : Module.End R M)

B.IsSkewAdjoint f ↔ (-B).IsAdjointPair B f f


theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs)

{α : Type u}
{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
(xs : t α)

Traversable.toList xs = FreeMonoid.toList (Traversable.foldMap FreeMonoid.of xs)


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

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


@[simp]
theorem repr_scale (x) [NF x] (o) [NF o] : repr (scale x o) = ω ^ repr x * repr o


theorem toL1_add (f g : α → β) (hf : Integrable f μ) (hg : Integrable g μ) :
    toL1 (f + g) (hf.add hg) = toL1 f hf + toL1 g hg

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
(f g : α → β)
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)

MeasureTheory.Integrable.toL1 (f + g) ⋯ = MeasureTheory.Integrable.toL1 f hf + MeasureTheory.Integrable.toL1 g hg


theorem union_sdiff_of_subset (h : s ⊆ t) : s ∪ t \ s = t

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


theorem trailingDegree_one_le : (0 : ℕ∞) ≤ trailingDegree (1 : R[X])


@[to_additive]
theorem add_comp (f : F →* E) : (p + q).comp f = p.comp f + q.comp f

{E : Type u_4}
{F : Type u_5}
[Group E]
[Group F]
(p q : GroupSeminorm E)
(f : F →* E)


lemma exact_of_comp_of_mem_range
    (h1 : g.comp f = 0) (h2 : ∀ x, g x = 0 → x ∈ range f) : Exact f g

{M : Type u_2}
{N : Type u_4}
{P : Type u_6}
[AddGroup M]
[AddGroup N]
[AddGroup P]
{f : M →+ N}
{g : N →+ P}
(h1 : g.comp f = 0)
(h2 : ∀ (x : N), g x = 0 → x ∈ f.range)


@[simp]
theorem Ico_mem_nhds_iff [NoMinOrder α] {a b x : α} : Ico a b ∈ 𝓝 x ↔ x ∈ Ioo a b

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMinOrder α]
{a b x : α}


theorem blimsup_congr {f : Filter β} {u v : β → α} {p : β → Prop} (h : ∀ᶠ a in f, p a → u a = v a) :
    blimsup u f p = blimsup v f p

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
{f : Filter β}
{u v : β → α}
{p : β → Prop}
(h : ∀ᶠ (a : β) in f, p a → u a = v a)

Filter.blimsup u f p = Filter.blimsup v f p


theorem Infinite.nontrivial {s : Set α} (hs : s.Infinite) : s.Nontrivial

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


theorem inter_preimage_subset (s : Set α) (t : Set β) (f : α → β) :
    s ∩ f ⁻¹' t ⊆ f ⁻¹' (f '' s ∩ t)

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


theorem iInf_nat_gt_zero_eq (f : ℕ → α) : ⨅ i > 0, f i = ⨅ i, f (i + 1)

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


theorem measure_condCDF_Iic (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
    (condCDF ρ a).measure (Iic x) = ENNReal.ofReal (condCDF ρ a x)

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

(ProbabilityTheory.condCDF ρ a).measure (Set.Iic x) = ENNReal.ofReal (↑(ProbabilityTheory.condCDF ρ a) x)


theorem apply_coe_mem_map (f : F) (I : Ideal R) (x : I) : f x ∈ I.map f

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
(f : F)
(I : Ideal R)
(x : ↥I)


/-- The determinant of a permutation matrix equals its sign. -/
@[simp]
theorem det_permutation [CommRing R] : det (σ.permMatrix R) = Perm.sign σ

{n : Type u_1}
{R : Type u_2}
[DecidableEq n]
[Fintype n]
(σ : Equiv.Perm n)
[CommRing R]

(Equiv.Perm.permMatrix R σ).det = ↑↑(Equiv.Perm.sign σ)


theorem hasColimit_of_closedUnderColimits (h : ClosedUnderColimitsOfShape J P)
    (F : J ⥤ FullSubcategory P) [HasColimit (F ⋙ fullSubcategoryInclusion P)] : HasColimit F

(h : CategoryTheory.Limits.ClosedUnderColimitsOfShape J P)

(F : J ⥤ CategoryTheory.FullSubcategory P)

[CategoryTheory.Limits.HasColimit (F ⋙ CategoryTheory.fullSubcategoryInclusion P)]


@[simp]
theorem LinearMap.toMatrix'_toLinearMapₛₗ₂' (M : Matrix n m N₂) :
    LinearMap.toMatrixₛₗ₂' R (Matrix.toLinearMapₛₗ₂' R σ₁ σ₂ M) = M

{R : Type u_1}
{R₁ : Type u_2}
{S₁ : Type u_3}
{R₂ : Type u_4}
{S₂ : Type u_5}
{N₂ : Type u_11}
{n : Type u_12}
{m : Type u_13}
[CommSemiring R]
[AddCommMonoid N₂]
[Module R N₂]
[Semiring R₁]
[Semiring R₂]
[Semiring S₁]
[Semiring S₂]
[Module S₁ N₂]
[Module S₂ N₂]
[SMulCommClass S₁ R N₂]
[SMulCommClass S₂ R N₂]
[SMulCommClass S₂ S₁ N₂]
(σ₁ : R₁ →+* S₁)
(σ₂ : R₂ →+* S₂)
[Fintype n]
[Fintype m]
[DecidableEq n]
[DecidableEq m]
(M : Matrix n m N₂)

(LinearMap.toMatrixₛₗ₂' R) ((Matrix.toLinearMapₛₗ₂' R σ₁ σ₂) M) = M


theorem Lex.mono_right (hs : ∀ i a b, s₁ i a b → s₂ i a b) {a b : Σ i, α i} (h : Lex r s₁ a b) :
    Lex r s₂ a b

(hs : ∀ (i : ι) (a b : α i), s₁ i a b → s₂ i a b)


theorem not_def {x : BitVec v} : ~~~x = allOnes v ^^^ x


/-- The lower central series of a group is a descending central series. -/
theorem lowerCentralSeries_isDescendingCentralSeries :
    IsDescendingCentralSeries (lowerCentralSeries G)


theorem not_mem_none (a : α) : a ∉ (none : Option α)


theorem charFn_inj [Nontrivial Y] (hU : IsClopen U) (hV : IsClopen V)
    (h : charFn Y hU = charFn Y hV) : U = V

(h : LocallyConstant.charFn Y hU = LocallyConstant.charFn Y hV)


theorem toTopologicalSpace_inf {u v : UniformSpace α} :
    (u ⊓ v).toTopologicalSpace = u.toTopologicalSpace ⊓ v.toTopologicalSpace

UniformSpace.toTopologicalSpace = UniformSpace.toTopologicalSpace ⊓ UniformSpace.toTopologicalSpace


/-- An iterated coproduct is a coproduct over a sigma type. -/
@[simps]
def sigmaSigmaIso {ι : Type*} (f : ι → Type*) (g : (i : ι) → (f i) → C)
    [∀ i, HasCoproduct (g i)] [HasCoproduct fun i => ∐ g i] :
    (∐ fun i => ∐ g i) ≅ (∐ fun p : Σ i, f i => g p.1 p.2)

[∀ (i : ι), CategoryTheory.Limits.HasCoproduct (g i)]

[CategoryTheory.Limits.HasCoproduct fun i => ∐ g i]

(CategoryTheory.Limits.sigmaSigmaIso f g).hom =
  CategoryTheory.Limits.Sigma.desc fun i =>
    CategoryTheory.Limits.Sigma.desc fun x => CategoryTheory.Limits.Sigma.ι (fun p => g p.fst p.snd) ⟨i, x⟩


@[simp] theorem prod_get_snd {a : Thunk α} {b : Thunk β} : (prod a b).get.2 = b.get

{α : Type u}
{β : Type v}
{a : Thunk α}
{b : Thunk β}


theorem abs_moebius_le_one {n : ℕ} : |μ n| ≤ 1


theorem Eventually.filter_mono {f₁ f₂ : Filter α} (h : f₁ ≤ f₂) {p : α → Prop}
    (hp : ∀ᶠ x in f₂, p x) : ∀ᶠ x in f₁, p x

{α : Type u}
{f₁ f₂ : Filter α}
(h : f₁ ≤ f₂)
{p : α → Prop}
(hp : ∀ᶠ (x : α) in f₂, p x)


lemma cauchy_prod_iff [UniformSpace β] {F : Filter (α × β)} :
    Cauchy F ↔ Cauchy (map Prod.fst F) ∧ Cauchy (map Prod.snd F)

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
[UniformSpace β]
{F : Filter (α × β)}

Cauchy F ↔ Cauchy (Filter.map Prod.fst F) ∧ Cauchy (Filter.map Prod.snd F)


theorem hasFDerivWithinAt_inter (h : t ∈ 𝓝 x) :
    HasFDerivWithinAt f f' (s ∩ t) x ↔ HasFDerivWithinAt f f' s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
{s t : Set E}
(h : t ∈ 𝓝 x)


/-- The `R`-linear equivalence between `ULift M` and `M`.

This is a linear version of `AddEquiv.ulift`. -/
@[simps apply symm_apply]
def moduleEquiv [Semiring R] [AddCommMonoid M] [Module R M] : ULift.{w} M ≃ₗ[R] M

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(self : ULift.{w, v} M)


theorem connectedComponent_disjoint {x y : α} (h : connectedComponent x ≠ connectedComponent y) :
    Disjoint (connectedComponent x) (connectedComponent y)


theorem seqRight_eq [Monad m] [LawfulMonad m] (x : StateT σ m α) (y : StateT σ m β) : x *> y = const α id <$> x <*> y

{m : Type u_1 → Type u_2}
{σ α β : Type u_1}
[Monad m]
[LawfulMonad m]
(x : StateT σ m α)
(y : StateT σ m β)

(SeqRight.seqRight x fun x => y) = Seq.seq (Function.const α id <$> x) fun x => y


@[to_additive]
theorem pow_subset_pow_of_one_mem (hs : (1 : α) ∈ s) : m ≤ n → s ^ m ⊆ s ^ n

{α : Type u_2}
[DecidableEq α]
[AddMonoid α]
{s : Finset α}
{m n : ℕ}
(hs : 0 ∈ s)


theorem IsIso.inv_eq_inv {f g : X ⟶ Y} [IsIso f] [IsIso g] : inv f = inv g ↔ f = g

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

CategoryTheory.inv f = CategoryTheory.inv g ↔ f = g


/-- The projection of a graded object to its `i`-th component. -/
@[simps]
def eval {β : Type w} (b : β) : GradedObject β C ⥤ C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{β : Type w}
(b : β)

∀ {X Y : CategoryTheory.GradedObject β C} (f : X ⟶ Y), (CategoryTheory.GradedObject.eval b).map f = f b


/-- The definition of `0 ≤ x` on pre-games, in terms of `0 ≤` two moves later. -/
theorem zero_le {x : PGame} : 0 ≤ x ↔ ∀ j, ∃ i, 0 ≤ (x.moveRight j).moveLeft i

0 ≤ x ↔ ∀ (j : x.RightMoves), ∃ i, 0 ≤ (x.moveRight j).moveLeft i


/-- An isometry between quadratic forms generated by `QuadraticMap.pi` can be constructed
from a pair of isometries between the left and right parts. -/
@[simps toLinearEquiv]
def IsometryEquiv.pi [Fintype ι]
    {Q : ∀ i, QuadraticMap R (Mᵢ i) P} {Q' : ∀ i, QuadraticMap R (Nᵢ i) P}
    (e : ∀ i, (Q i).IsometryEquiv (Q' i)) : (pi Q).IsometryEquiv (pi Q')

{Q' : (i : ι) → QuadraticMap R (Nᵢ i) P}

(e : (i : ι) → (Q i).IsometryEquiv (Q' i))

(QuadraticMap.IsometryEquiv.pi e).toLinearEquiv = LinearEquiv.piCongrRight fun i => (e i).toLinearEquiv


/-- A `HomologicalComplex V c` with a "shape" controlled by `c : ComplexShape ι`
has chain groups `X i` (objects in `V`) indexed by `i : ι`,
and a differential `d i j` whenever `c.Rel i j`.

We in fact ask for differentials `d i j` for all `i j : ι`,
but have a field `shape` requiring that these are zero when not allowed by `c`.
This avoids a lot of dependent type theory hell!

The composite of any two differentials `d i j ≫ d j k` must be zero.
-/
structure HomologicalComplex (c : ComplexShape ι) where
  X : ι → V
  d : ∀ i j, X i ⟶ X j
  shape : ∀ i j, ¬c.Rel i j → d i j = 0 := by aesop_cat
  d_comp_d' : ∀ i j k, c.Rel i j → c.Rel j k → d i j ≫ d j k = 0 := by aesop_cat

c.Rel i j → c.Rel j k → self.d i j ≫ self.d j k = 0


@[to_additive (attr := simp)]
theorem mem_bot {x : M} : x ∈ (⊥ : Submonoid M) ↔ x = 1


protected theorem Set.OrdConnected.nullMeasurableSet (hs : s.OrdConnected) : NullMeasurableSet s

{ι : Type u_1}
[Fintype ι]
{s : Set (ι → ℝ)}
(hs : s.OrdConnected)


lemma primitiveCharacter_one (hn : n ≠ 0) :
    (1 : DirichletCharacter R n).primitiveCharacter = 1

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
(hn : n ≠ 0)

DirichletCharacter.primitiveCharacter 1 = 1


theorem circleMap_not_mem_ball (c : ℂ) (R : ℝ) (θ : ℝ) : circleMap c R θ ∉ ball c R


theorem eq_finite_iUnion_of_finite_subset_iUnion {ι} {s : ι → Set α} {t : Set α} (tfin : t.Finite)
    (h : t ⊆ ⋃ i, s i) :
    ∃ I : Set ι,
      I.Finite ∧
        ∃ σ : { i | i ∈ I } → Set α, (∀ i, (σ i).Finite) ∧ (∀ i, σ i ⊆ s i) ∧ t = ⋃ i, σ i

{α : Type u}
{ι : Type u_1}
{s : ι → Set α}
{t : Set α}
(tfin : t.Finite)
(h : t ⊆ ⋃ i, s i)

∃ I, I.Finite ∧ ∃ σ, (∀ (i : ↑{i | i ∈ I}), (σ i).Finite) ∧ (∀ (i : ↑{i | i ∈ I}), σ i ⊆ s ↑i) ∧ t = ⋃ i, σ i


/-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of the
base point is a neighborhood of the preimage, within a set. -/
theorem extChartAt_preimage_mem_nhdsWithin {x : M} (ht : t ∈ 𝓝[s] x) :
    (extChartAt I x).symm ⁻¹' t ∈ 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x) x

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
{s t : Set M}
[ChartedSpace H M]
{x : M}
(ht : t ∈ 𝓝[s] x)

↑(extChartAt I x).symm ⁻¹' t ∈ 𝓝[↑(extChartAt I x).symm ⁻¹' s ∩ Set.range ↑I] ↑(extChartAt I x) x


@[simp]
theorem minpolyGen_eq (pb : PowerBasis A S) : pb.minpolyGen = minpoly A pb.gen

{S : Type u_2}
[Ring S]
{A : Type u_4}
[CommRing A]
[Algebra A S]
(pb : PowerBasis A S)


/-- To check whether two maps are coequalized by both maps of a cotrident, it suffices to check it
for the second map -/
theorem Cotrident.coequalizer_ext [Nonempty J] (s : Cotrident f) {W : C} {k l : s.pt ⟶ W}
    (h : s.π ≫ k = s.π ≫ l) : ∀ j : WalkingParallelFamily J, s.ι.app j ≫ k = s.ι.app j ≫ l

(h : CategoryTheory.CategoryStruct.comp s.π k = CategoryTheory.CategoryStruct.comp s.π l)

(j : CategoryTheory.Limits.WalkingParallelFamily J)

CategoryTheory.CategoryStruct.comp (s.ι.app j) k = CategoryTheory.CategoryStruct.comp (s.ι.app j) l


lemma trim_withDensity {m m0 : MeasurableSpace α} {μ : Measure α}
    (hm : m ≤ m0) {f : α → ℝ≥0∞} (hf : Measurable[m] f) :
    (μ.withDensity f).trim hm = (μ.trim hm).withDensity f

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(hm : m ≤ m0)
{f : α → ℝ≥0∞}
(hf : Measurable f)


theorem OrderEmbedding.image_Ioi (e : α ↪o β) (he : IsUpperSet (range e)) (a : α) :
    e '' Ioi a = Ioi (e a)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ↪o β)
(he : IsUpperSet (Set.range ⇑e))
(a : α)


@[simp]
theorem restrict_eq_zero : μ.restrict s = 0 ↔ μ s = 0

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}


@[simp]
theorem prod_coe {s : Multiset { a : Associates α // Irreducible a }} :
    FactorSet.prod (s : FactorSet α) = (s.map (↑)).prod

{α : Type u_1}
[CancelCommMonoidWithZero α]
{s : Multiset { a // Irreducible a }}

Associates.FactorSet.prod ↑s = (Multiset.map Subtype.val s).prod


/-- **Helly's theorem** for finite sets of convex sets in its classical form.

If `F` is a finite set of convex sets in a vector space of finite dimension `d`, with `n ≥ d + 1`,
and any `d + 1` sets from `F` intersect nontrivially,
then all sets from `F` intersect nontrivially. -/
theorem helly_theorem_set {F : Finset (Set E)}
    (h_card : finrank 𝕜 E + 1 ≤ F.card)
    (h_convex : ∀ X ∈ F, Convex 𝕜 X)
    (h_inter : ∀ G : Finset (Set E), G ⊆ F → G.card = finrank 𝕜 E + 1 → (⋂₀ G : Set E).Nonempty) :
    (⋂₀ (F : Set (Set E))).Nonempty

(h_card : FiniteDimensional.finrank 𝕜 E + 1 ≤ F.card)

(h_inter : ∀ G ⊆ F, G.card = FiniteDimensional.finrank 𝕜 E + 1 → (⋂₀ ↑G).Nonempty)


/-- The functor `(L, R) ⥤ (L ⋙ F, R ⋙ F)` -/
@[simps]
def post (L : A ⥤ T) (R : B ⥤ T) (F : T ⥤ C) : Comma L R ⥤ Comma (L ⋙ F) (R ⋙ F)

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

∀ {X Y : CategoryTheory.Comma L R} (f : X ⟶ Y), ((CategoryTheory.Comma.post L R F).map f).left = f.left


@[simp]
theorem nullHomotopicMap_f_of_not_rel_left {k₁ k₀ : ι} (r₁₀ : c.Rel k₁ k₀)
    (hk₀ : ∀ l : ι, ¬c.Rel k₀ l) (hom : ∀ i j, C.X i ⟶ D.X j) :
    (nullHomotopicMap hom).f 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₀ : ι}
(r₁₀ : c.Rel k₁ k₀)
(hk₀ : ∀ (l : ι), ¬c.Rel k₀ l)
(hom : (i j : ι) → C.X i ⟶ D.X j)

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


/-- A stronger version of `mul_left_injective` -/
@[simp]
theorem mul_swap_involutive (i j : α) : Function.Involutive (· * Equiv.swap i j)

Function.Involutive fun x => x * Equiv.swap i j


theorem of_smul_def (i) (w : Word M) (m : M i) :
    of m • w = rcons { equivPair i w with head := m * (equivPair i w).head }

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
[(i : ι) → DecidableEq (M i)]
[DecidableEq ι]
(i : ι)
(w : Monoid.CoprodI.Word M)
(m : M i)

Monoid.CoprodI.of m • w =
  Monoid.CoprodI.Word.rcons
    (let __src := (Monoid.CoprodI.Word.equivPair i) w;
    { head := m * ((Monoid.CoprodI.Word.equivPair i) w).head, tail := __src.tail, fstIdx_ne := ⋯ })


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

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


theorem exists_mem_support_of_mem_support_prod {l : List (Perm α)} {x : α}
    (hx : x ∈ l.prod.support) : ∃ f : Perm α, f ∈ l ∧ x ∈ f.support

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{l : List (Equiv.Perm α)}
{x : α}
(hx : x ∈ l.prod.support)


@[simp] theorem mem_def {a : α} {b : Option α} : a ∈ b ↔ b = some a


@[to_additive]
theorem finiteIndex_iInf {ι : Type*} [Finite ι] {f : ι → Subgroup G}
    (hf : ∀ i, (f i).FiniteIndex) : (⨅ i, f i).FiniteIndex

{G : Type u_1}
[AddGroup G]
{ι : Type u_3}
[Finite ι]
{f : ι → AddSubgroup G}
(hf : ∀ (i : ι), (f i).FiniteIndex)


@[reassoc (attr := simp)]
theorem whiskerLeft_naturality_comp (f : a' ⟶ G.obj a) (g : a ⟶ b) (h : b ⟶ c) :
    f ◁ θ.naturality (g ≫ h) ≫ f ◁ θ.app a ◁ H.mapComp g h =
      f ◁ G.mapComp g h ▷ θ.app c ≫
        f ◁ (α_ _ _ _).hom ≫
          f ◁ G.map g ◁ θ.naturality h ≫
            f ◁ (α_ _ _ _).inv ≫ f ◁ θ.naturality g ▷ H.map h ≫ f ◁ (α_ _ _ _).hom

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{G H : CategoryTheory.OplaxFunctor B C}
(θ : CategoryTheory.OplaxNatTrans G H)
{a b c : B}
{a' : C}
(f : a' ⟶ G.obj a)
(g : a ⟶ b)
(h : b ⟶ c)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (θ.naturality (CategoryTheory.CategoryStruct.comp g h)))
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerLeft (θ.app a) (H.mapComp g h))) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerRight (G.mapComp g h) (θ.app c)))
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.associator (G.map g) (G.map h) (θ.app c)).hom)
      (CategoryTheory.CategoryStruct.comp
        (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerLeft (G.map g) (θ.naturality h)))
        (CategoryTheory.CategoryStruct.comp
          (CategoryTheory.Bicategory.whiskerLeft f
            (CategoryTheory.Bicategory.associator (G.map g) (θ.app b) (H.map h)).inv)
          (CategoryTheory.CategoryStruct.comp
            (CategoryTheory.Bicategory.whiskerLeft f
              (CategoryTheory.Bicategory.whiskerRight (θ.naturality g) (H.map h)))
            (CategoryTheory.Bicategory.whiskerLeft f
              (CategoryTheory.Bicategory.associator (θ.app a) (H.map g) (H.map h)).hom)))))


@[simp] lemma add_cons (v : Fin n.succ → α) (y : α) (w : Fin n → α) :
    v + vecCons y w = vecCons (vecHead v + y) (vecTail v + w)

{α : Type u_1}
{n : ℕ}
[Add α]
(v : Fin n.succ → α)
(y : α)
(w : Fin n → α)

v + Matrix.vecCons y w = Matrix.vecCons (Matrix.vecHead v + y) (Matrix.vecTail v + w)


theorem insertNth_injective (n : ℕ) (x : α) : Function.Injective (insertNth n x)


/-- The right fraction corresponding to a left fraction in the opposite category. -/
@[simps]
def LeftFraction.unop {W : MorphismProperty Cᵒᵖ}
    {X Y : Cᵒᵖ} (φ : W.LeftFraction X Y) :
    W.unop.RightFraction (Opposite.unop Y) (Opposite.unop X)

{W : CategoryTheory.MorphismProperty Cᵒᵖ}


/-- A composition of `n` is a list of positive integers summing to `n`. -/
@[ext]
structure Composition (n : ℕ) where
  /-- List of positive integers summing to `n`-/
  blocks : List ℕ
  /-- Proof of positivity for `blocks`-/
  blocks_pos : ∀ {i}, i ∈ blocks → 0 < i
  /-- Proof that `blocks` sums to `n`-/
  blocks_sum : blocks.sum = n


theorem smeval_commute (hc : Commute x y) : Commute (p.smeval x) (q.smeval y)

(R : Type u_1)
[Semiring R]
(p q : Polynomial R)
{S : Type u_2}
[Semiring S]
[Module R S]
[IsScalarTower R S S]
[SMulCommClass R S S]
{x y : S}
(hc : Commute x y)


theorem fmod_eq_emod (a : Int) {b : Int} (hb : 0 ≤ b) : fmod a b = a % b


lemma quot_mk_eq_iff [Mono f] (a b : X₁ ⊕ X₂) :
    (Quot.mk _ a : Pushout f g) = Quot.mk _ b ↔ Rel' f g a b

{S X₁ X₂ : Type u}
(f : S ⟶ X₁)
(g : S ⟶ X₂)
[CategoryTheory.Mono f]
(a b : X₁ ⊕ X₂)

Quot.mk (CategoryTheory.Limits.Types.Pushout.Rel f g) a = Quot.mk (CategoryTheory.Limits.Types.Pushout.Rel f g) b ↔
  CategoryTheory.Limits.Types.Pushout.Rel' f g a b


theorem derivedSeriesOfIdeal_mono {I J : LieIdeal R L} (h : I ≤ J) (k : ℕ) : D k I ≤ D k J

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{I J : LieIdeal R L}
(h : I ≤ J)
(k : ℕ)

LieAlgebra.derivedSeriesOfIdeal R L k I ≤ LieAlgebra.derivedSeriesOfIdeal R L k J


theorem forall_fin_one {p : Fin 1 → Prop} : (∀ i, p i) ↔ p 0


/-- The double opposite category is equivalent to the original. -/
@[simps]
def opOpEquivalence : Cᵒᵖᵒᵖ ≌ C

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

(CategoryTheory.opOpEquivalence C).unitIso = CategoryTheory.Iso.refl (CategoryTheory.Functor.id Cᵒᵖᵒᵖ)


@[simp]
theorem id_hom' (M : Mon_ C) : (𝟙 M : Hom M M).hom = 𝟙 M.X

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


theorem toIcoDiv_sub_eq_toIcoDiv_add (a b c : α) :
    toIcoDiv hp a (b - c) = toIcoDiv hp (a + c) b

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


theorem parts_nonempty (P : Finpartition a) (ha : a ≠ ⊥) : P.parts.Nonempty

{α : Type u_1}
[Lattice α]
[OrderBot α]
{a : α}
(P : Finpartition a)
(ha : a ≠ ⊥)


protected theorem sup_le {f g h : E →ₗ.[R] F}
    (H : ∀ (x : f.domain) (y : g.domain), (x : E) = y → f x = g y) (fh : f ≤ h) (gh : g ≤ h) :
    f.sup g H ≤ h

(H : ∀ (x : ↥f.domain) (y : ↥g.domain), ↑x = ↑y → ↑f x = ↑g y)


theorem L1.setToFun_eq_setToL1 (hT : DominatedFinMeasAdditive μ T C) (f : α →₁[μ] E) :
    setToFun μ T hT f = L1.setToL1 hT f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

MeasureTheory.setToFun μ T hT ↑↑f = (MeasureTheory.L1.setToL1 hT) f


/-- Given a `k`-linear `G`-representation `(A, ρ₁)`, this is the 'internal Hom' functor sending
`(B, ρ₂)` to the representation `Homₖ(A, B)` that maps `g : G` and `f : A →ₗ[k] B` to
`(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
@[simps]
protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)
{X Y : Rep k G}
(f : X ⟶ Y)

(A.ihom.map f).hom = ModuleCat.ofHom ((LinearMap.llcomp k (CoeSort.coe A) (CoeSort.coe X) (CoeSort.coe Y)) f.hom)


protected theorem add_lt_add_iff_right [LT α] [CovariantClass α α (swap (· + ·)) (· < ·)]
    [ContravariantClass α α (swap (· + ·)) (· < ·)] (ha : a ≠ ⊤) : b + a < c + a ↔ b < c

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

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


@[simp] lemma ofLower_toLower (a : α) : ofLower (toLower a) = a

Topology.WithLower.ofLower (Topology.WithLower.toLower a) = a


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


@[simp]
theorem Sphere.coe_mk (c : P) (r : ℝ) : ↑(⟨c, r⟩ : Sphere P) = Metric.sphere c r

{P : Type u_2}
[MetricSpace P]
(c : P)
(r : ℝ)

Metric.sphere { center := c, radius := r }.center { center := c, radius := r }.radius = Metric.sphere c r


/-- If `T` and `T'` are terminal, they are isomorphic. -/
@[simps]
def IsTerminal.uniqueUpToIso {T T' : C} (hT : IsTerminal T) (hT' : IsTerminal T') : T ≅ T'

(hT : CategoryTheory.Limits.IsTerminal T)

(hT' : CategoryTheory.Limits.IsTerminal T')


theorem divInt_mul_left {a : Int} (a0 : a ≠ 0) : (a * n) /. (a * d) = n /. d


@[simp]
theorem uniformEquiv_mk_coe_symm (a : Equiv α β) (b c) :
    ((UniformEquiv.mk a b c).symm : β → α) = a.symm

{α : Type u}
{β : Type u_1}
[UniformSpace α]
[UniformSpace β]
(a : α ≃ β)
(b : UniformContinuous a.toFun)
(c : UniformContinuous a.invFun)

⇑{ toEquiv := a, uniformContinuous_toFun := b, uniformContinuous_invFun := c }.symm = ⇑a.symm


@[to_additive]
theorem hasProd_prod {f : γ → β → α} {a : γ → α} {s : Finset γ} :
    (∀ i ∈ s, HasProd (f i) (a i)) → HasProd (fun b ↦ ∏ i ∈ s, f i b) (∏ i ∈ s, a i)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
[ContinuousMul α]
{f : γ → β → α}
{a : γ → α}
{s : Finset γ}

(∀ i ∈ s, HasProd (f i) (a i)) → HasProd (fun b => ∏ i ∈ s, f i b) (∏ i ∈ s, a i)


/-- 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 : G ≃+ Additive H)
(a : Multiplicative G)

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


/-- Ring homomorphisms preserve subtraction. -/
protected theorem map_sub [NonAssocRing α] [NonAssocRing β] (f : α →+* β) (x y : α) :
    f (x - y) = f x - f y

{α : Type u_2}
{β : Type u_3}
[NonAssocRing α]
[NonAssocRing β]
(f : α →+* β)
(x y : α)


@[to_additive]
theorem closure_union (s t : Set G) : closure (s ∪ t) = closure s ⊔ closure t

{G : Type u_1}
[AddGroup G]
(s t : Set G)

AddSubgroup.closure (s ∪ t) = AddSubgroup.closure s ⊔ AddSubgroup.closure t


theorem nonempty_quotient_iff (s : Setoid α) : Nonempty (Quotient s) ↔ Nonempty α


/-- Adding a bitvector to its own complement yields the all ones bitpattern -/
@[simp] theorem add_not_self (x : BitVec w) : x + ~~~x = allOnes w


@[simp]
theorem singleton_prod : ({a} : Set α) ×ˢ t = Prod.mk a '' t

{α : Type u_1}
{β : Type u_2}
{t : Set β}
{a : α}


lemma map_filter' {f : α → β} (hf : Injective f) (s : Multiset α)
    [DecidablePred fun b => ∃ a, p a ∧ f a = b] :
    (s.filter p).map f = (s.map f).filter fun b => ∃ a, p a ∧ f a = b

Multiset.map f (Multiset.filter p s) = Multiset.filter (fun b => ∃ a, p a ∧ f a = b) (Multiset.map f s)


@[to_additive]
theorem div_mem_div : a ∈ s → b ∈ t → a / b ∈ s / t

{α : Type u_2}
[DecidableEq α]
[Div α]
{s t : Finset α}
{a b : α}


theorem Base.indep (hB : M.Base B) : M.Indep B

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


@[simp] lemma mem_box : ∀ {n}, x ∈ box n ↔ max x.1.natAbs x.2.natAbs = n

x ∈ Finset.box n ↔ max x.1.natAbs x.2.natAbs = n


@[simp]
theorem codisjoint_inf_left : Codisjoint (a ⊓ b) c ↔ Codisjoint a c ∧ Codisjoint b c

{α : Type u_1}
[DistribLattice α]
[OrderTop α]
{a b c : α}


lemma neg_hom (α : Ext X Y n) : (-α).hom = -α.hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
{X Y : C}
{n : ℕ}
[HasDerivedCategory C]
(α : CategoryTheory.Abelian.Ext X Y n)


@[to_additive (attr := simp)]
lemma not_mulDissociated :
    ¬ MulDissociated s ↔
      ∃ t : Finset α, ↑t ⊆ s ∧ ∃ u : Finset α, ↑u ⊆ s ∧ t ≠ u ∧ ∏ x in t, x = ∏ x in u, x

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

¬AddDissociated s ↔ ∃ t, ↑t ⊆ s ∧ ∃ u, ↑u ⊆ s ∧ t ≠ u ∧ ∑ x ∈ t, x = ∑ x ∈ u, x


/-- If two functions coincide in a neighborhood of `x` within a set `s` and at `x`, then their
iterated differentials within this set at `x` coincide. -/
theorem Filter.EventuallyEq.iteratedFDerivWithin_eq (h : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x)
    (n : ℕ) : iteratedFDerivWithin 𝕜 n f₁ s x = iteratedFDerivWithin 𝕜 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 f₁ : E → F}
{x : E}
(h : f₁ =ᶠ[𝓝[s] x] f)
(hx : f₁ x = f x)
(n : ℕ)


/-- The functor which sends `[n]` to the simplicial set `Δ[n]` equipped by
the obvious augmentation towards the terminal object of the category of sets. -/
@[simps]
noncomputable def standardSimplex : SimplexCategory ⥤ SSet.Augmented.{u}

∀ {X Y : SimplexCategory} (θ : X ⟶ Y), (SSet.Augmented.standardSimplex.map θ).left = SSet.standardSimplex.map θ


lemma isRightKanExtension_iff_precomp (α : L ⋙ F' ⟶ F) :
    F'.IsRightKanExtension α ↔
      F'.IsRightKanExtension ((Functor.associator _ _ _).hom ≫ whiskerLeft G α)

F'.IsRightKanExtension α ↔
  F'.IsRightKanExtension (CategoryTheory.CategoryStruct.comp (G.associator L F').hom (CategoryTheory.whiskerLeft G α))


/-- Corresponds to `dist_ne_zero`. -/
theorem hammingDist_ne_zero {x y : ∀ i, β i} : hammingDist x y ≠ 0 ↔ x ≠ y

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
{x y : (i : ι) → β i}


/-- The powerset functor. `Set` as a contravariant functor. -/
@[simps]
def typeToBoolAlgOp : Type u ⥤ BoolAlgᵒᵖ

typeToBoolAlgOp.map f =
  Quiver.Hom.op
    (let __src := { toFun := ⇑(CompleteLatticeHom.setPreimage f), map_sup' := ⋯, map_inf' := ⋯ };
    { toFun := ⇑(CompleteLatticeHom.setPreimage f), map_sup' := ⋯, map_inf' := ⋯, map_top' := ⋯, map_bot' := ⋯ })


@[to_additive] theorem quotientMap_mk : QuotientMap (@mk M)


@[simp]
theorem spectralRadius_zero : spectralRadius 𝕜 (0 : A) = 0

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]


nonrec theorem ContinuousWithinAt.rpow_const (hf : ContinuousWithinAt f s x) (h : f x ≠ 0 ∨ 0 ≤ p) :
    ContinuousWithinAt (fun x => f x ^ p) s x

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℝ}
{s : Set α}
{x : α}
{p : ℝ}
(hf : ContinuousWithinAt f s x)
(h : f x ≠ 0 ∨ 0 ≤ p)


@[simp] lemma inl_sup (a₁ a₂ : α) : (inlₗ (a₁ ⊔ a₂) : α ⊕ β) = inlₗ a₁ ⊔ inlₗ a₂

{α : Type u_1}
{β : Type u_2}
[SemilatticeSup α]
[SemilatticeSup β]
(a₁ a₂ : α)

Sum.inlₗ (a₁ ⊔ a₂) = Sum.inlₗ a₁ ⊔ Sum.inlₗ a₂


theorem tail {n f} (hf : @Primrec' n f) : @Primrec' n.succ fun v => f v.tail

{n : ℕ}
{f : Mathlib.Vector ℕ n → ℕ}
(hf : Nat.Primrec' f)


/-- (Implementation). Given a hom between the pullbacks of two sheaves, we can whisker it with
`coyoneda` to obtain a hom between the pullbacks of the sheaves of maps from `X`.
-/
@[simps!]
def homOver {ℱ : Dᵒᵖ ⥤ A} {ℱ' : Sheaf K A} (α : G.op ⋙ ℱ ⟶ G.op ⋙ ℱ'.val) (X : A) :
    G.op ⋙ ℱ ⋙ coyoneda.obj (op X) ⟶ G.op ⋙ (sheafOver ℱ' X).val

{K : CategoryTheory.GrothendieckTopology D}

∀ (X_1 : Cᵒᵖ) (a : (CategoryTheory.coyoneda.obj (Opposite.op X)).obj ((G.op.comp ℱ).obj X_1)),
  (CategoryTheory.Functor.IsCoverDense.homOver α X).app X_1 a = CategoryTheory.CategoryStruct.comp a (α.app X_1)


/-- The composition of lax braided monoidal functors. -/
@[simps!]
def comp (F : LaxBraidedFunctor C D) (G : LaxBraidedFunctor D E) : LaxBraidedFunctor C E

(F : CategoryTheory.LaxBraidedFunctor C D)

(G : CategoryTheory.LaxBraidedFunctor D E)


/-- A weaker version of `Finset.fold_ite'`,
relying on typeclass idempotency over the whole type,
instead of solely on the seed element.
However, this is easier to use because it does not generate side goals. -/
theorem fold_ite [Std.IdempotentOp op] {g : α → β} (p : α → Prop) [DecidablePred p] :
    Finset.fold op b (fun i => ite (p i) (f i) (g i)) s =
      op (Finset.fold op b f (s.filter p)) (Finset.fold op b g (s.filter fun i => ¬p i))

{α : Type u_1}
{β : Type u_2}
{op : β → β → β}
[hc : Std.Commutative op]
[ha : Std.Associative op]
{f : α → β}
{b : β}
{s : Finset α}
[Std.IdempotentOp op]
{g : α → β}
(p : α → Prop)
[DecidablePred p]

Finset.fold op b (fun i => if p i then f i else g i) s =
  op (Finset.fold op b f (Finset.filter p s)) (Finset.fold op b g (Finset.filter (fun i => ¬p i) s))


@[to_additive (attr := simp)]
theorem pow_add_period_smul (n : ℕ) (m : M) (a : α) :
    m ^ (n + period m a) • a = m ^ n • a

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

(n + AddAction.period m a) • m +ᵥ a = n • m +ᵥ a


@[simp]
theorem val_eq_coe (n : ℝ≥0) : n.val = n


theorem eq_univ_of_forall : (∀ x, x ∈ s) → s = univ

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


@[to_additive (attr := simp)]
theorem const_eq_one : const ι a = 1 ↔ a = 1

{ι : Type u_1}
{α : Type u_2}
[One α]
[Nonempty ι]
{a : α}


theorem hasProducts_of_limit_fans (lf : ∀ {J : Type w} (f : J → C), Fan f)
    (lf_isLimit : ∀ {J : Type w} (f : J → C), IsLimit (lf f)) : HasProducts.{w} C

(lf : {J : Type w} → (f : J → C) → CategoryTheory.Limits.Fan f)

(lf_isLimit : {J : Type w} → (f : J → C) → CategoryTheory.Limits.IsLimit (lf f))