/-- The sum of two lower semicontinuous functions is lower semicontinuous. Formulated with
`[ContinuousAdd]`. The primed version of the lemma uses an explicit continuity assumption on
addition, for application to `EReal`. -/
theorem LowerSemicontinuousWithinAt.add {f g : α → γ} (hf : LowerSemicontinuousWithinAt f s x)
    (hg : LowerSemicontinuousWithinAt g s x) :
    LowerSemicontinuousWithinAt (fun z => f z + g z) s x


@[to_additive]
theorem fst_surjective : Surjective (fst : M ∗ N →* M)

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


theorem pow_eq_closure_pow_set (s : AddSubmonoid R) (n : ℕ) :
    s ^ n = closure ((s : Set R) ^ n)

{R : Type u_4}
[Semiring R]
(s : AddSubmonoid R)
(n : ℕ)


@[simp] theorem trans_apply (f : α ≃ β) (g : β ≃ γ) (a : α) : (f.trans g) a = g (f a)

{α : Sort u}
{β : Sort v}
{γ : Sort w}
(f : α ≃ β)
(g : β ≃ γ)
(a : α)


theorem ae_bdd_liminf_atTop_rpow_of_eLpNorm_bdd {p : ℝ≥0∞} {f : ℕ → α → E}
    (hfmeas : ∀ n, Measurable (f n)) (hbdd : ∀ n, eLpNorm (f n) p μ ≤ R) :
    ∀ᵐ x ∂μ, liminf (fun n => ((‖f n x‖₊ : ℝ≥0∞) ^ p.toReal : ℝ≥0∞)) atTop < ∞

(hbdd : ∀ (n : ℕ), MeasureTheory.eLpNorm (f n) p μ ≤ ↑R)

∀ᵐ (x : α) ∂μ, Filter.liminf (fun n => ↑‖f n x‖₊ ^ p.toReal) Filter.atTop < ⊤


theorem Chain.imp' {R S : α → α → Prop} (HRS : ∀ ⦃a b⦄, R a b → S a b) {a b : α}
    (Hab : ∀ ⦃c⦄, R a c → S b c) {l : List α} (p : Chain R a l) : Chain S b l

{α : Type u_1}
{R S : α → α → Prop}
(HRS : ∀ ⦃a b : α⦄, R a b → S a b)
{a b : α}
(Hab : ∀ ⦃c : α⦄, R a c → S b c)
{l : List α}
(p : List.Chain R a l)


/-- The `fg` argument is to avoid nasty stuff about dependent types. -/
theorem app_eq_appIso_inv_app_of_comp_eq {X Y U : Scheme.{u}} (f : Y ⟶ U) (g : U ⟶ X) (fg : Y ⟶ X)
    (H : fg = f ≫ g) [h : IsOpenImmersion g] (V : U.Opens) :
    f.app V = (g.appIso V).inv ≫ fg.app (g ''ᵁ V) ≫ Y.presheaf.map
      (eqToHom <| IsOpenImmersion.app_eq_invApp_app_of_comp_eq_aux f g fg H V).op

[h : AlgebraicGeometry.IsOpenImmersion g]

AlgebraicGeometry.Scheme.Hom.app f V =
  (AlgebraicGeometry.Scheme.Hom.appIso g V).inv ≫
    AlgebraicGeometry.Scheme.Hom.app fg ((AlgebraicGeometry.Scheme.Hom.opensFunctor g).obj V) ≫
      Y.presheaf.map (CategoryTheory.eqToHom ⋯).op


theorem Subsemiring.toNonUnitalSubsemiring_toSubsemiring (S : Subsemiring R) :
    S.toNonUnitalSubsemiring.toSubsemiring S.one_mem = S

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

S.toNonUnitalSubsemiring.toSubsemiring ⋯ = S


/-- 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).mul = F.μ A.X A.X ≫ F.map A.mul


/-- If a partial homeomorphism has source and target equal to univ, then it induces a homeomorphism
between the whole spaces, expressed in this definition. -/
@[simps (config := mfld_cfg) apply symm_apply]
-- Porting note (#11215): TODO: add a `PartialEquiv` version
def toHomeomorphOfSourceEqUnivTargetEqUniv (h : e.source = (univ : Set X)) (h' : e.target = univ) :
    X ≃ₜ Y

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
(h : e.source = Set.univ)
(h' : e.target = Set.univ)

⇑(e.toHomeomorphOfSourceEqUnivTargetEqUniv h h').symm = ↑e.symm


/-- The short complex `L₀.X₃ ⟶ L₃.X₁ ⟶ L₃.X₂`. -/
@[simps]
noncomputable def L₂' : ShortComplex C

(S : CategoryTheory.ShortComplex.SnakeInput C)


theorem basisSets_add (U) (hU : U ∈ p.basisSets) :
    ∃ V ∈ p.basisSets, V + V ⊆ U

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : SeminormFamily 𝕜 E ι)
(U : Set E)
(hU : U ∈ p.basisSets)


theorem bijOn_range (h : Semiconj f fa fb) (ha : Bijective fa) (hf : Injective f) :
    BijOn fb (range f) (range f)

{α : Type u_1}
{β : Type u_2}
{fa : α → α}
{fb : β → β}
{f : α → β}
(h : Function.Semiconj f fa fb)
(ha : Function.Bijective fa)
(hf : Function.Injective f)

Set.BijOn fb (Set.range f) (Set.range f)


@[simp]
theorem coe_orderIsoMultiset [DecidableEq ι] : ⇑(@orderIsoMultiset ι _) = toMultiset


theorem iSup_lsingle_range : ⨆ a, LinearMap.range (lsingle a : M →ₗ[R] α →₀ M) = ⊤

{α : Type u_1}
{M : Type u_2}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]

⨆ a, LinearMap.range (Finsupp.lsingle a) = ⊤


theorem bounded_lt_Iic [Preorder α] [NoMaxOrder α] (a : α) : Bounded (· < ·) (Iic a)

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

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


/-- If a sequence of functions between real or complex normed spaces are differentiable on a
preconnected open set, they form a Cauchy sequence _at_ `x`, and their derivatives are Cauchy
uniformly on the set, then the functions form a Cauchy sequence at any point in the set. -/
theorem cauchy_map_of_uniformCauchySeqOn_fderiv {s : Set E} (hs : IsOpen s) (h's : IsPreconnected s)
    (hf' : UniformCauchySeqOn f' l s) (hf : ∀ n : ι, ∀ y : E, y ∈ s → HasFDerivAt (f n) (f' n y) y)
    {x₀ x : E} (hx₀ : x₀ ∈ s) (hx : x ∈ s) (hfg : Cauchy (map (fun n => f n x₀) l)) :
    Cauchy (map (fun n => f n x) l)

(hf : ∀ (n : ι), ∀ y ∈ s, HasFDerivAt (f n) (f' n y) y)

(hfg : Cauchy (Filter.map (fun n => f n x₀) l))


/-- The oscillation of `f` at `x` within `univ` is equal to `oscillation f x` -/
theorem oscillationWithin_univ_eq_oscillation [TopologicalSpace E] (f : E → F) (x : E) :
    oscillationWithin f univ x = oscillation f x

{E : Type u}
{F : Type v}
[PseudoEMetricSpace F]
[TopologicalSpace E]
(f : E → F)
(x : E)

oscillationWithin f Set.univ x = oscillation f x


@[simp] theorem toNat_or (x y : BitVec v) :
    BitVec.toNat (x ||| y) = BitVec.toNat x ||| BitVec.toNat y


theorem isGLB_pi {s : Set (∀ a, π a)} {f : ∀ a, π a} :
    IsGLB s f ↔ ∀ a, IsGLB (Function.eval a '' s) (f a)

{α : Type u}
{π : α → Type u_1}
[(a : α) → Preorder (π a)]
{s : Set ((a : α) → π a)}
{f : (a : α) → π a}

IsGLB s f ↔ ∀ (a : α), IsGLB (Function.eval a '' s) (f a)


@[simp]
lemma image_subtype_val_Iio_Iio {a : α} (b : Iio a) : Subtype.val '' Iio b = Iio b.1

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


@[simp]
lemma leftUnshift_units_smul {n' a : ℤ} (γ : Cochain (K⟦a⟧) L n') (n : ℤ)
    (hn : n + a = n') (x : Rˣ) :
    (x • γ).leftUnshift n hn = x • γ.leftUnshift n hn

(γ : CochainComplex.HomComplex.Cochain ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) a).obj K) L n')


theorem LieSubalgebra.ad_comp_incl_eq (K : LieSubalgebra R L) (x : K) :
    (ad R L ↑x).comp (K.incl : K →ₗ[R] L) = (K.incl : K →ₗ[R] L).comp (ad R K x)

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(K : LieSubalgebra R L)
(x : ↥K)

(LieAlgebra.ad R L) ↑x ∘ₗ ↑K.incl = ↑K.incl ∘ₗ (LieAlgebra.ad R ↥K) x


@[simp, norm_cast] theorem coe_one : ↑(1 : ℝ≥0) = (1 : ℝ≥0∞)


@[simp]
lemma equalizerSieve_eq_top_iff {F : Cᵒᵖ ⥤ D} {X : Cᵒᵖ} (x y : F.obj X) :
    equalizerSieve x y = ⊤ ↔ x = y

(x y : (CategoryTheory.forget D).obj (F.obj X))

CategoryTheory.Presheaf.equalizerSieve x y = ⊤ ↔ x = y


@[to_additive (attr := simp)]
theorem prod_ite_irrel (p : Prop) [Decidable p] (s : Finset α) (f g : α → β) :
    ∏ x ∈ s, (if p then f x else g x) = if p then ∏ x ∈ s, f x else ∏ x ∈ s, g x

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

(∑ x ∈ s, if p then f x else g x) = if p then ∑ x ∈ s, f x else ∑ x ∈ s, g x


theorem exists_Ioc_subset_of_mem_nhds' [OrderTopology α] {a : α} {s : Set α} (hs : s ∈ 𝓝 a) {l : α}
    (hl : l < a) : ∃ l' ∈ Ico l a, Ioc l' a ⊆ s

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


theorem integral_piecewise [DecidablePred (· ∈ s)] (hs : MeasurableSet s) (hf : IntegrableOn f s μ)
    (hg : IntegrableOn g sᶜ μ) :
    ∫ x, s.piecewise f g x ∂μ = ∫ x in s, f x ∂μ + ∫ x in sᶜ, g x ∂μ

(hg : MeasureTheory.IntegrableOn g sᶜ μ)

∫ (x : X), s.piecewise f g x ∂μ = ∫ (x : X) in s, f x ∂μ + ∫ (x : X) in sᶜ, g x ∂μ


@[rclike_simps]
theorem smul_re (r : ℝ) (z : K) : re (r • z) = r * re z

{K : Type u_1}
[RCLike K]
(r : ℝ)
(z : K)


lemma exact_of_f_is_kernel (hS : IsLimit (KernelFork.ofι S.f S.zero))
    [S.HasHomology] : S.Exact

(hS : CategoryTheory.Limits.IsLimit (CategoryTheory.Limits.KernelFork.ofι S.f ⋯))


theorem AEEqFun.compMeasurePreserving_mem_Lp {β : Type*} [MeasurableSpace β]
    {μb : MeasureTheory.Measure β} {g : β →ₘ[μb] E} (hg : g ∈ Lp E p μb) {f : α → β}
    (hf : MeasurePreserving f μ μb) :
    g.compMeasurePreserving f hf ∈ Lp E p μ

(hf : MeasureTheory.MeasurePreserving f μ μb)

g.compMeasurePreserving f hf ∈ MeasureTheory.Lp E p μ


@[to_additive] lemma zpow_self : Commute (a ^ n) a

{G : Type u_1}
[Group G]
(a : G)
(n : ℤ)


theorem CNFRec_pos (b : Ordinal) {o : Ordinal} {C : Ordinal → Sort*} (ho : o ≠ 0) (H0 : C 0)
    (H : ∀ o, o ≠ 0 → C (o % b ^ log b o) → C o) :
    @CNFRec b C H0 H o = H o ho (@CNFRec b C H0 H _)

(H : (o : Ordinal.{u_2}) → o ≠ 0 → C (o % b ^ Ordinal.log b o) → C o)

b.CNFRec H0 H o = H o ho (b.CNFRec H0 H (o % b ^ Ordinal.log b o))


theorem mk_multiset_sum (l : Multiset R) (b : M) : mk l.sum b = (l.map fun a => mk a b).sum

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(l : Multiset R)
(b : ↥M)

Localization.mk l.sum b = (Multiset.map (fun a => Localization.mk a b) l).sum


lemma smul_eq_smul_iff_eq_and_eq_of_pos [PosSMulStrictMono α β] [SMulPosStrictMono α β]
    (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) (h₁ : 0 < a₁) (h₂ : 0 < b₂) :
    a₁ • b₁ = a₂ • b₂ ↔ a₁ = a₂ ∧ b₁ = b₂

{α : Type u_1}
{β : Type u_2}
{a₁ a₂ : α}
{b₁ b₂ : β}
[Zero α]
[Zero β]
[SMulWithZero α β]
[PartialOrder α]
[PartialOrder β]
[PosSMulStrictMono α β]
[SMulPosStrictMono α β]
(ha : a₁ ≤ a₂)
(hb : b₁ ≤ b₂)
(h₁ : 0 < a₁)
(h₂ : 0 < b₂)

a₁ • b₁ = a₂ • b₂ ↔ a₁ = a₂ ∧ b₁ = b₂


/-- If `f` is a partition of unity on `s`, then for every `x ∈ s` there exists an index `i` such
that `0 < f i x`. -/
theorem exists_pos {x : X} (hx : x ∈ s) : ∃ i, 0 < f i x

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : PartitionOfUnity ι X s)
{x : X}
(hx : x ∈ s)


@[to_additive] lemma lintegral_eq_tsum'' (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) :
    ∫⁻ x, f x ∂μ = ∑' g : G, ∫⁻ x in s, f (g • x) ∂μ

[MeasureTheory.SMulInvariantMeasure G α μ]

(h : MeasureTheory.IsFundamentalDomain G s μ)

(f : α → ℝ≥0∞)

∫⁻ (x : α), f x ∂μ = ∑' (g : G), ∫⁻ (x : α) in s, f (g • x) ∂μ


theorem auxEquiv_one : auxEquiv R 𝒜 ℬ 1 = 1

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

(GradedTensorProduct.auxEquiv R 𝒜 ℬ) 1 = 1


@[simps]
instance : TotalComplexShape c c c

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

∀ (x : I × I),
  TotalComplexShape.ε₂ c c c x =
    match x with
    | (p, snd) => c.ε p


@[simp] theorem join_cons : (l :: ls).join = l ++ ls.join

∀ {α : Type u_1} {l : List α} {ls : List (List α)}, (l :: ls).join = l ++ ls.join


@[simp]
lemma leftHomologyMap_smul : leftHomologyMap (a • φ) = a • leftHomologyMap φ

{R : Type u_1}
{C : Type u_2}
[Semiring R]
[CategoryTheory.Category.{u_3, u_2} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ : S₁ ⟶ S₂)
(a : R)
[S₁.HasLeftHomology]
[S₂.HasLeftHomology]

CategoryTheory.ShortComplex.leftHomologyMap (a • φ) = a • CategoryTheory.ShortComplex.leftHomologyMap φ


theorem equiv_mul_right_of_mem {g k : G} (h : k ∈ K) :
    hSK.equiv (g * k) = ((hSK.equiv g).fst, (hSK.equiv g).snd * ⟨k, h⟩)

{G : Type u_1}
[Group G]
{K : Subgroup G}
{S : Set G}
(hSK : Subgroup.IsComplement S ↑K)
{g k : G}
(h : k ∈ K)

hSK.equiv (g * k) = ((hSK.equiv g).1, (hSK.equiv g).2 * ⟨k, h⟩)


theorem uniformSpace_edist :
    ‹PseudoEMetricSpace α›.toUniformSpace =
      uniformSpaceOfEDist edist edist_self edist_comm edist_triangle

PseudoEMetricSpace.toUniformSpace = uniformSpaceOfEDist edist ⋯ ⋯ ⋯


theorem single_apply (i : ℕ) (m : M) (n : ℕ) : single R i m n = ite (i = n) m 0

(R : Type u_1)
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(i : ℕ)
(m : M)
(n : ℕ)

((PolynomialModule.single R i) m) n = if i = n then m else 0


@[simp]
theorem ofMapBounded_apply (f : α → β) {h} (a : α) : ofMapBounded f h a = f a

{h : ∀ ⦃s : Set α⦄, Bornology.IsBounded s → Bornology.IsBounded (f '' s)}

(LocallyBoundedMap.ofMapBounded f h) a = f a


theorem det_eq_one_of_finrank_eq_zero {𝕜 : Type*} [Field 𝕜] {M : Type*} [AddCommGroup M]
    [Module 𝕜 M] (h : FiniteDimensional.finrank 𝕜 M = 0) (f : M →ₗ[𝕜] M) :
    LinearMap.det (f : M →ₗ[𝕜] M) = 1

{𝕜 : Type u_7}
[Field 𝕜]
{M : Type u_8}
[AddCommGroup M]
[Module 𝕜 M]
(h : FiniteDimensional.finrank 𝕜 M = 0)
(f : M →ₗ[𝕜] M)


@[simp]
theorem mem_top : a ∈ (⊤ : LowerSet α)


protected theorem of_ae_eq {g : α → γ} (hf : AEMeasurable f μ) (heq : f =ᵐ[μ] g) :
    IdentDistrib f g μ μ

{α : Type u_1}
{γ : Type u_3}
[MeasurableSpace α]
[MeasurableSpace γ]
{μ : MeasureTheory.Measure α}
{f g : α → γ}
(hf : AEMeasurable f μ)
(heq : f =ᵐ[μ] g)


@[simp]
lemma Differentiable.add_iff_right (hg : Differentiable 𝕜 f) :
    Differentiable 𝕜 (fun y => f y + g y) ↔ Differentiable 𝕜 g

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

(Differentiable 𝕜 fun y => f y + g y) ↔ Differentiable 𝕜 g


theorem strictMono_fst : StrictMono (Prod.fst ∘ toProd : Concept α β r → Set α)

{α : Type u_2}
{β : Type u_3}
{r : α → β → Prop}


/-- The affine span of any two distinct points of a collinear set of points equals the affine
span of the whole set. -/
theorem Collinear.affineSpan_eq_of_ne {s : Set P} (h : Collinear k s) {p₁ p₂ : P} (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) (hp₁p₂ : p₁ ≠ p₂) : line[k, p₁, p₂] = affineSpan k s

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
(h : Collinear k s)
{p₁ p₂ : P}
(hp₁ : p₁ ∈ s)
(hp₂ : p₂ ∈ s)
(hp₁p₂ : p₁ ≠ p₂)


theorem ediv_sign : ∀ a b, a / sign b = a * sign b


theorem jb_transform : (PB l R)ᵀ * JB l R * PB l R = (2 : R) • Matrix.fromBlocks 1 0 0 (S l R)

(l : Type u_4)
(R : Type u₂)
[DecidableEq l]
[CommRing R]
[Fintype l]

(LieAlgebra.Orthogonal.PB l R).transpose * LieAlgebra.Orthogonal.JB l R * LieAlgebra.Orthogonal.PB l R =
  2 • Matrix.fromBlocks 1 0 0 (LieAlgebra.Orthogonal.S l R)


theorem pathConnected_subset_basis [LocPathConnectedSpace X] {U : Set X} (h : IsOpen U)
    (hx : x ∈ U) : (𝓝 x).HasBasis (fun s : Set X => s ∈ 𝓝 x ∧ IsPathConnected s ∧ s ⊆ U) id

{X : Type u_1}
[TopologicalSpace X]
{x : X}
[LocPathConnectedSpace X]
{U : Set X}
(h : IsOpen U)
(hx : x ∈ U)

(𝓝 x).HasBasis (fun s => s ∈ 𝓝 x ∧ IsPathConnected s ∧ s ⊆ U) id


theorem injective_of_surjective_of_injective
    {N : Type w} [AddCommMonoid N] [Module R N]
    (i f : N →ₗ[R] M) (hi : Injective i) (hf : Surjective f) : Injective f

{R : Type u}
[Semiring R]
[OrzechProperty R]
{M : Type v}
[AddCommMonoid M]
[Module R M]
[Module.Finite R M]
{N : Type w}
[AddCommMonoid N]
[Module R N]
(i f : N →ₗ[R] M)
(hi : Function.Injective ⇑i)
(hf : Function.Surjective ⇑f)


/-- Let $M$ be a flat module. Let $K$ and $N$ be finite $R$-modules with $N$
free, and let $f \colon K \to N$ and $x \colon N \to M$ be homomorphisms such that
$x \circ f = 0$. Then there exist a finite index type $\kappa$ and module homomorphisms
$a \colon N \to R^{\kappa}$ and $y \colon R^{\kappa} \to M$ such that $x = y \circ a$ and
$a \circ f = 0$. -/
theorem exists_factorization_of_comp_eq_zero_of_free [Flat R M] {K N : Type u}
    [AddCommGroup K] [Module R K] [Finite R K] [AddCommGroup N] [Module R N] [Free R N] [Finite R N]
    {f : K →ₗ[R] N} {x : N →ₗ[R] M} (h : x ∘ₗ f = 0) :
    ∃ (κ : Type u) (_ : Fintype κ) (a : N →ₗ[R] (κ →₀ R)) (y : (κ →₀ R) →ₗ[R] M),
      x = y ∘ₗ a ∧ a ∘ₗ f = 0

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.Flat R M]
{K N : Type u}
[AddCommGroup K]
[Module R K]
[Module.Finite R K]
[AddCommGroup N]
[Module R N]
[Module.Free R N]
[Module.Finite R N]
{f : K →ₗ[R] N}
{x : N →ₗ[R] M}
(h : x ∘ₗ f = 0)


lemma continuousOn_one_add_mul_inv {z : ℂ} (hz : 1 + z ∈ slitPlane) :
    ContinuousOn (fun t : ℝ ↦ (1 + t • z)⁻¹) (Set.Icc 0 1)

{z : ℂ}
(hz : 1 + z ∈ Complex.slitPlane)

ContinuousOn (fun t => (1 + t • z)⁻¹) (Set.Icc 0 1)


(R : Type u_1)
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]


theorem pseudoApply_mk' {P Q : C} (f : P ⟶ Q) (a : Over P) : f ⟦a⟧ = ⟦↑(a.hom ≫ f)⟧

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q : C}
(f : P ⟶ Q)
(a : CategoryTheory.Over P)

CategoryTheory.Abelian.Pseudoelement.pseudoApply f ⟦a⟧ = ⟦CategoryTheory.Over.mk (a.hom ≫ f)⟧


theorem counit_app_functor (e : C ≌ D) (X : C) :
    e.counit.app (e.functor.obj X) = e.functor.map (e.unitInv.app X)

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


@[to_additive (attr := simp)]
theorem mk_smul_mk (r : R) (x : M) (hx : x ∈ s) : r • (⟨x, hx⟩ : s) = ⟨r • x, smul_mem r hx⟩

{S : Type u'}
{R : Type u}
{M : Type v}
[VAdd R M]
[SetLike S M]
[hS : VAddMemClass S R M]
(s : S)
(r : R)
(x : M)
(hx : x ∈ s)


@[simp]
theorem coe_orderIso_refl : (OrderRingIso.refl α : α ≃o α) = OrderIso.refl α

↑(OrderRingIso.refl α) = OrderIso.refl α


theorem det_updateRow_add_self (A : Matrix n n R) {i j : n} (hij : i ≠ j) :
    det (updateRow A i (A i + A j)) = det A

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A : Matrix n n R)
{i j : n}
(hij : i ≠ j)


lemma finset_inf_nhds [SemilatticeInf L] [OrderTop L] [ContinuousInf L]
    (hs : ∀ i ∈ s, Tendsto (f i) l (𝓝 (g i))) : Tendsto (s.inf f) l (𝓝 (s.inf g))

(hs : ∀ i ∈ s, Filter.Tendsto (f i) l (𝓝 (g i)))

Filter.Tendsto (s.inf f) l (𝓝 (s.inf g))


theorem mem_inv_pointwise_smul_iff {a : α} {S : Subgroup G} {x : G} : x ∈ a⁻¹ • S ↔ a • x ∈ S

{α : Type u_1}
{G : Type u_2}
[Group G]
[Group α]
[MulDistribMulAction α G]
{a : α}
{S : Subgroup G}
{x : G}

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


nonrec lemma EdgeDisjointTriangles.mono (h : G ≤ H) (hH : H.EdgeDisjointTriangles) :
    G.EdgeDisjointTriangles

{α : Type u_1}
{G H : SimpleGraph α}
(h : G ≤ H)
(hH : H.EdgeDisjointTriangles)


@[simp]
theorem not_mem_bot (x : ℕ × ℕ) : x ∉ (⊥ : YoungDiagram)


@[simp]
lemma sub_app (f g : P ⟶ Q) (X : Cᵒᵖ) : (f - g).app X = f.app X - g.app X

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

PresheafOfModules.Hom.app (f - g) X = PresheafOfModules.Hom.app f X - PresheafOfModules.Hom.app g X


theorem le_iff_mem_closure (x y : ProjectiveSpectrum 𝒜) :
    x ≤ y ↔ y ∈ closure ({x} : Set (ProjectiveSpectrum 𝒜))

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(x y : ProjectiveSpectrum 𝒜)


theorem Inseparable.specializes (h : x ~ᵢ y) : x ⤳ y

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
(h : x ~ᵢ y)


theorem nullMeasurableSet_lt [SecondCountableTopology α] {μ : Measure δ} {f g : δ → α}
    (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) : NullMeasurableSet { a | f a < g a } μ

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[MeasurableSpace δ]
[LinearOrder α]
[OrderClosedTopology α]
[SecondCountableTopology α]
{μ : MeasureTheory.Measure δ}
{f g : δ → α}
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)

MeasureTheory.NullMeasurableSet {a | f a < g a} μ


/-- Expressing uniform convergence on a set using `edist`. -/
theorem tendstoUniformlyOn_iff {ι : Type*} {F : ι → β → α} {f : β → α} {p : Filter ι} {s : Set β} :
    TendstoUniformlyOn F f p s ↔ ∀ ε > 0, ∀ᶠ n in p, ∀ x ∈ s, edist (f x) (F n x) < ε

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
{ι : Type u_2}
{F : ι → β → α}
{f : β → α}
{p : Filter ι}
{s : Set β}

TendstoUniformlyOn F f p s ↔ ∀ ε > 0, ∀ᶠ (n : ι) in p, ∀ x ∈ s, edist (f x) (F n x) < ε


theorem localInverse_apply_image {n : ℕ∞} (hf : ContDiffAt 𝕂 n f a)
    (hf' : HasFDerivAt f (f' : E →L[𝕂] F) a) (hn : 1 ≤ n) : hf.localInverse hf' hn (f a) = a

{𝕂 : Type u_1}
[RCLike 𝕂]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕂 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕂 F]
[CompleteSpace E]
{f : E → F}
{f' : E ≃L[𝕂] F}
{a : E}
{n : ℕ∞}
(hf : ContDiffAt 𝕂 n f a)
(hf' : HasFDerivAt f (↑f') a)
(hn : 1 ≤ n)


theorem DirectedOn.strictConvex_sUnion {S : Set (Set E)} (hdir : DirectedOn (· ⊆ ·) S)
    (hS : ∀ s ∈ S, StrictConvex 𝕜 s) : StrictConvex 𝕜 (⋃₀ S)

(hdir : DirectedOn (fun x x_1 => x ⊆ x_1) S)


/-- The sequence `TopologicalSpace.denseSeq α` has dense range. -/
@[simp]
theorem denseRange_denseSeq [SeparableSpace α] [Nonempty α] : DenseRange (denseSeq α)

(α : Type u)
[t : TopologicalSpace α]
[TopologicalSpace.SeparableSpace α]
[Nonempty α]


@[simp, norm_cast]
theorem codisjoint_coe : Codisjoint (s : Set α) t ↔ Disjoint s t

{α : Type u_1}
[LE α]
{s t : UpperSet α}


theorem continuous_extension : Continuous (Valued.extension : hat K → Γ₀)

{K : Type u_1}
[Field K]
{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
[hv : Valued K Γ₀]


@[to_additive sum_lt_sum]
lemma prod_lt_prod' (hle : ∀ i ∈ s, f i ≤ g i) (hlt : ∃ i ∈ s, f i < g i) :
    (s.map f).prod < (s.map g).prod

{ι : Type u_1}
{α : Type u_2}
[OrderedCancelCommMonoid α]
{s : Multiset ι}
{f g : ι → α}
(hle : ∀ i ∈ s, f i ≤ g i)
(hlt : ∃ i ∈ s, f i < g i)

(Multiset.map f s).prod < (Multiset.map g s).prod


@[to_additive]
theorem sInf_mul : sInf (s * t) = sInf s * sInf t

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

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


@[simp]
theorem toNNReal_le_toNNReal (ha : a ≠ ∞) (hb : b ≠ ∞) : a.toNNReal ≤ b.toNNReal ↔ a ≤ b


/-- The projection on the base of a fiber bundle created from core is continuous -/
nonrec theorem continuous_proj : Continuous Z.proj

{ι : Type u_1}
{B : Type u_2}
{F : Type u_3}
[TopologicalSpace B]
[TopologicalSpace F]
(Z : FiberBundleCore ι B F)


@[simp]
theorem one_add_of_omega_le {o} (h : ω ≤ o) : 1 + o = o


@[simp]
theorem map_inf_principal_preimage {f : α → β} {s : Set β} {l : Filter α} :
    map f (l ⊓ 𝓟 (f ⁻¹' s)) = map f l ⊓ 𝓟 s

{α : Type u}
{β : Type v}
{f : α → β}
{s : Set β}
{l : Filter α}

Filter.map f (l ⊓ 𝓟 (f ⁻¹' s)) = Filter.map f l ⊓ 𝓟 s


theorem surjective_algebraMap_iff :
    Function.Surjective (algebraMap R A) ↔ (⊤ : Subalgebra R A) = ⊥

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]

Function.Surjective ⇑(algebraMap R A) ↔ ⊤ = ⊥


protected theorem comp_traverse (f : β → F γ) (g : α → G β) (x : t' α) :
    Equiv.traverse eqv (Comp.mk ∘ Functor.map f ∘ g) x =
      Comp.mk (Equiv.traverse eqv f <$> Equiv.traverse eqv g x)

{t t' : Type u → Type u}
(eqv : (α : Type u) → t α ≃ t' α)
[Traversable t]
[LawfulTraversable t]
{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulApplicative F]
[LawfulApplicative G]
{α β γ : Type u}
(f : β → F γ)
(g : α → G β)
(x : t' α)

Equiv.traverse eqv (Functor.Comp.mk ∘ Functor.map f ∘ g) x =
  Functor.Comp.mk (Equiv.traverse eqv f <$> Equiv.traverse eqv g x)


theorem Fix.mk_dest (x : Fix F α) : Fix.mk (Fix.dest x) = x

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


@[gcongr] theorem min_le_min_right (c) (h : a ≤ b) : min a c ≤ min b c

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


/-- Adding the angles between two vectors in each order results in 0. -/
@[simp]
theorem oangle_add_oangle_rev (x y : V) : o.oangle x y + o.oangle y x = 0

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


@[reassoc (attr := simp)]
lemma Pi.isoLimit_inv_π (j : α) :
    (Pi.isoLimit X).inv ≫ Pi.π _ j = limit.π _ (Discrete.mk j)

[CategoryTheory.Limits.HasProduct fun j => X.obj { as := j }]

(CategoryTheory.Limits.Pi.isoLimit X).inv ≫ CategoryTheory.Limits.Pi.π (fun j => X.obj { as := j }) j =
  CategoryTheory.Limits.limit.π X { as := j }


/-- A `DivisionMonoid` is a `DivInvMonoid` with involutive inversion and such that
`(a * b)⁻¹ = b⁻¹ * a⁻¹` and `a * b = 1 → a⁻¹ = b`.

This is the immediate common ancestor of `Group` and `GroupWithZero`. -/
@[to_additive SubtractionMonoid]
class DivisionMonoid (G : Type u) extends DivInvMonoid G, InvolutiveInv G where
  protected mul_inv_rev (a b : G) : (a * b)⁻¹ = b⁻¹ * a⁻¹
  /-- Despite the asymmetry of `inv_eq_of_mul`, the symmetric version is true thanks to the
  involutivity of inversion. -/
  protected inv_eq_of_mul (a b : G) : a * b = 1 → a⁻¹ = b

{G : Type u}
[self : DivisionMonoid G]
(a b : G)


@[deprecated div_le_div_of_nonneg_right (since := "2024-02-16")]
lemma div_le_div_of_le (hc : 0 ≤ c) (hab : a ≤ b) : a / c ≤ b / c

{α : Type u_2}
[LinearOrderedSemifield α]
{a b c : α}
(hc : 0 ≤ c)
(hab : a ≤ b)


@[to_additive addHaarScalarFactor_eq_integral_div]
lemma haarScalarFactor_eq_integral_div (μ' μ : Measure G) [IsHaarMeasure μ]
    [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ'] {f : G → ℝ} (hf : Continuous f)
    (h'f : HasCompactSupport f) (int_nonzero : ∫ x, f x ∂μ ≠ 0) :
    haarScalarFactor μ' μ = (∫ x, f x ∂μ') / ∫ x, f x ∂μ

↑(μ'.addHaarScalarFactor μ) = (∫ (x : G), f x ∂μ') / ∫ (x : G), f x ∂μ


@[simp] lemma isNilpotent_monomial_iff {n : ℕ} :
    IsNilpotent (monomial (R := R) n r) ↔ IsNilpotent r

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

IsNilpotent ((Polynomial.monomial n) r) ↔ IsNilpotent r


@[to_additive]
theorem prod_le_tprod {f : ι → α} (s : Finset ι) (hs : ∀ i, i ∉ s → 1 ≤ f i) (hf : Multipliable f) :
    ∏ i ∈ s, f i ≤ ∏' i, f i

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
(s : Finset ι)
(hs : ∀ i ∉ s, 0 ≤ f i)
(hf : Summable f)


@[simp]
theorem comp_apply (f : C^n⟮I', M'; I'', M''⟯) (g : C^n⟮I, M; I', M'⟯) (x : M) :
    f.comp g x = f (g x)

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


theorem measurePreserving_finTwoArrow {α : Type u} {m : MeasurableSpace α} (μ : Measure α)
    [SigmaFinite μ] :
    MeasurePreserving MeasurableEquiv.finTwoArrow (Measure.pi fun _ => μ) (μ.prod μ)

{α : Type u}
{m : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]

MeasureTheory.MeasurePreserving (⇑MeasurableEquiv.finTwoArrow) (MeasureTheory.Measure.pi fun x => μ) (μ.prod μ)


/-- When the first map `S.f` is zero, this is the left homology data on `S` given
by any limit kernel fork of `S.g` -/
@[simps]
def ofIsLimitKernelFork (hf : S.f = 0) (c : KernelFork S.g) (hc : IsLimit c) :
    S.LeftHomologyData

(c : CategoryTheory.Limits.KernelFork S.g)

(CategoryTheory.ShortComplex.LeftHomologyData.ofIsLimitKernelFork S hf c hc).H = c.pt


/-- Two filters are equal when their underlying sets are equal. -/
@[ext]
theorem ext (h : (s : Set P) = t) : s = t

{P : Type u_1}
[Preorder P]
(s t : Order.PFilter P)
(h : ↑s = ↑t)


theorem subset_intrinsicClosure : s ⊆ intrinsicClosure 𝕜 s

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_5}
[Ring 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
[TopologicalSpace P]
[AddTorsor V P]
{s : Set P}


@[to_additive]
theorem singleton_mul_ball_one : {x} * ball 1 δ = ball x δ

{E : Type u_1}
[SeminormedCommGroup E]
(δ : ℝ)
(x : E)


lemma pullback.hom_ext {Z : LightProfinite.{u}} (a b : Z ⟶ pullback f g)
    (hfst : a ≫ pullback.fst f g = b ≫ pullback.fst f g)
    (hsnd : a ≫ pullback.snd f g = b ≫ pullback.snd f g) : a = b

(hfst :
  CategoryTheory.CategoryStruct.comp a (LightProfinite.pullback.fst f g) =
    CategoryTheory.CategoryStruct.comp b (LightProfinite.pullback.fst f g))

(hsnd :
  CategoryTheory.CategoryStruct.comp a (LightProfinite.pullback.snd f g) =
    CategoryTheory.CategoryStruct.comp b (LightProfinite.pullback.snd f g))


@[simp]
theorem ofLE_refl {B : C} (X : Subobject B) : ofLE X X le_rfl = 𝟙 _

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

X.ofLE X ⋯ = CategoryTheory.CategoryStruct.id (CategoryTheory.Subobject.underlying.obj X)


@[simp]
theorem inv_app {X Y : Scheme} (f : X ⟶ Y) [IsIso f] (U : X.Opens) :
    (inv f).app U =
      X.presheaf.map (eqToHom (show (f ≫ inv f) ⁻¹ᵁ U = U by rw [IsIso.hom_inv_id]; rfl)).op ≫
        inv (f.app ((inv f) ⁻¹ᵁ U))

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
[CategoryTheory.IsIso f]
(U : X.Opens)

AlgebraicGeometry.Scheme.Hom.app (CategoryTheory.inv f) U =
  X.presheaf.map (CategoryTheory.eqToHom ⋯).op ≫
    CategoryTheory.inv
      (AlgebraicGeometry.Scheme.Hom.app f ((TopologicalSpace.Opens.map (CategoryTheory.inv f).val.base).obj U))


@[to_additive]
protected theorem NeBot.smul : NeBot f → NeBot g → NeBot (f • g)

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f : Filter α}
{g : Filter β}


@[to_additive (attr := simp)]
lemma symm_mk_mul [Mul M] (a b : Mᵈᵐᵃ) : mk.symm (a * b) = mk.symm b * mk.symm a

DomAddAct.mk.symm (a + b) = DomAddAct.mk.symm b + DomAddAct.mk.symm a


/-- Equivalence of nonzero vectors, in terms of `SameRay`. -/
theorem equiv_iff_sameRay {v₁ v₂ : RayVector R M} : v₁ ≈ v₂ ↔ SameRay R (v₁ : M) v₂

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{v₁ v₂ : RayVector R M}


@[reassoc, simp]
theorem whiskerLeft_rightUnitor_inv (X Y : C) :
    X ◁ (ρ_ Y).inv = (ρ_ (X ⊗ Y)).inv ≫ (α_ X Y (𝟙_ C)).hom

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

CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.MonoidalCategory.rightUnitor Y).inv =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.rightUnitor (CategoryTheory.MonoidalCategory.tensorObj X Y)).inv
    (CategoryTheory.MonoidalCategory.associator X Y (𝟙_ C)).hom


/-- Composing two multiplications on the left by `y` then `x`
is equal to a multiplication on the left by `x * y`.
-/
@[to_additive (attr := simp) "Composing two additions on the left by `y` then `x`
is equal to an addition on the left by `x + y`."]
theorem comp_mul_left (x y : α) : (x * ·) ∘ (y * ·) = (x * y * ·)


/-- `zeroLocus` and `vanishingIdeal` form a galois connection. -/
theorem gc_ideal :
    @GaloisConnection (Ideal A) (Set (ProjectiveSpectrum 𝒜))ᵒᵈ _ _
      (fun I => zeroLocus 𝒜 I) fun t => (vanishingIdeal t).toIdeal

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]

GaloisConnection (fun I => ProjectiveSpectrum.zeroLocus 𝒜 ↑I) fun t => (ProjectiveSpectrum.vanishingIdeal t).toIdeal


theorem comap_map_eq_self_of_injective
    {f : R →+* S} (hf : Function.Injective f) (s : Subring R) : (s.map f).comap f = s

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
{f : R →+* S}
(hf : Function.Injective ⇑f)
(s : Subring R)


lemma filter_attach' [DecidableEq α] (s : Finset α) (p : s → Prop) [DecidablePred p] :
    s.attach.filter p =
      (s.filter fun x => ∃ h, p ⟨x, h⟩).attach.map
        ⟨Subtype.map id <| filter_subset _ _, Subtype.map_injective _ injective_id⟩

{α : Type u_1}
[DecidableEq α]
(s : Finset α)
(p : { x // x ∈ s } → Prop)
[DecidablePred p]

Finset.filter p s.attach =
  Finset.map { toFun := Subtype.map id ⋯, inj' := ⋯ } (Finset.filter (fun x => ∃ (h : x ∈ s), p ⟨x, h⟩) s).attach


@[to_additive (attr := simp)]
theorem mul_right_inj (a : G) {b c : G} : a * b = a * c ↔ b = c

{G : Type u_3}
[Add G]
[IsLeftCancelAdd G]
(a : G)
{b c : G}


@[to_additive (attr := simp)]
theorem edist_div_left [PseudoEMetricSpace G] [IsometricSMul G G] [IsometricSMul Gᵐᵒᵖ G]
    (a b c : G) : edist (a / b) (a / c) = edist b c

{G : Type v}
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul G G]
[IsometricSMul Gᵐᵒᵖ G]
(a b c : G)


@[simp] lemma rpow_inv_rpow (hx : 0 ≤ x) (hy : y ≠ 0) : (x ^ y⁻¹) ^ y = x


/-- Two Lie derivations equal on a set are equal on its Lie span. -/
theorem eqOn_lieSpan {s : Set L} (h : Set.EqOn D1 D2 s) :
    Set.EqOn D1 D2 (LieSubalgebra.lieSpan R L s)

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{D1 D2 : LieDerivation R L M}
{s : Set L}
(h : Set.EqOn (⇑D1) (⇑D2) s)

Set.EqOn ⇑D1 ⇑D2 ↑(LieSubalgebra.lieSpan R L s)


lemma weightSpace_neg_zsmul_add_ne_bot {n : ℕ} (hn : n ≤ chainBotCoeff α β) :
    weightSpace M ((-n : ℤ) • α + β : L → R) ≠ ⊥

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
[NoZeroSMulDivisors ℤ R]
[NoZeroSMulDivisors R M]
[IsNoetherian R M]
(α : L → R)
(β : LieModule.Weight R L M)
{n : ℕ}
(hn : n ≤ LieModule.chainBotCoeff α β)

LieModule.weightSpace M (-↑n • α + ⇑β) ≠ ⊥


/-- Given two maps `r : I₁ × I₂ × I₃ → J` and `π : I₁ × I₃ → J`, this structure is the
input in the formulation of the triangle equality `mapBifunctor_triangle` which
relates the left and right unitor and the associator for `GradedObject.mapBifunctor`. -/
structure TriangleIndexData (r : I₁ × I₂ × I₃ → J) (π : I₁ × I₃ → J) where
  /-- a map `I₁ × I₂ → I₁` -/
  p₁₂ : I₁ × I₂ → I₁
  hp₁₂ (i : I₁ × I₂ × I₃) : π ⟨p₁₂ ⟨i.1, i.2.1⟩, i.2.2⟩ = r i
  /-- a map `I₂ × I₃ → I₃` -/
  p₂₃ : I₂ × I₃ → I₃
  hp₂₃ (i : I₁ × I₂ × I₃) : π ⟨i.1, p₂₃ i.2⟩ = r i
  h₁ (i₁ : I₁) : p₁₂ (i₁, 0) = i₁
  h₃ (i₃ : I₃) : p₂₃ (0, i₃) = i₃

(self : CategoryTheory.GradedObject.TriangleIndexData r π)


theorem le_mul_of_le_mul_of_nonneg_left [PosMulMono α] (h : a ≤ b * c) (hle : c ≤ d) (b0 : 0 ≤ b) :
    a ≤ b * d

{α : Type u_1}
{a b c d : α}
[Mul α]
[Zero α]
[Preorder α]
[PosMulMono α]
(h : a ≤ b * c)
(hle : c ≤ d)
(b0 : 0 ≤ b)


@[to_additive (attr := simp) prod_unique]
theorem prod_unique (f : M →ₙ* N × P) : ((fst N P).comp f).prod ((snd N P).comp f) = f

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[Add M]
[Add N]
[Add P]
(f : AddHom M (N × P))

((AddHom.fst N P).comp f).prod ((AddHom.snd N P).comp f) = f


theorem mem_iff_self_mul_star {U : R} : U ∈ unitary R ↔ U * star U = 1

{R : Type u_1}
[CommMonoid R]
[StarMul R]
{U : R}


@[simp]
theorem image_affine_Icc' {a : α} (h : 0 < a) (b c d : α) :
    (a * · + b) '' Icc c d = Icc (a * c + b) (a * d + b)

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

(fun x => a * x + b) '' Set.Icc c d = Set.Icc (a * c + b) (a * d + b)


/-- Construct a cone over a wide cospan. -/
@[simps]
def mkCone {F : WidePullbackShape J ⥤ C} {X : C} (f : X ⟶ F.obj none) (π : ∀ j, X ⟶ F.obj (some j))
    (w : ∀ j, π j ≫ F.map (Hom.term j) = f) : Cone F

{F : CategoryTheory.Limits.WidePullbackShape J ⥤ C}

(w : ∀ (j : J), π j ≫ F.map (CategoryTheory.Limits.WidePullbackShape.Hom.term j) = f)

(j : CategoryTheory.Limits.WidePullbackShape J)

(CategoryTheory.Limits.WidePullbackShape.mkCone f π w).π.app j =
  match j with
  | none => f
  | some j => π j


@[simp]
theorem prod_fst : (p.prod q).fst = (p.fst, q.fst)

{α : Type u_1}
{β : Type u_2}
(p : TwoPointing α)
(q : TwoPointing β)


theorem interpolate_eq_of_values_eq_on (hrr' : ∀ i ∈ s, r i = r' i) :
    interpolate s v r = interpolate s v r'

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
(r r' : ι → F)
(hrr' : ∀ i ∈ s, r i = r' i)

(Lagrange.interpolate s v) r = (Lagrange.interpolate s v) r'


theorem neg (hf : IsBoundedLinearMap 𝕜 f) : IsBoundedLinearMap 𝕜 fun e => -f e

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


@[simp]
theorem zmodEquivZPowers_symm_apply_pow' (i : ℕ) : h.zmodEquivZPowers.symm ⟨ζ ^ i, i, rfl⟩ = i

{R : Type u_4}
{k : ℕ}
[CommRing R]
{ζ : Rˣ}
(h : IsPrimitiveRoot ζ k)
(i : ℕ)


theorem TopologicalSpace.IsTopologicalBasis.exists_closure_subset {B : Set (Set X)}
    (hB : IsTopologicalBasis B) {x : X} {s : Set X} (h : s ∈ 𝓝 x) :
    ∃ t ∈ B, x ∈ t ∧ closure t ⊆ s

(hB : TopologicalSpace.IsTopologicalBasis B)


lemma IsTree.card_edgeFinset [Fintype V] [Fintype G.edgeSet] (hG : G.IsTree) :
    Finset.card G.edgeFinset + 1 = Fintype.card V

{V : Type u}
{G : SimpleGraph V}
[Fintype V]
[Fintype ↑G.edgeSet]
(hG : G.IsTree)


theorem restrict_Ioo_eq_restrict_Ioc : μ.restrict (Ioo a b) = μ.restrict (Ioc a b)

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.NoAtoms μ]
[PartialOrder α]
{a b : α}

μ.restrict (Set.Ioo a b) = μ.restrict (Set.Ioc a b)


@[to_additive]
theorem lcm_orderOf_dvd_exponent [Fintype G] :
    (Finset.univ : Finset G).lcm orderOf ∣ exponent G

Finset.univ.lcm addOrderOf ∣ AddMonoid.exponent G


/-- If `f` is integrable on intervals `Ioc (a i) (b i)`,
where `a i` tends to -∞ and `b i` tends to ∞, and
`∫ x in a i .. b i, ‖f x‖ ∂μ` converges to `I : ℝ` along a filter `l`,
then `f` is integrable on the interval (-∞, ∞) -/
theorem integrable_of_intervalIntegral_norm_tendsto (I : ℝ)
    (hfi : ∀ i, IntegrableOn f (Ioc (a i) (b i)) μ) (ha : Tendsto a l atBot)
    (hb : Tendsto b l atTop) (h : Tendsto (fun i => ∫ x in a i..b i, ‖f x‖ ∂μ) l (𝓝 I)) :
    Integrable f μ

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

(h : Filter.Tendsto (fun i => ∫ (x : ℝ) in a i..b i, ‖f x‖ ∂μ) l (𝓝 I))


theorem e_isoExt_inv : F'.e ≫ (isoExt hF hF').inv = F.e

{F F' : CategoryTheory.Limits.MonoFactorisation f}

(hF' : CategoryTheory.Limits.IsImage F')


@[reassoc]
theorem braiding_leftUnitor (X : C) : (β_ X (𝟙_ C)).hom ≫ (λ_ X).hom = (ρ_ X).hom

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


@[reassoc]
theorem equalizer.lift_ι {W : C} (k : W ⟶ X) (h : k ≫ f = k ≫ g) :
    equalizer.lift k h ≫ equalizer.ι f g = k

(h : CategoryTheory.CategoryStruct.comp k f = CategoryTheory.CategoryStruct.comp k g)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.equalizer.lift k h) (CategoryTheory.Limits.equalizer.ι f g) =
  k


theorem recF_eq' {α : Type _} (g : F α → α) (a : q.P.A) (f : q.P.B a → q.P.W) :
    recF g ⟨a, f⟩ = g (abs (q.P.map (recF g) ⟨a, f⟩))

{F : Type u → Type u}
[q : QPF F]
{α : Type u}
(g : F α → α)
(a : (QPF.P F).A)
(f : (QPF.P F).B a → (QPF.P F).W)

QPF.recF g (WType.mk a f) = g (QPF.abs ((QPF.P F).map (QPF.recF g) ⟨a, f⟩))


/-- Every Schwartz function is differentiable. -/
protected theorem differentiable (f : 𝓢(E, F)) : Differentiable ℝ f

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


/-- The morphism between augmented Čech conerves associated to a morphism of arrows. -/
@[simps]
def mapAugmentedCechConerve {f g : Arrow C}
    [∀ n : ℕ, HasWidePushout f.left (fun _ : Fin (n + 1) => f.right) fun _ => f.hom]
    [∀ n : ℕ, HasWidePushout g.left (fun _ : Fin (n + 1) => g.right) fun _ => g.hom] (F : f ⟶ g) :
    f.augmentedCechConerve ⟶ g.augmentedCechConerve

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePushout f.left (fun x => f.right) fun x => f.hom]

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePushout g.left (fun x => g.right) fun x => g.hom]

(CategoryTheory.Arrow.mapAugmentedCechConerve F).right = CategoryTheory.Arrow.mapCechConerve F


/-- The tautological 1-pre-hypercover induced by `S : J.Cover X`. Its index type `I₀`
is given by `S.Arrow` (i.e. all the morphisms in the sieve `S`), while `I₁` is given
by all possible pullback cones. -/
@[simps]
def preOneHypercover : PreOneHypercover.{max u v} X

{J : CategoryTheory.GrothendieckTopology C}

∀ (x x_1 : S.Arrow) (r : x.Relation x_1), S.preOneHypercover.Y r = r.Z


/-- The tensor product of two isomorphisms is an isomorphism. -/
@[simps]
def tensorIso {C : Type u} {X Y X' Y' : C} [Category.{v} C] [MonoidalCategory.{v} C] (f : X ≅ Y)
    (g : X' ≅ Y') : X ⊗ X' ≅ Y ⊗ Y'

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

(f ⊗ g).hom = CategoryTheory.MonoidalCategory.tensorHom f.hom g.hom


theorem sqrtTwoAddSeries_one : sqrtTwoAddSeries 0 1 = √2


/-- The scalar multiplication of a constant and a `C^n` function at a point is `C^n` at this
point. -/
theorem ContDiffAt.const_smul {f : E → F} {x : E} (c : R) (hf : ContDiffAt 𝕜 n f x) :
    ContDiffAt 𝕜 n (fun y => c • f y) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{R : Type u_3}
[Semiring R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
{f : E → F}
{x : E}
(c : R)
(hf : ContDiffAt 𝕜 n f x)


@[simp]
theorem Matrix.mulVecLin_mul [Fintype m] (M : Matrix l m R) (N : Matrix m n R) :
    Matrix.mulVecLin (M * N) = (Matrix.mulVecLin M).comp (Matrix.mulVecLin N)

{R : Type u_1}
[CommSemiring R]
{l : Type u_3}
{m : Type u_4}
{n : Type u_5}
[Fintype n]
[Fintype m]
(M : Matrix l m R)
(N : Matrix m n R)

(M * N).mulVecLin = M.mulVecLin ∘ₗ N.mulVecLin


@[ext]
theorem ext ⦃f g : α →ₙ+* β⦄ : (∀ x, f x = g x) → f = g

{α : Type u_2}
{β : Type u_3}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
⦃f g : α →ₙ+* β⦄


@[simp]
theorem coeFn_sub (Q Q' : QuadraticMap R M N) : ⇑(Q - Q') = Q - Q'

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(Q Q' : QuadraticMap R M N)


/-- A functor `F : J ⥤ Grp.{u}` has a limit iff `(F ⋙ forget Grp).sections` is
`u`-small.  -/
@[to_additive "A functor `F : J ⥤ AddGrp.{u}` has a limit iff
`(F ⋙ forget AddGrp).sections` is `u`-small."]
lemma hasLimit_iff_small_sections :
    HasLimit F ↔ Small.{u} (F ⋙ forget Grp).sections

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ Grp)

CategoryTheory.Limits.HasLimit F ↔ Small.{u, max u v} ↑(F ⋙ CategoryTheory.forget Grp).sections


@[simp]
theorem pure_eq_some (a : α) : pure a = some a


@[to_additive]
theorem ball_mul_one : ball 1 δ * s = thickening δ s

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

Metric.ball 1 δ * s = Metric.thickening δ s


theorem mul_single_zero_apply [AddZeroClass G] (f : k[G]) (r : k) (x : G) :
    (f * single (0 : G) r) x = f x * r

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[AddZeroClass G]
(f : AddMonoidAlgebra k G)
(r : k)
(x : G)

(f * AddMonoidAlgebra.single 0 r) x = f x * r


theorem pd_inv [Fintype l] [Invertible (2 : R)] : PD l R * ⅟ (2 : R) • (PD l R)ᵀ = 1

(l : Type u_4)
(R : Type u₂)
[DecidableEq l]
[CommRing R]
[Fintype l]
[Invertible 2]

LieAlgebra.Orthogonal.PD l R * ⅟2 • (LieAlgebra.Orthogonal.PD l R).transpose = 1


/-- A set `s` is closed and nowhere dense iff its complement `sᶜ` is open and dense. -/
lemma isClosed_isNowhereDense_iff_compl {s : Set X} :
    IsClosed s ∧ IsNowhereDense s ↔ IsOpen sᶜ ∧ Dense sᶜ

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


lemma quotient_map_mem_quasiIso_iff {K L : HomologicalComplex C c} (f : K ⟶ L) :
    quasiIso C c ((quotient C c).map f) ↔ HomologicalComplex.quasiIso C c f

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{ι : Type u_2}
{c : ComplexShape ι}
[CategoryTheory.Preadditive C]
[CategoryTheory.CategoryWithHomology C]
{K L : HomologicalComplex C c}
(f : K ⟶ L)

HomotopyCategory.quasiIso C c ((HomotopyCategory.quotient C c).map f) ↔ HomologicalComplex.quasiIso C c f


@[simp]
lemma ofHom_lift :
    Cochain.ofHom (lift φ α β eq) = liftCochain φ α β (zero_add 1)

(α : CochainComplex.HomComplex.Cocycle K F 1)

(β : CochainComplex.HomComplex.Cochain K G 0)

(eq : CochainComplex.HomComplex.δ 0 1 β + (↑α).comp (CochainComplex.HomComplex.Cochain.ofHom φ) ⋯ = 0)

CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.lift φ α β eq) =
  CochainComplex.mappingCone.liftCochain φ (↑α) β ⋯


lemma norm_unop [SeminormedAddGroup E] (a : Eᵐᵒᵖ) : ‖MulOpposite.unop a‖ = ‖a‖

{E : Type u_2}
[SeminormedAddGroup E]
(a : Eᵐᵒᵖ)


@[simp]
theorem map_map {M : Matrix m n α} {β γ : Type*} {f : α → β} {g : β → γ} :
    (M.map f).map g = M.map (g ∘ f)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{M : Matrix m n α}
{β : Type u_10}
{γ : Type u_11}
{f : α → β}
{g : β → γ}


@[reassoc]
lemma map_germ_eq_Γgerm (F : X.Presheaf C) {U : Opens X} {i : U ⟶ ⊤} (x : U) :
    F.map i.op ≫ germ F x = Γgerm F (i x)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasColimits C]
{X : TopCat}
(F : TopCat.Presheaf C X)
{U : TopologicalSpace.Opens ↑X}
{i : U ⟶ ⊤}
(x : ↥U)

F.map i.op ≫ F.germ x = F.Γgerm ↑((fun x => ⟨↑x, ⋯⟩) x)


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

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

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


@[reassoc (attr := simp)]
theorem image.factorThruImage_preComp [HasImage g] [HasImage (f ≫ g)] :
    factorThruImage (f ≫ g) ≫ image.preComp f g = f ≫ factorThruImage g

[CategoryTheory.Limits.HasImage (f ≫ g)]

CategoryTheory.Limits.factorThruImage (f ≫ g) ≫ CategoryTheory.Limits.image.preComp f g =
  f ≫ CategoryTheory.Limits.factorThruImage g


@[to_additive]
theorem Homeomorph.mulRight_symm (a : G) :
    (Homeomorph.mulRight a).symm = Homeomorph.mulRight a⁻¹

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[ContinuousAdd G]
(a : G)

(Homeomorph.addRight a).symm = Homeomorph.addRight (-a)


/-- **Cauchy-Goursat theorem** for a rectangle: the integral of a complex differentiable function
over the boundary of a rectangle equals zero. More precisely, if `f` is complex differentiable on a
closed rectangle, then its integral over the boundary of the rectangle equals zero. -/
theorem integral_boundary_rect_eq_zero_of_differentiableOn (f : ℂ → E) (z w : ℂ)
    (H : DifferentiableOn ℂ f ([[z.re, w.re]] ×ℂ [[z.im, w.im]])) :
    (∫ x : ℝ in z.re..w.re, f (x + z.im * I)) - (∫ x : ℝ in z.re..w.re, f (x + w.im * I)) +
      I • (∫ y : ℝ in z.im..w.im, f (re w + y * I)) -
      I • (∫ y : ℝ in z.im..w.im, f (re z + y * I)) = 0

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


/-- If `S / R` and `S' / R'` are algebras, `i : R →+* R'` is a surjective ring homomorphism,
`j : S →+* S'` is an injective ring homomorphism, such that `R → R' → S'` and `R → S → S'` commute,
then the rank of `S / R` is smaller than or equal to the rank of `S' / R'`. -/
theorem lift_rank_le_of_surjective_injective
    (i : R →+* R') (j : S →+* S') (hi : Surjective i) (hj : Injective j)
    (hc : (algebraMap R' S').comp i = j.comp (algebraMap R S)) :
    lift.{v'} (Module.rank R S) ≤ lift.{v} (Module.rank R' S')

Cardinal.lift.{v', v} (Module.rank R S) ≤ Cardinal.lift.{v, v'} (Module.rank R' S')


@[to_additive]
lemma comp_def {X Y Z : Grp} {f : X ⟶ Y} {g : Y ⟶ Z} : f ≫ g = g.comp f

{X Y Z : AddGrp}
{f : X ⟶ Y}
{g : Y ⟶ Z}


@[simp]
lemma norm_circle_smul {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℂ E]
    (u : circle) (v : E) :
    ‖u • v‖ = ‖v‖

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℂ E]
(u : ↥circle)
(v : E)

‖u • v‖ = ‖v‖


@[ext]
lemma ext' (e e' : Trivialization F proj) (h₁ : e.toPartialHomeomorph = e'.toPartialHomeomorph)
    (h₂ : e.baseSet = e'.baseSet) : e = e'


theorem sdiff_compl_neighborFinset_inter_eq {v w : V} (h : G.Adj v w) :
    ((G.neighborFinset v)ᶜ ∩ (G.neighborFinset w)ᶜ) \ ({w} ∪ {v}) =
      (G.neighborFinset v)ᶜ ∩ (G.neighborFinset w)ᶜ

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


theorem padicValNat_factorial_mul_add {n : ℕ} (m : ℕ) [hp : Fact p.Prime] (h : n < p) :
    padicValNat p (p * m + n) ! = padicValNat p (p * m) !

{p n : ℕ}
(m : ℕ)
[hp : Fact (Nat.Prime p)]
(h : n < p)

padicValNat p (p * m + n)! = padicValNat p (p * m)!


@[grind_norm] theorem not_eq_prop (p q : Prop) : (¬(p = q)) = (p = ¬q)


/-- For `n ≠ m`, `(n, m)` is in the transitive closure of a relation `~` if `i ~ pred i` and
  `pred i ~ i` for all `i` between `n` and `m`. -/
theorem transGen_of_pred_of_ne (r : α → α → Prop) {n m : α} (h1 : ∀ i ∈ Ioc m n, r i (pred i))
    (h2 : ∀ i ∈ Ioc n m, r (pred i) i) (hnm : n ≠ m) : TransGen r n m

(h1 : ∀ i ∈ Set.Ioc m n, r i (Order.pred i))

(h2 : ∀ i ∈ Set.Ioc n m, r (Order.pred i) i)


theorem mul_coeff_order_add_order {Γ} [LinearOrderedCancelAddCommMonoid Γ]
    [NonUnitalNonAssocSemiring R] (x y : HahnSeries Γ R) :
    (x * y).coeff (x.order + y.order) = x.leadingCoeff * y.leadingCoeff

{R : Type u_3}
{Γ : Type u_5}
[LinearOrderedCancelAddCommMonoid Γ]
[NonUnitalNonAssocSemiring R]
(x y : HahnSeries Γ R)


@[simp] lemma invert_comp_C : invert ∘ (@C R _) = C

⇑LaurentPolynomial.invert ∘ ⇑LaurentPolynomial.C = ⇑LaurentPolynomial.C


theorem eval₂Hom_bind₁ (f : R →+* S) (g : τ → S) (h : σ → MvPolynomial τ R) (φ : MvPolynomial σ R) :
    eval₂Hom f g (bind₁ h φ) = eval₂Hom f (fun i => eval₂Hom f g (h i)) φ

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_3}
{S : Type u_4}
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
(g : τ → S)
(h : σ → MvPolynomial τ R)
(φ : MvPolynomial σ R)

(MvPolynomial.eval₂Hom f g) ((MvPolynomial.bind₁ h) φ) =
  (MvPolynomial.eval₂Hom f fun i => (MvPolynomial.eval₂Hom f g) (h i)) φ


theorem le_pre : μ ≤ pre m r ↔ ∀ s : Set X, diam s ≤ r → μ s ≤ m s

{X : Type u_2}
[EMetricSpace X]
{m : Set X → ℝ≥0∞}
{r : ℝ≥0∞}
{μ : MeasureTheory.OuterMeasure X}

μ ≤ MeasureTheory.OuterMeasure.mkMetric'.pre m r ↔ ∀ (s : Set X), EMetric.diam s ≤ r → μ s ≤ m s


@[simp] theorem bind_id (l : List (List α)) : List.bind l id = l.join


@[simp]
theorem domRestrict_apply (f : M ↪[L] N) (p : L.Substructure M) (x : p) : f.domRestrict p x = f x

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(f : L.Embedding M N)
(p : L.Substructure M)
(x : ↥p)


/-- `functoriality F _ ⋙ precompose (whiskerLeft F _)` simplifies to `functoriality F _`. -/
@[simps!]
def functorialityCompPrecompose {H H' : C ⥤ D} (α : H ≅ H') :
    Cocones.functoriality F H ⋙ Cocones.precompose (whiskerLeft F α.inv) ≅
      Cocones.functoriality F H'

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
{F : J ⥤ C}
{H H' : C ⥤ D}
(α : H ≅ H')
(X : CategoryTheory.Limits.Cocone F)

((CategoryTheory.Functor.functorialityCompPrecompose α).inv.app X).hom = α.inv.app X.pt


theorem ne_iff_lt_or_gt {a b : α} : a ≠ b ↔ a < b ∨ a > b


protected theorem HasDerivAt.continuousOn {f f' : 𝕜 → F} (hderiv : ∀ x ∈ s, HasDerivAt f (f' x) x) :
    ContinuousOn f s


/-- An arrow of `S.pullback f` gives rise to an arrow of `S`. -/
@[simps]
def Arrow.base {f : Y ⟶ X} {S : J.Cover X} (I : (S.pullback f).Arrow) : S.Arrow

{J : CategoryTheory.GrothendieckTopology C}

I.base.f = CategoryTheory.CategoryStruct.comp I.f f


theorem sups_subset : s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ ⊻ t₁ ⊆ s₂ ⊻ t₂

{α : Type u_2}
[SemilatticeSup α]
{s₁ s₂ t₁ t₂ : Set α}

s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ ⊻ t₁ ⊆ s₂ ⊻ t₂


theorem card_image₂_singleton_right (hf : Injective fun a => f a b) :
    (image₂ f s {b}).card = s.card

{f : α → β → γ}

(hf : Function.Injective fun a => f a b)


lemma decreasingInduction_succ_left  {motive : (m : ℕ) → m ≤ n → Sort*} (of_succ self)
    (smn : m + 1 ≤ n) (mn : m ≤ n) :
    decreasingInduction (motive := motive) of_succ self mn =
      of_succ m smn (decreasingInduction of_succ self smn)

(of_succ : (k : ℕ) → (h : k < n) → motive (k + 1) h → motive k ⋯)

Nat.decreasingInduction of_succ self mn = of_succ m smn (Nat.decreasingInduction of_succ self smn)


/-- If `a : A` is not a unit, then some character takes the value zero at `a`. This is equivalent
to `gelfandTransform ℂ A a` takes the value zero at some character. -/
theorem WeakDual.CharacterSpace.exists_apply_eq_zero {a : A} (ha : ¬IsUnit a) :
    ∃ f : characterSpace ℂ A, f a = 0

{A : Type u_1}
[NormedCommRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
{a : A}
(ha : ¬IsUnit a)


theorem IsLowerSet.ordConnected (h : IsLowerSet s) : s.OrdConnected

{α : Type u_1}
[Preorder α]
{s : Set α}
(h : IsLowerSet s)


theorem find?_cons : (a::as).find? p = match p a with | true => some a | false => as.find? p

∀ {α : Type u_1} {a : α} {as : List α} {p : α → Bool},
  List.find? p (a :: as) =
    match p a with
    | true => some a
    | false => List.find? p as


@[reassoc (attr := simp)]
lemma D₂_D₁ (i₁₂ i₁₂' i₁₂'' : I₁₂) :
    K.D₂ c₁₂ i₁₂ i₁₂' ≫ K.D₁ c₁₂ i₁₂' i₁₂'' = - K.D₁ c₁₂ i₁₂ i₁₂' ≫ K.D₂ c₁₂ i₁₂' i₁₂''

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

K.D₂ c₁₂ i₁₂ i₁₂' ≫ K.D₁ c₁₂ i₁₂' i₁₂'' = -K.D₁ c₁₂ i₁₂ i₁₂' ≫ K.D₂ c₁₂ i₁₂' i₁₂''


/-- `mapCocone` commutes with `precomposeEquivalence`
-/
@[simps!]
def mapCoconePrecomposeEquivalenceFunctor {α : F ≅ G} {c} :
    mapCocone H ((Cocones.precomposeEquivalence α).functor.obj c) ≅
      (Cocones.precomposeEquivalence (isoWhiskerRight α H : _)).functor.obj (mapCocone H c)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(H : C ⥤ D)
{F G : J ⥤ C}
{α : F ≅ G}
{c : CategoryTheory.Limits.Cocone G}

H.mapCoconePrecomposeEquivalenceFunctor.hom.hom = 𝟙 (H.obj c.pt)


@[to_additive (attr := simp)]
theorem pow_right {a x y : M} (h : SemiconjBy a x y) (n : ℕ) : SemiconjBy a (x ^ n) (y ^ n)

{M : Type u_2}
[Monoid M]
{a x y : M}
(h : SemiconjBy a x y)
(n : ℕ)


theorem hasFDerivWithinAt_euclidean :
    HasFDerivWithinAt f f' t y ↔
      ∀ i, HasFDerivWithinAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') t y

{𝕜 : Type u_1}
{ι : Type u_2}
{H : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
[Fintype ι]
{f : H → EuclideanSpace 𝕜 ι}
{f' : H →L[𝕜] EuclideanSpace 𝕜 ι}
{t : Set H}
{y : H}

HasFDerivWithinAt f f' t y ↔ ∀ (i : ι), HasFDerivWithinAt (fun x => f x i) ((EuclideanSpace.proj i).comp f') t y


theorem coe_image_univ (s : Set α) : ((↑) : s → α) '' Set.univ = s


theorem inv_eq_of_lf_zero {x : PGame} (h : x ⧏ 0) : x⁻¹ = -inv' (-x)


lemma Pi.map'_id_id {f : α → C} [HasProduct f] : Pi.map' id (fun a => 𝟙 (f a)) = 𝟙 (∏ᶜ f)

{α : Type w₂}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : α → C}
[CategoryTheory.Limits.HasProduct f]

(CategoryTheory.Limits.Pi.map' id fun a => 𝟙 (f a)) = 𝟙 (∏ᶜ f)


theorem u_ciInf_set (gc : GaloisConnection l u) {s : Set γ} {f : γ → β} (hf : BddBelow (f '' s))
    (hne : s.Nonempty) : u (⨅ i : s, f i) = ⨅ i : s, u (f i)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[ConditionallyCompleteLattice α]
[ConditionallyCompleteLattice β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{s : Set γ}
{f : γ → β}
(hf : BddBelow (f '' s))
(hne : s.Nonempty)


/-- Helper theorem for `Lean.MVarId.liftReflToEq`. -/
private theorem rel_of_eq_and_refl {α : Sort _} {R : α → α → Prop}
    {x y : α} (hxy : x = y) (h : R x x) : R x y

{α : Sort u_1}
{R : α → α → Prop}
{x y : α}
(hxy : x = y)
(h : R x x)


theorem map_preimage_singleton (f : α →ₛ β) (g : β → γ) (c : γ) :
    f.map g ⁻¹' {c} = f ⁻¹' ↑(f.range.filter fun b => g b = c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α β)
(g : β → γ)
(c : γ)

↑(MeasureTheory.SimpleFunc.map g f) ⁻¹' {c} = ↑f ⁻¹' ↑(Finset.filter (fun b => g b = c) f.range)


theorem orthogonal_span_singleton_eq_toLin_ker {B : BilinForm K V} (x : V) :
    B.orthogonal (K ∙ x) = LinearMap.ker (LinearMap.BilinForm.toLinHomAux₁ B x)

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
{B : LinearMap.BilinForm K V}
(x : V)

B.orthogonal (Submodule.span K {x}) = LinearMap.ker (B.toLinHomAux₁ x)


theorem Sigma.univ (X : α → Type*) : (Set.univ : Set (Σa, X a)) = ⋃ a, range (Sigma.mk a)


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


theorem image2_lowerBounds_lowerBounds_subset :
    image2 f (lowerBounds s) (lowerBounds t) ⊆ lowerBounds (image2 f s t)

{f : α → β → γ}

(h₀ : ∀ (b : β), Monotone (Function.swap f b))

Set.image2 f (lowerBounds s) (lowerBounds t) ⊆ lowerBounds (Set.image2 f s t)


@[simp]
theorem ofInt_eq_intCast (n : ℤ) : (ofInt n : ℤ√d) = n


/-- A family of monoid homomorphisms `f a : γ →* β a` defines a monoid homomorphism
`Pi.monoidHom f : γ →* Π a, β a` given by `Pi.monoidHom f x b = f b x`. -/
@[to_additive (attr := simps)
  "A family of additive monoid homomorphisms `f a : γ →+ β a` defines a monoid homomorphism
  `Pi.addMonoidHom f : γ →+ Π a, β a` given by `Pi.addMonoidHom f x b = f b x`."]
def Pi.monoidHom {γ : Type w} [∀ i, MulOneClass (f i)] [MulOneClass γ] (g : ∀ i, γ →* f i) :
    γ →* ∀ i, f i

{I : Type u}
{f : I → Type v}
{γ : Type w}
[(i : I) → AddZeroClass (f i)]
[AddZeroClass γ]
(g : (i : I) → γ →+ f i)
(x : γ)
(i : I)


theorem single_left_inj (h : b ≠ 0) : single a b = single a' b ↔ a = a'

{α : Type u_1}
{M : Type u_5}
[Zero M]
{a a' : α}
{b : M}
(h : b ≠ 0)

Finsupp.single a b = Finsupp.single a' b ↔ a = a'


/-- For every directed family of closed sets whose intersection avoids a compact set,
there exists a single element of the family which itself avoids this compact set. -/
theorem IsCompact.elim_directed_family_closed {ι : Type v} [hι : Nonempty ι] (hs : IsCompact s)
    (t : ι → Set X) (htc : ∀ i, IsClosed (t i)) (hst : (s ∩ ⋂ i, t i) = ∅)
    (hdt : Directed (· ⊇ ·) t) : ∃ i : ι, s ∩ t i = ∅

(hdt : Directed (fun x x_1 => x ⊇ x_1) t)


theorem hadamard_comm [CommSemigroup α] : A ⊙ B = B ⊙ A

{α : Type u_1}
{m : Type u_4}
{n : Type u_5}
(A B : Matrix m n α)
[CommSemigroup α]


@[simp]
theorem map_univ_val_equiv (e : α ≃ β) :
    map e univ.val = univ.val

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(e : α ≃ β)

Multiset.map (⇑e) Finset.univ.val = Finset.univ.val


@[simp]
theorem Matrix.toBilin_toMatrix (B : BilinForm R₂ M₂) :
    Matrix.toBilin b (BilinForm.toMatrix b B) = B

{R₂ : Type u_5}
{M₂ : Type u_6}
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(b : Basis n R₂ M₂)
(B : LinearMap.BilinForm R₂ M₂)

(Matrix.toBilin b) ((BilinForm.toMatrix b) B) = B


/-- The partial application of a constant to a covariant operator is monotone. -/
theorem Covariant.monotone_of_const [CovariantClass M N μ (· ≤ ·)] (m : M) : Monotone (μ m)

[CovariantClass M N μ fun x x_1 => x ≤ x_1]


lemma RightInvOn.prodMap (h₁ : RightInvOn g₁ f₁ t₁) (h₂ : RightInvOn g₂ f₂ t₂) :
    RightInvOn (fun x ↦ (g₁ x.1, g₂ x.2)) (fun x ↦ (f₁ x.1, f₂ x.2)) (t₁ ×ˢ t₂)

{α₁ : Type u_6}
{α₂ : Type u_7}
{β₁ : Type u_8}
{β₂ : Type u_9}
{t₁ : Set β₁}
{t₂ : Set β₂}
{f₁ : α₁ → β₁}
{f₂ : α₂ → β₂}
{g₁ : β₁ → α₁}
{g₂ : β₂ → α₂}
(h₁ : Set.RightInvOn g₁ f₁ t₁)
(h₂ : Set.RightInvOn g₂ f₂ t₂)

Set.RightInvOn (fun x => (g₁ x.1, g₂ x.2)) (fun x => (f₁ x.1, f₂ x.2)) (t₁ ×ˢ t₂)


/-- Construct a left extension of `g : a ⟶ c` from a left extension of `g ≫ 𝟙 c`. -/
@[simps!]
def ofCompId (t : LeftExtension f (g ≫ 𝟙 c)) : LeftExtension f g

(t :
  CategoryTheory.Bicategory.LeftExtension f (CategoryTheory.CategoryStruct.comp g (CategoryTheory.CategoryStruct.id c)))


@[simp]
lemma zeroLocus_empty_eq_univ {U : X.Opens} :
    X.zeroLocus (∅ : Set Γ(X, U)) = Set.univ

(X : AlgebraicGeometry.Scheme)
{U : X.Opens}


theorem map_mem_edgeSet_iff {e : Sym2 V} : e.map f ∈ G'.edgeSet ↔ e ∈ G.edgeSet

{V : Type u_1}
{W : Type u_2}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G ↪g G')
{e : Sym2 V}

Sym2.map (⇑f) e ∈ G'.edgeSet ↔ e ∈ G.edgeSet


lemma isSMulRegular_of_smul_eq_zero_imp_eq_zero
    (h : ∀ x : M, r • x = 0 → x = 0) : IsSMulRegular M r

{R : Type u_1}
{M : Type u_3}
[Ring R]
[AddCommGroup M]
[Module R M]
{r : R}
(h : ∀ (x : M), r • x = 0 → x = 0)


theorem final_iff_comp_final_full_faithful [Final G] [Full G] [Faithful G] :
    Final F ↔ Final (F ⋙ G)

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


theorem conjugatesOfSet_mono {s t : Set G} (h : s ⊆ t) : conjugatesOfSet s ⊆ conjugatesOfSet t

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

Group.conjugatesOfSet s ⊆ Group.conjugatesOfSet t


/-- If an algebra morphism has an inverse, it is an algebra isomorphism. -/
@[simps]
def ofAlgHom (f : A₁ →ₐ[R] A₂) (g : A₂ →ₐ[R] A₁) (h₁ : f.comp g = AlgHom.id R A₂)
    (h₂ : g.comp f = AlgHom.id R A₁) : A₁ ≃ₐ[R] A₂

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(f : A₁ →ₐ[R] A₂)
(g : A₂ →ₐ[R] A₁)
(h₁ : f.comp g = AlgHom.id R A₂)
(h₂ : g.comp f = AlgHom.id R A₁)
(a : A₁)


theorem wellFounded_of_isEmpty {α} [IsEmpty α] (r : α → α → Prop) : WellFounded r

{α : Sort u_4}
[IsEmpty α]
(r : α → α → Prop)


@[to_additive]
theorem smoothWithinAt_finset_prod (h : ∀ i ∈ t, SmoothWithinAt I' I (f i) s x) :
    SmoothWithinAt I' I (fun x => ∏ i ∈ t, f i x) s x


/-- A `Simplex k P n` is a collection of `n + 1` affinely
independent points. -/
structure Simplex (n : ℕ) where
  points : Fin (n + 1) → P
  independent : AffineIndependent k points

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{n : ℕ}
(self : Affine.Simplex k P n)


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

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

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


@[simp]
theorem QuotientAddGroup.equivIocMod_coe (a b : α) :
    QuotientAddGroup.equivIocMod hp a ↑b = ⟨toIocMod hp a b, toIocMod_mem_Ioc hp a _⟩

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

(QuotientAddGroup.equivIocMod hp a) ↑b = ⟨toIocMod hp a b, ⋯⟩


@[simp]
theorem norm_unitary_smul (U : unitary E) (A : E) : ‖U • A‖ = ‖A‖

{E : Type u_2}
[NormedRing E]
[StarRing E]
[CstarRing E]
(U : ↥(unitary E))
(A : E)

‖U • A‖ = ‖A‖


theorem mkPiRing_zero : ContinuousMultilinearMap.mkPiRing R ι (0 : M) = 0

{R : Type u}
{ι : Type v}
{M : Type u_1}
[Fintype ι]
[CommRing R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace R]
[TopologicalSpace M]
[ContinuousMul R]
[ContinuousSMul R M]

ContinuousMultilinearMap.mkPiRing R ι 0 = 0


/-- Converting an augmented cosimplicial object to an augmented simplicial
object and back is isomorphic to the given object. -/
@[simps!]
def CosimplicialObject.Augmented.leftOpRightOpIso (X : CosimplicialObject.Augmented Cᵒᵖ) :
    X.leftOp.rightOp ≅ X

(X : CategoryTheory.CosimplicialObject.Augmented Cᵒᵖ)

∀ (X_1 : SimplexCategory), X.leftOpRightOpIso.hom.right.app X_1 = 𝟙 (X.right.obj X_1)


@[simp] lemma unop_whiskerLeft (X : Cᵒᵖ) {Y Z : Cᵒᵖ} (f : Y ⟶ Z) :
    (X ◁ f).unop =  unop X ◁ f.unop

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

(CategoryTheory.MonoidalCategory.whiskerLeft X f).unop =
  CategoryTheory.MonoidalCategory.whiskerLeft (Opposite.unop X) f.unop


theorem limit.lift_extend {F : J ⥤ C} [HasLimit F] (c : Cone F) {X : C} (f : X ⟶ c.pt) :
    limit.lift F (c.extend f) = f ≫ limit.lift F c

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : J ⥤ C}
[CategoryTheory.Limits.HasLimit F]
(c : CategoryTheory.Limits.Cone F)
{X : C}
(f : X ⟶ c.pt)

CategoryTheory.Limits.limit.lift F (c.extend f) = f ≫ CategoryTheory.Limits.limit.lift F c


@[simp]
theorem preserves_desc_mapCocone (c₁ c₂ : Cocone F) (t : IsColimit c₁) :
    (PreservesColimit.preserves t).desc (G.mapCocone _) = G.map (t.desc c₂)

(c₁ c₂ : CategoryTheory.Limits.Cocone F)

(t : CategoryTheory.Limits.IsColimit c₁)

(CategoryTheory.Limits.PreservesColimit.preserves t).desc (G.mapCocone c₂) = G.map (t.desc c₂)


/-- The union of an indexed, directed, nonempty set of submonoids of a monoid `M` is a submonoid
    of `M`. -/
@[to_additive
      "The union of an indexed, directed, nonempty set of `AddSubmonoid`s of an `AddMonoid` `M`
      is an `AddSubmonoid` of `M`. "]
theorem isSubmonoid_iUnion_of_directed {ι : Type*} [hι : Nonempty ι] {s : ι → Set M}
    (hs : ∀ i, IsSubmonoid (s i)) (Directed : ∀ i j, ∃ k, s i ⊆ s k ∧ s j ⊆ s k) :
    IsSubmonoid (⋃ i, s i)

(Directed : ∀ (i j : ι), ∃ k, s i ⊆ s k ∧ s j ⊆ s k)


theorem isBigO_fst_prod : f' =O[l] fun x => (f' x, g' x)

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{f' : α → E'}
{g' : α → F'}
{l : Filter α}


@[simp] theorem swap_swap (a : Array α) {i j : Fin a.size} :
    (a.swap i j).swap ⟨i.1, (a.size_swap ..).symm ▸i.2⟩ ⟨j.1, (a.size_swap ..).symm ▸j.2⟩ = a

{α : Type u_1}
(a : Array α)
{i j : Fin a.size}


/-- For functions to `ℝ`, it suffices to prove `f x ≤ f y + K * dist x y`; this version
assumes `0≤K`. -/
protected theorem of_le_add_mul {f : α → ℝ} (K : ℝ≥0)
    (h : ∀ x ∈ s, ∀ y ∈ s, f x ≤ f y + K * dist x y) : LipschitzOnWith K f s

(h : ∀ x ∈ s, ∀ y ∈ s, f x ≤ f y + ↑K * dist x y)


@[to_additive (attr := simp)]
lemma div_comp (f g : N →* G) (h : M →* N) : (f / g).comp h = f.comp h / g.comp h

{M : Type u_3}
{N : Type u_4}
{G : Type u_6}
[AddZeroClass M]
[AddZeroClass N]
[AddCommGroup G]
(f g : N →+ G)
(h : M →+ N)


theorem Path.cast_cons {u v w u' w' : U} (p : Path u v) (e : v ⟶ w) (hu : u = u') (hw : w = w') :
    (p.cons e).cast hu hw = (p.cast hu rfl).cons (e.cast rfl hw)

{U : Type u_1}
[Quiver U]
{u v w u' w' : U}
(p : Quiver.Path u v)
(e : v ⟶ w)
(hu : u = u')
(hw : w = w')

Quiver.Path.cast hu hw (p.cons e) = (Quiver.Path.cast hu ⋯ p).cons (Quiver.Hom.cast ⋯ hw e)


@[simp]
theorem accepts_reindex (g : σ ≃ σ') : (reindex g M).accepts = M.accepts

{α : Type u}
{σ : Type v}
(M : DFA α σ)
{σ' : Type u_2}
(g : σ ≃ σ')


theorem countable_iff_exists_subset_range [Nonempty α] {s : Set α} :
    s.Countable ↔ ∃ f : ℕ → α, s ⊆ range f


@[simp]
theorem empty_disjSum : (∅ : Finset α).disjSum t = t.map Embedding.inr

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

∅.disjSum t = Finset.map Function.Embedding.inr t


@[to_additive (attr := simp)]
theorem closure_univ : closure (univ : Set M) = ⊤


@[simp]
theorem nhdsSet_eq_principal_iff : 𝓝ˢ s = 𝓟 s ↔ IsOpen s

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


theorem comp (hg : IsConformalMap g) (hf : IsConformalMap f) : IsConformalMap (g.comp f)

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{G : Type u_4}
[NormedField R]
[SeminormedAddCommGroup M]
[SeminormedAddCommGroup N]
[SeminormedAddCommGroup G]
[NormedSpace R M]
[NormedSpace R N]
[NormedSpace R G]
{f : M →L[R] N}
{g : N →L[R] G}
(hg : IsConformalMap g)
(hf : IsConformalMap f)


@[to_additive boole_nsmul]
lemma pow_boole (P : Prop) [Decidable P] (a : M) :
    (a ^ if P then 1 else 0) = if P then a else 1

{M : Type u_4}
[Monoid M]
(P : Prop)
[Decidable P]
(a : M)


@[to_additive (attr := simp)]
theorem mulLeft_symm [IsometricSMul G G] (x : G) :
    (mulLeft x).symm = IsometryEquiv.mulLeft x⁻¹

{G : Type v}
[AddGroup G]
[PseudoEMetricSpace G]
[IsometricVAdd G G]
(x : G)

(IsometryEquiv.addLeft x).symm = IsometryEquiv.addLeft (-x)


@[to_additive (attr := simp)]
theorem mulSupport_eq_empty_iff {f : α → M} : mulSupport f = ∅ ↔ f = 1

{α : Type u_1}
{M : Type u_5}
[Zero M]
{f : α → M}


lemma one_lt_pow (hn : n ≠ 0) (ha : 1 < a) : 1 < a ^ n


theorem formPerm_apply_head (x y : α) (xs : List α) (h : Nodup (x :: y :: xs)) :
    formPerm (x :: y :: xs) x = y

{α : Type u_1}
[DecidableEq α]
(x y : α)
(xs : List α)
(h : (x :: y :: xs).Nodup)


lemma _root_.Set.rightInvOn_id (s : Set α) : RightInvOn id id s


theorem HasBasis.to_image_id {ι : Type*} {p : ι → Prop} {s : ι → Set α} (h : l.HasBasis p s) :
    l.HasBasis (· ∈ s '' {i | p i}) id

{α : Type u_1}
{l : Filter α}
{ι : Type u_6}
{p : ι → Prop}
{s : ι → Set α}
(h : l.HasBasis p s)

l.HasBasis (fun x => x ∈ s '' {i | p i}) id


/-- A circular partial order is the analogue of a partial order where you can loop around. `≤` and
`<` are replaced by ternary relations `btw` and `sbtw`. `btw` is reflexive, cyclic and
antisymmetric. `sbtw` is transitive. -/
class CircularPartialOrder (α : Type*) extends CircularPreorder α where
  /-- If `b` is between `a` and `c` and also between `c` and `a`, then at least one pair of points
  among `a`, `b`, `c` are identical. -/
  btw_antisymm {a b c : α} : btw a b c → btw c b a → a = b ∨ b = c ∨ c = a

{α : Type u_1}
[self : CircularPartialOrder α]
{a b c : α}


@[simp] theorem natCast_eq_ofNat (w x : Nat) : @Nat.cast (BitVec w) _ x = .ofNat w x


theorem rescale_zero_apply : rescale 0 X = C R (constantCoeff R X)

(PowerSeries.rescale 0) PowerSeries.X = (PowerSeries.C R) ((PowerSeries.constantCoeff R) PowerSeries.X)


theorem think_empty : empty α = think (empty α)

Computation.empty α = (Computation.empty α).think


/-- An element of a DVR is irreducible iff it is a uniformizer, that is, generates the
  maximal ideal of `R`. -/
theorem irreducible_iff_uniformizer (ϖ : R) : Irreducible ϖ ↔ maximalIdeal R = Ideal.span {ϖ}

{R : Type u}
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]
(ϖ : R)

Irreducible ϖ ↔ LocalRing.maximalIdeal R = Ideal.span {ϖ}


theorem tendsto_finset_prod_of_ne_top {ι : Type*} {f : ι → α → ℝ≥0∞} {x : Filter α} {a : ι → ℝ≥0∞}
    (s : Finset ι) (h : ∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) (h' : ∀ i ∈ s, a i ≠ ∞) :
    Tendsto (fun b => ∏ c ∈ s, f c b) x (𝓝 (∏ c ∈ s, a c))

{f : ι → α → ℝ≥0∞}

{a : ι → ℝ≥0∞}

(h : ∀ i ∈ s, Filter.Tendsto (f i) x (𝓝 (a i)))

Filter.Tendsto (fun b => ∏ c ∈ s, f c b) x (𝓝 (∏ c ∈ s, a c))


@[to_additive]
theorem isClosedMap_div_left (a : G) : IsClosedMap (a / ·)

{G : Type w}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
(a : G)


theorem left_unique_forall₂' (hr : LeftUnique R) : ∀ {a b c}, Forall₂ R a c → Forall₂ R b c → a = b

{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
(hr : Relator.LeftUnique R)
{a b : List α}
{c : List β}

List.Forall₂ R a c → List.Forall₂ R b c → a = b


@[simp] theorem isClosed_discrete (s : Set α) : IsClosed s

{α : Type u_1}
[TopologicalSpace α]
[DiscreteTopology α]
(s : Set α)


theorem empty_mem_measurableCylinders (α : ι → Type*) [∀ i, MeasurableSpace (α i)] :
    ∅ ∈ measurableCylinders α

{ι : Type u_2}
(α : ι → Type u_1)
[(i : ι) → MeasurableSpace (α i)]


lemma ofENat_strictMono : StrictMono ofENat


/-- A topological space is called a *Fréchet-Urysohn space*, if the sequential closure of any set
is equal to its closure. Since one of the inclusions is trivial, we require only the non-trivial one
in the definition. -/
class FrechetUrysohnSpace : Prop where
  closure_subset_seqClosure : ∀ s : Set X, closure s ⊆ seqClosure s

{X : Type u_1}
[TopologicalSpace X]
[self : FrechetUrysohnSpace X]
(s : Set X)


lemma SMulPosReflectLT.toSMulPosReflectLE [SMulPosReflectLT α β] : SMulPosReflectLE α β

{α : Type u_1}
{β : Type u_2}
[Ring α]
[AddCommGroup β]
[Module α β]
[NoZeroSMulDivisors α β]
[PartialOrder α]
[PartialOrder β]
[SMulPosReflectLT α β]


lemma Algebra.map_intTraceAux [IsIntegrallyClosed A] (x : B) :
    algebraMap A K (Algebra.intTraceAux A K L B x) = Algebra.trace K L (algebraMap B L x)

{A : Type u_1}
{K : Type u_2}
{L : Type u_3}
{B : Type u_4}
[CommRing A]
[CommRing B]
[Algebra A B]
[Field K]
[Field L]
[Algebra A K]
[IsFractionRing A K]
[Algebra B L]
[Algebra K L]
[Algebra A L]
[IsScalarTower A B L]
[IsScalarTower A K L]
[IsIntegralClosure B A L]
[FiniteDimensional K L]
[IsIntegrallyClosed A]
(x : B)

(algebraMap A K) ((Algebra.intTraceAux A K L B) x) = (Algebra.trace K L) ((algebraMap B L) x)


theorem realize_iff_of_model_completeTheory [N ⊨ L.completeTheory M] (φ : L.Sentence) :
    N ⊨ φ ↔ M ⊨ φ

{L : FirstOrder.Language}
(M : Type w)
(N : Type u_1)
[L.Structure M]
[L.Structure N]
[N ⊨ L.completeTheory M]
(φ : L.Sentence)

N ⊨ φ ↔ M ⊨ φ


@[simp]
theorem smeval_X :
    (X : R[X]).smeval x = x ^ 1

(R : Type u_1)
[Semiring R]
{S : Type u_2}
[AddCommMonoid S]
[Pow S ℕ]
[MulActionWithZero R S]
(x : S)


@[simp]
theorem min_lt_iff : min a b < c ↔ a < c ∨ b < c

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


protected theorem isPreorder : ∀ (_ : r ↪r s) [IsPreorder β s], IsPreorder α r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}

r ↪r s → ∀ [inst : IsPreorder β s], IsPreorder α r


theorem Finset.coe_einfsep [DecidableEq α] {s : Finset α} :
    (s : Set α).einfsep = s.offDiag.inf (uncurry edist)

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

(↑s).einfsep = s.offDiag.inf (Function.uncurry edist)


theorem type_lift_preimage {α : Type u} {β : Type v} (r : α → α → Prop) [IsWellOrder α r]
    (f : β ≃ α) : lift.{u} (type (f ⁻¹'o r)) = lift.{v} (type r)

Ordinal.lift.{u, v} (Ordinal.type (⇑f ⁻¹'o r)) = Ordinal.lift.{v, u} (Ordinal.type r)


@[simp]
theorem Orthonormal.equiv_toLinearEquiv {v : Basis ι 𝕜 E} (hv : Orthonormal 𝕜 v)
    {v' : Basis ι' 𝕜 E'} (hv' : Orthonormal 𝕜 v') (e : ι ≃ ι') :
    (hv.equiv hv' e).toLinearEquiv = v.equiv v' e

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{ι' : Type u_5}
{E' : Type u_7}
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
{v : Basis ι 𝕜 E}
(hv : Orthonormal 𝕜 ⇑v)
{v' : Basis ι' 𝕜 E'}
(hv' : Orthonormal 𝕜 ⇑v')
(e : ι ≃ ι')


@[simp]
theorem toRingEquiv_eq_coe (e : A ≃⋆+* B) : e.toRingEquiv = e

{A : Type u_1}
{B : Type u_2}
[Add A]
[Add B]
[Mul A]
[Mul B]
[Star A]
[Star B]
(e : A ≃⋆+* B)


@[simp] lemma _root_.nsmul_eq_mul (n : ℕ) (a : α) : n • a = n * a

{α : Type u_1}
[NonAssocSemiring α]
(n : ℕ)
(a : α)


theorem le_union_right (s t : Multiset α) : t ≤ s ∪ t

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


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


@[simp]
theorem support_swap {x y : α} (h : x ≠ y) : support (swap x y) = {x, y}

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{x y : α}
(h : x ≠ y)


theorem antidiagonalTuple_zero_right (k : ℕ) : antidiagonalTuple k 0 = {0}


theorem isInt_rpow_pos {a b : ℝ} {nb ne : ℕ}
    (pb : IsNat b nb) (pe' : IsInt (a ^ nb) (Int.negOfNat ne)) :
    IsInt (a ^ b) (Int.negOfNat ne)

(pe' : Mathlib.Meta.NormNum.IsInt (a ^ nb) (Int.negOfNat ne))

Mathlib.Meta.NormNum.IsInt (a ^ b) (Int.negOfNat ne)


@[simp, nolint simpNF]
theorem tendsto_comp_coe_Iio_atTop :
    Tendsto (fun x : Iio a => f x) atTop l ↔ Tendsto f (𝓝[<] a) l

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a : α}
{l : Filter β}
{f : α → β}

Filter.Tendsto (fun x => f ↑x) Filter.atTop l ↔ Filter.Tendsto f (𝓝[<] a) l


@[simp]
theorem aleph0_add_aleph0 : ℵ₀ + ℵ₀ = ℵ₀

Cardinal.aleph0 + Cardinal.aleph0 = Cardinal.aleph0


@[to_additive]
theorem Equiv.tprod_eq_tprod_of_mulSupport {f : β → α} {g : γ → α}
    (e : mulSupport f ≃ mulSupport g) (he : ∀ x, g (e x) = f x) :
    ∏' x, f x = ∏' y, g y

(e : ↑(Function.support f) ≃ ↑(Function.support g))

(he : ∀ (x : ↑(Function.support f)), g ↑(e x) = f ↑x)


theorem mem_prod {s : Subsemiring R} {t : Subsemiring S} {p : R × S} :
    p ∈ s.prod t ↔ p.1 ∈ s ∧ p.2 ∈ t

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
{s : Subsemiring R}
{t : Subsemiring S}
{p : R × S}


theorem epi_from_simple_zero_of_not_iso {X Y : C} [Simple X] {f : X ⟶ Y} [Epi f]
    (w : IsIso f → False) : f = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{X Y : C}
[CategoryTheory.Simple X]
{f : X ⟶ Y}
[CategoryTheory.Epi f]
(w : CategoryTheory.IsIso f → False)


theorem compProdFun_empty (κ : Kernel α β) (η : Kernel (α × β) γ) (a : α) :
    compProdFun κ η a ∅ = 0

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


theorem Integrable.hasFiniteIntegral {f : α → β} (hf : Integrable f μ) : HasFiniteIntegral f μ

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


theorem coe_convex (s : AbsConvexOpenSets 𝕜 E) : Convex ℝ (s : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[TopologicalSpace E]
[AddCommMonoid E]
[Zero E]
[SeminormedRing 𝕜]
[SMul 𝕜 E]
[SMul ℝ E]
(s : AbsConvexOpenSets 𝕜 E)


@[simp]
theorem untrop_one [Zero R] : untrop (1 : Tropical R) = 0


/-- Auxiliary definition for `mapTrifunctor`. -/
@[simps]
def mapTrifunctorObj {I₁ : Type*} (X₁ : GradedObject I₁ C₁) (I₂ I₃ : Type*) :
    GradedObject I₂ C₂ ⥤ GradedObject I₃ C₃ ⥤ GradedObject (I₁ × I₂ × I₃) C₄

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

(X₁ : CategoryTheory.GradedObject I₁ C₁)

(X₂ : CategoryTheory.GradedObject I₂ C₂)

(X₃ : CategoryTheory.GradedObject I₃ C₃)

((CategoryTheory.GradedObject.mapTrifunctorObj F X₁ I₂ I₃).obj X₂).obj X₃ x =
  ((F.obj (X₁ x.1)).obj (X₂ x.2.1)).obj (X₃ x.2.2)


@[simp]
theorem restrict_iSup {ι} (s : Set α) (m : ι → OuterMeasure α) :
    restrict s (⨆ i, m i) = ⨆ i, restrict s (m i)

{α : Type u_1}
{ι : Sort u_3}
(s : Set α)
(m : ι → MeasureTheory.OuterMeasure α)

(MeasureTheory.OuterMeasure.restrict s) (⨆ i, m i) = ⨆ i, (MeasureTheory.OuterMeasure.restrict s) (m i)


@[simp]
theorem Cone.ofFork_π {F : WalkingParallelPair ⥤ C} (t : Fork (F.map left) (F.map right)) (j) :
    (Cone.ofFork t).π.app j = t.π.app j ≫ eqToHom (by aesop)

{F : CategoryTheory.Functor CategoryTheory.Limits.WalkingParallelPair C}

(t :
  CategoryTheory.Limits.Fork (F.map CategoryTheory.Limits.WalkingParallelPairHom.left)
    (F.map CategoryTheory.Limits.WalkingParallelPairHom.right))

(CategoryTheory.Limits.Cone.ofFork t).π.app j =
  CategoryTheory.CategoryStruct.comp (t.π.app j) (CategoryTheory.eqToHom ⋯)


lemma IsCycle.ne_bot : ∀ {p : G.Walk u u}, p.IsCycle → G ≠ ⊥

{V : Type u}
{G : SimpleGraph V}
{u : V}
{p : G.Walk u u}


/-- If the measure `μ.trim hm` is sigma-finite, then the conditional expectation of a measurable set
with finite measure is integrable. -/
theorem integrable_condexpL2_indicator (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
    (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : E') :
    Integrable (β := E') (condexpL2 E' 𝕜 hm (indicatorConstLp 2 hs hμs x)) μ

{α : Type u_1}
{E' : Type u_3}
{𝕜 : Type u_7}
[RCLike 𝕜]
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
[CompleteSpace E']
[NormedSpace ℝ E']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hm : m ≤ m0)
[MeasureTheory.SigmaFinite (μ.trim hm)]
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(x : E')

MeasureTheory.Integrable (↑↑↑((MeasureTheory.condexpL2 E' 𝕜 hm) (MeasureTheory.indicatorConstLp 2 hs hμs x))) μ


lemma measurable_densityToFinite (μ : Measure α) [SFinite μ] : Measurable μ.densityToFinite

{α : Type u_1}
{mα : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SFinite μ]


protected theorem tsub_lt_iff_left (hb : AddLECancellable b) (hba : b ≤ a) :
    a - b < c ↔ a < b + c

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


theorem and_false_iff : p ∧ False ↔ False


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


/-- For presheaves valued in a concrete category, whose forgetful functor reflects isomorphisms and
preserves limits, the sheaf condition in terms of unique gluings is equivalent to the usual one.
-/
theorem isSheaf_iff_isSheafUniqueGluing : F.IsSheaf ↔ F.IsSheafUniqueGluing


/-- The map `v ↦ v +ᵥ b` as an affine equivalence between a module `V` and an affine space `P` with
tangent space `V`. -/
@[simps! linear apply symm_apply]
def vaddConst (b : P₁) : V₁ ≃ᵃ[k] P₁

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


@[reassoc]
theorem associator_naturality_left {X X' : C} (f : X ⟶ X') (Y Z : C) :
    f ▷ Y ▷ Z ≫ (α_ X' Y Z).hom = (α_ X Y Z).hom ≫ f ▷ (Y ⊗ Z)

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

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.whiskerRight f Y) Z)
    (CategoryTheory.MonoidalCategory.associator X' Y Z).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).hom
    (CategoryTheory.MonoidalCategory.whiskerRight f (CategoryTheory.MonoidalCategory.tensorObj Y Z))


@[simp]
theorem cosh_le_cosh : cosh x ≤ cosh y ↔ |x| ≤ |y|


theorem StrictConvex.smul_mem_of_zero_mem (hs : StrictConvex 𝕜 s) (zero_mem : (0 : E) ∈ s)
    (hx : x ∈ s) (hx₀ : x ≠ 0) {t : 𝕜} (ht₀ : 0 < t) (ht₁ : t < 1) : t • x ∈ interior s

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedRing 𝕜]
[TopologicalSpace E]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
{x : E}
(hs : StrictConvex 𝕜 s)
(zero_mem : 0 ∈ s)
(hx : x ∈ s)
(hx₀ : x ≠ 0)
{t : 𝕜}
(ht₀ : 0 < t)
(ht₁ : t < 1)


theorem continuous_sub_right (a : ℝ≥0∞) : Continuous fun x : ℝ≥0∞ => x - a


/-- The higher derived functors vanish on projective objects. -/
lemma Functor.isZero_leftDerived_obj_projective_succ
    (F : C ⥤ D) [F.Additive] (n : ℕ) (X : C) [Projective X] :
    IsZero ((F.leftDerived (n + 1)).obj X)

CategoryTheory.Limits.IsZero ((F.leftDerived (n + 1)).obj X)


/-- Let `f : β → α` be a multipliable function and let `b ∈ β` be an index.
Lemma `tprod_eq_mul_tprod_ite` writes `∏ n, f n` as `f b` times the product of the
remaining terms. -/
@[to_additive "Let `f : β → α` be a summable function and let `b ∈ β` be an index.
Lemma `tsum_eq_add_tsum_ite` writes `Σ' n, f n` as `f b` plus the sum of the
remaining terms."]
theorem tprod_eq_mul_tprod_ite [DecidableEq β] (hf : Multipliable f) (b : β) :
    ∏' n, f n = f b * ∏' n, ite (n = b) 1 (f n)

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
{f : β → α}
[T2Space α]
[DecidableEq β]
(hf : Summable f)
(b : β)

∑' (n : β), f n = f b + ∑' (n : β), if n = b then 0 else f n


/-- Swap the `ᵐᵒᵖ` on an algebra isomorphism to the opposite side. -/
@[simps!]
def opComm : (A ≃ₐ[R] Bᵐᵒᵖ) ≃ (Aᵐᵒᵖ ≃ₐ[R] B)

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]

∀ (a : Aᵐᵒᵖ ≃ₐ[R] B) (a_1 : Bᵐᵒᵖ),
  (AlgEquiv.opComm.symm a).symm a_1 =
    MulOpposite.unop ((↑↑(AlgEquiv.refl.trans (a.trans (AlgEquiv.opOp R B)))).symm (MulOpposite.op a_1))


protected theorem multiset_prod_mem {R : Type u} {A : Type v} [CommSemiring R] [CommSemiring A]
    [Algebra R A] (S : Subalgebra R A) {m : Multiset A} (h : ∀ x ∈ m, x ∈ S) : m.prod ∈ S


theorem piPremeasure_pi_mono {s t : Set (∀ i, α i)} (h : s ⊆ t) :
    piPremeasure m s ≤ piPremeasure m t

{m : (i : ι) → MeasureTheory.OuterMeasure (α i)}

MeasureTheory.piPremeasure m s ≤ MeasureTheory.piPremeasure m t


theorem universally_eq_iff {P : MorphismProperty C} :
    P.universally = P ↔ P.StableUnderBaseChange

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


theorem mem_smul_pointwise_iff_exists (m : G) (a : α) (S : Subgroup G) :
    m ∈ a • S ↔ ∃ s : G, s ∈ S ∧ a • s = m

{α : Type u_1}
{G : Type u_2}
[Group G]
[Monoid α]
[MulDistribMulAction α G]
(m : G)
(a : α)
(S : Subgroup G)


@[simp]
theorem disjoint_top : Disjoint a ⊤ ↔ a = ⊥

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


@[to_additive]
private theorem card_pow_eq_one_eq_orderOf_aux (a : α) :
    (Finset.univ.filter fun b : α => b ^ orderOf a = 1).card = orderOf a

(hn : ∀ (n : ℕ), 0 < n → (Finset.filter (fun a => a ^ n = 1) Finset.univ).card ≤ n)

(Finset.filter (fun b => b ^ orderOf a = 1) Finset.univ).card = orderOf a


@[to_additive]
theorem image_mulSingle_Ico (i : ι) (a b : α i) :
    Pi.mulSingle i '' Ico a b = Ico (Pi.mulSingle i a) (Pi.mulSingle i b)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → Zero (α i)]
(i : ι)
(a b : α i)

Pi.single i '' Set.Ico a b = Set.Ico (Pi.single i a) (Pi.single i b)


theorem natAbs_num_coe : (q : ℚ).num.natAbs = q.num


protected theorem HasFPowerSeriesAt.hasDerivAt (h : HasFPowerSeriesAt f p x) :
    HasDerivAt f (p 1 fun _ => 1) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : FormalMultilinearSeries 𝕜 𝕜 F}
{f : 𝕜 → F}
{x : 𝕜}
(h : HasFPowerSeriesAt f p x)


theorem integral_target_eq_integral_abs_det_fderiv_smul {f : PartialHomeomorph E E}
    (hf' : ∀ x ∈ f.source, HasFDerivAt f (f' x) x) (g : E → F) :
    ∫ x in f.target, g x ∂μ = ∫ x in f.source, |(f' x).det| • g (f x) ∂μ

(hf' : ∀ x ∈ f.source, HasFDerivAt (↑f) (f' x) x)

∫ (x : E) in f.target, g x ∂μ = ∫ (x : E) in f.source, |(f' x).det| • g (↑f x) ∂μ


theorem cycleRange_of_gt {n : ℕ} {i j : Fin n.succ} (h : i < j) : cycleRange i j = j


theorem add_ne_bot : a + b ≠ ⊥ ↔ a ≠ ⊥ ∧ b ≠ ⊥

a + b ≠ ⊥ ↔ a ≠ ⊥ ∧ b ≠ ⊥


@[simp]
theorem isNilpotent_iff_eq_zero [MonoidWithZero R] [IsReduced R] : IsNilpotent x ↔ x = 0

{R : Type u_1}
{x : R}
[MonoidWithZero R]
[IsReduced R]


@[to_additive]
theorem MulHom.comp_apply [Mul M] [Mul N] [Mul P] (g : N →ₙ* P) (f : M →ₙ* N) (x : M) :
    g.comp f x = g (f x)

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[Mul M]
[Mul N]
[Mul P]
(g : N →ₙ* P)
(f : M →ₙ* N)
(x : M)


@[to_additive (attr := simp)] theorem snd_comp_inr : (snd : M ∗ N →* N).comp inr = .id _

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

Monoid.Coprod.snd.comp Monoid.Coprod.inr = MonoidHom.id N


@[simp]
theorem toSet_union (x y : ZFSet.{u}) : (x ∪ y).toSet = x.toSet ∪ y.toSet


theorem Coloring.even_length_iff_congr {α} {G : SimpleGraph α}
    (c : G.Coloring Bool) {u v : α} (p : G.Walk u v) :
    Even p.length ↔ (c u ↔ c v)

{α : Type u_1}
{G : SimpleGraph α}
(c : G.Coloring Bool)
{u v : α}
(p : G.Walk u v)

Even p.length ↔ (c u = true ↔ c v = true)


/-- The Čech conerve associated to an arrow. -/
@[simps]
def cechConerve : CosimplicialObject C

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePushout f.left (fun x => f.right) fun x => f.hom]

f.cechConerve.obj n = CategoryTheory.Limits.widePushout f.left (fun x => f.right) fun x => f.hom


/-- The forgetful braided functor from a full braided subcategory into the original category
("forgetting" the condition).
-/
@[simps!]
def fullBraidedSubcategoryInclusion : BraidedFunctor (FullSubcategory P) C

(CategoryTheory.MonoidalCategory.fullBraidedSubcategoryInclusion P).ε = CategoryTheory.CategoryStruct.id (𝟙_ C)


@[simp]
theorem mk_toAddMonoidHom (f) (h₁) (h₂) :
    (⟨f, h₁, h₂⟩ : NormedAddGroupHom V₁ V₂).toAddMonoidHom = AddMonoidHom.mk' f h₁

(h₁ : ∀ (v₁ v₂ : V₁), f (v₁ + v₂) = f v₁ + f v₂)

{ toFun := f, map_add' := h₁, bound' := h₂ }.toAddMonoidHom = AddMonoidHom.mk' f h₁


@[simp]
theorem le_zero_of_isEmpty_leftMoves (x : PGame) [IsEmpty x.LeftMoves] : x ≤ 0

(x : SetTheory.PGame)
[IsEmpty x.LeftMoves]


@[to_additive]
theorem prod_ofFn [CommMonoid β] {n : ℕ} (f : Fin n → β) : (List.ofFn f).prod = ∏ i, f i

{β : Type u_2}
[CommMonoid β]
{n : ℕ}
(f : Fin n → β)


/-- Bounding the norm of the iterated derivative of `B (f x) (g x)` in terms of the
iterated derivatives of `f` and `g` when `B` is bilinear:
`‖D^n (x ↦ B (f x) (g x))‖ ≤ ‖B‖ ∑_{k ≤ n} n.choose k ‖D^k f‖ ‖D^{n-k} g‖` -/
theorem ContinuousLinearMap.norm_iteratedFDeriv_le_of_bilinear (B : E →L[𝕜] F →L[𝕜] G) {f : D → E}
    {g : D → F} {N : ℕ∞} (hf : ContDiff 𝕜 N f) (hg : ContDiff 𝕜 N g) (x : D) {n : ℕ}
    (hn : (n : ℕ∞) ≤ N) :
    ‖iteratedFDeriv 𝕜 n (fun y => B (f y) (g y)) x‖ ≤ ‖B‖ * ∑ i ∈ Finset.range (n + 1),
      (n.choose i : ℝ) * ‖iteratedFDeriv 𝕜 i f x‖ * ‖iteratedFDeriv 𝕜 (n - i) g x‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{D : Type uD}
[NormedAddCommGroup D]
[NormedSpace 𝕜 D]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(B : E →L[𝕜] F →L[𝕜] G)
{f : D → E}
{g : D → F}
{N : ℕ∞}
(hf : ContDiff 𝕜 N f)
(hg : ContDiff 𝕜 N g)
(x : D)
{n : ℕ}
(hn : ↑n ≤ N)

‖iteratedFDeriv 𝕜 n (fun y => (B (f y)) (g y)) x‖ ≤
  ‖B‖ * ∑ i ∈ Finset.range (n + 1), ↑(n.choose i) * ‖iteratedFDeriv 𝕜 i f x‖ * ‖iteratedFDeriv 𝕜 (n - i) g x‖


@[simp]
theorem nhds_eq_nhds_iff [T0Space X] {a b : X} : 𝓝 a = 𝓝 b ↔ a = b

{X : Type u_1}
[TopologicalSpace X]
[T0Space X]
{a b : X}


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

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

⇑(f.toOpposite hf) = MulOpposite.op ∘ ⇑f


@[simp]
theorem preimageIso_mapIso (f : X ≅ Y) : F.preimageIso (F.mapIso f) = f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
{X Y : C}
[F.Full]
[F.Faithful]
(f : X ≅ Y)


/-- The Lebesgue measure associated to an alternating map. It gives measure `|ω v|` to the
parallelepiped spanned by the vectors `v₁, ..., vₙ`. Note that it is not always a Haar measure,
as it can be zero, but it is always locally finite and translation invariant. -/
noncomputable irreducible_def _root_.AlternatingMap.measure (ω : G [⋀^Fin n]→ₗ[ℝ] ℝ) :
    Measure G

[_i : Fact (FiniteDimensional.finrank ℝ G = n)]

ω.measure = ‖ω ⇑(FiniteDimensional.finBasisOfFinrankEq ℝ G ⋯)‖₊ • (FiniteDimensional.finBasisOfFinrankEq ℝ G ⋯).addHaar


lemma Derives.eq_or_tail {u w : List (Symbol T g.NT)} (huw : g.Derives u w) :
    u = w ∨ ∃ v : List (Symbol T g.NT), g.Derives u v ∧ g.Produces v w

{T : Type uT}
{g : ContextFreeGrammar T}
{u w : List (Symbol T g.NT)}
(huw : g.Derives u w)

u = w ∨ ∃ v, g.Derives u v ∧ g.Produces v w


@[to_additive]
protected lemma mul_one_div_cancel (h : IsUnit a) : a * (1 / a) = 1

{α : Type u}
[DivisionMonoid α]
{a : α}
(h : IsUnit a)


theorem add_pow_char_pow_of_commute [Semiring R] {p n : ℕ} [hp : Fact p.Prime] [CharP R p]
    (x y : R) (h : Commute x y) : (x + y) ^ p ^ n = x ^ p ^ n + y ^ p ^ n

(R : Type u_1)
[Semiring R]
{p n : ℕ}
[hp : Fact (Nat.Prime p)]
[CharP R p]
(x y : R)
(h : Commute x y)


/--
Monoid objects in `C` are "just" lax monoidal functors from the trivial monoidal category to `C`.
-/
@[simps]
def equivLaxMonoidalFunctorPUnit : LaxMonoidalFunctor (Discrete PUnit.{u + 1}) C ≌ Mon_ C

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

(Mon_.equivLaxMonoidalFunctorPUnit C).unitIso = Mon_.EquivLaxMonoidalFunctorPUnit.unitIso C


@[simp]
lemma leadingCoeff_preΨ {n : ℤ} (h : (n : R) ≠ 0) :
    (W.preΨ n).leadingCoeff = if Even n then n / 2 else n

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{n : ℤ}
(h : ↑n ≠ 0)

(W.preΨ n).leadingCoeff = ↑(if Even n then n / 2 else n)


protected theorem ediv_mul_le (a : Int) {b : Int} (H : b ≠ 0) : a / b * b ≤ a


theorem comap_comp (f : M →ₛₗ[σ₁₂] M₂) (g : M₂ →ₛₗ[σ₂₃] M₃) (p : Submodule R₃ M₃) :
    comap (g.comp f : M →ₛₗ[σ₁₃] M₃) p = comap f (comap g p)

{R : Type u_1}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M : Type u_5}
{M₂ : Type u_7}
{M₃ : Type u_8}
[Semiring R]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R₂ M₂]
[Module R₃ M₃]
{σ₁₂ : R →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(f : M →ₛₗ[σ₁₂] M₂)
(g : M₂ →ₛₗ[σ₂₃] M₃)
(p : Submodule R₃ M₃)

Submodule.comap (g.comp f) p = Submodule.comap f (Submodule.comap g p)


/-- If `α` is a linear archimedean succ order and `β` is a linear order, then for any monotone
function `f` and `m n : α`, the union of intervals `Set.Ioc (f i) (f (Order.succ i))`, `m ≤ i < n`,
is equal to `Set.Ioc (f m) (f n)` -/
theorem biUnion_Ico_Ioc_map_succ [SuccOrder α] [IsSuccArchimedean α] [LinearOrder β] {f : α → β}
    (hf : Monotone f) (m n : α) : ⋃ i ∈ Ico m n, Ioc (f i) (f (succ i)) = Ioc (f m) (f n)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[SuccOrder α]
[IsSuccArchimedean α]
[LinearOrder β]
{f : α → β}
(hf : Monotone f)
(m n : α)

⋃ i ∈ Set.Ico m n, Set.Ioc (f i) (f (Order.succ i)) = Set.Ioc (f m) (f n)


theorem ofNat_sub_sub {a b c : Nat} : ((a - b - c : Nat) : Int) = ((a - (b + c) : Nat) : Int)


/-- This left homology map data expresses compatibilities of the left homology data
constructed by `LeftHomologyData.ofEpiOfIsIsoOfMono'` -/
@[simps]
noncomputable def ofEpiOfIsIsoOfMono' (φ : S₁ ⟶ S₂) (h : LeftHomologyData S₂)
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] :
    LeftHomologyMapData φ (LeftHomologyData.ofEpiOfIsIsoOfMono' φ h) h

(CategoryTheory.ShortComplex.LeftHomologyMapData.ofEpiOfIsIsoOfMono' φ h).φK =
  CategoryTheory.CategoryStruct.id (CategoryTheory.ShortComplex.LeftHomologyData.ofEpiOfIsIsoOfMono' φ h).K


/-- Coercion of a `MonoidHom` into a function is itself a `MonoidHom`.

See also `MonoidHom.eval`. -/
@[to_additive (attr := simps) "Coercion of an `AddMonoidHom` into a function is itself
an `AddMonoidHom`.

See also `AddMonoidHom.eval`."]
def MonoidHom.coeFn (α β : Type*) [MulOneClass α] [CommMonoid β] : (α →* β) →* α → β

(α : Type u_3)
(β : Type u_4)
[MulOneClass α]
[CommMonoid β]
(g : α →* β)
(a : α)


/-- If a weighted sum is zero and one of the weights is `-1`, the corresponding point is
the affine combination of the other points with the given weights. -/
theorem affineCombination_eq_of_weightedVSub_eq_zero_of_eq_neg_one {w : ι → k} {p : ι → P}
    (hw : s.weightedVSub p w = (0 : V)) {i : ι} [DecidablePred (· ≠ i)] (his : i ∈ s)
    (hwi : w i = -1) : (s.filter (· ≠ i)).affineCombination k p w = p i

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
{w : ι → k}
{p : ι → P}
(hw : (s.weightedVSub p) w = 0)
{i : ι}
[DecidablePred fun x => x ≠ i]
(his : i ∈ s)
(hwi : w i = -1)

(Finset.affineCombination k (Finset.filter (fun x => x ≠ i) s) p) w = p i


theorem Ioi_infinite [NoMaxOrder α] (a : α) : (Ioi a).Infinite

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


theorem list_get? : Computable₂ (@List.get? α)


@[to_additive (attr := simp)]
theorem recOn_one {C : FreeMonoid α → Sort*} (h0 : C 1) (ih : ∀ x xs, C xs → C (of x * xs)) :
    @recOn α C 1 h0 ih = h0

(ih : (x : α) → (xs : FreeMonoid α) → C xs → C (FreeMonoid.of x * xs))


@[measurability]
theorem measurableSet_preimage (f : α →ₛ β) (s) : MeasurableSet (f ⁻¹' s)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α β)
(s : Set β)


private theorem foldl_argAux_mem (l) : ∀ a m : α, m ∈ foldl (argAux r) (some a) l → m ∈ a :: l

{α : Type u_1}
(r : α → α → Prop)
[DecidableRel r]
(l : List α)
(a m : α)

m ∈ List.foldl (List.argAux r) (some a) l → m ∈ a :: l


/-- A finset is bounded below. -/
protected theorem bddBelow [SemilatticeInf α] [Nonempty α] (s : Finset α) : BddBelow (↑s : Set α)

{α : Type u}
[SemilatticeInf α]
[Nonempty α]
(s : Finset α)


theorem rpow_eq_top_of_nonneg (x : ℝ≥0∞) {y : ℝ} (hy0 : 0 ≤ y) : x ^ y = ⊤ → x = ⊤


@[simp]
theorem coe_copy (f : SupBotHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Bot α]
[Sup β]
[Bot β]
(f : SupBotHom α β)
(f' : α → β)
(h : f' = ⇑f)


/-- Reformulation of `ConvexOn.le_slope_of_hasDerivWithinAt_Ioi` using `derivWithin`. -/
lemma right_deriv_le_slope (hfc : ConvexOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hfd : DifferentiableWithinAt ℝ f (Ioi x) x) :
    derivWithin f (Ioi x) x ≤ slope f x y

(hfd : DifferentiableWithinAt ℝ f (Set.Ioi x) x)

derivWithin f (Set.Ioi x) x ≤ slope f x y


theorem antitone_mul_left [ExistsAddOfLE α] [PosMulMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    {a : α} (ha : a ≤ 0) : Antitone (a * ·)

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

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


@[simp]
theorem coe_codRestrict (f : A →ₐ[R] B) (S : Subalgebra R B) (hf : ∀ x, f x ∈ S) (x : A) :
    ↑(f.codRestrict S hf x) = f x

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


/-- If `μ` is inner regular, then any measurable set can be approximated by a compact subset.
See also `MeasurableSet.exists_isCompact_lt_add_of_ne_top`. -/
theorem _root_.MeasurableSet.exists_lt_isCompact [InnerRegular μ] ⦃A : Set α⦄
    (hA : MeasurableSet A) {r : ℝ≥0∞} (hr : r < μ A) :
    ∃ K, K ⊆ A ∧ IsCompact K ∧ r < μ K

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[μ.InnerRegular]
⦃A : Set α⦄
(hA : MeasurableSet A)
{r : ℝ≥0∞}
(hr : r < μ A)


/-- A version of Markov's inequality with elements of Lp. -/
theorem mul_meas_ge_le_pow_norm' (f : Lp E p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
    (ε : ℝ≥0∞) : ε ^ p.toReal * μ { x | ε ≤ ‖f x‖₊ } ≤ ENNReal.ofReal ‖f‖ ^ p.toReal

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
(f : ↥(MeasureTheory.Lp E p μ))
(hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ⊤)
(ε : ℝ≥0∞)

ε ^ p.toReal * μ {x | ε ≤ ↑‖↑↑f x‖₊} ≤ ENNReal.ofReal ‖f‖ ^ p.toReal


theorem mapRange_neg' [AddGroup G] [SubtractionMonoid H] [FunLike β G H] [AddMonoidHomClass β G H]
    {f : β} (v : α →₀ G) :
    mapRange f (map_zero f) (-v) = -mapRange f (map_zero f) v

{α : Type u_1}
{β : Type u_2}
{G : Type u_9}
{H : Type u_10}
[AddGroup G]
[SubtractionMonoid H]
[FunLike β G H]
[AddMonoidHomClass β G H]
{f : β}
(v : α →₀ G)

Finsupp.mapRange ⇑f ⋯ (-v) = -Finsupp.mapRange ⇑f ⋯ v


theorem isCycle_formPerm (hl : Nodup l) (hn : 2 ≤ l.length) : IsCycle (formPerm l)

{α : Type u_1}
[DecidableEq α]
{l : List α}
(hl : l.Nodup)
(hn : 2 ≤ l.length)


protected theorem ne_of_gt {a b : Int} (h : b < a) : a ≠ b


@[to_additive mul_nsmul']
lemma pow_mul' (a : M) (m n : ℕ) : a ^ (m * n) = (a ^ n) ^ m

{M : Type u_2}
[AddMonoid M]
(a : M)
(m n : ℕ)


@[gcongr]
theorem inf_le_inf (h₁ : a ≤ b) (h₂ : c ≤ d) : a ⊓ c ≤ b ⊓ d

{α : Type u}
[SemilatticeInf α]
{a b c d : α}
(h₁ : a ≤ b)
(h₂ : c ≤ d)


/-- If left-multiplication by any element is cancellative, left-multiplication by `g` is an
embedding. -/
@[to_additive (attr := simps)
      "If left-addition by any element is cancellative, left-addition by `g` is an
        embedding."]
def mulLeftEmbedding [Mul G] [IsLeftCancelMul G] (g : G) : G ↪ G

{G : Type u_1}
[Mul G]
[IsLeftCancelMul G]
(g h : G)


protected theorem HasCompactSupport.abs {f : α → β} (hf : HasCompactSupport f) :
    HasCompactSupport |f|

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