lemma InfClosed.image [FunLike F α β] [InfHomClass F α β] (hs : InfClosed s) (f : F) :
    InfClosed (f '' s)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[SemilatticeInf β]
{s : Set α}
[FunLike F α β]
[InfHomClass F α β]
(hs : InfClosed s)
(f : F)


@[ext]
theorem hom_ext ⦃f g : FreeRing α →+* R⦄ (h : ∀ x, f (of x) = g (of x)) : f = g

(h : ∀ (x : α), f (FreeRing.of x) = g (FreeRing.of x))


protected theorem hasSum_repr_symm (b : HilbertBasis ι 𝕜 E) (f : ℓ²(ι, 𝕜)) :
    HasSum (fun i => f i • b i) (b.repr.symm f)

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(b : HilbertBasis ι 𝕜 E)
(f : ↥(lp (fun i => 𝕜) 2))

HasSum (fun i => ↑f i • (fun i => b.repr.symm (lp.single 2 i 1)) i) (b.repr.symm f)


theorem coordChange_same (e : Trivialization F proj) {b : B} (h : b ∈ e.baseSet) :
    e.coordChange e b = id

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


/-- Implementation of `Mon_.equivLaxMonoidalFunctorPUnit`. -/
@[simps]
def monToLaxMonoidal : Mon_ C ⥤ LaxMonoidalFunctor (Discrete PUnit.{u + 1}) C

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

∀ {X Y : Mon_ C} (f : X ⟶ Y) (x : CategoryTheory.Discrete PUnit.{u + 1}),
  ((Mon_.EquivLaxMonoidalFunctorPUnit.monToLaxMonoidal C).map f).app x = f.hom


@[simp] theorem countP_nil : countP p [] = 0


@[simp]
theorem cmpLE_ofDual [LE α] [@DecidableRel α (· ≤ ·)] (x y : αᵒᵈ) :
    cmpLE (ofDual x) (ofDual y) = cmpLE y x

{α : Type u_1}
[LE α]
[DecidableRel fun x x_1 => x ≤ x_1]
(x y : αᵒᵈ)

cmpLE (OrderDual.ofDual x) (OrderDual.ofDual y) = cmpLE y x


lemma coe_killingCompl_top :
    killingCompl R L ⊤ = LinearMap.ker (killingForm R L)

(R : Type u_1)
(L : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]

(lieIdealSubalgebra R L (LieIdeal.killingCompl R L ⊤)).toSubmodule = LinearMap.ker (killingForm R L)


/-- If `f` is monotone both on `(-∞, a]` and `[a, ∞)`, then it is monotone on the whole line. -/
protected theorem MonotoneOn.Iic_union_Ici (h₁ : MonotoneOn f (Iic a)) (h₂ : MonotoneOn f (Ici a)) :
    Monotone f

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Preorder β]
{a : α}
{f : α → β}
(h₁ : MonotoneOn f (Set.Iic a))
(h₂ : MonotoneOn f (Set.Ici a))


@[simp]
theorem norm_div (a b : α) : ‖a / b‖ = ‖a‖ / ‖b‖

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


@[to_additive]
theorem Group.rank_le_of_surjective [Group.FG G] [Group.FG G'] (f : G →* G')
    (hf : Function.Surjective f) : Group.rank G' ≤ Group.rank G

{G : Type u_3}
[AddGroup G]
{G' : Type u_5}
[AddGroup G']
[AddGroup.FG G]
[AddGroup.FG G']
(f : G →+ G')
(hf : Function.Surjective ⇑f)


/-- `X ⨯ -` has a comonad structure. This is sometimes called the writer comonad. -/
@[simps!]
def prodComonad : Comonad C

(CategoryTheory.prodComonad X).δ.app Y =
  CategoryTheory.Limits.prod.lift CategoryTheory.Limits.prod.fst (CategoryTheory.CategoryStruct.id (X ⨯ Y))


theorem eval₂Hom_bind₂ (f : S →+* T) (g : σ → T) (h : R →+* MvPolynomial σ S)
    (φ : MvPolynomial σ R) : eval₂Hom f g (bind₂ h φ) = eval₂Hom ((eval₂Hom f g).comp h) g φ

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

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


/-- To give an isomorphism between cones, it suffices to give an
  isomorphism between their vertices which commutes with the cone
  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' : Cone 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.Cones.ext φ w).hom.hom = φ.hom


@[simp]
theorem pullback_symmetry_hom_of_epi_eq [Epi f] : (pushoutSymmetry f f).hom = 𝟙 _

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

(CategoryTheory.Limits.pushoutSymmetry f f).hom = 𝟙 (CategoryTheory.Limits.pushout f f)


@[reassoc]
lemma D₁_totalShift₁XIso_hom (n₀ n₁ n₀' n₁' : ℤ) (h₀ : n₀ + x = n₀') (h₁ : n₁ + x = n₁') :
    ((shiftFunctor₁ C x).obj K).D₁ (up ℤ) n₀ n₁ ≫ (K.totalShift₁XIso x n₁ n₁' h₁).hom =
      x.negOnePow • ((K.totalShift₁XIso x n₀ n₀' h₀).hom ≫ K.D₁ (up ℤ) n₀' n₁')

(K : HomologicalComplex₂ C (ComplexShape.up ℤ) (ComplexShape.up ℤ))

((HomologicalComplex₂.shiftFunctor₁ C x).obj K).D₁ (ComplexShape.up ℤ) n₀ n₁ ≫ (K.totalShift₁XIso x n₁ n₁' h₁).hom =
  x.negOnePow • (K.totalShift₁XIso x n₀ n₀' h₀).hom ≫ K.D₁ (ComplexShape.up ℤ) n₀' n₁'


/-- Forget the cone structure and obtain just the cone point. -/
@[simps]
def forget : Cone F ⥤ C

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

∀ {X Y : CategoryTheory.Limits.Cone F} (f : X ⟶ Y), (CategoryTheory.Limits.Cones.forget F).map f = f.hom


theorem one_lt_rOut_div_rIn {c : E} (f : ContDiffBump c) : 1 < f.rOut / f.rIn

{E : Type u_1}
{c : E}
(f : ContDiffBump c)


@[reassoc (attr := simp)]
lemma XIsoOfEq_hom_comp_d (K : HomologicalComplex V c) {p₁ p₂ : ι} (h : p₁ = p₂) (p₃ : ι) :
    (K.XIsoOfEq h).hom ≫ K.d p₂ p₃ = K.d p₁ p₃


/-- Given a diagram `D` of colimit cocones over the `F.obj j`, and a cocone over `uncurry.obj F`,
we can construct a cocone over the diagram consisting of the cocone points from `D`.
-/
@[simps]
def coconeOfCoconeUncurry {D : DiagramOfCocones F} (Q : ∀ j, IsColimit (D.obj j))
    (c : Cocone (uncurry.obj F)) : Cocone D.coconePoints

{D : CategoryTheory.Limits.DiagramOfCocones F}

(Q : (j : J) → CategoryTheory.Limits.IsColimit (D.obj j))

(c : CategoryTheory.Limits.Cocone (CategoryTheory.uncurry.obj F))

(CategoryTheory.Limits.coconeOfCoconeUncurry Q c).pt = c.pt


/-- The adjacency matrix of `G` is an adjacency matrix. -/
@[simp]
theorem isAdjMatrix_adjMatrix [Zero α] [One α] : (G.adjMatrix α).IsAdjMatrix

{V : Type u_1}
(α : Type u_2)
(G : SimpleGraph V)
[DecidableRel G.Adj]
[Zero α]
[One α]


lemma σ_symm (i₁ : I₁) (i₂ : I₂) :
    σ c₂ c₁ c₁₂ i₂ i₁ = σ c₁ c₂ c₁₂ i₁ i₂

[TotalComplexShapeSymmetrySymmetry c₁ c₂ c₁₂]

c₂.σ c₁ c₁₂ i₂ i₁ = c₁.σ c₂ c₁₂ i₁ i₂


@[to_additive]
theorem inter_smul_subset [DecidableEq α] : (s₁ ∩ s₂) • t ⊆ s₁ • t ∩ s₂ • t

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


/-- Left component of the associator as a natural isomorphism. -/
@[simps!]
def associatorNatIsoLeft (a : B) (g : b ⟶ c) (h : c ⟶ d) :
    (postcomposing a ..).obj g ⋙ (postcomposing ..).obj h ≅ (postcomposing ..).obj (g ≫ h)

{B : Type u}
[CategoryTheory.Bicategory B]
{b c d : B}
(a : B)
(g : b ⟶ c)
(h : c ⟶ d)
(X : a ⟶ b)

(CategoryTheory.Bicategory.associatorNatIsoLeft a g h).hom.app X = (CategoryTheory.Bicategory.associator X g h).hom


/-- The only prime factor of prime `p` is `p` itself, with multiplicity `1` -/
@[simp]
protected theorem Prime.factorization {p : ℕ} (hp : Prime p) : p.factorization = single p 1


theorem norm_integral_le_of_le_const {c : ℝ}
    (hc : ∀ x ∈ Box.Icc I, ‖f x‖ ≤ c) (μ : Measure ℝⁿ) [IsLocallyFiniteMeasure μ] :
    ‖(integral I l f μ.toBoxAdditive.toSMul : E)‖ ≤ (μ I).toReal * c

(hc : ∀ x ∈ BoxIntegral.Box.Icc I, ‖f x‖ ≤ c)

‖BoxIntegral.integral I l f μ.toBoxAdditive.toSMul‖ ≤ (μ ↑I).toReal * c


@[norm_cast]
theorem coe_ne_one {x : ℝ} : (x : ℝ*) ≠ 1 ↔ x ≠ 1

↑x ≠ 1 ↔ x ≠ 1


@[simp, mfld_simps]
theorem subtypeRestr_coe :
    ((e.subtypeRestr hs : PartialHomeomorph s Y) : s → Y) = Set.restrict ↑s (e : X → Y)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{s : TopologicalSpace.Opens X}
(hs : Nonempty ↥s)


/-- An altitude is one-dimensional (i.e., a line). -/
@[simp]
theorem finrank_direction_altitude {n : ℕ} (s : Simplex ℝ P (n + 1)) (i : Fin (n + 2)) :
    finrank ℝ (s.altitude i).direction = 1

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

FiniteDimensional.finrank ℝ ↥(s.altitude i).direction = 1


theorem ext_iff (x y : HahnModule Γ R V) :
    ((of R).symm x).coeff = ((of R).symm y).coeff ↔ x = y

{Γ : Type u_1}
{R : Type u_3}
{V : Type u_4}
[PartialOrder Γ]
[Zero V]
[SMul R V]
(x y : HahnModule Γ R V)

((HahnModule.of R).symm x).coeff = ((HahnModule.of R).symm y).coeff ↔ x = y


theorem and_right_comm : (a ∧ b) ∧ c ↔ (a ∧ c) ∧ b


@[to_additive]
theorem le_inv_iff_mul_le_one_left : a ≤ b⁻¹ ↔ b * a ≤ 1

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


/-- If `α` is a linear succ order, `β` is a preorder, and `f : α → β` is a monotone function, then
the intervals `Set.Ioo (f n) (f (Order.succ n))` are pairwise disjoint. -/
theorem pairwise_disjoint_on_Ioo_succ [SuccOrder α] [Preorder β] {f : α → β} (hf : Monotone f) :
    Pairwise (Disjoint on fun n => Ioo (f n) (f (succ n)))

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[SuccOrder α]
[Preorder β]
{f : α → β}
(hf : Monotone f)

Pairwise (Disjoint on fun n => Set.Ioo (f n) (f (Order.succ n)))


@[to_additive]
theorem MonoidHomClass.isometry_iff_norm [MonoidHomClass 𝓕 E F] (f : 𝓕) :
    Isometry f ↔ ∀ x, ‖f x‖ = ‖x‖

{𝓕 : Type u_1}
{E : Type u_3}
{F : Type u_4}
[SeminormedAddGroup E]
[SeminormedAddGroup F]
[FunLike 𝓕 E F]
[AddMonoidHomClass 𝓕 E F]
(f : 𝓕)


theorem ack_pair_lt (m n k : ℕ) : ack m (pair n k) < ack (m + 4) (max n k)

ack m (Nat.pair n k) < ack (m + 4) (max n k)


@[simp]
theorem cycleRange_zero (n : ℕ) : cycleRange (0 : Fin n.succ) = 1


theorem natDegree_linear (ha : a ≠ 0) : natDegree (C a * X + C b) = 1

{R : Type u}
{a b : R}
[Semiring R]
(ha : a ≠ 0)

(Polynomial.C a * Polynomial.X + Polynomial.C b).natDegree = 1


@[simp]
theorem coprod_apply (f : M →ₗ[R] M₃) (g : M₂ →ₗ[R] M₃) (x : M × M₂) :
    coprod f g x = f x.1 + g x.2

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


theorem ceil_eq_on_Ioc (z : ℤ) : ∀ a ∈ Set.Ioc (z - 1 : α) z, ⌈a⌉ = z

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(z : ℤ)
(a : α)


theorem le_sub_one_of_lt {a b : ℕ+} (hab : a < b) : a ≤ b - (1 : ℕ+)


theorem mellin_const_smul (f : ℝ → E) (s : ℂ) {𝕜 : Type*} [NontriviallyNormedField 𝕜]
    [NormedSpace 𝕜 E] [SMulCommClass ℂ 𝕜 E] (c : 𝕜) :
    mellin (fun t => c • f t) s = c • mellin f s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(f : ℝ → E)
(s : ℂ)
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[SMulCommClass ℂ 𝕜 E]
(c : 𝕜)


/-- When `V` is monoidal the forgetful functor `Action V G` to `V` is monoidal. -/
@[simps]
def forgetMonoidal : MonoidalFunctor (Action V G) V

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
(G : MonCat)
[CategoryTheory.MonoidalCategory V]

(Action.forgetMonoidal V G).ε = 𝟙 (𝟙_ V)


@[to_additive]
theorem Filter.Tendsto.smul {f : α → M} {g : α → X} {l : Filter α} {c : M} {a : X}
    (hf : Tendsto f l (𝓝 c)) (hg : Tendsto g l (𝓝 a)) :
    Tendsto (fun x => f x • g x) l (𝓝 <| c • a)

{M : Type u_1}
{X : Type u_2}
{α : Type u_4}
[TopologicalSpace M]
[TopologicalSpace X]
[VAdd M X]
[ContinuousVAdd M X]
{f : α → M}
{g : α → X}
{l : Filter α}
{c : M}
{a : X}
(hf : Filter.Tendsto f l (𝓝 c))
(hg : Filter.Tendsto g l (𝓝 a))

Filter.Tendsto (fun x => f x +ᵥ g x) l (𝓝 (c +ᵥ a))


/-- Continuity of the measure of translates of a compact set: Given a compact set `k` in a
topological group, for `g` close enough to the origin, `μ (g • k \ k)` is arbitrarily small. -/
@[to_additive]
lemma eventually_nhds_one_measure_smul_diff_lt [LocallyCompactSpace G]
    [IsFiniteMeasureOnCompacts μ] [InnerRegularCompactLTTop μ] {k : Set G}
    (hk : IsCompact k) (h'k : IsClosed k) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∀ᶠ g in 𝓝 (1 : G), μ (g • k \ k) < ε


theorem eqOn_piecewise {f f' g : α → β} {t} :
    EqOn (s.piecewise f f') g t ↔ EqOn f g (t ∩ s) ∧ EqOn f' g (t ∩ sᶜ)

{α : Type u_1}
{β : Type u_2}
(s : Set α)
[(j : α) → Decidable (j ∈ s)]
{f f' g : α → β}
{t : Set α}

Set.EqOn (s.piecewise f f') g t ↔ Set.EqOn f g (t ∩ s) ∧ Set.EqOn f' g (t ∩ sᶜ)


theorem prod_le_prod_iff_le [Nontrivial α] {p q : Multiset (Associates α)}
    (hp : ∀ a ∈ p, Irreducible a) (hq : ∀ a ∈ q, Irreducible a) : p.prod ≤ q.prod ↔ p ≤ q

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
[Nontrivial α]
{p q : Multiset (Associates α)}
(hp : ∀ a ∈ p, Irreducible a)
(hq : ∀ a ∈ q, Irreducible a)


@[simp]
theorem involute_v (m : M) : involute (v Q m) = -v Q m

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

CliffordAlgebra.involute ((CliffordAlgebra.EquivEven.v Q) m) = -(CliffordAlgebra.EquivEven.v Q) m


lemma StrictMonoOn.image_Ioc_subset (h : StrictMonoOn f (Icc a b)) :
    f '' Ioc a b ⊆ Ioc (f a) (f b)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[PartialOrder α]
[Preorder β]
{a b : α}
(h : StrictMonoOn f (Set.Icc a b))


protected nonrec theorem ContMDiffAt.coordChange
    (hf : ContMDiffAt IM IB n f x) (hg : ContMDiffAt IM 𝓘(𝕜, F) n g x) (he : f x ∈ e.baseSet)
    (he' : f x ∈ e'.baseSet) :
    ContMDiffAt IM 𝓘(𝕜, F) n (fun y ↦ e.coordChange e' (f y) (g y)) x

[TopologicalSpace (Bundle.TotalSpace F E)]

{e e' : Trivialization F Bundle.TotalSpace.proj}

ContMDiffAt IM 𝓘(𝕜, F) n (fun y => e.coordChange e' (f y) (g y)) x


protected lemma sub_add_sub_cancel (hab : b ≤ a) (hcb : c ≤ b) : a - b + (b - c) = a - c


/-- If a basis is multiplied columnwise by scalars `w : ι → Rˣ`, then the determinant with respect
to this basis is multiplied by the product of the inverse of these scalars. -/
theorem Basis.det_unitsSMul (e : Basis ι R M) (w : ι → Rˣ) :
    (e.unitsSMul w).det = (↑(∏ i, w i)⁻¹ : R) • e.det

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
(e : Basis ι R M)
(w : ι → Rˣ)

(e.unitsSMul w).det = ↑(∏ i : ι, w i)⁻¹ • e.det


@[to_additive (attr := simp)]
theorem orderOf_one : orderOf (1 : G) = 1


theorem lf_moveRight_of_le {x y : PGame} (h : x ≤ y) (j) : x ⧏ y.moveRight j

{x y : SetTheory.PGame}
(h : x ≤ y)
(j : y.RightMoves)


/-- A monotone, bounded above sequence `f : ℕ → ℝ` has a finite limit. -/
theorem _root_.Real.tendsto_of_bddAbove_monotone {f : ℕ → ℝ} (h_bdd : BddAbove (Set.range f))
    (h_mon : Monotone f) : ∃ r : ℝ, Tendsto f atTop (𝓝 r)

∃ r, Filter.Tendsto f Filter.atTop (𝓝 r)


/-- The L-series of the arithmetic function `ζ` equals the Riemann Zeta Function on its
domain of convergence `1 < re s`. -/
lemma LSeriesHasSum_zeta {s : ℂ} (hs : 1 < s.re) : LSeriesHasSum ↗ζ s (riemannZeta s)

LSeriesHasSum (fun n => ↑(ArithmeticFunction.zeta n)) s (riemannZeta s)


theorem Differentiable.diffContOnCl (h : Differentiable 𝕜 f) : DiffContOnCl 𝕜 f s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(h : Differentiable 𝕜 f)


@[simp] theorem comap_top : comap m ⊤ = ⊤


protected theorem mul_lt_mul' {a b c d : Int}
    (h₁ : a ≤ c) (h₂ : b < d) (h₃ : 0 ≤ b) (h₄ : 0 < c) : a * b < c * d


/-- The sum `F.sum' G` precomposed with the right inclusion functor is isomorphic to `G` -/
@[simps!]
def inrCompSum' (F : A ⥤ C) (G : B ⥤ C) : Sum.inr_ A B ⋙ F.sum' G ≅ G

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(F : CategoryTheory.Functor A C)
(G : CategoryTheory.Functor B C)
(X : B)

(F.inrCompSum' G).inv.app X = CategoryTheory.CategoryStruct.id ((F.sum' G).obj (Sum.inr X))


protected theorem le_neg_add_of_add_le {a b c : Int} (h : a + b ≤ c) : b ≤ -a + c


private theorem add_assoc' (x y z : LocalizedModule S M) : x + y + z = x + (y + z)

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(x y z : LocalizedModule S M)


theorem add_lt_ack : ∀ m n, m + n < ack m n


theorem bisim (R : M P → M P → Prop)
    (h : ∀ x y, R x y → ∃ a f f', M.dest x = ⟨a, f⟩ ∧ M.dest y = ⟨a, f'⟩ ∧ ∀ i, R (f i) (f' i)) :
    ∀ x y, R x y → x = y

(h : ∀ (x y : P.M), R x y → ∃ a f f', x.dest = ⟨a, f⟩ ∧ y.dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), R (f i) (f' i))


theorem mem_takeWhile_imp {x : α} (hx : x ∈ takeWhile p l) : p x

{α : Type u}
{p : α → Bool}
{l : List α}
{x : α}
(hx : x ∈ List.takeWhile p l)


/-- When `s` is an infinite set, `nth` agrees with `Nat.Subtype.orderIsoOfNat`. -/
theorem nth_eq_orderIsoOfNat (hf : (setOf p).Infinite) :
    nth p = (↑) ∘ @Nat.Subtype.orderIsoOfNat (setOf p) hf.to_subtype

{p : ℕ → Prop}
(hf : (setOf p).Infinite)

Nat.nth p = Subtype.val ∘ ⇑(Nat.Subtype.orderIsoOfNat (setOf p))


theorem of_restrictScalars_finiteType [Algebra S A] [IsScalarTower R S A] [hA : FiniteType R A] :
    FiniteType S A

(R : Type uR)
(S : Type uS)
(A : Type uA)
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Algebra R S]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
[hA : Algebra.FiniteType R A]


lemma F_nat_one_le {a : ℝ} (ha : 0 ≤ a) {t : ℝ} (ht : 0 < t) :
    ‖F_nat 1 a t‖ ≤ rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2
      + a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))

‖HurwitzKernelBounds.F_nat 1 a t‖ ≤
  rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 + a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))


@[simp]
theorem getLsb_twoPow (i j : Nat) : (twoPow w i).getLsb j = ((i < w) && (i = j))

(BitVec.twoPow w i).getLsb j = (decide (i < w) && decide (i = j))


/-- Every subgroup of `ℤ` is cyclic. -/
theorem Int.subgroup_cyclic (H : AddSubgroup ℤ) : ∃ a, H = AddSubgroup.closure {a}


protected theorem add_mem {x y : L} : x ∈ L' → y ∈ L' → (x + y : L) ∈ L'

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(L' : LieSubalgebra R L)
{x y : L}


lemma Module.finitePresentation_of_finite [IsNoetherianRing R] [h : Module.Finite R M] :
    Module.FinitePresentation R M

(R : Type u_1)
(M : Type u_2)
[Ring R]
[AddCommGroup M]
[Module R M]
[IsNoetherianRing R]
[h : Module.Finite R M]


@[simp]
theorem mul_divp_cancel (a : α) (u : αˣ) : a * u /ₚ u = a

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


theorem isCoseparator_op_iff (G : C) : IsCoseparator (op G) ↔ IsSeparator G

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

CategoryTheory.IsCoseparator (Opposite.op G) ↔ CategoryTheory.IsSeparator G


@[simp] nonrec theorem add_im : (a + b).im = a.im + b.im

{R : Type u_3}
[CommRing R]
(a b : ℍ[R])


theorem NeZero.ne' (n : R) [h : NeZero n] : 0 ≠ n

{R : Type u_1}
[Zero R]
(n : R)
[h : NeZero n]


protected theorem re {f : α → 𝕜} (hf : AEStronglyMeasurable f μ) :
    AEStronglyMeasurable (fun x => RCLike.re (f x)) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (fun x => RCLike.re (f x)) μ


theorem pathGraph_connected (n : ℕ) : (pathGraph (n + 1)).Connected

(SimpleGraph.pathGraph (n + 1)).Connected


@[simp]
theorem gcd_zero_right [NormalizedGCDMonoid α] (a : α) : gcd a 0 = normalize a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
(a : α)


@[simp, reassoc]
lemma lift_lifts {X Y : CompHaus} {Z : Stonean} (e : Z.compHaus ⟶ Y) (f : X ⟶ Y) [Epi f] :
    lift e f ≫ f = e

{X Y : CompHaus}
{Z : Stonean}
(e : Z.compHaus ⟶ Y)
(f : X ⟶ Y)
[CategoryTheory.Epi f]


/-- If `C` and `D` generate the σ-algebras on `α` resp. `β`, then rectangles formed by `C` and `D`
  generate the σ-algebra on `α × β`. -/
theorem generateFrom_eq_prod {C : Set (Set α)} {D : Set (Set β)} (hC : generateFrom C = ‹_›)
    (hD : generateFrom D = ‹_›) (h2C : IsCountablySpanning C) (h2D : IsCountablySpanning D) :
    generateFrom (image2 (· ×ˢ ·) C D) = Prod.instMeasurableSpace

(hC : MeasurableSpace.generateFrom C = inst✝)

(hD : MeasurableSpace.generateFrom D = inst✝¹)

MeasurableSpace.generateFrom (Set.image2 (fun x x_1 => x ×ˢ x_1) C D) = Prod.instMeasurableSpace


@[ext 1200]
theorem algHom_ext {A : Type*} [Semiring A] [Algebra R A] {f g : MvPolynomial σ R →ₐ[R] A}
    (hf : ∀ i : σ, f (X i) = g (X i)) : f = g

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


@[simp]
theorem degree_coe_units [Nontrivial R] (u : R[X]ˣ) : degree (u : R[X]) = 0

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
[Nontrivial R]
(u : R[X]ˣ)


theorem cl_eq_closure {X : Compactum} (A : Set X) : cl A = closure A


/-- The image of the closed interval `[0, p]` under the quotient map `𝕜 → AddCircle p` is the
entire space. -/
@[simp]
theorem coe_image_Icc_eq : ((↑) : 𝕜 → AddCircle p) '' Icc a (a + p) = univ

{𝕜 : Type u_1}
[LinearOrderedAddCommGroup 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
(p : 𝕜)
[hp : Fact (0 < p)]
(a : 𝕜)
[Archimedean 𝕜]

QuotientAddGroup.mk '' Set.Icc a (a + p) = Set.univ


theorem algHom_ext {S' : Type*} [Semiring S'] [Algebra R S'] (pb : PowerBasis R S)
    ⦃f g : S →ₐ[R] S'⦄ (h : f pb.gen = g pb.gen) : f = g

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
{S' : Type u_7}
[Semiring S']
[Algebra R S']
(pb : PowerBasis R S)
⦃f g : S →ₐ[R] S'⦄
(h : f pb.gen = g pb.gen)


@[simp]
theorem comp_apply (g : S →ₑ+*[ψ] T) (f : R →ₑ+*[φ] S) [MonoidHom.CompTriple φ ψ χ] (x : R) :
    g.comp f x = g (f x)

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{P : Type u_3}
[Monoid P]
{φ : M →* N}
{ψ : N →* P}
{χ : M →* P}
{R : Type u_10}
[Semiring R]
[MulSemiringAction M R]
{S : Type u_12}
[Semiring S]
[MulSemiringAction N S]
{T : Type u_14}
[Semiring T]
[MulSemiringAction P T]
(g : S →ₑ+*[ψ] T)
(f : R →ₑ+*[φ] S)
[φ.CompTriple ψ χ]
(x : R)


/-- `Set.image2` in terms of monadic operations. Note that this can't be taken as the definition
because of the lack of universe polymorphism. -/
theorem image2_def {α β γ : Type u} (f : α → β → γ) (s : Set α) (t : Set β) :
    image2 f s t = f <$> s <*> t

Set.image2 f s t = Seq.seq (f <$> s) fun x => t


@[simp]
theorem degree_monomial (n : ℕ) (ha : a ≠ 0) : degree (monomial n a) = n

{R : Type u}
{a : R}
[Semiring R]
(n : ℕ)
(ha : a ≠ 0)


theorem mem_cons_of_mem {a b : α} {s : Finset α} {hb : b ∉ s} (ha : a ∈ s) : a ∈ cons b s hb

{α : Type u_1}
{a b : α}
{s : Finset α}
{hb : b ∉ s}
(ha : a ∈ s)


theorem isPiSystem_generatePiSystem {α} (S : Set (Set α)) : IsPiSystem (generatePiSystem S)


/-- If the liminf and the limsup of a function coincide, then the limit of the function
exists and has the same value. -/
theorem tendsto_of_liminf_eq_limsup {f : Filter β} {u : β → α} {a : α} (hinf : liminf u f = a)
    (hsup : limsup u f = a) (h : f.IsBoundedUnder (· ≤ ·) u := by isBoundedDefault)
    (h' : f.IsBoundedUnder (· ≥ ·) u := by isBoundedDefault) : Tendsto u f (𝓝 a)

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

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


lemma eLpNorm_nnreal_eq_lintegral {f : α → F} {p : ℝ≥0} (hp : p ≠ 0) :
    eLpNorm f p μ = (∫⁻ x, ‖f x‖₊ ^ (p : ℝ) ∂μ) ^ (1 / (p : ℝ))

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

MeasureTheory.eLpNorm f (↑p) μ = (∫⁻ (x : α), ↑‖f x‖₊ ^ ↑p ∂μ) ^ (1 / ↑p)


@[simp]
theorem coe_mk' (e : P₁ → P₂) (e' : V₁ ≃ₗᵢ[𝕜] V₂) (p h) : ⇑(mk' e e' p h) = e


@[simp]
theorem GLPos.coe_neg_apply (g : GLPos n R) (i j : n) :
    ((↑(-g) : GL n R) : Matrix n n R) i j = -((g : GL n R) : Matrix n n R) i j

{n : Type u}
{R : Type v}
[DecidableEq n]
[Fintype n]
[LinearOrderedCommRing R]
[Fact (Even (Fintype.card n))]
(g : ↥(Matrix.GLPos n R))
(i j : n)


theorem range_single_subset : Set.range (single a b) ⊆ {0, b}

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

Set.range ⇑(Finsupp.single a b) ⊆ {0, b}


theorem nil_suffix (l : List α) : [] <:+ l


/-- To construct an isomorphism between tridents,
it suffices to give an isomorphism between the cone points
and check that it commutes with the `ι` morphisms.
-/
@[simps]
def Trident.ext [Nonempty J] {s t : Trident f} (i : s.pt ≅ t.pt)
    (w : i.hom ≫ t.ι = s.ι := by aesop_cat) : s ≅ t

(w : CategoryTheory.CategoryStruct.comp i.hom t.ι = s.ι := by aesop_cat)

(CategoryTheory.Limits.Trident.ext i w).hom = CategoryTheory.Limits.Trident.mkHom i.hom w


theorem eval₂_sum (s : Finset S₂) (p : S₂ → MvPolynomial σ R) :
    eval₂ f g (∑ x ∈ s, p x) = ∑ x ∈ s, eval₂ f g (p x)

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

MvPolynomial.eval₂ f g (∑ x ∈ s, p x) = ∑ x ∈ s, MvPolynomial.eval₂ f g (p x)


lemma subset_biUnion_of_mem (u : α → Finset β) {x : α} (xs : x ∈ s) : u x ⊆ s.biUnion u

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
[DecidableEq β]
(u : α → Finset β)
{x : α}
(xs : x ∈ s)


theorem smoothOn_coordChange (IB : ModelWithCorners 𝕜 EB HB) [h : Z.IsSmooth IB] (i j : ι) :
    SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (Z.coordChange i j) (Z.baseSet i ∩ Z.baseSet j)

{𝕜 : Type u_1}
{B : Type u_2}
{F : Type u_4}
[NontriviallyNormedField 𝕜]
{EB : Type u_7}
[NormedAddCommGroup EB]
[NormedSpace 𝕜 EB]
{HB : Type u_8}
[TopologicalSpace HB]
[TopologicalSpace B]
[ChartedSpace HB B]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{ι : Type u_11}
(Z : VectorBundleCore 𝕜 B F ι)
(IB : ModelWithCorners 𝕜 EB HB)
[h : Z.IsSmooth IB]
(i j : ι)


theorem IsBoundedUnder.isCoboundedUnder_flip {u : γ → α} {l : Filter γ} [IsTrans α r] [NeBot l]
    (h : l.IsBoundedUnder r u) : l.IsCoboundedUnder (flip r) u

{α : Type u_1}
{γ : Type u_3}
{r : α → α → Prop}
{u : γ → α}
{l : Filter γ}
[IsTrans α r]
[l.NeBot]
(h : Filter.IsBoundedUnder r l u)


lemma rpow_inv_natCast_pow {n : ℕ} (hn : n ≠ 0) (x : ℝ≥0∞) : (x ^ (n⁻¹ : ℝ)) ^ n = x


/-- The Haar measure equals the Lebesgue measure on `ℝ`. -/
theorem addHaarMeasure_eq_volume : addHaarMeasure Icc01 = volume

MeasureTheory.Measure.addHaarMeasure TopologicalSpace.PositiveCompacts.Icc01 = MeasureTheory.volume


/-- If two partial homeomorphisms are equivalent, so are their inverses. -/
theorem EqOnSource.symm' {e e' : PartialHomeomorph X Y} (h : e ≈ e') : e.symm ≈ e'.symm

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e e' : PartialHomeomorph X Y}
(h : e ≈ e')


/-- `AlternatingMap.domDomCongr` as a linear equivalence. -/
@[simps apply symm_apply]
def domDomCongrₗ (σ : ι ≃ ι') : M [⋀^ι]→ₗ[R] N ≃ₗ[S] M [⋀^ι']→ₗ[R] 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}
{ι' : Type u_8}
(S : Type u_12)
[Semiring S]
[Module S N]
[SMulCommClass R S N]
(σ : ι ≃ ι')
(f : M [⋀^ι']→ₗ[R] N)

(AlternatingMap.domDomCongrₗ S σ).symm f = AlternatingMap.domDomCongr σ.symm f


theorem interior_eq_nhds : interior s = { x | 𝓝 x ≤ 𝓟 s }

{X : Type u}
{s : Set X}
[TopologicalSpace X]


@[to_additive] lemma mabs_le_mabs (h₀ : a ≤ b) (h₁ : a⁻¹ ≤ b) : |a|ₘ ≤ |b|ₘ

{α : Type u_1}
[Lattice α]
[Group α]
{a b : α}
(h₀ : a ≤ b)
(h₁ : a⁻¹ ≤ b)


theorem extend_eq {s : α} (h : P s) : extend m s = m s h

{α : Type u_1}
{P : α → Prop}
(m : (s : α) → P s → ℝ≥0∞)
{s : α}
(h : P s)


@[simp, rclike_simps]
theorem inv_re (z : K) : re z⁻¹ = re z / normSq z

RCLike.re z⁻¹ = RCLike.re z / RCLike.normSq z


theorem countP_congr (h : ∀ x ∈ l, p x ↔ q x) : countP p l = countP q l

(h : ∀ (x : α), x ∈ l → (p x = true ↔ q x = true))


/-- A commutative algebra is finitely generated if and only if it is a quotient of a polynomial ring
in `n` variables. -/
theorem iff_quotient_mvPolynomial'' :
    FiniteType R S ↔ ∃ (n : ℕ) (f : MvPolynomial (Fin n) R →ₐ[R] S), Surjective f

{R : Type uR}
{S : Type uS}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]

Algebra.FiniteType R S ↔ ∃ n f, Function.Surjective ⇑f


theorem symm_bijective : Bijective (OrderRingIso.symm : (α ≃+*o β) → β ≃+*o α)

{α : Type u_2}
{β : Type u_3}
[Mul α]
[Add α]
[LE α]
[Mul β]
[Add β]
[LE β]


theorem orthogonalBilin_le (h : N ≤ L) : L.orthogonalBilin B ≤ N.orthogonalBilin B

{R : Type u_1}
{R₁ : Type u_2}
{M : Type u_5}
{M₁ : Type u_6}
[CommRing R]
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
[AddCommGroup M]
[Module R M]
{I₁ I₂ : R₁ →+* R}
{B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M}
{N L : Submodule R₁ M₁}
(h : N ≤ L)


@[to_additive]
protected theorem UniformFun.hasBasis_nhds_one_of_basis {p : ι → Prop} {b : ι → Set G}
    (h : (𝓝 1 : Filter G).HasBasis p b) :
    (𝓝 1 : Filter (α →ᵤ G)).HasBasis p fun i => { f : α →ᵤ G | ∀ x, toFun f x ∈ b i }

{α : Type u_1}
{G : Type u_2}
{ι : Type u_3}
[AddGroup G]
[UniformSpace G]
[UniformAddGroup G]
{p : ι → Prop}
{b : ι → Set G}
(h : (𝓝 0).HasBasis p b)

(𝓝 0).HasBasis p fun i => {f | ∀ (x : α), UniformFun.toFun f x ∈ b i}


theorem uIcc_subset_uIcc_left (h : x ∈ [[a, b]]) : [[a, x]] ⊆ [[a, b]]

{α : Type u_2}
[Lattice α]
[LocallyFiniteOrder α]
{a b x : α}
(h : x ∈ [[a, b]])


theorem digits_ofDigits (b : ℕ) (h : 1 < b) (L : List ℕ) (w₁ : ∀ l ∈ L, l < b)
    (w₂ : ∀ h : L ≠ [], L.getLast h ≠ 0) : digits b (ofDigits b L) = L

(b : ℕ)
(h : 1 < b)
(L : List ℕ)
(w₁ : ∀ l ∈ L, l < b)
(w₂ : ∀ (h : L ≠ []), L.getLast h ≠ 0)


theorem contDiffAt_inner {p : E × E} {n} : ContDiffAt ℝ n (fun p : E × E => ⟪p.1, p.2⟫) p

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{p : E × E}
{n : ℕ∞}

ContDiffAt ℝ n (fun p => ⟪p.1, p.2⟫_𝕜) p


/-- If `X` and `Y` are independent and `(X, Y)` and `(X', Y')` are identically distributed,
then `X'` and `Y'` are independent. -/
lemma indepFun_of_identDistrib_pair
    {μ : Measure γ} {μ' : Measure δ} [IsFiniteMeasure μ] [IsFiniteMeasure μ']
    {X : γ → α} {X' : δ → α} {Y : γ → β} {Y' : δ → β} (h_indep : IndepFun X Y μ)
    (h_ident : IdentDistrib (fun ω ↦ (X ω, Y ω)) (fun ω ↦ (X' ω, Y' ω)) μ μ') :
    IndepFun X' Y' μ'

(h_indep : ProbabilityTheory.IndepFun X Y μ)

(h_ident : ProbabilityTheory.IdentDistrib (fun ω => (X ω, Y ω)) (fun ω => (X' ω, Y' ω)) μ μ')


theorem Eq.comm {a b : α} : a = b ↔ b = a


/-- Variant of Hahn-Banach, eliminating the hypothesis that `x` be nonzero, but only ensuring that
    the dual element has norm at most `1` (this can not be improved for the trivial
    vector space). -/
theorem exists_dual_vector'' (x : E) : ∃ g : E →L[𝕜] 𝕜, ‖g‖ ≤ 1 ∧ g x = ‖x‖

(𝕜 : Type v)
[RCLike 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(x : E)

∃ g, ‖g‖ ≤ 1 ∧ g x = ↑‖x‖


theorem ascPochhammer_mul (n m : ℕ) :
    ascPochhammer S n * (ascPochhammer S m).comp (X + (n : S[X])) = ascPochhammer S (n + m)

ascPochhammer S n * (ascPochhammer S m).comp (Polynomial.X + ↑n) = ascPochhammer S (n + m)


/-- Given an object `W` equipped with morphisms `p₁ : W ⟶ E.X i₁`, `p₂ : W ⟶ E.X i₂`,
this is the sieve of `W` which consists of morphisms `g : Z ⟶ W` such that there exists `j`
and `h : Z ⟶ E.Y j` such that `g ≫ p₁ = h ≫ E.p₁ j` and `g ≫ p₂ = h ≫ E.p₂ j`.
See lemmas `sieve₁_eq_pullback_sieve₁'` and `sieve₁'_eq_sieve₁` for equational lemmas
regarding this sieve. -/
@[simps]
def sieve₁ {i₁ i₂ : E.I₀} {W : C} (p₁ : W ⟶ E.X i₁) (p₂ : W ⟶ E.X i₂) : Sieve W

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{S : C}
(E : CategoryTheory.PreOneHypercover S)
{i₁ i₂ : E.I₀}
{W : C}
(p₁ : W ⟶ E.X i₁)
(p₂ : W ⟶ E.X i₂)
(Z : C)
(g : Z ⟶ W)

(E.sieve₁ p₁ p₂).arrows g =
  ∃ j h,
    CategoryTheory.CategoryStruct.comp g p₁ = CategoryTheory.CategoryStruct.comp h (E.p₁ j) ∧
      CategoryTheory.CategoryStruct.comp g p₂ = CategoryTheory.CategoryStruct.comp h (E.p₂ j)


@[to_additive (attr := simp)]
theorem infinite_smul_set : (a • s).Infinite ↔ s.Infinite

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{a : α}
{s : Set β}


theorem norm_kahler (x y : E) : ‖o.kahler x y‖ = ‖x‖ * ‖y‖

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


theorem symmDiff_left_involutive (a : α) : Involutive (· ∆ a)

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


@[simp]
theorem range_id : range (id L M) = ⊤

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

(FirstOrder.Language.Hom.id L M).range = ⊤


theorem mem_orthogonalGroup_iff' {A : Matrix n n β} :
    A ∈ Matrix.orthogonalGroup n β ↔ star A * A = 1

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


@[simp]
theorem irrational_add_int_iff : Irrational (x + m) ↔ Irrational x


theorem liftRel_def {R : α → β → Prop} {ca cb} :
    LiftRel R ca cb ↔ (Terminates ca ↔ Terminates cb) ∧ ∀ {a b}, a ∈ ca → b ∈ cb → R a b

{α : Type u}
{β : Type v}
{R : α → β → Prop}
{ca : Computation α}
{cb : Computation β}

Computation.LiftRel R ca cb ↔ (ca.Terminates ↔ cb.Terminates) ∧ ∀ {a : α} {b : β}, a ∈ ca → b ∈ cb → R a b


@[to_additive (attr := simp)]
theorem MonoidHom.coe_comp [MulOneClass M] [MulOneClass N] [MulOneClass P]
    (g : N →* P) (f : M →* N) : ↑(g.comp f) = g ∘ f

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


theorem continuousOn_empty (f : α → β) : ContinuousOn f ∅

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


/-- The value from `IsWellFounded.fix` is built from the previous ones as specified. -/
theorem fix_eq {C : α → Sort*} (F : ∀ x : α, (∀ y : α, r y x → C y) → C x) :
    ∀ x, fix r F x = F x fun y _ => fix r F y

(F : (x : α) → ((y : α) → r y x → C y) → C x)

IsWellFounded.fix r F x = F x fun y x => IsWellFounded.fix r F y


@[simp]
theorem mapAlgEquiv_coe_ringHom (f : A ≃ₐ[R] B) :
    ↑(mapAlgEquiv f : _ ≃ₐ[R] Polynomial B) = (mapRingHom ↑f : Polynomial A →+* Polynomial B)

{R : Type u}
{A : Type z}
{B : Type u_2}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A ≃ₐ[R] B)

↑(Polynomial.mapAlgEquiv f) = Polynomial.mapRingHom ↑f


theorem hasFTaylorSeriesUpToOn_univ_iff :
    HasFTaylorSeriesUpToOn n f p univ ↔ HasFTaylorSeriesUpTo n f p

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ∞}
{p : E → FormalMultilinearSeries 𝕜 E F}

HasFTaylorSeriesUpToOn n f p Set.univ ↔ HasFTaylorSeriesUpTo n f p


theorem mem_nhdsWithin_Iio_iff_exists_mem_Ico_Ioo_subset {a l' : α} {s : Set α} (hl' : l' < a) :
    s ∈ 𝓝[<] a ↔ ∃ l ∈ Ico l' a, Ioo l a ⊆ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a l' : α}
{s : Set α}
(hl' : l' < a)

s ∈ 𝓝[<] a ↔ ∃ l ∈ Set.Ico l' a, Set.Ioo l a ⊆ s


theorem tan_pi_sub (x : ℝ) : tan (π - x) = -tan x


@[simp]
lemma counitForward_val_snd (s : CostructuredArrow yoneda A) (x : F.obj (op s)) :
    (counitForward F s x).val.snd = F.map (eqToHom (by simp [← CostructuredArrow.eq_mk])) x

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

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

(s : CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)

CategoryTheory.OverPresheafAux.YonedaCollection.snd (CategoryTheory.OverPresheafAux.counitForward F s x).val =
  F.map (CategoryTheory.eqToHom ⋯) x


@[simp] theorem map_id' : Option.map (@id α) = id


@[mono]
theorem toAddSubmonoid_strictMono : StrictMono (toAddSubmonoid : Submodule R M → AddSubmonoid M)

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]


theorem tr_init (c v) :
    ∃ b, TrCfg (stepNormal c Cont.halt v) b ∧ Reaches₁ (TM2.step tr) (init c v) b

(c : Turing.ToPartrec.Code)
(v : List ℕ)

∃ b,
  Turing.PartrecToTM2.TrCfg (Turing.ToPartrec.stepNormal c Turing.ToPartrec.Cont.halt v) b ∧
    Turing.Reaches₁ (Turing.TM2.step Turing.PartrecToTM2.tr) (Turing.PartrecToTM2.init c v) b


theorem StrictMono.lt_iff_lt (hf : StrictMono f) {a b : α} : f a < f b ↔ a < b

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


@[simp]
theorem zipLeft_cons_cons : zipLeft (a :: as) (b :: bs) = (a, some b) :: zipLeft as bs

{α : Type u}
{β : Type v}
(a : α)
(as : List α)
(b : β)
(bs : List β)

(a :: as).zipLeft (b :: bs) = (a, some b) :: as.zipLeft bs


@[simp] theorem map_some' (a) (f : α → β) : (some a).map f = some (f a)

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


theorem IsRegular.aleph0_le {c : Cardinal} (H : c.IsRegular) : ℵ₀ ≤ c


/-- `α × {*}` is uniformly isomorphic to `α`. -/
@[simps! (config := .asFn) apply]
def prodPunit : α × PUnit ≃ᵤ α

⇑(UniformEquiv.prodPunit α) = fun p => p.1


theorem coeff_toMvPowerSeries {f : HahnSeries (σ →₀ ℕ) R} {n : σ →₀ ℕ} :
    MvPowerSeries.coeff R n (toMvPowerSeries f) = f.coeff n

{R : Type u_2}
[Semiring R]
{σ : Type u_3}
[Finite σ]
{f : HahnSeries (σ →₀ ℕ) R}
{n : σ →₀ ℕ}

(MvPowerSeries.coeff R n) (HahnSeries.toMvPowerSeries f) = f.coeff n


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

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

MeasureTheory.Integrable (s.indicator f) μ


/-- See Note [no_index around OfNat.ofNat] -/
@[simp]
lemma cpow_ofNat_inv_pow (x : ℂ) (n : ℕ) [n.AtLeastTwo] :
    (x ^ ((no_index (OfNat.ofNat n) : ℂ)⁻¹)) ^ (no_index (OfNat.ofNat n) : ℕ) = x

(x ^ (OfNat.ofNat n)⁻¹) ^ OfNat.ofNat n = x


theorem inv_eq_of_root_of_coeff_zero_ne_zero {x : L} {p : K[X]} (aeval_eq : aeval x p = 0)
    (coeff_zero_ne : p.coeff 0 ≠ 0) : x⁻¹ = -(aeval x (divX p) / algebraMap _ _ (p.coeff 0))

{K : Type u_3}
{L : Type u_4}
[Field K]
[Field L]
[Algebra K L]
{x : L}
{p : K[X]}
(aeval_eq : (Polynomial.aeval x) p = 0)
(coeff_zero_ne : p.coeff 0 ≠ 0)

x⁻¹ = -((Polynomial.aeval x) p.divX / (algebraMap K L) (p.coeff 0))


@[to_additive eq_sub_of_add_eq']
theorem eq_div_of_mul_eq'' (h : c * a = b) : a = b / c

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


theorem ext_coord_change_source (x x' : M) :
    ((extChartAt I x').symm ≫ extChartAt I x).source =
      I '' ((chartAt H x').symm ≫ₕ chartAt H x).source

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

((extChartAt I x').symm ≫ extChartAt I x).source = ↑I '' ((chartAt H x').symm ≫ₕ chartAt H x).source


@[simp]
theorem whisker_unit (t : LeftLift f g) {x : B} (h : x ⟶ c) :
    (t.whisker h).unit = h ◁ t.unit ≫ (α_ h t.lift f).inv

(t : CategoryTheory.Bicategory.LeftLift f g)

(t.whisker h).unit =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft h t.unit)
    (CategoryTheory.Bicategory.associator h t.lift f).inv


@[simp]
theorem trans_apply (e : P₁ ≃ᵃ[k] P₂) (e' : P₂ ≃ᵃ[k] P₃) (p : P₁) : e.trans e' p = e' (e p)

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{P₃ : Type u_4}
{V₁ : Type u_6}
{V₂ : Type u_7}
{V₃ : Type u_8}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
[AddCommGroup V₃]
[Module k V₃]
[AffineSpace V₃ P₃]
(e : P₁ ≃ᵃ[k] P₂)
(e' : P₂ ≃ᵃ[k] P₃)
(p : P₁)


theorem supp_subset_range_natDegree_succ : p.support ⊆ Finset.range (natDegree p + 1)

p.support ⊆ Finset.range (p.natDegree + 1)


theorem mk_add_mk {m1 m2 : M} {s1 s2 : S} :
    mk m1 s1 + mk m2 s2 = mk (s2 • m1 + s1 • m2) (s1 * s2)

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
{m1 m2 : M}
{s1 s2 : ↥S}

LocalizedModule.mk m1 s1 + LocalizedModule.mk m2 s2 = LocalizedModule.mk (s2 • m1 + s1 • m2) (s1 * s2)


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

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

g ((symmDiff s t).indicator f x) = g (s.indicator f x - t.indicator f x)


@[to_additive (attr := simp)]
theorem mem_orbit_self (a : α) : a ∈ orbit M a

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


@[simp]
theorem walkingParallelPairOpEquiv_counitIso_one :
    walkingParallelPairOpEquiv.counitIso.app (op one) = Iso.refl (op one)

CategoryTheory.Limits.walkingParallelPairOpEquiv.counitIso.app
    (Opposite.op CategoryTheory.Limits.WalkingParallelPair.one) =
  CategoryTheory.Iso.refl (Opposite.op CategoryTheory.Limits.WalkingParallelPair.one)


/-- `a` semiconjugates `x` to `a * x * a⁻¹`. -/
@[to_additive "`a` semiconjugates `x` to `a + x + -a`."]
lemma mk_semiconjBy (u : Mˣ) (x : M) : SemiconjBy (↑u) x (u * x * ↑u⁻¹)

{M : Type u_1}
[AddMonoid M]
(u : AddUnits M)
(x : M)


theorem _root_.Bornology.IsBounded.subset_ball_lt (h : IsBounded s) (a : ℝ) (c : α) :
    ∃ r, a < r ∧ s ⊆ ball c r

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(h : Bornology.IsBounded s)
(a : ℝ)
(c : α)


theorem _root_.Set.Finite.compl_mem_cocardinal {s : Set α} (hs : s.Finite) :
    sᶜ ∈ cocardinal α hreg

{α : Type u}
{c : Cardinal.{u}}
{hreg : c.IsRegular}
{s : Set α}
(hs : s.Finite)


@[simp]
theorem Equivalence_mk'_unit (functor inverse unit_iso counit_iso f) :
    (⟨functor, inverse, unit_iso, counit_iso, f⟩ : C ≌ D).unit = unit_iso.hom

(unit_iso : CategoryTheory.Functor.id C ≅ functor.comp inverse)

(counit_iso : inverse.comp functor ≅ CategoryTheory.Functor.id D)

(f :
  ∀ (X : C),
    CategoryTheory.CategoryStruct.comp (functor.map (unit_iso.hom.app X)) (counit_iso.hom.app (functor.obj X)) =
      CategoryTheory.CategoryStruct.id (functor.obj X))

{ functor := functor, inverse := inverse, unitIso := unit_iso, counitIso := counit_iso,
      functor_unitIso_comp := f }.unit =
  unit_iso.hom


theorem isBigO_sub (l : Filter E) (x : E) : (fun x' => e (x' - x)) =O[l] fun x' => x' - x

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_5}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{σ₂₁ : 𝕜₂ →+* 𝕜}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
(e : E ≃SL[σ₁₂] F)
[RingHomIsometric σ₁₂]
(l : Filter E)
(x : E)


/-- like `coe_nonneg`, but with the inequality in `Icc (0:α) 1`. -/
theorem nonneg {t : Icc (0 : α) 1} : 0 ≤ t

{α : Type u_1}
[OrderedSemiring α]
{t : ↑(Set.Icc 0 1)}


@[reassoc]
lemma Exact.comp_eq_zero (h : S.Exact) {X Y : C} {a : X ⟶ S.X₂} (ha : a ≫ S.g = 0)
    {b : S.X₂ ⟶ Y} (hb : S.f ≫ b = 0) : a ≫ b = 0

(ha : CategoryTheory.CategoryStruct.comp a S.g = 0)

(hb : CategoryTheory.CategoryStruct.comp S.f b = 0)

CategoryTheory.CategoryStruct.comp a b = 0


/-- The composite of two monoid homomorphisms is a monoid homomorphism. -/
@[to_additive
      "The composite of two additive monoid homomorphisms is an additive monoid
      homomorphism."]
theorem comp (hf : IsMonoidHom f) {γ} [MulOneClass γ] {g : β → γ} (hg : IsMonoidHom g) :
    IsMonoidHom (g ∘ f)

{α : Type u}
{β : Type v}
[MulOneClass α]
[MulOneClass β]
{f : α → β}
(hf : IsMonoidHom f)
{γ : Type u_1}
[MulOneClass γ]
{g : β → γ}
(hg : IsMonoidHom g)


lemma compl_range_subset_kernImage {s : Set α} : (range f)ᶜ ⊆ kernImage f s

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


theorem mul_rpow {x y : ℝ≥0} {z : ℝ} : (x * y) ^ z = x ^ z * y ^ z


theorem toNNRat_prod_of_nonneg {s : Finset α} {f : α → ℚ} (hf : ∀ a ∈ s, 0 ≤ f a) :
    (∏ a ∈ s, f a).toNNRat = ∏ a ∈ s, (f a).toNNRat

{α : Type u_2}
{s : Finset α}
{f : α → ℚ}
(hf : ∀ a ∈ s, 0 ≤ f a)


theorem add_eq_right_iff_le : a + b = b ↔ a ≤ b

{α : Type u_1}
[IdemSemiring α]
{a b : α}


lemma zero_lt_mk {x : PGame.{u}} {hx} : 0 < mk x hx ↔ 0 < x


theorem norm_toSpanSingleton (x : E) : ‖toSpanSingleton 𝕜 x‖ = ‖x‖

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

‖ContinuousLinearMap.toSpanSingleton 𝕜 x‖ = ‖x‖


theorem dom_bool₂ (f : Bool → Bool → α) : Primrec₂ f

{α : Type u_1}
[Primcodable α]
(f : Bool → Bool → α)


@[to_additive (attr := simp)]
theorem length_map (x) : (map f x).length = x.length

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

((FreeAddSemigroup.map f) x).length = x.length


theorem EqOn.image_eq (heq : EqOn f₁ f₂ s) : f₁ '' s = f₂ '' s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f₁ f₂ : α → β}
(heq : Set.EqOn f₁ f₂ s)


theorem mono_pre_nat (m : Set X → ℝ≥0∞) : Monotone fun k : ℕ => pre m k⁻¹

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

Monotone fun k => MeasureTheory.OuterMeasure.mkMetric'.pre m (↑k)⁻¹


@[simp]
lemma liftCochain_descCochain :
    (liftCochain φ α β h).comp (descCochain φ α' β' h') hp =
      α.comp α' (by omega) + β.comp β' (by omega)

(α : CochainComplex.HomComplex.Cochain K F m)

(β : CochainComplex.HomComplex.Cochain K G n)

(α' : CochainComplex.HomComplex.Cochain F L m')

(β' : CochainComplex.HomComplex.Cochain G L n')

(CochainComplex.mappingCone.liftCochain φ α β h).comp (CochainComplex.mappingCone.descCochain φ α' β' h') hp =
  α.comp α' ⋯ + β.comp β' ⋯


@[simp]
theorem iInf_toSubfield {ι : Sort*} (S : ι → IntermediateField F E) :
    (iInf S).toSubfield = ⨅ i, (S i).toSubfield

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{ι : Sort u_3}
(S : ι → IntermediateField F E)


theorem measure_Icc_lt_top : μ (Icc a b) < ∞


@[simp] theorem endofunctorMonoidalCategory_tensorMap_app
    {F G H K : C ⥤ C} {α : F ⟶ G} {β : H ⟶ K} (X : C) :
    (α ⊗ β).app X = β.app (F.obj X) ≫ K.map (α.app X)

(C : Type u)
[CategoryTheory.Category.{v, u} C]
{F G H K : CategoryTheory.Functor C C}
{α : F ⟶ G}
{β : H ⟶ K}
(X : C)

(CategoryTheory.MonoidalCategory.tensorHom α β).app X =
  CategoryTheory.CategoryStruct.comp (β.app (F.obj X)) (K.map (α.app X))


theorem _root_.Real.coe_toNNReal (r : ℝ) (hr : 0 ≤ r) : (Real.toNNReal r : ℝ) = r


lemma sqrt_add_eq' (n : ℕ) (h : a ≤ n + n) : sqrt (n ^ 2 + a) = n


/-- To prove a proposition about `S : Finset α`,
it suffices to prove it for the empty `Finset`,
and to show that if it holds for some `Finset α ⊆ S`,
then it holds for the `Finset` obtained by inserting a new element of `S`.
-/
@[elab_as_elim]
theorem induction_on' {α : Type*} {p : Finset α → Prop} [DecidableEq α] (S : Finset α) (h₁ : p ∅)
    (h₂ : ∀ {a s}, a ∈ S → s ⊆ S → a ∉ s → p s → p (insert a s)) : p S

(h₂ : ∀ {a : α} {s : Finset α}, a ∈ S → s ⊆ S → a ∉ s → p s → p (insert a s))


@[simp]
theorem cons_append (a : α) (s t) : append (cons a s) t = cons a (append s t)

{α : Type u}
(a : α)
(s t : Stream'.Seq α)

(Stream'.Seq.cons a s).append t = Stream'.Seq.cons a (s.append t)


/-- The product `F.prod' G` followed by projection on the first component is isomorphic to `F` -/
@[simps!]
def prod'CompFst (F : A ⥤ B) (G : A ⥤ C) : F.prod' G ⋙ CategoryTheory.Prod.fst B C ≅ F

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor A C)
(X : A)

(F.prod'CompFst G).inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)


@[to_additive (attr := simp)]
theorem mulSingle_eq_same (i : I) (x : f i) : mulSingle i x i = x

{I : Type u}
{f : I → Type v₁}
[DecidableEq I]
[(i : I) → One (f i)]
(i : I)
(x : f i)


@[simp]
theorem isVonNBounded_add_self : IsVonNBounded 𝕜 (s + s) ↔ IsVonNBounded 𝕜 s

{𝕜 : Type u_1}
{E : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[ContinuousSMul 𝕜 E]
[ContinuousAdd E]
{s : Set E}

Bornology.IsVonNBounded 𝕜 (s + s) ↔ Bornology.IsVonNBounded 𝕜 s


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

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.IsCofiltered.eqHom f f') f =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.IsCofiltered.eqHom f f') f'


/-- A model of a theory is also a model of any subtheory. -/
@[simps]
def subtheoryModel (M : T.ModelType) {T' : L.Theory} (h : T' ⊆ T) : T'.ModelType

{L : FirstOrder.Language}
{T : L.Theory}
(M : T.ModelType)
{T' : L.Theory}
(h : T' ⊆ T)


/-- Lift two monoid equivalences `e : M ≃* N` and `e' : M' ≃* N'` to a monoid equivalence
`(M ∗ M') ≃* (N ∗ N')`. -/
@[to_additive (attr := simps! (config := .asFn)) "Lift two additive monoid
equivalences `e : M ≃+ N` and `e' : M' ≃+ N'` to an additive monoid equivalence
`(AddMonoid.Coprod M M') ≃+ (AddMonoid.Coprod N N')`."]
def coprodCongr (e : M ≃* N) (e' : M' ≃* N') : (M ∗ M') ≃* (N ∗ N')

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass M']
[AddZeroClass N']
(e : M ≃+ N)
(e' : M' ≃+ N')

⇑(AddMonoid.MulEquiv.coprodCongr e e').symm = ⇑(AddMonoid.Coprod.map ↑e.symm ↑e'.symm)


theorem Subgroup.sylow_mem_fixedPoints_iff (H : Subgroup G) {P : Sylow p G} :
    P ∈ fixedPoints H (Sylow p G) ↔ H ≤ (P : Subgroup G).normalizer

{p : ℕ}
{G : Type u_1}
[Group G]
(H : Subgroup G)
{P : Sylow p G}

P ∈ MulAction.fixedPoints (↥H) (Sylow p G) ↔ H ≤ (↑P).normalizer


protected theorem IsGδ.setOf_irrational : IsGδ { x | Irrational x }


theorem mem_upperBounds_image2 (ha : a ∈ upperBounds s) (hb : b ∈ upperBounds t) :
    f a b ∈ upperBounds (image2 f s t)

{f : α → β → γ}

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


theorem to_prim {n f} (pf : @Nat.Primrec' n f) : Primrec f

{n : ℕ}
{f : Mathlib.Vector ℕ n → ℕ}
(pf : Nat.Primrec' f)


/-- Symmetry properties of `IH4`. -/
lemma ih4_neg : IH4 x₁ x₂ y → IH4 (-x₂) (-x₁) y ∧ IH4 x₁ x₂ (-y)

Surreal.Multiplication.IH4 x₁ x₂ y → Surreal.Multiplication.IH4 (-x₂) (-x₁) y ∧ Surreal.Multiplication.IH4 x₁ x₂ (-y)


@[simp]
theorem matches'_char (a : α) : (char a).matches' = {[a]}

(RegularExpression.char a).matches' = {[a]}


theorem parallelPair_pullback_initial {X B : C} (π : X ⟶ B)
    (c : PullbackCone π π) (hc : IsLimit c) :
    (parallelPair (C := (Sieve.ofArrows (fun (_ : Unit) => X) (fun _ => π)).arrows.categoryᵒᵖ)
    (Y := op ((Presieve.categoryMk _ (c.fst ≫ π) ⟨_, c.fst, π, ofArrows.mk (), rfl⟩)))
    (X := op ((Presieve.categoryMk _ π (Sieve.ofArrows_mk _ _ Unit.unit))))
    (Quiver.Hom.op (Over.homMk c.fst))
    (Quiver.Hom.op (Over.homMk c.snd c.condition.symm))).Initial

(c : CategoryTheory.Limits.PullbackCone π π)

(CategoryTheory.Limits.parallelPair (CategoryTheory.Over.homMk c.fst ⋯).op
    (CategoryTheory.Over.homMk c.snd ⋯).op).Initial


theorem Ioc_subset_Ioc_union_Icc : Ioc a c ⊆ Ioc a b ∪ Icc b c

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


@[to_additive (attr := simp)]
theorem coeSubtype : (SubgroupClass.subtype H : H → G) = ((↑) : H → G)

{G : Type u_1}
[AddGroup G]
{S : Type u_6}
(H : S)
[SetLike S G]
[AddSubgroupClass S G]


/-- If the distance between any two points in a set is bounded by some constant `C`,
then `ENNReal.ofReal C` bounds the emetric diameter of this set. -/
theorem ediam_le_of_forall_dist_le {C : ℝ} (h : ∀ x ∈ s, ∀ y ∈ s, dist x y ≤ C) :
    EMetric.diam s ≤ ENNReal.ofReal C

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{C : ℝ}
(h : ∀ x ∈ s, ∀ y ∈ s, dist x y ≤ C)


@[to_additive (attr := fun_prop)]
theorem ContinuousOn.smul (hf : ContinuousOn f s) (hg : ContinuousOn g s) :
    ContinuousOn (fun x => f x • g x) s

{M : Type u_1}
{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace M]
[TopologicalSpace X]
[TopologicalSpace Y]
[SMul M X]
[ContinuousSMul M X]
{f : Y → M}
{g : Y → X}
{s : Set Y}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)


@[norm_cast]
theorem coe_GLPos_neg (g : SpecialLinearGroup n R) : ↑(-g) = -(↑g : GLPos n R)

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[LinearOrderedCommRing R]
[Fact (Even (Fintype.card n))]
(g : Matrix.SpecialLinearGroup n R)

Matrix.SpecialLinearGroup.toGLPos (-g) = -Matrix.SpecialLinearGroup.toGLPos g


@[simp]
theorem coe_fieldRange : ↑f.fieldRange = Set.range f

{K : Type u_1}
{L : Type u_2}
{L' : Type u_3}
[Field K]
[Field L]
[Field L']
[Algebra K L]
[Algebra K L']
(f : L →ₐ[K] L')


@[simp]
theorem comp_f : (f ≫ g).1 = f.1 ≫ g.1

{A₀ A₁ A₂ : CategoryTheory.Endofunctor.Algebra F}

(CategoryTheory.CategoryStruct.comp f g).f = CategoryTheory.CategoryStruct.comp f.f g.f


@[to_additive]
theorem tprod_ne_one_iff (hf : Multipliable f) : ∏' i, f i ≠ 1 ↔ ∃ x, f x ≠ 1

{ι : Type u_1}
{α : Type u_3}
[CanonicallyOrderedAddCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
(hf : Summable f)


@[simp]
lemma homologyMap'_sub :
    homologyMap' (φ - φ') h₁ h₂ = homologyMap' φ h₁ h₂ - homologyMap' φ' h₁ h₂

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
{φ φ' : S₁ ⟶ S₂}
(h₁ : S₁.HomologyData)
(h₂ : S₂.HomologyData)

CategoryTheory.ShortComplex.homologyMap' (φ - φ') h₁ h₂ =
  CategoryTheory.ShortComplex.homologyMap' φ h₁ h₂ - CategoryTheory.ShortComplex.homologyMap' φ' h₁ h₂


@[simp]
theorem frobenius_apply_frobeniusEquiv_symm (x : R) :
    frobenius R p ((frobeniusEquiv R p).symm x) = x

(R : Type u_1)
(p : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]
(x : R)

(frobenius R p) ((frobeniusEquiv R p).symm x) = x


@[simp]
theorem subtype_compAlternatingMap_codRestrict (f : M [⋀^ι]→ₗ[R] N) (p : Submodule R N)
    (h) : p.subtype.compAlternatingMap (f.codRestrict p h) = f

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
(f : M [⋀^ι]→ₗ[R] N)
(p : Submodule R N)
(h : ∀ (v : ι → M), f v ∈ p)


protected theorem Sorted.le_of_lt [Preorder α] {l : List α} (h : l.Sorted (· < ·)) :
    l.Sorted (· ≤ ·)

(h : List.Sorted (fun x x_1 => x < x_1) l)


@[simp]
theorem join_zero : (0 : Measure (Measure α)).join = 0


theorem tan_add_pi (x : ℝ) : tan (x + π) = tan x


lemma eigenvalues_conjTranspose_mul_self_nonneg (A : Matrix m n 𝕜) [DecidableEq n] (i : n) :
    0 ≤ (isHermitian_transpose_mul_self A).eigenvalues i

{m : Type u_1}
{n : Type u_2}
{𝕜 : Type u_4}
[Fintype m]
[Fintype n]
[RCLike 𝕜]
(A : Matrix m n 𝕜)
[DecidableEq n]
(i : n)


@[simp]
theorem toAffineEquiv_symm : e.toAffineEquiv.symm = e.symm.toAffineEquiv

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(e : P ≃ᵃⁱ[𝕜] P₂)


/-- Given `e : ComplexShape.Embedding c c'`, this is the restriction
functor `HomologicalComplex C c' ⥤ HomologicalComplex C c`. -/
@[simps]
noncomputable def restrictionFunctor [HasZeroMorphisms C] :
    HomologicalComplex C c' ⥤ HomologicalComplex C c

∀ {X Y : HomologicalComplex C c'} (φ : X ⟶ Y), (e.restrictionFunctor C).map φ = HomologicalComplex.restrictionMap φ e


theorem nsmul_eq_iff {ψ θ : Angle} {n : ℕ} (hz : n ≠ 0) :
    n • ψ = n • θ ↔ ∃ k : Fin n, ψ = θ + (k : ℕ) • (2 * π / n : ℝ)

n • ψ = n • θ ↔ ∃ k, ψ = θ + ↑k • ↑(2 * π / ↑n)


theorem intervalIntegrable_zpow {n : ℤ} (h : 0 ≤ n ∨ (0 : ℝ) ∉ [[a, b]]) :
    IntervalIntegrable (fun x => x ^ n) μ a b


/-- Bijection between a subgroup `H` and its opposite. -/
@[to_additive (attr := simps!) "Bijection between an additive subgroup `H` and its opposite."]
def equivOp (H : Subgroup G) : H ≃ H.op

{G : Type u_2}
[Group G]
(H : Subgroup G)
(a : { a // (fun x => x ∈ H) a })


lemma negAddY_eq {P Q : Fin 3 → F} (hPz : P z ≠ 0) (hQz : Q z ≠ 0) : W.negAddY P Q =
    ((P y * Q z ^ 3 - Q y * P z ^ 3) * (W.addX P Q * (P z * Q z) ^ 2 - P x * Q z ^ 2 * addZ P Q ^ 2)
      + P y * Q z ^ 3 * addZ P Q ^ 3) / (P z * Q z) ^ 3

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

W.negAddY P Q =
  ((P y * Q z ^ 3 - Q y * P z ^ 3) *
        (W.addX P Q * (P z * Q z) ^ 2 - P x * Q z ^ 2 * WeierstrassCurve.Jacobian.addZ P Q ^ 2) +
      P y * Q z ^ 3 * WeierstrassCurve.Jacobian.addZ P Q ^ 3) /
    (P z * Q z) ^ 3


theorem tensor_rho {X Y : Action V G} {g : G} : (X ⊗ Y).ρ g = X.ρ g ⊗ Y.ρ g

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
[CategoryTheory.MonoidalCategory V]
{X Y : Action V G}
{g : ↑G}

(CategoryTheory.MonoidalCategory.tensorObj X Y).ρ g = CategoryTheory.MonoidalCategory.tensorHom (X.ρ g) (Y.ρ g)


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

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

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


theorem image_symm (h : α ≃ᵤ β) : image h.symm = preimage h

{α : Type u}
{β : Type u_1}
[UniformSpace α]
[UniformSpace β]
(h : α ≃ᵤ β)


lemma _root_.PresheafOfModules.Sheafify.app_eq_of_isLocallyInjective
    {Y : C} (r₀ r₀' : R₀.obj (Opposite.op Y))
    (m₀ m₀' : M₀.presheaf.obj (Opposite.op Y))
    (hr₀ : α.app _ r₀ = α.app _ r₀')
    (hm₀ : φ.app _ m₀ = φ.app _ m₀') :
    φ.app _ (r₀ • m₀) = φ.app _ (r₀' • m₀')

{J : CategoryTheory.GrothendieckTopology C}

(hA : CategoryTheory.Presheaf.IsSeparated J A)

(m₀ m₀' : ↑(M₀.presheaf.obj (Opposite.op Y)))

(hr₀ : (α.app (Opposite.op Y)) r₀ = (α.app (Opposite.op Y)) r₀')

(hm₀ : (φ.app (Opposite.op Y)) m₀ = (φ.app (Opposite.op Y)) m₀')

(φ.app (Opposite.op Y)) (r₀ • m₀) = (φ.app (Opposite.op Y)) (r₀' • m₀')


@[simp]
theorem ofNat_ne_top (a : ℕ) [a.AtLeastTwo] : (no_index (OfNat.ofNat a : ℕ∞)) ≠ ⊤


@[to_additive]
theorem range_le_ker_iff (f : G →* G') (g : G' →* G'') : f.range ≤ g.ker ↔ g.comp f = 1

{G : Type u_1}
{G' : Type u_2}
{G'' : Type u_3}
[Group G]
[Group G']
[Group G'']
(f : G →* G')
(g : G' →* G'')


/-- Order isomorphism between `α → β` and `β`, where `α` has a unique element. -/
@[simps! toEquiv apply]
def funUnique (α β : Type*) [Unique α] [Preorder β] : (α → β) ≃o β

(α : Type u_6)
(β : Type u_7)
[Unique α]
[Preorder β]
(f : (i : α) → (fun a => β) i)


theorem measure_eq_top_of_setLintegral_ne_top {f : α → ℝ≥0∞} {s : Set α}
    (hf : AEMeasurable f (μ.restrict s)) (hμf : ∫⁻ x in s, f x ∂μ ≠ ∞) :
    μ ({x ∈ s | f x = ∞}) = 0

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
{s : Set α}
(hf : AEMeasurable f (μ.restrict s))
(hμf : ∫⁻ (x : α) in s, f x ∂μ ≠ ⊤)


theorem floor_congr (h : ∀ n : ℕ, (n : α) ≤ a ↔ (n : β) ≤ b) : ⌊a⌋₊ = ⌊b⌋₊

{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemiring α]
[LinearOrderedSemiring β]
[FloorSemiring α]
[FloorSemiring β]
{a : α}
{b : β}
(h : ∀ (n : ℕ), ↑n ≤ a ↔ ↑n ≤ b)


@[simp]
theorem norm_mul (z1 z2 : ℤ_[p]) : ‖z1 * z2‖ = ‖z1‖ * ‖z2‖

{p : ℕ}
[Fact (Nat.Prime p)]
(z1 z2 : ℤ_[p])


/-- Elements of finite order are closed under multiplication. -/
@[to_additive "Elements of finite additive order are closed under addition."]
theorem IsOfFinOrder.mul (hx : IsOfFinOrder x) (hy : IsOfFinOrder y) : IsOfFinOrder (x * y)

{G : Type u_1}
[AddCommMonoid G]
{x y : G}
(hx : IsOfFinAddOrder x)
(hy : IsOfFinAddOrder y)


theorem homotopyTo_apply (i : N) {p q : Ω^ N X x} (H : p.1.HomotopyRel q.1 <| Cube.boundary N)
    (t : I × I) (tₙ : I^{ j // j ≠ i }) :
    homotopyTo i H t tₙ = H (t.fst, Cube.insertAt i (t.snd, tₙ))

(H : (↑p).HomotopyRel (↑q) (Cube.boundary N))

((GenLoop.homotopyTo i H) t) tₙ = H (t.1, (Cube.insertAt i) (t.2, tₙ))


/-- If `R` is a field, then localizing at a submonoid not containing `0` adds no new elements. -/
theorem Field.localization_map_bijective {K Kₘ : Type*} [Field K] [CommRing Kₘ] {M : Submonoid K}
    (hM : (0 : K) ∉ M) [Algebra K Kₘ] [IsLocalization M Kₘ] :
    Function.Bijective (algebraMap K Kₘ)

{K : Type u_4}
{Kₘ : Type u_5}
[Field K]
[CommRing Kₘ]
{M : Submonoid K}
(hM : 0 ∉ M)
[Algebra K Kₘ]
[IsLocalization M Kₘ]


@[to_additive]
lemma snd_mem_orbit_of_mem_orbit {x y : α × β} (h : x ∈ MulAction.orbit M y) :
    x.2 ∈ MulAction.orbit M y.2

{M : Type u}
[AddMonoid M]
{α : Type v}
[AddAction M α]
{β : Type u_1}
[AddAction M β]
{x y : α × β}
(h : x ∈ AddAction.orbit M y)


/-- If the domain of a `PEquiv` is all of `α`, its forward direction is injective. -/
theorem injective_of_forall_isSome {f : α ≃. β} (h : ∀ a : α, isSome (f a)) : Injective f

{α : Type u}
{β : Type v}
{f : α ≃. β}
(h : ∀ (a : α), (f a).isSome = true)


/-- Given a natural transformation `α : F.op ⟶ G.op`,
we can take the "unopposite" of each component obtaining a natural transformation `G ⟶ F`.
-/
@[simps]
protected def removeOp (α : F.op ⟶ G.op) : G ⟶ F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : CategoryTheory.Functor C D}
(α : F.op ⟶ G.op)
(X : C)

(CategoryTheory.NatTrans.removeOp α).app X = (α.app (Opposite.op X)).unop


theorem subset_succ (n : ℕ) : K n ⊆ K (n + 1)

{X : Type u_1}
[TopologicalSpace X]
(K : CompactExhaustion X)
(n : ℕ)


@[to_additive]
theorem smul_one_smul (r : R) (x : X[S⁻¹]) : (r • 1 : M) • x = r • x

{R : Type u_1}
{M : Type u_3}
{X : Type u_4}
[AddMonoid M]
{S : AddSubmonoid M}
[AddOreLocalization.AddOreSet S]
[AddAction M X]
[VAdd R X]
[VAdd R M]
[VAddAssocClass R M M]
[VAddAssocClass R M X]
(r : R)
(x : AddOreLocalization S X)


protected theorem map_sub (f : A' →ₑ+[φ] B') (x y : A') : f (x - y) = f x - f y

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
(A' : Type u_8)
[AddGroup A']
[DistribMulAction M A']
(B' : Type u_9)
[AddGroup B']
[DistribMulAction N B']
(f : A' →ₑ+[φ] B')
(x y : A')


@[to_additive (attr := simp)]
theorem finite_smul_set : (a • s).Finite ↔ s.Finite

{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[AddAction α β]
{a : α}
{s : Set β}


lemma ext_to (i j : ℤ) (hij : i + 1 = j) {A : C} {f g : A ⟶ (mappingCone φ).X i}
    (h₁ : f ≫ (fst φ).1.v i j hij = g ≫ (fst φ).1.v i j hij)
    (h₂ : f ≫ (snd φ).v i i (add_zero i) = g ≫ (snd φ).v i i (add_zero i)) :
    f = g

{f g : A ⟶ (CochainComplex.mappingCone φ).X i}

(h₁ : f ≫ (↑(CochainComplex.mappingCone.fst φ)).v i j hij = g ≫ (↑(CochainComplex.mappingCone.fst φ)).v i j hij)

(h₂ : f ≫ (CochainComplex.mappingCone.snd φ).v i i ⋯ = g ≫ (CochainComplex.mappingCone.snd φ).v i i ⋯)


theorem mul_cancel_left_coe_nonZeroDivisors {x y : R'} {c : R'⁰} : (c : R') * x = c * y ↔ x = y

{R' : Type u_6}
[CommRing R']
{x y : R'}
{c : ↥R'⁰}


@[to_additive]
protected theorem symm_iff {a b : S} : Commute a b ↔ Commute b a


/-- `cons` and `snoc` commute. We state this lemma in a non-dependent setting, as otherwise it
would involve a cast to convince Lean that the two types are equal, making it harder to use. -/
theorem cons_snoc_eq_snoc_cons {β : Type*} (a : β) (q : Fin n → β) (b : β) :
    @cons n.succ (fun _ ↦ β) a (snoc q b) = snoc (cons a q) b

{n : ℕ}
{β : Type u_1}
(a : β)
(q : Fin n → β)
(b : β)

Fin.cons a (Fin.snoc q b) = Fin.snoc (Fin.cons a q) b


lemma StrictMono.not_bddAbove_range [NoMaxOrder α] [SuccOrder β] [IsSuccArchimedean β]
    (hf : StrictMono f) : ¬ BddAbove (Set.range f)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Nonempty α]
[Preorder β]
{f : α → β}
[NoMaxOrder α]
[SuccOrder β]
[IsSuccArchimedean β]
(hf : StrictMono f)


@[simp]
theorem ofReal_tanh_ofReal_re (x : ℝ) : ((tanh x).re : ℂ) = tanh x


theorem pred_wcovBy (a : α) : pred a ⩿ a

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


/-- Multiplying by a nonzero element `a` of the field `K` is a linear equivalence. -/
@[simps!]
def smulOfNeZero (a : K) (ha : a ≠ 0) : M ≃ₗ[K] M

(K : Type u_6)
(M : Type u_8)
[Field K]
[AddCommGroup M]
[Module K M]
(a : K)
(ha : a ≠ 0)

∀ (a_1 : M), (LinearEquiv.smulOfNeZero K M a ha).symm a_1 = (Units.mk0 a ha)⁻¹ • a_1


@[simp]
theorem support_pure : (pure a).support = {a}


theorem tr_eval_dom {σ₁ σ₂ f₁ f₂} {tr : σ₁ → σ₂ → Prop} (H : Respects f₁ f₂ tr) {a₁ a₂}
    (aa : tr a₁ a₂) : (eval f₂ a₂).Dom ↔ (eval f₁ a₁).Dom

{σ₁ : Type u_1}
{σ₂ : Type u_2}
{f₁ : σ₁ → Option σ₁}
{f₂ : σ₂ → Option σ₂}
{tr : σ₁ → σ₂ → Prop}
(H : Turing.Respects f₁ f₂ tr)
{a₁ : σ₁}
{a₂ : σ₂}
(aa : tr a₁ a₂)

(Turing.eval f₂ a₂).Dom ↔ (Turing.eval f₁ a₁).Dom


/-- A helper construction: given a square between `i` and `f ≫ g`, produce a square between
`i` and `g`, whose top leg uses `f`:
A  → X
     ↓f
↓i   Y             --> A → Y
     ↓g                ↓i  ↓g
B  → Z                 B → Z
 -/
@[simps]
def squareToSnd {X Y Z : C} {i : Arrow C} {f : X ⟶ Y} {g : Y ⟶ Z} (sq : i ⟶ Arrow.mk (f ≫ g)) :
    i ⟶ Arrow.mk g

(sq : i ⟶ CategoryTheory.Arrow.mk (CategoryTheory.CategoryStruct.comp f g))

(CategoryTheory.Arrow.squareToSnd sq).right = sq.right


theorem variance_smul' {A : Type*} [CommSemiring A] [Algebra A ℝ] (c : A) (X : Ω → ℝ)
    (μ : Measure Ω) : variance (c • X) μ = c ^ 2 • variance X μ

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{A : Type u_2}
[CommSemiring A]
[Algebra A ℝ]
(c : A)
(X : Ω → ℝ)
(μ : MeasureTheory.Measure Ω)

ProbabilityTheory.variance (c • X) μ = c ^ 2 • ProbabilityTheory.variance X μ


@[to_additive (attr := simps tensorObj_as leftUnitor rightUnitor associator) Discrete.addMonoidal]
instance Discrete.monoidal : MonoidalCategory (Discrete M)

(M : Type u)
[Monoid M]
(X Y : CategoryTheory.Discrete M)


/-- If two `L.Hom`s are equal on a set, then they are equal on its substructure closure. -/
theorem eqOn_closure {f g : M →[L] N} {s : Set M} (h : Set.EqOn f g s) :
    Set.EqOn f g (closure L s)

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f g : L.Hom M N}
{s : Set M}
(h : Set.EqOn (⇑f) (⇑g) s)

Set.EqOn ⇑f ⇑g ↑((FirstOrder.Language.Substructure.closure L).toFun s)


/-- A split equalizer clearly induces a fork. -/
@[simps! pt]
def IsSplitEqualizer.asFork {W : C} {h : W ⟶ X} (t : IsSplitEqualizer f g h) :
    Fork f g

(t : CategoryTheory.IsSplitEqualizer f g h)


theorem PartiallyWellOrderedOn.image_of_monotone_on (hs : s.PartiallyWellOrderedOn r)
    (hf : ∀ a₁ ∈ s, ∀ a₂ ∈ s, r a₁ a₂ → r' (f a₁) (f a₂)) : (f '' s).PartiallyWellOrderedOn r'


theorem comapEq_trans {β γ : Type w} {f g h : β → γ} (k : f = g) (l : g = h) :
    comapEq C (k.trans l) = comapEq C k ≪≫ comapEq C l

(C : Type u)
[CategoryTheory.Category.{v, u} C]
{β γ : Type w}
{f g h : β → γ}
(k : f = g)
(l : g = h)

CategoryTheory.GradedObject.comapEq C ⋯ =
  CategoryTheory.GradedObject.comapEq C k ≪≫ CategoryTheory.GradedObject.comapEq C l


@[simp]
theorem comp_apply (g : S₂ →◃ S₃) (f : S₁ →◃ S₂) (x : S₁) : (g.comp f) x = g (f x)

{S₁ : Type u_1}
{S₂ : Type u_2}
{S₃ : Type u_3}
[Shelf S₁]
[Shelf S₂]
[Shelf S₃]
(g : S₂ →◃ S₃)
(f : S₁ →◃ S₂)
(x : S₁)


theorem integrable_map_equiv (f : α ≃ᵐ δ) (g : δ → β) :
    Integrable g (Measure.map f μ) ↔ Integrable (g ∘ f) μ

{α : Type u_1}
{β : Type u_2}
{δ : Type u_4}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasurableSpace δ]
[NormedAddCommGroup β]
(f : α ≃ᵐ δ)
(g : δ → β)

MeasureTheory.Integrable g (MeasureTheory.Measure.map (⇑f) μ) ↔ MeasureTheory.Integrable (g ∘ ⇑f) μ


@[continuity]
theorem continuous_arcsin : Continuous arcsin


/-- Arithmetic progressions of length three are preserved under `2`-Freiman homomorphisms. -/
@[to_additive
"Arithmetic progressions of length three are preserved under `2`-Freiman homomorphisms."]
lemma ThreeGPFree.of_image (hf : IsMulFreimanHom 2 s t f) (hf' : s.InjOn f) (hAs : A ⊆ s)
    (hA : ThreeGPFree (f '' A)) : ThreeGPFree A

{α : Type u_2}
{β : Type u_3}
[CommMonoid α]
[CommMonoid β]
{s A : Set α}
{t : Set β}
{f : α → β}
(hf : IsMulFreimanHom 2 s t f)
(hf' : Set.InjOn f s)
(hAs : A ⊆ s)
(hA : ThreeGPFree (f '' A))


@[simp]
theorem cancelBaseChange_symm_tmul (m : M) (n : N) :
    (cancelBaseChange R A B M N).symm (m ⊗ₜ n) = m ⊗ₜ (1 ⊗ₜ n)

(R : Type uR)
(A : Type uA)
(B : Type uB)
{M : Type uM}
{N : Type uN}
[CommSemiring R]
[CommSemiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[AddCommMonoid M]
[Module R M]
[Module A M]
[Module B M]
[IsScalarTower R A M]
[IsScalarTower R B M]
[SMulCommClass A B M]
[AddCommMonoid N]
[Module R N]
[Algebra A B]
[IsScalarTower A B M]
(m : M)
(n : N)

(TensorProduct.AlgebraTensorModule.cancelBaseChange R A B M N).symm (m ⊗ₜ[R] n) = m ⊗ₜ[A] 1 ⊗ₜ[R] n


theorem zero_apply (m : M) : (0 : M →ₗ⁅R,L⁆ N) m = 0

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


protected theorem star_add [AddMonoid α] [StarAddMonoid α] (s t : Set α) : (s + t)⋆ = s⋆ + t⋆

{α : Type u_1}
[AddMonoid α]
[StarAddMonoid α]
(s t : Set α)


theorem or_or_or_comm : (a ∨ b) ∨ c ∨ d ↔ (a ∨ c) ∨ b ∨ d


@[to_additive (attr := simp)]
theorem eqLocusM_same (f : M →* N) : f.eqLocusM f = ⊤

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(f : M →+ N)


/-- A class of morphisms `W` has the two-out-of-three property if whenever two out
of three maps in `f`, `g`, `f ≫ g` are in `W`, then the third map is also in `W`. -/
class HasTwoOutOfThreeProperty (W : MorphismProperty C)
    extends W.IsStableUnderComposition : Prop where
  of_postcomp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) : W g → W (f ≫ g) → W f
  of_precomp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) : W f → W (f ≫ g) → W g

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

W f → W (CategoryTheory.CategoryStruct.comp f g) → W g


theorem prev_reverse_eq_next (l : List α) (h : Nodup l) (x : α) (hx : x ∈ l) :
    prev l.reverse x (mem_reverse.mpr hx) = next l x hx

{α : Type u_1}
[DecidableEq α]
(l : List α)
(h : l.Nodup)
(x : α)
(hx : x ∈ l)


theorem dist_lt_of_nonempty [Nonempty α] (w : ∀ x : α, dist (f x) (g x) < C) : dist f g < C

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[CompactSpace α]
[MetricSpace β]
{f g : C(α, β)}
{C : ℝ}
[Nonempty α]
(w : ∀ (x : α), dist (f x) (g x) < C)


lemma locallyRingedSpaceAdjunction_counit :
    locallyRingedSpaceAdjunction.counit = (NatIso.op SpecΓIdentity.{u}).inv

AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction.counit =
  (CategoryTheory.NatIso.op AlgebraicGeometry.LocallyRingedSpace.SpecΓIdentity).inv


theorem foldl_map (f : β₁ → β₂) (g : α → β₂ → α) (l : List β₁) (init : α) :
    (l.map f).foldl g init = l.foldl (fun x y => g x (f y)) init

{β₁ : Type u_1}
{β₂ : Type u_2}
{α : Type u_3}
(f : β₁ → β₂)
(g : α → β₂ → α)
(l : List β₁)
(init : α)

List.foldl g init (List.map f l) = List.foldl (fun x y => g x (f y)) init l


theorem isSimpleModule_iff_isAtom : IsSimpleModule R m ↔ IsAtom m

{R : Type u_2}
[Ring R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
{m : Submodule R M}


/-- A function is `C^∞` if and only if it is differentiable,
and its derivative (formulated in terms of `fderiv`) is `C^∞`. -/
theorem contDiff_top_iff_fderiv :
    ContDiff 𝕜 ∞ f ↔ Differentiable 𝕜 f ∧ ContDiff 𝕜 ∞ fun y => fderiv 𝕜 f y

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}

ContDiff 𝕜 ⊤ f ↔ Differentiable 𝕜 f ∧ ContDiff 𝕜 ⊤ fun y => fderiv 𝕜 f y


@[simp]
theorem arrowCongrRight_apply {α : Sort u} {β : Sort v} {γ : Sort w} (e : α ↪ β) (f : γ → α) :
    arrowCongrRight e f = e ∘ f


/-- The subtypes corresponding to equal sets are equivalent. -/
@[simps! apply]
def setCongr {α : Type*} {s t : Set α} (h : s = t) : s ≃ t

{α : Type u_1}
{s t : Set α}
(h : s = t)
(a : { a // (fun x => x ∈ s) a })


/-- Constructs an equivalence between partial orders from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : PartOrd.{u}} (e : α ≃o β) : α ≅ β


theorem _root_.Associated.separable {f g : R[X]}
    (ha : Associated f g) (h : f.Separable) : g.Separable

{R : Type u}
[CommSemiring R]
{f g : R[X]}
(ha : Associated f g)
(h : f.Separable)


/-- Equipping a type with the discrete topology is left adjoint to the forgetful functor
`Top ⥤ Type`. -/
@[simps! unit counit]
def adj₁ : discrete ⊣ forget TopCat.{u}

TopCat.adj₁.counit = { app := fun X => { toFun := id, continuous_toFun := ⋯ }, naturality := TopCat.adj₁.proof_3 }


/-- Show that `FirstObj` is isomorphic to `FamilyOfElements`. -/
@[simps]
def firstObjEqFamily : FirstObj P R ≅ R.FamilyOfElements P

(P : CategoryTheory.Functor Cᵒᵖ (Type (max v u)))

(t : CategoryTheory.Equalizer.FirstObj P R)

(CategoryTheory.Equalizer.firstObjEqFamily P R).hom t f hf =
  CategoryTheory.Limits.Pi.π (fun f => P.obj (Opposite.op f.fst)) ⟨Y, ⟨f, hf⟩⟩ t


@[simp]
theorem implicitFunction_apply_image (hf : HasStrictFDerivAt f f' a) (hf' : range f' = ⊤) :
    hf.implicitFunction f f' hf' (f a) 0 = a

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[FiniteDimensional 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{a : E}
(hf : HasStrictFDerivAt f f' a)
(hf' : LinearMap.range f' = ⊤)

HasStrictFDerivAt.implicitFunction f f' hf hf' (f a) 0 = a


theorem hasFDerivWithinAt_diff_singleton (y : E) :
    HasFDerivWithinAt f f' (s \ {y}) x ↔ HasFDerivWithinAt f f' s x

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


/-- Given a family of opens `opensLeCoverCocone U` is essentially the natural cocone
    associated to the sieve generated by the presieve associated to `U` with indexing
    category changed using the above equivalence. -/
@[simps]
def whiskerIsoMapGenerateCocone :
    (F.mapCone (opensLeCoverCocone U).op).whisker (generateEquivalenceOpensLe U hY).op.functor ≅
      F.mapCone (Sieve.generate (presieveOfCoveringAux U Y)).arrows.cocone.op

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : TopCat}
(F : TopCat.Presheaf C X)
{ι : Type w}
(U : ι → TopologicalSpace.Opens ↑X)
{Y : TopologicalSpace.Opens ↑X}
(hY : Y = iSup U)

(F.whiskerIsoMapGenerateCocone U hY).hom.hom = F.map (CategoryTheory.eqToHom ⋯)


lemma covBy_iff_exists_insert : s ⋖ t ↔ ∃ a ∉ s, insert a s = t


nonrec theorem ae_lt_top [IsFiniteMeasure ℙ] {μ : Measure E} {X : Ω → E} :
    ∀ᵐ x ∂μ, pdf X ℙ μ x < ∞

{Ω : Type u_1}
{E : Type u_2}
[MeasurableSpace E]
{m : MeasurableSpace Ω}
{ℙ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure ℙ]
{μ : MeasureTheory.Measure E}
{X : Ω → E}

∀ᵐ (x : E) ∂μ, MeasureTheory.pdf X ℙ μ x < ⊤


/-- Expand the square -/
theorem norm_add_sq_real (x y : F) : ‖x + y‖ ^ 2 = ‖x‖ ^ 2 + 2 * ⟪x, y⟫_ℝ + ‖y‖ ^ 2

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(x y : F)


theorem rootMultiplicity_expand :
    (expand R p f).rootMultiplicity r = p * f.rootMultiplicity (r ^ p)

{R : Type u}
[CommRing R]
{p : ℕ}
[ExpChar R p]
{f : R[X]}
{r : R}

Polynomial.rootMultiplicity r ((Polynomial.expand R p) f) = p * Polynomial.rootMultiplicity (r ^ p) f


theorem homothety_neg_one_apply (c p : P₁) : homothety c (-1 : R') p = pointReflection R' c p

{P₁ : Type u_2}
{V₁ : Type u_6}
[AddCommGroup V₁]
[AffineSpace V₁ P₁]
{R' : Type u_10}
[CommRing R']
[Module R' V₁]
(c p : P₁)

(AffineMap.homothety c (-1)) p = (AffineEquiv.pointReflection R' c) p


theorem mapsTo_range (h : Semiconj f fa fb) : MapsTo fb (range f) (range f)

{α : Type u_1}
{β : Type u_2}
{fa : α → α}
{fb : β → β}
{f : α → β}
(h : Function.Semiconj f fa fb)

Set.MapsTo fb (Set.range f) (Set.range f)


theorem le_add_le (a : Nat) {b c : Nat} (h : a ≤ c) : (a ≤ b + c) = True


theorem pos_of_isPowerOfTwo (h : isPowerOfTwo n) : n > 0


theorem roots_X_pow_char_pow_sub_C {y : R} :
    (X ^ p ^ n - C y).roots = p ^ n • {(iterateFrobeniusEquiv R p n).symm y}

{R : Type u_1}
[CommRing R]
[IsDomain R]
{p n : ℕ}
[ExpChar R p]
[PerfectRing R p]
{y : R}

(Polynomial.X ^ p ^ n - Polynomial.C y).roots = p ^ n • {(iterateFrobeniusEquiv R p n).symm y}


@[simp]
theorem smul_C {S} [SMulZeroClass S R] (s : S) (r : R) : s • C r = C (s • r)

{R : Type u}
[Semiring R]
{S : Type u_1}
[SMulZeroClass S R]
(s : S)
(r : R)

s • Polynomial.C r = Polynomial.C (s • r)


/-- `OrderDual` as a functor. -/
@[simps]
def dual : FinPartOrd ⥤ FinPartOrd

{X Y : FinPartOrd}
(a : ↑X.toPartOrd →o ↑Y.toPartOrd)


@[simp]
theorem spanExt_inv_app_right : (spanExt iX iY iZ wf wg).inv.app WalkingSpan.right = iZ.inv

{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 ⟶ Y}
{g : X ⟶ Z}
{f' : X' ⟶ Y'}
{g' : X' ⟶ Z'}
(wf : iX.hom ≫ f' = f ≫ iY.hom)
(wg : iX.hom ≫ g' = g ≫ iZ.hom)

(CategoryTheory.Limits.spanExt iX iY iZ wf wg).inv.app CategoryTheory.Limits.WalkingSpan.right = iZ.inv


@[simp]
theorem coe_rangeRestrict [RingHomSurjective σ₁₂] (f : M₁ →SL[σ₁₂] M₂) :
    (f.rangeRestrict : M₁ →ₛₗ[σ₁₂] LinearMap.range f) = (f : M₁ →ₛₗ[σ₁₂] M₂).rangeRestrict

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
[RingHomSurjective σ₁₂]
(f : M₁ →SL[σ₁₂] M₂)


theorem kreplace_nodupKeys (a : α) (b : β a) {l : List (Sigma β)} :
    (kreplace a b l).NodupKeys ↔ l.NodupKeys

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(b : β a)
{l : List (Sigma β)}

(List.kreplace a b l).NodupKeys ↔ l.NodupKeys


@[simp] nonrec lemma card_sigma [Fintype ι] [∀ i, Fintype (α i)] :
    card (Sigma α) = ∑ i, card (α i)

{ι : Type u_4}
{α : ι → Type u_6}
[Fintype ι]
[(i : ι) → Fintype (α i)]

Fintype.card (Sigma α) = ∑ i : ι, Fintype.card (α i)


protected theorem inv_ne_zero : a⁻¹ ≠ 0 ↔ a ≠ ∞

a⁻¹ ≠ 0 ↔ a ≠ ⊤


theorem lt_fdiv_add_one_mul_self (a : Int) {b : Int} (H : 0 < b) : a < (a.fdiv b + 1) * b


/-- A snake input in an abelian category `C` consists of morphisms
of short complexes `L₀ ⟶ L₁ ⟶ L₂ ⟶ L₃` (which should be visualized vertically) such
that `L₀` and `L₃` are respectively the kernel and the cokernel of `L₁ ⟶ L₂`,
`L₁` and `L₂` are exact, `L₁.g` is epi and `L₂.f` is mono. -/
structure SnakeInput where
  /-- the zeroth row -/
  L₀ : ShortComplex C
  /-- the first row -/
  L₁ : ShortComplex C
  /-- the second row -/
  L₂ : ShortComplex C
  /-- the third row -/
  L₃ : ShortComplex C
  /-- the morphism from the zeroth row to the first row -/
  v₀₁ : L₀ ⟶ L₁
  /-- the morphism from the first row to the second row -/
  v₁₂ : L₁ ⟶ L₂
  /-- the morphism from the second row to the third row -/
  v₂₃ : L₂ ⟶ L₃
  w₀₂ : v₀₁ ≫ v₁₂ = 0 := by aesop_cat
  w₁₃ : v₁₂ ≫ v₂₃ = 0 := by aesop_cat
  /-- `L₀` is the kernel of `v₁₂ : L₁ ⟶ L₂`. -/
  h₀ : IsLimit (KernelFork.ofι _ w₀₂)
  /-- `L₃` is the cokernel of `v₁₂ : L₁ ⟶ L₂`. -/
  h₃ : IsColimit (CokernelCofork.ofπ _ w₁₃)
  L₁_exact : L₁.Exact
  epi_L₁_g : Epi L₁.g
  L₂_exact : L₂.Exact
  mono_L₂_f : Mono L₂.f

(self : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.CategoryStruct.comp self.v₁₂ self.v₂₃ = 0


theorem subset_iUnion₂ {s : ∀ i, κ i → Set α} (i : ι) (j : κ i) : s i j ⊆ ⋃ (i') (j'), s i' j'

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


@[to_additive (attr := simp)]
lemma mk_pow [Monoid M] (a : M) (n : ℕ) : mk (a ^ n) = mk a ^ n

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

DomAddAct.mk (n • a) = n • DomAddAct.mk a


theorem HasDerivAt.clog_real {f : ℝ → ℂ} {x : ℝ} {f' : ℂ} (h₁ : HasDerivAt f f' x)
    (h₂ : f x ∈ slitPlane) : HasDerivAt (fun t => log (f t)) (f' / f x) x

{f : ℝ → ℂ}
{x : ℝ}
{f' : ℂ}
(h₁ : HasDerivAt f f' x)
(h₂ : f x ∈ Complex.slitPlane)

HasDerivAt (fun t => Complex.log (f t)) (f' / f x) x


theorem eval₂_reverse_mul_pow (i : R →+* S) (x : S) [Invertible x] (f : R[X]) :
    eval₂ i (⅟ x) (reverse f) * x ^ f.natDegree = eval₂ i x f

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[CommSemiring S]
(i : R →+* S)
(x : S)
[Invertible x]
(f : Polynomial R)

Polynomial.eval₂ i (⅟x) f.reverse * x ^ f.natDegree = Polynomial.eval₂ i x f


/-- Let `r` be an irrational number. Then `B⁺_r` and `B⁺'_r` are equal. -/
theorem Irrational.beattySeq'_pos_eq {r : ℝ} (hr : Irrational r) :
    {beattySeq' r k | k > 0} = {beattySeq r k | k > 0}

{x | ∃ k > 0, beattySeq' r k = x} = {x | ∃ k > 0, beattySeq r k = x}


Polynomial.C (a - b) = Polynomial.C a - Polynomial.C b


/-- The range of a surjective monoid homomorphism is the whole of the codomain. -/
@[to_additive (attr := simp)
  "The range of a surjective `AddMonoid` homomorphism is the whole of the codomain."]
theorem range_top_of_surjective {N} [Group N] (f : G →* N) (hf : Function.Surjective f) :
    f.range = (⊤ : Subgroup N)

{G : Type u_1}
[Group G]
{N : Type u_7}
[Group N]
(f : G →* N)
(hf : Function.Surjective ⇑f)


theorem IsCompact.exists_sSup_image_eq [ClosedIciTopology α] {s : Set β} (hs : IsCompact s)
    (ne_s : s.Nonempty) : ∀ {f : β → α}, ContinuousOn f s → ∃ x ∈ s, sSup (f '' s) = f x

{α : Type u_2}
{β : Type u_3}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIciTopology α]
{s : Set β}
(hs : IsCompact s)
(ne_s : s.Nonempty)
{f : β → α}


theorem comp_assoc {R₄ : Type*} [Semiring R₄] [Module R₄ M₄] {σ₁₄ : R₁ →+* R₄} {σ₂₄ : R₂ →+* R₄}
    {σ₃₄ : R₃ →+* R₄} [RingHomCompTriple σ₁₃ σ₃₄ σ₁₄] [RingHomCompTriple σ₂₃ σ₃₄ σ₂₄]
    [RingHomCompTriple σ₁₂ σ₂₄ σ₁₄] (h : M₃ →SL[σ₃₄] M₄) (g : M₂ →SL[σ₂₃] M₃) (f : M₁ →SL[σ₁₂] M₂) :
    (h.comp g).comp f = h.comp (g.comp f)

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


/-- A weighted sum may be split into such sums over two subsets. -/
theorem weightedVSubOfPoint_sdiff [DecidableEq ι] {s₂ : Finset ι} (h : s₂ ⊆ s) (w : ι → k)
    (p : ι → P) (b : P) :
    (s \ s₂).weightedVSubOfPoint p b w + s₂.weightedVSubOfPoint p b w =
      s.weightedVSubOfPoint p b w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
[DecidableEq ι]
{s₂ : Finset ι}
(h : s₂ ⊆ s)
(w : ι → k)
(p : ι → P)
(b : P)

((s \ s₂).weightedVSubOfPoint p b) w + (s₂.weightedVSubOfPoint p b) w = (s.weightedVSubOfPoint p b) w


theorem Sized.pos {s l x r} (h : Sized (@node α s l x r)) : 0 < s

{α : Type u_1}
{s : ℕ}
{l : Ordnode α}
{x : α}
{r : Ordnode α}
(h : (Ordnode.node s l x r).Sized)


/-- If a set has a closed thickening with finite measure, then the measure of its `r`-closed
thickenings converges to the measure of its closure as `r` tends to `0`. -/
theorem tendsto_measure_cthickening {μ : Measure α} {s : Set α}
    (hs : ∃ R > 0, μ (cthickening R s) ≠ ∞) :
    Tendsto (fun r => μ (cthickening r s)) (𝓝 0) (𝓝 (μ (closure s)))

(hs : ∃ R > 0, μ (Metric.cthickening R s) ≠ ⊤)

Filter.Tendsto (fun r => μ (Metric.cthickening r s)) (𝓝 0) (𝓝 (μ (closure s)))


/-- The coercion of a subgroupoid as a groupoid -/
@[simps comp_coe, simps (config := .lemmasOnly) inv_coe]
instance coe : Groupoid S.objs

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)

∀ {X Y : ↑S.objs} (p : X ⟶ Y), ↑(CategoryTheory.Groupoid.inv p) = CategoryTheory.Groupoid.inv ↑p


@[simp]
theorem quotientKerEquivOfRightInverse.apply {g : S → R} (hf : Function.RightInverse g f)
    (x : R ⧸ ker f) : quotientKerEquivOfRightInverse hf x = kerLift f x

{R : Type u}
{S : Type v}
[CommRing R]
[Semiring S]
{f : R →+* S}
{g : S → R}
(hf : Function.RightInverse g ⇑f)
(x : R ⧸ RingHom.ker f)

(RingHom.quotientKerEquivOfRightInverse hf) x = f.kerLift x


theorem integral_nonneg_of_forall (hab : a ≤ b) (hf : ∀ u, 0 ≤ f u) : 0 ≤ ∫ u in a..b, f u ∂μ

{f : ℝ → ℝ}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(hab : a ≤ b)
(hf : ∀ (u : ℝ), 0 ≤ f u)


@[mono]
theorem toAddSubgroup_strictMono :
    StrictMono (toAddSubgroup : NonUnitalSubring R → AddSubgroup R)


/-- The projective spectrum of a graded commutative ring is the subtype of all homogenous ideals
that are prime and do not contain the irrelevant ideal. -/
@[ext]
structure ProjectiveSpectrum where
  asHomogeneousIdeal : HomogeneousIdeal 𝒜
  isPrime : asHomogeneousIdeal.toIdeal.IsPrime
  not_irrelevant_le : ¬HomogeneousIdeal.irrelevant 𝒜 ≤ asHomogeneousIdeal

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


/-- The canonical map `DoubleCentralizer.toProdMulOpposite` as a ring homomorphism. -/
@[simps]
def toProdMulOppositeHom : 𝓜(𝕜, A) →+* (A →L[𝕜] A) × (A →L[𝕜] A)ᵐᵒᵖ

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]

∀ (a : 𝓜(𝕜, A)), DoubleCentralizer.toProdMulOppositeHom a = a.toProdMulOpposite


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

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

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


/-- This rather trivial consequence of `subset_iUnion`is convenient with `apply`, and has `i`
explicit for this purpose. -/
theorem subset_iUnion_of_subset {s : Set α} {t : ι → Set α} (i : ι) (h : s ⊆ t i) : s ⊆ ⋃ i, t i

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


@[simp]
theorem mapIsoToOrderIso_apply (e : X ≅ Y) (P : Subobject X) :
    mapIsoToOrderIso e P = (map e.hom).obj P

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
(e : X ≅ Y)
(P : CategoryTheory.Subobject X)

(CategoryTheory.Subobject.mapIsoToOrderIso e) P = (CategoryTheory.Subobject.map e.hom).obj P


@[simp]
lemma leadingCoeff_Φ [Nontrivial R] (n : ℤ) : (W.Φ n).leadingCoeff = 1

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
[Nontrivial R]
(n : ℤ)


@[simp]
theorem LinearEquiv.coe_isometryOfOrthonormal (f : E ≃ₗ[𝕜] E') {v : Basis ι 𝕜 E}
    (hv : Orthonormal 𝕜 v) (hf : Orthonormal 𝕜 (f ∘ v)) : ⇑(f.isometryOfOrthonormal hv hf) = f

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


theorem subset_preimage : spectrum S a ⊆ f ⁻¹' spectrum R a

{R : Type u_3}
{S : Type u_4}
{A : Type u_5}
[Semifield R]
[Semifield S]
[Ring A]
[Algebra R S]
[Algebra R A]
[Algebra S A]
{a : A}
{f : S → R}
[IsScalarTower R S A]
(h : SpectrumRestricts a f)


lemma LeftHomologyMapData.quasiIso_iff {φ : S₁ ⟶ S₂} {h₁ : S₁.LeftHomologyData}
    {h₂ : S₂.LeftHomologyData} (γ : LeftHomologyMapData φ h₁ h₂) :
    QuasiIso φ ↔ IsIso γ.φH

(γ : CategoryTheory.ShortComplex.LeftHomologyMapData φ h₁ h₂)

CategoryTheory.ShortComplex.QuasiIso φ ↔ CategoryTheory.IsIso γ.φH


theorem AffineMap.continuous_of_finiteDimensional (f : PE →ᵃ[𝕜] PF) : Continuous f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type w}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace 𝕜]
{PE : Type u_1}
{PF : Type u_2}
[MetricSpace PE]
[NormedAddTorsor E PE]
[MetricSpace PF]
[NormedAddTorsor F PF]
[FiniteDimensional 𝕜 E]
(f : PE →ᵃ[𝕜] PF)


lemma congr_symm_apply_of [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃+* G' i)
    (he : ∀ i j h, (e j).toRingHom.comp (f i j h) = (f' i j h).comp (e i))
    {i : ι} (g : G' i) :
    (congr e he).symm (of G' _ i g) = of G (fun _ _ h ↦ f _ _ h) i ((e i).symm g)

{f' : (i j : ι) → i ≤ j → G' i →+* G' j}

(he : ∀ (i j : ι) (h : i ≤ j), (e j).toRingHom.comp (f i j h) = (f' i j h).comp ↑(e i))

(Ring.DirectLimit.congr e he).symm ((Ring.DirectLimit.of G' (fun x x_1 h => ⇑(f' x x_1 h)) i) g) =
  (Ring.DirectLimit.of G (fun x x_1 h => ⇑(f x x_1 h)) i) ((e i).symm g)


theorem annihilator_bot : (⊥ : Submodule R M).annihilator = ⊤

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]


@[simp, norm_cast]
theorem gcd_coe (n m : ℕ+) : (gcd n m : ℕ) = Nat.gcd n m


protected lemma inter (hs : Absorbs G₀ s u) (ht : Absorbs G₀ t u) : Absorbs G₀ (s ∩ t) u

{G₀ : Type u_1}
{α : Type u_2}
[GroupWithZero G₀]
[Bornology G₀]
[MulAction G₀ α]
{s t u : Set α}
(hs : Absorbs G₀ s u)
(ht : Absorbs G₀ t u)


theorem map_eq_map_iff_of_injOn {f g : Filter α} {m : α → β} {s : Set α} (hsf : s ∈ f) (hsg : s ∈ g)
    (hm : InjOn m s) : map m f = map m g ↔ f = g

{α : Type u}
{β : Type v}
{f g : Filter α}
{m : α → β}
{s : Set α}
(hsf : s ∈ f)
(hsg : s ∈ g)
(hm : Set.InjOn m s)


theorem choose_zero_pos (R) [NonAssocRing R] [Pow R ℕ] [NatPowAssoc R] [BinomialRing R]
    {k : ℕ} (h_pos: 0 < k) : choose (0 : R) k = 0

(R : Type u_2)
[NonAssocRing R]
[Pow R ℕ]
[NatPowAssoc R]
[BinomialRing R]
{k : ℕ}
(h_pos : 0 < k)


theorem map_denom_ne_zero {L F : Type*} [Zero L] [FunLike F K[X] L] [ZeroHomClass F K[X] L]
    (φ : F) (hφ : Function.Injective φ) (f : RatFunc K) : φ f.denom ≠ 0

{K : Type u}
[Field K]
{L : Type u_1}
{F : Type u_2}
[Zero L]
[FunLike F K[X] L]
[ZeroHomClass F K[X] L]
(φ : F)
(hφ : Function.Injective ⇑φ)
(f : RatFunc K)


@[simp] lemma upperBounds_supClosure (s : Set α) : upperBounds (supClosure s) = upperBounds s

{α : Type u_2}
[SemilatticeSup α]
(s : Set α)


theorem tsum_geometric_two : (∑' n : ℕ, ((1 : ℝ) / 2) ^ n) = 2


theorem IsClosed.diffContOnCl_iff (hs : IsClosed s) : DiffContOnCl 𝕜 f s ↔ DifferentiableOn 𝕜 f s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(hs : IsClosed s)


@[elab_as_elim]
theorem induction_on (f : α →ₘ[μ] β) {p : (α →ₘ[μ] β) → Prop} (H : ∀ f hf, p (mk f hf)) : p f

(H : ∀ (f : α → β) (hf : MeasureTheory.AEStronglyMeasurable f μ), p (MeasureTheory.AEEqFun.mk f hf))


theorem suffixLevenshtein_cons_cons_fst_get_zero
    (x : α) (xs y ys) (w : 0 < (suffixLevenshtein C (x :: xs) (y :: ys)).val.length) :
    (suffixLevenshtein C (x :: xs) (y :: ys)).1[0]'w =
      let ⟨dx, _⟩ := suffixLevenshtein C xs (y :: ys)
      let ⟨dy, _⟩ := suffixLevenshtein C (x :: xs) ys
      let ⟨dxy, _⟩ := suffixLevenshtein C xs ys
      min
        (C.delete x + dx[0])
        (min
          (C.insert y + dy[0])
          (C.substitute x y + dxy[0]))

(suffixLevenshtein C (x :: xs) (y :: ys)).val[0] =
  match suffixLevenshtein C xs (y :: ys) with
  | ⟨dx, property⟩ =>
    match suffixLevenshtein C (x :: xs) ys with
    | ⟨dy, property_1⟩ =>
      match suffixLevenshtein C xs ys with
      | ⟨dxy, property_2⟩ => min (C.delete x + dx[0]) (min (C.insert y + dy[0]) (C.substitute x y + dxy[0]))


(CategoryTheory.CategoryStruct.id X).F = CategoryTheory.Limits.prod.snd


/-- An `R`-coalgebra is a comonoid object in the category of `R`-modules. -/
@[simps] def toComonObj (X : CoalgebraCat R) : Comon_ (ModuleCat R)

{R : Type u}
[CommRing R]
(X : CoalgebraCat R)

X.toComonObj.counit = ModuleCat.ofHom Coalgebra.counit


theorem inter_comm (s t : Multiset α) : s ∩ t = t ∩ s

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


/-- The functor which sends a triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` in `Cᵒᵖ` to the triangle
`Z.unop ⟶ Y.unop ⟶ X.unop ⟶ Z.unop⟦1⟧` in `C` (without introducing signs). -/
@[simps]
noncomputable def inverse : Triangle Cᵒᵖ ⥤ (Triangle C)ᵒᵖ

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

(CategoryTheory.Pretriangulated.TriangleOpEquivalence.inverse C).map φ =
  Quiver.Hom.op { hom₁ := φ.hom₃.unop, hom₂ := φ.hom₂.unop, hom₃ := φ.hom₁.unop, comm₁ := ⋯, comm₂ := ⋯, comm₃ := ⋯ }


theorem setIntegral_compProd {f : β × γ → E} {s : Set β} {t : Set γ} (hs : MeasurableSet s)
    (ht : MeasurableSet t) (hf : IntegrableOn f (s ×ˢ t) ((κ ⊗ₖ η) a)) :
    ∫ z in s ×ˢ t, f z ∂(κ ⊗ₖ η) a = ∫ x in s, ∫ y in t, f (x, y) ∂η (a, x) ∂κ a

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

(hf : MeasureTheory.IntegrableOn f (s ×ˢ t) ((κ ⊗ₖ η) a))

∫ (z : β × γ) in s ×ˢ t, f z ∂(κ ⊗ₖ η) a = ∫ (x : β) in s, ∫ (y : γ) in t, f (x, y) ∂η (a, x) ∂κ a


protected lemma sq_eq_sq_iff_eq_or_eq_neg (h : Commute a b) : a ^ 2 = b ^ 2 ↔ a = b ∨ a = -b

{R : Type x}
[Ring R]
{a b : R}
[NoZeroDivisors R]
(h : Commute a b)


@[to_additive (attr := simp)]
theorem edist_smul_Lp (c : Mᵈᵐᵃ) (f g : Lp E p μ) : edist (c • f) (c • g) = edist f g

[MeasureTheory.SMulInvariantMeasure M α μ]


/-- An angle in a right-angled triangle expressed using `arctan`. -/
theorem oangle_add_left_eq_arctan_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    o.oangle (x + y) y = Real.arctan (‖x‖ / ‖y‖)

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

o.oangle (x + y) y = ↑(Real.arctan (‖x‖ / ‖y‖))


@[to_additive]
theorem Left.self_le_inv (h : a ≤ 1) : a ≤ a⁻¹

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


protected theorem not_le : ¬f ≤ g ↔ ∃ s ∈ g, s ∉ f


theorem iSup_affineOpens_eq_top (X : Scheme) : ⨆ i : X.affineOpens, (i : X.Opens) = ⊤


@[simp]
theorem rdropWhile_concat_neg (x : α) (h : ¬p x) : rdropWhile p (l ++ [x]) = l ++ [x]

{α : Type u_1}
(p : α → Bool)
(l : List α)
(x : α)
(h : ¬p x = true)


@[simp] theorem pow_eq_top_iff {n : ℕ} : a ^ n = ∞ ↔ a = ∞ ∧ n ≠ 0


theorem map_le_iff_le_comap : map m f ≤ g ↔ f ≤ comap m g

{α : Type u}
{β : Type v}
{f : Filter α}
{g : Filter β}
{m : α → β}

Filter.map m f ≤ g ↔ f ≤ Filter.comap m g


/-- Convenience congruence lemma stating in a dependent setting that, if the arguments to a formal
multilinear series are equal, then the values are also equal. -/
theorem congr (p : FormalMultilinearSeries 𝕜 E F) {m n : ℕ} {v : Fin m → E} {w : Fin n → E}
    (h1 : m = n) (h2 : ∀ (i : ℕ) (him : i < m) (hin : i < n), v ⟨i, him⟩ = w ⟨i, hin⟩) :
    p m v = p n w


theorem smul (r : ℝ≥0∞) (h : ν ⟂ₘ μ) : r • ν ⟂ₘ μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(r : ℝ≥0∞)
(h : ν ⟂ₘ μ)


theorem monotone_iUnionUpTo : Monotone p.iUnionUpTo

{α : Type u_1}
[MetricSpace α]
{β : Type u}
[Nonempty β]
(p : Besicovitch.TauPackage β α)


theorem tendsto_rightLim_within (x : α) : Tendsto f (𝓝[>] x) (𝓝[≥] rightLim f x)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Monotone f)
[TopologicalSpace α]
[OrderTopology α]
(x : α)

Filter.Tendsto f (𝓝[>] x) (𝓝[≥] Function.rightLim f x)


@[ext]
theorem ext (A B : HVertexOperator Γ R V W) (h : ∀ v : V, A v = B v) :
    A = B

{Γ : Type u_1}
[PartialOrder Γ]
{R : Type u_2}
{V : Type u_3}
{W : Type u_4}
[CommRing R]
[AddCommGroup V]
[Module R V]
[AddCommGroup W]
[Module R W]
(A B : HVertexOperator Γ R V W)
(h : ∀ (v : V), A v = B v)


/-- Linearly disjoint is symmetric in a commutative ring. -/
theorem linearDisjoint_symm : M.LinearDisjoint N ↔ N.LinearDisjoint M

{R : Type u}
{S : Type v}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
{M N : Submodule R S}


/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b < slope f c b`. -/
theorem map_lt_lineMap_iff_slope_lt_slope_right (h : 0 < (1 - r) * (b - a)) :
    f c < lineMap (f a) (f b) r ↔ slope f a b < slope f c b

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{f : k → E}
{a b r : k}
(h : 0 < (1 - r) * (b - a))

f ((AffineMap.lineMap a b) r) < (AffineMap.lineMap (f a) (f b)) r ↔ slope f a b < slope f ((AffineMap.lineMap a b) r) b


theorem map_map (S : Subalgebra R A) (g : B →ₐ[R] C) (f : A →ₐ[R] B) :
    (S.map f).map g = S.map (g.comp f)

{R : Type u}
{A : Type v}
{B : Type w}
{C : Type w'}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[Semiring C]
[Algebra R C]
(S : Subalgebra R A)
(g : B →ₐ[R] C)
(f : A →ₐ[R] B)

Subalgebra.map g (Subalgebra.map f S) = Subalgebra.map (g.comp f) S


/-- Functoriality of `yonedaCollectionPresheaf A F` in `F`. -/
@[simps]
def yonedaCollectionPresheafMap₁ {F G : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} (η : F ⟶ G) :
    yonedaCollectionPresheaf A F ⟶ yonedaCollectionPresheaf A G

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

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

∀ (a : CategoryTheory.OverPresheafAux.YonedaCollection F (Opposite.unop X)),
  (CategoryTheory.OverPresheafAux.yonedaCollectionPresheafMap₁ η).app X a =
    CategoryTheory.OverPresheafAux.YonedaCollection.map₁ η a


/-- An auxiliary lemma that combines two double exponential estimates into a similar estimate
on the difference of the functions. -/
theorem isBigO_sub_exp_exp {a : ℝ} {f g : ℂ → E} {l : Filter ℂ} {u : ℂ → ℝ}
    (hBf : ∃ c < a, ∃ B, f =O[l] fun z => expR (B * expR (c * |u z|)))
    (hBg : ∃ c < a, ∃ B, g =O[l] fun z => expR (B * expR (c * |u z|))) :
    ∃ c < a, ∃ B, (f - g) =O[l] fun z => expR (B * expR (c * |u z|))


theorem compProd_restrict_right {t : Set γ} (ht : MeasurableSet t) :
    κ ⊗ₖ Kernel.restrict η ht = Kernel.restrict (κ ⊗ₖ η) (MeasurableSet.univ.prod ht)

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

κ.compProd (η.restrict ht) = (κ.compProd η).restrict ⋯


/-- A subsemiring `S` includes `closure s` if and only if it includes `s`. -/
@[simp]
theorem closure_le {s : Set R} {t : Subsemiring R} : closure s ≤ t ↔ s ⊆ t

{R : Type u}
[NonAssocSemiring R]
{s : Set R}
{t : Subsemiring R}


theorem normSq_div (z w : ℂ) : normSq (z / w) = normSq z / normSq w

Complex.normSq (z / w) = Complex.normSq z / Complex.normSq w


/-- An `R`-submodule of `M` is principal if it is generated by one element. -/
@[mk_iff]
class IsPrincipal (S : Submodule R M) : Prop where
  principal' : ∃ a, S = span R {a}

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

S.IsPrincipal ↔ ∃ a, S = Submodule.span R {a}


@[simp] lemma sqrt_sq (x : ℝ≥0) : sqrt (x ^ 2) = x


@[simp]
theorem diag_diagonal [DecidableEq n] [Zero α] (a : n → α) : diag (diagonal a) = a

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
(a : n → α)


theorem two_nsmul_eq_zero
    (R) (M) [Semiring R] [CharZero R] [AddCommMonoid M] [Module R M] [NoZeroSMulDivisors R M]
    {v : M} : 2 • v = 0 ↔ v = 0

(R : Type u_9)
(M : Type u_10)
[Semiring R]
[CharZero R]
[AddCommMonoid M]
[Module R M]
[NoZeroSMulDivisors R M]
{v : M}


theorem left_cancel_inv (x : R) {y y' : R} : x ◃⁻¹ y = x ◃⁻¹ y' ↔ y = y'

{R : Type u_1}
[Rack R]
(x : R)
{y y' : R}


/-- A bijection between two sets `s : Set α` and `t : Set β` provides a partial equivalence
between `α` and `β`. -/
@[simps (config := .asFn)]
noncomputable def BijOn.toPartialEquiv [Nonempty α] (f : α → β) (s : Set α) (t : Set β)
    (hf : BijOn f s t) : PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
[Nonempty α]
(f : α → β)
(s : Set α)
(t : Set β)
(hf : Set.BijOn f s t)

(Set.BijOn.toPartialEquiv f s t hf).source = s