/-- If `M` and itself are linearly disjoint, if `M` is flat,
if any two elements of `M` are commutative, then the rank of `M` is at most one. -/
theorem rank_le_one_of_commute_of_flat_of_self (H : M.LinearDisjoint M) [Module.Flat R M]
    (hc : ∀ (m n : M), Commute m.1 n.1) : Module.rank R M ≤ 1

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
[Algebra R S]
{M : Submodule R S}
(H : M.LinearDisjoint M)
[Module.Flat R ↥M]
(hc : ∀ (m n : ↥M), Commute ↑m ↑n)


theorem measurableSpace_le {ι} [SemilatticeSup ι] {f : Filtration ι m} {τ : Ω → ι}
    [IsCountablyGenerated (atTop : Filter ι)] (hτ : IsStoppingTime f τ) :
    hτ.measurableSpace ≤ m

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{ι : Type u_4}
[SemilatticeSup ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
[Filter.atTop.IsCountablyGenerated]
(hτ : MeasureTheory.IsStoppingTime f τ)


theorem opow_principal_add_of_principal_add {a} (ha : Principal (· + ·) a) (b : Ordinal) :
    Principal (· + ·) (a^b)

(ha : Ordinal.Principal (fun x x_1 => x + x_1) a)

Ordinal.Principal (fun x x_1 => x + x_1) (a ^ b)


@[to_additive]
theorem MulEquiv.map_finprod_mem (g : M ≃* N) (f : α → M) {s : Set α} (hs : s.Finite) :
    g (∏ᶠ i ∈ s, f i) = ∏ᶠ i ∈ s, g (f i)

{α : Type u_1}
{M : Type u_5}
{N : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
(g : M ≃+ N)
(f : α → M)
{s : Set α}
(hs : s.Finite)


theorem totalDegree_sub (a b : MvPolynomial σ R) :
    (a - b).totalDegree ≤ max a.totalDegree b.totalDegree

{R : Type u}
{σ : Type u_1}
[CommRing R]
(a b : MvPolynomial σ R)


/-- `Complex.arg` and `expMapCircle` define an equivalence between `circle` and `(-π, π]`. -/
@[simps (config := .asFn)]
noncomputable def argEquiv : circle ≃ Ioc (-π) π


lemma Codisjoint.ne_bot_of_ne_top (h : Codisjoint a b) (ha : a ≠ ⊤) : b ≠ ⊥

{α : Type u_1}
[PartialOrder α]
[BoundedOrder α]
{a b : α}
(h : Codisjoint a b)
(ha : a ≠ ⊤)


theorem toFinsupp_union (s t : Multiset α) : toFinsupp (s ∪ t) = toFinsupp s ⊔ toFinsupp t

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

Multiset.toFinsupp (s ∪ t) = Multiset.toFinsupp s ⊔ Multiset.toFinsupp t


theorem exists_forall_closed_ball_dist_add_le_two_mul_sub (hε : 0 < ε) (r : ℝ) :
    ∃ δ, 0 < δ ∧ ∀ ⦃x : E⦄, ‖x‖ ≤ r → ∀ ⦃y⦄, ‖y‖ ≤ r → ε ≤ ‖x - y‖ → ‖x + y‖ ≤ 2 * r - δ

(E : Type u_1)
[SeminormedAddCommGroup E]
[UniformConvexSpace E]
{ε : ℝ}
[NormedSpace ℝ E]
(hε : 0 < ε)
(r : ℝ)

∃ δ, 0 < δ ∧ ∀ ⦃x : E⦄, ‖x‖ ≤ r → ∀ ⦃y : E⦄, ‖y‖ ≤ r → ε ≤ ‖x - y‖ → ‖x + y‖ ≤ 2 * r - δ


theorem disjoint_stdBasis_stdBasis (I J : Set ι) (h : Disjoint I J) :
    Disjoint (⨆ i ∈ I, range (stdBasis R φ i)) (⨆ i ∈ J, range (stdBasis R φ i))

(R : Type u_1)
{ι : Type u_2}
[Semiring R]
(φ : ι → Type u_3)
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
[DecidableEq ι]
(I J : Set ι)
(h : Disjoint I J)

Disjoint (⨆ i ∈ I, LinearMap.range (LinearMap.stdBasis R φ i)) (⨆ i ∈ J, LinearMap.range (LinearMap.stdBasis R φ i))


private theorem eps_pos {ε : ℝ} {n : ℕ} (h : 100 ≤ (4 : ℝ) ^ n * ε ^ 5) : 0 < ε


@[simp, norm_cast]
theorem coe_zero : ((0 : s) : R) = 0


lemma binaryProductTriangle_distinguished (X₁ X₂ : C) :
    binaryProductTriangle X₁ X₂ ∈ distTriang C

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

CategoryTheory.Pretriangulated.binaryProductTriangle X₁ X₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


theorem GameAdd.fst {a₁ a₂ b : α} (h : rα a₁ a₂) : GameAdd rα s(a₁, b) s(a₂, b)

{α : Type u_1}
{rα : α → α → Prop}
{a₁ a₂ b : α}
(h : rα a₁ a₂)


/-- The Dirichlet character mod `0` corresponds to `δ`. -/
lemma modZero_eq_delta {χ : DirichletCharacter ℂ 0} : ↗χ = δ


theorem mem_of_mem_filter {s : Finset α} (x : α) (h : x ∈ s.filter p) : x ∈ s

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{s : Finset α}
(x : α)
(h : x ∈ Finset.filter p s)


/--
The `Monad` typeclass only contains the operations of a monad.
`LawfulMonad` further asserts that these operations satisfy the laws of a monad,
including associativity and identity laws for `bind`:
```
pure x >>= f = f x
x >>= pure = x
x >>= f >>= g = x >>= (fun x => f x >>= g)
```

`LawfulMonad.mk'` is an alternative constructor containing useful defaults for many fields.
-/
class LawfulMonad (m : Type u → Type v) [Monad m] extends LawfulApplicative m : Prop where
  bind_pure_comp (f : α → β) (x : m α) : x >>= (fun a => pure (f a)) = f <$> x
  bind_map       {α β : Type u} (f : m (α → β)) (x : m α) : f >>= (. <$> x) = f <*> x
  pure_bind      (x : α) (f : α → m β) : pure x >>= f = f x
  bind_assoc     (x : m α) (f : α → m β) (g : β → m γ) : x >>= f >>= g = x >>= fun x => f x >>= g
  map_pure g x    := (by rw [← bind_pure_comp, pure_bind])
  seq_pure g x    := (by rw [← bind_map]; simp [map_pure, bind_pure_comp])
  seq_assoc x g h := (by simp [← bind_pure_comp, ← bind_map, bind_assoc, pure_bind])

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

(do
    let x_1 ← f
    x_1 <$> x) =
  Seq.seq f fun x_1 => x


@[simp]
theorem coe_sub : ⇑(X - Y) = X - Y

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


/-- Map `WithTerminal` with respect to a functor `F : C ⥤ D`. -/
@[simps]
def map {D : Type*} [Category D] (F : C ⥤ D) : WithTerminal C ⥤ WithTerminal D

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
(F : CategoryTheory.Functor C D)
(X : CategoryTheory.WithTerminal C)

(CategoryTheory.WithTerminal.map F).obj X =
  match X with
  | CategoryTheory.WithTerminal.of x => CategoryTheory.WithTerminal.of (F.obj x)
  | CategoryTheory.WithTerminal.star => CategoryTheory.WithTerminal.star


theorem get?_set (a : Array α) (i : Fin a.size) (j : Nat) (v : α) :
    (a.set i v)[j]? = if i.1 = j then some v else a[j]?

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

(a.set i v)[j]? = if ↑i = j then some v else a[j]?


@[to_additive]
theorem unop_inf (S₁ S₂ : Subgroup Gᵐᵒᵖ) : (S₁ ⊓ S₂).unop = S₁.unop ⊓ S₂.unop

{G : Type u_2}
[AddGroup G]
(S₁ S₂ : AddSubgroup Gᵃᵒᵖ)


theorem tsupport_mul_subset_right {α : Type*} [MulZeroClass α] {f g : X → α} :
    (tsupport fun x => f x * g x) ⊆ tsupport g

{X : Type u_1}
[TopologicalSpace X]
{α : Type u_10}
[MulZeroClass α]
{f g : X → α}


theorem map_extend_nhds_of_boundaryless [I.Boundaryless] {x : M} (hx : x ∈ f.source) :
    map (f.extend I) (𝓝 x) = 𝓝 (f.extend I x)

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

Filter.map (↑(f.extend I)) (𝓝 x) = 𝓝 (↑(f.extend I) x)


lemma llr_smul_left [IsFiniteMeasure μ] [Measure.HaveLebesgueDecomposition μ ν]
    (hμν : μ ≪ ν) (c : ℝ≥0∞) (hc : c ≠ 0) (hc_ne_top : c ≠ ∞) :
    llr (c • μ) ν =ᵐ[μ] fun x ↦ llr μ ν x + log c.toReal

{α : Type u_1}
{mα : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
[μ.HaveLebesgueDecomposition ν]
(hμν : μ.AbsolutelyContinuous ν)
(c : ℝ≥0∞)
(hc : c ≠ 0)
(hc_ne_top : c ≠ ⊤)

MeasureTheory.llr (c • μ) ν =ᵐ[μ] fun x => MeasureTheory.llr μ ν x + Real.log c.toReal


@[simp]
theorem toDual_apply_top : WithTop.toDual (⊤ : WithTop α) = ⊥


theorem list_join : Primrec (@List.join α)


theorem ContMDiffWithinAt.snd {f : N → M × M'} {s : Set N} {x : N}
    (hf : ContMDiffWithinAt J (I.prod I') n f s x) :
    ContMDiffWithinAt J I' n (fun x => (f x).2) s x


@[simp]
theorem restrictScalars_bot : restrictScalars S (⊥ : Submodule R M) = ⊥

(S : Type u_1)
(R : Type u_2)
(M : Type u_3)
[Semiring R]
[AddCommMonoid M]
[Semiring S]
[Module S M]
[Module R M]
[SMul S R]
[IsScalarTower S R M]


lemma disjoint_sdiff_neighborFinset_image :
    Disjoint (G.edgeFinset \ G.incidenceFinset t) ((G.neighborFinset s).image (s(·, t)))

{V : Type u_1}
[DecidableEq V]
(G : SimpleGraph V)
{s t : V}
[Fintype V]
[DecidableRel G.Adj]

Disjoint (G.edgeFinset \ G.incidenceFinset t) (Finset.image (fun x => s(x, t)) (G.neighborFinset s))


theorem mem_of_span_eq_top_of_smul_pow_mem
    (s : Set S) (l : s →₀ S) (hs : Finsupp.total s S S (↑) l = 1)
    (hs' : s ⊆ S') (hl : ∀ i, l i ∈ S') (x : S) (H : ∀ r : s, ∃ n : ℕ, (r : S) ^ n • x ∈ S') :
    x ∈ S'

(hs : (Finsupp.total (↑s) S S Subtype.val) l = 1)


theorem infiniteNeg_mul_of_not_infinitesimal_neg_infinitePos {x y : ℝ*} :
    ¬Infinitesimal x → x < 0 → InfinitePos y → InfiniteNeg (x * y)

¬x.Infinitesimal → x < 0 → y.InfinitePos → (x * y).InfiniteNeg


@[simp] lemma coe_toHom (f : G ↪g H) : ⇑f.toHom = f

{V : Type u_1}
{W : Type u_2}
{G : SimpleGraph V}
{H : SimpleGraph W}
(f : G ↪g H)


@[simp]
theorem fix_eval (f) : (fix f).eval =
    PFun.fix fun v => (f.eval v).map fun v =>
      if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail

f.fix.eval = PFun.fix fun v => Part.map (fun v => if v.headI = 0 then Sum.inl v.tail else Sum.inr v.tail) (f.eval v)


lemma natCast_eq_natCast : (a : R) = b ↔ a ≡ b [MOD p]

(R : Type u_1)
[AddMonoidWithOne R]
(p : ℕ)
[CharP R p]
{a b : ℕ}
[IsRightCancelAdd R]


/-- Corollary of Chinese Remainder Theorem: if `Iᵢ` are pairwise coprime ideals in a
commutative ring then given elements `xᵢ` you can find `r` with `r - xᵢ ∈ Iᵢ` for all `i`. -/
lemma exists_forall_sub_mem_ideal {R : Type*} [CommRing R] {ι : Type*} [Finite ι]
    {I : ι → Ideal R} (hI : Pairwise fun i j ↦ IsCoprime (I i) (I j)) (x : ι → R) :
    ∃ r : R, ∀ i, r - x i ∈ I i

(hI : Pairwise fun i j => IsCoprime (I i) (I j))


/-- In the commutative diagram
```
    f     g
 X₁ --→ X₂ --→ X₃
 ↑      ↑      ↑
v|     u|     w|
 ι  → ι ⊕ ι' ← ι'
```
where the top row is an exact sequence of modules and the maps on the bottom are `Sum.inl` and
`Sum.inr`. If `v` spans `X₁` and `w` spans `X₃`, then `u` spans `X₂`. -/
theorem span_exact {β : Type*} {u : ι ⊕ β → S.X₂} (huv : u ∘ Sum.inl = S.f ∘ v)
    (hv : ⊤ ≤ span R (range v))
    (hw : ⊤ ≤ span R (range (S.g ∘ u ∘ Sum.inr))) :
    ⊤ ≤ span R (range u)

{S : CategoryTheory.ShortComplex (ModuleCat R)}

(hv : ⊤ ≤ Submodule.span R (Set.range v))

(hw : ⊤ ≤ Submodule.span R (Set.range (⇑S.g ∘ u ∘ Sum.inr)))


@[to_additive]
theorem eq_mul_of_mul_inv_eq (h : a * c⁻¹ = b) : a = b * c

{G : Type u_3}
[Group G]
{a b c : G}
(h : a * c⁻¹ = b)


@[simp]
lemma self_iff (μ : Measure α) : μ ⟂ₘ μ ↔ μ = 0

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)

μ ⟂ₘ μ ↔ μ = 0


@[simp]
theorem multispan_map_snd (a) : I.multispan.map (WalkingMultispan.Hom.snd a) = I.snd a

(I : CategoryTheory.Limits.MultispanIndex C)

I.multispan.map (CategoryTheory.Limits.WalkingMultispan.Hom.snd a) = I.snd a


@[simp]
lemma inv_iff {f : 𝕜 → 𝕜} {x : 𝕜} :
    MeromorphicAt f⁻¹ x ↔ MeromorphicAt f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{f : 𝕜 → 𝕜}
{x : 𝕜}


@[simp]
theorem inl_one [One R] [Zero A] : (inl 1 : Unitization R A) = 1

{R : Type u_1}
(A : Type u_2)
[One R]
[Zero A]


@[gcongr]
theorem sInter_subset_sInter {S T : Set (Set α)} (h : S ⊆ T) : ⋂₀ T ⊆ ⋂₀ S

{α : Type u_1}
{S T : Set (Set α)}
(h : S ⊆ T)


/-- The image of a Haar measure under a continuous surjective proper group homomorphism is again
a Haar measure. See also `MulEquiv.isHaarMeasure_map`. -/
@[to_additive
"The image of an additive Haar measure under a continuous surjective proper additive group
homomorphism is again an additive Haar measure. See also `AddEquiv.isAddHaarMeasure_map`."]
theorem isHaarMeasure_map [BorelSpace G] [TopologicalGroup G] {H : Type*} [Group H]
    [TopologicalSpace H] [MeasurableSpace H] [BorelSpace H] [T2Space H] [TopologicalGroup H]
    (f : G →* H) (hf : Continuous f) (h_surj : Surjective f)
    (h_prop : Tendsto f (cocompact G) (cocompact H)) : IsHaarMeasure (Measure.map f μ)

(h_prop : Filter.Tendsto (⇑f) (Filter.cocompact G) (Filter.cocompact H))


lemma epi_τ₂_of_exact_of_epi {S₁ S₂ : ShortComplex C} (φ : S₁ ⟶ S₂)
    (h₂ : S₂.Exact) [Epi S₁.g] [Epi S₂.g] [Epi φ.τ₁] [Epi φ.τ₃] : Epi φ.τ₂

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Balanced C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ : S₁ ⟶ S₂)
(h₂ : S₂.Exact)
[CategoryTheory.Epi S₁.g]
[CategoryTheory.Epi S₂.g]
[CategoryTheory.Epi φ.τ₁]
[CategoryTheory.Epi φ.τ₃]


theorem withDensity_kernel_sum [Countable ι] (κ : ι → Kernel α β) (hκ : ∀ i, IsSFiniteKernel (κ i))
    (f : α → β → ℝ≥0∞) :
    @withDensity _ _ _ _ (Kernel.sum κ) (isSFiniteKernel_sum hκ) f =
      Kernel.sum fun i => withDensity (κ i) f

(hκ : ∀ (i : ι), ProbabilityTheory.IsSFiniteKernel (κ i))

(f : α → β → ℝ≥0∞)

(ProbabilityTheory.Kernel.sum κ).withDensity f = ProbabilityTheory.Kernel.sum fun i => (κ i).withDensity f


@[simp]
theorem coe_toLinearEquiv (h : ∀ (c : R) (x), e (c • x) = c • e x) : ⇑(e.toLinearEquiv h) = e

(h : ∀ (c : R) (x : M), e (c • x) = c • e x)


theorem subsingleton_univ [Subsingleton α] : (univ : Set α).Subsingleton


lemma isUnit_eq_or_eq_neg (hu : IsUnit u) (hv : IsUnit v) : u = v ∨ u = -v

{u v : ℤ}
(hu : IsUnit u)
(hv : IsUnit v)


@[simp] theorem ite_false_same (p q : Prop) [h : Decidable p] : (if p then q else p) = (p ∧ q)


theorem measure_eq_inducedOuterMeasure :
    μ s = inducedOuterMeasure (fun s _ => μ s) MeasurableSet.empty μ.empty s

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}

μ s = (MeasureTheory.inducedOuterMeasure (fun s x => μ s) ⋯ ⋯) s


/-- The Gelfand transform is bijective when the algebra is a C⋆-algebra over `ℂ`. -/
theorem gelfandTransform_bijective : Function.Bijective (gelfandTransform ℂ A)

(A : Type u_1)
[NormedCommRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[StarModule ℂ A]

Function.Bijective ⇑(WeakDual.gelfandTransform ℂ A)


theorem inner_smul_real_left (x y : E) (r : ℝ) : ⟪(r : 𝕜) • x, y⟫ = r • ⟪x, y⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)
(r : ℝ)


/-- The diameter of a union is controlled by the diameter of the sets, and the edistance
between two points in the sets. -/
theorem diam_union {t : Set α} (xs : x ∈ s) (yt : y ∈ t) :
    diam (s ∪ t) ≤ diam s + edist x y + diam t

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}
{s t : Set α}
(xs : x ∈ s)
(yt : y ∈ t)

EMetric.diam (s ∪ t) ≤ EMetric.diam s + edist x y + EMetric.diam t


@[simp]
theorem toIcoMod_sub_self (a b : α) : toIcoMod hp a b - b = -toIcoDiv hp a b • p

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


theorem imageToKernel_comp_right {D : V} (h : C ⟶ D) (w : f ≫ g = 0) :
    imageToKernel f (g ≫ h) (by simp [reassoc_of% w]) =
      imageToKernel f g w ≫ Subobject.ofLE _ _ (kernelSubobject_comp_le g h)

imageToKernel f (g ≫ h) ⋯ =
  imageToKernel f g w ≫ (CategoryTheory.Limits.kernelSubobject g).ofLE (CategoryTheory.Limits.kernelSubobject (g ≫ h)) ⋯


lemma iSup_inf_eq (f : ι → α) (a : α) : (⨆ i, f i) ⊓ a = ⨆ i, f i ⊓ a

{α : Type u}
{ι : Sort w}
(minAx : Order.Frame.MinimalAxioms α)
(f : ι → α)
(a : α)


lemma div_dvd_of_dvd (h : n ∣ m) : m / n ∣ m


lemma IsEquipartition.sum_nonUniforms_lt (hA : A.Nonempty) (hε : 0 < ε) (hP : P.IsEquipartition)
    (hG : P.IsUniform G ε) :
    ((P.nonUniforms G ε).biUnion fun (U, V) ↦ U ×ˢ V).card < 4 * ε * A.card ^ 2

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
{P : Finpartition A}
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε : 𝕜}
(hA : A.Nonempty)
(hε : 0 < ε)
(hP : P.IsEquipartition)
(hG : P.IsUniform G ε)

↑((P.nonUniforms G ε).biUnion fun x =>
        match x with
        | (U, V) => U ×ˢ V).card <
  4 * ε * ↑A.card ^ 2


@[ext]
theorem ext {V : Type u} [Quiver.{v₁} V] {W : Type u₂} [Quiver.{v₂} W] {F G : Prefunctor V W}
    (h_obj : ∀ X, F.obj X = G.obj X)
    (h_map : ∀ (X Y : V) (f : X ⟶ Y),
      F.map f = Eq.recOn (h_obj Y).symm (Eq.recOn (h_obj X).symm (G.map f))) : F = G

(h_map : ∀ (X Y : V) (f : X ⟶ Y), F.map f = Eq.recOn ⋯ (Eq.recOn ⋯ (G.map f)))


/-- If two points belong to some set, their edistance is bounded by the diameter of the set -/
theorem edist_le_diam_of_mem (hx : x ∈ s) (hy : y ∈ s) : edist x y ≤ diam s

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}
{s : Set α}
(hx : x ∈ s)
(hy : y ∈ s)


theorem iInter₂_union (s : ∀ i, κ i → Set α) (t : Set α) :
    (⋂ (i) (j), s i j) ∪ t = ⋂ (i) (j), s i j ∪ t

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
(s : (i : ι) → κ i → Set α)
(t : Set α)

(⋂ i, ⋂ j, s i j) ∪ t = ⋂ i, ⋂ j, s i j ∪ t


theorem filterMap_eq_filter : filterMap (Option.guard p) = filter p

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

Multiset.filterMap (Option.guard p) = Multiset.filter p


theorem finite_univ_iff : (@univ α).Finite ↔ Finite α


/-- Transport being a left adjoint along a natural isomorphism. -/
lemma isLeftAdjoint_of_iso {F G : C ⥤ D} (h : F ≅ G) [IsLeftAdjoint F] :
    IsLeftAdjoint G

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : CategoryTheory.Functor C D}
(h : F ≅ G)
[F.IsLeftAdjoint]


@[simp]
theorem smul_comp [Monoid S] [DistribMulAction S R] [IsScalarTower S R R] (s : S) (p q : R[X]) :
    (s • p).comp q = s • p.comp q

{R : Type u}
{S : Type v}
[Semiring R]
[Monoid S]
[DistribMulAction S R]
[IsScalarTower S R R]
(s : S)
(p q : R[X])


theorem Finite.eq_of_subset_of_encard_le' (hs : s.Finite) (hst : s ⊆ t)
    (hts : t.encard ≤ s.encard) : s = t

{α : Type u_1}
{s t : Set α}
(hs : s.Finite)
(hst : s ⊆ t)
(hts : t.encard ≤ s.encard)


theorem forall_mem_pwFilter [DecidableRel (α := α) R]
    (neg_trans : ∀ {x y z}, R x z → R x y ∨ R y z) (a : α) (l : List α) :
    (∀ b ∈ pwFilter R l, R a b) ↔ ∀ b ∈ l, R a b

(neg_trans : ∀ {x y z : α}, R x z → R x y ∨ R y z)

(∀ (b : α), b ∈ List.pwFilter R l → R a b) ↔ ∀ (b : α), b ∈ l → R a b


@[fun_prop]
theorem HasStrictFDerivAt.multiset_prod [DecidableEq ι] {u : Multiset ι} {x : E}
    (h : ∀ i ∈ u, HasStrictFDerivAt (g i ·) (g' i) x) :
    HasStrictFDerivAt (fun x ↦ (u.map (g · x)).prod)
      (u.map fun i ↦ ((u.erase i).map (g · x)).prod • g' i).sum x

(h : ∀ i ∈ u, HasStrictFDerivAt (fun x => g i x) (g' i) x)

HasStrictFDerivAt (fun x => (Multiset.map (fun x_1 => g x_1 x) u).prod)
  (Multiset.map (fun i => (Multiset.map (fun x_1 => g x_1 x) (u.erase i)).prod • g' i) u).sum x


theorem irrational_sqrt_ratCast_iff_of_nonneg {q : ℚ} (hq : 0 ≤ q) :
    Irrational (√q) ↔ ¬IsSquare q


@[to_additive]
theorem SMulCommClass.of_mclosure_eq_top {N α} [Monoid M] [SMul N α] [MulAction M α] {s : Set M}
    (htop : Submonoid.closure s = ⊤) (hs : ∀ x ∈ s, ∀ (y : N) (z : α), x • y • z = y • x • z) :
    SMulCommClass M N α

(hs : ∀ x ∈ s, ∀ (y : N) (z : α), x +ᵥ (y +ᵥ z) = y +ᵥ (x +ᵥ z))


@[gcongr]
theorem compl_le_compl (h : a ≤ b) : bᶜ ≤ aᶜ

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


theorem completion.map_normNoninc {V W : SemiNormedGrp} {f : V ⟶ W} (hf : f.NormNoninc) :
    (completion.map f).NormNoninc

{V W : SemiNormedGrp}
{f : V ⟶ W}
(hf : NormedAddGroupHom.NormNoninc f)


theorem archimedean_iff_rat_lt : Archimedean α ↔ ∀ x : α, ∃ q : ℚ, x < q


theorem boundary_le_boundary_sup_sup_boundary_inf_right : ∂ b ≤ ∂ (a ⊔ b) ⊔ ∂ (a ⊓ b)

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


theorem dist_summable (x y : ∀ i, F i) :
    Summable fun i : ι => min ((1 / 2) ^ encode i : ℝ) (dist (x i) (y i))

{ι : Type u_2}
[Encodable ι]
{F : ι → Type u_3}
[(i : ι) → MetricSpace (F i)]
(x y : (i : ι) → F i)

Summable fun i => min ((1 / 2) ^ Encodable.encode i) (dist (x i) (y i))


theorem sdiff_right_comm (a b c : α) : (a \ b) \ c = (a \ c) \ b

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
(a b c : α)


@[simp]
theorem comp (x : F.obj X) : (σ ≫ τ).app X x = τ.app X (σ.app X x)

(F G H : CategoryTheory.Functor C (Type w))

(CategoryTheory.CategoryStruct.comp σ τ).app X x = τ.app X (σ.app X x)


theorem rpow_left_injective {x : ℝ} (hx : x ≠ 0) : Function.Injective fun y : ℝ≥0 => y ^ x


@[simp]
theorem symm_symm (e : α ≃+*o β) : e.symm.symm = e

{α : Type u_2}
{β : Type u_3}
[Mul α]
[Add α]
[LE α]
[Mul β]
[Add β]
[LE β]
(e : α ≃+*o β)


protected theorem smooth (f : C^∞⟮I, M; I', M'⟯) : Smooth I I' f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{H' : Type u_5}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
(f : C^⊤⟮I, M; I', M'⟯)


theorem castHom_injective : Function.Injective (ZMod.castHom (dvd_refl n) R)

{n : ℕ}
(R : Type u_1)
[Ring R]
[CharP R n]


theorem chartedSpaceSelf_prod : prodChartedSpace H H H' H' = chartedSpaceSelf (H × H')

{H : Type u}
{H' : Type u_1}
[TopologicalSpace H]
[TopologicalSpace H']


@[simp]
theorem merge_node {ls ll lx lr rs rl rx rr} :
    merge (@node α ls ll lx lr) (node rs rl rx rr) =
      if delta * ls < rs then balanceL (merge (node ls ll lx lr) rl) rx rr
      else if delta * rs < ls then balanceR ll lx (merge lr (node rs rl rx rr))
      else glue (node ls ll lx lr) (node rs rl rx rr)

{α : Type u_1}
{ls : ℕ}
{ll : Ordnode α}
{lx : α}
{lr : Ordnode α}
{rs : ℕ}
{rl : Ordnode α}
{rx : α}
{rr : Ordnode α}

(Ordnode.node ls ll lx lr).merge (Ordnode.node rs rl rx rr) =
  if Ordnode.delta * ls < rs then ((Ordnode.node ls ll lx lr).merge rl).balanceL rx rr
  else
    if Ordnode.delta * rs < ls then ll.balanceR lx (lr.merge (Ordnode.node rs rl rx rr))
    else (Ordnode.node ls ll lx lr).glue (Ordnode.node rs rl rx rr)


theorem size_mapM [Monad m] [LawfulMonad m] (f : α → m β) (as : Array α) :
    SatisfiesM (fun arr => arr.size = as.size) (Array.mapM f as)

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(f : α → m β)
(as : Array α)


@[simp]
theorem Ici_prod_Ici (a : α) (b : β) : Iic a ×ˢ Iic b = Iic (a, b)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(a : α)
(b : β)

LowerSet.Iic a ×ˢ LowerSet.Iic b = LowerSet.Iic (a, b)


theorem nonempty_of_not_isBounded (h : ¬IsBounded s) : s.Nonempty

∀ {x : Bornology α} {s : Set α}, ¬Bornology.IsBounded s → s.Nonempty


theorem adjoin_algebraMap (s : Set S) :
    adjoin R (algebraMap S A '' s) = (adjoin R s).map (IsScalarTower.toAlgHom R S A)

(R : Type uR)
{S : Type uS}
(A : Type uA)
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Algebra R S]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
(s : Set S)

Algebra.adjoin R (⇑(algebraMap S A) '' s) = Subalgebra.map (IsScalarTower.toAlgHom R S A) (Algebra.adjoin R s)


theorem span_set_smul [SMulCommClass S R M] (s : Set S) (t : Set M) :
    span R (s • t) = s • span R t

{R : Type u_2}
{M : Type u_3}
[Semiring R]
{S : Type u_4}
[Monoid S]
[AddCommMonoid M]
[Module R M]
[DistribMulAction S M]
[SMulCommClass S R M]
(s : Set S)
(t : Set M)

Submodule.span R (s • t) = s • Submodule.span R t


@[simp] theorem findEntryP?_eq (p : α → β → Bool) (l : AssocList α β) :
    findEntryP? p l = l.toList.find? fun (a, b) => p a b

{α : Type u_1}
{β : Type u_2}
(p : α → β → Bool)
(l : Batteries.AssocList α β)

Batteries.AssocList.findEntryP? p l =
  List.find?
    (fun x =>
      match x with
      | (a, b) => p a b)
    l.toList


/-- A functor `RF : D ⥤ H` is a right derived functor of `F : C ⥤ H`
if it is equipped with a natural transformation `α : F ⟶ L ⋙ RF`
which makes it a left Kan extension of `F` along `L`,
where `L : C ⥤ D` is a localization functor for `W : MorphismProperty C`. -/
class IsRightDerivedFunctor [L.IsLocalization W] : Prop where
  isLeftKanExtension' : RF.IsLeftKanExtension α

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} H]
{RF : CategoryTheory.Functor D H}
{F : CategoryTheory.Functor C H}
{L : CategoryTheory.Functor C D}
{α : F ⟶ L.comp RF}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[self : RF.IsRightDerivedFunctor α W]


theorem le_iSup (f : ι → α) (i : ι) : f i ≤ iSup f

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
(f : ι → α)
(i : ι)


private theorem ncs_tendsto_lim :
    Tendsto (fun i => ‖F.derivative.eval (ncs i)‖) atTop (𝓝 ‖F.derivative.eval ncs.lim‖)

{p : ℕ}
[Fact (Nat.Prime p)]
{ncs : CauSeq ℤ_[p] norm}
{F : Polynomial ℤ_[p]}

Filter.Tendsto (fun i => ‖Polynomial.eval (↑ncs i) (Polynomial.derivative F)‖) Filter.atTop
  (𝓝 ‖Polynomial.eval ncs.lim (Polynomial.derivative F)‖)


/-- Two dependent pairs of tensor products are equal if their index is equal and the contents
are equal after a canonical reindexing. -/
@[ext]
theorem gradedMonoid_eq_of_reindex_cast {ιι : Type*} {ι : ιι → Type*} :
    ∀ {a b : GradedMonoid fun ii => ⨂[R] _ : ι ii, M} (h : a.fst = b.fst),
      reindex R (fun _ ↦ M) (Equiv.cast <| congr_arg ι h) a.snd = b.snd → a = b

{a b : GradedMonoid fun ii => ⨂[R] (x : ι ii), M}

(PiTensorProduct.reindex R (fun x => M) (Equiv.cast ⋯)) a.snd = b.snd → a = b


theorem mem_of_mem_join {a : α} {x : Option (Option α)} (h : a ∈ x.join) : some a ∈ x

{α : Type u_1}
{a : α}
{x : Option (Option α)}
(h : a ∈ x.join)


{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
(a : α)


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


@[measurability]
theorem measurable_coe_nnreal_real : Measurable ((↑) : ℝ≥0 → ℝ)


@[simp] lemma coeff_mul_intCast [Ring S] {p : S[X]} {a : ℤ} {k : ℕ} :
  coeff (p * (a : S[X])) k = coeff p k * (↑a : S)

{S : Type v}
[Ring S]
{p : S[X]}
{a : ℤ}
{k : ℕ}


@[simp]
theorem conjCLE_apply (z : ℂ) : conjCLE z = conj z


/--
`natDegree` version of the above theorem.
Note this would be false with just `(ha : a ≠ 0) (hb : b ≠ 0),
as when `a = b = 1` we have `(wronskian a b).natDegree = a.natDegree = b.natDegree = 0`.
-/
theorem natDegree_wronskian_lt_add {a b : R[X]} (hw : wronskian a b ≠ 0) :
    (wronskian a b).natDegree < a.natDegree + b.natDegree

{R : Type u_1}
[CommRing R]
{a b : R[X]}
(hw : a.wronskian b ≠ 0)

(a.wronskian b).natDegree < a.natDegree + b.natDegree


/-- An element of a star monoid is normal if it commutes with its adjoint. -/
@[mk_iff]
class IsStarNormal [Mul R] [Star R] (x : R) : Prop where
  /-- A normal element of a star monoid commutes with its adjoint. -/
  star_comm_self : Commute (star x) x

{R : Type u_1}
[Mul R]
[Star R]
{x : R}
[self : IsStarNormal x]


/-- The forgetful functor `AffineScheme ⥤ Scheme`. -/
@[simps!]
def forgetToScheme : AffineScheme ⥤ Scheme

(self : CategoryTheory.FullSubcategory AlgebraicGeometry.Scheme.Spec.essImage)

AlgebraicGeometry.AffineScheme.forgetToScheme.obj self = self.obj


@[simp]
theorem mem_coe {I : FractionalIdeal S P} {x : P} : x ∈ (I : Submodule R P) ↔ x ∈ I

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

x ∈ ↑I ↔ x ∈ I


@[simp]
theorem equivCongr_symm (e : A₁ ≃ₐ[R] A₂) (e' : A₁' ≃ₐ[R] A₂') :
    (equivCongr e e').symm = equivCongr e.symm e'.symm

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
{A₁' : Type uA₁'}
{A₂' : Type uA₂'}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Semiring A₁']
[Semiring A₂']
[Algebra R A₁]
[Algebra R A₂]
[Algebra R A₁']
[Algebra R A₂']
(e : A₁ ≃ₐ[R] A₂)
(e' : A₁' ≃ₐ[R] A₂')

(e.equivCongr e').symm = e.symm.equivCongr e'.symm


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

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(f : α →o β)
(f' : α → β)
(h : f' = ⇑f)


/-- Being well-powered is preserved by equivalences, as long as the two categories involved have
    their morphisms in the same universe. -/
theorem wellPowered_congr (e : C ≌ D) : WellPowered C ↔ WellPowered D

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

CategoryTheory.WellPowered C ↔ CategoryTheory.WellPowered D


theorem IsVonNBounded.smul_tendsto_zero [NormedField 𝕜]
    [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E]
    {S : Set E} {ε : ι → 𝕜} {x : ι → E} {l : Filter ι}
    (hS : IsVonNBounded 𝕜 S) (hxS : ∀ᶠ n in l, x n ∈ S) (hε : Tendsto ε l (𝓝 0)) :
    Tendsto (ε • x) l (𝓝 0)

{𝕜 : Type u_1}
{E : Type u_3}
{ι : Type u_6}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
{S : Set E}
{ε : ι → 𝕜}
{x : ι → E}
{l : Filter ι}
(hS : Bornology.IsVonNBounded 𝕜 S)
(hxS : ∀ᶠ (n : ι) in l, x n ∈ S)
(hε : Filter.Tendsto ε l (𝓝 0))


@[to_additive]
theorem contMDiffAt_one [One M'] : ContMDiffAt I I' n (1 : M → M') 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]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{x : M}
{n : ℕ∞}
[One M']


theorem separable_X_add_C (a : R) : (X + C a).Separable

(Polynomial.X + Polynomial.C a).Separable


/-- Whisker a cocone by precomposition of a functor. See `whiskering` for a functorial
version.
-/
@[simps]
def whisker (E : K ⥤ J) (c : Cocone F) : Cocone (E ⋙ F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(E : K ⥤ J)
(c : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Limits.Cocone.whisker E c).pt = c.pt


@[simp]
theorem mem_Ioo : x ∈ Ioo a b ↔ a < x ∧ x < b

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b x : α}


theorem one_add_coe_ne_zero (z : 𝔻) : (1 + z : ℂ) ≠ 0


/-- A measure is σ-finite with respect to filtration if it is σ-finite with respect
to all the sub-σ-algebra of the filtration. -/
class SigmaFiniteFiltration [Preorder ι] (μ : Measure Ω) (f : Filtration ι m) : Prop where
  SigmaFinite : ∀ i : ι, SigmaFinite (μ.trim (f.le i))

[self : MeasureTheory.SigmaFiniteFiltration μ f]


/-- `LinearMap.proj` as an isometry, when all but one quadratic form is zero. -/
@[simps!]
def Isometry.proj [Fintype ι] [DecidableEq ι] (i : ι) (Q : QuadraticMap R (Mᵢ i) P) :
    pi (Pi.single i Q) →qᵢ Q

{ι : Type u_1}
{R : Type u_2}
{P : Type u_7}
{Mᵢ : ι → Type u_8}
[CommSemiring R]
[(i : ι) → AddCommMonoid (Mᵢ i)]
[AddCommMonoid P]
[(i : ι) → Module R (Mᵢ i)]
[Module R P]
[Fintype ι]
[DecidableEq ι]
(i : ι)
(Q : QuadraticMap R (Mᵢ i) P)
(f : (x : ι) → Mᵢ x)

(QuadraticMap.Isometry.proj i Q) f = f i


@[simp]
protected theorem neg_smul [DecidableEq α] : -s • t = -(s • t)

{α : Type u_2}
{β : Type u_3}
[Ring α]
[AddCommGroup β]
[Module α β]
[DecidableEq β]
{s : Finset α}
{t : Finset β}
[DecidableEq α]


theorem prev : ∀ {s}, ValidFor l (m₁ ++ c :: m₂) r s →
    s.prev ⟨utf8Len m₁ + c.utf8Size⟩ = ⟨utf8Len m₁⟩

{l m₁ : List Char}
{c : Char}
{m₂ r : List Char}
{s : Substring}

Substring.ValidFor l (m₁ ++ c :: m₂) r s →
  s.prev { byteIdx := String.utf8Len m₁ + c.utf8Size } = { byteIdx := String.utf8Len m₁ }


theorem ofDual {a b : αᵒᵈ} (h : IsCompl a b) : IsCompl (ofDual a) (ofDual b)

{α : Type u_1}
[PartialOrder α]
[BoundedOrder α]
{a b : αᵒᵈ}
(h : IsCompl a b)

IsCompl (OrderDual.ofDual a) (OrderDual.ofDual b)


@[to_additive sum_le_card_nsmul]
theorem prod_le_pow_card (s : Finset ι) (f : ι → N) (n : N) (h : ∀ x ∈ s, f x ≤ n) :
    s.prod f ≤ n ^ s.card

{ι : Type u_1}
{N : Type u_5}
[OrderedCommMonoid N]
(s : Finset ι)
(f : ι → N)
(n : N)
(h : ∀ x ∈ s, f x ≤ n)


@[simp]
theorem eqToHom_whiskerRight {X Y : C} (f : X = Y) (Z : C) :
    eqToHom f ▷ Z = eqToHom (congr_arg₂ tensorObj f rfl)

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

CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.eqToHom f) Z = CategoryTheory.eqToHom ⋯


/-- Fixing an element `a : α` gives an embedding `β ↪ α × β`. -/
@[simps]
def sectr {α : Sort _} (a : α) (β : Sort _) : β ↪ α × β

{α : Type u_1}
(a : α)
(β : Type u_2)
(b : β)

(Function.Embedding.sectr a β) b = (a, b)


lemma ComplexShape.QFactorsThroughHomotopy_of_exists_prev [CategoryWithHomology C] :
    c.QFactorsThroughHomotopy C


@[to_additive]
theorem orderOf_pow' (h : n ≠ 0) : orderOf (x ^ n) = orderOf x / gcd (orderOf x) n

{G : Type u_1}
[Monoid G]
(x : G)
{n : ℕ}
(h : n ≠ 0)

orderOf (x ^ n) = orderOf x / (orderOf x).gcd n


/-- Proof used in definition of `Finset.noncommProd` -/
@[to_additive]
theorem noncommProd_lemma (s : Finset α) (f : α → β)
    (comm : (s : Set α).Pairwise fun a b => Commute (f a) (f b)) :
    Set.Pairwise { x | x ∈ Multiset.map f s.val } Commute

(comm : (↑s).Pairwise fun a b => AddCommute (f a) (f b))

{x | x ∈ Multiset.map f s.val}.Pairwise AddCommute


@[simp] theorem getLsb_append {v : BitVec n} {w : BitVec m} :
    getLsb (v ++ w) i = bif i < m then getLsb w i else getLsb v (i - m)

{n m i : Nat}
{v : BitVec n}
{w : BitVec m}

(v ++ w).getLsb i = bif decide (i < m) then w.getLsb i else v.getLsb (i - m)


@[measurability]
theorem measurable_arg : Measurable arg


@[to_additive] lemma prod_eq_one_iff : m.prod = 1 ↔ ∀ x ∈ m, x = (1 : α)

{α : Type u_2}
[CanonicallyOrderedCommMonoid α]
{m : Multiset α}


/-- A `DivInvMonoid` is a `Monoid` with operations `/` and `⁻¹` satisfying
`div_eq_mul_inv : ∀ a b, a / b = a * b⁻¹`.

This deduplicates the name `div_eq_mul_inv`.
The default for `div` is such that `a / b = a * b⁻¹` holds by definition.

Adding `div` as a field rather than defining `a / b := a * b⁻¹` allows us to
avoid certain classes of unification failures, for example:
Let `Foo X` be a type with a `∀ X, Div (Foo X)` instance but no
`∀ X, Inv (Foo X)`, e.g. when `Foo X` is a `EuclideanDomain`. Suppose we
also have an instance `∀ X [Cromulent X], GroupWithZero (Foo X)`. Then the
`(/)` coming from `GroupWithZero.div` cannot be definitionally equal to
the `(/)` coming from `Foo.Div`.

In the same way, adding a `zpow` field makes it possible to avoid definitional failures
in diamonds. See the definition of `Monoid` and Note [forgetful inheritance] for more
explanations on this.
-/
class DivInvMonoid (G : Type u) extends Monoid G, Inv G, Div G where
  protected div := DivInvMonoid.div'
  /-- `a / b := a * b⁻¹` -/
  protected div_eq_mul_inv : ∀ a b : G, a / b = a * b⁻¹ := by intros; rfl
  /-- The power operation: `a ^ n = a * ··· * a`; `a ^ (-n) = a⁻¹ * ··· a⁻¹` (`n` times) -/
  protected zpow : ℤ → G → G := zpowRec npowRec
  /-- `a ^ 0 = 1` -/
  protected zpow_zero' : ∀ a : G, zpow 0 a = 1 := by intros; rfl
  /-- `a ^ (n + 1) = a ^ n * a` -/
  protected zpow_succ' (n : ℕ) (a : G) : zpow (Int.ofNat n.succ) a = zpow (Int.ofNat n) a  * a := by
    intros; rfl
  /-- `a ^ -(n + 1) = (a ^ (n + 1))⁻¹` -/
  protected zpow_neg' (n : ℕ) (a : G) : zpow (Int.negSucc n) a = (zpow n.succ a)⁻¹ := by intros; rfl

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


theorem fromZetaAut_spec : fromZetaAut hμ h (zeta n K L) = μ

(h : Irreducible (Polynomial.cyclotomic (↑n) K))

(IsCyclotomicExtension.fromZetaAut hμ h) (IsCyclotomicExtension.zeta n K L) = μ


@[simp]
theorem spanSingleton_zero : spanSingleton S (0 : P) = 0

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


theorem Subalgebra.toNonUnitalSubalgebra_toSubalgebra (S : Subalgebra R A) :
    S.toNonUnitalSubalgebra.toSubalgebra S.one_mem = S

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)

S.toNonUnitalSubalgebra.toSubalgebra ⋯ = S


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


theorem HasDerivWithinAt.congr (h : HasDerivWithinAt f f' s x) (hs : ∀ x ∈ s, f₁ x = f x)
    (hx : f₁ x = f x) : HasDerivWithinAt f₁ f' s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s : Set 𝕜}
(h : HasDerivWithinAt f f' s x)
(hs : ∀ x ∈ s, f₁ x = f x)
(hx : f₁ x = f x)


@[simp]
theorem baseChange_tmul (Q : QuadraticForm R M₂) (a : A) (m₂ : M₂) :
    Q.baseChange A (a ⊗ₜ m₂) = Q m₂ • (a * a)

{R : Type uR}
{A : Type uA}
{M₂ : Type uM₂}
[CommRing R]
[CommRing A]
[AddCommGroup M₂]
[Algebra R A]
[Module R M₂]
[Invertible 2]
(Q : QuadraticForm R M₂)
(a : A)
(m₂ : M₂)

(QuadraticForm.baseChange A Q) (a ⊗ₜ[R] m₂) = Q m₂ • (a * a)


theorem smooth_const : Smooth I I' fun _ : M => c

{𝕜 : 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]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{c : M'}


theorem Filter.Tendsto.compMeasurePreservingLp {α : Type*} {l : Filter α}
    {f : α → Lp E p ν} {f₀ : Lp E p ν} {g : α → C(X, Y)} {g₀ : C(X, Y)}
    (hf : Tendsto f l (𝓝 f₀)) (hg : Tendsto g l (𝓝 g₀))
    (hgm : ∀ a, MeasurePreserving (g a) μ ν) (hgm₀ : MeasurePreserving g₀ μ ν) (hp : p ≠ ∞) :
    Tendsto (fun a ↦ Lp.compMeasurePreserving (g a) (hgm a) (f a)) l
      (𝓝 (Lp.compMeasurePreserving g₀ hgm₀ f₀))

(hgm : ∀ (a : α), MeasureTheory.MeasurePreserving (⇑(g a)) μ ν)

(hgm₀ : MeasureTheory.MeasurePreserving (⇑g₀) μ ν)

Filter.Tendsto (fun a => (MeasureTheory.Lp.compMeasurePreserving ⇑(g a) ⋯) (f a)) l
  (𝓝 ((MeasureTheory.Lp.compMeasurePreserving (⇑g₀) hgm₀) f₀))


@[simp]
theorem ofMul_inv [Inv α] (x : α) : ofMul x⁻¹ = -ofMul x


theorem mk_wcovBy_mk_iff : (a₁, b₁) ⩿ (a₂, b₂) ↔ a₁ ⩿ a₂ ∧ b₁ = b₂ ∨ b₁ ⩿ b₂ ∧ a₁ = a₂

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
{a₁ a₂ : α}
{b₁ b₂ : β}


@[to_additive (attr := simp) MeasureTheory.sdiff_addFundamentalInterior]
theorem sdiff_fundamentalInterior : s \ fundamentalInterior G s = fundamentalFrontier G s

(G : Type u_1)
{α : Type u_3}
[AddGroup G]
[AddAction G α]
(s : Set α)

s \ MeasureTheory.addFundamentalInterior G s = MeasureTheory.addFundamentalFrontier G s


@[simp]
theorem foldr_mul (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) (a b : CliffordAlgebra Q) :
    foldr Q f hf n (a * b) = foldr Q f hf (foldr Q f hf n b) a

((CliffordAlgebra.foldr Q f hf) n) (a * b) = ((CliffordAlgebra.foldr Q f hf) (((CliffordAlgebra.foldr Q f hf) n) b)) a


theorem segment_translate_image (a b c : E) : (fun x => a + x) '' [b -[𝕜] c] = [a + b -[𝕜] a + c]

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(a b c : E)


protected theorem t0Space [T0Space X] (h : X ≃ₜ Y) : T0Space Y

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


/-- Given two model_with_corners `I` on `(E, H)` and `I'` on `(E', H')`, we define the model with
corners `I.prod I'` on `(E × E', ModelProd H H')`. This appears in particular for the manifold
structure on the tangent bundle to a manifold modelled on `(E, H)`: it will be modelled on
`(E × E, H × E)`. See note [Manifold type tags] for explanation about `ModelProd H H'`
vs `H × H'`. -/
@[simps (config := .lemmasOnly)]
def ModelWithCorners.prod {𝕜 : Type u} [NontriviallyNormedField 𝕜] {E : Type v}
    [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type w} [TopologicalSpace H]
    (I : ModelWithCorners 𝕜 E H) {E' : Type v'} [NormedAddCommGroup E'] [NormedSpace 𝕜 E']
    {H' : Type w'} [TopologicalSpace H'] (I' : ModelWithCorners 𝕜 E' H') :
    ModelWithCorners 𝕜 (E × E') (ModelProd H H')

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type w}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{E' : Type v'}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type w'}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
(x : ModelProd H H')


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

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]

∀ {X Y : CategoryTheory.ShortComplex.SnakeInput C} (f : X ⟶ Y),
  CategoryTheory.ShortComplex.SnakeInput.functorL₂.map f = f.f₂


theorem eraseLead_add_of_natDegree_lt_right {p q : R[X]} (pq : p.natDegree < q.natDegree) :
    (p + q).eraseLead = p + q.eraseLead

{R : Type u_1}
[Semiring R]
{p q : R[X]}
(pq : p.natDegree < q.natDegree)


theorem integrable_swap_iff [SFinite μ] {f : α × β → E} :
    Integrable (f ∘ Prod.swap) (ν.prod μ) ↔ Integrable f (μ.prod ν)

{α : Type u_1}
{β : Type u_3}
{E : Type u_6}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[NormedAddCommGroup E]
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
{f : α × β → E}

MeasureTheory.Integrable (f ∘ Prod.swap) (ν.prod μ) ↔ MeasureTheory.Integrable f (μ.prod ν)


/-- The ring equiv between the top element of `Subsemiring R` and `R`. -/
@[simps]
def topEquiv : (⊤ : Subsemiring R) ≃+* R

{R : Type u}
[NonAssocSemiring R]
(r : R)


@[to_additive]
theorem isComplement_univ_right : IsComplement S univ ↔ ∃ g : G, S = {g}

AddSubgroup.IsComplement S Set.univ ↔ ∃ g, S = {g}


theorem IntegrableAtFilter.filter_mono (hl : l ≤ l') (hl' : IntegrableAtFilter f l' μ) :
    IntegrableAtFilter f l μ

(hl' : MeasureTheory.IntegrableAtFilter f l' μ)


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

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


/-- **Pigeonhole principle** for two finsets inside an ambient finset. -/
theorem inter_nonempty_of_card_lt_card_add_card (hts : t ⊆ s) (hus : u ⊆ s)
    (hstu : s.card < t.card + u.card) : (t ∩ u).Nonempty

{α : Type u_1}
{s t u : Finset α}
[DecidableEq α]
(hts : t ⊆ s)
(hus : u ⊆ s)
(hstu : s.card < t.card + u.card)


@[simp]
theorem coe_pnatDen (x : ℚ) : (x.pnatDen : ℕ) = x.den


@[ext high]
theorem ringHom_ext' {S} [Semiring S] {f g : R[X] →+* S} (h₁ : f.comp C = g.comp C)
    (h₂ : f X = g X) : f = g

(h₁ : f.comp Polynomial.C = g.comp Polynomial.C)


theorem funext₃ {β : α → Sort _} {γ : ∀ a, β a → Sort _} {δ : ∀ a b, γ a b → Sort _}
    {f g : ∀ a b c, δ a b c} (h : ∀ a b c, f a b c = g a b c) : f = g

{δ : (a : α) → (b : β a) → γ a b → Sort u_4}

{f g : (a : α) → (b : β a) → (c : γ a b) → δ a b c}

(h : ∀ (a : α) (b : β a) (c : γ a b), f a b c = g a b c)


theorem heq_prop {P Q : Prop} (p : P) (q : Q) : HEq p q


@[ext]
theorem EuclideanQuadrant.ext (x y : EuclideanQuadrant n) (h : x.1 = y.1) : x = y

{n : ℕ}
(x y : EuclideanQuadrant n)
(h : ↑x = ↑y)


@[simp, rclike_simps, norm_cast]
theorem ofReal_finsupp_sum {α M : Type*} [Zero M] (f : α →₀ M) (g : α → M → ℝ) :
    ((f.sum fun a b => g a b : ℝ) : K) = f.sum fun a b => (g a b : K)

{K : Type u_1}
[RCLike K]
{α : Type u_3}
{M : Type u_4}
[Zero M]
(f : α →₀ M)
(g : α → M → ℝ)

↑(f.sum fun a b => g a b) = f.sum fun a b => ↑(g a b)


lemma iSup_unique [Unique ι] (f : ι → α) : ⨆ i, f i = f default

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
[Unique ι]
(f : ι → α)


@[to_additive]
theorem isComplement_iff_existsUnique :
    IsComplement S T ↔ ∀ g : G, ∃! x : S × T, x.1.1 * x.2.1 = g

{G : Type u_1}
[AddGroup G]
{S T : Set G}

AddSubgroup.IsComplement S T ↔ ∀ (g : G), ∃! x, ↑x.1 + ↑x.2 = g


/-- `f z ^ g z` is analytic if `f z` is not a nonpositive real -/
theorem AnalyticAt.cpow (fa : AnalyticAt ℂ f x) (ga : AnalyticAt ℂ g x)
    (m : f x ∈ slitPlane) : AnalyticAt ℂ (fun z ↦ f z ^ g z) x

{E : Type}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f g : E → ℂ}
{x : E}
(fa : AnalyticAt ℂ f x)
(ga : AnalyticAt ℂ g x)
(m : f x ∈ Complex.slitPlane)


theorem chain_of_chain_cons {a b : α} {l : List α} (p : Chain R a (b :: l)) : Chain R b l

{α : Type u_1}
{R : α → α → Prop}
{a b : α}
{l : List α}
(p : List.Chain R a (b :: l))


/-- The subpresheaf of dependent functions on `X` satisfying the "pre-local" predicate `P`.
-/
@[simps!]
def subpresheafToTypes (P : PrelocalPredicate T) : Presheaf (Type v) X

{X : TopCat}
{T : ↑X → Type v}
(P : TopCat.PrelocalPredicate T)
{U V : (TopologicalSpace.Opens ↑X)ᵒᵖ}
(i : U ⟶ V)
(f : { f // P.pred f })
(x : ↥(Opposite.unop V))

↑((TopCat.subpresheafToTypes P).map i f) x = ↑f ⟨↑x, ⋯⟩


lemma gaussianPDF_pos (μ : ℝ) {v : ℝ≥0} (hv : v ≠ 0) (x : ℝ) : 0 < gaussianPDF μ v x


/-- See `tsub_add_tsub_comm` for the equality. -/
theorem add_tsub_add_le_tsub_add_tsub : a + b - (c + d) ≤ a - c + (b - d)


lemma tensor_map_id_left_injective_of_injective (hf : Function.Injective f) :
    Function.Injective (AlgebraTensorModule.map LinearMap.id f :
        AdicCompletion I R ⊗[R] M →ₗ[AdicCompletion I R] AdicCompletion I R ⊗[R] N)

{R : Type u}
[CommRing R]
(I : Ideal R)
[IsNoetherianRing R]
{M : Type u}
[AddCommGroup M]
[Module R M]
{N : Type u}
[AddCommGroup N]
[Module R N]
{f : M →ₗ[R] N}
[Module.Finite R M]
[Module.Finite R N]
(hf : Function.Injective ⇑f)

Function.Injective ⇑(TensorProduct.AlgebraTensorModule.map LinearMap.id f)


@[to_additive (attr := simp)]
lemma continuousAt_inv_iff : ContinuousAt f⁻¹ x ↔ ContinuousAt f x

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[InvolutiveNeg G]
[ContinuousNeg G]
[TopologicalSpace α]
{f : α → G}
{x : α}


lemma map_equiv_eq_comap_symm (f : α ≃o β) (L : Sublattice α) :
    L.map f = L.comap (f.symm : LatticeHom β α)

{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
(f : α ≃o β)
(L : Sublattice α)

Sublattice.map { toFun := ⇑f, map_sup' := ⋯, map_inf' := ⋯ } L =
  Sublattice.comap { toFun := ⇑f.symm, map_sup' := ⋯, map_inf' := ⋯ } L


theorem comap_uniformity_le (hf : AntilipschitzWith K f) : (𝓤 β).comap (Prod.map f f) ≤ 𝓤 α

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : AntilipschitzWith K f)


theorem span_mul_span (S T : Set R) : span S * span T = span (⋃ (s ∈ S) (t ∈ T), {s * t})

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

Ideal.span S * Ideal.span T = Ideal.span (⋃ s ∈ S, ⋃ t ∈ T, {s * t})


/-- See `zero_lt_two'` for a version with the type explicit. -/
@[simp] lemma zero_lt_two : (0 : α) < 2

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


theorem Nodup.pmap {p : α → Prop} {f : ∀ a, p a → β} {l : List α} {H}
    (hf : ∀ a ha b hb, f a ha = f b hb → a = b) (h : Nodup l) : Nodup (pmap f l H)

(hf : ∀ (a : α) (ha : p a) (b : α) (hb : p b), f a ha = f b hb → a = b)


@[deprecated map_finsupp_prod (since := "2024-06-20")]
protected theorem map_finsupp_prod {α : Type*} [Zero α] {ι : Type*} (f : ι →₀ α) (g : ι → α → A₁) :
    e (f.prod g) = f.prod fun i a => e (g i a)

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[CommSemiring A₁]
[CommSemiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)
{α : Type u_1}
[Zero α]
{ι : Type u_2}
(f : ι →₀ α)
(g : ι → α → A₁)


theorem Tendsto.eventually_forall_ge_atTop [Preorder β] {l : Filter α}
    {p : β → Prop} {f : α → β} (hf : Tendsto f l atTop) (h_evtl : ∀ᶠ x in atTop, p x) :
    ∀ᶠ x in l, ∀ y, f x ≤ y → p y

(h_evtl : ∀ᶠ (x : β) in Filter.atTop, p x)

∀ᶠ (x : α) in l, ∀ (y : β), f x ≤ y → p y


theorem continuousAt_extend {x : M} (h : x ∈ f.source) : ContinuousAt (f.extend I) x

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


lemma equiv_comp [HasSmallLocalizedShiftedHom.{w} W M X Y]
    [HasSmallLocalizedShiftedHom.{w} W M Y Z] [HasSmallLocalizedShiftedHom.{w} W M X Z]
    [HasSmallLocalizedShiftedHom.{w} W M Z Z] {a b c : M}
    (f : SmallShiftedHom.{w} W X Y a) (g : SmallShiftedHom.{w} W Y Z b) (h : b + a = c) :
    equiv W L (f.comp g h) = (equiv W L f).comp (equiv W L g) h

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M X Y]

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M Y Z]

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M X Z]

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M Z Z]

(f : CategoryTheory.Localization.SmallShiftedHom W X Y a)

(g : CategoryTheory.Localization.SmallShiftedHom W Y Z b)

(CategoryTheory.Localization.SmallShiftedHom.equiv W L) (f.comp g h) =
  ((CategoryTheory.Localization.SmallShiftedHom.equiv W L) f).comp
    ((CategoryTheory.Localization.SmallShiftedHom.equiv W L) g) h


@[to_additive]
theorem card_mul_le : (s * t).card ≤ s.card * t.card

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


theorem mellinInv_eq_fourierIntegralInv (σ : ℝ) (f : ℂ → E) {x : ℝ} (hx : 0 < x) :
    mellinInv σ f x =
    (x : ℂ) ^ (-σ : ℂ) • 𝓕⁻ (fun (y : ℝ) ↦ f (σ + 2 * π * y * I)) (-Real.log x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(σ : ℝ)
(f : ℂ → E)
{x : ℝ}
(hx : 0 < x)

mellinInv σ f x = ↑x ^ (-↑σ) • 𝓕⁻ (fun y => f (↑σ + 2 * ↑π * ↑y * Complex.I)) (-Real.log x)


@[simp]
theorem associatesEquivIsPrincipal_map_one :
    (associatesEquivIsPrincipal R 1 : Ideal R) = 1

{R : Type u_1}
[CommRing R]
[IsDomain R]

↑((Ideal.associatesEquivIsPrincipal R) 1) = 1


theorem setToFun_smul [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E] [NormedSpace 𝕜 F]
    (hT : DominatedFinMeasAdditive μ T C) (h_smul : ∀ c : 𝕜, ∀ s x, T s (c • x) = c • T s x) (c : 𝕜)
    (f : α → E) : setToFun μ T hT (c • f) = c • setToFun μ T hT f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(h_smul : ∀ (c : 𝕜) (s : Set α) (x : E), (T s) (c • x) = c • (T s) x)

MeasureTheory.setToFun μ T hT (c • f) = c • MeasureTheory.setToFun μ T hT f


lemma of_le (P Q : MorphismProperty C) (F : C ⥤ D) (hQ : Q.IsInvertedBy F) (h : P ≤ Q) :
    P.IsInvertedBy F

(P Q : CategoryTheory.MorphismProperty C)


@[measurability, fun_prop]
theorem AEMeasurable.ennreal_toNNReal {f : α → ℝ≥0∞} {μ : Measure α} (hf : AEMeasurable f μ) :
    AEMeasurable (fun x => (f x).toNNReal) μ

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


theorem orthonormal_empty : Orthonormal 𝕜 (fun x => x : (∅ : Set E) → E)

(𝕜 : Type u_1)
(E : Type u_2)
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]


@[simp]
theorem toIocMod_sub_zsmul (a b : α) (m : ℤ) : toIocMod hp a (b - m • p) = toIocMod hp a b

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


@[to_additive (attr := simp)]
theorem elim_mulSingle_one [DecidableEq α] [DecidableEq β] [One γ] (i : α) (c : γ) :
    Sum.elim (Pi.mulSingle i c) (1 : β → γ) = Pi.mulSingle (Sum.inl i) c

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[DecidableEq α]
[DecidableEq β]
[One γ]
(i : α)
(c : γ)

Sum.elim (Pi.mulSingle i c) 1 = Pi.mulSingle (Sum.inl i) c


theorem ofNat_sub_eq_zero {b a : Nat} (h : ¬ b ≤ a) : ((a - b : Nat) : Int) = 0


/-- A bijective morphism of Lie algebras yields an equivalence of Lie algebras. -/
@[simps!]
noncomputable def ofBijective (f : L₁ →ₗ⁅R⁆ L₂) (h : Function.Bijective f) : L₁ ≃ₗ⁅R⁆ L₂

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

∀ (a : L₂), (LieEquiv.ofBijective f h).invFun a = (LinearEquiv.ofBijective (↑f) h).symm a


theorem openSegment_subset (x y : E × F) :
    openSegment 𝕜 x y ⊆ openSegment 𝕜 x.1 y.1 ×ˢ openSegment 𝕜 x.2 y.2

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(x y : E × F)


/-- Constructor for isomorphisms `F ≅ G` in `ComposableArrows C n` which takes as inputs
a family of isomorphisms `F.obj i ≅ G.obj i` and the naturality condition only for the
maps in `Fin (n + 1)` given by inequalities of the form `i ≤ i + 1`. -/
@[simps]
def isoMk {F G : ComposableArrows C n} (app : ∀ i, F.obj i ≅ G.obj i)
    (w : ∀ (i : ℕ) (hi : i < n),
      F.map' i (i + 1) ≫ (app _).hom = (app _).hom ≫ G.map' i (i + 1)) :
    F ≅ G

{F G : CategoryTheory.ComposableArrows C n}

(app : (i : Fin (n + 1)) → F.obj i ≅ G.obj i)

(w :
  ∀ (i : ℕ) (hi : i < n),
    CategoryTheory.CategoryStruct.comp (F.map' i (i + 1) ⋯ hi) (app ⟨i + 1, ⋯⟩).hom =
      CategoryTheory.CategoryStruct.comp (app ⟨i, ⋯⟩).hom (G.map' i (i + 1) ⋯ hi))

(CategoryTheory.ComposableArrows.isoMk app w).inv = CategoryTheory.ComposableArrows.homMk (fun i => (app i).inv) ⋯


/-- The functor `G : C ⥤ D` exhibits `(C, J)` as a dense subsite of `(D, K)`
if `G` is cover-dense, locally fully-faithful,
and `S` is a cover of `C` if and only if the image of `S` in `D` is a cover. -/
class IsDenseSubsite : Prop where
  isCoverDense' : G.IsCoverDense K := by infer_instance
  isLocallyFull' : G.IsLocallyFull K := by infer_instance
  isLocallyFaithful' : G.IsLocallyFaithful K := by infer_instance
  functorPushforward_mem_iff : ∀ {X : C} {S : Sieve X}, S.functorPushforward G ∈ K _ ↔ S ∈ J _

(J : CategoryTheory.GrothendieckTopology C)

{K : CategoryTheory.GrothendieckTopology D}

[self : CategoryTheory.Functor.IsDenseSubsite J K G]


@[simp]
theorem Path.reverse_comp [HasReverse V] {a b c : V} (p : Path a b) (q : Path b c) :
    (p.comp q).reverse = q.reverse.comp p.reverse

{V : Type u_2}
[Quiver V]
[Quiver.HasReverse V]
{a b c : V}
(p : Quiver.Path a b)
(q : Quiver.Path b c)


/-- Any finite group in universe `u` is equivalent to some finite group in universe `0`. -/
lemma exists_type_zero_nonempty_mulEquiv (G : Type u) [Group G] [Finite G] :
    ∃ (G' : Type) (_ : Group G') (_ : Fintype G'), Nonempty (G ≃* G')


@[simp]
theorem nextCoeff_X_add_C [Semiring S] (c : S) : nextCoeff (X + C c) = c

(Polynomial.X + Polynomial.C c).nextCoeff = c


@[reassoc (attr := simp)]
theorem whiskerLeft_inv_hom' (X : C) {Y Z : C} (f : Y ⟶ Z) [IsIso f] :
    X ◁ inv f ≫ X ◁ f = 𝟙 (X ⊗ Z)

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.inv f))
    (CategoryTheory.MonoidalCategory.whiskerLeft X f) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.MonoidalCategory.tensorObj X Z)


/-- See `zero_lt_four` for a version with the type implicit. -/
lemma zero_lt_four' : (0 : α) < 4

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


theorem isRight_left (h : LiftRel r s x (inr d)) : x.isRight

{α : Type u}
{β : Type v}
{γ : Type u_1}
{δ : Type u_2}
{r : α → γ → Prop}
{s : β → δ → Prop}
{x : α ⊕ β}
{d : δ}
(h : Sum.LiftRel r s x (Sum.inr d))


@[to_additive]
theorem inv_mem_inv [Inv α] (a : Part α) (ma : α) (ha : ma ∈ a) : ma⁻¹ ∈ a⁻¹

{α : Type u_1}
[Inv α]
(a : Part α)
(ma : α)
(ha : ma ∈ a)


theorem Nodup.ext {s t : Multiset α} : Nodup s → Nodup t → (s = t ↔ ∀ a, a ∈ s ↔ a ∈ t)

s.Nodup → t.Nodup → (s = t ↔ ∀ (a : α), a ∈ s ↔ a ∈ t)


@[simp, nolint simpNF] -- Porting note: simpNF linter claims simp can prove this, it can not
theorem erase_zero (a : α) : erase a (0 : α →₀ M) = 0

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


@[simp]
theorem support_opRingEquiv (p : R[X]ᵐᵒᵖ) : (opRingEquiv R p).support = (unop p).support

{R : Type u_1}
[Semiring R]
(p : R[X]ᵐᵒᵖ)

((Polynomial.opRingEquiv R) p).support = (MulOpposite.unop p).support


@[simp] theorem SatisfiesM_ExceptT_eq [Monad m] [LawfulMonad m] :
    SatisfiesM (m := ExceptT ρ m) (α := α) p x ↔ SatisfiesM (m := m) (∀ a, · = .ok a → p a) x

{m : Type u_1 → Type u_2}
{α ρ : Type u_1}
{p : α → Prop}
{x : ExceptT ρ m α}
[Monad m]
[LawfulMonad m]

SatisfiesM p x ↔ SatisfiesM (fun x => ∀ (a : α), x = Except.ok a → p a) x


theorem Sigma.isPreconnected_iff [hι : Nonempty ι] [∀ i, TopologicalSpace (π i)]
    {s : Set (Σi, π i)} : IsPreconnected s ↔ ∃ i t, IsPreconnected t ∧ s = Sigma.mk i '' t

{ι : Type u_1}
{π : ι → Type u_2}
[hι : Nonempty ι]
[(i : ι) → TopologicalSpace (π i)]
{s : Set ((i : ι) × π i)}


@[to_additive (attr := simp, to_additive) (reorder := 2 3, 5 6) smul_const]
lemma _root_.Function.const_pow [Pow α β] (a : α) (b : β) : const I a ^ b = const I (a ^ b)

{I : Type u}
{α : Type u_1}
{β : Type u_2}
[Pow α β]
(a : α)
(b : β)

Function.const I a ^ b = Function.const I (a ^ b)


theorem length_eq_map (s : WSeq α) : length s = Computation.map List.length (toList s)

s.length = Computation.map List.length s.toList


lemma Even.neg_zpow : Even n → ∀ a : α, (-a) ^ n = a ^ n

{α : Type u_2}
[DivisionMonoid α]
[HasDistribNeg α]
{n : ℤ}


theorem totient_eq_iff_prime {p : ℕ} (hp : 0 < p) : p.totient = p - 1 ↔ p.Prime


@[simp] lemma last_smash {p q : RelSeries r} (h : p.last = q.head) :
    (smash p q h).last = q.last

{α : Type u_1}
{r : Rel α α}
{p q : RelSeries r}
(h : p.last = q.head)


@[simp]
theorem coe_toMulHom (f : α →ₙ+* β) : ⇑f.toMulHom = f

{α : Type u_2}
{β : Type u_3}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
(f : α →ₙ+* β)


theorem forall_isConj {p : ConjClasses α → Prop} : (∀ a, p a) ↔ ∀ a, p (ConjClasses.mk a)

{α : Type u}
[Monoid α]
{p : ConjClasses α → Prop}

(∀ (a : ConjClasses α), p a) ↔ ∀ (a : α), p (ConjClasses.mk a)


protected theorem Pairwise.image {s : Set ι} (h : s.Pairwise (r on f)) : (f '' s).Pairwise r

{α : Type u_1}
{ι : Type u_4}
{r : α → α → Prop}
{f : ι → α}
{s : Set ι}
(h : s.Pairwise (r on f))


theorem comap_ne_bot_of_root_mem [IsDomain S] {r : S} (r_ne_zero : r ≠ 0) (hr : r ∈ I) {p : R[X]}
    (p_ne_zero : p ≠ 0) (hp : p.eval₂ f r = 0) : I.comap f ≠ ⊥

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
{f : R →+* S}
{I : Ideal S}
[IsDomain S]
{r : S}
(r_ne_zero : r ≠ 0)
(hr : r ∈ I)
{p : Polynomial R}
(p_ne_zero : p ≠ 0)
(hp : Polynomial.eval₂ f r p = 0)


theorem Finset.sum_apply' : (∑ k ∈ s, f k) i = ∑ k ∈ s, f k i

{α : Type u_1}
{ι : Type u_2}
{A : Type u_4}
[AddCommMonoid A]
{s : Finset α}
{f : α → ι →₀ A}
(i : ι)


@[simp]
theorem Basis.localizationLocalization_apply {ι : Type*} (b : Basis ι R A) (i) :
    b.localizationLocalization Rₛ S Aₛ i = algebraMap A Aₛ (b i)

[hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ]

(Basis.localizationLocalization Rₛ S Aₛ b) i = (algebraMap A Aₛ) (b i)


theorem eq_zero_of_tgt {X Y : C} (o : IsZero Y) (f : X ⟶ Y) : f = 0


/-- A pi type is nontrivial if it's nonempty everywhere and nontrivial somewhere. -/
theorem nontrivial_at (i' : I) [inst : ∀ i, Nonempty (f i)] [Nontrivial (f i')] :
    Nontrivial (∀ i : I, f i)

{I : Type u_3}
{f : I → Type u_4}
(i' : I)
[inst : ∀ (i : I), Nonempty (f i)]
[Nontrivial (f i')]


theorem coe_fn_inj {φ₁ φ₂ : A →ₐc[R] B} : (φ₁ : A → B) = φ₂ ↔ φ₁ = φ₂

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
{φ₁ φ₂ : A →ₐc[R] B}

⇑φ₁ = ⇑φ₂ ↔ φ₁ = φ₂


@[simp]
theorem Ico_zero_eq_range : Ico 0 = range


@[simp]
theorem snd_apply (p : Submodule R E) (p' : Submodule R F) (x : p.prod p') :
    LinearPMap.snd p p' x = (x : E × F).2

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(p : Submodule R E)
(p' : Submodule R F)
(x : ↥(p.prod p'))


theorem Ico_infinite : (Ico a b).Infinite

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


/-- A morphism `g : X ⟶ Y` is epi with an injective kernel iff there exists a morphism
`f : I ⟶ X` with `I` injective such that `f ≫ g = 0` and
the short complex `I ⟶ X ⟶ Y` has a splitting. -/
lemma epiWithInjectiveKernel_iff {X Y : C} (g : X ⟶ Y) :
    epiWithInjectiveKernel g ↔ ∃ (I : C) (_ : Injective I) (f : I ⟶ X) (w : f ≫ g = 0),
      Nonempty (ShortComplex.mk f g w).Splitting

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{X Y : C}
(g : X ⟶ Y)

CategoryTheory.Abelian.epiWithInjectiveKernel g ↔
  ∃ I,
    ∃ (_ : CategoryTheory.Injective I),
      ∃ f, ∃ (w : CategoryTheory.CategoryStruct.comp f g = 0), Nonempty (CategoryTheory.ShortComplex.mk f g w).Splitting


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


lemma bot_mul_of_neg {x : EReal} (h : x < 0) : ⊥ * x = ⊤


@[simp]
theorem mapAccumr_cons :
    mapAccumr f (x ::ᵥ xs) s
    = let r := mapAccumr f xs s
      let q := f x r.1
      (q.1, q.2 ::ᵥ r.2)

{α : Type u_2}
{n : ℕ}
(xs : Mathlib.Vector α n)

∀ {α_1 : Type} {β : Type u_1} {f : α → α_1 → α_1 × β} {x : α} {s : α_1},
  Mathlib.Vector.mapAccumr f (x ::ᵥ xs) s =
    let r := Mathlib.Vector.mapAccumr f xs s;
    let q := f x r.1;
    (q.1, q.2 ::ᵥ r.2)


theorem diff_eq_empty {s t : Set α} : s \ t = ∅ ↔ s ⊆ t


/-- Subtracting a point in the given subspace from the
`orthogonalProjection` produces a result in the direction of the
given subspace. -/
theorem orthogonalProjection_vsub_mem_direction {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] {p1 : P} (p2 : P) (hp1 : p1 ∈ s) :
    ↑(orthogonalProjection s p2 -ᵥ ⟨p1, hp1⟩ : s.direction) ∈ s.direction

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
{p1 : P}
(p2 : P)
(hp1 : p1 ∈ s)

↑((EuclideanGeometry.orthogonalProjection s) p2 -ᵥ ⟨p1, hp1⟩) ∈ s.direction


@[to_additive]
theorem topologicalGroup_is_uniform_of_compactSpace [CompactSpace G] : UniformGroup G

(G : Type u_1)
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
[CompactSpace G]


@[refl]
theorem IsRotated.refl (l : List α) : l ~r l


theorem basis_toMatrix_basisFun_mul (b : Basis ι R (ι → R)) (A : Matrix ι ι R) :
    b.toMatrix (Pi.basisFun R ι) * A = of fun i j => b.repr (Aᵀ j) i

{ι : Type u_1}
{R : Type u_5}
[CommSemiring R]
[Fintype ι]
(b : Basis ι R (ι → R))
(A : Matrix ι ι R)

b.toMatrix ⇑(Pi.basisFun R ι) * A = Matrix.of fun i j => (b.repr (Aᵀ j)) i


theorem HasFDerivAtFilter.isBigO_sub (h : HasFDerivAtFilter f f' x L) :
    (fun x' => f x' - f x) =O[L] fun x' => x' - 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}
{L : Filter E}
(h : HasFDerivAtFilter f f' x L)


lemma Spec.map_inj : Spec.map φ = Spec.map ψ ↔ φ = ψ

AlgebraicGeometry.Spec.map φ = AlgebraicGeometry.Spec.map ψ ↔ φ = ψ


@[simp]
theorem valMinAbs_def_zero (x : ZMod 0) : valMinAbs x = x


@[simp]
theorem dropFun_comp {α₀ α₁ α₂ : TypeVec (n + 1)} (f₀ : α₀ ⟹ α₁) (f₁ : α₁ ⟹ α₂) :
    dropFun (f₁ ⊚ f₀) = dropFun f₁ ⊚ dropFun f₀

{n : ℕ}
{α₀ : TypeVec.{u_1} (n + 1)}
{α₁ : TypeVec.{u_2} (n + 1)}
{α₂ : TypeVec.{u_3} (n + 1)}
(f₀ : α₀.Arrow α₁)
(f₁ : α₁.Arrow α₂)

TypeVec.dropFun (TypeVec.comp f₁ f₀) = TypeVec.comp (TypeVec.dropFun f₁) (TypeVec.dropFun f₀)


@[to_additive (attr := mono)]
theorem inv_subset_inv (h : s ⊆ t) : s⁻¹ ⊆ t⁻¹

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


@[simp] theorem ite_some_none_eq_some [Decidable P] :
    (if P then some x else none) = some y ↔ P ∧ x = y

∀ {α : Type u_1} {x y : α} [inst : Decidable P], (if P then some x else none) = some y ↔ P ∧ x = y


theorem Eq.rec_eq_cast {α : Sort _} {P : α → Sort _} {x y : α} (h : x = y) (z : P x) :
    h ▸ z = cast (congr_arg P h) z

{α : Sort u_1}
{P : α → Sort u_2}
{x y : α}
(h : x = y)
(z : P x)


@[to_additive]
theorem SeminormedGroup.uniformCauchySeqOn_iff_tendstoUniformlyOn_one {f : ι → κ → G} {s : Set κ}
    {l : Filter ι} :
    UniformCauchySeqOn f l s ↔
      TendstoUniformlyOn (fun n : ι × ι => fun z => f n.fst z / f n.snd z) 1 (l ×ˢ l) s

{ι : Type u_4}
{κ : Type u_5}
{G : Type u_8}
[SeminormedAddGroup G]
{f : ι → κ → G}
{s : Set κ}
{l : Filter ι}

UniformCauchySeqOn f l s ↔ TendstoUniformlyOn (fun n z => f n.1 z - f n.2 z) 0 (l ×ˢ l) s


theorem HasFiniteFPowerSeriesOnBall.mono (hf : HasFiniteFPowerSeriesOnBall f p x n r)
    (r'_pos : 0 < r') (hr : r' ≤ r) : HasFiniteFPowerSeriesOnBall f p x n r'


@[to_additive] lemma isMulFreimanHom_id (hA : A₁ ⊆ A₂) : IsMulFreimanHom n A₁ A₂ id

{α : Type u_2}
[AddCommMonoid α]
{A₁ A₂ : Set α}
{n : ℕ}
(hA : A₁ ⊆ A₂)


/-- If `C` is cofiltered, then we can give an explicit condition for a functor `F : C ⥤ D` to
    be initial. -/
theorem Functor.initial_iff_of_isCofiltered [IsCofilteredOrEmpty C] :
    Initial F ↔ (∀ d, ∃ c, Nonempty (F.obj c ⟶ d)) ∧ (∀ {d : D} {c : C} (s s' : F.obj c ⟶ d),
      ∃ (c' : C) (t : c' ⟶ c), F.map t ≫ s = F.map t ≫ s')

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

F.Initial ↔
  (∀ (d : D), ∃ c, Nonempty (F.obj c ⟶ d)) ∧
    ∀ {d : D} {c : C} (s s' : F.obj c ⟶ d),
      ∃ c' t, CategoryTheory.CategoryStruct.comp (F.map t) s = CategoryTheory.CategoryStruct.comp (F.map t) s'


@[simp]
theorem fract_natCast (n : ℕ) : fract (n : α) = 0

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(n : ℕ)


/-- Primes greater than about `2 * n / 3` and less than `n` do not appear in the factorization of
`centralBinom n`. -/
theorem factorization_centralBinom_of_two_mul_self_lt_three_mul (n_big : 2 < n) (p_le_n : p ≤ n)
    (big : 2 * n < 3 * p) : (centralBinom n).factorization p = 0


/-- A filter `l` has the countable intersection property if for any countable collection
of sets `s ∈ l` their intersection belongs to `l` as well. -/
class CountableInterFilter (l : Filter α) : Prop where
  /-- For a countable collection of sets `s ∈ l`, their intersection belongs to `l` as well. -/
  countable_sInter_mem : ∀ S : Set (Set α), S.Countable → (∀ s ∈ S, s ∈ l) → ⋂₀ S ∈ l

{α : Type u_2}
{l : Filter α}
[self : CountableInterFilter l]
(S : Set (Set α))


@[simp]
theorem lowerClosure_univ : lowerClosure (univ : Set α) = ⊤


theorem tsupport_fderiv_subset : tsupport (fderiv 𝕜 f) ⊆ tsupport f

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


/-- If `p` is a submodule that is equal to `⊤`, then `LinearIsometryEquiv.ofTop p hp` is the
"identity" equivalence between `p` and `E`. -/
@[simps! toLinearEquiv apply symm_apply_coe]
def ofTop {R : Type*} [Ring R] [Module R E] (p : Submodule R E) (hp : p = ⊤) : p ≃ₗᵢ[R] E

(E : Type u_5)
[SeminormedAddCommGroup E]
{R : Type u_12}
[Ring R]
[Module R E]
(p : Submodule R E)
(hp : p = ⊤)
(x : E)

↑((LinearIsometryEquiv.ofTop E p hp).symm x) = x


theorem natCast_mem (n : ℕ) : (n : L) ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
(n : ℕ)


theorem le.dest_sub {a b : Int} (h : a ≤ b) : ∃ n : Nat, b - a = n


theorem range_eq_empty [IsEmpty ι] (f : ι → α) : range f = ∅

{α : Type u_1}
{ι : Sort u_4}
[IsEmpty ι]
(f : ι → α)


@[ext]
theorem ext {f g : X →ₑ[φ] Y} :
    (∀ x, f x = g x) → f = g

{M : Type u_2}
{N : Type u_3}
{φ : M → N}
{X : Type u_5}
[SMul M X]
{Y : Type u_6}
[SMul N Y]
{f g : X →ₑ[φ] Y}


private theorem quotient_mk_comp_C_isIntegral_of_jacobson' {R : Type*} [CommRing R] [IsJacobson R]
    (P : Ideal (MvPolynomial (Fin n) R)) (hP : P.IsMaximal) :
    RingHom.IsIntegral (algebraMap R (MvPolynomial (Fin n) R ⧸ P))

{n : ℕ}
{R : Type u_1}
[CommRing R]
[Ideal.IsJacobson R]
(P : Ideal (MvPolynomial (Fin n) R))
(hP : P.IsMaximal)

(algebraMap R (MvPolynomial (Fin n) R ⧸ P)).IsIntegral


theorem coeff_contract {p : ℕ} (hp : p ≠ 0) (f : R[X]) (n : ℕ) :
    (contract p f).coeff n = f.coeff (n * p)

{R : Type u}
[CommSemiring R]
{p : ℕ}
(hp : p ≠ 0)
(f : R[X])
(n : ℕ)

(Polynomial.contract p f).coeff n = f.coeff (n * p)


@[simp]
theorem pow_card_pow {n p : ℕ} [Fact p.Prime] (x : ZMod p) : x ^ p ^ n = x

{n p : ℕ}
[Fact (Nat.Prime p)]
(x : ZMod p)


@[simp]
theorem elim_val {γ} (f : ∀ a, β a → γ) (a b) : PSigma.elim f ⟨a, b⟩ = f a b

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


theorem inf_prod {f₁ f₂ : Filter α} : (f₁ ⊓ f₂) ×ˢ g = (f₁ ×ˢ g) ⊓ (f₂ ×ˢ g)

{α : Type u_1}
{β : Type u_2}
{g : Filter β}
{f₁ f₂ : Filter α}

(f₁ ⊓ f₂) ×ˢ g = f₁ ×ˢ g ⊓ f₂ ×ˢ g


@[symm]
theorem CondIndep.symm {m' m₁ m₂ : MeasurableSpace Ω} {mΩ : MeasurableSpace Ω}
    [StandardBorelSpace Ω] [Nonempty Ω] {hm' : m' ≤ mΩ} {μ : Measure Ω} [IsFiniteMeasure μ]
    (h : CondIndep m' m₁ m₂ hm' μ) :
    CondIndep m' m₂ m₁ hm' μ

(h : ProbabilityTheory.CondIndep m' m₁ m₂ hm' μ)

ProbabilityTheory.CondIndep m' m₂ m₁ hm' μ


theorem exists_lt_norm (r : ℝ) : ∃ x : α, r < ‖x‖

(α : Type u_1)
[NontriviallyNormedField α]
(r : ℝ)


theorem comap_surjective_eq_bot {f : Filter β} {m : α → β} (hm : Surjective m) :
    comap m f = ⊥ ↔ f = ⊥

{α : Type u}
{β : Type v}
{f : Filter β}
{m : α → β}
(hm : Function.Surjective m)


theorem coe_real_preimage_closedBall_eq_iUnion (x ε : ℝ) :
    (↑) ⁻¹' closedBall (x : AddCircle p) ε = ⋃ z : ℤ, closedBall (x + z • p) ε

QuotientAddGroup.mk ⁻¹' Metric.closedBall (↑x) ε = ⋃ z, Metric.closedBall (x + z • p) ε


@[to_additive le_addIndex_mul]
theorem le_index_mul (K₀ : PositiveCompacts G) (K : Compacts G) {V : Set G}
    (hV : (interior V).Nonempty) :
    index (K : Set G) V ≤ index (K : Set G) K₀ * index (K₀ : Set G) V

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.haar.index (↑K) V ≤
  MeasureTheory.Measure.haar.index ↑K ↑K₀ * MeasureTheory.Measure.haar.index (↑K₀) V


theorem ext' {g h : A ⊗[R] B →ₐ[S] C} (H : ∀ a b, g (a ⊗ₜ b) = h (a ⊗ₜ b)) : g = h


theorem pullback_eq_top_iff_mem (f : Y ⟶ X) : S f ↔ S.pullback f = ⊤

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

S.arrows f ↔ CategoryTheory.Sieve.pullback f S = ⊤


theorem trNormal_supports {S c k} (Hk : codeSupp c k ⊆ S) : (trNormal c k).Supports S

(Hk : Turing.PartrecToTM2.codeSupp c k ⊆ S)

Turing.PartrecToTM2.Λ'.Supports S (Turing.PartrecToTM2.trNormal c k)


lemma map_comp [IsDirected ι (· ≤ ·)]
    (g₁ : (i : ι) → G i →+* G' i) (g₂ : (i : ι) → G' i →+* G'' i)
    (hg₁ : ∀ i j h, (g₁ j).comp (f i j h) = (f' i j h).comp (g₁ i))
    (hg₂ : ∀ i j h, (g₂ j).comp (f' i j h) = (f'' i j h).comp (g₂ i)) :
    ((map g₂ hg₂).comp (map g₁ hg₁) :
      DirectLimit G (fun _ _ h ↦ f _ _ h) →+* DirectLimit G'' fun _ _ h ↦ f'' _ _ h) =
    (map (fun i ↦ (g₂ i).comp (g₁ i)) fun i j h ↦ by
      rw [RingHom.comp_assoc, hg₁ i, ← RingHom.comp_assoc, hg₂ i, RingHom.comp_assoc] :
      DirectLimit G (fun _ _ h ↦ f _ _ h) →+* DirectLimit G'' fun _ _ h ↦ f'' _ _ h)

{f' : (i j : ι) → i ≤ j → G' i →+* G' j}

{f'' : (i j : ι) → i ≤ j → G'' i →+* G'' j}

(hg₁ : ∀ (i j : ι) (h : i ≤ j), (g₁ j).comp (f i j h) = (f' i j h).comp (g₁ i))

(hg₂ : ∀ (i j : ι) (h : i ≤ j), (g₂ j).comp (f' i j h) = (f'' i j h).comp (g₂ i))

(Ring.DirectLimit.map g₂ hg₂).comp (Ring.DirectLimit.map g₁ hg₁) = Ring.DirectLimit.map (fun i => (g₂ i).comp (g₁ i)) ⋯


@[reassoc (attr := simp)]
theorem inr_comp_pushoutSymmetry_inv [HasPushout f g] :
    pushout.inr _ _ ≫ (pushoutSymmetry f g).inv = pushout.inl _ _

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

CategoryTheory.Limits.pushout.inr g f ≫ (CategoryTheory.Limits.pushoutSymmetry f g).inv =
  CategoryTheory.Limits.pushout.inl f g


@[simp]
theorem pred_succ (o) : pred (succ o) = o


@[simp]
theorem LinearMap.BilinForm.toMatrixAux_apply (B : BilinForm R₂ M₂) (b : n → M₂) (i j : n) :
    -- Porting note: had to hint the base ring even though it should be clear from context...
    BilinForm.toMatrixAux (R₂ := R₂) b B i j = B (b i) (b j)

{R₂ : Type u_5}
{M₂ : Type u_6}
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{n : Type u_11}
(B : LinearMap.BilinForm R₂ M₂)
(b : n → M₂)
(i j : n)

(BilinForm.toMatrixAux b) B i j = (B (b i)) (b j)


/-- `x ↦ x / a` as an order isomorphism. -/
@[to_additive (attr := simps!) "`x ↦ x - a` as an order isomorphism."]
def OrderIso.divRight (a : α) : α ≃o α

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

(RelIso.symm (OrderIso.subRight a)) b = b + a


@[to_additive (attr := simp)]
theorem inv_surjective : Function.Surjective (Inv.inv : G → G)


@[to_additive (attr := simp)]
theorem coe_rangeRestrict (f : G →* N) (g : G) : (f.rangeRestrict g : N) = f g

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


theorem OrderIso.map_bot [LE α] [PartialOrder β] [OrderBot α] [OrderBot β] (f : α ≃o β) : f ⊥ = ⊥

{α : Type u_2}
{β : Type u_3}
[LE α]
[PartialOrder β]
[OrderBot α]
[OrderBot β]
(f : α ≃o β)


theorem ltb_cons_addChar (c : Char) (cs₁ cs₂ : List Char) (i₁ i₂ : Pos) :
    ltb ⟨⟨c :: cs₁⟩, i₁ + c⟩ ⟨⟨c :: cs₂⟩, i₂ + c⟩ = ltb ⟨⟨cs₁⟩, i₁⟩ ⟨⟨cs₂⟩, i₂⟩

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

String.ltb { s := { data := c :: cs₁ }, i := i₁ + c } { s := { data := c :: cs₂ }, i := i₂ + c } =
  String.ltb { s := { data := cs₁ }, i := i₁ } { s := { data := cs₂ }, i := i₂ }


theorem norm_int_of_nonneg {n : ℤ} (hn : 0 ≤ n) : ‖(n : ℂ)‖ = n


@[simp] theorem foldl_reverse (l : List α) (f : β → α → β) (b) :
    l.reverse.foldl f b = l.foldr (fun x y => f y x) b

{α : Type u_1}
{β : Type u_2}
(l : List α)
(f : β → α → β)
(b : β)

List.foldl f b l.reverse = List.foldr (fun x y => f y x) b l


lemma addU_of_Z_eq_zero_right {P Q : Fin 3 → F} (hQz : Q z = 0) : addU P Q = 0

{F : Type v}
[Field F]
{P Q : Fin 3 → F}
(hQz : Q z = 0)


/-- The canonical isomorphism relating `Span f.op g.op` and `(Cospan f g).op` -/
@[simps!]
def spanOp {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    span f.op g.op ≅ walkingCospanOpEquiv.inverse ⋙ (cospan f g).op

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

∀ (X_1 : CategoryTheory.Limits.WalkingSpan),
  (CategoryTheory.Limits.spanOp f g).inv.app X_1 =
    (Option.rec (CategoryTheory.Iso.refl (Opposite.op Z))
        (fun val =>
          CategoryTheory.Limits.WalkingPair.rec (CategoryTheory.Iso.refl (Opposite.op X))
            (CategoryTheory.Iso.refl (Opposite.op Y)) val)
        X_1).inv


@[simp]
lemma minOrder_of_prime {p : ℕ} (hp : p.Prime) : minOrder (ZMod p) = p


theorem Submonoid.toAddSubmonoid'_closure (S : Set (Multiplicative A)) :
    Submonoid.toAddSubmonoid' (Submonoid.closure S)
      = AddSubmonoid.closure (Additive.ofMul ⁻¹' S)

{A : Type u_4}
[AddZeroClass A]
(S : Set (Multiplicative A))

Submonoid.toAddSubmonoid' (Submonoid.closure S) = AddSubmonoid.closure (⇑Additive.ofMul ⁻¹' S)


theorem Simple.not_isZero (X : C) [Simple X] : ¬IsZero X


/-- In a Hilbert space, the orthogonal complement of the orthogonal complement of a subspace `K`
is the topological closure of `K`.

Note that the completeness assumption is necessary. Let `E` be the space `ℕ →₀ ℝ` with inner space
structure inherited from `PiLp 2 (fun _ : ℕ ↦ ℝ)`. Let `K` be the subspace of sequences with the sum
of all elements equal to zero. Then `Kᗮ = ⊥`, `Kᗮᗮ = ⊤`.  -/
theorem Submodule.orthogonal_orthogonal_eq_closure [CompleteSpace E] :
    Kᗮᗮ = K.topologicalClosure

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


theorem not_neZero {n : R} : ¬NeZero n ↔ n = 0


theorem dvdNotUnit_iff_normalizedFactors_lt_normalizedFactors {x y : α} (hx : x ≠ 0) (hy : y ≠ 0) :
    DvdNotUnit x y ↔ normalizedFactors x < normalizedFactors y

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]
{x y : α}
(hx : x ≠ 0)
(hy : y ≠ 0)

DvdNotUnit x y ↔ UniqueFactorizationMonoid.normalizedFactors x < UniqueFactorizationMonoid.normalizedFactors y


/-- For any `m : M` and any `0 < ε`, there is `s ∈ S` such that `‖m + s‖ < ‖mk' S m‖ + ε`. -/
theorem norm_mk_lt' (S : AddSubgroup M) (m : M) {ε : ℝ} (hε : 0 < ε) :
    ∃ s ∈ S, ‖m + s‖ < ‖mk' S m‖ + ε

{M : Type u_1}
[SeminormedAddCommGroup M]
(S : AddSubgroup M)
(m : M)
{ε : ℝ}
(hε : 0 < ε)

∃ s ∈ S, ‖m + s‖ < ‖(QuotientAddGroup.mk' S) m‖ + ε


/-- A version of `EulerProduct.summable_and_hasSum_factoredNumbers_prod_filter_prime_tsum`
in terms of the value of the series. -/
lemma prod_filter_prime_tsum_eq_tsum_factoredNumbers (hsum : Summable (‖f ·‖)) (s : Finset ℕ) :
    ∏ p ∈ s.filter Nat.Prime, ∑' n : ℕ, f (p ^ n) = ∑' m : factoredNumbers s, f m

(hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n)

∏ p ∈ Finset.filter Nat.Prime s, ∑' (n : ℕ), f (p ^ n) = ∑' (m : ↑(Nat.factoredNumbers s)), f ↑m


/-- The elliptic curve mapped over a ring homomorphism `φ : R →+* A`. -/
@[simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
def map : EllipticCurve A

{R : Type u}
[CommRing R]
(E : EllipticCurve R)
{A : Type v}
[CommRing A]
(φ : R →+* A)


lemma of_decreasing_bounded (f : ℕ → α) {a : α} {m : ℕ} (ham : ∀ n ≥ m, |f n| ≤ a)
    (hnm : ∀ n ≥ m, f n.succ ≤ f n) : IsCauSeq abs f

{α : Type u_1}
[LinearOrderedField α]
[Archimedean α]
(f : ℕ → α)
{a : α}
{m : ℕ}
(ham : ∀ n ≥ m, |f n| ≤ a)
(hnm : ∀ n ≥ m, f n.succ ≤ f n)


@[simp]
theorem natDegree_of_a_ne_zero (ha : P.a ≠ 0) : P.toPoly.natDegree = 3

{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a ≠ 0)


@[to_additive]
theorem pow_count [DecidableEq α] (a : α) : a ^ s.count a = (s.filter (Eq a)).prod

{α : Type u_3}
[CommMonoid α]
{s : Multiset α}
[DecidableEq α]
(a : α)

a ^ Multiset.count a s = (Multiset.filter (Eq a) s).prod


@[simp]
theorem Proj.res_apply (x) : ((Proj.structureSheaf 𝒜).1.map i s).1 x = s.1 (i.unop x)

{U V : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ}

(s : ↑((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).val.obj V))

↑(((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).val.map i) s) x = ↑s ((fun x => ⟨↑x, ⋯⟩) x)


lemma prod_primeFactors_of_squarefree (hn : Squarefree n) : ∏ p ∈ n.primeFactors, p = n


/-- A Young diagram is a finite collection of cells on the `ℕ × ℕ` grid such that whenever
a cell is present, so are all the ones above and to the left of it. Like matrices, an `(i, j)` cell
is a cell in row `i` and column `j`, where rows are enumerated downward and columns rightward.

Young diagrams are modeled as finite sets in `ℕ × ℕ` that are lower sets with respect to the
standard order on products. -/
@[ext]
structure YoungDiagram where
  /-- A finite set which represents a finite collection of cells on the `ℕ × ℕ` grid. -/
  cells : Finset (ℕ × ℕ)
  /-- Cells are up-left justified, witnessed by the fact that `cells` is a lower set in `ℕ × ℕ`. -/
  isLowerSet : IsLowerSet (cells : Set (ℕ × ℕ))


@[simp, reassoc]
theorem lift_fac (H : Set.range g.base ⊆ Set.range f.base) : lift f g H ≫ f = g

{X Y Z : AlgebraicGeometry.PresheafedSpace C}

[hf : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]

(H : Set.range ⇑g.base ⊆ Set.range ⇑f.base)

AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.lift f g H ≫ f = g


theorem lift_down' {a : Cardinal.{u}} {b : Ordinal.{max u v}}
    (h : card.{max u v} b ≤ Cardinal.lift.{v,u} a) : ∃ a', lift.{v,u} a' = b

{a : Cardinal.{u}}
{b : Ordinal.{max u v}}
(h : b.card ≤ Cardinal.lift.{v, u} a)


@[to_additive (attr := simp)]
theorem prod_one [∀ i, AddCommMonoid (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)] [CommMonoid γ]
    {f : Π₀ i, β i} : (f.prod fun _ _ => (1 : γ)) = 1

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]


lemma InjOn.image_inter {s t u : Set α} (hf : u.InjOn f) (hs : s ⊆ u) (ht : t ⊆ u) :
    f '' (s ∩ t) = f '' s ∩ f '' t

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{s t u : Set α}
(hf : Set.InjOn f u)
(hs : s ⊆ u)
(ht : t ⊆ u)


@[simp]
theorem apply_symm_apply (e : R ≃+* S) : ∀ x, e (e.symm x) = x

{R : Type u_4}
{S : Type u_5}
[Mul R]
[Mul S]
[Add R]
[Add S]
(e : R ≃+* S)
(x : S)


theorem iSup_span {ι : Sort*} (p : ι → Set M) : ⨆ i, span R (p i) = span R (⋃ i, p i)

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{ι : Sort u_9}
(p : ι → Set M)

⨆ i, Submodule.span R (p i) = Submodule.span R (⋃ i, p i)


/-- (internal implementation) the colimit cocone of a functor,
implemented as a quotient of a sigma type
-/
@[simps]
noncomputable def colimitCocone (F : J ⥤ Type u) [Small.{u} (Quot F)] : Cocone F

[Small.{u, max u v} (CategoryTheory.Limits.Types.Quot F)]

(CategoryTheory.Limits.Types.colimitCocone F).pt = Shrink.{u, max u v} (CategoryTheory.Limits.Types.Quot F)


theorem div_le_iff_of_neg' (hc : c < 0) : b / c ≤ a ↔ c * a ≤ b

{α : Type u_2}
[LinearOrderedField α]
{a b c : α}
(hc : c < 0)


/--Multiplication in the free product of the injections of any two `aᵢ aᵢ': A i` for
the same `i` is just the injection of multiplication `aᵢ * aᵢ'` in `A i`.-/
theorem mul_injections (a₁ a₂ : A i) :
    ι' R A (DirectSum.lof R I A i a₁) * ι' R A (DirectSum.lof R I A i a₂)
      = ι' R A (DirectSum.lof R I A i (a₁ * a₂))

{I : Type u}
[DecidableEq I]
{i : I}
(R : Type v)
[CommSemiring R]
(A : I → Type w)
[(i : I) → Semiring (A i)]
[(i : I) → Algebra R (A i)]
(a₁ a₂ : A i)

(LinearAlgebra.FreeProduct.ι' R A) ((DirectSum.lof R I A i) a₁) *
    (LinearAlgebra.FreeProduct.ι' R A) ((DirectSum.lof R I A i) a₂) =
  (LinearAlgebra.FreeProduct.ι' R A) ((DirectSum.lof R I A i) (a₁ * a₂))


/-- Note: `Sym2.map_id` will not simplify `Sym2.map id z` due to `Sym2.map_congr`. -/
@[simp]
theorem map_id' : (map fun x : α => x) = id


@[simp]
theorem isoApp_symm {X Y : DifferentialObject S C} (f : X ≅ Y) : isoApp f.symm = (isoApp f).symm

{X Y : CategoryTheory.DifferentialObject S C}

CategoryTheory.DifferentialObject.isoApp f.symm = (CategoryTheory.DifferentialObject.isoApp f).symm


theorem Convex.mapsTo_lineMap (h : Convex 𝕜 s) {x y : E} (hx : x ∈ s) (hy : y ∈ s) :
    MapsTo (AffineMap.lineMap x y) (Icc (0 : 𝕜) 1) s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(h : Convex 𝕜 s)
{x y : E}
(hx : x ∈ s)
(hy : y ∈ s)

Set.MapsTo (⇑(AffineMap.lineMap x y)) (Set.Icc 0 1) s


theorem Coprime.factor_eq_gcd_right {a b m n : ℕ+} (cop : m.Coprime n) (am : a ∣ m) (bn : b ∣ n) :
    a = (b * a).gcd m


@[nolint docBlame]
class FloatCfg where
  (prec emax : ℕ)
  precPos : 0 < prec
  precMax : prec ≤ emax


/-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal
`I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`.

See <https://stacks.math.columbia.edu/tag/00UM>. -/
@[mk_iff]
class FormallyUnramified : Prop where
  comp_injective :
    ∀ ⦃B : Type u⦄ [CommRing B],
      ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥),
        Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I)

(R : Type u)
[CommSemiring R]
(A : Type u)
[Semiring A]
[Algebra R A]

Algebra.FormallyUnramified R A ↔
  ∀ ⦃B : Type u⦄ [inst : CommRing B] [inst_1 : Algebra R B] (I : Ideal B),
    I ^ 2 = ⊥ → Function.Injective (Ideal.Quotient.mkₐ R I).comp


theorem condexpIndL1_add (x y : G) :
    condexpIndL1 hm μ s (x + y) = condexpIndL1 hm μ s x + condexpIndL1 hm μ s y

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[NormedSpace ℝ G]
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
(x y : G)

MeasureTheory.condexpIndL1 hm μ s (x + y) = MeasureTheory.condexpIndL1 hm μ s x + MeasureTheory.condexpIndL1 hm μ s y


theorem zsmul_coeff (m : ℤ) (x : 𝕎 R) (n : ℕ) :
    (m • x).coeff n = peval (wittZSMul p m n) ![x.coeff]

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
(m : ℤ)
(x : 𝕎 R)
(n : ℕ)

(m • x).coeff n = WittVector.peval (WittVector.wittZSMul p m n) ![x.coeff]


theorem LinearIndependent.union_of_quotient
    {M' : Submodule R M} {s : Set M} (hs : s ⊆ M') (hs' : LinearIndependent (ι := s) R Subtype.val)
  {t : Set M} (ht : LinearIndependent (ι := t) R (Submodule.Quotient.mk (p := M') ∘ Subtype.val)) :
    LinearIndependent (ι := (s ∪ t : _)) R Subtype.val

(hs' : LinearIndependent (ι := ↑s) R Subtype.val)

(ht : LinearIndependent (ι := ↑t) R (Submodule.Quotient.mk ∘ Subtype.val))

LinearIndependent (ι := ↑(s ∪ t)) R Subtype.val


theorem not_lt_eq (a b : β) : (¬ (a < b)) = (b ≤ a)

{β : Type u_2}
[LinearOrder β]
(a b : β)


theorem image_neg_Iio : Neg.neg '' Iio a = Ioi (-a)

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


private lemma auxLTensor_eq [Module.Flat R S] {I : Ideal R} :
    (auxLTensor R S M I : M ⊗[R] I →ₗ[R] M) =
    TensorProduct.rid R M ∘ₗ lTensor M (I.subtype)

(R : Type u)
(S : Type v)
(M : Type w)
[CommRing R]
[CommRing S]
[Algebra R S]
[AddCommGroup M]
[Module R M]
[Module S M]
[IsScalarTower R S M]
[Module.Flat R S]
{I : Ideal R}

↑R (Module.Flat.auxLTensor R S M I) = ↑(TensorProduct.rid R M) ∘ₗ LinearMap.lTensor M (Submodule.subtype I)


theorem factorThruImage_comp_coimageIsoImage'_inv :
    factorThruImage f ≫ (coimageIsoImage' f).inv = cokernel.π _

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

CategoryTheory.Limits.factorThruImage f ≫ (CategoryTheory.Abelian.coimageIsoImage' f).inv =
  CategoryTheory.Limits.cokernel.π (CategoryTheory.Limits.kernel.ι f)


theorem le_natDegree_of_ne_zero (h : coeff p n ≠ 0) : n ≤ natDegree p

{R : Type u}
{n : ℕ}
[Semiring R]
{p : R[X]}
(h : p.coeff n ≠ 0)


theorem le_degrees_add {p q : MvPolynomial σ R} (h : p.degrees.Disjoint q.degrees) :
    p.degrees ≤ (p + q).degrees

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{p q : MvPolynomial σ R}
(h : p.degrees.Disjoint q.degrees)


theorem smooth_snd : Smooth (I.prod J) J (@Prod.snd M N)

{𝕜 : 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]
{F : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]


/-- A submonoid `S` includes `closure s` if and only if it includes `s`. -/
@[to_additive (attr := simp)
"An additive submonoid `S` includes `closure s` if and only if it includes `s`"]
theorem closure_le : closure s ≤ S ↔ s ⊆ S

{M : Type u_1}
[MulOneClass M]
{s : Set M}
{S : Submonoid M}


/-- Every coefficient in a Cantor normal form is positive. -/
theorem CNF_lt_snd {b o : Ordinal.{u}} {x : Ordinal × Ordinal} : x ∈ CNF b o → 0 < x.2

{b o : Ordinal.{u}}
{x : Ordinal.{u} × Ordinal.{u}}


@[simp]
theorem X_inj [Nontrivial R] (m n : σ) : X m = (X n : MvPolynomial σ R) ↔ m = n

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[Nontrivial R]
(m n : σ)

MvPolynomial.X m = MvPolynomial.X n ↔ m = n


@[to_additive]
theorem image_mul_right' : (· * b⁻¹) '' t = (· * b) ⁻¹' t

{α : Type u_2}
[AddGroup α]
{t : Set α}
{b : α}

(fun x => x + -b) '' t = (fun x => x + b) ⁻¹' t


theorem infty_not_mem_range_coe : ∞ ∉ range ((↑) : X → OnePoint X)

OnePoint.infty ∉ Set.range OnePoint.some


protected theorem add_mul (a b c : Int) : (a + b) * c = a * c + b * c


/-- We say that a type has `MeasurableSup₂` if `uncurry (· ⊔ ·)` is a measurable functions.
For a typeclass assuming measurability of `(c ⊔ ·)` and `(· ⊔ c)` see `MeasurableSup`. -/
class MeasurableSup₂ (M : Type*) [MeasurableSpace M] [Sup M] : Prop where
  measurable_sup : Measurable fun p : M × M => p.1 ⊔ p.2

{M : Type u_1}
[MeasurableSpace M]
[Sup M]
[self : MeasurableSup₂ M]


theorem HasIntegral.integrable (h : HasIntegral I l f vol y) : Integrable I l f vol

(h : BoxIntegral.HasIntegral I l f vol y)


@[mfld_simps]
theorem forall_true_iff : (α → True) ↔ True


theorem vec_one_mul [Fintype m] (A : Matrix m n α) : 1 ᵥ* A = fun j => ∑ i, A i j

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonAssocSemiring α]
[Fintype m]
(A : Matrix m n α)


/-- If `A₁` is equivalent to `A₁'` and `A₂` is equivalent to `A₂'`, then the type of maps
`A₁ →ₐ[R] A₂` is equivalent to the type of maps `A₁' →ₐ[R] A₂'`. -/
@[simps apply]
def arrowCongr (e₁ : A₁ ≃ₐ[R] A₁') (e₂ : A₂ ≃ₐ[R] A₂') : (A₁ →ₐ[R] A₂) ≃ (A₁' →ₐ[R] A₂')

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
{A₁' : Type uA₁'}
{A₂' : Type uA₂'}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Semiring A₁']
[Semiring A₂']
[Algebra R A₁]
[Algebra R A₂]
[Algebra R A₁']
[Algebra R A₂']
(e₁ : A₁ ≃ₐ[R] A₁')
(e₂ : A₂ ≃ₐ[R] A₂')
(f : A₁ →ₐ[R] A₂)

(e₁.arrowCongr e₂) f = ((↑e₂).comp f).comp ↑e₁.symm


@[simp]
theorem sign_pi_sub (θ : Angle) : ((π : Angle) - θ).sign = θ.sign


@[simp, mfld_simps]
theorem modelWithCorners_prod_toPartialEquiv :
    (I.prod J).toPartialEquiv = I.toPartialEquiv.prod J.toPartialEquiv

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_6}
[TopologicalSpace H]
{G : Type u_8}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}

(I.prod J).toPartialEquiv = I.prod J.toPartialEquiv


theorem isUniversalColimit_extendCofan {n : ℕ} (f : Fin (n + 1) → C)
    {c₁ : Cofan fun i : Fin n ↦ f i.succ} {c₂ : BinaryCofan (f 0) c₁.pt}
    (t₁ : IsUniversalColimit c₁) (t₂ : IsUniversalColimit c₂)
    [∀ {Z} (i : Z ⟶ c₂.pt), HasPullback c₂.inr i] :
    IsUniversalColimit (extendCofan c₁ c₂)

{c₁ : CategoryTheory.Limits.Cofan fun i => f i.succ}

{c₂ : CategoryTheory.Limits.BinaryCofan (f 0) c₁.pt}

(t₁ : CategoryTheory.IsUniversalColimit c₁)

(t₂ : CategoryTheory.IsUniversalColimit c₂)

[∀ {Z : C} (i : Z ⟶ c₂.pt), CategoryTheory.Limits.HasPullback c₂.inr i]

CategoryTheory.IsUniversalColimit (CategoryTheory.extendCofan c₁ c₂)


@[simp]
theorem degree_nodal [Nontrivial R] : (nodal s v).degree = s.card

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
{s : Finset ι}
{v : ι → R}
[Nontrivial R]


theorem mapEquiv_symm_apply (y : f β) : (mapEquiv f e).symm y = EquivFunctor.map e.symm y

(f : Type u₀ → Type u₁)
[EquivFunctor f]
{α β : Type u₀}
(e : α ≃ β)
(y : f β)

(EquivFunctor.mapEquiv f e).symm y = EquivFunctor.map e.symm y


theorem norm_algebraMap [Algebra.IsSeparable K L] (x : 𝓞 K) :
    norm K (algebraMap (𝓞 K) (𝓞 L) x) = x ^ finrank K L

{L : Type u_1}
(K : Type u_2)
[Field K]
[Field L]
[Algebra K L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
(x : 𝓞 K)

(RingOfIntegers.norm K) ((algebraMap (𝓞 K) (𝓞 L)) x) = x ^ FiniteDimensional.finrank K L


theorem smul_mem_iff {c : 𝕜} (hc : 0 < c) {x : E} : c • x ∈ S ↔ x ∈ S

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedField 𝕜]
[AddCommMonoid E]
[MulAction 𝕜 E]
(S : ConvexCone 𝕜 E)
{c : 𝕜}
(hc : 0 < c)
{x : E}


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

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

∀ (a : A →ₐ[R] Bᵐᵒᵖ) (a_1 : Aᵐᵒᵖ), (AlgHom.opComm a) a_1 = MulOpposite.unop (a (MulOpposite.unop a_1))


theorem cos_sq' : cos x ^ 2 = 1 - sin x ^ 2

Complex.cos x ^ 2 = 1 - Complex.sin x ^ 2


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

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


@[simp]
theorem toFinset_union (l l' : List α) : (l ∪ l').toFinset = l.toFinset ∪ l'.toFinset

{α : Type u_1}
[DecidableEq α]
(l l' : List α)


lemma Asymptotics.IsBigO.comp_summable_norm {ι E F : Type*}
    [SeminormedAddCommGroup E] [SeminormedAddCommGroup F] {f : E → F} {g : ι → E}
    (hf : f =O[𝓝 0] id) (hg : Summable (‖g ·‖)) : Summable (‖f <| g ·‖)

{ι : Type u_1}
{E : Type u_2}
{F : Type u_3}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
{f : E → F}
{g : ι → E}
(hf : f =O[𝓝 0] id)
(hg : Summable fun x => ‖g x‖)


theorem intCast_zmod_eq_zero_iff_dvd (a : ℤ) (b : ℕ) : (a : ZMod b) = 0 ↔ (b : ℤ) ∣ a


theorem rat_mul_continuous_lemma {ε K₁ K₂ : α} (ε0 : 0 < ε) :
    ∃ δ > 0, ∀ {a₁ a₂ b₁ b₂ : β}, abv a₁ < K₁ → abv b₂ < K₂ → abv (a₁ - b₁) < δ →
      abv (a₂ - b₂) < δ → abv (a₁ * a₂ - b₁ * b₂) < ε

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
(abv : β → α)
[IsAbsoluteValue abv]
{ε K₁ K₂ : α}
(ε0 : 0 < ε)


theorem of_b_eq_zero' : toPoly ⟨0, 0, c, d⟩ = C c * X + C d

{ a := 0, b := 0, c := c, d := d }.toPoly = Polynomial.C c * Polynomial.X + Polynomial.C d


@[to_additive]
lemma mulSupport_prod (s : Finset ι) (f : ι → α → β) :
    mulSupport (fun x ↦ ∏ i ∈ s, f i x) ⊆ ⋃ i ∈ s, mulSupport (f i)

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

(Function.mulSupport fun x => ∏ i ∈ s, f i x) ⊆ ⋃ i ∈ s, Function.mulSupport (f i)


theorem max'_insert (a : α) (s : Finset α) (H : s.Nonempty) :
    (insert a s).max' (s.insert_nonempty a) = max (s.max' H) a

{α : Type u_2}
[LinearOrder α]
(a : α)
(s : Finset α)
(H : s.Nonempty)


theorem NeBot.of_map₂_left (h : (map₂ m f g).NeBot) : f.NeBot

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{m : α → β → γ}
{f : Filter α}
{g : Filter β}
(h : (Filter.map₂ m f g).NeBot)


theorem exists_inv_two_pow_lt (ha : a ≠ 0) : ∃ n : ℕ, 2⁻¹ ^ n < a


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

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


/-- Implementation of `Mon_.equivLaxMonoidalFunctorPUnit`. -/
@[simps]
def laxMonoidalToMon : LaxMonoidalFunctor (Discrete PUnit.{u + 1}) C ⥤ Mon_ C

(F : CategoryTheory.LaxMonoidalFunctor (CategoryTheory.Discrete PUnit.{u + 1}) C)

(Mon_.EquivLaxMonoidalFunctorPUnit.laxMonoidalToMon C).obj F =
  F.mapMon.obj (Mon_.trivial (CategoryTheory.Discrete PUnit.{u + 1}))


/-- The nerve of a category, as a functor `Cat ⥤ SSet` -/
@[simps]
def nerveFunctor : Cat ⥤ SSet

CategoryTheory.nerveFunctor.obj C = CategoryTheory.nerve ↑C


theorem coeSort_elementarySkolem₁Reduct (S : (L.sum L.skolem₁).Substructure M) :
    (S.elementarySkolem₁Reduct : Type w) = S

{L : FirstOrder.Language}
{M : Type w}
[Nonempty M]
[L.Structure M]
(S : (L.sum L.skolem₁).Substructure M)


theorem rnDeriv_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
    [t.HaveLebesgueDecomposition μ] [hst : (s - t).HaveLebesgueDecomposition μ] :
    (s - t).rnDeriv μ =ᵐ[μ] s.rnDeriv μ - t.rnDeriv μ


theorem HasDerivWithinAt.ccos (hf : HasDerivWithinAt f f' s x) :
    HasDerivWithinAt (fun x => Complex.cos (f x)) (-Complex.sin (f x) * f') s x

{f : ℂ → ℂ}
{f' x : ℂ}
{s : Set ℂ}
(hf : HasDerivWithinAt f f' s x)


theorem add_succ : ∀ m n : Num, m + succ n = succ (m + n)


@[simp] theorem get?_nil : @get? α [] n = none


protected theorem Dense.exists_le [NoMinOrder α] {s : Set α} (hs : Dense s) (x : α) :
    ∃ y ∈ s, y ≤ x

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
[NoMinOrder α]
{s : Set α}
(hs : Dense s)
(x : α)


@[simp]
theorem setValue_eq_iff {α β} (f : α ↪ β) {a a' : α} {b : β} [∀ a', Decidable (a' = a)]
    [∀ a', Decidable (f a' = b)] : setValue f a b a' = b ↔ a' = a

{α : Sort u_1}
{β : Sort u_2}
(f : α ↪ β)
{a a' : α}
{b : β}
[(a' : α) → Decidable (a' = a)]
[(a' : α) → Decidable (f a' = b)]


protected theorem add_lt_add_left [CovariantClass α α (· + ·) (· < ·)] (ha : a ≠ ⊥) (h : b < c) :
    a + b < a + c

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


/--
**Hadamard three-line theorem** on `re ⁻¹' [0,1]`: If `f` is a bounded function, continuous on the
closed strip `re ⁻¹' [0,1]` and differentiable on open strip `re ⁻¹' (0,1)`, then for
`M(x) := sup ((norm ∘ f) '' (re ⁻¹' {x}))` we have that for all `z` in the closed strip
`re ⁻¹' [0,1]` the inequality `‖f(z)‖ ≤ M(0) ^ (1 - z.re) * M(1) ^ z.re` holds. -/
lemma norm_le_interpStrip_of_mem_verticalClosedStrip (f : ℂ → E) {z : ℂ}
    (hz : z ∈ verticalClosedStrip 0 1) (hd : DiffContOnCl ℂ f (verticalStrip 0 1))
    (hB : BddAbove ((norm ∘ f) '' (verticalClosedStrip 0 1))) :
    ‖f z‖ ≤ ‖interpStrip f z‖

(hz : z ∈ Complex.HadamardThreeLines.verticalClosedStrip 0 1)

(hd : DiffContOnCl ℂ f (Complex.HadamardThreeLines.verticalStrip 0 1))

(hB : BddAbove (norm ∘ f '' Complex.HadamardThreeLines.verticalClosedStrip 0 1))

‖f z‖ ≤ ‖Complex.HadamardThreeLines.interpStrip f z‖


protected theorem dist : LipschitzWith 2 (Function.uncurry <| @dist α _)


theorem incomp_iff_eq {α : Sort u} {lt : α → α → Prop} [IsTrichotomous α lt] [IsIrrefl α lt] (a b) :
    ¬lt a b ∧ ¬lt b a ↔ a = b

{α : Sort u}
{lt : α → α → Prop}
[IsTrichotomous α lt]
[IsIrrefl α lt]
(a b : α)


@[simp]
theorem row_empty : row ι (vecEmpty : Fin 0 → α) = of fun _ => vecEmpty

Matrix.row ι ![] = Matrix.of fun x => ![]


@[simp]
lemma natCast_le_ofReal {n : ℕ} {p : ℝ} (hn : n ≠ 0) : n ≤ ENNReal.ofReal p ↔ n ≤ p


@[to_additive (attr := norm_cast) (reorder := 7 8)]
theorem coe_zpow [Group β] [TopologicalGroup β] (f : C(α, β)) (z : ℤ) : ⇑(f ^ z) = (⇑f) ^ z

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[AddGroup β]
[TopologicalAddGroup β]
(z : ℤ)
(f : C(α, β))


theorem centralBinom_eq_two_mul_choose (n : ℕ) : centralBinom n = (2 * n).choose n


theorem absolutelyContinuous {X : Ω → E} {s : Set E} (hu : IsUniform X s ℙ μ) : map X ℙ ≪ μ

{E : Type u_1}
[MeasurableSpace E]
{μ : MeasureTheory.Measure E}
{Ω : Type u_2}

∀ {x : MeasurableSpace Ω} {ℙ : MeasureTheory.Measure Ω} {X : Ω → E} {s : Set E},
  MeasureTheory.pdf.IsUniform X s ℙ μ → MeasureTheory.Measure.map X ℙ ≪ μ


theorem iInter_mono' {s : ι → Set α} {t : ι' → Set α} (h : ∀ j, ∃ i, s i ⊆ t j) :
    ⋂ i, s i ⊆ ⋂ j, t j

{α : Type u_1}
{ι : Sort u_4}
{ι' : Sort u_5}
{s : ι → Set α}
{t : ι' → Set α}
(h : ∀ (j : ι'), ∃ i, s i ⊆ t j)


/-- The tangent of a complex number is equal to zero
iff this number is equal to `k * π / 2` for an integer `k`.

Note that this lemma takes into account that we use zero as the junk value for division by zero.
See also `Complex.tan_eq_zero_iff'`.  -/
theorem tan_eq_zero_iff {θ : ℂ} : tan θ = 0 ↔ ∃ k : ℤ, k * π / 2 = θ

Complex.tan θ = 0 ↔ ∃ k, ↑k * ↑Real.pi / 2 = θ


@[simp]
theorem opow_one (a : Ordinal) : a ^ (1 : Ordinal) = a


/-- If `X` is a paracompact normal topological space and `U` is an open covering of a closed set
`s`, then there exists a `BumpCovering ι X s` that is subordinate to `U`. -/
theorem exists_isSubordinate [NormalSpace X] [ParacompactSpace X] (hs : IsClosed s) (U : ι → Set X)
    (ho : ∀ i, IsOpen (U i)) (hU : s ⊆ ⋃ i, U i) : ∃ f : BumpCovering ι X s, f.IsSubordinate U

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
[NormalSpace X]
[ParacompactSpace X]
(hs : IsClosed s)
(U : ι → Set X)
(ho : ∀ (i : ι), IsOpen (U i))
(hU : s ⊆ ⋃ i, U i)


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

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


theorem frontier_interior_subset : frontier (interior s) ⊆ frontier s

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


@[simp] theorem cond_false_left  : ∀(c f : Bool), cond c false f = (!c && f)


@[simp]
theorem bot_prod_bot : (⊥ : UpperSet α) ×ˢ (⊥ : UpperSet β) = ⊥

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]


@[simp]
theorem image_ball (h : α ≃ᵢ β) (x : α) (r : ℝ) : h '' Metric.ball x r = Metric.ball (h x) r

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
(h : α ≃ᵢ β)
(x : α)
(r : ℝ)

⇑h '' Metric.ball x r = Metric.ball (h x) r


@[to_additive (attr := simp)]
theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : α ⊕ γ → β) :
    ∏ x ∈ s.disjSum t, f x = (∏ x ∈ s, f (Sum.inl x)) * ∏ x ∈ t, f (Sum.inr x)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[CommMonoid β]
(s : Finset α)
(t : Finset γ)
(f : α ⊕ γ → β)


@[simp] lemma addLeft_zero : Equiv.addLeft (0 : α) = 1


theorem summable_of_locally_summable_norm {ι : Type*} {F : ι → C(X, E)}
    (hF : ∀ K : Compacts X, Summable fun i => ‖(F i).restrict K‖) : Summable F

(hF : ∀ (K : TopologicalSpace.Compacts X), Summable fun i => ‖ContinuousMap.restrict (↑K) (F i)‖)