@[reassoc (attr := simp)]
theorem hom_inv_whiskerRight {f g : a ⟶ b} (η : f ≅ g) (h : b ⟶ c) :
    η.hom ▷ h ≫ η.inv ▷ h = 𝟙 (f ≫ h)

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c : B}
{f g : a ⟶ b}
(η : f ≅ g)
(h : b ⟶ c)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight η.hom h)
    (CategoryTheory.Bicategory.whiskerRight η.inv h) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.CategoryStruct.comp f h)


@[simp]
theorem id_f (C : HomologicalComplex V c) (i : ι) : Hom.f (𝟙 C) i = 𝟙 (C.X i)


@[simp]
theorem intrinsicInterior_union_intrinsicFrontier (s : Set P) :
    intrinsicInterior 𝕜 s ∪ intrinsicFrontier 𝕜 s = intrinsicClosure 𝕜 s

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


@[to_additive] lemma isSquare_mabs : IsSquare |a|ₘ ↔ IsSquare a

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


@[simp]
theorem quotMapCMapSpanMkEquivQuotMapCQuotMapSpanMk_symm_quotQuotMk (p : R[X]) :
    (quotMapCMapSpanMkEquivQuotMapCQuotMapSpanMk I f).symm (quotQuotMk (I.map C) (span {f}) p) =
      Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk (span {f})) (I.map (C : R →+* R[X])))
        (mk f p)

{R : Type u}
[CommRing R]
(I : Ideal R)
(f p : R[X])

(AdjoinRoot.quotMapCMapSpanMkEquivQuotMapCQuotMapSpanMk I f).symm
    ((DoubleQuot.quotQuotMk (Ideal.map Polynomial.C I) (Ideal.span {f})) p) =
  (Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk (Ideal.span {f})) (Ideal.map Polynomial.C I))) ((AdjoinRoot.mk f) p)


@[simp]
theorem biproduct.isoCoproduct_inv {f : J → C} [HasBiproduct f] :
    (biproduct.isoCoproduct f).inv = Sigma.desc (biproduct.ι f)

(CategoryTheory.Limits.biproduct.isoCoproduct f).inv =
  CategoryTheory.Limits.Sigma.desc (CategoryTheory.Limits.biproduct.ι f)


theorem Dvd.intro (c : α) (h : a * c = b) : a ∣ b

{α : Type u_1}
[Semigroup α]
{a b : α}
(c : α)
(h : a * c = b)


@[to_additive]
theorem apply_mulIndicator_symmDiff {g : G → β} (hg : ∀ x, g x⁻¹ = g x)
    (s t : Set α) (f : α → G) (x : α) :
    g (mulIndicator (s ∆ t) f x) = g (mulIndicator s f x / mulIndicator t f x)

{α : Type u_1}
{β : Type u_2}
{G : Type u_6}
[Group G]
{g : G → β}
(hg : ∀ (x : G), g x⁻¹ = g x)
(s t : Set α)
(f : α → G)
(x : α)

g ((symmDiff s t).mulIndicator f x) = g (s.mulIndicator f x / t.mulIndicator f x)


@[to_additive]
lemma HasCompactMulSupport.exists_pos_le_norm [One E] (hf : HasCompactMulSupport f) :
    ∃ R : ℝ, 0 < R ∧ ∀ x : α, R ≤ ‖x‖ → f x = 1

{α : Type u_1}
{E : Type u_3}
[NormedAddGroup α]
{f : α → E}
[One E]
(hf : HasCompactMulSupport f)

∃ R, 0 < R ∧ ∀ (x : α), R ≤ ‖x‖ → f x = 1


theorem id_map {α : Type _} (x : F α) : id <$> x = x

{F : Type u → Type u}
[q : QPF F]
{α : Type u}
(x : F α)


lemma fib_greatestFib_le (n : ℕ) : fib (greatestFib n) ≤ n


@[simp]
theorem mapEquiv_refl_refl : mapEquiv F (Equiv.refl α) (Equiv.refl α') = Equiv.refl (F α α')

{α : Type u}
{α' : Type v}
(F : Type u → Type v → Type w)
[Bifunctor F]
[LawfulBifunctor F]

Bifunctor.mapEquiv F (Equiv.refl α) (Equiv.refl α') = Equiv.refl (F α α')


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
lemma nonempty_Ioi : (Ioi a).Nonempty ↔ ¬ IsMax a

{α : Type u_2}
[Preorder α]
{a : α}
[LocallyFiniteOrderTop α]


theorem hasFPowerSeriesOnBall_exp_of_radius_pos (h : 0 < (expSeries 𝕂 𝔸).radius) :
    HasFPowerSeriesOnBall (exp 𝕂) (expSeries 𝕂 𝔸) 0 (expSeries 𝕂 𝔸).radius

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

HasFPowerSeriesOnBall (NormedSpace.exp 𝕂) (NormedSpace.expSeries 𝕂 𝔸) 0 (NormedSpace.expSeries 𝕂 𝔸).radius


@[simp, norm_cast]
theorem coe_natCast [NatCast β] (n : ℕ) : ((n : C(α, β)) : α → β) = n

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[NatCast β]
(n : ℕ)


/-- The isomorphism between points of limit cokernel coforks induced by an isomorphism
in the category of arrows. -/
@[simps]
def mapIsoOfIsColimit {cc : CokernelCofork f} {cc' : CokernelCofork f'}
    (hf : IsColimit cc) (hf' : IsColimit cc')
    (φ : Arrow.mk f ≅ Arrow.mk f') : cc.pt ≅ cc'.pt

{cc : CategoryTheory.Limits.CokernelCofork f}

{cc' : CategoryTheory.Limits.CokernelCofork f'}

(hf : CategoryTheory.Limits.IsColimit cc)

(hf' : CategoryTheory.Limits.IsColimit cc')

(φ : CategoryTheory.Arrow.mk f ≅ CategoryTheory.Arrow.mk f')

(CategoryTheory.Limits.CokernelCofork.mapIsoOfIsColimit hf hf' φ).inv =
  CategoryTheory.Limits.CokernelCofork.mapOfIsColimit hf' cc φ.inv


theorem nhds_zero : 𝓝 (0 : Γ₀) = ⨅ γ ≠ 0, 𝓟 (Iio γ)

{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]


@[simp]
theorem iterate_comp_eval :
    ∀ (k : ℕ) (t : R), (p.comp^[k] q).eval t = (fun x => p.eval x)^[k] (q.eval t)

{R : Type u}
[CommSemiring R]
{p q : R[X]}
(k : ℕ)
(t : R)

Polynomial.eval t (p.comp^[k] q) = (fun x => Polynomial.eval x p)^[k] (Polynomial.eval t q)


lemma HomologyData.exact_iff_i_p_zero (h : S.HomologyData) :
    S.Exact ↔ h.left.i ≫ h.right.p = 0

S.Exact ↔ CategoryTheory.CategoryStruct.comp h.left.i h.right.p = 0


theorem filterMap_eq_map_iff_forall_eq_some {f : α → Option β} {g : α → β} {l : List α} :
    l.filterMap f = l.map g ↔ ∀ x ∈ l, f x = some (g x)

{α : Type u}
{β : Type v}
{f : α → Option β}
{g : α → β}
{l : List α}

List.filterMap f l = List.map g l ↔ ∀ (x : α), x ∈ l → f x = some (g x)


@[simp]
theorem mk_sup (a b) : (mk (a ⊔ b) : ℝ) = mk a ⊔ mk b


/-- The functor `ComposableArrows C m ⥤ ComposableArrows C n` obtained by precomposition with
a functor `Fin (n + 1) ⥤ Fin (m + 1)`. -/
@[simps!]
def whiskerLeftFunctor (Φ : Fin (n + 1) ⥤ Fin (m + 1)) :
    ComposableArrows C m ⥤ ComposableArrows C n

(Φ : CategoryTheory.Functor (Fin (n + 1)) (Fin (m + 1)))

(F : CategoryTheory.ComposableArrows C m)

((CategoryTheory.ComposableArrows.whiskerLeftFunctor Φ).obj F).obj X = F.obj (Φ.obj X)


@[simp]
theorem nhdsWithin_compl_singleton_sup_pure (a : α) : 𝓝[≠] a ⊔ pure a = 𝓝 a

{α : Type u_1}
[TopologicalSpace α]
(a : α)


theorem measurableSet_Icc : MeasurableSet (Box.Icc I)

{ι : Type u_1}
(I : BoxIntegral.Box ι)
[Countable ι]


theorem atImInfty_basis : atImInfty.HasBasis (fun _ => True) fun i : ℝ => im ⁻¹' Set.Ici i

UpperHalfPlane.atImInfty.HasBasis (fun x => True) fun i => UpperHalfPlane.im ⁻¹' Set.Ici i


@[to_additive]
theorem isOpenMap_smul (c : G) : IsOpenMap fun x : α => c • x

{α : Type u_2}
{G : Type u_4}
[TopologicalSpace α]
[Group G]
[MulAction G α]
[ContinuousConstSMul G α]
(c : G)


@[simp]
theorem other_eq_other' [DecidableEq α] {a : α} {z : Sym2 α} (h : a ∈ z) :
    Mem.other h = Mem.other' h

{α : Type u_1}
[DecidableEq α]
{a : α}
{z : Sym2 α}
(h : a ∈ z)


theorem coneDiscreteComp_obj_mapCone :
    -- Porting note: check universe parameters here
    (coneDiscreteComp X).functor.obj (Functor.mapCone π (TopCat.piFan.{u,u} X)) =
      Limits.Fan.mk (πₓ (TopCat.of (∀ i, X i))) (proj X)

(FundamentalGroupoidFunctor.coneDiscreteComp X).functor.obj (π.mapCone (TopCat.piFan X)) =
  CategoryTheory.Limits.Fan.mk (π.obj (TopCat.of ((i : I) → ↑(X i)))) (FundamentalGroupoidFunctor.proj X)


theorem thickenedIndicatorAux_lt_top {δ : ℝ} {E : Set α} {x : α} :
    thickenedIndicatorAux δ E x < ∞

{α : Type u_1}
[PseudoEMetricSpace α]
{δ : ℝ}
{E : Set α}
{x : α}


/-- The equivalence class of a multiplicative norm on the rationals is determined by its values on
the natural numbers. -/
lemma equiv_on_nat_iff_equiv : (∃ c : ℝ, 0 < c ∧ (∀ n : ℕ , (f n) ^ c = g n)) ↔
    f.equiv g

(∃ c, 0 < c ∧ ∀ (n : ℕ), f ↑n ^ c = g ↑n) ↔ f.equiv g


/-- There exists only one solution of an ODE \(\dot x=v(t, x)\) in a set `s ⊆ ℝ × E` with
a given initial value provided that the RHS is Lipschitz continuous in `x` within `s`,
and we consider only solutions included in `s`.

This version shows uniqueness in a closed interval `Icc a b`, where `a` is the initial time. -/
theorem ODE_solution_unique_of_mem_Icc_right
    (hf : ContinuousOn f (Icc a b))
    (hf' : ∀ t ∈ Ico a b, HasDerivWithinAt f (v t (f t)) (Ici t) t)
    (hfs : ∀ t ∈ Ico a b, f t ∈ s t)
    (hg : ContinuousOn g (Icc a b))
    (hg' : ∀ t ∈ Ico a b, HasDerivWithinAt g (v t (g t)) (Ici t) t)
    (hgs : ∀ t ∈ Ico a b, g t ∈ s t)
    (ha : f a = g a) :
    EqOn f g (Icc a b)

(hv : ∀ (t : ℝ), LipschitzOnWith K (v t) (s t))

(hf' : ∀ t ∈ Set.Ico a b, HasDerivWithinAt f (v t (f t)) (Set.Ici t) t)

(hg' : ∀ t ∈ Set.Ico a b, HasDerivWithinAt g (v t (g t)) (Set.Ici t) t)


@[simp]
theorem realize_rel {k : ℕ} {R : L.Relations k} {ts : Fin k → L.Term α} :
    (R.formula ts).Realize v ↔ RelMap R fun i => (ts i).realize v

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{v : α → M}
{k : ℕ}
{R : L.Relations k}
{ts : Fin k → L.Term α}

(R.formula ts).Realize v ↔ FirstOrder.Language.Structure.RelMap R fun i => FirstOrder.Language.Term.realize v (ts i)


@[simp]
theorem coprodᵢ_neBot_iff [∀ i, Nonempty (α i)] : NeBot (Filter.coprodᵢ f) ↔ ∃ d, NeBot (f d)

{ι : Type u_1}
{α : ι → Type u_2}
{f : (i : ι) → Filter (α i)}
[∀ (i : ι), Nonempty (α i)]

(Filter.coprodᵢ f).NeBot ↔ ∃ d, (f d).NeBot


/-- 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₃ = (⋯.iso ⋯).hom


theorem iIndepSets.piiUnionInter_of_not_mem {π : ι → Set (Set Ω)} {a : ι} {S : Finset ι}
    (hp_ind : iIndepSets π κ μ) (haS : a ∉ S) :
    IndepSets (piiUnionInter π S) (π a) κ μ

(hp_ind : ProbabilityTheory.Kernel.iIndepSets π κ μ)

ProbabilityTheory.Kernel.IndepSets (piiUnionInter π ↑S) (π a) κ μ


theorem dist_le_two_norm' {f : γ → β} {C : ℝ} (hC : ∀ x, ‖f x‖ ≤ C) (x y : γ) :
    dist (f x) (f y) ≤ 2 * C

{β : Type v}
{γ : Type w}
[SeminormedAddCommGroup β]
{f : γ → β}
{C : ℝ}
(hC : ∀ (x : γ), ‖f x‖ ≤ C)
(x y : γ)


@[to_additive (attr := ext)]
theorem ext (h : ∀ x, x ∈ U ↔ x ∈ V) : U = V

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
{U V : OpenAddSubgroup G}
(h : ∀ (x : G), x ∈ U ↔ x ∈ V)


@[simp]
theorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄ h₅ h₆) :
    ((⟨⟨⟨⟨⟨f, h₁⟩, h₂⟩, h₃, h₄⟩, h₅⟩, h₆⟩ : A →⋆ₐ[R] B) : A → B) = f

(h₂ :
  ∀ (x y : A),
    { toFun := f, map_one' := h₁ }.toFun (x * y) =
      { toFun := f, map_one' := h₁ }.toFun x * { toFun := f, map_one' := h₁ }.toFun y)

(h₃ : (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun 0 = 0)

(h₄ :
  ∀ (x y : A),
    (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun (x + y) =
      (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun x +
        (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun y)

(h₅ :
  ∀ (r : R),
    (↑↑{ toFun := f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄ }).toFun ((algebraMap R A) r) =
      (algebraMap R B) r)

(h₆ :
  ∀ (x : A),
    (↑↑{ toFun := f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄, commutes' := h₅ }.toRingHom).toFun
        (star x) =
      star
        ((↑↑{ toFun := f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄,
                    commutes' := h₅ }.toRingHom).toFun
          x))

⇑{ toFun := f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄, commutes' := h₅, map_star' := h₆ } = f


@[simp]
theorem IsCycle.zpowersEquivSupport_symm_apply {σ : Perm α} (hσ : IsCycle σ) (n : ℕ) :
    hσ.zpowersEquivSupport.symm
        ⟨(σ ^ n) (Classical.choose hσ),
          pow_apply_mem_support.2 (mem_support.2 (Classical.choose_spec hσ).1)⟩ =
      ⟨σ ^ n, n, rfl⟩

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{σ : Equiv.Perm α}
(hσ : σ.IsCycle)
(n : ℕ)

hσ.zpowersEquivSupport.symm ⟨(σ ^ n) (Classical.choose hσ), ⋯⟩ = ⟨σ ^ n, ⋯⟩


theorem toIcoDiv_eq_of_sub_zsmul_mem_Ico (h : b - n • p ∈ Set.Ico a (a + p)) :
    toIcoDiv hp a b = n

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
{a b : α}
{n : ℤ}
(h : b - n • p ∈ Set.Ico a (a + p))


theorem odd_mul_odd {n m : ℕ} : n % 2 = 1 → m % 2 = 1 → n * m % 2 = 1


lemma exists_eq_ciSup_of_not_isSuccLimit
    (hf : BddAbove (Set.range f)) (hf' : ¬ IsSuccLimit (⨆ i, f i)) :
    ∃ i, f i = ⨆ i, f i

{ι : Type u_1}
{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
[Nonempty ι]
{f : ι → α}
(hf : BddAbove (Set.range f))
(hf' : ¬Order.IsSuccLimit (⨆ i, f i))


/-- `Matrix.conjTranspose` as a `RingEquiv` to the opposite ring -/
@[simps]
def conjTransposeRingEquiv [Semiring α] [StarRing α] [Fintype m] :
    Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ

(m : Type u_2)
(α : Type v)
[Semiring α]
[StarRing α]
[Fintype m]
(M : (Matrix m m α)ᵐᵒᵖ)

(Matrix.conjTransposeRingEquiv m α).symm M = (MulOpposite.unop M)ᴴ


theorem sum_div_factorial_le {α : Type*} [LinearOrderedField α] (n j : ℕ) (hn : 0 < n) :
    (∑ m ∈ filter (fun k => n ≤ k) (range j),
      (1 / m.factorial : α)) ≤ n.succ / (n.factorial * n)

{α : Type u_1}
[LinearOrderedField α]
(n j : ℕ)
(hn : 0 < n)

∑ m ∈ Finset.filter (fun k => n ≤ k) (Finset.range j), 1 / ↑m.factorial ≤ ↑n.succ / (↑n.factorial * ↑n)


@[to_additive]
theorem map_le_map_iff' {f : G →* N} {H K : Subgroup G} :
    H.map f ≤ K.map f ↔ H ⊔ f.ker ≤ K ⊔ f.ker

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

AddSubgroup.map f H ≤ AddSubgroup.map f K ↔ H ⊔ f.ker ≤ K ⊔ f.ker


@[simp]
theorem not_supPrime : ¬SupPrime a ↔ IsMin a ∨ ∃ b c, a ≤ b ⊔ c ∧ ¬a ≤ b ∧ ¬a ≤ c

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


theorem pow_mod_card_support_cycleOf_self_apply [DecidableEq α] [Fintype α]
    (f : Perm α) (n : ℕ) (x : α) : (f ^ (n % (f.cycleOf x).support.card)) x = (f ^ n) x

{α : Type u_2}
[DecidableEq α]
[Fintype α]
(f : Equiv.Perm α)
(n : ℕ)
(x : α)


theorem image_update_Icc_left (f : ∀ i, α i) (i : ι) (a : α i) :
    update f i '' Icc a (f i) = Icc (update f i a) f

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

Function.update f i '' Set.Icc a (f i) = Set.Icc (Function.update f i a) f


/-- If `e : C ≌ D` is an equivalence of categories, and `iso : e.functor ≅ G` is
an isomorphism, then there is an equivalence of categories whose functor is `G`. -/
@[simps!]
def changeFunctor (e : C ≌ D) {G : C ⥤ D} (iso : e.functor ≅ G) : C ≌ D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)
{G : CategoryTheory.Functor C D}
(iso : e.functor ≅ G)


@[simp]
lemma Fin.dist_insertNth_insertNth {n : ℕ} {α : Fin (n + 1) → Type*}
    [∀ i, PseudoMetricSpace (α i)] (i : Fin (n + 1)) (x y : α i) (f g : ∀ j, α (i.succAbove j)) :
    dist (i.insertNth x f) (i.insertNth y g) = max (dist x y) (dist f g)

[(i : Fin (n + 1)) → PseudoMetricSpace (α i)]


lemma basis_iff_basis_closure_of_subset' (hIX : I ⊆ X) :
    M.Basis I X ↔ M.Basis I (M.closure X) ∧ X ⊆ M.E

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


protected theorem min_eq_right {a b : Int} (h : b ≤ a) : min a b = b


@[simp]
theorem toComplex_star (x : ℤ[i]) : ((star x : ℤ[i]) : ℂ) = conj (x : ℂ)

GaussianInt.toComplex (star x) = (starRingEnd ℂ) (GaussianInt.toComplex x)


/-- Given a finite set `s` and an element `a ∉ s`, the product of `f i` over `i ∈ insert a s` equals
`f a` times the product of `f i` over `i ∈ s`. -/
@[to_additive
      "Given a finite set `s` and an element `a ∉ s`, the sum of `f i` over `i ∈ insert a s`
      equals `f a` plus the sum of `f i` over `i ∈ s`."]
theorem finprod_mem_insert (f : α → M) (h : a ∉ s) (hs : s.Finite) :
    ∏ᶠ i ∈ insert a s, f i = f a * ∏ᶠ i ∈ s, f i

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

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


@[simp]
theorem head_dropn (s : Seq α) (n) : head (drop s n) = get? s n

{α : Type u}
(s : Stream'.Seq α)
(n : ℕ)


theorem sup_span : p ⊔ span R s = span R (p ∪ s)

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : Submodule R M)
{s : Set M}

p ⊔ Submodule.span R s = Submodule.span R (↑p ∪ s)


theorem mdifferentiableOn_id : MDifferentiableOn I I (@id M) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{s : Set M}


/-- If we have `IsFiltered C`, then for any functor `F : J ⥤ C` with `FinCategory J`,
there exists a cocone over `F`.
-/
theorem cocone_nonempty (F : J ⥤ C) : Nonempty (Cocone F)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.IsFiltered C]
{J : Type w}
[CategoryTheory.SmallCategory J]
[CategoryTheory.FinCategory J]
(F : CategoryTheory.Functor J C)


@[simp]
theorem comp_eval (f g) : (comp f g).eval = fun v => g.eval v >>= f.eval

(f.comp g).eval = fun v => g.eval v >>= f.eval


@[simp, norm_cast]
theorem mem_coe {a : α} {s : Finset α} : a ∈ (s : Set α) ↔ a ∈ (s : Finset α)

a ∈ ↑s ↔ a ∈ s


theorem eq_of_eq_some {α : Type u} : ∀ {x y : Option α}, (∀z, x = some z ↔ y = some z) → x = y

(∀ (z : α), x = some z ↔ y = some z) → x = y


/-- The `List` of a vector after a `reverse`, retrieved by `toList` is equal
to the `List.reverse` after retrieving a vector's `toList`. -/
theorem toList_reverse {v : Vector α n} : v.reverse.toList = v.toList.reverse

{n : ℕ}
{α : Type u_1}
{v : Mathlib.Vector α n}


theorem ContinuousOn.integrableAt_nhdsWithin_of_isSeparable [TopologicalSpace α]
    [PseudoMetrizableSpace α] [OpensMeasurableSpace α] {μ : Measure α} [IsLocallyFiniteMeasure μ]
    {a : α} {t : Set α} {f : α → E} (hft : ContinuousOn f t) (ht : MeasurableSet t)
    (h't : TopologicalSpace.IsSeparable t) (ha : a ∈ t) : IntegrableAtFilter f (𝓝[t] a) μ

MeasureTheory.IntegrableAtFilter f (𝓝[t] a) μ


@[simp, norm_cast] lemma coe_zpow (a : α) (n : ℤ) : ↑(a ^ n) = (↑a : WithZero α) ^ n

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


theorem homogeneousIdeal_le_vanishingIdeal_zeroLocus (I : HomogeneousIdeal 𝒜) :
    I ≤ vanishingIdeal (zeroLocus 𝒜 I)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(I : HomogeneousIdeal 𝒜)

I ≤ ProjectiveSpectrum.vanishingIdeal (ProjectiveSpectrum.zeroLocus 𝒜 ↑I)


/-- An Akra-Bazzi recurrence is a function that satisfies the recurrence
`T n = (∑ i, a i * T (r i n)) + g n`. -/
structure AkraBazziRecurrence {α : Type*} [Fintype α] [Nonempty α]
    (T : ℕ → ℝ) (g : ℝ → ℝ) (a : α → ℝ) (b : α → ℝ) (r : α → ℕ → ℕ) where
  /-- Point below which the recurrence is in the base case -/
  n₀ : ℕ
  /-- `n₀` is always `> 0` -/
  n₀_gt_zero : 0 < n₀
  /-- The `a`'s are nonzero -/
  a_pos : ∀ i, 0 < a i
  /-- The `b`'s are nonzero -/
  b_pos : ∀ i, 0 < b i
  /-- The b's are less than 1 -/
  b_lt_one : ∀ i, b i < 1
  /-- `g` is nonnegative -/
  g_nonneg : ∀ x ≥ 0, 0 ≤ g x
  /-- `g` grows polynomially -/
  g_grows_poly : AkraBazziRecurrence.GrowsPolynomially g
  /-- The actual recurrence -/
  h_rec (n : ℕ) (hn₀ : n₀ ≤ n) : T n = (∑ i, a i * T (r i n)) + g n
  /-- Base case: `T(n) > 0` whenever `n < n₀` -/
  T_gt_zero' (n : ℕ) (hn : n < n₀) : 0 < T n
  /-- The `r`'s always reduce `n` -/
  r_lt_n : ∀ i n, n₀ ≤ n → r i n < n
  /-- The `r`'s approximate the `b`'s -/
  dist_r_b : ∀ i, (fun n => (r i n : ℝ) - b i * n) =o[atTop] fun n => n / (log n) ^ 2

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


/-- The direction of the sup of two nonempty affine subspaces is the sup of the two directions and
of any one difference between points in the two subspaces. -/
theorem direction_sup {s1 s2 : AffineSubspace k P} {p1 p2 : P} (hp1 : p1 ∈ s1) (hp2 : p2 ∈ s2) :
    (s1 ⊔ s2).direction = s1.direction ⊔ s2.direction ⊔ k ∙ p2 -ᵥ p1

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s1 s2 : AffineSubspace k P}
{p1 p2 : P}
(hp1 : p1 ∈ s1)
(hp2 : p2 ∈ s2)

(s1 ⊔ s2).direction = s1.direction ⊔ s2.direction ⊔ Submodule.span k {p2 -ᵥ p1}


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

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


/-- Any standard Borel space is measurably equivalent to a subset of the reals. -/
theorem exists_subset_real_measurableEquiv : ∃ s : Set ℝ, MeasurableSet s ∧ Nonempty (α ≃ᵐ s)

(α : Type u_1)
[MeasurableSpace α]
[StandardBorelSpace α]

∃ s, MeasurableSet s ∧ Nonempty (α ≃ᵐ ↑s)


/-- A family of additive subgroups on a ring `A` is a subgroups basis if it satisfies some
axioms ensuring there is a topology on `A` which is compatible with the ring structure and
admits this family as a basis of neighborhoods of zero. -/
structure RingSubgroupsBasis {A ι : Type*} [Ring A] (B : ι → AddSubgroup A) : Prop where
  /-- Condition for `B` to be a filter basis on `A`. -/
  inter : ∀ i j, ∃ k, B k ≤ B i ⊓ B j
  /-- For each set `B` in the submodule basis on `A`, there is another basis element `B'` such
   that the set-theoretic product `B' * B'` is in `B`. -/
  mul : ∀ i, ∃ j, (B j : Set A) * B j ⊆ B i
  /-- For any element `x : A` and any set `B` in the submodule basis on `A`,
    there is another basis element `B'` such that `B' * x` is in `B`. -/
  leftMul : ∀ x : A, ∀ i, ∃ j, (B j : Set A) ⊆ (x * ·) ⁻¹' B i
  /-- For any element `x : A` and any set `B` in the submodule basis on `A`,
    there is another basis element `B'` such that `x * B'` is in `B`. -/
  rightMul : ∀ x : A, ∀ i, ∃ j, (B j : Set A) ⊆ (· * x) ⁻¹' B i

{A : Type u_1}
{ι : Type u_2}
[Ring A]
{B : ι → AddSubgroup A}
(self : RingSubgroupsBasis B)
(i : ι)


lemma ne_of_not_superset [IsRefl α (· ⊆ ·)] : ¬a ⊆ b → b ≠ a

{α : Type u}
[HasSubset α]
{a b : α}
[IsRefl α fun x x_1 => x ⊆ x_1]

¬a ⊆ b → b ≠ a


@[simp]
lemma map_d (b : B) : map fac (d b) = d (g' b)

{A B A' B' : CommRingCat}
{f : A ⟶ B}
{f' : A' ⟶ B'}
{g : A ⟶ A'}
{g' : B ⟶ B'}
(fac : g ≫ f' = f ≫ g')
(b : ↑B)

(CommRingCat.KaehlerDifferential.map fac) (CommRingCat.KaehlerDifferential.d b) =
  CommRingCat.KaehlerDifferential.d (g' b)


@[to_additive]
lemma mem_ofUnits_iff_toUnits_mem (H : Subgroup Gˣ) (x : G) : x ∈ H.ofUnits ↔ (toUnits x) ∈ H

{G : Type u_2}
[AddGroup G]
(H : AddSubgroup (AddUnits G))
(x : G)


/-- If `H` is a `p`-subgroup of `G`, then the index of `H` inside its normalizer is congruent
  mod `p` to the index of `H`.  -/
theorem card_quotient_normalizer_modEq_card_quotient [Finite G] {p : ℕ} {n : ℕ} [hp : Fact p.Prime]
    {H : Subgroup G} (hH : Nat.card H = p ^ n) :
    Nat.card (normalizer H ⧸ Subgroup.comap ((normalizer H).subtype : normalizer H →* G) H) ≡
      Nat.card (G ⧸ H) [MOD p]

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

Nat.card (↥H.normalizer ⧸ Subgroup.comap H.normalizer.subtype H) ≡ Nat.card (G ⧸ H) [MOD p]


@[simp]
theorem toLinearMap_fromOpposite (f : A →ₐ[R] B) (hf : ∀ x y, Commute (f x) (f y)) :
    (f.fromOpposite hf).toLinearMap = f.toLinearMap ∘ₗ (opLinearEquiv R (M := A)).symm

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(hf : ∀ (x y : A), Commute (f x) (f y))

(f.fromOpposite hf).toLinearMap = f.toLinearMap ∘ₗ ↑(MulOpposite.opLinearEquiv R).symm


@[to_additive (attr := simp, norm_cast)]
theorem val_mul : (↑(a * b) : α) = a * b

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


@[simp]
theorem tsub_zero (a : α) : a - 0 = a

{α : Type u_1}
[PartialOrder α]
[AddCommMonoid α]
[Sub α]
[OrderedSub α]
(a : α)


lemma fderiv_fourierChar_neg_bilinear_left_apply (v y : V) (w : W) :
    fderiv ℝ (fun v ↦ (𝐞 (-L v w) : ℂ)) v y = -2 * π * I * L y w * 𝐞 (-L v w)

{V : Type u_1}
{W : Type u_2}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[NormedAddCommGroup W]
[NormedSpace ℝ W]
(L : V →L[ℝ] W →L[ℝ] ℝ)
(v y : V)
(w : W)

(fderiv ℝ (fun v => ↑(𝐞 (-(L v) w))) v) y = -2 * ↑π * Complex.I * ↑((L y) w) * ↑(𝐞 (-(L v) w))


theorem nonzeroMinimum_pos {xs : List Nat} (m : a ∈ xs) (h : a ≠ 0) : 0 < xs.nonzeroMinimum

{a : Nat}
{xs : List Nat}
(m : a ∈ xs)
(h : a ≠ 0)


/-- An upper estimate on the remainder. This estimate works with `m ∈ ℝ` satisfying `1 < m` and is
stronger than the estimate `LiouvilleNumber.remainder_lt` below. However, the latter estimate is
more useful for the proof. -/
theorem remainder_lt' (n : ℕ) {m : ℝ} (m1 : 1 < m) :
    remainder m n < (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!)

LiouvilleNumber.remainder m n < (1 - 1 / m)⁻¹ * (1 / m ^ (n + 1)!)


theorem HasBasis.sup_pure (hl : l.HasBasis p s) (x : α) :
    (l ⊔ pure x).HasBasis p fun i => s i ∪ {x}

{α : Type u_1}
{ι : Sort u_4}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(hl : l.HasBasis p s)
(x : α)


@[simp] lemma inr_inf (b₁ b₂ : β) : (inrₗ (b₁ ⊓ b₂) : α ⊕ β) = inrₗ b₁ ⊓ inrₗ b₂

{α : Type u_1}
{β : Type u_2}
[SemilatticeInf α]
[SemilatticeInf β]
(b₁ b₂ : β)

Sum.inrₗ (b₁ ⊓ b₂) = Sum.inrₗ b₁ ⊓ Sum.inrₗ b₂


@[reassoc (attr := simp)]
theorem app_appIso_inv (U) :
    f.app U ≫ (f.appIso (f ⁻¹ᵁ U)).inv =
      Y.presheaf.map (homOfLE (Set.image_preimage_subset f.1.base U.1)).op

[H : AlgebraicGeometry.IsOpenImmersion f]

f.app U ≫ (f.appIso ((TopologicalSpace.Opens.map f.val.base).obj U)).inv = Y.presheaf.map (CategoryTheory.homOfLE ⋯).op


theorem ite_inter_closure_eq_of_inter_frontier_eq {s s' t : Set α}
    (ht : s ∩ frontier t = s' ∩ frontier t) : t.ite s s' ∩ closure t = s ∩ closure t

{α : Type u_1}
[TopologicalSpace α]
{s s' t : Set α}
(ht : s ∩ frontier t = s' ∩ frontier t)


@[simp]
theorem comp_hom' {M N K : Mod_ A} (f : M ⟶ N) (g : N ⟶ K) :
    (f ≫ g).hom = f.hom ≫ g.hom

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{A : Mon_ C}
{M N K : Mod_ A}
(f : M ⟶ N)
(g : N ⟶ K)


@[to_additive]
theorem mulSingle_mono : Monotone (Pi.mulSingle i : f i → ∀ i, f i)

{I : Type u}
{f : I → Type v}
(i : I)
[DecidableEq I]
[(i : I) → Preorder (f i)]
[(i : I) → Zero (f i)]


theorem invFun_surjective (hf : Injective f) : Surjective (invFun f)

{α : Sort u_1}
{β : Sort u_2}
[Nonempty α]
{f : α → β}
(hf : Function.Injective f)


theorem Squarefree.eq_zero_or_one_of_pow_of_not_isUnit [CommMonoid R] {x : R} {n : ℕ}
    (h : Squarefree (x ^ n)) (h' : ¬ IsUnit x) :
    n = 0 ∨ n = 1

{R : Type u_1}
[CommMonoid R]
{x : R}
{n : ℕ}
(h : Squarefree (x ^ n))
(h' : ¬IsUnit x)


@[to_additive]
theorem MonoidHom.functions_ext [Finite I] (G : Type*) [CommMonoid G] (g h : (∀ i, Z i) →* G)
    (H : ∀ i x, g (Pi.mulSingle i x) = h (Pi.mulSingle i x)) : g = h

(H : ∀ (i : I) (x : Z i), g (Pi.single i x) = h (Pi.single i x))


@[simp]
theorem Finsupp.toFreeAbelianGroup_comp_toFinsupp :
    toFreeAbelianGroup.comp toFinsupp = AddMonoidHom.id (FreeAbelianGroup X)

Finsupp.toFreeAbelianGroup.comp FreeAbelianGroup.toFinsupp = AddMonoidHom.id (FreeAbelianGroup X)


theorem sub_eq_zero_of_le (h : μ ≤ ν) : μ - ν = 0

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(h : μ ≤ ν)


protected theorem Sublist.sym2 {xs ys : List α} (h : xs <+ ys) : xs.sym2 <+ ys.sym2

{α : Type u_1}
{xs ys : List α}
(h : xs.Sublist ys)


@[simp]
theorem comap_bot : (⊥ : MeasurableSpace α).comap g = ⊥

{α : Type u_1}
{β : Type u_2}
{g : β → α}


@[simp]
theorem restrictScalars_toSubfield {E : IntermediateField L' L} :
    (E.restrictScalars K).toSubfield = E.toSubfield

(K : Type u_1)
{L : Type u_2}
{L' : Type u_3}
[Field K]
[Field L]
[Field L']
[Algebra K L]
[Algebra K L']
[Algebra L' L]
[IsScalarTower K L' L]
{E : IntermediateField L' L}

(IntermediateField.restrictScalars K E).toSubfield = E.toSubfield


private theorem Gamma_integrand_intervalIntegrable (s : ℂ) {X : ℝ} (hs : 0 < s.re) (hX : 0 ≤ X) :
    IntervalIntegrable (fun x => (-x).exp * x ^ (s - 1) : ℝ → ℂ) volume 0 X

IntervalIntegrable (fun x => ↑(rexp (-x)) * ↑x ^ (s - 1)) MeasureTheory.volume 0 X


@[simp]
theorem map_smul [DecidableEq ι] (i : ι) (r : R) (x : M) :
    f (update v i (r • x)) = r • f (update v i x)

{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}
(f : M [⋀^ι]→ₗ[R] N)
(v : ι → M)
[DecidableEq ι]
(i : ι)
(r : R)
(x : M)

f (Function.update v i (r • x)) = r • f (Function.update v i x)


@[simp]
lemma univ_coeff_eval₂Hom (M : n × n → S) (i : ℕ) :
    MvPolynomial.eval₂Hom f M ((univ R n).coeff i) =
      (charpoly (Matrix.of M.curry)).coeff i

{R : Type u_1}
{S : Type u_2}
(n : Type u_3)
[CommRing R]
[CommRing S]
[Fintype n]
[DecidableEq n]
(f : R →+* S)
(M : n × n → S)
(i : ℕ)

(MvPolynomial.eval₂Hom f M) ((Matrix.charpoly.univ R n).coeff i) = (Matrix.of (Function.curry M)).charpoly.coeff i


theorem snd_map_snd : (Submodule.snd R M M₂).map (LinearMap.snd R M M₂) = ⊤

(R : Type u)
(M : Type v)
(M₂ : Type w)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

Submodule.map (LinearMap.snd R M M₂) (Submodule.snd R M M₂) = ⊤


/-- For maps between vector spaces, `MDifferentiableWithinAt` and `DifferentiableWithinAt`
coincide -/
theorem mdifferentiableWithinAt_iff_differentiableWithinAt :
    MDifferentiableWithinAt 𝓘(𝕜, E) 𝓘(𝕜, E') f s x ↔ DifferentiableWithinAt 𝕜 f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{f : E → E'}
{s : Set E}
{x : E}


theorem forall_zpowers {x : G} {p : zpowers x → Prop} : (∀ g, p g) ↔ ∀ m : ℤ, p ⟨x ^ m, m, rfl⟩

{G : Type u_1}
[Group G]
{x : G}
{p : ↥(Subgroup.zpowers x) → Prop}

(∀ (g : ↥(Subgroup.zpowers x)), p g) ↔ ∀ (m : ℤ), p ⟨x ^ m, ⋯⟩


/-- If `f` is a function `α → 𝕜` which is continuous on a preconnected set `S`, and
`f ^ 2 = 1` on `S`, then either `f = 1` on `S`, or `f = -1` on `S`. -/
theorem IsPreconnected.eq_one_or_eq_neg_one_of_sq_eq [Ring 𝕜] [NoZeroDivisors 𝕜]
    (hS : IsPreconnected S) (hf : ContinuousOn f S) (hsq : EqOn (f ^ 2) 1 S) :
    EqOn f 1 S ∨ EqOn f (-1) S

{α : Type u_2}
{𝕜 : Type u_3}
{f : α → 𝕜}
{S : Set α}
[TopologicalSpace α]
[TopologicalSpace 𝕜]
[T1Space 𝕜]
[Ring 𝕜]
[NoZeroDivisors 𝕜]
(hS : IsPreconnected S)
(hf : ContinuousOn f S)
(hsq : Set.EqOn (f ^ 2) 1 S)


@[simp] lemma measure_closedBall_pos_iff {X : Type*} [MetricSpace X] {m : MeasurableSpace X}
    (μ : Measure X) [IsOpenPosMeasure μ] [NoAtoms μ] {x : X} {r : ℝ} :
    0 < μ (closedBall x r) ↔ 0 < r

{X : Type u_2}
[MetricSpace X]
{m : MeasurableSpace X}
(μ : MeasureTheory.Measure X)
[μ.IsOpenPosMeasure]
[MeasureTheory.NoAtoms μ]
{x : X}
{r : ℝ}


theorem image_of_isOpenImmersion (f : X ⟶ Y) [H : IsOpenImmersion f] :
    IsAffineOpen (f ''ᵁ U)

[H : AlgebraicGeometry.IsOpenImmersion f]

AlgebraicGeometry.IsAffineOpen ((AlgebraicGeometry.Scheme.Hom.opensFunctor f).obj U)


@[simp]
theorem ofAntisymmetrization_lt_ofAntisymmetrization_iff {a b : Antisymmetrization α (· ≤ ·)} :
    ofAntisymmetrization (· ≤ ·) a < ofAntisymmetrization (· ≤ ·) b ↔ a < b

{a b : Antisymmetrization α fun x x_1 => x ≤ x_1}

ofAntisymmetrization (fun x x_1 => x ≤ x_1) a < ofAntisymmetrization (fun x x_1 => x ≤ x_1) b ↔ a < b


@[simp] theorem associator_inv_apply_1_2 {X Y Z : Type u} {x} :
    (((α_ X Y Z).inv : X ⊗ Y ⊗ Z → (X ⊗ Y) ⊗ Z) x).1.2 = x.2.1


/-- A preadditive category has an equalizer for `f` and `g` if it has a kernel for `f - g`. -/
theorem hasEqualizer_of_hasKernel [HasKernel (f - g)] : HasEqualizer f g

[CategoryTheory.Limits.HasKernel (f - g)]


@[to_additive (attr := simp)]
theorem comap_uniformity_mulOpposite [UniformSpace α] :
    comap (fun p : α × α => (MulOpposite.op p.1, MulOpposite.op p.2)) (𝓤 αᵐᵒᵖ) = 𝓤 α

Filter.comap (fun p => (MulOpposite.op p.1, MulOpposite.op p.2)) (𝓤 αᵐᵒᵖ) = 𝓤 α


theorem image_update_uIcc_right (f : ∀ i, α i) (i : ι) (b : α i) :
    update f i '' uIcc (f i) b = uIcc f (update f i b)

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

Function.update f i '' Set.uIcc (f i) b = Set.uIcc f (Function.update f i b)


@[simp]
theorem snd_smul [SMul S R] [SMul S M] (s : S) (x : tsze R M) : (s • x).snd = s • x.snd

{S : Type u_2}
{R : Type u}
{M : Type v}
[SMul S R]
[SMul S M]
(s : S)
(x : tsze R M)


@[to_additive]
lemma prod_fiberwise_eq_prod_filter (s : Finset ι) (t : Finset κ) (g : ι → κ) (f : ι → α) :
    ∏ j ∈ t, ∏ i ∈ s.filter fun i ↦ g i = j, f i = ∏ i ∈ s.filter fun i ↦ g i ∈ t, f i

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[AddCommMonoid α]
[DecidableEq κ]
(s : Finset ι)
(t : Finset κ)
(g : ι → κ)
(f : ι → α)

∑ j ∈ t, ∑ i ∈ Finset.filter (fun i => g i = j) s, f i = ∑ i ∈ Finset.filter (fun i => g i ∈ t) s, f i


@[simp]
theorem coe_orderIsoOfSurjective : (orderIsoOfSurjective f h_mono h_surj : α → β) = f

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[Preorder β]
(f : α → β)
(h_mono : StrictMono f)
(h_surj : Function.Surjective f)

⇑(StrictMono.orderIsoOfSurjective f h_mono h_surj) = f


@[simp]
lemma range_isScalarTower_toAlgHom [CommSemiring R] [CommSemiring A]
    [Algebra R A] (S : Subalgebra R A) :
    LinearMap.range (IsScalarTower.toAlgHom R S A) = Subalgebra.toSubmodule S

(R : Type u)
(A : Type w)
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
(S : Subalgebra R A)

LinearMap.range (IsScalarTower.toAlgHom R (↥S) A) = Subalgebra.toSubmodule S


@[to_additive (attr := simp)]
theorem inv_symm : (Equiv.inv G).symm = Equiv.inv G


lemma succ_mod_two_eq_zero_iff {m : ℕ} : (m + 1) % 2 = 0 ↔ m % 2 = 1


@[to_additive (attr := simp)]
theorem coe_map_inv (f : M →* N) (u : Mˣ) : ↑(map f u)⁻¹ = f ↑u⁻¹

{M : Type u}
{N : Type v}
[AddMonoid M]
[AddMonoid N]
(f : M →+ N)
(u : AddUnits M)


@[to_additive (attr := ext)]
theorem ext : Function.Injective (val : αˣ → α)


@[higher_order tsnd_id]
theorem id_tsnd : ∀ {α β} (x : t α β), tsnd (F := Id) pure x = pure x

{t : Type u → Type u → Type u}
[Bitraversable t]
[LawfulBitraversable t]
{α β : Type u}
(x : t α β)


@[to_additive (attr := simp)]
theorem piecewise_eq_mulIndicator [DecidablePred (· ∈ s)] : s.piecewise f 1 = s.mulIndicator f

{α : Type u_1}
{M : Type u_4}
[One M]
{s : Set α}
{f : α → M}
[DecidablePred fun x => x ∈ s]


@[simp]
theorem Differentiable.arctan (hc : Differentiable ℝ f) : Differentiable ℝ fun x => arctan (f x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
(hc : Differentiable ℝ f)

Differentiable ℝ fun x => Real.arctan (f x)


theorem IsLeast.isLeast_image2_of_isGreatest (ha : IsLeast s a) (hb : IsGreatest t b) :
    IsLeast (Set.image2 f s t) (f a b)

{f : α → β → γ}

(h₀ : ∀ (b : β), Monotone (Function.swap f b))


theorem norm_setIntegral_le_of_norm_le_const_ae {C : ℝ} (hs : μ s < ∞)
    (hC : ∀ᵐ x ∂μ.restrict s, ‖f x‖ ≤ C) : ‖∫ x in s, f x ∂μ‖ ≤ C * (μ s).toReal

(hC : ∀ᵐ (x : X) ∂μ.restrict s, ‖f x‖ ≤ C)

‖∫ (x : X) in s, f x ∂μ‖ ≤ C * (μ s).toReal


theorem Subpresheaf.eq_sheafify (h : Presieve.IsSheaf J F) (hG : Presieve.IsSheaf J G.toPresheaf) :
    G = G.sheafify J

{J : CategoryTheory.GrothendieckTopology C}

(G : CategoryTheory.GrothendieckTopology.Subpresheaf F)

(h : CategoryTheory.Presieve.IsSheaf J F)

(hG : CategoryTheory.Presieve.IsSheaf J G.toPresheaf)

G = CategoryTheory.GrothendieckTopology.Subpresheaf.sheafify J G


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


@[to_additive (attr := simp, nolint simpNF)]
lemma finEquivZPowers_symm_apply (x : G) (hx) (n : ℕ) :
    (finEquivZPowers x hx).symm ⟨x ^ n, ⟨n, by simp⟩⟩ =
    ⟨n % orderOf x, Nat.mod_lt _ hx.orderOf_pos⟩

{G : Type u_1}
[Group G]
(x : G)
(hx : IsOfFinOrder x)
(n : ℕ)

(finEquivZPowers x hx).symm ⟨x ^ n, ⋯⟩ = ⟨n % orderOf x, ⋯⟩


theorem IsLowerSet.compl (hs : IsLowerSet s) : IsUpperSet sᶜ

{α : Type u_1}
[LE α]
{s : Set α}
(hs : IsLowerSet s)


theorem epi_of_epi_right {A B : StructuredArrow S T} (f : A ⟶ B) [h : Epi f.right] : Epi f

{A B : CategoryTheory.StructuredArrow S T}


theorem MonoidHom.map_frobenius : f (frobenius R p x) = frobenius S p (f x)

{R : Type u}
[CommSemiring R]
{S : Type u_1}
[CommSemiring S]
(f : R →* S)
(p : ℕ)
[ExpChar R p]
[ExpChar S p]
(x : R)

f ((frobenius R p) x) = (frobenius S p) (f x)


@[simp]
theorem self_invAct_invAct_eq {x y : R} : (x ◃⁻¹ x) ◃⁻¹ y = x ◃⁻¹ y

(x ◃⁻¹ x) ◃⁻¹ y = x ◃⁻¹ y


theorem mapMono_id : mapMono K (𝟙 Δ) = 𝟙 _

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(K : ChainComplex C ℕ)
(Δ : SimplexCategory)

AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K (𝟙 Δ) = 𝟙 (K.X Δ.len)


/-- This is the `iff` version of `Matrix.isSymm.fromBlocks`. -/
theorem isSymm_fromBlocks_iff {A : Matrix m m α} {B : Matrix m n α} {C : Matrix n m α}
    {D : Matrix n n α} : (A.fromBlocks B C D).IsSymm ↔ A.IsSymm ∧ Bᵀ = C ∧ Cᵀ = B ∧ D.IsSymm

{α : Type u_1}
{n : Type u_3}
{m : Type u_4}
{A : Matrix m m α}
{B : Matrix m n α}
{C : Matrix n m α}
{D : Matrix n n α}

(Matrix.fromBlocks A B C D).IsSymm ↔ A.IsSymm ∧ B.transpose = C ∧ C.transpose = B ∧ D.IsSymm


theorem _root_.Commute.exp [T2Space 𝔸] {x y : 𝔸} (h : Commute x y) : Commute (exp 𝕂 x) (exp 𝕂 y)

(𝕂 : Type u_1)
{𝔸 : Type u_2}
[Field 𝕂]
[Ring 𝔸]
[Algebra 𝕂 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]
[T2Space 𝔸]
{x y : 𝔸}
(h : Commute x y)

Commute (NormedSpace.exp 𝕂 x) (NormedSpace.exp 𝕂 y)


@[to_additive (attr := ext)]
lemma ext {X Y : Grp} {f g : X ⟶ Y} (w : ∀ x : X, f x = g x) : f = g

{X Y : Grp}
{f g : X ⟶ Y}
(w : ∀ (x : ↑X), f x = g x)


@[simp]
theorem pointwise_smul_le_pointwise_smul_iff {a : α} {S T : Subgroup G} : a • S ≤ a • T ↔ S ≤ T

{α : Type u_1}
{G : Type u_2}
[Group G]
[Group α]
[MulDistribMulAction α G]
{a : α}
{S T : Subgroup G}


@[simp]
theorem opRingEquiv_symm_X : (opRingEquiv R).symm (X : Rᵐᵒᵖ[X]) = op X

(Polynomial.opRingEquiv R).symm Polynomial.X = MulOpposite.op Polynomial.X


@[simp]
theorem hasStrictFDerivAt_pi' :
    HasStrictFDerivAt Φ Φ' x ↔ ∀ i, HasStrictFDerivAt (fun x => Φ x i) ((proj i).comp Φ') x

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

HasStrictFDerivAt Φ Φ' x ↔ ∀ (i : ι), HasStrictFDerivAt (fun x => Φ x i) ((ContinuousLinearMap.proj i).comp Φ') x


/-- A base angle of an isosceles triangle is acute, oriented angle-at-point form. -/
theorem abs_oangle_right_toReal_lt_pi_div_two_of_dist_eq {p₁ p₂ p₃ : P}
    (h : dist p₁ p₂ = dist p₁ p₃) : |(∡ p₁ p₂ p₃).toReal| < π / 2

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


theorem IsLUB.nonempty [NoMinOrder α] (hs : IsLUB s a) : s.Nonempty

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


/-- The idempotent endomorphisms of a module with range equal to a submodule are in 1-1
correspondence with linear maps to the submodule that restrict to the identity on the submodule. -/
@[simps] def isIdempotentElemEquiv :
    { f : Module.End R E // IsIdempotentElem f ∧ range f = p } ≃
    { f : E →ₗ[R] p // ∀ x : p, f x = x }

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
(p : Submodule R E)
(f : { f // ∀ (x : ↥p), f ↑x = x })

↑(p.isIdempotentElemEquiv.symm f) = p.subtype ∘ₗ ↑f


@[simp]
theorem zero_caratheodory : (0 : OuterMeasure α).caratheodory = ⊤

MeasureTheory.OuterMeasure.caratheodory 0 = ⊤


@[simp] theorem decide_True  : decide True  = true


theorem uniformContinuous_add : UniformContinuous fun p : ℚ × ℚ => p.1 + p.2


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

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

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


@[simp]
theorem not_prime_one : ¬Prime (1 : α)


lemma AntivaryOn.pow_left₀ (hf : ∀ i ∈ s, 0 ≤ f i) (hfg : AntivaryOn f g s) (n : ℕ) :
    AntivaryOn (f ^ n) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedSemiring α]
[OrderedSemiring β]
{s : Set ι}
{f : ι → α}
{g : ι → β}
(hf : ∀ i ∈ s, 0 ≤ f i)
(hfg : AntivaryOn f g s)
(n : ℕ)


@[trans]
theorem dvd_trans : a ∣ b → b ∣ c → a ∣ c

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


theorem ball_finset_sup (p : ι → Seminorm 𝕜 E) (s : Finset ι) (x : E) {r : ℝ} (hr : 0 < r) :
    ball (s.sup p) x r = s.inf fun i => ball (p i) x r

{𝕜 : Type u_3}
{E : Type u_7}
{ι : Type u_12}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : ι → Seminorm 𝕜 E)
(s : Finset ι)
(x : E)
{r : ℝ}
(hr : 0 < r)

(s.sup p).ball x r = s.inf fun i => (p i).ball x r


theorem map_ceil (f : F) (hf : StrictMono f) (a : α) : ⌈f a⌉₊ = ⌈a⌉₊

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemiring α]
[LinearOrderedSemiring β]
[FloorSemiring α]
[FloorSemiring β]
[FunLike F α β]
[RingHomClass F α β]
(f : F)
(hf : StrictMono ⇑f)
(a : α)

⌈f a⌉₊ = ⌈a⌉₊


@[simp] theorem iff_false (p : Prop) : (p ↔ False) = ¬p


theorem map_ciInf_set (e : α ≃o β) {s : Set γ} {f : γ → α} (hf : BddBelow (f '' s))
    (hne : s.Nonempty) : e (⨅ i : s, f i) = ⨅ i : s, e (f i)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[ConditionallyCompleteLattice α]
[ConditionallyCompleteLattice β]
(e : α ≃o β)
{s : Set γ}
{f : γ → α}
(hf : BddBelow (f '' s))
(hne : s.Nonempty)


/-- The definition of a periodic orbit, in terms of `List.map`. -/
theorem periodicOrbit_def (f : α → α) (x : α) :
    periodicOrbit f x = (List.range (minimalPeriod f x)).map fun n => f^[n] x

Function.periodicOrbit f x = ↑(List.map (fun n => f^[n] x) (List.range (Function.minimalPeriod f x)))


theorem uniformity_lift_le_comp {f : Set (α × α) → Filter β} (h : Monotone f) :
    ((𝓤 α).lift fun s => f (s ○ s)) ≤ (𝓤 α).lift f

{α : Type ua}
{β : Type ub}
[UniformSpace α]
{f : Set (α × α) → Filter β}
(h : Monotone f)


theorem any_eq_true (p : α → Bool) (as : Array α) :
    any as p ↔ ∃ i : Fin as.size, p as[i]

{α : Type u_1}
(p : α → Bool)
(as : Array α)


theorem eq_single_iff_length {n : ℕ} (h : 0 < n) {c : Composition n} :
    c = single n h ↔ c.length = 1

c = Composition.single n h ↔ c.length = 1


/-- The restriction of scalars of presheaves of modules, on objects. -/
@[simps]
noncomputable def restrictScalarsBundledCore (M' : PresheafOfModules R') (α : R ⟶ R') :
    BundledCorePresheafOfModules R

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

(M'.restrictScalarsBundledCore α).obj X = (ModuleCat.restrictScalars (α.app X)).obj (M'.obj X)


theorem iff_forall_not_isBadSeq (r : α → α → Prop) (s : Set α) :
    s.PartiallyWellOrderedOn r ↔ ∀ f, ¬IsBadSeq r s f

{α : Type u_2}
(r : α → α → Prop)
(s : Set α)

s.PartiallyWellOrderedOn r ↔ ∀ (f : ℕ → α), ¬Set.PartiallyWellOrderedOn.IsBadSeq r s f


@[simp] theorem castSucc_castLT (i : Fin (n + 1)) (h : (i : Nat) < n) :
    castSucc (castLT i h) = i


theorem dvd_iff_multiplicity_pos {a b : α} : (0 : PartENat) < multiplicity a b ↔ a ∣ b

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}


/-- The quotient of a direct sum is the direct sum of quotients. -/
@[simps!]
def quotientPi [Fintype ι] [DecidableEq ι] (p : ∀ i, Submodule R (Ms i)) :
    ((∀ i, Ms i) ⧸ pi Set.univ p) ≃ₗ[R] ∀ i, Ms i ⧸ p i

{ι : Type u_1}
{R : Type u_2}
[CommRing R]
{Ms : ι → Type u_3}
[(i : ι) → AddCommGroup (Ms i)]
[(i : ι) → Module R (Ms i)]
[Fintype ι]
[DecidableEq ι]
(p : (i : ι) → Submodule R (Ms i))

∀ (a : ((i : ι) → Ms i) ⧸ Submodule.pi Set.univ p) (i : ι),
  (Submodule.quotientPi p) a i = (Submodule.quotientPiLift p (fun i => (p i).mkQ) ⋯) a i


theorem ghDist_le_nonemptyCompacts_dist (p q : NonemptyCompacts X) :
    dist p.toGHSpace q.toGHSpace ≤ dist p q

(p q : TopologicalSpace.NonemptyCompacts X)


@[to_additive]
theorem prod_eq_mul_prod_diff_singleton [DecidableEq α] {s : Finset α} {i : α} (h : i ∈ s)
    (f : α → β) : ∏ x ∈ s, f x = f i * ∏ x ∈ s \ {i}, f x

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
{s : Finset α}
{i : α}
(h : i ∈ s)
(f : α → β)


theorem ωSup_bind {β γ : Type v} (c : Chain α) (f : α →o Part β) (g : α →o β → Part γ) :
    ωSup (c.map (f.partBind g)) = ωSup (c.map f) >>= ωSup (c.map g)

{α : Type u}
[OmegaCompletePartialOrder α]
{β γ : Type v}
(c : OmegaCompletePartialOrder.Chain α)
(f : α →o Part β)
(g : α →o β → Part γ)

OmegaCompletePartialOrder.ωSup (c.map (f.partBind g)) =
  OmegaCompletePartialOrder.ωSup (c.map f) >>= OmegaCompletePartialOrder.ωSup (c.map g)


/-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that
`f ≫ coeqHom f f' = f' ≫ coeqHom f f'`.
-/
@[reassoc]
theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f'

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.IsFilteredOrEmpty C]
{j j' : C}
(f f' : j ⟶ j')

CategoryTheory.CategoryStruct.comp f (CategoryTheory.IsFiltered.coeqHom f f') =
  CategoryTheory.CategoryStruct.comp f' (CategoryTheory.IsFiltered.coeqHom f f')


protected theorem zsmul_add (z : ℤ) : a ≡ b [PMOD p] → z • p + a ≡ b [PMOD p]

{α : Type u_1}
[AddCommGroup α]
{p a b : α}
(z : ℤ)


theorem mem_toTrivialization_baseSet {x : X} {I : Type*} [TopologicalSpace I]
    (h : IsEvenlyCovered f x I) : x ∈ h.toTrivialization.baseSet

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
{x : X}
{I : Type u_3}
[TopologicalSpace I]
(h : IsEvenlyCovered f x I)


@[to_additive]
theorem mt (h : UniqueMul A B a0 b0) :
    ∀ ⦃a b⦄, a ∈ A → b ∈ B → a ≠ a0 ∨ b ≠ b0 → a * b ≠ a0 * b0

{G : Type u_1}
[Mul G]
{A B : Finset G}
{a0 b0 : G}
(h : UniqueMul A B a0 b0)
⦃a b : G⦄


@[to_additive]
theorem lt_mul_of_lt_mul_left [CovariantClass α α (· * ·) (· ≤ ·)] {a b c d : α} (h : a < b * c)
    (hle : c ≤ d) :
    a < b * d

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


theorem transitive_gt [Preorder α] : Transitive (@GT.gt α _)


@[simp]
theorem disjoint_self : Disjoint a a ↔ a = ⊥

{α : Type u_1}
[PartialOrder α]
[OrderBot α]
{a : α}


/-- `PowerBasis.map pb (e : S ≃ₐ[R] S')` is the power basis for `S'` generated by `e pb.gen`. -/
@[simps dim gen basis]
noncomputable def map (pb : PowerBasis R S) (e : S ≃ₐ[R] S') : PowerBasis R S'

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
{S' : Type u_7}
[CommRing S']
[Algebra R S']
(pb : PowerBasis R S)
(e : S ≃ₐ[R] S')


@[to_additive (attr := simp)]
theorem curry_one [∀ a b, One (γ a b)] : Sigma.curry (1 : (i : Σ a, β a) → γ i.1 i.2) = 1

{α : Type u_3}
{β : α → Type u_4}
{γ : (a : α) → β a → Type u_5}
[(a : α) → (b : β a) → One (γ a b)]


theorem aeval_bind₂ [Algebra S T] (f : σ → T) (g : R →+* MvPolynomial σ S) (φ : MvPolynomial σ R) :
    aeval f (bind₂ g φ) = eval₂Hom ((↑(aeval f : _ →ₐ[S] _) : _ →+* _).comp g) f φ

{σ : Type u_1}
{R : Type u_3}
{S : Type u_4}
{T : Type u_5}
[CommSemiring R]
[CommSemiring S]
[CommSemiring T]
[Algebra S T]
(f : σ → T)
(g : R →+* MvPolynomial σ S)
(φ : MvPolynomial σ R)

(MvPolynomial.aeval f) ((MvPolynomial.bind₂ g) φ) = (MvPolynomial.eval₂Hom ((↑(MvPolynomial.aeval f)).comp g) f) φ


/-- The measure associated to the cdf of a probability measure is the same probability measure. -/
lemma measure_cdf [IsProbabilityMeasure μ] : (cdf μ).measure = μ

(μ : MeasureTheory.Measure ℝ)
[MeasureTheory.IsProbabilityMeasure μ]


/-- Given a `k`-linear `G`-representation `A`, `diagonalHomEquiv` is a `k`-linear isomorphism of
the set of representation morphisms `Hom(k[Gⁿ⁺¹], A)` with `Fun(Gⁿ, A)`. This lemma says that this
sends a morphism of representations `f : k[Gⁿ⁺¹] ⟶ A` to the function
`(g₁, ..., gₙ) ↦ f(1, g₁, g₁g₂, ..., g₁g₂...gₙ).` -/
theorem diagonalHomEquiv_apply (f : Rep.ofMulAction k G (Fin (n + 1) → G) ⟶ A) (x : Fin n → G) :
    diagonalHomEquiv n A f x = f.hom (Finsupp.single (Fin.partialProd x) 1)

(Rep.diagonalHomEquiv n A) f x = f.hom (Finsupp.single (Fin.partialProd x) 1)


@[simp]
theorem ExactFunctor.forget_obj (F : C ⥤ₑ D) : (ExactFunctor.forget C D).obj F = F.1

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

(CategoryTheory.ExactFunctor.forget C D).obj F = F.obj


theorem isCodetecting_iff_isCoseparating [HasCoequalizers C] [Balanced C] {𝒢 : Set C} :
    IsCodetecting 𝒢 ↔ IsCoseparating 𝒢

CategoryTheory.IsCodetecting 𝒢 ↔ CategoryTheory.IsCoseparating 𝒢


@[simp]
theorem mem_toAddSubgroup {s : Subfield K} {x : K} : x ∈ s.toAddSubgroup ↔ x ∈ s

{K : Type u}
[DivisionRing K]
{s : Subfield K}
{x : K}


protected theorem Sublist.sym (n : ℕ) {xs ys : List α} (h : xs <+ ys) : xs.sym n <+ ys.sym n

{α : Type u_1}
(n : ℕ)
{xs ys : List α}
(h : xs.Sublist ys)


lemma cfcₙ_predicate (f : R → R) (a : A) : p (cfcₙ f a)


theorem encard_le_encard_of_injOn (hf : MapsTo f s t) (f_inj : InjOn f s) :
    s.encard ≤ t.encard

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


lemma LinearMap.localized'_ker_eq_ker_localizedMap (g : M →ₗ[R] P) :
    Submodule.localized' S p f (LinearMap.ker g) =
      LinearMap.ker ((IsLocalizedModule.map p f f' g).extendScalarsOfIsLocalization p S)

{R : Type u}
(S : Type u')
{M : Type v}
{N : Type v'}
[CommRing R]
[CommRing S]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[Algebra R S]
[Module S N]
[IsScalarTower R S N]
(p : Submonoid R)
[IsLocalization p S]
(f : M →ₗ[R] N)
[IsLocalizedModule p f]
{P : Type w}
[AddCommGroup P]
[Module R P]
{Q : Type w'}
[AddCommGroup Q]
[Module R Q]
[Module S Q]
[IsScalarTower R S Q]
(f' : P →ₗ[R] Q)
[IsLocalizedModule p f']
(g : M →ₗ[R] P)

Submodule.localized' S p f (LinearMap.ker g) =
  LinearMap.ker (LinearMap.extendScalarsOfIsLocalization p S ((IsLocalizedModule.map p f f') g))


theorem le_iff_eq_sup_sdiff (hz : z ≤ y) (hx : x ≤ y) : x ≤ z ↔ y = z ⊔ y \ x

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]
(hz : z ≤ y)
(hx : x ≤ y)


@[simp]
theorem coe_ringEquiv_refl : (OrderRingIso.refl α : α ≃+* α) = RingEquiv.refl α

↑(OrderRingIso.refl α) = RingEquiv.refl α


@[simp]
theorem inftyValuation_of_nonzero {x : RatFunc Fq} (hx : x ≠ 0) :
    inftyValuationDef Fq x = Multiplicative.ofAdd x.intDegree

(Fq : Type)
[Field Fq]
[DecidableEq (RatFunc Fq)]
{x : RatFunc Fq}
(hx : x ≠ 0)

FunctionField.inftyValuationDef Fq x = ↑(Multiplicative.ofAdd x.intDegree)


lemma HasFDerivAt.hasLineDerivAt (hf : HasFDerivAt f L x) (v : E) :
    HasLineDerivAt 𝕜 f (L v) 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}
{x : E}
{L : E →L[𝕜] F}
(hf : HasFDerivAt f L x)
(v : E)


@[simp] lemma edgeSet_eq_empty : G.edgeSet = ∅ ↔ G = ⊥


@[simp]
theorem untrop_add (x y : Tropical R) : untrop (x + y) = min (untrop x) (untrop y)

{R : Type u}
[LinearOrder R]
(x y : Tropical R)

Tropical.untrop (x + y) = min (Tropical.untrop x) (Tropical.untrop y)


theorem disjoint_comm : Disjoint l₁ l₂ ↔ Disjoint l₂ l₁

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.Disjoint l₂ ↔ l₂.Disjoint l₁


theorem f_add_nat_eq (hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y) (hx : 0 < x) (n : ℕ) :
    f (x + n) = f x + ∑ m ∈ Finset.range n, log (x + m)

(hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + Real.log y)

f (x + ↑n) = f x + ∑ m ∈ Finset.range n, Real.log (x + ↑m)


@[to_additive (attr := simp)]
lemma inv_pow (a : α) : ∀ n : ℕ, a⁻¹ ^ n = (a ^ n)⁻¹

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


theorem mem_range_of_mem_image (f : α → β) (s) {x : β} (h : x ∈ f '' s) : x ∈ range f

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(s : Set α)
{x : β}
(h : x ∈ f '' s)


theorem HasDerivAt.inner {f g : ℝ → E} {f' g' : E} {x : ℝ} :
    HasDerivAt f f' x → HasDerivAt g g' x →
      HasDerivAt (fun t => ⟪f t, g t⟫) (⟪f x, g'⟫ + ⟪f', g x⟫) x

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{f g : ℝ → E}
{f' g' : E}
{x : ℝ}

HasDerivAt f f' x → HasDerivAt g g' x → HasDerivAt (fun t => ⟪f t, g t⟫_𝕜) (⟪f x, g'⟫_𝕜 + ⟪f', g x⟫_𝕜) x


theorem derivWithin_csinh (hf : DifferentiableWithinAt ℂ f s x) (hxs : UniqueDiffWithinAt ℂ s x) :
    derivWithin (fun x => Complex.sinh (f x)) s x = Complex.cosh (f x) * derivWithin f s x

{f : ℂ → ℂ}
{x : ℂ}
{s : Set ℂ}
(hf : DifferentiableWithinAt ℂ f s x)
(hxs : UniqueDiffWithinAt ℂ s x)


@[simp]
theorem choose_zero_right (n : ℕ) : choose n 0 = 1


theorem isMaxFilter_const {b : β} : IsMaxFilter (fun _ => b) l a

{α : Type u}
{β : Type v}
[Preorder β]
{l : Filter α}
{a : α}
{b : β}


theorem WOppSide.map {s : AffineSubspace R P} {x y : P} (h : s.WOppSide x y) (f : P →ᵃ[R] P') :
    (s.map f).WOppSide (f x) (f y)

{R : Type u_1}
{V : Type u_2}
{V' : Type u_3}
{P : Type u_4}
{P' : Type u_5}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[AddCommGroup V']
[Module R V']
[AddTorsor V' P']
{s : AffineSubspace R P}
{x y : P}
(h : s.WOppSide x y)
(f : P →ᵃ[R] P')

(AffineSubspace.map f s).WOppSide (f x) (f y)


theorem irreducibleSpace_def (X : Type*) [TopologicalSpace X] :
    IrreducibleSpace X ↔ IsIrreducible (⊤ : Set X)


@[simp]
theorem add_apply (x y : M) : (B + D) x y = B x y + D x y

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


theorem rightMoves_add : ∀ x y : PGame.{u}, (x + y).RightMoves = (x.RightMoves ⊕ y.RightMoves)


/-- We can assume that a minimal solution to `a ^ 4 + b ^ 4 = c ^ 2` has `a` odd. -/
theorem exists_odd_minimal {a b c : ℤ} (h : Fermat42 a b c) :
    ∃ a0 b0 c0, Minimal a0 b0 c0 ∧ a0 % 2 = 1

∃ a0 b0 c0, Fermat42.Minimal a0 b0 c0 ∧ a0 % 2 = 1


theorem zero_mem_smul_finset_iff (ha : a ≠ 0) : (0 : β) ∈ a • t ↔ (0 : β) ∈ t

{α : Type u_2}
{β : Type u_3}
[Zero β]
[SMulZeroClass α β]
[DecidableEq β]
{t : Finset β}
{a : α}
[Zero α]
[NoZeroSMulDivisors α β]
(ha : a ≠ 0)


/-- The standard case of the layer cake formula / Cavalieri's principle / tail probability formula:

For an integrable a.e.-nonnegative real-valued function `f`, the Bochner integral of `f` can be
written (roughly speaking) as: `∫ f ∂μ = ∫ t in 0..∞, μ {ω | f(ω) > t}`.

See `MeasureTheory.lintegral_eq_lintegral_meas_lt` for a version with Lebesgue integral `∫⁻`
instead. -/
theorem Integrable.integral_eq_integral_meas_lt
    (f_intble : Integrable f μ) (f_nn : 0 ≤ᵐ[μ] f) :
    ∫ ω, f ω ∂μ = ∫ t in Set.Ioi 0, ENNReal.toReal (μ {a : α | t < f a})

(f_intble : MeasureTheory.Integrable f μ)

∫ (ω : α), f ω ∂μ = ∫ (t : ℝ) in Set.Ioi 0, (μ {a | t < f a}).toReal


/-- In a `T2Space`, every compact set is closed. -/
theorem IsCompact.isClosed [T2Space X] {s : Set X} (hs : IsCompact s) : IsClosed s

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
{s : Set X}
(hs : IsCompact s)


@[to_additive]
theorem isClosedMap_inv : IsClosedMap (Inv.inv : G → G)

(G : Type w)
[TopologicalSpace G]
[InvolutiveInv G]
[ContinuousInv G]


@[simp] theorem all₂_eq_true {r : α → β → Bool} :
    ∀ l₁ l₂, all₂ r l₁ l₂ ↔ Forall₂ (r · ·) l₁ l₂

{α : Type u_1}
{β : Type u_2}
{r : α → β → Bool}
(l₁ : List α)
(l₂ : List β)

List.all₂ r l₁ l₂ = true ↔ List.Forall₂ (fun x x_1 => r x x_1 = true) l₁ l₂


protected theorem IsAlgebraic.algebraMap {a : S} :
    IsAlgebraic R a → IsAlgebraic R (algebraMap S A a)

{R : Type u}
{S : Type u_1}
{A : Type v}
[CommRing R]
[CommRing S]
[Ring A]
[Algebra R A]
[Algebra R S]
[Algebra S A]
[IsScalarTower R S A]
{a : S}

IsAlgebraic R a → IsAlgebraic R ((algebraMap S A) a)


theorem hasLineDerivWithinAt_congr_set (h : s =ᶠ[𝓝 x] t) :
    HasLineDerivWithinAt 𝕜 f f' s x v ↔ HasLineDerivWithinAt 𝕜 f f' t 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}
{f' : F}
{s t : Set E}
{x v : E}
(h : s =ᶠ[𝓝 x] t)


@[to_additive]
theorem haarMeasure_closure_self {K₀ : PositiveCompacts G} : haarMeasure K₀ (closure K₀) = 1

{K₀ : TopologicalSpace.PositiveCompacts G}

(MeasureTheory.Measure.haarMeasure K₀) (closure ↑K₀) = 1


theorem ae_tendsto_lintegral_div' {f : α → ℝ≥0∞} (hf : Measurable f) (h'f : (∫⁻ y, f y ∂μ) ≠ ∞) :
    ∀ᵐ x ∂μ, Tendsto (fun a => (∫⁻ y in a, f y ∂μ) / μ a) (v.filterAt x) (𝓝 (f x))

{f : α → ℝ≥0∞}

∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun a => (∫⁻ (y : α) in a, f y ∂μ) / μ a) (v.filterAt x) (𝓝 (f x))


theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂

{V : Type u}
[Quiver V]
{a b c : V}
{p₁ p₂ : Quiver.Path a b}
{q₁ q₂ : Quiver.Path b c}
(hq : q₁.length = q₂.length)


/-- A submodule is equal to the supremum of the spans of the submodule's nonzero elements. -/
theorem submodule_eq_sSup_le_nonzero_spans (p : Submodule R M) :
    p = sSup { T : Submodule R M | ∃ m ∈ p, m ≠ 0 ∧ T = span R {m} }

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : Submodule R M)

p = sSup {T | ∃ m ∈ p, m ≠ 0 ∧ T = Submodule.span R {m}}


/-- If the difference of two Bases is a singleton, then they differ by an insertion/removal -/
theorem Base.eq_exchange_of_diff_eq_singleton (hB : M.Base B) (hB' : M.Base B') (h : B \ B' = {e}) :
    ∃ f ∈ B' \ B, B' = (insert f B) \ {e}

{α : Type u_1}
{M : Matroid α}
{B B' : Set α}
{e : α}
(hB : M.Base B)
(hB' : M.Base B')
(h : B \ B' = {e})


@[simp]
theorem gcd_self_sub_left {m n : ℕ} (h : m ≤ n) : gcd (n - m) n = gcd m n


/-- A subgraph of a `SimpleGraph` is a subset of vertices along with a restriction of the adjacency
relation that is symmetric and is supported by the vertex subset.  They also form a bounded lattice.

Thinking of `V → V → Prop` as `Set (V × V)`, a set of darts (i.e., half-edges), then
`Subgraph.adj_sub` is that the darts of a subgraph are a subset of the darts of `G`. -/
@[ext]
structure Subgraph {V : Type u} (G : SimpleGraph V) where
  verts : Set V
  Adj : V → V → Prop
  adj_sub : ∀ {v w : V}, Adj v w → G.Adj v w
  edge_vert : ∀ {v w : V}, Adj v w → v ∈ verts
  symm : Symmetric Adj := by aesop_graph

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


/-- A useful special case of `Continuous.path_extend`. -/
@[continuity, fun_prop]
theorem continuous_extend : Continuous γ.extend

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


/-- The tangent of an angle in a right-angled triangle multiplied by the adjacent side equals
the opposite side, version subtracting vectors. -/
theorem tan_oangle_sub_left_mul_norm_of_oangle_eq_pi_div_two {x y : V}
    (h : o.oangle x y = ↑(π / 2)) : Real.Angle.tan (o.oangle (x - y) x) * ‖x‖ = ‖y‖

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


theorem LinearMap.associated_det_comp_equiv {N : Type*} [AddCommGroup N] [Module R N]
    (f : N →ₗ[R] M) (e e' : M ≃ₗ[R] N) :
    Associated (LinearMap.det (f ∘ₗ ↑e)) (LinearMap.det (f ∘ₗ ↑e'))

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Type u_5}
[AddCommGroup N]
[Module R N]
(f : N →ₗ[R] M)
(e e' : M ≃ₗ[R] N)


theorem isUnit_of_natDegree_eq_zero_of_isPrimitive {p q : R[X]}
    -- Porting note: stated using `IsPrimitive` which is defeq to old statement.
    (hu : IsPrimitive (p * q)) (hpm : p.natDegree = 0) : IsUnit p

{R : Type u_1}
[CommRing R]
{p q : R[X]}
(hu : (p * q).IsPrimitive)
(hpm : p.natDegree = 0)


theorem coe_add (x y : 𝕜) : (↑(x + y) : AddCircle p) = (x : AddCircle p) + (y : AddCircle p)

{𝕜 : Type u_1}
[LinearOrderedAddCommGroup 𝕜]
(p x y : 𝕜)


lemma mem_homologicalKernel_W_iff {X Y : C} (f : X ⟶ Y) :
    F.homologicalKernel.W f ↔ ∀ (n : ℤ), IsIso ((F.shift n).map f)

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

F.homologicalKernel.W f ↔ ∀ (n : ℤ), CategoryTheory.IsIso ((F.shift n).map f)


/-- Reflection is involutive. -/
@[simp]
theorem reflection_mul_reflection : reflection K * reflection K = 1

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(K : Submodule 𝕜 E)
[HasOrthogonalProjection K]


theorem NullMeasurableSet.const_smul (hs : NullMeasurableSet s μ) (r : ℝ) :
    NullMeasurableSet (r • s) μ

(hs : MeasureTheory.NullMeasurableSet s μ)

MeasureTheory.NullMeasurableSet (r • s) μ


@[to_additive (attr := simp)]
lemma lipschitzOnWith_inv_iff : LipschitzOnWith K f⁻¹ s ↔ LipschitzOnWith K f s

{α : Type u_5}
{E : Type u_6}
[SeminormedAddCommGroup E]
[PseudoEMetricSpace α]
{K : ℝ≥0}
{f : α → E}
{s : Set α}

LipschitzOnWith K (-f) s ↔ LipschitzOnWith K f s


/-- Two equal natural transformations `R₁ ⟶ R₂` yield naturally isomorphic functors
    `Comma L R₁ ⥤ Comma L R₂`. -/
@[simps!]
def mapRightEq (r r' : R₁ ⟶ R₂) (h : r = r') : mapRight L r ≅ mapRight 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]
(L : CategoryTheory.Functor A T)
{R₁ R₂ : CategoryTheory.Functor B T}
(r r' : R₁ ⟶ R₂)
(h : r = r')
(X : CategoryTheory.Comma L R₁)

((CategoryTheory.Comma.mapRightEq L r r' h).hom.app X).left = CategoryTheory.CategoryStruct.id X.left


@[to_additive (attr := norm_cast)]
theorem pow_apply [Monoid β] [ContinuousMul β] (f : C(α, β)) (n : ℕ) (x : α) :
    (f ^ n) x = f x ^ n

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[AddMonoid β]
[ContinuousAdd β]
(f : C(α, β))
(n : ℕ)
(x : α)


/-- A kernel is s-finite if it can be written as the sum of countably many finite kernels. -/
class _root_.ProbabilityTheory.IsSFiniteKernel (κ : Kernel α β) : Prop where
  tsum_finite : ∃ κs : ℕ → Kernel α β, (∀ n, IsFiniteKernel (κs n)) ∧ κ = Kernel.sum κs

[self : ProbabilityTheory.IsSFiniteKernel κ]

∃ κs, (∀ (n : ℕ), ProbabilityTheory.IsFiniteKernel (κs n)) ∧ κ = ProbabilityTheory.Kernel.sum κs


@[simp]
theorem zero_apply {V W : SemiNormedGrp} (x : V) : (0 : V ⟶ W) x = 0


@[simp]
theorem basisFun_apply [DecidableEq ι] (i : ι) : basisFun ι 𝕜 i = EuclideanSpace.single i 1

(ι : Type u_1)
(𝕜 : Type u_3)
[RCLike 𝕜]
[Fintype ι]
[DecidableEq ι]
(i : ι)

(EuclideanSpace.basisFun ι 𝕜) i = EuclideanSpace.single i 1


theorem coeff_eval_eq_eval_coeff (s' : Fin n → R) (f : Polynomial (MvPolynomial (Fin n) R))
    (i : ℕ) : Polynomial.coeff (Polynomial.map (eval s') f) i = eval s' (Polynomial.coeff f i)

{R : Type u}
[CommSemiring R]
{n : ℕ}
(s' : Fin n → R)
(f : (MvPolynomial (Fin n) R)[X])
(i : ℕ)

(Polynomial.map (MvPolynomial.eval s') f).coeff i = (MvPolynomial.eval s') (f.coeff i)


@[simp]
theorem codisjoint_bot : Codisjoint a ⊥ ↔ a = ⊤

{α : Type u_1}
[PartialOrder α]
[BoundedOrder α]
{a : α}


/-- If the determinant of a map vanishes, then the map is not injective. -/
theorem bot_lt_ker_of_det_eq_zero {𝕜 : Type*} [Field 𝕜] [Module 𝕜 M] {f : M →ₗ[𝕜] M}
    (hf : LinearMap.det f = 0) : ⊥ < LinearMap.ker f

{M : Type u_2}
[AddCommGroup M]
{𝕜 : Type u_7}
[Field 𝕜]
[Module 𝕜 M]
{f : M →ₗ[𝕜] M}
(hf : LinearMap.det f = 0)


@[to_additive] -- Porting note: removed `simp` because `simpNF` says it can prove it.
theorem card_bot : Nat.card (⊥ : Subgroup G) = 1


theorem HasFPowerSeriesOnBall.eventually_hasSum (hf : HasFPowerSeriesOnBall f p x r) :
    ∀ᶠ y in 𝓝 0, HasSum (fun n : ℕ => p n fun _ : Fin n => y) (f (x + y))

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f p x r)

∀ᶠ (y : E) in 𝓝 0, HasSum (fun n => (p n) fun x => y) (f (x + y))


/-- Given two composable morphisms `f : X₁ ⟶ X₂` and `g : X₂ ⟶ X₃` in the category
of cochain complexes, this is the canonical triangle
`mappingCone f ⟶ mappingCone (f ≫ g) ⟶ mappingCone g ⟶ (mappingCone f)⟦1⟧`. -/
@[simps! mor₁ mor₂ mor₃ obj₁ obj₂ obj₃]
noncomputable def mappingConeCompTriangle : Triangle (CochainComplex C ℤ)

(CochainComplex.mappingConeCompTriangle f g).mor₂ = CochainComplex.mappingCone.map (f ≫ g) g f (𝟙 X₃) ⋯


theorem ae_restrict_iff₀ {p : α → Prop} (hp : NullMeasurableSet { x | p x } (μ.restrict s)) :
    (∀ᵐ x ∂μ.restrict s, p x) ↔ ∀ᵐ x ∂μ, x ∈ s → p x

(hp : MeasureTheory.NullMeasurableSet {x | p x} (μ.restrict s))

(∀ᵐ (x : α) ∂μ.restrict s, p x) ↔ ∀ᵐ (x : α) ∂μ, x ∈ s → p x


theorem eval_eq_rfindOpt (c n) : eval c n = Nat.rfindOpt fun k => evaln k c n

c.eval n = Nat.rfindOpt fun k => Nat.Partrec.Code.evaln k c n


/-- An upper set is Lawson open if and only if it is Scott open -/
lemma lawsonOpen_iff_scottOpen_of_isUpperSet' (s : Set α) (h : IsUpperSet s) :
    IsOpen[L] s ↔ IsOpen[S] s

{α : Type u_1}
[Preorder α]
(L S : TopologicalSpace α)
[Topology.IsLawson α]
[Topology.IsScott α]
(s : Set α)
(h : IsUpperSet s)


@[simp]
theorem bind₂_C_right (f : R →+* MvPolynomial σ S) (r : R) : bind₂ f (C r) = f r

{σ : Type u_1}
{R : Type u_3}
{S : Type u_4}
[CommSemiring R]
[CommSemiring S]
(f : R →+* MvPolynomial σ S)
(r : R)

(MvPolynomial.bind₂ f) (MvPolynomial.C r) = f r


@[to_additive (attr := simp)]
lemma finite_powers : (powers a : Set G).Finite ↔ IsOfFinOrder a

{G : Type u_1}
[AddLeftCancelMonoid G]
{a : G}

(↑(AddSubmonoid.multiples a)).Finite ↔ IsOfFinAddOrder a


@[to_additive]
theorem mem_closure_union_iff {G : Type*} [CommGroup G] {s t : Set G} {x : G} :
    x ∈ closure (s ∪ t) ↔ ∃ y ∈ closure s, ∃ z ∈ closure t, y * z = x

{G : Type u_4}
[CommGroup G]
{s t : Set G}
{x : G}

x ∈ Group.closure (s ∪ t) ↔ ∃ y ∈ Group.closure s, ∃ z ∈ Group.closure t, y * z = x


theorem preimage_comap_zeroLocus_aux (f : R →+* S) (s : Set R) :
    (fun y => ⟨Ideal.comap f y.asIdeal, inferInstance⟩ : PrimeSpectrum S → PrimeSpectrum R) ⁻¹'
        zeroLocus s =
      zeroLocus (f '' s)

{R : Type u}
{S : Type v}
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
(s : Set R)

(fun y => { asIdeal := Ideal.comap f y.asIdeal, isPrime := ⋯ }) ⁻¹' PrimeSpectrum.zeroLocus s =
  PrimeSpectrum.zeroLocus (⇑f '' s)


theorem comp_hasFDerivWithinAt_iff {f : G → E} {s : Set G} {x : G} {f' : G →L[𝕜] E} :
    HasFDerivWithinAt (iso ∘ f) ((iso : E →L[𝕜] F).comp f') s x ↔ HasFDerivWithinAt f f' s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(iso : E ≃ₗᵢ[𝕜] F)
{f : G → E}
{s : Set G}
{x : G}
{f' : G →L[𝕜] E}

HasFDerivWithinAt (⇑iso ∘ f)
    ((↑{ toLinearEquiv := iso.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ }).comp f') s x ↔
  HasFDerivWithinAt f f' s x


@[simp]
theorem star_rat_smul {R : Type*} [AddCommGroup R] [StarAddMonoid R] [Module ℚ R] (x : R) (n : ℚ) :
    star (n • x) = n • star x

{R : Type u_3}
[AddCommGroup R]
[StarAddMonoid R]
[Module ℚ R]
(x : R)
(n : ℚ)


/-- For a function `f` on `𝕜`, and `z₀ ∈ 𝕜`, there exists at most one `n` such that on a punctured
neighbourhood of `z₀` we have `f z = (z - z₀) ^ n • g z`, with `g` analytic and nonvanishing at
`z₀`. We formulate this with `n : ℤ`, and deduce the case `n : ℕ` later, for applications to
meromorphic functions. -/
lemma unique_eventuallyEq_zpow_smul_nonzero {m n : ℤ}
    (hm : ∃ g, AnalyticAt 𝕜 g z₀ ∧ g z₀ ≠ 0 ∧ ∀ᶠ z in 𝓝[≠] z₀, f z = (z - z₀) ^ m • g z)
    (hn : ∃ g, AnalyticAt 𝕜 g z₀ ∧ g z₀ ≠ 0 ∧ ∀ᶠ z in 𝓝[≠] z₀, f z = (z - z₀) ^ n • g z) :
    m = n

(hm : ∃ g, AnalyticAt 𝕜 g z₀ ∧ g z₀ ≠ 0 ∧ ∀ᶠ (z : 𝕜) in 𝓝[≠] z₀, f z = (z - z₀) ^ m • g z)

(hn : ∃ g, AnalyticAt 𝕜 g z₀ ∧ g z₀ ≠ 0 ∧ ∀ᶠ (z : 𝕜) in 𝓝[≠] z₀, f z = (z - z₀) ^ n • g z)


@[to_additive (attr := simp)]
theorem smul_none : a • (none : Option α) = none

{M : Type u_1}
{α : Type u_3}
[SMul M α]
(a : M)


@[norm_cast]
theorem Int.natCast_multiplicity (a b : ℕ) : multiplicity (a : ℤ) (b : ℤ) = multiplicity a b


theorem StrictConvexOn.add (hf : StrictConvexOn 𝕜 s f) (hg : StrictConvexOn 𝕜 s g) :
    StrictConvexOn 𝕜 s (f + g)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedCancelAddCommMonoid β]
[SMul 𝕜 E]
[DistribMulAction 𝕜 β]
{s : Set E}
{f g : E → β}
(hf : StrictConvexOn 𝕜 s f)
(hg : StrictConvexOn 𝕜 s g)


@[simp]
lemma preNormEDS_two : preNormEDS b c d 2 = 1


@[simp]
theorem consElim_cons {C H a t} : @consElim α n C H (a :: t) = H a t

{H : (a : α) → (t : Vector3 α n) → C (Vector3.cons a t)}

Vector3.consElim H (Vector3.cons a t) = H a t


@[reassoc (attr := simp)]
theorem app_idem : P.p.app X ≫ P.p.app X = P.p.app X

(P : CategoryTheory.Idempotents.Karoubi (J ⥤ C))


theorem charZero_of_inj_zero [AddGroupWithOne R] (H : ∀ n : ℕ, (n : R) = 0 → n = 0) :
    CharZero R

{R : Type u_1}
[AddGroupWithOne R]
(H : ∀ (n : ℕ), ↑n = 0 → n = 0)


/-- An ordered cancellative vector addition is an ordered vector addition that is cancellative. -/
class IsOrderedCancelVAdd (G P : Type*) [LE G] [LE P] [VAdd G P] extends
    IsOrderedVAdd G P : Prop where
  protected le_of_vadd_le_vadd_left : ∀ (a : G) (b c : P), a +ᵥ b ≤ a +ᵥ c → b ≤ c
  protected le_of_vadd_le_vadd_right : ∀ (a b : G) (c : P), a +ᵥ c ≤ b +ᵥ c → a ≤ b

{G : Type u_3}
{P : Type u_4}
[LE G]
[LE P]
[VAdd G P]
[self : IsOrderedCancelVAdd G P]
(a : G)
(b c : P)


@[simp]
protected theorem smul_def (f : RingAut R) (r : R) : f • r = f r

{R : Type u_2}
[Semiring R]
(f : RingAut R)
(r : R)


theorem eq_symm_apply {x : X} {y : Y} (hx : x ∈ e.source) (hy : y ∈ e.target) :
    x = e.symm y ↔ e x = y

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{x : X}
{y : Y}
(hx : x ∈ e.source)
(hy : y ∈ e.target)


theorem reesAlgebra.monomial_mem {I : Ideal R} {i : ℕ} {r : R} :
    monomial i r ∈ reesAlgebra I ↔ r ∈ I ^ i

{R : Type u}
[CommRing R]
{I : Ideal R}
{i : ℕ}
{r : R}

(Polynomial.monomial i) r ∈ reesAlgebra I ↔ r ∈ I ^ i


theorem associated_eq_eq : (Associated : α → α → Prop) = Eq


@[simp]
theorem mk_vcomp {f g h : a ⟶ b} (η : Hom₂ f g) (θ : Hom₂ g h) :
    (η.vcomp θ).mk = (η.mk ≫ θ.mk : f ⟶ h)

(η : CategoryTheory.FreeBicategory.Hom₂ f g)

(θ : CategoryTheory.FreeBicategory.Hom₂ g h)

(η.vcomp θ).mk = CategoryTheory.CategoryStruct.comp η.mk θ.mk


@[reassoc (attr := simp)]
theorem inl_biprodComparison' : biprod.inl ≫ biprodComparison' F X Y = F.map biprod.inl

[CategoryTheory.Limits.HasBinaryBiproduct (F.obj X) (F.obj Y)]

CategoryTheory.Limits.biprod.inl ≫ F.biprodComparison' X Y = F.map CategoryTheory.Limits.biprod.inl


lemma restrictScalarsComp'App_hom_apply (M : ModuleCat R₃) (x : M) :
    (restrictScalarsComp'App f g gf hgf M).hom x = x

{R₁ : Type u₁}
{R₂ : Type u₂}
{R₃ : Type u₃}
[Ring R₁]
[Ring R₂]
[Ring R₃]
(f : R₁ →+* R₂)
(g : R₂ →+* R₃)
(gf : R₁ →+* R₃)
(hgf : gf = g.comp f)
(M : ModuleCat R₃)
(x : ↑M)

(ModuleCat.restrictScalarsComp'App f g gf hgf M).hom x = x


/-- `FrameHomClass F α β` states that `F` is a type of frame morphisms. They preserve `⊓` and `⨆`.

You should extend this class when you extend `FrameHom`. -/
class FrameHomClass (F α β : Type*) [CompleteLattice α] [CompleteLattice β] [FunLike F α β]
  extends InfTopHomClass F α β : Prop where
  /-- The proposition that members of `FrameHomClass` commute with arbitrary suprema/joins. -/
  map_sSup (f : F) (s : Set α) : f (sSup s) = sSup (f '' s)

{F : Type u_8}
{α : Type u_9}
{β : Type u_10}
[CompleteLattice α]
[CompleteLattice β]
[FunLike F α β]
[self : FrameHomClass F α β]
(f : F)
(s : Set α)


@[simp] lemma predAbove_zero_succ [NeZero n] {i : Fin n} : predAbove 0 i.succ = i


protected theorem congr_fun {f g : A₁ ≃ₐ[R] A₂} (h : f = g) (x : A₁) : f x = g x

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
{f g : A₁ ≃ₐ[R] A₂}
(h : f = g)
(x : A₁)


theorem commonNeighbors_symm (v w : V) : G.commonNeighbors v w = G.commonNeighbors w v

{V : Type u}
(G : SimpleGraph V)
(v w : V)


nonrec theorem HasDerivWithinAt.sub_const (hf : HasDerivWithinAt f f' s x) (c : F) :
    HasDerivWithinAt (fun x => f x - c) f' s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s : Set 𝕜}
(hf : HasDerivWithinAt f f' s x)
(c : F)


theorem range_top_iff_surjective {f : R →+* S} :
    f.range = (⊤ : Subring S) ↔ Function.Surjective f

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
{f : R →+* S}


lemma dvd_of_mul_dvd_mul_right (ha : a ≠ 0) (h : m * a ∣ n * a) : m ∣ n

{a m n : ℤ}
(ha : a ≠ 0)
(h : m * a ∣ n * a)


theorem integrableOn_map_equiv [MeasurableSpace β] (e : α ≃ᵐ β) {f : β → E} {μ : Measure α}
    {s : Set β} : IntegrableOn f s (μ.map e) ↔ IntegrableOn (f ∘ e) (e ⁻¹' s) μ

{α : Type u_1}
{β : Type u_2}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
[MeasurableSpace β]
(e : α ≃ᵐ β)
{f : β → E}
{μ : MeasureTheory.Measure α}
{s : Set β}

MeasureTheory.IntegrableOn f s (MeasureTheory.Measure.map (⇑e) μ) ↔ MeasureTheory.IntegrableOn (f ∘ ⇑e) (⇑e ⁻¹' s) μ


theorem multichoose_eq : ∀ n k : ℕ, multichoose n k = (n + k - 1).choose k


/-- To show a category is an `InitialMonoClass` it suffices to show every morphism out of the
initial object is a monomorphism. -/
theorem InitialMonoClass.of_initial [HasInitial C] (h : ∀ X : C, Mono (initial.to X)) :
    InitialMonoClass C

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


@[to_additive tsum_of_nat_of_neg_add_one]
lemma tprod_of_nat_of_neg_add_one [T2Space M] {f : ℤ → M}
    (hf₁ : Multipliable fun n : ℕ ↦ f n) (hf₂ : Multipliable fun n : ℕ ↦ f (-(n + 1))) :
    ∏' n : ℤ, f n = (∏' n : ℕ, f n) * ∏' n : ℕ, f (-(n + 1))

(hf₂ : Multipliable fun n => f (-(↑n + 1)))


theorem Periodic.sub_antiperiod [AddGroup α] [InvolutiveNeg β] (h1 : Periodic f c₁)
    (h2 : Antiperiodic f c₂) : Antiperiodic f (c₁ - c₂)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c₁ c₂ : α}
[AddGroup α]
[InvolutiveNeg β]
(h1 : Function.Periodic f c₁)
(h2 : Function.Antiperiodic f c₂)


theorem monovary_const_left (g : ι → β) (a : α) : Monovary (const ι a) g

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
(g : ι → β)
(a : α)


{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
(x : E)


protected theorem _root_.Bornology.IsBounded.thickening {δ : ℝ} {E : Set X} (h : IsBounded E) :
    IsBounded (thickening δ E)

{X : Type u}
[PseudoMetricSpace X]
{δ : ℝ}
{E : Set X}
(h : Bornology.IsBounded E)

Bornology.IsBounded (Metric.thickening δ E)


/-- The equivalence between R-linear maps from `R` to `M`, and points of `M` itself.
This says that the forgetful functor from `R`-modules to types is representable, by `R`.

This is an `S`-linear equivalence, under the assumption that `S` acts on `M` commuting with `R`.
When `R` is commutative, we can take this to be the usual action with `S = R`.
Otherwise, `S = ℕ` shows that the equivalence is additive.
See note [bundled maps over different rings].
-/
@[simps]
def ringLmapEquivSelf [Module S M] [SMulCommClass R S M] : (R →ₗ[R] M) ≃ₗ[S] M

(R : Type u_1)
(S : Type u_7)
(M : Type u_8)
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[Module R M]
[Module S M]
[SMulCommClass R S M]
(x : M)

(LinearMap.ringLmapEquivSelf R S M).symm x = LinearMap.smulRight 1 x


/-- If `c` is a limiting binary product cone, and we have a terminal object,
then we have `IsPullback c.fst c.snd 0 0`
(where each `0` is the unique morphism to the terminal object). -/
theorem of_is_product {c : BinaryFan X Y} (h : Limits.IsLimit c) (t : IsTerminal Z) :
    IsPullback c.fst c.snd (t.from _) (t.from _)

{c : CategoryTheory.Limits.BinaryFan X Y}

(t : CategoryTheory.Limits.IsTerminal Z)

CategoryTheory.IsPullback c.fst c.snd
  (t.from ((CategoryTheory.Limits.pair X Y).obj { as := CategoryTheory.Limits.WalkingPair.left }))
  (t.from ((CategoryTheory.Limits.pair X Y).obj { as := CategoryTheory.Limits.WalkingPair.right }))


protected theorem pow_lt_pow_of_lt {a n m : Nat} (h : 1 < a) (w : n < m) : a ^ n < a ^ m


lemma Args.numeric_P24 {x₁ x₂ y} :
    (Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric

(Surreal.Multiplication.Args.P24 x₁ x₂ y).Numeric ↔ x₁.Numeric ∧ x₂.Numeric ∧ y.Numeric


theorem nhds_bot_order [TopologicalSpace α] [Preorder α] [OrderBot α] [OrderTopology α] :
    𝓝 (⊥ : α) = ⨅ (l) (h₂ : ⊥ < l), 𝓟 (Iio l)

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[OrderBot α]
[OrderTopology α]


theorem LocallyIntegrableOn.norm (hf : LocallyIntegrableOn f s μ) :
    LocallyIntegrableOn (fun x => ‖f x‖) s μ

(hf : MeasureTheory.LocallyIntegrableOn f s μ)

MeasureTheory.LocallyIntegrableOn (fun x => ‖f x‖) s μ


@[simp]
theorem contractRight_one : (1 : CliffordAlgebra Q)⌊d = 0

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(d : Module.Dual R M)


@[reassoc (attr := simp, nolint simpNF)]
theorem obj_ε_app (n : M) (X : C) :
    (F.obj n).map (F.ε.app X) = (F.map (λ_ n).inv).app X ≫ (F.μIso (𝟙_ M) n).inv.app X

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

(F.obj n).map (F.ε.app X) =
  CategoryTheory.CategoryStruct.comp ((F.map (CategoryTheory.MonoidalCategory.leftUnitor n).inv).app X)
    ((F.μIso (𝟙_ M) n).inv.app X)


theorem laverage_eq' (f : α → ℝ≥0∞) : ⨍⁻ x, f x ∂μ = ∫⁻ x, f x ∂(μ univ)⁻¹ • μ

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

⨍⁻ (x : α), f x ∂μ = ∫⁻ (x : α), f x ∂(μ Set.univ)⁻¹ • μ


@[to_additive indicator_nonneg]
lemma one_le_mulIndicator (h : ∀ a ∈ s, 1 ≤ f a) (a : α) : 1 ≤ mulIndicator s f a

{α : Type u_2}
{M : Type u_4}
[Preorder M]
[Zero M]
{s : Set α}
{f : α → M}
(h : ∀ a ∈ s, 0 ≤ f a)
(a : α)


/-- The sum of two lower semicontinuous functions is lower semicontinuous. Formulated with
`[ContinuousAdd]`. The primed version of the lemma uses an explicit continuity assumption on
addition, for application to `EReal`. -/
theorem LowerSemicontinuousAt.add {f g : α → γ} (hf : LowerSemicontinuousAt f x)
    (hg : LowerSemicontinuousAt g x) : LowerSemicontinuousAt (fun z => f z + g z) x

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{γ : Type u_4}
[LinearOrderedAddCommMonoid γ]
[TopologicalSpace γ]
[OrderTopology γ]
[ContinuousAdd γ]
{f g : α → γ}
(hf : LowerSemicontinuousAt f x)
(hg : LowerSemicontinuousAt g x)


protected theorem Finite.powerset {s : Set α} (h : s.Finite) : (𝒫 s).Finite


/-- This special case of `PGame.le_of_forall_lf` is useful when dealing with surreals, where `<` is
preferred over `⧏`. -/
theorem le_of_forall_lt {x y : PGame} (h₁ : ∀ i, x.moveLeft i < y) (h₂ : ∀ j, x < y.moveRight j) :
    x ≤ y

(h₁ : ∀ (i : x.LeftMoves), x.moveLeft i < y)

(h₂ : ∀ (j : y.RightMoves), x < y.moveRight j)


@[simp]
theorem restrict_apply (s t : Set α) (m : OuterMeasure α) : restrict s m t = m (t ∩ s)

{α : Type u_1}
(s t : Set α)
(m : MeasureTheory.OuterMeasure α)

((MeasureTheory.OuterMeasure.restrict s) m) t = m (t ∩ s)


theorem sinh_sq : sinh x ^ 2 = cosh x ^ 2 - 1

Complex.sinh x ^ 2 = Complex.cosh x ^ 2 - 1


theorem subsingleton_of_top_le_bot (h : (⊤ : α) ≤ (⊥ : α)) : Subsingleton α

{α : Type u}
[PartialOrder α]
[BoundedOrder α]
(h : ⊤ ≤ ⊥)


/-- The supremum of a set S of equivalence relations is the equivalence closure of the binary
    relation `there exists r ∈ S relating x and y`. -/
theorem sSup_eq_eqvGen (S : Set (Setoid α)) :
    sSup S = EqvGen.Setoid fun x y => ∃ r : Setoid α, r ∈ S ∧ r.Rel x y

sSup S = EqvGen.Setoid fun x y => ∃ r ∈ S, r.Rel x y


@[simp] theorem Bool.not_true  : (!true) = false


theorem neg {f : ∀ i, E i} (hf : Memℓp f p) : Memℓp (-f) p

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
{f : (i : α) → E i}
(hf : Memℓp f p)


theorem Algebra.IsIntegral.isField_iff_isField {R S : Type*} [CommRing R]
    [CommRing S] [IsDomain S] [Algebra R S] [Algebra.IsIntegral R S]
    (hRS : Function.Injective (algebraMap R S)) : IsField R ↔ IsField S

(hRS : Function.Injective ⇑(algebraMap R S))


/-- The anti-equivalence between cosimplicial objects and simplicial objects. -/
@[simps!]
def cosimplicialSimplicialEquiv : (CosimplicialObject C)ᵒᵖ ≌ SimplicialObject Cᵒᵖ

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(F : (SimplexCategory ⥤ C)ᵒᵖ)
(X : SimplexCategoryᵒᵖ)

((CategoryTheory.cosimplicialSimplicialEquiv C).functor.obj F).obj X =
  Opposite.op ((Opposite.unop F).obj (Opposite.unop X))


@[simp]
theorem mem_roots' : a ∈ p.roots ↔ p ≠ 0 ∧ IsRoot p a

{R : Type u}
{a : R}
[CommRing R]
[IsDomain R]
{p : Polynomial R}


@[to_additive]
theorem div_lt_iff_lt_mul : a / c < b ↔ a < b * c

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


@[to_additive (attr := simp)]
lemma stabilizer_univ : stabilizer G (Set.univ : Set α) = ⊤

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]


theorem tangentMapWithin_eq_tangentMap {p : TangentBundle I M} (hs : UniqueMDiffWithinAt I s p.1)
    (h : MDifferentiableAt I I' f p.1) : tangentMapWithin I I' f s p = tangentMap I I' f p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{s : Set M}
[Is : SmoothManifoldWithCorners I M]
[I's : SmoothManifoldWithCorners I' M']
{p : TangentBundle I M}
(hs : UniqueMDiffWithinAt I s p.proj)
(h : MDifferentiableAt I I' f p.proj)


@[norm_cast, simp]
theorem coe_pow (n : ℕ) : (↑(x ^ n) : ℍ[R,c₁,c₂]) = (x : ℍ[R,c₁,c₂]) ^ n

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(x : R)
(n : ℕ)


protected theorem polarCoord_source : Complex.polarCoord.source = slitPlane


protected theorem nonempty_coeSort {U : Opens α} : Nonempty U ↔ (U : Set α).Nonempty

{α : Type u_2}
[TopologicalSpace α]
{U : TopologicalSpace.Opens α}


/-- To check a polynomial over a field is irreducible, it suffices to check only for
divisors that have smaller degree.

See also: `Polynomial.Monic.irreducible_iff_natDegree`.
-/
theorem irreducible_iff_degree_lt (p : R[X]) (hp0 : p ≠ 0) (hpu : ¬ IsUnit p) :
    Irreducible p ↔ ∀ q, q.degree ≤ ↑(natDegree p / 2) → q ∣ p → IsUnit q

{R : Type u}
[Field R]
(p : R[X])
(hp0 : p ≠ 0)
(hpu : ¬IsUnit p)

Irreducible p ↔ ∀ (q : R[X]), q.degree ≤ ↑(p.natDegree / 2) → q ∣ p → IsUnit q


theorem toOpen_eq_const (U : Opens (PrimeSpectrum.Top R)) (f : R) :
    toOpen R U f = const R f 1 U fun x _ => (Ideal.ne_top_iff_one _).1 x.2.1

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

(AlgebraicGeometry.StructureSheaf.toOpen R U) f = AlgebraicGeometry.StructureSheaf.const R f 1 U ⋯


theorem KaehlerDifferential.kerTotal_mkQ_single_mul (x y z) :
    (z𝖣x * y) = ((z * x)𝖣y) + (z * y)𝖣x

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]
(x y z : S)

(KaehlerDifferential.kerTotal R S).mkQ (Finsupp.single (x * y) z) =
  (KaehlerDifferential.kerTotal R S).mkQ (Finsupp.single y (z * x)) +
    (KaehlerDifferential.kerTotal R S).mkQ (Finsupp.single x (z * y))


theorem cycleType_le_of_mem_cycleFactorsFinset {f g : Perm α} (hf : f ∈ g.cycleFactorsFinset) :
    f.cycleType ≤ g.cycleType

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{f g : Equiv.Perm α}
(hf : f ∈ g.cycleFactorsFinset)


@[simp]
theorem trivialization_target : (trivialization B F).target = univ

(B : Type u_1)
(F : Type u_2)
[TopologicalSpace B]
[TopologicalSpace F]

(Bundle.Trivial.trivialization B F).target = Set.univ


/-- **Strong law of large numbers**, almost sure version: if `X n` is a sequence of independent
identically distributed integrable random variables taking values in a Banach space,
then `n⁻¹ • ∑ i ∈ range n, X i` converges almost surely to `𝔼[X 0]`. We give here the strong
version, due to Etemadi, that only requires pairwise independence. -/
theorem strong_law_ae
    (X : ℕ → Ω → E) (hint : Integrable (X 0))
    (hindep : Pairwise (fun i j ↦ IndepFun (X i) (X j))) (hident : ∀ i, IdentDistrib (X i) (X 0)) :
    ∀ᵐ ω, Tendsto (fun n : ℕ ↦ (n : ℝ) ⁻¹ • (∑ i ∈ range n, X i ω)) atTop (𝓝 𝔼[X 0])

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

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

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

∀ᵐ (ω : Ω), Filter.Tendsto (fun n => (↑n)⁻¹ • ∑ i ∈ Finset.range n, X i ω) Filter.atTop (𝓝 (∫ (a : Ω), X 0 a))


lemma shiftFunctorAdd_inv_app_f (K : CochainComplex C ℤ) (a b n : ℤ) :
    ((shiftFunctorAdd (CochainComplex C ℤ) a b).inv.app K).f n =
      (K.XIsoOfEq (by dsimp; rw [add_comm a, add_assoc])).hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(K : CochainComplex C ℤ)
(a b n : ℤ)

((CategoryTheory.shiftFunctorAdd (CochainComplex C ℤ) a b).inv.app K).f n = (HomologicalComplex.XIsoOfEq K ⋯).hom


theorem exists_associated_mem_of_dvd_prod [CancelCommMonoidWithZero α] {p : α} (hp : Prime p)
    {s : Multiset α} : (∀ r ∈ s, Prime r) → p ∣ s.prod → ∃ q ∈ s, p ~ᵤ q

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p : α}
(hp : Prime p)
{s : Multiset α}


@[to_additive (attr := simp)]
lemma coe_comp {X Y Z : CommMonCat} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g : X → Z) = g ∘ f


@[elab_as_elim]
theorem left_induction {P : CliffordAlgebra Q → Prop} (algebraMap : ∀ r : R, P (algebraMap _ _ r))
    (add : ∀ x y, P x → P y → P (x + y)) (ι_mul : ∀ x m, P x → P (ι Q m * x)) : ∀ x, P x

(algebraMap : ∀ (r : R), P ((algebraMap R (CliffordAlgebra Q)) r))

(add : ∀ (x y : CliffordAlgebra Q), P x → P y → P (x + y))

(ι_mul : ∀ (x : CliffordAlgebra Q) (m : M), P x → P ((CliffordAlgebra.ι Q) m * x))


/-- A polynomial lifts if and only if it can be lifted to a polynomial of the same degree. -/
theorem mem_lifts_and_degree_eq {p : S[X]} (hlifts : p ∈ lifts f) :
    ∃ q : R[X], map f q = p ∧ q.degree = p.degree

{R : Type u}
[Semiring R]
{S : Type v}
[Semiring S]
{f : R →+* S}
{p : S[X]}
(hlifts : p ∈ Polynomial.lifts f)

∃ q, Polynomial.map f q = p ∧ q.degree = p.degree


lemma comp_assoc {a₁ a₂ a₃ a₁₂ a₂₃ a : ℕ} (α : Ext X Y a₁) (β : Ext Y Z a₂) (γ : Ext Z T a₃)
    (h₁₂ : a₁ + a₂ = a₁₂) (h₂₃ : a₂ + a₃ = a₂₃) (h : a₁ + a₂ + a₃ = a) :
    (α.comp β h₁₂).comp γ (show a₁₂ + a₃ = a by omega) =
      α.comp (β.comp γ h₂₃) (by omega)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
{X Y Z T : C}
{a₁ a₂ a₃ a₁₂ a₂₃ a : ℕ}
(α : CategoryTheory.Abelian.Ext X Y a₁)
(β : CategoryTheory.Abelian.Ext Y Z a₂)
(γ : CategoryTheory.Abelian.Ext Z T a₃)
(h₁₂ : a₁ + a₂ = a₁₂)
(h₂₃ : a₂ + a₃ = a₂₃)
(h : a₁ + a₂ + a₃ = a)

(α.comp β h₁₂).comp γ ⋯ = α.comp (β.comp γ h₂₃) ⋯


@[simp]
theorem coe_zero : ⇑(0 : SlashInvariantForm Γ k) = (0 : ℍ → ℂ)


theorem dist_le_tsum_dist_of_tendsto₀ (h : Summable fun n ↦ dist (f n) (f n.succ))
    (ha : Tendsto f atTop (𝓝 a)) : dist (f 0) a ≤ ∑' n, dist (f n) (f n.succ)

(h : Summable fun n => dist (f n) (f n.succ))

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

dist (f 0) a ≤ ∑' (n : ℕ), dist (f n) (f n.succ)


lemma SurjOn.perm_pow : SurjOn f s s → ∀ n : ℕ, SurjOn (f ^ n) s s

{α : Type u_1}
{f : Equiv.Perm α}
{s : Set α}

Set.SurjOn (⇑f) s s → ∀ (n : ℕ), Set.SurjOn (⇑(f ^ n)) s s


@[to_additive (attr := simp) AddMonoid.exp_eq_one_of_subsingleton]
theorem exp_eq_one_of_subsingleton [hs : Subsingleton G] : exponent G = 1

{G : Type u}
[AddMonoid G]
[hs : Subsingleton G]


@[to_additive]
theorem mapsTo_smul_orbit (m : M) (a : α) : Set.MapsTo (m • ·) (orbit M a) (orbit M a)

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

Set.MapsTo (fun x => m • x) (MulAction.orbit M a) (MulAction.orbit M a)


theorem kronecker_zero [MulZeroClass α] (A : Matrix l m α) : A ⊗ₖ (0 : Matrix n p α) = 0

{α : Type u_2}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
[MulZeroClass α]
(A : Matrix l m α)

Matrix.kroneckerMap (fun x x_1 => x * x_1) A 0 = 0


theorem linearIndependent_subtype_disjoint {s : Set M} :
    LinearIndependent R (fun x => x : s → M) ↔
      Disjoint (Finsupp.supported R R s) (LinearMap.ker <| Finsupp.total M M R id)

{R : Type u_2}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s : Set M}

(LinearIndependent R fun (x : ↑s) => ↑x) ↔ Disjoint (Finsupp.supported R R s) (LinearMap.ker (Finsupp.total M M R id))


lemma exact_iff_exact_map_forget₂ [S.HasHomology] :
    S.Exact ↔ (S.map (forget₂ C Ab)).Exact

S.Exact ↔ (S.map (CategoryTheory.forget₂ C Ab)).Exact


/-- This functor `SimplexCategory ⥤ Cat` sends `[n]` (for `n : ℕ`)
to the category attached to the ordered set `{0, 1, ..., n}` -/
@[simps! obj map]
def toCat : SimplexCategory ⥤ Cat.{0}

SimplexCategory.toCat.obj X =
  CategoryTheory.Cat.of
    ↑((CategoryTheory.forget₂ PartOrd Preord).obj
        ((CategoryTheory.forget₂ Lat PartOrd).obj
          ((CategoryTheory.forget₂ LinOrd Lat).obj
            ((CategoryTheory.forget₂ NonemptyFinLinOrd LinOrd).obj (NonemptyFinLinOrd.of (Fin (X.len + 1)))))))


theorem isGenericPoint_closure {x : α} : IsGenericPoint x (closure ({x} : Set α))

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


theorem Indep.not_dep (hI : M.Indep I) : ¬ M.Dep I

{α : Type u_1}
{M : Matroid α}
{I : Set α}
(hI : M.Indep I)


theorem injective_as_module_iff : Injective (⟨A⟩ : ModuleCat ℤ) ↔
    Injective (⟨A,inferInstance⟩ : AddCommGrp)

CategoryTheory.Injective (ModuleCat.mk A) ↔ CategoryTheory.Injective { α := A, str := inferInstance }


theorem convexOn_const (c : β) (hs : Convex 𝕜 s) : ConvexOn 𝕜 s fun _ : E => c

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
{s : Set E}
(c : β)
(hs : Convex 𝕜 s)


theorem pow_rpow_inv_natCast (x : ℝ≥0) {n : ℕ} (hn : n ≠ 0) : (x ^ n) ^ (n⁻¹ : ℝ) = x


/-- The natural functor from `Fintype` to `LightProfinite`, endowing a finite type with the
discrete topology. -/
@[simps!]
def FintypeCat.toLightProfinite : FintypeCat ⥤ LightProfinite

↑(FintypeCat.toLightProfinite.obj A).toTop = ↑A


@[to_additive (attr := simp)]
theorem pure_mul_pure : pure a * pure b = pure (a * b)

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

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

NonemptyInterval.pure a * NonemptyInterval.pure b = NonemptyInterval.pure (a * b)


@[simp, norm_cast]
theorem natCast_covBy {a b : ℕ} : (a : ℤ) ⋖ b ↔ a ⋖ b

↑a ⋖ ↑b ↔ a ⋖ b


theorem signAux_eq_signAux2 {n : ℕ} :
    ∀ (l : List α) (f : Perm α) (e : α ≃ Fin n) (_h : ∀ x, f x ≠ x → x ∈ l),
      signAux ((e.symm.trans f).trans e) = signAux2 l f

{α : Type u}
[DecidableEq α]
{n : ℕ}
(l : List α)
(f : Equiv.Perm α)
(e : α ≃ Fin n)
(_h : ∀ (x : α), f x ≠ x → x ∈ l)

Equiv.Perm.signAux ((e.symm.trans f).trans e) = Equiv.Perm.signAux2 l f


@[norm_cast] -- @[simp, norm_cast] -- Porting note: not in simpNF
theorem coe_subset_coe : (s : Set α) ⊆ t ↔ (s : NonemptyInterval α) ≤ t

{α : Type u_1}
[PartialOrder α]
{s t : NonemptyInterval α}

↑s ⊆ ↑t ↔ s ≤ t


@[simp]
theorem toOrderHom_eq_coe (f : PseudoEpimorphism α β) : ⇑f.toOrderHom = f

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(f : PseudoEpimorphism α β)


/-- The preimage of a compact set under an inducing map is a compact set. -/
theorem Inducing.isCompact_preimage {f : X → Y} (hf : Inducing f) (hf' : IsClosed (range f))
    {K : Set Y} (hK : IsCompact K) : IsCompact (f ⁻¹' K)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : Inducing f)
(hf' : IsClosed (Set.range f))
{K : Set Y}
(hK : IsCompact K)


@[continuity]
protected theorem continuous (f : P →ᴬ[R] Q) : Continuous f

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
{Q : Type u_5}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace Q]
[AddTorsor W Q]
(f : P →ᴬ[R] Q)


@[simp]
theorem IsRoot.def : IsRoot p a ↔ p.eval a = 0

{R : Type u}
{a : R}
[Semiring R]
{p : R[X]}


@[simp]
theorem half_le_self_iff : a / 2 ≤ a ↔ 0 ≤ a

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


@[to_additive]
lemma noncommProd_induction (s : Multiset α) (comm)
    (p : α → Prop) (hom : ∀ a b, p a → p b → p (a * b)) (unit : p 1) (base : ∀ x ∈ s, p x) :
    p (s.noncommProd comm)

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

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


@[aesop safe apply]
theorem inv {x : R} (hx : IsSelfAdjoint x) : IsSelfAdjoint x⁻¹

{R : Type u_1}
[DivisionSemiring R]
[StarRing R]
{x : R}
(hx : IsSelfAdjoint x)


@[to_additive normal_of_eq_addCosets]
theorem normal_of_eq_cosets (h : ∀ g : α, g • (s : Set α) = op g • s) : s.Normal

(h : ∀ (g : α), g • ↑s = MulOpposite.op g • ↑s)


/-- A prefunctor is a covering of quivers if it defines bijections on all stars and costars. -/
protected structure Prefunctor.IsCovering : Prop where
  star_bijective : ∀ u, Bijective (φ.star u)
  costar_bijective : ∀ u, Bijective (φ.costar u)

{U : Type u_1}
[Quiver U]
{V : Type u_2}
[Quiver V]
{φ : U ⥤q V}
(self : φ.IsCovering)
(u : U)


theorem eq_bot_or_exists_simple_le (N : Submodule R M) : N = ⊥ ∨ ∃ m ≤ N, IsSimpleModule R m

{R : Type u_2}
[Ring R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
[IsSemisimpleModule R M]
(N : Submodule R M)


theorem degreeOf_mul_C_le (p : MvPolynomial σ R) (i : σ) (c : R) :
    (p * C c).degreeOf i ≤ p.degreeOf i

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(p : MvPolynomial σ R)
(i : σ)
(c : R)

MvPolynomial.degreeOf i (p * MvPolynomial.C c) ≤ MvPolynomial.degreeOf i p


@[simp]
theorem coe_bot : ↑(⊥ : ConvexCone 𝕜 E) = (∅ : Set E)

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]


theorem mem_restrictDegree_iff_sup [DecidableEq σ] (p : MvPolynomial σ R) (n : ℕ) :
    p ∈ restrictDegree σ R n ↔ ∀ i, p.degrees.count i ≤ n

(σ : Type u)
{R : Type v}
[CommSemiring R]
[DecidableEq σ]
(p : MvPolynomial σ R)
(n : ℕ)

p ∈ MvPolynomial.restrictDegree σ R n ↔ ∀ (i : σ), Multiset.count i p.degrees ≤ n


theorem pow_of_dvd (h : IsPrimitiveRoot ζ k) {p : ℕ} (hp : p ≠ 0) (hdiv : p ∣ k) :
    IsPrimitiveRoot (ζ ^ p) (k / p)

{M : Type u_1}
[CommMonoid M]
{k : ℕ}
{ζ : M}
(h : IsPrimitiveRoot ζ k)
{p : ℕ}
(hp : p ≠ 0)
(hdiv : p ∣ k)


/-- Use `eLpNorm_smul_measure_of_ne_top` instead. -/
private theorem eLpNorm_smul_measure_of_ne_zero_of_ne_top {p : ℝ≥0∞} (hp_ne_zero : p ≠ 0)
    (hp_ne_top : p ≠ ∞) {f : α → F} (c : ℝ≥0∞) :
    eLpNorm f p (c • μ) = c ^ (1 / p).toReal • eLpNorm f p μ

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

MeasureTheory.eLpNorm f p (c • μ) = c ^ (1 / p).toReal • MeasureTheory.eLpNorm f p μ


{α : Type u_1}
[CommMonoidWithZero α]
{p : α}
(hp : Prime p)


@[simp]
lemma rightShift_add (a n' : ℤ) (hn' : n' + a = n) :
    (γ₁ + γ₂).rightShift a n' hn' = γ₁.rightShift a n' hn' + γ₂.rightShift a n' hn'

(γ₁ γ₂ : CochainComplex.HomComplex.Cochain K L n)


/-- The constant function 1 is invariant under any element of `SL(2, ℤ)`. -/
-- @[simp] -- Porting note: simpNF says LHS simplifies to something more complex
theorem is_invariant_one (A : SL(2, ℤ)) : (1 : ℍ → ℂ) ∣[(0 : ℤ)] A = (1 : ℍ → ℂ)


@[simp]
theorem prod_singleton {i} (x : M i) (hne_one : x ≠ 1) : (singleton x hne_one).prod = of x

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{i : ι}
(x : M i)
(hne_one : x ≠ 1)

(Monoid.CoprodI.NeWord.singleton x hne_one).prod = Monoid.CoprodI.of x


@[elab_as_elim]
theorem induction_on {C : Hausdorffification I M → Prop} (x : Hausdorffification I M)
    (ih : ∀ x, C (of I M x)) : C x

(ih : ∀ (x : M), C ((Hausdorffification.of I M) x))


theorem mul_right_eq_self₀ : a * b = a ↔ b = 1 ∨ a = 0

{M₀ : Type u_2}
[CancelMonoidWithZero M₀]
{a b : M₀}


lemma enumerateCountable_mem {s : Set α} (h : s.Countable) {default : α} (h_mem : default ∈ s)
    (n : ℕ) :
    enumerateCountable h default n ∈ s

{α : Type u}
{s : Set α}
(h : s.Countable)
{default : α}
(h_mem : default ∈ s)
(n : ℕ)


@[simp]
theorem sup_eq_union : (Sup.sup : Finset α → Finset α → Finset α) = Union.union


/-- An open cover of `X` consists of a family of open immersions into `X`,
and for each `x : X` an open immersion (indexed by `f x`) that covers `x`.

This is merely a coverage in the Zariski pretopology, and it would be optimal
if we could reuse the existing API about pretopologies, However, the definitions of sieves and
grothendieck topologies uses `Prop`s, so that the actual open sets and immersions are hard to
obtain. Also, since such a coverage in the pretopology usually contains a proper class of
immersions, it is quite hard to glue them, reason about finite covers, etc.
-/
structure OpenCover (X : Scheme.{u}) where
  /-- index set of an open cover of a scheme `X` -/
  J : Type v
  /-- the subschemes of an open cover -/
  obj : J → Scheme
  /-- the embedding of subschemes to `X` -/
  map : ∀ j : J, obj j ⟶ X
  /-- given a point of `x : X`, `f x` is the index of the subscheme which contains `x`  -/
  f : X → J
  /-- the subschemes covers `X` -/
  covers : ∀ x, x ∈ Set.range (map (f x)).1.base
  /-- the embedding of subschemes are open immersions -/
  IsOpen : ∀ x, IsOpenImmersion (map x) := by infer_instance

{X : AlgebraicGeometry.Scheme}
(self : X.OpenCover)
(x : ↑↑X.toPresheafedSpace)

x ∈ Set.range ⇑(self.map (self.f x)).val.base


@[simp] theorem injective_restrict_iff_disjoint {p : Submodule R M} {f : M →ₗ[R] M}
    (hf : ∀ x ∈ p, f x ∈ p) :
    Injective (f.restrict hf) ↔ Disjoint p (ker f)

{R : Type u_1}
{M : Type u_6}
[Ring R]
[AddCommGroup M]
[Module R M]
{p : Submodule R M}
{f : M →ₗ[R] M}
(hf : ∀ x ∈ p, f x ∈ p)

Function.Injective ⇑(f.restrict hf) ↔ Disjoint p (LinearMap.ker f)


@[simp]
theorem coeFn_mk {f : α →ₘ[μ] E} (hf : eLpNorm f p μ < ∞) : ((⟨f, hf⟩ : Lp E p μ) : α → E) = f

(hf : MeasureTheory.eLpNorm (↑f) p μ < ⊤)


theorem toCircle_add (x : AddCircle T) (y : AddCircle T) :
    @toCircle T (x + y) = toCircle x * toCircle y

(x + y).toCircle = x.toCircle * y.toCircle


/-- If the first and final modules in an exact sequence are Noetherian,
  then the middle module is also Noetherian. -/
theorem isNoetherian_of_range_eq_ker [IsNoetherian R P]
    (f : M →ₗ[R] N) (g : N →ₗ[R] P) (h : LinearMap.range f = LinearMap.ker g) :
    IsNoetherian R N


theorem iterate_pos_lt_iff {x : ℝ} {m : ℤ} {n : ℕ} (hn : 0 < n) :
    f^[n] x < x + n * m ↔ f x < x + m

(f : CircleDeg1Lift)
{x : ℝ}
{m : ℤ}
{n : ℕ}
(hn : 0 < n)


/-- Let `P` be the minimal polynomial of a root of unity `μ` and `Q` be the minimal polynomial of
`μ ^ p`, where `p` is a prime that does not divide `n`. Then `P` divides `Q` modulo `p`. -/
theorem minpoly_dvd_mod_p {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) :
    map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣
      map (Int.castRingHom (ZMod p)) (minpoly ℤ (μ ^ p))

{n : ℕ}
{K : Type u_1}
[CommRing K]
{μ : K}
(h : IsPrimitiveRoot μ n)
[IsDomain K]
[CharZero K]
{p : ℕ}
[Fact (Nat.Prime p)]
(hdiv : ¬p ∣ n)

Polynomial.map (Int.castRingHom (ZMod p)) (minpoly ℤ μ) ∣ Polynomial.map (Int.castRingHom (ZMod p)) (minpoly ℤ (μ ^ p))


/-- The `0` element is not `M`-regular, on a non-trivial module. -/
theorem not_zero [nM : Nontrivial M] : ¬IsSMulRegular M (0 : R)

{R : Type u_1}
{M : Type u_3}
[MonoidWithZero R]
[Zero M]
[MulActionWithZero R M]
[nM : Nontrivial M]


theorem restrict_apply_measure (μ : FiniteMeasure Ω) (A : Set Ω) {s : Set Ω}
    (s_mble : MeasurableSet s) : (μ.restrict A : Measure Ω) s = (μ : Measure Ω) (s ∩ A)

{Ω : Type u_1}
[MeasurableSpace Ω]
(μ : MeasureTheory.FiniteMeasure Ω)
(A : Set Ω)
{s : Set Ω}
(s_mble : MeasurableSet s)


@[simp]
theorem mem_range {α : Type u} {f : α → ZFSet.{max u v}} {x : ZFSet.{max u v}} :
    x ∈ range.{u, v} f ↔ x ∈ Set.range f

{α : Type u}
{f : α → ZFSet}
{x : ZFSet}