/-- Variant of `AlgebraicGeometry.localRingHom_comp_stalkIso` for `Spec.map`. -/
@[elementwise]
lemma Scheme.localRingHom_comp_stalkIso {R S : CommRingCat.{u}} (f : R ⟶ S) (p : PrimeSpectrum S) :
    (StructureSheaf.stalkIso R (PrimeSpectrum.comap f p)).hom ≫
      (CommRingCat.ofHom <| Localization.localRingHom
        (PrimeSpectrum.comap f p).asIdeal p.asIdeal f rfl) ≫
      (StructureSheaf.stalkIso S p).inv = (Spec.map f).stalkMap p

{R S : CommRingCat}
(f : R ⟶ S)
(p : PrimeSpectrum ↑S)

(AlgebraicGeometry.StructureSheaf.stalkIso (↑R) ((PrimeSpectrum.comap f) p)).hom ≫
    CommRingCat.ofHom (Localization.localRingHom ((PrimeSpectrum.comap f) p).asIdeal p.asIdeal f ⋯) ≫
      (AlgebraicGeometry.StructureSheaf.stalkIso (↑S) p).inv =
  AlgebraicGeometry.Scheme.Hom.stalkMap (AlgebraicGeometry.Spec.map f) p


@[to_additive]
theorem smul_finset_union : a • (s₁ ∪ s₂) = a • s₁ ∪ a • s₂

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


/-- If a set is equal to its sequential closure, then it is sequentially closed. -/
theorem isSeqClosed_of_seqClosure_eq {s : Set X} (hs : seqClosure s = s) : IsSeqClosed s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(hs : seqClosure s = s)


theorem norm_inf_le_add (x y : α) : ‖x ⊓ y‖ ≤ ‖x‖ + ‖y‖

{α : Type u_1}
[NormedLatticeAddCommGroup α]
(x y : α)

‖x ⊓ y‖ ≤ ‖x‖ + ‖y‖


@[to_additive (attr := simp)]
theorem unit_spec (h : IsUnit a) : ↑h.unit = a

{M : Type u_1}
[Monoid M]
{a : M}
(h : IsUnit a)


@[to_additive (attr := simp)]
theorem mul_seq {f g : FreeSemigroup (α → β)} {x : FreeSemigroup α} :
    f * g <*> x = (f <*> x) * (g <*> x)

{α β : Type u}
{f g : FreeAddSemigroup (α → β)}
{x : FreeAddSemigroup α}

(Seq.seq (f + g) fun x_1 => x) = (Seq.seq f fun x_1 => x) + Seq.seq g fun x_1 => x


@[to_additive]
lemma inf_mul_right [SemilatticeInf β] [OrderTop β] (s t : Finset α) (f : α → β) :
    inf (s * t) f = inf t fun y ↦ inf s (f <| · * y)

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

(s + t).inf f = t.inf fun y => s.inf fun x => f (x + y)


@[simp]
theorem rTensor_comp_lTensor (f : M →ₗ[R] P) (g : N →ₗ[R] Q) :
    (f.rTensor Q).comp (g.lTensor M) = map f g

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
(f : M →ₗ[R] P)
(g : N →ₗ[R] Q)

LinearMap.rTensor Q f ∘ₗ LinearMap.lTensor M g = TensorProduct.map f g


@[simp] theorem get?_size {a : Array α} : a[a.size]? = none


theorem subsemiringClosure_toAddSubmonoid :
    M.subsemiringClosure.toAddSubmonoid = AddSubmonoid.closure (M : Set R)

{R : Type u}
[NonAssocSemiring R]
(M : Submonoid R)

M.subsemiringClosure.toAddSubmonoid = AddSubmonoid.closure ↑M


/--
`TopCat.toCondensedSet` yields a functor from `TopCat.{u+1}` to `CondensedSet.{u}`.
-/
@[simps]
noncomputable def topCatToCondensedSet : TopCat.{u+1} ⥤ CondensedSet.{u}

∀ {X Y : TopCat} (f : X ⟶ Y) (x : CompHausᵒᵖ) (g : ((fun X => X.toCondensedSet) X).val.obj x),
  (topCatToCondensedSet.map f).val.app x g = ContinuousMap.comp f g


@[to_additive (attr := simp)]
theorem isBoundedUnder_ge_inv [OrderedCommGroup α] {l : Filter β} {u : β → α} :
    (IsBoundedUnder (· ≥ ·) l fun x => (u x)⁻¹) ↔ IsBoundedUnder (· ≤ ·) l u

{α : Type u_1}
{β : Type u_2}
[OrderedCommGroup α]
{l : Filter β}
{u : β → α}

(Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) l fun x => (u x)⁻¹) ↔ Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l u


/-- Local equivalence between subsets `source` and `target` of `α` and `β` respectively. The
(global) maps `toFun : α → β` and `invFun : β → α` map `source` to `target` and conversely, and are
inverse to each other there. The values of `toFun` outside of `source` and of `invFun` outside of
`target` are irrelevant. -/
structure PartialEquiv (α : Type*) (β : Type*) where
  /-- The global function which has a partial inverse. Its value outside of the `source` subset is
  irrelevant. -/
  toFun : α → β
  /-- The partial inverse to `toFun`. Its value outside of the `target` subset is irrelevant. -/
  invFun : β → α
  /-- The domain of the partial equivalence. -/
  source : Set α
  /-- The codomain of the partial equivalence. -/
  target : Set β
  /-- The proposition that elements of `source` are mapped to elements of `target`. -/
  map_source' : ∀ ⦃x⦄, x ∈ source → toFun x ∈ target
  /-- The proposition that elements of `target` are mapped to elements of `source`. -/
  map_target' : ∀ ⦃x⦄, x ∈ target → invFun x ∈ source
  /-- The proposition that `invFun` is a left-inverse of `toFun` on `source`. -/
  left_inv' : ∀ ⦃x⦄, x ∈ source → invFun (toFun x) = x
  /-- The proposition that `invFun` is a right-inverse of `toFun` on `target`. -/
  right_inv' : ∀ ⦃x⦄, x ∈ target → toFun (invFun x) = x

{α : Type u_5}
{β : Type u_6}
(self : PartialEquiv α β)
⦃x : β⦄

x ∈ self.target → ↑self (self.invFun x) = x


@[simp]
theorem nthRoots_two_eq_zero_iff {r : R} : nthRoots 2 r = 0 ↔ ¬IsSquare r

{R : Type u}
[CommRing R]
[IsDomain R]
{r : R}

Polynomial.nthRoots 2 r = 0 ↔ ¬IsSquare r


private theorem toIxxMod_trans {x₁ x₂ x₃ x₄ : α}
    (h₁₂₃ : toIcoMod hp x₁ x₂ ≤ toIocMod hp x₁ x₃ ∧ ¬toIcoMod hp x₃ x₂ ≤ toIocMod hp x₃ x₁)
    (h₂₃₄ : toIcoMod hp x₂ x₄ ≤ toIocMod hp x₂ x₃ ∧ ¬toIcoMod hp x₃ x₄ ≤ toIocMod hp x₃ x₂) :
    toIcoMod hp x₁ x₄ ≤ toIocMod hp x₁ x₃ ∧ ¬toIcoMod hp x₃ x₄ ≤ toIocMod hp x₃ x₁


theorem biSup_add' {ι : Sort*} {p : ι → Prop} (h : ∃ i, p i) {f : ι → ℝ≥0∞} :
    (⨆ (i) (_ : p i), f i) + a = ⨆ (i) (_ : p i), f i + a

{a : ℝ≥0∞}
{ι : Sort u_4}
{p : ι → Prop}
(h : ∃ i, p i)
{f : ι → ℝ≥0∞}


theorem natDegree_intCast_le (n : ℤ) : natDegree (n : R[X]) ≤ 0


@[simp]
theorem ghostMap_apply (x : 𝕎 R) (n : ℕ) : ghostMap x n = ghostComponent n x

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

WittVector.ghostMap x n = (WittVector.ghostComponent n) x


theorem selfZPow_neg_mul (d : ℤ) : selfZPow x B (-d) * selfZPow x B d = 1

{R : Type u_1}
[CommRing R]
(x : R)
(B : Type u_2)
[CommRing B]
[Algebra R B]
[IsLocalization.Away x B]
(d : ℤ)


@[simp]
theorem preimage_id : F.preimage (𝟙 (F.obj X)) = 𝟙 X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
{X : C}
[F.Full]
[F.Faithful]

F.preimage (CategoryTheory.CategoryStruct.id (F.obj X)) = CategoryTheory.CategoryStruct.id X


protected theorem IntegrableAtFilter.norm (hf : IntegrableAtFilter f l μ) :
    IntegrableAtFilter (fun x => ‖f x‖) l μ

(hf : MeasureTheory.IntegrableAtFilter f l μ)

MeasureTheory.IntegrableAtFilter (fun x => ‖f x‖) l μ


theorem uniqueDiffWithinAt_congr (st : 𝓝[s] x = 𝓝[t] x) :
    UniqueDiffWithinAt 𝕜 s x ↔ UniqueDiffWithinAt 𝕜 t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s t : Set E}
(st : 𝓝[s] x = 𝓝[t] x)


@[simp]
theorem mk_rightMovesEquiv {x y L R hL hR} : (@Relabelling.mk x y L R hL hR).rightMovesEquiv = R

{hL : (i : x.LeftMoves) → (x.moveLeft i).Relabelling (y.moveLeft (L i))}

{hR : (j : x.RightMoves) → (x.moveRight j).Relabelling (y.moveRight (R j))}

(SetTheory.PGame.Relabelling.mk L R hL hR).rightMovesEquiv = R


theorem Filter.HasBasis.clusterPt_iff {ιX ιF} {pX : ιX → Prop} {sX : ιX → Set X} {pF : ιF → Prop}
    {sF : ιF → Set X} {F : Filter X} (hX : (𝓝 x).HasBasis pX sX) (hF : F.HasBasis pF sF) :
    ClusterPt x F ↔ ∀ ⦃i⦄, pX i → ∀ ⦃j⦄, pF j → (sX i ∩ sF j).Nonempty

{X : Type u}
{x : X}
[TopologicalSpace X]
{ιX : Sort u_3}
{ιF : Sort u_4}
{pX : ιX → Prop}
{sX : ιX → Set X}
{pF : ιF → Prop}
{sF : ιF → Set X}
{F : Filter X}
(hX : (𝓝 x).HasBasis pX sX)
(hF : F.HasBasis pF sF)

ClusterPt x F ↔ ∀ ⦃i : ιX⦄, pX i → ∀ ⦃j : ιF⦄, pF j → (sX i ∩ sF j).Nonempty


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

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

↑((MulEquiv.subgroupCongr h).symm x) = ↑x


theorem not_mem_range_self {n : ℕ} : n ∉ range n


@[fun_prop]
theorem Continuous.rexp (h : Continuous f) : Continuous fun y ↦ exp (f y)

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℝ}
(h : Continuous f)


theorem valuation_eq_one_iff (a : A) : IsUnit a ↔ A.valuation a = 1

{K : Type u}
[Field K]
(A : ValuationSubring K)
(a : ↥A)


theorem add_mk (a b c d) : (mk a b : Localization M) + mk c d =
    mk ((b : R) * c + (d : R) * a) (b * d)

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(a : R)
(b : ↥M)
(c : R)
(d : ↥M)

Localization.mk a b + Localization.mk c d = Localization.mk (↑b * c + ↑d * a) (b * d)


@[simp]
theorem drop_drop (n m : ℕ) (s : Stream' α) : drop n (drop m s) = drop (n + m) s

Stream'.drop n (Stream'.drop m s) = Stream'.drop (n + m) s


theorem pow_mul_divByMonic_rootMultiplicity_eq (p : R[X]) (a : R) :
    (X - C a) ^ rootMultiplicity a p * (p /ₘ (X - C a) ^ rootMultiplicity a p) = p

{R : Type u}
[Ring R]
(p : R[X])
(a : R)

(Polynomial.X - Polynomial.C a) ^ Polynomial.rootMultiplicity a p *
    (p /ₘ (Polynomial.X - Polynomial.C a) ^ Polynomial.rootMultiplicity a p) =
  p


@[to_additive]
theorem prod_hom_rel [CommMonoid β] (s : Multiset ι) {r : α → β → Prop} {f : ι → α} {g : ι → β}
    (h₁ : r 1 1) (h₂ : ∀ ⦃a b c⦄, r b c → r (f a * b) (g a * c)) :
    r (s.map f).prod (s.map g).prod

(h₂ : ∀ ⦃a : ι⦄ ⦃b : α⦄ ⦃c : β⦄, r b c → r (f a * b) (g a * c))

r (Multiset.map f s).prod (Multiset.map g s).prod


/-- The sequence `log ∘ stirlingSeq ∘ succ` is monotone decreasing -/
theorem log_stirlingSeq'_antitone : Antitone (Real.log ∘ stirlingSeq ∘ succ)

Antitone (Real.log ∘ Stirling.stirlingSeq ∘ Nat.succ)


protected theorem ne_of_gt {a b : Fin n} (h : a < b) : b ≠ a


/-- An object is initial if and only if its fiber is empty. -/
lemma initial_iff_fiber_empty (X : C) : Nonempty (IsInitial X) ↔ IsEmpty (F.obj X)

(F : CategoryTheory.Functor C FintypeCat)

Nonempty (CategoryTheory.Limits.IsInitial X) ↔ IsEmpty ↑(F.obj X)


theorem card_pi (m : Multiset α) (t : ∀ a, Multiset (β a)) :
    card (pi m t) = prod (m.map fun a => card (t a))

{α : Type u_1}
[DecidableEq α]
{β : α → Type u_2}
(m : Multiset α)
(t : (a : α) → Multiset (β a))

Multiset.card (m.pi t) = (Multiset.map (fun a => Multiset.card (t a)) m).prod


theorem totallyBounded_iff_filter {s : Set α} :
    TotallyBounded s ↔ ∀ f, NeBot f → f ≤ 𝓟 s → ∃ c ≤ f, Cauchy c

{α : Type u}
[uniformSpace : UniformSpace α]
{s : Set α}

TotallyBounded s ↔ ∀ (f : Filter α), f.NeBot → f ≤ 𝓟 s → ∃ c ≤ f, Cauchy c


@[simp]
theorem cofan_mk_inj {f : β → C} (P : C) (p : ∀ b, f b ⟶ P) (j : β) :
    (Cofan.mk P p).inj j = p j

{β : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : β → C}
(P : C)
(p : (b : β) → f b ⟶ P)
(j : β)

(CategoryTheory.Limits.Cofan.mk P p).inj j = p j


/-- Construct a comonad isomorphism from a natural isomorphism of functors where the forward
direction is a comonad morphism. -/
@[simps]
def ComonadIso.mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N)
    (f_ε : ∀ (X : C), f.hom.app X ≫ N.ε.app X = M.ε.app X := by aesop_cat)
    (f_δ : ∀ (X : C), f.hom.app X ≫ N.δ.app X =
    M.δ.app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X) := by aesop_cat) : M ≅ N

(f_ε : ∀ (X : C), CategoryTheory.CategoryStruct.comp (f.hom.app X) (N.ε.app X) = M.ε.app X := by aesop_cat)

(f_δ :
  ∀ (X : C),
    CategoryTheory.CategoryStruct.comp (f.hom.app X) (N.δ.app X) =
      CategoryTheory.CategoryStruct.comp (M.δ.app X)
        (CategoryTheory.CategoryStruct.comp (f.hom.app (M.obj X)) (N.map (f.hom.app X))) := by
  aesop_cat)

(CategoryTheory.ComonadIso.mk f f_ε f_δ).inv.toNatTrans = f.inv


@[simp] theorem lcm_one_right (m : Nat) : lcm m 1 = m


theorem map_const [NeBot f] {c : β} : (f.map fun _ => c) = pure c

{α : Type u}
{β : Type v}
{f : Filter α}
[f.NeBot]
{c : β}


/-- If `x` is an element of a submodule `s` of a normed group `E`, its norm in `s` is equal to its
norm in `E`. -/
@[simp]
theorem coe_norm [Ring 𝕜] [SeminormedAddCommGroup E] [Module 𝕜 E] {s : Submodule 𝕜 E}
    (x : s) : ‖x‖ = ‖(x : E)‖

{𝕜 : Type u_1}
{E : Type u_2}
[Ring 𝕜]
[SeminormedAddCommGroup E]
[Module 𝕜 E]
{s : Submodule 𝕜 E}
(x : ↥s)


/-- `x` is in a monomial ideal generated by variables `X` iff every element of its support
has a component in `s`. -/
theorem mem_ideal_span_X_image {x : MvPolynomial σ R} {s : Set σ} :
    x ∈ Ideal.span (MvPolynomial.X '' s : Set (MvPolynomial σ R)) ↔
      ∀ m ∈ x.support, ∃ i ∈ s, (m : σ →₀ ℕ) i ≠ 0

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
{x : MvPolynomial σ R}
{s : Set σ}

x ∈ Ideal.span (MvPolynomial.X '' s) ↔ ∀ m ∈ x.support, ∃ i ∈ s, m i ≠ 0


lemma LeftFractionRel.op {X Y : C} {z₁ z₂ : W.LeftFraction X Y}
    (h : LeftFractionRel z₁ z₂) : RightFractionRel z₁.op z₂.op

(h : CategoryTheory.MorphismProperty.LeftFractionRel z₁ z₂)


theorem mul_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a * b)

(U : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ)

(a b : (x : ↥(Opposite.unop U)) → HomogeneousLocalization.AtPrime 𝒜 (↑x).asHomogeneousIdeal.toIdeal)

(ha : (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction 𝒜).pred a)

(hb : (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction 𝒜).pred b)

(AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction 𝒜).pred (a * b)


protected theorem traverse_eq_map_id {α β} (f : α → β) (x : σ ⊕ α) :
    Sum.traverse ((pure : _ → Id _) ∘ f) x = (pure : _ → Id _) (f <$> x)

{σ α β : Type u}
(f : α → β)
(x : σ ⊕ α)

Sum.traverse (pure ∘ f) x = pure (f <$> x)


/-- Primitive element theorem for finite dimensional extension of a finite field. -/
theorem exists_primitive_element_of_finite_bot [Finite F] [FiniteDimensional F E] :
    ∃ α : E, F⟮α⟯ = ⊤

(F : Type u_1)
[Field F]
(E : Type u_2)
[Field E]
[Algebra F E]
[Finite F]
[FiniteDimensional F E]

∃ α, F⟮α⟯ = ⊤


/-- If `φ : S₁ ⟶ S₂` is a morphism of short complexes such that `φ.τ₁` is epi, `φ.τ₂` is an iso
and `φ.τ₃` is mono, then a left homology data for `S₁` induces a left homology data for `S₂` with
the same `K` and `H` fields. The inverse construction is `ofEpiOfIsIsoOfMono'`. -/
@[simps]
noncomputable def ofEpiOfIsIsoOfMono (φ : S₁ ⟶ S₂) (h : LeftHomologyData S₁)
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] : LeftHomologyData S₂

(CategoryTheory.ShortComplex.LeftHomologyData.ofEpiOfIsIsoOfMono φ h).K = h.K


theorem HasBasis.map (f : α → β) (hl : l.HasBasis p s) : (l.map f).HasBasis p fun i => f '' s i

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(f : α → β)
(hl : l.HasBasis p s)

(Filter.map f l).HasBasis p fun i => f '' s i


theorem toIocDiv_eq_of_sub_zsmul_mem_Ioc (h : b - n • p ∈ Set.Ioc a (a + p)) :
    toIocDiv hp a b = n

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
{a b : α}
{n : ℤ}
(h : b - n • p ∈ Set.Ioc a (a + p))


lemma uniformContinuous_inr : UniformContinuous (Sum.inr : β → α ⊕ β)

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[UniformSpace β]


@[simp]
theorem succ_eq_succ : Order.succ = succ


theorem Mem.leftUnique : Relator.LeftUnique ((· ∈ ·) : α → Option α → Prop)


@[simp]
theorem sum_apply {ι : Type*} (Q : ι → QuadraticMap R M N) (s : Finset ι) (x : M) :
    (∑ i ∈ s, Q i) x = ∑ i ∈ s, Q i x

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
{ι : Type u_8}
(Q : ι → QuadraticMap R M N)
(s : Finset ι)
(x : M)


/-- If `f` is a multilinear map, then `f.toLinearMap m i` is the linear map obtained by fixing all
coordinates but `i` equal to those of `m`, and varying the `i`-th coordinate. -/
@[simps]
def toLinearMap [DecidableEq ι] (m : ∀ i, M₁ i) (i : ι) : M₁ i →ₗ[R] M₂

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
[DecidableEq ι]
(m : (i : ι) → M₁ i)
(i : ι)
(x : M₁ i)

(f.toLinearMap m i) x = f (Function.update m i x)


theorem isLittleO_im_pow_exp_re (hl : IsExpCmpFilter l) (n : ℕ) :
    (fun z : ℂ => z.im ^ n) =o[l] fun z => Real.exp z.re

{l : Filter ℂ}
(hl : Complex.IsExpCmpFilter l)
(n : ℕ)

(fun z => z.im ^ n) =o[l] fun z => Real.exp z.re


theorem dist_triangle_left (x y z : α) : dist x y ≤ dist z x + dist z y

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


theorem inseparable_iff_closure_eq : (x ~ᵢ y) ↔ closure ({x} : Set X) = closure {y}

{X : Type u_1}
[TopologicalSpace X]
{x y : X}


theorem num_div_dvd (p : K[X]) {q : K[X]} (hq : q ≠ 0) :
    num (algebraMap _ _ p / algebraMap _ _ q) ∣ p

{K : Type u}
[Field K]
(p : K[X])
{q : K[X]}
(hq : q ≠ 0)

((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q).num ∣ p


@[simp]
theorem ofIsoColimit_desc {r t : Cocone F} (P : IsColimit r) (i : r ≅ t) (s) :
    (P.ofIsoColimit i).desc s = i.inv.hom ≫ P.desc s

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


theorem nth_le_nth_of_lt_card (hf : (setOf p).Finite) {m n : ℕ} (h : m ≤ n)
    (hn : n < hf.toFinset.card) : nth p m ≤ nth p n

{p : ℕ → Prop}
(hf : (setOf p).Finite)
{m n : ℕ}
(h : m ≤ n)
(hn : n < hf.toFinset.card)


@[elab_as_elim]
protected theorem ListBlank.induction_on {Γ} [Inhabited Γ] {p : ListBlank Γ → Prop}
    (q : ListBlank Γ) (h : ∀ a, p (ListBlank.mk a)) : p q

(h : ∀ (a : List Γ), p (Turing.ListBlank.mk a))


lemma toFiniteAux_eq_zero_iff [SFinite μ] : μ.toFiniteAux = 0 ↔ μ = 0

{α : Type u_1}
{mα : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.SFinite μ]


@[to_additive (attr := simp)]
theorem map_id (S : Submonoid M) : S.map (MonoidHom.id M) = S

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


@[norm_cast]
theorem coe_multiset_prod (s : Multiset ℚ≥0) : (s.prod : ℚ) = (s.map (↑)).prod

↑s.prod = (Multiset.map NNRat.cast s).prod


theorem hasDerivAt_cosh (x : ℝ) : HasDerivAt cosh (sinh x) x


/-- "iff" version of `Multipliable.of_nat_of_neg_add_one`. -/
@[to_additive "\"iff\" version of `Summable.of_nat_of_neg_add_one`."]
lemma multipliable_int_iff_multipliable_nat_and_neg_add_one {f : ℤ → G} : Multipliable f ↔
    (Multipliable fun n : ℕ ↦ f n) ∧ (Multipliable fun n : ℕ ↦ f (-(n + 1)))

{G : Type u_2}
[AddCommGroup G]
[UniformSpace G]
[UniformAddGroup G]
[CompleteSpace G]
{f : ℤ → G}

Summable f ↔ (Summable fun n => f ↑n) ∧ Summable fun n => f (-(↑n + 1))


/-- For a continuous real linear map `f`, if one controls the norm of every `f x`, `‖x‖₊ = 1`, then
one controls the norm of `f`. -/
theorem opNNNorm_le_of_unit_nnnorm [NormedSpace ℝ E] [NormedSpace ℝ F] {f : E →L[ℝ] F} {C : ℝ≥0}
    (hf : ∀ x, ‖x‖₊ = 1 → ‖f x‖₊ ≤ C) : ‖f‖₊ ≤ C

{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NormedSpace ℝ E]
[NormedSpace ℝ F]
{f : E →L[ℝ] F}
{C : ℝ≥0}
(hf : ∀ (x : E), ‖x‖₊ = 1 → ‖f x‖₊ ≤ C)


theorem isIntegralCurveOn_Ioo_eqOn_of_contMDiff_boundaryless [BoundarylessManifold I M]
    (ht₀ : t₀ ∈ Ioo a b)
    (hv : ContMDiff I I.tangent 1 (fun x ↦ (⟨x, v x⟩ : TangentBundle I M)))
    (hγ : IsIntegralCurveOn γ v (Ioo a b)) (hγ' : IsIntegralCurveOn γ' v (Ioo a b))
    (h : γ t₀ = γ' t₀) : EqOn γ γ' (Ioo a b)

(hv : ContMDiff I I.tangent 1 fun x => { proj := x, snd := v x })

(hγ : IsIntegralCurveOn γ v (Set.Ioo a b))

(hγ' : IsIntegralCurveOn γ' v (Set.Ioo a b))


theorem DifferentiableOn.mono (h : DifferentiableOn 𝕜 f t) (st : s ⊆ t) : DifferentiableOn 𝕜 f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s t : Set E}
(h : DifferentiableOn 𝕜 f t)
(st : s ⊆ t)


theorem setLaverage_congr (h : s =ᵐ[μ] t) : ⨍⁻ x in s, f x ∂μ = ⨍⁻ x in t, f x ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
{f : α → ℝ≥0∞}
(h : s =ᵐ[μ] t)

⨍⁻ (x : α) in s, f x ∂μ = ⨍⁻ (x : α) in t, f x ∂μ


/-- This is [grinberg_clifford_2016][] Theorem 13 -/
theorem contractRight_contractRight (x : CliffordAlgebra Q) : x⌊d⌊d = 0

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(d : Module.Dual R M)
(x : CliffordAlgebra Q)

(CliffordAlgebra.contractRight ((CliffordAlgebra.contractRight x) d)) d = 0


protected theorem map_neg : f (-x) = -f x

{R : Type u_4}
{S : Type u_5}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
(f : R ≃+* S)
(x : R)


/-- An n-ary version of `Set.mul_subset_mul`. -/
@[to_additive " An n-ary version of `Set.add_subset_add`. "]
theorem multiset_prod_subset_multiset_prod (t : Multiset ι) (f₁ f₂ : ι → Set α)
    (hf : ∀ i ∈ t, f₁ i ⊆ f₂ i) : (t.map f₁).prod ⊆ (t.map f₂).prod

{ι : Type u_1}
{α : Type u_2}
[CommMonoid α]
(t : Multiset ι)
(f₁ f₂ : ι → Set α)
(hf : ∀ i ∈ t, f₁ i ⊆ f₂ i)

(Multiset.map f₁ t).prod ⊆ (Multiset.map f₂ t).prod


@[to_additive]
theorem mul_ciSup_le [CovariantClass α α (· * ·) (· ≤ ·)] {a : α} {g : α} {h : ι → α}
    (H : ∀ j, g * h j ≤ a) : g * iSup h ≤ a

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


@[to_additive (attr := simp)]
theorem lift_comp_swap (f : M →* P) (g : N →* P) : (lift f g).comp (swap N M) = lift g f

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass N]
[AddMonoid P]
(f : M →+ P)
(g : N →+ P)

(AddMonoid.Coprod.lift f g).comp (AddMonoid.Coprod.swap N M) = AddMonoid.Coprod.lift g f


/-- The biUnion of a family of preconnected sets is preconnected if the graph determined by
whether two sets intersect is preconnected. -/
theorem IsConnected.biUnion_of_reflTransGen {ι : Type*} {t : Set ι} {s : ι → Set α}
    (ht : t.Nonempty) (H : ∀ i ∈ t, IsConnected (s i))
    (K : ∀ i, i ∈ t → ∀ j, j ∈ t → ReflTransGen (fun i j : ι => (s i ∩ s j).Nonempty ∧ i ∈ t) i j) :
    IsConnected (⋃ n ∈ t, s n)

(K : ∀ i ∈ t, ∀ j ∈ t, Relation.ReflTransGen (fun i j => (s i ∩ s j).Nonempty ∧ i ∈ t) i j)


@[simp]
theorem ascPochhammer_eval_one (S : Type*) [Semiring S] (n : ℕ) :
    (ascPochhammer S n).eval (1 : S) = (n ! : S)

Polynomial.eval 1 (ascPochhammer S n) = ↑n.factorial


theorem StrictMono.wellFoundedGT [WellFoundedGT β] (hf : StrictMono f) : WellFoundedGT α

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
[WellFoundedGT β]
(hf : StrictMono f)


theorem PrimePair.I_isPrime (IF : PrimePair P) : IsPrime IF.I

{P : Type u_1}
[Preorder P]
(IF : Order.Ideal.PrimePair P)


theorem geom_mean_le_arith_mean4_weighted (w₁ w₂ w₃ w₄ p₁ p₂ p₃ p₄ : ℝ≥0) :
    w₁ + w₂ + w₃ + w₄ = 1 →
      p₁ ^ (w₁ : ℝ) * p₂ ^ (w₂ : ℝ) * p₃ ^ (w₃ : ℝ) * p₄ ^ (w₄ : ℝ) ≤
        w₁ * p₁ + w₂ * p₂ + w₃ * p₃ + w₄ * p₄

w₁ + w₂ + w₃ + w₄ = 1 → p₁ ^ ↑w₁ * p₂ ^ ↑w₂ * p₃ ^ ↑w₃ * p₄ ^ ↑w₄ ≤ w₁ * p₁ + w₂ * p₂ + w₃ * p₃ + w₄ * p₄


theorem NeBot.smul_zero_nonneg (hf : f.NeBot) : 0 ≤ f • (0 : Filter β)

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
{f : Filter α}
(hf : f.NeBot)


/-- Given `K : HomologicalComplex C c'` and `e : c.Embedding c'` (satisfying `[e.IsRelIff]`),
this is the homological complex in `HomologicalComplex C c` obtained by restriction. -/
@[simps]
def restriction : HomologicalComplex C c


theorem le_def : p ≤ q ↔ (p : E → ℝ) ≤ q

{E : Type u_4}
[AddGroup E]
{p q : NonarchAddGroupSeminorm E}

p ≤ q ↔ ⇑p ≤ ⇑q


/-- Continuous `StarAlgHom`s from the topological closure of a `StarSubalgebra` whose
compositions with the `StarSubalgebra.inclusion` map agree are, in fact, equal. -/
theorem _root_.StarAlgHom.ext_topologicalClosure [T2Space B] {S : StarSubalgebra R A}
    {φ ψ : S.topologicalClosure →⋆ₐ[R] B} (hφ : Continuous φ) (hψ : Continuous ψ)
    (h :
      φ.comp (inclusion (le_topologicalClosure S)) = ψ.comp (inclusion (le_topologicalClosure S))) :
    φ = ψ

(h : φ.comp (StarSubalgebra.inclusion ⋯) = ψ.comp (StarSubalgebra.inclusion ⋯))


@[simp, norm_cast]
theorem coe_nonempty {s : Finset α} : (s : Set α).Nonempty ↔ s.Nonempty


/-- A nonsingular rational point on `W'`. -/
@[ext]
structure Point where
  /-- The point class underlying a nonsingular rational point on `W'`. -/
  {point : PointClass R}
  /-- The nonsingular condition underlying a nonsingular rational point on `W'`. -/
  (nonsingular : W'.NonsingularLift point)

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(self : W'.Point)


theorem pure_defined (p : Set α) (x : β) : p ⊆ (@PFun.pure α _ x).Dom

{α : Type u_1}
{β : Type u_2}
(p : Set α)
(x : β)


theorem range_toLin_eq_top [DecidableEq n] (A : Matrix n n R) (hA : IsUnit A.det) :
    LinearMap.range (toLin b b A) = ⊤

{n : Type u_1}
[Fintype n]
{R : Type u_2}
{M : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
(b : Basis n R M)
[DecidableEq n]
(A : Matrix n n R)
(hA : IsUnit A.det)

LinearMap.range ((Matrix.toLin b b) A) = ⊤


lemma coe_span_smul {R' M' : Type*} [CommSemiring R'] [AddCommMonoid M'] [Module R' M']
    (s : Set R') (N : Submodule R' M') :
    (Ideal.span s : Set R') • N = s • N

{R' : Type u_5}
{M' : Type u_6}
[CommSemiring R']
[AddCommMonoid M']
[Module R' M']
(s : Set R')
(N : Submodule R' M')


theorem measure_union (hd : Disjoint s₁ s₂) (h : MeasurableSet s₂) : μ (s₁ ∪ s₂) = μ s₁ + μ s₂

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s₁ s₂ : Set α}
(hd : Disjoint s₁ s₂)
(h : MeasurableSet s₂)

μ (s₁ ∪ s₂) = μ s₁ + μ s₂


theorem map_pmap {p : α → Prop} (g : β → γ) (f : ∀ a, p a → β) (l H) :
    map g (pmap f l H) = pmap (fun a h => g (f a h)) l H

{α : Type u}
{β : Type v}
{γ : Type w}
{p : α → Prop}
(g : β → γ)
(f : (a : α) → p a → β)
(l : List α)
(H : ∀ (a : α), a ∈ l → p a)

List.map g (List.pmap f l H) = List.pmap (fun a h => g (f a h)) l H


theorem mod_le (a b : Ordinal) : a % b ≤ a


/-- Reflection is involutive. -/
theorem reflection_involutive (s : AffineSubspace ℝ P) [Nonempty s]
    [HasOrthogonalProjection s.direction] : Function.Involutive (reflection s)

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


/-- The equivalence of functor categories induced by `leftOp` and `rightOp`.
-/
@[simps!]
def leftOpRightOpEquiv : (Cᵒᵖ ⥤ D)ᵒᵖ ≌ C ⥤ Dᵒᵖ

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

∀ {X Y : (CategoryTheory.Functor Cᵒᵖ D)ᵒᵖ} (η : X ⟶ Y) (X_1 : C),
  ((CategoryTheory.Functor.leftOpRightOpEquiv C D).functor.map η).app X_1 = (η.unop.app (Opposite.op X_1)).op


theorem liminf_le_iff {α β} [ConditionallyCompleteLinearOrder β] {f : Filter α} {u : α → β} {x : β}
    (h₁ : f.IsCoboundedUnder (· ≥ ·) u := by isBoundedDefault)
    (h₂ : f.IsBoundedUnder (· ≥ ·) u := by isBoundedDefault) :
    liminf u f ≤ x ↔ ∀ y > x, ∃ᶠ a in f, u a < y

(h₁ : Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) f u := by isBoundedDefault)

(h₂ : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f u := by isBoundedDefault)

Filter.liminf u f ≤ x ↔ ∀ y > x, ∃ᶠ (a : α) in f, u a < y


/-- An auxiliary type for the proof of Urysohn's lemma: a pair of a closed set `C` and its
open neighborhood `U`, together with the assumption that `C` satisfies the property `P C`. The
latter assumption will make it possible to prove simultaneously both versions of Urysohn's lemma,
in normal spaces (with `P` always true) and in locally compact spaces (with `P = IsCompact`).
We put also in the structure the assumption that, for any such pair, one may find an intermediate
pair inbetween satisfying `P`, to avoid carrying it around in the argument. -/
structure CU {X : Type*} [TopologicalSpace X] (P : Set X → Prop) where
  /-- The inner set in the inductive construction towards Urysohn's lemma -/
  protected C : Set X
  /-- The outer set in the inductive construction towards Urysohn's lemma -/
  protected U : Set X
  protected P_C : P C
  protected closed_C : IsClosed C
  protected open_U : IsOpen U
  protected subset : C ⊆ U
  protected hP : ∀ {c u : Set X}, IsClosed c → P c → IsOpen u → c ⊆ u →
    ∃ v, IsOpen v ∧ c ⊆ v ∧ closure v ⊆ u ∧ P (closure v)

{X : Type u_2}
[TopologicalSpace X]
{P : Set X → Prop}
(self : Urysohns.CU P)


lemma tendsto_densityProcess_fst_atTop_ae_of_monotone (κ : Kernel α (γ × β)) [IsFiniteKernel κ]
    (n : ℕ) (a : α) (seq : ℕ → Set β) (hseq : Monotone seq) (hseq_iUnion : ⋃ i, seq i = univ) :
    ∀ᵐ x ∂(fst κ a), Tendsto (fun m ↦ densityProcess κ (fst κ) n a x (seq m)) atTop (𝓝 1)

(κ : ProbabilityTheory.Kernel α (γ × β))

∀ᵐ (x : γ) ∂κ.fst a, Filter.Tendsto (fun m => κ.densityProcess κ.fst n a x (seq m)) Filter.atTop (𝓝 1)


theorem comap_le_iff_le_map {f : α → β} : m'.comap f ≤ m ↔ m' ≤ m.map f

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{m' : MeasurableSpace β}
{f : α → β}

MeasurableSpace.comap f m' ≤ m ↔ m' ≤ MeasurableSpace.map f m


lemma insert_erase_invOn :
    Set.InvOn (insert a) (fun s ↦ erase s a) {s : Finset α | a ∈ s} {s : Finset α | a ∉ s}

Set.InvOn (insert a) (fun s => s.erase a) {s | a ∈ s} {s | a ∉ s}


@[to_additive]
theorem tendsto_finset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Finset ι) :
    (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) →
      Tendsto (fun b => ∏ c ∈ s, f c b) x (𝓝 (∏ c ∈ s, a c))

{ι : Type u_1}
{α : Type u_2}
{M : Type u_3}
[TopologicalSpace M]
[AddCommMonoid M]
[ContinuousAdd M]
{f : ι → α → M}
{x : Filter α}
{a : ι → M}
(s : Finset ι)

(∀ i ∈ s, Filter.Tendsto (f i) x (𝓝 (a i))) → Filter.Tendsto (fun b => ∑ c ∈ s, f c b) x (𝓝 (∑ c ∈ s, a c))


/-- If a point is in the affine span of a set, adding it to that set does not change the affine
span. -/
theorem affineSpan_insert_eq_affineSpan {p : P} {ps : Set P} (h : p ∈ affineSpan k ps) :
    affineSpan k (insert p ps) = affineSpan k ps

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p : P}
{ps : Set P}
(h : p ∈ affineSpan k ps)


@[simp]
theorem LHom.map_constants_comp_sumInl {f : α → β} :
    (L.lhomWithConstantsMap f).comp LHom.sumInl = L.lhomWithConstants β

(L : FirstOrder.Language)
{α : Type w'}
{β : Type u_1}
{f : α → β}

(L.lhomWithConstantsMap f).comp FirstOrder.Language.LHom.sumInl = L.lhomWithConstants β


theorem blockTriangular_reindex_iff {b : n → α} {e : m ≃ n} :
    (reindex e e M).BlockTriangular b ↔ M.BlockTriangular (b ∘ e)

{α : Type u_1}
{m : Type u_3}
{n : Type u_4}
{R : Type v}
[CommRing R]
{M : Matrix m m R}
[LT α]
{b : n → α}
{e : m ≃ n}

((Matrix.reindex e e) M).BlockTriangular b ↔ M.BlockTriangular (b ∘ ⇑e)


theorem image_update_Ioo_right (f : ∀ i, α i) (i : ι) (b : α i) :
    update f i '' Ioo (f i) b = Ioo f (update f i b)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
(f : (i : ι) → α i)
(i : ι)
(b : α i)

Function.update f i '' Set.Ioo (f i) b = Set.Ioo f (Function.update f i b)


@[simp]
theorem mem_filterMap (f : α → Option β) (s : Multiset α) {b : β} :
    b ∈ filterMap f s ↔ ∃ a, a ∈ s ∧ f a = some b

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

b ∈ Multiset.filterMap f s ↔ ∃ a ∈ s, f a = some b


theorem inv_Ioi {a : α} (ha : 0 < a) : (Ioi a)⁻¹ = Ioo 0 a⁻¹

{α : Type u_1}
[LinearOrderedField α]
{a : α}
(ha : 0 < a)


theorem toContinuousLinearMap_injective :
    Function.Injective (toContinuousLinearMap : _ → E →SL[σ₁₂] E₂)

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


theorem integral_add_measure {f : α → G} (hμ : Integrable f μ) (hν : Integrable f ν) :
    ∫ x, f x ∂(μ + ν) = ∫ x, f x ∂μ + ∫ x, f x ∂ν

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

∫ (x : α), f x ∂(μ + ν) = ∫ (x : α), f x ∂μ + ∫ (x : α), f x ∂ν


/-- Construct a lax prefunctor from a map on objects, and prefunctors between the corresponding
hom types. -/
@[simps]
def mkOfHomPrefunctors (F : B → C) (F' : (a : B) → (b : B) → Prefunctor (a ⟶ b) (F a ⟶ F b)) :
    PrelaxFunctorStruct B C

(F' : (a b : B) → (a ⟶ b) ⥤q (F a ⟶ F b))

∀ (a : B), (CategoryTheory.PrelaxFunctorStruct.mkOfHomPrefunctors F F').obj a = F a


theorem d_squared (n : ℕ) : objD X (n + 1) ≫ objD X n = 0

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
(X : CategoryTheory.SimplicialObject C)
(n : ℕ)

AlgebraicTopology.NormalizedMooreComplex.objD X (n + 1) ≫ AlgebraicTopology.NormalizedMooreComplex.objD X n = 0


theorem isEquivalent_iff_tendsto_one (hz : ∀ᶠ x in l, v x ≠ 0) :
    u ~[l] v ↔ Tendsto (u / v) l (𝓝 1)

{α : Type u_1}
{β : Type u_2}
[NormedField β]
{u v : α → β}
{l : Filter α}
(hz : ∀ᶠ (x : α) in l, v x ≠ 0)

u ~[l] v ↔ Filter.Tendsto (u / v) l (nhds 1)


theorem dvd_iff' {k m : ℕ+} : k ∣ m ↔ mod m k = k


theorem IicExtend_of_mem (f : Iic b → β) (hx : x ∈ Iic b) : IicExtend f x = f ⟨x, hx⟩

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
{b x : α}
(f : ↑(Set.Iic b) → β)
(hx : x ∈ Set.Iic b)


class IsLeftCancel (α : Sort u) (op : α → α → α) : Prop where
  left_cancel : ∀ a b c, op a b = op a c → b = c

{α : Sort u}
{op : α → α → α}
[self : IsLeftCancel α op]
(a b c : α)


theorem reverse_concat (l : List α) (a : α) : (l.concat a).reverse = a :: l.reverse


theorem and_eq_of_eq {a b : Prop} (h : a = b) : (a ∧ b) = a


/-- A product of maps which preserve multiplication,
preserves multiplication when the target is commutative. -/
@[to_additive
      "A sum of maps which preserves addition, preserves addition when the target
      is commutative."]
theorem mul {α β} [Semigroup α] [CommSemigroup β] {f g : α → β} (hf : IsMulHom f)
    (hg : IsMulHom g) : IsMulHom fun a => f a * g a

{α : Type u_2}
{β : Type u_3}
[Semigroup α]
[CommSemigroup β]
{f g : α → β}
(hf : IsMulHom f)
(hg : IsMulHom g)


theorem coeff_comp_degree_mul_degree (hqd0 : natDegree q ≠ 0) :
    coeff (p.comp q) (natDegree p * natDegree q) =
    leadingCoeff p * leadingCoeff q ^ natDegree p

{R : Type u}
[Semiring R]
{p q : R[X]}
(hqd0 : q.natDegree ≠ 0)

(p.comp q).coeff (p.natDegree * q.natDegree) = p.leadingCoeff * q.leadingCoeff ^ p.natDegree


/-- A reified version of the `Bertrand.main_inequality` below.
This is not best possible: it actually holds for 464 ≤ x.
-/
theorem real_main_inequality {x : ℝ} (x_large : (512 : ℝ) ≤ x) :
    x * (2 * x) ^ √(2 * x) * 4 ^ (2 * x / 3) ≤ 4 ^ x


lemma uncurry_two_eq_uncurry {α β : Type u} (f : OfArity α β 2) :
    uncurry f = Function.uncurry f ∘ (finTwoArrowEquiv α)

{α β : Type u}
(f : Function.OfArity α β 2)

f.uncurry = Function.uncurry f ∘ ⇑(finTwoArrowEquiv α)


theorem derivWithin_sinh (hf : DifferentiableWithinAt ℝ f s x) (hxs : UniqueDiffWithinAt ℝ s x) :
    derivWithin (fun x => Real.sinh (f x)) s x = Real.cosh (f x) * derivWithin f s x

{f : ℝ → ℝ}
{x : ℝ}
{s : Set ℝ}
(hf : DifferentiableWithinAt ℝ f s x)
(hxs : UniqueDiffWithinAt ℝ s x)


/-- In a weakly locally compact R₁ space,
every compact set has an open neighborhood with compact closure. -/
theorem exists_isOpen_superset_and_isCompact_closure {K : Set X} (hK : IsCompact K) :
    ∃ V, IsOpen V ∧ K ⊆ V ∧ IsCompact (closure V)

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]
[WeaklyLocallyCompactSpace X]
{K : Set X}
(hK : IsCompact K)


lemma forall_mem_compls {p : α → Prop} : (∀ a ∈ sᶜˢ, p a) ↔ ∀ a ∈ s, p aᶜ

{α : Type u_2}
[BooleanAlgebra α]
{s : Finset α}
{p : α → Prop}


/-- The kernel of the quotient map induced by an equivalence relation r equals r. -/
@[simp]
theorem ker_mk_eq (r : Setoid α) : ker (@Quotient.mk'' _ r) = r


/-- Pre-composition by a *fixed* continuous linear map as a continuous linear map.
Note that in non-normed space it is not always true that composition is continuous
in both variables, so we have to fix one of them. -/
@[simps]
def precomp [TopologicalAddGroup G] [ContinuousConstSMul 𝕜₃ G] [RingHomSurjective σ]
    [RingHomIsometric σ] (L : E →SL[σ] F) : (F →SL[τ] G) →L[𝕜₃] E →SL[ρ] G

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
{𝕜₃ : Type u_3}
[NormedField 𝕜₁]
[NormedField 𝕜₂]
[NormedField 𝕜₃]
{σ : 𝕜₁ →+* 𝕜₂}
{τ : 𝕜₂ →+* 𝕜₃}
{ρ : 𝕜₁ →+* 𝕜₃}
[RingHomCompTriple σ τ ρ]
{E : Type u_4}
{F : Type u_5}
(G : Type u_6)
[AddCommGroup E]
[Module 𝕜₁ E]
[AddCommGroup F]
[Module 𝕜₂ F]
[AddCommGroup G]
[Module 𝕜₃ G]
[TopologicalSpace E]
[TopologicalSpace F]
[TopologicalSpace G]
[TopologicalAddGroup G]
[ContinuousConstSMul 𝕜₃ G]
[RingHomSurjective σ]
[RingHomIsometric σ]
(L : E →SL[σ] F)
(f : F →SL[τ] G)

(ContinuousLinearMap.precomp G L) f = f.comp L


lemma dualSubmodule_span_of_basis {ι} [Finite ι] [DecidableEq ι]
    (hB : B.Nondegenerate) (b : Basis ι S M) :
    B.dualSubmodule (Submodule.span R (Set.range b)) =
      Submodule.span R (Set.range <| B.dualBasis hB b)

{R : Type u_4}
{S : Type u_2}
{M : Type u_3}
[CommRing R]
[Field S]
[AddCommGroup M]
[Algebra R S]
[Module R M]
[Module S M]
[IsScalarTower R S M]
(B : LinearMap.BilinForm S M)
{ι : Type u_1}
[Finite ι]
[DecidableEq ι]
(hB : B.Nondegenerate)
(b : Basis ι S M)

B.dualSubmodule (Submodule.span R (Set.range ⇑b)) = Submodule.span R (Set.range ⇑(B.dualBasis hB b))


theorem stepBound_mono : Monotone stepBound


@[simp]
theorem rTensor_pow (f : M →ₗ[R] M) (n : ℕ) : f.rTensor N ^ n = (f ^ n).rTensor N

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(f : M →ₗ[R] M)
(n : ℕ)

LinearMap.rTensor N f ^ n = LinearMap.rTensor N (f ^ n)


theorem tendsto_atTop_add_left_of_le' (C : β) (hf : ∀ᶠ x in l, C ≤ f x) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x + g x) l atTop

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommGroup β]
(l : Filter α)
{f g : α → β}
(C : β)
(hf : ∀ᶠ (x : α) in l, C ≤ f x)
(hg : Filter.Tendsto g l Filter.atTop)

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


/-- Let `f : α → α` be an ergodic map.
Let `g : α → X` be a null-measurable function from `α` to a nonempty measurable space
with a countable family of measurable sets separating the points of `X`.
If `g` is a.e.-invariant under `f`, then `g` is a.e. constant. -/
theorem Ergodic.ae_eq_const_of_ae_eq_comp₀ (h : Ergodic f μ) (hgm : NullMeasurable g μ)
    (hg_eq : g ∘ f =ᵐ[μ] g) : ∃ c, g =ᵐ[μ] const α c

(hgm : MeasureTheory.NullMeasurable g μ)


theorem quotient_obj_as (C : HomologicalComplex V c) : ((quotient V c).obj C).as = C

{ι : Type u_2}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
(C : HomologicalComplex V c)

((HomotopyCategory.quotient V c).obj C).as = C


theorem rotation_symm_apply (θ : Real.Angle) (x : V) :
    (o.rotation θ).symm x = Real.Angle.cos θ • x - Real.Angle.sin θ • J x

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

(o.rotation θ).symm x = θ.cos • x - θ.sin • o.rightAngleRotation x


lemma norm_op [SeminormedAddGroup E] (a : E) : ‖MulOpposite.op a‖ = ‖a‖

{E : Type u_2}
[SeminormedAddGroup E]
(a : E)


theorem span_eq_of_le (h₁ : s ⊆ p) (h₂ : p ≤ span R s) : span R s = p

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : Submodule R M)
{s : Set M}
(h₁ : s ⊆ ↑p)
(h₂ : p ≤ Submodule.span R s)


@[simp]
theorem Icc_diff_Ioc_same (h : a ≤ b) : Icc a b \ Ioc a b = {a}

{α : Type u_1}
[PartialOrder α]
{a b : α}
(h : a ≤ b)


/-- Given a (potential) root `α` relative to a Cartan subalgebra `H`, if we restrict to the ideal
`I = corootSpace α` of `H` (informally, `I = ⁅H(α), H(-α)⁆`), we may find an
integral linear combination between `α` and any weight `χ` of a representation.

This is Proposition 4.4 from [carter2005] and is a key step in the proof that the roots of a
semisimple Lie algebra form a root system. It shows that the restriction of `α` to `I` vanishes iff
the restriction of every root to `I` vanishes (which cannot happen in a semisimple Lie algebra). -/
lemma exists_forall_mem_corootSpace_smul_add_eq_zero
    [IsDomain R] [IsPrincipalIdealRing R] [CharZero R] [NoZeroSMulDivisors R M] [IsNoetherian R M]
    (hα : α ≠ 0) (hχ : weightSpace M χ ≠ ⊥) :
    ∃ a b : ℤ, 0 < b ∧ ∀ x ∈ corootSpace α, (a • α + b • χ) x = 0

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(M : Type u_3)
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{H : LieSubalgebra R L}
(α χ : ↥H → R)
[H.IsCartanSubalgebra]
[IsNoetherian R L]
[IsDomain R]
[IsPrincipalIdealRing R]
[CharZero R]
[NoZeroSMulDivisors R M]
[IsNoetherian R M]
(hα : α ≠ 0)
(hχ : LieModule.weightSpace M χ ≠ ⊥)

∃ a b, 0 < b ∧ ∀ x ∈ LieAlgebra.corootSpace α, (a • α + b • χ) x = 0


/-- An embedding from a topological space to a metric space is an isometry with respect to the
induced metric space structure on the source space. -/
theorem Embedding.to_isometry {α β} [TopologicalSpace α] [MetricSpace β] {f : α → β}
    (h : Embedding f) : (letI := h.comapMetricSpace f; Isometry f)

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[MetricSpace β]
{f : α → β}
(h : Embedding f)


theorem exists_ne_zero {f : M₁ →SL[σ₁₂] M₂} (hf : f ≠ 0) : ∃ x, f x ≠ 0

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
{f : M₁ →SL[σ₁₂] M₂}
(hf : f ≠ 0)


theorem ofList_toList (l : DList α) : DList.ofList (DList.toList l) = l


theorem coprime_one_left : ∀ n, Coprime 1 n


theorem inf_ind (a b : α) {p : α → Prop} : p a → p b → p (a ⊓ b)

{α : Type u}
[LinearOrder α]
(a b : α)
{p : α → Prop}


@[simp]
theorem comp_apply (f : BiheytingHom β γ) (g : BiheytingHom α β) (a : α) : f.comp g a = f (g a)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[BiheytingAlgebra α]
[BiheytingAlgebra β]
[BiheytingAlgebra γ]
(f : BiheytingHom β γ)
(g : BiheytingHom α β)
(a : α)


protected theorem contMDiffOn : ContMDiffOn I J n Φ Φ.source

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_4}
[TopologicalSpace H]
{G : Type u_5}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_7}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
(Φ : PartialDiffeomorph I J M N n)

ContMDiffOn I J n (↑Φ.toPartialEquiv) Φ.source


theorem IsPrimitive.content_eq_one {p : R[X]} (hp : p.IsPrimitive) : p.content = 1

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
{p : Polynomial R}
(hp : p.IsPrimitive)


/-- The tensor algebra is isomorphic to a direct sum of tensor powers. -/
@[simps!]
def equivDirectSum : TensorAlgebra R M ≃ₐ[R] ⨁ n, ⨂[R]^n M

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(a : ⨁ (n : ℕ), ⨂[R]^n M)

TensorAlgebra.equivDirectSum.symm a = TensorAlgebra.ofDirectSum a


theorem sup_smul : (I ⊔ J) • N = I • N ⊔ J • N

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(I J : Ideal R)
(N : Submodule R M)


theorem pairwise_append {l₁ l₂ : List α} :
    (l₁ ++ l₂).Pairwise R ↔ l₁.Pairwise R ∧ l₂.Pairwise R ∧ ∀ a ∈ l₁, ∀ b ∈ l₂, R a b

{α : Type u_1}
{R : α → α → Prop}
{l₁ l₂ : List α}

List.Pairwise R (l₁ ++ l₂) ↔ List.Pairwise R l₁ ∧ List.Pairwise R l₂ ∧ ∀ (a : α), a ∈ l₁ → ∀ (b : α), b ∈ l₂ → R a b


@[simp]
theorem withBot_id : (LatticeHom.id α).withBot = LatticeHom.id _

(LatticeHom.id α).withBot = LatticeHom.id (WithBot α)


@[simp]
theorem BinaryBiproduct.bicone_inr : (BinaryBiproduct.bicone X Y).inr = biprod.inr

(CategoryTheory.Limits.BinaryBiproduct.bicone X Y).inr = CategoryTheory.Limits.biprod.inr


theorem inv_def (x : CoprodI G) :
    x⁻¹ =
      MulOpposite.unop
        (lift (fun i => (of : G i →* _).op.comp (MulEquiv.inv' (G i)).toMonoidHom) x)

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

x⁻¹ =
  MulOpposite.unop
    ((Monoid.CoprodI.lift fun i => (MonoidHom.op Monoid.CoprodI.of).comp (MulEquiv.inv' (G i)).toMonoidHom) x)


theorem map_coe_nnreal_restrict (f : α →ₛ ℝ≥0) (s : Set α) :
    (f.restrict s).map ((↑) : ℝ≥0 → ℝ) = (f.map (↑)).restrict s

{α : Type u_1}
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α ℝ≥0)
(s : Set α)

MeasureTheory.SimpleFunc.map NNReal.toReal (f.restrict s) = (MeasureTheory.SimpleFunc.map NNReal.toReal f).restrict s


/-- Universe lift functor for commutative monoids. -/
@[to_additive (attr := simps)
  "Universe lift functor for additive commutative monoids."]
def uliftFunctor : CommMonCat.{u} ⥤ CommMonCat.{max u v}

CommMonCat.uliftFunctor.map f =
  CommMonCat.ofHom (MulEquiv.ulift.symm.toMonoidHom.comp (MonoidHom.comp f MulEquiv.ulift.toMonoidHom))


theorem val_eq (h : v₁.IsEquiv v₂) {r s : R} : v₁ r = v₁ s ↔ v₂ r = v₂ s

{R : Type u_3}
{Γ₀ : Type u_4}
{Γ'₀ : Type u_5}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
[LinearOrderedCommMonoidWithZero Γ'₀]
{v₁ : Valuation R Γ₀}
{v₂ : Valuation R Γ'₀}
(h : v₁.IsEquiv v₂)
{r s : R}


/-- Construct a cone for the empty diagram given an object. -/
@[simps]
def asEmptyCone (X : C) : Cone (Functor.empty.{0} C)

(X_1 : CategoryTheory.Discrete PEmpty.{1})

(CategoryTheory.Limits.asEmptyCone X).π.app X_1 = id (CategoryTheory.Discrete.casesOn X_1 fun as => ⋯.elim)


theorem infiniteNeg_mul_of_infinitePos_not_infinitesimal_neg {x y : ℝ*} :
    InfinitePos x → ¬Infinitesimal y → y < 0 → InfiniteNeg (x * y)

x.InfinitePos → ¬y.Infinitesimal → y < 0 → (x * y).InfiniteNeg


theorem nodup_ofFn {n} {f : Fin n → α} : Nodup (ofFn f) ↔ Function.Injective f

(List.ofFn f).Nodup ↔ Function.Injective f


theorem stolzSet_empty {M : ℝ} (hM : M ≤ 1) : stolzSet M = ∅


@[simp]
theorem xz_succ (n : ℕ) : (xz a1 (n + 1)) = xz a1 n * az a + d a1 * yz a1 n

Pell.xz a1 (n + 1) = Pell.xz a1 n * Pell.az a + ↑(Pell.d a1) * Pell.yz a1 n


theorem IsPurelyInseparable.inseparable [IsPurelyInseparable F E] :
    ∀ x : E, IsSeparable F x → x ∈ (algebraMap F E).range

(F : Type u)
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
[IsPurelyInseparable F E]
(x : E)


lemma iSup_opensRange_sigmaι : ⨆ i, (Sigma.ι f i).opensRange = ⊤

{ι : Type u}
(f : ι → AlgebraicGeometry.Scheme)

⨆ i, AlgebraicGeometry.Scheme.Hom.opensRange (CategoryTheory.Limits.Sigma.ι f i) = ⊤


theorem SimpleFunc.integral_eq_sum (f : α →ₛ E) (hfi : Integrable f μ) :
    ∫ x, f x ∂μ = ∑ x ∈ f.range, ENNReal.toReal (μ (f ⁻¹' {x})) • x

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[hE : CompleteSpace E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f : MeasureTheory.SimpleFunc α E)
(hfi : MeasureTheory.Integrable (↑f) μ)

∫ (x : α), ↑f x ∂μ = ∑ x ∈ f.range, (μ (↑f ⁻¹' {x})).toReal • x


theorem isUnit_toMatrix_iff [Nontrivial k] (p : ι → P) :
    IsUnit (b.toMatrix p) ↔ AffineIndependent k p ∧ affineSpan k (range p) = ⊤

{ι : Type u₁}
{k : Type u₂}
{V : Type u₃}
{P : Type u₄}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)
[Fintype ι]
[DecidableEq ι]
[Nontrivial k]
(p : ι → P)

IsUnit (b.toMatrix p) ↔ AffineIndependent k p ∧ affineSpan k (Set.range p) = ⊤


@[to_additive (attr := simp low+1)]
theorem smul_singleton : s • ({b} : Set β) = (· • b) '' s

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{s : Set α}
{b : β}


theorem one_div_lt_neg_one (h1 : a < 0) (h2 : -1 < a) : 1 / a < -1

{α : Type u_2}
[LinearOrderedField α]
{a : α}
(h1 : a < 0)
(h2 : -1 < a)


theorem subset_comp_self_of_mem_uniformity {s : Set (α × α)} (h : s ∈ 𝓤 α) : s ⊆ s ○ s

{α : Type ua}
[UniformSpace α]
{s : Set (α × α)}
(h : s ∈ 𝓤 α)


/-- A dilation maps closed balls to closed balls and scales the radius by `ratio f`. -/
theorem mapsTo_emetric_closedBall (x : α) (r' : ℝ≥0∞) :
    MapsTo (f : α → β) (EMetric.closedBall x r') (EMetric.closedBall (f x) (ratio f * r'))

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[FunLike F α β]
[DilationClass F α β]
(f : F)
(x : α)
(r' : ℝ≥0∞)

Set.MapsTo (⇑f) (EMetric.closedBall x r') (EMetric.closedBall (f x) (↑(Dilation.ratio f) * r'))


theorem comp_continuousLinearEquivAt_eq_coord_change (e e' : Trivialization F (π F E))
    [e.IsLinear R] [e'.IsLinear R] {b : B} (hb : b ∈ e.baseSet ∩ e'.baseSet) :
    (e.continuousLinearEquivAt R b hb.1).symm.trans (e'.continuousLinearEquivAt R b hb.2) =
      coordChangeL R e e' b

[TopologicalSpace (Bundle.TotalSpace F E)]

(e e' : Trivialization F Bundle.TotalSpace.proj)

(Trivialization.continuousLinearEquivAt R e b ⋯).symm.trans (Trivialization.continuousLinearEquivAt R e' b ⋯) =
  Trivialization.coordChangeL R e e' b


theorem norm_setToL1_le_mul_norm (hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C)
    (f : α →₁[μ] E) : ‖setToL1 hT f‖ ≤ C * ‖f‖

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

‖(MeasureTheory.L1.setToL1 hT) f‖ ≤ C * ‖f‖


@[to_additive const_add]
theorem AntitoneOn.const_mul' [CovariantClass α α (· * ·) (· ≤ ·)] (hf : AntitoneOn f s) (a : α) :
    AntitoneOn (fun x => a * f x) s

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


@[continuity]
protected theorem continuous (f : NormedAddGroupHom V₁ V₂) : Continuous f

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


@[simp]
theorem coe_toBipointed (X : TwoP) : ↥X.toBipointed = ↥X


@[measurability]
theorem measurable_coe_ennreal_ereal : Measurable ((↑) : ℝ≥0∞ → EReal)


theorem Integrable.aemeasurable [MeasurableSpace β] [BorelSpace β] {f : α → β}
    (hf : Integrable f μ) : AEMeasurable f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
[MeasurableSpace β]
[BorelSpace β]
{f : α → β}
(hf : MeasureTheory.Integrable f μ)


theorem equiv'_toAlgHom (h₁ : aeval (root g) (minpoly R pb.gen) = 0) (h₂ : aeval pb.gen g = 0) :
    (equiv' g pb h₁ h₂).toAlgHom = AdjoinRoot.liftHom g pb.gen h₂

(h₁ : (Polynomial.aeval (AdjoinRoot.root g)) (minpoly R pb.gen) = 0)

↑(AdjoinRoot.equiv' g pb h₁ h₂) = AdjoinRoot.liftHom g pb.gen h₂


/--
If `P` is a sheaf for every pullback of the sieve `S`, then `P` is a sheaf for any presieve which
contains `S`.
This is closely related to [Elephant] C2.1.6.
-/
theorem isSheafFor_subsieve (P : Cᵒᵖ ⥤ Type w) {S : Sieve X} {R : Presieve X}
    (h : (S : Presieve X) ≤ R) (trans : ∀ ⦃Y⦄ (f : Y ⟶ X),
      IsSheafFor P (S.pullback f : Presieve Y)) :
    IsSheafFor P R

(P : CategoryTheory.Functor Cᵒᵖ (Type w))

(trans : ∀ ⦃Y : C⦄ (f : Y ⟶ X), CategoryTheory.Presieve.IsSheafFor P (CategoryTheory.Sieve.pullback f S).arrows)


@[simp]
theorem reindex_refl : reindex (Equiv.refl σ) M = M


theorem ne_nil_of_mem {a : α} {l : List α} (h : a ∈ l) : l ≠ []

{α : Type u_1}
{a : α}
{l : List α}
(h : a ∈ l)


theorem trans_assoc_reparam {x₀ x₁ x₂ x₃ : X} (p : Path x₀ x₁) (q : Path x₁ x₂) (r : Path x₂ x₃) :
    (p.trans q).trans r =
      (p.trans (q.trans r)).reparam
        (fun t => ⟨transAssocReparamAux t, transAssocReparamAux_mem_I t⟩) (by continuity)
        (Subtype.ext transAssocReparamAux_zero) (Subtype.ext transAssocReparamAux_one)

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ x₂ x₃ : X}
(p : Path x₀ x₁)
(q : Path x₁ x₂)
(r : Path x₂ x₃)

(p.trans q).trans r = (p.trans (q.trans r)).reparam (fun t => ⟨Path.Homotopy.transAssocReparamAux t, ⋯⟩) ⋯ ⋯ ⋯


theorem smooth_toPartitionOfUnity {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E]
    {H : Type uH} [TopologicalSpace H] {I : ModelWithCorners ℝ E H} {M : Type uM}
    [TopologicalSpace M] [ChartedSpace H M] {s : Set M} (f : BumpCovering ι M s)
    (hf : ∀ i, Smooth I 𝓘(ℝ) (f i)) (i : ι) : Smooth I 𝓘(ℝ) (f.toPartitionOfUnity i)

(hf : ∀ (i : ι), Smooth I 𝓘(ℝ, ℝ) ⇑(f i))

Smooth I 𝓘(ℝ, ℝ) ⇑(f.toPartitionOfUnity i)


theorem one_sub_X_sq_mul_U_eq_pol_in_T (n : ℤ) :
    (1 - X ^ 2) * U R n = X * T R (n + 1) - T R (n + 2)

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


/-- The first part of the third simplicial identity -/
@[reassoc]
theorem δ_comp_σ_self {n} {i : Fin (n + 1)} :
    δ (Fin.castSucc i) ≫ σ i = 𝟙 ([n] : SimplexCategory)

SimplexCategory.δ i.castSucc ≫ SimplexCategory.σ i = 𝟙 (SimplexCategory.mk n)


lemma Normal.of_map_injective {G H : Type*} [Group G] [Group H] {φ : G →* H}
    (hφ : Function.Injective φ) {L : Subgroup G} (n : (L.map φ).Normal) : L.Normal

{G : Type u_6}
{H : Type u_7}
[Group G]
[Group H]
{φ : G →* H}
(hφ : Function.Injective ⇑φ)
{L : Subgroup G}
(n : (Subgroup.map φ L).Normal)


lemma eq_inf : @IsClosedImmersion = (topologically ClosedEmbedding) ⊓
    stalkwise (fun f ↦ Function.Surjective f)

@AlgebraicGeometry.IsClosedImmersion =
  (AlgebraicGeometry.topologically fun {α β} [TopologicalSpace α] [TopologicalSpace β] => ClosedEmbedding) ⊓
    AlgebraicGeometry.stalkwise fun {R S} [CommRing R] [CommRing S] f => Function.Surjective ⇑f


/-- If vectors `v₁` and `v₂` are on the same ray, then they are nonnegative multiples of the same
vector. Actually, this vector can be assumed to be `v₁ + v₂`, see `SameRay.exists_eq_smul_add`. -/
theorem exists_eq_smul (h : SameRay R v₁ v₂) :
    ∃ (u : M) (a b : R), 0 ≤ a ∧ 0 ≤ b ∧ a + b = 1 ∧ v₁ = a • u ∧ v₂ = b • u

{R : Type u_1}
[LinearOrderedField R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{v₁ v₂ : M}
(h : SameRay R v₁ v₂)

∃ u a b, 0 ≤ a ∧ 0 ≤ b ∧ a + b = 1 ∧ v₁ = a • u ∧ v₂ = b • u


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

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

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


theorem tan_pi_sub (x : ℂ) : tan (π - x) = -tan x

Complex.tan (↑Real.pi - x) = -Complex.tan x


/-- One implication of the portmanteau theorem:
If for all open sets G we have the liminf condition `μ(G) ≤ liminf μsₙ(G)`, then the measures
μsₙ converge weakly to the measure μ. -/
theorem tendsto_of_forall_isOpen_le_liminf {μ : ProbabilityMeasure Ω}
    {μs : ℕ → ProbabilityMeasure Ω}
    (h_opens : ∀ G, IsOpen G → μ G ≤ atTop.liminf (fun i ↦ μs i G)) :
    atTop.Tendsto (fun i ↦ μs i) (𝓝 μ)

{μ : MeasureTheory.ProbabilityMeasure Ω}

{μs : ℕ → MeasureTheory.ProbabilityMeasure Ω}

(h_opens : ∀ (G : Set Ω), IsOpen G → μ G ≤ Filter.liminf (fun i => (μs i) G) Filter.atTop)

Filter.Tendsto (fun i => μs i) Filter.atTop (𝓝 μ)


/-- Right component of the associator as a natural isomorphism. -/
@[simps!]
def associatorNatIsoRight (f : a ⟶ b) (g : b ⟶ c) (d : B) :
    (precomposing _ _ d).obj (f ≫ g) ≅ (precomposing ..).obj g ⋙ (precomposing ..).obj f

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

(CategoryTheory.Bicategory.associatorNatIsoRight f g d).inv.app X = (CategoryTheory.Bicategory.associator f g X).inv


theorem isLocal_iff {I : Ideal R} : IsLocal I ↔ IsMaximal (jacobson I)


@[simp]
lemma map_id : map (𝟙 K) 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 : HomologicalComplex₂ C c₁ c₂)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]

HomologicalComplex₂.total.map (𝟙 K) c₁₂ = 𝟙 (K.total c₁₂)


theorem mk_coe {s : Finset α} (x : (s : Set α)) {h} : (⟨x, h⟩ : (s : Set α)) = x

{α : Type u_1}
{s : Finset α}
(x : ↑↑s)
{h : ↑x ∈ ↑s}


@[simp] theorem empty_indep (M : Matroid α) : M.Indep ∅


theorem Nodup.map_on {f : α → β} :
    (∀ x ∈ s, ∀ y ∈ s, f x = f y → x = y) → Nodup s → Nodup (map f s)

{α : Type u_1}
{β : Type u_2}
{s : Multiset α}
{f : α → β}

(∀ x ∈ s, ∀ y ∈ s, f x = f y → x = y) → s.Nodup → (Multiset.map f s).Nodup


/-- Flipping commutative squares is an auto-equivalence. -/
@[simps]
def flipEquivalence : Square C ≌ Square C

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


/-- The Weierstrass curve mapped over a ring homomorphism `φ : R →+* A`. -/
@[simps]
def map : WeierstrassCurve A

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{A : Type v}
[CommRing A]
(φ : R →+* A)


theorem card_range_le [Finite α] (f : α → β) : Nat.card (Set.range f) ≤ Nat.card α

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


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

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


private theorem recC_intro {motive : (a : α) → Acc r a → Sort v}
    (intro : (x : α) → (h : ∀ (y : α), r y x → Acc r y) →
     ((y : α) → (hr : r y x) → motive y (h y hr)) → motive x (intro x h))
    {a : α} (h : ∀ (y : α), r y a → Acc r y) :
    recC intro (Acc.intro _ h) = intro a h (fun y hr => recC intro (h y hr))

(intro : (x : α) → (h : ∀ (y : α), r y x → Acc r y) → ((y : α) → (hr : r y x) → motive y ⋯) → motive x ⋯)

Acc.recC intro ⋯ = intro a h fun y hr => Acc.recC intro ⋯


/-- See also `finsum_smul` for a version that works even when the support of `f` is not finite,
but with slightly stronger typeclass requirements. -/
theorem finsum_smul' {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] {f : ι → R}
    (hf : (support f).Finite) (x : M) : (∑ᶠ i, f i) • x = ∑ᶠ i, f i • x

{ι : Type u_3}
{R : Type u_7}
{M : Type u_8}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{f : ι → R}
(hf : (Function.support f).Finite)
(x : M)

(∑ᶠ (i : ι), f i) • x = ∑ᶠ (i : ι), f i • x


@[to_additive (attr := measurability)]
theorem _root_.List.stronglyMeasurable_prod' (l : List (α → M))
    (hl : ∀ f ∈ l, StronglyMeasurable f) : StronglyMeasurable l.prod

(hl : ∀ f ∈ l, MeasureTheory.StronglyMeasurable f)


@[simp]
theorem center_im (z r) : (center z r).im = z.im * Real.cosh r


/-- The bottom map in the coequalizer diagram we will construct. -/
@[simps]
def FreeCoequalizer.bottomMap : (Monad.free T).obj (T.obj X.A) ⟶ (Monad.free T).obj X.A

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T : CategoryTheory.Monad C}
(X : T.Algebra)

(CategoryTheory.Monad.FreeCoequalizer.bottomMap X).f = T.μ.app X.A


/-- M. **Riesz extension theorem**: given a convex cone `s` in a vector space `E`, a submodule `p`,
and a linear `f : p → ℝ`, assume that `f` is nonnegative on `p ∩ s` and `p + s = E`. Then
there exists a globally defined linear function `g : E → ℝ` that agrees with `f` on `p`,
and is nonnegative on `s`. -/
theorem riesz_extension (s : ConvexCone ℝ E) (f : E →ₗ.[ℝ] ℝ)
    (nonneg : ∀ x : f.domain, (x : E) ∈ s → 0 ≤ f x)
    (dense : ∀ y, ∃ x : f.domain, (x : E) + y ∈ s) :
    ∃ g : E →ₗ[ℝ] ℝ, (∀ x : f.domain, g x = f x) ∧ ∀ x ∈ s, 0 ≤ g x

(nonneg : ∀ (x : ↥f.domain), ↑x ∈ s → 0 ≤ ↑f x)

∃ g, (∀ (x : ↥f.domain), g ↑x = ↑f x) ∧ ∀ x ∈ s, 0 ≤ g x


@[to_additive]
theorem lift.of_eq (x : FreeGroup α) : lift FreeGroup.of x = x


nonrec
theorem _root_.ContinuousOn.clog {f : α → ℂ} {s : Set α} (h₁ : ContinuousOn f s)
    (h₂ : ∀ x ∈ s, f x ∈ slitPlane) : ContinuousOn (fun t => log (f t)) s

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℂ}
{s : Set α}
(h₁ : ContinuousOn f s)
(h₂ : ∀ x ∈ s, f x ∈ Complex.slitPlane)

ContinuousOn (fun t => Complex.log (f t)) s


@[simp]
theorem diag_zero (h : j ≠ i) : diag (stdBasisMatrix i j c) = 0

{n : Type u_3}
{α : Type u_5}
[DecidableEq n]
[Semiring α]
(i j : n)
(c : α)
(h : j ≠ i)


theorem linearMapAt_eq_zero (e : Pretrivialization F (π F E)) [e.IsLinear R] {b : B}
    (hb : b ∉ e.baseSet) : e.linearMapAt R b = 0

(e : Pretrivialization F Bundle.TotalSpace.proj)


/-- A category has strong epi images if it has all images and `factorThruImage f` is a strong
    epimorphism for all `f`. -/
class HasStrongEpiImages : Prop where
  strong_factorThruImage : ∀ {X Y : C} (f : X ⟶ Y), StrongEpi (factorThruImage f)

[self : CategoryTheory.Limits.HasStrongEpiImages C]


theorem nonneg_iff {a : SignType} : 0 ≤ a ↔ a = 0 ∨ a = 1


@[to_additive]
theorem coe_comp_monoidHom (f : β →*o γ) (g : α →*o β) :
    (f.comp g : α →* γ) = (f : β →* γ).comp g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
[MulOneClass α]
[MulOneClass β]
[MulOneClass γ]
(f : β →*o γ)
(g : α →*o β)


theorem withDensity_preCDF (ρ : Measure (α × ℝ)) (r : ℚ) [IsFiniteMeasure ρ] :
    ρ.fst.withDensity (preCDF ρ r) = ρ.IicSnd r

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
(r : ℚ)
[MeasureTheory.IsFiniteMeasure ρ]

ρ.fst.withDensity (ProbabilityTheory.preCDF ρ r) = ρ.IicSnd ↑r


/-- Given two maps `r : I₁ × I₂ × I₃ → J` and `π : I₁ × I₃ → J`, this structure is the
input in the formulation of the triangle equality `mapBifunctor_triangle` which
relates the left and right unitor and the associator for `GradedObject.mapBifunctor`. -/
structure TriangleIndexData (r : I₁ × I₂ × I₃ → J) (π : I₁ × I₃ → J) where
  /-- a map `I₁ × I₂ → I₁` -/
  p₁₂ : I₁ × I₂ → I₁
  hp₁₂ (i : I₁ × I₂ × I₃) : π ⟨p₁₂ ⟨i.1, i.2.1⟩, i.2.2⟩ = r i
  /-- a map `I₂ × I₃ → I₃` -/
  p₂₃ : I₂ × I₃ → I₃
  hp₂₃ (i : I₁ × I₂ × I₃) : π ⟨i.1, p₂₃ i.2⟩ = r i
  h₁ (i₁ : I₁) : p₁₂ (i₁, 0) = i₁
  h₃ (i₃ : I₃) : p₂₃ (0, i₃) = i₃

(self : CategoryTheory.GradedObject.TriangleIndexData r π)


theorem volume_pi_Ioc {a b : ι → ℝ} :
    volume (pi univ fun i => Ioc (a i) (b i)) = ∏ i, ENNReal.ofReal (b i - a i)

{ι : Type u_1}
[Fintype ι]
{a b : ι → ℝ}

MeasureTheory.volume (Set.univ.pi fun i => Set.Ioc (a i) (b i)) = ∏ i : ι, ENNReal.ofReal (b i - a i)


theorem or_lt_two_pow {x y n : Nat} (left : x < 2^n) (right : y < 2^n) : x ||| y < 2^n

{x y n : Nat}
(left : x < 2 ^ n)
(right : y < 2 ^ n)


@[simp]
theorem sublistsLen_zero (l : List α) : sublistsLen 0 l = [[]]


/-- The multiset `nthRoots ↑n (1 : R)` has no repeated elements
if there is a primitive root of unity in `R`. -/
theorem nthRoots_one_nodup {ζ : R} {n : ℕ} (h : IsPrimitiveRoot ζ n) :
    (nthRoots n (1 : R)).Nodup

{R : Type u_4}
[CommRing R]
[IsDomain R]
{ζ : R}
{n : ℕ}
(h : IsPrimitiveRoot ζ n)


/-- Given a commuting square
R --→ P = R[X] ---→ S
|                   |
↓                   ↓
R' -→ P' = R'[X'] → S
A hom between `P` and `P'` is an assignment `I → P'` such that the arrows commute.
Also see `Algebra.Generators.Hom.equivAlgHom`.
-/
@[ext]
structure Hom where
  /-- The assignment of each variable in `I` to a value in `P' = R'[X']`. -/
  val : P.vars → P'.Ring
  aeval_val : ∀ i, aeval P'.val (val i) = algebraMap S S' (P.val i)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u_1}
{S' : Type u_2}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra S S']
(self : P.Hom P')
(i : P.vars)

(MvPolynomial.aeval P'.val) (self.val i) = (algebraMap S S') (P.val i)


theorem disjoint_frontier_iff_isOpen : Disjoint (frontier s) s ↔ IsOpen s

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


theorem le_coe : ∀ {o : Option α}, a ∈ o → (@LE.le (WithTop α) _ o b ↔ a ≤ b)

{α : Type u_1}
{a b : α}
[LE α]
{o : Option α}


/-- **Rearrangement Inequality**: Pointwise multiplication of `f` and `g` is minimized when `f` and
`g` antivary together. Stated by permuting the entries of `f`. -/
theorem Antivary.sum_mul_le_sum_comp_perm_mul (hfg : Antivary f g) :
    ∑ i, f i * g i ≤ ∑ i, f (σ i) * g i

{ι : Type u_1}
{α : Type u_2}
[LinearOrderedRing α]
{σ : Equiv.Perm ι}
{f g : ι → α}
[Fintype ι]
(hfg : Antivary f g)

∑ i : ι, f i * g i ≤ ∑ i : ι, f (σ i) * g i


@[to_additive]
protected lemma one_div_mul_cancel (h : IsUnit a) : 1 / a * a = 1

{α : Type u}
[DivisionMonoid α]
{a : α}
(h : IsUnit a)


@[to_additive]
theorem prod_range [CommMonoid β] {n : ℕ} (f : ℕ → β) :
    ∏ i ∈ Finset.range n, f i = ∏ i : Fin n, f i

{β : Type u_2}
[AddCommMonoid β]
{n : ℕ}
(f : ℕ → β)

∑ i ∈ Finset.range n, f i = ∑ i : Fin n, f ↑i


@[simp, norm_cast]
theorem cast_lt [LinearOrderedSemiring α] {m n : PosNum} : (m : α) < n ↔ m < n

{α : Type u_1}
[LinearOrderedSemiring α]
{m n : PosNum}


@[simp]
theorem inf_toSubmodule (S T : NonUnitalSubalgebra R A) :
    (S ⊓ T).toSubmodule = S.toSubmodule ⊓ T.toSubmodule

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


@[simp] lemma lift_inf_comp (a b : α) : lift a ⊓ comp b = lift (a \ b)

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

Booleanisation.lift a ⊓ Booleanisation.comp b = Booleanisation.lift (a \ b)


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

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

((CategoryTheory.Limits.Cone.equivCostructuredArrow F).functor.obj c).left = c.pt


/-- A constructor for isomorphisms in the category `ShortComplex C`-/
@[simps]
def isoMk (e₁ : S₁.X₁ ≅ S₂.X₁) (e₂ : S₁.X₂ ≅ S₂.X₂) (e₃ : S₁.X₃ ≅ S₂.X₃)
    (comm₁₂ : e₁.hom ≫ S₂.f = S₁.f ≫ e₂.hom := by aesop_cat)
    (comm₂₃ : e₂.hom ≫ S₂.g = S₁.g ≫ e₃.hom := by aesop_cat) :
    S₁ ≅ S₂

(comm₁₂ : CategoryTheory.CategoryStruct.comp e₁.hom S₂.f = CategoryTheory.CategoryStruct.comp S₁.f e₂.hom := by
  aesop_cat)

(comm₂₃ : CategoryTheory.CategoryStruct.comp e₂.hom S₂.g = CategoryTheory.CategoryStruct.comp S₁.g e₃.hom := by
  aesop_cat)

(CategoryTheory.ShortComplex.isoMk e₁ e₂ e₃ comm₁₂ comm₂₃).hom.τ₃ = e₃.hom


/-- **Britton's Lemma**. Any reduced word whose product is an element of `G`, has no
occurences of `t`.  -/
theorem toList_eq_nil_of_mem_of_range (w : ReducedWord G A B)
    (hw : w.prod φ ∈ (of.range : Subgroup (HNNExtension G A B φ))) :
    w.toList = []

(w : HNNExtension.NormalWord.ReducedWord G A B)

(hw : HNNExtension.NormalWord.ReducedWord.prod φ w ∈ HNNExtension.of.range)


@[simp]
theorem of_nat_toZNumNeg (n : ℕ) : Num.toZNumNeg n = -n


theorem vertex_mem_convexHull_iff (hx : x ∈ K.vertices) (hs : s ∈ K.faces) :
    x ∈ convexHull 𝕜 (s : Set E) ↔ x ∈ s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{K : Geometry.SimplicialComplex 𝕜 E}
{s : Finset E}
{x : E}
(hx : x ∈ K.vertices)
(hs : s ∈ K.faces)


@[simp]
theorem mem_comap {s : Subsemiring S} {f : R →+* S} {x : R} : x ∈ s.comap f ↔ f x ∈ s

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
{s : Subsemiring S}
{f : R →+* S}
{x : R}


protected theorem div_pow (dvd : p ^ a ∣ b) : padicValNat p (b / p ^ a) = padicValNat p b - a

{p a b : ℕ}
[hp : Fact (Nat.Prime p)]
(dvd : p ^ a ∣ b)


@[simp]
theorem nhdsSet_le_iff [T1Space X] {s t : Set X} : 𝓝ˢ s ≤ 𝓝ˢ t ↔ s ⊆ t

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

𝓝ˢ s ≤ 𝓝ˢ t ↔ s ⊆ t


/-- Auxiliary definition for `AlgebraicGeometry.PresheafedSpace.instHasColimits`.
-/
@[simps]
def colimitCocone (F : J ⥤ PresheafedSpace.{_, _, v} C) : Cocone F

[∀ (X : TopCat), CategoryTheory.Limits.HasLimitsOfShape Jᵒᵖ (TopCat.Presheaf C X)]

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

((AlgebraicGeometry.PresheafedSpace.colimitCocone F).ι.app j).base =
  CategoryTheory.Limits.colimit.ι (F ⋙ AlgebraicGeometry.PresheafedSpace.forget C) j


theorem smoothManifoldWithCorners_of_contDiffOn {𝕜 : Type*} [NontriviallyNormedField 𝕜]
    {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H]
    (I : ModelWithCorners 𝕜 E H) (M : Type*) [TopologicalSpace M] [ChartedSpace H M]
    (h : ∀ e e' : PartialHomeomorph M H, e ∈ atlas H M → e' ∈ atlas H M →
      ContDiffOn 𝕜 ⊤ (I ∘ e.symm ≫ₕ e' ∘ I.symm) (I.symm ⁻¹' (e.symm ≫ₕ e').source ∩ range I)) :
    SmoothManifoldWithCorners I M

(h :
  ∀ (e e' : PartialHomeomorph M H),
    e ∈ atlas H M →
      e' ∈ atlas H M →
        ContDiffOn 𝕜 ⊤ (↑I ∘ ↑(e.symm ≫ₕ e') ∘ ↑I.symm) (↑I.symm ⁻¹' (e.symm ≫ₕ e').source ∩ Set.range ↑I))


theorem uniformContinuous_lift {f : α → β} (h : ∀ a b, Inseparable a b → f a = f b) :
    UniformContinuous (lift f h) ↔ UniformContinuous f

(h : ∀ (a b : α), Inseparable a b → f a = f b)

UniformContinuous (SeparationQuotient.lift f h) ↔ UniformContinuous f


/-- The reflection of the circumcenter of a simplex in an edge, in
terms of `pointsWithCircumcenter`. -/
theorem reflection_circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ}
    (s : Simplex ℝ P n) {i₁ i₂ : Fin (n + 1)} (h : i₁ ≠ i₂) :
    reflection (affineSpan ℝ (s.points '' {i₁, i₂})) s.circumcenter =
      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination ℝ s.pointsWithCircumcenter
        (reflectionCircumcenterWeightsWithCircumcenter i₁ i₂)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P n)
{i₁ i₂ : Fin (n + 1)}
(h : i₁ ≠ i₂)

(EuclideanGeometry.reflection (affineSpan ℝ (s.points '' {i₁, i₂}))) s.circumcenter =
  (Finset.affineCombination ℝ Finset.univ s.pointsWithCircumcenter)
    (Affine.Simplex.reflectionCircumcenterWeightsWithCircumcenter i₁ i₂)


@[to_additive]
theorem pi_bot : (pi Set.univ fun i => (⊥ : Subgroup (f i))) = ⊥

{η : Type u_7}
{f : η → Type u_8}
[(i : η) → Group (f i)]


theorem Basis.mem_of_insert_indep (hI : M.Basis I X) (he : e ∈ X) (hIe : M.Indep (insert e I)) :
    e ∈ I

{α : Type u_1}
{M : Matroid α}
{I X : Set α}
{e : α}
(hI : M.Basis I X)
(he : e ∈ X)
(hIe : M.Indep (insert e I))


@[simp]
theorem closure_addSubmonoid_closure {s : Set R} :
    closure ↑(AddSubmonoid.closure s) = closure s

{R : Type u}
[NonUnitalNonAssocSemiring R]
{s : Set R}

NonUnitalSubsemiring.closure ↑(AddSubmonoid.closure s) = NonUnitalSubsemiring.closure s


theorem neg_le_natAbs {a : Int} : -a ≤ a.natAbs


theorem isCycle_cycleRange {n : ℕ} {i : Fin (n + 1)} (h0 : i ≠ 0) : IsCycle (cycleRange i)


theorem rpow_lt_one_iff (hx : 0 ≤ x) :
    x ^ y < 1 ↔ x = 0 ∧ y ≠ 0 ∨ 1 < x ∧ y < 0 ∨ x < 1 ∧ 0 < y


theorem map_nhds_induced_of_mem {a : α} (h : range f ∈ 𝓝 (f a)) :
    map f (@nhds α (induced f t) a) = 𝓝 (f a)

{α : Type u_1}
{β : Type u_2}
[t : TopologicalSpace β]
{f : α → β}
{a : α}
(h : Set.range f ∈ 𝓝 (f a))


theorem rel_nodup {r : α → β → Prop} (hr : Relator.BiUnique r) : (Forall₂ r ⇒ (· ↔ ·)) Nodup Nodup

{α : Type u}
{β : Type v}
{r : α → β → Prop}
(hr : Relator.BiUnique r)

(List.Forall₂ r ⇒ fun x x_1 => x ↔ x_1) List.Nodup List.Nodup


@[simp]
theorem isRotated_singleton_iff' {x : α} : [x] ~r l ↔ [x] = l


protected theorem Nodup.sigma {σ : α → Type*} {t : ∀ a, Multiset (σ a)} :
    Nodup s → (∀ a, Nodup (t a)) → Nodup (s.sigma t)

{α : Type u_1}
{s : Multiset α}
{σ : α → Type u_5}
{t : (a : α) → Multiset (σ a)}

s.Nodup → (∀ (a : α), (t a).Nodup) → (s.sigma t).Nodup


@[to_additive (attr := simp)]
theorem map_coe (f : α →ₙ* β) (a : α) : map f (a : WithOne α) = f a

{α : Type u}
{β : Type v}
[Mul α]
[Mul β]
(f : α →ₙ* β)
(a : α)


@[simp, norm_cast]
theorem coe_powerset (s : Finset α) :
    (s.powerset : Set (Finset α)) = ((↑) : Finset α → Set α) ⁻¹' (s : Set α).powerset


@[simp]
theorem bliminf_false {f : Filter β} {u : β → α} : (bliminf u f fun _ => False) = ⊤

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{u : β → α}


@[to_additive]
theorem Finset.tprod_subtype' (s : Finset β) (f : β → α) :
    ∏' x : (s : Set β), f x = ∏ x ∈ s, f x

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
(s : Finset β)
(f : β → α)


@[simp]
theorem coeSubmodule_isPrincipal {I : Ideal R} : (coeSubmodule K I).IsPrincipal ↔ I.IsPrincipal

(R : Type u_1)
[CommRing R]
(K : Type u_5)
[CommRing K]
[Algebra R K]
[IsFractionRing R K]
{I : Ideal R}

(IsLocalization.coeSubmodule K I).IsPrincipal ↔ Submodule.IsPrincipal I


/-- An isometry preserves edistances. -/
theorem edist_eq (hf : Isometry f) (x y : α) : edist (f x) (f y) = edist x y

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
(hf : Isometry f)
(x y : α)


@[reassoc]
lemma mappingConeCompTriangle_mor₃_naturality {Y₁ Y₂ Y₃ : CochainComplex C ℤ} (f' : Y₁ ⟶ Y₂)
    (g' : Y₂ ⟶ Y₃) (φ : mk₂ f g ⟶ mk₂ f' g') :
    map g g' (φ.app 1) (φ.app 2) (naturality' φ 1 2) ≫ (mappingConeCompTriangle f' g').mor₃ =
      (mappingConeCompTriangle f g).mor₃ ≫
        (map f f' (φ.app 0) (φ.app 1) (naturality' φ 0 1))⟦1⟧'

(φ : CategoryTheory.ComposableArrows.mk₂ f g ⟶ CategoryTheory.ComposableArrows.mk₂ f' g')

CochainComplex.mappingCone.map g g' (φ.app 1) (φ.app 2) ⋯ ≫ (CochainComplex.mappingConeCompTriangle f' g').mor₃ =
  (CochainComplex.mappingConeCompTriangle f g).mor₃ ≫
    (CategoryTheory.shiftFunctor (CochainComplex C ℤ) 1).map (CochainComplex.mappingCone.map f f' (φ.app 0) (φ.app 1) ⋯)


@[reassoc]
theorem prod.map_comp_id {X Y Z W : C} (f : X ⟶ Y) (g : Y ⟶ Z) [HasBinaryProduct X W]
    [HasBinaryProduct Z W] [HasBinaryProduct Y W] :
    prod.map (f ≫ g) (𝟙 W) = prod.map f (𝟙 W) ≫ prod.map g (𝟙 W)

CategoryTheory.Limits.prod.map (f ≫ g) (𝟙 W) =
  CategoryTheory.Limits.prod.map f (𝟙 W) ≫ CategoryTheory.Limits.prod.map g (𝟙 W)


/-- `AddChar A M` is the type of maps `A → M`, for `A` an additive monoid and `M` a multiplicative
monoid, which intertwine addition in `A` with multiplication in `M`.

We only put the typeclasses needed for the definition, although in practice we are usually
interested in much more specific cases (e.g. when `A` is a group and `M` a commutative ring).
 -/
structure AddChar where
  /-- The underlying function.

  Do not use this function directly. Instead use the coercion coming from the `FunLike`
  instance. -/
  toFun : A → M
  /-- The function maps `0` to `1`.

  Do not use this directly. Instead use `AddChar.map_zero_eq_one`. -/
  map_zero_eq_one' : toFun 0 = 1
  /-- The function maps addition in `A` to multiplication in `M`.

  Do not use this directly. Instead use `AddChar.map_add_eq_mul`. -/
  map_add_eq_mul' : ∀ a b : A, toFun (a + b) = toFun a * toFun b

{A : Type u_1}
[AddMonoid A]
{M : Type u_2}
[Monoid M]
(self : AddChar A M)


lemma monotone_inclusion_le_le_of_le [Preorder α] {k j : α} (hkj : k ≤ j) :
    Monotone (fun ⟨i, hi⟩ => ⟨i, hi.trans hkj⟩ : { i // i ≤ k } → { i // i ≤ j})

{α : Type u}
[Preorder α]
{k j : α}
(hkj : k ≤ j)

Monotone fun x =>
  match x with
  | ⟨i, hi⟩ => ⟨i, ⋯⟩


theorem ContinuousOn.congr_mono {f g : α → β} {s s₁ : Set α} (h : ContinuousOn f s)
    (h' : EqOn g f s₁) (h₁ : s₁ ⊆ s) : ContinuousOn g s₁

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f g : α → β}
{s s₁ : Set α}
(h : ContinuousOn f s)
(h' : Set.EqOn g f s₁)
(h₁ : s₁ ⊆ s)


theorem to_sup_of_normal_right' {H K : Subgroup G} (hH : IsPGroup p H) (hK : IsPGroup p K)
    (hHK : H ≤ K.normalizer) : IsPGroup p (H ⊔ K : Subgroup G)

{p : ℕ}
{G : Type u_1}
[Group G]
{H K : Subgroup G}
(hH : IsPGroup p ↥H)
(hK : IsPGroup p ↥K)
(hHK : H ≤ K.normalizer)


/-- An open set is a Gδ set. -/
theorem IsOpen.isGδ {s : Set X} (h : IsOpen s) : IsGδ s

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


@[simp]
theorem transferCenterPow_apply [FiniteIndex (center G)] (g : G) :
    ↑(transferCenterPow G g) = g ^ (center G).index

{G : Type u_1}
[Group G]
[(Subgroup.center G).FiniteIndex]
(g : G)

↑((MonoidHom.transferCenterPow G) g) = g ^ (Subgroup.center G).index


@[simp]
theorem coe_inv (x : { x : K // 0 < x }) : ↑x⁻¹ = (x⁻¹ : K)

{K : Type u_1}
[LinearOrderedField K]
(x : { x // 0 < x })

↑x⁻¹ = (↑x)⁻¹


theorem rnDeriv_def (s : SignedMeasure α) (μ : Measure α) : rnDeriv s μ = fun x =>
    (s.toJordanDecomposition.posPart.rnDeriv μ x).toReal -
      (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal

{α : Type u_1}
{m : MeasurableSpace α}
(s : MeasureTheory.SignedMeasure α)
(μ : MeasureTheory.Measure α)

s.rnDeriv μ = fun x =>
  (s.toJordanDecomposition.posPart.rnDeriv μ x).toReal - (s.toJordanDecomposition.negPart.rnDeriv μ x).toReal


@[simp]
theorem productIso_hom_comp_eval {J : Type v} (F : J → TypeMax.{v, u}) (j : J) :
    ((productIso.{v, u} F).hom ≫ fun f => f j) = Pi.π F j

((CategoryTheory.Limits.Types.productIso F).hom ≫ fun f => f j) = CategoryTheory.Limits.Pi.π F j


theorem norm_iteratedFDerivWithin_fderivWithin {n : ℕ} (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) :
    ‖iteratedFDerivWithin 𝕜 n (fderivWithin 𝕜 f s) s x‖ =
      ‖iteratedFDerivWithin 𝕜 (n + 1) f s x‖

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ}
(hs : UniqueDiffOn 𝕜 s)
(hx : x ∈ s)


/-- The prelax functor from `Cat` to `Cat` defined with `WithTerminal`. -/
@[simps]
def prelaxfunctor : PrelaxFunctor Cat Cat

∀ {a b : CategoryTheory.Cat} {f g : a ⟶ b} (η : f ⟶ g),
  CategoryTheory.WithTerminal.prelaxfunctor.map₂ η = CategoryTheory.WithTerminal.map₂ η


theorem splits_iff_exists_multiset {f : K[X]} :
    Splits i f ↔
      ∃ s : Multiset L, f.map i = C (i f.leadingCoeff) * (s.map fun a : L => X - C a).prod

{K : Type v}
{L : Type w}
[Field K]
[Field L]
(i : K →+* L)
{f : K[X]}

Polynomial.Splits i f ↔
  ∃ s,
    Polynomial.map i f =
      Polynomial.C (i f.leadingCoeff) * (Multiset.map (fun a => Polynomial.X - Polynomial.C a) s).prod


@[mono]
theorem exp_strictMono : StrictMono exp


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


@[simp]
theorem recBotCoe_coe {C : WithBot α → Sort*} (d : C ⊥) (f : ∀ a : α, C a) (x : α) :
    @recBotCoe _ C d f ↑x = f x

{α : Type u_1}
{C : WithBot α → Sort u_5}
(d : C ⊥)
(f : (a : α) → C ↑a)
(x : α)


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

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


theorem le_self_mul_one_div {I : Submodule R A} (hI : I ≤ 1) : I ≤ I * (1 / I)

{R : Type u}
[CommSemiring R]
{A : Type v}
[CommSemiring A]
[Algebra R A]
{I : Submodule R A}
(hI : I ≤ 1)


@[simp, norm_cast] lemma coe_pow (q : ℚ≥0) (n : ℕ) : (↑(q ^ n) : ℚ) = (q : ℚ) ^ n


theorem preimage_iso_iff [LE α] [LE β] {t : Set β} {φ : α ≃o β} :
    IsAntichain (· ≤ ·) (φ ⁻¹' t) ↔ IsAntichain (· ≤ ·) t

{α : Type u_1}
{β : Type u_2}
[LE α]
[LE β]
{t : Set β}
{φ : α ≃o β}

IsAntichain (fun x x_1 => x ≤ x_1) (⇑φ ⁻¹' t) ↔ IsAntichain (fun x x_1 => x ≤ x_1) t


theorem sup_sdiff_cancel' (hab : a ≤ b) (hbc : b ≤ c) : b ⊔ c \ a = c

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


@[to_additive (attr := simp) norm_pos_iff]
theorem norm_pos_iff'' : 0 < ‖a‖ ↔ a ≠ 1

{E : Type u_6}
[NormedAddGroup E]
{a : E}


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

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


theorem update_comm {α} [DecidableEq α] {β : α → Sort*} {a b : α} (h : a ≠ b) (v : β a) (w : β b)
    (f : ∀ a, β a) : update (update f a v) b w = update (update f b w) a v

{α : Sort u_2}
[DecidableEq α]
{β : α → Sort u_1}
{a b : α}
(h : a ≠ b)
(v : β a)
(w : β b)
(f : (a : α) → β a)

Function.update (Function.update f a v) b w = Function.update (Function.update f b w) a v


/-- Product of a list of elements in a subgroup is in the subgroup. -/
@[to_additive "Sum of a list of elements in an `AddSubgroup` is in the `AddSubgroup`."]
protected theorem list_prod_mem {l : List G} : (∀ x ∈ l, x ∈ K) → l.prod ∈ K

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


@[to_additive (attr := simp)]
theorem set_smul_subset_set_smul_iff : a • A ⊆ a • B ↔ A ⊆ B

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{A B : Set β}
{a : α}


/--
If `B` is a strict bicategory and `I` is a (1-)category, any functor (of 1-categories) `I ⥤ B` can
be promoted to a pseudofunctor from `LocallyDiscrete I` to `B`.
-/
@[simps]
def Functor.toPseudoFunctor (F : I ⥤ B) : Pseudofunctor (LocallyDiscrete I) B

{I : Type u₁}
[CategoryTheory.Category.{v₁, u₁} I]
{B : Type u₂}
[CategoryTheory.Bicategory B]
[CategoryTheory.Bicategory.Strict B]
(F : CategoryTheory.Functor I B)

∀ {a b c : CategoryTheory.LocallyDiscrete I} (f : a ⟶ b) (g : b ⟶ c),
  F.toPseudoFunctor.mapComp f g = CategoryTheory.eqToIso ⋯


/-- This is a `rfl` and `simp` version of `bot_eq_zero`. -/
@[simp]
theorem bot_eq_zero : (⊥ : Multiset α) = 0


/-- `Set.univ X` is homeomorphic to `X`. -/
@[simps! (config := .asFn)]
def Set.univ (X : Type*) [TopologicalSpace X] : (univ : Set X) ≃ₜ X


theorem min_const (hf : LipschitzWith Kf f) (a : ℝ) : LipschitzWith Kf fun x => min (f x) a

{α : Type u}
[PseudoEMetricSpace α]
{f : α → ℝ}
{Kf : ℝ≥0}
(hf : LipschitzWith Kf f)
(a : ℝ)


@[simp]
theorem cells_subset_iff {μ ν : YoungDiagram} : μ.cells ⊆ ν.cells ↔ μ ≤ ν


lemma dist_pi_const_le (a b : α) : (dist (fun _ : β => a) fun _ => b) ≤ dist a b

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
[Fintype β]
(a b : α)

(dist (fun x => a) fun x => b) ≤ dist a b


@[simp, norm_cast]
theorem coeIdeal_mul (I J : Ideal R) : (↑(I * J) : FractionalIdeal S P) = I * J

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


/-- The equivalence of categories expressing left unity of products of categories.  -/
@[simps]
def leftUnitorEquivalence : Discrete (PUnit : Type w) × C ≌ C

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

(CategoryTheory.prod.leftUnitorEquivalence C).functor = CategoryTheory.prod.leftUnitor C


theorem formPerm_subsingleton (s : Cycle α) (h : Subsingleton s) : formPerm s h.nodup = 1

{α : Type u_1}
[DecidableEq α]
(s : Cycle α)
(h : s.Subsingleton)


theorem of_inv (h : Irrational x⁻¹) : Irrational x


@[simp]
lemma map_mk' (h : M →ₗ[R] N) (x) (s : S) :
    map S f g h (IsLocalizedModule.mk' f x s) = (IsLocalizedModule.mk' g (h x) s)

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
{N : Type u_6}
{N' : Type u_7}
[AddCommGroup N]
[AddCommGroup N']
[Module R N]
[Module R N']
(g : N →ₗ[R] N')
[IsLocalizedModule S g]
(h : M →ₗ[R] N)
(x : M)
(s : ↥S)

((IsLocalizedModule.map S f g) h) (IsLocalizedModule.mk' f x s) = IsLocalizedModule.mk' g (h x) s


theorem extension_coe [T0Space β] (hf : UniformContinuous f) (a : α) :
    (Completion.extension f) a = f a

{α : Type u_1}
[UniformSpace α]
{β : Type u_2}
[UniformSpace β]
{f : α → β}
[T0Space β]
(hf : UniformContinuous f)
(a : α)

UniformSpace.Completion.extension f (↑α a) = f a


theorem tendsto_floor_right (n : ℤ) : Tendsto (fun x => floor x : α → α) (𝓝[≥] n) (𝓝[≥] n)

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
[OrderClosedTopology α]
(n : ℤ)

Filter.Tendsto (fun x => ↑⌊x⌋) (𝓝[≥] ↑n) (𝓝[≥] ↑n)


@[reassoc (attr := simp)]
theorem whiskerRight_naturality_comp (f : a ⟶ b) (g : b ⟶ c) (h : G.obj c ⟶ a') :
    η.naturality (f ≫ g) ▷ h ≫ (α_ _ _ _).hom ≫ η.app a ◁ G.mapComp f g ▷ h =
      F.mapComp f g ▷ η.app c ▷ h ≫
        (α_ _ _ _).hom ▷ h ≫
          (α_ _ _ _).hom ≫
            F.map f ◁ η.naturality g ▷ h ≫
              (α_ _ _ _).inv ≫
                (α_ _ _ _).inv ▷ h ≫
                  η.naturality f ▷ G.map g ▷ h ≫ (α_ _ _ _).hom ▷ h ≫ (α_ _ _ _).hom

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{F G : CategoryTheory.OplaxFunctor B C}
(η : CategoryTheory.OplaxNatTrans F G)
{a b c : B}
{a' : C}
(f : a ⟶ b)
(g : b ⟶ c)
(h : G.obj c ⟶ a')

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerRight (η.naturality (CategoryTheory.CategoryStruct.comp f g)) h)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.associator (η.app a) (G.map (CategoryTheory.CategoryStruct.comp f g)) h).hom
      (CategoryTheory.Bicategory.whiskerLeft (η.app a) (CategoryTheory.Bicategory.whiskerRight (G.mapComp f g) h))) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.whiskerRight (F.mapComp f g) (η.app c)) h)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.associator (F.map f) (F.map g) (η.app c)).hom
        h)
      (CategoryTheory.CategoryStruct.comp
        (CategoryTheory.Bicategory.associator (F.map f) (CategoryTheory.CategoryStruct.comp (F.map g) (η.app c)) h).hom
        (CategoryTheory.CategoryStruct.comp
          (CategoryTheory.Bicategory.whiskerLeft (F.map f) (CategoryTheory.Bicategory.whiskerRight (η.naturality g) h))
          (CategoryTheory.CategoryStruct.comp
            (CategoryTheory.Bicategory.associator (F.map f) (CategoryTheory.CategoryStruct.comp (η.app b) (G.map g))
                h).inv
            (CategoryTheory.CategoryStruct.comp
              (CategoryTheory.Bicategory.whiskerRight
                (CategoryTheory.Bicategory.associator (F.map f) (η.app b) (G.map g)).inv h)
              (CategoryTheory.CategoryStruct.comp
                (CategoryTheory.Bicategory.whiskerRight
                  (CategoryTheory.Bicategory.whiskerRight (η.naturality f) (G.map g)) h)
                (CategoryTheory.CategoryStruct.comp
                  (CategoryTheory.Bicategory.whiskerRight
                    (CategoryTheory.Bicategory.associator (η.app a) (G.map f) (G.map g)).hom h)
                  (CategoryTheory.Bicategory.associator (η.app a)
                      (CategoryTheory.CategoryStruct.comp (G.map f) (G.map g)) h).hom)))))))


theorem prod_nat_mod (s : Finset α) (n : ℕ) (f : α → ℕ) :
    (∏ i ∈ s, f i) % n = (∏ i ∈ s, f i % n) % n

{α : Type u_3}
(s : Finset α)
(n : ℕ)
(f : α → ℕ)


@[simp]
theorem closure_Icc (a b : α) : closure (Icc a b) = Icc a b

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[t : OrderClosedTopology α]
(a b : α)


/-- The underlying object of `(Comonad.comparison L).obj X` is just `L.obj X`.
-/
@[simps]
def Comonad.comparisonForget {L : C ⥤ D} {R : D ⥤ C} (h : L ⊣ R) :
    Comonad.comparison h ⋙ h.toComonad.forget ≅ L

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : CategoryTheory.Functor C D}
{R : CategoryTheory.Functor D C}
(h : L ⊣ R)
(X : C)

(CategoryTheory.Comonad.comparisonForget h).inv.app X = CategoryTheory.CategoryStruct.id (L.obj X)


@[reassoc (attr := simp)]
theorem ofLE_arrow {B : C} {X Y : Subobject B} (h : X ≤ Y) : ofLE X Y h ≫ Y.arrow = X.arrow

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

CategoryTheory.CategoryStruct.comp (X.ofLE Y h) Y.arrow = X.arrow


theorem mapDomain_support_of_injOn [DecidableEq β] {f : α → β} (s : α →₀ M)
    (hf : Set.InjOn f s.support) : (mapDomain f s).support = Finset.image f s.support

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
[DecidableEq β]
{f : α → β}
(s : α →₀ M)
(hf : Set.InjOn f ↑s.support)

(Finsupp.mapDomain f s).support = Finset.image f s.support


@[simp] lemma map_addZ : addZ (f ∘ P) (f ∘ Q) = f (addZ P Q)

{R : Type u}
[CommRing R]
{S : Type u_1}
[CommRing S]
(f : R →+* S)
(P Q : Fin 3 → R)

WeierstrassCurve.Jacobian.addZ (⇑f ∘ P) (⇑f ∘ Q) = f (WeierstrassCurve.Jacobian.addZ P Q)


@[to_additive (attr := deprecated Monoid.one_lt_exponent (since := "2024-02-17"))
  AddGroup.one_lt_exponent]
lemma Group.one_lt_exponent [Finite G] [Nontrivial G] : 1 < Monoid.exponent G

{G : Type u}
[Group G]
[Finite G]
[Nontrivial G]


/-- Corresponds to `dist_triangle_left`. -/
theorem hammingDist_triangle_left (x y z : ∀ i, β i) :
    hammingDist x y ≤ hammingDist z x + hammingDist z y

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


/-- The `Finset` of prime factors of an `s`-factored number is contained in `s`. -/
lemma primeFactors_subset_of_mem_factoredNumbers {s : Finset ℕ} {m : ℕ}
    (hm : m ∈ factoredNumbers s) :
    m.primeFactors ⊆ s

{s : Finset ℕ}
{m : ℕ}
(hm : m ∈ Nat.factoredNumbers s)


theorem mk_leftInverse (hg : g.Monic) : Function.LeftInverse (mk g) (modByMonicHom hg)

{R : Type u}
[CommRing R]
{g : R[X]}
(hg : g.Monic)

Function.LeftInverse ⇑(AdjoinRoot.mk g) ⇑(AdjoinRoot.modByMonicHom hg)


theorem imageSieve_app {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : C} (s : F.obj (op U)) :
    imageSieve f (f.app _ s) = ⊤

(s : (CategoryTheory.forget A).obj (F.obj (Opposite.op U)))

CategoryTheory.Presheaf.imageSieve f ((f.app (Opposite.op U)) s) = ⊤


/-- A pair of measures `μ` and `ν` is said to `HaveLebesgueDecomposition` if there exists a
measure `ξ` and a measurable function `f`, such that `ξ` is mutually singular with respect to
`ν` and `μ = ξ + ν.withDensity f`. -/
class HaveLebesgueDecomposition (μ ν : Measure α) : Prop where
  lebesgue_decomposition :
    ∃ p : Measure α × (α → ℝ≥0∞), Measurable p.2 ∧ p.1 ⟂ₘ ν ∧ μ = p.1 + ν.withDensity p.2

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[self : μ.HaveLebesgueDecomposition ν]

∃ p, Measurable p.2 ∧ p.1 ⟂ₘ ν ∧ μ = p.1 + ν.withDensity p.2


/-- A continuous affine equivalence, denoted `P₁ ≃ᵃL[k] P₂`, between two affine topological spaces
is an affine equivalence such that forward and inverse maps are continuous. -/
structure ContinuousAffineEquiv (k P₁ P₂ : Type*) {V₁ V₂ : Type*} [Ring k]
    [AddCommGroup V₁] [Module k V₁] [AddTorsor V₁ P₁] [TopologicalSpace P₁]
    [AddCommGroup V₂] [Module k V₂] [AddTorsor V₂ P₂] [TopologicalSpace P₂]
    extends P₁ ≃ᵃ[k] P₂ where
  continuous_toFun : Continuous toFun := by continuity
  continuous_invFun : Continuous invFun := by continuity

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_4}
{V₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[TopologicalSpace P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₂]
(self : P₁ ≃ᵃL[k] P₂)


@[simp]
theorem augment_X_succ (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0)
    (i : ℕ) : (augment C f w).X (i + 1) = C.X i


@[to_additive]
lemma IsCyclic.ext {G : Type*} [Group G] [Fintype G] [IsCyclic G] {d : ℕ} {a b : ZMod d}
    (hGcard : Fintype.card G = d) (h : ∀ t : G, t ^ a.val = t ^ b.val) : a = b

{G : Type u_1}
[AddGroup G]
[Fintype G]
[IsAddCyclic G]
{d : ℕ}
{a b : ZMod d}
(hGcard : Fintype.card G = d)
(h : ∀ (t : G), a.val • t = b.val • t)


theorem eval₂_mul_noncomm (hf : ∀ k, Commute (f <| q.coeff k) x) :
    eval₂ f x (p * q) = eval₂ f x p * eval₂ f x q

(hf : ∀ (k : ℕ), Commute (f (q.coeff k)) x)

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


@[simp]
theorem single_blocks {n : ℕ} (h : 0 < n) : (single n h).blocks = [n]


@[ext] theorem ext ⦃inst₁ inst₂ : CommRing R⦄
    (h_add : local_hAdd[R, inst₁] = local_hAdd[R, inst₂])
    (h_mul : local_hMul[R, inst₁] = local_hMul[R, inst₂]) :
    inst₁ = inst₂

{R : Type u}
⦃inst₁ inst₂ : CommRing R⦄
(h_add : HAdd.hAdd = HAdd.hAdd)
(h_mul : HMul.hMul = HMul.hMul)


/-- More convenient version of `TrivSqZeroExt.eq_smul_exp_of_invertible` for when `R` is a
field. -/
theorem eq_smul_exp_of_ne_zero (x : tsze R M) (hx : x.fst ≠ 0) :
    x = x.fst • exp 𝕜 (x.fst⁻¹ • inr x.snd)

(𝕜 : Type u_1)
{R : Type u_3}
{M : Type u_4}
[Field 𝕜]
[CharZero 𝕜]
[Field R]
[AddCommGroup M]
[Algebra 𝕜 R]
[Module 𝕜 M]
[Module R M]
[Module Rᵐᵒᵖ M]
[IsCentralScalar R M]
[IsScalarTower 𝕜 R M]
[TopologicalSpace R]
[TopologicalSpace M]
[TopologicalRing R]
[TopologicalAddGroup M]
[ContinuousSMul R M]
[ContinuousSMul Rᵐᵒᵖ M]
[T2Space R]
[T2Space M]
(x : tsze R M)
(hx : x.fst ≠ 0)

x = x.fst • NormedSpace.exp 𝕜 (x.fst⁻¹ • TrivSqZeroExt.inr x.snd)


@[simp] theorem sublist_append_right : ∀ l₁ l₂ : List α, l₂ <+ l₁ ++ l₂


/-- If x ∈ α is in 2 elements of a set of sets partitioning α, those 2 sets are equal. -/
theorem eq_of_mem_eqv_class {c : Set (Set α)} (H : ∀ a, ∃! b ∈ c, a ∈ b) {x b b'}
    (hc : b ∈ c) (hb : x ∈ b) (hc' : b' ∈ c) (hb' : x ∈ b') : b = b'

{α : Type u_1}
{c : Set (Set α)}
(H : ∀ (a : α), ∃! b, b ∈ c ∧ a ∈ b)
{x : α}
{b b' : Set α}
(hc : b ∈ c)
(hb : x ∈ b)
(hc' : b' ∈ c)
(hb' : x ∈ b')


theorem mem_vsub {s : Set α} : s ∈ f -ᵥ g ↔ ∃ t₁ ∈ f, ∃ t₂ ∈ g, t₁ -ᵥ t₂ ⊆ s

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{f g : Filter β}
{s : Set α}


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

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


@[to_additive]
theorem exists_mk {C : α ⧸ s → Prop} : (∃ x : α ⧸ s, C x) ↔ ∃ x : α, C x

{α : Type u_1}
[AddGroup α]
{s : AddSubgroup α}
{C : α ⧸ s → Prop}


theorem weightedHomogeneousComponent_eq_zero [SemilatticeSup M] [OrderBot M]
    (h : weightedTotalDegree w φ < n) : weightedHomogeneousComponent w n φ = 0

(h : MvPolynomial.weightedTotalDegree w φ < n)

(MvPolynomial.weightedHomogeneousComponent w n) φ = 0


@[to_additive (attr := ext)]
theorem ext {f g : ContinuousMonoidHom A B} (h : ∀ x, f x = g x) : f = g

{A : Type u_2}
{B : Type u_3}
[AddMonoid A]
[AddMonoid B]
[TopologicalSpace A]
[TopologicalSpace B]
{f g : ContinuousAddMonoidHom A B}
(h : ∀ (x : A), f x = g x)


/-- If `f : E → F` has an invertible derivative `f'` at `a` in the sense of strict differentiability
and `g (f x) = x` in a neighborhood of `a`, then `g` has derivative `f'.symm` at `f a`.

For a version assuming `f (g y) = y` and continuity of `g` at `f a` but not `[CompleteSpace E]`
see `of_local_left_inverse`.  -/
theorem to_local_left_inverse (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) {g : F → E}
    (hg : ∀ᶠ x in 𝓝 a, g (f x) = x) : HasStrictFDerivAt g (f'.symm : F →L[𝕜] E) (f a)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace E]
{f : E → F}
{f' : E ≃L[𝕜] F}
{a : E}
(hf : HasStrictFDerivAt f (↑f') a)
{g : F → E}
(hg : ∀ᶠ (x : E) in 𝓝 a, g (f x) = x)


theorem Filter.EventuallyEq.mfderivWithin_eq (hs : UniqueMDiffWithinAt I s x) (hL : f₁ =ᶠ[𝓝[s] x] f)
    (hx : f₁ x = f x) : mfderivWithin I I' f₁ s x = (mfderivWithin I I' f s x : _)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f f₁ : M → M'}
{x : M}
{s : Set M}
[Is : SmoothManifoldWithCorners I M]
[I's : SmoothManifoldWithCorners I' M']
(hs : UniqueMDiffWithinAt I s x)
(hL : f₁ =ᶠ[𝓝[s] x] f)
(hx : f₁ x = f x)

mfderivWithin I I' f₁ s x = mfderivWithin I I' f s x


/-- A multiplicative action such that for all `c`,
the map `fun x ↦ c • x` is uniformly continuous. -/
@[to_additive]
class UniformContinuousConstSMul [SMul M X] : Prop where
  uniformContinuous_const_smul : ∀ c : M, UniformContinuous (c • · : X → X)

{M : Type v}
{X : Type x}
[UniformSpace X]
[SMul M X]
[self : UniformContinuousConstSMul M X]
(c : M)


theorem nonunits_inj {A B : ValuationSubring K} : A.nonunits = B.nonunits ↔ A = B

{K : Type u}
[Field K]
{A B : ValuationSubring K}


theorem not_isUnit_zero [Nontrivial M₀] : ¬IsUnit (0 : M₀)

{M₀ : Type u_2}
[MonoidWithZero M₀]
[Nontrivial M₀]


theorem ContDiffWithinAt.mono (h : ContDiffWithinAt 𝕜 n f s x) {t : Set E} (hst : t ⊆ s) :
    ContDiffWithinAt 𝕜 n f t x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ∞}
(h : ContDiffWithinAt 𝕜 n f s x)
{t : Set E}
(hst : t ⊆ s)


@[to_additive (attr := simp)]
theorem map.mk : map f (mk L) = mk (L.map fun x => (f x.1, x.2))

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

(FreeGroup.map f) (FreeGroup.mk L) = FreeGroup.mk (List.map (fun x => (f x.1, x.2)) L)


@[simp, norm_cast] theorem intCast_neg (a : Int) : ((-a : Int) : Rat) = -(a : Rat)


/-- Riemann zeta functional equation, formulated for `Λ`: for any complex `s` we have
`Λ (1 - s) = Λ s`. -/
theorem completedRiemannZeta_one_sub (s : ℂ) :
    completedRiemannZeta (1 - s) = completedRiemannZeta s


@[simp]
theorem counitBialgHom_toCoalgHom :
    counitBialgHom R A = Coalgebra.counitCoalgHom R A

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

↑(Bialgebra.counitBialgHom R A) = Coalgebra.counitCoalgHom R A


/--
To construct an isomorphism of algebras, it suffices to give an isomorphism of the carriers which
commutes with the structure morphisms.
-/
@[simps]
def isoMk {A B : Algebra T} (h : A.A ≅ B.A)
    (w : (T : C ⥤ C).map h.hom ≫ B.a = A.a ≫ h.hom := by aesop_cat) : A ≅ B

(w : CategoryTheory.CategoryStruct.comp (T.map h.hom) B.a = CategoryTheory.CategoryStruct.comp A.a h.hom := by
  aesop_cat)

(CategoryTheory.Monad.Algebra.isoMk h w).inv.f = h.inv


/-- Adding an open immersion into an open cover gives another open cover. -/
@[simps]
def OpenCover.add {X Y : Scheme.{u}} (𝒰 : X.OpenCover) (f : Y ⟶ X) [IsOpenImmersion f] :
    X.OpenCover

{X Y : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : Y ⟶ X)
[AlgebraicGeometry.IsOpenImmersion f]
(i : Option 𝒰.J)


theorem deriv_single (i : ι) (y : 𝕜) :
    deriv (Pi.single (f := fun _ ↦ 𝕜) i) y = Pi.single i (1 : 𝕜)

{𝕜 : Type u_1}
{ι : Type u_2}
[DecidableEq ι]
[Fintype ι]
[NontriviallyNormedField 𝕜]
(i : ι)
(y : 𝕜)


theorem fg_pi {ι : Type*} {M : ι → Type*} [Finite ι] [∀ i, AddCommMonoid (M i)]
    [∀ i, Module R (M i)] {p : ∀ i, Submodule R (M i)} (hsb : ∀ i, (p i).FG) :
    (Submodule.pi Set.univ p).FG

{R : Type u_1}
[Semiring R]
{ι : Type u_4}
{M : ι → Type u_5}
[Finite ι]
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
{p : (i : ι) → Submodule R (M i)}
(hsb : ∀ (i : ι), (p i).FG)


@[to_additive]
theorem topologicalGroup_sInf {ts : Set (TopologicalSpace G)}
    (h : ∀ t ∈ ts, @TopologicalGroup G t _) : @TopologicalGroup G (sInf ts) _

{G : Type w}
[AddGroup G]
{ts : Set (TopologicalSpace G)}
(h : ∀ t ∈ ts, TopologicalAddGroup G)


@[simp]
lemma single₀_obj_zero (A : V) :
    ((single₀ V).obj A).X 0 = A

((CochainComplex.single₀ V).obj A).X 0 = A


theorem set_biInter_option_toFinset (o : Option α) (f : α → Set β) :
    ⋂ x ∈ o.toFinset, f x = ⋂ x ∈ o, f x

{α : Type u_2}
{β : Type u_3}
(o : Option α)
(f : α → Set β)


@[simp]
theorem nonempty_Iio [NoMinOrder α] : (Iio a).Nonempty

{α : Type u_1}
[Preorder α]
{a : α}
[NoMinOrder α]


theorem Pairwise.and_mem {l : List α} :
    Pairwise R l ↔ Pairwise (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l

{α : Type u_1}
{R : α → α → Prop}
{l : List α}

List.Pairwise R l ↔ List.Pairwise (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l


theorem self_mem_adjoin_singleton (x : A) : x ∈ adjoin R ({x} : Set A)

(R : Type uR)
{A : Type uA}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(x : A)


@[simp]
theorem coe_sup' : ((s.sup' H f : α) : WithBot α) = s.sup ((↑) ∘ f)

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

↑(s.sup' H f) = s.sup (WithBot.some ∘ f)


@[simp] theorem cast_eq {α : Sort u} (h : α = α) (a : α) : cast h a = a


protected theorem lt_sub_left_of_add_lt {a b c : Int} (h : a + b < c) : b < c - a