lemma hasSmallLocalizedShiftedHom_iff
    (L : C ⥤ D) [L.IsLocalization W] [L.CommShift M] (X Y : C) :
    HasSmallLocalizedShiftedHom.{w} W M X Y ↔
      ∀ (a b : M), Small.{w} ((L.obj X)⟦a⟧ ⟶ (L.obj Y)⟦b⟧)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(W : CategoryTheory.MorphismProperty C)
(M : Type w')
[AddMonoid M]
[CategoryTheory.HasShift C M]
[CategoryTheory.HasShift D M]
(L : CategoryTheory.Functor C D)
[L.IsLocalization W]
[L.CommShift M]
(X Y : C)

CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M X Y ↔
  ∀ (a b : M),
    Small.{w, v₂} ((CategoryTheory.shiftFunctor D a).obj (L.obj X) ⟶ (CategoryTheory.shiftFunctor D b).obj (L.obj Y))


theorem indep_of_indep_of_le_left {m₁ m₂ m₃ : MeasurableSpace Ω} {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} (h_indep : Indep m₁ m₂ κ μ) (h31 : m₃ ≤ m₁) :
    Indep m₃ m₂ κ μ

(h_indep : ProbabilityTheory.Kernel.Indep m₁ m₂ κ μ)

ProbabilityTheory.Kernel.Indep m₃ m₂ κ μ


/-- Definition of `≤` for congruence relations. -/
theorem le_def {c d : RingCon R} : c ≤ d ↔ ∀ {x y}, c x y → d x y

{R : Type u_2}
[Add R]
[Mul R]
{c d : RingCon R}


@[to_additive]
theorem mem_inv {x : α} : x ∈ s⁻¹ ↔ ∃ y ∈ s, y⁻¹ = x

{α : Type u_2}
[DecidableEq α]
[Inv α]
{s : Finset α}
{x : α}

x ∈ s⁻¹ ↔ ∃ y ∈ s, y⁻¹ = x


theorem trace_kroneckerTMul [Fintype m] [Fintype n] (A : Matrix m m α) (B : Matrix n n β) :
    trace (A ⊗ₖₜ[R] B) = trace A ⊗ₜ[R] trace B

(R : Type u_1)
{α : Type u_2}
{β : Type u_4}
{m : Type u_9}
{n : Type u_10}
[CommSemiring R]
[AddCommMonoid α]
[AddCommMonoid β]
[Module R α]
[Module R β]
[Fintype m]
[Fintype n]
(A : Matrix m m α)
(B : Matrix n n β)

(Matrix.kroneckerMap (TensorProduct.tmul R) A B).trace = A.trace ⊗ₜ[R] B.trace


theorem smul_iSup {R : Type*} [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞]
    {ι : Sort*} (f : ι → OuterMeasure α) (c : R) :
    (c • ⨆ i, f i) = ⨆ i, c • f i

{α : Type u_1}
{R : Type u_3}
[SMul R ℝ≥0∞]
[IsScalarTower R ℝ≥0∞ ℝ≥0∞]
{ι : Sort u_4}
(f : ι → MeasureTheory.OuterMeasure α)
(c : R)


@[to_additive]
theorem tendsto_list_prod {f : ι → α → M} {x : Filter α} {a : ι → M} :
    ∀ l : List ι,
      (∀ i ∈ l, Tendsto (f i) x (𝓝 (a i))) →
        Tendsto (fun b => (l.map fun c => f c b).prod) x (𝓝 (l.map a).prod)

{ι : Type u_1}
{α : Type u_2}
{M : Type u_3}
[TopologicalSpace M]
[AddMonoid M]
[ContinuousAdd M]
{f : ι → α → M}
{x : Filter α}
{a : ι → M}
(l : List ι)

(∀ i ∈ l, Filter.Tendsto (f i) x (𝓝 (a i))) →
  Filter.Tendsto (fun b => (List.map (fun c => f c b) l).sum) x (𝓝 (List.map a l).sum)


/-- The object level part of the backward direction of `Comon_ (Mon_ C) ≌ Mon_ (Comon_ C)` -/
@[simps]
def ofMon_Comon_obj (M : Mon_ (Comon_ C)) : Bimon_ C

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

(Bimon_.ofMon_Comon_obj C M).X = (Comon_.forgetMonoidal C).mapMon.obj M


theorem Module.finite_of_rank_eq_one [Module.Free R M] (h : Module.rank R M = 1) :
    Module.Finite R M

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
(h : Module.rank R M = 1)


@[simp]
theorem linfty_opNorm_diagonal [DecidableEq m] (v : m → α) : ‖diagonal v‖ = ‖v‖

{m : Type u_3}
{α : Type u_5}
[Fintype m]
[SeminormedAddCommGroup α]
[DecidableEq m]
(v : m → α)


protected theorem Nodup.pairwise : (∀ a ∈ s, ∀ b ∈ s, a ≠ b → r a b) → Nodup s → Pairwise r s

{α : Type u_1}
{r : α → α → Prop}
{s : Multiset α}

(∀ a ∈ s, ∀ b ∈ s, a ≠ b → r a b) → s.Nodup → Multiset.Pairwise r s


theorem or_left_comm  : a ∨ (b ∨ c) ↔ b ∨ (a ∨ c)


@[to_additive (attr := simp)]
theorem untop_one : (1 : WithTop α).untop coe_ne_top = 1


/-- There are `⌊(b - v) / r⌋ - ⌊(a - v) / r⌋` numbers congruent to `v` mod `r` in `(a, b]`,
if `a ≤ b`. `Nat` version of `Int.Ioc_filter_modEq_card`. -/
theorem Ioc_filter_modEq_card (v : ℕ) : ((Ioc a b).filter (· ≡ v [MOD r])).card =
    max (⌊(b - v) / (r : ℚ)⌋ - ⌊(a - v) / (r : ℚ)⌋) 0

↑(Finset.filter (fun x => x ≡ v [MOD r]) (Finset.Ioc a b)).card = max (⌊(↑b - ↑v) / ↑r⌋ - ⌊(↑a - ↑v) / ↑r⌋) 0


/-- Only a ring of characteristic zero can can have a non-trivial module without additive or
scalar torsion. -/
theorem CharZero.of_noZeroSMulDivisors [Nontrivial M] [NoZeroSMulDivisors ℤ M] : CharZero R

(R : Type u_2)
(M : Type u_5)
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial M]
[NoZeroSMulDivisors ℤ M]


@[to_additive]
theorem singleton_div_singleton (a b : α) : ({a} : Finset α) / {b} = {a / b}

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


@[simp] lemma of_symm_smul (f : R[X]) (m : AEval R M a) :
    (of R M a).symm (f • m) = aeval a f • (of R M a).symm m

{R : Type u_1}
{A : Type u_3}
{M : Type u_2}
[CommSemiring R]
[Semiring A]
(a : A)
[Algebra R A]
[AddCommMonoid M]
[Module A M]
[Module R M]
[IsScalarTower R A M]
(f : R[X])
(m : Module.AEval R M a)

(Module.AEval.of R M a).symm (f • m) = (Polynomial.aeval a) f • (Module.AEval.of R M a).symm m


theorem nodup_map_iff_of_injective {f : α → β} (d : Function.Injective f) :
    Nodup (map f s) ↔ Nodup s

{α : Type u_1}
{β : Type u_2}
{s : Multiset α}
{f : α → β}
(d : Function.Injective f)


theorem convexBodySum_isBounded : Bornology.IsBounded (convexBodySum K B)

(K : Type u_1)
[Field K]
[NumberField K]
(B : ℝ)

Bornology.IsBounded (NumberField.mixedEmbedding.convexBodySum K B)


/-- A vector in `K` is orthogonal to one in `Kᗮ`. -/
theorem inner_right_of_mem_orthogonal {u v : E} (hu : u ∈ K) (hv : v ∈ Kᗮ) : ⟪u, v⟫ = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
{u v : E}
(hu : u ∈ K)
(hv : v ∈ Kᗮ)


@[simp, norm_cast] lemma coe_sum (s : Finset ι) (f : ι → α) :
    ∑ i ∈ s, f i = ∑ i ∈ s, (f i : WithBot α)

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


@[to_additive (attr := simp)]
theorem coprodAssoc_apply_inr (x : P) : coprodAssoc M N P (inr x) = inr (inr x)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[AddMonoid M]
[AddMonoid N]
[AddMonoid P]
(x : P)

(AddMonoid.MulEquiv.coprodAssoc M N P) (AddMonoid.Coprod.inr x) = AddMonoid.Coprod.inr (AddMonoid.Coprod.inr x)


theorem map_P {D : Type*} [Category D] [Preadditive D] (G : C ⥤ D) [G.Additive]
    (X : SimplicialObject C) (q n : ℕ) :
    G.map ((P q : K[X] ⟶ _).f n) = (P q : K[((whiskering C D).obj G).obj X] ⟶ _).f n

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Preadditive C]
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive D]
(G : C ⥤ D)
[G.Additive]
(X : CategoryTheory.SimplicialObject C)
(q n : ℕ)

G.map ((AlgebraicTopology.DoldKan.P q).f n) = (AlgebraicTopology.DoldKan.P q).f n


theorem empty_card : Fintype.card (∅ : Set α) = 0


lemma fib_add_one : ∀ {n}, n ≠ 0 → fib (n + 1) = fib (n - 1) + fib n

n ≠ 0 → Nat.fib (n + 1) = Nat.fib (n - 1) + Nat.fib n


theorem turnBound_ne_zero_of_left_move {s t : S} (m : t ∈ l s) : turnBound s ≠ 0

{S : Type u}
[SetTheory.PGame.State S]
{s t : S}
(m : t ∈ SetTheory.PGame.State.l s)


theorem colLen_eq_card (μ : YoungDiagram) {j : ℕ} : μ.colLen j = (μ.col j).card


/-- `t` is in the shadow of `𝒜` iff there is a `s ∈ 𝒜` from which we can remove one element to
get `t`. -/
lemma mem_shadow_iff : t ∈ ∂ 𝒜 ↔ ∃ s ∈ 𝒜, ∃ a ∈ s, erase s a = t

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{t : Finset α}

t ∈ 𝒜.shadow ↔ ∃ s ∈ 𝒜, ∃ a ∈ s, s.erase a = t


@[simp]
theorem localRingHom_id : localRingHom I I (RingHom.id R) (Ideal.comap_id I).symm = RingHom.id _

{R : Type u_1}
[CommSemiring R]
(I : Ideal R)
[hI : I.IsPrime]

Localization.localRingHom I I (RingHom.id R) ⋯ = RingHom.id (Localization.AtPrime I)


/-- While we didn't need decidable instances to define it, we do to reduce it to a sum -/
theorem sumAddHom_apply [∀ i, AddZeroClass (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)]
    [AddCommMonoid γ] (φ : ∀ i, β i →+ γ) (f : Π₀ i, β i) : sumAddHom φ f = f.sum fun x => φ x

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]

(DFinsupp.sumAddHom φ) f = f.sum fun x => ⇑(φ x)


/-- Proves that **Bertrand's postulate** holds for all sufficiently large `n`.
-/
theorem exists_prime_lt_and_le_two_mul_eventually (n : ℕ) (n_large : 512 ≤ n) :
    ∃ p : ℕ, p.Prime ∧ n < p ∧ p ≤ 2 * n


theorem convolution_def [Sub G] : (f ⋆[L, μ] g) x = ∫ t, L (f t) (g (x - t)) ∂μ

{𝕜 : Type u𝕜}
{G : Type uG}
{E : Type uE}
{E' : Type uE'}
{F : Type uF}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[NormedAddCommGroup F]
{f : G → E}
{g : G → E'}
{x : G}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 E']
[NormedSpace 𝕜 F]
(L : E →L[𝕜] E' →L[𝕜] F)
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[NormedSpace ℝ F]
[Sub G]

MeasureTheory.convolution f g L μ x = ∫ (t : G), (L (f t)) (g (x - t)) ∂μ


@[simp]
theorem uniqueMDiffOn_preimage (h : M ≃ₘ^n⟮I, J⟯ N) (hn : 1 ≤ n) {s : Set N} :
    UniqueMDiffOn I (h ⁻¹' s) ↔ UniqueMDiffOn J s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
[SmoothManifoldWithCorners I M]
[SmoothManifoldWithCorners J N]
(h : M ≃ₘ^n⟮I, J⟯ N)
(hn : 1 ≤ n)
{s : Set N}

UniqueMDiffOn I (⇑h ⁻¹' s) ↔ UniqueMDiffOn J s


/-- The trace of an endomorphism of a direct sum is the sum of the traces on each component.

See also `LinearMap.trace_restrict_eq_sum_trace_restrict`. -/
lemma trace_eq_sum_trace_restrict [Fintype ι]
    {f : M →ₗ[R] M} (hf : ∀ i, MapsTo f (N i) (N i)) :
    trace R M f = ∑ i, trace R (N i) (f.restrict (hf i))

(hf : ∀ (i : ι), Set.MapsTo ⇑f ↑(N i) ↑(N i))

(LinearMap.trace R M) f = ∑ i : ι, (LinearMap.trace R ↥(N i)) (f.restrict ⋯)


@[to_additive]
theorem closure_iUnion {ι} (s : ι → Set M) : closure (⋃ i, s i) = ⨆ i, closure (s i)

{M : Type u_1}
[Add M]
{ι : Sort u_4}
(s : ι → Set M)

AddSubsemigroup.closure (⋃ i, s i) = ⨆ i, AddSubsemigroup.closure (s i)


/-- An alternative constructor to `QuadraticMap.mk`, for rings where `polar` can be used. -/
@[simps]
def ofPolar (toFun : M → N) (toFun_smul : ∀ (a : R) (x : M), toFun (a • x) = (a * a) • toFun x)
    (polar_add_left : ∀ x x' y : M, polar toFun (x + x') y = polar toFun x y + polar toFun x' y)
    (polar_smul_left : ∀ (a : R) (x y : M), polar toFun (a • x) y = a • polar toFun x y) :
    QuadraticMap R M N

(polar_add_left :
  ∀ (x x' y : M), QuadraticMap.polar toFun (x + x') y = QuadraticMap.polar toFun x y + QuadraticMap.polar toFun x' y)

(polar_smul_left : ∀ (a : R) (x y : M), QuadraticMap.polar toFun (a • x) y = a • QuadraticMap.polar toFun x y)

∀ (a : M), (QuadraticMap.ofPolar toFun toFun_smul polar_add_left polar_smul_left) a = toFun a


theorem out_mul (a b : Associates α) : (a * b).out = a.out * b.out

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
(a b : Associates α)


/-- Functor composition induces a functor on augmented cosimplicial objects. -/
@[simps]
def whiskering (D : Type u') [Category.{v'} D] : (C ⥤ D) ⥤ Augmented C ⥤ Augmented D

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

∀ {X Y : C ⥤ D} (η : X ⟶ Y) (A : CategoryTheory.CosimplicialObject.Augmented C),
  (((CategoryTheory.CosimplicialObject.Augmented.whiskering C D).map η).app A).left =
    η.app (CategoryTheory.CosimplicialObject.Augmented.point.obj A)


/-- A subfield contains the field's 0. -/
protected theorem zero_mem : (0 : K) ∈ s

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


/-- Given a chain from `a` to `b`, and a predicate true at `b`, if `r x y → p y → p x` then
the predicate is true at `a`.
That is, we can propagate the predicate all the way up the chain.
-/
@[elab_as_elim]
theorem Chain.induction_head (p : α → Prop) (l : List α) (h : Chain r a l)
    (hb : getLast (a :: l) (cons_ne_nil _ _) = b) (carries : ∀ ⦃x y : α⦄, r x y → p y → p x)
    (final : p b) : p a


@[simp] theorem encard_univ_coe (s : Set α) : encard (univ : Set s) = encard s


theorem mem_Iic_Iio_of_subset_of_subset {s : Set α} (ho : Iio a ⊆ s) (hc : s ⊆ Iic a) :
    s ∈ ({Iic a, Iio a} : Set (Set α))

{α : Type u_1}
[PartialOrder α]
{a : α}
{s : Set α}
(ho : Set.Iio a ⊆ s)
(hc : s ⊆ Set.Iic a)


theorem getElem_set (a : Array α) (i : Fin a.size) (v : α) (j : Nat)
    (h : j < (a.set i v).size) :
    (a.set i v)[j]'h = if i = j then v else a[j]'(size_set a i v ▸ h)

{α : Type u_1}
(a : Array α)
(i : Fin a.size)
(v : α)
(j : Nat)
(h : j < (a.set i v).size)

(a.set i v)[j] = if ↑i = j then v else a[j]


@[simp]
theorem polynomialFunctions_coe (X : Set R) :
    (polynomialFunctions X : Set C(X, R)) = Set.range (Polynomial.toContinuousMapOnAlgHom X)

{R : Type u_1}
[CommSemiring R]
[TopologicalSpace R]
[TopologicalSemiring R]
(X : Set R)

↑(polynomialFunctions X) = Set.range ⇑(Polynomial.toContinuousMapOnAlgHom X)


@[to_additive (attr := simp)]
lemma mk_pow [Monoid M] (a : M) (n : ℕ) : mk (a ^ n) = mk a ^ n

{M : Type u_1}
[Monoid M]
(a : M)
(n : ℕ)

DomMulAct.mk (a ^ n) = DomMulAct.mk a ^ n


theorem pointwise_smul_def {a : M} (S : Ideal R) :
    a • S = S.map (MulSemiringAction.toRingHom _ _ a)

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[CommRing R]
[MulSemiringAction M R]
{a : M}
(S : Ideal R)

a • S = Ideal.map (MulSemiringAction.toRingHom M R a) S


@[simp]
theorem rTensor_sub (f g : N →ₗ[R] P) : (f - g).rTensor M = f.rTensor M - g.rTensor M

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
(f g : N →ₗ[R] P)

LinearMap.rTensor M (f - g) = LinearMap.rTensor M f - LinearMap.rTensor M g


theorem dvd_card_of_dvd_card [Finite G] {p : ℕ} [Fact p.Prime] (P : Sylow p G)
    (hdvd : p ∣ Nat.card G) : p ∣ Nat.card P

{G : Type u}
[Group G]
[Finite G]
{p : ℕ}
[Fact (Nat.Prime p)]
(P : Sylow p G)
(hdvd : p ∣ Nat.card G)


@[simp]
lemma coeff_Ψ₃ : W.Ψ₃.coeff 4 = 3

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)


theorem toSphere_apply_aux (s : Set (sphere (0 : E) 1)) (r : Ioi (0 : ℝ)) :
    μ ((↑) '' (homeomorphUnitSphereProd E ⁻¹' s ×ˢ Iio r)) = μ (Ioo (0 : ℝ) r • ((↑) '' s))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
(μ : MeasureTheory.Measure E)
(s : Set ↑(Metric.sphere 0 1))
(r : ↑(Set.Ioi 0))

μ (Subtype.val '' (⇑(homeomorphUnitSphereProd E) ⁻¹' s ×ˢ Set.Iio r)) = μ (Set.Ioo 0 ↑r • Subtype.val '' s)


theorem DifferentiableOn.finset_prod (hd : ∀ i ∈ u, DifferentiableOn 𝕜 (f i) s) :
    DifferentiableOn 𝕜 (∏ i ∈ u, f i ·) s

{f : ι → 𝕜 → 𝔸'}

DifferentiableOn 𝕜 (fun x => ∏ i ∈ u, f i x) s


@[to_additive (attr := simp)]
theorem ofList_join (xs : List (List α)) : ofList xs.join = (xs.map ofList).prod

FreeAddMonoid.ofList xs.join = (List.map (⇑FreeAddMonoid.ofList) xs).sum


theorem not_and_of_not_right (a : Prop) {b : Prop} : ¬b → ¬(a ∧ b)


@[to_additive]
theorem div_ae_eq_one {β} [Group β] (f g : α → β) : f / g =ᵐ[μ] 1 ↔ f =ᵐ[μ] g

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type u_7}
[Group β]
(f g : α → β)


@[simp]
theorem str_incl (X : Compactum) (x : X) : X.str (X.incl x) = x


/-- Note this is more general for matrices than `isSelfAdjoint_one` as it does not
require `Fintype n`, which is necessary for `Monoid (Matrix n n R)`. -/
@[simp]
theorem isHermitian_one [DecidableEq n] : (1 : Matrix n n α).IsHermitian

{α : Type u_1}
{n : Type u_4}
[Semiring α]
[StarRing α]
[DecidableEq n]


theorem hadamard_one : M ⊙ (1 : Matrix n n α) = diagonal fun i => M i i

{α : Type u_1}
{n : Type u_5}
[DecidableEq n]
[MulZeroOneClass α]
(M : Matrix n n α)

M.hadamard 1 = Matrix.diagonal fun i => M i i


@[simp, norm_cast] lemma coe_nnqsmul (q : ℚ≥0) (a : {x : α // 0 ≤ x}) :
    ↑(q • a) = (q • a : α)

{α : Type u_1}
[LinearOrderedSemifield α]
(q : ℚ≥0)
(a : { x // 0 ≤ x })


theorem single_comp_single {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (r s : R) :
    (single f r ≫ single g s : Free.of R X ⟶ Free.of R Z) = single (f ≫ g) (r * s)

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

Finsupp.single f r ≫ Finsupp.single g s = Finsupp.single (f ≫ g) (r * s)


/-- To prove something about Laurent polynomials, it suffices to show that
* the condition is closed under taking sums, and
* it holds for monomials.
-/
@[elab_as_elim]
protected theorem induction_on' {M : R[T;T⁻¹] → Prop} (p : R[T;T⁻¹])
    (h_add : ∀ p q, M p → M q → M (p + q)) (h_C_mul_T : ∀ (n : ℤ) (a : R), M (C a * T n)) :
    M p

(h_add : ∀ (p q : R[T;T⁻¹]), M p → M q → M (p + q))

(h_C_mul_T : ∀ (n : ℤ) (a : R), M (LaurentPolynomial.C a * LaurentPolynomial.T n))


lemma Nontrivial.exists_cons_eq {s : Finset α} (hs : s.Nontrivial) :
    ∃ t a ha b hb hab, (cons b t hb).cons a (mem_cons.not.2 <| not_or_intro hab ha) = s

{α : Type u_1}
{s : Finset α}
(hs : s.Nontrivial)

∃ t a, ∃ (ha : a ∉ t), ∃ b, ∃ (hb : b ∉ t) (hab : ¬a = b), Finset.cons a (Finset.cons b t hb) ⋯ = s


@[to_additive dist_norm_norm_le]
theorem dist_norm_norm_le' (a b : E) : dist ‖a‖ ‖b‖ ≤ ‖a / b‖

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


theorem HasFDerivWithinAt.eventually_ne (h : HasFDerivWithinAt f f' s x)
    (hf' : ∃ C, ∀ z, ‖z‖ ≤ C * ‖f' z‖) : ∀ᶠ z in 𝓝[s \ {x}] x, f z ≠ f x

(hf' : ∃ C, ∀ (z : E), ‖z‖ ≤ C * ‖f' z‖)


@[simp]
theorem coe_id : ⇑(NonUnitalStarAlgHom.id R A) = id

(R : Type u_1)
(A : Type u_2)
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]


theorem mapsTo_image (h : Semiconj f fa fb) (ha : MapsTo fa s t) : MapsTo fb (f '' s) (f '' t)

{α : Type u_1}
{β : Type u_2}
{fa : α → α}
{fb : β → β}
{f : α → β}
{s t : Set α}
(h : Function.Semiconj f fa fb)
(ha : Set.MapsTo fa s t)


theorem posPart_toSimpleFunc (f : α →₁ₛ[μ] ℝ) :
    toSimpleFunc (posPart f) =ᵐ[μ] (toSimpleFunc f).posPart

(f : ↥(MeasureTheory.Lp.simpleFunc ℝ 1 μ))

↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc (MeasureTheory.L1.SimpleFunc.posPart f)) =ᵐ[μ]
  ↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc f).posPart


/-- If `J` and `K` are equivalent, then if `J` is connected then `K` is as well. -/
theorem isConnected_of_equivalent {K : Type u₂} [Category.{v₂} K] (e : J ≌ K) [IsConnected J] :
    IsConnected K

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
(e : J ≌ K)
[CategoryTheory.IsConnected J]


@[simp]
theorem preimage_Iio {a : α} : (Nat.cast : ℕ → α) ⁻¹' Set.Iio a = Set.Iio ⌈a⌉₊

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}


theorem rootSpaceProduct_tmul
    (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ₂ = χ₃) (x : rootSpace H χ₁) (y : rootSpace H χ₂) :
    (rootSpaceProduct R L H χ₁ χ₂ χ₃ hχ (x ⊗ₜ y) : L) = ⁅(x : L), (y : L)⁆

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(H : LieSubalgebra R L)
[LieAlgebra.IsNilpotent R ↥H]
(χ₁ χ₂ χ₃ : ↥H → R)
(hχ : χ₁ + χ₂ = χ₃)
(x : ↥(LieAlgebra.rootSpace H χ₁))
(y : ↥(LieAlgebra.rootSpace H χ₂))

↑((LieAlgebra.rootSpaceProduct R L H χ₁ χ₂ χ₃ hχ) (x ⊗ₜ[R] y)) = ⁅↑x, ↑y⁆


theorem span_prod_le (s : Set M) (t : Set M') : span R (s ×ˢ t) ≤ prod (span R s) (span R t)

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_9}
[AddCommMonoid M']
[Module R M']
(s : Set M)
(t : Set M')

Submodule.span R (s ×ˢ t) ≤ (Submodule.span R s).prod (Submodule.span R t)


theorem neg_strictAnti : StrictAnti (- · : EReal → EReal)


theorem ack_mono_left (n : ℕ) : Monotone fun m => ack m n


theorem closure_subtype {x : { a // p a }} {s : Set { a // p a }} :
    x ∈ closure s ↔ (x : X) ∈ closure (((↑) : _ → X) '' s)

{X : Type u}
[TopologicalSpace X]
{p : X → Prop}
{x : { a // p a }}
{s : Set { a // p a }}

x ∈ closure s ↔ ↑x ∈ closure (Subtype.val '' s)


theorem isConnected_singleton {x} : IsConnected ({x} : Set α)

{α : Type u}
[TopologicalSpace α]
{x : α}


theorem compl_mem_comap : sᶜ ∈ comap f l ↔ (f '' s)ᶜ ∈ l

{α : Type u}
{β : Type v}
{f : α → β}
{l : Filter β}
{s : Set α}


theorem ext_iff {x y : TruncatedWittVector p n R} : x = y ↔ ∀ i, x.coeff i = y.coeff i

{p n : ℕ}
{R : Type u_1}
{x y : TruncatedWittVector p n R}

x = y ↔ ∀ (i : Fin n), TruncatedWittVector.coeff i x = TruncatedWittVector.coeff i y


@[measurability]
theorem measurable_nnnorm : Measurable (nnnorm : α → ℝ≥0)

{α : Type u_1}
[MeasurableSpace α]
[NormedAddCommGroup α]
[OpensMeasurableSpace α]


@[simp]
theorem toDeleteEdges_cons (s : Set (Sym2 V)) {u v w : V} (h : G.Adj u v) (p : G.Walk v w) (hp) :
    (Walk.cons h p).toDeleteEdges s hp =
      Walk.cons (deleteEdges_adj.mpr ⟨h, hp _ (List.Mem.head _)⟩)
        (p.toDeleteEdges s fun _ he => hp _ <| List.Mem.tail _ he)

(hp : ∀ e ∈ (SimpleGraph.Walk.cons h p).edges, e ∉ s)

SimpleGraph.Walk.toDeleteEdges s (SimpleGraph.Walk.cons h p) hp =
  SimpleGraph.Walk.cons ⋯ (SimpleGraph.Walk.toDeleteEdges s p ⋯)


theorem cof_type (r : α → α → Prop) [IsWellOrder α r] : (type r).cof = StrictOrder.cof r

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

(Ordinal.type r).cof = StrictOrder.cof r


theorem edgeDensity_comm (hr : Symmetric r) (s t : Finset α) :
    edgeDensity r s t = edgeDensity r t s

{α : Type u_4}
{r : α → α → Prop}
[DecidableRel r]
(hr : Symmetric r)
(s t : Finset α)

Rel.edgeDensity r s t = Rel.edgeDensity r t s


theorem fst_prod_mk {α α' β β' : TypeVec n} (f : α ⟹ β) (g : α' ⟹ β') :
    TypeVec.prod.fst ⊚ (f ⊗' g) = f ⊚ TypeVec.prod.fst

{n : ℕ}
{α α' β β' : TypeVec.{u_1} n}
(f : α.Arrow β)
(g : α'.Arrow β')

TypeVec.comp TypeVec.prod.fst (TypeVec.prod.map f g) = TypeVec.comp f TypeVec.prod.fst


lemma autAdjoinRootXPowSubCEquiv_symm_smul (σ) :
    ((autAdjoinRootXPowSubCEquiv hζ hn H).symm σ : Kˣ) • (root _ : K[n√a]) = σ (root _)

(H : Irreducible (Polynomial.X ^ n - Polynomial.C a))

↑((autAdjoinRootXPowSubCEquiv hζ hn H).symm σ) • AdjoinRoot.root (Polynomial.X ^ n - Polynomial.C a) =
  σ (AdjoinRoot.root (Polynomial.X ^ n - Polynomial.C a))


theorem X_pow_sub_C_irreducible_iff_of_prime_pow
    {p : ℕ} (hp : p.Prime) (hp' : p ≠ 2) {n} (hn : n ≠ 0) {a : K} :
    Irreducible (X ^ p ^ n - C a) ↔ ∀ b, b ^ p ≠ a

{K : Type u}
[Field K]
{p : ℕ}
(hp : Nat.Prime p)
(hp' : p ≠ 2)
{n : ℕ}
(hn : n ≠ 0)
{a : K}

Irreducible (Polynomial.X ^ p ^ n - Polynomial.C a) ↔ ∀ (b : K), b ^ p ≠ a


/-- To construct an isomorphism of costructured arrows,
we need an isomorphism of the objects underlying the source,
and to check that the triangle commutes.
-/
@[simps!]
def isoMk {f f' : CostructuredArrow S T} (g : f.left ≅ f'.left)
    (w : S.map g.hom ≫ f'.hom = f.hom := by aesop_cat) : f ≅ f'

{f f' : CategoryTheory.CostructuredArrow S T}

(w : CategoryTheory.CategoryStruct.comp (S.map g.hom) f'.hom = f.hom := by aesop_cat)


theorem symm_trans (e₁ : R ≃+* S) (e₂ : S ≃+* S') : (e₁.trans e₂).symm = e₂.symm.trans e₁.symm

{R : Type u_4}
{S : Type u_5}
{S' : Type u_6}
[Mul R]
[Mul S]
[Add R]
[Add S]
[Mul S']
[Add S']
(e₁ : R ≃+* S)
(e₂ : S ≃+* S')


@[reassoc (attr := simp)]
lemma liftCochain_v_snd_v (p₁ p₂ : ℤ) (h₁₂ : p₁ + n = p₂) :
    (liftCochain φ α β h).v p₁ p₂ h₁₂ ≫ (snd φ).v p₂ p₂ (add_zero p₂) = β.v p₁ p₂ h₁₂

(α : CochainComplex.HomComplex.Cochain K F m)

(β : CochainComplex.HomComplex.Cochain K G n)

(CochainComplex.mappingCone.liftCochain φ α β h).v p₁ p₂ h₁₂ ≫ (CochainComplex.mappingCone.snd φ).v p₂ p₂ ⋯ =
  β.v p₁ p₂ h₁₂


/-- We have that `η ^ 2 = -η - 1`. -/
lemma eta_sq : (η ^ 2 : 𝓞 K) = - η - 1

{K : Type u_1}
[Field K]
{ζ : K}
(hζ : IsPrimitiveRoot ζ ↑3)


@[simp]
theorem map_map (γ : Path x y) {Z : Type*} [TopologicalSpace Z]
    {f : X → Y} (hf : Continuous f) {g : Y → Z} (hg : Continuous g) :
    (γ.map hf).map hg = γ.map (hg.comp hf)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{x y : X}
(γ : Path x y)
{Z : Type u_4}
[TopologicalSpace Z]
{f : X → Y}
(hf : Continuous f)
{g : Y → Z}
(hg : Continuous g)


theorem Complex.integral_exp_neg_rpow {p : ℝ} (hp : 1 ≤ p) :
    ∫ x : ℂ, rexp (- ‖x‖ ^ p) = π * Real.Gamma (2 / p + 1)

∫ (x : ℂ), rexp (-‖x‖ ^ p) = π * Real.Gamma (2 / p + 1)


theorem rel_iff_exists_classes (r : Setoid α) {x y} : r.Rel x y ↔ ∃ c ∈ r.classes, x ∈ c ∧ y ∈ c


theorem zpow_pos (ha : a ≠ 0) (h'a : a ≠ ∞) (n : ℤ) : 0 < a ^ n

{a : ENNReal}
(ha : a ≠ 0)
(h'a : a ≠ ⊤)
(n : ℤ)


/-- If a function defined on a topological group has a support contained in a
compact set, then either the function is trivial or the group is locally compact. -/
@[to_additive
      "If a function defined on a topological additive group has a support contained in a compact
      set, then either the function is trivial or the group is locally compact."]
theorem eq_zero_or_locallyCompactSpace_of_support_subset_isCompact_of_group
    [TopologicalSpace α] [Zero α] [T1Space α]
    {f : G → α} {k : Set G} (hk : IsCompact k) (hf : support f ⊆ k) (h'f : Continuous f) :
    f = 0 ∨ LocallyCompactSpace G

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[TopologicalSpace α]
[Zero α]
[T1Space α]
{f : G → α}
{k : Set G}
(hk : IsCompact k)
(hf : Function.support f ⊆ k)
(h'f : Continuous f)


theorem neighborFinset_disjoint_singleton : Disjoint (G.neighborFinset v) {v}

{V : Type u_1}
(G : SimpleGraph V)
(v : V)
[Fintype ↑(G.neighborSet v)]


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

{α : Type u_1}
[TopologicalSpace α]
(s : TopologicalSpace.Compacts α)
(h : IsOpen s.carrier)


theorem Subtype.preconnectedSpace {s : Set α} (h : IsPreconnected s) : PreconnectedSpace s

{α : Type u}
[TopologicalSpace α]
{s : Set α}
(h : IsPreconnected s)


theorem preimage_iInter₂ {f : α → β} {s : ∀ i, κ i → Set β} :
    (f ⁻¹' ⋂ (i) (j), s i j) = ⋂ (i) (j), f ⁻¹' s i j

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{f : α → β}
{s : (i : ι) → κ i → Set β}

f ⁻¹' ⋂ i, ⋂ j, s i j = ⋂ i, ⋂ j, f ⁻¹' s i j


/-- These are actually equal, of course, but not definitionally equal
  (the equality requires F.map (𝟙 _) = 𝟙 _). A natural isomorphism is
  more convenient than an equality between functors (compare id_to_iso). -/
@[simps]
def constComp (X : C) (F : C ⥤ D) : (const J).obj X ⋙ F ≅ (const J).obj (F.obj X)

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

∀ (x : J),
  (CategoryTheory.Functor.constComp J X F).inv.app x = 𝟙 (((CategoryTheory.Functor.const J).obj (F.obj X)).obj x)


@[simp] lemma mem_sigma : ∀ {p : Σa, σ a}, p ∈ @Multiset.sigma α σ s t ↔ p.1 ∈ s ∧ p.2 ∈ t p.1

{α : Type u_1}
{σ : α → Type u_4}
{s : Multiset α}
{t : (a : α) → Multiset (σ a)}
{p : (a : α) × σ a}

p ∈ s.sigma t ↔ p.fst ∈ s ∧ p.snd ∈ t p.fst


@[to_additive norm_zsmul_le]
theorem norm_zpow_le_mul_norm (n : ℤ) (a : α) : ‖a ^ n‖ ≤ ‖n‖ * ‖a‖

{α : Type u_1}
[SeminormedCommGroup α]
(n : ℤ)
(a : α)

‖a ^ n‖ ≤ ‖n‖ * ‖a‖


theorem comap_bot_of_injective (hf : Function.Injective f) : Ideal.comap f ⊥ = ⊥

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
(hf : Function.Injective ⇑f)


theorem inner_map_map_of_mem_unitary {u : H →L[𝕜] H} (hu : u ∈ unitary (H →L[𝕜] H)) (x y : H) :
    ⟪u x, u y⟫_𝕜 = ⟪x, y⟫_𝕜

{𝕜 : Type u_1}
[RCLike 𝕜]
{H : Type u_5}
[NormedAddCommGroup H]
[InnerProductSpace 𝕜 H]
[CompleteSpace H]
{u : H →L[𝕜] H}
(hu : u ∈ unitary (H →L[𝕜] H))
(x y : H)


@[simp]
theorem cmp_eq_lt_iff : cmp x y = Ordering.lt ↔ x < y

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


/-- Given `X : D` and `F : C ⥤ D`, to upgrade a functor `G : E ⥤ C` to a functor
    `E ⥤ StructuredArrow X F`, it suffices to provide maps `X ⟶ F.obj (G.obj Y)` for all `Y` making
    the obvious triangles involving all `F.map (G.map g)` commute.

    This is of course the same as providing a cone over `F ⋙ G` with cone point `X`, see
    `Functor.toStructuredArrowIsoToStructuredArrow`. -/
@[simps]
def toStructuredArrow (G : E ⥤ C) (X : D) (F : C ⥤ D) (f : (Y : E) → X ⟶ F.obj (G.obj Y))
    (h : ∀ {Y Z : E} (g : Y ⟶ Z), f Y ≫ F.map (G.map g) = f Z) : E ⥤ StructuredArrow X F

(h : ∀ {Y Z : E} (g : Y ⟶ Z), CategoryTheory.CategoryStruct.comp (f Y) (F.map (G.map g)) = f Z)

(G.toStructuredArrow X F f h).obj Y = CategoryTheory.StructuredArrow.mk (f Y)


theorem eq_iff_not_lt_of_le [PartialOrder α] {x y : α} : x ≤ y → y = x ↔ ¬x < y

{α : Type u_2}
[PartialOrder α]
{x y : α}


/-- The scalar multiplication on `ModuleCat R` considered as a morphism of rings
to the endomorphisms of the forgetful functor to `AddCommGrp)`. -/
@[simps]
def smulNatTrans : R →+* End (forget₂ (ModuleCat R) AddCommGrp)

(R : Type u)
[Ring R]
(r : R)
(M : ModuleCat R)

((ModuleCat.smulNatTrans R) r).app M = M.smul r


theorem isLittleO_norm_pow_norm_pow {m n : ℕ} (h : m < n) :
    (fun x : E' => ‖x‖ ^ n) =o[𝓝 0] fun x => ‖x‖ ^ m

{E' : Type u_6}
[SeminormedAddCommGroup E']
{m n : ℕ}
(h : m < n)

(fun x => ‖x‖ ^ n) =o[𝓝 0] fun x => ‖x‖ ^ m


@[to_additive (attr := simp)]
theorem inter_inv : (s ∩ t)⁻¹ = s⁻¹ ∩ t⁻¹


@[to_additive]
theorem HasProd.hasProd_of_prod_eq {g : γ → α}
    (h_eq : ∀ u : Finset γ, ∃ v : Finset β, ∀ v', v ⊆ v' →
      ∃ u', u ⊆ u' ∧ ∏ x ∈ u', g x = ∏ b ∈ v', f b)
    (hf : HasProd g a) : HasProd f a

(h_eq : ∀ (u : Finset γ), ∃ v, ∀ (v' : Finset β), v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x ∈ u', g x = ∏ b ∈ v', f b)


lemma preimage_insertNth_Icc_of_not_mem {i : Fin (n + 1)} {x : α i} {q₁ q₂ : ∀ j, α j}
    (hx : x ∉ Icc (q₁ i) (q₂ i)) : i.insertNth x ⁻¹' Icc q₁ q₂ = ∅

{n : ℕ}
{α : Fin (n + 1) → Type u_1}
[(i : Fin (n + 1)) → Preorder (α i)]
{i : Fin (n + 1)}
{x : α i}
{q₁ q₂ : (j : Fin (n + 1)) → α j}
(hx : x ∉ Set.Icc (q₁ i) (q₂ i))


@[to_additive (attr := simp)]
theorem lift_apply_inl (f : M →* P) (g : N →* P) (x : M) : lift f g (inl x) = f x

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

(AddMonoid.Coprod.lift f g) (AddMonoid.Coprod.inl x) = f x


@[simp]
theorem sdiff_le_iff : a \ b ≤ c ↔ a ≤ b ⊔ c

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b c : α}


/-- (Impl) This new cocone is used to construct the coalgebra structure -/
@[simps! ι_app]
def newCocone : Cocone (D ⋙ forget T)

(D : CategoryTheory.Functor J T.Coalgebra)

(c : CategoryTheory.Limits.Cocone (D.comp T.forget))

(CategoryTheory.Comonad.ForgetCreatesColimits'.newCocone D c).ι.app X =
  CategoryTheory.CategoryStruct.comp (D.obj X).a (T.map (c.ι.app X))


lemma isConj_one_iff : IsConj φ (1 : K ≃ₐ[k] K) ↔ IsReal φ

{K : Type u_1}
[Field K]
{k : Type u_2}
[Field k]
[Algebra k K]
{φ : K →+* ℂ}

NumberField.ComplexEmbedding.IsConj φ 1 ↔ NumberField.ComplexEmbedding.IsReal φ


theorem bit_one (b : Bool) : (b :: zero (Not b)) = msb b

SNum.bit b (SNum.zero (decide ¬b = true)) = SNum.nz (NzsNum.msb b)


@[reassoc]
theorem whisker_assoc_symm (X : C) {Y Y' : C} (f : Y ⟶ Y') (Z : C) :
    X ◁ f ▷ Z = (α_ X Y Z).inv ≫ (X ◁ f) ▷ Z ≫ (α_ X Y' Z).hom

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

CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.MonoidalCategory.whiskerRight f Z) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.whiskerLeft X f) Z)
      (CategoryTheory.MonoidalCategory.associator X Y' Z).hom)


lemma opcycles_ext_iff {A : C} (f₁ f₂ : S.opcycles ⟶ A) :
    f₁ = f₂ ↔ S.pOpcycles ≫ f₁ = S.pOpcycles ≫ f₂

f₁ = f₂ ↔ CategoryTheory.CategoryStruct.comp S.pOpcycles f₁ = CategoryTheory.CategoryStruct.comp S.pOpcycles f₂


theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]]) :
    ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1)


theorem sigma_support : l.support = l.splitSupport.sigma fun i => (l.split i).support

{ι : Type u_4}
{M : Type u_5}
{αs : ι → Type u_13}
[Zero M]
(l : (i : ι) × αs i →₀ M)


@[simp]
theorem coeIdeal_le_coeIdeal (K : Type*) [CommRing K] [Algebra R K] [IsFractionRing R K]
    {I J : Ideal R} : (I : FractionalIdeal R⁰ K) ≤ J ↔ I ≤ J

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

↑I ≤ ↑J ↔ I ≤ J


{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(φ : MvPowerSeries σ R)


/-- `rpow` as a `MonoidHom`-/
@[simps]
def rpowMonoidHom (r : ℝ) : ℝ≥0 →* ℝ≥0

∀ (x : ℝ≥0), (NNReal.rpowMonoidHom r) x = x ^ r


/-- The linear map corresponding to `affineCombination` is
`weightedVSub`. -/
@[simp]
theorem affineCombination_linear (p : ι → P) :
    (s.affineCombination k p).linear = s.weightedVSub p

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(p : ι → P)

(Finset.affineCombination k s p).linear = s.weightedVSub p


/-- The cardinality of the interval [a, b]. -/
theorem mk_Icc_real {a b : ℝ} (h : a < b) : #(Icc a b) = 𝔠


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


protected theorem continuous_const_mul {a : ℝ≥0∞} (ha : a ≠ ∞) : Continuous (a * ·)


@[to_additive (attr := simp)]
lemma ofHom_apply {X Y : Type u} [CommMonoid X] [CommMonoid Y] (f : X →* Y) (x : X) :
    (ofHom f) x = f x


/-- The cokernel of `biproduct.fromSubtype f p` is `⨁ Subtype.restrict pᶜ f`. -/
@[simps!]
def cokernelBiproductFromSubtypeIso (p : Set K) :
    cokernel (biproduct.fromSubtype f p) ≅ ⨁ Subtype.restrict pᶜ f

(CategoryTheory.Limits.cokernelBiproductFromSubtypeIso f p).inv =
  (CategoryTheory.Limits.CokernelCofork.IsColimit.ofπ (CategoryTheory.Limits.biproduct.toSubtype f pᶜ) ⋯
        (fun {W} g x => CategoryTheory.Limits.biproduct.fromSubtype f pᶜ ≫ g) ⋯ ⋯).desc
    (CategoryTheory.Limits.colimit.cocone
      (CategoryTheory.Limits.parallelPair (CategoryTheory.Limits.biproduct.fromSubtype f p) 0))


/-- Note that the below inequality can be strict. For example the ideal of strictly-upper-triangular
2x2 matrices inside the Lie algebra of upper-triangular 2x2 matrices with `k = 1`. -/
-- Porting note: added `LieSubmodule.toSubmodule` in the statement
theorem LieModule.coe_lowerCentralSeries_ideal_le {I : LieIdeal R L} (k : ℕ) :
    LieSubmodule.toSubmodule (lowerCentralSeries R I I k) ≤ lowerCentralSeries R L I k

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{I : LieIdeal R L}
(k : ℕ)

↑(LieModule.lowerCentralSeries R (↥↑I) (↥↑I) k) ≤ ↑(LieModule.lowerCentralSeries R L (↥↑I) k)


theorem _root_.AlternatingMap.measure_parallelepiped (ω : G [⋀^Fin n]→ₗ[ℝ] ℝ)
    (v : Fin n → G) : ω.measure (parallelepiped v) = ENNReal.ofReal |ω v|

[_i : Fact (FiniteDimensional.finrank ℝ G = n)]


theorem nhds_nhdsAdjoint_of_ne {a b : α} (f : Filter α) (h : b ≠ a) :
    @nhds α (nhdsAdjoint a f) b = pure b

{α : Type u}
{a b : α}
(f : Filter α)
(h : b ≠ a)


/-- The `MonoidHom` from the preimage of a subgroup to itself. -/
@[to_additive (attr := simps!) "the `AddMonoidHom` from the preimage of an
additive subgroup to itself."]
def subgroupComap (f : G →* G') (H' : Subgroup G') : H'.comap f →* H'

(x : ↥(Submonoid.comap f H'.toSubmonoid))


@[simp]
theorem inf_toNonUnitalSubalgebra (S T : NonUnitalStarSubalgebra R A) :
    (S ⊓ T).toNonUnitalSubalgebra = S.toNonUnitalSubalgebra ⊓ T.toNonUnitalSubalgebra

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
(S T : NonUnitalStarSubalgebra R A)


@[to_additive] lemma prod_reverse (l : List M) : prod l.reverse = prod l

{M : Type u_4}
[AddCommMonoid M]
(l : List M)


@[simp] theorem coe_clamp (n m : Nat) : (clamp n m : Nat) = min n m


theorem preimage_closure (e : M₁ ≃SL[σ₁₂] M₂) (s : Set M₂) : e ⁻¹' closure s = closure (e ⁻¹' s)

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


@[simp]
theorem cancel_counitInv_right_assoc {W X X' Y : D} (f : W ⟶ X) (g : X ⟶ Y) (f' : W ⟶ X')
    (g' : X' ⟶ Y) : f ≫ g ≫ e.counitInv.app Y = f' ≫ g' ≫ e.counitInv.app Y ↔ f ≫ g = f' ≫ g'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)
{W X X' Y : D}
(f : W ⟶ X)
(g : X ⟶ Y)
(f' : W ⟶ X')
(g' : X' ⟶ Y)

CategoryTheory.CategoryStruct.comp f (CategoryTheory.CategoryStruct.comp g (e.counitInv.app Y)) =
    CategoryTheory.CategoryStruct.comp f' (CategoryTheory.CategoryStruct.comp g' (e.counitInv.app Y)) ↔
  CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.comp f' g'


theorem leadingCoeff_sub_of_degree_lt (h : Polynomial.degree q < Polynomial.degree p) :
    (p - q).leadingCoeff = p.leadingCoeff

{R : Type u}
[Ring R]
{p q : R[X]}
(h : q.degree < p.degree)


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

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


@[simp]
theorem max_eq_left_iff : max a b = a ↔ b ≤ a


theorem Summable.matrix_diag {f : X → Matrix n n R} (hf : Summable f) :
    Summable fun x => diag (f x)

{X : Type u_1}
{n : Type u_5}
{R : Type u_8}
[AddCommMonoid R]
[TopologicalSpace R]
{f : X → Matrix n n R}
(hf : Summable f)


theorem Convex.mem_smul_of_zero_mem (h : Convex 𝕜 s) {x : E} (zero_mem : (0 : E) ∈ s) (hx : x ∈ s)
    {t : 𝕜} (ht : 1 ≤ t) : x ∈ t • s

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(h : Convex 𝕜 s)
{x : E}
(zero_mem : 0 ∈ s)
(hx : x ∈ s)
{t : 𝕜}
(ht : 1 ≤ t)


theorem fderivWithin_eq_fderiv (hs : UniqueDiffWithinAt 𝕜 s x) (h : DifferentiableAt 𝕜 f x) :
    fderivWithin 𝕜 f s 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}
{s : Set E}
(hs : UniqueDiffWithinAt 𝕜 s x)
(h : DifferentiableAt 𝕜 f x)


@[simp]
theorem isNilpotent_range_toEnd_iff :
    IsNilpotent R (toEnd R L M).range M ↔ IsNilpotent R L M

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]

LieModule.IsNilpotent R (↥(LieModule.toEnd R L M).range) M ↔ LieModule.IsNilpotent R L M


@[to_additive]
theorem card_dvd_exponent_pow_rank' {n : ℕ} (hG : ∀ g : G, g ^ n = 1) :
    Nat.card G ∣ n ^ Group.rank G

(G : Type u_1)
[AddCommGroup G]
[AddGroup.FG G]
{n : ℕ}
(hG : ∀ (g : G), n • g = 0)


theorem iInf_principal_finite {ι : Type w} {s : Set ι} (hs : s.Finite) (f : ι → Set α) :
    ⨅ i ∈ s, 𝓟 (f i) = 𝓟 (⋂ i ∈ s, f i)

{α : Type u}
{ι : Type w}
{s : Set ι}
(hs : s.Finite)
(f : ι → Set α)


theorem orthonormal_span {ι : Type*} {v : ι → E} (hv : Orthonormal 𝕜 v) :
    @Orthonormal 𝕜 (Submodule.span 𝕜 (Set.range v)) _ _ _ ι fun i : ι =>
      ⟨v i, Submodule.subset_span (Set.mem_range_self i)⟩

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{v : ι → E}
(hv : Orthonormal 𝕜 v)


@[ext]
theorem ext {P Q : Karoubi C} (h_X : P.X = Q.X) (h_p : P.p ≫ eqToHom h_X = eqToHom h_X ≫ Q.p) :
    P = Q

{P Q : CategoryTheory.Idempotents.Karoubi C}

(h_p :
  CategoryTheory.CategoryStruct.comp P.p (CategoryTheory.eqToHom h_X) =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom h_X) Q.p)


private theorem nsmul_zero' (x : LocalizedModule S M) : (0 : ℕ) • x = 0

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(x : LocalizedModule S M)


theorem card_le_card_biUnion_add_card_fiber {s : Finset ι} {f : ι → Finset α}
    (hs : (s : Set ι).PairwiseDisjoint f) :
    s.card ≤ (s.biUnion f).card + (s.filter fun i ↦ f i = ∅).card

{ι : Type u_1}
{α : Type u_2}
[DecidableEq α]
{s : Finset ι}
{f : ι → Finset α}
(hs : (↑s).PairwiseDisjoint f)

s.card ≤ (s.biUnion f).card + (Finset.filter (fun i => f i = ∅) s).card


theorem monotone_setOf [Preorder α] {p : α → β → Prop} (hp : ∀ b, Monotone fun a => p a b) :
    Monotone fun a => { b | p a b }

(hp : ∀ (b : β), Monotone fun a => p a b)


theorem factorization_def (n : ℕ) {p : ℕ} (pp : p.Prime) : n.factorization p = padicValNat p n


@[ext]
theorem ext (X Y : Skeleton) : X.len = Y.len → X = Y


theorem NeBot.zero_smul_nonneg (hg : g.NeBot) : 0 ≤ (0 : Filter α) • g

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


theorem map_sup_ker_eq_map : LieIdeal.map f (I ⊔ f.ker) = LieIdeal.map f I

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L →ₗ⁅R⁆ L'}
{I : LieIdeal R L}


@[simp]
theorem coeToGL_det (g : SpecialLinearGroup n R) :
    Matrix.GeneralLinearGroup.det (g : GL n R) = 1

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(g : Matrix.SpecialLinearGroup n R)


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


/-- For a quasi ergodic map, sets that are almost invariant (rather than strictly invariant) are
still either almost empty or full. -/
theorem ae_mem_or_ae_nmem₀ (hf : QuasiErgodic f μ) (hsm : NullMeasurableSet s μ)
    (hs : f ⁻¹' s =ᵐ[μ] s) :
    (∀ᵐ x ∂μ, x ∈ s) ∨ ∀ᵐ x ∂μ, x ∉ s

(hsm : MeasureTheory.NullMeasurableSet s μ)

(∀ᵐ (x : α) ∂μ, x ∈ s) ∨ ∀ᵐ (x : α) ∂μ, x ∉ s


@[to_additive]
theorem exists_pow_ne_one_of_isCyclic {G : Type*} [Group G] [Fintype G] [G_cyclic : IsCyclic G]
    {k : ℕ} (k_pos : k ≠ 0) (k_lt_card_G : k < Fintype.card G) : ∃ a : G, a ^ k ≠ 1

{G : Type u_1}
[Group G]
[Fintype G]
[G_cyclic : IsCyclic G]
{k : ℕ}
(k_pos : k ≠ 0)
(k_lt_card_G : k < Fintype.card G)


/-- General fencing theorem for continuous functions with an estimate on the derivative.
Let `f` and `B` be continuous functions on `[a, b]` such that

* `f a ≤ B a`;
* `B` has right derivative `B'` at every point of `[a, b)`;
* for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)`
  is bounded above by `B'`.

Then `f x ≤ B x` everywhere on `[a, b]`. -/
theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ → ℝ} {a b : ℝ}
    (hf : ContinuousOn f (Icc a b)) {B B' : ℝ → ℝ} (ha : f a ≤ B a) (hB : ContinuousOn B (Icc a b))
    (hB' : ∀ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x)
    -- `bound` actually says `liminf (f z - f x) / (z - x) ≤ B' x`
    (bound : ∀ x ∈ Ico a b, ∀ r, B' x < r → ∃ᶠ z in 𝓝[>] x, slope f x z < r) :
    ∀ ⦃x⦄, x ∈ Icc a b → f x ≤ B x

(hB' : ∀ x ∈ Set.Ico a b, HasDerivWithinAt B (B' x) (Set.Ici x) x)

(bound : ∀ x ∈ Set.Ico a b, ∀ (r : ℝ), B' x < r → ∃ᶠ (z : ℝ) in 𝓝[>] x, slope f x z < r)


theorem add_left_inj (h : a ≠ ∞) : b + a = c + a ↔ b = c


@[mono]
theorem map_mono {β} (f : α → β) : Monotone (map f)

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


theorem WithBot.sInf_eq [InfSet α] {s : Set (WithBot α)} (hs : ⊥ ∉ s)
    (hs' : BddBelow ((↑) ⁻¹' s : Set α)) : sInf s = ↑(sInf ((↑) ⁻¹' s) : α)

{α : Type u_1}
[Preorder α]
[InfSet α]
{s : Set (WithBot α)}
(hs : ⊥ ∉ s)
(hs' : BddBelow (WithBot.some ⁻¹' s))


/-- The identity monad. -/
@[simps!]
def id : Monad C

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

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


theorem mk_mul {f g : CauSeq ℚ abs} : mk (f * g) = mk f * mk g


theorem inter_iInter [Nonempty ι] (s : Set β) (t : ι → Set β) : (s ∩ ⋂ i, t i) = ⋂ i, s ∩ t i

{β : Type u_2}
{ι : Sort u_4}
[Nonempty ι]
(s : Set β)
(t : ι → Set β)


/-- Two equivalent partial homeomorphisms have the same target. -/
theorem EqOnSource.target_eq {e e' : PartialHomeomorph X Y} (h : e ≈ e') : e.target = e'.target

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e e' : PartialHomeomorph X Y}
(h : e ≈ e')


lemma sFiniteSeq_absolutelyContinuous_toFinite (μ : Measure α) [SFinite μ] (n : ℕ) :
    sFiniteSeq μ n ≪ μ.toFinite

{α : Type u_1}
{mα : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SFinite μ]
(n : ℕ)

(MeasureTheory.sFiniteSeq μ n).AbsolutelyContinuous μ.toFinite


protected theorem convex (K : Submodule 𝕜 E) : Convex 𝕜 (↑K : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(K : Submodule 𝕜 E)


/-- Sometimes rewriting with `comp_c_app` doesn't work because of dependent type issues.
In that case, `erw comp_c_app_assoc` might make progress.
The lemma `comp_c_app_assoc` is also better suited for rewrites in the opposite direction. -/
@[reassoc, simp]
theorem comp_c_app {X Y Z : PresheafedSpace C} (α : X ⟶ Y) (β : Y ⟶ Z) (U) :
    (α ≫ β).c.app U = β.c.app U ≫ α.c.app (op ((Opens.map β.base).obj (unop U)))

{X Y Z : AlgebraicGeometry.PresheafedSpace C}

(α ≫ β).c.app U = β.c.app U ≫ α.c.app (Opposite.op ((TopologicalSpace.Opens.map β.base).obj (Opposite.unop U)))


/-- A sufficient condition for injectivity of `NonUnitalSubalgebra.unitization` when the scalars
are a commutative ring. When the scalars are a field, one should use the more natural
`NonUnitalStarSubalgebra.unitization_injective` whose hypothesis is easier to verify. -/
theorem _root_.AlgHomClass.unitization_injective' {F R S A : Type*} [CommRing R] [Ring A]
    [Algebra R A] [SetLike S A] [hSA : NonUnitalSubringClass S A] [hSRA : SMulMemClass S R A]
    (s : S) (h : ∀ r, r ≠ 0 → algebraMap R A r ∉ s)
    [FunLike F (Unitization R s) A] [AlgHomClass F R (Unitization R s) A]
    (f : F) (hf : ∀ x : s, f x = x) : Function.Injective f

(h : ∀ (r : R), r ≠ 0 → (algebraMap R A) r ∉ s)


@[to_additive (attr := simp)]
theorem mul_left_iterate : (a * ·)^[n] = (a ^ n * ·)

{G : Type u_3}
[AddMonoid G]
(a : G)
(n : ℕ)

(fun x => a + x)^[n] = fun x => n • a + x


theorem log_neg_of_lt_zero (h0 : x < 0) (h1 : -1 < x) : log x < 0


/-- Intermediate stage of assembling the unit. -/
@[simps!]
def unitAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    yonedaCollectionPresheaf A (restrictedYonedaObj η) ≅ F

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

∀ (a : F.obj X), ((CategoryTheory.OverPresheafAux.unitAuxAux η).inv.app X a).fst = η.app X a


theorem universally_mono : Monotone (universally : MorphismProperty C → MorphismProperty C)

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


theorem WfDvdMonoid.max_power_factor' [CommMonoidWithZero α] [WfDvdMonoid α] {a₀ x : α}
    (h : a₀ ≠ 0) (hx : ¬IsUnit x) : ∃ (n : ℕ) (a : α), ¬x ∣ a ∧ a₀ = x ^ n * a

{α : Type u_1}
[CommMonoidWithZero α]
[WfDvdMonoid α]
{a₀ x : α}
(h : a₀ ≠ 0)
(hx : ¬IsUnit x)


theorem utf8GetAux_of_valid (cs cs' : List Char) {i p : Nat} (hp : i + utf8Len cs = p) :
    utf8GetAux (cs ++ cs') ⟨i⟩ ⟨p⟩ = cs'.headD default

(cs cs' : List Char)
{i p : Nat}
(hp : i + String.utf8Len cs = p)

String.utf8GetAux (cs ++ cs') { byteIdx := i } { byteIdx := p } = cs'.headD default


theorem ofReal_lt_ofReal_iff_of_nonneg {p q : ℝ} (hp : 0 ≤ p) :
    ENNReal.ofReal p < ENNReal.ofReal q ↔ p < q


@[to_additive] lemma pow_mul_pow_eq_one : ∀ n, a * b = 1 → a ^ n * b ^ n = 1

{M : Type u_4}
[AddMonoid M]
{a b : M}
(n : ℕ)


theorem Chain'.infix (h : Chain' R l) (h' : l₁ <:+: l) : Chain' R l₁

{α : Type u}
{R : α → α → Prop}
{l l₁ : List α}
(h : List.Chain' R l)
(h' : l₁ <:+: l)


theorem midpoint_zero_add (x y : V) : midpoint R 0 (x + y) = midpoint R x y

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


@[simp]
theorem coe_mapAlgEquiv (f : A ≃ₐ[R] B) : ⇑(mapAlgEquiv f) = map f

{R : Type u}
{A : Type z}
{B : Type u_2}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A ≃ₐ[R] B)

⇑(Polynomial.mapAlgEquiv f) = Polynomial.map ↑f


@[simp]
theorem mk_d_2_1 : (mk X₀ X₁ X₂ d₀ d₁ s succ).d 2 1 = d₁

(succ : (S : CategoryTheory.ShortComplex V) → (X₃ : V) ×' (d₂ : X₃ ⟶ S.X₁) ×' d₂ ≫ S.f = 0)

(ChainComplex.mk X₀ X₁ X₂ d₀ d₁ s succ).d 2 1 = d₁


@[reassoc (attr := simp)]
theorem equalizerSubobject_arrow :
    (equalizerSubobjectIso f g).hom ≫ equalizer.ι f g = (equalizerSubobject f g).arrow

(CategoryTheory.Limits.equalizerSubobjectIso f g).hom ≫ CategoryTheory.Limits.equalizer.ι f g =
  (CategoryTheory.Limits.equalizerSubobject f g).arrow


@[simp]
theorem getElem?_getD_replicate_default_eq (r n : ℕ) : (replicate r d)[n]?.getD d = d


theorem erase_sublist (a : α) (l : List α) : l.erase a <+ l

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


@[simp]
theorem dual_map (f : α →o β) (a : NonemptyInterval α) :
    dual (a.map f) = a.dual.map (OrderHom.dual f)

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

NonemptyInterval.dual (NonemptyInterval.map f a) = NonemptyInterval.map (OrderHom.dual f) (NonemptyInterval.dual a)


lemma FinitaryExtensive.isPullback_initial_to_sigma_ι [FinitaryExtensive C] {ι : Type*} [Finite ι]
    (X : ι → C) (i j : ι) (e : i ≠ j) :
    IsPullback (initial.to _) (initial.to _) (Sigma.ι X i) (Sigma.ι X j)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.FinitaryExtensive C]
{ι : Type u_1}
[Finite ι]
(X : ι → C)
(i j : ι)
(e : i ≠ j)

CategoryTheory.IsPullback (CategoryTheory.Limits.initial.to (X i)) (CategoryTheory.Limits.initial.to (X j))
  (CategoryTheory.Limits.Sigma.ι X i) (CategoryTheory.Limits.Sigma.ι X j)


lemma growsPolynomially_id : GrowsPolynomially (fun x => x)

AkraBazziRecurrence.GrowsPolynomially fun x => x


theorem rcomap_rcomap (r : Rel α β) (s : Rel β γ) (l : Filter γ) :
    rcomap r (rcomap s l) = rcomap (r.comp s) l

{α : Type u}
{β : Type v}
{γ : Type w}
(r : Rel α β)
(s : Rel β γ)
(l : Filter γ)

Filter.rcomap r (Filter.rcomap s l) = Filter.rcomap (r.comp s) l


@[simp]
theorem image2_vsub : (image2 VSub.vsub s t : Set α) = s -ᵥ t

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


theorem ImageMap.map_uniq {f g : Arrow C} [HasImage f.hom] [HasImage g.hom]
    {sq : f ⟶ g} (F G : ImageMap sq) : F.map = G.map

(F G : CategoryTheory.Limits.ImageMap sq)


theorem image_id (s : Set α) : id '' s = s


@[simp] lemma map_emptyOn (f : α → β) : (emptyOn α).map f (by simp) = emptyOn β

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

(Matroid.emptyOn α).map f ⋯ = Matroid.emptyOn β


theorem WithSeminorms.hasBasis (hp : WithSeminorms p) :
    (𝓝 (0 : E)).HasBasis (fun s : Set E => s ∈ p.basisSets) id

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

(𝓝 0).HasBasis (fun s => s ∈ p.basisSets) id


theorem isSt_ofSeq_iff_tendsto {f : ℕ → ℝ} {r : ℝ} :
    IsSt (ofSeq f) r ↔ Tendsto f (hyperfilter ℕ) (𝓝 r)

(Hyperreal.ofSeq f).IsSt r ↔ Filter.Tendsto f (↑(Filter.hyperfilter ℕ)) (𝓝 r)


@[simp]
theorem ramificationIdx_of_not_le (h : ¬map f p ≤ P) : ramificationIdx f p P = 0

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
{f : R →+* S}
{p : Ideal R}
{P : Ideal S}
(h : ¬Ideal.map f p ≤ P)


@[simp]
theorem Ideal.dvd_span_singleton {I : Ideal A} {x : A} : I ∣ Ideal.span {x} ↔ x ∈ I

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
{I : Ideal A}
{x : A}


theorem stoneCech_hom_ext {g₁ g₂ : StoneCech α → β} (h₁ : Continuous g₁) (h₂ : Continuous g₂)
    (h : g₁ ∘ stoneCechUnit = g₂ ∘ stoneCechUnit) : g₁ = g₂


theorem comp [FormallyEtale R A] [FormallyEtale A B] : FormallyEtale R B

(R : Type u)
[CommSemiring R]
(A : Type u)
[CommSemiring A]
[Algebra R A]
(B : Type u)
[Semiring B]
[Algebra R B]
[Algebra A B]
[IsScalarTower R A B]
[Algebra.FormallyEtale R A]
[Algebra.FormallyEtale A B]


lemma map_eq_of_iso (P : MorphismProperty C) {F G : C ⥤ D} (e : F ≅ G) :
    P.map F = P.map G

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
(P : CategoryTheory.MorphismProperty C)
{F G : C ⥤ D}
(e : F ≅ G)


lemma quotTensorEquivQuotSMul_symm_comp_mkQ (I : Ideal R) :
    (quotTensorEquivQuotSMul M I).symm ∘ₗ (I • ⊤ : Submodule R M).mkQ =
      TensorProduct.mk R (R ⧸ I) M 1

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(I : Ideal R)

↑(quotTensorEquivQuotSMul M I).symm ∘ₗ (I • ⊤).mkQ = (TensorProduct.mk R (R ⧸ I) M) 1


@[to_additive sum_le_card_nsmul]
theorem prod_le_pow_card (s : Finset ι) (f : ι → N) (n : N) (h : ∀ x ∈ s, f x ≤ n) :
    s.prod f ≤ n ^ s.card

{ι : Type u_1}
{N : Type u_5}
[OrderedAddCommMonoid N]
(s : Finset ι)
(f : ι → N)
(n : N)
(h : ∀ x ∈ s, f x ≤ n)


theorem uniformContinuous_extension₂ : UniformContinuous₂ (Completion.extension₂ f)

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


@[simp]
theorem removeNone_symm : (removeNone e).symm = removeNone e.symm

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


@[simp]
theorem iUnion_bot : (⊥ : Prepartition I).iUnion = ∅


theorem coeFn_compLp' (L : E →L[𝕜] F) (f : Lp E p μ) : L.compLp f =ᵐ[μ] fun a => L (f a)

{α : Type u_1}
{E : Type u_2}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
{𝕜 : Type u_5}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
(L : E →L[𝕜] F)
(f : ↥(MeasureTheory.Lp E p μ))


theorem sub_coeff (x y : 𝕎 R) (n : ℕ) :
    (x - y).coeff n = peval (wittSub p n) ![x.coeff, y.coeff]

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

(x - y).coeff n = WittVector.peval (WittVector.wittSub p n) ![x.coeff, y.coeff]


private theorem mul_inv_cancel_aux (a : ZMod p) (h : a ≠ 0) : a * a⁻¹ = 1

(p : ℕ)
[Fact (Nat.Prime p)]
(a : ZMod p)
(h : a ≠ 0)


theorem Ioo_succ_right_eq_insert_of_not_isMax (h₁ : a < b) (h₂ : ¬IsMax b) :
    Ioo a (succ b) = insert b (Ioo a b)

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a b : α}
(h₁ : a < b)
(h₂ : ¬IsMax b)

Set.Ioo a (Order.succ b) = insert b (Set.Ioo a b)


@[simp]
theorem sign_nonpos_iff : sign a ≤ 0 ↔ a ≤ 0

{α : Type u_1}
[Zero α]
[LinearOrder α]
{a : α}


@[simp]
theorem coe_mem {s : Finset α} (x : (s : Set α)) : ↑x ∈ s


/-- A constructor that multiplies a `NormalWord` by an element, with condition to make
sure the underlying list does get longer.  -/
@[simps!]
noncomputable def cons {i} (g : G i) (w : NormalWord d) (hmw : w.fstIdx ≠ some i)
    (hgr : g ∉ (φ i).range) : NormalWord d

{d : Monoid.PushoutI.NormalWord.Transversal φ}

(Monoid.PushoutI.NormalWord.cons g w hmw hgr).toList = ⟨i, ↑(⋯.equiv (g * (φ i) w.head)).2⟩ :: w.toList


/-- A normed division ring is a division ring endowed with a seminorm which satisfies the equality
`‖x y‖ = ‖x‖ ‖y‖`. -/
class NormedDivisionRing (α : Type*) extends Norm α, DivisionRing α, MetricSpace α where
  /-- The distance is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = norm (x - y)
  /-- The norm is multiplicative. -/
  norm_mul' : ∀ a b, norm (a * b) = norm a * norm b

{α : Type u_5}
[self : NormedDivisionRing α]
(x y : α)


/-- A family `𝓕 : ι → β → α` is uniformly equicontinuous iff `range 𝓕` is uniformly equicontinuous,
i.e the family `(↑) : range F → β → α` is uniformly equicontinuous. -/
theorem uniformEquicontinuous_iff_range {F : ι → β → α} :
    UniformEquicontinuous F ↔ UniformEquicontinuous ((↑) : range F → β → α)

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{F : ι → β → α}

UniformEquicontinuous F ↔ UniformEquicontinuous Subtype.val


/-- If a point in a topological group has a compact neighborhood, then the group is
locally compact. -/
@[to_additive]
theorem IsCompact.locallyCompactSpace_of_mem_nhds_of_group {K : Set G} (hK : IsCompact K) {x : G}
    (h : K ∈ 𝓝 x) : LocallyCompactSpace G

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{K : Set G}
(hK : IsCompact K)
{x : G}
(h : K ∈ 𝓝 x)


theorem eq_of_factors_eq_factors {a b : Associates α} (h : a.factors = b.factors) : a = b

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
{a b : Associates α}
(h : a.factors = b.factors)


/-- The head term of the gcf of `v` is `⌊v⌋`. -/
@[simp]
theorem of_h_eq_floor : (of v).h = ⌊v⌋

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
{v : K}


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


theorem norm_lt_iff {r : ℝ} (hr : 0 < r) {A : Matrix m n α} : ‖A‖ < r ↔ ∀ i j, ‖A i j‖ < r

{m : Type u_3}
{n : Type u_4}
{α : Type u_5}
[Fintype m]
[Fintype n]
[SeminormedAddCommGroup α]
{r : ℝ}
(hr : 0 < r)
{A : Matrix m n α}

‖A‖ < r ↔ ∀ (i : m) (j : n), ‖A i j‖ < r


theorem setOf_sSameSide_eq_image2 {s : AffineSubspace R P} {x p : P} (hx : x ∉ s) (hp : p ∈ s) :
    { y | s.SSameSide x y } = Set.image2 (fun (t : R) q => t • (x -ᵥ p) +ᵥ q) (Set.Ioi 0) s

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x p : P}
(hx : x ∉ s)
(hp : p ∈ s)

{y | s.SSameSide x y} = Set.image2 (fun t q => t • (x -ᵥ p) +ᵥ q) (Set.Ioi 0) ↑s


/-- Assumes left covariance.
The lemma assuming right covariance is `Right.one_lt_mul_of_le_of_lt`. -/
@[to_additive Left.add_pos_of_nonneg_of_pos
      "Assumes left covariance.
      The lemma assuming right covariance is `Right.add_pos_of_nonneg_of_pos`."]
theorem Left.one_lt_mul_of_le_of_lt [CovariantClass α α (· * ·) (· < ·)] {a b : α} (ha : 1 ≤ a)
    (hb : 1 < b) :
    1 < a * b

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


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


theorem essSup_eq [ConditionallyCompleteLinearOrder γ] [TopologicalSpace γ] [OpensMeasurableSpace γ]
    [OrderClosedTopology γ] (h : IdentDistrib f g μ ν) : essSup f μ = essSup g ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)


/-- The property of being `C^n`, initially defined in terms of the Fréchet derivative, can be
reformulated in terms of the one-dimensional derivative. -/
theorem contDiff_iff_iteratedDeriv {n : ℕ∞} : ContDiff 𝕜 n f ↔
    (∀ m : ℕ, (m : ℕ∞) ≤ n → Continuous (iteratedDeriv m f)) ∧
      ∀ m : ℕ, (m : ℕ∞) < n → Differentiable 𝕜 (iteratedDeriv m f)

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

ContDiff 𝕜 n f ↔
  (∀ (m : ℕ), ↑m ≤ n → Continuous (iteratedDeriv m f)) ∧ ∀ (m : ℕ), ↑m < n → Differentiable 𝕜 (iteratedDeriv m f)


/--
The pullback cone whose cone point is the explicit pullback.
-/
@[simps! pt π]
def pullback.cone : Limits.PullbackCone f g

{P : TopCat → Prop}
{X Y B : CompHausLike P}
(f : X ⟶ B)
(g : Y ⟶ B)
[CompHausLike.HasExplicitPullback f g]

(CompHausLike.pullback.cone f g).π =
  {
    app := fun j =>
      Option.rec (CategoryTheory.CategoryStruct.comp (CompHausLike.pullback.fst f g) f)
        (fun val =>
          CategoryTheory.Limits.WalkingPair.rec (CompHausLike.pullback.fst f g) (CompHausLike.pullback.snd f g) val)
        j,
    naturality := ⋯ }


theorem cderiv_sub (hr : 0 < r) (hf : ContinuousOn f (sphere z r))
    (hg : ContinuousOn g (sphere z r)) : cderiv r (f - g) z = cderiv r f z - cderiv r g z

(hf : ContinuousOn f (Metric.sphere z r))

(hg : ContinuousOn g (Metric.sphere z r))

Complex.cderiv r (f - g) z = Complex.cderiv r f z - Complex.cderiv r g z


/-- A `Groupoid` is a category such that all morphisms are isomorphisms. -/
class Groupoid (obj : Type u) extends Category.{v} obj : Type max u (v + 1) where
  /-- The inverse morphism -/
  inv : ∀ {X Y : obj}, (X ⟶ Y) → (Y ⟶ X)
  /-- `inv f` composed `f` is the identity -/
  inv_comp : ∀ {X Y : obj} (f : X ⟶ Y), comp (inv f) f = id Y := by aesop_cat
  /-- `f` composed with `inv f` is the identity -/
  comp_inv : ∀ {X Y : obj} (f : X ⟶ Y), comp f (inv f) = id X := by aesop_cat

{obj : Type u}
[self : CategoryTheory.Groupoid obj]
{X Y : obj}
(f : X ⟶ Y)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Groupoid.inv f) f = CategoryTheory.CategoryStruct.id Y


@[gcongr]
theorem mul_lt_mul_of_pos_left [PosMulStrictMono α] (bc : b < c) (a0 : 0 < a) : a * b < a * c

{α : Type u_1}
{a b c : α}
[Mul α]
[Zero α]
[Preorder α]
[PosMulStrictMono α]
(bc : b < c)
(a0 : 0 < a)


theorem card_eq_one_of_forall_eq {i : α} (h : ∀ j, j = i) : card α = 1

{α : Type u_1}
[Fintype α]
{i : α}
(h : ∀ (j : α), j = i)


theorem exists_frequently_lt_of_liminf_ne_top' {ι : Type*} {l : Filter ι} {x : ι → ℝ}
    (hx : liminf (fun n => (Real.nnabs (x n) : ℝ≥0∞)) l ≠ ∞) : ∃ R, ∃ᶠ n in l, R < x n

(hx : Filter.liminf (fun n => ↑(Real.nnabs (x n))) l ≠ ⊤)


protected theorem congr_fun {f g : X →ₑ[φ] Y} (h : f = g) (x : X) :
    f x = g x

{M : Type u_2}
{N : Type u_3}
{φ : M → N}
{X : Type u_5}
[SMul M X]
{Y : Type u_6}
[SMul N Y]
{f g : X →ₑ[φ] Y}
(h : f = g)
(x : X)


/-- Construct an isomorphism `F ⋙ H.inverse ≅ G` from an isomorphism `F ≅ G ⋙ H.functor`. -/
@[simps!]
def compInverseIso {H : D ≌ E} (i : F ≅ G ⋙ H.functor) : F ⋙ H.inverse ≅ G

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{F : CategoryTheory.Functor C E}
{G : CategoryTheory.Functor C D}
{H : D ≌ E}
(i : F ≅ G.comp H.functor)
(X : C)

i.compInverseIso.inv.app X =
  CategoryTheory.CategoryStruct.comp (H.unitIso.hom.app (G.obj X)) (H.inverse.map (i.inv.app X))


theorem _root_.HasCompactSupport.convolutionExistsRightOfContinuousLeft (hcg : HasCompactSupport g)
    (hf : Continuous f) (hg : LocallyIntegrable g μ) : ConvolutionExists f g L μ

(hg : MeasureTheory.LocallyIntegrable g μ)


theorem map_fst_darts_append {u v : V} (p : G.Walk u v) :
    p.darts.map (·.fst) ++ [v] = p.support

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

List.map (fun x => x.toProd.1) p.darts ++ [v] = p.support


theorem degree_of_c_eq_zero' : (toPoly ⟨0, 0, 0, d⟩).degree ≤ 0


theorem fixedPoint_unique {x} (hx : IsFixedPt f x) : x = fixedPoint f hf

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


theorem closure_subset {T : Set F} (hT : IsSubfield T) (H : S ⊆ T) : closure S ⊆ T

{F : Type u_1}
[Field F]
{S T : Set F}
(hT : IsSubfield T)
(H : S ⊆ T)


@[to_additive (attr := simp)]
theorem mul_empty (s : Finset α) : s * ∅ = ∅

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


@[simp]
theorem zero_dotProduct : 0 ⬝ᵥ v = 0

{m : Type u_2}
{α : Type v}
[Fintype m]
[NonUnitalNonAssocSemiring α]
(v : m → α)


/-- When `p ∤ a`, then `legendreSym p a = 1` iff `a` is a square mod `p`. -/
theorem eq_one_iff {a : ℤ} (ha0 : (a : ZMod p) ≠ 0) : legendreSym p a = 1 ↔ IsSquare (a : ZMod p)

(p : ℕ)
[Fact (Nat.Prime p)]
{a : ℤ}
(ha0 : ↑a ≠ 0)


theorem sigma_preimage_left {f : ι' → ι} :
    ((f ⁻¹' s).sigma fun i ↦ t (f i)) = (fun p : Σ i, α (f i) ↦ Sigma.mk _ p.2) ⁻¹' s.sigma t

{ι : Type u_1}
{ι' : Type u_2}
{α : ι → Type u_3}
{s : Set ι}
{t : (i : ι) → Set (α i)}
{f : ι' → ι}

((f ⁻¹' s).sigma fun i => t (f i)) = (fun p => ⟨f p.fst, p.snd⟩) ⁻¹' s.sigma t


theorem lastStep_nonempty :
    {i | ¬∃ b : β, p.c b ∉ p.iUnionUpTo i ∧ p.R i ≤ p.τ * p.r b}.Nonempty

{α : Type u_1}
[MetricSpace α]
{β : Type u}
[Nonempty β]
(p : Besicovitch.TauPackage β α)

{i | ¬∃ b, p.c b ∉ p.iUnionUpTo i ∧ p.R i ≤ p.τ * p.r b}.Nonempty


@[to_additive Even.nsmul'] lemma Even.isSquare_pow : Even n → ∀ a : α, IsSquare (a ^ n)


lemma ofJ_1728_of_three_eq_zero (h3 : (3 : F) = 0) :
    ofJ 1728 = @ofJ1728 _ _ (invertibleOfNonzero <| two_or_three_ne_zero.neg_resolve_right h3)

{F : Type u}
[Field F]
[DecidableEq F]
(h3 : 3 = 0)

EllipticCurve.ofJ 1728 = EllipticCurve.ofJ1728 F


@[simp]
theorem bot_sub (x : EReal) : ⊥ - x = ⊥


/-- Ring homomorphism between the function spaces `I → α` and `I → β`, induced by a ring
homomorphism `f` between `α` and `β`. -/
@[simps]
protected def RingHom.compLeft {α β : Type*} [NonAssocSemiring α] [NonAssocSemiring β]
    (f : α →+* β) (I : Type*) : (I → α) →+* I → β

{α : Type u_1}
{β : Type u_2}
[NonAssocSemiring α]
[NonAssocSemiring β]
(f : α →+* β)
(I : Type u_3)
(h : I → α)

∀ (a : I), (f.compLeft I) h a = (⇑f ∘ h) a


theorem basisOfFractionalIdeal_apply (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ)
    (i : Free.ChooseBasisIndex ℤ I) :
    basisOfFractionalIdeal K I i = fractionalIdealBasis K I.1 i

(I : (FractionalIdeal (nonZeroDivisors (NumberField.RingOfIntegers K)) K)ˣ)

(i : Module.Free.ChooseBasisIndex ℤ ↥↑↑I)

(NumberField.basisOfFractionalIdeal K I) i = ↑((NumberField.fractionalIdealBasis K ↑I) i)


/-- The **measurable Besicovitch covering theorem**. Assume that, for any `x` in a set `s`,
one is given a set of admissible closed balls centered at `x`, with arbitrarily small radii.
Then there exists a disjoint covering of almost all `s` by admissible closed balls centered at some
points of `s`.
This version requires that the underlying measure is finite, and that the space has the Besicovitch
covering property (which is satisfied for instance by normed real vector spaces). It expresses the
conclusion in a slightly awkward form (with a subset of `α × ℝ`) coming from the proof technique.
For a version assuming that the measure is sigma-finite,
see `exists_disjoint_closedBall_covering_ae_aux`.
For a version giving the conclusion in a nicer form, see `exists_disjoint_closedBall_covering_ae`.
-/
theorem exists_disjoint_closedBall_covering_ae_of_finiteMeasure_aux (μ : Measure α)
    [IsFiniteMeasure μ] (f : α → Set ℝ) (s : Set α)
    (hf : ∀ x ∈ s, ∀ δ > 0, (f x ∩ Ioo 0 δ).Nonempty) :
    ∃ t : Set (α × ℝ), t.Countable ∧ (∀ p ∈ t, p.1 ∈ s) ∧ (∀ p ∈ t, p.2 ∈ f p.1) ∧
      μ (s \ ⋃ (p : α × ℝ) (_ : p ∈ t), closedBall p.1 p.2) = 0 ∧
        t.PairwiseDisjoint fun p => closedBall p.1 p.2

(hf : ∀ x ∈ s, ∀ δ > 0, (f x ∩ Set.Ioo 0 δ).Nonempty)

∃ t,
  t.Countable ∧
    (∀ p ∈ t, p.1 ∈ s) ∧
      (∀ p ∈ t, p.2 ∈ f p.1) ∧
        μ (s \ ⋃ p ∈ t, Metric.closedBall p.1 p.2) = 0 ∧ t.PairwiseDisjoint fun p => Metric.closedBall p.1 p.2


theorem not_not_of_not_imp : ¬(a → b) → ¬¬a

¬(a → b) → ¬¬a


/-- The complex measures form a linear isomorphism to the type of pairs of signed measures. -/
@[simps]
def equivSignedMeasureₗ : ComplexMeasure α ≃ₗ[R] SignedMeasure α × SignedMeasure α

{α : Type u_1}
{m : MeasurableSpace α}
{R : Type u_3}
[Semiring R]
[Module R ℝ]
[ContinuousConstSMul R ℝ]
[ContinuousConstSMul R ℂ]

∀ (a : MeasureTheory.SignedMeasure α × MeasureTheory.SignedMeasure α),
  MeasureTheory.ComplexMeasure.equivSignedMeasureₗ.symm a = MeasureTheory.ComplexMeasure.equivSignedMeasure.invFun a


@[reassoc (attr := simp)]
lemma finiteCoproduct.ι_desc {B : CompHausLike P} (e : (a : α) → (X a ⟶ B)) (a : α) :
    finiteCoproduct.ι X a ≫ finiteCoproduct.desc X e = e a

CategoryTheory.CategoryStruct.comp (CompHausLike.finiteCoproduct.ι X a) (CompHausLike.finiteCoproduct.desc X e) = e a


lemma congr_symm_apply_of [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃+ G' i)
    (he : ∀ i j h, (e j).toAddMonoidHom.comp (f i j h) = (f' i j h).comp (e i))
    {i : ι} (g : G' i) :
    (congr e he).symm (of G' f' i g) = of G f i ((e i).symm g)

(he : ∀ (i j : ι) (h : i ≤ j), (e j).toAddMonoidHom.comp (f i j h) = (f' i j h).comp ↑(e i))

(AddCommGroup.DirectLimit.congr e he).symm ((AddCommGroup.DirectLimit.of G' f' i) g) =
  (AddCommGroup.DirectLimit.of G f i) ((e i).symm g)


/-- The power basis `1, root f, ..., root f ^ (d - 1)` for `AdjoinRoot f`,
where `f` is an irreducible polynomial over a field of degree `d`. -/
@[simps!]  -- Porting note: was `[simps]`
def powerBasis (hf : f ≠ 0) : PowerBasis K (AdjoinRoot f)

{K : Type w}
[Field K]
{f : K[X]}
(hf : f ≠ 0)

(AdjoinRoot.powerBasis hf).dim = f.natDegree


@[to_additive]
theorem finprod_mem_inter_mul_diff' (t : Set α) (h : (s ∩ mulSupport f).Finite) :
    ((∏ᶠ i ∈ s ∩ t, f i) * ∏ᶠ i ∈ s \ t, f i) = ∏ᶠ i ∈ s, f i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
{s : Set α}
(t : Set α)
(h : (s ∩ Function.support f).Finite)

∑ᶠ (i : α) (_ : i ∈ s ∩ t), f i + ∑ᶠ (i : α) (_ : i ∈ s \ t), f i = ∑ᶠ (i : α) (_ : i ∈ s), f i


lemma isSheafFor_of_factorsThru
    {X : C} {S T : Presieve X}
    (P : Cᵒᵖ ⥤ Type*)
    (H : S.FactorsThru T) (hS : S.IsSheafFor P)
    (h : ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄, T f → ∃ (R : Presieve Y),
      R.IsSeparatedFor P ∧ R.FactorsThruAlong S f) :
    T.IsSheafFor P

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

(hS : CategoryTheory.Presieve.IsSheafFor P S)

(h : ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄, T f → ∃ R, CategoryTheory.Presieve.IsSeparatedFor P R ∧ R.FactorsThruAlong S f)


/-- Homotopy between morphisms of short complexes is compatible with postcomposition. -/
@[simps]
def compRight (h : Homotopy φ₁ φ₂) (ψ : S₂ ⟶ S₃) : Homotopy (φ₁ ≫ ψ) (φ₂ ≫ ψ)

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

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

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

(h.compRight ψ).h₁ = CategoryTheory.CategoryStruct.comp h.h₁ ψ.τ₁


@[reassoc (attr := simp)]
theorem underlying_arrow {X : C} {Y Z : Subobject X} (f : Y ⟶ Z) :
    underlying.map f ≫ arrow Z = arrow Y

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.Subobject.underlying.map f) Z.arrow = Y.arrow


theorem lift_comp : (of σ ⋙q lift σ φ τ h) = φ

{V : Type u_1}
[Quiver V]
{W : Type u_2}
(σ : V → W)
{W' : Type u_3}
[Quiver W']
(φ : V ⥤q W')
(τ : W → W')
(h : ∀ (x : V), φ.obj x = τ (σ x))

Quiver.Push.of σ ⋙q Quiver.Push.lift σ φ τ h = φ


@[to_additive (attr := simp)] theorem swap_inl (x : M) : swap M N (inl x) = inr x

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

(AddMonoid.Coprod.swap M N) (AddMonoid.Coprod.inl x) = AddMonoid.Coprod.inr x


/-- The natural isomorphism comparing between
pulling back along two propositionally equal functions.
-/
@[simps]
def comapEq {β γ : Type w} {f g : β → γ} (h : f = g) : comap C f ≅ comap C g

(C : Type u)
[CategoryTheory.Category.{v, u} C]
{β γ : Type w}
{f g : β → γ}
(h : f = g)
(X : CategoryTheory.GradedObject γ C)
(b : β)

(CategoryTheory.GradedObject.comapEq C h).inv.app X b = CategoryTheory.eqToHom ⋯


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

IsAddUnit a ↔ Function.Bijective fun x => x + a


theorem id_eq_nilFun {α : TypeVec 0} : @id _ α = nilFun


@[to_additive]
theorem unop_sup (S₁ S₂ : Subgroup Gᵐᵒᵖ) : (S₁ ⊔ S₂).unop = S₁.unop ⊔ S₂.unop

{G : Type u_2}
[Group G]
(S₁ S₂ : Subgroup Gᵐᵒᵖ)


theorem lowerSemicontinuous_const : LowerSemicontinuous fun _x : α => z

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


@[to_additive (attr := simp)]
theorem lift_restrict (f : FreeMonoid α →* M) : lift (f ∘ of) = f

{α : Type u_1}
{M : Type u_4}
[Monoid M]
(f : FreeMonoid α →* M)

FreeMonoid.lift (⇑f ∘ FreeMonoid.of) = f


theorem span_gcd : Ideal.span {gcd x y} = Ideal.span {x, y}

[Submodule.IsPrincipal (Ideal.span {x, y})]

Ideal.span {IsBezout.gcd x y} = Ideal.span {x, y}


/-- A class specifying that you can lift elements from `α` to `β` assuming `cond` is true.
  Used by the tactic `lift`. -/
class CanLift (α β : Sort*) (coe : outParam <| β → α) (cond : outParam <| α → Prop) : Prop where
  /-- An element of `α` that satisfies `cond` belongs to the range of `coe`. -/
  prf : ∀ x : α, cond x → ∃ y : β, coe y = x

{α : Sort u_1}
{β : Sort u_2}
{coe : outParam (β → α)}
{cond : outParam (α → Prop)}
[self : CanLift α β coe cond]
(x : α)


@[simp]
theorem comap_exp_nhds_zero : comap exp (𝓝 0) = atBot

Filter.comap Real.exp (𝓝 0) = Filter.atBot


@[simp]
theorem mono_map_iff_mono [hF₁ : PreservesMonomorphisms F] [hF₂ : ReflectsMonomorphisms F] :
    Mono (F.map f) ↔ Mono f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
{X Y : C}
(f : X ⟶ Y)
[hF₁ : F.PreservesMonomorphisms]
[hF₂ : F.ReflectsMonomorphisms]

CategoryTheory.Mono (F.map f) ↔ CategoryTheory.Mono f


/-- As expected, the Fibonacci sequence is a solution of `fibRec`. -/
theorem fib_isSol_fibRec : fibRec.IsSolution (fun x => x.fib : ℕ → α)


@[simp, norm_cast]
lemma coe_biUnion : (s.biUnion t : Set β) = ⋃ x ∈ (s : Set α), t x

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


theorem image_coe_Ici : (some : α → WithBot α) '' Ici a = Ici (a : WithBot α)


theorem Matrix.mulVec_stdBasis [DecidableEq n] (M : Matrix m n R) (i j) :
    (M *ᵥ LinearMap.stdBasis R (fun _ ↦ R) j 1) i = M i j

{R : Type u_1}
[CommSemiring R]
{m : Type u_4}
{n : Type u_5}
[Fintype n]
[DecidableEq n]
(M : Matrix m n R)
(i : m)
(j : n)

(M *ᵥ (LinearMap.stdBasis R (fun x => R) j) 1) i = M i j


theorem measurePreserving_piUnique {π : ι → Type*} [Unique ι] {m : ∀ i, MeasurableSpace (π i)}
    (μ : ∀ i, Measure (π i)) :
    MeasurePreserving (MeasurableEquiv.piUnique π) (Measure.pi μ) (μ default)

(μ : (i : ι) → MeasureTheory.Measure (π i))

MeasureTheory.MeasurePreserving (⇑(MeasurableEquiv.piUnique π)) (MeasureTheory.Measure.pi μ) (μ default)


theorem generate_empty : Filter.generate ∅ = (⊤ : Filter α)


theorem eq {H K : Subgroup G} (hk : Commensurable H K) : commensurator H = commensurator K

{G : Type u_1}
[Group G]
{H K : Subgroup G}
(hk : Commensurable H K)

Commensurable.commensurator H = Commensurable.commensurator K


/-- Post-compose a homotopy relative to a set by a continuous function. -/
@[simps!] def compContinuousMap {f₀ f₁ : C(X, Y)} (F : f₀.HomotopyRel f₁ S) (g : C(Y, Z)) :
    (g.comp f₀).HomotopyRel (g.comp f₁) S

{X : Type u}
{Y : Type v}
{Z : Type w}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{S : Set X}
{f₀ f₁ : C(X, Y)}
(F : f₀.HomotopyRel f₁ S)
(g : C(Y, Z))
(x : ↑I × X)


@[simp]
theorem cardinal_mk_eq_lift [IsEmpty σ] : #(MvPolynomial σ R) = Cardinal.lift.{u} #R

{σ : Type u}
{R : Type v}
[CommSemiring R]
[IsEmpty σ]

#(MvPolynomial σ R) = Cardinal.lift.{u, v} #R


@[simp]
theorem attach_nil : (nil : Sym α 0).attach = nil


/-- Reducible form of `congrArg_mpr_hom_right` -/
@[simp]
theorem congrArg_cast_hom_right {X Y Z : C} (p : X ⟶ Y) (q : Z = Y) :
    cast (congrArg (fun W : C => X ⟶ W) q.symm) p = p ≫ eqToHom q.symm

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : C}
(p : X ⟶ Y)
(q : Z = Y)

cast ⋯ p = CategoryTheory.CategoryStruct.comp p (CategoryTheory.eqToHom ⋯)


protected theorem eqOn : EqOn (Prod.fst ∘ e) proj e.source

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e : Trivialization F proj)


theorem of_boundedUnder_im (hre : Tendsto re l atTop) (him_le : IsBoundedUnder (· ≤ ·) l im)
    (him_ge : IsBoundedUnder (· ≥ ·) l im) : IsExpCmpFilter l

(hre : Filter.Tendsto Complex.re l Filter.atTop)

(him_le : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l Complex.im)

(him_ge : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) l Complex.im)


theorem intrinsicClosure_subset_affineSpan : intrinsicClosure 𝕜 s ⊆ affineSpan 𝕜 s

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_5}
[Ring 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
[TopologicalSpace P]
[AddTorsor V P]
{s : Set P}

intrinsicClosure 𝕜 s ⊆ ↑(affineSpan 𝕜 s)


theorem fderiv_add_const (c : F) : fderiv 𝕜 (fun y => f y + c) 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 aeval_minpolyGen (pb : PowerBasis A S) : aeval pb.gen (minpolyGen pb) = 0

{S : Type u_2}
[Ring S]
{A : Type u_4}
[CommRing A]
[Algebra A S]
(pb : PowerBasis A S)

(Polynomial.aeval pb.gen) pb.minpolyGen = 0


/-- Coercion from a `Finsupp` to a function type is an `AddMonoidHom`. -/
@[simps]
noncomputable def coeFnAddHom : (α →₀ M) →+ α → M

{α : Type u_1}
{M : Type u_5}
[AddZeroClass M]

∀ (a : α →₀ M) (a_1 : α), Finsupp.coeFnAddHom a a_1 = a a_1


@[to_additive]
theorem Measurable.mul_iff_left {G : Type*} [MeasurableSpace G] [MeasurableSpace α] [CommGroup G]
    [MeasurableMul₂ G] [MeasurableInv G] {f g : α → G} (hf : Measurable f) :
    Measurable (g * f) ↔ Measurable g

{α : Type u_1}
{G : Type u_2}
[MeasurableSpace G]
[MeasurableSpace α]
[AddCommGroup G]
[MeasurableAdd₂ G]
[MeasurableNeg G]
{f g : α → G}
(hf : Measurable f)


/-- A characterization of the addition on the Ore localizaion, allowing for arbitrary Ore
numerator and Ore denominator. -/
theorem oreDiv_add_char {r r' : X} (s s' : S) (rb : R) (sb : S) (h : sb * s = rb * s') :
    r /ₒ s + r' /ₒ s' = (sb • r + rb • r') /ₒ (sb * s)

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[AddMonoid X]
[DistribMulAction R X]
{r r' : X}
(s s' : ↥S)
(rb : R)
(sb : ↥S)
(h : ↑sb * ↑s = rb * ↑s')


lemma conductor_one_dvd (n : ℕ) : conductor (1 : DirichletCharacter R 1) ∣ n

{R : Type u_1}
[CommMonoidWithZero R]
(n : ℕ)


lemma isCornerFree_empty : IsCornerFree (∅ : Set (G × G))


/-- If a measure `μ` admits finite spanning open sets such that the restriction of `μ` to each set
is outer regular, then the original measure is outer regular as well. -/
protected theorem FiniteSpanningSetsIn.outerRegular [OpensMeasurableSpace α] {μ : Measure α}
    (s : μ.FiniteSpanningSetsIn { U | IsOpen U ∧ OuterRegular (μ.restrict U) }) :
    OuterRegular μ

(s : μ.FiniteSpanningSetsIn {U | IsOpen U ∧ (μ.restrict U).OuterRegular})


/-- The morphism between augmented Čech nerve associated to a morphism of arrows. -/
@[simps]
def mapAugmentedCechNerve {f g : Arrow C}
    [∀ n : ℕ, HasWidePullback f.right (fun _ : Fin (n + 1) => f.left) fun _ => f.hom]
    [∀ n : ℕ, HasWidePullback g.right (fun _ : Fin (n + 1) => g.left) fun _ => g.hom] (F : f ⟶ g) :
    f.augmentedCechNerve ⟶ g.augmentedCechNerve

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

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

(CategoryTheory.Arrow.mapAugmentedCechNerve F).right = F.right


lemma isBounded_sub [Bornology R] [Sub R] [BoundedSub R] {s t : Set R}
    (hs : Bornology.IsBounded s) (ht : Bornology.IsBounded t) :
    Bornology.IsBounded (s - t)

{R : Type u_1}
[Bornology R]
[Sub R]
[BoundedSub R]
{s t : Set R}
(hs : Bornology.IsBounded s)
(ht : Bornology.IsBounded t)


theorem toMeasureOfLEZero_apply (hi : s ≤[i] 0) (hi₁ : MeasurableSet i) (hj₁ : MeasurableSet j) :
    s.toMeasureOfLEZero i hi₁ hi j = ((↑) : ℝ≥0 → ℝ≥0∞) ⟨-s (i ∩ j), neg_apply s (i ∩ j) ▸
      nonneg_of_zero_le_restrict _ (zero_le_restrict_subset _ hi₁ Set.inter_subset_left
      (@neg_zero (VectorMeasure α ℝ) _ ▸ neg_le_neg _ _ hi₁ hi))⟩

(hi : MeasureTheory.VectorMeasure.restrict s i ≤ MeasureTheory.VectorMeasure.restrict 0 i)

(s.toMeasureOfLEZero i hi₁ hi) j = ↑⟨-↑s (i ∩ j), ⋯⟩


theorem Nat.succ.injEq (u v : Nat) : (u.succ = v.succ) = (u = v)


@[to_additive]
theorem prod_map_one : prod (m.map fun _ => (1 : α)) = 1

{ι : Type u_2}
{α : Type u_3}
[AddCommMonoid α]
{m : Multiset ι}


@[simp]
theorem mulVec_zero [Fintype n] (A : Matrix m n α) : A *ᵥ 0 = 0

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


@[to_additive (attr := simp)]
theorem comp_apply (f : β →*o γ) (g : α →*o β) (a : α) : (f.comp g) a = f (g a)

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


@[simp]
theorem mem_bot : a ∈ (⊥ : UpperSet α)


theorem DifferentiableOn.hasDerivAt (h : DifferentiableOn 𝕜 f s) (hs : s ∈ 𝓝 x) :
    HasDerivAt f (deriv f x) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
(h : DifferentiableOn 𝕜 f s)
(hs : s ∈ 𝓝 x)


@[to_additive (attr := simp) nsmul_eq_smul]
theorem npow_eq_pow (n : ℕ) (x : M) : Monoid.npow n x = x ^ n

{M : Type u_2}
[Monoid M]
(n : ℕ)
(x : M)


{R : Type u_3}
[CommRing R]
(r : R)
(a : ℍ[R])


theorem star_subset_adjoin (s : Set A) : star s ⊆ adjoin R s

(R : Type u_2)
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
(s : Set A)


theorem mem_closure_iff_nhds_basis' {p : ι → Prop} {s : ι → Set X} (h : (𝓝 x).HasBasis p s) :
    x ∈ closure t ↔ ∀ i, p i → (s i ∩ t).Nonempty

{X : Type u}
{ι : Sort w}
{x : X}
{t : Set X}
[TopologicalSpace X]
{p : ι → Prop}
{s : ι → Set X}
(h : (𝓝 x).HasBasis p s)

x ∈ closure t ↔ ∀ (i : ι), p i → (s i ∩ t).Nonempty


protected theorem LocallyIntegrable.sub (hf : LocallyIntegrable f μ) (hg : LocallyIntegrable g μ) :
    LocallyIntegrable (f - g) μ

(hf : MeasureTheory.LocallyIntegrable f μ)

(hg : MeasureTheory.LocallyIntegrable g μ)

MeasureTheory.LocallyIntegrable (f - g) μ


@[to_additive]
theorem one_min (a : α) : min 1 a = 1


theorem lt_sup_principal_of_not_mem (hx : x ∉ I) : I < I ⊔ principal x

{P : Type u_1}
[SemilatticeSup P]
[IsDirected P fun x x_1 => x ≥ x_1]
{x : P}
{I : Order.Ideal P}
(hx : x ∉ I)


theorem one_le_rpow {x : ℝ≥0∞} {z : ℝ} (hx : 1 ≤ x) (hz : 0 < z) : 1 ≤ x ^ z


lemma kernImage_eq_compl {s : Set α} : kernImage f s = (f '' sᶜ)ᶜ

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


/--
Accessing bits in `x.rotateRight r` the range `[w-r, w)` is equal to
accessing bits `x` in the range `[0, r)`.

Proof by example:
Let x := <6 5 4 3 2 1 0> : BitVec 7.
x.rotateRight 2 = (<6 5 4 3 2 | 1 0>).rotateRight 2 = <1 0 | 6 5 4 3 2>

(x.rotateLeft 2).getLsb ⟨i, i ≥ 7 - 2⟩
= <1 0 | 6 5 4 3 2>.getLsb ⟨i, i ≤ 7 - 2⟩
= <1 0>.getLsb (i - len(<6 5 4 3 2>)
= <6 5 4 3 2 | 1 0> (i - len<6 4 4 3 2>)
 -/
theorem getLsb_rotateRightAux_of_geq {x : BitVec w} {r : Nat} {i : Nat} (hi : i ≥ w - r) :
    (x.rotateRightAux r).getLsb i = (decide (i < w) && x.getLsb (i - (w - r)))

{w : Nat}
{x : BitVec w}
{r i : Nat}
(hi : i ≥ w - r)


theorem IsUpperSet.preimage (hs : IsUpperSet s) {f : β → α} (hf : Monotone f) :
    IsUpperSet (f ⁻¹' s : Set β)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s : Set α}
(hs : IsUpperSet s)
{f : β → α}
(hf : Monotone f)


lemma closedEmbedding_cfcₙHom_of_cfcHom {a : A} (ha : p a) :
    ClosedEmbedding (cfcₙHom_of_cfcHom R ha)

[h_cpct : ∀ (a : A), CompactSpace ↑(spectrum R a)]

ClosedEmbedding ⇑(cfcₙHom_of_cfcHom R ha)


@[simp]
theorem isLowerSet_preimage_ofDual_iff : IsLowerSet (ofDual ⁻¹' s) ↔ IsUpperSet s

IsLowerSet (⇑OrderDual.ofDual ⁻¹' s) ↔ IsUpperSet s


theorem update_comp_eq_of_injective' (g : ∀ a, β a) {f : α' → α} (hf : Function.Injective f)
    (i : α') (a : β (f i)) : (fun j ↦ update g (f i) a (f j)) = update (fun i ↦ g (f i)) i a

{α : Sort u}
{β : α → Sort v}
{α' : Sort w}
[DecidableEq α]
[DecidableEq α']
(g : (a : α) → β a)
{f : α' → α}
(hf : Function.Injective f)
(i : α')
(a : β (f i))

(fun j => Function.update g (f i) a (f j)) = Function.update (fun i => g (f i)) i a


@[to_additive]
theorem mk'_surjective (z : N) : ∃ (x : _) (y : S), f.mk' x y = z

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


@[simp]
theorem ofSubmodule'_symm_apply [Module R M] [Module R₂ M₂] (f : M ≃ₛₗ[σ₁₂] M₂)
    (U : Submodule R₂ M₂) (x : U) : ((f.ofSubmodule' U).symm x : M) = f.symm (x : M₂)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
[Module R M]
[Module R₂ M₂]
(f : M ≃ₛₗ[σ₁₂] M₂)
(U : Submodule R₂ M₂)
(x : ↥U)

↑((f.ofSubmodule' U).symm x) = f.symm ↑x


@[simp]
theorem sum_single_index {N} [AddCommMonoid N] {a : G} {b : k} {h : G → k → N}
    (h_zero : h a 0 = 0) :
    (single a b).sum h = h a b

{k : Type u₁}
{G : Type u₂}
[Semiring k]
{N : Type u_3}
[AddCommMonoid N]
{a : G}
{b : k}
{h : G → k → N}
(h_zero : h a 0 = 0)

Finsupp.sum (MonoidAlgebra.single a b) h = h a b


theorem C_mul_X_eq_monomial {s : σ} {a : R} : C a * X s = monomial (Finsupp.single s 1) a

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{s : σ}
{a : R}

MvPolynomial.C a * MvPolynomial.X s = (MvPolynomial.monomial (Finsupp.single s 1)) a


theorem _root_.biInf_finsetSigma' [CompleteLattice β] (s : Finset ι) (t : ∀ i, Finset (α i))
    (f : ∀ i, α i → β) : ⨅ (i ∈ s) (j ∈ t i), f i j = ⨅ ij ∈ s.sigma t, f ij.fst ij.snd

{ι : Type u_1}
{α : ι → Type u_2}
{β : Type u_3}
[CompleteLattice β]
(s : Finset ι)
(t : (i : ι) → Finset (α i))
(f : (i : ι) → α i → β)

⨅ i ∈ s, ⨅ j ∈ t i, f i j = ⨅ ij ∈ s.sigma t, f ij.fst ij.snd


@[measurability]
theorem measurable_iSup {ι} [Countable ι] {f : ι → δ → α} (hf : ∀ i, Measurable (f i)) :
    Measurable (fun b ↦ ⨆ i, f i b)

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[MeasurableSpace δ]
[ConditionallyCompleteLinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
{ι : Sort u_5}
[Countable ι]
{f : ι → δ → α}
(hf : ∀ (i : ι), Measurable (f i))


@[simp] lemma nhdsSet_exterior (s : Set α) : 𝓝ˢ (exterior s) = 𝓝ˢ s

{α : Type u_3}
[TopologicalSpace α]
[AlexandrovDiscrete α]
(s : Set α)


lemma eventually_r_le_b : ∀ᶠ (n : ℕ) in atTop, ∀ i, r i n ≤ (b i : ℝ) * n + (n / log n ^ 2)

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

∀ᶠ (n : ℕ) in Filter.atTop, ∀ (i : α), ↑(r i n) ≤ b i * ↑n + ↑n / Real.log ↑n ^ 2


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

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


protected theorem lt_min {a b c : Nat} : a < min b c ↔ a < b ∧ a < c


@[to_additive]
theorem Multipliable.congr (hf : Multipliable f) (hfg : ∀ b, f b = g b) : Multipliable g

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f g : β → α}
(hf : Multipliable f)
(hfg : ∀ (b : β), f b = g b)


/-- If `α` is a seminormed ring with `‖1‖₊ = 1`, then `‖a ^ n‖₊ ≤ ‖a‖₊ ^ n`.
See also `nnnorm_pow_le'`. -/
theorem nnnorm_pow_le [NormOneClass α] (a : α) (n : ℕ) : ‖a ^ n‖₊ ≤ ‖a‖₊ ^ n

{α : Type u_1}
[SeminormedRing α]
[NormOneClass α]
(a : α)
(n : ℕ)

‖a ^ n‖₊ ≤ ‖a‖₊ ^ n


@[reassoc (attr := simp), elementwise (attr := simp)]
theorem kernelSubobjectMap_arrow (sq : Arrow.mk f ⟶ Arrow.mk f') :
    kernelSubobjectMap sq ≫ (kernelSubobject f').arrow = (kernelSubobject f).arrow ≫ sq.left

(sq : CategoryTheory.Arrow.mk f ⟶ CategoryTheory.Arrow.mk f')

CategoryTheory.Limits.kernelSubobjectMap sq ≫ (CategoryTheory.Limits.kernelSubobject f').arrow =
  (CategoryTheory.Limits.kernelSubobject f).arrow ≫ sq.left


theorem adjoin_eq_top_of_algebra (hS : Algebra.adjoin F S = ⊤) : adjoin F S = ⊤

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(S : Set E)
(hS : Algebra.adjoin F S = ⊤)


theorem isPreconnected_setOf_sOppSide (s : AffineSubspace ℝ P) (x : P) :
    IsPreconnected { y | s.SOppSide x y }

{V : Type u_2}
{P : Type u_4}
[SeminormedAddCommGroup V]
[NormedSpace ℝ V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(s : AffineSubspace ℝ P)
(x : P)


@[simp]
theorem log_apply {n : ℕ} : log n = Real.log n


protected theorem Nodup.product {l₂ : List β} (d₁ : l₁.Nodup) (d₂ : l₂.Nodup) :
    (l₁ ×ˢ l₂).Nodup

{α : Type u}
{β : Type v}
{l₁ : List α}
{l₂ : List β}
(d₁ : l₁.Nodup)
(d₂ : l₂.Nodup)


theorem integral_pos_iff_support_of_nonneg_ae {f : α → ℝ} (hf : 0 ≤ᵐ[μ] f) (hfi : Integrable f μ) :
    (0 < ∫ x, f x ∂μ) ↔ 0 < μ (Function.support f)

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

0 < ∫ (x : α), f x ∂μ ↔ 0 < μ (Function.support f)


@[simp]
theorem sym2_eq_nil_iff {xs : List α} : xs.sym2 = [] ↔ xs = []


theorem slt_eq_ult (x y : BitVec w) :
    x.slt y = (x.msb != y.msb).xor (x.ult y)


@[simp]
theorem card_zero : @card α 0 = 0


theorem mapDomain_sum [Zero N] {f : α → β} {s : α →₀ N} {v : α → N → α →₀ M} :
    mapDomain f (s.sum v) = s.sum fun a b => mapDomain f (v a b)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
{N : Type u_7}
[AddCommMonoid M]
[Zero N]
{f : α → β}
{s : α →₀ N}
{v : α → N → α →₀ M}

Finsupp.mapDomain f (s.sum v) = s.sum fun a b => Finsupp.mapDomain f (v a b)


theorem iff_false_left  (ha : ¬a) : (a ↔ b) ↔ ¬b


@[simp]
theorem bernoulli'_two : bernoulli' 2 = 1 / 6


lemma Continuous.discrete_of_tendsto_cofinite_cocompact [T1Space X] [WeaklyLocallyCompactSpace Y]
    (hf' : Continuous f) (hf : Tendsto f cofinite (cocompact _)) :
    DiscreteTopology X

(hf : Filter.Tendsto f Filter.cofinite (Filter.cocompact Y))


protected theorem AntitoneOn.Iio (hf : AntitoneOn f s) : AntitoneOn (fun x => Iio (f x)) s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
{s : Set α}
(hf : AntitoneOn f s)


@[simp]
lemma image_subtype_val_Iic_Ioi {a : α} (b : Iic a) : Subtype.val '' Ioi b = Ioc b.1 a

{α : Type u_1}
[Preorder α]
{a : α}
(b : ↑(Set.Iic a))

Subtype.val '' Set.Ioi b = Set.Ioc (↑b) a


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

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

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


@[simp]
theorem pair_apply (f : α →ₛ β) (g : α →ₛ γ) (a) : pair f g a = (f a, g a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α β)
(g : MeasureTheory.SimpleFunc α γ)
(a : α)


theorem ne_natDegree_of_mem_eraseLead_support {a : ℕ} (h : a ∈ (eraseLead f).support) :
    a ≠ f.natDegree

{R : Type u_1}
[Semiring R]
{f : R[X]}
{a : ℕ}
(h : a ∈ f.eraseLead.support)


@[simp]
theorem zeroIsoIsInitial_hom {X : C} (t : IsInitial X) : (zeroIsoIsInitial t).hom = 0

(CategoryTheory.Limits.HasZeroObject.zeroIsoIsInitial t).hom = 0


theorem IsPrime.mem_or_mem (hI : IsPrime I) {x y : P} : x ⊓ y ∈ I → x ∈ I ∨ y ∈ I

{P : Type u_1}
[SemilatticeInf P]
{I : Order.Ideal P}
(hI : I.IsPrime)
{x y : P}


theorem not_sat'_of_isImpossible (h : isImpossible c) {x y} : ¬ c.sat' x y

{c : Lean.Omega.Constraint}
(h : c.isImpossible = true)
{x y : Lean.Omega.Coeffs}


theorem not_isRelPrime_zero_zero [Nontrivial α] : ¬IsRelPrime (0 : α) 0

{α : Type u_1}
[CommMonoidWithZero α]
[Nontrivial α]


/--
For `F : J ⥤ C`, given a cocone `c : Cocone F`, and a natural isomorphism `α : H ≅ H'` for functors
`H H' : C ⥤ D`, the precomposition of the cocone `H.mapCocone` using the isomorphism `α` is
isomorphic to the cocone `H'.mapCocone`.
-/
@[simps!]
def precomposeWhiskerLeftMapCocone {H H' : C ⥤ D} (α : H ≅ H') (c : Cocone F) :
    (Cocones.precompose (whiskerLeft F α.inv : _)).obj (mapCocone H c) ≅ mapCocone H' c

{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}
{H H' : C ⥤ D}
(α : H ≅ H')
(c : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Functor.precomposeWhiskerLeftMapCocone α c).inv.hom = α.inv.app c.pt


@[to_additive] lemma Monovary.pow_left (hfg : Monovary f g) (n : ℕ) : Monovary (f ^ n) g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommGroup β]
{f : ι → α}
{g : ι → β}
(hfg : Monovary f g)
(n : ℕ)


/-- A continuous partition of unity on a set `s : Set X` is a collection of continuous functions
`f i` such that

* the supports of `f i` form a locally finite family of sets, i.e., for every point `x : X` there
  exists a neighborhood `U ∋ x` such that all but finitely many functions `f i` are zero on `U`;
* the functions `f i` are nonnegative;
* the sum `∑ᶠ i, f i x` is equal to one for every `x ∈ s` and is less than or equal to one
  otherwise.

If `X` is a normal paracompact space, then `PartitionOfUnity.exists_isSubordinate` guarantees
that for every open covering `U : Set (Set X)` of `s` there exists a partition of unity that is
subordinate to `U`.
-/
structure PartitionOfUnity (ι X : Type*) [TopologicalSpace X] (s : Set X := univ) where
  /-- The collection of continuous functions underlying this partition of unity -/
  toFun : ι → C(X, ℝ)
  /-- the supports of the underlying functions are a locally finite family of sets -/
  locallyFinite' : LocallyFinite fun i => support (toFun i)
  /-- the functions are non-negative -/
  nonneg' : 0 ≤ toFun
  /-- the functions sum up to one on `s` -/
  sum_eq_one' : ∀ x ∈ s, ∑ᶠ i, toFun i x = 1
  /-- the functions sum up to at most one, globally -/
  sum_le_one' : ∀ x, ∑ᶠ i, toFun i x ≤ 1

{ι : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{s : optParam (Set X) Set.univ}
(self : PartitionOfUnity ι X s)


/-- Pushforwards of submodules along a `LinearEquiv` have the same dimension. -/
theorem LinearEquiv.rank_map_eq (f : M ≃ₗ[R] M₁) (p : Submodule R M) :
    Module.rank R (p.map (f : M →ₗ[R] M₁)) = Module.rank R p

{R : Type u}
{M M₁ : Type v}
[Ring R]
[AddCommGroup M]
[AddCommGroup M₁]
[Module R M]
[Module R M₁]
(f : M ≃ₗ[R] M₁)
(p : Submodule R M)

Module.rank R ↥(Submodule.map (↑f) p) = Module.rank R ↥p


@[simp] theorem mkRat_zero (n) : mkRat n 0 = 0


theorem hasConstantSpeedOnWith_of_subsingleton (f : ℝ → E) {s : Set ℝ} (hs : s.Subsingleton)
    (l : ℝ≥0) : HasConstantSpeedOnWith f s l

{E : Type u_2}
[PseudoEMetricSpace E]
(f : ℝ → E)
{s : Set ℝ}
(hs : s.Subsingleton)
(l : ℝ≥0)


/-- If `C` has a terminal object and binary products, then it has finite products. -/
theorem hasFiniteProducts_of_has_binary_and_terminal : HasFiniteProducts C


/-- The value of `Orientation.map` when the index type has cardinality equal to the finite
dimension, in terms of `f.det`. -/
theorem map_eq_det_inv_smul (x : Orientation R M ι) (f : M ≃ₗ[R] M)
    (h : Fintype.card ι = finrank R M) : Orientation.map ι f x = (LinearEquiv.det f)⁻¹ • x

(h : Fintype.card ι = FiniteDimensional.finrank R M)

(Orientation.map ι f) x = (LinearEquiv.det f)⁻¹ • x


@[simp]
theorem dualQuotEquivDualAnnihilator_apply (W : Submodule R M) (φ : Module.Dual R (M ⧸ W)) (x : M) :
    dualQuotEquivDualAnnihilator W φ x = φ (Quotient.mk x)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(W : Submodule R M)
(φ : Module.Dual R (M ⧸ W))
(x : M)

(W.dualQuotEquivDualAnnihilator φ) x = φ (Submodule.Quotient.mk x)


/-- The short complex in `D` obtained by applying a functor `F : C ⥤ D` to a
short complex in `C`, assuming that `F` preserves zero morphisms. -/
@[simps]
def map (F : C ⥤ D) [F.PreservesZeroMorphisms] : ShortComplex D


theorem iSupLift_of_mem {dir : Directed (· ≤ ·) K} {f : ∀ i, K i →ₐ[R] B}
    {hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (inclusion h)}
    {T : Subalgebra R A} {hT : T = iSup K} {i : ι} (x : T) (hx : (x : A) ∈ K i) :
    iSupLift K dir f hf T hT x = f i ⟨x, hx⟩

{dir : Directed (fun x x_1 => x ≤ x_1) K}

{hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (Subalgebra.inclusion h)}

(Subalgebra.iSupLift K dir f hf T hT) x = (f i) ⟨↑x, hx⟩


theorem lex_iff {a b : Σ' i, α i} :
    Lex r s a b ↔ r a.1 b.1 ∨ ∃ h : a.1 = b.1, s b.1 (h.rec a.2) b.2

{ι : Sort u_1}
{α : ι → Sort u_2}
{r : ι → ι → Prop}
{s : (i : ι) → α i → α i → Prop}
{a b : (i : ι) ×' α i}

PSigma.Lex r s a b ↔ r a.fst b.fst ∨ ∃ h, s b.fst (h ▸ a.snd) b.snd


theorem support_C_mul_X' (c : R) : Polynomial.support (C c * X) ⊆ singleton 1

(Polynomial.C c * Polynomial.X).support ⊆ {1}


/-- Is `B` is a block for an action of `G`, it is a block for the action of any subgroup of `G` -/
theorem IsBlock.subgroup {H : Subgroup G} {B : Set X} (hfB : IsBlock G B) :
    IsBlock H B

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{H : Subgroup G}
{B : Set X}
(hfB : MulAction.IsBlock G B)


theorem ContinuousLinearEquiv.tsum_eq_iff [T2Space M] [T2Space M₂] {f : ι → M} (e : M ≃SL[σ] M₂)
    {y : M₂} : (∑' z, e (f z)) = y ↔ ∑' z, f z = e.symm y

{ι : Type u_5}
{R : Type u_7}
{R₂ : Type u_8}
{M : Type u_9}
{M₂ : Type u_10}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M₂]
[Module R₂ M₂]
[TopologicalSpace M]
[TopologicalSpace M₂]
{σ : R →+* R₂}
{σ' : R₂ →+* R}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
[T2Space M]
[T2Space M₂]
{f : ι → M}
(e : M ≃SL[σ] M₂)
{y : M₂}

∑' (z : ι), e (f z) = y ↔ ∑' (z : ι), f z = e.symm y


/-- `i : α → β` is "dense inducing" if it has dense range and the topology on `α`
  is the one induced by `i` from the topology on `β`. -/
structure DenseInducing [TopologicalSpace α] [TopologicalSpace β] (i : α → β)
    extends Inducing i : Prop where
  /-- The range of a dense inducing map is a dense set. -/
  protected dense : DenseRange i

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{i : α → β}
(self : DenseInducing i)


theorem ClassGroup.mk0_eq_mk0_inv_iff [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I = (ClassGroup.mk0 J)⁻¹ ↔
      ∃ x ≠ (0 : R), I * J = Ideal.span {x}

{R : Type u_1}
[CommRing R]
[IsDomain R]
[IsDedekindDomain R]
{I J : ↥(Ideal R)⁰}

ClassGroup.mk0 I = (ClassGroup.mk0 J)⁻¹ ↔ ∃ x, x ≠ 0 ∧ ↑I * ↑J = Ideal.span {x}


@[to_additive]
lemma IsSquare.div [DivisionCommMonoid α] {a b : α} (ha : IsSquare a) (hb : IsSquare b) :
    IsSquare (a / b)

{α : Type u_2}
[DivisionCommMonoid α]
{a b : α}
(ha : IsSquare a)
(hb : IsSquare b)


theorem Subalgebra.finite_sup {K L : Type*} [CommSemiring K] [CommSemiring L] [Algebra K L]
    (E1 E2 : Subalgebra K L) [Module.Finite K E1] [Module.Finite K E2] :
    Module.Finite K ↥(E1 ⊔ E2)

{K : Type u_1}
{L : Type u_2}
[CommSemiring K]
[CommSemiring L]
[Algebra K L]
(E1 E2 : Subalgebra K L)
[Module.Finite K ↥E1]
[Module.Finite K ↥E2]


/-- `Multifork.ofPiFork` as a functor. -/
@[simps]
noncomputable def ofPiForkFunctor : Fork I.fstPiMap I.sndPiMap ⥤ Multifork I

(I : CategoryTheory.Limits.MulticospanIndex C)

(c : CategoryTheory.Limits.Fork I.fstPiMap I.sndPiMap)

I.ofPiForkFunctor.obj c = CategoryTheory.Limits.Multifork.ofPiFork I c


@[norm_cast]
theorem coe_mks {f : A → B} (h₀ h₁ h₂ h₃ h₄ h₅) :
    ⇑(⟨⟨⟨⟨f, h₀⟩, h₁⟩, h₂, h₃⟩, h₄, h₅⟩ : A →ₐc[R] B) = f

(h₀ : ∀ (x y : A), f (x + y) = f x + f y)

(h₁ :
  ∀ (m : R) (x : A),
    { toFun := f, map_add' := h₀ }.toFun (m • x) = (RingHom.id R) m • { toFun := f, map_add' := h₀ }.toFun x)

(h₂ : Coalgebra.counit ∘ₗ { toFun := f, map_add' := h₀, map_smul' := h₁ } = Coalgebra.counit)

(h₃ :
  TensorProduct.map { toFun := f, map_add' := h₀, map_smul' := h₁ } { toFun := f, map_add' := h₀, map_smul' := h₁ } ∘ₗ
      Coalgebra.comul =
    Coalgebra.comul ∘ₗ { toFun := f, map_add' := h₀, map_smul' := h₁ })

(h₄ : { toFun := f, map_add' := h₀, map_smul' := h₁, counit_comp := h₂, map_comp_comul := h₃ }.toFun 1 = 1)

(h₅ :
  ∀ (x y : A),
    { toFun := f, map_add' := h₀, map_smul' := h₁, counit_comp := h₂, map_comp_comul := h₃ }.toFun (x * y) =
      { toFun := f, map_add' := h₀, map_smul' := h₁, counit_comp := h₂, map_comp_comul := h₃ }.toFun x *
        { toFun := f, map_add' := h₀, map_smul' := h₁, counit_comp := h₂, map_comp_comul := h₃ }.toFun y)

⇑{ toFun := f, map_add' := h₀, map_smul' := h₁, counit_comp := h₂, map_comp_comul := h₃, map_one' := h₄,
      map_mul' := h₅ } =
  f


theorem SeparationQuotient.uniformInducing_mk : UniformInducing (mk : α → SeparationQuotient α)


/-- The direction of the affine span of coplanar points is finite-dimensional. -/
theorem Coplanar.finiteDimensional_direction_affineSpan {s : Set P} (h : Coplanar k s) :
    FiniteDimensional k (affineSpan k s).direction

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
(h : Coplanar k s)

FiniteDimensional k ↥(affineSpan k s).direction