theorem neighborFinset_eq_filter {v : V} [DecidableRel G.Adj] :
    G.neighborFinset v = Finset.univ.filter (G.Adj v)

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

G.neighborFinset v = Finset.filter (G.Adj v) Finset.univ


lemma dblZ_ne_zero_of_Y_ne' [NoZeroDivisors R] {P Q : Fin 3 → R} (hP : W'.Equation P)
    (hQ : W'.Equation Q) (hPz : P z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2)
    (hy : P y * Q z ^ 3 ≠ W'.negY Q * P z ^ 3) : W'.dblZ P ≠ 0


protected theorem max_min_distrib_right (a b c : Nat) :
    max (min a b) c = min (max a c) (max b c)


theorem nhds_coe {r : ℝ≥0} : 𝓝 (r : ℝ≥0∞) = (𝓝 r).map (↑)

𝓝 ↑r = Filter.map ENNReal.ofNNReal (𝓝 r)


theorem even_odd_of_coprime (hc : Int.gcd x y = 1) :
    x % 2 = 0 ∧ y % 2 = 1 ∨ x % 2 = 1 ∧ y % 2 = 0

{x y z : ℤ}
(h : PythagoreanTriple x y z)
(hc : x.gcd y = 1)


@[simp]
lemma restrict_nullSet (h : μ ⟂ₘ ν) : μ.restrict h.nullSet = 0

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


/-- In order to check that a certain data is a `1`-hypercover of `S`, it suffices to
check that the data provides a covering of `S` and of the fibre products. -/
@[simps toPreOneHypercover]
def mk' {S : C} (E : PreOneHypercover S) [E.HasPullbacks]
    (mem₀ : E.sieve₀ ∈ J S) (mem₁' : ∀ (i₁ i₂ : E.I₀), E.sieve₁' i₁ i₂ ∈ J _) :
    J.OneHypercover S

{J : CategoryTheory.GrothendieckTopology C}

(mem₁' : ∀ (i₁ i₂ : E.I₀), E.sieve₁' i₁ i₂ ∈ J.sieves (CategoryTheory.Limits.pullback (E.f i₁) (E.f i₂)))

(CategoryTheory.GrothendieckTopology.OneHypercover.mk' E mem₀ mem₁').toPreOneHypercover = E


@[simp 1100]
theorem prevD_comp_left (f : C ⟶ D) (g : ∀ i j, D.X i ⟶ E.X j) (j : ι) :
    (prevD j fun i j => f.f i ≫ g i j) = f.f j ≫ prevD j g

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D E : HomologicalComplex V c}
(f : C ⟶ D)
(g : (i j : ι) → D.X i ⟶ E.X j)
(j : ι)

((prevD j) fun i j => f.f i ≫ g i j) = f.f j ≫ (prevD j) g


/-- Given an open cover on `X`, we may pull them back along a morphism `W ⟶ X` to obtain
an open cover of `W`. -/
@[simps]
def OpenCover.pullbackCover {X W : Scheme.{u}} (𝒰 : X.OpenCover) (f : W ⟶ X) :
    W.OpenCover

{X W : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : W ⟶ X)
(x : 𝒰.J)

(𝒰.pullbackCover f).obj x = CategoryTheory.Limits.pullback f (𝒰.map x)


@[simp]
theorem tendsto_Ioo_atBot {f : β → Ioo a b} :
    Tendsto f l atBot ↔ Tendsto (fun x => (f x : α)) l (𝓝[>] a)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
{l : Filter β}
{f : β → ↑(Set.Ioo a b)}

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


theorem circulant_col_zero_eq [AddGroup n] (v : n → α) (i : n) : circulant v i 0 = v i

{α : Type u_1}
{n : Type u_4}
[AddGroup n]
(v : n → α)
(i : n)


theorem Monotone.const_mul [PosMulMono α]
    (hf : Monotone f) (ha : 0 ≤ a) : Monotone fun x => a * f x

{α : Type u}
{β : Type u_1}
[Semiring α]
[Preorder α]
{a : α}
[Preorder β]
{f : β → α}
[PosMulMono α]
(hf : Monotone f)
(ha : 0 ≤ a)


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

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


@[simp]
lemma one_le_ofReal {p : ℝ} : 1 ≤ ENNReal.ofReal p ↔ 1 ≤ p


theorem coprime_of_lt_prime {n p} (n_pos : 0 < n) (hlt : n < p) (pp : Prime p) : Coprime p n

{n p : ℕ}
(n_pos : 0 < n)
(hlt : n < p)
(pp : Nat.Prime p)


theorem sub_one_mul_conj : (p - 1) * q = p


theorem coeff_p_pow [CharP R p] (i : ℕ) : ((p : 𝕎 R) ^ i).coeff i = 1

(p : ℕ)
(R : Type u_1)
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CharP R p]
(i : ℕ)


theorem hasStrictDerivAt : HasStrictDerivAt f (f.linear 1) x

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


@[simp] theorem max_none_some [Max α] {b : α} : max none (some b) = some b


theorem ite_le_sup (s s' : α) (P : Prop) [Decidable P] : ite P s s' ≤ s ⊔ s'

{α : Type u}
[SemilatticeSup α]
(s s' : α)
(P : Prop)
[Decidable P]


/-- If an action is continuous, then composing this action with a continuous homomorphism gives
again a continuous action. -/
@[to_additive]
theorem MulAction.continuousSMul_compHom
    {N : Type*} [TopologicalSpace N] [Monoid N] {f : N →* M} (hf : Continuous f) :
    letI : MulAction N X := MulAction.compHom _ f
    ContinuousSMul N X

{M : Type u_1}
{X : Type u_2}
[TopologicalSpace M]
[TopologicalSpace X]
[Monoid M]
[MulAction M X]
[ContinuousSMul M X]
{N : Type u_5}
[TopologicalSpace N]
[Monoid N]
{f : N →* M}
(hf : Continuous ⇑f)


theorem psigmaCongrRight_symm {α} {β₁ β₂ : α → Sort*} (F : ∀ a, β₁ a ≃ β₂ a) :
    (psigmaCongrRight F).symm = psigmaCongrRight fun a => (F a).symm

{α : Sort u_3}
{β₁ : α → Sort u_1}
{β₂ : α → Sort u_2}
(F : (a : α) → β₁ a ≃ β₂ a)

(Equiv.psigmaCongrRight F).symm = Equiv.psigmaCongrRight fun a => (F a).symm


theorem solvable_of_ker_le_range {G' G'' : Type*} [Group G'] [Group G''] (f : G' →* G)
    (g : G →* G'') (hfg : g.ker ≤ f.range) [hG' : IsSolvable G'] [hG'' : IsSolvable G''] :
    IsSolvable G

{G : Type u_1}
[Group G]
{G' : Type u_3}
{G'' : Type u_4}
[Group G']
[Group G'']
(f : G' →* G)
(g : G →* G'')
(hfg : g.ker ≤ f.range)
[hG' : IsSolvable G']
[hG'' : IsSolvable G'']


@[to_additive (attr := simp)]
theorem isUnit_one [Monoid M] : IsUnit (1 : M)


theorem Nat.disjoint_divisors_filter_isPrimePow {a b : ℕ} (hab : a.Coprime b) :
    Disjoint (a.divisors.filter IsPrimePow) (b.divisors.filter IsPrimePow)

Disjoint (Finset.filter IsPrimePow a.divisors) (Finset.filter IsPrimePow b.divisors)


@[simp] lemma toUpperSet_ofUpperSet (a : WithUpperSet α) : toUpperSet (ofUpperSet a) = a

{α : Type u_1}
(a : Topology.WithUpperSet α)

Topology.WithUpperSet.toUpperSet (Topology.WithUpperSet.ofUpperSet a) = a


/-- This is not an instance to avoid slowing down every single `Subsingleton` typeclass search. -/
lemma subsingleton_cod [∀ a, Subsingleton (β a)] : Subsingleton F

{F : Sort u_1}
{α : Sort u_2}
{β : α → Sort u_3}
[i : DFunLike F α β]
[∀ (a : α), Subsingleton (β a)]


theorem contMDiffWithinAt_iff_contDiffWithinAt {f : E → E'} {s : Set E} {x : E} :
    ContMDiffWithinAt 𝓘(𝕜, E) 𝓘(𝕜, E') n f s x ↔ ContDiffWithinAt 𝕜 n f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{n : ℕ∞}
{f : E → E'}
{s : Set E}
{x : E}


theorem slice_subset_falling : 𝒜 # k ⊆ falling k 𝒜

{α : Type u_2}
[DecidableEq α]
(k : ℕ)
(𝒜 : Finset (Finset α))


lemma dist_eq (x y : ULift β) : dist x y = dist x.down y.down

{β : Type u_2}
[PseudoMetricSpace β]
(x y : ULift.{u_3, u_2} β)


/-- If `t` is bounded, then so is `s ∩ t` -/
theorem BddBelow.inter_of_right (h : BddBelow t) : BddBelow (s ∩ t)

{α : Type u}
[Preorder α]
{s t : Set α}
(h : BddBelow t)


theorem Disjoint.sdiff_eq_left (h : Disjoint a b) : a \ b = a

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


/-- An object in the arrow category is simply a morphism in `T`. -/
@[simps]
def mk {X Y : T} (f : X ⟶ Y) : Arrow T

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


theorem IsNormal.isLimit {f} (H : IsNormal f) {o} (l : IsLimit o) : IsLimit (f o)

{f : Ordinal.{u_4} → Ordinal.{u_5}}
(H : Ordinal.IsNormal f)
{o : Ordinal.{u_4}}
(l : o.IsLimit)


theorem map_sup (s t : Subring R) (f : R →+* S) : (s ⊔ t).map f = s.map f ⊔ t.map f

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

Subring.map f (s ⊔ t) = Subring.map f s ⊔ Subring.map f t


theorem map_one_of_isLeftRegular (h : IsLeftRegular (abv 1)) : abv 1 = 1

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedSemiring S]
(abv : AbsoluteValue R S)
(h : IsLeftRegular (abv 1))


@[simp]
theorem symm_dual_id : SupHom.dual.symm (InfHom.id _) = SupHom.id α

SupHom.dual.symm (InfHom.id αᵒᵈ) = SupHom.id α


@[simp]
theorem length_cons {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    (cons h p).length = p.length + 1

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

(SimpleGraph.Walk.cons h p).length = p.length + 1


theorem mk'_add_mk' (m₁ m₂ : M) (s₁ s₂ : S) :
    mk' f m₁ s₁ + mk' f m₂ s₂ = mk' f (s₂ • m₁ + s₁ • m₂) (s₁ * s₂)

{R : Type u_1}
[CommSemiring R]
{S : Submonoid R}
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
(m₁ m₂ : M)
(s₁ s₂ : ↥S)

IsLocalizedModule.mk' f m₁ s₁ + IsLocalizedModule.mk' f m₂ s₂ = IsLocalizedModule.mk' f (s₂ • m₁ + s₁ • m₂) (s₁ * s₂)


@[simp]
theorem of_comp_lift (f : X → A) : lift R f ∘ of R = f

(R : Type u)
{X : Type v}
[Semiring R]
{A : Type w}
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(f : X → A)

⇑((FreeNonUnitalNonAssocAlgebra.lift R) f) ∘ FreeNonUnitalNonAssocAlgebra.of R = f


theorem mul_apply (f g : M₁ →L[R₁] M₁) (x : M₁) : (f * g) x = f (g x)

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


theorem closure_subset_preimage_closure_image (h : Continuous f) :
    closure s ⊆ f ⁻¹' closure (f '' s)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{s : Set X}
(h : Continuous f)


protected theorem coe_nat_lcm (m n : ℕ) : Int.lcm ↑m ↑n = Nat.lcm m n


lemma norm_term_eq (f : ℕ → ℂ) (s : ℂ) (n : ℕ) :
    ‖term f s n‖ = if n = 0 then 0 else ‖f n‖ / n ^ s.re

‖LSeries.term f s n‖ = if n = 0 then 0 else ‖f n‖ / ↑n ^ s.re


@[simp]
theorem factorThru_zero [HasZeroMorphisms C] {X Y : C} {P : Subobject Y}
    (h : P.Factors (0 : X ⟶ Y)) : P.factorThru 0 h = 0


theorem strictMonoOn_dual_iff :
    StrictMonoOn (toDual ∘ f ∘ ofDual : αᵒᵈ → βᵒᵈ) s ↔ StrictMonoOn f s

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s : Set α}

StrictMonoOn (⇑OrderDual.toDual ∘ f ∘ ⇑OrderDual.ofDual) s ↔ StrictMonoOn f s


@[to_additive (attr := measurability)]
theorem AEMeasurable.mul_const [MeasurableMul M] (hf : AEMeasurable f μ) (c : M) :
    AEMeasurable (fun x => f x * c) μ

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Add M]
{m : MeasurableSpace α}
{f : α → M}
{μ : MeasureTheory.Measure α}
[MeasurableAdd M]
(hf : AEMeasurable f μ)
(c : M)


@[simp]
theorem optionEquivSumPUnit_none : optionEquivSumPUnit α none = Sum.inr PUnit.unit

(Equiv.optionEquivSumPUnit α) none = Sum.inr PUnit.unit


theorem proj_stdBasis_same (i : ι) : (proj i).comp (stdBasis R φ i) = id

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

LinearMap.proj i ∘ₗ LinearMap.stdBasis R φ i = LinearMap.id


theorem hasProductsOfShape_of_small (β : Type w₂) [Small.{w₁} β] [HasProducts.{w₁} C] :
    HasProductsOfShape β C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(β : Type w₂)
[Small.{w₁, w₂} β]
[CategoryTheory.Limits.HasProducts C]


theorem le_trailingDegree_X : (1 : ℕ∞) ≤ trailingDegree (X : R[X])


theorem not_isField_iff_exists_prime [Nontrivial R] :
    ¬IsField R ↔ ∃ p : Ideal R, p ≠ ⊥ ∧ p.IsPrime

{R : Type u_1}
[CommSemiring R]
[Nontrivial R]


/-- The commutator of a derivation `D` and a derivation of the form `ad x` is `ad (D x)`. -/
lemma lie_der_ad_eq_ad_der (D : LieDerivation R L L) (x : L) : ⁅D, ad R L x⁆ = ad R L (D x)

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(D : LieDerivation R L L)
(x : L)

⁅D, (LieDerivation.ad R L) x⁆ = (LieDerivation.ad R L) (D x)


theorem polar_comm (f : M → N) (x y : M) : polar f x y = polar f y x

{M : Type u_4}
{N : Type u_5}
[AddCommGroup M]
[AddCommGroup N]
(f : M → N)
(x y : M)

QuadraticMap.polar f x y = QuadraticMap.polar f y x


@[simp]
theorem mem_mk {s : Set E} {h₁ h₂ x} : x ∈ @mk 𝕜 _ _ _ _ s h₁ h₂ ↔ x ∈ s

{h₁ : ∀ ⦃c : 𝕜⦄, 0 < c → ∀ ⦃x : E⦄, x ∈ s → c • x ∈ s}

{h₂ : ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃y : E⦄, y ∈ s → x + y ∈ s}

x ∈ { carrier := s, smul_mem' := h₁, add_mem' := h₂ } ↔ x ∈ s


/-- If any finite measure has a Lebesgue decomposition with respect to `ν`,
then the same is true for any s-finite measure. -/
theorem HaveLebesgueDecomposition.sfinite_of_isFiniteMeasure [SFinite μ]
    (_h : ∀ (μ : Measure α) [IsFiniteMeasure μ], HaveLebesgueDecomposition μ ν) :
    HaveLebesgueDecomposition μ ν

(_h : ∀ (μ : MeasureTheory.Measure α) [inst : MeasureTheory.IsFiniteMeasure μ], μ.HaveLebesgueDecomposition ν)


@[simp]
theorem preimage_closedBall (x : E₂) (r : ℝ) :
    e ⁻¹' Metric.closedBall x r = Metric.closedBall (e.symm x) r

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

⇑e ⁻¹' Metric.closedBall x r = Metric.closedBall (e.symm x) r


/-- Formula for the discriminant of a power basis using the norm of the field extension. -/
-- Porting note: `(minpoly K pb.gen).derivative` does not work anymore.
theorem discr_powerBasis_eq_norm [Algebra.IsSeparable K L] :
    discr K pb.basis =
      (-1) ^ (n * (n - 1) / 2) *
      norm K (aeval pb.gen (derivative (R := K) (minpoly K pb.gen)))

(K : Type u)
{L : Type v}
[Field K]
[Field L]
[Algebra K L]
[Module.Finite K L]
(pb : PowerBasis K L)
[Algebra.IsSeparable K L]

Algebra.discr K ⇑pb.basis =
  (-1) ^ (FiniteDimensional.finrank K L * (FiniteDimensional.finrank K L - 1) / 2) *
    (Algebra.norm K) ((Polynomial.aeval pb.gen) (Polynomial.derivative (minpoly K pb.gen)))


theorem separatingLeft_iff_det_ne_zero {B : M₁ →ₗ[R₁] M₁ →ₗ[R₁] R₁} (b : Basis ι R₁ M₁) :
    B.SeparatingLeft ↔ (toMatrix₂ b b B).det ≠ 0

{R₁ : Type u_2}
{M₁ : Type u_7}
{ι : Type u_16}
[CommRing R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[DecidableEq ι]
[Fintype ι]
[IsDomain R₁]
{B : M₁ →ₗ[R₁] M₁ →ₗ[R₁] R₁}
(b : Basis ι R₁ M₁)

B.SeparatingLeft ↔ ((LinearMap.toMatrix₂ b b) B).det ≠ 0


/-- The canonical (bundled) continuous map from the underlying topological
space of `X` to the prime spectrum of its global sections. -/
@[simps]
def toΓSpecBase : X.toTopCat ⟶ Spec.topObj (Γ.obj (op X))

∀ (a : ↑X.toTopCat), X.toΓSpecBase a = X.toΓSpecFun a


theorem mem_inv_iff (hI : I ≠ 0) {x : K} : x ∈ I⁻¹ ↔ ∀ y ∈ I, x * y ∈ (1 : FractionalIdeal R₁⁰ K)

{K : Type u_3}
[Field K]
{R₁ : Type u_4}
[CommRing R₁]
[IsDomain R₁]
[Algebra R₁ K]
[IsFractionRing R₁ K]
{I : FractionalIdeal R₁⁰ K}
(hI : I ≠ 0)
{x : K}


/--
`LawfulBEq α` is a typeclass which asserts that the `BEq α` implementation
(which supplies the `a == b` notation) coincides with logical equality `a = b`.
In other words, `a == b` implies `a = b`, and `a == a` is true.
-/
class LawfulBEq (α : Type u) [BEq α] : Prop where
  /-- If `a == b` evaluates to `true`, then `a` and `b` are equal in the logic. -/
  eq_of_beq : {a b : α} → a == b → a = b
  /-- `==` is reflexive, that is, `(a == a) = true`. -/
  protected rfl : {a : α} → a == a

{α : Type u}
[BEq α]
[self : LawfulBEq α]
{a b : α}


@[simp, reassoc]
theorem morphismRestrict_ι {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    (f ∣_ U) ≫ U.ι = (f ⁻¹ᵁ U).ι ≫ f

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(U : Y.Opens)

f ∣_ U ≫ U.ι = ((TopologicalSpace.Opens.map f.val.base).obj U).ι ≫ f


@[to_additive norm_ne_zero_iff]
theorem norm_ne_zero_iff' : ‖a‖ ≠ 0 ↔ a ≠ 1

‖a‖ ≠ 0 ↔ a ≠ 1


lemma integrable (f : 𝓢(D, V)) : Integrable f μ

{D : Type u_3}
{V : Type u_7}
[NormedAddCommGroup D]
[NormedSpace ℝ D]
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[MeasurableSpace D]
[BorelSpace D]
[SecondCountableTopology D]
{μ : MeasureTheory.Measure D}
[hμ : μ.HasTemperateGrowth]
(f : SchwartzMap D V)


/-- The norm of the `0` operator is `0`. -/
theorem opNorm_zero : ‖(0 : E →SL[σ₁₂] F)‖ = 0

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}


/-- Every finite subset of a linearly independent set is linearly independent. -/
theorem linearIndependent_finset_map_embedding_subtype (s : Set M)
    (li : LinearIndependent R ((↑) : s → M)) (t : Finset s) :
    LinearIndependent R ((↑) : Finset.map (Embedding.subtype s) t → M)

(li : LinearIndependent (ι := { x // x ∈ s }) R Subtype.val)


theorem UniformContinuous.prod_mk_left {f : α × β → γ} (h : UniformContinuous f) (b) :
    UniformContinuous fun a => f (a, b)

{α : Type ua}
{β : Type ub}
{γ : Type uc}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
{f : α × β → γ}
(h : UniformContinuous f)
(b : β)


theorem cons_diff_of_mem {a : α} {l₂ : List α} (h : a ∈ l₂) (l₁ : List α) :
    (a :: l₁).diff l₂ = l₁.diff (l₂.erase a)

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a : α}
{l₂ : List α}
(h : a ∈ l₂)
(l₁ : List α)


/-- The functor which sends `[n]` to the simplicial set `Δ[n]` equipped by
the obvious augmentation towards the terminal object of the category of sets. -/
@[simps]
noncomputable def standardSimplex : SimplexCategory ⥤ SSet.Augmented.{u}

(SSet.Augmented.standardSimplex.obj Δ).right = ⊤_ Type u


lemma preimage_subset_of_surjOn {t : Set β} (hf : Injective f) (h : SurjOn f s t) :
    f ⁻¹' t ⊆ s

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{s : Set α}
{t : Set β}
(hf : Function.Injective f)
(h : Set.SurjOn f s t)


theorem eq_of_forall_π_app_eq (a b : C)
    (h : ∀ (J : Finset ι), π_app C (· ∈ J) a = π_app C (· ∈ J) b) : a = b

(h :
  ∀ (J : Finset ι),
    (Profinite.IndexFunctor.π_app C fun x => x ∈ J) a = (Profinite.IndexFunctor.π_app C fun x => x ∈ J) b)


lemma mk_sub {x y : PGame} (hx : x.Numeric) (hy : y.Numeric) :
    Surreal.mk (x - y) (hx.sub hy) = Surreal.mk x hx - Surreal.mk y hy

{x y : SetTheory.PGame}
(hx : x.Numeric)
(hy : y.Numeric)

Surreal.mk (x - y) ⋯ = Surreal.mk x hx - Surreal.mk y hy


@[simp]
theorem leftDual_v [LeftRigidCategory V] : (ᘁX).V = ᘁX.V

(X : Action V ((CategoryTheory.forget₂ Grp MonCat).obj H))


/-- Eta rule for cones. -/
@[simps!]
def eta (c : Cone F) : c ≅ ⟨c.pt, c.π⟩

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

(CategoryTheory.Limits.Cones.eta c).hom.hom = 𝟙 c.pt


theorem Nonempty.of_disjSups_left : (s ○ t).Nonempty → s.Nonempty

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
[OrderBot α]
[DecidableRel Disjoint]
{s t : Finset α}


@[simp, norm_cast]
theorem coeIdeal_bot : ((⊥ : Ideal R) : FractionalIdeal S P) = 0

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


theorem disjoint_mul_inv_of_mem_cycleFactorsFinset {f g : Perm α} (h : f ∈ cycleFactorsFinset g) :
    Disjoint (g * f⁻¹) f

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{f g : Equiv.Perm α}
(h : f ∈ g.cycleFactorsFinset)


/-- If `x` is a fixed point of `f`, then `f x = x`. This is useful, e.g., for `rw` or `simp`. -/
protected theorem eq (hf : IsFixedPt f x) : f x = x

{α : Type u}
{f : α → α}
{x : α}
(hf : Function.IsFixedPt f x)


@[to_additive]
theorem tprod_eq_tprod_of_hasProd_iff_hasProd {f : β → α} {g : γ → α}
    (h : ∀ {a}, HasProd f a ↔ HasProd g a) : ∏' b, f b = ∏' c, g c

(h : ∀ {a : α}, HasProd f a ↔ HasProd g a)


@[simp]
theorem whiskerRight_hom {X Y : Action V G} (f : X ⟶ Y) (Z : Action V G) :
    (f ▷ Z).hom = f.hom ▷ Z.V

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
[CategoryTheory.MonoidalCategory V]
{X Y : Action V G}
(f : X ⟶ Y)
(Z : Action V G)

(CategoryTheory.MonoidalCategory.whiskerRight f Z).hom = CategoryTheory.MonoidalCategory.whiskerRight f.hom Z.V


@[to_additive (attr := simp)]
theorem Submonoid.equivMapOfInjective_coe_mulEquiv (e : M ≃* N) :
    S.equivMapOfInjective (e : M →* N) (EquivLike.injective e) = e.submonoidMap S

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(S : Submonoid M)
(e : M ≃* N)

S.equivMapOfInjective ↑e ⋯ = e.submonoidMap S


theorem ext_iff (x y : L') : x = y ↔ (x : L) = y

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


@[gcongr]
theorem Ioc_subset_Ioc_left (h : a₁ ≤ a₂) : Ioc a₂ b ⊆ Ioc a₁ b

{α : Type u_1}
[Preorder α]
{a₁ a₂ b : α}
(h : a₁ ≤ a₂)


theorem subset_sInter {S : Set (Set α)} {t : Set α} (h : ∀ t' ∈ S, t ⊆ t') : t ⊆ ⋂₀ S

{α : Type u_1}
{S : Set (Set α)}
{t : Set α}
(h : ∀ t' ∈ S, t ⊆ t')


lemma piecewise_mem_set_pi (hf : f ∈ Set.pi t t') (hg : g ∈ Set.pi t t') :
    s.piecewise f g ∈ Set.pi t t'

{ι : Type u_1}
(s : Finset ι)
[(j : ι) → Decidable (j ∈ s)]
{π : ι → Type u_3}
{t : Set ι}
{t' : (i : ι) → Set (π i)}
{f g : (i : ι) → π i}
(hf : f ∈ t.pi t')
(hg : g ∈ t.pi t')


/-- If `f : X → Z` is a surjective Borel measurable map from a standard Borel space
to a countably separated measurable space, then the preimage of a set `s`
is measurable if and only if the set is measurable.
One implication is the definition of measurability, the other one heavily relies on `X` being a
standard Borel space. -/
theorem measurableSet_preimage_iff_of_surjective [CountablySeparated Z]
    {f : X → Z} (hf : Measurable f) (hsurj : Surjective f) {s : Set Z} :
    MeasurableSet (f ⁻¹' s) ↔ MeasurableSet s

{X : Type u_3}
{Z : Type u_5}
[MeasurableSpace X]
[StandardBorelSpace X]
[MeasurableSpace Z]
[MeasurableSpace.CountablySeparated Z]
{f : X → Z}
(hf : Measurable f)
(hsurj : Function.Surjective f)
{s : Set Z}


@[to_additive]
theorem Submonoid.topologicalClosure_minimal (s : Submonoid M) {t : Submonoid M} (h : s ≤ t)
    (ht : IsClosed (t : Set M)) : s.topologicalClosure ≤ t

{M : Type u_3}
[TopologicalSpace M]
[AddMonoid M]
[ContinuousAdd M]
(s : AddSubmonoid M)
{t : AddSubmonoid M}
(h : s ≤ t)
(ht : IsClosed ↑t)


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

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

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


lemma le_iff_max'_mem {s t : Colex α} :
    s ≤ t ↔ ∀ h : s ≠ t, (ofColex s ∆ ofColex t).max' (max_mem_aux h) ∈ ofColex t

{α : Type u_1}
[LinearOrder α]
{s t : Finset.Colex α}

s ≤ t ↔ ∀ (h : s ≠ t), (symmDiff s.ofColex t.ofColex).max' ⋯ ∈ t.ofColex


@[simp]
theorem inl_le_inl_iff [LE α] [LE β] {a b : α} : (inl a : α ⊕ β) ≤ inl b ↔ a ≤ b

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


theorem revzip_sublists (l : List α) : ∀ l₁ l₂, (l₁, l₂) ∈ revzip l.sublists → l₁ ++ l₂ ~ l

(l₁, l₂) ∈ l.sublists.revzip → (l₁ ++ l₂).Perm l


theorem le_map_map_zero : f 0 + ⌊g 0⌋ ≤ f (g 0)


@[simp]
theorem mk_lt_mk [LT α] {p : α → Prop} {x y : α} {hx : p x} {hy : p y} :
    (⟨x, hx⟩ : Subtype p) < ⟨y, hy⟩ ↔ x < y

{α : Type u_2}
[LT α]
{p : α → Prop}
{x y : α}
{hx : p x}
{hy : p y}


theorem gcd_rec (m n : Nat) : gcd m n = gcd (n % m) m


theorem cocompact_le_atTop [OrderBot α] [CompactIccSpace α] :
    cocompact α ≤ atTop

{α : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[OrderBot α]
[CompactIccSpace α]


theorem Ioc_mem_nhdsWithin_Ioi' {a b : α} (H : a < b) : Ioc a b ∈ 𝓝[>] a

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{a b : α}
(H : a < b)


theorem ChartedSpace.secondCountable_of_countable_cover [SecondCountableTopology H] {s : Set M}
    (hs : ⋃ (x) (_ : x ∈ s), (chartAt H x).source = univ) (hsc : s.Countable) :
    SecondCountableTopology M

(hs : ⋃ x ∈ s, (chartAt H x).source = Set.univ)


/-- To rewrite from right to left, use `Finset.inf'_comp_eq_map`. -/
@[simp]
theorem inf'_map {s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : (s.map f).Nonempty) :
    (s.map f).inf' hs g = s.inf' (map_nonempty.1 hs) (g ∘ f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeInf α]
{s : Finset γ}
{f : γ ↪ β}
(g : β → α)
(hs : (Finset.map f s).Nonempty)

(Finset.map f s).inf' hs g = s.inf' ⋯ (g ∘ ⇑f)


theorem mem_image2_of_mem (ha : a ∈ s) (hb : b ∈ t) : f a b ∈ image2 f s t

{α : Type u}
{β : Type v}
{γ : Type w}
{f : α → β → γ}
{s : Set α}
{t : Set β}
{a : α}
{b : β}
(ha : a ∈ s)
(hb : b ∈ t)


theorem directedOn_image {s : Set β} {f : β → α} :
    DirectedOn r (f '' s) ↔ DirectedOn (f ⁻¹'o r) s

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


lemma innerRegularWRT_isClosed_isOpen [R1Space α] [OpensMeasurableSpace α] [h : InnerRegular μ] :
    InnerRegularWRT μ IsClosed IsOpen

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[R1Space α]
[OpensMeasurableSpace α]
[h : μ.InnerRegular]


theorem pi_eq_empty (hs : i ∈ s) (ht : t i = ∅) : s.pi t = ∅

{ι : Type u_1}
{α : ι → Type u_2}
{s : Set ι}
{t : (i : ι) → Set (α i)}
{i : ι}
(hs : i ∈ s)
(ht : t i = ∅)


theorem inf_comm (a b : α) : a ⊓ b = b ⊓ a

{α : Type u}
[SemilatticeInf α]
(a b : α)


lemma cfcₙHom_mono {a : A} (ha : p a) {f g : C(σₙ R a, R)₀} (hfg : f ≤ g) :
    cfcₙHom ha f ≤ cfcₙHom ha g

[∀ (α : Type u_1) [inst : Zero α] [inst_1 : TopologicalSpace α], StarOrderedRing C(α, R)₀]


@[simp]
theorem comp_nil {a b : V} (p : Path a b) : p.comp Path.nil = p

{V : Type u}
[Quiver V]
{a b : V}
(p : Quiver.Path a b)


@[to_additive]
theorem prod_eq_one [∀ i, Zero (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)] [CommMonoid γ]
    {f : Π₀ i, β i} {h : ∀ i, β i → γ} (hyp : ∀ i, h i (f i) = 1) : f.prod h = 1

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


theorem range'_eq_map_range (s n : Nat) : range' s n = map (s + ·) (range n)

List.range' s n = List.map (fun x => s + x) (List.range n)


@[simp]
theorem preimage_sInter {f : α → β} {s : Set (Set β)} : f ⁻¹' ⋂₀ s = ⋂ t ∈ s, f ⁻¹' t

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


theorem peirce (a b : Prop) : ((a → b) → a) → a


lemma sup'_image₂_left (g : γ → δ) (h : (image₂ f s t).Nonempty) :
    sup' (image₂ f s t) h g =
      sup' s h.of_image₂_left fun x ↦ sup' t h.of_image₂_right (g <| f x ·)

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{δ : Type u_7}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
[SemilatticeSup δ]
(g : γ → δ)
(h : (Finset.image₂ f s t).Nonempty)

(Finset.image₂ f s t).sup' h g = s.sup' ⋯ fun x => t.sup' ⋯ fun x_1 => g (f x x_1)


@[simp]
lemma div_zero {a : EReal} : a / 0 = 0


theorem mul_le_mul_left {n m : Nat} (k : Nat) (h : n ≤ m) : k * n ≤ k * m


@[simp]
theorem Prop.top_eq_true : (⊤ : Prop) = True


@[simp, nolint simpNF]
theorem type_uLift_aux (r : α → α → Prop) [IsWellOrder α r] :
    @type.{max v u} _ (fun x y => r (ULift.down.{v,u} x) (ULift.down.{v,u} y))
      (inferInstanceAs (IsWellOrder (ULift α) (ULift.down ⁻¹'o r))) = lift.{v} (type r)

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

(Ordinal.type fun x y => r x.down y.down) = Ordinal.lift.{v, u} (Ordinal.type r)


@[simp]
theorem SetLike.homogeneous_coe {A : ι → S} {i} (x : A i) : SetLike.Homogeneous A (x : R)

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[SetLike S R]
{A : ι → S}
{i : ι}
(x : ↥(A i))


@[simp]
theorem pi_div_two_le_arcsin {x} : π / 2 ≤ arcsin x ↔ 1 ≤ x


theorem IsLittleO.def' (h : f =o[l] g) (hc : 0 < c) : IsBigOWith c l f g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{c : ℝ}
{f : α → E}
{g : α → F}
{l : Filter α}
(h : f =o[l] g)
(hc : 0 < c)


@[to_additive (attr := simp)]
theorem prod_cons (a : α) (s) : prod (a ::ₘ s) = a * prod s

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


/-- In a finite dimensional vector space over `ℝ`, the series `∑ x, ‖f x‖` is unconditionally
summable if and only if the series `∑ x, f x` is unconditionally summable. One implication holds in
any complete normed space, while the other holds only in finite dimensional spaces. -/
theorem summable_norm_iff {α E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [FiniteDimensional ℝ E] {f : α → E} : (Summable fun x => ‖f x‖) ↔ Summable f

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{f : α → E}


theorem indicator_meas_zero (hs : μ s = 0) : indicator s f =ᵐ[μ] 0

{α : Type u_2}
{β : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → β}
[Zero β]
(hs : μ s = 0)


@[simp]
theorem toAlternatingMap_zero : (0 : M [⋀^ι]→L[R] N).toAlternatingMap = 0

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]

ContinuousAlternatingMap.toAlternatingMap 0 = 0


@[simp]
lemma sumCoeffsExp_p_eq_one : ∑ i, a i * (b i) ^ p a b = 1

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

∑ i : α, a i * b i ^ AkraBazziRecurrence.p a b = 1


theorem isBasis_countableBasis [SecondCountableTopology α] :
    IsTopologicalBasis (countableBasis α)

(α : Type u)
[t : TopologicalSpace α]
[SecondCountableTopology α]


/-- There exists a "small" non-zero algebraic integral solution of an
 non-trivial underdetermined system of linear equations with algebraic integer coefficients.-/
theorem exists_ne_zero_int_vec_house_le :
    ∃ (ξ : β → 𝓞 K), ξ ≠ 0 ∧ a *ᵥ ξ = 0 ∧
    ∀ l, house (ξ l).1 ≤ c₁ K * ((c₁ K * q * A) ^ ((p : ℝ) / (q - p)))

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

(habs : ∀ (k : α) (l : β), NumberField.house ((algebraMap (NumberField.RingOfIntegers K) K) (a k l)) ≤ A)

∃ ξ,
  ξ ≠ 0 ∧
    a.mulVec ξ = 0 ∧
      ∀ (l : β),
        NumberField.house ↑(ξ l) ≤ NumberField.house.c₁ K * (NumberField.house.c₁ K * ↑q * A) ^ (↑p / (↑q - ↑p))


@[simp]
theorem toDual_ofNat [NatCast α] (n : ℕ) [n.AtLeastTwo] :
    (toDual (no_index (OfNat.ofNat n : α))) = OfNat.ofNat n

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

OrderDual.toDual (OfNat.ofNat n) = OfNat.ofNat n


@[simp]
lemma mapZ_id : data.mapZ (𝟙 (Arrow.mk f)) = 𝟙 _

{W₁ W₂ : CategoryTheory.MorphismProperty C}

(data : W₁.FunctorialFactorizationData W₂)

data.mapZ (CategoryTheory.CategoryStruct.id (CategoryTheory.Arrow.mk f)) =
  CategoryTheory.CategoryStruct.id (data.factorizationData f).Z


protected theorem map_zero (f : A →ₛₙₐ[φ] B) : f 0 = 0

{R : Type u}
{S : Type u₁}
[Monoid R]
[Monoid S]
{φ : R →* S}
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction S B]
(f : A →ₛₙₐ[φ] B)


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

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{S : Set (NonUnitalSubalgebra R A)}
{x : A}


/--
For two preorders `α, β`, if `f : α → β` is surjective and strictly comonotonic, then a
strict series of `β` can be pulled back to a strict chain of `α` by
`b₀ < b₁ < ... < bₙ ↦ f⁻¹ b₀ < f⁻¹ b₁ < ... < f⁻¹ bₙ` where `f⁻¹ bᵢ` is an arbitrary element in the
preimage of `f⁻¹ {bᵢ}`.
-/
@[simps!]
noncomputable def comap (p : LTSeries β) (f : α → β)
  (comap : ∀ ⦃x y⦄, f x < f y → x < y)
  (surjective : Function.Surjective f) :
  LTSeries α

(comap : ∀ ⦃x y : α⦄, f x < f y → x < y)

(p.comap f comap surjective).toFun i = ⋯.choose


/-- If `s` has a greatest element, then it is bounded above. -/
theorem IsGreatest.bddAbove (h : IsGreatest s a) : BddAbove s

{α : Type u}
[Preorder α]
{s : Set α}
{a : α}
(h : IsGreatest s a)


theorem finite_norm_eq (x : e.finiteSubspace) : ‖x‖ = (e x).toReal

{𝕜 : Type u_1}
{V : Type u_2}
[NormedField 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
(e : ENorm 𝕜 V)
(x : ↥e.finiteSubspace)


theorem compl_anti : Antitone (compl : α → α)


nonrec theorem algEquiv_symm_mk' (x : R) (y : M) :
    (algEquiv M S).symm (mk' S x y) = mk' (Localization M) x y

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(x : R)
(y : ↥M)

(Localization.algEquiv M S).symm (IsLocalization.mk' S x y) = IsLocalization.mk' (Localization M) x y


theorem le_of_le_mul_of_le_one_of_nonneg_right [MulPosMono α] (h : a ≤ b * c) (hb : b ≤ 1)
    (hc : 0 ≤ c) : a ≤ c

{α : Type u_1}
{a b c : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[MulPosMono α]
(h : a ≤ b * c)
(hb : b ≤ 1)
(hc : 0 ≤ c)


theorem isIrreducible_iff_closure : IsIrreducible (closure s) ↔ IsIrreducible s

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


theorem map_permutationsAux (f : α → β) :
    ∀ ts is :
    List α, map (map f) (permutationsAux ts is) = permutationsAux (map f ts) (map f is)

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

List.map (List.map f) (ts.permutationsAux is) = (List.map f ts).permutationsAux (List.map f is)


theorem Fintype.card_subtype_eq' (y : α) [Fintype { x // y = x }] :
    Fintype.card { x // y = x } = 1

{α : Type u_1}
(y : α)
[Fintype { x // y = x }]


theorem of_mem_supp {α : Type u} {x : F α} {p : α → Prop} (h : Liftp p x) : ∀ y ∈ supp x, p y

{F : Type u → Type u}
[Functor F]
{α : Type u}
{x : F α}
{p : α → Prop}
(h : Functor.Liftp p x)
(y : α)


lemma measurable_memPartitionSet (ht : ∀ n, MeasurableSet (t n)) (n : ℕ) :
    Measurable (memPartitionSet t n)

{α : Type u_1}
[m : MeasurableSpace α]
{t : ℕ → Set α}
(ht : ∀ (n : ℕ), MeasurableSet (t n))
(n : ℕ)


@[simp] lemma id_f₃ : Hom.f₃ (𝟙 S) = 𝟙 _

(S : CategoryTheory.ShortComplex.SnakeInput C)

(CategoryTheory.CategoryStruct.id S).f₃ = CategoryTheory.CategoryStruct.id S.L₃


theorem neg_lt_of_tendsto_zero_of_pos {f : ℕ → ℝ} (hf : Tendsto f atTop (𝓝 0)) :
    ∀ {r : ℝ}, 0 < r → (-r : ℝ*) < ofSeq f

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


theorem biUnion_accumulate [Preorder α] (x : α) : ⋃ y ≤ x, Accumulate s y = ⋃ y ≤ x, s y

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

⋃ y, ⋃ (_ : y ≤ x), Set.Accumulate s y = ⋃ y, ⋃ (_ : y ≤ x), s y


@[simp]
theorem toHamming_sub [∀ i, Sub (β i)] {x y : ∀ i, β i} :
    toHamming (x - y) = toHamming x - toHamming y

{ι : Type u_2}
{β : ι → Type u_3}
[(i : ι) → Sub (β i)]
{x y : (i : ι) → β i}

Hamming.toHamming (x - y) = Hamming.toHamming x - Hamming.toHamming y


theorem projIcc_of_le_left (hx : x ≤ a) : projIcc a b h x = ⟨a, left_mem_Icc.2 h⟩

{α : Type u_1}
[LinearOrder α]
{a b : α}
(h : a ≤ b)
{x : α}
(hx : x ≤ a)


theorem Iic_mem_nhdsSet_Ico (h : b ≤ c) : Iic c ∈ 𝓝ˢ (Ico a b)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b c : α}
(h : b ≤ c)


theorem coeff_monomial_mul (a : R) :
    coeff R m (monomial R n a * φ) = if n ≤ m then a * coeff R (m - n) φ else 0

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(m n : σ →₀ ℕ)
(φ : MvPowerSeries σ R)
(a : R)

(MvPowerSeries.coeff R m) ((MvPowerSeries.monomial R n) a * φ) =
  if n ≤ m then a * (MvPowerSeries.coeff R (m - n)) φ else 0


@[trans]
theorem IsLittleO.trans_isBigO {f : α → E} {g : α → F} {k : α → G'} (hfg : f =o[l] g)
    (hgk : g =O[l] k) : f =o[l] k

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
{G' : Type u_8}
[Norm E]
[Norm F]
[SeminormedAddCommGroup G']
{l : Filter α}
{f : α → E}
{g : α → F}
{k : α → G'}
(hfg : f =o[l] g)
(hgk : g =O[l] k)


@[simp]
theorem coe_hom {X Y : T} (f : Y ⟶ X) : (f : Over X).hom = f

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


theorem toBasis_adjustToOrientation :
    (e.adjustToOrientation x).toBasis = e.toBasis.adjustToOrientation x

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{ι : Type u_2}
[Fintype ι]
[DecidableEq ι]
[ne : Nonempty ι]
(e : OrthonormalBasis ι ℝ E)
(x : Orientation ℝ E ι)


@[simp]
theorem fst_himp [HImp α] [HImp β] (a b : α × β) : (a ⇨ b).1 = a.1 ⇨ b.1

{α : Type u_2}
{β : Type u_3}
[HImp α]
[HImp β]
(a b : α × β)


theorem SmoothOn.inv₀ (hf : SmoothOn I' I f s) (h0 : ∀ x ∈ s, f x ≠ 0) :
    SmoothOn I' I (fun x => (f x)⁻¹) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Inv G]
[Zero G]
[SmoothInv₀ I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f : M → G}
{s : Set M}
(hf : SmoothOn I' I f s)
(h0 : ∀ x ∈ s, f x ≠ 0)


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

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


theorem equicontinuousWithinAt_unique [Unique ι] {F : ι → X → α} {S : Set X} {x : X} :
    EquicontinuousWithinAt F S x ↔ ContinuousWithinAt (F default) S x

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
[Unique ι]
{F : ι → X → α}
{S : Set X}
{x : X}


lemma fromSpec_toSpec {f : A} {m : ℕ} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) (x : Proj.T| pbo f) :
    FromSpec.toFun f_deg hm (toSpec 𝒜 f x) = x

(x : ↑↑((AlgebraicGeometry.Proj.toLocallyRingedSpace 𝒜).restrict ⋯).toPresheafedSpace)

AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.toFun f_deg hm
    ((AlgebraicGeometry.ProjIsoSpecTopComponent.toSpec 𝒜 f) x) =
  x


@[to_additive]
theorem mul_def : s * t = (s ×ˢ t).image fun p : α × α => p.1 * p.2

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

s + t = Finset.image (fun p => p.1 + p.2) (s ×ˢ t)


theorem isAddFundamentalDomain_Ioc' {T : ℝ} (hT : 0 < T) (t : ℝ) (μ : Measure ℝ := by volume_tac) :
    IsAddFundamentalDomain (AddSubgroup.op <| .zmultiples T) (Ioc t (t + T)) μ

(μ : MeasureTheory.Measure ℝ := by volume_tac)

MeasureTheory.IsAddFundamentalDomain (↥(AddSubgroup.zmultiples T).op) (Set.Ioc t (t + T)) μ


@[to_additive (attr := simp)]
theorem inf_apply : (p ⊓ q) x = ⨅ y, p y + q (x / y)

{E : Type u_4}
[CommGroup E]
(p q : GroupSeminorm E)
(x : E)


@[simp]
theorem comap_iInf {f : ι → Filter β} : comap m (⨅ i, f i) = ⨅ i, comap m (f i)

{α : Type u}
{β : Type v}
{ι : Sort x}
{m : α → β}
{f : ι → Filter β}

Filter.comap m (⨅ i, f i) = ⨅ i, Filter.comap m (f i)


@[simp, norm_cast]
theorem coe_sub (m m' : N) : (↑(m - m') : M) = (m : M) - (m' : M)

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(N : LieSubmodule R L M)
(m m' : ↥N)


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

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

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


@[to_additive (attr := ext)]
theorem OneHom.ext [One M] [One N] ⦃f g : OneHom M N⦄ (h : ∀ x, f x = g x) : f = g

{M : Type u_4}
{N : Type u_5}
[One M]
[One N]
⦃f g : OneHom M N⦄
(h : ∀ (x : M), f x = g x)


theorem aecover_Icc : AECover μ l fun i => Icc (a i) (b i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[Preorder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{a b : ι → α}
(ha : Filter.Tendsto a l Filter.atBot)
(hb : Filter.Tendsto b l Filter.atTop)

MeasureTheory.AECover μ l fun i => Set.Icc (a i) (b i)


@[simp]
theorem Ico_eq_zero_iff : Ico a b = 0 ↔ ¬a < b

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


theorem drop_subset (n) (l : List α) : drop n l ⊆ l


lemma primeFactors_div_gcd (hm : Squarefree m) (hn : n ≠ 0) :
    primeFactors (m / m.gcd n) = primeFactors m \ primeFactors n

{m n : ℕ}
(hm : Squarefree m)
(hn : n ≠ 0)

(m / m.gcd n).primeFactors = m.primeFactors \ n.primeFactors


@[fun_prop]
theorem DifferentiableWithinAt.smul_const (hc : DifferentiableWithinAt 𝕜 c s x) (f : F) :
    DifferentiableWithinAt 𝕜 (fun y => c y • f) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
{s : Set E}
{𝕜' : Type u_6}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : E → 𝕜'}
(hc : DifferentiableWithinAt 𝕜 c s x)
(f : F)


lemma exists_isCompact_closedBall [WeaklyLocallyCompactSpace α] (x : α) :
    ∃ r, 0 < r ∧ IsCompact (closedBall x r)

{α : Type u_2}
[PseudoMetricSpace α]
[WeaklyLocallyCompactSpace α]
(x : α)

∃ r, 0 < r ∧ IsCompact (Metric.closedBall x r)


theorem Separable.ne_zero [Nontrivial R] {f : R[X]} (h : f.Separable) : f ≠ 0

{R : Type u}
[CommSemiring R]
[Nontrivial R]
{f : R[X]}
(h : f.Separable)


@[simp]
theorem Limit.map_π_apply' {F G : J ⥤ Type v} (α : F ⟶ G) (j : J) (x : limit F) :
    limit.π G j (limMap α x) = α.app j (limit.π F j x)

{J : Type v}
[CategoryTheory.Category.{w, v} J]
{F G : J ⥤ Type v}
(α : F ⟶ G)
(j : J)
(x : CategoryTheory.Limits.limit F)

CategoryTheory.Limits.limit.π G j (CategoryTheory.Limits.limMap α x) = α.app j (CategoryTheory.Limits.limit.π F j x)


@[simp]
theorem eval₂_sub {S} [Ring S] (f : R →+* S) {x : S} :
    (p - q).eval₂ f x = p.eval₂ f x - q.eval₂ f x

{R : Type u}
[Ring R]
{p q : R[X]}
{S : Type u_1}
[Ring S]
(f : R →+* S)
{x : S}

Polynomial.eval₂ f x (p - q) = Polynomial.eval₂ f x p - Polynomial.eval₂ f x q


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


@[to_additive]
theorem smul_finset_subset_iff : a • s ⊆ t ↔ s ⊆ a⁻¹ • t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[AddGroup α]
[AddAction α β]
{s t : Finset β}
{a : α}


theorem subtype_Icc_eq : Icc a b = (Icc (a : α) b).subtype p

{α : Type u_1}
[Preorder α]
(p : α → Prop)
[DecidablePred p]
[LocallyFiniteOrder α]
(a b : Subtype p)

Finset.Icc a b = Finset.subtype p (Finset.Icc ↑a ↑b)


protected theorem dist_left (y : α) : LipschitzWith 1 (dist · y)

{α : Type u}
[PseudoMetricSpace α]
(y : α)


/-- The topological closure of a normal subgroup is normal. -/
@[to_additive "The topological closure of a normal additive subgroup is normal."]
theorem Subgroup.is_normal_topologicalClosure {G : Type*} [TopologicalSpace G] [Group G]
    [TopologicalGroup G] (N : Subgroup G) [N.Normal] : (Subgroup.topologicalClosure N).Normal

{G : Type u_1}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
(N : Subgroup G)
[N.Normal]


theorem iff_comp {r : Prop → α → Prop} : (· ↔ ·) ∘r r = r

Relation.Comp (fun x x_1 => x ↔ x_1) r = r


/-- A certain linear combination of the previous three identities,
which we'll want later.
-/
theorem variance (n : ℕ) :
    (∑ ν ∈ Finset.range (n + 1), (n • Polynomial.X - (ν : R[X])) ^ 2 * bernsteinPolynomial R n ν) =
      n • Polynomial.X * ((1 : R[X]) - Polynomial.X)

∑ ν ∈ Finset.range (n + 1), (n • Polynomial.X - ↑ν) ^ 2 * bernsteinPolynomial R n ν =
  n • Polynomial.X * (1 - Polynomial.X)


@[instance]
theorem isCountablyGenerated_bot : IsCountablyGenerated (⊥ : Filter α)


theorem rightLim_eq_sInf [TopologicalSpace α] [OrderTopology α] (h : 𝓝[>] x ≠ ⊥) :
    rightLim f x = sInf (f '' Ioi x)

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

Function.rightLim f x = sInf (f '' Set.Ioi x)


@[to_additive (attr := simp)]
theorem mul_right_inv (a : G) : a * a⁻¹ = 1


theorem Ioo_inter_Ioi : Ioo a b ∩ Ioi c = Ioo (max a c) b

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

Set.Ioo a b ∩ Set.Ioi c = Set.Ioo (max a c) b


theorem measure_inter_lt_top_of_right_ne_top (ht_finite : μ t ≠ ∞) : μ (s ∩ t) < ∞

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s t : Set α}
(ht_finite : μ t ≠ ⊤)


@[simp]
theorem le_sdiff_iff : x ≤ y \ x ↔ x = ⊥

{α : Type u}
{x y : α}
[GeneralizedBooleanAlgebra α]


/-- The pullback in the category of a `SemilatticeInf` with `OrderTop` is the same as the infimum
over the objects.
-/
@[simp]
theorem pullback_eq_inf [SemilatticeInf α] [OrderTop α] {x y z : α} (f : x ⟶ z) (g : y ⟶ z) :
    pullback f g = x ⊓ y

{α : Type u}
[SemilatticeInf α]
[OrderTop α]
{x y z : α}
(f : x ⟶ z)
(g : y ⟶ z)

CategoryTheory.Limits.pullback f g = x ⊓ y


theorem length_mem_cyclicPermutations (l : List α) (h : l' ∈ cyclicPermutations l) :
    length l' = length l

{α : Type u}
{l' : List α}
(l : List α)
(h : l' ∈ l.cyclicPermutations)


theorem convexBodySumFun_eq_zero_iff (x : E K) :
    convexBodySumFun x = 0 ↔ x = 0

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

NumberField.mixedEmbedding.convexBodySumFun x = 0 ↔ x = 0


theorem arg_cos_add_sin_mul_I {θ : ℝ} (hθ : θ ∈ Set.Ioc (-π) π) : arg (cos θ + sin θ * I) = θ

(Complex.cos ↑θ + Complex.sin ↑θ * Complex.I).arg = θ


/-- Supremum of `s i`, `i : ι`, is equal to the supremum over `t : Finset ι` of suprema
`⨆ i ∈ t, s i`. This version assumes `ι` is a `Type*`. See `iSup_eq_iSup_finset'` for a version
that works for `ι : Sort*`. -/
theorem iSup_eq_iSup_finset (s : ι → α) : ⨆ i, s i = ⨆ t : Finset ι, ⨆ i ∈ t, s i

{α : Type u_2}
{ι : Type u_5}
[CompleteLattice α]
(s : ι → α)


@[simp]
theorem trans_refl : e.trans (refl 𝕜 P₂) = e

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(e : P ≃ᵃⁱ[𝕜] P₂)

e.trans (AffineIsometryEquiv.refl 𝕜 P₂) = e


@[simp]
theorem coe_toDiffeomorph_symm : ⇑e.toDiffeomorph.symm = e.symm

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


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

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


theorem measurable_findGreatest {p : α → ℕ → Prop} [∀ x, DecidablePred (p x)] {N}
    (hN : ∀ k ≤ N, MeasurableSet { x | p x k }) : Measurable fun x => Nat.findGreatest (p x) N

(hN : ∀ k ≤ N, MeasurableSet {x | p x k})


theorem HasFDerivAt.unique (h₀ : HasFDerivAt f f₀' x) (h₁ : HasFDerivAt f f₁' x) : f₀' = f₁'

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f₀' f₁' : E →L[𝕜] F}
{x : E}
(h₀ : HasFDerivAt f f₀' x)
(h₁ : HasFDerivAt f f₁' x)


theorem add_le_zero_iff_le_neg (a b : Int) : a + b ≤ 0 ↔ a ≤ - b


@[simp]
theorem LinearMap.toMatrix_one : LinearMap.toMatrix v₁ v₁ 1 = 1

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


theorem right_unitality (X : Type u) :
    (ρ_ ((free R).obj X)).hom =
      (𝟙 ((free R).obj X) ⊗ ε R) ≫ (μ R X (𝟙_ (Type u))).hom ≫ map (free R).obj (ρ_ X).hom

(CategoryTheory.MonoidalCategory.rightUnitor ((ModuleCat.free R).obj X)).hom =
  CategoryTheory.MonoidalCategory.tensorHom (𝟙 ((ModuleCat.free R).obj X)) (ModuleCat.Free.ε R) ≫
    (ModuleCat.Free.μ R X (𝟙_ (Type u))).hom ≫
      CategoryTheory.map (ModuleCat.free R).obj (CategoryTheory.MonoidalCategory.rightUnitor X).hom


theorem LinearMap.map_finsupp_total (f : M →ₗ[R] N) {ι : Type*} {g : ι → M} (l : ι →₀ R) :
    f (Finsupp.total ι M R g l) = Finsupp.total ι N R (f ∘ g) l

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(f : M →ₗ[R] N)
{ι : Type u_4}
{g : ι → M}
(l : ι →₀ R)

f ((Finsupp.total ι M R g) l) = (Finsupp.total ι N R (⇑f ∘ g)) l


theorem eq_add_gt (a : Nat) {b c : Nat} (h : c > a) : (a = b + c) = False


theorem _root_.IsTop.atTop_eq [Preorder α] {a : α} (ha : IsTop a) : atTop = 𝓟 (Ici a)

{α : Type u_3}
[Preorder α]
{a : α}
(ha : IsTop a)


theorem isAlgebraic_iff {x : S} : IsAlgebraic K x ↔ IsAlgebraic K (x : L)

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{S : IntermediateField K L}
{x : ↥S}


lemma isCoprime_of_gcd_eq_one_of_FLT {n : ℕ} {a b c : ℤ} (Hgcd : Finset.gcd {a, b, c} id = 1)
    (HF : a ^ n + b ^ n + c ^ n = 0) : IsCoprime a b

{n : ℕ}
{a b c : ℤ}
(Hgcd : {a, b, c}.gcd id = 1)
(HF : a ^ n + b ^ n + c ^ n = 0)


/-- The `DelProp` property is a strengthened version of the red-red invariant. -/
theorem DelProp.redred (h : DelProp c t n) : ∃ n', RedRed (c = black) t n'

∀ {α : Type u_1} {t : Batteries.RBNode α} {n : Nat},
  Batteries.RBNode.DelProp c t n → ∃ n', Batteries.RBNode.RedRed (c = Batteries.RBColor.black) t n'


@[to_additive]
theorem mul_iff_right [CommGroup β] [TopologicalGroup β] (hf : StronglyMeasurable f) :
    StronglyMeasurable (f * g) ↔ StronglyMeasurable g

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable (f + g) ↔ MeasureTheory.StronglyMeasurable g


@[to_additive]
theorem comap_mker (g : N →* P) (f : M →* N) : g.mker.comap f = mker (comp g f)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[MulOneClass M]
[MulOneClass N]
[MulOneClass P]
(g : N →* P)
(f : M →* N)

Submonoid.comap f (MonoidHom.mker g) = MonoidHom.mker (g.comp f)


theorem coe_sSup_of_directedOn {S : Set (NonUnitalSubring R)} (Sne : S.Nonempty)
    (hS : DirectedOn (· ≤ ·) S) : (↑(sSup S) : Set R) = ⋃ s ∈ S, ↑s

(hS : DirectedOn (fun x x_1 => x ≤ x_1) S)


@[simp] theorem runCatch_throw [Monad m] : runCatch (throw a : ExceptCpsT α m α) = pure a

{m : Type u_1 → Type u_2}
{α : Type u_1}
{a : α}
[Monad m]


nonrec theorem continuous_snd : Continuous (snd : tsze R M → M)

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


@[simp]
theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0

{c : ℝ}
{f : ℕ → Bool}
{n : ℕ}
(h : f n = false)


@[simp] theorem iff_or_self : ∀(a b : Bool), (b = (a || b)) ↔ (a → b)


theorem exp_units_conj' (y : 𝔸ˣ) (x : 𝔸) : exp 𝕂 (↑y⁻¹ * x * y) = ↑y⁻¹ * exp 𝕂 x * y

(𝕂 : Type u_1)
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(y : 𝔸ˣ)
(x : 𝔸)

NormedSpace.exp 𝕂 (↑y⁻¹ * x * ↑y) = ↑y⁻¹ * NormedSpace.exp 𝕂 x * ↑y


@[simp]
theorem kunion_cons {s} {l₁ l₂ : List (Sigma β)} :
    kunion (s :: l₁) l₂ = s :: kunion l₁ (kerase s.1 l₂)

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{s : Sigma β}
{l₁ l₂ : List (Sigma β)}

(s :: l₁).kunion l₂ = s :: l₁.kunion (List.kerase s.fst l₂)


@[to_additive]
theorem prod_extend_by_one [DecidableEq α] (s : Finset α) (f : α → β) :
    ∏ i ∈ s, (if i ∈ s then f i else 1) = ∏ i ∈ s, f i

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

(∑ i ∈ s, if i ∈ s then f i else 0) = ∑ i ∈ s, f i


@[simp] lemma den_pow (q : ℚ) (n : ℕ) : (q ^ n).den = q.den ^ n


theorem haveLebesgueDecomposition_mk (μ : Measure α) {f : α → ℝ} (hf : Measurable f)
    (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.HaveLebesgueDecomposition μ

{α : Type u_1}
{m : MeasurableSpace α}
{s t : MeasureTheory.SignedMeasure α}
(μ : MeasureTheory.Measure α)
{f : α → ℝ}
(hf : Measurable f)
(htμ : t ⟂ᵥ μ.toENNRealVectorMeasure)
(hadd : s = t + μ.withDensityᵥ f)


theorem ContMDiffWithinAt.inv₀ (hf : ContMDiffWithinAt I' I n f s a) (ha : f a ≠ 0) :
    ContMDiffWithinAt I' I n (fun x => (f x)⁻¹) s a

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Inv G]
[Zero G]
[SmoothInv₀ I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{n : ℕ∞}
{f : M → G}
{s : Set M}
{a : M}
(hf : ContMDiffWithinAt I' I n f s a)
(ha : f a ≠ 0)


@[simp]
theorem map_gfp : f (gfp f) = gfp f

{α : Type u}
[CompleteLattice α]
(f : α →o α)


theorem Icc_filter_lt_of_lt_right {a b c : α} [DecidablePred (· < c)] (h : b < c) :
    (Icc a b).filter (· < c) = Icc a b

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

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


@[measurability]
theorem Measurable.inner_const {_ : MeasurableSpace α} [MeasurableSpace E] [OpensMeasurableSpace E]
    [SecondCountableTopology E] {c : E} {f : α → E} (hf : Measurable f) :
    Measurable fun t => ⟪f t, c⟫

{α : Type u_1}
{𝕜 : Type u_2}
{E : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]

∀ {x : MeasurableSpace α} [inst : MeasurableSpace E] [inst_1 : OpensMeasurableSpace E]
  [inst_2 : SecondCountableTopology E] {c : E} {f : α → E}, Measurable f → Measurable fun t => ⟪f t, c⟫_𝕜


@[simp]
theorem finsuppTensorFinsupp_apply (f : ι →₀ M) (g : κ →₀ N) (i : ι) (k : κ) :
    finsuppTensorFinsupp R S M N ι κ (f ⊗ₜ g) (i, k) = f i ⊗ₜ g k

(R : Type u_1)
(S : Type u_2)
(M : Type u_3)
(N : Type u_4)
(ι : Type u_5)
(κ : Type u_6)
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
[Semiring S]
[Algebra R S]
[Module S M]
[IsScalarTower R S M]
(f : ι →₀ M)
(g : κ →₀ N)
(i : ι)
(k : κ)

((finsuppTensorFinsupp R S M N ι κ) (f ⊗ₜ[R] g)) (i, k) = f i ⊗ₜ[R] g k


theorem wbtw_midpoint (x y : P) : Wbtw R x (midpoint R x y) y

(R : Type u_1)
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(x y : P)


theorem inf_of_left (h : μ.FiniteAtFilter f) : μ.FiniteAtFilter (f ⊓ g)

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : Filter α}
(h : μ.FiniteAtFilter f)


/-- Unweighted mean inequality, version for two elements of `ℝ≥0∞` and real exponents. -/
theorem rpow_add_le_mul_rpow_add_rpow (z₁ z₂ : ℝ≥0∞) {p : ℝ} (hp : 1 ≤ p) :
    (z₁ + z₂) ^ p ≤ (2 : ℝ≥0∞) ^ (p - 1) * (z₁ ^ p + z₂ ^ p)


/-- A unique factorization domain with at least one irreducible element
in which all irreducible elements are associated
is a discrete valuation ring.
-/
theorem of_ufd_of_unique_irreducible {R : Type u} [CommRing R] [IsDomain R]
    [UniqueFactorizationMonoid R] (h₁ : ∃ p : R, Irreducible p)
    (h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q) :
    DiscreteValuationRing R


@[simp]
theorem coe_inclusion {E F : IntermediateField K L} (hEF : E ≤ F) (e : E) :
    (inclusion hEF e : L) = e

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{E F : IntermediateField K L}
(hEF : E ≤ F)
(e : ↥E)

↑((IntermediateField.inclusion hEF) e) = ↑e


/--
An `InjectiveResolution Z` consists of a bundled `ℕ`-indexed cochain complex of injective objects,
along with a quasi-isomorphism from the complex consisting of just `Z` supported in degree `0`.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure InjectiveResolution (Z : C) where
  /-- the cochain complex involved in the resolution -/
  cocomplex : CochainComplex C ℕ
  /-- the cochain complex must be degreewise injective -/
  injective : ∀ n, Injective (cocomplex.X n) := by infer_instance
  /-- the cochain complex must have homology -/
  [hasHomology : ∀ i, cocomplex.HasHomology i]
  /-- the morphism from the single cochain complex with `Z` in degree `0` -/
  ι : (single₀ C).obj Z ⟶ cocomplex
  /-- the morphism from the single cochain complex with `Z` in degree `0` is a quasi-isomorphism -/
  quasiIso : QuasiIso ι := by infer_instance

(self : CategoryTheory.InjectiveResolution Z)


/-- Postcomposition of a 1-morphism as a functor. -/
@[simps]
def postcomp (a : B) (f : b ⟶ c) : (a ⟶ b) ⥤ (a ⟶ c)

{B : Type u}
[CategoryTheory.Bicategory B]
{b c : B}
(a : B)
(f : b ⟶ c)

∀ {X Y : a ⟶ b} (x : X ⟶ Y), (CategoryTheory.Bicategory.postcomp a f).map x = CategoryTheory.Bicategory.whiskerRight x f


/-- Two measures which are finite on closed-open intervals are equal if they agree on all
open-closed intervals. -/
theorem ext_of_Ioc' {α : Type*} [TopologicalSpace α] {m : MeasurableSpace α}
    [SecondCountableTopology α] [LinearOrder α] [OrderTopology α] [BorelSpace α] [NoMinOrder α]
    (μ ν : Measure α) (hμ : ∀ ⦃a b⦄, a < b → μ (Ioc a b) ≠ ∞)
    (h : ∀ ⦃a b⦄, a < b → μ (Ioc a b) = ν (Ioc a b)) : μ = ν

(hμ : ∀ ⦃a b : α⦄, a < b → μ (Set.Ioc a b) ≠ ⊤)

(h : ∀ ⦃a b : α⦄, a < b → μ (Set.Ioc a b) = ν (Set.Ioc a b))


@[simp]
theorem comp_continuous_iff (h : X ≃ₜ Y) {f : Z → X} : Continuous (h ∘ f) ↔ Continuous f

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(h : X ≃ₜ Y)
{f : Z → X}


@[simp]
theorem truncate_liftFun (s : S) : WittVector.truncate n (liftFun f s) = f n s

{f : (k : ℕ) → S →+* TruncatedWittVector p k R}

(f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), (TruncatedWittVector.truncate hk).comp (f k₂) = f k₁)

(WittVector.truncate n) (WittVector.liftFun f s) = (f n) s


theorem IsPrime.mem_or_compl_mem (hI : IsPrime I) : x ∈ I ∨ xᶜ ∈ I

{P : Type u_1}
[BooleanAlgebra P]
{x : P}
{I : Order.Ideal P}
(hI : I.IsPrime)

x ∈ I ∨ xᶜ ∈ I


/-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories
    `Comma L R₁ ≌ Comma L R₂`. -/
@[simps!]
def mapRightIso (i : R₁ ≅ R₂) : Comma L R₁ ≌ Comma L R₂

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

((CategoryTheory.Comma.mapRightIso L i).counitIso.hom.app X).right = CategoryTheory.CategoryStruct.id X.right


@[simp]
lemma Tor'_map_app' (n : ℕ) {X Y : C} (f : X ⟶ Y) (Z : C) :
    ((Tor' C n).map f).app Z = (Functor.leftDerived ((tensoringRight C).obj Z) n).map f

((CategoryTheory.Tor' C n).map f).app Z =
  (((CategoryTheory.MonoidalCategory.tensoringRight C).obj Z).leftDerived n).map f


@[simp]
theorem ofNat_lt_lift_iff {a : Cardinal.{u}} {n : ℕ} [n.AtLeastTwo] :
    (no_index (OfNat.ofNat n : Cardinal)) < lift.{v} a ↔ (OfNat.ofNat n : Cardinal) < a

OfNat.ofNat n < Cardinal.lift.{v, u} a ↔ OfNat.ofNat n < a


theorem cast_toNat_of_aleph0_le {c : Cardinal} (h : ℵ₀ ≤ c) : ↑(toNat c) = (0 : Cardinal)

{c : Cardinal.{u_1}}
(h : Cardinal.aleph0 ≤ c)


theorem toTopologicalSpace_top : @UniformSpace.toTopologicalSpace α ⊤ = ⊤


theorem square_commutes : SumEval C ho ∘ Sum.inl =
    ModuleCat.ofHom (πs C o) ∘ eval (π C (ord I · < o))

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

Profinite.NobelingProof.GoodProducts.SumEval C ho ∘ Sum.inl =
  ⇑(ModuleCat.ofHom (Profinite.NobelingProof.πs C o)) ∘
    Profinite.NobelingProof.GoodProducts.eval (Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o)


/-- Any first countable topological group has an antitone neighborhood basis `u : ℕ → Set G` for
which `(u (n + 1)) ^ 2 ⊆ u n`. The existence of such a neighborhood basis is a key tool for
`QuotientGroup.completeSpace` -/
@[to_additive
  "Any first countable topological additive group has an antitone neighborhood basis
  `u : ℕ → set G` for which `u (n + 1) + u (n + 1) ⊆ u n`.
  The existence of such a neighborhood basis is a key tool for `QuotientAddGroup.completeSpace`"]
theorem TopologicalGroup.exists_antitone_basis_nhds_one :
    ∃ u : ℕ → Set G, (𝓝 1).HasAntitoneBasis u ∧ ∀ n, u (n + 1) * u (n + 1) ⊆ u n

(G : Type w)
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
[FirstCountableTopology G]

∃ u, (𝓝 1).HasAntitoneBasis u ∧ ∀ (n : ℕ), u (n + 1) * u (n + 1) ⊆ u n


theorem psigmaCongrRight_refl {α} {β : α → Sort*} :
    (psigmaCongrRight fun a => Equiv.refl (β a)) = Equiv.refl (Σ' a, β a)

(Equiv.psigmaCongrRight fun a => Equiv.refl (β a)) = Equiv.refl ((a : α) ×' β a)


@[simp]
theorem id_f (X : Center C) : Hom.f (𝟙 X) = 𝟙 X.1

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


@[gcongr] protected theorem mul_right (c : ℤ) (h : a ≡ b [ZMOD n]) : a * c ≡ b * c [ZMOD n]

{n a b : ℤ}
(c : ℤ)
(h : a ≡ b [ZMOD n])


@[simp]
lemma mk₀_comp_mk₀_assoc (f : X ⟶ Y) (g : Y ⟶ Z) {a : M}
    (ha : a = 0) {d : M} (h : ShiftedHom Z T d) :
    (mk₀ a ha f).comp ((mk₀ a ha g).comp h
        (show _ = d by rw [ha, add_zero])) (show _ = d by rw [ha, add_zero]) =
      (mk₀ a ha (f ≫ g)).comp h (by rw [ha, add_zero])

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
{M : Type u_4}
[AddMonoid M]
[CategoryTheory.HasShift C M]
{X Y Z T : C}
(f : X ⟶ Y)
(g : Y ⟶ Z)
{a : M}
(ha : a = 0)
{d : M}
(h : CategoryTheory.ShiftedHom Z T d)

(CategoryTheory.ShiftedHom.mk₀ a ha f).comp ((CategoryTheory.ShiftedHom.mk₀ a ha g).comp h ⋯) ⋯ =
  (CategoryTheory.ShiftedHom.mk₀ a ha (CategoryTheory.CategoryStruct.comp f g)).comp h ⋯


@[to_additive (attr := simp)]
theorem map_inv_eq_self (μ : Measure G) [IsInvInvariant μ] : map Inv.inv μ = μ

{G : Type u_2}
[MeasurableSpace G]
[Inv G]
(μ : MeasureTheory.Measure G)
[μ.IsInvInvariant]


nonrec theorem mem_nthRootsFinset (hζ : IsPrimitiveRoot ζ k) (hk : 0 < k) :
    ζ ∈ nthRootsFinset k R

{R : Type u_4}
{k : ℕ}
{ζ : R}
[CommRing R]
[IsDomain R]
(hζ : IsPrimitiveRoot ζ k)
(hk : 0 < k)


@[to_additive (attr := simp)]
lemma subgroupCongr_symm_apply (h : H = K) (x) :
    ((MulEquiv.subgroupCongr h).symm x : G) = x

{G : Type u_1}
[AddGroup G]
{H K : AddSubgroup G}
(h : H = K)
(x : ↥K)

↑((AddEquiv.addSubgroupCongr h).symm x) = ↑x


lemma dblXYZ_of_Y_eq {P Q : Fin 3 → F} (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2)
    (hy : P y * Q z ^ 3 = Q y * P z ^ 3) (hy' : P y * Q z ^ 3 = W.negY Q * P z ^ 3) :
    W.dblXYZ P = W.dblU P • ![1, 1, 0]


@[simp]
theorem Matrix.toLinearMap₂_apply (M : Matrix n m N₂) (x : M₁) (y : M₂) :
    Matrix.toLinearMap₂ b₁ b₂ M x y = ∑ i, ∑ j, b₁.repr x i • b₂.repr y j • M i j

{R : Type u_1}
{M₁ : Type u_7}
{M₂ : Type u_8}
{N₂ : Type u_11}
{n : Type u_12}
{m : Type u_13}
[CommSemiring R]
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
[AddCommMonoid N₂]
[Module R N₂]
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
(b₁ : Basis n R M₁)
(b₂ : Basis m R M₂)
(M : Matrix n m N₂)
(x : M₁)
(y : M₂)

(((Matrix.toLinearMap₂ b₁ b₂) M) x) y = ∑ i : n, ∑ j : m, (b₁.repr x) i •> (b₂.repr y) j •> M i j


theorem openSegment_eq_image_lineMap (x y : E) :
    openSegment 𝕜 x y = AffineMap.lineMap x y '' Ioo (0 : 𝕜) 1

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(x y : E)

openSegment 𝕜 x y = ⇑(AffineMap.lineMap x y) '' Set.Ioo 0 1


theorem borel_le_measurable : borel ℝ ≤ f.outer.caratheodory


theorem TotallyBounded.subset {s₁ s₂ : Set α} (hs : s₁ ⊆ s₂) (h : TotallyBounded s₂) :
    TotallyBounded s₁

{α : Type u}
[uniformSpace : UniformSpace α]
{s₁ s₂ : Set α}
(hs : s₁ ⊆ s₂)
(h : TotallyBounded s₂)


theorem IndepFun.neg_right {_mβ : MeasurableSpace β} {_mβ' : MeasurableSpace β'} [Neg β']
    [MeasurableNeg β'] (hfg : IndepFun f g κ μ)  :
    IndepFun f (-g) κ μ

(hfg : ProbabilityTheory.Kernel.IndepFun f g κ μ)

ProbabilityTheory.Kernel.IndepFun f (-g) κ μ


lemma lift_fst :
    (Cochain.ofHom (lift φ α β eq)).comp (fst φ).1 (zero_add 1) = α.1

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

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

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

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


@[to_additive] lemma IsMulFreimanIso.comp (hg : IsMulFreimanIso n B C g)
    (hf : IsMulFreimanIso n A B f) : IsMulFreimanIso n A C (g ∘ f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[AddCommMonoid α]
[AddCommMonoid β]
[AddCommMonoid γ]
{A : Set α}
{B : Set β}
{C : Set γ}
{f : α → β}
{g : β → γ}
{n : ℕ}
(hg : IsAddFreimanIso n B C g)
(hf : IsAddFreimanIso n A B f)


theorem image_subset_sups_right : a ∈ s → (· ⊔ ·) a '' t ⊆ s ⊻ t

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

a ∈ s → (fun x x_1 => x ⊔ x_1) a '' t ⊆ s ⊻ t


theorem dist_eq_norm (f g : Lp E p μ) : dist f g = ‖f - g‖

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


@[reassoc (attr := simp)]
theorem xPrevIsoSelf_comp_dTo {j : ι} (h : ¬c.Rel (c.prev j) j) :
    (C.xPrevIsoSelf h).inv ≫ C.dTo j = 0


theorem count_apply_finite' {s : Set α} (s_fin : s.Finite) (s_mble : MeasurableSet s) :
    count s = s_fin.toFinset.card

{α : Type u_1}
[MeasurableSpace α]
{s : Set α}
(s_fin : s.Finite)
(s_mble : MeasurableSet s)

MeasureTheory.Measure.count s = ↑s_fin.toFinset.card


/-- Hölder's inequality for integrable functions: the scalar multiplication of an integrable
scalar-valued function by a vector-value function with finite essential supremum is integrable. -/
theorem Integrable.smul_essSup {𝕜 : Type*} [NormedRing 𝕜] [Module 𝕜 β] [BoundedSMul 𝕜 β]
    {f : α → 𝕜} (hf : Integrable f μ) {g : α → β}
    (g_aestronglyMeasurable : AEStronglyMeasurable g μ)
    (ess_sup_g : essSup (fun x => (‖g x‖₊ : ℝ≥0∞)) μ ≠ ∞) :
    Integrable (fun x : α => f x • g x) μ

(g_aestronglyMeasurable : MeasureTheory.AEStronglyMeasurable g μ)

(ess_sup_g : essSup (fun x => ↑‖g x‖₊) μ ≠ ⊤)

MeasureTheory.Integrable (fun x => f x • g x) μ


@[simp]
theorem nonsing_inv_nonsing_inv (h : IsUnit A.det) : A⁻¹⁻¹ = A

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


theorem card_fintype_uIcc : Fintype.card (Set.uIcc a b) = (b - a).natAbs + 1

Fintype.card ↑(Set.uIcc a b) = (b - a).natAbs + 1


@[to_additive (attr := simp, norm_cast)]
theorem coe_one [One M] : ↑(1 : α → M) = (1 : Germ l M)

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
[Zero M]


/-- `Fintype.prod_equiv` is a specialization of `Finset.prod_bij` that
automatically fills in most arguments.

See `Equiv.prod_comp` for a version without `h`.
-/
@[to_additive "`Fintype.sum_equiv` is a specialization of `Finset.sum_bij` that
automatically fills in most arguments.

See `Equiv.sum_comp` for a version without `h`."]
lemma prod_equiv (e : ι ≃ κ) (f : ι → α) (g : κ → α) (h : ∀ x, f x = g (e x)) :
    ∏ x, f x = ∏ x, g x

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[Fintype ι]
[Fintype κ]
[AddCommMonoid α]
(e : ι ≃ κ)
(f : ι → α)
(g : κ → α)
(h : ∀ (x : ι), f x = g (e x))


theorem Char.le_antisymm_iff {x y : Char} : x = y ↔ x ≤ y ∧ y ≤ x


@[simp]
theorem equivEquivIso_inv {X Y : Type u} (e : X ≅ Y) : equivEquivIso.symm e = e.toEquiv


/-- Given `w : TwoSquare T L R B` and `X₂ : C₂`, this is the obvious functor
`StructuredArrow X₂ T ⥤ StructuredArrow (R.obj X₂) B`. -/
@[simps! obj map]
def structuredArrowDownwards (X₂ : C₂) :
    StructuredArrow X₂ T ⥤ StructuredArrow (R.obj X₂) B

{C₁ : Type u₁}
{C₂ : Type u₂}
{C₃ : Type u₃}
{C₄ : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C₁]
[CategoryTheory.Category.{v₂, u₂} C₂]
[CategoryTheory.Category.{v₃, u₃} C₃]
[CategoryTheory.Category.{v₄, u₄} C₄]
{T : CategoryTheory.Functor C₁ C₂}
{L : CategoryTheory.Functor C₁ C₃}
{R : CategoryTheory.Functor C₂ C₄}
{B : CategoryTheory.Functor C₃ C₄}
(w : CategoryTheory.TwoSquare T L R B)
(X₂ : C₂)

∀ {X Y : CategoryTheory.StructuredArrow X₂ T} (f : X ⟶ Y),
  (w.structuredArrowDownwards X₂).map f =
    (CategoryTheory.StructuredArrow.pre (R.obj X₂) L B).map
      ((CategoryTheory.Comma.mapRight (CategoryTheory.Functor.fromPUnit (R.obj X₂)) w).map
        (CategoryTheory.StructuredArrow.homMk f.right ⋯))


@[simp]
theorem isEmptyEquiv_apply_tprod [IsEmpty ι] (f : Π i, s i) :
    isEmptyEquiv ι (tprod R f) = 1

(ι : Type u_1)
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
[IsEmpty ι]
(f : (i : ι) → s i)

(PiTensorProduct.isEmptyEquiv ι) ((PiTensorProduct.tprod R) f) = 1


lemma shiftIso_add_inv_app (n m a a' a'' : A) (ha' : n + a = a') (ha'' : m + a' = a'') (X : C) :
    (F.shiftIso (m + n) a a'' (by rw [add_assoc, ha', ha''])).inv.app X =
      (F.shiftIso n a a' ha').inv.app X ≫
      ((F.shiftIso m a' a'' ha'').inv.app X)⟦n⟧' ≫
      (shiftFunctorAdd D m n).inv.app ((F.functor a'').obj X)

(F : CategoryTheory.SingleFunctors C D A)

(F.shiftIso (m + n) a a'' ⋯).inv.app X =
  (F.shiftIso n a a' ha').inv.app X ≫
    (CategoryTheory.shiftFunctor D n).map ((F.shiftIso m a' a'' ha'').inv.app X) ≫
      (CategoryTheory.shiftFunctorAdd D m n).inv.app ((F.functor a'').obj X)


@[to_additive min_sub_sub_right]
theorem min_div_div_right' (a b c : α) : min (a / c) (b / c) = min a b / c

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


@[simp] theorem zero_ne_add_one (n : Nat) : 0 ≠ n + 1


lemma le_iff_le_forall_real_gt (x y : EReal) : (∀ z : ℝ, x < z → y ≤ z) ↔ y ≤ x


@[simp]
theorem id_left (U : Over X) : CommaMorphism.left (𝟙 U) = 𝟙 U.left

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
(U : CategoryTheory.Over X)

(CategoryTheory.CategoryStruct.id U).left = CategoryTheory.CategoryStruct.id U.left


theorem one_div_neg_eq_neg_one_div (a : K) : 1 / -a = -(1 / a)

{K : Type u_3}
[DivisionMonoid K]
[HasDistribNeg K]
(a : K)


@[to_additive (attr := simp, norm_cast)]
theorem coe_centralizer : ↑(centralizer S) = S.centralizer

{M : Type u_1}
(S : Set M)
[AddSemigroup M]

↑(AddSubsemigroup.centralizer S) = S.addCentralizer


@[simp]
theorem Iic_mem_nhdsSet_Iic_iff {a b : α} [NeBot (𝓝[>] b)] : Iic a ∈ 𝓝ˢ (Iic b) ↔ b < a

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
{a b : α}
[(𝓝[>] b).NeBot]


@[simp] theorem getElem_set_eq (a : Array α) (i : Fin a.size) (v : α) {j : Nat}
      (eq : i.val = j) (p : j < (a.set i v).size) :
    (a.set i v)[j]'p = v

{α : Type u_1}
(a : Array α)
(i : Fin a.size)
(v : α)
{j : Nat}
(eq : ↑i = j)
(p : j < (a.set i v).size)


theorem AddMonoidHom.toRatLinearMap_injective [AddCommGroup M] [Module ℚ M] [AddCommGroup M₂]
    [Module ℚ M₂] : Function.Injective (@AddMonoidHom.toRatLinearMap M M₂ _ _ _ _)

{M : Type u_1}
{M₂ : Type u_2}
[AddCommGroup M]
[Module ℚ M]
[AddCommGroup M₂]
[Module ℚ M₂]


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


@[simp]
theorem coe_of (R : Type u) [CommRing R] : (CommRingCat.of R : Type u) = R


/-- A version of `NormedSpace.exp_sum_of_commute` for a commutative Banach-algebra. -/
theorem exp_sum {ι} (s : Finset ι) (f : ι → 𝔸) : exp 𝕂 (∑ i ∈ s, f i) = ∏ i ∈ s, exp 𝕂 (f i)

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedCommRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
{ι : Type u_3}
(s : Finset ι)
(f : ι → 𝔸)

NormedSpace.exp 𝕂 (∑ i ∈ s, f i) = ∏ i ∈ s, NormedSpace.exp 𝕂 (f i)


theorem separatingLeft_toLinearMap₂'_of_det_ne_zero' (M : Matrix ι ι R₁) (h : M.det ≠ 0) :
    (Matrix.toLinearMap₂' R₁ M).SeparatingLeft (R := R₁)

{R₁ : Type u_2}
{ι : Type u_16}
[CommRing R₁]
[DecidableEq ι]
[Fintype ι]
[IsDomain R₁]
(M : Matrix ι ι R₁)
(h : M.det ≠ 0)


@[simp] theorem foldr_nil : [].foldr f b = b

∀ {α : Type u_1} {α_1 : Type u_2} {f : α → α_1 → α_1} {b : α_1}, List.foldr f b List.nil = b


theorem isPrime_of_irreducible_absNorm {I : Ideal S} (hI : Irreducible (Ideal.absNorm I)) :
    I.IsPrime

{S : Type u_1}
[CommRing S]
[IsDomain S]
[Nontrivial S]
[IsDedekindDomain S]
[Module.Free ℤ S]
{I : Ideal S}
(hI : Irreducible (Ideal.absNorm I))


@[simp] theorem H1LequivOfIsTrivial_symm_apply [A.IsTrivial] (f : Additive G →+ A) :
    (H1LequivOfIsTrivial A).symm f = H1_π A ((oneCocyclesLequivOfIsTrivial A).symm f)

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)
[A.IsTrivial]
(f : Additive G →+ CoeSort.coe A)

(groupCohomology.H1LequivOfIsTrivial A).symm f =
  (groupCohomology.H1_π A) ((groupCohomology.oneCocyclesLequivOfIsTrivial A).symm f)


theorem eventually_forall_le_dist_cast_div (hx : Irrational x) (n : ℕ) :
    ∀ᶠ ε : ℝ in 𝓝 0, ∀ m : ℤ, ε ≤ dist x (m / n)

∀ᶠ (ε : ℝ) in 𝓝 0, ∀ (m : ℤ), ε ≤ dist x (↑m / ↑n)


@[simp]
theorem Basis.coe_parallelepiped (b : Basis ι ℝ E) :
    (b.parallelepiped : Set E) = _root_.parallelepiped b

{ι : Type u_1}
{E : Type u_3}
[Fintype ι]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(b : Basis ι ℝ E)


/--
Assuming `G` is preconnected and `K` not empty, given any connected component `C` outside of `K`,
there exists a vertex `k ∈ K` adjacent to a vertex `v ∈ C`.
-/
theorem exists_adj_boundary_pair (Gc : G.Preconnected) (hK : K.Nonempty) :
    ∀ C : G.ComponentCompl K, ∃ ck : V × V, ck.1 ∈ C ∧ ck.2 ∈ K ∧ G.Adj ck.1 ck.2

{V : Type u}
{G : SimpleGraph V}
{K : Set V}
(Gc : G.Preconnected)
(hK : K.Nonempty)
(C : G.ComponentCompl K)

∃ ck, ck.1 ∈ C ∧ ck.2 ∈ K ∧ G.Adj ck.1 ck.2


@[to_additive]
theorem exponent_ne_zero_iff_range_orderOf_finite (h : ∀ g : G, 0 < orderOf g) :
    exponent G ≠ 0 ↔ (Set.range (orderOf : G → ℕ)).Finite

{G : Type u}
[Monoid G]
(h : ∀ (g : G), 0 < orderOf g)

Monoid.exponent G ≠ 0 ↔ (Set.range orderOf).Finite


theorem StrictMono.minimal_of_minimal_image (hf : StrictMono f) {a} (hmin : ∀ p, f a ≤ p) (x : α) :
    a ≤ x

{α : Type u}
{β : Type v}
[LinearOrder α]
[Preorder β]
{f : α → β}
(hf : StrictMono f)
{a : α}
(hmin : ∀ (p : β), f a ≤ p)
(x : α)


/-- If all prime ideals in a commutative ring are principal, so are all other ideals. -/
theorem IsPrincipalIdealRing.of_prime (H : ∀ P : Ideal R, P.IsPrime → P.IsPrincipal) :
    IsPrincipalIdealRing R

(H : ∀ (P : Ideal R), P.IsPrime → Submodule.IsPrincipal P)


@[simp]
theorem _root_.Subalgebra.valA_apply (p : Subalgebra R A) (x : p) : p.valA x = x

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
[Algebra R A]
(p : Subalgebra R A)
(x : ↥p)


lemma range_traceForm_le_span_weight :
    LinearMap.range (traceForm K L M) ≤ span K (range (Weight.toLinear K L M))

(K : Type u_2)
(L : Type u_3)
(M : Type u_4)
[LieRing L]
[AddCommGroup M]
[LieRingModule L M]
[Field K]
[LieAlgebra K L]
[Module K M]
[LieModule K L M]
[FiniteDimensional K M]
[LieAlgebra.IsNilpotent K L]
[LieModule.LinearWeights K L M]
[LieModule.IsTriangularizable K L M]

LinearMap.range (LieModule.traceForm K L M) ≤ Submodule.span K (Set.range (LieModule.Weight.toLinear K L M))


theorem power_pos {a : Cardinal} (b : Cardinal) (ha : 0 < a) : 0 < a ^ b

{a : Cardinal.{u_1}}
(b : Cardinal.{u_1})
(ha : 0 < a)


@[simp]
theorem mem_so [Fintype n] (A : Matrix n n R) : A ∈ so n R ↔ Aᵀ = -A

(n : Type u_1)
(R : Type u₂)
[DecidableEq n]
[CommRing R]
[Fintype n]
(A : Matrix n n R)

A ∈ LieAlgebra.Orthogonal.so n R ↔ A.transpose = -A


@[to_additive]
theorem NormedCommGroup.tendsto_nhds_nhds {f : E → F} {x : E} {y : F} :
    Tendsto f (𝓝 x) (𝓝 y) ↔ ∀ ε > 0, ∃ δ > 0, ∀ x', ‖x' / x‖ < δ → ‖f x' / y‖ < ε

{E : Type u_6}
{F : Type u_7}
[SeminormedGroup E]
[SeminormedGroup F]
{f : E → F}
{x : E}
{y : F}

Filter.Tendsto f (𝓝 x) (𝓝 y) ↔ ∀ ε > 0, ∃ δ > 0, ∀ (x' : E), ‖x' / x‖ < δ → ‖f x' / y‖ < ε


theorem ne_zero_iff {x : PartENat} : x ≠ 0 ↔ ⊥ < x


/-- The **Cauchy product formula** for the product of two infinites sums indexed by `ℕ`, expressed
by summing on `Finset.antidiagonal`.

See also `tsum_mul_tsum_eq_tsum_sum_antidiagonal_of_summable_norm` if `f` and `g` are absolutely
summable. -/
theorem tsum_mul_tsum_eq_tsum_sum_antidiagonal (hf : Summable f) (hg : Summable g)
    (hfg : Summable fun x : A × A ↦ f x.1 * g x.2) :
    ((∑' n, f n) * ∑' n, g n) = ∑' n, ∑ kl ∈ antidiagonal n, f kl.1 * g kl.2

{α : Type u_4}
{A : Type u_5}
[AddCommMonoid A]
[Finset.HasAntidiagonal A]
[TopologicalSpace α]
[NonUnitalNonAssocSemiring α]
{f g : A → α}
[T3Space α]
[TopologicalSemiring α]
(hf : Summable f)
(hg : Summable g)
(hfg : Summable fun x => f x.1 * g x.2)

(∑' (n : A), f n) * ∑' (n : A), g n = ∑' (n : A), ∑ kl ∈ Finset.antidiagonal n, f kl.1 * g kl.2


lemma eq_zero_of_natDegree_lt_card_of_eval_eq_zero' {R} [CommRing R] [IsDomain R]
    (p : R[X]) (s : Finset R) (heval : ∀ i ∈ s, p.eval i = 0) (hcard : natDegree p < s.card) :
    p = 0

(heval : ∀ i ∈ s, Polynomial.eval i p = 0)


theorem comap_surjective_of_injective : Function.Surjective (comap f)

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}
(hf : Function.Injective ⇑f)


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

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

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

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


/-- The product of two partial homeomorphisms, as a partial homeomorphism on the product space. -/
@[simps! (config := mfld_cfg) toPartialEquiv apply,
  simps! (config := .lemmasOnly) source target symm_apply]
def prod (eX : PartialHomeomorph X X') (eY : PartialHomeomorph Y Y') :
    PartialHomeomorph (X × Y) (X' × Y')

{X : Type u_1}
{X' : Type u_2}
{Y : Type u_3}
{Y' : Type u_4}
[TopologicalSpace X]
[TopologicalSpace X']
[TopologicalSpace Y]
[TopologicalSpace Y']
(eX : PartialHomeomorph X X')
(eY : PartialHomeomorph Y Y')
(p : X' × Y')

↑(eX.prod eY).symm p = (↑eX.symm p.1, ↑eY.symm p.2)


theorem toReal_pos_iff_ne_top (p : ℝ≥0∞) [Fact (1 ≤ p)] : 0 < p.toReal ↔ p ≠ ∞


@[to_additive]
theorem supports_of_mem (ha : a ∈ s) : Supports G s a

(G : Type u_1)
{α : Type u_3}
[VAdd G α]
{s : Set α}
{a : α}
(ha : a ∈ s)


@[continuity, fun_prop]
theorem Continuous.star (hf : Continuous f) : Continuous fun x => star (f x)

{α : Type u_1}
{R : Type u_2}
[TopologicalSpace R]
[Star R]
[ContinuousStar R]
[TopologicalSpace α]
{f : α → R}
(hf : Continuous f)


theorem ContinuousAt.comp₂_of_eq {f : Y × Z → W} {g : X → Y} {h : X → Z} {x : X} {y : Y × Z}
    (hf : ContinuousAt f y) (hg : ContinuousAt g x) (hh : ContinuousAt h x) (e : (g x, h x) = y) :
    ContinuousAt (fun x ↦ f (g x, h x)) x

{X : Type u}
{Y : Type v}
{Z : Type u_1}
{W : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace W]
{f : Y × Z → W}
{g : X → Y}
{h : X → Z}
{x : X}
{y : Y × Z}
(hf : ContinuousAt f y)
(hg : ContinuousAt g x)
(hh : ContinuousAt h x)
(e : (g x, h x) = y)


@[simp]
theorem coe_toSet_mk (S : Set M) (h₁ h₂ h₃ h₄) :
    ((⟨⟨⟨⟨S, h₁⟩, h₂⟩, h₃⟩, h₄⟩ : LieSubmodule R L M) : Set M) = S

(h₁ : ∀ {a b : M}, a ∈ S → b ∈ S → a + b ∈ S)

(h₃ :
  ∀ (c : R) {x : M},
    x ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂ }.carrier →
      c • x ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂ }.carrier)

(h₄ :
  ∀ {x : L} {m : M},
    m ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂, smul_mem' := h₃ }.carrier →
      ⁅x, m⁆ ∈ { carrier := S, add_mem' := h₁, zero_mem' := h₂, smul_mem' := h₃ }.carrier)

↑{ carrier := S, add_mem' := h₁, zero_mem' := h₂, smul_mem' := h₃, lie_mem := h₄ } = S


/-- If `X` is isomorphic to `X₁` and `Y` is isomorphic to `Y₁`, then
there is a bijection between `X ≅ Y` and `X₁ ≅ Y₁`. -/
@[simps]
def isoCongr {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ≅ X₂) (g : Y₁ ≅ Y₂) : (X₁ ≅ Y₁) ≃ (X₂ ≅ Y₂)

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

(f.isoCongr g).symm h = f ≪≫ h ≪≫ g.symm


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


@[simp]
theorem trans_apply (e₁ : A₁ ≃ₐ[R] A₂) (e₂ : A₂ ≃ₐ[R] A₃) (x : A₁) : (e₁.trans e₂) x = e₂ (e₁ x)

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


theorem prod_neBot : NeBot (f ×ˢ g) ↔ NeBot f ∧ NeBot g

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


protected theorem StrictAnti.compares (hf : StrictAnti f) {a b : α} {o : Ordering} :
    o.Compares (f a) (f b) ↔ o.Compares b a

{α : Type u}
{β : Type v}
[LinearOrder α]
[Preorder β]
{f : α → β}
(hf : StrictAnti f)
{a b : α}
{o : Ordering}


theorem coeFn_compMeasurePreserving (g : Lp E p μb) (hf : MeasurePreserving f μ μb) :
    compMeasurePreserving f hf g =ᵐ[μ] g ∘ f

(hf : MeasureTheory.MeasurePreserving f μ μb)

↑↑((MeasureTheory.Lp.compMeasurePreserving f hf) g) =ᵐ[μ] ↑↑g ∘ f


theorem sup_lt_ord {ι} {f : ι → Ordinal} {c : Ordinal} (hι : #ι < c.cof) :
    (∀ i, f i < c) → sup.{u, u} f < c

{ι : Type u}
{f : ι → Ordinal.{u}}
{c : Ordinal.{u}}
(hι : #ι < c.cof)

(∀ (i : ι), f i < c) → Ordinal.sup f < c


/-- The algebra map from `R[X]` to continuous functions `C(R, R)`.
-/
@[simps]
def toContinuousMapAlgHom : R[X] →ₐ[R] C(R, R)

{R : Type u_1}
[CommSemiring R]
[TopologicalSpace R]
[TopologicalSemiring R]
(p : R[X])

Polynomial.toContinuousMapAlgHom p = p.toContinuousMap


@[continuity, fun_prop]
theorem continuous_ofReal : Continuous (ofReal : ℝ → K)


theorem exists_mem_singleton_mem_of_mem_of_nonempty_of_forall_separating (p : Set α → Prop)
    {s : Set α} [HasCountableSeparatingOn α p s] (hs : s ∈ l) (hne : s.Nonempty)
    (hl : ∀ U, p U → U ∈ l ∨ Uᶜ ∈ l) : ∃ a ∈ s, {a} ∈ l

(hl : ∀ (U : Set α), p U → U ∈ l ∨ Uᶜ ∈ l)


@[to_additive (attr := simp)]
theorem smul_filter_bot : a • (⊥ : Filter β) = ⊥

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{a : α}


@[simp]
theorem upper_sub_lower_splitCenterBox (I : Box ι) (s : Set ι) (i : ι) :
    (I.splitCenterBox s).upper i - (I.splitCenterBox s).lower i = (I.upper i - I.lower i) / 2

{ι : Type u_1}
(I : BoxIntegral.Box ι)
(s : Set ι)
(i : ι)


theorem gfpApprox_add_one (h : f x ≤ x) (a : Ordinal) :
    gfpApprox f x (a+1) = f (gfpApprox f x a)

{α : Type u}
[CompleteLattice α]
(f : α →o α)
(x : α)
(h : f x ≤ x)
(a : Ordinal.{u})

OrdinalApprox.gfpApprox f x (a + 1) = f (OrdinalApprox.gfpApprox f x a)


@[simp]
theorem ofNat_lt_card {o} {n : ℕ} [n.AtLeastTwo] :
    (no_index (OfNat.ofNat n : Cardinal)) < card o ↔ (OfNat.ofNat n : Ordinal) < o

{o : Ordinal.{u_3}}
{n : ℕ}
[n.AtLeastTwo]

OfNat.ofNat n < o.card ↔ OfNat.ofNat n < o


@[simp]
theorem forall_mem_ofFn_iff {n : ℕ} {f : Fin n → α} {P : α → Prop} :
    (∀ i ∈ ofFn f, P i) ↔ ∀ j : Fin n, P (f j)

{α : Type u}
{n : ℕ}
{f : Fin n → α}
{P : α → Prop}

(∀ i ∈ List.ofFn f, P i) ↔ ∀ (j : Fin n), P (f j)


/-- The exponential pdf is measurable. -/
@[measurability]
lemma measurable_exponentialPDFReal (r : ℝ) : Measurable (exponentialPDFReal r)


/-- Continuous linear equivalence between dependent functions `(i : Fin 2) → M i` and `M 0 × M 1`.
-/
@[simps! (config := .asFn) apply symm_apply]
def piFinTwo (M : Fin 2 → Type*) [∀ i, AddCommMonoid (M i)] [∀ i, Module R (M i)]
    [∀ i, TopologicalSpace (M i)] : ((i : _) → M i) ≃L[R] M 0 × M 1

(R : Type u_2)
[Semiring R]
(M : Fin 2 → Type u_4)
[(i : Fin 2) → AddCommMonoid (M i)]
[(i : Fin 2) → Module R (M i)]
[(i : Fin 2) → TopologicalSpace (M i)]

⇑(ContinuousLinearEquiv.piFinTwo R M).symm = fun p => Fin.cons p.1 (Fin.cons p.2 finZeroElim)


theorem Real.continuous_inv : Continuous fun a : { r : ℝ // r ≠ 0 } => a.val⁻¹


@[simp]
theorem nhds_bot : 𝓝 (⊥ : Filter α) = pure ⊥


theorem le_of_not_le_of_le {hi n lo : α} [LinearOrder α] (h1 : ¬hi ≤ n) (h2 : hi ≤ lo) :
    (n:α) ≤ lo

{α : Type u_1}
{hi n lo : α}
[LinearOrder α]
(h1 : ¬hi ≤ n)
(h2 : hi ≤ lo)


theorem degrees_monomial (s : σ →₀ ℕ) (a : R) : degrees (monomial s a) ≤ toMultiset s

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(s : σ →₀ ℕ)
(a : R)

((MvPolynomial.monomial s) a).degrees ≤ Finsupp.toMultiset s


theorem eval_rename_prod_mk (g : σ × τ → R) (i : σ) (p : MvPolynomial τ R) :
    eval g (rename (Prod.mk i) p) = eval (fun j => g (i, j)) p

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_4}
[CommSemiring R]
(g : σ × τ → R)
(i : σ)
(p : MvPolynomial τ R)

(MvPolynomial.eval g) ((MvPolynomial.rename (Prod.mk i)) p) = (MvPolynomial.eval fun j => g (i, j)) p


/-- If a predicate depends only on `f x - x` and holds for all `0 ≤ x ≤ 1`,
then it holds for all `x`. -/
theorem forall_map_sub_of_Icc (P : ℝ → Prop) (h : ∀ x ∈ Icc (0 : ℝ) 1, P (f x - x)) (x : ℝ) :
    P (f x - x)

(f : CircleDeg1Lift)
(P : ℝ → Prop)
(h : ∀ x ∈ Set.Icc 0 1, P (f x - x))
(x : ℝ)


@[simp] -- Porting note: new attr
theorem cycleType_eq_zero {σ : Perm α} : σ.cycleType = 0 ↔ σ = 1

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{σ : Equiv.Perm α}


theorem map_map (op₁ : γ → δ) (op₂ : β → γ) (f : Germ l β) :
    map op₁ (map op₂ f) = map (op₁ ∘ op₂) f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{l : Filter α}
(op₁ : γ → δ)
(op₂ : β → γ)
(f : l.Germ β)

Filter.Germ.map op₁ (Filter.Germ.map op₂ f) = Filter.Germ.map (op₁ ∘ op₂) f


@[to_additive (attr := simp)]
theorem measure_inv_null : μ s⁻¹ = 0 ↔ μ s = 0

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
{s : Set G}
[MeasurableInv G]
[μ.IsMulLeftInvariant]


theorem MonovaryOn.dual_left : MonovaryOn f g s → AntivaryOn (toDual ∘ f) g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
{s : Set ι}

MonovaryOn f g s → AntivaryOn (⇑OrderDual.toDual ∘ f) g s


lemma frequently_iff_neBot {l : Filter α} {p : α → Prop} :
    (∃ᶠ x in l, p x) ↔ NeBot (l ⊓ 𝓟 {x | p x})

{α : Type u}
{l : Filter α}
{p : α → Prop}

(∃ᶠ (x : α) in l, p x) ↔ (l ⊓ 𝓟 {x | p x}).NeBot


/-- The `0`-th coefficient of `q.comp p` is `q 0`. Since these maps are multilinear maps in zero
variables, but on different spaces, we can not state this directly, so we state it when applied to
arbitrary vectors (which have to be the zero vector). -/
theorem comp_coeff_zero (q : FormalMultilinearSeries 𝕜 F G) (p : FormalMultilinearSeries 𝕜 E F)
    (v : Fin 0 → E) (v' : Fin 0 → F) : (q.comp p) 0 v = q 0 v'

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
[CommRing 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[AddCommGroup G]
[Module 𝕜 E]
[Module 𝕜 F]
[Module 𝕜 G]
[TopologicalSpace E]
[TopologicalSpace F]
[TopologicalSpace G]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
[TopologicalAddGroup G]
[ContinuousConstSMul 𝕜 G]
(q : FormalMultilinearSeries 𝕜 F G)
(p : FormalMultilinearSeries 𝕜 E F)
(v : Fin 0 → E)
(v' : Fin 0 → F)


/-- Rewriting equality in the dependent type
`Σ (c : composition n), Π (i : fin c.length), composition (c.blocks_fun i)` in
non-dependent terms with lists, requiring that the lists of blocks coincide. -/
theorem sigma_pi_composition_eq_iff
    (u v : Σ c : Composition n, ∀ i : Fin c.length, Composition (c.blocksFun i)) :
    u = v ↔ (ofFn fun i => (u.2 i).blocks) = ofFn fun i => (v.2 i).blocks

(u v : (c : Composition n) × ((i : Fin c.length) → Composition (c.blocksFun i)))

u = v ↔ (List.ofFn fun i => (u.snd i).blocks) = List.ofFn fun i => (v.snd i).blocks


@[simp]
theorem nndist_self_homothety (p₁ p₂ : P) (c : 𝕜) :
    nndist p₂ (homothety p₁ c p₂) = ‖1 - c‖₊ * nndist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
(p₁ p₂ : P)
(c : 𝕜)

nndist p₂ ((AffineMap.homothety p₁ c) p₂) = ‖1 - c‖₊ * nndist p₁ p₂


/-- Given a pair of isomorphisms between the summands of a pair of binary biproducts,
we obtain an isomorphism between the binary biproducts. -/
@[simps]
def biprod.mapIso {W X Y Z : C} [HasBinaryBiproduct W X] [HasBinaryBiproduct Y Z] (f : W ≅ Y)
    (g : X ≅ Z) : W ⊞ X ≅ Y ⊞ Z

(CategoryTheory.Limits.biprod.mapIso f g).inv = CategoryTheory.Limits.biprod.map f.inv g.inv


@[simp]
theorem mk_zero : (⟨0, nodup_zero⟩ : Finset α) = ∅


theorem unifTight_iff_ennreal {_ : MeasurableSpace α} (f : ι → α → β) (p : ℝ≥0∞) (μ : Measure α) :
    UnifTight f p μ ↔ ∀ ⦃ε : ℝ≥0∞⦄, 0 < ε → ∃ s : Set α,
      μ s ≠ ∞ ∧ ∀ i, eLpNorm (sᶜ.indicator (f i)) p μ ≤ ε

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[NormedAddCommGroup β]

∀ {x : MeasurableSpace α} (f : ι → α → β) (p : ENNReal) (μ : MeasureTheory.Measure α),
  MeasureTheory.UnifTight f p μ ↔
    ∀ ⦃ε : ENNReal⦄, 0 < ε → ∃ s, μ s ≠ ⊤ ∧ ∀ (i : ι), MeasureTheory.eLpNorm (sᶜ.indicator (f i)) p μ ≤ ε


theorem logb_neg_of_base_lt_one (h1 : 1 < x) : logb b x < 0


theorem splits_comp_of_splits (i : R →+* K) (j : K →+* L) {f : R[X]} (h : Splits i f) :
    Splits (j.comp i) f

{R : Type u_1}
{K : Type v}
{L : Type w}
[CommRing R]
[Field K]
[Field L]
(i : R →+* K)
(j : K →+* L)
{f : R[X]}
(h : Polynomial.Splits i f)


/-- Reification of a single clause formula. -/
theorem Fmla.reify_one {c : Clause} {a : Prop} (h : Clause.reify v c a) :
    Fmla.reify v (Fmla.one c) a

{v : Sat.Valuation}
{c : Sat.Clause}
{a : Prop}
(h : Sat.Clause.reify v c a)


@[simp]
theorem range_eq_empty_iff {f : ι → α} : range f = ∅ ↔ IsEmpty ι

{α : Type u_1}
{ι : Sort u_4}
{f : ι → α}


theorem eqOn_sup {f g : F} {S T : Submodule R M} (hS : Set.EqOn f g S) (hT : Set.EqOn f g T) :
    Set.EqOn f g ↑(S ⊔ T)

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_3}
{M₂ : Type u_4}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_5}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
{f g : F}
{S T : Submodule R M}
(hS : Set.EqOn ⇑f ⇑g ↑S)
(hT : Set.EqOn ⇑f ⇑g ↑T)


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


theorem MeasureTheory.volume_sum_rpow_le [Nonempty ι] {p : ℝ} (hp : 1 ≤ p) (r : ℝ) :
    volume {x : ι → ℝ | (∑ i, |x i| ^ p) ^ (1 / p) ≤ r} = (.ofReal r) ^ card ι *
      .ofReal ((2 * Gamma (1 / p + 1)) ^ card ι / Gamma (card ι / p + 1))

(ι : Type u_1)
[Fintype ι]
[Nonempty ι]
{p : ℝ}
(hp : 1 ≤ p)
(r : ℝ)

MeasureTheory.volume {x | (∑ i : ι, |x i| ^ p) ^ (1 / p) ≤ r} =
  ENNReal.ofReal r ^ Fintype.card ι *
    ENNReal.ofReal ((2 * Real.Gamma (1 / p + 1)) ^ Fintype.card ι / Real.Gamma (↑(Fintype.card ι) / p + 1))


theorem hasGradientWithinAt_congr_set' {s t : Set F} (y : F) (h : s =ᶠ[𝓝[{y}ᶜ] x] t) :
    HasGradientWithinAt f f' s x ↔ HasGradientWithinAt f f' t x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
{s t : Set F}
(y : F)
(h : s =ᶠ[𝓝[{y}ᶜ] x] t)


theorem sublist_suffix_of_union : ∀ l₁ l₂ : List α, ∃ t, t <+ l₁ ∧ t ++ l₂ = l₁ ∪ l₂

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


/-- Two biproducts which differ by an equivalence in the indexing type,
and up to isomorphism in the factors, are isomorphic.

Unfortunately there are two natural ways to define each direction of this isomorphism
(because it is true for both products and coproducts separately).
We give the alternative definitions as lemmas below.
-/
@[simps]
def biproduct.whiskerEquiv {f : J → C} {g : K → C} (e : J ≃ K) (w : ∀ j, g (e j) ≅ f j)
    [HasBiproduct f] [HasBiproduct g] : ⨁ f ≅ ⨁ g

(CategoryTheory.Limits.biproduct.whiskerEquiv e w).inv =
  CategoryTheory.Limits.biproduct.desc fun k =>
    CategoryTheory.eqToHom ⋯ ≫ (w (e.symm k)).hom ≫ CategoryTheory.Limits.biproduct.ι f (e.symm k)


/--
If the germ of a section `f` is a unit in the stalk at `x`, then `f` must be a unit on some small
neighborhood around `x`.
-/
theorem isUnit_res_of_isUnit_germ (U : Opens X) (f : X.presheaf.obj (op U)) (x : U)
    (h : IsUnit (X.presheaf.germ x f)) :
    ∃ (V : Opens X) (i : V ⟶ U) (_ : x.1 ∈ V), IsUnit (X.presheaf.map i.op f)

(U : TopologicalSpace.Opens ↑↑X.toPresheafedSpace)

∃ V i, ∃ (_ : ↑x ∈ V), IsUnit ((X.presheaf.map i.op) f)


theorem coe_center : (center R A : Set A) = Set.center A

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


@[simp]
theorem powerset_eq_singleton_empty : s.powerset = {∅} ↔ s = ∅


theorem map_adjoin (f : A →⋆ₐ[R] B) (s : Set A) :
    map f (adjoin R s) = adjoin R (f '' s)

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
[Semiring B]
[Algebra R B]
[StarRing B]
[StarModule R B]
(f : A →⋆ₐ[R] B)
(s : Set A)

StarSubalgebra.map f (StarAlgebra.adjoin R s) = StarAlgebra.adjoin R (⇑f '' s)


@[simp] lemma unop_zero (X Y : Cᵒᵖ) : (0 : X ⟶ Y).unop = 0


theorem prod_dvd_iff {x y : G₁ × G₂} :
    x ∣ y ↔ x.1 ∣ y.1 ∧ x.2 ∣ y.2

{G₁ : Type u_2}
{G₂ : Type u_3}
[Semigroup G₁]
[Semigroup G₂]
{x y : G₁ × G₂}


/-- In a space with second countable topology, strongly measurable and measurable are equivalent. -/
theorem _root_.stronglyMeasurable_iff_measurable [TopologicalSpace β] [MetrizableSpace β]
    [BorelSpace β] [SecondCountableTopology β] : StronglyMeasurable f ↔ Measurable f

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{mα : MeasurableSpace α}
[MeasurableSpace β]
[TopologicalSpace β]
[TopologicalSpace.MetrizableSpace β]
[BorelSpace β]
[SecondCountableTopology β]

MeasureTheory.StronglyMeasurable f ↔ Measurable f


@[simp]
theorem prod_principal_principal {s : Set α} {t : Set β} : 𝓟 s ×ˢ 𝓟 t = 𝓟 (s ×ˢ t)

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}

𝓟 s ×ˢ 𝓟 t = 𝓟 (s ×ˢ t)


/-- The co-Yoneda embedding, as a functor from `Cᵒᵖ` into co-presheaves on `C`.
-/
@[simps]
def coyoneda : Cᵒᵖ ⥤ C ⥤ Type v₁

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

∀ {X Y : Cᵒᵖ} (f : X ⟶ Y) (Y_1 : C)
  (g :
    ((fun X =>
            { obj := fun Y => Opposite.unop X ⟶ Y, map := fun {X_1 Y} f g => CategoryTheory.CategoryStruct.comp g f,
              map_id := ⋯, map_comp := ⋯ })
          X).obj
      Y_1),
  (CategoryTheory.coyoneda.map f).app Y_1 g = CategoryTheory.CategoryStruct.comp f.unop g


theorem semanticallyEquivalent_all_liftAt : T.SemanticallyEquivalent φ (φ.liftAt 1 n).all

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
{n : ℕ}
(φ : L.BoundedFormula α n)

T.SemanticallyEquivalent φ (∀'FirstOrder.Language.BoundedFormula.liftAt 1 n φ)


theorem im_le_im_mul_exp_dist (z w : ℍ) : z.im ≤ w.im * Real.exp (dist z w)


theorem Ideal.exists_comap_eq_of_mem_minimalPrimes {I : Ideal S} (f : R →+* S) (p)
    (H : p ∈ (I.comap f).minimalPrimes) : ∃ p' : Ideal S, p'.IsPrime ∧ I ≤ p' ∧ p'.comap f = p

(H : p ∈ (Ideal.comap f I).minimalPrimes)

∃ p', p'.IsPrime ∧ I ≤ p' ∧ Ideal.comap f p' = p


theorem product_image_fst [DecidableEq α] (ht : t.Nonempty) : (s ×ˢ t).image Prod.fst = s

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
[DecidableEq α]
(ht : t.Nonempty)


@[to_additive mem_fixedPoints_iff_card_orbit_eq_one]
theorem mem_fixedPoints_iff_card_orbit_eq_one {a : α} [Fintype (orbit M a)] :
    a ∈ fixedPoints M α ↔ Fintype.card (orbit M a) = 1

{M : Type u}
[AddMonoid M]
{α : Type v}
[AddAction M α]
{a : α}
[Fintype ↑(AddAction.orbit M a)]

a ∈ AddAction.fixedPoints M α ↔ Fintype.card ↑(AddAction.orbit M a) = 1


@[simp]
lemma eval_map_algebraMap (P : R[X]) (a : A) :
    (map (algebraMap R A) P).eval a = aeval a P

{R : Type u_1}
(A : Type u_2)
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
(P : R[X])
(a : A)

Polynomial.eval a (Polynomial.map (algebraMap R A) P) = (Polynomial.aeval a) P


/-- The atoms of the lattice of submodules of a module over a division ring are the
submodules equal to the span of a nonzero element of the module. -/
theorem atom_iff_nonzero_span (W : Submodule K V) :
    IsAtom W ↔ ∃ v ≠ 0, W = span K {v}

{K : Type u_3}
{V : Type u_4}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(W : Submodule K V)

IsAtom W ↔ ∃ v, v ≠ 0 ∧ W = Submodule.span K {v}


theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
    centralMoment X 1 μ = (1 - (μ Set.univ).toReal) * μ[X]

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{X : Ω → ℝ}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
(h_int : MeasureTheory.Integrable X μ)

ProbabilityTheory.centralMoment X 1 μ = (1 - (μ Set.univ).toReal) * ∫ (x : Ω), X x ∂μ


theorem lift_mk : lift (mk R M N) = LinearMap.id

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]

TensorProduct.lift (TensorProduct.mk R M N) = LinearMap.id


@[simp]
theorem update_self : f.update i (f i) = f

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
(i : ι)
(f : Π₀ (i : ι), β i)


lemma ofJ_0_of_three_ne_zero [h3 : NeZero (3 : F)] :
    ofJ 0 = @ofJ0 _ _ (invertibleOfNonzero h3.out)

{F : Type u}
[Field F]
[DecidableEq F]
[h3 : NeZero 3]

EllipticCurve.ofJ 0 = EllipticCurve.ofJ0 F


/-- NB: `Nat.card` is defined to be `0` for infinite types. -/
theorem card_eq_zero_of_surjective {f : α → β} (hf : Function.Surjective f) (h : Nat.card β = 0) :
    Nat.card α = 0

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Surjective f)
(h : Nat.card β = 0)


theorem abs_apply {z : ℂ} : Complex.abs z = (normSq z).sqrt


@[simp]
theorem pell_val (n : ℕ) : pell a1 n = (xn a1 n, yn a1 n)

Pell.pell a1 n = (Pell.xn a1 n, Pell.yn a1 n)


/-- The preimage of a separable set by an inducing map is separable. -/
protected theorem _root_.Inducing.isSeparable_preimage {f : β → α} [TopologicalSpace β]
    (hf : Inducing f) {s : Set α} (hs : IsSeparable s) : IsSeparable (f ⁻¹' s)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
{f : β → α}
[TopologicalSpace β]
(hf : Inducing f)
{s : Set α}
(hs : TopologicalSpace.IsSeparable s)


@[to_additive]
lemma dite_lt_one [LT α] (ha : ∀ h, a h < 1) (hb : ∀ h, b h < 1) : dite p a b < 1

{α : Type u_2}
[One α]
{p : Prop}
[Decidable p]
{a : p → α}
{b : ¬p → α}
[LT α]
(ha : ∀ (h : p), a h < 1)
(hb : ∀ (h : ¬p), b h < 1)