lemma closure_closure_union_closure_eq_closure_union (M : Matroid α) (X Y : Set α) :
    M.closure (M.closure X ∪ M.closure Y) = M.closure (X ∪ Y)

{α : Type u_2}
(M : Matroid α)
(X Y : Set α)


/-- If the unit is an isomorphism, bundle one has an isomorphism `L ⋙ R ⋙ L ≅ L`. -/
@[simps!]
noncomputable def whiskerLeftLCounitIsoOfIsIsoUnit [IsIso h.unit] : L ⋙ R ⋙ L ≅ L

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : C ⥤ D}
{R : D ⥤ C}
(h : L ⊣ R)
[CategoryTheory.IsIso h.unit]
(X : C)

h.whiskerLeftLCounitIsoOfIsIsoUnit.inv.app X = L.map (h.unit.app X)


theorem comap_iInf_map_of_injective {ι : Sort*} (S : ι → Submodule R M) :
    (⨅ i, (S i).map f).comap f = iInf S

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
{f : F}
(hf : Function.Injective ⇑f)
{ι : Sort u_10}
(S : ι → Submodule R M)

Submodule.comap f (⨅ i, Submodule.map f (S i)) = iInf S


theorem range_eq_iUnion {ι} (f : ι → α) : range f = ⋃ i, {f i}

{α : Type u_1}
{ι : Sort u_11}
(f : ι → α)


theorem isGLB_of_tendsto_atTop [TopologicalSpace α] [Preorder α] [OrderClosedTopology α]
    [Nonempty β] [SemilatticeSup β] {f : β → α} {a : α} (hf : Antitone f)
    (ha : Tendsto f atTop (𝓝 a)) : IsGLB (Set.range f) a

(ha : Filter.Tendsto f Filter.atTop (𝓝 a))


/-- The *spectral mapping theorem* for polynomials.  Note: the assumption `degree p > 0`
is necessary in case `σ a = ∅`, for then the left-hand side is `∅` and the right-hand side,
assuming `[Nontrivial A]`, is `{k}` where `p = Polynomial.C k`. -/
theorem map_polynomial_aeval_of_degree_pos [IsAlgClosed 𝕜] (a : A) (p : 𝕜[X])
    (hdeg : 0 < degree p) : σ (aeval a p) = (eval · p) '' σ a

{𝕜 : Type u}
{A : Type v}
[Field 𝕜]
[Ring A]
[Algebra 𝕜 A]
[IsAlgClosed 𝕜]
(a : A)
(p : Polynomial 𝕜)
(hdeg : 0 < p.degree)

spectrum 𝕜 ((Polynomial.aeval a) p) = (fun x => Polynomial.eval x p) '' spectrum 𝕜 a


theorem min'_eq_inf' : s.min' H = s.inf' H id

{α : Type u_2}
[LinearOrder α]
(s : Finset α)
(H : s.Nonempty)


@[simp] theorem isLeast_singleton : IsLeast {a} a


theorem isClosed_innerDualCone : IsClosed (s.innerDualCone : Set H)

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


/-- The determinant of `conjLIE`, as a linear map. -/
@[simp]
theorem det_conjLIE : LinearMap.det (conjLIE.toLinearEquiv : ℂ →ₗ[ℝ] ℂ) = -1

LinearMap.det ↑Complex.conjLIE.toLinearEquiv = -1


/-- Corresponds to `dist_smul` with the discrete norm on `α`. -/
theorem hammingDist_smul [∀ i, SMul α (β i)] {k : α} {x y : ∀ i, β i}
    (hk : ∀ i, IsSMulRegular (β i) k) : hammingDist (k • x) (k • y) = hammingDist x y

{α : Type u_1}
{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
[(i : ι) → SMul α (β i)]
{k : α}
{x y : (i : ι) → β i}
(hk : ∀ (i : ι), IsSMulRegular (β i) k)


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

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

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

[self : CategoryTheory.Pretriangulated C]

CategoryTheory.Pretriangulated.contractibleTriangle X ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


/-- Subgroups of torsion groups are torsion groups. -/
@[to_additive "Subgroups of additive torsion groups are additive torsion groups."]
theorem IsTorsion.subgroup (tG : IsTorsion G) (H : Subgroup G) : IsTorsion H

{G : Type u_1}
[AddGroup G]
(tG : AddMonoid.IsTorsion G)
(H : AddSubgroup G)


theorem HasMFDerivWithinAt.continuousWithinAt (h : HasMFDerivWithinAt I I' f s x f') :
    ContinuousWithinAt f s x

{f' : TangentSpace I x →L[𝕜] TangentSpace I' (f x)}


theorem exists_int_gt (x : α) : ∃ n : ℤ, x < n

{α : Type u_1}
[StrictOrderedRing α]
[Archimedean α]
(x : α)


@[to_additive]
theorem IsLUB.inv (h : IsLUB s a) : IsGLB s⁻¹ a⁻¹

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

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


lemma δ_apply (x₃ : (forget₂ C Ab).obj (S.X₃.X i))
    (hx₃ : (forget₂ C Ab).map (S.X₃.d i j) x₃ = 0)
    (x₂ : (forget₂ C Ab).obj (S.X₂.X i)) (hx₂ : (forget₂ C Ab).map (S.g.f i) x₂ = x₃)
    (x₁ : (forget₂ C Ab).obj (S.X₁.X j))
    (hx₁ : (forget₂ C Ab).map (S.f.f j) x₁ = (forget₂ C Ab).map (S.X₂.d i j) x₂)
    (k : ι) (hk : c.next j = k) :
    (forget₂ C Ab).map (hS.δ i j hij)
      ((forget₂ C Ab).map (S.X₃.homologyπ i) (S.X₃.cyclesMk x₃ j (c.next_eq' hij) hx₃)) =
        (forget₂ C Ab).map (S.X₁.homologyπ j) (S.X₁.cyclesMk x₁ k hk (by
          have := hS.mono_f
          apply (Preadditive.mono_iff_injective (S.f.f k)).1 inferInstance
          erw [← forget₂_comp_apply, ← HomologicalComplex.Hom.comm, forget₂_comp_apply, hx₁,
            ← forget₂_comp_apply, HomologicalComplex.d_comp_d, Functor.map_zero, map_zero,
            AddMonoidHom.zero_apply]))

{S : CategoryTheory.ShortComplex (HomologicalComplex C c)}

(x₃ : ↑((CategoryTheory.forget₂ C Ab).obj (S.X₃.X i)))

(hx₃ : ((CategoryTheory.forget₂ C Ab).map (S.X₃.d i j)) x₃ = 0)

(x₂ : ↑((CategoryTheory.forget₂ C Ab).obj (S.X₂.X i)))

(hx₂ : ((CategoryTheory.forget₂ C Ab).map (S.g.f i)) x₂ = x₃)

(x₁ : ↑((CategoryTheory.forget₂ C Ab).obj (S.X₁.X j)))

(hx₁ : ((CategoryTheory.forget₂ C Ab).map (S.f.f j)) x₁ = ((CategoryTheory.forget₂ C Ab).map (S.X₂.d i j)) x₂)

((CategoryTheory.forget₂ C Ab).map (hS.δ i j hij))
    (((CategoryTheory.forget₂ C Ab).map (S.X₃.homologyπ i)) (S.X₃.cyclesMk x₃ j ⋯ hx₃)) =
  ((CategoryTheory.forget₂ C Ab).map (S.X₁.homologyπ j)) (S.X₁.cyclesMk x₁ k hk ⋯)


theorem SurjOn.inter_inter (h₁ : SurjOn f s₁ t₁) (h₂ : SurjOn f s₂ t₂) (h : InjOn f (s₁ ∪ s₂)) :
    SurjOn f (s₁ ∩ s₂) (t₁ ∩ t₂)

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Set α}
{t₁ t₂ : Set β}
{f : α → β}
(h₁ : Set.SurjOn f s₁ t₁)
(h₂ : Set.SurjOn f s₂ t₂)
(h : Set.InjOn f (s₁ ∪ s₂))


/-- If we dilate a convex set about a point in its interior by a scale `t > 1`, the interior of
the result includes the closure of the original set.

TODO Generalise this from convex sets to sets that are balanced / star-shaped about `x`. -/
theorem Convex.closure_subset_interior_image_homothety_of_one_lt {s : Set E} (hs : Convex ℝ s)
    {x : E} (hx : x ∈ interior s) (t : ℝ) (ht : 1 < t) :
    closure s ⊆ interior (homothety x t '' s)

{E : Type u_3}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
{s : Set E}
(hs : Convex ℝ s)
{x : E}
(hx : x ∈ interior s)
(t : ℝ)
(ht : 1 < t)

closure s ⊆ interior (⇑(AffineMap.homothety x t) '' s)


theorem Associated.neg_neg [Monoid α] [HasDistribNeg α] {a b : α} (h : Associated a b) :
    Associated (-a) (-b)

{α : Type u_1}
[Monoid α]
[HasDistribNeg α]
{a b : α}
(h : a ~ᵤ b)


@[to_additive (attr := simp)]
theorem inv_lt_div_iff_lt_mul : a⁻¹ < b / c ↔ c < a * b

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

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


theorem BilinForm.toMatrix_mul (B : BilinForm R₂ M₂) (M : Matrix n n R₂) :
    BilinForm.toMatrix b B * M = BilinForm.toMatrix b (B.compRight (Matrix.toLin b b M))

{R₂ : Type u_5}
{M₂ : Type u_6}
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(b : Basis n R₂ M₂)
(B : LinearMap.BilinForm R₂ M₂)
(M : Matrix n n R₂)

(BilinForm.toMatrix b) B * M = (BilinForm.toMatrix b) (B.compRight ((Matrix.toLin b b) M))


@[simp, norm_cast]
theorem cast_to_int [AddGroupWithOne α] (n : PosNum) : ((n : ℤ) : α) = n

{α : Type u_1}
[AddGroupWithOne α]
(n : PosNum)


protected theorem bot_eq_zero : (⊥ : Π₀ i, α i) = 0

[(i : ι) → CanonicallyOrderedAddCommMonoid (α i)]


/-- Introduction rule to prove that `b` is the supremum of `f`: it suffices to check that `b`
is larger than `f i` for all `i`, and that this is not the case of any `w<b`.
See `ciSup_eq_of_forall_le_of_forall_lt_exists_gt` for a version in conditionally complete
lattices. -/
theorem iSup_eq_of_forall_le_of_forall_lt_exists_gt {f : ι → α} (h₁ : ∀ i, f i ≤ b)
    (h₂ : ∀ w, w < b → ∃ i, w < f i) : ⨆ i : ι, f i = b

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{b : α}
{f : ι → α}
(h₁ : ∀ (i : ι), f i ≤ b)
(h₂ : ∀ w < b, ∃ i, w < f i)


@[simp]
theorem comp_zero (g : M₂ →SL[σ₂₃] M₃) : g.comp (0 : M₁ →SL[σ₁₂] M₂) = 0

{R₁ : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
[Module R₁ M₁]
[Module R₂ M₂]
[Module R₃ M₃]
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(g : M₂ →SL[σ₂₃] M₃)


theorem Ioi_pred_eq_insert_of_not_isMin (ha : ¬IsMin a) : Ioi (pred a) = insert a (Ioi a)

{α : Type u_1}
[PartialOrder α]
[PredOrder α]
{a : α}
(ha : ¬IsMin a)

Set.Ioi (Order.pred a) = insert a (Set.Ioi a)


theorem Module.injective_module_of_injective_object
    [inj : CategoryTheory.Injective <| ModuleCat.of R Q] :
    Module.Injective R Q

[inj : CategoryTheory.Injective (ModuleCat.of R Q)]


@[simp]
theorem range_quot_lift {r : ι → ι → Prop} (hf : ∀ x y, r x y → f x = f y) :
    range (Quot.lift f hf) = range f

{α : Type u_1}
{ι : Sort u_4}
{f : ι → α}
{r : ι → ι → Prop}
(hf : ∀ (x y : ι), r x y → f x = f y)

Set.range (Quot.lift f hf) = Set.range f


@[simp]
theorem tensorObj_obj {F G : C ⥤ D} {X} : (F ⊗ G).obj X = F.obj X ⊗ G.obj X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
{F G : C ⥤ D}
{X : C}


@[mono]
theorem toFilteriUnion_mono (I : Box ι) {l₁ l₂ : IntegrationParams} (h : l₁ ≤ l₂)
    (π₀ : Prepartition I) : l₁.toFilteriUnion I π₀ ≤ l₂.toFilteriUnion I π₀

{ι : Type u_1}
[Fintype ι]
(I : BoxIntegral.Box ι)
{l₁ l₂ : BoxIntegral.IntegrationParams}
(h : l₁ ≤ l₂)
(π₀ : BoxIntegral.Prepartition I)


@[simp]
theorem coeff_mul_X (m) (s : σ) (p : MvPolynomial σ R) :
    coeff (m + Finsupp.single s 1) (p * X s) = coeff m p

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(m : σ →₀ ℕ)
(s : σ)
(p : MvPolynomial σ R)

MvPolynomial.coeff (m + Finsupp.single s 1) (p * MvPolynomial.X s) = MvPolynomial.coeff m p


theorem HasDerivWithinAt.comp_of_eq (hh₂ : HasDerivWithinAt h₂ h₂' s' y)
    (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s s') (hy : y = h x) :
    HasDerivWithinAt (h₂ ∘ h) (h₂' * h') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)
{s : Set 𝕜}
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{s' : Set 𝕜'}
{h : 𝕜 → 𝕜'}
{h₂ : 𝕜' → 𝕜'}
{h' h₂' y : 𝕜'}
(hh₂ : HasDerivWithinAt h₂ h₂' s' y)
(hh : HasDerivWithinAt h h' s x)
(hst : Set.MapsTo h s s')
(hy : y = h x)


/-- The convergents coincide in the expected way at the squashed position if the partial denominator
at the squashed position is not zero. -/
theorem succ_nth_conv_eq_squashGCF_nth_conv [Field K]
    (nth_partDen_ne_zero : ∀ {b : K}, g.partDens.get? n = some b → b ≠ 0) :
    g.convs (n + 1) = (squashGCF g n).convs n

g.convs (n + 1) = (g.squashGCF n).convs n


theorem IsCompact.inf_nhdsSet_eq_biSup {K : Set X} (hK : IsCompact K) (l : Filter X) :
    l ⊓ (𝓝ˢ K) = ⨆ x ∈ K, l ⊓ 𝓝 x

{X : Type u}
[TopologicalSpace X]
{K : Set X}
(hK : IsCompact K)
(l : Filter X)


@[simp]
theorem Tape.map_write {Γ Γ'} [Inhabited Γ] [Inhabited Γ'] (f : PointedMap Γ Γ') (b : Γ) :
    ∀ T : Tape Γ, (T.write b).map f = (T.map f).write (f b)

{Γ : Type u_1}
{Γ' : Type u_2}
[Inhabited Γ]
[Inhabited Γ']
(f : Turing.PointedMap Γ Γ')
(b : Γ)
(T : Turing.Tape Γ)

Turing.Tape.map f (Turing.Tape.write b T) = Turing.Tape.write (f.f b) (Turing.Tape.map f T)


lemma sqrt.lt_iter_succ_sq (n guess : ℕ) (hn : n < (guess + 1) * (guess + 1)) :
    n < (sqrt.iter n guess + 1) * (sqrt.iter n guess + 1)

n < (Nat.sqrt.iter n guess + 1) * (Nat.sqrt.iter n guess + 1)


theorem exists_of_update (self : Buckets α β) (i d h) :
    ∃ l₁ l₂, self.1.data = l₁ ++ self.1[i] :: l₂ ∧ List.length l₁ = i.toNat ∧
      (self.update i d h).1.data = l₁ ++ d :: l₂

(self : Batteries.HashMap.Imp.Buckets α β)

∃ l₁ l₂, self.val.data = l₁ ++ self.val[i] :: l₂ ∧ l₁.length = i.toNat ∧ (self.update i d h).val.data = l₁ ++ d :: l₂


/-- See note [partially-applied ext lemmas]. -/
@[ext]
theorem hom_ext {A : Type*} [Semiring A] [Algebra R A] {f g : TensorAlgebra R M →ₐ[R] A}
    (w : f.toLinearMap.comp (ι R) = g.toLinearMap.comp (ι R)) : f = g

(w : f.toLinearMap ∘ₗ TensorAlgebra.ι R = g.toLinearMap ∘ₗ TensorAlgebra.ι R)


lemma lintegral_le_meas {s : Set α} {f : α → ℝ≥0∞} (hf : ∀ a, f a ≤ 1) (h'f : ∀ a ∈ sᶜ, f a = 0) :
    ∫⁻ a, f a ∂μ ≤ μ s

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → ℝ≥0∞}
(hf : ∀ (a : α), f a ≤ 1)
(h'f : ∀ a ∈ sᶜ, f a = 0)


@[deprecated measure_biUnion_null_iff (since := "2024-05-14")]
theorem biUnion_null_iff (m : OuterMeasure α) {s : Set β} (hs : s.Countable) {t : β → Set α} :
    m (⋃ i ∈ s, t i) = 0 ↔ ∀ i ∈ s, m (t i) = 0

{α : Type u_1}
{β : Type u_2}
(m : MeasureTheory.OuterMeasure α)
{s : Set β}
(hs : s.Countable)
{t : β → Set α}


/-- The Grothendieck construction applied to a functor to `Type`
(thought of as a functor to `Cat` by realising a type as a discrete category)
is the same as the 'category of elements' construction.
-/
-- See porting note on grothendieckTypeToCatInverse.
-- We just want to turn off grothendieckTypeToCat_inverse_map_fiber_down_down,
-- so have to list the complement here for `@[simps]`.
@[simps! functor_obj_fst functor_obj_snd functor_map_coe inverse_obj_base inverse_obj_fiber_as
  inverse_map_base unitIso_hom_app_base unitIso_hom_app_fiber unitIso_inv_app_base
  unitIso_inv_app_fiber counitIso_hom_app_coe counitIso_inv_app_coe]
def grothendieckTypeToCat : Grothendieck (G ⋙ typeToCat) ≌ G.Elements

(X : CategoryTheory.Grothendieck (G.comp CategoryTheory.typeToCat))

((CategoryTheory.Grothendieck.grothendieckTypeToCat G).functor.obj X).fst = X.base


theorem eq_bot_iff_generator_eq_zero (S : Submodule R M) [S.IsPrincipal] :
    S = ⊥ ↔ generator S = 0

{R : Type u}
{M : Type v}
[AddCommGroup M]
[Ring R]
[Module R M]
(S : Submodule R M)
[S.IsPrincipal]

S = ⊥ ↔ Submodule.IsPrincipal.generator S = 0


@[to_additive]
theorem leftInverse_div_mul_left (c : G) : Function.LeftInverse (fun x ↦ x / c) fun x ↦ x * c

Function.LeftInverse (fun x => x / c) fun x => x * c


theorem isCoatom_iff [OrderTop α] [OrderTop β] [IsCoatomic β] {l : α → β} {u : β → α}
    (gi : GaloisCoinsertion l u) (htop : l ⊤ = ⊤) (h_coatom : ∀ b, IsCoatom b → l (u b) = b)
    (b : β) : IsCoatom (u b) ↔ IsCoatom b

(h_coatom : ∀ (b : β), IsCoatom b → l (u b) = b)


theorem Orthonormal.map_equiv {v : Basis ι 𝕜 E} (hv : Orthonormal 𝕜 v) {v' : Basis ι' 𝕜 E'}
    (hv' : Orthonormal 𝕜 v') (e : ι ≃ ι') :
    v.map (hv.equiv hv' e).toLinearEquiv = v'.reindex e.symm

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{ι' : Type u_5}
{E' : Type u_7}
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
{v : Basis ι 𝕜 E}
(hv : Orthonormal 𝕜 ⇑v)
{v' : Basis ι' 𝕜 E'}
(hv' : Orthonormal 𝕜 ⇑v')
(e : ι ≃ ι')


theorem integralNormalization_aeval_eq_zero [Algebra R S] {f : R[X]} {z : S} (hz : aeval z f = 0)
    (inj : ∀ x : R, algebraMap R S x = 0 → x = 0) :
    aeval (z * algebraMap R S f.leadingCoeff) (integralNormalization f) = 0

(inj : ∀ (x : R), (algebraMap R S) x = 0 → x = 0)

(Polynomial.aeval (z * (algebraMap R S) f.leadingCoeff)) f.integralNormalization = 0


/-- (Impl) Given a cone in the base category, raise it to a cone in the over category. Note this is
where the connected assumption is used.
-/
@[simps]
def raiseCone [IsConnected J] {B : C} {F : J ⥤ Over B} (c : Cone (F ⋙ forget B)) :
    Cone F

(c : CategoryTheory.Limits.Cone (F ⋙ CategoryTheory.Over.forget B))

(CategoryTheory.Over.CreatesConnected.raiseCone c).pt =
  CategoryTheory.Over.mk (c.π.app (Classical.arbitrary J) ≫ (F.obj (Classical.arbitrary J)).hom)


theorem rel_iff_cov [CovariantClass M N μ r] [ContravariantClass M N μ r] (m : M) {a b : N} :
    r (μ m a) (μ m b) ↔ r a b

(M : Type u_1)
(N : Type u_2)
(μ : M → N → N)
(r : N → N → Prop)
[CovariantClass M N μ r]
[ContravariantClass M N μ r]
(m : M)
{a b : N}


theorem to_localInverse : HasStrictDerivAt (hf.localInverse f f' a hf') f'⁻¹ (f a)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
{f : 𝕜 → 𝕜}
{f' a : 𝕜}
(hf : HasStrictDerivAt f f' a)
(hf' : f' ≠ 0)

HasStrictDerivAt (HasStrictDerivAt.localInverse f f' a hf hf') f'⁻¹ (f a)


/-- `x ↦ a / x` as an order-reversing equivalence. -/
@[to_additive (attr := simps!) "`x ↦ a - x` as an order-reversing equivalence."]
def OrderIso.divLeft (a : α) : α ≃o αᵒᵈ

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

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

∀ (a_1 : αᵒᵈ), (RelIso.symm (OrderIso.subLeft a)) a_1 = -OrderDual.ofDual a_1 + a


@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.mul' [MeasurableMul₂ M] (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    AEMeasurable (f * g) μ

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Mul M]
{m : MeasurableSpace α}
{f g : α → M}
{μ : MeasureTheory.Measure α}
[MeasurableMul₂ M]
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


/-- The *principle of isolated zeros* for an analytic function, local version: if a function is
analytic at `z₀`, then either it is identically zero in a neighborhood of `z₀`, or it does not
vanish in a punctured neighborhood of `z₀`. -/
theorem eventually_eq_zero_or_eventually_ne_zero (hf : AnalyticAt 𝕜 f z₀) :
    (∀ᶠ z in 𝓝 z₀, f z = 0) ∨ ∀ᶠ z in 𝓝[≠] z₀, f z ≠ 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{z₀ : 𝕜}
(hf : AnalyticAt 𝕜 f z₀)

(∀ᶠ (z : 𝕜) in 𝓝 z₀, f z = 0) ∨ ∀ᶠ (z : 𝕜) in 𝓝[≠] z₀, f z ≠ 0


theorem cotangent_subsingleton_iff : Subsingleton I.Cotangent ↔ IsIdempotentElem I


theorem coe_mul_star_self (U : unitary R) : (U : R) * star U = 1

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


theorem ExpChar.neg_one_pow_expChar [Ring R] (q : ℕ) [hR : ExpChar R q] :
    (-1 : R) ^ q = -1

(R : Type u)
[Ring R]
(q : ℕ)
[hR : ExpChar R q]


/-- image and preimage are a Galois connection -/
@[simp]
theorem image_subset_iff {s : Set α} {t : Set β} {f : α → β} : f '' s ⊆ t ↔ s ⊆ f ⁻¹' t

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


@[simp]
theorem cons_transpose (v : n' → α) (A : Matrix (Fin m) n' α) :
    (of (vecCons v A))ᵀ = of fun i => vecCons (v i) (Aᵀ i)

{α : Type u}
{m : ℕ}
{n' : Type uₙ}
(v : n' → α)
(A : Matrix (Fin m) n' α)

(Matrix.of (Matrix.vecCons v A)).transpose = Matrix.of fun i => Matrix.vecCons (v i) (A.transpose i)


protected theorem Equiv.euc : ∀ {x y z}, Equiv x y → Equiv z y → Equiv x z


theorem lt_factorial_self {n : ℕ} (hi : 3 ≤ n) : n < n !


theorem comp_add (X Y Z : C) (f : X ⟶ Y) (g h : Y ⟶ Z) : f ≫ (g + h) = f ≫ g + f ≫ h


@[to_additive coe_prod]
theorem coe_prod (f : M →* N) (g : M →* P) : ⇑(f.prod g) = Pi.prod f g

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[MulOneClass M]
[MulOneClass N]
[MulOneClass P]
(f : M →* N)
(g : M →* P)


@[simp 1100] -- Porting note: increased priority to make lint happy
theorem hasStrictFDerivAt_pi :
    HasStrictFDerivAt (fun x i => φ i x) (ContinuousLinearMap.pi φ') x ↔
      ∀ i, HasStrictFDerivAt (φ i) (φ' i) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{ι : Type u_6}
[Fintype ι]
{F' : ι → Type u_7}
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
{φ : (i : ι) → E → F' i}
{φ' : (i : ι) → E →L[𝕜] F' i}

HasStrictFDerivAt (fun x i => φ i x) (ContinuousLinearMap.pi φ') x ↔ ∀ (i : ι), HasStrictFDerivAt (φ i) (φ' i) x


theorem comap_eq_generateFrom (m : MeasurableSpace β) (f : α → β) :
    m.comap f = generateFrom { t | ∃ s, MeasurableSet s ∧ f ⁻¹' s = t }

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

MeasurableSpace.comap f m = MeasurableSpace.generateFrom {t | ∃ s, MeasurableSet s ∧ f ⁻¹' s = t}


theorem add_le_mul' [ZeroLEOneClass α] [NeZero (R := α) 1]
    [MulPosStrictMono α] [PosMulStrictMono α] [CovariantClass α α (· + ·) (· ≤ ·)]
    (a2 : 2 ≤ a) (b2 : 2 ≤ b) : a + b ≤ b * a


@[to_additive (attr := simp)]
theorem coe_of (R : Type u) [Semigroup R] : (Semigrp.of R : Type u) = R


/-- Class `ContinuousConstVAdd Γ T` says that the additive action `(+ᵥ) : Γ → T → T`
is continuous in the second argument. We use the same class for all kinds of additive actions,
including (semi)modules and algebras.

Note that both `ContinuousConstVAdd α α` and `ContinuousConstVAdd αᵐᵒᵖ α` are
weaker versions of `ContinuousVAdd α`. -/
class ContinuousConstVAdd (Γ : Type*) (T : Type*) [TopologicalSpace T] [VAdd Γ T] : Prop where
  /-- The additive action `(+ᵥ) : Γ → T → T` is continuous in the second argument. -/
  continuous_const_vadd : ∀ γ : Γ, Continuous fun x : T => γ +ᵥ x

{Γ : Type u_1}
{T : Type u_2}
[TopologicalSpace T]
[VAdd Γ T]
[self : ContinuousConstVAdd Γ T]
(γ : Γ)


@[to_additive]
theorem support_mulAntidiagonal_subset_mul : { a | (mulAntidiagonal hs ht a).Nonempty } ⊆ s * t

{α : Type u_1}
[OrderedCancelAddCommMonoid α]
{s t : Set α}
{hs : s.IsPWO}
{ht : t.IsPWO}

{a | (Finset.addAntidiagonal hs ht a).Nonempty} ⊆ s + t


theorem empty_mem_ssubsets {s : Finset α} (h : s.Nonempty) : ∅ ∈ s.ssubsets

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
(h : s.Nonempty)


@[to_additive (attr := simp)]
theorem _root_.map_units_inv {F : Type*} [FunLike F M α] [MonoidHomClass F M α]
    (f : F) (u : Units M) :
    f ↑u⁻¹ = (f u)⁻¹

{α : Type u_1}
{M : Type u}
[Monoid M]
[DivisionMonoid α]
{F : Type u_2}
[FunLike F M α]
[MonoidHomClass F M α]
(f : F)
(u : Mˣ)


theorem trStmts₁_run {k : K} {s : StAct₂ k} {q : Stmt₂} :
    trStmts₁ (stRun s q) = {go k s q, ret q} ∪ trStmts₁ q

{K : Type u_1}
{Γ : K → Type u_2}
{Λ : Type u_3}
{σ : Type u_4}
{k : K}
{s : Turing.TM2to1.StAct k}
{q : Turing.TM2.Stmt Γ Λ σ}

Turing.TM2to1.trStmts₁ (Turing.TM2to1.stRun s q) =
  {Turing.TM2to1.Λ'.go k s q, Turing.TM2to1.Λ'.ret q} ∪ Turing.TM2to1.trStmts₁ q


theorem comap_coe_neBot_of_le_principal {s : Set γ} {l : Filter γ} [h : NeBot l] (h' : l ≤ 𝓟 s) :
    NeBot (comap ((↑) : s → γ) l)

{γ : Type w}
{s : Set γ}
{l : Filter γ}
[h : l.NeBot]
(h' : l ≤ 𝓟 s)


@[to_additive]
theorem inv_mul_lt_one_iff_lt : a * b⁻¹ < 1 ↔ a < b

[CovariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x < x_1]


theorem take_iterate (f : α → α) (a : α) (m n : ℕ) :
    take m (iterate f a n) = iterate f a (min m n)

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

List.take m (List.iterate f a n) = List.iterate f a (min m n)


@[simp]
theorem coprod_bot (l : Filter α) : l.coprod (⊥ : Filter β) = comap Prod.fst l

{α : Type u_1}
{β : Type u_2}
(l : Filter α)


theorem IsGLB.mul_left {s : Set α} (ha : 0 ≤ a) (hs : IsGLB s b) :
    IsGLB ((fun b => a * b) '' s) (a * b)

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
{s : Set α}
(ha : 0 ≤ a)
(hs : IsGLB s b)


@[simp]
theorem preimage_coe_Ioi : (some : α → WithBot α) ⁻¹' Ioi a = Ioi a


nonrec theorem IsLocalMinOn.min (hf : IsLocalMinOn f s a) (hg : IsLocalMinOn g s a) :
    IsLocalMinOn (fun x => min (f x) (g x)) s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder β]
{f g : α → β}
{a : α}
{s : Set α}
(hf : IsLocalMinOn f s a)
(hg : IsLocalMinOn g s a)


lemma isOrthogonal_comm (h : IsOrthogonal P i j) : Commute (P.reflection i) (P.reflection j)

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i j : ι)
(h : P.IsOrthogonal i j)


/-- Transport a `HasLimitsOfSize` instance across an equivalence. -/
theorem has_limits_of_equivalence (E : D ⥤ C) [E.IsEquivalence] [HasLimitsOfSize.{v, u} C] :
    HasLimitsOfSize.{v, u} D

[CategoryTheory.Limits.HasLimitsOfSize.{v, u, v₁, u₁} C]

CategoryTheory.Limits.HasLimitsOfSize.{v, u, v₂, u₂} D


@[to_additive (attr := simp)]
theorem inv_univ : (univ : Set α)⁻¹ = univ


@[simp]
lemma LinearMap.range_dualMap_dual_eq_span_singleton (f : Dual R M₁) :
    range f.dualMap = R ∙ f

{R : Type u}
[CommSemiring R]
{M₁ : Type v}
[AddCommMonoid M₁]
[Module R M₁]
(f : Module.Dual R M₁)

LinearMap.range (LinearMap.dualMap f) = Submodule.span R {f}


theorem hasPullback_of_left_iso : HasPullback f g

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


@[to_additive (attr := simp)]
theorem refl_apply (m : M) : refl M m = m


/-- When `S₁.f` and `S₂.f` are zero and we have chosen limit kernel forks `c₁` and `c₂`
for `S₁.g` and `S₂.g` respectively, the action on homology of a morphism `φ : S₁ ⟶ S₂` of
short complexes is given by the unique morphism `f : c₁.pt ⟶ c₂.pt` such that
`c₁.ι ≫ φ.τ₂ = f ≫ c₂.ι`. -/
@[simps]
def ofIsLimitKernelFork (φ : S₁ ⟶ S₂)
    (hf₁ : S₁.f = 0) (c₁ : KernelFork S₁.g) (hc₁ : IsLimit c₁)
    (hf₂ : S₂.f = 0) (c₂ : KernelFork S₂.g) (hc₂ : IsLimit c₂) (f : c₁.pt ⟶ c₂.pt)
    (comm : c₁.ι ≫ φ.τ₂ = f ≫ c₂.ι) :
    HomologyMapData φ (HomologyData.ofIsLimitKernelFork S₁ hf₁ c₁ hc₁)
      (HomologyData.ofIsLimitKernelFork S₂ hf₂ c₂ hc₂)

(c₁ : CategoryTheory.Limits.KernelFork S₁.g)

(hc₁ : CategoryTheory.Limits.IsLimit c₁)

(c₂ : CategoryTheory.Limits.KernelFork S₂.g)

(hc₂ : CategoryTheory.Limits.IsLimit c₂)

(comm :
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Fork.ι c₁) φ.τ₂ =
    CategoryTheory.CategoryStruct.comp f (CategoryTheory.Limits.Fork.ι c₂))

(CategoryTheory.ShortComplex.HomologyMapData.ofIsLimitKernelFork φ hf₁ c₁ hc₁ hf₂ c₂ hc₂ f comm).left =
  CategoryTheory.ShortComplex.LeftHomologyMapData.ofIsLimitKernelFork φ hf₁ c₁ hc₁ hf₂ c₂ hc₂ f comm


/-- The 1-hypercover of `D.glued` in the big Zariski site that is given by the
open cover `D.U` from the glue data `D`.
The "covering of the intersection of two such open subsets" is the trivial
covering given by `D.V`. -/
@[simps]
noncomputable def oneHypercover : Scheme.zariskiTopology.OneHypercover D.glued

∀ (x x_1 : D.J), D.oneHypercover.I₁ x x_1 = PUnit.{u + 1}


@[simp]
theorem minimum_of_length_pos_le_iff {b : α} (h : 0 < l.length) :
    minimum_of_length_pos h ≤ b ↔ l.minimum ≤ b

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

List.minimum_of_length_pos h ≤ b ↔ l.minimum ≤ ↑b


/-- For a functor `F : C ⥤ D` and an object `d : D`, we obtain a contravariant functor from the
category of costructured arrows `F.obj c ⟶ d` to the category of structured arrows
`op d ⟶ F.op.obj c`.
-/
@[simps]
def toStructuredArrow (F : C ⥤ D) (d : D) :
    (CostructuredArrow F d)ᵒᵖ ⥤ StructuredArrow (op d) F.op

(X : (CategoryTheory.CostructuredArrow F d)ᵒᵖ)

(CategoryTheory.CostructuredArrow.toStructuredArrow F d).obj X =
  CategoryTheory.StructuredArrow.mk (Opposite.unop X).hom.op


lemma AEval'.of_symm_X_smul (m : AEval' φ) :
    (AEval'.of φ).symm ((X : R[X]) • m) = φ ((AEval'.of φ).symm m)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(φ : M →ₗ[R] M)
(m : Module.AEval' φ)

(Module.AEval'.of φ).symm (Polynomial.X • m) = φ ((Module.AEval'.of φ).symm m)


/-- If `dist (f n) (f (n+1))` is bounded by `C * r^n`, `r < 1`, then the distance from
`f n` to the limit of `f` is bounded above by `C * r^n / (1 - r)`. -/
theorem dist_le_of_le_geometric_of_tendsto₀ {a : α} (ha : Tendsto f atTop (𝓝 a)) :
    dist (f 0) a ≤ C / (1 - r)

(hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n)

(ha : Filter.Tendsto f Filter.atTop (𝓝 a))


@[simp]
lemma mapₐ_coe (f : A →ₐ[R] B) :
    (mapₐ M Rₚ Aₚ Bₚ f : Aₚ → Bₚ) = map Bₚ f.toRingHom (algebraMapSubmonoid_le_comap M f)

[IsLocalization (Algebra.algebraMapSubmonoid A M) Aₚ]

[IsLocalization (Algebra.algebraMapSubmonoid B M) Bₚ]

⇑(IsLocalization.mapₐ M Rₚ Aₚ Bₚ f) = ⇑(IsLocalization.map Bₚ f.toRingHom ⋯)


@[simp]
theorem foldl_mul (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) (a b : CliffordAlgebra Q) :
    foldl Q f hf n (a * b) = foldl Q f hf (foldl Q f hf n a) b

((CliffordAlgebra.foldl Q f hf) n) (a * b) = ((CliffordAlgebra.foldl Q f hf) (((CliffordAlgebra.foldl Q f hf) n) a)) b


theorem toNNReal_lt_toNNReal_iff {r p : ℝ} (h : 0 < p) :
    Real.toNNReal r < Real.toNNReal p ↔ r < p


@[simp]
theorem sup_join {f₁ f₂ : Filter (Filter α)} : join f₁ ⊔ join f₂ = join (f₁ ⊔ f₂)

{α : Type u}
{f₁ f₂ : Filter (Filter α)}


theorem continuousAt_arg (h : x ∈ slitPlane) : ContinuousAt arg x


/-- We can promote a type-level `Equiv` to
an equivalence between the corresponding `discrete` categories.
-/
@[simps]
def equivalence {I : Type u₁} {J : Type u₂} (e : I ≃ J) : Discrete I ≌ Discrete J

(CategoryTheory.Discrete.equivalence e).functor = CategoryTheory.Discrete.functor (CategoryTheory.Discrete.mk ∘ ⇑e)


@[elab_as_elim]
protected theorem induction_on {M : R[T;T⁻¹] → Prop} (p : R[T;T⁻¹]) (h_C : ∀ a, M (C a))
    (h_add : ∀ {p q}, M p → M q → M (p + q))
    (h_C_mul_T : ∀ (n : ℕ) (a : R), M (C a * T n) → M (C a * T (n + 1)))
    (h_C_mul_T_Z : ∀ (n : ℕ) (a : R), M (C a * T (-n)) → M (C a * T (-n - 1))) : M p

(h_C : ∀ (a : R), M (LaurentPolynomial.C a))

(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) → M (LaurentPolynomial.C a * LaurentPolynomial.T (↑n + 1)))

(h_C_mul_T_Z :
  ∀ (n : ℕ) (a : R),
    M (LaurentPolynomial.C a * LaurentPolynomial.T (-↑n)) → M (LaurentPolynomial.C a * LaurentPolynomial.T (-↑n - 1)))


/-- `SatisfiesM` distributes over `*>`, general version. -/
protected theorem seqRight [Applicative m] [LawfulApplicative m] {x : m α}
    (hx : SatisfiesM p₁ x) (hy : SatisfiesM p₂ y)
    (H : ∀ {a b}, p₁ a → p₂ b → q b) : SatisfiesM q (x *> y)

{m : Type u_1 → Type u_2}
{α : Type u_1}
{p₁ : α → Prop}

∀ {a : Type u_1} {p₂ : a → Prop} {y : m a} {q : a → Prop} [inst : Applicative m] [inst_1 : LawfulApplicative m]
  {x : m α},
  SatisfiesM p₁ x →
    SatisfiesM p₂ y → (∀ {a_1 : α} {b : a}, p₁ a_1 → p₂ b → q b) → SatisfiesM q (SeqRight.seqRight x fun x => y)


/-- The natural transformation `S.cycles ⟶ S.leftHomology` for all short complexes `S`. -/
@[simps]
noncomputable def leftHomologyπNatTrans : cyclesFunctor C ⟶ leftHomologyFunctor C

(CategoryTheory.ShortComplex.leftHomologyπNatTrans C).app S = S.leftHomologyπ


theorem isInt_dvd_false : {a b : ℤ} → {a' b' : ℤ} →
    IsInt a a' → IsInt b b' → Int.mod b' a' != 0 → ¬a ∣ b

Mathlib.Meta.NormNum.IsInt a a' → Mathlib.Meta.NormNum.IsInt b b' → (b'.mod a' != 0) = true → ¬a ∣ b


theorem restrict_toMeasurable (h : μ s ≠ ∞) : μ.restrict (toMeasurable μ s) = μ.restrict s

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(h : μ s ≠ ⊤)

μ.restrict (MeasureTheory.toMeasurable μ s) = μ.restrict s


lemma nonsingular_of_affine_of_Z_ne_zero {P : Fin 3 → F}
    (h : W.toAffine.Nonsingular (P x / P z) (P y / P z)) (hPz : P z ≠ 0) : W.Nonsingular P

(h : W.toAffine.Nonsingular (P 0 / P 2) (P 1 / P 2))


lemma disjoint_of_subset (hs : s₁ ⊆ s₂) (ht : t₁ ⊆ t₂) (h : Disjoint s₂ t₂) : Disjoint s₁ t₁

{α : Type u}
{s₁ s₂ t₁ t₂ : Set α}
(hs : s₁ ⊆ s₂)
(ht : t₁ ⊆ t₂)
(h : Disjoint s₂ t₂)


@[simp]
theorem Prefunctor.pathStar_apply {u v : U} (p : Path u v) :
    φ.pathStar u (Quiver.PathStar.mk p) = Quiver.PathStar.mk (φ.mapPath p)

{U : Type u_1}
[Quiver U]
{V : Type u_2}
[Quiver V]
(φ : U ⥤q V)
{u v : U}
(p : Quiver.Path u v)


/-- Intuitively, a fixed point operator `fix` is lawful if it satisfies `fix f = f (fix f)` for all
`f`, but this is inconsistent / uninteresting in most cases due to the existence of "exotic"
functions `f`, such as the function that is defined iff its argument is not, familiar from the
halting problem. Instead, this requirement is limited to only functions that are `Continuous` in the
sense of `ω`-complete partial orders, which excludes the example because it is not monotone
(making the input argument less defined can make `f` more defined). -/
class LawfulFix (α : Type*) [OmegaCompletePartialOrder α] extends Fix α where
  fix_eq : ∀ {f : α →o α}, Continuous f → Fix.fix f = f (Fix.fix f)

{α : Type u_3}
[OmegaCompletePartialOrder α]
[self : LawfulFix α]
{f : α →o α}

OmegaCompletePartialOrder.Continuous f → Fix.fix ⇑f = f (Fix.fix ⇑f)


@[to_additive]
protected theorem mul_right_injective (h : IsUnit a) : Injective (a * ·)

{M : Type u_1}
[AddMonoid M]
{a : M}
(h : IsAddUnit a)


@[to_additive]
protected theorem inv [Group β] [TopologicalGroup β] (hu : ProgMeasurable f u) :
    ProgMeasurable f fun i ω => (u i ω)⁻¹

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[Preorder ι]
{u : ι → Ω → β}
{f : MeasureTheory.Filtration ι m}
[MeasurableSpace ι]
[AddGroup β]
[TopologicalAddGroup β]
(hu : MeasureTheory.ProgMeasurable f u)

MeasureTheory.ProgMeasurable f fun i ω => -u i ω


theorem eraseP_of_forall_not {l : List α} (h : ∀ a, a ∈ l → ¬p a) : l.eraseP p = l

{α : Type u_1}
{p : α → Bool}
{l : List α}
(h : ∀ (a : α), a ∈ l → ¬p a = true)


@[to_additive]
protected theorem le_mul_iff_one_le_right [MulOneClass α] [CovariantClass α α (· * ·) (· ≤ ·)]
    {a b : α} (ha : MulLECancellable a) :
    a ≤ a * b ↔ 1 ≤ b

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


/--
  If `f` returns the same output and next state for every value of it's second argument, then
  `ys : Vector` is ignored, and we can rewrite `mapAccumr₂` into `map`
-/
@[simp]
theorem mapAccumr₂_unused_input_right [Inhabited β] (f : α → β → σ → σ × γ)
    (h : ∀ a b s, f a default s = f a b s) :
    mapAccumr₂ f xs ys s = mapAccumr (fun a s => f a default s) xs s

(f : α → β → σ → σ × γ)

(h : ∀ (a : α) (b : β) (s : σ), f a default s = f a b s)

Mathlib.Vector.mapAccumr₂ f xs ys s = Mathlib.Vector.mapAccumr (fun a s => f a default s) xs s


/-- An ultrafilter is a minimal (maximal in the set order) proper filter. -/
structure Ultrafilter (α : Type*) extends Filter α where
  /-- An ultrafilter is nontrivial. -/
  protected neBot' : NeBot toFilter
  /-- If `g` is a nontrivial filter that is less than or equal to an ultrafilter, then it is greater
  than or equal to the ultrafilter. -/
  protected le_of_le : ∀ g, Filter.NeBot g → g ≤ toFilter → toFilter ≤ g


@[simp] lemma union_eq_right : s ∪ t = t ↔ s ⊆ t

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


theorem destruct_eq_pure {s : Computation α} {a : α} : destruct s = Sum.inl a → s = pure a

{α : Type u}
{s : Computation α}
{a : α}

s.destruct = Sum.inl a → s = Computation.pure a


theorem surjOn_iInter [Nonempty ι] {s : ι → Set α} {t : Set β} {f : α → β}
    (H : ∀ i, SurjOn f (s i) t) (Hinj : InjOn f (⋃ i, s i)) : SurjOn f (⋂ i, s i) t

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
[Nonempty ι]
{s : ι → Set α}
{t : Set β}
{f : α → β}
(H : ∀ (i : ι), Set.SurjOn f (s i) t)
(Hinj : Set.InjOn f (⋃ i, s i))


/-- For `fst κ a`-almost all `b`, the conditional kernel `Kernel.condKernel κ` applied to `(a, b)`
is equal to the conditional kernel of the measure `κ a` applied to `b`. -/
lemma Kernel.condKernel_apply_eq_condKernel [CountableOrCountablyGenerated α β]
    (κ : Kernel α (β × Ω)) [IsFiniteKernel κ] (a : α) :
    (fun b ↦ Kernel.condKernel κ (a, b)) =ᵐ[Kernel.fst κ a] (κ a).condKernel

(κ : ProbabilityTheory.Kernel α (β × Ω))

(fun b => κ.condKernel (a, b)) =ᵐ[κ.fst a] ⇑(κ a).condKernel


theorem kahler_ne_zero_iff (x y : E) : o.kahler x y ≠ 0 ↔ x ≠ 0 ∧ y ≠ 0

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


theorem rank_span {v : ι → M} (hv : LinearIndependent R v) :
    Module.rank R ↑(span R (range v)) = #(range v)

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
{ι : Type w}
[StrongRankCondition R]
{v : ι → M}
(hv : LinearIndependent R v)

Module.rank R ↥(Submodule.span R (Set.range v)) = #↑(Set.range v)


@[simp] theorem forM_append [Monad m] [LawfulMonad m] (l₁ l₂ : List α) (f : α → m PUnit) :
    (l₁ ++ l₂).forM f = (do l₁.forM f; l₂.forM f)

{m : Type u_1 → Type u_2}
{α : Type u_3}
[Monad m]
[LawfulMonad m]
(l₁ l₂ : List α)
(f : α → m PUnit)

(l₁ ++ l₂).forM f = do
  l₁.forM f
  l₂.forM f


lemma sqrt_mul_sqrt_lt_succ (n : ℕ) : sqrt n * sqrt n < n + 1


theorem lt_bsup {o : Ordinal.{u}} (f : ∀ a < o, Ordinal.{max u v}) {a} :
    a < bsup.{_, v} o f ↔ ∃ i hi, a < f i hi

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

a < o.bsup f ↔ ∃ i, ∃ (hi : i < o), a < f i hi


theorem le_def {x y : ONote} : x ≤ y ↔ repr x ≤ repr y


/-- Fractions which differ by a factor of the numerator can be proven equal if
those factors expand to equal elements of `R`. -/
@[to_additive "Differences whose minuends differ by a common summand can be proven equal if
those summands expand to equal elements of `R`."]
protected theorem eq_of_num_factor_eq {r r' r₁ r₂ : R} {s t : S} (h : t * r = t * r') :
    r₁ * r * r₂ /ₒ s = r₁ * r' * r₂ /ₒ s

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{r r' r₁ r₂ : R}
{s t : ↥S}
(h : ↑t * r = ↑t * r')


theorem union_def (s t : Multiset α) : s ∪ t = s - t + t

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


theorem evalWhiskerRight_cons_whisker
    {α : g ⟶ f ⊗ h} {η : h ⟶ i} {ηs : f ⊗ i ⟶ j} {k : C}
    {η₁ : h ⊗ k ⟶ i ⊗ k} {η₂ : f ⊗ (h ⊗ k) ⟶ f ⊗ (i ⊗ k)} {ηs₁ : (f ⊗ i) ⊗ k ⟶ j ⊗ k}
    {ηs₂ : f ⊗ (i ⊗ k) ⟶ j ⊗ k} {η₃ : f ⊗ (h ⊗ k) ⟶ j ⊗ k} {η₄ : (f ⊗ h) ⊗ k ⟶ j ⊗ k}
    {η₅ : g ⊗ k ⟶ j ⊗ k}
    (pf_η₁ : (𝟙 _ ≫ η ≫ 𝟙 _ ) ▷ k = η₁) (pf_η₂ : f ◁ η₁ = η₂)
    (pf_ηs₁ : ηs ▷ k = ηs₁) (pf_ηs₂ : (α_ _ _ _).inv ≫ ηs₁ = ηs₂)
    (pf_η₃ : η₂ ≫ ηs₂ = η₃) (pf_η₄ : (α_ _ _ _).hom ≫ η₃ = η₄) (pf_η₅ : α ▷ k ≫ η₄ = η₅) :
    (α ≫ (f ◁ η) ≫ ηs) ▷ k = η₅

{α : g ⟶ CategoryTheory.MonoidalCategory.tensorObj f h}

{ηs : CategoryTheory.MonoidalCategory.tensorObj f i ⟶ j}

{η₁ : CategoryTheory.MonoidalCategory.tensorObj h k ⟶ CategoryTheory.MonoidalCategory.tensorObj i k}

{η₂ :
  CategoryTheory.MonoidalCategory.tensorObj f (CategoryTheory.MonoidalCategory.tensorObj h k) ⟶
    CategoryTheory.MonoidalCategory.tensorObj f (CategoryTheory.MonoidalCategory.tensorObj i k)}

{ηs₁ :
  CategoryTheory.MonoidalCategory.tensorObj (CategoryTheory.MonoidalCategory.tensorObj f i) k ⟶
    CategoryTheory.MonoidalCategory.tensorObj j k}

{ηs₂ :
  CategoryTheory.MonoidalCategory.tensorObj f (CategoryTheory.MonoidalCategory.tensorObj i k) ⟶
    CategoryTheory.MonoidalCategory.tensorObj j k}

{η₃ :
  CategoryTheory.MonoidalCategory.tensorObj f (CategoryTheory.MonoidalCategory.tensorObj h k) ⟶
    CategoryTheory.MonoidalCategory.tensorObj j k}

{η₄ :
  CategoryTheory.MonoidalCategory.tensorObj (CategoryTheory.MonoidalCategory.tensorObj f h) k ⟶
    CategoryTheory.MonoidalCategory.tensorObj j k}

{η₅ : CategoryTheory.MonoidalCategory.tensorObj g k ⟶ CategoryTheory.MonoidalCategory.tensorObj j k}

(pf_η₁ :
  CategoryTheory.MonoidalCategory.whiskerRight
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.CategoryStruct.id h)
        (CategoryTheory.CategoryStruct.comp η (CategoryTheory.CategoryStruct.id i)))
      k =
    η₁)

(pf_η₂ : CategoryTheory.MonoidalCategory.whiskerLeft f η₁ = η₂)

(pf_ηs₁ : CategoryTheory.MonoidalCategory.whiskerRight ηs k = ηs₁)

(pf_ηs₂ : CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator f i k).inv ηs₁ = ηs₂)

(pf_η₃ : CategoryTheory.CategoryStruct.comp η₂ ηs₂ = η₃)

(pf_η₄ : CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator f h k).hom η₃ = η₄)

(pf_η₅ : CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerRight α k) η₄ = η₅)

CategoryTheory.MonoidalCategory.whiskerRight
    (CategoryTheory.CategoryStruct.comp α
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft f η) ηs))
    k =
  η₅


@[to_additive (attr := simp)]
theorem tendsto_one {a : Filter β} {f : β → α} : Tendsto f a 1 ↔ ∀ᶠ x in a, f x = 1

{α : Type u_2}
{β : Type u_3}
[Zero α]
{a : Filter β}
{f : β → α}

Filter.Tendsto f a 0 ↔ ∀ᶠ (x : β) in a, f x = 0


/-- A lax monoidal functor is a functor `F : C ⥤ D` between monoidal categories,
equipped with morphisms `ε : 𝟙 _D ⟶ F.obj (𝟙_ C)` and `μ X Y : F.obj X ⊗ F.obj Y ⟶ F.obj (X ⊗ Y)`,
satisfying the appropriate coherences. -/
structure LaxMonoidalFunctor extends C ⥤ D where
  /-- unit morphism -/
  ε : 𝟙_ D ⟶ obj (𝟙_ C)
  /-- tensorator -/
  μ : ∀ X Y : C, obj X ⊗ obj Y ⟶ obj (X ⊗ Y)
  μ_natural_left :
    ∀ {X Y : C} (f : X ⟶ Y) (X' : C),
      map f ▷ obj X' ≫ μ Y X' = μ X X' ≫ map (f ▷ X') := by
    aesop_cat
  μ_natural_right :
    ∀ {X Y : C} (X' : C) (f : X ⟶ Y) ,
      obj X' ◁ map f ≫ μ X' Y = μ X' X ≫ map (X' ◁ f) := by
    aesop_cat
  /-- associativity of the tensorator -/
  associativity :
    ∀ X Y Z : C,
      μ X Y ▷ obj Z ≫ μ (X ⊗ Y) Z ≫ map (α_ X Y Z).hom =
        (α_ (obj X) (obj Y) (obj Z)).hom ≫ obj X ◁ μ Y Z ≫ μ X (Y ⊗ Z) := by
    aesop_cat
  -- unitality
  left_unitality : ∀ X : C, (λ_ (obj X)).hom = ε ▷ obj X ≫ μ (𝟙_ C) X ≫ map (λ_ X).hom := by
    aesop_cat
  right_unitality : ∀ X : C, (ρ_ (obj X)).hom = obj X ◁ ε ≫ μ X (𝟙_ C) ≫ map (ρ_ X).hom := by
    aesop_cat

(self : CategoryTheory.LaxMonoidalFunctor C D)

(CategoryTheory.MonoidalCategory.leftUnitor (self.obj X)).hom =
  CategoryTheory.MonoidalCategory.whiskerRight self.ε (self.obj X) ≫
    self.μ (𝟙_ C) X ≫ self.map (CategoryTheory.MonoidalCategory.leftUnitor X).hom


@[to_additive (attr := simp)]
theorem coe_smul [SMul R Y] (r : R) (f : LocallyConstant X Y) : ⇑(r • f) = r • (f : X → Y)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{R : Type u_4}
[SMul R Y]
(r : R)
(f : LocallyConstant X Y)


@[simp]
theorem range_norm : range (norm : E → ℝ) = Ici 0

(E : Type u_1)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[Nontrivial E]


lemma rightHomology_ext_iff {A : C} (f₁ f₂ : A ⟶ S.rightHomology) :
    f₁ = f₂ ↔ f₁ ≫ S.rightHomologyι = f₂ ≫ S.rightHomologyι

f₁ = f₂ ↔
  CategoryTheory.CategoryStruct.comp f₁ S.rightHomologyι = CategoryTheory.CategoryStruct.comp f₂ S.rightHomologyι


@[simp]
theorem lowerBounds_insert (a : α) (s : Set α) :
    lowerBounds (insert a s) = Iic a ∩ lowerBounds s

{α : Type u}
[Preorder α]
(a : α)
(s : Set α)

lowerBounds (insert a s) = Set.Iic a ∩ lowerBounds s


theorem apply_order_ne_zero' (hp : p.order ≠ 0) : p p.order ≠ 0

{𝕜 : Type u}
{E : Type v}
{F : Type w}
[Ring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
{p : FormalMultilinearSeries 𝕜 E F}
(hp : p.order ≠ 0)


theorem Nonempty.of_sups_right : (s ⊻ t).Nonempty → t.Nonempty

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


@[to_additive]
theorem finprod_of_isEmpty [IsEmpty α] (f : α → M) : ∏ᶠ i, f i = 1

{M : Type u_2}
{α : Sort u_4}
[CommMonoid M]
[IsEmpty α]
(f : α → M)


theorem card_le_of_injective [StrongRankCondition R] {α β : Type*} [Fintype α] [Fintype β]
    (f : (α → R) →ₗ[R] β → R) (i : Injective f) : Fintype.card α ≤ Fintype.card β

(R : Type u)
[Semiring R]
[StrongRankCondition R]
{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(f : (α → R) →ₗ[R] β → R)
(i : Function.Injective ⇑f)


/--
The base of a sieve `S` is a colimit of `S` iff all Yoneda-presheaves satisfy
the sheaf condition for `S`.
-/
theorem forallYonedaIsSheaf_iff_colimit (S : Sieve X) :
    (∀ W : C, Presieve.IsSheafFor (yoneda.obj W) (S : Presieve X)) ↔
      Nonempty (IsColimit S.arrows.cocone)

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

(∀ (W : C), CategoryTheory.Presieve.IsSheafFor (CategoryTheory.yoneda.obj W) S.arrows) ↔
  Nonempty (CategoryTheory.Limits.IsColimit S.arrows.cocone)


theorem compQuasiMeasurePreserving_eq_mk (g : β →ₘ[ν] γ) (hf : QuasiMeasurePreserving f μ ν) :
    g.compQuasiMeasurePreserving f hf =
      mk (g ∘ f) (g.aestronglyMeasurable.comp_quasiMeasurePreserving hf)

(hf : MeasureTheory.Measure.QuasiMeasurePreserving f μ ν)

g.compQuasiMeasurePreserving f hf = MeasureTheory.AEEqFun.mk (↑g ∘ f) ⋯


/-- A functor is an equivalence of categories if it is faithful, full and
essentially surjective. -/
class Functor.IsEquivalence (F : C ⥤ D) : Prop where
  faithful : F.Faithful := by infer_instance
  full : F.Full := by infer_instance
  essSurj : F.EssSurj := by infer_instance

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
[self : F.IsEquivalence]


lemma AutGalois.π_apply (A : PointedGaloisObject F) (x : AutGalois F) :
    AutGalois.π F A x = x.val A

(F : CategoryTheory.Functor C FintypeCat)

(A : CategoryTheory.PreGaloisCategory.PointedGaloisObject F)

(x : CategoryTheory.PreGaloisCategory.AutGalois F)

(CategoryTheory.PreGaloisCategory.AutGalois.π F A) x = ↑x A


private theorem soln_dist_to_a_lt_deriv : ‖soln - a‖ < ‖F.derivative.eval a‖

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

‖soln_gen hnorm - a‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖


@[simp]
lemma trace_eq_zero_of_isEmpty [IsEmpty n] (A : Matrix n n R) : trace A = 0

{n : Type u_3}
{R : Type u_6}
[Fintype n]
[AddCommMonoid R]
[IsEmpty n]
(A : Matrix n n R)


@[simp]
theorem coe_mk (f : R →ₙ* S) {h₁ h₂ h₃} : (AbsoluteValue.mk f h₁ h₂ h₃ : R → S) = f

{h₃ : ∀ (x y : R), f.toFun (x + y) ≤ f.toFun x + f.toFun y}

⇑{ toMulHom := f, nonneg' := h₁, eq_zero' := h₂, add_le' := h₃ } = ⇑f


@[simp]
theorem tendsto_exp_comp_nhds_zero {f : α → ℝ} :
    Tendsto (fun x => exp (f x)) l (𝓝 0) ↔ Tendsto f l atBot

{α : Type u_1}
{l : Filter α}
{f : α → ℝ}

Filter.Tendsto (fun x => Real.exp (f x)) l (𝓝 0) ↔ Filter.Tendsto f l Filter.atBot


lemma eq_of_mul_inv_eq_one (h : a * b⁻¹ = 1) : a = b

{α : Type u_1}
[DivisionMonoid α]
{a b : α}
(h : a * b⁻¹ = 1)


@[simp] lemma add_apply (κ η : Kernel α β) (a : α) : (κ + η) a = κ a + η a

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


theorem _root_.HasCompactSupport.hasDerivAt_convolution_left [IsNegInvariant μ]
    (hcf : HasCompactSupport f₀) (hf : ContDiff 𝕜 1 f₀) (hg : LocallyIntegrable g₀ μ) (x₀ : 𝕜) :
    HasDerivAt (f₀ ⋆[L, μ] g₀) ((deriv f₀ ⋆[L, μ] g₀) x₀) x₀

(hg : MeasureTheory.LocallyIntegrable g₀ μ)

HasDerivAt (MeasureTheory.convolution f₀ g₀ L μ) (MeasureTheory.convolution (deriv f₀) g₀ L μ x₀) x₀


theorem smul_le_stoppedValue_hitting [IsFiniteMeasure μ] (hsub : Submartingale f 𝒢 μ) {ε : ℝ≥0}
    (n : ℕ) : ε • μ {ω | (ε : ℝ) ≤ (range (n + 1)).sup' nonempty_range_succ fun k => f k ω} ≤
    ENNReal.ofReal (∫ ω in {ω | (ε : ℝ) ≤ (range (n + 1)).sup' nonempty_range_succ fun k => f k ω},
      stoppedValue f (hitting f {y : ℝ | ↑ε ≤ y} 0 n) ω ∂μ)

{f : ℕ → Ω → ℝ}

(hsub : MeasureTheory.Submartingale f 𝒢 μ)

ε • μ {ω | ↑ε ≤ (Finset.range (n + 1)).sup' ⋯ fun k => f k ω} ≤
  ENNReal.ofReal
    (∫ (ω : Ω) in {ω | ↑ε ≤ (Finset.range (n + 1)).sup' ⋯ fun k => f k ω},
      MeasureTheory.stoppedValue f (MeasureTheory.hitting f {y | ↑ε ≤ y} 0 n) ω ∂μ)


theorem adhesive_of_preserves_and_reflects_isomorphism (F : C ⥤ D)
    [Adhesive D] [HasPullbacks C] [HasPushouts C]
    [PreservesLimitsOfShape WalkingCospan F]
    [PreservesColimitsOfShape WalkingSpan F]
    [F.ReflectsIsomorphisms] :
    Adhesive C


theorem forall_associated [Monoid α] {p : Associates α → Prop} :
    (∀ a, p a) ↔ ∀ a, p (Associates.mk a)

{α : Type u_1}
[Monoid α]
{p : Associates α → Prop}

(∀ (a : Associates α), p a) ↔ ∀ (a : α), p (Associates.mk a)


@[simp]
theorem le_update_self_iff : x ≤ update x i a ↔ x i ≤ a

{ι : Type u_1}
{π : ι → Type u_4}
[DecidableEq ι]
[(i : ι) → Preorder (π i)]
{x : (i : ι) → π i}
{i : ι}
{a : π i}


theorem normUnit_eq (z : ℤ) : normUnit z = if 0 ≤ z then 1 else -1


theorem partialSups_eq_biSup (f : ℕ → α) (n : ℕ) : partialSups f n = ⨆ i ≤ n, f i

{α : Type u_1}
[CompleteLattice α]
(f : ℕ → α)
(n : ℕ)

(partialSups f) n = ⨆ i, ⨆ (_ : i ≤ n), f i


theorem partialSections.nonempty [IsCofilteredOrEmpty J] [h : ∀ j : J, Nonempty (F.obj j)]
    {G : Finset J} (H : Finset (FiniteDiagramArrow G)) : (partialSections F H).Nonempty

(H : Finset (TopCat.FiniteDiagramArrow G))


theorem mem_lpMeas_iff_aeStronglyMeasurable' {m m0 : MeasurableSpace α} {μ : Measure α}
    {f : Lp F p μ} : f ∈ lpMeas F 𝕜 m p μ ↔ AEStronglyMeasurable' m f μ

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

f ∈ MeasureTheory.lpMeas F 𝕜 m p μ ↔ MeasureTheory.AEStronglyMeasurable' m (↑↑f) μ


{α : Type u_1}
[Preorder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
{a b : α}


/-- Two functors from a free groupoid to a group are equal when they agree on the generating
quiver. -/
@[ext]
theorem ext_functor {G} [Groupoid.{v} G] [IsFreeGroupoid G] {X : Type v} [Group X]
    (f g : G ⥤ CategoryTheory.SingleObj X) (h : ∀ (a b) (e : a ⟶ b), f.map (of e) = g.map (of e)) :
    f = g

(h : ∀ (a b : IsFreeGroupoid.Generators G) (e : a ⟶ b), f.map (IsFreeGroupoid.of e) = g.map (IsFreeGroupoid.of e))


@[simp]
theorem coe_copy (f : α →*₀o β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

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


theorem _root_.SimpleGraph.Preconnected.subsingleton_connectedComponent (h : G.Preconnected) :
    Subsingleton G.ConnectedComponent

{V : Type u}
{G : SimpleGraph V}
(h : G.Preconnected)


theorem algebraMap_def (r : R) :
    algebraMap R (Completion A) r = (algebraMap R A r : Completion A)

(A : Type u_2)
[Ring A]
[UniformSpace A]
[UniformAddGroup A]
[TopologicalRing A]
(R : Type u_3)
[CommSemiring R]
[Algebra R A]
[UniformContinuousConstSMul R A]
(r : R)

(algebraMap R (UniformSpace.Completion A)) r = ↑A ((algebraMap R A) r)


theorem le_maximalIdeal {J : Ideal R} (hJ : J ≠ ⊤) : J ≤ maximalIdeal R

{R : Type u_1}
[CommSemiring R]
[LocalRing R]
{J : Ideal R}
(hJ : J ≠ ⊤)


theorem eq_X_sub_C_of_splits_of_single_root {x : K} {h : K[X]} (h_splits : Splits i h)
    (h_roots : (h.map i).roots = {i x}) : h = C h.leadingCoeff * (X - C x)

(h_roots : (Polynomial.map i h).roots = {i x})

h = Polynomial.C h.leadingCoeff * (Polynomial.X - Polynomial.C x)


theorem bsup_comp {o o' : Ordinal.{max u v}} {f : ∀ a < o, Ordinal.{max u v w}}
    (hf : ∀ {i j} (hi) (hj), i ≤ j → f i hi ≤ f j hj) {g : ∀ a < o', Ordinal.{max u v}}
    (hg : blsub.{_, u} o' g = o) :
    (bsup.{_, w} o' fun a ha => f (g a ha) (by rw [← hg]; apply lt_blsub)) = bsup.{_, w} o f

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

(hf : ∀ {i j : Ordinal.{max u v}} (hi : i < o) (hj : j < o), i ≤ j → f i hi ≤ f j hj)

{g : (a : Ordinal.{max u v}) → a < o' → Ordinal.{max u v}}

(o'.bsup fun a ha => f (g a ha) ⋯) = o.bsup f


theorem integrable_pdf_smul_iff [IsFiniteMeasure ℙ] {X : Ω → E} [HasPDF X ℙ μ] {f : E → F}
    (hf : AEStronglyMeasurable f μ) :
    Integrable (fun x => (pdf X ℙ μ x).toReal • f x) μ ↔ Integrable (fun x => f (X x)) ℙ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.Integrable (fun x => (MeasureTheory.pdf X ℙ μ x).toReal • f x) μ ↔
  MeasureTheory.Integrable (fun x => f (X x)) ℙ


theorem rel_of_act_rel_act (m : M) {a b : N} (ab : r (μ m a) (μ m b)) : r a b

{M : Type u_1}
{N : Type u_2}
{μ : M → N → N}
{r : N → N → Prop}
[ContravariantClass M N μ r]
(m : M)
{a b : N}
(ab : r (μ m a) (μ m b))


theorem memℒp_const_iff {p : ℝ≥0∞} {c : E} (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    Memℒp (fun _ : α => c) p μ ↔ c = 0 ∨ μ Set.univ < ∞

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{c : E}
(hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ⊤)

MeasureTheory.Memℒp (fun x => c) p μ ↔ c = 0 ∨ μ Set.univ < ⊤


lemma quotient_inverts_homotopyEquivalences :
    (HomologicalComplex.homotopyEquivalences V c).IsInvertedBy (quotient V c)

{ι : Type u_2}
(V : Type u)
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
(c : ComplexShape ι)

(HomologicalComplex.homotopyEquivalences V c).IsInvertedBy (HomotopyCategory.quotient V c)


lemma ShortExact.moduleCat_surjective_g (hS : S.ShortExact) :
    Function.Surjective S.g

{S : CategoryTheory.ShortComplex (ModuleCat R)}


/-- If a matrix has a repeated row, the determinant will be zero. -/
theorem det_zero_of_row_eq (i_ne_j : i ≠ j) (hij : M i = M j) : M.det = 0

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{M : Matrix n n R}
{i j : n}
(i_ne_j : i ≠ j)
(hij : M i = M j)


@[to_additive]
theorem mulIndicator_preimage_of_not_mem (s : Set α) (f : α → M) {t : Set M} (ht : (1 : M) ∉ t) :
    mulIndicator s f ⁻¹' t = f ⁻¹' t ∩ s

{α : Type u_1}
{M : Type u_4}
[Zero M]
(s : Set α)
(f : α → M)
{t : Set M}
(ht : 0 ∉ t)


@[simp]
theorem sublists'_nil : sublists' (@nil α) = [[]]


@[simp]
theorem mem_pimage : b ∈ s.pimage f ↔ ∃ a ∈ s, b ∈ f a

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α →. β}
[(x : α) → Decidable (f x).Dom]
{s : Finset α}
{b : β}

b ∈ Finset.pimage f s ↔ ∃ a ∈ s, b ∈ f a


theorem le_iff_compact_le_imp {a b : α} :
    a ≤ b ↔ ∀ c : α, CompleteLattice.IsCompactElement c → c ≤ a → c ≤ b

{α : Type u_2}
[CompleteLattice α]
[IsCompactlyGenerated α]
{a b : α}

a ≤ b ↔ ∀ (c : α), CompleteLattice.IsCompactElement c → c ≤ a → c ≤ b


theorem support_sup_union_support_inf : (f ⊔ g).support ∪ (f ⊓ g).support = f.support ∪ g.support

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


@[to_additive (attr := simp, norm_cast)]
theorem coe_mul [Mul β] (f g : α →ₛ β) : ⇑(f * g) = ⇑f * ⇑g

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


lemma Absorbs.exists_pos (h : Absorbs 𝕜 A B) : ∃ r > 0, ∀ c : 𝕜, r ≤ ‖c‖ → B ⊆ c • A

{𝕜 : Type u_1}
{E : Type u_3}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
{A B : Set E}
(h : Absorbs 𝕜 A B)


theorem mapsTo_reflection_root :
    MapsTo (P.reflection i) (range P.root) (range P.root)

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i : ι)

Set.MapsTo (⇑(P.reflection i)) (Set.range ⇑P.root) (Set.range ⇑P.root)


nonrec theorem IsWF.not_lt_min (hs : IsWF s) (hn : s.Nonempty) (ha : a ∈ s) : ¬a < hs.min hn

{α : Type u_2}
[Preorder α]
{s : Set α}
{a : α}
(hs : s.IsWF)
(hn : s.Nonempty)
(ha : a ∈ s)


theorem Filter.Tendsto.cexp {l : Filter α} {f : α → ℂ} {z : ℂ} (hf : Tendsto f l (𝓝 z)) :
    Tendsto (fun x => exp (f x)) l (𝓝 (exp z))

{α : Type u_1}
{l : Filter α}
{f : α → ℂ}
{z : ℂ}
(hf : Filter.Tendsto f l (𝓝 z))

Filter.Tendsto (fun x => Complex.exp (f x)) l (𝓝 (Complex.exp z))


theorem Ico_subset_closure_interior (a b : α) : Ico a b ⊆ closure (interior (Ico a b))

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
(a b : α)

Set.Ico a b ⊆ closure (interior (Set.Ico a b))


theorem UnivLE_iff_essSurj :
    UnivLE.{max u v, v} ↔ (uliftFunctor.{u, v} : Type v ⥤ Type max u v).EssSurj

UnivLE.{max u v, v} ↔ CategoryTheory.uliftFunctor.{u, v}.EssSurj


theorem HasMFDerivAt.add (hf : HasMFDerivAt I 𝓘(𝕜, E') f z f')
    (hg : HasMFDerivAt I 𝓘(𝕜, E') g z g') : HasMFDerivAt I 𝓘(𝕜, E') (f + g) z (f' + g')

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{z : M}
{f g : M → E'}
{f' g' : TangentSpace I z →L[𝕜] E'}
(hf : HasMFDerivAt I 𝓘(𝕜, E') f z f')
(hg : HasMFDerivAt I 𝓘(𝕜, E') g z g')


theorem apply_update₂ {ι : Sort*} [DecidableEq ι] {α β γ : ι → Sort*} (f : ∀ i, α i → β i → γ i)
    (g : ∀ i, α i) (h : ∀ i, β i) (i : ι) (v : α i) (w : β i) (j : ι) :
    f j (update g i v j) (update h i w j) = update (fun k ↦ f k (g k) (h k)) i (f i v w) j

{ι : Sort u_1}
[DecidableEq ι]
{α : ι → Sort u_2}
{β : ι → Sort u_3}
{γ : ι → Sort u_4}
(f : (i : ι) → α i → β i → γ i)
(g : (i : ι) → α i)
(h : (i : ι) → β i)
(i : ι)
(v : α i)
(w : β i)
(j : ι)

f j (Function.update g i v j) (Function.update h i w j) = Function.update (fun k => f k (g k) (h k)) i (f i v w) j


theorem sbtw_iff_btw_not_btw {a b c : α} : sbtw a b c ↔ btw a b c ∧ ¬btw c b a

{α : Type u_1}
[CircularPreorder α]
{a b c : α}


theorem exists_ge_ge [LE α] [IsDirected α (· ≤ ·)] (a b : α) : ∃ c, a ≤ c ∧ b ≤ c

{α : Type u}
[LE α]
[IsDirected α fun x x_1 => x ≤ x_1]
(a b : α)


theorem sin_nat_mul_pi_sub (x : ℝ) (n : ℕ) : sin (n * π - x) = -((-1) ^ n * sin x)

Real.sin (↑n * Real.pi - x) = -((-1) ^ n * Real.sin x)


@[to_additive]
theorem IsOpen.mul_left : IsOpen t → IsOpen (s * t)

{α : Type u}
[TopologicalSpace α]
[Group α]
[ContinuousConstSMul α α]
{s t : Set α}


@[simp]
lemma reverse_mul (l m : Language α) : (l * m).reverse = m.reverse * l.reverse


theorem Prime.properDivisors {p : ℕ} (pp : p.Prime) : properDivisors p = {1}


/-- An orthonormal set in a finite-dimensional `InnerProductSpace` is maximal, if and only if it
is a basis. -/
theorem maximal_orthonormal_iff_basis_of_finiteDimensional (hv : Orthonormal 𝕜 ((↑) : v → E)) :
    (∀ u ⊇ v, Orthonormal 𝕜 ((↑) : u → E) → u = v) ↔ ∃ b : Basis v 𝕜 E, ⇑b = ((↑) : v → E)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{v : Set E}
[FiniteDimensional 𝕜 E]
(hv : Orthonormal 𝕜 Subtype.val)

(∀ u ⊇ v, Orthonormal 𝕜 Subtype.val → u = v) ↔ ∃ b, ⇑b = Subtype.val


/-- Replacing the third point by one on the same line does not change twice the oriented angle. -/
theorem _root_.Collinear.two_zsmul_oangle_eq_right {p₁ p₂ p₃ p₃' : P}
    (h : Collinear ℝ ({p₃, p₂, p₃'} : Set P)) (hp₃p₂ : p₃ ≠ p₂) (hp₃'p₂ : p₃' ≠ p₂) :
    (2 : ℤ) • ∡ p₁ p₂ p₃ = (2 : ℤ) • ∡ p₁ p₂ p₃'

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

2 • ∡ p₁ p₂ p₃ = 2 • ∡ p₁ p₂ p₃'


theorem basisDivisor_ne_zero_iff : basisDivisor x y ≠ 0 ↔ x ≠ y


@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIdIso_hom_fst :
    (pullbackDiagonalMapIdIso f g i).hom ≫ pullback.fst _ _ =
      pullback.snd _ _ ≫ pullback.fst _ _

[CategoryTheory.Limits.HasPullback (f ≫ i) (g ≫ i)]

[CategoryTheory.Limits.HasPullback (CategoryTheory.Limits.pullback.diagonal i)
    (CategoryTheory.Limits.pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯)]

(CategoryTheory.Limits.pullbackDiagonalMapIdIso f g i).hom ≫ CategoryTheory.Limits.pullback.fst f g =
  CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.diagonal i)
      (CategoryTheory.Limits.pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯) ≫
    CategoryTheory.Limits.pullback.fst (f ≫ i) (g ≫ i)


/-- A homotopy between two morphisms of short complexes `S₁ ⟶ S₂` consists of various
maps and conditions which will be sufficient to show that they induce the same morphism
in homology. -/
@[ext]
structure Homotopy where
  /-- a morphism `S₁.X₁ ⟶ S₂.X₁` -/
  h₀ : S₁.X₁ ⟶ S₂.X₁
  h₀_f : h₀ ≫ S₂.f = 0 := by aesop_cat
  /-- a morphism `S₁.X₂ ⟶ S₂.X₁` -/
  h₁ : S₁.X₂ ⟶ S₂.X₁
  /-- a morphism `S₁.X₃ ⟶ S₂.X₂` -/
  h₂ : S₁.X₃ ⟶ S₂.X₂
  /-- a morphism `S₁.X₃ ⟶ S₂.X₃` -/
  h₃ : S₁.X₃ ⟶ S₂.X₃
  g_h₃ : S₁.g ≫ h₃ = 0 := by aesop_cat
  comm₁ : φ₁.τ₁ = S₁.f ≫ h₁ + h₀ + φ₂.τ₁ := by aesop_cat
  comm₂ : φ₁.τ₂ = S₁.g ≫ h₂ + h₁ ≫ S₂.f + φ₂.τ₂ := by aesop_cat
  comm₃ : φ₁.τ₃ = h₃ + h₂ ≫ S₂.g + φ₂.τ₃ := by aesop_cat

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

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

φ₁.τ₁ = CategoryTheory.CategoryStruct.comp S₁.f self.h₁ + self.h₀ + φ₂.τ₁


/-- Any ring homomorphism into `ZMod n` has a right inverse. -/
theorem ringHom_rightInverse [Ring R] (f : R →+* ZMod n) :
    Function.RightInverse (cast : ZMod n → R) f

{n : ℕ}
{R : Type u_1}
[Ring R]
(f : R →+* ZMod n)


theorem reindex_updateColumn [DecidableEq o] [DecidableEq n] (A : Matrix m n α) (j : n) (c : m → α)
    (e : m ≃ l) (f : n ≃ o) :
    reindex e f (A.updateColumn j c) = updateColumn (reindex e f A) (f j) fun i => c (e.symm i)

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[DecidableEq o]
[DecidableEq n]
(A : Matrix m n α)
(j : n)
(c : m → α)
(e : m ≃ l)
(f : n ≃ o)

(Matrix.reindex e f) (A.updateColumn j c) = ((Matrix.reindex e f) A).updateColumn (f j) fun i => c (e.symm i)


theorem sort_perm_toList (s : Finset α) : sort r s ~ s.toList

{α : Type u_1}
(r : α → α → Prop)
[DecidableRel r]
[IsTrans α r]
[IsAntisymm α r]
[IsTotal α r]
(s : Finset α)


/-- Given an open cover `{ Xᵢ }` of `X` and an open cover `{ Yⱼ }` of `Y`, then
`X ×[Z] Y` is covered by `Xᵢ ×[Z] Yⱼ`. -/
@[simps! J obj map]
def openCoverOfLeftRight (𝒰X : X.OpenCover) (𝒰Y : Y.OpenCover) (f : X ⟶ Z) (g : Y ⟶ Z) :
    (pullback f g).OpenCover

{X Y Z : AlgebraicGeometry.Scheme}
(𝒰X : X.OpenCover)
(𝒰Y : Y.OpenCover)
(f : X ⟶ Z)
(g : Y ⟶ Z)

(AlgebraicGeometry.Scheme.Pullback.openCoverOfLeftRight 𝒰X 𝒰Y f g).J = (𝒰X.J × 𝒰Y.J)


@[simp]
theorem coe_smul (r : S) (D : Derivation R A M) : ⇑(r • D) = r • ⇑D

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


theorem upperSemicontinuousOn_iff_limsup_le {f : α → γ} :
    UpperSemicontinuousOn f s ↔ ∀ x ∈ s, limsup f (𝓝[s] x) ≤ f x

{α : Type u_1}
[TopologicalSpace α]
{s : Set α}
{γ : Type u_3}
[CompleteLinearOrder γ]
[DenselyOrdered γ]
{f : α → γ}

UpperSemicontinuousOn f s ↔ ∀ x ∈ s, Filter.limsup f (𝓝[s] x) ≤ f x


@[simp] theorem cast_addNat_right {n m m' : Nat} (i : Fin n) (h : n + m' = n + m) :
    cast h (addNat i m') = addNat i m


theorem span_invSubmonoid : Submodule.span R (invSubmonoid M S : Set S) = ⊤

{R : Type u_1}
[CommRing R]
(M : Submonoid R)
(S : Type u_2)
[CommRing S]
[Algebra R S]
[IsLocalization M S]

Submodule.span R ↑(IsLocalization.invSubmonoid M S) = ⊤


@[simp]
theorem mem_toNonUnitalSubalgebra {S : NonUnitalStarSubalgebra R A} {x} :
    x ∈ S.toNonUnitalSubalgebra ↔ x ∈ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[Star A]
{S : NonUnitalStarSubalgebra R A}
{x : A}


@[simp, norm_cast] lemma ratCast_im (q : ℚ) : (q : ℂ).im = 0


theorem coequalizer.existsUnique {W : C} (k : Y ⟶ W) (h : f ≫ k = g ≫ k) :
    ∃! d : coequalizer f g ⟶ W, coequalizer.π f g ≫ d = k

(h : CategoryTheory.CategoryStruct.comp f k = CategoryTheory.CategoryStruct.comp g k)

∃! d, CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.coequalizer.π f g) d = k


theorem leadingCoeff_smul_normalizeScaleRoots (p : R[X]) :
    p.leadingCoeff • normalizeScaleRoots p = scaleRoots p p.leadingCoeff

p.leadingCoeff • normalizeScaleRoots p = p.scaleRoots p.leadingCoeff


theorem skeletal : Skeletal SimplexCategory


/-- Precomposing `f` with `Prod.fst` is continuous -/
theorem Continuous.fst' {f : X → Z} (hf : Continuous f) : Continuous fun x : X × Y => f x.fst

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X → Z}
(hf : Continuous f)


private irreducible_def star' (hr : ∀ a b, r a b → r (star a) (star b)) : RingQuot r → RingQuot r

(hr : ∀ (a b : R), r a b → r (star a) (star b))

∀ (x : RingQuot r),
  RingQuot.star' r hr x =
    match x with
    | { toQuot := a } => { toQuot := Quot.map star ⋯ a }


theorem skewAdjoint.I_smul_neg_I (a : skewAdjoint A) : I • (skewAdjoint.negISMul a : A) = a

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]
(a : ↥(skewAdjoint A))

Complex.I • ↑(skewAdjoint.negISMul a) = ↑a


@[to_additive sum_mono_set]
theorem prod_mono_set' (f : ι → M) : Monotone fun s ↦ ∏ x ∈ s, f x

{ι : Type u_1}
{M : Type u_4}
[CanonicallyOrderedAddCommMonoid M]
(f : ι → M)


lemma OrthogonalIdempotents.isIdempotentElem_sum [Fintype I] : IsIdempotentElem (∑ i, e i)

{R : Type u_1}
[Ring R]
{I : Type u_3}
{e : I → R}
(he : OrthogonalIdempotents e)
[Fintype I]


@[to_additive]
lemma unit_mem_of_mem_ofUnits (S : Subgroup Mˣ) {x : M} {h₁ : IsUnit x}
    (h₂ : x ∈ S.ofUnits) : h₁.unit ∈ S

{M : Type u_1}
[Monoid M]
(S : Subgroup Mˣ)
{x : M}
{h₁ : IsUnit x}
(h₂ : x ∈ S.ofUnits)


@[ext 1100]
lemma ext₀ (z₁ z₂ : Cochain F G 0)
    (h : ∀ (p : ℤ), z₁.v p p (add_zero p) = z₂.v p p (add_zero p)) : z₁ = z₂

(z₁ z₂ : CochainComplex.HomComplex.Cochain F G 0)

(h : ∀ (p : ℤ), z₁.v p p ⋯ = z₂.v p p ⋯)


lemma isClosed_inter_singleton [T1Space X] {A : Set X} {a : X} : IsClosed (A ∩ {a})

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{A : Set X}
{a : X}


@[simp]
theorem preimage_coe_Icc : (some : α → WithBot α) ⁻¹' Icc a b = Icc a b

WithBot.some ⁻¹' Set.Icc ↑a ↑b = Set.Icc a b


@[simp]
theorem toFinsupp_toFreeAbelianGroup (f : X →₀ ℤ) :
    FreeAbelianGroup.toFinsupp (Finsupp.toFreeAbelianGroup f) = f


@[to_additive (attr := simp)]
theorem mem_fixedBy {m : M} {a : α} : a ∈ fixedBy α m ↔ m • a = a

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


theorem JoinedIn.refl (h : x ∈ F) : JoinedIn F x x

{X : Type u_1}
[TopologicalSpace X]
{x : X}
{F : Set X}
(h : x ∈ F)


/-- The generalized eigenspace of an eigenvalue has positive dimension for positive exponents. -/
theorem pos_finrank_genEigenspace_of_hasEigenvalue [FiniteDimensional K V] {f : End K V}
    {k : ℕ} {μ : K} (hx : f.HasEigenvalue μ) (hk : 0 < k) :
    0 < finrank K (f.genEigenspace μ k)

{K : Type v}
{V : Type w}
[Field K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{f : Module.End K V}
{k : ℕ}
{μ : K}
(hx : f.HasEigenvalue μ)
(hk : 0 < k)

0 < FiniteDimensional.finrank K ↥((f.genEigenspace μ) k)


theorem isUpperSet_empty : IsUpperSet (∅ : Set α)


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

[(i : Fin n.succ) → AddCommMonoid (M i)]

[(i : Fin n.succ) → TopologicalSpace (M i)]

f (Fin.cons (c • x) m) = c • f (Fin.cons x m)


protected theorem add_ciSup (c : Cardinal.{v}) : c + (⨆ i, f i) = ⨆ i, c + f i

{ι : Type u}
(f : ι → Cardinal.{v})
[Nonempty ι]
(hf : BddAbove (Set.range f))
(c : Cardinal.{v})


protected theorem le_mul_of_pos_left (m) (h : 0 < n) : m ≤ n * m


lemma coe_restrictScalars' (f : A →⋆ₙₐ[S] B) : (f.restrictScalars R : A → B) = f

(R : Type u_1)
{S : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Monoid R]
[Monoid S]
[Star A]
[Star B]
[NonUnitalNonAssocSemiring A]
[NonUnitalNonAssocSemiring B]
[MulAction R S]
[DistribMulAction S A]
[DistribMulAction S B]
[DistribMulAction R A]
[DistribMulAction R B]
[IsScalarTower R S A]
[IsScalarTower R S B]
(f : A →⋆ₙₐ[S] B)

⇑(NonUnitalStarAlgHom.restrictScalars R f) = ⇑f


@[to_additive]
theorem smul_mem_orbit_smul (g h : G) (a : α) : g • a ∈ orbit G (h • a)

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
(g h : G)
(a : α)


theorem sInf_le_sInf_of_subset_insert_top (h : s ⊆ insert ⊤ t) : sInf t ≤ sInf s

{α : Type u_1}
[CompleteLattice α]
{s t : Set α}
(h : s ⊆ insert ⊤ t)


@[simp]
theorem comp_assoc (f : SpectralMap γ δ) (g : SpectralMap β γ) (h : SpectralMap α β) :
    (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{δ : Type u_5}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[TopologicalSpace δ]
(f : SpectralMap γ δ)
(g : SpectralMap β γ)
(h : SpectralMap α β)


theorem map_toCotangent_ker : I.toCotangent.ker.map I.subtype = I ^ 2

Submodule.map (Submodule.subtype I) (LinearMap.ker I.toCotangent) = I ^ 2


/-- The category of binary bicones on a given diagram. -/
@[simps]
instance BinaryBicone.category {P Q : C} : Category (BinaryBicone P Q)

∀ {X Y Z : CategoryTheory.Limits.BinaryBicone P Q} (f : X ⟶ Y) (g : Y ⟶ Z), (f ≫ g).hom = f.hom ≫ g.hom


@[to_additive]
theorem mem_normalizer_iff {g : G} : g ∈ H.normalizer ↔ ∀ h, h ∈ H ↔ g * h * g⁻¹ ∈ H

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
{g : G}

g ∈ H.normalizer ↔ ∀ (h : G), h ∈ H ↔ g + h + -g ∈ H


@[simp]
theorem withConstants_relMap_sum_inl [L[[α]].Structure M] [(lhomWithConstants L α).IsExpansionOn M]
    {n} {R : L.Relations n} {x : Fin n → M} : @RelMap (L[[α]]) M _ n (Sum.inl R) x = RelMap R x

FirstOrder.Language.Structure.RelMap (Sum.inl R) x = FirstOrder.Language.Structure.RelMap R x


theorem inv_pow_anti (a1 : 1 ≤ a) : Antitone fun n : ℕ => (a ^ n)⁻¹

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}
(a1 : 1 ≤ a)


lemma map_eq_mapOfHomotopy : map φ₁ φ₂ a b comm = mapOfHomotopy (Homotopy.ofEq comm)

(φ₁ : K₁ ⟶ L₁)

(φ₂ : K₂ ⟶ L₂)

CochainComplex.mappingCone.map φ₁ φ₂ a b comm = CochainComplex.mappingCone.mapOfHomotopy (Homotopy.ofEq comm)


theorem sub_eq (p₁ p₂ : Pos) : p₁ - p₂ = ⟨p₁.byteIdx - p₂.byteIdx⟩

p₁ - p₂ = { byteIdx := p₁.byteIdx - p₂.byteIdx }


theorem sup_le_of_range_subset {ι ι'} {f : ι → Ordinal} {g : ι' → Ordinal}
    (h : Set.range f ⊆ Set.range g) : sup.{u, max v w} f ≤ sup.{v, max u w} g

{ι : Type u}
{ι' : Type v}
{f : ι → Ordinal.{max (max u v) w}}
{g : ι' → Ordinal.{max (max u v) w}}
(h : Set.range f ⊆ Set.range g)


theorem IsUniform.mono {ε ε' : 𝕜} (hP : P.IsUniform G ε) (h : ε ≤ ε') : P.IsUniform G ε'

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
{P : Finpartition A}
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε ε' : 𝕜}
(hP : P.IsUniform G ε)
(h : ε ≤ ε')


theorem add_pf_add_lt (a₁ : R) (_ : a₂ + b = c) : (a₁ + a₂) + b = a₁ + c

{R : Type u_1}
[CommSemiring R]
{a₂ b c : R}
(a₁ : R)


theorem MeasureTheory.AEStronglyMeasurable.prod_mk_left {γ : Type*} [SFinite ν]
    [TopologicalSpace γ] {f : α × β → γ} (hf : AEStronglyMeasurable f (μ.prod ν)) :
    ∀ᵐ x ∂μ, AEStronglyMeasurable (fun y => f (x, y)) ν

{f : α × β → γ}

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

∀ᵐ (x : α) ∂μ, MeasureTheory.AEStronglyMeasurable (fun y => f (x, y)) ν


theorem mkQ_surjective (A : Submodule R M) : Function.Surjective A.mkQ

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(A : Submodule R M)


theorem Nodup.filter (p : α → Bool) {l} : Nodup l → Nodup (filter p l)

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


theorem UniqueMDiffWithinAt.inter' (hs : UniqueMDiffWithinAt I s x) (ht : t ∈ 𝓝[s] x) :
    UniqueMDiffWithinAt I (s ∩ t) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{x : M}
{s t : Set M}
(hs : UniqueMDiffWithinAt I s x)
(ht : t ∈ 𝓝[s] x)


theorem cast_comm (r : ℚ) (a : α) : (r : α) * a = a * r

{α : Type u_3}
[DivisionRing α]
(r : ℚ)
(a : α)


/-- Bundle `Finsupp.embDomain f` as an additive map from `α →₀ M` to `β →₀ M`. -/
@[simps]
def embDomain.addMonoidHom (f : α ↪ β) : (α →₀ M) →+ β →₀ M

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddZeroClass M]
(f : α ↪ β)
(v : α →₀ M)

(Finsupp.embDomain.addMonoidHom f) v = Finsupp.embDomain f v


theorem toList_ofList (l : List α) : l ∈ toList (ofList l)


theorem exp_1_approx_succ_eq {n} {a₁ b₁ : ℝ} {m : ℕ} (en : n + 1 = m) {rm : ℝ} (er : ↑m = rm)
    (h : |exp 1 - expNear m 1 ((a₁ - 1) * rm)| ≤ |1| ^ m / m.factorial * (b₁ * rm)) :
    |exp 1 - expNear n 1 a₁| ≤ |1| ^ n / n.factorial * b₁

(h : |Real.exp 1 - Real.expNear m 1 ((a₁ - 1) * rm)| ≤ |1| ^ m / ↑m.factorial * (b₁ * rm))

|Real.exp 1 - Real.expNear n 1 a₁| ≤ |1| ^ n / ↑n.factorial * b₁


/-- The cartesian product of two equivalences of categories. -/
@[simps]
def prod (E₁ : A ≌ B) (E₂ : C ≌ D) : A × C ≌ B × D

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

(E₁.prod E₂).unitIso = CategoryTheory.NatIso.prod E₁.unitIso E₂.unitIso


lemma himp_ne_himp_iff : b ⇨ a ≠ a ⇨ b ↔ a ≠ b

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


/-- The constant factor occurring in the conclusion of `eLpNorm_le_eLpNorm_fderiv_of_eq`.
It only depends on `E`, `F`, `μ` and `p`. -/
irreducible_def SNormLESNormFDerivOfEqConst [FiniteDimensional ℝ F] (p : ℝ) : ℝ≥0

(F : Type u_6)
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{E : Type u_7}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
[FiniteDimensional ℝ F]
(p : ℝ)

MeasureTheory.SNormLESNormFDerivOfEqConst F μ p =
  let F' := EuclideanSpace ℝ (Fin (FiniteDimensional.finrank ℝ F));
  let e := toEuclidean;
  ‖↑e.symm‖₊ * MeasureTheory.eLpNormLESNormFDerivOfEqInnerConst μ p * ‖↑e‖₊


/-- Nonzero fractional ideals contain a nonzero integer. -/
theorem exists_ne_zero_mem_isInteger [Nontrivial R] (hI : I ≠ 0) :
    ∃ x, x ≠ 0 ∧ algebraMap R K x ∈ I

{R : Type u_1}
[CommRing R]
{K : Type u_3}
[Field K]
[Algebra R K]
[IsFractionRing R K]
{I : FractionalIdeal R⁰ K}
[Nontrivial R]
(hI : I ≠ 0)


theorem preVal_mul {x y : ModP K v O hv p} (hxy0 : x * y ≠ 0) :
    preVal K v O hv p (x * y) = preVal K v O hv p x * preVal K v O hv p y

{K : Type u₁}
[Field K]
{v : Valuation K ℝ≥0}
{O : Type u₂}
[CommRing O]
[Algebra O K]
{hv : v.Integers O}
{p : ℕ}
{x y : ModP K v O hv p}
(hxy0 : x * y ≠ 0)

ModP.preVal K v O hv p (x * y) = ModP.preVal K v O hv p x * ModP.preVal K v O hv p y


/-- If the restriction to a set `s` of a σ-algebra `m` is included in the restriction to `s` of
another σ-algebra `m₂` (hypothesis `hs`), the set `s` is `m` measurable and a function `f` almost
everywhere supported on `s` is `m`-ae-strongly-measurable, then `f` is also
`m₂`-ae-strongly-measurable. -/
theorem AEStronglyMeasurable'.aeStronglyMeasurable'_of_measurableSpace_le_on {α E}
    {m m₂ m0 : MeasurableSpace α} {μ : Measure α} [TopologicalSpace E] [Zero E] (hm : m ≤ m0)
    {s : Set α} {f : α → E} (hs_m : MeasurableSet[m] s)
    (hs : ∀ t, MeasurableSet[m] (s ∩ t) → MeasurableSet[m₂] (s ∩ t))
    (hf : AEStronglyMeasurable' m f μ) (hf_zero : f =ᵐ[μ.restrict sᶜ] 0) :
    AEStronglyMeasurable' m₂ f μ

(hs : ∀ (t : Set α), MeasurableSet (s ∩ t) → MeasurableSet (s ∩ t))

(hf : MeasureTheory.AEStronglyMeasurable' m f μ)

MeasureTheory.AEStronglyMeasurable' m₂ f μ


@[simp]
theorem gramSchmidt_zero {ι : Type*} [LinearOrder ι] [LocallyFiniteOrder ι] [OrderBot ι]
    [IsWellOrder ι (· < ·)] (f : ι → E) : gramSchmidt 𝕜 f ⊥ = f ⊥

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
[LinearOrder ι]
[LocallyFiniteOrder ι]
[OrderBot ι]
[IsWellOrder ι fun x x_1 => x < x_1]
(f : ι → E)


@[to_additive (attr := simp) pi_nnnorm_const]
lemma pi_nnnorm_const' [Nonempty ι] (a : E) : ‖fun _i : ι => a‖₊ = ‖a‖₊

{ι : Type u_1}
{E : Type u_2}
[Fintype ι]
[SeminormedGroup E]
[Nonempty ι]
(a : E)


/-- Two open immersions with equal range is isomorphic. -/
@[simps]
def isoOfRangeEq [IsOpenImmersion g] (e : Set.range f.base = Set.range g.base) : X ≅ Y

{X Y Z : AlgebraicGeometry.PresheafedSpace C}

[hf : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]

(e : Set.range ⇑f.base = Set.range ⇑g.base)

(AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.isoOfRangeEq f g e).hom =
  AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.lift g f ⋯


@[to_additive]
theorem singleton_one : ({1} : Finset α) = 1


theorem coe_add_get {x : ℕ} {y : PartENat} (h : ((x : PartENat) + y).Dom) :
    get ((x : PartENat) + y) h = x + get y h.2

{x : ℕ}
{y : PartENat}
(h : (↑x + y).Dom)


@[to_additive (attr := simp)] lemma mulEnergy_empty_right : Eₘ[s, ∅] = 0

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


theorem compProdFun_tsum_right (κ : Kernel α β) (η : Kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
    (hs : MeasurableSet s) : compProdFun κ η a s = ∑' n, compProdFun κ (seq η n) a s

(η : ProbabilityTheory.Kernel (α × β) γ)

κ.compProdFun η a s = ∑' (n : ℕ), κ.compProdFun (η.seq n) a s


lemma cfcₙ_id' : cfcₙ (fun x : R ↦ x) a = a


/-- Coefficients of a product of power series -/
theorem coeff_prod [DecidableEq σ]
    (f : ι → MvPowerSeries σ R) (d : σ →₀ ℕ) (s : Finset ι) :
    coeff R d (∏ j ∈ s, f j) =
      ∑ l ∈ finsuppAntidiag s d,
        ∏ i ∈ s, coeff R (l i) (f i)

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
{ι : Type u_4}
[DecidableEq ι]
[DecidableEq σ]
(f : ι → MvPowerSeries σ R)
(d : σ →₀ ℕ)
(s : Finset ι)

(MvPowerSeries.coeff R d) (∏ j ∈ s, f j) = ∑ l ∈ s.finsuppAntidiag d, ∏ i ∈ s, (MvPowerSeries.coeff R (l i)) (f i)


@[simp] lemma convexHull_pi (s : Set ι) (t : Π i, Set (E i)) :
    convexHull 𝕜 (s.pi t) = s.pi (fun i ↦ convexHull 𝕜 (t i))

{𝕜 : Type u_1}
{ι : Type u_2}
{E : ι → Type u_3}
[Finite ι]
[LinearOrderedField 𝕜]
[(i : ι) → AddCommGroup (E i)]
[(i : ι) → Module 𝕜 (E i)]
(s : Set ι)
(t : (i : ι) → Set (E i))

(convexHull 𝕜) (s.pi t) = s.pi fun i => (convexHull 𝕜) (t i)


@[aesop safe apply]
lemma max_bi_le {b : α → ℝ} (i : α) : b i ≤ b (max_bi b)

{α : Type u_1}
[Finite α]
[Nonempty α]
{b : α → ℝ}
(i : α)


/-- Left-multiplication by a nonzero element of a topological division ring is proper, i.e.,
inverse images of compact sets are compact. -/
theorem Filter.tendsto_cocompact_mul_left₀ [ContinuousMul K] {a : K} (ha : a ≠ 0) :
    Filter.Tendsto (fun x : K => a * x) (Filter.cocompact K) (Filter.cocompact K)

{K : Type u_1}
[DivisionRing K]
[TopologicalSpace K]
[ContinuousMul K]
{a : K}
(ha : a ≠ 0)

Filter.Tendsto (fun x => a * x) (Filter.cocompact K) (Filter.cocompact K)


theorem mem_nhds_iff : s ∈ 𝓝 x ↔ ∃ ε > 0, ball x ε ⊆ s

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


/-- An equivalence of categories induces an equivalences between the respective categories
of homological complex.
-/
@[simps]
def Equivalence.mapHomologicalComplex (e : W₁ ≌ W₂) [e.functor.PreservesZeroMorphisms]
    (c : ComplexShape ι) :
    HomologicalComplex W₁ c ≌ HomologicalComplex W₂ c

(e.mapHomologicalComplex c).unitIso =
  (CategoryTheory.Functor.mapHomologicalComplexIdIso W₁ c).symm ≪≫
    CategoryTheory.NatIso.mapHomologicalComplex e.unitIso c


@[to_additive]
theorem MulHom.cancel_right [Mul M] [Mul N] [Mul P] {g₁ g₂ : N →ₙ* P} {f : M →ₙ* N}
    (hf : Function.Surjective f) : g₁.comp f = g₂.comp f ↔ g₁ = g₂

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[Add M]
[Add N]
[Add P]
{g₁ g₂ : AddHom N P}
{f : AddHom M N}
(hf : Function.Surjective ⇑f)


@[simp]
theorem mapAccumr_snoc :
    mapAccumr f (xs.snoc x) s
    = let q := f x s
      let r := mapAccumr f xs q.1
      (r.1, r.2.snoc q.2)

{α : Type u_2}
{n : ℕ}
(xs : Mathlib.Vector α n)

∀ {α_1 : Type} {β : Type u_1} {f : α → α_1 → α_1 × β} {x : α} {s : α_1},
  Mathlib.Vector.mapAccumr f (xs.snoc x) s =
    let q := f x s;
    let r := Mathlib.Vector.mapAccumr f xs q.1;
    (r.1, r.2.snoc q.2)


/--
  If there is a set of states that is closed under `f`, and such that `f` produces that same output
  for all states in this set, then the state is not actually needed.
  Hence, then we can rewrite `mapAccumr₂` into just `map₂`
-/
theorem mapAccumr₂_eq_map₂ {f : α → β → σ → σ × γ} {s₀ : σ} (S : Set σ) (h₀ : s₀ ∈ S)
    (closure : ∀ a b s, s ∈ S → (f a b s).1 ∈ S)
    (out : ∀ a b s s', s ∈ S → s' ∈ S → (f a b s).2 = (f a b s').2) :
    (mapAccumr₂ f xs ys s₀).snd = map₂ (f · · s₀ |>.snd) xs ys

{f : α → β → σ → σ × γ}

(closure : ∀ (a : α) (b : β), ∀ s ∈ S, (f a b s).1 ∈ S)

(out : ∀ (a : α) (b : β) (s s' : σ), s ∈ S → s' ∈ S → (f a b s).2 = (f a b s').2)

(Mathlib.Vector.mapAccumr₂ f xs ys s₀).2 = Mathlib.Vector.map₂ (fun x x_1 => (f x x_1 s₀).2) xs ys


lemma mul_nat_lit_eq_nsmul [n.AtLeastTwo] : r * no_index (OfNat.ofNat n) = n • r

{R : Type u_1}
[NonAssocSemiring R]
(r : R)
(n : ℕ)
[n.AtLeastTwo]


@[simp]
lemma reverse_zero : (0 : Language α).reverse = 0


lemma KaehlerDifferential.mvPolynomialBasis_repr_D (σ) (x) :
    (mvPolynomialBasis R σ).repr (D _ _ x) =
      MvPolynomial.mkDerivation R (Finsupp.single · (1 : MvPolynomial σ R)) x

(R : Type u)
[CommRing R]
(σ : Type u_1)
(x : MvPolynomial σ R)

(KaehlerDifferential.mvPolynomialBasis R σ).repr ((KaehlerDifferential.D R (MvPolynomial σ R)) x) =
  (MvPolynomial.mkDerivation R fun x => Finsupp.single x 1) x


theorem le_kernelSubobject (A : Subobject X) (h : A.arrow ≫ f = 0) : A ≤ kernelSubobject f

A ≤ CategoryTheory.Limits.kernelSubobject f


@[ext]
theorem ext (H : ∀ a, D1 a = D2 a) : D1 = D2

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
{D1 D2 : Derivation R A M}
(H : ∀ (a : A), D1 a = D2 a)


/-- Reformulation of equicontinuity at `x₀` comparing two variables near `x₀` instead of comparing
only one with `x₀`. -/
theorem equicontinuousAt_iff_pair {F : ι → X → α} {x₀ : X} :
    EquicontinuousAt F x₀ ↔
      ∀ U ∈ 𝓤 α, ∃ V ∈ 𝓝 x₀, ∀ x ∈ V, ∀ y ∈ V, ∀ i, (F i x, F i y) ∈ U

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

EquicontinuousAt F x₀ ↔ ∀ U ∈ uniformity α, ∃ V ∈ nhds x₀, ∀ x ∈ V, ∀ y ∈ V, ∀ (i : ι), (F i x, F i y) ∈ U


theorem basisDivisor_self : basisDivisor x x = 0


@[simp]
theorem inclusion_inclusion {S T U : NonUnitalSubalgebra R A} (hst : S ≤ T) (htu : T ≤ U) (x : S) :
    inclusion htu (inclusion hst x) = inclusion (le_trans hst htu) x

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{S T U : NonUnitalSubalgebra R A}
(hst : S ≤ T)
(htu : T ≤ U)
(x : ↥S)

(NonUnitalSubalgebra.inclusion htu) ((NonUnitalSubalgebra.inclusion hst) x) = (NonUnitalSubalgebra.inclusion ⋯) x


@[simp]
theorem comapDomain'_single [DecidableEq ι] [DecidableEq κ] [∀ i, Zero (β i)] (h : κ → ι)
    {h' : ι → κ} (hh' : Function.LeftInverse h' h) (k : κ) (x : β (h k)) :
    comapDomain' h hh' (single (h k) x) = single k x

{ι : Type u}
{β : ι → Type v}
{κ : Type u_1}
[DecidableEq ι]
[DecidableEq κ]
[(i : ι) → Zero (β i)]
(h : κ → ι)
{h' : ι → κ}
(hh' : Function.LeftInverse h' h)
(k : κ)
(x : β (h k))

DFinsupp.comapDomain' h hh' (DFinsupp.single (h k) x) = DFinsupp.single k x


theorem Fin.ne_of_val_ne {n} {i j : Fin n} (h : Not (Eq i.val j.val)) : Not (Eq i j)


@[fun_prop]
theorem Continuous.continuousOn {f : α → β} {s : Set α} (h : Continuous f) : ContinuousOn f s

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
(h : Continuous f)


theorem le_of_not_lt {a b : α} (h : ¬b < a) : a ≤ b

{α : Type u}
[LinearOrder α]
{a b : α}
(h : ¬b < a)


@[to_additive]
theorem Isometry.norm_map_of_map_one {f : E → F} (hi : Isometry f) (h₁ : f 1 = 1) (x : E) :
    ‖f x‖ = ‖x‖

{E : Type u_3}
{F : Type u_4}
[SeminormedAddGroup E]
[SeminormedAddGroup F]
{f : E → F}
(hi : Isometry f)
(h₁ : f 0 = 0)
(x : E)


@[simp, mfld_simps]
theorem tangentMap_proj {p : TangentBundle I M} : (tangentMap I I' f p).proj = f p.proj

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
[Is : SmoothManifoldWithCorners I M]
[I's : SmoothManifoldWithCorners I' M']
{p : TangentBundle I M}


@[simp]
theorem mul_right_self_sup : I * J ⊔ I = I

{R : Type u}
[CommSemiring R]
{I J : Ideal R}


/-- The Yoneda embedding for `R`-linear categories `C`,
sending an object `Y : Cᵒᵖ` to the `Module R`-valued copresheaf on `C`,
with value on `X : C` given by `Module.of R (unop Y ⟶ X)`. -/
@[simps]
def linearCoyoneda : Cᵒᵖ ⥤ C ⥤ ModuleCat R

(R : Type w)
[Ring R]
(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]
(Y : Cᵒᵖ)
(X : C)

((CategoryTheory.linearCoyoneda R C).obj Y).obj X = ModuleCat.of R (Opposite.unop Y ⟶ X)


theorem comp_map {π : P →+* R} (m : PerfectionMap p π) {σ : Q →+* S} (n : PerfectionMap p σ)
    (φ : R →+* S) : σ.comp (map p m n φ) = φ.comp π

(p : ℕ)
[Fact (Nat.Prime p)]
{R : Type u₁}
[CommSemiring R]
[CharP R p]
{P : Type u₃}
[CommSemiring P]
[CharP P p]
[PerfectRing P p]
{S : Type u₂}
[CommSemiring S]
[CharP S p]
{Q : Type u₄}
[CommSemiring Q]
[CharP Q p]
[PerfectRing Q p]
{π : P →+* R}
(m : PerfectionMap p π)
{σ : Q →+* S}
(n : PerfectionMap p σ)
(φ : R →+* S)

σ.comp (PerfectionMap.map p m n φ) = φ.comp π


/-- Balls at the origin are absorbent. -/
theorem absorbent_ball_zero (hr : 0 < r) : Absorbent 𝕜 (Metric.ball (0 : E) r)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
{r : ℝ}
(hr : 0 < r)


theorem Integrable.indicator (h : Integrable f μ) (hs : MeasurableSet s) :
    Integrable (indicator s f) μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{s : Set α}
{μ : MeasureTheory.Measure α}
(h : MeasureTheory.Integrable f μ)
(hs : MeasurableSet s)

MeasureTheory.Integrable (s.indicator f) μ


@[reassoc (attr := simp)]
theorem inl_comp_pushoutSymmetry_hom [HasPushout f g] :
    pushout.inl _ _ ≫ (pushoutSymmetry f g).hom = pushout.inr _ _

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

CategoryTheory.Limits.pushout.inl f g ≫ (CategoryTheory.Limits.pushoutSymmetry f g).hom =
  CategoryTheory.Limits.pushout.inr g f


theorem card_Iio : (Iio f).card = (∏ i ∈ f.support, (Iic (f i)).card) - 1

[(i : ι) → CanonicallyOrderedAddCommMonoid (α i)]

(Finset.Iio f).card = ∏ i ∈ f.support, (Finset.Iic (f i)).card - 1


/-- Given a functor `F : C₁ ⥤ C₂ ⥤ D`, this is the bifunctor which sends
`K₁ : HomologicalComplex C₁ c₁` and `K₂ : HomologicalComplex C₂ c₂` to the bicomplex
which is degree `(i₁, i₂)` consists of `(F.obj (K₁.X i₁)).obj (K₂.X i₂)`. -/
@[simps! obj_obj_X_X obj_obj_X_d obj_obj_d_f obj_map_f_f map_app_f_f]
def mapBifunctorHomologicalComplex :
    HomologicalComplex C₁ c₁ ⥤ HomologicalComplex C₂ c₂ ⥤ HomologicalComplex₂ D c₁ c₂

[∀ (X₁ : C₁), (F.obj X₁).PreservesZeroMorphisms]

((((F.mapBifunctorHomologicalComplex c₁ c₂).obj K₁).obj K₂).d i₁ i₁').f i₂ = (F.map (K₁.d i₁ i₁')).app (K₂.X i₂)


lemma Module.support_of_noZeroSMulDivisors [NoZeroSMulDivisors R M] [Nontrivial M] :
    Module.support R M = Set.univ

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


theorem HasFiniteFPowerSeriesOnBall.bound_zero_of_eq_zero (hf : ∀ y ∈ EMetric.ball x r, f y = 0)
    (r_pos : 0 < r) (hp : ∀ n, p n = 0) : HasFiniteFPowerSeriesOnBall f p x 0 r

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
(hf : ∀ y ∈ EMetric.ball x r, f y = 0)
(r_pos : 0 < r)
(hp : ∀ (n : ℕ), p n = 0)


/-- Tensor product of two bimodule objects as a bimodule object. -/
@[simps]
noncomputable def tensorBimod {X Y Z : Mon_ C} (M : Bimod X Y) (N : Bimod Y Z) : Bimod X Z

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁} (CategoryTheory.MonoidalCategory.tensorLeft X)]

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁}
      (CategoryTheory.MonoidalCategory.tensorRight X)]

(M.tensorBimod N).actLeft = Bimod.TensorBimod.actLeft M N


theorem radius_eq_top_of_eventually_eq_zero (h : ∀ᶠ n in atTop, p n = 0) : p.radius = ∞

(h : ∀ᶠ (n : ℕ) in Filter.atTop, p n = 0)


/-- Differentiation under integral of `x ↦ ∫ x in a..b, F x a` at a given point `x₀`, assuming
`F x₀` is integrable on `(a,b)`, `x ↦ F x a` is differentiable on a ball around `x₀` for ae `a` with
derivative norm uniformly bounded by an integrable function (the ball radius is independent of `a`),
and `F x` is ae-measurable for `x` in a possibly smaller neighborhood of `x₀`. -/
theorem hasFDerivAt_integral_of_dominated_of_fderiv_le'' [NormedSpace ℝ H] {μ : Measure ℝ}
    {F : H → ℝ → E} {F' : H → ℝ → H →L[ℝ] E} {a b : ℝ} {bound : ℝ → ℝ} (ε_pos : 0 < ε)
    (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) <| μ.restrict (Ι a b))
    (hF_int : IntervalIntegrable (F x₀) μ a b)
    (hF'_meas : AEStronglyMeasurable (F' x₀) <| μ.restrict (Ι a b))
    (h_bound : ∀ᵐ t ∂μ.restrict (Ι a b), ∀ x ∈ ball x₀ ε, ‖F' x t‖ ≤ bound t)
    (bound_integrable : IntervalIntegrable bound μ a b)
    (h_diff : ∀ᵐ t ∂μ.restrict (Ι a b), ∀ x ∈ ball x₀ ε, HasFDerivAt (F · t) (F' x t) x) :
    HasFDerivAt (fun x ↦ ∫ t in a..b, F x t ∂μ) (∫ t in a..b, F' x₀ t ∂μ) x₀

(hF_meas : ∀ᶠ (x : H) in 𝓝 x₀, MeasureTheory.AEStronglyMeasurable (F x) (μ.restrict (Ι a b)))

(hF'_meas : MeasureTheory.AEStronglyMeasurable (F' x₀) (μ.restrict (Ι a b)))

(h_bound : ∀ᵐ (t : ℝ) ∂μ.restrict (Ι a b), ∀ x ∈ Metric.ball x₀ ε, ‖F' x t‖ ≤ bound t)

(h_diff : ∀ᵐ (t : ℝ) ∂μ.restrict (Ι a b), ∀ x ∈ Metric.ball x₀ ε, HasFDerivAt (fun x => F x t) (F' x t) x)

HasFDerivAt (fun x => ∫ (t : ℝ) in a..b, F x t ∂μ) (∫ (t : ℝ) in a..b, F' x₀ t ∂μ) x₀


theorem lift_rank_range_add_rank_ker (f : M →ₗ[R] M') :
    lift.{u} (Module.rank R (LinearMap.range f)) + lift.{v} (Module.rank R (LinearMap.ker f)) =
      lift.{v} (Module.rank R M)

{R : Type u_1}
{M : Type u}
{M' : Type v}
[Ring R]
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
[HasRankNullity.{u, u_1} R]
(f : M →ₗ[R] M')

Cardinal.lift.{u, v} (Module.rank R ↥(LinearMap.range f)) + Cardinal.lift.{v, u} (Module.rank R ↥(LinearMap.ker f)) =
  Cardinal.lift.{v, u} (Module.rank R M)


@[simp]
theorem mem_one {x : R} : x ∈ (1 : AddSubmonoid R) ↔ ∃ n : ℕ, ↑n = x

{R : Type u_4}
[AddMonoidWithOne R]
{x : R}


theorem ack_add_one_sq_lt_ack_add_three : ∀ m n, (ack m n + 1) ^ 2 ≤ ack (m + 3) n


@[continuity]
protected theorem continuous : Continuous I

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


theorem IsRefl.swap (r) [IsRefl α r] : IsRefl α (swap r)

{α : Type u}
(r : α → α → Prop)
[IsRefl α r]


@[simp]
theorem coeff_succ_C {a : R} {n : ℕ} : coeff R (n + 1) (C R a) = 0

{R : Type u_1}
[Semiring R]
{a : R}
{n : ℕ}

(PowerSeries.coeff R (n + 1)) ((PowerSeries.C R) a) = 0


/-- The prime divisors of the characteristic of a finite commutative ring are exactly
the prime divisors of its cardinality. -/
theorem prime_dvd_char_iff_dvd_card {R : Type*} [CommRing R] [Fintype R] (p : ℕ) [Fact p.Prime] :
    p ∣ ringChar R ↔ p ∣ Fintype.card R

{R : Type u_1}
[CommRing R]
[Fintype R]
(p : ℕ)
[Fact (Nat.Prime p)]


@[simp]
theorem imaginaryPart_I_smul (a : A) : ℑ (I • a) = ℜ a

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

imaginaryPart (Complex.I • a) = realPart a


@[to_additive]
theorem Subgroup.isClosed_topologicalClosure (s : Subgroup G) :
    IsClosed (s.topologicalClosure : Set G)

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
(s : Subgroup G)


lemma AntivaryOn.mul_right₀ (hg₁ : ∀ i ∈ s, 0 ≤ g₁ i) (hg₂ : ∀ i ∈ s, 0 ≤ g₂ i)
    (h₁ : AntivaryOn f g₁ s) (h₂ : AntivaryOn f g₂ s) : AntivaryOn f (g₁ * g₂) s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemiring α]
[LinearOrderedSemiring β]
{s : Set ι}
{f : ι → α}
{g₁ g₂ : ι → β}
(hg₁ : ∀ i ∈ s, 0 ≤ g₁ i)
(hg₂ : ∀ i ∈ s, 0 ≤ g₂ i)
(h₁ : AntivaryOn f g₁ s)
(h₂ : AntivaryOn f g₂ s)


lemma exists_eq_one {x : V} (hx : x ≠ 0) :
    ∃ f : V →L[R] R, f x = 1

{R : Type u_1}
{V : Type u_2}
[Field R]
[AddCommGroup V]
[TopologicalSpace R]
[TopologicalSpace V]
[TopologicalRing R]
[Module R V]
[SeparatingDual R V]
{x : V}
(hx : x ≠ 0)


@[to_additive (attr := simp)]
theorem relindex_bot_right : H.relindex ⊥ = 1

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


theorem subNatNat_sub (h : n ≤ m) (k : Nat) : subNatNat (m - n) k = subNatNat m (k + n)

Int.subNatNat (m - n) k = Int.subNatNat m (k + n)


/-- If `f : R → ℝ` is a nonnegative, multiplicatively bounded function, then
  `seminormFromBounded' f` is submultiplicative. -/
theorem seminormFromBounded_mul (f_nonneg : 0 ≤ f)
    (f_mul : ∀ x y : R, f (x * y) ≤ c * f x * f y) (x y : R) :
    seminormFromBounded' f (x * y) ≤ seminormFromBounded' f x * seminormFromBounded' f y

(f_mul : ∀ (x y : R), f (x * y) ≤ c * f x * f y)


/-- The homology isomorphism `S₁.homology ⟶ S₂.homology` induced by an isomorphism
`S₁ ≅ S₂` of short complexes. -/
@[simps]
noncomputable def homologyMapIso (e : S₁ ≅ S₂) [S₁.HasHomology]
    [S₂.HasHomology] : S₁.homology ≅ S₂.homology

(CategoryTheory.ShortComplex.homologyMapIso e).inv = CategoryTheory.ShortComplex.homologyMap e.inv


@[simp]
theorem div2_bit (b n) : div2 (bit b n) = n


theorem to_ringEquiv_symm (f : A ≃⋆ₐ[R] B) : (f : A ≃+* B).symm = f.symm

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Add A]
[Add B]
[Mul A]
[Mul B]
[SMul R A]
[SMul R B]
[Star A]
[Star B]
(f : A ≃⋆ₐ[R] B)


/-- An oriented angle is unchanged by replacing the first point by one weakly further away on the
same ray. -/
theorem _root_.Wbtw.oangle_eq_left {p₁ p₁' p₂ p₃ : P} (h : Wbtw ℝ p₂ p₁ p₁') (hp₁p₂ : p₁ ≠ p₂) :
    ∡ p₁ p₂ p₃ = ∡ p₁' p₂ p₃

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

∡ p₁ p₂ p₃ = ∡ p₁' p₂ p₃


@[to_additive]
theorem not_mem_mulTSupport_iff_eventuallyEq : x ∉ mulTSupport f ↔ f =ᶠ[𝓝 x] 1

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[One β]
{f : α → β}
{x : α}


theorem condIndepFun_iff_condexp_inter_preimage_eq_mul {mβ : MeasurableSpace β}
    {mβ' : MeasurableSpace β'} (hf : Measurable f) (hg : Measurable g) :
    CondIndepFun m' hm' f g μ ↔
      ∀ s t, MeasurableSet s → MeasurableSet t
        → (μ⟦f ⁻¹' s ∩ g ⁻¹' t | m'⟧) =ᵐ[μ] fun ω ↦ (μ⟦f ⁻¹' s | m'⟧) ω * (μ⟦g ⁻¹' t | m'⟧) ω

{Ω : Type u_1}
{β : Type u_3}
{β' : Type u_4}
{m' mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
{hm' : m' ≤ mΩ}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
{f : Ω → β}
{g : Ω → β'}
{mβ : MeasurableSpace β}
{mβ' : MeasurableSpace β'}
(hf : Measurable f)
(hg : Measurable g)

ProbabilityTheory.CondIndepFun m' hm' f g μ ↔
  ∀ (s : Set β) (t : Set β'),
    MeasurableSet s →
      MeasurableSet t →
        μ[(f ⁻¹' s ∩ g ⁻¹' t).indicator fun ω => 1|m'] =ᵐ[μ] fun ω =>
          (μ[(f ⁻¹' s).indicator fun ω => 1|m']) ω * (μ[(g ⁻¹' t).indicator fun ω => 1|m']) ω


/-- `(⇑)` as an `AddMonoidHom`. -/
@[simps]
def coeFnAddMonoidHom : OuterMeasure α →+ Set α → ℝ≥0∞

∀ (a : MeasureTheory.OuterMeasure α) (a_1 : Set α), MeasureTheory.OuterMeasure.coeFnAddMonoidHom a a_1 = a a_1


theorem prime_def_lt' {p : ℕ} : Prime p ↔ 2 ≤ p ∧ ∀ m, 2 ≤ m → m < p → ¬m ∣ p

Nat.Prime p ↔ 2 ≤ p ∧ ∀ (m : ℕ), 2 ≤ m → m < p → ¬m ∣ p


/-- `TensorProduct.rid` preserves tensor products of quadratic forms. -/
@[simps toLinearEquiv]
def tensorRId (Q₁ : QuadraticForm R M₁) :
    (Q₁.tmul (sq (R := R))).IsometryEquiv Q₁

{R : Type uR}
{M₁ : Type uM₁}
[CommRing R]
[AddCommGroup M₁]
[Module R M₁]
[Invertible 2]
(Q₁ : QuadraticForm R M₁)

Q₁.tensorRId.toLinearEquiv = TensorProduct.rid R M₁


@[simp]
theorem Matrix.toLin'_toMatrix' (f : (n → R) →ₗ[R] m → R) :
    Matrix.toLin' (LinearMap.toMatrix' f) = f

{R : Type u_1}
[CommSemiring R]
{m : Type u_4}
{n : Type u_5}
[DecidableEq n]
[Fintype n]
(f : (n → R) →ₗ[R] m → R)


/-- Two elements `a` and `b` are `M`-regular if and only if both products `a * b` and `b * a`
are `M`-regular. -/
theorem mul_and_mul_iff [Mul R] [IsScalarTower R R M] :
    IsSMulRegular M (a * b) ∧ IsSMulRegular M (b * a) ↔ IsSMulRegular M a ∧ IsSMulRegular M b

{R : Type u_1}
{M : Type u_3}
{a b : R}
[SMul R M]
[Mul R]
[IsScalarTower R R M]


@[simp]
theorem bot_F (u : Unit) : (@Realizer.bot α).F u = ∅


theorem Icc_mem_nhds (xt : x ≠ ∞) (ε0 : ε ≠ 0) : Icc (x - ε) (x + ε) ∈ 𝓝 x


/-- Group homomorphisms preserve integer power. -/
@[to_additive (attr := simp) (reorder := 9 10)
"Additive group homomorphisms preserve integer scaling."]
theorem map_zpow [Group G] [DivisionMonoid H] [MonoidHomClass F G H]
    (f : F) (g : G) (n : ℤ) : f (g ^ n) = f g ^ n

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


theorem imp_true_iff (α : Sort u) : (α → True) ↔ True


/-- If `H` is a `p`-subgroup but not a Sylow `p`-subgroup, then `p` divides the
  index of `H` inside its normalizer. -/
theorem prime_dvd_card_quotient_normalizer [Finite G] {p : ℕ} {n : ℕ} [hp : Fact p.Prime]
    (hdvd : p ^ (n + 1) ∣ Nat.card G) {H : Subgroup G} (hH : Nat.card H = p ^ n) :
    p ∣ Nat.card (normalizer H ⧸ Subgroup.comap ((normalizer H).subtype : normalizer H →* G) H)

{G : Type u}
[Group G]
[Finite G]
{p n : ℕ}
[hp : Fact (Nat.Prime p)]
(hdvd : p ^ (n + 1) ∣ Nat.card G)
{H : Subgroup G}
(hH : Nat.card ↥H = p ^ n)

p ∣ Nat.card (↥H.normalizer ⧸ Subgroup.comap H.normalizer.subtype H)