theorem norm_le_of_forall_le {f : lp E ∞} {C : ℝ} (hC : 0 ≤ C) (hCf : ∀ i, ‖f i‖ ≤ C) :
    ‖f‖ ≤ C

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
{f : ↥(lp E ⊤)}
{C : ℝ}
(hC : 0 ≤ C)
(hCf : ∀ (i : α), ‖↑f i‖ ≤ C)


/-- This cannot be a `simp` lemmas as it incorrectly matches against `e : α ≃ synonym α`, when
`synonym α` is semireducible. This makes a mess of `Multiplicative.ofAdd` etc. -/
theorem Perm.coe_subsingleton {α : Type*} [Subsingleton α] (e : Perm α) : (e : α → α) = id

{α : Type u_1}
[Subsingleton α]
(e : Equiv.Perm α)


@[ext]
theorem ext {f g : InfTopHom α β} (h : ∀ a, f a = g a) : f = g

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Top α]
[Inf β]
[Top β]
{f g : InfTopHom α β}
(h : ∀ (a : α), f a = g a)


theorem condIndep_limsup_self [StandardBorelSpace Ω] [Nonempty Ω]
    (hm : m ≤ m0) [IsFiniteMeasure μ]
    (h_le : ∀ n, s n ≤ m0) (h_indep : iCondIndep m hm s μ) (hf : ∀ t, p t → tᶜ ∈ f)
    (hns : Directed (· ≤ ·) ns) (hnsp : ∀ a, p (ns a)) (hns_univ : ∀ n, ∃ a, n ∈ ns a) :
    CondIndep m (limsup s f) (limsup s f) hm μ

(h_indep : ProbabilityTheory.iCondIndep m hm s μ)

(hns : Directed (fun x x_1 => x ≤ x_1) ns)

ProbabilityTheory.CondIndep m (Filter.limsup s f) (Filter.limsup s f) hm μ


@[simp]
theorem toHom_comp_inj (h : N ↪[L] P) (f g : M →[L] N) : h.toHom.comp f = h.toHom.comp g ↔ f = g

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
{P : Type u_1}
[L.Structure P]
(h : L.Embedding N P)
(f g : L.Hom M N)


/-- Reformulation of the uniform structure in terms of the extended distance -/
theorem uniformity_pseudoedist : 𝓤 α = ⨅ ε > 0, 𝓟 { p : α × α | edist p.1 p.2 < ε }


/-- If a set of functions is uniformly equicontinuous, its closure for the product topology is also
uniformly equicontinuous. -/
protected theorem Set.UniformEquicontinuous.closure {A : Set <| β → α}
    (hA : A.UniformEquicontinuous) : (closure A).UniformEquicontinuous

{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{A : Set (β → α)}
(hA : A.UniformEquicontinuous)


theorem le_trailingDegree_X_pow (n : ℕ) : (n : ℕ∞) ≤ trailingDegree (X ^ n : R[X])


@[to_additive (attr := simp)]
theorem inv_le_self_iff : a⁻¹ ≤ a ↔ 1 ≤ a

{α : Type u}
[LinearOrderedCommGroup α]
{a : α}

a⁻¹ ≤ a ↔ 1 ≤ a


lemma trace_mul_cycle' (f g h : M →ₗ[R] M) :
    trace R M (f * (g * h)) = trace R M (h * (f * g))

(R : Type u)
[CommSemiring R]
{M : Type v}
[AddCommMonoid M]
[Module R M]
(f g h : M →ₗ[R] M)

(LinearMap.trace R M) (f * (g * h)) = (LinearMap.trace R M) (h * (f * g))


/-- A dependent version of `Subsemigroup.iSup_induction`. -/
@[to_additive (attr := elab_as_elim)
"A dependent version of `AddSubsemigroup.iSup_induction`."]
theorem iSup_induction' (S : ι → Subsemigroup M) {C : ∀ x, (x ∈ ⨆ i, S i) → Prop}
    (mem : ∀ (i) (x) (hxS : x ∈ S i), C x (mem_iSup_of_mem i ‹_›))
    (mul : ∀ x y hx hy, C x hx → C y hy → C (x * y) (mul_mem ‹_› ‹_›)) {x₁ : M}
    (hx₁ : x₁ ∈ ⨆ i, S i) : C x₁ hx₁

(mem : ∀ (i : ι) (x : M) (hxS : x ∈ S i), C x ⋯)

(mul : ∀ (x y : M) (hx : x ∈ ⨆ i, S i) (hy : y ∈ ⨆ i, S i), C x hx → C y hy → C (x + y) ⋯)


/-- An open right half-plane (with boundary real part given by an `EReal`) is an open set
in the complex plane. -/
lemma isOpen_re_gt_EReal (x : EReal) : IsOpen {z : ℂ | x < z.re}


theorem BilinForm.toMatrix'_mul (B : BilinForm R₂ (n → R₂)) (M : Matrix n n R₂) :
    BilinForm.toMatrix' B * M = BilinForm.toMatrix' (B.compRight (Matrix.toLin' M))

{R₂ : Type u_5}
[CommSemiring R₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(B : LinearMap.BilinForm R₂ (n → R₂))
(M : Matrix n n R₂)

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


/-- If `GenContFract.of v` terminated at step `n`, then the `n`th convergent is exactly `v`. -/
theorem of_correctness_of_terminatedAt (terminatedAt_n : (of v).TerminatedAt n) :
    v = (of v).convs n

(terminatedAt_n : (GenContFract.of v).TerminatedAt n)


theorem eventuallyEq_nhdsWithin_of_eqOn {f g : α → β} {s : Set α} {a : α} (h : EqOn f g s) :
    f =ᶠ[𝓝[s] a] g

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
{f g : α → β}
{s : Set α}
{a : α}
(h : Set.EqOn f g s)


theorem collapse_apply [IsWellOrder β s] (f : r ↪r s) (a) : collapse f a = (collapseF f a).1

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
[IsWellOrder β s]
(f : r ↪r s)
(a : α)


theorem partOrd_dual_comp_forget_to_preord :
    PartOrd.dual ⋙ forget₂ PartOrd Preord =
      forget₂ PartOrd Preord ⋙ Preord.dual

PartOrd.dual ⋙ CategoryTheory.forget₂ PartOrd Preord = CategoryTheory.forget₂ PartOrd Preord ⋙ Preord.dual


theorem IsClosed.nhdsSet_le_sup (h : IsClosed t) : 𝓝ˢ s ≤ 𝓝ˢ (s ∩ t) ⊔ 𝓟 (tᶜ)

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

𝓝ˢ s ≤ 𝓝ˢ (s ∩ t) ⊔ 𝓟 tᶜ


/-- Given a localization map `f : R →+* S` for a submonoid `M ⊆ R` and a map of `CommSemiring`s
`g : R →* P` such that `g y` is invertible for all `y : M`, the homomorphism induced from
`S` to `P` maps `f x * (f y)⁻¹` to `g x * (g y)⁻¹` for all `x : R, y ∈ M`. -/
theorem lift_mk' (x y) :
    lift hg (mk' S x y) = g x * ↑(IsUnit.liftRight (g.toMonoidHom.restrict M) hg y)⁻¹

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
[IsLocalization M S]
{g : R →+* P}
(hg : ∀ (y : ↥M), IsUnit (g ↑y))
(x : R)
(y : ↥M)

(IsLocalization.lift hg) (IsLocalization.mk' S x y) = g x * ↑((IsUnit.liftRight ((↑g).restrict M) hg) y)⁻¹


/-- The convolution `f * g` is `C^n` when `f` is locally integrable and `g` is `C^n` and compactly
supported. Version where `g` depends on an additional parameter in an open subset `s` of a
parameter space `P` (and the compact support `k` is independent of the parameter in `s`). -/
theorem contDiffOn_convolution_right_with_param {f : G → E} {n : ℕ∞} (L : E →L[𝕜] E' →L[𝕜] F)
    {g : P → G → E'} {s : Set P} {k : Set G} (hs : IsOpen s) (hk : IsCompact k)
    (hgs : ∀ p, ∀ x, p ∈ s → x ∉ k → g p x = 0) (hf : LocallyIntegrable f μ)
    (hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ)) :
    ContDiffOn 𝕜 n (fun q : P × G => (f ⋆[L, μ] g q.1) q.2) (s ×ˢ univ)

(hgs : ∀ (p : P) (x : G), p ∈ s → x ∉ k → g p x = 0)

(hf : MeasureTheory.LocallyIntegrable f μ)

(hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ Set.univ))

ContDiffOn 𝕜 n (fun q => MeasureTheory.convolution f (g q.1) L μ q.2) (s ×ˢ Set.univ)


theorem measure_le_tsum_of_absolutelyContinuous [SecondCountableTopology α] {ρ : Measure α}
    (hρ : ρ ≪ μ) : ρ s ≤ ∑' p : h.index, ρ (h.covering p)

{α : Type u_1}
[MetricSpace α]
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{v : VitaliFamily μ}
{f : α → Set (Set α)}
{s : Set α}
(h : v.FineSubfamilyOn f s)
[SecondCountableTopology α]
{ρ : MeasureTheory.Measure α}
(hρ : ρ ≪ μ)

ρ s ≤ ∑' (p : ↑h.index), ρ (h.covering ↑p)


/-- Shows how the entries of the sequence of the computed continued fraction can be obtained by the
fractional parts of the stream of integer and fractional parts.
-/
theorem get?_of_eq_some_of_get?_intFractPair_stream_fr_ne_zero {ifp_n : IntFractPair K}
    (stream_nth_eq : IntFractPair.stream v n = some ifp_n) (nth_fr_ne_zero : ifp_n.fr ≠ 0) :
    (of v).s.get? n = some ⟨1, (IntFractPair.of ifp_n.fr⁻¹).b⟩

(stream_nth_eq : GenContFract.IntFractPair.stream v n = some ifp_n)

(GenContFract.of v).s.get? n = some { a := 1, b := ↑(GenContFract.IntFractPair.of ifp_n.fr⁻¹).b }


@[simp]
theorem aleph0_add_ofNat {n : ℕ} [Nat.AtLeastTwo n] : ℵ₀ + no_index (OfNat.ofNat n) = ℵ₀

Cardinal.aleph0 + OfNat.ofNat n = Cardinal.aleph0


@[simp]
theorem neg_bot : -(⊥ : EReal) = ⊤


/-- We may construct a glue data from a family of open sets. -/
@[simps! toGlueData_J toGlueData_U toGlueData_V toGlueData_t toGlueData_f]
def ofOpenSubsets : TopCat.GlueData.{u}

(i :
  (TopCat.GlueData.MkCore.mk (fun i => (TopologicalSpace.Opens.toTopCat (TopCat.of α)).obj (U i))
        (fun i j => (TopologicalSpace.Opens.map (U i).inclusion).obj (U j))
        (fun i j => { toFun := fun x => ⟨⟨↑↑x, ⋯⟩, ⋯⟩, continuous_toFun := ⋯ }) ⋯ ⋯ ⋯ ⋯).J ×
    (TopCat.GlueData.MkCore.mk (fun i => (TopologicalSpace.Opens.toTopCat (TopCat.of α)).obj (U i))
        (fun i j => (TopologicalSpace.Opens.map (U i).inclusion).obj (U j))
        (fun i j => { toFun := fun x => ⟨⟨↑↑x, ⋯⟩, ⋯⟩, continuous_toFun := ⋯ }) ⋯ ⋯ ⋯ ⋯).J)

(TopCat.GlueData.ofOpenSubsets U).V i =
  (TopologicalSpace.Opens.toTopCat ((TopologicalSpace.Opens.toTopCat (TopCat.of α)).obj (U i.1))).obj
    ((TopologicalSpace.Opens.map (U i.1).inclusion).obj (U i.2))


@[aesop (rule_sets := [builtin]) norm destruct]
theorem empty_false (h : Empty) : False


lemma exists_ne_mem_inter_of_not_pairwise_disjoint
    {f : ι → Set α} (h : ¬ Pairwise (Disjoint on f)) :
    ∃ i j : ι, i ≠ j ∧ ∃ x, x ∈ f i ∩ f j

{α : Type u_1}
{ι : Type u_4}
{f : ι → Set α}
(h : ¬Pairwise (Disjoint on f))


theorem perm_lookup {a : α} {s₁ s₂ : AList β} (p : s₁.entries ~ s₂.entries) :
    s₁.lookup a = s₂.lookup a

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{s₁ s₂ : AList β}
(p : s₁.entries ~ s₂.entries)


theorem ωb_mul_ω (q : ℕ+) : (ωb : X q) * ω = 1


@[to_additive]
theorem ite_mul {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) :
    (if P then a else b) * c = if P then a * c else b * c

{α : Type u_1}
[Add α]
(P : Prop)
[Decidable P]
(a b c : α)

(if P then a else b) + c = if P then a + c else b + c


lemma stieltjesOfMeasurableRat_nonneg (hf : Measurable f) (a : α) (r : ℝ) :
    0 ≤ stieltjesOfMeasurableRat f hf a r

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℚ → ℝ}
(hf : Measurable f)
(a : α)
(r : ℝ)

0 ≤ ↑(ProbabilityTheory.stieltjesOfMeasurableRat f hf a) r


lemma isInitSeg_initSeg : IsInitSeg (initSeg s) s.card

{α : Type u_1}
[LinearOrder α]
{s : Finset α}
[Fintype α]

Finset.Colex.IsInitSeg (Finset.Colex.initSeg s) s.card


@[simp, norm_cast]
theorem coe_prodMap {D : Type*} [Semiring D] [TopologicalSpace D] [Algebra R D] (f₁ : A →A[R] B)
    (f₂ : C →A[R] D) :
    (f₁.prodMap f₂ : A × C →ₐ[R] B × D) = (f₁ : A →ₐ[R] B).prodMap (f₂ : C →ₐ[R] D)

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


theorem toIcoMod_neg (a b : α) : toIcoMod hp a (-b) = p - toIocMod hp (-a) b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b : α)


theorem mul_def [Mul α] (a b : Part α) : a * b = bind a fun y ↦ map (y * ·) b

a * b = do
  let y ← a
  Part.map (fun x => y * x) b


@[simp]
theorem down_ssubset_down {s t : SetSemiring α} : SetSemiring.down s ⊂ SetSemiring.down t ↔ s < t


@[simp]
theorem natCast_self' (n : ℕ) : (n + 1 : ZMod (n + 1)) = 0


theorem node3R_size {l x m y r} : size (@node3R α l x m y r) = size l + size m + size r + 2

{α : Type u_1}
{l : Ordnode α}
{x : α}
{m : Ordnode α}
{y : α}
{r : Ordnode α}

(l.node3R x m y r).size = l.size + m.size + r.size + 2


theorem eq_zero_iff {p : RingSeminorm R} : p = 0 ↔ ∀ x, p x = 0

{R : Type u_2}
[NonUnitalRing R]
{p : RingSeminorm R}


theorem eq_zero_of_eq_zero (h : (0 : R) = (1 : R)) (p : R[X]) : p = 0

{R : Type u}
[Semiring R]
(h : 0 = 1)
(p : R[X])


@[simp]
theorem empty_toList {s : Multiset α} : s.toList.isEmpty ↔ s = 0


theorem mex_le_lsub {ι : Type u} (f : ι → Ordinal.{max u v}) : mex.{_, v} f ≤ lsub.{_, v} f


theorem unbounded_lt_inter_le [LinearOrder α] (a : α) :
    Unbounded (· < ·) (s ∩ { b | a ≤ b }) ↔ Unbounded (· < ·) s

{α : Type u_1}
{s : Set α}
[LinearOrder α]
(a : α)

Set.Unbounded (fun x x_1 => x < x_1) (s ∩ {b | a ≤ b}) ↔ Set.Unbounded (fun x x_1 => x < x_1) s


theorem nonempty_of_ssubset' (ht : s ⊂ t) : t.Nonempty


theorem sum_add (xs ys : IntList) : (xs + ys).sum = xs.sum + ys.sum


lemma strictConcaveOn_rpow {p : ℝ} (hp₀ : 0 < p) (hp₁ : p < 1) :
    StrictConcaveOn ℝ (Set.Ici 0) fun x : ℝ ↦ x ^ p

StrictConcaveOn ℝ (Set.Ici 0) fun x => x ^ p


theorem finrank_span_finset_eq_card {s : Finset M} (hs : LinearIndependent R ((↑) : s → M)) :
    finrank R (span R (s : Set M)) = s.card

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
{s : Finset M}
(hs : LinearIndependent R Subtype.val)

FiniteDimensional.finrank R ↥(Submodule.span R ↑s) = s.card


theorem total_comapDomain (f : α → α') (l : α' →₀ R) (hf : Set.InjOn f (f ⁻¹' ↑l.support)) :
    Finsupp.total α M R v (Finsupp.comapDomain f l hf) =
      (l.support.preimage f hf).sum fun i => l (f i) • v i

{α : Type u_1}
{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α' : Type u_7}
{v : α → M}
(f : α → α')
(l : α' →₀ R)
(hf : Set.InjOn f (f ⁻¹' ↑l.support))

(Finsupp.total α M R v) (Finsupp.comapDomain f l hf) = ∑ i ∈ l.support.preimage f hf, l (f i) • v i


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

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


@[simp]
theorem Equivalence.toOrderIso_symm_apply (e : X ≌ Y) (y : Y) :
    e.toOrderIso.symm y = e.inverse.obj y

{X : Type u}
{Y : Type v}
[PartialOrder X]
[PartialOrder Y]
(e : X ≌ Y)
(y : Y)


/-- `sinh` is surjective, `∀ b, ∃ a, sinh a = b`. In this case, we use `a = arsinh b`. -/
theorem sinh_surjective : Surjective sinh


@[to_additive]
theorem one_mem_one [One α] : (1 : α) ∈ (1 : Part α)


/-- If `α` has a solid norm, then the balls centered at the origin of `α` are solid sets. -/
theorem LatticeOrderedAddCommGroup.isSolid_ball (r : ℝ) :
    LatticeOrderedAddCommGroup.IsSolid (Metric.ball (0 : α) r)

{α : Type u_1}
[NormedAddCommGroup α]
[Lattice α]
[HasSolidNorm α]
(r : ℝ)

LatticeOrderedAddCommGroup.IsSolid (Metric.ball 0 r)


theorem limsup_const_mul_of_ne_top {u : α → ℝ≥0∞} {a : ℝ≥0∞} (ha_top : a ≠ ⊤) :
    (f.limsup fun x : α => a * u x) = a * f.limsup u

{α : Type u_1}
{f : Filter α}
{u : α → ℝ≥0∞}
{a : ℝ≥0∞}
(ha_top : a ≠ ⊤)

Filter.limsup (fun x => a * u x) f = a * Filter.limsup u f


@[to_additive]
theorem Nonempty.of_smul_left : (s • t).Nonempty → s.Nonempty

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{s : Finset α}
{t : Finset β}


/-- Extended norm on a vector space. As in the case of normed spaces, we require only
`‖c • x‖ ≤ ‖c‖ * ‖x‖` in the definition, then prove an equality in `map_smul`. -/
structure ENorm (𝕜 : Type*) (V : Type*) [NormedField 𝕜] [AddCommGroup V] [Module 𝕜 V] where
  toFun : V → ℝ≥0∞
  eq_zero' : ∀ x, toFun x = 0 → x = 0
  map_add_le' : ∀ x y : V, toFun (x + y) ≤ toFun x + toFun y
  map_smul_le' : ∀ (c : 𝕜) (x : V), toFun (c • x) ≤ ‖c‖₊ * toFun x

{𝕜 : Type u_1}
{V : Type u_2}
[NormedField 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
(self : ENorm 𝕜 V)
(x : V)


@[simp]
theorem mem_cliqueFinset_iff : s ∈ G.cliqueFinset n ↔ G.IsNClique n s

{α : Type u_1}
{G : SimpleGraph α}
[Fintype α]
[DecidableEq α]
[DecidableRel G.Adj]
{n : ℕ}
{s : Finset α}


@[to_additive]
theorem numeratorHom_apply {r : R} : numeratorHom r = r /ₒ (1 : S)

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
{r : R}

AddOreLocalization.numeratorHom r = r -ₒ 0


/-- The ring homomorphism `GradedRing.projZeroRingHom' 𝒜` is surjective. -/
lemma GradedRing.projZeroRingHom'_surjective :
    Function.Surjective (GradedRing.projZeroRingHom' 𝒜)

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


theorem filter_lt_of_succ_bot {n m : ℕ} (hnm : n < m) :
    ((Ico n m).filter fun x => x < n + 1) = [n]

List.filter (fun x => decide (x < n + 1)) (List.Ico n m) = [n]


/-- A variant of `Matrix.mvPolynomialX_map_eval₂` with a bundled `AlgHom` on the LHS. -/
theorem mvPolynomialX_mapMatrix_aeval [Fintype m] [DecidableEq m] [CommSemiring R] [CommSemiring S]
    [Algebra R S] (A : Matrix m m S) :
    (MvPolynomial.aeval fun p : m × m => A p.1 p.2).mapMatrix (mvPolynomialX m m R) = A

{m : Type u_1}
(R : Type u_3)
{S : Type u_4}
[Fintype m]
[DecidableEq m]
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
(A : Matrix m m S)

(MvPolynomial.aeval fun p => A p.1 p.2).mapMatrix (Matrix.mvPolynomialX m m R) = A


@[simp]
theorem quotLeftToQuotSupₐ_toRingHom :
    (quotLeftToQuotSupₐ R I J : _ →+* _) = quotLeftToQuotSup I J

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

↑(DoubleQuot.quotLeftToQuotSupₐ R I J) = DoubleQuot.quotLeftToQuotSup I J


theorem normalize_eq_iff (z₁ : d₁ ≠ 0) (z₂ : d₂ ≠ 0) :
    normalize n₁ d₁ z₁ = normalize n₂ d₂ z₂ ↔ n₁ * d₂ = n₂ * d₁

{d₁ d₂ : Nat}
{n₁ n₂ : Int}
(z₁ : d₁ ≠ 0)
(z₂ : d₂ ≠ 0)

Rat.normalize n₁ d₁ z₁ = Rat.normalize n₂ d₂ z₂ ↔ n₁ * ↑d₂ = n₂ * ↑d₁


@[to_additive]
lemma prod_preimage' (f : ι → κ) [DecidablePred (· ∈ Set.range f)] (s : Finset κ) (hf) (g : κ → β) :
    ∏ x ∈ s.preimage f hf, g (f x) = ∏ x ∈ s.filter (· ∈ Set.range f), g x

[DecidablePred fun x => x ∈ Set.range f]

∑ x ∈ s.preimage f hf, g (f x) = ∑ x ∈ Finset.filter (fun x => x ∈ Set.range f) s, g x


/-- A row partioned matrix when transposed gives a column partioned matrix with rows of the initial
matrix tranposed to become columns. -/
lemma transpose_fromRows (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) :
    transpose (fromRows A₁ A₂) = fromColumns (transpose A₁) (transpose A₂)

{R : Type u_1}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n : Type u_5}
(A₁ : Matrix m₁ n R)
(A₂ : Matrix m₂ n R)

(A₁.fromRows A₂).transpose = A₁.transpose.fromColumns A₂.transpose


/-- The chosen cokernels and kernels of the limits API give a `RightHomologyData` -/
@[simps]
noncomputable def ofHasCokernelOfHasKernel
    [HasCokernel S.f] [HasKernel (cokernel.desc S.f S.g S.zero)] :
    S.RightHomologyData

[CategoryTheory.Limits.HasKernel (CategoryTheory.Limits.cokernel.desc S.f S.g ⋯)]

(CategoryTheory.ShortComplex.RightHomologyData.ofHasCokernelOfHasKernel S).H =
  CategoryTheory.Limits.kernel (CategoryTheory.Limits.cokernel.desc S.f S.g ⋯)


/-- `F.flip` is isomorphic to uncurrying `F`, swapping the variables, and currying. -/
@[simps!]
def flipIsoCurrySwapUncurry (F : C ⥤ D ⥤ E) : F.flip ≅ curry.obj (Prod.swap _ _ ⋙ uncurry.obj F)

(F : CategoryTheory.Functor C (CategoryTheory.Functor D E))

∀ (X_1 : C),
  ((CategoryTheory.flipIsoCurrySwapUncurry F).inv.app X).app X_1 = CategoryTheory.CategoryStruct.id ((F.obj X_1).obj X)


theorem IsSheaf.hom_ext {A : Type u₂} [Category.{v₂} A] {E : A} {X : C} {P : Cᵒᵖ ⥤ A}
    (hP : Presheaf.IsSheaf J P) (S : J.Cover X) (e₁ e₂ : E ⟶ P.obj (op X))
    (h : ∀ I : S.Arrow, e₁ ≫ P.map I.f.op = e₂ ≫ P.map I.f.op) : e₁ = e₂

{J : CategoryTheory.GrothendieckTopology C}

(hP : CategoryTheory.Presheaf.IsSheaf J P)

(h :
  ∀ (I : S.Arrow),
    CategoryTheory.CategoryStruct.comp e₁ (P.map I.f.op) = CategoryTheory.CategoryStruct.comp e₂ (P.map I.f.op))


/-- A continuous function on a closed interval with `f a = f b`
has a local extremum at some point of the corresponding open interval. -/
theorem exists_isLocalExtr_Ioo (hab : a < b) (hfc : ContinuousOn f (Icc a b)) (hfI : f a = f b) :
    ∃ c ∈ Ioo a b, IsLocalExtr f c

{X : Type u_1}
{Y : Type u_2}
[ConditionallyCompleteLinearOrder X]
[DenselyOrdered X]
[TopologicalSpace X]
[OrderTopology X]
[LinearOrder Y]
[TopologicalSpace Y]
[OrderTopology Y]
{f : X → Y}
{a b : X}
(hab : a < b)
(hfc : ContinuousOn f (Set.Icc a b))
(hfI : f a = f b)


/-- Baire theorem: if countably many closed sets cover the whole space, then their interiors
are dense. Formulated here with an index set which is a countable type. -/
theorem dense_iUnion_interior_of_closed [Countable ι] {f : ι → Set X} (hc : ∀ i, IsClosed (f i))
    (hU : ⋃ i, f i = univ) : Dense (⋃ i, interior (f i))

{X : Type u_1}
{ι : Sort u_3}
[TopologicalSpace X]
[BaireSpace X]
[Countable ι]
{f : ι → Set X}
(hc : ∀ (i : ι), IsClosed (f i))
(hU : ⋃ i, f i = Set.univ)


/-- Embedding `i : Fin n` into `Fin (n + 1)` using a pivot `p` that is lesser
results in a value that is greater than `p`. -/
lemma lt_succAbove_iff_le_castSucc (p : Fin (n + 1)) (i : Fin n) :
    p < p.succAbove i ↔ p ≤ castSucc i


@[simp]
theorem nats_get? (n : ℕ) : nats.get? n = some n


/-- A sieve is a cover for the regular topology if and only if it contains an `EffectiveEpi`. -/
theorem mem_sieves_iff_hasEffectiveEpi (S : Sieve X) :
    (S ∈ (regularTopology C).sieves  X) ↔
    ∃ (Y : C) (π : Y ⟶ X), EffectiveEpi π ∧ (S.arrows π)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preregular C]
{X : C}
(S : CategoryTheory.Sieve X)

S ∈ (CategoryTheory.regularTopology C).sieves X ↔ ∃ Y π, CategoryTheory.EffectiveEpi π ∧ S.arrows π


@[simp] theorem data_join (ss : List String) : (join ss).data = (ss.map data).join

(String.join ss).data = (List.map String.data ss).join


@[simp]
theorem continuousAt_dslope_same : ContinuousAt (dslope f a) a ↔ DifferentiableAt 𝕜 f a

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{a : 𝕜}


theorem injOn_iff_invFunOn_image_image_eq_self [Nonempty α] :
    InjOn f s ↔ (invFunOn f s) '' (f '' s) = s

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

Set.InjOn f s ↔ Function.invFunOn f s '' (f '' s) = s


/-- A norm on an additive group `G` is a function `f : G → ℝ` that preserves zero, is subadditive
and such that `f (-x) = f x` and `f x = 0 → x = 0` for all `x`. -/
structure AddGroupNorm (G : Type*) [AddGroup G] extends AddGroupSeminorm G where
  /-- If the image under the seminorm is zero, then the argument is zero. -/
  protected eq_zero_of_map_eq_zero' : ∀ x, toFun x = 0 → x = 0

{G : Type u_7}
[AddGroup G]
(self : AddGroupNorm G)
(x : G)


@[simp]
theorem edges_reverse {u v : V} (p : G.Walk u v) : p.reverse.edges = p.edges.reverse

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


@[simp]
theorem integral_sin_sq_mul_cos :
    ∫ x in a..b, sin x ^ 2 * cos x = (sin b ^ 3 - sin a ^ 3) / 3

∫ (x : ℝ) in a..b, Real.sin x ^ 2 * Real.cos x = (Real.sin b ^ 3 - Real.sin a ^ 3) / 3


theorem trans_eq_none (f : α ≃. β) (g : β ≃. γ) (a : α) :
    f.trans g a = none ↔ ∀ b c, b ∉ f a ∨ c ∉ g b

{α : Type u}
{β : Type v}
{γ : Type w}
(f : α ≃. β)
(g : β ≃. γ)
(a : α)

(f.trans g) a = none ↔ ∀ (b : β) (c : γ), b ∉ f a ∨ c ∉ g b


lemma Odd.pow_nonneg_iff (hn : Odd n) : 0 ≤ a ^ n ↔ 0 ≤ a

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
{n : ℕ}
[ExistsAddOfLE R]
(hn : Odd n)


@[to_additive (attr := simp)]
theorem div_div_div_cancel_left (a b c : G) : c / a / (c / b) = b / a

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


/-- If `s` is not of the form `1 - n` for `n ∈ ℕ`, then `cosZeta a (1 - s)` is an explicit
multiple of `hurwitzZetaEven s`. -/
lemma cosZeta_one_sub (a : UnitAddCircle) {s : ℂ} (hs : ∀ (n : ℕ), s ≠ 1 - n) :
    cosZeta a (1 - s) = 2 * (2 * π) ^ (-s) * Gamma s * cos (π * s / 2) * hurwitzZetaEven a s

(a : UnitAddCircle)
{s : ℂ}
(hs : ∀ (n : ℕ), s ≠ 1 - ↑n)

HurwitzZeta.cosZeta a (1 - s) =
  2 * (2 * ↑π) ^ (-s) * Complex.Gamma s * Complex.cos (↑π * s / 2) * HurwitzZeta.hurwitzZetaEven a s


@[simp]
theorem comp_id (f : R →ₑ+*[φ] S) : f.comp (MulSemiringActionHom.id M) = f

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{R : Type u_10}
[Semiring R]
[MulSemiringAction M R]
{S : Type u_12}
[Semiring S]
[MulSemiringAction N S]
(f : R →ₑ+*[φ] S)


@[ext]
theorem ext {x y : TruncatedWittVector p n R} (h : ∀ i, x.coeff i = y.coeff i) : x = y

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


lemma dvd_sum [NonUnitalSemiring R] {a} {l : List R} (h : ∀ x ∈ l, a ∣ x) : a ∣ l.sum

{R : Type u_5}
[NonUnitalSemiring R]
{a : R}
{l : List R}
(h : ∀ x ∈ l, a ∣ x)


theorem ergodic_zsmul_add (x : AddCircle T) {n : ℤ} (h : 1 < |n|) : Ergodic fun y => n • y + x

{T : ℝ}
[hT : Fact (0 < T)]
(x : AddCircle T)
{n : ℤ}
(h : 1 < |n|)

Ergodic (fun y => n • y + x) MeasureTheory.volume


theorem trace_eq_sum_roots [FiniteDimensional K L] {x : L}
    (hF : (minpoly K x).Splits (algebraMap K F)) :
    algebraMap K F (Algebra.trace K L x) =
      finrank K⟮x⟯ L • ((minpoly K x).aroots F).sum

(hF : Polynomial.Splits (algebraMap K F) (minpoly K x))

(algebraMap K F) ((Algebra.trace K L) x) = FiniteDimensional.finrank (↥K⟮x⟯) L • ((minpoly K x).aroots F).sum


theorem floor_int_div_nat_eq_div {n : ℤ} {d : ℕ} : ⌊(↑n : ℚ) / (↑d : ℚ)⌋ = n / (↑d : ℤ)


/-- Show that the response for right provided by `rightResponse` preserves the right-player-wins
condition. -/
theorem rightResponse_spec {x : PGame} (h : x ≤ 0) (i : x.LeftMoves) :
    (x.moveLeft i).moveRight (rightResponse h i) ≤ 0

{x : SetTheory.PGame}
(h : x ≤ 0)
(i : x.LeftMoves)

(x.moveLeft i).moveRight (SetTheory.PGame.rightResponse h i) ≤ 0


@[simp]
theorem evalFrom_nil (S : Set σ) : M.evalFrom S [] = M.εClosure S

{α : Type u}
{σ : Type v}
(M : εNFA α σ)
(S : Set σ)


@[simp]
theorem ofCoconeEquiv_apply_desc {D : Type u₄} [Category.{v₄} D] {G : K ⥤ D}
    (h : Cocone G ≌ Cocone F) {c : Cocone G} (P : IsColimit (h.functor.obj c)) (s) :
    (ofCoconeEquiv h P).desc s =
      (h.unit.app c).hom ≫
        (h.inverse.map (P.descCoconeMorphism (h.functor.obj s))).hom ≫ (h.unitInv.app s).hom

(h : CategoryTheory.Limits.Cocone G ≌ CategoryTheory.Limits.Cocone F)

(P : CategoryTheory.Limits.IsColimit (h.functor.obj c))

((CategoryTheory.Limits.IsColimit.ofCoconeEquiv h) P).desc s =
  (h.unit.app c).hom ≫ (h.inverse.map (P.descCoconeMorphism (h.functor.obj s))).hom ≫ (h.unitInv.app s).hom


@[simp]
theorem cast_pow_eq_one {R : Type*} [Semiring R] [CharZero R] (q : ℕ) (n : ℕ) (hn : n ≠ 0) :
    (q : R) ^ n = 1 ↔ q = 1

{R : Type u_2}
[Semiring R]
[CharZero R]
(q n : ℕ)
(hn : n ≠ 0)


private lemma expDegree_cast {n : ℕ} (hn : n ≠ 0) :
    2 * (expDegree n : ℤ) = n ^ 2 - if Even n then 4 else 1

2 * ↑(WeierstrassCurve.expDegree n) = ↑n ^ 2 - if Even n then 4 else 1


/-- The functor `(F ⋙ L, R) ⥤ (L, R)` -/
@[simps]
def preRight (L : A ⥤ T) (F : C ⥤ B) (R : B ⥤ T) : Comma L (F ⋙ R) ⥤ Comma L R

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{C : Type u₄}
[CategoryTheory.Category.{v₄, u₄} C]
(L : CategoryTheory.Functor A T)
(F : CategoryTheory.Functor C B)
(R : CategoryTheory.Functor B T)

∀ {X Y : CategoryTheory.Comma L (F.comp R)} (f : X ⟶ Y), ((CategoryTheory.Comma.preRight L F R).map f).left = f.left


lemma IsQuasiregular.map {F R S : Type*} [NonUnitalSemiring R] [NonUnitalSemiring S]
    [FunLike F R S] [NonUnitalRingHomClass F R S] (f : F) {x : R} (hx : IsQuasiregular x) :
    IsQuasiregular (f x)

{F : Type u_1}
{R : Type u_2}
{S : Type u_3}
[NonUnitalSemiring R]
[NonUnitalSemiring S]
[FunLike F R S]
[NonUnitalRingHomClass F R S]
(f : F)
{x : R}
(hx : IsQuasiregular x)


theorem Quotient.mk_eq_iff_out [s : Setoid α] {x : α} {y : Quotient s} :
    ⟦x⟧ = y ↔ x ≈ Quotient.out y

{α : Sort u_1}
[s : Setoid α]
{x : α}
{y : Quotient s}


theorem vec2_dotProduct' {a₀ a₁ b₀ b₁ : α} : ![a₀, a₁] ⬝ᵥ ![b₀, b₁] = a₀ * b₀ + a₁ * b₁

{α : Type u}
[AddCommMonoid α]
[Mul α]
{a₀ a₁ b₀ b₁ : α}

Matrix.dotProduct ![a₀, a₁] ![b₀, b₁] = a₀ * b₀ + a₁ * b₁


@[simp]
theorem verts_toSubgraph (p : G.Walk u v) : p.toSubgraph.verts = { w | w ∈ p.support }

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

p.toSubgraph.verts = {w | w ∈ p.support}


theorem IsInfix.trans : ∀ {l₁ l₂ l₃ : List α}, l₁ <:+: l₂ → l₂ <:+: l₃ → l₁ <:+: l₃


/-- Left unit cancellation `1 ⊗ X ≅ X` in `Dial C`. -/
@[simps!] def leftUnitor (X : Dial C) : tensorObj tensorUnit X ≅ X

X.leftUnitor.inv.f =
  CategoryTheory.Limits.prod.lift (CategoryTheory.Limits.terminal.from X.src) (CategoryTheory.CategoryStruct.id X.src)


@[simp]
theorem coe_prodEquivOfIsCompl (h : IsCompl p q) :
    (prodEquivOfIsCompl p q h : p × q →ₗ[R] E) = p.subtype.coprod q.subtype

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
(p q : Submodule R E)
(h : IsCompl p q)

↑(p.prodEquivOfIsCompl q h) = p.subtype.coprod q.subtype


@[deprecated (since := "2024-04-26")]
theorem BilinForm.toLin_apply (x : M) : BilinForm.toLin B x = B x

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
(x : M)


@[to_additive (attr := elab_as_elim)]
theorem induction_on_units {p : Units c.Quotient → Prop} (u : Units c.Quotient)
    (H : ∀ (x y : M) (hxy : c (x * y) 1) (hyx : c (y * x) 1), p ⟨x, y, c.eq.2 hxy, c.eq.2 hyx⟩) :
    p u

(H : ∀ (x y : M) (hxy : c (x + y) 0) (hyx : c (y + x) 0), p { val := ↑x, neg := ↑y, val_neg := ⋯, neg_val := ⋯ })


@[to_additive (attr := simp)]
theorem self_le_mul_right (a b : α) : a ≤ a * b

{α : Type u}
[CanonicallyOrderedAddCommMonoid α]
(a b : α)


@[to_additive (attr := simp)]
theorem pure_bind (f : α → FreeSemigroup β) (x) : pure x >>= f = f x

{α β : Type u}
(f : α → FreeAddSemigroup β)
(x : α)


@[to_additive]
theorem prod_le_hasProd (s : Finset ι) (hs : ∀ i, i ∉ s → 1 ≤ f i) (hf : HasProd f a) :
    ∏ i ∈ s, f i ≤ a

{ι : Type u_1}
{α : Type u_3}
[OrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
{a : α}
(s : Finset ι)
(hs : ∀ i ∉ s, 1 ≤ f i)
(hf : HasProd f a)


theorem _root_.QuadraticMap.polarBilin_comp (Q : QuadraticMap R N' N) (f : M →ₗ[R] N') :
    polarBilin (Q.comp f) = LinearMap.compl₁₂ (polarBilin Q) f f

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
{N' : Type u_8}
[AddCommGroup N']
[Module R N']
(Q : QuadraticMap R N' N)
(f : M →ₗ[R] N')

(Q.comp f).polarBilin = LinearMap.compl₁₂ Q.polarBilin f f


@[simp] lemma supClosure_empty : supClosure (∅ : Set α) = ∅


@[simp]
theorem rightMoves_mk {xl xr xL xR} : (⟨xl, xr, xL, xR⟩ : PGame).RightMoves = xr

{xl xr : Type u_1}
{xL : xl → SetTheory.PGame}
{xR : xr → SetTheory.PGame}

(SetTheory.PGame.mk xl xr xL xR).RightMoves = xr


/-- The type of continuous additive monoid homomorphisms from `A` to `B`.

When possible, instead of parametrizing results over `(f : ContinuousAddMonoidHom A B)`,
you should parametrize over `(F : Type*) [ContinuousAddMonoidHomClass F A B] (f : F)`.

When you extend this structure, make sure to extend `ContinuousAddMonoidHomClass`. -/
structure ContinuousAddMonoidHom (A B : Type*) [AddMonoid A] [AddMonoid B] [TopologicalSpace A]
  [TopologicalSpace B] extends A →+ B where
  /-- Proof of continuity of the Hom. -/
  continuous_toFun : @Continuous A B _ _ toFun

{A : Type u_7}
{B : Type u_8}
[AddMonoid A]
[AddMonoid B]
[TopologicalSpace A]
[TopologicalSpace B]
(self : ContinuousAddMonoidHom A B)


theorem adjoin.finiteDimensional {x : L} (hx : IsIntegral K x) : FiniteDimensional K K⟮x⟯

{K : Type u}
[Field K]
{L : Type u_3}
[Field L]
[Algebra K L]
{x : L}
(hx : IsIntegral K x)


@[reassoc (attr := simp)]
lemma map_ofInv_hom_id (s : Y ⟶ X) (hs : W s) (L : C ⥤ D) (hL : W.IsInvertedBy L) :
    (ofInv s hs).map L hL ≫ L.map s = 𝟙 _

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
(W : CategoryTheory.MorphismProperty C)
{X Y : C}
(s : Y ⟶ X)
(hs : W s)
(L : CategoryTheory.Functor C D)
(hL : W.IsInvertedBy L)

CategoryTheory.CategoryStruct.comp ((CategoryTheory.MorphismProperty.LeftFraction.ofInv s hs).map L hL) (L.map s) =
  CategoryTheory.CategoryStruct.id (L.obj X)


/-- The upper part of the first column of the snake diagram is exact. -/
lemma exact_C₁_up : (ShortComplex.mk S.v₀₁.τ₁ S.v₁₂.τ₁
    (by rw [← comp_τ₁, S.w₀₂, zero_τ₁])).Exact

(S : CategoryTheory.ShortComplex.SnakeInput C)

(CategoryTheory.ShortComplex.mk S.v₀₁.τ₁ S.v₁₂.τ₁ ⋯).Exact


@[reassoc]
lemma mapComp_assoc_left {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) :
    F.mapComp f g ▷ F.map h ≫ F.mapComp (f ≫ g) h = (α_ (F.map f) (F.map g) (F.map h)).hom ≫
      F.map f ◁ F.mapComp g h ≫ F.mapComp f (g ≫ h) ≫ F.map₂ (α_ f g h).inv

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.LaxFunctor B C)
{a b c d : B}
(f : a ⟶ b)
(g : b ⟶ c)
(h : c ⟶ d)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (F.mapComp f g) (F.map h))
    (F.mapComp (CategoryTheory.CategoryStruct.comp f g) h) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (F.map f) (F.map g) (F.map h)).hom
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (F.map f) (F.mapComp g h))
      (CategoryTheory.CategoryStruct.comp (F.mapComp f (CategoryTheory.CategoryStruct.comp g h))
        (F.map₂ (CategoryTheory.Bicategory.associator f g h).inv)))


theorem eq_path_of_eq_image :
    (πₘ f).map ⟦p⟧ = hcast (start_path hfg) ≫ (πₘ g).map ⟦q⟧ ≫ hcast (end_path hfg).symm

{X₁ X₂ Y : TopCat}
{f : C(↑X₁, ↑Y)}
{g : C(↑X₂, ↑Y)}
{x₀ x₁ : ↑X₁}
{x₂ x₃ : ↑X₂}
{p : Path x₀ x₁}
{q : Path x₂ x₃}
(hfg : ∀ (t : ↑I), f (p t) = g (q t))

(π.map f).map ⟦p⟧ = ContinuousMap.Homotopy.hcast ⋯ ≫ (π.map g).map ⟦q⟧ ≫ ContinuousMap.Homotopy.hcast ⋯


theorem log_neg_natCast_nonneg (n : ℕ) : 0 ≤ log (-n)


theorem coe_compLinearMap (f : M [⋀^ι]→ₗ[R] N) (g : M₂ →ₗ[R] M) :
    ⇑(f.compLinearMap g) = f ∘ (g ∘ ·)

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
{M₂ : Type u_10}
[AddCommMonoid M₂]
[Module R M₂]
(f : M [⋀^ι]→ₗ[R] N)
(g : M₂ →ₗ[R] M)

⇑(f.compLinearMap g) = ⇑f ∘ fun x => ⇑g ∘ x


theorem zip_eq_zip_data (as : Array α) (bs : Array β) :
    (as.zip bs).data = as.data.zip bs.data

{α : Type u_1}
{β : Type u_2}
(as : Array α)
(bs : Array β)


theorem ofReal_integral_eq_lintegral_ofReal {f : α → ℝ} (hfi : Integrable f μ) (f_nn : 0 ≤ᵐ[μ] f) :
    ENNReal.ofReal (∫ x, f x ∂μ) = ∫⁻ x, ENNReal.ofReal (f x) ∂μ

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

ENNReal.ofReal (∫ (x : α), f x ∂μ) = ∫⁻ (x : α), ENNReal.ofReal (f x) ∂μ


@[to_additive]
theorem uniformEmbedding_translate_mul (a : α) : UniformEmbedding fun x : α => x * a

{α : Type u_1}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
(a : α)


@[to_additive (attr := simp)]
lemma smul_eq_mul (α : Type*) [Mul α] {a a' : α} : a • a' = a * a'


theorem ringHom_monotone (hR : ∀ r : R, 0 ≤ r → ∃ s : R, s ^ 2 = r) (f : R →+* S) : Monotone f

(hR : ∀ (r : R), 0 ≤ r → ∃ s, s ^ 2 = r)


theorem iUnion_eq_compl_iInter_compl (s : ι → Set β) : ⋃ i, s i = (⋂ i, (s i)ᶜ)ᶜ

{β : Type u_2}
{ι : Sort u_4}
(s : ι → Set β)


/-- Composition of paths as functor from the path category of a category to the category. -/
@[simps]
def pathComposition : Paths C ⥤ C

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

(CategoryTheory.pathComposition C).obj X = X


lemma le_iff {I J : TwoSidedIdeal R} : I ≤ J ↔ (I : Set R) ⊆ (J : Set R)

{R : Type u_1}
[NonUnitalNonAssocRing R]
{I J : TwoSidedIdeal R}

I ≤ J ↔ ↑I ⊆ ↑J


theorem measure_compl_aeSeqSet_eq_zero [Countable ι] (hf : ∀ i, AEMeasurable (f i) μ)
    (hp : ∀ᵐ x ∂μ, p x fun n => f n x) : μ (aeSeqSet hf p)ᶜ = 0

{f : ι → α → β}

(hp : ∀ᵐ (x : α) ∂μ, p x fun n => f n x)


lemma triangleRemovalBound_nonpos (hε : ε ≤ 0) : triangleRemovalBound ε ≤ 0


@[simp]
theorem nndist_homothety_self (p₁ p₂ : P) (c : 𝕜) :
    nndist (homothety p₁ c p₂) p₂ = ‖1 - c‖₊ * nndist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
(p₁ p₂ : P)
(c : 𝕜)

nndist ((AffineMap.homothety p₁ c) p₂) p₂ = ‖1 - c‖₊ * nndist p₁ p₂


theorem firstDiffPos_loop_eq (l₁ l₂ r₁ r₂ stop p)
    (hl₁ : p = utf8Len l₁) (hl₂ : p = utf8Len l₂)
    (hstop : stop = min (utf8Len l₁ + utf8Len r₁) (utf8Len l₂ + utf8Len r₂)) :
    firstDiffPos.loop ⟨l₁ ++ r₁⟩ ⟨l₂ ++ r₂⟩ ⟨stop⟩ ⟨p⟩ =
      ⟨p + utf8Len (List.takeWhile₂ (· = ·) r₁ r₂).1⟩

(hstop : stop = min (String.utf8Len l₁ + String.utf8Len r₁) (String.utf8Len l₂ + String.utf8Len r₂))

String.firstDiffPos.loop { data := l₁ ++ r₁ } { data := l₂ ++ r₂ } { byteIdx := stop } { byteIdx := p } =
  { byteIdx := p + String.utf8Len (List.takeWhile₂ (fun x x_1 => decide (x = x_1)) r₁ r₂).fst }


theorem isUnit_nonsing_inv_det_iff {A : Matrix n n α} : IsUnit A⁻¹.det ↔ IsUnit A.det

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
{A : Matrix n n α}


{α : Type u_1}
[OrderedSemiring α]
[DecidableRel fun x x_1 => x < x_1]
[Nontrivial α]


/-- The (distinguished) triangle in the derived category of `C` given by a
short exact short complex in `C`. -/
@[simps!]
noncomputable def singleTriangle : Triangle (DerivedCategory C)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[HasDerivedCategory C]
{S : CategoryTheory.ShortComplex C}
(hS : S.ShortExact)

hS.singleTriangle.mor₁ = (DerivedCategory.singleFunctor C 0).map S.f


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

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

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


theorem left_lt_right {x : PGame} (o : Numeric x) (i : x.LeftMoves) (j : x.RightMoves) :
    x.moveLeft i < x.moveRight j

{x : SetTheory.PGame}
(o : x.Numeric)
(i : x.LeftMoves)
(j : x.RightMoves)


theorem le_einfsep_image_iff {d} {f : β → α} {s : Set β} : d ≤ einfsep (f '' s)
    ↔ ∀ x ∈ s, ∀ y ∈ s, f x ≠ f y → d ≤ edist (f x) (f y)

{α : Type u_1}
{β : Type u_2}
[EDist α]
{d : ENNReal}
{f : β → α}
{s : Set β}

d ≤ (f '' s).einfsep ↔ ∀ x ∈ s, ∀ y ∈ s, f x ≠ f y → d ≤ edist (f x) (f y)


theorem tan_int_mul_pi (n : ℤ) : tan (n * π) = 0


theorem toSplittingField_evalXSelf {s : Finset (MonicIrreducible k)} {f} (hf : f ∈ s) :
    toSplittingField k s (evalXSelf k f) = 0

{s : Finset (AlgebraicClosure.MonicIrreducible k)}

{f : AlgebraicClosure.MonicIrreducible k}

(AlgebraicClosure.toSplittingField k s) (AlgebraicClosure.evalXSelf k f) = 0


@[simp]
theorem snd_zero [Zero R] [Zero A] : (0 : Unitization R A).snd = 0

{R : Type u_3}
{A : Type u_4}
[Zero R]
[Zero A]


/--
If `(a,b)` is a kernel pair for `f₁ ≫ f₂` and `a ≫ f₁ = b ≫ f₁`, then `(a,b)` is a kernel pair for
just `f₁`.
That is, to show that `(a,b)` is a kernel pair for `f₁` it suffices to only show the square
commutes, rather than to additionally show it's a pullback.
-/
theorem cancel_right {f₁ : X ⟶ Y} {f₂ : Y ⟶ Z} (comm : a ≫ f₁ = b ≫ f₁)
    (big_k : IsKernelPair (f₁ ≫ f₂) a b) : IsKernelPair f₁ a b

(comm : CategoryTheory.CategoryStruct.comp a f₁ = CategoryTheory.CategoryStruct.comp b f₁)

(big_k : CategoryTheory.IsKernelPair (CategoryTheory.CategoryStruct.comp f₁ f₂) a b)


theorem Disjoint.mul_eq_one_iff {σ τ : Perm α} (hστ : Disjoint σ τ) :
    σ * τ = 1 ↔ σ = 1 ∧ τ = 1

{α : Type u_1}
{σ τ : Equiv.Perm α}
(hστ : σ.Disjoint τ)


lemma exact₀ (S : ComposableArrows C 0) : S.Exact

(S : CategoryTheory.ComposableArrows C 0)


theorem toMatrix_swap [DecidableEq n] [Ring α] (i j : n) :
    (Equiv.swap i j).toPEquiv.toMatrix =
      (1 : Matrix n n α) - (single i i).toMatrix - (single j j).toMatrix + (single i j).toMatrix +
        (single j i).toMatrix

{n : Type u_4}
{α : Type v}
[DecidableEq n]
[Ring α]
(i j : n)

(Equiv.toPEquiv (Equiv.swap i j)).toMatrix =
  1 - (PEquiv.single i i).toMatrix - (PEquiv.single j j).toMatrix + (PEquiv.single i j).toMatrix +
    (PEquiv.single j i).toMatrix


/-- The polar coordinates partial homeomorphism in `ℝ^2`, mapping `(r cos θ, r sin θ)` to `(r, θ)`.
It is a homeomorphism between `ℝ^2 - (-∞, 0]` and `(0, +∞) × (-π, π)`. -/
@[simps]
def polarCoord : PartialHomeomorph (ℝ × ℝ) (ℝ × ℝ)

polarCoord.source = {q | 0 < q.1} ∪ {q | q.2 ≠ 0}


protected theorem nonempty (q : Trunc α) : Nonempty α


@[to_additive]
theorem hasProd_empty [IsEmpty β] : HasProd f 1

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


theorem StrongEpi.mk' {f : P ⟶ Q} [Epi f]
    (hf : ∀ (X Y : C) (z : X ⟶ Y)
      (_ : Mono z) (u : P ⟶ X) (v : Q ⟶ Y) (sq : CommSq u f z v), sq.HasLift) :
    StrongEpi f

(hf :
  ∀ (X Y : C) (z : X ⟶ Y),
    CategoryTheory.Mono z → ∀ (u : P ⟶ X) (v : Q ⟶ Y) (sq : CategoryTheory.CommSq u f z v), sq.HasLift)


theorem range_sigma_eq_iUnion_range {γ : α → Type*} (f : Sigma γ → β) :
    range f = ⋃ a, range fun b => f ⟨a, b⟩

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

Set.range f = ⋃ a, Set.range fun b => f ⟨a, b⟩


theorem IsGLB.isLUB_of_tendsto [Preorder γ] [TopologicalSpace γ] [OrderClosedTopology γ] :
    ∀ {f : α → γ} {s : Set α} {a : α} {b : γ},
      AntitoneOn f s → IsGLB s a → s.Nonempty → Tendsto f (𝓝[s] a) (𝓝 b) → IsLUB (f '' s) b

{α : Type u_1}
{γ : Type u_3}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[Preorder γ]
[TopologicalSpace γ]
[OrderClosedTopology γ]
{f : α → γ}
{s : Set α}
{a : α}
{b : γ}

AntitoneOn f s → IsGLB s a → s.Nonempty → Filter.Tendsto f (𝓝[s] a) (𝓝 b) → IsLUB (f '' s) b


theorem empty_or_nonempty_of_hausdorffEdist_ne_top (fin : hausdorffEdist s t ≠ ⊤) :
    (s = ∅ ∧ t = ∅) ∨ (s.Nonempty ∧ t.Nonempty)

{α : Type u}
[PseudoEMetricSpace α]
{s t : Set α}
(fin : EMetric.hausdorffEdist s t ≠ ⊤)


lemma nnnorm_unop [SeminormedAddGroup E] (a : Eᵐᵒᵖ) : ‖MulOpposite.unop a‖₊ = ‖a‖₊

{E : Type u_2}
[SeminormedAddGroup E]
(a : Eᵐᵒᵖ)


theorem op_smul_eq_mul_diagonal [Fintype n] [DecidableEq n] (M : Matrix m n α) (a : α) :
    MulOpposite.op a • M = M * (diagonal fun _ : n => a)

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

MulOpposite.op a • M = M * Matrix.diagonal fun x => a


lemma emod_two_eq_zero_or_one (n : ℤ) : n % 2 = 0 ∨ n % 2 = 1


@[to_additive]
theorem mk''_toEquiv (hS : S ∈ Subgroup.leftTransversals (H : Set G)) (q : G ⧸ H) :
    Quotient.mk'' (toEquiv hS q : G) = q

{G : Type u_1}
[Group G]
{H : Subgroup G}
{S : Set G}
(hS : S ∈ Subgroup.leftTransversals ↑H)
(q : G ⧸ H)

Quotient.mk'' ↑((Subgroup.MemLeftTransversals.toEquiv hS) q) = q


/-- A functor `F : C ⥤ D` is full if for each `X Y : C`, `F.map` is surjective.

See <https://stacks.math.columbia.edu/tag/001C>.
-/
class Full (F : C ⥤ D) : Prop where
  map_surjective {X Y : C} : Function.Surjective (F.map (X := X) (Y := Y))

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


theorem exists_s_a_of_partNum {a : α} (nth_partNum_eq : g.partNums.get? n = some a) :
    ∃ gp, g.s.get? n = some gp ∧ gp.a = a


lemma Continuous.finset_inf (hs : ∀ i ∈ s, Continuous (f i)) : Continuous (s.inf f)

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
{ι : Type u_3}
[SemilatticeInf L]
[OrderTop L]
[ContinuousInf L]
{s : Finset ι}
{f : ι → X → L}
(hs : ∀ i ∈ s, Continuous (f i))


theorem eraseP_append_left {a : α} (pa : p a) :
    ∀ {l₁ : List α} l₂, a ∈ l₁ → (l₁++l₂).eraseP p = l₁.eraseP p ++ l₂

{α : Type u_1}
{p : α → Bool}
{a : α}
(pa : p a = true)
{l₁ : List α}
(l₂ : List α)

a ∈ l₁ → List.eraseP p (l₁ ++ l₂) = List.eraseP p l₁ ++ l₂


@[to_additive]
theorem Smooth.extend_one [T2Space M] [One M'] {U : Opens M} {f : U → M'}
    (supp : HasCompactMulSupport f) (diff : Smooth I I' f) : Smooth I I' (Subtype.val.extend f 1)

{𝕜 : 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']
[T2Space M]
[One M']
{U : TopologicalSpace.Opens M}
{f : ↥U → M'}
(supp : HasCompactMulSupport f)
(diff : Smooth I I' f)

Smooth I I' (Function.extend Subtype.val f 1)


@[measurability]
theorem _root_.aestronglyMeasurable_id {α : Type*} [TopologicalSpace α] [PseudoMetrizableSpace α]
    {_ : MeasurableSpace α} [OpensMeasurableSpace α] [SecondCountableTopology α] {μ : Measure α} :
    AEStronglyMeasurable (id : α → α) μ

∀ {x : MeasurableSpace α} [inst : OpensMeasurableSpace α] [inst : SecondCountableTopology α]
  {μ : MeasureTheory.Measure α}, MeasureTheory.AEStronglyMeasurable id μ


/-- If `I` is a nonzero fractional ideal, `a ∈ R`, and `J` is an ideal of `R` such that
`I = a⁻¹J`, then `I` is equal to the product `∏_v v^(val_v(J) - val_v(a))`. -/
theorem finprod_heightOneSpectrum_factorization {I : FractionalIdeal R⁰ K} (hI : I ≠ 0) {a : R}
    {J : Ideal R} (haJ : I = spanSingleton R⁰ ((algebraMap R K) a)⁻¹ * ↑J) :
    ∏ᶠ v : HeightOneSpectrum R, (v.asIdeal : FractionalIdeal R⁰ K) ^
      ((Associates.mk v.asIdeal).count (Associates.mk J).factors -
        (Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {a})).factors : ℤ) = I

(haJ : I = FractionalIdeal.spanSingleton R⁰ ((algebraMap R K) a)⁻¹ * ↑J)

∏ᶠ (v : IsDedekindDomain.HeightOneSpectrum R),
    ↑v.asIdeal ^
      (↑((Associates.mk v.asIdeal).count (Associates.mk J).factors) -
        ↑((Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {a})).factors)) =
  I


theorem const_zero (f : R) (U hu) : const R 0 f U hu = 0

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

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

AlgebraicGeometry.StructureSheaf.const R 0 f U hu = 0


/-- Up to rotation, the contractible triangle `X ⟶ X ⟶ 0 ⟶ X⟦1⟧` for `X : Cᵒᵖ` corresponds
to the contractible triangle for `X.unop` in `C`. -/
@[simps!]
noncomputable def contractibleTriangleIso (X : Cᵒᵖ) :
    contractibleTriangle X ≅ (triangleOpEquivalence C).functor.obj
      (Opposite.op (contractibleTriangle X.unop).invRotate)

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

(CategoryTheory.Pretriangulated.Opposite.contractibleTriangleIso X).hom.hom₂ = CategoryTheory.CategoryStruct.id X


theorem zeta_isRoot [IsDomain B] [NeZero ((n : ℕ) : B)] : IsRoot (cyclotomic n B) (zeta n A B)

(n : ℕ+)
(A : Type w)
(B : Type z)
[CommRing A]
[CommRing B]
[Algebra A B]
[IsCyclotomicExtension {n} A B]
[IsDomain B]
[NeZero ↑↑n]

(Polynomial.cyclotomic (↑n) B).IsRoot (IsCyclotomicExtension.zeta n A B)


theorem ContDiffOn.rpow_const_of_le (hf : ContDiffOn ℝ m f s) (h : ↑m ≤ p) :
    ContDiffOn ℝ m (fun x => f x ^ p) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
{p : ℝ}
{m : ℕ}
(hf : ContDiffOn ℝ (↑m) f s)
(h : ↑m ≤ p)


theorem fold_sup_bot_singleton [DecidableEq α] (s : Finset α) :
    Finset.fold (· ⊔ ·) ⊥ singleton s = s

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

Finset.fold (fun x x_1 => x ⊔ x_1) ⊥ singleton s = s


/-- If `p` is a prime and `IsCyclotomicExtension {p ^ k} K L`, then the discriminant of
`hζ.powerBasis K` is `(-1) ^ ((p ^ k).totient / 2) * p ^ (p ^ (k - 1) * ((p - 1) * k - 1))`
if `Irreducible (cyclotomic (p ^ k) K))`. Beware that in the cases `p ^ k = 1` and `p ^ k = 2`
the formula uses `1 / 2 = 0` and `0 - 1 = 0`. It is useful only to have a uniform result.
See also `IsCyclotomicExtension.discr_prime_pow_eq_unit_mul_pow`. -/
theorem discr_prime_pow [hcycl : IsCyclotomicExtension {p ^ k} K L] [hp : Fact (p : ℕ).Prime]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ k)) (hirr : Irreducible (cyclotomic (↑(p ^ k) : ℕ) K)) :
    discr K (hζ.powerBasis K).basis =
      (-1) ^ ((p ^ k : ℕ).totient / 2) * p ^ ((p : ℕ) ^ (k - 1) * ((p - 1) * k - 1))

(hirr : Irreducible (Polynomial.cyclotomic (↑(p ^ k)) K))

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


theorem le_of_mem_A {r ε : ℝ} {L : E →L[𝕜] F} {x : E} (hx : x ∈ A f L r ε) {y z : E}
    (hy : y ∈ closedBall x (r / 2)) (hz : z ∈ closedBall x (r / 2)) :
    ‖f z - f y - L (z - y)‖ ≤ ε * r

(hx : x ∈ FDerivMeasurableAux.A f L r ε)


@[simp]
theorem wronskian_zero_right (a : R[X]) : wronskian a 0 = 0


@[simp]
theorem mem_map {f : E →ₗ[𝕜] F} {S : PointedCone 𝕜 E} {y : F} : y ∈ S.map f ↔ ∃ x ∈ S, f x = y

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
[AddCommMonoid F]
[Module 𝕜 F]
{f : E →ₗ[𝕜] F}
{S : PointedCone 𝕜 E}
{y : F}

y ∈ PointedCone.map f S ↔ ∃ x ∈ S, f x = y


@[simp]
theorem wittNeg_zero : wittNeg p 0 = -X (0, 0)

WittVector.wittNeg p 0 = -MvPolynomial.X (0, 0)


theorem cons_injective_iff {α} {x₀ : α} {x : Fin n → α} :
    Function.Injective (cons x₀ x : Fin n.succ → α) ↔ x₀ ∉ Set.range x ∧ Function.Injective x

{n : ℕ}
{α : Type u_1}
{x₀ : α}
{x : Fin n → α}

Function.Injective (Fin.cons x₀ x) ↔ x₀ ∉ Set.range x ∧ Function.Injective x


theorem Bounded.dual :
    ∀ {t : Ordnode α} {o₁ o₂}, Bounded t o₁ o₂ → @Bounded αᵒᵈ _ (dual t) o₂ o₁

{α : Type u_1}
[Preorder α]
{t : Ordnode α}
{o₁ : WithBot α}
{o₂ : WithTop α}


theorem Eventually.forall_mem {α : Type*} {f : Filter α} {s : Set α} {P : α → Prop}
    (hP : ∀ᶠ x in f, P x) (hf : 𝓟 s ≤ f) : ∀ x ∈ s, P x

{α : Type u_2}
{f : Filter α}
{s : Set α}
{P : α → Prop}
(hP : ∀ᶠ (x : α) in f, P x)
(hf : 𝓟 s ≤ f)
(x : α)


theorem comp_smul_apply (p : Seminorm 𝕜₂ E₂) (f : E →ₛₗ[σ₁₂] E₂) (c : 𝕜₂) (x : E) :
    p.comp (c • f) x = ‖c‖ * p (f x)

{𝕜 : Type u_3}
{𝕜₂ : Type u_4}
{E : Type u_7}
{E₂ : Type u_8}
[SeminormedRing 𝕜]
[SeminormedCommRing 𝕜₂]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
[AddCommGroup E]
[AddCommGroup E₂]
[Module 𝕜 E]
[Module 𝕜₂ E₂]
(p : Seminorm 𝕜₂ E₂)
(f : E →ₛₗ[σ₁₂] E₂)
(c : 𝕜₂)
(x : E)


@[simp, nolint simpNF] protected lemma pow_eq_zero {a : ℕ} : ∀ {n : ℕ}, a ^ n = 0 ↔ a = 0 ∧ n ≠ 0


@[simp]
theorem measurableSet_sInf {ms : Set (MeasurableSpace α)} {s : Set α} :
    MeasurableSet[sInf ms] s ↔ ∀ m ∈ ms, MeasurableSet[m] s

{α : Type u_1}
{ms : Set (MeasurableSpace α)}
{s : Set α}

MeasurableSet s ↔ ∀ m ∈ ms, MeasurableSet s


(α : Type u_1)
[Preorder α]
[TopologicalSpace α]
[Topology.IsLower α]


/-- `ContinuousAlgHom.prod` as an `Equiv`. -/
@[simps apply]
def prodEquiv : (A →A[R] B) × (A →A[R] C) ≃ (A →A[R] B × C)

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

ContinuousAlgHom.prodEquiv f = f.1.prod f.2


nonrec theorem uniformContinuous_snd : UniformContinuous (snd : tsze R M → M)

{R : Type u_3}
{M : Type u_4}
[UniformSpace R]
[UniformSpace M]


lemma _root_.NonUnitalNonAssocSemiring.mem_center_iff (a : α) :
    a ∈ NonUnitalSubsemiring.center α ↔ R a = L a ∧ (L a) ∈ RingHom.rangeS (toEndRingHom α)

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
(a : α)

a ∈ NonUnitalSubsemiring.center α ↔
  AddMonoid.End.mulRight a = AddMonoid.End.mulLeft a ∧ AddMonoid.End.mulLeft a ∈ (CentroidHom.toEndRingHom α).rangeS


/-- When both `S.f` and `S.g` are zero, the middle object `S.X₂` gives a homology data on S -/
@[simps]
noncomputable def ofZeros (hf : S.f = 0) (hg : S.g = 0) :
    S.HomologyData

(CategoryTheory.ShortComplex.HomologyData.ofZeros S hf hg).right =
  CategoryTheory.ShortComplex.RightHomologyData.ofZeros S hf hg


@[simp]
theorem comp_def (P Q : RegularExpression α) : comp P Q = P * Q

{α : Type u_1}
(P Q : RegularExpression α)


/-- The cone for `StructuredArrow.proj Y L ⋙ F` attached to `E : RightExtension L F`.
The point of this cone is `E.left.obj Y` -/
@[simps]
def coneAt (Y : D) : Cone (StructuredArrow.proj Y L ⋙ F)

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} H]
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
(E : L.RightExtension F)
(Y : D)


@[simp]
theorem update_inl_apply_inl [DecidableEq α] [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i j : α}
    {x : γ} : update f (inl i) x (inl j) = update (f ∘ inl) i x j

{α : Type u}
{β : Type v}
{γ : Type u_1}
[DecidableEq α]
[DecidableEq (α ⊕ β)]
{f : α ⊕ β → γ}
{i j : α}
{x : γ}

Function.update f (Sum.inl i) x (Sum.inl j) = Function.update (f ∘ Sum.inl) i x j


protected theorem inv_mul_cancel (h : a ≠ 0) : a⁻¹ * a = 1


/-- The angle between a vector and a negative multiple of a vector. -/
@[simp]
theorem angle_smul_right_of_neg (x y : V) {r : ℝ} (hr : r < 0) :
    angle x (r • y) = angle x (-y)

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
(x y : V)
{r : ℝ}
(hr : r < 0)

InnerProductGeometry.angle x (r • y) = InnerProductGeometry.angle x (-y)


theorem inner_im_symm (x y : E) : im ⟪x, y⟫ = -im ⟪y, x⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)

RCLike.im ⟪x, y⟫_𝕜 = -RCLike.im ⟪y, x⟫_𝕜


/-- Cannot be an instance because `PowerBasis` cannot be a class. -/
theorem finite (pb : PowerBasis R S) : Module.Finite R S

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
(pb : PowerBasis R S)


@[to_additive]
theorem comap_strictMono_of_surjective : StrictMono (comap f)

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{f : F}
(hf : Function.Surjective ⇑f)


theorem eq_of_mem_replicate {a b : α} {n} : b ∈ replicate n a → b = a


/-- A function is a Schwartz function if it is smooth and all derivatives decay faster than
  any power of `‖x‖`. -/
structure SchwartzMap where
  toFun : E → F
  smooth' : ContDiff ℝ ⊤ toFun
  decay' : ∀ k n : ℕ, ∃ C : ℝ, ∀ x, ‖x‖ ^ k * ‖iteratedFDeriv ℝ n toFun x‖ ≤ C

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(self : SchwartzMap E F)
(k n : ℕ)

∃ C, ∀ (x : E), ‖x‖ ^ k * ‖iteratedFDeriv ℝ n self.toFun x‖ ≤ C


protected theorem map_sum [NonAssocSemiring R] [NonAssocSemiring S] (g : R ≃+* S) (f : α → R)
    (s : Finset α) : g (∑ x ∈ s, f x) = ∑ x ∈ s, g (f x)

{α : Type u_1}
{R : Type u_2}
{S : Type u_3}
[NonAssocSemiring R]
[NonAssocSemiring S]
(g : R ≃+* S)
(f : α → R)
(s : Finset α)


theorem IsLocalMin.inv {f : α → β} {a : α} (h1 : IsLocalMin f a) (h2 : ∀ᶠ z in 𝓝 a, 0 < f z) :
    IsLocalMax f⁻¹ a

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[LinearOrderedSemifield β]
{f : α → β}
{a : α}
(h1 : IsLocalMin f a)
(h2 : ∀ᶠ (z : α) in nhds a, 0 < f z)


theorem mem_insert_of_mem (h : a ∈ s) : a ∈ insert b s

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{a b : α}
(h : a ∈ s)


@[simp, norm_cast]
theorem coe_Iic (a : α) : (Iic a : Set α) = Set.Iic a

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


lemma slope_le_of_hasDerivWithinAt (hfc : ConcaveOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hfd : HasDerivWithinAt f f' S x) :
    slope f x y ≤ f'

{S : Set ℝ}
{f : ℝ → ℝ}
{x y f' : ℝ}
(hfc : ConcaveOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hfd : HasDerivWithinAt f f' S x)


theorem comp_right_fderivWithin {f : F → G} {s : Set F} {x : E}
    (hxs : UniqueDiffWithinAt 𝕜 (iso ⁻¹' s) x) :
    fderivWithin 𝕜 (f ∘ iso) (iso ⁻¹' s) x =
      (fderivWithin 𝕜 f s (iso x)).comp (iso : E →L[𝕜] F)

(hxs : UniqueDiffWithinAt 𝕜 (⇑iso ⁻¹' s) x)

fderivWithin 𝕜 (f ∘ ⇑iso) (⇑iso ⁻¹' s) x = (fderivWithin 𝕜 f s (iso x)).comp ↑iso


theorem single_apply_eq_zero {a x : α} {b : M} : single a b x = 0 ↔ x = a → b = 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
{a x : α}
{b : M}

(Finsupp.single a b) x = 0 ↔ x = a → b = 0


@[measurability]
theorem measurable_sinh : Measurable sinh


theorem fin_curry {n} {f : α → Fin n → σ} : Primrec f ↔ Primrec₂ f

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


@[to_additive]
theorem subset_interior_mul' : interior s * interior t ⊆ interior (s * t)

{α : Type u}
[TopologicalSpace α]
[AddGroup α]
[ContinuousConstVAdd αᵃᵒᵖ α]
{s t : Set α}

interior s + interior t ⊆ interior (s + t)


@[simp]
theorem AdditiveFunctor.ofExact_map {F G : C ⥤ₑ D} (α : F ⟶ G) :
    (AdditiveFunctor.ofExact C D).map α = α

(CategoryTheory.AdditiveFunctor.ofExact C D).map α = α


theorem ne_zero [Nontrivial M'] {f' : M' →L[R] N} (hf' : IsConformalMap f') : f' ≠ 0

{R : Type u_1}
{N : Type u_3}
{M' : Type u_5}
[NormedField R]
[SeminormedAddCommGroup N]
[NormedSpace R N]
[NormedAddCommGroup M']
[NormedSpace R M']
[Nontrivial M']
{f' : M' →L[R] N}
(hf' : IsConformalMap f')


@[simp]
theorem comap_incl_self : comap N.incl N = ⊤

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


@[to_additive (attr := simp, norm_cast)]
theorem coe_smul [SMul M G] (n : M) (f : α → G) : ↑(n • f) = n • (f : Germ l G)

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
{G : Type u_6}
[VAdd M G]
(n : M)
(f : α → G)


theorem toFractionRing_injective : Function.Injective (toFractionRing : _ → FractionRing K[X])
  -- Porting note: the `xy` input was `rfl` and then there was no need for the `subst`


theorem imageSubobject_le {A B : C} {X : Subobject B} (f : A ⟶ B) [HasImage f] (h : A ⟶ X)
    (w : h ≫ X.arrow = f) : imageSubobject f ≤ X

(h : A ⟶ CategoryTheory.Subobject.underlying.obj X)

CategoryTheory.Limits.imageSubobject f ≤ X


theorem mulMap_comm : mulMap B A = (mulMap A B).comp (Algebra.TensorProduct.comm R B A)

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

B.mulMap A = (A.mulMap B).comp ↑(Algebra.TensorProduct.comm R ↥B ↥A)


lemma antilipschitzWith_mul_left {a : α} (ha : a ≠ 0) : AntilipschitzWith (‖a‖₊⁻¹) (a * ·)

{α : Type u_1}
[NormedDivisionRing α]
{a : α}
(ha : a ≠ 0)


@[simp]
theorem star_inj [InvolutiveStar R] {x y : R} : star x = star y ↔ x = y

{R : Type u}
[InvolutiveStar R]
{x y : R}


@[reassoc (attr := simp)]
lemma map_s_comp_map (φ : W.RightFraction X Y) (L : C ⥤ D) (hL : W.IsInvertedBy L) :
    L.map φ.s ≫ φ.map L hL = L.map φ.f

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{W : CategoryTheory.MorphismProperty C}
{X Y : C}
(φ : W.RightFraction X Y)
(L : CategoryTheory.Functor C D)
(hL : W.IsInvertedBy L)

CategoryTheory.CategoryStruct.comp (L.map φ.s) (φ.map L hL) = L.map φ.f


theorem aeval_root_derivative_of_splits [Algebra K L] [DecidableEq L] {P : K[X]} (hmo : P.Monic)
    (hP : P.Splits (algebraMap K L)) {r : L} (hr : r ∈ P.aroots L) :
    aeval r (Polynomial.derivative P) =
    (((P.aroots L).erase r).map fun a => r - a).prod

(hP : Polynomial.Splits (algebraMap K L) P)

(Polynomial.aeval r) (Polynomial.derivative P) = (Multiset.map (fun a => r - a) ((P.aroots L).erase r)).prod


lemma inter_indicator_mul (f g : ι → M₀) (i : ι) :
    (s ∩ t).indicator (fun j ↦ f j * g j) i = s.indicator f i * t.indicator g i

{ι : Type u_1}
{M₀ : Type u_4}
[MulZeroClass M₀]
{s t : Set ι}
(f g : ι → M₀)
(i : ι)

(s ∩ t).indicator (fun j => f j * g j) i = s.indicator f i * t.indicator g i


theorem iSup_range_stdBasis [Finite ι] : ⨆ i, range (stdBasis R φ i) = ⊤

(R : Type u_1)
{ι : Type u_2}
[Semiring R]
(φ : ι → Type u_3)
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
[DecidableEq ι]
[Finite ι]

⨆ i, LinearMap.range (LinearMap.stdBasis R φ i) = ⊤


@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIso_inv_snd_snd :
    (pullbackDiagonalMapIso f i i₁ i₂).inv ≫ pullback.snd _ _ ≫ pullback.snd _ _ =
      pullback.snd _ _

(i₁ : V₁ ⟶ CategoryTheory.Limits.pullback f i)

(i₂ : V₂ ⟶ CategoryTheory.Limits.pullback f i)

(CategoryTheory.Limits.pullbackDiagonalMapIso f i i₁ i₂).inv ≫
    CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.diagonal f)
        (CategoryTheory.Limits.pullback.map (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
          (i₂ ≫ CategoryTheory.Limits.pullback.snd f i) f f (i₁ ≫ CategoryTheory.Limits.pullback.fst f i)
          (i₂ ≫ CategoryTheory.Limits.pullback.fst f i) i ⋯ ⋯) ≫
      CategoryTheory.Limits.pullback.snd (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
        (i₂ ≫ CategoryTheory.Limits.pullback.snd f i) =
  CategoryTheory.Limits.pullback.snd i₁ i₂


/-- The canonical `R`-algebra projection `Unitization R A → R`. -/
@[simps]
def fstHom : Unitization R A →ₐ[R] R

(R : Type u_2)
(A : Type u_3)
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(x : Unitization R A)


@[simp]
theorem deriv_sinh : deriv sinh = cosh


@[simp] lemma rpow_inv_rpow {y : ℝ} (hy : y ≠ 0) (x : ℝ≥0∞) : (x ^ y⁻¹) ^ y = x


/-- The equivalence between `FinPartOrd` and itself induced by `OrderDual` both ways. -/
@[simps! functor inverse]
def dualEquiv : FinPartOrd ≌ FinPartOrd


@[simp]
lemma map₁_map₂ {G : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G) {Y : C} (f : X ⟶ Y)
    (p : YonedaCollection F Y) :
    YonedaCollection.map₂ G f (YonedaCollection.map₁ η p) =
      YonedaCollection.map₁ η (YonedaCollection.map₂ F f p)

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

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

{G : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

(p : CategoryTheory.OverPresheafAux.YonedaCollection F Y)

CategoryTheory.OverPresheafAux.YonedaCollection.map₂ G f (CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η p) =
  CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η (CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F f p)


@[to_additive]
theorem div_div_div_comm : a / b / (c / d) = a / c / (b / d)

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


/-- A ring is isomorphic to the opposite of its opposite. -/
@[simps!]
def opOp (R : Type*) [Add R] [Mul R] : R ≃+* Rᵐᵒᵖᵐᵒᵖ

∀ (a : Rᵐᵒᵖᵐᵒᵖ), (RingEquiv.opOp R).symm a = MulOpposite.unop (MulOpposite.unop a)


theorem destutter_is_chain' : ∀ l : List α, (l.destutter R).Chain' R

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


@[simp] -- Porting note (#10618): was @[simp]
theorem integral_comp_add_mul (hc : c ≠ 0) (d) :
    (∫ x in a..b, f (d + c * x)) = c⁻¹ • ∫ x in d + c * a..d + c * b, f x

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b c : ℝ}
(f : ℝ → E)
(hc : c ≠ 0)
(d : ℝ)

∫ (x : ℝ) in a..b, f (d + c * x) = c⁻¹ • ∫ (x : ℝ) in d + c * a..d + c * b, f x


/-- If `s : Set α` is a proper subset of `α` and `f : s → α` is surjective, then `α` is infinite. -/
theorem of_surjective_from_set {s : Set α} (hs : s ≠ Set.univ) {f : s → α} (hf : Surjective f) :
    Infinite α

{α : Type u_1}
{s : Set α}
(hs : s ≠ Set.univ)
{f : ↑s → α}
(hf : Function.Surjective f)


theorem biUnion_singleton (a : α) (s : α → Set β) : ⋃ x ∈ ({a} : Set α), s x = s a

{α : Type u_1}
{β : Type u_2}
(a : α)
(s : α → Set β)


theorem gc : GaloisConnection Closeds.closure ((↑) : Closeds α → Set α)


@[simp] protected lemma sdiff_idem (s : LowerSet α) (t : Set α) : (s.sdiff t).sdiff t = s.sdiff t

{α : Type u_1}
[Preorder α]
(s : LowerSet α)
(t : Set α)


/-- Ad hoc class stating that the closure of an upper set is an upper set. This is used to state
lemmas that do not mention algebraic operations for both the additive and multiplicative versions
simultaneously. If you find a satisfying replacement for this typeclass, please remove it! -/
class HasUpperLowerClosure (α : Type*) [TopologicalSpace α] [Preorder α] : Prop where
  isUpperSet_closure : ∀ s : Set α, IsUpperSet s → IsUpperSet (closure s)
  isLowerSet_closure : ∀ s : Set α, IsLowerSet s → IsLowerSet (closure s)
  isOpen_upperClosure : ∀ s : Set α, IsOpen s → IsOpen (upperClosure s : Set α)
  isOpen_lowerClosure : ∀ s : Set α, IsOpen s → IsOpen (lowerClosure s : Set α)

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
[self : HasUpperLowerClosure α]
(s : Set α)


/-- **First moment method**. The maximum of a measurable function is greater than its mean. -/
theorem exists_setLaverage_le (hμ : μ s ≠ 0) (hs : NullMeasurableSet s μ)
    (hint : ∫⁻ a in s, f a ∂μ ≠ ∞) : ∃ x ∈ s, ⨍⁻ a in s, f a ∂μ ≤ f x

{f : α → ℝ≥0∞}

(hs : MeasureTheory.NullMeasurableSet s μ)


@[to_additive (attr := simp)] lemma MonoidHom.pow_apply {M N : Type*} [MulOneClass M]
    [CommMonoid N] (f : M →* N) (n : ℕ) (x : M) :
    (f ^ n) x = (f x) ^ n

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[CommMonoid N]
(f : M →* N)
(n : ℕ)
(x : M)


/-- The Mellin transform of the indicator function of `Ioc 0 1`. -/
theorem hasMellin_one_Ioc {s : ℂ} (hs : 0 < re s) :
    HasMellin (indicator (Ioc 0 1) (fun _ => 1 : ℝ → ℂ)) s (1 / s)

HasMellin ((Set.Ioc 0 1).indicator fun x => 1) s (1 / s)


theorem BoundedAtFilter.smul
    [SeminormedRing 𝕜] [SeminormedAddCommGroup β] [Module 𝕜 β] [BoundedSMul 𝕜 β]
    {l : Filter α} {f : α → β} (c : 𝕜) (hf : BoundedAtFilter l f) : BoundedAtFilter l (c • f)

{𝕜 : Type u_1}
{α : Type u_2}
{β : Type u_3}
[SeminormedRing 𝕜]
[SeminormedAddCommGroup β]
[Module 𝕜 β]
[BoundedSMul 𝕜 β]
{l : Filter α}
{f : α → β}
(c : 𝕜)
(hf : l.BoundedAtFilter f)


theorem to_isAddMonoidHom (f : R →+* S) : IsAddMonoidHom f

{R : Type u_1}
{S : Type u_2}
[NonAssocSemiring R]
[NonAssocSemiring S]
(f : R →+* S)


theorem singularPart_sub (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
    [t.HaveLebesgueDecomposition μ] :
    (s - t).singularPart μ = s.singularPart μ - t.singularPart μ

{α : Type u_1}
{m : MeasurableSpace α}
(s t : MeasureTheory.SignedMeasure α)
(μ : MeasureTheory.Measure α)
[s.HaveLebesgueDecomposition μ]
[t.HaveLebesgueDecomposition μ]


/-- An auxiliary lemma that can be used to prove that coercion `Mˣ → M` is a topological embedding.
Use `Units.embedding_val₀`, `Units.embedding_val`, or `toUnits_homeomorph` instead. -/
@[to_additive "An auxiliary lemma that can be used to prove that coercion `AddUnits M → M` is a
topological embedding. Use `AddUnits.embedding_val` or `toAddUnits_homeomorph` instead."]
lemma embedding_val_mk' {M : Type*} [Monoid M] [TopologicalSpace M] {f : M → M}
    (hc : ContinuousOn f {x : M | IsUnit x}) (hf : ∀ u : Mˣ, f u.1 = ↑u⁻¹) :
    Embedding (val : Mˣ → M)

{M : Type u_3}
[Monoid M]
[TopologicalSpace M]
{f : M → M}
(hc : ContinuousOn f {x | IsUnit x})
(hf : ∀ (u : Mˣ), f ↑u = ↑u⁻¹)


theorem hasPDF_iff_of_aemeasurable {X : Ω → E} {ℙ : Measure Ω}
    {μ : Measure E} (hX : AEMeasurable X ℙ) :
    HasPDF X ℙ μ ↔ (map X ℙ).HaveLebesgueDecomposition μ ∧ map X ℙ ≪ μ

{Ω : Type u_1}
{E : Type u_2}
[MeasurableSpace E]

∀ {x : MeasurableSpace Ω} {X : Ω → E} {ℙ : MeasureTheory.Measure Ω} {μ : MeasureTheory.Measure E},
  AEMeasurable X ℙ →
    (MeasureTheory.HasPDF X ℙ μ ↔
      (MeasureTheory.Measure.map X ℙ).HaveLebesgueDecomposition μ ∧ MeasureTheory.Measure.map X ℙ ≪ μ)


@[to_additive]
theorem zpow_trick {G : Type*} [Group G] (a b : G) (n m : ℤ) :
    a * b ^ n * b ^ m = a * b ^ (n + m)

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


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

{V : Type u}
{a b : V}
{s : Set (SimpleGraph V)}

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


lemma isSplittingField_X_pow_sub_C_of_root_adjoin_eq_top
    {a : K} {α : L} (ha : α ^ (finrank K L) = algebraMap K L a) (hα : K⟮α⟯ = ⊤) :
    IsSplittingField K L (X ^ (finrank K L) - C a)

(hK : (primitiveRoots (FiniteDimensional.finrank K L) K).Nonempty)

(ha : α ^ FiniteDimensional.finrank K L = (algebraMap K L) a)

Polynomial.IsSplittingField K L (Polynomial.X ^ FiniteDimensional.finrank K L - Polynomial.C a)


@[simp]
theorem neLocus_self_sub_left : neLocus (f - g) f = g.support

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


@[simp]
theorem succ_mersenne (k : ℕ) : mersenne k + 1 = 2 ^ k


/-- A category in which coimage-image comparisons are all isomorphisms has images. -/
theorem hasImages : HasImages C

[∀ {X Y : C} (f : X ⟶ Y), CategoryTheory.IsIso (CategoryTheory.Abelian.coimageImageComparison f)]


/-- Group homomorphisms preserve division. -/
@[to_additive (attr := simp) "Additive group homomorphisms preserve subtraction."]
theorem map_div [Group G] [DivisionMonoid H] [MonoidHomClass F G H] (f : F) :
    ∀ a b, f (a / b) = f a / f b

{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)
(a b : G)


@[simp]
theorem cos_two_pi_sub (x : ℝ) : cos (2 * π - x) = cos x


/-- The functor `Γ₀ : ChainComplex C ℕ ⥤ SimplicialObject C`, on objects. -/
@[simps]
def obj (K : ChainComplex C ℕ) : SimplicialObject C

∀ {X Y : SimplexCategoryᵒᵖ} (θ : X ⟶ Y),
  (AlgebraicTopology.DoldKan.Γ₀.obj K).map θ = AlgebraicTopology.DoldKan.Γ₀.Obj.map K θ


theorem ball_mem_nhds {x : E} {r : ℝ} (hr : 0 < r) : ball x r ∈ 𝓝 x

{E : Type u_1}
[AddCommGroup E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[T2Space E]
[Module ℝ E]
[ContinuousSMul ℝ E]
[FiniteDimensional ℝ E]
{x : E}
{r : ℝ}
(hr : 0 < r)


/-- If `w` is a nontorsion weight function, then the finitely supported function `m : σ →₀ ℕ`
  has weighted degree zero if and only if `∀ x : σ, m x = 0`. -/
theorem weightedDegree_eq_zero_iff (hw : NonTorsionWeight w) {m : σ →₀ ℕ} :
    weight w m = 0 ↔ ∀ x : σ, m x = 0

{m : σ →₀ ℕ}

(Finsupp.weight w) m = 0 ↔ ∀ (x : σ), m x = 0


lemma IsRegular.prod (h : ∀ i ∈ s, IsRegular (f i)) :
    IsRegular (∏ i ∈ s, f i)

{ι : Type u_2}
{R : Type u_3}
[CommMonoid R]
{s : Finset ι}
{f : ι → R}
(h : ∀ i ∈ s, IsRegular (f i))


/-- Any graph on `n` vertices has at most `n.choose 2` edges. -/
theorem card_edgeFinset_le_card_choose_two : G.edgeFinset.card ≤ (Fintype.card V).choose 2

{V : Type u_1}
{G : SimpleGraph V}
[Fintype ↑G.edgeSet]
[Fintype V]


theorem exists_min_root [LinearOrder R] (p : R[X]) (hp : p ≠ 0) : ∃ x₀, ∀ x, p.IsRoot x → x₀ ≤ x

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


@[ext 1100]
theorem algHom_ext' {A B : Type*} [CommSemiring A] [CommSemiring B] [Algebra R A] [Algebra R B]
    {f g : MvPolynomial σ A →ₐ[R] B}
    (h₁ :
      f.comp (IsScalarTower.toAlgHom R A (MvPolynomial σ A)) =
        g.comp (IsScalarTower.toAlgHom R A (MvPolynomial σ A)))
    (h₂ : ∀ i, f (X i) = g (X i)) : f = g

(h₂ : ∀ (i : σ), f (MvPolynomial.X i) = g (MvPolynomial.X i))


/-- If a function `f` is continuous on a convex set `D ⊆ ℝ`, is twice differentiable on its
interior, and `f''` is nonnegative on the interior, then `f` is convex on `D`. -/
lemma convexOn_of_hasDerivWithinAt2_nonneg {D : Set ℝ} (hD : Convex ℝ D) {f f' f'' : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf' : ∀ x ∈ interior D, HasDerivWithinAt f (f' x) (interior D) x)
    (hf'' : ∀ x ∈ interior D, HasDerivWithinAt f' (f'' x) (interior D) x)
    (hf''₀ : ∀ x ∈ interior D, 0 ≤ f'' x) : ConvexOn ℝ D f


/-- For `a > 1`, `a ^ b = a` iff `b = 1`. -/
lemma pow_eq_self_iff {a b : ℕ} (ha : 1 < a) : a ^ b = a ↔ b = 1


@[reassoc]
theorem Obj.mapMono_on_summand_id {Δ Δ' : SimplexCategory} (i : Δ' ⟶ Δ) [Mono i] :
    ((splitting K).cofan _).inj (Splitting.IndexSet.id (op Δ)) ≫ (obj K).map i.op =
      Obj.Termwise.mapMono K i ≫ ((splitting K).cofan _).inj (Splitting.IndexSet.id (op Δ'))

((AlgebraicTopology.DoldKan.Γ₀.splitting K).cofan (Opposite.op Δ)).inj
      (SimplicialObject.Splitting.IndexSet.id (Opposite.op Δ)) ≫
    (AlgebraicTopology.DoldKan.Γ₀.obj K).map i.op =
  AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K i ≫
    ((AlgebraicTopology.DoldKan.Γ₀.splitting K).cofan (Opposite.op Δ')).inj
      (SimplicialObject.Splitting.IndexSet.id (Opposite.op Δ'))


lemma strictConcaveOn_rpow {p : ℝ} (hp₀ : 0 < p) (hp₁ : p < 1) :
    StrictConcaveOn ℝ≥0 univ fun x : ℝ≥0 ↦ x ^ p

StrictConcaveOn NNReal Set.univ fun x => x ^ p


@[to_additive (attr := simp)]
theorem lift_ofList (f : α → M) (l : List α) : lift f (ofList l) = (l.map f).prod

{α : Type u_1}
{M : Type u_4}
[AddMonoid M]
(f : α → M)
(l : List α)

(FreeAddMonoid.lift f) (FreeAddMonoid.ofList l) = (List.map f l).sum


theorem id_of_comp_right_id (f : X ⟶ X) (w : ∀ {Y : C} (g : Y ⟶ X), g ≫ f = g) : f = 𝟙 X

(w : ∀ {Y : C} (g : Y ⟶ X), CategoryTheory.CategoryStruct.comp g f = g)


@[to_additive]
protected theorem isOpen : IsOpen (U : Set G)

{G : Type u_1}
[Group G]
[TopologicalSpace G]
(U : OpenSubgroup G)


@[simp]
theorem fromStructuredArrow_map {X Y} (f : X ⟶ Y) :
    (fromStructuredArrow F).map f = ⟨f.right, congr_fun f.w.symm PUnit.unit⟩

{X Y : CategoryTheory.StructuredArrow PUnit.{w + 1} F}

(CategoryTheory.CategoryOfElements.fromStructuredArrow F).map f = ⟨f.right, ⋯⟩


theorem u_iInf {f : ι → β} : u (iInf f) = ⨅ i, u (f i)

{α : Type u}
{β : Type v}
{ι : Sort x}
[CompleteLattice α]
[CompleteLattice β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{f : ι → β}


@[simp]
theorem lookmap_nil : [].lookmap f = []


/-- If a vector space (or module) has a finite basis, then its dimension (or rank) is equal to the
cardinality of the basis. This lemma uses a `Finset` instead of indexed types. -/
theorem finrank_eq_card_finset_basis {ι : Type w} {b : Finset ι} (h : Basis b R M) :
    finrank R M = Finset.card b

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
{ι : Type w}
{b : Finset ι}
(h : Basis { x // x ∈ b } R M)


theorem conjAut_zpow (f : Aut X) (n : ℤ) : α.conjAut (f ^ n) = α.conjAut f ^ n

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
(α : X ≅ Y)
(f : CategoryTheory.Aut X)
(n : ℤ)


theorem subset_union_of_subset_right {s u : Set α} (h : s ⊆ u) (t : Set α) : s ⊆ t ∪ u

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


theorem isBot_or_exists_lt [IsDirected α (· ≥ ·)] (a : α) : IsBot a ∨ ∃ b, b < a

{α : Type u}
[Preorder α]
[IsDirected α fun x x_1 => x ≥ x_1]
(a : α)


lemma Args.numeric_P1 {x y} : (Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric

(Surreal.Multiplication.Args.P1 x y).Numeric ↔ x.Numeric ∧ y.Numeric


/-- The unipotent lower triangular matrix
```
(1 0)
(r 1)
```
as an isomorphism.
-/
@[simps]
def Biprod.unipotentLower {X₁ X₂ : C} (r : X₂ ⟶ X₁) : X₁ ⊞ X₂ ≅ X₁ ⊞ X₂

(CategoryTheory.Biprod.unipotentLower r).inv = CategoryTheory.Biprod.ofComponents (𝟙 X₁) 0 (-r) (𝟙 X₂)


theorem deriv_mul_const_field (v : 𝕜') : deriv (fun y => u y * v) x = deriv u x * v

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{𝕜' : Type u_2}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{u : 𝕜 → 𝕜'}
(v : 𝕜')


theorem IsGLB.mem_closure {a : α} {s : Set α} (ha : IsGLB s a) (hs : s.Nonempty) : a ∈ closure s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
{s : Set α}
(ha : IsGLB s a)
(hs : s.Nonempty)


private lemma add_hom' (α β : Ext X Y n) : (α + β).hom' = α.hom' + β.hom'

(α β : CategoryTheory.Abelian.Ext X Y n)


lemma withDensity_inv_same_le {μ : Measure α} {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) :
    (μ.withDensity f).withDensity f⁻¹ ≤ μ

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


theorem extendSubtype_apply_of_not_mem (e : { x // p x } ≃ { x // q x }) (x) (hx : ¬p x) :
    e.extendSubtype x = e.toCompl ⟨x, hx⟩

{α : Type u_1}
[Finite α]
{p q : α → Prop}
[DecidablePred p]
[DecidablePred q]
(e : { x // p x } ≃ { x // q x })
(x : α)
(hx : ¬p x)

e.extendSubtype x = ↑(e.toCompl ⟨x, hx⟩)


/-- If there is an absolute upper bound on the size of a set satisfying `P`, then the
  maximal subset property always holds. -/
theorem _root_.Matroid.existsMaximalSubsetProperty_of_bdd {P : Set α → Prop}
    (hP : ∃ (n : ℕ), ∀ Y, P Y → Y.encard ≤ n) (X : Set α) : ExistsMaximalSubsetProperty P X

(hP : ∃ n, ∀ (Y : Set α), P Y → Y.encard ≤ ↑n)


@[simp]
lemma ofEpiOfIsIsoOfMono'_f' (φ : S₁ ⟶ S₂) (h : LeftHomologyData S₂)
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] : (ofEpiOfIsIsoOfMono' φ h).f' = φ.τ₁ ≫ h.f'

(CategoryTheory.ShortComplex.LeftHomologyData.ofEpiOfIsIsoOfMono' φ h).f' = CategoryTheory.CategoryStruct.comp φ.τ₁ h.f'


@[to_additive]
theorem smul_def (c : M) (x : Completion X) : c • x = Completion.map (c • ·) x

(M : Type v)
(X : Type x)
[UniformSpace X]
[SMul M X]
(c : M)
(x : UniformSpace.Completion X)

c • x = UniformSpace.Completion.map (fun x => c • x) x


@[to_additive (attr := simp) norm_eq_of_mem_sphere]
theorem norm_eq_of_mem_sphere' (x : sphere (1 : E) r) : ‖(x : E)‖ = r

{E : Type u_6}
[SeminormedGroup E]
{r : ℝ}
(x : ↑(Metric.sphere 1 r))


/-- The chain rule.

Note that the function `h₂` is a function on an algebra. If you are looking for the chain rule
with `h₂` taking values in a vector space, use `HasDerivAt.scomp`. -/
nonrec theorem HasDerivAt.comp (hh₂ : HasDerivAt h₂ h₂' (h x)) (hh : HasDerivAt h h' x) :
    HasDerivAt (h₂ ∘ h) (h₂' * h') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{h : 𝕜 → 𝕜'}
{h₂ : 𝕜' → 𝕜'}
{h' h₂' : 𝕜'}
(hh₂ : HasDerivAt h₂ h₂' (h x))
(hh : HasDerivAt h h' x)


/-- If `X` is a uniform space with countably generated uniformity filter, there exists a
`PseudoMetricSpace` structure compatible with the `UniformSpace` structure. Use
`UniformSpace.pseudoMetricSpace` or `UniformSpace.metricSpace` instead. -/
protected theorem UniformSpace.metrizable_uniformity (X : Type*) [UniformSpace X]
    [IsCountablyGenerated (𝓤 X)] : ∃ I : PseudoMetricSpace X, I.toUniformSpace = ‹_›

(X : Type u_2)
[UniformSpace X]
[(𝓤 X).IsCountablyGenerated]

∃ I, PseudoMetricSpace.toUniformSpace = inst✝


theorem explicitCokernelDesc_unique {X Y Z : SemiNormedGrp.{u}} {f : X ⟶ Y} {g : Y ⟶ Z}
    (w : f ≫ g = 0) (e : explicitCokernel f ⟶ Z) (he : explicitCokernelπ f ≫ e = g) :
    e = explicitCokernelDesc w

(e : SemiNormedGrp.explicitCokernel f ⟶ Z)

(he : SemiNormedGrp.explicitCokernelπ f ≫ e = g)

e = SemiNormedGrp.explicitCokernelDesc w


theorem diff_erase (l₁ l₂ : List α) (a : α) : (l₁.diff l₂).erase a = (l₁.erase a).diff l₂

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


@[simp]
theorem inner_neg_left (x y : E) : ⟪-x, y⟫ = -⟪x, y⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)


@[simp]
theorem lintegral_const_mul (r : ℝ≥0∞) {f : α → ℝ≥0∞} (hf : Measurable f) :
    ∫⁻ a, r * f a ∂μ = r * ∫⁻ a, f a ∂μ

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

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


/-- If the submodule `P` has a basis, `x ∈ P` iff it is a linear combination of basis vectors. -/
theorem mem_submodule_iff {P : Submodule R M} (b : Basis ι R P) {x : M} :
    x ∈ P ↔ ∃ c : ι →₀ R, x = Finsupp.sum c fun i x => x • (b i : M)

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{P : Submodule R M}
(b : Basis ι R ↥P)
{x : M}

x ∈ P ↔ ∃ c, x = c.sum fun i x => x • ↑(b i)


protected theorem isOpenMap : IsOpenMap f

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
(hf : IsCoveringMap f)


theorem IsOpenImmersion.isOpen_range {X Y : Scheme.{u}} (f : X ⟶ Y) [H : IsOpenImmersion f] :
    IsOpen (Set.range f.1.base)

[H : AlgebraicGeometry.IsOpenImmersion f]


lemma CFC.exists_sqrt_of_isSelfAdjoint_of_spectrumRestricts {A : Type*} [Ring A] [StarRing A]
    [TopologicalSpace A] [Algebra ℝ A] [ContinuousFunctionalCalculus ℝ (IsSelfAdjoint : A → Prop)]
    {a : A} (ha₁ : IsSelfAdjoint a) (ha₂ : SpectrumRestricts a ContinuousMap.realToNNReal) :
    ∃ x : A, IsSelfAdjoint x ∧ SpectrumRestricts x ContinuousMap.realToNNReal ∧ x ^ 2 = a

(ha₂ : SpectrumRestricts a ⇑ContinuousMap.realToNNReal)

∃ x, IsSelfAdjoint x ∧ SpectrumRestricts x ⇑ContinuousMap.realToNNReal ∧ x ^ 2 = a


protected theorem proj_eq (h : IsHomeomorphicTrivialFiberBundle F proj) :
    ∃ e : Z ≃ₜ B × F, proj = Prod.fst ∘ e


@[aesop unsafe 10% (rule_sets := [Matroid])]
lemma closure_subset_ground (M : Matroid α) (X : Set α) : M.closure X ⊆ M.E

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


@[simp]
theorem Iic_prod_Iic (a : α) (b : β) : Iic a ×ˢ Iic b = Iic (a, b)

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


ArithmeticFunction.pow 0 = ArithmeticFunction.zeta


/-- The left fraction from `X` to `Y` given by a morphism `f : X ⟶ Y`. -/
@[simps]
def ofHom (f : X ⟶ Y) [W.ContainsIdentities] :
    W.LeftFraction X Y

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(W : CategoryTheory.MorphismProperty C)
{X Y : C}
(f : X ⟶ Y)
[W.ContainsIdentities]

(CategoryTheory.MorphismProperty.LeftFraction.ofHom W f).s = CategoryTheory.CategoryStruct.id Y


/-- Preimage of a set neighborhood of `t` under a continuous map `f` is a set neighborhood of `s`
provided that `f` maps `s` to `t`.  -/
theorem Continuous.tendsto_nhdsSet {f : X → Y} {t : Set Y} (hf : Continuous f)
    (hst : MapsTo f s t) : Tendsto f (𝓝ˢ s) (𝓝ˢ t)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
{f : X → Y}
{t : Set Y}
(hf : Continuous f)
(hst : Set.MapsTo f s t)


@[to_additive]
theorem right_dom_of_mul_dom [Mul α] {a b : Part α} (hab : Dom (a * b)) : b.Dom

{α : Type u_1}
[Mul α]
{a b : Part α}
(hab : (a * b).Dom)


protected theorem le_inf {a b c : CauSeq α abs} (hb : a ≤ b) (hc : a ≤ c) : a ≤ b ⊓ c

{α : Type u_1}
[LinearOrderedField α]
{a b c : CauSeq α abs}
(hb : a ≤ b)
(hc : a ≤ c)


@[simp] lemma isLUB_supClosure : IsLUB (supClosure s) a ↔ IsLUB s a

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


theorem convexBodySumFun_neg (x : E K) :
    convexBodySumFun (- x) = convexBodySumFun x

(x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ))

NumberField.mixedEmbedding.convexBodySumFun (-x) = NumberField.mixedEmbedding.convexBodySumFun x


@[simps]
instance [Add α] {a b : Thunk α} (εa εb : Type*) [EstimatorData a εa] [EstimatorData b εb] :
    EstimatorData (a + b) (εa × εb)

{α : Type u_1}
[Add α]
{a b : Thunk α}
(εa : Type u_3)
(εb : Type u_4)
[EstimatorData a εa]
[EstimatorData b εb]
(e : εa × εb)

EstimatorData.improve (a + b) e =
  match EstimatorData.improve a e.1 with
  | some e' => some (e', e.2)
  | none =>
    match EstimatorData.improve b e.2 with
    | some e' => some (e.1, e')
    | none => none


@[simp]
theorem sInf_diff_singleton_top (s : Set α) : sInf (s \ {⊤}) = sInf s

{α : Type u_1}
[CompleteLattice α]
(s : Set α)


@[simp] lemma empty_basis_iff : M.Basis ∅ X ↔ X ⊆ M.closure ∅

{α : Type u_2}
{M : Matroid α}
{X : Set α}


/-- `ContinuousMultilinearMap.pi` as a `LinearEquiv`. -/
@[simps (config := { simpRhs := true })]
def piLinearEquiv {ι' : Type*} {M' : ι' → Type*} [∀ i, AddCommMonoid (M' i)]
    [∀ i, TopologicalSpace (M' i)] [∀ i, ContinuousAdd (M' i)] [∀ i, Module R' (M' i)]
    [∀ i, Module A (M' i)] [∀ i, SMulCommClass A R' (M' i)] [∀ i, ContinuousConstSMul R' (M' i)] :
    (∀ i, ContinuousMultilinearMap A M₁ (M' i)) ≃ₗ[R'] ContinuousMultilinearMap A M₁ (∀ i, M' i)

[∀ (i : ι'), ContinuousConstSMul R' (M' i)]

∀ (a : ContinuousMultilinearMap A M₁ ((i : ι') → M' i)) (i : ι'),
  ContinuousMultilinearMap.piLinearEquiv.symm a i = (ContinuousLinearMap.proj i).compContinuousMultilinearMap a


@[to_additive (attr := simp)]
lemma UniformOnFun.one_apply [One β] : ofFun 𝔖 (1 : α → β) = 1

{α : Type u_1}
{β : Type u_2}
{𝔖 : Set (Set α)}
[One β]


@[to_additive (attr := simp)]
theorem coe_monoidHom (f : α →*o β) : ((f : α →* β) : α → β) = f

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[AddZeroClass α]
[AddZeroClass β]
(f : α →+o β)


lemma neg_point (P : W.Point) : (-P).point = W.negMap P.point

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
(P : W.Point)


/-- The region between two a.e.-measurable functions on a null-measurable set is null-measurable;
a version for the region together with the graphs of both functions. -/
lemma nullMeasurableSet_region_between_cc (μ : Measure α)
    {f g : α → ℝ} (f_mble : AEMeasurable f μ) (g_mble : AEMeasurable g μ)
    {s : Set α} (s_mble : NullMeasurableSet s μ) :
    NullMeasurableSet {p : α × ℝ | p.1 ∈ s ∧ p.snd ∈ Icc (f p.fst) (g p.fst)} (μ.prod volume)

(s_mble : MeasureTheory.NullMeasurableSet s μ)

MeasureTheory.NullMeasurableSet {p | p.1 ∈ s ∧ p.2 ∈ Set.Icc (f p.1) (g p.1)} (μ.prod MeasureTheory.volume)


/-- Given two points in an affine subspace, the angles between those two points at two other
points on opposite sides of that subspace have opposite signs. -/
theorem _root_.AffineSubspace.SOppSide.oangle_sign_eq_neg {s : AffineSubspace ℝ P} {p₁ p₂ p₃ p₄ : P}
    (hp₁ : p₁ ∈ s) (hp₂ : p₂ ∈ s) (hp₃p₄ : s.SOppSide p₃ p₄) :
    (∡ p₁ p₄ p₂).sign = -(∡ p₁ p₃ p₂).sign

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


@[simp]
theorem mk'_zero (h : IsIntegral R (0 : B) := isIntegral_zero) : mk' A 0 h = 0

{R : Type u_1}
(A : Type u_2)
{B : Type u_3}
[CommRing R]
[CommRing A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[IsIntegralClosure A R B]
(h : IsIntegral R 0 := ⋯)


theorem of_card_aut_eq_finrank [FiniteDimensional F E]
    (h : Fintype.card (E ≃ₐ[F] E) = finrank F E) : IsGalois F E

(h : Fintype.card (E ≃ₐ[F] E) = FiniteDimensional.finrank F E)


theorem lineDerivWithin_of_isOpen (hs : IsOpen s) (hx : x ∈ s) :
    lineDerivWithin 𝕜 f s x v = lineDeriv 𝕜 f x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : E → F}
{s : Set E}
{x v : E}
(hs : IsOpen s)
(hx : x ∈ s)


@[simp] protected theorem rank_top : Module.rank (⊤ : IntermediateField F E) E = 1

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]


@[to_additive sub]
theorem Filter.Tendsto.div' {f g : α → G} {l : Filter α} {a b : G} (hf : Tendsto f l (𝓝 a))
    (hg : Tendsto g l (𝓝 b)) : Tendsto (fun x => f x / g x) l (𝓝 (a / b))

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Div G]
[ContinuousDiv G]
{f g : α → G}
{l : Filter α}
{a b : G}
(hf : Filter.Tendsto f l (𝓝 a))
(hg : Filter.Tendsto g l (𝓝 b))

Filter.Tendsto (fun x => f x / g x) l (𝓝 (a / b))


theorem coe_injective : Injective ((↑) : Regular α → α)


theorem modify_WF [BEq α] [Hashable α] {m : Imp α β} {k}
    (h : m.buckets.WF) : (modify m k f).buckets.WF

{α : Type u_1}
{β : Type u_2}
{f : α → β → β}
[BEq α]
[Hashable α]
{m : Batteries.HashMap.Imp α β}
{k : α}
(h : m.buckets.WF)


theorem exists_lt_of_directed_ge [IsDirected β (· ≥ ·)] [Nontrivial β] : ∃ a b : β, a < b

(β : Type v)
[PartialOrder β]
[IsDirected β fun x x_1 => x ≥ x_1]
[Nontrivial β]


theorem Antitone.map_max (hf : Antitone f) : f (max a b) = min (f a) (f b)

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


@[simp]
theorem map_add [DecidableEq ι] (m : ι → M) (i : ι) (x y : M) :
    f (update m i (x + y)) = f (update m i x) + f (update m i y)

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
(f : M [⋀^ι]→L[R] N)
[DecidableEq ι]
(m : ι → M)
(i : ι)
(x y : M)

f (Function.update m i (x + y)) = f (Function.update m i x) + f (Function.update m i y)


@[simp]
theorem neg_apply (Q : QuadraticMap R M N) (x : M) : (-Q) x = -Q x

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(Q : QuadraticMap R M N)
(x : M)


@[simp]
theorem proj_apply (i j : n) (x : n → A) : proj (R := R) i j x = x i * x j

{R : Type u_3}
{A : Type u_7}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
{n : Type u_9}
(i j : n)
(x : n → A)


/-- The obvious functor `(ShortComplex C)ᵒᵖ ⥤ ShortComplex Cᵒᵖ`. -/
@[simps]
def opFunctor : (ShortComplex C)ᵒᵖ ⥤ ShortComplex Cᵒᵖ

(CategoryTheory.ShortComplex.opFunctor C).obj S = (Opposite.unop S).op


/-- A value is accessible iff it isn't contained in any infinite decreasing sequence. -/
theorem acc_iff_no_decreasing_seq {x} :
    Acc r x ↔ IsEmpty { f : ((· > ·) : ℕ → ℕ → Prop) ↪r r // x ∈ Set.range f }

{α : Type u_1}
{r : α → α → Prop}
[IsStrictOrder α r]
{x : α}

Acc r x ↔ IsEmpty { f // x ∈ Set.range ⇑f }


@[simp, reassoc]
theorem t_fst_snd (i j : 𝒰.J) :
    t 𝒰 f g i j ≫ pullback.fst _ _ ≫ pullback.snd _ _ = pullback.fst _ _ ≫ pullback.snd _ _

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

AlgebraicGeometry.Scheme.Pullback.t 𝒰 f g i j ≫
    CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map j ≫ f) g ≫ 𝒰.map j) (𝒰.map i) ≫
      CategoryTheory.Limits.pullback.snd (𝒰.map j ≫ f) g =
  CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g ≫ 𝒰.map i) (𝒰.map j) ≫
    CategoryTheory.Limits.pullback.snd (𝒰.map i ≫ f) g


theorem adjoin_le {S : StarSubalgebra R A} {s : Set A} (hs : s ⊆ S) : adjoin R s ≤ S

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
{S : StarSubalgebra R A}
{s : Set A}
(hs : s ⊆ ↑S)


theorem Measure.toOuterMeasure_apply (μ : Measure α) (s : Set α) :
    μ.toOuterMeasure s = μ s

{α : Type u_1}
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)
(s : Set α)


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

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


@[to_additive]
theorem finprod_mem_inter_mulSupport_eq' (f : α → M) (s t : Set α)
    (h : ∀ x ∈ mulSupport f, x ∈ s ↔ x ∈ t) : ∏ᶠ i ∈ s, f i = ∏ᶠ i ∈ t, f i

(h : ∀ x ∈ Function.mulSupport f, x ∈ s ↔ x ∈ t)

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


theorem mk_of_lt (ζ : M) (hk : 0 < k) (h1 : ζ ^ k = 1) (h : ∀ l : ℕ, 0 < l → l < k → ζ ^ l ≠ 1) :
    IsPrimitiveRoot ζ k

(h : ∀ (l : ℕ), 0 < l → l < k → ζ ^ l ≠ 1)


theorem le_mul_ediam_image (hf : AntilipschitzWith K f) (s : Set α) : diam s ≤ K * diam (f '' s)

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : AntilipschitzWith K f)
(s : Set α)

EMetric.diam s ≤ ↑K * EMetric.diam (f '' s)


/-- A modification `Γ` between oplax natural transformations `η` and `θ` consists of a family of
2-morphisms `Γ.app a : η.app a ⟶ θ.app a`, which satisfies the equation
`(F.map f ◁ app b) ≫ θ.naturality f = η.naturality f ≫ (app a ▷ G.map f)`
for each 1-morphism `f : a ⟶ b`.
-/
@[ext]
structure Modification (η θ : F ⟶ G) where
  app (a : B) : η.app a ⟶ θ.app a
  naturality :
    ∀ {a b : B} (f : a ⟶ b),
      F.map f ◁ app b ≫ θ.naturality f = η.naturality f ≫ app a ▷ G.map f := by
    aesop_cat

(self : CategoryTheory.OplaxNatTrans.Modification η θ)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (F.map f) (self.app b)) (θ.naturality f) =
  CategoryTheory.CategoryStruct.comp (η.naturality f) (CategoryTheory.Bicategory.whiskerRight (self.app a) (G.map f))


@[simp]
theorem mapPath_toPath {a b : V} (f : a ⟶ b) : F.mapPath f.toPath = (F.map f).toPath

{V : Type u₁}
[Quiver V]
{W : Type u₂}
[Quiver W]
(F : V ⥤q W)
{a b : V}
(f : a ⟶ b)


theorem IsCoprime.of_prod_left (H1 : IsCoprime (∏ i ∈ t, s i) x) (i : I) (hit : i ∈ t) :
    IsCoprime (s i) x

{R : Type u}
{I : Type v}
[CommSemiring R]
{x : R}
{s : I → R}
{t : Finset I}
(H1 : IsCoprime (∏ i ∈ t, s i) x)
(i : I)
(hit : i ∈ t)


theorem range_comp_le_range (f : A →⋆ₙₐ[R] B) (g : B →⋆ₙₐ[R] C) :
    NonUnitalStarAlgHom.range (g.comp f) ≤ NonUnitalStarAlgHom.range g

{R : Type u}
{A : Type v}
{B : Type w}
{C : Type w'}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[Star B]
[NonUnitalNonAssocSemiring C]
[Module R C]
[Star C]
(f : A →⋆ₙₐ[R] B)
(g : B →⋆ₙₐ[R] C)


theorem setOf_base_eq_maximals_setOf_indep : {B | M.Base B} = maximals (· ⊆ ·) {I | M.Indep I}

{B | M.Base B} = maximals (fun x x_1 => x ⊆ x_1) {I | M.Indep I}


/-- Moves one-sided left toNat equality to BitVec equality. -/
theorem toNat_eq_nat (x : BitVec w) (y : Nat)
  : (x.toNat = y) ↔ (y < 2^w ∧ (x = BitVec.ofNat w y))

x.toNat = y ↔ y < 2 ^ w ∧ x = BitVec.ofNat w y


/-- A typeclass for when a `MulAction β α` descends to the quotient `α ⧸ H`. -/
class QuotientAction : Prop where
  /-- The action fulfils a normality condition on products that lie in `H`.
    This ensures that the action descends to an action on the quotient `α ⧸ H`. -/
  inv_mul_mem : ∀ (b : β) {a a' : α}, a⁻¹ * a' ∈ H → (b • a)⁻¹ * b • a' ∈ H

{α : Type u}
{β : Type v}
[Group α]
[Monoid β]
[MulAction β α]
{H : Subgroup α}
[self : MulAction.QuotientAction β H]
(b : β)
{a a' : α}


/-- Every split epi `f` with a kernel induces a binary bicone with `f` as its `snd` and
the kernel map as its `inl`.
We will show in `binary_bicone_of_is_split_mono_of_cokernel` that this binary bicone is in fact
already a biproduct. -/
@[simps]
def binaryBiconeOfIsSplitEpiOfKernel {X Y : C} {f : X ⟶ Y} [IsSplitEpi f] {c : KernelFork f}
    (i : IsLimit c) : BinaryBicone c.pt Y

{c : CategoryTheory.Limits.KernelFork f}

(CategoryTheory.Limits.binaryBiconeOfIsSplitEpiOfKernel i).inl = CategoryTheory.Limits.Fork.ι c


theorem IsPrimePow.pos {n : ℕ} (hn : IsPrimePow n) : 0 < n


theorem IsPreirreducible.open_subset {U : Set X} (ht : IsPreirreducible t) (hU : IsOpen U)
    (hU' : U ⊆ t) : IsPreirreducible U

{X : Type u_1}
[TopologicalSpace X]
{t U : Set X}
(ht : IsPreirreducible t)
(hU : IsOpen U)
(hU' : U ⊆ t)


@[to_additive AddMonoid.one_lt_exponent]
lemma one_lt_exponent [Nontrivial G] : 1 < Monoid.exponent G

{G : Type u}
[LeftCancelMonoid G]
[Finite G]
[Nontrivial G]


theorem image_preimage_of_bij [DecidableEq β] (f : α → β) (s : Finset β)
    (hf : Set.BijOn f (f ⁻¹' ↑s) ↑s) : image f (preimage s f hf.injOn) = s

{α : Type u}
{β : Type v}
[DecidableEq β]
(f : α → β)
(s : Finset β)
(hf : Set.BijOn f (f ⁻¹' ↑s) ↑s)


/-- Two group isomorphisms `G ≃* G'` are equal if and only if they agree on a generator of `G`. -/
@[to_additive
   "Two isomorphisms `G ≃+ G'` of additive groups are equal if and only if they agree
   on a generator of `G`."]
lemma MulEquiv.eq_iff_eq_on_generator (f₁ f₂ : G ≃* G') : f₁ = f₂ ↔ f₁ g = f₂ g

(hg : ∀ (x : G), x ∈ AddSubgroup.zmultiples g)


/-- If `f : X → Y` is an `Inducing` map, the image `f '' s` of a set `s` is compact
  if and only if `s` is compact. -/
theorem Inducing.isCompact_iff {f : X → Y} (hf : Inducing f) :
    IsCompact s ↔ IsCompact (f '' s)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
{f : X → Y}
(hf : Inducing f)


/-- This lemma is used in the proof of `elementalStarAlgebra.isUnit_of_isUnit_of_isStarNormal`,
which in turn is the key to spectral permanence `StarSubalgebra.spectrum_eq`, which is itself
necessary for the continuous functional calculus. Using the continuous functional calculus, this
lemma can be superseded by one that omits the `IsStarNormal` hypothesis. -/
theorem spectrum_star_mul_self_of_isStarNormal :
    spectrum ℂ (star a * a) ⊆ Set.Icc (0 : ℂ) ‖star a * a‖

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

spectrum ℂ (star a * a) ⊆ Set.Icc 0 ↑‖star a * a‖


nonrec theorem SeminormedAddCommGroup.cauchySeq_of_le_geometric {C : ℝ} {r : ℝ} (hr : r < 1)
    {u : ℕ → α} (h : ∀ n, ‖u n - u (n + 1)‖ ≤ C * r ^ n) : CauchySeq u

(h : ∀ (n : ℕ), ‖u n - u (n + 1)‖ ≤ C * r ^ n)


theorem add_congr {a b c d : Int} (h₁ : a = b) (h₂ : c = d) : a + c = b + d


@[to_additive (attr := simp) mod_natCard_zsmul]
lemma zpow_mod_natCard (a : G) (n : ℤ) : a ^ (n % Nat.card G : ℤ) = a ^ n

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


lemma ext_cochain_from_iff (i j : ℤ) (hij : i + 1 = j)
    {K : CochainComplex C ℤ} {γ₁ γ₂ : Cochain (mappingCone φ) K j} :
    γ₁ = γ₂ ↔
      (inl φ).comp γ₁ (show _ = i by omega) = (inl φ).comp γ₂ (by omega) ∧
        (Cochain.ofHom (inr φ)).comp γ₁ (zero_add j) =
          (Cochain.ofHom (inr φ)).comp γ₂ (zero_add j)

{γ₁ γ₂ : CochainComplex.HomComplex.Cochain (CochainComplex.mappingCone φ) K j}

γ₁ = γ₂ ↔
  (CochainComplex.mappingCone.inl φ).comp γ₁ ⋯ = (CochainComplex.mappingCone.inl φ).comp γ₂ ⋯ ∧
    (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.inr φ)).comp γ₁ ⋯ =
      (CochainComplex.HomComplex.Cochain.ofHom (CochainComplex.mappingCone.inr φ)).comp γ₂ ⋯


@[simp, nolint simpNF]
theorem liftRel_pure (R : α → β → Prop) (a : α) (b : β) :
    LiftRel R (pure a) (pure b) ↔ R a b

{α : Type u}
{β : Type v}
(R : α → β → Prop)
(a : α)
(b : β)

Computation.LiftRel R (Computation.pure a) (Computation.pure b) ↔ R a b


theorem hasStrictDerivAt_exp (x : ℝ) : HasStrictDerivAt exp (exp x) x

HasStrictDerivAt Real.exp (Real.exp x) x


@[nolint unusedHavesSuffices] -- false positive from unfolding String.mapAux
theorem mapAux_of_valid (f : Char → Char) : ∀ l r, mapAux f ⟨utf8Len l⟩ ⟨l ++ r⟩ = ⟨l ++ r.map f⟩

String.mapAux f { byteIdx := String.utf8Len l } { data := l ++ r } = { data := l ++ List.map f r }


/-- Special case of `integral_deriv_mul_eq_sub_of_hasDeriv_right` where the functions have a
  derivative at the endpoints. -/
theorem integral_deriv_mul_eq_sub {u v u' v' : ℝ → A}
    (hu : ∀ x ∈ [[a, b]], HasDerivAt u (u' x) x)
    (hv : ∀ x ∈ [[a, b]], HasDerivAt v (v' x) x)
    (hu' : IntervalIntegrable u' volume a b)
    (hv' : IntervalIntegrable v' volume a b) :
    ∫ x in a..b, u' x * v x + u x * v' x = u b * v b - u a * v a

(hu' : IntervalIntegrable u' MeasureTheory.volume a b)

(hv' : IntervalIntegrable v' MeasureTheory.volume a b)

∫ (x : ℝ) in a..b, u' x * v x + u x * v' x = u b * v b - u a * v a


theorem fix_aux {α σ} (f : α →. σ ⊕ α) (a : α) (b : σ) :
    let F : α → ℕ →. σ ⊕ α := fun a n =>
      n.rec (some (Sum.inr a)) fun _ IH => IH.bind fun s => Sum.casesOn s (fun _ => Part.some s) f
    (∃ n : ℕ,
        ((∃ b' : σ, Sum.inl b' ∈ F a n) ∧ ∀ {m : ℕ}, m < n → ∃ b : α, Sum.inr b ∈ F a m) ∧
          Sum.inl b ∈ F a n) ↔
      b ∈ PFun.fix f a

{α : Type u_5}
{σ : Type u_6}
(f : α →. σ ⊕ α)
(a : α)
(b : σ)

let F := fun a n =>
  Nat.rec (Part.some (Sum.inr a)) (fun x IH => IH.bind fun s => Sum.casesOn s (fun x => Part.some s) f) n;
(∃ n, ((∃ b', Sum.inl b' ∈ F a n) ∧ ∀ {m : ℕ}, m < n → ∃ b, Sum.inr b ∈ F a m) ∧ Sum.inl b ∈ F a n) ↔ b ∈ f.fix a


/-- p-groups with different p are disjoint -/
theorem disjoint_of_ne (p₁ p₂ : ℕ) [hp₁ : Fact p₁.Prime] [hp₂ : Fact p₂.Prime] (hne : p₁ ≠ p₂)
    (H₁ H₂ : Subgroup G) (hH₁ : IsPGroup p₁ H₁) (hH₂ : IsPGroup p₂ H₂) : Disjoint H₁ H₂

{G : Type u_1}
[Group G]
(p₁ p₂ : ℕ)
[hp₁ : Fact (Nat.Prime p₁)]
[hp₂ : Fact (Nat.Prime p₂)]
(hne : p₁ ≠ p₂)
(H₁ H₂ : Subgroup G)
(hH₁ : IsPGroup p₁ ↥H₁)
(hH₂ : IsPGroup p₂ ↥H₂)


/-- Rotating triangles gives an endofunctor on the category of triangles in `C`.
-/
@[simps]
def rotate : Triangle C ⥤ Triangle C

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.HasShift C ℤ]

∀ {X Y : CategoryTheory.Pretriangulated.Triangle C} (f : X ⟶ Y),
  ((CategoryTheory.Pretriangulated.rotate C).map f).hom₂ = f.hom₃


@[simp]
theorem coe_ennreal_eq_top_iff {x : ℝ≥0∞} : (x : EReal) = ⊤ ↔ x = ⊤

↑x = ⊤ ↔ x = ⊤


theorem factors_mul {x y : α} (hx : x ≠ 0) (hy : y ≠ 0) :
    Multiset.Rel Associated (factors (x * y)) (factors x + factors y)

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
{x y : α}
(hx : x ≠ 0)
(hy : y ≠ 0)

Multiset.Rel Associated (UniqueFactorizationMonoid.factors (x * y))
  (UniqueFactorizationMonoid.factors x + UniqueFactorizationMonoid.factors y)


/--
A universe polymorphic Yoneda presheaf on `TopCat` given by continuous maps into a topoological
space `Y`.
-/
@[simps]
def yonedaPresheaf' : TopCat.{w}ᵒᵖ ⥤ Type (max w w')

∀ {X Y_1 : TopCatᵒᵖ} (f : X ⟶ Y_1) (g : C(↑(Opposite.unop X), Y)),
  (ContinuousMap.yonedaPresheaf' Y).map f g = g.comp f.unop


theorem ae_snd (h : IdentDistrib f g μ ν) {p : γ → Prop} (pmeas : MeasurableSet {x | p x})
    (hp : ∀ᵐ x ∂μ, p (f x)) : ∀ᵐ x ∂ν, p (g x)

(h : ProbabilityTheory.IdentDistrib f g μ ν)


theorem frobenius_one : frobenius R p 1 = 1

{R : Type u}
[CommSemiring R]
(p : ℕ)
[ExpChar R p]


theorem pos_of_sign_eq_one : ∀ {a : Int}, sign a = 1 → 0 < a