/-- Introduction rule to prove that `b` is the infimum of `s`: it suffices to check that `b`
is smaller than all elements of `s`, and that this is not the case of any `w>b`.
See `sInf_eq_of_forall_ge_of_forall_gt_exists_lt` for a version in complete lattices. -/
theorem csInf_eq_of_forall_ge_of_forall_gt_exists_lt :
    s.Nonempty → (∀ a ∈ s, b ≤ a) → (∀ w, b < w → ∃ a ∈ s, a < w) → sInf s = b

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
{b : α}

s.Nonempty → (∀ a ∈ s, b ≤ a) → (∀ (w : α), b < w → ∃ a ∈ s, a < w) → sInf s = b


theorem isPrincipal_iff (I : FractionalIdeal S P) :
    IsPrincipal (I : Submodule R P) ↔ ∃ x, I = spanSingleton S x

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
[loc : IsLocalization S P]
(I : FractionalIdeal S P)

(↑I).IsPrincipal ↔ ∃ x, I = FractionalIdeal.spanSingleton S x


theorem pow_mul_m_le_card_part (hP : P.IsEquipartition) (hu : u ∈ P.parts) :
    (4 : ℝ) ^ P.parts.card * m ≤ u.card

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{P : Finpartition Finset.univ}
{u : Finset α}
(hP : P.IsEquipartition)
(hu : u ∈ P.parts)


/-- If `s` is a closed set, `v` is a partial refinement, and `i` is an index such that
`i ∉ v.carrier`, then there exists a partial refinement that is strictly greater than `v`. -/
theorem exists_gt (v : PartialRefinement u s) (hs : IsClosed s) (i : ι) (hi : i ∉ v.carrier) :
    ∃ v' : PartialRefinement u s, v < v'

(v : ShrinkingLemma.PartialRefinement u s)


theorem arg_mem_Ioc (z : ℂ) : arg z ∈ Set.Ioc (-π) π


/-- If `f` is a Hölder continuous map with exponent `r > 0`, then `dimH (f '' s) ≤ dimH s / r`. -/
theorem HolderOnWith.dimH_image_le (h : HolderOnWith C r f s) (hr : 0 < r) :
    dimH (f '' s) ≤ dimH s / r

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
{s : Set X}
(h : HolderOnWith C r f s)
(hr : 0 < r)


/-- If `l : Filter ℂ` is an "exponential comparison filter", then for any complex `a₁`, `a₂` and any
natural `b₁ < b₂`, we have
`(fun z ↦ z ^ a₁ * exp (b₁ * z)) =o[l] (fun z ↦ z ^ a₂ * exp (b₂ * z))`. -/
theorem isLittleO_pow_mul_exp {b₁ b₂ : ℝ} (hl : IsExpCmpFilter l) (hb : b₁ < b₂) (m n : ℕ) :
    (fun z => z ^ m * exp (b₁ * z)) =o[l] fun z => z ^ n * exp (b₂ * z)

{l : Filter ℂ}
{b₁ b₂ : ℝ}
(hl : Complex.IsExpCmpFilter l)
(hb : b₁ < b₂)
(m n : ℕ)

(fun z => z ^ m * Complex.exp (↑b₁ * z)) =o[l] fun z => z ^ n * Complex.exp (↑b₂ * z)


@[norm_cast]
theorem coe_mulHom_mk (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) :
    ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) : A →ₙ* B) = ⟨f, h₄⟩

(h₁ : ∀ (m : R) (x : A), f (m • x) = φ m • f x)

(h₂ : { toFun := ⇑f, map_smul' := h₁ }.toFun 0 = 0)

(h₃ :
  ∀ (x y : A),
    { toFun := ⇑f, map_smul' := h₁ }.toFun (x + y) =
      { toFun := ⇑f, map_smul' := h₁ }.toFun x + { toFun := ⇑f, map_smul' := h₁ }.toFun y)

(h₄ :
  ∀ (x y : A),
    { toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun (x * y) =
      { toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun x *
        { toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun y)

↑{ toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃, map_mul' := h₄ } = { toFun := ⇑f, map_mul' := h₄ }


@[simp]
lemma mkHomToSingle_f {K : HomologicalComplex V c} {j : ι} {A : V} (φ : K.X j ⟶ A)
    (hφ : ∀ (i : ι), c.Rel i j → K.d i j ≫ φ = 0) :
    (mkHomToSingle φ hφ).f j = φ ≫ (singleObjXSelf c j A).inv

(HomologicalComplex.mkHomToSingle φ hφ).f j = φ ≫ (HomologicalComplex.singleObjXSelf c j A).inv


@[to_additive (attr := simp)]
theorem prod.of {x : α} : prod (of x) = x

FreeAddGroup.sum (FreeAddGroup.of x) = x


@[to_additive (attr := simp)]
theorem lift_comp_of' (f : FreeMagma α →ₙ* β) : lift (f ∘ of) = f

{α : Type u}
{β : Type v}
[Add β]
(f : AddHom (FreeAddMagma α) β)

FreeAddMagma.lift (⇑f ∘ FreeAddMagma.of) = f


theorem integral_undef {f : ℂ → E} {c : ℂ} {R : ℝ} (hf : ¬CircleIntegrable f c R) :
    (∮ z in C(c, R), f z) = 0

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : ℂ → E}
{c : ℂ}
{R : ℝ}
(hf : ¬CircleIntegrable f c R)


/-- By definition, the elements of `Lp.boundedContinuousFunction E p μ` are the elements of
`Lp E p μ` which contain a bounded continuous representative. -/
theorem MeasureTheory.Lp.mem_boundedContinuousFunction_iff {f : Lp E p μ} :
    f ∈ MeasureTheory.Lp.boundedContinuousFunction E p μ ↔
      ∃ f₀ : α →ᵇ E, f₀.toContinuousMap.toAEEqFun μ = (f : α →ₘ[μ] E)

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[TopologicalSpace α]
[BorelSpace α]
[SecondCountableTopologyEither α E]
{f : ↥(MeasureTheory.Lp E p μ)}

f ∈ MeasureTheory.Lp.boundedContinuousFunction E p μ ↔ ∃ f₀, ContinuousMap.toAEEqFun μ f₀.toContinuousMap = ↑f


@[simp]
theorem toFinset_subset {t : Finset α} : hs.toFinset ⊆ t ↔ s ⊆ t

{α : Type u}
{s : Set α}
{hs : s.Finite}
{t : Finset α}


/-- The functor `Comma L₁ R ⥤ Comma L₃ R` induced by the composition of two natural transformations
    `l : L₁ ⟶ L₂` and `l' : L₂ ⟶ L₃` is naturally isomorphic to the composition of the two functors
    induced by these natural transformations. -/
@[simps!]
def mapLeftComp (l : L₁ ⟶ L₂) (l' : L₂ ⟶ L₃) :
    mapLeft R (l ≫ l') ≅ mapLeft R l' ⋙ mapLeft R l

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(R : CategoryTheory.Functor B T)
{L₁ L₂ L₃ : CategoryTheory.Functor A T}
(l : L₁ ⟶ L₂)
(l' : L₂ ⟶ L₃)
(X : CategoryTheory.Comma L₃ R)

((CategoryTheory.Comma.mapLeftComp R l l').inv.app X).right = CategoryTheory.CategoryStruct.id X.right


theorem vadd_absorbs {M E : Type*} [Bornology M] [AddZeroClass E] [DistribSMul M E]
    {s₁ s₂ t : Set E} {x : E} (h₁ : Absorbent M s₁) (h₂ : Absorbs M s₂ t) :
    Absorbs M (s₁ + s₂) (x +ᵥ t)

{M : Type u_1}
{E : Type u_2}
[Bornology M]
[AddZeroClass E]
[DistribSMul M E]
{s₁ s₂ t : Set E}
{x : E}
(h₁ : Absorbent M s₁)
(h₂ : Absorbs M s₂ t)


theorem PosDef.add (Q Q' : QuadraticMap R₂ M N) (hQ : PosDef Q) (hQ' : PosDef Q') :
    PosDef (Q + Q')

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


theorem piecewise_single_erase (x : Π₀ i, β i) (i : ι)
    [∀ i' : ι, Decidable <| (i' ∈ ({i} : Set ι))] : -- Porting note: added Decidable hypothesis
    (single i (x i)).piecewise (x.erase i) {i} = x

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
(x : Π₀ (i : ι), β i)
(i : ι)
[(i' : ι) → Decidable (i' ∈ {i})]

(DFinsupp.single i (x i)).piecewise (DFinsupp.erase i x) {i} = x


/-- Given a functor `F : C₁ ⥤ C₂ ⥤ D`, this is the bifunctor which sends
`K₁ : HomologicalComplex C₁ c₁` and `K₂ : HomologicalComplex C₂ c₂` to the bicomplex
which is degree `(i₁, i₂)` consists of `(F.obj (K₁.X i₁)).obj (K₂.X i₂)`. -/
@[simps! obj_obj_X_X obj_obj_X_d obj_obj_d_f obj_map_f_f map_app_f_f]
def mapBifunctorHomologicalComplex :
    HomologicalComplex C₁ c₁ ⥤ HomologicalComplex C₂ c₂ ⥤ HomologicalComplex₂ D c₁ c₂

[∀ (X₁ : C₁), (F.obj X₁).PreservesZeroMorphisms]

((((F.mapBifunctorHomologicalComplex c₁ c₂).obj K₁).map φ).f i₁).f i₂ = (F.obj (K₁.X i₁)).map (φ.f i₂)


lemma differentiableAt_log {z : ℂ} (hz : z ∈ slitPlane) : DifferentiableAt ℂ log z


@[simp]
theorem map_div (I J : FractionalIdeal R₁⁰ K) (h : K ≃ₐ[R₁] K') :
    (I / J).map (h : K →ₐ[R₁] K') = I.map h / J.map h

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[frac : IsFractionRing R₁ K]
[IsDomain R₁]
{K' : Type u_5}
[Field K']
[Algebra R₁ K']
[IsFractionRing R₁ K']
(I J : FractionalIdeal R₁⁰ K)
(h : K ≃ₐ[R₁] K')

FractionalIdeal.map (↑h) (I / J) = FractionalIdeal.map (↑h) I / FractionalIdeal.map (↑h) J


/-- A structure encapsulating minimal axioms needed to defined a normed vector space, as found
in textbooks. This is meant to be used to easily define `NormedAddCommGroup E` and `NormedSpace E`
instances from scratch on a type with no preexisting distance or topology. -/
structure NormedSpace.Core (𝕜 : Type*) (E : Type*) [NormedField 𝕜] [AddCommGroup E] [Module 𝕜 E]
    [Norm E] extends SeminormedAddCommGroup.Core 𝕜 E : Prop where
  norm_eq_zero_iff (x : E) : ‖x‖ = 0 ↔ x = 0

{𝕜 : Type u_6}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Norm E]
(self : NormedSpace.Core 𝕜 E)
(x : E)


theorem ext_iff {inst₁ inst₂ : Distrib R} :
    inst₁ = inst₂ ↔
      (local_hAdd[R, inst₁] = local_hAdd[R, inst₂]) ∧
      (local_hMul[R, inst₁] = local_hMul[R, inst₂])

inst₁ = inst₂ ↔ HAdd.hAdd = HAdd.hAdd ∧ HMul.hMul = HMul.hMul


theorem LinearMap.toMatrixAlgEquiv_comp (f g : M₁ →ₗ[R] M₁) :
    LinearMap.toMatrixAlgEquiv v₁ (f.comp g) =
      LinearMap.toMatrixAlgEquiv v₁ f * LinearMap.toMatrixAlgEquiv v₁ g

{R : Type u_1}
[CommSemiring R]
{n : Type u_4}
[Fintype n]
[DecidableEq n]
{M₁ : Type u_5}
[AddCommMonoid M₁]
[Module R M₁]
(v₁ : Basis n R M₁)
(f g : M₁ →ₗ[R] M₁)

(LinearMap.toMatrixAlgEquiv v₁) (f ∘ₗ g) = (LinearMap.toMatrixAlgEquiv v₁) f * (LinearMap.toMatrixAlgEquiv v₁) g


@[simp]
theorem mem_normalizer (m : M) : m ∈ N.normalizer ↔ ∀ x : L, ⁅x, m⁆ ∈ N

{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]
(N : LieSubmodule R L M)
(m : M)

m ∈ N.normalizer ↔ ∀ (x : L), ⁅x, m⁆ ∈ N


theorem StrictAntiOn.eq_iff_eq (hf : StrictAntiOn f s) {a b : α} (ha : a ∈ s) (hb : b ∈ s) :
    f a = f b ↔ b = a

{α : Type u}
{β : Type v}
[LinearOrder α]
[Preorder β]
{f : α → β}
{s : Set α}
(hf : StrictAntiOn f s)
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)


@[reassoc (attr := simp)]
lemma inrX_d (i j : ι) :
    inrX φ i ≫ d φ i j = G.d i j ≫ inrX φ j

HomologicalComplex.homotopyCofiber.inrX φ i ≫ HomologicalComplex.homotopyCofiber.d φ i j =
  G.d i j ≫ HomologicalComplex.homotopyCofiber.inrX φ j


theorem IsConnected.subset_connectedComponent {x : α} {s : Set α} (H1 : IsConnected s)
    (H2 : x ∈ s) : s ⊆ connectedComponent x

{α : Type u}
[TopologicalSpace α]
{x : α}
{s : Set α}
(H1 : IsConnected s)
(H2 : x ∈ s)


(S : CategoryTheory.ShortComplex.SnakeInput C)


theorem Sigma.ι_comp_toFiniteCoproduct (a : α) :
    (Limits.Sigma.ι X a) ≫ (coproductIsoCoproduct X).inv = finiteCoproduct.ι X a

{α : Type w}
[Finite α]
(X : α → LightProfinite)
(a : α)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Sigma.ι X a) (LightProfinite.coproductIsoCoproduct X).inv =
  LightProfinite.finiteCoproduct.ι X a


@[simp]
protected theorem smul_def (f : M₁ →L[R₁] M₁) (a : M₁) : f • a = f a

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[ContinuousAdd M₁]
(f : M₁ →L[R₁] M₁)
(a : M₁)


/-- Canonical form of the **equality case of Jensen's equality**.

For a strictly convex function `f` and positive weights `w`, we have
`f (∑ i ∈ t, w i • p i) = ∑ i ∈ t, w i • f (p i)` if and only if the points `p` are all equal
(and in fact all equal to their center of mass wrt `w`). -/
lemma StrictConvexOn.map_sum_eq_iff {w : ι → 𝕜} {p : ι → E} (hf : StrictConvexOn 𝕜 s f)
    (h₀ : ∀ i ∈ t, 0 < w i) (h₁ : ∑ i ∈ t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) :
    f (∑ i ∈ t, w i • p i) = ∑ i ∈ t, w i • f (p i) ↔ ∀ j ∈ t, p j = ∑ i ∈ t, w i • p i

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
{ι : Type u_5}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[OrderedAddCommGroup β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
{t : Finset ι}
{w : ι → 𝕜}
{p : ι → E}
(hf : StrictConvexOn 𝕜 s f)
(h₀ : ∀ i ∈ t, 0 < w i)
(h₁ : ∑ i ∈ t, w i = 1)
(hmem : ∀ i ∈ t, p i ∈ s)


@[simp]
theorem finrank_eq_finrank_subalgebra : finrank K F.toSubalgebra = finrank K F

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

FiniteDimensional.finrank K ↥F.toSubalgebra = FiniteDimensional.finrank K ↥F


@[to_additive]
theorem smooth_mul_left {a : G} : Smooth I I fun b : G => a * b

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


theorem iteratedDerivWithin_sub (hf : ContDiffOn 𝕜 n f s) (hg : ContDiffOn 𝕜 n g s) :
    iteratedDerivWithin n (f - g) s x =
      iteratedDerivWithin n f s x - iteratedDerivWithin n g s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{x : 𝕜}
{s : Set 𝕜}
(hx : x ∈ s)
(h : UniqueDiffOn 𝕜 s)
{f g : 𝕜 → F}
(hf : ContDiffOn 𝕜 (↑n) f s)
(hg : ContDiffOn 𝕜 (↑n) g s)


@[simp]
theorem X_mul_modMonomial (i : σ) (x : MvPolynomial σ R) :
    X i * x %ᵐᵒⁿᵒᵐⁱᵃˡ Finsupp.single i 1 = 0

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(i : σ)
(x : MvPolynomial σ R)

(MvPolynomial.X i * x).modMonomial (Finsupp.single i 1) = 0


/-- If two monoid homomorphisms are equal on a set, then they are equal on its submonoid closure. -/
@[to_additive
      "If two monoid homomorphisms are equal on a set, then they are equal on its submonoid
      closure."]
theorem eqOn_closureM {f g : M →* N} {s : Set M} (h : Set.EqOn f g s) : Set.EqOn f g (closure s)

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{f g : M →* N}
{s : Set M}
(h : Set.EqOn (⇑f) (⇑g) s)


/-- For every element in the span of a set, there exists a finite subset of the set
such that the element is contained in the span of the subset. -/
theorem mem_span_finite_of_mem_span {S : Set M} {x : M} (hx : x ∈ span R S) :
    ∃ T : Finset M, ↑T ⊆ S ∧ x ∈ span R (T : Set M)

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{S : Set M}
{x : M}
(hx : x ∈ Submodule.span R S)


theorem copy_eq (f : InfTopHom α β) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Top α]
[Inf β]
[Top β]
(f : InfTopHom α β)
(f' : α → β)
(h : f' = ⇑f)


/-- An alias for `h.symm.map_mul`. Introduced to fix the issue in
https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/!4.234183.20.60simps.60.20maximum.20recursion.20depth
-/
@[to_additive]
lemma symm_map_mul {M N : Type*} [Mul M] [Mul N] (h : M ≃* N) (x y : N) :
    h.symm (x * y) = h.symm x * h.symm y

{M : Type u_12}
{N : Type u_13}
[Mul M]
[Mul N]
(h : M ≃* N)
(x y : N)


@[simp]
theorem coe_toAdditive_ker (f : G →* G') :
    (MonoidHom.toAdditive f).ker = Subgroup.toAddSubgroup f.ker

{G : Type u_1}
{G' : Type u_2}
[Group G]
[Group G']
(f : G →* G')


theorem pi_ext (h : ∀ i x, f (Pi.single i x) = g (Pi.single i x)) : f = g

(h : ∀ (i : ι) (x : φ i), f (Pi.single i x) = g (Pi.single i x))


@[simp, reassoc]
theorem pullbackP1Iso_inv_fst (i : 𝒰.J) :
    (pullbackP1Iso 𝒰 f g i).inv ≫ pullback.fst _ _ = (gluing 𝒰 f g).ι i

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

(AlgebraicGeometry.Scheme.Pullback.pullbackP1Iso 𝒰 f g i).inv ≫
    CategoryTheory.Limits.pullback.fst (AlgebraicGeometry.Scheme.Pullback.p1 𝒰 f g) (𝒰.map i) =
  (AlgebraicGeometry.Scheme.Pullback.gluing 𝒰 f g).ι i


theorem subset_sInf_of_within [Inhabited s] {t : Set s}
    (h' : t.Nonempty) (h'' : BddBelow t) (h : sInf ((↑) '' t : Set α) ∈ s) :
    sInf ((↑) '' t : Set α) = (@sInf s _ t : α)

{α : Type u_2}
(s : Set α)
[Preorder α]
[InfSet α]
[Inhabited ↑s]
{t : Set ↑s}
(h' : t.Nonempty)
(h'' : BddBelow t)
(h : sInf (Subtype.val '' t) ∈ s)


@[simp]
theorem realize_sup : (φ ⊔ ψ).Realize v xs ↔ φ.Realize v xs ∨ ψ.Realize v xs

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{l : ℕ}
{φ ψ : L.BoundedFormula α l}
{v : α → M}
{xs : Fin l → M}


theorem fderivWithin_mul_const (hxs : UniqueDiffWithinAt 𝕜 s x)
    (hc : DifferentiableWithinAt 𝕜 c s x) (d : 𝔸') :
    fderivWithin 𝕜 (fun y => c y * d) s x = d • fderivWithin 𝕜 c s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s : Set E}
{𝔸' : Type u_7}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
{c : E → 𝔸'}
(hxs : UniqueDiffWithinAt 𝕜 s x)
(hc : DifferentiableWithinAt 𝕜 c s x)
(d : 𝔸')


@[simp]
theorem disjoint_lift'_closure_nhds [T25Space X] {x y : X} :
    Disjoint ((𝓝 x).lift' closure) ((𝓝 y).lift' closure) ↔ x ≠ y

{X : Type u_1}
[TopologicalSpace X]
[T25Space X]
{x y : X}


@[to_additive (attr := simp)]
theorem op_ofNat [NatCast α] (n : ℕ) [n.AtLeastTwo] :
    op (no_index (OfNat.ofNat n : α)) = OfNat.ofNat n

{α : Type u_1}
[NatCast α]
(n : ℕ)
[n.AtLeastTwo]

MulOpposite.op (OfNat.ofNat n) = OfNat.ofNat n


/-- A finite union of sets which are all bounded below is still bounded below. -/
theorem Finite.bddBelow_biUnion {I : Set β} {S : β → Set α} (H : I.Finite) :
    BddBelow (⋃ i ∈ I, S i) ↔ ∀ i ∈ I, BddBelow (S i)

{α : Type u}
{β : Type v}
[Preorder α]
[IsDirected α fun x x_1 => x ≥ x_1]
[Nonempty α]
{I : Set β}
{S : β → Set α}
(H : I.Finite)


@[simp]
theorem smul_toInvSubmonoid (m : M) : m • (toInvSubmonoid M S m : S) = 1

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

m • ↑((IsLocalization.toInvSubmonoid M S) m) = 1


@[simp] theorem rightInvSeq_singleton (i : B) : ris [i] = [s i]

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(i : B)


@[to_additive (attr := simp)]
theorem coe_normGroupSeminorm : ⇑(normGroupSeminorm E) = norm


/-- Restricting a partial homeomorphism `e` to `e.source ∩ interior s`. We use the interior to make
sure that the restriction is well defined whatever the set s, since partial homeomorphisms are by
definition defined on open sets. In applications where `s` is open, this coincides with the
restriction of partial equivalences -/
@[simps! (config := mfld_cfg) apply symm_apply, simps! (config := .lemmasOnly) source target]
protected def restr (s : Set X) : PartialHomeomorph X Y

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
(s : Set X)

(e.restr s).target = e.target ∩ ↑e.symm ⁻¹' interior s


@[to_additive] lemma MonovaryOn.pow_right (hfg : MonovaryOn f g s) (n : ℕ) :
    MonovaryOn f (g ^ n) s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[LinearOrderedAddCommGroup β]
{s : Set ι}
{f : ι → α}
{g : ι → β}
(hfg : MonovaryOn f g s)
(n : ℕ)


/-- If one controls the norm of every `A x`, then one controls the norm of `A`. -/
theorem opNNNorm_le_bound (f : E →SL[σ₁₂] F) (M : ℝ≥0) (hM : ∀ x, ‖f x‖₊ ≤ M * ‖x‖₊) : ‖f‖₊ ≤ M

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)
(M : ℝ≥0)
(hM : ∀ (x : E), ‖f x‖₊ ≤ M * ‖x‖₊)


theorem lintegral_bind {m : Measure α} {μ : α → Measure β} {f : β → ℝ≥0∞} (hμ : Measurable μ)
    (hf : Measurable f) : ∫⁻ x, f x ∂bind m μ = ∫⁻ a, ∫⁻ x, f x ∂μ a ∂m

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{m : MeasureTheory.Measure α}
{μ : α → MeasureTheory.Measure β}
{f : β → ℝ≥0∞}
(hμ : Measurable μ)
(hf : Measurable f)

∫⁻ (x : β), f x ∂m.bind μ = ∫⁻ (a : α), ∫⁻ (x : β), f x ∂μ a ∂m


/-- The object in `SimplicialObject.Split C` attached to a splitting `s : Splitting X`
of a simplicial object `X`. -/
@[simps]
def mk' {X : SimplicialObject C} (s : Splitting X) : Split C

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X : CategoryTheory.SimplicialObject C}
(s : SimplicialObject.Splitting X)


@[to_additive Pi.nnnorm_def]
lemma Pi.nnnorm_def' : ‖f‖₊ = Finset.univ.sup fun b => ‖f b‖₊

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedGroup (π i)]
(f : (i : ι) → π i)


@[simp]
theorem coe_range : (f.range : Set S) = Set.range f

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(f : R →+* S)


@[simp]
theorem rdrop_concat_succ (x : α) : rdrop (l ++ [x]) (n + 1) = rdrop l n

{α : Type u_1}
(l : List α)
(n : ℕ)
(x : α)


/-- `Fin.castLE` as an `Embedding`, `castLEEmb h i` embeds `i` into a larger `Fin` type.  -/
@[simps! apply]
def castLEEmb (h : n ≤ m) : Fin n ↪ Fin m


theorem mul_cases : Irrational (x * y) → Irrational x ∨ Irrational y


lemma eq_bot_or_eq_succ_or_isWellOrderLimitElement [OrderBot α] (a : α) :
    a = ⊥ ∨ (∃ b, a = wellOrderSucc b ∧ b < a) ∨ IsWellOrderLimitElement a

{α : Type u_1}
[LinearOrder α]
[IsWellOrder α fun x x_1 => x < x_1]
[OrderBot α]
(a : α)


/--
A typeclass describing the property that forming all finite disjoint unions is stable under the
property `P`.
-/
class HasExplicitFiniteCoproducts : Prop where
  hasProp {α : Type w} [Finite α] (X : α → CompHausLike.{max u w} P) : HasExplicitFiniteCoproduct X

[self : CompHausLike.HasExplicitFiniteCoproducts P]


theorem top_mem_upperBounds [OrderTop α] (s : Set α) : ⊤ ∈ upperBounds s

{α : Type u}
[Preorder α]
[OrderTop α]
(s : Set α)


@[to_additive (attr := simp)]
lemma haarScalarFactor_self (μ : Measure G) [IsHaarMeasure μ] :
    haarScalarFactor μ μ = 1

{G : Type u_1}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[MeasurableSpace G]
[BorelSpace G]
(μ : MeasureTheory.Measure G)
[μ.IsAddHaarMeasure]


theorem dite_tensor {P : Prop} [Decidable P] {W X Y Z : C} (f : W ⟶ X) (g : P → (Y ⟶ Z))
    (g' : ¬P → (Y ⟶ Z)) : (if h : P then g h else g' h) ⊗ f =
    if h : P then g h ⊗ f else g' h ⊗ f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{P : Prop}
[Decidable P]
{W X Y Z : C}
(f : W ⟶ X)
(g : P → (Y ⟶ Z))
(g' : ¬P → (Y ⟶ Z))

CategoryTheory.MonoidalCategory.tensorHom (if h : P then g h else g' h) f =
  if h : P then CategoryTheory.MonoidalCategory.tensorHom (g h) f
  else CategoryTheory.MonoidalCategory.tensorHom (g' h) f


theorem isAlgebraic_of_finite_intermediateField
    [Finite (IntermediateField F E)] : Algebra.IsAlgebraic F E

(F : Type u_1)
(E : Type u_2)
[Field F]
[Field E]
[Algebra F E]
[Finite (IntermediateField F E)]


@[simp]
theorem whiskeringLeftFunctor'_obj (F : D ⥤ E) : (whiskeringLeftFunctor' L W E).obj F = L ⋙ F

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
{E : Type u_3}
[CategoryTheory.Category.{u_5, u_3} E]
[L.IsLocalization W]
(F : CategoryTheory.Functor D E)

(CategoryTheory.Localization.whiskeringLeftFunctor' L W E).obj F = L.comp F


theorem isBigO_refl (f : α → E) (l : Filter α) : f =O[l] f

{α : Type u_1}
{E : Type u_3}
[Norm E]
(f : α → E)
(l : Filter α)


theorem closure_inf_le [SemilatticeInf α] (c : ClosureOperator α) (x y : α) :
    c (x ⊓ y) ≤ c x ⊓ c y

{α : Type u_1}
[SemilatticeInf α]
(c : ClosureOperator α)
(x y : α)


theorem mem_append_stream_right : ∀ {a : α} (l : List α) {s : Stream' α}, a ∈ s → a ∈ l ++ₛ s

{α : Type u}
{a : α}
(l : List α)
{s : Stream' α}


@[to_additive is_left_invariant_addIndex]
theorem is_left_invariant_index {K : Set G} (hK : IsCompact K) (g : G) {V : Set G}
    (hV : (interior V).Nonempty) : index ((fun h => g * h) '' K) V = index K V

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
{K : Set G}
(hK : IsCompact K)
(g : G)
{V : Set G}
(hV : (interior V).Nonempty)

MeasureTheory.Measure.haar.index ((fun h => g * h) '' K) V = MeasureTheory.Measure.haar.index K V


theorem antisymm' [IsAntisymm α r] {a b : α} : r a b → r b a → b = a

{α : Type u}
{r : α → α → Prop}
[IsAntisymm α r]
{a b : α}


/-- The set of right differentiability points of a function taking values in a complete space is
Borel-measurable. -/
theorem measurableSet_of_differentiableWithinAt_Ici :
    MeasurableSet { x | DifferentiableWithinAt ℝ f (Ici x) x }

{F : Type u_1}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : ℝ → F)
[CompleteSpace F]

MeasurableSet {x | DifferentiableWithinAt ℝ f (Set.Ici x) x}


lemma rTensorAlgHom_toLinearMap :
    (rTensorAlgHom :
      MvPolynomial σ S ⊗[R] N →ₐ[S] MvPolynomial σ (S ⊗[R] N)).toLinearMap =
      rTensor.toLinearMap

{R : Type u}
{N : Type w}
[CommSemiring R]
{σ : Type u_1}
[DecidableEq σ]
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[CommSemiring N]
[Algebra R N]


theorem image_trans_source : e '' (e.trans e').source = e.target ∩ e'.source

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(e : PartialHomeomorph X Y)
(e' : PartialHomeomorph Y Z)

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


theorem next_prev (l : List α) (h : Nodup l) (x : α) (hx : x ∈ l) :
    next l (prev l x hx) (prev_mem _ _ _) = x

{α : Type u_1}
[DecidableEq α]
(l : List α)
(h : l.Nodup)
(x : α)
(hx : x ∈ l)


@[to_additive (attr := simp)]
theorem piCongrRight_symm {η : Type*} {Ms Ns : η → Type*} [∀ j, Mul (Ms j)] [∀ j, Mul (Ns j)]
    (es : ∀ j, Ms j ≃* Ns j) : (piCongrRight es).symm = piCongrRight fun i => (es i).symm

{η : Type u_12}
{Ms : η → Type u_13}
{Ns : η → Type u_14}
[(j : η) → Add (Ms j)]
[(j : η) → Add (Ns j)]
(es : (j : η) → Ms j ≃+ Ns j)

(AddEquiv.piCongrRight es).symm = AddEquiv.piCongrRight fun i => (es i).symm


/-- The angle ∠ABA at a point is `0`, unless `A = B`. -/
theorem angle_self_of_ne (h : p ≠ p₀) : ∠ p p₀ p = 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p p₀ : P}
(h : p ≠ p₀)


@[simp]
theorem nonempty_Ioo [DenselyOrdered α] : (Ioo a b).Nonempty ↔ a < b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}
[DenselyOrdered α]


theorem halting_problem_not_re (n) : ¬RePred fun c => ¬(eval c n).Dom


theorem blsub_lt_ord_of_isRegular {o : Ordinal} {f : ∀ a < o, Ordinal} {c} (hc : IsRegular c)
    (ho : o.card < c) : (∀ i hi, f i hi < c.ord) → Ordinal.blsub o f < c.ord

{f : (a : Ordinal.{max u_2 u_3}) → a < o → Ordinal.{max u_2 u_3}}

(∀ (i : Ordinal.{max u_2 u_3}) (hi : i < o), f i hi < c.ord) → o.blsub f < c.ord


theorem InjOn.cancel_left (hg : t.InjOn g) (hf₁ : s.MapsTo f₁ t) (hf₂ : s.MapsTo f₂ t) :
    s.EqOn (g ∘ f₁) (g ∘ f₂) ↔ s.EqOn f₁ f₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
{t : Set β}
{f₁ f₂ : α → β}
{g : β → γ}
(hg : Set.InjOn g t)
(hf₁ : Set.MapsTo f₁ s t)
(hf₂ : Set.MapsTo f₂ s t)

Set.EqOn (g ∘ f₁) (g ∘ f₂) s ↔ Set.EqOn f₁ f₂ s


theorem succ_pred_eq_of_ne_zero : ∀ {n}, n ≠ 0 → succ (pred n) = n


@[to_additive]
theorem lift_surjective_iff :
    Function.Surjective (f.lift hg) ↔ ∀ v : P, ∃ x : M × S, v * g x.2 = g x.1

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{g : M →* P}
(hg : ∀ (y : ↥S), IsUnit (g ↑y))

Function.Surjective ⇑(f.lift hg) ↔ ∀ (v : P), ∃ x, v * g ↑x.2 = g x.1


theorem le_imp_le_of_lt_imp_lt {β} [Preorder α] [LinearOrder β] {a b : α} {c d : β}
    (H : d < c → b < a) (h : a ≤ b) : c ≤ d

{α : Type u}
{β : Type u_1}
[Preorder α]
[LinearOrder β]
{a b : α}
{c d : β}
(H : d < c → b < a)
(h : a ≤ b)


theorem dotProduct_block [Fintype m] [Fintype n] [Mul α] [AddCommMonoid α] (v w : m ⊕ n → α) :
    v ⬝ᵥ w = v ∘ Sum.inl ⬝ᵥ w ∘ Sum.inl + v ∘ Sum.inr ⬝ᵥ w ∘ Sum.inr

{m : Type u_2}
{n : Type u_3}
{α : Type u_12}
[Fintype m]
[Fintype n]
[Mul α]
[AddCommMonoid α]
(v w : m ⊕ n → α)


@[simp]
theorem union_nonempty : (s ∪ t).Nonempty ↔ s.Nonempty ∨ t.Nonempty


/-- Two morphisms from a horn are equal if they are equal on all suitable faces. -/
protected
lemma hom_ext {n : ℕ} {i : Fin (n+2)} {S : SSet} (σ₁ σ₂ : Λ[n+1, i] ⟶ S)
    (h : ∀ (j) (h : j ≠ i), σ₁.app _ (face i j h) = σ₂.app _ (face i j h)) :
    σ₁ = σ₂

(h :
  ∀ (j : Fin (n + 2)) (h : j ≠ i),
    σ₁.app (Opposite.op [n]) (SSet.horn.face i j h) = σ₂.app (Opposite.op [n]) (SSet.horn.face i j h))


lemma toUnits_comp_map : toUnits.comp (map f) = (Units.map f).comp toUnits

{F : Type u_2}
{R : Type u_3}
{S : Type u_4}
[Monoid R]
[StarMul R]
[Monoid S]
[StarMul S]
[FunLike F R S]
[StarHomClass F R S]
[MonoidHomClass F R S]
(f : F)

unitary.toUnits.comp (unitary.map f) = (Units.map ↑f).comp unitary.toUnits


theorem algebraMap_eq_of_integral {x : K} : IsIntegral R x → ∃ y : R, algebraMap R K y = x

{R : Type u_1}
[CommRing R]
[iic : IsIntegrallyClosed R]
{K : Type u_3}
[CommRing K]
[Algebra R K]
[ifr : IsFractionRing R K]
{x : K}

IsIntegral R x → ∃ y, (algebraMap R K) y = x


@[simp] lemma bddAbove_preimage_toDual {s : Set αᵒᵈ} :
    BddAbove (toDual ⁻¹' s) ↔ BddBelow s

BddAbove (⇑OrderDual.toDual ⁻¹' s) ↔ BddBelow s


/-- An inducing map with an open range is an open map. -/
protected theorem Inducing.isOpenMap (hi : Inducing f) (ho : IsOpen (range f)) : IsOpenMap f

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hi : Inducing f)
(ho : IsOpen (Set.range f))


protected theorem ContinuousLinearMap.map_tsum [T2Space M₂] {f : ι → M} (φ : M →SL[σ] M₂)
    (hf : Summable f) : φ (∑' z, f z) = ∑' z, φ (f z)

{ι : Type u_5}
{R : Type u_7}
{R₂ : Type u_8}
{M : Type u_9}
{M₂ : Type u_10}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M₂]
[Module R₂ M₂]
[TopologicalSpace M]
[TopologicalSpace M₂]
{σ : R →+* R₂}
[T2Space M₂]
{f : ι → M}
(φ : M →SL[σ] M₂)
(hf : Summable f)


@[simp]
theorem app_hom {P Q : C} (f : P ⟶ Q) (a : Over P) : (app f a).hom = a.hom ≫ f

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

(CategoryTheory.Abelian.app f a).hom = a.hom ≫ f


theorem mfderivWithin_zero_of_not_mdifferentiableWithinAt
    (h : ¬MDifferentiableWithinAt I I' f s x) : mfderivWithin I I' f s x = 0


/-- `HasFTaylorSeriesUpToOn n f p s` registers the fact that `p 0 = f` and `p (m+1)` is a
derivative of `p m` for `m < n`, and is continuous for `m ≤ n`. This is a predicate analogous to
`HasFDerivWithinAt` but for higher order derivatives.

Notice that `p` does not sum up to `f` on the diagonal (`FormalMultilinearSeries.sum`), even if
`f` is analytic and `n = ∞`: an additional `1/m!` factor on the `m`th term is necessary for that. -/
structure HasFTaylorSeriesUpToOn (n : ℕ∞) (f : E → F) (p : E → FormalMultilinearSeries 𝕜 E F)
  (s : Set E) : Prop where
  zero_eq : ∀ x ∈ s, (p x 0).uncurry0 = f x
  protected fderivWithin : ∀ m : ℕ, (m : ℕ∞) < n → ∀ x ∈ s,
    HasFDerivWithinAt (p · m) (p x m.succ).curryLeft s x
  cont : ∀ m : ℕ, (m : ℕ∞) ≤ n → ContinuousOn (p · m) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{f : E → F}
{p : E → FormalMultilinearSeries 𝕜 E F}
{s : Set E}
(self : HasFTaylorSeriesUpToOn n f p s)
(x : E)


@[to_additive zsmul_strictMono_left]
lemma zpow_right_strictMono (ha : 1 < a) : StrictMono fun n : ℤ ↦ a ^ n

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


theorem le_dedup {s t : Multiset α} : s ≤ dedup t ↔ s ≤ t ∧ Nodup s

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


protected lemma partialSups_apply (hf : ∀ k ≤ n, Tendsto (f k) l (𝓝 (g k))) :
    Tendsto (fun a ↦ partialSups (f · a) n) l (𝓝 (partialSups g n))

(hf : ∀ k ≤ n, Filter.Tendsto (f k) l (𝓝 (g k)))

Filter.Tendsto (fun a => (partialSups fun x => f x a) n) l (𝓝 ((partialSups g) n))


theorem choice_isFunc (h : ∅ ∉ x) : IsFunc x (⋃₀ x) (choice x)


@[simp]
theorem coe_of (X : Type u) [CommRing X] [TopologicalSpace X] [TopologicalRing X] :
    (of X : Type u) = X


@[simp]
theorem isLittleO_const_left {c : E''} :
    (fun _x => c) =o[l] g'' ↔ c = 0 ∨ Tendsto (norm ∘ g'') l atTop

{α : Type u_1}
{E'' : Type u_9}
{F'' : Type u_10}
[NormedAddCommGroup E'']
[NormedAddCommGroup F'']
{g'' : α → F''}
{l : Filter α}
{c : E''}

(fun _x => c) =o[l] g'' ↔ c = 0 ∨ Filter.Tendsto (norm ∘ g'') l Filter.atTop


@[to_additive (attr := continuity) continuous_sub_right]
lemma continuous_div_right' (a : G) : Continuous (· / a)

{G : Type w}
[TopologicalSpace G]
[Div G]
[ContinuousDiv G]
(a : G)


/-- `zero_le_one` with the type argument implicit. -/
@[simp] lemma zero_le_one [Zero α] [One α] [LE α] [ZeroLEOneClass α] : (0 : α) ≤ 1

{α : Type u_1}
[Zero α]
[One α]
[LE α]
[ZeroLEOneClass α]


theorem lt_natDegree_of_mem_eraseLead_support {a : ℕ} (h : a ∈ (eraseLead f).support) :
    a < f.natDegree

{R : Type u_1}
[Semiring R]
{f : R[X]}
{a : ℕ}
(h : a ∈ f.eraseLead.support)


@[to_additive]
theorem comap_iInf {ι : Sort*} (f : M →ₙ* N) (s : ι → Subsemigroup N) :
    (iInf s).comap f = ⨅ i, (s i).comap f

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{ι : Sort u_5}
(f : M →ₙ* N)
(s : ι → Subsemigroup N)

Subsemigroup.comap f (iInf s) = ⨅ i, Subsemigroup.comap f (s i)


theorem integral_pair [CompleteSpace E] [CompleteSpace F] {f : X → E} {g : X → F}
    (hf : Integrable f μ) (hg : Integrable g μ) :
    ∫ x, (f x, g x) ∂μ = (∫ x, f x ∂μ, ∫ x, g x ∂μ)

{X : Type u_1}
{E : Type u_3}
{F : Type u_4}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace ℝ E]
[NormedSpace ℝ F]
[CompleteSpace E]
[CompleteSpace F]
{f : X → E}
{g : X → F}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)

∫ (x : X), (f x, g x) ∂μ = (∫ (x : X), f x ∂μ, ∫ (x : X), g x ∂μ)


@[simp]
theorem neg_of [Neg α] (f : m → n → α) : -of f = of (-f)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Neg α]
(f : m → n → α)


theorem ContDiffOn.csin {n} (hf : ContDiffOn ℂ n f s) :
    ContDiffOn ℂ n (fun x => Complex.sin (f x)) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffOn ℂ n f s)


theorem supported_inter (s t : Set α) :
    supported M R (s ∩ t) = supported M R s ⊓ supported M R t

{α : Type u_1}
{M : Type u_2}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(s t : Set α)

Finsupp.supported M R (s ∩ t) = Finsupp.supported M R s ⊓ Finsupp.supported M R t


@[simp]
theorem mapAccumr₂_mapAccumr₂_left_right
    (f₁ : γ → β → σ₁ → σ₁ × φ) (f₂ : α → β → σ₂ → σ₂ × γ) :
    (mapAccumr₂ f₁ (mapAccumr₂ f₂ xs ys s₂).snd ys s₁)
    = let m := mapAccumr₂ (fun x y (s₁, s₂) =>
                let r₂ := f₂ x y s₂
                let r₁ := f₁ r₂.snd y s₁
                ((r₁.fst, r₂.fst), r₁.snd)
              )
            xs ys (s₁, s₂)
    (m.fst.fst, m.snd)

{α : Type}
{n : ℕ}
{β : Type}
(xs : Mathlib.Vector α n)
(ys : Mathlib.Vector β n)
{γ σ₁ φ σ₂ : Type}
{s₂ : σ₂}
{s₁ : σ₁}
(f₁ : γ → β → σ₁ → σ₁ × φ)
(f₂ : α → β → σ₂ → σ₂ × γ)

Mathlib.Vector.mapAccumr₂ f₁ (Mathlib.Vector.mapAccumr₂ f₂ xs ys s₂).2 ys s₁ =
  let m :=
    Mathlib.Vector.mapAccumr₂
      (fun x y x_1 =>
        match x_1 with
        | (s₁, s₂) =>
          let r₂ := f₂ x y s₂;
          let r₁ := f₁ r₂.2 y s₁;
          ((r₁.1, r₂.1), r₁.2))
      xs ys (s₁, s₂);
  (m.1.1, m.2)


theorem sub_martingale [Preorder E] [CovariantClass E E (· + ·) (· ≤ ·)]
    (hf : Supermartingale f ℱ μ) (hg : Martingale g ℱ μ) : Supermartingale (f - g) ℱ μ

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

(hf : MeasureTheory.Supermartingale f ℱ μ)

MeasureTheory.Supermartingale (f - g) ℱ μ


@[simp]
theorem refl_toHomotopyEquiv (X : Type u) [TopologicalSpace X] :
    (Homeomorph.refl X).toHomotopyEquiv = HomotopyEquiv.refl X

(Homeomorph.refl X).toHomotopyEquiv = ContinuousMap.HomotopyEquiv.refl X


theorem isBigOWith_comm :
    IsBigOWith c l (fun x => f₁ x - f₂ x) g ↔ IsBigOWith c l (fun x => f₂ x - f₁ x) g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{c : ℝ}
{g : α → F}
{l : Filter α}
{f₁ f₂ : α → E'}

Asymptotics.IsBigOWith c l (fun x => f₁ x - f₂ x) g ↔ Asymptotics.IsBigOWith c l (fun x => f₂ x - f₁ x) g


@[reassoc (attr := simp)]
lemma inrX_sndX (i : ι) : inrX φ i ≫ sndX φ i = 𝟙 _

HomologicalComplex.homotopyCofiber.inrX φ i ≫ HomologicalComplex.homotopyCofiber.sndX φ i = 𝟙 (G.X i)


theorem of_null (h : μ s = 0) : NullMeasurableSet s μ

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


/-- A strictly concave function admits at most one global maximum. -/
lemma StrictConcaveOn.eq_of_isMaxOn (hf : StrictConcaveOn 𝕜 s f) (hfx : IsMaxOn f s x)
    (hfy : IsMaxOn f s y) (hx : x ∈ s) (hy : y ∈ s) : x = y

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[LinearOrderedField 𝕜]
[OrderedAddCommMonoid β]
[AddCommMonoid E]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{f : E → β}
{s : Set E}
{x y : E}
(hf : StrictConcaveOn 𝕜 s f)
(hfx : IsMaxOn f s x)
(hfy : IsMaxOn f s y)
(hx : x ∈ s)
(hy : y ∈ s)


theorem gcd_val (a b : R) : gcd a b = gcd (b % a) a

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
(a b : R)

EuclideanDomain.gcd a b = EuclideanDomain.gcd (b % a) a


lemma setIntegral_densityProcess_of_le (hκν : fst κ ≤ ν)
    [IsFiniteKernel ν] {n m : ℕ} (hnm : n ≤ m) (a : α) {s : Set β} (hs : MeasurableSet s)
    {A : Set γ} (hA : MeasurableSet[countableFiltration γ n] A) :
    ∫ x in A, densityProcess κ ν m a x s ∂(ν a) = (κ a (A ×ˢ s)).toReal

{κ : ProbabilityTheory.Kernel α (γ × β)}

∫ (x : γ) in A, κ.densityProcess ν m a x s ∂ν a = ((κ a) (A ×ˢ s)).toReal


/-- Adding the result of subtracting from another point produces that
point. -/
@[simp]
theorem vsub_vadd (p₁ p₂ : P) : p₁ -ᵥ p₂ +ᵥ p₂ = p₁

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


theorem prev_lt_of_pos (s : String) (i : Pos) (h : i ≠ 0) : (s.prev i).1 < i.1

(s : String)
(i : String.Pos)
(h : i ≠ 0)


/--
As `0` is the default value for `Real.sInf` of the empty set or sets which are not bounded below, it
suffices to show that `S` is bounded above by `0` to show that `sInf S ≤ 0`.
-/
theorem sInf_nonpos (S : Set ℝ) (hS : ∀ x ∈ S, x ≤ (0 : ℝ)) : sInf S ≤ 0


theorem _root_.Set.Finite.nullMeasurableSet_biInter {f : ι → Set α} {s : Set ι} (hs : s.Finite)
    (h : ∀ b ∈ s, NullMeasurableSet (f b) μ) : NullMeasurableSet (⋂ b ∈ s, f b) μ

(h : ∀ b ∈ s, MeasureTheory.NullMeasurableSet (f b) μ)

MeasureTheory.NullMeasurableSet (⋂ b ∈ s, f b) μ


theorem top_prod (s : Subsemiring S) : (⊤ : Subsemiring R).prod s = s.comap (RingHom.snd R S)

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
(s : Subsemiring S)

⊤.prod s = Subsemiring.comap (RingHom.snd R S) s


/-- If every element belongs to at most `n` Finsets, then the sum of their sizes is at most `n`
times how many they are. -/
theorem sum_card_le [Fintype α] (h : ∀ a, (B.filter (a ∈ ·)).card ≤ n) :
    ∑ s ∈ B, s.card ≤ Fintype.card α * n

(h : ∀ (a : α), (Finset.filter (fun x => a ∈ x) B).card ≤ n)


@[simp]
theorem Equiv.asEmbedding_range {α β : Sort _} {p : β → Prop} (e : α ≃ Subtype p) :
    Set.range e.asEmbedding = setOf p

{α : Sort u_1}
{β : Type u_2}
{p : β → Prop}
(e : α ≃ Subtype p)


/-- The same-universe version of `lift_rank_le_of_injective_injective`. -/
theorem rank_le_of_injective_injective (i : R' → R) (j : M →+ M₁)
    (hi : ∀ r, i r = 0 → r = 0) (hj : Injective j)
    (hc : ∀ (r : R') (m : M), j (i r • m) = r • j m) :
    Module.rank R M ≤ Module.rank R' M₁


theorem UniformContinuous₂.comp {f : α → β → γ} {g : γ → δ} (hg : UniformContinuous g)
    (hf : UniformContinuous₂ f) : UniformContinuous₂ (g ∘₂ f)

{α : Type ua}
{β : Type ub}
{γ : Type uc}
{δ : Type ud}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
[UniformSpace δ]
{f : α → β → γ}
{g : γ → δ}
(hg : UniformContinuous g)
(hf : UniformContinuous₂ f)

UniformContinuous₂ (Function.bicompr g f)


@[simp]
theorem cons_zero : cons x p 0 = x

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


@[simp]
theorem image_id_eq : image (id : α → α) = id


theorem StrictAntiOn.le_iff_le (hf : StrictAntiOn f s) {a b : α} (ha : a ∈ s) (hb : b ∈ s) :
    f a ≤ f b ↔ b ≤ a

{α : Type u}
{β : Type v}
[LinearOrder α]
[Preorder β]
{f : α → β}
{s : Set α}
(hf : StrictAntiOn f s)
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)


theorem LiftRel.swap (R : α → β → Prop) : swap (LiftRel R) = LiftRel (swap R)

{α : Type u}
{β : Type v}
(R : α → β → Prop)

Function.swap (Stream'.WSeq.LiftRel R) = Stream'.WSeq.LiftRel (Function.swap R)


@[to_additive nsmul_le_nsmul_iff_left]
theorem pow_le_pow_iff_right' (ha : 1 < a) : a ^ m ≤ a ^ n ↔ m ≤ n

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

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


theorem Monotone.prod_map (hf : Monotone f) (hg : Monotone g) : Monotone (Prod.map f g)

{α : Type u}
{β : Type v}
{γ : Type w}
{δ : Type u_2}
[Preorder α]
[Preorder β]
[Preorder γ]
[Preorder δ]
{f : α → γ}
{g : β → δ}
(hf : Monotone f)
(hg : Monotone g)


/-- `HomOrthogonal.matrixDecomposition` as an additive equivalence. -/
@[simps!]
noncomputable def matrixDecompositionAddEquiv (o : HomOrthogonal s) {α β : Type} [Finite α]
    [Finite β] {f : α → ι} {g : β → ι} :
    ((⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)) ≃+
      ∀ i : ι, Matrix (g ⁻¹' {i}) (f ⁻¹' {i}) (End (s i))

(z : (i : ι) → Matrix (↑(g ⁻¹' {i})) (↑(f ⁻¹' {i})) (CategoryTheory.End (s i)))

o.matrixDecompositionAddEquiv.symm z =
  CategoryTheory.Limits.biproduct.matrix fun j k =>
    if h : f j = g k then CategoryTheory.CategoryStruct.comp (z (f j) ⟨k, ⋯⟩ ⟨j, ⋯⟩) (CategoryTheory.eqToHom ⋯) else 0


@[simp] theorem self_comp_symm (e : α ≃ β) : e ∘ e.symm = id


theorem image_image_val_eq_restrict_image {δ : Type*} {f : α → δ} : f '' γ = β.restrict f '' γ

{α : Type u}
{β : Set α}
{γ : Set ↑β}
{δ : Type u_1}
{f : α → δ}


lemma card_eq_card_isUnramifiedIn [NumberField k] [IsGalois k K] :
    Fintype.card (InfinitePlace K) =
      Finset.card (Finset.univ.filter <| IsUnramifiedIn K (k := k)) * finrank k K +
      Finset.card (Finset.univ.filter <| IsUnramifiedIn K (k := k))ᶜ * (finrank k K / 2)

(k : Type u_1)
[Field k]
(K : Type u_2)
[Field K]
[NumberField K]
[Algebra k K]
[NumberField k]
[IsGalois k K]

Fintype.card (NumberField.InfinitePlace K) =
  (Finset.filter (NumberField.InfinitePlace.IsUnramifiedIn K) Finset.univ).card * FiniteDimensional.finrank k K +
    (Finset.filter (NumberField.InfinitePlace.IsUnramifiedIn K) Finset.univ)ᶜ.card * (FiniteDimensional.finrank k K / 2)


/-- Whisker a bicone with an equivalence between the indexing types. -/
@[simps]
def whisker {f : J → C} (c : Bicone f) (g : K ≃ J) : Bicone (f ∘ g)


theorem sqrt_normSq_eq_norm {z : K} : √(normSq z) = ‖z‖


theorem restrict_congr_mono (hs : s ⊆ t) (h : μ.restrict t = ν.restrict t) :
    μ.restrict s = ν.restrict s

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{s t : Set α}
(hs : s ⊆ t)
(h : μ.restrict t = ν.restrict t)


theorem comp_symm_eq {α β γ} (e : α ≃ β) (f : β → γ) (g : α → γ) : g ∘ e.symm = f ↔ g = f ∘ e

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
(e : α ≃ β)
(f : β → γ)
(g : α → γ)


theorem eventually_ne_nhds [T1Space X] {a b : X} (h : a ≠ b) : ∀ᶠ x in 𝓝 a, x ≠ b

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{a b : X}
(h : a ≠ b)


@[continuity]
theorem Continuous.matrix_col {ι : Type*} {A : X → n → R} (hA : Continuous A) :
    Continuous fun x => col ι (A x)

{X : Type u_1}
{n : Type u_5}
{R : Type u_8}
[TopologicalSpace X]
[TopologicalSpace R]
{ι : Type u_11}
{A : X → n → R}
(hA : Continuous A)


theorem swapTrue_eq_true (x : I → Bool) : SwapTrue o x (term I ho) = true

(ho : o < Ordinal.type fun x x_1 => x < x_1)

Profinite.NobelingProof.SwapTrue o x (Profinite.NobelingProof.term I ho) = true


/-- The sine of the angle between two vectors, multiplied by the
product of their norms. -/
theorem sin_angle_mul_norm_mul_norm (x y : V) :
    Real.sin (angle x y) * (‖x‖ * ‖y‖) = √(⟪x, x⟫ * ⟪y, y⟫ - ⟪x, y⟫ * ⟪x, y⟫)

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
(x y : V)

Real.sin (InnerProductGeometry.angle x y) * (‖x‖ * ‖y‖) = √(⟪x, x⟫_ℝ * ⟪y, y⟫_ℝ - ⟪x, y⟫_ℝ * ⟪x, y⟫_ℝ)


theorem mdifferentiableWithinAt_id : MDifferentiableWithinAt I I (@id M) s x

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


theorem length_mul_right_ne (w : W) : ℓ (t * w) ≠ ℓ w

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


theorem proj_comp_stdBasis (i j : ι) : (proj i).comp (stdBasis R φ j) = diag j i

(R : Type u_1)
{ι : Type u_2}
[Semiring R]
(φ : ι → Type u_3)
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
[DecidableEq ι]
(i j : ι)

LinearMap.proj i ∘ₗ LinearMap.stdBasis R φ j = LinearMap.diag j i


@[to_additive]
theorem ite_one_mul {P : Prop} [Decidable P] {a b : M} :
    ite P 1 (a * b) = ite P 1 a * ite P 1 b

{M : Type u}
[MulOneClass M]
{P : Prop}
[Decidable P]
{a b : M}

(if P then 1 else a * b) = (if P then 1 else a) * if P then 1 else b


lemma erase_eq_iff_eq_insert (hs : a ∈ s) (ht : a ∉ t) : erase s a = t ↔ s = insert a t

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


@[to_additive (attr := simp) toProd_zero]
theorem toProd_one : (1 : NonemptyInterval α).toProd = 1


@[to_additive]
protected theorem UniformGroup.comap {γ : Type*} [Group γ] {u : UniformSpace γ} [UniformGroup γ]
    {F : Type*} [FunLike F β γ] [MonoidHomClass F β γ] (f : F) : @UniformGroup β (u.comap f) _

{β : Type u_2}
[AddGroup β]
{γ : Type u_3}
[AddGroup γ]
{u : UniformSpace γ}
[UniformAddGroup γ]
{F : Type u_4}
[FunLike F β γ]
[AddMonoidHomClass F β γ]
(f : F)


theorem forall_subtype_range_iff {p : range f → Prop} :
    (∀ a : range f, p a) ↔ ∀ i, p ⟨f i, mem_range_self _⟩

{α : Type u_1}
{ι : Sort u_4}
{f : ι → α}
{p : ↑(Set.range f) → Prop}

(∀ (a : ↑(Set.range f)), p a) ↔ ∀ (i : ι), p ⟨f i, ⋯⟩


theorem sum_sub_index [AddCommGroup β] [AddCommGroup γ] {f g : α →₀ β} {h : α → β → γ}
    (h_sub : ∀ a b₁ b₂, h a (b₁ - b₂) = h a b₁ - h a b₂) : (f - g).sum h = f.sum h - g.sum h

{h : α → β → γ}

(h_sub : ∀ (a : α) (b₁ b₂ : β), h a (b₁ - b₂) = h a b₁ - h a b₂)


theorem iUnion_cylinder_update (x : ∀ n, E n) (n : ℕ) :
    ⋃ k, cylinder (update x n k) (n + 1) = cylinder x n

{E : ℕ → Type u_1}
(x : (n : ℕ) → E n)
(n : ℕ)

⋃ k, PiNat.cylinder (Function.update x n k) (n + 1) = PiNat.cylinder x n


@[simp]
protected theorem summable : Summable f


@[simp] theorem ofBool_false : ofBool false = 0


theorem eq_lim_of_const_equiv {f : CauSeq β abv} {x : β} (h : CauSeq.const abv x ≈ f) : x = lim f

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
[CauSeq.IsComplete β abv]
{f : CauSeq β abv}
{x : β}
(h : CauSeq.const abv x ≈ f)


@[to_additive] -- Porting note (#10618): simp can prove this (so removed simp)
theorem powCoprime_one {G : Type*} [Group G] (h : (Nat.card G).Coprime n) : powCoprime h 1 = 1

{n : ℕ}
{G : Type u_6}
[Group G]
(h : (Nat.card G).Coprime n)


theorem _root_.intCast_memℓp_infty (z : ℤ) : Memℓp (z : ∀ i, B i) ∞

{I : Type u_3}
{B : I → Type u_4}
[(i : I) → NormedRing (B i)]
[∀ (i : I), NormOneClass (B i)]
(z : ℤ)


theorem wellPowered_of_essentiallySmall_monoOver (h : ∀ X : C, EssentiallySmall.{v} (MonoOver X)) :
    WellPowered C

(h : ∀ (X : C), CategoryTheory.EssentiallySmall.{v, v, max u₁ v} (CategoryTheory.MonoOver X))


lemma mul_eq_mul_of_div_eq_div (a c : G₀) (hb : b ≠ 0) (hd : d ≠ 0)
    (h : a / b = c / d) : a * d = c * b

{G₀ : Type u_3}
[CommGroupWithZero G₀]
{b d : G₀}
(a c : G₀)
(hb : b ≠ 0)
(hd : d ≠ 0)
(h : a / b = c / d)


theorem scalar_inj [Nonempty n] {r s : α} : scalar n r = scalar n s ↔ r = s

{n : Type u_3}
{α : Type v}
[Semiring α]
[DecidableEq n]
[Fintype n]
[Nonempty n]
{r s : α}

(Matrix.scalar n) r = (Matrix.scalar n) s ↔ r = s


lemma IsPath.tail {p : G.Walk u v} (hp : p.IsPath) (hp' : ¬ p.Nil) : (p.tail hp').IsPath

{V : Type u}
{G : SimpleGraph V}
{u v : V}
{p : G.Walk u v}
(hp : p.IsPath)
(hp' : ¬p.Nil)


@[to_additive (attr := simp)]
lemma toUnits_val_apply {G : Type*} [Group G] (x : Gˣ) : toUnits (x : G) = x

{G : Type u_12}
[AddGroup G]
(x : AddUnits G)


@[simp]
theorem torsionBy_torsionBy_eq_top : torsionBy R (torsionBy R M a) a = ⊤

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(a : R)

Submodule.torsionBy R (↥(Submodule.torsionBy R M a)) a = ⊤


@[simp]
theorem Orientation.map_apply (e : M ≃ₗ[R] N) (v : M [⋀^ι]→ₗ[R] R) (hv : v ≠ 0) :
    Orientation.map ι e (rayOfNeZero _ v hv) =
      rayOfNeZero _ (v.compLinearMap e.symm) (mt (v.compLinearEquiv_eq_zero_iff e.symm).mp hv)

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
(ι : Type u_4)
(e : M ≃ₗ[R] N)
(v : M [⋀^ι]→ₗ[R] R)
(hv : v ≠ 0)

(Orientation.map ι e) (rayOfNeZero R v hv) = rayOfNeZero R (v.compLinearMap ↑e.symm) ⋯


@[simp, norm_cast]
theorem coe_mul (x y : s) : (↑(x * y) : K) = ↑x * ↑y

{K : Type u}
[DivisionRing K]
(s : Subfield K)
(x y : ↥s)


theorem mem_sInf {S : Set (NonUnitalStarSubalgebra R A)} {x : A} : x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
{S : Set (NonUnitalStarSubalgebra R A)}
{x : A}


/-- See also `Cardinal.nsmul_lt_aleph0_iff` for a hypothesis-free version. -/
theorem nsmul_lt_aleph0_iff_of_ne_zero {n : ℕ} {a : Cardinal} (h : n ≠ 0) : n • a < ℵ₀ ↔ a < ℵ₀

{n : ℕ}
{a : Cardinal.{u_1}}
(h : n ≠ 0)

n • a < Cardinal.aleph0 ↔ a < Cardinal.aleph0


theorem _root_.IsUnit.mem_unitary_of_star_mul_self  {u : R} (hu : IsUnit u)
    (h_mul : star u * u = 1) : u ∈ unitary R

{R : Type u_1}
[Monoid R]
[StarMul R]
{u : R}
(hu : IsUnit u)
(h_mul : star u * u = 1)


lemma l2_opNorm_mulVec (A : Matrix m n 𝕜) (x : EuclideanSpace 𝕜 n) :
    ‖(EuclideanSpace.equiv m 𝕜).symm <| A *ᵥ x‖ ≤ ‖A‖ * ‖x‖

{𝕜 : Type u_1}
{m : Type u_2}
{n : Type u_3}
[RCLike 𝕜]
[Fintype m]
[Fintype n]
[DecidableEq n]
(A : Matrix m n 𝕜)
(x : EuclideanSpace 𝕜 n)

‖(EuclideanSpace.equiv m 𝕜).symm (A *ᵥ x)‖ ≤ ‖A‖ * ‖x‖


theorem isGLB_lt_iff (h : IsGLB s a) : a < b ↔ ∃ c ∈ s, c < b

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


theorem opNorm_le_of_shell {f : E →SL[σ₁₂] F} {ε C : ℝ} (ε_pos : 0 < ε) (hC : 0 ≤ C) {c : 𝕜}
    (hc : 1 < ‖c‖) (hf : ∀ x, ε / ‖c‖ ≤ ‖x‖ → ‖x‖ < ε → ‖f x‖ ≤ C * ‖x‖) : ‖f‖ ≤ C

{σ₁₂ : 𝕜 →+* 𝕜₂}

(hf : ∀ (x : E), ε / ‖c‖ ≤ ‖x‖ → ‖x‖ < ε → ‖f x‖ ≤ C * ‖x‖)


theorem orbitRel_conjAct : (orbitRel (ConjAct G) G).Rel = IsConj

(MulAction.orbitRel (ConjAct G) G).Rel = IsConj


@[reassoc (attr := simp)]
lemma leftUnitor_naturality (φ : X ⟶ X') :
    tensorHom (𝟙 (tensorUnit)) φ ≫ (leftUnitor X').hom =
      (leftUnitor X).hom ≫ φ

[(X₂ : C) →
    CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C)
      ((CategoryTheory.MonoidalCategory.curriedTensor C).flip.obj X₂)]

{X X' : CategoryTheory.GradedObject I C}

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.GradedObject.Monoidal.tensorHom
      (CategoryTheory.CategoryStruct.id CategoryTheory.GradedObject.Monoidal.tensorUnit) φ)
    (CategoryTheory.GradedObject.Monoidal.leftUnitor X').hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.leftUnitor X).hom φ


theorem abs_sub_nonpos : |a - b| ≤ 0 ↔ a = b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{a b : α}


theorem orderIsoMapComap_apply' (e : M ≃ₛₗ[τ₁₂] M₂) (p : Submodule R M) :
    orderIsoMapComap e p = comap e.symm p

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{τ₂₁ : R₂ →+* R}
[RingHomInvPair τ₁₂ τ₂₁]
[RingHomInvPair τ₂₁ τ₁₂]
(e : M ≃ₛₗ[τ₁₂] M₂)
(p : Submodule R M)

(Submodule.orderIsoMapComap e) p = Submodule.comap e.symm p


@[to_additive]
theorem pi_mem_of_mulSingle_mem_aux [DecidableEq η] (I : Finset η) {H : Subgroup (∀ i, f i)}
    (x : ∀ i, f i) (h1 : ∀ i, i ∉ I → x i = 1) (h2 : ∀ i, i ∈ I → Pi.mulSingle i (x i) ∈ H) :
    x ∈ H

{η : Type u_3}
{f : η → Type u_4}
[(i : η) → AddGroup (f i)]
[DecidableEq η]
(I : Finset η)
{H : AddSubgroup ((i : η) → f i)}
(x : (i : η) → f i)
(h1 : ∀ i ∉ I, x i = 0)
(h2 : ∀ i ∈ I, Pi.single i (x i) ∈ H)


lemma toOpen_comp_locallyRingedSpaceAdjunction_homEquiv_app
    {X : LocallyRingedSpace} {R : Type u} [CommRing R]
    (f : Γ.rightOp.obj X ⟶ op (CommRingCat.of R)) (U) :
    StructureSheaf.toOpen R U.unop ≫
      (locallyRingedSpaceAdjunction.homEquiv X (op <| CommRingCat.of R) f).1.c.app U =
    f.unop ≫ X.presheaf.map (homOfLE le_top).op

(f : AlgebraicGeometry.LocallyRingedSpace.Γ.rightOp.obj X ⟶ Opposite.op (CommRingCat.of R))

(U :
  (TopologicalSpace.Opens
      ↑↑(AlgebraicGeometry.Spec.toLocallyRingedSpace.obj (Opposite.op (CommRingCat.of R))).toPresheafedSpace)ᵒᵖ)

CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.StructureSheaf.toOpen R (Opposite.unop U))
    (((AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction.homEquiv X (Opposite.op (CommRingCat.of R))) f).val.c.app
      U) =
  CategoryTheory.CategoryStruct.comp f.unop (X.presheaf.map (CategoryTheory.homOfLE ⋯).op)


@[simp]
theorem mem_subalgebraOfSubring {x : R} {S : Subring R} : x ∈ subalgebraOfSubring S ↔ x ∈ S

{R : Type u_1}
[Ring R]
{x : R}
{S : Subring R}


theorem HasMFDerivWithinAt.union (hs : HasMFDerivWithinAt I I' f s x f')
    (ht : HasMFDerivWithinAt I I' f t x f') : HasMFDerivWithinAt I I' f (s ∪ t) x f'

{f' : TangentSpace I x →L[𝕜] TangentSpace I' (f x)}


theorem coe_fst' (ex : proj x ∈ e.baseSet) : (e x).1 = proj x

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
(e : Pretrivialization F proj)
{x : Z}
(ex : proj x ∈ e.baseSet)


@[simp]
lemma span_eq_toSubmodule (s : NonUnitalSubalgebra R A) :
    Submodule.span R (s : Set A) = s.toSubmodule

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
(s : NonUnitalSubalgebra R A)


@[simp]
theorem smul_mk (re im_i im_j im_k : R) :
    s • (⟨re, im_i, im_j, im_k⟩ : ℍ[R,c₁,c₂]) = ⟨s • re, s • im_i, s • im_j, s • im_k⟩

{S : Type u_1}
{R : Type u_3}
{c₁ c₂ : R}
[SMul S R]
(s : S)
(re im_i im_j im_k : R)

s • { re := re, imI := im_i, imJ := im_j, imK := im_k } =
  { re := s • re, imI := s • im_i, imJ := s • im_j, imK := s • im_k }


theorem finite_mul_aux {p : α} (hp : Prime p) {a b : α} :
    ∀ {n m : ℕ}, ¬p ^ (n + 1) ∣ a → ¬p ^ (m + 1) ∣ b → ¬p ^ (n + m + 1) ∣ a * b

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p : α}
(hp : Prime p)
{a b : α}
{n m : ℕ}


@[simp]
theorem normSq_to_complex {x : ℂ} : norm_sqC x = Complex.normSq x


theorem filter_eq_indicator : ⇑(f.filter p) = Set.indicator { x | p x } f

{α : Type u_1}
{M : Type u_5}
[Zero M]
(p : α → Prop)
[DecidablePred p]
(f : α →₀ M)

⇑(Finsupp.filter p f) = {x | p x}.indicator ⇑f


@[simp]
theorem rangeS_subtype (s : Subsemiring R) : s.subtype.rangeS = s

{R : Type u}
[NonAssocSemiring R]
(s : Subsemiring R)


@[simp]
theorem comap_top (f : A →ₐ[R] B) : (⊤ : Subalgebra R B).comap f = ⊤

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


/-- Local equivalence between subsets `source` and `target` of `α` and `β` respectively. The
(global) maps `toFun : α → β` and `invFun : β → α` map `source` to `target` and conversely, and are
inverse to each other there. The values of `toFun` outside of `source` and of `invFun` outside of
`target` are irrelevant. -/
structure PartialEquiv (α : Type*) (β : Type*) where
  /-- The global function which has a partial inverse. Its value outside of the `source` subset is
  irrelevant. -/
  toFun : α → β
  /-- The partial inverse to `toFun`. Its value outside of the `target` subset is irrelevant. -/
  invFun : β → α
  /-- The domain of the partial equivalence. -/
  source : Set α
  /-- The codomain of the partial equivalence. -/
  target : Set β
  /-- The proposition that elements of `source` are mapped to elements of `target`. -/
  map_source' : ∀ ⦃x⦄, x ∈ source → toFun x ∈ target
  /-- The proposition that elements of `target` are mapped to elements of `source`. -/
  map_target' : ∀ ⦃x⦄, x ∈ target → invFun x ∈ source
  /-- The proposition that `invFun` is a left-inverse of `toFun` on `source`. -/
  left_inv' : ∀ ⦃x⦄, x ∈ source → invFun (toFun x) = x
  /-- The proposition that `invFun` is a right-inverse of `toFun` on `target`. -/
  right_inv' : ∀ ⦃x⦄, x ∈ target → toFun (invFun x) = x

{α : Type u_5}
{β : Type u_6}
(self : PartialEquiv α β)
⦃x : β⦄

x ∈ self.target → self.invFun x ∈ self.source


theorem not_dvd_one_of_finite_one_right {a : α} : Finite a 1 → ¬a ∣ 1


theorem get_nats (n : ℕ) : get nats n = n


theorem roots_ne_zero_of_splits {f : K[X]} (hs : Splits i f) (hf0 : natDegree f ≠ 0) :
    (f.map i).roots ≠ 0

{K : Type v}
{L : Type w}
[Field K]
[Field L]
(i : K →+* L)
{f : K[X]}
(hs : Polynomial.Splits i f)
(hf0 : f.natDegree ≠ 0)


lemma le_nhds_iff_forall_inner_apply_le_nhds [CompleteSpace F] {l : Filter (E →WOT[𝕜] F)}
    {A : E →WOT[𝕜] F} : l ≤ 𝓝 A ↔ ∀ x y, l.map (fun T => ⟪y, T x⟫_𝕜) ≤ 𝓝 (⟪y, A x⟫_𝕜)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{l : Filter (E →WOT[𝕜]F)}
{A : E →WOT[𝕜]F}

l ≤ 𝓝 A ↔ ∀ (x : E) (y : F), Filter.map (fun T => ⟪y, T x⟫_𝕜) l ≤ 𝓝 ⟪y, A x⟫_𝕜


@[simp]
theorem coe_toIocMod (θ ψ : ℝ) : ↑(toIocMod two_pi_pos ψ θ) = (θ : Angle)


/-- If `C.d i j` and `C.d i' j` are both allowed, then we must have `i = i'`,
and so the differentials only differ by an `eqToHom`.
-/
theorem eqToHom_comp_d {i i' j : ι} (rij : c.Rel i j) (rij' : c.Rel i' j) :
    eqToHom (congr_arg C.X (c.prev_eq rij rij')) ≫ C.d i' j = C.d i j

CategoryTheory.eqToHom ⋯ ≫ C.d i' j = C.d i j


lemma insert_indep_iff : M.Indep (insert e I) ↔ M.Indep I ∧ (e ∉ I → e ∈ M.E \ M.closure I)

{α : Type u_2}
{M : Matroid α}
{e : α}
{I : Set α}


theorem cos_sub_pi (x : ℂ) : cos (x - π) = -cos x

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


/-- An equivalence between `ℕ ⊕ ℕ` and `ℕ`, by mapping `(Sum.inl x)` to `2 * x` and `(Sum.inr x)` to
`2 * x + 1`.
-/
@[simps! symm_apply]
def natSumNatEquivNat : ℕ ⊕ ℕ ≃ ℕ

∀ (a : ℕ), Equiv.natSumNatEquivNat.symm a = Bool.rec (Sum.inl a.div2) (Sum.inr a.div2) a.bodd


theorem not_mem_singleton {a b : α} : a ∉ ({b} : Finset α) ↔ a ≠ b


@[simp]
theorem id_apply (m : M) : (𝟙 M : M → M) m = m

{R : Type u}
[Ring R]
{M : ModuleCat R}
(m : ↑M)


@[simp] theorem getMsb_cons_succ : (cons a x).getMsb (i + 1) = x.getMsb i

∀ {w : Nat} {x : BitVec w} {i : Nat}, (BitVec.cons a x).getMsb (i + 1) = x.getMsb i


protected theorem isLinearOrder : ∀ (_ : r ↪r s) [IsLinearOrder β s], IsLinearOrder α r

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

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


theorem chain'_adj_support {u v : V} : ∀ (p : G.Walk u v), List.Chain' G.Adj p.support

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(p : G.Walk u v)


theorem reachable_iff_nonempty_univ {u v : V} :
    G.Reachable u v ↔ (Set.univ : Set (G.Walk u v)).Nonempty

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


theorem image_coe_Ioi : (some : α → WithBot α) '' Ioi a = Ioi (a : WithBot α)


theorem sort_univ (n : ℕ) : Finset.univ.sort (fun x y : Fin n => x ≤ y) = List.finRange n

Finset.sort (fun x y => x ≤ y) Finset.univ = List.finRange n


/-- For `S : Set α` and `V : Set (β × β)`, we have
`UniformOnFun.gen 𝔖 S V = (S.restrict × S.restrict) ⁻¹' (UniformFun.gen S β V)`.
This is the crucial fact for proving that the family `UniformOnFun.gen S V` for `S ∈ 𝔖` and
`V ∈ 𝓤 β` is indeed a basis for the uniformity `α →ᵤ[𝔖] β` endowed with `𝒱(α, β, 𝔖, uβ)`
the uniform structure of `𝔖`-convergence, as defined in `UniformOnFun.uniformSpace`. -/
protected theorem gen_eq_preimage_restrict {𝔖} (S : Set α) (V : Set (β × β)) :
    UniformOnFun.gen 𝔖 S V =
      Prod.map (S.restrict ∘ UniformFun.toFun) (S.restrict ∘ UniformFun.toFun) ⁻¹'
        UniformFun.gen S β V

{α : Type u_1}
{β : Type u_2}
{𝔖 : Set (Set α)}
(S : Set α)
(V : Set (β × β))

UniformOnFun.gen 𝔖 S V =
  Prod.map (S.restrict ∘ ⇑UniformFun.toFun) (S.restrict ∘ ⇑UniformFun.toFun) ⁻¹' UniformFun.gen (↑S) β V


@[simp, norm_cast]
lemma coe_sSup (s : Set G.Finsubgraph) : sSup s = (⨆ G ∈ s, G : G.Subgraph)

{V : Type u}
{G : SimpleGraph V}
[Finite V]
(s : Set G.Finsubgraph)


@[to_additive]
theorem pairwise_disjoint_Ioc_zpow :
    Pairwise (Disjoint on fun n : ℤ => Ioc (b ^ n) (b ^ (n + 1)))

{α : Type u_1}
[OrderedAddCommGroup α]
(b : α)

Pairwise (Disjoint on fun n => Set.Ioc (n • b) ((n + 1) • b))


theorem algebraMap_smul [SMul R M] [IsScalarTower R A M] (r : R) (x : M) :
    algebraMap R A r • x = r • x

{R : Type u}
(A : Type w)
{M : Type v₁}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[MulAction A M]
[SMul R M]
[IsScalarTower R A M]
(r : R)
(x : M)


/-- When `f` is an embedding we have an embedding `(α →₀ ℕ) ↪ (β →₀ ℕ)` given by `mapDomain`. -/
@[simps]
def mapDomainEmbedding {α β : Type*} (f : α ↪ β) : (α →₀ ℕ) ↪ β →₀ ℕ

{α : Type u_13}
{β : Type u_14}
(f : α ↪ β)
(v : α →₀ ℕ)

(Finsupp.mapDomainEmbedding f) v = Finsupp.mapDomain (⇑f) v


lemma comap_symm (G : SimpleGraph V) (e : V ≃ W) :
    G.comap e.symm.toEmbedding = G.map e.toEmbedding

{V : Type u_1}
{W : Type u_2}
(G : SimpleGraph V)
(e : V ≃ W)

SimpleGraph.comap (⇑e.symm.toEmbedding) G = SimpleGraph.map e.toEmbedding G


theorem bind_bind {γ} [MeasurableSpace γ] {m : Measure α} {f : α → Measure β} {g : β → Measure γ}
    (hf : Measurable f) (hg : Measurable g) : bind (bind m f) g = bind m fun a => bind (f a) g

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{γ : Type u_3}
[MeasurableSpace γ]
{m : MeasureTheory.Measure α}
{f : α → MeasureTheory.Measure β}
{g : β → MeasureTheory.Measure γ}
(hf : Measurable f)
(hg : Measurable g)

(m.bind f).bind g = m.bind fun a => (f a).bind g


@[simp]
theorem map_sup : (N ⊔ N₂).map f = N.map f ⊔ N₂.map f

{R : Type u}
{L : Type v}
{M : Type w}
{M' : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup M']
[Module R M']
[LieRingModule L M']
{f : M →ₗ⁅R,L⁆ M'}
{N N₂ : LieSubmodule R L M}

LieSubmodule.map f (N ⊔ N₂) = LieSubmodule.map f N ⊔ LieSubmodule.map f N₂


theorem locallyIntegrable_map_homeomorph [BorelSpace X] [BorelSpace Y] (e : X ≃ₜ Y) {f : Y → E}
    {μ : Measure X} : LocallyIntegrable f (Measure.map e μ) ↔ LocallyIntegrable (f ∘ e) μ

{X : Type u_1}
{Y : Type u_2}
{E : Type u_3}
[MeasurableSpace X]
[TopologicalSpace X]
[MeasurableSpace Y]
[TopologicalSpace Y]
[NormedAddCommGroup E]
[BorelSpace X]
[BorelSpace Y]
(e : X ≃ₜ Y)
{f : Y → E}
{μ : MeasureTheory.Measure X}

MeasureTheory.LocallyIntegrable f (MeasureTheory.Measure.map (⇑e) μ) ↔ MeasureTheory.LocallyIntegrable (f ∘ ⇑e) μ


/-- Multiplicative congruence relations preserve product indexed by a multiset. -/
@[to_additive "Additive congruence relations preserve sum indexed by a multiset."]
protected theorem multiset_prod {ι M : Type*} [CommMonoid M] (c : Con M) {s : Multiset ι}
    {f g : ι → M} (h : ∀ x ∈ s, c (f x) (g x)) :
    c (s.map f).prod (s.map g).prod

{ι : Type u_1}
{M : Type u_2}
[CommMonoid M]
(c : Con M)
{s : Multiset ι}
{f g : ι → M}
(h : ∀ x ∈ s, c (f x) (g x))

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


@[simp, norm_cast] theorem Nat.cast_ofNat_Int :
  (Nat.cast (no_index (OfNat.ofNat n)) : Int) = OfNat.ofNat n


private theorem newton_seq_dist_to_a :
    ∀ n : ℕ, 0 < n → ‖newton_seq n - a‖ = ‖F.eval a‖ / ‖F.derivative.eval a‖

(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)

0 < n → ‖newton_seq_gen hnorm n - a‖ = ‖Polynomial.eval a F‖ / ‖Polynomial.eval a (Polynomial.derivative F)‖


@[reassoc (attr := simp)]
theorem homotopyEquiv_hom_ι {X : C} (I J : InjectiveResolution X) :
    I.ι ≫ (homotopyEquiv I J).hom = J.ι

(I J : CategoryTheory.InjectiveResolution X)


/-- Functors from `Discrete PUnit` are equivalent to the category itself. -/
@[simps]
def equiv : Discrete PUnit.{w + 1} ⥤ C ≌ C

(F : CategoryTheory.Functor (CategoryTheory.Discrete PUnit.{w + 1}) C)

CategoryTheory.Functor.equiv.functor.obj F = F.obj { as := PUnit.unit }


/-- Partial sums of an alternating monotone series with an odd number of terms provide
lower bounds on the limit. -/
theorem Monotone.alternating_series_le_tendsto
    (hfl : Tendsto (fun n ↦ ∑ i ∈ range n, (-1) ^ i * f i) atTop (𝓝 l))
    (hfm : Monotone f) (k : ℕ) : ∑ i ∈ range (2 * k + 1), (-1) ^ i * f i ≤ l

(hfl : Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) Filter.atTop (𝓝 l))

∑ i ∈ Finset.range (2 * k + 1), (-1) ^ i * f i ≤ l


private theorem edgeDensity_chunk_aux [Nonempty α]
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    (hU : U ∈ P.parts) (hV : V ∈ P.parts) :
    (G.edgeDensity U V : ℝ) ^ 2 - ε ^ 5 / ↑25 ≤
    ((∑ ab ∈ (chunk hP G ε hU).parts.product (chunk hP G ε hV).parts,
      (G.edgeDensity ab.1 ab.2 : ℝ)) / ↑16 ^ P.parts.card) ^ 2

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

↑(G.edgeDensity U V) ^ 2 - ε ^ 5 / 25 ≤
  ((∑ ab ∈ (SzemerediRegularity.chunk hP G ε hU).parts.product (SzemerediRegularity.chunk hP G ε hV).parts,
        ↑(G.edgeDensity ab.1 ab.2)) /
      16 ^ P.parts.card) ^
    2


@[simp]
theorem realize_zero (v : α → R) : Term.realize v (0 : ring.Term α) = 0

{α : Type u_1}
{R : Type u_2}
[Add R]
[Mul R]
[Neg R]
[One R]
[Zero R]
[FirstOrder.Ring.CompatibleRing R]
(v : α → R)

FirstOrder.Language.Term.realize v 0 = 0


/-- Shows that the fractional parts of the stream are smaller than one. -/
theorem nth_stream_fr_lt_one {ifp_n : IntFractPair K}
    (nth_stream_eq : IntFractPair.stream v n = some ifp_n) : ifp_n.fr < 1

(nth_stream_eq : GenContFract.IntFractPair.stream v n = some ifp_n)


lemma neg_one_pow_eq_one_iff_even {R : Type*} [Monoid R] [HasDistribNeg R] {n : ℕ}
    (h : (-1 : R) ≠ 1) : (-1 : R) ^ n = 1 ↔ Even n

{R : Type u_5}
[Monoid R]
[HasDistribNeg R]
{n : ℕ}
(h : -1 ≠ 1)


@[simp]
theorem maximum_nil : maximum ([] : List α) = ⊥

{α : Type u_1}
[Preorder α]
[DecidableRel fun x x_1 => x < x_1]


@[simp]
theorem sym2_singleton (a : α) : ({a} : Finset α).sym2 = {Sym2.diag a}


theorem Finset.card_lt_iff_ne_univ [Fintype α] (s : Finset α) :
    s.card < Fintype.card α ↔ s ≠ Finset.univ

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


@[to_additive]
theorem Monotone.mulIndicator_eventuallyEq_iUnion {ι} [Preorder ι] [One β] (s : ι → Set α)
    (hs : Monotone s) (f : α → β) (a : α) :
    (fun i => mulIndicator (s i) f a) =ᶠ[atTop] fun _ ↦ mulIndicator (⋃ i, s i) f a

{α : Type u_1}
{β : Type u_2}
{ι : Type u_5}
[Preorder ι]
[One β]
(s : ι → Set α)
(hs : Monotone s)
(f : α → β)
(a : α)

(fun i => (s i).mulIndicator f a) =ᶠ[Filter.atTop] fun x => (⋃ i, s i).mulIndicator f a


theorem self_le_of_strictMono (h : WellFounded ((· < ·) : β → β → Prop)) {f : β → β}
    (hf : StrictMono f) : ∀ n, n ≤ f n

{β : Type u_2}
[LinearOrder β]
(h : WellFounded fun x x_1 => x < x_1)
{f : β → β}
(hf : StrictMono f)
(n : β)


/-- A version of the **direct comparison test** for conditionally convergent series.
See `cauchySeq_finset_of_norm_bounded` for the same statement about absolutely convergent ones. -/
theorem cauchySeq_range_of_norm_bounded {f : ℕ → E} (g : ℕ → ℝ)
    (hg : CauchySeq fun n => ∑ i ∈ range n, g i) (hf : ∀ i, ‖f i‖ ≤ g i) :
    CauchySeq fun n => ∑ i ∈ range n, f i

(hg : CauchySeq fun n => ∑ i ∈ Finset.range n, g i)

CauchySeq fun n => ∑ i ∈ Finset.range n, f i


@[simp, norm_cast]
theorem coe_zero : ↑(0 : FractionalIdeal S P) = (⊥ : Submodule R P)

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]


/-- A fan over `f : β → C` consists of a collection of maps from an object `P` to every `f b`. -/
@[simps! pt π_app]
def Fan.mk {f : β → C} (P : C) (p : ∀ b, P ⟶ f b) : Fan f

{β : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : β → C}
(P : C)
(p : (b : β) → P ⟶ f b)
(X : CategoryTheory.Discrete β)

(CategoryTheory.Limits.Fan.mk P p).π.app X = p X.as


@[to_additive (attr := simp)]
theorem mk_smul_mk_aeeqFun (c : M) (f : α → β) (hf : AEStronglyMeasurable f μ) :
    mk c • AEEqFun.mk f hf = AEEqFun.mk (f <| c • ·)
      (hf.comp_measurePreserving (measurePreserving_smul _ _))

[MeasureTheory.SMulInvariantMeasure M α μ]

(hf : MeasureTheory.AEStronglyMeasurable f μ)

DomMulAct.mk c • MeasureTheory.AEEqFun.mk f hf = MeasureTheory.AEEqFun.mk (fun x => f (c • x)) ⋯


theorem card_Ioo_eq_card_Icc_sub_two (a b : α) : (Ioo a b).card = (Icc a b).card - 2

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

(Finset.Ioo a b).card = (Finset.Icc a b).card - 2


theorem hasStrictDerivAt_exp_smul_const_of_mem_ball (x : 𝔸) (t : 𝕂)
    (htx : t • x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    HasStrictDerivAt (fun u : 𝕂 => exp 𝕂 (u • x)) (exp 𝕂 (t • x) * x) t

(htx : t • x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

HasStrictDerivAt (fun u => NormedSpace.exp 𝕂 (u • x)) (NormedSpace.exp 𝕂 (t • x) * x) t


@[trans]
nonrec theorem trans (MN : M ≅[L] N) (NP : N ≅[L] P) : M ≅[L] P

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
{P : Type u_2}
[L.Structure M]
[L.Structure N]
[L.Structure P]
(MN : L.ElementarilyEquivalent M N)
(NP : L.ElementarilyEquivalent N P)


protected theorem exists_not_mem_col (μ : YoungDiagram) (j : ℕ) : ∃ i, (i, j) ∉ μ.cells


/-- `Setoid.quotientKerEquivOfRightInverse` as a homeomorphism. -/
@[simps!]
def Function.RightInverse.homeomorph {f' : C(Y, X)} (hf : Function.RightInverse f' f) :
    Quotient (Setoid.ker f) ≃ₜ Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : C(X, Y)}
{f' : C(Y, X)}
(hf : Function.RightInverse ⇑f' ⇑f)
(a : Quotient (Setoid.ker ⇑f))


protected theorem bijective : Bijective e

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


@[to_additive]
theorem mul_subset_iff_left : s * t ⊆ u ↔ ∀ a ∈ s, a • t ⊆ u

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


@[to_additive]
theorem mono_iff_ker_eq_bot : Mono f ↔ f.ker = ⊥

CategoryTheory.Mono f ↔ AddMonoidHom.ker f = ⊥


theorem ker_toSpanSingleton {x : M} (h : x ≠ 0) : LinearMap.ker (toSpanSingleton R M x) = ⊥

(R : Type u_1)
(M : Type u_4)
[Ring R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{x : M}
(h : x ≠ 0)

LinearMap.ker (LinearMap.toSpanSingleton R M x) = ⊥


theorem mapHom_comp (f : M →* N) {P : Type w} [Monoid P] (g : N →* P) :
    mapHom M P (g.comp f) = mapHom M N f ⋙ mapHom N P g

{M : Type u}
[Monoid M]
{N : Type v}
[Monoid N]
(f : M →* N)
{P : Type w}
[Monoid P]
(g : N →* P)

(CategoryTheory.SingleObj.mapHom M P) (g.comp f) =
  (CategoryTheory.SingleObj.mapHom M N) f ⋙ (CategoryTheory.SingleObj.mapHom N P) g


@[to_additive (attr := simp) zsmul_smul_addOrderOf]
theorem zpow_pow_orderOf : (x ^ i) ^ orderOf x = 1

{G : Type u_1}
[AddGroup G]
{x : G}
{i : ℤ}


theorem IntegrableOn.mono_set_ae (h : IntegrableOn f t μ) (hst : s ≤ᵐ[μ] t) : IntegrableOn f s μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{s t : Set α}
{μ : MeasureTheory.Measure α}
(h : MeasureTheory.IntegrableOn f t μ)
(hst : s ≤ᵐ[μ] t)


theorem mem_cons_self (a : α) (s : Sym α n) : a ∈ a ::ₛ s

{α : Type u_1}
{n : ℕ}
(a : α)
(s : Sym α n)


/-- Every homomorphism from a finitely presented module to a flat module factors through a finite
free module. -/
theorem exists_factorization_of_isFinitelyPresented [Flat R M] {P : Type u} [AddCommGroup P]
    [Module R P] [FinitePresentation R P] (h₁ : P →ₗ[R] M) :
      ∃ (κ : Type u) (_ : Fintype κ) (h₂ : P →ₗ[R] (κ →₀ R)) (h₃ : (κ →₀ R) →ₗ[R] M),
        h₁ = h₃ ∘ₗ h₂

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.Flat R M]
{P : Type u}
[AddCommGroup P]
[Module R P]
[Module.FinitePresentation R P]
(h₁ : P →ₗ[R] M)

∃ κ x h₂ h₃, h₁ = h₃ ∘ₗ h₂


theorem IsUniversalColimit.of_mapCocone (G : C ⥤ D) {F : J ⥤ C} {c : Cocone F}
    [PreservesLimitsOfShape WalkingCospan G] [ReflectsColimitsOfShape J G]
    (hc : IsUniversalColimit (G.mapCocone c)) : IsUniversalColimit c

(hc : CategoryTheory.IsUniversalColimit (G.mapCocone c))


@[simp]
theorem optionSubtype_apply_symm_apply
    [DecidableEq β] (x : β)
    (e : { e : Option α ≃ β // e none = x })
    (b : { y : β // y ≠ x }) : ↑((optionSubtype x e).symm b) = (e : Option α ≃ β).symm b

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : { e // e none = x })
(b : { y // y ≠ x })

some (((Equiv.optionSubtype x) e).symm b) = (↑e).symm ↑b


theorem gc_ord_card : GaloisConnection ord card


/-- Let `R` satisfy the strong rank condition. If `m` elements of a free rank `n` `R`-module are
linearly independent, then `m ≤ n`. -/
theorem Basis.card_le_card_of_linearIndependent_aux {R : Type*} [Ring R] [StrongRankCondition R]
    (n : ℕ) {m : ℕ} (v : Fin m → Fin n → R) : LinearIndependent R v → m ≤ n

{R : Type u_1}
[Ring R]
[StrongRankCondition R]
(n : ℕ)
{m : ℕ}
(v : Fin m → Fin n → R)


/-- `toPrincipalIdeal R K x` sends `x ≠ 0 : K` to the fractional `R`-ideal generated by `x` -/
irreducible_def toPrincipalIdeal : Kˣ →* (FractionalIdeal R⁰ K)ˣ

(R : Type u_4)
(K : Type u_5)
[CommRing R]
[Field K]
[Algebra R K]
[IsFractionRing R K]

toPrincipalIdeal R K =
  {
    toFun := fun x =>
      { val := FractionalIdeal.spanSingleton R⁰ ↑x, inv := FractionalIdeal.spanSingleton R⁰ (↑x)⁻¹, val_inv := ⋯,
        inv_val := ⋯ },
    map_one' := ⋯, map_mul' := ⋯ }


theorem coeff_eq_zero_of_lt_trailingDegree (h : (n : ℕ∞) < trailingDegree p) : coeff p n = 0

{R : Type u}
{n : ℕ}
[Semiring R]
{p : R[X]}
(h : ↑n < p.trailingDegree)


theorem ext_iff {x y : 𝓞 K} : x = y ↔ (x : K) = (y : K)

{K : Type u_1}
[Field K]
{x y : NumberField.RingOfIntegers K}


@[simp]
lemma unmop_hom_braiding (X Y : Cᴹᵒᵖ) : (β_ X Y).hom.unmop = (β_ (unmop Y) (unmop X)).hom

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

(β_ X Y).hom.unmop = (β_ Y.unmop X.unmop).hom


theorem nodup_iff_count_le_one [DecidableEq α] {s : Multiset α} : Nodup s ↔ ∀ a, count a s ≤ 1

{α : Type u_1}
[DecidableEq α]
{s : Multiset α}

s.Nodup ↔ ∀ (a : α), Multiset.count a s ≤ 1


@[reassoc (attr := simp)]
theorem QInfty_f_comp_PInfty_f (n : ℕ) : (QInfty.f n : X _[n] ⟶ _) ≫ PInfty.f n = 0

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

AlgebraicTopology.DoldKan.QInfty.f n ≫ AlgebraicTopology.DoldKan.PInfty.f n = 0


/-- The linear map forgetting that a bounded continuous function is bounded. -/
@[simps]
def toContinuousMapLinearMap : (α →ᵇ β) →ₗ[𝕜] C(α, β)

(α : Type u)
(β : Type v)
(𝕜 : Type u_2)
[PseudoMetricSpace 𝕜]
[TopologicalSpace α]
[PseudoMetricSpace β]
[Semiring 𝕜]
[AddCommMonoid β]
[Module 𝕜 β]
[BoundedSMul 𝕜 β]
[BoundedAdd β]
[ContinuousAdd β]
(self : BoundedContinuousFunction α β)

(BoundedContinuousFunction.toContinuousMapLinearMap α β 𝕜) self = self.toContinuousMap


theorem ContDiffOn.cosh {n} (hf : ContDiffOn ℝ n f s) :
    ContDiffOn ℝ n (fun x => Real.cosh (f x)) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffOn ℝ n f s)


theorem IsEquivalent.isBigO_symm (h : u ~[l] v) : v =O[l] u

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u v : α → β}
{l : Filter α}
(h : u ~[l] v)


theorem LeftExtension.IsKan.hasLeftKanExtension {t : LeftExtension f g} (H : IsKan t) :
    HasLeftKanExtension f g

{t : CategoryTheory.Bicategory.LeftExtension f g}


@[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}
[AddMonoid M]
{a x y : M}
(h : AddSemiconjBy a x y)
(n : ℕ)


@[norm_cast]
theorem coe_zsmul (n : ℤ) (x : ℝ) : (↑(n • x) : EReal) = n • (x : EReal)


theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
    (hg : g ∈ measurableLE μ ν) : (fun a ↦ f a ⊔ g a) ∈ measurableLE μ ν

(hf : f ∈ MeasureTheory.Measure.LebesgueDecomposition.measurableLE μ ν)

(hg : g ∈ MeasureTheory.Measure.LebesgueDecomposition.measurableLE μ ν)

(fun a => f a ⊔ g a) ∈ MeasureTheory.Measure.LebesgueDecomposition.measurableLE μ ν


/-- An equivalence between categories gives an equivalence between the opposite categories.
-/
@[simps]
def op (e : C ≌ D) : Cᵒᵖ ≌ Dᵒᵖ

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

e.op.unitIso = (CategoryTheory.NatIso.op e.unitIso).symm


@[to_additive]
theorem IsClosed.mul_right_of_isCompact (ht : IsClosed t) (hs : IsCompact s) :
    IsClosed (t * s)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{s t : Set G}
(ht : IsClosed t)
(hs : IsCompact s)


theorem Walk.isPath_of_length_eq_dist (p : G.Walk u v) (hp : p.length = G.dist u v) :
    p.IsPath

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}
(p : G.Walk u v)
(hp : p.length = G.dist u v)


@[simp]
theorem mk_C (x : R) : mk f (C x) = x

{R : Type u}
[CommRing R]
{f : R[X]}
(x : R)

(AdjoinRoot.mk f) (Polynomial.C x) = (AdjoinRoot.of f) x


/-- The map sending a binary relation to the smallest congruence relation in which it is
    contained is idempotent. -/
@[to_additive addConGen_idem "The map sending a binary relation to the smallest additive
congruence relation in which it is contained is idempotent."]
theorem conGen_idem (r : M → M → Prop) : conGen (conGen r) = conGen r

{M : Type u_1}
[Add M]
(r : M → M → Prop)


lemma coe_ne_one : (r : ℝ≥0∞) ≠ 1 ↔ r ≠ 1

↑r ≠ 1 ↔ r ≠ 1


theorem finrank_add_finrank_le_of_disjoint [FiniteDimensional K V]
    {s t : Submodule K V} (hdisjoint : Disjoint s t) :
    finrank K s + finrank K t ≤ finrank K V

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{s t : Submodule K V}
(hdisjoint : Disjoint s t)

FiniteDimensional.finrank K ↥s + FiniteDimensional.finrank K ↥t ≤ FiniteDimensional.finrank K V


@[simp]
theorem ofEquiv_F {f : Filter α} (F : f.Realizer) (E : F.σ ≃ τ) (s : τ) :
    (F.ofEquiv E).F s = F.F (E.symm s)

{α : Type u_1}
{τ : Type u_4}
{f : Filter α}
(F : f.Realizer)
(E : F.σ ≃ τ)
(s : τ)


@[simp] lemma toENat_comp_ofENat : toENat ∘ (↑) = id


/-- **First moment method**. A measurable function is smaller than its mean on a set of positive
measure. -/
theorem measure_le_laverage_pos (hμ : μ ≠ 0) (hf : AEMeasurable f μ) :
    0 < μ {x | f x ≤ ⨍⁻ a, f a ∂μ}

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
[MeasureTheory.IsFiniteMeasure μ]
(hμ : μ ≠ 0)
(hf : AEMeasurable f μ)


theorem totallyBounded_iff' {s : Set α} :
    TotallyBounded s ↔ ∀ ε > 0, ∃ t, t ⊆ s ∧ Set.Finite t ∧ s ⊆ ⋃ y ∈ t, ball y ε

{α : Type u}
[PseudoEMetricSpace α]
{s : Set α}

TotallyBounded s ↔ ∀ ε > 0, ∃ t ⊆ s, t.Finite ∧ s ⊆ ⋃ y ∈ t, EMetric.ball y ε


@[simp]
theorem blimsup_false {f : Filter β} {u : β → α} : (blimsup u f fun _ => False) = ⊥

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{u : β → α}


@[simp]
theorem prod_coe : (prod p q₁ : Set (M × M')) = (p : Set M) ×ˢ (q₁ : Set M')

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : Submodule R M)
{M' : Type u_9}
[AddCommMonoid M']
[Module R M']
(q₁ : Submodule R M')


theorem comp_equiv' {π : P →+* R} (m : PerfectionMap p π) :
    (Perfection.coeff R p 0).comp ↑m.equiv = π

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


@[simp]
theorem coe_const (q : Q) : (const R P q : P → Q) = Function.const P q

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

⇑(ContinuousAffineMap.const R P q) = Function.const P q


theorem associated_of_dvd_of_natDegree_le_of_leadingCoeff {p q : R[X]} (hpq : p ∣ q)
    (h₁ : q.natDegree ≤ p.natDegree) (h₂ : q.leadingCoeff ∣ p.leadingCoeff) :
    Associated p q

{R : Type u}
[CommRing R]
[IsDomain R]
{p q : R[X]}
(hpq : p ∣ q)
(h₁ : q.natDegree ≤ p.natDegree)
(h₂ : q.leadingCoeff ∣ p.leadingCoeff)


@[simp]
theorem sumCompl_apply_symm_of_neg (p : α → Prop) [DecidablePred p] (a : α) (h : ¬p a) :
    (sumCompl p).symm a = Sum.inr ⟨a, h⟩

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(a : α)
(h : ¬p a)

(Equiv.sumCompl p).symm a = Sum.inr ⟨a, h⟩


theorem coeff_eq_zero_of_lt_orderTop {x : HahnSeries Γ R} {i : Γ} (hi : i < x.orderTop) :
    x.coeff i = 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{x : HahnSeries Γ R}
{i : Γ}
(hi : ↑i < x.orderTop)


theorem integral_countable' [Countable α] [MeasurableSingletonClass α] {μ : Measure α}
    {f : α → E} (hf : Integrable f μ) :
    ∫ a, f a ∂μ = ∑' a, (μ {a}).toReal • f a

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

∫ (a : α), f a ∂μ = ∑' (a : α), (μ {a}).toReal • f a


lemma Exact.mono_fromOpcycles (hS : S.Exact) [S.HasRightHomology] : Mono S.fromOpcycles

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(hS : S.Exact)
[S.HasRightHomology]


theorem isCompl_iff [PartialOrder α] [BoundedOrder α] {a b : α} :
    IsCompl a b ↔ Disjoint a b ∧ Codisjoint a b

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


theorem IsBigOWith.add (h₁ : IsBigOWith c₁ l f₁ g) (h₂ : IsBigOWith c₂ l f₂ g) :
    IsBigOWith (c₁ + c₂) l (fun x => f₁ x + f₂ x) g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{c₁ c₂ : ℝ}
{g : α → F}
{l : Filter α}
{f₁ f₂ : α → E'}
(h₁ : Asymptotics.IsBigOWith c₁ l f₁ g)
(h₂ : Asymptotics.IsBigOWith c₂ l f₂ g)

Asymptotics.IsBigOWith (c₁ + c₂) l (fun x => f₁ x + f₂ x) g


theorem pow_arith_mean_le_arith_mean_pow (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i)
    (hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) (n : ℕ) :
    (∑ i ∈ s, w i * z i) ^ n ≤ ∑ i ∈ s, w i * z i ^ n

{ι : Type u}
(s : Finset ι)
(w z : ι → ℝ)
(hw : ∀ i ∈ s, 0 ≤ w i)
(hw' : ∑ i ∈ s, w i = 1)
(hz : ∀ i ∈ s, 0 ≤ z i)
(n : ℕ)


theorem exists_rat_eq_nth_den : ∃ q : ℚ, (of v).dens n = (q : K)

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
(v : K)
(n : ℕ)


@[to_additive]
theorem continuous_embedProduct : Continuous (embedProduct M)

{M : Type u_1}
[TopologicalSpace M]
[AddMonoid M]


theorem liftPropWithinAt_indep_chart [HasGroupoid M G] [HasGroupoid M' G']
    (he : e ∈ G.maximalAtlas M) (xe : x ∈ e.source) (hf : f ∈ G'.maximalAtlas M')
    (xf : g x ∈ f.source) :
    LiftPropWithinAt P g s x ↔
    ContinuousWithinAt g s x ∧ P (f ∘ g ∘ e.symm) (e.symm ⁻¹' s) (e x)

(he : e ∈ StructureGroupoid.maximalAtlas M G)

(hf : f ∈ StructureGroupoid.maximalAtlas M' G')

ChartedSpace.LiftPropWithinAt P g s x ↔ ContinuousWithinAt g s x ∧ P (↑f ∘ g ∘ ↑e.symm) (↑e.symm ⁻¹' s) (↑e x)


theorem choose_eq_nat_choose [NatPowAssoc R] (n k : ℕ) : choose (n : R) k = Nat.choose n k

{R : Type u_1}
[NonAssocRing R]
[Pow R ℕ]
[BinomialRing R]
[NatPowAssoc R]
(n k : ℕ)


@[simp]
theorem coe_normSeminorm : ⇑(normSeminorm 𝕜 E) = norm

(𝕜 : Type u_3)
(E : Type u_7)
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]


@[simp]
theorem continuum_le_lift {c : Cardinal.{u}} : 𝔠 ≤ lift.{v} c ↔ 𝔠 ≤ c

Cardinal.continuum ≤ Cardinal.lift.{v, u} c ↔ Cardinal.continuum ≤ c


@[simp]
theorem functorPullback_arrows (R : Sieve (F.obj X)) :
    (R.functorPullback F).arrows = R.arrows.functorPullback F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
{X : C}
(R : CategoryTheory.Sieve (F.obj X))

(CategoryTheory.Sieve.functorPullback F R).arrows = CategoryTheory.Presieve.functorPullback F R.arrows


@[to_additive eq_sub_of_add_eq']
theorem eq_div_of_mul_eq'' (h : c * a = b) : a = b / c

{G : Type u_3}
[AddCommGroup G]
{a b c : G}
(h : c + a = b)


/-- Alternative constructor for `IndObjectPresentation` taking a cocone instead of its defining
    natural transformation. -/
@[simps]
def ofCocone {I : Type v} [SmallCategory I] [IsFiltered I] {F : I ⥤ C}
    (c : Cocone (F ⋙ yoneda)) (hc : IsColimit c) : IndObjectPresentation c.pt

(c : CategoryTheory.Limits.Cocone (F.comp CategoryTheory.yoneda))

(hc : CategoryTheory.Limits.IsColimit c)

(CategoryTheory.Limits.IndObjectPresentation.ofCocone c hc).ℐ = inst✝


theorem projectiveSeminormAux_smul (p : FreeAddMonoid (𝕜 × Π i, E i)) (a : 𝕜) :
    projectiveSeminormAux (List.map (fun (y : 𝕜 × Π i, E i) ↦ (a * y.1, y.2)) p) =
    ‖a‖ * projectiveSeminormAux p

[(i : ι) → SeminormedAddCommGroup (E i)]

(p : FreeAddMonoid (𝕜 × ((i : ι) → E i)))

PiTensorProduct.projectiveSeminormAux (List.map (fun y => (a * y.1, y.2)) p) =
  ‖a‖ * PiTensorProduct.projectiveSeminormAux p


theorem degree_erase_le (p : R[X]) (n : ℕ) : degree (p.erase n) ≤ degree p

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

(Polynomial.erase n p).degree ≤ p.degree


private theorem add_aux_right (x y1 y2 : ℕ × K) (H : R K p y1 y2) :
    mk K p (x.1 + y1.1, (frobenius K p)^[y1.1] x.2 + (frobenius K p)^[x.1] y1.2) =
      mk K p (x.1 + y2.1, (frobenius K p)^[y2.1] x.2 + (frobenius K p)^[x.1] y2.2)

(K : Type u)
[CommRing K]
(p : ℕ)
[Fact (Nat.Prime p)]
[CharP K p]
(x y1 y2 : ℕ × K)
(H : PerfectClosure.R K p y1 y2)

PerfectClosure.mk K p (x.1 + y1.1, (⇑(frobenius K p))^[y1.1] x.2 + (⇑(frobenius K p))^[x.1] y1.2) =
  PerfectClosure.mk K p (x.1 + y2.1, (⇑(frobenius K p))^[y2.1] x.2 + (⇑(frobenius K p))^[x.1] y2.2)


/-- A subfield contains the field's 1. -/
protected theorem one_mem : (1 : K) ∈ s

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


@[to_additive (attr := simp)]
theorem image2_mul : image2 (· * ·) s t = s * t

Set.image2 (fun x x_1 => x * x_1) s t = s * t


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofDual_smul']
theorem pow_ofDual [Pow α β] (a : α) (b : βᵒᵈ) : a ^ ofDual b = a ^ b

{β : Type u_2}
{α : Type u_1}
[VAdd β α]
(b : βᵒᵈ)
(a : α)


theorem RelIso.cof_le {α β : Type u} {r : α → α → Prop} {s} [IsRefl β s] (f : r ≃r s) :
    Order.cof r ≤ Order.cof s

{α β : Type u}
{r : α → α → Prop}
{s : β → β → Prop}
[IsRefl β s]
(f : r ≃r s)


@[simp]
theorem stalk_open_algebraMap {X : TopCat} (F : X.Presheaf CommRingCat) {U : Opens X} (x : U) :
    algebraMap (F.obj <| op U) (F.stalk x) = F.germ x

{X : TopCat}
(F : TopCat.Presheaf CommRingCat X)
{U : TopologicalSpace.Opens ↑X}
(x : ↥U)

algebraMap ↑(F.obj (Opposite.op U)) ↑(F.stalk ↑x) = F.germ x


/-- A choice of isomorphism `T₁ ≅ T₂` between two distinguished triangles
when we are given two isomorphisms `e₁ : T₁.obj₁ ≅ T₂.obj₁` and `e₂ : T₁.obj₂ ≅ T₂.obj₂`. -/
@[simps! hom_hom₁ hom_hom₂ inv_hom₁ inv_hom₂]
def isoTriangleOfIso₁₂ (T₁ T₂ : Triangle C) (hT₁ : T₁ ∈ distTriang C)
    (hT₂ : T₂ ∈ distTriang C) (e₁ : T₁.obj₁ ≅ T₂.obj₁) (e₂ : T₁.obj₂ ≅ T₂.obj₂)
    (comm : T₁.mor₁ ≫ e₂.hom = e₁.hom ≫ T₂.mor₁) : T₁ ≅ T₂

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

(T₁ T₂ : CategoryTheory.Pretriangulated.Triangle C)

(hT₁ : T₁ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(hT₂ : T₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.Pretriangulated.isoTriangleOfIso₁₂ T₁ T₂ hT₁ hT₂ e₁ e₂ comm).hom.hom₁ = e₁.hom


/-- Given a fintype `α`, `finsetOrderIsoSet` is the order isomorphism between `Finset α` and `Set α`
(all sets on a finite type are finite). -/
@[simps toEquiv]
noncomputable def finsetOrderIsoSet : Finset α ≃o Set α


@[ext]
theorem ext (A B : unitaryGroup n α) : (∀ i j, A i j = B i j) → A = B

{n : Type u}
[DecidableEq n]
[Fintype n]
{α : Type v}
[CommRing α]
[StarRing α]
(A B : ↥(Matrix.unitaryGroup n α))


@[simp]
lemma ofReal_eq_one {r : ℝ} : ENNReal.ofReal r = 1 ↔ r = 1


@[trans]
theorem IsBigO.trans_isTheta {f : α → E} {g : α → F'} {k : α → G} (h₁ : f =O[l] g)
    (h₂ : g =Θ[l] k) : f =O[l] k

{α : Type u_1}
{E : Type u_3}
{G : Type u_5}
{F' : Type u_7}
[Norm E]
[Norm G]
[SeminormedAddCommGroup F']
{l : Filter α}
{f : α → E}
{g : α → F'}
{k : α → G}
(h₁ : f =O[l] g)
(h₂ : g =Θ[l] k)


@[simp]
theorem le_eq_subset : ((· ≤ ·) : Finset α → Finset α → Prop) = (· ⊆ ·)

(fun x x_1 => x ≤ x_1) = fun x x_1 => x ⊆ x_1


@[reassoc]
theorem single_map_f_self (j : ι) {A B : V} (f : A ⟶ B) :
    ((single V c j).map f).f j = (singleObjXSelf c j A).hom ≫
      f ≫ (singleObjXSelf c j B).inv

((HomologicalComplex.single V c j).map f).f j =
  (HomologicalComplex.singleObjXSelf c j A).hom ≫ f ≫ (HomologicalComplex.singleObjXSelf c j B).inv


theorem sub_one_sub_lt (h : i < n) : n - 1 - i < n


@[simp] lemma forget_map (f : M ⟶ N) : (forget (ModuleCat R)).map f = (f : M → N)

{R : Type u}
[Ring R]
{M N : ModuleCat R}
(f : M ⟶ N)

(CategoryTheory.forget (ModuleCat R)).map f = ⇑f


/-- The structure presheaf, valued in `CommRingCat`, constructed by dressing up the `Type` valued
structure presheaf.
-/
@[simps]
def structurePresheafInCommRing : Presheaf CommRingCat (PrimeSpectrum.Top R)

(U : (TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))ᵒᵖ)

(AlgebraicGeometry.structurePresheafInCommRing R).obj U =
  CommRingCat.of ((AlgebraicGeometry.structureSheafInType R).val.obj U)


lemma withDensity_add_right [IsSFiniteKernel κ] {f g : α → β → ℝ≥0∞}
    (hf : Measurable (Function.uncurry f)) (hg : Measurable (Function.uncurry g)) :
    withDensity κ (f + g) = withDensity κ f + withDensity κ g

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ : ProbabilityTheory.Kernel α β}
[ProbabilityTheory.IsSFiniteKernel κ]
{f g : α → β → ℝ≥0∞}
(hf : Measurable (Function.uncurry f))
(hg : Measurable (Function.uncurry g))

κ.withDensity (f + g) = κ.withDensity f + κ.withDensity g


protected lemma mem_nonZeroDivisors_iff {P : R[X]} : P ∈ R[X]⁰ ↔ ∀ a : R, a • P = 0 → a = 0

{R : Type u}
[CommSemiring R]
{P : R[X]}

P ∈ nonZeroDivisors R[X] ↔ ∀ (a : R), a • P = 0 → a = 0


@[simp]
theorem card_neighborFinset_eq_degree : (G.neighborFinset v).card = G.degree v

{V : Type u_1}
(G : SimpleGraph V)
(v : V)
[Fintype ↑(G.neighborSet v)]


@[simps!]
instance : MonoidalCategoryStruct (Dial C)

∀ (x x_1 : CategoryTheory.Dial C) (f : x ⟶ x_1),
  (CategoryTheory.MonoidalCategory.whiskerLeft X f).f =
    CategoryTheory.Limits.prod.map (CategoryTheory.CategoryStruct.id X.src) f.f


theorem finite_int_iff_natAbs_finite {a b : ℤ} : Finite a b ↔ Finite a.natAbs b.natAbs

multiplicity.Finite a b ↔ multiplicity.Finite a.natAbs b.natAbs


theorem traceForm_nondegenerate [FiniteDimensional K L] [Algebra.IsSeparable K L] :
    (traceForm K L).Nondegenerate

(K : Type u_4)
(L : Type u_5)
[Field K]
[Field L]
[Algebra K L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]


/-- The comparison isomorphism between `normalizedMooreComplex A` and
the functor `Idempotents.DoldKan.N` from the pseudoabelian case -/
@[simps!]
def comparisonN : (N : SimplicialObject A ⥤ _) ≅ Idempotents.DoldKan.N

{A : Type u_1}
[CategoryTheory.Category.{u_2, u_1} A]
[CategoryTheory.Abelian A]
(X : CategoryTheory.SimplicialObject A)
(i : ℕ)

(CategoryTheory.Abelian.DoldKan.comparisonN.hom.app X).f i =
  ((CategoryTheory.Idempotents.toKaroubiEquivalence (ChainComplex A ℕ)).unitIso.hom.app
          (CategoryTheory.Abelian.DoldKan.N.obj X)).f
      i ≫
    ((CategoryTheory.Idempotents.toKaroubiEquivalence (ChainComplex A ℕ)).inverse.map
          ((AlgebraicTopology.DoldKan.N₁_iso_normalizedMooreComplex_comp_toKaroubi A).inv.app X)).f
      i


theorem mul : mapFun f (x * y) = mapFun f x * mapFun f y

{p : ℕ}
{R : Type u_1}
{S : Type u_2}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CommRing S]
(f : R →+* S)
(x y : 𝕎 R)

WittVector.mapFun (⇑f) (x * y) = WittVector.mapFun (⇑f) x * WittVector.mapFun (⇑f) y


/-- A version of `algebraMap_mono` for use by `gcongr` since it currently does not preprocess
`Monotone` conclusions. -/
@[gcongr] protected lemma GCongr.algebraMap_le_algebraMap {a₁ a₂ : α} (ha : a₁ ≤ a₂) :
    algebraMap α β a₁ ≤ algebraMap α β a₂

{α : Type u_1}
(β : Type u_2)
[OrderedCommSemiring α]
[OrderedSemiring β]
[Algebra α β]
[SMulPosMono α β]
{a₁ a₂ : α}
(ha : a₁ ≤ a₂)

(algebraMap α β) a₁ ≤ (algebraMap α β) a₂


theorem tendsto_abs_re_smul {p : Fin 2 → ℤ} (hp : IsCoprime (p 0) (p 1)) :
    Tendsto
      (fun g : { g : SL(2, ℤ) // (↑ₘg) 1 = p } => |((g : SL(2, ℤ)) • z).re|) cofinite atTop

(z : ℍ)
{p : Fin 2 → ℤ}
(hp : IsCoprime (p 0) (p 1))

Filter.Tendsto (fun g => |(↑g • z).re|) Filter.cofinite Filter.atTop


@[simp]
theorem mul_one_add_self : a * (1 + a) = 0


theorem ker_def {f : α → β} {x y : α} : (ker f).Rel x y ↔ f x = f y

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{x y : α}


@[to_additive]
theorem mul_comm_div : a / b * c = a * (c / b)

{α : Type u_1}
[SubtractionCommMonoid α]
(a b c : α)


/-- The map `(x, y) ↦ (x, y / x)` is measure-preserving. -/
@[to_additive measurePreserving_prod_sub "The map `(x, y) ↦ (x, y - x)` is measure-preserving."]
theorem measurePreserving_prod_div [IsMulRightInvariant ν] :
    MeasurePreserving (fun z : G × G => (z.1, z.2 / z.1)) (μ.prod ν) (μ.prod ν)

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[MeasurableNeg G]
[ν.IsAddRightInvariant]

MeasureTheory.MeasurePreserving (fun z => (z.1, z.2 - z.1)) (μ.prod ν) (μ.prod ν)


theorem uniqueMDiffOn_univ : UniqueMDiffOn I (univ : Set M)

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


@[simp]
theorem integralSum_add (f g : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) (π : TaggedPrepartition I) :
    integralSum (f + g) vol π = integralSum f vol π + integralSum g vol π

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
(f g : (ι → ℝ) → E)
(vol : ι →ᵇᵃ[⊤] E →L[ℝ] F)
(π : BoxIntegral.TaggedPrepartition I)

BoxIntegral.integralSum (f + g) vol π = BoxIntegral.integralSum f vol π + BoxIntegral.integralSum g vol π


theorem Pi.mem_enum (f : ∀ a, β a) :
    f ∈ Pi.enum β

{α : Type u_1}
[FinEnum α]
{β : α → Type u_2}
[(a : α) → FinEnum (β a)]
(f : (a : α) → β a)


@[simp]
theorem liftAux_neg_I : liftAux (-I) ((neg_mul_neg _ _).trans I_mul_I) = conjAe

Complex.liftAux (-Complex.I) ⋯ = ↑Complex.conjAe


theorem blocks_partial_sum {i : ℕ} (h : i < c.boundaries.card) :
    (c.blocks.take i).sum = c.boundary ⟨i, h⟩

{n : ℕ}
(c : CompositionAsSet n)
{i : ℕ}
(h : i < c.boundaries.card)

(List.take i c.blocks).sum = ↑(c.boundary ⟨i, h⟩)


private theorem candidates_nonneg (fA : f ∈ candidates X Y) : 0 ≤ f (x, y)

(fA : f ∈ GromovHausdorff.candidates X Y)


@[simp] lemma coe_inclusion (h : L ≤ M) : inclusion h = Set.inclusion h

{α : Type u_2}
[Lattice α]
{L M : Sublattice α}
(h : L ≤ M)

⇑(Sublattice.inclusion h) = Set.inclusion h


/-- **Frattini's Argument**: If `N` is a normal subgroup of `G`, and if `P` is a Sylow `p`-subgroup
  of `N`, then `N_G(P) ⊔ N = G`. -/
theorem Sylow.normalizer_sup_eq_top' {p : ℕ} [Fact p.Prime] {N : Subgroup G} [N.Normal]
    [Finite (Sylow p N)] (P : Sylow p G) (hP : ↑P ≤ N) : (P : Subgroup G).normalizer ⊔ N = ⊤

{G : Type u_1}
[Group G]
{p : ℕ}
[Fact (Nat.Prime p)]
{N : Subgroup G}
[N.Normal]
[Finite (Sylow p ↥N)]
(P : Sylow p G)
(hP : ↑P ≤ N)


@[simp]
theorem coeff_divX : (divX p).coeff n = p.coeff (n + 1)

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


@[simp]
theorem toEquiv_inj {h h' : M ≃ₘ^n⟮I, I'⟯ M'} : h.toEquiv = h'.toEquiv ↔ h = h'

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
{h h' : M ≃ₘ^n⟮I, I'⟯ M'}


theorem integrableOn_Iic_of_intervalIntegral_norm_bounded (I b : ℝ)
    (hfi : ∀ i, IntegrableOn f (Ioc (a i) b) μ) (ha : Tendsto a l atBot)
    (h : ∀ᶠ i in l, (∫ x in a i..b, ‖f x‖ ∂μ) ≤ I) : IntegrableOn f (Iic b) μ

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

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

MeasureTheory.IntegrableOn f (Set.Iic b) μ


theorem toSignedMeasure_smul (r : ℝ≥0) : (r • j).toSignedMeasure = r • j.toSignedMeasure

(j : MeasureTheory.JordanDecomposition α)


/-- If `f` is an affine map, then its linear part is an open map iff `f` is an open map. -/
theorem AffineMap.isOpenMap_linear_iff {f : P →ᵃ[𝕜] P₂} : IsOpenMap f.linear ↔ IsOpenMap f

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
{f : P →ᵃ[𝕜] P₂}


@[simp]
theorem disjoint_union_left : Disjoint (s ∪ t) u ↔ Disjoint s u ∧ Disjoint t u

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


theorem findIdx?_eq_some_iff (xs : List α) (p : α → Bool) :
    xs.findIdx? p = some i ↔ (xs.take (i + 1)).map p = replicate i false ++ [true]

{α : Type u_1}
{i : Nat}
(xs : List α)
(p : α → Bool)

List.findIdx? p xs = some i ↔ List.map p (List.take (i + 1) xs) = List.replicate i false ++ [true]


private theorem restrictNonposSeq_subset (n : ℕ) : restrictNonposSeq s i n ⊆ i

{α : Type u_1}
[MeasurableSpace α]
{s : MeasureTheory.SignedMeasure α}
{i : Set α}
(n : ℕ)

MeasureTheory.SignedMeasure.restrictNonposSeq s i n ⊆ i


@[simp]
theorem coe_toSubalgebra (p : Submodule R A) (h_one h_mul) :
    (p.toSubalgebra h_one h_mul : Set A) = p

(h_mul : ∀ (x y : A), x ∈ p → y ∈ p → x * y ∈ p)


@[simp]
theorem exp_eq_exp {x y : ℝ} : exp x = exp y ↔ x = y


theorem fourierIntegral_continuousMultilinearMap_apply {ι : Type*} [Fintype ι]
    {M : ι → Type*} [∀ i, NormedAddCommGroup (M i)] [∀ i, NormedSpace ℝ (M i)]
    {f : V → ContinuousMultilinearMap ℝ M E} {m : (i : ι) → M i} {v : V} (hf : Integrable f) :
    𝓕 f v m = 𝓕 (fun x ↦ f x m) v

(hf : MeasureTheory.Integrable f MeasureTheory.volume)

(Real.fourierIntegral f v) m = Real.fourierIntegral (fun x => (f x) m) v


protected theorem AntitoneOn.Ici (hf : AntitoneOn f s) : MonotoneOn (fun x => Ici (f x)) s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
{s : Set α}
(hf : AntitoneOn f s)


nonrec theorem HasFDerivWithinAt.mono (h : HasFDerivWithinAt f f' t x) (hst : s ⊆ t) :
    HasFDerivWithinAt f f' s x

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


lemma opensMeasurableSpace_iff_forall_measurableSet
    [TopologicalSpace α] [MeasurableSpace α] :
    OpensMeasurableSpace α ↔  (∀ (s : Set α), IsOpen s → MeasurableSet s)

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]

OpensMeasurableSpace α ↔ ∀ (s : Set α), IsOpen s → MeasurableSet s