@[simp]
theorem mkHom_f_succ_succ (n : ℕ) :
    (mkHom P Q zero one one_zero_comm succ).f (n + 2) =
      (succ n
          ⟨(mkHom P Q zero one one_zero_comm succ).f n,
            (mkHom P Q zero one one_zero_comm succ).f (n + 1),
            (mkHom P Q zero one one_zero_comm succ).comm n (n + 1)⟩).1

(one_zero_comm : zero ≫ Q.d 0 1 = P.d 0 1 ≫ one)

(P.mkHom Q zero one one_zero_comm succ).f (n + 2) =
  (succ n ⟨(P.mkHom Q zero one one_zero_comm succ).f n, ⟨(P.mkHom Q zero one one_zero_comm succ).f (n + 1), ⋯⟩⟩).fst


theorem pi_Ico_ae_eq_pi_Icc {s : Set ι} {f g : ∀ i, α i} :
    (pi s fun i => Ico (f i) (g i)) =ᵐ[Measure.pi μ] pi s fun i => Icc (f i) (g i)

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

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

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

(s.pi fun i => Set.Ico (f i) (g i)) =ᵐ[MeasureTheory.Measure.pi μ] s.pi fun i => Set.Icc (f i) (g i)


@[reassoc]
theorem id_tensor_comp_tensor_id (f : W ⟶ X) (g : Y ⟶ Z) : (𝟙 Y ⊗ f) ≫ (g ⊗ 𝟙 X) = g ⊗ f

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.id Y) f)
    (CategoryTheory.MonoidalCategory.tensorHom g (CategoryTheory.CategoryStruct.id X)) =
  CategoryTheory.MonoidalCategory.tensorHom g f


@[simp]
theorem apply_one [DecidableEq R] (x : R) : (1 : RingSeminorm R) x = if x = 0 then 0 else 1

{R : Type u_2}
[NonUnitalRing R]
[DecidableEq R]
(x : R)


/-- If the spans of two pairs of vectors are equal, twice angles between those vectors are
equal. -/
theorem two_zsmul_oangle_of_span_eq_of_span_eq {w x y z : V} (hwx : (ℝ ∙ w) = ℝ ∙ x)
    (hyz : (ℝ ∙ y) = ℝ ∙ z) : (2 : ℤ) • o.oangle w y = (2 : ℤ) • o.oangle x z

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

(hwx : Submodule.span ℝ {w} = Submodule.span ℝ {x})

(hyz : Submodule.span ℝ {y} = Submodule.span ℝ {z})


@[simp]
theorem tensorLeftHomEquiv_whiskerRight_comp_evaluation {X Y : C} [HasLeftDual X] [HasLeftDual Y]
    (f : X ⟶ Y) : (tensorLeftHomEquiv _ _ _ _) (f ▷ _ ≫ ε_ _ _) = (ᘁf) ≫ (ρ_ _).inv

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

(CategoryTheory.tensorLeftHomEquiv (ᘁY) (ᘁX) X (𝟙_ C)) (f ▷ ᘁY ≫ ε_ (ᘁY) Y) = (ᘁf) ≫ (ρ_ ᘁX).inv


theorem insert_idem (a : α) (s : Set α) : insert a (insert a s) = insert a s


theorem simple_iff_isSimpleModule : Simple (of R M) ↔ IsSimpleModule R M

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]

CategoryTheory.Simple (ModuleCat.of R M) ↔ IsSimpleModule R M


@[simp] lemma latticeClosure_univ : latticeClosure (Set.univ : Set α) = Set.univ


@[to_additive (attr := simp)]
theorem smul_iterate [MulAction G H] : (a • · : H → H)^[n] = (a ^ n • ·)

{G : Type u_3}
{H : Type u_4}
[AddMonoid G]
(a : G)
(n : ℕ)
[AddAction G H]

(fun x => a +ᵥ x)^[n] = fun x => n • a +ᵥ x


theorem frequently_smallSets {p : Set α → Prop} :
    (∃ᶠ s in l.smallSets, p s) ↔ ∀ t ∈ l, ∃ s, s ⊆ t ∧ p s

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

(∃ᶠ (s : Set α) in l.smallSets, p s) ↔ ∀ t ∈ l, ∃ s ⊆ t, p s


@[simp]
theorem smulAddHom_apply (r : R) (x : M) : smulAddHom R M r x = r • x

{R : Type u_2}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(r : R)
(x : M)


/-- A linearly-independent family of vectors in a module over a non-trivial ring must be finite if
the module is Noetherian. -/
theorem LinearIndependent.finite_of_isNoetherian [Nontrivial R] {ι} {v : ι → M}
    (hv : LinearIndependent R v) : Finite ι

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
[IsNoetherian R M]
[Nontrivial R]
{ι : Type u_4}
{v : ι → M}
(hv : LinearIndependent R v)


@[simp] lemma natCast_eq_zero {a n : ℕ} [NeZero n] : (a : Fin n) = 0 ↔ n ∣ a


theorem append_concat (a : α) (l₁ l₂ : List α) : l₁ ++ concat l₂ a = concat (l₁ ++ l₂) a


@[reassoc]
theorem fac_pull : (A.pull θ).e ≫ image.ι (θ.unop ≫ A.e) = θ.unop ≫ A.e

(A : SimplicialObject.Splitting.IndexSet Δ)

(θ : Δ ⟶ Δ')

(A.pull θ).e ≫ CategoryTheory.Limits.image.ι (θ.unop ≫ A.e) = θ.unop ≫ A.e


@[reassoc (attr := simp)]
theorem pullbackRightPullbackFstIso_inv_snd_fst :
    (pullbackRightPullbackFstIso f g f').inv ≫ pullback.snd _ _ ≫ pullback.fst _ _ =
      pullback.fst _ _ ≫ f'

[CategoryTheory.Limits.HasPullback f' (CategoryTheory.Limits.pullback.fst f g)]

[CategoryTheory.Limits.HasPullback (f' ≫ f) g]

(CategoryTheory.Limits.pullbackRightPullbackFstIso f g f').inv ≫
    CategoryTheory.Limits.pullback.snd f' (CategoryTheory.Limits.pullback.fst f g) ≫
      CategoryTheory.Limits.pullback.fst f g =
  CategoryTheory.Limits.pullback.fst (f' ≫ f) g ≫ f'


/-- Submonoid closure of a set is monotone in its argument: if `s ⊆ t`,
then `closure s ≤ closure t`. -/
@[to_additive
      "Additive submonoid closure of a set is monotone in its argument: if `s ⊆ t`,
      then `closure s ≤ closure t`"]
theorem closure_mono ⦃s t : Set M⦄ (h : s ⊆ t) : closure s ≤ closure t

{M : Type u_1}
[AddZeroClass M]
⦃s t : Set M⦄
(h : s ⊆ t)

AddSubmonoid.closure s ≤ AddSubmonoid.closure t


lemma le_traceDual_iff_map_le_one {I J : Submodule B L} :
    I ≤ Jᵛ ↔ ((I * J : Submodule B L).restrictScalars A).map
      ((trace K L).restrictScalars A) ≤ 1

{A : Type u_1}
{K : Type u_2}
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
{I J : Submodule B L}

I ≤ Submodule.traceDual A K J ↔ Submodule.map (↑A (Algebra.trace K L)) (Submodule.restrictScalars A (I * J)) ≤ 1


/-- A subring is closed under multiplication. -/
protected theorem mul_mem {x y : R} : x ∈ s → y ∈ s → x * y ∈ s

{R : Type u}
[Ring R]
(s : Subring R)
{x y : R}


theorem isIdempotentComplete_of_isIdempotentComplete_opposite (h : IsIdempotentComplete Cᵒᵖ) :
    IsIdempotentComplete C

(h : CategoryTheory.IsIdempotentComplete Cᵒᵖ)


theorem vsub_le_vsub : f₁ ≤ f₂ → g₁ ≤ g₂ → f₁ -ᵥ g₁ ≤ f₂ -ᵥ g₂

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{f₁ f₂ g₁ g₂ : Filter β}

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


theorem toDistrib_injective : Function.Injective (@toDistrib R)


/-- Implementation of `Mon_.hasLimits`: a limiting cone over a functor `F : J ⥤ Mon_ C`.
-/
@[simps]
def limitCone (F : J ⥤ Mon_ C) : Cone F


@[simp]
theorem top_toSubmodule : (⊤ : NonUnitalSubalgebra R A).toSubmodule = ⊤

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]


theorem eqOn_dslope_slope (f : 𝕜 → E) (a : 𝕜) : EqOn (dslope f a) (slope f a) {a}ᶜ

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


@[simp]
theorem coe_ringHom_refl : (RingEquiv.refl R : R →+* R) = RingHom.id R


@[to_additive (attr := simp)]
theorem toTopologicalSpace_le {x y : GroupTopology α} :
    x.toTopologicalSpace ≤ y.toTopologicalSpace ↔ x ≤ y

{α : Type u}
[AddGroup α]
{x y : AddGroupTopology α}


/-- See also `leOnePart_eq_one`. -/
@[to_additive "See also `negPart_eq_zero`."]
lemma leOnePart_eq_one' : a⁻ᵐ = 1 ↔ a⁻¹ ≤ 1

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

a⁻ᵐ = 1 ↔ a⁻¹ ≤ 1


@[simp]
theorem support_eq_empty_iff {x : HahnSeries Γ R} : x.support = ∅ ↔ x = 0

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


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

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

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

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


/-- Expression for `hurwitzZeta a 1` as a limit. (Mathematically `hurwitzZeta a 1` is
undefined, but our construction assigns some value to it; this lemma is mostly of interest for
determining what that value is). -/
lemma tendsto_hurwitzZeta_sub_one_div_nhds_one (a : UnitAddCircle) :
    Tendsto (fun s ↦ hurwitzZeta a s - 1 / (s - 1) / Gammaℝ s) (𝓝 1) (𝓝 (hurwitzZeta a 1))

Filter.Tendsto (fun s => HurwitzZeta.hurwitzZeta a s - 1 / (s - 1) / s.Gammaℝ) (𝓝 1) (𝓝 (HurwitzZeta.hurwitzZeta a 1))


theorem lift_comp {α} {β} {γ} [AddCommGroup γ] (f : α → β) (g : β → γ) (x : FreeAbelianGroup α) :
    lift (g ∘ f) x = lift g (map f x)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommGroup γ]
(f : α → β)
(g : β → γ)
(x : FreeAbelianGroup α)

(FreeAbelianGroup.lift (g ∘ f)) x = (FreeAbelianGroup.lift g) ((FreeAbelianGroup.map f) x)


theorem single_eq_of_ne {i i' b} (h : i ≠ i') : (single i b : Π₀ i, β i) i' = 0

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
{i i' : ι}
{b : β i}
(h : i ≠ i')


@[to_additive top_prod]
theorem top_prod (s : Subsemigroup N) : (⊤ : Subsemigroup M).prod s = s.comap (MulHom.snd M N)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(s : Subsemigroup N)

⊤.prod s = Subsemigroup.comap (MulHom.snd M N) s


@[simp]
theorem sum_C_index {a} {β} [AddCommMonoid β] {f : ℕ → R → β} (h : f 0 0 = 0) :
    (C a).sum f = f 0 a

{R : Type u}
[Semiring R]
{a : R}
{β : Type u_1}
[AddCommMonoid β]
{f : ℕ → R → β}
(h : f 0 0 = 0)


protected theorem IsLeftRegular.star [Mul R] [StarMul R] {x : R} (hx : IsLeftRegular x) :
    IsRightRegular (star x)

{R : Type u}
[Mul R]
[StarMul R]
{x : R}
(hx : IsLeftRegular x)


@[to_additive (attr := simp)]
theorem mem_top (x : M) : x ∈ (⊤ : Submonoid M)


lemma hurwitzZeta_one_sub (a : UnitAddCircle) {s : ℂ}
    (hs : ∀ (n : ℕ), s ≠ -n) (hs' : a ≠ 0 ∨ s ≠ 1) :
    hurwitzZeta a (1 - s) = (2 * π) ^ (-s) * Gamma s *
    (exp (-π * I * s / 2) * expZeta a s + exp (π * I * s / 2) * expZeta (-a) s)

(a : UnitAddCircle)
{s : ℂ}
(hs : ∀ (n : ℕ), s ≠ -↑n)
(hs' : a ≠ 0 ∨ s ≠ 1)

HurwitzZeta.hurwitzZeta a (1 - s) =
  (2 * ↑π) ^ (-s) * Complex.Gamma s *
    (cexp (-↑π * Complex.I * s / 2) * HurwitzZeta.expZeta a s +
      cexp (↑π * Complex.I * s / 2) * HurwitzZeta.expZeta (-a) s)


@[simp]
lemma RingEquiv_coe_eq {X Y : Type _} [CommSemiring X] [CommSemiring Y] (e : X ≃+* Y) :
    (@DFunLike.coe (CommSemiRingCat.of X ⟶ CommSemiRingCat.of Y) _
      (fun _ => (forget CommSemiRingCat).obj _)
      ConcreteCategory.instFunLike (e : X →+* Y) : X → Y) = ↑e

{X Y : Type u_1}
[CommSemiring X]
[CommSemiring Y]
(e : X ≃+* Y)


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

ENNReal.ofReal r ≤ OfNat.ofNat n ↔ r ≤ OfNat.ofNat n


theorem nhdsWithin_Ici_basis_Ico [NoMaxOrder α] (a : α) :
    (𝓝[≥] a).HasBasis (fun u => a < u) (Ico a)

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[NoMaxOrder α]
(a : α)

(𝓝[≥] a).HasBasis (fun u => a < u) (Set.Ico a)


theorem isOpen_of_mem_countableBasis [SecondCountableTopology α] {s : Set α}
    (hs : s ∈ countableBasis α) : IsOpen s

(hs : s ∈ TopologicalSpace.countableBasis α)


/-- A subgroupoid is normal if it is wide and satisfies the expected stability under conjugacy. -/
structure IsNormal extends IsWide S : Prop where
  conj : ∀ {c d} (p : c ⟶ d) {γ : c ⟶ c}, γ ∈ S.arrows c c → Groupoid.inv p ≫ γ ≫ p ∈ S.arrows d d

{C : Type u}
[CategoryTheory.Groupoid C]
{S : CategoryTheory.Subgroupoid C}
(self : S.IsNormal)
{c d : C}
(p : c ⟶ d)
{γ : c ⟶ c}

γ ∈ S.arrows c c →
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Groupoid.inv p) (CategoryTheory.CategoryStruct.comp γ p) ∈
    S.arrows d d


@[simp]
theorem Perm.subtypeCongr.refl :
    Perm.subtypeCongr (Equiv.refl { a // p a }) (Equiv.refl { a // ¬p a }) = Equiv.refl ε

{ε : Type u_1}
{p : ε → Prop}
[DecidablePred p]

Equiv.Perm.subtypeCongr (Equiv.refl { a // p a }) (Equiv.refl { a // ¬p a }) = Equiv.refl ε


theorem EventuallyLE.prod_map {δ} [LE γ] [LE δ] {la : Filter α} {fa ga : α → γ} (ha : fa ≤ᶠ[la] ga)
    {lb : Filter β} {fb gb : β → δ} (hb : fb ≤ᶠ[lb] gb) :
    Prod.map fa fb ≤ᶠ[la ×ˢ lb] Prod.map ga gb

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_6}
[LE γ]
[LE δ]
{la : Filter α}
{fa ga : α → γ}
(ha : fa ≤ᶠ[la] ga)
{lb : Filter β}
{fb gb : β → δ}
(hb : fb ≤ᶠ[lb] gb)


theorem summable_norm_pow_mul_geometric_of_norm_lt_one {R : Type*} [NormedRing R] (k : ℕ) {r : R}
    (hr : ‖r‖ < 1) : Summable fun n : ℕ ↦ ‖((n : R) ^ k * r ^ n : R)‖

{R : Type u_4}
[NormedRing R]
(k : ℕ)
{r : R}
(hr : ‖r‖ < 1)


@[reassoc]
lemma leftRightHomologyComparison'_naturality (φ : S₁ ⟶ S₂) (h₁ : S₁.LeftHomologyData)
    (h₂ : S₁.RightHomologyData) (h₁' : S₂.LeftHomologyData) (h₂' : S₂.RightHomologyData) :
    leftHomologyMap' φ h₁ h₁' ≫ leftRightHomologyComparison' h₁' h₂' =
      leftRightHomologyComparison' h₁ h₂ ≫ rightHomologyMap' φ h₂ h₂'

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.leftHomologyMap' φ h₁ h₁')
    (CategoryTheory.ShortComplex.leftRightHomologyComparison' h₁' h₂') =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.leftRightHomologyComparison' h₁ h₂)
    (CategoryTheory.ShortComplex.rightHomologyMap' φ h₂ h₂')


theorem eventually_fintsupport_subset : ∀ᶠ y in 𝓝 x₀, ρ.fintsupport y ⊆ ρ.fintsupport 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}
(ρ : SmoothPartitionOfUnity ι I M s)
(x₀ : M)

∀ᶠ (y : M) in 𝓝 x₀, ρ.fintsupport y ⊆ ρ.fintsupport x₀


theorem subsingleton_range {α : Sort*} [Subsingleton α] (f : α → β) : (range f).Subsingleton

{β : Type u_2}
{α : Sort u_6}
[Subsingleton α]
(f : α → β)


/-- The `Ideal` version of `Set.image_subset_preimage_of_inverse`. -/
theorem map_le_comap_of_inverse (g : G) (I : Ideal R) (h : Function.LeftInverse g f) :
    I.map f ≤ I.comap g

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
(f : F)
{G : Type u_2}
[FunLike G S R]
[rcg : RingHomClass G S R]
(g : G)
(I : Ideal R)
(h : Function.LeftInverse ⇑g ⇑f)


/-- Dirac delta measures at two different points are different, assuming the measurable space
separates points. -/
lemma dirac_ne_dirac [SeparatesPoints α] {x y : α} (x_ne_y : x ≠ y) :
    Measure.dirac x ≠ Measure.dirac y

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSpace.SeparatesPoints α]
{x y : α}
(x_ne_y : x ≠ y)

MeasureTheory.Measure.dirac x ≠ MeasureTheory.Measure.dirac y


/-- This is the `List.prod` version of `mul_inv_rev` -/
@[to_additive "This is the `List.sum` version of `add_neg_rev`"]
theorem prod_inv_reverse : ∀ L : List G, L.prod⁻¹ = (L.map fun x => x⁻¹).reverse.prod

{G : Type u_7}
[AddGroup G]
(L : List G)

-L.sum = (List.map (fun x => -x) L).reverse.sum


@[simp] lemma symmDiff_eq_empty : s ∆ t = ∅ ↔ s = t

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


lemma pos_of_smul_pos_left [PosSMulReflectLT α β] (h : 0 < a • b) (ha : 0 ≤ a) : 0 < b

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Zero α]
[Zero β]
[SMulZeroClass α β]
[Preorder α]
[Preorder β]
[PosSMulReflectLT α β]
(h : 0 < a • b)
(ha : 0 ≤ a)


theorem piecewise_preimage (f g : α → β) (t) : s.piecewise f g ⁻¹' t = s.ite (f ⁻¹' t) (g ⁻¹' t)

{α : Type u_1}
{β : Type u_2}
(s : Set α)
[(j : α) → Decidable (j ∈ s)]
(f g : α → β)
(t : Set β)


protected theorem one_mul : (1 : Submodule R A) * M = M

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(M : Submodule R A)


theorem lt_sub {a b c : Ordinal} : a < b - c ↔ c + a < b


theorem smoothOn_iff :
    SmoothOn I I' f s ↔
      ContinuousOn f s ∧
        ∀ (x : M) (y : M'),
          ContDiffOn 𝕜 ⊤ (extChartAt I' y ∘ f ∘ (extChartAt I x).symm)
            ((extChartAt I x).target ∩
              (extChartAt I x).symm ⁻¹' (s ∩ f ⁻¹' (extChartAt I' y).source))

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

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


protected theorem IsExtreme.mono (hAC : IsExtreme 𝕜 A C) (hBA : B ⊆ A) (hCB : C ⊆ B) :
    IsExtreme 𝕜 B C

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{A B C : Set E}
(hAC : IsExtreme 𝕜 A C)
(hBA : B ⊆ A)
(hCB : C ⊆ B)


lemma root_apply_cartanEquivDual_symm_ne_zero {α : Weight K H L} (hα : α.IsNonZero) :
    α ((cartanEquivDual H).symm α) ≠ 0

{K : Type u_2}
{L : Type u_3}
[LieRing L]
[Field K]
[LieAlgebra K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
[LieAlgebra.IsKilling K L]
[CharZero K]
{α : LieModule.Weight K (↥H) L}
(hα : α.IsNonZero)

α ((LieAlgebra.IsKilling.cartanEquivDual H).symm (LieModule.Weight.toLinear K (↥H) L α)) ≠ 0


theorem IsNormal.nfp_le_apply {f} (H : IsNormal f) {a b} : nfp f a ≤ f b ↔ nfp f a ≤ b

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

Ordinal.nfp f a ≤ f b ↔ Ordinal.nfp f a ≤ b


theorem smul_strictMono_right [SMul M α] [Preorder α] [CovariantClass M α HSMul.hSMul LT.lt]
    (m : M) : StrictMono (HSMul.hSMul m : α → α)

{M : Type u_2}
{α : Type u_3}
[SMul M α]
[Preorder α]
[CovariantClass M α HSMul.hSMul LT.lt]
(m : M)


@[simp]
theorem coe_copy (S : NonUnitalStarSubsemiring R) (s : Set R) (hs : s = ↑S) :
    (S.copy s hs : Set R) = s

{R : Type v}
[NonUnitalNonAssocSemiring R]
[StarRing R]
(S : NonUnitalStarSubsemiring R)
(s : Set R)
(hs : s = ↑S)


theorem choose_eq_factorial_div_factorial {n k : ℕ} (hk : k ≤ n) :
    choose n k = n ! / (k ! * (n - k)!)


@[simp]
theorem decode_option_zero [Encodable α] : (decode 0 : Option (Option α))= some none


theorem uniqueMDiffWithinAt_univ : UniqueMDiffWithinAt I univ x

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


theorem le_weight (w : σ → ℕ) {s : σ} (hs : w s ≠ 0) (f : σ →₀ ℕ) :
    f s ≤ weight w f

{σ : Type u_1}
(w : σ → ℕ)
{s : σ}
(hs : w s ≠ 0)
(f : σ →₀ ℕ)


theorem Filter.le_lift'_closure (l : Filter X) : l ≤ l.lift' closure

{X : Type u}
[TopologicalSpace X]
(l : Filter X)


theorem isLeftInversion_mul_right_iff {w : W} :
    cs.IsLeftInversion (t * w) t ↔ ¬cs.IsLeftInversion w t

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
{cs : CoxeterSystem M W}
{t : W}
(ht : cs.IsReflection t)
{w : W}


lemma coprime_div_gcd_of_squarefree (hm : Squarefree m) (hn : n ≠ 0) : Coprime (m / gcd m n) n

{m n : ℕ}
(hm : Squarefree m)
(hn : n ≠ 0)


theorem IsCycle.pow_eq_one_iff [Finite β] {f : Perm β} (hf : IsCycle f) {n : ℕ} :
    f ^ n = 1 ↔ ∃ x, f x ≠ x ∧ (f ^ n) x = x

{β : Type u_3}
[Finite β]
{f : Equiv.Perm β}
(hf : f.IsCycle)
{n : ℕ}


theorem extraction_of_eventually_atTop {P : ℕ → Prop} (h : ∀ᶠ n in atTop, P n) :
    ∃ φ : ℕ → ℕ, StrictMono φ ∧ ∀ n, P (φ n)

{P : ℕ → Prop}
(h : ∀ᶠ (n : ℕ) in Filter.atTop, P n)


@[ext]
protected theorem ext (f g : α →𝒄 β) (h : ∀ x, f x = g x) : f = g

{α : Type u}
{β : Type v}
[OmegaCompletePartialOrder α]
[OmegaCompletePartialOrder β]
(f g : α →𝒄 β)
(h : ∀ (x : α), f x = g x)


@[simp]
theorem invUnitsSub_mul_X (u : Rˣ) : invUnitsSub u * X = invUnitsSub u * C R u - 1

PowerSeries.invUnitsSub u * PowerSeries.X = PowerSeries.invUnitsSub u * (PowerSeries.C R) ↑u - 1


@[to_additive (attr := simp)]
theorem mul_comp {G : Type*} [Mul G] [TopologicalSpace G] [ChartedSpace H' G] [SmoothMul I' G]
    (f g : C^∞⟮I'', N'; I', G⟯) (h : C^∞⟮I, N; I'', N'⟯) : (f * g).comp h = f.comp h * g.comp h

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{H' : Type u_5}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{E'' : Type u_7}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_8}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{N' : Type u_9}
[TopologicalSpace N']
[ChartedSpace H'' N']
{G : Type u_10}
[Add G]
[TopologicalSpace G]
[ChartedSpace H' G]
[SmoothAdd I' G]
(f g : C^⊤⟮I'', N'; I', G⟯)
(h : C^⊤⟮I, N; I'', N'⟯)


theorem toFractionRing_smul [SMul R (FractionRing K[X])] (c : R) (p : RatFunc K) :
    toFractionRing (c • p) = c • toFractionRing p

{K : Type u}
[CommRing K]
{R : Type u_1}
[SMul R (FractionRing K[X])]
(c : R)
(p : RatFunc K)

(c • p).toFractionRing = c • p.toFractionRing


@[to_additive (attr := simp)]
theorem map_op_nhds (x : M) : map (op : M → Mᵐᵒᵖ) (𝓝 x) = 𝓝 (op x)

{M : Type u_1}
[TopologicalSpace M]
(x : M)

Filter.map MulOpposite.op (𝓝 x) = 𝓝 (MulOpposite.op x)


theorem foldl_op_eq_op_foldr_assoc :
    ∀ {l : List α} {a₁ a₂}, ((l <*> a₁) ⋆ a₂) = a₁ ⋆ l.foldr (· ⋆ ·) a₂

{α : Type u}
{op : α → α → α}
[ha : Std.Associative op]
{l : List α}
{a₁ a₂ : α}

op (List.foldl op a₁ l) a₂ = op a₁ (List.foldr (fun x x_1 => op x x_1) a₂ l)


theorem strictMonoOn_projIci : StrictMonoOn (projIci a) (Ici a)

StrictMonoOn (Set.projIci a) (Set.Ici a)


private lemma card_badVertices_le (dst : 2 * ε ≤ G.edgeDensity s t) (hst : G.IsUniform ε s t) :
    (badVertices G ε s t).card ≤ s.card * ε

{α : Type u_1}
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : ℝ}
{s t : Finset α}
(dst : 2 * ε ≤ ↑(G.edgeDensity s t))
(hst : G.IsUniform ε s t)

↑(SimpleGraph.badVertices G ε s t).card ≤ ↑s.card * ε


theorem IsLUB.upperBounds_eq (h : IsLUB s a) : upperBounds s = Ici a

{α : Type u}
[Preorder α]
{s : Set α}
{a : α}
(h : IsLUB s a)


/-- An auxiliary structure, used to define `S.index`. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
@[ext]
structure Arrow (S : J.Cover X) where
  /-- The source of the arrow. -/
  Y : C
  /-- The arrow itself. -/
  f : Y ⟶ X
  /-- The given arrow is contained in the given sieve. -/
  hf : S f

{J : CategoryTheory.GrothendieckTopology C}


lemma ConcaveOn.smul' (hf : ConcaveOn 𝕜 s f) (hg : ConcaveOn 𝕜 s g) (hf₀ : ∀ ⦃x⦄, x ∈ s → 0 ≤ f x)
    (hg₀ : ∀ ⦃x⦄, x ∈ s → 0 ≤ g x) (hfg : AntivaryOn f g s) : ConcaveOn 𝕜 s (f • g)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[LinearOrderedCommRing 𝕜]
[LinearOrderedCommRing E]
[LinearOrderedAddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
[Module E F]
[IsScalarTower 𝕜 E F]
[SMulCommClass 𝕜 E F]
[OrderedSMul 𝕜 E]
[OrderedSMul 𝕜 F]
[OrderedSMul E F]
{s : Set 𝕜}
{f : 𝕜 → E}
{g : 𝕜 → F}
(hf : ConcaveOn 𝕜 s f)
(hg : ConcaveOn 𝕜 s g)
(hf₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → 0 ≤ f x)
(hg₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → 0 ≤ g x)
(hfg : AntivaryOn f g s)


protected theorem continuousOn (hf : ApproximatesLinearOn f f' s c) : ContinuousOn f s

{𝕜 : 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}
{s : Set E}
{c : ℝ≥0}
(hf : ApproximatesLinearOn f f' s c)


/-- The square
```
  X --inl--> X ⊞ Y
  |            |
  0           snd
  |            |
  v            v
  0 ---0-----> Y
```
is a pullback square.
-/
@[simp]
theorem inl_snd (X Y : C) [HasBinaryBiproduct X Y] :
    IsPullback biprod.inl (0 : X ⟶ 0) biprod.snd (0 : 0 ⟶ Y)

CategoryTheory.IsPullback CategoryTheory.Limits.biprod.inl 0 CategoryTheory.Limits.biprod.snd 0


/-- If `C` has limits then any reflective subcategory has limits. -/
theorem hasLimits_of_reflective (R : D ⥤ C) [HasLimitsOfSize.{v, u} C] [Reflective R] :
    HasLimitsOfSize.{v, u} D

[CategoryTheory.Limits.HasLimitsOfSize.{v, u, v₁, u₁} C]

CategoryTheory.Limits.HasLimitsOfSize.{v, u, v₂, u₂} D


theorem lt_or_equiv_of_le {x y : PGame} (h : x ≤ y) : x < y ∨ (x ≈ y)


theorem natDegree_of_c_eq_zero' : (toPoly ⟨0, 0, 0, d⟩).natDegree = 0

{ a := 0, b := 0, c := 0, d := d }.toPoly.natDegree = 0


/-- Given an action of a group `α` on `β`, each `g : α` defines a permutation of `β`. -/
@[to_additive (attr := simps)]
def MulAction.toPerm (a : α) : Equiv.Perm β

{α : Type u_1}
{β : Type u_2}
[AddGroup α]
[AddAction α β]
(a : α)
(x : β)


theorem affineSegment_comm (x y : P) : affineSegment R x y = affineSegment R y x

(R : Type u_1)
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(x y : P)


@[simp] theorem comp_apply {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : (f ≫ g) x = g (f x)

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

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


/-- An n-ary version of `Set.mul_subset_mul`. -/
@[to_additive " An n-ary version of `Set.add_subset_add`. "]
theorem finset_prod_subset_finset_prod (t : Finset ι) (f₁ f₂ : ι → Set α)
    (hf : ∀ i ∈ t, f₁ i ⊆ f₂ i) : ∏ i ∈ t, f₁ i ⊆ ∏ i ∈ t, f₂ i

{ι : Type u_1}
{α : Type u_2}
[AddCommMonoid α]
(t : Finset ι)
(f₁ f₂ : ι → Set α)
(hf : ∀ i ∈ t, f₁ i ⊆ f₂ i)


lemma restrictSubtype_basis_iff {Y : Set α} {I X : Set Y} :
    (M.restrictSubtype Y).Basis I X ↔ M.Basis' I X

{α : Type u_1}
{M : Matroid α}
{Y : Set α}
{I X : Set ↑Y}

(M.restrictSubtype Y).Basis I X ↔ M.Basis' ↑I ↑X


nonrec theorem sinh_sq : sinh x ^ 2 = cosh x ^ 2 - 1


theorem prev_ne_cons_cons (y z : α) (h : x ∈ y :: z :: l) (hy : x ≠ y) (hz : x ≠ z) :
    prev (y :: z :: l) x h = prev (z :: l) x (by simpa [hy] using h)

{α : Type u_1}
[DecidableEq α]
(l : List α)
(x y z : α)
(h : x ∈ y :: z :: l)
(hy : x ≠ y)
(hz : x ≠ z)

(y :: z :: l).prev x h = (z :: l).prev x ⋯


/-- An induction principle for permutations. If `P` holds for the identity permutation, and
is preserved under composition with a non-trivial swap, then `P` holds for all permutations. -/
@[elab_as_elim]
theorem swap_induction_on [Finite α] {P : Perm α → Prop} (f : Perm α) :
    P 1 → (∀ f x y, x ≠ y → P f → P (swap x y * f)) → P f

{α : Type u}
[DecidableEq α]
[Finite α]
{P : Equiv.Perm α → Prop}
(f : Equiv.Perm α)

P 1 → (∀ (f : Equiv.Perm α) (x y : α), x ≠ y → P f → P (Equiv.swap x y * f)) → P f


theorem shift_shiftFunctorCompIsoId_hom_app (n m : A) (h : n + m = 0) (X : C) :
    ((shiftFunctorCompIsoId C n m h).hom.app X)⟦n⟧' =
    (shiftFunctorCompIsoId C m n
      (by rw [← neg_eq_of_add_eq_zero_left h, add_right_neg])).hom.app (X⟦n⟧)

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddGroup A]
[CategoryTheory.HasShift C A]
(n m : A)
(h : n + m = 0)
(X : C)

(CategoryTheory.shiftFunctor C n).map ((CategoryTheory.shiftFunctorCompIsoId C n m h).hom.app X) =
  (CategoryTheory.shiftFunctorCompIsoId C m n ⋯).hom.app ((CategoryTheory.shiftFunctor C n).obj X)


/-- Paste two pullback squares "vertically" to obtain another pullback square.

The objects in the statement fit into the following diagram:
```
X₁₁ - h₁₁ -> X₁₂
|            |
v₁₁          v₁₂
↓            ↓
X₂₁ - h₂₁ -> X₂₂
|            |
v₂₁          v₂₂
↓            ↓
X₃₁ - h₃₁ -> X₃₂
```
-/
theorem paste_vert {X₁₁ X₁₂ X₂₁ X₂₂ X₃₁ X₃₂ : C} {h₁₁ : X₁₁ ⟶ X₁₂} {h₂₁ : X₂₁ ⟶ X₂₂}
    {h₃₁ : X₃₁ ⟶ X₃₂} {v₁₁ : X₁₁ ⟶ X₂₁} {v₁₂ : X₁₂ ⟶ X₂₂} {v₂₁ : X₂₁ ⟶ X₃₁} {v₂₂ : X₂₂ ⟶ X₃₂}
    (s : IsPullback h₁₁ v₁₁ v₁₂ h₂₁) (t : IsPullback h₂₁ v₂₁ v₂₂ h₃₁) :
    IsPullback h₁₁ (v₁₁ ≫ v₂₁) (v₁₂ ≫ v₂₂) h₃₁

{X₁₁ X₁₂ X₂₁ X₂₂ X₃₁ X₃₂ : C}

{h₁₁ : X₁₁ ⟶ X₁₂}

{h₂₁ : X₂₁ ⟶ X₂₂}

{h₃₁ : X₃₁ ⟶ X₃₂}

{v₁₁ : X₁₁ ⟶ X₂₁}

{v₁₂ : X₁₂ ⟶ X₂₂}

{v₂₁ : X₂₁ ⟶ X₃₁}

{v₂₂ : X₂₂ ⟶ X₃₂}

(s : CategoryTheory.IsPullback h₁₁ v₁₁ v₁₂ h₂₁)

(t : CategoryTheory.IsPullback h₂₁ v₂₁ v₂₂ h₃₁)

CategoryTheory.IsPullback h₁₁ (v₁₁ ≫ v₂₁) (v₁₂ ≫ v₂₂) h₃₁


/-- The functor `Sigma.map` applied to the identity function is just the identity functor. -/
@[simps!]
def mapId : map C (id : I → I) ≅ 𝟭 (Σi, C i)

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

∀ (x : (i : I) × (fun i => C (id i)) i),
  (CategoryTheory.Sigma.mapId I C).inv.app x = CategoryTheory.CategoryStruct.id ⟨x.fst, x.snd⟩


/-- Basic hypothesis to talk about a topological space with a continuous `star` operator. -/
class ContinuousStar (R : Type*) [TopologicalSpace R] [Star R] : Prop where
  /-- The `star` operator is continuous. -/
  continuous_star : Continuous (star : R → R)

{R : Type u_1}
[TopologicalSpace R]
[Star R]
[self : ContinuousStar R]


@[to_additive] lemma mulDissociated_iff_sum_eq_subsingleton :
    MulDissociated s ↔ ∀ a, {t : Finset α | ↑t ⊆ s ∧ ∏ x in t, x = a}.Subsingleton

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

MulDissociated s ↔ ∀ (a : α), {t | ↑t ⊆ s ∧ ∏ x ∈ t, x = a}.Subsingleton


@[to_additive]
theorem finiteIndex_of_le [FiniteIndex H] (h : H ≤ K) : FiniteIndex K

{G : Type u_1}
[Group G]
{H K : Subgroup G}
[H.FiniteIndex]
(h : H ≤ K)


@[to_additive (attr := measurability)]
protected theorem smul_const {𝕜} [TopologicalSpace 𝕜] [SMul 𝕜 β] [ContinuousSMul 𝕜 β] {f : α → 𝕜}
    (hf : StronglyMeasurable f) (c : β) : StronglyMeasurable fun x => f x • c

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable fun x => f x +ᵥ c


@[to_additive]
theorem map.comp {γ : Type w} (f : α → β) (g : β → γ) (x) :
    map g (map f x) = map (g ∘ f) x

{α : Type u}
{β : Type v}
{γ : Type w}
(f : α → β)
(g : β → γ)
(x : FreeGroup α)

(FreeGroup.map g) ((FreeGroup.map f) x) = (FreeGroup.map (g ∘ f)) x


/-- If the restrictions of a measure to a monotone sequence of sets covering the space are
inner regular for some property `p` and all measurable sets, then the measure itself is
inner regular. -/
lemma of_restrict {μ : Measure α} {s : ℕ → Set α}
    (h : ∀ n, InnerRegularWRT (μ.restrict (s n)) p MeasurableSet)
    (hs : univ ⊆ ⋃ n, s n) (hmono : Monotone s) : InnerRegularWRT μ p MeasurableSet

(h : ∀ (n : ℕ), (μ.restrict (s n)).InnerRegularWRT p MeasurableSet)


theorem single_one_eq_pow {R : Type _} [Ring R] (n : ℕ) :
    single (n : ℤ) (1 : R) = single (1 : ℤ) 1 ^ n

(HahnSeries.single ↑n) 1 = (HahnSeries.single 1) 1 ^ n


@[to_additive AddLocalization.r_iff_exists]
theorem r_iff_exists {x y : M × S} : r S x y ↔ ∃ c : S, ↑c * (↑y.2 * x.1) = c * (x.2 * y.1)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{x y : M × ↥S}

(AddLocalization.r S) x y ↔ ∃ c, ↑c + (↑y.2 + x.1) = ↑c + (↑x.2 + y.1)


/-- If a Cauchy sequence has a convergent subsequence, then it converges. -/
theorem tendsto_nhds_of_cauchySeq_of_subseq [Preorder β] {u : β → α} (hu : CauchySeq u)
    {ι : Type*} {f : ι → β} {p : Filter ι} [NeBot p] (hf : Tendsto f p atTop) {a : α}
    (ha : Tendsto (u ∘ f) p (𝓝 a)) : Tendsto u atTop (𝓝 a)

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
[Preorder β]
{u : β → α}
(hu : CauchySeq u)
{ι : Type u_1}
{f : ι → β}
{p : Filter ι}
[p.NeBot]
(hf : Filter.Tendsto f p Filter.atTop)
{a : α}
(ha : Filter.Tendsto (u ∘ f) p (𝓝 a))


@[simp] theorem length_iota (n : Nat) : length (iota n) = n


/-- The area form on an oriented real inner product space of dimension 2 can be evaluated in terms
of a complex-number representation of the space. -/
theorem areaForm_map_complex (f : E ≃ₗᵢ[ℝ] ℂ)
    (hf : Orientation.map (Fin 2) f.toLinearEquiv o = Complex.orientation) (x y : E) :
    ω x y = (conj (f x) * f y).im

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

(hf : (Orientation.map (Fin 2) f.toLinearEquiv) o = Complex.orientation)

(o.areaForm x) y = ((starRingEnd ℂ) (f x) * f y).im


@[simp]
theorem _root_.Cardinal.toPartENat_le_natCast_iff {c : Cardinal} {n : ℕ} :
    toPartENat c ≤ n ↔ c ≤ n


protected theorem measurableSet_ge' [TopologicalSpace ι] [OrderTopology ι]
    [FirstCountableTopology ι] (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[hτ.measurableSpace] {ω | i ≤ τ ω}

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
[TopologicalSpace ι]
[OrderTopology ι]
[FirstCountableTopology ι]
(hτ : MeasureTheory.IsStoppingTime f τ)
(i : ι)


/-- The fully faithful embedding of `FintypeCat` into the category of types. -/
@[simps!]
def incl : FintypeCat ⥤ Type*


@[simp] theorem toCoalgEquiv_toCoalgHom (i : X ≅ Y) :
    i.toCoalgEquiv = i.hom.toCoalgHom

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


theorem list_sum_pow_char (l : List R) : l.sum ^ p = (l.map (· ^ p : R → R)).sum

{R : Type u}
[CommSemiring R]
(p : ℕ)
[ExpChar R p]
(l : List R)

l.sum ^ p = (List.map (fun x => x ^ p) l).sum


theorem hasStrictDerivAt_log (hx : x ≠ 0) : HasStrictDerivAt log x⁻¹ x


@[simp] protected theorem inv_zero : (0 : Rat).inv = 0


/-- Extensionality rule for congruence relations. -/
@[to_additive (attr := ext) "Extensionality rule for additive congruence relations."]
theorem ext {c d : Con M} (H : ∀ x y, c x y ↔ d x y) : c = d

{M : Type u_1}
[Add M]
{c d : AddCon M}
(H : ∀ (x y : M), c x y ↔ d x y)


/-- A lax braided functor takes commutative monoid objects to commutative monoid objects.

That is, a lax braided functor `F : C ⥤ D` induces a functor `CommMon_ C ⥤ CommMon_ D`.
-/
@[simps!]
def mapCommMon (F : LaxBraidedFunctor C D) : CommMon_ C ⥤ CommMon_ D

(F : CategoryTheory.LaxBraidedFunctor C D)

(F.mapCommMon.obj A).one = F.ε ≫ F.map A.one


@[to_additive (attr := simp)]
lemma smul_set_disjoint_iff : Disjoint (a • s) (a • t) ↔ Disjoint s t

{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[AddAction α β]
{s t : Set β}
{a : α}

Disjoint (a +ᵥ s) (a +ᵥ t) ↔ Disjoint s t


@[simp]
theorem fromBlocks_apply₁₂ (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α)
    (D : Matrix o m α) (i : n) (j : m) : fromBlocks A B C D (Sum.inl i) (Sum.inr j) = B i j

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
(A : Matrix n l α)
(B : Matrix n m α)
(C : Matrix o l α)
(D : Matrix o m α)
(i : n)
(j : m)

Matrix.fromBlocks A B C D (Sum.inl i) (Sum.inr j) = B i j


theorem quotientToQuotientRangePowQuotSucc_injective [IsDedekindDomain S] [P.IsPrime]
    {i : ℕ} (hi : i < e) {a : S} (a_mem : a ∈ P ^ i) (a_not_mem : a ∉ P ^ (i + 1)) :
    Function.Injective (quotientToQuotientRangePowQuotSucc f p P a_mem)

[hfp : NeZero (Ideal.ramificationIdx f p P)]

Function.Injective ⇑(Ideal.quotientToQuotientRangePowQuotSucc f p P a_mem)


theorem compl_unique (h₀ : a ⊓ b = ⊥) (h₁ : a ⊔ b = ⊤) : aᶜ = b

{α : Type u_2}
[HeytingAlgebra α]
{a b : α}
(h₀ : a ⊓ b = ⊥)
(h₁ : a ⊔ b = ⊤)


theorem lt_trans {s₁ s₂ s₃ : String} : s₁ < s₂ → s₂ < s₃ → s₁ < s₃


theorem OneOneReducible.disjoin_left {α β} [Primcodable α] [Primcodable β] {p : α → Prop}
    {q : β → Prop} : p ≤₁ p ⊕' q

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{p : α → Prop}
{q : β → Prop}


/-- The spectrum, as a contravariant functor from commutative rings to schemes. -/
@[simps]
protected def Scheme.Spec : CommRingCatᵒᵖ ⥤ Scheme

AlgebraicGeometry.Scheme.Spec.obj R = AlgebraicGeometry.Spec (Opposite.unop R)


protected theorem inf_le_right (f g : α →ₘ[μ] β) : f ⊓ g ≤ g

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


theorem KerLift.map_smul (f : A →ₐ[R₁] B) (r : R₁) (x : A ⧸ (RingHom.ker f)) :
    f.kerLift (r • x) = r • f.kerLift x

{R₁ : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R₁]
[CommRing A]
[Algebra R₁ A]
[Semiring B]
[Algebra R₁ B]
(f : A →ₐ[R₁] B)
(r : R₁)
(x : A ⧸ RingHom.ker f)


theorem IsGLB.biUnion_Ioi_eq (h : IsGLB s a) : ⋃ x ∈ s, Ioi x = Ioi a

{α : Type v}
[LinearOrder α]
{s : Set α}
{a : α}
(h : IsGLB s a)


theorem mul_polyOfInterest_aux3 (n : ℕ) : wittPolyProd p (n + 1) =
    -((p : 𝕄) ^ (n + 1) * X (0, n + 1)) * ((p : 𝕄) ^ (n + 1) * X (1, n + 1)) +
    (p : 𝕄) ^ (n + 1) * X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p ℤ (n + 1)) +
    (p : 𝕄) ^ (n + 1) * X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p ℤ (n + 1)) +
    remainder p n

WittVector.wittPolyProd p (n + 1) =
  -(↑p ^ (n + 1) * MvPolynomial.X (0, n + 1)) * (↑p ^ (n + 1) * MvPolynomial.X (1, n + 1)) +
        ↑p ^ (n + 1) * MvPolynomial.X (0, n + 1) * (MvPolynomial.rename (Prod.mk 1)) (wittPolynomial p ℤ (n + 1)) +
      ↑p ^ (n + 1) * MvPolynomial.X (1, n + 1) * (MvPolynomial.rename (Prod.mk 0)) (wittPolynomial p ℤ (n + 1)) +
    WittVector.remainder p n


/-- If `f` is an `n` times continuously differentiable homeomorphism,
and if the derivative of `f` at each point is a continuous linear equivalence,
then `f.symm` is `n` times continuously differentiable.

This is one of the easy parts of the inverse function theorem: it assumes that we already have
an inverse function. -/
theorem Homeomorph.contDiff_symm [CompleteSpace E] (f : E ≃ₜ F) {f₀' : E → E ≃L[𝕜] F}
    (hf₀' : ∀ a, HasFDerivAt f (f₀' a : E →L[𝕜] F) a) (hf : ContDiff 𝕜 n (f : E → F)) :
    ContDiff 𝕜 n (f.symm : F → E)

(hf₀' : ∀ (a : E), HasFDerivAt (⇑f) (↑(f₀' a)) a)


theorem derivative_comp_one_sub_X (p : R[X]) :
    derivative (p.comp (1 - X)) = -p.derivative.comp (1 - X)

Polynomial.derivative (p.comp (1 - Polynomial.X)) = -(Polynomial.derivative p).comp (1 - Polynomial.X)


theorem log_opow {b : Ordinal} (hb : 1 < b) (x : Ordinal) : log b (b ^ x) = x

{b : Ordinal.{u_1}}
(hb : 1 < b)
(x : Ordinal.{u_1})


theorem mapsTo_iInter_iInter {s : ι → Set α} {t : ι → Set β} {f : α → β}
    (H : ∀ i, MapsTo f (s i) (t i)) : MapsTo f (⋂ i, s i) (⋂ i, t i)

(H : ∀ (i : ι), Set.MapsTo f (s i) (t i))


/-- Auxiliary lemma to prove that the composition of formal multilinear series is associative.

Consider a composition `a` of `n` and a composition `b` of `a.length`. Grouping together some
blocks of `a` according to `b` as in `a.gather b`, one can compute the total size of the blocks
of `a` up to an index `size_up_to b i + j` (where the `j` corresponds to a set of blocks of `a`
that do not fill a whole block of `a.gather b`). The first part corresponds to a sum of blocks
in `a.gather b`, and the second one to a sum of blocks in the next block of
`sigma_composition_aux a b`. This is the content of this lemma. -/
theorem sizeUpTo_sizeUpTo_add (a : Composition n) (b : Composition a.length) {i j : ℕ}
    (hi : i < b.length) (hj : j < blocksFun b ⟨i, hi⟩) :
    sizeUpTo a (sizeUpTo b i + j) =
      sizeUpTo (a.gather b) i +
        sizeUpTo (sigmaCompositionAux a b ⟨i, (length_gather a b).symm ▸ hi⟩) j

{n : ℕ}
(a : Composition n)
(b : Composition a.length)
{i j : ℕ}
(hi : i < b.length)
(hj : j < b.blocksFun ⟨i, hi⟩)

a.sizeUpTo (b.sizeUpTo i + j) = (a.gather b).sizeUpTo i + (a.sigmaCompositionAux b ⟨i, ⋯⟩).sizeUpTo j


@[simp] theorem cons_union (a : α) (l₁ l₂ : List α) :
    (a :: l₁) ∪ l₂ = (l₁ ∪ l₂).insert a

{α : Type u_1}
[BEq α]
(a : α)
(l₁ l₂ : List α)


/-- If `f : α → β` is a strictly monotonic function and `α` is an infinite dimensional type then so
  is `β`. -/
lemma infiniteDimensionalOrder_of_strictMono [Preorder α] [Preorder β]
    (f : α → β) (hf : StrictMono f) [InfiniteDimensionalOrder α] :
    InfiniteDimensionalOrder β

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


/-- -
If we have particular colimit cocones available for `E ⋙ F` and for `F`,
we obtain a formula for `colimit.pre F E`.
-/
theorem colimit.pre_eq (s : ColimitCocone (E ⋙ F)) (t : ColimitCocone F) :
    colimit.pre F E =
      (colimit.isoColimitCocone s).hom ≫
        s.isColimit.desc (t.cocone.whisker E) ≫ (colimit.isoColimitCocone t).inv

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

(s : CategoryTheory.Limits.ColimitCocone (E ⋙ F))

(t : CategoryTheory.Limits.ColimitCocone F)

CategoryTheory.Limits.colimit.pre F E =
  (CategoryTheory.Limits.colimit.isoColimitCocone s).hom ≫
    s.isColimit.desc (CategoryTheory.Limits.Cocone.whisker E t.cocone) ≫
      (CategoryTheory.Limits.colimit.isoColimitCocone t).inv


theorem eq_pellZd (b : ℤ√(d a1)) (b1 : 1 ≤ b) (hp : IsPell b) : ∃ n, b = pellZd a1 n

{a : ℕ}
(a1 : 1 < a)
(b : ℤ√↑(Pell.d a1))
(b1 : 1 ≤ b)
(hp : Pell.IsPell b)


@[to_additive]
lemma mem_of_mem_val_ofUnits (S : Subgroup Mˣ) {y : Mˣ} (hy : (y : M) ∈ S.ofUnits) : y ∈ S

{M : Type u_1}
[Monoid M]
(S : Subgroup Mˣ)
{y : Mˣ}
(hy : ↑y ∈ S.ofUnits)


theorem not_mem_sdiff_of_not_mem_left (h : a ∉ s) : a ∉ s \ t

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


theorem cthickening_subset_iUnion_closedBall_of_lt {α : Type*} [PseudoMetricSpace α] (E : Set α)
    {δ δ' : ℝ} (hδ₀ : 0 < δ') (hδδ' : δ < δ') : cthickening δ E ⊆ ⋃ x ∈ E, closedBall x δ'

{α : Type u_2}
[PseudoMetricSpace α]
(E : Set α)
{δ δ' : ℝ}
(hδ₀ : 0 < δ')
(hδδ' : δ < δ')

Metric.cthickening δ E ⊆ ⋃ x ∈ E, Metric.closedBall x δ'


theorem integrable_iff_finMeasSupp {f : α →ₛ E} : Integrable f μ ↔ f.FinMeasSupp μ

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

MeasureTheory.Integrable (↑f) μ ↔ f.FinMeasSupp μ


@[to_additive (attr := simp, norm_cast)]
theorem const_div [Div M] (a b : M) : (↑(a / b) : Germ l M) = ↑a / ↑b

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
[Div M]
(a b : M)


@[simp]
theorem squarefree_natCast {n : ℕ} : Squarefree (n : ℤ) ↔ Squarefree n


theorem wittStructureRat_prop (Φ : MvPolynomial idx ℚ) (n : ℕ) :
    bind₁ (wittStructureRat p Φ) (W_ ℚ n) = bind₁ (fun i => rename (Prod.mk i) (W_ ℚ n)) Φ

(p : ℕ)
{idx : Type u_2}
[hp : Fact (Nat.Prime p)]
(Φ : MvPolynomial idx ℚ)
(n : ℕ)

(MvPolynomial.bind₁ (wittStructureRat p Φ)) (W_ ℚ n) =
  (MvPolynomial.bind₁ fun i => (MvPolynomial.rename (Prod.mk i)) (W_ ℚ n)) Φ


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


@[simp]
theorem neighborSet_sInf (s : Set G.Subgraph) (v : V) :
    (sInf s).neighborSet v = (⋂ G' ∈ s, neighborSet G' v) ∩ G.neighborSet v

{V : Type u}
{G : SimpleGraph V}
(s : Set G.Subgraph)
(v : V)

(sInf s).neighborSet v = (⋂ G' ∈ s, G'.neighborSet v) ∩ G.neighborSet v


theorem rel_join {r : α → β → Prop} {s t} (h : Rel (Rel r) s t) : Rel r s.join t.join

{α : Type u_1}
{β : Type v}
{r : α → β → Prop}
{s : Multiset (Multiset α)}
{t : Multiset (Multiset β)}
(h : Multiset.Rel (Multiset.Rel r) s t)


theorem coeFn_injective : @Function.Injective (M₁ →SL[σ₁₂] M₂) (M₁ → M₂) (↑)

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]


@[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}
[AddZeroClass M]
(s : Set α)
(f : α → M)


/-- Two pseudo emetric space structures with the same edistance function coincide. -/
@[ext]
protected theorem PseudoEMetricSpace.ext {α : Type*} {m m' : PseudoEMetricSpace α}
    (h : m.toEDist = m'.toEDist) : m = m'

(h : PseudoEMetricSpace.toEDist = PseudoEMetricSpace.toEDist)


@[to_additive]
theorem nnnorm_le_nnnorm_add_nnnorm_div' (a b : E) : ‖a‖₊ ≤ ‖b‖₊ + ‖a / b‖₊

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

‖a‖₊ ≤ ‖b‖₊ + ‖a - b‖₊


@[simp]
theorem Tape.mk'_nth_nat {Γ} [Inhabited Γ] (L R : ListBlank Γ) (n : ℕ) :
    (Tape.mk' L R).nth n = R.nth n

{Γ : Type u_1}
[Inhabited Γ]
(L R : Turing.ListBlank Γ)
(n : ℕ)


theorem lowerBounds_image {s : Set α} : lowerBounds (f '' s) = f '' lowerBounds s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α ≃o β)
{s : Set α}

lowerBounds (⇑f '' s) = ⇑f '' lowerBounds s


theorem dvd_sub (h₁ : a ∣ b) (h₂ : a ∣ c) : a ∣ b - c

{α : Type u_1}
[NonUnitalRing α]
{a b c : α}
(h₁ : a ∣ b)
(h₂ : a ∣ c)


protected theorem congr_arg {f : Equiv α β} {x x' : α} : x = x' → f x = f x'

{α : Sort u}
{β : Sort v}
{f : α ≃ β}
{x x' : α}


theorem convolutionExistsAt_iff_integrable_swap :
    ConvolutionExistsAt f g x L μ ↔ Integrable (fun t => L (f (x - t)) (g t)) μ

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

MeasureTheory.ConvolutionExistsAt f g x L μ ↔ MeasureTheory.Integrable (fun t => (L (f (x - t))) (g t)) μ


/-- Auxiliary construction for `CliffordAlgebra.changeForm` -/
@[simps!]
def changeFormAux (B : BilinForm R M) : M →ₗ[R] CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(B : LinearMap.BilinForm R M)
(a : M)

∀ (a_1 : CliffordAlgebra Q),
  ((CliffordAlgebra.changeFormAux Q B) a) a_1 = (CliffordAlgebra.ι Q) a * a_1 - (CliffordAlgebra.contractLeft (B a)) a_1


/-- `simp` can prove this as `Basis.coe_reindex` + `EquivLike.range_comp` -/
theorem range_reindex : Set.range (b.reindex e) = Set.range b

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(e : ι ≃ ι')


theorem mul_emod (a b n : Int) : (a * b) % n = (a % n) * (b % n) % n


/-- The Hausdorff edistance between two sets is the smallest `r` such that each set
is contained in the `r`-neighborhood of the other one -/
irreducible_def hausdorffEdist {α : Type u} [PseudoEMetricSpace α] (s t : Set α) : ℝ≥0∞

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

EMetric.hausdorffEdist s t = (⨆ x ∈ s, EMetric.infEdist x t) ⊔ ⨆ y ∈ t, EMetric.infEdist y s


/-- Assume that a function `f` has a derivative at every point of a set `s`. Then one may
partition `s` into countably many disjoint relatively measurable sets (i.e., intersections
of `s` with measurable sets `t n`) on which `f` is well approximated by linear maps `A n`. -/
theorem exists_partition_approximatesLinearOn_of_hasFDerivWithinAt [SecondCountableTopology F]
    (f : E → F) (s : Set E) (f' : E → E →L[ℝ] F) (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x)
    (r : (E →L[ℝ] F) → ℝ≥0) (rpos : ∀ A, r A ≠ 0) :
    ∃ (t : ℕ → Set E) (A : ℕ → E →L[ℝ] F),
      Pairwise (Disjoint on t) ∧
        (∀ n, MeasurableSet (t n)) ∧
          (s ⊆ ⋃ n, t n) ∧
            (∀ n, ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧
              (s.Nonempty → ∀ n, ∃ y ∈ s, A n = f' y)

∃ t A,
  Pairwise (Disjoint on t) ∧
    (∀ (n : ℕ), MeasurableSet (t n)) ∧
      s ⊆ ⋃ n, t n ∧
        (∀ (n : ℕ), ApproximatesLinearOn f (A n) (s ∩ t n) (r (A n))) ∧ (s.Nonempty → ∀ (n : ℕ), ∃ y ∈ s, A n = f' y)


lemma hf_modif_int :
    LocallyIntegrableOn P.f_modif (Ioi 0)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(P : WeakFEPair E)

MeasureTheory.LocallyIntegrableOn P.f_modif (Set.Ioi 0) MeasureTheory.volume


@[to_additive]
protected lemma mul_inv_eq_iff_eq_mul (h : IsUnit b) : a * b⁻¹ = c ↔ a = c * b

{α : Type u}
[SubtractionMonoid α]
{a b c : α}
(h : IsAddUnit b)


/--
The pullback cone whose cone point is the explicit pullback.
-/
@[simps! pt π]
def pullback.cone : Limits.PullbackCone f g

{P : TopCat → Prop}
{X Y B : CompHausLike P}
(f : X ⟶ B)
(g : Y ⟶ B)
[CompHausLike.HasExplicitPullback f g]

(CompHausLike.pullback.cone f g).pt = CompHausLike.pullback f g


@[to_additive]
theorem map_symm_eq_iff_map_eq {H : Subgroup N} {e : G ≃* N} :
    H.map ↑e.symm = K ↔ K.map ↑e = H

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

AddSubgroup.map (↑e.symm) H = K ↔ AddSubgroup.map (↑e) K = H


theorem frontier_Ici [NoMinOrder α] {a : α} : frontier (Ici a) = {a}

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


theorem _root_.Function.Embedding.cardinal_le {α β : Type u} (f : α ↪ β) : #α ≤ #β


@[simp, norm_cast]
theorem coe_toAddMonoidHom (f : CentroidHom α) : ⇑(f : α →+ α) = f

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
(f : CentroidHom α)


/-- The product of `f y` over `y ∈ Set.range g` equals the product of `f (g i)` over all `i`
provided that `g` is injective on `mulSupport (f ∘ g)`. -/
@[to_additive
      "The sum of `f y` over `y ∈ Set.range g` equals the sum of `f (g i)` over all `i`
      provided that `g` is injective on `support (f ∘ g)`."]
theorem finprod_mem_range' {g : β → α} (hg : (mulSupport (f ∘ g)).InjOn g) :
    ∏ᶠ i ∈ range g, f i = ∏ᶠ j, f (g j)

(hg : Set.InjOn g (Function.support (f ∘ g)))

∑ᶠ (i : α) (_ : i ∈ Set.range g), f i = ∑ᶠ (j : β), f (g j)


@[simp]
lemma measure_add (f g : StieltjesFunction) : (f + g).measure = f.measure + g.measure


@[simp]
theorem destruct_flatten (c : Computation (WSeq α)) : destruct (flatten c) = c >>= destruct

{α : Type u}
(c : Computation (Stream'.WSeq α))

(Stream'.WSeq.flatten c).destruct = c >>= Stream'.WSeq.destruct


/-- `prod C D` gives the cartesian product of two categories.

See <https://stacks.math.columbia.edu/tag/001K>.
-/
@[simps (config := { notRecursive := [] }) Hom id_fst id_snd comp_fst comp_snd]
instance prod : Category.{max v₁ v₂} (C × D)

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

∀ {X Y Z : C × D} (f : X ⟶ Y) (g : Y ⟶ Z),
  (CategoryTheory.CategoryStruct.comp f g).2 = CategoryTheory.CategoryStruct.comp f.2 g.2


/-- A variant of `NormedAddCommGroup.tendsto_atTop` that
uses `∃ N, ∀ n > N, ...` rather than `∃ N, ∀ n ≥ N, ...`
-/
theorem NormedAddCommGroup.tendsto_atTop' [Nonempty α] [SemilatticeSup α] [NoMaxOrder α]
    {β : Type*} [SeminormedAddCommGroup β] {f : α → β} {b : β} :
    Tendsto f atTop (𝓝 b) ↔ ∀ ε, 0 < ε → ∃ N, ∀ n, N < n → ‖f n - b‖ < ε

{α : Type u_1}
[Nonempty α]
[SemilatticeSup α]
[NoMaxOrder α]
{β : Type u_5}
[SeminormedAddCommGroup β]
{f : α → β}
{b : β}

Filter.Tendsto f Filter.atTop (𝓝 b) ↔ ∀ (ε : ℝ), 0 < ε → ∃ N, ∀ (n : α), N < n → ‖f n - b‖ < ε


/-- `DFinsupp.filter` as an `AddMonoidHom`. -/
@[simps]
def filterAddMonoidHom [∀ i, AddZeroClass (β i)] (p : ι → Prop) [DecidablePred p] :
    (Π₀ i, β i) →+ Π₀ i, β i

{ι : Type u}
(β : ι → Type v)
[(i : ι) → AddZeroClass (β i)]
(p : ι → Prop)
[DecidablePred p]
(x : Π₀ (i : ι), β i)

(DFinsupp.filterAddMonoidHom β p) x = DFinsupp.filter p x


theorem free_shortExact_finrank_add {n p : ℕ} [Module.Free R S.X₁] [Module.Free R S.X₃]
    [Module.Finite R S.X₁] [Module.Finite R S.X₃]
    (hN : FiniteDimensional.finrank R S.X₁ = n)
    (hP : FiniteDimensional.finrank R S.X₃ = p)
    [StrongRankCondition R] :
    FiniteDimensional.finrank R S.X₂ = n + p

{S : CategoryTheory.ShortComplex (ModuleCat R)}

(hN : FiniteDimensional.finrank R ↑S.X₁ = n)

(hP : FiniteDimensional.finrank R ↑S.X₃ = p)

FiniteDimensional.finrank R ↑S.X₂ = n + p


theorem Summable.matrix_blockDiag {f : X → Matrix (m × p) (n × p) R} (hf : Summable f) :
    Summable fun x => blockDiag (f x)

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{p : Type u_6}
{R : Type u_8}
[AddCommMonoid R]
[TopologicalSpace R]
{f : X → Matrix (m × p) (n × p) R}
(hf : Summable f)


@[simp, norm_cast]
theorem coeff_coe (n) : PowerSeries.coeff R n φ = coeff φ n

{R : Type u_2}
[CommSemiring R]
(φ : Polynomial R)
(n : ℕ)


@[to_additive (attr := simp)]
lemma prod_indicator_index_eq_prod_attach [Zero M] [CommMonoid N]
    {s : Finset α} (f : ∀ a ∈ s, M) {h : α → M → N} (h_zero : ∀ a ∈ s, h a 0 = 1) :
    (indicator s f).prod h = ∏ x ∈ s.attach, h ↑x (f x x.2)

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[AddCommMonoid N]
{s : Finset α}
(f : (a : α) → a ∈ s → M)
{h : α → M → N}
(h_zero : ∀ a ∈ s, h a 0 = 0)

(Finsupp.indicator s f).sum h = ∑ x ∈ s.attach, h (↑x) (f ↑x ⋯)


theorem range_euclideanQuadrant (n : ℕ) :
    (range fun x : EuclideanQuadrant n => x.val) = { y | ∀ i : Fin n, 0 ≤ y i }

(Set.range fun x => ↑x) = {y | ∀ (i : Fin n), 0 ≤ y i}


theorem HasFiniteIntegral.smul [NormedAddCommGroup 𝕜] [SMulZeroClass 𝕜 β] [BoundedSMul 𝕜 β] (c : 𝕜)
    {f : α → β} : HasFiniteIntegral f μ → HasFiniteIntegral (c • f) μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{𝕜 : Type u_5}
[NormedAddCommGroup 𝕜]
[SMulZeroClass 𝕜 β]
[BoundedSMul 𝕜 β]
(c : 𝕜)
{f : α → β}

MeasureTheory.HasFiniteIntegral f μ → MeasureTheory.HasFiniteIntegral (c • f) μ


theorem maximals_inter_subset : maximals r s ∩ t ⊆ maximals r (s ∩ t)

{α : Type u_1}
{r : α → α → Prop}
{s t : Set α}


theorem eq_pow_of_mem_rootsOfUnity {k : ℕ+} {ζ ξ : Rˣ} (h : IsPrimitiveRoot ζ k)
    (hξ : ξ ∈ rootsOfUnity k R) : ∃ (i : ℕ), i < k ∧ ζ ^ i = ξ

{R : Type u_4}
[CommRing R]
[IsDomain R]
{k : ℕ+}
{ζ ξ : Rˣ}
(h : IsPrimitiveRoot ζ ↑k)
(hξ : ξ ∈ rootsOfUnity k R)


/-- **Kolmogorov's 0-1 law**, conditional version: any event in the tail σ-algebra of a
conditinoally independent sequence of sub-σ-algebras has conditional probability 0 or 1. -/
theorem condexp_zero_or_one_of_measurableSet_limsup_atBot [StandardBorelSpace Ω] [Nonempty Ω]
    (hm : m ≤ m0) [IsFiniteMeasure μ] (h_le : ∀ n, s n ≤ m0)
    (h_indep : iCondIndep m hm s μ) {t : Set Ω} (ht_tail : MeasurableSet[limsup s atBot] t) :
    ∀ᵐ ω ∂μ, (μ⟦t | m⟧) ω = 0 ∨ (μ⟦t | m⟧) ω = 1

(h_indep : ProbabilityTheory.iCondIndep m hm s μ)

∀ᵐ (ω : Ω) ∂μ, (μ[t.indicator fun ω => 1|m]) ω = 0 ∨ (μ[t.indicator fun ω => 1|m]) ω = 1


theorem setIntegral_pos_iff_support_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ.restrict s] f)
    (hfi : IntegrableOn f s μ) : (0 < ∫ x in s, f x ∂μ) ↔ 0 < μ (support f ∩ s)

(hfi : MeasureTheory.IntegrableOn f s μ)

0 < ∫ (x : X) in s, f x ∂μ ↔ 0 < μ (Function.support f ∩ s)


theorem Prime.ne_one {p : ℕ} (hp : p.Prime) : p ≠ 1


theorem rel_perm_imp (hr : RightUnique r) : (Forall₂ r ⇒ Forall₂ r ⇒ (· → ·)) Perm Perm

{α : Type u_1}
{β : Type u_2}
{r : α → β → Prop}
(hr : Relator.RightUnique r)

(List.Forall₂ r ⇒ List.Forall₂ r ⇒ fun x x_1 => x → x_1) List.Perm List.Perm


@[to_additive]
theorem extend_div [Div γ] (f : α → β) (g₁ g₂ : α → γ) (e₁ e₂ : β → γ) :
    Function.extend f (g₁ / g₂) (e₁ / e₂) = Function.extend f g₁ e₁ / Function.extend f g₂ e₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Div γ]
(f : α → β)
(g₁ g₂ : α → γ)
(e₁ e₂ : β → γ)


theorem SimpleFunc.integral_eq_integral (f : α →ₛ E) (hfi : Integrable f μ) :
    f.integral μ = ∫ x, f x ∂μ

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[hE : CompleteSpace E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f : MeasureTheory.SimpleFunc α E)
(hfi : MeasureTheory.Integrable (↑f) μ)

MeasureTheory.SimpleFunc.integral μ f = ∫ (x : α), ↑f x ∂μ


theorem term_add_constg {α} [AddCommGroup α] (n x a k a') (h : a + k = a') :
    @termg α _ n x a + k = termg n x a'

{α : Type u_1}
[AddCommGroup α]
(n : ℤ)
(x a k a' : α)
(h : a + k = a')

Mathlib.Tactic.Abel.termg n x a + k = Mathlib.Tactic.Abel.termg n x a'


/-- Any first countable topological group has an antitone neighborhood basis `u : ℕ → Set G` for
which `(u (n + 1)) ^ 2 ⊆ u n`. The existence of such a neighborhood basis is a key tool for
`QuotientGroup.completeSpace` -/
@[to_additive
  "Any first countable topological additive group has an antitone neighborhood basis
  `u : ℕ → set G` for which `u (n + 1) + u (n + 1) ⊆ u n`.
  The existence of such a neighborhood basis is a key tool for `QuotientAddGroup.completeSpace`"]
theorem TopologicalGroup.exists_antitone_basis_nhds_one :
    ∃ u : ℕ → Set G, (𝓝 1).HasAntitoneBasis u ∧ ∀ n, u (n + 1) * u (n + 1) ⊆ u n

(G : Type w)
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[FirstCountableTopology G]

∃ u, (𝓝 0).HasAntitoneBasis u ∧ ∀ (n : ℕ), u (n + 1) + u (n + 1) ⊆ u n


theorem rootMultiplicity_X_sub_C_self [Nontrivial R] {x : R} :
    rootMultiplicity x (X - C x) = 1

{R : Type u}
[CommRing R]
[Nontrivial R]
{x : R}

Polynomial.rootMultiplicity x (Polynomial.X - Polynomial.C x) = 1


/-- Updating a tuple and adding an element at the beginning commute. -/
@[simp]
theorem cons_update : cons x (update p i y) = update (cons x p) i.succ y

{n : ℕ}
{α : Fin (n + 1) → Type u}
(x : α 0)
(p : (i : Fin n) → α i.succ)
(i : Fin n)
(y : α i.succ)

Fin.cons x (Function.update p i y) = Function.update (Fin.cons x p) i.succ y


@[simp]
theorem smul_add_one_sub_smul {R : Type*} [Ring R] [Module R M] {r : R} {m : M} :
    r • m + (1 - r) • m = m

{M : Type u_5}
[AddCommMonoid M]
{R : Type u_9}
[Ring R]
[Module R M]
{r : R}
{m : M}


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


/--
The `Fin.pos_iff_ne_zero` in `Lean` only applies in `Fin (n+1)`.
This one instead uses a `NeZero n` typeclass hypothesis.
-/
theorem pos_iff_ne_zero' [NeZero n] (a : Fin n) : 0 < a ↔ a ≠ 0


theorem jacobiTheta_T_sq_smul (τ : ℍ) : jacobiTheta (ModularGroup.T ^ 2 • τ :) = jacobiTheta τ

jacobiTheta ↑(ModularGroup.T ^ 2 • τ) = jacobiTheta ↑τ


theorem Squarefree.isRadical {x : R} (hx : Squarefree x) : IsRadical x

{R : Type u_1}
[CommMonoidWithZero R]
[DecompositionMonoid R]
{x : R}
(hx : Squarefree x)


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

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


@[simp]
theorem pderiv_X_of_ne {i j : σ} (h : j ≠ i) : pderiv i (X j : MvPolynomial σ R) = 0

{R : Type u}
{σ : Type v}
[CommSemiring R]
{i j : σ}
(h : j ≠ i)

(MvPolynomial.pderiv i) (MvPolynomial.X j) = 0


@[to_additive (attr := simp)]
protected theorem inv_le_inv_iff : f⁻¹ ≤ g⁻¹ ↔ f ≤ g

{α : Type u_2}
[InvolutiveNeg α]
{f g : Filter α}


/-- If a polynomial is separable, then its separable degree is equal to its degree. -/
theorem natSepDegree_eq_natDegree_of_separable (h : f.Separable) :
    f.natSepDegree = f.natDegree

{F : Type u}
[Field F]
(f : F[X])
(h : f.Separable)


theorem tendsto_atBot_iInf (h_mono : Monotone f) : Tendsto f atBot (𝓝 (⨅ i, f i))

{α : Type u_1}
{ι : Type u_3}
[Preorder ι]
[TopologicalSpace α]
[CompleteLattice α]
[InfConvergenceClass α]
{f : ι → α}
(h_mono : Monotone f)

Filter.Tendsto f Filter.atBot (𝓝 (⨅ i, f i))


theorem epi_iff_range_eq_top : Epi f ↔ LinearMap.range f = ⊤

{R : Type u}
[Ring R]
{X Y : ModuleCat R}
(f : X ⟶ Y)

CategoryTheory.Epi f ↔ LinearMap.range f = ⊤


@[simp]
theorem neg_apply (f : Poly α) (x) : (-f) x = -f x


@[to_additive] -- Porting note (#10618): `simp` can prove this.
theorem out_eq' (a : α ⧸ s) : mk a.out' = a

{α : Type u_1}
[Group α]
{s : Subgroup α}
(a : α ⧸ s)


@[simp]
lemma smul_le_smul_iff_of_pos_left [PosSMulMono α β] [PosSMulReflectLE α β] (ha : 0 < a) :
    a • b₁ ≤ a • b₂ ↔ b₁ ≤ b₂

{α : Type u_1}
{β : Type u_2}
{a : α}
{b₁ b₂ : β}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[PosSMulMono α β]
[PosSMulReflectLE α β]
(ha : 0 < a)

a • b₁ ≤ a • b₂ ↔ b₁ ≤ b₂


@[simp]
theorem to_real_im (x : ℤ[i]) : ((x.im : ℤ) : ℝ) = (x : ℂ).im


theorem measure_subtype_coe_eq_zero_of_comap_eq_zero (hs : NullMeasurableSet s μ) {t : Set s}
    (ht : μ.comap Subtype.val t = 0) : μ (((↑) : s → α) '' t) = 0

(hs : MeasureTheory.NullMeasurableSet s μ)

(ht : (MeasureTheory.Measure.comap Subtype.val μ) t = 0)


theorem average_union_mem_openSegment {f : α → E} {s t : Set α} (hd : AEDisjoint μ s t)
    (ht : NullMeasurableSet t μ) (hs₀ : μ s ≠ 0) (ht₀ : μ t ≠ 0) (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞)
    (hfs : IntegrableOn f s μ) (hft : IntegrableOn f t μ) :
    ⨍ x in s ∪ t, f x ∂μ ∈ openSegment ℝ (⨍ x in s, f x ∂μ) (⨍ x in t, f x ∂μ)

(ht : MeasureTheory.NullMeasurableSet t μ)

(hfs : MeasureTheory.IntegrableOn f s μ)

(hft : MeasureTheory.IntegrableOn f t μ)

⨍ (x : α) in s ∪ t, f x ∂μ ∈ openSegment ℝ (⨍ (x : α) in s, f x ∂μ) (⨍ (x : α) in t, f x ∂μ)


lemma isWeaklyRegular_iff_Fin (rs : List R) :
    IsWeaklyRegular M rs ↔ ∀ (i : Fin rs.length),
      IsSMulRegular (M ⧸ (ofList (rs.take i) • ⊤ : Submodule R M)) (rs.get i)

{R : Type u_1}
(M : Type u_3)
[CommRing R]
[AddCommGroup M]
[Module R M]
(rs : List R)

RingTheory.Sequence.IsWeaklyRegular M rs ↔
  ∀ (i : Fin rs.length), IsSMulRegular (M ⧸ Ideal.ofList (List.take (↑i) rs) • ⊤) (rs.get i)


/--
M is flat if and only if `f ⊗ 𝟙 M` is injective whenever `f` is an injective linear map.
-/
lemma iff_rTensor_preserves_injective_linearMap [Small.{v} R] :
    Flat R M ↔
    ∀ ⦃N N' : Type v⦄ [AddCommGroup N] [AddCommGroup N'] [Module R N] [Module R N']
      (L : N →ₗ[R] N'), Function.Injective L → Function.Injective (L.rTensor M)

(R : Type u)
(M : Type v)
[CommRing R]
[AddCommGroup M]
[Module R M]
[Small.{v, u} R]

Module.Flat R M ↔
  ∀ ⦃N N' : Type v⦄ [inst : AddCommGroup N] [inst_1 : AddCommGroup N'] [inst_2 : Module R N] [inst_3 : Module R N']
    (L : N →ₗ[R] N'), Function.Injective ⇑L → Function.Injective ⇑(LinearMap.rTensor M L)


theorem unop_sInf (S : Set (Subalgebra R Aᵐᵒᵖ)) : (sInf S).unop = sInf (.op ⁻¹' S)

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Set (Subalgebra R Aᵐᵒᵖ))

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


/-- The weighted homogeneous submodules form a graded monoid. -/
lemma WeightedHomogeneousSubmodule.gradedMonoid {w : σ → M} :
    SetLike.GradedMonoid (weightedHomogeneousSubmodule R w)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
{σ : Type u_3}
[AddCommMonoid M]
{w : σ → M}

SetLike.GradedMonoid (MvPolynomial.weightedHomogeneousSubmodule R w)


/-- The natural isomorphism between
pulling back a grading along the identity function,
and the identity functor. -/
@[simps]
def comapId : comap C (id : I → I) ≅ 𝟭 (∀ i, C i)

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

(CategoryTheory.Pi.comapId I C).inv.app X i = CategoryTheory.CategoryStruct.id X i


/-- Arithmetic progressions of length three are preserved under `2`-Freiman isomorphisms. -/
@[to_additive
"Arithmetic progressions of length three are preserved under `2`-Freiman isomorphisms."]
lemma threeGPFree_image (hf : IsMulFreimanIso 2 s t f) (hAs : A ⊆ s) :
    ThreeGPFree (f '' A) ↔ ThreeGPFree A

{α : Type u_2}
{β : Type u_3}
[CommMonoid α]
[CommMonoid β]
{s A : Set α}
{t : Set β}
{f : α → β}
(hf : IsMulFreimanIso 2 s t f)
(hAs : A ⊆ s)


@[to_additive (attr := simp)] lemma mul_apply (f g : M →* N) (x : M) : (f * g) x = f x * g x

{M : Type u_3}
{N : Type u_4}
[MulOneClass M]
[CommMonoid N]
(f g : M →* N)
(x : M)


lemma _root_.Pairwise.range_pairwise (hr : Pairwise (r on f)) : (Set.range f).Pairwise r

{α : Type u_1}
{ι : Type u_4}
{r : α → α → Prop}
{f : ι → α}
(hr : Pairwise (r on f))


/-- A family of gluing data consists of
1. An index type `J`
2. A bundled topological space `U i` for each `i : J`.
3. An open set `V i j ⊆ U i` for each `i j : J`.
4. A transition map `t i j : V i j ⟶ V j i` for each `i j : ι`.
such that
6. `V i i = U i`.
7. `t i i` is the identity.
8. For each `x ∈ V i j ∩ V i k`, `t i j x ∈ V j k`.
9. `t j k (t i j x) = t i k x`.

We can then glue the topological spaces `U i` together by identifying `V i j` with `V j i`.
-/
-- Porting note(#5171): removed `@[nolint has_nonempty_instance]`
structure MkCore where
  {J : Type u}
  U : J → TopCat.{u}
  V : ∀ i, J → Opens (U i)
  t : ∀ i j, (Opens.toTopCat _).obj (V i j) ⟶ (Opens.toTopCat _).obj (V j i)
  V_id : ∀ i, V i i = ⊤
  t_id : ∀ i, ⇑(t i i) = id
  t_inter : ∀ ⦃i j⦄ (k) (x : V i j), ↑x ∈ V i k → (((↑) : (V j i) → (U j)) (t i j x)) ∈ V j k
  cocycle :
    ∀ (i j k) (x : V i j) (h : ↑x ∈ V i k),
      -- Porting note: the underscore in the next line was `↑(t i j x)`, but Lean type-mismatched
      (((↑) : (V k j) → (U k)) (t j k ⟨_, t_inter k x h⟩)) = ((↑) : (V k i) → (U k)) (t i k ⟨x, h⟩)

(self : TopCat.GlueData.MkCore)
(i : self.J)


@[to_additive (attr := simp)]
lemma stabilizer_mul_eq_left [Group α] [IsScalarTower G α α] (a b : α)  :
    stabilizer G (a * b) = stabilizer G a

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

MulAction.stabilizer G (a * b) = MulAction.stabilizer G a


protected theorem hasSum_repr (b : HilbertBasis ι 𝕜 E) (x : E) :
    HasSum (fun i => b.repr x i • b i) x

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(b : HilbertBasis ι 𝕜 E)
(x : E)

HasSum (fun i => ↑(b.repr x) i • (fun i => b.repr.symm (lp.single 2 i 1)) i) x


theorem HasStrictFDerivAt.csinh (hf : HasStrictFDerivAt f f' x) :
    HasStrictFDerivAt (fun x => Complex.sinh (f x)) (Complex.cosh (f x) • f') x

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


theorem ContinuousAt.comp_lowerSemicontinuousWithinAt {g : γ → δ} {f : α → γ}
    (hg : ContinuousAt g (f x)) (hf : LowerSemicontinuousWithinAt f s x) (gmon : Monotone g) :
    LowerSemicontinuousWithinAt (g ∘ f) s x


/-- The duality equivalence `(WidePullbackShape J)ᵒᵖ ≌ WidePushoutShape J` -/
@[simps]
def widePullbackShapeOpEquiv : (WidePullbackShape J)ᵒᵖ ≌ WidePushoutShape J

(CategoryTheory.Limits.widePullbackShapeOpEquiv J).functor = CategoryTheory.Limits.widePullbackShapeUnop J


@[to_additive (attr := simp)]
theorem ker_rangeRestrict (f : G →* N) : ker (rangeRestrict f) = ker f

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)


@[simp]
theorem mapsTo_image_iff {f : α → β} {g : γ → α} {s : Set γ} {t : Set β} :
    MapsTo f (g '' s) t ↔ MapsTo (f ∘ g) s t

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

Set.MapsTo f (g '' s) t ↔ Set.MapsTo (f ∘ g) s t


/-- We say that `R` satisfies the strong rank condition if `(Fin n → R) →ₗ[R] (Fin m → R)` injective
    implies `n ≤ m`. -/
@[mk_iff]
class StrongRankCondition : Prop where
  /-- Any injective linear map from `Rⁿ` to `Rᵐ` guarantees `n ≤ m`. -/
  le_of_fin_injective : ∀ {n m : ℕ} (f : (Fin n → R) →ₗ[R] Fin m → R), Injective f → n ≤ m

{R : Type u}
[Semiring R]
[self : StrongRankCondition R]
{n m : ℕ}
(f : (Fin n → R) →ₗ[R] Fin m → R)


theorem tendsto_comp_exp_atTop {f : ℝ → α} :
    Tendsto (fun x => f (exp x)) atTop l ↔ Tendsto f atTop l

{α : Type u_1}
{l : Filter α}
{f : ℝ → α}

Filter.Tendsto (fun x => f (Real.exp x)) Filter.atTop l ↔ Filter.Tendsto f Filter.atTop l


theorem Nodup.inter_right [DecidableEq α] (s) : Nodup t → Nodup (s ∩ t)

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


@[simp]
theorem id_comp (f : L₁ →ₗ⁅R⁆ L₂) : (id : L₂ →ₗ⁅R⁆ L₂).comp f = f

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


@[to_additive (attr := simp)]
lemma val_mem_ofUnits_iff_mem (H : Subgroup Gˣ) (x : Gˣ) : (x : G) ∈ H.ofUnits ↔ x ∈ H

{G : Type u_2}
[AddGroup G]
(H : AddSubgroup (AddUnits G))
(x : AddUnits G)


@[deprecated rpow_inv_le_iff (since := "2024-07-10")]
theorem rpow_one_div_le_iff {x y : ℝ≥0} {z : ℝ} (hz : 0 < z) : x ^ (1 / z) ≤ y ↔ x ≤ y ^ z


/-- The product of a list of Lipschitz continuous endomorphisms is a Lipschitz continuous
endomorphism. -/
protected theorem list_prod (f : ι → Function.End α) (K : ι → ℝ≥0)
    (h : ∀ i, LipschitzWith (K i) (f i)) : ∀ l : List ι, LipschitzWith (l.map K).prod (l.map f).prod

(h : ∀ (i : ι), LipschitzWith (K i) (f i))

LipschitzWith (List.map K l).prod (List.map f l).prod


theorem gcd_comm {m n : ℕ+} : m.gcd n = n.gcd m


lemma sqrt_add_eq (n : ℕ) (h : a ≤ n + n) : sqrt (n * n + a) = n


@[simp]
theorem sSup_compact_le_eq (b) :
    sSup { c : α | CompleteLattice.IsCompactElement c ∧ c ≤ b } = b

{α : Type u_2}
[CompleteLattice α]
[IsCompactlyGenerated α]
(b : α)

sSup {c | CompleteLattice.IsCompactElement c ∧ c ≤ b} = b


/-- The (pre)image under `inv` of `Ioo 0 a` is `Ioi a⁻¹`. -/
theorem inv_Ioo_0_left {a : α} (ha : 0 < a) : (Ioo 0 a)⁻¹ = Ioi a⁻¹

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


@[simp]
theorem projIcc_eq_zero {x : ℝ} : projIcc (0 : ℝ) 1 zero_le_one x = 0 ↔ x ≤ 0


@[simp]
theorem coeSubtype (s : AffineSubspace k P) [Nonempty s] : (s.subtype : s → P) = ((↑) : s → P)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(s : AffineSubspace k P)
[Nonempty ↥s]


@[simp (default + 1)] -- otherwise `simp` doesn't use `forall_image₂_iff`
lemma le_inf_image₂ {g : γ → δ} {a : δ} :
    a ≤ inf (image₂ f s t) g ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ g (f x y)

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{δ : Type u_7}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
[SemilatticeInf δ]
[OrderTop δ]
{g : γ → δ}
{a : δ}

a ≤ (Finset.image₂ f s t).inf g ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ g (f x y)


theorem ListBlank.nth_modifyNth {Γ} [Inhabited Γ] (f : Γ → Γ) (n i) (L : ListBlank Γ) :
    (L.modifyNth f n).nth i = if i = n then f (L.nth i) else L.nth i

{Γ : Type u_1}
[Inhabited Γ]
(f : Γ → Γ)
(n i : ℕ)
(L : Turing.ListBlank Γ)

(Turing.ListBlank.modifyNth f n L).nth i = if i = n then f (L.nth i) else L.nth i


@[simp]
theorem count_univ [DecidableEq α] (a : α) : count a Finset.univ.val = 1

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(a : α)


theorem compl_sup_le_himp : aᶜ ⊔ b ≤ a ⇨ b

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

aᶜ ⊔ b ≤ a ⇨ b


theorem iIndepSets_singleton_iff {s : ι → Set Ω} :
    iIndepSets (fun i ↦ {s i}) μ ↔ ∀ t, μ (⋂ i ∈ t, s i) = ∏ i ∈ t, μ (s i)

{Ω : Type u_1}
{ι : Type u_2}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{s : ι → Set Ω}

ProbabilityTheory.iIndepSets (fun i => {s i}) μ ↔ ∀ (t : Finset ι), μ (⋂ i ∈ t, s i) = ∏ i ∈ t, μ (s i)


@[simp] theorem nndist_toMul (a b : Additive X) : nndist (toMul a) (toMul b) = nndist a b

{X : Type u_1}
[PseudoMetricSpace X]
(a b : Additive X)

nndist (Additive.toMul a) (Additive.toMul b) = nndist a b


theorem HasDerivAt.hasDerivWithinAt (h : HasDerivAt f f' x) : HasDerivWithinAt f f' s x

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


theorem map_pmap (g : β → γ) (f : ∀ a, p a → β) (x H) :
    Option.map g (pmap f x H) = pmap (fun a h ↦ g (f a h)) x H

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{p : α → Prop}
(g : β → γ)
(f : (a : α) → p a → β)
(x : Option α)
(H : ∀ (a : α), a ∈ x → p a)

Option.map g (Option.pmap f x H) = Option.pmap (fun a h => g (f a h)) x H


theorem measurePreserving_pi_empty {ι : Type u} {α : ι → Type v} [Fintype ι] [IsEmpty ι]
    {m : ∀ i, MeasurableSpace (α i)} (μ : ∀ i, Measure (α i)) :
    MeasurePreserving (MeasurableEquiv.ofUniqueOfUnique (∀ i, α i) Unit) (Measure.pi μ)
      (Measure.dirac ())

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

MeasureTheory.MeasurePreserving (⇑(MeasurableEquiv.ofUniqueOfUnique ((i : ι) → α i) Unit)) (MeasureTheory.Measure.pi μ)
  (MeasureTheory.Measure.dirac ())


@[simp]
theorem coe_inf : (↑(s ⊓ t) : Set P) = ↑s ∩ ↑t

{P : Type u_1}
[SemilatticeSup P]
[IsDirected P fun x x_1 => x ≥ x_1]
{s t : Order.Ideal P}


theorem eq_biInf_of_mem_iff_exists_mem {f : ι → Filter α} {p : ι → Prop} {l : Filter α}
    (h : ∀ {s}, s ∈ l ↔ ∃ i, p i ∧ s ∈ f i) : l = ⨅ (i) (_ : p i), f i

(h : ∀ {s : Set α}, s ∈ l ↔ ∃ i, p i ∧ s ∈ f i)


theorem conjTranspose_nonsing_inv [StarRing α] : A⁻¹ᴴ = Aᴴ⁻¹

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)
[StarRing α]


@[simps]
def foldrM.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α →* Monoid.foldrM m β

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

∀ (a : CategoryTheory.KleisliCat.mk m β),
  (Monoid.foldrM.ofFreeMonoid f) xs a = flip (List.foldrM f) (FreeMonoid.toList xs) a


theorem m_pos [Nonempty α] (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) : 0 < m

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


lemma unitForward_unitBackward {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : C) :
    unitForward η X ∘ unitBackward η X = id

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

CategoryTheory.OverPresheafAux.unitForward η X ∘ CategoryTheory.OverPresheafAux.unitBackward η X = id


theorem down_bijective : Bijective (@down α)


theorem of_wfDvdMonoid_associates (_ : WfDvdMonoid (Associates α)) : WfDvdMonoid α

WfDvdMonoid (Associates α) → WfDvdMonoid α


@[simp] theorem isWF_union : IsWF (s ∪ t) ↔ IsWF s ∧ IsWF t

{α : Type u_2}
[Preorder α]
{s t : Set α}


theorem sup_mono {s₁ s₂ : Multiset α} (h : s₁ ⊆ s₂) : s₁.sup ≤ s₂.sup

{α : Type u_1}
[SemilatticeSup α]
[OrderBot α]
{s₁ s₂ : Multiset α}
(h : s₁ ⊆ s₂)


theorem coe_injective :
    @Function.Injective (LeftInvariantDerivation I G) (_ → C^∞⟮I, G; 𝕜⟯) DFunLike.coe

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]


theorem apply_eq_of_lt_firstDiff {x y : ∀ n, E n} {n : ℕ} (hn : n < firstDiff x y) : x n = y n

{E : ℕ → Type u_1}
{x y : (n : ℕ) → E n}
{n : ℕ}
(hn : n < PiNat.firstDiff x y)


@[simp]
theorem mem_ite_empty_right (p : Prop) [Decidable p] (t : Set α) (x : α) :
    x ∈ ite p t ∅ ↔ p ∧ x ∈ t

{α : Type u}
(p : Prop)
[Decidable p]
(t : Set α)
(x : α)


theorem erase_mem_compression (hs : s ∈ 𝒜) : s.erase a ∈ 𝓓 a 𝒜

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{s : Finset α}
{a : α}
(hs : s ∈ 𝒜)


theorem inv (h : IsPrimitiveRoot ζ k) : IsPrimitiveRoot ζ⁻¹ k

{G : Type u_3}
[DivisionCommMonoid G]
{k : ℕ}
{ζ : G}
(h : IsPrimitiveRoot ζ k)


theorem toComplex_div_re (x y : ℤ[i]) : ((x / y : ℤ[i]) : ℂ).re = round (x / y : ℂ).re

(GaussianInt.toComplex (x / y)).re = ↑(round (GaussianInt.toComplex x / GaussianInt.toComplex y).re)


/-- The product of a family of triangles. -/
@[simps!]
def productTriangle : Triangle C

(T : J → CategoryTheory.Pretriangulated.Triangle C)

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₁]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₂]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₃]

[CategoryTheory.Limits.HasProduct fun j => (CategoryTheory.shiftFunctor C 1).obj (T j).obj₁]

(CategoryTheory.Pretriangulated.productTriangle T).obj₃ = ∏ᶜ fun j => (T j).obj₃


@[simp]
theorem countable_union {s t : Set α} : (s ∪ t).Countable ↔ s.Countable ∧ t.Countable


@[simp]
theorem prod_top : (⊤ : FactorSet α).prod = 0

{α : Type u_1}
[CancelCommMonoidWithZero α]


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

(C : Type u_1)
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Preadditive C]
(α : Type u_3)
[AddRightCancelSemigroup α]
[One α]

∀ {X Y : CategoryTheory.Idempotents.Karoubi (HomologicalComplex C (ComplexShape.up α))} (f : X ⟶ Y) (n : α),
  (((CategoryTheory.Idempotents.karoubiCochainComplexEquivalence C α).functor.map f).f n).f = f.f.f n


@[simp]
lemma image_val_inter_self_left_eq_coe : ↑D ∩ A = ↑D


theorem insert'_eq_insertWith [@DecidableRel α (· ≤ ·)] (x : α) :
    ∀ t, insert' x t = insertWith id x t

{α : Type u_1}
[Preorder α]
[DecidableRel fun x x_1 => x ≤ x_1]
(x : α)
(t : Ordnode α)

Ordnode.insert' x t = Ordnode.insertWith id x t


/-- The balanced core of `t` is maximal in the sense that it contains any balanced subset
`s` of `t`. -/
theorem Balanced.subset_balancedCore_of_subset (hs : Balanced 𝕜 s) (h : s ⊆ t) :
    s ⊆ balancedCore 𝕜 t

{𝕜 : Type u_1}
{E : Type u_2}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
{s t : Set E}
(hs : Balanced 𝕜 s)
(h : s ⊆ t)


@[to_additive]
theorem ciSup_mul (hf : BddAbove (range f)) (a : G) : (⨆ i, f i) * a = ⨆ i, f i * a

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


/-- A set of points in a two-dimensional space is coplanar. -/
theorem coplanar_of_fact_finrank_eq_two (s : Set P) [h : Fact (finrank k V = 2)] : Coplanar k s

[h : Fact (FiniteDimensional.finrank k V = 2)]


@[to_additive (attr := simp)]
theorem ker_toHomUnits {M} [Monoid M] (f : G →* M) : f.toHomUnits.ker = f.ker

{G : Type u_1}
[AddGroup G]
{M : Type u_8}
[AddMonoid M]
(f : G →+ M)


lemma map_lie (e : L₁ ≃ₗ⁅R⁆ L₂) (x y : L₁) : e ⁅x, y⁆ = ⁅e x, e y⁆

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieRing L₂]
[LieAlgebra R L₁]
[LieAlgebra R L₂]
(e : L₁ ≃ₗ⁅R⁆ L₂)
(x y : L₁)


@[to_additive]
lemma IsOfFinOrder.powers_eq_zpowers (hx : IsOfFinOrder x) : (powers x : Set G) = zpowers x

{G : Type u_1}
[Group G]
{x : G}
(hx : IsOfFinOrder x)

↑(Submonoid.powers x) = ↑(Subgroup.zpowers x)


theorem integral_average_sub [IsFiniteMeasure μ] (hf : Integrable f μ) :
    ∫ x, ⨍ a, f a ∂μ - f x ∂μ = 0

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{μ : MeasureTheory.Measure α}
{f : α → E}
[MeasureTheory.IsFiniteMeasure μ]
(hf : MeasureTheory.Integrable f μ)

∫ (x : α), ⨍ (a : α), f a ∂μ - f x ∂μ = 0


@[simp]
theorem constVAdd_symm (v : V₁) : (constVAdd k P₁ v).symm = constVAdd k P₁ (-v)

(k : Type u_1)
(P₁ : Type u_2)
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(v : V₁)

(AffineEquiv.constVAdd k P₁ v).symm = AffineEquiv.constVAdd k P₁ (-v)


theorem flip_comp : flip (r ∘r p) = flip p ∘r flip r

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{r : α → β → Prop}
{p : β → γ → Prop}

flip (Relation.Comp r p) = Relation.Comp (flip p) (flip r)


@[simp]
theorem map_inl : p.map (inl R M M₂) = prod p ⊥

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(p : Submodule R M)

Submodule.map (LinearMap.inl R M M₂) p = p.prod ⊥


/-- The orthogonal complement of any submodule `K` is closed. -/
theorem isClosed_orthogonal : IsClosed (Kᗮ : Set E)

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


/-- Constructs an isomorphism of finite partial orders from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : FinPartOrd.{u}} (e : α ≃o β) : α ≅ β

{α β : FinPartOrd}
(e : ↑α.toPartOrd ≃o ↑β.toPartOrd)


lemma coe_mul_top_of_pos {x : ℝ} (h : 0 < x) : (x : EReal) * ⊤ = ⊤


@[simp]
theorem primeSpectrumProd_symm_inl_asIdeal (x : PrimeSpectrum R) :
    ((primeSpectrumProd R S).symm <| Sum.inl x).asIdeal = Ideal.prod x.asIdeal ⊤

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

((PrimeSpectrum.primeSpectrumProd R S).symm (Sum.inl x)).asIdeal = x.asIdeal.prod ⊤


@[simp, norm_cast]
theorem prod_apply (f₁ : A →A[R] B) (f₂ : A →A[R] C) (x : A) :
    f₁.prod f₂ x = (f₁ x, f₂ x)

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
{C : Type u_4}
[Semiring C]
[Algebra R C]
[TopologicalSpace C]
(f₁ : A →A[R] B)
(f₂ : A →A[R] C)
(x : A)


@[simp]
theorem coprime_add_mul_left_right (m n k : ℕ) : Coprime m (n + m * k) ↔ Coprime m n


theorem absNorm_dvd_absNorm_of_le {I J : Ideal S} (h : J ≤ I) : Ideal.absNorm I ∣ Ideal.absNorm J

{S : Type u_1}
[CommRing S]
[IsDomain S]
[Nontrivial S]
[IsDedekindDomain S]
[Module.Free ℤ S]
{I J : Ideal S}
(h : J ≤ I)


theorem append_right_inj {t₁ t₂ : List α} (s) : s ++ t₁ = s ++ t₂ ↔ t₁ = t₂

{α : Type u_1}
{t₁ t₂ : List α}
(s : List α)


@[simp, norm_cast]
theorem coe_smul (a : α) (x : R) : (↑(a • x) : c.Quotient) = a • (x : c.Quotient)

{α : Type u_1}
{R : Type u_2}
[Add R]
[MulOneClass R]
[SMul α R]
[IsScalarTower α R R]
(c : RingCon R)
(a : α)
(x : R)


theorem compl_mem_iff_not_mem : sᶜ ∈ f ↔ s ∉ f

{α : Type u}
{f : Ultrafilter α}
{s : Set α}

sᶜ ∈ f ↔ s ∉ f


theorem mk₂_funext {c f₁ f₂ : Type u} {r₁ r₂ : Type v} {F G : Language.mk₂ c f₁ f₂ r₁ r₂ →ᴸ L'}
    (h0 : ∀ c : (Language.mk₂ c f₁ f₂ r₁ r₂).Constants, F.onFunction c = G.onFunction c)
    (h1 : ∀ f : (Language.mk₂ c f₁ f₂ r₁ r₂).Functions 1, F.onFunction f = G.onFunction f)
    (h2 : ∀ f : (Language.mk₂ c f₁ f₂ r₁ r₂).Functions 2, F.onFunction f = G.onFunction f)
    (h1' : ∀ r : (Language.mk₂ c f₁ f₂ r₁ r₂).Relations 1, F.onRelation r = G.onRelation r)
    (h2' : ∀ r : (Language.mk₂ c f₁ f₂ r₁ r₂).Relations 2, F.onRelation r = G.onRelation r) :
    F = G

{F G : FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂ →ᴸ L'}

(h0 : ∀ (c_1 : (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Constants), F.onFunction c_1 = G.onFunction c_1)

(h1 : ∀ (f : (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Functions 1), F.onFunction f = G.onFunction f)

(h2 : ∀ (f : (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Functions 2), F.onFunction f = G.onFunction f)

(h1' : ∀ (r : (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Relations 1), F.onRelation r = G.onRelation r)

(h2' : ∀ (r : (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Relations 2), F.onRelation r = G.onRelation r)


theorem domCoprod_coe (a : Mᵢ [⋀^ιa]→ₗ[R'] N₁) (b : Mᵢ [⋀^ιb]→ₗ[R'] N₂) :
    (↑(a.domCoprod b) : MultilinearMap R' (fun _ => Mᵢ) _) =
      ∑ σ : Perm.ModSumCongr ιa ιb, domCoprod.summand a b σ

{ιa : Type u_1}
{ιb : Type u_2}
[Fintype ιa]
[Fintype ιb]
{R' : Type u_3}
{Mᵢ : Type u_4}
{N₁ : Type u_5}
{N₂ : Type u_6}
[CommSemiring R']
[AddCommGroup N₁]
[Module R' N₁]
[AddCommGroup N₂]
[Module R' N₂]
[AddCommMonoid Mᵢ]
[Module R' Mᵢ]
[DecidableEq ιa]
[DecidableEq ιb]
(a : Mᵢ [⋀^ιa]→ₗ[R'] N₁)
(b : Mᵢ [⋀^ιb]→ₗ[R'] N₂)

↑(a.domCoprod b) = ∑ σ : Equiv.Perm.ModSumCongr ιa ιb, AlternatingMap.domCoprod.summand a b σ


@[simp]
theorem augmentTruncate_hom_f_succ (C : CochainComplex V ℕ) (i : ℕ) :
    (augmentTruncate C).hom.f (i + 1) = 𝟙 (C.X (i + 1))

C.augmentTruncate.hom.f (i + 1) = 𝟙 (C.X (i + 1))


theorem piecewise_ae_eq_restrict [DecidablePred (· ∈ s)] (hs : MeasurableSet s) :
    piecewise s f g =ᵐ[μ.restrict s] f

{α : Type u_2}
{β : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
{f g : α → β}
[DecidablePred fun x => x ∈ s]
(hs : MeasurableSet s)


theorem InftyValuation.map_mul' (x y : RatFunc Fq) :
    inftyValuationDef Fq (x * y) = inftyValuationDef Fq x * inftyValuationDef Fq y

(Fq : Type)
[Field Fq]
[DecidableEq (RatFunc Fq)]
(x y : RatFunc Fq)

FunctionField.inftyValuationDef Fq (x * y) = FunctionField.inftyValuationDef Fq x * FunctionField.inftyValuationDef Fq y


/-- `yoneda.obj X` is a sheaf for the canonical topology. -/
theorem isSheaf_yoneda_obj (X : C) : Presieve.IsSheaf (canonicalTopology C) (yoneda.obj X)

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

CategoryTheory.Presieve.IsSheaf (CategoryTheory.Sheaf.canonicalTopology C) (CategoryTheory.yoneda.obj X)


theorem _root_.Module.End_isUnit_iff [Module R M] (f : Module.End R M) :
    IsUnit f ↔ Function.Bijective f

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


/-- Appending of vectors corresponds under `toList` to appending of lists. -/
@[simp]
theorem toList_append {n m : ℕ} (v : Vector α n) (w : Vector α m) :
    toList (append v w) = toList v ++ toList w

{α : Type u}
{n m : ℕ}
(v : Mathlib.Vector α n)
(w : Mathlib.Vector α m)

(v.append w).toList = v.toList ++ w.toList


theorem sep_of_ncard_eq {a : α} {P : α → Prop} (h : { x ∈ s | P x }.ncard = s.ncard) (ha : a ∈ s)
    (hs : s.Finite := by toFinite_tac) : P a

{α : Type u_1}
{s : Set α}
{a : α}
{P : α → Prop}
(h : {x | x ∈ s ∧ P x}.ncard = s.ncard)
(ha : a ∈ s)
(hs : s.Finite := by toFinite_tac)


theorem RingOfIntegers.rank : FiniteDimensional.finrank ℤ (𝓞 K) = FiniteDimensional.finrank ℚ K

(K : Type u_1)
[Field K]
[nf : NumberField K]

FiniteDimensional.finrank ℤ (NumberField.RingOfIntegers K) = FiniteDimensional.finrank ℚ K


@[simp] theorem abs_mem_iff {S G} [AddGroup G] [LinearOrder G] {_ : SetLike S G}
    [NegMemClass S G] {H : S} {x : G} : |x| ∈ H ↔ x ∈ H

{S : Type u_1}
{G : Type u_2}
[AddGroup G]
[LinearOrder G]

∀ {x : SetLike S G} [inst : NegMemClass S G] {H : S} {x_1 : G}, |x_1| ∈ H ↔ x_1 ∈ H


@[simp] lemma erase_nonempty (ha : a ∈ s) : (s.erase a).Nonempty ↔ s.Nontrivial

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


@[simp]
theorem Basis.parallelepiped_reindex (b : Basis ι ℝ E) (e : ι ≃ ι') :
    (b.reindex e).parallelepiped = b.parallelepiped

{ι : Type u_1}
{ι' : Type u_2}
{E : Type u_3}
[Fintype ι]
[Fintype ι']
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(b : Basis ι ℝ E)
(e : ι ≃ ι')


theorem reaches₀_eq {σ} {f : σ → Option σ} {a b} (e : f a = f b) : Reaches₀ f a b

{σ : Type u_1}
{f : σ → Option σ}
{a b : σ}
(e : f a = f b)


@[simp]
theorem Ici_bot : Ici (⊥ : α) = univ

{α : Type u_1}
[Preorder α]
[OrderBot α]


@[simp]
theorem sumProdDistrib_apply_right (b : β) (c : γ) :
    sumProdDistrib α β γ (Sum.inr b, c) = Sum.inr (b, c)

{β : Type u_1}
{γ : Type u_2}
{α : Type u_3}
(b : β)
(c : γ)

(Equiv.sumProdDistrib α β γ) (Sum.inr b, c) = Sum.inr (b, c)


@[simp] theorem last_add_one : ∀ n, last n + 1 = 0


theorem mono_ac (h : μ₁ ⟂ₘ ν₁) (hμ : μ₂ ≪ μ₁) (hν : ν₂ ≪ ν₁) : μ₂ ⟂ₘ ν₂

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ₁ μ₂ ν₁ ν₂ : MeasureTheory.Measure α}
(h : μ₁ ⟂ₘ ν₁)
(hμ : μ₂ ≪ μ₁)
(hν : ν₂ ≪ ν₁)


/-- Cauchy's Mean Value Theorem, extended `deriv` version. -/
theorem exists_ratio_deriv_eq_ratio_slope' {lfa lga lfb lgb : ℝ}
    (hdf : DifferentiableOn ℝ f <| Ioo a b) (hdg : DifferentiableOn ℝ g <| Ioo a b)
    (hfa : Tendsto f (𝓝[>] a) (𝓝 lfa)) (hga : Tendsto g (𝓝[>] a) (𝓝 lga))
    (hfb : Tendsto f (𝓝[<] b) (𝓝 lfb)) (hgb : Tendsto g (𝓝[<] b) (𝓝 lgb)) :
    ∃ c ∈ Ioo a b, (lgb - lga) * deriv f c = (lfb - lfa) * deriv g c

(hdf : DifferentiableOn ℝ f (Set.Ioo a b))

(hdg : DifferentiableOn ℝ g (Set.Ioo a b))

(hfa : Filter.Tendsto f (𝓝[>] a) (𝓝 lfa))

(hga : Filter.Tendsto g (𝓝[>] a) (𝓝 lga))

(hfb : Filter.Tendsto f (𝓝[<] b) (𝓝 lfb))

(hgb : Filter.Tendsto g (𝓝[<] b) (𝓝 lgb))

∃ c ∈ Set.Ioo a b, (lgb - lga) * deriv f c = (lfb - lfa) * deriv g c


theorem natDegree_multiset_prod_le : t.prod.natDegree ≤ (t.map natDegree).sum

{R : Type u}
[CommSemiring R]
(t : Multiset R[X])

t.prod.natDegree ≤ (Multiset.map Polynomial.natDegree t).sum


/-- Corresponds to `dist_eq_zero`. -/
@[simp]
theorem hammingDist_eq_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}


theorem edist_le_mul (h : LipschitzWith K f) (x y : α) : edist (f x) (f y) ≤ K * edist x y

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(h : LipschitzWith K f)
(x y : α)


theorem norm_of_nonpos (hr : r ≤ 0) : ‖r‖ = -r


@[simp]
theorem isBigOWith_principal {s : Set α} : IsBigOWith c (𝓟 s) f g ↔ ∀ x ∈ s, ‖f x‖ ≤ c * ‖g x‖

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{c : ℝ}
{f : α → E}
{g : α → F}
{s : Set α}

Asymptotics.IsBigOWith c (𝓟 s) f g ↔ ∀ x ∈ s, ‖f x‖ ≤ c * ‖g x‖


theorem liftP_iff {α : TypeVec n} (p : ∀ ⦃i⦄, α i → Prop) (x : P α) :
    LiftP p x ↔ ∃ a f, x = ⟨a, f⟩ ∧ ∀ i j, p (f i j)

{n : ℕ}
{P : MvPFunctor.{u} n}
{α : TypeVec.{u} n}
(p : ⦃i : Fin2 n⦄ → α i → Prop)
(x : ↑P α)

MvFunctor.LiftP p x ↔ ∃ a f, x = ⟨a, f⟩ ∧ ∀ (i : Fin2 n) (j : P.B a i), p (f i j)


/-- A quotient of a projective module is projective iff it is a direct summand. -/
theorem Projective.iff_split_of_projective [Module.Projective R M] (s : M →ₗ[R] P)
    (hs : Function.Surjective s) :
    Module.Projective R P ↔ ∃ i, s ∘ₗ i = LinearMap.id

{R : Type u}
[Ring R]
{P : Type v}
[AddCommGroup P]
[Module R P]
{M : Type u_1}
[AddCommGroup M]
[Module R M]
[Module.Projective R M]
(s : M →ₗ[R] P)
(hs : Function.Surjective ⇑s)


/-- The identity functor as a morphism of localizers. -/
@[simps]
def id : LocalizerMorphism W₁ W₁

(W₁ : CategoryTheory.MorphismProperty C₁)

(CategoryTheory.LocalizerMorphism.id W₁).functor = CategoryTheory.Functor.id C₁


theorem coe_image {s : Set ℝ≥0} :
    (↑) '' s = { x : ℝ | ∃ h : 0 ≤ x, @Membership.mem ℝ≥0 _ _ ⟨x, h⟩ s }

NNReal.toReal '' s = {x | ∃ (h : 0 ≤ x), ⟨x, h⟩ ∈ s}


@[simp]
theorem inv_right (a : N ⋊[φ] G) : a⁻¹.right = a.right⁻¹

{N : Type u_1}
{G : Type u_2}
[Group N]
[Group G]
{φ : G →* MulAut N}
(a : N ⋊[φ] G)


theorem USize.toNat_zero : (0 : USize).toNat = 0


@[simp]
theorem fpowerSeries_radius (f : E →L[𝕜] F) (x : E) : (f.fpowerSeries x).radius = ∞

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


/-- finite = integral + finite type -/
theorem RingHom.finite_iff_isIntegral_and_finiteType : f.Finite ↔ f.IsIntegral ∧ f.FiniteType

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


theorem natCast_floor_eq_intCast_floor (ha : 0 ≤ a) : (⌊a⌋₊ : α) = ⌊a⌋

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{a : α}
(ha : 0 ≤ a)

↑⌊a⌋₊ = ↑⌊a⌋


/-- If two linear maps are equal on a set `s`, then they are equal on `Submodule.span s`.

See also `LinearMap.eqOn_span'` for a version using `Set.EqOn`. -/
theorem eqOn_span {s : Set M} {f g : F} (H : Set.EqOn f g s) ⦃x⦄ (h : x ∈ span R s) :
    f x = g x

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Semiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{F : Type u_8}
{σ₁₂ : R →+* R₂}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
{s : Set M}
{f g : F}
(H : Set.EqOn (⇑f) (⇑g) s)
⦃x : M⦄
(h : x ∈ Submodule.span R s)


/-- Right multiplication by a matrix, as an `AddMonoidHom` from matrices to matrices. -/
@[simps]
def addMonoidHomMulRight [Fintype m] (M : Matrix m n α) : Matrix l m α →+ Matrix l n α

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocSemiring α]
[Fintype m]
(M : Matrix m n α)
(x : Matrix l m α)


@[to_additive]
theorem inv_eq_of_mul_eq_one_left (h : a * b = 1) : b⁻¹ = a

{G : Type u_1}
[SubtractionMonoid G]
{a b : G}
(h : a + b = 0)


lemma toSetoid_injective : Function.Injective (@toSetoid X _)


@[simp]
theorem aevalTower_ofId :
    aevalTower (Algebra.ofId S A) = (aeval : (σ → A) → MvPolynomial σ S →ₐ[S] A)

{σ : Type u_1}
{S : Type u_2}
{A : Type u_3}
[CommSemiring S]
[CommSemiring A]
[Algebra S A]

MvPolynomial.aevalTower (Algebra.ofId S A) = MvPolynomial.aeval


lemma isClosed_nonneg : IsClosed {x : α | 0 ≤ x}

{α : Type u_1}
[NormedLatticeAddCommGroup α]


/-- Eigenvalues of a diagonal linear operator with respect to standard basis
    are the diagonal entries. -/
lemma hasEigenvalue_toLin'_diagonal_iff [NoZeroDivisors R] (d : n → R) {μ : R} :
    HasEigenvalue (toLin' (diagonal d)) μ ↔ (∃ i, d i = μ)

{R : Type u_1}
{n : Type u_2}
[DecidableEq n]
[Fintype n]
[CommRing R]
[Nontrivial R]
[NoZeroDivisors R]
(d : n → R)
{μ : R}

Module.End.HasEigenvalue (Matrix.toLin' (Matrix.diagonal d)) μ ↔ ∃ i, d i = μ


@[to_additive]
lemma mem_subgroup_orbit_iff {H : Subgroup G} {x : α} {a b : orbit G x} :
    a ∈ MulAction.orbit H b ↔ (a : α) ∈ MulAction.orbit H (b : α)

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
{H : AddSubgroup G}
{x : α}
{a b : ↑(AddAction.orbit G x)}

a ∈ AddAction.orbit (↥H) b ↔ ↑a ∈ AddAction.orbit ↥H ↑b


/-- `sectr Z D` is the functor `D ⥤ C × D` given by `Y ↦ (Z, Y)` . -/
@[simps]
def sectr {C : Type u₁} [Category.{v₁} C] (Z : C) (D : Type u₂) [Category.{v₂} D] : D ⥤ C × D

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

∀ {X Y : D} (f : X ⟶ Y), (CategoryTheory.Prod.sectr Z D).map f = (CategoryTheory.CategoryStruct.id Z, f)


@[simp]
lemma coeff_C_succ {r : R} {n : ℕ} : coeff (C r) (n + 1) = 0

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


/-- A diagonal matrix is hermitian if each diagonal entry is self-adjoint -/
lemma isHermitian_diagonal_iff [DecidableEq n] {d : n → α} :
    IsHermitian (diagonal d) ↔ (∀ i : n, IsSelfAdjoint (d i))

{α : Type u_1}
{n : Type u_4}
[AddMonoid α]
[StarAddMonoid α]
[DecidableEq n]
{d : n → α}

(Matrix.diagonal d).IsHermitian ↔ ∀ (i : n), IsSelfAdjoint (d i)


@[simp]
theorem coe_opLinearEquiv_symm_addEquiv :
    ((opLinearEquiv R : M ≃ₗ[R] Mᵐᵒᵖ).symm : Mᵐᵒᵖ ≃+ M) = opAddEquiv.symm

(R : Type u)
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]

↑(MulOpposite.opLinearEquiv R).symm = MulOpposite.opAddEquiv.symm


/-- An equipartition of a finset with `n` elements into `k` parts has
`n - n % k` parts of size `n / k`. -/
theorem IsEquipartition.card_small_parts_eq_mod (hP : P.IsEquipartition) :
    (P.parts.filter fun p ↦ p.card = s.card / P.parts.card).card =
    P.parts.card - s.card % P.parts.card

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{P : Finpartition s}
(hP : P.IsEquipartition)

(Finset.filter (fun p => p.card = s.card / P.parts.card) P.parts).card = P.parts.card - s.card % P.parts.card


/-- If `u` is a monotone function with linear ordered codomain and the range of `u` is not bounded
above, then `Tendsto u atTop atTop`. -/
theorem tendsto_atTop_atTop_of_monotone' [Preorder ι] [LinearOrder α] {u : ι → α} (h : Monotone u)
    (H : ¬BddAbove (range u)) : Tendsto u atTop atTop

{ι : Type u_1}
{α : Type u_3}
[Preorder ι]
[LinearOrder α]
{u : ι → α}
(h : Monotone u)
(H : ¬BddAbove (Set.range u))

Filter.Tendsto u Filter.atTop Filter.atTop


@[to_additive]
theorem Filter.Tendsto.mul {f g : α → M} {x : Filter α} {a b : M} (hf : Tendsto f x (𝓝 a))
    (hg : Tendsto g x (𝓝 b)) : Tendsto (fun x => f x * g x) x (𝓝 (a * b))

{α : Type u_2}
{M : Type u_3}
[TopologicalSpace M]
[Mul M]
[ContinuousMul M]
{f g : α → M}
{x : Filter α}
{a b : M}
(hf : Filter.Tendsto f x (𝓝 a))
(hg : Filter.Tendsto g x (𝓝 b))

Filter.Tendsto (fun x => f x * g x) x (𝓝 (a * b))


theorem hasEigenvalue_of_hasEigenvector {f : End R M} {μ : R} {x : M} (h : HasEigenvector f μ x) :
    HasEigenvalue f μ

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : Module.End R M}
{μ : R}
{x : M}
(h : f.HasEigenvector μ x)


/-- One semiconjugates any element to itself. -/
@[to_additive (attr := simp) "Zero semiconjugates any element to itself."]
theorem one_left (x : M) : SemiconjBy 1 x x


theorem ofNat_one (n : Nat) : BitVec.ofNat 1 n = BitVec.ofBool (n % 2 = 1)

BitVec.ofNat 1 n = BitVec.ofBool (decide (n % 2 = 1))


lemma erase_biUnion (f : α → Finset β) (s : Finset α) (b : β) :
    (s.biUnion f).erase b = s.biUnion fun x ↦ (f x).erase b

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(f : α → Finset β)
(s : Finset α)
(b : β)

(s.biUnion f).erase b = s.biUnion fun x => (f x).erase b


theorem mem_of_integral {x : R} (hx : IsIntegral O x) : x ∈ v.integer

{R : Type u}
{Γ₀ : Type v}
[CommRing R]
[LinearOrderedCommGroupWithZero Γ₀]
{v : Valuation R Γ₀}
{O : Type w}
[CommRing O]
[Algebra O R]
(hv : v.Integers O)
{x : R}
(hx : IsIntegral O x)


lemma negMulLog_def : negMulLog = fun x ↦ - x * log x

Real.negMulLog = fun x => -x * Real.log x


@[simp]
theorem lists_coe (l : List α) : lists (l : Cycle α) = ↑l.cyclicPermutations


@[simp]
theorem injective (φ : M ↪ₑ[L] N) : Function.Injective φ

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
[L.Structure N]
(φ : M ↪ₑ[L] N)


@[simp]
theorem singleton_lookupFinsupp (a : α) (m : M) :
    (singleton a m).lookupFinsupp = Finsupp.single a m

{α : Type u_1}
{M : Type u_2}
[Zero M]
(a : α)
(m : M)

(AList.singleton a m).lookupFinsupp = Finsupp.single a m


/-- The unit in `Presheaf.stalkFunctor ⊣ skyscraperPresheafFunctor`
-/
@[simps]
protected def unit :
    𝟭 (Presheaf C X) ⟶ Presheaf.stalkFunctor C p₀ ⋙ skyscraperPresheafFunctor p₀

[(U : TopologicalSpace.Opens ↑X) → Decidable (p₀ ∈ U)]

(StalkSkyscraperPresheafAdjunctionAuxs.unit p₀).app 𝓕 =
  StalkSkyscraperPresheafAdjunctionAuxs.toSkyscraperPresheaf p₀ (𝟙 (((𝟭 (TopCat.Presheaf C X)).obj 𝓕).stalk p₀))


protected theorem mul_right_cancel_iff {m : Nat} (p : 0 < m) (n k : Nat) : n * m = k * m ↔ n = k


theorem union_upperBounds_subset_upperBounds_inter :
    upperBounds s ∪ upperBounds t ⊆ upperBounds (s ∩ t)


@[simp]
lemma coe_one : ↑(1 : M ≃ₗ[R] M) = id

{R : Type u_1}
{M : Type u_8}
[Semiring R]
[AddCommMonoid M]
[Module R M]


@[simp] theorem tail?_map (f : α → β) (l : List α) : tail? (map f l) = (tail? l).map (map f)

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

(List.map f l).tail? = Option.map (List.map f) l.tail?


/--
A `Pair d i` is a word in the coproduct, `Coprod G`, the `tail`, and an element of the group `G i`,
the `head`. The first letter of the `tail` must not be an element of `G i`.
Note that the `head` may be `1` Every letter in the `tail` must be in the transversal given by `d`.
Similar to `Monoid.CoprodI.Pair` except every letter must be in the transversal
(not including the head letter). -/
structure Pair (d : Transversal φ) (i : ι) extends CoprodI.Word.Pair G i where
  /-- All letters in the word are in the transversal. -/
  normalized : ∀ i g, ⟨i, g⟩ ∈ tail.toList → g ∈ d.set i

{d : Monoid.PushoutI.NormalWord.Transversal φ}

(self : Monoid.PushoutI.NormalWord.Pair d i)

∀ (i_1 : ι) (g : G i_1), ⟨i_1, g⟩ ∈ self.tail.toList → g ∈ d.set i_1


@[to_additive]
theorem Measurable.mul_iff_right {G : Type*} [MeasurableSpace G] [MeasurableSpace α] [CommGroup G]
    [MeasurableMul₂ G] [MeasurableInv G] {f g : α → G} (hf : Measurable f) :
    Measurable (f * g) ↔ Measurable g

{α : Type u_1}
{G : Type u_2}
[MeasurableSpace G]
[MeasurableSpace α]
[AddCommGroup G]
[MeasurableAdd₂ G]
[MeasurableNeg G]
{f g : α → G}
(hf : Measurable f)


/-- Extensionality lemma for monoid homomorphisms `M ∗ N →* P`.
If two homomorphisms agree on the ranges of `Monoid.Coprod.inl` and `Monoid.Coprod.inr`,
then they are equal. -/
@[to_additive (attr := ext 1100)
  "Extensionality lemma for additive monoid homomorphisms `AddMonoid.Coprod M N →+ P`.
  If two homomorphisms agree on the ranges of `AddMonoid.Coprod.inl` and `AddMonoid.Coprod.inr`,
  then they are equal."]
theorem hom_ext {f g : M ∗ N →* P} (h₁ : f.comp inl = g.comp inl) (h₂ : f.comp inr = g.comp inr) :
    f = g

(h₁ : f.comp AddMonoid.Coprod.inl = g.comp AddMonoid.Coprod.inl)

(h₂ : f.comp AddMonoid.Coprod.inr = g.comp AddMonoid.Coprod.inr)


theorem Kernel.lintegral_fn_integral_sub ⦃f g : β × γ → E⦄ (F : E → ℝ≥0∞)
    (hf : Integrable f ((κ ⊗ₖ η) a)) (hg : Integrable g ((κ ⊗ₖ η) a)) :
    ∫⁻ x, F (∫ y, f (x, y) - g (x, y) ∂η (a, x)) ∂κ a =
      ∫⁻ x, F (∫ y, f (x, y) ∂η (a, x) - ∫ y, g (x, y) ∂η (a, x)) ∂κ a

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

⦃f g : β × γ → E⦄

(hf : MeasureTheory.Integrable f ((κ ⊗ₖ η) a))

(hg : MeasureTheory.Integrable g ((κ ⊗ₖ η) a))

∫⁻ (x : β), F (∫ (y : γ), f (x, y) - g (x, y) ∂η (a, x)) ∂κ a =
  ∫⁻ (x : β), F (∫ (y : γ), f (x, y) ∂η (a, x) - ∫ (y : γ), g (x, y) ∂η (a, x)) ∂κ a


@[to_additive]
theorem mul_right_iterate_apply_one : (· * a)^[n] 1 = a ^ n

{G : Type u_3}
[Monoid G]
(a : G)
(n : ℕ)


@[to_additive]
lemma prod_ite_of_false {p : α → Prop} {_ : DecidablePred p} (h : ∀ x ∈ s, ¬p x) (f g : α → β) :
    ∏ x ∈ s, (if p x then f x else g x) = ∏ x ∈ s, g x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
[AddCommMonoid β]
{p : α → Prop}

∀ {x : DecidablePred p}, (∀ x ∈ s, ¬p x) → ∀ (f g : α → β), (∑ x_1 ∈ s, if p x_1 then f x_1 else g x_1) = ∑ x ∈ s, g x


@[to_additive]
theorem saturated_iff_npow {H : Subgroup G} :
    Saturated H ↔ ∀ (n : ℕ) (g : G), g ^ n ∈ H → n = 0 ∨ g ∈ H

{G : Type u_1}
[Group G]
{H : Subgroup G}

H.Saturated ↔ ∀ (n : ℕ) (g : G), g ^ n ∈ H → n = 0 ∨ g ∈ H


/-- The character is multiplicative under the tensor product. -/
theorem char_tensor (V W : FDRep k G) : (V ⊗ W).character = V.character * W.character

{k : Type u}
[Field k]
{G : Type u}
[Monoid G]
(V W : FDRep k G)


@[simp]
theorem edgeSet_sSup (s : Set G.Subgraph) : (sSup s).edgeSet = ⋃ G' ∈ s, edgeSet G'

{V : Type u}
{G : SimpleGraph V}
(s : Set G.Subgraph)


theorem isPositive_one : IsPositive (1 : E →L[𝕜] E)

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