theorem ediv_add_emod (a b : Int) : b * (a / b) + a % b = a


@[simp]
theorem laverage_zero : ⨍⁻ _x, (0 : ℝ≥0∞) ∂μ = 0

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)


theorem isBounded_image_fst_and_snd {s : Set (α × β)} :
    IsBounded (Prod.fst '' s) ∧ IsBounded (Prod.snd '' s) ↔ IsBounded s

{α : Type u_1}
{β : Type u_2}
[Bornology α]
[Bornology β]
{s : Set (α × β)}

Bornology.IsBounded (Prod.fst '' s) ∧ Bornology.IsBounded (Prod.snd '' s) ↔ Bornology.IsBounded s


/-- A homomorphism from a uniform group to a discrete uniform group is continuous if and only if
its kernel is open. -/
@[to_additive "A homomorphism from a uniform additive group to a discrete uniform additive group is
continuous if and only if its kernel is open."]
theorem UniformGroup.uniformContinuous_iff_open_ker {hom : Type*} [UniformSpace β]
    [DiscreteTopology β] [Group β] [UniformGroup β] [FunLike hom α β] [MonoidHomClass hom α β]
    {f : hom} :
    UniformContinuous f ↔ IsOpen ((f : α →* β).ker : Set α)

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[Group α]
[UniformGroup α]
{hom : Type u_3}
[UniformSpace β]
[DiscreteTopology β]
[Group β]
[UniformGroup β]
[FunLike hom α β]
[MonoidHomClass hom α β]
{f : hom}


@[simp] theorem not_xor (P Q : Prop) : ¬Xor' P Q ↔ (P ↔ Q)


@[simp]
theorem mul_eq_bot {R : Type*} [CommSemiring R] [NoZeroDivisors R] {I J : Ideal R} :
    I * J = ⊥ ↔ I = ⊥ ∨ J = ⊥

{R : Type u_2}
[CommSemiring R]
[NoZeroDivisors R]
{I J : Ideal R}


lemma domDomRestrict_aux [DecidableEq ι] (P : ι → Prop) [DecidablePred P]
    [DecidableEq {a // P a}]
    (x : (i : {a // P a}) → M₁ i) (z : (i : {a // ¬ P a}) → M₁ i) (i : {a : ι // P a})
    (c : M₁ i) : (fun j ↦ if h : P j then Function.update x i c ⟨j, h⟩ else z ⟨j, h⟩) =
    Function.update (fun j => if h : P j then x ⟨j, h⟩ else z ⟨j, h⟩) i c

{ι : Type uι}
{M₁ : ι → Type v₁}
[DecidableEq ι]
(P : ι → Prop)
[DecidablePred P]
[DecidableEq { a // P a }]
(x : (i : { a // P a }) → M₁ ↑i)
(z : (i : { a // ¬P a }) → M₁ ↑i)
(i : { a // P a })
(c : M₁ ↑i)

(fun j => if h : P j then Function.update x i c ⟨j, h⟩ else z ⟨j, h⟩) =
  Function.update (fun j => if h : P j then x ⟨j, h⟩ else z ⟨j, h⟩) (↑i) c


/-- An ingredient of the proof of the Special Adjoint Functor Theorem: a cocomplete well-copowered
    category with a small separating set has a terminal object.

    In fact, it follows from the Special Adjoint Functor Theorem that `C` is already complete, see
    `hasLimits_of_hasColimits_of_isSeparating`. -/
theorem hasTerminal_of_isSeparating [WellPowered Cᵒᵖ] [HasColimits C] {𝒢 : Set C} [Small.{v₁} 𝒢]
    (h𝒢 : IsSeparating 𝒢) : HasTerminal C

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.WellPowered Cᵒᵖ]
[CategoryTheory.Limits.HasColimits C]
{𝒢 : Set C}
[Small.{v₁, u₁} ↑𝒢]
(h𝒢 : CategoryTheory.IsSeparating 𝒢)


/-- The (identity) equivalence between `Cᴹᵒᵖ` and `C`. -/
@[simps!] def MonoidalOpposite.unmopEquiv : Cᴹᵒᵖ ≌ C

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

(CategoryTheory.MonoidalOpposite.unmopEquiv C).counitIso.hom.app X = 𝟙 X


@[to_additive (attr := simp)]
lemma val_smul [Group G] [Monoid M] [MulAction G M] [SMulCommClass G M M] [IsScalarTower G M M]
    (g : G) (m : Mˣ) : ↑(g • m) = g • (m : M)

{G : Type u_1}
{M : Type u_3}
[Group G]
[Monoid M]
[MulAction G M]
[SMulCommClass G M M]
[IsScalarTower G M M]
(g : G)
(m : Mˣ)


theorem coe_def : (f : LaurentSeries F) = coeAlgHom F f


@[to_additive]
lemma op_smul_op_smul (b : β) (a₁ a₂ : α) : b <• a₁ <• a₂ = b <• (a₁ * a₂)

{α : Type u_5}
{β : Type u_6}
[AddMonoid α]
[AddAction αᵃᵒᵖ β]
(b : β)
(a₁ a₂ : α)

AddOpposite.op a₂ +ᵥ (AddOpposite.op a₁ +ᵥ b) = AddOpposite.op (a₁ + a₂) +ᵥ b


@[to_additive]
theorem Finset.univ_prod_mulSingle [Fintype I] (f : ∀ i, Z i) :
    (∏ i, Pi.mulSingle i (f i)) = f

{I : Type u_1}
[DecidableEq I]
{Z : I → Type u_2}
[(i : I) → CommMonoid (Z i)]
[Fintype I]
(f : (i : I) → Z i)


theorem cons_of_coe_eq (a : α) (v : Vector α n) : a ::ₛ (↑v : Sym α n) = ↑(a ::ᵥ v)

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

a ::ₛ Sym.ofVector v = Sym.ofVector (a ::ᵥ v)


/-- The disjoint union of antidiagonal tuples `Σ n, antidiagonalTuple k n` is equivalent to the
`k`-tuple `Fin k → ℕ`. This is such an equivalence, obtained by mapping `(n, x)` to `x`.

This is the tuple version of `Finset.sigmaAntidiagonalEquivProd`. -/
@[simps]
def sigmaAntidiagonalTupleEquivTuple (k : ℕ) : (Σ n, antidiagonalTuple k n) ≃ (Fin k → ℕ)

∀ (a : Fin k), ↑((Finset.Nat.sigmaAntidiagonalTupleEquivTuple k).symm x).snd a = x a


/-- Construct a simplicial complex as a subset of a given simplicial complex. -/
@[simps]
def ofSubcomplex (K : SimplicialComplex 𝕜 E) (faces : Set (Finset E)) (subset : faces ⊆ K.faces)
    (down_closed : ∀ {s t}, s ∈ faces → t ⊆ s → t ∈ faces) : SimplicialComplex 𝕜 E

(down_closed : ∀ {s t : Finset E}, s ∈ faces → t ⊆ s → t ∈ faces)

(K.ofSubcomplex faces subset down_closed).faces = faces


theorem HasMFDerivWithinAt.comp (hg : HasMFDerivWithinAt I' I'' g u (f x) g')
    (hf : HasMFDerivWithinAt I I' f s x f') (hst : s ⊆ f ⁻¹' u) :
    HasMFDerivWithinAt I I'' (g ∘ f) s x (g'.comp f')

[I''s : SmoothManifoldWithCorners I'' M'']

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

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


/-- A group is called *cyclic* if it is generated by a single element. -/
@[to_additive]
class IsCyclic (α : Type u) [Group α] : Prop where
  exists_generator : ∃ g : α, ∀ x, x ∈ zpowers g

{α : Type u}
[Group α]
[self : IsCyclic α]


theorem DFinsupp.sum_inner {ι : Type*} [DecidableEq ι] {α : ι → Type*}
    [∀ i, AddZeroClass (α i)] [∀ (i) (x : α i), Decidable (x ≠ 0)] (f : ∀ i, α i → E)
    (l : Π₀ i, α i) (x : E) : ⟪l.sum f, x⟫ = l.sum fun i a => ⟪f i a, x⟫

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

⟪l.sum f, x⟫_𝕜 = l.sum fun i a => ⟪f i a, x⟫_𝕜


@[simp]
theorem range_zero : range 0 = ∅


theorem lintegral_mono_set {_ : MeasurableSpace α} ⦃μ : Measure α⦄ {s t : Set α} {f : α → ℝ≥0∞}
    (hst : s ⊆ t) : ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in t, f x ∂μ

∀ {x : MeasurableSpace α} ⦃μ : MeasureTheory.Measure α⦄ {s t : Set α} {f : α → ℝ≥0∞},
  s ⊆ t → ∫⁻ (x : α) in s, f x ∂μ ≤ ∫⁻ (x : α) in t, f x ∂μ


theorem nthLe_reverse' (l : List α) (n : ℕ) (hn : n < l.reverse.length) (hn') :
    l.reverse.nthLe n hn = l.nthLe (l.length - 1 - n) hn'

{α : Type u}
(l : List α)
(n : ℕ)
(hn : n < l.reverse.length)
(hn' : l.length - 1 - n < l.length)


/-- The category of `MonoOver α`, for `α : Type u`, is equivalent to the partial order `Set α`.
-/
@[simps]
noncomputable def Types.monoOverEquivalenceSet (α : Type u) : MonoOver α ≌ Set α

(α : Type u)
{f g : CategoryTheory.MonoOver α}
(t : f ⟶ g)

(Types.monoOverEquivalenceSet α).functor.map t = CategoryTheory.homOfLE ⋯


theorem coe_injective : Injective (DFunLike.coe : (M →ₛₗ[σ] M₃) → _)

{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₃ : Type u_12}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₃]
[Module R M]
[Module S M₃]
{σ : R →+* S}


theorem compare_le_iff_le {a b : α} : (compare a b ≠ .gt) ↔ a ≤ b


/-- Note this is a special case of `(Finset.image_preimage f univ _).symm`. -/
theorem univ_filter_mem_range (f : α → β) [Fintype β] [DecidablePred fun y => y ∈ Set.range f]
    [DecidableEq β] : (Finset.univ.filter fun y => y ∈ Set.range f) = Finset.univ.image f

Finset.filter (fun y => y ∈ Set.range f) Finset.univ = Finset.image f Finset.univ


@[simp] lemma sdiff_eq_right : x \ y = y ↔ x = ⊥ ∧ y = ⊥

{α : Type u}
{x y : α}
[GeneralizedBooleanAlgebra α]


theorem natCast_succ (n : ℕ) : ↑n.succ = succ (n : Ordinal)


theorem proj_symm_apply' {b : B} {x : F} (hx : b ∈ e.baseSet) :
    proj (e.toPartialHomeomorph.symm (b, x)) = b

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e : Trivialization F proj)
{b : B}
{x : F}
(hx : b ∈ e.baseSet)


@[to_additive]
theorem toEquiv_apply {f : G ⧸ H → G} (hf : ∀ q, (f q : G ⧸ H) = q) (q : G ⧸ H) :
    (toEquiv (range_mem_leftTransversals hf) q : G) = f q

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
{f : G ⧸ H → G}
(hf : ∀ (q : G ⧸ H), ↑(f q) = q)
(q : G ⧸ H)

↑((AddSubgroup.MemLeftTransversals.toEquiv ⋯) q) = f q


theorem inter_right_comm (s₁ s₂ s₃ : Set α) : s₁ ∩ s₂ ∩ s₃ = s₁ ∩ s₃ ∩ s₂

s₁ ∩ s₂ ∩ s₃ = s₁ ∩ s₃ ∩ s₂


protected lemma lt_sub_iff_add_lt' : a < c - b ↔ b + a < c


@[simp]
lemma map_g' : (h.map F).g' = F.map h.g'


theorem preservesZeroMorphisms_of_map_zero_object (i : F.obj 0 ≅ 0) : PreservesZeroMorphisms F


theorem card_roots_sub_C {p : R[X]} {a : R} (hp0 : 0 < degree p) :
    (Multiset.card (p - C a).roots : WithBot ℕ) ≤ degree p

{R : Type u}
[CommRing R]
[IsDomain R]
{p : Polynomial R}
{a : R}
(hp0 : 0 < p.degree)

↑(Multiset.card (p - Polynomial.C a).roots) ≤ p.degree


@[to_additive]
theorem ContMDiffAt.prod (h : ∀ i ∈ t, ContMDiffAt I' I n (f i) x₀) :
    ContMDiffAt I' I n (fun x ↦ ∏ i ∈ t, f i x) x₀

ContMDiffAt I' I n (fun x => ∏ i ∈ t, f i x) x₀


@[simp] theorem one_toReal : (1 : ℝ≥0∞).toReal = 1


lemma mk'_num_den (q : ℚ) : mk' q.num q.den q.den_nz q.reduced = q

{ num := q.num, den := q.den, den_nz := ⋯, reduced := ⋯ } = q


/-- **Integration by parts for Fréchet derivatives**
Version with a general bilinear form `B`.
If `B f g` is integrable, as well as `B f' g` and `B f g'` where `f'` and `g'` are the derivatives
of `f` and `g` in a given direction `v`, then `∫ B f g' = - ∫ B f' g`. -/
theorem integral_bilinear_fderiv_right_eq_neg_left_of_integrable
    {f : E → F} {g : E → G} {v : E} {B : F →L[ℝ] G →L[ℝ] W}
    (hf'g : Integrable (fun x ↦ B (fderiv ℝ f x v) (g x)) μ)
    (hfg' : Integrable (fun x ↦ B (f x) (fderiv ℝ g x v)) μ)
    (hfg : Integrable (fun x ↦ B (f x) (g x)) μ)
    (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) :
    ∫ x, B (f x) (fderiv ℝ g x v) ∂μ = - ∫ x, B (fderiv ℝ f x v) (g x) ∂μ

(hf'g : MeasureTheory.Integrable (fun x => (B ((fderiv ℝ f x) v)) (g x)) μ)

(hfg' : MeasureTheory.Integrable (fun x => (B (f x)) ((fderiv ℝ g x) v)) μ)

(hfg : MeasureTheory.Integrable (fun x => (B (f x)) (g x)) μ)

∫ (x : E), (B (f x)) ((fderiv ℝ g x) v) ∂μ = -∫ (x : E), (B ((fderiv ℝ f x) v)) (g x) ∂μ


theorem det_mul_aux {M N : Matrix n n R} {p : n → n} (H : ¬Bijective p) :
    (∑ σ : Perm n, ε σ * ∏ x, M (σ x) (p x) * N (p x) x) = 0

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{M N : Matrix n n R}
{p : n → n}
(H : ¬Function.Bijective p)

∑ σ : Equiv.Perm n, ↑↑(Equiv.Perm.sign σ) * ∏ x : n, M (σ x) (p x) * N (p x) x = 0


@[to_additive exists_lt_of_sum_lt]
lemma exists_lt_of_prod_lt' [LinearOrder M] [CovariantClass M M (Function.swap (· * ·)) (· ≤ ·)]
    [CovariantClass M M (· * ·) (· ≤ ·)] {l : List ι} (f g : ι → M)
    (h : (l.map f).prod < (l.map g).prod) : ∃ i ∈ l, f i < g i

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

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

(h : (List.map f l).sum < (List.map g l).sum)


/-- Morphisms between two direct sums over a hom orthogonal family `s : ι → C`
are equivalent to block diagonal matrices,
with blocks indexed by `ι`,
and matrix entries in `i`-th block living in the endomorphisms of `s i`. -/
@[simps]
noncomputable def matrixDecomposition (o : HomOrthogonal s) {α β : Type} [Finite α] [Finite β]
    {f : α → ι} {g : β → ι} :
    ((⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)) ≃
      ∀ i : ι, Matrix (g ⁻¹' {i}) (f ⁻¹' {i}) (End (s i))

(z : (i : ι) → Matrix (↑(g ⁻¹' {i})) (↑(f ⁻¹' {i})) (CategoryTheory.End (s i)))

o.matrixDecomposition.symm z =
  CategoryTheory.Limits.biproduct.matrix fun j k =>
    if h : f j = g k then CategoryTheory.CategoryStruct.comp (z (f j) ⟨k, ⋯⟩ ⟨j, ⋯⟩) (CategoryTheory.eqToHom ⋯) else 0


lemma IsHomological.mk' [F.PreservesZeroMorphisms]
    (hF : ∀ (T : Pretriangulated.Triangle C) (hT : T ∈ distTriang C),
      ∃ (T' : Pretriangulated.Triangle C) (e : T ≅ T'),
      ((shortComplexOfDistTriangle T' (isomorphic_distinguished _ hT _ e.symm)).map F).Exact) :
    F.IsHomological

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

(hF :
  ∀ (T : CategoryTheory.Pretriangulated.Triangle C) (hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles),
    ∃ T' e, ((CategoryTheory.Pretriangulated.shortComplexOfDistTriangle T' ⋯).map F).Exact)


/-- The list `List.insertionSort r l` is `List.Sorted` with respect to `r`. -/
theorem sorted_insertionSort : ∀ l, Sorted r (insertionSort r l)

{α : Type u}
(r : α → α → Prop)
[DecidableRel r]
[IsTotal α r]
[IsTrans α r]
(l : List α)


@[simp]
protected theorem toFinset_nonempty : hs.toFinset.Nonempty ↔ s.Nonempty

{α : Type u}
{s : Set α}
(hs : s.Finite)


/-- A version of `liftPropWithinAt_indep_chart`, only for the target. -/
theorem liftPropWithinAt_indep_chart_target [HasGroupoid M' G'] (hf : f ∈ G'.maximalAtlas M')
    (xf : g x ∈ f.source) :
    LiftPropWithinAt P g s x ↔ ContinuousWithinAt g s x ∧ LiftPropWithinAt P (f ∘ g) s x

(hf : f ∈ StructureGroupoid.maximalAtlas M' G')

ChartedSpace.LiftPropWithinAt P g s x ↔ ContinuousWithinAt g s x ∧ ChartedSpace.LiftPropWithinAt P (↑f ∘ g) s x


@[simp]
theorem integral_indicator_one ⦃s : Set X⦄ (hs : MeasurableSet s) :
    ∫ x, s.indicator 1 x ∂μ = (μ s).toReal

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
⦃s : Set X⦄
(hs : MeasurableSet s)

∫ (x : X), s.indicator 1 x ∂μ = (μ s).toReal


theorem arg_cos_add_sin_mul_I_coe_angle (θ : Real.Angle) :
    (arg (Real.Angle.cos θ + Real.Angle.sin θ * I) : Real.Angle) = θ


@[simp]
theorem idealOfEmpty_eq_bot : idealOfSet R (∅ : Set X) = ⊥

{X : Type u_1}
{R : Type u_2}
[TopologicalSpace X]
[Semiring R]
[TopologicalSpace R]
[TopologicalSemiring R]


/-- Constant as a continuous bounded function. -/
@[simps! (config := .asFn)] -- Porting note: Changed `simps` to `simps!`
def const (b : β) : α →ᵇ β

(α : Type u)
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
(b : β)

⇑(BoundedContinuousFunction.const α b) = fun x => b


/-- This lemma matches more generally than `Finset.Nat.prod_antidiagonal_eq_prod_range_succ_mk` when
using `rw ← `. -/
@[to_additive "This lemma matches more generally than
`Finset.Nat.sum_antidiagonal_eq_sum_range_succ_mk` when using `rw ← `."]
theorem prod_antidiagonal_eq_prod_range_succ {M : Type*} [CommMonoid M] (f : ℕ → ℕ → M) (n : ℕ) :
    ∏ ij ∈ antidiagonal n, f ij.1 ij.2 = ∏ k ∈ range n.succ, f k (n - k)

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

∑ ij ∈ Finset.antidiagonal n, f ij.1 ij.2 = ∑ k ∈ Finset.range n.succ, f k (n - k)


@[aesop apply safe (rule_sets := [CategoryTheory])]
theorem inv_ext' {f : X ≅ Y} {g : Y ⟶ X} (hom_inv_id : f.hom ≫ g = 𝟙 X) : g = f.inv

(hom_inv_id : CategoryTheory.CategoryStruct.comp f.hom g = CategoryTheory.CategoryStruct.id X)


@[simp]
lemma iSup_weightSpaceOf_eq_top [IsTriangularizable R L M] (x : L) :
    ⨆ (φ : R), weightSpaceOf M φ x = ⊤

(R : Type u_2)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieModule.IsTriangularizable R L M]
(x : L)


/-- If `i` is an `F`-algebra homomorphism from `E` to `K`, then the preimage of
`separableClosure F K` under the map `i` is equal to `separableClosure F E`. -/
theorem separableClosure.comap_eq_of_algHom (i : E →ₐ[F] K) :
    (separableClosure F K).comap i = separableClosure F E

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
{K : Type w}
[Field K]
[Algebra F K]
(i : E →ₐ[F] K)

IntermediateField.comap i (separableClosure F K) = separableClosure F E


@[simp]
theorem coe_sumAddMonoidHom : (sumAddMonoidHom : Multiset α → α) = sum


theorem eq_top_iff {s : Setoid α} : s = (⊤ : Setoid α) ↔ ∀ x y : α, s.Rel x y


/-- A typeclass indicating that the right (aka `AddOpposite`) and left actions by `M` on `α` are
equal, that is that `M` acts centrally on `α`. This can be thought of as a version of commutativity
for `+ᵥ`. -/
class IsCentralVAdd (M α : Type*) [VAdd M α] [VAdd Mᵃᵒᵖ α] : Prop where
  /-- The right and left actions of `M` on `α` are equal. -/
  op_vadd_eq_vadd : ∀ (m : M) (a : α), AddOpposite.op m +ᵥ a = m +ᵥ a

{M : Type u_11}
{α : Type u_12}
[VAdd M α]
[VAdd Mᵃᵒᵖ α]
[self : IsCentralVAdd M α]
(m : M)
(a : α)


lemma predAbove_castPred_of_le (p i : Fin (n + 1)) (h : i ≤ p) (hp : p ≠ last n)
    (hi := Fin.ne_of_lt $ Fin.lt_of_le_of_lt h $ Fin.lt_last_iff_ne_last.2 hp) :
    (castPred p hp).predAbove i = castPred i hi

{n : ℕ}
(p i : Fin (n + 1))
(h : i ≤ p)
(hp : p ≠ Fin.last n)
(hi : i ≠ Fin.last n := ⋯)

(p.castPred hp).predAbove i = i.castPred hi


@[simp]
theorem formPerm_nil : formPerm ([] : List α) = 1


/-- When `S.f = 0`, this is the canonical isomorphism `S.cycles ≅ S.leftHomology` induced
by `S.leftHomologyπ`. -/
@[simps! hom]
noncomputable def cyclesIsoLeftHomology (hf : S.f = 0) : S.cycles ≅ S.leftHomology

(S.cyclesIsoLeftHomology hf).hom = S.leftHomologyπ


nonrec theorem ContinuousAt.arsinh (h : ContinuousAt f a) :
    ContinuousAt (fun x => arsinh (f x)) a

{X : Type u_1}
[TopologicalSpace X]
{f : X → ℝ}
{a : X}
(h : ContinuousAt f a)

ContinuousAt (fun x => Real.arsinh (f x)) a


theorem mono_of_source_iso_zero {X Y : C} (f : X ⟶ Y) (i : X ≅ 0) : Mono f


@[simp]
theorem eval_map (f : R →+* S₁) (g : σ → S₁) (p : MvPolynomial σ R) :
    eval g (map f p) = eval₂ f g p

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
(f : R →+* S₁)
(g : σ → S₁)
(p : MvPolynomial σ R)

(MvPolynomial.eval g) ((MvPolynomial.map f) p) = MvPolynomial.eval₂ f g p


@[simp] theorem LinearMap.comp_id_moduleCat
    {R} [Ring R] {G : ModuleCat.{u} R} {H : Type u} [AddCommGroup H] [Module R H] (f : G →ₗ[R] H) :
    f.comp (𝟙 G) = f

{R : Type u_1}
[Ring R]
{G : ModuleCat R}
{H : Type u}
[AddCommGroup H]
[Module R H]
(f : ↑G →ₗ[R] H)


theorem _root_.ULift.algebraMap_eq (r : R) :
    algebraMap R (ULift A) r = ULift.up (algebraMap R A r)

{R : Type u}
{A : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(r : R)

(algebraMap R (ULift.{u_2, w} A)) r = { down := (algebraMap R A) r }


theorem add_right [T2Space M] [ContinuousAdd N] (h₁ : v ⟂ᵥ w₁) (h₂ : v ⟂ᵥ w₂) : v ⟂ᵥ w₁ + w₂

{w₁ w₂ : MeasureTheory.VectorMeasure α N}

v ⟂ᵥ w₁ + w₂


theorem inter_left_comm (s₁ s₂ s₃ : Finset α) : s₁ ∩ (s₂ ∩ s₃) = s₂ ∩ (s₁ ∩ s₃)

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


theorem rev_castPred {i : Fin (n + 1)}
    (h : i ≠ last n) (h' := rev_ne_iff.mpr ((rev_zero _).symm ▸ h)) :
    rev (castPred i h) = pred (rev i) h'

{n : ℕ}
{i : Fin (n + 1)}
(h : i ≠ Fin.last n)
(h' : i.rev ≠ 0 := ⋯)


/-- Extension of a natural transformation `φ` between functors
`C ⥤ karoubi D` to a natural transformation between the
extension of these functors to `karoubi C ⥤ karoubi D` -/
@[simps]
def map {F G : C ⥤ Karoubi D} (φ : F ⟶ G) : obj F ⟶ obj G

{F G : CategoryTheory.Functor C (CategoryTheory.Idempotents.Karoubi D)}

(P : CategoryTheory.Idempotents.Karoubi C)

((CategoryTheory.Idempotents.FunctorExtension₁.map φ).app P).f =
  CategoryTheory.CategoryStruct.comp (F.map P.p).f (φ.app P.X).f


theorem over_coe_def {P Q : C} (a : Q ⟶ P) : (a : Pseudoelement P) = ⟦↑a⟧

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q : C}
(a : Q ⟶ P)

Quot.mk (CategoryTheory.Abelian.PseudoEqual P) (CategoryTheory.Over.mk a) = ⟦CategoryTheory.Over.mk a⟧


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


theorem map_le_sub {x y : R} {g : Γ₀} (hx : g ≤ v x) (hy : g ≤ v y) : g ≤ v (x - y)

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


@[simp] lemma directLimitRight_symm_of_tmul {i : ι} (m : M) (g : G i) :
    (directLimitRight f M).symm (of _ _ _ _ _ (m ⊗ₜ g)) = m ⊗ₜ of _ _ _ f _ g

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
[DecidableEq ι]
[Preorder ι]
{G : ι → Type u_3}
[(i : ι) → AddCommGroup (G i)]
[(i : ι) → Module R (G i)]
(f : (i j : ι) → i ≤ j → G i →ₗ[R] G j)
(M : Type u_4)
[AddCommGroup M]
[Module R M]
[IsDirected ι fun x x_1 => x ≤ x_1]
{i : ι}
(m : M)
(g : G i)

(TensorProduct.directLimitRight f M).symm
    ((Module.DirectLimit.of R ι (fun x => M ⊗[R] G x) (fun i j h => LinearMap.lTensor M (f i j h)) i) (m ⊗ₜ[R] g)) =
  m ⊗ₜ[R] (Module.DirectLimit.of R ι G f i) g


private theorem add_left_aux8 (y z : E) :
    ‖(I : 𝕜) • y - 2 • z‖ * ‖(I : 𝕜) • y - 2 • z‖ =
    2 * (‖(I : 𝕜) • y - z‖ * ‖(I : 𝕜) • y - z‖ + ‖z‖ * ‖z‖) - ‖(I : 𝕜) • y‖ * ‖(I : 𝕜) • y‖

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

‖RCLike.I • y - 2 • z‖ * ‖RCLike.I • y - 2 • z‖ =
  2 * (‖RCLike.I • y - z‖ * ‖RCLike.I • y - z‖ + ‖z‖ * ‖z‖) - ‖RCLike.I • y‖ * ‖RCLike.I • y‖


@[to_additive]
theorem map_comap_le (H : Subgroup N) : map f (comap f H) ≤ H

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

AddSubgroup.map f (AddSubgroup.comap f H) ≤ H


theorem convex_singleton (c : E) : Convex 𝕜 ({c} : Set E)

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


theorem restrict_le_restrict_of_subset_le {i : Set α}
    (h : ∀ ⦃j⦄, MeasurableSet j → j ⊆ i → v j ≤ w j) : v ≤[i] w

(h : ∀ ⦃j : Set α⦄, MeasurableSet j → j ⊆ i → ↑v j ≤ ↑w j)


theorem quotDualCoannihilatorToDual_injective (W : Submodule R (Dual R M)) :
    Function.Injective W.quotDualCoannihilatorToDual

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


theorem nearestPtInd_succ (e : ℕ → α) (N : ℕ) (x : α) :
    nearestPtInd e (N + 1) x =
      if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else nearestPtInd e N x

{α : Type u_1}
[MeasurableSpace α]
[PseudoEMetricSpace α]
[OpensMeasurableSpace α]
(e : ℕ → α)
(N : ℕ)
(x : α)

↑(MeasureTheory.SimpleFunc.nearestPtInd e (N + 1)) x =
  if ∀ k ≤ N, edist (e (N + 1)) x < edist (e k) x then N + 1 else ↑(MeasureTheory.SimpleFunc.nearestPtInd e N) x


theorem sublists_perm_sublists' (l : List α) : sublists l ~ sublists' l


theorem pow_dvd_nthHom_sub (r : R) (i j : ℕ) (h : i ≤ j) :
    (p : ℤ) ^ i ∣ nthHom f r j - nthHom f r i

(f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), (ZMod.castHom ⋯ (ZMod (p ^ k1))).comp (f k2) = f k1)

↑p ^ i ∣ PadicInt.nthHom f r j - PadicInt.nthHom f r i


theorem ne_bot_of_dvd_card [Finite G] {p : ℕ} [hp : Fact p.Prime] (P : Sylow p G)
    (hdvd : p ∣ Nat.card G) : (P : Subgroup G) ≠ ⊥

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


/-- On a compact space, locally uniform convergence is just uniform convergence. -/
theorem tendstoLocallyUniformly_iff_tendstoUniformly_of_compactSpace [CompactSpace α] :
    TendstoLocallyUniformly F f p ↔ TendstoUniformly F f p

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
[TopologicalSpace α]
[CompactSpace α]


@[simp, norm_cast] lemma coe_compl (s : CompactOpens α) : ↑sᶜ = (sᶜ : Set α)

{α : Type u_1}
[TopologicalSpace α]
[CompactSpace α]
[T2Space α]
(s : TopologicalSpace.CompactOpens α)


@[simp]
theorem coe_im (z : ℍ) : (z : ℂ).im = z.im


theorem mul_def (f g : Perm α) : f * g = g.trans f


/-- A configuration is nondegenerate if:
  1) there does not exist a line that passes through all of the points,
  2) there does not exist a point that is on all of the lines,
  3) there is at most one line through any two points,
  4) any two lines have at most one intersection point.
  Conditions 3 and 4 are equivalent. -/
class Nondegenerate : Prop where
  exists_point : ∀ l : L, ∃ p, p ∉ l
  exists_line : ∀ p, ∃ l : L, p ∉ l
  eq_or_eq : ∀ {p₁ p₂ : P} {l₁ l₂ : L}, p₁ ∈ l₁ → p₂ ∈ l₁ → p₁ ∈ l₂ → p₂ ∈ l₂ → p₁ = p₂ ∨ l₁ = l₂

[self : Configuration.Nondegenerate P L]


lemma CompleteOrthogonalIdempotents.map_injective_iff (hf : Function.Injective f) :
    CompleteOrthogonalIdempotents (f ∘ e) ↔ CompleteOrthogonalIdempotents e

{R : Type u_1}
{S : Type u_2}
[Ring R]
[Ring S]
(f : R →+* S)
{I : Type u_3}
{e : I → R}
[Fintype I]
(hf : Function.Injective ⇑f)

CompleteOrthogonalIdempotents (⇑f ∘ e) ↔ CompleteOrthogonalIdempotents e


@[simp]
lemma coe_transpose (A : SpecialLinearGroup n R) : ↑ₘAᵀ = (↑ₘA)ᵀ

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


@[to_additive]
theorem orbit_subgroup_eq_self_of_mem {a : α} (ha : a ∈ s) : MulAction.orbit s a = s

{α : Type u_1}
[AddGroup α]
(s : AddSubgroup α)
{a : α}
(ha : a ∈ s)


theorem blunt_iff_not_pointed (S : ConvexCone 𝕜 E) : S.Blunt ↔ ¬S.Pointed

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


@[to_additive (attr := simp)] lemma monovary_inv_right : Monovary f g⁻¹ ↔ Antivary f g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommGroup β]
{f : ι → α}
{g : ι → β}


theorem sup_powerset_len {α : Type*} [DecidableEq α] (x : Multiset α) :
    (Finset.sup (Finset.range (card x + 1)) fun k => x.powersetCard k) = x.powerset

{α : Type u_9}
[DecidableEq α]
(x : Multiset α)

((Finset.range (Multiset.card x + 1)).sup fun k => Multiset.powersetCard k x) = x.powerset


lemma XYIdeal_eq₂ {x₁ x₂ y₁ y₂ : F} (h₁ : W.Equation x₁ y₁)
    (h₂ : W.Equation x₂ y₂) (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
    XYIdeal W x₂ (C y₂) = XYIdeal W x₂ (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂)

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ y₁ y₂ : F}
(h₁ : W.Equation x₁ y₁)
(h₂ : W.Equation x₂ y₂)
(hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂)

WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₂ (Polynomial.C y₂) =
  WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₂
    (WeierstrassCurve.Affine.linePolynomial x₁ y₁ (W.slope x₁ x₂ y₁ y₂))


@[simp]
theorem liftAlternating_ι (f : ∀ i, M [⋀^Fin i]→ₗ[R] N) (m : M) :
    liftAlternating (R := R) (M := M) (N := N) f (ι R m) = f 1 ![m]

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(f : (i : ℕ) → M [⋀^Fin i]→ₗ[R] N)
(m : M)

(ExteriorAlgebra.liftAlternating f) ((ExteriorAlgebra.ι R) m) = (f 1) ![m]


lemma add_point (P Q : W.Point) : (P + Q).point = W.addMap P.point Q.point

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


@[to_additive]
theorem IsCompact.div_closedBall_one (hs : IsCompact s) (hδ : 0 ≤ δ) :
    s / closedBall 1 δ = cthickening δ s

{E : Type u_1}
[SeminormedCommGroup E]
{δ : ℝ}
{s : Set E}
(hs : IsCompact s)
(hδ : 0 ≤ δ)

s / Metric.closedBall 1 δ = Metric.cthickening δ s


/-- Showing one side of the equivalence between the definitions
`IsDedekindDomainInv` and `IsDedekindDomain` of Dedekind domains. -/
theorem isDedekindDomain : IsDedekindDomain A

{A : Type u_2}
[CommRing A]
[IsDomain A]
(h : IsDedekindDomainInv A)


theorem filter_cons_of_neg (a : α) (s : Finset α) (ha : a ∉ s) (hp : ¬p a) :
    filter p (cons a s ha) = filter p s

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(a : α)
(s : Finset α)
(ha : a ∉ s)
(hp : ¬p a)

Finset.filter p (Finset.cons a s ha) = Finset.filter p s


theorem quotientMap_comp_mk {J : Ideal R} {I : Ideal S} {f : R →+* S} (H : J ≤ I.comap f) :
    (quotientMap I f H).comp (Quotient.mk J) = (Quotient.mk I).comp f

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
{J : Ideal R}
{I : Ideal S}
{f : R →+* S}
(H : J ≤ Ideal.comap f I)

(Ideal.quotientMap I f H).comp (Ideal.Quotient.mk J) = (Ideal.Quotient.mk I).comp f


/-- If a set of points is affinely independent, so is any subset. -/
protected theorem AffineIndependent.mono {s t : Set P}
    (ha : AffineIndependent k (fun x => x : t → P)) (hs : s ⊆ t) :
    AffineIndependent k (fun x => x : s → P)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s t : Set P}
(ha : AffineIndependent k fun x => ↑x)
(hs : s ⊆ t)


theorem injective_iff_preservesEpimorphisms_yoneda_obj (J : C) :
    Injective J ↔ (yoneda.obj J).PreservesEpimorphisms

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

CategoryTheory.Injective J ↔ (CategoryTheory.yoneda.obj J).PreservesEpimorphisms


theorem prodMap_add (f₁ : M →ₗ[R] M₃) (f₂ : M →ₗ[R] M₃) (g₁ : M₂ →ₗ[R] M₄) (g₂ : M₂ →ₗ[R] M₄) :
    (f₁ + f₂).prodMap (g₁ + g₂) = f₁.prodMap g₁ + f₂.prodMap g₂

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
{M₄ : Type z}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommMonoid M₄]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module R M₄]
(f₁ f₂ : M →ₗ[R] M₃)
(g₁ g₂ : M₂ →ₗ[R] M₄)


/-- If `f` maps a subspace `p` into itself, then the generalized eigenspace of the restriction
    of `f` to `p` is the part of the generalized eigenspace of `f` that lies in `p`. -/
theorem genEigenspace_restrict (f : End R M) (p : Submodule R M) (k : ℕ) (μ : R)
    (hfp : ∀ x : M, x ∈ p → f x ∈ p) :
    genEigenspace (LinearMap.restrict f hfp) μ k =
      Submodule.comap p.subtype (f.genEigenspace μ k)

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
(f : Module.End R M)
(p : Submodule R M)
(k : ℕ)
(μ : R)
(hfp : ∀ x ∈ p, f x ∈ p)

(Module.End.genEigenspace (LinearMap.restrict f hfp) μ) k = Submodule.comap p.subtype ((f.genEigenspace μ) k)


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

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{n : ℕ∞}
{𝔸' : Type u_4}
{ι : Type u_5}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
{t : Finset ι}
{f : ι → E → 𝔸'}
(h : ∀ i ∈ t, ContDiffAt 𝕜 n (f i) x)


@[simp, norm_cast] lemma coe_one : ⇑(1 : α →+* α) = _root_.id


protected theorem compose [Preorder α] [Preorder β] [Preorder γ] {l1 : α → β} {u1 : β → α}
    {l2 : β → γ} {u2 : γ → β} (gc1 : GaloisConnection l1 u1) (gc2 : GaloisConnection l2 u2) :
    GaloisConnection (l2 ∘ l1) (u1 ∘ u2)

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder α]
[Preorder β]
[Preorder γ]
{l1 : α → β}
{u1 : β → α}
{l2 : β → γ}
{u2 : γ → β}
(gc1 : GaloisConnection l1 u1)
(gc2 : GaloisConnection l2 u2)


@[simp]
theorem restrict_univ (m : OuterMeasure α) : restrict univ m = m

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

(MeasureTheory.OuterMeasure.restrict Set.univ) m = m


/-- On pseudometric spaces, a map is an isometry if and only if it preserves distances. -/
theorem isometry_iff_dist_eq [PseudoMetricSpace α] [PseudoMetricSpace β] {f : α → β} :
    Isometry f ↔ ∀ x y, dist (f x) (f y) = dist x y

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

Isometry f ↔ ∀ (x y : α), dist (f x) (f y) = dist x y


theorem eventually_fintsupport_subset :
    ∀ᶠ y in 𝓝 x₀, ρ.fintsupport y ⊆ ρ.fintsupport x₀

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(ρ : PartitionOfUnity ι X s)
(x₀ : X)

∀ᶠ (y : X) in 𝓝 x₀, ρ.fintsupport y ⊆ ρ.fintsupport x₀


theorem le_of_le_of_eq {a b c : α} [LE α] (h₁ : a ≤ b) (h₂ : b = c) : a ≤ c

{α : Type u}
{a b c : α}
[LE α]
(h₁ : a ≤ b)
(h₂ : b = c)


@[simp]
theorem parallelPair_functor_obj {F : WalkingParallelPair ⥤ C} (j : WalkingParallelPair) :
    (parallelPair (F.map left) (F.map right)).obj j = F.obj j

{F : CategoryTheory.Functor CategoryTheory.Limits.WalkingParallelPair C}

(CategoryTheory.Limits.parallelPair (F.map CategoryTheory.Limits.WalkingParallelPairHom.left)
        (F.map CategoryTheory.Limits.WalkingParallelPairHom.right)).obj
    j =
  F.obj j


@[ext]
theorem ext (x y : ULift α) (h : x.down = y.down) : x = y

{α : Type u}
(x y : ULift.{u_1, u} α)
(h : x.down = y.down)


lemma shiftLeft_sub : ∀ (m : Nat) {n k}, k ≤ n → m <<< (n - k) = (m <<< n) >>> k


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

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


theorem Iio_succ_of_not_isMax (ha : ¬IsMax a) : Iio (succ a) = Iic a

{α : Type u_1}
[Preorder α]
[SuccOrder α]
{a : α}
(ha : ¬IsMax a)


theorem Finset.mem_convexHull {s : Finset E} {x : E} : x ∈ convexHull R (s : Set E) ↔
    ∃ w : E → R, (∀ y ∈ s, 0 ≤ w y) ∧ ∑ y ∈ s, w y = 1 ∧ s.centerMass w id = x

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
{s : Finset E}
{x : E}

x ∈ (convexHull R) ↑s ↔ ∃ w, (∀ y ∈ s, 0 ≤ w y) ∧ ∑ y ∈ s, w y = 1 ∧ s.centerMass w id = x


@[simp]
theorem lift_succ (a : Ordinal.{v}) : lift.{u} (succ a) = succ (lift.{u} a)

Ordinal.lift.{u, v} (Order.succ a) = Order.succ (Ordinal.lift.{u, v} a)


@[simp]
theorem isOrtho_top_left {V : Submodule 𝕜 E} : ⊤ ⟂ V ↔ V = ⊥

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{V : Submodule 𝕜 E}

⊤ ⟂ V ↔ V = ⊥


@[simp]
theorem liftAlternating_algebraMap (f : ∀ i, M [⋀^Fin i]→ₗ[R] N) (r : R) :
    liftAlternating (R := R) (M := M) (N := N) f (algebraMap _ (ExteriorAlgebra R M) r) =
    r • f 0 0

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(f : (i : ℕ) → M [⋀^Fin i]→ₗ[R] N)
(r : R)

(ExteriorAlgebra.liftAlternating f) ((algebraMap R (ExteriorAlgebra R M)) r) = r • (f 0) 0


/-- The multiplicative equivalence between the type of units of `M` and the submonoid of unit
elements of `M`. -/
@[to_additive (attr := simps!) " The additive equivalence between the type of additive units of `M`
  and the additive submonoid whose elements are the additive units of `M`. "]
noncomputable def unitsTypeEquivIsUnitSubmonoid [Monoid M] : Mˣ ≃* IsUnit.submonoid M

↑(Submonoid.unitsTypeEquivIsUnitSubmonoid x) = ↑x


@[simp]
theorem mem_top (x : R) : x ∈ (⊤ : NonUnitalSubsemiring R)

{R : Type u}
[NonUnitalNonAssocSemiring R]
(x : R)


theorem eval_zero_mem_ideal_of_eq_mul_X_pow {n : ℕ} {P : Ideal R} {q : R[X]}
    {c : Polynomial (R ⧸ P)} (hq : map (mk P) q = c * X ^ n) (hn0 : n ≠ 0) : eval 0 q ∈ P

(hq : Polynomial.map (Ideal.Quotient.mk P) q = c * Polynomial.X ^ n)


theorem injective_iff {α β} {f : Option α → β} :
    Injective f ↔ Injective (f ∘ some) ∧ f none ∉ range (f ∘ some)

{α : Type u_1}
{β : Type u_2}
{f : Option α → β}

Function.Injective f ↔ Function.Injective (f ∘ some) ∧ f none ∉ Set.range (f ∘ some)


@[to_additive (attr := simp, norm_cast)]
theorem coe_sup : ⇑(p ⊔ q) = ⇑p ⊔ ⇑q

{E : Type u_4}
[AddGroup E]
(p q : AddGroupNorm E)


theorem IsLocalMin.on (h : IsLocalMin f a) (s) : IsLocalMinOn f s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{f : α → β}
{a : α}
(h : IsLocalMin f a)
(s : Set α)


@[simp]
theorem cons_eq_insert (a s h) : @cons α a s h = insert a s

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


theorem polynomialFunctions.starClosure_eq_adjoin_X [StarRing R] [ContinuousStar R] (s : Set R) :
    (polynomialFunctions s).starClosure = adjoin R {toContinuousMapOnAlgHom s X}

{R : Type u_1}
[CommSemiring R]
[TopologicalSpace R]
[TopologicalSemiring R]
[StarRing R]
[ContinuousStar R]
(s : Set R)

(polynomialFunctions s).starClosure = StarAlgebra.adjoin R {(Polynomial.toContinuousMapOnAlgHom s) Polynomial.X}


@[field_simps]
theorem divp_divp_eq_divp_mul (x : α) (u₁ u₂ : αˣ) : x /ₚ u₁ /ₚ u₂ = x /ₚ (u₂ * u₁)

{α : Type u}
[Monoid α]
(x : α)
(u₁ u₂ : αˣ)


theorem card_insert_of_mem (h : a ∈ s) : card (insert a s) = s.card

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


theorem add_den_dvd (q₁ q₂ : ℚ) : (q₁ + q₂).den ∣ q₁.den * q₂.den


protected lemma lt_of_le_of_lt : a ≤ b → b < c → a < c


theorem Iio_mem_nhdsSet_Icc (h : b < c) : Iio c ∈ 𝓝ˢ (Icc a b)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b c : α}
(h : b < c)


theorem filter_parts_partition_eq_cycleType {σ : Perm α} :
    ((partition σ).parts.filter fun n => 2 ≤ n) = σ.cycleType

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{σ : Equiv.Perm α}

Multiset.filter (fun n => 2 ≤ n) σ.partition.parts = σ.cycleType


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


theorem Icc_bot_coe : Icc (⊥ : WithBot α) b = insertNone (Iic b)

(α : Type u_1)
[PartialOrder α]
[OrderBot α]
[LocallyFiniteOrder α]
(b : α)

Finset.Icc ⊥ ↑b = Finset.insertNone (Finset.Iic b)


theorem sInf_glb (S : Set (LieSubalgebra R L)) : IsGLB S (sInf S)

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(S : Set (LieSubalgebra R L))


lemma cfc_comp_neg (hf : ContinuousOn f ((- ·) '' (spectrum R (a : A))) := by cfc_cont_tac)
    (ha : p a := by cfc_tac) : cfc (f <| - ·) a = cfc f (-a)

(hf : ContinuousOn f ((fun x => -x) '' spectrum R a) := by cfc_cont_tac)


@[norm_cast]
theorem hasSum_coe {f : α → ℝ≥0} {r : ℝ≥0} : HasSum (fun a => (f a : ℝ)) (r : ℝ) ↔ HasSum f r

{α : Type u_1}
{f : α → NNReal}
{r : NNReal}

HasSum (fun a => ↑(f a)) ↑r ↔ HasSum f r


@[to_additive gcd_nsmul_card_eq_zero_iff]
theorem pow_gcd_card_eq_one_iff : x ^ n = 1 ↔ x ^ gcd n (Fintype.card G) = 1

{G : Type u_1}
[AddGroup G]
[Fintype G]
{x : G}
{n : ℕ}

n • x = 0 ↔ n.gcd (Fintype.card G) • x = 0


theorem uniformContinuous_iff_eventually [UniformSpace β] {f : α → β} :
    UniformContinuous f ↔ ∀ r ∈ 𝓤 β, ∀ᶠ x : α × α in 𝓤 α, (f x.1, f x.2) ∈ r

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[UniformSpace β]
{f : α → β}

UniformContinuous f ↔ ∀ r ∈ 𝓤 β, ∀ᶠ (x : α × α) in 𝓤 α, (f x.1, f x.2) ∈ r


@[simp] theorem max_some_none [Max α] {a : α} : max (some a) none = some a


@[simp]
theorem trace_transpose_mul [AddCommMonoid R] [Mul R] (A : Matrix m n R) (B : Matrix n m R) :
    trace (Aᵀ * Bᵀ) = trace (A * B)

{m : Type u_2}
{n : Type u_3}
{R : Type u_6}
[Fintype m]
[Fintype n]
[AddCommMonoid R]
[Mul R]
(A : Matrix m n R)
(B : Matrix n m R)


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


theorem continuousAt_coe_iff {α : Type*} [TopologicalSpace α] {x : ℝ≥0} {f : ℝ≥0∞ → α} :
    ContinuousAt f ↑x ↔ ContinuousAt (f ∘ (↑) : ℝ≥0 → α) x

{α : Type u_4}
[TopologicalSpace α]
{x : ℝ≥0}
{f : ℝ≥0∞ → α}

ContinuousAt f ↑x ↔ ContinuousAt (f ∘ ENNReal.ofNNReal) x


/-- For a compact set `s`, locally uniform convergence on `s` is just uniform convergence on `s`. -/
theorem tendstoLocallyUniformlyOn_iff_tendstoUniformlyOn_of_compact (hs : IsCompact s) :
    TendstoLocallyUniformlyOn F f p s ↔ TendstoUniformlyOn F f p s

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{s : Set α}
{p : Filter ι}
[TopologicalSpace α]
(hs : IsCompact s)


/-- The image of a preconnected set is preconnected as well. -/
protected theorem IsPreconnected.image [TopologicalSpace β] {s : Set α} (H : IsPreconnected s)
    (f : α → β) (hf : ContinuousOn f s) : IsPreconnected (f '' s)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
{s : Set α}
(H : IsPreconnected s)
(f : α → β)
(hf : ContinuousOn f s)


/-- Typeclass for division rounded down. For each `a > 0`, this asserts the existence of a right
adjoint to the map `b ↦ a • b : β → β`. -/
class FloorDiv where
  /-- Flooring division. If `a > 0`, then `b ⌊/⌋ a` is the greatest `c` such that `a • c ≤ b`. -/
  floorDiv : β → α → β
  /-- Do not use this. Use `gc_floorDiv_smul` or `gc_floorDiv_mul` instead. -/
  protected floorDiv_gc ⦃a⦄ : 0 < a → GaloisConnection (a • ·) (floorDiv · a)
  /-- Do not use this. Use `floorDiv_nonpos` instead. -/
  protected floorDiv_nonpos ⦃a⦄ : a ≤ 0 → ∀ b, floorDiv b a = 0
  /-- Do not use this. Use `zero_floorDiv` instead. -/
  protected zero_floorDiv (a) : floorDiv 0 a = 0

{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMulZeroClass α β]
[self : FloorDiv α β]
(a : α)


@[simp]
theorem neg_eq_top_iff {x : EReal} : -x = ⊤ ↔ x = ⊥


theorem noetherianSpace_iff_isCompact : NoetherianSpace α ↔ ∀ s : Set α, IsCompact s

TopologicalSpace.NoetherianSpace α ↔ ∀ (s : Set α), IsCompact s


theorem cancel_right_of_respectsIso
    (P : AffineTargetMorphismProperty) [P.toProperty.RespectsIso]
    {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [IsIso g] [IsAffine Z] [IsAffine Y] :
    P (f ≫ g) ↔ P f


theorem _root_.is_const_of_fderiv_eq_zero
    {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {f : E → G}
    (hf : Differentiable 𝕜 f) (hf' : ∀ x, fderiv 𝕜 f x = 0)
    (x y : E) : f x = f y

{𝕜 : Type u_3}
{G : Type u_4}
[RCLike 𝕜]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{E : Type u_5}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : E → G}
(hf : Differentiable 𝕜 f)
(hf' : ∀ (x : E), fderiv 𝕜 f x = 0)
(x y : E)


theorem Coprime.eq_one_of_dvd {k m : Nat} (H : Coprime k m) (d : k ∣ m) : k = 1

{k m : Nat}
(H : k.Coprime m)
(d : k ∣ m)


/-- If a dense embedding `e : E →L[𝕜] G` expands the norm by a constant factor `N⁻¹`, then the
norm of the extension of `f` along `e` is bounded by `N * ‖f‖`. -/
theorem opNorm_extend_le :
    ‖f.extend e h_dense (uniformEmbedding_of_bound _ h_e).toUniformInducing‖ ≤ N * ‖f‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
{Fₗ : Type u_7}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedAddCommGroup Fₗ]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜 Fₗ]
{σ₁₂ : 𝕜 →+* 𝕜₂}
(f : E →SL[σ₁₂] F)
[CompleteSpace F]
(e : E →L[𝕜] Fₗ)
(h_dense : DenseRange ⇑e)
{N : ℝ≥0}
(h_e : ∀ (x : E), ‖x‖ ≤ ↑N * ‖e x‖)
[RingHomIsometric σ₁₂]


@[simp]
theorem join_append (L₁ L₂ : List (List α)) : join (L₁ ++ L₂) = join L₁ ++ join L₂


lemma iSup_coe_lt_top : ⨆ i, (f i : ℝ≥0∞) < ⊤ ↔ BddAbove (range f)

⨆ i, ↑(f i) < ⊤ ↔ BddAbove (Set.range f)


lemma radical_pow : ∀ {n}, n ≠ 0 → radical (I ^ n) = radical I

{R : Type u}
[CommSemiring R]
(I : Ideal R)
{n : ℕ}


@[simp]
theorem inclusion_le_inclusion [Preorder α] {s t : Set α} (h : s ⊆ t) {x y : s} :
    inclusion h x ≤ inclusion h y ↔ x ≤ y

{α : Type u_1}
[Preorder α]
{s t : Set α}
(h : s ⊆ t)
{x y : ↑s}

Set.inclusion h x ≤ Set.inclusion h y ↔ x ≤ y


theorem sq_of_coprime {a b c : ℤ} (h : IsCoprime a b) (heq : a * b = c ^ 2) :
    ∃ a0 : ℤ, a = a0 ^ 2 ∨ a = -a0 ^ 2


@[simp, norm_cast] lemma natCast_re (n : ℕ) : (n : ℂ).re = n


/-- A monoid is a decomposition monoid if every element is primal. An integral domain whose
multiplicative monoid is a decomposition monoid, is called a pre-Schreier domain; it is a
Schreier domain if it is moreover integrally closed. -/
@[mk_iff] class DecompositionMonoid : Prop where
  primal (a : α) : IsPrimal a

DecompositionMonoid α ↔ ∀ (a : α), IsPrimal a


@[reassoc (attr := simp)]
theorem toSheafify_naturality {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) :
    η ≫ J.toSheafify _ = J.toSheafify _ ≫ J.sheafifyMap η

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, w} D]

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

CategoryTheory.CategoryStruct.comp η (J.toSheafify Q) =
  CategoryTheory.CategoryStruct.comp (J.toSheafify P) (J.sheafifyMap η)


lemma prod_galRestrict_eq_norm [IsGalois K L] [IsIntegrallyClosed A] (x : B) :
    (∏ σ : L ≃ₐ[K] L, galRestrict A K L B σ x) =
    algebraMap A B (IsIntegralClosure.mk' (R := A) A (Algebra.norm K <| algebraMap B L x)
      (Algebra.isIntegral_norm K (IsIntegralClosure.isIntegral A L x).algebraMap))

(A : Type u_1)
(K : Type u_2)
(L : Type u_3)
(B : Type u_4)
[CommRing A]
[CommRing B]
[Algebra A B]
[Field K]
[Field L]
[Algebra A K]
[IsFractionRing A K]
[Algebra B L]
[Algebra K L]
[Algebra A L]
[IsScalarTower A B L]
[IsScalarTower A K L]
[IsIntegralClosure B A L]
[FiniteDimensional K L]
[IsGalois K L]
[IsIntegrallyClosed A]
(x : B)

∏ σ : L ≃ₐ[K] L, ((galRestrict A K L B) σ) x =
  (algebraMap A B) (IsIntegralClosure.mk' A ((Algebra.norm K) ((algebraMap B L) x)) ⋯)


theorem derivative_expand (f : R[X]) : Polynomial.derivative (expand R p f) =
    expand R p (Polynomial.derivative f) * (p * (X ^ (p - 1) : R[X]))

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

Polynomial.derivative ((Polynomial.expand R p) f) =
  (Polynomial.expand R p) (Polynomial.derivative f) * (↑p * Polynomial.X ^ (p - 1))


@[simp]
theorem _root_.Subalgebra.toSubmodule_toSubalgebra (S : Subalgebra R A) :
    (S.toSubmodule.toSubalgebra S.one_mem fun _ _ => S.mul_mem) = S

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)

(Subalgebra.toSubmodule S).toSubalgebra ⋯ ⋯ = S


lemma le_def (f g : E →L[𝕜] E) : f ≤ g ↔ (g - f).IsPositive

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
(f g : E →L[𝕜] E)


@[simp]
theorem mem_full_iff {c d : C} {f : c ⟶ d} : f ∈ (full D).arrows c d ↔ c ∈ D ∧ d ∈ D

{C : Type u}
[CategoryTheory.Groupoid C]
(D : Set C)
{c d : C}
{f : c ⟶ d}

f ∈ (CategoryTheory.Subgroupoid.full D).arrows c d ↔ c ∈ D ∧ d ∈ D


theorem lim_conj (f : CauSeq ℂ Complex.abs) : lim (cauSeqConj f) = conj (lim f)

(Complex.cauSeqConj f).lim = (starRingEnd ℂ) f.lim


@[simp]
theorem congr_tprod (f : Π i, s i ≃ₗ[R] t i) (m : Π i, s i) :
    congr f (tprod R m) = tprod R (fun (i : ι) ↦ (f i) (m i))

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
{t : ι → Type u_11}
[(i : ι) → AddCommMonoid (t i)]
[(i : ι) → Module R (t i)]
(f : (i : ι) → s i ≃ₗ[R] t i)
(m : (i : ι) → s i)

(PiTensorProduct.congr f) ((PiTensorProduct.tprod R) m) = ⨂ₜ[R] (i : ι), (f i) (m i)


theorem one_div_le_one_div_of_le (ha : 0 < a) (h : a ≤ b) : 1 / b ≤ 1 / a

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 < a)
(h : a ≤ b)


@[simp] theorem xor_not_right : Xor' a (¬b) ↔ (a ↔ b)


theorem trim_mkMetric [MeasurableSpace X] [BorelSpace X] (m : ℝ≥0∞ → ℝ≥0∞) :
    (mkMetric m : OuterMeasure X).trim = mkMetric m

{X : Type u_2}
[EMetricSpace X]
[MeasurableSpace X]
[BorelSpace X]
(m : ℝ≥0∞ → ℝ≥0∞)

(MeasureTheory.OuterMeasure.mkMetric m).trim = MeasureTheory.OuterMeasure.mkMetric m


/-- The elliptic curve mapped over a ring homomorphism `φ : R →+* A`. -/
@[simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
def map : EllipticCurve A

{R : Type u}
[CommRing R]
(E : EllipticCurve R)
{A : Type v}
[CommRing A]
(φ : R →+* A)


/-- Promote a finite products preserving functor to a monoidal functor between
categories equipped with the monoidal category structure given by finite products. -/
@[simps]
def Functor.toMonoidalFunctorOfHasFiniteProducts : MonoidalFunctor C D

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Functor.empty C) F]

[CategoryTheory.Limits.PreservesLimitsOfShape (CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair) F]

F.toMonoidalFunctorOfHasFiniteProducts.ε = (CategoryTheory.asIso (CategoryTheory.Limits.terminalComparison F)).inv


/-- This rather trivial consequence of `iInter₂_subset` is convenient with `apply`, and has `i` and
`j` explicit for this purpose. -/
theorem iInter₂_subset_of_subset {s : ∀ i, κ i → Set α} {t : Set α} (i : ι) (j : κ i)
    (h : s i j ⊆ t) : ⋂ (i) (j), s i j ⊆ t

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{s : (i : ι) → κ i → Set α}
{t : Set α}
(i : ι)
(j : κ i)
(h : s i j ⊆ t)


/-- A vector measure on a measurable space `α` is a σ-additive `M`-valued function (for some `M`
an add monoid) such that the empty set and non-measurable sets are mapped to zero. -/
structure VectorMeasure (α : Type*) [MeasurableSpace α] (M : Type*) [AddCommMonoid M]
    [TopologicalSpace M] where
  measureOf' : Set α → M
  empty' : measureOf' ∅ = 0
  not_measurable' ⦃i : Set α⦄ : ¬MeasurableSet i → measureOf' i = 0
  m_iUnion' ⦃f : ℕ → Set α⦄ : (∀ i, MeasurableSet (f i)) → Pairwise (Disjoint on f) →
    HasSum (fun i => measureOf' (f i)) (measureOf' (⋃ i, f i))

(self : MeasureTheory.VectorMeasure α M)

⦃f : ℕ → Set α⦄

(∀ (i : ℕ), MeasurableSet (f i)) → Pairwise (Disjoint on f) → HasSum (fun i => ↑self (f i)) (↑self (⋃ i, f i))


/-- `Polynomial.Gal.restrict p E` is compatible with `Polynomial.Gal.galAction p E`. -/
@[simp]
theorem restrict_smul [Fact (p.Splits (algebraMap F E))] (ϕ : E ≃ₐ[F] E) (x : rootSet p E) :
    ↑(restrict p E ϕ • x) = ϕ x

[Fact (Polynomial.Splits (algebraMap F E) p)]

↑((Polynomial.Gal.restrict p E) ϕ • x) = ϕ ↑x


@[simp]
theorem mem_inf {S T : Subalgebra R A} {x : A} : x ∈ S ⊓ T ↔ x ∈ S ∧ x ∈ T

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{S T : Subalgebra R A}
{x : A}


/-- A variant of Zorn's lemma. If every nonempty chain of a nonempty type has an upper bound, then
there is a maximal element.
-/
theorem exists_maximal_of_nonempty_chains_bounded [Nonempty α]
    (h : ∀ c, IsChain r c → c.Nonempty → ∃ ub, ∀ a ∈ c, a ≺ ub)
    (trans : ∀ {a b c}, a ≺ b → b ≺ c → a ≺ c) : ∃ m, ∀ a, m ≺ a → a ≺ m

(h : ∀ (c : Set α), IsChain r c → c.Nonempty → ∃ ub, ∀ a ∈ c, r a ub)

(trans : ∀ {a b c : α}, r a b → r b c → r a c)


theorem integrableOn_Lp_of_measure_ne_top {E} [NormedAddCommGroup E] {p : ℝ≥0∞} {s : Set α}
    (f : Lp E p μ) (hp : 1 ≤ p) (hμs : μ s ≠ ∞) : IntegrableOn f s μ

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{E : Type u_5}
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{s : Set α}
(f : ↥(MeasureTheory.Lp E p μ))
(hp : 1 ≤ p)
(hμs : μ s ≠ ⊤)


@[simp]
theorem sdiff_inf_self_left (a b : α) : a \ (a ⊓ b) = a \ b

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


@[simps!]
instance : MonoidalCategoryStruct (Dial C)

(CategoryTheory.MonoidalCategory.associator X Y Z).hom.F =
  CategoryTheory.Limits.prod.lift
    (CategoryTheory.Limits.prod.lift
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst)
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd
        (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst)))
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd))


/--
The category of sheaves on the bottom (trivial) grothendieck topology is equivalent to the category
of presheaves.
-/
@[simps]
def sheafOfTypesBotEquiv : SheafOfTypes (⊥ : GrothendieckTopology C) ≌ Cᵒᵖ ⥤ Type w

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

CategoryTheory.sheafOfTypesBotEquiv.counitIso =
  CategoryTheory.Iso.refl
    ({ obj := fun P => { val := P, cond := ⋯ }, map := fun {X Y} f => { val := f }, map_id := ⋯, map_comp := ⋯ }.comp
      (CategoryTheory.sheafOfTypesToPresheaf ⊥))


/-- In a bicategory, we can compose the 1-morphisms `f : a ⟶ b` and `g : b ⟶ c` to obtain
a 1-morphism `f ≫ g : a ⟶ c`. This composition does not need to be strictly associative,
but there is a specified associator, `α_ f g h : (f ≫ g) ≫ h ≅ f ≫ (g ≫ h)`.
There is an identity 1-morphism `𝟙 a : a ⟶ a`, with specified left and right unitor
isomorphisms `λ_ f : 𝟙 a ≫ f ≅ f` and `ρ_ f : f ≫ 𝟙 a ≅ f`.
These associators and unitors satisfy the pentagon and triangle equations.

See https://ncatlab.org/nlab/show/bicategory.
-/
@[nolint checkUnivs]
class Bicategory (B : Type u) extends CategoryStruct.{v} B where
  -- category structure on the collection of 1-morphisms:
  homCategory : ∀ a b : B, Category.{w} (a ⟶ b) := by infer_instance
  -- left whiskering:
  whiskerLeft {a b c : B} (f : a ⟶ b) {g h : b ⟶ c} (η : g ⟶ h) : f ≫ g ⟶ f ≫ h
  -- right whiskering:
  whiskerRight {a b c : B} {f g : a ⟶ b} (η : f ⟶ g) (h : b ⟶ c) : f ≫ h ⟶ g ≫ h
  -- associator:
  associator {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) : (f ≫ g) ≫ h ≅ f ≫ g ≫ h
  -- left unitor:
  leftUnitor {a b : B} (f : a ⟶ b) : 𝟙 a ≫ f ≅ f
  -- right unitor:
  rightUnitor {a b : B} (f : a ⟶ b) : f ≫ 𝟙 b ≅ f
  -- axioms for left whiskering:
  whiskerLeft_id : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerLeft f (𝟙 g) = 𝟙 (f ≫ g) := by
    aesop_cat
  whiskerLeft_comp :
    ∀ {a b c} (f : a ⟶ b) {g h i : b ⟶ c} (η : g ⟶ h) (θ : h ⟶ i),
      whiskerLeft f (η ≫ θ) = whiskerLeft f η ≫ whiskerLeft f θ := by
    aesop_cat
  id_whiskerLeft :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerLeft (𝟙 a) η = (leftUnitor f).hom ≫ η ≫ (leftUnitor g).inv := by
    aesop_cat
  comp_whiskerLeft :
    ∀ {a b c d} (f : a ⟶ b) (g : b ⟶ c) {h h' : c ⟶ d} (η : h ⟶ h'),
      whiskerLeft (f ≫ g) η =
        (associator f g h).hom ≫ whiskerLeft f (whiskerLeft g η) ≫ (associator f g h').inv := by
    aesop_cat
  -- axioms for right whiskering:
  id_whiskerRight : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerRight (𝟙 f) g = 𝟙 (f ≫ g) := by
    aesop_cat
  comp_whiskerRight :
    ∀ {a b c} {f g h : a ⟶ b} (η : f ⟶ g) (θ : g ⟶ h) (i : b ⟶ c),
      whiskerRight (η ≫ θ) i = whiskerRight η i ≫ whiskerRight θ i := by
    aesop_cat
  whiskerRight_id :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerRight η (𝟙 b) = (rightUnitor f).hom ≫ η ≫ (rightUnitor g).inv := by
    aesop_cat
  whiskerRight_comp :
    ∀ {a b c d} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c) (h : c ⟶ d),
      whiskerRight η (g ≫ h) =
        (associator f g h).inv ≫ whiskerRight (whiskerRight η g) h ≫ (associator f' g h).hom := by
    aesop_cat
  -- associativity of whiskerings:
  whisker_assoc :
    ∀ {a b c d} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g') (h : c ⟶ d),
      whiskerRight (whiskerLeft f η) h =
        (associator f g h).hom ≫ whiskerLeft f (whiskerRight η h) ≫ (associator f g' h).inv := by
    aesop_cat
  -- exchange law of left and right whiskerings:
  whisker_exchange :
    ∀ {a b c} {f g : a ⟶ b} {h i : b ⟶ c} (η : f ⟶ g) (θ : h ⟶ i),
      whiskerLeft f θ ≫ whiskerRight η i = whiskerRight η h ≫ whiskerLeft g θ := by
    aesop_cat
  -- pentagon identity:
  pentagon :
    ∀ {a b c d e} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) (i : d ⟶ e),
      whiskerRight (associator f g h).hom i ≫
          (associator f (g ≫ h) i).hom ≫ whiskerLeft f (associator g h i).hom =
        (associator (f ≫ g) h i).hom ≫ (associator f g (h ≫ i)).hom := by
    aesop_cat
  -- triangle identity:
  triangle :
    ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c),
      (associator f (𝟙 b) g).hom ≫ whiskerLeft f (leftUnitor g).hom
      = whiskerRight (rightUnitor f).hom g := by
    aesop_cat

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

CategoryTheory.Bicategory.whiskerRight (CategoryTheory.CategoryStruct.id f) g =
  CategoryTheory.CategoryStruct.id (CategoryTheory.CategoryStruct.comp f g)


/-- If a function is locally Lipschitz around a point, then it is continuous at this point. -/
theorem continuousAt_of_locally_lipschitz {x : α} {r : ℝ} (hr : 0 < r) (K : ℝ)
    (h : ∀ y, dist y x < r → dist (f y) (f x) ≤ K * dist y x) : ContinuousAt f x

(h : ∀ (y : α), dist y x < r → dist (f y) (f x) ≤ K * dist y x)


/-- Formula for `hurwitzZetaOdd` as a Dirichlet series in the convergence range, with sum over `ℕ`
(version without absolute values, assuming `a ∈ Icc 0 1`) -/
lemma hasSum_nat_hurwitzZetaOdd_of_mem_Icc {a : ℝ} (ha : a ∈ Icc 0 1) {s : ℂ} (hs : 1 < re s) :
    HasSum (fun n : ℕ ↦ (1 / (n + a : ℂ) ^ s - 1 / (n + 1 - a : ℂ) ^ s) / 2)
    (hurwitzZetaOdd a s)

{a : ℝ}
(ha : a ∈ Set.Icc 0 1)
{s : ℂ}
(hs : 1 < s.re)

HasSum (fun n => (1 / (↑n + ↑a) ^ s - 1 / (↑n + 1 - ↑a) ^ s) / 2) (HurwitzZeta.hurwitzZetaOdd (↑a) s)


@[to_additive]
theorem le_of_forall_one_lt_lt_mul (h : ∀ ε : α, 1 < ε → a < b * ε) : a ≤ b

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


theorem encard_singleton_inter (s : Set α) (x : α) : ({x} ∩ s).encard ≤ 1


@[to_additive]
theorem mk'_eq_iff_eq {x₁ x₂} {y₁ y₂ : S} :
    f.mk' x₁ y₁ = f.mk' x₂ y₂ ↔ f.toMap (y₂ * x₁) = f.toMap (y₁ * x₂)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
{x₁ x₂ : M}
{y₁ y₂ : ↥S}

f.mk' x₁ y₁ = f.mk' x₂ y₂ ↔ f.toMap (↑y₂ + x₁) = f.toMap (↑y₁ + x₂)


@[simp]
theorem init_snoc : init (snoc p x) = p

{n : ℕ}
{α : Fin (n + 1) → Type u}
(x : α (Fin.last n))
(p : (i : Fin n) → α i.castSucc)


theorem SSameSide.trans_wOppSide {s : AffineSubspace R P} {x y z : P} (hxy : s.SSameSide x y)
    (hyz : s.WOppSide y z) : s.WOppSide x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(hxy : s.SSameSide x y)
(hyz : s.WOppSide y z)


theorem comap_apply' (κ : Kernel α β) (hg : Measurable g) (c : γ) (s : Set β) :
    comap κ g hg c s = κ (g c) s

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
{g : γ → α}
(κ : ProbabilityTheory.Kernel α β)
(hg : Measurable g)
(c : γ)
(s : Set β)


@[to_additive]
theorem prod_hom₂ [CommMonoid β] [CommMonoid γ] (s : Multiset ι) (f : α → β → γ)
    (hf : ∀ a b c d, f (a * b) (c * d) = f a c * f b d) (hf' : f 1 1 = 1) (f₁ : ι → α)
    (f₂ : ι → β) : (s.map fun i => f (f₁ i) (f₂ i)).prod = f (s.map f₁).prod (s.map f₂).prod

(f : α → β → γ)

(hf : ∀ (a b : α) (c d : β), f (a * b) (c * d) = f a c * f b d)

(f₁ : ι → α)

(f₂ : ι → β)

(Multiset.map (fun i => f (f₁ i) (f₂ i)) s).prod = f (Multiset.map f₁ s).prod (Multiset.map f₂ s).prod


@[simp]
theorem coe_countAddMonoidHom {a : α} : (countAddMonoidHom a : Multiset α → ℕ) = count a

⇑(Multiset.countAddMonoidHom a) = Multiset.count a


/-- A function `f` on `Fin (n + 1)` is strictly antitone if and only if `f (i + 1) < f i`
for all `i`. -/
lemma strictAnti_iff_succ_lt : StrictAnti f ↔ ∀ i : Fin n, f i.succ < f (castSucc i)

{n : ℕ}
{α : Type u_1}
[Preorder α]
{f : Fin (n + 1) → α}

StrictAnti f ↔ ∀ (i : Fin n), f i.succ < f i.castSucc


/-- The supremum of a chain in the product `ω`-CPO. -/
@[simps]
protected def ωSup (c : Chain (α × β)) : α × β

(c : OmegaCompletePartialOrder.Chain (α × β))

(Prod.ωSup c).1 = OmegaCompletePartialOrder.ωSup (c.map OrderHom.fst)


@[fun_prop]
theorem Differentiable.const_smul (h : Differentiable 𝕜 f) (c : R) :
    Differentiable 𝕜 fun y => c • f y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{R : Type u_6}
[Semiring R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
(h : Differentiable 𝕜 f)
(c : R)


theorem Ioc_filter_lt_of_lt_right {a b c : α} [DecidablePred (· < c)] (h : b < c) :
    (Ioc a b).filter (· < c) = Ioc a b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b c : α}
[DecidablePred fun x => x < c]
(h : b < c)

Finset.filter (fun x => x < c) (Finset.Ioc a b) = Finset.Ioc a b


{R : Type u_1}
[NonUnitalNonAssocRing R]
(I : TwoSidedIdeal R)


theorem sup_inf {x' y'} (h : IsCompl x y) (h' : IsCompl x' y') : IsCompl (x ⊔ x') (y ⊓ y')

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{x y x' y' : α}
(h : IsCompl x y)
(h' : IsCompl x' y')


theorem einfsep_pos_of_finite [Finite s] : 0 < s.einfsep

{α : Type u_1}
[EMetricSpace α]
{s : Set α}
[Finite ↑s]


lemma LeftHomologyData.mapCyclesIso_eq [S.HasLeftHomology]
    [F.PreservesLeftHomologyOf S] :
    S.mapCyclesIso F = (hl.map F).cyclesIso ≪≫ F.mapIso hl.cyclesIso.symm


theorem image_val_preimage_restrictPreimage {u : Set t} :
    Subtype.val '' (t.restrictPreimage f ⁻¹' u) = f ⁻¹' (Subtype.val '' u)

{α : Type u_1}
{β : Type u_2}
(t : Set β)
{f : α → β}
{u : Set ↑t}


protected theorem tsub_add_eq_add_tsub (hb : AddLECancellable b) (h : b ≤ a) :
    a - b + c = a + c - b

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


/-- If the subalgebra generated by a set `s` is dense in the ambient module, then two continuous
algebra maps equal on `s` are equal. -/
theorem ext_on [T2Space B] {s : Set A} (hs : Dense (Algebra.adjoin R s : Set A))
    {f g : A →A[R] B} (h : Set.EqOn f g s) : f = g

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
[T2Space B]
{s : Set A}
(hs : Dense ↑(Algebra.adjoin R s))
{f g : A →A[R] B}
(h : Set.EqOn (⇑f) (⇑g) s)


/-- The (identity) equivalence between `Cᴹᵒᵖ` and `C`. -/
@[simps!] def MonoidalOpposite.unmopEquiv : Cᴹᵒᵖ ≌ C

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

∀ {X Y : Cᴹᵒᵖ} (f : X ⟶ Y), (CategoryTheory.MonoidalOpposite.unmopEquiv C).functor.map f = f.unmop


/-- Every set has a measurable superset. Declare this as local instance as needed. -/
theorem nonempty_measurable_superset (s : Set α) : Nonempty { t // s ⊆ t ∧ MeasurableSet t }

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


theorem continuous_hatInv [CompletableTopField K] {x : hat K} (h : x ≠ 0) :
    ContinuousAt hatInv x

{K : Type u_1}
[Field K]
[UniformSpace K]
[CompletableTopField K]
{x : hat K}
(h : x ≠ 0)


/-- A filter `F` on a type `α` is a collection of sets of `α` which contains the whole `α`,
is upwards-closed, and is stable under intersection. We do not forbid this collection to be
all sets of `α`. -/
structure Filter (α : Type*) where
  /-- The set of sets that belong to the filter. -/
  sets : Set (Set α)
  /-- The set `Set.univ` belongs to any filter. -/
  univ_sets : Set.univ ∈ sets
  /-- If a set belongs to a filter, then its superset belongs to the filter as well. -/
  sets_of_superset {x y} : x ∈ sets → x ⊆ y → y ∈ sets
  /-- If two sets belong to a filter, then their intersection belongs to the filter as well. -/
  inter_sets {x y} : x ∈ sets → y ∈ sets → x ∩ y ∈ sets

{α : Type u_1}
(self : Filter α)
{x y : Set α}


theorem IsSymm.zpow {A : M} (h : A.IsSymm) (k : ℤ) :
    (A ^ k).IsSymm

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
{A : Matrix n' n' R}
(h : A.IsSymm)
(k : ℤ)


theorem surjective_ofLocalizationSpan : OfLocalizationSpan surjective

RingHom.OfLocalizationSpan fun {X Y} [CommRing X] [CommRing Y] f => Function.Surjective ⇑f


theorem _root_.LieHom.range_eq_map : f.range = map f ⊤

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


@[to_additive]
theorem swap_mem_mulAntidiagonal [CommSemigroup α] {s t : Set α} {a : α} {x : α × α} :
    x.swap ∈ Set.mulAntidiagonal s t a ↔ x ∈ Set.mulAntidiagonal t s a

{α : Type u_1}
[CommSemigroup α]
{s t : Set α}
{a : α}
{x : α × α}

x.swap ∈ s.mulAntidiagonal t a ↔ x ∈ t.mulAntidiagonal s a


@[simp]
theorem toCocone_pt (c : BinaryBicone P Q) : c.toCocone.pt = c.pt

(c : CategoryTheory.Limits.BinaryBicone P Q)


theorem eq_coe_norm_of_nonneg {z : ℂ} (hz : 0 ≤ z) : z = ↑‖z‖


@[simp]
lemma dualCoannihilator_map_linearEquiv_flip (p : Submodule R M) :
    (p.map e.flip).dualCoannihilator = p.dualAnnihilator.map e.symm

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[Module.IsReflexive R M]
(e : N ≃ₗ[R] Module.Dual R M)
(p : Submodule R M)

(Submodule.map e.flip p).dualCoannihilator = Submodule.map e.symm p.dualAnnihilator


/-- The left options of `x * y` agree with that of `y * x` up to equivalence. -/
lemma mulOption_symm (x y) {i j} : ⟦mulOption x y i j⟧ = (⟦mulOption y x j i⟧ : Game)

(x y : SetTheory.PGame)
{i : x.LeftMoves}
{j : y.LeftMoves}

⟦x.mulOption y i j⟧ = ⟦y.mulOption x j i⟧


/-- This lemma (and some of its corollaries) also holds for `ENNReal`, but this proof doesn't work
for it. Maybe we should add this lemma as field to `OrderedSub`? -/
theorem lt_tsub_of_add_lt_left : a + c < b → c < b - a

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


theorem compl_compl_image [BooleanAlgebra α] (S : Set α) :
    HasCompl.compl '' (HasCompl.compl '' S) = S

{α : Type u_1}
[BooleanAlgebra α]
(S : Set α)


@[simp]
lemma negOnePow_two_mul_add_one (n : ℤ) : (2 * n + 1).negOnePow = -1


@[fun_prop, measurability]
protected theorem measurable (L : E →L[𝕜] F) : Measurable L

{𝕜 : Type u_2}
[NormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[MeasurableSpace E]
[OpensMeasurableSpace E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[MeasurableSpace F]
[BorelSpace F]
(L : E →L[𝕜] F)


@[to_additive]
nonrec theorem SmoothWithinAt.inv {f : M → G} {s : Set M} {x₀ : M}
    (hf : SmoothWithinAt I' I f s x₀) : SmoothWithinAt I' I (fun x => (f x)⁻¹) s x₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[Group G]
[LieGroup I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{f : M → G}
{s : Set M}
{x₀ : M}
(hf : SmoothWithinAt I' I f s x₀)


lemma biprod_lift_id_sub_id : biprod.lift (𝟙 K) (-𝟙 K) = biprod.inl - biprod.inr

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

CategoryTheory.Limits.biprod.lift (𝟙 K) (-𝟙 K) = CategoryTheory.Limits.biprod.inl - CategoryTheory.Limits.biprod.inr


nonrec theorem exp_nat_mul (x : ℝ) (n : ℕ) : exp (n * x) = exp x ^ n


lemma isBigO_atTop_F_nat_zero_sub {a : ℝ} (ha : 0 ≤ a) : ∃ p, 0 < p ∧
    (fun t ↦ F_nat 0 a t - (if a = 0 then 1 else 0)) =O[atTop] fun t ↦ exp (-p * t)

∃ p, 0 < p ∧ (fun t => HurwitzKernelBounds.F_nat 0 a t - if a = 0 then 1 else 0) =O[Filter.atTop] fun t => rexp (-p * t)


theorem mem_singleton_self (a : α) : a ∈ [a]


@[simp]
theorem id_comp (f : C(α, β)) : (ContinuousMap.id _).comp f = f

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : C(α, β))


/-- The inverse of a map which preserves multiplication,
preserves multiplication when the target is commutative. -/
@[to_additive
      "The negation of a map which preserves addition, preserves addition when
      the target is commutative."]
theorem inv {α β} [Mul α] [CommGroup β] {f : α → β} (hf : IsMulHom f) : IsMulHom fun a => (f a)⁻¹

{α : Type u_2}
{β : Type u_3}
[Mul α]
[CommGroup β]
{f : α → β}
(hf : IsMulHom f)


theorem toString : ∀ {s}, ValidFor l m r s → s.toString = ⟨m⟩

Substring.ValidFor l m r s → s.toString = { data := m }


@[to_additive]
lemma card_fiber_eq_of_mem_range (f : F) {x y : M} (hx : x ∈ Set.range f) (hy : y ∈ Set.range f) :
    (univ.filter <| fun g => f g = x).card = (univ.filter <| fun g => f g = y).card

{G : Type u_1}
{M : Type u_2}
{F : Type u_3}
[AddGroup G]
[Fintype G]
[AddMonoid M]
[DecidableEq M]
[FunLike F G M]
[AddMonoidHomClass F G M]
(f : F)
{x y : M}
(hx : x ∈ Set.range ⇑f)
(hy : y ∈ Set.range ⇑f)

(Finset.filter (fun g => f g = x) Finset.univ).card = (Finset.filter (fun g => f g = y) Finset.univ).card


lemma one_div_nonneg : 0 ≤ 1 / a ↔ 0 ≤ a

{α : Type u_1}
[Semifield α]
[LinearOrder α]
[PosMulReflectLT α]
[ZeroLEOneClass α]
{a : α}


protected theorem contDiff : ContDiff ℝ n f

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
{c : E}
(f : ContDiffBump c)
{n : ℕ∞}


theorem finite_def {a b : α} : Finite a b ↔ ∃ n : ℕ, ¬a ^ (n + 1) ∣ b

multiplicity.Finite a b ↔ ∃ n, ¬a ^ (n + 1) ∣ b


/-- Make a `VectorBundle` from a `VectorPrebundle`.  Concretely this means
that, given a `VectorPrebundle` structure for a sigma-type `E` -- which consists of a
number of "pretrivializations" identifying parts of `E` with product spaces `U × F` -- one
establishes that for the topology constructed on the sigma-type using
`VectorPrebundle.totalSpaceTopology`, these "pretrivializations" are actually
"trivializations" (i.e., homeomorphisms with respect to the constructed topology). -/
theorem toVectorBundle : @VectorBundle R _ F E _ _ _ _ _ _ a.totalSpaceTopology _ a.toFiberBundle

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
{E : B → Type u_4}
[NontriviallyNormedField R]
[(x : B) → AddCommMonoid (E x)]
[(x : B) → Module R (E x)]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
[(x : B) → TopologicalSpace (E x)]
(a : VectorPrebundle R F E)


@[to_additive (attr := simp)]
theorem MonoidHom.mk_coe [MulOneClass M] [MulOneClass N] (f : M →* N) (hmul) :
    MonoidHom.mk f hmul = f

(hmul : ∀ (x y : M), (↑f).toFun (x * y) = (↑f).toFun x * (↑f).toFun y)

{ toOneHom := ↑f, map_mul' := hmul } = f


/--
An isomorphism of groups gives an order isomorphism between the lattices of subgroups,
defined by sending subgroups to their forward images.

See also `MulEquiv.comapSubgroup` which maps subgroups to their inverse images.
-/
@[simps]
def mapSubgroup {H : Type*} [Group H] (f : G ≃* H) : Subgroup G ≃o Subgroup H

{G : Type u_1}
[Group G]
{H : Type u_6}
[Group H]
(f : G ≃* H)

∀ (H_1 : Subgroup H), (RelIso.symm f.mapSubgroup) H_1 = Subgroup.map (↑f.symm) H_1


theorem Subset.dedup_add_left {s t : Multiset α} (h : t ⊆ s) :
    dedup (s + t) = dedup s

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


theorem antilipschitz_equivRealProd : AntilipschitzWith (NNReal.sqrt 2) equivRealProd

AntilipschitzWith (NNReal.sqrt 2) ⇑Complex.equivRealProd


/-- Hölder inequality -/
protected theorem tsum_mul_le_mul_norm {p q : ℝ≥0∞} (hpq : p.toReal.IsConjExponent q.toReal)
    (f : lp E p) (g : lp E q) :
    (Summable fun i => ‖f i‖ * ‖g i‖) ∧ ∑' i, ‖f i‖ * ‖g i‖ ≤ ‖f‖ * ‖g‖

(Summable fun i => ‖↑f i‖ * ‖↑g i‖) ∧ ∑' (i : α), ‖↑f i‖ * ‖↑g i‖ ≤ ‖f‖ * ‖g‖


@[simp] theorem toIsometryEquiv_symm (e : X ≅ Y) :
    toIsometryEquiv e.symm = (toIsometryEquiv e).symm

{R : Type u}
[CommRing R]
{X Y : QuadraticModuleCat R}
(e : X ≅ Y)


theorem countable_iff_exists_surjective [Nonempty α] : Countable α ↔ ∃ f : ℕ → α, Surjective f

Countable α ↔ ∃ f, Function.Surjective f


protected lemma pow_lt_pow_iff_left (hn : n ≠ 0) : a ^ n < b ^ n ↔ a < b


theorem cosh_two_mul : cosh (2 * x) = cosh x ^ 2 + sinh x ^ 2

Complex.cosh (2 * x) = Complex.cosh x ^ 2 + Complex.sinh x ^ 2


/-- Precomposing `f` with `Prod.snd` is `C^n` at `(x, y)` -/
theorem ContDiffAt.snd' {f : F → G} {x : E} {y : F} (hf : ContDiffAt 𝕜 n f y) :
    ContDiffAt 𝕜 n (fun x : E × F => f x.2) (x, y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ∞}
{f : F → G}
{x : E}
{y : F}
(hf : ContDiffAt 𝕜 n f y)


theorem continuousWithinAt_iff'_right [TopologicalSpace β] {f : β → α} {b : β} {s : Set β} :
    ContinuousWithinAt f s b ↔ Tendsto (fun x => (f b, f x)) (𝓝[s] b) (𝓤 α)

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[TopologicalSpace β]
{f : β → α}
{b : β}
{s : Set β}

ContinuousWithinAt f s b ↔ Filter.Tendsto (fun x => (f b, f x)) (𝓝[s] b) (𝓤 α)


theorem ContinuousAt.update [DecidableEq ι] {x : X} (hf : ContinuousAt f x) (i : ι) {g : X → π i}
    (hg : ContinuousAt g x) : ContinuousAt (fun a => update (f a) i (g a)) x

{X : Type u}
{ι : Type u_5}
{π : ι → Type u_6}
[TopologicalSpace X]
[T : (i : ι) → TopologicalSpace (π i)]
{f : X → (i : ι) → π i}
[DecidableEq ι]
{x : X}
(hf : ContinuousAt f x)
(i : ι)
{g : X → π i}
(hg : ContinuousAt g x)

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


theorem symm_image_eq_preimage (h : M ≃ₘ^n⟮I, J⟯ N) (s : Set N) : h.symm '' s = h ⁻¹' s

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


theorem piCongrLeft_sum_inl (π : ι'' → Type*) (e : ι ⊕ ι' ≃ ι'') (f : ∀ i, π (e (inl i)))
    (g : ∀ i, π (e (inr i))) (i : ι) :
    piCongrLeft π e (sumPiEquivProdPi (fun x => π (e x)) |>.symm (f, g)) (e (inl i)) = f i

{ι'' : Sort u_2}
{ι : Type u_3}
{ι' : Type u_4}
(π : ι'' → Type u_1)
(e : ι ⊕ ι' ≃ ι'')
(f : (i : ι) → π (e (Sum.inl i)))
(g : (i : ι') → π (e (Sum.inr i)))
(i : ι)

(Equiv.piCongrLeft π e) ((Equiv.sumPiEquivProdPi fun x => π (e x)).symm (f, g)) (e (Sum.inl i)) = f i


@[simp] theorem restrict_ground_eq : (M ↾ R).E = R

{α : Type u_1}
{M : Matroid α}
{R : Set α}


lemma eval_polynomialY_of_Z_ne_zero {P : Fin 3 → F} (hPz : P z ≠ 0) :
    eval P W.polynomialY / P z ^ 3 =
      W.toAffine.polynomialY.evalEval (P x / P z ^ 2) (P y / P z ^ 3)

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P : Fin 3 → F}
(hPz : P z ≠ 0)

(MvPolynomial.eval P) W.polynomialY / P z ^ 3 =
  Polynomial.evalEval (P x / P z ^ 2) (P y / P z ^ 3) W.toAffine.polynomialY


@[to_additive]
theorem nonempty_iInter_clPrehaar (K₀ : PositiveCompacts G) :
    (haarProduct (K₀ : Set G) ∩ ⋂ V : OpenNhdsOf (1 : G), clPrehaar K₀ V).Nonempty

(K₀ : TopologicalSpace.PositiveCompacts G)

(MeasureTheory.Measure.haar.haarProduct ↑K₀ ∩ ⋂ V, MeasureTheory.Measure.haar.clPrehaar (↑K₀) V).Nonempty


@[simp]
theorem toNormedDual_eq_iff (x' y' : WeakDual 𝕜 E) : toNormedDual x' = toNormedDual y' ↔ x' = y'

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
(x' y' : WeakDual 𝕜 E)

WeakDual.toNormedDual x' = WeakDual.toNormedDual y' ↔ x' = y'


theorem norm_mul (f g : PadicSeq p) : (f * g).norm = f.norm * g.norm

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(f g : PadicSeq p)


@[simp, norm_cast]
theorem toMeasure_zero : ((↑) : FiniteMeasure Ω → Measure Ω) 0 = 0


@[local instance] private lemma instT0Space : T0Space R


@[simp]
theorem edist_equiv_symm_single_same (i : ι) (b₁ b₂ : β i) :
    edist
        ((WithLp.equiv p (∀ i, β i)).symm (Pi.single i b₁))
        ((WithLp.equiv p (∀ i, β i)).symm (Pi.single i b₂)) =
      edist b₁ b₂

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

edist ((WithLp.equiv p ((i : ι) → β i)).symm (Pi.single i b₁))
    ((WithLp.equiv p ((i : ι) → β i)).symm (Pi.single i b₂)) =
  edist b₁ b₂


@[simp]
theorem one_eq_lift_iff {a : Cardinal.{u}} :
    (1 : Cardinal) = lift.{v} a ↔ 1 = a


/-- Used to prove that a regular topological space with Lindelöf topology is a normal space,
and (todo) a perfectly normal space is a completely normal space. -/
theorem hasSeparatingCovers_iff_separatedNhds {s t : Set X} :
    HasSeparatingCover s t ∧ HasSeparatingCover t s ↔ SeparatedNhds s t

{X : Type u_1}
[TopologicalSpace X]
{s t : Set X}


theorem peval_polyOfInterest (n : ℕ) (x y : 𝕎 k) :
    peval (polyOfInterest p n) ![fun i => x.coeff i, fun i => y.coeff i] =
    (x * y).coeff (n + 1) + p ^ (n + 1) * x.coeff (n + 1) * y.coeff (n + 1) -
      y.coeff (n + 1) * ∑ i ∈ range (n + 1 + 1), p ^ i * x.coeff i ^ p ^ (n + 1 - i) -
      x.coeff (n + 1) * ∑ i ∈ range (n + 1 + 1), p ^ i * y.coeff i ^ p ^ (n + 1 - i)

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

WittVector.peval (WittVector.polyOfInterest p n) ![fun i => x.coeff i, fun i => y.coeff i] =
  (x * y).coeff (n + 1) + ↑p ^ (n + 1) * x.coeff (n + 1) * y.coeff (n + 1) -
      y.coeff (n + 1) * ∑ i ∈ Finset.range (n + 1 + 1), ↑p ^ i * x.coeff i ^ p ^ (n + 1 - i) -
    x.coeff (n + 1) * ∑ i ∈ Finset.range (n + 1 + 1), ↑p ^ i * y.coeff i ^ p ^ (n + 1 - i)


/-- Any finite collection of objects in a cofiltered category has an object "to the left".
-/
theorem inf_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (S ⟶ X)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.IsCofiltered C]
(O : Finset C)

∃ S, ∀ {X : C}, X ∈ O → Nonempty (S ⟶ X)


protected theorem coe_neg {R : Type u} {A : Type v} [CommRing R] [NonUnitalRing A] [Module R A]
    [Star A] {S : NonUnitalStarSubalgebra R A} (x : S) : (↑(-x) : A) = -↑x

{R : Type u}
{A : Type v}
[CommRing R]
[NonUnitalRing A]
[Module R A]
[Star A]
{S : NonUnitalStarSubalgebra R A}
(x : ↥S)


theorem iSupLift_of_mem {i : ι} (x : T) (hx : (x : A) ∈ K i) :
    iSupLift K dir f hf T hT x = f i ⟨x, hx⟩

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

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

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


/-- Casting `SignType → ℤ → α` is the same as casting directly `SignType → α`. -/
@[simp, norm_cast]
lemma intCast_cast {α : Type*} [AddGroupWithOne α] (s : SignType) : ((s : ℤ) : α) = s

{α : Type u_2}
[AddGroupWithOne α]
(s : SignType)


theorem exists_seq_strictAnti_tendsto_nhdsWithin [DenselyOrdered α] [NoMaxOrder α]
    [FirstCountableTopology α] (x : α) :
    ∃ u : ℕ → α, StrictAnti u ∧ (∀ n, x < u n) ∧ Tendsto u atTop (𝓝[>] x)

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMaxOrder α]
[FirstCountableTopology α]
(x : α)

∃ u, StrictAnti u ∧ (∀ (n : ℕ), x < u n) ∧ Filter.Tendsto u Filter.atTop (𝓝[>] x)


/-- If `(m : M)` has norm equal to `0` in `M ⧸ S` for a closed subgroup `S` of `M`, then
`m ∈ S`. -/
theorem norm_mk_eq_zero (S : AddSubgroup M) (hS : IsClosed (S : Set M)) (m : M)
    (h : ‖mk' S m‖ = 0) : m ∈ S

{M : Type u_1}
[SeminormedAddCommGroup M]
(S : AddSubgroup M)
(hS : IsClosed ↑S)
(m : M)
(h : ‖(QuotientAddGroup.mk' S) m‖ = 0)


@[simp]
theorem lift_eq (x : R) : lift hg ((algebraMap R S) x) = g x

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

(IsLocalization.lift hg) ((algebraMap R S) x) = g x


lemma KernelFork.IsLimit.isIso_ι {X Y : C} {f : X ⟶ Y} (c : KernelFork f)
    (hc : IsLimit c) (hf : f = 0) : IsIso c.ι

(c : CategoryTheory.Limits.KernelFork f)


@[simp, norm_cast]
protected theorem coe_nonpos {x : ℝ} : (x : EReal) ≤ 0 ↔ x ≤ 0

↑x ≤ 0 ↔ x ≤ 0


/-- There exists `π ∈ K` with `v`-adic valuation `Multiplicative.ofAdd (-1)`. -/
theorem valuation_exists_uniformizer : ∃ π : K, v.valuation π = Multiplicative.ofAdd (-1 : ℤ)

(v : IsDedekindDomain.HeightOneSpectrum R)

∃ π, v.valuation π = ↑(Multiplicative.ofAdd (-1))


theorem add_measure_right {_ : MeasurableSpace α} (μ ν : Measure α)
    (hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C) : DominatedFinMeasAdditive (μ + ν) T C

{α : Type u_1}
{β : Type u_7}
[SeminormedAddCommGroup β]
{T : Set α → β}
{C : ℝ}

∀ {x : MeasurableSpace α} (μ ν : MeasureTheory.Measure α),
  MeasureTheory.DominatedFinMeasAdditive μ T C → 0 ≤ C → MeasureTheory.DominatedFinMeasAdditive (μ + ν) T C


@[to_additive]
theorem Right.self_lt_inv (h : a < 1) : a < a⁻¹

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


@[simp]
theorem T_mul_apply_one (g : SL(2, ℤ)) : ↑ₘ(T * g) 1 = ↑ₘg 1

(g : Matrix.SpecialLinearGroup (Fin 2) ℤ)


theorem posTangentConeAt_mono : Monotone fun s => posTangentConeAt s a

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a : E}


theorem sup_support_mul_le {degb : A → B} (degbm : ∀ {a b}, degb (a + b) ≤ degb a + degb b)
    (f g : R[A]) :
    (f * g).support.sup degb ≤ f.support.sup degb + g.support.sup degb

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

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

(degbm : ∀ {a b : A}, degb (a + b) ≤ degb a + degb b)


theorem toFinsupp_support :
    l.toFinsupp.support = (Finset.range l.length).filter (getD l · 0 ≠ 0)

{M : Type u_1}
[Zero M]
(l : List M)
[DecidablePred fun x => l.getD x 0 ≠ 0]

l.toFinsupp.support = Finset.filter (fun x => l.getD x 0 ≠ 0) (Finset.range l.length)


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

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


theorem limsup_max [ConditionallyCompleteLinearOrder β] {f : Filter α} {u v : α → β}
    (h₁ : f.IsCoboundedUnder (· ≤ ·) u := by isBoundedDefault)
    (h₂ : f.IsCoboundedUnder (· ≤ ·) v := by isBoundedDefault)
    (h₃ : f.IsBoundedUnder (· ≤ ·) u := by isBoundedDefault)
    (h₄ : f.IsBoundedUnder (· ≤ ·) v := by isBoundedDefault) :
    limsup (fun a ↦ max (u a) (v a)) f = max (limsup u f) (limsup v f)

(h₁ : Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) f u := by isBoundedDefault)

(h₂ : Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) f v := by isBoundedDefault)

(h₃ : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f u := by isBoundedDefault)

(h₄ : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f v := by isBoundedDefault)

Filter.limsup (fun a => max (u a) (v a)) f = max (Filter.limsup u f) (Filter.limsup v f)


theorem support_mul [DecidableEq σ] (p q : MvPolynomial σ R) :
    (p * q).support ⊆ p.support + q.support

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[DecidableEq σ]
(p q : MvPolynomial σ R)


lemma mul_inv (a b : EReal) : (a * b)⁻¹ = a⁻¹ * b⁻¹


/--
The comultiplication on the tensor product of two comonoids is
the tensor product of the comultiplications followed by the tensor strength
(to shuffle the factors back into order).
-/
theorem tensorObj_comul (A B : Comon_ C) :
    (A ⊗ B).comul = (A.comul ⊗ B.comul) ≫ tensor_μ C (A.X, A.X) (B.X, B.X)

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

(A ⊗ B).comul = (A.comul ⊗ B.comul) ≫ CategoryTheory.tensor_μ C (A.X, A.X) (B.X, B.X)


protected theorem iSup {κ : Sort*} {f : κ → Ideal A} (h : ∀ i, (f i).IsHomogeneous 𝒜) :
    (⨆ i, f i).IsHomogeneous 𝒜

(h : ∀ (i : κ), Ideal.IsHomogeneous 𝒜 (f i))


theorem disjoint_left {s t : Multiset α} : Disjoint s t ↔ ∀ {a}, a ∈ s → a ∉ t


@[to_additive]
theorem image_mulSingle_Ico_left (i : ι) (a : α i) :
    Pi.mulSingle i '' Ico a 1 = Ico (Pi.mulSingle i a) 1

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

Pi.mulSingle i '' Set.Ico a 1 = Set.Ico (Pi.mulSingle i a) 1


@[simp]
theorem WithTop.iInf_empty [IsEmpty ι] [InfSet α] (f : ι → WithTop α) :
    ⨅ i, f i = ⊤

{α : Type u_1}
{ι : Sort u_4}
[Preorder α]
[IsEmpty ι]
[InfSet α]
(f : ι → WithTop α)


@[simp]
theorem op_eq_zero_iff [Zero α] (a : α) : op a = (0 : αᵐᵒᵖ) ↔ a = (0 : α)


/-- When `p` is prime, then the totient of `p ^ n` is `p ^ (n - 1) * (p - 1)` -/
theorem totient_prime_pow {p : ℕ} (hp : p.Prime) {n : ℕ} (hn : 0 < n) :
    φ (p ^ n) = p ^ (n - 1) * (p - 1)

{p : ℕ}
(hp : Nat.Prime p)
{n : ℕ}
(hn : 0 < n)


/-- Given a bounded bilinear map `f`, the map associating to a point `p` the derivative of `f` at
`p` is itself a bounded linear map. -/
theorem IsBoundedBilinearMap.isBoundedLinearMap_deriv (h : IsBoundedBilinearMap 𝕜 f) :
    IsBoundedLinearMap 𝕜 fun p : E × F => h.deriv p

{𝕜 : 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]
{f : E × F → G}
(h : IsBoundedBilinearMap 𝕜 f)


@[simp]
protected theorem liftOn₂'_mk'' (f : α → β → γ) (h) (a : α) (b : β) :
    Quotient.liftOn₂' (@Quotient.mk'' _ s₁ a) (@Quotient.mk'' _ s₂ b) f h = f a b

(f : α → β → γ)

(h : ∀ (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), Setoid.r a₁ b₁ → Setoid.r a₂ b₂ → f a₁ a₂ = f b₁ b₂)

(Quotient.mk'' a).liftOn₂' (Quotient.mk'' b) f h = f a b


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


@[simp]
theorem Ici_diff_Ioi_same : Ici a \ Ioi a = {a}


/-- The derivative of `x ↦ f (-x)` at `a` is the negative of the derivative of `f` at `-a`. -/
lemma deriv_comp_neg {𝕜 : Type*} [NontriviallyNormedField 𝕜] {F : Type*} [NormedAddCommGroup F]
    [NormedSpace 𝕜 F] (f : 𝕜 → F) (a : 𝕜) : deriv (fun x ↦ f (-x)) a = -deriv f (-a)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : 𝕜 → F)
(a : 𝕜)

deriv (fun x => f (-x)) a = -deriv f (-a)


@[reassoc (attr := simp)]
lemma cyclesMap_i : cyclesMap φ ≫ S₂.iCycles = S₁.iCycles ≫ φ.τ₂

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.cyclesMap φ) S₂.iCycles =
  CategoryTheory.CategoryStruct.comp S₁.iCycles φ.τ₂


theorem eq_zero_of_forall_not_mem {s : Multiset α} : (∀ x, x ∉ s) → s = 0


lemma memPartitionSet_mem (f : ℕ → Set α) (n : ℕ) (a : α) :
    memPartitionSet f n a ∈ memPartition f n

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


lemma HurwitzZeta.completedCosZeta_zero (s : ℂ) :
    completedCosZeta 0 s = completedRiemannZeta s

HurwitzZeta.completedCosZeta 0 s = completedRiemannZeta s


lemma div_div_div_cancel_left' (a b : G₀) (hc : c ≠ 0) : c / a / (c / b) = b / a

{G₀ : Type u_3}
[CommGroupWithZero G₀]
{c : G₀}
(a b : G₀)
(hc : c ≠ 0)


lemma Finitary.sum' (h : ∀ i, (M i).Finitary) : (Matroid.sum' M).Finitary

{α : Type u_1}
{ι : Type u_2}
{M : ι → Matroid α}
(h : ∀ (i : ι), (M i).Finitary)


theorem aestronglyMeasurable_lineDeriv_uncurry (hf : Continuous f) (μ : Measure (E × E)) :
    AEStronglyMeasurable (fun (p : E × E) ↦ lineDeriv 𝕜 f p.1 p.2) μ

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[LocallyCompactSpace 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[MeasurableSpace E]
[OpensMeasurableSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f : E → F}
[SecondCountableTopology E]
(hf : Continuous f)
(μ : MeasureTheory.Measure (E × E))

MeasureTheory.AEStronglyMeasurable (fun p => lineDeriv 𝕜 f p.1 p.2) μ


@[simp]
theorem frobenius_zmodp (x : 𝕎 (ZMod p)) : frobenius x = x

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(x : WittVector p (ZMod p))


@[simp]
theorem id_hom (M : Action V G) : (𝟙 M : Hom M M).hom = 𝟙 M.V

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
(M : Action V G)


theorem isBigO_nat_atTop_iff {f : ℕ → E''} {g : ℕ → F''} (h : ∀ x, g x = 0 → f x = 0) :
    f =O[atTop] g ↔ ∃ C, ∀ x, ‖f x‖ ≤ C * ‖g x‖

{E'' : Type u_9}
{F'' : Type u_10}
[NormedAddCommGroup E'']
[NormedAddCommGroup F'']
{f : ℕ → E''}
{g : ℕ → F''}
(h : ∀ (x : ℕ), g x = 0 → f x = 0)

f =O[Filter.atTop] g ↔ ∃ C, ∀ (x : ℕ), ‖f x‖ ≤ C * ‖g x‖


protected theorem injective : Injective f₁

{R : Type u_1}
{R₂ : Type u_2}
{E₂ : Type u_6}
{F : Type u_9}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E₂]
[Module R₂ E₂]
[NormedAddCommGroup F]
[Module R F]
(f₁ : F →ₛₗᵢ[σ₁₂] E₂)


lemma isIso_p (hf : S.f = 0) : IsIso h.p


theorem mem_center_iff {a : A} : a ∈ center R A ↔ ∀ b : A, b * a = a * b

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{a : A}

a ∈ Subalgebra.center R A ↔ ∀ (b : A), b * a = a * b


/-- The center of the circumsphere is the circumcenter. -/
@[simp]
theorem circumsphere_center {n : ℕ} (s : Simplex ℝ P n) : s.circumsphere.center = s.circumcenter

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P n)


theorem transPartialHomeomorph_eq_trans (e : X ≃ₜ Y) (f' : PartialHomeomorph Y Z) :
    e.transPartialHomeomorph f' = e.toPartialHomeomorph.trans f'

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(e : X ≃ₜ Y)
(f' : PartialHomeomorph Y Z)


@[simp, norm_cast] lemma bot_eq_coe [Bot α] {a : α} : (⊥ : WithTop α) = a ↔ ⊥ = a

⊥ = ↑a ↔ ⊥ = a


theorem Dense.topology_eq_generateFrom [OrderTopology α] [DenselyOrdered α] {s : Set α}
    (hs : Dense s) : ‹TopologicalSpace α› = .generateFrom (Ioi '' s ∪ Iio '' s)

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{s : Set α}
(hs : Dense s)

inst✝ = TopologicalSpace.generateFrom (Set.Ioi '' s ∪ Set.Iio '' s)


@[simp] theorem range'_append_1 (s m n : Nat) :
    range' s m ++ range' (s + m) n = range' s (n + m)

List.range' s m ++ List.range' (s + m) n = List.range' s (n + m)


theorem factors_prod {a : α} (ane0 : a ≠ 0) : Associated (factors a).prod a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
{a : α}
(ane0 : a ≠ 0)

(UniqueFactorizationMonoid.factors a).prod ~ᵤ a


@[simp]
theorem valuation_one : valuation (1 : ℚ_[p]) = 0


@[to_additive] lemma mabs_le_mabs_of_le_one (ha : a ≤ 1) (hab : b ≤ a) : |a|ₘ ≤ |b|ₘ

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

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


theorem denseInducing_pureCauchy : DenseInducing (pureCauchy : α → CauchyFilter α)


@[to_additive]
theorem prod_Icc_succ_top {a b : ℕ} (hab : a ≤ b + 1) (f : ℕ → M) :
    (∏ k in Icc a (b + 1), f k) = (∏ k in Icc a b, f k) * f (b + 1)

{M : Type u_2}
[CommMonoid M]
{a b : ℕ}
(hab : a ≤ b + 1)
(f : ℕ → M)

∏ k ∈ Finset.Icc a (b + 1), f k = (∏ k ∈ Finset.Icc a b, f k) * f (b + 1)


@[simp] lemma toAddMonoid_inj {f g : ∀ i, β i →+ γ} : toAddMonoid f = toAddMonoid g ↔ f = g

{ι : Type v}
{β : ι → Type w}
[(i : ι) → AddCommMonoid (β i)]
[DecidableEq ι]
{γ : Type u₁}
[AddCommMonoid γ]
{f g : (i : ι) → β i →+ γ}

DirectSum.toAddMonoid f = DirectSum.toAddMonoid g ↔ f = g


/-- To give an isomorphism between cocones, it suffices to give an
  isomorphism between their vertices which commutes with the cocone
  maps. -/
-- Porting note: `@[ext]` used to accept lemmas like this. Now we add an aesop rule
@[aesop apply safe (rule_sets := [CategoryTheory]), simps]
def ext {P Q : C} {c c' : BinaryBicone P Q} (φ : c.pt ≅ c'.pt)
    (winl : c.inl ≫ φ.hom = c'.inl := by aesop_cat)
    (winr : c.inr ≫ φ.hom = c'.inr := by aesop_cat)
    (wfst : φ.hom ≫ c'.fst = c.fst := by aesop_cat)
    (wsnd : φ.hom ≫ c'.snd = c.snd := by aesop_cat) : c ≅ c'

{c c' : CategoryTheory.Limits.BinaryBicone P Q}

(CategoryTheory.Limits.BinaryBicones.ext φ winl winr wfst wsnd).hom.hom = φ.hom


theorem Ico_filter_lt_of_le_right [DecidablePred (· < c)] (hcb : c ≤ b) :
    ((Ico a b).filter fun x => x < c) = Ico a c

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b c : α}
[DecidablePred fun x => x < c]
(hcb : c ≤ b)

Multiset.filter (fun x => x < c) (Multiset.Ico a b) = Multiset.Ico a c


theorem cos_add_two_pi (x : ℂ) : cos (x + 2 * π) = cos x

Complex.cos (x + 2 * ↑Real.pi) = Complex.cos x


theorem replicate_succ_to_snoc (val : α) :
    replicate (n+1) val = (replicate n val).snoc val

Mathlib.Vector.replicate (n + 1) val = (Mathlib.Vector.replicate n val).snoc val


@[simp]
theorem lift_comp_ι (g : FreeAlgebra R X →ₐ[R] A) :
    lift R ((g : FreeAlgebra R X → A) ∘ ι R) = g

{R : Type u_1}
[CommSemiring R]
{X : Type u_2}
{A : Type u_3}
[Semiring A]
[Algebra R A]
(g : FreeAlgebra R X →ₐ[R] A)

(FreeAlgebra.lift R) (⇑g ∘ FreeAlgebra.ι R) = g


theorem ext_inner_right {x y : E} (h : ∀ v, ⟪x, v⟫ = ⟪y, v⟫) : x = y

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{x y : E}
(h : ∀ (v : E), ⟪x, v⟫_𝕜 = ⟪y, v⟫_𝕜)


theorem comp_measurable {f : α → δ} {g : δ → β} (hg : AEMeasurable g (μ.map f))
    (hf : Measurable f) : AEMeasurable (g ∘ f) μ

(hg : AEMeasurable g (MeasureTheory.Measure.map f μ))


protected theorem mul_end {f g : Function.End α} {Kf Kg} (hf : LipschitzWith Kf f)
    (hg : LipschitzWith Kg g) : LipschitzWith (Kf * Kg) (f * g : Function.End α)

{α : Type u}
[PseudoEMetricSpace α]
{f g : Function.End α}
{Kf Kg : ℝ≥0}
(hf : LipschitzWith Kf f)
(hg : LipschitzWith Kg g)


/-- The cosine of an angle in a right-angled triangle as a ratio of sides, version subtracting
vectors. -/
theorem cos_oangle_sub_left_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    Real.Angle.cos (o.oangle (x - y) x) = ‖x‖ / ‖x - y‖

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

(o.oangle (x - y) x).cos = ‖x‖ / ‖x - y‖


@[simp]
theorem disjoint_singleton_right : Disjoint s (singleton a) ↔ a ∉ s


/-- Transfer `IsBigO` over a `Homeomorph`. -/
theorem isBigO_congr (e : α ≃ₜ β) {b : β} {f : β → E} {g : β → F} :
    f =O[𝓝 b] g ↔ (f ∘ e) =O[𝓝 (e.symm b)] (g ∘ e)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{E : Type u_3}
[Norm E]
{F : Type u_4}
[Norm F]
(e : α ≃ₜ β)
{b : β}
{f : β → E}
{g : β → F}

f =O[𝓝 b] g ↔ (f ∘ ⇑e) =O[𝓝 (e.symm b)] (g ∘ ⇑e)


theorem map_comp {g : β → γ} {f : α → β} (hg : UniformContinuous g) (hf : UniformContinuous f) :
    Completion.map g ∘ Completion.map f = Completion.map (g ∘ f)

{α : Type u_1}
[UniformSpace α]
{β : Type u_2}
[UniformSpace β]
{γ : Type u_3}
[UniformSpace γ]
{g : β → γ}
{f : α → β}
(hg : UniformContinuous g)
(hf : UniformContinuous f)

UniformSpace.Completion.map g ∘ UniformSpace.Completion.map f = UniformSpace.Completion.map (g ∘ f)


@[simp]
theorem conjTranspose_natCast_smul [Semiring R] [AddCommMonoid α] [StarAddMonoid α] [Module R α]
    (c : ℕ) (M : Matrix m n α) : ((c : R) • M)ᴴ = (c : R) • Mᴴ

{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
{α : Type v}
[Semiring R]
[AddCommMonoid α]
[StarAddMonoid α]
[Module R α]
(c : ℕ)
(M : Matrix m n α)


lemma lt_pred_iff : a < pred b ↔ succ a < b


theorem trans_range {a b c : X} (γ₁ : Path a b) (γ₂ : Path b c) :
    range (γ₁.trans γ₂) = range γ₁ ∪ range γ₂

{X : Type u_1}
[TopologicalSpace X]
{a b c : X}
(γ₁ : Path a b)
(γ₂ : Path b c)

Set.range ⇑(γ₁.trans γ₂) = Set.range ⇑γ₁ ∪ Set.range ⇑γ₂


theorem surjective_rangeRestrict : Surjective f.rangeRestrict

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
(f : M →ₛₗ[τ₁₂] M₂)


/-- If a function admits a power series expansion at `x`, then it is the locally uniform limit of
the partial sums of this power series on the disk of convergence, i.e., `f y`
is the locally uniform limit of `p.partialSum n (y - x)` there. -/
theorem HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' (hf : HasFPowerSeriesOnBall f p x r) :
    TendstoLocallyUniformlyOn (fun n y => p.partialSum n (y - x)) f atTop
      (EMetric.ball (x : E) r)

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

TendstoLocallyUniformlyOn (fun n y => p.partialSum n (y - x)) f Filter.atTop (EMetric.ball x r)


theorem ofEven_comp_toEven : (ofEven Q).comp (toEven Q) = AlgHom.id R _

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)

(CliffordAlgebra.ofEven Q).comp (CliffordAlgebra.toEven Q) = AlgHom.id R (CliffordAlgebra Q)


@[ext]
lemma hom_ext {Φ : yoneda.LeftExtension (F ⋙ yoneda)}
    (f g : Functor.LeftExtension.mk F.op.lan (compYonedaIsoYonedaCompLan F).hom ⟶ Φ) :
    f = g

[∀ (P : CategoryTheory.Functor Cᵒᵖ (Type v₁)), F.op.HasLeftKanExtension P]

{Φ : CategoryTheory.yoneda.LeftExtension (F.comp CategoryTheory.yoneda)}

(f g : CategoryTheory.Functor.LeftExtension.mk F.op.lan (CategoryTheory.Presheaf.compYonedaIsoYonedaCompLan F).hom ⟶ Φ)


lemma diffs_subset : s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ \\ t₁ ⊆ s₂ \\ t₂

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

s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁.diffs t₁ ⊆ s₂.diffs t₂


/-- An `Invertible` element is a unit. -/
@[simps]
def unitOfInvertible [Monoid α] (a : α) [Invertible a] : αˣ

{α : Type u}
[Monoid α]
(a : α)
[Invertible a]


/--
The `R`-linear equivalence between additive morphisms `A →+ B` and `ℕ`-linear morphisms `A →ₗ[ℕ] B`.
-/
@[simps]
def addMonoidHomLequivNat {A B : Type*} (R : Type*) [Semiring R] [AddCommMonoid A]
    [AddCommMonoid B] [Module R B] : (A →+ B) ≃ₗ[R] A →ₗ[ℕ] B

{A : Type u_17}
{B : Type u_18}
(R : Type u_19)
[Semiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[Module R B]
(f : A →+ B)

(addMonoidHomLequivNat R) f = f.toNatLinearMap


@[simp]
theorem union_self (a : Set α) : a ∪ a = a


@[to_additive (attr := simp)]
theorem smul_orbit (g : G) (a : α) : g • orbit G a = orbit G a

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
(g : G)
(a : α)

g • MulAction.orbit G a = MulAction.orbit G a


/-- Multiplication as a monoid homomorphism. -/
@[to_additive (attr := simps) "Addition as an additive monoid homomorphism."]
def mulMonoidHom [CommMonoid α] : α × α →* α

∀ (a : α × α), addAddMonoidHom a = addAddHom.toFun a


theorem isCobounded_iff_closedBall_compl_subset {s : Set α} (c : α) :
    IsCobounded s ↔ ∃ (r : ℝ), (Metric.closedBall c r)ᶜ ⊆ s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(c : α)

Bornology.IsCobounded s ↔ ∃ r, (Metric.closedBall c r)ᶜ ⊆ s


@[to_additive]
protected theorem div_mul_div_comm (hbd : Commute b d) (hbc : Commute b⁻¹ c) :
    a / b * (c / d) = a * c / (b * d)

{G : Type u_1}
[SubtractionMonoid G]
{a b c d : G}
(hbd : AddCommute b d)
(hbc : AddCommute (-b) c)


@[simp]
theorem lift_symm_apply (F : FreeAlgebra R X →ₐ[R] A) : (lift R).symm F = F ∘ ι R

(R : Type u_1)
[CommSemiring R]
{X : Type u_2}
{A : Type u_3}
[Semiring A]
[Algebra R A]
(F : FreeAlgebra R X →ₐ[R] A)

(FreeAlgebra.lift R).symm F = ⇑F ∘ FreeAlgebra.ι R


theorem traceMatrix_of_matrix_vecMul [Fintype κ] (b : κ → B) (P : Matrix κ κ A) :
    traceMatrix A (b ᵥ* P.map (algebraMap A B)) = Pᵀ * traceMatrix A b * P

{κ : Type w}
{A : Type u}
{B : Type v}
[CommRing A]
[CommRing B]
[Algebra A B]
[Fintype κ]
(b : κ → B)
(P : Matrix κ κ A)

Algebra.traceMatrix A (b ᵥ* P.map ⇑(algebraMap A B)) = Pᵀ * Algebra.traceMatrix A b * P


theorem of'_eq_of [AddZeroClass G] (a : G) : of' k G a = of k G (.ofAdd a)

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[AddZeroClass G]
(a : G)

AddMonoidAlgebra.of' k G a = (AddMonoidAlgebra.of k G) (Multiplicative.ofAdd a)


@[simp]
theorem moveRight_nim' {o : Ordinal} (i) : (nim o).moveRight i = nim (toRightMovesNim.symm i).val

(i : (SetTheory.PGame.nim o).RightMoves)

(SetTheory.PGame.nim o).moveRight i = SetTheory.PGame.nim ↑(SetTheory.PGame.toRightMovesNim.symm i)


@[simp]
theorem id_comp : (AlgHom.id R B).comp φ = φ

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(φ : A →ₐ[R] B)


/-- If `f` is a monomorphism, then `(𝟙 _, 𝟙 _)` is a kernel pair for `f`. -/
theorem id_of_mono [Mono f] : IsKernelPair f (𝟙 _) (𝟙 _)

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

CategoryTheory.IsKernelPair f (CategoryTheory.CategoryStruct.id X) (CategoryTheory.CategoryStruct.id X)


@[simp]
theorem pred_singleton {m : ℕ} (h : 0 < m) : Ico (m - 1) m = [m - 1]


theorem tendsto_symm {x} (hx : x ∈ e.source) : Tendsto e.symm (𝓝 (e x)) (𝓝 x)

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

Filter.Tendsto (↑e.symm) (𝓝 (↑e x)) (𝓝 x)


@[to_additive]
lemma orbitRel.Quotient.orbit_injective :
    Injective (orbitRel.Quotient.orbit : orbitRel.Quotient G α → Set α)

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


/-- The chosen kernels and cokernels of the limits API give a `LeftHomologyData` -/
@[simps]
noncomputable def ofHasKernelOfHasCokernel
    [HasKernel S.g] [HasCokernel (kernel.lift S.g S.f S.zero)] :
    S.LeftHomologyData

[CategoryTheory.Limits.HasCokernel (CategoryTheory.Limits.kernel.lift S.g S.f ⋯)]

(CategoryTheory.ShortComplex.LeftHomologyData.ofHasKernelOfHasCokernel S).H =
  CategoryTheory.Limits.cokernel (CategoryTheory.Limits.kernel.lift S.g S.f ⋯)


theorem withTopEquiv_symm_ofNat (n : Nat) [n.AtLeastTwo] :
    withTopEquiv.symm (no_index (OfNat.ofNat n)) = OfNat.ofNat n

PartENat.withTopEquiv.symm (OfNat.ofNat n) = OfNat.ofNat n


@[simp]
theorem copy_rfl_rfl {u v} (p : G.Walk u v) : p.copy rfl rfl = p

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


/-- Symmetric statement to `Option.map_map₂_antidistrib_right`. -/
theorem map_map₂_right_anticomm {f : α → β' → γ} {g : β → β'} {f' : β → α → δ} {g' : δ → γ}
    (h_right_anticomm : ∀ a b, f a (g b) = g' (f' b a)) :
    map₂ f a (b.map g) = (map₂ f' b a).map g'

{f : α → β' → γ}

{f' : β → α → δ}

(h_right_anticomm : ∀ (a : α) (b : β), f a (g b) = g' (f' b a))

Option.map₂ f a (Option.map g b) = Option.map g' (Option.map₂ f' b a)