/-- A function is `C^n` at a point, for `n : ℕ`, if and only if it is `C^n` on
a neighborhood of this point. -/
theorem contMDiffAt_iff_contMDiffOn_nhds {n : ℕ} :
    ContMDiffAt I I' n f x ↔ ∃ u ∈ 𝓝 x, ContMDiffOn I I' n f u

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

ContMDiffAt I I' (↑n) f x ↔ ∃ u ∈ 𝓝 x, ContMDiffOn I I' (↑n) f u


/-- 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 {c c' : Cocone F} (φ : c.pt ≅ c'.pt)
    (w : ∀ j, c.ι.app j ≫ φ.hom = c'.ι.app j := by aesop_cat) : c ≅ c'

(w : ∀ (j : J), c.ι.app j ≫ φ.hom = c'.ι.app j := by aesop_cat)

(CategoryTheory.Limits.Cocones.ext φ w).inv.hom = φ.inv


theorem getLsb_ofNat (n : Nat) (x : Nat) (i : Nat) :
  getLsb (BitVec.ofNat n x) i = (i < n && x.testBit i)

(BitVec.ofNat n x).getLsb i = (decide (i < n) && x.testBit i)


/-- If the diagonal morphism of `A` is an isomorphism, then it is subterminal.
The converse of `isSubterminal.isIso_diag`.
-/
theorem isSubterminal_of_isIso_diag [HasBinaryProduct A A] [IsIso (diag A)] : IsSubterminal A


@[to_additive sum_le_sum_fiberwise_of_sum_fiber_nonpos]
theorem prod_le_prod_fiberwise_of_prod_fiber_le_one' {t : Finset ι'} {g : ι → ι'} {f : ι → N}
    (h : ∀ y ∉ t, ∏ x ∈ s.filter fun x ↦ g x = y, f x ≤ 1) :
    ∏ x ∈ s, f x ≤ ∏ y ∈ t, ∏ x ∈ s.filter fun x ↦ g x = y, f x

(h : ∀ y ∉ t, ∑ x ∈ Finset.filter (fun x => g x = y) s, f x ≤ 0)

∑ x ∈ s, f x ≤ ∑ y ∈ t, ∑ x ∈ Finset.filter (fun x => g x = y) s, f x


@[to_additive (attr := simp)] lemma isUnit_pow_iff (hn : n ≠ 0) : IsUnit (a ^ n) ↔ IsUnit a

{M : Type u_1}
[AddMonoid M]
{n : ℕ}
{a : M}
(hn : n ≠ 0)


@[to_additive (attr := simp)]
theorem inl_apply (x) : inl M N x = (x, 1)

{M : Type u_5}
{N : Type u_6}
[MulOneClass M]
[MulOneClass N]
(x : M)


theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1)

(hrec : ∀ (ps : PFunctor.Approx.Path F), n = List.length ps → PFunctor.M.iselect ps x = PFunctor.M.iselect ps y)


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofLex_smul']
theorem pow_ofLex [Pow α β] (a : α) (b : Lex β) : a ^ ofLex b = a ^ b

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


@[to_additive]
theorem apply_coe_mem_map (f : M →ₙ* N) (S : Subsemigroup M) (x : S) : f x ∈ S.map f

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(f : AddHom M N)
(S : AddSubsemigroup M)
(x : ↥S)


theorem tendsto_abs_nhdsWithin_zero : Tendsto (abs : G → G) (𝓝[≠] 0) (𝓝[>] 0)

{G : Type u_2}
[TopologicalSpace G]
[LinearOrderedAddCommGroup G]
[OrderTopology G]


theorem HasBasis.prod {ι ι' : Type*} {pa : ι → Prop} {sa : ι → Set α} {pb : ι' → Prop}
    {sb : ι' → Set β} (hla : la.HasBasis pa sa) (hlb : lb.HasBasis pb sb) :
    (la ×ˢ lb).HasBasis (fun i : ι × ι' => pa i.1 ∧ pb i.2) fun i => sa i.1 ×ˢ sb i.2

{α : Type u_1}
{β : Type u_2}
{la : Filter α}
{lb : Filter β}
{ι : Type u_6}
{ι' : Type u_7}
{pa : ι → Prop}
{sa : ι → Set α}
{pb : ι' → Prop}
{sb : ι' → Set β}
(hla : la.HasBasis pa sa)
(hlb : lb.HasBasis pb sb)

(la ×ˢ lb).HasBasis (fun i => pa i.1 ∧ pb i.2) fun i => sa i.1 ×ˢ sb i.2


/-- The **Dyson e-transform**. Turns `(s, t)` into `(s ∪ e • t, t ∩ e⁻¹ • s)`. This reduces the
product of the two sets. -/
@[to_additive (attr := simps) "The **Dyson e-transform**.
Turns `(s, t)` into `(s ∪ e +ᵥ t, t ∩ -e +ᵥ s)`. This reduces the sum of the two sets."]
def mulDysonETransform : Finset α × Finset α

{α : Type u_1}
[DecidableEq α]
[AddCommGroup α]
(e : α)
(x : Finset α × Finset α)

(Finset.addDysonETransform e x).1 = x.1 ∪ (e +ᵥ x.2)


@[to_additive le_prod_iff]
theorem le_prod_iff {H : Subgroup G} {K : Subgroup N} {J : Subgroup (G × N)} :
    J ≤ H.prod K ↔ map (MonoidHom.fst G N) J ≤ H ∧ map (MonoidHom.snd G N) J ≤ K

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{H : AddSubgroup G}
{K : AddSubgroup N}
{J : AddSubgroup (G × N)}

J ≤ H.prod K ↔ AddSubgroup.map (AddMonoidHom.fst G N) J ≤ H ∧ AddSubgroup.map (AddMonoidHom.snd G N) J ≤ K


/-- A morphism of schemes `X ⟶ Y` is affine if
the preimage of any affine open subset of `Y` is affine. -/
@[mk_iff]
class IsAffineHom {X Y : Scheme} (f : X ⟶ Y) : Prop where
  isAffine_preimage : ∀ U : Y.Opens, IsAffineOpen U → IsAffineOpen (f ⁻¹ᵁ U)

[self : AlgebraicGeometry.IsAffineHom f]

AlgebraicGeometry.IsAffineOpen U → AlgebraicGeometry.IsAffineOpen ((TopologicalSpace.Opens.map f.val.base).obj U)


theorem inclusion_right {S T : NonUnitalStarSubalgebra R A} (h : S ≤ T) (x : T) (m : (x : A) ∈ S) :
    inclusion h ⟨x, m⟩ = x

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
{S T : NonUnitalStarSubalgebra R A}
(h : S ≤ T)
(x : ↥T)
(m : ↑x ∈ S)

(NonUnitalStarSubalgebra.inclusion h) ⟨↑x, m⟩ = x


theorem quotient_nhd_basis (S : AddSubgroup M) :
    (𝓝 (0 : M ⧸ S)).HasBasis (fun ε ↦ 0 < ε) fun ε ↦ { x | ‖x‖ < ε }

{M : Type u_1}
[SeminormedAddCommGroup M]
(S : AddSubgroup M)

(𝓝 0).HasBasis (fun ε => 0 < ε) fun ε => {x | ‖x‖ < ε}


/-- A morphism of triangles `(X,Y,Z,f,g,h) ⟶ (X',Y',Z',f',g',h')` in `C` is a triple of morphisms
`a : X ⟶ X'`, `b : Y ⟶ Y'`, `c : Z ⟶ Z'` such that
`a ≫ f' = f ≫ b`, `b ≫ g' = g ≫ c`, and `a⟦1⟧' ≫ h = h' ≫ c`.
In other words, we have a commutative diagram:
```
     f      g      h
  X  ───> Y  ───> Z  ───> X⟦1⟧
  │       │       │        │
  │a      │b      │c       │a⟦1⟧'
  V       V       V        V
  X' ───> Y' ───> Z' ───> X'⟦1⟧
     f'     g'     h'
```
See <https://stacks.math.columbia.edu/tag/0144>.
-/
@[ext]
structure TriangleMorphism (T₁ : Triangle C) (T₂ : Triangle C) where
  /-- the first morphism in a triangle morphism -/
  hom₁ : T₁.obj₁ ⟶ T₂.obj₁
  /-- the second morphism in a triangle morphism -/
  hom₂ : T₁.obj₂ ⟶ T₂.obj₂
  /-- the third morphism in a triangle morphism -/
  hom₃ : T₁.obj₃ ⟶ T₂.obj₃
  /-- the first commutative square of a triangle morphism -/
  comm₁ : T₁.mor₁ ≫ hom₂ = hom₁ ≫ T₂.mor₁ := by aesop_cat
  /-- the second commutative square of a triangle morphism -/
  comm₂ : T₁.mor₂ ≫ hom₃ = hom₂ ≫ T₂.mor₂ := by aesop_cat
  /-- the third commutative square of a triangle morphism -/
  comm₃ : T₁.mor₃ ≫ hom₁⟦1⟧' = hom₃ ≫ T₂.mor₃ := by aesop_cat

{T₁ T₂ : CategoryTheory.Pretriangulated.Triangle C}

(self : CategoryTheory.Pretriangulated.TriangleMorphism T₁ T₂)

T₁.mor₂ ≫ self.hom₃ = self.hom₂ ≫ T₂.mor₂


@[simp]
theorem irreducible_mul_leadingCoeff_inv {p : K[X]} :
    Irreducible (p * C (leadingCoeff p)⁻¹) ↔ Irreducible p

{K : Type u_1}
[DivisionRing K]
{p : K[X]}

Irreducible (p * Polynomial.C p.leadingCoeff⁻¹) ↔ Irreducible p


/-- The functions satisfying a local predicate satisfy the sheaf condition.
-/
theorem isSheaf (P : LocalPredicate T) : (subpresheafToTypes P.toPrelocalPredicate).IsSheaf

{X : TopCat}
{T : ↑X → Type v}
(P : TopCat.LocalPredicate T)


@[simp]
theorem toAffineIsometryEquiv_toAffineEquiv :
    e.toAffineIsometryEquiv.toAffineEquiv = e.toLinearEquiv.toAffineEquiv

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
(e : V ≃ₗᵢ[𝕜] V₂)


theorem nadd_le_nadd_left (h : b ≤ c) (a) : a ♯ b ≤ a ♯ c

{b c : Ordinal.{u}}
(h : b ≤ c)
(a : Ordinal.{u})


theorem max_eq_right {a b : α} (h : a ≤ b) : max a b = b

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


@[simp]
theorem ofNat_lt_ofNat {m n : ℕ} [NeZero m] [NeZero n] :
    (no_index (OfNat.ofNat m) : ℕ+) < no_index (OfNat.ofNat n) ↔ OfNat.ofNat m < OfNat.ofNat n

OfNat.ofNat m < OfNat.ofNat n ↔ OfNat.ofNat m < OfNat.ofNat n


@[simp]
theorem graph_zero : graph (0 : α →₀ M) = ∅


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

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
{x : α}
{y : β}
(hx : x ∈ e.source)
(hy : y ∈ e.target)


@[elementwise (attr := simp)]
theorem glue_condition (i j : D.J) : D.t i j ≫ D.f j i ≫ D.ι j = D.f i j ≫ D.ι i

CategoryTheory.CategoryStruct.comp (D.t i j) (CategoryTheory.CategoryStruct.comp (D.f j i) (D.ι j)) =
  CategoryTheory.CategoryStruct.comp (D.f i j) (D.ι i)


theorem range_pullback_fst_of_right :
    Set.range (pullback.fst g f).1.base =
      ((Opens.map g.1.base).obj ⟨Set.range f.1.base, H.base_open.isOpen_range⟩).1

[H : AlgebraicGeometry.IsOpenImmersion f]

Set.range ⇑(CategoryTheory.Limits.pullback.fst g f).val.base =
  ((TopologicalSpace.Opens.map g.val.base).obj { carrier := Set.range ⇑f.val.base, is_open' := ⋯ }).carrier


protected lemma continuousOn (hf : LocallyLipschitzOn s f) : ContinuousOn f s

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
{s : Set α}
(hf : LocallyLipschitzOn s f)


@[continuity]
theorem continuous_symm : Continuous I.symm

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


@[simp]
theorem nil_append (s : Seq α) : append nil s = s


theorem neg_eq_not_add (x : BitVec w) : -x = ~~~x + 1


/-- Forgetting the sheaf condition is a functor from `SheafedSpace C` to `PresheafedSpace C`. -/
@[simps! obj map]
def forgetToPresheafedSpace : SheafedSpace C ⥤ PresheafedSpace C

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

∀
  {X Y :
    CategoryTheory.InducedCategory (AlgebraicGeometry.PresheafedSpace C)
      AlgebraicGeometry.SheafedSpace.toPresheafedSpace}
  (f : X ⟶ Y), AlgebraicGeometry.SheafedSpace.forgetToPresheafedSpace.map f = f


lemma commProb_odd {n : ℕ} (hn : Odd n) :
    commProb (DihedralGroup n) = (n + 3) / (4 * n)

commProb (DihedralGroup n) = (↑n + 3) / (4 * ↑n)


theorem mem_sInf {S : Set (NonUnitalSubring R)} {x : R} : x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p

{R : Type u}
[NonUnitalNonAssocRing R]
{S : Set (NonUnitalSubring R)}
{x : R}


/-- A 1-hypercover in `C` is preserved by a functor `F : C ⥤ D` if the mapped 1-pre-hypercover
in `D` is a 1-hypercover for the given topology on `D`. -/
class IsPreservedBy (F : C ⥤ D) (K : GrothendieckTopology D) : Prop where
  mem₀ : (E.toPreOneHypercover.map F).sieve₀ ∈ K (F.obj X)
  mem₁ (i₁ i₂ : E.I₀) ⦃W : D⦄ (p₁ : W ⟶ F.obj (E.X i₁)) (p₂ : W ⟶ F.obj (E.X i₂))
    (w : p₁ ≫ F.map (E.f i₁) = p₂ ≫ F.map (E.f i₂)) :
      (E.toPreOneHypercover.map F).sieve₁ p₁ p₂ ∈ K W

{J : CategoryTheory.GrothendieckTopology C}

{K : CategoryTheory.GrothendieckTopology D}


@[simp]
theorem nhds_bind_nhds : (𝓝 x).bind 𝓝 = 𝓝 x

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


/-- The "identity" functor from `AsType α` to `ObjAsType α`. -/
@[simps]
noncomputable def asTypeToObjAsType : AsType α ⥤ ObjAsType α

{X Y : CategoryTheory.FinCategory.AsType α}

(CategoryTheory.FinCategory.asTypeToObjAsType α).map a = (Fintype.equivFin (X ⟶ Y)).symm a


/-- If `a ^ n = 1`, `n ≠ 0`, then `a` is a unit. -/
@[to_additive (attr := simps!) "If `n • x = 0`, `n ≠ 0`, then `x` is an additive unit."]
def Units.ofPowEqOne (a : M) (n : ℕ) (ha : a ^ n = 1) (hn : n ≠ 0) : Mˣ

{M : Type u_1}
[AddMonoid M]
(a : M)
(n : ℕ)
(ha : n • a = 0)
(hn : n ≠ 0)

↑(-AddUnits.ofNSMulEqZero a n ha hn) = (n - 1) • a


theorem mem_of_mem_tail (v : Vector α n) (ha : a ∈ v.tail.toList) : a ∈ v.toList

{α : Type u_1}
{n : ℕ}
(a : α)
(v : Mathlib.Vector α n)
(ha : a ∈ v.tail.toList)


@[simp]
protected theorem compl_inf (s : Finset ι) (f : ι → α) : (s.inf f)ᶜ = s.sup fun i => (f i)ᶜ

{α : Type u_2}
{ι : Type u_5}
[BooleanAlgebra α]
(s : Finset ι)
(f : ι → α)


/-- The ideal of `A ⊗[R] B` generated by `I` is the image of `I ⊗[R] B` -/
lemma Ideal.map_includeLeft_eq (I : Ideal A) :
    (I.map (Algebra.TensorProduct.includeLeft : A →ₐ[R] A ⊗[R] B)).restrictScalars R
      = LinearMap.range (LinearMap.rTensor B (Submodule.subtype (I.restrictScalars R)))

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
{B : Type u_3}
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(I : Ideal A)

Submodule.restrictScalars R (Ideal.map Algebra.TensorProduct.includeLeft I) =
  LinearMap.range (LinearMap.rTensor B (Submodule.restrictScalars R I).subtype)


@[simp]
lemma centralizer_centralizer_centralizer {s : Set A} :
    centralizer R s.centralizer.centralizer = centralizer R s

(R : Type u)
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{s : Set A}

Subalgebra.centralizer R s.centralizer.centralizer = Subalgebra.centralizer R s


@[simp] lemma factorization_ceilRoot (n a : ℕ) :
    (ceilRoot n a).factorization = a.factorization ⌈/⌉ n

(n.ceilRoot a).factorization = a.factorization ⌈/⌉ n


theorem Bornology.IsBounded.image [Bornology α] [Bornology β] [LocallyBoundedMapClass F α β] (f : F)
    {s : Set α} (hs : IsBounded s) : IsBounded (f '' s)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[FunLike F α β]
[Bornology α]
[Bornology β]
[LocallyBoundedMapClass F α β]
(f : F)
{s : Set α}
(hs : Bornology.IsBounded s)


@[to_additive]
lemma isSquare_unop_iff {a : αᵐᵒᵖ} : IsSquare (unop a) ↔ IsSquare a


lemma of_neZero_natCast (R) [AddMonoidWithOne R] {n : ℕ} [h : NeZero (n : R)] : NeZero n

(R : Type u_1)
[AddMonoidWithOne R]
{n : ℕ}
[h : NeZero ↑n]


@[to_additive]
theorem div_eq_inv_mul : a / b = b⁻¹ * a

{α : Type u_1}
[DivisionCommMonoid α]
(a b : α)


@[simp]
theorem sub_right : Commute a b → Commute a c → Commute a (b - c)

{R : Type x}
[NonUnitalNonAssocRing R]
{a b c : R}


theorem card_eq_coe_natCard (α : Type*) [Finite α] : card α = Nat.card α


theorem Real.ball_eq_Ioo (x r : ℝ) : ball x r = Ioo (x - r) (x + r)

Metric.ball x r = Set.Ioo (x - r) (x + r)


@[to_additive addOrderOf_nsmul_eq_zero]
theorem pow_orderOf_eq_one (x : G) : x ^ orderOf x = 1


theorem toIcoMod_eventuallyEq_toIocMod : toIcoMod hp a =ᶠ[𝓝 x] toIocMod hp a

{𝕜 : Type u_1}
[LinearOrderedAddCommGroup 𝕜]
[Archimedean 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{p : 𝕜}
(hp : 0 < p)
(a : 𝕜)
{x : 𝕜}
(hx : ↑x ≠ ↑a)


@[simp] theorem modifyNth_nil (f : α → α) (n) : [].modifyNth f n = []


/-- The `n`-th iterated derivative within a set with unique derivatives can be obtained by
iterating `n` times the differentiation operation. -/
theorem iteratedDerivWithin_eq_iterate {x : 𝕜} (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) :
    iteratedDerivWithin n f s x = (fun g : 𝕜 → F => derivWithin g s)^[n] f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}
{s : Set 𝕜}
{x : 𝕜}
(hs : UniqueDiffOn 𝕜 s)
(hx : x ∈ s)

iteratedDerivWithin n f s x = (fun g => derivWithin g s)^[n] f x


@[to_additive (attr := ext)]
theorem CommGroup.ext {G : Type*} ⦃g₁ g₂ : CommGroup G⦄ (h_mul : g₁.mul = g₂.mul) : g₁ = g₂

{G : Type u_1}
⦃g₁ g₂ : AddCommGroup G⦄
(h_mul : Add.add = Add.add)


theorem filter_range_nth_subset_insert (k : ℕ) :
    (range (nth p (k + 1))).filter p ⊆ insert (nth p k) ((range (nth p k)).filter p)

(p : ℕ → Prop)
[DecidablePred p]
(k : ℕ)

Finset.filter p (Finset.range (Nat.nth p (k + 1))) ⊆ insert (Nat.nth p k) (Finset.filter p (Finset.range (Nat.nth p k)))


@[simp]
theorem cospanExt_app_left : (cospanExt iX iY iZ wf wg).app WalkingCospan.left = iX

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z X' Y' Z' : C}
(iX : X ≅ X')
(iY : Y ≅ Y')
(iZ : Z ≅ Z')
{f : X ⟶ Z}
{g : Y ⟶ Z}
{f' : X' ⟶ Z'}
{g' : Y' ⟶ Z'}
(wf : iX.hom ≫ f' = f ≫ iZ.hom)
(wg : iY.hom ≫ g' = g ≫ iZ.hom)

(CategoryTheory.Limits.cospanExt iX iY iZ wf wg).app CategoryTheory.Limits.WalkingCospan.left = iX


@[simp]
theorem apply_of_col_ne (i i' : m) {j j' : n} (hj : j ≠ j') (a : α) :
    stdBasisMatrix i j a i' j' = 0

{m : Type u_2}
{n : Type u_3}
{α : Type u_5}
[DecidableEq m]
[DecidableEq n]
[Semiring α]
(i i' : m)
{j j' : n}
(hj : j ≠ j')
(a : α)


/-- If `α i` has a faithful scalar action for a given `i`, then so does `Π i, α i`. This is
not an instance as `i` cannot be inferred. -/
@[to_additive
"If `α i` has a faithful additive action for a given `i`, then
so does `Π i, α i`. This is not an instance as `i` cannot be inferred"]
lemma faithfulSMul_at [∀ i, SMul M (α i)] [∀ i, Nonempty (α i)] (i : ι) [FaithfulSMul M (α i)] :
    FaithfulSMul M (∀ i, α i)

{ι : Type u_1}
{M : Type u_2}
{α : ι → Type u_4}
[(i : ι) → SMul M (α i)]
[∀ (i : ι), Nonempty (α i)]
(i : ι)
[FaithfulSMul M (α i)]


@[simp] theorem msb_zero_length (x : BitVec 0) : x.msb = false


/-- A lower-left subblock of the inverse of a block-triangular matrix is zero. This is a first step
towards `BlockTriangular.inv_toBlock` below. -/
theorem toBlock_inverse_eq_zero [LinearOrder α] [Invertible M] (hM : BlockTriangular M b) (k : α) :
    (M⁻¹.toBlock (fun i => k ≤ b i) fun i => b i < k) = 0

{α : Type u_1}
{m : Type u_3}
{R : Type v}
[CommRing R]
{M : Matrix m m R}
{b : m → α}
[DecidableEq m]
[Fintype m]
[LinearOrder α]
[Invertible M]
(hM : M.BlockTriangular b)
(k : α)


@[reassoc (attr := simp)]
theorem tensor_inv_hom_id' {V W X Y Z : C} (f : V ⟶ W) [IsIso f] (g : X ⟶ Y) (h : Y ⟶ Z) :
    (g ⊗ inv f) ≫ (h ⊗ f) = (g ⊗ 𝟙 W) ≫ (h ⊗ 𝟙 W)

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.tensorHom g (CategoryTheory.inv f))
    (CategoryTheory.MonoidalCategory.tensorHom h f) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.tensorHom g (CategoryTheory.CategoryStruct.id W))
    (CategoryTheory.MonoidalCategory.tensorHom h (CategoryTheory.CategoryStruct.id W))


theorem Iio_ofDual (a : αᵒᵈ) : Iio (ofDual a) = (Ioi a).map ofDual.toEmbedding

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

Finset.Iio (OrderDual.ofDual a) = Finset.map OrderDual.ofDual.toEmbedding (Finset.Ioi a)


/-- To rewrite from right to left, use `Monotone.map_finset_min'`. -/
@[simp]
theorem min'_image [LinearOrder β] {f : α → β} (hf : Monotone f) (s : Finset α)
    (h : (s.image f).Nonempty) : (s.image f).min' h = f (s.min' h.of_image)

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[LinearOrder β]
{f : α → β}
(hf : Monotone f)
(s : Finset α)
(h : (Finset.image f s).Nonempty)

(Finset.image f s).min' h = f (s.min' ⋯)


/-- **Phragmen-Lindelöf principle** in the first quadrant. Let `f : ℂ → E` be a function such that

* `f` is differentiable in the open first quadrant and is continuous on its closure;
* `‖f z‖` is bounded from above by `A * exp(B * (abs z) ^ c)` on the open first quadrant
  for some `A`, `B`, and `c < 2`;
* `f` is equal to zero on the boundary of the first quadrant.

Then `f` is equal to zero on the closed first quadrant. -/
theorem eq_zero_on_quadrant_I (hd : DiffContOnCl ℂ f (Ioi 0 ×ℂ Ioi 0))
    (hB : ∃ c < (2 : ℝ), ∃ B,
      f =O[cobounded ℂ ⊓ 𝓟 (Ioi 0 ×ℂ Ioi 0)] fun z => expR (B * abs z ^ c))
    (hre : ∀ x : ℝ, 0 ≤ x → f x = 0) (him : ∀ x : ℝ, 0 ≤ x → f (x * I) = 0) :
    EqOn f 0 {z | 0 ≤ z.re ∧ 0 ≤ z.im}

(hd : DiffContOnCl ℂ f (Set.Ioi 0 ×ℂ Set.Ioi 0))

(hB : ∃ c < 2, ∃ B, f =O[Bornology.cobounded ℂ ⊓ 𝓟 (Set.Ioi 0 ×ℂ Set.Ioi 0)] fun z => expR (B * Complex.abs z ^ c))

(him : ∀ (x : ℝ), 0 ≤ x → f (↑x * Complex.I) = 0)


theorem get_swap' (a : Array α) (i j : Fin a.size) (k : Nat) (hk' : k < (a.swap i j).size) :
    (a.swap i j)[k] = if k = i then a[j] else if k = j then a[i] else a[k]'(by simp_all)

{α : Type u_1}
(a : Array α)
(i j : Fin a.size)
(k : Nat)
(hk' : k < (a.swap i j).size)

(a.swap i j)[k] = if k = ↑i then a[j] else if k = ↑j then a[i] else a[k]


theorem frequently_curry_iff {α β : Type*} {l : Filter α} {m : Filter β}
    (p : (α × β) → Prop) : (∃ᶠ x in l.curry m, p x) ↔ ∃ᶠ x in l, ∃ᶠ y in m, p (x, y)

{α : Type u_4}
{β : Type u_5}
{l : Filter α}
{m : Filter β}
(p : α × β → Prop)

(∃ᶠ (x : α × β) in l.curry m, p x) ↔ ∃ᶠ (x : α) in l, ∃ᶠ (y : β) in m, p (x, y)


@[simp]
theorem traceForm_apply (x y : S) : traceForm R S x y = trace R S (x * y)

(R : Type u_1)
{S : Type u_2}
[CommRing R]
[CommRing S]
[Algebra R S]
(x y : S)

((Algebra.traceForm R S) x) y = (Algebra.trace R S) (x * y)


/-- The equivalence `Karoubi (CochainComplex C α) ≌ CochainComplex (Karoubi C) α`. -/
@[simps!]
def karoubiCochainComplexEquivalence :
    Karoubi (CochainComplex C α) ≌ CochainComplex (Karoubi C) α

(C : Type u_1)
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Preadditive C]
(α : Type u_3)
[AddRightCancelSemigroup α]
[One α]

∀ {X Y : HomologicalComplex (CategoryTheory.Idempotents.Karoubi C) (ComplexShape.up α)} (f : X ⟶ Y) (n : α),
  ((CategoryTheory.Idempotents.karoubiCochainComplexEquivalence C α).inverse.map f).f.f n = (f.f n).f


theorem isRat_eq_true [Ring α] : {a b : α} → {n : ℤ} → {d : ℕ} →
    IsRat a n d → IsRat b n d → a = b

{α : Type u}
[Ring α]
{a b : α}
{n : ℤ}
{d : ℕ}

Mathlib.Meta.NormNum.IsRat a n d → Mathlib.Meta.NormNum.IsRat b n d → a = b


theorem eLpNorm_congr_nnnorm_ae {f : α → F} {g : α → G} (hfg : ∀ᵐ x ∂μ, ‖f x‖₊ = ‖g x‖₊) :
    eLpNorm f p μ = eLpNorm g p μ

{α : Type u_1}
{F : Type u_3}
{G : Type u_4}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
[NormedAddCommGroup G]
{f : α → F}
{g : α → G}
(hfg : ∀ᵐ (x : α) ∂μ, ‖f x‖₊ = ‖g x‖₊)

MeasureTheory.eLpNorm f p μ = MeasureTheory.eLpNorm g p μ


/-- In a Galois category, every object is the sum of connected objects. -/
theorem has_decomp_connected_components (X : C) :
    ∃ (ι : Type) (f : ι → C) (g : (i : ι) → f i ⟶ X) (_ : IsColimit (Cofan.mk X g)),
      (∀ i, IsConnected (f i)) ∧ Finite ι

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

∃ ι f g x, (∀ (i : ι), CategoryTheory.PreGaloisCategory.IsConnected (f i)) ∧ Finite ι


theorem add_rat (h : Irrational x) : Irrational (x + q)


theorem IsLUB.biUnion_Iio_eq (h : IsLUB s a) : ⋃ x ∈ s, Iio x = Iio a

{α : Type v}
[LinearOrder α]
{s : Set α}
{a : α}
(h : IsLUB s a)


/-- A version of *Fubini theorem* for continuous functions with compact support: one may swap
the order of integration with respect to locally finite measures. One does not assume that the
measures are σ-finite, contrary to the usual Fubini theorem. -/
lemma integral_integral_swap_of_hasCompactSupport
    {f : X → Y → E} (hf : Continuous f.uncurry) (h'f : HasCompactSupport f.uncurry)
    {μ : Measure X} {ν : Measure Y} [IsFiniteMeasureOnCompacts μ] [IsFiniteMeasureOnCompacts ν] :
    ∫ x, (∫ y, f x y ∂ν) ∂μ = ∫ y, (∫ x, f x y ∂μ) ∂ν

(h'f : HasCompactSupport (Function.uncurry f))

∫ (x : X), ∫ (y : Y), f x y ∂ν ∂μ = ∫ (y : Y), ∫ (x : X), f x y ∂μ ∂ν


@[to_additive]
theorem contMDiffWithinAt_one [One M'] : ContMDiffWithinAt I I' n (1 : M → M') s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{s : Set M}
{x : M}
{n : ℕ∞}
[One M']


lemma smulPosMono_iff_smulPosReflectLT : SMulPosMono α β ↔ SMulPosReflectLT α β

{α : Type u_1}
{β : Type u_2}
[SMul α β]
[LinearOrder α]
[LinearOrder β]
[Zero β]


@[simp, norm_cast]
theorem toENNReal_min (m n : ℕ∞) : ↑(min m n) = (min m n : ℝ≥0∞)


@[simp]
theorem mulLeft_eq_zero_iff (a : A) : mulLeft R a = 0 ↔ a = 0

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


/-- Conditional kernel of a measure on a product space: a Markov kernel such that
`ρ = ρ.fst ⊗ₘ ρ.condKernel` (see `MeasureTheory.Measure.compProd_fst_condKernel`). -/
noncomputable
irreducible_def _root_.MeasureTheory.Measure.condKernel (ρ : Measure (α × Ω)) [IsFiniteMeasure ρ] :
    Kernel α Ω

{α : Type u_5}
{Ω : Type u_6}
{mα : MeasurableSpace α}
[MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
(ρ : MeasureTheory.Measure (α × Ω))
[MeasureTheory.IsFiniteMeasure ρ]

ρ.condKernel = (ProbabilityTheory.Kernel.const Unit ρ).condKernelUnitBorel.comap (fun a => ((), a)) ⋯


theorem comp {f' : β → γ} {gc : γ → γ → γ} (hf' : Semiconj₂ f' gb gc) (hf : Semiconj₂ f ga gb) :
    Semiconj₂ (f' ∘ f) ga gc

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{ga : α → α → α}
{gb : β → β → β}
{f' : β → γ}
{gc : γ → γ → γ}
(hf' : Function.Semiconj₂ f' gb gc)
(hf : Function.Semiconj₂ f ga gb)


private lemma span_range_relation_eq_ker_baseChange :
    Ideal.span (Set.range fun i ↦ (MvPolynomial.map (algebraMap R T)) (P.relation i)) =
      RingHom.ker (aeval (R := T) (S₁ := T ⊗[R] S) P.baseChange.val)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{T : Type u_1}
[CommRing T]
[Algebra R T]
(P : Algebra.Presentation R S)

Ideal.span (Set.range fun i => (MvPolynomial.map (algebraMap R T)) (P.relation i)) =
  RingHom.ker (MvPolynomial.aeval P.baseChange.val)


/-- There is an induced injective homomorphism of a subgraph of `G` as
a spanning subgraph into `G`. -/
@[simps]
def spanningHom (x : Subgraph G) : x.spanningCoe →g G

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


@[simp]
theorem blockDiagonal'_mul [NonUnitalNonAssocSemiring α] [∀ i, Fintype (n' i)] [Fintype o]
    (M : ∀ i, Matrix (m' i) (n' i) α) (N : ∀ i, Matrix (n' i) (p' i) α) :
    (blockDiagonal' fun k => M k * N k) = blockDiagonal' M * blockDiagonal' N

{o : Type u_4}
{m' : o → Type u_7}
{n' : o → Type u_8}
{p' : o → Type u_9}
{α : Type u_12}
[DecidableEq o]
[NonUnitalNonAssocSemiring α]
[(i : o) → Fintype (n' i)]
[Fintype o]
(M : (i : o) → Matrix (m' i) (n' i) α)
(N : (i : o) → Matrix (n' i) (p' i) α)

(Matrix.blockDiagonal' fun k => M k * N k) = Matrix.blockDiagonal' M * Matrix.blockDiagonal' N


theorem suffixLevenshtein_nil_nil : (suffixLevenshtein C [] []).1 = [0]

{α : Type u_1}
{β : Type u_2}
{δ : Type u_3}
[AddZeroClass δ]
[Min δ]
{C : Levenshtein.Cost α β δ}


theorem mem_vanishingIdeal (t : Set (PrimeSpectrum R)) (f : R) :
    f ∈ vanishingIdeal t ↔ ∀ x ∈ t, f ∈ x.asIdeal

{R : Type u}
[CommSemiring R]
(t : Set (PrimeSpectrum R))
(f : R)

f ∈ PrimeSpectrum.vanishingIdeal t ↔ ∀ x ∈ t, f ∈ x.asIdeal


theorem mapClusterPt_def {ι : Type*} (x : X) (F : Filter ι) (u : ι → X) :
    MapClusterPt x F u ↔ ClusterPt x (map u F)

{X : Type u}
[TopologicalSpace X]
{ι : Type u_3}
(x : X)
(F : Filter ι)
(u : ι → X)

MapClusterPt x F u ↔ ClusterPt x (Filter.map u F)


lemma generateFrom_natGeneratingSequence (α : Type*) [m : MeasurableSpace α]
    [CountablyGenerated α] : generateFrom (range (natGeneratingSequence _)) = m

(α : Type u_3)
[m : MeasurableSpace α]
[MeasurableSpace.CountablyGenerated α]

MeasurableSpace.generateFrom (Set.range (MeasurableSpace.natGeneratingSequence α)) = m


protected theorem frontier (h : e.IsImage s t) : e.IsImage (frontier s) (frontier t)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e : PartialHomeomorph X Y}
{s : Set X}
{t : Set Y}
(h : e.IsImage s t)


@[simp] lemma one_le_sqrt : 1 ≤ sqrt x ↔ 1 ≤ x


theorem ediam_eq_top_iff_unbounded : EMetric.diam s = ⊤ ↔ ¬IsBounded s

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

EMetric.diam s = ⊤ ↔ ¬Bornology.IsBounded s


/-- A negative exponential function is integrable on intervals in `R≥0` -/
lemma exp_neg_integrableOn_Ioc {b x : ℝ} (hb : 0 < b) :
    IntegrableOn (fun x ↦ rexp (-(b * x))) (Ioc 0 x)

MeasureTheory.IntegrableOn (fun x => rexp (-(b * x))) (Set.Ioc 0 x) MeasureTheory.volume


lemma regularTopology.isLocallySurjective_sheafOfTypes [Preregular C] [FinitaryPreExtensive C]
    {F G : Cᵒᵖ ⥤ Type w} (f : F ⟶ G) [PreservesFiniteProducts F] [PreservesFiniteProducts G]
      (h : Presheaf.IsLocallySurjective (coherentTopology C) f) :
        Presheaf.IsLocallySurjective (regularTopology C) f

(h : CategoryTheory.Presheaf.IsLocallySurjective (CategoryTheory.coherentTopology C) f)

CategoryTheory.Presheaf.IsLocallySurjective (CategoryTheory.regularTopology C) f


theorem single_smul (i : ℕ) (r : R) (m : M) : single R i (r • m) = r • single R i m

(R : Type u_1)
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(i : ℕ)
(r : R)
(m : M)

(PolynomialModule.single R i) (r • m) = r • (PolynomialModule.single R i) m


/-- For `n < m`, `(n, m)` is in the transitive closure of a relation `~` for `n ≠ m` if `pred i ~ i`
  for all `i` between `n` and `m`. -/
theorem transGen_of_pred_of_lt (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ioc n m, r (pred i) i)
    (hmn : n < m) : TransGen r n m

(h : ∀ i ∈ Set.Ioc n m, r (Order.pred i) i)


/-- `SMul` version of `one_mul_eq_id` -/
@[to_additive "`VAdd` version of `zero_add_eq_id`"]
lemma one_smul_eq_id : (((1 : M) • ·) : α → α) = id

(M : Type u_1)
{α : Type u_7}
[Monoid M]
[MulAction M α]


theorem comp_hasFDerivAt_iff {f : G → E} {x : G} {f' : G →L[𝕜] E} :
    HasFDerivAt (iso ∘ f) ((iso : E →L[𝕜] F).comp f') x ↔ HasFDerivAt f f' x

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

HasFDerivAt (⇑iso ∘ f) ((↑iso).comp f') x ↔ HasFDerivAt f f' x


theorem List.support_sum_eq [AddMonoid M] (l : List (ι →₀ M))
    (hl : l.Pairwise (_root_.Disjoint on Finsupp.support)) :
    l.sum.support = l.foldr (Finsupp.support · ⊔ ·) ∅

(hl : List.Pairwise (Disjoint on Finsupp.support) l)

l.sum.support = List.foldr (fun x x_1 => x.support ⊔ x_1) ∅ l


theorem min'_insert (a : α) (s : Finset α) (H : s.Nonempty) :
    (insert a s).min' (s.insert_nonempty a) = min (s.min' H) a

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


theorem eq_of_germ_isConstant [i : PreconnectedSpace X]
    (h : ∀ x : X, (f : Germ (𝓝 x) Y).IsConstant) (x x' : X) : f x = f x'

{X : Type u_3}
{Y : Type u_4}
[TopologicalSpace X]
{f : X → Y}
[i : PreconnectedSpace X]
(h : ∀ (x : X), (↑f).IsConstant)
(x x' : X)


theorem gcd_ne_zero_right : n ≠ 0 → gcd m n ≠ 0


theorem measurable_of_measurable_union_cover {f : α → β} (s t : Set α) (hs : MeasurableSet s)
    (ht : MeasurableSet t) (h : univ ⊆ s ∪ t) (hc : Measurable fun a : s => f a)
    (hd : Measurable fun a : t => f a) : Measurable f

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{f : α → β}
(s t : Set α)
(hs : MeasurableSet s)
(ht : MeasurableSet t)
(h : Set.univ ⊆ s ∪ t)
(hc : Measurable fun a => f ↑a)
(hd : Measurable fun a => f ↑a)


@[simp]
theorem support_filter (f : Π₀ i, β i) : (f.filter p).support = f.support.filter p

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

(DFinsupp.filter p f).support = Finset.filter p f.support


lemma yoneda_exact₂ {X : C} (f : T.obj₂ ⟶ X) (hf : T.mor₁ ≫ f = 0) :
    ∃ (g : T.obj₃ ⟶ X), f = T.mor₂ ≫ g

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


theorem Sublist.diff_right : ∀ {l₁ l₂ l₃ : List α}, l₁ <+ l₂ → l₁.diff l₃ <+ l₂.diff l₃

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{l₁ l₂ l₃ : List α}


lemma endEquivAutGalois_π (f : End F) (A : PointedGaloisObject F) :
    F.map (AutGalois.π F A (endEquivAutGalois F f)).hom A.pt = f.app A A.pt

(F : CategoryTheory.Functor C FintypeCat)

(A : CategoryTheory.PreGaloisCategory.PointedGaloisObject F)

F.map
    ((CategoryTheory.PreGaloisCategory.AutGalois.π F A) ((CategoryTheory.PreGaloisCategory.endEquivAutGalois F) f)).hom
    A.pt =
  f.app A.obj A.pt


@[reassoc (attr := simp)]
lemma toCycles_cyclesIsoSc'_hom :
    K.toCycles i j ≫ (K.cyclesIsoSc' i j k hi hk).hom = (K.sc' i j k).toCycles


/-- Left Kan extensions of isomorphic functors are isomorphic. -/
@[simps]
noncomputable def leftKanExtensionUniqueOfIso {G : C ⥤ H} (i : F ≅ G) (G' : D ⥤ H)
    (β : G ⟶ L ⋙ G') [G'.IsLeftKanExtension β] : F' ≅ G'

{C : Type u_1}
{H : Type u_3}
{D : Type u_5}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_8, u_3} H]
[CategoryTheory.Category.{u_9, u_5} D]
(F' : CategoryTheory.Functor D H)
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
(α : F ⟶ L.comp F')
[F'.IsLeftKanExtension α]
{G : CategoryTheory.Functor C H}
(i : F ≅ G)
(G' : CategoryTheory.Functor D H)
(β : G ⟶ L.comp G')
[G'.IsLeftKanExtension β]

(F'.leftKanExtensionUniqueOfIso α i G' β).inv =
  G'.descOfIsLeftKanExtension β F' (CategoryTheory.CategoryStruct.comp i.inv α)


theorem ofNat_le :
    (no_index (OfNat.ofNat m : α)) ≤ (no_index (OfNat.ofNat n)) ↔
      (OfNat.ofNat m : ℕ) ≤ OfNat.ofNat n

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

OfNat.ofNat m ≤ OfNat.ofNat n ↔ OfNat.ofNat m ≤ OfNat.ofNat n


theorem comap_of_ker_isPGroup {H : Subgroup G} (hH : IsPGroup p H) {K : Type*} [Group K]
    (ϕ : K →* G) (hϕ : IsPGroup p ϕ.ker) : IsPGroup p (H.comap ϕ)

{p : ℕ}
{G : Type u_1}
[Group G]
{H : Subgroup G}
(hH : IsPGroup p ↥H)
{K : Type u_2}
[Group K]
(ϕ : K →* G)
(hϕ : IsPGroup p ↥ϕ.ker)


/-- (Implementation). An auxiliary cone which is useful in order to construct limits
in the comma category. -/
@[simps!]
def limitAuxiliaryCone (c₁ : Cone (F ⋙ fst L R)) : Cone ((F ⋙ snd L R) ⋙ R)

(F : CategoryTheory.Functor J (CategoryTheory.Comma L R))

(c₁ : CategoryTheory.Limits.Cone (F.comp (CategoryTheory.Comma.fst L R)))

(CategoryTheory.Comma.limitAuxiliaryCone F c₁).pt = L.obj c₁.pt


theorem lowerSemicontinuousAt_tsum {f : ι → α → ℝ≥0∞} (h : ∀ i, LowerSemicontinuousAt (f i) x) :
    LowerSemicontinuousAt (fun x' => ∑' i, f i x') x

{f : ι → α → ℝ≥0∞}

(h : ∀ (i : ι), LowerSemicontinuousAt (f i) x)

LowerSemicontinuousAt (fun x' => ∑' (i : ι), f i x') x


/-- Precomposition of a 1-morphism as a functor. -/
@[simps]
def precomp (c : B) (f : a ⟶ b) : (b ⟶ c) ⥤ (a ⟶ c)

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

∀ {X Y : b ⟶ c} (x : X ⟶ Y), (CategoryTheory.Bicategory.precomp c f).map x = CategoryTheory.Bicategory.whiskerLeft f x


@[trans]
theorem PreEnvelGroupRel.trans {R : Type u} [Rack R] {a b c : PreEnvelGroup R} :
    PreEnvelGroupRel R a b → PreEnvelGroupRel R b c → PreEnvelGroupRel R a c

{R : Type u}
[Rack R]
{a b c : Rack.PreEnvelGroup R}

Rack.PreEnvelGroupRel R a b → Rack.PreEnvelGroupRel R b c → Rack.PreEnvelGroupRel R a c


/-- This can be used to prove
```lean
example [NonUnitalNonAssocSemiring α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁ b₂ : α) :
  ![b₁, b₂] ᵥ* !![a₁₁, a₁₂;
                       a₂₁, a₂₂] = ![b₁*a₁₁ + b₂*a₂₁, b₁*a₁₂ + b₂*a₂₂] :=
(vecMulᵣ_eq _ _).symm
```
-/
@[simp]
theorem vecMulᵣ_eq [NonUnitalNonAssocSemiring α] (v : Fin l → α) (A : Matrix (Fin l) (Fin m) α) :
    vecMulᵣ v A = v ᵥ* A

{l m : ℕ}
{α : Type u_1}
[NonUnitalNonAssocSemiring α]
(v : Fin l → α)
(A : Matrix (Fin l) (Fin m) α)


@[simp]
theorem vecMul_empty [Fintype n'] (v : n' → α) (B : Matrix n' (Fin 0) α) : v ᵥ* B = ![]

{α : Type u}
{n' : Type uₙ}
[NonUnitalNonAssocSemiring α]
[Fintype n']
(v : n' → α)
(B : Matrix n' (Fin 0) α)


lemma mkPostcomp_comp (f : S ⟶ T.obj Y) (g : Y ⟶ Y') (g' : Y' ⟶ Y'') :
    mkPostcomp f (g ≫ g') = mkPostcomp f g ≫ mkPostcomp (f ≫ T.map g) g' ≫ eqToHom (by simp)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{S : D}
{Y Y' Y'' : C}
{T : CategoryTheory.Functor C D}
(f : S ⟶ T.obj Y)
(g : Y ⟶ Y')
(g' : Y' ⟶ Y'')

CategoryTheory.StructuredArrow.mkPostcomp f (CategoryTheory.CategoryStruct.comp g g') =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.StructuredArrow.mkPostcomp f g)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.StructuredArrow.mkPostcomp (CategoryTheory.CategoryStruct.comp f (T.map g)) g')
      (CategoryTheory.eqToHom ⋯))


protected theorem le_of_sub_le_sub_left : ∀ {n k m : Nat}, n ≤ k → k - m ≤ k - n → n ≤ m


theorem adjoin_toSubalgebra_of_isAlgebraic_right (L : IntermediateField F K)
    [halg : Algebra.IsAlgebraic F L] :
    (adjoin E (L : Set K)).toSubalgebra = Algebra.adjoin E (L : Set K)

{F : Type u_1}
[Field F]
(E : Type u_2)
[Field E]
[Algebra F E]
{K : Type u_3}
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]
(L : IntermediateField F K)
[halg : Algebra.IsAlgebraic F ↥L]

(IntermediateField.adjoin E ↑L).toSubalgebra = Algebra.adjoin E ↑L


@[simp]
theorem iterToSum_C_X (c : S₂) : iterToSum R S₁ S₂ (C (X c)) = X (Sum.inr c)

(R : Type u)
(S₁ : Type v)
(S₂ : Type w)
[CommSemiring R]
(c : S₂)

(MvPolynomial.iterToSum R S₁ S₂) (MvPolynomial.C (MvPolynomial.X c)) = MvPolynomial.X (Sum.inr c)


/-- Transferred from `DFinsupp.Lex.acc`. See the top of that file for an explanation for the
  appearance of the relation `rᶜ ⊓ (≠)`. -/
theorem Lex.acc (hbot : ∀ ⦃n⦄, ¬s n 0) (hs : WellFounded s) (x : α →₀ N)
    (h : ∀ a ∈ x.support, Acc (rᶜ ⊓ (· ≠ ·)) a) :
    Acc (Finsupp.Lex r s) x

(h : ∀ a ∈ x.support, Acc (rᶜ ⊓ fun x x_1 => x ≠ x_1) a)


lemma baseChange_ψ (n : ℤ) : (W.baseChange B).ψ n = ((W.baseChange A).ψ n).map (mapRingHom f)

{R : Type r}
{S : Type s}
[CommRing R]
[CommRing S]
(W : WeierstrassCurve R)
[Algebra R S]
{A : Type u}
[CommRing A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
{B : Type v}
[CommRing B]
[Algebra R B]
[Algebra S B]
[IsScalarTower R S B]
(f : A →ₐ[S] B)
(n : ℤ)

(W.baseChange B).ψ n = Polynomial.map (Polynomial.mapRingHom ↑f) ((W.baseChange A).ψ n)


@[to_additive]
nonrec theorem _root_.Commute.unop [Mul α] {x y : αᵐᵒᵖ} (h : Commute x y) :
    Commute (unop x) (unop y)

{α : Type u_1}
[Mul α]
{x y : αᵐᵒᵖ}
(h : Commute x y)

Commute (MulOpposite.unop x) (MulOpposite.unop y)


theorem laverage_add_measure :
    ⨍⁻ x, f x ∂(μ + ν) =
      μ univ / (μ univ + ν univ) * ⨍⁻ x, f x ∂μ + ν univ / (μ univ + ν univ) * ⨍⁻ x, f x ∂ν

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

⨍⁻ (x : α), f x ∂(μ + ν) =
  μ Set.univ / (μ Set.univ + ν Set.univ) * ⨍⁻ (x : α), f x ∂μ +
    ν Set.univ / (μ Set.univ + ν Set.univ) * ⨍⁻ (x : α), f x ∂ν


lemma Exact.of_ladder_linearEquiv_of_exact
    (h₁₂ : g₁₂ ∘ₗ e₁ = e₂ ∘ₗ f₁₂) (h₂₃ : g₂₃ ∘ₗ e₂ = e₃ ∘ₗ f₂₃)
    (H : Exact f₁₂ f₂₃) : Exact g₁₂ g₂₃

{R : Type u_1}
{M : Type u_2}
{M' : Type u_3}
{N : Type u_4}
{N' : Type u_5}
{P : Type u_6}
{P' : Type u_7}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M']
[AddCommMonoid N]
[AddCommMonoid N']
[AddCommMonoid P]
[AddCommMonoid P']
[Module R M]
[Module R M']
[Module R N]
[Module R N']
[Module R P]
[Module R P']
{f₁₂ : M →ₗ[R] N}
{f₂₃ : N →ₗ[R] P}
{g₁₂ : M' →ₗ[R] N'}
{g₂₃ : N' →ₗ[R] P'}
{e₁ : M ≃ₗ[R] M'}
{e₂ : N ≃ₗ[R] N'}
{e₃ : P ≃ₗ[R] P'}
(h₁₂ : g₁₂ ∘ₗ ↑e₁ = ↑e₂ ∘ₗ f₁₂)
(h₂₃ : g₂₃ ∘ₗ ↑e₂ = ↑e₃ ∘ₗ f₂₃)
(H : Function.Exact ⇑f₁₂ ⇑f₂₃)


@[simp]
theorem foldr_algebraMap (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) (r : R) :
    foldr Q f hf n (algebraMap R _ r) = r • n

((CliffordAlgebra.foldr Q f hf) n) ((algebraMap R (CliffordAlgebra Q)) r) = r • n


/-- Given an exact short complex `S` and a limit kernel fork `kf` for `S.g`, this is the
left homology data for `S` with `K := kf.pt` and `H := 0`. -/
@[simps]
noncomputable def Exact.leftHomologyDataOfIsLimitKernelFork
    (hS : S.Exact) [HasZeroObject C] (kf : KernelFork S.g) (hkf : IsLimit kf) :
    S.LeftHomologyData

(kf : CategoryTheory.Limits.KernelFork S.g)

(hkf : CategoryTheory.Limits.IsLimit kf)

(hS.leftHomologyDataOfIsLimitKernelFork kf hkf).H = 0


theorem iterate_dslope_fslope_ne_zero (hp : HasFPowerSeriesAt f p z₀) (h : p ≠ 0) :
    (swap dslope z₀)^[p.order] f z₀ ≠ 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{p : FormalMultilinearSeries 𝕜 𝕜 E}
{f : 𝕜 → E}
{z₀ : 𝕜}
(hp : HasFPowerSeriesAt f p z₀)
(h : p ≠ 0)

(Function.swap dslope z₀)^[p.order] f z₀ ≠ 0


theorem self_mul_star : a * star a = normSq a


lemma jacobiTheta₂'_undef (z : ℂ) {τ : ℂ} (hτ : im τ ≤ 0) : jacobiTheta₂' z τ = 0


theorem of_finiteType [IsNoetherianRing A] {f : A →ₐ[R] B} : f.FiniteType ↔ f.FinitePresentation

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommRing R]
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]
[IsNoetherianRing A]
{f : A →ₐ[R] B}


theorem dual_lc (l : ι →₀ R) (i : ι) : ε i (DualBases.lc e l) = l i

{R : Type u_1}
{M : Type u_2}
{ι : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
{e : ι → M}
{ε : ι → Module.Dual R M}
[DecidableEq ι]
(h : Module.DualBases e ε)
(l : ι →₀ R)
(i : ι)


/-- We define `Tor C n : C ⥤ C ⥤ C` by left-deriving in the second factor of `(X, Y) ↦ X ⊗ Y`. -/
@[simps]
def Tor (n : ℕ) : C ⥤ C ⥤ C

(CategoryTheory.Tor C n).obj X = ((CategoryTheory.MonoidalCategory.tensoringLeft C).obj X).leftDerived n


/-- If the punctured neighborhoods of a point form a nontrivial filter, then any neighborhood is
infinite. -/
theorem infinite_of_mem_nhds {X} [TopologicalSpace X] [T1Space X] (x : X) [hx : NeBot (𝓝[≠] x)]
    {s : Set X} (hs : s ∈ 𝓝 x) : Set.Infinite s

{X : Type u_3}
[TopologicalSpace X]
[T1Space X]
(x : X)
[hx : (𝓝[≠] x).NeBot]
{s : Set X}
(hs : s ∈ 𝓝 x)


theorem isBigO_fst_prod' {f' : α → E' × F'} : (fun x => (f' x).1) =O[l] f'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{l : Filter α}
{f' : α → E' × F'}


theorem base_compl_iff_mem_maximals_disjoint_base (hB : B ⊆ M.E := by aesop_mat) :
    M.Base (M.E \ B) ↔ B ∈ maximals (· ⊆ ·) {I | I ⊆ M.E ∧ ∃ B, M.Base B ∧ Disjoint I B}

{α : Type u_1}
{M : Matroid α}
{B : Set α}
(hB : B ⊆ M.E := by aesop_mat)

M.Base (M.E \ B) ↔ B ∈ maximals (fun x x_1 => x ⊆ x_1) {I | I ⊆ M.E ∧ ∃ B, M.Base B ∧ Disjoint I B}


theorem firstDiffPos_eq (a b : String) :
    firstDiffPos a b = ⟨utf8Len (List.takeWhile₂ (· = ·) a.1 b.1).1⟩

a.firstDiffPos b = { byteIdx := String.utf8Len (List.takeWhile₂ (fun x x_1 => decide (x = x_1)) a.data b.data).fst }


theorem prod_sup (u v : PrimeMultiset) : (u ⊔ v).prod = PNat.lcm u.prod v.prod


lemma of_mul_left (m : ℤ) (h : a ≡ b [ZMOD m * n]) : a ≡ b [ZMOD n]

{n a b : ℤ}
(m : ℤ)
(h : a ≡ b [ZMOD m * n])


theorem ContDiffOn.dist (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s)
    (hne : ∀ x ∈ s, f x ≠ g x) : ContDiffOn ℝ n (fun y => dist (f y) (g y)) s

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f g : G → E}
{s : Set G}
{n : ℕ∞}
(hf : ContDiffOn ℝ n f s)
(hg : ContDiffOn ℝ n g s)
(hne : ∀ x ∈ s, f x ≠ g x)


/-- Any power of the exponential characteristic is positive. -/
theorem expChar_pow_pos (q : ℕ) [ExpChar R q] (n : ℕ) : 0 < q ^ n

(R : Type u)
[Semiring R]
(q : ℕ)
[ExpChar R q]
(n : ℕ)


@[to_additive (attr := simp)]
lemma monoidHomOfForallMemZpowers_apply_gen :
    monoidHomOfForallMemZpowers hg hg' g = g'

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

(addMonoidHomOfForallMemZmultiples hg hg') g = g'


/-- A set is ample iff its pre-image under a continuous affine equivalence is. -/
theorem preimage_iff {s : Set F} (L : E ≃ᵃL[ℝ] F) :
    AmpleSet (L ⁻¹' s) ↔ AmpleSet s

{F : Type u_1}
[AddCommGroup F]
[Module ℝ F]
[TopologicalSpace F]
{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
{s : Set F}
(L : E ≃ᵃL[ℝ] F)


lemma smul_eq_smul_iff_eq_and_eq_of_pos' [PosSMulStrictMono α β] [SMulPosStrictMono α β]
    (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) (h₂ : 0 < a₂) (h₁ : 0 < b₁) :
    a₁ • b₁ = a₂ • b₂ ↔ a₁ = a₂ ∧ b₁ = b₂

{α : Type u_1}
{β : Type u_2}
{a₁ a₂ : α}
{b₁ b₂ : β}
[Zero α]
[Zero β]
[SMulWithZero α β]
[PartialOrder α]
[PartialOrder β]
[PosSMulStrictMono α β]
[SMulPosStrictMono α β]
(ha : a₁ ≤ a₂)
(hb : b₁ ≤ b₂)
(h₂ : 0 < a₂)
(h₁ : 0 < b₁)

a₁ • b₁ = a₂ • b₂ ↔ a₁ = a₂ ∧ b₁ = b₂


theorem diff_subset_comm {s t u : Set α} : s \ t ⊆ u ↔ s \ u ⊆ t


lemma card_filter_le_iff (s : Finset α) (P : α → Prop) [DecidablePred P] (n : ℕ) :
    (s.filter P).card ≤ n ↔ ∀ s' ⊆ s, n < s'.card → ∃ a ∈ s', ¬ P a

{α : Type u_1}
(s : Finset α)
(P : α → Prop)
[DecidablePred P]
(n : ℕ)

(Finset.filter P s).card ≤ n ↔ ∀ s' ⊆ s, n < s'.card → ∃ a ∈ s', ¬P a


theorem normSq_add_mul_I (x y : ℝ) : normSq (x + y * I) = x ^ 2 + y ^ 2

Complex.normSq (↑x + ↑y * Complex.I) = x ^ 2 + y ^ 2


@[to_additive (attr := simp)] lemma MulEquiv.mulDissociated_preimage (e : β ≃* α) :
    MulDissociated (e ⁻¹' s) ↔ MulDissociated s

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[AddCommGroup β]
{s : Set α}
(e : β ≃+ α)

AddDissociated (⇑e ⁻¹' s) ↔ AddDissociated s


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

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

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

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


/-- A side of a right-angled triangle divided by the tangent of the opposite angle equals the
adjacent side. -/
theorem dist_div_tan_oangle_left_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P}
    (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) : dist p₃ p₂ / Real.Angle.tan (∡ p₃ p₁ p₂) = dist p₁ p₂

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

dist p₃ p₂ / (∡ p₃ p₁ p₂).tan = dist p₁ p₂


@[simp] theorem fst_one [Zero ι] [GOne A] : (1 : GradedMonoid A).fst = 0

{ι : Type u_1}
(A : ι → Type u_2)
[Zero ι]
[GradedMonoid.GOne A]


theorem hausdorffMeasure_smul_right_image [NormedAddCommGroup E] [NormedSpace ℝ E]
    [MeasurableSpace E] [BorelSpace E] (v : E) (s : Set ℝ) :
    μH[1] ((fun r => r • v) '' s) = ‖v‖₊ • μH[1] s

{E : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(v : E)
(s : Set ℝ)


theorem exists_not_mem_finset [Infinite α] (s : Finset α) : ∃ x, x ∉ s

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


@[simp] theorem lTensor_tmul : f.lTensor M (m ⊗ₜ n) = m ⊗ₜ f n

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : N ≃ₗ[R] P)
(m : M)
(n : N)

(LinearEquiv.lTensor M f) (m ⊗ₜ[R] n) = m ⊗ₜ[R] f n


lemma CokernelCofork.IsColimit.isIso_π {X Y : C} {f : X ⟶ Y} (c : CokernelCofork f)
    (hc : IsColimit c) (hf : f = 0) : IsIso c.π

(c : CategoryTheory.Limits.CokernelCofork f)

(hc : CategoryTheory.Limits.IsColimit c)


theorem mem_inf_of_right {f g : Filter α} {s : Set α} (h : s ∈ g) : s ∈ f ⊓ g

{α : Type u}
{f g : Filter α}
{s : Set α}
(h : s ∈ g)


@[simp]
theorem areaForm_neg_orientation : (-o).areaForm = -o.areaForm

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


@[to_additive Finset.sum_nonneg']
theorem one_le_prod'' (h : ∀ i : ι, 1 ≤ f i) : 1 ≤ ∏ i ∈ s, f i

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


@[simp] lemma mod_two_add_succ_mod_two (m : ℕ) : m % 2 + (m + 1) % 2 = 1


/-- See Note [continuity lemma statement]. -/
theorem _root_.Continuous.path_extend {γ : Y → Path x y} {f : Y → ℝ} (hγ : Continuous ↿γ)
    (hf : Continuous f) : Continuous fun t => (γ t).extend (f t)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{x y : X}
{γ : Y → Path x y}
{f : Y → ℝ}
(hγ : Continuous ↿γ)
(hf : Continuous f)


theorem subalgebra_top_finrank_eq_submodule_top_finrank :
    finrank F (⊤ : Subalgebra F E) = finrank F (⊤ : Submodule F E)

{F : Type u_2}
{E : Type u_3}
[CommRing F]
[Ring E]
[Algebra F E]

FiniteDimensional.finrank F ↥⊤ = FiniteDimensional.finrank F ↥⊤


/-- Predicate typeclass for expressing that `a * b = 0` implies `a = 0` or `b = 0`
for all `a` and `b` of type `G₀`. -/
class NoZeroDivisors (M₀ : Type*) [Mul M₀] [Zero M₀] : Prop where
  /-- For all `a` and `b` of `G₀`, `a * b = 0` implies `a = 0` or `b = 0`. -/
  eq_zero_or_eq_zero_of_mul_eq_zero : ∀ {a b : M₀}, a * b = 0 → a = 0 ∨ b = 0

{M₀ : Type u_4}
[Mul M₀]
[Zero M₀]
[self : NoZeroDivisors M₀]
{a b : M₀}


lemma comp_eq_top_iff : W₁.comp W₂ = ⊤ ↔ HasFactorization W₁ W₂

(W₁ W₂ : CategoryTheory.MorphismProperty C)


/-- `Nat.cast` as an embedding into monoids of characteristic `0`. -/
@[simps]
def castEmbedding : ℕ ↪ R

{R : Type u_1}
[AddMonoidWithOne R]
[CharZero R]


theorem continuous_inner : Continuous fun p : E × E => ⟪p.1, p.2⟫

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


lemma condIndepFun_iff_condIndep {β γ : Type*} [mβ : MeasurableSpace β]
    [mγ : MeasurableSpace γ] (f : Ω → β) (g : Ω → γ) (μ : Measure Ω) [IsFiniteMeasure μ] :
    CondIndepFun m' hm' f g μ
      ↔ CondIndep m' (MeasurableSpace.comap f mβ) (MeasurableSpace.comap g mγ) hm' μ

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

ProbabilityTheory.CondIndepFun m' hm' f g μ ↔
  ProbabilityTheory.CondIndep m' (MeasurableSpace.comap f mβ) (MeasurableSpace.comap g mγ) hm' μ


/-- If `R` satisfies the strong rank condition,
then for any linearly independent family `v : ι → M`
and any finite spanning set `w : Set M`,
the cardinality of `ι` is bounded by the cardinality of `w`.
-/
theorem linearIndependent_le_span {ι : Type*} (v : ι → M) (i : LinearIndependent R v) (w : Set M)
    [Fintype w] (s : span R w = ⊤) : #ι ≤ Fintype.card w

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
{ι : Type u_1}
(v : ι → M)
(i : LinearIndependent R v)
(w : Set M)
[Fintype ↑w]
(s : Submodule.span R w = ⊤)


@[simp, norm_cast]
theorem coe_infs : (↑(s ⊼ t) : Set α) = ↑s ⊼ ↑t

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


/-- Subtracting the point `p` is an injective function. -/
theorem vsub_left_injective (p : P) : Function.Injective ((· -ᵥ p) : P → G)

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[T : AddTorsor G P]
(p : P)


theorem derivative_nodal [DecidableEq ι] :
    derivative (nodal s v) = ∑ i ∈ s, nodal (s.erase i) v

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
{s : Finset ι}
{v : ι → R}
[DecidableEq ι]

Polynomial.derivative (Lagrange.nodal s v) = ∑ i ∈ s, Lagrange.nodal (s.erase i) v


/-- Let `s` be a convex set in a real normed vector space `E`, let `f : E → G` be a function
differentiable within `s` in a neighborhood of `x : E` with derivative `f'`. Suppose that `f'` is
continuous within `s` at `x`. Then for any number `K : ℝ≥0` larger than `‖f' x‖₊`, `f` is
`K`-Lipschitz on some neighborhood of `x` within `s`. See also
`Convex.exists_nhdsWithin_lipschitzOnWith_of_hasFDerivWithinAt` for a version that claims
existence of `K` instead of an explicit estimate. -/
theorem exists_nhdsWithin_lipschitzOnWith_of_hasFDerivWithinAt_of_nnnorm_lt (hs : Convex ℝ s)
    {f : E → G} (hder : ∀ᶠ y in 𝓝[s] x, HasFDerivWithinAt f (f' y) s y)
    (hcont : ContinuousWithinAt f' s x) (K : ℝ≥0) (hK : ‖f' x‖₊ < K) :
    ∃ t ∈ 𝓝[s] x, LipschitzOnWith K f t

(hder : ∀ᶠ (y : E) in 𝓝[s] x, HasFDerivWithinAt f (f' y) s y)


@[simp] theorem reverse_reverse (t : RBNode α) : t.reverse.reverse = t


@[simp]
theorem closure_univ : closure L (univ : Set M) = ⊤

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]

(FirstOrder.Language.Substructure.closure L).toFun Set.univ = ⊤


@[simp]
theorem LinearMap.det_zero'' {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M]
    [Module.Free R M] [Module.Finite R M] [Nontrivial M] : LinearMap.det (0 : M →ₗ[R] M) = 0

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
[Nontrivial M]


lemma LieSubalgebra.coe_ad_pow (H : LieSubalgebra R L) (x y : H) (n : ℕ) :
    ((ad R H x ^ n) y : L) = (ad R L x ^ n) y

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(H : LieSubalgebra R L)
(x y : ↥H)
(n : ℕ)

↑(((LieAlgebra.ad R ↥H) x ^ n) y) = ((LieAlgebra.ad R L) ↑x ^ n) ↑y


theorem isPiSystem_iUnion_of_monotone {α ι} [SemilatticeSup ι] (p : ι → Set (Set α))
    (hp_pi : ∀ n, IsPiSystem (p n)) (hp_mono : Monotone p) : IsPiSystem (⋃ n, p n)

{α : Type u_1}
{ι : Type u_2}
[SemilatticeSup ι]
(p : ι → Set (Set α))
(hp_pi : ∀ (n : ι), IsPiSystem (p n))
(hp_mono : Monotone p)


@[simp]
theorem not_mem_empty (a : α) : a ∉ (∅ : AList β)


@[to_additive (attr := simp)]
theorem image2_smul : image2 SMul.smul s t = s • t

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


theorem preservesMonomorphisms.iso_iff {F G : C ⥤ D} (α : F ≅ G) :
    PreservesMonomorphisms F ↔ PreservesMonomorphisms G

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


theorem isNilpotent_quotient_iff :
    IsNilpotent R L (M ⧸ N) ↔ ∃ k, lowerCentralSeries R L M k ≤ N

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

LieModule.IsNilpotent R L (M ⧸ N) ↔ ∃ k, LieModule.lowerCentralSeries R L M k ≤ N


theorem elem_iff [BEq α] [LawfulBEq α] {a : α} {as : List α} :
    elem a as = true ↔ a ∈ as

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a : α}
{as : List α}


theorem coeIdeal_le_one {I : Ideal R} : (I : FractionalIdeal S P) ≤ 1

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{I : Ideal R}


/-- The counit isomorphism of the equivalence
`Karoubi (HomologicalComplex C c) ≌ HomologicalComplex (Karoubi C) c`. -/
@[simps!]
def counitIso : inverse ⋙ functor ≅ 𝟭 (HomologicalComplex (Karoubi C) c)

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{ι : Type u_2}
{c : ComplexShape ι}

CategoryTheory.Idempotents.KaroubiHomologicalComplexEquivalence.counitIso.hom = CategoryTheory.eqToHom ⋯


/-- A monoid object as a bimodule over itself. -/
@[simps]
def regular : Bimod A A

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


theorem aeval_eq_eval₂Hom (p : MvPolynomial σ R) : aeval f p = eval₂Hom (algebraMap R S₁) f p

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

(MvPolynomial.aeval f) p = (MvPolynomial.eval₂Hom (algebraMap R S₁) f) p


@[simp]
theorem of_zero_ofNat (n : ℕ) [n.AtLeastTwo] : of A 0 (no_index (OfNat.ofNat n)) = OfNat.ofNat n

{ι : Type u_1}
[DecidableEq ι]
(A : ι → Type u_2)
[(i : ι) → AddCommMonoid (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
(n : ℕ)
[n.AtLeastTwo]

(DirectSum.of A 0) (OfNat.ofNat n) = OfNat.ofNat n


theorem isIntegral (α : solvableByRad F E) : IsIntegral F α

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(α : ↥(solvableByRad F E))


@[simp]
lemma smulRight_apply_eq_zero_iff {f : M₁ →ₗ[R] S} {x : M} [NoZeroSMulDivisors S M] :
    f.smulRight x = 0 ↔ f = 0 ∨ x = 0

{R : Type u_1}
{S : Type u_4}
{M : Type u_5}
{M₁ : Type u_6}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₁]
[Module R M]
[Module R M₁]
[Semiring S]
[Module R S]
[Module S M]
[IsScalarTower R S M]
{f : M₁ →ₗ[R] S}
{x : M}
[NoZeroSMulDivisors S M]


@[simp] lemma image_inv (f : Perm α) (s : Set α) : ↑f⁻¹ '' s = f ⁻¹' s

{α : Type u}
(f : Equiv.Perm α)
(s : Set α)


theorem symmDiff_left_injective (a : α) : Injective (· ∆ a)

{α : Type u_2}
[GeneralizedBooleanAlgebra α]
(a : α)


/-- A single vertex, in terms of `pointsWithCircumcenter`. -/
theorem point_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n)
    (i : Fin (n + 1)) :
    s.points i =
      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination ℝ s.pointsWithCircumcenter
        (pointWeightsWithCircumcenter i)

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

s.points i =
  (Finset.affineCombination ℝ Finset.univ s.pointsWithCircumcenter) (Affine.Simplex.pointWeightsWithCircumcenter i)


@[simp]
theorem preimage_Ico (e : α ≃o β) (a b : β) : e ⁻¹' Ico a b = Ico (e.symm a) (e.symm b)

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

⇑e ⁻¹' Set.Ico a b = Set.Ico (e.symm a) (e.symm b)


@[simp, mfld_simps]
theorem map_mk (f : α → γ) (g : β → δ) (a : α) (b : β) : map f g (a, b) = (f a, g b)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(f : α → γ)
(g : β → δ)
(a : α)
(b : β)


theorem CauchySeq.nonempty [Preorder β] {u : β → α} (hu : CauchySeq u) : Nonempty β

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
[Preorder β]
{u : β → α}
(hu : CauchySeq u)


@[to_additive (attr := simp)]
theorem coe_mulRight (g : G) : ⇑(mulRight g) = fun x => x * g

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul G]
(g : G)

⇑(MeasurableEquiv.mulRight g) = fun x => x * g


theorem sizeUpTo_strict_mono {i : ℕ} (h : i < c.length) : c.sizeUpTo i < c.sizeUpTo (i + 1)

{n : ℕ}
(c : Composition n)
{i : ℕ}
(h : i < c.length)


@[simp, to_additive existing]
theorem unsym_inv [Inv α] (a : αˢʸᵐ) : unsym a⁻¹ = (unsym a)⁻¹


lemma map_ι₀_eq_map_ι₁ {D : Type*} [Category D] (H : HomologicalComplex C c ⥤ D)
    (hH : (homotopyEquivalences C c).IsInvertedBy H) :
    H.map (ι₀ K) = H.map (ι₁ K)

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

[HomologicalComplex.HasHomotopyCofiber (CategoryTheory.Limits.biprod.lift (𝟙 K) (-𝟙 K))]

(hH : (HomologicalComplex.homotopyEquivalences C c).IsInvertedBy H)

H.map (HomologicalComplex.cylinder.ι₀ K) = H.map (HomologicalComplex.cylinder.ι₁ K)


@[simp]
theorem trunc_one (n) : trunc (n + 1) (1 : R⟦X⟧) = 1


@[simp]
theorem sum_const (ι : Type u) (a : Cardinal.{v}) :
    (sum fun _ : ι => a) = lift.{v} #ι * lift.{u} a

(Cardinal.sum fun x => a) = Cardinal.lift.{v, u} (Cardinal.mk ι) * Cardinal.lift.{u, v} a


/-- The permutation of a type is equivalent to the units group of the endomorphisms monoid of this
type. -/
@[simps]
def equivUnitsEnd : Perm α ≃* Units (Function.End α)

∀ (a : α), ↑(Equiv.Perm.equivUnitsEnd e) a = e.toFun a


/-- If `α` is algebraic over `F`, then the separable degree of `F⟮α⟯ / F` is equal to the degree
of `F⟮α⟯ / F` if and only if `α` is a separable element. -/
theorem finSepDegree_adjoin_simple_eq_finrank_iff (α : E) (halg : IsAlgebraic F α) :
    finSepDegree F F⟮α⟯ = finrank F F⟮α⟯ ↔ IsSeparable F α

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(α : E)
(halg : IsAlgebraic F α)

Field.finSepDegree F ↥F⟮α⟯ = FiniteDimensional.finrank F ↥F⟮α⟯ ↔ IsSeparable F α


theorem Separable.mul {f g : R[X]} (hf : f.Separable) (hg : g.Separable) (h : IsCoprime f g) :
    (f * g).Separable

{R : Type u}
[CommRing R]
{f g : R[X]}
(hf : f.Separable)
(hg : g.Separable)
(h : IsCoprime f g)


/-- A non-empty set is countable iff there exists a surjection from the
natural numbers onto the subtype induced by the set.
-/
protected theorem countable_iff_exists_surjective {s : Set α} (hs : s.Nonempty) :
    s.Countable ↔ ∃ f : ℕ → s, Surjective f

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

s.Countable ↔ ∃ f, Function.Surjective f


@[to_additive (attr := simp)]
theorem prod_const (b : β) : ∏ _x ∈ s, b = b ^ s.card

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
[CommMonoid β]
(b : β)


/-- The hypotheses also imply that `G` is initial, see `initial_of_comp_full_faithful'`. -/
theorem initial_of_comp_full_faithful [Full G] [Faithful G] [Initial (F ⋙ G)] : Initial F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(F : CategoryTheory.Functor C D)
(G : CategoryTheory.Functor D E)
[G.Full]
[G.Faithful]
[(F.comp G).Initial]


theorem dual_node' (l : Ordnode α) (x : α) (r : Ordnode α) :
    dual (node' l x r) = node' (dual r) x (dual l)

{α : Type u_1}
(l : Ordnode α)
(x : α)
(r : Ordnode α)

(l.node' x r).dual = r.dual.node' x l.dual


theorem eqOn_zero_of_preconnected_of_mem_closure (hf : AnalyticOn 𝕜 f U) (hU : IsPreconnected U)
    (h₀ : z₀ ∈ U) (hfz₀ : z₀ ∈ closure ({z | f z = 0} \ {z₀})) : EqOn f 0 U


theorem Antitone.directed_le [Preorder α] [IsDirected α (· ≥ ·)] [Preorder β] {f : α → β}
    (hf : Antitone f) : Directed (· ≤ ·) f

{α : Type u}
{β : Type v}
[Preorder α]
[IsDirected α fun x x_1 => x ≥ x_1]
[Preorder β]
{f : α → β}
(hf : Antitone f)


theorem of_epi_zero (X Y : C) [Epi (0 : X ⟶ Y)] : IsZero Y


/-- The functor `ComposableArrows C n ⥤ ComposableArrows D n` obtained by postcomposition
with a functor `C ⥤ D`. -/
@[simps!]
def Functor.mapComposableArrows :
    ComposableArrows C n ⥤ ComposableArrows D n

(F : CategoryTheory.Functor (Fin (n + 1)) C)

∀ {X Y : Fin (n + 1)} (f : X ⟶ Y), ((G.mapComposableArrows n).obj F).map f = G.map (F.map f)


lemma fst_prodMkRight (κ : Kernel α (β × γ)) (δ : Type*) [MeasurableSpace δ] :
    fst (prodMkRight δ κ) = prodMkRight δ (fst κ)

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

(ProbabilityTheory.Kernel.prodMkRight δ κ).fst = ProbabilityTheory.Kernel.prodMkRight δ κ.fst


/--
If `F ⊣ G` and `F' ⊣ G'` are adjunctions, then giving a natural isomorphism `G ≅ G'` is the
same as giving a natural transformation `F' ≅ F`.
-/
@[simps]
def natIsoEquiv {F F' : C ⥤ D} {G G' : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G') :
    (G ≅ G') ≃ (F' ≅ F)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{F F' : C ⥤ D}
{G G' : D ⥤ C}
(adj1 : F ⊣ G)
(adj2 : F' ⊣ G')
(i : F' ≅ F)

((adj1.natIsoEquiv adj2).symm i).inv = (adj2.natTransEquiv adj1).symm i.inv


/-- The natural category equivalence between `R`-coalgebras and comonoid objects in the
category of `R`-modules. -/
@[simps]
noncomputable def comonEquivalence : CoalgebraCat R ≌ Comon_ (ModuleCat R)

(CoalgebraCat.comonEquivalence R).counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun x => CategoryTheory.Iso.refl (((CoalgebraCat.ofComon R).comp (CoalgebraCat.toComon R)).obj x)) ⋯


theorem verschiebungFun_coeff (x : 𝕎 R) (n : ℕ) :
    (verschiebungFun x).coeff n = if n = 0 then 0 else x.coeff (n - 1)

{p : ℕ}
{R : Type u_1}
[CommRing R]
(x : WittVector p R)
(n : ℕ)

x.verschiebungFun.coeff n = if n = 0 then 0 else x.coeff (n - 1)


@[to_additive (attr := simp)]
theorem swap_swap (x : M ∗ N) : swap N M (swap M N x) = x

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

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


theorem form_perm_zpow_apply_mem_imp_mem (l : List α) (x : α) (hx : x ∈ l) (n : ℤ) :
    (formPerm l ^ n) x ∈ l

{α : Type u_1}
[DecidableEq α]
(l : List α)
(x : α)
(hx : x ∈ l)
(n : ℤ)


theorem HasLineDerivWithinAt.congr (h : HasLineDerivWithinAt 𝕜 f f' s x v) (hs : EqOn f₁ f s)
    (hx : f₁ x = f x) : HasLineDerivWithinAt 𝕜 f₁ f' s x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f f₁ : E → F}
{f' : F}
{s : Set E}
{x v : E}
(h : HasLineDerivWithinAt 𝕜 f f' s x v)
(hs : Set.EqOn f₁ f s)
(hx : f₁ x = f x)


theorem iff_of_openCover :
    P f ↔ ∀ i, P (𝒰.map i ≫ f)

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}


theorem charpoly_monic : f.charpoly.Monic

{R : Type u}
{M : Type v}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
(f : M →ₗ[R] M)


theorem ite_tmul (x₁ : M) (x₂ : N) (P : Prop) [Decidable P] :
    (if P then x₁ else 0) ⊗ₜ[R] x₂ = if P then x₁ ⊗ₜ x₂ else 0

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(x₁ : M)
(x₂ : N)
(P : Prop)
[Decidable P]

(if P then x₁ else 0) ⊗ₜ[R] x₂ = if P then x₁ ⊗ₜ[R] x₂ else 0


theorem IsDiag.neg [AddGroup α] {A : Matrix n n α} (ha : A.IsDiag) : (-A).IsDiag

{α : Type u_1}
{n : Type u_4}
[AddGroup α]
{A : Matrix n n α}
(ha : A.IsDiag)


@[to_additive]
theorem red_iff_irreducible {x1 b1 x2 b2} (h : (x1, b1) ≠ (x2, b2)) :
    Red [(x1, !b1), (x2, b2)] L ↔ L = [(x1, !b1), (x2, b2)]

{α : Type u}
{L : List (α × Bool)}
{x1 : α}
{b1 : Bool}
{x2 : α}
{b2 : Bool}
(h : (x1, b1) ≠ (x2, b2))


protected theorem add_lt_add_iff_left [LT α] [CovariantClass α α (· + ·) (· < ·)]
    [ContravariantClass α α (· + ·) (· < ·)] (ha : a ≠ ⊤) : a + b < a + c ↔ b < c

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

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


theorem zipWith_rotate_one {β : Type*} (f : α → α → β) (x y : α) (l : List α) :
    zipWith f (x :: y :: l) ((x :: y :: l).rotate 1) = f x y :: zipWith f (y :: l) (l ++ [x])

{α : Type u}
{β : Type u_1}
(f : α → α → β)
(x y : α)
(l : List α)

List.zipWith f (x :: y :: l) ((x :: y :: l).rotate 1) = f x y :: List.zipWith f (y :: l) (l ++ [x])


/-- In an (extended) metric space with second countable topology, the Hausdorff dimension
of a set `s` is the supremum over `x ∈ s` of the limit superiors of `dimH t` along
`(𝓝[s] x).smallSets`. -/
theorem bsupr_limsup_dimH (s : Set X) : ⨆ x ∈ s, limsup dimH (𝓝[s] x).smallSets = dimH s

{X : Type u_2}
[EMetricSpace X]
[SecondCountableTopology X]
(s : Set X)

⨆ x ∈ s, Filter.limsup dimH (𝓝[s] x).smallSets = dimH s


lemma prime_of_mem_primeFactors (hp : p ∈ n.primeFactors) : p.Prime


lemma mor₃_eq_zero_iff_epi₂ : T.mor₃ = 0 ↔ Epi T.mor₂

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


/-- The definition of a Monge plane. -/
theorem mongePlane_def {n : ℕ} (s : Simplex ℝ P (n + 2)) (i₁ i₂ : Fin (n + 3)) :
    s.mongePlane i₁ i₂ =
      mk' (({i₁, i₂}ᶜ : Finset (Fin (n + 3))).centroid ℝ s.points)
          (ℝ ∙ s.points i₁ -ᵥ s.points i₂)ᗮ ⊓
        affineSpan ℝ (Set.range s.points)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P (n + 2))
(i₁ i₂ : Fin (n + 3))

s.mongePlane i₁ i₂ =
  AffineSubspace.mk' (Finset.centroid ℝ {i₁, i₂}ᶜ s.points) (Submodule.span ℝ {s.points i₁ -ᵥ s.points i₂})ᗮ ⊓
    affineSpan ℝ (Set.range s.points)


lemma homologySequence_exact₃ :
    (ShortComplex.mk _ _ (F.comp_homologySequenceδ T hT _ _ h)).Exact

(CategoryTheory.ShortComplex.mk ((F.shift n₀).map T.mor₂) (F.homologySequenceδ T n₀ n₁ h) ⋯).Exact


@[simp]
theorem bitCasesOn_bit {C : ℕ → Sort u} (H : ∀ b n, C (bit b n)) (b : Bool) (n : ℕ) :
    bitCasesOn (bit b n) H = H b n

(H : (b : Bool) → (n : ℕ) → C (Nat.bit b n))


protected theorem norm_ne_zero_iff {x : E K} :
    mixedEmbedding.norm x ≠ 0 ↔ ∀ w, normAtPlace w x ≠ 0

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

NumberField.mixedEmbedding.norm x ≠ 0 ↔
  ∀ (w : NumberField.InfinitePlace K), (NumberField.mixedEmbedding.normAtPlace w) x ≠ 0


@[to_additive]
theorem smulInvariantMeasure_map [SMul M α] [SMul M β]
    [MeasurableSMul M β]
    (μ : Measure α) [SMulInvariantMeasure M α μ] (f : α → β)
    (hsmul : ∀ (m : M) a, f (m • a) = m • f a) (hf : Measurable f) :
    SMulInvariantMeasure M β (map f μ)

[MeasureTheory.VAddInvariantMeasure M α μ]

(hsmul : ∀ (m : M) (a : α), f (m +ᵥ a) = m +ᵥ f a)

MeasureTheory.VAddInvariantMeasure M β (MeasureTheory.Measure.map f μ)


theorem sInf_neBot_of_directed [Nonempty α] {s : Set (Filter α)} (hd : DirectedOn (· ≥ ·) s)
    (hbot : ⊥ ∉ s) : NeBot (sInf s)

(hd : DirectedOn (fun x x_1 => x ≥ x_1) s)


theorem norm_ofNormedAddCommGroup_le {f : α → β} (hfc : Continuous f) {C : ℝ} (hC : 0 ≤ C)
    (hfC : ∀ x, ‖f x‖ ≤ C) : ‖ofNormedAddCommGroup f hfc C hfC‖ ≤ C

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
{f : α → β}
(hfc : Continuous f)
{C : ℝ}
(hC : 0 ≤ C)
(hfC : ∀ (x : α), ‖f x‖ ≤ C)

‖BoundedContinuousFunction.ofNormedAddCommGroup f hfc C hfC‖ ≤ C


theorem mfderivWithin_comp (hg : MDifferentiableWithinAt I' I'' g u (f x))
    (hf : MDifferentiableWithinAt I I' f s x) (h : s ⊆ f ⁻¹' u) (hxs : UniqueMDiffWithinAt I s x) :
    mfderivWithin I I'' (g ∘ f) s x =
      (mfderivWithin I' I'' g u (f x)).comp (mfderivWithin I I' f s x)

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


@[to_additive (attr := simp)] lemma one_ne_top : (1 : WithTop α) ≠ ⊤


@[simp]
theorem measure_toMeasurable (s : Set α) : μ (toMeasurable μ s) = μ s

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

μ (MeasureTheory.toMeasurable μ s) = μ s


/-- Right multiplication by a nonzero element in a `GroupWithZero` is a permutation of the
underlying type. -/
@[simps! (config := .asFn)]
protected def mulRight₀ (a : G) (ha : a ≠ 0) : Perm G

{G : Type u_1}
[GroupWithZero G]
(a : G)
(ha : a ≠ 0)

⇑(Equiv.mulRight₀ a ha) = fun x => x * a


theorem HomClass.map_constants {F M N} [L.Structure M] [L.Structure N] [FunLike F M N]
    [HomClass L F M N] (φ : F) (c : L.Constants) : φ c = c

{L : FirstOrder.Language}
{F : Type u_3}
{M : Type u_4}
{N : Type u_5}
[L.Structure M]
[L.Structure N]
[FunLike F M N]
[L.HomClass F M N]
(φ : F)
(c : L.Constants)


@[to_additive]
theorem iInter_smul_subset (s : ι → Set α) (t : Set β) : (⋂ i, s i) • t ⊆ ⋂ i, s i • t

{α : Type u_2}
{β : Type u_3}
{ι : Sort u_5}
[VAdd α β]
(s : ι → Set α)
(t : Set β)


theorem ae_of_ae_map {f : α → β} (hf : AEMeasurable f μ) {p : β → Prop} (h : ∀ᵐ y ∂μ.map f, p y) :
    ∀ᵐ x ∂μ, p (f x)

(h : ∀ᵐ (y : β) ∂MeasureTheory.Measure.map f μ, p y)


@[to_additive]
theorem measurePreserving_mul_right (μ : Measure G) [IsMulRightInvariant μ] (g : G) :
    MeasurePreserving (· * g) μ μ

{G : Type u_2}
[MeasurableSpace G]
[Mul G]
[MeasurableMul G]
(μ : MeasureTheory.Measure G)
[μ.IsMulRightInvariant]
(g : G)

MeasureTheory.MeasurePreserving (fun x => x * g) μ μ


theorem apply_eq_zero_iff (p : PMF α) (a : α) : p a = 0 ↔ a ∉ p.support


@[to_additive] lemma MulEquivClass.isMulFreimanIso [EquivLike F α β] [MulEquivClass F α β] (f : F)
    (hfAB : BijOn f A B) : IsMulFreimanIso n A B f

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{A : Set α}
{B : Set β}
{n : ℕ}
[EquivLike F α β]
[AddEquivClass F α β]
(f : F)
(hfAB : Set.BijOn (⇑f) A B)


/-- To show a property hold on all `TrivSqZeroExt R M` it suffices to show it holds
on terms of the form `inl r + inr m`. -/
@[elab_as_elim, induction_eliminator, cases_eliminator]
theorem ind {R M} [AddZeroClass R] [AddZeroClass M] {P : TrivSqZeroExt R M → Prop}
    (inl_add_inr : ∀ r m, P (inl r + inr m)) (x) : P x

(inl_add_inr : ∀ (r : R) (m : M), P (TrivSqZeroExt.inl r + TrivSqZeroExt.inr m))


theorem FG.map {N : Submodule R M} (hs : N.FG) : (N.map f).FG

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{P : Type u_3}
[AddCommMonoid P]
[Module R P]
(f : M →ₗ[R] P)
{N : Submodule R M}
(hs : N.FG)


@[to_additive]
theorem extend_one : HasCompactMulSupport (g.extend f 1)

{α : Type u_2}
{α' : Type u_3}
{β : Type u_4}
[TopologicalSpace α]
[TopologicalSpace α']
[Zero β]
{f : α → β}
[T2Space α']
(hf : HasCompactSupport f)
{g : α → α'}
(cont : Continuous g)

HasCompactSupport (Function.extend g f 0)


@[simp]
theorem permutationsAux_cons (t : α) (ts is : List α) :
    permutationsAux (t :: ts) is =
      foldr (fun y r => (permutationsAux2 t ts r y id).2) (permutationsAux ts (t :: is))
        (permutations is)

(t :: ts).permutationsAux is =
  List.foldr (fun y r => (List.permutationsAux2 t ts r y id).2) (ts.permutationsAux (t :: is)) is.permutations


theorem add_factorial_succ_le_factorial_add_succ (i : ℕ) (n : ℕ) :
    i + (n + 1)! ≤ (i + (n + 1))!

i + (n + 1).factorial ≤ (i + (n + 1)).factorial


@[simp]
theorem normalizer_normalizer {p : ℕ} [Fact p.Prime] [Finite (Sylow p G)] (P : Sylow p G) :
    (↑P : Subgroup G).normalizer.normalizer = (↑P : Subgroup G).normalizer

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


theorem Continuous.of_bundled (f : α → β) (hf : Monotone f) (hf' : Continuous ⟨f, hf⟩) :
    Continuous' f

(hf' : OmegaCompletePartialOrder.Continuous { toFun := f, monotone' := hf })


lemma isProbabilityMeasureGeometric (hp_pos : 0 < p) (hp_le_one : p ≤ 1) :
    IsProbabilityMeasure (geometricMeasure hp_pos hp_le_one)

{p : ℝ}
(hp_pos : 0 < p)
(hp_le_one : p ≤ 1)

MeasureTheory.IsProbabilityMeasure (ProbabilityTheory.geometricMeasure hp_pos hp_le_one)


theorem Filter.HasBasis.uniformEquicontinuousOn_iff_left {p : κ → Prop}
    {s : κ → Set (β × β)} {F : ι → β → α} {S : Set β} (hβ : (𝓤 β ⊓ 𝓟 (S ×ˢ S)).HasBasis p s) :
    UniformEquicontinuousOn F S ↔
      ∀ U ∈ 𝓤 α, ∃ k, p k ∧ ∀ x y, (x, y) ∈ s k → ∀ i, (F i x, F i y) ∈ U

{F : ι → β → α}

(hβ : (uniformity β ⊓ Filter.principal (S ×ˢ S)).HasBasis p s)

UniformEquicontinuousOn F S ↔ ∀ U ∈ uniformity α, ∃ k, p k ∧ ∀ (x y : β), (x, y) ∈ s k → ∀ (i : ι), (F i x, F i y) ∈ U


theorem CovBy.Iio_eq (h : a ⋖ b) : Iio b = Iic a

{α : Type u_1}
[LinearOrder α]
{a b : α}
(h : a ⋖ b)


@[to_additive (attr := simp)] lemma oneLePart_eq_self : a⁺ᵐ = a ↔ 1 ≤ a

{α : Type u_1}
[Lattice α]
[AddGroup α]
{a : α}


@[simp]
theorem strictAntiOn_toDual_comp_iff : StrictAntiOn (toDual ∘ f : α → βᵒᵈ) s ↔ StrictMonoOn f s

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s : Set α}

StrictAntiOn (⇑OrderDual.toDual ∘ f) s ↔ StrictMonoOn f s


@[simp]
theorem norm_mul_coe_unitary (A : E) (U : unitary E) : ‖A * U‖ = ‖A‖

{E : Type u_2}
[NormedRing E]
[StarRing E]
[CstarRing E]
(A : E)
(U : ↥(unitary E))

‖A * ↑U‖ = ‖A‖


theorem reflTransGen_iff_eq (h : ∀ b, ¬r a b) : ReflTransGen r a b ↔ b = a

{α : Type u_1}
{r : α → α → Prop}
{a b : α}
(h : ∀ (b : α), ¬r a b)


/-- An auxiliary equivalence useful in the proofs about
`FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a
`Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a
`Finset (Fin n)`.

The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to
`(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems
with non-definitional equalities. -/
@[simps]
def changeOriginIndexEquiv :
    (Σ k l : ℕ, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Σ n : ℕ, Finset (Fin n)

(FormalMultilinearSeries.changeOriginIndexEquiv.symm s).fst = s.fst - s.snd.card


theorem symm_apply_mem_iff_mem_image {α β : Type*} (e : α ≃ β) (s : Set α) (x : β) :
    e.symm x ∈ s ↔ x ∈ e '' s

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
(s : Set α)
(x : β)


/-- The exponent is zero iff for all nonzero `n`, one can find a `g` such that `g ^ n ≠ 1`. -/
@[to_additive "The exponent is zero iff for all nonzero `n`, one can find a `g` such that
`n • g ≠ 0`."]
theorem exponent_eq_zero_iff_forall : exponent G = 0 ↔ ∀ n > 0, ∃ g : G, g ^ n ≠ 1

Monoid.exponent G = 0 ↔ ∀ n > 0, ∃ g, g ^ n ≠ 1


@[simp]
theorem bind_cons (f : α → β) (g : α → Multiset β) :
    (s.bind fun a => f a ::ₘ g a) = map f s + s.bind g

{α : Type u_1}
{β : Type v}
(s : Multiset α)
(f : α → β)
(g : α → Multiset β)

(s.bind fun a => f a ::ₘ g a) = Multiset.map f s + s.bind g


theorem Coprime.mul_right {k m n : ℕ+} : k.Coprime m → k.Coprime n → k.Coprime (m * n)


theorem SOppSide.right_not_mem {s : AffineSubspace R P} {x y : P} (h : s.SOppSide x y) : y ∉ s

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y : P}
(h : s.SOppSide x y)


theorem ContDiff.smulRight {f : E → F →L[𝕜] 𝕜} {g : E → G} {n : ℕ∞} (hf : ContDiff 𝕜 n f)
    (hg : ContDiff 𝕜 n g) : ContDiff 𝕜 n fun x => (f x).smulRight (g x)

{𝕜 : 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]
{f : E → F →L[𝕜] 𝕜}
{g : E → G}
{n : ℕ∞}
(hf : ContDiff 𝕜 n f)
(hg : ContDiff 𝕜 n g)


theorem positive_le_strictlyPositive : strictlyPositive 𝕜 E ≤ positive 𝕜 E

(𝕜 : Type u_1)
(E : Type u_2)
[OrderedSemiring 𝕜]
[OrderedAddCommGroup E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]

ConvexCone.strictlyPositive 𝕜 E ≤ ConvexCone.positive 𝕜 E


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

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


theorem and_or_inj_right_iff :
    ∀ {m x y : Bool}, (x && m) = (y && m) ∧ (x || m) = (y || m) ↔ x = y


/-- If `Fₙ` tends uniformly to `f`, and `gₙ` tends to `x`, then `Fₙ gₙ` tends to `f x`. -/
theorem TendstoUniformly.tendsto_comp (h : TendstoUniformly F f p) (hf : ContinuousAt f x)
    (hg : Tendsto g p (𝓝 x)) : Tendsto (fun n => F n (g n)) p (𝓝 (f x))

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{x : α}
{p : Filter ι}
{g : ι → α}
[TopologicalSpace α]
(h : TendstoUniformly F f p)
(hf : ContinuousAt f x)
(hg : Filter.Tendsto g p (𝓝 x))

Filter.Tendsto (fun n => F n (g n)) p (𝓝 (f x))


/-- The standard triangle `K ⟶ L ⟶ mappingCone φ ⟶ K⟦(1 : ℤ)⟧` in `CochainComplex C ℤ`
attached to a morphism `φ : K ⟶ L`. It involves `φ`, `inr φ : L ⟶ mappingCone φ` and
the morphism induced by the `1`-cocycle `-mappingCone.fst φ`. -/
@[simps! obj₁ obj₂ obj₃ mor₁ mor₂]
noncomputable def triangle : Triangle (CochainComplex C ℤ)

(CochainComplex.mappingCone.triangle φ).obj₂ = L


lemma two_mul_card_edgeFinset :
    2 * G.edgeFinset.card = (univ.filter fun (x, y) ↦ G.Adj x y).card

{V : Type u}
(G : SimpleGraph V)
[Fintype V]
[DecidableRel G.Adj]
[Fintype (Sym2 V)]

2 * G.edgeFinset.card =
  (Finset.filter
      (fun x =>
        match x with
        | (x, y) => G.Adj x y)
      Finset.univ).card


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

{X Y B : Profinite}
(f : X ⟶ B)
(g : Y ⟶ B)

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


theorem gcd_eq (h : a ≡ b [MOD m]) : gcd a m = gcd b m


theorem sdiff_triangle (a b c : α) : a \ c ≤ a \ b ⊔ b \ c

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


protected theorem uniformContinuous [UniformSpace E] [UniformAddGroup E] [ContinuousConstSMul 𝕜 E]
    {p : Seminorm 𝕜 E} {r : ℝ} (hp : p.ball 0 r ∈ (𝓝 0 : Filter E)) :
    UniformContinuous p

{𝕜 : Type u_3}
{E : Type u_7}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[UniformSpace E]
[UniformAddGroup E]
[ContinuousConstSMul 𝕜 E]
{p : Seminorm 𝕜 E}
{r : ℝ}
(hp : p.ball 0 r ∈ 𝓝 0)


lemma castPred_succAbove (x : Fin n) (y : Fin (n + 1)) (h : castSucc x < y)
    (h' := Fin.ne_last_of_lt $ (succAbove_lt_iff_castSucc_lt ..).2 h) :
    (y.succAbove x).castPred h' = x

{n : ℕ}
(x : Fin n)
(y : Fin (n + 1))
(h : x.castSucc < y)
(h' : y.succAbove x ≠ Fin.last n := ⋯)


theorem coeff_toPowerSeries {f : HahnSeries ℕ R} {n : ℕ} :
    PowerSeries.coeff R n (toPowerSeries f) = f.coeff n

{R : Type u_2}
[Semiring R]
{f : HahnSeries ℕ R}
{n : ℕ}

(PowerSeries.coeff R n) (HahnSeries.toPowerSeries f) = f.coeff n


@[reassoc]
theorem hexagon_forward_inv (X Y Z : C) :
    (α_ Y Z X).inv ≫ (β_ X (Y ⊗ Z)).inv ≫ (α_ X Y Z).inv =
      Y ◁ (β_ X Z).inv ≫ (α_ Y X Z).inv ≫ (β_ X Y).inv ▷ Z

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


theorem tendsto_exp_comap_re_atBot_nhdsWithin : Tendsto exp (comap re atBot) (𝓝[≠] 0)

Filter.Tendsto Complex.exp (Filter.comap Complex.re Filter.atBot) (𝓝[≠] 0)


/-- The other direction does not hold because of the `s`-`s` cross terms on the RHS. -/
theorem image₂_distrib_subset_left {γ : Type*} {u : Finset γ} {f : α → δ → ε} {g : β → γ → δ}
    {f₁ : α → β → β'} {f₂ : α → γ → γ'} {g' : β' → γ' → ε}
    (h_distrib : ∀ a b c, f a (g b c) = g' (f₁ a b) (f₂ a c)) :
    image₂ f s (image₂ g t u) ⊆ image₂ g' (image₂ f₁ s t) (image₂ f₂ s u)

{f : α → δ → ε}

{g : β → γ → δ}

{f₁ : α → β → β'}

{f₂ : α → γ → γ'}

(h_distrib : ∀ (a : α) (b : β) (c : γ), f a (g b c) = g' (f₁ a b) (f₂ a c))

Finset.image₂ f s (Finset.image₂ g t u) ⊆ Finset.image₂ g' (Finset.image₂ f₁ s t) (Finset.image₂ f₂ s u)


theorem get_cons_zero (a : α) (v : Vector α n) : get (a ::ᵥ v) 0 = a

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


theorem intPow_negOfNat_bit0 {b' c' : ℕ} (h1 : Nat.pow a b' = c')
    (hb : nat_lit 2 * b' = b) (hc : c' * c' = c) :
    Int.pow (Int.negOfNat a) b = Int.ofNat c


@[simp]
theorem map_id : map (f₂ := f₁) (g₂ := g₁) (id V₁) (id W₁) rfl rfl = id (f₁.equalizer g₁)

{V₁ : Type u_3}
[SeminormedAddCommGroup V₁]
{W₁ : Type u_6}
[SeminormedAddCommGroup W₁]
{f₁ g₁ : NormedAddGroupHom V₁ W₁}

NormedAddGroupHom.Equalizer.map (NormedAddGroupHom.id V₁) (NormedAddGroupHom.id W₁) ⋯ ⋯ =
  NormedAddGroupHom.id ↥(f₁.equalizer g₁)


@[simp]
theorem tail_cons (a : α) (s : Stream' α) : tail (a::s) = s


theorem IsLowerSet.inter (hs : IsLowerSet s) (ht : IsLowerSet t) : IsLowerSet (s ∩ t)

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


@[to_additive (attr := simp)]
theorem empty_pow {n : ℕ} (hn : n ≠ 0) : (∅ : Set α) ^ n = ∅

{α : Type u_2}
[Monoid α]
{n : ℕ}
(hn : n ≠ 0)


theorem subseq_tendsto_of_neBot {f : Filter α} [IsCountablyGenerated f] {u : ℕ → α}
    (hx : NeBot (f ⊓ map u atTop)) : ∃ θ : ℕ → ℕ, StrictMono θ ∧ Tendsto (u ∘ θ) atTop f

(hx : (f ⊓ Filter.map u Filter.atTop).NeBot)

∃ θ, StrictMono θ ∧ Filter.Tendsto (u ∘ θ) Filter.atTop f


theorem not_all_isAtomic (φ : L.BoundedFormula α (n + 1)) : ¬φ.all.IsAtomic

{L : FirstOrder.Language}
{α : Type u'}
{n : ℕ}
(φ : L.BoundedFormula α (n + 1))


@[simp] theorem length_append (as bs : List α) : (as ++ bs).length = as.length + bs.length


theorem eq_dioph : Dioph fun v => f v = g v

{α : Type}
{f g : (α → ℕ) → ℕ}
(df : Dioph.DiophFn f)
(dg : Dioph.DiophFn g)


@[simp]
theorem op_toSubring (S : Subalgebra R A) : S.op.toSubring = S.toSubring.op

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
(S : Subalgebra R A)


@[to_additive]
theorem image_mul_left' : (a⁻¹ * ·) '' t = (a * ·) ⁻¹' t

{α : Type u_2}
[AddGroup α]
{t : Set α}
{a : α}

(fun x => -a + x) '' t = (fun x => a + x) ⁻¹' t


theorem Metric.closedBall_infDist_compl_subset_closure {x : F} {s : Set F} (hx : x ∈ s) :
    closedBall x (infDist x sᶜ) ⊆ closure s

{F : Type u_3}
[SeminormedAddCommGroup F]
[NormedSpace ℝ F]
{x : F}
{s : Set F}
(hx : x ∈ s)

Metric.closedBall x (Metric.infDist x sᶜ) ⊆ closure s


theorem HasFDerivWithinAt.congr_mono (h : HasFDerivWithinAt f f' s x) (ht : EqOn f₁ f t)
    (hx : f₁ x = f x) (h₁ : t ⊆ s) : HasFDerivWithinAt f₁ f' t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : E → F}
{f' : E →L[𝕜] F}
{x : E}
{s t : Set E}
(h : HasFDerivWithinAt f f' s x)
(ht : Set.EqOn f₁ f t)
(hx : f₁ x = f x)
(h₁ : t ⊆ s)


protected theorem unique_ext_iff [Unique α] {f g : α →₀ M} : f = g ↔ f default = g default

{α : Type u_1}
{M : Type u_5}
[Zero M]
[Unique α]
{f g : α →₀ M}


@[simp]
protected theorem add_tsub_cancel_left (ha : AddLECancellable a) : a + b - a = b

{α : Type u_1}
[PartialOrder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
{a b : α}
(ha : AddLECancellable a)


theorem injOn_of_injective (h : Injective f) {s : Set α} : InjOn f s

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


theorem algEquivOfEq_toAlgHom {p q : K[X]} (hp : p ≠ 0) (h_eq : p = q) :
    (algEquivOfEq hp h_eq).toAlgHom = liftHom p (root q) (by rw [h_eq, aeval_eq, mk_self])

{K : Type u_1}
[Field K]
{p q : K[X]}
(hp : p ≠ 0)
(h_eq : p = q)

↑(AdjoinRoot.algEquivOfEq hp h_eq) = AdjoinRoot.liftHom p (AdjoinRoot.root q) ⋯


theorem lex_lt_of_lt_of_preorder [∀ i, Preorder (α i)] (r) [IsStrictOrder ι r] {x y : Π₀ i, α i}
    (hlt : x < y) : ∃ i, (∀ j, r j i → x j ≤ y j ∧ y j ≤ x j) ∧ x i < y i

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Zero (α i)]
[(i : ι) → Preorder (α i)]
(r : ι → ι → Prop)
[IsStrictOrder ι r]
{x y : Π₀ (i : ι), α i}
(hlt : x < y)

∃ i, (∀ (j : ι), r j i → x j ≤ y j ∧ y j ≤ x j) ∧ x i < y i


theorem Equiv.Computable.symm {α β} [Primcodable α] [Primcodable β] {e : α ≃ β} :
    e.Computable → e.symm.Computable

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{e : α ≃ β}


theorem not_and_iff_or_not_not : ¬(a ∧ b) ↔ ¬a ∨ ¬b

¬(a ∧ b) ↔ ¬a ∨ ¬b


theorem findMax'_all {P : α → Prop} : ∀ (x : α) (t), P x → All P t → P (findMax' x t)

{α : Type u_1}
{P : α → Prop}
(x : α)
(t : Ordnode α)

P x → Ordnode.All P t → P (Ordnode.findMax' x t)


theorem norm_compLp_le (L : E →L[𝕜] F) (f : Lp E p μ) : ‖L.compLp f‖ ≤ ‖L‖ * ‖f‖

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


nonrec theorem ContinuousWithinAt.rpow (hf : ContinuousWithinAt f s x)
    (hg : ContinuousWithinAt g s x) (h : f x ≠ 0 ∨ 0 < g x) :
    ContinuousWithinAt (fun t => f t ^ g t) s x

{α : Type u_1}
[TopologicalSpace α]
{f g : α → ℝ}
{s : Set α}
{x : α}
(hf : ContinuousWithinAt f s x)
(hg : ContinuousWithinAt g s x)
(h : f x ≠ 0 ∨ 0 < g x)


@[simp] lemma of_Lawson_symm_eq : (@ofLawson α).symm = toLawson


@[to_additive]
theorem OneHom.cancel_left [One M] [One N] [One P] {g : OneHom N P} {f₁ f₂ : OneHom M N}
    (hg : Function.Injective g) : g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[One M]
[One N]
[One P]
{g : OneHom N P}
{f₁ f₂ : OneHom M N}
(hg : Function.Injective ⇑g)


theorem coprodMap_apply (f : ∀ i : ι, M i →ₗ[R] N) (x : Π₀ i, M i) :
    coprodMap f x =
      DFinsupp.sum (mapRange (fun i => f i) (fun _ => LinearMap.map_zero _) x) fun _ =>
        id

{ι : Type u_1}
{R : Type u_2}
{M : ι → Type u_4}
{N : Type u_5}
[Semiring R]
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
[AddCommMonoid N]
[Module R N]
[DecidableEq ι]
[(x : N) → Decidable (x ≠ 0)]
(f : (i : ι) → M i →ₗ[R] N)
(x : Π₀ (i : ι), M i)

(DFinsupp.coprodMap f) x = (DFinsupp.mapRange (fun i => ⇑(f i)) ⋯ x).sum fun x => id


/-- A complete upper-modular lattice that is atomistic is strongly atomic.
Not an instance to prevent loops. -/
theorem CompleteLattice.isStronglyAtomic [IsUpperModularLattice α] [IsAtomistic α] :
    IsStronglyAtomic α

{α : Type u_2}
[CompleteLattice α]
[IsUpperModularLattice α]
[IsAtomistic α]


/-- A **bornology** on a type `α` is a filter of cobounded sets which contains the cofinite filter.
Such spaces are equivalently specified by their bounded sets, see `Bornology.ofBounded`
and `Bornology.ext_iff_isBounded`-/
class Bornology (α : Type*) where
  /-- The filter of cobounded sets in a bornology. This is a field of the structure, but one
  should always prefer `Bornology.cobounded` because it makes the `α` argument explicit. -/
  cobounded' : Filter α
  /-- The cobounded filter in a bornology is smaller than the cofinite filter. This is a field of
  the structure, but one should always prefer `Bornology.le_cofinite` because it makes the `α`
  argument explicit. -/
  le_cofinite' : cobounded' ≤ cofinite


theorem smul_left (a : R) (x y : M) : B (a • x) y = a * B x y

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


lemma nonsingular_iff (P : Fin 3 → R) : W.Nonsingular P ↔ W.Equation P ∧
    (W.a₁ * P y * P z ≠ 3 * P x ^ 2 + 2 * W.a₂ * P x * P z + W.a₄ * P z ^ 2 ∨
      P y * P z ≠ -P y * P z - W.a₁ * P x * P z - W.a₃ * P z ^ 2 ∨
      P y ^ 2 + W.a₁ * P x * P y + 2 * W.a₃ * P y * P z
        ≠ W.a₂ * P x ^ 2 + 2 * W.a₄ * P x * P z + 3 * W.a₆ * P z ^ 2)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)
(P : Fin 3 → R)


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

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


theorem coe_multilinearMap_injective :
    Function.Injective ((↑) : M [⋀^ι]→ₗ[R] N → MultilinearMap R (fun _ : ι => M) N)

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}


/-- The inverse in the equivalence of sheaf categories. -/
@[simps!]
def sheafCongr.inverse : Sheaf K A ⥤ Sheaf J A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[CategoryTheory.Equivalence.TransportsGrothendieckTopology J K e]

((CategoryTheory.Equivalence.sheafCongr.inverse J K e A).obj F).val.obj X =
  F.val.obj (Opposite.op (e.functor.obj (Opposite.unop X)))


theorem cardinal_mk_algHom (K : Type u) (V : Type v) (W : Type w) [Field K] [Field V] [Algebra K V]
    [FiniteDimensional K V] [Field W] [Algebra K W] :
    Cardinal.mk (V →ₐ[K] W) ≤ finrank W (V →ₗ[K] W)

Cardinal.mk (V →ₐ[K] W) ≤ ↑(FiniteDimensional.finrank W (V →ₗ[K] W))


theorem cast_le_cast (eq : n = m) {a b : Fin n} : cast eq a ≤ cast eq b ↔ a ≤ b


/-- The only prime factor of prime `p` is `p` itself. -/
theorem Prime.eq_of_factorization_pos {p q : ℕ} (hp : Prime p) (h : p.factorization q ≠ 0) :
    p = q

{p q : ℕ}
(hp : Nat.Prime p)
(h : p.factorization q ≠ 0)


@[simp]
theorem ofNat_range : Set.range (ofNat s) = Set.univ

{s : Set ℕ}
[Infinite ↑s]
[DecidablePred fun x => x ∈ s]

Set.range (Nat.Subtype.ofNat s) = Set.univ


/-- Given a finpartition `P` of `a` and finpartitions of each part of `P`, this yields the
finpartition of `a` obtained by juxtaposing all the subpartitions. -/
@[simps]
def bind (P : Finpartition a) (Q : ∀ i ∈ P.parts, Finpartition i) : Finpartition a

(Q : (i : α) → i ∈ P.parts → Finpartition i)

(P.bind Q).parts = P.parts.attach.biUnion fun i => (Q ↑i ⋯).parts


@[simp]
theorem subtype_comp_codRestrict (f : M →[L] N) (p : L.Substructure N) (h : ∀ b, f b ∈ p) :
    p.subtype.toHom.comp (codRestrict p f h) = f

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(f : L.Hom M N)
(p : L.Substructure N)
(h : ∀ (b : M), f b ∈ p)

p.subtype.toHom.comp (FirstOrder.Language.Hom.codRestrict p f h) = f


theorem nfp_le_of_principal {op : Ordinal → Ordinal → Ordinal} {a o : Ordinal} (hao : a < o)
    (ho : Principal op o) : nfp (op a) a ≤ o

{op : Ordinal.{u_1} → Ordinal.{u_1} → Ordinal.{u_1}}


@[simp] theorem mk_eq_bot_iff {N : Submodule R M} {h} :
    (⟨N, h⟩ : LieSubmodule R L M) = ⊥ ↔ N = ⊥

{h : ∀ {x : L} {m : M}, m ∈ N.carrier → ⁅x, m⁆ ∈ N.carrier}

{ toSubmodule := N, lie_mem := h } = ⊥ ↔ N = ⊥


/-- Re-indexing the components of the tensor product by an equivalence `e` is compatible
with `PiTensorProduct.map`. -/
theorem map_comp_reindex_eq (f : Π i, s i →ₗ[R] t i) (e : ι ≃ ι₂) :
    map (fun i ↦ f (e.symm i)) ∘ₗ reindex R s e = reindex R t e ∘ₗ map f

{ι : Type u_1}
{ι₂ : Type u_2}
{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)
(e : ι ≃ ι₂)

(PiTensorProduct.map fun i => f (e.symm i)) ∘ₗ ↑(PiTensorProduct.reindex R s e) =
  ↑(PiTensorProduct.reindex R t e) ∘ₗ PiTensorProduct.map f


@[simp]
theorem principal_empty : 𝓟 (∅ : Set α) = ⊥


@[simp]
theorem id_toLinearMap : (CoalgHom.id R A : A →ₗ[R] A) = LinearMap.id

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[CoalgebraStruct R A]


@[simp]
lemma zero_hom : (0 : Ext X Y n).hom = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
(X Y : C)
(n : ℕ)
[HasDerivedCategory C]


private lemma add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q

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


lemma finitePresentation_of_isFinite [P.IsFinite] :
    FinitePresentation R S

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(P : Algebra.Presentation R S)
[P.IsFinite]


/-- **Ruzsa's triangle inequality**. Div-mul-mul version. -/
@[to_additive "**Ruzsa's triangle inequality**. Sub-add-add version."]
theorem ruzsa_triangle_inequality_div_mul_mul (A B C : Finset α) :
    (A / C).card * B.card ≤ (A * B).card * (B * C).card

{α : Type u_1}
[CommGroup α]
[DecidableEq α]
(A B C : Finset α)


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

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


theorem basis_repr_abs_le_const_mul_house (α : 𝓞 K) (i : K →+* ℂ) :
    Complex.abs (((integralBasis K).reindex (equivReindex K).symm).repr α i) ≤
      (c K) * house (algebraMap (𝓞 K) K α)

(K : Type u_1)
[Field K]
[NumberField K]
[DecidableEq (K →+* ℂ)]
(α : NumberField.RingOfIntegers K)
(i : K →+* ℂ)

Complex.abs ↑((((NumberField.integralBasis K).reindex (NumberField.equivReindex K).symm).repr ↑α) i) ≤
  NumberField.house.c K * NumberField.house ((algebraMap (NumberField.RingOfIntegers K) K) α)


/-- The difference of two `C^n` functions on a domain is `C^n`. -/
theorem ContDiffOn.sub {s : Set E} {f g : E → F} (hf : ContDiffOn 𝕜 n f s)
    (hg : ContDiffOn 𝕜 n g s) : ContDiffOn 𝕜 n (fun x => f x - g x) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{s : Set E}
{f g : E → F}
(hf : ContDiffOn 𝕜 n f s)
(hg : ContDiffOn 𝕜 n g s)


/-- The submonoid generated by an element of a monoid equals the set of natural number powers of
    the element. -/
@[to_additive
      "The `AddSubmonoid` generated by an element of an `AddMonoid` equals the set of
      natural number multiples of the element."]
theorem closure_singleton {x : M} : Closure ({x} : Set M) = powers x


protected theorem add_le_add_iff_left (a : Int) : a + b ≤ a + c ↔ b ≤ c


protected lemma zero_eq_mul : 0 = m * n ↔ m = 0 ∨ n = 0


@[simp]
theorem isSubordinate_toPartitionOfUnity :
    f.toPartitionOfUnity.IsSubordinate U ↔ f.IsSubordinate U

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
{f : SmoothPartitionOfUnity ι I M s}
{U : ι → Set M}


theorem eq_rnDeriv₀ [SigmaFinite ν] {s : Measure α} {f : α → ℝ≥0∞}
    (hf : AEMeasurable f ν) (hs : s ⟂ₘ ν) (hadd : μ = s + ν.withDensity f) :
    f =ᵐ[ν] μ.rnDeriv ν

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite ν]
{s : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : AEMeasurable f ν)
(hs : s ⟂ₘ ν)
(hadd : μ = s + ν.withDensity f)


theorem iInf_Ioi_eq_iInf_rat_gt {f : ℝ → ℝ} (x : ℝ) (hf : BddBelow (f '' Ioi x))
    (hf_mono : Monotone f) : ⨅ r : Ioi x, f r = ⨅ q : { q' : ℚ // x < q' }, f q

{f : ℝ → ℝ}
(x : ℝ)
(hf : BddBelow (f '' Set.Ioi x))
(hf_mono : Monotone f)


/-- The `StarSubalgebra.inclusion` of a star subalgebra is an `Embedding`. -/
theorem embedding_inclusion {S₁ S₂ : StarSubalgebra R A} (h : S₁ ≤ S₂) : Embedding (inclusion h)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[TopologicalSpace A]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
{S₁ S₂ : StarSubalgebra R A}
(h : S₁ ≤ S₂)


theorem div_sat (c : Constraint) (t : Int) (k : Nat) (n : k ≠ 0) (h : (k : Int) ∣ t) (w : c.sat t) :
    (c.div k).sat (t / k)

(c : Lean.Omega.Constraint)
(t : Int)
(k : Nat)
(n : k ≠ 0)
(h : ↑k ∣ t)
(w : c.sat t = true)


@[simp]
theorem coe_id : ⇑(EsakiaHom.id α) = id

(α : Type u_2)
[TopologicalSpace α]
[Preorder α]


@[simp]
theorem coe_smul : ⇑(r • X) = r • ⇑X

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(r : 𝕜)
(X : LeftInvariantDerivation I G)


@[simp] theorem im_imJ : a.im.imJ = a.imJ


/-- An additive character maps negatives to inverses (when defined) -/
lemma map_neg_eq_inv (ψ : AddChar A M) (a : A) : ψ (-a) = (ψ a)⁻¹

{A : Type u_1}
{M : Type u_2}
[AddGroup A]
[DivisionMonoid M]
(ψ : AddChar A M)
(a : A)


theorem whiskerLeft_iff {X Y : C} (f g : X ⟶ Y) : 𝟙_ C ◁ f = 𝟙_ C ◁ g ↔ f = g

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

CategoryTheory.MonoidalCategory.whiskerLeft (𝟙_ C) f = CategoryTheory.MonoidalCategory.whiskerLeft (𝟙_ C) g ↔ f = g


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

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


theorem doubleFactorial_eq_prod_even : ∀ n : ℕ, (2 * n)‼ = ∏ i ∈ Finset.range n, 2 * (i + 1)


@[norm_cast]
theorem coe_projIcc (a b : α) (h : a ≤ b) (x : α) : (projIcc a b h x : α) = max a (min b x)

{α : Type u_1}
[LinearOrder α]
(a b : α)
(h : a ≤ b)
(x : α)

↑(Set.projIcc a b h x) = max a (min b x)


/-- Given congruence relations `c, d` on a monoid such that `d` contains `c`, the definition of
    the homomorphism from the quotient by `c` to the quotient by `d` induced by `d`'s quotient
    map. -/
@[to_additive "Given additive congruence relations `c, d` on an `AddMonoid` such that `d`
contains `c`, the definition of the homomorphism from the quotient by `c` to the quotient by `d`
induced by `d`'s quotient map."]
theorem map_apply {c d : Con M} (h : c ≤ d) (x) :
    c.map d h x = c.lift d.mk' (fun _ _ hc => d.eq.2 <| h hc) x

{M : Type u_1}
[AddZeroClass M]
{c d : AddCon M}
(h : c ≤ d)
(x : c.Quotient)


theorem wOppSide_lineMap_left {s : AffineSubspace R P} {x : P} (y : P) (h : x ∈ s) {t : R}
    (ht : t ≤ 0) : s.WOppSide (lineMap x y t) y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x : P}
(y : P)
(h : x ∈ s)
{t : R}
(ht : t ≤ 0)

s.WOppSide ((AffineMap.lineMap x y) t) y


@[to_additive]
theorem hasProd_ite_eq (b : β) [DecidablePred (· = b)] (a : α) :
    HasProd (fun b' ↦ if b' = b then a else 1) a

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
(b : β)
[DecidablePred fun x => x = b]
(a : α)

HasSum (fun b' => if b' = b then a else 0) a


theorem iteratedFDeriv_succ_apply_right {n : ℕ} (m : Fin (n + 1) → E) :
    (iteratedFDeriv 𝕜 (n + 1) f x : (Fin (n + 1) → E) → F) m =
      iteratedFDeriv 𝕜 n (fun y => fderiv 𝕜 f y) x (init m) (m (last n))

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{n : ℕ}
(m : Fin (n + 1) → E)

(iteratedFDeriv 𝕜 (n + 1) f x) m = ((iteratedFDeriv 𝕜 n (fun y => fderiv 𝕜 f y) x) (Fin.init m)) (m (Fin.last n))