lemma shape_f (K : HomologicalComplex₂ C c₁ c₂) (i₁ i₁' : I₁) (h : ¬ c₁.Rel i₁ i₁') (i₂ : I₂) :
    (K.d i₁ i₁').f i₂ = 0


theorem insert_inter_distrib (a : α) (s t : Set α) : insert a (s ∩ t) = insert a s ∩ insert a t


theorem algHom_subsingleton {S : Type*} [CommRing S] [Algebra R S] {r : R} :
    Subsingleton (AdjoinRoot (C r * X - 1) →ₐ[R] S)

{R : Type u}
[CommRing R]
{S : Type u_1}
[CommRing S]
[Algebra R S]
{r : R}

Subsingleton (AdjoinRoot (Polynomial.C r * Polynomial.X - 1) →ₐ[R] S)


@[simp, norm_cast] lemma coe_le_coe : (a : WithZero α) ≤ b ↔ a ≤ b

↑a ≤ ↑b ↔ a ≤ b


/-- A projection on a normed space `X` is said to be an L-projection if, for all `x` in `X`,
$\|x\| = \|P x\| + \|(1 - P) x\|$.

Note that we write `P • x` instead of `P x` for reasons described in the module docstring.
-/
structure IsLprojection (P : M) : Prop where
  proj : IsIdempotentElem P
  Lnorm : ∀ x : X, ‖x‖ = ‖P • x‖ + ‖(1 - P) • x‖

{X : Type u_1}
[NormedAddCommGroup X]
{M : Type u_2}
[Ring M]
[Module M X]
{P : M}
(self : IsLprojection X P)
(x : X)


@[to_additive (attr := simp)]
theorem toFinset_one : (1 : Set α).toFinset = 1


theorem mem_closedBall_self : x ∈ closedBall x ε

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{ε : ℝ≥0∞}


/-- A CHSH tuple in a *-monoid consists of 4 self-adjoint involutions `A₀ A₁ B₀ B₁` such that
the `Aᵢ` commute with the `Bⱼ`.

The physical interpretation is that `A₀` and `A₁` are a pair of boolean observables which
are spacelike separated from another pair `B₀` and `B₁` of boolean observables.
-/
--@[nolint has_nonempty_instance] Porting note(#5171): linter not ported yet
structure IsCHSHTuple {R} [Monoid R] [StarMul R] (A₀ A₁ B₀ B₁ : R) : Prop where
  A₀_inv : A₀ ^ 2 = 1
  A₁_inv : A₁ ^ 2 = 1
  B₀_inv : B₀ ^ 2 = 1
  B₁_inv : B₁ ^ 2 = 1
  A₀_sa : star A₀ = A₀
  A₁_sa : star A₁ = A₁
  B₀_sa : star B₀ = B₀
  B₁_sa : star B₁ = B₁
  A₀B₀_commutes : A₀ * B₀ = B₀ * A₀
  A₀B₁_commutes : A₀ * B₁ = B₁ * A₀
  A₁B₀_commutes : A₁ * B₀ = B₀ * A₁
  A₁B₁_commutes : A₁ * B₁ = B₁ * A₁

{R : Type u_1}
[Monoid R]
[StarMul R]
{A₀ A₁ B₀ B₁ : R}
(self : IsCHSHTuple A₀ A₁ B₀ B₁)


@[simp]
theorem invOf_eq_inv (a : α) [Invertible a] : ⅟ a = a⁻¹

{α : Type u}
[GroupWithZero α]
(a : α)
[Invertible a]


theorem zipWith_neLocus_eq_right [∀ a, DecidableEq (M a)] [∀ a, DecidableEq (P a)]
    {F : ∀ a, M a → N a → P a} (F0 : ∀ a, F a 0 0 = 0) (f₁ f₂ : Π₀ a, M a) (g : Π₀ a, N a)
    (hF : ∀ a g, Function.Injective fun f ↦ F a f g) :
    (zipWith F F0 f₁ g).neLocus (zipWith F F0 f₂ g) = f₁.neLocus f₂

(hF : ∀ (a : α) (g : N a), Function.Injective fun f => F a f g)

(DFinsupp.zipWith F F0 f₁ g).neLocus (DFinsupp.zipWith F F0 f₂ g) = f₁.neLocus f₂


@[to_additive (attr := simp)]
theorem comap_map_comap {S : Subsemigroup N} {f : M →ₙ* N} :
    ((S.comap f).map f).comap f = S.comap f

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{S : AddSubsemigroup N}
{f : AddHom M N}

AddSubsemigroup.comap f (AddSubsemigroup.map f (AddSubsemigroup.comap f S)) = AddSubsemigroup.comap f S


@[simp]
theorem convexHull_pair (x y : E) : convexHull 𝕜 {x, y} = segment 𝕜 x y

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(x y : E)


@[simp]
theorem smul_apply' (s : S) (g : (restrictScalars f).obj ⟨S⟩ →ₗ[R] M) (s' : S) :
    (s • g) s' = g (s' * s : S)

(g : ↑((ModuleCat.restrictScalars f).obj (ModuleCat.mk S)) →ₗ[R] M)


/-- Coercion `ℕ∞ → ℝ≥0∞` as a ring homomorphism. -/
@[simps! (config := .asFn)]
def toENNRealRingHom : ℕ∞ →+* ℝ≥0∞


lemma mapSucc_eq (i : J) (hi : i < j) :
    iter.mapSucc i hi = whiskerLeft _ ε ≫ (iter.isoSucc i hi).inv

(iter : CategoryTheory.Functor.Iteration ε j)

iter.mapSucc i hi =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerLeft (iter.F.obj ⟨i, ⋯⟩) ε) (iter.isoSucc i hi).inv


protected theorem bot_eq_zero : (⊥ : ι →₀ α) = 0

{ι : Type u_1}
{α : Type u_2}
[CanonicallyOrderedAddCommMonoid α]


theorem tendsto_const_mul_rpow_nhds_zero_of_pos {c : ℝ≥0∞} (hc : c ≠ ∞) {y : ℝ} (hy : 0 < y) :
    Tendsto (fun x : ℝ≥0∞ => c * x ^ y) (𝓝 0) (𝓝 0)

Filter.Tendsto (fun x => c * x ^ y) (𝓝 0) (𝓝 0)


/-- If `J` is subcanonical, then any representable is a `J`-sheaf. -/
theorem isSheaf_of_representable {J : GrothendieckTopology C} (hJ : Subcanonical J)
    (P : Cᵒᵖ ⥤ Type v) [P.Representable] : Presieve.IsSheaf J P

{J : CategoryTheory.GrothendieckTopology C}

(hJ : CategoryTheory.Sheaf.Subcanonical J)

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


lemma map_injective_of_injective (hf : Function.Injective f) :
    Function.Injective (map f)

{R : Type u}
{L : Type v}
{M : Type w}
{M' : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup M']
[Module R M']
[LieRingModule L M']
{f : M →ₗ⁅R,L⁆ M'}
(hf : Function.Injective ⇑f)


/-- For vectors `a x y : E`, the identity `⟪a, x⟫ * ⟪a, y⟫ + ω a x * ω a y = ‖a‖ ^ 2 * ⟪x, y⟫`. -/
theorem inner_mul_inner_add_areaForm_mul_areaForm (a x y : E) :
    ⟪a, x⟫ * ⟪a, y⟫ + ω a x * ω a y = ‖a‖ ^ 2 * ⟪x, y⟫

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

⟪a, x⟫_ℝ * ⟪a, y⟫_ℝ + (o.areaForm a) x * (o.areaForm a) y = ‖a‖ ^ 2 * ⟪x, y⟫_ℝ


theorem mono_measure {ν : Measure α} (hf : AEStronglyMeasurable f μ) (h : ν ≤ μ) :
    AEStronglyMeasurable f ν

(hf : MeasureTheory.AEStronglyMeasurable f μ)


theorem mem_range_of_mem_oneCoboundaries {f : oneCocycles A} (h : f ∈ oneCoboundaries A) :
    f.1 ∈ LinearMap.range (dZero A)

(h : f ∈ groupCohomology.oneCoboundaries A)

↑f ∈ LinearMap.range (groupCohomology.dZero A)


/-- `PLift α` is equivalent to `α`. -/
@[simps (config := .asFn) apply]
protected def plift : PLift α ≃ α


theorem const (x : σ) : Primrec fun _ : α => x

{α : Type u_1}
{σ : Type u_3}
[Primcodable α]
[Primcodable σ]
(x : σ)


theorem contDiff_apply_apply (i : ι) (j : ι') : ContDiff 𝕜 n fun f : ι → ι' → E => f i j

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(E : Type uE)
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{n : ℕ∞}
{ι : Type u_3}
{ι' : Type u_4}
[Fintype ι]
[Fintype ι']
(i : ι)
(j : ι')


@[simp]
theorem exponent_multiplicative {G : Type*} [AddMonoid G] :
    exponent (Multiplicative G) = AddMonoid.exponent G

Monoid.exponent (Multiplicative G) = AddMonoid.exponent G


theorem le_map_sup_fixedPoints (x y : fixedPoints f) : (x ⊔ y : α) ≤ f (x ⊔ y)

{α : Type u}
[CompleteLattice α]
(f : α →o α)
(x y : ↑(Function.fixedPoints ⇑f))

↑x ⊔ ↑y ≤ f (↑x ⊔ ↑y)


@[simp] theorem lt_eq : Nat.lt x y = (x < y)


/-- Given a MonoidHom `f : M →* N` and Submonoid `S ⊆ M` such that `f(S) ⊆ Nˣ`, for all
`w, z : N` and `y ∈ S`, we have `w * (f y)⁻¹ = z ↔ w = f y * z`. -/
@[to_additive
    "Given an AddMonoidHom `f : M →+ N` and Submonoid `S ⊆ M` such that
`f(S) ⊆ AddUnits N`, for all `w, z : N` and `y ∈ S`, we have `w - f y = z ↔ w = f y + z`."]
theorem mul_inv_left {f : M →* N} (h : ∀ y : S, IsUnit (f y)) (y : S) (w z : N) :
    w * (IsUnit.liftRight (f.restrict S) h y)⁻¹ = z ↔ w = f y * z

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{f : M →+ N}
(h : ∀ (y : ↥S), IsAddUnit (f ↑y))
(y : ↥S)
(w z : N)

w + ↑(-(IsAddUnit.liftRight (f.restrict S) h) y) = z ↔ w = f ↑y + z


theorem cos_arg {x : ℂ} (hx : x ≠ 0) : Real.cos (arg x) = x.re / abs x


@[simp]
theorem support_nsmul (k : ℕ) (h : k ≠ 0) (a : FreeAbelianGroup X) :
    support (k • a) = support a

{X : Type u_1}
(k : ℕ)
(h : k ≠ 0)
(a : FreeAbelianGroup X)


theorem toCone_π_app_mk (B : Bicone F) (j : J) : B.toCone.π.app ⟨j⟩ = B.π j


theorem star_eq_inv (U : unitary R) : star U = U⁻¹

{R : Type u_1}
[Monoid R]
[StarMul R]
(U : ↥(unitary R))


@[to_additive]
theorem map_div (hf : IsGroupHom f) (a b : α) : f (a / b) = f a / f b

{α : Type u}
{β : Type v}
[Group α]
[Group β]
{f : α → β}
(hf : IsGroupHom f)
(a b : α)


@[simp]
theorem coprime_mul_right_add_left (m n k : ℕ) : Coprime (k * n + m) n ↔ Coprime m n


@[to_additive]
theorem finprod_mem_eq_one_of_infinite {f : α → M} {s : Set α} (hs : (s ∩ mulSupport f).Infinite) :
    ∏ᶠ i ∈ s, f i = 1

(hs : (s ∩ Function.mulSupport f).Infinite)


/-- If an antitone function is continuous at the supremum of a nonempty bounded above set `s`,
then it sends this supremum to the infimum of the image of `s`. -/
theorem Antitone.map_csSup_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sSup s))
    (Af : Antitone f) (ne : s.Nonempty) (H : BddAbove s) : f (sSup s) = sInf (f '' s)

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderClosedTopology β]
{f : α → β}
{s : Set α}
(Cf : ContinuousAt f (sSup s))
(Af : Antitone f)
(ne : s.Nonempty)
(H : BddAbove s)


theorem vecMul_neg [Fintype m] (v : m → α) (A : Matrix m n α) : v ᵥ* (-A) = - (v ᵥ* A)

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


theorem nonempty_of_nonempty_iUnion
    {s : ι → Set α} (h_Union : (⋃ i, s i).Nonempty) : Nonempty ι

{α : Type u_1}
{ι : Sort u_4}
{s : ι → Set α}
(h_Union : (⋃ i, s i).Nonempty)


protected theorem map_neg (f : R' →ₑ+*[φ] S') (x : R') : f (-x) = -f x

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
(R' : Type u_11)
[Ring R']
[MulSemiringAction M R']
(S' : Type u_13)
[Ring S']
[MulSemiringAction N S']
(f : R' →ₑ+*[φ] S')
(x : R')


theorem equiv_of_mk_equiv {x y : PGame} (L : x.LeftMoves ≃ y.LeftMoves)
    (R : x.RightMoves ≃ y.RightMoves) (hl : ∀ i, x.moveLeft i ≈ y.moveLeft (L i))
    (hr : ∀ j, x.moveRight j ≈ y.moveRight (R j)) : x ≈ y

(hl : ∀ (i : x.LeftMoves), x.moveLeft i ≈ y.moveLeft (L i))

(hr : ∀ (j : x.RightMoves), x.moveRight j ≈ y.moveRight (R j))


theorem symmetry (X Y : Dial C) :
    (braiding X Y).hom ≫ (braiding Y X).hom = 𝟙 (tensorObj X Y)

CategoryTheory.CategoryStruct.comp (X.braiding Y).hom (Y.braiding X).hom =
  CategoryTheory.CategoryStruct.id (X.tensorObj Y)


theorem nonneg_of_mul_nonpos_right [ExistsAddOfLE α] [MulPosStrictMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    {a b : α} (h : a * b ≤ 0) (ha : a < 0) : 0 ≤ b

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

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


theorem CauchySeq.eventually_eventually [SemilatticeSup β] {u : β → α} (hu : CauchySeq u)
    {V : Set (α × α)} (hV : V ∈ 𝓤 α) : ∀ᶠ k in atTop, ∀ᶠ l in atTop, (u k, u l) ∈ V

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
[SemilatticeSup β]
{u : β → α}
(hu : CauchySeq u)
{V : Set (α × α)}
(hV : V ∈ 𝓤 α)

∀ᶠ (k : β) (l : β) in Filter.atTop, (u k, u l) ∈ V


theorem mem_def (A B : Class.{u}) : A ∈ B ↔ ∃ x : ZFSet, ↑x = A ∧ B x


@[simp] lemma rpow_rpow_inv (hx : 0 ≤ x) (hy : y ≠ 0) : (x ^ y) ^ y⁻¹ = x


@[trans]
theorem IsLittleO.trans_isTheta {f : α → E} {g : α → F} {k : α → G'} (h₁ : f =o[l] g)
    (h₂ : g =Θ[l] k) : f =o[l] k

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
{G' : Type u_8}
[Norm E]
[Norm F]
[SeminormedAddCommGroup G']
{l : Filter α}
{f : α → E}
{g : α → F}
{k : α → G'}
(h₁ : f =o[l] g)
(h₂ : g =Θ[l] k)


@[simp]
theorem coe_inf (p p' : NonUnitalSubsemiring R) :
    ((p ⊓ p' : NonUnitalSubsemiring R) : Set R) = (p : Set R) ∩ p'

{R : Type u}
[NonUnitalNonAssocSemiring R]
(p p' : NonUnitalSubsemiring R)


theorem ne_bot_of_le_ne_bot (hb : b ≠ ⊥) (hab : b ≤ a) : a ≠ ⊥

{α : Type u}
[PartialOrder α]
[OrderBot α]
{a b : α}
(hb : b ≠ ⊥)
(hab : b ≤ a)


theorem image_cast_int_Ioo (a b : ℕ) : (↑) '' Ioo a b = Ioo (a : ℤ) b


@[to_additive (attr := simp)]
theorem coe_of_map_div {H : Type*} [Group H] (f : G → H) (hf : ∀ x y, f (x / y) = f x / f y) :
    ↑(ofMapDiv f hf) = f

(hf : ∀ (x y : G), f (x - y) = f x - f y)


theorem Real.dist_0_eq_abs (x : ℝ) : dist x 0 = |x|


/-- For a functor `G : J ⥤ K ⥤ C`, its colimit `K ⥤ C` is given by `(G' : K ⥤ J ⥤ C) ⋙ colim`.
Note that this does not require `K` to be small.
-/
@[simps!]
def colimitIsoSwapCompColim [HasColimitsOfShape J C] (G : J ⥤ K ⥤ C) :
    colimit G ≅ curry.obj (Prod.swap K J ⋙ uncurry.obj G) ⋙ colim

(CategoryTheory.Limits.colimitIsoSwapCompColim G).hom.app X =
  (CategoryTheory.Limits.colimitObjIsoColimitCompEvaluation G X).hom ≫
    CategoryTheory.Limits.colimMap ((CategoryTheory.flipIsoCurrySwapUncurry G).hom.app X)


theorem isCoseparator_pi_of_isCoseparator {β : Type w} (f : β → C) [HasProduct f] (b : β)
    (hb : IsCoseparator (f b)) : IsCoseparator (∏ᶜ f)

(hb : CategoryTheory.IsCoseparator (f b))


nonrec theorem abs_of_nonneg {r : ℝ} (h : 0 ≤ r) : Complex.abs r = r


theorem filter_fst_eq_antidiagonal (n m : A) [DecidablePred (· = m)] [Decidable (m ≤ n)] :
    filter (fun x : A × A ↦ x.fst = m) (antidiagonal n) = if m ≤ n then {(m, n - m)} else ∅

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

Finset.filter (fun x => x.1 = m) (Finset.antidiagonal n) = if m ≤ n then {(m, n - m)} else ∅


/-- The ring isomorphism between multivariable polynomials in no variables
and the ground ring. -/
@[simps!]
def isEmptyRingEquiv [IsEmpty σ] : MvPolynomial σ R ≃+* R

(R : Type u)
(σ : Type u_1)
[CommSemiring R]
[IsEmpty σ]
(a : MvPolynomial σ R)

(MvPolynomial.isEmptyRingEquiv R σ) a = (MvPolynomial.aeval fun a => inst✝.elim a) a


theorem map_one_snd_of_isTwoCocycle {f : G × G → A} (hf : IsTwoCocycle f) (g : G) :
    f (g, 1) = g • f (1, 1)

{G : Type u_1}
{A : Type u_2}
[Monoid G]
[AddCommGroup A]
[MulAction G A]
{f : G × G → A}
(hf : groupCohomology.IsTwoCocycle f)
(g : G)


/-- Let `f, g` be monic polynomials over `K`. If `f` is irreducible, and `g(x) - α` is irreducible
in `K⟮α⟯` with `α` a root of `f`, then `f(g(x))` is irreducible. -/
theorem _root_.Polynomial.irreducible_comp {f g : K[X]} (hfm : f.Monic) (hgm : g.Monic)
    (hf : Irreducible f)
    (hg : ∀ (E : Type u) [Field E] [Algebra K E] (x : E) (hx : minpoly K x = f),
      Irreducible (g.map (algebraMap _ _) - C (AdjoinSimple.gen K x))) :
    Irreducible (f.comp g)

(hg :
  ∀ (E : Type u) [inst : Field E] [inst_1 : Algebra K E] (x : E),
    minpoly K x = f →
      Irreducible (Polynomial.map (algebraMap K ↥K⟮x⟯) g - Polynomial.C (IntermediateField.AdjoinSimple.gen K x)))


theorem nsmul_singleton (a : α) (n) : n • ({a} : Multiset α) = replicate n a


lemma congr_φQ {γ₁ γ₂ : RightHomologyMapData φ h₁ h₂} (eq : γ₁ = γ₂) : γ₁.φQ = γ₂.φQ

{γ₁ γ₂ : CategoryTheory.ShortComplex.RightHomologyMapData φ h₁ h₂}

γ₁.φQ = γ₂.φQ


@[to_additive uniformContinuous_nnnorm]
theorem uniformContinuous_nnnorm' : UniformContinuous fun a : E => ‖a‖₊


theorem aemeasurable_withDensity_ennreal_iff {f : α → ℝ≥0} (hf : Measurable f) {g : α → ℝ≥0∞} :
    AEMeasurable g (μ.withDensity fun x => (f x : ℝ≥0∞)) ↔
      AEMeasurable (fun x => (f x : ℝ≥0∞) * g x) μ

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

AEMeasurable g (μ.withDensity fun x => ↑(f x)) ↔ AEMeasurable (fun x => ↑(f x) * g x) μ


@[simp]
theorem log_eq_zero {x : ℝ} : log x = 0 ↔ x = 0 ∨ x = 1 ∨ x = -1


/-- An alternative statement of Weierstrass' theorem.

Every real-valued continuous function on `[a,b]` is a uniform limit of polynomials.
-/
theorem continuousMap_mem_polynomialFunctions_closure (a b : ℝ) (f : C(Set.Icc a b, ℝ)) :
    f ∈ (polynomialFunctions (Set.Icc a b)).topologicalClosure


theorem map_div {R : Type*} [DivisionRing R] (v : Valuation R Γ₀) : ∀ x y, v (x / y) = v x / v y

{Γ₀ : Type u_4}
[LinearOrderedCommGroupWithZero Γ₀]
{R : Type u_7}
[DivisionRing R]
(v : Valuation R Γ₀)
(x y : R)


theorem integrable_zero : Integrable I l (fun _ => (0 : E)) vol

{ι : 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.Integrable I l (fun x => 0) vol


@[simp]
theorem sInf_adj {s : Set G.Subgraph} : (sInf s).Adj a b ↔ (∀ G' ∈ s, Adj G' a b) ∧ G.Adj a b

{V : Type u}
{G : SimpleGraph V}
{a b : V}
{s : Set G.Subgraph}

(sInf s).Adj a b ↔ (∀ G' ∈ s, G'.Adj a b) ∧ G.Adj a b


lemma comp_isLocallyInjective_iff
    {F₁ F₂ F₃ : Cᵒᵖ ⥤ A} (f₁ : F₁ ⟶ F₂) (f₂ : F₂ ⟶ F₃)
    [IsLocallyInjective J f₁] [IsLocallySurjective J f₁] :
    IsLocallyInjective J (f₁ ≫ f₂) ↔ IsLocallyInjective J f₂

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.Presheaf.IsLocallyInjective J (f₁ ≫ f₂) ↔ CategoryTheory.Presheaf.IsLocallyInjective J f₂


@[to_additive (attr := simp)]
theorem map_equiv_top (f : M ≃* N) : (⊤ : Submonoid M).map f = ⊤

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(f : M ≃+ N)


@[simp]
theorem biUnion_and (p : ι → Prop) (q : ι → ι' → Prop) (s : ∀ x y, p x ∧ q x y → Set α) :
    ⋃ (x : ι) (y : ι') (h : p x ∧ q x y), s x y h =
      ⋃ (x : ι) (hx : p x) (y : ι') (hy : q x y), s x y ⟨hx, hy⟩

(s : (x : ι) → (y : ι') → p x ∧ q x y → Set α)

⋃ x, ⋃ y, ⋃ (h : p x ∧ q x y), s x y h = ⋃ x, ⋃ (hx : p x), ⋃ y, ⋃ (hy : q x y), s x y ⋯


@[simp]
theorem tendsto_comap_iff {f : α → β} {g : β → γ} {a : Filter α} {c : Filter γ} :
    Tendsto f a (c.comap g) ↔ Tendsto (g ∘ f) a c

{α : Type u}
{β : Type v}
{γ : Type w}
{f : α → β}
{g : β → γ}
{a : Filter α}
{c : Filter γ}

Filter.Tendsto f a (Filter.comap g c) ↔ Filter.Tendsto (g ∘ f) a c


/-- The symmetric product of vectors is a scalar -/
theorem ι_mul_ι_add_swap (a b : M) :
    ι Q a * ι Q b + ι Q b * ι Q a = algebraMap R _ (QuadraticMap.polar Q a b)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(a b : M)

(CliffordAlgebra.ι Q) a * (CliffordAlgebra.ι Q) b + (CliffordAlgebra.ι Q) b * (CliffordAlgebra.ι Q) a =
  (algebraMap R (CliffordAlgebra Q)) (QuadraticMap.polar (⇑Q) a b)


/-- `LocallyConstant.comap` as a `MonoidHom`. -/
@[to_additive (attr := simps) "`LocallyConstant.comap` as an `AddMonoidHom`."]
def comapMonoidHom [MulOneClass Z]  (f : C(X, Y)) :
    LocallyConstant Y Z →* LocallyConstant X Z

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{Z : Type u_6}
[AddZeroClass Z]
(f : C(X, Y))
(g : LocallyConstant Y Z)

(LocallyConstant.comapAddMonoidHom f) g = LocallyConstant.comap f g


@[simp]
theorem equiv'_apply (f : M → M') (g : M' → M) (hf hg hgf hfg) (i : ι) :
    b.equiv' b' f g hf hg hgf hfg (b i) = f (b i)

(hf : ∀ (i : ι), f (b i) ∈ Set.range ⇑b')

(hg : ∀ (i : ι'), g (b' i) ∈ Set.range ⇑b)

(b.equiv' b' f g hf hg hgf hfg) (b i) = f (b i)


theorem _root_.LieSubalgebra.isNilpotent_ad_of_isNilpotent_ad {L : Type v} [LieRing L]
    [LieAlgebra R L] (K : LieSubalgebra R L) {x : K} (h : IsNilpotent (LieAlgebra.ad R L ↑x)) :
    IsNilpotent (LieAlgebra.ad R K x)

(h : IsNilpotent ((LieAlgebra.ad R L) ↑x))


theorem Antiperiodic.nat_mul_sub_eq [Ring α] [Ring β] (h : Antiperiodic f c) (n : ℕ) :
    f (n * c - x) = (-1) ^ n * f (-x)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c x : α}
[Ring α]
[Ring β]
(h : Function.Antiperiodic f c)
(n : ℕ)


protected theorem isCompact (n : ℕ) : IsCompact (K n)

{X : Type u_1}
[TopologicalSpace X]
(K : CompactExhaustion X)
(n : ℕ)


protected lemma inv_inv (ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a⁻¹.IsConjExponent b⁻¹


theorem Filter.Tendsto.exists_forall_ge [Nonempty α] [LinearOrder β] {f : α → β}
    (hf : Tendsto f cofinite atBot) : ∃ a₀, ∀ a, f a ≤ f a₀

(hf : Filter.Tendsto f Filter.cofinite Filter.atBot)


@[to_additive (attr := simp)]
theorem quotientSubgroupOfMapOfLE_apply_mk (H : Subgroup α) (h : s ≤ t) (g : H) :
    quotientSubgroupOfMapOfLE H h (QuotientGroup.mk g) =
      (QuotientGroup.mk g : { x // x ∈ H } ⧸ subgroupOf t H)

{α : Type u_1}
[Group α]
{s t : Subgroup α}
(H : Subgroup α)
(h : s ≤ t)
(g : ↥H)

Subgroup.quotientSubgroupOfMapOfLE H h ↑g = ↑g


@[simp]
theorem ordConnectedComponent_mem_nhds : ordConnectedComponent s a ∈ 𝓝 a ↔ s ∈ 𝓝 a

{X : Type u_1}
[LinearOrder X]
[TopologicalSpace X]
[OrderTopology X]
{a : X}
{s : Set X}

s.ordConnectedComponent a ∈ 𝓝 a ↔ s ∈ 𝓝 a


/-- Given `F : WalkingCospan ⥤ C`, which is really the same as `cospan (F.map inl) (F.map inr)`,
    and a cone on `F`, we get a pullback cone on `F.map inl` and `F.map inr`. -/
@[simps]
def PullbackCone.ofCone {F : WalkingCospan ⥤ C} (t : Cone F) :
    PullbackCone (F.map inl) (F.map inr)

{F : CategoryTheory.Limits.WalkingCospan ⥤ C}

(CategoryTheory.Limits.PullbackCone.ofCone t).π = t.π ≫ (CategoryTheory.Limits.diagramIsoCospan F).hom


theorem splitOnP_ne_nil (xs : List α) : xs.splitOnP p ≠ []

{α : Type u}
(p : α → Bool)
(xs : List α)


theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2

{V : Type u_3}
{W : Type u_4}
[Nonempty V]
[Nonempty W]


theorem forall_imp_iff_exists_imp {α : Sort*} {p : α → Prop} {b : Prop} [ha : Nonempty α] :
    (∀ x, p x) → b ↔ ∃ x, p x → b

{α : Sort u_3}
{p : α → Prop}
{b : Prop}
[ha : Nonempty α]


theorem generateFrom_iUnion {f : ι → Set (Set α)} :
    generateFrom (⋃ i, f i) = ⨅ i, generateFrom (f i)

{α : Type u}
{ι : Sort v}
{f : ι → Set (Set α)}

TopologicalSpace.generateFrom (⋃ i, f i) = ⨅ i, TopologicalSpace.generateFrom (f i)


@[simp]
theorem ofSubsingleton_self : ofSubsingleton M M = refl R M

{R : Type u_1}
(M : Type u_8)
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Subsingleton M]

LinearEquiv.ofSubsingleton M M = LinearEquiv.refl R M


@[to_additive]
theorem op_smul_set_smul_eq_smul_smul_set (a : α) (s : Set β) (t : Set γ)
    (h : ∀ (a : α) (b : β) (c : γ), (op a • b) • c = b • a • c) : (op a • s) • t = s • a • t

(h : ∀ (a : α) (b : β) (c : γ), (MulOpposite.op a • b) • c = b • a • c)


theorem lintegral_const_mul_le (r : ℝ≥0∞) (f : α → ℝ≥0∞) :
    r * ∫⁻ a, f a ∂μ ≤ ∫⁻ a, r * f a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(r : ℝ≥0∞)
(f : α → ℝ≥0∞)

r * ∫⁻ (a : α), f a ∂μ ≤ ∫⁻ (a : α), r * f a ∂μ


theorem Poly.denote_fuse (ctx : Context) (p : Poly) : p.fuse.denote ctx = p.denote ctx

(ctx : Nat.Linear.Context)
(p : Nat.Linear.Poly)

Nat.Linear.Poly.denote ctx p.fuse = Nat.Linear.Poly.denote ctx p


@[simp]
theorem Fintype.card_set [Fintype α] : Fintype.card (Set α) = 2 ^ Fintype.card α


{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
{c : E}
(f : ContDiffBump c)
{x : E}


/-- Auxiliary lemma used as an argument to `CliffordAlgebra.changeForm` -/
theorem changeForm.zero_proof : (0 : BilinForm R M).toQuadraticMap = Q - Q

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}

LinearMap.BilinMap.toQuadraticMap 0 = Q - Q


lemma IsSelfAdjoint.toReal_spectralRadius_eq_norm {a : A} (ha : IsSelfAdjoint a) :
    (spectralRadius ℝ a).toReal = ‖a‖

{A : Type u_1}
[NormedRing A]
[StarRing A]
[CstarRing A]
[CompleteSpace A]
[NormedAlgebra ℂ A]
[StarModule ℂ A]
{a : A}
(ha : IsSelfAdjoint a)


@[simp]
theorem bind_bind : (p.bind f).bind g = p.bind fun a => (f a).bind g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(p : PMF α)
(f : α → PMF β)
(g : β → PMF γ)


/-- An isomorphism of differential objects gives an isomorphism of the underlying objects. -/
@[simps]
def isoApp {X Y : DifferentialObject S C} (f : X ≅ Y) : X.obj ≅ Y.obj

{X Y : CategoryTheory.DifferentialObject S C}

(CategoryTheory.DifferentialObject.isoApp f).inv = f.inv.f


theorem _root_.Ideal.torsionOf_eq_span_pow_pOrder (x : M) :
    torsionOf R M x = span {p ^ pOrder hM x}

(hM : Module.IsTorsion' M ↥(Submonoid.powers p))

Ideal.torsionOf R M x = Ideal.span {p ^ Submodule.pOrder hM x}


theorem MDifferentiableWithinAt.hasMFDerivWithinAt (h : MDifferentiableWithinAt I I' f s x) :
    HasMFDerivWithinAt I I' f s x (mfderivWithin I I' f s x)


/-- `M.toNFA` is an `NFA` constructed from a `DFA` `M` by using the same start and accept
  states and a transition function which sends `s` with input `a` to the singleton `M.step s a`. -/
@[simps] def toNFA (M : DFA α σ') : NFA α σ'

{α : Type u}
{σ' : Type v}
(M : DFA α σ')


/-- The L-series of the convolution product `f ⍟ g` of two sequences `f` and `g`
equals the product of their L-series in their common half-plane of absolute convergence. -/
lemma LSeries_convolution {f g : ℕ → ℂ} {s : ℂ}
    (hf : abscissaOfAbsConv f < s.re) (hg : abscissaOfAbsConv g < s.re) :
    LSeries (f ⍟ g) s = LSeries f s * LSeries g s

(hf : LSeries.abscissaOfAbsConv f < ↑s.re)

(hg : LSeries.abscissaOfAbsConv g < ↑s.re)


/-- To apply Arzela-Ascoli, we need to check that the set of candidates is closed and
equicontinuous. Equicontinuity follows from the Lipschitz control, we check closedness. -/
private theorem closed_candidatesB : IsClosed (candidatesB X Y)

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

IsClosed (GromovHausdorff.candidatesB X Y)


theorem slt_eq_not_carry (x y : BitVec w) :
    x.slt y = (x.msb == y.msb).xor (carry w x (~~~y) true)

x.slt y = (x.msb == y.msb).xor (BitVec.carry w x (~~~y) true)


theorem lie_of_of_ne [DecidableEq ι] {i j : ι} (hij : i ≠ j) (x : L i) (y : L j) :
    ⁅of L i x, of L j y⁆ = 0

{ι : Type v}
(L : ι → Type w)
[(i : ι) → LieRing (L i)]
[DecidableEq ι]
{i j : ι}
(hij : i ≠ j)
(x : L i)
(y : L j)

⁅(DirectSum.of L i) x, (DirectSum.of L j) y⁆ = 0


@[to_additive]
theorem mul_ne_mul_right (a : G) {b c : G} : a * b ≠ a * c ↔ b ≠ c

{G : Type u_3}
[Add G]
[IsLeftCancelAdd G]
(a : G)
{b c : G}


@[norm_cast] lemma cast_divNat_of_ne_zero (a : ℕ) {b : ℕ} (hb : (b : α) ≠ 0) :
    divNat a b = (a / b : α)

{α : Type u_3}
[DivisionSemiring α]
(a : ℕ)
{b : ℕ}
(hb : ↑b ≠ 0)


lemma norm_jacobiTheta₂_term_fderiv_ge (n : ℤ) (z τ : ℂ) :
    π * |n| ^ 2 * ‖jacobiTheta₂_term n z τ‖ ≤ ‖jacobiTheta₂_term_fderiv n z τ‖

π * ↑|n| ^ 2 * ‖jacobiTheta₂_term n z τ‖ ≤ ‖jacobiTheta₂_term_fderiv n z τ‖


/-- Every topological group in which there exists a compact set with nonempty interior
is locally compact. -/
@[to_additive
  "Every topological additive group
  in which there exists a compact set with nonempty interior is locally compact."]
theorem TopologicalSpace.PositiveCompacts.locallyCompactSpace_of_group
    (K : PositiveCompacts G) : LocallyCompactSpace G

(K : TopologicalSpace.PositiveCompacts G)


@[simp]
theorem refl_apply (x : α) : OrderRingIso.refl α x = x

(α : Type u_2)
[Mul α]
[Add α]
[LE α]
(x : α)


@[ext]
theorem hom_ext {F₁ F₂ : FreeLieAlgebra R X →ₗ⁅R⁆ L} (h : ∀ x, F₁ (of R x) = F₂ (of R x)) :
    F₁ = F₂

(h : ∀ (x : X), F₁ (FreeLieAlgebra.of R x) = F₂ (FreeLieAlgebra.of R x))


/-- `ContinuousMap.compStarAlgHom` is functorial. -/
lemma compStarAlgHom_comp (φ : A →⋆ₐ[𝕜] B) (ψ : B →⋆ₐ[𝕜] C) (hφ : Continuous φ)
    (hψ : Continuous ψ) : compStarAlgHom X (ψ.comp φ) (hψ.comp hφ) =
      (compStarAlgHom X ψ hψ).comp (compStarAlgHom X φ hφ)

(X : Type u_1)
{𝕜 : Type u_2}
{A : Type u_3}
{B : Type u_4}
{C : Type u_5}
[TopologicalSpace X]
[CommSemiring 𝕜]
[TopologicalSpace A]
[Semiring A]
[TopologicalSemiring A]
[Star A]
[ContinuousStar A]
[Algebra 𝕜 A]
[TopologicalSpace B]
[Semiring B]
[TopologicalSemiring B]
[Star B]
[ContinuousStar B]
[Algebra 𝕜 B]
[TopologicalSpace C]
[Semiring C]
[TopologicalSemiring C]
[Star C]
[ContinuousStar C]
[Algebra 𝕜 C]
(φ : A →⋆ₐ[𝕜] B)
(ψ : B →⋆ₐ[𝕜] C)
(hφ : Continuous ⇑φ)
(hψ : Continuous ⇑ψ)

ContinuousMap.compStarAlgHom X (ψ.comp φ) ⋯ =
  (ContinuousMap.compStarAlgHom X ψ hψ).comp (ContinuousMap.compStarAlgHom X φ hφ)


/-- A `NormedLinearOrderedField` is a field that is both a `NormedField` and a
    `LinearOrderedField`. This class is necessary to avoid diamonds. -/
class NormedLinearOrderedField (α : Type*) extends LinearOrderedField α, Norm α,
  MetricSpace α where
  /-- The distance function is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = ‖x - y‖ := by aesop
  /-- The norm is multiplicative. -/
  norm_mul' : ∀ x y : α, ‖x * y‖ = ‖x‖ * ‖y‖

{α : Type u_2}
[self : NormedLinearOrderedField α]
(x y : α)


/-- The type of open subgroups of a topological additive group. -/
structure OpenAddSubgroup (G : Type*) [AddGroup G] [TopologicalSpace G] extends AddSubgroup G where
  isOpen' : IsOpen carrier

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
(self : OpenAddSubgroup G)


theorem pow_expChar_pow_inj_of_pNilradical_eq_bot (R : Type*) [CommRing R] (p : ℕ) [ExpChar R p]
    (h : pNilradical R p = ⊥) (n : ℕ) : Function.Injective fun x : R ↦ x ^ p ^ n

(R : Type u_1)
[CommRing R]
(p : ℕ)
[ExpChar R p]
(h : pNilradical R p = ⊥)
(n : ℕ)


@[simp]
theorem quotQuotEquivComm_comp_quotQuotMkₐ :
    AlgHom.comp (↑(quotQuotEquivCommₐ R I J)) (quotQuotMkₐ R I J) = quotQuotMkₐ R J I

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(I J : Ideal A)

(↑(DoubleQuot.quotQuotEquivCommₐ R I J)).comp (DoubleQuot.quotQuotMkₐ R I J) = DoubleQuot.quotQuotMkₐ R J I


theorem Countable.biUnion_iff {s : Set α} {t : ∀ a ∈ s, Set β} (hs : s.Countable) :
    (⋃ a ∈ s, t a ‹_›).Countable ↔ ∀ a (ha : a ∈ s), (t a ha).Countable

{α : Type u}
{β : Type v}
{s : Set α}
{t : (a : α) → a ∈ s → Set β}
(hs : s.Countable)

(⋃ a, ⋃ (h : a ∈ s), t a h).Countable ↔ ∀ (a : α) (ha : a ∈ s), (t a ha).Countable


@[simp]
theorem powerset_mono {s t : Finset α} : powerset s ⊆ powerset t ↔ s ⊆ t


@[to_additive] lemma self_zpow : Commute a (a ^ n)

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


/-- Auxiliary lemma for `sheafCompose_reflects_discrete`. -/
private lemma sheafifyComposeIso_comp_sheafCompose_map_constantSheafAdj_counit :
  (sheafifyComposeIso J U ((const Cᵒᵖ).obj (F.val.obj { unop := t }))).hom ≫
    ((sheafCompose J U).map ((constantSheafAdj J A ht).counit.app F)).val =
      ((presheafToSheaf J B ⋙ sheafToPresheaf J B).mapIso (constComp Cᵒᵖ _ U)).hom ≫
        ((constantSheafAdj J B ht).counit.app ((sheafCompose J U).obj F)).val

(J : CategoryTheory.GrothendieckTopology C)

(ht : CategoryTheory.Limits.IsTerminal t)

(CategoryTheory.sheafifyComposeIso J U ((CategoryTheory.Functor.const Cᵒᵖ).obj (F.val.obj (Opposite.op t)))).hom ≫
    ((CategoryTheory.sheafCompose J U).map ((CategoryTheory.constantSheafAdj J A ht).counit.app F)).val =
  ((CategoryTheory.presheafToSheaf J B ⋙ CategoryTheory.sheafToPresheaf J B).mapIso
        (CategoryTheory.Functor.constComp Cᵒᵖ (F.val.obj (Opposite.op t)) U)).hom ≫
    ((CategoryTheory.constantSheafAdj J B ht).counit.app ((CategoryTheory.sheafCompose J U).obj F)).val


/-- The exponential in a Banach algebra `𝔸` over a normed field `𝕂` has strict Fréchet derivative
`1 : 𝔸 →L[𝕂] 𝔸` at zero, as long as it converges on a neighborhood of zero. -/
theorem hasStrictFDerivAt_exp_zero_of_radius_pos (h : 0 < (expSeries 𝕂 𝔸).radius) :
    HasStrictFDerivAt (exp 𝕂) (1 : 𝔸 →L[𝕂] 𝔸) 0

(h : 0 < (NormedSpace.expSeries 𝕂 𝔸).radius)

HasStrictFDerivAt (NormedSpace.exp 𝕂) 1 0


theorem eraseLead_natDegree_le_aux : (eraseLead f).natDegree ≤ f.natDegree


theorem Valid'.glue_aux {l r o₁ o₂} (hl : Valid' o₁ l o₂) (hr : Valid' o₁ r o₂)
    (sep : l.All fun x => r.All fun y => x < y) (bal : BalancedSz (size l) (size r)) :
    Valid' o₁ (@glue α l r) o₂ ∧ size (glue l r) = size l + size r

(sep : Ordnode.All (fun x => Ordnode.All (fun y => x < y) r) l)

(bal : Ordnode.BalancedSz l.size r.size)

Ordnode.Valid' o₁ (l.glue r) o₂ ∧ (l.glue r).size = l.size + r.size


theorem _root_.Filter.EventuallyEq.isBigO {f₁ f₂ : α → E} (hf : f₁ =ᶠ[l] f₂) : f₁ =O[l] f₂

{α : Type u_1}
{E : Type u_3}
[Norm E]
{l : Filter α}
{f₁ f₂ : α → E}
(hf : f₁ =ᶠ[l] f₂)


@[reassoc (attr := simp)]
theorem biproduct.fromSubtype_π [DecidablePred p] (j : J) :
    biproduct.fromSubtype f p ≫ biproduct.π f j =
      if h : p j then biproduct.π (Subtype.restrict p f) ⟨j, h⟩ else 0

[CategoryTheory.Limits.HasBiproduct (Subtype.restrict p f)]

CategoryTheory.Limits.biproduct.fromSubtype f p ≫ CategoryTheory.Limits.biproduct.π f j =
  if h : p j then CategoryTheory.Limits.biproduct.π (Subtype.restrict p f) ⟨j, h⟩ else 0


theorem pwFilter_map [DecidableRel (α := α) R] (f : β → α) :
    ∀ l : List β, pwFilter R (map f l) = map f (pwFilter (fun x y => R (f x) (f y)) l)

{α : Type u_1}
{R : α → α → Prop}
{β : Type u_2}
[DecidableRel R]
(f : β → α)
(l : List β)

List.pwFilter R (List.map f l) = List.map f (List.pwFilter (fun x y => R (f x) (f y)) l)


theorem integral_sub' {f g : α → G} (hf : Integrable f μ) (hg : Integrable g μ) :
    ∫ a, (f - g) a ∂μ = ∫ a, f a ∂μ - ∫ a, g a ∂μ

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

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


@[simp]
theorem range_fst : (fst R S).rangeS = ⊤

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]


theorem cmpLT.trans_l {cmp x y} (H : cmpLT cmp x y) {t : RBNode α}
    (h : t.All (cmpLT cmp y ·)) : t.All (cmpLT cmp x ·)

(h : Batteries.RBNode.All (fun x => Batteries.RBNode.cmpLT cmp y x) t)

Batteries.RBNode.All (fun x_1 => Batteries.RBNode.cmpLT cmp x x_1) t


theorem smul_eq_lsmul_rTensor (a : A) (x : M ⊗[R] N) : a • x = (lsmul R R M a).rTensor N x

{R : Type uR}
{A : Type uA}
{M : Type uM}
{N : Type uN}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]
(a : A)
(x : TensorProduct R M N)

a • x = (LinearMap.rTensor N ((Algebra.lsmul R R M) a)) x


/-- `Function.const` as a `RingHom`. -/
@[simps]
def Pi.constRingHom (α β : Type*) [NonAssocSemiring β] : β →+* α → β

(α : Type u_1)
(β : Type u_2)
[NonAssocSemiring β]
(a : β)

∀ (a_1 : α), (Pi.constRingHom α β) a a_1 = Function.const α a a_1


@[simp] theorem getMsb_zeroExtend_add {x : BitVec w} (h : k ≤ i) :
    (x.zeroExtend (w + k)).getMsb i = x.getMsb (i - k)

{w k i : Nat}
{x : BitVec w}
(h : k ≤ i)

(BitVec.zeroExtend (w + k) x).getMsb i = x.getMsb (i - k)


@[fun_prop]
theorem hasFDerivAt_snd : HasFDerivAt (@Prod.snd E F) (snd 𝕜 E F) p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : E × F}

HasFDerivAt Prod.snd (ContinuousLinearMap.snd 𝕜 E F) p


/-- Reverse of `Set.codRestrict_restrict`. -/
theorem MapsTo.restrict_eq_codRestrict (h : MapsTo f s t) :
    h.restrict f s t = codRestrict (s.restrict f) t fun x => h x.2

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

Set.MapsTo.restrict f s t h = Set.codRestrict (s.restrict f) t ⋯


@[simp] theorem natAbs_mul_self' (a : Int) : (natAbs a * natAbs a : Int) = a * a


@[simp]
theorem lift_root : lift i a h (root f) = a

{R : Type u}
{S : Type v}
[CommRing R]
{f : R[X]}
[CommRing S]
{i : R →+* S}
{a : S}
(h : Polynomial.eval₂ i a f = 0)

(AdjoinRoot.lift i a h) (AdjoinRoot.root f) = a


/--
The categorical product of rings is the cartesian product of rings. This is its `Fan`.
-/
@[simps! pt]
def piFan : Fan R

(CommRingCat.piFan R).pt = CommRingCat.of ((i : ι) → ↑(R i))


@[simp]
theorem add_apply (f g : ModularForm Γ k) (z : ℍ) : (f + g) z = f z + g z

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f g : ModularForm Γ k)
(z : ℍ)


theorem inter_mem_inf {α : Type u} {f g : Filter α} {s t : Set α} (hs : s ∈ f) (ht : t ∈ g) :
    s ∩ t ∈ f ⊓ g


theorem Perm.kreplace {a : α} {b : β a} {l₁ l₂ : List (Sigma β)} (nd : l₁.NodupKeys) :
    l₁ ~ l₂ → kreplace a b l₁ ~ kreplace a b l₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{l₁ l₂ : List (Sigma β)}
(nd : l₁.NodupKeys)

l₁.Perm l₂ → (List.kreplace a b l₁).Perm (List.kreplace a b l₂)


@[simp]
theorem sepDegree_self : sepDegree F F = 1


theorem of_iUnion_nonneg {M : Type*} [TopologicalSpace M] [OrderedAddCommMonoid M]
    [OrderClosedTopology M] {v : VectorMeasure α M} (hf₁ : ∀ i, MeasurableSet (f i))
    (hf₂ : Pairwise (Disjoint on f)) (hf₃ : ∀ i, 0 ≤ v (f i)) : 0 ≤ v (⋃ i, f i)

{α : Type u_1}
{m : MeasurableSpace α}
{f : ℕ → Set α}
{M : Type u_4}
[TopologicalSpace M]
[OrderedAddCommMonoid M]
[OrderClosedTopology M]
{v : MeasureTheory.VectorMeasure α M}
(hf₁ : ∀ (i : ℕ), MeasurableSet (f i))
(hf₂ : Pairwise (Disjoint on f))
(hf₃ : ∀ (i : ℕ), 0 ≤ ↑v (f i))


@[simp]
theorem map_add : (I + J).map g = I.map g + J.map g

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{P' : Type u_3}
[CommRing P']
[Algebra R P']
(I J : FractionalIdeal S P)
(g : P →ₐ[R] P')

FractionalIdeal.map g (I + J) = FractionalIdeal.map g I + FractionalIdeal.map g J


theorem tendsto_const_mul_pow_atBot_iff {c : α} {n : ℕ} :
    Tendsto (fun x => c * x ^ n) atTop atBot ↔ n ≠ 0 ∧ c < 0

{α : Type u_3}
[LinearOrderedField α]
{c : α}
{n : ℕ}

Filter.Tendsto (fun x => c * x ^ n) Filter.atTop Filter.atBot ↔ n ≠ 0 ∧ c < 0


theorem linearIndependent_iff_range : LinearIndependent ℤ (GoodProducts.eval C) ↔
    LinearIndependent ℤ (fun (p : range C) ↦ p.1)

{I : Type u}
[LinearOrder I]
(C : Set (I → Bool))

LinearIndependent ℤ (Profinite.NobelingProof.GoodProducts.eval C) ↔
  LinearIndependent ℤ fun (p : ↑(Profinite.NobelingProof.GoodProducts.range C)) => ↑p


theorem exists_subset_or_subset_of_two_mul_lt_ncard {n : ℕ} (hst : 2 * n < (s ∪ t).ncard) :
    ∃ r : Set α, n < r.ncard ∧ (r ⊆ s ∨ r ⊆ t)

{α : Type u_1}
{s t : Set α}
{n : ℕ}
(hst : 2 * n < (s ∪ t).ncard)


/-- The natural `ℝ`-linear equivalence between `selfAdjoint ℂ` and `ℝ`. -/
@[simps apply symm_apply]
def Complex.selfAdjointEquiv : selfAdjoint ℂ ≃ₗ[ℝ] ℝ


@[simp]
theorem coe_sub : ⇑(f - g) = f - g

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[AddGroup β]
[TopologicalAddGroup β]
(f g : α →C_c β)


/-- Pull a subgroup back to an opposite subgroup along `MulOpposite.unop`-/
@[to_additive (attr := simps)
"Pull an additive subgroup back to an opposite additive subgroup along `AddOpposite.unop`"]
protected def op (H : Subgroup G) : Subgroup Gᵐᵒᵖ

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


theorem comp_mem_uniformity_sets {s : Set (α × α)} (hs : s ∈ 𝓤 α) : ∃ t ∈ 𝓤 α, t ○ t ⊆ s

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

∃ t ∈ 𝓤 α, t ○ t ⊆ s


@[simp]
theorem map_pow : ∀ (x : R) (n : ℕ), v (x ^ n) = n • (v x)

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedAddCommMonoidWithTop Γ₀]
(v : AddValuation R Γ₀)
(x : R)
(n : ℕ)


/-- By assumption, for each `c : CU P` there exists an open set `u`
such that `c.C ⊆ u` and `closure u ⊆ c.U`. `c.left` is the pair `(c.C, u)`. -/
@[simps C]
def left (c : CU P) : CU P

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


theorem eval_eq_zero_of_dvd_of_eval_eq_zero : p ∣ q → eval x p = 0 → eval x q = 0

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

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


theorem map_natDegree_eq_natDegree {S F : Type*} [Semiring S]
    [FunLike F R[X] S[X]] [AddMonoidHomClass F R[X] S[X]]
    {φ : F} (p) (φ_mon_nat : ∀ n c, c ≠ 0 → (φ (monomial n c)).natDegree = n) :
    (φ p).natDegree = p.natDegree

(φ_mon_nat : ∀ (n : ℕ) (c : R), c ≠ 0 → (φ ((Polynomial.monomial n) c)).natDegree = n)


@[simp]
theorem ofRat_natCast (n : ℕ) : (ofRat n : Cauchy abv) = n

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(n : ℕ)


@[to_additive]
theorem smul_mem_smul : a ∈ s → b ∈ t → a • b ∈ s • t

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


theorem eq_one_of_lt_two {n : ℕ+} : n < 2 → n = 1


lemma skewAdjointPart_eq_I_smul_imaginaryPart (x : A) :
    (skewAdjointPart ℝ x : A) = I • (imaginaryPart x : A)

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]
(x : A)

↑((skewAdjointPart ℝ) x) = Complex.I • ↑(imaginaryPart x)


theorem toCone_eq_sInf : hs.toCone s = sInf { t : ConvexCone 𝕜 E | s ⊆ t }

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)


theorem ContDiffAt.comp' {f : E → F} {g : F → G} (hg : ContDiffAt K n g (f x))
    (hf : ContDiffAt K n f x) : ContDiffAt K n (fun x => g (f x)) x

{K : Type u_1}
[NontriviallyNormedField K]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace K E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace K F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace K G]
{x : E}
{n : ℕ∞}
{f : E → F}
{g : F → G}
(hg : ContDiffAt K n g (f x))
(hf : ContDiffAt K n f x)


theorem idealFactorsEquivOfQuotEquiv_is_dvd_iso {L M : Ideal R} (hL : L ∣ I) (hM : M ∣ I) :
    (idealFactorsEquivOfQuotEquiv f ⟨L, hL⟩ : Ideal A) ∣ idealFactorsEquivOfQuotEquiv f ⟨M, hM⟩ ↔
      L ∣ M

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[IsDedekindDomain A]
{I : Ideal R}
{J : Ideal A}
[IsDedekindDomain R]
(f : R ⧸ I ≃+* A ⧸ J)
{L M : Ideal R}
(hL : L ∣ I)
(hM : M ∣ I)

↑((idealFactorsEquivOfQuotEquiv f) ⟨L, hL⟩) ∣ ↑((idealFactorsEquivOfQuotEquiv f) ⟨M, hM⟩) ↔ L ∣ M


/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m)

(m : Type u → Type u)
[Monad m]
[LawfulMonad m]
(X : CategoryTheory.KleisliCat m)


theorem arcsin_eq_of_sin_eq {x y : ℝ} (h₁ : sin x = y) (h₂ : x ∈ Icc (-(π / 2)) (π / 2)) :
    arcsin y = x

{x y : ℝ}
(h₁ : Real.sin x = y)
(h₂ : x ∈ Set.Icc (-(π / 2)) (π / 2))


@[simp] theorem left_mem_perpBisector : p₁ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ : P}

p₁ ∈ AffineSubspace.perpBisector p₁ p₂ ↔ p₁ = p₂


/-- The graph of `-f` as a pushforward. -/
theorem neg_graph (f : E →ₗ.[R] F) :
    (-f).graph =
    f.graph.map ((LinearMap.id : E →ₗ[R] E).prodMap (-(LinearMap.id : F →ₗ[R] F)))

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

(-f).graph = Submodule.map (LinearMap.id.prodMap (-LinearMap.id)) f.graph


@[simp, norm_cast]
theorem coe_one : ((1 : R) : ℍ[R,c₁,c₂]) = 1


theorem diag_map {f : α → β} {A : Matrix n n α} : diag (A.map f) = f ∘ diag A

{n : Type u_3}
{α : Type v}
{β : Type w}
{f : α → β}
{A : Matrix n n α}


theorem sigmaIsoSigma_hom_ι_apply {ι : Type v} (α : ι → TopCat.{max v u}) (i : ι) (x : α i) :
    (sigmaIsoSigma α).hom ((Sigma.ι α i : _) x) = Sigma.mk i x

{ι : Type v}
(α : ι → TopCat)
(i : ι)
(x : ↑(α i))

(TopCat.sigmaIsoSigma α).hom ((CategoryTheory.Limits.Sigma.ι α i) x) = ⟨i, x⟩


/-- The obvious equivalence of categories `(ShortComplex C)ᵒᵖ ≌ ShortComplex Cᵒᵖ`. -/
@[simps]
def opEquiv : (ShortComplex C)ᵒᵖ ≌ ShortComplex Cᵒᵖ

(CategoryTheory.ShortComplex.opEquiv C).inverse = CategoryTheory.ShortComplex.unopFunctor C


/-- A submonoid `H` of `G` determines a submonoid `H.op` of the opposite group `Gᵐᵒᵖ`. -/
@[to_additive (attr := simps) "A additive submonoid `H` of `G` determines an additive submonoid
`H.op` of the opposite group `Gᵐᵒᵖ`."]
def opEquiv : Submonoid M ≃o Submonoid Mᵐᵒᵖ

{M : Type u_2}
[MulOneClass M]
(x : Submonoid M)


theorem dvd_lcm {b : β} (hb : b ∈ s) : f b ∣ s.lcm f

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f : β → α}
{b : β}
(hb : b ∈ s)


@[simp]
lemma incl_obj (A : PointedGaloisObject F) : (incl F).obj A = A

(F : CategoryTheory.Functor C FintypeCat)

(A : CategoryTheory.PreGaloisCategory.PointedGaloisObject F)

(CategoryTheory.PreGaloisCategory.PointedGaloisObject.incl F).obj A = A.obj


/-- The following diagram commutes:
```text
TruncatedWittVector p n (zmod p) ----> TruncatedWittVector p m (zmod p)
            |                                        |
            |                                        |
            v                                        v
          zmod (p^n) ----------------------------> zmod (p^m)
```
Here the vertical arrows are `(TruncatedWittVector.zmodEquivTrunc p _).symm`,
the horizontal arrow at the top is `ZMod.castHom`,
and the horizontal arrow at the bottom is `TruncatedWittVector.truncate`.
-/
theorem commutes_symm {m : ℕ} (hm : n ≤ m) :
    (zmodEquivTrunc p n).symm.toRingHom.comp (truncate hm) =
      (ZMod.castHom (pow_dvd_pow p hm) _).comp (zmodEquivTrunc p m).symm.toRingHom

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(n : ℕ)
{m : ℕ}
(hm : n ≤ m)

(TruncatedWittVector.zmodEquivTrunc p n).symm.toRingHom.comp (TruncatedWittVector.truncate hm) =
  (ZMod.castHom ⋯ (ZMod (p ^ n))).comp (TruncatedWittVector.zmodEquivTrunc p m).symm.toRingHom


theorem smul_iSup {ι : Sort*} {I : Ideal R} {t : ι → Submodule R M} : I • iSup t = ⨆ i, I • t i

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{ι : Sort u_4}
{I : Ideal R}
{t : ι → Submodule R M}


@[simp]
theorem coe_comp (f : TopHom β γ) (g : TopHom α β) : (f.comp g : α → γ) = f ∘ g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Top α]
[Top β]
[Top γ]
(f : TopHom β γ)
(g : TopHom α β)


lemma dualSubmoduleToDual_injective (hB : B.Nondegenerate) [NoZeroSMulDivisors R S]
    (N : Submodule R M) (hN : Submodule.span S (N : Set M) = ⊤) :
    Function.Injective (B.dualSubmoduleToDual N)

{R : Type u_3}
{S : Type u_1}
{M : Type u_2}
[CommRing R]
[Field S]
[AddCommGroup M]
[Algebra R S]
[Module R M]
[Module S M]
[IsScalarTower R S M]
(B : LinearMap.BilinForm S M)
(hB : B.Nondegenerate)
[NoZeroSMulDivisors R S]
(N : Submodule R M)
(hN : Submodule.span S ↑N = ⊤)


@[to_additive]
theorem independent_range_of_coprime_order
    (hcomm : Pairwise fun i j : ι => ∀ (x : H i) (y : H j), Commute (ϕ i x) (ϕ j y))
    [Finite ι] [∀ i, Fintype (H i)]
    (hcoprime : Pairwise fun i j => Nat.Coprime (Fintype.card (H i)) (Fintype.card (H j))) :
    CompleteLattice.Independent fun i => (ϕ i).range

(hcomm : Pairwise fun i j => ∀ (x : H i) (y : H j), Commute ((ϕ i) x) ((ϕ j) y))

(hcoprime : Pairwise fun i j => (Fintype.card (H i)).Coprime (Fintype.card (H j)))


/-- A binary function is integrable if the function `y ↦ f (x, y)` is integrable for almost every
  `x` and the function `x ↦ ∫ ‖f (x, y)‖ dy` is integrable. -/
theorem integrable_prod_iff ⦃f : α × β → E⦄ (h1f : AEStronglyMeasurable f (μ.prod ν)) :
    Integrable f (μ.prod ν) ↔
      (∀ᵐ x ∂μ, Integrable (fun y => f (x, y)) ν) ∧ Integrable (fun x => ∫ y, ‖f (x, y)‖ ∂ν) μ

⦃f : α × β → E⦄

(h1f : MeasureTheory.AEStronglyMeasurable f (μ.prod ν))

MeasureTheory.Integrable f (μ.prod ν) ↔
  (∀ᵐ (x : α) ∂μ, MeasureTheory.Integrable (fun y => f (x, y)) ν) ∧
    MeasureTheory.Integrable (fun x => ∫ (y : β), ‖f (x, y)‖ ∂ν) μ


theorem HasDerivWithinAt.ccosh (hf : HasDerivWithinAt f f' s x) :
    HasDerivWithinAt (fun x => Complex.cosh (f x)) (Complex.sinh (f x) * f') s x

{f : ℂ → ℂ}
{f' x : ℂ}
{s : Set ℂ}
(hf : HasDerivWithinAt f f' s x)


@[simp]
theorem ofPowerSeries_C (r : R) : ofPowerSeries Γ R (PowerSeries.C R r) = HahnSeries.C r

{Γ : Type u_1}
{R : Type u_2}
[Semiring R]
[StrictOrderedSemiring Γ]
(r : R)

(HahnSeries.ofPowerSeries Γ R) ((PowerSeries.C R) r) = HahnSeries.C r


@[to_additive (attr := fun_prop, measurability)]
theorem Measurable.const_mul [MeasurableMul M] (hf : Measurable f) (c : M) :
    Measurable fun x => c * f x

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Add M]
{m : MeasurableSpace α}
{f : α → M}
[MeasurableAdd M]
(hf : Measurable f)
(c : M)


theorem Perm.inter {l₁ l₂ t₁ t₂ : List α} (p₁ : l₁ ~ l₂) (p₂ : t₁ ~ t₂) : l₁ ∩ t₁ ~ l₂ ∩ t₂

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

l₁ ∩ t₁ ~ l₂ ∩ t₂


/-- `ModularFormClass F Γ k` says that `F` is a type of bundled functions that extend
`SlashInvariantFormClass` by requiring that the functions be holomorphic and bounded
at infinity. -/
class ModularFormClass (F : Type*) (Γ : outParam <| Subgroup (SL(2, ℤ))) (k : outParam ℤ)
    [FunLike F ℍ ℂ] extends SlashInvariantFormClass F Γ k : Prop where
  holo : ∀ f : F, MDifferentiable 𝓘(ℂ) 𝓘(ℂ) (f : ℍ → ℂ)
  bdd_at_infty : ∀ (f : F) (A : SL(2, ℤ)), IsBoundedAtImInfty (f ∣[k] A)

{F : Type u_2}
{Γ : outParam (Subgroup SL(2, ℤ))}
{k : outParam ℤ}
[FunLike F ℍ ℂ]
[self : ModularFormClass F Γ k]
(f : F)
(A : SL(2, ℤ))

UpperHalfPlane.IsBoundedAtImInfty (SlashAction.map ℂ k A ⇑f)


theorem fmod_nonneg {a b : Int} (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a.fmod b


/-- `count` measure evaluates to infinity at infinite sets. -/
theorem count_apply_infinite (hs : s.Infinite) : count s = ∞

{α : Type u_1}
[MeasurableSpace α]
{s : Set α}
(hs : s.Infinite)


/-- Two simplices glue nicely if the union of their vertices is affine independent. -/
lemma AffineIndependent.convexHull_inter (hs : AffineIndependent R ((↑) : s → E))
    (ht₁ : t₁ ⊆ s) (ht₂ : t₂ ⊆ s) :
    convexHull R (t₁ ∩ t₂ : Set E) = convexHull R t₁ ∩ convexHull R t₂

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
{s t₁ t₂ : Finset E}
(hs : AffineIndependent R Subtype.val)
(ht₁ : t₁ ⊆ s)
(ht₂ : t₂ ⊆ s)

(convexHull R) (↑t₁ ∩ ↑t₂) = (convexHull R) ↑t₁ ∩ (convexHull R) ↑t₂


/-- The leading coefficient of a product of polynomials is equal to
the product of the leading coefficients, provided that this product is nonzero.

See `Polynomial.leadingCoeff_multiset_prod` (without the `'`) for a version for integral domains,
where this condition is automatically satisfied.
-/
theorem leadingCoeff_multiset_prod' (h : (t.map leadingCoeff).prod ≠ 0) :
    t.prod.leadingCoeff = (t.map leadingCoeff).prod

(h : (Multiset.map Polynomial.leadingCoeff t).prod ≠ 0)

t.prod.leadingCoeff = (Multiset.map Polynomial.leadingCoeff t).prod


theorem homCongr_apply (k : Type*) {C : Type*} [Category C] [Semiring k] [Preadditive C]
    [Linear k C] {X Y W Z : C} (f₁ : X ≅ Y) (f₂ : W ≅ Z) (f : X ⟶ W) :
    homCongr k f₁ f₂ f = (f₁.inv ≫ f) ≫ f₂.hom

(k : Type u_1)
{C : Type u_2}
[CategoryTheory.Category.{u_3, u_2} C]
[Semiring k]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear k C]
{X Y W Z : C}
(f₁ : X ≅ Y)
(f₂ : W ≅ Z)
(f : X ⟶ W)

(CategoryTheory.Linear.homCongr k f₁ f₂) f = (f₁.inv ≫ f) ≫ f₂.hom


@[simp, norm_cast]
theorem const_nat [NatCast M] (n : ℕ) : ((n : M) : Germ l M) = n

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
[NatCast M]
(n : ℕ)


@[to_additive]
theorem mul_mem_upperBounds_mul {s t : Set M} {a b : M} (ha : a ∈ upperBounds s)
    (hb : b ∈ upperBounds t) : a * b ∈ upperBounds (s * t)

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

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


@[simp]
theorem verts_sup (G₁ G₂ : G.Subgraph) : (G₁ ⊔ G₂).verts = G₁.verts ∪ G₂.verts

{V : Type u}
{G : SimpleGraph V}
(G₁ G₂ : G.Subgraph)


/-- An additive action is isometric if each map `x ↦ c +ᵥ x` is an isometry. -/
class IsometricVAdd [PseudoEMetricSpace X] [VAdd M X] : Prop where
  protected isometry_vadd : ∀ c : M, Isometry ((c +ᵥ ·) : X → X)

{M : Type u}
{X : Type w}
[PseudoEMetricSpace X]
[VAdd M X]
[self : IsometricVAdd M X]
(c : M)


/-- **Schreier's Lemma**: If `R : Set G` is a `rightTransversal` of `H : Subgroup G`
  with `1 ∈ R`, and if `G` is generated by `S : Set G`, then `H` is generated by the `Set`
  `(R * S).image (fun g ↦ g * (toFun hR g)⁻¹)`. -/
theorem closure_mul_image_eq_top (hR : R ∈ rightTransversals (H : Set G)) (hR1 : (1 : G) ∈ R)
    (hS : closure S = ⊤) : closure ((R * S).image fun g =>
      ⟨g * (toFun hR g : G)⁻¹, mul_inv_toFun_mem hR g⟩ : Set H) = ⊤

(hR : R ∈ Subgroup.rightTransversals ↑H)

Subgroup.closure ((fun g => ⟨g * (↑(Subgroup.MemRightTransversals.toFun hR g))⁻¹, ⋯⟩) '' (R * S)) = ⊤


theorem norm_le_norm_one (φ : characterSpace 𝕜 A) : ‖toNormedDual (φ : WeakDual 𝕜 A)‖ ≤ ‖(1 : A)‖

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
(φ : ↑(WeakDual.characterSpace 𝕜 A))


/-- The associator for tensor, `(X ⊗ Y) ⊗ Z ≅ X ⊗ (Y ⊗ Z)` in `Dial C`. -/
@[simps!]
def associator (X Y Z : Dial C) : tensorObj (tensorObj X Y) Z ≅ tensorObj X (tensorObj Y Z)

(X.associator Y Z).inv.F =
  CategoryTheory.Limits.prod.lift
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.fst))
    (CategoryTheory.Limits.prod.lift
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd
        (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.snd))
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd))


theorem StrictAntiOn.cmp_map_eq (hf : StrictAntiOn f s) (hx : x ∈ s) (hy : y ∈ s) :
    cmp (f x) (f y) = cmp y x

{α : Type u}
{β : Type v}
[LinearOrder α]
[LinearOrder β]
{f : α → β}
{s : Set α}
{x y : α}
(hf : StrictAntiOn f s)
(hx : x ∈ s)
(hy : y ∈ s)


theorem not_xor_self : ∀ (x : Bool), xor (!x) x = true


/-- Construct an isomorphism of bimodules by giving an isomorphism between the underlying objects
and checking compatibility with left and right actions only in the forward direction.
-/
@[simps]
def isoOfIso {X Y : Mon_ C} {P Q : Bimod X Y} (f : P.X ≅ Q.X)
    (f_left_act_hom : P.actLeft ≫ f.hom = (X.X ◁ f.hom) ≫ Q.actLeft)
    (f_right_act_hom : P.actRight ≫ f.hom = (f.hom ▷ Y.X) ≫ Q.actRight) : P ≅ Q

(f_left_act_hom : P.actLeft ≫ f.hom = X.X ◁ f.hom ≫ Q.actLeft)

(f_right_act_hom : P.actRight ≫ f.hom = f.hom ▷ Y.X ≫ Q.actRight)

(Bimod.isoOfIso f f_left_act_hom f_right_act_hom).inv.hom = f.inv


@[reassoc (attr := simp)]
lemma rightHomologyι_naturality :
    rightHomologyMap φ ≫ S₂.rightHomologyι = S₁.rightHomologyι ≫ opcyclesMap φ

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.rightHomologyMap φ) S₂.rightHomologyι =
  CategoryTheory.CategoryStruct.comp S₁.rightHomologyι (CategoryTheory.ShortComplex.opcyclesMap φ)


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

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

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


/-- Two spheres intersect in at most two points in two-dimensional space; this is a version of
`eq_of_dist_eq_of_dist_eq_of_finrank_eq_two` for bundled spheres. -/
theorem eq_of_mem_sphere_of_mem_sphere_of_finrank_eq_two [FiniteDimensional ℝ V]
    (hd : finrank ℝ V = 2) {s₁ s₂ : Sphere P} {p₁ p₂ p : P} (hs : s₁ ≠ s₂) (hp : p₁ ≠ p₂)
    (hp₁s₁ : p₁ ∈ s₁) (hp₂s₁ : p₂ ∈ s₁) (hps₁ : p ∈ s₁) (hp₁s₂ : p₁ ∈ s₂) (hp₂s₂ : p₂ ∈ s₂)
    (hps₂ : p ∈ s₂) : p = p₁ ∨ p = p₂

(hd : FiniteDimensional.finrank ℝ V = 2)


@[to_additive (attr := measurability)]
theorem Measurable.smul_const (hf : Measurable f) (y : β) : Measurable fun x => f x • y

{M : Type u_2}
{β : Type u_3}
{α : Type u_4}
[MeasurableSpace M]
[MeasurableSpace β]
[VAdd M β]
{m : MeasurableSpace α}
{f : α → M}
[MeasurableVAdd M β]
(hf : Measurable f)
(y : β)


@[simp]
theorem aeval_coe (S : Subalgebra R A) (x : S) (p : R[X]) : aeval (x : A) p = aeval x p

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
(S : Subalgebra R A)
(x : ↥S)
(p : R[X])

(Polynomial.aeval ↑x) p = ↑((Polynomial.aeval x) p)


theorem image_update_Ico (f : ∀ i, α i) (i : ι) (a b : α i) :
    update f i '' Ico a b = Ico (update f i a) (update f i b)

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

Function.update f i '' Set.Ico a b = Set.Ico (Function.update f i a) (Function.update f i b)


/-- Applying `LocalRing.ResidueField.map` to the identity ring homomorphism gives the identity
ring homomorphism. -/
@[simp]
theorem map_id :
    LocalRing.ResidueField.map (RingHom.id R) = RingHom.id (LocalRing.ResidueField R)

{R : Type u_1}
[CommRing R]
[LocalRing R]


theorem isLUB_u {b : β} : IsLUB { a | l a ≤ b } (u b)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{b : β}


theorem intro_with_eq (p p' q : Prop) (he : p = p') (h : p' → q) : p → q


@[simp]
theorem lift_comp_lift_apply (x : L) : lift j k p (lift i j p x) = lift i k p x

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

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


@[to_additive]
theorem card_le_card_mul_right {t : Finset α} (ht : t.Nonempty) : s.card ≤ (s * t).card

{α : Type u_2}
[Mul α]
[IsRightCancelMul α]
[DecidableEq α]
(s : Finset α)
{t : Finset α}
(ht : t.Nonempty)


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

{f : ι → α → γ}


/-- An order is strongly coatomic if every nontrivial interval `[a, b]`
contains an element covered by `b`. -/
@[mk_iff]
class IsStronglyCoatomic (α : Type*) [Preorder α] : Prop where
  (exists_le_covBy_of_lt : ∀ (a b : α), a < b → ∃ x, a ≤ x ∧ x ⋖ b)

IsStronglyCoatomic α ↔ ∀ (a b : α), a < b → ∃ x, a ≤ x ∧ x ⋖ b


/-- A *Coxeter matrix* is a symmetric matrix of natural numbers whose diagonal entries are equal to
1 and whose off-diagonal entries are not equal to 1. -/
@[ext]
structure CoxeterMatrix (B : Type*) where
  /-- The underlying matrix of the Coxeter matrix. -/
  M : Matrix B B ℕ
  isSymm : M.IsSymm := by decide
  diagonal i : M i i = 1 := by decide
  off_diagonal i i' : i ≠ i' → M i i' ≠ 1 := by decide


/-- If `(l, u)` is a Galois connection, then the relation `x ≤ u (l y)` is a transitive relation.
If `l` is a closure operator (`Submodule.span`, `Subgroup.closure`, ...) and `u` is the coercion to
`Set`, this reads as "if `U` is in the closure of `V` and `V` is in the closure of `W` then `U` is
in the closure of `W`". -/
theorem le_u_l_trans {x y z : α} (hxy : x ≤ u (l y)) (hyz : y ≤ u (l z)) : x ≤ u (l z)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{x y z : α}
(hxy : x ≤ u (l y))
(hyz : y ≤ u (l z))


/-- The strong pigeonhole principle for finitely many pigeons and pigeonholes. There is a pigeonhole
with at least as many pigeons as the ceiling of the average number of pigeons across all
pigeonholes. -/
theorem exists_lt_card_fiber_of_nsmul_lt_card (hb : card β • b < card α) :
    ∃ y : β, b < (univ.filter fun x => f x = y).card

(hb : Fintype.card β • b < ↑(Fintype.card α))

∃ y, b < ↑(Finset.filter (fun x => f x = y) Finset.univ).card


theorem self_le_supp_comap (J : Ideal R) (v : AddValuation (R ⧸ J) Γ₀) :
    J ≤ (v.comap (Ideal.Quotient.mk J)).supp

{R : Type u_1}
{Γ₀ : Type u_2}
[CommRing R]
[LinearOrderedAddCommMonoidWithTop Γ₀]
(J : Ideal R)
(v : AddValuation (R ⧸ J) Γ₀)

J ≤ (AddValuation.comap (Ideal.Quotient.mk J) v).supp


/-- This is not a simp lemma, as it is usually preferable to use the lemmas about `C` and `X`
instead. -/
theorem Polynomial.toLaurent_apply [Semiring R] (p : R[X]) :
    toLaurent p = p.toFinsupp.mapDomain (↑)

Polynomial.toLaurent p = AddMonoidAlgebra.mapDomain Nat.cast p.toFinsupp


@[to_additive (attr := simp)] lemma monovary_inv_left : Monovary f⁻¹ g ↔ Antivary f g

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


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

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

((CategoryTheory.Limits.Cocone.equivStructuredArrow F).counitIso.inv.app X).left =
  CategoryTheory.CategoryStruct.id X.left


@[to_additive (attr := simp)]
theorem mulIndicator_apply_eq_one : mulIndicator s f a = 1 ↔ a ∈ s → f a = 1

{α : Type u_1}
{M : Type u_4}
[Zero M]
{s : Set α}
{f : α → M}
{a : α}


/-- An uncurried version of `Finset.prod_prod_type_right`. -/
@[to_additive Fintype.sum_prod_type_right' "An uncurried version of `Finset.sum_prod_type_right`"]
theorem Fintype.prod_prod_type_right' [CommMonoid γ] {f : α₁ → α₂ → γ} :
    ∏ x : α₁ × α₂, f x.1 x.2 = ∏ y, ∏ x, f x y

{γ : Type u_3}
{α₁ : Type u_4}
{α₂ : Type u_5}
[Fintype α₁]
[Fintype α₂]
[CommMonoid γ]
{f : α₁ → α₂ → γ}

∏ x : α₁ × α₂, f x.1 x.2 = ∏ y : α₂, ∏ x : α₁, f x y


@[simp]
lemma compProd_zero_right (κ : Kernel α β) (γ : Type*) [MeasurableSpace γ] :
    κ ⊗ₖ (0 : Kernel (α × β) γ) = 0

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ : ProbabilityTheory.Kernel α β)
(γ : Type u_5)
[MeasurableSpace γ]


theorem le_of_isLUB_le_isGLB {x y} (ha : IsGLB s a) (hb : IsLUB s b) (hab : b ≤ a) (hx : x ∈ s)
    (hy : y ∈ s) : x ≤ y

{α : Type u}
[Preorder α]
{s : Set α}
{a b x y : α}
(ha : IsGLB s a)
(hb : IsLUB s b)
(hab : b ≤ a)
(hx : x ∈ s)
(hy : y ∈ s)


@[simp]
theorem coe_prop {S : Set α} (a : { a // a ∈ S }) : ↑a ∈ S

{α : Type u_1}
{S : Set α}
(a : { a // a ∈ S })


theorem lt_of_mul_lt_mul_of_le₀ (h : a * b < c * d) (hc : 0 < c) (hh : c ≤ a) : b < d

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a b c d : α}
(h : a * b < c * d)
(hc : 0 < c)
(hh : c ≤ a)


theorem GammaSeq_eq_approx_Gamma_integral {s : ℂ} (hs : 0 < re s) {n : ℕ} (hn : n ≠ 0) :
    GammaSeq s n = ∫ x : ℝ in (0)..n, ↑((1 - x / n) ^ n) * (x : ℂ) ^ (s - 1)

s.GammaSeq n = ∫ (x : ℝ) in 0 ..↑n, ↑((1 - x / ↑n) ^ n) * ↑x ^ (s - 1)


theorem card_fun [Finite α] : Nat.card (α → β) = Nat.card β ^ Nat.card α

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


@[to_additive (attr := simp, norm_cast)]
theorem coe_ofClosureMEqTopRight (f : M → N) (hs : closure s = ⊤) (h1 hmul) :
    ⇑(ofClosureMEqTopRight f hs h1 hmul) = f

(hmul : ∀ (x y : M), y ∈ s → f (x + y) = f x + f y)

⇑(AddMonoidHom.ofClosureMEqTopRight f hs h1 hmul) = f


theorem eLpNorm_le_of_ae_nnnorm_bound {f : α → F} {C : ℝ≥0} (hfC : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ C) :
    eLpNorm f p μ ≤ C • μ Set.univ ^ p.toReal⁻¹

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{f : α → F}
{C : ℝ≥0}
(hfC : ∀ᵐ (x : α) ∂μ, ‖f x‖₊ ≤ C)

MeasureTheory.eLpNorm f p μ ≤ C • μ Set.univ ^ p.toReal⁻¹


theorem IsAdjointPair.comp {f' : M' →ₗ[R] M''} {g' : M'' →ₗ[R] M'} (h : IsAdjointPair B B' f g)
    (h' : IsAdjointPair B' B'' f' g') : IsAdjointPair B B'' (f'.comp f) (g.comp g')

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


protected theorem Decidable.not_forall_not {p : α → Prop} [Decidable (∃ x, p x)] :
    (¬∀ x, ¬p x) ↔ ∃ x, p x

{α : Sort u_1}
{p : α → Prop}
[Decidable (∃ x, p x)]


@[simp, bv_toNat] theorem toNat_ofNat (x w : Nat) : (BitVec.ofNat w x).toNat = x % 2^w


/-- Alternative constructor for `isLimit`,
providing a morphism of cones rather than a morphism between the cone points
and separately the factorisation condition.
-/
@[simps]
def mkConeMorphism {t : Cone F} (lift : ∀ s : Cone F, s ⟶ t)
    (uniq : ∀ (s : Cone F) (m : s ⟶ t), m = lift s) : IsLimit t

(lift : (s : CategoryTheory.Limits.Cone F) → s ⟶ t)

(uniq : ∀ (s : CategoryTheory.Limits.Cone F) (m : s ⟶ t), m = lift s)

(CategoryTheory.Limits.IsLimit.mkConeMorphism lift uniq).lift s = (lift s).hom


@[simp]
theorem equivOfEq_symm {S T : IntermediateField F E} (h : S = T) :
    (equivOfEq h).symm = equivOfEq h.symm

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{S T : IntermediateField F E}
(h : S = T)

(IntermediateField.equivOfEq h).symm = IntermediateField.equivOfEq ⋯


theorem natAbs_min_of_le_div_two (n : ℕ) (x y : ℤ) (he : (x : ZMod n) = y) (hl : x.natAbs ≤ n / 2) :
    x.natAbs ≤ y.natAbs

(n : ℕ)
(x y : ℤ)
(he : ↑x = ↑y)
(hl : x.natAbs ≤ n / 2)


theorem tsum_prob_mem_Ioi_lt_top {X : Ω → ℝ} (hint : Integrable X) (hnonneg : 0 ≤ X) :
    (∑' j : ℕ, ℙ {ω | X ω ∈ Set.Ioi (j : ℝ)}) < ∞

{Ω : Type u_1}
[MeasureTheory.MeasureSpace Ω]
[MeasureTheory.IsProbabilityMeasure ℙ]
{X : Ω → ℝ}
(hint : MeasureTheory.Integrable X ℙ)
(hnonneg : 0 ≤ X)

∑' (j : ℕ), ℙ {ω | X ω ∈ Set.Ioi ↑j} < ⊤


theorem quasiMeasurePreserving_symm (μ : Measure α) (e : α ≃ᵐ β) :
    QuasiMeasurePreserving e.symm (map e μ) μ

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(μ : MeasureTheory.Measure α)
(e : α ≃ᵐ β)

MeasureTheory.Measure.QuasiMeasurePreserving (⇑e.symm) (MeasureTheory.Measure.map (⇑e) μ) μ


theorem map_eq_withDensity_pdf {m : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω)
    (μ : Measure E := by volume_tac) [hX : HasPDF X ℙ μ] :
    map X ℙ = μ.withDensity (pdf X ℙ μ)

(μ : MeasureTheory.Measure E := by volume_tac)

MeasureTheory.Measure.map X ℙ = MeasureTheory.Measure.withDensity μ (MeasureTheory.pdf X ℙ μ)


/-- If `p` is a closed complemented submodule,
then there exists a submodule `q` and a continuous linear equivalence `M ≃L[R] (p × q)` such that
`e (x : p) = (x, 0)`, `e (y : q) = (0, y)`, and `e.symm x = x.1 + x.2`.

In fact, the properties of `e` imply the properties of `e.symm` and vice versa,
but we provide both for convenience. -/
lemma ClosedComplemented.exists_submodule_equiv_prod [TopologicalAddGroup M]
    {p : Submodule R M} (hp : p.ClosedComplemented) :
    ∃ (q : Submodule R M) (e : M ≃L[R] (p × q)),
      (∀ x : p, e x = (x, 0)) ∧ (∀ y : q, e y = (0, y)) ∧ (∀ x, e.symm x = x.1 + x.2)

{R : Type u_1}
[Ring R]
{M : Type u_2}
[TopologicalSpace M]
[AddCommGroup M]
[Module R M]
[TopologicalAddGroup M]
{p : Submodule R M}
(hp : p.ClosedComplemented)

∃ q e, (∀ (x : ↥p), e ↑x = (x, 0)) ∧ (∀ (y : ↥q), e ↑y = (0, y)) ∧ ∀ (x : ↥p × ↥q), e.symm x = ↑x.1 + ↑x.2


theorem le_neg_iff {x y : PGame} : y ≤ -x ↔ x ≤ -y


/-- In a real vector space of dimension `> 1`, the complement of any singleton is path-connected. -/
theorem isPathConnected_compl_singleton_of_one_lt_rank (h : 1 < Module.rank ℝ E) (x : E) :
    IsPathConnected {x}ᶜ

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[ContinuousAdd E]
[ContinuousSMul ℝ E]
(h : 1 < Module.rank ℝ E)
(x : E)


@[simp] lemma odd_add_one_self' : Odd (a + (1 + a))


theorem coordChange_apply_snd (e₁ e₂ : Trivialization F proj) {p : Z} (h : proj p ∈ e₁.baseSet) :
    e₁.coordChange e₂ (proj p) (e₁ p).snd = (e₂ p).snd

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e₁ e₂ : Trivialization F proj)
{p : Z}
(h : proj p ∈ e₁.baseSet)

e₁.coordChange e₂ (proj p) (↑e₁ p).2 = (↑e₂ p).2


@[simp]
theorem kinsert_def {a} {b : β a} {l : List (Sigma β)} : kinsert a b l = ⟨a, b⟩ :: kerase a l

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{l : List (Sigma β)}

List.kinsert a b l = ⟨a, b⟩ :: List.kerase a l


@[to_additive (attr := simp)]
theorem liftOfRightInverseAux_comp_apply (hf : Function.RightInverse f_inv f) (g : G₁ →* G₃)
    (hg : f.ker ≤ g.ker) (x : G₁) : (f.liftOfRightInverseAux f_inv hf g hg) (f x) = g x

{G₁ : Type u_5}
{G₂ : Type u_6}
{G₃ : Type u_7}
[Group G₁]
[Group G₂]
[Group G₃]
(f : G₁ →* G₂)
(f_inv : G₂ → G₁)
(hf : Function.RightInverse f_inv ⇑f)
(g : G₁ →* G₃)
(hg : f.ker ≤ g.ker)
(x : G₁)


theorem infinite_range_iff {f : α → β} (hi : Injective f) :
    (range f).Infinite ↔ Infinite α

{α : Type u}
{β : Type v}
{f : α → β}
(hi : Function.Injective f)


@[simp]
theorem coe_ofLinearIsometry (f : E →ₛₗᵢ[σ₁₂] E₂) (g : E₂ →ₛₗ[σ₂₁] E)
    (h₁ : f.toLinearMap.comp g = LinearMap.id) (h₂ : g.comp f.toLinearMap = LinearMap.id) :
    (ofLinearIsometry f g h₁ h₂ : E → E₂) = (f : E → E₂)

(f : E →ₛₗᵢ[σ₁₂] E₂)

⇑(LinearIsometryEquiv.ofLinearIsometry f g h₁ h₂) = ⇑f


theorem lieSpan_eq_bot_iff : lieSpan R L s = ⊥ ↔ ∀ m ∈ s, m = (0 : M)

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{s : Set M}

LieSubmodule.lieSpan R L s = ⊥ ↔ ∀ m ∈ s, m = 0


@[to_additive]
theorem one_mul_eq_id : ((1 : M) * ·) = id


theorem atEnd : ∀ {s}, ValidFor l m r s → (s.atEnd ⟨p⟩ ↔ p = utf8Len m)

{l m r : List Char}
{p : Nat}
{s : Substring}

Substring.ValidFor l m r s → (s.atEnd { byteIdx := p } = true ↔ p = String.utf8Len m)


theorem sin_pos_of_mem_Ioo {x : ℝ} (hx : x ∈ Ioo 0 π) : 0 < sin x


lemma Module.support_eq_empty_iff :
    Module.support R M = ∅ ↔ Subsingleton M

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


@[to_additive (attr := to_additive) (reorder := 5 6) smul_def]
theorem pow_def [∀ i, Pow (f i) β] (x : ∀ i, f i) (b : β) : x ^ b = fun i => x i ^ b

{I : Type u}
{β : Type u_2}
{f : I → Type v₁}
[(i : I) → SMul β (f i)]
(b : β)
(x : (i : I) → f i)


theorem pointed_innerDualCone : s.innerDualCone.Pointed

{H : Type u_5}
[NormedAddCommGroup H]
[InnerProductSpace ℝ H]
(s : Set H)


/-- The category of algebras over an additive endofunctor on a preadditive category is preadditive.
-/
@[simps]
instance Endofunctor.algebraPreadditive : Preadditive (Endofunctor.Algebra F)

(A₁ A₂ : CategoryTheory.Endofunctor.Algebra F)


@[simp]
theorem pullback_apply {Y X : C} {P : Cᵒᵖ ⥤ D} {S : J.Cover X} (x : Meq P S) (f : Y ⟶ X)
    (I : ((J.pullback f).obj S).Arrow) : x.pullback f I = x ⟨_, I.f ≫ f, I.hf⟩

{J : CategoryTheory.GrothendieckTopology C}

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

↑(x.pullback f) I = ↑x { Y := I.Y, f := CategoryTheory.CategoryStruct.comp I.f f, hf := ⋯ }


theorem lt_mul_of_one_lt_of_le_of_pos [MulPosStrictMono α] (ha : 1 < a) (h : b ≤ c) (hc : 0 < c) :
    b < a * c

{α : Type u_1}
{a b c : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[MulPosStrictMono α]
(ha : 1 < a)
(h : b ≤ c)
(hc : 0 < c)


/-- A map `f : α → β` is said to be *quasi measure preserving* (a.k.a. non-singular) w.r.t. measures
`μa` and `μb` if it is measurable and `μb s = 0` implies `μa (f ⁻¹' s) = 0`. -/
structure QuasiMeasurePreserving {m0 : MeasurableSpace α} (f : α → β)
  (μa : Measure α := by volume_tac)
  (μb : Measure β := by volume_tac) : Prop where
  protected measurable : Measurable f
  protected absolutelyContinuous : μa.map f ≪ μb

{μa : autoParam (MeasureTheory.Measure α) _auto✝}

{μb : autoParam (MeasureTheory.Measure β) _auto✝¹}

(self : MeasureTheory.Measure.QuasiMeasurePreserving f μa μb)


theorem le_iSup_iff {s : ι → α} : a ≤ iSup s ↔ ∀ b, (∀ i, s i ≤ b) → a ≤ b

{α : Type u_1}
{ι : Sort u_5}
[CompleteSemilatticeSup α]
{a : α}
{s : ι → α}

a ≤ iSup s ↔ ∀ (b : α), (∀ (i : ι), s i ≤ b) → a ≤ b


theorem span_top : span K (span ℤ (Set.range b) : Set E) = ⊤

{E : Type u_1}
{ι : Type u_2}
{K : Type u_3}
[NormedLinearOrderedField K]
[NormedAddCommGroup E]
[NormedSpace K E]
(b : Basis ι K E)

Submodule.span K ↑(Submodule.span ℤ (Set.range ⇑b)) = ⊤


/-- Given a Localization map `f : M →*₀ N` for a Submonoid `S ⊆ M`,
if `M` is a cancellative monoid with zero, and all elements of `S` are
regular, then N is a cancellative monoid with zero.  -/
theorem isLeftRegular_of_le_isCancelMulZero (f : LocalizationWithZeroMap S N)
    [IsCancelMulZero M] (h : ∀ ⦃x⦄, x ∈ S → IsRegular x) : IsCancelMulZero N

{M : Type u_1}
[CommMonoidWithZero M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoidWithZero N]
(f : S.LocalizationWithZeroMap N)
[IsCancelMulZero M]
(h : ∀ ⦃x : M⦄, x ∈ S → IsRegular x)


lemma diffContOnCl_interpStrip :
    DiffContOnCl ℂ (interpStrip f) (verticalStrip 0 1)

{E : Type u_1}
[NormedAddCommGroup E]
(f : ℂ → E)

DiffContOnCl ℂ (Complex.HadamardThreeLines.interpStrip f) (Complex.HadamardThreeLines.verticalStrip 0 1)


/-- Construct a natural isomorphism between functors by giving object level isomorphisms,
and checking naturality only in the forward direction.
-/
@[simps]
def ofComponents (app : ∀ X : C, F.obj X ≅ G.obj X)
    (naturality : ∀ {X Y : C} (f : X ⟶ Y),
      F.map f ≫ (app Y).hom = (app X).hom ≫ G.map f := by aesop_cat) :
    F ≅ G

(CategoryTheory.NatIso.ofComponents app naturality).hom.app X = (app X).hom


theorem DFinsupp.Lex.wellFounded_of_finite [IsStrictTotalOrder ι r] [Finite ι] [∀ i, Zero (α i)]
    (hs : ∀ i, WellFounded (s i)) : WellFounded (DFinsupp.Lex r s)

{ι : Type u_1}
{α : ι → Type u_2}
(r : ι → ι → Prop)
{s : (i : ι) → α i → α i → Prop}
[IsStrictTotalOrder ι r]
[Finite ι]
[(i : ι) → Zero (α i)]
(hs : ∀ (i : ι), WellFounded (s i))


@[simp, norm_cast]
theorem coe_map (g : P →ₐ[R] P') (I : FractionalIdeal S P) :
    ↑(map g I) = Submodule.map g.toLinearMap I

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{P' : Type u_3}
[CommRing P']
[Algebra R P']
(g : P →ₐ[R] P')
(I : FractionalIdeal S P)

↑(FractionalIdeal.map g I) = Submodule.map g.toLinearMap ↑I


/-- The functor which sends `X, Y` to the product type `X × Y`. -/
@[simps]
def binaryProductFunctor : Type u ⥤ Type u ⥤ Type u

(X : Type u)
{Y₁ Y₂ : Type u}
(f : Y₁ ⟶ Y₂)

∀ (a : (CategoryTheory.Limits.BinaryFan.mk Prod.fst (Prod.snd ≫ f)).pt),
  (CategoryTheory.Limits.Types.binaryProductFunctor.obj X).map f a =
    (CategoryTheory.Limits.Types.binaryProductLimit X Y₂).lift
      (CategoryTheory.Limits.BinaryFan.mk Prod.fst (Prod.snd ≫ f)) a


/-- Construction of a group with commuting probability `1 / n`. -/
theorem commProb_reciprocal (n : ℕ) :
    commProb (Product (reciprocalFactors n)) = 1 / n

commProb (DihedralGroup.Product (DihedralGroup.reciprocalFactors n)) = 1 / ↑n


@[to_additive]
lemma nullMeasurableSet_mulSupport {E} [TopologicalSpace E] [MetrizableSpace E] [One E] {f : α → E}
    (hf : AEStronglyMeasurable f μ) : NullMeasurableSet (mulSupport f) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.NullMeasurableSet (Function.mulSupport f) μ


@[simp]
theorem midpoint_self (x : P) : midpoint R x x = x

(R : Type u_1)
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(x : P)


protected theorem zero_def : (0 : X[S⁻¹]) = 0 /ₒ 1

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[Zero X]
[MulAction R X]


theorem list_reverse : Computable (@List.reverse α)


theorem gcd_eq_natAbs {a b : ℤ} : Int.gcd a b = Nat.gcd a.natAbs b.natAbs


@[simp]
theorem const_comp (f : α →o β) (c : γ) : (const β c).comp f = const α c

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

((OrderHom.const β) c).comp f = (OrderHom.const α) c


theorem mem_degreeLE {n : WithBot ℕ} {f : R[X]} : f ∈ degreeLE R n ↔ degree f ≤ n

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

f ∈ Polynomial.degreeLE R n ↔ f.degree ≤ n


theorem point_finite (hf : LocallyFinite f) (x : X) : { b | x ∈ f b }.Finite

{ι : Type u_1}
{X : Type u_4}
[TopologicalSpace X]
{f : ι → Set X}
(hf : LocallyFinite f)
(x : X)


theorem ContMDiffOn.inv₀ (hf : ContMDiffOn I' I n f s) (h0 : ∀ x ∈ s, f x ≠ 0) :
    ContMDiffOn I' I n (fun x => (f x)⁻¹) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Inv G]
[Zero G]
[SmoothInv₀ I G]
{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]
{n : ℕ∞}
{f : M → G}
{s : Set M}
(hf : ContMDiffOn I' I n f s)
(h0 : ∀ x ∈ s, f x ≠ 0)


theorem insert_prod : insert a s ×ˢ t = Prod.mk a '' t ∪ s ×ˢ t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{a : α}


/-- The map associating to `a : R` the multiplicative shift of `ψ` by `a`
is injective when `ψ` is primitive. -/
theorem to_mulShift_inj_of_isPrimitive {ψ : AddChar R R'} (hψ : IsPrimitive ψ) :
    Function.Injective ψ.mulShift

{R : Type u}
[CommRing R]
{R' : Type v}
[CommMonoid R']
{ψ : AddChar R R'}
(hψ : ψ.IsPrimitive)


lemma isSFiniteKernel_prodMkLeft_unit {κ : Kernel α β} :
    IsSFiniteKernel (prodMkLeft Unit κ) ↔ IsSFiniteKernel κ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ : ProbabilityTheory.Kernel α β}

ProbabilityTheory.IsSFiniteKernel (ProbabilityTheory.Kernel.prodMkLeft Unit κ) ↔ ProbabilityTheory.IsSFiniteKernel κ


/-- The pseudofunctor from `Cat` to `Cat` defined with `WithInitial`. -/
@[simps]
def pseudofunctor : Pseudofunctor Cat Cat

CategoryTheory.WithInitial.pseudofunctor.mapId C = CategoryTheory.WithInitial.mapId ↑C


@[simp]
lemma down_imageHom [MulOneClass α] [MulOneClass β] (f : α →* β) (s : SetSemiring α) :
    down (imageHom f s) = f '' down s

{α : Type u_1}
{β : Type u_2}
[MulOneClass α]
[MulOneClass β]
(f : α →* β)
(s : SetSemiring α)

SetSemiring.down ((SetSemiring.imageHom f) s) = ⇑f '' SetSemiring.down s


/-- As the thickening radius δ tends to 0, the δ-thickened indicator of a set E (in α) tends
pointwise (i.e., w.r.t. the product topology on `α → ℝ≥0∞`) to the indicator function of the
closure of E.

This statement is for the unbundled `ℝ≥0∞`-valued functions `thickenedIndicatorAux δ E`, see
`thickenedIndicator_tendsto_indicator_closure` for the version for bundled `ℝ≥0`-valued
bounded continuous functions. -/
theorem thickenedIndicatorAux_tendsto_indicator_closure {δseq : ℕ → ℝ}
    (δseq_lim : Tendsto δseq atTop (𝓝 0)) (E : Set α) :
    Tendsto (fun n => thickenedIndicatorAux (δseq n) E) atTop
      (𝓝 (indicator (closure E) fun _ => (1 : ℝ≥0∞)))

(δseq_lim : Filter.Tendsto δseq Filter.atTop (𝓝 0))

Filter.Tendsto (fun n => thickenedIndicatorAux (δseq n) E) Filter.atTop (𝓝 ((closure E).indicator fun x => 1))


theorem _root_.Disjoint.forall_ne_finset (h : Disjoint s t) (ha : a ∈ s) (hb : b ∈ t) : a ≠ b

{α : Type u_1}
{s t : Finset α}
{a b : α}
(h : Disjoint s t)
(ha : a ∈ s)
(hb : b ∈ t)


@[to_additive nnnorm_add_le]
theorem nnnorm_mul_le' (a b : E) : ‖a * b‖₊ ≤ ‖a‖₊ + ‖b‖₊

{E : Type u_6}
[SeminormedGroup E]
(a b : E)

‖a * b‖₊ ≤ ‖a‖₊ + ‖b‖₊


/-- Equivalence between continuous maps into the units of a monoid with continuous multiplication
and the units of the monoid of continuous maps. -/
-- Porting note: `simps` made bad `simp` lemmas (LHS simplifies) so we add them manually below
@[to_additive (attr := simps apply_val_apply symm_apply_apply_val)
"Equivalence between continuous maps into the additive units of an additive monoid with continuous
addition and the additive units of the additive monoid of continuous maps."]
def unitsLift : C(X, Mˣ) ≃ C(X, M)ˣ

{X : Type u_1}
{M : Type u_2}
[TopologicalSpace X]
[AddMonoid M]
[TopologicalSpace M]
[ContinuousAdd M]
(f : AddUnits C(X, M))
(x : X)

↑((ContinuousMap.addUnitsLift.symm f) x) = ↑f x


theorem zorn_subset (S : Set (Set α))
    (h : ∀ c ⊆ S, IsChain (· ⊆ ·) c → ∃ ub ∈ S, ∀ s ∈ c, s ⊆ ub) :
    ∃ m ∈ S, ∀ a ∈ S, m ⊆ a → a = m

(h : ∀ c ⊆ S, IsChain (fun x x_1 => x ⊆ x_1) c → ∃ ub ∈ S, ∀ s ∈ c, s ⊆ ub)


@[simp]
protected lemma max_eq_top [OrderTop α] {s : Finset α} : s.max = ⊤ ↔ ⊤ ∈ s

{α : Type u_2}
[LinearOrder α]
[OrderTop α]
{s : Finset α}


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

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(S : Submonoid M)
(f : M →* N)

MonoidHom.mker (f.restrict S) = Submonoid.comap S.subtype (MonoidHom.mker f)


@[simp]
theorem constAlgHom_eq_algebra_ofId : constAlgHom R A R = Algebra.ofId R (A → R)

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

Pi.constAlgHom R A R = Algebra.ofId R (A → R)


/-- A preadditive category `C` with an additive shift, and a class of "distinguished triangles"
relative to that shift is called pretriangulated if the following hold:
* Any triangle that is isomorphic to a distinguished triangle is also distinguished.
* Any triangle of the form `(X,X,0,id,0,0)` is distinguished.
* For any morphism `f : X ⟶ Y` there exists a distinguished triangle of the form `(X,Y,Z,f,g,h)`.
* The triangle `(X,Y,Z,f,g,h)` is distinguished if and only if `(Y,Z,X⟦1⟧,g,h,-f⟦1⟧)` is.
* Given a diagram:
  ```
        f       g       h
    X  ───> Y  ───> Z  ───> X⟦1⟧
    │       │                │
    │a      │b               │a⟦1⟧'
    V       V                V
    X' ───> Y' ───> Z' ───> X'⟦1⟧
        f'      g'      h'
  ```
  where the left square commutes, and whose rows are distinguished triangles,
  there exists a morphism `c : Z ⟶ Z'` such that `(a,b,c)` is a triangle morphism.

See <https://stacks.math.columbia.edu/tag/0145>
-/
class Pretriangulated [∀ n : ℤ, Functor.Additive (shiftFunctor C n)] where
  /-- a class of triangle which are called `distinguished` -/
  distinguishedTriangles : Set (Triangle C)
  /-- a triangle that is isomorphic to a distinguished triangle is distinguished -/
  isomorphic_distinguished :
    ∀ T₁ ∈ distinguishedTriangles, ∀ (T₂) (_ : T₂ ≅ T₁), T₂ ∈ distinguishedTriangles
  /-- obvious triangles `X ⟶ X ⟶ 0 ⟶ X⟦1⟧` are distinguished -/
  contractible_distinguished : ∀ X : C, contractibleTriangle X ∈ distinguishedTriangles
  /-- any morphism `X ⟶ Y` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
  distinguished_cocone_triangle :
    ∀ {X Y : C} (f : X ⟶ Y),
      ∃ (Z : C) (g : Y ⟶ Z) (h : Z ⟶ X⟦(1 : ℤ)⟧), Triangle.mk f g h ∈ distinguishedTriangles
  /-- a triangle is distinguished iff it is so after rotating it -/
  rotate_distinguished_triangle :
    ∀ T : Triangle C, T ∈ distinguishedTriangles ↔ T.rotate ∈ distinguishedTriangles
  /-- given two distinguished triangle, a commutative square
        can be extended as morphism of triangles -/
  complete_distinguished_triangle_morphism :
    ∀ (T₁ T₂ : Triangle C) (_ : T₁ ∈ distinguishedTriangles) (_ : T₂ ∈ distinguishedTriangles)
      (a : T₁.obj₁ ⟶ T₂.obj₁) (b : T₁.obj₂ ⟶ T₂.obj₂) (_ : T₁.mor₁ ≫ b = a ≫ T₂.mor₁),
      ∃ c : T₁.obj₃ ⟶ T₂.obj₃, T₁.mor₂ ≫ c = b ≫ T₂.mor₂ ∧ T₁.mor₃ ≫ a⟦1⟧' = c ≫ T₂.mor₃

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

[self : CategoryTheory.Pretriangulated C]

(T₁ : CategoryTheory.Pretriangulated.Triangle C)

T₁ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles →
  ∀ (T₂ : CategoryTheory.Pretriangulated.Triangle C),
    (T₂ ≅ T₁) → T₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


theorem eventually_mem_spanningSets (μ : Measure α) [SigmaFinite μ] (x : α) :
    ∀ᶠ n in atTop, x ∈ spanningSets μ n

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]
(x : α)

∀ᶠ (n : ℕ) in Filter.atTop, x ∈ MeasureTheory.spanningSets μ n


/-- If a function `f` equals `1` on a set `s`, then the product of `f i` over `i ∈ s` equals `1`. -/
@[to_additive
      "If a function `f` equals `0` on a set `s`, then the product of `f i` over `i ∈ s`
      equals `0`."]
theorem finprod_mem_of_eqOn_one (hf : s.EqOn f 1) : ∏ᶠ i ∈ s, f i = 1

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
{s : Set α}
(hf : Set.EqOn f 0 s)


theorem IsPreconnected.union' {s t : Set α} (H : (s ∩ t).Nonempty) (hs : IsPreconnected s)
    (ht : IsPreconnected t) : IsPreconnected (s ∪ t)

{α : Type u}
[TopologicalSpace α]
{s t : Set α}
(H : (s ∩ t).Nonempty)
(hs : IsPreconnected s)
(ht : IsPreconnected t)


@[to_additive (attr := simp)]
theorem mk'_mul_cancel_right (x : M) (y : S) : f.mk' (x * y) y = f.toMap x

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


@[simp]
theorem isBigO_sup : f =O[l ⊔ l'] g' ↔ f =O[l] g' ∧ f =O[l'] g'

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


theorem enumOrd_succ_le {a b} (hS : Unbounded (· < ·) S) (ha : a ∈ S) (hb : enumOrd S b < a) :
    enumOrd S (succ b) ≤ a

(hS : Set.Unbounded (fun x x_1 => x < x_1) S)


theorem toHom_range (f : M ≃[L] N) : f.toHom.range = ⊤

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


theorem tendsto_iterate_fixedPoint (x) :
    Tendsto (fun n ↦ f^[n] x) atTop (𝓝 <| fixedPoint f hf)

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

Filter.Tendsto (fun n => f^[n] x) Filter.atTop (𝓝 (ContractingWith.fixedPoint f hf))


/-- The top-right evaluation `Square C ⥤ C`. -/
@[simps]
def evaluation₂ : Square C ⥤ C

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

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), CategoryTheory.Square.evaluation₂.map φ = φ.τ₂


private lemma zpow_zero_pos (a : α) : 0 < a ^ (0 : ℤ)

{α : Type u_4}
[LinearOrderedSemifield α]
(a : α)


@[simp]
theorem coe_mk (s : Set α) (h₁ h₂) : (mk s h₁ h₂ : Set α) = s

(h₂ : ∀ ⦃s_1 : Set α⦄, IsChain (fun x x_1 => x ≤ x_1) s_1 → s ⊆ s_1 → s = s_1)

↑{ carrier := s, Chain' := h₁, max_chain' := h₂ } = s


@[simp] lemma sqrt_le_one : √x ≤ 1 ↔ x ≤ 1

√x ≤ 1 ↔ x ≤ 1


@[simp]
theorem coe_toAlgHom : ↑(toAlgHom R S A) = algebraMap S A

(R : Type u)
(S : Type v)
(A : Type w)
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Algebra R S]
[Algebra S A]
[Algebra R A]
[IsScalarTower R S A]

↑(IsScalarTower.toAlgHom R S A) = algebraMap S A


/-- In a vector bundle, a trivialization in the fiber (which is a priori only linear)
is in fact a continuous linear equiv between the fibers and the model fiber. -/
@[simps (config := .asFn) apply symm_apply]
def continuousLinearEquivAt (e : Trivialization F (π F E)) [e.IsLinear R] (b : B)
    (hb : b ∈ e.baseSet) : E b ≃L[R] F

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

⇑(Trivialization.continuousLinearEquivAt R e b hb).symm = e.symm b


theorem exists_pos_forall_lt_edist (hs : IsCompact s) (ht : IsClosed t) (hst : Disjoint s t) :
    ∃ r : ℝ≥0, 0 < r ∧ ∀ x ∈ s, ∀ y ∈ t, (r : ℝ≥0∞) < edist x y

{α : Type u}
[PseudoEMetricSpace α]
{s t : Set α}
(hs : IsCompact s)
(ht : IsClosed t)
(hst : Disjoint s t)

∃ r, 0 < r ∧ ∀ x ∈ s, ∀ y ∈ t, ↑r < edist x y


@[simp]
theorem natCast_apply [ContinuousAdd M₁] (n : ℕ) (m : M₁) : (↑n : M₁ →L[R₁] M₁) m = n • m

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[ContinuousAdd M₁]
(n : ℕ)
(m : M₁)


/-- `m` is an `n`-smooth number if and only if `m ≠ 0` and the `Finset` of its prime factors
is contained in the `Finset` of primes below `n` -/
lemma mem_smoothNumbers_iff_primeFactors_subset {m n : ℕ} :
    m ∈ n.smoothNumbers ↔ m ≠ 0 ∧ m.primeFactors ⊆ n.primesBelow


theorem lowerSemicontinuousOn_const : LowerSemicontinuousOn (fun _x => z) s

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{s : Set α}
{z : β}


@[simp]
theorem map_eq (x) : map Q g hy ((algebraMap R S) x) = algebraMap P Q (g 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]
(x : R)

(IsLocalization.map Q g hy) ((algebraMap R S) x) = (algebraMap P Q) (g x)


/-- **Maximum modulus principle**: if `f : E → F` is complex differentiable on a bounded set `U` and
`‖f z‖ ≤ C` for any `z ∈ frontier U`, then the same is true for any `z ∈ closure U`. -/
theorem norm_le_of_forall_mem_frontier_norm_le {f : E → F} {U : Set E} (hU : IsBounded U)
    (hd : DiffContOnCl ℂ f U) {C : ℝ} (hC : ∀ z ∈ frontier U, ‖f z‖ ≤ C) {z : E}
    (hz : z ∈ closure U) : ‖f z‖ ≤ C

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace ℂ F]
[Nontrivial E]
{f : E → F}
{U : Set E}
(hU : Bornology.IsBounded U)
(hd : DiffContOnCl ℂ f U)
{C : ℝ}
(hC : ∀ z ∈ frontier U, ‖f z‖ ≤ C)
{z : E}
(hz : z ∈ closure U)


/-- A cone extended by an isomorphism is isomorphic to the original cone. -/
@[simps]
def extendIso (s : Cone F) {X : C} (f : X ≅ s.pt) : s.extend f.hom ≅ s

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(s : CategoryTheory.Limits.Cone F)
{X : C}
(f : X ≅ s.pt)

(CategoryTheory.Limits.Cones.extendIso s f).inv.hom = f.inv


@[simp]
lemma Spec.map_inv {R S : CommRingCat} (f : R ⟶ S) [IsIso f] :
    Spec.map (inv f) = inv (Spec.map f)

{R S : CommRingCat}
(f : R ⟶ S)
[CategoryTheory.IsIso f]

AlgebraicGeometry.Spec.map (CategoryTheory.inv f) = CategoryTheory.inv (AlgebraicGeometry.Spec.map f)


theorem WCovBy.eq_or_eq (h : a ⩿ b) (h2 : a ≤ c) (h3 : c ≤ b) : c = a ∨ c = b

{α : Type u_1}
[PartialOrder α]
{a b c : α}
(h : a ⩿ b)
(h2 : a ≤ c)
(h3 : c ≤ b)


/-- A version of `Quotient.eq'` compatible with `Setoid.Rel`, to make rewriting possible. -/
theorem Quotient.eq_rel {r : Setoid α} {x y} :
    (Quotient.mk' x : Quotient r) = Quotient.mk' y ↔ r.Rel x y

Quotient.mk' x = Quotient.mk' y ↔ r.Rel x y


private theorem bound'_sq :
    Tendsto (fun n : ℕ => ‖F.derivative.eval a‖ ^ 2 * T ^ 2 ^ n) atTop (𝓝 0)

(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)

Filter.Tendsto (fun n => ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2 * T_gen p F a ^ 2 ^ n) Filter.atTop (𝓝 0)


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

(e : Pretrivialization F Bundle.TotalSpace.proj)

⇑(Pretrivialization.linearEquivAt R e b hb).symm = e.symm b


@[to_additive]
theorem mul_mem_mul : a ∈ s → b ∈ t → a * b ∈ s * t

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


theorem coe_decompose_mul_of_right_mem_of_le (b_mem : b ∈ 𝒜 i) (h : i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = decompose 𝒜 a (n - i) * b

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

↑(((DirectSum.decompose 𝒜) (a * b)) n) = ↑(((DirectSum.decompose 𝒜) a) (n - i)) * b


theorem mul_reindexLinearEquiv_one [Fintype n] [DecidableEq o] (e₁ : o ≃ n) (e₂ : o ≃ n')
    (M : Matrix m n A) :
    M * (reindexLinearEquiv R A e₁ e₂ 1) =
      reindexLinearEquiv R A (Equiv.refl m) (e₁.symm.trans e₂) M

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{n' : Type u_7}
(R : Type u_11)
(A : Type u_12)
[Semiring R]
[Semiring A]
[Module R A]
[Fintype n]
[DecidableEq o]
(e₁ : o ≃ n)
(e₂ : o ≃ n')
(M : Matrix m n A)

M * (Matrix.reindexLinearEquiv R A e₁ e₂) 1 = (Matrix.reindexLinearEquiv R A (Equiv.refl m) (e₁.symm.trans e₂)) M


@[simp]
theorem coe_of (X : Type u) [UniformSpace X] [CompleteSpace X] [T0Space X] :
    (of X : Type u) = X


theorem Computable.eqv (α) [Denumerable α] : (Denumerable.eqv α).Computable


@[reassoc (attr := simp)]
lemma π_descHomology (k : S.cycles ⟶ A) (hk : S.toCycles ≫ k = 0) :
    S.homologyπ ≫ S.descHomology k hk = k

(hk : CategoryTheory.CategoryStruct.comp S.toCycles k = 0)

CategoryTheory.CategoryStruct.comp S.homologyπ (S.descHomology k hk) = k


theorem smul_apply (f : R[X]) (g : PolynomialModule R M) (n : ℕ) :
    (f • g) n = ∑ x ∈ Finset.antidiagonal n, f.coeff x.1 • g x.2

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(f : R[X])
(g : PolynomialModule R M)
(n : ℕ)


@[simp]
theorem LinearMap.ker_restrictScalars (f : M →ₗ[S] N) :
    LinearMap.ker (f.restrictScalars R) = f.ker.restrictScalars R

(R : Type u_1)
{S : Type u_2}
{M : Type u_3}
{N : Type u_4}
[Semiring R]
[Semiring S]
[SMul R S]
[AddCommMonoid M]
[Module R M]
[Module S M]
[IsScalarTower R S M]
[AddCommMonoid N]
[Module R N]
[Module S N]
[IsScalarTower R S N]
(f : M →ₗ[S] N)

LinearMap.ker (↑R f) = Submodule.restrictScalars R (LinearMap.ker f)


theorem coe_add (m n : ℕ) : ↑(m + n) = (m + n : ℕ∞)


/-- A `PSigma`-type is equivalent to the corresponding `Sigma`-type. -/
@[simps apply symm_apply]
def psigmaEquivSigma {α} (β : α → Type*) : (Σ' i, β i) ≃ Σ i, β i

{α : Type u_2}
(β : α → Type u_1)
(a : (i : α) × β i)

(Equiv.psigmaEquivSigma β).symm a = ⟨a.fst, a.snd⟩


@[to_additive (attr := simp)]
theorem singleton_div (a : α) : {a} / s = s.image (a / ·)

{α : Type u_2}
[DecidableEq α]
[Div α]
{s : Finset α}
(a : α)

{a} / s = Finset.image (fun x => a / x) s


theorem step_run {k : K} (q : Stmt₂) (v : σ) (S : ∀ k, List (Γ k)) : ∀ s : StAct₂ k,
    TM2.stepAux (stRun s q) v S = TM2.stepAux q (stVar v (S k) s) (update S k (stWrite v (S k) s))

{K : Type u_1}
[DecidableEq K]
{Γ : K → Type u_2}
{Λ : Type u_3}
{σ : Type u_4}
{k : K}
(q : Turing.TM2.Stmt Γ Λ σ)
(v : σ)
(S : (k : K) → List (Γ k))
(s : Turing.TM2to1.StAct k)

Turing.TM2.stepAux (Turing.TM2to1.stRun s q) v S =
  Turing.TM2.stepAux q (Turing.TM2to1.stVar v (S k) s) (Function.update S k (Turing.TM2to1.stWrite v (S k) s))


@[simp]
theorem codisjoint_inf_right : Codisjoint a (b ⊓ c) ↔ Codisjoint a b ∧ Codisjoint a c

{α : Type u_1}
[DistribLattice α]
[OrderTop α]
{a b c : α}


theorem filterMap_append {α β : Type _} (l l' : List α) (f : α → Option β) :
    filterMap f (l ++ l') = filterMap f l ++ filterMap f l'

{α : Type u_1}
{β : Type u_2}
(l l' : List α)
(f : α → Option β)

List.filterMap f (l ++ l') = List.filterMap f l ++ List.filterMap f l'


nonrec theorem IsEquivalent.isBigO (h : u ~[l] v) : u =O[l] v

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u v : α → β}
{l : Filter α}
(h : u ~[l] v)


theorem ext_iff {f g : M ↪ₑ[L] N} : f = g ↔ ∀ x, f x = g x

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
[L.Structure N]
{f g : M ↪ₑ[L] N}


theorem of_div (h : a / c ≡ b / c [ZMOD m / c]) (ha : c ∣ a) (ha : c ∣ b) (ha : c ∣ m) :
    a ≡ b [ZMOD m]

{m a b c : ℤ}
(h : a / c ≡ b / c [ZMOD m / c])
(ha : c ∣ a)


/-- To show a category is an `InitialMonoClass` it suffices to give an initial object such that
every morphism out of it is a monomorphism. -/
theorem InitialMonoClass.of_isInitial {I : C} (hI : IsInitial I) (h : ∀ X, Mono (hI.to X)) :
    InitialMonoClass C

(hI : CategoryTheory.Limits.IsInitial I)

(h : ∀ (X : C), CategoryTheory.Mono (hI.to X))


@[simp]
theorem preimage_mul_const_Iio_of_neg (a : α) {c : α} (h : c < 0) :
    (fun x => x * c) ⁻¹' Iio a = Ioi (a / c)

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

(fun x => x * c) ⁻¹' Set.Iio a = Set.Ioi (a / c)


theorem Icc_add_bij : BijOn (· + d) (Icc a b) (Icc (a + d) (b + d))

{M : Type u_1}
[OrderedCancelAddCommMonoid M]
[ExistsAddOfLE M]
(a b d : M)

Set.BijOn (fun x => x + d) (Set.Icc a b) (Set.Icc (a + d) (b + d))


/-- Variant of `IsPushout.of_right` where `h₂₂` is induced from a morphism `h₂₃ : X₂₁ ⟶ X₂₃`, and
the universal property of the left square.

The objects in the statement fit into the following diagram:
```
X₁₁ - h₁₁ -> X₁₂ - h₁₂ -> X₁₃
|            |            |
v₁₁          v₁₂          v₁₃
↓            ↓            ↓
X₂₁ - h₂₁ -> X₂₂ - h₂₂ -> X₂₃
```
-/
theorem of_left' {X₁₁ X₁₂ X₁₃ X₂₁ X₂₂ X₂₃ : C} {h₁₁ : X₁₁ ⟶ X₁₂} {h₁₂ : X₁₂ ⟶ X₁₃} {h₂₁ : X₂₁ ⟶ X₂₂}
    {h₂₃ : X₂₁ ⟶ X₂₃} {v₁₁ : X₁₁ ⟶ X₂₁} {v₁₂ : X₁₂ ⟶ X₂₂} {v₁₃ : X₁₃ ⟶ X₂₃}
    (s : IsPushout (h₁₁ ≫ h₁₂) v₁₁ v₁₃ h₂₃) (t : IsPushout h₁₁ v₁₁ v₁₂ h₂₁) :
    IsPushout h₁₂ v₁₂ v₁₃ (t.desc (h₁₂ ≫ v₁₃) h₂₃ (by rw [← Category.assoc, s.w]))

{X₁₁ X₁₂ X₁₃ X₂₁ X₂₂ X₂₃ : C}

{h₁₁ : X₁₁ ⟶ X₁₂}

{h₁₂ : X₁₂ ⟶ X₁₃}

{h₂₁ : X₂₁ ⟶ X₂₂}

{h₂₃ : X₂₁ ⟶ X₂₃}

{v₁₁ : X₁₁ ⟶ X₂₁}

{v₁₂ : X₁₂ ⟶ X₂₂}

{v₁₃ : X₁₃ ⟶ X₂₃}

(s : CategoryTheory.IsPushout (h₁₁ ≫ h₁₂) v₁₁ v₁₃ h₂₃)

(t : CategoryTheory.IsPushout h₁₁ v₁₁ v₁₂ h₂₁)

CategoryTheory.IsPushout h₁₂ v₁₂ v₁₃ (t.desc (h₁₂ ≫ v₁₃) h₂₃ ⋯)


@[to_additive]
theorem map_mul_left_eq_self (μ : Measure G) [IsMulLeftInvariant μ] (g : G) :
    map (g * ·) μ = μ

{G : Type u_2}
[MeasurableSpace G]
[Add G]
(μ : MeasureTheory.Measure G)
[μ.IsAddLeftInvariant]
(g : G)

MeasureTheory.Measure.map (fun x => g + x) μ = μ


theorem Dense.inter_nhds_nonempty (hs : Dense s) (ht : t ∈ 𝓝 x) :
    (s ∩ t).Nonempty

{X : Type u}
{x : X}
{s t : Set X}
[TopologicalSpace X]
(hs : Dense s)
(ht : t ∈ 𝓝 x)


@[simp]
protected theorem run_pure {α : Type v} : ∀ x : α, (pure x : Comp F G α).run = pure (pure x)

{F : Type u → Type w}
{G : Type v → Type u}
[Applicative F]
[Applicative G]
{α : Type v}
(x : α)


@[simp]
theorem brange_bfamilyOfFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] (f : ι → α) :
    brange _ (bfamilyOfFamily' r f) = range f

{α : Type u_1}
{ι : Type u}
(r : ι → ι → Prop)
[IsWellOrder ι r]
(f : ι → α)

(Ordinal.type r).brange (Ordinal.bfamilyOfFamily' r f) = Set.range f


@[to_additive mem_prod]
theorem mem_prod {s : Submonoid M} {t : Submonoid N} {p : M × N} :
    p ∈ s.prod t ↔ p.1 ∈ s ∧ p.2 ∈ t

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


/-- If `f` is closable, then the closure is closable. -/
theorem IsClosable.closureIsClosable {f : E →ₗ.[R] F} (hf : f.IsClosable) : f.closure.IsClosable

{R : Type u_1}
{E : Type u_2}
{F : Type u_3}
[CommRing R]
[AddCommGroup E]
[AddCommGroup F]
[Module R E]
[Module R F]
[TopologicalSpace E]
[TopologicalSpace F]
[ContinuousAdd E]
[ContinuousAdd F]
[TopologicalSpace R]
[ContinuousSMul R E]
[ContinuousSMul R F]
{f : E →ₗ.[R] F}
(hf : f.IsClosable)


@[simp] theorem isAtom_iff {p : Prop} : IsAtom p ↔ p