/-- A type `α` is countable if there exists an injective map `α → ℕ`. -/
@[mk_iff countable_iff_exists_injective]
class Countable (α : Sort u) : Prop where
  /-- A type `α` is countable if there exists an injective map `α → ℕ`. -/
  exists_injective_nat' : ∃ f : α → ℕ, Injective f


/-- `Discrete α` is equivalent to the original type `α`. -/
@[simps]
def discreteEquiv {α : Type u₁} : Discrete α ≃ α

(CategoryTheory.discreteEquiv.symm as).as = as


@[simp]
theorem iUnion_toPrepartition : π.toPrepartition.iUnion = π.iUnion

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.TaggedPrepartition I)


theorem minimum_of_length_pos_mem (h : 0 < l.length) :
    minimum_of_length_pos h ∈ l

{α : Type u_1}
[LinearOrder α]
{l : List α}
(h : 0 < l.length)


lemma mem_spectrum_inr_of_not_isUnit {R A : Type*} [CommRing R]
    [NonUnitalRing A] [Module R A] [IsScalarTower R A A] [SMulCommClass R A A]
    (a : A) (r : R) (hr : ¬ IsUnit r) : r ∈ spectrum R (a : Unitization R A)

{R : Type u_3}
{A : Type u_4}
[CommRing R]
[NonUnitalRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(a : A)
(r : R)
(hr : ¬IsUnit r)


protected theorem Commute.mul_geom_sum₂_Ico [Ring α] {x y : α} (h : Commute x y) {m n : ℕ}
    (hmn : m ≤ n) :
    ((x - y) * ∑ i ∈ Finset.Ico m n, x ^ i * y ^ (n - 1 - i)) = x ^ n - x ^ m * y ^ (n - m)

{α : Type u}
[Ring α]
{x y : α}
(h : Commute x y)
{m n : ℕ}
(hmn : m ≤ n)

(x - y) * ∑ i ∈ Finset.Ico m n, x ^ i * y ^ (n - 1 - i) = x ^ n - x ^ m * y ^ (n - m)


lemma toHomeomorph_apply (e : α ≃ᵤ β) : (e.toHomeomorph : α → β) = e

{α : Type u}
{β : Type u_1}
[UniformSpace α]
[UniformSpace β]
(e : α ≃ᵤ β)


@[to_additive]
theorem union_mul : (s₁ ∪ s₂) * t = s₁ * t ∪ s₂ * t

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


theorem measure_union_add_inter₀' (hs : NullMeasurableSet s μ) (t : Set α) :
    μ (s ∪ t) + μ (s ∩ t) = μ s + μ t

(hs : MeasureTheory.NullMeasurableSet s μ)


@[simp]
theorem rightComm_tmul (m : M) (p : P) (q : Q) :
    rightComm R A M P Q ((m ⊗ₜ p) ⊗ₜ q) = (m ⊗ₜ q) ⊗ₜ p

(R : Type uR)
(A : Type uA)
{M : Type uM}
{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 P]
[Module A P]
[AddCommMonoid Q]
[Module R Q]
(m : M)
(p : P)
(q : Q)

(TensorProduct.AlgebraTensorModule.rightComm R A M P Q) ((m ⊗ₜ[A] p) ⊗ₜ[R] q) = (m ⊗ₜ[R] q) ⊗ₜ[A] p


@[to_additive]
protected theorem conj (comm : Commute a b) (h : G) : Commute (h * a * h⁻¹) (h * b * h⁻¹)

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


/-- A morphism of modules is surjective if and only the morphism of exterior algebras that it
induces is surjective. -/
@[simp]
lemma map_surjective_iff {f : M →ₗ[R] N} :
    Function.Surjective (map f) ↔ Function.Surjective f

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{N : Type u4}
[AddCommGroup N]
[Module R N]
{f : M →ₗ[R] N}

Function.Surjective ⇑(ExteriorAlgebra.map f) ↔ Function.Surjective ⇑f


theorem strictMonoOn_tan : StrictMonoOn tan (Ioo (-(π / 2)) (π / 2))

StrictMonoOn Real.tan (Set.Ioo (-(Real.pi / 2)) (Real.pi / 2))


nonrec theorem IsLocalMax.comp_mono (hf : IsLocalMax f a) {g : β → γ} (hg : Monotone g) :
    IsLocalMax (g ∘ f) a

{α : Type u}
{β : Type v}
{γ : Type w}
[TopologicalSpace α]
[Preorder β]
[Preorder γ]
{f : α → β}
{a : α}
(hf : IsLocalMax f a)
{g : β → γ}
(hg : Monotone g)


theorem Zigzag.trans {j₁ j₂ j₃ : J} (h₁ : Zigzag j₁ j₂) (h₂ : Zigzag j₂ j₃) : Zigzag j₁ j₃

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{j₁ j₂ j₃ : J}
(h₁ : CategoryTheory.Zigzag j₁ j₂)
(h₂ : CategoryTheory.Zigzag j₂ j₃)


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

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


@[to_additive dite_nonneg]
lemma one_le_dite [LE α] (ha : ∀ h, 1 ≤ a h) (hb : ∀ h, 1 ≤ b h) : 1 ≤ dite p a b

{α : Type u_2}
[One α]
{p : Prop}
[Decidable p]
{a : p → α}
{b : ¬p → α}
[LE α]
(ha : ∀ (h : p), 1 ≤ a h)
(hb : ∀ (h : ¬p), 1 ≤ b h)


theorem UniformEmbedding.prod {α' : Type*} {β' : Type*} [UniformSpace α'] [UniformSpace β']
    {e₁ : α → α'} {e₂ : β → β'} (h₁ : UniformEmbedding e₁) (h₂ : UniformEmbedding e₂) :
    UniformEmbedding fun p : α × β => (e₁ p.1, e₂ p.2)

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]
{α' : Type u_1}
{β' : Type u_2}
[UniformSpace α']
[UniformSpace β']
{e₁ : α → α'}
{e₂ : β → β'}
(h₁ : UniformEmbedding e₁)
(h₂ : UniformEmbedding e₂)

UniformEmbedding fun p => (e₁ p.1, e₂ p.2)


/-- Sufficient conditions to show that the `p`-adic valuation of `q` is less than or equal to the
`p`-adic valuation of `q + r`. -/
theorem le_padicValRat_add_of_le {q r : ℚ} (hqr : q + r ≠ 0)
    (h : padicValRat p q ≤ padicValRat p r) : padicValRat p q ≤ padicValRat p (q + r)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{q r : ℚ}
(hqr : q + r ≠ 0)
(h : padicValRat p q ≤ padicValRat p r)


@[simp]
theorem multiplicity_zero_eq_zero_of_ne_zero (a : α) (ha : a ≠ 0) : multiplicity 0 a = 0

{α : Type u_1}
[MonoidWithZero α]
[DecidableRel fun x x_1 => x ∣ x_1]
(a : α)
(ha : a ≠ 0)


@[simp]
theorem smul_mem_pointwise_smul_iff₀ {a : α} (ha : a ≠ 0) (S : Submonoid M) (x : M) :
    a • x ∈ a • S ↔ x ∈ S

{α : Type u_1}
{M : Type u_3}
[Monoid M]
[GroupWithZero α]
[MulDistribMulAction α M]
{a : α}
(ha : a ≠ 0)
(S : Submonoid M)
(x : M)


/-- A universe-polymorphic version of `EquivFunctor.mapEquiv Option e`. -/
@[simps apply]
def optionCongr (e : α ≃ β) : Option α ≃ Option β

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

∀ (a : Option α), e.optionCongr a = Option.map (⇑e) a


/-- A `dite` whose results do not actually depend on the condition may be reduced to an `ite`. -/
@[simp] theorem dite_eq_ite [Decidable P] : (dite P (fun _ => a) fun _ => b) = ite P a b

∀ {α : Sort u_1} {a b : α} [inst : Decidable P], (if x : P then a else b) = if P then a else b


@[simp]
lemma decompose_symm_algebraMap (r : R) :
    (decompose 𝒜).symm (algebraMap R (⨁ i, 𝒜 i) r) = algebraMap R A r

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[DecidableEq ι]
[AddMonoid ι]
[CommSemiring R]
[Semiring A]
[Algebra R A]
(𝒜 : ι → Submodule R A)
[GradedAlgebra 𝒜]
(r : R)

(DirectSum.decompose 𝒜).symm ((algebraMap R (⨁ (i : ι), ↥(𝒜 i))) r) = (algebraMap R A) r


protected theorem mem_rootsOfUnity {ζ : Mˣ} {n : ℕ+} (h : IsPrimitiveRoot ζ n) :
    ζ ∈ rootsOfUnity n M

{M : Type u_1}
[CommMonoid M]
{ζ : Mˣ}
{n : ℕ+}
(h : IsPrimitiveRoot ζ ↑n)


@[simp] theorem tail?_nil : @tail? α [] = none


theorem isLieAbelian_iff_center_eq_top : IsLieAbelian L ↔ center R L = ⊤

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]

IsLieAbelian L ↔ LieAlgebra.center R L = ⊤


theorem coprime_mul_iff_right : Coprime k (m * n) ↔ Coprime k m ∧ Coprime k n

k.Coprime (m * n) ↔ k.Coprime m ∧ k.Coprime n


theorem ContinuousAt.lowerSemicontinuousAt {f : α → γ} (h : ContinuousAt f x) :
    LowerSemicontinuousAt f x

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{f : α → γ}
(h : ContinuousAt f x)


@[to_additive]
theorem continuous_comp_right (f : ContinuousMonoidHom B C) :
    Continuous fun g : ContinuousMonoidHom A B => f.comp g

{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[Monoid A]
[Monoid B]
[Monoid C]
[TopologicalSpace A]
[TopologicalSpace B]
[TopologicalSpace C]
(f : ContinuousMonoidHom B C)


theorem trans_assoc (e'' : PartialEquiv γ δ) : (e.trans e').trans e'' = e.trans (e'.trans e'')

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(e : PartialEquiv α β)
(e' : PartialEquiv β γ)
(e'' : PartialEquiv γ δ)


@[simp] theorem H0LequivOfIsTrivial_symm_apply [A.IsTrivial] (x : A) :
    (H0LequivOfIsTrivial A).symm x = x

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)
[A.IsTrivial]
(x : CoeSort.coe A)

↑((groupCohomology.H0LequivOfIsTrivial A).symm x) = x


@[reassoc (attr := simp)]
lemma biprodXIso_hom_fst (i : ι) :
    (biprodXIso K L i).hom ≫ biprod.fst = (biprod.fst : K ⊞ L ⟶ K).f i

[∀ (i : ι), CategoryTheory.Limits.HasBinaryBiproduct (K.X i) (L.X i)]

(K.biprodXIso L i).hom ≫ CategoryTheory.Limits.biprod.fst = CategoryTheory.Limits.biprod.fst.f i


theorem inter_le_ndinter (s t : Multiset α) : s ∩ t ≤ ndinter s t

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


@[simp]
theorem closure_eq {K L : PointedCone 𝕜 E} : K.closure = L ↔ closure (K : Set E) = L

{𝕜 : Type u_1}
[OrderedSemiring 𝕜]
{E : Type u_2}
[AddCommMonoid E]
[TopologicalSpace E]
[ContinuousAdd E]
[Module 𝕜 E]
[ContinuousConstSMul 𝕜 E]
{K L : PointedCone 𝕜 E}


/-- **Cauchy integral formula** for the value at the center of a disc. If `f : ℂ → E` is continuous
on a closed disc of radius `R` and is complex differentiable at all but countably many points of its
interior, then the integral $\oint_{|z-c|=R} \frac{f(z)}{z-c}\,dz$ is equal to `2πiy`. -/
theorem circleIntegral_sub_center_inv_smul_of_differentiable_on_off_countable {R : ℝ} (h0 : 0 < R)
    {f : ℂ → E} {c : ℂ} {s : Set ℂ} (hs : s.Countable) (hc : ContinuousOn f (closedBall c R))
    (hd : ∀ z ∈ ball c R \ s, DifferentiableAt ℂ f z) :
    (∮ z in C(c, R), (z - c)⁻¹ • f z) = (2 * π * I : ℂ) • f c

(hc : ContinuousOn f (Metric.closedBall c R))

(hd : ∀ z ∈ Metric.ball c R \ s, DifferentiableAt ℂ f z)

(∮ (z : ℂ) in C(c, R), (z - c)⁻¹ • f z) = (2 * ↑π * Complex.I) • f c


/-- `TwoUniqueProd` is preserved under multiplicative equivalences. -/
@[to_additive "`TwoUniqueSums` is preserved under additive equivalences."]
theorem _root_.MulEquiv.twoUniqueProds_iff (f : G ≃* H) : TwoUniqueProds G ↔ TwoUniqueProds H

{G : Type u}
{H : Type v}
[Mul G]
[Mul H]
(f : G ≃* H)


@[simp]
theorem sup_apply [∀ i, Sup (α' i)] (f g : ∀ i, α' i) (i : ι) : (f ⊔ g) i = f i ⊔ g i

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


theorem hasIntegral_zero : HasIntegral I l (fun _ => (0 : E)) vol 0

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}

BoxIntegral.HasIntegral I l (fun x => 0) vol 0


lemma strictConcaveOn_sqrt : StrictConcaveOn ℝ≥0 univ NNReal.sqrt

StrictConcaveOn NNReal Set.univ ⇑NNReal.sqrt


nonrec theorem IsLocalExtr.comp_antitone (hf : IsLocalExtr f a) {g : β → γ} (hg : Antitone g) :
    IsLocalExtr (g ∘ f) a

{α : Type u}
{β : Type v}
{γ : Type w}
[TopologicalSpace α]
[Preorder β]
[Preorder γ]
{f : α → β}
{a : α}
(hf : IsLocalExtr f a)
{g : β → γ}
(hg : Antitone g)


/-- The category of R-modules has all limits. -/
lemma hasLimitsOfSize [UnivLE.{v, w}] : HasLimitsOfSize.{t, v} (ModuleCat.{w} R)

CategoryTheory.Limits.HasLimitsOfSize.{t, v, w, max (w + 1) u} (ModuleCat R)


@[to_additive]
theorem prod_filter_mul_prod_filter_not (p) [DecidablePred p] :
    (s.filter p).prod * (s.filter (fun a ↦ ¬ p a)).prod = s.prod

{α : Type u_3}
[CommMonoid α]
{s : Multiset α}
(p : α → Prop)
[DecidablePred p]

(Multiset.filter p s).prod * (Multiset.filter (fun a => ¬p a) s).prod = s.prod


theorem PosDef.nonneg {Q : QuadraticMap R₂ M N} (hQ : PosDef Q) (x : M) : 0 ≤ Q x

{M : Type u_4}
{N : Type u_5}
{R₂ : Type u}
[CommSemiring R₂]
[AddCommMonoid M]
[Module R₂ M]
[PartialOrder N]
[AddCommMonoid N]
[Module R₂ N]
{Q : QuadraticMap R₂ M N}
(hQ : Q.PosDef)
(x : M)


/-- If two ring homomorphisms from `MonoidAlgebra k G` are equal on all `single a 1`
and `single 1 b`, then they are equal.

See note [partially-applied ext lemmas]. -/
@[ext high]
theorem ringHom_ext' {R} [Semiring k] [MulOneClass G] [Semiring R] {f g : MonoidAlgebra k G →+* R}
    (h₁ : f.comp singleOneRingHom = g.comp singleOneRingHom)
    (h_of :
      (f : MonoidAlgebra k G →* R).comp (of k G) = (g : MonoidAlgebra k G →* R).comp (of k G)) :
    f = g

(h₁ : f.comp MonoidAlgebra.singleOneRingHom = g.comp MonoidAlgebra.singleOneRingHom)

(h_of : (↑f).comp (MonoidAlgebra.of k G) = (↑g).comp (MonoidAlgebra.of k G))


/-- The chain rule. -/
nonrec theorem HasDerivAt.scomp (hg : HasDerivAt g₁ g₁' (h x)) (hh : HasDerivAt h h' x) :
    HasDerivAt (g₁ ∘ h) (h' • g₁') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(x : 𝕜)
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{h : 𝕜 → 𝕜'}
{h' : 𝕜'}
{g₁ : 𝕜' → F}
{g₁' : F}
(hg : HasDerivAt g₁ g₁' (h x))
(hh : HasDerivAt h h' x)


/-- If `[x -[ℝ] x + y] ⊆ s`, then `y` belongs to the positive tangnet cone of `s`.

Before 2024-07-13, this lemma used to be called `mem_posTangentConeAt_of_segment_subset`.
See also `sub_mem_posTangentConeAt_of_segment_subset`
for the lemma that used to be called `mem_posTangentConeAt_of_segment_subset`. -/
theorem mem_posTangentConeAt_of_segment_subset (h : [x -[ℝ] x + y] ⊆ s) :
    y ∈ posTangentConeAt s x

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{s : Set E}
{x y : E}
(h : [x-[ℝ]x + y] ⊆ s)


/-- The Čech conerve associated to an arrow. -/
@[simps]
def cechConerve : CosimplicialObject C

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePushout f.left (fun x => f.right) fun x => f.hom]

f.cechConerve.map g =
  CategoryTheory.Limits.WidePushout.desc (CategoryTheory.Limits.WidePushout.head fun x => f.hom)
    (fun i => CategoryTheory.Limits.WidePushout.ι (fun x => f.hom) ((SimplexCategory.Hom.toOrderHom g) i)) ⋯


lemma scalarRTensor_apply_X_tmul_apply (s : σ) (n : N) (d : σ →₀ ℕ) :
    scalarRTensor (X s ⊗ₜ[R] n) d = if Finsupp.single s 1 = d then n else 0

{R : Type u}
{N : Type w}
[CommSemiring R]
{σ : Type u_1}
[DecidableEq σ]
[AddCommMonoid N]
[Module R N]
(s : σ)
(n : N)
(d : σ →₀ ℕ)

(MvPolynomial.scalarRTensor (MvPolynomial.X s ⊗ₜ[R] n)) d = if Finsupp.single s 1 = d then n else 0


theorem factor_dvd_of_degree_ne_zero {f : K[X]} (hf : f.degree ≠ 0) : factor f ∣ f

{K : Type v}
[Field K]
{f : K[X]}
(hf : f.degree ≠ 0)


theorem iSup_eq_of_tendsto {α β} [TopologicalSpace α] [CompleteLinearOrder α] [OrderTopology α]
    [Nonempty β] [SemilatticeSup β] {f : β → α} {a : α} (hf : Monotone f) :
    Tendsto f atTop (𝓝 a) → iSup f = a

{α : Type u_3}
{β : Type u_4}
[TopologicalSpace α]
[CompleteLinearOrder α]
[OrderTopology α]
[Nonempty β]
[SemilatticeSup β]
{f : β → α}
{a : α}
(hf : Monotone f)

Filter.Tendsto f Filter.atTop (𝓝 a) → iSup f = a


theorem prod_map_right (f : β → γ) (F : Filter α) (G : Filter β) :
    F ×ˢ map f G = map (Prod.map id f) (F ×ˢ G)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : β → γ)
(F : Filter α)
(G : Filter β)

F ×ˢ Filter.map f G = Filter.map (Prod.map id f) (F ×ˢ G)


theorem mono_right {t'} (h' : IsMetricSeparated s t') (ht : t ⊆ t') : IsMetricSeparated s t

{X : Type u_1}
[EMetricSpace X]
{s t t' : Set X}
(h' : IsMetricSeparated s t')
(ht : t ⊆ t')


/-- We verify that an enriched functor between `Type v` enriched categories
is just the same thing as an honest functor.
-/
@[simps]
def enrichedFunctorTypeEquivFunctor {C : Type u₁} [𝒞 : EnrichedCategory (Type v) C] {D : Type u₂}
    [𝒟 : EnrichedCategory (Type v) D] : EnrichedFunctor (Type v) C D ≃ C ⥤ D

[𝒞 : CategoryTheory.EnrichedCategory (Type v) C]

[𝒟 : CategoryTheory.EnrichedCategory (Type v) D]

(F : CategoryTheory.EnrichedFunctor (Type v) C D)

∀ {X Y : C} (f : X ⟶ Y), (CategoryTheory.enrichedFunctorTypeEquivFunctor F).map f = F.map X Y f


theorem mem_join_of_mem (lL : l ∈ L) (al : a ∈ l) : a ∈ join L

∀ {α : Type u_1} {l : List α} {L : List (List α)} {a : α}, l ∈ L → a ∈ l → a ∈ L.join


theorem mk_eq_mk_iff {p q : α × α} : Sym2.mk p = Sym2.mk q ↔ p = q ∨ p = q.swap


lemma hasSmallLocalizedHom_of_hasSmallLocalizedShiftedHom₀ :
    HasSmallLocalizedHom.{w} W X Y

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M X Y]

CategoryTheory.Localization.HasSmallLocalizedHom W X Y


theorem inducing_iff_nhds : Inducing f ↔ ∀ x, 𝓝 x = comap f (𝓝 (f x))

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

Inducing f ↔ ∀ (x : X), 𝓝 x = Filter.comap f (𝓝 (f x))


theorem append_mem_append [Append α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
    ma ++ mb ∈ a ++ b

{α : Type u_1}
[Append α]
(a b : Part α)
(ma mb : α)
(ha : ma ∈ a)
(hb : mb ∈ b)


/-- The spectrum of a Hermitian matrix `A` coincides with the spectrum of `toEuclideanLin A`. -/
theorem spectrum_toEuclideanLin : spectrum 𝕜 (toEuclideanLin A) = spectrum 𝕜 A

{𝕜 : Type u_1}
[RCLike 𝕜]
{n : Type u_2}
[Fintype n]
{A : Matrix n n 𝕜}
[DecidableEq n]

spectrum 𝕜 (Matrix.toEuclideanLin A) = spectrum 𝕜 A


theorem mk'_mk_eq_div {r s} (hs : s ∈ nonZeroDivisors A) :
    mk' K r ⟨s, hs⟩ = algebraMap A K r / algebraMap A K s

{A : Type u_4}
[CommRing A]
[IsDomain A]
{K : Type u_5}
[Field K]
[Algebra A K]
[IsFractionRing A K]
{r s : A}
(hs : s ∈ nonZeroDivisors A)

IsLocalization.mk' K r ⟨s, hs⟩ = (algebraMap A K) r / (algebraMap A K) s


@[simp]
theorem mem_rootsOfUnity_prime_pow_mul_iff' (p k : ℕ) (m : ℕ+) [ExpChar R p]
    {ζ : Rˣ} : ζ ^ (p ^ k * ↑m) = 1 ↔ ζ ∈ rootsOfUnity m R

(R : Type u_4)
[CommRing R]
[IsReduced R]
(p k : ℕ)
(m : ℕ+)
[ExpChar R p]
{ζ : Rˣ}


theorem ContDiffAt.csinh {n} (hf : ContDiffAt ℂ n f x) :
    ContDiffAt ℂ n (fun x => Complex.sinh (f x)) x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
{n : ℕ∞}
(hf : ContDiffAt ℂ n f x)


/-- The extension of `Γ₀ : ChainComplex C ℕ ⥤ SimplicialObject C`
on the idempotent completions. It shall be an equivalence of categories
for any additive category `C`. -/
@[simps!]
def Γ₂ : Karoubi (ChainComplex C ℕ) ⥤ Karoubi (SimplicialObject C)

∀ {X Y : CategoryTheory.Idempotents.Karoubi (ChainComplex C ℕ)} (f : X ⟶ Y) (Δ : SimplexCategoryᵒᵖ),
  (AlgebraicTopology.DoldKan.Γ₂.map f).f.app Δ =
    (AlgebraicTopology.DoldKan.Γ₀.splitting X.X).desc Δ fun A =>
      f.f.f (Opposite.unop A.fst).len ≫ ((AlgebraicTopology.DoldKan.Γ₀.splitting Y.X).cofan Δ).inj A


@[simp]
protected theorem inv_one : (1 : tsze R M)⁻¹ = (1 : tsze R M)

{R : Type u}
{M : Type v}
[DivisionSemiring R]
[AddCommGroup M]
[Module Rᵐᵒᵖ M]
[Module R M]


@[fun_prop]
theorem hasFDerivAt_multiset_prod [DecidableEq ι] [Fintype ι] {u : Multiset ι} {x : ι → 𝔸'} :
    HasFDerivAt (𝕜 := 𝕜) (fun x ↦ (u.map x).prod)
      (Multiset.sum (u.map (fun i ↦ ((u.erase i).map x).prod • proj i))) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{ι : Type u_6}
{𝔸' : Type u_8}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
[DecidableEq ι]
[Fintype ι]
{u : Multiset ι}
{x : ι → 𝔸'}

HasFDerivAt (fun x => (Multiset.map x u).prod)
  (Multiset.map (fun i => (Multiset.map x (u.erase i)).prod • ContinuousLinearMap.proj i) u).sum x


@[to_additive (attr := simp)]
theorem mul_singleton : s * {b} = (· * b) '' s

{α : Type u_2}
[Add α]
{s : Set α}
{b : α}


theorem comp_sub_right (hf : IntervalIntegrable f volume a b) (c : ℝ) :
    IntervalIntegrable (fun x => f (x - c)) volume (a + c) (b + c)

(hf : IntervalIntegrable f MeasureTheory.volume a b)

IntervalIntegrable (fun x => f (x - c)) MeasureTheory.volume (a + c) (b + c)


/--
Monoid objects in `C` are "just" lax monoidal functors from the trivial monoidal category to `C`.
-/
@[simps]
def equivLaxMonoidalFunctorPUnit : LaxMonoidalFunctor (Discrete PUnit.{u + 1}) C ≌ Mon_ C

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

(Mon_.equivLaxMonoidalFunctorPUnit C).functor = Mon_.EquivLaxMonoidalFunctorPUnit.laxMonoidalToMon C


theorem hnot_le_iff_codisjoint_right : ￢a ≤ b ↔ Codisjoint a b

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


theorem boundary (f : Ω^ N X x) : ∀ y ∈ Cube.boundary N, f y = x

{N : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{x : X}
(f : ↑(Ω^ N X x))
(y : N → ↑I)


/-- The Yoneda embedding for preadditive categories sends an object `X` to the copresheaf sending an
object `Y` to the `End X`-module of morphisms `X ⟶ Y`.
-/
@[simps]
def preadditiveCoyonedaObj (X : Cᵒᵖ) : C ⥤ ModuleCat.{v} (End X)

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

∀ {X_1 Y : C} (f : X_1 ⟶ Y),
  (CategoryTheory.preadditiveCoyonedaObj X).map f =
    ModuleCat.ofHom { toFun := fun g => CategoryTheory.CategoryStruct.comp g f, map_add' := ⋯, map_smul' := ⋯ }


theorem mul_self_ne_zero : a * a ≠ 0 ↔ a ≠ 0

{M₀ : Type u_1}
[MulZeroClass M₀]
[NoZeroDivisors M₀]
{a : M₀}


@[simp]
theorem nhds_false : 𝓝 False = ⊤


/-- See also `Filter.blimsup_or_eq_sup`. -/
-- @[simp] -- Porting note: simp_nf linter, lhs simplifies, added _aux simp versions below
theorem blimsup_sup_le_or : blimsup u f p ⊔ blimsup u f q ≤ blimsup u f fun x => p x ∨ q x

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

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


lemma yonedaEquiv_presheafHom_yoneda_obj (X : C) :
    yonedaEquiv (presheafHom φ (yoneda.obj X)) =
      ((φ.app X).app (F.op.obj (Opposite.op X)) (𝟙 _))

{G : CategoryTheory.Functor (CategoryTheory.Functor Cᵒᵖ (Type v₁)) (CategoryTheory.Functor Dᵒᵖ (Type v₁))}

(φ : F.comp CategoryTheory.yoneda ⟶ CategoryTheory.yoneda.comp G)

CategoryTheory.yonedaEquiv
    (CategoryTheory.Presheaf.compYonedaIsoYonedaCompLan.presheafHom φ (CategoryTheory.yoneda.obj X)) =
  (φ.app X).app (F.op.obj (Opposite.op X)) (CategoryTheory.CategoryStruct.id (Opposite.unop (F.op.obj (Opposite.op X))))


@[to_additive]
lemma smul_iterate_apply [MulAction G H] {b : H} : (a • ·)^[n] b = a ^ n • b

{G : Type u_3}
{H : Type u_4}
[AddMonoid G]
(a : G)
(n : ℕ)
[AddAction G H]
{b : H}


theorem Nodup.mem_diff_iff [DecidableEq α] (hl₁ : l₁.Nodup) : a ∈ l₁.diff l₂ ↔ a ∈ l₁ ∧ a ∉ l₂

{α : Type u}
{l₁ l₂ : List α}
{a : α}
[DecidableEq α]
(hl₁ : l₁.Nodup)


@[to_additive (attr := simp)]
theorem noncommProd_cons (s : Multiset α) (a : α) (comm) :
    noncommProd (a ::ₘ s) comm = a * noncommProd s (comm.mono fun _ => mem_cons_of_mem)

(comm : {x | x ∈ a ::ₘ s}.Pairwise AddCommute)

(a ::ₘ s).noncommSum comm = a + s.noncommSum ⋯


/-- In a separable space, a family of disjoint sets with nonempty interiors is countable. -/
theorem _root_.Set.PairwiseDisjoint.countable_of_nonempty_interior [SeparableSpace α] {ι : Type*}
    {s : ι → Set α} {a : Set ι} (h : a.PairwiseDisjoint s)
    (ha : ∀ i ∈ a, (interior (s i)).Nonempty) : a.Countable


@[simp]
theorem mapRange_zero {f : M → N} {hf : f 0 = 0} : mapRange f hf (0 : α →₀ M) = 0

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
[Zero N]
{f : M → N}
{hf : f 0 = 0}


theorem exists_mem_multiset_map_dvd (hp : Prime p) {s : Multiset β} {f : β → α} :
    p ∣ (s.map f).prod → ∃ a ∈ s, p ∣ f a

{α : Type u_1}
{β : Type u_2}
[CommMonoidWithZero α]
{p : α}
(hp : Prime p)
{s : Multiset β}
{f : β → α}

p ∣ (Multiset.map f s).prod → ∃ a ∈ s, p ∣ f a


theorem Prime.neg {p : α} (hp : Prime p) : Prime (-p)

{α : Type u_1}
[CommRing α]
{p : α}
(hp : Prime p)


@[simp]
theorem self_comp_symm_toHom (f : M ≃[L] N) :
    f.toHom.comp f.symm.toHom = Hom.id L N

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(f : L.Equiv M N)

f.toHom.comp f.symm.toHom = FirstOrder.Language.Hom.id L N


@[simp] theorem Name.str.sizeOf_spec (p : Name) (s : String) : sizeOf (str p s) = 1 + sizeOf p + sizeOf s

sizeOf (p.str s) = 1 + sizeOf p + sizeOf s


theorem monic_prod_of_monic (s : Finset ι) (f : ι → R[X]) (hs : ∀ i ∈ s, Monic (f i)) :
    Monic (∏ i ∈ s, f i)

{R : Type u}
{ι : Type y}
[CommSemiring R]
(s : Finset ι)
(f : ι → R[X])
(hs : ∀ i ∈ s, (f i).Monic)


@[simp]
theorem not_nonempty_empty : ¬ZFSet.Nonempty ∅


lemma one_mem_posTangentConeAt_iff_frequently :
    1 ∈ posTangentConeAt s a ↔ ∃ᶠ x in 𝓝[>] a, x ∈ s

1 ∈ posTangentConeAt s a ↔ ∃ᶠ (x : ℝ) in 𝓝[>] a, x ∈ s


theorem rank_closureCommutatorRepresentatives_le [Finite (commutatorSet G)] :
    Group.rank (closureCommutatorRepresentatives G) ≤ 2 * Nat.card (commutatorSet G)

(G : Type u)
[Group G]
[Finite ↑(commutatorSet G)]

Group.rank ↥(closureCommutatorRepresentatives G) ≤ 2 * Nat.card ↑(commutatorSet G)


theorem finset_inf_span_singleton {ι : Type*} (s : Finset ι) (I : ι → R)
    (hI : Set.Pairwise (↑s) (IsCoprime on I)) :
    (s.inf fun i => Ideal.span ({I i} : Set R)) = Ideal.span {∏ i ∈ s, I i}

{R : Type u}
[CommSemiring R]
{ι : Type u_2}
(s : Finset ι)
(I : ι → R)
(hI : (↑s).Pairwise (IsCoprime on I))

(s.inf fun i => Ideal.span {I i}) = Ideal.span {∏ i ∈ s, I i}


theorem length_filter_lt_length_iff_exists (l) :
    length (filter p l) < length l ↔ ∃ x ∈ l, ¬p x

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

(List.filter p l).length < l.length ↔ ∃ x, x ∈ l ∧ ¬p x = true


lemma ofCauchy_ratCast (q : ℚ) : (⟨q⟩ : ℝ) = q


@[simp]
theorem arg_neg_I : arg (-I) = -(π / 2)


theorem map_finset_sup [DecidableEq α] [DecidableEq β] (s : Finset γ) (f : γ → Multiset β)
    (g : β → α) (hg : Function.Injective g) : map g (s.sup f) = s.sup (map g ∘ f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[DecidableEq α]
[DecidableEq β]
(s : Finset γ)
(f : γ → Multiset β)
(g : β → α)
(hg : Function.Injective g)

Multiset.map g (s.sup f) = s.sup (Multiset.map g ∘ f)


@[local simp]
theorem map_enumFrom_eq_zipWith : ∀ (l : List α) (n : ℕ) (f : ℕ → α → β),
    map (uncurry f) (enumFrom n l) = zipWith (fun i ↦ f (i + n)) (range (length l)) l

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

List.map (Function.uncurry f) (List.enumFrom n l) = List.zipWith (fun i => f (i + n)) (List.range l.length) l


/-- The isomorphism between `incl ⋙ lift F _ _` with `F`. -/
@[simps!]
def inclLift {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, F.obj x ⟶ Z)
    (hM : ∀ (x y : C) (f : x ⟶ y), F.map f ≫ M y = M x) : incl ⋙ lift F M hM ≅ F

(hM : ∀ (x y : C) (f : x ⟶ y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x)

(CategoryTheory.WithTerminal.inclLift F M hM).hom.app X =
  CategoryTheory.CategoryStruct.id
    (match CategoryTheory.WithTerminal.incl.obj X with
    | CategoryTheory.WithTerminal.of x => F.obj x
    | CategoryTheory.WithTerminal.star => Z)


@[reassoc] lemma comp_τ₃ (φ₁₂ : S₁ ⟶ S₂) (φ₂₃ : S₂ ⟶ S₃) :
    (φ₁₂ ≫ φ₂₃).τ₃ = φ₁₂.τ₃ ≫ φ₂₃.τ₃

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

(φ₁₂ : S₁ ⟶ S₂)

(φ₂₃ : S₂ ⟶ S₃)

(CategoryTheory.CategoryStruct.comp φ₁₂ φ₂₃).τ₃ = CategoryTheory.CategoryStruct.comp φ₁₂.τ₃ φ₂₃.τ₃


theorem IsPath.length_lt [Fintype V] {u v : V} {p : G.Walk u v} (hp : p.IsPath) :
    p.length < Fintype.card V

{V : Type u}
{G : SimpleGraph V}
[Fintype V]
{u v : V}
{p : G.Walk u v}
(hp : p.IsPath)


theorem foldrM_push [Monad m] (f : α → β → m β) (init : β) (arr : Array α) (a : α) :
    (arr.push a).foldrM f init = f a init >>= arr.foldrM f

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(f : α → β → m β)
(init : β)
(arr : Array α)
(a : α)

Array.foldrM f init (arr.push a) (arr.push a).size = do
  let init ← f a init
  Array.foldrM f init arr arr.size


/-- The natural functor from `Fintype` to `LightProfinite`, endowing a finite type with the
discrete topology. -/
@[simps!]
def FintypeCat.toLightProfinite : FintypeCat ⥤ LightProfinite

∀ {X Y : FintypeCat} (f : X ⟶ Y) (a : ↑X), (FintypeCat.toLightProfinite.map f) a = f a


/-- `n + 1` points are affinely independent if and only if their
`vectorSpan` has dimension at least `n`. -/
theorem affineIndependent_iff_le_finrank_vectorSpan [Fintype ι] (p : ι → P) {n : ℕ}
    (hc : Fintype.card ι = n + 1) :
    AffineIndependent k p ↔ n ≤ finrank k (vectorSpan k (Set.range p))

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
{ι : Type u_4}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[Fintype ι]
(p : ι → P)
{n : ℕ}
(hc : Fintype.card ι = n + 1)

AffineIndependent k p ↔ n ≤ FiniteDimensional.finrank k ↥(vectorSpan k (Set.range p))


@[simp]
theorem realize_not : φ.not.Realize v xs ↔ ¬φ.Realize v xs

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{l : ℕ}
{φ : L.BoundedFormula α l}
{v : α → M}
{xs : Fin l → M}


theorem finrank_eq_zero_of_not_exists_basis_finite
    (h : ¬∃ (s : Set M) (_ : Basis.{v} (s : Set M) R M), s.Finite) : finrank R M = 0

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
(h : ¬∃ s x, s.Finite)


@[simp]
theorem neLocus_self_add_right : neLocus f (f + g) = g.support

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f g : α →₀ N)


lemma IsOfFinOrder.isUnit {M} [Monoid M] {x : M} (hx : IsOfFinOrder x) : IsUnit x

{M : Type u_6}
[Monoid M]
{x : M}
(hx : IsOfFinOrder x)


/-- If `F : C ⥤ D` is a triangulated functor from a triangulated category, then `D`
is also triangulated if tuples of composables arrows in `D` can be lifted to `C`. -/
lemma isTriangulated_of_essSurj_mapComposableArrows_two
    (F : C ⥤ D) [F.CommShift ℤ] [F.IsTriangulated]
    [(F.mapComposableArrows 2).EssSurj] [IsTriangulated C] :
    IsTriangulated D

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

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


theorem card_filter_univ_succ (p : Fin (n + 1) → Prop) [DecidablePred p] :
    (univ.filter p).card =
    if p 0 then (univ.filter (p ∘ Fin.succ)).card + 1 else (univ.filter (p ∘ Fin.succ)).card

{n : ℕ}
(p : Fin (n + 1) → Prop)
[DecidablePred p]

(Finset.filter p Finset.univ).card =
  if p 0 then (Finset.filter (p ∘ Fin.succ) Finset.univ).card + 1 else (Finset.filter (p ∘ Fin.succ) Finset.univ).card


protected theorem injective [DivisionRing α] [Semiring β] [Nontrivial β] (f : α →+* β) :
    Injective f

{α : Type u_1}
{β : Type u_2}
[DivisionRing α]
[Semiring β]
[Nontrivial β]
(f : α →+* β)


/-- Reinterpret a supremum homomorphism as an infimum homomorphism between the dual lattices. -/
@[simps]
protected def dual : SupHom α β ≃ InfHom αᵒᵈ βᵒᵈ

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Sup β]
(f : SupHom α β)
(a : α)


theorem summable_geometric_of_lt_one {r : ℝ} (h₁ : 0 ≤ r) (h₂ : r < 1) :
    Summable fun n : ℕ ↦ r ^ n


theorem epsilon_spec_aux {α : Sort u} (h : Nonempty α) (p : α → Prop) : (∃ y, p y) → p (@epsilon α h p)


@[simp] theorem coprime_one_right_eq_true (n) : Coprime n 1 = True


/-- The Hausdorff distance to the empty set vanishes (if you want to have the more reasonable
value `∞` instead, use `EMetric.hausdorffEdist`, which takes values in `ℝ≥0∞`). -/
@[simp]
theorem hausdorffDist_empty : hausdorffDist s ∅ = 0

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}


@[to_additive (attr := simp)] lemma leOnePart_div_oneLePart (a : α) : a⁻ᵐ / a⁺ᵐ = a⁻¹

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


lemma homologyMap_congr (h : Homotopy φ₁ φ₂) [S₁.HasHomology] [S₂.HasHomology] :
    homologyMap φ₁ = homologyMap φ₂

{φ₁ φ₂ : S₁ ⟶ S₂}

(h : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)

CategoryTheory.ShortComplex.homologyMap φ₁ = CategoryTheory.ShortComplex.homologyMap φ₂


@[to_additive]
theorem prod_range_succ_comm (f : ℕ → β) (n : ℕ) :
    (∏ x ∈ range (n + 1), f x) = f n * ∏ x ∈ range n, f x

{β : Type u_4}
[CommMonoid β]
(f : ℕ → β)
(n : ℕ)

∏ x ∈ Finset.range (n + 1), f x = f n * ∏ x ∈ Finset.range n, f x


@[to_additive]
theorem image_smul_comm [SMul α β] [SMul α γ] (f : β → γ) (a : α) (s : Set β) :
    (∀ b, f (a • b) = a • f b) → f '' (a • s) = a • f '' s

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SMul α β]
[SMul α γ]
(f : β → γ)
(a : α)
(s : Set β)

(∀ (b : β), f (a • b) = a • f b) → f '' (a • s) = a • f '' s


/-- Given a map f from α to β, the natural map from the quotient of α by the kernel of f is
    injective. -/
theorem ker_lift_injective (f : α → β) : Injective (@Quotient.lift _ _ (ker f) f fun _ _ h => h)

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


lemma rel_or : ((·↔·) ⇒ (·↔·) ⇒ (·↔·)) (·∨·) (·∨·)

((fun x x_1 => x ↔ x_1) ⇒ (fun x x_1 => x ↔ x_1) ⇒ fun x x_1 => x ↔ x_1) (fun x x_1 => x ∨ x_1) fun x x_1 => x ∨ x_1


lemma isRightKanExtension_iff_postcomp₁ (α : L' ⋙ F' ⟶ F) :
    F'.IsRightKanExtension α ↔ (G ⋙ F').IsRightKanExtension
      ((Functor.associator _ _ _).inv ≫ whiskerRight e.hom F' ≫ α)

{C : Type u_1}
{H : Type u_3}
{D : Type u_5}
{D' : Type u_6}
[CategoryTheory.Category.{u_8, u_1} C]
[CategoryTheory.Category.{u_7, u_3} H]
[CategoryTheory.Category.{u_10, u_5} D]
[CategoryTheory.Category.{u_9, u_6} D']
{L : CategoryTheory.Functor C D}
{L' : CategoryTheory.Functor C D'}
(G : CategoryTheory.Functor D D')
[G.IsEquivalence]
(e : L.comp G ≅ L')
{F : CategoryTheory.Functor C H}
{F' : CategoryTheory.Functor D' H}
(α : L'.comp F' ⟶ F)

F'.IsRightKanExtension α ↔
  (G.comp F').IsRightKanExtension
    (CategoryTheory.CategoryStruct.comp (L.associator G F').inv
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerRight e.hom F') α))


@[simp]
theorem bliminf_or_le_inf_aux_left : (bliminf u f fun x => p x ∨ q x) ≤ bliminf u f p

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

(Filter.bliminf u f fun x => p x ∨ q x) ≤ Filter.bliminf u f p


theorem swap_iInf [InfSet α] [InfSet β] (f : ι → α × β) : (iInf f).swap = ⨅ i, (f i).swap

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[InfSet α]
[InfSet β]
(f : ι → α × β)


/-- We can upgrade `e.inverse` to a monoidal functor from `D` with the transported structure to `C`.
-/
@[simps!]
def fromTransported (e : C ≌ D) : MonoidalFunctor (Transported e) C

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

(CategoryTheory.Monoidal.fromTransported e).ε = e.unitIso.hom.app (𝟙_ C)


theorem eval_dvd : p ∣ q → eval x p ∣ eval x q

{R : Type u}
[CommSemiring R]
{p q : R[X]}
{x : R}

p ∣ q → Polynomial.eval x p ∣ Polynomial.eval x q


theorem sub_mem_sub (ha : a ∈ s) (hb : b ∈ t) : a - b ∈ s - t


@[simp]
theorem prod_fst_snd : prod (fst R A B) (snd R A B) = 1

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Star A]
[Semiring B]
[Algebra R B]
[Star B]

(StarAlgHom.fst R A B).prod (StarAlgHom.snd R A B) = 1


@[simp]
theorem smul_toOuterMeasure {_m : MeasurableSpace α} (c : R) (μ : Measure α) :
    (c • μ).toOuterMeasure = c • μ.toOuterMeasure

{α : Type u_1}
{R : Type u_6}
[SMul R ENNReal]
[IsScalarTower R ENNReal ENNReal]
{_m : MeasurableSpace α}
(c : R)
(μ : MeasureTheory.Measure α)


@[to_additive (attr := norm_cast, simp)]
theorem coe_finset_prod {ι M} [CommMonoid M] (S : Submonoid M) (f : ι → S) (s : Finset ι) :
    ↑(∏ i ∈ s, f i) = (∏ i ∈ s, f i : M)

{ι : Type u_4}
{M : Type u_5}
[CommMonoid M]
(S : Submonoid M)
(f : ι → ↥S)
(s : Finset ι)


theorem basicOpen_basicOpen_is_basicOpen (g : Γ(X, X.basicOpen f)) :
    ∃ f' : Γ(X, U), X.basicOpen f' = X.basicOpen g

(g : ↑(X.presheaf.obj (Opposite.op (X.basicOpen f))))


/-- The sum over the values of the quadratic character is zero when the characteristic is odd. -/
theorem quadraticChar_sum_zero (hF : ringChar F ≠ 2) : ∑ a : F, quadraticChar F a = 0

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


@[to_additive (attr := gcongr) add_le_add_right]
theorem mul_le_mul_right' [i : CovariantClass α α (swap (· * ·)) (· ≤ ·)] {b c : α} (bc : b ≤ c)
    (a : α) :
    b * a ≤ c * a

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


lemma HasLineDerivWithinAt.lineDifferentiableWithinAt (hf : HasLineDerivWithinAt 𝕜 f f' s x v) :
    LineDifferentiableWithinAt 𝕜 f s x v


/-- The choice of `d` in `Ideal.exists_mul_add_mem_pow_succ` is unique, up to `P`.
Inspired by [Neukirch], proposition 6.1 -/
theorem Ideal.mul_add_mem_pow_succ_unique [IsDedekindDomain S] {i : ℕ} (a d d' e e' : S)
    (a_not_mem : a ∉ P ^ (i + 1)) (e_mem : e ∈ P ^ (i + 1)) (e'_mem : e' ∈ P ^ (i + 1))
    (h : a * d + e - (a * d' + e') ∈ P ^ (i + 1)) : d - d' ∈ P


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


@[simp] theorem size_pop (a : Array α) : a.pop.size = a.size - 1


@[simp]
theorem prod_empty : prod (empty : Word M) = 1

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]


theorem mod_add_div (a b : R) : a % b + b * (a / b) = a

{R : Type u}
[EuclideanDomain R]
(a b : R)


/-- A filter equals the intersection of all the ultrafilters which contain it. -/
theorem iSup_ultrafilter_le_eq (f : Filter α) :
    ⨆ (g : Ultrafilter α) (_ : g ≤ f), (g : Filter α) = f


theorem inter (hs : ClosedUnder f s) (ht : ClosedUnder f t) : ClosedUnder f (s ∩ t)

(hs : FirstOrder.Language.ClosedUnder f s)

(ht : FirstOrder.Language.ClosedUnder f t)

FirstOrder.Language.ClosedUnder f (s ∩ t)


/-- Given an integrable function `f` with values in `ℝ≥0` in a sigma-finite space, there exists a
lower semicontinuous function `g > f` with integral arbitrarily close to that of `f`.
Formulation in terms of `integral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem exists_lt_lowerSemicontinuous_integral_gt_nnreal [SigmaFinite μ] (f : α → ℝ≥0)
    (fint : Integrable (fun x => (f x : ℝ)) μ) {ε : ℝ} (εpos : 0 < ε) :
    ∃ g : α → ℝ≥0∞,
      (∀ x, (f x : ℝ≥0∞) < g x) ∧
      LowerSemicontinuous g ∧
      (∀ᵐ x ∂μ, g x < ⊤) ∧
      Integrable (fun x => (g x).toReal) μ ∧ (∫ x, (g x).toReal ∂μ) < (∫ x, ↑(f x) ∂μ) + ε

(fint : MeasureTheory.Integrable (fun x => ↑(f x)) μ)

∃ g,
  (∀ (x : α), ↑(f x) < g x) ∧
    LowerSemicontinuous g ∧
      (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧
        MeasureTheory.Integrable (fun x => (g x).toReal) μ ∧ ∫ (x : α), (g x).toReal ∂μ < ∫ (x : α), ↑(f x) ∂μ + ε


theorem wbtw_swap_right_iff [NoZeroSMulDivisors R V] (x : P) {y z : P} :
    Wbtw R x y z ∧ Wbtw R x z y ↔ y = z

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


theorem star_mul_star (x y : R) : star (x * star y) = y * star x

{R : Type u}
[Mul R]
[StarMul R]
(x y : R)


theorem fold_cons'_right (b a : α) (s : Multiset α) : (a ::ₘ s).fold op b = s.fold op (b * a)

{α : Type u_1}
(op : α → α → α)
[hc : Std.Commutative op]
[ha : Std.Associative op]
(b a : α)
(s : Multiset α)

Multiset.fold op b (a ::ₘ s) = Multiset.fold op (op b a) s


theorem mul_num (q₁ q₂ : ℚ) :
    (q₁ * q₂).num = q₁.num * q₂.num / Nat.gcd (q₁.num * q₂.num).natAbs (q₁.den * q₂.den)

(q₁ * q₂).num = q₁.num * q₂.num / ↑((q₁.num * q₂.num).natAbs.gcd (q₁.den * q₂.den))


@[simp]
theorem cochainComplex_d_succ_succ_zero (C : CochainComplex V ℕ) (i : ℕ) : C.d 0 (i + 2) = 0


protected theorem lt_succ_iff : m < succ n ↔ m ≤ n


/-- To show continuity of a map `α → C(β, γ)`, it suffices to show that its uncurried form
    `α × β → γ` is continuous. -/
theorem continuous_of_continuous_uncurry (f : X → C(Y, Z))
    (h : Continuous (Function.uncurry fun x y => f x y)) : Continuous f

(h : Continuous (Function.uncurry fun x y => (f x) y))


/--
Check that if each `P ∈ Ps` is a sheaf for `J`, then `J` is a subtopology of `finestTopology Ps`.
-/
theorem le_finestTopology (Ps : Set (Cᵒᵖ ⥤ Type v)) (J : GrothendieckTopology C)
    (hJ : ∀ P ∈ Ps, Presieve.IsSheaf J P) : J ≤ finestTopology Ps

(Ps : Set (CategoryTheory.Functor Cᵒᵖ (Type v)))

(J : CategoryTheory.GrothendieckTopology C)

(hJ : ∀ P ∈ Ps, CategoryTheory.Presieve.IsSheaf J P)

J ≤ CategoryTheory.Sheaf.finestTopology Ps


lemma mul {f g : 𝕜 → 𝕜} {x : 𝕜} (hf : MeromorphicAt f x) (hg : MeromorphicAt g x) :
    MeromorphicAt (f * g) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{f g : 𝕜 → 𝕜}
{x : 𝕜}
(hf : MeromorphicAt f x)
(hg : MeromorphicAt g x)


theorem le_of_opNorm_le {c : ℝ} (h : ‖f‖ ≤ c) (x : E) : ‖f x‖ ≤ c * ‖x‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)
{c : ℝ}
(h : ‖f‖ ≤ c)
(x : E)

‖f x‖ ≤ c * ‖x‖


/-- The limit of `J : SingleObj M ⥤ Type u` is equivalent to the fixed points of the
induced action on `J.obj (SingleObj.star M)`. -/
@[simps!]
noncomputable def Types.limitEquivFixedPoints :
    limit J ≃ MulAction.fixedPoints M (J.obj (SingleObj.star M))

(J : CategoryTheory.Functor (CategoryTheory.SingleObj M) (Type u))

∀ (a : CategoryTheory.Limits.limit J),
  ↑((CategoryTheory.Limits.SingleObj.Types.limitEquivFixedPoints J) a) =
    CategoryTheory.Limits.limit.π J (CategoryTheory.SingleObj.star M) a


@[simp]
theorem ofBoolAlg_bot : ofBoolAlg (⊥ : AsBoolAlg α) = 0


/-- The point of the augmentation. -/
@[simps!]
def point : Augmented C ⥤ C

(X : CategoryTheory.Comma (CategoryTheory.CosimplicialObject.const C) (𝟭 (CategoryTheory.CosimplicialObject C)))

CategoryTheory.CosimplicialObject.Augmented.point.obj X = X.left


@[simp]
theorem nsmul_lie (n : ℕ) : ⁅n • x, m⁆ = n • ⁅x, m⁆

{L : Type v}
{M : Type w}
[LieRing L]
[AddCommGroup M]
[LieRingModule L M]
(x : L)
(m : M)
(n : ℕ)


@[simp]
theorem fst_comp_prod (f : A →A[R] B) (g : A →A[R] C) :
    (fst R B C).comp (f.prod g) = f

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

(ContinuousAlgHom.fst R B C).comp (f.prod g) = f


@[to_additive (attr := elab_as_elim)]
theorem closure_induction_right {s : Set M} {p : (m : M) → m ∈ closure s → Prop}
    (one : p 1 (one_mem _))
    (mul_right : ∀ x hx, ∀ (y) (hy : y ∈ s), p x hx → p (x * y) (mul_mem hx (subset_closure hy)))
    {x : M} (h : x ∈ closure s) : p x h

{p : (m : M) → m ∈ Submonoid.closure s → Prop}

(mul_right : ∀ (x : M) (hx : x ∈ Submonoid.closure s) (y : M) (hy : y ∈ s), p x hx → p (x * y) ⋯)


@[simp]
theorem sumLexAssoc_apply_inr :
    sumLexAssoc α β γ (toLex <| inr c) = toLex (inr <| toLex <| inr c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[LE α]
[LE β]
[LE γ]
(c : γ)

(OrderIso.sumLexAssoc α β γ) (toLex (Sum.inr c)) = toLex (Sum.inr (toLex (Sum.inr c)))


lemma _root_.Function.HasTemperateGrowth.of_fderiv {f : E → F}
    (h'f : Function.HasTemperateGrowth (fderiv ℝ f)) (hf : Differentiable ℝ f) {k : ℕ} {C : ℝ}
    (h : ∀ x, ‖f x‖ ≤ C * (1 + ‖x‖) ^ k) :
    Function.HasTemperateGrowth f

(h : ∀ (x : E), ‖f x‖ ≤ C * (1 + ‖x‖) ^ k)


@[simp]
theorem mem_pi {s : Finset α} {t : ∀ a, Finset (β a)} {f : ∀ a ∈ s, β a} :
    f ∈ s.pi t ↔ ∀ (a) (h : a ∈ s), f a h ∈ t a

{α : Type u_1}
{β : α → Type u}
[DecidableEq α]
{s : Finset α}
{t : (a : α) → Finset (β a)}
{f : (a : α) → a ∈ s → β a}

f ∈ s.pi t ↔ ∀ (a : α) (h : a ∈ s), f a h ∈ t a


@[simp] theorem one_and_eq_mod_two (n : Nat) : 1 &&& n = n % 2


protected theorem nsmul {S : Type*} [AddGroup S] [Mul S] (t : RingCon S)
    (m : ℕ) {x y : S} (hx : t x y) : t (m • x) (m • y)

{S : Type u_3}
[AddGroup S]
[Mul S]
(t : RingCon S)
(m : ℕ)
{x y : S}
(hx : t x y)


/-- A submonoid `S` of an additive monoid `R` is (left) Ore if common summands on the right can be
turned into common summands on the left, and if each pair of `r : R` and `s : S` admits an Ore
minuend `v : R` and an Ore subtrahend `u : S` such that `u + r = v + s`. -/
class AddOreSet {R : Type*} [AddMonoid R] (S : AddSubmonoid R) where
  /-- Common summands on the right can be turned into common summands on the left, a weak form of
cancellability. -/
  ore_right_cancel : ∀ (r₁ r₂ : R) (s : S), r₁ + s = r₂ + s → ∃ s' : S, s' + r₁ = s' + r₂
  /-- The Ore minuend of a difference. -/
  oreMin : R → S → R
  /-- The Ore subtrahend of a difference. -/
  oreSubtra : R → S → S
  /-- The Ore condition of a difference, expressed in terms of `oreMin` and `oreSubtra`. -/
  ore_eq : ∀ (r : R) (s : S), oreSubtra r s + r = oreMin r s + s

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[self : AddOreLocalization.AddOreSet S]
(r₁ r₂ : R)
(s : ↥S)

r₁ + ↑s = r₂ + ↑s → ∃ s', ↑s' + r₁ = ↑s' + r₂


@[to_additive]
theorem oreDiv_eq_iff {r₁ r₂ : X} {s₁ s₂ : S} :
    r₁ /ₒ s₁ = r₂ /ₒ s₂ ↔ ∃ (u : S) (v : R), u • r₂ = v • r₁ ∧ u * s₂ = v * s₁

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
{X : Type u_2}
[AddAction R X]
{r₁ r₂ : X}
{s₁ s₂ : ↥S}

r₁ -ₒ s₁ = r₂ -ₒ s₂ ↔ ∃ u v, u +ᵥ r₂ = v +ᵥ r₁ ∧ ↑u + ↑s₂ = v + ↑s₁


@[simp]
theorem wellFoundedOn_singleton : WellFoundedOn ({a} : Set α) r

{α : Type u_2}
{r : α → α → Prop}
[IsStrictOrder α r]
{a : α}


/-- If a nondegenerate configuration has a unique point on any two lines, then `|L| ≤ |P|`. -/
theorem HasPoints.card_le [HasPoints P L] [Fintype P] [Fintype L] :
    Fintype.card L ≤ Fintype.card P

(P : Type u_1)
(L : Type u_2)
[Membership P L]
[Configuration.HasPoints P L]
[Fintype P]
[Fintype L]


@[to_additive]
theorem HasProd.mul_compl {s : Set β} (ha : HasProd (f ∘ (↑) : s → α) a)
    (hb : HasProd (f ∘ (↑) : (sᶜ : Set β) → α) b) : HasProd f (a * b)

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a b : α}
[ContinuousAdd α]
{s : Set β}
(ha : HasSum (f ∘ Subtype.val) a)
(hb : HasSum (f ∘ Subtype.val) b)


@[simp]
theorem invMonoidHom_apply (a : α) : invMonoidHom a = a⁻¹

{α : Type u_1}
[DivisionCommMonoid α]
(a : α)


theorem linearIndependent_empty : LinearIndependent R (fun x => x : (∅ : Set M) → M)

(R : Type u_2)
(M : Type u_4)
[Semiring R]
[AddCommMonoid M]
[Module R M]


@[simp, deprecated (since := "2023-01-26")]
lemma not_even_bit1 (n : ℤ) : ¬Even (2 * n + 1)


theorem root_gcd_iff_root_left_right [CommSemiring k] [DecidableEq R]
    {ϕ : R →+* k} {f g : R[X]} {α : k} :
    (EuclideanDomain.gcd f g).eval₂ ϕ α = 0 ↔ f.eval₂ ϕ α = 0 ∧ g.eval₂ ϕ α = 0

{R : Type u}
{k : Type y}
[Field R]
[CommSemiring k]
[DecidableEq R]
{ϕ : R →+* k}
{f g : R[X]}
{α : k}

Polynomial.eval₂ ϕ α (EuclideanDomain.gcd f g) = 0 ↔ Polynomial.eval₂ ϕ α f = 0 ∧ Polynomial.eval₂ ϕ α g = 0


/-- `mapMon` is functorial in the lax monoidal functor. -/
@[simps] -- Porting note: added this, not sure how it worked previously without.
def mapMonFunctor : LaxMonoidalFunctor C D ⥤ Mon_ C ⥤ Mon_ D

(F : CategoryTheory.LaxMonoidalFunctor C D)

(CategoryTheory.LaxMonoidalFunctor.mapMonFunctor C D).obj F = F.mapMon


theorem cos_antiperiodic : Function.Antiperiodic cos π


theorem locallyFinite_tsupport : LocallyFinite fun i => tsupport (f i)

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : BumpCovering ι X s)


lemma dblZ_smul (P : Fin 3 → R) (u : R) : W'.dblZ (u • P) = u ^ 4 * W'.dblZ P

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


theorem clog_eq_one {b n : ℕ} (hn : 2 ≤ n) (h : n ≤ b) : clog b n = 1


/-- Convergence along filters for `WithSeminorms`. -/
theorem WithSeminorms.tendsto_nhds (hp : WithSeminorms p) (u : F → E) {f : Filter F} (y₀ : E) :
    Filter.Tendsto u f (𝓝 y₀) ↔ ∀ i ε, 0 < ε → ∀ᶠ x in f, p i (u x - y₀) < ε

{𝕜 : Type u_1}
{E : Type u_5}
{F : Type u_6}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
[TopologicalSpace E]
{p : SeminormFamily 𝕜 E ι}
(hp : WithSeminorms p)
(u : F → E)
{f : Filter F}
(y₀ : E)

Filter.Tendsto u f (𝓝 y₀) ↔ ∀ (i : ι) (ε : ℝ), 0 < ε → ∀ᶠ (x : F) in f, (p i) (u x - y₀) < ε


/-- We can more explicitly show that a category has an initial object by specifying the object,
and showing there is a unique morphism from it to any other object. -/
theorem hasInitial_of_unique (X : C) [h : ∀ Y : C, Unique (X ⟶ Y)] : HasInitial C

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


theorem exists_basis_subset_basis (M : Matroid α) (hXY : X ⊆ Y) (hY : Y ⊆ M.E := by aesop_mat) :
    ∃ I J, M.Basis I X ∧ M.Basis J Y ∧ I ⊆ J

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


theorem ae_eq_set_compl {s t : Set α} : sᶜ =ᵐ[μ] t ↔ s =ᵐ[μ] tᶜ

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


theorem insert_mem_nhdsWithin_insert {a : α} {s t : Set α} (h : t ∈ 𝓝[s] a) :
    insert a t ∈ 𝓝[insert a s] a

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


@[to_additive (attr := simp)]
lemma forget_map {X Y : CommGrp} (f : X ⟶ Y) :
    (forget CommGrp).map f = (f : X → Y)

(CategoryTheory.forget AddCommGrp).map f = ⇑f


theorem exists_duplicate_iff_not_nodup : (∃ x : α, x ∈+ l) ↔ ¬Nodup l


theorem tail {n f} (hf : @Partrec' n f) : @Partrec' n.succ fun v => f v.tail

{n : ℕ}
{f : Mathlib.Vector ℕ n →. ℕ}
(hf : Nat.Partrec' f)


theorem Context.evalList_sort_loop_swap
  (ctx : Context α)
  (h : Commutative ctx.op)
  (xs ys : List Nat)
  : evalList α ctx (sort.loop xs (y::ys)) = evalList α ctx (sort.loop (y::xs) ys)

{α : Sort u_1}
{y : Nat}
(ctx : Lean.Data.AC.Context α)
(h : Std.Commutative ctx.op)
(xs ys : List Nat)

Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort.loop xs (y :: ys)) =
  Lean.Data.AC.evalList α ctx (Lean.Data.AC.sort.loop (y :: xs) ys)


@[simp]
theorem summable_op : (Summable fun a ↦ op (f a)) ↔ Summable f

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

(Summable fun a => MulOpposite.op (f a)) ↔ Summable f


@[to_additive]
theorem mk_lt_mk : mk a₁ a₂ < mk b₁ b₂ ↔ ↑b₂ * a₁ < a₂ * b₁

{α : Type u_1}
[OrderedCancelAddCommMonoid α]
{s : AddSubmonoid α}
{a₁ b₁ : α}
{a₂ b₂ : ↥s}

AddLocalization.mk a₁ a₂ < AddLocalization.mk b₁ b₂ ↔ ↑b₂ + a₁ < ↑a₂ + b₁


theorem pair_diff_left (hne : a ≠ b) : ({a, b} : Set α) \ {a} = {b}


@[simp] theorem coe_false_iff_true  : ∀(a b : Bool), (a = false ↔ b) ↔ (!a) = b


/-- Note that as this lemma has an `if` in the statement, we include a `DecidableEq` argument.
This means you may not be able to `simp` using this lemma unless you `open scoped Classical`. -/
@[reassoc]
theorem biproduct.ι_π [DecidableEq J] (f : J → C) [HasBiproduct f] (j j' : J) :
    biproduct.ι f j ≫ biproduct.π f j' = if h : j = j' then eqToHom (congr_arg f h) else 0

CategoryTheory.Limits.biproduct.ι f j ≫ CategoryTheory.Limits.biproduct.π f j' =
  if h : j = j' then CategoryTheory.eqToHom ⋯ else 0


@[to_additive zsmul_right_inj]
lemma zpow_left_inj (hn : n ≠ 0) : a ^ n = b ^ n ↔ a = b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{n : ℤ}
{a b : α}
(hn : n ≠ 0)


theorem mk_eq_nat_iff_finset {n : ℕ} :
    #α = n ↔ ∃ t : Finset α, (t : Set α) = univ ∧ t.card = n

Cardinal.mk α = ↑n ↔ ∃ t, ↑t = Set.univ ∧ t.card = n


theorem le_tan {x : ℝ} (h1 : 0 ≤ x) (h2 : x < π / 2) : x ≤ tan x


@[simp]
lemma map₁_val {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G ⟶ A} {X : C}
    (s : yoneda.obj X ⟶ A) (u : OverArrows η s) (ε : F ⟶ G) (hε : ε ≫ μ = η) :
    (u.map₁ ε hε).val = ε.app _ u.val

{A F G : CategoryTheory.Functor Cᵒᵖ (Type v)}

(u : CategoryTheory.OverPresheafAux.OverArrows η s)

(hε : CategoryTheory.CategoryStruct.comp ε μ = η)

(u.map₁ ε hε).val = ε.app (Opposite.op X) u.val


lemma eulerMascheroniSeq'_six_lt_two_thirds : eulerMascheroniSeq' 6 < 2 / 3


theorem exists_coprime' (H : 0 < gcd m n) :
    ∃ g m' n', 0 < g ∧ Coprime m' n' ∧ m = m' * g ∧ n = n' * g

∃ g m' n', 0 < g ∧ m'.Coprime n' ∧ m = m' * g ∧ n = n' * g


@[simp]
lemma stalkMap_germ'_apply (U : Y.Opens) (x : X) (hx : f.val.base x ∈ U) (y) :
    f.stalkMap x (Y.presheaf.germ ⟨f.val.base x, hx⟩ y) =
      X.presheaf.germ (U := (Opens.map f.val.base).obj U) ⟨x, hx⟩ (f.val.c.app (op U) y)

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(U : Y.Opens)
(x : ↑↑X.toPresheafedSpace)
(hx : f.val.base x ∈ U)
(y : ↑(Y.presheaf.obj (Opposite.op U)))

(AlgebraicGeometry.Scheme.Hom.stalkMap f x) ((Y.presheaf.germ ⟨f.val.base x, hx⟩) y) =
  (X.presheaf.germ ⟨x, hx⟩) ((f.val.c.app (Opposite.op U)) y)


/-- `CompleteLatticeHomClass F α β` states that `F` is a type of complete lattice morphisms.

You should extend this class when you extend `CompleteLatticeHom`. -/
class CompleteLatticeHomClass (F α β : Type*) [CompleteLattice α] [CompleteLattice β]
  [FunLike F α β] extends sInfHomClass F α β : Prop where
  /-- The proposition that members of `CompleteLatticeHomClass` commute with arbitrary
  suprema/joins. -/
  map_sSup (f : F) (s : Set α) : f (sSup s) = sSup (f '' s)

{F : Type u_8}
{α : Type u_9}
{β : Type u_10}
[CompleteLattice α]
[CompleteLattice β]
[FunLike F α β]
[self : CompleteLatticeHomClass F α β]
(f : F)
(s : Set α)


theorem leadingCoeff_comp (hq : natDegree q ≠ 0) :
    leadingCoeff (p.comp q) = leadingCoeff p * leadingCoeff q ^ natDegree p

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

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


/-- The residue of `Λ(s)` at `s = 1` is equal to `1`. -/
lemma completedRiemannZeta_residue_one :
    Tendsto (fun s ↦ (s - 1) * completedRiemannZeta s) (𝓝[≠] 1) (𝓝 1)

Filter.Tendsto (fun s => (s - 1) * completedRiemannZeta s) (𝓝[≠] 1) (𝓝 1)


@[simp]
lemma Icc_inr_inl : Icc (inrₗ b) (inlₗ a) = ∅

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[OrderTop α]
[OrderBot β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
(a : α)
(b : β)

Finset.Icc (Sum.inrₗ b) (Sum.inlₗ a) = ∅


@[simp, norm_cast]
theorem coe_abs (x : ℝ) : ((|x| : ℝ) : ℝ*) = |↑x|


theorem integral_cos_pow_aux :
    (∫ x in a..b, cos x ^ (n + 2)) =
      (cos b ^ (n + 1) * sin b - cos a ^ (n + 1) * sin a + (n + 1) * ∫ x in a..b, cos x ^ n) -
        (n + 1) * ∫ x in a..b, cos x ^ (n + 2)

∫ (x : ℝ) in a..b, Real.cos x ^ (n + 2) =
  (Real.cos b ^ (n + 1) * Real.sin b - Real.cos a ^ (n + 1) * Real.sin a +
      (↑n + 1) * ∫ (x : ℝ) in a..b, Real.cos x ^ n) -
    (↑n + 1) * ∫ (x : ℝ) in a..b, Real.cos x ^ (n + 2)


theorem Filter.tendsto_nhds_min_right {l : Filter β} {a : α} (h : Tendsto f l (𝓝[<] a)) :
    Tendsto (fun i => min a (f i)) l (𝓝[<] a)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{f : β → α}
{l : Filter β}
{a : α}
(h : Filter.Tendsto f l (𝓝[<] a))

Filter.Tendsto (fun i => min a (f i)) l (𝓝[<] a)


theorem testBit_two_pow_add_eq (x i : Nat) : testBit (2^i + x) i = not (testBit x i)


lemma exists_ne_zero (χ : Weight R L M) :
    ∃ x ∈ weightSpace M χ, x ≠ 0

{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]
(χ : LieModule.Weight R L M)


theorem length_mul_left_ne (w : W) : ℓ (w * t) ≠ ℓ w

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
{cs : CoxeterSystem M W}
{t : W}
(ht : cs.IsReflection t)
(w : W)


protected theorem sub_lt_sub_left : ∀ {k m n : Nat}, k < m → k < n → m - n < m - k


theorem add_one_le_of_lt {n m : Nat} (h : n < m) : n + 1 ≤ m


/-- Multiplicative congruence relations preserve multiplication. -/
@[to_additive "Additive congruence relations preserve addition."]
protected theorem mul {w x y z} : c w x → c y z → c (w * y) (x * z)

{M : Type u_1}
[Mul M]
(c : Con M)
{w x y z : M}


theorem iterate_comm (f : α → α) (m n : ℕ) : f^[n]^[m] = f^[m]^[n]


@[simp] lemma EReal.log_exp (x : EReal) : log (exp x) = x


theorem sup_toAddSubgroup {R M : Type*} [Ring R] [AddCommGroup M] [Module R M]
    (p p' : Submodule R M) : (p ⊔ p').toAddSubgroup = p.toAddSubgroup ⊔ p'.toAddSubgroup

{R : Type u_9}
{M : Type u_10}
[Ring R]
[AddCommGroup M]
[Module R M]
(p p' : Submodule R M)


theorem ExtensionOfMaxAdjoin.extendIdealTo_eq (h : Module.Baer R Q) {y : N} (r : R)
    (hr : r • y ∈ (extensionOfMax i f).domain) : ExtensionOfMaxAdjoin.extendIdealTo i f h y r =
    (extensionOfMax i f).toLinearPMap ⟨r • y, hr⟩

(hr : r • y ∈ (Module.Baer.extensionOfMax i f).domain)

(Module.Baer.ExtensionOfMaxAdjoin.extendIdealTo i f h y) r = ↑(Module.Baer.extensionOfMax i f).toLinearPMap ⟨r • y, hr⟩


/-- If `a` semiconjugates a unit `x` to a unit `y`, then it semiconjugates `x⁻¹` to `y⁻¹`. -/
@[to_additive "If `a` semiconjugates an additive unit `x` to an additive unit `y`, then it
semiconjugates `-x` to `-y`."]
theorem units_inv_right {a : M} {x y : Mˣ} (h : SemiconjBy a x y) : SemiconjBy a ↑x⁻¹ ↑y⁻¹

{M : Type u_1}
[AddMonoid M]
{a : M}
{x y : AddUnits M}
(h : AddSemiconjBy a ↑x ↑y)


theorem Prime.dvd_prime_iff_associated [CancelCommMonoidWithZero α] {p q : α} (pp : Prime p)
    (qp : Prime q) : p ∣ q ↔ Associated p q

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p q : α}
(pp : Prime p)
(qp : Prime q)


/-- The forgetful functor from bimonoid objects to comonoid objects. -/
@[simps!]
def toComon_ : Bimon_ C ⥤ Comon_ C

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


theorem closure_eq_of_le (h₁ : s ⊆ S) (h₂ : S ≤ closure L s) : closure L s = S

(h₂ : S ≤ (FirstOrder.Language.Substructure.closure L).toFun s)

(FirstOrder.Language.Substructure.closure L).toFun s = S


/-- Turn a Legendre symbol into a Jacobi symbol. -/
theorem LegendreSym.to_jacobiSym (p : ℕ) (pp : Fact p.Prime) (a r : ℤ)
    (hr : IsInt (jacobiSym a p) r) : IsInt (legendreSym p a) r

(hr : Mathlib.Meta.NormNum.IsInt (jacobiSym a p) r)

Mathlib.Meta.NormNum.IsInt (legendreSym p a) r


@[to_additive]
theorem universalMulHom_apply {r : R} {s : S} :
    universalMulHom f fS hf (r /ₒ s) = ((fS s)⁻¹ : Units T) * f r

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
{T : Type u_2}
[AddMonoid T]
(f : R →+ T)
(fS : ↥S →+ AddUnits T)
(hf : ∀ (s : ↥S), f ↑s = ↑(fS s))
{r : R}
{s : ↥S}

(AddOreLocalization.universalAddHom f fS hf) (r -ₒ s) = ↑(-fS s) + f r


@[simp] theorem lTensor_refl : (refl R N).lTensor M = refl R _

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
(N : Type u_5)
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]

LinearEquiv.lTensor M (LinearEquiv.refl R N) = LinearEquiv.refl R (TensorProduct R M N)


/-- The obvious triangle `X₁ ⟶ X₁ ⊞ X₂ ⟶ X₂ ⟶ X₁⟦1⟧`. -/
@[simps!]
def binaryBiproductTriangle (X₁ X₂ : C) [HasZeroMorphisms C] [HasBinaryBiproduct X₁ X₂] :
    Triangle C

(CategoryTheory.Pretriangulated.binaryBiproductTriangle X₁ X₂).mor₁ = CategoryTheory.Limits.biprod.inl


lemma LeftHomologyData.mapHomologyIso_eq [S.HasHomology]
    [(S.map F).HasHomology] [F.PreservesLeftHomologyOf S] :
    S.mapHomologyIso F = (hl.map F).homologyIso ≪≫ F.mapIso hl.homologyIso.symm


/-- The equivalence of categories between `(A ⥤ B) × (A ⥤ C)` and `A ⥤ (B × C)` -/
@[simps]
def functorProdFunctorEquiv : (A ⥤ B) × (A ⥤ C) ≌ A ⥤ B × C

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

(CategoryTheory.functorProdFunctorEquiv A B C).functor = CategoryTheory.prodFunctorToFunctorProd A B C


lemma EssFiniteType.adjoin_mem_finset [EssFiniteType R S] :
    adjoin R { x : subalgebra R S | x.1 ∈ finset R S } = ⊤

(R : Type u_1)
(S : Type u_2)
[CommRing R]
[CommRing S]
[Algebra R S]
[Algebra.EssFiniteType R S]

Algebra.adjoin R {x | ↑x ∈ Algebra.EssFiniteType.finset R S} = ⊤


/-- The composition of `C^∞` functions is `C^∞`. -/
nonrec theorem SmoothOn.comp' {t : Set M'} {g : M' → M''} (hg : SmoothOn I' I'' g t)
    (hf : SmoothOn I I' f s) : SmoothOn I I'' (g ∘ f) (s ∩ f ⁻¹' t)

{𝕜 : 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']
{E'' : Type u_8}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_9}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{M'' : Type u_10}
[TopologicalSpace M'']
[ChartedSpace H'' M'']
{f : M → M'}
{s : Set M}
{t : Set M'}
{g : M' → M''}
(hg : SmoothOn I' I'' g t)
(hf : SmoothOn I I' f s)


theorem HasConstantSpeedOnWith.hasLocallyBoundedVariationOn (h : HasConstantSpeedOnWith f s l) :
    LocallyBoundedVariationOn f s

{E : Type u_2}
[PseudoEMetricSpace E]
{f : ℝ → E}
{s : Set ℝ}
{l : ℝ≥0}
(h : HasConstantSpeedOnWith f s l)


@[simp]
lemma toPresheafOfModules_obj (X : Cᵒᵖ) :
    M.toPresheafOfModules.obj X = (M.obj X).carrier

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
(M : BundledCorePresheafOfModules R)
(X : Cᵒᵖ)

↑(M.toPresheafOfModules.obj X) = ↑(M.obj X)


theorem openEmbedding_iff_continuous_injective_open :
    OpenEmbedding f ↔ Continuous f ∧ Injective f ∧ IsOpenMap f

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

OpenEmbedding f ↔ Continuous f ∧ Function.Injective f ∧ IsOpenMap f


theorem sub_mem_Ioc_iff_right : a - b ∈ Set.Ioc c d ↔ b ∈ Set.Ico (a - d) (a - c)

{α : Type u_1}
[OrderedAddCommGroup α]
{a b c d : α}


@[to_additive]
lemma tprod_nat_mul_neg [T2Space M] {f : ℤ → M} (hf : Multipliable f) :
    ∏' n : ℕ, (f n * f (-n)) = (∏' n : ℤ, f n) * f 0

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
[ContinuousAdd M]
[T2Space M]
{f : ℤ → M}
(hf : Summable f)


theorem coeff_trunc (m) (n) (φ : R⟦X⟧) :
    (trunc n φ).coeff m = if m < n then coeff R m φ else 0

{R : Type u_1}
[Semiring R]
(m n : ℕ)
(φ : PowerSeries R)

(PowerSeries.trunc n φ).coeff m = if m < n then (PowerSeries.coeff R m) φ else 0


@[to_additive HasSum.nat_add_neg_add_one]
lemma HasProd.nat_mul_neg_add_one {f : ℤ → M} (hf : HasProd f m) :
    HasProd (fun n : ℕ ↦ f n * f (-(n + 1))) m

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
{m : M}
{f : ℤ → M}
(hf : HasProd f m)

HasProd (fun n => f ↑n * f (-(↑n + 1))) m


/-- The isomorphism between `(lift F _ _).obj WithInitial.star` with `Z`. -/
@[simps!]
def liftStar {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, Z ⟶ F.obj x)
    (hM : ∀ (x y : C) (f : x ⟶ y), M x ≫ F.map f = M y) : (lift F M hM).obj star ≅ Z

(hM : ∀ (x y : C) (f : x ⟶ y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y)

(CategoryTheory.WithInitial.liftStar F M hM).hom = CategoryTheory.CategoryStruct.id Z


@[to_additive le_prod_iff]
theorem le_prod_iff {H : Subgroup G} {K : Subgroup N} {J : Subgroup (G × N)} :
    J ≤ H.prod K ↔ map (MonoidHom.fst G N) J ≤ H ∧ map (MonoidHom.snd G N) J ≤ K

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{H : Subgroup G}
{K : Subgroup N}
{J : Subgroup (G × N)}

J ≤ H.prod K ↔ Subgroup.map (MonoidHom.fst G N) J ≤ H ∧ Subgroup.map (MonoidHom.snd G N) J ≤ K


theorem IicSnd_univ (r : ℝ) : ρ.IicSnd r univ = ρ (univ ×ˢ Iic r)

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

(ρ.IicSnd r) Set.univ = ρ (Set.univ ×ˢ Set.Iic r)


/-- The ω-limit of a nonempty set w.r.t. a nontrivial filter is nonempty. -/
theorem nonempty_omegaLimit_of_isCompact_absorbing [NeBot f] {c : Set β} (hc₁ : IsCompact c)
    (hc₂ : ∃ v ∈ f, closure (image2 ϕ v s) ⊆ c) (hs : s.Nonempty) : (ω f ϕ s).Nonempty

(ϕ : τ → α → β)

(hc₂ : ∃ v ∈ f, closure (Set.image2 ϕ v s) ⊆ c)


@[simp, norm_cast]
lemma coe_coe {F : Type*} [FunLike F M M₃] [SemilinearMapClass F σ M M₃] {f : F} :
    ⇑(f : M →ₛₗ[σ] M₃) = f

{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₃ : Type u_12}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₃]
[Module R M]
[Module S M₃]
{σ : R →+* S}
{F : Type u_17}
[FunLike F M M₃]
[SemilinearMapClass F σ M M₃]
{f : F}


@[simp]
theorem reverse_inj [h : HasInvolutiveReverse V] {a b : V}
    (f g : a ⟶ b) : reverse f = reverse g ↔ f = g

{V : Type u_2}
[Quiver V]
[h : Quiver.HasInvolutiveReverse V]
{a b : V}
(f g : a ⟶ b)

Quiver.reverse f = Quiver.reverse g ↔ f = g


theorem nfpBFamily_monotone (hf : ∀ i hi, Monotone (f i hi)) : Monotone (nfpBFamily.{u, v} o f)

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

(hf : ∀ (i : Ordinal.{u}) (hi : i < o), Monotone (f i hi))


theorem memℒp_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
    (hf : Memℒp f p μ) {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s]
    (hi₀ : Memℒp (fun _ => y₀) p μ) (n : ℕ) : Memℒp (approxOn f fmeas s y₀ h₀ n) p μ

(hi₀ : MeasureTheory.Memℒp (fun x => y₀) p μ)

MeasureTheory.Memℒp (↑(MeasureTheory.SimpleFunc.approxOn f fmeas s y₀ h₀ n)) p μ


@[simp]
theorem arsinh_zero : arsinh 0 = 0


/-- Cyclotomic polynomials are always positive on inputs larger than one.
Similar to `cyclotomic_pos` but with the condition on the input rather than index of the
cyclotomic polynomial. -/
theorem cyclotomic_pos' (n : ℕ) {R} [LinearOrderedCommRing R] {x : R} (hx : 1 < x) :
    0 < eval x (cyclotomic n R)

(n : ℕ)
{R : Type u_1}
[LinearOrderedCommRing R]
{x : R}
(hx : 1 < x)

0 < Polynomial.eval x (Polynomial.cyclotomic n R)


@[simp, norm_cast]
theorem Nat.cast_id (n : ℕ) : n.cast = n


/-- These are `SlashInvariantForm`s that are holomorphic and zero at infinity. -/
structure CuspForm extends SlashInvariantForm Γ k where
  holo' : MDifferentiable 𝓘(ℂ) 𝓘(ℂ) (toSlashInvariantForm : ℍ → ℂ)
  zero_at_infty' : ∀ A : SL(2, ℤ), IsZeroAtImInfty (toSlashInvariantForm ∣[k] A)

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(self : CuspForm Γ k)
(A : SL(2, ℤ))

UpperHalfPlane.IsZeroAtImInfty (SlashAction.map ℂ k A ⇑self.toSlashInvariantForm)


theorem copy_eq_self (f : α →ᵈ β) {f' : α → β} (h : f' = f) : f.copy f' h = f

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(f : α →ᵈ β)
{f' : α → β}
(h : f' = ⇑f)


@[simp] theorem mem_reverseAux {x : α} : ∀ {as bs}, x ∈ reverseAux as bs ↔ x ∈ as ∨ x ∈ bs


/-- Every basis vector from `adjust_to_orientation` is either that from the original basis or its
negation. -/
theorem adjustToOrientation_apply_eq_or_eq_neg [Nonempty ι] (e : Basis ι R M)
    (x : Orientation R M ι) (i : ι) :
    e.adjustToOrientation x i = e i ∨ e.adjustToOrientation x i = -e i

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_3}
[Fintype ι]
[DecidableEq ι]
[Nonempty ι]
(e : Basis ι R M)
(x : Orientation R M ι)
(i : ι)

(e.adjustToOrientation x) i = e i ∨ (e.adjustToOrientation x) i = -e i


@[simp]
theorem intervalIntegrable_exp : IntervalIntegrable exp μ a b


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

{F : Type u_1}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[IsScalarTower R B B]
[SMulCommClass R B B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
(f : F)
(S T : NonUnitalSubalgebra R A)

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


@[simp] protected theorem max_zero (a) : max a 0 = a


lemma nonsingular_of_equiv {P Q : Fin 3 → R} (h : P ≈ Q) : W.Nonsingular P ↔ W.Nonsingular Q

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)
{P Q : Fin 3 → R}
(h : P ≈ Q)


theorem equiv_lift_of {i : ι} (x : G i) :
    equiv_lift L ι G f G' f' g H_commuting (of L ι G f i x) = of L ι G' f' i (g i x)

[DirectedSystem G fun i j h => ⇑(f i j h)]

(f' : (i j : ι) → i ≤ j → G' i ↪[L] G' j)

(H_commuting : ∀ (i j : ι) (hij : i ≤ j) (x : G i), (g j) ((f i j hij) x) = (f' i j hij) ((g i) x))

[DirectedSystem G' fun i j h => ⇑(f' i j h)]

(FirstOrder.Language.DirectLimit.equiv_lift L ι G f G' f' g H_commuting)
    ((FirstOrder.Language.DirectLimit.of L ι G f i) x) =
  (FirstOrder.Language.DirectLimit.of L ι G' f' i) ((g i) x)


/-- `Equiv.piCongr` as a uniform isomorphism: this is the natural isomorphism
`Π i₁, β₁ i ≃ᵤ Π i₂, β₂ i₂` obtained from a bijection `ι₁ ≃ ι₂` and isomorphisms
`β₁ i₁ ≃ᵤ β₂ (e i₁)` for each `i₁ : ι₁`. -/
@[simps! apply toEquiv]
def piCongr {ι₁ ι₂ : Type*} {β₁ : ι₁ → Type*} {β₂ : ι₂ → Type*}
    [∀ i₁, UniformSpace (β₁ i₁)] [∀ i₂, UniformSpace (β₂ i₂)]
    (e : ι₁ ≃ ι₂) (F : ∀ i₁, β₁ i₁ ≃ᵤ β₂ (e i₁)) : (∀ i₁, β₁ i₁) ≃ᵤ ∀ i₂, β₂ i₂

{ι₁ : Type u_4}
{ι₂ : Type u_5}
{β₁ : ι₁ → Type u_6}
{β₂ : ι₂ → Type u_7}
[(i₁ : ι₁) → UniformSpace (β₁ i₁)]
[(i₂ : ι₂) → UniformSpace (β₂ i₂)]
(e : ι₁ ≃ ι₂)
(F : (i₁ : ι₁) → β₁ i₁ ≃ᵤ β₂ (e i₁))

∀ (a : (i : ι₁) → β₁ i) (i₂ : ι₂),
  (UniformEquiv.piCongr e F) a i₂ = ⋯ ▸ (Equiv.piCongrRight fun i => (F i).toEquiv) a (e.symm i₂)


theorem preimage_image_mk_open (hs : IsOpen s) : mk ⁻¹' (mk '' s) = s

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

SeparationQuotient.mk ⁻¹' (SeparationQuotient.mk '' s) = s


@[simp]
theorem map_fun (φ : M ↪ₑ[L] N) {n : ℕ} (f : L.Functions n) (x : Fin n → M) :
    φ (funMap f x) = funMap f (φ ∘ x)

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
[L.Structure N]
(φ : M ↪ₑ[L] N)
{n : ℕ}
(f : L.Functions n)
(x : Fin n → M)

φ (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (⇑φ ∘ x)


lemma cauchy_nnratCast (q : ℚ≥0) : (q : ℝ).cauchy = q


@[simp]
theorem suffix_insert (a : α) (l : List α) : l <:+ l.insert a

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


/-- Auxiliary definition for `unopEquivalence`. -/
@[simps]
def unopFunctor : (HomologicalComplex Vᵒᵖ c)ᵒᵖ ⥤ HomologicalComplex V c.symm

∀ {X Y : (HomologicalComplex Vᵒᵖ c)ᵒᵖ} (f : X ⟶ Y) (i : ι),
  ((HomologicalComplex.unopFunctor V c).map f).f i = (f.unop.f i).unop


@[simp]
theorem prodMapL_apply (p : (M₁ →L[𝕜] M₂) × (M₃ →L[𝕜] M₄)) :
    ContinuousLinearMap.prodMapL 𝕜 M₁ M₂ M₃ M₄ p = p.1.prodMap p.2

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{M₁ : Type u_5}
{M₂ : Type u_6}
{M₃ : Type u_7}
{M₄ : Type u_8}
[SeminormedAddCommGroup M₁]
[NormedSpace 𝕜 M₁]
[SeminormedAddCommGroup M₂]
[NormedSpace 𝕜 M₂]
[SeminormedAddCommGroup M₃]
[NormedSpace 𝕜 M₃]
[SeminormedAddCommGroup M₄]
[NormedSpace 𝕜 M₄]
(p : (M₁ →L[𝕜] M₂) × (M₃ →L[𝕜] M₄))

(ContinuousLinearMap.prodMapL 𝕜 M₁ M₂ M₃ M₄) p = p.1.prodMap p.2


@[to_additive]
protected theorem div_mem_comm_iff {a b : G} : a / b ∈ H ↔ b / a ∈ H

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
{a b : G}


lemma Nat.log_ne_padicValNat_succ {n : ℕ} (hn : n ≠ 0) : log 2 n ≠ padicValNat 2 (n + 1)


lemma IsUniform.pos (hG : G.IsUniform ε s t) : 0 < ε

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε : 𝕜}
{s t : Finset α}
(hG : G.IsUniform ε s t)


theorem edgeFinset_replaceVertex_of_not_adj (hn : ¬G.Adj s t) : (G.replaceVertex s t).edgeFinset =
    G.edgeFinset \ G.incidenceFinset t ∪ (G.neighborFinset s).image (s(·, t))

{V : Type u_1}
[DecidableEq V]
(G : SimpleGraph V)
{s t : V}
[Fintype V]
[DecidableRel G.Adj]
(hn : ¬G.Adj s t)

(G.replaceVertex s t).edgeFinset =
  G.edgeFinset \ G.incidenceFinset t ∪ Finset.image (fun x => s(x, t)) (G.neighborFinset s)


/-- Tensoring on the right gives a monoidal functor from `C` into endofunctors of `C`.
-/
@[simps!]
def tensoringRightMonoidal [MonoidalCategory.{v} C] : MonoidalFunctor C (C ⥤ C)

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

((CategoryTheory.tensoringRightMonoidal C).obj k).obj j = CategoryTheory.MonoidalCategory.tensorObj j k


@[simp, norm_cast]
theorem coe_coe (e : M₁ ≃SL[σ₁₂] M₂) : ⇑(e : M₁ →SL[σ₁₂] M₂) = e

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


theorem mem_roots (hp : p ≠ 0) : a ∈ p.roots ↔ IsRoot p a

{R : Type u}
{a : R}
[CommRing R]
[IsDomain R]
{p : Polynomial R}
(hp : p ≠ 0)


theorem IsMaxFilter.filter_inf (h : IsMaxFilter f l a) (l') : IsMaxFilter f (l ⊓ l') a

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{l : Filter α}
{a : α}
(h : IsMaxFilter f l a)
(l' : Filter α)


@[to_additive]
theorem sSup_inv (s : Set α) : sSup s⁻¹ = (sInf s)⁻¹

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


@[simp] theorem length_replaceF : length (replaceF f l) = length l

∀ {α : Type u_1} {f : α → Option α} {l : List α}, (List.replaceF f l).length = l.length


/-- A category has pullback of inclusions if it has all pullbacks along coproduct injections. -/
class HasPullbacksOfInclusions (C : Type u) [Category.{v} C] [HasBinaryCoproducts C] : Prop where
  [hasPullbackInl : ∀ {X Y Z : C} (f : Z ⟶ X ⨿ Y), HasPullback coprod.inl f]

[self : CategoryTheory.HasPullbacksOfInclusions C]


/-- A Lie submodule of a Lie module is a submodule that is closed under the Lie bracket.
This is a sufficient condition for the subset itself to form a Lie module. -/
structure LieSubmodule extends Submodule R M where
  lie_mem : ∀ {x : L} {m : M}, m ∈ carrier → ⁅x, m⁆ ∈ carrier

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

m ∈ (↑self).carrier → ⁅x, m⁆ ∈ (↑self).carrier


@[measurability]
theorem Measurable.sup_const (hf : Measurable f) (c : M) : Measurable fun x => f x ⊔ c

{M : Type u_1}
[MeasurableSpace M]
{α : Type u_2}
{m : MeasurableSpace α}
{f : α → M}
[Sup M]
[MeasurableSup M]
(hf : Measurable f)
(c : M)


@[simp] theorem toList_erase [BEq α] (a : α) (l : AssocList α β) :
    (erase a l).toList = l.toList.eraseP (·.1 == a)

{α : Type u_1}
{β : Type u_2}
[BEq α]
(a : α)
(l : Batteries.AssocList α β)

(Batteries.AssocList.erase a l).toList = List.eraseP (fun x => x.fst == a) l.toList


/-- `Subfield.extendScalars.orderIso` bundles `Subfield.extendScalars`
into an order isomorphism from
`{ E : Subfield L // F ≤ E }` to `IntermediateField F L`. Its inverse is
`IntermediateField.toSubfield`. -/
@[simps]
def extendScalars.orderIso :
    { E : Subfield L // F ≤ E } ≃o IntermediateField F L

{L : Type u_2}
[Field L]
(F : Subfield L)
(E : { E // F ≤ E })

(Subfield.extendScalars.orderIso F) E = Subfield.extendScalars ⋯


private lemma tendsto_div_two_punctured_nhds (a : ℂ) :
    Tendsto (fun s : ℂ ↦ s / 2) (𝓝[≠] a) (𝓝[≠] (a / 2))

Filter.Tendsto (fun s => s / 2) (𝓝[≠] a) (𝓝[≠] (a / 2))


@[to_additive]
theorem div [Div Y] ⦃f g : X → Y⦄ (hf : IsLocallyConstant f) (hg : IsLocallyConstant g) :
    IsLocallyConstant (f / g)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[Div Y]
⦃f g : X → Y⦄
(hf : IsLocallyConstant f)
(hg : IsLocallyConstant g)


/-- `Finset.noncommProd` is “injective” in `f` if `f` maps into independent subgroups.  This
generalizes (one direction of) `Subgroup.disjoint_iff_mul_eq_one`. -/
@[to_additive "`Finset.noncommSum` is “injective” in `f` if `f` maps into independent subgroups.
This generalizes (one direction of) `AddSubgroup.disjoint_iff_add_eq_zero`. "]
theorem eq_one_of_noncommProd_eq_one_of_independent {ι : Type*} (s : Finset ι) (f : ι → G) (comm)
    (K : ι → Subgroup G) (hind : CompleteLattice.Independent K) (hmem : ∀ x ∈ s, f x ∈ K x)
    (heq1 : s.noncommProd f comm = 1) : ∀ i ∈ s, f i = 1

(comm : (↑s).Pairwise fun a b => Commute (f a) (f b))


theorem nonempty_type_iff_nonempty {x : PSet} : Nonempty x.Type ↔ PSet.Nonempty x


theorem char_mul_comm (V : FDRep k G) (g : G) (h : G) :
    V.character (h * g) = V.character (g * h)

{k : Type u}
[Field k]
{G : Type u}
[Monoid G]
(V : FDRep k G)
(g h : G)


theorem LinearIndependent.mono {t s : Set M} (h : t ⊆ s) :
    LinearIndependent R (fun x => x : s → M) → LinearIndependent R (fun x => x : t → M)

{R : Type u_2}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{t s : Set M}
(h : t ⊆ s)

(LinearIndependent R fun (x : ↑s) => ↑x) → LinearIndependent R fun (x : ↑t) => ↑x


@[to_additive]
theorem inter_div_subset : s₁ ∩ s₂ / t ⊆ s₁ / t ∩ (s₂ / t)

{α : Type u_2}
[Div α]
{s₁ s₂ t : Set α}


@[simp]
theorem coe_mapCoeffs : (b.mapCoeffs f h : ι → M) = b

(h : ∀ (c : R) (x : M), f c • x = c • x)


/-- If `CommSemiring` homs `g : R →+* P, l : P →+* A` induce maps of localizations, the composition
of the induced maps equals the map of localizations induced by `l ∘ g`. -/
theorem map_map {A : Type*} [CommSemiring A] {U : Submonoid A} {W} [CommSemiring W] [Algebra A W]
    [IsLocalization U W] {l : P →+* A} (hl : T ≤ U.comap l) (x : S) :
    map W l hl (map Q g hy x) = map W (l.comp g) (fun x hx => hl (hy hx)) x

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
[IsLocalization M S]
{g : R →+* P}
{T : Submonoid P}
{Q : Type u_4}
[CommSemiring Q]
(hy : M ≤ Submonoid.comap g T)
[Algebra P Q]
[IsLocalization T Q]
{A : Type u_5}
[CommSemiring A]
{U : Submonoid A}
{W : Type u_6}
[CommSemiring W]
[Algebra A W]
[IsLocalization U W]
{l : P →+* A}
(hl : T ≤ Submonoid.comap l U)
(x : S)

(IsLocalization.map W l hl) ((IsLocalization.map Q g hy) x) = (IsLocalization.map W (l.comp g) ⋯) x


theorem inf_left_eq_bot_iff (h : IsCompl y z) : x ⊓ y = ⊥ ↔ x ≤ z

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{x y z : α}
(h : IsCompl y z)


/-- Multiplication of analytic functions (valued in a normed `𝕜`-algebra) is analytic. -/
lemma AnalyticOn.mul {f g : E → A} {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}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{A : Type u_8}
[NormedRing A]
[NormedAlgebra 𝕜 A]
{f g : E → A}
{s : Set E}
(hf : AnalyticOn 𝕜 f s)
(hg : AnalyticOn 𝕜 g s)


@[to_additive]
nonrec lemma orbitRel.Quotient.orbit_nonempty (x : orbitRel.Quotient G α) :
    Set.Nonempty x.orbit

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
(x : AddAction.orbitRel.Quotient G α)


theorem mul_eq_max_of_aleph0_le_left {a b : Cardinal} (h : ℵ₀ ≤ a) (h' : b ≠ 0) :
    a * b = max a b

{a b : Cardinal.{u_1}}
(h : ℵ₀ ≤ a)
(h' : b ≠ 0)


/-- Combine two equivalences using `PProd` in the domain and `Prod` in the codomain. -/
@[simps! apply symm_apply]
def pprodProd (ea : α₁ ≃ α₂) (eb : β₁ ≃ β₂) :
    PProd α₁ β₁ ≃ α₂ × β₂

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

∀ (a : α₂ × β₂), (ea.pprodProd eb).symm a = (ea.pprodCongr eb).symm ⟨a.1, a.2⟩


@[simp]
theorem comp_right (a b c : Under X) (f : a ⟶ b) (g : b ⟶ c) : (f ≫ g).right = f.right ≫ g.right

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
(a b c : CategoryTheory.Under X)
(f : a ⟶ b)
(g : b ⟶ c)

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


theorem map_sentence (f : M ↪ₑ[L] N) (φ : L.Sentence) : M ⊨ φ ↔ N ⊨ φ

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
[L.Structure N]
(f : M ↪ₑ[L] N)
(φ : L.Sentence)

M ⊨ φ ↔ N ⊨ φ


@[simp]
theorem coe_smul_linearMap (r : S) (D : Derivation R A M) : ↑(r • D) = r • (D : A →ₗ[R] M)

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
{S : Type u_5}
[Monoid S]
[DistribMulAction S M]
[SMulCommClass R S M]
[SMulCommClass S A M]
(r : S)
(D : Derivation R A M)


@[simp]
theorem op_star [Star R] (r : R) : op (star r) = star (op r)

MulOpposite.op (star r) = star (MulOpposite.op r)


theorem exp_one_gt_d9 : 2.7182818283 < exp 1


@[simp]
theorem type_eq_one_iff_unique [IsWellOrder α r] : type r = 1 ↔ Nonempty (Unique α)

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

Ordinal.type r = 1 ↔ Nonempty (Unique α)


theorem not_a_field : maximalIdeal R ≠ ⊥

(R : Type u)
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]


@[to_additive (attr := simp)]
theorem uncurry_one [∀ a b, One (γ a b)] : Sigma.uncurry (1 : ∀ a b, γ a b) = 1

{α : Type u_3}
{β : α → Type u_4}
{γ : (a : α) → β a → Type u_5}
[(a : α) → (b : β a) → Zero (γ a b)]


@[simp]
theorem const_apply (f g : R) (U : Opens (PrimeSpectrum.Top R))
    (hu : ∀ x ∈ U, g ∈ (x : PrimeSpectrum.Top R).asIdeal.primeCompl) (x : U) :
    (const R f g U hu).1 x = IsLocalization.mk' _ f ⟨g, hu x x.2⟩

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(hu : ∀ x ∈ U, g ∈ x.asIdeal.primeCompl)

↑(AlgebraicGeometry.StructureSheaf.const R f g U hu) x =
  IsLocalization.mk' (AlgebraicGeometry.StructureSheaf.Localizations R ↑x) f ⟨g, ⋯⟩


theorem Integrable.withDensityᵥ_trim_eq_integral {m m0 : MeasurableSpace α} {μ : Measure α}
    (hm : m ≤ m0) {f : α → ℝ} (hf : Integrable f μ) {i : Set α} (hi : MeasurableSet[m] i) :
    (μ.withDensityᵥ f).trim hm i = ∫ x in i, f x ∂μ

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(hm : m ≤ m0)
{f : α → ℝ}
(hf : MeasureTheory.Integrable f μ)
{i : Set α}
(hi : MeasurableSet i)

↑((μ.withDensityᵥ f).trim hm) i = ∫ (x : α) in i, f x ∂μ


/-- `Fintype.prod_bijective` is a variant of `Finset.prod_bij` that accepts `Function.Bijective`.

See `Function.Bijective.prod_comp` for a version without `h`. -/
@[to_additive "`Fintype.sum_bijective` is a variant of `Finset.sum_bij` that accepts
`Function.Bijective`.

See `Function.Bijective.sum_comp` for a version without `h`. "]
lemma prod_bijective (e : ι → κ) (he : e.Bijective) (f : ι → α) (g : κ → α)
    (h : ∀ x, f x = g (e x)) : ∏ x, f x = ∏ x, g x

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[Fintype ι]
[Fintype κ]
[CommMonoid α]
(e : ι → κ)
(he : Function.Bijective e)
(f : ι → α)
(g : κ → α)
(h : ∀ (x : ι), f x = g (e x))


@[simp]
theorem re_snd_dualNumberEquiv (q : Quaternion (DualNumber R)) :
    (dualNumberEquiv q).snd.re = q.re.snd

{R : Type u_1}
[CommRing R]
(q : Quaternion (DualNumber R))

(TrivSqZeroExt.snd (Quaternion.dualNumberEquiv q)).re = TrivSqZeroExt.snd q.re


/-- Order isomorphism between bundled monotone maps `α →o Π i, π i` and families of bundled monotone
maps `Π i, α →o π i`. -/
@[simps]
def piIso : (α →o ∀ i, π i) ≃o ∀ i, α →o π i

{α : Type u_2}
[Preorder α]
{ι : Type u_6}
{π : ι → Type u_7}
[(i : ι) → Preorder (π i)]
(f : α →o (i : ι) → π i)
(i : ι)

OrderHom.piIso f i = (Pi.evalOrderHom i).comp f


/-- `trim` is additive. -/
theorem trim_add (m₁ m₂ : OuterMeasure α) : (m₁ + m₂).trim = m₁.trim + m₂.trim

{α : Type u_1}
[MeasurableSpace α]
(m₁ m₂ : MeasureTheory.OuterMeasure α)


@[simp]
theorem mk_add (f g : CauSeq β abv) : mk f + mk g = mk (f + g)

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(f g : CauSeq β abv)

CauSeq.Completion.mk f + CauSeq.Completion.mk g = CauSeq.Completion.mk (f + g)


@[to_additive]
theorem Nonempty.inv (h : s.Nonempty) : s⁻¹.Nonempty

{α : Type u_2}
[InvolutiveNeg α]
{s : Set α}
(h : s.Nonempty)


/-- An oriented angle is zero if and only if the angle with the order of the points reversed is
zero. -/
theorem oangle_eq_zero_iff_oangle_rev_eq_zero {p₁ p₂ p₃ : P} : ∡ p₁ p₂ p₃ = 0 ↔ ∡ p₃ p₂ p₁ = 0

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


@[simp]
theorem sdiff_inter_self (s₁ s₂ : Finset α) : s₂ \ s₁ ∩ s₁ = ∅

{α : Type u_1}
[DecidableEq α]
(s₁ s₂ : Finset α)

s₂ \ s₁ ∩ s₁ = ∅


@[simp]
theorem map_fval {f : ZFSet.{u} → ZFSet.{u}} [H : PSet.Definable 1 f] {x y : ZFSet.{u}}
    (h : y ∈ x) : (ZFSet.map f x ′ y : Class.{u}) = f y

{f : ZFSet → ZFSet}
[H : PSet.Definable 1 f]
{x y : ZFSet}
(h : y ∈ x)


theorem card_pos_iff_exists_mem {s : Multiset α} : 0 < card s ↔ ∃ a, a ∈ s


@[to_additive]
theorem smul_set_sdiff : a • (s \ t) = a • s \ a • t

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{s t : Set β}
{a : α}


theorem isEquipartition_iff_card_parts_eq_average :
    P.IsEquipartition ↔
      ∀ a : Finset α,
        a ∈ P.parts → a.card = s.card / P.parts.card ∨ a.card = s.card / P.parts.card + 1

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
(P : Finpartition s)

P.IsEquipartition ↔ ∀ a ∈ P.parts, a.card = s.card / P.parts.card ∨ a.card = s.card / P.parts.card + 1


theorem NFBelow.fst {e n a b} (h : NFBelow (ONote.oadd e n a) b) : NF e

{e : ONote}
{n : ℕ+}
{a : ONote}
{b : Ordinal.{0}}
(h : (e.oadd n a).NFBelow b)


/-- A continuous injective map from a compact space to a Hausdorff space is a closed embedding. -/
theorem Continuous.closedEmbedding [CompactSpace X] [T2Space Y] {f : X → Y} (h : Continuous f)
    (hf : Function.Injective f) : ClosedEmbedding f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[CompactSpace X]
[T2Space Y]
{f : X → Y}
(h : Continuous f)
(hf : Function.Injective f)


/-- Multiplying `a` by its inverse and then by itself results in `a`
(whether or not `a` is zero). -/
@[simp]
theorem mul_inv_mul_self (a : G₀) : a * a⁻¹ * a = a

{G₀ : Type u_3}
[GroupWithZero G₀]
(a : G₀)


protected theorem inv_eq_of_mul_eq_one (n : ℕ) (a b : ZMod n) (h : a * b = 1) : a⁻¹ = b


nonrec theorem _root_.Commute.tprod {a₁ a₂ : Π i, A i} (ha : Commute a₁ a₂) :
    Commute (tprod R a₁) (tprod R a₂)

[(i : ι) → NonUnitalNonAssocSemiring (A i)]

[∀ (i : ι), SMulCommClass R (A i) (A i)]

[∀ (i : ι), IsScalarTower R (A i) (A i)]

Commute ((PiTensorProduct.tprod R) a₁) ((PiTensorProduct.tprod R) a₂)


theorem out_no_max_of_succ_lt {o : Ordinal} (ho : ∀ a < o, succ a < o) : NoMaxOrder o.out.α

{o : Ordinal.{u_4}}
(ho : ∀ a < o, Order.succ a < o)


@[to_additive]
theorem integral_eq_tsum' (h : IsFundamentalDomain G s μ) (f : α → E) (hf : Integrable f μ) :
    ∫ x, f x ∂μ = ∑' g : G, ∫ x in s, f (g⁻¹ • x) ∂μ

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

∫ (x : α), f x ∂μ = ∑' (g : G), ∫ (x : α) in s, f (-g +ᵥ x) ∂μ


theorem tag_biUnionTagged (π : Prepartition I) {πi : ∀ J, TaggedPrepartition J} (hJ : J ∈ π) {J'}
    (hJ' : J' ∈ πi J) : (π.biUnionTagged πi).tag J' = (πi J).tag J'

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


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

{G : Type v}
{X : Type w}
[PseudoMetricSpace X]
[AddGroup G]
[AddAction G X]
[IsometricVAdd G X]
(c : G)
(x : X)
(r : ℝ)

(fun x => c +ᵥ x) ⁻¹' Metric.ball x r = Metric.ball (-c +ᵥ x) r


@[to_additive]
theorem is_mul_left_invariant_innerContent [Group G] [TopologicalGroup G]
    (h : ∀ (g : G) {K : Compacts G}, μ (K.map _ <| continuous_mul_left g) = μ K) (g : G)
    (U : Opens G) :
    μ.innerContent (Opens.comap (Homeomorph.mulLeft g).toContinuousMap U) = μ.innerContent U

(h :
  ∀ (g : G) {K : TopologicalSpace.Compacts G},
    (fun s => ↑(μ.toFun s)) (TopologicalSpace.Compacts.map (fun b => g + b) ⋯ K) = (fun s => ↑(μ.toFun s)) K)

μ.innerContent ((TopologicalSpace.Opens.comap (Homeomorph.addLeft g).toContinuousMap) U) = μ.innerContent U


@[simp, elementwise nosimp]
theorem ι_fromOpenSubsetsGlue (i : J) :
    (ofOpenSubsets U).toGlueData.ι i ≫ fromOpenSubsetsGlue U = Opens.inclusion _

{α : Type u}
[TopologicalSpace α]
{J : Type u}
(U : J → TopologicalSpace.Opens α)
(i : J)

(TopCat.GlueData.ofOpenSubsets U).ι i ≫ TopCat.GlueData.fromOpenSubsetsGlue U = (U i).inclusion


@[simp]
theorem detAux_id (b : Trunc <| Basis ι A M) : LinearMap.detAux b LinearMap.id = 1

{M : Type u_2}
[AddCommGroup M]
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
{A : Type u_5}
[CommRing A]
[Module A M]
(b : Trunc (Basis ι A M))


@[simp]
theorem ucs_succ (k : ℕ) : N.ucs (k + 1) = (N.ucs k).normalizer

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(N : LieSubmodule R L M)
(k : ℕ)

LieSubmodule.ucs (k + 1) N = (LieSubmodule.ucs k N).normalizer


theorem le_of_mem_compression_of_not_mem (h : a ∈ 𝓒 u v s) (ha : a ∉ s) : u ≤ a

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableRel Disjoint]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{u v a : α}
[DecidableEq α]
(h : a ∈ UV.compression u v s)
(ha : a ∉ s)


theorem StarConvex.preimage_smul {c : 𝕜} (hs : StarConvex 𝕜 (c • x) s) :
    StarConvex 𝕜 x ((fun z => c • z) ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedCommSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{x : E}
{s : Set E}
{c : 𝕜}
(hs : StarConvex 𝕜 (c • x) s)


theorem Ioo_toDual : Ioo (toDual a) (toDual b) = (Ioo b a).map toDual.toEmbedding

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

Finset.Ioo (OrderDual.toDual a) (OrderDual.toDual b) = Finset.map OrderDual.toDual.toEmbedding (Finset.Ioo b a)


lemma deriv_smoothingFn {x : ℝ} (hx : 1 < x) : deriv ε x = -x⁻¹ / (log x ^ 2)

deriv AkraBazziRecurrence.smoothingFn x = -x⁻¹ / Real.log x ^ 2


/-- Interpret an `Equiv` as a `PartialEquiv` by restricting it to `s` in the domain
and to `t` in the codomain. -/
@[simps (config := .asFn)]
def _root_.Equiv.toPartialEquivOfImageEq (e : α ≃ β) (s : Set α) (t : Set β) (h : e '' s = t) :
    PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
(s : Set α)
(t : Set β)
(h : ⇑e '' s = t)

(e.toPartialEquivOfImageEq s t h).source = s


@[to_additive]
theorem div_mul_eq_div_div : a / (b * c) = a / b / c

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


/-- `BoxIntegral.Box.splitCenterBox` bundled as a `Function.Embedding`. -/
@[simps]
def splitCenterBoxEmb (I : Box ι) : Set ι ↪ Box ι

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

I.splitCenterBoxEmb s = I.splitCenterBox s


theorem contDiff_single [DecidableEq ι] (k : ℕ∞) (i : ι) :
    ContDiff 𝕜 k (Pi.single i : F' i → ∀ i, F' i)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{ι : Type u_3}
[Fintype ι]
(F' : ι → Type u_5)
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
[DecidableEq ι]
(k : ℕ∞)
(i : ι)


@[simp]
lemma finsuppScalarLeft_apply_tmul_apply (p : ι →₀ R) (n : N) (i : ι) :
    finsuppScalarLeft R N ι (p ⊗ₜ[R] n) i = p i • n

{R : Type u_1}
[CommSemiring R]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_4}
[DecidableEq ι]
(p : ι →₀ R)
(n : N)
(i : ι)

((TensorProduct.finsuppScalarLeft R N ι) (p ⊗ₜ[R] n)) i = p i • n


protected lemma add [AddZeroClass E] [DistribSMul M E]
    (h₁ : Absorbs M s₁ t₁) (h₂ : Absorbs M s₂ t₂) : Absorbs M (s₁ + s₂) (t₁ + t₂)

{M : Type u_1}
{E : Type u_2}
[Bornology M]
{s₁ s₂ t₁ t₂ : Set E}
[AddZeroClass E]
[DistribSMul M E]
(h₁ : Absorbs M s₁ t₁)
(h₂ : Absorbs M s₂ t₂)


/-- In the specific case of continuous alternating maps on spaces indexed by `Fin (n+1)`, where one
can build an element of `Π(i : Fin (n+1)), M i` using `cons`, one can express directly the
multiplicativity of an alternating map along the first variable. -/
theorem cons_smul (f : ContinuousAlternatingMap R M N (Fin (n + 1))) (m : Fin n → M) (c : R)
    (x : M) : f (Fin.cons (c • x) m) = c • f (Fin.cons x m)

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
{n : ℕ}
(f : M [⋀^Fin (n + 1)]→L[R] N)
(m : Fin n → M)
(c : R)
(x : M)


theorem not_ge_eq (a b : Nat) : (¬ (a ≥ b)) = (a + 1 ≤ b)


@[to_additive]
theorem mem_comm_iff (nH : H.Normal) {a b : G} : a * b ∈ H ↔ b * a ∈ H

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
(nH : H.Normal)
{a b : G}


theorem mem_annihilator_span (s : Set M) (r : R) :
    r ∈ (Submodule.span R s).annihilator ↔ ∀ n : s, r • (n : M) = 0

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(s : Set M)
(r : R)

r ∈ (Submodule.span R s).annihilator ↔ ∀ (n : ↑s), r • ↑n = 0


theorem mul_inv_lt_iff (h : 0 < b) : a * b⁻¹ < c ↔ a < b * c

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


@[simp]
theorem addEquivBoundedOfCompact_symm_apply [AddMonoid β] [LipschitzAdd β] :
    ⇑((addEquivBoundedOfCompact α β).symm) = toContinuousMapAddHom α β

(α : Type u_1)
(β : Type u_2)
[TopologicalSpace α]
[CompactSpace α]
[MetricSpace β]
[AddMonoid β]
[LipschitzAdd β]

⇑(ContinuousMap.addEquivBoundedOfCompact α β).symm = ⇑(BoundedContinuousFunction.toContinuousMapAddHom α β)


theorem aut_mul (ϕ ψ : A₁ ≃ₐ[R] A₁) : ϕ * ψ = ψ.trans ϕ

{R : Type uR}
{A₁ : Type uA₁}
[CommSemiring R]
[Semiring A₁]
[Algebra R A₁]
(ϕ ψ : A₁ ≃ₐ[R] A₁)


@[simp]
theorem Ioi_insert : insert a (Ioi a) = Ici a


/-- The equivalence of categories `X ≌ Y` induced by `e : X ≃o Y`. -/
@[simps]
def OrderIso.equivalence (e : X ≃o Y) : X ≌ Y

{X : Type u}
{Y : Type v}
[Preorder X]
[Preorder Y]
(e : X ≃o Y)

e.equivalence.unitIso = CategoryTheory.NatIso.ofComponents (fun x => CategoryTheory.eqToIso ⋯) ⋯


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

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]

↑(NonUnitalSubalgebra.center R A) = Set.center A


@[simp]
theorem comapEquiv_symm_coe (f : MvPolynomial σ R ≃ₐ[R] MvPolynomial τ R) :
    ((comapEquiv f).symm : (σ → R) → τ → R) = comap f.symm

⇑(MvPolynomial.comapEquiv f).symm = MvPolynomial.comap ↑f.symm


theorem rotate_cons_succ (l : List α) (a : α) (n : ℕ) :
    (a :: l : List α).rotate (n + 1) = (l ++ [a]).rotate n

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

(a :: l).rotate (n + 1) = (l ++ [a]).rotate n


@[to_additive (attr := simp)]
theorem mem_inv : a ∈ s⁻¹ ↔ a⁻¹ ∈ s

{α : Type u_2}
[Inv α]
{s : Set α}
{a : α}

a ∈ s⁻¹ ↔ a⁻¹ ∈ s


theorem piecewise_op₂ {δ' δ'' : α → Sort*} (f' g' : ∀ i, δ' i) (h : ∀ i, δ i → δ' i → δ'' i) :
    (s.piecewise (fun x => h x (f x) (f' x)) fun x => h x (g x) (g' x)) = fun x =>
      h x (s.piecewise f g x) (s.piecewise f' g' x)

{α : Type u_1}
{δ : α → Sort u_6}
(s : Set α)
(f g : (i : α) → δ i)
[(j : α) → Decidable (j ∈ s)]
{δ' : α → Sort u_7}
{δ'' : α → Sort u_8}
(f' g' : (i : α) → δ' i)
(h : (i : α) → δ i → δ' i → δ'' i)


@[to_additive]
theorem isUnit_iff_mulLeft_bijective {a : M} :
    IsUnit a ↔ Function.Bijective (a * ·)

IsUnit a ↔ Function.Bijective fun x => a * x


theorem IsPrimitive.irreducible_of_irreducible_map_of_injective (h_irr : Irreducible (map φ f)) :
    Irreducible f

(h_irr : Irreducible (Polynomial.map φ f))


theorem coe_coe_symm_apply_coe_apply {F : Type*} [EquivLike F A₁ A₂] [AlgEquivClass F R A₁ A₂]
    (f : F) (x : A₁) :
    (f : A₁ ≃ₐ[R] A₂).symm (f x) = x

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
{F : Type u_1}
[EquivLike F A₁ A₂]
[AlgEquivClass F R A₁ A₂]
(f : F)
(x : A₁)


theorem sigmaToiUnion_injective (h : Pairwise fun i j => Disjoint (t i) (t j)) :
    Injective (sigmaToiUnion t)


/-- In a preconnected space, any disjoint cover by non-empty open subsets has at most one
element. -/
lemma subsingleton_of_disjoint_isOpen_iUnion_eq_univ
    (h_open : ∀ i, IsOpen (s i)) (h_Union : ⋃ i, s i = univ) :
    Subsingleton ι

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


@[simp]
theorem sup_biUnion [DecidableEq β] (s : Finset γ) (t : γ → Finset β) :
    (s.biUnion t).sup f = s.sup fun x => (t x).sup f

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


@[simp]
theorem sub_dotProduct : (u - v) ⬝ᵥ w = u ⬝ᵥ w - v ⬝ᵥ w

{m : Type u_2}
{α : Type v}
[Fintype m]
[NonUnitalNonAssocRing α]
(u v w : m → α)


@[simp]
theorem rightHom_inr (g : G) : rightHom (inr g : N ⋊[φ] G) = g

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

SemidirectProduct.rightHom (SemidirectProduct.inr g) = g


/-- Characterization of multiplication -/
theorem mul_spec [Nonempty N] {i} {p q : Ω^ N X x} :
    -- Porting note (#11215): TODO: introduce `HomotopyGroup.mk` and remove defeq abuse.
    ((· * ·) : _ → _ → HomotopyGroup N X x) ⟦p⟧ ⟦q⟧ = ⟦transAt i q p⟧

{N : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{x : X}
[DecidableEq N]
[Nonempty N]
{i : N}
{p q : ↑(Ω^ N X x)}

(fun x_1 x_2 => x_1 * x_2) ⟦p⟧ ⟦q⟧ = ⟦GenLoop.transAt i q p⟧


@[simp]
theorem subtypeDomain_piecewise (f : Subtype P →₀ M) (g : {a // ¬ P a} →₀ M) :
    subtypeDomain P (f.piecewise g) = f

{α : Type u_1}
{M : Type u_13}
[Zero M]
{P : α → Prop}
[DecidablePred P]
(f : Subtype P →₀ M)
(g : { a // ¬P a } →₀ M)

Finsupp.subtypeDomain P (f.piecewise g) = f


/-- If `m ⊗ n ≅ 𝟙_M` and `n ⊗ m ≅ 𝟙_M` (subject to some commuting constraints),
  then `F.obj m` and `F.obj n` forms a self-equivalence of `C`. -/
@[simps]
noncomputable def equivOfTensorIsoUnit (m n : M) (h₁ : m ⊗ n ≅ 𝟙_ M) (h₂ : n ⊗ m ≅ 𝟙_ M)
    (H : h₁.hom ▷ m ≫ (λ_ m).hom = (α_ m n m).hom ≫ m ◁ h₂.hom ≫ (ρ_ m).hom) : C ≌ C

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

(h₁ : CategoryTheory.MonoidalCategory.tensorObj m n ≅ 𝟙_ M)

(h₂ : CategoryTheory.MonoidalCategory.tensorObj n m ≅ 𝟙_ M)

(H :
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerRight h₁.hom m)
      (CategoryTheory.MonoidalCategory.leftUnitor m).hom =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator m n m).hom
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft m h₂.hom)
        (CategoryTheory.MonoidalCategory.rightUnitor m).hom))

(CategoryTheory.equivOfTensorIsoUnit F m n h₁ h₂ H).unitIso = (CategoryTheory.unitOfTensorIsoUnit F m n h₁).symm


theorem lintegral_rpow_nnnorm_lt_top_of_eLpNorm_lt_top {f : α → F} (hp_ne_zero : p ≠ 0)
    (hp_ne_top : p ≠ ∞) (hfp : eLpNorm f p μ < ∞) : (∫⁻ a, (‖f a‖₊ : ℝ≥0∞) ^ p.toReal ∂μ) < ∞

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{f : α → F}
(hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ⊤)
(hfp : MeasureTheory.eLpNorm f p μ < ⊤)


theorem surjOn (hf : RightInvOn f' f t) (hf' : MapsTo f' t s) : SurjOn f s t

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


theorem exists_of_mem_keys {a} {l : List (Sigma β)} (h : a ∈ l.keys) :
    ∃ b : β a, Sigma.mk a b ∈ l

{α : Type u}
{β : α → Type v}
{a : α}
{l : List (Sigma β)}
(h : a ∈ l.keys)


@[simp]
lemma inl_comp_binaryCoproductIso_hom_apply (a : C) (x : F.obj a) :
    (binaryCoproductIso F G).hom.app a ((Limits.coprod.inl (X := F)).app a x) = .inl x

(F G : CategoryTheory.Functor C (Type w))

(CategoryTheory.FunctorToTypes.binaryCoproductIso F G).hom.app a (CategoryTheory.Limits.coprod.inl.app a x) = Sum.inl x


theorem insert_inter_of_mem (h : a ∈ t) : insert a s ∩ t = insert a (s ∩ t)

{α : Type u}
{a : α}
{s t : Set α}
(h : a ∈ t)


lemma arctan_add_arctan_lt_pi_div_two {x y : ℝ} (h : x * y < 1) : arctan x + arctan y < π / 2

Real.arctan x + Real.arctan y < Real.pi / 2


/-- An isomorphism (a.k.a. an invertible morphism) between two objects of a category.
The inverse morphism is bundled.

See also `CategoryTheory.Core` for the category with the same objects and isomorphisms playing
the role of morphisms.

See <https://stacks.math.columbia.edu/tag/0017>.
-/
structure Iso {C : Type u} [Category.{v} C] (X Y : C) where
  /-- The forward direction of an isomorphism. -/
  hom : X ⟶ Y
  /-- The backwards direction of an isomorphism. -/
  inv : Y ⟶ X
  /-- Composition of the two directions of an isomorphism is the identity on the source. -/
  hom_inv_id : hom ≫ inv = 𝟙 X := by aesop_cat
  /-- Composition of the two directions of an isomorphism in reverse order
  is the identity on the target. -/
  inv_hom_id : inv ≫ hom = 𝟙 Y := by aesop_cat

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

CategoryTheory.CategoryStruct.comp self.inv self.hom = CategoryTheory.CategoryStruct.id Y


/-- **The Schröder-Bernstein Theorem**: Given embeddings `α ↪ β` and `β ↪ α`, there exists an
equivalence `α ≃ β`. -/
theorem antisymm : (α ↪ β) → (β ↪ α) → Nonempty (α ≃ β)