@[to_additive (attr := simp) snd_comp_prod]
theorem snd_comp_prod (f : M →* N) (g : M →* P) : (snd N P).comp (f.prod g) = g

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[MulOneClass M]
[MulOneClass N]
[MulOneClass P]
(f : M →* N)
(g : M →* P)


theorem algebraMap_eq_smul_one' : ⇑(algebraMap R A) = fun r => r • (1 : A)

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


theorem cof_sup_le_lift {ι} {f : ι → Ordinal} (H : ∀ i, f i < sup.{u, v} f) :
    cof (sup.{u, v} f) ≤ Cardinal.lift.{v, u} #ι

{ι : Type u}
{f : ι → Ordinal.{max u v}}
(H : ∀ (i : ι), f i < Ordinal.sup f)

(Ordinal.sup f).cof ≤ Cardinal.lift.{v, u} #ι


@[simp]
theorem LinearIndependent.total_repr (x) : Finsupp.total ι M R v (hv.repr x) = x

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Ring R]
[AddCommGroup M]
[Module R M]
(hv : LinearIndependent R v)
(x : ↥(Submodule.span R (Set.range v)))

(Finsupp.total ι M R v) (hv.repr x) = ↑x


theorem isLocalization_of_base_ringEquiv [IsLocalization M S] (h : R ≃+* P) :
    haveI := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra
    IsLocalization (M.map h.toMonoidHom) S

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
[IsLocalization M S]
(h : R ≃+* P)

IsLocalization (Submonoid.map h.toMonoidHom M) S


@[to_additive]
-- Porting note: renamed theorem to conform to naming convention
theorem comm_topologicalGroup_is_uniform : UniformGroup G

{G : Type u_1}
[AddCommGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]


@[simp]
theorem toLin'_one : toLin' (1 : unitaryGroup n α) = LinearMap.id

{n : Type u}
[DecidableEq n]
[Fintype n]
{α : Type v}
[CommRing α]
[StarRing α]

Matrix.UnitaryGroup.toLin' 1 = LinearMap.id


@[simp]
theorem ceil_add_nat (a : α) (n : ℕ) : ⌈a + n⌉ = ⌈a⌉ + n

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


@[to_additive]
theorem injective_ofQuotientStabilizer : Function.Injective (ofQuotientStabilizer α x)

(α : Type u)
{β : Type v}
[Group α]
[MulAction α β]
(x : β)

Function.Injective (MulAction.ofQuotientStabilizer α x)


theorem eq_of_eqOn_set_dense {s : Set R} (hs : closure s = ⊤) {f g : R →+* S} (h : s.EqOn f g) :
    f = g

{R : Type u}
[Ring R]
{S : Type v}
[Semiring S]
{s : Set R}
(hs : Subring.closure s = ⊤)
{f g : R →+* S}
(h : Set.EqOn (⇑f) (⇑g) s)


/-- In a linearly ordered field with the order topology, if `f` tends to `Filter.atTop` and `g`
tends to a positive constant `C` then `f * g` tends to `Filter.atTop`. -/
theorem Filter.Tendsto.atTop_mul {C : 𝕜} (hC : 0 < C) (hf : Tendsto f l atTop)
    (hg : Tendsto g l (𝓝 C)) : Tendsto (fun x => f x * g x) l atTop

{𝕜 : Type u_1}
{α : Type u_2}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{l : Filter α}
{f g : α → 𝕜}
{C : 𝕜}
(hC : 0 < C)
(hf : Filter.Tendsto f l Filter.atTop)
(hg : Filter.Tendsto g l (𝓝 C))

Filter.Tendsto (fun x => f x * g x) l Filter.atTop


theorem setIntegral_condexpInd (hs : MeasurableSet[m] s) (ht : MeasurableSet t) (hμs : μ s ≠ ∞)
    (hμt : μ t ≠ ∞) (x : G') : ∫ a in s, condexpInd G' hm μ t x a ∂μ = (μ (t ∩ s)).toReal • x

{α : Type u_1}
{G' : Type u_6}
[NormedAddCommGroup G']
[NormedSpace ℝ G']
[CompleteSpace G']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
(hs : MeasurableSet s)
(ht : MeasurableSet t)
(hμs : μ s ≠ ⊤)
(hμt : μ t ≠ ⊤)
(x : G')

∫ (a : α) in s, ↑↑((MeasureTheory.condexpInd G' hm μ t) x) a ∂μ = (μ (t ∩ s)).toReal • x


theorem map₂_le_map₂_left {f : M →ₗ[R] N →ₗ[R] P} {p₁ p₂ : Submodule R M} {q : Submodule R N}
    (h : p₁ ≤ p₂) : map₂ f p₁ q ≤ map₂ f p₂ q

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
{f : M →ₗ[R] N →ₗ[R] P}
{p₁ p₂ : Submodule R M}
{q : Submodule R N}
(h : p₁ ≤ p₂)

Submodule.map₂ f p₁ q ≤ Submodule.map₂ f p₂ q


theorem join_dirac (μ : Measure α) : join (dirac μ) = μ

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

(MeasureTheory.Measure.dirac μ).join = μ


@[simp] lemma lt_sdiff_left : s < s.sdiff t ↔ ¬ Disjoint ↑s t

{α : Type u_1}
[Preorder α]
{s : UpperSet α}
{t : Set α}


@[simp]
theorem coe_toMonoidHom : ⇑abv.toMonoidHom = abv

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedRing S]
(abv : AbsoluteValue R S)
[IsDomain S]
[Nontrivial R]


@[to_additive]
theorem isUnit_singleton (a : α) : IsUnit ({a} : Set α)


theorem exists_prime_and_dvd {n : ℕ+} (hn : n ≠ 1) : ∃ p : ℕ+, p.Prime ∧ p ∣ n


@[deprecated filter_eq (since := "2023-12-14")]
theorem filter_eq' (l : List α) (a : α) : l.filter (a = ·) = replicate (count a l) a

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

List.filter (fun x => decide (a = x)) l = List.replicate (List.count a l) a


lemma algebraMap_def (r : R) : algebraMap R (𝒜 ᵍ⊗[R] ℬ) r = algebraMap R A r ᵍ⊗ₜ[R] 1

{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 ℬ]
(r : R)

(algebraMap R (𝒜 ᵍ⊗[R] ℬ)) r = (algebraMap R A) r ᵍ⊗ₜ[R] 1


@[simp]
theorem sum_apply_eq_zero [Countable ι] {μ : ι → Measure α} {s : Set α} :
    sum μ s = 0 ↔ ∀ i, μ i s = 0

{α : Type u_1}
{ι : Type u_5}
{m0 : MeasurableSpace α}
[Countable ι]
{μ : ι → MeasureTheory.Measure α}
{s : Set α}

(MeasureTheory.Measure.sum μ) s = 0 ↔ ∀ (i : ι), (μ i) s = 0


theorem isChain_range_flag (b : Basis (Fin n) R M) : IsChain (· ≤ ·) (range b.flag)

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{n : ℕ}
(b : Basis (Fin n) R M)

IsChain (fun x x_1 => x ≤ x_1) (Set.range b.flag)


theorem pi_Iio_mem_nhds (ha : ∀ i, x i < a i) : Iio a ∈ 𝓝 x

{ι : Type u_1}
{π : ι → Type u_2}
[Finite ι]
[(i : ι) → LinearOrder (π i)]
[(i : ι) → TopologicalSpace (π i)]
[∀ (i : ι), OrderTopology (π i)]
{a x : (i : ι) → π i}
[Nonempty ι]
(ha : ∀ (i : ι), x i < a i)


@[simp] theorem disjoint_append_left : Disjoint (l₁ ++ l₂) l ↔ Disjoint l₁ l ∧ Disjoint l₂ l

∀ {α : Type u_1} {l₁ l₂ l : List α}, (l₁ ++ l₂).Disjoint l ↔ l₁.Disjoint l ∧ l₂.Disjoint l


@[to_additive]
theorem le_ciInf_mul [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a : α} {g : ι → α}
    {h : α} (H : ∀ i, a ≤ g i * h) : a ≤ iInf g * h

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


theorem nonempty_congr (e : α ≃ β) : Nonempty α ↔ Nonempty β


theorem log_nonneg_iff (hx : 0 < x) : 0 ≤ log x ↔ 1 ≤ x


theorem aleph0_le {c : Cardinal} : ℵ₀ ≤ c ↔ ∀ n : ℕ, ↑n ≤ c


/-- Two elements `x` and `y` are complements of each other if `x ⊔ y = ⊤` and `x ⊓ y = ⊥`. -/
structure IsCompl [PartialOrder α] [BoundedOrder α] (x y : α) : Prop where
  /-- If `x` and `y` are to be complementary in an order, they should be disjoint. -/
  protected disjoint : Disjoint x y
  /-- If `x` and `y` are to be complementary in an order, they should be codisjoint. -/
  protected codisjoint : Codisjoint x y

{α : Type u_1}
[PartialOrder α]
[BoundedOrder α]
{x y : α}
(self : IsCompl x y)


theorem partialInv_of_injective {α β} {f : α → β} (I : Injective f) : IsPartialInv f (partialInv f)

{α : Type u_4}
{β : Sort u_5}
{f : α → β}
(I : Function.Injective f)

Function.IsPartialInv f (Function.partialInv f)


/-- If `f : α → E` is a function such that `norm ∘ f` has a local maximum on a set `s` at a point
`c` and `y` is a vector on the same ray as `f c`, then the function `fun x => ‖f x + y‖` has a local
maximum on `s` at `c`. -/
theorem IsLocalMaxOn.norm_add_sameRay (h : IsLocalMaxOn (norm ∘ f) s c) (hy : SameRay ℝ (f c) y) :
    IsLocalMaxOn (fun x => ‖f x + y‖) s c

{X : Type u_2}
{E : Type u_3}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
[TopologicalSpace X]
{f : X → E}
{s : Set X}
{c : X}
{y : E}
(h : IsLocalMaxOn (norm ∘ f) s c)
(hy : SameRay ℝ (f c) y)


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

{J : CategoryTheory.GrothendieckTopology C}


theorem equivalence_functor : (equivalence hF hG).functor = F ⋙ eB.inverse

(hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor)

(AlgebraicTopology.DoldKan.Compatibility.equivalence hF hG).functor = F ⋙ eB.inverse


@[simp] theorem isEmpty_cons : (x :: xs : List α).isEmpty = false


/-- Rotating triangles gives an auto-equivalence on the category of triangles in `C`.
-/
@[simps]
def triangleRotation : Equivalence (Triangle C) (Triangle C)

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

(CategoryTheory.Pretriangulated.triangleRotation C).unitIso = CategoryTheory.Pretriangulated.rotCompInvRot


lemma indicator_one_inj (h : indicator s (1 : ι → M₀) = indicator t 1) : s = t

{ι : Type u_1}
(M₀ : Type u_4)
[MulZeroOneClass M₀]
{s t : Set ι}
[Nontrivial M₀]
(h : s.indicator 1 = t.indicator 1)


/-- Homotopy between morphisms of short complexes is compatible with precomposition. -/
@[simps]
def compLeft (h : Homotopy φ₁ φ₂) (ψ : S₃ ⟶ S₁) : Homotopy (ψ ≫ φ₁) (ψ ≫ φ₂)

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

{φ₁ φ₂ : S₁ ⟶ S₂}

(h : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)

(h.compLeft ψ).h₁ = CategoryTheory.CategoryStruct.comp ψ.τ₂ h.h₁


/-- A variant of `Submodule.span_image` for `algebraMap`. -/
theorem span_algebraMap_image (a : Set R) :
    Submodule.span R (algebraMap R S '' a) = (Submodule.span R a).map (Algebra.linearMap R S)

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
(a : Set R)

Submodule.span R (⇑(algebraMap R S) '' a) = Submodule.map (Algebra.linearMap R S) (Submodule.span R a)


theorem app_eq_invApp_app_of_comp_eq_aux {X Y U : Scheme.{u}} (f : Y ⟶ U) (g : U ⟶ X) (fg : Y ⟶ X)
    (H : fg = f ≫ g) [h : IsOpenImmersion g] (V : U.Opens) :
    f ⁻¹ᵁ V = fg ⁻¹ᵁ (g ''ᵁ V)

[h : AlgebraicGeometry.IsOpenImmersion g]

(TopologicalSpace.Opens.map f.val.base).obj V =
  (TopologicalSpace.Opens.map fg.val.base).obj ((AlgebraicGeometry.Scheme.Hom.opensFunctor g).obj V)


/-- A column partioned matrix in a Star ring when conjugate transposed gives a row partitioned
matrix with the columns of the initial matrix conjugate transposed to become rows. -/
lemma conjTranspose_fromColumns_eq_fromRows_conjTranspose (A₁ : Matrix m n₁ R)
    (A₂ : Matrix m n₂ R) :
    conjTranspose (fromColumns A₁ A₂) = fromRows (conjTranspose A₁) (conjTranspose A₂)

{R : Type u_1}
{m : Type u_2}
{n₁ : Type u_6}
{n₂ : Type u_7}
[Star R]
(A₁ : Matrix m n₁ R)
(A₂ : Matrix m n₂ R)

(A₁.fromColumns A₂).conjTranspose = A₁.conjTranspose.fromRows A₂.conjTranspose


theorem isGLB_of_mem_closure {s : Set α} {a : α} (hsa : a ∈ lowerBounds s) (hsf : a ∈ closure s) :
    IsGLB s a

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{s : Set α}
{a : α}
(hsa : a ∈ lowerBounds s)
(hsf : a ∈ closure s)


/-- A functor `G : C ⥤ D` sends bicones over `F` to bicones over `G.obj ∘ F` functorially. -/
@[simps]
def functoriality (G : C ⥤ D) [Functor.PreservesZeroMorphisms G] :
    Bicone F ⥤ Bicone (G.obj ∘ F)

∀ {X Y : CategoryTheory.Limits.Bicone F} (f : X ⟶ Y),
  ((CategoryTheory.Limits.Bicones.functoriality F G).map f).hom = G.map f.hom


@[simp]
theorem integrable_neg_iff {f : α → β} : Integrable (-f) μ ↔ Integrable f μ

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

MeasureTheory.Integrable (-f) μ ↔ MeasureTheory.Integrable f μ


@[simp] theorem appendList_eq_append
    (arr : Array α) (l : List α) : arr.appendList l = arr ++ l

{α : Type u_1}
(arr : Array α)
(l : List α)


/-- `CoheytingHomClass F α β` states that `F` is a type of co-Heyting homomorphisms.

You should extend this class when you extend `CoheytingHom`. -/
class CoheytingHomClass (F α β : Type*) [CoheytingAlgebra α] [CoheytingAlgebra β] [FunLike F α β]
  extends LatticeHomClass F α β : Prop where
  /-- The proposition that a co-Heyting homomorphism preserves the top element. -/
  map_top (f : F) : f ⊤ = ⊤
  /-- The proposition that a co-Heyting homomorphism preserves the difference operation. -/
  map_sdiff (f : F) : ∀ a b, f (a \ b) = f a \ f b

{F : Type u_6}
{α : Type u_7}
{β : Type u_8}
[CoheytingAlgebra α]
[CoheytingAlgebra β]
[FunLike F α β]
[self : CoheytingHomClass F α β]
(f : F)


/-- Ad hoc typeclass stating that neighborhoods are eventually bounded above. -/
class BoundedLENhdsClass (α : Type*) [Preorder α] [TopologicalSpace α] : Prop where
  isBounded_le_nhds (a : α) : (𝓝 a).IsBounded (· ≤ ·)

{α : Type u_7}
[Preorder α]
[TopologicalSpace α]
[self : BoundedLENhdsClass α]
(a : α)

Filter.IsBounded (fun x x_1 => x ≤ x_1) (𝓝 a)


theorem cmp_mul_neg_left [ExistsAddOfLE α] [PosMulStrictMono α]
    [ContravariantClass α α (swap (· + ·)) (· < ·)] [CovariantClass α α (swap (· + ·)) (· < ·)]
    {a : α} (ha : a < 0) (b c : α) : cmp (a * b) (a * c) = cmp c b

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

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


@[simp]
lemma id_val (X : SheafOfModules.{v} R) : Hom.val (𝟙 X) = 𝟙 X.val


theorem isLocalRingHom_of_iso {R S : CommRingCat} (f : R ≅ S) : IsLocalRingHom f.hom


lemma val_inv_mul (hmn : m.Coprime n) : ((m⁻¹ : ZMod n).val * m : ZMod n) = 1


theorem mk_insert_le {α : Type u} {s : Set α} {a : α} : #(insert a s : Set α) ≤ #s + 1

Cardinal.mk ↑(insert a s) ≤ Cardinal.mk ↑s + 1


/-- In a complete space `E`, the projection maps onto a complete subspace `K` and its orthogonal
complement sum to the identity. -/
theorem id_eq_sum_orthogonalProjection_self_orthogonalComplement [HasOrthogonalProjection K] :
    ContinuousLinearMap.id 𝕜 E =
      K.subtypeL.comp (orthogonalProjection K) + Kᗮ.subtypeL.comp (orthogonalProjection Kᗮ)

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


@[simp]
theorem span_singleton_eq_bot : (R ∙ x) = ⊥ ↔ x = 0

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{x : M}


@[simp] lemma posFittingCompOf_eq_bot_of_isNilpotent
    [IsNilpotent R L M] (x : L) :
    posFittingCompOf R M x = ⊥

(R : Type u_2)
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieModule.IsNilpotent R L M]
(x : L)


@[to_additive (attr := elab_as_elim)]
theorem induction_on_units {p : Units c.Quotient → Prop} (u : Units c.Quotient)
    (H : ∀ (x y : M) (hxy : c (x * y) 1) (hyx : c (y * x) 1), p ⟨x, y, c.eq.2 hxy, c.eq.2 hyx⟩) :
    p u

(H : ∀ (x y : M) (hxy : c (x * y) 1) (hyx : c (y * x) 1), p { val := ↑x, inv := ↑y, val_inv := ⋯, inv_val := ⋯ })


/-- Local integral curves are unique.

If a $C^1$ vector field `v` admits two local integral curves `γ γ' : ℝ → M` at `t₀` with
`γ t₀ = γ' t₀`, then `γ` and `γ'` agree on some open interval containing `t₀`. -/
theorem isIntegralCurveAt_eventuallyEq_of_contMDiffAt (hγt₀ : I.IsInteriorPoint (γ t₀))
    (hv : ContMDiffAt I I.tangent 1 (fun x ↦ (⟨x, v x⟩ : TangentBundle I M)) (γ t₀))
    (hγ : IsIntegralCurveAt γ v t₀) (hγ' : IsIntegralCurveAt γ' v t₀) (h : γ t₀ = γ' t₀) :
    γ =ᶠ[𝓝 t₀] γ'

(hv : ContMDiffAt I I.tangent 1 (fun x => { proj := x, snd := v x }) (γ t₀))

γ =ᶠ[𝓝 t₀] γ'


/-- **Uniqueness of left-invariant measures**:
Given two left-invariant measures which are finite
on compacts and regular, they coincide up to a multiplicative constant. -/
@[to_additive isAddLeftInvariant_eq_smul_of_regular]
lemma isMulLeftInvariant_eq_smul_of_regular [LocallyCompactSpace G]
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ']
    [Regular μ] [Regular μ'] :
    μ' = haarScalarFactor μ' μ • μ


theorem lt_iSup_iff {f : ι → α} : a < iSup f ↔ ∃ i, a < f i

{α : Type u_1}
{ι : Sort u_5}
[CompleteLinearOrder α]
{a : α}
{f : ι → α}


theorem lt_congr_right {x y₁ y₂ : PGame} (hy : y₁ ≈ y₂) : x < y₁ ↔ x < y₂

{x y₁ y₂ : SetTheory.PGame}
(hy : y₁ ≈ y₂)


/-- When `g` is a monomorphism, the kernel of `f ≫ g` is isomorphic to the kernel of `f`.
-/
@[simps]
def kernelCompMono {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) [HasKernel f] [Mono g] :
    kernel (f ≫ g) ≅ kernel f

(CategoryTheory.Limits.kernelCompMono f g).hom =
  CategoryTheory.Limits.kernel.lift f (CategoryTheory.Limits.kernel.ι (f ≫ g)) ⋯


/-- A point in the subspace is equidistant from another point and its
reflection. -/
theorem dist_reflection_eq_of_mem (s : AffineSubspace ℝ P) [Nonempty s]
    [HasOrthogonalProjection s.direction] {p₁ : P} (hp₁ : p₁ ∈ s) (p₂ : P) :
    dist p₁ (reflection s p₂) = dist p₁ p₂

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(s : AffineSubspace ℝ P)
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
{p₁ : P}
(hp₁ : p₁ ∈ s)
(p₂ : P)

dist p₁ ((EuclideanGeometry.reflection s) p₂) = dist p₁ p₂


theorem pullbackConeOfRightIso_π_app_none : (pullbackConeOfRightIso f g).π.app none = f

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

(CategoryTheory.Limits.pullbackConeOfRightIso f g).π.app none = f


lemma withDensity_one_sub_rnDerivAux (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η] :
    withDensity (κ + η) (fun a x ↦ Real.toNNReal (1 - rnDerivAux κ (κ + η) a x)) = η

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

((κ + η).withDensity fun a x => ↑(1 - κ.rnDerivAux (κ + η) a x).toNNReal) = η


@[simp]
theorem image_sub_const_Iic : (fun x => x - a) '' Iic b = Iic (b - a)

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

(fun x => x - a) '' Set.Iic b = Set.Iic (b - a)


/-- A closed ball in a product space is a product of closed balls. See also `closedBall_pi'`
for a version assuming `Nonempty β` instead of `0 ≤ r`. -/
lemma closedBall_pi (x : ∀ b, π b) {r : ℝ} (hr : 0 ≤ r) :
    closedBall x r = Set.pi univ fun b => closedBall (x b) r

{β : Type u_2}
{π : β → Type u_3}
[Fintype β]
[(b : β) → PseudoMetricSpace (π b)]
(x : (b : β) → π b)
{r : ℝ}
(hr : 0 ≤ r)

Metric.closedBall x r = Set.univ.pi fun b => Metric.closedBall (x b) r


theorem DifferentiableOn.eventually_differentiableAt (h : DifferentiableOn 𝕜 f s) (hs : s ∈ 𝓝 x) :
    ∀ᶠ y in 𝓝 x, DifferentiableAt 𝕜 f y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{s : Set E}
(h : DifferentiableOn 𝕜 f s)
(hs : s ∈ 𝓝 x)

∀ᶠ (y : E) in 𝓝 x, DifferentiableAt 𝕜 f y


@[to_additive subset_addCenter_add_units]
theorem subset_center_units : ((↑) : Mˣ → M) ⁻¹' center M ⊆ Set.center Mˣ

Units.val ⁻¹' Set.center M ⊆ Set.center Mˣ


theorem isSubring_set_range {R : Type u} {S : Type v} [Ring R] [Ring S] (f : R →+* S) :
    IsSubring (Set.range f)


@[reassoc (attr := simp)]
lemma additiveObjIsoBiproduct_hom_π (F : Mat_ C ⥤ D) [Functor.Additive F] (M : Mat_ C) (i : M.ι) :
    (additiveObjIsoBiproduct F M).hom ≫ biproduct.π _ i =
      F.map (M.isoBiproductEmbedding.hom ≫ biproduct.π _ i)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
[CategoryTheory.Preadditive D]
(F : CategoryTheory.Mat_ C ⥤ D)
[F.Additive]
(M : CategoryTheory.Mat_ C)
(i : M.ι)

(CategoryTheory.Mat_.additiveObjIsoBiproduct F M).hom ≫
    CategoryTheory.Limits.biproduct.π (fun i => F.obj ((CategoryTheory.Mat_.embedding C).obj (M.X i))) i =
  F.map
    (M.isoBiproductEmbedding.hom ≫
      CategoryTheory.Limits.biproduct.π (fun i => (CategoryTheory.Mat_.embedding C).obj (M.X i)) i)


@[simp]
theorem coe_const (b : β) : ⇑(const α b) = Function.const α b

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

↑(MeasureTheory.SimpleFunc.const α b) = Function.const α b


/-- Composition of prelax functors. -/
@[simps]
def comp (G : PrelaxFunctor C D) : PrelaxFunctor B D

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{D : Type u₃}
[CategoryTheory.Bicategory D]
(F : CategoryTheory.PrelaxFunctor B C)
(G : CategoryTheory.PrelaxFunctor C D)

(F.comp G).toPrelaxFunctorStruct = F.comp G.toPrelaxFunctorStruct


/-- The **triangle inequality** in `LinearOrderedAddCommGroup`s. -/
theorem abs_add (a b : α) : |a + b| ≤ |a| + |b|

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


/-- **Cauchy–Schwarz inequality**. -/
theorem inner_mul_inner_self_le (x y : E) : ‖⟪x, y⟫‖ * ‖⟪y, x⟫‖ ≤ re ⟪x, x⟫ * re ⟪y, y⟫

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

‖⟪x, y⟫_𝕜‖ * ‖⟪y, x⟫_𝕜‖ ≤ RCLike.re ⟪x, x⟫_𝕜 * RCLike.re ⟪y, y⟫_𝕜


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

{R : Type u}
[NonUnitalNonAssocSemiring R]
(S : NonUnitalSubsemiring R)
(s : Set R)
(hs : s = ↑S)


/-- The Bochner integral of a real-valued function `f : α → ℝ` is the difference between the
  integral of the positive part of `f` and the integral of the negative part of `f`.  -/
theorem integral_eq_lintegral_pos_part_sub_lintegral_neg_part {f : α → ℝ} (hf : Integrable f μ) :
    ∫ a, f a ∂μ =
      ENNReal.toReal (∫⁻ a, .ofReal (f a) ∂μ) - ENNReal.toReal (∫⁻ a, .ofReal (-f a) ∂μ)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
(hf : MeasureTheory.Integrable f μ)

∫ (a : α), f a ∂μ = (∫⁻ (a : α), ENNReal.ofReal (f a) ∂μ).toReal - (∫⁻ (a : α), ENNReal.ofReal (-f a) ∂μ).toReal


@[simp]
theorem gcd_mul_right' [GCDMonoid α] (a b c : α) :
    Associated (gcd (b * a) (c * a)) (gcd b c * a)

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


theorem trans_apply (f : r ↪r s) (g : s ↪r t) (a : α) : (f.trans g) a = g (f a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{r : α → α → Prop}
{s : β → β → Prop}
{t : γ → γ → Prop}
(f : r ↪r s)
(g : s ↪r t)
(a : α)


@[to_additive (attr := simp)]
protected theorem map_one {β} (f : α → β) : (1 : WithBot α).map f = (f 1 : WithBot β)

{α : Type u}
[Zero α]
{β : Type u_1}
(f : α → β)


@[simp]
theorem submodule_mk'' (H : Submodule K V) (h : finrank K H = 1) : (mk'' H h).submodule = H

(h : FiniteDimensional.finrank K ↥H = 1)

(Projectivization.mk'' H h).submodule = H


/-- Equivalence between `Fin (n + 1) → β` and `β × (Fin n → β)`. -/
@[simps! (config := .asFn)]
def Equiv.piFinSucc (n : ℕ) (β : Type u) : (Fin (n + 1) → β) ≃ β × (Fin n → β)

⇑(Equiv.piFinSucc n β).symm = fun f => Fin.cons f.1 f.2


theorem not_mem_zero (v : Vector α 0) : a ∉ v.toList

{α : Type u_1}
(a : α)
(v : Mathlib.Vector α 0)


theorem setIntegral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
    (hs : MeasurableSet s) : ∫ a in s, condCDF ρ a x ∂ρ.fst = (ρ (s ×ˢ Iic x)).toReal

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
[MeasureTheory.IsFiniteMeasure ρ]
(x : ℝ)
{s : Set α}
(hs : MeasurableSet s)

∫ (a : α) in s, ↑(ProbabilityTheory.condCDF ρ a) x ∂ρ.fst = (ρ (s ×ˢ Set.Iic x)).toReal


theorem abv_div (a b : R) : abv (a / b) = abv a / abv b

{S : Type u_5}
[LinearOrderedSemifield S]
{R : Type u_6}
[DivisionSemiring R]
(abv : R → S)
[IsAbsoluteValue abv]
(a b : R)


theorem neg_pi_lt_toReal (θ : Angle) : -π < θ.toReal


/-- A monotone function is continuous to the right at a point if and only if its right limit
coincides with the value of the function. -/
theorem continuousWithinAt_Ioi_iff_rightLim_eq :
    ContinuousWithinAt f (Ioi x) x ↔ rightLim f x = f x

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Monotone f)
{x : α}
[TopologicalSpace α]
[OrderTopology α]

ContinuousWithinAt f (Set.Ioi x) x ↔ Function.rightLim f x = f x


@[simp]
theorem diag_one [DecidableEq n] [Zero α] [One α] : diag (1 : Matrix n n α) = 1

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
[One α]


@[simp]
theorem coe_add (m₁ m₂ : OuterMeasure α) : ⇑(m₁ + m₂) = m₁ + m₂

{α : Type u_1}
(m₁ m₂ : MeasureTheory.OuterMeasure α)


@[to_additive (attr := simp)]
lemma coe_monoidHom_symm_comp_coe_monoidHom (e : M ≃* N) :
    (e.symm : N →* M).comp e = MonoidHom.id _

{M : Type u_6}
{N : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
(e : M ≃+ N)


lemma shiftLeft'_add (b m n) : ∀ k, shiftLeft' b m (n + k) = shiftLeft' b (shiftLeft' b m n) k

Nat.shiftLeft' b m (n + k) = Nat.shiftLeft' b (Nat.shiftLeft' b m n) k


/-- If `A` and `B` are also `Algebra`s over yet another set of scalars `S` then we may "base change"
from `R` to `S`. -/
@[simps!]
def baseChange (S : Type*) [CommSemiring S] [Module S M] [Algebra S A] [Algebra S B]
    [IsScalarTower S A M] [IsScalarTower S B M] (p : Submodule (A ⊗[R] B) M) :
    Submodule (A ⊗[S] B) M

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{M : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[Semiring A]
[Semiring B]
[Module A M]
[Module B M]
[Algebra R A]
[Algebra R B]
[IsScalarTower R A M]
[IsScalarTower R B M]
[SMulCommClass A B M]
(S : Type u_5)
[CommSemiring S]
[Module S M]
[Algebra S A]
[Algebra S B]
[IsScalarTower S A M]
[IsScalarTower S B M]
(p : Submodule (A ⊗[R] B) M)


@[to_additive]
theorem mul_singleton_mem_nhds (a : α) {b : α} (h : s ∈ 𝓝 b) : s * {a} ∈ 𝓝 (b * a)

{α : Type u}
[TopologicalSpace α]
[AddGroup α]
[ContinuousConstVAdd αᵃᵒᵖ α]
{s : Set α}
(a : α)
{b : α}
(h : s ∈ 𝓝 b)


theorem associated_of_dvd_of_degree_eq {K} [Field K] {p q : K[X]} (hpq : p ∣ q)
    (h₁ : p.degree = q.degree) : Associated p q

{K : Type u_1}
[Field K]
{p q : K[X]}
(hpq : p ∣ q)
(h₁ : p.degree = q.degree)


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

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → ℝ≥0∞}
(hμ : μ s ≠ 0)
(hμ₁ : μ s ≠ ⊤)
(hf : AEMeasurable f (μ.restrict s))

0 < μ {x | x ∈ s ∧ f x ≤ ⨍⁻ (a : α) in s, f a ∂μ}


@[to_additive]
theorem Set.Subsingleton.threeGPFree (hs : s.Subsingleton) : ThreeGPFree s

{α : Type u_2}
[AddMonoid α]
{s : Set α}
(hs : s.Subsingleton)


theorem cos_add_pi (x : ℂ) : cos (x + π) = -cos x

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


@[simp]
theorem coeSubtype : (Submodule.subtype p : p → M) = Subtype.val

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


/-- **First moment method**. An integrable function is greater than its mean on a set of positive
measure. -/
theorem measure_setAverage_le_pos (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : IntegrableOn f s μ) :
    0 < μ ({x ∈ s | ⨍ a in s, f a ∂μ ≤ f x})

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → ℝ}
(hμ : μ s ≠ 0)
(hμ₁ : μ s ≠ ⊤)
(hf : MeasureTheory.IntegrableOn f s μ)

0 < μ {x | x ∈ s ∧ ⨍ (a : α) in s, f a ∂μ ≤ f x}


theorem MonovaryOn.comp_monotoneOn_right (h : MonovaryOn f g s) (hg : MonotoneOn g' (g '' s)) :
    MonovaryOn f (g' ∘ g) s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Preorder α]
[LinearOrder β]
[Preorder γ]
{f : ι → α}
{g : ι → β}
{g' : β → γ}
{s : Set ι}
(h : MonovaryOn f g s)
(hg : MonotoneOn g' (g '' s))


@[to_additive (attr := simp)]
theorem sInf_one : sInf (1 : Set α) = 1

{α : Type u_1}
[CompleteLattice α]
[Zero α]


/-- The two properties shown to be equivalent here are possible definitions for a Lie algebra
to be reductive.

Note that there is absolutely [no agreement](https://mathoverflow.net/questions/284713/) on what
the label 'reductive' should mean when the coefficients are not a field of characteristic zero. -/
theorem abelian_radical_iff_solvable_is_abelian [IsNoetherian R L] :
    IsLieAbelian (radical R L) ↔ ∀ I : LieIdeal R L, IsSolvable R I → IsLieAbelian I

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[IsNoetherian R L]

IsLieAbelian ↥↑(LieAlgebra.radical R L) ↔ ∀ (I : LieIdeal R L), LieAlgebra.IsSolvable R ↥↑I → IsLieAbelian ↥↑I


protected theorem mul_le_of_le_ediv {a b c : Int} (H1 : 0 < c) (H2 : a ≤ b / c) : a * c ≤ b


theorem projectiveSeminormAux_add_le (p q : FreeAddMonoid (𝕜 × Π i, E i)) :
    projectiveSeminormAux (p + q) ≤ projectiveSeminormAux p + projectiveSeminormAux q

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

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

PiTensorProduct.projectiveSeminormAux (p + q) ≤
  PiTensorProduct.projectiveSeminormAux p + PiTensorProduct.projectiveSeminormAux q


@[simp] lemma reflTransGen_transGen : ReflTransGen (TransGen r) = ReflTransGen r

Relation.ReflTransGen (Relation.TransGen r) = Relation.ReflTransGen r


@[reassoc]
theorem Cofork.app_zero_eq_comp_π_right (s : Cofork f g) : s.ι.app zero = g ≫ s.π

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

s.ι.app CategoryTheory.Limits.WalkingParallelPair.zero = CategoryTheory.CategoryStruct.comp g s.π


@[simp]
theorem dist_map (x y : E) : dist (f x) (f y) = dist x y

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


theorem leadingCoeff_eq_iff {x : HahnSeries Γ R} : x.leadingCoeff = 0 ↔ x = 0

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


lemma ciInf_eq_ite {p : Prop} [Decidable p] {f : p → α} :
    (⨅ h : p, f h) = if h : p then f h else sInf (∅ : Set α)

{α : Type u_1}
[ConditionallyCompleteLattice α]
{p : Prop}
[Decidable p]
{f : p → α}

⨅ (h : p), f h = if h : p then f h else sInf ∅


nonrec theorem HasDerivWithinAt.const_add (c : F) (hf : HasDerivWithinAt f f' s x) :
    HasDerivWithinAt (fun y => c + f y) f' s x

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


theorem natTrans_hcomp_injective {F G : W.Localization ⥤ D} {τ₁ τ₂ : F ⟶ G}
    (h : 𝟙 W.Q ◫ τ₁ = 𝟙 W.Q ◫ τ₂) : τ₁ = τ₂

{F G : CategoryTheory.Functor W.Localization D}

{τ₁ τ₂ : F ⟶ G}

(h : CategoryTheory.CategoryStruct.id W.Q ◫ τ₁ = CategoryTheory.CategoryStruct.id W.Q ◫ τ₂)


lemma ne_zero_of_irreducible_X_pow_sub_C {n : ℕ} {a : K} (H : Irreducible (X ^ n - C a)) :
    n ≠ 0

(H : Irreducible (Polynomial.X ^ n - Polynomial.C a))


@[norm_cast] -- Porting note: no longer a `simp`
theorem coe_iSup₂ (f : ∀ i, κ i → LowerSet α) :
    (↑(⨆ (i) (j), f i j) : Set α) = ⋃ (i) (j), f i j

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_5}
[LE α]
(f : (i : ι) → κ i → LowerSet α)


/-- The identity oplax functor. -/
@[simps]
def id (B : Type u₁) [Bicategory.{w₁, v₁} B] : OplaxFunctor B B

(B : Type u₁)
[CategoryTheory.Bicategory B]

(CategoryTheory.OplaxFunctor.id B).toPrelaxFunctor = CategoryTheory.PrelaxFunctor.id B


theorem of_algebraMap_eq [Algebra R A]
    (h : ∀ x, algebraMap R A x = algebraMap S A (algebraMap R S x)) : IsScalarTower R S A

(h : ∀ (x : R), (algebraMap R A) x = (algebraMap S A) ((algebraMap R S) x))


theorem Ioo_subset_Iio_self : Ioo a b ⊆ Iio b


theorem MonotoneOn.map_csInf {β : Type*} [ConditionallyCompleteLattice β] {f : α → β}
    (hf : MonotoneOn f s) (hs : s.Nonempty) : f (sInf s) = sInf (f '' s)

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
[IsWellOrder α fun x x_1 => x < x_1]
{β : Type u_5}
[ConditionallyCompleteLattice β]
{f : α → β}
(hf : MonotoneOn f s)
(hs : s.Nonempty)


@[simp]
theorem val_toFinset [DecidableEq α] (s : Finset α) : s.val.toFinset = s

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


@[simp]
theorem basis_repr (h : IsAdjoinRootMonic S f) (x : S) (i : Fin (natDegree f)) :
    h.basis.repr x i = (h.modByMonicHom x).coeff (i : ℕ)

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)
(x : S)
(i : Fin f.natDegree)

(h.basis.repr x) i = (h.modByMonicHom x).coeff ↑i


theorem associated_mul_unit_left {β : Type*} [Monoid β] (a u : β) (hu : IsUnit u) :
    Associated (a * u) a

{β : Type u_5}
[Monoid β]
(a u : β)
(hu : IsUnit u)


theorem IsBaseChange.of_lift_unique
    (h : ∀ (Q : Type max v₁ v₂ v₃) [AddCommMonoid Q],
      ∀ [Module R Q] [Module S Q], ∀ [IsScalarTower R S Q],
        ∀ g : M →ₗ[R] Q, ∃! g' : N →ₗ[S] Q, (g'.restrictScalars R).comp f = g) :
    IsBaseChange S f

(h :
  ∀ (Q : Type (max v₁ v₂ v₃)) [inst : AddCommMonoid Q] [inst_1 : Module R Q] [inst_2 : Module S Q]
    [inst_3 : IsScalarTower R S Q] (g : M →ₗ[R] Q), ∃! g', ↑R g' ∘ₗ f = g)


protected theorem tsum_mul_right : ∑' i, f i * a = (∑' i, f i) * a

{α : Type u_1}
{a : ℝ≥0∞}
{f : α → ℝ≥0∞}


theorem forget_map_eq_coe {X Y : C} (f : X ⟶ Y) : (forget C).map f = f

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


@[simp]
theorem inv_last {i j} (w : NeWord G i j) : w.inv.last = w.head⁻¹

{ι : Type u_1}
{G : ι → Type u_4}
[(i : ι) → Group (G i)]
{i j : ι}
(w : Monoid.CoprodI.NeWord G i j)


protected theorem Set.OrdConnected.IciExtend {s : Set (Ici a)} (hs : s.OrdConnected) :
    {x | IciExtend (· ∈ s) x}.OrdConnected

{α : Type u_1}
[LinearOrder α]
{a : α}
{s : Set ↑(Set.Ici a)}
(hs : s.OrdConnected)

{x | Set.IciExtend (fun x => x ∈ s) x}.OrdConnected


/-- A morphism of sheaves of types is locally bijective iff it is an isomorphism.
(This is generalized below as `isLocallyBijective_iff_isIso`.) -/
private lemma isLocallyBijective_iff_isIso' :
    IsLocallyInjective f ∧ IsLocallySurjective f ↔ IsIso f

{J : CategoryTheory.GrothendieckTopology C}

CategoryTheory.Sheaf.IsLocallyInjective f ∧ CategoryTheory.Sheaf.IsLocallySurjective f ↔ CategoryTheory.IsIso f


@[simp]
lemma whiskerLeft_app {C D E : Cat} (F : C ⟶ D) {G H : D ⟶ E} (η : G ⟶ H) (X : C) :
    (F ◁ η).app X = η.app (F.obj X)

{C D E : CategoryTheory.Cat}
(F : C ⟶ D)
{G H : D ⟶ E}
(η : G ⟶ H)
(X : ↑C)

(CategoryTheory.Bicategory.whiskerLeft F η).app X = η.app (F.obj X)


theorem card_eq_of_mem_parts_equitabilise :
    t ∈ (P.equitabilise h).parts → t.card = m ∨ t.card = m + 1

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
{m a b : ℕ}
{P : Finpartition s}
{h : a * m + b * (m + 1) = s.card}

t ∈ (Finpartition.equitabilise h).parts → t.card = m ∨ t.card = m + 1


/-- An `R`-coalgebra is a comonoid object in the category of `R`-modules. -/
@[simps] def toComonObj (X : CoalgebraCat R) : Comon_ (ModuleCat R)

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

X.toComonObj.X = ModuleCat.of R ↑X.toModuleCat


@[simp]
theorem adjugate_submatrix_equiv_self (e : n ≃ m) (A : Matrix m m α) :
    adjugate (A.submatrix e e) = (adjugate A).submatrix e e

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

(A.submatrix ⇑e ⇑e).adjugate = A.adjugate.submatrix ⇑e ⇑e


theorem sym2_cons (a : α) (s : Finset α) (ha : a ∉ s) :
    (s.cons a ha).sym2 = ((s.cons a ha).map <| Sym2.mkEmbedding a).disjUnion s.sym2 (by
      simp [Finset.disjoint_left, ha])

{α : Type u_1}
(a : α)
(s : Finset α)
(ha : a ∉ s)

(Finset.cons a s ha).sym2 = (Finset.map (Sym2.mkEmbedding a) (Finset.cons a s ha)).disjUnion s.sym2 ⋯


theorem not_mem_Ioo_of_le (ha : c ≤ a) : c ∉ Ioo a b

{α : Type u_1}
[Preorder α]
{a b c : α}
(ha : c ≤ a)


theorem diam_triple :
    Metric.diam ({x, y, z} : Set α) = max (max (dist x y) (dist x z)) (dist y z)

{α : Type u}
[PseudoMetricSpace α]
{x y z : α}

Metric.diam {x, y, z} = max (max (dist x y) (dist x z)) (dist y z)


theorem add_num_den' (q r : ℚ) :
    (q + r).num * q.den * r.den = (q.num * r.den + r.num * q.den) * (q + r).den

(q + r).num * ↑q.den * ↑r.den = (q.num * ↑r.den + r.num * ↑q.den) * ↑(q + r).den


protected theorem mono (h : AEDisjoint μ s t) (hu : u ⊆ s) (hv : v ⊆ t) : AEDisjoint μ u v

{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t u v : Set α}
(h : MeasureTheory.AEDisjoint μ s t)
(hu : u ⊆ s)
(hv : v ⊆ t)


protected theorem add_le_add_iff_left [LE α] [CovariantClass α α (· + ·) (· ≤ ·)]
    [ContravariantClass α α (· + ·) (· ≤ ·)] (ha : a ≠ ⊤) : a + b ≤ a + c ↔ b ≤ c

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

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


lemma mul_eq_bot_iff : a * b = ⊥ ↔ a ≠ 0 ∧ b = ⊥ ∨ a = ⊥ ∧ b ≠ 0

{α : Type u_1}
[DecidableEq α]
[MulZeroClass α]
{a b : WithBot α}


@[simp]
theorem comp_inj_left {p₁ p₂ : Path a b} {q : Path b c} : p₁.comp q = p₂.comp q ↔ p₁ = p₂

{V : Type u}
[Quiver V]
{a b c : V}
{p₁ p₂ : Quiver.Path a b}
{q : Quiver.Path b c}


theorem Ioo_mem_nhdsWithin_Ici (H : b ∈ Ioo a c) : Ioo a c ∈ 𝓝[≥] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{a b c : α}
(H : b ∈ Set.Ioo a c)


protected theorem eq' (hs : IsAntichain r s) {a b : α} (ha : a ∈ s) (hb : b ∈ s) (h : r b a) :
    a = b

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
(hs : IsAntichain r s)
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)
(h : r b a)


lemma generateFrom_memPartition_le_succ (t : ℕ → Set α) (n : ℕ) :
    generateFrom (memPartition t n) ≤ generateFrom (memPartition t (n + 1))

MeasurableSpace.generateFrom (memPartition t n) ≤ MeasurableSpace.generateFrom (memPartition t (n + 1))


theorem continuousAt_inv_infDist_pt (h : x ∉ closure s) :
    ContinuousAt (fun x ↦ (infDist x s)⁻¹) x

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x : α}
(h : x ∉ closure s)

ContinuousAt (fun x => (Metric.infDist x s)⁻¹) x


theorem norm_inf_sub_inf_le_add_norm (a b c d : α) : ‖a ⊓ b - c ⊓ d‖ ≤ ‖a - c‖ + ‖b - d‖

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


@[to_additive]
theorem diff_self : diff ϕ T T = 1

{G : Type u_1}
[Group G]
{H : Subgroup G}
{A : Type u_2}
[CommGroup A]
(ϕ : ↥H →* A)
(T : ↑(Subgroup.leftTransversals ↑H))
[H.FiniteIndex]

Subgroup.leftTransversals.diff ϕ T T = 1


@[to_additive]
theorem inv_le (S T : Submonoid G) : S⁻¹ ≤ T ↔ S ≤ T⁻¹

{G : Type u_2}
[AddGroup G]
(S T : AddSubmonoid G)


@[simp]
lemma hom_inv_id_apply {X Y : TopCat} (f : X ≅ Y) (x : X) : f.inv (f.hom x) = x


@[to_additive]
theorem inv_def : s⁻¹ = s.image fun x => x⁻¹

{α : Type u_2}
[DecidableEq α]
[Inv α]
{s : Finset α}


@[gcongr]
theorem iInf_mono (h : ∀ i, f i ≤ g i) : iInf f ≤ iInf g

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{f g : ι → α}
(h : ∀ (i : ι), f i ≤ g i)


/-- If a function is integrable on a set `s`, and vanishes on `t \ s`, then it is integrable on `t`
if `t` is null-measurable. -/
theorem IntegrableOn.of_ae_diff_eq_zero (hf : IntegrableOn f s μ) (ht : NullMeasurableSet t μ)
    (h't : ∀ᵐ x ∂μ, x ∈ t \ s → f x = 0) : IntegrableOn f t μ

(ht : MeasureTheory.NullMeasurableSet t μ)

(h't : ∀ᵐ (x : α) ∂μ, x ∈ t \ s → f x = 0)


/-- The composition of two lax monoidal functors is again lax monoidal. -/
@[simps]
def comp : LaxMonoidalFunctor.{v₁, v₃} C E

(F : CategoryTheory.LaxMonoidalFunctor C D)

(G : CategoryTheory.LaxMonoidalFunctor D E)

(F ⊗⋙ G).μ X Y = G.μ (F.obj X) (F.obj Y) ≫ G.map (F.μ X Y)


theorem star_eq [Star R] {x : R} (hx : IsSelfAdjoint x) : star x = x

{R : Type u_1}
[Star R]
{x : R}
(hx : IsSelfAdjoint x)


lemma cfcₙ_eq_cfcₙ_iff_eqOn {f g : R → R} {a : A} (ha : p a := by cfc_tac)
    (hf : ContinuousOn f (σₙ R a) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac)
    (hg : ContinuousOn g (σₙ R a) := by cfc_cont_tac) (hg0 : g 0 = 0 := by cfc_zero_tac) :
    cfcₙ f a = cfcₙ g a ↔ (σₙ R a).EqOn f g

cfcₙ f a = cfcₙ g a ↔ Set.EqOn f g (σₙ R a)


/-- Applying a continuous linear map commutes with taking an (infinite) sum. -/
protected theorem ContinuousLinearMap.hasSum {f : ι → M} (φ : M →SL[σ] M₂) {x : M}
    (hf : HasSum f x) : HasSum (fun b : ι ↦ φ (f b)) (φ x)

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


lemma frontier_ball_subset_sphere : frontier (ball x ε) ⊆ sphere x ε

{α : Type u_2}
[PseudoMetricSpace α]
{x : α}
{ε : ℝ}

frontier (Metric.ball x ε) ⊆ Metric.sphere x ε


lemma inv_neg (a : EReal) : (-a)⁻¹ = -a⁻¹


theorem isRat_lt_true [LinearOrderedRing α] [Nontrivial α] : {a b : α} → {na nb : ℤ} → {da db : ℕ} →
    IsRat a na da → IsRat b nb db → decide (na * db < nb * da) → a < b

{α : Type u_1}
[LinearOrderedRing α]
[Nontrivial α]
{a b : α}
{na nb : ℤ}
{da db : ℕ}

Mathlib.Meta.NormNum.IsRat a na da → Mathlib.Meta.NormNum.IsRat b nb db → decide (na * ↑db < nb * ↑da) = true → a < b


@[simp, mfld_simps]
theorem trans_toPartialEquiv :
    (e.trans e').toPartialEquiv = e.toPartialEquiv.trans e'.toPartialEquiv

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

(e.trans e').toPartialEquiv = e.trans e'.toPartialEquiv


theorem Trivialization.smoothWithinAt_iff {f : M → TotalSpace F E} {s : Set M} {x₀ : M}
    (he : f x₀ ∈ e.source) :
    SmoothWithinAt IM (IB.prod 𝓘(𝕜, F)) f s x₀ ↔
      SmoothWithinAt IM IB (fun x => (f x).proj) s x₀ ∧
      SmoothWithinAt IM 𝓘(𝕜, F) (fun x ↦ (e (f x)).2) s x₀

[TopologicalSpace (Bundle.TotalSpace F E)]

{e : Trivialization F Bundle.TotalSpace.proj}

SmoothWithinAt IM (IB.prod 𝓘(𝕜, F)) f s x₀ ↔
  SmoothWithinAt IM IB (fun x => (f x).proj) s x₀ ∧ SmoothWithinAt IM 𝓘(𝕜, F) (fun x => (↑e (f x)).2) s x₀


theorem mem_support_pure_iff : a' ∈ (pure a).support ↔ a' = a


@[elab_as_elim]
protected theorem induction_on {p : Multiset α → Prop} (s : Multiset α) (empty : p 0)
    (cons : ∀ (a : α) (s : Multiset α), p s → p (a ::ₘ s)) : p s


@[simp]
theorem sup'_const (a : α) : s.sup' H (fun _ => a) = a

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


theorem fromBlocks_map (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α)
    (f : α → β) : (fromBlocks A B C D).map f =
      fromBlocks (A.map f) (B.map f) (C.map f) (D.map f)

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
{β : Type u_13}
(A : Matrix n l α)
(B : Matrix n m α)
(C : Matrix o l α)
(D : Matrix o m α)
(f : α → β)

(Matrix.fromBlocks A B C D).map f = Matrix.fromBlocks (A.map f) (B.map f) (C.map f) (D.map f)


@[refl]
theorem Equiv.refl (s : Computation α) : s ~ s


theorem nat_mod : Primrec₂ ((· % ·) : ℕ → ℕ → ℕ)


lemma lie_eq_self_of_isAtom_of_nonabelian {R L : Type*} [CommRing R] [LieRing L] [LieAlgebra R L]
    (I : LieIdeal R L) (hI : IsAtom I) (h : ¬IsLieAbelian I) :
    ⁅I, I⁆ = I

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)
(hI : IsAtom I)
(h : ¬IsLieAbelian ↥↑I)


theorem Filter.Tendsto.isCoboundedUnder_le [NeBot f] (h : Tendsto u f (𝓝 a)) :
    f.IsCoboundedUnder (· ≤ ·) u

{ι : Type u_1}
{α : Type u_2}
[Preorder α]
[TopologicalSpace α]
[BoundedGENhdsClass α]
{f : Filter ι}
{u : ι → α}
{a : α}
[f.NeBot]
(h : Filter.Tendsto u f (𝓝 a))

Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) f u


@[ext]
protected theorem ext {s t : Compacts α} (h : (s : Set α) = t) : s = t

{α : Type u_1}
[TopologicalSpace α]
{s t : TopologicalSpace.Compacts α}
(h : ↑s = ↑t)


@[simp]
theorem upperClosure_eq_top_iff : upperClosure s = ⊤ ↔ s = ∅


@[simp]
theorem cos_pi_sub (x : ℝ) : cos (π - x) = -cos x


lemma nonempty_rightResolution_iff_op (X₂ : C₂) :
    Nonempty (Φ.RightResolution X₂) ↔ Nonempty (Φ.op.LeftResolution (Opposite.op X₂))

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)


lemma ne_last_of_lt {a b : Fin (n + 1)} (hab : a < b) : a ≠ last n


theorem lt_irrefl {α : Type u} [Preorder α] {a : α} : ¬a < a


@[simp]
theorem inr_add [AddZeroClass R] [Add A] (m₁ m₂ : A) : (↑(m₁ + m₂) : Unitization R A) = m₁ + m₂

(R : Type u_3)
{A : Type u_4}
[AddZeroClass R]
[Add A]
(m₁ m₂ : A)


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

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
[AddGroup α]
[VAddCommClass G α α]
(a b : α)

AddAction.stabilizer G (a + b) = AddAction.stabilizer G b


lemma sqrt_le_sqrt : sqrt x ≤ sqrt y ↔ x ≤ y


@[norm_cast] theorem ofNat_dvd {m n : Nat} : (↑m : Int) ∣ ↑n ↔ m ∣ n

↑m ∣ ↑n ↔ m ∣ n


/-- If an invariant measure is inner regular, then it gives the same mass to measurable sets with
compact closure as any other invariant measure, up to the scalar `haarScalarFactor μ' μ`.

Auxiliary lemma in the proof of the more general
`measure_isMulInvariant_eq_smul_of_isCompact_closure`, which works for any set with
compact closure, and removes the inner regularity assumption. -/
@[to_additive measure_isAddInvariant_eq_smul_of_isCompact_closure_of_innerRegularCompactLTTop
" If an invariant measure is inner regular, then it gives the same mass to measurable sets with
compact closure as any other invariant measure, up to the scalar `addHaarScalarFactor μ' μ`.

Auxiliary lemma in the proof of the more general
`measure_isAddInvariant_eq_smul_of_isCompact_closure`, which works for any set with
compact closure, and removes the inner regularity assumption."]
lemma measure_isMulInvariant_eq_smul_of_isCompact_closure_of_innerRegularCompactLTTop
    [LocallyCompactSpace G]
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ']
    [InnerRegularCompactLTTop μ]
    {s : Set G} (hs : MeasurableSet s) (h's : IsCompact (closure s)) :
    μ' s = haarScalarFactor μ' μ • μ s


/-- The **Cantor-Bendixson Theorem**: Any closed subset of a second countable space
can be written as the union of a countable set and a perfect set. -/
theorem exists_countable_union_perfect_of_isClosed [SecondCountableTopology α]
    (hclosed : IsClosed C) : ∃ V D : Set α, V.Countable ∧ Perfect D ∧ C = V ∪ D

{α : Type u_1}
[TopologicalSpace α]
{C : Set α}
[SecondCountableTopology α]
(hclosed : IsClosed C)

∃ V D, V.Countable ∧ Perfect D ∧ C = V ∪ D


@[simp]
theorem toMulBot_coe (x : Multiplicative α) :
    toMulBot ↑x = Multiplicative.ofAdd (↑(Multiplicative.toAdd x) : WithBot α)

{α : Type u}
[Add α]
(x : Multiplicative α)

WithZero.toMulBot ↑x = Multiplicative.ofAdd ↑(Multiplicative.toAdd x)


/-- `A : Matrix V V α` is qualified as an "adjacency matrix" if
    (1) every entry of `A` is `0` or `1`,
    (2) `A` is symmetric,
    (3) every diagonal entry of `A` is `0`. -/
structure IsAdjMatrix [Zero α] [One α] (A : Matrix V V α) : Prop where
  zero_or_one : ∀ i j, A i j = 0 ∨ A i j = 1 := by aesop
  symm : A.IsSymm := by aesop
  apply_diag : ∀ i, A i i = 0 := by aesop

{V : Type u_1}
{α : Type u_2}
[Zero α]
[One α]
{A : Matrix V V α}
(self : A.IsAdjMatrix)
(i : V)


/-- The universal morphism from any other cone to a limit cone. -/
@[simps]
def liftConeMorphism {t : Cone F} (h : IsLimit t) (s : Cone F) : s ⟶ t

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{t : CategoryTheory.Limits.Cone F}
(h : CategoryTheory.Limits.IsLimit t)
(s : CategoryTheory.Limits.Cone F)


theorem frequently_atTop' [SemilatticeSup α] [Nonempty α] [NoMaxOrder α] {p : α → Prop} :
    (∃ᶠ x in atTop, p x) ↔ ∀ a, ∃ b > a, p b

{α : Type u_3}
[SemilatticeSup α]
[Nonempty α]
[NoMaxOrder α]
{p : α → Prop}

(∃ᶠ (x : α) in Filter.atTop, p x) ↔ ∀ (a : α), ∃ b > a, p b


lemma iterate_odd (hf : Involutive f) (hn : Odd n) : f^[n] = f

{α : Type u_5}
{f : α → α}
{n : ℕ}
(hf : Function.Involutive f)
(hn : Odd n)


theorem adjoin_inl_union_inr_eq_prod (s) (t) :
    adjoin R (LinearMap.inl R A B '' (s ∪ {1}) ∪ LinearMap.inr R A B '' (t ∪ {1})) =
      (adjoin R s).prod (adjoin R t)

(R : Type uR)
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(s : Set A)
(t : Set B)

Algebra.adjoin R (⇑(LinearMap.inl R A B) '' (s ∪ {1}) ∪ ⇑(LinearMap.inr R A B) '' (t ∪ {1})) =
  (Algebra.adjoin R s).prod (Algebra.adjoin R t)


theorem Function.Injective.swap_comp
    [DecidableEq α] [DecidableEq β] {f : α → β} (hf : Function.Injective f) (x y : α) :
    Equiv.swap (f x) (f y) ∘ f = f ∘ Equiv.swap x y

{α : Sort u_1}
{β : Sort u_2}
[DecidableEq α]
[DecidableEq β]
{f : α → β}
(hf : Function.Injective f)
(x y : α)

⇑(Equiv.swap (f x) (f y)) ∘ f = f ∘ ⇑(Equiv.swap x y)


@[simp] theorem dite_eq_left_iff {P : Prop} [Decidable P] {B : ¬ P → α} :
    dite P (fun _ => a) B = a ↔ ∀ h, B h = a

{α : Sort u_1}
{a : α}
{P : Prop}
[Decidable P]
{B : ¬P → α}

dite P (fun x => a) B = a ↔ ∀ (h : ¬P), B h = a


theorem subtypeDomain_finsupp_sum {δ : γ → Type x} [DecidableEq γ] [∀ c, Zero (δ c)]
    [∀ (c) (x : δ c), Decidable (x ≠ 0)] [∀ i, AddCommMonoid (β i)] {p : ι → Prop} [DecidablePred p]
    {s : Π₀ c, δ c} {h : ∀ c, δ c → Π₀ i, β i} :
    (s.sum h).subtypeDomain p = s.sum fun c d => (h c d).subtypeDomain p

[(c : γ) → (x : δ c) → Decidable (x ≠ 0)]

DFinsupp.subtypeDomain p (s.sum h) = s.sum fun c d => DFinsupp.subtypeDomain p (h c d)


/-- If an infinite type `β` can be expressed as a union of finite sets,
then the cardinality of the collection of those finite sets
must be at least the cardinality of `β`.
-/
theorem le_range_of_union_finset_eq_top {α β : Type*} [Infinite β] (f : α → Finset β)
    (w : ⋃ a, (f a : Set β) = ⊤) : #β ≤ #(range f)

{α : Type u_2}
{β : Type u_3}
[Infinite β]
(f : α → Finset β)
(w : ⋃ a, ↑(f a) = ⊤)


@[simp] lemma zmultiplesAddHom_symm_apply (f : ℤ →+ β) : (zmultiplesAddHom β).symm f = f 1

(β : Type u_4)
[AddCommGroup β]
(f : ℤ →+ β)


theorem to_int_inj {m n : ZNum} : (m : ℤ) = n ↔ m = n


@[to_additive (attr := simp)]
lemma mk_one [One M] : mk (1 : M) = 1


theorem essentiallySmall_congr {C : Type u} [Category.{v} C] {D : Type u'} [Category.{v'} D]
    (e : C ≌ D) : EssentiallySmall.{w} C ↔ EssentiallySmall.{w} D

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

CategoryTheory.EssentiallySmall.{w, v, u} C ↔ CategoryTheory.EssentiallySmall.{w, v', u'} D


theorem fp_iff_derivFamily (H : ∀ i, IsNormal (f i)) {a} :
    (∀ i, f i a = a) ↔ ∃ o, derivFamily.{u, v} f o = a

{f : ι → Ordinal.{max u v} → Ordinal.{max u v}}

(∀ (i : ι), f i a = a) ↔ ∃ o, Ordinal.derivFamily f o = a


theorem mem_range_of_mem_twoCoboundaries {f : twoCocycles A} (h : f ∈ twoCoboundaries A) :
    (twoCocycles A).subtype f ∈ LinearMap.range (dOne A)

(h : f ∈ groupCohomology.twoCoboundaries A)

(groupCohomology.twoCocycles A).subtype f ∈ LinearMap.range (groupCohomology.dOne A)


lemma zero_zpow_eq (n : ℤ) : (0 : G₀) ^ n = if n = 0 then 1 else 0

{G₀ : Type u_3}
[GroupWithZero G₀]
(n : ℤ)


@[simp]
theorem isPrimal_mk {a : α} : IsPrimal (Associates.mk a) ↔ IsPrimal a


/-- If `f : X → Y` is Lipschitz continuous on `s`, then `dimH (f '' s) ≤ dimH s`. -/
theorem LipschitzOnWith.dimH_image_le (h : LipschitzOnWith K f s) : dimH (f '' s) ≤ dimH s

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
{K : ℝ≥0}
{f : X → Y}
{s : Set X}
(h : LipschitzOnWith K f s)


/-- A measure is called locally finite if it is finite in some neighborhood of each point. -/
class IsLocallyFiniteMeasure [TopologicalSpace α] (μ : Measure α) : Prop where
  finiteAtNhds : ∀ x, μ.FiniteAtFilter (𝓝 x)

[self : MeasureTheory.IsLocallyFiniteMeasure μ]


@[norm_cast] lemma Function.Embedding.coe_sigmaSet {s : ι → Set α} (h) :
    (Function.Embedding.sigmaSet h : ((i : ι) × s i) → α) = fun x ↦ x.2.1

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

⇑(Function.Embedding.sigmaSet h) = fun x => ↑x.snd


theorem writtenInExtChartAt_chartAt_comp [ChartedSpace H H'] (x : M') {y}
    (hy : y ∈ letI := ChartedSpace.comp H H' M'; (extChartAt I x).target) :
    (letI := ChartedSpace.comp H H' M'; writtenInExtChartAt I I x (chartAt H' x) y) = y

{𝕜 : Type u_1}
{E : Type u_2}
{H : Type u_4}
{M' : Type u_6}
{H' : Type u_7}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
[ChartedSpace H H']
(x : M')
{y : E}
(hy : y ∈ (extChartAt I x).target)

writtenInExtChartAt I I x (↑(chartAt H' x)) y = y


lemma _root_.MvPolynomial.isHomogeneous_X_pow (i : σ) (n : ℕ) :
    (X (R := R) i ^ n).IsHomogeneous n

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
(i : σ)
(n : ℕ)


lemma IsPushout.op {sq : Square C} (h : sq.IsPushout) : sq.op.IsPullback

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{sq : CategoryTheory.Square C}
(h : sq.IsPushout)


theorem isIntegral_iff_isIntegral_closure_finite {r : B} :
    IsIntegral R r ↔ ∃ s : Set R, s.Finite ∧ IsIntegral (Subring.closure s) r

{R : Type u_1}
{B : Type u_3}
[CommRing R]
[Ring B]
[Algebra R B]
{r : B}

IsIntegral R r ↔ ∃ s, s.Finite ∧ IsIntegral (↥(Subring.closure s)) r


theorem mem_span_mul_finite_of_mem_span_mul {R A} [Semiring R] [AddCommMonoid A] [Mul A]
    [Module R A] {S : Set A} {S' : Set A} {x : A} (hx : x ∈ span R (S * S')) :
    ∃ T T' : Finset A, ↑T ⊆ S ∧ ↑T' ⊆ S' ∧ x ∈ span R (T * T' : Set A)

{R : Type u_1}
{A : Type u_2}
[Semiring R]
[AddCommMonoid A]
[Mul A]
[Module R A]
{S S' : Set A}
{x : A}
(hx : x ∈ Submodule.span R (S * S'))

∃ T T', ↑T ⊆ S ∧ ↑T' ⊆ S' ∧ x ∈ Submodule.span R (↑T * ↑T')


theorem generateFrom_inter (a b : TopologicalSpace α) :
    generateFrom ({ s | IsOpen[a] s } ∩ { s | IsOpen[b] s }) = a ⊔ b

TopologicalSpace.generateFrom ({s | IsOpen s} ∩ {s | IsOpen s}) = a ⊔ b


@[simp]
theorem LinearMap.clmOfExistsBoundedImage_apply {f : E →ₗ[𝕜] F}
    {h : ∃ V ∈ 𝓝 (0 : E), Bornology.IsVonNBounded 𝕜 (f '' V)} {x : E} :
    f.clmOfExistsBoundedImage h x = f x

{h : ∃ V ∈ 𝓝 0, Bornology.IsVonNBounded 𝕜 (⇑f '' V)}


@[trans]
theorem le_of_equiv_of_le {x y z : PGame} (h₁ : x ≈ y) : y ≤ z → x ≤ z


theorem Ioo_subset_Ioc_union_Ico : Ioo a c ⊆ Ioc a b ∪ Ico b c

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


protected theorem Nodup.sym (n : ℕ) {xs : List α} (h : xs.Nodup) : (xs.sym n).Nodup

{α : Type u_1}
(n : ℕ)
{xs : List α}
(h : xs.Nodup)


theorem not_ne_iff {α : Sort*} {a b : α} : ¬a ≠ b ↔ a = b


@[simp]
theorem coe_quotLeftToQuotSupₐ : ⇑(quotLeftToQuotSupₐ R I J) = quotLeftToQuotSup I J

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(I J : Ideal A)

⇑(DoubleQuot.quotLeftToQuotSupₐ R I J) = ⇑(DoubleQuot.quotLeftToQuotSup I J)


/-- See `lt_of_tsub_lt_tsub_right_of_le` for a weaker statement in a partial order. -/
theorem lt_of_tsub_lt_tsub_right (h : a - c < b - c) : a < b

{α : Type u_1}
{a b c : α}
[LinearOrder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
(h : a - c < b - c)


theorem LowerSemicontinuous.isClosed_preimage {f : α → γ} (hf : LowerSemicontinuous f) (y : γ) :
    IsClosed (f ⁻¹' Iic y)

{α : Type u_1}
[TopologicalSpace α]
{γ : Type u_3}
[LinearOrder γ]
{f : α → γ}
(hf : LowerSemicontinuous f)
(y : γ)


/-- Definition of the infimum of two congruence relations. -/
@[to_additive "Definition of the infimum of two additive congruence relations."]
theorem inf_iff_and {c d : Con M} {x y} : (c ⊓ d) x y ↔ c x y ∧ d x y

{M : Type u_1}
[Mul M]
{c d : Con M}
{x y : M}


/-- This lemma is superseded by `Submartingale.bddAbove_iff_exists_tendsto`. -/
theorem Submartingale.exists_tendsto_of_abs_bddAbove_aux [IsFiniteMeasure μ]
    (hf : Submartingale f ℱ μ) (hf0 : f 0 = 0) (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) :
    ∀ᵐ ω ∂μ, BddAbove (Set.range fun n => f n ω) → ∃ c, Tendsto (fun n => f n ω) atTop (𝓝 c)

{f : ℕ → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

(hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R)

∀ᵐ (ω : Ω) ∂μ, BddAbove (Set.range fun n => f n ω) → ∃ c, Filter.Tendsto (fun n => f n ω) Filter.atTop (𝓝 c)


@[simp]
theorem sdiff_val (s₁ s₂ : Finset α) : (s₁ \ s₂).val = s₁.val - s₂.val

{α : Type u_1}
[DecidableEq α]
(s₁ s₂ : Finset α)


@[to_additive]
theorem apply_coe_mem_map (f : F) (S : Submonoid M) (x : S) : f x ∈ S.map f

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
(f : F)
(S : AddSubmonoid M)
(x : ↥S)


lemma image_sups (f : F) (s t : Finset α) : image f (s ⊻ t) = image f s ⊻ image f t

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[DecidableEq β]
[SemilatticeSup α]
[SemilatticeSup β]
[FunLike F α β]
[SupHomClass F α β]
(f : F)
(s t : Finset α)

Finset.image (⇑f) (s ⊻ t) = Finset.image (⇑f) s ⊻ Finset.image (⇑f) t


theorem continuousAt_iff'_right [TopologicalSpace β] {f : β → α} {b : β} :
    ContinuousAt f b ↔ Tendsto (fun x => (f b, f x)) (𝓝 b) (𝓤 α)

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[TopologicalSpace β]
{f : β → α}
{b : β}

ContinuousAt f b ↔ Filter.Tendsto (fun x => (f b, f x)) (𝓝 b) (𝓤 α)


lemma coe_edge_down_toOrderHom (n : ℕ) (a b : Fin (n+1)) (hab : a ≤ b) :
    ↑(edge n a b hab).down.toOrderHom = ![a, b]

(n : ℕ)
(a b : Fin (n + 1))
(hab : a ≤ b)

⇑(SimplexCategory.Hom.toOrderHom (SSet.standardSimplex.edge n a b hab).down) = ![a, b]


/-- `≤` implies not `>` for lists. -/
theorem le_eq_not_gt [LT α] : ∀ l₁ l₂ : List α, (l₁ ≤ l₂) = ¬l₂ < l₁


theorem eventually_filterAt_subset_of_nhds {x : α} {o : Set α} (hx : o ∈ 𝓝 x) :
    ∀ᶠ a in v.filterAt x, a ⊆ o

{α : Type u_1}
[MetricSpace α]
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(v : VitaliFamily μ)
{x : α}
{o : Set α}
(hx : o ∈ 𝓝 x)


theorem if_ctx_simp_congr_prop {b c x y u v : Prop} [Decidable b] (h_c : b ↔ c) (h_t : c → (x ↔ u))
    -- FIXME: after https://github.com/leanprover/lean4/issues/1867 is fixed,
    -- this should be changed back to:
    -- (h_e : ¬c → (y ↔ v)) : ite b x y ↔ ite c (h := decidable_of_decidable_of_iff h_c) u v :=
    (h_e : ¬c → (y ↔ v)) : ite b x y ↔ @ite _ c (decidable_of_decidable_of_iff h_c) u v

{b c x y u v : Prop}
[Decidable b]
(h_c : b ↔ c)
(h_t : c → (x ↔ u))
(h_e : ¬c → (y ↔ v))

(if b then x else y) ↔ if c then u else v


/-- The application of continuous functions as a continuous function.  -/
@[simps]
def apply : (α →𝒄 β) × α →𝒄 β

{α : Type u}
{β : Type v}
[OmegaCompletePartialOrder α]
[OmegaCompletePartialOrder β]
(f : (α →𝒄 β) × α)

OmegaCompletePartialOrder.ContinuousHom.Prod.apply f = f.1 f.2


theorem cos_periodic : Function.Periodic cos (2 * π)

Function.Periodic Real.cos (2 * Real.pi)


@[simp]
theorem realize_liftAt {n n' m : ℕ} {t : L.Term (α ⊕ (Fin n))} {v : α ⊕ (Fin (n + n')) → M} :
    (t.liftAt n' m).realize v =
      t.realize (v ∘ Sum.map id fun i : Fin _ =>
        if ↑i < m then Fin.castAdd n' i else Fin.addNat i n')

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{n n' m : ℕ}
{t : L.Term (α ⊕ Fin n)}
{v : α ⊕ Fin (n + n') → M}

FirstOrder.Language.Term.realize v (FirstOrder.Language.Term.liftAt n' m t) =
  FirstOrder.Language.Term.realize (v ∘ Sum.map id fun i => if ↑i < m then Fin.castAdd n' i else i.addNat n') t


theorem finite_setOf_add_order_eq {n : ℕ} (hn : 0 < n) :
    { u : AddCircle p | addOrderOf u = n }.Finite

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
(p : 𝕜)
[hp : Fact (0 < p)]
{n : ℕ}
(hn : 0 < n)


@[simp]
lemma LinearMap.extendScalarsOfSurjective_apply (l : M →ₗ[R] N) (x) :
    l.extendScalarsOfSurjective h x = l x

(h : Function.Surjective ⇑(algebraMap R S))

(LinearMap.extendScalarsOfSurjective h l) x = l x


theorem subset_insert_iff_of_not_mem (ha : a ∉ s) : s ⊆ insert a t ↔ s ⊆ t

{α : Type u}
{a : α}
{s t : Set α}
(ha : a ∉ s)


theorem mem_map (f : α → β) {a : α} {s : WSeq α} : a ∈ s → f a ∈ map f s

{α : Type u}
{β : Type v}
(f : α → β)
{a : α}
{s : Stream'.WSeq α}


/--
Swap the direction of a `RingHomInvPair`. This is not an instance as it would loop, and better
instances are often available and may often be preferrable to using this one. Indeed, this
declaration is not currently used in mathlib.
-/
theorem symm (σ₁₂ : R₁ →+* R₂) (σ₂₁ : R₂ →+* R₁) [RingHomInvPair σ₁₂ σ₂₁] :
    RingHomInvPair σ₂₁ σ₁₂

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
(σ₁₂ : R₁ →+* R₂)
(σ₂₁ : R₂ →+* R₁)
[RingHomInvPair σ₁₂ σ₂₁]


theorem factors_spec (a : R) (h : a ≠ 0) :
    (∀ b ∈ factors a, Irreducible b) ∧ Associated (factors a).prod a

{R : Type u}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]
(a : R)
(h : a ≠ 0)

(∀ b ∈ PrincipalIdealRing.factors a, Irreducible b) ∧ Associated (PrincipalIdealRing.factors a).prod a


@[simp]
theorem limit.homIso_hom (F : J ⥤ C) [HasLimit F] {W : C} (f : ULift (W ⟶ limit F)) :
    (limit.homIso F W).hom f = (const J).map f.down ≫ (limit.cone F).π

(f : ULift.{u₁, v} (W ⟶ CategoryTheory.Limits.limit F))

(CategoryTheory.Limits.limit.homIso F W).hom f =
  (CategoryTheory.Functor.const J).map f.down ≫ (CategoryTheory.Limits.limit.cone F).π


lemma isHomological_of_localization (L : C ⥤ D)
    [L.CommShift ℤ] [L.IsTriangulated] [L.mapArrow.EssSurj] (F : D ⥤ A)
    (G : C ⥤ A) (e : L ⋙ F ≅ G) [G.IsHomological] :
    F.IsHomological

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

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


@[to_additive]
lemma unit_eq_unit_of_mem_ofUnits (S : Subgroup Mˣ) {x : M} (h₁ : IsUnit x)
    (h₂ : x ∈ S.ofUnits) : h₁.unit = S.unit_of_mem_ofUnits h₂

{M : Type u_1}
[AddMonoid M]
(S : AddSubgroup (AddUnits M))
{x : M}
(h₁ : IsAddUnit x)
(h₂ : x ∈ S.ofAddUnits)

h₁.addUnit = S.addUnit_of_mem_ofAddUnits h₂


@[simp]
theorem logb_le_logb_of_base_lt_one (h : 0 < x) (h₁ : 0 < y) : logb b x ≤ logb b y ↔ y ≤ x


lemma Derives.trans_produces {u v w : List (Symbol T g.NT)}
    (huv : g.Derives u v) (hvw : g.Produces v w) :
    g.Derives u w

{T : Type uT}
{g : ContextFreeGrammar T}
{u v w : List (Symbol T g.NT)}
(huv : g.Derives u v)
(hvw : g.Produces v w)


theorem _root_.absorbent_iff_forall_absorbs_singleton : Absorbent M s ↔ ∀ x, Absorbs M s {x}

{M : Type u_1}
{α : Type u_2}
[Bornology M]
[SMul M α]
{s : Set α}

Absorbent M s ↔ ∀ (x : α), Absorbs M s {x}


theorem Chain'.right_of_append (h : Chain' R (l₁ ++ l₂)) : Chain' R l₂

{α : Type u}
{R : α → α → Prop}
{l₁ l₂ : List α}
(h : List.Chain' R (l₁ ++ l₂))


theorem image_image2 (f : α → β → γ) (g : γ → δ) :
    g '' image2 f s t = image2 (fun a b => g (f a b)) s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{δ : Type u_7}
{s : Set α}
{t : Set β}
(f : α → β → γ)
(g : γ → δ)

g '' Set.image2 f s t = Set.image2 (fun a b => g (f a b)) s t


lemma _root_.MonoidHom.compAddChar_injective_right (f : M →* N) (hf : Injective f) :
    Injective fun ψ : AddChar B M ↦ f.compAddChar ψ

{B : Type u_2}
{M : Type u_3}
{N : Type u_4}
[AddMonoid B]
[Monoid M]
[Monoid N]
(f : M →* N)
(hf : Function.Injective ⇑f)

Function.Injective fun ψ => f.compAddChar ψ


/-- A type bundled with the structure induced by an equivalence. -/
@[simps]
def bundledInduced : CategoryTheory.Bundled.{w'} L.Structure

(L : FirstOrder.Language)
{M : Type w}
[L.Structure M]
{N : Type w'}
(g : M ≃ N)

(Equiv.bundledInduced L g).str = g.inducedStructure


@[simp]
theorem aeval_eq (h : IsAdjoinRoot S f) (p : R[X]) : aeval h.root p = h.map p

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRoot S f)
(p : R[X])


@[to_additive]
theorem singleton_div_singleton : ({a} : Set α) / {b} = {a / b}


@[simp]
theorem toIocDiv_sub (a b : α) : toIocDiv hp a (b - p) = toIocDiv hp a b - 1

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


@[to_additive]
theorem sup_eq_closure_mul (H K : Submonoid M) : H ⊔ K = closure ((H : Set M) * (K : Set M))

{M : Type u_3}
[AddMonoid M]
(H K : AddSubmonoid M)


theorem gal_mul_isSolvable {p q : F[X]} (_ : IsSolvable p.Gal) (_ : IsSolvable q.Gal) :
    IsSolvable (p * q).Gal

IsSolvable p.Gal → IsSolvable q.Gal → IsSolvable (p * q).Gal


/-- For any circle integrable function `f`, the power series `cauchyPowerSeries f c R`, `R > 0`,
converges to the Cauchy integral `(2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - w)⁻¹ • f z` on the open
disc `Metric.ball c R`. -/
theorem sum_cauchyPowerSeries_eq_integral {f : ℂ → E} {c : ℂ} {R : ℝ} {w : ℂ}
    (hf : CircleIntegrable f c R) (hw : abs w < R) :
    (cauchyPowerSeries f c R).sum w = (2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - (c + w))⁻¹ • f z

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : ℂ → E}
{c : ℂ}
{R : ℝ}
{w : ℂ}
(hf : CircleIntegrable f c R)
(hw : Complex.abs w < R)

(cauchyPowerSeries f c R).sum w = (2 * ↑π * Complex.I)⁻¹ • ∮ (z : ℂ) in C(c, R), (z - (c + w))⁻¹ • f z


/-- The embedding `α → FreeSemigroup α`. -/
@[to_additive (attr := simps) "The embedding `α → FreeAddSemigroup α`."]
def of (x : α) : FreeSemigroup α


theorem of_surjective (f : A →+* B) (hf : Surjective f) : f.FiniteType

{A : Type u_1}
{B : Type u_2}
[CommRing A]
[CommRing B]
(f : A →+* B)
(hf : Function.Surjective ⇑f)


lemma Monovary.div_left₀ (hf₁ : 0 ≤ f₁) (hf₂ : StrongLT 0 f₂) (h₁ : Monovary f₁ g)
    (h₂ : Antivary f₂ g) : Monovary (f₁ / f₂) g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemifield α]
[LinearOrderedSemifield β]
{f₁ f₂ : ι → α}
{g : ι → β}
(hf₁ : 0 ≤ f₁)
(hf₂ : StrongLT 0 f₂)
(h₁ : Monovary f₁ g)
(h₂ : Antivary f₂ g)


lemma Dvd.dvd.even (hab : a ∣ b) (ha : Even a) : Even b

{α : Type u_2}
[Semiring α]
{a b : α}
(hab : a ∣ b)
(ha : Even a)


protected theorem coe_zero : ((0 : S) : A) = 0

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
{S : NonUnitalSubalgebra R A}


theorem map_filterMap_of_inv (f : α → Option β) (g : β → α) (H : ∀ x : α, (f x).map g = some x)
    (s : Multiset α) : map g (filterMap f s) = s

(H : ∀ (x : α), Option.map g (f x) = some x)

Multiset.map g (Multiset.filterMap f s) = s


@[simp] lemma comap_emptyOn (f : α → β) : comap (emptyOn β) f = emptyOn α

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

(Matroid.emptyOn β).comap f = Matroid.emptyOn α


@[simp, norm_cast]
theorem id'_coe {σ : R →+* R} [RingHomId σ] : ((id' : M →ₛₗ[σ] M) : M → M) = _root_.id

{R : Type u_1}
{M : Type u_9}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{σ : R →+* R}
[RingHomId σ]


/-- See `rank_lt_aleph0` for the inverse direction without `Module.Free R M`. -/
lemma Module.rank_lt_alpeh0_iff :
    Module.rank R M < ℵ₀ ↔ Module.Finite R M

{R : Type u}
{M : Type v}
[Ring R]
[StrongRankCondition R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]


/-- Summability of the `p`-series over `ℤ`. -/
theorem summable_one_div_int_pow {p : ℕ} :
    (Summable fun n : ℤ ↦ 1 / (n : ℝ) ^ p) ↔ 1 < p


theorem finsupport_subset_fintsupport : ρ.finsupport x₀ ⊆ ρ.fintsupport x₀

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(ρ : SmoothPartitionOfUnity ι I M s)
(x₀ : M)


theorem IsBigOWith.prod_rightl (h : IsBigOWith c l f g') (hc : 0 ≤ c) :
    IsBigOWith c l f fun x => (g' x, k' x)

{α : Type u_1}
{E : Type u_3}
{F' : Type u_7}
{G' : Type u_8}
[Norm E]
[SeminormedAddCommGroup F']
[SeminormedAddCommGroup G']
{c : ℝ}
{f : α → E}
{g' : α → F'}
(k' : α → G')
{l : Filter α}
(h : Asymptotics.IsBigOWith c l f g')
(hc : 0 ≤ c)

Asymptotics.IsBigOWith c l f fun x => (g' x, k' x)


/-- `F.mapTriangle` commutes with the inverse of the rotation of triangles. -/
@[simps!]
noncomputable def mapTriangleInvRotateIso [F.Additive] :
    F.mapTriangle ⋙ Pretriangulated.invRotate D ≅
      Pretriangulated.invRotate C ⋙ F.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

(F.mapTriangleInvRotateIso.inv.app X).hom₁ = (F.commShiftIso (-1)).hom.app X.obj₃


@[simp]
theorem ContinuousLinearEquiv.uniqueDiffOn_preimage_iff (e : F ≃L[𝕜] E) :
    UniqueDiffOn 𝕜 (e ⁻¹' s) ↔ UniqueDiffOn 𝕜 s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
(e : F ≃L[𝕜] E)

UniqueDiffOn 𝕜 (⇑e ⁻¹' s) ↔ UniqueDiffOn 𝕜 s


/-- If the union of disjoint measurable sets has finite measure, then there are only
finitely many members of the union whose measure exceeds any given positive number. -/
theorem finite_const_le_meas_of_disjoint_iUnion {ι : Type*} [MeasurableSpace α] (μ : Measure α)
    {ε : ℝ≥0∞} (ε_pos : 0 < ε) {As : ι → Set α} (As_mble : ∀ i : ι, MeasurableSet (As i))
    (As_disj : Pairwise (Disjoint on As)) (Union_As_finite : μ (⋃ i, As i) ≠ ∞) :
    Set.Finite { i : ι | ε ≤ μ (As i) }

(As_mble : ∀ (i : ι), MeasurableSet (As i))


theorem tendsto_principal_principal {f : α → β} {s : Set α} {t : Set β} :
    Tendsto f (𝓟 s) (𝓟 t) ↔ ∀ a ∈ s, f a ∈ t

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

Filter.Tendsto f (𝓟 s) (𝓟 t) ↔ ∀ a ∈ s, f a ∈ t


theorem dist_lt_add_of_nonempty_closedBall_inter_ball (h : (closedBall x ε₁ ∩ ball y ε₂).Nonempty) :
    dist x y < ε₁ + ε₂

(h : (Metric.closedBall x ε₁ ∩ Metric.ball y ε₂).Nonempty)


theorem count_mono {I J} (hI : I ≠ 0) (h : I ≤ J) : count K v J ≤ count K v I

(v : IsDedekindDomain.HeightOneSpectrum R)

FractionalIdeal.count K v J ≤ FractionalIdeal.count K v I


/-- When you take a set `U` in `α`, push it down to the quotient, and pull back, you get the union
of the orbit of `U` under `G`. -/
@[to_additive
      "When you take a set `U` in `α`, push it down to the quotient, and pull back, you get the
      union of the orbit of `U` under `G`."]
theorem quotient_preimage_image_eq_union_mul (U : Set α) :
    letI := orbitRel G α
    Quotient.mk' ⁻¹' (Quotient.mk' '' U) = ⋃ g : G, (g • ·) '' U

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
(U : Set α)

Quotient.mk' ⁻¹' (Quotient.mk' '' U) = ⋃ g, (fun x => g • x) '' U


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

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

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

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

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

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


@[simp]
theorem mk_embedding (w : InfinitePlace K) : mk (embedding w) = w

{K : Type u_2}
[Field K]
(w : NumberField.InfinitePlace K)

NumberField.InfinitePlace.mk w.embedding = w


/-- Scalar product of two infinites sums indexed by arbitrary types. -/
theorem tsum_smul_tsum (hf : Summable f) (hg : Summable g)
    (hfg : Summable fun x : ι × κ ↦ f x.1 • g x.2) :
    ((∑' x, f x) • ∑' y, g y) = ∑' z : ι × κ, f z.1 • g z.2

{ι : Type u_5}
{κ : Type u_6}
{R : Type u_7}
{M : Type u_9}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace R]
[TopologicalSpace M]
[T3Space M]
[ContinuousAdd M]
[ContinuousSMul R M]
{f : ι → R}
{g : κ → M}
(hf : Summable f)
(hg : Summable g)
(hfg : Summable fun x => f x.1 • g x.2)


/-- The category of actions of `G` in the category `V`
is equivalent to the functor category `singleObj G ⥤ V`.
-/
@[simps]
def functorCategoryEquivalence : Action V G ≌ SingleObj G ⥤ V

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
(G : MonCat)

(Action.functorCategoryEquivalence V G).functor = Action.FunctorCategoryEquivalence.functor


theorem exists_ne_of_one_lt_ncard (hs : 1 < s.ncard) (a : α) : ∃ b, b ∈ s ∧ b ≠ a

{α : Type u_1}
{s : Set α}
(hs : 1 < s.ncard)
(a : α)


/-- This lemma is superceded by `uniformIntegrable_of` which only requires
`AEStronglyMeasurable`. -/
theorem uniformIntegrable_of' [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
    (hf : ∀ i, StronglyMeasurable (f i))
    (h : ∀ ε : ℝ, 0 < ε → ∃ C : ℝ≥0,
      ∀ i, eLpNorm ({ x | C ≤ ‖f i x‖₊ }.indicator (f i)) p μ ≤ ENNReal.ofReal ε) :
    UniformIntegrable f p μ

{f : ι → α → β}

(hf : ∀ (i : ι), MeasureTheory.StronglyMeasurable (f i))

(h :
  ∀ (ε : ℝ), 0 < ε → ∃ C, ∀ (i : ι), MeasureTheory.eLpNorm ({x | C ≤ ‖f i x‖₊}.indicator (f i)) p μ ≤ ENNReal.ofReal ε)


theorem isTopologicalBasis_subtype
    {α : Type*} [TopologicalSpace α] {B : Set (Set α)}
    (h : TopologicalSpace.IsTopologicalBasis B) (p : α → Prop) :
    IsTopologicalBasis (Set.preimage (Subtype.val (p := p)) '' B)

TopologicalSpace.IsTopologicalBasis (Set.preimage Subtype.val '' B)


@[simp] theorem findSome?_map (f : β → γ) (l : List β) : findSome? p (l.map f) = l.findSome? (p ∘ f)

∀ {α : Type u_3} {p : γ → Option α} (f : β → γ) (l : List β), List.findSome? p (List.map f l) = List.findSome? (p ∘ f) l


/-- In a pseudo metric space with a conditionally complete linear order such that the order and the
    metric structure give the same topology, any order-bounded set is metric-bounded. -/
theorem isBounded_of_bddAbove_of_bddBelow {s : Set α} (h₁ : BddAbove s) (h₂ : BddBelow s) :
    IsBounded s

{α : Type u}
[PseudoMetricSpace α]
[Preorder α]
[CompactIccSpace α]
{s : Set α}
(h₁ : BddAbove s)
(h₂ : BddBelow s)


theorem eq_iff_atom_le_iff {α} [BooleanAlgebra α] [IsAtomic α] {x y : α} :
    x = y ↔ ∀ a, IsAtom a → (a ≤ x ↔ a ≤ y)

{α : Type u_4}
[BooleanAlgebra α]
[IsAtomic α]
{x y : α}

x = y ↔ ∀ (a : α), IsAtom a → (a ≤ x ↔ a ≤ y)


theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt 𝕜 f x) {n : ℕ∞} :
    ContDiffAt 𝕜 n f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
[CompleteSpace F]
(h : AnalyticAt 𝕜 f x)
{n : ℕ∞}


theorem sheafification_map {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) :
    (sheafification J D).map η = sheafifyMap J η

(J : CategoryTheory.GrothendieckTopology C)

(CategoryTheory.sheafification J D).map η = CategoryTheory.sheafifyMap J η


theorem bernoulli'_def' (n : ℕ) :
    bernoulli' n = 1 - ∑ k : Fin n, n.choose k / (n - k + 1) * bernoulli' k

bernoulli' n = 1 - ∑ k : Fin n, ↑(n.choose ↑k) / (↑n - ↑↑k + 1) * bernoulli' ↑k


theorem eventually_nhdsWithin_of_forall {s : Set α} {a : α} {p : α → Prop} (h : ∀ x ∈ s, p x) :
    ∀ᶠ x in 𝓝[s] a, p x

{α : Type u_1}
[TopologicalSpace α]
{s : Set α}
{a : α}
{p : α → Prop}
(h : ∀ x ∈ s, p x)


theorem lt_mem_sets_of_limsSup_lt (h : f.IsBounded (· ≤ ·)) (l : f.limsSup < b) :
    ∀ᶠ a in f, a < b

(h : Filter.IsBounded (fun x x_1 => x ≤ x_1) f)


@[simp]
theorem comap_top (f : R →+* S) : (⊤ : Subring S).comap f = ⊤

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


theorem UInt64.ext_iff {x y : UInt64} : x = y ↔ x.toNat = y.toNat


theorem min_bot_right [OrderBot α] (a : α) : min a ⊥ = ⊥

{α : Type u}
[LinearOrder α]
[OrderBot α]
(a : α)


theorem succ_descFactorial (n : ℕ) :
    ∀ k, (n + 1 - k) * (n + 1).descFactorial k = (n + 1) * n.descFactorial k


@[simp]
nonrec theorem integral_smul_const {𝕜 : Type*} [RCLike 𝕜] [NormedSpace 𝕜 E] (f : ℝ → 𝕜) (c : E) :
    ∫ x in a..b, f x • c ∂μ = (∫ x in a..b, f x ∂μ) • c

{E : Type u_3}
[NormedAddCommGroup E]
[CompleteSpace E]
[NormedSpace ℝ E]
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
{𝕜 : Type u_6}
[RCLike 𝕜]
[NormedSpace 𝕜 E]
(f : ℝ → 𝕜)
(c : E)

∫ (x : ℝ) in a..b, f x • c ∂μ = (∫ (x : ℝ) in a..b, f x ∂μ) • c


theorem lift_apply_apply (fe : {_fe : (A →ₐ[R] B) × B // _}) (a : A[ε]) :
    lift fe a = fe.val.1 a.fst + fe.val.1 a.snd * fe.val.2

(DualNumber.lift fe) a = (↑fe).1 (TrivSqZeroExt.fst a) + (↑fe).1 (TrivSqZeroExt.snd a) * (↑fe).2


theorem le_span_singleton_mul_iff {x : R} {I J : Ideal R} :
    I ≤ span {x} * J ↔ ∀ zI ∈ I, ∃ zJ ∈ J, x * zJ = zI

{R : Type u}
[CommSemiring R]
{x : R}
{I J : Ideal R}

I ≤ Ideal.span {x} * J ↔ ∀ zI ∈ I, ∃ zJ ∈ J, x * zJ = zI


lemma normal_iff_forall_map_le : Normal F K ↔ ∀ σ : L →ₐ[F] L, K.map σ ≤ K

{F : Type u_1}
{L : Type u_3}
[Field F]
[Field L]
[Algebra F L]
[Normal F L]
{K : IntermediateField F L}

Normal F ↥K ↔ ∀ (σ : L →ₐ[F] L), IntermediateField.map σ K ≤ K


@[simps add]
instance instAdd [Preadditive C] {P Q : Karoubi C} : Add (P ⟶ Q)

{P Q : CategoryTheory.Idempotents.Karoubi C}


@[to_additive]
theorem mulSupport_mulSingle [DecidableEq B] :
    mulSupport (mulSingle a b) = if b = 1 then ∅ else {a}

{A : Type u_1}
{B : Type u_2}
[DecidableEq A]
[One B]
{a : A}
{b : B}
[DecidableEq B]

Function.mulSupport (Pi.mulSingle a b) = if b = 1 then ∅ else {a}


@[simp]
theorem mk'_linear (f : P1 → P2) (f' : V1 →ₗ[k] V2) (p h) : (mk' f f' p h).linear = f'


theorem maximals_swap : maximals (swap r) s = minimals r s

{α : Type u_1}
(r : α → α → Prop)
(s : Set α)

maximals (Function.swap r) s = minimals r s


theorem injOn_tan : InjOn tan (Ioo (-(π / 2)) (π / 2))

Set.InjOn Real.tan (Set.Ioo (-(Real.pi / 2)) (Real.pi / 2))


theorem ae_eq_zero_restrict_of_forall_setIntegral_eq_zero_real {f : α → ℝ}
    (hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
    (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = 0) {t : Set α}
    (ht : MeasurableSet t) (hμt : μ t ≠ ∞) : f =ᵐ[μ.restrict t] 0

(hf_int_finite : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → MeasureTheory.IntegrableOn f s μ)

(hf_zero : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∫ (x : α) in s, f x ∂μ = 0)


@[to_additive]
theorem mrange_inl' : mrange (inl M N) = comap (snd M N) ⊥

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

AddMonoidHom.mrange (AddMonoidHom.inl M N) = AddSubmonoid.comap (AddMonoidHom.snd M N) ⊥


@[to_additive (attr := simp)]
theorem one_subset : (1 : Finset α) ⊆ s ↔ (1 : α) ∈ s


@[fun_prop]
theorem DifferentiableWithinAt.pow (ha : DifferentiableWithinAt 𝕜 a s x) :
    ∀ n : ℕ, DifferentiableWithinAt 𝕜 (fun x => a x ^ n) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s : Set E}
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a : E → 𝔸}
(ha : DifferentiableWithinAt 𝕜 a s x)
(n : ℕ)


theorem reverse_eq_iff {t t' : RBNode α} : t.reverse = t' ↔ t = t'.reverse

{α : Type u_1}
{t t' : Batteries.RBNode α}


theorem fderivWithin_sinh (hf : DifferentiableWithinAt ℝ f s x) (hxs : UniqueDiffWithinAt ℝ s x) :
    fderivWithin ℝ (fun x => Real.sinh (f x)) s x = Real.cosh (f x) • fderivWithin ℝ f s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt ℝ f s x)
(hxs : UniqueDiffWithinAt ℝ s x)


/-- Multiplicativity of the ideal norm in number rings. -/
theorem cardQuot_mul [IsDedekindDomain S] [Module.Free ℤ S] (I J : Ideal S) :
    cardQuot (I * J) = cardQuot I * cardQuot J

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

Submodule.cardQuot (I * J) = Submodule.cardQuot I * Submodule.cardQuot J


@[simp, norm_cast] lemma coe_pow (f : Monoid.End M) (n : ℕ) : (↑(f ^ n) : M → M) = f^[n]

(M : Type u_4)
[MulOneClass M]
(f : Monoid.End M)
(n : ℕ)


@[simp] theorem specializes_eq_eq [T1Space X] : (· ⤳ ·) = @Eq X

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]


theorem isPrenex_toPrenexImpRight {φ ψ : L.BoundedFormula α n} (hφ : IsQF φ) (hψ : IsPrenex ψ) :
    IsPrenex (φ.toPrenexImpRight ψ)

{L : FirstOrder.Language}
{α : Type u'}
{n : ℕ}
{φ ψ : L.BoundedFormula α n}
(hφ : φ.IsQF)
(hψ : ψ.IsPrenex)


@[to_additive (attr := simp)]
theorem zpow_period_add_smul (i : ℤ) (g : G) (a : α) :
    g ^ (period g a + i) • a = g ^ i • a

{α : Type v}
{G : Type u}
[Group G]
[MulAction G α]
(i : ℤ)
(g : G)
(a : α)

g ^ (↑(MulAction.period g a) + i) • a = g ^ i • a


theorem insertNth_last (x : α (last n)) (p : ∀ j : Fin n, α ((last n).succAbove j)) :
    insertNth (last n) x p =
      snoc (fun j ↦ _root_.cast (congr_arg α (succAbove_last_apply j)) (p j)) x

(p : (j : Fin n) → α ((Fin.last n).succAbove j))

(Fin.last n).insertNth x p = Fin.snoc (fun j => cast ⋯ (p j)) x


@[simps]
instance : MonoidalCategoryStruct (FullSubcategory P)

(CategoryTheory.MonoidalCategory.rightUnitor X).inv = (CategoryTheory.MonoidalCategory.rightUnitor X.obj).inv


theorem powHalf_succ_le_powHalf (n : ℕ) : powHalf (n + 1) ≤ powHalf n

SetTheory.PGame.powHalf (n + 1) ≤ SetTheory.PGame.powHalf n


@[reassoc]
lemma mapBifunctorLeftUnitor_naturality :
    mapBifunctorMapMap F p (𝟙 _) φ ≫ (mapBifunctorLeftUnitor F X e p hp Y').hom =
      (mapBifunctorLeftUnitor F X e p hp Y).hom ≫ φ

(F : CategoryTheory.Functor C (CategoryTheory.Functor D D))

(e : F.obj X ≅ CategoryTheory.Functor.id D)

[(Y : D) → CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C) (F.flip.obj Y)]

{Y Y' : CategoryTheory.GradedObject J D}

[(((CategoryTheory.GradedObject.mapBifunctor F I J).obj ((CategoryTheory.GradedObject.single₀ I).obj X)).obj Y).HasMap
    p]

[(((CategoryTheory.GradedObject.mapBifunctor F I J).obj ((CategoryTheory.GradedObject.single₀ I).obj X)).obj Y').HasMap
    p]

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.GradedObject.mapBifunctorMapMap F p
      (CategoryTheory.CategoryStruct.id ((CategoryTheory.GradedObject.single₀ I).obj X)) φ)
    (CategoryTheory.GradedObject.mapBifunctorLeftUnitor F X e p hp Y').hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.mapBifunctorLeftUnitor F X e p hp Y).hom φ


theorem AntivaryOn.comp_antitoneOn_right (h : AntivaryOn f g s) (hg : AntitoneOn g' (g '' s)) :
    MonovaryOn f (g' ∘ g) s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Preorder α]
[LinearOrder β]
[Preorder γ]
{f : ι → α}
{g : ι → β}
{g' : β → γ}
{s : Set ι}
(h : AntivaryOn f g s)
(hg : AntitoneOn g' (g '' s))


@[to_additive]
theorem isUnit_singleton (a : α) : IsUnit ({a} : Finset α)

{α : Type u_2}
[DecidableEq α]
[Group α]
(a : α)


/-- If `α` is a nonempty preorder with no minimal elements, then there exists a strictly antitone
function `ℕ → α`. -/
theorem exists_strictAnti [Nonempty α] [NoMinOrder α] : ∃ f : ℕ → α, StrictAnti f

(α : Type u)
[Preorder α]
[Nonempty α]
[NoMinOrder α]


@[reassoc (attr := simp)]
theorem Cofork.condition (t : Cofork f g) : f ≫ t.π = g ≫ t.π

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

CategoryTheory.CategoryStruct.comp f t.π = CategoryTheory.CategoryStruct.comp g t.π


theorem inits_cons (a : α) (l : List α) : inits (a :: l) = [] :: l.inits.map fun t => a :: t

(a :: l).inits = [] :: List.map (fun t => a :: t) l.inits


theorem LinearMap.toMatrix_apply' (f : M₁ →ₗ[R] M₂) (i : m) (j : n) :
    LinearMap.toMatrix v₁ v₂ f i j = v₂.repr (f (v₁ j)) i

{R : Type u_1}
[CommSemiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype n]
[Finite m]
[DecidableEq n]
{M₁ : Type u_5}
{M₂ : Type u_6}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
(v₁ : Basis n R M₁)
(v₂ : Basis m R M₂)
(f : M₁ →ₗ[R] M₂)
(i : m)
(j : n)

(LinearMap.toMatrix v₁ v₂) f i j = (v₂.repr (f (v₁ j))) i


private theorem rel_of_eq {s : Setoid α} {q₁ q₂ : Quotient s} : q₁ = q₂ → rel q₁ q₂

{α : Sort u}
{s : Setoid α}
{q₁ q₂ : Quotient s}


@[to_additive]
lemma Subgroup.tendsto_coe_cofinite_of_discrete [T2Space G] (H : Subgroup G) [DiscreteTopology H] :
    Tendsto ((↑) : H → G) cofinite (cocompact _)

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
[T2Space G]
(H : AddSubgroup G)
[DiscreteTopology ↥H]

Filter.Tendsto Subtype.val Filter.cofinite (Filter.cocompact G)


@[simp]
lemma decreasingInduction_succ' {n} {motive : (m : ℕ) → m ≤ n + 1 → Sort*} (of_succ self) :
    decreasingInduction (motive := motive) of_succ self n.le_succ = of_succ _ _ self

{motive : (m : ℕ) → m ≤ n + 1 → Sort u_1}

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

Nat.decreasingInduction of_succ self ⋯ = of_succ n ⋯ self


@[simp]
theorem eval₂Hom_id_X_eq_join₂ : eval₂Hom (RingHom.id _) X = @join₂ σ R _

(σ : Type u_1)
(R : Type u_3)
[CommSemiring R]

MvPolynomial.eval₂Hom (RingHom.id (MvPolynomial σ R)) MvPolynomial.X = MvPolynomial.join₂


/-- A projection on a normed space `X` is said to be an L-projection if, for all `x` in `X`,
$\|x\| = \|P x\| + \|(1 - P) x\|$.

Note that we write `P • x` instead of `P x` for reasons described in the module docstring.
-/
structure IsLprojection (P : M) : Prop where
  proj : IsIdempotentElem P
  Lnorm : ∀ x : X, ‖x‖ = ‖P • x‖ + ‖(1 - P) • x‖

{X : Type u_1}
[NormedAddCommGroup X]
{M : Type u_2}
[Ring M]
[Module M X]
{P : M}
(self : IsLprojection X P)


theorem toIocMod_mem_Ioc (a b : α) : toIocMod hp a b ∈ Set.Ioc a (a + p)

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


@[to_additive (attr := simp)]
theorem powersEquivPowers_apply (h : orderOf x = orderOf y) (n : ℕ) :
    powersEquivPowers h ⟨x ^ n, n, rfl⟩ = ⟨y ^ n, n, rfl⟩

{G : Type u_1}
[AddLeftCancelMonoid G]
[Finite G]
{x y : G}
(h : addOrderOf x = addOrderOf y)
(n : ℕ)

(multiplesEquivMultiples h) ⟨n • x, ⋯⟩ = ⟨n • y, ⋯⟩


theorem le_of_forall_le' [Preorder α] {a b : α} (H : ∀ c, a ≤ c → b ≤ c) : b ≤ a

{α : Type u_2}
[Preorder α]
{a b : α}
(H : ∀ (c : α), a ≤ c → b ≤ c)


@[simp]
lemma equivPullbackObj_symm_apply_fst (x : Types.PullbackObj f g) :
    c.fst ((equivPullbackObj hc).symm x) = x.1.1

{c : CategoryTheory.Limits.PullbackCone f g}

(x : CategoryTheory.Limits.Types.PullbackObj f g)

c.fst ((CategoryTheory.Limits.PullbackCone.IsLimit.equivPullbackObj hc).symm x) = (↑x).1


theorem sigma_preimage_mk {β : α → Type*} [DecidableEq α] (s : Finset (Σa, β a)) (t : Finset α) :
    (t.sigma fun a => s.preimage (Sigma.mk a) sigma_mk_injective.injOn) =
      s.filter fun a => a.1 ∈ t

{α : Type u}
{β : α → Type u_1}
[DecidableEq α]
(s : Finset ((a : α) × β a))
(t : Finset α)

(t.sigma fun a => s.preimage (Sigma.mk a) ⋯) = Finset.filter (fun a => a.fst ∈ t) s


theorem lintegral_prodMkLeft (κ : Kernel α β) (ca : γ × α) (g : β → ℝ≥0∞) :
    ∫⁻ b, g b ∂prodMkLeft γ κ ca = ∫⁻ b, g b ∂κ ca.snd

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_5}
{mγ : MeasurableSpace γ}
(κ : ProbabilityTheory.Kernel α β)
(ca : γ × α)
(g : β → ℝ≥0∞)

∫⁻ (b : β), g b ∂(ProbabilityTheory.Kernel.prodMkLeft γ κ) ca = ∫⁻ (b : β), g b ∂κ ca.2


theorem SSameSide.trans_wSameSide {s : AffineSubspace R P} {x y z : P} (hxy : s.SSameSide x y)
    (hyz : s.WSameSide y z) : s.WSameSide x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(hxy : s.SSameSide x y)
(hyz : s.WSameSide y z)


theorem normalClosure_idempotent : normalClosure ↑(normalClosure s) = normalClosure s

Subgroup.normalClosure ↑(Subgroup.normalClosure s) = Subgroup.normalClosure s


theorem isHenstock_single (h : x ∈ Box.Icc I) : IsHenstock (single I I le_rfl x h)

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{x : ι → ℝ}
(h : x ∈ BoxIntegral.Box.Icc I)

(BoxIntegral.TaggedPrepartition.single I I ⋯ x h).IsHenstock


/-- Given a family of opens `opensLeCoverCocone U` is essentially the natural cocone
    associated to the sieve generated by the presieve associated to `U` with indexing
    category changed using the above equivalence. -/
@[simps]
def whiskerIsoMapGenerateCocone :
    (F.mapCone (opensLeCoverCocone U).op).whisker (generateEquivalenceOpensLe U hY).op.functor ≅
      F.mapCone (Sieve.generate (presieveOfCoveringAux U Y)).arrows.cocone.op

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : TopCat}
(F : TopCat.Presheaf C X)
{ι : Type w}
(U : ι → TopologicalSpace.Opens ↑X)
{Y : TopologicalSpace.Opens ↑X}
(hY : Y = iSup U)

(F.whiskerIsoMapGenerateCocone U hY).inv.hom = F.map (CategoryTheory.eqToHom ⋯)


theorem ascFactorial_eq_factorial_mul_choose' (n k : ℕ) :
    n.ascFactorial k = k ! * (n + k - 1).choose k


/-- The product of `f` over `insert a s` is the same as
the product over `s`, as long as `f a = 1`. -/
@[to_additive (attr := simp) "The sum of `f` over `insert a s` is the same as
the sum over `s`, as long as `f a = 0`."]
theorem prod_insert_one [DecidableEq α] (h : f a = 1) : ∏ x ∈ insert a s, f x = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{a : α}
{f : α → β}
[AddCommMonoid β]
[DecidableEq α]
(h : f a = 0)


private theorem signAux_swap_zero_one {n : ℕ} (hn : 2 ≤ n) :
    signAux (swap (⟨0, lt_of_lt_of_le (by decide) hn⟩ : Fin n) ⟨1, lt_of_lt_of_le (by decide) hn⟩) =
      -1


theorem permutationsAux_append (is is' ts : List α) :
    permutationsAux (is ++ ts) is' =
      (permutationsAux is is').map (· ++ ts) ++ permutationsAux ts (is.reverse ++ is')

(is ++ ts).permutationsAux is' =
  List.map (fun x => x ++ ts) (is.permutationsAux is') ++ ts.permutationsAux (is.reverse ++ is')


@[simp]
theorem toSet_subset_iff {x y : ZFSet} : x.toSet ⊆ y.toSet ↔ x ⊆ y


theorem IsBigO.isBigOWith : f =O[l] g → ∃ c : ℝ, IsBigOWith c l f g

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

f =O[l] g → ∃ c, Asymptotics.IsBigOWith c l f g


@[simp]
theorem lcs_succ : N.lcs (k + 1) = ⁅(⊤ : LieIdeal R L), N.lcs k⁆

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(k : ℕ)
(N : LieSubmodule R L M)

LieSubmodule.lcs (k + 1) N = ⁅⊤, LieSubmodule.lcs k N⁆


lemma comul_mul (a b : A) : comul (R := R) (a * b) = comul a * comul b

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Bialgebra R A]
(a b : A)

Coalgebra.comul (a * b) = Coalgebra.comul a * Coalgebra.comul b


/-- `Solution'` is a tuple given by a solution to `a ^ 3 + b ^ 3 = u * c ^ 3`,
where `a`, `b`, `c` and `u` are as in `FermatLastTheoremForThreeGen`.
See `Solution` for the actual structure on which we will do the descent. -/
structure Solution' where
  a : 𝓞 K
  b : 𝓞 K
  c : 𝓞 K
  u : (𝓞 K)ˣ
  ha : ¬ λ ∣ a
  hb : ¬ λ ∣ b
  hc : c ≠ 0
  coprime : IsCoprime a b
  hcdvd : λ ∣ c
  H : a ^ 3 + b ^ 3 = u * c ^ 3

(self : FermatLastTheoremForThreeGen.Solution' hζ)


@[simp]
lemma id_val (A : PointedGaloisObject F) : 𝟙 A = 𝟙 A.obj

{F : CategoryTheory.Functor C FintypeCat}

(A : CategoryTheory.PreGaloisCategory.PointedGaloisObject F)

(CategoryTheory.CategoryStruct.id A).val = CategoryTheory.CategoryStruct.id A.obj


/-- Turning `p : Submodule R M` into an `S`-submodule gives the same module structure
as turning it into a type and adding a module structure. -/
@[simps (config := { simpRhs := true })]
def restrictScalarsEquiv (p : Submodule R M) : p.restrictScalars S ≃ₗ[R] p

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

∀ (a : ↥p), (Submodule.restrictScalarsEquiv S R M p).symm a = a


theorem intCast_eq_intCast_iff' (a b : ℤ) (c : ℕ) : (a : ZMod c) = (b : ZMod c) ↔ a % c = b % c


theorem isNat_not_prime {n n' : ℕ} (h : IsNat n n') : ¬n'.Prime → ¬n.Prime

{n n' : ℕ}
(h : Mathlib.Meta.NormNum.IsNat n n')


lemma isContinuous [G.IsLocallyFaithful K] (Hp : CoverPreserving J K G) : G.IsContinuous J K

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

(Hp : CategoryTheory.CoverPreserving J K G)


@[simp]
theorem supported_univ : supported R (Set.univ : Set σ) = ⊤

{σ : Type u_1}
{R : Type u}
[CommSemiring R]


/-- Given `S' : Solution'`, we have that `2 ≤ S'.multiplicity`. -/
lemma Solution'.two_le_multiplicity : 2 ≤ S'.multiplicity

(S' : FermatLastTheoremForThreeGen.Solution' hζ)


private theorem a_soln_is_unique (ha : F.eval a = 0) (z' : ℤ_[p]) (hz' : F.eval z' = 0)
    (hnormz' : ‖z' - a‖ < ‖F.derivative.eval a‖) : z' = a

(hnormz' : ‖z' - a‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖)


/-- The free R-module functor is lax monoidal. -/
@[simps]
instance : LaxMonoidal.{u} (free R).obj

(R : Type u)
[CommRing R]
(X Y : Type u)

CategoryTheory.LaxMonoidal.μ X Y = (ModuleCat.Free.μ R X Y).hom


theorem mem_iInf {ι : Sort*} {S : ι → NonUnitalStarSubalgebra R A} {x : A} :
    (x ∈ ⨅ i, S i) ↔ ∀ i, x ∈ S i

{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]
{ι : Sort u_1}
{S : ι → NonUnitalStarSubalgebra R A}
{x : A}


theorem Trivialization.contMDiff_iff {f : M → TotalSpace F E} (he : ∀ x, f x ∈ e.source) :
    ContMDiff IM (IB.prod 𝓘(𝕜, F)) n f ↔
      ContMDiff IM IB n (fun x => (f x).proj) ∧
      ContMDiff IM 𝓘(𝕜, F) n (fun x ↦ (e (f x)).2)

[TopologicalSpace (Bundle.TotalSpace F E)]

{e : Trivialization F Bundle.TotalSpace.proj}

ContMDiff IM (IB.prod 𝓘(𝕜, F)) n f ↔
  (ContMDiff IM IB n fun x => (f x).proj) ∧ ContMDiff IM 𝓘(𝕜, F) n fun x => (↑e (f x)).2


/--
The underlying object of a condensed object in `C` is the condensed object evaluated at a point.
This can be viewed as a sort of forgetful functor from `Condensed C` to `C`
-/
@[simps!]
noncomputable def LightCondensed.underlying : LightCondensed.{u} C ⥤ C

(j : CategoryTheory.Sheaf (CategoryTheory.coherentTopology LightProfinite) C)

(LightCondensed.underlying C).obj j = j.val.obj (Opposite.op (LightProfinite.of PUnit.{u + 1}))


theorem land_comm (n m : ℕ) : n &&& m = m &&& n


lemma CochainComplex.exactAt_succ_single_obj (A : C) (n : ℕ) :
    ExactAt ((single₀ C).obj A) (n + 1)

HomologicalComplex.ExactAt ((CochainComplex.single₀ C).obj A) (n + 1)


@[to_additive IsLowerSet.cthickening]
protected theorem IsLowerSet.cthickening' (hs : IsLowerSet s) (ε : ℝ) :
    IsLowerSet (cthickening ε s)

{α : Type u_1}
[NormedOrderedAddGroup α]
{s : Set α}
(hs : IsLowerSet s)
(ε : ℝ)


/-- This condition `eq_bot_or_top` is equivalent to being a field.
However, `Ideal.spanNorm_mul_of_field` is harder to apply since we'd need to upgrade a `CommRing R`
instance to a `Field R` instance. -/
theorem spanNorm_mul_of_bot_or_top [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S]
    (eq_bot_or_top : ∀ I : Ideal R, I = ⊥ ∨ I = ⊤) (I J : Ideal S) :
    spanNorm R (I * J) = spanNorm R I * spanNorm R J

(eq_bot_or_top : ∀ (I : Ideal R), I = ⊥ ∨ I = ⊤)

Ideal.spanNorm R (I * J) = Ideal.spanNorm R I * Ideal.spanNorm R J


lemma le_egauge_smul_left (c : 𝕜) (s : Set E) (x : E) :
    egauge 𝕜 s x / ‖c‖₊ ≤ egauge 𝕜 (c • s) x

{𝕜 : Type u_1}
[NormedDivisionRing 𝕜]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
(c : 𝕜)
(s : Set E)
(x : E)

egauge 𝕜 s x / ↑‖c‖₊ ≤ egauge 𝕜 (c • s) x


lemma induce_sUnion_connected_of_pairwise_not_disjoint {S : Set (Set V)} (Sn : S.Nonempty)
    (Snd : ∀ {s t}, s ∈ S → t ∈ S → (s ∩ t).Nonempty)
    (Sc : ∀ {s}, s ∈ S → (G.induce s).Connected) :
    (G.induce (⋃₀ S)).Connected

(Snd : ∀ {s t : Set V}, s ∈ S → t ∈ S → (s ∩ t).Nonempty)

(Sc : ∀ {s : Set V}, s ∈ S → (SimpleGraph.induce s G).Connected)


@[to_additive (attr := simp) ite_smul]
lemma pow_ite (p : Prop) [Decidable p] (a : α) (b c : β) :
    a ^ (if p then b else c) = if p then a ^ b else a ^ c

{α : Type u_1}
{β : Type u_2}
[Pow α β]
(p : Prop)
[Decidable p]
(a : α)
(b c : β)

(a ^ if p then b else c) = if p then a ^ b else a ^ c


@[simp] theorem false_bne : ∀(b : Bool), (false != b) =  b


theorem GradeOrder.wellFoundedLT (𝕆 : Type*) [Preorder 𝕆] [GradeOrder 𝕆 α]
    [WellFoundedLT 𝕆] : WellFoundedLT α

{α : Type u_3}
[Preorder α]
(𝕆 : Type u_5)
[Preorder 𝕆]
[GradeOrder 𝕆 α]
[WellFoundedLT 𝕆]


lemma stdSimplex_unique [Unique ι] : stdSimplex 𝕜 ι = {fun _ ↦ 1}

(𝕜 : Type u_1)
(ι : Type u_5)
[OrderedSemiring 𝕜]
[Fintype ι]
[Unique ι]


theorem left_node_right_eq_self : ∀ {x : Tree Unit} (_hx : x ≠ nil), x.left △ x.right = x


theorem smul_sup [SMul R ℝ] [SMul R ℝ≥0] [IsScalarTower R ℝ≥0 ℝ] (r : R) (p q : Seminorm 𝕜 E) :
    r • (p ⊔ q) = r • p ⊔ r • q

{R : Type u_1}
{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]
[SMul R ℝ]
[SMul R ℝ≥0]
[IsScalarTower R ℝ≥0 ℝ]
(r : R)
(p q : Seminorm 𝕜 E)


@[simp]
theorem image_segment (f : E →ᵃ[𝕜] F) (a b : E) : f '' [a -[𝕜] b] = [f a -[𝕜] f b]

(𝕜 : Type u_1)
{E : Type u_2}
{F : Type u_3}
[OrderedRing 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
(f : E →ᵃ[𝕜] F)
(a b : E)


theorem exists_mem (x : X) : ∃ n, x ∈ K n

{X : Type u_1}
[TopologicalSpace X]
(K : CompactExhaustion X)
(x : X)


@[functor_norm]
theorem traverse_id : traverse pure = (pure : t α → Id (t α))

{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
{α : Type u}


/-- Two sublattices are equal if they have the same elements. -/
lemma ext : (∀ a, a ∈ L ↔ a ∈ M) → L = M

{α : Type u_2}
[Lattice α]
{L M : Sublattice α}


/-- A typeclass for nonempty finite linear orders. -/
class NonemptyFiniteLinearOrder (α : Type*) extends Fintype α, LinearOrder α where
  Nonempty : Nonempty α := by infer_instance

{α : Type u_1}
[self : NonemptyFiniteLinearOrder α]


/-- The square of the distance from a point in `s` to `p2` equals the
sum of the squares of the distances of the two points to the
`orthogonalProjection`. -/
theorem dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq
    {s : AffineSubspace ℝ P} [Nonempty s] [HasOrthogonalProjection s.direction] {p1 : P} (p2 : P)
    (hp1 : p1 ∈ s) :
    dist p1 p2 * dist p1 p2 =
      dist p1 (orthogonalProjection s p2) * dist p1 (orthogonalProjection s p2) +
        dist p2 (orthogonalProjection s p2) * dist p2 (orthogonalProjection s p2)

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

dist p1 p2 * dist p1 p2 =
  dist p1 ↑((EuclideanGeometry.orthogonalProjection s) p2) * dist p1 ↑((EuclideanGeometry.orthogonalProjection s) p2) +
    dist p2 ↑((EuclideanGeometry.orthogonalProjection s) p2) * dist p2 ↑((EuclideanGeometry.orthogonalProjection s) p2)


/-- `F.mapTriangle` commutes with the inverse of the rotation of triangles. -/
@[simps!]
noncomputable def mapTriangleInvRotateIso [F.Additive] :
    F.mapTriangle ⋙ Pretriangulated.invRotate D ≅
      Pretriangulated.invRotate C ⋙ F.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

(F.mapTriangleInvRotateIso.inv.app X).hom₃ = CategoryTheory.CategoryStruct.id (F.obj X.obj₂)


@[to_additive]
theorem mul_right_cancel'' [ContravariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c : α}
    (h : a * b = c * b) :
    a = c

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


theorem Basis.isScalarTower_of_nonempty {ι} [Nonempty ι] (b : Basis ι S A) : IsScalarTower R S S

(R : Type u)
{S : Type v}
{A : Type w}
[Semiring R]
[Semiring S]
[AddCommMonoid A]
[Module R S]
[Module S A]
[Module R A]
[IsScalarTower R S A]
{ι : Type u_1}
[Nonempty ι]
(b : Basis ι S A)


@[simp]
lemma id_map {a : M} (f : ShiftedHom X Y a) : f.map (𝟭 C) = f

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
{M : Type u_4}
[AddMonoid M]
[CategoryTheory.HasShift C M]
{X Y : C}
{a : M}
(f : CategoryTheory.ShiftedHom X Y a)


theorem Squarefree.of_mul_right [CommMonoid R] {m n : R} (hmn : Squarefree (m * n)) :
    Squarefree n

{R : Type u_1}
[CommMonoid R]
{m n : R}
(hmn : Squarefree (m * n))


theorem IsProj.eq_conj_prodMap {f : E →ₗ[R] E} (h : IsProj p f) :
    f = (p.prodEquivOfIsCompl (ker f) h.isCompl).conj (prodMap id 0)

{R : Type u_1}
[CommRing R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{p : Submodule R E}
{f : E →ₗ[R] E}
(h : LinearMap.IsProj p f)

f = (p.prodEquivOfIsCompl (LinearMap.ker f) ⋯).conj (LinearMap.id.prodMap 0)


@[simp]
theorem mem_top (x : L) : x ∈ (⊤ : LieSubalgebra R L)

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


@[simp] theorem false_implies (p : Prop) : (False → p) = True