@[to_additive (attr := simp)]
theorem mul_liftRight_inv (f : M →* N) (h : ∀ x, IsUnit (f x)) (x) :
    f x * ↑(IsUnit.liftRight f h x)⁻¹ = 1

{M : Type u_4}
{N : Type u_5}
[Monoid M]
[Monoid N]
(f : M →* N)
(h : ∀ (x : M), IsUnit (f x))
(x : M)


@[to_additive (attr := simp)]
theorem inv_lt_self_iff : a⁻¹ < a ↔ 1 < a

{α : Type u}
[LinearOrderedCommGroup α]
{a : α}


@[to_additive (attr := simp)]
theorem preimage_smul_ball (c : G) (x : X) (r : ℝ≥0∞) :
    (c • ·) ⁻¹' ball x r = ball (c⁻¹ • x) r

{G : Type v}
{X : Type w}
[PseudoEMetricSpace X]
[Group G]
[MulAction G X]
[IsometricSMul G X]
(c : G)
(x : X)
(r : ℝ≥0∞)

(fun x => c • x) ⁻¹' EMetric.ball x r = EMetric.ball (c⁻¹ • x) r


@[simp]
lemma reflection_symm (h : f x = 2) :
    (reflection h).symm = reflection h

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{x : M}
{f : Module.Dual R M}
(h : f x = 2)

(Module.reflection h).symm = Module.reflection h


@[simp]
theorem coe_toAffineMap : ⇑f.toAffineMap = f

{k : Type u_1}
{V₁ : Type u_2}
{V₂ : Type u_3}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddCommGroup V₂]
[Module k V₂]
(f : V₁ →ₗ[k] V₂)


/-- A version of `Quotient.inductionOn` taking `{s : Setoid α}` as an implicit argument instead
of an instance argument. -/
@[elab_as_elim]
protected theorem inductionOn' {p : Quotient s₁ → Prop} (q : Quotient s₁)
    (h : ∀ a, p (Quotient.mk'' a)) : p q

{α : Sort u_1}
{s₁ : Setoid α}
{p : Quotient s₁ → Prop}
(q : Quotient s₁)
(h : ∀ (a : α), p (Quotient.mk'' a))


theorem empty_of_count_eq_zero' (s_mble : MeasurableSet s) (hsc : count s = 0) : s = ∅

(hsc : MeasureTheory.Measure.count s = 0)


theorem disjSups_assoc : ∀ s t u : Finset α, s ○ t ○ u = s ○ (t ○ u)

{α : Type u_2}
[DecidableEq α]
[DistribLattice α]
[OrderBot α]
[DecidableRel Disjoint]
(s t u : Finset α)

(s.disjSups t).disjSups u = s.disjSups (t.disjSups u)


@[reassoc]
theorem coconePointsIsoOfNatIso_inv_desc {F G : J ⥤ C} {s : Cocone G} {r t : Cocone F}
    (P : IsColimit t) (Q : IsColimit s) (w : F ≅ G) :
    (coconePointsIsoOfNatIso P Q w).inv ≫ P.desc r = Q.map _ w.inv

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

(P.coconePointsIsoOfNatIso Q w).inv ≫ P.desc r = Q.map r w.inv


theorem cycleOf_one [DecidableRel (1 : Perm α).SameCycle] (x : α) :
    cycleOf 1 x = 1

{α : Type u_2}
[DecidableRel (Equiv.Perm.SameCycle 1)]
(x : α)


/-- The number of solutions to `x^2 = a` is determined by the quadratic character. -/
theorem quadraticChar_card_sqrts (hF : ringChar F ≠ 2) (a : F) :
    ↑{x : F | x ^ 2 = a}.toFinset.card = quadraticChar F a + 1

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]
(hF : ringChar F ≠ 2)
(a : F)

↑{x | x ^ 2 = a}.toFinset.card = (quadraticChar F) a + 1


theorem associated_of_irreducible {a b : R} (ha : Irreducible a) (hb : Irreducible b) :
    Associated a b

(R : Type u)
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]
{a b : R}
(ha : Irreducible a)
(hb : Irreducible b)


@[to_additive (attr := simp)]
lemma lipschitzWith_inv_iff : LipschitzWith K f⁻¹ ↔ LipschitzWith K f

{α : Type u_5}
{E : Type u_6}
[SeminormedAddCommGroup E]
[PseudoEMetricSpace α]
{K : ℝ≥0}
{f : α → E}

LipschitzWith K (-f) ↔ LipschitzWith K f


theorem le_inf_support_add : f.support.inf degt ⊓ g.support.inf degt ≤ (f + g).support.inf degt

{R : Type u_1}
{A : Type u_3}
{T : Type u_4}
[SemilatticeInf T]
[OrderTop T]
[Semiring R]
(degt : A → T)
(f g : AddMonoidAlgebra R A)


/-- To show that two linear maps from the exterior algebra agree, it suffices to show they agree on
the exterior powers.

See note [partially-applied ext lemmas] -/
@[ext]
theorem lhom_ext ⦃f g : ExteriorAlgebra R M →ₗ[R] N⦄
    (h : ∀ i, f.compAlternatingMap (ιMulti R i) = g.compAlternatingMap (ιMulti R i)) : f = g

(h : ∀ (i : ℕ), f.compAlternatingMap (ExteriorAlgebra.ιMulti R i) = g.compAlternatingMap (ExteriorAlgebra.ιMulti R i))


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


@[simp]
theorem sdiff_eq_bot_iff : a \ b = ⊥ ↔ a ≤ b

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b : α}


/-- Given `f : β → ℝ≥0∞`, if `f` sends `{i | p i}` to a set of positive numbers
accumulating to zero, then closed `f i`-neighborhoods of the diagonal form a basis of `𝓤 α`.

For specific bases see `uniformity_basis_edist_le` and `uniformity_basis_edist_le'`. -/
protected theorem EMetric.mk_uniformity_basis_le {β : Type*} {p : β → Prop} {f : β → ℝ≥0∞}
    (hf₀ : ∀ x, p x → 0 < f x) (hf : ∀ ε, 0 < ε → ∃ x, p x ∧ f x ≤ ε) :
    (𝓤 α).HasBasis p fun x => { p : α × α | edist p.1 p.2 ≤ f x }

{f : β → ℝ≥0∞}

(hf : ∀ (ε : ℝ≥0∞), 0 < ε → ∃ x, p x ∧ f x ≤ ε)

(𝓤 α).HasBasis p fun x => {p | edist p.1 p.2 ≤ f x}


theorem totalDegree_smul_le [CommSemiring S] [DistribMulAction R S] (a : R) (f : MvPolynomial σ S) :
    (a • f).totalDegree ≤ f.totalDegree

{R : Type u}
{S : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S]
[DistribMulAction R S]
(a : R)
(f : MvPolynomial σ S)


@[simp]
theorem upperBounds_insert (a : α) (s : Set α) :
    upperBounds (insert a s) = Ici a ∩ upperBounds s

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

upperBounds (insert a s) = Set.Ici a ∩ upperBounds s


theorem Sphere.mem_coe {p : P} {s : Sphere P} : p ∈ (s : Set P) ↔ p ∈ s

{P : Type u_2}
[MetricSpace P]
{p : P}
{s : EuclideanGeometry.Sphere P}

p ∈ Metric.sphere s.center s.radius ↔ p ∈ s


@[simp] theorem add_mul_mod_self_right (x y z : Nat) : (x + y * z) % z = x % z


theorem left_or_right_lt_sup (h : a ≠ b) : a < a ⊔ b ∨ b < a ⊔ b

{α : Type u}
[SemilatticeSup α]
{a b : α}
(h : a ≠ b)


theorem attach_map_val' (s : Multiset α) (f : α → β) : (s.attach.map fun i => f i.val) = s.map f

{α : Type u_1}
{β : Type v}
(s : Multiset α)
(f : α → β)

Multiset.map (fun i => f ↑i) s.attach = Multiset.map f s


/--Universal property of the free product of algebras:
for every `R`-algebra `B`, every family of maps `maps : (i : I) → (A i →ₐ[R] B)` lifts
to a unique arrow `π` from `FreeProduct R A` such that  `π ∘ ι i = maps i`.-/
@[simps] def lift : ({i : I} → A i →ₐ[R] B) ≃ (FreeProduct R A →ₐ[R] B)

{I : Type u}
[DecidableEq I]
(R : Type v)
[CommSemiring R]
(A : I → Type w)
[(i : I) → Semiring (A i)]
[(i : I) → Algebra R (A i)]
{B : Type w'}
[Semiring B]
[Algebra R B]
(maps : {i : I} → A i →ₐ[R] B)

(LinearAlgebra.FreeProduct.lift R A) maps =
  (RingQuot.liftAlgHom R) ⟨(TensorAlgebra.lift R) (DirectSum.toModule R I B fun x => maps.toLinearMap), ⋯⟩


@[simp]
theorem interUnionPullbackCone_pt : (interUnionPullbackCone F U V).pt = F.1.obj (op <| U ⊔ V)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : TopCat}
(F : TopCat.Sheaf C X)
(U V : TopologicalSpace.Opens ↑X)

(F.interUnionPullbackCone U V).pt = F.val.obj (Opposite.op (U ⊔ V))


@[reassoc (attr := simp)]
lemma inrX_fstX (i j : ι) (hij : c.Rel i j) :
    inrX φ i ≫ fstX φ i j hij = 0

HomologicalComplex.homotopyCofiber.inrX φ i ≫ HomologicalComplex.homotopyCofiber.fstX φ i j hij = 0


@[to_additive]
lemma mem_orbit_of_mem_orbit_submonoid {S : Submonoid M} {a b : α} (h : a ∈ orbit S b) :
    a ∈ orbit M b

{M : Type u}
[AddMonoid M]
{α : Type v}
[AddAction M α]
{S : AddSubmonoid M}
{a b : α}
(h : a ∈ AddAction.orbit (↥S) b)


@[simp]
theorem pullback_refine {Y X : C} {P : Cᵒᵖ ⥤ D} {S T : J.Cover X} (h : S ⟶ T) (f : Y ⟶ X)
    (x : Meq P T) : (x.pullback f).refine ((J.pullback f).map h) = (refine x h).pullback _

{J : CategoryTheory.GrothendieckTopology C}

[CategoryTheory.Category.{max v u, w} D]

(x.pullback f).refine ((J.pullback f).map h) = (x.refine h).pullback f


@[simp] lemma ofNat_eq_coe (n : ℕ) [n.AtLeastTwo] (m : α) :
    no_index (OfNat.ofNat n) = (m : WithBot α) ↔ OfNat.ofNat n = m

{α : Type u}
[AddMonoidWithOne α]
(n : ℕ)
[n.AtLeastTwo]
(m : α)


/-- A continuous function with compact support has a global maximum. -/
@[to_additive "A continuous function with compact support has a global maximum."]
theorem Continuous.exists_forall_ge_of_hasCompactMulSupport [ClosedIciTopology α] [Nonempty β]
    [One α] {f : β → α} (hf : Continuous f) (h : HasCompactMulSupport f) :
    ∃ x : β, ∀ y : β, f y ≤ f x

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIciTopology α]
[Nonempty β]
[Zero α]
{f : β → α}
(hf : Continuous f)
(h : HasCompactSupport f)


theorem initial_of_initial_comp [Initial F] [Initial (F ⋙ G)] : Initial G

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


theorem mem_span_repr_support (m : M) : m ∈ span R (b '' (b.repr m).support)

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(m : M)

m ∈ Submodule.span R (⇑b '' ↑(b.repr m).support)


@[to_additive]
theorem nndist_mul_mul_le (a₁ a₂ b₁ b₂ : E) :
    nndist (a₁ * a₂) (b₁ * b₂) ≤ nndist a₁ b₁ + nndist a₂ b₂

{E : Type u_3}
[SeminormedCommGroup E]
(a₁ a₂ b₁ b₂ : E)


/-- Typeclass for division rounded up. For each `a > 0`, this asserts the existence of a left
adjoint to the map `b ↦ a • b : β → β`. -/
class CeilDiv where
  /-- Ceiling division. If `a > 0`, then `b ⌈/⌉ a` is the least `c` such that `b ≤ a • c`. -/
  ceilDiv : β → α → β
  /-- Do not use this. Use `gc_smul_ceilDiv` or `gc_mul_ceilDiv` instead. -/
  protected ceilDiv_gc ⦃a⦄ : 0 < a → GaloisConnection (ceilDiv · a) (a • ·)
  /-- Do not use this. Use `ceilDiv_nonpos` instead. -/
  protected ceilDiv_nonpos ⦃a⦄ : a ≤ 0 → ∀ b, ceilDiv b a = 0
  /-- Do not use this. Use `zero_ceilDiv` instead. -/
  protected zero_ceilDiv (a) : ceilDiv 0 a = 0

{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMulZeroClass α β]
[self : CeilDiv α β]
(a : α)


theorem nhds_atTop [Preorder α] : 𝓝 atTop = ⨅ x : α, 𝓟 (Iic (𝓟 (Ici x)))

𝓝 Filter.atTop = ⨅ x, 𝓟 (Set.Iic (𝓟 (Set.Ici x)))


@[simp]
theorem inclusionMapIso_hom (x : X) : (inclusionMapIso f x).hom = 𝟙 _

(TopologicalSpace.OpenNhds.inclusionMapIso f x).hom =
  𝟙 (TopologicalSpace.OpenNhds.inclusion (f x) ⋙ TopologicalSpace.Opens.map f)


theorem isConnected_setOf_sSameSide {s : AffineSubspace ℝ P} {x : P} (hx : x ∉ s)
    (h : (s : Set P).Nonempty) : IsConnected { y | s.SSameSide x y }

{V : Type u_2}
{P : Type u_4}
[SeminormedAddCommGroup V]
[NormedSpace ℝ V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
{x : P}
(hx : x ∉ s)
(h : (↑s).Nonempty)


theorem natDegree_natCast_le (n : ℕ) : natDegree (n : R[X]) ≤ 0


/-- A mono factorisation of `g ≫ f`, where `g` is an isomorphism,
gives a mono factorisation of `f`. -/
@[simps]
def ofIsoComp {X' : C} (g : X' ⟶ X) [IsIso g] (F : MonoFactorisation (g ≫ f)) :
    MonoFactorisation f

(F : CategoryTheory.Limits.MonoFactorisation (g ≫ f))

(CategoryTheory.Limits.MonoFactorisation.ofIsoComp g F).m = F.m


protected lemma _root_.sInfHom.continuous (f : sInfHom α β) : Continuous f

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
[CompleteLattice β]
[TopologicalSpace α]
[Topology.IsLower α]
[TopologicalSpace β]
[Topology.IsLower β]
(f : sInfHom α β)


/-- The submonoid of pointwise inverse of `S` is `MulEquiv` to `S`. -/
@[to_additive (attr := simps apply) "The additive submonoid of pointwise additive inverse of `S` is
`AddEquiv` to `S`."]
noncomputable def leftInvEquiv : S.leftInv ≃* S

{M : Type u_1}
[AddCommMonoid M]
(S : AddSubmonoid M)
(hS : S ≤ IsAddUnit.addSubmonoid M)

∀ (a : ↥S.leftNeg), (S.leftNegEquiv hS) a = (↑S.fromCommLeftNeg).toFun a


protected theorem IsChain.insert (hs : IsChain r s) (ha : ∀ b ∈ s, a ≠ b → a ≺ b ∨ b ≺ a) :
    IsChain r (insert a s)

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{a : α}
(hs : IsChain r s)
(ha : ∀ b ∈ s, a ≠ b → r a b ∨ r b a)


/-- The additive inverse of one multiplied by an element of a ring is the element's additive
  inverse. -/
theorem neg_one_mul (a : α) : -1 * a = -a

{α : Type u}
[MulOneClass α]
[HasDistribNeg α]
(a : α)


theorem restrict_trim (hle : m ≤ n) {i : Set α} (hi : MeasurableSet[m] i) :
    @VectorMeasure.restrict α m M _ _ (v.trim hle) i = (v.restrict i).trim hle

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_4}
[AddCommMonoid M]
[TopologicalSpace M]
{n : MeasurableSpace α}
{v : MeasureTheory.VectorMeasure α M}
(hle : m ≤ n)
{i : Set α}
(hi : MeasurableSet i)

(v.trim hle).restrict i = (v.restrict i).trim hle


theorem split_of_valid (s p) : split s p = (List.splitOnP p s.1).map mk

s.split p = List.map String.mk (List.splitOnP p s.data)


theorem neg_insertRight_neg (x x' : PGame.{u}) : (-x).insertRight (-x') = -x.insertLeft x'


@[simp]
theorem teichmuller_zero : teichmuller p (0 : R) = 0

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


/-- this lemma establishes that if `ContinuousLinearMap.mul 𝕜 A` is injective, then so is
`Unitization.splitMul 𝕜 A`. When `A` is a `RegularNormedAlgebra`, then
`ContinuousLinearMap.mul 𝕜 A` is an isometry, and is therefore automatically injective. -/
theorem splitMul_injective_of_clm_mul_injective
    (h : Function.Injective (mul 𝕜 A)) :
    Function.Injective (splitMul 𝕜 A)

(h : Function.Injective ⇑(ContinuousLinearMap.mul 𝕜 A))

Function.Injective ⇑(Unitization.splitMul 𝕜 A)


theorem dart_edge_eq_iff : ∀ d₁ d₂ : G.Dart, d₁.edge = d₂.edge ↔ d₁ = d₂ ∨ d₁ = d₂.symm

{V : Type u_1}
{G : SimpleGraph V}
(d₁ d₂ : G.Dart)


/-- A normal monomorphism is a morphism which is the kernel of some morphism. -/
class NormalMono (f : X ⟶ Y) where
  Z : C -- Porting note: violates naming convention but can't think of a better one
  g : Y ⟶ Z
  w : f ≫ g = 0
  isLimit : IsLimit (KernelFork.ofι f w)

CategoryTheory.CategoryStruct.comp f CategoryTheory.NormalMono.g = 0


@[simp]
theorem lift_single (F : G →* A) (a b) : lift k G A F (single a b) = b • F a

{k : Type u₁}
{G : Type u₂}
[CommSemiring k]
[Monoid G]
{A : Type u₃}
[Semiring A]
[Algebra k A]
(F : G →* A)
(a : G)
(b : k)

((MonoidAlgebra.lift k G A) F) (MonoidAlgebra.single a b) = b • F a


@[simp]
protected lemma «forall» {p : Multiplicative α → Prop} : (∀ a, p a) ↔ ∀ a, p (ofAdd a)

{α : Type u}
{p : Multiplicative α → Prop}

(∀ (a : Multiplicative α), p a) ↔ ∀ (a : α), p (Multiplicative.ofAdd a)


theorem upperBounds_Ioc (h : a < b) : upperBounds (Ioc a b) = Ici b

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


theorem isIntegral_algHom_iff {x : A} : IsIntegral R (f x) ↔ IsIntegral R x

{R : Type u_1}
[CommRing R]
{A : Type u_5}
{B : Type u_6}
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(hf : Function.Injective ⇑f)
{x : A}


@[to_additive (attr := simp) sub_self]
theorem div_self' (a : G) : a / a = 1


theorem mem_pi_of_mem (i : ι) {s : Set (α i)} (hs : s ∈ f i) : eval i ⁻¹' s ∈ pi f

{ι : Type u_1}
{α : ι → Type u_2}
{f : (i : ι) → Filter (α i)}
(i : ι)
{s : Set (α i)}
(hs : s ∈ f i)


theorem isClosed_range (coercive : IsCoercive B) : IsClosed (range B♯ : Set V)

{V : Type u}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[CompleteSpace V]
{B : V →L[ℝ] V →L[ℝ] ℝ}
(coercive : IsCoercive B)

IsClosed ↑(LinearMap.range (InnerProductSpace.continuousLinearMapOfBilin B))


theorem IsBigO.bound : f =O[l] g → ∃ c : ℝ, ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖

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

f =O[l] g → ∃ c, ∀ᶠ (x : α) in l, ‖f x‖ ≤ c * ‖g x‖


/-- In a preconnected space, any disjoint family of non-empty clopen subsets has at most one
element. -/
lemma subsingleton_of_disjoint_isClopen
    (h_clopen : ∀ i, IsClopen (s i)) :
    Subsingleton ι

(h_nonempty : ∀ (i : ι), (s i).Nonempty)


theorem abs_ediv_le_abs : ∀ a b : ℤ, |a / b| ≤ |a|


@[to_additive (attr := simp)]
theorem empty_smul : (∅ : Set α) • t = ∅

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


/-- The sum over the reciprocals of the primes diverges. -/
theorem Nat.Primes.not_summable_one_div : ¬ Summable (fun p : Nat.Primes ↦ (1 / p : ℝ))


@[simp]
theorem vecMul_zero [Fintype m] (v : m → α) : v ᵥ* (0 : Matrix m n α) = 0

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocSemiring α]
[Fintype m]
(v : m → α)


theorem nonunits_add {a b : R} (ha : a ∈ nonunits R) (hb : b ∈ nonunits R) : a + b ∈ nonunits R

{R : Type u_1}
[CommSemiring R]
[LocalRing R]
{a b : R}
(ha : a ∈ nonunits R)
(hb : b ∈ nonunits R)


theorem rpow_lt_rpow_iff {x y : ℝ≥0} {z : ℝ} (hz : 0 < z) : x ^ z < y ^ z ↔ x < y


theorem zero_mem_cantorSet : 0 ∈ cantorSet


protected theorem quotientMap (h : X ≃ₜ Y) : QuotientMap h

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


@[to_additive (attr := simp)]
theorem inv_le_self : f⁻¹ ≤ f ↔ f⁻¹ = f

{α : Type u_2}
[InvolutiveNeg α]
{f : Filter α}


@[simp]
theorem iSup_iSup_eq_right {b : β} {f : ∀ x : β, b = x → α} : ⨆ x, ⨆ h : b = x, f x h = f b rfl

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{b : β}
{f : (x : β) → b = x → α}


/-- Given two elements `b`, `c` of a `CancelMonoidWithZero` and a nonzero element `a`,
 `a*b` divides `a*c` iff `b` divides `c`. -/
theorem mul_dvd_mul_iff_left [CancelMonoidWithZero α] {a b c : α} (ha : a ≠ 0) :
    a * b ∣ a * c ↔ b ∣ c

{α : Type u_1}
[CancelMonoidWithZero α]
{a b c : α}
(ha : a ≠ 0)


theorem support_zipWith [D : DecidableEq α] {f : M → N → P} {hf : f 0 0 = 0} {g₁ : α →₀ M}
    {g₂ : α →₀ N} : (zipWith f hf g₁ g₂).support ⊆ g₁.support ∪ g₂.support

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
{P : Type u_8}
[Zero M]
[Zero N]
[Zero P]
[D : DecidableEq α]
{f : M → N → P}
{hf : f 0 0 = 0}
{g₁ : α →₀ M}
{g₂ : α →₀ N}

(Finsupp.zipWith f hf g₁ g₂).support ⊆ g₁.support ∪ g₂.support


@[to_additive]
theorem map_le_iff_le_comap {f : F} {S : Submonoid M} {T : Submonoid N} :
    S.map f ≤ T ↔ S ≤ T.comap f

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{f : F}
{S : Submonoid M}
{T : Submonoid N}

Submonoid.map f S ≤ T ↔ S ≤ Submonoid.comap f T


/-- The canonical function `X → FreeAlgebra R X`.
-/
irreducible_def ι : X → FreeAlgebra R X

(R : Type u_3)
[CommSemiring R]
{X : Type u_4}
(m : X)

FreeAlgebra.ι R m = Quot.mk (FreeAlgebra.Rel R X) (FreeAlgebra.Pre.of m)


@[to_additive (attr := simp)]
theorem recOn_of_mul {C : FreeMonoid α → Sort*} (x : α) (xs : FreeMonoid α) (h0 : C 1)
    (ih : ∀ x xs, C xs → C (of x * xs)) : @recOn α C (of x * xs) h0 ih = ih x xs (recOn xs h0 ih)

(ih : (x : α) → (xs : FreeMonoid α) → C xs → C (FreeMonoid.of x * xs))

(FreeMonoid.of x * xs).recOn h0 ih = ih x xs (xs.recOn h0 ih)


private theorem Sum.mem_uniformity (s : Set ((X ⊕ Y) × (X ⊕ Y))) :
    s ∈ 𝓤 (X ⊕ Y) ↔ ∃ ε > 0, ∀ a b, Sum.dist a b < ε → (a, b) ∈ s

{X : Type u}
{Y : Type v}
[MetricSpace X]
[MetricSpace Y]
(s : Set ((X ⊕ Y) × (X ⊕ Y)))

s ∈ 𝓤 (X ⊕ Y) ↔ ∃ ε > 0, ∀ (a b : X ⊕ Y), Metric.Sum.dist a b < ε → (a, b) ∈ s


theorem toFunLinear_one_tmul_one :
    toFunLinear R A (1 ⊗ₜ[R] 1) = 1

(R : Type u_1)
(A : Type u_2)
[CommSemiring R]
[Semiring A]
[Algebra R A]

(PolyEquivTensor.toFunLinear R A) (1 ⊗ₜ[R] 1) = 1


theorem lintegral_dirac' (a : α) {f : α → ℝ≥0∞} (hf : Measurable f) : ∫⁻ a, f a ∂dirac a = f a

{α : Type u_1}
[MeasurableSpace α]
(a : α)
{f : α → ℝ≥0∞}
(hf : Measurable f)

∫⁻ (a : α), f a ∂MeasureTheory.Measure.dirac a = f a


theorem finset_sup_apply_lt {p : ι → Seminorm 𝕜 E} {s : Finset ι} {x : E} {a : ℝ} (ha : 0 < a)
    (h : ∀ i, i ∈ s → p i x < a) : s.sup p x < a

{𝕜 : Type u_3}
{E : Type u_7}
{ι : Type u_12}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : ι → Seminorm 𝕜 E}
{s : Finset ι}
{x : E}
{a : ℝ}
(ha : 0 < a)
(h : ∀ i ∈ s, (p i) x < a)


protected theorem hasDerivAt_aeval (x : 𝕜) :
    HasDerivAt (fun x => aeval x q) (aeval x (derivative q)) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{R : Type u_1}
[CommSemiring R]
[Algebra R 𝕜]
(q : R[X])
(x : 𝕜)

HasDerivAt (fun x => (Polynomial.aeval x) q) ((Polynomial.aeval x) (Polynomial.derivative q)) x


theorem scaleRoots_aeval_eq_zero_of_aeval_div_eq_zero [Algebra R K]
    (inj : Function.Injective (algebraMap R K)) {p : R[X]} {r s : R}
    (hr : aeval (algebraMap R K r / algebraMap R K s) p = 0) (hs : s ∈ nonZeroDivisors R) :
    aeval (algebraMap R K r) (scaleRoots p s) = 0

(inj : Function.Injective ⇑(algebraMap R K))

(hr : (Polynomial.aeval ((algebraMap R K) r / (algebraMap R K) s)) p = 0)

(Polynomial.aeval ((algebraMap R K) r)) (p.scaleRoots s) = 0


@[simp]
lemma support_nonempty {p : MvPolynomial σ R} : p.support.Nonempty ↔ p ≠ 0

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


/-- Group homomorphisms preserve integer power. -/
@[to_additive "Additive group homomorphisms preserve integer scaling."]
protected theorem map_zpow [Group α] [DivisionMonoid β] (f : α →* β) (g : α) (n : ℤ) :
    f (g ^ n) = f g ^ n

{α : Type u_2}
{β : Type u_3}
[Group α]
[DivisionMonoid β]
(f : α →* β)
(g : α)
(n : ℤ)


@[simp]
theorem range_exp : Set.range exp = {0}ᶜ


@[to_additive (attr := simp)]
lemma monovaryOn_inv_left : MonovaryOn f⁻¹ g s ↔ AntivaryOn f g s

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


theorem ground_finite (M : Matroid α) [M.Finite] : M.E.Finite

{α : Type u_1}
(M : Matroid α)
[M.Finite]


@[simp]
theorem pathEquivList_symm_nil : pathEquivList.symm ([] : List α) = Path.nil

Quiver.SingleObj.pathEquivList.symm [] = Quiver.Path.nil


/--
Given a `HomotopyRel f₀ f₁ S`, we can define a `HomotopyRel f₁ f₀ S` by reversing the homotopy.
-/
@[simps!]
def symm (F : HomotopyRel f₀ f₁ S) : HomotopyRel f₁ f₀ S

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}
{S : Set X}
(F : f₀.HomotopyRel f₁ S)
(x : ↑I × X)


@[to_additive (attr := mono)]
theorem tprod_strict_mono (hf : Multipliable f) (hg : Multipliable g) (h : f < g) :
    ∏' n, f n < ∏' n, g n

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
[OrderClosedTopology α]
{f g : ι → α}
(hf : Summable f)
(hg : Summable g)
(h : f < g)


@[simp]
theorem piCongr'_symm_apply_symm_apply (f : ∀ b, Z b) (b : β) :
    (h₁.piCongr' h₂).symm f (h₁.symm b) = (h₂ b).symm (f b)

{α : Sort u_1}
{β : Sort u_2}
{W : α → Sort w}
{Z : β → Sort z}
(h₁ : α ≃ β)
(h₂ : (b : β) → W (h₁.symm b) ≃ Z b)
(f : (b : β) → Z b)
(b : β)


theorem closedEmbedding_inr : ClosedEmbedding (inr : Y → X ⊕ Y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


theorem surjective_projRestricts (h : ∀ i, J i → K i) : Function.Surjective (ProjRestricts C h)

{I : Type u}
(C : Set (I → Bool))
{J K : I → Prop}
[(i : I) → Decidable (J i)]
[(i : I) → Decidable (K i)]
(h : ∀ (i : I), J i → K i)

Function.Surjective (Profinite.NobelingProof.ProjRestricts C h)


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

{R : Type u}
[Ring R]
{S : Set (Subring R)}
{x : R}


/-- `Under.pushout f` is left adjoint to `Under.map f`. -/
@[simps! unit_app counit_app]
def mapPushoutAdj {X Y : C} (f : X ⟶ Y) : pushout f ⊣ map f

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

∀ (X_1 : CategoryTheory.Under X),
  (CategoryTheory.Under.mapPushoutAdj f).unit.app X_1 =
    CategoryTheory.Under.homMk (CategoryTheory.Limits.pushout.inl X_1.hom f) ⋯


@[simp, norm_cast]
theorem coe_indicator {α} (s : Set α) (f : α → ℝ≥0) (a : α) :
    ((s.indicator f a : ℝ≥0) : ℝ) = s.indicator (fun x => ↑(f x)) a

{α : Type u_1}
(s : Set α)
(f : α → ℝ≥0)
(a : α)

↑(s.indicator f a) = s.indicator (fun x => ↑(f x)) a


theorem finset_card_neighborSet_eq_degree {G' : Subgraph G} {v : V} [Fintype (G'.neighborSet v)] :
    (G'.neighborSet v).toFinset.card = G'.degree v

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


theorem Int.Prime.dvd_pow {n : ℤ} {k p : ℕ} (hp : Nat.Prime p) (h : (p : ℤ) ∣ n ^ k) :
    p ∣ n.natAbs

{n : ℤ}
{k p : ℕ}
(hp : Nat.Prime p)
(h : ↑p ∣ n ^ k)


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


@[simp]
theorem one_right : (1 : N ⋊[φ] G).right = 1

{N : Type u_1}
{G : Type u_2}
[Group N]
[Group G]
{φ : G →* MulAut N}


@[simp]
theorem associator_hom_f (X Y Z : Center C) : Hom.f (α_ X Y Z).hom = (α_ X.1 Y.1 Z.1).hom

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

(α_ X Y Z).hom.f = (α_ X.fst Y.fst Z.fst).hom


theorem isClosed_C' : IsClosed (C' C ho)

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

IsClosed (Profinite.NobelingProof.C' C ho)


/-- Technical lemma to control the addition of functions in `L^p` even for `p < 1`: Given `δ > 0`,
there exists `η` such that two functions bounded by `η` in `L^p` have a sum bounded by `δ`. One
could take `η = δ / 2` for `p ≥ 1`, but the point of the lemma is that it works also for `p < 1`.
-/
theorem exists_Lp_half (p : ℝ≥0∞) {δ : ℝ≥0∞} (hδ : δ ≠ 0) :
    ∃ η : ℝ≥0∞,
      0 < η ∧
        ∀ (f g : α → E), AEStronglyMeasurable f μ → AEStronglyMeasurable g μ →
          eLpNorm f p μ ≤ η → eLpNorm g p μ ≤ η → eLpNorm (f + g) p μ < δ

{α : Type u_1}
(E : Type u_2)
{m : MeasurableSpace α}
[NormedAddCommGroup E]
(μ : MeasureTheory.Measure α)
(p : ℝ≥0∞)
{δ : ℝ≥0∞}
(hδ : δ ≠ 0)

∃ η,
  0 < η ∧
    ∀ (f g : α → E),
      MeasureTheory.AEStronglyMeasurable f μ →
        MeasureTheory.AEStronglyMeasurable g μ →
          MeasureTheory.eLpNorm f p μ ≤ η → MeasureTheory.eLpNorm g p μ ≤ η → MeasureTheory.eLpNorm (f + g) p μ < δ


theorem all_iff_forall {P : α → Prop} : ∀ {t}, All P t ↔ ∀ x, Emem x t → P x

{α : Type u_1}
{P : α → Prop}
{t : Ordnode α}

Ordnode.All P t ↔ ∀ (x : α), Ordnode.Emem x t → P x


theorem splittingOfFinsuppSurjective_injective (f : M →ₗ[R] α →₀ R) (s : Surjective f) :
    Injective (splittingOfFinsuppSurjective f s)

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_4}
(f : M →ₗ[R] α →₀ R)
(s : Function.Surjective ⇑f)


lemma eigenvalues_self_mul_conjTranspose_nonneg (A : Matrix m n 𝕜) [DecidableEq m] (i : m) :
    0 ≤ (isHermitian_mul_conjTranspose_self A).eigenvalues i

{m : Type u_1}
{n : Type u_2}
{𝕜 : Type u_4}
[Fintype m]
[Fintype n]
[RCLike 𝕜]
(A : Matrix m n 𝕜)
[DecidableEq m]
(i : m)


theorem X_pow_mul {n : ℕ} : X ^ n * p = p * X ^ n

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

Polynomial.X ^ n * p = p * Polynomial.X ^ n


protected lemma MulActionWithZero.nontrivial
    [MulActionWithZero R M] [Nontrivial M] : Nontrivial R

(R : Type u_1)
(M : Type u_3)
[MonoidWithZero R]
[Zero M]
[MulActionWithZero R M]
[Nontrivial M]


@[simp] theorem run_map {α β σ : Type u} [Monad m] [LawfulMonad m] (f : α → β) (x : StateT σ m α) (s : σ) : (f <$> x).run s = (fun (p : α × σ) => (f p.1, p.2)) <$> x.run s

{m : Type u → Type u_1}
{α β σ : Type u}
[Monad m]
[LawfulMonad m]
(f : α → β)
(x : StateT σ m α)
(s : σ)

(f <$> x).run s = (fun p => (f p.fst, p.snd)) <$> x.run s


/-- The natural embedding `α ⧸ (⨅ i, f i) ↪ Π i, α ⧸ f i`. -/
@[to_additive (attr := simps) "The natural embedding `α ⧸ (⨅ i, f i) ↪ Π i, α ⧸ f i`."]
def quotientiInfEmbedding {ι : Type*} (f : ι → Subgroup α) : (α ⧸ ⨅ i, f i) ↪ ∀ i, α ⧸ f i

{α : Type u_1}
[Group α]
{ι : Type u_2}
(f : ι → Subgroup α)
(q : α ⧸ ⨅ i, f i)
(i : ι)

(Subgroup.quotientiInfEmbedding f) q i = Subgroup.quotientMapOfLE ⋯ q


@[to_additive]
theorem mk'_spec (x) (y : S) : f.mk' x y * f.toMap y = f.toMap x

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


@[simp]
theorem blimsup_or_eq_sup : (blimsup u f fun x => p x ∨ q x) = blimsup u f p ⊔ blimsup u f q

{α : Type u_1}
{β : Type u_2}
[CompleteDistribLattice α]
{f : Filter β}
{p q : β → Prop}
{u : β → α}

(Filter.blimsup u f fun x => p x ∨ q x) = Filter.blimsup u f p ⊔ Filter.blimsup u f q


protected lemma Antitone.sInf (hs : ∀ f ∈ s, Antitone f) : Antitone (sInf s)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[CompleteLattice β]
{s : Set (α → β)}
(hs : ∀ f ∈ s, Antitone f)


@[simp]
theorem countable_preimage_exp {s : Set ℂ} : (exp ⁻¹' s).Countable ↔ s.Countable

(Complex.exp ⁻¹' s).Countable ↔ s.Countable


theorem id_mem_of_src {c d : C} {f : c ⟶ d} (h : f ∈ S.arrows c d) : 𝟙 c ∈ S.arrows c c

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)
{c d : C}
{f : c ⟶ d}
(h : f ∈ S.arrows c d)

CategoryTheory.CategoryStruct.id c ∈ S.arrows c c


@[simp] theorem bind_nil (f : α → List β) : List.bind [] f = []

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


theorem lowerCentralSeriesLast_le_max_triv :
    lowerCentralSeriesLast R L M ≤ maxTrivSubmodule R L M

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

LieModule.lowerCentralSeriesLast R L M ≤ LieModule.maxTrivSubmodule R L M


lemma predAbove_castPred_self (p : Fin (n + 1)) (hp : p ≠ last n) :
    (castPred p hp).predAbove p = castPred p hp

{n : ℕ}
(p : Fin (n + 1))
(hp : p ≠ Fin.last n)

(p.castPred hp).predAbove p = p.castPred hp


@[simp]
theorem LinearMap.toMatrix'_one : LinearMap.toMatrix' (1 : (n → R) →ₗ[R] n → R) = 1

{R : Type u_1}
[CommSemiring R]
{n : Type u_5}
[DecidableEq n]
[Fintype n]


@[to_additive] theorem quotientMap_mk : QuotientMap (@mk M)


theorem iInter_Iic_eq_empty_iff : ⋂ i, Iic (f i) = ∅ ↔ ¬ BddBelow (range f)

{ι : Sort u}
{α : Type v}
[LinearOrder α]
{f : ι → α}

⋂ i, Set.Iic (f i) = ∅ ↔ ¬BddBelow (Set.range f)


theorem upperClosure_min (h : s ⊆ t) (ht : IsUpperSet t) : ↑(upperClosure s) ⊆ t

{α : Type u_1}
[Preorder α]
{s t : Set α}
(h : s ⊆ t)
(ht : IsUpperSet t)


/-- Induction principle used for proving facts about Chebyshev polynomials. -/
@[elab_as_elim]
protected theorem induct (motive : ℤ → Prop)
    (zero : motive 0)
    (one : motive 1)
    (add_two : ∀ (n : ℕ), motive (↑n + 1) → motive ↑n → motive (↑n + 2))
    (neg_add_one : ∀ (n : ℕ), motive (-↑n) → motive (-↑n + 1) → motive (-↑n - 1)) :
    ∀ (a : ℤ), motive a


lemma div_le_comm₀ (hb : 0 < b) (hc : 0 < c) : a / b ≤ c ↔ a / c ≤ b

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


/-- The forget functor `SheafOfModules R ⥤ Sheaf J AddCommGrp`. -/
@[simps]
def toSheaf : SheafOfModules.{v} R ⥤ Sheaf J AddCommGrp.{v}

{J : CategoryTheory.GrothendieckTopology C}

((SheafOfModules.toSheaf R).obj M).val = M.val.presheaf


/-- Class for bundled homs. Note that the arguments order follows that of lemmas for `MonoidHom`.
This way we can use `⟨@MonoidHom.toFun, @MonoidHom.id ...⟩` in an instance. -/
structure BundledHom where
  /-- the underlying map of a bundled morphism -/
  toFun : ∀ {α β : Type u} (Iα : c α) (Iβ : c β), hom Iα Iβ → α → β
  /-- the identity as a bundled morphism -/
  id : ∀ {α : Type u} (I : c α), hom I I
  /-- composition of bundled morphisms -/
  comp : ∀ {α β γ : Type u} (Iα : c α) (Iβ : c β) (Iγ : c γ), hom Iβ Iγ → hom Iα Iβ → hom Iα Iγ
  /-- a bundled morphism is determined by the underlying map -/
  hom_ext : ∀ {α β : Type u} (Iα : c α) (Iβ : c β), Function.Injective (toFun Iα Iβ) := by
   aesop_cat
  /-- compatibility with identities -/
  id_toFun : ∀ {α : Type u} (I : c α), toFun I I (id I) = _root_.id := by aesop_cat
  /-- compatibility with the composition -/
  comp_toFun :
    ∀ {α β γ : Type u} (Iα : c α) (Iβ : c β) (Iγ : c γ) (f : hom Iα Iβ) (g : hom Iβ Iγ),
      toFun Iα Iγ (comp Iα Iβ Iγ g f) = toFun Iβ Iγ g ∘ toFun Iα Iβ f := by
   aesop_cat

{hom : ⦃α β : Type u⦄ → c α → c β → Type u}


theorem top_prod : (⊤ : Filter α) ×ˢ g = g.comap Prod.snd

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


@[simp]
theorem cancel_left {g f₁ f₂ : CentroidHom α} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
{g f₁ f₂ : CentroidHom α}
(hg : Function.Injective ⇑g)


lemma Equiv.biSup_comp {ι ι' : Type*} {g : ι' → α} (e : ι ≃ ι') (s : Set ι') :
    ⨆ i ∈ e.symm '' s, g (e i) = ⨆ i ∈ s, g i

{α : Type u_1}
[CompleteLattice α]
{ι : Type u_9}
{ι' : Type u_10}
{g : ι' → α}
(e : ι ≃ ι')
(s : Set ι')

⨆ i ∈ ⇑e.symm '' s, g (e i) = ⨆ i ∈ s, g i


theorem minFac_pos (n : ℕ) : 0 < minFac n


@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem Measurable.smul [MeasurableSMul₂ M β] (hf : Measurable f) (hg : Measurable g) :
    Measurable fun x => f x • g x

{M : Type u_2}
{β : Type u_3}
{α : Type u_4}
[MeasurableSpace M]
[MeasurableSpace β]
[SMul M β]
{m : MeasurableSpace α}
{f : α → M}
{g : α → β}
[MeasurableSMul₂ M β]
(hf : Measurable f)
(hg : Measurable g)


/-- If the sign of the angle between two vectors is nonzero, the vectors are not equal. -/
theorem ne_of_oangle_sign_ne_zero {x y : V} (h : (o.oangle x y).sign ≠ 0) : x ≠ y

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


theorem le_limsSup_of_le {f : Filter α} {a}
    (hf : f.IsBounded (· ≤ ·) := by isBoundedDefault)
    (h : ∀ b, (∀ᶠ n in f, n ≤ b) → a ≤ b) : a ≤ limsSup f

(hf : Filter.IsBounded (fun x x_1 => x ≤ x_1) f := by isBoundedDefault)

(h : ∀ (b : α), (∀ᶠ (n : α) in f, n ≤ b) → a ≤ b)


theorem LiftRelO.imp {R S : α → β → Prop} {C D : WSeq α → WSeq β → Prop} (H1 : ∀ a b, R a b → S a b)
    (H2 : ∀ s t, C s t → D s t) : ∀ {o p}, LiftRelO R C o p → LiftRelO S D o p

{C D : Stream'.WSeq α → Stream'.WSeq β → Prop}

(H2 : ∀ (s : Stream'.WSeq α) (t : Stream'.WSeq β), C s t → D s t)

Stream'.WSeq.LiftRelO R C o p → Stream'.WSeq.LiftRelO S D o p


/-- If `α ≃ α'` and `β ≃ β'`, then `α ⊕ β ≃ α' ⊕ β'`. This is `Sum.map` as an equivalence. -/
@[simps apply]
def sumCongr (ea : α₁ ≃ α₂) (eb : β₁ ≃ β₂) : α₁ ⊕ β₁ ≃ α₂ ⊕ β₂

{α₁ : Type u_1}
{α₂ : Type u_2}
{β₁ : Type u_3}
{β₂ : Type u_4}
(ea : α₁ ≃ α₂)
(eb : β₁ ≃ β₂)

∀ (a : α₁ ⊕ β₁), (ea.sumCongr eb) a = Sum.map (⇑ea) (⇑eb) a


/-- The rank of a matrix is the rank of the space spanned by its rows.

TODO: prove this in a generality that works for `ℂ` too, not just `ℚ` and `ℝ`. -/
theorem rank_eq_finrank_span_row [LinearOrderedField R] [Finite m] (A : Matrix m n R) :
    A.rank = finrank R (Submodule.span R (Set.range A))

{m : Type u_2}
{n : Type u_3}
{R : Type u_5}
[Fintype n]
[LinearOrderedField R]
[Finite m]
(A : Matrix m n R)

A.rank = FiniteDimensional.finrank R ↥(Submodule.span R (Set.range A))


theorem dif_neg {c : Prop} {h : Decidable c} (hnc : ¬c) {α : Sort u} {t : c → α} {e : ¬ c → α} : (dite c t e) = e hnc

{c : Prop}
{h : Decidable c}
(hnc : ¬c)
{α : Sort u}
{t : c → α}
{e : ¬c → α}


@[to_additive]
theorem FP.finset_prod {M} [CommMonoid M] (a : Stream' M) (s : Finset ℕ) (hs : s.Nonempty) :
    (s.prod fun i => a.get i) ∈ FP a

{M : Type u_1}
[AddCommMonoid M]
(a : Stream' M)
(s : Finset ℕ)
(hs : s.Nonempty)


lemma mem_limsup_iff_frequently_mem : (a ∈ limsup s 𝓕) ↔ (∃ᶠ i in 𝓕, a ∈ s i)

{α : Type u_1}
{ι : Type u_4}
{s : ι → Set α}
{𝓕 : Filter ι}
{a : α}

a ∈ Filter.limsup s 𝓕 ↔ ∃ᶠ (i : ι) in 𝓕, a ∈ s i


theorem HasBasis.eventuallyConst_iff' {ι : Sort*} {p : ι → Prop} {s : ι → Set α}
    {x : ι → α} (h : l.HasBasis p s) (hx : ∀ i, p i → x i ∈ s i) :
    EventuallyConst f l ↔ ∃ i, p i ∧ ∀ y ∈ s i, f y = f (x i)

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{f : α → β}
{ι : Sort u_5}
{p : ι → Prop}
{s : ι → Set α}
{x : ι → α}
(h : l.HasBasis p s)
(hx : ∀ (i : ι), p i → x i ∈ s i)

Filter.EventuallyConst f l ↔ ∃ i, p i ∧ ∀ y ∈ s i, f y = f (x i)


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

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

∀ {X Y : CategoryTheory.LaxMonoidalFunctor (CategoryTheory.Discrete PUnit.{u + 1}) C} (α : X ⟶ Y),
  (Mon_.EquivLaxMonoidalFunctorPUnit.laxMonoidalToMon C).map α =
    ((CategoryTheory.LaxMonoidalFunctor.mapMonFunctor (CategoryTheory.Discrete PUnit.{u + 1}) C).map α).app
      (Mon_.trivial (CategoryTheory.Discrete PUnit.{u + 1}))


@[simp]
theorem Ico_inter_Ici (a b c : α) : Ico a b ∩ Ici c = Ico (a ⊔ c) b

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

Set.Ico a b ∩ Set.Ici c = Set.Ico (a ⊔ c) b


theorem conj_cong_is_cong (g : ConjAct SL(2, ℤ)) (Γ : Subgroup SL(2, ℤ))
    (h : IsCongruenceSubgroup Γ) : IsCongruenceSubgroup (g • Γ)

(h : CongruenceSubgroup.IsCongruenceSubgroup Γ)

CongruenceSubgroup.IsCongruenceSubgroup (g • Γ)


theorem dist_conj_self (z : ℂ) : dist (conj z) z = 2 * |z.im|


@[simp]
theorem run_monadLift {n} [MonadLiftT n m] (x : n α) :
    (monadLift x : OptionT m α).run = (monadLift x : m α) >>= fun a => pure (some a)

{α : Type u}
{m : Type u → Type v}
[Monad m]
{n : Type u → Type u_1}
[MonadLiftT n m]
(x : n α)

(monadLift x).run = do
  let a ← monadLift x
  pure (some a)


lemma nonUnitalStarAlgebraAdjoin_id_subset_ker_evalStarAlgHom {s : Set 𝕜} (h0 : 0 ∈ s) :
    (adjoin 𝕜 {restrict s (.id 𝕜)} : Set C(s, 𝕜)) ⊆
      RingHom.ker (evalStarAlgHom 𝕜 𝕜 (⟨0, h0⟩ : s))

{𝕜 : Type u_2}
[RCLike 𝕜]
{s : Set 𝕜}
(h0 : 0 ∈ s)

↑(NonUnitalStarAlgebra.adjoin 𝕜 {ContinuousMap.restrict s (ContinuousMap.id 𝕜)}) ⊆
  ↑(RingHom.ker (ContinuousMap.evalStarAlgHom 𝕜 𝕜 ⟨0, h0⟩))


/-- A module is projective iff it is the direct summand of a free module. -/
theorem Projective.iff_split : Module.Projective R P ↔
    ∃ (M : Type max u v) (_ : AddCommGroup M) (_ : Module R M) (_ : Module.Free R M)
      (i : P →ₗ[R] M) (s : M →ₗ[R] P), s.comp i = LinearMap.id

{R : Type u}
[Ring R]
{P : Type v}
[AddCommGroup P]
[Module R P]

Module.Projective R P ↔ ∃ M x x_1, ∃ (_ : Module.Free R M), ∃ i s, s ∘ₗ i = LinearMap.id


theorem nhdsWithin_basis_eball : (𝓝[s] x).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) fun ε => ball x ε ∩ s

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{s : Set α}

(𝓝[s] x).HasBasis (fun ε => 0 < ε) fun ε => EMetric.ball x ε ∩ s


@[simp]
theorem rotate_eq_nil_iff {l : List α} {n : ℕ} : l.rotate n = [] ↔ l = []


@[simp]
theorem cancel_left {g : LatticeHom β γ} {f₁ f₂ : LatticeHom α β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Lattice α]
[Lattice β]
[Lattice γ]
{g : LatticeHom β γ}
{f₁ f₂ : LatticeHom α β}
(hg : Function.Injective ⇑g)


@[simp]
theorem coe_refl : ⇑(refl R E) = id

{R : Type u_1}
{E : Type u_5}
[Semiring R]
[SeminormedAddCommGroup E]
[Module R E]


@[to_additive]
theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x = 1) :
    ∏ x ∈ s₁, f x = ∏ x ∈ s₂, f x

{α : Type u_3}
{β : Type u_4}
{s₁ s₂ : Finset α}
{f : α → β}
[CommMonoid β]
(h : s₁ ⊆ s₂)
(hf : ∀ x ∈ s₂, x ∉ s₁ → f x = 1)


@[to_additive]
theorem Finite.inv (hs : s.Finite) : s⁻¹.Finite

{α : Type u_2}
[InvolutiveInv α]
{s : Set α}
(hs : s.Finite)


/-- An epimorphism is surjective. -/
theorem range_eq_top_of_cancel {f : M →ₛₗ[τ₁₂] M₂}
    (h : ∀ u v : M₂ →ₗ[R₂] M₂ ⧸ (range f), u.comp f = v.comp f → u = v) : range f = ⊤

(h : ∀ (u v : M₂ →ₗ[R₂] M₂ ⧸ LinearMap.range f), u.comp f = v.comp f → u = v)


@[simp] -- Porting note: removing reassoc tag since result is not hygienic (two h's)
theorem coprod.desc_comp {V W X Y : C} [HasBinaryCoproduct X Y] (f : V ⟶ W) (g : X ⟶ V)
    (h : Y ⟶ V) : coprod.desc g h ≫ f = coprod.desc (g ≫ f) (h ≫ f)

CategoryTheory.Limits.coprod.desc g h ≫ f = CategoryTheory.Limits.coprod.desc (g ≫ f) (h ≫ f)


@[simp]
theorem bitCasesOn_bit0 {C : ℕ → Sort u} (H : ∀ b n, C (bit b n)) (n : ℕ) :
    bitCasesOn (2 * n) H = H false n

(H : (b : Bool) → (n : ℕ) → C (Nat.bit b n))


theorem sum_mem (I : Ideal α) {ι : Type*} {t : Finset ι} {f : ι → α} :
    (∀ c ∈ t, f c ∈ I) → (∑ i ∈ t, f i) ∈ I

{α : Type u}
[Semiring α]
(I : Ideal α)
{ι : Type u_1}
{t : Finset ι}
{f : ι → α}


@[simp]
theorem lift_comp_lift : (lift j k p).comp (lift i j p) = lift i k p

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing K]
[CommRing L]
[CommRing M]
[CommRing N]
(i : K →+* L)
(j : K →+* M)
(k : K →+* N)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[ExpChar M p]
[ExpChar N p]
[PerfectRing M p]
[IsPRadical i p]
[PerfectRing N p]
[IsPRadical j p]

(PerfectRing.lift j k p).comp (PerfectRing.lift i j p) = PerfectRing.lift i k p


@[to_additive]
theorem continuousInv_iInf {ts' : ι' → TopologicalSpace G}
    (h' : ∀ i, @ContinuousInv G (ts' i) _) : @ContinuousInv G (⨅ i, ts' i) _

{G : Type w}
{ι' : Sort u_1}
[Inv G]
{ts' : ι' → TopologicalSpace G}
(h' : ∀ (i : ι'), ContinuousInv G)


theorem drop : ∀ {s}, ValidFor l m r s → ∀ n, ValidFor (l ++ m.take n) (m.drop n) r (s.drop n)

Substring.ValidFor l m r s → ∀ (n : Nat), Substring.ValidFor (l ++ List.take n m) (List.drop n m) r (s.drop n)


theorem HasFiniteFPowerSeriesAt.cPolynomialAt (hf : HasFiniteFPowerSeriesAt f p x n) :
    CPolynomialAt 𝕜 f x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{n : ℕ}
(hf : HasFiniteFPowerSeriesAt f p x n)


@[simp] lemma edgeDisjointTriangles_bot : (⊥ : SimpleGraph α).EdgeDisjointTriangles


/-- Constructor for morphisms in `ModuleCat R` which takes as inputs
a morphism between the underlying objects in `AddCommGrp` and the compatibility
with the scalar multiplication. -/
@[simps]
def homMk : M ⟶ N

(φ : (CategoryTheory.forget₂ (ModuleCat R) AddCommGrp).obj M ⟶ (CategoryTheory.forget₂ (ModuleCat R) AddCommGrp).obj N)

(hφ : ∀ (r : R), φ ≫ N.smul r = M.smul r ≫ φ)

(a : ↑((CategoryTheory.forget₂ (ModuleCat R) AddCommGrp).obj M))


protected theorem mul_inv_le_iff {x y z : ℝ≥0∞} (h1 : y ≠ 0) (h2 : y ≠ ∞) :
    x * y⁻¹ ≤ z ↔ x ≤ z * y

{x y z : ENNReal}
(h1 : y ≠ 0)
(h2 : y ≠ ⊤)


nonrec theorem get_eq_iff_eq_some {a : PartENat} {ha : a.Dom} {b : ℕ} : a.get ha = b ↔ a = some b


theorem fin_comap_jointlySurjective
    (hC : IsClosed C)
    (f : LocallyConstant C ℤ) : ∃ (s : Finset I)
    (g : LocallyConstant (π C (· ∈ s)) ℤ), f = g.comap ⟨(ProjRestrict C (· ∈ s)),
      continuous_projRestrict _ _⟩

{I : Type u}
[LinearOrder I]
(C : Set (I → Bool))
(hC : IsClosed C)
(f : LocallyConstant ↑C ℤ)

∃ s g,
  f = LocallyConstant.comap { toFun := Profinite.NobelingProof.ProjRestrict C fun x => x ∈ s, continuous_toFun := ⋯ } g


theorem down_surjective : Surjective (@down α)


/-- Any open cover of the unit interval can be refined to a finite partition into subintervals. -/
lemma exists_monotone_Icc_subset_open_cover_unitInterval {ι} {c : ι → Set I}
    (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : univ ⊆ ⋃ i, c i) : ∃ t : ℕ → I, t 0 = 0 ∧
      Monotone t ∧ (∃ n, ∀ m ≥ n, t m = 1) ∧ ∀ n, ∃ i, Icc (t n) (t (n + 1)) ⊆ c i

{ι : Sort u_1}
{c : ι → Set ↑unitInterval}
(hc₁ : ∀ (i : ι), IsOpen (c i))
(hc₂ : Set.univ ⊆ ⋃ i, c i)

∃ t, t 0 = 0 ∧ Monotone t ∧ (∃ n, ∀ m ≥ n, t m = 1) ∧ ∀ (n : ℕ), ∃ i, Set.Icc (t n) (t (n + 1)) ⊆ c i


theorem ofNat_pow (a b : Nat) : ((a ^ b : Nat) : Int) = (a : Int) ^ b


@[simp]
theorem comp_const (γ : Type*) [Preorder γ] (f : α →o β) (c : α) :
    f.comp (const γ c) = const γ (f c)

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(γ : Type u_6)
[Preorder γ]
(f : α →o β)
(c : α)

f.comp ((OrderHom.const γ) c) = (OrderHom.const γ) (f c)


theorem mfderiv_prod_left {x₀ : M} {y₀ : M'} :
    mfderiv I (I.prod I') (fun x => (x, y₀)) x₀ =
      ContinuousLinearMap.inl 𝕜 (TangentSpace I x₀) (TangentSpace I' y₀)

{𝕜 : 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']
{x₀ : M}
{y₀ : M'}


/-- The associator isomorphism which associates a binary biproduct. -/
@[simps]
def biprod.associator (P Q R : C) : (P ⊞ Q) ⊞ R ≅ P ⊞ (Q ⊞ R)

(CategoryTheory.Limits.biprod.associator P Q R).inv =
  CategoryTheory.Limits.biprod.lift
    (CategoryTheory.Limits.biprod.lift CategoryTheory.Limits.biprod.fst
      (CategoryTheory.Limits.biprod.snd ≫ CategoryTheory.Limits.biprod.fst))
    (CategoryTheory.Limits.biprod.snd ≫ CategoryTheory.Limits.biprod.snd)


theorem pow_add_pow_le (hx : 0 ≤ x) (hy : 0 ≤ y) (hn : n ≠ 0) : x ^ n + y ^ n ≤ (x + y) ^ n

{R : Type u_3}
[OrderedSemiring R]
{x y : R}
{n : ℕ}
(hx : 0 ≤ x)
(hy : 0 ≤ y)
(hn : n ≠ 0)


@[simp, norm_cast]
theorem ofReal_cosh (x : ℝ) : (Real.cosh x : ℂ) = cosh x


theorem toNonUnitalNonAssocRing_injective :
    Function.Injective (@toNonUnitalNonAssocRing R)


@[simp, norm_cast]
theorem coe_snd' : ⇑(snd R A B) = Prod.snd

{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]

⇑(ContinuousAlgHom.snd R A B) = Prod.snd


/-- The oriented angle on an oriented real inner product space of dimension 2 can be evaluated in
terms of a complex-number representation of the space. -/
theorem oangle_map_complex (f : V ≃ₗᵢ[ℝ] ℂ)
    (hf : Orientation.map (Fin 2) f.toLinearEquiv o = Complex.orientation) (x y : V) :
    o.oangle x y = Complex.arg (conj (f x) * f y)

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

(hf : (Orientation.map (Fin 2) f.toLinearEquiv) o = Complex.orientation)

o.oangle x y = ↑((starRingEnd ℂ) (f x) * f y).arg


@[simp]
theorem cells_inf (μ ν : YoungDiagram) : (μ ⊓ ν).cells = μ.cells ∩ ν.cells


@[simp]
theorem liftQSpanSingleton_apply (x : M) (f : M →ₛₗ[τ₁₂] M₂) (h : f x = 0) (y : M) :
    liftQSpanSingleton x f h (Quotient.mk y) = f y

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
{R₂ : Type u_3}
{M₂ : Type u_4}
[Ring R₂]
[AddCommGroup M₂]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
(x : M)
(f : M →ₛₗ[τ₁₂] M₂)
(h : f x = 0)
(y : M)

(Submodule.liftQSpanSingleton x f h) (Submodule.Quotient.mk y) = f y


@[simp]
theorem id_hom (A : CommMon_ C) : Mon_.Hom.hom (𝟙 A) = 𝟙 A.X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(A : CommMon_ C)


@[simp]
theorem mul_add_mul : a * b + b * a = 0

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


theorem linearIndependent_insert (hxs : x ∉ s) :
    (LinearIndependent K fun b : ↥(insert x s) => (b : V)) ↔
      (LinearIndependent K fun b : s => (b : V)) ∧ x ∉ Submodule.span K s

{K : Type u_3}
{V : Type u}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{s : Set V}
{x : V}
(hxs : x ∉ s)

(LinearIndependent K fun (b : ↑(insert x s)) => ↑b) ↔ (LinearIndependent K fun (b : ↑s) => ↑b) ∧ x ∉ Submodule.span K s


@[to_additive]
theorem smul_subset_smul_left : t₁ ⊆ t₂ → s • t₁ ⊆ s • t₂

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

t₁ ⊆ t₂ → s • t₁ ⊆ s • t₂


theorem diam_image [SemilinearIsometryClass 𝓕 σ₁₂ E E₂] (f : 𝓕) (s : Set E) :
    Metric.diam (f '' s) = Metric.diam s

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
{𝓕 : Type u_10}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
[FunLike 𝓕 E E₂]
[SemilinearIsometryClass 𝓕 σ₁₂ E E₂]
(f : 𝓕)
(s : Set E)


theorem nodup_of_pairwise_disjoint {l : List (Perm α)} (h1 : (1 : Perm α) ∉ l)
    (h2 : l.Pairwise Disjoint) : l.Nodup

(h2 : List.Pairwise Equiv.Perm.Disjoint l)


@[simp]
theorem homothety_add (c : P1) (r₁ r₂ : k) :
    homothety c (r₁ + r₂) = r₁ • (id k P1 -ᵥ const k P1 c) +ᵥ homothety c r₂

{k : Type u_2}
{V1 : Type u_3}
{P1 : Type u_4}
[CommRing k]
[AddCommGroup V1]
[AffineSpace V1 P1]
[Module k V1]
(c : P1)
(r₁ r₂ : k)

AffineMap.homothety c (r₁ + r₂) = r₁ • (AffineMap.id k P1 -ᵥ AffineMap.const k P1 c) +ᵥ AffineMap.homothety c r₂


theorem _root_.IsClosed.analyticSet [PolishSpace α] {s : Set α} (hs : IsClosed s) :
    AnalyticSet s

{α : Type u_1}
[TopologicalSpace α]
[PolishSpace α]
{s : Set α}
(hs : IsClosed s)


theorem tsum_smul_const [T2Space M] (hf : Summable f) (a : M) : ∑' z, f z • a = (∑' z, f z) • a

{ι : Type u_5}
{R : Type u_7}
{M : Type u_9}
[Semiring R]
[TopologicalSpace R]
[TopologicalSpace M]
[AddCommMonoid M]
[Module R M]
[ContinuousSMul R M]
{f : ι → R}
[T2Space M]
(hf : Summable f)
(a : M)

∑' (z : ι), f z • a = (∑' (z : ι), f z) • a


lemma IsSheaf.hom_ext_ofArrows
    {P : Cᵒᵖ ⥤ A} (hP : Presheaf.IsSheaf J P) {I : Type*} {S : C} {X : I → C}
    (f : ∀ i, X i ⟶ S) (hf : Sieve.ofArrows _ f ∈ J S) {E : A}
    {x y : E ⟶ P.obj (op S)} (h : ∀ i, x ≫ P.map (f i).op = y ≫ P.map (f i).op) :
    x = y

{J : CategoryTheory.GrothendieckTopology C}

(hP : CategoryTheory.Presheaf.IsSheaf J P)

(hf : CategoryTheory.Sieve.ofArrows X f ∈ J.sieves S)

(h :
  ∀ (i : I),
    CategoryTheory.CategoryStruct.comp x (P.map (f i).op) = CategoryTheory.CategoryStruct.comp y (P.map (f i).op))


theorem sMod_mod (p i : ℕ) : sMod p i % (2 ^ p - 1) = sMod p i

LucasLehmer.sMod p i % (2 ^ p - 1) = LucasLehmer.sMod p i


theorem BddBelow.image2_bddAbove : BddBelow s → BddBelow t → BddAbove (Set.image2 f s t)

{f : α → β → γ}

(h₀ : ∀ (b : β), Antitone (Function.swap f b))


@[simp]
theorem iteratedDeriv_cexp_const_mul (n : ℕ) (c : ℂ) :
    (iteratedDeriv n fun s : ℂ => exp (c * s)) = fun s => c ^ n * exp (c * s)

(iteratedDeriv n fun s => Complex.exp (c * s)) = fun s => c ^ n * Complex.exp (c * s)


theorem arg_mul_cos_add_sin_mul_I {r : ℝ} (hr : 0 < r) {θ : ℝ} (hθ : θ ∈ Set.Ioc (-π) π) :
    arg (r * (cos θ + sin θ * I)) = θ

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


/-- `s ∈ ∂ 𝒜` iff `s` is exactly one element less than something from `𝒜`.

See also `Finset.mem_shadow_iff_exists_sdiff`. -/
lemma mem_shadow_iff_exists_mem_card_add_one :
    t ∈ ∂ 𝒜 ↔ ∃ s ∈ 𝒜, t ⊆ s ∧ s.card = t.card + 1

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

t ∈ 𝒜.shadow ↔ ∃ s ∈ 𝒜, t ⊆ s ∧ s.card = t.card + 1


/-- This is used as the ext lemma instead of `LinearMap.pi_ext` for reasons explained in
note [partially-applied ext lemmas]. -/
@[ext]
theorem pi_ext' (h : ∀ i, f.comp (single i) = g.comp (single i)) : f = g

(h : ∀ (i : ι), f ∘ₗ LinearMap.single i = g ∘ₗ LinearMap.single i)


theorem exists_of_mem_map (h : b ∈ map f l) : ∃ a, a ∈ l ∧ f a = b

∀ {α : Type u_1} {b : α} {α_1 : Type u_2} {f : α_1 → α} {l : List α_1}, b ∈ List.map f l → ∃ a, a ∈ l ∧ f a = b


/-- `UniqueMul` is preserved under embeddings that are multiplicative.

See `UniqueMul.mulHom_image_iff` for a version with swapped bundling. -/
@[to_additive
      "`UniqueAdd` is preserved under embeddings that are additive.

See `UniqueAdd.addHom_image_iff` for a version with swapped bundling."]
theorem mulHom_map_iff (f : G ↪ H) (mul : ∀ x y, f (x * y) = f x * f y) :
    UniqueMul (A.map f) (B.map f) (f a0) (f b0) ↔ UniqueMul A B a0 b0

(mul : ∀ (x y : G), f (x * y) = f x * f y)

UniqueMul (Finset.map f A) (Finset.map f B) (f a0) (f b0) ↔ UniqueMul A B a0 b0


@[simp]
theorem powersetCardAux_cons (n : ℕ) (a : α) (l : List α) :
    powersetCardAux (n + 1) (a :: l) =
      powersetCardAux (n + 1) l ++ List.map (cons a) (powersetCardAux n l)

{α : Type u_1}
(n : ℕ)
(a : α)
(l : List α)

Multiset.powersetCardAux (n + 1) (a :: l) =
  Multiset.powersetCardAux (n + 1) l ++ List.map (Multiset.cons a) (Multiset.powersetCardAux n l)


@[simp, nolint simpNF] -- Porting note: lemma does prove itself, seems to be a linter error
theorem closure_is_closed (x : α) : u (l x) ∈ l.closed

{α : Type u_1}
{β : Type u_4}
[PartialOrder α]
[PartialOrder β]
{u : β → α}
(l : LowerAdjoint u)
(x : α)


/-- This can't be `@[simp]`, because it would cause the more useful
  `Matroid.ofIndepFinset_apply` not to be in simp normal form. -/
theorem ofFinset_indep' [DecidableEq α] (E : Set α) Indep indep_empty indep_subset indep_aug
    subset_ground {I : Set α} : (IndepMatroid.ofFinset
      E Indep indep_empty indep_subset indep_aug subset_ground).Indep I ↔
        ∀ (J : Finset α), (J : Set α) ⊆ I → Indep J

(indep_subset : ∀ ⦃I J : Finset α⦄, Indep J → I ⊆ J → Indep I)

(indep_aug : ∀ ⦃I J : Finset α⦄, Indep I → Indep J → I.card < J.card → ∃ e ∈ J, e ∉ I ∧ Indep (insert e I))

(subset_ground : ∀ ⦃I : Finset α⦄, Indep I → ↑I ⊆ E)

(IndepMatroid.ofFinset E Indep indep_empty indep_subset indep_aug subset_ground).Indep I ↔
  ∀ (J : Finset α), ↑J ⊆ I → Indep J


@[simp]
theorem strictMono_restrict [Preorder α] [Preorder β] {f : α → β} {s : Set α} :
    StrictMono (s.restrict f) ↔ StrictMonoOn f s

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


theorem Trivialization.smoothOn_symm (e : Trivialization F (π F E)) [MemTrivializationAtlas e] :
    SmoothOn (IB.prod 𝓘(𝕜, F)) (IB.prod 𝓘(𝕜, F)) e.toPartialHomeomorph.symm e.target

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

SmoothOn (IB.prod 𝓘(𝕜, F)) (IB.prod 𝓘(𝕜, F)) (↑e.symm) e.target


theorem sdiff_eq_self_iff_disjoint : s \ t = s ↔ Disjoint s t

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


theorem coeff_zero_C (a : R) : coeff R (0 : σ →₀ ℕ) (C σ R a) = a

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(a : R)

(MvPowerSeries.coeff R 0) ((MvPowerSeries.C σ R) a) = a


theorem nhdsSet_inter_le (s t : Set X) : 𝓝ˢ (s ∩ t) ≤ 𝓝ˢ s ⊓ 𝓝ˢ t

{X : Type u_1}
[TopologicalSpace X]
(s t : Set X)

𝓝ˢ (s ∩ t) ≤ 𝓝ˢ s ⊓ 𝓝ˢ t


theorem mem_iff_index_eq {x i} : x ∈ s i ↔ hs.index x = i

{ι : Type u_1}
{α : Type u_2}
{s : ι → Set α}
(hs : IndexedPartition s)
{x : α}
{i : ι}


theorem elementarilyEquivalent_iff : M ≅[L] N ↔ ∀ φ : L.Sentence, M ⊨ φ ↔ N ⊨ φ

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

L.ElementarilyEquivalent M N ↔ ∀ (φ : L.Sentence), M ⊨ φ ↔ N ⊨ φ


@[to_additive (attr := simp)]
theorem smul_set_ae_le (c : G) {s t : Set α} : c • s ≤ᵐ[μ] c • t ↔ s ≤ᵐ[μ] t

[MeasureTheory.SMulInvariantMeasure G α μ]


theorem epi_of_surjective {X Y : CompHausLike.{u} P} (f : X ⟶ Y) (hf : Function.Surjective f) :
    Epi f

{P : TopCat → Prop}
{X Y : CompHausLike P}
(f : X ⟶ Y)
(hf : Function.Surjective ⇑f)


theorem one_lt_sq_iff {a : R} (ha : 0 ≤ a) : 1 < a ^ 2 ↔ 1 < a

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
(ha : 0 ≤ a)


@[simp] theorem mul_mod_right (a b : Int) : (a * b).mod a = 0


lemma mk'_mul_mk' (n₁ n₂ : ℤ) (d₁ d₂ : ℕ) (hd₁ hd₂ hnd₁ hnd₂) (h₁₂ : n₁.natAbs.Coprime d₂)
    (h₂₁ : n₂.natAbs.Coprime d₁) :
    mk' n₁ d₁ hd₁ hnd₁ * mk' n₂ d₂ hd₂ hnd₂ = mk' (n₁ * n₂) (d₁ * d₂) (Nat.mul_ne_zero hd₁ hd₂) (by
      rw [Int.natAbs_mul]; exact (hnd₁.mul h₂₁).mul_right (h₁₂.mul hnd₂))

(n₁ n₂ : ℤ)
(d₁ d₂ : ℕ)
(hd₁ : d₁ ≠ 0)
(hd₂ : d₂ ≠ 0)
(hnd₁ : n₁.natAbs.Coprime d₁)
(hnd₂ : n₂.natAbs.Coprime d₂)
(h₁₂ : n₁.natAbs.Coprime d₂)
(h₂₁ : n₂.natAbs.Coprime d₁)

{ num := n₁, den := d₁, den_nz := hd₁, reduced := hnd₁ } * { num := n₂, den := d₂, den_nz := hd₂, reduced := hnd₂ } =
  { num := n₁ * n₂, den := d₁ * d₂, den_nz := ⋯, reduced := ⋯ }


lemma le_normalClosure : K ≤ normalClosure F K L

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


theorem integral_cos_pow_pos (n : ℕ) : 0 < ∫ x in (0 : ℝ)..π / 2, cos x ^ n

0 < ∫ (x : ℝ) in 0 ..π / 2, Real.cos x ^ n


/-- The diamond isomorphism between the intervals `]a ⊓ b, a[` and `}b, a ⊔ b[`. -/
@[simps]
def infIooOrderIsoIooSup (a b : α) : Ioo (a ⊓ b) a ≃o Ioo b (a ⊔ b)

{α : Type u_1}
[Lattice α]
[IsModularLattice α]
(a b : α)
(c : ↑(Set.Ioo b (a ⊔ b)))

↑((RelIso.symm (infIooOrderIsoIooSup a b)) c) = a ⊓ ↑c


theorem UniformSpace.ball_mem_nhds (x : α) ⦃V : Set (α × α)⦄ (V_in : V ∈ 𝓤 α) : ball x V ∈ 𝓝 x

{α : Type ua}
[UniformSpace α]
(x : α)
⦃V : Set (α × α)⦄
(V_in : V ∈ 𝓤 α)


theorem commProb_function {α β : Type*} [Fintype α] [Mul β] :
    commProb (α → β) = (commProb β) ^ Fintype.card α

{α : Type u_2}
{β : Type u_3}
[Fintype α]
[Mul β]

commProb (α → β) = commProb β ^ Fintype.card α


lemma uzpow_neg (s : ℤˣ) (x : R) : s ^ (-x) = (s ^ x)⁻¹

{R : Type u_1}
[CommRing R]
[Module R (Additive ℤˣ)]
(s : ℤˣ)
(x : R)


/-- If two words have a common maximal reduction, then they correspond to the same element in the
  free group. -/
@[to_additive "If two words have a common maximal reduction, then they correspond to the same
  element in the additive free group."]
theorem reduce.exact (H : reduce L₁ = reduce L₂) : mk L₁ = mk L₂

(H : FreeAddGroup.reduce L₁ = FreeAddGroup.reduce L₂)


@[simp]
theorem implicitFunctionOfComplemented_apply_image (hf : HasStrictFDerivAt f f' a)
    (hf' : range f' = ⊤) (hker : (ker f').ClosedComplemented) :
    hf.implicitFunctionOfComplemented f f' hf' hker (f a) 0 = a

(hker : (LinearMap.ker f').ClosedComplemented)

HasStrictFDerivAt.implicitFunctionOfComplemented f f' hf hf' hker (f a) 0 = a


@[to_additive]
theorem fst_prod : (∏ c ∈ s, f c).1 = ∏ c ∈ s, (f c).1

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[CommMonoid β]
{s : Finset γ}
{f : γ → α × β}


@[simps]
instance : MonoidalCategoryStruct (FullSubcategory P)

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


@[simp]
theorem lowerClosure_empty : lowerClosure (∅ : Set α) = ⊥


theorem of_imp (h : ∀ s, q s → p s) : InnerRegularWRT μ p q

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{p q : Set α → Prop}
(h : ∀ (s : Set α), q s → p s)


theorem isCofiltered_costructuredArrow_of_isCofiltered_of_exists [IsCofilteredOrEmpty C]
    (h₁ : ∀ d, ∃ c, Nonempty (F.obj c ⟶ d)) (h₂ : ∀ {d : D} {c : C} (s s' : F.obj c ⟶ d),
      ∃ (c' : C) (t : c' ⟶ c), F.map t ≫ s = F.map t ≫ s') (d : D) :
    IsCofiltered (CostructuredArrow F d)

(h₁ : ∀ (d : D), ∃ c, Nonempty (F.obj c ⟶ d))

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

CategoryTheory.IsCofiltered (CategoryTheory.CostructuredArrow F d)


@[simp]
lemma Int.zmultiples_one : AddSubgroup.zmultiples (1 : ℤ) = ⊤


theorem to_nat_eq_succ_pred (n : PosNum) : (n : ℕ) = n.pred' + 1


protected theorem Tendsto.nhds {f : α → X} {l : Filter α} {x : X} (h : Tendsto f l (𝓝 x)) :
    Tendsto (𝓝 ∘ f) l (𝓝 (𝓝 x))

{α : Type u_2}
{X : Type u_4}
[TopologicalSpace X]
{f : α → X}
{l : Filter α}
{x : X}
(h : Filter.Tendsto f l (𝓝 x))


theorem eq_of_degree_le_of_eval_index_eq (hvs : Set.InjOn v s)
    (h_deg_le : f.degree ≤ s.card)
    (h_deg_eq : f.degree = g.degree)
    (hlc : f.leadingCoeff = g.leadingCoeff)
    (h_eval : ∀ i ∈ s, f.eval (v i) = g.eval (v i)) : f = g

(h_eval : ∀ i ∈ s, Polynomial.eval (v i) f = Polynomial.eval (v i) g)


theorem exists_basis_union_inter_basis (M : Matroid α) (X Y : Set α) (hX : X ⊆ M.E := by aesop_mat)
    (hY : Y ⊆ M.E := by aesop_mat) : ∃ I, M.Basis I (X ∪ Y) ∧ M.Basis (I ∩ Y) Y

{α : Type u_1}
(M : Matroid α)
(X Y : Set α)
(hX : X ⊆ M.E := by aesop_mat)
(hY : Y ⊆ M.E := by aesop_mat)


@[to_additive (attr := simp)]
theorem lift_swap (f : M →* P) (g : N →* P) (x : N ∗ M) : lift f g (swap N M x) = lift g f x

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

(Monoid.Coprod.lift f g) ((Monoid.Coprod.swap N M) x) = (Monoid.Coprod.lift g f) x


lemma addContent_union_le (hC : IsSetRing C) (hs : s ∈ C) (ht : t ∈ C) :
    m (s ∪ t) ≤ m s + m t

{α : Type u_1}
{C : Set (Set α)}
{s t : Set α}
{m : MeasureTheory.AddContent C}
(hC : MeasureTheory.IsSetRing C)
(hs : s ∈ C)
(ht : t ∈ C)


theorem of_eq {v' : AddValuation R Γ₀} (h : v = v') : v.IsEquiv v'

{R : Type u_3}
{Γ₀ : Type u_4}
[LinearOrderedAddCommMonoidWithTop Γ₀]
[Ring R]
{v v' : AddValuation R Γ₀}
(h : v = v')


lemma GrothendieckTopology.preservesSheafification_iff_of_adjunctions_of_hasSheafCompose :
    J.PreservesSheafification F ↔ IsIso (sheafComposeNatTrans J F adj₁ adj₂)

(J : CategoryTheory.GrothendieckTopology C)

{G₁ : CategoryTheory.Functor (CategoryTheory.Functor Cᵒᵖ A) (CategoryTheory.Sheaf J A)}

(adj₁ : G₁ ⊣ CategoryTheory.sheafToPresheaf J A)

{G₂ : CategoryTheory.Functor (CategoryTheory.Functor Cᵒᵖ B) (CategoryTheory.Sheaf J B)}

(adj₂ : G₂ ⊣ CategoryTheory.sheafToPresheaf J B)

J.PreservesSheafification F ↔ CategoryTheory.IsIso (CategoryTheory.sheafComposeNatTrans J F adj₁ adj₂)


@[continuity, fun_prop]
theorem continuous_symm : Continuous σ


theorem isStrongLimit_beth {o : Ordinal} (H : IsSuccLimit o) : IsStrongLimit (beth o)

{o : Ordinal.{u_2}}
(H : Order.IsSuccLimit o)


theorem IsRoot.eq_zero (h : IsRoot p x) : eval x p = 0

{R : Type u}
[Semiring R]
{p : R[X]}
{x : R}
(h : p.IsRoot x)


@[fun_prop]
theorem HasFDerivAt.sum (h : ∀ i ∈ u, HasFDerivAt (A i) (A' i) x) :
    HasFDerivAt (fun y => ∑ i ∈ u, A i y) (∑ i ∈ u, A' i) x


theorem iSup_inf_of_antitone {ι : Type*} [Preorder ι] [IsDirected ι (swap (· ≤ ·))] {f g : ι → α}
    (hf : Antitone f) (hg : Antitone g) : ⨆ i, f i ⊓ g i = (⨆ i, f i) ⊓ ⨆ i, g i

[IsDirected ι (Function.swap fun x x_1 => x ≤ x_1)]


@[simp]
theorem toSubalgebra_lt_toSubalgebra {S S' : IntermediateField K L} :
    S.toSubalgebra < S'.toSubalgebra ↔ S < S'

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


@[simp]
theorem bihimp_bihimp_sup : a ⇔ b ⇔ (a ⊔ b) = a ⊓ b

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


theorem sigma_eq_biUnion [DecidableEq (Σi, α i)] (s : Finset ι) (t : ∀ i, Finset (α i)) :
    s.sigma t = s.biUnion fun i => (t i).map <| Embedding.sigmaMk i

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ((i : ι) × α i)]
(s : Finset ι)
(t : (i : ι) → Finset (α i))

s.sigma t = s.biUnion fun i => Finset.map (Function.Embedding.sigmaMk i) (t i)


/-- The continuous homomorphism given by the diagonal embedding. -/
@[to_additive (attr := simps!) "The continuous homomorphism given by the diagonal embedding."]
def diag : ContinuousMonoidHom A (A × A)

(A : Type u_2)
[Monoid A]
[TopologicalSpace A]
(i : A)

(ContinuousMonoidHom.diag A) i = ((ContinuousMonoidHom.id A).toMonoidHom i, (ContinuousMonoidHom.id A).toMonoidHom i)


theorem Fintype.univ_punit : @univ PUnit _ = {PUnit.unit}


theorem uniformEquicontinuousOn_unique [Unique ι] {F : ι → β → α} {S : Set β} :
    UniformEquicontinuousOn F S ↔ UniformContinuousOn (F default) S

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
[Unique ι]
{F : ι → β → α}
{S : Set β}


/-- The `p`-adic norm of `p` is less than `1` if `1 < p`.

See also `padicNorm.padicNorm_p_lt_one_of_prime` for a version assuming `p` is prime. -/
theorem padicNorm_p_lt_one (hp : 1 < p) : padicNorm p p < 1


theorem mk_list_sum (l : List R) (b : M) : mk l.sum b = (l.map fun a => mk a b).sum

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(l : List R)
(b : ↥M)

Localization.mk l.sum b = (List.map (fun a => Localization.mk a b) l).sum


theorem union_sublist_append (l₁ l₂ : List α) : l₁ ∪ l₂ <+ l₁ ++ l₂

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


/-- The restriction of a proper map to a closed subset is proper. -/
lemma isProperMap_restr_of_proper_of_closed {U : Set X} (hf : IsProperMap f) (hU : IsClosed U) :
    IsProperMap (fun x : U ↦ f x)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{U : Set X}
(hf : IsProperMap f)
(hU : IsClosed U)


theorem of_finitePresentation {f : A →ₐ[R] B} (hf : f.FinitePresentation) : f.FiniteType

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommRing R]
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]
{f : A →ₐ[R] B}
(hf : f.FinitePresentation)


theorem eq_of_isNilpotent_sub_of_isIdempotentElem {e₁ e₂ : R}
    (he₁ : IsIdempotentElem e₁) (he₂ : IsIdempotentElem e₂) (H : IsNilpotent (e₁ - e₂)) :
    e₁ = e₂

{R : Type u_1}
[CommRing R]
{e₁ e₂ : R}
(he₁ : IsIdempotentElem e₁)
(he₂ : IsIdempotentElem e₂)
(H : IsNilpotent (e₁ - e₂))


@[to_additive]
theorem exponent_ne_zero : exponent G ≠ 0 ↔ ExponentExists G

AddMonoid.exponent G ≠ 0 ↔ AddMonoid.ExponentExists G


theorem powerBasis_gen_mem_adjoin_zeta_sub_one :
    (hζ.powerBasis K).gen ∈ adjoin K ({ζ - 1} : Set L)

{n : ℕ+}
(K : Type u)
{L : Type v}
[Field K]
[CommRing L]
[IsDomain L]
[Algebra K L]
[IsCyclotomicExtension {n} K L]
{ζ : L}
(hζ : IsPrimitiveRoot ζ ↑n)

(IsPrimitiveRoot.powerBasis K hζ).gen ∈ Algebra.adjoin K {ζ - 1}


@[to_additive (attr := simp)] lemma leOnePart_one : (1 : α)⁻ᵐ = 1


lemma iSup_weightSpace_eq_top' [IsTriangularizable K L M] :
    ⨆ χ : Weight K L M, weightSpace M χ = ⊤

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


@[to_additive] lemma zpow_mul_comm (a : G) (m n : ℤ) : a ^ m * a ^ n = a ^ n * a ^ m

{G : Type u_3}
[AddGroup G]
(a : G)
(m n : ℤ)


theorem antidiagonal.snd_lt {n : ℕ} {kl : ℕ × ℕ} (hlk : kl ∈ antidiagonal n) : kl.2 < n + 1

{n : ℕ}
{kl : ℕ × ℕ}
(hlk : kl ∈ Finset.antidiagonal n)


@[to_additive]
theorem IsCompact.closedBall_div (hs : IsCompact s) (hδ : 0 ≤ δ) (x : E) :
    closedBall x δ * s = x • cthickening δ s

{E : Type u_1}
[SeminormedAddCommGroup E]
{δ : ℝ}
{s : Set E}
(hs : IsCompact s)
(hδ : 0 ≤ δ)
(x : E)

Metric.closedBall x δ + s = x +ᵥ Metric.cthickening δ s


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


/-- See `le_sdiff` for a stronger version in generalised Boolean algebras. -/
theorem Disjoint.le_sdiff_of_le_left (hac : Disjoint a c) (hab : a ≤ b) : a ≤ b \ c

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b c : α}
(hac : Disjoint a c)
(hab : a ≤ b)


theorem neg_of_mul_pos_left [PosMulMono α] [MulPosMono α] (h : 0 < a * b) (ha : b ≤ 0) : a < 0

{α : Type u_1}
{a b : α}
[MulZeroClass α]
[LinearOrder α]
[PosMulMono α]
[MulPosMono α]
(h : 0 < a * b)
(ha : b ≤ 0)


theorem surjOn_expMapCircle_neg_pi_pi : SurjOn expMapCircle (Ioc (-π) π) univ

Set.SurjOn (⇑expMapCircle) (Set.Ioc (-π) π) Set.univ


theorem Nonempty.of_sups_left : (s ⊻ t).Nonempty → s.Nonempty

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


theorem fderiv_clm_comp (hc : DifferentiableAt 𝕜 c x) (hd : DifferentiableAt 𝕜 d x) :
    fderiv 𝕜 (fun y => (c y).comp (d y)) x =
      (compL 𝕜 F G H (c x)).comp (fderiv 𝕜 d x) +
        ((compL 𝕜 F G H).flip (d x)).comp (fderiv 𝕜 c x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{H : Type u_6}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{c : E → G →L[𝕜] H}
{d : E → F →L[𝕜] G}
(hc : DifferentiableAt 𝕜 c x)
(hd : DifferentiableAt 𝕜 d x)

fderiv 𝕜 (fun y => (c y).comp (d y)) x =
  ((ContinuousLinearMap.compL 𝕜 F G H) (c x)).comp (fderiv 𝕜 d x) +
    ((ContinuousLinearMap.compL 𝕜 F G H).flip (d x)).comp (fderiv 𝕜 c x)


@[to_additive]
lemma sup_mul_left [SemilatticeSup β] [OrderBot β] (s t : Finset α) (f : α → β) :
    sup (s * t) f = sup s fun x ↦ sup t (f <| x * ·)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Add α]
[SemilatticeSup β]
[OrderBot β]
(s t : Finset α)
(f : α → β)

(s + t).sup f = s.sup fun x => t.sup fun x_1 => f (x + x_1)


theorem IsOrtho.inner_eq {U V : Submodule 𝕜 E} (h : U ⟂ V) {u v : E} (hu : u ∈ U) (hv : v ∈ V) :
    ⟪u, v⟫ = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{U V : Submodule 𝕜 E}
(h : U ⟂ V)
{u v : E}
(hu : u ∈ U)
(hv : v ∈ V)


@[simp]
theorem eval_natCast {n : ℕ} : (n : R[X]).eval x = n

{R : Type u}
[Semiring R]
{x : R}
{n : ℕ}


/-- A constructor for `PredOrder α` for `α` a linear order. -/
@[simps]
def PredOrder.ofCore {α} [LinearOrder α] (pred : α → α)
    (hn : ∀ {a}, ¬IsMin a → ∀ b, b ≤ pred a ↔ b < a) (hm : ∀ a, IsMin a → pred a = a) :
    PredOrder α

(hn : ∀ {a : α}, ¬IsMin a → ∀ (b : α), b ≤ pred a ↔ b < a)


lemma EffectiveEpiFamily.hom_ext {B W : C} {α : Type*} (X : α → C) (π : (a : α) → (X a ⟶ B))
    [EffectiveEpiFamily X π] (m₁ m₂ : B ⟶ W) (h : ∀ a, π a ≫ m₁ = π a ≫ m₂) :
    m₁ = m₂

(h : ∀ (a : α), CategoryTheory.CategoryStruct.comp (π a) m₁ = CategoryTheory.CategoryStruct.comp (π a) m₂)


/-- Reformulation of `hasSum_nat_sinZeta` using `LSeriesHasSum`. -/
lemma LSeriesHasSum_sin (a : ℝ) {s : ℂ} (hs : 1 < re s) :
    LSeriesHasSum (Real.sin <| 2 * π * a * ·) s (sinZeta a s)

LSeriesHasSum (fun x => ↑(Real.sin (2 * π * a * ↑x))) s (HurwitzZeta.sinZeta (↑a) s)


protected theorem lt_of_mul_lt_mul_right {a b c : Nat} (h : b * a < c * a) : b < c


theorem C_injective : Function.Injective (C R)


theorem mem_carrier {x : L} : x ∈ L'.carrier ↔ x ∈ (L' : Set L)

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


@[simp]
lemma map_top (f : X ⟶ Y) : (Opens.map f).obj ⊤ = ⊤

(TopologicalSpace.Opens.map f).obj ⊤ = ⊤


theorem formPerm_apply_mem_eq_next (s : Cycle α) (h : Nodup s) (x : α) (hx : x ∈ s) :
    formPerm s h x = next s h x hx

{α : Type u_1}
[DecidableEq α]
(s : Cycle α)
(h : s.Nodup)
(x : α)
(hx : x ∈ s)


@[simp]
theorem map_map (g : β ≃o γ) (f : α ≃o β) : map g (map f s) = map (f.trans g) s

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

(UpperSet.map g) ((UpperSet.map f) s) = (UpperSet.map (f.trans g)) s


theorem condIndep_iff_forall_condIndepSet (μ : Measure Ω) [IsFiniteMeasure μ] :
    CondIndep m' m₁ m₂ hm' μ ↔ ∀ s t, MeasurableSet[m₁] s → MeasurableSet[m₂] t
      → CondIndepSet m' hm' s t μ

{Ω : Type u_1}
{m' m₁ m₂ mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
{hm' : m' ≤ mΩ}
(μ : MeasureTheory.Measure Ω)
[MeasureTheory.IsFiniteMeasure μ]

ProbabilityTheory.CondIndep m' m₁ m₂ hm' μ ↔
  ∀ (s t : Set Ω), MeasurableSet s → MeasurableSet t → ProbabilityTheory.CondIndepSet m' hm' s t μ


@[simp]
theorem keys_erase (a : α) (s : AList β) : (erase a s).keys = s.keys.erase a

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(s : AList β)


@[reassoc (attr := simp)]
theorem diagonalObjPullbackFstIso_inv_snd_fst {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    (diagonalObjPullbackFstIso f g).inv ≫ pullback.snd _ _ ≫ pullback.fst _ _ =
      pullback.snd _ _

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Limits.HasPullbacks C]
{X Y Z : C}
(f : X ⟶ Z)
(g : Y ⟶ Z)

(CategoryTheory.Limits.diagonalObjPullbackFstIso f g).inv ≫
    CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.fst f g)
        (CategoryTheory.Limits.pullback.fst f g) ≫
      CategoryTheory.Limits.pullback.fst f g =
  CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.snd g g ≫ g) f


/-- A piecewise function on countably many pieces is measurable if all the data is measurable. -/
@[measurability]
theorem Measurable.find {_ : MeasurableSpace α} {f : ℕ → α → β} {p : ℕ → α → Prop}
    [∀ n, DecidablePred (p n)] (hf : ∀ n, Measurable (f n)) (hp : ∀ n, MeasurableSet { x | p n x })
    (h : ∀ x, ∃ n, p n x) : Measurable fun x => f (Nat.find (h x)) x

{α : Type u_1}
{β : Type u_2}
{mβ : MeasurableSpace β}

∀ {x : MeasurableSpace α} {f : ℕ → α → β} {p : ℕ → α → Prop} [inst : (n : ℕ) → DecidablePred (p n)],
  (∀ (n : ℕ), Measurable (f n)) →
    (∀ (n : ℕ), MeasurableSet {x | p n x}) → ∀ (h : ∀ (x : α), ∃ n, p n x), Measurable fun x => f (Nat.find ⋯) x


@[simp]
theorem not_monic_zero : ¬Monic (0 : R[X])

{R : Type u}
[Semiring R]
[Nontrivial R]


lemma real_iff [Algebra ℂ A] {a : A} :
    SpectrumRestricts a Complex.reCLM ↔ ∀ x ∈ spectrum ℂ a, x = x.re

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

SpectrumRestricts a ⇑Complex.reCLM ↔ ∀ x ∈ spectrum ℂ a, x = ↑x.re


theorem grade_mono [PartialOrder α] [GradeOrder 𝕆 α] : Monotone (grade 𝕆 : α → 𝕆)

{𝕆 : Type u_1}
{α : Type u_3}
[Preorder 𝕆]
[PartialOrder α]
[GradeOrder 𝕆 α]


theorem of_terminates_iff_of_rat_terminates {v : K} {q : ℚ} (v_eq_q : v = (q : K)) :
    (of v).Terminates ↔ (of q).Terminates

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
{v : K}
{q : ℚ}
(v_eq_q : v = ↑q)

(GenContFract.of v).Terminates ↔ (GenContFract.of q).Terminates


theorem expSeries_summable_of_mem_ball' (x : 𝔸)
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    Summable fun n => (n !⁻¹ : 𝕂) • x ^ n

(hx : x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

Summable fun n => (↑n.factorial)⁻¹ • x ^ n


protected theorem inf_eq_right {a b : CauSeq α abs} (h : b ≤ a) : a ⊓ b ≈ b

{α : Type u_1}
[LinearOrderedField α]
{a b : CauSeq α abs}
(h : b ≤ a)


@[to_additive]
theorem finprod_inv_distrib [DivisionCommMonoid G] (f : α → G) : (∏ᶠ x, (f x)⁻¹) = (∏ᶠ x, f x)⁻¹

{G : Type u_1}
{α : Sort u_4}
[SubtractionCommMonoid G]
(f : α → G)


@[to_additive (attr := simp)]
theorem restrict_mker (f : M →* N) : mker (f.restrict S) = f.mker.comap S.subtype

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(S : AddSubmonoid M)
(f : M →+ N)

AddMonoidHom.mker (f.restrict S) = AddSubmonoid.comap S.subtype (AddMonoidHom.mker f)


@[simp] lemma coe_toInfTopHom (f : FrameHom α β) : ⇑f.toInfTopHom = f

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : FrameHom α β)


protected theorem map_add [DecidableEq ι] (i : ι) (u v : s i →ₗ[R] t i) :
    map (update f i (u + v)) = map (update f i u) + map (update f i v)

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
{t : ι → Type u_11}
[(i : ι) → AddCommMonoid (t i)]
[(i : ι) → Module R (t i)]
(f : (i : ι) → s i →ₗ[R] t i)
[DecidableEq ι]
(i : ι)
(u v : s i →ₗ[R] t i)

PiTensorProduct.map (Function.update f i (u + v)) =
  PiTensorProduct.map (Function.update f i u) + PiTensorProduct.map (Function.update f i v)


@[simp]
theorem mem_ite_univ_left (p : Prop) [Decidable p] (t : Set α) (x : α) :
    x ∈ ite p Set.univ t ↔ ¬p → x ∈ t

{α : Type u}
(p : Prop)
[Decidable p]
(t : Set α)
(x : α)

(x ∈ if p then Set.univ else t) ↔ ¬p → x ∈ t


/-- If `f(p(t) = g(q(t))` for two paths `p` and `q`, then the induced path homotopy classes
`f(p)` and `g(p)` are the same as well, despite having a priori different types -/
theorem heq_path_of_eq_image : HEq ((πₘ f).map ⟦p⟧) ((πₘ g).map ⟦q⟧)

{X₁ X₂ Y : TopCat}
{f : C(↑X₁, ↑Y)}
{g : C(↑X₂, ↑Y)}
{x₀ x₁ : ↑X₁}
{x₂ x₃ : ↑X₂}
{p : Path x₀ x₁}
{q : Path x₂ x₃}
(hfg : ∀ (t : ↑I), f (p t) = g (q t))

HEq ((π.map f).map ⟦p⟧) ((π.map g).map ⟦q⟧)


/-- The map `(x, y) ↦ (y, yx)` sends the measure `μ × ν` to `ν × μ`.
This is the map `SR` in [Halmos, §59].
`S` is the map `(x, y) ↦ (x, xy)` and `R` is `Prod.swap`. -/
@[to_additive measurePreserving_prod_add_swap
" The map `(x, y) ↦ (y, y + x)` sends the measure `μ × ν` to `ν × μ`. "]
theorem measurePreserving_prod_mul_swap [IsMulLeftInvariant μ] :
    MeasurePreserving (fun z : G × G => (z.2, z.2 * z.1)) (μ.prod ν) (ν.prod μ)

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

MeasureTheory.MeasurePreserving (fun z => (z.2, z.2 * z.1)) (μ.prod ν) (ν.prod μ)


/-- Every ordinal has a fundamental sequence. -/
theorem exists_fundamental_sequence (a : Ordinal.{u}) :
    ∃ f, IsFundamentalSequence a a.cof.ord f

∃ f, a.IsFundamentalSequence a.cof.ord f


theorem toString : ∀ {it}, ValidFor l r it → it.1 = ⟨l.reverseAux r⟩

{l r : List Char}
{it : String.Iterator}

String.Iterator.ValidFor l r it → it.s = { data := l.reverseAux r }


theorem isOpen_sigma_fst_preimage (s : Set ι) : IsOpen (Sigma.fst ⁻¹' s : Set (Σ a, σ a))

{ι : Type u_5}
{σ : ι → Type u_7}
[(i : ι) → TopologicalSpace (σ i)]
(s : Set ι)


theorem eq_top_iff {S : NonUnitalStarSubalgebra R A} : S = ⊤ ↔ ∀ x : A, x ∈ S

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


theorem ae_le_set : s ≤ᵐ[μ] t ↔ μ (s \ t) = 0

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{s t : Set α}


theorem iInf_image :
    ∀ {γ} {f : β → γ} {g : γ → α} {t : Set β}, ⨅ c ∈ f '' t, g c = ⨅ b ∈ t, g (f b)

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{γ : Type u_9}
{f : β → γ}
{g : γ → α}
{t : Set β}


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


@[gcongr]
theorem union_subset_union (hsu : s ⊆ u) (htv : t ⊆ v) : s ∪ t ⊆ u ∪ v

{α : Type u_1}
[DecidableEq α]
{s t u v : Finset α}
(hsu : s ⊆ u)
(htv : t ⊆ v)


theorem pmap_bind {α β γ} {x : Option α} {g : α → Option β} {p : β → Prop} {f : ∀ b, p b → γ} (H)
    (H' : ∀ (a : α), ∀ b ∈ g a, b ∈ x >>= g) :
    pmap f (x >>= g) H = x >>= fun a ↦ pmap f (g a) fun b h ↦ H _ (H' a _ h)

(H' : ∀ (a : α) (b : β), b ∈ g a → b ∈ x >>= g)

Option.pmap f (x >>= g) H = do
  let a ← x
  Option.pmap f (g a) ⋯


@[simp] theorem negSucc_not_nonneg (n : Nat) : 0 ≤ -[n+1] ↔ False


@[to_additive]
theorem measure_eq_tsum' (h : IsFundamentalDomain G s μ) (t : Set α) :
    μ t = ∑' g : G, μ (t ∩ g • s)

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)


/-- The infimum of a set of congruence relations is the same as the infimum of the set's image
    under the map to the underlying equivalence relation. -/
@[to_additive "The infimum of a set of additive congruence relations is the same as the infimum of
the set's image under the map to the underlying equivalence relation."]
theorem sInf_toSetoid (S : Set (Con M)) : (sInf S).toSetoid = sInf (toSetoid '' S)

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

(sInf S).toSetoid = sInf (Con.toSetoid '' S)


@[simp]
theorem inf_apply [∀ i, Inf (α' i)] (f g : ∀ i, α' i) (i : ι) : (f ⊓ g) i = f i ⊓ g i

{ι : Type u_1}
{α' : ι → Type u_2}
[(i : ι) → Inf (α' i)]
(f g : (i : ι) → α' i)
(i : ι)


@[simp]
theorem preimage_coe_Ioo_bot : (some : α → WithBot α) ⁻¹' Ioo ⊥ a = Iio a

WithBot.some ⁻¹' Set.Ioo ⊥ ↑a = Set.Iio a


lemma congr (h_eq : Set.EqOn f g U) (hu : IsOpen U) : MeromorphicOn g U

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f g : 𝕜 → E}
{U : Set 𝕜}
(hf : MeromorphicOn f U)
(h_eq : Set.EqOn f g U)
(hu : IsOpen U)


theorem biUnion_image_right : (t.biUnion fun b => s.image fun a => f a b) = image₂ f s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}

(t.biUnion fun b => Finset.image (fun a => f a b) s) = Finset.image₂ f s t


/-- If a function `f` tends to negative infinity along a filter, then `f` multiplied by
a positive constant (on the right) also tends to negative infinity. -/
theorem Tendsto.atBot_mul_const (hr : 0 < r) (hf : Tendsto f l atBot) :
    Tendsto (fun x => f x * r) l atBot

{α : Type u_3}
{β : Type u_4}
[LinearOrderedField α]
{l : Filter β}
{f : β → α}
{r : α}
(hr : 0 < r)
(hf : Filter.Tendsto f l Filter.atBot)

Filter.Tendsto (fun x => f x * r) l Filter.atBot


@[to_additive indicator_compl]
theorem mulIndicator_compl' (s : Set α) (f : α → G) :
    mulIndicator sᶜ f = f / mulIndicator s f

{α : Type u_1}
{G : Type u_6}
[Group G]
(s : Set α)
(f : α → G)

sᶜ.mulIndicator f = f / s.mulIndicator f


theorem subset_left_of_subset_union (h : s ⊆ t ∪ u) (hac : Disjoint s u) : s ⊆ t

{α : Type u_1}
{s t u : Set α}
(h : s ⊆ t ∪ u)
(hac : Disjoint s u)


@[simp]
theorem MapsTo.restrict_surjective_iff (h : MapsTo f s t) :
    Surjective (MapsTo.restrict _ _ _ h) ↔ SurjOn f s t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
(h : Set.MapsTo f s t)

Function.Surjective (Set.MapsTo.restrict f s t h) ↔ Set.SurjOn f s t


lemma div_mul_cancel_left₀ (ha : a ≠ 0) (b : G₀) : a / (a * b) = b⁻¹

{G₀ : Type u_3}
[CommGroupWithZero G₀]
{a : G₀}
(ha : a ≠ 0)
(b : G₀)


/-- This structure contains the data of two left fractions for
`W : MorphismProperty C` that have the same "denominator". -/
structure LeftFraction₂ (X Y : C) where
  /-- the auxiliary object of left fractions -/
  {Y' : C}
  /-- the numerator of the first left fraction -/
  f : X ⟶ Y'
  /-- the numerator of the second left fraction -/
  f' : X ⟶ Y'
  /-- the denominator of the left fractions -/
  s : Y ⟶ Y'
  /-- the condition that the denominator belongs to the given morphism property -/
  hs : W s

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
{X Y : C}
(self : W.LeftFraction₂ X Y)


@[simp, fun_prop]
theorem DifferentiableAt.sub (hf : DifferentiableAt 𝕜 f x) (hg : DifferentiableAt 𝕜 g x) :
    DifferentiableAt 𝕜 (fun y => f y - g y) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{x : E}
(hf : DifferentiableAt 𝕜 f x)
(hg : DifferentiableAt 𝕜 g x)


@[to_additive]
theorem inv_mul_le_one_iff : a⁻¹ * b ≤ 1 ↔ b ≤ a

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


@[simp]
lemma Scheme.ofRestrict_appIso (U) :
    (X.ofRestrict h).appIso U = Iso.refl _

{f : U ⟶ TopCat.of ↑↑X.toPresheafedSpace}

∀ (U_1 : (X.restrict h).Opens),
  AlgebraicGeometry.Scheme.Hom.appIso (X.ofRestrict h) U_1 =
    CategoryTheory.Iso.refl
      (X.presheaf.obj (Opposite.op ((AlgebraicGeometry.Scheme.Hom.opensFunctor (X.ofRestrict h)).obj U_1)))


@[reassoc (attr := simp)]
lemma map_comp_map_s (φ : W.LeftFraction X Y) (L : C ⥤ D) (hL : W.IsInvertedBy L) :
    φ.map L hL ≫ L.map φ.s = L.map φ.f

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{W : CategoryTheory.MorphismProperty C}
{X Y : C}
(φ : W.LeftFraction X Y)
(L : CategoryTheory.Functor C D)
(hL : W.IsInvertedBy L)

CategoryTheory.CategoryStruct.comp (φ.map L hL) (L.map φ.s) = L.map φ.f


@[simp]
theorem Iio_bot : Iio (⊥ : α) = ∅

{α : Type u_1}
[Preorder α]
[OrderBot α]


@[simp]
theorem id_comp : (id : E₂ →ₗᵢ[R₂] E₂).comp f = f

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


@[to_additive (attr := simp)]
theorem mem_range {f : G →* N} {y : N} : y ∈ f.range ↔ ∃ x, f x = y

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
{y : N}


/-- A component of a transposed form of the inverse conjugation definition. -/
theorem conjugateEquiv_counit_symm (α : R₁ ⟶ R₂) (d : D) :
    L₂.map (α.app _) ≫ adj₂.counit.app d =
      ((conjugateEquiv adj₁ adj₂).symm α).app _ ≫ adj₁.counit.app d

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
{L₁ L₂ : CategoryTheory.Functor C D}
{R₁ R₂ : CategoryTheory.Functor D C}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(α : R₁ ⟶ R₂)
(d : D)

CategoryTheory.CategoryStruct.comp (L₂.map (α.app d)) (adj₂.counit.app d) =
  CategoryTheory.CategoryStruct.comp (((CategoryTheory.conjugateEquiv adj₁ adj₂).symm α).app (R₁.obj d))
    (adj₁.counit.app d)


@[simp]
theorem eraseLead_coeff_natDegree : f.eraseLead.coeff f.natDegree = 0


/-- Product of modules is commutative up to continuous linear isomorphism. -/
@[simps! apply toLinearEquiv]
def prodComm [Module R₁ M₂] : (M₁ × M₂) ≃L[R₁] M₂ × M₁

(R₁ : Type u_1)
[Semiring R₁]
(M₁ : Type u_4)
[TopologicalSpace M₁]
[AddCommMonoid M₁]
(M₂ : Type u_6)
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₁ M₂]

∀ (a : M₁ × M₂), (ContinuousLinearEquiv.prodComm R₁ M₁ M₂) a = a.swap


@[trans]
theorem trans {H K L : Subgroup G} (hhk : Commensurable H K) (hkl : Commensurable K L) :
    Commensurable H L

{G : Type u_1}
[Group G]
{H K L : Subgroup G}
(hhk : Commensurable H K)
(hkl : Commensurable K L)


theorem inf_mem_infs : a ∈ s → b ∈ t → a ⊓ b ∈ s ⊼ t

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


@[simp]
theorem range_castSucc {n : ℕ} : Set.range (castSucc : Fin n → Fin n.succ) =
    ({ i | (i : ℕ) < n } : Set (Fin n.succ))


@[to_additive]
theorem mk_one_eq_monoidOf_mk (x) : mk x 1 = (monoidOf S).toMap x

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
(x : M)

Localization.mk x 1 = (Localization.monoidOf S).toMap x


theorem toIocMod_eq_toIocMod : toIocMod hp a b = toIocMod hp a c ↔ ∃ n : ℤ, c - b = n • p

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

toIocMod hp a b = toIocMod hp a c ↔ ∃ n, c - b = n • p


@[to_additive]
theorem op_sInf (S : Set (Subgroup G)) : (sInf S).op = sInf (.unop ⁻¹' S)

{G : Type u_2}
[AddGroup G]
(S : Set (AddSubgroup G))

(sInf S).op = sInf (AddSubgroup.unop ⁻¹' S)


theorem differentiableOn_inv : DifferentiableOn 𝕜 (fun x : 𝕜 => x⁻¹) { x | x ≠ 0 }

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]

DifferentiableOn 𝕜 (fun x => x⁻¹) {x | x ≠ 0}


theorem IsWF.min_mem (hs : IsWF s) (hn : s.Nonempty) : hs.min hn ∈ s

{α : Type u_2}
[Preorder α]
{s : Set α}
(hs : s.IsWF)
(hn : s.Nonempty)


@[simp]
theorem coe_neg (x : ℝ) : ↑(-x : ℝ) = -(↑x : Angle)


@[simp]
theorem T_add_two : ∀ n, T R (n + 2) = 2 * X * T R (n + 1) - T R n

Polynomial.Chebyshev.T R (n + 2) = 2 * Polynomial.X * Polynomial.Chebyshev.T R (n + 1) - Polynomial.Chebyshev.T R n


theorem monoidalClosed_pre_app {M N : ModuleCat.{u} R} (P : ModuleCat.{u} R) (f : N ⟶ M) :
    (MonoidalClosed.pre f).app P = LinearMap.lcomp R _ f

{R : Type u}
[CommRing R]
{M N : ModuleCat R}
(P : ModuleCat R)
(f : N ⟶ M)

(CategoryTheory.MonoidalClosed.pre f).app P = LinearMap.lcomp R (↑P) f


@[to_additive (attr := simp)]
theorem liftRight_inv_mul (f : M →* N) (h : ∀ x, IsUnit (f x)) (x) :
    ↑(IsUnit.liftRight f h x)⁻¹ * f x = 1

{M : Type u_4}
{N : Type u_5}
[AddMonoid M]
[AddMonoid N]
(f : M →+ N)
(h : ∀ (x : M), IsAddUnit (f x))
(x : M)

↑(-(IsAddUnit.liftRight f h) x) + f x = 0


theorem size_to_nat : ∀ n, (size n : ℕ) = Nat.size n


@[simp]
theorem maxTrivEquiv_of_equiv_symm_eq_symm (e : M ≃ₗ⁅R,L⁆ N) :
    (maxTrivEquiv e).symm = maxTrivEquiv e.symm

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[AddCommGroup N]
[Module R N]
[LieRingModule L N]
[LieModule R L N]
(e : M ≃ₗ⁅R,L⁆ N)

(LieModule.maxTrivEquiv e).symm = LieModule.maxTrivEquiv e.symm


@[simp]
theorem neighborSet_fst_subgraphOfAdj {v w : V} (hvw : G.Adj v w) :
    (G.subgraphOfAdj hvw).neighborSet v = {w}

{V : Type u}
{G : SimpleGraph V}
{v w : V}
(hvw : G.Adj v w)


theorem IsUpperSet.top_mem (hs : IsUpperSet s) : ⊤ ∈ s ↔ s.Nonempty

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


theorem nhdsWithin_union (a : α) (s t : Set α) : 𝓝[s ∪ t] a = 𝓝[s] a ⊔ 𝓝[t] a

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


lemma longestOf_len_unique [FiniteDimensionalOrder α] (p : LTSeries α)
    (is_longest : ∀ (q : LTSeries α), q.length ≤ p.length) :
    p.length = (LTSeries.longestOf α).length


theorem Inducing.frechetUrysohnSpace [FrechetUrysohnSpace Y] {f : X → Y} (hf : Inducing f) :
    FrechetUrysohnSpace X

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[FrechetUrysohnSpace Y]
{f : X → Y}
(hf : Inducing f)


@[reassoc (attr := simp)]
theorem coprodComparison_inr : coprod.inr ≫ coprodComparison F A B = F.map coprod.inr

[CategoryTheory.Limits.HasBinaryCoproduct (F.obj A) (F.obj B)]

CategoryTheory.Limits.coprod.inr ≫ CategoryTheory.Limits.coprodComparison F A B = F.map CategoryTheory.Limits.coprod.inr


@[simp]
theorem toList_singleton (a : α) : ({a} : Multiset α).toList = [a]


@[simp]
theorem mem_compl : x ∈ sᶜ ↔ ¬x ∈ s

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{A : Set M}
{α : Type u₁}
{s : L.DefinableSet A α}
{x : α → M}

x ∈ sᶜ ↔ x ∉ s


/-- We'd like to state this as `L.headI * L.tail.prod = L.prod`, but because `L.headI` relies on an
inhabited instance to return a garbage value on the empty list, this is not possible.
Instead, we write the statement in terms of `(L.get? 0).getD 1`.
-/
@[to_additive "We'd like to state this as `L.headI + L.tail.sum = L.sum`, but because `L.headI`
  relies on an inhabited instance to return a garbage value on the empty list, this is not possible.
  Instead, we write the statement in terms of `(L.get? 0).getD 0`."]
theorem get?_zero_mul_tail_prod (l : List M) : (l.get? 0).getD 1 * l.tail.prod = l.prod

{M : Type u_4}
[AddMonoid M]
(l : List M)


theorem Ico_filter_le_of_right_le [DecidablePred (b ≤ ·)] :
    ((Ico a b).filter fun x => b ≤ x) = ∅

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}
[DecidablePred fun x => b ≤ x]

Multiset.filter (fun x => b ≤ x) (Multiset.Ico a b) = ∅


theorem map_sup (f : F) (S T : NonUnitalStarSubalgebra R A) :
    ((S ⊔ T).map f : NonUnitalStarSubalgebra R B) = S.map f ⊔ T.map f

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
[NonUnitalSemiring B]
[StarRing B]
[Module R B]
[IsScalarTower R B B]
[SMulCommClass R B B]
[StarModule R B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
[NonUnitalStarAlgHomClass F R A B]
(f : F)
(S T : NonUnitalStarSubalgebra R A)

NonUnitalStarSubalgebra.map f (S ⊔ T) = NonUnitalStarSubalgebra.map f S ⊔ NonUnitalStarSubalgebra.map f T


@[simp]
theorem comp_bijective (f : α → β) (e : F) : Function.Bijective (e ∘ f) ↔ Function.Bijective f

{F : Sort u_2}
{α : Sort u_3}
{β : Sort u_4}
{γ : Sort u_5}
[iF : EquivLike F β γ]
(f : α → β)
(e : F)

Function.Bijective (⇑e ∘ f) ↔ Function.Bijective f


@[mono]
theorem clog_mono_right {b : ℕ} {r₁ r₂ : R} (h₀ : 0 < r₁) (h : r₁ ≤ r₂) :
    clog b r₁ ≤ clog b r₂

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
{b : ℕ}
{r₁ r₂ : R}
(h₀ : 0 < r₁)
(h : r₁ ≤ r₂)


theorem Finset.exists_le [Nonempty α] [Preorder α] [IsDirected α (· ≤ ·)] (s : Finset α) :
    ∃ M, ∀ i ∈ s, i ≤ M

{α : Type u}
[Nonempty α]
[Preorder α]
[IsDirected α fun x x_1 => x ≤ x_1]
(s : Finset α)


@[simp]
theorem extensionHom_val {X : UniformSpaceCat} {Y : CpltSepUniformSpace}
    (f : X ⟶ (forget₂ _ _).obj Y) (x) : (extensionHom f) x = Completion.extension f x

(f : X ⟶ (CategoryTheory.forget₂ CpltSepUniformSpace UniformSpaceCat).obj Y)

(x : (CategoryTheory.forget CpltSepUniformSpace).obj (UniformSpaceCat.completionFunctor.obj X))

(UniformSpaceCat.extensionHom f) x = UniformSpace.Completion.extension ((CategoryTheory.forget UniformSpaceCat).map f) x


theorem Ioo_union_right (hab : a < b) : Ioo a b ∪ {b} = Ioc a b

{α : Type u_1}
[PartialOrder α]
{a b : α}
(hab : a < b)


lemma hasTotal_of_iso [K.HasTotal c₁₂] : L.HasTotal c₁₂

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
{K L : HomologicalComplex₂ C c₁ c₂}
(e : K ≅ L)
(c₁₂ : ComplexShape I₁₂)
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]


theorem rpow_inv_lt_iff_of_neg (hx : 0 < x) (hy : 0 < y) (hz : z < 0) :
    x ^ z⁻¹ < y ↔ y ^ z < x


/-- The forgetful functor from categories to quivers. -/
@[simps]
def forget : Cat.{v, u} ⥤ Quiv.{v, u}

∀ {X Y : CategoryTheory.Cat} (F : X ⟶ Y), CategoryTheory.Quiv.forget.map F = F.toPrefunctor


theorem IsLittleO.congr (h : f₁ =o[l] g₁) (hf : ∀ x, f₁ x = f₂ x) (hg : ∀ x, g₁ x = g₂ x) :
    f₂ =o[l] g₂

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{l : Filter α}
{f₁ f₂ : α → E}
{g₁ g₂ : α → F}
(h : f₁ =o[l] g₁)
(hf : ∀ (x : α), f₁ x = f₂ x)
(hg : ∀ (x : α), g₁ x = g₂ x)


@[simp]
theorem mem_Ioi : x ∈ Ioi a ↔ a < x


@[reassoc (attr := simp, nolint simpNF)]
theorem Pi.π_comp_eqToHom {J : Type*} (f : J → C) [HasProduct f] {j j' : J} (w : j = j') :
    Pi.π f j ≫ eqToHom (by simp [w]) = Pi.π f j'

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{J : Type u_1}
(f : J → C)
[CategoryTheory.Limits.HasProduct f]
{j j' : J}
(w : j = j')

CategoryTheory.Limits.Pi.π f j ≫ CategoryTheory.eqToHom ⋯ = CategoryTheory.Limits.Pi.π f j'


theorem of_mul_inv_t (a : A) :
    (of (a : G) : HNNExtension G A B φ) * t⁻¹ = t⁻¹ * of (φ a : G)

{G : Type u_1}
[Group G]
{A B : Subgroup G}
{φ : ↥A ≃* ↥B}
(a : ↥A)

HNNExtension.of ↑a * HNNExtension.t⁻¹ = HNNExtension.t⁻¹ * HNNExtension.of ↑(φ a)


/-- The associator for tensor, `(X ⊗ Y) ⊗ Z ≅ X ⊗ (Y ⊗ Z)` in `Dial C`. -/
@[simps!]
def associator (X Y Z : Dial C) : tensorObj (tensorObj X Y) Z ≅ tensorObj X (tensorObj Y Z)

(X.associator Y Z).inv.f =
  CategoryTheory.Limits.prod.lift
    (CategoryTheory.Limits.prod.lift CategoryTheory.Limits.prod.fst
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst))
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd)


theorem isBigO_comm : (fun x => f₁ x - f₂ x) =O[l] g ↔ (fun x => f₂ x - f₁ x) =O[l] g

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


/-- A module which satisfies the universal property is projective: If all surjections of
`R`-modules `(P →₀ R) →ₗ[R] P` have `R`-linear left inverse maps, then `P` is
projective. -/
theorem Projective.of_lifting_property'' {R : Type u} [Semiring R] {P : Type v} [AddCommMonoid P]
    [Module R P] (huniv : ∀ (f : (P →₀ R) →ₗ[R] P), Function.Surjective f →
      ∃ h : P →ₗ[R] (P →₀ R), f.comp h = .id) :
    Projective R P

(huniv : ∀ (f : (P →₀ R) →ₗ[R] P), Function.Surjective ⇑f → ∃ h, f ∘ₗ h = LinearMap.id)


{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(f : BoundedContinuousFunction α β)


/-- `Sum.inr` as a relation embedding into `Sum.Lex r s`. -/
@[simps]
def sumLexInr (r : α → α → Prop) (s : β → β → Prop) : s ↪r Sum.Lex r s

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

(RelEmbedding.sumLexInr r s) val = Sum.inr val


@[to_additive] lemma mulEnergy_eq_sum_sq [Fintype α] (s t : Finset α) :
    Eₘ[s, t] = ∑ a, ((s ×ˢ t).filter fun (x, y) ↦ x * y = a).card ^ 2

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

s.mulEnergy t =
  ∑ a : α,
    (Finset.filter
          (fun x =>
            match x with
            | (x, y) => x * y = a)
          (s ×ˢ t)).card ^
      2


@[simp]
theorem kernelZeroIsoSource_inv :
    kernelZeroIsoSource.inv = kernel.lift (0 : X ⟶ Y) (𝟙 X) (by simp)

CategoryTheory.Limits.kernelZeroIsoSource.inv = CategoryTheory.Limits.kernel.lift 0 (𝟙 X) ⋯


/-- The (identity) equivalence between `Cᴹᵒᵖ` and `C`. -/
@[simps!] def MonoidalOpposite.unmopEquiv : Cᴹᵒᵖ ≌ C

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

(CategoryTheory.MonoidalOpposite.unmopEquiv C).functor.obj self = self.unmop


theorem coeff_apply (h : IsAdjoinRootMonic S f) (z : S) (i : ℕ) :
    h.coeff z i = if hi : i < natDegree f then h.basis.repr z ⟨i, hi⟩ else 0

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)
(z : S)
(i : ℕ)

h.coeff z i = if hi : i < f.natDegree then (h.basis.repr z) ⟨i, hi⟩ else 0


@[to_additive (attr := simp)]
theorem prod_replicate (n : ℕ) (a : M) : (replicate n a).prod = a ^ n

{M : Type u_4}
[Monoid M]
(n : ℕ)
(a : M)


@[simp]
theorem rat_add_iff : LiouvilleWith p (r + x) ↔ LiouvilleWith p x

LiouvilleWith p (↑r + x) ↔ LiouvilleWith p x


@[simp]
theorem hasSum_conj {f : α → 𝕜} {x : 𝕜} : HasSum (fun x => conj (f x)) x ↔ HasSum f (conj x)

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

HasSum (fun x => (starRingEnd 𝕜) (f x)) x ↔ HasSum f ((starRingEnd 𝕜) x)


theorem pow_add_one' {m n : Nat} : m ^ (n + 1) = m * m ^ n


theorem smul_mono_right [SMul M α] [Preorder α] [CovariantClass M α HSMul.hSMul LE.le]
    (m : M) : Monotone (HSMul.hSMul m : α → α)

{M : Type u_2}
{α : Type u_3}
[SMul M α]
[Preorder α]
[CovariantClass M α HSMul.hSMul LE.le]
(m : M)


@[to_additive]
protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = pure a ∧ t = pure b ∧ a * b = 1

{α : Type u_2}
[OrderedAddCommGroup α]
{s t : Interval α}

s + t = 0 ↔ ∃ a b, s = Interval.pure a ∧ t = Interval.pure b ∧ a + b = 0


private theorem candidates_triangle (fA : f ∈ candidates X Y) : f (x, z) ≤ f (x, y) + f (y, z)

(fA : f ∈ GromovHausdorff.candidates X Y)


@[to_additive uniformContinuous_norm]
theorem uniformContinuous_norm' : UniformContinuous (norm : E → ℝ)


theorem isLittleO_pow_pow_of_abs_lt_left {r₁ r₂ : ℝ} (h : |r₁| < |r₂|) :
    (fun n : ℕ ↦ r₁ ^ n) =o[atTop] fun n ↦ r₂ ^ n

(fun n => r₁ ^ n) =o[Filter.atTop] fun n => r₂ ^ n


theorem const_neg (x : β) : const (-x) = -const x

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(x : β)

CauSeq.const abv (-x) = -CauSeq.const abv x


@[simp]
theorem toComplex_eq_zero {x : ℤ[i]} : (x : ℂ) = 0 ↔ x = 0


@[simp]
theorem comp_toCoalgHom (φ₁ : B →ₐc[R] C) (φ₂ : A →ₐc[R] B) :
    φ₁.comp φ₂ = (φ₁ : B →ₗc[R] C).comp (φ₂ : A →ₗc[R] B)

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


@[simp]
theorem takeWhile_eq_nil_iff : takeWhile p l = [] ↔ ∀ hl : 0 < l.length, ¬p (l.nthLe 0 hl)

{α : Type u}
{p : α → Bool}
{l : List α}

List.takeWhile p l = [] ↔ ∀ (hl : 0 < l.length), ¬p (l.nthLe 0 hl) = true