/-- If `0 < n`, then `xa i` has order 4.
-/
@[simp]
theorem orderOf_xa [NeZero n] (i : ZMod (2 * n)) : orderOf (xa i) = 4


theorem singleton_disjoint_neighborFinset : Disjoint {v} (G.neighborFinset v)

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


theorem iSup_eq_iSup_of_partialSups_eq_partialSups {f g : ℕ → α}
    (h : partialSups f = partialSups g) : ⨆ n, f n = ⨆ n, g n

{α : Type u_1}
[CompleteLattice α]
{f g : ℕ → α}
(h : partialSups f = partialSups g)


/-- Continuous algebra homomorphisms between algebras. We only put the type classes that are
necessary for the definition, although in applications `M` and `B` will be topological algebras
over the topological ring `R`. -/
structure ContinuousAlgHom (R : Type*) [CommSemiring R] (A : Type*) [Semiring A]
    [TopologicalSpace A] (B : Type*) [Semiring B] [TopologicalSpace B] [Algebra R A] [Algebra R B]
    extends A →ₐ[R] B where
-- TODO: replace with `fun_prop` when that is stable
  cont : Continuous toFun := by continuity

{R : Type u_3}
[CommSemiring R]
{A : Type u_4}
[Semiring A]
[TopologicalSpace A]
{B : Type u_5}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
(self : A →A[R] B)


theorem isNilpotent_toEnd_of_isNilpotent [IsNilpotent R L M] (x : L) :
    _root_.IsNilpotent (toEnd R L M x)

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieModule.IsNilpotent R L M]
(x : L)


/-- The angle between two vectors is `θ` if and only if they are nonzero and the second vector
is the first rotated by `θ` and scaled by the ratio of the norms, or `θ` and at least one of the
vectors are zero. -/
theorem oangle_eq_iff_eq_norm_div_norm_smul_rotation_or_eq_zero {x y : V} (θ : Real.Angle) :
    o.oangle x y = θ ↔
      x ≠ 0 ∧ y ≠ 0 ∧ y = (‖y‖ / ‖x‖) • o.rotation θ x ∨ θ = 0 ∧ (x = 0 ∨ y = 0)

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

o.oangle x y = θ ↔ x ≠ 0 ∧ y ≠ 0 ∧ y = (‖y‖ / ‖x‖) • (o.rotation θ) x ∨ θ = 0 ∧ (x = 0 ∨ y = 0)


theorem wellFounded_iff_has_min {r : α → α → Prop} :
    WellFounded r ↔ ∀ s : Set α, s.Nonempty → ∃ m ∈ s, ∀ x ∈ s, ¬r x m

WellFounded r ↔ ∀ (s : Set α), s.Nonempty → ∃ m ∈ s, ∀ x ∈ s, ¬r x m


/-- A subfield is closed under subtraction. -/
protected theorem sub_mem {x y : K} : x ∈ s → y ∈ s → x - y ∈ s

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


theorem Ico_filter_lt_of_le_left [DecidablePred (· < c)] (hca : c ≤ a) :
    (Ico a b).filter (· < c) = ∅

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b c : α}
[DecidablePred fun x => x < c]
(hca : c ≤ a)

Finset.filter (fun x => x < c) (Finset.Ico a b) = ∅


theorem lipschitzExtensionConstant_pos (E' : Type*) [NormedAddCommGroup E'] [NormedSpace ℝ E']
    [FiniteDimensional ℝ E'] : 0 < lipschitzExtensionConstant E'

(E' : Type u_1)
[NormedAddCommGroup E']
[NormedSpace ℝ E']
[FiniteDimensional ℝ E']


@[to_additive]
theorem HasProd.tprod_eq (ha : HasProd f a) : ∏' b, f b = a

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}
[T2Space α]
(ha : HasProd f a)


@[simp]
lemma map_apply (f : V ≃ W) (G : SimpleGraph V) (v : V) :
    SimpleGraph.Iso.map f G v = f v

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


private theorem density_sub_eps_le_sum_density_div_card [Nonempty α]
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    {hU : U ∈ P.parts} {hV : V ∈ P.parts} {A B : Finset (Finset α)}
    (hA : A ⊆ (chunk hP G ε hU).parts) (hB : B ⊆ (chunk hP G ε hV).parts) :
    (G.edgeDensity (A.biUnion id) (B.biUnion id)) - ε ^ 5 / 50 ≤
    (∑ ab ∈ A.product B, (G.edgeDensity ab.1 ab.2 : ℝ)) / (A.card * B.card)

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

(hA : A ⊆ (SzemerediRegularity.chunk hP G ε hU).parts)

(hB : B ⊆ (SzemerediRegularity.chunk hP G ε hV).parts)

↑(G.edgeDensity (A.biUnion id) (B.biUnion id)) - ε ^ 5 / 50 ≤
  (∑ ab ∈ A.product B, ↑(G.edgeDensity ab.1 ab.2)) / (↑A.card * ↑B.card)


theorem MetricSpace.replaceUniformity_eq {γ} [U : UniformSpace γ] (m : MetricSpace γ)
    (H : 𝓤[U] = 𝓤[PseudoEMetricSpace.toUniformSpace]) : m.replaceUniformity H = m

{γ : Type u_3}
[U : UniformSpace γ]
(m : MetricSpace γ)
(H : 𝓤 γ = 𝓤 γ)


@[fun_prop]
theorem HasFDerivAt.mul_const (hc : HasFDerivAt c c' x) (d : 𝔸') :
    HasFDerivAt (fun y => c y * d) (d • c') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸' : Type u_7}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
{c : E → 𝔸'}
{c' : E →L[𝕜] 𝔸'}
(hc : HasFDerivAt c c' x)
(d : 𝔸')


theorem toZ_iterate_succ [NoMaxOrder ι] (n : ℕ) : toZ i0 (succ^[n] i0) = n

{ι : Type u_1}
[LinearOrder ι]
[SuccOrder ι]
[IsSuccArchimedean ι]
[PredOrder ι]
{i0 : ι}
[NoMaxOrder ι]
(n : ℕ)


/-- Two affine maps are equal if they have equal linear maps and are equal at some point. -/
theorem ext_linear_iff {f g : P1 →ᵃ[k] P2} : f = g ↔ (f.linear = g.linear) ∧ (∃ p, f p = g p)

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]
{f g : P1 →ᵃ[k] P2}

f = g ↔ f.linear = g.linear ∧ ∃ p, f p = g p


/-- If a finset has cardinality larger than `finrank + 1`,
then there is a nontrivial linear relation amongst its elements,
such that the coefficients of the relation sum to zero. -/
theorem Module.exists_nontrivial_relation_sum_zero_of_finrank_succ_lt_card
    {t : Finset M} (h : finrank R M + 1 < t.card) :
    ∃ f : M → R, ∑ e ∈ t, f e • e = 0 ∧ ∑ e ∈ t, f e = 0 ∧ ∃ x ∈ t, f x ≠ 0

(h : FiniteDimensional.finrank R M + 1 < t.card)

∃ f, ∑ e ∈ t, f e • e = 0 ∧ ∑ e ∈ t, f e = 0 ∧ ∃ x ∈ t, f x ≠ 0


@[to_additive add_lt_of_neg_right]
theorem mul_lt_of_lt_one_right' [CovariantClass α α (· * ·) (· < ·)] (a : α) {b : α} (h : b < 1) :
    a * b < a

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


theorem lie_jacobi : ⁅x, ⁅y, z⁆⁆ + ⁅y, ⁅z, x⁆⁆ + ⁅z, ⁅x, y⁆⁆ = 0


theorem commutator_mem_commutator (h₁ : g₁ ∈ H₁) (h₂ : g₂ ∈ H₂) : ⁅g₁, g₂⁆ ∈ ⁅H₁, H₂⁆

{G : Type u_1}
[Group G]
{g₁ g₂ : G}
{H₁ H₂ : Subgroup G}
(h₁ : g₁ ∈ H₁)
(h₂ : g₂ ∈ H₂)

⁅g₁, g₂⁆ ∈ ⁅H₁, H₂⁆


theorem LieRingModule.compLieHom_apply (x : L₁) (m : M) :
    haveI := LieRingModule.compLieHom M f
    ⁅x, m⁆ = ⁅f x, m⁆

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


theorem fourierIntegral_iteratedDeriv {f : ℝ → E} {N : ℕ∞} {n : ℕ} (hf : ContDiff ℝ N f)
    (h'f : ∀ (n : ℕ), n ≤ N → Integrable (iteratedDeriv n f)) (hn : n ≤ N) :
    𝓕 (iteratedDeriv n f) = fun (x : ℝ) ↦ (2 * π * I * x) ^ n • (𝓕 f x)

(h'f : ∀ (n : ℕ), ↑n ≤ N → MeasureTheory.Integrable (iteratedDeriv n f) MeasureTheory.volume)

𝓕 (iteratedDeriv n f) = fun x => (2 * ↑π * Complex.I * ↑x) ^ n • 𝓕 f x


/-- Alternative formulation of `MeasureTheory.SignedMeasure.exists_isCompl_positive_negative`
(the Hahn decomposition theorem) using set complements. -/
theorem exists_compl_positive_negative (s : SignedMeasure α) :
    ∃ i : Set α, MeasurableSet i ∧ 0 ≤[i] s ∧ s ≤[iᶜ] 0

{α : Type u_1}
[MeasurableSpace α]
(s : MeasureTheory.SignedMeasure α)

∃ i,
  MeasurableSet i ∧
    MeasureTheory.VectorMeasure.restrict 0 i ≤ MeasureTheory.VectorMeasure.restrict s i ∧
      MeasureTheory.VectorMeasure.restrict s iᶜ ≤ MeasureTheory.VectorMeasure.restrict 0 iᶜ


/-- Determinant of 2x2 matrix -/
theorem det_fin_two (A : Matrix (Fin 2) (Fin 2) R) : det A = A 0 0 * A 1 1 - A 0 1 * A 1 0

{R : Type v}
[CommRing R]
(A : Matrix (Fin 2) (Fin 2) R)


/-- Auxiliary lemma to reduce convergence statements from vector-valued functions to real
scalar-valued functions. -/
theorem mellin_convergent_iff_norm [NormedSpace ℂ E] {f : ℝ → E} {T : Set ℝ} (hT : T ⊆ Ioi 0)
    (hT' : MeasurableSet T) (hfc : AEStronglyMeasurable f <| volume.restrict <| Ioi 0) {s : ℂ} :
    IntegrableOn (fun t : ℝ => (t : ℂ) ^ (s - 1) • f t) T ↔
      IntegrableOn (fun t : ℝ => t ^ (s.re - 1) * ‖f t‖) T

(hfc : MeasureTheory.AEStronglyMeasurable f (MeasureTheory.volume.restrict (Set.Ioi 0)))

MeasureTheory.IntegrableOn (fun t => ↑t ^ (s - 1) • f t) T MeasureTheory.volume ↔
  MeasureTheory.IntegrableOn (fun t => t ^ (s.re - 1) * ‖f t‖) T MeasureTheory.volume


/-- The oriented angle between three points is π if and only if the second point is strictly
between the other two. -/
theorem oangle_eq_pi_iff_sbtw {p₁ p₂ p₃ : P} : ∡ p₁ p₂ p₃ = π ↔ Sbtw ℝ p₁ p₂ p₃

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

∡ p₁ p₂ p₃ = ↑π ↔ Sbtw ℝ p₁ p₂ p₃


/-- `Module.Free R M` is the statement that the `R`-module `M` is free. -/
class Module.Free : Prop where
  exists_basis : Nonempty <| (I : Type v) × Basis I R M

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[self : Module.Free R M]


theorem nonempty_support_iff : p.support.Nonempty ↔ p ≠ 0


@[simp] lemma head_tail (p : RelSeries r) (len_pos : p.length ≠ 0) :
    (p.tail len_pos).head = p 1

{α : Type u_1}
{r : Rel α α}
(p : RelSeries r)
(len_pos : p.length ≠ 0)


/-- An additive `n`-Freiman homomorphism from a set `A` to a set `B` is a bijective map which
preserves sums of `n` elements. -/
structure IsAddFreimanIso [AddCommMonoid α] [AddCommMonoid β] (n : ℕ) (A : Set α) (B : Set β)
    (f : α → β) : Prop where
  bijOn : BijOn f A B
  /-- An additive `n`-Freiman homomorphism preserves sums of `n` elements. -/
  map_sum_eq_map_sum ⦃s t : Multiset α⦄ (hsA : ∀ ⦃x⦄, x ∈ s → x ∈ A) (htA : ∀ ⦃x⦄, x ∈ t → x ∈ A)
    (hs : Multiset.card s = n) (ht : Multiset.card t = n) :
    (s.map f).sum = (t.map f).sum ↔ s.sum = t.sum

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{n : ℕ}
{A : Set α}
{B : Set β}
{f : α → β}
(self : IsAddFreimanIso n A B f)


@[simp]
theorem measure_union_toMeasurable : μ (s ∪ toMeasurable μ t) = μ (s ∪ t)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}

μ (s ∪ MeasureTheory.toMeasurable μ t) = μ (s ∪ t)


protected theorem edist_triangle : G.edist u w ≤ G.edist u v + G.edist v w

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


/-- The extension of functors functor `(C ⥤ D) ⥤ (Karoubi C ⥤ D)`
when `D` is idempotent complete. -/
@[simps!]
noncomputable def functorExtension : (C ⥤ D) ⥤ Karoubi C ⥤ D

(C : Type u_1)
(D : Type u_2)
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.IsIdempotentComplete D]

∀ {X Y : CategoryTheory.Functor C D} (f : X ⟶ Y) (X_1 : CategoryTheory.Idempotents.Karoubi C),
  ((CategoryTheory.Idempotents.functorExtension C D).map f).app X_1 =
    (CategoryTheory.Idempotents.toKaroubiEquivalence D).inverse.map
      (((CategoryTheory.Idempotents.functorExtension₂ C D).map f).app X_1)


theorem mem_submoduleImage_of_le {M' : Type*} [AddCommMonoid M'] [Module R M'] {O : Submodule R M}
    {ϕ : O →ₗ[R] M'} {N : Submodule R M} (hNO : N ≤ O) {x : M'} :
    x ∈ ϕ.submoduleImage N ↔ ∃ (y : _) (yN : y ∈ N), ϕ ⟨y, hNO yN⟩ = x

{R : Type u_1}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_11}
[AddCommMonoid M']
[Module R M']
{O : Submodule R M}
{ϕ : ↥O →ₗ[R] M'}
{N : Submodule R M}
(hNO : N ≤ O)
{x : M'}

x ∈ ϕ.submoduleImage N ↔ ∃ y, ∃ (yN : y ∈ N), ϕ ⟨y, ⋯⟩ = x


@[simp] lemma zero_empty : (0 : Fin 0 → α) = ![]


/-- A bicategory structure on the oplax functors between bicategories. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
instance OplaxFunctor.bicategory : Bicategory (OplaxFunctor B C)

(B : Type u₁)
[CategoryTheory.Bicategory B]
(C : Type u₂)
[CategoryTheory.Bicategory C]
{F G : CategoryTheory.OplaxFunctor B C}
(η : F ⟶ G)
(a : B)

(CategoryTheory.Bicategory.leftUnitor η).inv.app a = (CategoryTheory.Bicategory.leftUnitor (η.app a)).inv


@[simp]
lemma map_zero_inv_app (X : C) :
    F.map ((zero hF s i).inv.app X) =
      (shiftFunctorZero D A).inv.app (F.obj X) ≫ (i 0).inv.app X

(i : (i : A) → (s i).comp F ≅ F.comp (CategoryTheory.shiftFunctor D i))

F.map ((CategoryTheory.Functor.FullyFaithful.hasShift.zero hF s i).inv.app X) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctorZero D A).inv.app (F.obj X)) ((i 0).inv.app X)


@[to_additive]
theorem tprod_bool (f : Bool → α) : ∏' i : Bool, f i = f false * f true

{α : Type u_1}
[CommMonoid α]
[TopologicalSpace α]
(f : Bool → α)


theorem map_map (g : N →[L] P) (f : M →[L] N) : (S.map f).map g = S.map (g.comp f)

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
{P : Type u_2}
[L.Structure M]
[L.Structure N]
[L.Structure P]
(S : L.Substructure M)
(g : L.Hom N P)
(f : L.Hom M N)

FirstOrder.Language.Substructure.map g (FirstOrder.Language.Substructure.map f S) =
  FirstOrder.Language.Substructure.map (g.comp f) S


/-- The function `MulOpposite.op` is an additive equivalence. -/
@[simps! (config := { fullyApplied := false, simpRhs := true }) apply symm_apply]
def opAddEquiv [Add α] : α ≃+ αᵐᵒᵖ


theorem Integrable.prod_left_ae [SFinite μ] ⦃f : α × β → E⦄ (hf : Integrable f (μ.prod ν)) :
    ∀ᵐ y ∂ν, Integrable (fun x => f (x, y)) μ

⦃f : α × β → E⦄

(hf : MeasureTheory.Integrable f (μ.prod ν))

∀ᵐ (y : β) ∂ν, MeasureTheory.Integrable (fun x => f (x, y)) μ


theorem closure_subset_iff_isClosed : closure s ⊆ s ↔ IsClosed s

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


@[to_additive]
theorem mem_closure_pair {x y z : C} :
    z ∈ closure ({x, y} : Set C) ↔ ∃ m n : ℤ, x ^ m * y ^ n = z

{C : Type u_6}
[AddCommGroup C]
{x y z : C}

z ∈ AddSubgroup.closure {x, y} ↔ ∃ m n, m • x + n • y = z


theorem differentiableAt_sinh {x : ℂ} : DifferentiableAt ℂ sinh x


@[symm]
theorem symm (h : ν ⟂ₘ μ) : μ ⟂ₘ ν

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


@[simp, norm_cast]
theorem coe_le_coe {f g : α →o β} : (f : α → β) ≤ g ↔ f ≤ g

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{f g : α →o β}

⇑f ≤ ⇑g ↔ f ≤ g


/-- Consider a series of functions `∑' n, f n x` on a preconnected open set. If the series converges
at a point, and all functions in the series are differentiable with a summable bound on the
derivatives, then the series converges everywhere on the set. -/
theorem summable_of_summable_hasDerivAt_of_isPreconnected (hu : Summable u) (ht : IsOpen t)
    (h't : IsPreconnected t) (hg : ∀ n y, y ∈ t → HasDerivAt (g n) (g' n y) y)
    (hg' : ∀ n y, y ∈ t → ‖g' n y‖ ≤ u n) (hy₀ : y₀ ∈ t) (hg0 : Summable (g · y₀))
    (hy : y ∈ t) : Summable fun n => g n y

(hg : ∀ (n : α), ∀ y ∈ t, HasDerivAt (g n) (g' n y) y)

(hg' : ∀ (n : α), ∀ y ∈ t, ‖g' n y‖ ≤ u n)


theorem homEquiv_naturality_left_square_iff (f : X' ⟶ X) (g : F.obj X ⟶ Y')
    (h : F.obj X' ⟶ Y) (k : Y ⟶ Y') :
    (f ≫ (adj.homEquiv X Y') g = (adj.homEquiv X' Y) h ≫ G.map k) ↔
      (F.map f ≫ g = h ≫ k)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
{G : CategoryTheory.Functor D C}
(adj : F ⊣ G)
{X' X : C}
{Y Y' : D}
(f : X' ⟶ X)
(g : F.obj X ⟶ Y')
(h : F.obj X' ⟶ Y)
(k : Y ⟶ Y')

CategoryTheory.CategoryStruct.comp f ((adj.homEquiv X Y') g) =
    CategoryTheory.CategoryStruct.comp ((adj.homEquiv X' Y) h) (G.map k) ↔
  CategoryTheory.CategoryStruct.comp (F.map f) g = CategoryTheory.CategoryStruct.comp h k


theorem lt_max_of_lt_right (h : a < c) : a < max b c

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


/-- A `JordanHolderLattice` is the class for which the Jordan Hölder theorem is proved. A
Jordan Hölder lattice is a lattice equipped with a notion of maximality, `IsMaximal`, and a notion
of isomorphism of pairs `Iso`. In the example of subgroups of a group, `IsMaximal H K` means that
`H` is a maximal normal subgroup of `K`, and `Iso (H₁, K₁) (H₂, K₂)` means that the quotient
`H₁ / K₁` is isomorphic to the quotient `H₂ / K₂`. `Iso` must be symmetric and transitive and must
satisfy the second isomorphism theorem `Iso (H, H ⊔ K) (H ⊓ K, K)`.
Examples include `Subgroup G` if `G` is a group, and `Submodule R M` if `M` is an `R`-module.
-/
class JordanHolderLattice (X : Type u) [Lattice X] where
  IsMaximal : X → X → Prop
  lt_of_isMaximal : ∀ {x y}, IsMaximal x y → x < y
  sup_eq_of_isMaximal : ∀ {x y z}, IsMaximal x z → IsMaximal y z → x ≠ y → x ⊔ y = z
  isMaximal_inf_left_of_isMaximal_sup :
    ∀ {x y}, IsMaximal x (x ⊔ y) → IsMaximal y (x ⊔ y) → IsMaximal (x ⊓ y) x
  Iso : X × X → X × X → Prop
  iso_symm : ∀ {x y}, Iso x y → Iso y x
  iso_trans : ∀ {x y z}, Iso x y → Iso y z → Iso x z
  second_iso : ∀ {x y}, IsMaximal x (x ⊔ y) → Iso (x, x ⊔ y) (x ⊓ y, y)

{X : Type u}
[Lattice X]
[self : JordanHolderLattice X]
{x y : X × X}

JordanHolderLattice.Iso x y → JordanHolderLattice.Iso y x


@[to_additive (attr := simp)]
theorem coprodAssoc_apply_inl_inl (x : M) : coprodAssoc M N P (inl (inl x)) = inl x

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[Monoid M]
[Monoid N]
[Monoid P]
(x : M)

(Monoid.MulEquiv.coprodAssoc M N P) (Monoid.Coprod.inl (Monoid.Coprod.inl x)) = Monoid.Coprod.inl x


protected theorem MonovaryOn.subset (hst : s ⊆ t) (h : MonovaryOn f g t) : MonovaryOn f g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
{s t : Set ι}
(hst : s ⊆ t)
(h : MonovaryOn f g t)


lemma mono_of_isZero_kernel {X Y : C} (f : X ⟶ Y) [HasKernel f] (h : IsZero (kernel f)) :
    Mono f

(h : CategoryTheory.Limits.IsZero (CategoryTheory.Limits.kernel f))


/-- The operator norm of the second projection `E × F → F` is at most 1. (It is 0 if `F` is zero, so
the inequality cannot be improved without further assumptions.) -/
lemma norm_snd_le : ‖snd 𝕜 E F‖ ≤ 1

(𝕜 : Type u_1)
(E : Type u_2)
(F : Type u_3)
[NontriviallyNormedField 𝕜]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]


@[simp]
theorem map_obj_hom : ((map f).obj U).hom = f ≫ U.hom

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X Y : T}
{f : X ⟶ Y}
{U : CategoryTheory.Under Y}

((CategoryTheory.Under.map f).obj U).hom = CategoryTheory.CategoryStruct.comp f U.hom


/-- The homeomorphism between `AddCircle (2 * π)` and `circle`. -/
@[simps] noncomputable def homeomorphCircle' : AddCircle (2 * π) ≃ₜ circle

AddCircle.homeomorphCircle' θ = θ.expMapCircle


theorem SupIrred.not_isMin (ha : SupIrred a) : ¬IsMin a

{α : Type u_2}
[SemilatticeSup α]
{a : α}
(ha : SupIrred a)


theorem openEmbedding_coe : OpenEmbedding ((↑) : ℍ → ℂ)


theorem map_add : ∀ (x y : R), min (v x) (v y) ≤ v (x + y)

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedAddCommMonoidWithTop Γ₀]
(v : AddValuation R Γ₀)
(x y : R)


theorem Disjoint.mono {x y : Perm α} (h : Disjoint f g) (hf : x.support ≤ f.support)
    (hg : y.support ≤ g.support) : Disjoint x y

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{f g x y : Equiv.Perm α}
(h : f.Disjoint g)
(hf : x.support ≤ f.support)
(hg : y.support ≤ g.support)


theorem isBot_iff_isMin [IsDirected α (· ≥ ·)] : IsBot a ↔ IsMin a

{α : Type u}
[Preorder α]
{a : α}
[IsDirected α fun x x_1 => x ≥ x_1]


@[reassoc (attr := simp)]
lemma leftHomologyπ_naturality :
    S₁.leftHomologyπ ≫ leftHomologyMap φ = cyclesMap φ ≫ S₂.leftHomologyπ

CategoryTheory.CategoryStruct.comp S₁.leftHomologyπ (CategoryTheory.ShortComplex.leftHomologyMap φ) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.cyclesMap φ) S₂.leftHomologyπ


/-- An open neighborhood of the identity in the cartesian product of two nonarchimedean groups
contains the cartesian product of an open neighborhood in each group. -/
@[to_additive NonarchimedeanAddGroup.prod_subset "An open neighborhood of the identity in
the cartesian product of two nonarchimedean groups contains the cartesian product of
an open neighborhood in each group."]
theorem prod_subset {U} (hU : U ∈ 𝓝 (1 : G × K)) :
    ∃ (V : OpenSubgroup G) (W : OpenSubgroup K), (V : Set G) ×ˢ (W : Set K) ⊆ U

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[NonarchimedeanAddGroup G]
{K : Type u_3}
[AddGroup K]
[TopologicalSpace K]
[NonarchimedeanAddGroup K]
{U : Set (G × K)}
(hU : U ∈ 𝓝 0)

∃ V W, ↑V ×ˢ ↑W ⊆ U


theorem eLpNorm'_measure_zero_of_exponent_zero {f : α → F} : eLpNorm' f 0 (0 : Measure α) = 1

{α : Type u_1}
{F : Type u_3}
[NormedAddCommGroup F]
[MeasurableSpace α]
{f : α → F}


theorem size_modify (a : Array α) (i : Nat) (f : α → α) :
    (a.modify i f).size = a.size

{α : Type u_1}
(a : Array α)
(i : Nat)
(f : α → α)


theorem rev_succ (k : Fin n) : rev (succ k) = castSucc (rev k)


theorem convex_halfspace_lt {f : E → β} (h : IsLinearMap 𝕜 f) (r : β) : Convex 𝕜 { w | f w < r }

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
[OrderedCancelAddCommMonoid β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{f : E → β}
(h : IsLinearMap 𝕜 f)
(r : β)


theorem of_injective : Function.Injective (of : α → FreeCommRing α)


theorem le_left_iff (h : IsCompl x y) : z ≤ x ↔ Disjoint z y

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{x y z : α}
(h : IsCompl x y)


/-- `(d/dx) lim_{n → ∞} f n x = lim_{n → ∞} f' n x` when the `f' n` converge
_uniformly_ to their limit on an open set containing `x`. -/
theorem hasFDerivAt_of_tendstoUniformlyOn [NeBot l] {s : Set E} (hs : IsOpen s)
    (hf' : TendstoUniformlyOn f' g' l s)
    (hf : ∀ n : ι, ∀ x : E, x ∈ s → HasFDerivAt (f n) (f' n x) x)
    (hfg : ∀ x : E, x ∈ s → Tendsto (fun n => f n x) l (𝓝 (g x))) :
    ∀ x : E, x ∈ s → HasFDerivAt g (g' x) x

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

(hfg : ∀ x ∈ s, Filter.Tendsto (fun n => f n x) l (𝓝 (g x)))


theorem _root_.HasCompactSupport.contDiff_convolution_right {n : ℕ∞} (hcg : HasCompactSupport g)
    (hf : LocallyIntegrable f μ) (hg : ContDiff 𝕜 n g) : ContDiff 𝕜 n (f ⋆[L, μ] g)

(hf : MeasureTheory.LocallyIntegrable f μ)

ContDiff 𝕜 n (MeasureTheory.convolution f g L μ)


@[simp]
theorem map₂_left [NeBot g] : map₂ (fun x _ => x) f g = f

{α : Type u_1}
{β : Type u_3}
{f : Filter α}
{g : Filter β}
[g.NeBot]


@[to_additive]
theorem measure_eq_zero_iff_eq_empty_of_smulInvariant (hμ : μ ≠ 0) (hU : IsOpen U) :
    μ U = 0 ↔ U = ∅

[MeasureTheory.VAddInvariantMeasure G α μ]


@[simp]
theorem lift_le_one_iff {a : Cardinal.{u}} :
    lift.{v} a ≤ 1 ↔ a ≤ 1


/-- A morphism factors through the sheafification of the image presheaf. -/
@[simps!]
def toImagePresheafSheafify (f : F' ⟶ F) : F' ⟶ ((imagePresheaf f).sheafify J).toPresheaf

(J : CategoryTheory.GrothendieckTopology C)

∀ (a : F'.obj X), ↑((J.toImagePresheafSheafify f).app X a) = f.app X a


theorem get_of_bisim (bisim : IsBisimulation R) :
    ∀ {s₁ s₂} (n), s₁ ~ s₂ → get s₁ n = get s₂ n ∧ drop (n + 1) s₁ ~ drop (n + 1) s₂

{α : Type u}
(R : Stream' α → Stream' α → Prop)
(bisim : Stream'.IsBisimulation R)
{s₁ s₂ : Stream' α}
(n : ℕ)

R s₁ s₂ → s₁.get n = s₂.get n ∧ R (Stream'.drop (n + 1) s₁) (Stream'.drop (n + 1) s₂)


theorem one_eq_closure_one_set : (1 : AddSubmonoid R) = closure 1


@[simp, norm_cast]
theorem coe_prod [Module R₁ M₂] [Module R₁ M₃] (f₁ : M₁ →L[R₁] M₂) (f₂ : M₁ →L[R₁] M₃) :
    (f₁.prod f₂ : M₁ →ₗ[R₁] M₂ × M₃) = LinearMap.prod f₁ f₂

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
[Module R₁ M₁]
[Module R₁ M₂]
[Module R₁ M₃]
(f₁ : M₁ →L[R₁] M₂)
(f₂ : M₁ →L[R₁] M₃)


/-- `X` is simple iff it has subobject lattice `{⊥, ⊤}`. -/
theorem simple_iff_subobject_isSimpleOrder (X : C) : Simple X ↔ IsSimpleOrder (Subobject X)

CategoryTheory.Simple X ↔ IsSimpleOrder (CategoryTheory.Subobject X)


lemma setIntegral_condKernel_univ_left (a : α) {t : Set Ω} (ht : MeasurableSet t)
    (hf : IntegrableOn f (Set.univ ×ˢ t) (κ a)) :
    ∫ b, ∫ ω in t, f (b, ω) ∂(Kernel.condKernel κ (a, b)) ∂(Kernel.fst κ a)
      = ∫ x in Set.univ ×ˢ t, f x ∂(κ a)

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

(hf : MeasureTheory.IntegrableOn f (Set.univ ×ˢ t) (κ a))

∫ (b : β), ∫ (ω : Ω) in t, f (b, ω) ∂κ.condKernel (a, b) ∂κ.fst a = ∫ (x : β × Ω) in Set.univ ×ˢ t, f x ∂κ a


@[simp]
theorem support_smul_eq {S₁ : Type*} [Semiring S₁] [Module S₁ R] [NoZeroSMulDivisors S₁ R] {a : S₁}
    (h : a ≠ 0) (p : MvPolynomial σ R) : (a • p).support = p.support

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{S₁ : Type u_2}
[Semiring S₁]
[Module S₁ R]
[NoZeroSMulDivisors S₁ R]
{a : S₁}
(h : a ≠ 0)
(p : MvPolynomial σ R)


theorem lt_wf : @WellFounded PartENat (· < ·)


theorem ofBijective_apply {f : A₁ →ₐ[R] A₂} {hf : Function.Bijective f} (a : A₁) :
    (AlgEquiv.ofBijective f hf) a = f a

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
{f : A₁ →ₐ[R] A₂}
{hf : Function.Bijective ⇑f}
(a : A₁)


theorem lift.unique {φ' : (⨂[R] i, s i) →ₗ[R] E} (H : ∀ f, φ' (PiTensorProduct.tprod R f) = φ f) :
    φ' = lift φ

{φ' : (PiTensorProduct R fun i => s i) →ₗ[R] E}

(H : ∀ (f : (i : ι) → s i), φ' ((PiTensorProduct.tprod R) f) = φ f)


@[simp] theorem toBialgEquiv_symm (e : X ≅ Y) :
    toBialgEquiv e.symm = (toBialgEquiv e).symm

{R : Type u}
[CommRing R]
{X Y : BialgebraCat R}
(e : X ≅ Y)


theorem splitAux_of_valid (p l m r acc) :
    splitAux ⟨l ++ m ++ r⟩ p ⟨utf8Len l⟩ ⟨utf8Len l + utf8Len m⟩ acc =
      acc.reverse ++ (List.splitOnP.go p r m.reverse).map mk

(p : Char → Bool)
(l m r : List Char)
(acc : List String)

{ data := l ++ m ++ r }.splitAux p { byteIdx := String.utf8Len l } { byteIdx := String.utf8Len l + String.utf8Len m }
    acc =
  acc.reverse ++ List.map String.mk (List.splitOnP.go p r m.reverse)


theorem infs_sups_subset_left : s ⊼ (t ⊻ u) ⊆ s ⊼ t ⊻ s ⊼ u

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


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


@[simp] lemma isAtom_singleton (a : α) : IsAtom ({a} : Finset α)


@[simp]
theorem comp_id (f : A →A[R] B) : f.comp (ContinuousAlgHom.id R A) = f

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


@[simp, reassoc]
theorem comp_f {C₁ C₂ C₃ : HomologicalComplex V c} (f : C₁ ⟶ C₂) (g : C₂ ⟶ C₃) (i : ι) :
    (f ≫ g).f i = f.f i ≫ g.f i


@[simp] theorem Function.Embedding.sigmaSet_range {s : ι → Set α}
    (h : Pairwise (Disjoint on s)) : Set.range (Function.Embedding.sigmaSet h) = ⋃ i, s i

{α : Type u_1}
{ι : Type u_2}
{s : ι → Set α}
(h : Pairwise (Disjoint on s))

Set.range ⇑(Function.Embedding.sigmaSet h) = ⋃ i, s i


@[simp]
theorem mem_filter {p : Box ι → Prop} : J ∈ π.filter p ↔ J ∈ π ∧ p J

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
(π : BoxIntegral.TaggedPrepartition I)
{p : BoxIntegral.Box ι → Prop}


@[simp]
theorem mem_range {f : α →ₛ β} {b} : b ∈ f.range ↔ b ∈ range f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{f : MeasureTheory.SimpleFunc α β}
{b : β}


theorem inner_mul_symm_re_eq_norm (x y : F) : re (⟪x, y⟫ * ⟪y, x⟫) = ‖⟪x, y⟫ * ⟪y, x⟫‖

{𝕜 : Type u_1}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
[c : InnerProductSpace.Core 𝕜 F]
(x y : F)

RCLike.re (⟪x, y⟫_𝕜 * ⟪y, x⟫_𝕜) = ‖⟪x, y⟫_𝕜 * ⟪y, x⟫_𝕜‖


protected lemma SupClosed.infClosure (hs : SupClosed s) : SupClosed (infClosure s)

{α : Type u_2}
[DistribLattice α]
{s : Set α}
(hs : SupClosed s)


/--
`Subtype p`, usually written as `{x : α // p x}`, is a type which
represents all the elements `x : α` for which `p x` is true. It is structurally
a pair-like type, so if you have `x : α` and `h : p x` then
`⟨x, h⟩ : {x // p x}`. An element `s : {x // p x}` will coerce to `α` but
you can also make it explicit using `s.1` or `s.val`.
-/
@[pp_using_anonymous_constructor]
structure Subtype {α : Sort u} (p : α → Prop) where
  /-- If `s : {x // p x}` then `s.val : α` is the underlying element in the base
  type. You can also write this as `s.1`, or simply as `s` when the type is
  known from context. -/
  val : α
  /-- If `s : {x // p x}` then `s.2` or `s.property` is the assertion that
  `p s.1`, that is, that `s` is in fact an element for which `p` holds. -/
  property : p val

{α : Sort u}
{p : α → Prop}
(self : Subtype p)


@[simp]
theorem deriv_mul (hc : DifferentiableAt 𝕜 c x) (hd : DifferentiableAt 𝕜 d x) :
    deriv (fun y => c y * d y) x = deriv c x * d x + c x * deriv d x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{𝔸 : Type u_3}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{c d : 𝕜 → 𝔸}
(hc : DifferentiableAt 𝕜 c x)
(hd : DifferentiableAt 𝕜 d x)


theorem hasPDF_of_pdf_ne_zero {m : MeasurableSpace Ω} {ℙ : Measure Ω} {μ : Measure E} {X : Ω → E}
    (hac : map X ℙ ≪ μ) (hpdf : ¬pdf X ℙ μ =ᵐ[μ] 0) : HasPDF X ℙ μ

(hac : MeasureTheory.Measure.map X ℙ ≪ μ)

(hpdf : ¬MeasureTheory.pdf X ℙ μ =ᵐ[μ] 0)


/-- Scalar multiplication as a monoid homomorphism. -/
@[simps]
def smulMonoidHom [Monoid α] [MulOneClass β] [MulAction α β] [IsScalarTower α β β]
    [SMulCommClass α β β] : α × β →* β

{α : Type u_5}
{β : Type u_6}
[Monoid α]
[MulOneClass β]
[MulAction α β]
[IsScalarTower α β β]
[SMulCommClass α β β]

∀ (a : α × β), smulMonoidHom a = smulMulHom.toFun a


theorem continuousOn_tan : ContinuousOn tan {x | cos x ≠ 0}

ContinuousOn Complex.tan {x | Complex.cos x ≠ 0}


theorem lookupFinsupp_surjective : Function.Surjective (@lookupFinsupp α M _)


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

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


@[simp] lemma fourierTransformCLE_symm_apply (f : 𝓢(V, E)) :
    (fourierTransformCLE 𝕜).symm f = 𝓕⁻ f

(𝕜 : Type u_1)
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[NormedSpace 𝕜 E]
[SMulCommClass ℂ 𝕜 E]
{V : Type u_3}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[FiniteDimensional ℝ V]
[MeasurableSpace V]
[BorelSpace V]
[CompleteSpace E]
(f : SchwartzMap V E)

⇑((SchwartzMap.fourierTransformCLE 𝕜).symm f) = 𝓕⁻ ⇑f


/-- The `normSq` function on `ℂ` is proper. -/
theorem tendsto_normSq_cocompact_atTop : Tendsto normSq (cocompact ℂ) atTop

Filter.Tendsto (⇑Complex.normSq) (Filter.cocompact ℂ) Filter.atTop


theorem HasStrictFDerivAt.arsinh (hf : HasStrictFDerivAt f f' a) :
    HasStrictFDerivAt (fun x => arsinh (f x)) ((√(1 + f a ^ 2))⁻¹ • f') a

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

HasStrictFDerivAt (fun x => Real.arsinh (f x)) ((√(1 + f a ^ 2))⁻¹ • f') a


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

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

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


/-- The right homology data on a short complex equipped with a splitting. -/
@[simps]
noncomputable def rightHomologyData [HasZeroObject C] (s : S.Splitting) :
    RightHomologyData S

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
[CategoryTheory.Limits.HasZeroObject C]
(s : S.Splitting)


@[to_additive]
theorem _root_.Equiv.Perm.prod_comp (σ : Equiv.Perm α) (s : Finset α) (f : α → β)
    (hs : { a | σ a ≠ a } ⊆ s) : (∏ x ∈ s, f (σ x)) = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
(σ : Equiv.Perm α)
(s : Finset α)
(f : α → β)
(hs : {a | σ a ≠ a} ⊆ ↑s)


theorem aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : ℕ → A) (n : ℕ) :
    aeval f (W_ R n) = ∑ i ∈ range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i)

(p : ℕ)
(R : Type u_1)
[CommRing R]
{A : Type u_3}
[CommRing A]
[Algebra R A]
(f : ℕ → A)
(n : ℕ)

(MvPolynomial.aeval f) (W_ R n) = ∑ i ∈ Finset.range (n + 1), ↑p ^ i * f i ^ p ^ (n - i)


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

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


protected lemma mul_dvd_mul_right (a : ℤ) (h : b ∣ c) : b * a ∣ c * a


/-- See also `Set.nonempty_iff_ne_empty`. -/
theorem not_nonempty_iff_eq_empty {s : Set α} : ¬s.Nonempty ↔ s = ∅


@[simp]
theorem image_singleton {f : α → β} {a : α} : f '' {a} = {f a}

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{a : α}


@[simp, nolint simpNF]
theorem mem_carrier {s : StarSubsemiring R} {x : R} : x ∈ s.carrier ↔ x ∈ s

{R : Type v}
[NonAssocSemiring R]
[StarRing R]
{s : StarSubsemiring R}
{x : R}


theorem kstar_eq_iSup_pow (l : Language α) : l∗ = ⨆ i : ℕ, l ^ i


@[simp]
theorem enum_map_snd (l : List α) : map Prod.snd (enum l) = l


/-- If `f` is invariant under the action of a countable group `G`, and `μ` is a `G`-invariant
  measure with a fundamental domain `s`, then the `essSup` of `f` restricted to `s` is the same as
  that of `f` on all of its domain. -/
@[to_additive "If `f` is invariant under the action of a countable additive group `G`, and `μ` is a
  `G`-invariant measure with a fundamental domain `s`, then the `essSup` of `f` restricted to `s`
  is the same as that of `f` on all of its domain."]
theorem essSup_measure_restrict (hs : IsFundamentalDomain G s μ) {f : α → ℝ≥0∞}
    (hf : ∀ γ : G, ∀ x : α, f (γ • x) = f x) : essSup f (μ.restrict s) = essSup f μ

[MeasureTheory.SMulInvariantMeasure G α μ]

(hs : MeasureTheory.IsFundamentalDomain G s μ)

{f : α → ℝ≥0∞}

(hf : ∀ (γ : G) (x : α), f (γ • x) = f x)


theorem IsExtreme.extremePoints_eq (hAB : IsExtreme 𝕜 A B) :
    B.extremePoints 𝕜 = B ∩ A.extremePoints 𝕜

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{A B : Set E}
(hAB : IsExtreme 𝕜 A B)

Set.extremePoints 𝕜 B = B ∩ Set.extremePoints 𝕜 A


lemma biUnion_biUnion [DecidableEq γ] (s : Finset α) (f : α → Finset β) (g : β → Finset γ) :
    (s.biUnion f).biUnion g = s.biUnion fun a ↦ (f a).biUnion g

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

(s.biUnion f).biUnion g = s.biUnion fun a => (f a).biUnion g


@[simp]
theorem factorThruKernelSubobject_comp_arrow {W : C} (h : W ⟶ X) (w : h ≫ f = 0) :
    factorThruKernelSubobject f h w ≫ (kernelSubobject f).arrow = h

CategoryTheory.Limits.factorThruKernelSubobject f h w ≫ (CategoryTheory.Limits.kernelSubobject f).arrow = h


@[simp]
theorem sameRay_neg_smul_right_iff {v : M} {r : R} : SameRay R (-v) (r • v) ↔ r ≤ 0 ∨ v = 0

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{v : M}
{r : R}


theorem weightedHomogeneousComponent_eq_zero'
    (h : ∀ d : σ →₀ ℕ, d ∈ φ.support → weight w d ≠ n) :
    weightedHomogeneousComponent w n φ = 0

(h : ∀ d ∈ φ.support, (Finsupp.weight w) d ≠ n)

(MvPolynomial.weightedHomogeneousComponent w n) φ = 0


@[reassoc (attr := simp)] lemma w₀₂_τ₂ : S.v₀₁.τ₂ ≫ S.v₁₂.τ₂ = 0

(S : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.CategoryStruct.comp S.v₀₁.τ₂ S.v₁₂.τ₂ = 0


/-- `Dilation.ratio` as a monoid homomorphism from `α →ᵈ α` to `ℝ≥0`. -/
@[simps]
def ratioHom : (α →ᵈ α) →* ℝ≥0

{α : Type u_1}
[PseudoEMetricSpace α]
(f : α →ᵈ α)


theorem ae_le_trim_of_stronglyMeasurable [LinearOrder γ] [TopologicalSpace γ]
    [OrderClosedTopology γ] [PseudoMetrizableSpace γ] (hm : m ≤ m0) {f g : β → γ}
    (hf : StronglyMeasurable[m] f) (hg : StronglyMeasurable[m] g) (hfg : f ≤ᵐ[μ] g) :
    f ≤ᵐ[μ.trim hm] g

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)


@[to_additive (attr := simp)]
theorem of_smul (f : α → β → β) (x : α) (y : β) :
    (haveI := mkMulAction f
    of x • y) = f x y

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


@[to_additive (attr := simp, norm_cast) coe_nonneg]
theorem one_le_coe [LE α] {a : α} : 1 ≤ (a : WithTop α) ↔ 1 ≤ a

1 ≤ ↑a ↔ 1 ≤ a


@[to_additive]
theorem NormedCommGroup.uniformity_basis_dist :
    (𝓤 E).HasBasis (fun ε : ℝ => 0 < ε) fun ε => { p : E × E | ‖p.fst / p.snd‖ < ε }

(𝓤 E).HasBasis (fun ε => 0 < ε) fun ε => {p | ‖p.1 / p.2‖ < ε}


lemma add_smul_equiv (P Q : Fin 3 → R) {u v : R} (hu : IsUnit u) (hv : IsUnit v) :
    W'.add (u • P) (v • Q) ≈ W'.add P Q

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P Q : Fin 3 → R)
{u v : R}
(hu : IsUnit u)
(hv : IsUnit v)


@[to_additive]
theorem controlled_prod_of_mem_closure_range {j : E →* F} {b : F}
    (hb : b ∈ closure (j.range : Set F)) {f : ℕ → ℝ} (b_pos : ∀ n, 0 < f n) :
    ∃ a : ℕ → E,
      Tendsto (fun n => ∏ i ∈ range (n + 1), j (a i)) atTop (𝓝 b) ∧
        ‖j (a 0) / b‖ < f 0 ∧ ∀ n, 0 < n → ‖j (a n)‖ < f n

{E : Type u_6}
{F : Type u_7}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
{j : E →+ F}
{b : F}
(hb : b ∈ closure ↑j.range)
{f : ℕ → ℝ}
(b_pos : ∀ (n : ℕ), 0 < f n)

∃ a,
  Filter.Tendsto (fun n => ∑ i ∈ Finset.range (n + 1), j (a i)) Filter.atTop (𝓝 b) ∧
    ‖j (a 0) - b‖ < f 0 ∧ ∀ (n : ℕ), 0 < n → ‖j (a n)‖ < f n


/-- The map that turns a triangle index into an explicit triangle. -/
@[simps] def toTriangle : α × β × γ ↪ Finset (α ⊕ β ⊕ γ)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[DecidableEq α]
[DecidableEq β]
[DecidableEq γ]
(x : α × β × γ)

SimpleGraph.TripartiteFromTriangles.toTriangle x = {Sum3.in₀ x.1, Sum3.in₁ x.2.1, Sum3.in₂ x.2.2}


@[to_additive]
theorem _root_.hasCompactMulSupport_comp_left (hg : ∀ {x}, g x = 1 ↔ x = 1) :
    HasCompactMulSupport (g ∘ f) ↔ HasCompactMulSupport f

{α : Type u_2}
{β : Type u_4}
{γ : Type u_5}
[TopologicalSpace α]
[Zero β]
[Zero γ]
{g : β → γ}
{f : α → β}
(hg : ∀ {x : β}, g x = 0 ↔ x = 0)

HasCompactSupport (g ∘ f) ↔ HasCompactSupport f


theorem mapIdx_eq_enum_map (l : List α) (f : ℕ → α → β) :
    l.mapIdx f = l.enum.map (Function.uncurry f)

{α : Type u}
{β : Type v}
(l : List α)
(f : ℕ → α → β)

List.mapIdx f l = List.map (Function.uncurry f) l.enum


theorem le_of_lt_add_one (h : m < n + 1) : m ≤ n


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofLex_smul]
theorem ofLex_pow [Pow α β] (a : Lex α) (b : β) : ofLex (a ^ b) = ofLex a ^ b

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


theorem monotone_Iio : Monotone (Iio : α → Set α)


@[to_additive (attr := simp)]
theorem prod_div_distrib : ∏ x ∈ s, f x / g x = (∏ x ∈ s, f x) / ∏ x ∈ s, g x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{f g : α → β}
[SubtractionCommMonoid β]

∑ x ∈ s, (f x - g x) = ∑ x ∈ s, f x - ∑ x ∈ s, g x


/-- As a map from the left argument to a unary function, `f` is injective. -/
theorem left' (hf : Injective2 f) [Nonempty β] : Function.Injective f

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β → γ}
(hf : Function.Injective2 f)
[Nonempty β]


@[simp]
theorem aleph0_toPartENat : toPartENat ℵ₀ = ⊤


theorem fderiv_of_not_mem_tsupport (h : x ∉ tsupport f) : fderiv 𝕜 f x = 0

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


@[reassoc (attr := simp)]
lemma inr_f_fst_v (p q : ℤ) (hpq : p + 1 = q) :
    (inr φ).f p ≫ (fst φ).1.v p q hpq = 0

(CochainComplex.mappingCone.inr φ).f p ≫ (↑(CochainComplex.mappingCone.fst φ)).v p q hpq = 0


protected theorem ofNat (α) [Denumerable α] : Computable (ofNat α)


@[simp] theorem of_symm_smul [PartialOrder Γ] [SMulZeroClass R V] (r : R) (x : HahnModule Γ R V) :
  (of R).symm (r • x) = r • (of R).symm x

{Γ : Type u_1}
{R : Type u_3}
{V : Type u_4}
[AddCommMonoid V]
[PartialOrder Γ]
[SMulZeroClass R V]
(r : R)
(x : HahnModule Γ R V)

(HahnModule.of R).symm (r • x) = r • (HahnModule.of R).symm x


@[csimp]
theorem iterate_eq_iterateTR : @iterate = @iterateTR


theorem upperSemicontinuous_const : UpperSemicontinuous fun _x : α => z

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{z : β}


theorem PairwiseDisjoint.subset (ht : t.PairwiseDisjoint f) (h : s ⊆ t) : s.PairwiseDisjoint f

{α : Type u_1}
{ι : Type u_4}
[PartialOrder α]
[OrderBot α]
{s t : Set ι}
{f : ι → α}
(ht : t.PairwiseDisjoint f)
(h : s ⊆ t)


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


theorem le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁ ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s

{α : Type u_1}
[MeasurableSpace α]
{m₁ m₂ : MeasureTheory.OuterMeasure α}

m₁ ≤ m₂.trim ↔ ∀ (s : Set α), MeasurableSet s → m₁ s ≤ m₂ s


theorem linearIndependent_fin2 {f : Fin 2 → V} :
    LinearIndependent K f ↔ f 1 ≠ 0 ∧ ∀ a : K, a • f 1 ≠ f 0

{K : Type u_3}
{V : Type u}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{f : Fin 2 → V}

LinearIndependent K f ↔ f 1 ≠ 0 ∧ ∀ (a : K), a • f 1 ≠ f 0


private theorem ξ_mulVec_eq_0 : a *ᵥ ξ K x = 0

(a : Matrix α β (NumberField.RingOfIntegers K))

(hmulvec0 : (NumberField.house.asiegel K a).mulVec x = 0)


@[simp]
lemma inv_ev (γ : OneCochain G U) (i j : I) {T : C} (a : T ⟶ U i) (b : T ⟶ U j) :
    (γ⁻¹).ev i j a b = (γ.ev i j a b)⁻¹

(γ : CategoryTheory.PresheafOfGroups.OneCochain G U)


/-- The square with `0 : 0 ⟶ 0` on the right and `𝟙 X` on the left is a pullback square. -/
@[simp]
theorem zero_right (X : C) : IsPullback (0 : X ⟶ 0) (𝟙 X) (0 : (0 : C) ⟶ 0) (0 : X ⟶ 0)


protected theorem mul_div_assoc (a : Int) : ∀ {b c : Int}, c ∣ b → (a * b).div c = a * (b.div c)


theorem eval₂_multiset_prod (s : Multiset R[X]) (x : S) :
    eval₂ f x s.prod = (s.map (eval₂ f x)).prod

{R : Type u}
{S : Type v}
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
(s : Multiset R[X])
(x : S)

Polynomial.eval₂ f x s.prod = (Multiset.map (Polynomial.eval₂ f x) s).prod


/-- The pushforward functor. -/
@[simps!]
def pushforward {X Y : TopCat.{w}} (f : X ⟶ Y) : X.Presheaf C ⥤ Y.Presheaf C

(C : Type u)
[CategoryTheory.Category.{v, u} C]
{X Y : TopCat}
(f : X ⟶ Y)
(G : (TopologicalSpace.Opens ↑X)ᵒᵖ ⥤ C)

∀ (X_1 : (TopologicalSpace.Opens ↑Y)ᵒᵖ),
  ((TopCat.Presheaf.pushforward C f).obj G).obj X_1 =
    G.obj (Opposite.op ((TopologicalSpace.Opens.map f).obj (Opposite.unop X_1)))


theorem C_injective : Function.Injective (C : R → HahnSeries Γ R)

{Γ : Type u_1}
{R : Type u_3}
[OrderedCancelAddCommMonoid Γ]
[NonAssocSemiring R]


theorem inv_smul' (k : αˣ) (h : IsUnit A.det) : (k • A)⁻¹ = k⁻¹ • A⁻¹

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)
(k : αˣ)
(h : IsUnit A.det)

(k • A)⁻¹ = k⁻¹ • A⁻¹


theorem ofReal_eq_coe_nnreal {x : ℝ} (h : 0 ≤ x) :
    ENNReal.ofReal x = ofNNReal ⟨x, h⟩


theorem IsCycle.support_pow_of_pos_of_lt_orderOf (hf : IsCycle f) {n : ℕ} (npos : 0 < n)
    (hn : n < orderOf f) : (f ^ n).support = f.support

{α : Type u_2}
{f : Equiv.Perm α}
[DecidableEq α]
[Fintype α]
(hf : f.IsCycle)
{n : ℕ}
(npos : 0 < n)
(hn : n < orderOf f)


/-- The complement of a closed set as an open set. -/
@[simps]
def Closeds.compl (s : Closeds α) : Opens α

{α : Type u_2}
[TopologicalSpace α]
(s : TopologicalSpace.Closeds α)


/-- Pochhammer version of Chu-Vandermonde identity -/
theorem descPochhammer_smeval_add [Ring R] {r s : R} (k : ℕ) (h: Commute r s) :
    (descPochhammer ℤ k).smeval (r + s) = ∑ ij ∈ antidiagonal k,
    Nat.choose k ij.1 * ((descPochhammer ℤ ij.1).smeval r * (descPochhammer ℤ ij.2).smeval s)

{R : Type u_1}
[Ring R]
{r s : R}
(k : ℕ)
(h : Commute r s)

(descPochhammer ℤ k).smeval (r + s) =
  ∑ ij ∈ Finset.antidiagonal k, ↑(k.choose ij.1) * ((descPochhammer ℤ ij.1).smeval r * (descPochhammer ℤ ij.2).smeval s)


/-- `Fin.rev n` as an order-reversing isomorphism. -/
@[simps! apply toEquiv]
def revOrderIso : (Fin n)ᵒᵈ ≃o Fin n

∀ (a : (Fin n)ᵒᵈ), Fin.revOrderIso a = (OrderDual.ofDual a).rev


lemma isIso_homologyπ : IsIso (K.homologyπ j)


theorem tmul_coe_mul_one_tmul {j₁ : ι} (a₁ : A) (b₁ : ℬ j₁) (b₂ : B) :
    (a₁ ᵍ⊗ₜ[R] (b₁ : B) * (1 : A) ᵍ⊗ₜ[R] b₂ : 𝒜 ᵍ⊗[R] ℬ) = (a₁ : A) ᵍ⊗ₜ (b₁ * b₂ : B)

{R : Type u_1}
{ι : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
[CommRing R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
(𝒜 : ι → Submodule R A)
(ℬ : ι → Submodule R B)
[GradedAlgebra 𝒜]
[GradedAlgebra ℬ]
{j₁ : ι}
(a₁ : A)
(b₁ : ↥(ℬ j₁))
(b₂ : B)

a₁ ᵍ⊗ₜ[R] ↑b₁ * 1 ᵍ⊗ₜ[R] b₂ = a₁ ᵍ⊗ₜ[R] (↑b₁ * b₂)


theorem fmod_def (a b : Int) : a.fmod b = a - b * a.fdiv b


nonrec theorem uniformContinuous_fst : UniformContinuous (fst : tsze R M → R)

{R : Type u_3}
{M : Type u_4}
[UniformSpace R]
[UniformSpace M]


protected theorem IsCycle.orderOf (hf : IsCycle f) : orderOf f = f.support.card

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


theorem isImage_source_target : e.IsImage e.source e.target

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


/-- `op` induces morphisms of monoids on hom groups of a preadditive category -/
@[simps!]
def opHom (X Y : C) : (X ⟶ Y) →+ (Opposite.op Y ⟶ Opposite.op X)

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


@[simp] lemma map₂_top_left (f : α → β → γ) (b) : map₂ f ⊤ b = ⊤

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β → γ)
(b : WithTop β)


theorem continuousAt_add_coe_coe (a b : ℝ) :
    ContinuousAt (fun p : EReal × EReal => p.1 + p.2) (a, b)

ContinuousAt (fun p => p.1 + p.2) (↑a, ↑b)


theorem Mon.append_denote (ctx : Context) (m₁ m₂ : Mon) : (m₁ ++ m₂).denote ctx = m₁.denote ctx * m₂.denote ctx

(ctx : Nat.Linear.Context)
(m₁ m₂ : Nat.SOM.Mon)

Nat.SOM.Mon.denote ctx (m₁ ++ m₂) = Nat.SOM.Mon.denote ctx m₁ * Nat.SOM.Mon.denote ctx m₂


protected theorem injective (e : r ≃r s) : Injective e

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(e : r ≃r s)


theorem offDiag_eq_sep_prod : s.offDiag = { x ∈ s ×ˢ s | x.1 ≠ x.2 }

s.offDiag = {x | x ∈ s ×ˢ s ∧ x.1 ≠ x.2}


theorem exists_eval₂_eq_zero_of_injective {R : Type*} [Ring R] [IsAlgClosed k] (f : R →+* k)
    (hf : Function.Injective f) (p : R[X]) (hp : p.degree ≠ 0) : ∃ x, p.eval₂ f x = 0

{k : Type u}
[Field k]
{R : Type u_1}
[Ring R]
[IsAlgClosed k]
(f : R →+* k)
(hf : Function.Injective ⇑f)
(p : R[X])
(hp : p.degree ≠ 0)


@[simp] theorem sum_nil : sum ([] : IntList) = 0


theorem single_trans_of_eq_none (a : α) {b : β} {f : β ≃. δ} (h : f b = none) :
    (single a b).trans f = ⊥

{α : Type u}
{β : Type v}
{δ : Type x}
[DecidableEq α]
[DecidableEq β]
(a : α)
{b : β}
{f : β ≃. δ}
(h : f b = none)


@[deprecated mapsTo_range_iff (since := "2023-12-25")]
theorem maps_range_to (f : α → β) (g : γ → α) (s : Set β) :
    MapsTo f (range g) s ↔ MapsTo (f ∘ g) univ s

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

Set.MapsTo f (Set.range g) s ↔ Set.MapsTo (f ∘ g) Set.univ s


theorem sum_id_lt_of_lt (m n : ι →₀ ℕ) (h : m < n) : (m.sum fun _ => id) < n.sum fun _ => id

{ι : Type u_3}
(m n : ι →₀ ℕ)
(h : m < n)


theorem dual_insert [Preorder α] [IsTotal α (· ≤ ·)] [@DecidableRel α (· ≤ ·)] (x : α) :
    ∀ t : Ordnode α, dual (Ordnode.insert x t) = @Ordnode.insert αᵒᵈ _ _ x (dual t)

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

(Ordnode.insert x t).dual = Ordnode.insert x t.dual


@[simp]
theorem prod_smul_empty (w : NormalWord d) :
    (w.prod φ) • empty = w

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

HNNExtension.NormalWord.ReducedWord.prod φ w.toReducedWord • HNNExtension.NormalWord.empty = w


@[to_additive (attr := simp)]
protected lemma mul_inv_cancel_left (h : IsUnit a) : ∀ b, a * (a⁻¹ * b) = b

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


theorem associated_left_inverse (h : B₁.IsSymm) : associatedHom S B₁.toQuadraticMap = B₁

(S : Type u_1)
{R : Type u_3}
{M : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[CommSemiring S]
[Algebra S R]
[Invertible 2]
{B₁ : LinearMap.BilinMap R M R}
(h : LinearMap.IsSymm B₁)

(QuadraticMap.associatedHom S) B₁.toQuadraticMap = B₁


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

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

(Subgroup.map N.subtype ↑P).normalizer ⊔ N = ⊤


theorem not_countably_generated_cocompact : ¬IsCountablyGenerated (cocompact ℚ)


@[simp]
theorem tensor_mul (M N : Mon_ C) : (M ⊗ N).mul =
    tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul)

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

(M ⊗ N).mul = CategoryTheory.tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul)


theorem squarefree_iff_irreducible_sq_not_dvd_of_exists_irreducible {r : R}
    (hr : ∃ x : R, Irreducible x) : Squarefree r ↔ ∀ x : R, Irreducible x → ¬x * x ∣ r

{R : Type u_1}
[CommMonoidWithZero R]
[WfDvdMonoid R]
{r : R}
(hr : ∃ x, Irreducible x)

Squarefree r ↔ ∀ (x : R), Irreducible x → ¬x * x ∣ r


@[ext]
protected theorem ext {R S : Sieve X} (h : ∀ ⦃Y⦄ (f : Y ⟶ X), R f ↔ S f) : R = S

(h : ∀ ⦃Y : C⦄ (f : Y ⟶ X), R.arrows f ↔ S.arrows f)


protected theorem Tendsto.const_div {f : Filter α} {m : α → ℝ≥0∞} {a b : ℝ≥0∞}
    (hm : Tendsto m f (𝓝 b)) (hb : b ≠ ∞ ∨ a ≠ ∞) : Tendsto (fun b => a / m b) f (𝓝 (a / b))

{α : Type u_1}
{f : Filter α}
{m : α → ℝ≥0∞}
{a b : ℝ≥0∞}
(hm : Filter.Tendsto m f (𝓝 b))
(hb : b ≠ ⊤ ∨ a ≠ ⊤)

Filter.Tendsto (fun b => a / m b) f (𝓝 (a / b))


theorem isSelfAdjoint_def : IsSelfAdjoint A ↔ A† = A

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
{A : E →ₗ.[𝕜] E}


theorem le_of_dvd (hv : Integers v O) {x y : O} (h : x ∣ y) :
    v (algebraMap O R y) ≤ v (algebraMap O R x)

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

v ((algebraMap O R) y) ≤ v ((algebraMap O R) x)


@[simp]
theorem toPGame_birthday (o : Ordinal) : o.toPGame.birthday = o


/-- Combining `DFinsupp.lsum` with `LinearMap.toSpanSingleton` is the same as `Finsupp.total` -/
theorem lsum_comp_mapRange_toSpanSingleton [∀ m : R, Decidable (m ≠ 0)] (p : ι → Submodule R N)
    {v : ι → N} (hv : ∀ i : ι, v i ∈ p i) :
    (lsum ℕ (M := fun i ↦ ↥(p i)) fun i => (p i).subtype : _ →ₗ[R] _).comp
        ((mapRange.linearMap fun i => LinearMap.toSpanSingleton R (↥(p i)) ⟨v i, hv i⟩ :
              _ →ₗ[R] _).comp
          (finsuppLequivDFinsupp R : (ι →₀ R) ≃ₗ[R] _).toLinearMap) =
      Finsupp.total ι N R v

{ι : Type u_1}
{R : Type u_2}
{N : Type u_5}
[DecidableEq ι]
[Semiring R]
[AddCommMonoid N]
[Module R N]
[(m : R) → Decidable (m ≠ 0)]
(p : ι → Submodule R N)
{v : ι → N}
(hv : ∀ (i : ι), v i ∈ p i)

((DFinsupp.lsum ℕ) fun i => (p i).subtype) ∘ₗ
    (DFinsupp.mapRange.linearMap fun i => LinearMap.toSpanSingleton R ↥(p i) ⟨v i, ⋯⟩) ∘ₗ ↑(finsuppLequivDFinsupp R) =
  Finsupp.total ι N R v


theorem lift_unique (g : UniversalEnvelopingAlgebra R L →ₐ[R] A) : g ∘ ι R = f ↔ g = lift R f

⇑g ∘ ⇑(UniversalEnvelopingAlgebra.ι R) = ⇑f ↔ g = (UniversalEnvelopingAlgebra.lift R) f


protected nonrec theorem Continuous.nhds (h : Continuous f) : Continuous (𝓝 ∘ f)

{X : Type u_4}
{Y : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(h : Continuous f)


/-- If two ring homomorphisms from `k[G]` are equal on all `single a 1`
and `single 0 b`, then they are equal. -/
theorem ringHom_ext {R} [Semiring k] [AddMonoid G] [Semiring R] {f g : k[G] →+* R}
    (h₀ : ∀ b, f (single 0 b) = g (single 0 b)) (h_of : ∀ a, f (single a 1) = g (single a 1)) :
    f = g

(h₀ : ∀ (b : k), f (AddMonoidAlgebra.single 0 b) = g (AddMonoidAlgebra.single 0 b))

(h_of : ∀ (a : G), f (AddMonoidAlgebra.single a 1) = g (AddMonoidAlgebra.single a 1))


theorem encard_pair {x y : α} (hne : x ≠ y) : ({x, y} : Set α).encard = 2


@[simp, norm_cast]
theorem toENNReal_top : ((⊤ : ℕ∞) : ℝ≥0∞) = ⊤


@[to_additive (attr := simp)]
theorem fst_inv [Inv G] [Inv H] (p : G × H) : p⁻¹.1 = p.1⁻¹

{G : Type u_3}
{H : Type u_4}
[Neg G]
[Neg H]
(p : G × H)


/-- The sum of two `C^n` functions on a domain is `C^n`. -/
theorem ContDiffOn.add {s : Set E} {f g : E → F} (hf : ContDiffOn 𝕜 n f s)
    (hg : ContDiffOn 𝕜 n g s) : ContDiffOn 𝕜 n (fun x => f x + g x) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{s : Set E}
{f g : E → F}
(hf : ContDiffOn 𝕜 n f s)
(hg : ContDiffOn 𝕜 n g s)


@[to_additive (attr := simp)]
lemma mk_smul (g : G) (hg : g ∈ S) (a : α) : (⟨g, hg⟩ : S) • a = g • a

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
{S : AddSubgroup G}
(g : G)
(hg : g ∈ S)
(a : α)


theorem tsub_apply (f g : Π₀ i, α i) (i : ι) : (f - g) i = f i - g i

[(i : ι) → CanonicallyOrderedAddCommMonoid (α i)]


theorem isSt_of_tendsto {f : ℕ → ℝ} {r : ℝ} (hf : Tendsto f atTop (𝓝 r)) : IsSt (ofSeq f) r

(hf : Filter.Tendsto f Filter.atTop (𝓝 r))


@[to_additive]
theorem one_le_of_le_mul_left [ContravariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α}
    (h : b ≤ a * b) :
    1 ≤ a

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


theorem IsQuasiSeparated.of_quasiSeparatedSpace (s : Set α) [QuasiSeparatedSpace α] :
    IsQuasiSeparated s

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


@[simp]
theorem forget₂_coalgebra_map (X Y : BialgebraCat R) (f : X ⟶ Y) :
    (forget₂ (BialgebraCat R) (CoalgebraCat R)).map f = CoalgebraCat.ofHom f.toBialgHom

{R : Type u}
[CommRing R]
(X Y : BialgebraCat R)
(f : X ⟶ Y)

(CategoryTheory.forget₂ (BialgebraCat R) (CoalgebraCat R)).map f = CoalgebraCat.ofHom ↑f.toBialgHom


/-- A sheaf of modules is quasi-coherent if it is locally the cokernel of a
morphism between coproducts of copies of the sheaf of rings. -/
class IsQuasicoherent : Prop where
  nonempty_quasicoherentData : Nonempty M.QuasicoherentData

{J : CategoryTheory.GrothendieckTopology C}

[∀ (X : C), (J.over X).HasSheafCompose (CategoryTheory.forget₂ RingCat AddCommGrp)]

[∀ (X : C), CategoryTheory.HasWeakSheafify (J.over X) AddCommGrp]

[∀ (X : C), (J.over X).WEqualsLocallyBijective AddCommGrp]


theorem norm_smul (c : ℝ) (x : E K) :
    mixedEmbedding.norm (c • x) = |c| ^ finrank ℚ K * (mixedEmbedding.norm x)

(x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ))

NumberField.mixedEmbedding.norm (c • x) = |c| ^ FiniteDimensional.finrank ℚ K * NumberField.mixedEmbedding.norm x


theorem isClosedMap_iff_isClosedMap_of_iSup_eq_top :
    IsClosedMap f ↔ ∀ i, IsClosedMap ((U i).1.restrictPreimage f)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{ι : Type u_3}
{U : ι → TopologicalSpace.Opens β}
(hU : iSup U = ⊤)

IsClosedMap f ↔ ∀ (i : ι), IsClosedMap ((U i).carrier.restrictPreimage f)


theorem coeFn_toLp [NormedField 𝕜] [NormedSpace 𝕜 E] (f : C(α, E)) :
    toLp (E := E) p μ 𝕜 f =ᵐ[μ] f

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup E]
[TopologicalSpace α]
[BorelSpace α]
[SecondCountableTopologyEither α E]
[CompactSpace α]
[MeasureTheory.IsFiniteMeasure μ]
{𝕜 : Type u_5}
[Fact (1 ≤ p)]
[NormedField 𝕜]
[NormedSpace 𝕜 E]
(f : C(α, E))

↑↑((ContinuousMap.toLp p μ 𝕜) f) =ᵐ[μ] ⇑f


@[simp]
theorem verschiebung_coeff_zero (x : 𝕎 R) : (verschiebung x).coeff 0 = 0

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
(x : WittVector p R)


@[to_additive]
protected theorem Inseparable.smul {a b : M} {x y : X} (h₁ : Inseparable a b)
    (h₂ : Inseparable x y) : Inseparable (a • x) (b • y)

{M : Type u_1}
{X : Type u_2}
[TopologicalSpace M]
[TopologicalSpace X]
[SMul M X]
[ContinuousSMul M X]
{a b : M}
{x y : X}
(h₁ : Inseparable a b)
(h₂ : Inseparable x y)


theorem modEq_iff_dvd : a ≡ b [ZMOD n] ↔ n ∣ b - a


theorem closure_cycle_coprime_swap {n : ℕ} {σ : Perm α} (h0 : Nat.Coprime n (Fintype.card α))
    (h1 : IsCycle σ) (h2 : σ.support = Finset.univ) (x : α) :
    closure ({σ, swap x ((σ ^ n) x)} : Set (Perm α)) = ⊤

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{n : ℕ}
{σ : Equiv.Perm α}
(h0 : n.Coprime (Fintype.card α))
(h1 : σ.IsCycle)
(h2 : σ.support = Finset.univ)
(x : α)

Subgroup.closure {σ, Equiv.swap x ((σ ^ n) x)} = ⊤


theorem not_mem_of_not_mem_closure {s : Set K} {P : K} (hP : P ∉ closure s) : P ∉ s

{K : Type u}
[DivisionRing K]
{s : Set K}
{P : K}
(hP : P ∉ Subfield.closure s)


@[simp]
theorem append_right {α : Type*} (u : Fin m → α) (v : Fin n → α) (i : Fin n) :
    append u v (natAdd m i) = v i

{m n : ℕ}
{α : Type u_1}
(u : Fin m → α)
(v : Fin n → α)
(i : Fin n)


@[simp]
theorem zero_fst : (0 : WithLp p (α × β)).fst = 0

{p : ℝ≥0∞}
{α : Type u_2}
{β : Type u_3}
[AddCommGroup α]
[AddCommGroup β]


theorem zero_mem (h : (p : Set M).Nonempty) : (0 : M) ∈ p

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : SubMulAction R M)
(h : (↑p).Nonempty)


protected theorem compl_inf (s t : LowerSet α) : (s ⊓ t).compl = s.compl ⊓ t.compl

{α : Type u_1}
[LE α]
(s t : LowerSet α)


theorem isIntegral_stableUnderComposition : StableUnderComposition fun f => f.IsIntegral

RingHom.StableUnderComposition fun {R S} [CommRing R] [CommRing S] f => f.IsIntegral


/-- If two integers are congruent to a sufficiently large modulus, they are equal. -/
lemma eq_of_mod_eq_of_natAbs_sub_lt_natAbs {a b c : ℤ} (h1 : a % b = c)
    (h2 : natAbs (a - c) < natAbs b) : a = c

{a b c : ℤ}
(h1 : a % b = c)
(h2 : (a - c).natAbs < b.natAbs)


@[to_additive (attr := simp) zsmul_neg']
lemma inv_zpow' (a : α) (n : ℤ) : a⁻¹ ^ n = a ^ (-n)

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


/-- The square
```
  Y --inr--> X ⊞ Y
  |            |
  0           fst
  |            |
  v            v
  0 ---0-----> X
```
is a pushout square.
-/
theorem inr_fst (X Y : C) [HasBinaryBiproduct X Y] :
    IsPushout biprod.inr (0 : Y ⟶ 0) biprod.fst (0 : 0 ⟶ X)

CategoryTheory.IsPushout CategoryTheory.Limits.biprod.inr 0 CategoryTheory.Limits.biprod.fst 0


@[to_additive (attr := simp) negPart_pos] lemma one_lt_ltOnePart (ha : a < 1) : 1 < a⁻ᵐ

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


theorem setOf_subset {p : α → Prop} {s : Set α} : setOf p ⊆ s ↔ ∀ x, p x → x ∈ s


@[simp]
theorem inductionOn_nil {C : ∀ {n : ℕ}, Vector α n → Sort*}
    (nil : C nil) (cons : ∀ {n : ℕ} {x : α} {w : Vector α n}, C w → C (x ::ᵥ w)) :
    Vector.nil.inductionOn nil cons = nil

{C : {n : ℕ} → Mathlib.Vector α n → Sort u_2}

(cons : {n : ℕ} → {x : α} → {w : Mathlib.Vector α n} → C w → C (x ::ᵥ w))

(Mathlib.Vector.nil.inductionOn nil fun {n} {x} {w} => cons) = nil


theorem floor_lt (ha : 0 ≤ a) : ⌊a⌋₊ < n ↔ a < n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
{n : ℕ}
(ha : 0 ≤ a)


theorem Nonempty.forall_const {s : Finset α} (h : s.Nonempty) {p : Prop} : (∀ x ∈ s, p) ↔ p

{α : Type u_1}
{s : Finset α}
(h : s.Nonempty)
{p : Prop}


theorem monic_zero_iff_subsingleton : Monic (0 : R[X]) ↔ Subsingleton R


@[simp]
theorem enumOrd_zero : enumOrd S 0 = sInf S


theorem ball_disjoint (h : ε₁ + ε₂ ≤ edist x y) : Disjoint (ball x ε₁) (ball y ε₂)

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}
{ε₁ ε₂ : ℝ≥0∞}
(h : ε₁ + ε₂ ≤ edist x y)

Disjoint (EMetric.ball x ε₁) (EMetric.ball y ε₂)


/-- **Stewart's Theorem**. -/
theorem dist_sq_mul_dist_add_dist_sq_mul_dist (a b c p : P) (h : ∠ b p c = π) :
    dist a b ^ 2 * dist c p + dist a c ^ 2 * dist b p =
    dist b c * (dist a p ^ 2 + dist b p * dist c p)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(a b c p : P)
(h : EuclideanGeometry.angle b p c = π)


@[simp]
theorem coe_addEquiv_refl : (RingEquiv.refl R : R ≃+ R) = AddEquiv.refl R


theorem monotone_zpow {x : ℝ≥0∞} (hx : 1 ≤ x) : Monotone ((x ^ ·) : ℤ → ℝ≥0∞)


@[simp]
theorem get?_nil (n : ℕ) : (@nil α).get? n = none


@[simp]
theorem relabel_all (g : α → β ⊕ (Fin n)) {k} (φ : L.BoundedFormula α (k + 1)) :
    φ.all.relabel g = (φ.relabel g).all

{L : FirstOrder.Language}
{α : Type u'}
{β : Type v'}
{n : ℕ}
(g : α → β ⊕ Fin n)
{k : ℕ}
(φ : L.BoundedFormula α (k + 1))

FirstOrder.Language.BoundedFormula.relabel g φ.all = (FirstOrder.Language.BoundedFormula.relabel g φ).all


theorem restr_source_inter (s : Set X) : e.restr (e.source ∩ s) = e.restr s

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


theorem Ioc_succ_right (h : a < succ b) : Ioc a (succ b) = insert (succ b) (Ioc a b)

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a b : α}
(h : a < Order.succ b)

Set.Ioc a (Order.succ b) = insert (Order.succ b) (Set.Ioc a b)


/-- If a `n`-th cyclotomic extension of `ℚ` contains a primitive `l`-th root of unity, then
`l ∣ 2 * n`. -/
theorem dvd_of_isCyclotomicExtension [NumberField K] [IsCyclotomicExtension {n} ℚ K] {ζ : K}
    {l : ℕ} (hζ : IsPrimitiveRoot ζ l) (hl : l ≠ 0) : l ∣ 2 * n

(n : ℕ+)
{K : Type u}
[Field K]
[NumberField K]
[IsCyclotomicExtension {n} ℚ K]
{ζ : K}
{l : ℕ}
(hζ : IsPrimitiveRoot ζ l)
(hl : l ≠ 0)


@[simp]
theorem sumDualDistrib_inr : sumDualDistrib α β (toDual (inr b)) = inr (toDual b)

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

(OrderIso.sumDualDistrib α β) (OrderDual.toDual (Sum.inr b)) = Sum.inr (OrderDual.toDual b)


/-- The functor `ComposableArrows C (n + 1) ⥤ ComposableArrows C n` which forgets
the first arrow. -/
@[simps!]
def δ₀Functor : ComposableArrows C (n + 1) ⥤ ComposableArrows C n

(F : CategoryTheory.ComposableArrows C (n + 1))

∀ {X Y : Fin (n + 1)} (f : X ⟶ Y),
  (CategoryTheory.ComposableArrows.δ₀Functor.obj F).map f = F.map (CategoryTheory.homOfLE ⋯)


protected lemma Shatters.nonempty (h : 𝒜.Shatters s) : 𝒜.Nonempty

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{s : Finset α}
(h : 𝒜.Shatters s)


theorem map_ofNat' {A} [AddMonoidWithOne A] [FunLike F A B] [AddMonoidHomClass F A B]
    (f : F) (h : f 1 = 1) (n : ℕ) [n.AtLeastTwo] : f (OfNat.ofNat n) = OfNat.ofNat n

{B : Type u_4}
{F : Type u_5}
[AddMonoidWithOne B]
{A : Type u_6}
[AddMonoidWithOne A]
[FunLike F A B]
[AddMonoidHomClass F A B]
(f : F)
(h : f 1 = 1)
(n : ℕ)
[n.AtLeastTwo]


@[simp]
theorem isBigO_norm_left : (fun x => ‖f' x‖) =O[l] g ↔ f' =O[l] g

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


@[mono]
theorem starClosure_mono : Monotone (starClosure (R := R) (A := A))

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]


theorem map_coprod_prod (f : M →ₗ[R] M₃) (g : M₂ →ₗ[R] M₃) (p : Submodule R M)
    (q : Submodule R M₂) : map (coprod f g) (p.prod q) = map f p ⊔ map g q

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
(f : M →ₗ[R] M₃)
(g : M₂ →ₗ[R] M₃)
(p : Submodule R M)
(q : Submodule R M₂)

Submodule.map (f.coprod g) (p.prod q) = Submodule.map f p ⊔ Submodule.map g q


theorem contMDiffAt_extChartAt : ContMDiffAt I 𝓘(𝕜, E) n (extChartAt I x) x

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

ContMDiffAt I 𝓘(𝕜, E) n (↑(extChartAt I x)) x


@[simp]
theorem isMin_iff_eq_bot : IsMin a ↔ a = ⊥

{α : Type u}
[PartialOrder α]
[OrderBot α]
{a : α}


theorem dom_mono {r s : Rel α β} (h : r ≤ s) : dom r ⊆ dom s

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


@[simp]
theorem prod_empty : (empty : NormalWord d).prod φ = 1

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

HNNExtension.NormalWord.ReducedWord.prod φ HNNExtension.NormalWord.empty.toReducedWord = 1


lemma OrthogonalIdempotents.option [Fintype I] (x)
    (hx : IsIdempotentElem x) (hx₁ : x * ∑ i, e i = 0) (hx₂ : (∑ i, e i) * x = 0) :
    OrthogonalIdempotents (Option.elim · x e)

{R : Type u_1}
[Ring R]
{I : Type u_3}
{e : I → R}
(he : OrthogonalIdempotents e)
[Fintype I]
(x : R)
(hx : IsIdempotentElem x)
(hx₁ : x * ∑ i : I, e i = 0)
(hx₂ : (∑ i : I, e i) * x = 0)

OrthogonalIdempotents fun x_1 => x_1.elim x e


theorem Fintype.linearIndependent_iff [Fintype ι] :
    LinearIndependent R v ↔ ∀ g : ι → R, ∑ i, g i • v i = 0 → ∀ i, g i = 0

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Fintype ι]

LinearIndependent R v ↔ ∀ (g : ι → R), ∑ i : ι, g i • v i = 0 → ∀ (i : ι), g i = 0


/-- The binary product functor. -/
@[simps]
def prod.functor : C ⥤ C ⥤ C

(CategoryTheory.Limits.prod.functor.obj X).map g = CategoryTheory.Limits.prod.map (𝟙 X) g


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

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

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


/-- Assumes right covariance.
The lemma assuming left covariance is `Left.one_lt_mul_of_lt_of_le`. -/
@[to_additive Right.add_pos_of_pos_of_nonneg
"Assumes right covariance.
The lemma assuming left covariance is `Left.add_pos_of_pos_of_nonneg`."]
theorem Right.one_lt_mul_of_lt_of_le [CovariantClass α α (swap (· * ·)) (· < ·)] {a b : α}
    (ha : 1 < a) (hb : 1 ≤ b) :
    1 < a * b

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


theorem sInf_image' {s : Set β} {f : β → α} : sInf (f '' s) = ⨅ a : s, f a

{α : Type u_1}
{β : Type u_2}
[InfSet α]
{s : Set β}
{f : β → α}


theorem of_eq {f g : α → β → σ} (hg : Primrec₂ f) (H : ∀ a b, f a b = g a b) : Primrec₂ g

{α : Type u_1}
{β : Type u_2}
{σ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f g : α → β → σ}
(hg : Primrec₂ f)
(H : ∀ (a : α) (b : β), f a b = g a b)


theorem get?_rotate {l : List α} {n m : ℕ} (hml : m < l.length) :
    (l.rotate n).get? m = l.get? ((m + n) % l.length)

{α : Type u}
{l : List α}
{n m : ℕ}
(hml : m < l.length)


@[to_additive]
theorem op_iInf (S : ι → Subgroup G) : (iInf S).op = ⨅ i, (S i).op

{ι : Sort u_1}
{G : Type u_2}
[Group G]
(S : ι → Subgroup G)


@[simp, norm_cast] lemma coe_succAboveEmb (p : Fin (n + 1)) : p.succAboveEmb = p.succAbove


theorem eq_symm_apply {α β} (e : α ≃ β) {x y} : y = e.symm x ↔ e y = x

{α : Sort u_1}
{β : Sort u_2}
(e : α ≃ β)
{x : β}
{y : α}


/--
Two elements `a` and `b` commute if `a * b = b * a`.
-/
@[to_additive]
theorem commute_iff_eq [Mul S] (a b : S) : Commute a b ↔ a * b = b * a


theorem isRegular_top : IsRegular (⊤ : α)


theorem Prime.coprime_iff_not_dvd {p n : ℕ} (pp : Prime p) : Coprime p n ↔ ¬p ∣ n


/-- Polynomial functions in are dense in `C(s, ℝ)` when `s` is compact.

See `polynomialFunctions_closure_eq_top` for the special case `s = Set.Icc a b` which does not use
the full Stone-Weierstrass theorem. Of course, that version could be used to prove this one as
well. -/
theorem polynomialFunctions.topologicalClosure (s : Set ℝ)
    [CompactSpace s] : (polynomialFunctions s).topologicalClosure = ⊤


private lemma pairMap_ne_self (t : Finset σ × σ) : pairMap σ t ≠ t

(σ : Type u_1)
[DecidableEq σ]
(t : Finset σ × σ)

MvPolynomial.NewtonIdentities.pairMap σ t ≠ t


theorem sup_eq_prod_inf_factors (hI : I ≠ ⊥) (hJ : J ≠ ⊥) :
    I ⊔ J = (normalizedFactors I ∩ normalizedFactors J).prod

{T : Type u_4}
[CommRing T]
[IsDedekindDomain T]
{I J : Ideal T}
(hI : I ≠ ⊥)
(hJ : J ≠ ⊥)

I ⊔ J = (UniqueFactorizationMonoid.normalizedFactors I ∩ UniqueFactorizationMonoid.normalizedFactors J).prod


/-- The equivalence between the endomorphisms of the single object
when we promote a monoidal category to a single object bicategory,
and the original monoidal category.
-/
@[simps functor inverse_obj inverse_map unitIso counitIso]
noncomputable def endMonoidalStarFunctorEquivalence :
    EndMonoidal (MonoidalSingleObj.star C) ≌ C

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.MonoidalCategory C]

(CategoryTheory.MonoidalSingleObj.endMonoidalStarFunctorEquivalence C).functor =
  (CategoryTheory.MonoidalSingleObj.endMonoidalStarFunctor C).toFunctor


theorem local_compact_nhds [LocallyCompactSpace X] {x : X} {n : Set X} (h : n ∈ 𝓝 x) :
    ∃ s ∈ 𝓝 x, s ⊆ n ∧ IsCompact s

{X : Type u_1}
[TopologicalSpace X]
[LocallyCompactSpace X]
{x : X}
{n : Set X}
(h : n ∈ 𝓝 x)


@[reassoc]
theorem lift_comp_conePointsIsoOfNatIso_hom {F G : J ⥤ C} {r s : Cone F} {t : Cone G}
    (P : IsLimit s) (Q : IsLimit t) (w : F ≅ G) :
    P.lift r ≫ (conePointsIsoOfNatIso P Q w).hom = Q.map r w.hom

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F G : J ⥤ C}
{r s : CategoryTheory.Limits.Cone F}
{t : CategoryTheory.Limits.Cone G}
(P : CategoryTheory.Limits.IsLimit s)
(Q : CategoryTheory.Limits.IsLimit t)
(w : F ≅ G)

P.lift r ≫ (P.conePointsIsoOfNatIso Q w).hom = CategoryTheory.Limits.IsLimit.map r Q w.hom


theorem ker_eq_bot_of_inverse {τ₂₁ : R₂ →+* R} [RingHomInvPair τ₁₂ τ₂₁] {f : M →ₛₗ[τ₁₂] M₂}
    {g : M₂ →ₛₗ[τ₂₁] M} (h : (g.comp f : M →ₗ[R] M) = id) : ker f = ⊥

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_6}
{M₂ : Type u_8}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{τ₂₁ : R₂ →+* R}
[RingHomInvPair τ₁₂ τ₂₁]
{f : M →ₛₗ[τ₁₂] M₂}
{g : M₂ →ₛₗ[τ₂₁] M}
(h : g.comp f = LinearMap.id)


@[to_additive]
theorem inv_injective : Function.Injective (Inv.inv : G → G)


theorem nontrivial_of_einfsep_ne_top (hs : s.einfsep ≠ ∞) : s.Nontrivial

{α : Type u_1}
[EDist α]
{s : Set α}
(hs : s.einfsep ≠ ⊤)


/-- An object of a category `C` is connected if it is not initial
and has no non-trivial subobjects. Lenstra, 3.12. -/
class IsConnected {C : Type u₁} [Category.{u₂, u₁} C] (X : C) : Prop where
  /-- `X` is not an initial object. -/
  notInitial : IsInitial X → False
  /-- `X` has no non-trivial subobjects. -/
  noTrivialComponent (Y : C) (i : Y ⟶ X) [Mono i] : (IsInitial Y → False) → IsIso i

[self : CategoryTheory.PreGaloisCategory.IsConnected X]

(CategoryTheory.Limits.IsInitial Y → False) → CategoryTheory.IsIso i


theorem isOpen_setOf_nat_le_rank (n : ℕ) :
    IsOpen { f : E →L[𝕜] F | ↑n ≤ (f : E →ₗ[𝕜] F).rank }

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type w}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace 𝕜]
(n : ℕ)


@[to_additive]
theorem one_mk_mul_one_mk [Monoid M] [Mul N] (b₁ b₂ : N) :
    ((1 : M), b₁) * (1, b₂) = (1, b₁ * b₂)

{M : Type u_5}
{N : Type u_6}
[AddMonoid M]
[Add N]
(b₁ b₂ : N)


theorem continuous_of_linear_of_bound {f : E → G} (h_add : ∀ x y, f (x + y) = f x + f y)
    (h_smul : ∀ (c : 𝕜) (x), f (c • x) = c • f x) {C : ℝ} (h_bound : ∀ x, ‖f x‖ ≤ C * ‖x‖) :
    Continuous f

(h_add : ∀ (x y : E), f (x + y) = f x + f y)

(h_smul : ∀ (c : 𝕜) (x : E), f (c • x) = c • f x)


theorem size_zip (as : Array α) (bs : Array β) :
    (as.zip bs).size = min as.size bs.size

{α : Type u_1}
{β : Type u_2}
(as : Array α)
(bs : Array β)


theorem eLpNorm_sub_le_of_dist_bdd (μ : Measure α)
    {p : ℝ≥0∞} (hp' : p ≠ ∞) {s : Set α} (hs : MeasurableSet[m] s)
    {f g : α → β} {c : ℝ} (hc : 0 ≤ c) (hf : ∀ x ∈ s, dist (f x) (g x) ≤ c) :
    eLpNorm (s.indicator (f - g)) p μ ≤ ENNReal.ofReal c * μ s ^ (1 / p.toReal)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
[NormedAddCommGroup β]
(μ : MeasureTheory.Measure α)
{p : ℝ≥0∞}
(hp' : p ≠ ⊤)
{s : Set α}
(hs : MeasurableSet s)
{f g : α → β}
{c : ℝ}
(hc : 0 ≤ c)
(hf : ∀ x ∈ s, dist (f x) (g x) ≤ c)

MeasureTheory.eLpNorm (s.indicator (f - g)) p μ ≤ ENNReal.ofReal c * μ s ^ (1 / p.toReal)


theorem linearMapAt_apply (e : Pretrivialization F (π F E)) [e.IsLinear R] {b : B} (y : E b) :
    e.linearMapAt R b y = if b ∈ e.baseSet then (e ⟨b, y⟩).2 else 0

(e : Pretrivialization F Bundle.TotalSpace.proj)

(Pretrivialization.linearMapAt R e b) y = if b ∈ e.baseSet then (↑e { proj := b, snd := y }).2 else 0


theorem integral_withDensity {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    {f : β → E} [IsSFiniteKernel κ] {a : α} {g : α → β → ℝ≥0}
    (hg : Measurable (Function.uncurry g)) :
    ∫ b, f b ∂withDensity κ (fun a b => g a b) a = ∫ b, g a b • f b ∂κ a

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

∫ (b : β), f b ∂(κ.withDensity fun a b => ↑(g a b)) a = ∫ (b : β), g a b • f b ∂κ a


theorem isOpen_extend_preimage' {s : Set E} (hs : IsOpen s) :
    IsOpen ((f.extend I).source ∩ f.extend I ⁻¹' s)

{𝕜 : 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)
{s : Set E}
(hs : IsOpen s)

IsOpen ((f.extend I).source ∩ ↑(f.extend I) ⁻¹' s)


/-- Given `F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v`, this is the presheaf that is given by
    `YonedaCollection F X` on objects. -/
@[simps]
def yonedaCollectionPresheaf (A : Cᵒᵖ ⥤ Type v) (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) :
    Cᵒᵖ ⥤ Type v

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

(F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v))

(CategoryTheory.OverPresheafAux.yonedaCollectionPresheaf A F).obj X =
  CategoryTheory.OverPresheafAux.YonedaCollection F (Opposite.unop X)


/-- Let `G` be a Type with multiplication. `TwoUniqueProds G` asserts that any two non-empty
finite subsets of `G`, at least one of which is not a singleton, possesses at least two pairs
of elements satisfying the `UniqueMul` property. -/
class TwoUniqueProds (G) [Mul G] : Prop where
/-- For `A B` two finite sets whose product has cardinality at least 2,
  we can find at least two unique pairs. -/
  uniqueMul_of_one_lt_card : ∀ {A B : Finset G}, 1 < A.card * B.card →
    ∃ p1 ∈ A ×ˢ B, ∃ p2 ∈ A ×ˢ B, p1 ≠ p2 ∧ UniqueMul A B p1.1 p1.2 ∧ UniqueMul A B p2.1 p2.2

{G : Type u_1}
[Mul G]
[self : TwoUniqueProds G]
{A B : Finset G}


theorem truncateFun_natCast (m : ℕ) : truncateFun n (m : 𝕎 R) = m

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


theorem le_cons [∀ i, Preorder (α i)] {x : α 0} {q : ∀ i, α i} {p : ∀ i : Fin n, α i.succ} :
    q ≤ cons x p ↔ q 0 ≤ x ∧ tail q ≤ p

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

q ≤ Fin.cons x p ↔ q 0 ≤ x ∧ Fin.tail q ≤ p


theorem Continuous.uniformContinuous_of_tendsto_cocompact {f : α → β} {x : β}
    (h_cont : Continuous f) (hx : Tendsto f (cocompact α) (𝓝 x)) : UniformContinuous f

(hx : Filter.Tendsto f (Filter.cocompact α) (𝓝 x))


@[simp]
theorem compl_map (f : α ≃o β) (s : UpperSet α) : (map f s).compl = LowerSet.map f s.compl

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

((UpperSet.map f) s).compl = (LowerSet.map f) s.compl


@[to_additive]
theorem sum_restrict_of_ac (h : IsFundamentalDomain G s μ) (hν : ν ≪ μ) :
    (sum fun g : G => ν.restrict (g • s)) = ν

[MeasureTheory.SMulInvariantMeasure G α μ]

(h : MeasureTheory.IsFundamentalDomain G s μ)

(hν : ν ≪ μ)

(MeasureTheory.Measure.sum fun g => ν.restrict (g • s)) = ν


theorem expand_eq_C {p : ℕ} (hp : 0 < p) {f : R[X]} {r : R} : expand R p f = C r ↔ f = C r

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

(Polynomial.expand R p) f = Polynomial.C r ↔ f = Polynomial.C r


@[to_additive] lemma mabs_ne_one : |a|ₘ ≠ 1 ↔ a ≠ 1

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

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


@[to_additive (attr := simp)]
theorem alternatingProd_singleton (a : α) : alternatingProd [a] = a

{α : Type u_2}
[One α]
[Mul α]
[Inv α]
(a : α)


lemma equation_smul (P : Fin 3 → R) {u : R} (hu : IsUnit u) : W'.Equation (u • P) ↔ W'.Equation P

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P : Fin 3 → R)
{u : R}
(hu : IsUnit u)


/-- An `AddGroupFilterBasis` on an additive group is a `FilterBasis` satisfying some additional
  axioms. Example : if `G` is a topological group then the neighbourhoods of the identity are an
  `AddGroupFilterBasis`. Conversely given an `AddGroupFilterBasis` one can define a topology
  compatible with the group structure on `G`. -/
class AddGroupFilterBasis (A : Type u) [AddGroup A] extends FilterBasis A where
  zero' : ∀ {U}, U ∈ sets → (0 : A) ∈ U
  add' : ∀ {U}, U ∈ sets → ∃ V ∈ sets, V + V ⊆ U
  neg' : ∀ {U}, U ∈ sets → ∃ V ∈ sets, V ⊆ (fun x ↦ -x) ⁻¹' U
  conj' : ∀ x₀, ∀ {U}, U ∈ sets → ∃ V ∈ sets, V ⊆ (fun x ↦ x₀ + x + -x₀) ⁻¹' U

{A : Type u}
[AddGroup A]
[self : AddGroupFilterBasis A]
{U : Set A}

U ∈ AddGroupFilterBasis.toFilterBasis.sets → ∃ V ∈ AddGroupFilterBasis.toFilterBasis.sets, V ⊆ (fun x => -x) ⁻¹' U


theorem sup_support_pow_le (degb0 : degb 0 ≤ 0) (degbm : ∀ a b, degb (a + b) ≤ degb a + degb b)
    (n : ℕ) (f : R[A]) : (f ^ n).support.sup degb ≤ n • f.support.sup degb

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

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

(degbm : ∀ (a b : A), degb (a + b) ≤ degb a + degb b)


theorem sublists'Aux_eq_map (a : α) (r₁ : List (List α)) : ∀ (r₂ : List (List α)),
    sublists'Aux a r₁ r₂ = r₂ ++ map (cons a) r₁

{α : Type u}
(a : α)
(r₁ r₂ : List (List α))

List.sublists'Aux a r₁ r₂ = r₂ ++ List.map (List.cons a) r₁


@[simp]
theorem card_eq_nat {o} {n : ℕ} : card o = n ↔ o = n


@[simp]
theorem closure_le_eq [TopologicalSpace β] {f g : β → α} (hf : Continuous f) (hg : Continuous g) :
    closure { b | f b ≤ g b } = { b | f b ≤ g b }

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder α]
[t : OrderClosedTopology α]
[TopologicalSpace β]
{f g : β → α}
(hf : Continuous f)
(hg : Continuous g)

closure {b | f b ≤ g b} = {b | f b ≤ g b}


protected theorem mul_lt_mul_of_le_of_lt (hac : a ≤ c) (hbd : b < d) (hc : 0 < c) :
    a * b < c * d

{a c b d : Nat}
(hac : a ≤ c)
(hbd : b < d)
(hc : 0 < c)


@[simp]
theorem mk_apply : (mk s x : ∀ i, β i) i = if H : i ∈ s then x ⟨i, H⟩ else 0

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
{s : Finset ι}
{x : (i : ↑↑s) → β ↑i}
{i : ι}

(DFinsupp.mk s x) i = if H : i ∈ s then x ⟨i, H⟩ else 0


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

(hs : MeasureTheory.NullMeasurableSet s μ)

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

MeasureTheory.NullMeasurableSet (Subtype.val '' t) μ


protected theorem weaken (hf : LipschitzWith K f) {K' : ℝ≥0} (h : K ≤ K') : LipschitzWith K' f

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


@[simp]
theorem coe_top : ((⊤ : NonUnitalSubring R) : Set R) = Set.univ


protected theorem min_le_right (a b : Int) : min a b ≤ b


theorem tendsto_atBot_of_add_bdd_below_left' (C) (hC : ∀ᶠ x in l, C ≤ f x)
    (h : Tendsto (fun x => f x + g x) l atBot) : Tendsto g l atBot

(h : Filter.Tendsto (fun x => f x + g x) l Filter.atBot)


theorem derivWithin_const (hxs : UniqueDiffWithinAt 𝕜 s x) : derivWithin (fun _ => c) s x = 0

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(x : 𝕜)
(s : Set 𝕜)
(c : F)
(hxs : UniqueDiffWithinAt 𝕜 s x)


theorem comapₗ_eq_comap {β} [MeasurableSpace α] {_mβ : MeasurableSpace β} (f : α → β)
    (hfi : Injective f) (hf : ∀ s, MeasurableSet s → MeasurableSet (f '' s)) (μ : Measure β)
    (hs : MeasurableSet s) : comapₗ f μ s = comap f μ s

(hf : ∀ (s : Set α), MeasurableSet s → MeasurableSet (f '' s))

((MeasureTheory.Measure.comapₗ f) μ) s = (MeasureTheory.Measure.comap f μ) s


/--
If the unit and counit of a given adjunction are (pointwise) isomorphisms, then we can upgrade the
adjunction to an equivalence.
-/
@[simps!]
noncomputable def toEquivalence (adj : F ⊣ G) [∀ X, IsIso (adj.unit.app X)]
    [∀ Y, IsIso (adj.counit.app Y)] : C ≌ D

[∀ (X : C), CategoryTheory.IsIso (adj.unit.app X)]

[∀ (Y : D), CategoryTheory.IsIso (adj.counit.app Y)]


theorem range_eq_map [RingHomSurjective τ₁₂] (f : F) : range f = map f ⊤

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_11}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
[RingHomSurjective τ₁₂]
(f : F)


@[simp] lemma toHomeomorph_refl :
  (Equiv.refl X).toHomeomorph (fun _s ↦ Iff.rfl) = Homeomorph.refl _

(Equiv.refl X).toHomeomorph ⋯ = Homeomorph.refl X


/-- The product measure of the product of two sets is the product of their measures. Note that we
do not need the sets to be measurable. -/
@[simp]
theorem prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
(s : Set α)
(t : Set β)


@[to_additive prod_eq_top_iff]
theorem prod_eq_top_iff [Nonempty M] [Nonempty N] {s : Subsemigroup M} {t : Subsemigroup N} :
    s.prod t = ⊤ ↔ s = ⊤ ∧ t = ⊤

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
[Nonempty M]
[Nonempty N]
{s : Subsemigroup M}
{t : Subsemigroup N}


@[simp]
theorem toAddMonoidHom_eq_coe (f : α →+* β) : f.toAddMonoidHom = f

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), f.toAddMonoidHom = ↑f


protected theorem add_le_add_left {n m : Nat} (h : n ≤ m) (k : Nat) : k + n ≤ k + m


theorem restrict_not_measurable {i : Set α} (hi : ¬MeasurableSet i) : v.restrict i = 0

{α : Type u_1}
[MeasurableSpace α]
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
(v : MeasureTheory.VectorMeasure α M)
{i : Set α}
(hi : ¬MeasurableSet i)


/-- If a function is polynomial on a set `s`, so is its Fréchet derivative. -/
theorem CPolynomialOn.fderiv (h : CPolynomialOn 𝕜 f s) :
    CPolynomialOn 𝕜 (fderiv 𝕜 f) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(h : CPolynomialOn 𝕜 f s)


theorem continuous_curry : Continuous <| monotoneCurry α β γ

[(x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)]

OmegaCompletePartialOrder.Continuous (Pi.monotoneCurry α β γ)


theorem primitive_element_inf_aux_exists_c (f g : F[X]) :
    ∃ c : F, ∀ α' ∈ (f.map ϕ).roots, ∀ β' ∈ (g.map ϕ).roots, -(α' - α) / (β' - β) ≠ ϕ c

{F : Type u_1}
[Field F]
[Infinite F]
{E : Type u_2}
[Field E]
(ϕ : F →+* E)
(α β : E)
(f g : F[X])

∃ c, ∀ α' ∈ (Polynomial.map ϕ f).roots, ∀ β' ∈ (Polynomial.map ϕ g).roots, -(α' - α) / (β' - β) ≠ ϕ c


/-- Obvious triangles `X ⟶ 0 ⟶ X⟦1⟧ ⟶ X⟦1⟧` are distinguished -/
lemma contractible_distinguished₂ (X : C) :
    Triangle.mk (0 : X ⟶ 0) 0 (𝟙 (X⟦1⟧)) ∈ distTriang C

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

CategoryTheory.Pretriangulated.Triangle.mk 0 0 (𝟙 ((CategoryTheory.shiftFunctor C 1).obj X)) ∈
  CategoryTheory.Pretriangulated.distinguishedTriangles


theorem cramer_reindex (e : m ≃ n) (A : Matrix m m α) (b : n → α) :
    cramer (reindex e e A) b = cramer A (b ∘ e) ∘ e.symm

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

((Matrix.reindex e e) A).cramer b = A.cramer (b ∘ ⇑e) ∘ ⇑e.symm


/-- A presieve is *extensive* if it is finite and its arrows induce an isomorphism from the
coproduct to the target. -/
class Presieve.Extensive {X : C} (R : Presieve X) : Prop where
  /-- `R` consists of a finite collection of arrows that together induce an isomorphism from the
  coproduct of their sources. -/
  arrows_nonempty_isColimit : ∃ (α : Type) (_ : Finite α) (Z : α → C) (π : (a : α) → (Z a ⟶ X)),
    R = Presieve.ofArrows Z π ∧ Nonempty (IsColimit (Cofan.mk X π))

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{X : C}
{R : CategoryTheory.Presieve X}
[self : R.Extensive]

∃ α,
  ∃ (_ : Finite α),
    ∃ Z π,
      R = CategoryTheory.Presieve.ofArrows Z π ∧
        Nonempty (CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.Cofan.mk X π))


/-- Any prefunctor into a category lifts to a functor from the path category. -/
@[simps]
def lift {V : Type u} [Quiver.{v + 1} V] {C : Type*} [Category C] (F : Prefunctor V C) :
    Paths V ⥤ C

{V : Type u}
[Quiver V]
{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
(F : V ⥤q C)

∀ {X Y : CategoryTheory.Paths V} (f : X ⟶ Y),
  (CategoryTheory.Quiv.lift F).map f = CategoryTheory.composePath (F.mapPath f)


@[to_additive]
theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a ∈ s) (hb : b ∈ s)
    (hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : ∏ x ∈ s, f x = f a * f b

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
{s : Finset α}
{f : α → β}
(a b : α)
(ha : a ∈ s)
(hb : b ∈ s)
(hn : a ≠ b)
(h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 0)


theorem mk_equiv_eq_zero_iff_lift_ne : #(α ≃ β') = 0 ↔ lift.{v} #α ≠ lift.{u} #β'

#(α ≃ β') = 0 ↔ Cardinal.lift.{v, u} #α ≠ Cardinal.lift.{u, v} #β'


theorem mem_permutationsAux2' {t : α} {ts : List α} {ys : List α} {l : List α} :
    l ∈ (permutationsAux2 t ts [] ys id).2 ↔
      ∃ l₁ l₂, l₂ ≠ [] ∧ ys = l₁ ++ l₂ ∧ l = l₁ ++ t :: l₂ ++ ts

{α : Type u_1}
{t : α}
{ts ys l : List α}

l ∈ (List.permutationsAux2 t ts [] ys id).2 ↔ ∃ l₁ l₂, l₂ ≠ [] ∧ ys = l₁ ++ l₂ ∧ l = l₁ ++ t :: l₂ ++ ts


/-- If `S` is a nonempty subset of a finite group `G`, then `S ^ |G|` is a subgroup -/
@[to_additive (attr := simps!) smulCardAddSubgroup
  "If `S` is a nonempty subset of a finite add group `G`, then `|G| • S` is a subgroup"]
def powCardSubgroup {G : Type*} [Group G] [Fintype G] (S : Set G) (hS : S.Nonempty) : Subgroup G

{G : Type u_6}
[AddGroup G]
[Fintype G]
(S : Set G)
(hS : S.Nonempty)

↑(smulCardAddSubgroup S hS) = Fintype.card G • S


theorem StoneCech.projective [DiscreteTopology X] : CompactT2.Projective (StoneCech X)

{X : Type u}
[TopologicalSpace X]
[DiscreteTopology X]


@[to_additive (attr := simp)]
theorem toList_ofList (l : List α) : toList (ofList l) = l

FreeMonoid.toList (FreeMonoid.ofList l) = l


protected theorem neg_le_sub_left_of_le_add {a b c : Int} (h : c ≤ a + b) : -a ≤ b - c


theorem exists_upperCrossingTime_eq (f : ℕ → Ω → ℝ) (N : ℕ) (ω : Ω) (hab : a < b) :
    ∃ n, upperCrossingTime a b f N n ω = N

{Ω : Type u_1}
{a b : ℝ}
(f : ℕ → Ω → ℝ)
(N : ℕ)
(ω : Ω)
(hab : a < b)

∃ n, MeasureTheory.upperCrossingTime a b f N n ω = N


theorem MeasurableSet.induction_on_open [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α]
    {C : Set α → Prop} (h_open : ∀ U, IsOpen U → C U)
    (h_compl : ∀ t, MeasurableSet t → C t → C tᶜ)
    (h_union :
      ∀ f : ℕ → Set α,
        Pairwise (Disjoint on f) → (∀ i, MeasurableSet (f i)) → (∀ i, C (f i)) → C (⋃ i, f i)) :
    ∀ ⦃t⦄, MeasurableSet t → C t

(h_open : ∀ (U : Set α), IsOpen U → C U)

(h_compl : ∀ (t : Set α), MeasurableSet t → C t → C tᶜ)

(h_union :
  ∀ (f : ℕ → Set α), Pairwise (Disjoint on f) → (∀ (i : ℕ), MeasurableSet (f i)) → (∀ (i : ℕ), C (f i)) → C (⋃ i, f i))


@[to_additive (attr := simp)]
theorem inv_bot : (⊥ : Submonoid G)⁻¹ = ⊥


@[simp]
theorem boundary_last : c.boundary (Fin.last c.length) = Fin.last n


/-- A typeclass mixin saying that two additive actions on the same space commute. -/
class VAddCommClass (M N α : Type*) [VAdd M α] [VAdd N α] : Prop where
  /-- `+ᵥ` is left commutative -/
  vadd_comm : ∀ (m : M) (n : N) (a : α), m +ᵥ (n +ᵥ a) = n +ᵥ (m +ᵥ a)

{M : Type u_11}
{N : Type u_12}
{α : Type u_13}
[VAdd M α]
[VAdd N α]
[self : VAddCommClass M N α]
(m : M)
(n : N)
(a : α)


theorem uniqueDiffOn_Ico (a b : ℝ) : UniqueDiffOn ℝ (Ico a b)


lemma supIrredLowerSet_surjective : Surjective (supIrredLowerSet (α := α))

{α : Type u_1}
[PartialOrder α]
[Finite α]


theorem primeFactorsList_chain_2 (n) : List.Chain (· ≤ ·) 2 (primeFactorsList n)

List.Chain (fun x x_1 => x ≤ x_1) 2 n.primeFactorsList


theorem indexOf_get [DecidableEq α] {a : α} {l : List α} (h) : get l ⟨indexOf a l, h⟩ = a

{α : Type u}
[DecidableEq α]
{a : α}
{l : List α}
(h : List.indexOf a l < l.length)


theorem nhdsWithin_eq_map_subtype_coe {s : Set α} {a : α} (h : a ∈ s) :
    𝓝[s] a = map ((↑) : s → α) (𝓝 ⟨a, h⟩)

{α : Type u_1}
[TopologicalSpace α]
{s : Set α}
{a : α}
(h : a ∈ s)

𝓝[s] a = Filter.map Subtype.val (𝓝 ⟨a, h⟩)


theorem ModelsBoundedFormula.realize_sentence {φ : L.Sentence} (h : T ⊨ᵇ φ) (M : Type*)
    [L.Structure M] [M ⊨ T] [Nonempty M] : M ⊨ φ

{L : FirstOrder.Language}
{T : L.Theory}
{φ : L.Sentence}
(h : T ⊨ᵇ φ)
(M : Type u_1)
[L.Structure M]
[M ⊨ T]
[Nonempty M]


lemma Measure.MutuallySingular.withDensity {ν : Measure α} {f : α → ℝ≥0∞} (h : μ ⟂ₘ ν) :
    μ.withDensity f ⟂ₘ ν

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(h : μ.MutuallySingular ν)


theorem isPiSystem_Iic : IsPiSystem (range Iic : Set (Set α))


@[simp]
theorem fst_comp_quotientInfEquivQuotientProd (I J : Ideal R) (coprime : IsCoprime I J) :
    (RingHom.fst _ _).comp
        (quotientInfEquivQuotientProd I J coprime : R ⧸ I ⊓ J →+* (R ⧸ I) × R ⧸ J) =
      Ideal.Quotient.factor (I ⊓ J) I inf_le_left

{R : Type u}
[CommRing R]
(I J : Ideal R)
(coprime : IsCoprime I J)

(RingHom.fst (R ⧸ I) (R ⧸ J)).comp ↑(I.quotientInfEquivQuotientProd J coprime) = Ideal.Quotient.factor (I ⊓ J) I ⋯


theorem unit_mul_pow_congr_unit {ϖ : R} (hirr : Irreducible ϖ) (u v : Rˣ) (m n : ℕ)
    (h : ↑u * ϖ ^ m = v * ϖ ^ n) : u = v

{R : Type u_1}
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]
{ϖ : R}
(hirr : Irreducible ϖ)
(u v : Rˣ)
(m n : ℕ)
(h : ↑u * ϖ ^ m = ↑v * ϖ ^ n)


@[nontriviality]
theorem algebraicIndependent_of_subsingleton [Subsingleton R] : AlgebraicIndependent R x

{ι : Type u_1}
{R : Type u_3}
{A : Type u_5}
{x : ι → A}
[CommRing R]
[CommRing A]
[Algebra R A]
[Subsingleton R]


@[simp]
theorem monomial_zero_left (a : R) : monomial 0 a = C a

(Polynomial.monomial 0) a = Polynomial.C a


theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X]

{R : Type u_1}
[CommRing R]
(hR : Ideal.IsJacobson R)


protected theorem derivWithin.star (hxs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin (fun y => star (f y)) s x = star (derivWithin f s x)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
[StarRing 𝕜]
[TrivialStar 𝕜]
[StarAddMonoid F]
[ContinuousStar F]
[StarModule 𝕜 F]
{s : Set 𝕜}
{x : 𝕜}
(hxs : UniqueDiffWithinAt 𝕜 s x)


theorem snd {α β} [Primcodable α] [Primcodable β] : Primrec (@Prod.snd α β)

{α : Type u_3}
{β : Type u_4}
[Primcodable α]
[Primcodable β]


theorem IsTotal.swap (r) [IsTotal α r] : IsTotal α (swap r)

{α : Type u}
(r : α → α → Prop)
[IsTotal α r]


/-- The `atBot` filter for an open interval `Iio a` comes from the `atBot` filter in the ambient
order. -/
theorem atBot_Iio_eq [SemilatticeInf α] (a : α) : atBot = comap ((↑) : Iio a → α) atBot

{α : Type u_3}
[SemilatticeInf α]
(a : α)

Filter.atBot = Filter.comap Subtype.val Filter.atBot


/-- A choice of orthonormal basis of eigenvectors for self-adjoint operator `T` on a
finite-dimensional inner product space `E`.

TODO Postcompose with a permutation so that these eigenvectors are listed in increasing order of
eigenvalue. -/
noncomputable irreducible_def eigenvectorBasis : OrthonormalBasis (Fin n) 𝕜 E

(hn : FiniteDimensional.finrank 𝕜 E = n)

hT.eigenvectorBasis hn = DirectSum.IsInternal.subordinateOrthonormalBasis hn ⋯ ⋯


@[to_additive (attr := simp)]
theorem subtype_comp_inclusion {H K : S} (hH : H ≤ K) :
    (SubgroupClass.subtype K).comp (inclusion hH) = SubgroupClass.subtype H

{G : Type u_1}
[AddGroup G]
{S : Type u_6}
[SetLike S G]
[AddSubgroupClass S G]
{H K : S}
(hH : H ≤ K)

(↑K).comp (AddSubgroupClass.inclusion hH) = ↑H


@[to_additive (attr := simp)]
theorem preimage_smul_sphere (c : G) (x : X) (r : ℝ) :
    (c • ·) ⁻¹' sphere x r = sphere (c⁻¹ • x) r

{G : Type v}
{X : Type w}
[PseudoMetricSpace X]
[AddGroup G]
[AddAction G X]
[IsometricVAdd G X]
(c : G)
(x : X)
(r : ℝ)

(fun x => c +ᵥ x) ⁻¹' Metric.sphere x r = Metric.sphere (-c +ᵥ x) r


protected lemma eq_div_of_mul_eq_left (hc : c ≠ 0) (h : a * c = b) : a = b / c

{a b c : ℕ}
(hc : c ≠ 0)
(h : a * c = b)


@[ext]
lemma to_single_hom_ext {K : HomologicalComplex V c} {j : ι} {A : V}
    {f g : K ⟶ (single V c j).obj A} (hfg : f.f j = g.f j) : f = g

{f g : K ⟶ (HomologicalComplex.single V c j).obj A}


theorem strictAnti_nat_of_succ_lt {f : ℕ → α} (hf : ∀ n, f (n + 1) < f n) : StrictAnti f

{α : Type u}
[Preorder α]
{f : ℕ → α}
(hf : ∀ (n : ℕ), f (n + 1) < f n)


/-- Introduction rule to prove that `b` is the supremum of `f`: it suffices to check that `b`
is larger than `f i` for all `i`, and that this is not the case of any `w<b`.
See `iSup_eq_of_forall_le_of_forall_lt_exists_gt` for a version in complete lattices. -/
theorem ciSup_eq_of_forall_le_of_forall_lt_exists_gt [Nonempty ι] {f : ι → α} (h₁ : ∀ i, f i ≤ b)
    (h₂ : ∀ w, w < b → ∃ i, w < f i) : ⨆ i : ι, f i = b

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
{b : α}
[Nonempty ι]
{f : ι → α}
(h₁ : ∀ (i : ι), f i ≤ b)
(h₂ : ∀ w < b, ∃ i, w < f i)


theorem lt_or_fuzzy_of_lf {x y : PGame} : x ⧏ y → x < y ∨ x ‖ y


theorem le_inf_support_multiset_prod (degt0 : 0 ≤ degt 0)
    (degtm : ∀ a b, degt a + degt b ≤ degt (a + b)) (m : Multiset R[A]) :
    (m.map fun f : R[A] => f.support.inf degt).sum ≤ m.prod.support.inf degt

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

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

(degtm : ∀ (a b : A), degt a + degt b ≤ degt (a + b))

(Multiset.map (fun f => f.support.inf degt) m).sum ≤ m.prod.support.inf degt


/-- The equivalence relation made from the equivalence classes of an equivalence
    relation r equals r. -/
theorem mkClasses_classes (r : Setoid α) : mkClasses r.classes classes_eqv_classes = r


theorem isCartanSubalgebra_iff_isUcsLimit : H.IsCartanSubalgebra ↔ H.toLieSubmodule.IsUcsLimit

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


protected theorem add_sub_add_left (k n m : Nat) : (k + n) - (k + m) = n - m


@[to_additive]
theorem HasProd.update (hf : HasProd f a₁) (b : β) [DecidableEq β] (a : α) :
    HasProd (update f b a) (a / f b * a₁)

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
{f : β → α}
{a₁ : α}
(hf : HasProd f a₁)
(b : β)
[DecidableEq β]
(a : α)

HasProd (Function.update f b a) (a / f b * a₁)


private irreducible_def npow (n : ℕ) : RingQuot r → RingQuot r

{R : Type u_1}
[Semiring R]
(r : R → R → Prop)
(n : ℕ)

∀ (x : RingQuot r),
  RingQuot.npow r n x =
    match x with
    | { toQuot := a } => { toQuot := Quot.lift (fun a => Quot.mk (RingQuot.Rel r) (a ^ n)) ⋯ a }


/-- A coproduct over an index type with exactly one term is just the object over that term. -/
@[simps!]
def coproductUniqueIso : ∐ f ≅ f default

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

(CategoryTheory.Limits.coproductUniqueIso f).inv =
  CategoryTheory.Limits.colimit.ι (CategoryTheory.Discrete.functor f) default


@[simp]
theorem comp_apply (g : N ≃[L] P) (f : M ≃[L] N) (x : M) : g.comp f x = g (f x)

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
{P : Type u_1}
[L.Structure P]
(g : L.Equiv N P)
(f : L.Equiv M N)
(x : M)


@[simp]
theorem aleph_mul_aleph (o₁ o₂ : Ordinal) : aleph o₁ * aleph o₂ = aleph (max o₁ o₂)

Cardinal.aleph o₁ * Cardinal.aleph o₂ = Cardinal.aleph (max o₁ o₂)


theorem next_of_valid' (cs cs' : List Char) :
    next ⟨cs ++ cs'⟩ ⟨utf8Len cs⟩ = ⟨utf8Len cs + (cs'.headD default).utf8Size⟩

{ data := cs ++ cs' }.next { byteIdx := String.utf8Len cs } =
  { byteIdx := String.utf8Len cs + (cs'.headD default).utf8Size }


/-- The localization of a Dedekind domain is a Dedekind domain. -/
theorem IsLocalization.isDedekindDomain [IsDedekindDomain A] {M : Submonoid A} (hM : M ≤ A⁰)
    (Aₘ : Type*) [CommRing Aₘ] [IsDomain Aₘ] [Algebra A Aₘ] [IsLocalization M Aₘ] :
    IsDedekindDomain Aₘ

(A : Type u_2)
[CommRing A]
[IsDomain A]
[IsDedekindDomain A]
{M : Submonoid A}
(hM : M ≤ A⁰)
(Aₘ : Type u_4)
[CommRing Aₘ]
[IsDomain Aₘ]
[Algebra A Aₘ]
[IsLocalization M Aₘ]


@[simp]
theorem BilinForm.toMatrix_apply (B : BilinForm R₂ M₂) (i j : n) :
    BilinForm.toMatrix 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}
[Fintype n]
[DecidableEq n]
(b : Basis n R₂ M₂)
(B : LinearMap.BilinForm R₂ M₂)
(i j : n)

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


/-- The underlying set of a non-empty directed sSup of subrings is just a union of the subrings.
  Note that this fails without the directedness assumption (the union of two subrings is
  typically not a subring) -/
theorem mem_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Subring R} (hS : Directed (· ≤ ·) S)
    {x : R} : (x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i

(hS : Directed (fun x x_1 => x ≤ x_1) S)


@[simp]
protected theorem compl_bot : (⊥ : UpperSet α).compl = ⊥


/-- A convex cone is a subset `s` of a `𝕜`-module such that `a • x + b • y ∈ s` whenever `a, b > 0`
and `x, y ∈ s`. -/
structure ConvexCone [AddCommMonoid E] [SMul 𝕜 E] where
  /-- The **carrier set** underlying this cone: the set of points contained in it -/
  carrier : Set E
  smul_mem' : ∀ ⦃c : 𝕜⦄, 0 < c → ∀ ⦃x : E⦄, x ∈ carrier → c • x ∈ carrier
  add_mem' : ∀ ⦃x⦄ (_ : x ∈ carrier) ⦃y⦄ (_ : y ∈ carrier), x + y ∈ carrier

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
(self : ConvexCone 𝕜 E)
⦃c : 𝕜⦄

0 < c → ∀ ⦃x : E⦄, x ∈ self.carrier → c • x ∈ self.carrier


protected theorem smul [Regular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) : (x • μ).Regular

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[μ.Regular]
{x : ℝ≥0∞}
(hx : x ≠ ⊤)


/-- `Fin.sigma_eq_iff_eq_comp_cast` may be useful to work with the RHS of this expression. -/
theorem ofFn_inj' {m n : ℕ} {f : Fin m → α} {g : Fin n → α} :
    ofFn f = ofFn g ↔ (⟨m, f⟩ : Σn, Fin n → α) = ⟨n, g⟩

{α : Type u}
{m n : ℕ}
{f : Fin m → α}
{g : Fin n → α}

List.ofFn f = List.ofFn g ↔ ⟨m, f⟩ = ⟨n, g⟩


@[to_additive]
theorem norm_div_sub_norm_div_le_norm_div (u v w : E) : ‖u / w‖ - ‖v / w‖ ≤ ‖u / v‖

{E : Type u_6}
[SeminormedAddGroup E]
(u v w : E)


theorem IsRegularOfDegree.degree_eq {d : ℕ} (h : G.IsRegularOfDegree d) (v : V) : G.degree v = d

{V : Type u_1}
{G : SimpleGraph V}
[G.LocallyFinite]
{d : ℕ}
(h : G.IsRegularOfDegree d)
(v : V)


theorem ramificationIdx_ne_zero (hp0 : map f p ≠ ⊥) (hP : P.IsPrime) (le : map f p ≤ P) :
    ramificationIdx f p P ≠ 0

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
{f : R →+* S}
{p : Ideal R}
{P : Ideal S}
[IsDedekindDomain S]
(hp0 : Ideal.map f p ≠ ⊥)
(hP : P.IsPrime)
(le : Ideal.map f p ≤ P)