/-- The characteristic predicate for localized module.
`IsLocalizedModule S f` describes that `f : M ⟶ M'` is the localization map identifying `M'` as
`LocalizedModule S M`.
-/
@[mk_iff] class IsLocalizedModule : Prop where
  map_units : ∀ x : S, IsUnit (algebraMap R (Module.End R M') x)
  surj' : ∀ y : M', ∃ x : M × S, x.2 • y = f x.1
  exists_of_eq : ∀ {x₁ x₂}, f x₁ = f x₂ → ∃ c : S, c • x₁ = c • x₂

{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'}
[self : IsLocalizedModule S f]
(y : M')


@[simp]
theorem toLinearMap_apply (x : A₁) : e.toLinearMap x = e x

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


/-- If `η_A` is a split monomorphism, then `A` is in the reflective subcategory. -/
theorem mem_essImage_of_unit_isSplitMono [Reflective i] {A : C}
    [IsSplitMono ((reflectorAdjunction i).unit.app A)] : A ∈ i.essImage

[CategoryTheory.IsSplitMono ((CategoryTheory.reflectorAdjunction i).unit.app A)]


theorem sdiff_nonempty : (s \ t).Nonempty ↔ ¬s ⊆ t

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


@[simp] lemma δ_units_smul (k : Rˣ) (z : Cochain F G n) : δ n m (k • z) = k • δ n m z

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

CochainComplex.HomComplex.δ n m (k • z) = k • CochainComplex.HomComplex.δ n m z


theorem piecewise_mem_Icc {s : Set ι} [∀ j, Decidable (j ∈ s)] {f₁ f₂ g₁ g₂ : ∀ i, α i}
    (h₁ : ∀ i ∈ s, f₁ i ∈ Icc (g₁ i) (g₂ i)) (h₂ : ∀ i ∉ s, f₂ i ∈ Icc (g₁ i) (g₂ i)) :
    s.piecewise f₁ f₂ ∈ Icc g₁ g₂

(h₁ : ∀ i ∈ s, f₁ i ∈ Set.Icc (g₁ i) (g₂ i))

(h₂ : ∀ i ∉ s, f₂ i ∈ Set.Icc (g₁ i) (g₂ i))


theorem cast_castAdd_left {n n' m : Nat} (i : Fin n') (h : n' + m = n + m) :
    cast h (castAdd m i) = castAdd m (cast (Nat.add_right_cancel h) i)

Fin.cast h (Fin.castAdd m i) = Fin.castAdd m (Fin.cast ⋯ i)


/-- A unit trinomial is irreducible if it is coprime with its mirror -/
theorem irreducible_of_isCoprime (hp : p.IsUnitTrinomial) (h : IsCoprime p p.mirror) :
    Irreducible p

{p : Polynomial ℤ}
(hp : p.IsUnitTrinomial)
(h : IsCoprime p p.mirror)


lemma hasColimitsOfSize : HasColimitsOfSize.{v, u} AddCommGrp.{max u v w}

CategoryTheory.Limits.HasColimitsOfSize.{v, u, max (max u v) w, max (max (u + 1) (v + 1)) (w + 1)} AddCommGrp


@[simp] lemma toMul_smul [SMul α β] (a) (b : β) : (toMul a : α) • b = a +ᵥ b

{α : Type u_7}
{β : Type u_8}
[SMul α β]
(a : Additive α)
(b : β)


@[simp]
theorem compl_top : (⊤ : α)ᶜ = ⊥


/-- The sum of two lower semicontinuous functions is lower semicontinuous. Formulated with an
explicit continuity assumption on addition, for application to `EReal`. The unprimed version of
the lemma uses `[ContinuousAdd]`. -/
theorem LowerSemicontinuous.add' {f g : α → γ} (hf : LowerSemicontinuous f)
    (hg : LowerSemicontinuous g)
    (hcont : ∀ x, ContinuousAt (fun p : γ × γ => p.1 + p.2) (f x, g x)) :
    LowerSemicontinuous fun z => f z + g z

(hcont : ∀ (x : α), ContinuousAt (fun p => p.1 + p.2) (f x, g x))


/-- The determinants of a `LinearEquiv` and its inverse multiply to 1. -/
@[simp]
theorem LinearEquiv.det_mul_det_symm {A : Type*} [CommRing A] [Module A M] (f : M ≃ₗ[A] M) :
    LinearMap.det (f : M →ₗ[A] M) * LinearMap.det (f.symm : M →ₗ[A] M) = 1

{M : Type u_2}
[AddCommGroup M]
{A : Type u_5}
[CommRing A]
[Module A M]
(f : M ≃ₗ[A] M)

LinearMap.det ↑f * LinearMap.det ↑f.symm = 1


lemma quasiIso_shift_iff {K L : CochainComplex C ℤ} (φ : K ⟶ L) (n : ℤ) :
    QuasiIso (φ⟦n⟧') ↔ QuasiIso φ

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.CategoryWithHomology C]
{K L : CochainComplex C ℤ}
(φ : K ⟶ L)
(n : ℤ)

QuasiIso ((CategoryTheory.shiftFunctor (HomologicalComplex C (ComplexShape.up ℤ)) n).map φ) ↔ QuasiIso φ


theorem norm_iteratedFDeriv_fderiv {n : ℕ} :
    ‖iteratedFDeriv 𝕜 n (fderiv 𝕜 f) x‖ = ‖iteratedFDeriv 𝕜 (n + 1) f x‖

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{n : ℕ}


/-- Either `f = ⊥` or `Filter.NeBot f`. This is a version of `eq_or_ne` that uses `Filter.NeBot`
as the second alternative, to be used as an instance. -/
theorem eq_or_neBot (f : Filter α) : f = ⊥ ∨ NeBot f


@[simp]
theorem cast_one (h : m ∣ n) : (cast (1 : ZMod n) : R) = 1

{n : ℕ}
{R : Type u_1}
[Ring R]
{m : ℕ}
[CharP R m]
(h : m ∣ n)


theorem le_iff (l m : Language α) : l ≤ m ↔ l + m = m


theorem StrictConcaveOn.dual (hf : StrictConcaveOn 𝕜 s f) : StrictConvexOn 𝕜 s (toDual ∘ f)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[SMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : StrictConcaveOn 𝕜 s f)

StrictConvexOn 𝕜 s (⇑OrderDual.toDual ∘ f)


@[simp]
theorem isLittleO_pure {x} : f'' =o[pure x] g'' ↔ f'' x = 0

{α : Type u_1}
{E'' : Type u_9}
{F'' : Type u_10}
[NormedAddCommGroup E'']
[NormedAddCommGroup F'']
{f'' : α → E''}
{g'' : α → F''}
{x : α}


@[to_additive]
theorem finiteIndex_of_finite_quotient [Finite (G ⧸ H)] : FiniteIndex H

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


theorem srange_top_iff_surjective {f : F} :
    srange f = (⊤ : NonUnitalSubsemiring S) ↔ Function.Surjective (f : R → S)

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
{f : F}

NonUnitalRingHom.srange f = ⊤ ↔ Function.Surjective ⇑f


theorem min_choice (a b : α) : min a b = a ∨ min a b = b


theorem cardinal_mk_eq_sum : #(WType β) = sum (fun a : α => #(WType β) ^ #(β a))

Cardinal.mk (WType β) = Cardinal.sum fun a => Cardinal.mk (WType β) ^ Cardinal.mk (β a)


theorem smul_sup (a : α) (S T : Submonoid M) : a • (S ⊔ T) = a • S ⊔ a • T

{α : Type u_1}
{M : Type u_3}
[Monoid M]
[Monoid α]
[MulDistribMulAction α M]
(a : α)
(S T : Submonoid M)


@[to_additive]
theorem IsClosed.smul {s : Set α} (hs : IsClosed s) (c : G) : IsClosed (c • s)

{α : Type u_2}
{G : Type u_4}
[TopologicalSpace α]
[Group G]
[MulAction G α]
[ContinuousConstSMul G α]
{s : Set α}
(hs : IsClosed s)
(c : G)


/-- The range of `pure : α → Ultrafilter α` is dense in `Ultrafilter α`. -/
theorem denseRange_pure : DenseRange (pure : α → Ultrafilter α)


theorem extend_target : (f.extend I).target = I.symm ⁻¹' f.target ∩ range I

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

(f.extend I).target = ↑I.symm ⁻¹' f.target ∩ Set.range ↑I


/-- Same as limsup_const applied to `⊥` but without the `NeBot f` assumption -/
@[simp]
theorem limsup_const_bot {f : Filter β} : limsup (fun _ : β => (⊥ : α)) f = (⊥ : α)

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


@[fun_prop]
theorem HasStrictFDerivAt.mul' {x : E} (ha : HasStrictFDerivAt a a' x)
    (hb : HasStrictFDerivAt b b' x) :
    HasStrictFDerivAt (fun y => a y * b y) (a x • b' + a'.smulRight (b x)) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a b : E → 𝔸}
{a' b' : E →L[𝕜] 𝔸}
{x : E}
(ha : HasStrictFDerivAt a a' x)
(hb : HasStrictFDerivAt b b' x)


lemma GrothendieckTopology.preservesSheafification_iff_of_adjunctions :
    J.PreservesSheafification F ↔ ∀ (P : Cᵒᵖ ⥤ A),
      IsIso (G₂.map (whiskerRight (adj₁.unit.app P) F))

(J : CategoryTheory.GrothendieckTopology C)

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

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

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

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

J.PreservesSheafification F ↔
  ∀ (P : CategoryTheory.Functor Cᵒᵖ A), CategoryTheory.IsIso (G₂.map (CategoryTheory.whiskerRight (adj₁.unit.app P) F))


@[to_additive]
theorem eq_mul_of_inv_mul_eq (h : b⁻¹ * a = c) : a = b * c

{G : Type u_3}
[AddGroup G]
{a b c : G}
(h : -b + a = c)


@[to_additive (attr := ext)]
theorem ext {f g : LocalizationMap S N} (h : ∀ x, f.toMap x = g.toMap x) : f = g

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{f g : S.LocalizationMap N}
(h : ∀ (x : M), f.toMap x = g.toMap x)


/-- A version of `Equiv.optionCongr` for `WithOne`. -/
@[to_additive (attr := simps apply) "A version of `Equiv.optionCongr` for `WithZero`."]
def _root_.MulEquiv.withOneCongr (e : α ≃* β) : WithOne α ≃* WithOne β

{α : Type u}
{β : Type v}
[Add α]
[Add β]
(e : α ≃+ β)
(a : WithZero α)

e.withZeroCongr a = (WithZero.map e.toAddHom) a


@[simp]
theorem lcm_add (s₁ s₂ : Multiset α) : (s₁ + s₂).lcm = GCDMonoid.lcm s₁.lcm s₂.lcm

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
(s₁ s₂ : Multiset α)


theorem coeff_algebraMap [Nontrivial S] (h : IsAdjoinRootMonic S f) (x : R) :
    h.coeff (algebraMap R S x) = Pi.single 0 x

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

h.coeff ((algebraMap R S) x) = Pi.single 0 x


theorem choose_mem (hp : ∃ a, a ∈ l ∧ p a) : choose p l hp ∈ l

{α : Type u}
(p : α → Prop)
[DecidablePred p]
(l : List α)
(hp : ∃ a, a ∈ l ∧ p 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}
[AddSemigroup α]
[AddCommSemigroup β]
{f g : α → β}
(hf : IsAddHom f)
(hg : IsAddHom g)


/-- The equivalence between `BoolAlg` and itself induced by `OrderDual` both ways. -/
@[simps functor inverse]
def dualEquiv : BoolAlg ≌ BoolAlg


@[ext]
theorem ext {η : Kernel α β} (h : ∀ a, κ a = η a) : κ = η

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ η : ProbabilityTheory.Kernel α β}
(h : ∀ (a : α), κ a = η a)


theorem coe_inv_le : (↑r⁻¹ : ℝ≥0∞) ≤ (↑r)⁻¹

↑r⁻¹ ≤ (↑r)⁻¹


theorem wittStructureRat_rec_aux (Φ : MvPolynomial idx ℚ) (n : ℕ) :
    wittStructureRat p Φ n * C ((p : ℚ) ^ n) =
      bind₁ (fun b => rename (fun i => (b, i)) (W_ ℚ n)) Φ -
        ∑ i ∈ range n, C ((p : ℚ) ^ i) * wittStructureRat p Φ i ^ p ^ (n - i)

(p : ℕ)
{idx : Type u_2}
[hp : Fact (Nat.Prime p)]
(Φ : MvPolynomial idx ℚ)
(n : ℕ)

wittStructureRat p Φ n * MvPolynomial.C (↑p ^ n) =
  (MvPolynomial.bind₁ fun b => (MvPolynomial.rename fun i => (b, i)) (W_ ℚ n)) Φ -
    ∑ i ∈ Finset.range n, MvPolynomial.C (↑p ^ i) * wittStructureRat p Φ i ^ p ^ (n - i)


@[simp] lemma coe_mk (f : A → M)
    (map_zero_eq_one' : f 0 = 1) (map_add_eq_mul' : ∀ a b : A, f (a + b) = f a * f b) :
    AddChar.mk f map_zero_eq_one' map_add_eq_mul' = f

(map_add_eq_mul' : ∀ (a b : A), f (a + b) = f a * f b)

⇑{ toFun := f, map_zero_eq_one' := map_zero_eq_one', map_add_eq_mul' := map_add_eq_mul' } = f


theorem vector_toList {n} : Primrec (@Vector.toList α n)


theorem isMaximal_of_irreducible [CommRing R] [IsPrincipalIdealRing R] {p : R}
    (hp : Irreducible p) : Ideal.IsMaximal (span R ({p} : Set R))

{R : Type u}
[CommRing R]
[IsPrincipalIdealRing R]
{p : R}
(hp : Irreducible p)


/-- If the angle between three points is `π / 2`, the first and third points are not equal. -/
theorem left_ne_right_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = (π / 2 : ℝ)) :
    p₁ ≠ p₃

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


theorem Differentiable.arsinh (h : Differentiable ℝ f) : Differentiable ℝ fun x => arsinh (f x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
(h : Differentiable ℝ f)

Differentiable ℝ fun x => Real.arsinh (f x)


@[reassoc (attr := simp)]
theorem fac_left [hsq : HasLift sq] : i ≫ sq.lift = f

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{A B X Y : C}
{f : A ⟶ X}
{i : A ⟶ B}
{p : X ⟶ Y}
{g : B ⟶ Y}
(sq : CategoryTheory.CommSq f i p g)
[hsq : sq.HasLift]

CategoryTheory.CategoryStruct.comp i sq.lift = f


@[simp]
theorem prodMonoidal_rightUnitor_inv_fst (X : C₁ × C₂) :
    ((ρ_ X).inv : X ⟶ X ⊗ 𝟙_ _).1 = (ρ_ X.1).inv

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

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


/-- If advancing one step from `a` on `f` leads to `a' : α`, then `f.fix a = f.fix a'` -/
theorem fix_fwd_eq {f : α →. β ⊕ α} {a a' : α} (ha' : Sum.inr a' ∈ f a) : f.fix a = f.fix a'

{α : Type u_1}
{β : Type u_2}
{f : α →. β ⊕ α}
{a a' : α}
(ha' : Sum.inr a' ∈ f a)


@[simp, push_cast]
theorem dist_eq_hammingDist (x y : Hamming β) :
    dist x y = hammingDist (ofHamming x) (ofHamming y)

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

dist x y = ↑(hammingDist (Hamming.ofHamming x) (Hamming.ofHamming y))


@[simp]
theorem continuousMultilinearCurryRightEquiv_symm_apply (f : ContinuousMultilinearMap 𝕜 Ei G)
    (v : ∀ i : Fin n, Ei <| castSucc i) (x : Ei (last n)) :
    (continuousMultilinearCurryRightEquiv 𝕜 Ei G).symm f v x = f (snoc v x)

[(i : Fin n.succ) → NormedAddCommGroup (Ei i)]

[(i : Fin n.succ) → NormedSpace 𝕜 (Ei i)]

(((continuousMultilinearCurryRightEquiv 𝕜 Ei G).symm f) v) x = f (Fin.snoc v x)


@[to_additive]
theorem tprod_apply [∀ x, T2Space (π x)] {f : ι → ∀ x, π x} {x : α} (hf : Multipliable f) :
    (∏' i, f i) x = ∏' i, f i x

{α : Type u_1}
{ι : Type u_5}
{π : α → Type u_6}
[(x : α) → AddCommMonoid (π x)]
[(x : α) → TopologicalSpace (π x)]
[∀ (x : α), T2Space (π x)]
{f : ι → (x : α) → π x}
{x : α}
(hf : Summable f)

tsum (fun i => f i) x = ∑' (i : ι), f i x


/-- A Galois insertion is a Galois connection where `l ∘ u = id`. It also contains a constructive
choice function, to give better definitional equalities when lifting order structures. Dual
to `GaloisCoinsertion` -/
structure GaloisInsertion {α β : Type*} [Preorder α] [Preorder β] (l : α → β) (u : β → α) where
  /-- A contructive choice function for images of `l`. -/
  choice : ∀ x : α, u (l x) ≤ x → β
  /-- The Galois connection associated to a Galois insertion. -/
  gc : GaloisConnection l u
  /-- Main property of a Galois insertion. -/
  le_l_u : ∀ x, x ≤ l (u x)
  /-- Property of the choice function. -/
  choice_eq : ∀ a h, choice a h = l a

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(self : GaloisInsertion l u)


theorem supDegree_mul_le [CovariantClass B B (· + ·) (· ≤ ·)]
    [CovariantClass B B (Function.swap (· + ·)) (· ≤ ·)] :
    (p * q).supDegree D ≤ p.supDegree D + q.supDegree D

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

[CovariantClass B B (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]

AddMonoidAlgebra.supDegree D (p * q) ≤ AddMonoidAlgebra.supDegree D p + AddMonoidAlgebra.supDegree D q


@[simp] lemma lt_find_iff (h : ∃ n : ℕ, p n) (n : ℕ) : n < Nat.find h ↔ ∀ m ≤ n, ¬ p m

{p : ℕ → Prop}
[DecidablePred p]
(h : ∃ n, p n)
(n : ℕ)

n < Nat.find h ↔ ∀ (m : ℕ), m ≤ n → ¬p m


theorem coinduced_of_isColimit {F : J ⥤ TopCat.{max v u}} (c : Cocone F) (hc : IsColimit c) :
    c.pt.str = ⨆ j, (F.obj j).str.coinduced (c.ι.app j)

(hc : CategoryTheory.Limits.IsColimit c)

c.pt.str = ⨆ j, TopologicalSpace.coinduced (⇑(c.ι.app j)) (F.obj j).str


theorem le_map_sSup_subset_fixedPoints (A : Set α) (hA : A ⊆ fixedPoints f) :
    sSup A ≤ f (sSup A)

{α : Type u}
[CompleteLattice α]
(f : α →o α)
(A : Set α)
(hA : A ⊆ Function.fixedPoints ⇑f)


/-- Möbius inversion for functions to a `CommGroup`, where the equalities only hold on a
well-behaved set. -/
theorem prod_eq_iff_prod_pow_moebius_eq_on [CommGroup R] {f g : ℕ → R}
    (s : Set ℕ) (hs : ∀ m n, m ∣ n → n ∈ s → m ∈ s) :
    (∀ n > 0, n ∈ s → (∏ i ∈ n.divisors, f i) = g n) ↔
      ∀ n > 0, n ∈ s → (∏ x ∈ n.divisorsAntidiagonal, g x.snd ^ μ x.fst) = f n

(hs : ∀ (m n : ℕ), m ∣ n → n ∈ s → m ∈ s)

(∀ n > 0, n ∈ s → ∏ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, n ∈ s → ∏ x ∈ n.divisorsAntidiagonal, g x.2 ^ ArithmeticFunction.moebius x.1 = f n


/-- The obvious map `PushoutCocone f g → PullbackCone f.unop g.unop` -/
@[simps!]
def unop {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) :
    PullbackCone f.unop g.unop

(c : CategoryTheory.Limits.PushoutCocone f g)

∀ (X_1 : CategoryTheory.Limits.WalkingCospan),
  c.unop.π.app X_1 =
    (c.ι.app X_1).unop ≫
      (Option.rec (CategoryTheory.Iso.refl X)
            (fun val =>
              CategoryTheory.Limits.WalkingPair.rec (CategoryTheory.Iso.refl Y) (CategoryTheory.Iso.refl Z) val)
            X_1).inv.unop


@[to_additive]
lemma prod_fiberwise_of_maps_to' {g : ι → κ} (h : ∀ i ∈ s, g i ∈ t) (f : κ → α) :
    ∏ j ∈ t, ∏ _i ∈ s.filter fun i ↦ g i = j, f j = ∏ i ∈ s, f (g i)

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[CommMonoid α]
{s : Finset ι}
{t : Finset κ}
[DecidableEq κ]
{g : ι → κ}
(h : ∀ i ∈ s, g i ∈ t)
(f : κ → α)

∏ j ∈ t, ∏ _i ∈ Finset.filter (fun i => g i = j) s, f j = ∏ i ∈ s, f (g i)


theorem add_emod (a b n : Int) : (a + b) % n = (a % n + b % n) % n


@[simp]
theorem edgeSet_toSubgraph (p : G.Walk u v) : p.toSubgraph.edgeSet = { e | e ∈ p.edges }

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

p.toSubgraph.edgeSet = {e | e ∈ p.edges}


@[ext] theorem ext {a b : ℍ} (h : (a : ℂ) = b) : a = b


@[simp]
theorem range_eq_empty_of_isEmpty {β} [hα : IsEmpty α] (f : α →ₛ β) : f.range = ∅

{α : Type u_1}
[MeasurableSpace α]
{β : Type u_5}
[hα : IsEmpty α]
(f : MeasureTheory.SimpleFunc α β)


theorem IsNormal.apply_le_nfp {f} (H : IsNormal f) {a b} : f b ≤ nfp f a ↔ b ≤ nfp f a

{f : Ordinal.{u_1} → Ordinal.{u_1}}
(H : Ordinal.IsNormal f)
{a b : Ordinal.{u_1}}

f b ≤ Ordinal.nfp f a ↔ b ≤ Ordinal.nfp f a


@[simp] lemma sum_base_iff {M : Matroid α} {N : Matroid β} {B : Set (α ⊕ β)} :
    (M.sum N).Base B ↔ M.Base (.inl ⁻¹' B) ∧ N.Base (.inr ⁻¹' B)

{α : Type u}
{β : Type v}
{M : Matroid α}
{N : Matroid β}
{B : Set (α ⊕ β)}

(M.sum N).Base B ↔ M.Base (Sum.inl ⁻¹' B) ∧ N.Base (Sum.inr ⁻¹' B)


lemma mor₂_eq_zero_iff_epi₁ : T.mor₂ = 0 ↔ Epi T.mor₁

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


/-- Easy inclusion: a differentiability point with derivative in `K` belongs to `D f K`. -/
theorem differentiable_set_subset_D :
    { x | DifferentiableAt 𝕜 f x ∧ fderiv 𝕜 f x ∈ K } ⊆ D f K

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
(K : Set (E →L[𝕜] F))

{x | DifferentiableAt 𝕜 f x ∧ fderiv 𝕜 f x ∈ K} ⊆ FDerivMeasurableAux.D f K


/-- The class number of a function field is `1` iff the ring of integers is a PID. -/
theorem classNumber_eq_one_iff :
    classNumber Fq F = 1 ↔ IsPrincipalIdealRing (ringOfIntegers Fq F)

[IsScalarTower (Polynomial Fq) (RatFunc Fq) F]

FunctionField.classNumber Fq F = 1 ↔ IsPrincipalIdealRing ↥(FunctionField.ringOfIntegers Fq F)


@[simp] lemma ker_comap (m : α → β) (f : Filter β) : ker (comap m f) = m ⁻¹' ker f

{α : Type u_2}
{β : Type u_3}
(m : α → β)
(f : Filter β)


@[simp] theorem recDiagAux_zero_right {motive : Nat → Nat → Sort _}
    (zero_left : ∀ n, motive 0 n) (zero_right : ∀ m, motive m 0)
    (succ_succ : ∀ m n, motive m n → motive (m+1) (n+1)) (m)
    (h : zero_left 0 = zero_right 0 := by first | assumption | trivial) :
    Nat.recDiagAux zero_left zero_right succ_succ m 0 = zero_right m

(succ_succ : (m n : Nat) → motive m n → motive (m + 1) (n + 1))


@[reassoc (attr := simp)]
lemma singleObjCyclesSelfIso_inv_naturality :
    (singleObjCyclesSelfIso c j A).inv ≫ cyclesMap ((single C c j).map f) j =
      f ≫ (singleObjCyclesSelfIso c j B).inv

(HomologicalComplex.singleObjCyclesSelfIso c j A).inv ≫
    HomologicalComplex.cyclesMap ((HomologicalComplex.single C c j).map f) j =
  f ≫ (HomologicalComplex.singleObjCyclesSelfIso c j B).inv


theorem nontrivial_of_pair_subset {x y} (hxy : x ≠ y) (h : {x, y} ⊆ s) : s.Nontrivial

{α : Type u}
{s : Set α}
{x y : α}
(hxy : x ≠ y)
(h : {x, y} ⊆ s)


@[to_additive]
theorem comap_comap (S : Subsemigroup P) (g : N →ₙ* P) (f : M →ₙ* N) :
    (S.comap g).comap f = S.comap (g.comp f)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[Mul M]
[Mul N]
[Mul P]
(S : Subsemigroup P)
(g : N →ₙ* P)
(f : M →ₙ* N)

Subsemigroup.comap f (Subsemigroup.comap g S) = Subsemigroup.comap (g.comp f) S


theorem mem_reProdIm {z : ℂ} {s t : Set ℝ} : z ∈ s ×ℂ t ↔ z.re ∈ s ∧ z.im ∈ t


@[simp]
theorem pointwise_smul_toAddSubmonoid (a : α) (S : AddSubgroup A) :
    (a • S).toAddSubmonoid = a • S.toAddSubmonoid

{α : Type u_1}
{A : Type u_3}
[AddGroup A]
[Monoid α]
[DistribMulAction α A]
(a : α)
(S : AddSubgroup A)


@[simp]
theorem mulLeftRight_apply (a b x : A) : mulLeftRight R (a, b) x = a * x * b

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
(a b x : A)

(LinearMap.mulLeftRight R (a, b)) x = a * x * b


@[simp]
theorem comp_id (f : Q₁ →qᵢ Q₂) : f.comp (id Q₁) = f

{R : Type u_2}
{M₁ : Type u_4}
{M₂ : Type u_5}
{N : Type u_8}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid N]
[Module R M₁]
[Module R M₂]
[Module R N]
{Q₁ : QuadraticMap R M₁ N}
{Q₂ : QuadraticMap R M₂ N}
(f : Q₁ →qᵢ Q₂)

f.comp (QuadraticMap.Isometry.id Q₁) = f


/-- The image of a right invariant measure under a left action is right invariant, assuming that
the action preserves multiplication. -/
@[to_additive "The image of a right invariant measure under a left additive action is right
 invariant, assuming that the action preserves addition."]
theorem isMulRightInvariant_map_smul
    {α} [SMul α G] [SMulCommClass α Gᵐᵒᵖ G] [MeasurableSpace α] [MeasurableSMul α G]
    [IsMulRightInvariant μ] (a : α) :
    IsMulRightInvariant (map (a • · : G → G) μ)

{G : Type u_2}
[MeasurableSpace G]
[Semigroup G]
[MeasurableMul G]
{μ : MeasureTheory.Measure G}
{α : Type u_4}
[SMul α G]
[SMulCommClass α Gᵐᵒᵖ G]
[MeasurableSpace α]
[MeasurableSMul α G]
[μ.IsMulRightInvariant]
(a : α)

(MeasureTheory.Measure.map (fun x => a • x) μ).IsMulRightInvariant


@[simp]
theorem volume_Iio {a : ℝ} : volume (Iio a) = ∞


/-- The ordinal approximants of the least fixed point are stabilizing
  when reaching a fixed point of f -/
theorem lfpApprox_eq_of_mem_fixedPoints {a b : Ordinal} (h_init : x ≤ f x) (h_ab : a ≤ b)
    (h : lfpApprox f x a ∈ fixedPoints f) : lfpApprox f x b = lfpApprox f x a

(h : OrdinalApprox.lfpApprox f x a ∈ Function.fixedPoints ⇑f)

OrdinalApprox.lfpApprox f x b = OrdinalApprox.lfpApprox f x a


/-- The left unitor as a natural isomorphism. -/
@[simps!]
def leftUnitorNatIso : tensorUnitLeft C ≅ 𝟭 C

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

(CategoryTheory.MonoidalCategory.leftUnitorNatIso C).hom.app X = (CategoryTheory.MonoidalCategory.leftUnitor X).hom


lemma continuous_iff {Y : Type*} [TopologicalSpace Y] (f : OnePoint X → Y) : Continuous f ↔
    Tendsto (fun x : X ↦ f x) (coclosedCompact X) (𝓝 (f ∞)) ∧ Continuous (fun x : X ↦ f x)

{X : Type u_1}
[TopologicalSpace X]
{Y : Type u_2}
[TopologicalSpace Y]
(f : OnePoint X → Y)

Continuous f ↔
  Filter.Tendsto (fun x => f ↑x) (Filter.coclosedCompact X) (𝓝 (f OnePoint.infty)) ∧ Continuous fun x => f ↑x


@[simp]
theorem compHahnSeries_add (u v : U) :
    compHahnSeries A B (u + v) = compHahnSeries A B u + compHahnSeries A B v

{Γ : Type u_5}
{Γ' : Type u_6}
[OrderedCancelAddCommMonoid Γ]
[OrderedCancelAddCommMonoid Γ']
{R : Type u_7}
[CommRing R]
{U : Type u_8}
{V : Type u_9}
{W : Type u_10}
[AddCommGroup U]
[Module R U]
[AddCommGroup V]
[Module R V]
[AddCommGroup W]
[Module R W]
(A : HVertexOperator Γ R V W)
(B : HVertexOperator Γ' R U V)
(u v : U)

A.compHahnSeries B (u + v) = A.compHahnSeries B u + A.compHahnSeries B v


@[simp, norm_cast]
theorem coe_smul [SMulZeroClass S R] (s : S) (r : R) : (↑(s • r) : ℍ[R]) = s • (r : ℍ[R])

{S : Type u_1}
{R : Type u_3}
[CommRing R]
[SMulZeroClass S R]
(s : S)
(r : R)


theorem rel_eq {s t : Multiset α} : Rel (· = ·) s t ↔ s = t

Multiset.Rel (fun x x_1 => x = x_1) s t ↔ s = t


/-- The binary product functor. -/
@[simps]
def prod.functor : C ⥤ C ⥤ C

(CategoryTheory.Limits.prod.functor.obj X).obj Y = (X ⨯ Y)


@[simp]
theorem coeSucc_eq_succ {a : Fin n} : castSucc a + 1 = a.succ


@[simp]
theorem gcd_one {n : ℕ+} : gcd n 1 = 1


theorem out' : ∀ {it}, ValidFor l r it → it = ⟨⟨l.reverse ++ r⟩, ⟨utf8Len l.reverse⟩⟩

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

String.Iterator.ValidFor l r it → it = { s := { data := l.reverse ++ r }, i := { byteIdx := String.utf8Len l.reverse } }


theorem sum_add [Countable ι] (κ η : ι → Kernel α β) :
    (Kernel.sum fun n => κ n + η n) = Kernel.sum κ + Kernel.sum η

(κ η : ι → ProbabilityTheory.Kernel α β)

(ProbabilityTheory.Kernel.sum fun n => κ n + η n) = ProbabilityTheory.Kernel.sum κ + ProbabilityTheory.Kernel.sum η


theorem gcd_mul_lcm (m n : Nat) : gcd m n * lcm m n = m * n


@[simp]
theorem toList_nil : toList (@nil α) = []


@[reassoc (attr := simp)]
lemma p_opcyclesMap : S₁.pOpcycles ≫ opcyclesMap φ = φ.τ₂ ≫ S₂.pOpcycles

CategoryTheory.CategoryStruct.comp S₁.pOpcycles (CategoryTheory.ShortComplex.opcyclesMap φ) =
  CategoryTheory.CategoryStruct.comp φ.τ₂ S₂.pOpcycles


@[to_additive (attr := aesop safe -100 (rule_sets := [Continuous]), fun_prop)]
theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n

{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[AddMonoid M]
[ContinuousAdd M]
{f : X → M}
(h : Continuous f)
(n : ℕ)


@[to_additive sub.instNeBot]
lemma div.instNeBot [NeBot f] [NeBot g] : NeBot (f / g)


/-- If `w₁ w₂` are words such that `w₁` reduces to `w₂`, then `w₂` is a sublist of `w₁`. -/
@[to_additive "If `w₁ w₂` are words such that `w₁` reduces to `w₂`, then `w₂` is a sublist of
  `w₁`."]
protected theorem sublist : Red L₁ L₂ → L₂ <+ L₁


theorem ofInt'_toZNum : ∀ n : ℕ, toZNum n = ZNum.ofInt' n


theorem ContinuousLinearMap.reApplyInnerSelf_apply (T : E →L[𝕜] E) (x : E) :
    T.reApplyInnerSelf x = re ⟪T x, x⟫

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

T.reApplyInnerSelf x = RCLike.re ⟪T x, x⟫_𝕜


@[to_additive]
theorem smooth_finset_prod' (h : ∀ i ∈ t, Smooth I' I (f i)) : Smooth I' I (∏ i ∈ t, f i)

{ι : Type u_1}
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{H : Type u_3}
[TopologicalSpace H]
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[CommMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{t : Finset ι}
{f : ι → M → G}
(h : ∀ i ∈ t, Smooth I' I (f i))


/-- The normal closure of `s` is the smallest normal subgroup containing `s`. -/
theorem normalClosure_le_normal {N : Subgroup G} [N.Normal] (h : s ⊆ N) : normalClosure s ≤ N

{G : Type u_1}
[Group G]
{s : Set G}
{N : Subgroup G}
[N.Normal]
(h : s ⊆ ↑N)


/-- The bijection `StructuredArrow (L.obj X) L ≃ StructuredArrow (L'.obj X) L'`
when `L` and `L'` are two localization functors for the same class of morphisms. -/
@[simps]
noncomputable def structuredArrowEquiv :
    StructuredArrow (L.obj X) L ≃ StructuredArrow (L'.obj X) L'

(f : CategoryTheory.StructuredArrow (L'.obj X) L')

(CategoryTheory.Localization.structuredArrowEquiv W L L').symm f =
  CategoryTheory.StructuredArrow.mk ((CategoryTheory.Localization.homEquiv W L' L) f.hom)


/-- If `s ⊆ t`, then `s ≤ t` in the colex order. Note the converse does not hold, as inclusion does
not form a linear order. -/
lemma toColex_le_toColex_of_subset (h : s ⊆ t) : toColex s ≤ toColex t

{α : Type u_1}
[PartialOrder α]
{s t : Finset α}
(h : s ⊆ t)


/-- If a multilinear map in finitely many variables on normed spaces is continuous, then it
satisfies the inequality `‖f m‖ ≤ C * ∏ i, ‖m i‖`, for some `C` which can be chosen to be
positive. -/
theorem exists_bound_of_continuous (hf : Continuous f) :
    ∃ C : ℝ, 0 < C ∧ ∀ m, ‖f m‖ ≤ C * ∏ i, ‖m i‖

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

∃ C, 0 < C ∧ ∀ (m : (i : ι) → E i), ‖f m‖ ≤ C * ∏ i : ι, ‖m i‖


/-- The functor from homological complexes to differential graded objects.
-/
@[simps]
def homologicalComplexToDGO :
    HomologicalComplex V (ComplexShape.up' b) ⥤
      DifferentialObject ℤ (GradedObjectWithShift b V)

(X : HomologicalComplex V (ComplexShape.up' b))

((HomologicalComplex.homologicalComplexToDGO b V).obj X).d i = X.d i ((fun b_1 => b_1 + { as := 1 }.as • b) i)


lemma mem_posFittingCompOf (x : L) (m : M) :
    m ∈ posFittingCompOf R M x ↔ ∀ (k : ℕ), ∃ n, (toEnd R L M x ^ k) n = m

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

m ∈ LieModule.posFittingCompOf R M x ↔ ∀ (k : ℕ), ∃ n, ((LieModule.toEnd R L M) x ^ k) n = m


@[simps]
instance Cocone.category : Category (Cocone F)

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


/-- An induction principle for `Cycle`. Use as `induction s`. -/
@[elab_as_elim, induction_eliminator]
theorem induction_on {C : Cycle α → Prop} (s : Cycle α) (H0 : C nil)
    (HI : ∀ (a) (l : List α), C ↑l → C ↑(a :: l)) : C s

(HI : ∀ (a : α) (l : List α), C ↑l → C ↑(a :: l))


@[simp] lemma induce_singleton_eq_top (v : V) : G.induce {v} = ⊤

{V : Type u_1}
(G : SimpleGraph V)
(v : V)


@[fun_prop]
theorem DifferentiableWithinAt.add_const (hf : DifferentiableWithinAt 𝕜 f s x) (c : F) :
    DifferentiableWithinAt 𝕜 (fun y => f y + c) s x

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


theorem toLinearEquiv_injective :
    Function.Injective (toLinearEquiv : (M₁ ≃SL[σ₁₂] M₂) → M₁ ≃ₛₗ[σ₁₂] M₂)

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


/-- `gramSchmidt` produces a triangular matrix of vectors when given a basis. -/
theorem gramSchmidt_triangular {i j : ι} (hij : i < j) (b : Basis ι 𝕜 E) :
    b.repr (gramSchmidt 𝕜 b i) j = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_3}
[LinearOrder ι]
[LocallyFiniteOrderBot ι]
[IsWellOrder ι fun x x_1 => x < x_1]
{i j : ι}
(hij : i < j)
(b : Basis ι 𝕜 E)


/-- `Finset.cons` version of `Finset.Ioc_insert_left`. -/
theorem Icc_eq_cons_Ioc (h : a ≤ b) : Icc a b = (Ioc a b).cons a left_not_mem_Ioc

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

Finset.Icc a b = Finset.cons a (Finset.Ioc a b) ⋯


@[simp] lemma sups_singleton : s ⊻ {b} = s.image (· ⊔ b)

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

s ⊻ {b} = Finset.image (fun x => x ⊔ b) s


lemma map_some {x y : F} (h : (W.baseChange F).toAffine.Nonsingular x y) :
    map W f (some h) = some ((W.baseChange_nonsingular f.injective ..).mpr h)

(h : (WeierstrassCurve.baseChange W F).toAffine.Nonsingular x y)

(WeierstrassCurve.Affine.Point.map W f) (WeierstrassCurve.Affine.Point.some h) = WeierstrassCurve.Affine.Point.some ⋯


/-- Function between 1-morphisms as a functor. -/
@[simps]
def mapFunctor (a b : B) : (a ⟶ b) ⥤ (F.obj a ⟶ F.obj b)

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.PrelaxFunctor B C)
(a b : B)

∀ {X Y : a ⟶ b} (η : X ⟶ Y), (F.mapFunctor a b).map η = F.map₂ η


theorem Lp_add_le_tsum_of_nonneg' (hp : 1 ≤ p) (hf : ∀ i, 0 ≤ f i) (hg : ∀ i, 0 ≤ g i)
    (hf_sum : Summable fun i => f i ^ p) (hg_sum : Summable fun i => g i ^ p) :
    (∑' i, (f i + g i) ^ p) ^ (1 / p) ≤ (∑' i, f i ^ p) ^ (1 / p) + (∑' i, g i ^ p) ^ (1 / p)

{ι : Type u}
{f g : ι → ℝ}
{p : ℝ}
(hp : 1 ≤ p)
(hf : ∀ (i : ι), 0 ≤ f i)
(hg : ∀ (i : ι), 0 ≤ g i)
(hf_sum : Summable fun i => f i ^ p)
(hg_sum : Summable fun i => g i ^ p)


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

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

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


/-- Representable presheaves are (trivially) ind-objects. -/
@[simps]
def yoneda (X : C) : IndObjectPresentation (yoneda.obj X)

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

(CategoryTheory.Limits.IndObjectPresentation.yoneda X).I = CategoryTheory.Discrete PUnit.{v + 1}


theorem isRelPrime_mul_unit_left_right : IsRelPrime y (x * z) ↔ IsRelPrime y z

{α : Type u_1}
[CommMonoid α]
{x y z : α}
(hu : IsUnit x)


theorem colimit_exists_rep [HasColimit F] (x : ↑(colimit F)) :
    ∃ (j : J) (y : F.obj j), colimit.ι F j y = x

[CategoryTheory.Limits.PreservesColimit F (CategoryTheory.forget C)]

(x : (CategoryTheory.forget C).obj (CategoryTheory.Limits.colimit F))

∃ j y, (CategoryTheory.Limits.colimit.ι F j) y = x


@[to_additive]
lemma mem_orbit_symm {a₁ a₂ : α} : a₁ ∈ orbit G a₂ ↔ a₂ ∈ orbit G a₁

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
{a₁ a₂ : α}

a₁ ∈ MulAction.orbit G a₂ ↔ a₂ ∈ MulAction.orbit G a₁


/-- If `C` is filtered, then we can give an explicit condition for a functor `F : C ⥤ D` to
    be final. The converse is also true, see `final_iff_of_isFiltered`. -/
theorem Functor.final_of_exists_of_isFiltered [IsFilteredOrEmpty C]
    (h₁ : ∀ d, ∃ c, Nonempty (d ⟶ F.obj c)) (h₂ : ∀ {d : D} {c : C} (s s' : d ⟶ F.obj c),
      ∃ (c' : C) (t : c ⟶ c'), s ≫ F.map t = s' ≫ F.map t) : Functor.Final F

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

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


theorem eq_zero_or_eq_sub_one_add_one : ∀ {n}, n = 0 ∨ n = n - 1 + 1


@[simp] theorem map_id : Except.map (ε := ε) (α := α) (β := α) id = id


theorem ContMDiffOn.contMDiffAt (h : ContMDiffOn I I' n f s) (hx : s ∈ 𝓝 x) :
    ContMDiffAt I I' n f 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 : M → M'}
{s : Set M}
{x : M}
{n : ℕ∞}
(h : ContMDiffOn I I' n f s)
(hx : s ∈ 𝓝 x)


theorem map_monotone (f : V ↪ W) : Monotone (SimpleGraph.map f)

{V : Type u_1}
{W : Type u_2}
(f : V ↪ W)


@[to_additive]
lemma iIndepFun.indepFun_mul_mul (hf_indep : iIndepFun (fun _ ↦ m) f μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (f i * f j) (f k * f l) μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.iIndepFun (fun x => m) f μ)

ProbabilityTheory.IndepFun (f i * f j) (f k * f l) μ


theorem Normal.splits (_ : Normal F K) (x : K) : Splits (algebraMap F K) (minpoly F x)

{F : Type u_1}
{K : Type u_2}
[Field F]
[Field K]
[Algebra F K]

Normal F K → ∀ (x : K), Polynomial.Splits (algebraMap F K) (minpoly F x)


/-- `seminormFromConst_seq c f x` is antitone. -/
theorem seminormFromConst_seq_antitone (x : R) : Antitone (seminormFromConst_seq c f x)

{R : Type u_1}
[CommRing R]
{c : R}
{f : RingSeminorm R}
(hf1 : f 1 ≤ 1)
(hc : f c ≠ 0)
(hpm : IsPowMul ⇑f)
(x : R)


@[ext] theorem AddGroupWithOne.ext ⦃inst₁ inst₂ : AddGroupWithOne R⦄
    (h_add : local_hAdd[R, inst₁] = local_hAdd[R, inst₂])
    (h_one : (letI := inst₁; One.one : R) = (letI := inst₂; One.one)) :
    inst₁ = inst₂

{R : Type u}
⦃inst₁ inst₂ : AddGroupWithOne R⦄
(h_add : HAdd.hAdd = HAdd.hAdd)
(h_one : One.one = One.one)


theorem condIndep_iSup_of_antitone [SemilatticeInf ι] {m : ι → MeasurableSpace Ω}
    (h_indep : ∀ i, CondIndep m' (m i) m₁ hm' μ) (h_le : ∀ i, m i ≤ mΩ) (h_le' : m₁ ≤ mΩ)
    (hm : Antitone m) :
    CondIndep m' (⨆ i, m i) m₁ hm' μ

(h_indep : ∀ (i : ι), ProbabilityTheory.CondIndep m' (m i) m₁ hm' μ)

ProbabilityTheory.CondIndep m' (⨆ i, m i) m₁ hm' μ


theorem coprime_iff_isRelPrime {m n : ℕ} : m.Coprime n ↔ IsRelPrime m n


lemma quasiIso_iff_isIso_leftHomologyMap' (φ : S₁ ⟶ S₂)
    (h₁ : S₁.LeftHomologyData) (h₂ : S₂.LeftHomologyData) :
    QuasiIso φ ↔ IsIso (leftHomologyMap' φ h₁ h₂)

CategoryTheory.ShortComplex.QuasiIso φ ↔ CategoryTheory.IsIso (CategoryTheory.ShortComplex.leftHomologyMap' φ h₁ h₂)


theorem IsSymmetric.add {T S : E →ₗ[𝕜] E} (hT : T.IsSymmetric) (hS : S.IsSymmetric) :
    (T + S).IsSymmetric

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{T S : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)
(hS : S.IsSymmetric)


/-- Typeclass for an extension being an algebraic closure. -/
class IsAlgClosure (R : Type u) (K : Type v) [CommRing R] [Field K] [Algebra R K]
    [NoZeroSMulDivisors R K] : Prop where
  alg_closed : IsAlgClosed K
  algebraic : Algebra.IsAlgebraic R K

{R : Type u}
{K : Type v}
[CommRing R]
[Field K]
[Algebra R K]
[NoZeroSMulDivisors R K]
[self : IsAlgClosure R K]


@[to_additive]
theorem characteristic_iff_map_le : H.Characteristic ↔ ∀ ϕ : G ≃* G, H.map ϕ.toMonoidHom ≤ H

{G : Type u_1}
[Group G]
{H : Subgroup G}

H.Characteristic ↔ ∀ (ϕ : G ≃* G), Subgroup.map ϕ.toMonoidHom H ≤ H


@[simp]
theorem withTopCongr_trans (e₁ : α ≃o β) (e₂ : β ≃o γ) :
    e₁.withTopCongr.trans e₂.withTopCongr = (e₁.trans e₂).withTopCongr

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[PartialOrder α]
[PartialOrder β]
[PartialOrder γ]
(e₁ : α ≃o β)
(e₂ : β ≃o γ)


@[simp, nolint unusedHavesSuffices] -- Porting note: false positive
theorem decode_list_succ (v : ℕ) :
    decode (α := List α) (succ v) =
      (· :: ·) <$> decode (α := α) v.unpair.1 <*> decode (α := List α) v.unpair.2

Encodable.decode v.succ =
  Seq.seq ((fun x x_1 => x :: x_1) <$> Encodable.decode (Nat.unpair v).1) fun x => Encodable.decode (Nat.unpair v).2


@[simp]
theorem tensorTensorTensorComm_symm_tmul (m : M) (n : N) (p : P) (q : Q) :
    (tensorTensorTensorComm R A M N P Q).symm ((m ⊗ₜ p) ⊗ₜ (n ⊗ₜ q)) = (m ⊗ₜ n) ⊗ₜ (p ⊗ₜ q)

(R : Type uR)
(A : Type uA)
{M : Type uM}
{N : Type uN}
{P : Type uP}
{Q : Type uQ}
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]
[AddCommMonoid P]
[Module R P]
[Module A P]
[IsScalarTower R A P]
[AddCommMonoid Q]
[Module R Q]
(m : M)
(n : N)
(p : P)
(q : Q)

(TensorProduct.AlgebraTensorModule.tensorTensorTensorComm R A M N P Q).symm ((m ⊗ₜ[A] p) ⊗ₜ[R] n ⊗ₜ[R] q) =
  (m ⊗ₜ[R] n) ⊗ₜ[A] p ⊗ₜ[R] q


@[to_additive (attr := simp)]
lemma mk_smul (g : M') (hg : g ∈ S) (a : α) : (⟨g, hg⟩ : S) • a = g • a

{M' : Type u_5}
{α : Type u_6}
[MulOneClass M']
[SMul M' α]
{S : Submonoid M'}
(g : M')
(hg : g ∈ S)
(a : α)


lemma subset_closure_of_subset' (M : Matroid α) (hXY : X ⊆ Y) (hX : X ⊆ M.E := by aesop_mat) :
    X ⊆ M.closure Y

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


@[simp]
theorem disjoint_add_right {s t u : Multiset α} :
    Disjoint s (t + u) ↔ Disjoint s t ∧ Disjoint s u

s.Disjoint (t + u) ↔ s.Disjoint t ∧ s.Disjoint u


@[simp]
theorem limLax_map {F G : J ⥤ C} (α : F ⟶ G) : limLax.map α = lim.map α

CategoryTheory.Limits.limLax.map α = CategoryTheory.Limits.lim.map α


theorem mod_le (m k : ℕ+) : mod m k ≤ m ∧ mod m k ≤ k


@[simp]
theorem sym_sub [Sub α] (a b : α) : sym (a - b) = sym a - sym b

SymAlg.sym (a - b) = SymAlg.sym a - SymAlg.sym b


theorem tan_pos_of_pos_of_lt_pi_div_two {x : ℝ} (h0x : 0 < x) (hxp : x < π / 2) : 0 < tan x


theorem coe_cycleRange_of_le {n : ℕ} {i j : Fin n.succ} (h : j ≤ i) :
    (cycleRange i j : ℕ) = if j = i then 0 else (j : ℕ) + 1

↑(i.cycleRange j) = if j = i then 0 else ↑j + 1


/-- Passing from `Monad C` to `Mon_ (C ⥤ C)` is functorial. -/
@[simps]
def monadToMon : Monad C ⥤ Mon_ (C ⥤ C)

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

∀ {X Y : CategoryTheory.Monad C} (f : X ⟶ Y), ((CategoryTheory.Monad.monadToMon C).map f).hom = f.toNatTrans


@[simp]
theorem dual_comp (g : SupBotHom β γ) (f : SupBotHom α β) :
    SupBotHom.dual (g.comp f) = (SupBotHom.dual g).comp (SupBotHom.dual f)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Sup α]
[Bot α]
[Sup β]
[Bot β]
[Sup γ]
[Bot γ]
(g : SupBotHom β γ)
(f : SupBotHom α β)


theorem nadd_right_cancel_iff : ∀ {a b c}, b ♯ a = c ♯ a ↔ b = c


/-- Equivalence classes partition the type. -/
theorem classes_eqv_classes {r : Setoid α} (a) : ∃! b ∈ r.classes, a ∈ b


@[to_additive]
lemma map_comp_zpow [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) (g : ι → G)
    (n : ℤ) : f ∘ (g ^ n) = f ∘ g ^ n

{ι : Type u_1}
{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[AddGroup G]
[SubtractionMonoid H]
[AddMonoidHomClass F G H]
(f : F)
(g : ι → G)
(n : ℤ)


theorem nullhomotopic_of_constant (y : Y) : Nullhomotopic (ContinuousMap.const X y)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(y : Y)


@[simp]
theorem PreservesCokernel.iso_inv : (PreservesCokernel.iso G f).inv = cokernelComparison f G

[CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.parallelPair f 0) G]

(CategoryTheory.Limits.PreservesCokernel.iso G f).inv = CategoryTheory.Limits.cokernelComparison f G


theorem neg_coeff (x : 𝕎 R) (n : ℕ) : (-x).coeff n = peval (wittNeg p n) ![x.coeff]

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

(-x).coeff n = WittVector.peval (WittVector.wittNeg p n) ![x.coeff]


theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x

((starRingEnd ℂ) x).arg = if x.arg = π then π else -x.arg


/-- A family `𝓕 : ι → X → α` is equicontinuous on `S` iff `range 𝓕` is equicontinuous on `S`,
i.e the family `(↑) : range F → X → α` is equicontinuous on `S`. -/
theorem equicontinuousOn_iff_range {F : ι → X → α} {S : Set X} :
    EquicontinuousOn F S ↔ EquicontinuousOn ((↑) : range F → X → α) S

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

EquicontinuousOn F S ↔ EquicontinuousOn Subtype.val S


@[simp]
theorem zero_equiv_neg_iff {x : PGame} : (0 ≈ -x) ↔ (0 ≈ x)


theorem nmem_setOf_iff {a : α} {p : α → Prop} : a ∉ { x | p x } ↔ ¬p a


/-- An upper estimate on the complex distance between two points in terms of the hyperbolic distance
and the imaginary part of one of the points. -/
theorem le_dist_coe (z w : ℍ) : w.im * (1 - Real.exp (-dist z w)) ≤ dist (z : ℂ) w

w.im * (1 - rexp (-dist z w)) ≤ dist ↑z ↑w


/-- The ray of `someVector`. -/
@[simp]
theorem someVector_ray (x : Module.Ray R M) : rayOfNeZero R _ x.someVector_ne_zero = x

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
(x : Module.Ray R M)


theorem dist_fixedPoint_le (x) : dist x (fixedPoint f hf) ≤ dist x (f x) / (1 - K)

{α : Type u_1}
[MetricSpace α]
{K : ℝ≥0}
{f : α → α}
(hf : ContractingWith K f)
[Nonempty α]
[CompleteSpace α]
(x : α)

dist x (ContractingWith.fixedPoint f hf) ≤ dist x (f x) / (1 - ↑K)


protected theorem intCast_mem (n : ℤ) : (n : K) ∈ s

{K : Type u}
[DivisionRing K]
(s : Subfield K)
(n : ℤ)


theorem _root_.Reflexive.set_pairwise_iff (hr : Reflexive r) :
    s.Pairwise r ↔ ∀ ⦃a⦄, a ∈ s → ∀ ⦃b⦄, b ∈ s → r a b

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

s.Pairwise r ↔ ∀ ⦃a : α⦄, a ∈ s → ∀ ⦃b : α⦄, b ∈ s → r a b


theorem natAbs_eq_iff_sq_eq {a b : ℤ} : a.natAbs = b.natAbs ↔ a ^ 2 = b ^ 2


theorem Complex.exp_eq_exp_ℂ : Complex.exp = NormedSpace.exp ℂ


/-- The order of a formal power series is at least `n` if
the `i`th coefficient is `0` for all `i < n`. -/
theorem le_order (φ : R⟦X⟧) (n : PartENat) (h : ∀ i : ℕ, ↑i < n → coeff R i φ = 0) :
    n ≤ order φ

(h : ∀ (i : ℕ), ↑i < n → (PowerSeries.coeff R i) φ = 0)


/--
The categories of coherent sheaves and extensive sheaves on `C` are equivalent if `C` is
preregular, finitary extensive, and every object is projective.
-/
@[simps]
def coherentExtensiveEquivalence [Preregular C] [FinitaryExtensive C] [∀ (X : C), Projective X] :
    Sheaf (coherentTopology C) A ≌ Sheaf (extensiveTopology C) A

[∀ (X : C), CategoryTheory.Projective X]

∀ {X Y : CategoryTheory.Sheaf (CategoryTheory.extensiveTopology C) A} (f : X ⟶ Y),
  (CategoryTheory.Presheaf.coherentExtensiveEquivalence.inverse.map f).val = f.val


/-- If `P` is separated, then `P⁺` is a sheaf. -/
theorem isSheaf_of_sep (P : Cᵒᵖ ⥤ D)
    (hsep :
      ∀ (X : C) (S : J.Cover X) (x y : P.obj (op X)),
        (∀ I : S.Arrow, P.map I.f.op x = P.map I.f.op y) → x = y) :
    Presheaf.IsSheaf J (J.plusObj P)

{J : CategoryTheory.GrothendieckTopology C}

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

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ (CategoryTheory.forget D)]

(hsep :
  ∀ (X : C) (S : J.Cover X) (x y : (CategoryTheory.forget D).obj (P.obj (Opposite.op X))),
    (∀ (I : S.Arrow), (P.map I.f.op) x = (P.map I.f.op) y) → x = y)

CategoryTheory.Presheaf.IsSheaf J (J.plusObj P)


lemma optionEquivRight_X_none : optionEquivRight R S₁ (X none) = C Polynomial.X

(R : Type u)
(S₁ : Type v)
[CommSemiring R]

(MvPolynomial.optionEquivRight R S₁) (MvPolynomial.X none) = MvPolynomial.C Polynomial.X


protected theorem smul {α} [Monoid α] [DistribMulAction α R] [SMulCommClass R α R] (a : α)
    {B : BilinForm R M} (hB : B.IsAlt) : (a • B).IsAlt

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_9}
[Monoid α]
[DistribMulAction α R]
[SMulCommClass R α R]
(a : α)
{B : LinearMap.BilinForm R M}
(hB : B.IsAlt)


@[simp]
theorem mk_sup_mk [Sup α] [Sup β] (a₁ a₂ : α) (b₁ b₂ : β) :
    (a₁, b₁) ⊔ (a₂, b₂) = (a₁ ⊔ a₂, b₁ ⊔ b₂)

(α : Type u)
(β : Type v)
[Sup α]
[Sup β]
(a₁ a₂ : α)
(b₁ b₂ : β)


lemma find_eq_iff (h : ∃ n : ℕ, p n) : Nat.find h = m ↔ p m ∧ ∀ n < m, ¬ p n

{m : ℕ}
{p : ℕ → Prop}
[DecidablePred p]
(h : ∃ n, p n)

Nat.find h = m ↔ p m ∧ ∀ (n : ℕ), n < m → ¬p n


theorem measurableSpace_iSup_eq (m : ι → MeasurableSpace α) :
    ⨆ n, m n = generateFrom { s | ∃ n, MeasurableSet[m n] s }

{α : Type u_1}
{ι : Sort u_6}
(m : ι → MeasurableSpace α)

⨆ n, m n = MeasurableSpace.generateFrom {s | ∃ n, MeasurableSet s}


/-- If a function `f : α → ℝ≥0∞` is such that the level sets `{f < p}` and `{q < f}` have measurable
supersets which are disjoint up to measure zero when `p` and `q` are finite numbers satisfying
`p < q`, then `f` is almost-everywhere measurable. -/
theorem ENNReal.aemeasurable_of_exist_almost_disjoint_supersets {α : Type*} {m : MeasurableSpace α}
    (μ : Measure α) (f : α → ℝ≥0∞)
    (h : ∀ (p : ℝ≥0) (q : ℝ≥0), p < q →
      ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧
        { x | f x < p } ⊆ u ∧ { x | (q : ℝ≥0∞) < f x } ⊆ v ∧ μ (u ∩ v) = 0) :
    AEMeasurable f μ

(f : α → ℝ≥0∞)

(h :
  ∀ (p q : ℝ≥0),
    p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < ↑p} ⊆ u ∧ {x | ↑q < f x} ⊆ v ∧ μ (u ∩ v) = 0)


theorem ContMDiffAt.smoothAt (h : ContMDiffAt I I' ⊤ f x) : SmoothAt I I' f 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 : M → M'}
{x : M}
(h : ContMDiffAt I I' ⊤ f x)


@[to_additive]
theorem Red.reduce_left (h : Red L₁ L₂) : Red L₂ (reduce L₁)

{α : Type u}
{L₁ L₂ : List (α × Bool)}
[DecidableEq α]
(h : FreeAddGroup.Red L₁ L₂)

FreeAddGroup.Red L₂ (FreeAddGroup.reduce L₁)


/-- If `K` is complete, any `v` in `E` can be expressed as a sum of elements of `K` and `Kᗮ`. -/
theorem Submodule.exists_add_mem_mem_orthogonal [HasOrthogonalProjection K] (v : E) :
    ∃ y ∈ K, ∃ z ∈ Kᗮ, v = y + z

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


@[simp]
theorem cosh_abs : cosh |x| = cosh x


/-- Any continuous ring homomorphism commutes with `NormedSpace.exp`. -/
theorem map_exp {F} [FunLike F 𝔸 𝔹] [RingHomClass F 𝔸 𝔹] (f : F) (hf : Continuous f) (x : 𝔸) :
    f (exp 𝕂 x) = exp 𝕂 (f x)

(𝕂 : Type u_1)
{𝔸 : Type u_2}
{𝔹 : Type u_3}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[NormedRing 𝔹]
[NormedAlgebra 𝕂 𝔹]
[CompleteSpace 𝔸]
{F : Type u_4}
[FunLike F 𝔸 𝔹]
[RingHomClass F 𝔸 𝔹]
(f : F)
(hf : Continuous ⇑f)
(x : 𝔸)

f (NormedSpace.exp 𝕂 x) = NormedSpace.exp 𝕂 (f x)


@[simp]
theorem coe_mk (f : X → Y) (h) : ⇑(⟨f, h⟩ : LocallyConstant X Y) = f

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

⇑{ toFun := f, isLocallyConstant := h } = f


theorem mem_support_nil_iff {u v : V} : u ∈ (nil : G.Walk v v).support ↔ u = v

{V : Type u}
{G : SimpleGraph V}
{u v : V}

u ∈ SimpleGraph.Walk.nil.support ↔ u = v


theorem mem_insert_of_mem {x : α} {s : Set α} (y : α) : x ∈ s → x ∈ insert y s

{α : Type u}
{x : α}
{s : Set α}
(y : α)


theorem squarefree_iff_no_irreducibles {x : R} (hx₀ : x ≠ 0) :
    Squarefree x ↔ ∀ p, Irreducible p → ¬ (p * p ∣ x)

{R : Type u_1}
[CommMonoidWithZero R]
[WfDvdMonoid R]
{x : R}
(hx₀ : x ≠ 0)

Squarefree x ↔ ∀ (p : R), Irreducible p → ¬p * p ∣ x


{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)


@[simp]
theorem union_symm_apply_right {α} {s t : Set α} [DecidablePred fun x => x ∈ s] (H : s ∩ t ⊆ ∅)
    (a : t) : (Equiv.Set.union H).symm (Sum.inr a) = ⟨a, by simp⟩

{α : Type u_1}
{s t : Set α}
[DecidablePred fun x => x ∈ s]
(H : s ∩ t ⊆ ∅)
(a : ↑t)

(Equiv.Set.union H).symm (Sum.inr a) = ⟨↑a, ⋯⟩


/-- We can turn any limit cone over a discrete collection of objects into a bicone. -/
@[simps]
def ofLimitCone {f : J → C} {t : Cone (Discrete.functor f)} (ht : IsLimit t) : Bicone f

{t : CategoryTheory.Limits.Cone (CategoryTheory.Discrete.functor f)}

(CategoryTheory.Limits.Bicone.ofLimitCone ht).pt = t.pt


@[simp]
theorem zeroth_den_eq_one : g.dens 0 = 1

{K : Type u_1}
{g : GenContFract K}
[DivisionRing K]


/-- A version of `WithTop.coe_sSup'` with a more convenient but less general statement. -/
@[norm_cast]
theorem coe_sSup {s : Set α} (hb : BddAbove s) : ↑(sSup s) = (⨆ a ∈ s, ↑a : WithTop α)

{α : Type u_1}
[ConditionallyCompleteLinearOrderBot α]
{s : Set α}
(hb : BddAbove s)


theorem upperSemicontinuousWithinAt_sum {f : ι → α → γ} {a : Finset ι}
    (ha : ∀ i ∈ a, UpperSemicontinuousWithinAt (f i) s x) :
    UpperSemicontinuousWithinAt (fun z => ∑ i ∈ a, f i z) s x

{f : ι → α → γ}


theorem normalizedFactors_prod {a : α} (ane0 : a ≠ 0) :
    Associated (normalizedFactors a).prod a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]
{a : α}
(ane0 : a ≠ 0)

(UniqueFactorizationMonoid.normalizedFactors a).prod ~ᵤ a


theorem inter_dom_subset_preimage_image (s : Set α) : s ∩ r.dom ⊆ r.preimage (r.image s)

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


theorem IsPositive.inner_nonneg_left {T : E →L[𝕜] E} (hT : IsPositive T) (x : E) :
    0 ≤ re ⟪T x, x⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
{T : E →L[𝕜] E}
(hT : T.IsPositive)
(x : E)


theorem rightInvSeq_drop (ω : List B) (j : ℕ) :
    ris (ω.drop j) = (ris ω).drop j

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(ω : List B)
(j : ℕ)

cs.rightInvSeq (List.drop j ω) = List.drop j (cs.rightInvSeq ω)


lemma IsFiniteKernel.integrable (μ : Measure α) [IsFiniteMeasure μ]
    (κ : Kernel α β) [IsFiniteKernel κ] {s : Set β} (hs : MeasurableSet s) :
    Integrable (fun x => (κ x s).toReal) μ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]
(κ : ProbabilityTheory.Kernel α β)
[ProbabilityTheory.IsFiniteKernel κ]
{s : Set β}
(hs : MeasurableSet s)

MeasureTheory.Integrable (fun x => ((κ x) s).toReal) μ


/-- If `|z| < 1`, then applying `S` strictly decreases `im`. -/
theorem im_lt_im_S_smul (h : normSq z < 1) : z.im < (S • z).im


theorem zeroLocus_vanishingIdeal_le (V : Set (σ → k)) : V ≤ zeroLocus (vanishingIdeal V)

{k : Type u_1}
[Field k]
{σ : Type u_2}
(V : Set (σ → k))

V ≤ MvPolynomial.zeroLocus (MvPolynomial.vanishingIdeal V)


lemma Module.mem_support_iff_of_finite [Module.Finite R M] :
    p ∈ Module.support R M ↔ Module.annihilator R M ≤ p.asIdeal

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{p : PrimeSpectrum R}
[Module.Finite R M]


/-- Two maps from a coequalizer are equal if they are equal when composed with the coequalizer
    map -/
@[ext]
theorem coequalizer.hom_ext {W : C} {k l : coequalizer f g ⟶ W}
    (h : coequalizer.π f g ≫ k = coequalizer.π f g ≫ l) : k = l

{k l : CategoryTheory.Limits.coequalizer f g ⟶ W}

(h :
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.coequalizer.π f g) k =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.coequalizer.π f g) l)


theorem add_iSup {ι : Sort*} {s : ι → ℝ≥0∞} [Nonempty ι] : a + iSup s = ⨆ b, a + s b

{a : ℝ≥0∞}
{ι : Sort u_4}
{s : ι → ℝ≥0∞}
[Nonempty ι]


theorem mul_ne_top : a ≠ ∞ → b ≠ ∞ → a * b ≠ ∞

a ≠ ⊤ → b ≠ ⊤ → a * b ≠ ⊤


/-- If `τ` is a `CanonicallyOrderedAddCommMonoid` (e.g., `ℕ` or `ℝ≥0`), then the notions
`IsFwInvariant` and `IsInvariant` are equivalent. -/
theorem isFwInvariant_iff_isInvariant [CanonicallyOrderedAddCommMonoid τ] {ϕ : τ → α → α}
    {s : Set α} :
    IsFwInvariant ϕ s ↔ IsInvariant ϕ s

{τ : Type u_1}
{α : Type u_2}
[CanonicallyOrderedAddCommMonoid τ]
{ϕ : τ → α → α}
{s : Set α}


@[simp]
theorem one_lt_card {o} : 1 < card o ↔ 1 < o


@[simp]
theorem cancel_right {g₁ g₂ : sInfHom β γ} {f : sInfHom α β} (hf : Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[InfSet α]
[InfSet β]
[InfSet γ]
{g₁ g₂ : sInfHom β γ}
{f : sInfHom α β}
(hf : Function.Surjective ⇑f)


/-- The clifford algebra over `CliffordAlgebraQuaternion.Q c₁ c₂` is isomorphic as an `R`-algebra
to `ℍ[R,c₁,c₂]`. -/
@[simps!]
protected def equiv : CliffordAlgebra (Q c₁ c₂) ≃ₐ[R] ℍ[R,c₁,c₂]

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

CliffordAlgebraQuaternion.equiv a = CliffordAlgebraQuaternion.toQuaternion a


@[simp]
theorem lequivCongrLeft_apply (h : ι ≃ κ) (f : ⨁ i, M i) (k : κ) :
    lequivCongrLeft R h f k = f (h.symm k)

(R : Type u)
[Semiring R]
{ι : Type v}
{M : ι → Type w}
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
{κ : Type u_1}
(h : ι ≃ κ)
(f : DirectSum ι fun i => M i)
(k : κ)

((DirectSum.lequivCongrLeft R h) f) k = f (h.symm k)


theorem le_iff_le_of_cmp_eq_cmp (h : cmp x y = cmp x' y') : x ≤ y ↔ x' ≤ y'

{α : Type u_1}
[LinearOrder α]
{x y : α}
{β : Type u_3}
[LinearOrder β]
{x' y' : β}
(h : cmp x y = cmp x' y')


protected theorem Directed.iSup_inf_eq (h : Directed (· ≤ ·) f) :
    (⨆ i, f i) ⊓ a = ⨆ i, f i ⊓ a

{ι : Sort u_1}
{α : Type u_2}
{f : ι → α}
[CompleteLattice α]
[IsCompactlyGenerated α]
{a : α}
(h : Directed (fun x x_1 => x ≤ x_1) f)


lemma _root_.Basis.baseChange_linearMap (b : Basis ι R M) (b' : Basis ι' R N) (ij : ι × ι') :
    baseChange A (b'.linearMap b ij) = (basis A b').linearMap (basis A b) ij

{R : Type uR}
{M : Type uM}
{ι : Type uι}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[Fintype ι]
{ι' : Type u_1}
{N : Type u_2}
[Fintype ι']
[DecidableEq ι']
[AddCommMonoid N]
[Module R N]
(A : Type u_3)
[CommSemiring A]
[Algebra R A]
(b : Basis ι R M)
(b' : Basis ι' R N)
(ij : ι × ι')

LinearMap.baseChange A ((b'.linearMap b) ij) =
  ((Algebra.TensorProduct.basis A b').linearMap (Algebra.TensorProduct.basis A b)) ij


theorem agree_children {n : ℕ} (x : CofixA F (succ n)) (y : CofixA F (succ n + 1)) {i j}
    (h₀ : HEq i j) (h₁ : Agree x y) : Agree (children' x i) (children' y j)

(y : PFunctor.Approx.CofixA F (n.succ + 1))

PFunctor.Approx.Agree (PFunctor.Approx.children' x i) (PFunctor.Approx.children' y j)


theorem Mon.mul_denote (ctx : Context) (m₁ m₂ : Mon) : (m₁.mul m₂).denote ctx = m₁.denote ctx * m₂.denote ctx

(ctx : Nat.Linear.Context)
(fuel : Nat)
(m₁ m₂ : Nat.SOM.Mon)

Nat.SOM.Mon.denote ctx (Nat.SOM.Mon.mul.go fuel m₁ m₂) = Nat.SOM.Mon.denote ctx m₁ * Nat.SOM.Mon.denote ctx m₂


theorem not_isFiniteMeasure_iff : ¬IsFiniteMeasure μ ↔ μ Set.univ = ∞

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

¬MeasureTheory.IsFiniteMeasure μ ↔ μ Set.univ = ⊤


@[simp]
theorem add_sub_add_cancel (a b c : Ordinal) : a + b - (a + c) = b - c


/-- The 1st differential in the complex of inhomogeneous cochains of `A : Rep k G`, as a
`k`-linear map `Fun(G, A) → Fun(G × G, A)`. It sends
`(f, (g₁, g₂)) ↦ ρ_A(g₁)(f(g₂)) - f(g₁g₂) + f(g₁).` -/
@[simps]
def dOne : (G → A) →ₗ[k] G × G → A

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

(groupCohomology.dOne A) f g = (A.ρ g.1) (f g.2) - f (g.1 * g.2) + f g.1


/-- A category is essentially small if and only if
the underlying type of its skeleton (i.e. the "set" of isomorphism classes) is small,
and it is locally small.
-/
theorem essentiallySmall_iff (C : Type u) [Category.{v} C] :
    EssentiallySmall.{w} C ↔ Small.{w} (Skeleton C) ∧ LocallySmall.{w} C

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

CategoryTheory.EssentiallySmall.{w, v, u} C ↔
  Small.{w, u} (CategoryTheory.Skeleton C) ∧ CategoryTheory.LocallySmall.{w, v, u} C


/-- The image of a topological basis under an open quotient map is a topological basis. -/
theorem IsTopologicalBasis.quotientMap {V : Set (Set X)} (hV : IsTopologicalBasis V)
    (h' : QuotientMap π) (h : IsOpenMap π) : IsTopologicalBasis (Set.image π '' V)

(hV : TopologicalSpace.IsTopologicalBasis V)

TopologicalSpace.IsTopologicalBasis (Set.image π '' V)


/-- For two `R`-algebra morphisms out of `R[ε]` to agree, it suffices for them to agree on `ε`. -/
@[ext 1200]
nonrec theorem algHom_ext ⦃f g : R[ε] →ₐ[R] A⦄ (hε : f ε = g ε) : f = g

{R : Type u_1}
{A : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
⦃f g : R[ε] →ₐ[R] A⦄
(hε : f ε = g ε)


/-- If `F` is initial,
the category of cones on `F ⋙ G` is equivalent to the category of cones on `G`,
for any `G : D ⥤ E`.
-/
@[simps]
def conesEquiv : Cone (F ⋙ G) ≌ Cone G

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

(CategoryTheory.Functor.Initial.conesEquiv F G).counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun c =>
      CategoryTheory.Limits.Cones.ext
        (CategoryTheory.Iso.refl
          (((CategoryTheory.Limits.Cones.whiskering F).comp CategoryTheory.Functor.Initial.extendCone).obj c).pt)
        ⋯)
    ⋯


lemma Monotone.mapsTo_Ici (h : Monotone f) : MapsTo f (Ici a) (Ici (f a))

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{a : α}
(h : Monotone f)

Set.MapsTo f (Set.Ici a) (Set.Ici (f a))


theorem finite_range_const {c : β} : (range fun _ : α => c).Finite


@[simp]
theorem preimage_const_add_Iic : (fun x => a + x) ⁻¹' Iic b = Iic (b - a)

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

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


@[to_additive prod_eq_top_iff]
theorem prod_eq_top_iff {s : Submonoid M} {t : Submonoid N} : s.prod t = ⊤ ↔ s = ⊤ ∧ t = ⊤

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{s : AddSubmonoid M}
{t : AddSubmonoid N}


theorem map_isTrail_iff_of_injective (hinj : Function.Injective f) :
    (p.map f).IsTrail ↔ p.IsTrail

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
{f : G →g G'}
{u v : V}
{p : G.Walk u v}
(hinj : Function.Injective ⇑f)

(SimpleGraph.Walk.map f p).IsTrail ↔ p.IsTrail


/-- If `x` and `y` are nonzero vectors on the same ray, then there exist positive numbers `r₁ r₂`
such that `r₁ • x = r₂ • y`. -/
theorem exists_pos (h : SameRay R x y) (hx : x ≠ 0) (hy : y ≠ 0) :
    ∃ r₁ r₂ : R, 0 < r₁ ∧ 0 < r₂ ∧ r₁ • x = r₂ • y

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{x y : M}
(h : SameRay R x y)
(hx : x ≠ 0)
(hy : y ≠ 0)

∃ r₁ r₂, 0 < r₁ ∧ 0 < r₂ ∧ r₁ • x = r₂ • y


theorem Basis'.inter_eq_of_subset_indep (hI : M.Basis' I X) (hIJ : I ⊆ J) (hJ : M.Indep J) :
    J ∩ X = I

{α : Type u_1}
{M : Matroid α}
{I J X : Set α}
(hI : M.Basis' I X)
(hIJ : I ⊆ J)
(hJ : M.Indep J)


protected theorem to_map_ne_zero_of_mem_nonZeroDivisors [Nontrivial R] {x : R}
    (hx : x ∈ nonZeroDivisors R) : algebraMap R K x ≠ 0

{R : Type u_1}
[CommRing R]
{K : Type u_5}
[CommRing K]
[Algebra R K]
[IsFractionRing R K]
[Nontrivial R]
{x : R}
(hx : x ∈ nonZeroDivisors R)


/-- The other direction does not hold because of the `s`-`s` cross terms on the RHS. -/
theorem image2_distrib_subset_left {f : α → δ → ε} {g : β → γ → δ} {f₁ : α → β → β'}
    {f₂ : α → γ → γ'} {g' : β' → γ' → ε} (h_distrib : ∀ a b c, f a (g b c) = g' (f₁ a b) (f₂ a c)) :
    image2 f s (image2 g t u) ⊆ image2 g' (image2 f₁ s t) (image2 f₂ s u)

{f : α → δ → ε}

{g : β → γ → δ}

{f₁ : α → β → β'}

{f₂ : α → γ → γ'}

(h_distrib : ∀ (a : α) (b : β) (c : γ), f a (g b c) = g' (f₁ a b) (f₂ a c))

Set.image2 f s (Set.image2 g t u) ⊆ Set.image2 g' (Set.image2 f₁ s t) (Set.image2 f₂ s u)


@[to_additive]
theorem right_dom_of_mul_dom [Mul α] {a b : Part α} (hab : Dom (a * b)) : b.Dom

{α : Type u_1}
[Add α]
{a b : Part α}
(hab : (a + b).Dom)


theorem eq_of_forall_apply_eq (μ ν : ProbabilityMeasure Ω)
    (h : ∀ s : Set Ω, MeasurableSet s → μ s = ν s) : μ = ν

(μ ν : MeasureTheory.ProbabilityMeasure Ω)

(h : ∀ (s : Set Ω), MeasurableSet s → μ s = ν s)


theorem countP_pos : 0 < countP p l ↔ ∃ a ∈ l, p a

{α : Type u_1}
(p : α → Bool)
{l : List α}

0 < List.countP p l ↔ ∃ a, a ∈ l ∧ p a = true


/-- The Cartesian product of analytic functions is analytic. -/
lemma AnalyticOn.prod {f : E → F} {g : E → G} {s : Set E}
    (hf : AnalyticOn 𝕜 f s) (hg : AnalyticOn 𝕜 g s) :
    AnalyticOn 𝕜 (fun x ↦ (f x, g x)) s

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
{G : Type u_5}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E → F}
{g : E → G}
{s : Set E}
(hf : AnalyticOn 𝕜 f s)
(hg : AnalyticOn 𝕜 g s)


theorem translationNumber_le_of_le_add_nat {x : ℝ} {m : ℕ} (h : f x ≤ x + m) : τ f ≤ m

(f : CircleDeg1Lift)
{x : ℝ}
{m : ℕ}
(h : f x ≤ x + ↑m)


/-- A dependent version of `submodule.iSup_induction`. -/
@[elab_as_elim]
theorem iSup_induction' {ι : Sort*} (p : ι → Submodule R M) {C : ∀ x, (x ∈ ⨆ i, p i) → Prop}
    (mem : ∀ (i) (x) (hx : x ∈ p i), C x (mem_iSup_of_mem i hx)) (zero : C 0 (zero_mem _))
    (add : ∀ x y hx hy, C x hx → C y hy → C (x + y) (add_mem ‹_› ‹_›)) {x : M}
    (hx : x ∈ ⨆ i, p i) : C x hx

(mem : ∀ (i : ι) (x : M) (hx : x ∈ p i), C x ⋯)

(add : ∀ (x y : M) (hx : x ∈ ⨆ i, p i) (hy : y ∈ ⨆ i, p i), C x hx → C y hy → C (x + y) ⋯)


@[to_additive]
theorem extend_one [One γ] (f : α → β) : Function.extend f (1 : α → γ) (1 : β → γ) = 1

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Zero γ]
(f : α → β)


@[simp] theorem sub_ofFin (x : BitVec n) (y : Fin (2^n)) : x - .ofFin y = .ofFin (x.toFin - y)

{n : Nat}
(x : BitVec n)
(y : Fin (2 ^ n))

x - { toFin := y } = { toFin := x.toFin - y }


lemma equation_iff_variableChange (x y : R) :
    W.Equation x y ↔ (W.variableChange ⟨1, x, 0, y⟩).toAffine.Equation 0 0

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
(x y : R)

W.Equation x y ↔ (WeierstrassCurve.variableChange W { u := 1, r := x, s := 0, t := y }).toAffine.Equation 0 0


lemma chainTop_isNonZero (α β : Weight R L M) (hα : α.IsNonZero) :
    (chainTop α β).IsNonZero

{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]
[LieAlgebra.IsNilpotent R L]
[NoZeroSMulDivisors ℤ R]
[NoZeroSMulDivisors R M]
[IsNoetherian R M]
(α β : LieModule.Weight R L M)
(hα : α.IsNonZero)


theorem ite_mono (t : Set α) {s₁ s₁' s₂ s₂' : Set α} (h : s₁ ⊆ s₂) (h' : s₁' ⊆ s₂') :
    t.ite s₁ s₁' ⊆ t.ite s₂ s₂'

{α : Type u}
(t : Set α)
{s₁ s₁' s₂ s₂' : Set α}
(h : s₁ ⊆ s₂)
(h' : s₁' ⊆ s₂')


theorem emod_add_cancel_left {m n k i : Int} : (i + m) % n = (i + k) % n ↔ m % n = k % n


/-- A time-independent, continuously differentiable ODE admits a solution in some open interval. -/
theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt (hv : ContDiffAt ℝ 1 v x₀) :
    ∃ f : ℝ → E, f t₀ = x₀ ∧
      ∃ ε > (0 : ℝ), ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{v : E → E}
(t₀ : ℝ)
{x₀ : E}
[CompleteSpace E]
(hv : ContDiffAt ℝ 1 v x₀)

∃ f, f t₀ = x₀ ∧ ∃ ε > 0, ∀ t ∈ Set.Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t


/-- The functor `HomologicalComplex C c ⥤ ShortComplex C` which sends a homological
complex `K` to the short complex `K.X i ⟶ K.X j ⟶ K.X k` for arbitrary indices `i`, `j` and `k`. -/
@[simps]
def shortComplexFunctor' (i j k : ι) : HomologicalComplex C c ⥤ ShortComplex C

∀ {X Y : HomologicalComplex C c} (f : X ⟶ Y), ((HomologicalComplex.shortComplexFunctor' C c i j k).map f).τ₂ = f.f j


theorem sub_pow_eq_sub_pow_mod_mul_pow_sub_pow_div
    [CommRing R] {p : ℕ} [Fact p.Prime] [CharP R p] {n : ℕ} (x y : R) :
    (x - y) ^ n = (x - y) ^ (n % p) * (x ^ p - y ^ p) ^ (n / p)

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


/-- The lifting of a functor to the path category of `LocQuiver W` -/
@[simps!]
def liftToPathCategory : Paths (LocQuiver W) ⥤ D

{C : Type uC}
[CategoryTheory.Category.{uC', uC} C]
{W : CategoryTheory.MorphismProperty C}
{D : Type uD}
[CategoryTheory.Category.{uD', uD} D]
(G : CategoryTheory.Functor C D)
(hG : W.IsInvertedBy G)

∀ {X Y : CategoryTheory.Paths (CategoryTheory.Localization.Construction.LocQuiver W)} (f : X ⟶ Y),
  (CategoryTheory.Localization.Construction.liftToPathCategory G hG).map f =
    CategoryTheory.composePath
      ({ obj := fun X => G.obj X.obj,
            map := fun {X Y} a =>
              Sum.rec (fun val => G.map val) (fun val => CategoryTheory.inv (G.map ↑val)) a }.mapPath
        f)


/-- Forgetting to the underlying type and then building the bundled object returns the original
algebra. -/
@[simps]
def ofSelfIso (M : AlgebraCat.{v} R) : AlgebraCat.of R M ≅ M

{R : Type u}
[CommRing R]
(M : AlgebraCat R)


protected lemma eq_sub_of_add_eq' (h : b + c = a) : c = a - b


/-- Induct on two ereals by performing case splits on the sign of one whenever the other is
infinite. This version eliminates some cases by assuming that `P` is symmetric and `P x y` implies
`P (-x) y` for all `x`, `y`. -/
@[elab_as_elim]
lemma induction₂_symm_neg {P : EReal → EReal → Prop}
    (symm : ∀ {x y}, P x y → P y x)
    (neg_left : ∀ {x y}, P x y → P (-x) y) (top_top : P ⊤ ⊤)
    (top_pos : ∀ x : ℝ, 0 < x → P ⊤ x) (top_zero : P ⊤ 0) (coe_coe : ∀ x y : ℝ, P x y) :
    ∀ x y, P x y

(neg_left : ∀ {x y : EReal}, P x y → P (-x) y)


lemma cfcAux_id : hA.cfcAux (.restrict (spectrum ℝ A) (.id ℝ)) = A

{n : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
[Fintype n]
[DecidableEq n]
{A : Matrix n n 𝕜}
(hA : A.IsHermitian)

hA.cfcAux (ContinuousMap.restrict (spectrum ℝ A) (ContinuousMap.id ℝ)) = A


theorem exists_weightSpace_zero_le_ker_of_isNoetherian
    [IsNoetherian R M] (x : L) :
    ∃ k : ℕ, weightSpace M (0 : L → R) ≤ LinearMap.ker (toEnd R L M x ^ k)

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

∃ k, ↑(LieModule.weightSpace M 0) ≤ LinearMap.ker ((LieModule.toEnd R L M) x ^ k)


/-- The coevaluation map `Y → C(X, Y × X)` sending a point `x : Y` to the continuous function
on `X` sending `y` to `(x, y)`. -/
@[simps (config := .asFn)]
def coev (b : Y) : C(X, Y × X)

(X : Type u_2)
(Y : Type u_3)
[TopologicalSpace X]
[TopologicalSpace Y]
(b : Y)


theorem Ordered.del : ∀ {path : Path α} {t : RBNode α} {c},
    t.Ordered cmp → path.Ordered cmp → t.All (path.RootOrdered cmp) → (path.del t c).Ordered cmp

{α : Type u_1}
{cmp : α → α → Ordering}
{path : Batteries.RBNode.Path α}
{t : Batteries.RBNode α}
{c : Batteries.RBColor}

Batteries.RBNode.Ordered cmp t →
  Batteries.RBNode.Path.Ordered cmp path →
    Batteries.RBNode.All (Batteries.RBNode.Path.RootOrdered cmp path) t → Batteries.RBNode.Ordered cmp (path.del t c)


theorem dist_mul_of_eq_angle_of_dist_mul (a b c a' b' c' : P) (r : ℝ) (h : ∠ a' b' c' = ∠ a b c)
    (hab : dist a' b' = r * dist a b) (hcb : dist c' b' = r * dist c b) :
    dist a' c' = r * dist a c

(h : EuclideanGeometry.angle a' b' c' = EuclideanGeometry.angle a b c)


@[to_additive (attr := simp)]
theorem pure_pow : pure a ^ n = pure (a ^ n)

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

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

n • NonemptyInterval.pure a = NonemptyInterval.pure (n • a)


theorem orbit.eq_or_disjoint (a b : X) :
    orbit G a = orbit G b ∨ Disjoint (orbit G a) (orbit G b)

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
(a b : X)

MulAction.orbit G a = MulAction.orbit G b ∨ Disjoint (MulAction.orbit G a) (MulAction.orbit G b)


/-- If a family of seminorms is continuous, then their basis sets are neighborhoods of zero. -/
lemma basisSets_mem_nhds {𝕜 E ι : Type*} [NormedField 𝕜]
    [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E] (p : SeminormFamily 𝕜 E ι)
    (hp : ∀ i, Continuous (p i)) (U : Set E) (hU : U ∈ p.basisSets) : U ∈ 𝓝 (0 : E)

{𝕜 : Type u_10}
{E : Type u_11}
{ι : Type u_12}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
(p : SeminormFamily 𝕜 E ι)
(hp : ∀ (i : ι), Continuous ⇑(p i))
(U : Set E)
(hU : U ∈ p.basisSets)


theorem nfpBFamily_le_apply (ho : o ≠ 0) (H : ∀ i hi, IsNormal (f i hi)) {a b} :
    (∃ i hi, nfpBFamily.{u, v} o f a ≤ f i hi b) ↔ nfpBFamily.{u, v} o f a ≤ b

{f : (b : Ordinal.{u}) → b < o → Ordinal.{max u v} → Ordinal.{max u v}}

(H : ∀ (i : Ordinal.{u}) (hi : i < o), Ordinal.IsNormal (f i hi))

(∃ i, ∃ (hi : i < o), o.nfpBFamily f a ≤ f i hi b) ↔ o.nfpBFamily f a ≤ b


@[simp]
theorem apply_diag_ne [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) (i : V) :
    ¬A i i = 1

{V : Type u_1}
{α : Type u_2}
{A : Matrix V V α}
[MulZeroOneClass α]
[Nontrivial α]
(h : A.IsAdjMatrix)
(i : V)


/-- `x ^ s = o(exp(b * x))` as `x → ∞` for any real `s` and positive `b`. -/
theorem isLittleO_rpow_exp_pos_mul_atTop (s : ℝ) {b : ℝ} (hb : 0 < b) :
    (fun x : ℝ => x ^ s) =o[atTop] fun x => exp (b * x)

(fun x => x ^ s) =o[Filter.atTop] fun x => rexp (b * x)


@[simp]
theorem adjoin_univ (F E : Type*) [Field F] [Field E] [Algebra F E] :
    adjoin F (Set.univ : Set E) = ⊤

(F : Type u_3)
(E : Type u_4)
[Field F]
[Field E]
[Algebra F E]


/-- Every element is less than its closure. This property is sometimes referred to as extensivity or
inflationarity. -/
theorem le_closure (x : α) : x ≤ u (l x)

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


/-- See `inv_lt_inv_of_lt` for the implication from right-to-left with one fewer assumption. -/
theorem inv_lt_inv (ha : 0 < a) (hb : 0 < b) : a⁻¹ < b⁻¹ ↔ b < a

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


@[to_additive]
theorem prod_eq_single_of_mem {s : Finset α} {f : α → β} (a : α) (h : a ∈ s)
    (h₀ : ∀ b ∈ s, b ≠ a → f b = 1) : ∏ x ∈ s, f x = f a

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
{s : Finset α}
{f : α → β}
(a : α)
(h : a ∈ s)
(h₀ : ∀ b ∈ s, b ≠ a → f b = 0)


theorem chartAt_toPartialEquiv (p : TM) :
    (chartAt (ModelProd H E) p).toPartialEquiv =
      (tangentBundleCore I M).toFiberBundleCore.localTrivAsPartialEquiv (achart H p.1) ≫
        (chartAt H p.1).toPartialEquiv.prod (PartialEquiv.refl E)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(M : Type u_6)
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
(p : TangentBundle I M)

(chartAt (ModelProd H E) p).toPartialEquiv =
  (tangentBundleCore I M).toFiberBundleCore.localTrivAsPartialEquiv (achart H p.proj) ≫
    (chartAt H p.proj).prod (PartialEquiv.refl E)


@[reassoc (attr := simp)]
lemma fac : (map p f φ hf' φ') ≫ φ = φ'

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
[CategoryTheory.Category.{v₂, u₂} 𝒳]
(p : 𝒳 ⥤ 𝒮)
{R S : 𝒮}
{a b : 𝒳}
(f : R ⟶ S)
(φ : a ⟶ b)
[p.IsStronglyCartesian f φ]
{R' : 𝒮}
{a' : 𝒳}
{g : R' ⟶ R}
{f' : R' ⟶ S}
(hf' : f' = g ≫ f)
(φ' : a' ⟶ b)
[p.IsHomLift f' φ']

CategoryTheory.Functor.IsStronglyCartesian.map p f φ hf' φ' ≫ φ = φ'


@[simp]
theorem coe_inter (s t : List α) : (s ∩ t : Multiset α) = (s.bagInter t : List α)

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


theorem isSt_st_of_exists_st {x : ℝ*} (hx : ∃ r : ℝ, IsSt x r) : IsSt x (st x)


/-- Let `I J : Ideal R`. If the localization of `I` at each maximal ideal `P` is included in
the localization of `J` at `P`, then `I ≤ J`. -/
theorem Ideal.le_of_localization_maximal {I J : Ideal R}
    (h : ∀ (P : Ideal R) (hP : P.IsMaximal),
      Ideal.map (algebraMap R (Localization.AtPrime P)) I ≤
        Ideal.map (algebraMap R (Localization.AtPrime P)) J) :
    I ≤ J


/-- Given a nonzero vector in a space of dimension `> 1`, one may find another vector linearly
independent of the first one. -/
theorem exists_linearIndependent_pair_of_one_lt_rank [StrongRankCondition R]
    [NoZeroSMulDivisors R M] (h : 1 < Module.rank R M) {x : M} (hx : x ≠ 0) :
    ∃ y, LinearIndependent R ![x, y]

{R : Type u_1}
{M : Type u}
[Ring R]
[AddCommGroup M]
[Module R M]
[HasRankNullity.{u, u_1} R]
[StrongRankCondition R]
[NoZeroSMulDivisors R M]
(h : 1 < Module.rank R M)
{x : M}
(hx : x ≠ 0)


theorem UInt64.toNat_div (x y : UInt64) : (x / y).toNat = x.toNat / y.toNat


@[simp] lemma coe_add [AddZeroClass R] [ContinuousAdd R] (f g : C(X, R)₀) : ⇑(f + g) = f + g

{X : Type u_1}
{R : Type u_2}
[Zero X]
[TopologicalSpace X]
[TopologicalSpace R]
[AddZeroClass R]
[ContinuousAdd R]
(f g : ContinuousMapZero X R)


@[simp]
theorem sign_pi_add (θ : Angle) : ((π : Angle) + θ).sign = -θ.sign


@[simp, norm_cast]
theorem coeFn_le [Preorder β] {f g : α →ₘ[μ] β} : (f : α → β) ≤ᵐ[μ] g ↔ f ≤ g

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
[Preorder β]
{f g : α →ₘ[μ] β}

↑f ≤ᵐ[μ] ↑g ↔ f ≤ g


theorem _root_.tendsto_real_toNNReal {f : Filter α} {m : α → ℝ} {x : ℝ} (h : Tendsto m f (𝓝 x)) :
    Tendsto (fun a => Real.toNNReal (m a)) f (𝓝 (Real.toNNReal x))

{α : Type u_1}
{f : Filter α}
{m : α → ℝ}
{x : ℝ}
(h : Filter.Tendsto m f (𝓝 x))

Filter.Tendsto (fun a => (m a).toNNReal) f (𝓝 x.toNNReal)


theorem definable_finset_biUnion {ι : Type*} {f : ι → Set (α → M)}
    (hf : ∀ i, A.Definable L (f i)) (s : Finset ι) : A.Definable L (⋃ i ∈ s, f i)

{M : Type w}
{A : Set M}
{L : FirstOrder.Language}
[L.Structure M]
{α : Type u₁}
{ι : Type u_2}
{f : ι → Set (α → M)}
(hf : ∀ (i : ι), A.Definable L (f i))
(s : Finset ι)


/-- `Prod.fst : (x, y) ↦ x` as a bundled continuous map. -/
@[simps (config := .asFn)]
def fst : C(α × β, α)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]


theorem HasFTaylorSeriesUpToOn.contDiffOn {f' : E → FormalMultilinearSeries 𝕜 E F}
    (hf : HasFTaylorSeriesUpToOn n f f' s) : ContDiffOn 𝕜 n f s


theorem getElem_ofFn_go (f : Fin n → α) (i) {acc k}
    (hki : k < n) (hin : i ≤ n) (hi : i = acc.size)
    (hacc : ∀ j, ∀ hj : j < acc.size, acc[j] = f ⟨j, Nat.lt_of_lt_of_le hj (hi ▸ hin)⟩) :
    haveI : acc.size + (n - acc.size) = n := Nat.add_sub_cancel' (hi ▸ hin)
    (ofFn.go f i acc)[k]'(by simp [*]) = f ⟨k, hki⟩

(hacc : ∀ (j : Nat) (hj : j < acc.size), acc[j] = f ⟨j, ⋯⟩)


theorem l_biSup_u [CompleteLattice α] [CompleteLattice β] (gi : GaloisInsertion l u) {ι : Sort x}
    {p : ι → Prop} (f : ∀ i, p i → β) : l (⨆ (i) (hi), u (f i hi)) = ⨆ (i) (hi), f i hi

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[CompleteLattice α]
[CompleteLattice β]
(gi : GaloisInsertion l u)
{ι : Sort x}
{p : ι → Prop}
(f : (i : ι) → p i → β)

l (⨆ i, ⨆ (hi : p i), u (f i hi)) = ⨆ i, ⨆ (hi : p i), f i hi


/-- If `f` has compact multiplicative support, then `f` tends to 1 at infinity. -/
@[to_additive "If `f` has compact support, then `f` tends to zero at infinity."]
theorem is_one_at_infty {f : α → γ} [TopologicalSpace γ] [One γ]
    (h : HasCompactMulSupport f) : Tendsto f (cocompact α) (𝓝 1)

{α : Type u_2}
{γ : Type u_5}
[TopologicalSpace α]
{f : α → γ}
[TopologicalSpace γ]
[One γ]
(h : HasCompactMulSupport f)

Filter.Tendsto f (Filter.cocompact α) (𝓝 1)


/-- The functor constructed with `copyObj` is isomorphic to the given functor. -/
@[simps!]
def isoCopyObj : F ≅ F.copyObj obj e

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
(obj : C → D)
(e : (X : C) → F.obj X ≅ obj X)
(X : C)

(F.isoCopyObj obj e).hom.app X = (e X).hom


@[simp]
theorem toFinsupp_erase (p : R[X]) (n : ℕ) : toFinsupp (p.erase n) = p.toFinsupp.erase n

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

(Polynomial.erase n p).toFinsupp = Finsupp.erase n p.toFinsupp


lemma strictAntiOn_smoothingFn : StrictAntiOn ε (Set.Ioi 1)

StrictAntiOn AkraBazziRecurrence.smoothingFn (Set.Ioi 1)


@[simp]
theorem tensorHom {W X Y Z : C} (f : W ⟶ X) (g : Y ⟶ Z) : f ⊗ g = Limits.coprod.map f g

CategoryTheory.MonoidalCategory.tensorHom f g = CategoryTheory.Limits.coprod.map f g


theorem ext_get_iff {l₁ l₂ : List α} :
    l₁ = l₂ ↔ l₁.length = l₂.length ∧ ∀ n h₁ h₂, get l₁ ⟨n, h₁⟩ = get l₂ ⟨n, h₂⟩

l₁ = l₂ ↔ l₁.length = l₂.length ∧ ∀ (n : ℕ) (h₁ : n < l₁.length) (h₂ : n < l₂.length), l₁.get ⟨n, h₁⟩ = l₂.get ⟨n, h₂⟩


@[simp]
theorem sUnion_empty : ⋃₀ (∅ : Class.{u}) = (∅ : Class.{u})


theorem norm_fderiv_iteratedFDeriv {n : ℕ} :
    ‖fderiv 𝕜 (iteratedFDeriv 𝕜 n f) x‖ = ‖iteratedFDeriv 𝕜 (n + 1) f x‖

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{n : ℕ}


/-- On square matrices, `mul_comm` applies under `det`. -/
theorem det_mul_comm (M N : Matrix m m R) : det (M * N) = det (N * M)

{m : Type u_1}
[DecidableEq m]
[Fintype m]
{R : Type v}
[CommRing R]
(M N : Matrix m m R)


theorem chain'_map_of_chain' {S : β → β → Prop} (f : α → β) (H : ∀ a b : α, R a b → S (f a) (f b))
    {l : List α} (p : Chain' R l) : Chain' S (map f l)

(H : ∀ (a b : α), R a b → S (f a) (f b))


@[field_simps]
theorem divp_mul_divp (x y : α) (ux uy : αˣ) : x /ₚ ux * (y /ₚ uy) = x * y /ₚ (ux * uy)

{α : Type u}
[CommMonoid α]
(x y : α)
(ux uy : αˣ)


theorem mul_le_mul_left (h : M ≤ N) : M * P ≤ N * P

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
{M N P : Submodule R A}
(h : M ≤ N)


/-- The diagram of the multifork attached to a presheaf
`F : Cᵒᵖ ⥤ A`, `S : C` and `E : PreOneHypercover S`. -/
@[simps]
def multicospanIndex (F : Cᵒᵖ ⥤ A) : MulticospanIndex A

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{A : Type u_1}
[CategoryTheory.Category.{u_2, u_1} A]
{S : C}
(E : CategoryTheory.PreOneHypercover S)
(F : CategoryTheory.Functor Cᵒᵖ A)
(j : E.I₁')

(E.multicospanIndex F).fstTo j = j.fst.1


/-- Reformulation of `ConvexOn.slope_le_of_hasDerivAt` using `deriv`. -/
lemma slope_le_deriv (hfc : ConvexOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hfd : DifferentiableAt ℝ f y) :
    slope f x y ≤ deriv f y

{S : Set ℝ}
{f : ℝ → ℝ}
{x y : ℝ}
(hfc : ConvexOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hfd : DifferentiableAt ℝ f y)


theorem by_cases {p q : Prop} (hpq : p → q) (hnpq : ¬p → q) : q


@[simp] lemma odd_iff_not_even : Odd n ↔ ¬Even n


theorem IsCobounded.mono (h : f ≤ g) : f.IsCobounded r → g.IsCobounded r

{α : Type u_1}
{r : α → α → Prop}
{f g : Filter α}
(h : f ≤ g)

Filter.IsCobounded r f → Filter.IsCobounded r g


@[simp]
theorem continuousAt_tan {x : ℂ} : ContinuousAt tan x ↔ cos x ≠ 0

ContinuousAt Complex.tan x ↔ Complex.cos x ≠ 0


lemma IsClosed.stableUnderSpecialization {s : Set X} (hs : IsClosed s) :
    StableUnderSpecialization s

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


theorem dual_balance' (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (balance' l x r) = balance' (dual r) x (dual l)

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

(l.balance' x r).dual = r.dual.balance' x l.dual


/-- The associator isomorphism for binary products. -/
@[simps]
def prod.associator [HasBinaryProducts C] (P Q R : C) : (P ⨯ Q) ⨯ R ≅ P ⨯ Q ⨯ R

(CategoryTheory.Limits.prod.associator P Q R).hom =
  CategoryTheory.Limits.prod.lift (CategoryTheory.Limits.prod.fst ≫ CategoryTheory.Limits.prod.fst)
    (CategoryTheory.Limits.prod.lift (CategoryTheory.Limits.prod.fst ≫ CategoryTheory.Limits.prod.snd)
      CategoryTheory.Limits.prod.snd)


theorem range_inclusion (p q : Submodule R M) (h : p ≤ q) :
    range (inclusion h) = comap q.subtype p

{R : Type u_1}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p q : Submodule R M)
(h : p ≤ q)

LinearMap.range (Submodule.inclusion h) = Submodule.comap q.subtype p


theorem IsBigO.antisymm (h₁ : f =O[l] g) (h₂ : g =O[l] f) : f =Θ[l] g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
{l : Filter α}
(h₁ : f =O[l] g)
(h₂ : g =O[l] f)


theorem arsinh_surjective : Surjective arsinh


lemma Antitone.image_Ici_subset (h : Antitone f) : f '' Ici a ⊆ Iic (f a)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{a : α}
(h : Antitone f)


/-- If we replace a column of a matrix by a linear combination of its columns, then the determinant
is multiplied by the coefficient of that column. -/
theorem det_updateColumn_sum (A : Matrix n n R) (j : n) (c : n → R) :
    (A.updateColumn j (fun k ↦ ∑ i, (c i) • A k i)).det = (c j) • A.det

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A : Matrix n n R)
(j : n)
(c : n → R)

(A.updateColumn j fun k => ∑ i : n, c i • A k i).det = c j • A.det


/-- The exponentiation map is an isomorphism from the additive monoid on natural numbers to powers
when it is injective. The inverse is given by the logarithms. -/
@[simps]
def powLogEquiv [DecidableEq M] {n : M} (h : Function.Injective fun m : ℕ => n ^ m) :
    Multiplicative ℕ ≃* powers n

{M : Type u_1}
[Monoid M]
[DecidableEq M]
{n : M}
(h : Function.Injective fun m => n ^ m)
(m : ↥(Submonoid.powers n))

(Submonoid.powLogEquiv h).symm m = Multiplicative.ofAdd (Submonoid.log m)


/-- `DFinsupp.mapRange` as a `LinearMap`. -/
@[simps! apply]
def mapRange.linearMap (f : ∀ i, β₁ i →ₗ[R] β₂ i) : (Π₀ i, β₁ i) →ₗ[R] Π₀ i, β₂ i

{ι : Type u_1}
{R : Type u_2}
[Semiring R]
{β₁ : ι → Type u_7}
{β₂ : ι → Type u_8}
[(i : ι) → AddCommMonoid (β₁ i)]
[(i : ι) → AddCommMonoid (β₂ i)]
[(i : ι) → Module R (β₁ i)]
[(i : ι) → Module R (β₂ i)]
(f : (i : ι) → β₁ i →ₗ[R] β₂ i)
(x : Π₀ (i : ι), β₁ i)

(DFinsupp.mapRange.linearMap f) x = DFinsupp.mapRange (fun i x => (f i) x) ⋯ x


@[simp] lemma angle_mul_left (ha : a ≠ 0) (x y : ℂ) : angle (a * x) (a * y) = angle x y

InnerProductGeometry.angle (a * x) (a * y) = InnerProductGeometry.angle x y


theorem erase_idem {a : α} {s : Finset α} : erase (erase s a) a = erase s a

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


lemma natCast_strictMono (hbn : b ≤ n) (hab : a < b) : (a : Fin (n + 1)) < b


/-- A function which is continuous on a set `s` is almost everywhere strongly measurable with
respect to `μ.restrict s` when either the source space or the target space is second-countable. -/
theorem ContinuousOn.aestronglyMeasurable [TopologicalSpace α] [TopologicalSpace β]
    [h : SecondCountableTopologyEither α β] [OpensMeasurableSpace α] [PseudoMetrizableSpace β]
    {f : α → β} {s : Set α} {μ : Measure α} (hf : ContinuousOn f s) (hs : MeasurableSet s) :
    AEStronglyMeasurable f (μ.restrict s)

MeasureTheory.AEStronglyMeasurable f (μ.restrict s)


/-- A pretrivialization for a vector bundle defines linear equivalences between the
fibers and the model space. -/
@[simps (config := .asFn)]
def linearEquivAt (e : Pretrivialization F (π F E)) [e.IsLinear R] (b : B) (hb : b ∈ e.baseSet) :
    E b ≃ₗ[R] F

(e : Pretrivialization F Bundle.TotalSpace.proj)

⇑(Pretrivialization.linearEquivAt R e b hb) = fun y => (↑e { proj := b, snd := y }).2


theorem eventually_nhdsSet_iUnion {ι : Sort*} {s : ι → Set X} {P : X → Prop} :
    (∀ᶠ x in 𝓝ˢ (⋃ i, s i), P x) ↔ ∀ i, ∀ᶠ x in 𝓝ˢ (s i), P x

{X : Type u_1}
[TopologicalSpace X]
{ι : Sort u_3}
{s : ι → Set X}
{P : X → Prop}

(∀ᶠ (x : X) in 𝓝ˢ (⋃ i, s i), P x) ↔ ∀ (i : ι), ∀ᶠ (x : X) in 𝓝ˢ (s i), P x


theorem CG.range {N : Type*} [L.Structure N] (h : CG L M) (f : M →[L] N) : f.range.CG

(h : FirstOrder.Language.Structure.CG L M)


/-- If `A` is a finitely presented `R`-algebra, then `MvPolynomial (Fin n) A` is finitely presented
as `R`-algebra. -/
theorem mvPolynomial_of_finitePresentation [FinitePresentation.{w₁, w₂} R A]
    (ι : Type v) [Finite ι] :
    FinitePresentation.{w₁, max v w₂} R (MvPolynomial ι A)

{R : Type w₁}
{A : Type w₂}
[CommRing R]
[CommRing A]
[Algebra R A]
[Algebra.FinitePresentation R A]
(ι : Type v)
[Finite ι]

Algebra.FinitePresentation R (MvPolynomial ι A)


@[to_additive]
theorem subsemigroupMap_surjective (f : M →ₙ* N) (M' : Subsemigroup M) :
    Function.Surjective (f.subsemigroupMap M')

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(f : AddHom M N)
(M' : AddSubsemigroup M)


/-- A ring isomorphism sends one to one. -/
protected theorem map_one : f 1 = 1

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


@[to_additive]
theorem Set.piecewise_mul [∀ i, Mul (f i)] (s : Set I) [∀ i, Decidable (i ∈ s)]
    (f₁ f₂ g₁ g₂ : ∀ i, f i) :
    s.piecewise (f₁ * f₂) (g₁ * g₂) = s.piecewise f₁ g₁ * s.piecewise f₂ g₂

{I : Type u}
{f : I → Type v}
[(i : I) → Add (f i)]
(s : Set I)
[(i : I) → Decidable (i ∈ s)]
(f₁ f₂ g₁ g₂ : (i : I) → f i)

s.piecewise (f₁ + f₂) (g₁ + g₂) = s.piecewise f₁ g₁ + s.piecewise f₂ g₂


theorem setLIntegral_max {f g : α → ℝ≥0∞} (hf : Measurable f) (hg : Measurable g) (s : Set α) :
    ∫⁻ x in s, max (f x) (g x) ∂μ =
      ∫⁻ x in s ∩ { x | f x ≤ g x }, g x ∂μ + ∫⁻ x in s ∩ { x | g x < f x }, f x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → ℝ≥0∞}
(hf : Measurable f)
(hg : Measurable g)
(s : Set α)

∫⁻ (x : α) in s, max (f x) (g x) ∂μ =
  ∫⁻ (x : α) in s ∩ {x | f x ≤ g x}, g x ∂μ + ∫⁻ (x : α) in s ∩ {x | g x < f x}, f x ∂μ


@[simp] theorem preimage_singleton_true (p : α → Prop) : p ⁻¹' {True} = {a | p a}


lemma addY_smul (P Q : Fin 3 → R) (u v : R) :
    W'.addY (u • P) (v • Q) = ((u * v) ^ 2) ^ 3 * W'.addY P Q

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P Q : Fin 3 → R)
(u v : R)


theorem continuous_stoneCechExtend : Continuous (stoneCechExtend hg)

{α : Type u}
[TopologicalSpace α]
{β : Type v}
[TopologicalSpace β]
[T2Space β]
[CompactSpace β]
{g : α → β}
(hg : Continuous g)


/-- Any number m is less than b^(number of digits in the base b representation of m) -/
theorem lt_base_pow_length_digits {b m : ℕ} (hb : 1 < b) : m < b ^ (digits b m).length


@[to_additive]
theorem ContinuousWithinAt.pow {f : X → M} {x : X} {s : Set X} (hf : ContinuousWithinAt f s x)
    (n : ℕ) : ContinuousWithinAt (fun x => f x ^ n) s x

{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[AddMonoid M]
[ContinuousAdd M]
{f : X → M}
{x : X}
{s : Set X}
(hf : ContinuousWithinAt f s x)
(n : ℕ)

ContinuousWithinAt (fun x => n • f x) s x


@[simp]
theorem comp_id (f : EsakiaHom α β) : f.comp (EsakiaHom.id α) = f

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[Preorder α]
[TopologicalSpace β]
[Preorder β]
(f : EsakiaHom α β)


@[simp]
theorem eventually_nhdsWithin_nhdsWithin {a : α} {s : Set α} {p : α → Prop} :
    (∀ᶠ y in 𝓝[s] a, ∀ᶠ x in 𝓝[s] y, p x) ↔ ∀ᶠ x in 𝓝[s] a, p x

{α : Type u_1}
[TopologicalSpace α]
{a : α}
{s : Set α}
{p : α → Prop}

(∀ᶠ (y : α) in 𝓝[s] a, ∀ᶠ (x : α) in 𝓝[s] y, p x) ↔ ∀ᶠ (x : α) in 𝓝[s] a, p x


theorem smul_ofModule_asModule (r : MonoidAlgebra k G) (m : (ofModule M).asModule) :
    (RestrictScalars.addEquiv k _ _) ((ofModule M).asModuleEquiv (r • m)) =
      r • (RestrictScalars.addEquiv k _ _) ((ofModule M).asModuleEquiv (G := G) m)

(m : (Representation.ofModule M).asModule)

(RestrictScalars.addEquiv k (MonoidAlgebra k G) M) ((Representation.ofModule M).asModuleEquiv (r • m)) =
  r • (RestrictScalars.addEquiv k (MonoidAlgebra k G) M) ((Representation.ofModule M).asModuleEquiv m)


theorem sin_sub_pi_div_two (x : ℂ) : sin (x - π / 2) = -cos x

Complex.sin (x - ↑Real.pi / 2) = -Complex.cos x


/--
The explicit pullback cone is a limit cone.
-/
@[simps! lift]
def pullback.isLimit : Limits.IsLimit (pullback.cone f g)

(s : CategoryTheory.Limits.PullbackCone f g)

(CompHaus.pullback.isLimit f g).lift s = CompHaus.pullback.lift f g s.fst s.snd ⋯


theorem mem_biUnionIndex (hJ : J ∈ π.biUnion πi) : J ∈ πi (π.biUnionIndex πi J)

{πi : (J : BoxIntegral.Box ι) → BoxIntegral.Prepartition J}


theorem eq_lim_at_right_extendFrom_Ioo [TopologicalSpace α] [LinearOrder α] [DenselyOrdered α]
    [OrderTopology α] [TopologicalSpace β] [T2Space β] {f : α → β} {a b : α} {lb : β} (hab : a < b)
    (hb : Tendsto f (𝓝[<] b) (𝓝 lb)) : extendFrom (Ioo a b) f b = lb

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrder α]
[DenselyOrdered α]
[OrderTopology α]
[TopologicalSpace β]
[T2Space β]
{f : α → β}
{a b : α}
{lb : β}
(hab : a < b)
(hb : Filter.Tendsto f (𝓝[<] b) (𝓝 lb))


/-- **L'Hôpital's rule** for approaching a real, `deriv` version. This
  does not require anything about the situation at `a` -/
theorem lhopital_zero_nhds' (hdf : ∀ᶠ x in 𝓝[≠] a, DifferentiableAt ℝ f x)
    (hg' : ∀ᶠ x in 𝓝[≠] a, deriv g x ≠ 0) (hfa : Tendsto f (𝓝[≠] a) (𝓝 0))
    (hga : Tendsto g (𝓝[≠] a) (𝓝 0))
    (hdiv : Tendsto (fun x => (deriv f) x / (deriv g) x) (𝓝[≠] a) l) :
    Tendsto (fun x => f x / g x) (𝓝[≠] a) l

(hdf : ∀ᶠ (x : ℝ) in 𝓝[≠] a, DifferentiableAt ℝ f x)

(hg' : ∀ᶠ (x : ℝ) in 𝓝[≠] a, deriv g x ≠ 0)

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

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


/-- The Dold-Kan equivalence for abelian categories -/
@[simps! functor]
def equivalence : SimplicialObject A ≌ ChainComplex A ℕ

{A : Type u_1}
[CategoryTheory.Category.{u_2, u_1} A]
[CategoryTheory.Abelian A]


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

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


/-- This is a version of `Finset.mem_convexHull` stated without `Finset.centerMass`. -/
lemma Finset.mem_convexHull' {s : Finset E} {x : E} :
    x ∈ convexHull R (s : Set E) ↔
      ∃ w : E → R, (∀ y ∈ s, 0 ≤ w y) ∧ ∑ y ∈ s, w y = 1 ∧ ∑ y ∈ s, w y • y = x

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
{s : Finset E}
{x : E}

x ∈ (convexHull R) ↑s ↔ ∃ w, (∀ y ∈ s, 0 ≤ w y) ∧ ∑ y ∈ s, w y = 1 ∧ ∑ y ∈ s, w y • y = x


theorem tsub_lt_iff_right (hbc : b ≤ a) : a - b < c ↔ a < c + b

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

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


/-- If `‖x + y‖ = ‖x‖ + ‖y‖` implies that `x y : E` are in the same ray, then `E` is a strictly
convex space. See also a more -/
theorem StrictConvexSpace.of_norm_add
    (h : ∀ x y : E, ‖x‖ = 1 → ‖y‖ = 1 → ‖x + y‖ = 2 → SameRay ℝ x y) : StrictConvexSpace ℝ E

(h : ∀ (x y : E), ‖x‖ = 1 → ‖y‖ = 1 → ‖x + y‖ = 2 → SameRay ℝ x y)


@[simp]
theorem toMeasure_map_apply [MeasurableSpace α] [MeasurableSpace β] (hf : Measurable f)
    (hs : MeasurableSet s) : (p.map f).toMeasure s = p.toMeasure (f ⁻¹' s)

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(p : PMF α)
(s : Set β)
[MeasurableSpace α]
[MeasurableSpace β]
(hf : Measurable f)
(hs : MeasurableSet s)

(PMF.map f p).toMeasure s = p.toMeasure (f ⁻¹' s)


@[simp]
theorem foldrRecOn_nil {C : β → Sort*} (op : α → β → β) (b) (hb : C b) (hl) :
    foldrRecOn [] op b hb hl = hb

(op : α → β → β)

(hl : (b : β) → C b → (a : α) → a ∈ [] → C (op a b))


@[simp, norm_cast]
theorem coe_product (s : Finset α) (t : Finset β) :
    (↑(s ×ˢ t) : Set (α × β)) = (s : Set α) ×ˢ t

{α : Type u_1}
{β : Type u_2}
(s : Finset α)
(t : Finset β)

↑(s ×ˢ t) = ↑s ×ˢ ↑t


/-- A variant of `modEq_iff_dvd` with `Nat` divisibility -/
theorem modEq_iff_dvd' (h : a ≤ b) : a ≡ b [MOD n] ↔ n ∣ b - a


/-- The preimage of a connected component is preconnected if the function has connected fibers
and a subset is closed iff the preimage is. -/
theorem preimage_connectedComponent_connected [TopologicalSpace β] {f : α → β}
    (connected_fibers : ∀ t : β, IsConnected (f ⁻¹' {t}))
    (hcl : ∀ T : Set β, IsClosed T ↔ IsClosed (f ⁻¹' T)) (t : β) :
    IsConnected (f ⁻¹' connectedComponent t)

(connected_fibers : ∀ (t : β), IsConnected (f ⁻¹' {t}))

(hcl : ∀ (T : Set β), IsClosed T ↔ IsClosed (f ⁻¹' T))


@[to_additive]
theorem apply_eq_iff_eq (e : M ≃* N) {x y : M} : e x = e y ↔ x = y

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(e : M ≃+ N)
{x y : M}


theorem card_le_card_of_leftTotal_unique (h₁ : LeftTotal r) (h₂ : LeftUnique r) :
    Fintype.card α ≤ Fintype.card β

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
{r : α → β → Prop}
(h₁ : Relator.LeftTotal r)
(h₂ : Relator.LeftUnique r)


theorem braiding_leftUnitor_aux₁ (X : C) :
    (α_ (𝟙_ C) (𝟙_ C) X).hom ≫
        (𝟙_ C ◁ (β_ X (𝟙_ C)).inv) ≫ (α_ _ X _).inv ≫ ((λ_ X).hom ▷ _) =
      ((λ_ _).hom ▷ X) ≫ (β_ X (𝟙_ C)).inv

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

(α_ (𝟙_ C) (𝟙_ C) X).hom ≫ 𝟙_ C ◁ (β_ X (𝟙_ C)).inv ≫ (α_ (𝟙_ C) X (𝟙_ C)).inv ≫ (λ_ X).hom ▷ 𝟙_ C =
  (λ_ (𝟙_ C)).hom ▷ X ≫ (β_ X (𝟙_ C)).inv


theorem trop_sum [AddCommMonoid R] (s : Finset S) (f : S → R) :
    trop (∑ i ∈ s, f i) = ∏ i ∈ s, trop (f i)

{R : Type u_1}
{S : Type u_2}
[AddCommMonoid R]
(s : Finset S)
(f : S → R)

Tropical.trop (∑ i ∈ s, f i) = ∏ i ∈ s, Tropical.trop (f i)


/-- If `F ⋙ G` is full and `G` is faithful, then `F` is full. -/
lemma Full.of_comp_faithful_iso {F : C ⥤ D} {G : D ⥤ E} {H : C ⥤ E} [Full H] [G.Faithful]
    (h : F ⋙ G ≅ H) : Full F

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


@[to_additive]
theorem map.comp {γ : Type w} (f : α → β) (g : β → γ) (x) :
    map g (map f x) = map (g ∘ f) x

{α : Type u}
{β : Type v}
{γ : Type w}
(f : α → β)
(g : β → γ)
(x : FreeAddGroup α)

(FreeAddGroup.map g) ((FreeAddGroup.map f) x) = (FreeAddGroup.map (g ∘ f)) x


theorem eventually_atTop_prod_self [SemilatticeSup α] [Nonempty α] {p : α × α → Prop} :
    (∀ᶠ x in atTop, p x) ↔ ∃ a, ∀ k l, a ≤ k → a ≤ l → p (k, l)

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

(∀ᶠ (x : α × α) in Filter.atTop, p x) ↔ ∃ a, ∀ (k l : α), a ≤ k → a ≤ l → p (k, l)


/-- If `p` is prime, then `cyclotomic p R = ∑ i ∈ range p, X ^ i`. -/
theorem cyclotomic_prime (R : Type*) [Ring R] (p : ℕ) [hp : Fact p.Prime] :
    cyclotomic p R = ∑ i ∈ Finset.range p, X ^ i

(R : Type u_1)
[Ring R]
(p : ℕ)
[hp : Fact (Nat.Prime p)]

Polynomial.cyclotomic p R = ∑ i ∈ Finset.range p, Polynomial.X ^ i


/-- The equivalence between isomorphisms of the form `A ≅ B` and `B.unop ≅ A.unop`.

Note this is definitionally the same as the other three variants:
* `(Opposite.op A ≅ B) ≃ (B.unop ≅ A)`
* `(A ≅ Opposite.op B) ≃ (B ≅ A.unop)`
* `(Opposite.op A ≅ Opposite.op B) ≃ (B ≅ A)`
-/
@[simps]
def isoOpEquiv (A B : Cᵒᵖ) : (A ≅ B) ≃ (B.unop ≅ A.unop)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(A B : Cᵒᵖ)
(g : Opposite.unop B ≅ Opposite.unop A)

(CategoryTheory.isoOpEquiv A B).symm g = g.op


/-- Construct an adjunction between `F` and `G` out of a natural bijection between each
`F.obj X ⟶ Y` and `X ⟶ G.obj Y`. -/
@[simps]
def mkOfHomEquiv (adj : CoreHomEquiv F G) : F ⊣ G

(adj : CategoryTheory.Adjunction.CoreHomEquiv F G)

(CategoryTheory.Adjunction.mkOfHomEquiv adj).homEquiv X Y = adj.homEquiv X Y


@[simp] lemma bot_lt_log_iff {x : ℝ≥0∞} : ⊥ < log x ↔ 0 < x


/-- Two 2-morphisms out of a left Kan lift are equal if their compositions with
each triangle 2-morphism are equal. -/
theorem hom_ext (H : IsKan t) {k : c ⟶ b} {τ τ' : t.lift ⟶ k}
    (w : t.unit ≫ τ ▷ f = t.unit ≫ τ' ▷ f) : τ = τ'

{t : CategoryTheory.Bicategory.LeftLift f g}

(w :
  CategoryTheory.CategoryStruct.comp t.unit (CategoryTheory.Bicategory.whiskerRight τ f) =
    CategoryTheory.CategoryStruct.comp t.unit (CategoryTheory.Bicategory.whiskerRight τ' f))


theorem coprime_primes {p q : ℕ} (pp : Prime p) (pq : Prime q) : Coprime p q ↔ p ≠ q

{p q : ℕ}
(pp : Nat.Prime p)
(pq : Nat.Prime q)


/-- Auxiliary lemma for `measure_univ_eq`. -/
lemma measure_univ_eq_of_subset (hP : IsProjectiveMeasureFamily P) (hJI : J ⊆ I) :
    P I univ = P J univ

{P : (J : Finset ι) → MeasureTheory.Measure ((j : { x // x ∈ J }) → α ↑j)}

(hP : MeasureTheory.IsProjectiveMeasureFamily P)


nonrec theorem IsLocalMaxOn.congr {f g : α → β} {a : α} (h : IsLocalMaxOn f s a)
    (heq : f =ᶠ[𝓝[s] a] g) (hmem : a ∈ s) : IsLocalMaxOn g s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{s : Set α}
{f g : α → β}
{a : α}
(h : IsLocalMaxOn f s a)
(heq : f =ᶠ[𝓝[s] a] g)
(hmem : a ∈ s)


/-- Given all wide pullbacks in `C`, construct products in `C/B`. -/
theorem over_products_of_widePullbacks [HasWidePullbacks.{w} C] {B : C} :
    HasProducts.{w} (Over B)


@[nontriviality]
theorem contDiffAt_of_subsingleton [Subsingleton F] : ContDiffAt 𝕜 n f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{n : ℕ∞}
[Subsingleton F]