@[to_additive]
theorem comap_map_eq_self_of_injective {f : G →* N} (h : Function.Injective f) (H : Subgroup G) :
    comap f (map f H) = H

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
(h : Function.Injective ⇑f)
(H : Subgroup G)


@[higher_order tsnd_comp_tfst]
theorem tsnd_tfst {α₀ α₁ β₀ β₁} (f : α₀ → F α₁) (f' : β₀ → G β₁) (x : t α₀ β₀) :
    Comp.mk (tsnd f' <$> tfst f x)
      = bitraverse (Comp.mk ∘ map pure ∘ f) (Comp.mk ∘ pure ∘ f') x

{t : Type u → Type u → Type u}
[Bitraversable t]
{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulBitraversable t]
[LawfulApplicative F]
[LawfulApplicative G]
{α₀ α₁ β₀ β₁ : Type u}
(f : α₀ → F α₁)
(f' : β₀ → G β₁)
(x : t α₀ β₀)

Functor.Comp.mk (Bitraversable.tsnd f' <$> Bitraversable.tfst f x) =
  bitraverse (Functor.Comp.mk ∘ Functor.map pure ∘ f) (Functor.Comp.mk ∘ pure ∘ f') x


@[norm_cast, simp]
theorem coe_inj {a b : R} : (↑a : A) = ↑b ↔ a = b

{R : Type u_1}
{A : Type u_2}
[Field R]
[CommSemiring A]
[Nontrivial A]
[Algebra R A]
{a b : R}


@[to_additive]
theorem BddBelow.mul {s t : Set M} (hs : BddBelow s) (ht : BddBelow t) : BddBelow (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]


theorem exists_dist_eq (x z : E) {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) :
    ∃ y, dist x y = b * dist x z ∧ dist y z = a * dist x z

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(x z : E)
{a b : ℝ}
(ha : 0 ≤ a)
(hb : 0 ≤ b)
(hab : a + b = 1)


/-- Evaluation on an object `X` gives a functor
`PresheafOfModules R ⥤ ModuleCat (R.obj X)`. -/
@[simps]
def evaluation (X : Cᵒᵖ) : PresheafOfModules.{v} R ⥤ ModuleCat (R.obj X)

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

(PresheafOfModules.evaluation R X).obj M = M.obj X


/-- If `p ≠ 0` and `p ≠ 1`, then `padicValInt p p` is `1`. -/
theorem self (hp : 1 < p) : padicValInt p p = 1


theorem add_eq_left_iff {a b : Cardinal} : a + b = a ↔ max ℵ₀ b ≤ a ∨ b = 0


theorem tendsto_nhds_of_eventually_eq {l : Filter α} {f : α → X} (h : ∀ᶠ x' in l, f x' = x) :
    Tendsto f l (𝓝 x)

{X : Type u}
{α : Type u_1}
{x : X}
[TopologicalSpace X]
{l : Filter α}
{f : α → X}
(h : ∀ᶠ (x' : α) in l, f x' = x)


lemma cast_eq_mod (p : ℕ) [CharP R p] (k : ℕ) : (k : R) = (k % p : ℕ)

(R : Type u_1)
[NonAssocRing R]
(p : ℕ)
[CharP R p]
(k : ℕ)


@[to_additive (attr := simp)]
theorem toProd_apply_inl (x : M) : toProd (inl x : M ∗ N) = (x, 1)

{M : Type u_1}
{N : Type u_2}
[Monoid M]
[Monoid N]
(x : M)

Monoid.Coprod.toProd (Monoid.Coprod.inl x) = (x, 1)


protected theorem lt_add_of_sub_lt_left (h : a ≠ ∞ ∨ b ≠ ∞) : a - b < c → a < b + c


@[to_additive]
theorem multiset_noncommProd_mem (S : Submonoid M) (m : Multiset M) (comm) (h : ∀ x ∈ m, x ∈ S) :
    m.noncommProd comm ∈ S

(comm : {x | x ∈ m}.Pairwise AddCommute)


theorem destruct_eq_cons {s : Seq α} {a s'} : destruct s = some (a, s') → s = cons a s'

{α : Type u}
{s : Stream'.Seq α}
{a : α}
{s' : Stream'.Seq α}

s.destruct = some (a, s') → s = Stream'.Seq.cons a s'


theorem log_of_nnreal {x : ℝ≥0} (h : x ≠ 0) :
    log (x : ℝ≥0∞) = Real.log x


/-- Relation between Beta integral and Gamma function.  -/
theorem Gamma_mul_Gamma_eq_betaIntegral {s t : ℂ} (hs : 0 < re s) (ht : 0 < re t) :
    Gamma s * Gamma t = Gamma (s + t) * betaIntegral s t

Complex.Gamma s * Complex.Gamma t = Complex.Gamma (s + t) * s.betaIntegral t


theorem fin_curry₁ {n} {f : Fin n → α → σ} : Primrec₂ f ↔ ∀ i, Primrec (f i)

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
{n : ℕ}
{f : Fin n → α → σ}

Primrec₂ f ↔ ∀ (i : Fin n), Primrec (f i)


theorem toNNRat_sum_of_nonneg {s : Finset α} {f : α → ℚ} (hf : ∀ a, a ∈ s → 0 ≤ f a) :
    (∑ a ∈ s, f a).toNNRat = ∑ a ∈ s, (f a).toNNRat

{α : Type u_2}
{s : Finset α}
{f : α → ℚ}
(hf : ∀ a ∈ s, 0 ≤ f a)


@[simp] lemma div_ratCast_re (z : ℂ) (x : ℚ) : (z / x).re = z.re / x


/-- `LinearMap.BilinForm.toQuadraticMap` as an additive homomorphism -/
@[simps]
def toQuadraticMapAddMonoidHom : (BilinMap R M N) →+ QuadraticMap R M N

(R : Type u_3)
(M : Type u_4)
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(B : LinearMap.BilinMap R M N)

(LinearMap.BilinMap.toQuadraticMapAddMonoidHom R M) B = B.toQuadraticMap


/-- If the angle between two vectors is `π`, the second vector is nonzero. -/
theorem right_ne_zero_of_oangle_eq_pi {x y : V} (h : o.oangle x y = π) : y ≠ 0

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


theorem image_connectedComponentIn {s : Set X} (h : X ≃ₜ Y) {x : X} (hx : x ∈ s) :
    h '' connectedComponentIn s x = connectedComponentIn (h '' s) (h x)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
(h : X ≃ₜ Y)
{x : X}
(hx : x ∈ s)

⇑h '' connectedComponentIn s x = connectedComponentIn (⇑h '' s) (h x)


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_Ioc : (Ioc a b).Nonempty ↔ a < b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


@[simp]
theorem mk_inl {W : C} (inl : Y ⟶ W) (inr : Z ⟶ W) (eq : f ≫ inl = g ≫ inr) :
    (mk inl inr eq).inl = inl

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : C}
{f : X ⟶ Y}
{g : X ⟶ Z}
{W : C}
(inl : Y ⟶ W)
(inr : Z ⟶ W)
(eq : f ≫ inl = g ≫ inr)

(CategoryTheory.Limits.PushoutCocone.mk inl inr eq).inl = inl


@[simp]
theorem natDegree_nodal [Nontrivial R] : (nodal s v).natDegree = s.card

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
{s : Finset ι}
{v : ι → R}
[Nontrivial R]


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


lemma smash_natAdd {p q : RelSeries r} (h : p.last = q.head) (i : Fin q.length) :
    smash p q h (Fin.castSucc <| i.natAdd p.length) = q (Fin.castSucc i)

{α : Type u_1}
{r : Rel α α}
{p q : RelSeries r}
(h : p.last = q.head)
(i : Fin q.length)

(p.smash q h).toFun (Fin.natAdd p.length i).castSucc = q.toFun i.castSucc


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

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

M.toPresheafOfModules.obj X = ModuleCat.of (↑(R.obj X)) (M.obj X)


@[simp]
theorem top_boxes : (⊤ : Prepartition I).boxes = {I}


/-- When `V` is braided the forgetful functor `Action V G` to `V` is braided. -/
@[simps!]
def forgetBraided : BraidedFunctor (Action V G) V

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
(G : MonCat)
[CategoryTheory.MonoidalCategory V]
[CategoryTheory.BraidedCategory V]


lemma exists_between_coe_real {x z : EReal} (h : x < z) : ∃ y : ℝ, x < y ∧ y < z


theorem sum_incMatrix_apply [Fintype (neighborSet G a)] :
    ∑ e, G.incMatrix R a e = G.degree a

{R : Type u_1}
{α : Type u_2}
(G : SimpleGraph α)
[Fintype (Sym2 α)]
[NonAssocSemiring R]
{a : α}
[Fintype ↑(G.neighborSet a)]

∑ e : Sym2 α, SimpleGraph.incMatrix R G a e = ↑(G.degree a)


theorem xor_assoc : ∀ (x y z : Bool), xor (xor x y) z = xor x (xor y z)


theorem isLittleO_abs_log_rpow_rpow_nhds_zero {s : ℝ} (r : ℝ) (hs : s < 0) :
    (fun x => |log x| ^ r) =o[𝓝[>] 0] fun x => x ^ s

(fun x => |Real.log x| ^ r) =o[𝓝[>] 0] fun x => x ^ s


theorem sum_toPOUFun_eq (x : X) : ∑ᶠ i, f.toPOUFun i x = 1 - ∏ᶠ i, (1 - f i x)

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

∑ᶠ (i : ι), f.toPOUFun i x = 1 - ∏ᶠ (i : ι), (1 - (f i) x)


lemma l2_opNNNorm_conjTranspose [DecidableEq m] (A : Matrix m n 𝕜) : ‖Aᴴ‖₊ = ‖A‖₊

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

‖Aᴴ‖₊ = ‖A‖₊


@[simp]
theorem midpoint_eq_right_iff {x y : P} : midpoint R x y = y ↔ x = y

(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 y : P}


@[to_additive]
theorem swap_bijective : Bijective (swap M N)

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]

Function.Bijective ⇑(AddMonoid.Coprod.swap M N)


theorem norm_iteratedFDeriv_eq_norm_iteratedDeriv :
    ‖iteratedFDeriv 𝕜 n f x‖ = ‖iteratedDeriv n f x‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}
{x : 𝕜}


theorem fromRel_bot : fromRel (fun (x y : α) z => z : Symmetric ⊥) = ∅


/-- The equivalence between `TwoP` and itself induced by `Prod.swap` both ways. -/
@[simps!]
noncomputable def swapEquiv : TwoP ≌ TwoP

(a : ((TwoP.swap ⋙ TwoP.swap).obj X).toBipointed.X)

(TwoP.swapEquiv.counitIso.hom.app X).toFun a = a


lemma eval₂_evalRingHom (x : R) :
    eval₂ (evalRingHom x) = evalEval x

Polynomial.eval₂ (Polynomial.evalRingHom x) = Polynomial.evalEval x


@[simp] theorem intersperse_single (sep : α) : [x].intersperse sep = [x]

List.intersperse sep (x :: List.nil) = x :: List.nil


@[simp] protected theorem div_zero (n : Nat) : n / 0 = 0


theorem range_toLpHom [Fact (1 ≤ p)] :
    ((toLpHom p μ).range : AddSubgroup (Lp E p μ)) =
      MeasureTheory.Lp.boundedContinuousFunction E p μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
(p : ℝ≥0∞)
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup E]
[TopologicalSpace α]
[BorelSpace α]
[SecondCountableTopologyEither α E]
[MeasureTheory.IsFiniteMeasure μ]
[Fact (1 ≤ p)]

(BoundedContinuousFunction.toLpHom p μ).range = MeasureTheory.Lp.boundedContinuousFunction E p μ


/-- A category embeds into its `R`-linear completion.
-/
@[simps]
def embedding : C ⥤ Free R C

(R : Type u_1)
[CommRing R]
(C : Type u)
[CategoryTheory.Category.{v, u} C]
{X Y : C}
(f : X ⟶ Y)

(CategoryTheory.Free.embedding R C).map f = Finsupp.single f 1


theorem rightInverse_iff_comp {f : α → β} {g : β → α} : RightInverse f g ↔ g ∘ f = id

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
{g : β → α}


protected theorem Commute.inv_add_inv (hab : Commute a b) (ha : a ≠ 0) (hb : b ≠ 0) :
    a⁻¹ + b⁻¹ = (a + b) / (a * b)

{α : Type u_1}
[DivisionSemiring α]
{a b : α}
(hab : Commute a b)
(ha : a ≠ 0)
(hb : b ≠ 0)


@[to_additive]
theorem prod_map_eq_pow_single [DecidableEq ι] (i : ι)
    (hf : ∀ i' ≠ i, i' ∈ m → f i' = 1) : (m.map f).prod = f i ^ m.count i

(hf : ∀ (i' : ι), i' ≠ i → i' ∈ m → f i' = 1)

(Multiset.map f m).prod = f i ^ Multiset.count i m


@[simp, norm_cast]
lemma cast_sum [AddCommMonoidWithOne β] (s : Finset α) (f : α → ℕ) :
    ↑(∑ x ∈ s, f x : ℕ) = ∑ x ∈ s, (f x : β)

{α : Type u_2}
{β : Type u_3}
[AddCommMonoidWithOne β]
(s : Finset α)
(f : α → ℕ)


@[simp]
theorem prod_range_factorial_succ (n : ℕ) : ∏ x ∈ range n, (x + 1)! = sf n

∏ x ∈ Finset.range n, (x + 1).factorial = n.superFactorial


theorem option_casesOn_right {o : α → Option β} {f : α → σ} {g : α → β →. σ} (ho : Computable o)
    (hf : Computable f) (hg : Partrec₂ g) :
    @Partrec _ σ _ _ fun a => Option.casesOn (o a) (Part.some (f a)) (g a)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{o : α → Option β}
{f : α → σ}
{g : α → β →. σ}
(ho : Computable o)
(hf : Computable f)
(hg : Partrec₂ g)

Partrec fun a => Option.casesOn (o a) (Part.some (f a)) (g a)


@[simp]
theorem piQuotientLift_mk [Fintype ι] [DecidableEq ι] (p : ∀ i, Submodule R (Ms i))
    (q : Submodule R N) (f : ∀ i, Ms i →ₗ[R] N) (hf : ∀ i, p i ≤ q.comap (f i)) (x : ∀ i, Ms i) :
    (piQuotientLift p q f hf fun i => Quotient.mk (x i)) = Quotient.mk (lsum _ _ R f x)

(hf : ∀ (i : ι), p i ≤ Submodule.comap (f i) q)

((Submodule.piQuotientLift p q f hf) fun i => Submodule.Quotient.mk (x i)) =
  Submodule.Quotient.mk (((LinearMap.lsum R Ms R) f) x)


theorem ofNat_div (m n : Nat) : ↑(m / n) = div ↑m ↑n


@[simp]
theorem LinearMap.toMatrix'_symm :
    (LinearMap.toMatrix'.symm : Matrix m n R ≃ₗ[R] _) = Matrix.toLin'

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


theorem isLeast_opNorm : IsLeast {c : ℝ | 0 ≤ c ∧ ∀ m, ‖f m‖ ≤ c * ∏ i, ‖m i‖} ‖f‖

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

IsLeast {c | 0 ≤ c ∧ ∀ (m : (i : ι) → E i), ‖f m‖ ≤ c * ∏ i : ι, ‖m i‖} ‖f‖


theorem or_iff_left  (hb : ¬b) : a ∨ b ↔ a


@[simp]
theorem Tape.nth_zero {Γ} [Inhabited Γ] (T : Tape Γ) : T.nth 0 = T.1

{Γ : Type u_1}
[Inhabited Γ]
(T : Turing.Tape Γ)


theorem toSphere_apply_univ' : μ.toSphere univ = dim E * μ (ball 0 1 \ {0})

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(μ : MeasureTheory.Measure E)

μ.toSphere Set.univ = ↑(dim E) * μ (Metric.ball 0 1 \ {0})


@[simp]
theorem imageSubobjectIso_imageToKernel' (w : f ≫ g = 0) :
    (imageSubobjectIso f).hom ≫ imageToKernel' f g w =
      imageToKernel f g w ≫ (kernelSubobjectIso g).hom

(CategoryTheory.Limits.imageSubobjectIso f).hom ≫ imageToKernel' f g w =
  imageToKernel f g w ≫ (CategoryTheory.Limits.kernelSubobjectIso g).hom


@[to_additive]
theorem Finset.mulSupport_of_fiberwise_prod_subset_image [DecidableEq β] (s : Finset α) (f : α → M)
    (g : α → β) : (mulSupport fun b => (s.filter fun a => g a = b).prod f) ⊆ s.image g

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
[DecidableEq β]
(s : Finset α)
(f : α → M)
(g : α → β)

(Function.support fun b => (Finset.filter (fun a => g a = b) s).sum f) ⊆ ↑(Finset.image g s)


theorem one_submatrix_mul [Fintype m] [Finite o] [NonAssocSemiring α] [DecidableEq o] (e₁ : l → o)
    (e₂ : m ≃ o) (M : Matrix m n α) :
    ((1 : Matrix o o α).submatrix e₁ e₂) * M = submatrix M (e₂.symm ∘ e₁) id

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[Fintype m]
[Finite o]
[NonAssocSemiring α]
[DecidableEq o]
(e₁ : l → o)
(e₂ : m ≃ o)
(M : Matrix m n α)

Matrix.submatrix 1 e₁ ⇑e₂ * M = M.submatrix (⇑e₂.symm ∘ e₁) id


theorem kstar_le_of_mul_le_right (hb : 1 ≤ b) : a * b ≤ b → a∗ ≤ b

{α : Type u_1}
[KleeneAlgebra α]
{a b : α}
(hb : 1 ≤ b)


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

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

∀ {X Y : CategoryTheory.Limits.Cone F} (f : X ⟶ Y),
  ((CategoryTheory.Limits.Cone.equivCostructuredArrow F).functor.map f).right =
    CategoryTheory.CategoryStruct.id { as := PUnit.unit }


lemma quasiIsoAt_iff_exactAt' (f : K ⟶ L) (i : ι) [K.HasHomology i] [L.HasHomology i]
    (hL : L.ExactAt i) :
    QuasiIsoAt f i ↔ K.ExactAt i


@[field_simps]
theorem mul_ne_zero (ha : a ≠ 0) (hb : b ≠ 0) : a * b ≠ 0

{M₀ : Type u_2}
[Mul M₀]
[Zero M₀]
[NoZeroDivisors M₀]
{a b : M₀}
(ha : a ≠ 0)
(hb : b ≠ 0)


@[to_additive (attr := simp)]
theorem coe_set_mk {s : Subsemigroup M} (h_one) : (mk s h_one : Set M) = s

{M : Type u_1}
[AddZeroClass M]
{s : AddSubsemigroup M}
(h_one : 0 ∈ s.carrier)

↑{ toAddSubsemigroup := s, zero_mem' := h_one } = ↑s


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

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


/-- The functor `(S, F ⋙ G) ⥤ (S, G)`. -/
@[simps!]
def pre (S : D) (F : B ⥤ C) (G : C ⥤ D) : StructuredArrow S (F ⋙ G) ⥤ StructuredArrow S G

(X : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit S) (F.comp G))

((CategoryTheory.StructuredArrow.pre S F G).obj X).right = F.obj X.right


theorem contDiffWithinAt_extend_coord_change' [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
    (hf' : f' ∈ maximalAtlas I M) {x : M} (hxf : x ∈ f.source) (hxf' : x ∈ f'.source) :
    ContDiffWithinAt 𝕜 ⊤ (f.extend I ∘ (f'.extend I).symm) (range I) (f'.extend I x)

(hf : f ∈ SmoothManifoldWithCorners.maximalAtlas I M)

(hf' : f' ∈ SmoothManifoldWithCorners.maximalAtlas I M)

ContDiffWithinAt 𝕜 ⊤ (↑(f.extend I) ∘ ↑(f'.extend I).symm) (Set.range ↑I) (↑(f'.extend I) x)


theorem arsinh_bijective : Bijective arsinh


/-- The `Lp`-norm of a bounded continuous function is at most a constant (depending on the measure
of the whole space) times its sup-norm. -/
theorem Lp_nnnorm_le (f : α →ᵇ E) :
    ‖(⟨f.toContinuousMap.toAEEqFun μ, mem_Lp f⟩ : Lp E p μ)‖₊ ≤
      measureUnivNNReal μ ^ p.toReal⁻¹ * ‖f‖₊

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[TopologicalSpace α]
[BorelSpace α]
[SecondCountableTopologyEither α E]
[MeasureTheory.IsFiniteMeasure μ]
(f : α →ᵇ E)

‖⟨ContinuousMap.toAEEqFun μ f.toContinuousMap, ⋯⟩‖₊ ≤ MeasureTheory.measureUnivNNReal μ ^ p.toReal⁻¹ * ‖f‖₊


@[simp]
lemma _root_.IsometryEquiv.toDilationEquiv_symm (e : X ≃ᵢ Y) :
    e.toDilationEquiv.symm = e.symm.toDilationEquiv

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
(e : X ≃ᵢ Y)


@[simp]
theorem empty_union {s : AList β} : (∅ : AList β) ∪ s = s

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


theorem nodup_join {L : List (List α)} :
    Nodup (join L) ↔ (∀ l ∈ L, Nodup l) ∧ Pairwise Disjoint L

L.join.Nodup ↔ (∀ l ∈ L, l.Nodup) ∧ List.Pairwise List.Disjoint L


theorem le_ker_iff_map (M' : LieSubmodule R L M) : M' ≤ f.ker ↔ LieSubmodule.map f M' = ⊥

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup N]
[Module R N]
[LieRingModule L N]
{f : M →ₗ⁅R,L⁆ N}
(M' : LieSubmodule R L M)


@[mono]
theorem mono (HU : U₁ ≤ U₂) (hxy : x ≡ y [SMOD U₁]) : x ≡ y [SMOD U₂]

{R : Type u_1}
[Ring R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{U₁ U₂ : Submodule R M}
{x y : M}
(HU : U₁ ≤ U₂)
(hxy : x ≡ y [SMOD U₁])


/-- The product over the complement of a finset tends to `1` when the finset grows to cover the
whole space. This does not need a multipliability assumption, as otherwise all such products are
one. -/
@[to_additive "The sum over the complement of a finset tends to `0` when the finset grows to cover
the whole space. This does not need a summability assumption, as otherwise all such sums are zero."]
theorem tendsto_tprod_compl_atTop_one (f : α → G) :
    Tendsto (fun s : Finset α ↦ ∏' a : { x // x ∉ s }, f a) atTop (𝓝 1)

{α : Type u_1}
{G : Type u_5}
[TopologicalSpace G]
[CommGroup G]
[TopologicalGroup G]
(f : α → G)

Filter.Tendsto (fun s => ∏' (a : { x // x ∉ s }), f ↑a) Filter.atTop (𝓝 1)


@[to_additive]
theorem oreDiv_smul_oreDiv {r₁ : R} {r₂ : X} {s₁ s₂ : S} :
    (r₁ /ₒ s₁) • (r₂ /ₒ s₂) = oreNum r₁ s₂ • r₂ /ₒ (oreDenom r₁ s₂ * s₁)

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[MulAction R X]
{r₁ : R}
{r₂ : X}
{s₁ s₂ : ↥S}

(r₁ /ₒ s₁) • (r₂ /ₒ s₂) = OreLocalization.oreNum r₁ s₂ • r₂ /ₒ (OreLocalization.oreDenom r₁ s₂ * s₁)


@[reassoc (attr := simp)]
lemma biprod_inl_fst_f (i : ι) :
    (biprod.inl : K ⟶ K ⊞ L).f i ≫ (biprod.fst : K ⊞ L ⟶ K).f i = 𝟙 _

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

CategoryTheory.Limits.biprod.inl.f i ≫ CategoryTheory.Limits.biprod.fst.f i = 𝟙 (K.X i)


@[simp] theorem equiv_symm_apply (x : S × T) : (hST.equiv.symm x : G) = x.1.1 * x.2.1

{G : Type u_1}
[Group G]
{S T : Set G}
(hST : Subgroup.IsComplement S T)
(x : ↑S × ↑T)


lemma testFalseHelper (p : ℕ) (hp : Nat.blt 1 p = true)
    (h : Nat.ble 1 (sMod' (2 ^ p - 1) (p - 2))) : ¬ LucasLehmerTest p

(h : Nat.ble 1 (LucasLehmer.norm_num_ext.sMod' (2 ^ p - 1) (p - 2)) = true)


/-- An auxiliary lemma for `Basis.le_span`.

If `R` satisfies the rank condition,
then for any finite basis `b : Basis ι R M`,
and any finite spanning set `w : Set M`,
the cardinality of `ι` is bounded by the cardinality of `w`.
-/
theorem Basis.le_span'' {ι : Type*} [Fintype ι] (b : Basis ι R M) {w : Set M} [Fintype w]
    (s : span R w = ⊤) : Fintype.card ι ≤ Fintype.card w

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[RankCondition R]
{ι : Type u_1}
[Fintype ι]
(b : Basis ι R M)
{w : Set M}
[Fintype ↑w]
(s : Submodule.span R w = ⊤)


/-- An angle in a right-angled triangle expressed using `arccos`. -/
theorem oangle_left_eq_arccos_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) :
    ∡ p₃ p₁ p₂ = Real.arccos (dist p₁ p₂ / dist p₁ p₃)

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

∡ p₃ p₁ p₂ = ↑(Real.arccos (dist p₁ p₂ / dist p₁ p₃))


/-- Construct terminal object in the over category. This isn't an instance as it's not typically the
way we want to define terminal objects.
(For instance, this gives a terminal object which is different from the generic one given by
`over_product_of_widePullback` above.)
-/
theorem over_hasTerminal (B : C) : HasTerminal (Over B)

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


@[simp]
theorem star_mk (x y : ℤ) : star (⟨x, y⟩ : ℤ√d) = ⟨x, -y⟩

star { re := x, im := y } = { re := x, im := -y }


/-- A compact neighborhood of `1` in a topological group admits a closed compact subset
that is a neighborhood of `1`. -/
@[to_additive (attr := deprecated IsCompact.isCompact_isClosed_basis_nhds (since := "2024-01-28"))
  "A compact neighborhood of `0` in a topological additive group
admits a closed compact subset that is a neighborhood of `0`."]
theorem exists_isCompact_isClosed_subset_isCompact_nhds_one
    {L : Set G} (Lcomp : IsCompact L) (L1 : L ∈ 𝓝 (1 : G)) :
    ∃ K : Set G, IsCompact K ∧ IsClosed K ∧ K ⊆ L ∧ K ∈ 𝓝 (1 : G)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{L : Set G}
(Lcomp : IsCompact L)
(L1 : L ∈ 𝓝 0)

∃ K, IsCompact K ∧ IsClosed K ∧ K ⊆ L ∧ K ∈ 𝓝 0


@[simp]
theorem LinearMap.toMatrix'_toLinearMap₂' (M : Matrix n m N₂) :
    LinearMap.toMatrix₂' R (Matrix.toLinearMap₂' R (S₁ := S₁) (S₂ := S₂) M) = M

{R : Type u_1}
{S₁ : Type u_3}
{S₂ : Type u_5}
{N₂ : Type u_11}
{n : Type u_12}
{m : Type u_13}
[CommSemiring R]
[AddCommMonoid N₂]
[Module R N₂]
[Semiring S₁]
[Semiring S₂]
[Module S₁ N₂]
[Module S₂ N₂]
[SMulCommClass S₁ R N₂]
[SMulCommClass S₂ R N₂]
[SMulCommClass S₂ S₁ N₂]
[Fintype n]
[Fintype m]
[DecidableEq n]
[DecidableEq m]
(M : Matrix n m N₂)

(LinearMap.toMatrix₂' R) ((Matrix.toLinearMap₂' R) M) = M


protected theorem tsub_lt_tsub_right_of_le (hc : AddLECancellable c) (h : c ≤ a) (h2 : a < b) :
    a - c < b - c

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


theorem setOf_basis_eq (M : Matroid α) (hX : X ⊆ M.E := by aesop_mat) :
    {I | M.Basis I X} = maximals (· ⊆ ·) ({I | M.Indep I} ∩ Iic X)

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

{I | M.Basis I X} = maximals (fun x x_1 => x ⊆ x_1) ({I | M.Indep I} ∩ Set.Iic X)


theorem decide_congr {p q : Prop} [Decidable p] [Decidable q] (h : p ↔ q) : decide p = decide q


theorem IsClique.mono (h : G ≤ H) : G.IsClique s → H.IsClique s

{α : Type u_1}
{G H : SimpleGraph α}
{s : Set α}
(h : G ≤ H)


theorem image_cast_int_Ici (a : ℕ) : (↑) '' Ici a = Ici (a : ℤ)


theorem Memℒp.congr_norm {f : α → E} {g : α → F} (hf : Memℒp f p μ) (hg : AEStronglyMeasurable g μ)
    (h : ∀ᵐ a ∂μ, ‖f a‖ = ‖g a‖) : Memℒp g p μ

(hg : MeasureTheory.AEStronglyMeasurable g μ)


theorem inter_vsub_subset : s₁ ∩ s₂ -ᵥ t ⊆ (s₁ -ᵥ t) ∩ (s₂ -ᵥ t)

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{s₁ s₂ t : Set β}


theorem nsmul_congr {a a' : ℕ} (_ : (a : ℕ) = a') (_ : b = b') (_ : a' • b' = c) :
    (a • (b : R)) = c

{R : Type u_1}
[CommSemiring R]
{b b' c : R}
{a a' : ℕ}

a = a' → b = b' → a' • b' = c → a • b = c


theorem rank_span_finset_le (s : Finset M) : Module.rank R (span R (s : Set M)) ≤ s.card

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
(s : Finset M)

Module.rank R ↥(Submodule.span R ↑s) ≤ ↑s.card


theorem LowerSemicontinuousOn.mono (h : LowerSemicontinuousOn f s) (hst : t ⊆ s) :
    LowerSemicontinuousOn f t

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{f : α → β}
{s t : Set α}
(h : LowerSemicontinuousOn f s)
(hst : t ⊆ s)


theorem prod_rpow_of_ne_top {ι} {s : Finset ι} {f : ι → ℝ≥0∞} (hf : ∀ i ∈ s, f i ≠ ∞) (r : ℝ) :
    ∏ i ∈ s, f i ^ r = (∏ i ∈ s, f i) ^ r

{ι : Type u_1}
{s : Finset ι}
{f : ι → ℝ≥0∞}
(hf : ∀ i ∈ s, f i ≠ ⊤)
(r : ℝ)


theorem eval {R : Type*} [CommRing R] {I : Ideal R} {x y : R} (h : x ≡ y [SMOD I]) (f : R[X]) :
    f.eval x ≡ f.eval y [SMOD I]

{R : Type u_5}
[CommRing R]
{I : Ideal R}
{x y : R}
(h : x ≡ y [SMOD I])
(f : R[X])

Polynomial.eval x f ≡ Polynomial.eval y f [SMOD I]


@[to_additive (attr := simp)]
theorem mul_eq (x y : FreeMagma α) : mul x y = x * y


theorem quotient_mk_comp_C_isIntegral_of_jacobson {R : Type*} [CommRing R] [IsJacobson R]
    (P : Ideal (MvPolynomial (Fin n) R)) [hP : P.IsMaximal] :
    RingHom.IsIntegral (RingHom.comp (Quotient.mk P) (MvPolynomial.C))

{n : ℕ}
{R : Type u_1}
[CommRing R]
[Ideal.IsJacobson R]
(P : Ideal (MvPolynomial (Fin n) R))
[hP : P.IsMaximal]


theorem inv_diagonal (v : n → α) : (diagonal v)⁻¹ = diagonal (Ring.inverse v)

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(v : n → α)

(Matrix.diagonal v)⁻¹ = Matrix.diagonal (Ring.inverse v)


/-- `SimpleFunc.bintegral` and `SimpleFunc.integral` agree when the integrand has type
    `α →ₛ ℝ≥0∞`. But since `ℝ≥0∞` is not a `NormedSpace`, we need some form of coercion. -/
theorem integral_eq_lintegral {f : α →ₛ ℝ} (hf : Integrable f μ) (h_pos : 0 ≤ᵐ[μ] f) :
    f.integral μ = ENNReal.toReal (∫⁻ a, ENNReal.ofReal (f a) ∂μ)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : MeasureTheory.SimpleFunc α ℝ}
(hf : MeasureTheory.Integrable (↑f) μ)
(h_pos : 0 ≤ᵐ[μ] ↑f)

MeasureTheory.SimpleFunc.integral μ f = (∫⁻ (a : α), ENNReal.ofReal (↑f a) ∂μ).toReal


@[to_additive]
theorem ker_prod {M N : Type*} [MulOneClass M] [MulOneClass N] (f : G →* M) (g : G →* N) :
    (f.prod g).ker = f.ker ⊓ g.ker

{G : Type u_1}
[AddGroup G]
{M : Type u_8}
{N : Type u_9}
[AddZeroClass M]
[AddZeroClass N]
(f : G →+ M)
(g : G →+ N)


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

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

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


protected theorem map_smul (f : A →ₛₙₐ[φ] B) (c : R) (x : A) : f (c • x) = (φ c) • f x

{R : Type u}
{S : Type u₁}
[Monoid R]
[Monoid S]
{φ : R →* S}
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction S B]
(f : A →ₛₙₐ[φ] B)
(c : R)
(x : A)


/-- If `x + y` is irrational, then at least one of `x` and `y` is irrational. -/
theorem add_cases : Irrational (x + y) → Irrational x ∨ Irrational y


/-- Functor translating a commutative monoid object in a functor category
to a functor into the category of commutative monoid objects.
-/
@[simps!]
def functor : CommMon_ (C ⥤ D) ⥤ C ⥤ CommMon_ D

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

∀ {X Y : C} (a : X ⟶ Y),
  ((CategoryTheory.Monoidal.CommMonFunctorCategoryEquivalence.functor.obj A).map a).hom = A.X.map a


@[simp, norm_cast] lemma coe_succOrderEmb : ⇑(succOrderEmb n) = Fin.succ


lemma apply_mem_rootsOfUnity_orderOf (χ : MulChar F R) {a : F} (ha : a ≠ 0) :
    ∃ ζ ∈ rootsOfUnity ⟨orderOf χ, χ.orderOf_pos⟩ R, ζ = χ a

{F : Type u_1}
[Field F]
[Finite F]
{R : Type u_2}
[CommRing R]
(χ : MulChar F R)
{a : F}
(ha : a ≠ 0)

∃ ζ ∈ rootsOfUnity ⟨orderOf χ, ⋯⟩ R, ↑ζ = χ a


/-- Useful lemma to show `x` generates a power basis:
the powers of `x` less than the degree of `x`'s minimal polynomial are linearly independent. -/
theorem linearIndependent_pow [Algebra K S] (x : S) :
    LinearIndependent K fun i : Fin (minpoly K x).natDegree => x ^ (i : ℕ)

{S : Type u_2}
[Ring S]
{K : Type u_6}
[Field K]
[Algebra K S]
(x : S)


@[to_additive (attr := simp)]
theorem tprod_empty [IsEmpty β] : ∏' b, f b = 1

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


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

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

MeasureTheory.eLpNorm f p μ < ⊤ ↔ ∫⁻ (a : α), ↑‖f a‖₊ ^ p.toReal ∂μ < ⊤


theorem sum_range_reflect {δ : Type*} [AddCommMonoid δ] (f : ℕ → δ) (n : ℕ) :
    (∑ j ∈ range n, f (n - 1 - j)) = ∑ j ∈ range n, f j

{δ : Type u_3}
[AddCommMonoid δ]
(f : ℕ → δ)
(n : ℕ)

∑ j ∈ Finset.range n, f (n - 1 - j) = ∑ j ∈ Finset.range n, f j


theorem le_of_nadd_le_nadd_left : ∀ {a b c}, a ♯ b ≤ a ♯ c → b ≤ c


theorem map_inf_le [SemilatticeInf α] [SemilatticeInf β] {f : α → β} (h : Monotone f) (x y : α) :
    f (x ⊓ y) ≤ f x ⊓ f y

{α : Type u}
{β : Type v}
[SemilatticeInf α]
[SemilatticeInf β]
{f : α → β}
(h : Monotone f)
(x y : α)


theorem rpow_lt_rpow_of_exponent_lt (hx : 1 < x) (hyz : y < z) : x ^ y < x ^ z


theorem isPreirreducible_singleton {x} : IsPreirreducible ({x} : Set X)

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


/-- Intermediate stage of assembling the counit. -/
@[simps! hom]
def counitAux (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) :
    F ≅ restrictedYonedaObj (yonedaCollectionPresheafToA F)

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

(F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v))

(CategoryTheory.OverPresheafAux.counitAux F).hom =
  { app := fun X => (CategoryTheory.OverPresheafAux.counitAuxAux F (Opposite.unop X)).hom, naturality := ⋯ }


@[to_additive (attr := simp)]
theorem mulLeft_symm (u : Mˣ) : u.mulLeft.symm = u⁻¹.mulLeft

{M : Type u_6}
[AddMonoid M]
(u : AddUnits M)


theorem ae_eq_dirac [MeasurableSingletonClass α] {a : α} (f : α → δ) :
    f =ᵐ[dirac a] const α (f a)

{α : Type u_1}
{δ : Type u_3}
[MeasurableSpace α]
[MeasurableSingletonClass α]
{a : α}
(f : α → δ)

f =ᵐ[MeasureTheory.Measure.dirac a] Function.const α (f a)


theorem mem_pathComponent_of_mem (h : x ∈ pathComponent y) : y ∈ pathComponent x

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
(h : x ∈ pathComponent y)


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

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

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


/-- If `μ` satisfies `QuotientMeasureEqMeasurePreimage` relative to a both left- and right-
  invariant measure `ν` on `G`, then it is a `G` invariant measure on `G ⧸ Γ`. -/
@[to_additive]
lemma MeasureTheory.QuotientMeasureEqMeasurePreimage.smulInvariantMeasure_quotient
    [IsMulLeftInvariant ν] [hasFun : HasFundamentalDomain Γ.op G ν] :
    SMulInvariantMeasure G (G ⧸ Γ) μ

[hasFun : MeasureTheory.HasFundamentalDomain (↥Γ.op) G ν]

MeasureTheory.SMulInvariantMeasure G (G ⧸ Γ) μ


theorem uniformSpace_eq_inf_precomp_of_cover {δ₁ δ₂ : Type*} (φ₁ : δ₁ → α) (φ₂ : δ₂ → α)
    (𝔗₁ : Set (Set δ₁)) (𝔗₂ : Set (Set δ₂))
    (h_image₁ : MapsTo (φ₁ '' ·) 𝔗₁ 𝔖) (h_image₂ : MapsTo (φ₂ '' ·) 𝔗₂ 𝔖)
    (h_preimage₁ : MapsTo (φ₁ ⁻¹' ·) 𝔖 𝔗₁) (h_preimage₂ : MapsTo (φ₂ ⁻¹' ·) 𝔖 𝔗₂)
    (h_cover : ∀ S ∈ 𝔖, S ⊆ range φ₁ ∪ range φ₂) :
    𝒱(α, β, 𝔖, _) =
      .comap (ofFun 𝔗₁ ∘ (· ∘ φ₁) ∘ toFun 𝔖) 𝒱(δ₁, β, 𝔗₁, _) ⊓
      .comap (ofFun 𝔗₂ ∘ (· ∘ φ₂) ∘ toFun 𝔖) 𝒱(δ₂, β, 𝔗₂, _)

(φ₁ : δ₁ → α)

(φ₂ : δ₂ → α)

(h_image₁ : Set.MapsTo (fun x => φ₁ '' x) 𝔗₁ 𝔖)

(h_image₂ : Set.MapsTo (fun x => φ₂ '' x) 𝔗₂ 𝔖)

(h_preimage₁ : Set.MapsTo (fun x => φ₁ ⁻¹' x) 𝔖 𝔗₁)

(h_preimage₂ : Set.MapsTo (fun x => φ₂ ⁻¹' x) 𝔖 𝔗₂)

(h_cover : ∀ S ∈ 𝔖, S ⊆ Set.range φ₁ ∪ Set.range φ₂)

UniformOnFun.uniformSpace α β 𝔖 =
  UniformSpace.comap (⇑(UniformOnFun.ofFun 𝔗₁) ∘ (fun x => x ∘ φ₁) ∘ ⇑(UniformOnFun.toFun 𝔖))
      (UniformOnFun.uniformSpace δ₁ β 𝔗₁) ⊓
    UniformSpace.comap (⇑(UniformOnFun.ofFun 𝔗₂) ∘ (fun x => x ∘ φ₂) ∘ ⇑(UniformOnFun.toFun 𝔖))
      (UniformOnFun.uniformSpace δ₂ β 𝔗₂)


protected theorem map_pow (a : R) (n : ℕ) : abv (a ^ n) = abv a ^ n

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedRing S]
(abv : AbsoluteValue R S)
[IsDomain S]
[Nontrivial R]
(a : R)
(n : ℕ)


protected theorem denseRange (hp_ne_top : p ≠ ∞) :
    DenseRange ((↑) : Lp.simpleFunc E p μ → Lp E p μ)

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[Fact (1 ≤ p)]
(hp_ne_top : p ≠ ⊤)


theorem continuous_cons : Continuous fun x : α × List α => (x.1::x.2 : List α)


theorem mk_biUnion_le {ι α : Type u} (A : ι → Set α) (s : Set ι) :
    #(⋃ x ∈ s, A x) ≤ #s * ⨆ x : s, #(A x.1)

Cardinal.mk ↑(⋃ x ∈ s, A x) ≤ Cardinal.mk ↑s * ⨆ x, Cardinal.mk ↑(A ↑x)


@[deprecated (since := "2024-04-26")]
theorem LinearMap.toBilin_apply (f : M →ₗ[R] M →ₗ[R] R) (x y : M) :
    toBilin f x y = f x y

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(f : M →ₗ[R] M →ₗ[R] R)
(x y : M)


/-- Reinterpret a monoid isomorphism `f : M ≃* N` as an equivalence `SingleObj M ≌ SingleObj N`. -/
@[simps!]
def toSingleObjEquiv (e : M ≃* N) : SingleObj M ≌ SingleObj N

{M : Type u}
{N : Type v}
[Monoid M]
[Monoid N]
(e : M ≃* N)

∀ {X Y : CategoryTheory.SingleObj M} (a : M), e.toSingleObjEquiv.functor.map a = e a


theorem uniformContinuous_extension₂ : UniformContinuous₂ (pkg.extend₂ pkg' f)

{α : Type u_1}
[UniformSpace α]
(pkg : AbstractCompletion α)
{β : Type u_2}
[UniformSpace β]
(pkg' : AbstractCompletion β)
{γ : Type u_3}
[UniformSpace γ]
(f : α → β → γ)
[CompleteSpace γ]


@[simp]
theorem id_apply (a : α) : BoundedOrderHom.id α a = a

{α : Type u_2}
[Preorder α]
[BoundedOrder α]
(a : α)


@[to_additive (attr := simp)]
theorem Red.step_invRev_iff :
    Red.Step (FreeGroup.invRev L₁) (FreeGroup.invRev L₂) ↔ Red.Step L₁ L₂

FreeAddGroup.Red.Step (FreeAddGroup.negRev L₁) (FreeAddGroup.negRev L₂) ↔ FreeAddGroup.Red.Step L₁ L₂


@[simp] lemma SpecΓIdentity_inv_app : SpecΓIdentity.inv.app R = (ΓSpecIso R).inv

AlgebraicGeometry.Scheme.SpecΓIdentity.inv.app R = (AlgebraicGeometry.Scheme.ΓSpecIso R).inv


/-- An equivalent expression of `Submonoid.FG` in terms of `Set.Finite` instead of `Finset`. -/
@[to_additive "An equivalent expression of `AddSubmonoid.FG` in terms of `Set.Finite` instead of
`Finset`."]
theorem Submonoid.fg_iff (P : Submonoid M) :
    Submonoid.FG P ↔ ∃ S : Set M, Submonoid.closure S = P ∧ S.Finite

{M : Type u_1}
[AddMonoid M]
(P : AddSubmonoid M)

P.FG ↔ ∃ S, AddSubmonoid.closure S = P ∧ S.Finite


@[simp]
theorem dlookup_kerase_ne {a a'} {l : List (Sigma β)} (h : a ≠ a') :
    dlookup a (kerase a' l) = dlookup a l

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

List.dlookup a (List.kerase a' l) = List.dlookup a l


@[gcongr]
theorem sdiff_le_sdiff_right (h : a ≤ b) : a \ c ≤ b \ c

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


theorem powQuotSuccInclusion_injective (i : ℕ) :
    Function.Injective (powQuotSuccInclusion f p P i)

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
(f : R →+* S)
(p : Ideal R)
(P : Ideal S)
(i : ℕ)

Function.Injective ⇑(Ideal.powQuotSuccInclusion f p P i)


/-- A Hilbert space admits a Hilbert basis. -/
theorem _root_.exists_hilbertBasis : ∃ (w : Set E) (b : HilbertBasis w 𝕜 E), ⇑b = ((↑) : w → E)

(𝕜 : Type u_2)
[RCLike 𝕜]
(E : Type u_3)
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[cplt : CompleteSpace E]

∃ w b, (fun i => b.repr.symm (lp.single 2 i 1)) = Subtype.val


@[simp]
theorem fst_apply (p : Submodule R E) (p' : Submodule R F) (x : p.prod p') :
    LinearPMap.fst p p' x = (x : E × F).1

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(p : Submodule R E)
(p' : Submodule R F)
(x : ↥(p.prod p'))


/-- Introduction rule to prove that `b` is the supremum of `s`: it suffices to check that `b`
is larger than all elements of `s`, and that this is not the case of any `w<b`.
See `sSup_eq_of_forall_le_of_forall_lt_exists_gt` for a version in complete lattices. -/
theorem csSup_eq_of_forall_le_of_forall_lt_exists_gt (hs : s.Nonempty) (H : ∀ a ∈ s, a ≤ b)
    (H' : ∀ w, w < b → ∃ a ∈ s, w < a) : sSup s = b

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
{b : α}
(hs : s.Nonempty)
(H : ∀ a ∈ s, a ≤ b)
(H' : ∀ w < b, ∃ a ∈ s, w < a)


@[to_additive]
theorem map_le_iff_le_comap {f : G →* N} {K : Subgroup G} {H : Subgroup N} :
    K.map f ≤ H ↔ K ≤ H.comap f

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
{K : AddSubgroup G}
{H : AddSubgroup N}

AddSubgroup.map f K ≤ H ↔ K ≤ AddSubgroup.comap f H


theorem hundred_lt_pow_initialBound_mul {ε : ℝ} (hε : 0 < ε) (l : ℕ) :
    100 < ↑4 ^ initialBound ε l * ε ^ 5

100 < 4 ^ SzemerediRegularity.initialBound ε l * ε ^ 5


theorem tendsto_atBot_atTop_of_antitone [Preorder α] [Preorder β] {f : α → β} (hf : Antitone f)
    (h : ∀ b, ∃ a, b ≤ f a) : Tendsto f atBot atTop

{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : Antitone f)
(h : ∀ (b : β), ∃ a, b ≤ f a)

Filter.Tendsto f Filter.atBot Filter.atTop


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


theorem dvd_ord_compl_of_dvd_not_dvd {p d n : ℕ} (hdn : d ∣ n) (hpd : ¬p ∣ d) :
    d ∣ ord_compl[p] n


theorem smul_mem_pointwise_smul (m : R') (r : A) (S : Subalgebra R A) : r ∈ S → m • r ∈ m • S

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{R' : Type u_3}
[Semiring R']
[MulSemiringAction R' A]
[SMulCommClass R' R A]
(m : R')
(r : A)
(S : Subalgebra R A)


theorem log_im_le_pi (x : ℂ) : (log x).im ≤ π


/-- Euclid's lemma: if `a ∣ b * c` and `gcd a c = 1` then `a ∣ b`.
Compare with `IsCoprime.dvd_of_dvd_mul_left` and
`UniqueFactorizationMonoid.dvd_of_dvd_mul_left_of_no_prime_factors` -/
theorem dvd_of_dvd_mul_left_of_gcd_one {a b c : ℤ} (habc : a ∣ b * c) (hab : gcd a c = 1) :
    a ∣ b

{a b c : ℤ}
(habc : a ∣ b * c)
(hab : a.gcd c = 1)


@[mono]
theorem face_mono {n} {I J : Box (Fin (n + 1))} (h : I ≤ J) (i : Fin (n + 1)) :
    face I i ≤ face J i

{n : ℕ}
{I J : BoxIntegral.Box (Fin (n + 1))}
(h : I ≤ J)
(i : Fin (n + 1))


@[simp] theorem findEntry?_eq [BEq α] (a : α) (l : AssocList α β) :
    findEntry? a l = l.toList.find? (·.1 == a)

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

Batteries.AssocList.findEntry? a l = List.find? (fun x => x.fst == a) l.toList


@[simp, mfld_simps]
theorem left_inv {x : α} (h : x ∈ e.source) : e.symm (e x) = x

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
{x : α}
(h : x ∈ e.source)


theorem zneg_neg (n : PosNum) : -neg n = pos n


@[fun_prop]
theorem Measurable.fst {f : α → β × γ} (hf : Measurable f) : Measurable fun a : α => (f a).1

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{mγ : MeasurableSpace γ}
{f : α → β × γ}
(hf : Measurable f)


/-- The Grothendieck construction is functorial: a natural transformation `α : F ⟶ G` induces
a functor `Grothendieck.map : Grothendieck F ⥤ Grothendieck G`.
-/
@[simps!]
def map (α : F ⟶ G) : Grothendieck F ⥤ Grothendieck G

{F G : CategoryTheory.Functor C CategoryTheory.Cat}

((CategoryTheory.Grothendieck.map α).obj X).base = X.base


/-- A version of `Con.induction_on` for predicates which take two arguments. -/
@[to_additive (attr := elab_as_elim) "A version of `AddCon.induction_on` for predicates which take
two arguments."]
protected theorem induction_on₂ {d : Con N} {C : c.Quotient → d.Quotient → Prop} (p : c.Quotient)
    (q : d.Quotient) (H : ∀ (x : M) (y : N), C x y) : C p q

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{c : AddCon M}
{d : AddCon N}
{C : c.Quotient → d.Quotient → Prop}
(p : c.Quotient)
(q : d.Quotient)
(H : ∀ (x : M) (y : N), C ↑x ↑y)


@[to_additive]
protected theorem Finset.hasProd_compl_iff (s : Finset β) :
    HasProd (fun x : { x // x ∉ s } ↦ f x) a ↔ HasProd f (a * ∏ i ∈ s, f i)

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

HasSum (fun x => f ↑x) a ↔ HasSum f (a + ∑ i ∈ s, f i)


@[simp] lemma exp_le_exp_iff {a b : EReal} : exp a ≤ exp b ↔ a ≤ b


{X : Type u_1}
[TopologicalSpace X]
{x y : X}
(γ : Path x y)


private
theorem X_pow_sub_C_eq_prod'
    {n : ℕ} {ζ : K} (hζ : IsPrimitiveRoot ζ n) {α a : K} (hn : 0 < n) (e : α ^ n = a) :
    (X ^ n - C a) = ∏ i ∈ Finset.range n, (X - C (ζ ^ i * α))

{K : Type u}
[Field K]
{n : ℕ}
{ζ : K}
(hζ : IsPrimitiveRoot ζ n)
{α a : K}
(hn : 0 < n)
(e : α ^ n = a)

Polynomial.X ^ n - Polynomial.C a = ∏ i ∈ Finset.range n, (Polynomial.X - Polynomial.C (ζ ^ i * α))


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


@[simp]
theorem extremePoints_pi (s : ∀ i, Set (π i)) :
    (univ.pi s).extremePoints 𝕜 = univ.pi fun i ↦ (s i).extremePoints 𝕜

{𝕜 : Type u_1}
{ι : Type u_4}
{π : ι → Type u_5}
[OrderedSemiring 𝕜]
[(i : ι) → AddCommGroup (π i)]
[(i : ι) → Module 𝕜 (π i)]
(s : (i : ι) → Set (π i))

Set.extremePoints 𝕜 (Set.univ.pi s) = Set.univ.pi fun i => Set.extremePoints 𝕜 (s i)


/-- If a measure `μ` is the sum of a countable family `mₙ`, and a set `t` has finite measure for
each `mₙ`, then its measurable superset `toMeasurable μ t` (which has the same measure as `t`)
satisfies, for any measurable set `s`, the equality `μ (toMeasurable μ t ∩ s) = μ (t ∩ s)`. -/
theorem measure_toMeasurable_inter_of_sum {s : Set α} (hs : MeasurableSet s) {t : Set α}
    {m : ℕ → Measure α} (hv : ∀ n, m n t ≠ ∞) (hμ : μ = sum m) :
    μ (toMeasurable μ t ∩ s) = μ (t ∩ s)

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : MeasurableSet s)
{t : Set α}
{m : ℕ → MeasureTheory.Measure α}
(hv : ∀ (n : ℕ), (m n) t ≠ ⊤)
(hμ : μ = MeasureTheory.Measure.sum m)

μ (MeasureTheory.toMeasurable μ t ∩ s) = μ (t ∩ s)


/-- In an ordered commutative monoid, if each factor `f i` of one nontrivial finite product is
strictly less than the corresponding factor `g i` of another nontrivial finite product, then
`s.prod f < s.prod g`.

This is a variant (beta-reduced) version of the standard lemma `Finset.prod_lt_prod_of_nonempty'`,
convenient for the `gcongr` tactic. -/
@[to_additive (attr := gcongr) GCongr.sum_lt_sum_of_nonempty]
theorem _root_.GCongr.prod_lt_prod_of_nonempty' (hs : s.Nonempty) (Hlt : ∀ i ∈ s, f i < g i) :
    s.prod f < s.prod g

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelCommMonoid M]
{f g : ι → M}
{s : Finset ι}
(hs : s.Nonempty)
(Hlt : ∀ i ∈ s, f i < g i)


@[to_additive (attr := simp)]
theorem eventuallyConst_inv_set_ae :
    EventuallyConst (s⁻¹ : Set G) (ae μ) ↔ EventuallyConst s (ae μ)

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

Filter.EventuallyConst s⁻¹ (MeasureTheory.ae μ) ↔ Filter.EventuallyConst s (MeasureTheory.ae μ)


theorem tendsto_atBot_atTop_iff_of_antitone [Nonempty α] [SemilatticeInf α] [Preorder β] {f : α → β}
    (hf : Antitone f) : Tendsto f atBot atTop ↔ ∀ b : β, ∃ a : α, b ≤ f a

{α : Type u_3}
{β : Type u_4}
[Nonempty α]
[SemilatticeInf α]
[Preorder β]
{f : α → β}
(hf : Antitone f)

Filter.Tendsto f Filter.atBot Filter.atTop ↔ ∀ (b : β), ∃ a, b ≤ f a


/-- `teichmuller` is a natural transformation. -/
@[simp]
theorem map_teichmuller (f : R →+* S) (r : R) : map f (teichmuller p r) = teichmuller p (f r)

(p : ℕ)
{R : Type u_1}
{S : Type u_2}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CommRing S]
(f : R →+* S)
(r : R)

(WittVector.map f) ((WittVector.teichmuller p) r) = (WittVector.teichmuller p) (f r)


protected theorem intCast_mem {R : Type u} {A : Type v} [CommRing R] [Ring A] [Algebra R A]
    (S : Subalgebra R A) (n : ℤ) : (n : A) ∈ S


theorem beth_normal : IsNormal.{u} fun o => (beth o).ord

Ordinal.IsNormal fun o => (Cardinal.beth o).ord


@[simp]
theorem cgf_zero' : cgf X μ 0 = log (μ Set.univ).toReal

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{X : Ω → ℝ}
{μ : MeasureTheory.Measure Ω}

ProbabilityTheory.cgf X μ 0 = Real.log (μ Set.univ).toReal


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

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(self : GaloisCoinsertion l u)


protected lemma ContinuousWithinAt.partialSups_apply (hf : ∀ k ≤ n, ContinuousWithinAt (f k) s x) :
    ContinuousWithinAt (fun a ↦ partialSups (f · a) n) s x

ContinuousWithinAt (fun a => (partialSups fun x => f x a) n) s x


protected theorem surjective (e : P₁ ≃ᵃL[k] P₂) : Surjective e

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


lemma normal_iff_normalClosure_eq : Normal F K ↔ normalClosure F K L = K

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

Normal F ↥K ↔ normalClosure F (↥K) L = K


/-- If the products `W ⨯ X` and `Y ⨯ Z` exist, then every pair of isomorphisms `f : W ≅ Y` and
    `g : X ≅ Z` induces an isomorphism `prod.mapIso f g : W ⨯ X ≅ Y ⨯ Z`. -/
@[simps]
def prod.mapIso {W X Y Z : C} [HasBinaryProduct W X] [HasBinaryProduct Y Z] (f : W ≅ Y)
    (g : X ≅ Z) : W ⨯ X ≅ Y ⨯ Z

(CategoryTheory.Limits.prod.mapIso f g).hom = CategoryTheory.Limits.prod.map f.hom g.hom


/-- The unique morphism into `Factorisation.terminal f`. -/
@[simps]
protected def terminalHom (d : Factorisation f) :
    Factorisation.Hom d (Factorisation.terminal : Factorisation f)

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


theorem associated_gcd_left_iff [GCDMonoid α] {x y : α} : Associated x (gcd x y) ↔ x ∣ y

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
{x y : α}


@[simp]
theorem sym_nonempty : (s.sym n).Nonempty ↔ n = 0 ∨ s.Nonempty

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{n : ℕ}


theorem cpow_two (x : ℂ) : x ^ (2 : ℂ) = x ^ (2 : ℕ)


theorem isCycleOn_swap [DecidableEq α] (hab : a ≠ b) : (swap a b).IsCycleOn {a, b}

{α : Type u_2}
{a b : α}
[DecidableEq α]
(hab : a ≠ b)


theorem poly_eq_of_wittPolynomial_bind_eq [Fact p.Prime] (f g : ℕ → MvPolynomial ℕ ℤ)
    (h : ∀ n, bind₁ f (wittPolynomial p _ n) = bind₁ g (wittPolynomial p _ n)) : f = g

(h : ∀ (n : ℕ), (MvPolynomial.bind₁ f) (wittPolynomial p ℤ n) = (MvPolynomial.bind₁ g) (wittPolynomial p ℤ n))


protected theorem IsCycle.toDeleteEdges (s : Set (Sym2 V))
    {p : G.Walk v v} (h : p.IsCycle) (hp) : (p.toDeleteEdges s hp).IsCycle

{V : Type u}
(G : SimpleGraph V)
{v : V}
(s : Set (Sym2 V))
{p : G.Walk v v}
(h : p.IsCycle)
(hp : ∀ e ∈ p.edges, e ∉ s)

(SimpleGraph.Walk.toDeleteEdges s p hp).IsCycle


/-- A subspace of a projective space is a structure consisting of a set of points such that:
If two nonzero vectors determine points which are in the set, and the sum of the two vectors is
nonzero, then the point determined by the sum is also in the set. -/
@[ext]
structure Subspace where
  /-- The set of points. -/
  carrier : Set (ℙ K V)
  /-- The addition rule. -/
  mem_add' (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) (hvw : v + w ≠ 0) :
    mk K v hv ∈ carrier → mk K w hw ∈ carrier → mk K (v + w) hvw ∈ carrier

{K : Type u_1}
{V : Type u_2}
[Field K]
[AddCommGroup V]
[Module K V]
(self : Projectivization.Subspace K V)
(v w : V)
(hv : v ≠ 0)
(hw : w ≠ 0)
(hvw : v + w ≠ 0)

Projectivization.mk K v hv ∈ self.carrier →
  Projectivization.mk K w hw ∈ self.carrier → Projectivization.mk K (v + w) hvw ∈ self.carrier


theorem fromRel_top : fromRel (fun (x y : α) z => z : Symmetric ⊤) = Set.univ


theorem mod_four_eq_three_of_nat_prime_of_prime (p : ℕ) [hp : Fact p.Prime]
    (hpi : Prime (p : ℤ[i])) : p % 4 = 3

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(hpi : Prime ↑p)


/-- An additive monoid is finitely generated if it is finitely generated as an additive submonoid of
itself. -/
class AddMonoid.FG : Prop where
  out : (⊤ : AddSubmonoid N).FG

{N : Type u_2}
[AddMonoid N]
[self : AddMonoid.FG N]


/-- A homomorphism from a group to a monoid is injective iff its kernel is trivial,
stated as an iff on the triviality of the kernel.
For the implication, see `injective_iff_map_eq_one`. -/
@[to_additive
  "A homomorphism from an additive group to an additive monoid is injective iff its
  kernel is trivial, stated as an iff on the triviality of the kernel. For the implication, see
  `injective_iff_map_eq_zero`."]
theorem _root_.injective_iff_map_eq_one' {G H} [Group G] [MulOneClass H]
    [FunLike F G H] [MonoidHomClass F G H]
    (f : F) : Function.Injective f ↔ ∀ a, f a = 1 ↔ a = 1

{F : Type u_8}
{G : Type u_9}
{H : Type u_10}
[AddGroup G]
[AddZeroClass H]
[FunLike F G H]
[AddMonoidHomClass F G H]
(f : F)

Function.Injective ⇑f ↔ ∀ (a : G), f a = 0 ↔ a = 0


@[simp] lemma subset_zero : s ⊆ 0 ↔ s = 0


lemma orthogonal_disjoint
    (Φ : LinearMap.BilinForm R L) (hΦ_nondeg : Φ.Nondegenerate) (hΦ_inv : Φ.lieInvariant L)
    -- TODO: replace the following assumption by a typeclass assumption `[HasNonAbelianAtoms]`
    (hL : ∀ I : LieIdeal R L, IsAtom I → ¬IsLieAbelian I)
    (I : LieIdeal R L) (hI : IsAtom I) :
    Disjoint I (orthogonal Φ hΦ_inv I)

(hΦ_inv : LinearMap.BilinForm.lieInvariant L Φ)

(hL : ∀ (I : LieIdeal R L), IsAtom I → ¬IsLieAbelian ↥↑I)

Disjoint I (LieAlgebra.InvariantForm.orthogonal Φ hΦ_inv I)


@[reassoc (attr := simp)]
lemma cyclesMap_i : cyclesMap φ i ≫ L.iCycles i = K.iCycles i ≫ φ.f i

HomologicalComplex.cyclesMap φ i ≫ L.iCycles i = K.iCycles i ≫ φ.f i


/-- The strong pigeonhole principle for finitely many pigeons and pigeonholes.  Given a function `f`
between finite types `α` and `β` and a number `n` such that `card α ≤ card β * n`, there exists an
element `y : β` such that its preimage has at most `n` elements. See also
`Fintype.exists_card_fiber_lt_of_card_lt_mul` for a stronger statement. -/
theorem exists_card_fiber_le_of_card_le_mul [Nonempty β] (hn : card α ≤ card β * n) :
    ∃ y : β, (univ.filter fun x => f x = y).card ≤ n

(hn : Fintype.card α ≤ Fintype.card β * n)

∃ y, (Finset.filter (fun x => f x = y) Finset.univ).card ≤ n


theorem IsGreatest.isGreatest_iff_eq (Ha : IsGreatest s a) : IsGreatest s b ↔ a = b

{α : Type u}
[PartialOrder α]
{s : Set α}
{a b : α}
(Ha : IsGreatest s a)


/-- The open sets of a space whose topology is induced by a family of seminorms
are exactly the sets which contain seminorm balls around all of their points. -/
theorem WithSeminorms.isOpen_iff_mem_balls (hp : WithSeminorms p) (U : Set E) :
    IsOpen U ↔ ∀ x ∈ U, ∃ s : Finset ι, ∃ r > 0, (s.sup p).ball x r ⊆ U

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
[TopologicalSpace E]
{p : SeminormFamily 𝕜 E ι}
(hp : WithSeminorms p)
(U : Set E)

IsOpen U ↔ ∀ x ∈ U, ∃ s, ∃ r > 0, (s.sup p).ball x r ⊆ U


theorem bot_covers (S : Sieve X) (f : Y ⟶ X) : (⊥ : GrothendieckTopology C).Covers S f ↔ S f

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


theorem IsClosed.closure_subset_iff (h₁ : IsClosed t) : closure s ⊆ t ↔ s ⊆ t

{X : Type u}
{s t : Set X}
[TopologicalSpace X]
(h₁ : IsClosed t)


/-- A `DivisionRing` is a `Ring` with multiplicative inverses for nonzero elements.

An instance of `DivisionRing K` includes maps `ratCast : ℚ → K` and `qsmul : ℚ → K → K`.
Those two fields are needed to implement the `DivisionRing K → Algebra ℚ K` instance since we need
to control the specific definitions for some special cases of `K` (in particular `K = ℚ` itself).
See also note [forgetful inheritance]. Similarly, there are maps `nnratCast ℚ≥0 → K` and
`nnqsmul : ℚ≥0 → K → K` to implement the `DivisionSemiring K → Algebra ℚ≥0 K` instance.

If the division ring has positive characteristic `p`, our division by zero convention forces
`ratCast (1 / p) = 1 / 0 = 0`. -/
class DivisionRing (α : Type*)
  extends Ring α, DivInvMonoid α, Nontrivial α, NNRatCast α, RatCast α where
  /-- For a nonzero `a`, `a⁻¹` is a right multiplicative inverse. -/
  protected mul_inv_cancel : ∀ (a : α), a ≠ 0 → a * a⁻¹ = 1
  /-- The inverse of `0` is `0` by convention. -/
  protected inv_zero : (0 : α)⁻¹ = 0
  protected nnratCast := NNRat.castRec
  /-- However `NNRat.cast` is defined, it must be equal to `a / b`.

  Do not use this lemma directly. Use `NNRat.cast_def` instead. -/
  protected nnratCast_def (q : ℚ≥0) : (NNRat.cast q : α) = q.num / q.den := by intros; rfl
  /-- Scalar multiplication by a nonnegative rational number.

  Unless there is a risk of a `Module ℚ≥0 _` instance diamond, write `nnqsmul := _`. This will set
  `nnqsmul` to `(NNRat.cast · * ·)` thanks to unification in the default proof of `nnqsmul_def`.

  Do not use directly. Instead use the `•` notation. -/
  protected nnqsmul : ℚ≥0 → α → α
  /-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.

  Do not use this lemma directly. Use `NNRat.smul_def` instead. -/
  protected nnqsmul_def (q : ℚ≥0) (a : α) : nnqsmul q a = NNRat.cast q * a := by intros; rfl
  protected ratCast := Rat.castRec
  /-- However `Rat.cast q` is defined, it must be propositionally equal to `q.num / q.den`.

  Do not use this lemma directly. Use `Rat.cast_def` instead. -/
  protected ratCast_def (q : ℚ) : (Rat.cast q : α) = q.num / q.den := by intros; rfl
  /-- Scalar multiplication by a rational number.

  Unless there is a risk of a `Module ℚ _` instance diamond, write `qsmul := _`. This will set
  `qsmul` to `(Rat.cast · * ·)` thanks to unification in the default proof of `qsmul_def`.

  Do not use directly. Instead use the `•` notation. -/
  protected qsmul : ℚ → α → α
  /-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.

  Do not use this lemma directly. Use `Rat.cast_def` instead. -/
  protected qsmul_def (a : ℚ) (x : α) : qsmul a x = Rat.cast a * x := by intros; rfl


theorem rank_le_domain (f : V →ₗ[K] V₁) : rank f ≤ Module.rank K V

{K : Type u}
{V V₁ : Type v}
[Ring K]
[AddCommGroup V]
[Module K V]
[AddCommGroup V₁]
[Module K V₁]
(f : V →ₗ[K] V₁)


theorem ofFn_eq_map {n} {f : Fin n → α} : ofFn f = (finRange n).map f

List.ofFn f = List.map f (List.finRange n)


theorem mulMap_bot_left_eq : mulMap ⊥ A = A.val.comp A.lTensorBot.toAlgHom

{R : Type u}
{S : Type v}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
(A : Subalgebra R S)


/-- An auxiliary induction lemma, which is generalized by `solvableByRad.isSolvable`. -/
theorem induction3 {α : solvableByRad F E} {n : ℕ} (hn : n ≠ 0) (hα : P (α ^ n)) : P α

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{α : ↥(solvableByRad F E)}
{n : ℕ}
(hn : n ≠ 0)
(hα : solvableByRad.P (α ^ n))


theorem or_congr (h₁ : a ↔ c) (h₂ : b ↔ d) : (a ∨ b) ↔ (c ∨ d)

{a c b d : Prop}
(h₁ : a ↔ c)
(h₂ : b ↔ d)


theorem fderiv_const_add (c : F) : fderiv 𝕜 (fun y => c + f y) x = fderiv 𝕜 f x

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


theorem Filter.HasBasis.lift'_closure_eq_self {l : Filter X} {p : ι → Prop} {s : ι → Set X}
    (h : l.HasBasis p s) (hc : ∀ i, p i → IsClosed (s i)) : l.lift' closure = l

{X : Type u}
{ι : Sort w}
[TopologicalSpace X]
{l : Filter X}
{p : ι → Prop}
{s : ι → Set X}
(h : l.HasBasis p s)
(hc : ∀ (i : ι), p i → IsClosed (s i))


theorem logb_pos_of_base_lt_one (hx : 0 < x) (hx' : x < 1) : 0 < logb b x


@[simp]
theorem map_exp_comap_re_atBot : map exp (comap re atBot) = 𝓝[≠] 0

Filter.map Complex.exp (Filter.comap Complex.re Filter.atBot) = nhdsWithin 0 {0}ᶜ


theorem strictMonoOn_log : StrictMonoOn log (Set.Ioi 0)


@[simp]
theorem ofBijective_symm_apply_apply (f : E →SL[σ] F) (hinj : ker f = ⊥)
    (hsurj : LinearMap.range f = ⊤) (x : E) : (ofBijective f hinj hsurj).symm (f x) = x

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{σ' : 𝕜' →+* 𝕜}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
[RingHomIsometric σ]
[RingHomIsometric σ']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
[CompleteSpace F]
[CompleteSpace E]
(f : E →SL[σ] F)
(hinj : LinearMap.ker f = ⊥)
(hsurj : LinearMap.range f = ⊤)
(x : E)

(ContinuousLinearEquiv.ofBijective f hinj hsurj).symm (f x) = x


lemma leftRightHomologyComparison'_eq_leftHomologpMap'_comp_iso_hom_comp_rightHomologyMap'
    (h : S.HomologyData) (h₁ : S.LeftHomologyData) (h₂ : S.RightHomologyData) :
    leftRightHomologyComparison' h₁ h₂ =
      leftHomologyMap' (𝟙 S) h₁ h.left ≫ h.iso.hom ≫ rightHomologyMap' (𝟙 S) h.right h₂

CategoryTheory.ShortComplex.leftRightHomologyComparison' h₁ h₂ =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.ShortComplex.leftHomologyMap' (CategoryTheory.CategoryStruct.id S) h₁ h.left)
    (CategoryTheory.CategoryStruct.comp h.iso.hom
      (CategoryTheory.ShortComplex.rightHomologyMap' (CategoryTheory.CategoryStruct.id S) h.right h₂))


theorem copy_eq (f : α →+*o β) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_2}
{β : Type u_3}
[NonAssocSemiring α]
[Preorder α]
[NonAssocSemiring β]
[Preorder β]
(f : α →+*o β)
(f' : α → β)
(h : f' = ⇑f)


theorem val_lt_one_iff (v : Valuation K Γ₀) {x : K} (h : x ≠ 0) : v x < 1 ↔ 1 < v x⁻¹

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
[LinearOrderedCommGroupWithZero Γ₀]
(v : Valuation K Γ₀)
{x : K}
(h : x ≠ 0)


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

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


lemma real_exp_eq_normedSpace_exp {a : A} (ha : p a := by cfc_tac) :
    cfc Real.exp a = exp ℝ a

{A : Type u_1}
{p : A → Prop}
[NormedRing A]
[StarRing A]
[TopologicalRing A]
[NormedAlgebra ℝ A]
[CompleteSpace A]
[ContinuousFunctionalCalculus ℝ p]
{a : A}
(ha : p a := by cfc_tac)


theorem le_union_left (s t : Multiset α) : s ≤ s ∪ t

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


theorem _root_.IsClosed.exists_infDist_eq_dist [ProperSpace α] (h : IsClosed s) (hne : s.Nonempty)
    (x : α) : ∃ y ∈ s, infDist x s = dist x y

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
[ProperSpace α]
(h : IsClosed s)
(hne : s.Nonempty)
(x : α)


theorem one_le_iff_ne_zero {o : Ordinal} : 1 ≤ o ↔ o ≠ 0


theorem mem_closure_iff_clusterPt : x ∈ closure s ↔ ClusterPt x (𝓟 s)

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


@[to_additive (attr := simp)]
theorem period_one (a : α) : period (1 : M) a = 1

{α : Type v}
(M : Type u)
[Monoid M]
[MulAction M α]
(a : α)


@[simp]
theorem coe_toAffineIsometryEquiv : ⇑(e.toAffineIsometryEquiv : V ≃ᵃⁱ[𝕜] V₂) = e

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
(e : V ≃ₗᵢ[𝕜] V₂)


@[simp]
theorem IsMax.not_infIrred (ha : IsMax a) : ¬InfIrred a

{α : Type u_2}
[SemilatticeInf α]
{a : α}
(ha : IsMax a)


/-- The canonical isomorphism `S.homology ≅ S.opcycles` when `S.g = 0`. -/
@[simps! hom]
noncomputable def asIsoHomologyι (hg : S.g = 0) [S.HasHomology] :
    S.homology ≅ S.opcycles


/-- If a family is convex independent, a point in the family is not in the convex hull of the other
points. See `convexIndependent_set_iff_not_mem_convexHull_diff` for the `Set` version. -/
theorem convexIndependent_iff_not_mem_convexHull_diff {p : ι → E} :
    ConvexIndependent 𝕜 p ↔ ∀ i s, p i ∉ convexHull 𝕜 (p '' (s \ {i}))

{𝕜 : Type u_1}
{E : Type u_2}
{ι : Type u_3}
[OrderedSemiring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : ι → E}

ConvexIndependent 𝕜 p ↔ ∀ (i : ι) (s : Set ι), p i ∉ (convexHull 𝕜) (p '' (s \ {i}))


@[simp]
theorem mk_le_mk {S S' : AddSubmonoid M} (h h') :
    (⟨S, h⟩ : Submodule R M) ≤ (⟨S', h'⟩ : Submodule R M) ↔ S ≤ S'

(h : ∀ (c : R) {x : M}, x ∈ S.carrier → c • x ∈ S.carrier)

(h' : ∀ (c : R) {x : M}, x ∈ S'.carrier → c • x ∈ S'.carrier)

{ toAddSubmonoid := S, smul_mem' := h } ≤ { toAddSubmonoid := S', smul_mem' := h' } ↔ S ≤ S'


theorem Polynomial.bernoulli_three_eval_one_quarter :
    (Polynomial.bernoulli 3).eval (1 / 4) = 3 / 64

Polynomial.eval (1 / 4) (Polynomial.bernoulli 3) = 3 / 64


/-- Distance between the images of any two points is at most twice the norm of the function. -/
theorem dist_le_two_norm (x y : α) : dist (f x) (f y) ≤ 2 * ‖f‖

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
(f : C(α, E))
(x y : α)


@[simp, rclike_simps, norm_cast]
theorem norm_natCast (n : ℕ) : ‖(n : K)‖ = n


theorem degree_C_mul_X (ha : a ≠ 0) : degree (C a * X) = 1

{R : Type u}
{a : R}
[Semiring R]
(ha : a ≠ 0)

(Polynomial.C a * Polynomial.X).degree = 1


theorem le_normalizer : H ≤ H.normalizer

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(H : LieSubalgebra R L)


@[simp]
theorem irrational_nat_div_iff : Irrational (n / x) ↔ n ≠ 0 ∧ Irrational x

Irrational (↑n / x) ↔ n ≠ 0 ∧ Irrational x


@[simp]
theorem mem_pi {f : Π₀ i, Finset (α i)} {g : Π₀ i, α i} : g ∈ f.pi ↔ ∀ i, g i ∈ f i

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Zero (α i)]
[DecidableEq ι]
[(i : ι) → DecidableEq (α i)]
{f : Π₀ (i : ι), Finset (α i)}
{g : Π₀ (i : ι), α i}


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

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

(CategoryTheory.Limits.Bicone.ofLimitCone ht).ι j =
  ht.lift (CategoryTheory.Limits.Fan.mk (f j) fun j' => if h : j = j' then CategoryTheory.eqToHom ⋯ else 0)


lemma HurwitzZeta.hurwitzZeta_zero : hurwitzZeta 0 = riemannZeta


@[simp]
theorem moveRight_neg' {x : PGame} (i) :
    (-x).moveRight i = -x.moveLeft (toRightMovesNeg.symm i)

{x : SetTheory.PGame}
(i : (-x).RightMoves)

(-x).moveRight i = -x.moveLeft (SetTheory.PGame.toRightMovesNeg.symm i)


theorem finite_mem_finset (s : Finset α) : { a | a ∈ s }.Finite


@[simp]
theorem mkMonoidHom_apply (a : α) : Associates.mkMonoidHom a = Associates.mk a


@[simp]
nonrec theorem integral_smul {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E]
    [SMulCommClass ℝ 𝕜 E] (r : 𝕜) (f : ℝ → E) :
    ∫ x in a..b, r • f x ∂μ = r • ∫ x in a..b, f x ∂μ

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
{𝕜 : Type u_6}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[SMulCommClass ℝ 𝕜 E]
(r : 𝕜)
(f : ℝ → E)

∫ (x : ℝ) in a..b, r • f x ∂μ = r • ∫ (x : ℝ) in a..b, f x ∂μ


@[to_additive]
theorem measure_eq_zero_iff_eq_empty_of_smulInvariant (hμ : μ ≠ 0) (hU : IsOpen U) :
    μ U = 0 ↔ U = ∅

[MeasureTheory.SMulInvariantMeasure G α μ]


lemma pow_pred_nilpotencyClass [Nontrivial R] (hx : IsNilpotent x) :
    x ^ (nilpotencyClass x - 1) ≠ 0

{R : Type u_1}
{x : R}
[MonoidWithZero R]
[Nontrivial R]
(hx : IsNilpotent x)


@[gcongr]
theorem max_mono {s t : Finset α} (st : s ⊆ t) : s.max ≤ t.max

{α : Type u_2}
[LinearOrder α]
{s t : Finset α}
(st : s ⊆ t)


theorem forall_congr {α : Sort u} {p q : α → Prop} (h : ∀ a, p a = q a) : (∀ a, p a) = (∀ a, q a)

{α : Sort u}
{p q : α → Prop}
(h : ∀ (a : α), p a = q a)


@[to_additive]
theorem prod_erase_attach [DecidableEq ι] {s : Finset ι} (f : ι → α) (i : ↑s) :
    ∏ j ∈ s.attach.erase i, f ↑j = ∏ j ∈ s.erase ↑i, f j

{ι : Type u_1}
{α : Type u_3}
[AddCommMonoid α]
[DecidableEq ι]
{s : Finset ι}
(f : ι → α)
(i : { x // x ∈ s })

∑ j ∈ s.attach.erase i, f ↑j = ∑ j ∈ s.erase ↑i, f j


@[simp]
theorem dotProduct_cons (v : Fin n.succ → α) (x : α) (w : Fin n → α) :
    dotProduct v (vecCons x w) = vecHead v * x + dotProduct (vecTail v) w

{α : Type u}
{n : ℕ}
[AddCommMonoid α]
[Mul α]
(v : Fin n.succ → α)
(x : α)
(w : Fin n → α)

Matrix.dotProduct v (Matrix.vecCons x w) = Matrix.vecHead v * x + Matrix.dotProduct (Matrix.vecTail v) w


/-- A group `G` is solvable if its derived series is eventually trivial. We use this definition
  because it's the most convenient one to work with. -/
@[mk_iff isSolvable_def]
class IsSolvable : Prop where
  /-- A group `G` is solvable if its derived series is eventually trivial. -/
  solvable : ∃ n : ℕ, derivedSeries G n = ⊥

IsSolvable G ↔ ∃ n, derivedSeries G n = ⊥


theorem copy_ok (q s a b c d) :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.copy q), s, K'.elim a b c d⟩
      ⟨some q, none, K'.elim (List.reverseAux b a) [] c (List.reverseAux b d)⟩

(q : Turing.PartrecToTM2.Λ')
(s : Option Turing.PartrecToTM2.Γ')
(a b c d : List Turing.PartrecToTM2.Γ')

Turing.Reaches₁ (Turing.TM2.step Turing.PartrecToTM2.tr)
  { l := some q.copy, var := s, stk := Turing.PartrecToTM2.K'.elim a b c d }
  { l := some q, var := none, stk := Turing.PartrecToTM2.K'.elim (b.reverseAux a) [] c (b.reverseAux d) }


@[to_additive]
theorem swap_injective : Injective (swap M N)

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]

Function.Injective ⇑(AddMonoid.Coprod.swap M N)


theorem comp_Hσ_eq_zero {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ)
    (hqn : n < q) : φ ≫ (Hσ q).f (n + 1) = 0

(v : AlgebraicTopology.DoldKan.HigherFacesVanish q φ)

φ ≫ (AlgebraicTopology.DoldKan.Hσ q).f (n + 1) = 0


@[simp] theorem isPWO_empty : IsPWO (∅ : Set α)


/-- If `b` is odd, then `J(-2 | b)` is given by `χ₈' b`. -/
theorem at_neg_two {b : ℕ} (hb : Odd b) : J(-2 | b) = χ₈' b


theorem map_inf (hf : Function.Injective f) :
    (N ⊓ N₂).map f = N.map f ⊓ N₂.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'}
{N N₂ : LieSubmodule R L M}
(hf : Function.Injective ⇑f)

LieSubmodule.map f (N ⊓ N₂) = LieSubmodule.map f N ⊓ LieSubmodule.map f N₂


theorem isSupFiniteCompact_iff_isSupClosedCompact : IsSupFiniteCompact α ↔ IsSupClosedCompact α

CompleteLattice.IsSupFiniteCompact α ↔ CompleteLattice.IsSupClosedCompact α


@[ext]
theorem ext_ring [TopologicalSpace R₁] {f g : R₁ →L[R₁] M₁} (h : f 1 = g 1) : f = g

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[TopologicalSpace R₁]
{f g : R₁ →L[R₁] M₁}
(h : f 1 = g 1)


theorem tendsto_Lp_iff_tendsto_ℒp {ι} {fi : Filter ι} [Fact (1 ≤ p)] (f : ι → Lp E p μ)
    (f_lim : α → E) (f_lim_ℒp : Memℒp f_lim p μ) :
    fi.Tendsto f (𝓝 (f_lim_ℒp.toLp f_lim)) ↔
      fi.Tendsto (fun n => eLpNorm (⇑(f n) - f_lim) p μ) (𝓝 0)

(f_lim_ℒp : MeasureTheory.Memℒp f_lim p μ)

Filter.Tendsto f fi (𝓝 (MeasureTheory.Memℒp.toLp f_lim f_lim_ℒp)) ↔
  Filter.Tendsto (fun n => MeasureTheory.eLpNorm (↑↑(f n) - f_lim) p μ) fi (𝓝 0)


/-- Auxiliary definition: the limit category. -/
@[simps]
def limitConeX (F : J ⥤ Cat.{v, v}) : Cat.{v, v}

(F : CategoryTheory.Functor J CategoryTheory.Cat)

(CategoryTheory.Cat.HasLimits.limitConeX F).str = inferInstance


theorem isQuasiSeparated_iff_quasiSeparatedSpace (s : Set α) (hs : IsOpen s) :
    IsQuasiSeparated s ↔ QuasiSeparatedSpace s

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

IsQuasiSeparated s ↔ QuasiSeparatedSpace ↑s


/-- Functor translating a functor into the category of comonoid objects
to a comonoid object in the functor category
-/
@[simps]
private def inverse : (C ⥤ Comon_ D) ⥤ Comon_ (C ⥤ D)

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

CategoryTheory.Monoidal.ComonFunctorCategoryEquivalence.inverse.obj F =
  CategoryTheory.Monoidal.ComonFunctorCategoryEquivalence.inverseObj F


@[simp]
theorem genericPoint_closure [QuasiSober α] [IrreducibleSpace α] :
    closure ({genericPoint α} : Set α) = ⊤

(α : Type u_1)
[TopologicalSpace α]
[QuasiSober α]
[IrreducibleSpace α]


@[simp]
theorem coeFn_generalLinearEquiv (f : GeneralLinearGroup R M) :
    (generalLinearEquiv R M f) = (f : M → M)

(R : Type u_1)
(M : Type u_2)
[Semiring R]
[AddCommMonoid M]
[Module R M]
(f : LinearMap.GeneralLinearGroup R M)

⇑((LinearMap.GeneralLinearGroup.generalLinearEquiv R M) f) = ⇑↑f


@[simp] lemma op_sub [Sub α] (x y : α) : op (x - y) = op x - op y

MulOpposite.op (x - y) = MulOpposite.op x - MulOpposite.op y


theorem contDiffWithinAt_prod {t : Finset ι} {f : ι → E → 𝔸'}
    (h : ∀ i ∈ t, ContDiffWithinAt 𝕜 n (f i) s x) :
    ContDiffWithinAt 𝕜 n (fun y => ∏ i ∈ t, f i y) s x


@[simp]
theorem stalkAlgebra_map (p : PrimeSpectrum R) (r : R) :
    algebraMap R ((structureSheaf R).presheaf.stalk p) r = toStalk R p r

(R : Type u)
[CommRing R]
(p : PrimeSpectrum R)
(r : R)

(algebraMap R ↑((AlgebraicGeometry.Spec.structureSheaf R).presheaf.stalk p)) r =
  (AlgebraicGeometry.StructureSheaf.toStalk R p) r


@[simp]
theorem coe_starₗᵢ : (starₗᵢ 𝕜 : E → E) = star

{𝕜 : Type u_1}
{E : Type u_2}
[CommSemiring 𝕜]
[StarRing 𝕜]
[SeminormedAddCommGroup E]
[StarAddMonoid E]
[NormedStarGroup E]
[Module 𝕜 E]
[StarModule 𝕜 E]


theorem mem_perfectClosure_iff {x : E} :
    x ∈ perfectClosure F E ↔ ∃ n : ℕ, x ^ (ringExpChar F) ^ n ∈ (algebraMap F E).range

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

x ∈ perfectClosure F E ↔ ∃ n, x ^ ringExpChar F ^ n ∈ (algebraMap F E).range


theorem le_piecewise {δ : α → Type*} [∀ i, Preorder (δ i)] {s : Set α} [∀ j, Decidable (j ∈ s)]
    {f₁ f₂ g : ∀ i, δ i} (h₁ : ∀ i ∈ s, g i ≤ f₁ i) (h₂ : ∀ i ∉ s, g i ≤ f₂ i) :
    g ≤ s.piecewise f₁ f₂

{α : Type u_1}
{δ : α → Type u_7}
[(i : α) → Preorder (δ i)]
{s : Set α}
[(j : α) → Decidable (j ∈ s)]
{f₁ f₂ g : (i : α) → δ i}
(h₁ : ∀ i ∈ s, g i ≤ f₁ i)
(h₂ : ∀ i ∉ s, g i ≤ f₂ i)


theorem IsBigO.const_mul_right' {g : α → R} {c : R} (hc : IsUnit c) (h : f =O[l] g) :
    f =O[l] fun x => c * g x

{α : Type u_1}
{E : Type u_3}
{R : Type u_13}
[Norm E]
[SeminormedRing R]
{f : α → E}
{l : Filter α}
{g : α → R}
{c : R}
(hc : IsUnit c)
(h : f =O[l] g)


/-- The truncation of `Xᵢ` up to `i` satisfies the strong law of large numbers (with respect to
the truncated expectation) along the sequence `c^n`, for any `c > 1`, up to a given `ε > 0`.
This follows from a variance control. -/
theorem strong_law_aux1 {c : ℝ} (c_one : 1 < c) {ε : ℝ} (εpos : 0 < ε) : ∀ᵐ ω, ∀ᶠ n : ℕ in atTop,
    |∑ i ∈ range ⌊c ^ n⌋₊, truncation (X i) i ω - 𝔼[∑ i ∈ range ⌊c ^ n⌋₊, truncation (X i) i]| <
    ε * ⌊c ^ n⌋₊

(X : ℕ → Ω → ℝ)

(hint : MeasureTheory.Integrable (X 0) ℙ)

(hindep : Pairwise fun i j => ProbabilityTheory.IndepFun (X i) (X j) ℙ)

(hident : ∀ (i : ℕ), ProbabilityTheory.IdentDistrib (X i) (X 0) ℙ ℙ)

(hnonneg : ∀ (i : ℕ) (ω : Ω), 0 ≤ X i ω)

∀ᵐ (ω : Ω),
  ∀ᶠ (n : ℕ) in Filter.atTop,
    |∑ i ∈ Finset.range ⌊c ^ n⌋₊, ProbabilityTheory.truncation (X i) (↑i) ω -
          ∫ (a : Ω), (∑ i ∈ Finset.range ⌊c ^ n⌋₊, ProbabilityTheory.truncation (X i) ↑i) a| <
      ε * ↑⌊c ^ n⌋₊


theorem cast_add (h : m ∣ n) (a b : ZMod n) : (cast (a + b : ZMod n) : R) = cast a + cast b

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


/-- Composing on the left by a uniformly continuous function preserves
uniform Cauchy sequences -/
theorem UniformContinuous.comp_uniformCauchySeqOn [UniformSpace γ] {g : β → γ}
    (hg : UniformContinuous g) (hf : UniformCauchySeqOn F p s) :
    UniformCauchySeqOn (fun n => g ∘ F n) p s

{α : Type u}
{β : Type v}
{γ : Type w}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{s : Set α}
{p : Filter ι}
[UniformSpace γ]
{g : β → γ}
(hg : UniformContinuous g)
(hf : UniformCauchySeqOn F p s)


theorem isSeparator_iff_epi (G : C) [∀ A : C, HasCoproduct fun _ : G ⟶ A => G] :
    IsSeparator G ↔ ∀ A : C, Epi (Sigma.desc fun f : G ⟶ A => f)

[∀ (A : C), CategoryTheory.Limits.HasCoproduct fun x => G]

CategoryTheory.IsSeparator G ↔ ∀ (A : C), CategoryTheory.Epi (CategoryTheory.Limits.Sigma.desc fun f => f)


theorem integral_Iio_add_Ici (h_left : IntegrableOn f (Iio b) μ)
    (h_right : IntegrableOn f (Ici b) μ) :
    (∫ x in Iio b, f x ∂μ) + (∫ x in Ici b, f x ∂μ) = ∫ (x : ℝ), f x ∂μ

(h_left : MeasureTheory.IntegrableOn f (Set.Iio b) μ)

(h_right : MeasureTheory.IntegrableOn f (Set.Ici b) μ)

∫ (x : ℝ) in Set.Iio b, f x ∂μ + ∫ (x : ℝ) in Set.Ici b, f x ∂μ = ∫ (x : ℝ), f x ∂μ


protected theorem ne_of_lt {a b : Char} (h : a < b) : a ≠ b


theorem infiniteNeg_iff_infinite_and_neg {x : ℝ*} : InfiniteNeg x ↔ Infinite x ∧ x < 0


/-- If `μ` is a σ-finite measure, and `s ⊆ α × β` is measurable, then `y ↦ μ { x | (x, y) ∈ s }` is
  a measurable function. -/
theorem measurable_measure_prod_mk_right {μ : Measure α} [SFinite μ] {s : Set (α × β)}
    (hs : MeasurableSet s) : Measurable fun y => μ ((fun x => (x, y)) ⁻¹' s)

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
[MeasureTheory.SFinite μ]
{s : Set (α × β)}
(hs : MeasurableSet s)


@[simp]
theorem subtypeDomain_add {v v' : α →₀ M} :
    (v + v').subtypeDomain p = v.subtypeDomain p + v'.subtypeDomain p

{α : Type u_1}
{M : Type u_5}
[AddZeroClass M]
{p : α → Prop}
{v v' : α →₀ M}

Finsupp.subtypeDomain p (v + v') = Finsupp.subtypeDomain p v + Finsupp.subtypeDomain p v'


@[reassoc (attr := simp)]
lemma g_desc (hS : S.Exact) {A : C} (k : S.X₂ ⟶ A) (hk : S.f ≫ k = 0) [Epi S.g] :
    S.g ≫ hS.desc k hk = k

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

CategoryTheory.CategoryStruct.comp S.g (hS.desc k hk) = k


/-- To prove a property of a product, it suffices to prove that
the property is multiplicative and holds on factors. -/
@[to_additive "To prove a property of a sum, it suffices to prove that
the property is additive and holds on summands."]
theorem prod_induction {M : Type*} [CommMonoid M] (f : α → M) (p : M → Prop)
    (hom : ∀ a b, p a → p b → p (a * b)) (unit : p 1) (base : ∀ x ∈ s, p <| f x) :
    p <| ∏ x ∈ s, f x

(hom : ∀ (a b : M), p a → p b → p (a + b))


/-- The measure of an open set is the supremum of the measures of compact sets it contains. -/
theorem _root_.IsOpen.measure_eq_iSup_isCompact ⦃U : Set α⦄ (hU : IsOpen U) (μ : Measure α)
    [Regular μ] : μ U = ⨆ (K : Set α) (_ : K ⊆ U) (_ : IsCompact K), μ K

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
⦃U : Set α⦄
(hU : IsOpen U)
(μ : MeasureTheory.Measure α)
[μ.Regular]

μ U = ⨆ K, ⨆ (_ : K ⊆ U), ⨆ (_ : IsCompact K), μ K


@[to_additive]
protected theorem Inseparable.zpow {G : Type*} [DivInvMonoid G] [TopologicalSpace G]
    [ContinuousMul G] [ContinuousInv G] {x y : G} (h : Inseparable x y) (m : ℤ) :
    Inseparable (x ^ m) (y ^ m)

{G : Type u_1}
[SubNegMonoid G]
[TopologicalSpace G]
[ContinuousAdd G]
[ContinuousNeg G]
{x y : G}
(h : Inseparable x y)
(m : ℤ)


/-- If `e : C ≌ D` is an equivalence of categories, then `functoriality F e.functor` induces an
equivalence between cocones over `F` and cocones over `F ⋙ e.functor`.
-/
@[simps]
def functorialityEquivalence (e : C ≌ D) : Cocone F ≌ Cocone (F ⋙ e.functor)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(F : J ⥤ C)
(e : C ≌ D)

(CategoryTheory.Limits.Cocones.functorialityEquivalence F e).counitIso =
  CategoryTheory.NatIso.ofComponents (fun c => CategoryTheory.Limits.Cocones.ext (e.counitIso.app c.pt) ⋯) ⋯


@[simp] lemma coe_recolorOfEmbedding (f : α ↪ β) :
    ⇑(G.recolorOfEmbedding f) = (Embedding.completeGraph f).toHom.comp

{V : Type u}
(G : SimpleGraph V)
{α : Type u_1}
{β : Type u_2}
(f : α ↪ β)

⇑(G.recolorOfEmbedding f) = (SimpleGraph.Embedding.completeGraph f).toHom.comp


/-- The discriminant of the power basis given by `ζ - 1`. Beware that in the cases `p ^ k = 1` and
`p ^ k = 2` the formula uses `1 / 2 = 0` and `0 - 1 = 0`. It is useful only to have a uniform
result. See also `IsCyclotomicExtension.Rat.discr_prime_pow_eq_unit_mul_pow'`. -/
theorem discr_prime_pow' [IsCyclotomicExtension {p ^ k} ℚ K] (hζ : IsPrimitiveRoot ζ ↑(p ^ k)) :
    discr ℚ (hζ.subOnePowerBasis ℚ).basis =
      (-1) ^ ((p ^ k : ℕ).totient / 2) * p ^ ((p : ℕ) ^ (k - 1) * ((p - 1) * k - 1))

{p : ℕ+}
{k : ℕ}
{K : Type u}
[Field K]
[CharZero K]
{ζ : K}
[hp : Fact (Nat.Prime ↑p)]
[IsCyclotomicExtension {p ^ k} ℚ K]
(hζ : IsPrimitiveRoot ζ ↑(p ^ k))

Algebra.discr ℚ ⇑(IsPrimitiveRoot.subOnePowerBasis ℚ hζ).basis =
  (-1) ^ (φ (↑p ^ k) / 2) * ↑↑p ^ (↑p ^ (k - 1) * ((↑p - 1) * k - 1))


/-- A bicategory structure on the oplax functors between bicategories. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
instance OplaxFunctor.bicategory : Bicategory (OplaxFunctor B C)

(B : Type u₁)
[CategoryTheory.Bicategory B]
(C : Type u₂)
[CategoryTheory.Bicategory C]
{F G : CategoryTheory.OplaxFunctor B C}
(η : F ⟶ G)
(a : B)

(CategoryTheory.Bicategory.leftUnitor η).hom.app a = (CategoryTheory.Bicategory.leftUnitor (η.app a)).hom


lemma finiteCoproduct.ι_desc_apply {B : CompHaus} {π : (a : α) → X a ⟶ B} (a : α) :
    ∀ x, finiteCoproduct.desc X π (finiteCoproduct.ι X a x) = π a x

(x : (CategoryTheory.forget CompHaus).obj (X a))

(CompHaus.finiteCoproduct.desc X π) ((CompHaus.finiteCoproduct.ι X a) x) = (π a) x


@[to_additive] lemma monotone_prod_take (L : List M) : Monotone fun i => (L.take i).prod

{M : Type u_3}
[CanonicallyOrderedCommMonoid M]
(L : List M)


theorem RingHom.ofLocalizationSpanTarget_iff_finite :
    RingHom.OfLocalizationSpanTarget @P ↔ RingHom.OfLocalizationFiniteSpanTarget @P

(P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop)

RingHom.OfLocalizationSpanTarget P ↔ RingHom.OfLocalizationFiniteSpanTarget P


theorem X_injective [Nontrivial R] : Function.Injective (X : σ → MvPolynomial σ R)

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[Nontrivial R]


theorem compPartialSumTargetSet_image_compPartialSumSource (m M N : ℕ)
    (i : Σ n, Composition n) (hi : i ∈ compPartialSumTargetSet m M N) :
    ∃ (j : _) (hj : j ∈ compPartialSumSource m M N), compChangeOfVariables m M N j hj = i

(hi : i ∈ FormalMultilinearSeries.compPartialSumTargetSet m M N)

∃ j,
  ∃ (hj : j ∈ FormalMultilinearSeries.compPartialSumSource m M N),
    FormalMultilinearSeries.compChangeOfVariables m M N j hj = i


lemma shift_distinguished_triangle (T : Triangle (HomotopyCategory C (ComplexShape.up ℤ)))
    (hT : T ∈ distinguishedTriangles C) (n : ℤ) :
      (Triangle.shiftFunctor _ n).obj T ∈ distinguishedTriangles C

(T : CategoryTheory.Pretriangulated.Triangle (HomotopyCategory C (ComplexShape.up ℤ)))

(hT : T ∈ HomotopyCategory.Pretriangulated.distinguishedTriangles C)

(CategoryTheory.Pretriangulated.Triangle.shiftFunctor (HomotopyCategory C (ComplexShape.up ℤ)) n).obj T ∈
  HomotopyCategory.Pretriangulated.distinguishedTriangles C


theorem mk_le_mk_of_subset {α} {s t : Set α} (h : s ⊆ t) : #s ≤ #t

{α : Type u_1}
{s t : Set α}
(h : s ⊆ t)


theorem get_succ_iterate' (n : ℕ) (f : α → α) (a : α) :
    get (iterate f a) (succ n) = f (get (iterate f a) n)

{α : Type u}
(n : ℕ)
(f : α → α)
(a : α)

(Stream'.iterate f a).get n.succ = f ((Stream'.iterate f a).get n)


theorem suffixLevenshtein_cons₁_fst (x : α) (xs ys) :
    (suffixLevenshtein C (x :: xs) ys).1 =
      levenshtein C (x :: xs) ys ::
        (suffixLevenshtein C xs ys).1

{α : Type u_1}
{β : Type u_2}
{δ : Type u_3}
[AddZeroClass δ]
[Min δ]
{C : Levenshtein.Cost α β δ}
(x : α)
(xs : List α)
(ys : List β)

(suffixLevenshtein C (x :: xs) ys).val = levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val


/-- Associate the dot product of `mulVec` to the left. -/
theorem dotProduct_mulVec [Fintype n] [Fintype m] [NonUnitalSemiring R] (v : m → R)
    (A : Matrix m n R) (w : n → R) : v ⬝ᵥ A *ᵥ w = v ᵥ* A ⬝ᵥ w

{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
[Fintype n]
[Fintype m]
[NonUnitalSemiring R]
(v : m → R)
(A : Matrix m n R)
(w : n → R)


lemma addMap_of_Z_ne_zero {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0)
    (hQz : Q z ≠ 0) (hxy : P x * Q z ^ 2 = Q x * P z ^ 2 → P y * Q z ^ 3 ≠ W.negY Q * P z ^ 3) :
    W.addMap ⟦P⟧ ⟦Q⟧ =
      ⟦![W.toAffine.addX (P x / P z ^ 2) (Q x / Q z ^ 2)
          (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
        W.toAffine.addY (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3)
          (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
        1]⟧


theorem subNatNat_of_sub_eq_zero {m n : Nat} (h : n - m = 0) : subNatNat m n = ↑(m - n)


{x₁ x₂ y : SetTheory.PGame}
(hx₁ : x₁.Numeric)
(hx₂ : x₂.Numeric)
(hy : y.Numeric)


theorem IsGLB.exists_between_self_add' (h : IsGLB s a) (h₂ : a ∉ s) (hε : 0 < ε) :
    ∃ b ∈ s, a < b ∧ b < a + ε

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{s : Set α}
{a ε : α}
(h : IsGLB s a)
(h₂ : a ∉ s)
(hε : 0 < ε)


/-- When the second map `S.g` is zero, this is the homology data on `S` given
by any colimit cokernel cofork of `S.f` -/
@[simps]
def ofIsColimitCokernelCofork (hg : S.g = 0) (c : CokernelCofork S.f) (hc : IsColimit c) :
    S.HomologyData

(c : CategoryTheory.Limits.CokernelCofork S.f)

(hc : CategoryTheory.Limits.IsColimit c)

(CategoryTheory.ShortComplex.HomologyData.ofIsColimitCokernelCofork S hg c hc).left =
  CategoryTheory.ShortComplex.LeftHomologyData.ofIsColimitCokernelCofork S hg c hc


@[simp] lemma divInt_one (n : ℤ) : n /. 1 = n


@[simp]
theorem accepts_comap (f : α' → α) : (M.comap f).accepts = List.map f ⁻¹' M.accepts

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

(DFA.comap f M).accepts = List.map f ⁻¹' M.accepts


theorem gcd_eq_left_iff_dvd {m n : ℕ+} : m ∣ n ↔ m.gcd n = m


theorem lt_le_trans (h₁ : cmp x y = .lt) (h₂ : cmp y z ≠ .gt) : cmp x z = .lt

∀ {x : Sort u_1} {cmp : x → x → Ordering} [inst : Batteries.TransCmp cmp] {x_1 y z : x},
  cmp x_1 y = Ordering.lt → cmp y z ≠ Ordering.gt → cmp x_1 z = Ordering.lt


theorem summable_sigma {β : α → Type*} {f : (Σ x, β x) → ℝ≥0} :
    Summable f ↔ (∀ x, Summable fun y => f ⟨x, y⟩) ∧ Summable fun x => ∑' y, f ⟨x, y⟩

{α : Type u_1}
{β : α → Type u_4}
{f : (x : α) × β x → ℝ≥0}

Summable f ↔ (∀ (x : α), Summable fun y => f ⟨x, y⟩) ∧ Summable fun x => ∑' (y : β x), f ⟨x, y⟩


{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(D : LieDerivation R L M)
(a : L)


@[simp]
lemma egirth_eq_top : G.egirth = ⊤ ↔ G.IsAcyclic


theorem count_eq_zero_of_ne [DecidableEq (Associates α)] {p q : Associates α} (hp : Irreducible p)
    (hq : Irreducible q) (h : p ≠ q) : p.count q.factors = 0

[(p : Associates α) → Decidable (Irreducible p)]


theorem inseparable_lim_iff [CompleteSpace α] {f g : CauchyFilter α} :
    haveI := f.2.1.nonempty; Inseparable (lim f.1) (lim g.1) ↔ Inseparable f g

{α : Type u}
[UniformSpace α]
[CompleteSpace α]
{f g : CauchyFilter α}

Inseparable (lim ↑f) (lim ↑g) ↔ Inseparable f g


theorem Finite.einfsep (hs : s.Finite) : s.einfsep = hs.offDiag.toFinset.inf (uncurry edist)

{α : Type u_1}
[EDist α]
{s : Set α}
(hs : s.Finite)

s.einfsep = ⋯.toFinset.inf (Function.uncurry edist)


@[simp] lemma support_pow (f : ι → M₀) (hn : n ≠ 0) : support (fun a ↦ f a ^ n) = support f

{ι : Type u_1}
{M₀ : Type u_4}
[MonoidWithZero M₀]
[NoZeroDivisors M₀]
{n : ℕ}
(f : ι → M₀)
(hn : n ≠ 0)

(Function.support fun a => f a ^ n) = Function.support f


@[simp, norm_cast]
lemma cast_multiset_sum [AddCommMonoidWithOne β] (s : Multiset ℕ) :
    (↑s.sum : β) = (s.map (↑)).sum

{β : Type u_3}
[AddCommMonoidWithOne β]
(s : Multiset ℕ)


lemma generateFrom_memPartition_le [m : MeasurableSpace α] {t : ℕ → Set α}
    (ht : ∀ n, MeasurableSet (t n)) (n : ℕ) :
    generateFrom (memPartition t n) ≤ m

{α : Type u_1}
[m : MeasurableSpace α]
{t : ℕ → Set α}
(ht : ∀ (n : ℕ), MeasurableSet (t n))
(n : ℕ)

MeasurableSpace.generateFrom (memPartition t n) ≤ m


@[simp]
theorem uncurry_apply_cons {n : ℕ} {α} {p : Fin n → Type u} {τ : Type u}
    (f : Function.FromTypes (vecCons α p) τ) (a : α) (args : (i : Fin n) → p i) :
    uncurry f (Fin.cons a args) = @uncurry _ p _ (f a) args

(f : Function.FromTypes (Matrix.vecCons α p) τ)

f.uncurry (Fin.cons a args) = (f a).uncurry args


theorem splits_X_sub_C {x : K} : (X - C x).Splits i

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

Polynomial.Splits i (Polynomial.X - Polynomial.C x)


theorem uniformInducing_iff [PseudoEMetricSpace β] {f : α → β} :
    UniformInducing f ↔ UniformContinuous f ∧
      ∀ δ > 0, ∃ ε > 0, ∀ {a b : α}, edist (f a) (f b) < ε → edist a b < δ

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}


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

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

((CategoryTheory.Limits.Cone.equivCostructuredArrow F).counitIso.hom.app X).left =
  CategoryTheory.CategoryStruct.id X.left


theorem Ideal.eq_prime_pow_of_succ_lt_of_le {P I : Ideal A} [P_prime : P.IsPrime] (hP : P ≠ ⊥)
    {i : ℕ} (hlt : P ^ (i + 1) < I) (hle : I ≤ P ^ i) : I = P ^ i

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
{P I : Ideal A}
[P_prime : P.IsPrime]
(hP : P ≠ ⊥)
{i : ℕ}
(hlt : P ^ (i + 1) < I)
(hle : I ≤ P ^ i)


theorem chain_append_singleton_iff_forall₂ :
    Chain R a (l ++ [b]) ↔ Forall₂ R (a :: l) (l ++ [b])

{α : Type u}
{R : α → α → Prop}
{l : List α}
{a b : α}

List.Chain R a (l ++ [b]) ↔ List.Forall₂ R (a :: l) (l ++ [b])


theorem le_log_iff_exp_le (hy : 0 < y) : x ≤ log y ↔ exp x ≤ y


theorem gauge_lt_eq (absorbs : Absorbent ℝ s) (a : ℝ) :
    { x | gauge s x < a } = ⋃ r ∈ Set.Ioo 0 (a : ℝ), r • s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
(absorbs : Absorbent ℝ s)
(a : ℝ)

{x | gauge s x < a} = ⋃ r ∈ Set.Ioo 0 a, r • s


/-- The translation of a strictly convex set is also strictly convex. -/
theorem StrictConvex.preimage_add_right (hs : StrictConvex 𝕜 s) (z : E) :
    StrictConvex 𝕜 ((fun x => z + x) ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[AddCancelCommMonoid E]
[ContinuousAdd E]
[Module 𝕜 E]
{s : Set E}
(hs : StrictConvex 𝕜 s)
(z : E)


@[to_additive]
theorem prehaar_mem_haarProduct (K₀ : PositiveCompacts G) {U : Set G} (hU : (interior U).Nonempty) :
    prehaar (K₀ : Set G) U ∈ haarProduct (K₀ : Set G)

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.haar.prehaar (↑K₀) U ∈ MeasureTheory.Measure.haar.haarProduct ↑K₀


/-- Isometry between the tangent space `V` of a (semi)normed add torsor `P` and `P` given by
addition/subtraction of `x : P`. -/
@[simps!]
def IsometryEquiv.vaddConst (x : P) : V ≃ᵢ P

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(x p' : P)

(IsometryEquiv.vaddConst x).invFun p' = p' -ᵥ x


theorem iUnion_closure_compactCovering : ⋃ n, closure (compactCovering X n) = univ

(X : Type u_1)
[TopologicalSpace X]
[SigmaCompactSpace X]

⋃ n, closure (compactCovering X n) = Set.univ


lemma optionEquivLeft_C (r : R) : optionEquivLeft R S₁ (C r) = Polynomial.C (C r)

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

(MvPolynomial.optionEquivLeft R S₁) (MvPolynomial.C r) = Polynomial.C (MvPolynomial.C r)


theorem mem_ofSet_self_iff {s : Set α} [DecidablePred (· ∈ s)] {a : α} : a ∈ ofSet s a ↔ a ∈ s

{α : Type u}
{s : Set α}
[DecidablePred fun x => x ∈ s]
{a : α}


/-- Given a compact set `K` inside an open set `U`, there is an open neighborhood `V` of `1`
  such that `K * V ⊆ U`. -/
@[to_additive
  "Given a compact set `K` inside an open set `U`, there is an open neighborhood `V` of
  `0` such that `K + V ⊆ U`."]
theorem compact_open_separated_mul_right {K U : Set G} (hK : IsCompact K) (hU : IsOpen U)
    (hKU : K ⊆ U) : ∃ V ∈ 𝓝 (1 : G), K * V ⊆ U

{G : Type w}
[TopologicalSpace G]
[MulOneClass G]
[ContinuousMul G]
{K U : Set G}
(hK : IsCompact K)
(hU : IsOpen U)
(hKU : K ⊆ U)


theorem eval_indicator_apply_eq_one (a : σ → K) : eval a (indicator a) = 1

{K : Type u_1}
{σ : Type u_2}
[Fintype K]
[Fintype σ]
[CommRing K]
(a : σ → K)

(MvPolynomial.eval a) (MvPolynomial.indicator a) = 1


lemma add_of_Z_eq_zero_right {P Q : Fin 3 → R} (hQ : W'.Equation Q) (hPz : P z ≠ 0)
    (hQz : Q z = 0) : W'.add P Q = -(Q x * P z) • P

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P Q : Fin 3 → R}
(hQ : W'.Equation Q)
(hPz : P z ≠ 0)
(hQz : Q z = 0)


/-- The map `Square C → Square Cᵒᵖ` which switches `X₁` and `X₃`, but
does not move `X₂` and `X₃`. -/
@[simps]
protected def op (sq : Square C) : Square Cᵒᵖ

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


theorem IsInternal.ofBijective_coeLinearMap_of_mem_ne (h : IsInternal A)
    {i j : ι} (hij : i ≠ j) {x : M} (hx : x ∈ A i) :
    (LinearEquiv.ofBijective (coeLinearMap A) h).symm x j = 0

{R : Type u}
[Semiring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : Type u_1}
[AddCommMonoid M]
[Module R M]
{A : ι → Submodule R M}
(h : DirectSum.IsInternal A)
{i j : ι}
(hij : i ≠ j)
{x : M}
(hx : x ∈ A i)

((LinearEquiv.ofBijective (DirectSum.coeLinearMap A) h).symm x) j = 0


@[simp]
theorem infinite_union {s t : Set α} : (s ∪ t).Infinite ↔ s.Infinite ∨ t.Infinite


theorem iff_unop {A B X Y : Cᵒᵖ} {f : A ⟶ X} {i : A ⟶ B} {p : X ⟶ Y} {g : B ⟶ Y}
    (sq : CommSq f i p g) : HasLift sq ↔ HasLift sq.unop

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


theorem map_sub_swap (x y : R) : v (x - y) = v (y - x)

{R : Type u_3}
{Γ₀ : Type u_4}
[LinearOrderedAddCommGroupWithTop Γ₀]
[Ring R]
(v : AddValuation R Γ₀)
(x y : R)


/-- The left unitor isomorphism for binary products with the terminal object. -/
@[simps]
def prod.leftUnitor (P : C) [HasBinaryProduct (⊤_ C) P] : (⊤_ C) ⨯ P ≅ P

[CategoryTheory.Limits.HasBinaryProduct (⊤_ C) P]

(CategoryTheory.Limits.prod.leftUnitor P).inv =
  CategoryTheory.Limits.prod.lift (CategoryTheory.Limits.terminal.from P) (𝟙 P)


theorem norm_fderiv_norm_id_rpow (x : E) {p : ℝ} (hp : 1 < p) :
    ‖fderiv ℝ (fun x ↦ ‖x‖ ^ p) x‖ = p * ‖x‖ ^ (p - 1)

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
(x : E)
{p : ℝ}
(hp : 1 < p)

‖fderiv ℝ (fun x => ‖x‖ ^ p) x‖ = p * ‖x‖ ^ (p - 1)


theorem dist_dist_dist_le_left (x y z : α) : dist (dist x z) (dist y z) ≤ dist x y

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


@[to_additive]
theorem dist_div_div_le (a₁ a₂ b₁ b₂ : E) : dist (a₁ / a₂) (b₁ / b₂) ≤ dist a₁ b₁ + dist a₂ b₂

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


theorem Ideal.toCharacterSpace_apply_eq_zero_of_mem {a : A} (ha : a ∈ I) :
    I.toCharacterSpace a = 0

{A : Type u_1}
[NormedCommRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
(I : Ideal A)
[I.IsMaximal]
{a : A}
(ha : a ∈ I)


theorem frontier_Iic_subset (a : α) : frontier (Iic a) ⊆ {a}

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
(a : α)


theorem IsDiag.submatrix [Zero α] {A : Matrix n n α} (ha : A.IsDiag) {f : m → n}
    (hf : Injective f) : (A.submatrix f f).IsDiag

{α : Type u_1}
{n : Type u_4}
{m : Type u_5}
[Zero α]
{A : Matrix n n α}
(ha : A.IsDiag)
{f : m → n}
(hf : Function.Injective f)


@[simp]
theorem cone_fst (h : IsPullback fst snd f g) : h.cone.fst = fst

(h : CategoryTheory.IsPullback fst snd f g)


theorem pairwise_disjoint_Ico_intCast :
    Pairwise (Disjoint on fun n : ℤ => Ico (n : α) (n + 1))

Pairwise (Disjoint on fun n => Set.Ico (↑n) (↑n + 1))


@[simp]
theorem inter_assoc (s₁ s₂ s₃ : Finset α) : s₁ ∩ s₂ ∩ s₃ = s₁ ∩ (s₂ ∩ s₃)

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

s₁ ∩ s₂ ∩ s₃ = s₁ ∩ (s₂ ∩ s₃)


theorem fib_dvd (m n : ℕ) (h : m ∣ n) : fib m ∣ fib n


@[simp]
theorem Sum.elim_range (f : α → γ) (g : β → γ) : range (Sum.elim f g) = range f ∪ range g

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

Set.range (Sum.elim f g) = Set.range f ∪ Set.range g


lemma exact_iff_homology_iso_zero [S.HasHomology] [HasZeroObject C] :
    S.Exact ↔ Nonempty (S.homology ≅ 0)


theorem exact_cokernel {X Y : C} (f : X ⟶ Y) :
    (ShortComplex.mk f (cokernel.π f) (by simp)).Exact

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

(CategoryTheory.ShortComplex.mk f (CategoryTheory.Limits.cokernel.π f) ⋯).Exact


@[simp]
theorem decompose_one : decompose 𝒜 (1 : A) = 1

{ι : Type u_1}
{A : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddMonoid ι]
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[GradedRing 𝒜]


protected theorem le_floor {z : ℤ} : ∀ {r : ℚ}, z ≤ Rat.floor r ↔ (z : ℚ) ≤ r


theorem mem_ofZNum' : ∀ {m : Num} {n : ZNum}, m ∈ ofZNum' n ↔ n = toZNum m


theorem zero_rootSpace_eq_top_of_nilpotent [IsNilpotent R L] :
    rootSpace (⊤ : LieSubalgebra R L) 0 = ⊤

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]


/-- Given a finite set `s`, the product of `f i * g i` over `i ∈ s` equals the product of `f i`
over `i ∈ s` times the product of `g i` over `i ∈ s`. -/
@[to_additive
      "Given a finite set `s`, the sum of `f i + g i` over `i ∈ s` equals the sum of `f i`
      over `i ∈ s` plus the sum of `g i` over `i ∈ s`."]
theorem finprod_mem_mul_distrib (hs : s.Finite) :
    ∏ᶠ i ∈ s, f i * g i = (∏ᶠ i ∈ s, f i) * ∏ᶠ i ∈ s, g i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f g : α → M}
{s : Set α}
(hs : s.Finite)

∏ᶠ (i : α) (_ : i ∈ s), f i * g i = (∏ᶠ (i : α) (_ : i ∈ s), f i) * ∏ᶠ (i : α) (_ : i ∈ s), g i


theorem sum (s : Finset ι) {f : ι → ℝ → E} (h : ∀ i ∈ s, IntervalIntegrable (f i) μ a b) :
    IntervalIntegrable (∑ i ∈ s, f i) μ a b


theorem innerProp (r : 𝕜) : innerProp' E r

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[InnerProductSpaceable E]
(r : 𝕜)


@[simp]
theorem compContinuousLinearMapLRight_apply (g : ContinuousMultilinearMap 𝕜 E₁ G)
    (f : ∀ i, E i →L[𝕜] E₁ i) : compContinuousLinearMapLRight g f = g.compContinuousLinearMap f

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

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

g.compContinuousLinearMapLRight f = g.compContinuousLinearMap f


protected
theorem «exists» {p : Interval α → Prop} : (∃ s, p s) ↔ p ⊥ ∨ ∃ s : NonemptyInterval α, p s

{α : Type u_1}
[LE α]
{p : Interval α → Prop}


@[to_additive (attr := simp)]
theorem coe_one [One Y] : ⇑(1 : LocallyConstant X Y) = (1 : X → Y)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[One Y]


@[simp]
theorem prodMonoidal_leftUnitor_hom_fst (X : C₁ × C₂) :
    ((λ_ X).hom : 𝟙_ _ ⊗ X ⟶ X).1 = (λ_ X.1).hom

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

(CategoryTheory.MonoidalCategory.leftUnitor X).hom.1 = (CategoryTheory.MonoidalCategory.leftUnitor X.1).hom


theorem Base.compl_base_of_dual (h : M✶.Base B) : M.Base (M.E \ B)

{α : Type u_1}
{M : Matroid α}
{B : Set α}
(h : M✶.Base B)


lemma isIso_iff_of_hasRightResolutions [Φ.HasRightResolutions] {F G : D₂ ⥤ H} (α : F ⟶ G) :
    IsIso α ↔ ∀ (X₁ : C₁), IsIso (α.app (L₂.obj (Φ.functor.obj X₁)))

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

CategoryTheory.IsIso α ↔ ∀ (X₁ : C₁), CategoryTheory.IsIso (α.app (L₂.obj (Φ.functor.obj X₁)))


@[continuity, fun_prop]
theorem continuous_pi (h : ∀ i, Continuous fun a => f a i) : Continuous f

(h : ∀ (i : ι), Continuous fun a => f a i)


theorem subset_cons_diff {a : α} {l₁ l₂ : List α} : (a :: l₁).diff l₂ ⊆ a :: l₁.diff l₂

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


@[simp]
theorem toConstProdContinuousLinearMap_fst (f : V →ᴬ[𝕜] W) :
    (toConstProdContinuousLinearMap 𝕜 V W f).fst = f 0

(𝕜 : Type u_1)
(V : Type u_3)
(W : Type u_4)
[NormedAddCommGroup V]
[NormedAddCommGroup W]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 V]
[NormedSpace 𝕜 W]
(f : V →ᴬ[𝕜] W)

((ContinuousAffineMap.toConstProdContinuousLinearMap 𝕜 V W) f).1 = f 0