/-- A homotopy `h` between chain maps `f` and `g` consists of components `h i j : C.X i ⟶ D.X j`
which are zero unless `c.Rel j i`, satisfying the homotopy condition.
-/
@[ext]
structure Homotopy (f g : C ⟶ D) where
  hom : ∀ i j, C.X i ⟶ D.X j
  zero : ∀ i j, ¬c.Rel j i → hom i j = 0 := by aesop_cat
  comm : ∀ i, f.f i = dNext i hom + prevD i hom + g.f i := by aesop_cat

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


lemma sum_nat_mod (l : List ℕ) (n : ℕ) : l.sum % n = (l.map (· % n)).sum % n

l.sum % n = (List.map (fun x => x % n) l).sum % n


theorem IsAdjointPair.smul (c : R) (h : IsAdjointPair B B₂' f₂ g₂) :
    IsAdjointPair B B₂' (c • f₂) (c • g₂)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
{M' : Type u_9}
[AddCommMonoid M']
[Module R M']
{B₂' : LinearMap.BilinForm R M'}
{f₂ : M →ₗ[R] M'}
{g₂ : M' →ₗ[R] M}
(c : R)
(h : B.IsAdjointPair B₂' f₂ g₂)


lemma CharP.neg_mul_eq_sub_one_mul {α : Type _} [Ring α] (n : ℕ) (inst : CharP α n) (a b : α)
    (na : ℕ) (na' : α) (p : IsNat ((n - 1) * a : α) na) (pa : na = na') :
    -(a * b) = na' * b

(p : Mathlib.Meta.NormNum.IsNat ((↑n - 1) * a) na)


@[to_additive]
theorem coe_center : ↑(center G) = Set.center G

↑(AddSubgroup.center G) = Set.addCenter G


theorem isLeast_lfp : IsLeast (fixedPoints f) (lfp f)

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

IsLeast (Function.fixedPoints ⇑f) (OrderHom.lfp f)


theorem _root_.MeasureTheory.AEStronglyMeasurable.comp_snd_map_prod_id [TopologicalSpace F]
    (hm : m ≤ mΩ) (hf : AEStronglyMeasurable f μ) : AEStronglyMeasurable (fun x : Ω × Ω => f x.2)
      (@Measure.map Ω (Ω × Ω) (m.prod mΩ) mΩ (fun ω => (id ω, id ω)) μ)

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (fun x => f x.2) (MeasureTheory.Measure.map (fun ω => (id ω, id ω)) μ)


lemma ker_Pi_Quotient_mk {ι : Type*} (I : ι → Ideal R) :
    ker (Pi.ringHom fun i : ι ↦ Quotient.mk (I i)) = ⨅ i, I i

{R : Type u}
[CommRing R]
{ι : Type u_1}
(I : ι → Ideal R)

RingHom.ker (Pi.ringHom fun i => Ideal.Quotient.mk (I i)) = ⨅ i, I i


/-- A filter `l` is disjoint with the neighborhood filter of a compact set if and only if it is
disjoint with the neighborhood filter of each point of this set. -/
theorem IsCompact.disjoint_nhdsSet_right {l : Filter X} (hs : IsCompact s) :
    Disjoint l (𝓝ˢ s) ↔ ∀ x ∈ s, Disjoint l (𝓝 x)

{X : Type u}
[TopologicalSpace X]
{s : Set X}
{l : Filter X}
(hs : IsCompact s)


/-- Vertical composition of monoidal natural transformations. -/
@[simps!]
def vcomp {F G H : LaxMonoidalFunctor C D} (α : MonoidalNatTrans F G) (β : MonoidalNatTrans G H) :
    MonoidalNatTrans F H

{F G H : CategoryTheory.LaxMonoidalFunctor C D}

(α : CategoryTheory.MonoidalNatTrans F G)

(β : CategoryTheory.MonoidalNatTrans G H)


theorem locallyFinite_iff_exists_realizer [TopologicalSpace α] (F : Ctop.Realizer α)
    {f : β → Set α} : LocallyFinite f ↔ Nonempty (LocallyFinite.Realizer F f)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
(F : Ctop.Realizer α)
{f : β → Set α}


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

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


lemma map_preΨ' (n : ℕ) : (W.map f).preΨ' n = (W.preΨ' n).map f

{R : Type r}
{S : Type s}
[CommRing R]
[CommRing S]
(W : WeierstrassCurve R)
(f : R →+* S)
(n : ℕ)

(W.map f).preΨ' n = Polynomial.map f (W.preΨ' n)


@[simp]
theorem pimage_empty : pimage f ∅ = ∅

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α →. β}
[(x : α) → Decidable (f x).Dom]


theorem isPreirreducible_iff_subsingleton [T2Space X] {S : Set X} :
    IsPreirreducible S ↔ S.Subsingleton

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
{S : Set X}


theorem setIntegral_withDensity_eq_setIntegral_smul {f : X → ℝ≥0} (f_meas : Measurable f)
    (g : X → E) {s : Set X} (hs : MeasurableSet s) :
    ∫ x in s, g x ∂μ.withDensity (fun x => f x) = ∫ x in s, f x • g x ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → ℝ≥0}
(f_meas : Measurable f)
(g : X → E)
{s : Set X}
(hs : MeasurableSet s)

(∫ (x : X) in s, g x ∂μ.withDensity fun x => ↑(f x)) = ∫ (x : X) in s, f x • g x ∂μ


@[to_additive (attr := simp)]
theorem Step.cons_not_rev {x b} : Red.Step ((x, !b) :: (x, b) :: L) L

{α : Type u}
{L : List (α × Bool)}
{x : α}
{b : Bool}

FreeGroup.Red.Step ((x, !b) :: (x, b) :: L) L


protected theorem sSup_apply {s : Set (Seminorm 𝕜 E)} (hp : BddAbove s) {x : E} :
    (sSup s) x = ⨆ p : s, (p : E → ℝ) x

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set (Seminorm 𝕜 E)}
(hp : BddAbove s)
{x : E}


@[simp]
theorem sup_bot (s : Finset β) : (s.sup fun _ => ⊥) = (⊥ : α)

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
(s : Finset β)


@[to_additive] lemma sup_eq_mul_oneLePart_div (a b : α) : a ⊔ b = b * (a / b)⁺ᵐ

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


theorem torusIntegral_radius_zero (hn : n ≠ 0) (f : ℂⁿ → E) (c : ℂⁿ) :
    (∯ x in T(c, 0), f x) = 0

{n : ℕ}
{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(hn : n ≠ 0)
(f : (Fin n → ℂ) → E)
(c : Fin n → ℂ)


/-- The difference with `NonUnitalAlgebra.adjoin_induction` is that this acts on the subtype. -/
@[elab_as_elim]
lemma adjoin_induction_subtype {s : Set A} {p : adjoin R s → Prop} (a : adjoin R s)
    (mem : ∀ x (h : x ∈ s), p ⟨x, subset_adjoin R h⟩)
    (add : ∀ x y, p x → p y → p (x + y)) (zero : p 0)
    (mul : ∀ x y, p x → p y → p (x * y)) (smul : ∀ (r : R) x, p x → p (r • x)) : p a

{p : ↥(NonUnitalAlgebra.adjoin R s) → Prop}

(add : ∀ (x y : ↥(NonUnitalAlgebra.adjoin R s)), p x → p y → p (x + y))

(mul : ∀ (x y : ↥(NonUnitalAlgebra.adjoin R s)), p x → p y → p (x * y))

(smul : ∀ (r : R) (x : ↥(NonUnitalAlgebra.adjoin R s)), p x → p (r • x))


@[to_additive]
private theorem inv_eq_of_mul (h : a * b = 1) : a⁻¹ = b

{G : Type u_1}
[Group G]
{a b : G}
(h : a * b = 1)


theorem isBoundedUnder_ge_finset_inf' [LinearOrder β] [Nonempty β] {f : Filter α} {F : ι → α → β}
    {s : Finset ι} (hs : s.Nonempty) (h : ∀ i ∈ s, f.IsBoundedUnder (· ≥ ·) (F i)) :
    f.IsBoundedUnder (· ≥ ·) (fun a ↦ inf' s hs (fun i ↦ F i a))

{F : ι → α → β}

(h : ∀ i ∈ s, Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f (F i))

Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f fun a => s.inf' hs fun i => F i a


@[to_additive (attr := simp)]
theorem MonoidHom.toMulHom_coe [MulOneClass M] [MulOneClass N] (f : M →* N) :
    f.toMulHom.toFun = f

{M : Type u_4}
{N : Type u_5}
[MulOneClass M]
[MulOneClass N]
(f : M →* N)


@[to_additive (attr := simp)]
theorem restrict_apply {N : Type*} [Mul N] [SetLike σ M] [MulMemClass σ M] (f : M →ₙ* N) {S : σ}
    (x : S) : f.restrict S x = f x

{M : Type u_1}
{σ : Type u_4}
[Add M]
{N : Type u_5}
[Add N]
[SetLike σ M]
[AddMemClass σ M]
(f : AddHom M N)
{S : σ}
(x : ↥S)


@[simp]
theorem symm_toHomeomorph (e : M₁ ≃SL[σ₁₂] M₂) : e.toHomeomorph.symm = e.symm.toHomeomorph

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(e : M₁ ≃SL[σ₁₂] M₂)


theorem dvd_lcm_right [GCDMonoid α] (a b : α) : b ∣ lcm a b

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


theorem Relation.is_graph_iff (r : Rel α β) : (∃! f, Function.graph f = r) ↔ ∀ x, ∃! y, r x y

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

(∃! f, Function.graph f = r) ↔ ∀ (x : α), ∃! y, r x y


theorem monic_of_isUnit_leadingCoeff_inv_smul (h : IsUnit p.leadingCoeff) :
    Monic (h.unit⁻¹ • p)

{R : Type u}
[Semiring R]
{p : R[X]}
(h : IsUnit p.leadingCoeff)


theorem normalize_eq_normalize_iff {x y : α} : normalize x = normalize y ↔ x ∣ y ∧ y ∣ x

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
{x y : α}


theorem dot_nil_right {xs : Coeffs} : dot xs .nil = 0


/-- Euler's reflection formula for the complex Gamma function. -/
theorem Gamma_mul_Gamma_one_sub (z : ℂ) : Gamma z * Gamma (1 - z) = π / sin (π * z)

Complex.Gamma z * Complex.Gamma (1 - z) = ↑π / Complex.sin (↑π * z)


@[fun_prop]
theorem Set.Subsingleton.differentiableOn (hs : s.Subsingleton) : DifferentiableOn 𝕜 f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(hs : s.Subsingleton)


lemma cfc_star_id : cfc (star · : R → R) a = star a

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
(a : A)
(ha : p a := by cfc_tac)


/-- Ring isomorphism between `α` considered as a Boolean algebra considered as a Boolean ring and
`α`. -/
@[simps!]
def RingEquiv.asBoolRingAsBoolAlg (α : Type*) [BooleanRing α] : AsBoolRing (AsBoolAlg α) ≃+* α

∀ (a : AsBoolRing (AsBoolAlg α)), (RingEquiv.asBoolRingAsBoolAlg α) a = ofBoolAlg (ofBoolRing a)


@[simp]
theorem coe_le_coe {I J : FractionalIdeal S P} :
    (I : Submodule R P) ≤ (J : Submodule R P) ↔ I ≤ J

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

↑I ≤ ↑J ↔ I ≤ J


@[simp]
theorem manyOneEquiv_toNat (p : Set α) (q : Set β) :
    ManyOneEquiv (toNat p) (toNat q) ↔ ManyOneEquiv p q

{α : Type u}
[Primcodable α]
[Inhabited α]
{β : Type v}
[Primcodable β]
[Inhabited β]
(p : Set α)
(q : Set β)


theorem ceil_add_one (ha : 0 ≤ a) : ⌈a + 1⌉₊ = ⌈a⌉₊ + 1

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


theorem le_eqLocus {f g : F} {S : Submodule R M} : S ≤ eqLocus f g ↔ Set.EqOn f g S

{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 : Submodule R M}

S ≤ LinearMap.eqLocus f g ↔ Set.EqOn ⇑f ⇑g ↑S


theorem Ico_filter_pow_dvd_eq {n p b : ℕ} (pp : p.Prime) (hn : n ≠ 0) (hb : n ≤ p ^ b) :
    ((Ico 1 n).filter fun i => p ^ i ∣ n) = (Icc 1 b).filter fun i => p ^ i ∣ n

{n p b : ℕ}
(pp : Nat.Prime p)
(hn : n ≠ 0)
(hb : n ≤ p ^ b)

Finset.filter (fun i => p ^ i ∣ n) (Finset.Ico 1 n) = Finset.filter (fun i => p ^ i ∣ n) (Finset.Icc 1 b)


@[to_additive (attr := simp)]
theorem one_lt_mul_self_iff : 1 < a * a ↔ 1 < a

{α : Type u_1}
[LinearOrderedAddCommMonoid α]
{a : α}


@[simp]
theorem mem_basicOpen (f : A) (x : ProjectiveSpectrum 𝒜) :
    x ∈ basicOpen 𝒜 f ↔ f ∉ x.asHomogeneousIdeal

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(f : A)
(x : ProjectiveSpectrum 𝒜)

x ∈ ProjectiveSpectrum.basicOpen 𝒜 f ↔ f ∉ x.asHomogeneousIdeal


lemma add_of_Y_eq {P Q : Fin 3 → F} (hPz : P z ≠ 0) (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.add P Q = W.dblU P • ![1, 1, 0]


theorem union_eq_union_iff_right : s ∪ u = t ∪ u ↔ s ⊆ t ∪ u ∧ t ⊆ s ∪ u


@[simp]
theorem update_same (a : α) (v : β a) (f : ∀ a, β a) : update f a v a = v

{α : Sort u}
{β : α → Sort v}
[DecidableEq α]
(a : α)
(v : β a)
(f : (a : α) → β a)


/-- `toNat` has a right-inverse: coercion. -/
theorem toNat_rightInverse : Function.RightInverse ((↑) : ℕ → Cardinal) toNat


theorem cons_getElem_drop_succ {l : List α} {n : Nat} {h : n < l.length} :
    l[n] :: l.drop (n + 1) = l.drop n

{α : Type u}
{l : List α}
{n : ℕ}
{h : n < l.length}

l[n] :: List.drop (n + 1) l = List.drop n l


@[simp]
theorem deriv_exp : deriv exp = exp


/-- An equivalence of the index set defines an equivalence between the spaces of continuous
multilinear maps. In case of normed spaces, this is a linear isometric equivalence, see
`ContinuousMultilinearMap.domDomCongrₗᵢ`. -/
@[simps]
def domDomCongrEquiv {ι' : Type*} (e : ι ≃ ι') :
    ContinuousMultilinearMap R (fun _ : ι => M₂) M₃ ≃
      ContinuousMultilinearMap R (fun _ : ι' => M₂) M₃

(f : ContinuousMultilinearMap R (fun x => M₂) M₃)

(ContinuousMultilinearMap.domDomCongrEquiv e) f = ContinuousMultilinearMap.domDomCongr e f


theorem contMDiffOn_id : ContMDiffOn I I n (id : M → M) s

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


lemma boundaryLE {k' : ι'} {j : ι} (hj : c'.Rel (e.f j) k') (hk' : ∀ i, e.f i ≠ k') :
    e.BoundaryLE j

{ι : Type u_1}
{ι' : Type u_2}
{c : ComplexShape ι}
{c' : ComplexShape ι'}
(e : c.Embedding c')
{k' : ι'}
{j : ι}
(hj : c'.Rel (e.f j) k')
(hk' : ∀ (i : ι), e.f i ≠ k')


@[simp]
theorem iUnion_iUnion_eq_or_left {b : β} {p : β → Prop} {s : ∀ x : β, x = b ∨ p x → Set α} :
    ⋃ (x) (h), s x h = s b (Or.inl rfl) ∪ ⋃ (x) (h : p x), s x (Or.inr h)

{α : Type u_1}
{β : Type u_2}
{b : β}
{p : β → Prop}
{s : (x : β) → x = b ∨ p x → Set α}

⋃ x, ⋃ (h : x = b ∨ p x), s x h = s b ⋯ ∪ ⋃ x, ⋃ (h : p x), s x ⋯


@[simp]
theorem map_id : ∀ s : Seq α, map id s = s


/-- The type of AddMonoid homomorphisms satisfying the characteristic predicate: if `f : M →+ N`
satisfies this predicate, then `N` is isomorphic to the localization of `M` at `S`. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure LocalizationMap extends AddMonoidHom M N where
  map_add_units' : ∀ y : S, IsAddUnit (toFun y)
  surj' : ∀ z : N, ∃ x : M × S, z + toFun x.2 = toFun x.1
  exists_of_eq : ∀ x y, toFun x = toFun y → ∃ c : S, ↑c + x = ↑c + y

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(self : S.LocalizationMap N)
(y : ↥S)


theorem pow_smul_mem_adjoin_smul (r : R) (s : Set A) {x : A} (hx : x ∈ adjoin R s) :
    ∃ n₀ : ℕ, ∀ n ≥ n₀, r ^ n • x ∈ adjoin R (r • s)

{R : Type uR}
{A : Type uA}
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
(r : R)
(s : Set A)
{x : A}
(hx : x ∈ Algebra.adjoin R s)

∃ n₀, ∀ n ≥ n₀, r ^ n • x ∈ Algebra.adjoin R (r • s)


theorem nonneg_prod_iff [Preorder P] [CovariantClass P P (· + ·) (· ≤ ·)]
    {Q₁ : QuadraticMap R M₁ P} {Q₂ : QuadraticMap R M₂ P} :
    (∀ x, 0 ≤ (Q₁.prod Q₂) x) ↔ (∀ x, 0 ≤ Q₁ x) ∧ ∀ x, 0 ≤ Q₂ x

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

(∀ (x : M₁ × M₂), 0 ≤ (Q₁.prod Q₂) x) ↔ (∀ (x : M₁), 0 ≤ Q₁ x) ∧ ∀ (x : M₂), 0 ≤ Q₂ x


lemma isZero_X {i : Option ι} (hi : i = none) :
    IsZero (X K i)

CategoryTheory.Limits.IsZero (HomologicalComplex.extend.X K i)


@[simp]
theorem ae_neBot : (ae μ).NeBot ↔ μ ≠ 0

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


@[ext]
theorem colimit.hom_ext {F : J ⥤ C} [HasColimit F] {X : C} {f f' : colimit F ⟶ X}
    (w : ∀ j, colimit.ι F j ≫ f = colimit.ι F j ≫ f') : f = f'

{f f' : CategoryTheory.Limits.colimit F ⟶ X}

(w : ∀ (j : J), CategoryTheory.Limits.colimit.ι F j ≫ f = CategoryTheory.Limits.colimit.ι F j ≫ f')


theorem Ico_subset_Ici_self : Ico a b ⊆ Ici a


theorem nat_findGreatest {f : α → ℕ} {p : α → ℕ → Prop} [∀ x n, Decidable (p x n)]
    (hf : Primrec f) (hp : PrimrecRel p) : Primrec fun x => (f x).findGreatest (p x)

{α : Type u_1}
[Primcodable α]
{f : α → ℕ}
{p : α → ℕ → Prop}
[(x : α) → (n : ℕ) → Decidable (p x n)]
(hf : Primrec f)
(hp : PrimrecRel p)

Primrec fun x => Nat.findGreatest (p x) (f x)


theorem exists_lt_card_nth_eq {x} (h : p x) :
    ∃ n, (∀ hf : (setOf p).Finite, n < hf.toFinset.card) ∧ nth p n = x

∃ n, (∀ (hf : (setOf p).Finite), n < hf.toFinset.card) ∧ Nat.nth p n = x


theorem ite_comp {P : Prop} [Decidable P] {X Y Z : C} (f f' : X ⟶ Y) (g : Y ⟶ Z) :
    (if P then f else f') ≫ g = if P then f ≫ g else f' ≫ g

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

CategoryTheory.CategoryStruct.comp (if P then f else f') g =
  if P then CategoryTheory.CategoryStruct.comp f g else CategoryTheory.CategoryStruct.comp f' g


@[simp]
theorem coeff_eq_b : P.toPoly.coeff 2 = P.b

{R : Type u_1}
{P : Cubic R}
[Semiring R]


@[to_additive (attr := simp)]
theorem hasProd_subtype_mulSupport : HasProd (f ∘ (↑) : mulSupport f → α) a ↔ HasProd f a

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}


theorem tendsto_nhds_bot_mono' [TopologicalSpace β] [Preorder β] [OrderBot β] [OrderTopology β]
    {l : Filter α} {f g : α → β} (hf : Tendsto f l (𝓝 ⊥)) (hg : g ≤ f) : Tendsto g l (𝓝 ⊥)

{α : Type u}
{β : Type v}
[TopologicalSpace β]
[Preorder β]
[OrderBot β]
[OrderTopology β]
{l : Filter α}
{f g : α → β}
(hf : Filter.Tendsto f l (𝓝 ⊥))
(hg : g ≤ f)


/-- All n-simplices among cospherical points in n-space have the same
circumcenter. -/
theorem exists_circumcenter_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional ℝ V]
    (hd : finrank ℝ V = n) (hc : Cospherical ps) :
    ∃ c : P, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumcenter = c

(hd : FiniteDimensional.finrank ℝ V = n)

∃ c, ∀ (sx : Affine.Simplex ℝ P n), Set.range sx.points ⊆ ps → sx.circumcenter = c


theorem bddBelow_def : BddBelow s ↔ ∃ x, ∀ y ∈ s, x ≤ y


@[simp 1100]
theorem decode_nat (n : ℕ) : decode n = some n


@[simp]
theorem comp_inv_app {X Y Z : TopCat.{w}} (f : X ⟶ Y) (g : Y ⟶ Z) (ℱ : X.Presheaf C) (U) :
    (comp f g ℱ).inv.app U = 𝟙 _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : TopCat}
(f : X ⟶ Y)
(g : Y ⟶ Z)
(ℱ : TopCat.Presheaf C X)
(U : (TopologicalSpace.Opens ↑Z)ᵒᵖ)

(TopCat.Presheaf.Pushforward.comp f g ℱ).inv.app U =
  𝟙 (((TopCat.Presheaf.pushforward C g).obj ((TopCat.Presheaf.pushforward C f).obj ℱ)).obj U)


theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P)
    (hf : Function.Injective f) : N.FG

{R : Type u_1}
{M : Type u_2}
{P : Type u_3}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid P]
[Module R M]
[Module R P]
[IsNoetherian R P]
{N : Submodule R M}
(f : M →ₗ[R] P)
(hf : Function.Injective ⇑f)


/-- A variant on `eqToHom_naturality` that helps Lean identify the families `f` and `g`. -/
-- The simpNF linter incorrectly claims that this will never apply.
-- https://github.com/leanprover-community/mathlib4/issues/5049
@[reassoc (attr := simp, nolint simpNF)]
theorem eqToHom_iso_inv_naturality {f g : β → C} (z : ∀ b, f b ≅ g b) {j j' : β} (w : j = j') :
    (z j).inv ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').inv

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{β : Sort u_1}
{f g : β → C}
(z : (b : β) → f b ≅ g b)
{j j' : β}
(w : j = j')

CategoryTheory.CategoryStruct.comp (z j).inv (CategoryTheory.eqToHom ⋯) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯) (z j').inv


/-- A version of `Equiv.mulLeft a b⁻¹` that is defeq to `a / b`. -/
@[to_additive (attr := simps) " A version of `Equiv.addLeft a (-b)` that is defeq to `a - b`. "]
protected def divLeft (a : G) : G ≃ G


theorem mem_maximals_iff_forall_insert (hP : ∀ ⦃s t⦄, P t → s ⊆ t → P s) :
    s ∈ maximals (· ⊆ ·) {t | P t} ↔ P s ∧ ∀ x ∉ s, ¬ P (insert x s)

(hP : ∀ ⦃s t : Finset α⦄, P t → s ⊆ t → P s)

s ∈ maximals (fun x x_1 => x ⊆ x_1) {t | P t} ↔ P s ∧ ∀ x ∉ s, ¬P (insert x s)


theorem nhds_mkOfNhds_single [DecidableEq α] {a₀ : α} {l : Filter α} (h : pure a₀ ≤ l) (b : α) :
    @nhds α (TopologicalSpace.mkOfNhds (update pure a₀ l)) b =
      (update pure a₀ l : α → Filter α) b

{α : Type u}
[DecidableEq α]
{a₀ : α}
{l : Filter α}
(h : pure a₀ ≤ l)
(b : α)


@[to_additive]
theorem smul_apply [SMul M α] (c : Mᵈᵐᵃ) (f : α → β) (a : α) : (c • f) a = f (mk.symm c • a)

{M : Type u_1}
{β : Type u_2}
{α : Type u_3}
[SMul M α]
(c : Mᵈᵐᵃ)
(f : α → β)
(a : α)


theorem center_le_centralizer {R} [NonUnitalSemiring R] (s) : center R ≤ centralizer s

{R : Type u_1}
[NonUnitalSemiring R]
(s : Set R)

NonUnitalSubsemiring.center R ≤ NonUnitalSubsemiring.centralizer s


@[to_additive (attr := simp)]
theorem untop_one : (1 : WithTop α).untop coe_ne_top = 1


lemma isComplex_of_iso {S₁ S₂ : ComposableArrows C n} (e : S₁ ≅ S₂) (h₁ : S₁.IsComplex) :
    S₂.IsComplex

{S₁ S₂ : CategoryTheory.ComposableArrows C n}


theorem choose_le_add (a b c : ℕ) : choose a c ≤ choose (a + b) c


theorem convolution_mono_right {f g g' : G → ℝ} (hfg : ConvolutionExistsAt f g x (lsmul ℝ ℝ) μ)
    (hfg' : ConvolutionExistsAt f g' x (lsmul ℝ ℝ) μ) (hf : ∀ x, 0 ≤ f x) (hg : ∀ x, g x ≤ g' x) :
    (f ⋆[lsmul ℝ ℝ, μ] g) x ≤ (f ⋆[lsmul ℝ ℝ, μ] g') x

(hfg : MeasureTheory.ConvolutionExistsAt f g x (ContinuousLinearMap.lsmul ℝ ℝ) μ)

(hfg' : MeasureTheory.ConvolutionExistsAt f g' x (ContinuousLinearMap.lsmul ℝ ℝ) μ)

MeasureTheory.convolution f g (ContinuousLinearMap.lsmul ℝ ℝ) μ x ≤
  MeasureTheory.convolution f g' (ContinuousLinearMap.lsmul ℝ ℝ) μ x


@[to_additive (attr := simp) MeasureTheory.mem_addFundamentalFrontier]
theorem mem_fundamentalFrontier :
    x ∈ fundamentalFrontier G s ↔ x ∈ s ∧ ∃ g : G, g ≠ 1 ∧ x ∈ g • s

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

x ∈ MeasureTheory.addFundamentalFrontier G s ↔ x ∈ s ∧ ∃ g, g ≠ 0 ∧ x ∈ g +ᵥ s


@[simp]
theorem realize_antisymmetric :
    M ⊨ r.antisymmetric ↔ AntiSymmetric fun x y : M => RelMap r ![x, y]

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{r : L.Relations 2}

M ⊨ r.antisymmetric ↔ AntiSymmetric fun x y => FirstOrder.Language.Structure.RelMap r ![x, y]


/-- The bijection between the set of prime factors of the ideal `⟨r⟩` and the set of prime factors
  of `r` preserves `count` of the corresponding multisets. See
  `multiplicity_normalizedFactorsEquivSpanNormalizedFactors_eq_multiplicity` for the version
  stated in terms of multiplicity. -/
theorem count_span_normalizedFactors_eq {r X : R} (hr : r ≠ 0) (hX : Prime X) :
    Multiset.count (Ideal.span {X} : Ideal R) (normalizedFactors (Ideal.span {r}))  =
        Multiset.count (normalize X) (normalizedFactors r)

{R : Type u_1}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]
[DecidableEq R]
[DecidableEq (Ideal R)]
[NormalizationMonoid R]
[DecidableRel fun x x_1 => x ∣ x_1]
[DecidableRel fun x x_1 => x ∣ x_1]
{r X : R}
(hr : r ≠ 0)
(hX : Prime X)

Multiset.count (Ideal.span {X}) (UniqueFactorizationMonoid.normalizedFactors (Ideal.span {r})) =
  Multiset.count (normalize X) (UniqueFactorizationMonoid.normalizedFactors r)


protected theorem inv_def {r : R} {s : R⁰} :
    (r /ₒ s)⁻¹ =
      if hr : r = (0 : R) then (0 : R[R⁰⁻¹])
      else s /ₒ ⟨r, fun _ => eq_zero_of_ne_zero_of_mul_right_eq_zero hr⟩

(r /ₒ s)⁻¹ = if hr : r = 0 then 0 else ↑s /ₒ ⟨r, ⋯⟩


lemma isOpen_extend_target [I.Boundaryless] : IsOpen (f.extend I).target

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


lemma toList_chain' (x : RelSeries r) : x.toList.Chain' r

{α : Type u_1}
{r : Rel α α}
(x : RelSeries r)


theorem hasStrictFDerivAt_cpow {p : ℂ × ℂ} (hp : p.1 ∈ slitPlane) :
    HasStrictFDerivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
      ((p.2 * p.1 ^ (p.2 - 1)) • ContinuousLinearMap.fst ℂ ℂ ℂ +
        (p.1 ^ p.2 * log p.1) • ContinuousLinearMap.snd ℂ ℂ ℂ) p

{p : ℂ × ℂ}
(hp : p.1 ∈ Complex.slitPlane)

HasStrictFDerivAt (fun x => x.1 ^ x.2)
  ((p.2 * p.1 ^ (p.2 - 1)) • ContinuousLinearMap.fst ℂ ℂ ℂ +
    (p.1 ^ p.2 * Complex.log p.1) • ContinuousLinearMap.snd ℂ ℂ ℂ)
  p


/-- **L'Hôpital's rule** for approaching a real, `HasDerivAt` version -/
theorem lhopital_zero_nhds (hff' : ∀ᶠ x in 𝓝 a, HasDerivAt f (f' x) x)
    (hgg' : ∀ᶠ x in 𝓝 a, HasDerivAt g (g' x) x) (hg' : ∀ᶠ x in 𝓝 a, g' x ≠ 0)
    (hfa : Tendsto f (𝓝 a) (𝓝 0)) (hga : Tendsto g (𝓝 a) (𝓝 0))
    (hdiv : Tendsto (fun x => f' x / g' x) (𝓝 a) l) : Tendsto (fun x => f x / g x) (𝓝[≠] a) l

(hff' : ∀ᶠ (x : ℝ) in 𝓝 a, HasDerivAt f (f' x) x)

(hgg' : ∀ᶠ (x : ℝ) in 𝓝 a, HasDerivAt g (g' x) x)

(hdiv : Filter.Tendsto (fun x => f' x / g' x) (𝓝 a) l)

Filter.Tendsto (fun x => f x / g x) (𝓝[≠] a) l


@[simp]
theorem dualDistribInvOfBasis_apply (b : Basis ι R M) (c : Basis κ R N) (f : Dual R (M ⊗[R] N)) :
    dualDistribInvOfBasis b c f = ∑ i, ∑ j, f (b i ⊗ₜ c j) • b.dualBasis i ⊗ₜ c.dualBasis j

(f : Module.Dual R (TensorProduct R M N))

(TensorProduct.dualDistribInvOfBasis b c) f = ∑ i : ι, ∑ j : κ, f (b i ⊗ₜ[R] c j) • b.dualBasis i ⊗ₜ[R] c.dualBasis j


private theorem ringEquivOfCardinalEqOfCharP (p : ℕ) [Fact p.Prime] [CharP K p] [CharP L p]
    (hK : ℵ₀ < #K) (hKL : #K = #L) : Nonempty (K ≃+* L)

{K L : Type}
[Field K]
[Field L]
[IsAlgClosed K]
[IsAlgClosed L]
(p : ℕ)
[Fact (Nat.Prime p)]
[CharP K p]
[CharP L p]
(hK : ℵ₀ < #K)
(hKL : #K = #L)


/-- The functor `RightExtension L' F ⥤ RightExtension L F`
induced by a natural transformation `L ⋙ G ⟶ L'`. -/
@[simps!]
def RightExtension.postcomp₁ (f : L ⋙ G ⟶ L') (F : C ⥤ H) :
    RightExtension L' F ⥤ RightExtension L F

(X : CategoryTheory.Comma ((CategoryTheory.whiskeringLeft C D' H).obj L') (CategoryTheory.Functor.fromPUnit F))

∀ (X_1 : D), ((CategoryTheory.Functor.RightExtension.postcomp₁ G f F).obj X).left.obj X_1 = X.left.obj (G.obj X_1)


@[simp]
theorem image2_insert_left : image2 f (insert a s) t = (fun b => f a b) '' t ∪ image2 f s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s : Set α}
{t : Set β}
{a : α}

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


@[simp]
theorem map_injective_iff {f : α → β} : Injective (map f) ↔ Injective f

Function.Injective (List.map f) ↔ Function.Injective f


/--
The pair `f g : A ⟶ B` is coreflexive if there is a morphism `B ⟶ A` which is a retraction for both.
-/
class IsCoreflexivePair (f g : A ⟶ B) : Prop where
  common_retraction' : ∃ s : B ⟶ A, f ≫ s = 𝟙 A ∧ g ≫ s = 𝟙 A

[self : CategoryTheory.IsCoreflexivePair f g]

∃ s,
  CategoryTheory.CategoryStruct.comp f s = CategoryTheory.CategoryStruct.id A ∧
    CategoryTheory.CategoryStruct.comp g s = CategoryTheory.CategoryStruct.id A


theorem succ_le_of_lt {n m : Nat} (h : n < m) : succ n ≤ m


@[to_additive]
theorem prehaar_self {K₀ : PositiveCompacts G} {U : Set G} (hU : (interior U).Nonempty) :
    prehaar (K₀ : Set G) U K₀.toCompacts = 1

{K₀ : TopologicalSpace.PositiveCompacts G}

MeasureTheory.Measure.haar.addPrehaar (↑K₀) U K₀.toCompacts = 1


/-- Adding a multiple of the first vector passed to `oangle` to the second vector does not change
the sign of the angle. -/
@[simp]
theorem oangle_sign_smul_add_right (x y : V) (r : ℝ) :
    (o.oangle x (r • x + y)).sign = (o.oangle x y).sign

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


@[simp] theorem compl_le_self : xᶜ ≤ x ↔ x = ⊤

xᶜ ≤ x ↔ x = ⊤


@[simp]
theorem countable_insert {s : Set α} {a : α} : (insert a s).Countable ↔ s.Countable


theorem associated_normalize (x : α) : Associated x (normalize x)

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
(x : α)


theorem aleph0_le_add_iff {a b : Cardinal} : ℵ₀ ≤ a + b ↔ ℵ₀ ≤ a ∨ ℵ₀ ≤ b

Cardinal.aleph0 ≤ a + b ↔ Cardinal.aleph0 ≤ a ∨ Cardinal.aleph0 ≤ b


theorem exists_dvd_of_not_prime {n : ℕ} (n2 : 2 ≤ n) (np : ¬Prime n) : ∃ m, m ∣ n ∧ m ≠ 1 ∧ m ≠ n

{n : ℕ}
(n2 : 2 ≤ n)
(np : ¬Nat.Prime n)


theorem eventuallyEq_of_mem_source (hx : x ∈ (chartAt H c).source) :
    f =ᶠ[𝓝 x] f.toContDiffBump ∘ extChartAt I c

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)
{x : M}
(hx : x ∈ (chartAt H c).source)

↑f =ᶠ[𝓝 x] ↑f.toContDiffBump ∘ ↑(extChartAt I c)


lemma mapₐ_surjective_of_surjective {f : A →ₐ[R] B} (a : A) [Away a Aₚ] [Away (f a) Bₚ]
    (hf : Function.Surjective f) : Function.Surjective (mapₐ Aₚ Bₚ f a)

{R : Type u_1}
[CommSemiring R]
{A : Type u_5}
[CommRing A]
[Algebra R A]
{B : Type u_6}
[CommRing B]
[Algebra R B]
{Aₚ : Type u_7}
[CommRing Aₚ]
[Algebra A Aₚ]
[Algebra R Aₚ]
[IsScalarTower R A Aₚ]
{Bₚ : Type u_8}
[CommRing Bₚ]
[Algebra B Bₚ]
[Algebra R Bₚ]
[IsScalarTower R B Bₚ]
{f : A →ₐ[R] B}
(a : A)
[IsLocalization.Away a Aₚ]
[IsLocalization.Away (f a) Bₚ]
(hf : Function.Surjective ⇑f)

Function.Surjective ⇑(IsLocalization.Away.mapₐ Aₚ Bₚ f a)


theorem uniformity_def :
    𝓤 (tsze R M) =
      ((𝓤 R).comap fun p => (p.1.fst, p.2.fst)) ⊓ ((𝓤 M).comap fun p => (p.1.snd, p.2.snd))

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

uniformity (tsze R M) =
  Filter.comap (fun p => (p.1.fst, p.2.fst)) (uniformity R) ⊓ Filter.comap (fun p => (p.1.snd, p.2.snd)) (uniformity M)


@[to_additive]
lemma coe_monoidHom_trans (e₁ : M ≃* N) (e₂ : N ≃* P) :
    (e₁.trans e₂ : M →* P) = (e₂ : N →* P).comp ↑e₁

{M : Type u_6}
{N : Type u_7}
{P : Type u_8}
[MulOneClass M]
[MulOneClass N]
[MulOneClass P]
(e₁ : M ≃* N)
(e₂ : N ≃* P)


/-- A subset of a collinear set is collinear. -/
theorem Collinear.subset {s₁ s₂ : Set P} (hs : s₁ ⊆ s₂) (h : Collinear k s₂) : Collinear k s₁

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s₁ s₂ : Set P}
(hs : s₁ ⊆ s₂)
(h : Collinear k s₂)


@[simp]
theorem cast_negOfNat (n : ℕ) : ((negOfNat n : ℤ) : R) = -n

{R : Type u}
[AddGroupWithOne R]
(n : ℕ)


@[simp]
theorem natTrailingDegree_neg (p : R[X]) : natTrailingDegree (-p) = natTrailingDegree p


theorem infs_inter_subset_right : s ⊼ (t₁ ∩ t₂) ⊆ s ⊼ t₁ ∩ s ⊼ t₂

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{s t₁ t₂ : Finset α}

s ⊼ (t₁ ∩ t₂) ⊆ s ⊼ t₁ ∩ s ⊼ t₂


/-- The **Erdős–Ginzburg–Ziv theorem** for `ℤ`.

Any sequence of at least `2 * n - 1` elements of `ℤ` contains a subsequence of `n` elements whose
sum is divisible by `n`. -/
theorem Int.erdos_ginzburg_ziv (a : ι → ℤ) (hs : 2 * n - 1 ≤ s.card) :
    ∃ t ⊆ s, t.card = n ∧ ↑n ∣ ∑ i ∈ t, a i

{ι : Type u_1}
{n : ℕ}
{s : Finset ι}
(a : ι → ℤ)
(hs : 2 * n - 1 ≤ s.card)


@[simp]
theorem preimage_const_mul_Ioo_of_neg (a b : α) {c : α} (h : c < 0) :
    (c * ·) ⁻¹' Ioo a b = Ioo (b / c) (a / c)

{α : Type u_1}
[LinearOrderedField α]
(a b : α)
{c : α}
(h : c < 0)

(fun x => c * x) ⁻¹' Set.Ioo a b = Set.Ioo (b / c) (a / c)


@[simp]
theorem run_mk (x : m (Option α)) : OptionT.run (OptionT.mk x) = x

{α : Type u}
{m : Type u → Type v}
(x : m (Option α))


protected theorem MeasurableSet.of_compl (h : MeasurableSet sᶜ) : MeasurableSet s

{α : Type u_1}
{s : Set α}
{m : MeasurableSpace α}
(h : MeasurableSet sᶜ)


/-- The functor `Cᵒᵖ ⥤ C ⥤ AddCommGrp` which sends `X : C` and `Y : C`
to `Ext X Y n`. -/
@[simps]
noncomputable def extFunctor (n : ℕ) : Cᵒᵖ ⥤ C ⥤ AddCommGrp.{w}

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
(n : ℕ)
{X₁ X₂ : Cᵒᵖ}
(f : X₁ ⟶ X₂)
(Y : C)

((CategoryTheory.Abelian.extFunctor n).map f).app Y =
  AddCommGrp.ofHom (AddMonoidHom.mk' (fun α => (CategoryTheory.Abelian.Ext.mk₀ f.unop).comp α ⋯) ⋯)


theorem insert_union_comm (s t : Finset α) (a : α) : insert a s ∪ t = s ∪ insert a t

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


@[simp]
theorem cons_fz (a : α) (v : Vector3 α n) : (a :: v) fz = a

{α : Type u_1}
{n : ℕ}
(a : α)
(v : Vector3 α n)


@[to_additive]
theorem pow_mem_closedBall {n : ℕ} (h : a ∈ closedBall b r) :
    a ^ n ∈ closedBall (b ^ n) (n • r)

{E : Type u_6}
[SeminormedAddCommGroup E]
{a b : E}
{r : ℝ}
{n : ℕ}
(h : a ∈ Metric.closedBall b r)

n • a ∈ Metric.closedBall (n • b) (n • r)


@[simp]
theorem centralizer_eq_top_iff_subset {s : Set A} : centralizer R s = ⊤ ↔ s ⊆ center R A

(R : Type u)
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{s : Set A}

Subalgebra.centralizer R s = ⊤ ↔ s ⊆ ↑(Subalgebra.center R A)


@[simp] protected theorem sub_self (a : Int) : a - a = 0


@[simp]
theorem symm_bot : (⊥ : α ≃. β).symm = ⊥


theorem uniformContinuous (f : F) : UniformContinuous (f : β → γ)

[CompactlySupportedContinuousMapClass F β γ]


@[simp, norm_cast]
theorem coe_lt_coe : (a : WithBot α) < b ↔ a < b


theorem mdifferentiableWithinAt_fst {s : Set (M × M')} {x : M × M'} :
    MDifferentiableWithinAt (I.prod I') I Prod.fst s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{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']
[SmoothManifoldWithCorners I' M']
{s : Set (M × M')}
{x : M × M'}


@[simp]
theorem image.isoStrongEpiMono_inv_comp_mono {I' : C} (e : X ⟶ I') (m : I' ⟶ Y) (comm : e ≫ m = f)
    [StrongEpi e] [Mono m] : (image.isoStrongEpiMono e m comm).inv ≫ m = image.ι f

(CategoryTheory.Limits.image.isoStrongEpiMono e m comm).inv ≫ m = CategoryTheory.Limits.image.ι f


/-- The `G`-set `G`, acting on itself by left multiplication. -/
@[simps!]
def leftRegular (G : Type u) [Monoid G] : Action (Type u) (MonCat.of G)

∀ (x : ↑(MonCat.of G)) (x_1 : G), (Action.leftRegular G).ρ x x_1 = x * x_1


@[to_additive (attr := simp)]
theorem prod_singleton (f : α → β) (a : α) : ∏ x ∈ singleton a, f x = f a

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
(f : α → β)
(a : α)


theorem divMod_to_nat (d n : PosNum) :
    (n / d : ℕ) = (divMod d n).1 ∧ (n % d : ℕ) = (divMod d n).2

↑n / ↑d = ↑(d.divMod n).1 ∧ ↑n % ↑d = ↑(d.divMod n).2


@[simp] theorem bne_iff_ne [BEq α] [LawfulBEq α] (a b : α) : a != b ↔ a ≠ b

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


theorem eq_iInf_of_mem_iff_exists_mem {f : ι → Filter α} {l : Filter α}
    (h : ∀ {s}, s ∈ l ↔ ∃ i, s ∈ f i) : l = iInf f

(h : ∀ {s : Set α}, s ∈ l ↔ ∃ i, s ∈ f i)


theorem arg_of_re_neg_of_im_neg {x : ℂ} (hx_re : x.re < 0) (hx_im : x.im < 0) :
    arg x = Real.arcsin ((-x).im / abs x) - π

x.arg = Real.arcsin ((-x).im / Complex.abs x) - π


@[to_additive]
theorem lift_eq_prod_map {β : Type v} [Group β] {f : α → β} {x} : lift f x = prod (map f x)

{α : Type u}
{β : Type v}
[AddGroup β]
{f : α → β}
{x : FreeAddGroup α}

(FreeAddGroup.lift f) x = FreeAddGroup.sum ((FreeAddGroup.map f) x)


protected theorem Tendsto.iterate {f : α → α} {l : Filter α} (h : Tendsto f l l) :
    ∀ n, Tendsto (f^[n]) l l

{α : Type u}
{f : α → α}
{l : Filter α}
(h : Filter.Tendsto f l l)
(n : ℕ)


@[simp]
theorem tendsto_Iio_atTop {f : β → Iio a} :
    Tendsto f l atTop ↔ Tendsto (fun x => (f x : α)) l (𝓝[<] a)

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

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


theorem emod_pos_of_not_dvd {a b : Int} (h : ¬ a ∣ b) : a = 0 ∨ 0 < b % a


theorem neg_left {M : Type*} [AddCommGroup M] [TopologicalSpace M] [TopologicalAddGroup M]
    {v : VectorMeasure α M} {w : VectorMeasure α N} (h : v ⟂ᵥ w) : -v ⟂ᵥ w

{α : Type u_1}
{m : MeasurableSpace α}
{N : Type u_5}
[AddCommMonoid N]
[TopologicalSpace N]
{M : Type u_6}
[AddCommGroup M]
[TopologicalSpace M]
[TopologicalAddGroup M]
{v : MeasureTheory.VectorMeasure α M}
{w : MeasureTheory.VectorMeasure α N}
(h : v ⟂ᵥ w)


@[simp]
theorem inv_eqToHom {X Y : C} (h : X = Y) : inv (eqToHom h) = eqToHom h.symm

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
(h : X = Y)

CategoryTheory.inv (CategoryTheory.eqToHom h) = CategoryTheory.eqToHom ⋯


theorem dual_balanceL (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balanceL l x r) = balanceR (dual r) x (dual l)

{α : Type u_1}
(l : Ordnode α)
(x : α)
(r : Ordnode α)

(l.balanceL x r).dual = r.dual.balanceR x l.dual


@[simp] lemma LinearMap.extendScalarsOfIsLocalization_apply (f : M →ₗ[A] N) :
    f.extendScalarsOfIsLocalization S A = f

{R : Type u_3}
[CommSemiring R]
(S : Submonoid R)
(A : Type u_4)
[CommSemiring A]
[Algebra R A]
[IsLocalization S A]
{M : Type u_5}
{N : Type u_6}
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]
[Module A N]
[IsScalarTower R A N]
(f : M →ₗ[A] N)

LinearMap.extendScalarsOfIsLocalization S A (↑R f) = f


@[to_additive (attr := simp)]
theorem map_mul [MulHomClass F M N] (f : F) (x y : M) : f (x * y) = f x * f y

{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[Mul M]
[Mul N]
[FunLike F M N]
[MulHomClass F M N]
(f : F)
(x y : M)


@[to_additive (attr := simp)]
lemma zpow_left (h : Commute a b) (m : ℤ) : Commute (a ^ m) b

{G : Type u_1}
[AddGroup G]
{a b : G}
(h : AddCommute a b)
(m : ℤ)


/-- The injection into a pi group with the same values commutes. -/
@[to_additive "The injection into an additive pi group with the same values commutes."]
theorem Pi.mulSingle_apply_commute [∀ i, MulOneClass <| f i] (x : ∀ i, f i) (i j : I) :
    Commute (mulSingle i (x i)) (mulSingle j (x j))

{I : Type u}
{f : I → Type v}
[DecidableEq I]
[(i : I) → MulOneClass (f i)]
(x : (i : I) → f i)
(i j : I)

Commute (Pi.mulSingle i (x i)) (Pi.mulSingle j (x j))


lemma cosh_le_exp_half_sq (x : ℝ) : cosh x ≤ exp (x ^ 2 / 2)


theorem filter_cons :
    (x :: xs : List α).filter p = if p x then x :: (xs.filter p) else xs.filter p

{α : Type u_1}
{x : α}
{xs : List α}
{p : α → Bool}

List.filter p (x :: xs) = if p x = true then x :: List.filter p xs else List.filter p xs


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

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


theorem map_comp {g : β → γ} {f : α → β} : Sym2.map (g ∘ f) = Sym2.map g ∘ Sym2.map f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{g : β → γ}
{f : α → β}


theorem sup_toSubalgebra_of_right [FiniteDimensional K E2] :
    (E1 ⊔ E2).toSubalgebra = E1.toSubalgebra ⊔ E2.toSubalgebra

{K : Type u_3}
{L : Type u_4}
[Field K]
[Field L]
[Algebra K L]
(E1 E2 : IntermediateField K L)
[FiniteDimensional K ↥E2]


theorem concat_ne_nil {u v : V} (p : G.Walk u v) (h : G.Adj v u) : p.concat h ≠ nil

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


/-- The pigeonhole principle for finitely many pigeons of different weights, non-strict inequality
version: there is a pigeonhole with the total weight of pigeons in it less than or equal to `b`
provided that the total number of pigeonholes times `b` is greater than or equal to the total weight
of all pigeons. -/
theorem exists_sum_fiber_le_of_sum_le_nsmul [Nonempty β] (hb : ∑ x, w x ≤ card β • b) :
    ∃ y, ∑ x ∈ univ.filter fun x => f x = y, w x ≤ b

(hb : ∑ x : α, w x ≤ Fintype.card β • b)

∃ y, ∑ x ∈ Finset.filter (fun x => f x = y) Finset.univ, w x ≤ b


theorem ext_iff {x y : AdicCompletion I M} : x = y ↔ ∀ n, x.val n = y.val n

{R : Type u_1}
[CommRing R]
{I : Ideal R}
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{x y : AdicCompletion I M}


@[simp] lemma mk_nnqsmul (q : ℚ≥0) (a : α) (ha : 0 ≤ a) :
    (⟨q • a, by rw [NNRat.smul_def]; exact mul_nonneg q.cast_nonneg ha⟩ : {x : α // 0 ≤ x}) =
      q • a

{α : Type u_1}
[LinearOrderedSemifield α]
(q : ℚ≥0)
(a : α)
(ha : 0 ≤ a)

↑⟨q • a, ⋯⟩ = q • a


theorem isSatisfiable_of_isSatisfiable_onTheory {L' : Language.{w, w'}} (φ : L →ᴸ L')
    (h : (φ.onTheory T).IsSatisfiable) : T.IsSatisfiable

{L : FirstOrder.Language}
{T : L.Theory}
{L' : FirstOrder.Language}
(φ : L →ᴸ L')
(h : (φ.onTheory T).IsSatisfiable)


/-- Compatibility of `nullHomotopicMap` with the application of additive functors -/
theorem map_nullHomotopicMap {W : Type*} [Category W] [Preadditive W] (G : V ⥤ W) [G.Additive]
    (hom : ∀ i j, C.X i ⟶ D.X j) :
    (G.mapHomologicalComplex c).map (nullHomotopicMap hom) =
      nullHomotopicMap (fun i j => by exact G.map (hom i j))

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
{W : Type u_2}
[CategoryTheory.Category.{u_3, u_2} W]
[CategoryTheory.Preadditive W]
(G : V ⥤ W)
[G.Additive]
(hom : (i j : ι) → C.X i ⟶ D.X j)

(G.mapHomologicalComplex c).map (Homotopy.nullHomotopicMap hom) = Homotopy.nullHomotopicMap fun i j => G.map (hom i j)


@[simp]
theorem image_Ico (e : α ≃o β) (a b : α) : e '' Ico a b = Ico (e a) (e b)

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


theorem fg_closure {s : Set M} (hs : s.Finite) : FG (closure L s)

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
{s : Set M}
(hs : s.Finite)


@[to_additive (attr := simp)]
theorem mem_one : s ∈ (1 : Filter α) ↔ (1 : α) ∈ s


/-- If a (unital or non-unital) star ring morphism has an inverse, it is an isomorphism of
star rings. -/
@[simps]
def ofStarRingHom (f : F) (g : G) (h₁ : ∀ x, g (f x) = x) (h₂ : ∀ x, f (g x) = x) : A ≃⋆+* B

{F : Type u_1}
{G : Type u_2}
{A : Type u_3}
{B : Type u_4}
[NonUnitalNonAssocSemiring A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Star B]
[FunLike F A B]
[NonUnitalRingHomClass F A B]
[NonUnitalStarRingHomClass F A B]
[FunLike G B A]
(f : F)
(g : G)
(h₁ : ∀ (x : A), g (f x) = x)
(h₂ : ∀ (x : B), f (g x) = x)
(a : B)

(StarRingEquiv.ofStarRingHom f g h₁ h₂).symm a = g a


@[to_additive (attr := simp, nolint simpNF)]
theorem mulEquivOfQuotient_mk' (x y) : mulEquivOfQuotient f ((monoidOf S).mk' x y) = f.mk' x y

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{f : S.LocalizationMap N}
(x : M)
(y : ↥S)

(Localization.mulEquivOfQuotient f) ((Localization.monoidOf S).mk' x y) = f.mk' x y


@[simp]
theorem exp_conj : exp (conj x) = conj (exp x)

Complex.exp ((starRingEnd ℂ) x) = (starRingEnd ℂ) (Complex.exp x)


@[to_additive zsmul_mono_right]
lemma zpow_mono_left (hn : 0 ≤ n) : Monotone ((· ^ n) : α → α)

(α : Type u_1)
[OrderedCommGroup α]
{n : ℤ}
(hn : 0 ≤ n)


theorem inf_le_invariants_comp (f g : α → α) :
    invariants f ⊓ invariants g ≤ invariants (f ∘ g)

{α : Type u_1}
[MeasurableSpace α]
(f g : α → α)

MeasurableSpace.invariants f ⊓ MeasurableSpace.invariants g ≤ MeasurableSpace.invariants (f ∘ g)


theorem cond {c : α → Bool} {f : α → σ} {g : α → σ} (hc : Computable c) (hf : Computable f)
    (hg : Computable g) : Computable fun a => cond (c a) (f a) (g a)

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
{c : α → Bool}
{f g : α → σ}
(hc : Computable c)
(hf : Computable f)
(hg : Computable g)

Computable fun a => bif c a then f a else g a


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

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


/-- An identity partial homeomorphism belongs to the analytic groupoid. -/
theorem ofSet_mem_analyticGroupoid {s : Set H} (hs : IsOpen s) :
    PartialHomeomorph.ofSet s hs ∈ analyticGroupoid I

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{s : Set H}
(hs : IsOpen s)


theorem CondIndepSets.union {s₁ s₂ s' : Set (Set Ω)}
    (h₁ : CondIndepSets m' hm' s₁ s' μ) (h₂ : CondIndepSets m' hm' s₂ s' μ) :
    CondIndepSets m' hm' (s₁ ∪ s₂) s' μ

(h₁ : ProbabilityTheory.CondIndepSets m' hm' s₁ s' μ)

(h₂ : ProbabilityTheory.CondIndepSets m' hm' s₂ s' μ)

ProbabilityTheory.CondIndepSets m' hm' (s₁ ∪ s₂) s' μ


theorem le_graph_of_le {f g : E →ₗ.[R] F} (h : f ≤ g) : f.graph ≤ g.graph

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{f g : E →ₗ.[R] F}
(h : f ≤ g)


lemma Even.odd_add (ha : Even a) (hb : Odd b) : Odd (b + a)

{α : Type u_2}
[Semiring α]
{a b : α}
(ha : Even a)
(hb : Odd b)


/-- The 1-hypercover of `D.glued` in the big Zariski site that is given by the
open cover `D.U` from the glue data `D`.
The "covering of the intersection of two such open subsets" is the trivial
covering given by `D.V`. -/
@[simps]
noncomputable def oneHypercover : Scheme.zariskiTopology.OneHypercover D.glued

(D : AlgebraicGeometry.Scheme.GlueData)
(i₁ i₂ : D.J)
(j : PUnit.{u + 1})

D.oneHypercover.p₂ j = D.t i₁ i₂ ≫ D.f i₂ i₁


@[to_additive (attr := simp)]
theorem one_toGerm [One β] : (1 : α →ₘ[μ] β).toGerm = 1

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
[Zero β]


theorem fst_injective_iff : Injective (fst : (Σ a, β a) → α) ↔ ∀ a, Subsingleton (β a)

Function.Injective Sigma.fst ↔ ∀ (a : α), Subsingleton (β a)


theorem eq_nil (v : Vector3 α 0) : v = []


/-- A kernel is a Markov kernel if every measure in its image is a probability measure. -/
class IsMarkovKernel (κ : Kernel α β) : Prop where
  isProbabilityMeasure : ∀ a, IsProbabilityMeasure (κ a)

[self : ProbabilityTheory.IsMarkovKernel κ]


@[to_additive]
theorem inf_relindex_right : (H ⊓ K).relindex K = H.relindex K

{G : Type u_1}
[Group G]
(H K : Subgroup G)


@[simp]
lemma comp_assoc_of_second_is_zero_cochain {n₁ n₃ n₁₃ : ℤ}
    (z₁ : Cochain F G n₁) (z₂ : Cochain G K 0) (z₃ : Cochain K L n₃) (h₁₃ : n₁ + n₃ = n₁₃) :
    (z₁.comp z₂ (add_zero n₁)).comp z₃ h₁₃ = z₁.comp (z₂.comp z₃ (zero_add n₃)) h₁₃

(z₁ : CochainComplex.HomComplex.Cochain F G n₁)

(z₂ : CochainComplex.HomComplex.Cochain G K 0)

(z₃ : CochainComplex.HomComplex.Cochain K L n₃)

(z₁.comp z₂ ⋯).comp z₃ h₁₃ = z₁.comp (z₂.comp z₃ ⋯) h₁₃


theorem map_add_le (f g : M →ₛₗ[σ₁₂] M₂) : map (f + g) p ≤ map f p ⊔ map g p

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
(p : Submodule R M)
[RingHomSurjective σ₁₂]
(f g : M →ₛₗ[σ₁₂] M₂)

Submodule.map (f + g) p ≤ Submodule.map f p ⊔ Submodule.map g p


/-- The function `fun t ↦ inverse (x + t)` is O(1) as `t → 0`. -/
theorem inverse_add_norm (x : Rˣ) : (fun t : R => inverse (↑x + t)) =O[𝓝 0] fun _t => (1 : ℝ)

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]
(x : Rˣ)

(fun t => Ring.inverse (↑x + t)) =O[𝓝 0] fun _t => 1


@[simp] theorem isRight_swap (x : α ⊕ β) : x.swap.isRight = x.isLeft

{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)


/-- If `α` is equivalent to `β`, then `Set α` is equivalent to `Set β`. -/
@[simps]
protected def congr {α β : Type*} (e : α ≃ β) : Set α ≃ Set β

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
(t : Set β)

(Equiv.Set.congr e).symm t = ⇑e.symm '' t


@[simp]
theorem rTensorHomEquivHomRTensor_toLinearMap :
    (rTensorHomEquivHomRTensor R M P Q).toLinearMap = rTensorHomToHomRTensor R M P Q

(R : Type u)
(M : Type v₁)
(P : Type v₃)
(Q : Type v₄)
[CommRing R]
[AddCommGroup M]
[AddCommGroup P]
[AddCommGroup Q]
[Module R M]
[Module R P]
[Module R Q]
[Module.Free R M]
[Module.Finite R M]

↑(rTensorHomEquivHomRTensor R M P Q) = TensorProduct.rTensorHomToHomRTensor R M P Q


@[to_additive]
theorem inter_smul_subset : (s₁ ∩ s₂) • t ⊆ s₁ • t ∩ s₂ • t

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{s₁ s₂ : Set α}
{t : Set β}

(s₁ ∩ s₂) • t ⊆ s₁ • t ∩ s₂ • t


/-- The adjunction given by an equivalence of categories. (To obtain the opposite adjunction,
simply use `e.symm.toAdjunction`. -/
@[simps! unit counit]
def toAdjunction : e.functor ⊣ e.inverse

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


@[simp] lemma toMonoidHomEquiv_symm_apply (ψ : Multiplicative A →* M) (a : A) :
    toMonoidHomEquiv.symm ψ a = ψ (Multiplicative.ofAdd a)

{A : Type u_1}
{M : Type u_3}
[AddMonoid A]
[Monoid M]
(ψ : Multiplicative A →* M)
(a : A)

(AddChar.toMonoidHomEquiv.symm ψ) a = ψ (Multiplicative.ofAdd a)


@[simp]
protected theorem map_map (f : α → β) (g : β → γ) :
    ∀ x : P α, P.map g (P.map f x) = P.map (g ∘ f) x

(P : PFunctor.{u})
{α : Type v₁}
{β : Type v₂}
{γ : Type v₃}
(f : α → β)
(g : β → γ)
(x : ↑P α)


/-- If `f` is an antitone function from `ℤ` to a preorder and `x` lies between `f (n + 1)` and
`f n`, then `x` doesn't lie in the range of `f`. -/
theorem Antitone.ne_of_lt_of_lt_int {f : ℤ → α} (hf : Antitone f) (n : ℤ) {x : α}
    (h1 : f (n + 1) < x) (h2 : x < f n) (a : ℤ) : f a ≠ x

{α : Type u}
[Preorder α]
{f : ℤ → α}
(hf : Antitone f)
(n : ℤ)
{x : α}
(h1 : f (n + 1) < x)
(h2 : x < f n)
(a : ℤ)


theorem coeff_zero_mem_comap_of_root_mem {r : S} (hr : r ∈ I) {p : R[X]} (hp : p.eval₂ f r = 0) :
    p.coeff 0 ∈ I.comap f

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


@[simp, norm_cast]
theorem coe_add : ((x + y : R) : ℍ[R,c₁,c₂]) = x + y

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(x y : R)


@[grind_norm] theorem iff_eq (p q : Prop) : (p ↔ q) = (p = q)


/-- The identification `- ⊗ X = mop (unmop X ⊗ -)` as a natural isomorphism. -/
@[simps!]
def MonoidalOpposite.tensorRightIso (X : Cᴹᵒᵖ) :
    tensorRight X ≅ unmopFunctor C ⋙ tensorLeft (unmop X) ⋙ mopFunctor C

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

∀ (X_1 : Cᴹᵒᵖ), (X.tensorRightIso.hom.app X_1).unmop = 𝟙 (CategoryTheory.MonoidalCategory.tensorObj X.unmop X_1.unmop)


/-- Given a continuous `R`-alternating map `f` taking values in `R`, `f.smulRight z` is the
continuous alternating map sending `m` to `f m • z`. -/
@[simps! toContinuousMultilinearMap apply]
def smulRight : M [⋀^ι]→L[R] N

{R : Type u_1}
{M : Type u_3}
{N : Type u_4}
{ι : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
[TopologicalSpace R]
[TopologicalSpace M]
[TopologicalSpace N]
[ContinuousSMul R N]
(f : M [⋀^ι]→L[R] R)
(z : N)

(f.smulRight z).toContinuousMultilinearMap = f.smulRight z


@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.div' [MeasurableDiv₂ G] (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    AEMeasurable (f / g) μ

{G : Type u_2}
{α : Type u_3}
[MeasurableSpace G]
[Sub G]
{m : MeasurableSpace α}
{f g : α → G}
{μ : MeasureTheory.Measure α}
[MeasurableSub₂ G]
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


@[simp]
theorem leadingCoeff_of_b_ne_zero' (hb : b ≠ 0) : (toPoly ⟨0, b, c, d⟩).leadingCoeff = b

{R : Type u_1}
{b c d : R}
[Semiring R]
(hb : b ≠ 0)

{ a := 0, b := b, c := c, d := d }.toPoly.leadingCoeff = b


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

{α : Type u_2}
[Mul α]
[IsCancelMul α]
{s t : Set α}

Nat.card ↑(s * t) ≤ Nat.card ↑s * Nat.card ↑t


theorem bounds_nonempty {f : NormedAddGroupHom V₁ V₂} :
    ∃ c, c ∈ { c | 0 ≤ c ∧ ∀ x, ‖f x‖ ≤ c * ‖x‖ }

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
{f : NormedAddGroupHom V₁ V₂}

∃ c, c ∈ {c | 0 ≤ c ∧ ∀ (x : V₁), ‖f x‖ ≤ c * ‖x‖}


/-- If `IsCyclotomicExtension {3} ℚ K` then `𝓞 K` is a principal ideal domain. -/
theorem three_pid [IsCyclotomicExtension {3} ℚ K] : IsPrincipalIdealRing (𝓞 K)

(K : Type u)
[Field K]
[NumberField K]
[IsCyclotomicExtension {3} ℚ K]


theorem subperm_cons (a : α) {l₁ l₂ : List α} : a :: l₁ <+~ a :: l₂ ↔ l₁ <+~ l₂


theorem addHom_ext {M : Type*} [AddMonoid M] {f g : R[X] →+ M}
    (h : ∀ n a, f (monomial n a) = g (monomial n a)) : f = g

(h : ∀ (n : ℕ) (a : R), f ((Polynomial.monomial n) a) = g ((Polynomial.monomial n) a))


theorem unop_sInf (S : Set (Subring Rᵐᵒᵖ)) : (sInf S).unop = sInf (.op ⁻¹' S)

{R : Type u_2}
[Ring R]
(S : Set (Subring Rᵐᵒᵖ))


@[simp]
theorem hasDerivAtFilter_pi :
    HasDerivAtFilter φ φ' x L ↔ ∀ i, HasDerivAtFilter (fun x => φ x i) (φ' i) x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{L : Filter 𝕜}
{ι : Type u_1}
[Fintype ι]
{E' : ι → Type u_2}
[(i : ι) → NormedAddCommGroup (E' i)]
[(i : ι) → NormedSpace 𝕜 (E' i)]
{φ : 𝕜 → (i : ι) → E' i}
{φ' : (i : ι) → E' i}

HasDerivAtFilter φ φ' x L ↔ ∀ (i : ι), HasDerivAtFilter (fun x => φ x i) (φ' i) x L


/-- **Uniqueness of left-invariant measures**:
Two Haar measures coincide up to a multiplicative constant in a second countable group. -/
@[to_additive isAddLeftInvariant_eq_smul]
lemma isMulLeftInvariant_eq_smul [LocallyCompactSpace G] [SecondCountableTopology G]
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ'] :
    μ' = haarScalarFactor μ' μ • μ


theorem apply_ne_top (p : PMF α) (a : α) : p a ≠ ∞


theorem leadingCoeff_smul_of_smul_regular {S : Type*} [Monoid S] [DistribMulAction S R] {k : S}
    (p : R[X]) (h : IsSMulRegular R k) : (k • p).leadingCoeff = k • p.leadingCoeff

{R : Type u}
[Semiring R]
{S : Type u_1}
[Monoid S]
[DistribMulAction S R]
{k : S}
(p : R[X])
(h : IsSMulRegular R k)


@[to_additive (attr := simp, norm_cast)]
theorem const_pow [Pow G M] (a : G) (n : M) : (↑(a ^ n) : Germ l G) = (↑a : Germ l G) ^ n

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
{G : Type u_6}
[SMul M G]
(a : G)
(n : M)


@[simp] theorem isUnit_ι_iff {m : M} : IsUnit (ι Q m) ↔ IsUnit (Q m)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
[Invertible 2]
{m : M}

IsUnit ((CliffordAlgebra.ι Q) m) ↔ IsUnit (Q m)


theorem normSq_inv : normSq a⁻¹ = (normSq a)⁻¹

{R : Type u_1}
[LinearOrderedField R]
(a : ℍ[R])

Quaternion.normSq a⁻¹ = (Quaternion.normSq a)⁻¹


theorem HasDerivAt.arctan (hf : HasDerivAt f f' x) :
    HasDerivAt (fun x => arctan (f x)) (1 / (1 + f x ^ 2) * f') x

{f : ℝ → ℝ}
{f' x : ℝ}
(hf : HasDerivAt f f' x)

HasDerivAt (fun x => Real.arctan (f x)) (1 / (1 + f x ^ 2) * f') x


theorem sum_measure [PseudoMetrizableSpace β] {m : MeasurableSpace α} {μ : ι → Measure α}
    (h : ∀ i, AEStronglyMeasurable f (μ i)) : AEStronglyMeasurable f (Measure.sum μ)

(h : ∀ (i : ι), MeasureTheory.AEStronglyMeasurable f (μ i))

MeasureTheory.AEStronglyMeasurable f (MeasureTheory.Measure.sum μ)


@[reassoc (attr := simp)]
lemma homologyIsoSc'_hom_ι :
    (K.homologyIsoSc' i j k hi hk).hom ≫ (K.sc' i j k).homologyι =
      K.homologyι j ≫ (K.opcyclesIsoSc' i j k hi hk).hom


@[simp]
theorem finSepDegree_top : finSepDegree F (⊤ : IntermediateField E K) = finSepDegree F K

{F : Type u}
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type w)
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]

Field.finSepDegree F ↥⊤ = Field.finSepDegree F K


@[simp] lemma lor_eq_or (p q : PosNum) : p.lor q = p ||| q


/-- We say that a collection of functions form a smooth partition of unity on a set `s` if

* all functions are infinitely smooth and nonnegative;
* the family `fun i ↦ support (f i)` is locally finite;
* for all `x ∈ s` the sum `∑ᶠ i, f i x` equals one;
* for all `x`, the sum `∑ᶠ i, f i x` is less than or equal to one. -/
structure SmoothPartitionOfUnity (s : Set M := univ) where
  /-- The family of functions forming the partition of unity. -/
  toFun : ι → C^∞⟮I, M; 𝓘(ℝ), ℝ⟯
  /-- Around each point, there are only finitely many nonzero functions in the family. -/
  locallyFinite' : LocallyFinite fun i => support (toFun i)
  /-- All the functions in the partition of unity are nonnegative. -/
  nonneg' : ∀ i x, 0 ≤ toFun i x
  /-- The functions in the partition of unity add up to `1` at any point of `s`. -/
  sum_eq_one' : ∀ x ∈ s, ∑ᶠ i, toFun i x = 1
  /-- The functions in the partition of unity add up to at most `1` everywhere. -/
  sum_le_one' : ∀ x, ∑ᶠ i, toFun i x ≤ 1

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : optParam (Set M) Set.univ}
(self : SmoothPartitionOfUnity ι I M s)

LocallyFinite fun i => Function.support ⇑(self.toFun i)


theorem min_lt_min (h₁ : a < c) (h₂ : b < d) : min a b < min c d

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


@[simp]
theorem cons_isPath_iff {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    (cons h p).IsPath ↔ p.IsPath ∧ u ∉ p.support

{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).IsPath ↔ p.IsPath ∧ u ∉ p.support


@[to_additive]
theorem MulEquiv.map_finprod (g : M ≃* N) (f : α → M) : g (∏ᶠ i, f i) = ∏ᶠ i, g (f i)

{M : Type u_2}
{N : Type u_3}
{α : Sort u_4}
[CommMonoid M]
[CommMonoid N]
(g : M ≃* N)
(f : α → M)

g (∏ᶠ (i : α), f i) = ∏ᶠ (i : α), g (f i)


/-- The subring generated by a set includes the set. -/
@[simp, aesop safe 20 apply (rule_sets := [SetLike])]
theorem subset_closure {s : Set R} : s ⊆ closure s


theorem integral_comp_div_sub (hc : c ≠ 0) (d) :
    (∫ x in a..b, f (x / c - d)) = c • ∫ x in a / c - d..b / c - d, f x

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b c : ℝ}
(f : ℝ → E)
(hc : c ≠ 0)
(d : ℝ)

∫ (x : ℝ) in a..b, f (x / c - d) = c • ∫ (x : ℝ) in a / c - d..b / c - d, f x


@[to_additive (attr := simp, norm_cast)]
theorem coe_one : ((1 : α) : WithTop α) = 1


@[simp]
theorem endEquivAutGalois_mul (f g : End F) :
    (endEquivAutGalois F) (g ≫ f) = (endEquivAutGalois F g) * (endEquivAutGalois F f)

(F : CategoryTheory.Functor C FintypeCat)

(CategoryTheory.PreGaloisCategory.endEquivAutGalois F) (CategoryTheory.CategoryStruct.comp g f) =
  (CategoryTheory.PreGaloisCategory.endEquivAutGalois F) g * (CategoryTheory.PreGaloisCategory.endEquivAutGalois F) f


private lemma lambda_not_dvd_Y : ¬ λ ∣ S.Y

(S : FermatLastTheoremForThreeGen.Solution hζ)

¬hζ.toInteger - 1 ∣ FermatLastTheoremForThreeGen.Solution.Y S


@[simp]
theorem factorThru_comp_arrow {X Y : C} {P : Subobject Y} (f : X ⟶ P) (h) :
    P.factorThru (f ≫ P.arrow) h = f

(f : X ⟶ CategoryTheory.Subobject.underlying.obj P)


theorem cg_def {N : L.Substructure M} : N.CG ↔ ∃ S : Set M, S.Countable ∧ closure L S = N

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
{N : L.Substructure M}

N.CG ↔ ∃ S, S.Countable ∧ (FirstOrder.Language.Substructure.closure L).toFun S = N


@[simp]
theorem norm_domDomCongr (σ : ι ≃ ι') (f : ContinuousMultilinearMap 𝕜 (fun _ : ι => G) G') :
    ‖domDomCongr σ f‖ = ‖f‖

(σ : ι ≃ ι')

(f : ContinuousMultilinearMap 𝕜 (fun x => G) G')

‖ContinuousMultilinearMap.domDomCongr σ f‖ = ‖f‖


@[simp]
theorem braiding_naturality_left {X Y : ModuleCat R} (f : X ⟶ Y) (Z : ModuleCat R) :
    f ▷ Z ≫ (braiding Y Z).hom = (braiding X Z).hom ≫ Z ◁ f

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

f ▷ Z ≫ (Y.braiding Z).hom = (X.braiding Z).hom ≫ Z ◁ f


@[simp]
theorem inv_mul_integral_comp_sub_div :
    (c⁻¹ * ∫ x in a..b, f (d - x / c)) = ∫ x in d - b / c..d - a / c, f x

c⁻¹ * ∫ (x : ℝ) in a..b, f (d - x / c) = ∫ (x : ℝ) in d - b / c..d - a / c, f x


/-- The constant functor sending everything to `PUnit.star`. -/
@[simps!]
def star : C ⥤ Discrete PUnit.{w + 1}

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

∀ (x : C), ((CategoryTheory.Functor.star C).obj x).as = PUnit.unit


/-- The functor which maps `S : SnakeInput C` to the diagram
`S.L₀.X₁ ⟶ S.L₀.X₂ ⟶ S.L₀.X₃ ⟶ S.L₃.X₁ ⟶ S.L₃.X₂ ⟶ S.L₃.X₃`. -/
@[simps]
noncomputable def composableArrowsFunctor : SnakeInput C ⥤ ComposableArrows C 5

(S : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.ShortComplex.SnakeInput.composableArrowsFunctor.obj S = S.composableArrows


theorem Nat.le_of_ble_eq_true (h : Eq (Nat.ble n m) true) : LE.le n m


@[simp]
theorem chain'_cons {x y l} : Chain' R (x :: y :: l) ↔ R x y ∧ Chain' R (y :: l)

{α : Type u}
{R : α → α → Prop}
{x y : α}
{l : List α}

List.Chain' R (x :: y :: l) ↔ R x y ∧ List.Chain' R (y :: l)


@[simp, norm_cast]
theorem summable_ofReal {f : α → ℝ} : (Summable fun x => (f x : 𝕜)) ↔ Summable f

{α : Type u_1}
(𝕜 : Type u_2)
[RCLike 𝕜]
{f : α → ℝ}


theorem injective_toZ : Function.Injective (toZ i0)

{ι : Type u_1}
[LinearOrder ι]
[SuccOrder ι]
[IsSuccArchimedean ι]
[PredOrder ι]
{i0 : ι}


@[to_additive (attr := simp)]
theorem preimage_mul_left_closedBall [IsometricSMul G G] (a b : G) (r : ℝ) :
    (a * ·) ⁻¹' closedBall b r = closedBall (a⁻¹ * b) r

{G : Type v}
[AddGroup G]
[PseudoMetricSpace G]
[IsometricVAdd G G]
(a b : G)
(r : ℝ)

(fun x => a + x) ⁻¹' Metric.closedBall b r = Metric.closedBall (-a + b) r


/-- If `f` is monotone and antitone on a directed order, then `f` is constant. -/
lemma constant_of_monotone_antitone [IsDirected α (· ≤ ·)] (hf : Monotone f) (hf' : Antitone f)
    (a b : α) : f a = f b

{α : Type u}
(β : Type v)
[Preorder α]
[PartialOrder β]
{f : α → β}
[IsDirected α fun x x_1 => x ≤ x_1]
(hf : Monotone f)
(hf' : Antitone f)
(a b : α)


@[simp]
theorem invOf_two_smul_add_invOf_two_smul [Invertible (2 : R)] (x : M) :
    (⅟ 2 : R) • x + (⅟ 2 : R) • x = x

(R : Type u_2)
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Invertible 2]
(x : M)


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

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

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


theorem congr_iff_nhdsWithin {s : Set H} {x : H} {f g : H → H'} (h1 : f =ᶠ[𝓝[s] x] g)
    (h2 : f x = g x) : P f s x ↔ P g s x

{H : Type u_1}
{H' : Type u_3}
[TopologicalSpace H]
[TopologicalSpace H']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
(hG : G.LocalInvariantProp G' P)
{s : Set H}
{x : H}
{f g : H → H'}
(h1 : f =ᶠ[𝓝[s] x] g)
(h2 : f x = g x)


@[simp]
theorem bot_lt_coe (x : ℝ) : (⊥ : EReal) < x


protected theorem mul_div_cancel (m : Nat) {n : Nat} (H : 0 < n) : m * n / n = m


theorem valid : ∀ {s}, ValidFor l m r s → Valid s


/-- Let `L` be a topological space and let `L×L` be equipped with the product topology and let
`⊓:L×L → L` be an infimum. Then `L` is said to have *(jointly) continuous infimum* if the map
`⊓:L×L → L` is continuous.
-/
class ContinuousInf (L : Type*) [TopologicalSpace L] [Inf L] : Prop where
  /-- The infimum is continuous -/
  continuous_inf : Continuous fun p : L × L => p.1 ⊓ p.2

{L : Type u_1}
[TopologicalSpace L]
[Inf L]
[self : ContinuousInf L]


/-- If a function `f : M → F` from a complex manifold to a complex normed space is holomorphic on a
(pre)connected compact open set, then it is a constant on this set. -/
theorem apply_eq_of_isPreconnected_isCompact_isOpen {f : M → F} {U : Set M} {a b : M}
    (hd : MDifferentiableOn I 𝓘(ℂ, F) f U) (hpc : IsPreconnected U) (hc : IsCompact U)
    (ho : IsOpen U) (ha : a ∈ U) (hb : b ∈ U) : f a = f b

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℂ F]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners ℂ E H}
[I.Boundaryless]
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{f : M → F}
{U : Set M}
{a b : M}
(hd : MDifferentiableOn I 𝓘(ℂ, F) f U)
(hpc : IsPreconnected U)
(hc : IsCompact U)
(ho : IsOpen U)
(ha : a ∈ U)
(hb : b ∈ U)


/-- Let `P` be an ideal in `R[x]`.  The map
`R[x]/P → (R / (P ∩ R))[x] / (P / (P ∩ R))`
is injective.
-/
theorem injective_quotient_le_comap_map (P : Ideal R[X]) :
    Function.Injective <|
      Ideal.quotientMap
        (Ideal.map (Polynomial.mapRingHom (Quotient.mk (P.comap (C : R →+* R[X])))) P)
        (Polynomial.mapRingHom (Ideal.Quotient.mk (P.comap (C : R →+* R[X]))))
        le_comap_map

{R : Type u_1}
[CommRing R]
(P : Ideal (Polynomial R))

Function.Injective
  ⇑(Ideal.quotientMap (Ideal.map (Polynomial.mapRingHom (Ideal.Quotient.mk (Ideal.comap Polynomial.C P))) P)
      (Polynomial.mapRingHom (Ideal.Quotient.mk (Ideal.comap Polynomial.C P))) ⋯)


theorem kroneckerMap_smul_right [SMul R β] [SMul R γ] (f : α → β → γ) (r : R)
    (hf : ∀ a b, f a (r • b) = r • f a b) (A : Matrix l m α) (B : Matrix n p β) :
    kroneckerMap f A (r • B) = r • kroneckerMap f A B

(f : α → β → γ)

(hf : ∀ (a : α) (b : β), f a (r • b) = r • f a b)

Matrix.kroneckerMap f A (r • B) = r • Matrix.kroneckerMap f A B


theorem cons_isCycle_iff {u v : V} (p : G.Walk v u) (h : G.Adj u v) :
    (Walk.cons h p).IsCycle ↔ p.IsPath ∧ ¬s(u, v) ∈ p.edges

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

(SimpleGraph.Walk.cons h p).IsCycle ↔ p.IsPath ∧ s(u, v) ∉ p.edges


@[simp]
theorem laverage_zero_measure (f : α → ℝ≥0∞) : ⨍⁻ x, f x ∂(0 : Measure α) = 0

{α : Type u_1}
{m0 : MeasurableSpace α}
(f : α → ℝ≥0∞)


lemma le_dens_sdiff (s t : Finset α) : dens t - dens s ≤ dens (t \ s)

{α : Type u_2}
[Fintype α]
[DecidableEq α]
(s t : Finset α)


@[simp]
theorem mem_range (φ : F) {y : B} :
    y ∈ (NonUnitalStarAlgHom.range φ : NonUnitalStarSubalgebra R B) ↔ ∃ x : A, φ x = y

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[Star B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
[NonUnitalStarAlgHomClass F R A B]
(φ : F)
{y : B}

y ∈ NonUnitalStarAlgHom.range φ ↔ ∃ x, φ x = y


@[simp]
theorem mem_ndunion {s t : Multiset α} {a : α} : a ∈ ndunion s t ↔ a ∈ s ∨ a ∈ t

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


theorem int_add (h : Irrational x) (m : ℤ) : Irrational (m + x)


lemma essFiniteType_cond_iff (σ : Finset S) :
    IsLocalization ((IsUnit.submonoid S).comap (algebraMap (adjoin R (σ : Set S)) S)) S ↔
    (∀ s : S, ∃ t ∈ Algebra.adjoin R (σ : Set S),
      IsUnit t ∧ s * t ∈ Algebra.adjoin R (σ : Set S))

(R : Type u_1)
(S : Type u_2)
[CommRing R]
[CommRing S]
[Algebra R S]
(σ : Finset S)

IsLocalization (Submonoid.comap (algebraMap (↥(Algebra.adjoin R ↑σ)) S) (IsUnit.submonoid S)) S ↔
  ∀ (s : S), ∃ t ∈ Algebra.adjoin R ↑σ, IsUnit t ∧ s * t ∈ Algebra.adjoin R ↑σ


@[norm_cast]
theorem coe_inj : (a : WithTop α) = b ↔ a = b


private theorem tmul_apply (a : ι → M) (b : ι₂ → M) :
    tmul ((⨂ₜ[R] i, a i) ⊗ₜ[R] ⨂ₜ[R] i, b i) = ⨂ₜ[R] i, Sum.elim a b i

{ι : Type u_1}
{ι₂ : Type u_2}
{R : Type u_4}
[CommSemiring R]
{M : Type u_8}
[AddCommMonoid M]
[Module R M]
(a : ι → M)
(b : ι₂ → M)

PiTensorProduct.tmul (((PiTensorProduct.tprod R) fun i => a i) ⊗ₜ[R] (PiTensorProduct.tprod R) fun i => b i) =
  (PiTensorProduct.tprod R) fun i => Sum.elim a b i


theorem get_ofFn_go {n} (f : Fin n → α) (i j h) (k) (hk) :
    get (ofFn.go f i j h) ⟨k, hk⟩ = f ⟨j + k, by simp at hk; omega⟩

(hk : k < (List.ofFn.go f i j h).length)

(List.ofFn.go f i j h).get ⟨k, hk⟩ = f ⟨j + k, ⋯⟩


@[deprecated getElem?_modifyNth (since := "2024-06-12")]
theorem get?_modifyNth (f : α → α) (n) (l : List α) (m) :
    (modifyNth f n l).get? m = (fun a => if n = m then f a else a) <$> l.get? m

{α : Type u_1}
(f : α → α)
(n : Nat)
(l : List α)
(m : Nat)

(List.modifyNth f n l).get? m = (fun a => if n = m then f a else a) <$> l.get? m


/-- `p → q → r ↔ q ∧ p → r` -/
theorem le_himp_iff' : a ≤ b ⇨ c ↔ b ⊓ a ≤ c

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


lemma starComp_apply (hR : 0 < ringChar R) {φ : AddChar R ℂ} (a : R) :
    (starRingEnd ℂ) (φ a) = φ⁻¹ a

{R : Type u_1}
[CommRing R]
(hR : 0 < ringChar R)
{φ : AddChar R ℂ}
(a : R)


@[simp]
theorem pi_apply (c : P1) (i : ι) : pi fp c i = fp i c

{k : Type u_2}
{V1 : Type u_3}
{P1 : Type u_4}
[Ring k]
[AddCommGroup V1]
[AffineSpace V1 P1]
[Module k V1]
{ι : Type u_9}
{φv : ι → Type u_10}
{φp : ι → Type u_11}
[(i : ι) → AddCommGroup (φv i)]
[(i : ι) → Module k (φv i)]
[(i : ι) → AffineSpace (φv i) (φp i)]
(fp : (i : ι) → P1 →ᵃ[k] φp i)
(c : P1)
(i : ι)


/-- A product of copies of a topological space can be split as the binary product of one copy and
  the product of all the remaining copies. -/
@[simps!]
def funSplitAt : (ι → Y) ≃ₜ Y × ({ j // j ≠ i } → Y)

(f : (fun a => Y) i × ((j : { j // j ≠ i }) → (fun a => Y) ↑j))

(Homeomorph.funSplitAt Y i).symm f j = if h : j = i then f.1 else f.2 ⟨j, ⋯⟩


/-- A binary bicone for a pair of objects `P Q : C` consists of the cone point `X`,
maps from `X` to both `P` and `Q`, and maps from both `P` and `Q` to `X`,
so that `inl ≫ fst = 𝟙 P`, `inl ≫ snd = 0`, `inr ≫ fst = 0`, and `inr ≫ snd = 𝟙 Q`
-/
-- @[nolint has_nonempty_instance] Porting note (#5171): removed
structure BinaryBicone (P Q : C) where
  pt : C
  fst : pt ⟶ P
  snd : pt ⟶ Q
  inl : P ⟶ pt
  inr : Q ⟶ pt
  inl_fst : inl ≫ fst = 𝟙 P := by aesop
  inl_snd : inl ≫ snd = 0 := by aesop
  inr_fst : inr ≫ fst = 0 := by aesop
  inr_snd : inr ≫ snd = 𝟙 Q := by aesop

(self : CategoryTheory.Limits.BinaryBicone P Q)


theorem get?_swap (a : Array α) (i j : Fin a.size) (k : Nat) : (a.swap i j)[k]? =
    if j = k then some a[i.1] else if i = k then some a[j.1] else a[k]?

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

(a.swap i j)[k]? = if ↑j = k then some a[↑i] else if ↑i = k then some a[↑j] else a[k]?


theorem incl_isIdealMorphism : I.incl.IsIdealMorphism

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)


/-- The natural equivalence between continuous linear maps from `M₂` to `M₃`
and continuous 1-multilinear maps from `M₂` to `M₃`. -/
@[simps! apply_toMultilinearMap apply_apply symm_apply_apply]
def ofSubsingleton [Subsingleton ι] (i : ι) :
    (M₂ →L[R] M₃) ≃ ContinuousMultilinearMap R (fun _ : ι => M₂) M₃

(R : Type u)
{ι : Type v}
(M₂ : Type w₂)
(M₃ : Type w₃)
[Semiring R]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M₂]
[Module R M₃]
[TopologicalSpace M₂]
[TopologicalSpace M₃]
[Subsingleton ι]
(i : ι)
(f : M₂ →L[R] M₃)

((ContinuousMultilinearMap.ofSubsingleton R M₂ M₃ i) f).toMultilinearMap = (MultilinearMap.ofSubsingleton R M₂ M₃ i) ↑f


@[simp]
theorem isLittleO_exp_comp_exp_comp {f g : α → ℝ} :
    ((fun x => exp (f x)) =o[l] fun x => exp (g x)) ↔ Tendsto (fun x => g x - f x) l atTop

{α : Type u_1}
{l : Filter α}
{f g : α → ℝ}

((fun x => Real.exp (f x)) =o[l] fun x => Real.exp (g x)) ↔ Filter.Tendsto (fun x => g x - f x) l Filter.atTop


@[simp]
theorem X_pow_comp {k : ℕ} : (X ^ k).comp p = p ^ k

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


@[to_additive]
lemma prod_lt_one (hf : f < 1) : ∏ i, f i < 1

{ι : Type u_1}
{M : Type u_4}
[Fintype ι]
[OrderedCancelCommMonoid M]
{f : ι → M}
(hf : f < 1)


@[simp]
theorem Quotient.equiv_trans {N O : Type*} [AddCommGroup N] [Module R N] [AddCommGroup O]
    [Module R O] (P : Submodule R M) (Q : Submodule R N) (S : Submodule R O) (e : M ≃ₗ[R] N)
    (f : N ≃ₗ[R] O) (he : P.map e = Q) (hf : Q.map f = S) (hef : P.map (e.trans f) = S) :
    Quotient.equiv P S (e.trans f) hef =
      (Quotient.equiv P Q e he).trans (Quotient.equiv Q S f hf)

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
{N : Type u_5}
{O : Type u_6}
[AddCommGroup N]
[Module R N]
[AddCommGroup O]
[Module R O]
(P : Submodule R M)
(Q : Submodule R N)
(S : Submodule R O)
(e : M ≃ₗ[R] N)
(f : N ≃ₗ[R] O)
(he : Submodule.map e P = Q)
(hf : Submodule.map f Q = S)
(hef : Submodule.map (e ≪≫ₗ f) P = S)

Submodule.Quotient.equiv P S (e ≪≫ₗ f) hef = Submodule.Quotient.equiv P Q e he ≪≫ₗ Submodule.Quotient.equiv Q S f hf


@[simp]
theorem quot_mul (x y : Prequotient F) : Quot.mk Setoid.r (mul x y) =
    @HMul.hMul (ColimitType F) (ColimitType F) (ColimitType F) _
      (Quot.mk Setoid.r x) (Quot.mk Setoid.r y)

{J : Type v}
[CategoryTheory.SmallCategory J]
(F : J ⥤ MonCat)
(x y : MonCat.Colimits.Prequotient F)

Quot.mk Setoid.r (x.mul y) = Quot.mk Setoid.r x * Quot.mk Setoid.r y


@[simp]
theorem ciInf_unique [Unique ι] {s : ι → α} : ⨅ i, s i = s default

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
[Unique ι]
{s : ι → α}


/-- Given a coefficient function valued in linear maps satisfying a partially well-ordered support
condition, we produce a heterogeneous vertex operator. -/
@[simps]
def of_coeff (f : Γ → V →ₗ[R] W)
    (hf : ∀(x : V), (Function.support (f · x)).IsPWO) : HVertexOperator Γ R V W

(hf : ∀ (x : V), (Function.support fun x_1 => (f x_1) x).IsPWO)

(HVertexOperator.of_coeff f hf) x = (HahnModule.of R) { coeff := fun g => (f g) x, isPWO_support' := ⋯ }


theorem isRat_inv_one {α} [DivisionRing α] : {a : α} →
    IsNat a (nat_lit 1) → IsNat a⁻¹ (nat_lit 1)

Mathlib.Meta.NormNum.IsNat a 1 → Mathlib.Meta.NormNum.IsNat a⁻¹ 1


theorem iInf_ker_proj : (⨅ i, ker (proj i : (∀ i, φ i) →L[R] φ i) : Submodule R (∀ i, φ i)) = ⊥

{R : Type u_1}
[Semiring R]
{ι : Type u_4}
{φ : ι → Type u_5}
[(i : ι) → TopologicalSpace (φ i)]
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]

⨅ i, LinearMap.ker (ContinuousLinearMap.proj i) = ⊥


theorem dist_pointReflection_self_real (x y : P) :
    dist (pointReflection ℝ x y) y = 2 * dist x y

{V : Type u_2}
{P : Type u_10}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[NormedSpace ℝ V]
(x y : P)

dist ((AffineIsometryEquiv.pointReflection ℝ x) y) y = 2 * dist x y


theorem StrictMono.mul_monotone [PosMulMono α] [MulPosStrictMono α]
    (hf : StrictMono f) (hg : Monotone g) (hf₀ : ∀ x, 0 ≤ f x)
    (hg₀ : ∀ x, 0 < g x) : StrictMono (f * g)

{α : Type u}
{β : Type u_1}
[Semiring α]
[PartialOrder α]
[Preorder β]
{f g : β → α}
[PosMulMono α]
[MulPosStrictMono α]
(hf : StrictMono f)
(hg : Monotone g)
(hf₀ : ∀ (x : β), 0 ≤ f x)
(hg₀ : ∀ (x : β), 0 < g x)


@[simp]
theorem mem_ofCardinalUnion {l : Set (Set α)} (hc : 2 < c) {hunion hmono s} :
    s ∈ ofCardinalUnion l hc hunion hmono ↔ l sᶜ

{hunion : ∀ (S : Set (Set α)), #↑S < c → (∀ s ∈ S, s ∈ l) → ⋃₀ S ∈ l}

s ∈ Filter.ofCardinalUnion l hc hunion hmono ↔ l sᶜ


/-- The condition that a property of morphisms is stable by finite products. -/
class IsStableUnderFiniteProducts : Prop :=
  isStableUnderProductsOfShape (J : Type) [Finite J] : W.IsStableUnderProductsOfShape J

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{W : CategoryTheory.MorphismProperty C}
[self : W.IsStableUnderFiniteProducts]
(J : Type)
[Finite J]


@[simp] lemma toSubspaceUnit_apply (l : Line α ι) (a) : ⇑l.toSubspaceUnit a = l (a ())

{α : Type u_2}
{ι : Type u_3}
(l : Combinatorics.Line α ι)
(a : Unit → α)

↑l.toSubspaceUnit a = (fun x i => (l.idxFun i).getD x) (a ())


theorem le_rpow_of_log_le (hx : 0 ≤ x) (hy : 0 < y) (h : Real.log x ≤ z * Real.log y) :
    x ≤ y ^ z

{x y z : ℝ}
(hx : 0 ≤ x)
(hy : 0 < y)
(h : Real.log x ≤ z * Real.log y)


theorem Icc_succ_left : Icc a.succ b = Ioc a b


/-- A reflexive module is one for which the natural map to its double dual is a bijection.

Any finitely-generated free module (and thus any finite-dimensional vector space) is reflexive.
See `Module.IsReflexive.of_finite_of_free`. -/
class IsReflexive : Prop where
  /-- A reflexive module is one for which the natural map to its double dual is a bijection. -/
  bijective_dual_eval' : Bijective (Dual.eval R M)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
[self : Module.IsReflexive R M]

Function.Bijective ⇑(Module.Dual.eval R M)


@[simp]
theorem ofQuaternion_toQuaternion (c : CliffordAlgebra (Q c₁ c₂)) :
    ofQuaternion (toQuaternion c) = c

(c : CliffordAlgebra (CliffordAlgebraQuaternion.Q c₁ c₂))

CliffordAlgebraQuaternion.ofQuaternion (CliffordAlgebraQuaternion.toQuaternion c) = c


theorem ofNat_toNat (b : Bool) : ofNat (toNat b) = b


/-- Given `A : IndexSet Δ₁`, if `p.unop : unop Δ₂ ⟶ unop Δ₁` is an epi, this
is the obvious element in `A : IndexSet Δ₂` associated to the composition
of epimorphisms `p.unop ≫ A.e`. -/
@[simps]
def epiComp {Δ₁ Δ₂ : SimplexCategoryᵒᵖ} (A : IndexSet Δ₁) (p : Δ₁ ⟶ Δ₂) [Epi p.unop] :
    IndexSet Δ₂

(A : SimplicialObject.Splitting.IndexSet Δ₁)

(p : Δ₁ ⟶ Δ₂)


theorem neg_add_le {x y : PGame} : -(x + y) ≤ -x + -y


@[simp]
lemma KaehlerDifferential.mvPolynomialBasis_repr_D_X (σ) (i) :
    (mvPolynomialBasis R σ).repr (D _ _ (.X i)) = Finsupp.single i 1

(R : Type u)
[CommRing R]
(σ : Type u_1)
(i : σ)

(KaehlerDifferential.mvPolynomialBasis R σ).repr ((KaehlerDifferential.D R (MvPolynomial σ R)) (MvPolynomial.X i)) =
  Finsupp.single i 1


theorem modByMonic_add_div (p : R[X]) {q : R[X]} (hq : Monic q) : p %ₘ q + q * (p /ₘ q) = p

{R : Type u}
[Ring R]
(p : R[X])
{q : R[X]}
(hq : q.Monic)


theorem totalSpaceMk_embedding (x : B) : Embedding (@TotalSpace.mk B F E x)

[TopologicalSpace (Bundle.TotalSpace F E)]


theorem nonneg_inner_and_areaForm_eq_zero_iff_sameRay (x y : E) :
    0 ≤ ⟪x, y⟫ ∧ ω x y = 0 ↔ SameRay ℝ x y

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

0 ≤ ⟪x, y⟫_ℝ ∧ (o.areaForm x) y = 0 ↔ SameRay ℝ x y


theorem map_nhds_eq_of_equiv (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) :
    map f (𝓝 a) = 𝓝 (f a)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace E]
{f : E → F}
{f' : E ≃L[𝕜] F}
{a : E}
(hf : HasStrictFDerivAt f (↑f') a)


theorem whiskerRight_id_symm {f g : a ⟶ b} (η : f ⟶ g) : η = (ρ_ f).inv ≫ η ▷ 𝟙 b ≫ (ρ_ g).hom

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

η =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.rightUnitor f).inv
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight η (CategoryTheory.CategoryStruct.id b))
      (CategoryTheory.Bicategory.rightUnitor g).hom)


theorem choose_add_smul_choose [NatPowAssoc R] (r : R) (n k : ℕ) :
    (Nat.choose (n + k) k) • choose (r + k) (n + k) = choose (r + k) k * choose r n

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

(n + k).choose k • Ring.choose (r + ↑k) (n + k) = Ring.choose (r + ↑k) k * Ring.choose r n


/-- **Bernoulli's inequality** for `n : ℕ`, `-2 ≤ a`. -/
lemma one_add_mul_le_pow (H : -2 ≤ a) (n : ℕ) : 1 + n * a ≤ (1 + a) ^ n

{R : Type u_1}
[LinearOrderedRing R]
{a : R}
(H : -2 ≤ a)
(n : ℕ)


@[simp]
theorem ForgetEnrichment.homOf_homTo {X Y : ForgetEnrichment W C} (f : X ⟶ Y) :
    ForgetEnrichment.homOf W (ForgetEnrichment.homTo W f) = f

{X Y : CategoryTheory.ForgetEnrichment W C}

CategoryTheory.ForgetEnrichment.homOf W (CategoryTheory.ForgetEnrichment.homTo W f) = f


lemma rootSpace_neg_nsmul_add_chainTop_of_lt {n : ℕ} (hn : chainLength α β < n) :
    rootSpace H (- (n • α) + chainTop α β) = ⊥

(hn : LieAlgebra.IsKilling.chainLength α β < n)

LieAlgebra.rootSpace H (-(n • ⇑α) + ⇑(LieModule.chainTop (⇑α) β)) = ⊥


theorem digits_two_eq_bits (n : ℕ) : digits 2 n = n.bits.map fun b => cond b 1 0

Nat.digits 2 n = List.map (fun b => bif b then 1 else 0) n.bits


lemma uniformity_eq_of_hasBasis
    {ι} [UniformSpace E] [UniformAddGroup E] [ContinuousConstSMul 𝕜 E]
    {p' : ι → Prop} {s : ι → Set E} (p : Seminorm 𝕜 E) (hb : (𝓝 0 : Filter E).HasBasis p' s)
    (h₁ : ∃ r, p.closedBall 0 r ∈ 𝓝 0) (h₂ : ∀ i, p' i → ∃ r > 0, p.ball 0 r ⊆ s i) :
    𝓤 E = ⨅ r > 0, 𝓟 {x | p (x.1 - x.2) < r}

(h₂ : ∀ (i : ι), p' i → ∃ r > 0, p.ball 0 r ⊆ s i)


theorem monoidOf_eq_algebraMap (x) : (monoidOf M).toMap x = algebraMap R (Localization M) x

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(x : R)

(Localization.monoidOf M).toMap x = (algebraMap R (Localization M)) x


@[simp]
theorem whiskerRight_id {G : C ⥤ D} (F : D ⥤ E) :
    whiskerRight (NatTrans.id G) F = NatTrans.id (G.comp F)

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

CategoryTheory.whiskerRight (CategoryTheory.NatTrans.id G) F = CategoryTheory.NatTrans.id (G.comp F)


lemma adj_counit_app (F : Discrete J ⥤ C) :
    (adj L hW).counit.app (F ⋙ L) =
      (Functor.const (Discrete J)).map ((compLimitFunctorIso L hW).hom.app F) ≫
        (Functor.compConstIso (Discrete J) L).hom.app (lim.obj F) ≫
        whiskerRight (constLimAdj.counit.app F) L

(F : CategoryTheory.Functor (CategoryTheory.Discrete J) C)

(CategoryTheory.Localization.HasProductsOfShapeAux.adj L hW).counit.app (F.comp L) =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.Functor.const (CategoryTheory.Discrete J)).map
      ((CategoryTheory.Localization.HasProductsOfShapeAux.compLimitFunctorIso L hW).hom.app F))
    (CategoryTheory.CategoryStruct.comp
      ((CategoryTheory.Functor.compConstIso (CategoryTheory.Discrete J) L).hom.app (CategoryTheory.Limits.lim.obj F))
      (CategoryTheory.whiskerRight (CategoryTheory.Limits.constLimAdj.counit.app F) L))


@[simp]
theorem inv_le {r p : ℝ≥0} (h : r ≠ 0) : r⁻¹ ≤ p ↔ 1 ≤ r * p


{α : Type u_1}
[Fintype α]
{s : Finset α}
[DecidableEq α]
{a : α}

a ∉ sᶜ ↔ a ∈ s


@[to_additive]
theorem eq_of_one_div_eq_one_div (h : 1 / a = 1 / b) : a = b

{α : Type u_1}
[SubtractionMonoid α]
{a b : α}
(h : 0 - a = 0 - b)


@[simp]
theorem coe_copy (f : HeytingHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

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


lemma measure_inter_conull' (ht : μ (s \ t) = 0) : μ (s ∩ t) = μ s

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(ht : μ (s \ t) = 0)


/-- If a countable family of closed sets cover a dense `Gδ` set, then the union of their interiors
is dense. Formulated here with a union over a countable set in any type. -/
theorem IsGδ.dense_biUnion_interior_of_closed {t : Set α} {s : Set X} (hs : IsGδ s) (hd : Dense s)
    (ht : t.Countable) {f : α → Set X} (hc : ∀ i ∈ t, IsClosed (f i)) (hU : s ⊆ ⋃ i ∈ t, f i) :
    Dense (⋃ i ∈ t, interior (f i))

{X : Type u_1}
{α : Type u_2}
[TopologicalSpace X]
[BaireSpace X]
{t : Set α}
{s : Set X}
(hs : IsGδ s)
(hd : Dense s)
(ht : t.Countable)
{f : α → Set X}
(hc : ∀ i ∈ t, IsClosed (f i))
(hU : s ⊆ ⋃ i ∈ t, f i)


/-- An induction principle for closure membership, for predicates with two arguments. -/
@[elab_as_elim]
theorem closure_induction₂ {s : Set R} {p : R → R → Prop} {a b : R} (ha : a ∈ closure s)
    (hb : b ∈ closure s) (Hs : ∀ x ∈ s, ∀ y ∈ s, p x y) (H0_left : ∀ x, p 0 x)
    (H0_right : ∀ x, p x 0) (H1_left : ∀ x, p 1 x) (H1_right : ∀ x, p x 1)
    (Hneg_left : ∀ x y, p x y → p (-x) y) (Hneg_right : ∀ x y, p x y → p x (-y))
    (Hadd_left : ∀ x₁ x₂ y, p x₁ y → p x₂ y → p (x₁ + x₂) y)
    (Hadd_right : ∀ x y₁ y₂, p x y₁ → p x y₂ → p x (y₁ + y₂))
    (Hmul_left : ∀ x₁ x₂ y, p x₁ y → p x₂ y → p (x₁ * x₂) y)
    (Hmul_right : ∀ x y₁ y₂, p x y₁ → p x y₂ → p x (y₁ * y₂)) : p a b

(Hneg_left : ∀ (x y : R), p x y → p (-x) y)

(Hneg_right : ∀ (x y : R), p x y → p x (-y))

(Hadd_left : ∀ (x₁ x₂ y : R), p x₁ y → p x₂ y → p (x₁ + x₂) y)

(Hadd_right : ∀ (x y₁ y₂ : R), p x y₁ → p x y₂ → p x (y₁ + y₂))

(Hmul_left : ∀ (x₁ x₂ y : R), p x₁ y → p x₂ y → p (x₁ * x₂) y)

(Hmul_right : ∀ (x y₁ y₂ : R), p x y₁ → p x y₂ → p x (y₁ * y₂))


@[simp]
theorem inner_product_apply_eigenvector {μ : 𝕜} {v : E} {T : E →ₗ[𝕜] E}
    (h : v ∈ Module.End.eigenspace T μ) : ⟪v, T v⟫ = μ * (‖v‖ : 𝕜) ^ 2

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{μ : 𝕜}
{v : E}
{T : E →ₗ[𝕜] E}
(h : v ∈ Module.End.eigenspace T μ)


@[simp]
theorem pure_seq_eq_map (g : α → β) (f : Filter α) : seq (pure g) f = f.map g

{α : Type u}
{β : Type v}
(g : α → β)
(f : Filter α)


@[reassoc]
lemma RightFraction.leftFraction_fac [W.HasLeftCalculusOfFractions] {X Y : C}
    (φ : W.RightFraction X Y) : φ.f ≫ φ.leftFraction.s = φ.s ≫ φ.leftFraction.f

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[W.HasLeftCalculusOfFractions]
{X Y : C}
(φ : W.RightFraction X Y)

CategoryTheory.CategoryStruct.comp φ.f φ.leftFraction.s = CategoryTheory.CategoryStruct.comp φ.s φ.leftFraction.f


theorem fderivWithin_ccosh (hf : DifferentiableWithinAt ℂ f s x) (hxs : UniqueDiffWithinAt ℂ s x) :
    fderivWithin ℂ (fun x => Complex.cosh (f x)) s x = Complex.sinh (f x) • fderivWithin ℂ f s x

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


/-- An Akra-Bazzi recurrence is a function that satisfies the recurrence
`T n = (∑ i, a i * T (r i n)) + g n`. -/
structure AkraBazziRecurrence {α : Type*} [Fintype α] [Nonempty α]
    (T : ℕ → ℝ) (g : ℝ → ℝ) (a : α → ℝ) (b : α → ℝ) (r : α → ℕ → ℕ) where
  /-- Point below which the recurrence is in the base case -/
  n₀ : ℕ
  /-- `n₀` is always `> 0` -/
  n₀_gt_zero : 0 < n₀
  /-- The `a`'s are nonzero -/
  a_pos : ∀ i, 0 < a i
  /-- The `b`'s are nonzero -/
  b_pos : ∀ i, 0 < b i
  /-- The b's are less than 1 -/
  b_lt_one : ∀ i, b i < 1
  /-- `g` is nonnegative -/
  g_nonneg : ∀ x ≥ 0, 0 ≤ g x
  /-- `g` grows polynomially -/
  g_grows_poly : AkraBazziRecurrence.GrowsPolynomially g
  /-- The actual recurrence -/
  h_rec (n : ℕ) (hn₀ : n₀ ≤ n) : T n = (∑ i, a i * T (r i n)) + g n
  /-- Base case: `T(n) > 0` whenever `n < n₀` -/
  T_gt_zero' (n : ℕ) (hn : n < n₀) : 0 < T n
  /-- The `r`'s always reduce `n` -/
  r_lt_n : ∀ i n, n₀ ≤ n → r i n < n
  /-- The `r`'s approximate the `b`'s -/
  dist_r_b : ∀ i, (fun n => (r i n : ℝ) - b i * n) =o[atTop] fun n => n / (log n) ^ 2

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


/-- Provide modus tollens (`mt`) as dot notation for implications. -/
protected theorem Function.mt {a b : Prop} : (a → b) → ¬b → ¬a


/-- If `E / F` and `K / E` are both purely inseparable extensions, then `K / F` is also
purely inseparable. -/
theorem IsPurelyInseparable.trans [Algebra E K] [IsScalarTower F E K]
    [h1 : IsPurelyInseparable F E] [h2 : IsPurelyInseparable E K] : IsPurelyInseparable F K

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type w)
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]
[h1 : IsPurelyInseparable F E]
[h2 : IsPurelyInseparable E K]


lemma eq_rpow_inv (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : z ≠ 0) : x = y ^ z⁻¹ ↔ x ^ z = y

{x y z : ℝ}
(hx : 0 ≤ x)
(hy : 0 ≤ y)
(hz : z ≠ 0)


theorem Pi.default_apply {β : α → Sort v} [∀ a, Inhabited (β a)] (a : α) :
    @default (∀ a, β a) _ a = default

{α : Sort u_1}
{β : α → Sort v}
[(a : α) → Inhabited (β a)]
(a : α)


theorem _root_.MeasureTheory.Integrable.integral_norm_condexpKernel (hf_int : Integrable f μ) :
    Integrable (fun ω => ∫ y, ‖f y‖ ∂condexpKernel μ m ω) μ

{Ω : Type u_1}
{F : Type u_2}
{m : MeasurableSpace Ω}
[mΩ : MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
[NormedAddCommGroup F]
{f : Ω → F}
(hf_int : MeasureTheory.Integrable f μ)

MeasureTheory.Integrable (fun ω => ∫ (y : Ω), ‖f y‖ ∂(ProbabilityTheory.condexpKernel μ m) ω) μ


@[simp]
theorem map_comap_subtype : map p.subtype (comap p.subtype p') = p ⊓ p'

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p p' : Submodule R M)

Submodule.map p.subtype (Submodule.comap p.subtype p') = p ⊓ p'


@[to_additive]
theorem comp_coprod {Q : Type*} [CommMonoid Q] (h : P →* Q) (f : M →* P) (g : N →* P) :
    h.comp (f.coprod g) = (h.comp f).coprod (h.comp g)

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
[AddCommMonoid P]
{Q : Type u_8}
[AddCommMonoid Q]
(h : P →+ Q)
(f : M →+ P)
(g : N →+ P)


/-- A ring iso `α ≃+* β` can equivalently be viewed as a ring iso `αᵐᵒᵖ ≃+* βᵐᵒᵖ`. -/
@[simps! symm_apply_apply symm_apply_symm_apply apply_apply apply_symm_apply]
protected def op {α β} [Add α] [Mul α] [Add β] [Mul β] :
    α ≃+* β ≃ (αᵐᵒᵖ ≃+* βᵐᵒᵖ)

{α : Type u_7}
{β : Type u_8}
[Add α]
[Mul α]
[Add β]
[Mul β]
(f : α ≃+* β)

∀ (a : βᵐᵒᵖ), (RingEquiv.op f).symm a = MulOpposite.op ((↑f).symm (MulOpposite.unop a))


@[to_additive]
theorem nonempty_of_prod_ne_one (h : ∏ x ∈ s, f x ≠ 1) : s.Nonempty

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{f : α → β}
[CommMonoid β]
(h : ∏ x ∈ s, f x ≠ 1)


/-- The top subgroup is isomorphic to the group.

This is the group version of `Submonoid.topEquiv`. -/
@[to_additive (attr := simps!)
      "The top additive subgroup is isomorphic to the additive group.

      This is the additive group version of `AddSubmonoid.topEquiv`."]
def topEquiv : (⊤ : Subgroup G) ≃* G


theorem disjSum_mono_right (s : Multiset α) :
    Monotone (s.disjSum : Multiset β → Multiset (α ⊕ β))

{α : Type u_1}
{β : Type u_2}
(s : Multiset α)


theorem integral_neg' (f : α → G) : ∫ a, (-f) a ∂μ = -∫ a, f a ∂μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f : α → G)

∫ (a : α), (-f) a ∂μ = -∫ (a : α), f a ∂μ


/-- The category of cones on `F` is just the comma category `(Δ ↓ F)`, where `Δ` is the constant
    functor. -/
@[simps! (config := { notRecursive := [`PLift, `ULift] })]
def Cone.equivCostructuredArrow (F : J ⥤ C) : Cone F ≌ CostructuredArrow (const J) F

(X : CategoryTheory.CostructuredArrow (CategoryTheory.Functor.const J) F)

((CategoryTheory.Limits.Cone.equivCostructuredArrow F).counitIso.inv.app X).right =
  CategoryTheory.CategoryStruct.id X.right


theorem localization_localization_exists_of_eq [IsLocalization N T] (x y : R) :
    algebraMap R T x = algebraMap R T y →
      ∃ c : localizationLocalizationSubmodule M N, ↑c * x = ↑c * y

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
(N : Submonoid S)
(T : Type u_4)
[CommSemiring T]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
[IsLocalization M S]
[IsLocalization N T]
(x y : R)

(algebraMap R T) x = (algebraMap R T) y → ∃ c, ↑c * x = ↑c * y


/-- Given a finite set `s`, the product of `f i / g i` over `i ∈ s` equals the product of `f i`
over `i ∈ s` divided by the product of `g i` over `i ∈ s`. -/
@[to_additive
      "Given a finite set `s`, the sum of `f i / g i` over `i ∈ s` equals the sum of `f i`
      over `i ∈ s` minus the sum of `g i` over `i ∈ s`."]
theorem finprod_mem_div_distrib [DivisionCommMonoid G] (f g : α → G) (hs : s.Finite) :
    ∏ᶠ i ∈ s, f i / g i = (∏ᶠ i ∈ s, f i) / ∏ᶠ i ∈ s, g i

{α : Type u_1}
{G : Type u_4}
{s : Set α}
[SubtractionCommMonoid G]
(f g : α → G)
(hs : s.Finite)

∑ᶠ (i : α) (_ : i ∈ s), (f i - g i) = ∑ᶠ (i : α) (_ : i ∈ s), f i - ∑ᶠ (i : α) (_ : i ∈ s), g i


theorem natDegree_sub_le_of_le (hp : natDegree p ≤ m) (hq : natDegree q ≤ n) :
    natDegree (p - q) ≤ max m n

{R : Type u}
{n m : ℕ}
[Ring R]
{p q : R[X]}
(hp : p.natDegree ≤ m)
(hq : q.natDegree ≤ n)


theorem vars_bind₁ [DecidableEq τ] (f : σ → MvPolynomial τ R) (φ : MvPolynomial σ R) :
    (bind₁ f φ).vars ⊆ φ.vars.biUnion fun i => (f i).vars

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_3}
[CommSemiring R]
[DecidableEq τ]
(f : σ → MvPolynomial τ R)
(φ : MvPolynomial σ R)

((MvPolynomial.bind₁ f) φ).vars ⊆ φ.vars.biUnion fun i => (f i).vars


@[to_additive]
theorem orderOf_le_of_pow_eq_one (hn : 0 < n) (h : x ^ n = 1) : orderOf x ≤ n


theorem frobenius_nnnorm_def (A : Matrix m n α) :
    ‖A‖₊ = (∑ i, ∑ j, ‖A i j‖₊ ^ (2 : ℝ)) ^ (1 / 2 : ℝ)

{m : Type u_3}
{n : Type u_4}
{α : Type u_5}
[Fintype m]
[Fintype n]
[SeminormedAddCommGroup α]
(A : Matrix m n α)

‖A‖₊ = (∑ i : m, ∑ j : n, ‖A i j‖₊ ^ 2) ^ (1 / 2)


/-- 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).inverse.obj X).hom =
  CategoryTheory.CategoryStruct.comp X.hom (i.inv.app X.right)


theorem normalizer_inf : (N₁ ⊓ N₂).normalizer = N₁.normalizer ⊓ N₂.normalizer

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{N₁ N₂ : LieSubmodule R L M}


@[simp]
theorem DFinsupp.toFinsupp_single (i : ι) (m : M) :
    (DFinsupp.single i m : Π₀ _ : ι, M).toFinsupp = Finsupp.single i m

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Zero M]
[(m : M) → Decidable (m ≠ 0)]
(i : ι)
(m : M)

(DFinsupp.single i m).toFinsupp = Finsupp.single i m


@[to_additive]
protected theorem div [Div β] [ContinuousDiv β] (hu : Adapted f u) (hv : Adapted f v) :
    Adapted f (u / v)

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[Preorder ι]
{u v : ι → Ω → β}
{f : MeasureTheory.Filtration ι m}
[Sub β]
[ContinuousSub β]
(hu : MeasureTheory.Adapted f u)
(hv : MeasureTheory.Adapted f v)


protected theorem congr_arg {f : E ≃ₛₗᵢ[σ₁₂] E₂} : ∀ {x x' : E}, x = x' → f x = f x'

{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₂]
{f : E ≃ₛₗᵢ[σ₁₂] E₂}
{x x' : E}


lemma nnreal_iff [Algebra ℝ A] {a : A} :
    SpectrumRestricts a ContinuousMap.realToNNReal ↔ ∀ x ∈ spectrum ℝ a, 0 ≤ x

{A : Type u_3}
[Ring A]
[Algebra ℝ A]
{a : A}

SpectrumRestricts a ⇑ContinuousMap.realToNNReal ↔ ∀ x ∈ spectrum ℝ a, 0 ≤ x


@[simp] lemma supSum_singleton (hs : s ≠ univ) :
    supSum ({s} : Finset (Finset α)) = card α * ∑ k ∈ range (card α), (k : ℚ)⁻¹

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{s : Finset α}
[Nonempty α]
(hs : s ≠ Finset.univ)

AhlswedeZhang.supSum {s} = ↑(Fintype.card α) * ∑ k ∈ Finset.range (Fintype.card α), (↑k)⁻¹


theorem mk'_mul_mk'_of_map_mul {M M' : Type*} [Semiring M] [Semiring M'] [Module R M]
    [Algebra R M'] (f : M →ₗ[R] M') (hf : ∀ m₁ m₂, f (m₁ * m₂) = f m₁ * f m₂)
    [IsLocalizedModule S f] (m₁ m₂ : M) (s₁ s₂ : S) :
    mk' f m₁ s₁ * mk' f m₂ s₂ = mk' f (m₁ * m₂) (s₁ * s₂)

(hf : ∀ (m₁ m₂ : M), f (m₁ * m₂) = f m₁ * f m₂)

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


/-- A *⋆-algebra homomorphism* is an algebra homomorphism between `R`-algebras `A` and `B`
equipped with a `star` operation, and this homomorphism is also `star`-preserving. -/
structure StarAlgHom (R A B : Type*) [CommSemiring R] [Semiring A] [Algebra R A] [Star A]
  [Semiring B] [Algebra R B] [Star B] extends AlgHom R A B where
  /-- By definition, a ⋆-algebra homomorphism preserves the `star` operation. -/
  map_star' : ∀ x : A, toFun (star x) = star (toFun x)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Star A]
[Semiring B]
[Algebra R B]
[Star B]
(self : A →⋆ₐ[R] B)
(x : A)

(↑↑self.toRingHom).toFun (star x) = star ((↑↑self.toRingHom).toFun x)


/-- In a topological vector space with separating dual, the group of continuous linear equivalences
acts transitively on the set of nonzero vectors: given two nonzero vectors `x` and `y`, there
exists `A : V ≃L[R] V` mapping `x` to `y`. -/
theorem exists_continuousLinearEquiv_apply_eq [ContinuousSMul R V]
    {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    ∃ A : V ≃L[R] V, A x = y

{R : Type u_1}
{V : Type u_2}
[Field R]
[AddCommGroup V]
[TopologicalSpace R]
[TopologicalSpace V]
[TopologicalRing R]
[TopologicalAddGroup V]
[Module R V]
[SeparatingDual R V]
[ContinuousSMul R V]
{x y : V}
(hx : x ≠ 0)
(hy : y ≠ 0)


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

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


theorem le_of_span_le_span [Nontrivial R] {s t u : Set M} (hl : LinearIndependent R ((↑) : u → M))
    (hsu : s ⊆ u) (htu : t ⊆ u) (hst : span R s ≤ span R t) : s ⊆ t

(hl : LinearIndependent (ι := { x // x ∈ u }) R Subtype.val)

(hst : Submodule.span R s ≤ Submodule.span R t)


@[reassoc, simp]
theorem prod.comp_lift {V W X Y : C} [HasBinaryProduct X Y] (f : V ⟶ W) (g : W ⟶ X) (h : W ⟶ Y) :
    f ≫ prod.lift g h = prod.lift (f ≫ g) (f ≫ h)

f ≫ CategoryTheory.Limits.prod.lift g h = CategoryTheory.Limits.prod.lift (f ≫ g) (f ≫ h)


/-- Product of elements of a subring of a `CommRing` indexed by a `Finset` is in the
    subring. -/
protected theorem prod_mem {R : Type*} [CommRing R] (s : Subring R) {ι : Type*} {t : Finset ι}
    {f : ι → R} (h : ∀ c ∈ t, f c ∈ s) : (∏ i ∈ t, f i) ∈ s

{R : Type u_1}
[CommRing R]
(s : Subring R)
{ι : Type u_2}
{t : Finset ι}
{f : ι → R}
(h : ∀ c ∈ t, f c ∈ s)


theorem toReal_add (ha : a ≠ ∞) (hb : b ≠ ∞) : (a + b).toReal = a.toReal + b.toReal


theorem IsUpperSet.not_bddAbove (hs : IsUpperSet s) : s.Nonempty → ¬BddAbove s

{α : Type u_1}
[Preorder α]
{s : Set α}
[NoMaxOrder α]
(hs : IsUpperSet s)


@[simp]
theorem destruct_empty : destruct (empty α) = Sum.inr (empty α)

(Computation.empty α).destruct = Sum.inr (Computation.empty α)


@[simp]
theorem left_eq_mul₀ (ha : a ≠ 0) : a = a * b ↔ b = 1

{M₀ : Type u_2}
[CancelMonoidWithZero M₀]
{a b : M₀}
(ha : a ≠ 0)


/-- Twisting by a Dirichlet character `χ` distributes over convolution. -/
lemma mul_convolution_distrib {R : Type*} [CommSemiring R] {n : ℕ} (χ : DirichletCharacter R n)
    (f g : ℕ → R) :
    (((χ ·) : ℕ → R) * f) ⍟ (((χ ·) : ℕ → R) * g) = ((χ ·) : ℕ → R) * (f ⍟ g)

{R : Type u_1}
[CommSemiring R]
{n : ℕ}
(χ : DirichletCharacter R n)
(f g : ℕ → R)

(fun x => χ ↑x) * f ⍟ ((fun x => χ ↑x) * g) = (fun x => χ ↑x) * (f ⍟ g)


@[to_additive]
theorem alternatingProd_reverse :
    ∀ l : List α, alternatingProd (reverse l) = alternatingProd l ^ (-1 : ℤ) ^ (length l + 1)

{α : Type u_2}
[AddCommGroup α]
(l : List α)

l.reverse.alternatingSum = (-1) ^ (l.length + 1) • l.alternatingSum


@[simp]
theorem AlgHom.restrictNormal_commutes [Normal F E] (x : E) :
    algebraMap E K₂ (ϕ.restrictNormal E x) = ϕ (algebraMap E K₁ x)

{F : Type u_1}
{K₁ : Type u_3}
{K₂ : Type u_4}
[Field F]
[Field K₁]
[Field K₂]
[Algebra F K₁]
[Algebra F K₂]
(ϕ : K₁ →ₐ[F] K₂)
(E : Type u_6)
[Field E]
[Algebra F E]
[Algebra E K₁]
[Algebra E K₂]
[IsScalarTower F E K₁]
[IsScalarTower F E K₂]
[Normal F E]
(x : E)

(algebraMap E K₂) ((ϕ.restrictNormal E) x) = ϕ ((algebraMap E K₁) x)


theorem of_injective {α β} [Infinite β] (f : β → α) (hf : Injective f) : Infinite α

{α : Sort u_4}
{β : Sort u_5}
[Infinite β]
(f : β → α)
(hf : Function.Injective f)


@[simp, reassoc] lemma comp_f₁ : (f ≫ g).f₁ = f.f₁ ≫ g.f₁

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

(CategoryTheory.CategoryStruct.comp f g).f₁ = CategoryTheory.CategoryStruct.comp f.f₁ g.f₁


/-- Auxiliary lemma in order to state `transfer_eq_pow`. -/
theorem transfer_eq_pow_aux (g : G)
    (key : ∀ (k : ℕ) (g₀ : G), g₀⁻¹ * g ^ k * g₀ ∈ H → g₀⁻¹ * g ^ k * g₀ = g ^ k) :
    g ^ H.index ∈ H


theorem iSup_comp_le {ι' : Sort*} (f : ι' → α) (g : ι → ι') : ⨆ x, f (g x) ≤ ⨆ y, f y

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


@[simp] theorem coe_castLE (h : n ≤ m) (i : Fin n) : (castLE h i : Nat) = i