/-- The duality equivalence `WalkingCospanᵒᵖ ≌ WalkingSpan` -/
@[simps!]
def walkingCospanOpEquiv : WalkingCospanᵒᵖ ≌ WalkingSpan

{X Y : CategoryTheory.Limits.WidePushoutShape CategoryTheory.Limits.WalkingPair}

∀ (a : X ⟶ Y),
  CategoryTheory.Limits.walkingCospanOpEquiv.inverse.map a =
    CategoryTheory.Limits.widePushoutShapeOpMap CategoryTheory.Limits.WalkingPair X Y a


theorem mk_sum_compl {α} (s : Set α) : #s + #(sᶜ : Set α) = #α

Cardinal.mk ↑s + Cardinal.mk ↑sᶜ = Cardinal.mk α


@[to_additive]
lemma mul_not_mem_of_orderOf_eq_two {x y : G} (hx : orderOf x = 2)
    (hy : orderOf y = 2) (hxy : x ≠ y) : x * y ∉ ({x, y, 1} : Set G)

{G : Type u}
[Group G]
{x y : G}
(hx : orderOf x = 2)
(hy : orderOf y = 2)
(hxy : x ≠ y)


theorem isLocalRingHom_residue : IsLocalRingHom (LocalRing.residue R)

{R : Type u_1}
[CommRing R]
[LocalRing R]


lemma rank_eq_one_iff_finrank_eq_one : Module.rank R M = 1 ↔ finrank R M = 1

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]

Module.rank R M = 1 ↔ FiniteDimensional.finrank R M = 1


theorem chain'_split {a : α} :
    ∀ {l₁ l₂ : List α}, Chain' R (l₁ ++ a :: l₂) ↔ Chain' R (l₁ ++ [a]) ∧ Chain' R (a :: l₂)

{α : Type u}
{R : α → α → Prop}
{a : α}
{l₁ l₂ : List α}

List.Chain' R (l₁ ++ a :: l₂) ↔ List.Chain' R (l₁ ++ [a]) ∧ List.Chain' R (a :: l₂)


theorem add_mul_left_left {x y : R} (h : IsCoprime x y) (z : R) : IsCoprime (x + y * z) y

{R : Type u}
[CommRing R]
{x y : R}
(h : IsCoprime x y)
(z : R)


theorem continuousWithinAt_iff' [TopologicalSpace β] {f : β → α} {b : β} {s : Set β} :
    ContinuousWithinAt f s b ↔ ∀ ε > 0, ∀ᶠ x in 𝓝[s] b, dist (f x) (f b) < ε

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[TopologicalSpace β]
{f : β → α}
{b : β}
{s : Set β}

ContinuousWithinAt f s b ↔ ∀ ε > 0, ∀ᶠ (x : β) in 𝓝[s] b, dist (f x) (f b) < ε


/-- **Maximum modulus principle**: if `f : E → F` is complex differentiable in a neighborhood of `c`
and the norm `‖f z‖` has a local maximum at `c`, then `f` is locally constant in a neighborhood
of `c`. -/
theorem eventually_eq_of_isLocalMax_norm {f : E → F} {c : E}
    (hd : ∀ᶠ z in 𝓝 c, DifferentiableAt ℂ f z) (hc : IsLocalMax (norm ∘ f) c) :
    ∀ᶠ y in 𝓝 c, f y = f c

(hd : ∀ᶠ (z : E) in 𝓝 c, DifferentiableAt ℂ f z)


{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)


@[to_additive]
protected theorem Multipliable.mulIndicator (hf : Multipliable f) (s : Set β) :
    Multipliable (s.mulIndicator f)

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
{f : β → α}
[CompleteSpace α]
(hf : Summable f)
(s : Set β)


@[reassoc, simp]
theorem leftUnitor_inv_whiskerRight (X Y : C) :
    (λ_ X).inv ▷ Y = (λ_ (X ⊗ Y)).inv ≫ (α_ (𝟙_ C) X Y).inv

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

CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.leftUnitor X).inv Y =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.leftUnitor (CategoryTheory.MonoidalCategory.tensorObj X Y)).inv
    (CategoryTheory.MonoidalCategory.associator (𝟙_ C) X Y).inv


theorem linearIndependent_iUnion_of_directed {η : Type*} {s : η → Set M} (hs : Directed (· ⊆ ·) s)
    (h : ∀ i, LinearIndependent R (fun x => x : s i → M)) :
    LinearIndependent R (fun x => x : (⋃ i, s i) → M)

(hs : Directed (fun x x_1 => x ⊆ x_1) s)

(h : ∀ (i : η), LinearIndependent R fun (x : ↑(s i)) => ↑x)

LinearIndependent R fun (x : ↑(⋃ i, s i)) => ↑x


theorem card_le_card_biUnion {s : Finset ι} {f : ι → Finset α} (hs : (s : Set ι).PairwiseDisjoint f)
    (hf : ∀ i ∈ s, (f i).Nonempty) : s.card ≤ (s.biUnion f).card

{ι : Type u_1}
{α : Type u_2}
[DecidableEq α]
{s : Finset ι}
{f : ι → Finset α}
(hs : (↑s).PairwiseDisjoint f)
(hf : ∀ i ∈ s, (f i).Nonempty)


theorem not_of_mem_foldl_argAux (hr₀ : Irreflexive r) (hr₁ : Transitive r) :
    ∀ {a m : α} {o : Option α}, a ∈ l → m ∈ foldl (argAux r) o l → ¬r a m

{α : Type u_1}
(r : α → α → Prop)
[DecidableRel r]
{l : List α}
(hr₀ : Irreflexive r)
(hr₁ : Transitive r)
{a m : α}
{o : Option α}

a ∈ l → m ∈ List.foldl (List.argAux r) o l → ¬r a m


theorem ofCauchy_mul (a b) : (⟨a * b⟩ : ℝ) = ⟨a⟩ * ⟨b⟩

{ cauchy := a * b } = { cauchy := a } * { cauchy := b }


theorem mem_annihilator_span_singleton (g : M) (r : R) :
    r ∈ (Submodule.span R ({g} : Set M)).annihilator ↔ r • g = 0

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(g : M)
(r : R)

r ∈ (Submodule.span R {g}).annihilator ↔ r • g = 0


@[to_additive]
lemma prod_preimage (f : ι → κ) (s : Finset κ) (hf) (g : κ → β)
    (hg : ∀ x ∈ s, x ∉ Set.range f → g x = 1) :
    ∏ x ∈ s.preimage f hf, g (f x) = ∏ x ∈ s, g x


theorem embDomain_injective {f : Γ ↪o Γ'} :
    Function.Injective (embDomain f : HahnSeries Γ R → HahnSeries Γ' R)

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{Γ' : Type u_3}
[PartialOrder Γ']
{f : Γ ↪o Γ'}


theorem quot_eq_of_mk'_quot_eq {x y : PGame} (L : x.LeftMoves ≃ y.LeftMoves)
    (R : x.RightMoves ≃ y.RightMoves) (hl : ∀ i, (⟦x.moveLeft i⟧ : Game) = ⟦y.moveLeft (L i)⟧)
    (hr : ∀ j, (⟦x.moveRight j⟧ : Game) = ⟦y.moveRight (R j)⟧) : (⟦x⟧ : Game) = ⟦y⟧

(hl : ∀ (i : x.LeftMoves), ⟦x.moveLeft i⟧ = ⟦y.moveLeft (L i)⟧)

(hr : ∀ (j : x.RightMoves), ⟦x.moveRight j⟧ = ⟦y.moveRight (R j)⟧)


@[simp] lemma birkhoffFinset_inf (a b : α) :
    birkhoffFinset (a ⊓ b) = birkhoffFinset a ∩ birkhoffFinset b

{α : Type u_1}
[DistribLattice α]
[Fintype α]
[DecidablePred SupIrred]
[DecidableEq α]
(a b : α)

OrderEmbedding.birkhoffFinset (a ⊓ b) = OrderEmbedding.birkhoffFinset a ∩ OrderEmbedding.birkhoffFinset b


/-- If the sign of the angle between two vectors is nonzero, the second vector is nonzero. -/
theorem right_ne_zero_of_oangle_sign_ne_zero {x y : V} (h : (o.oangle x y).sign ≠ 0) : y ≠ 0

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


lemma indicator_eq_sum_single [AddCommMonoid M] (s : Finset α) (f : α → M) :
    indicator s (fun x _ ↦ f x) = ∑ x ∈ s, single x (f x)

{α : Type u_1}
{M : Type u_8}
[AddCommMonoid M]
(s : Finset α)
(f : α → M)

(Finsupp.indicator s fun x x_1 => f x) = ∑ x ∈ s, Finsupp.single x (f x)


/-- If `p` is a maximal ideal of `R`, `S` extends `R` and `P^e` lies over `p`,
then the dimension `[S/(P^e) : R/p]`, as a natural number, is equal to `e * [S/P : R/p]`. -/
theorem finrank_prime_pow_ramificationIdx [IsDedekindDomain S] (hP0 : P ≠ ⊥)
    [p.IsMaximal] [P.IsPrime] (he : e ≠ 0) :
    finrank (R ⧸ p) (S ⧸ P ^ e) =
      e *
        @finrank (R ⧸ p) (S ⧸ P) _ _
          (@Algebra.toModule _ _ _ _ <|
            @Quotient.algebraQuotientOfRamificationIdxNeZero _ _ _ _ _ _ _ ⟨he⟩)

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
(f : R →+* S)
(p : Ideal R)
(P : Ideal S)
[IsDedekindDomain S]
(hP0 : P ≠ ⊥)
[p.IsMaximal]
[P.IsPrime]
(he : Ideal.ramificationIdx f p P ≠ 0)

FiniteDimensional.finrank (R ⧸ p) (S ⧸ P ^ Ideal.ramificationIdx f p P) =
  Ideal.ramificationIdx f p P * FiniteDimensional.finrank (R ⧸ p) (S ⧸ P)


/-- The Weierstrass curve mapped over a ring homomorphism `φ : R →+* A`. -/
@[simps]
def map : WeierstrassCurve A

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


@[simp]
theorem map_id (S : PointedCone 𝕜 E) : S.map LinearMap.id = S

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


/-- The constant map is multilinear when `ι` is empty. -/
-- Porting note: Removed [simps] & added simpNF-approved version of the generated lemma manually.
@[simps (config := .asFn)]
def constOfIsEmpty [IsEmpty ι] (m : M₂) : MultilinearMap R M₁ M₂

(R : Type uR)
{ι : Type uι}
(M₁ : ι → Type v₁)
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[IsEmpty ι]
(m : M₂)

⇑(MultilinearMap.constOfIsEmpty R M₁ m) = Function.const ((i : ι) → M₁ i) m


theorem irreducible_of_monic (hp : p.Monic) (hp1 : p ≠ 1) :
    Irreducible p ↔ ∀ f g : R[X], f.Monic → g.Monic → f * g = p → f = 1 ∨ g = 1

{R : Type u}
[CommSemiring R]
[NoZeroDivisors R]
{p : R[X]}
(hp : p.Monic)
(hp1 : p ≠ 1)

Irreducible p ↔ ∀ (f g : R[X]), f.Monic → g.Monic → f * g = p → f = 1 ∨ g = 1


@[norm_cast] lemma cast_div_of_ne_zero (hp : (p.den : α) ≠ 0) (hq : (q.num : α) ≠ 0) :
    ↑(p / q) = (p / q : α)

{α : Type u_3}
[DivisionRing α]
{p q : ℚ}
(hp : ↑p.den ≠ 0)
(hq : ↑q.num ≠ 0)


@[simp, norm_cast] theorem one_eq_coe : 1 = (↑r : ℝ≥0∞) ↔ 1 = r


@[simp] theorem zipWith_cons_cons {f : α → β → γ} :
    zipWith f (a :: as) (b :: bs) = f a b :: zipWith f as bs

{α : Type u}
{β : Type v}
{γ : Type w}
{a : α}
{as : List α}
{b : β}
{bs : List β}
{f : α → β → γ}

List.zipWith f (a :: as) (b :: bs) = f a b :: List.zipWith f as bs


@[simp]
theorem lt_iff_lex_lt (l m : Products I) : l < m ↔ List.Lex (·<·) l.val m.val

(l m : Profinite.NobelingProof.Products I)

l < m ↔ List.Lex (fun x x_1 => x < x_1) ↑l ↑m


@[simp, rclike_simps] -- Porting note: removed `norm_cast`
theorem intCast_re (n : ℤ) : re (n : K) = n


theorem exi_rat_seq_conv {ε : ℚ} (hε : 0 < ε) :
    ∃ N, ∀ i ≥ N, padicNormE (f i - (limSeq f i : ℚ_[p]) : ℚ_[p]) < ε

{p : ℕ}
[Fact (Nat.Prime p)]
(f : CauSeq ℚ_[p] ⇑padicNormE)
{ε : ℚ}
(hε : 0 < ε)

∃ N, ∀ i ≥ N, padicNormE (↑f i - ↑(Padic.limSeq f i)) < ε


/-- If G and H are naturally isomorphic functors, establish an equivalence of hom-sets. -/
@[simps]
def equivHomsetRightOfNatIso {G G' : D ⥤ C} (iso : G ≅ G') {X : C} {Y : D} :
    (X ⟶ G.obj Y) ≃ (X ⟶ G'.obj Y)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{G G' : CategoryTheory.Functor D C}
(iso : G ≅ G')
{X : C}
{Y : D}
(f : X ⟶ G.obj Y)

(CategoryTheory.Adjunction.equivHomsetRightOfNatIso iso) f = CategoryTheory.CategoryStruct.comp f (iso.hom.app Y)


@[simp] lemma generate_singleton (s : Set α) : generate {s} = 𝓟 s


@[simp]
theorem mem_torsionOf_iff (x : M) (a : R) : a ∈ torsionOf R M x ↔ a • x = 0

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(x : M)
(a : R)


theorem jacobiSymNat.mod_left (a b ab : ℕ) (r : ℤ) (hab : a % b = ab) (hr : jacobiSymNat ab b = r) :
    jacobiSymNat a b = r

(hr : Mathlib.Meta.NormNum.jacobiSymNat ab b = r)

Mathlib.Meta.NormNum.jacobiSymNat a b = r


theorem _root_.Polynomial.toLaurent_C_mul_X_pow (n : ℕ) (r : R) :
    toLaurent (Polynomial.C r * X ^ n) = C r * T n

{R : Type u_1}
[Semiring R]
(n : ℕ)
(r : R)

Polynomial.toLaurent (Polynomial.C r * Polynomial.X ^ n) = LaurentPolynomial.C r * LaurentPolynomial.T ↑n


theorem setToSimpleFunc_add (T : Set α → E →L[ℝ] F) (h_add : FinMeasAdditive μ T) {f g : α →ₛ E}
    (hf : Integrable f μ) (hg : Integrable g μ) :
    setToSimpleFunc T (f + g) = setToSimpleFunc T f + setToSimpleFunc T g

(h_add : MeasureTheory.FinMeasAdditive μ T)

MeasureTheory.SimpleFunc.setToSimpleFunc T (f + g) =
  MeasureTheory.SimpleFunc.setToSimpleFunc T f + MeasureTheory.SimpleFunc.setToSimpleFunc T g


theorem weight_apply (f : σ →₀ ℕ) :
    weight w f = Finsupp.sum f (fun i c => c • w i)

{σ : Type u_1}
{M : Type u_2}
(w : σ → M)
[AddCommMonoid M]
(f : σ →₀ ℕ)

(Finsupp.weight w) f = f.sum fun i c => c • w i


/-- The invariants of the representation `linHom X.ρ Y.ρ` correspond to the representation
homomorphisms from `X` to `Y`. -/
@[simps]
def invariantsEquivRepHom (X Y : Rep k G) : (linHom X.ρ Y.ρ).invariants ≃ₗ[k] X ⟶ Y

{k : Type u}
[CommRing k]
{G : Grp}
(X Y : Rep k ↑G)
(f : ↥(X.ρ.linHom Y.ρ).invariants)

((Representation.linHom.invariantsEquivRepHom X Y) f).hom = ↑f


/-- If one controls the norm of every `A x`, then one controls the norm of `A`. -/
theorem seminormAux_le_bound (k n : ℕ) (f : 𝓢(E, F)) {M : ℝ} (hMp : 0 ≤ M)
    (hM : ∀ x, ‖x‖ ^ k * ‖iteratedFDeriv ℝ n f x‖ ≤ M) : f.seminormAux k n ≤ M

(hM : ∀ (x : E), ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (⇑f) x‖ ≤ M)


theorem mk (h : ∀ ⦃s : Set α⦄, MeasurableSet s → w s = 0 → v s = 0) : v ≪ᵥ w

(h : ∀ ⦃s : Set α⦄, MeasurableSet s → ↑w s = 0 → ↑v s = 0)


@[simp, nolint simpNF] -- Porting note: linter claims that LHS does not simplify
theorem sup_attach (s : Finset β) (f : β → α) : (s.attach.sup fun x => f x) = s.sup f

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
(s : Finset β)
(f : β → α)


theorem le_sqrt' (hx : 0 < x) : x ≤ √y ↔ x ^ 2 ≤ y


@[to_additive (attr := simp)]
theorem lift_comp_inr (f : M →* P) (g : N →* P) : (lift f g).comp inr = g

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

(AddMonoid.Coprod.lift f g).comp AddMonoid.Coprod.inr = g


/-- Given `c : PullbackCone f g` in the category of types, this is
the canonical map `c.pt → Types.PullbackObj f g`. -/
@[simps coe_fst coe_snd]
def toPullbackObj (x : c.pt) : Types.PullbackObj f g

(c : CategoryTheory.Limits.PullbackCone f g)


theorem coe_injective : @Function.Injective (M ≃[L] N) (M → N) (↑)

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


theorem digits_getLast {b : ℕ} (m : ℕ) (h : 1 < b) (p q) :
    (digits b m).getLast p = (digits b (m / b)).getLast q

{b : ℕ}
(m : ℕ)
(h : 1 < b)
(p : b.digits m ≠ [])
(q : b.digits (m / b) ≠ [])

(b.digits m).getLast p = (b.digits (m / b)).getLast q


theorem indiscrete_isEquipartition {hs : s ≠ ∅} : (indiscrete hs).IsEquipartition

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


@[simp]
theorem cos_pi_div_eight : cos (π / 8) = √(2 + √2) / 2


@[simp]
theorem reverse_eq_id : (reverse : CliffordAlgebra Q →ₗ[ℝ] _) = LinearMap.id


theorem lineMap_mono_left (ha : a ≤ a') (hr : r ≤ 1) : lineMap a b r ≤ lineMap a' b r

{k : Type u_1}
{E : Type u_2}
[OrderedRing k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{a a' b : E}
{r : k}
(ha : a ≤ a')
(hr : r ≤ 1)

(AffineMap.lineMap a b) r ≤ (AffineMap.lineMap a' b) r


theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x

{F : Type u → Type u}
[q : QPF F]
(x y : (QPF.P F).W)


protected theorem add_comm : ∀ a b : Int, a + b = b + a


theorem disjoint_product : Disjoint (s ×ˢ t) (s' ×ˢ t') ↔ Disjoint s s' ∨ Disjoint t t'

{α : Type u_1}
{β : Type u_2}
{s s' : Finset α}
{t t' : Finset β}


theorem eq_Ici_of_nonempty_of_upward_closed {s : Set ℕ} (hs : s.Nonempty)
    (hs' : ∀ k₁ k₂ : ℕ, k₁ ≤ k₂ → k₁ ∈ s → k₂ ∈ s) : s = Ici (sInf s)

(hs' : ∀ (k₁ k₂ : ℕ), k₁ ≤ k₂ → k₁ ∈ s → k₂ ∈ s)


/-- If `φ : a ⟶ b` lifts `f : R ⟶ S` and `φ` is an isomorphism, then so is `f`. -/
lemma isIso_of_lift_isIso (f : R ⟶ S) (φ : a ⟶ b) [p.IsHomLift f φ] [IsIso φ] : IsIso f

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₂} 𝒳]
[CategoryTheory.Category.{v₂, u₁} 𝒮]
(p : 𝒳 ⥤ 𝒮)
{R S : 𝒮}
{a b : 𝒳}
(f : R ⟶ S)
(φ : a ⟶ b)
[p.IsHomLift f φ]
[CategoryTheory.IsIso φ]


lemma coe_restrictScalars (f : A →ₙₐ[S] B) : (f.restrictScalars R : A →ₙ+* B) = f

(R : Type u_1)
{S : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Monoid R]
[Monoid S]
[NonUnitalNonAssocSemiring A]
[NonUnitalNonAssocSemiring B]
[MulAction R S]
[DistribMulAction S A]
[DistribMulAction S B]
[DistribMulAction R A]
[DistribMulAction R B]
[IsScalarTower R S A]
[IsScalarTower R S B]
(f : A →ₙₐ[S] B)

↑(NonUnitalAlgHom.restrictScalars R f) = ↑f


theorem mdifferentiableOn_atlas (h : e ∈ atlas H M) : MDifferentiableOn I I e e.source

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{e : PartialHomeomorph M H}
(h : e ∈ atlas H M)


theorem chain'_of_chain'_map {S : β → β → Prop} (f : α → β) (H : ∀ a b : α, S (f a) (f b) → R a b)
    {l : List α} (p : Chain' S (map f l)) : Chain' R l

(H : ∀ (a b : α), S (f a) (f b) → R a b)


theorem exists_eq_mul_div_num_and_eq_mul_div_den (n : ℤ) {d : ℤ} (d_ne_zero : d ≠ 0) :
    ∃ c : ℤ, n = c * ((n : ℚ) / d).num ∧ (d : ℤ) = c * ((n : ℚ) / d).den

∃ c, n = c * (↑n / ↑d).num ∧ d = c * ↑(↑n / ↑d).den


/-- The equivalence between the opposite of a product and the product of the opposites. -/
@[simps]
def prodOpEquiv : (C × D)ᵒᵖ ≌ Cᵒᵖ × Dᵒᵖ

(C : Type u₃)
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]

(CategoryTheory.prodOpEquiv C).counitIso =
  CategoryTheory.Iso.refl
    ({
          obj := fun x =>
            match x with
            | (X, Y) => Opposite.op (Opposite.unop X, Opposite.unop Y),
          map := fun {X Y} x =>
            match x with
            | (f, g) => Opposite.op (f.unop, g.unop),
          map_id := ⋯, map_comp := ⋯ }.comp
      { obj := fun X => (Opposite.op (Opposite.unop X).1, Opposite.op (Opposite.unop X).2),
        map := fun {X Y} f => (f.unop.1.op, f.unop.2.op), map_id := ⋯, map_comp := ⋯ })


theorem HasFiniteIntegral.const_mul [NormedRing 𝕜] {f : α → 𝕜} (h : HasFiniteIntegral f μ) (c : 𝕜) :
    HasFiniteIntegral (fun x => c * f x) μ

(h : MeasureTheory.HasFiniteIntegral f μ)

MeasureTheory.HasFiniteIntegral (fun x => c * f x) μ


@[simp]
theorem coe_mkOfDistEq {α β} [PseudoMetricSpace α] [PseudoMetricSpace β] (f : α → β) (h) :
    ⇑(mkOfDistEq f h : α →ᵈ β) = f

(h : ∃ r, r ≠ 0 ∧ ∀ (x y : α), dist (f x) (f y) = ↑r * dist x y)


@[simp] theorem update_erase_eq_update (f : α →₀ M) (a : α) (b : M) :
    update (erase a f) a b = update f a b

{α : Type u_1}
{M : Type u_5}
[Zero M]
(f : α →₀ M)
(a : α)
(b : M)

(Finsupp.erase a f).update a b = f.update a b


@[reassoc (attr := simp)]
lemma EffectiveEpiFamily.fac {B W : C} {α : Type*} (X : α → C) (π : (a : α) → (X a ⟶ B))
    [EffectiveEpiFamily X π] (e : (a : α) → (X a ⟶ W))
    (h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂),
      g₁ ≫ π _ = g₂ ≫ π _ → g₁ ≫ e _ = g₂ ≫ e _) (a : α) :
    π a ≫ EffectiveEpiFamily.desc X π e h = e a

(h :
  ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂),
    CategoryTheory.CategoryStruct.comp g₁ (π a₁) = CategoryTheory.CategoryStruct.comp g₂ (π a₂) →
      CategoryTheory.CategoryStruct.comp g₁ (e a₁) = CategoryTheory.CategoryStruct.comp g₂ (e a₂))

CategoryTheory.CategoryStruct.comp (π a) (CategoryTheory.EffectiveEpiFamily.desc X π e ⋯) = e a


/-- The length of the `i`th row in `ofRowLens w hw` is the `i`th entry of `w` -/
theorem rowLen_ofRowLens {w : List ℕ} {hw : w.Sorted (· ≥ ·)} (i : Fin w.length) :
    (ofRowLens w hw).rowLen i = w.get i

{hw : List.Sorted (fun x x_1 => x ≥ x_1) w}

(YoungDiagram.ofRowLens w hw).rowLen ↑i = w.get i


/-- Convex hull of a finite set is closed. -/
theorem Set.Finite.isClosed_convexHull [T2Space E] {s : Set E} (hs : s.Finite) :
    IsClosed (convexHull ℝ s)

{E : Type u_3}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
[T2Space E]
{s : Set E}
(hs : s.Finite)


/--
The category of subterminal objects is equivalent to the category of monomorphisms to the terminal
object (which is in turn equivalent to the subobjects of the terminal object).
-/
@[simps]
def subterminalsEquivMonoOverTerminal [HasTerminal C] : Subterminals C ≌ MonoOver (⊤_ C)

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

((CategoryTheory.subterminalsEquivMonoOverTerminal C).functor.obj X).obj =
  CategoryTheory.Over.mk (CategoryTheory.Limits.terminal.from X.obj)


@[to_additive existing (attr := simp)]
lemma equivShrink_inv [Inv α] [Small α] (x : α) :
    equivShrink α x⁻¹ = (equivShrink α x)⁻¹

{α : Type u_1}
[Inv α]
[Small.{u_2, u_1} α]
(x : α)

(equivShrink α) x⁻¹ = ((equivShrink α) x)⁻¹


@[simp]
theorem card_Ioo : (Ioo a b).card = b - a - 1


@[to_additive]
theorem multipliable_prod {f : γ → β → α} {s : Finset γ} (hf : ∀ i ∈ s, Multipliable (f i)) :
    Multipliable fun b ↦ ∏ i ∈ s, f i b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
[ContinuousMul α]
{f : γ → β → α}
{s : Finset γ}
(hf : ∀ i ∈ s, Multipliable (f i))


/-- A mixin typeclass saying that `(c • ·)` is a proper map for all `c`.

Note that this is **not** the same as a proper multiplicative action (not yet in `Mathlib`). -/
@[to_additive]
class ProperConstSMul (M X : Type*) [SMul M X] [TopologicalSpace X] : Prop where
  /-- `(c • ·)` is a proper map. -/
  isProperMap_smul (c : M) : IsProperMap ((c • ·) : X → X)

{M : Type u_1}
{X : Type u_2}
[SMul M X]
[TopologicalSpace X]
[self : ProperConstSMul M X]
(c : M)


theorem coe_pow (f : A →A[R] A) (n : ℕ) : ⇑(f ^ n) = f^[n]

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
[Algebra R A]
(f : A →A[R] A)
(n : ℕ)


@[simp]
theorem involute_mem_evenOdd_iff {x : CliffordAlgebra Q} {n : ZMod 2} :
    involute x ∈ evenOdd Q n ↔ x ∈ evenOdd Q n

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
{x : CliffordAlgebra Q}
{n : ZMod 2}

CliffordAlgebra.involute x ∈ CliffordAlgebra.evenOdd Q n ↔ x ∈ CliffordAlgebra.evenOdd Q n


theorem le_mk_diff_add_mk (S T : Set α) : #S ≤ #(S \ T : Set α) + #T

Cardinal.mk ↑S ≤ Cardinal.mk ↑(S \ T) + Cardinal.mk ↑T


theorem contDiff_of_differentiable_iteratedFDeriv
    (h : ∀ m : ℕ, (m : ℕ∞) ≤ n → Differentiable 𝕜 (iteratedFDeriv 𝕜 m f)) : ContDiff 𝕜 n f

(h : ∀ (m : ℕ), ↑m ≤ n → Differentiable 𝕜 (iteratedFDeriv 𝕜 m f))


theorem pullback.diagonal_comp (f : X ⟶ Y) (g : Y ⟶ Z) [HasPullback f f] [HasPullback g g]
    [HasPullback (f ≫ g) (f ≫ g)] :
    diagonal (f ≫ g) = diagonal f ≫ (pullbackDiagonalMapIdIso f f g).inv ≫ pullback.snd _ _

[CategoryTheory.Limits.HasPullback (f ≫ g) (f ≫ g)]

CategoryTheory.Limits.pullback.diagonal (f ≫ g) =
  CategoryTheory.Limits.pullback.diagonal f ≫
    (CategoryTheory.Limits.pullbackDiagonalMapIdIso f f g).inv ≫
      CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.diagonal g)
        (CategoryTheory.Limits.pullback.map (f ≫ g) (f ≫ g) g g f f (𝟙 Z) ⋯ ⋯)


theorem IsMaxFilter.sub (hf : IsMaxFilter f l a) (hg : IsMinFilter g l a) :
    IsMaxFilter (fun x => f x - g x) l a

{α : Type u}
{β : Type v}
[OrderedAddCommGroup β]
{f g : α → β}
{a : α}
{l : Filter α}
(hf : IsMaxFilter f l a)
(hg : IsMinFilter g l a)


protected theorem sub_lt_self (ha : a ≠ ∞) (ha₀ : a ≠ 0) (hb : b ≠ 0) : a - b < a

{a b : ℝ≥0∞}
(ha : a ≠ ⊤)
(ha₀ : a ≠ 0)
(hb : b ≠ 0)


lemma Cotangent.smul_eq_zero_of_mem (p : P.Ring) (hp : p ∈ P.ker) (m : P.ker.Cotangent) :
    p • m = 0

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
(p : P.Ring)
(hp : p ∈ P.ker)
(m : P.ker.Cotangent)


theorem map_fract {R : Type*} [LinearOrderedRing R] [FloorRing R] [AddGroup H]
    [FunLike F R H] [AddConstMapClass F R H 1 b] (f : F) (x : R) :
    f (Int.fract x) = f x - ⌊x⌋ • b

{F : Type u_1}
{H : Type u_3}
{b : H}
{R : Type u_4}
[LinearOrderedRing R]
[FloorRing R]
[AddGroup H]
[FunLike F R H]
[AddConstMapClass F R H 1 b]
(f : F)
(x : R)


/-- Converse to the mean value inequality: if `f` is differentiable at `x₀` and `C`-lipschitz
on a neighborhood of `x₀` then its derivative at `x₀` has norm bounded by `C`. This version
only assumes that `‖f x - f x₀‖ ≤ C * ‖x - x₀‖` in a neighborhood of `x`. -/
theorem HasDerivAt.le_of_lip' {f : 𝕜 → F} {f' : F} {x₀ : 𝕜} (hf : HasDerivAt f f' x₀)
    {C : ℝ} (hC₀ : 0 ≤ C) (hlip : ∀ᶠ x in 𝓝 x₀, ‖f x - f x₀‖ ≤ C * ‖x - x₀‖) :
    ‖f'‖ ≤ C

(hlip : ∀ᶠ (x : 𝕜) in 𝓝 x₀, ‖f x - f x₀‖ ≤ C * ‖x - x₀‖)


@[to_additive (attr := simp)]
lemma symm_mk_inv [Inv M] (a : Mᵈᵐᵃ) : mk.symm (a⁻¹) = (mk.symm a)⁻¹

DomAddAct.mk.symm (-a) = -DomAddAct.mk.symm a


theorem lcm_eq_normalize [NormalizedGCDMonoid α] {a b c : α} (habc : lcm a b ∣ c)
    (hcab : c ∣ lcm a b) : lcm a b = normalize c

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{a b c : α}
(habc : lcm a b ∣ c)
(hcab : c ∣ lcm a b)


lemma Ψ₂Sq_eq : W.Ψ₂Sq = W.twoTorsionPolynomial.toPoly

{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)


@[simp]
theorem degree_mul_X_pow : degree (p * X ^ n) = degree p + n

{R : Type u}
[Semiring R]
[Nontrivial R]
{p : R[X]}
(n : ℕ)

(p * Polynomial.X ^ n).degree = p.degree + ↑n


/-- If a function `f` is continuous and `f'` is strictly monotone on `ℝ` then `f` is strictly
convex. Note that we don't require differentiability, since it is guaranteed at all but at most
one point by the strict monotonicity of `f'`. -/
theorem StrictMono.strictConvexOn_univ_of_deriv {f : ℝ → ℝ} (hf : Continuous f)
    (hf'_mono : StrictMono (deriv f)) : StrictConvexOn ℝ univ f


theorem Predictable.adapted {f : Filtration ℕ m} {u : ℕ → Ω → β} (hu : Adapted f fun n => u (n + 1))
    (hu0 : StronglyMeasurable[f 0] (u 0)) : Adapted f u

{u : ℕ → Ω → β}

(hu : MeasureTheory.Adapted f fun n => u (n + 1))

(hu0 : MeasureTheory.StronglyMeasurable (u 0))


theorem sumAddHom_comm {ι₁ ι₂ : Sort _} {β₁ : ι₁ → Type*} {β₂ : ι₂ → Type*} {γ : Type*}
    [DecidableEq ι₁] [DecidableEq ι₂] [∀ i, AddZeroClass (β₁ i)] [∀ i, AddZeroClass (β₂ i)]
    [AddCommMonoid γ] (f₁ : Π₀ i, β₁ i) (f₂ : Π₀ i, β₂ i) (h : ∀ i j, β₁ i →+ β₂ j →+ γ) :
    sumAddHom (fun i₂ => sumAddHom (fun i₁ => h i₁ i₂) f₁) f₂ =
      sumAddHom (fun i₁ => sumAddHom (fun i₂ => (h i₁ i₂).flip) f₂) f₁

(h : (i : ι₁) → (j : ι₂) → β₁ i →+ β₂ j →+ γ)

(DFinsupp.sumAddHom fun i₂ => (DFinsupp.sumAddHom fun i₁ => h i₁ i₂) f₁) f₂ =
  (DFinsupp.sumAddHom fun i₁ => (DFinsupp.sumAddHom fun i₂ => (h i₁ i₂).flip) f₂) f₁


/-- The non negative norm seen as an `ENNReal` and then as a `Real` is equal to the norm. -/
@[to_additive toReal_coe_nnnorm "The non negative norm seen as an `ENNReal` and
then as a `Real` is equal to the norm."]
theorem toReal_coe_nnnorm' (a : E) : (‖a‖₊ : ℝ≥0∞).toReal = ‖a‖

{E : Type u_6}
[SeminormedGroup E]
(a : E)


@[simp] theorem emod_one (a : Int) : a % 1 = 0


lemma equiv_smallHomMap (G : D₁ ⥤ D₂) (e : Φ.functor ⋙ L₂ ≅ L₁ ⋙ G)
    (f : SmallHom.{w} W₁ X Y) :
    (SmallHom.equiv W₂ L₂) (Φ.smallHomMap f) =
      e.hom.app X ≫ G.map (SmallHom.equiv W₁ L₁ f) ≫ e.inv.app Y

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

[CategoryTheory.Localization.HasSmallLocalizedHom W₁ X Y]

[CategoryTheory.Localization.HasSmallLocalizedHom W₂ (Φ.functor.obj X) (Φ.functor.obj Y)]

(f : CategoryTheory.Localization.SmallHom W₁ X Y)

(CategoryTheory.Localization.SmallHom.equiv W₂ L₂) (Φ.smallHomMap f) =
  CategoryTheory.CategoryStruct.comp (e.hom.app X)
    (CategoryTheory.CategoryStruct.comp (G.map ((CategoryTheory.Localization.SmallHom.equiv W₁ L₁) f)) (e.inv.app Y))


@[simp]
lemma lift'_nhdsSet_interior (s : Set X) : (𝓝ˢ s).lift' interior = 𝓝ˢ s

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


@[simp] theorem atEnd_iff (s : String) (p : Pos) : atEnd s p ↔ s.endPos ≤ p


/-- Shortcut version for the commonly arising special case when `p i = π * q i` for some other
sequence `q`. -/
lemma hasSum_mellin_pi_mul {a : ι → ℂ} {q : ι → ℝ} {F : ℝ → ℂ} {s : ℂ}
    (hq : ∀ i, a i = 0 ∨ 0 < q i) (hs : 0 < s.re)
    (hF : ∀ t ∈ Ioi 0, HasSum (fun i ↦ a i * rexp (-π * q i * t)) (F t))
    (h_sum : Summable fun i ↦ ‖a i‖ / (q i) ^ s.re) :
    HasSum (fun i ↦ π ^ (-s) * Gamma s * a i / q i ^ s) (mellin F s)

(hF : ∀ t ∈ Set.Ioi 0, HasSum (fun i => a i * ↑(rexp (-π * q i * t))) (F t))

(h_sum : Summable fun i => ‖a i‖ / q i ^ s.re)

HasSum (fun i => ↑π ^ (-s) * Complex.Gamma s * a i / ↑(q i) ^ s) (mellin F s)


/-- If there exists a sequence of compact closed balls with the same center
such that the radii tend to infinity, then the space is proper. -/
theorem ProperSpace.of_seq_closedBall {β : Type*} {l : Filter β} [NeBot l] {x : α} {r : β → ℝ}
    (hr : Tendsto r l atTop) (hc : ∀ᶠ i in l, IsCompact (closedBall x (r i))) :
    ProperSpace α

(hc : ∀ᶠ (i : β) in l, IsCompact (Metric.closedBall x (r i)))


/-- Heine-Cantor: a continuous function on a compact set of a uniform space is uniformly
continuous. -/
theorem IsCompact.uniformContinuousOn_of_continuous {s : Set α} {f : α → β} (hs : IsCompact s)
    (hf : ContinuousOn f s) : UniformContinuousOn f s

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[UniformSpace β]
{s : Set α}
{f : α → β}
(hs : IsCompact s)
(hf : ContinuousOn f s)


theorem monotone_sym2 : Monotone (Multiset.sym2 : Multiset α → _)


@[to_additive (attr := simp)] lemma mulEnergy_empty_right : Eₘ[s, ∅] = 0

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


theorem filterMap_map (f : α → β) (g : β → Option γ) (s : Multiset α) :
    filterMap g (map f s) = filterMap (g ∘ f) s

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

Multiset.filterMap g (Multiset.map f s) = Multiset.filterMap (g ∘ f) s


theorem transEquiv_eq_trans (e : PartialEquiv α β) (e' : β ≃ γ) :
    e.transEquiv e' = e.trans e'.toPartialEquiv

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : PartialEquiv α β)
(e' : β ≃ γ)


theorem induced_of_isLimit {F : J ⥤ TopCat.{max v u}} (C : Cone F) (hC : IsLimit C) :
    C.pt.str = ⨅ j, (F.obj j).str.induced (C.π.app j)

{J : Type v}
[CategoryTheory.SmallCategory J]
{F : J ⥤ TopCat}
(C : CategoryTheory.Limits.Cone F)
(hC : CategoryTheory.Limits.IsLimit C)

C.pt.str = ⨅ j, TopologicalSpace.induced (⇑(C.π.app j)) (F.obj j).str


theorem map_left_cancel {x y} {c : M} (h : algebraMap R S (x * c) = algebraMap R S (y * c)) :
    algebraMap R S x = algebraMap R S y

(h : (algebraMap R S) (x * ↑c) = (algebraMap R S) (y * ↑c))


theorem IsMatching.toEdge.surjective (h : M.IsMatching) : Surjective h.toEdge

{V : Type u_1}
{G : SimpleGraph V}
{M : G.Subgraph}
(h : M.IsMatching)


theorem HasMFDerivWithinAt.hasMFDerivAt (h : HasMFDerivWithinAt I I' f s x f') (hs : s ∈ 𝓝 x) :
    HasMFDerivAt I I' f x f'

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


/--
An `InjectiveResolution Z` consists of a bundled `ℕ`-indexed cochain complex of injective objects,
along with a quasi-isomorphism from the complex consisting of just `Z` supported in degree `0`.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure InjectiveResolution (Z : C) where
  /-- the cochain complex involved in the resolution -/
  cocomplex : CochainComplex C ℕ
  /-- the cochain complex must be degreewise injective -/
  injective : ∀ n, Injective (cocomplex.X n) := by infer_instance
  /-- the cochain complex must have homology -/
  [hasHomology : ∀ i, cocomplex.HasHomology i]
  /-- the morphism from the single cochain complex with `Z` in degree `0` -/
  ι : (single₀ C).obj Z ⟶ cocomplex
  /-- the morphism from the single cochain complex with `Z` in degree `0` is a quasi-isomorphism -/
  quasiIso : QuasiIso ι := by infer_instance

(self : CategoryTheory.InjectiveResolution Z)


protected theorem Set.OrdConnected.restrict (hs : s.OrdConnected) :
    {x | restrict t (· ∈ s) x}.OrdConnected

{α : Type u_1}
[LinearOrder α]
{s t : Set α}
(hs : s.OrdConnected)

{x | t.restrict (fun x => x ∈ s) x}.OrdConnected


/-- If `d` is positive and not a square, then a fundamental solution exists. -/
theorem exists_of_not_isSquare (h₀ : 0 < d) (hd : ¬IsSquare d) :
    ∃ a : Solution₁ d, IsFundamental a


theorem LocalRing.maximalIdeal_eq_bot {R : Type*} [Field R] : LocalRing.maximalIdeal R = ⊥


@[simp] lemma coe_mapIic_apply [Semiring R] [AddCommMonoid M] [Module R M]
    (p : Submodule R M) (q : Submodule R p) :
    (p.mapIic q : Submodule R M) = q.map p.subtype

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

↑(p.mapIic q) = Submodule.map p.subtype q


theorem modEq_eleven_digits_sum (n : ℕ) :
    n ≡ ((digits 10 n).map fun n : ℕ => (n : ℤ)).alternatingSum [ZMOD 11]

↑n ≡ (List.map (fun n => ↑n) (Nat.digits 10 n)).alternatingSum [ZMOD 11]


@[simp]
theorem lift_comp_of : (lift i a h).comp (of f) = i

{R : Type u}
{S : Type v}
[CommRing R]
{f : R[X]}
[CommRing S]
{i : R →+* S}
{a : S}
(h : Polynomial.eval₂ i a f = 0)

(AdjoinRoot.lift i a h).comp (AdjoinRoot.of f) = i


theorem smul_eq_self_of_mem_zpowers {α : Type*} [MulAction G α] (hx : x ∈ Subgroup.zpowers y)
    {a : α} (hs : y • a = a) : x • a = a

{G : Type u_1}
[Group G]
{x y : G}
{α : Type u_6}
[MulAction G α]
(hx : x ∈ Subgroup.zpowers y)
{a : α}
(hs : y • a = a)


@[simp] theorem apply_eq_self
    (ρ : Representation k G V) (g : G) (x : V) [h : IsTrivial ρ] :
    ρ g x = x

{k : Type u_1}
{G : Type u_2}
{V : Type u_3}
[CommSemiring k]
[Monoid G]
[AddCommMonoid V]
[Module k V]
(ρ : Representation k G V)
(g : G)
(x : V)
[h : ρ.IsTrivial]


/-- Coercion as a monoid hom. -/
@[simps apply]
def coeMonoidHom : α →* WithZero α


theorem eLpNorm'_const_of_isProbabilityMeasure (c : F) (hq_pos : 0 < q) [IsProbabilityMeasure μ] :
    eLpNorm' (fun _ : α => c) q μ = (‖c‖₊ : ℝ≥0∞)

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{q : ℝ}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
(c : F)
(hq_pos : 0 < q)
[MeasureTheory.IsProbabilityMeasure μ]

MeasureTheory.eLpNorm' (fun x => c) q μ = ↑‖c‖₊


@[simp, norm_cast] lemma coe_induceHom : ⇑(induceHom φ φst) = Set.MapsTo.restrict φ s t φst

{V : Type u_1}
{W : Type u_2}
{G : SimpleGraph V}
{G' : SimpleGraph W}
{s : Set V}
{t : Set W}
(φ : G →g G')
(φst : Set.MapsTo (⇑φ) s t)

⇑(SimpleGraph.induceHom φ φst) = Set.MapsTo.restrict (⇑φ) s t φst


/-- Reflecting twice in the same subspace. -/
@[simp]
theorem reflection_reflection (s : AffineSubspace ℝ P) [Nonempty s]
    [HasOrthogonalProjection s.direction] (p : P) : reflection s (reflection s p) = p

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(s : AffineSubspace ℝ P)
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
(p : P)

(EuclideanGeometry.reflection s) ((EuclideanGeometry.reflection s) p) = p


/-- A normed algebra `𝕜'` over `𝕜` is normed module that is also an algebra.

See the implementation notes for `Algebra` for a discussion about non-unital algebras. Following
the strategy there, a non-unital *normed* algebra can be written as:
```lean
variable [NormedField 𝕜] [NonUnitalSeminormedRing 𝕜']
variable [NormedSpace 𝕜 𝕜'] [SMulCommClass 𝕜 𝕜' 𝕜'] [IsScalarTower 𝕜 𝕜' 𝕜']
```
-/
class NormedAlgebra (𝕜 : Type*) (𝕜' : Type*) [NormedField 𝕜] [SeminormedRing 𝕜'] extends
  Algebra 𝕜 𝕜' where
  norm_smul_le : ∀ (r : 𝕜) (x : 𝕜'), ‖r • x‖ ≤ ‖r‖ * ‖x‖

{𝕜 : Type u_6}
{𝕜' : Type u_7}
[NormedField 𝕜]
[SeminormedRing 𝕜']
[self : NormedAlgebra 𝕜 𝕜']
(r : 𝕜)
(x : 𝕜')

‖r • x‖ ≤ ‖r‖ * ‖x‖


/--For two functions `f` and `g`, the composition of `Prod.map f g` with `Prod.swap`
is equal to the composition of `Prod.swap` with `Prod.map g f`.-/
theorem map_comp_swap (f : α → β) (g : γ → δ) :
    Prod.map f g ∘ Prod.swap = Prod.swap ∘ Prod.map g f

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


theorem IsMaxFilter.congr {α β : Type*} [Preorder β] {f g : α → β} {a : α} {l : Filter α}
    (h : IsMaxFilter f l a) (heq : f =ᶠ[l] g) (hfga : f a = g a) : IsMaxFilter g l a

{α : Type u_1}
{β : Type u_2}
[Preorder β]
{f g : α → β}
{a : α}
{l : Filter α}
(h : IsMaxFilter f l a)
(heq : f =ᶠ[l] g)
(hfga : f a = g a)


lemma spec_cfcₙAux (f : C(σₙ 𝕜 a, 𝕜)₀) : σ 𝕜 (cfcₙAux hp₁ a ha f) = Set.range f

(f : ContinuousMapZero (↑(quasispectrum 𝕜 a)) 𝕜)

spectrum 𝕜 ((cfcₙAux ⋯ a ha) f) = Set.range ⇑f


theorem PerfectRing.pNilradical_eq_bot (R : Type*) [CommRing R] (p : ℕ) [ExpChar R p]
    [PerfectRing R p] : pNilradical R p = ⊥

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


/-- If for any finitely generated submodules `M'` of `M`, `M'` and `N` are linearly disjoint,
then `M` and `N` themselves are linearly disjoint. -/
theorem of_linearDisjoint_fg_left
    (H : ∀ M' : Submodule R S, M' ≤ M → M'.FG → M'.LinearDisjoint N) :
    M.LinearDisjoint N

(H : ∀ M' ≤ M, M'.FG → M'.LinearDisjoint N)


/-- `colimit F` is functorial in `F`, when `C` has all colimits of shape `J`. -/
@[simps] -- Porting note: simps on all fields now
def colim : (J ⥤ C) ⥤ C

CategoryTheory.Limits.colim.obj F = CategoryTheory.Limits.colimit F


/-- Ring isomorphism between `R[X]` and `R[ℕ]`. This is just an
implementation detail, but it can be useful to transfer results from `Finsupp` to polynomials. -/
@[simps apply symm_apply]
def toFinsuppIso : R[X] ≃+* R[ℕ]

(R : Type u)
[Semiring R]
(toFinsupp : R[ℕ])

(Polynomial.toFinsuppIso R).symm toFinsupp = { toFinsupp := toFinsupp }


theorem Antiperiodic.mul_const' [DivisionSemiring α] [Neg β] (h : Antiperiodic f c) {a : α}
    (ha : a ≠ 0) : Antiperiodic (fun x => f (x * a)) (c / a)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[DivisionSemiring α]
[Neg β]
(h : Function.Antiperiodic f c)
{a : α}
(ha : a ≠ 0)

Function.Antiperiodic (fun x => f (x * a)) (c / a)


theorem inducedOuterMeasure_exists_set {s : Set α} (hs : inducedOuterMeasure m P0 m0 s ≠ ∞)
    {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ t : Set α,
      P t ∧ s ⊆ t ∧ inducedOuterMeasure m P0 m0 t ≤ inducedOuterMeasure m P0 m0 s + ε

(PU : ∀ ⦃f : ℕ → Set α⦄, (∀ (i : ℕ), P (f i)) → P (⋃ i, f i))

(msU : ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), P (f i)), m (⋃ i, f i) ⋯ ≤ ∑' (i : ℕ), m (f i) ⋯)

(m_mono : ∀ ⦃s₁ s₂ : Set α⦄ (hs₁ : P s₁) (hs₂ : P s₂), s₁ ⊆ s₂ → m s₁ hs₁ ≤ m s₂ hs₂)

(hs : (MeasureTheory.inducedOuterMeasure m P0 m0) s ≠ ⊤)

∃ t, P t ∧ s ⊆ t ∧ (MeasureTheory.inducedOuterMeasure m P0 m0) t ≤ (MeasureTheory.inducedOuterMeasure m P0 m0) s + ε


theorem range_comap_of_surjective (hf : Surjective f) :
    Set.range (comap f) = zeroLocus (ker f)

{R : Type u}
(S : Type v)
[CommRing R]
[CommRing S]
(f : R →+* S)
(hf : Function.Surjective ⇑f)

Set.range ⇑(PrimeSpectrum.comap f) = PrimeSpectrum.zeroLocus ↑(RingHom.ker f)


@[trans]
theorem lf_of_lf_of_equiv {x y z : PGame} (h₁ : x ⧏ y) (h₂ : y ≈ z) : x ⧏ z

{x y z : SetTheory.PGame}
(h₁ : x.LF y)
(h₂ : y ≈ z)


theorem dite_cond_eq_true {α : Sort u} {c : Prop} {_ : Decidable c} {t : c → α} {e : ¬ c → α} (h : c = True) : (dite c t e) = t (of_eq_true h)

∀ {x : Decidable c} {t : c → α} {e : ¬c → α} (h : c = True), dite c t e = t ⋯


@[to_additive]
theorem mem_pi (I : Set η) {H : ∀ i, Subgroup (f i)} {p : ∀ i, f i} :
    p ∈ pi I H ↔ ∀ i : η, i ∈ I → p i ∈ H i

{η : Type u_7}
{f : η → Type u_8}
[(i : η) → Group (f i)]
(I : Set η)
{H : (i : η) → Subgroup (f i)}
{p : (i : η) → f i}

p ∈ Subgroup.pi I H ↔ ∀ i ∈ I, p i ∈ H i


theorem mapsTo_closedBall (hf : LipschitzWith K f) (x : α) (r : ℝ) :
    MapsTo f (Metric.closedBall x r) (Metric.closedBall (f x) (K * r))

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)
(x : α)
(r : ℝ)

Set.MapsTo f (Metric.closedBall x r) (Metric.closedBall (f x) (↑K * r))


/-- There exist two lists of `TransvectionStruct` such that multiplying by them on the left and
on the right makes a matrix block-diagonal, when the last coefficient is nonzero. -/
theorem exists_isTwoBlockDiagonal_of_ne_zero (hM : M (inr unit) (inr unit) ≠ 0) :
    ∃ L L' : List (TransvectionStruct (Fin r ⊕ Unit) 𝕜),
      IsTwoBlockDiagonal ((L.map toMatrix).prod * M * (L'.map toMatrix).prod)

(M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜)

∃ L L',
  ((List.map Matrix.TransvectionStruct.toMatrix L).prod * M *
      (List.map Matrix.TransvectionStruct.toMatrix L').prod).IsTwoBlockDiagonal


theorem conj_ofNat (n : ℕ) [n.AtLeastTwo] : conj (no_index (OfNat.ofNat n : K)) = OfNat.ofNat n

{K : Type u_1}
[RCLike K]
(n : ℕ)
[n.AtLeastTwo]

(starRingEnd K) (OfNat.ofNat n) = OfNat.ofNat n


@[to_additive]
theorem map_comap_eq_self_of_surjective {f : G →* N} (h : Function.Surjective f) (H : Subgroup N) :
    map f (comap f H) = H

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
(h : Function.Surjective ⇑f)
(H : Subgroup N)


/-- A homeomorphism of spaces gives an equivalence of categories of presheaves. -/
@[simps!]
def presheafEquivOfIso {X Y : TopCat} (H : X ≅ Y) : X.Presheaf C ≌ Y.Presheaf C

(C : Type u)
[CategoryTheory.Category.{v, u} C]
{X Y : TopCat}
(H : X ≅ Y)
(G : (TopologicalSpace.Opens ↑Y)ᵒᵖ ⥤ C)

∀ (X_1 : (TopologicalSpace.Opens ↑X)ᵒᵖ),
  ((TopCat.Presheaf.presheafEquivOfIso C H).inverse.obj G).obj X_1 =
    G.obj (Opposite.op ((TopologicalSpace.Opens.map H.inv).obj (Opposite.unop X_1)))


theorem eval_monomial : eval f (monomial s a) = a * s.prod fun n e => f n ^ e

{R : Type u}
{σ : Type u_1}
{a : R}
{s : σ →₀ ℕ}
[CommSemiring R]
{f : σ → R}

(MvPolynomial.eval f) ((MvPolynomial.monomial s) a) = a * s.prod fun n e => f n ^ e


@[simp]
theorem ListBlank.nth_succ {Γ} [Inhabited Γ] (l : ListBlank Γ) (n : ℕ) :
    l.nth (n + 1) = l.tail.nth n

{Γ : Type u_1}
[Inhabited Γ]
(l : Turing.ListBlank Γ)
(n : ℕ)


protected theorem le_of_add_le_add_left (a b c : ℤ√d) (h : c + a ≤ c + b) : a ≤ b

{d : ℕ}
(a b c : ℤ√↑d)
(h : c + a ≤ c + b)


/-- Given two morphisms of complexes `φ₁ φ₂ : F ⟶ G`, the datum of an homotopy between `φ₁` and
`φ₂` is equivalent to the datum of a `1`-cochain `z` such that `δ (-1) 0 z` is the difference
of the zero cochains associated to `φ₂` and `φ₁`. -/
@[simps]
def equivHomotopy (φ₁ φ₂ : F ⟶ G) :
    Homotopy φ₁ φ₂ ≃
      { z : Cochain F G (-1) // Cochain.ofHom φ₁ = δ (-1) 0 z + Cochain.ofHom φ₂ }

(φ₁ φ₂ : F ⟶ G)

(z :
  { z //
    CochainComplex.HomComplex.Cochain.ofHom φ₁ =
      CochainComplex.HomComplex.δ (-1) 0 z + CochainComplex.HomComplex.Cochain.ofHom φ₂ })

((CochainComplex.HomComplex.Cochain.equivHomotopy φ₁ φ₂).symm z).hom i j =
  if hij : i + -1 = j then (↑z).v i j hij else 0


lemma preservesSheafification_of_adjunction (adj : G ⊣ F) :
    J.PreservesSheafification G

(J : CategoryTheory.GrothendieckTopology C)


@[to_additive]
theorem lt_mul_of_lt_of_one_lt [CovariantClass α α (· * ·) (· < ·)] {a b c : α} (hbc : b < c)
    (ha : 1 < a) :
    b < c * a

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


theorem tendstoUniformly_iff_seq_tendstoUniformly {l : Filter ι} [l.IsCountablyGenerated] :
    TendstoUniformly F f l ↔
      ∀ u : ℕ → ι, Tendsto u atTop l → TendstoUniformly (fun n => F (u n)) f atTop

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{l : Filter ι}
[l.IsCountablyGenerated]

TendstoUniformly F f l ↔
  ∀ (u : ℕ → ι), Filter.Tendsto u Filter.atTop l → TendstoUniformly (fun n => F (u n)) f Filter.atTop


@[to_additive (attr := simp)]
lemma stabilizer_mul_self (s : Set G) : (stabilizer G s : Set G) * s = s


theorem measurable_of_measurable_nnreal {f : ℝ≥0∞ → α} (h : Measurable fun p : ℝ≥0 => f p) :
    Measurable f

{α : Type u_1}
[MeasurableSpace α]
{f : ℝ≥0∞ → α}
(h : Measurable fun p => f ↑p)


theorem neg_add_self {X Y : C} (a : X ⟶ Y) : -a + a = 0


/--
To construct an isomorphism of coalgebras, it suffices to give an isomorphism of the carriers which
commutes with the structure morphisms.
-/
@[simps]
def isoMk {A B : Coalgebra G} (h : A.A ≅ B.A)
    (w : A.a ≫ (G : C ⥤ C).map h.hom = h.hom ≫ B.a := by aesop_cat) : A ≅ B

(w : CategoryTheory.CategoryStruct.comp A.a (G.map h.hom) = CategoryTheory.CategoryStruct.comp h.hom B.a := by
  aesop_cat)

(CategoryTheory.Comonad.Coalgebra.isoMk h w).inv.f = h.inv


@[simp]
theorem sum_hom [Preadditive C] {P Q : Karoubi C} {α : Type*} (s : Finset α) (f : α → (P ⟶ Q)) :
    (∑ x ∈ s, f x).f = ∑ x ∈ s, (f x).f

{P Q : CategoryTheory.Idempotents.Karoubi C}


@[simp]
lemma Scheme.ofRestrict_app (V) :
    (X.ofRestrict h).app V = X.presheaf.map (h.isOpenMap.adjunction.counit.app V).op

{f : U ⟶ TopCat.of ↑↑X.toPresheafedSpace}

AlgebraicGeometry.Scheme.Hom.app (X.ofRestrict h) V = X.presheaf.map (⋯.adjunction.counit.app V).op


@[simp]
theorem mk'_toSubmonoid {s : Set R} {sm : Submonoid R} (hm : ↑sm = s) {sa : AddSubmonoid R}
    (ha : ↑sa = s) : (Subsemiring.mk' s sm hm sa ha).toSubmonoid = sm

{R : Type u}
[NonAssocSemiring R]
{s : Set R}
{sm : Submonoid R}
(hm : ↑sm = s)
{sa : AddSubmonoid R}
(ha : ↑sa = s)


theorem add_emod_eq_add_emod_left {m n k : Int} (i : Int)
    (H : m % n = k % n) : (i + m) % n = (i + k) % n


@[simp]
lemma integrable_add_iff_integrable_left {f g : α → β} (hf : Integrable f μ) :
    Integrable (g + f) μ ↔ Integrable g μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f g : α → β}
(hf : MeasureTheory.Integrable f μ)

MeasureTheory.Integrable (g + f) μ ↔ MeasureTheory.Integrable g μ


/-- Assumes left covariance. -/
theorem Left.mul_le_one_of_le_of_le [PosMulMono α] (ha : a ≤ 1) (hb : b ≤ 1) (a0 : 0 ≤ a) :
    a * b ≤ 1

{α : Type u_1}
{a b : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[PosMulMono α]
(ha : a ≤ 1)
(hb : b ≤ 1)
(a0 : 0 ≤ a)


@[to_additive tsum_sum]
theorem tprod_of_prod {f : γ → β → α} {s : Finset γ} (hf : ∀ i ∈ s, Multipliable (f i)) :
    ∏' b, ∏ i ∈ s, f i b = ∏ i ∈ s, ∏' b, f i b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
[T2Space α]
[ContinuousAdd α]
{f : γ → β → α}
{s : Finset γ}
(hf : ∀ i ∈ s, Summable (f i))

∑' (b : β), ∑ i ∈ s, f i b = ∑ i ∈ s, ∑' (b : β), f i b


@[gcongr]
theorem insert_subset_insert (a : α) {s t : Finset α} (h : s ⊆ t) : insert a s ⊆ insert a t

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


theorem irreducible_of_coprime (hp : p.IsUnitTrinomial)
    (h : IsRelPrime p p.mirror) : Irreducible p

{p : Polynomial ℤ}
(hp : p.IsUnitTrinomial)
(h : IsRelPrime p p.mirror)


/-- If `f : ℝⁿ⁺¹ → E` is differentiable on a closed rectangular box `I` with derivative `f'`, then
the partial derivative `fun x ↦ f' x (Pi.single i 1)` is Henstock-Kurzweil integrable with integral
equal to the difference of integrals of `f` over the faces `x i = I.upper i` and `x i = I.lower i`.

More precisely, we use a non-standard generalization of the Henstock-Kurzweil integral and
we allow `f` to be non-differentiable (but still continuous) at a countable set of points.

TODO: If `n > 0`, then the condition at `x ∈ s` can be replaced by a much weaker estimate but this
requires either better integrability theorems, or usage of a filter depending on the countable set
`s` (we need to ensure that none of the faces of a partition contain a point from `s`). -/
theorem hasIntegral_GP_pderiv (f : (Fin (n + 1) → ℝ) → E)
    (f' : (Fin (n + 1) → ℝ) → (Fin (n + 1) → ℝ) →L[ℝ] E) (s : Set (Fin (n + 1) → ℝ))
    (hs : s.Countable) (Hs : ∀ x ∈ s, ContinuousWithinAt f (Box.Icc I) x)
    (Hd : ∀ x ∈ (Box.Icc I) \ s, HasFDerivWithinAt f (f' x) (Box.Icc I) x) (i : Fin (n + 1)) :
    HasIntegral.{0, u, u} I GP (fun x => f' x (Pi.single i 1)) BoxAdditiveMap.volume
      (integral.{0, u, u} (I.face i) GP (fun x => f (i.insertNth (I.upper i) x))
          BoxAdditiveMap.volume -
        integral.{0, u, u} (I.face i) GP (fun x => f (i.insertNth (I.lower i) x))
          BoxAdditiveMap.volume)

(Hs : ∀ x ∈ s, ContinuousWithinAt f (BoxIntegral.Box.Icc I) x)

(Hd : ∀ x ∈ BoxIntegral.Box.Icc I \ s, HasFDerivWithinAt f (f' x) (BoxIntegral.Box.Icc I) x)

BoxIntegral.HasIntegral I BoxIntegral.IntegrationParams.GP (fun x => (f' x) (Pi.single i 1))
  BoxIntegral.BoxAdditiveMap.volume
  (BoxIntegral.integral (I.face i) BoxIntegral.IntegrationParams.GP (fun x => f (i.insertNth (I.upper i) x))
      BoxIntegral.BoxAdditiveMap.volume -
    BoxIntegral.integral (I.face i) BoxIntegral.IntegrationParams.GP (fun x => f (i.insertNth (I.lower i) x))
      BoxIntegral.BoxAdditiveMap.volume)


@[deprecated toNat_lt_toNat (since := "2024-02-15")]
theorem toNat_lt_of_lt_of_lt_aleph0 (hd : d < ℵ₀) (hcd : c < d) : toNat c < toNat d

{c d : Cardinal.{u}}
(hd : d < Cardinal.aleph0)
(hcd : c < d)


/-- Construct a cocone on `F` from an object of the category `(F ↓ Δ)`. This is part of an
    equivalence, see `Cocone.equivStructuredArrow`. -/
@[simps]
def Cocone.fromStructuredArrow (F : J ⥤ C) : StructuredArrow F (const J) ⥤ Cocone F

(c : CategoryTheory.StructuredArrow F (CategoryTheory.Functor.const J))

((CategoryTheory.Limits.Cocone.fromStructuredArrow F).obj c).pt = c.right


theorem antitoneOn_iff_antitone : AntitoneOn f s ↔
    Antitone fun a : s => f a

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


lemma map_eq_iff {X Y : C} (φ ψ : W.LeftFraction₂ X Y) :
    (φ.fst.map L (Localization.inverts _ _) = ψ.fst.map L (Localization.inverts _ _) ∧
    φ.snd.map L (Localization.inverts _ _) = ψ.snd.map L (Localization.inverts _ _)) ↔
      LeftFraction₂Rel φ ψ

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y : C}
(φ ψ : W.LeftFraction₂ X Y)

φ.fst.map L ⋯ = ψ.fst.map L ⋯ ∧ φ.snd.map L ⋯ = ψ.snd.map L ⋯ ↔ CategoryTheory.MorphismProperty.LeftFraction₂Rel φ ψ


theorem Filter.Tendsto.piecewise_nhdsWithin {f g : α → β} {t : Set α} [∀ x, Decidable (x ∈ t)]
    {a : α} {s : Set α} {l : Filter β} (h₀ : Tendsto f (𝓝[s ∩ t] a) l)
    (h₁ : Tendsto g (𝓝[s ∩ tᶜ] a) l) : Tendsto (piecewise t f g) (𝓝[s] a) l

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
{f g : α → β}
{t : Set α}
[(x : α) → Decidable (x ∈ t)]
{a : α}
{s : Set α}
{l : Filter β}
(h₀ : Filter.Tendsto f (𝓝[s ∩ t] a) l)
(h₁ : Filter.Tendsto g (𝓝[s ∩ tᶜ] a) l)

Filter.Tendsto (t.piecewise f g) (𝓝[s] a) l


theorem _root_.closedEmbedding_id : ClosedEmbedding (@id X)


/-- If `f` is locally integrable, and `f =O[atBot] g`, `f =O[atTop] g'` for some
`g`, `g'` integrable at `atBot` and `atTop` respectively, then `f` is integrable. -/
theorem LocallyIntegrable.integrable_of_isBigO_atBot_atTop
    [IsMeasurablyGenerated (atBot (α := α))] [IsMeasurablyGenerated (atTop (α := α))]
    (hf : LocallyIntegrable f μ)
    (ho : f =O[atBot] g) (hg : IntegrableAtFilter g atBot μ)
    (ho' : f =O[atTop] g') (hg' : IntegrableAtFilter g' atTop μ) : Integrable f μ

(hf : MeasureTheory.LocallyIntegrable f μ)

(hg : MeasureTheory.IntegrableAtFilter g Filter.atBot μ)

(hg' : MeasureTheory.IntegrableAtFilter g' Filter.atTop μ)


theorem comapSMul_def (g : G) (f : α →₀ M) : g • f = mapDomain (g • ·) f

{α : Type u_1}
{M : Type u_5}
{G : Type u_9}
[Monoid G]
[MulAction G α]
[AddCommMonoid M]
(g : G)
(f : α →₀ M)

g • f = Finsupp.mapDomain (fun x => g • x) f


theorem finSuccEquiv'_ne_last_apply {i j : Fin (n + 1)} (hi : i ≠ Fin.last n) (hj : j ≠ i) :
    finSuccEquiv' i j = (i.castLT (Fin.val_lt_last hi)).predAbove j

{n : ℕ}
{i j : Fin (n + 1)}
(hi : i ≠ Fin.last n)
(hj : j ≠ i)

(finSuccEquiv' i) j = some ((i.castLT ⋯).predAbove j)


/-- A semigroup homomorphism `M →ₙ* N` can equivalently be viewed as a semigroup homomorphism
`Mᵐᵒᵖ →ₙ* Nᵐᵒᵖ`. This is the action of the (fully faithful) `ᵐᵒᵖ`-functor on morphisms. -/
@[to_additive (attr := simps)
      "An additive semigroup homomorphism `AddHom M N` can equivalently be viewed as an
      additive semigroup homomorphism `AddHom Mᵃᵒᵖ Nᵃᵒᵖ`. This is the action of the
      (fully faithful)`ᵃᵒᵖ`-functor on morphisms."]
def MulHom.op {M N} [Mul M] [Mul N] : (M →ₙ* N) ≃ (Mᵐᵒᵖ →ₙ* Nᵐᵒᵖ)

{M : Type u_2}
{N : Type u_3}
[Add M]
[Add N]
(f : AddHom Mᵃᵒᵖ Nᵃᵒᵖ)

∀ (a : M), (AddHom.op.symm f) a = (AddOpposite.unop ∘ ⇑f ∘ AddOpposite.op) a


theorem fib_succ_eq_succ_sum (n : ℕ) : fib (n + 1) = (∑ k ∈ Finset.range n, fib k) + 1

Nat.fib (n + 1) = ∑ k ∈ Finset.range n, Nat.fib k + 1


@[to_additive]
theorem exists_mk {C : α ⧸ s → Prop} : (∃ x : α ⧸ s, C x) ↔ ∃ x : α, C x

{α : Type u_1}
[Group α]
{s : Subgroup α}
{C : α ⧸ s → Prop}


theorem mk_eq_mk_iff_associated [Monoid α] {a b : α} : Associates.mk a = Associates.mk b ↔ a ~ᵤ b


@[simp]
theorem mem_boxes : J ∈ π.boxes ↔ J ∈ π

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)


theorem fast_fib_aux_bit_ff (n : ℕ) :
    fastFibAux (bit false n) =
      let p := fastFibAux n
      (p.1 * (2 * p.2 - p.1), p.2 ^ 2 + p.1 ^ 2)

(Nat.bit false n).fastFibAux =
  let p := n.fastFibAux;
  (p.1 * (2 * p.2 - p.1), p.2 ^ 2 + p.1 ^ 2)


/-- `F.mapTriangle` commutes with the inverse of the rotation of triangles. -/
@[simps!]
noncomputable def mapTriangleInvRotateIso [F.Additive] :
    F.mapTriangle ⋙ Pretriangulated.invRotate D ≅
      Pretriangulated.invRotate C ⋙ F.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

(F.mapTriangleInvRotateIso.inv.app X).hom₂ = CategoryTheory.CategoryStruct.id (F.obj X.obj₁)


theorem lintegral_const_mul'' (r : ℝ≥0∞) {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) :
    ∫⁻ a, r * f a ∂μ = r * ∫⁻ a, f a ∂μ

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

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


theorem map_eq_zero_iff {x : E} : e x = 0 ↔ x = 0

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)
{x : E}


/-- The functor swapping the factors of a cartesian product of categories, `C × D ⥤ D × C`. -/
@[simps]
def swap : C × D ⥤ D × C

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

(CategoryTheory.Prod.swap C D).obj X = (X.2, X.1)


@[to_additive (attr := simp)]
theorem comap_top (f : F) : (⊤ : Submonoid N).comap f = ⊤

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
(f : F)


/-- Definition of `x ⧏ y` on pre-games, in terms of `≤`.

The ordering here is chosen so that `or.inl` refer to moves by Left, and `or.inr` refer to
moves by Right. -/
theorem lf_iff_exists_le {x y : PGame} :
    x ⧏ y ↔ (∃ i, x ≤ y.moveLeft i) ∨ ∃ j, x.moveRight j ≤ y

x.LF y ↔ (∃ i, x ≤ y.moveLeft i) ∨ ∃ j, x.moveRight j ≤ y


@[simp] theorem toRingEquiv_opOp : (opOp R A : A ≃+* Aᵐᵒᵖᵐᵒᵖ) = RingEquiv.opOp A

(R : Type u_1)
(A : Type u_3)
[CommSemiring R]
[Semiring A]
[Algebra R A]


theorem LineDifferentiableWithinAt.lineDifferentiableAt (h : LineDifferentiableWithinAt 𝕜 f s x v)
    (hs : s ∈ 𝓝 x) : LineDifferentiableAt 𝕜 f x v


theorem fromTypes_zero (p : Fin 0 → Type u) (τ : Type u) : FromTypes p τ = τ


@[simp]
theorem congr_tmul (f : M ≃ₗ[R] P) (g : N ≃ₗ[R] Q) (m : M) (n : N) :
    congr f g (m ⊗ₜ n) = f m ⊗ₜ g n

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

(TensorProduct.congr f g) (m ⊗ₜ[R] n) = f m ⊗ₜ[R] g n


theorem injective_permutations'Aux (x : α) : Function.Injective (permutations'Aux x)


@[to_additive]
theorem mul_mem_sup {S T : Subsemigroup M} {x y : M} (hx : x ∈ S) (hy : y ∈ T) : x * y ∈ S ⊔ T

{M : Type u_2}
[Mul M]
{S T : Subsemigroup M}
{x y : M}
(hx : x ∈ S)
(hy : y ∈ T)


/-- `m` is an `n`-smooth number if the `Finset` of its prime factors consists of numbers `< n`. -/
lemma mem_smoothNumbers_of_primeFactors_subset {m n : ℕ} (hm : m ≠ 0)
    (hp : m.primeFactors ⊆ Finset.range n) : m ∈ n.smoothNumbers


@[to_additive]
lemma iIndepFun.indepFun_div_div (hf_indep : iIndepFun (fun _ ↦ m) f μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (f i / f j) (f k / f l) μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.iIndepFun (fun x => m) f μ)

ProbabilityTheory.IndepFun (f i - f j) (f k - f l) μ


@[simp]
theorem apply_eq_iff_eq (f : F) {x y : α} : f x = f y ↔ x = y

{F : Sort u_1}
{α : Sort u_2}
{β : Sort u_3}
[FunLike F α β]
[i : EmbeddingLike F α β]
(f : F)
{x y : α}


theorem setToL1SCLM_mono {T : Set α → G' →L[ℝ] G''} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
    (hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f g : α →₁ₛ[μ] G'}
    (hfg : f ≤ g) : setToL1SCLM α G' μ hT f ≤ setToL1SCLM α G' μ hT g

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x)

{f g : ↥(MeasureTheory.Lp.simpleFunc G' 1 μ)}

(MeasureTheory.L1.SimpleFunc.setToL1SCLM α G' μ hT) f ≤ (MeasureTheory.L1.SimpleFunc.setToL1SCLM α G' μ hT) g


theorem exists_mem_insert {P : α → Prop} {a : α} {s : Set α} :
    (∃ x ∈ insert a s, P x) ↔ (P a ∨ ∃ x ∈ s, P x)

{α : Type u}
{P : α → Prop}
{a : α}
{s : Set α}

(∃ x ∈ insert a s, P x) ↔ P a ∨ ∃ x ∈ s, P x


/-- products of nilpotent groups are nilpotent if their nilpotency class is bounded -/
theorem isNilpotent_pi_of_bounded_class [∀ i, IsNilpotent (Gs i)] (n : ℕ)
    (h : ∀ i, Group.nilpotencyClass (Gs i) ≤ n) : IsNilpotent (∀ i, Gs i)

(h : ∀ (i : η), Group.nilpotencyClass (Gs i) ≤ n)


@[simp]
theorem compL_apply (f : Fₗ →L[𝕜] Gₗ) (g : E →L[𝕜] Fₗ) : compL 𝕜 E Fₗ Gₗ f g = f.comp g

(𝕜 : Type u_1)
(E : Type u_4)
(Fₗ : Type u_7)
(Gₗ : Type u_9)
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup Fₗ]
[SeminormedAddCommGroup Gₗ]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 Fₗ]
[NormedSpace 𝕜 Gₗ]
(f : Fₗ →L[𝕜] Gₗ)
(g : E →L[𝕜] Fₗ)

((ContinuousLinearMap.compL 𝕜 E Fₗ Gₗ) f) g = f.comp g


/-- See also `Order.le_succ_of_wcovBy`. -/
lemma succ_eq_of_covBy (h : a ⋖ b) : succ a = b

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


private theorem I_prop : innerProp' E (I : 𝕜)

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


theorem le_mem_nhds [OrderTopology α] {a b : α} (h : a < b) : ∀ᶠ x in 𝓝 b, a ≤ x

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[OrderTopology α]
{a b : α}
(h : a < b)


theorem monomial_eq_monomial_iff {α : Type*} (a₁ a₂ : α →₀ ℕ) (b₁ b₂ : R) :
    monomial a₁ b₁ = monomial a₂ b₂ ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ b₁ = 0 ∧ b₂ = 0

{R : Type u}
[CommSemiring R]
{α : Type u_2}
(a₁ a₂ : α →₀ ℕ)
(b₁ b₂ : R)

(MvPolynomial.monomial a₁) b₁ = (MvPolynomial.monomial a₂) b₂ ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ b₁ = 0 ∧ b₂ = 0


@[simp]
theorem AlgEquiv.restrict_liftNormal (χ : K₁ ≃ₐ[F] K₁) [Normal F K₁] [Normal F E] :
    (χ.liftNormal E).restrictNormal K₁ = χ

{F : Type u_1}
{K₁ : Type u_3}
[Field F]
[Field K₁]
[Algebra F K₁]
(E : Type u_6)
[Field E]
[Algebra F E]
[Algebra K₁ E]
[IsScalarTower F K₁ E]
(χ : K₁ ≃ₐ[F] K₁)
[Normal F K₁]
[Normal F E]


theorem one_le_m_coe [Nonempty α] (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) : (1 : ℝ) ≤ m

(hPα : P.parts.card * 16 ^ P.parts.card ≤ Fintype.card α)


@[reassoc (attr := simp)]
lemma ιTotal_totalFlipIso_f_inv
    (i₁ : I₁) (i₂ : I₂) (j : J) (h : ComplexShape.π c₁ c₂ c (i₁, i₂) = j) :
    K.ιTotal c i₁ i₂ j h ≫ (K.totalFlipIso c).inv.f j =
      ComplexShape.σ c₁ c₂ c i₁ i₂ • K.flip.ιTotal c i₂ i₁ j
        (by rw [ComplexShape.π_symm c₁ c₂ c i₁ i₂, h])

{C : Type u_1}
{I₁ : Type u_2}
{I₂ : Type u_3}
{J : Type u_4}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c : ComplexShape J)
[TotalComplexShape c₁ c₂ c]
[TotalComplexShape c₂ c₁ c]
[TotalComplexShapeSymmetry c₁ c₂ c]
[K.HasTotal c]
[K.flip.HasTotal c]
[DecidableEq J]
(i₁ : I₁)
(i₂ : I₂)
(j : J)
(h : c₁.π c₂ c (i₁, i₂) = j)

K.ιTotal c i₁ i₂ j h ≫ (K.totalFlipIso c).inv.f j = c₁.σ c₂ c i₁ i₂ • K.flip.ιTotal c i₂ i₁ j ⋯


/-- Summing the count of `x` over a list filtered by some `p` is just `countP` applied to `p` -/
theorem sum_map_count_dedup_filter_eq_countP (p : α → Bool) (l : List α) :
    ((l.dedup.filter p).map fun x => l.count x).sum = l.countP p

{α : Type u_2}
[DecidableEq α]
(p : α → Bool)
(l : List α)

(List.map (fun x => List.count x l) (List.filter p l.dedup)).sum = List.countP p l


lemma IsIntegralCurveAt.eventually_hasDerivAt (hγ : IsIntegralCurveAt γ v t₀) :
    ∀ᶠ t in 𝓝 t₀, HasDerivAt ((extChartAt I (γ t₀)) ∘ γ)
      (tangentCoordChange I (γ t) (γ t₀) (γ t) (v (γ t))) t

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type u_2}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type u_3}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{γ : ℝ → M}
{v : (x : M) → TangentSpace I x}
{t₀ : ℝ}
(hγ : IsIntegralCurveAt γ v t₀)

∀ᶠ (t : ℝ) in 𝓝 t₀, HasDerivAt (↑(extChartAt I (γ t₀)) ∘ γ) ((tangentCoordChange I (γ t) (γ t₀) (γ t)) (v (γ t))) t


protected theorem Tendsto.Ioc {l₁ l₂ : Filter α} [TendstoIxxClass Ioc l₁ l₂] {lb : Filter β}
    {u₁ u₂ : β → α} (h₁ : Tendsto u₁ lb l₁) (h₂ : Tendsto u₂ lb l₁) :
    Tendsto (fun x => Ioc (u₁ x) (u₂ x)) lb l₂.smallSets

{α : Type u_1}
{β : Type u_2}
[Preorder α]
{l₁ l₂ : Filter α}
[Filter.TendstoIxxClass Set.Ioc l₁ l₂]
{lb : Filter β}
{u₁ u₂ : β → α}
(h₁ : Filter.Tendsto u₁ lb l₁)
(h₂ : Filter.Tendsto u₂ lb l₁)

Filter.Tendsto (fun x => Set.Ioc (u₁ x) (u₂ x)) lb l₂.smallSets


@[simp, reassoc]
theorem op_comp {X Y Z : C} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g).op = g.op ≫ f.op

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : C}
{f : X ⟶ Y}
{g : Y ⟶ Z}

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


@[simp]
lemma addSubmonoid_closure_range_mul_self : closure (range fun x : ℤ ↦ x * x) = nonneg _

AddSubmonoid.closure (Set.range fun x => x * x) = AddSubmonoid.nonneg ℤ


theorem imageSubobjectIso_comp_image_map {W X Y Z : C} {f : W ⟶ X} [HasImage f] {g : Y ⟶ Z}
    [HasImage g] (sq : Arrow.mk f ⟶ Arrow.mk g) [HasImageMap sq] :
    (imageSubobjectIso _).hom ≫ image.map sq =
      imageSubobjectMap sq ≫ (imageSubobjectIso _).hom

(sq : CategoryTheory.Arrow.mk f ⟶ CategoryTheory.Arrow.mk g)

(CategoryTheory.Limits.imageSubobjectIso (CategoryTheory.Arrow.mk f).hom).hom ≫ CategoryTheory.Limits.image.map sq =
  CategoryTheory.Limits.imageSubobjectMap sq ≫ (CategoryTheory.Limits.imageSubobjectIso g).hom


theorem Intersecting.is_max_iff_card_eq (hs : (s : Set α).Intersecting) :
    (∀ t : Finset α, (t : Set α).Intersecting → s ⊆ t → s = t) ↔ 2 * s.card = Fintype.card α

{α : Type u_1}
[BooleanAlgebra α]
[Nontrivial α]
[Fintype α]
{s : Finset α}
(hs : (↑s).Intersecting)

(∀ (t : Finset α), (↑t).Intersecting → s ⊆ t → s = t) ↔ 2 * s.card = Fintype.card α


/-- A functor `C ⥤ D` computably lowers to a functor `ThinSkeleton C ⥤ ThinSkeleton D`. -/
@[simps]
def map (F : C ⥤ D) : ThinSkeleton C ⥤ ThinSkeleton D

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

∀ (a : Quotient (CategoryTheory.isIsomorphicSetoid C)),
  (CategoryTheory.ThinSkeleton.map F).obj a = Quotient.map F.obj ⋯ a


@[simp] protected theorem eta (a : Fin n) (h : a < n) : (⟨a, h⟩ : Fin n) = a


@[simp]
theorem map_def {α β} (m : α → β) (f : Filter α) : m <$> f = map m f

{α β : Type u_2}
(m : α → β)
(f : Filter α)


theorem starConvex_iff_segment_subset : StarConvex 𝕜 x s ↔ ∀ ⦃y⦄, y ∈ s → [x -[𝕜] y] ⊆ s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{x : E}
{s : Set E}

StarConvex 𝕜 x s ↔ ∀ ⦃y : E⦄, y ∈ s → [x-[𝕜]y] ⊆ s


/-- In a connected category, any two objects are related by `Zigzag`. -/
theorem isPreconnected_zigzag [IsPreconnected J] (j₁ j₂ : J) : Zigzag j₁ j₂

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


theorem eraseNone_eq_biUnion [DecidableEq α] (s : Finset (Option α)) :
    eraseNone s = s.biUnion Option.toFinset

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

Finset.eraseNone s = s.biUnion Option.toFinset


theorem dominatedFinMeasAdditive_weightedSMul {_ : MeasurableSpace α} (μ : Measure α) :
    DominatedFinMeasAdditive μ (weightedSMul μ : Set α → F →L[ℝ] F) 1

{α : Type u_1}
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace ℝ F]

∀ {x : MeasurableSpace α} (μ : MeasureTheory.Measure α),
  MeasureTheory.DominatedFinMeasAdditive μ (MeasureTheory.weightedSMul μ) 1


theorem mem_sInter {x y : ZFSet} (h : x.Nonempty) : y ∈ ⋂₀ x ↔ ∀ z ∈ x, y ∈ z

y ∈ ⋂₀ x ↔ ∀ z ∈ x, y ∈ z


theorem mem_degreeLT {n : ℕ} {f : R[X]} : f ∈ degreeLT R n ↔ degree f < n

{R : Type u}
[Semiring R]
{n : ℕ}
{f : R[X]}

f ∈ Polynomial.degreeLT R n ↔ f.degree < ↑n


nonrec theorem integral_indicator {a₁ a₂ a₃ : ℝ} (h : a₂ ∈ Icc a₁ a₃) :
    ∫ x in a₁..a₃, indicator {x | x ≤ a₂} f x ∂μ = ∫ x in a₁..a₂, f x ∂μ

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : ℝ → E}
{μ : MeasureTheory.Measure ℝ}
{a₁ a₂ a₃ : ℝ}
(h : a₂ ∈ Set.Icc a₁ a₃)

∫ (x : ℝ) in a₁..a₃, {x | x ≤ a₂}.indicator f x ∂μ = ∫ (x : ℝ) in a₁..a₂, f x ∂μ


theorem lim_nonneg (c : CU P) (x : X) : 0 ≤ c.lim x

{X : Type u_1}
[TopologicalSpace X]
{P : Set X → Prop}
(c : Urysohns.CU P)
(x : X)


@[simp]
protected theorem _root_.LinearEquivClass.range [Module R M] [Module R₂ M₂] {F : Type*}
    [EquivLike F M M₂] [SemilinearEquivClass F σ₁₂ M M₂] (e : F) : LinearMap.range e = ⊤

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
[Module R M]
[Module R₂ M₂]
{F : Type u_10}
[EquivLike F M M₂]
[SemilinearEquivClass F σ₁₂ M M₂]
(e : F)


@[simp]
theorem volume_Icc {a b : ℝ} : volume (Icc a b) = ofReal (b - a)

MeasureTheory.volume (Set.Icc a b) = ENNReal.ofReal (b - a)


@[to_additive]
lemma isCyclic_iff_exists_ofOrder_eq_natCard [Finite α] :
    IsCyclic α ↔ ∃ g : α, orderOf g = Nat.card α

IsAddCyclic α ↔ ∃ g, addOrderOf g = Nat.card α


theorem coe_fn_inj {φ₁ φ₂ : A →ₗc[R] B} : (φ₁ : A → B) = φ₂ ↔ φ₁ = φ₂

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[AddCommMonoid B]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
{φ₁ φ₂ : A →ₗc[R] B}

⇑φ₁ = ⇑φ₂ ↔ φ₁ = φ₂


lemma atTop_eq_generate_of_forall_exists_le [LinearOrder α] {s : Set α} (hs : ∀ x, ∃ y ∈ s, x ≤ y) :
    (atTop : Filter α) = generate (Ici '' s)

{α : Type u_3}
[LinearOrder α]
{s : Set α}
(hs : ∀ (x : α), ∃ y ∈ s, x ≤ y)

Filter.atTop = Filter.generate (Set.Ici '' s)


/-- If `s ⊆ t`, `μ t ≤ μ s`, `μ t ≠ ∞`, and `s` is measurable, then `s =ᵐ[μ] t`. -/
theorem ae_eq_of_subset_of_measure_ge (h₁ : s ⊆ t) (h₂ : μ t ≤ μ s) (hsm : MeasurableSet s)
    (ht : μ t ≠ ∞) : s =ᵐ[μ] t

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(h₁ : s ⊆ t)
(h₂ : μ t ≤ μ s)
(hsm : MeasurableSet s)
(ht : μ t ≠ ⊤)


@[simp]
theorem singleton_val (a : α) : ({a} : Finset α).1 = {a}


theorem closure_sup_closure (x y : α) : u (l (u (l x) ⊔ u (l y))) = u (l (x ⊔ y))

{α : Type u_1}
{β : Type u_4}
[SemilatticeSup α]
[Preorder β]
{u : β → α}
(l : LowerAdjoint u)
(x y : α)

u (l.toFun (u (l.toFun x) ⊔ u (l.toFun y))) = u (l.toFun (x ⊔ y))


/-- A column partitioned matrix multipiled by a block matrix results in a column partioned matrix -/
lemma fromColumns_mul_fromBlocks (A₁ : Matrix m m₁ R) (A₂ : Matrix m m₂ R)
    (B₁₁ : Matrix m₁ n₁ R) (B₁₂ : Matrix m₁ n₂ R) (B₂₁ : Matrix m₂ n₁ R) (B₂₂ : Matrix m₂ n₂ R) :
    (fromColumns A₁ A₂) * fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ =
      fromColumns (A₁ * B₁₁ + A₂ * B₂₁) (A₁ * B₁₂ + A₂ * B₂₂)

{R : Type u_1}
{m : Type u_2}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n₁ : Type u_6}
{n₂ : Type u_7}
[Fintype m₁]
[Fintype m₂]
[Semiring R]
(A₁ : Matrix m m₁ R)
(A₂ : Matrix m m₂ R)
(B₁₁ : Matrix m₁ n₁ R)
(B₁₂ : Matrix m₁ n₂ R)
(B₂₁ : Matrix m₂ n₁ R)
(B₂₂ : Matrix m₂ n₂ R)

A₁.fromColumns A₂ * Matrix.fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ = (A₁ * B₁₁ + A₂ * B₂₁).fromColumns (A₁ * B₁₂ + A₂ * B₂₂)


@[refl]
theorem isTheta_refl (f : α → E) (l : Filter α) : f =Θ[l] f

{α : Type u_1}
{E : Type u_3}
[Norm E]
(f : α → E)
(l : Filter α)


private theorem exists_subset_restrict_nonpos' (hi₁ : MeasurableSet i) (hi₂ : s i < 0)
    (hn : ¬∀ n : ℕ, ¬s ≤[i \ ⋃ l < n, restrictNonposSeq s i l] 0) :
    ∃ j : Set α, MeasurableSet j ∧ j ⊆ i ∧ s ≤[j] 0 ∧ s j < 0

(hn :
  ¬∀ (n : ℕ),
      ¬MeasureTheory.VectorMeasure.restrict s
            (i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l) ≤
          MeasureTheory.VectorMeasure.restrict 0
            (i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l))

∃ j,
  MeasurableSet j ∧
    j ⊆ i ∧ MeasureTheory.VectorMeasure.restrict s j ≤ MeasureTheory.VectorMeasure.restrict 0 j ∧ ↑s j < 0


lemma even_div : Even (m / n) ↔ m % (2 * n) / n = 0


@[simp]
theorem update_eq_erase : f.update i 0 = f.erase i

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
(i : ι)
(f : Π₀ (i : ι), β i)

DFinsupp.update i f 0 = DFinsupp.erase i f


@[simp]
theorem constVAdd_add (v₁ v₂ : G) : constVAdd P (v₁ + v₂) = constVAdd P v₁ * constVAdd P v₂

{G : Type u_1}
(P : Type u_2)
[AddGroup G]
[AddTorsor G P]
(v₁ v₂ : G)

Equiv.constVAdd P (v₁ + v₂) = Equiv.constVAdd P v₁ * Equiv.constVAdd P v₂


lemma finiteCoproduct.ι_jointly_surjective (R : finiteCoproduct X) :
    ∃ (a : α) (r : X a), R = finiteCoproduct.ι X a r

(R : ↑(CompHausLike.finiteCoproduct X).toTop)

∃ a r, R = (CompHausLike.finiteCoproduct.ι X a) r


@[to_additive]
lemma prod_eq_one_iff_of_one_le (hf : 1 ≤ f) : ∏ i, f i = 1 ↔ f = 1

{ι : Type u_1}
{M : Type u_4}
[Fintype ι]
[OrderedAddCommMonoid M]
{f : ι → M}
(hf : 0 ≤ f)


theorem rec_heq_of_heq {C : α → Sort*} {x : C a} {y : β} (e : a = b) (h : HEq x y) :
    HEq (e ▸ x) y

{α : Sort u_2}
{a : α}
{β : Sort u_1}
{b : α}
{C : α → Sort u_1}
{x : C a}
{y : β}
(e : a = b)
(h : HEq x y)


@[simp]
theorem toOuterMeasure_bind_apply :
    (p.bind f).toOuterMeasure s = ∑' a, p a * (f a).toOuterMeasure s

{α : Type u_1}
{β : Type u_2}
(p : PMF α)
(f : α → PMF β)
(s : Set β)

(p.bind f).toOuterMeasure s = ∑' (a : α), p a * (f a).toOuterMeasure s


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

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


@[simp]
theorem surjective_comp (e : E) (f : β → γ) : Function.Surjective (f ∘ e) ↔ Function.Surjective f

{E : Sort u_1}
{α : Sort u_3}
{β : Sort u_4}
{γ : Sort u_5}
[iE : EquivLike E α β]
(e : E)
(f : β → γ)

Function.Surjective (f ∘ ⇑e) ↔ Function.Surjective f


/-- `Matrix.transpose` as an `AddEquiv` -/
@[simps apply]
def transposeAddEquiv [Add α] : Matrix m n α ≃+ Matrix n m α

(m : Type u_2)
(n : Type u_3)
(α : Type v)
[Add α]
(M : Matrix m n α)


theorem to_submodule_injective : Function.Injective ((↑) : LieSubalgebra R L → Submodule R L)

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]


theorem mul_neg_of_neg_of_pos [MulPosStrictMono α] (ha : a < 0) (hb : 0 < b) : a * b < 0

{α : Type u_1}
{a b : α}
[MulZeroClass α]
[Preorder α]
[MulPosStrictMono α]
(ha : a < 0)
(hb : 0 < b)


theorem degree_eq_zero_of_isUnit [Nontrivial R] (h : IsUnit p) : degree p = 0

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
{p : R[X]}
[Nontrivial R]
(h : IsUnit p)


@[to_additive (attr := simp)]
theorem coe_inv [Inv β] [ContinuousInv β] (f : C(α, β)) : ⇑f⁻¹ = (⇑f)⁻¹

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

⇑f⁻¹ = (⇑f)⁻¹


class IsSymmOp (α : Sort u) (β : Sort v) (op : α → α → β) : Prop where
  symm_op : ∀ a b, op a b = op b a

{α : Sort u}
{β : Sort v}
{op : α → α → β}
[self : IsSymmOp α β op]
(a b : α)


@[simp]
theorem Nat.ceil_int : (Nat.ceil : ℤ → ℕ) = Int.toNat


@[simp]
theorem coe_addMonoidHom_mk (f : α → β) (h₁ h₂ h₃) :
    ((⟨⟨f, h₁⟩, h₂, h₃⟩ : α →ₙ+* β) : α →+ β) = ⟨⟨f, h₂⟩, h₃⟩

(h₁ : ∀ (x y : α), f (x * y) = f x * f y)

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

(h₃ :
  ∀ (x y : α),
    { toFun := f, map_mul' := h₁ }.toFun (x + y) =
      { toFun := f, map_mul' := h₁ }.toFun x + { toFun := f, map_mul' := h₁ }.toFun y)

↑{ toFun := f, map_mul' := h₁, map_zero' := h₂, map_add' := h₃ } = { toFun := f, map_zero' := h₂, map_add' := h₃ }


theorem mul_matrix_apply [Fintype m] [DecidableEq m] [Semiring α] (f : l ≃. m) (M : Matrix m n α)
    (i j) : (f.toMatrix * M :) i j = Option.casesOn (f i) 0 fun fi => M fi j

{l : Type u_2}
{m : Type u_3}
{n : Type u_4}
{α : Type v}
[Fintype m]
[DecidableEq m]
[Semiring α]
(f : l ≃. m)
(M : Matrix m n α)
(i : l)
(j : n)

(f.toMatrix * M) i j = Option.casesOn (f i) 0 fun fi => M fi j


@[to_additive]
lemma nullMeasurableSet_mulSupport {E} [TopologicalSpace E] [MetrizableSpace E] [One E] {f : α → E}
    (hf : AEStronglyMeasurable f μ) : NullMeasurableSet (mulSupport f) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.NullMeasurableSet (Function.support f) μ


@[to_additive (attr := continuity, fun_prop)]
theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2

{M : Type u_3}
[TopologicalSpace M]
[Mul M]
[ContinuousMul M]


theorem lift_range (f : A →ₙₐ[R] C) :
    (lift f).range = Algebra.adjoin R (NonUnitalAlgHom.range f : Set C)

{R : Type u_1}
{A : Type u_2}
{C : Type u_3}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
[Semiring C]
[Algebra R C]
(f : A →ₙₐ[R] C)

(Unitization.lift f).range = Algebra.adjoin R ↑(NonUnitalAlgHom.range f)


/-- Two right Kan extensions are (canonically) isomorphic. -/
@[simps!]
noncomputable def rightKanExtensionUnique
    (F'' : D ⥤ H) (α' : L ⋙ F'' ⟶ F) [F''.IsRightKanExtension α'] : F' ≅ F''

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

(F'.rightKanExtensionUnique α F'' α').hom = F''.liftOfIsRightKanExtension α' F' α


theorem isIso_of_isIso_left_of_isIso_right {f g : Arrow T} (ff : f ⟶ g) [IsIso ff.left]
    [IsIso ff.right] : IsIso ff

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{f g : CategoryTheory.Arrow T}
(ff : f ⟶ g)
[CategoryTheory.IsIso ff.left]
[CategoryTheory.IsIso ff.right]


@[simp]
theorem norm_equiv_symm_single (i : ι) (b : β i) :
    ‖(WithLp.equiv p (∀ i, β i)).symm (Pi.single i b)‖ = ‖b‖

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

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


theorem nonneg_le_nonneg_of_sq_le_sq [PosMulStrictMono α] [MulPosMono α]
    {a b : α} (hb : 0 ≤ b) (h : a * a ≤ b * b) : a ≤ b

{α : Type u}
[Semiring α]
[LinearOrder α]
[PosMulStrictMono α]
[MulPosMono α]
{a b : α}
(hb : 0 ≤ b)
(h : a * a ≤ b * b)


/-- A function is `C^(n + 1)` on a domain with unique derivatives if and only if it is
differentiable there, and its derivative (expressed with `fderivWithin`) is `C^n`. -/
theorem contDiffOn_succ_iff_fderivWithin {n : ℕ} (hs : UniqueDiffOn 𝕜 s) :
    ContDiffOn 𝕜 (n + 1 : ℕ) f s ↔
      DifferentiableOn 𝕜 f s ∧ ContDiffOn 𝕜 n (fun y => fderivWithin 𝕜 f s y) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ}
(hs : UniqueDiffOn 𝕜 s)

ContDiffOn 𝕜 (↑(n + 1)) f s ↔ DifferentiableOn 𝕜 f s ∧ ContDiffOn 𝕜 (↑n) (fun y => fderivWithin 𝕜 f s y) s


theorem LocallyIntegrable.indicator (hf : LocallyIntegrable f μ) {s : Set X}
    (hs : MeasurableSet s) : LocallyIntegrable (s.indicator f) μ

(hf : MeasureTheory.LocallyIntegrable f μ)

MeasureTheory.LocallyIntegrable (s.indicator f) μ


theorem id_app (X : TopCat.{u}) (x : ↑X) : (𝟙 X : X ⟶ X) x = x


theorem Filter.map_surjOn_Iic_iff_le_map {m : α → β} :
    SurjOn (map m) (Iic F) (Iic G) ↔ G ≤ map m F

{α : Type u_1}
{β : Type u_2}
{F : Filter α}
{G : Filter β}
{m : α → β}

Set.SurjOn (Filter.map m) (Set.Iic F) (Set.Iic G) ↔ G ≤ Filter.map m F


lemma comap_cond {i : Ω' → Ω} (hi : MeasurableEmbedding i) (hi' : ∀ᵐ ω ∂μ, ω ∈ range i)
    (hs : MeasurableSet s) : comap i μ[|s] = (comap i μ)[|i ⁻¹' s]

{Ω : Type u_1}
{Ω' : Type u_2}
{m : MeasurableSpace Ω}
{m' : MeasurableSpace Ω'}
(μ : MeasureTheory.Measure Ω)
{s : Set Ω}
{i : Ω' → Ω}
(hi : MeasurableEmbedding i)
(hi' : ∀ᵐ (ω : Ω) ∂μ, ω ∈ Set.range i)
(hs : MeasurableSet s)

MeasureTheory.Measure.comap i (ProbabilityTheory.cond μ s) =
  ProbabilityTheory.cond (MeasureTheory.Measure.comap i μ) (i ⁻¹' s)


theorem exists_mem_of_ne_zero {s : Multiset α} : s ≠ 0 → ∃ a : α, a ∈ s


theorem map_swap_add [DecidableEq ι] {i j : ι} (hij : i ≠ j) :
    f (v ∘ Equiv.swap i j) + f v = 0

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
(f : M [⋀^ι]→ₗ[R] N)
(v : ι → M)
[DecidableEq ι]
{i j : ι}
(hij : i ≠ j)


theorem Summable.mul_norm {f : ι → R} {g : ι' → R} (hf : Summable fun x => ‖f x‖)
    (hg : Summable fun x => ‖g x‖) : Summable fun x : ι × ι' => ‖f x.1 * g x.2‖

{R : Type u_1}
{ι : Type u_2}
{ι' : Type u_3}
[NormedRing R]
{f : ι → R}
{g : ι' → R}
(hf : Summable fun x => ‖f x‖)
(hg : Summable fun x => ‖g x‖)


lemma four_dvd_add_or_sub_of_odd {a b : ℤ} (ha : Odd a) (hb : Odd b) :
    4 ∣ a + b ∨ 4 ∣ a - b


theorem IsGLB.mem_lowerBounds_of_tendsto [Preorder γ] [TopologicalSpace γ] [OrderClosedTopology γ]
    {f : α → γ} {s : Set α} {a : α} {b : γ} (hf : MonotoneOn f s) (ha : IsGLB s a)
    (hb : Tendsto f (𝓝[s] a) (𝓝 b)) : b ∈ lowerBounds (f '' s)

{α : Type u_1}
{γ : Type u_3}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[Preorder γ]
[TopologicalSpace γ]
[OrderClosedTopology γ]
{f : α → γ}
{s : Set α}
{a : α}
{b : γ}
(hf : MonotoneOn f s)
(ha : IsGLB s a)
(hb : Filter.Tendsto f (𝓝[s] a) (𝓝 b))


theorem swap_apply_apply (f : Perm α) (x y : α) : swap (f x) (f y) = f * swap x y * f⁻¹

{α : Type u}
[DecidableEq α]
(f : Equiv.Perm α)
(x y : α)

Equiv.swap (f x) (f y) = f * Equiv.swap x y * f⁻¹


/-- The map `(x, y) ↦ (xy, x⁻¹)` is measure-preserving. -/
@[to_additive measurePreserving_add_prod_neg_right
"The map `(x, y) ↦ (x + y, - x)` is measure-preserving."]
theorem measurePreserving_mul_prod_inv_right [IsMulRightInvariant μ] [IsMulRightInvariant ν] :
    MeasurePreserving (fun z : G × G => (z.1 * z.2, z.1⁻¹)) (μ.prod ν) (μ.prod ν)

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[MeasurableInv G]
[μ.IsMulRightInvariant]
[ν.IsMulRightInvariant]

MeasureTheory.MeasurePreserving (fun z => (z.1 * z.2, z.1⁻¹)) (μ.prod ν) (μ.prod ν)


theorem monotone_iff {f : WithTop α → β} :
    Monotone f ↔ Monotone (fun (a : α) => f a) ∧ ∀ x : α, f x ≤ f ⊤

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : WithTop α → β}

Monotone f ↔ (Monotone fun a => f ↑a) ∧ ∀ (x : α), f ↑x ≤ f ⊤


theorem not_isOpen_singleton (x : X) [NeBot (𝓝[≠] x)] : ¬IsOpen ({x} : Set X)

{X : Type u}
[TopologicalSpace X]
(x : X)
[(𝓝[≠] x).NeBot]


theorem cardinal_lt_aleph0_of_finiteDimensional [Finite K] [Module.Free K V] [Module.Finite K V] :
    #V < ℵ₀

(K : Type u)
(V : Type v)
[Ring K]
[StrongRankCondition K]
[AddCommGroup V]
[Module K V]
[Finite K]
[Module.Free K V]
[Module.Finite K V]


lemma IsAntichain.le_infSum (h𝒜 : IsAntichain (· ⊆ ·) (𝒜 : Set (Finset α))) (h𝒜₀ : ∅ ∉ 𝒜) :
    ∑ s ∈ 𝒜, ((card α).choose s.card : ℚ)⁻¹ ≤ infSum 𝒜

(h𝒜 : IsAntichain (fun x x_1 => x ⊆ x_1) ↑𝒜)

(h𝒜₀ : ∅ ∉ 𝒜)

∑ s ∈ 𝒜, (↑((Fintype.card α).choose s.card))⁻¹ ≤ AhlswedeZhang.infSum 𝒜


@[simp]
theorem arccos_eq_zero {x} : arccos x = 0 ↔ 1 ≤ x


/-- `MeasureTheory.SignedMeasure.toJordanDecomposition` and
`MeasureTheory.JordanDecomposition.toSignedMeasure` form an `Equiv`. -/
@[simps apply symm_apply]
def toJordanDecompositionEquiv (α : Type*) [MeasurableSpace α] :
    SignedMeasure α ≃ JordanDecomposition α

(α : Type u_3)
[MeasurableSpace α]
(s : MeasureTheory.SignedMeasure α)

(MeasureTheory.SignedMeasure.toJordanDecompositionEquiv α) s = s.toJordanDecomposition


/-- If `M` and `N` are linearly disjoint, if `N` is flat,
if any two elements of `↥(M ⊓ N)` are commutative, then the rank of `↥(M ⊓ N)` is at most one. -/
theorem rank_inf_le_one_of_commute_of_flat_right [Module.Flat R N]
    (hc : ∀ (m n : ↥(M ⊓ N)), Commute m.1 n.1) : Module.rank R ↥(M ⊓ N) ≤ 1

(hc : ∀ (m n : ↥(M ⊓ N)), Commute ↑m ↑n)


theorem interior_preimage_subset_preimage_interior (hf : IsOpenMap f) {s : Set Y} :
    interior (f ⁻¹' s) ⊆ f ⁻¹' interior s

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : IsOpenMap f)
{s : Set Y}


/-- If `A` is subterminal, the unique morphism from it to the terminal object is a monomorphism.
The converse of `isSubterminal_of_mono_terminal_from`.
-/
theorem IsSubterminal.mono_terminal_from [HasTerminal C] (hA : IsSubterminal A) :
    Mono (terminal.from A)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{A : C}
[CategoryTheory.Limits.HasTerminal C]
(hA : CategoryTheory.IsSubterminal A)


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

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

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


theorem seq_assoc (x : Comp F G α) (f : Comp F G (α → β)) (g : Comp F G (β → γ)) :
    g <*> (f <*> x) = @Function.comp α β γ <$> g <*> f <*> x

{F : Type u → Type w}
{G : Type v → Type u}
[Applicative F]
[Applicative G]
[LawfulApplicative F]
[LawfulApplicative G]
{α β γ : Type v}
(x : Functor.Comp F G α)
(f : Functor.Comp F G (α → β))
(g : Functor.Comp F G (β → γ))

(Seq.seq g fun x_1 => Seq.seq f fun x_2 => x) = Seq.seq (Seq.seq (Function.comp <$> g) fun x => f) fun x_1 => x


/-- An induction principle for closure membership. If `p` holds for all elements of `s`, and
is preserved under multiplication, then `p` holds for all elements of the closure of `s`. -/
@[to_additive (attr := elab_as_elim) "An induction principle for additive closure membership. If `p`
  holds for all elements of `s`, and is preserved under addition, then `p` holds for all
  elements of the additive closure of `s`."]
theorem closure_induction {p : M → Prop} {x} (h : x ∈ closure s) (mem : ∀ x ∈ s, p x)
    (mul : ∀ x y, p x → p y → p (x * y)) : p x

(mul : ∀ (x y : M), p x → p y → p (x * y))


/-- If `h : X → Y` is a homeomorphism, `s` is σ-compact iff `h(s)` is. -/
@[simp]
theorem isSigmaCompact_image {s : Set X} (h : X ≃ₜ Y) :
    IsSigmaCompact (h '' s) ↔ IsSigmaCompact s

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
(h : X ≃ₜ Y)

IsSigmaCompact (⇑h '' s) ↔ IsSigmaCompact s


@[to_additive]
theorem BddAbove.inv (h : BddAbove s) : BddBelow s⁻¹

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

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


theorem Wbtw.trans_sbtw_right [NoZeroSMulDivisors R V] {w x y z : P} (h₁ : Wbtw R w x z)
    (h₂ : Sbtw R x y z) : Sbtw R w y z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[NoZeroSMulDivisors R V]
{w x y z : P}
(h₁ : Wbtw R w x z)
(h₂ : Sbtw R x y z)


theorem finrank_eq_four [StrongRankCondition R] : FiniteDimensional.finrank R ℍ[R] = 4

{R : Type u_3}
[CommRing R]
[StrongRankCondition R]


/-- Tagged prepartition with single box and prescribed tag. -/
@[simps! (config := .asFn)]
def single (I J : Box ι) (hJ : J ≤ I) (x : ι → ℝ) (h : x ∈ Box.Icc I) : TaggedPrepartition I

{ι : Type u_1}
(I J : BoxIntegral.Box ι)
(hJ : J ≤ I)
(x : ι → ℝ)
(h : x ∈ BoxIntegral.Box.Icc I)

(BoxIntegral.TaggedPrepartition.single I J hJ x h).boxes.val = {J}


/-- Adding an open immersion into an open cover gives another open cover. -/
@[simps]
def OpenCover.add {X Y : Scheme.{u}} (𝒰 : X.OpenCover) (f : Y ⟶ X) [IsOpenImmersion f] :
    X.OpenCover

{X Y : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : Y ⟶ X)
[AlgebraicGeometry.IsOpenImmersion f]


theorem contDiff_one_iff_fderiv : ContDiff 𝕜 1 f ↔ Differentiable 𝕜 f ∧ Continuous (fderiv 𝕜 f)

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


@[simp]
theorem Subsingleton.stronglyMeasurable {α β} [MeasurableSpace α] [TopologicalSpace β]
    [Subsingleton β] (f : α → β) : StronglyMeasurable f

{α : Type u_5}
{β : Type u_6}
[MeasurableSpace α]
[TopologicalSpace β]
[Subsingleton β]
(f : α → β)


theorem init_zsmul (m : ℤ) (x : 𝕎 R) (n : ℕ) : init n (m • x) = init n (m • init n x)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{R : Type u_1}
[CommRing R]
(m : ℤ)
(x : 𝕎 R)
(n : ℕ)

WittVector.init n (m • x) = WittVector.init n (m • WittVector.init n x)


/-- The gamma pdf is positive for all positive reals -/
lemma gammaPDFReal_pos {x a r : ℝ} (ha : 0 < a) (hr : 0 < r) (hx : 0 < x) :
    0 < gammaPDFReal a r x

0 < ProbabilityTheory.gammaPDFReal a r x


@[simp]
theorem eval₂_at_natCast {S : Type*} [Semiring S] (f : R →+* S) (n : ℕ) :
    p.eval₂ f n = f (p.eval n)

{R : Type u}
[Semiring R]
{p : R[X]}
{S : Type u_1}
[Semiring S]
(f : R →+* S)
(n : ℕ)

Polynomial.eval₂ f (↑n) p = f (Polynomial.eval (↑n) p)


@[simp, norm_cast]
theorem coe_centralizer (s : Set R) : (centralizer s : Set R) = s.centralizer

↑(Subring.centralizer s) = s.centralizer


theorem dvd_normalize_iff {a b : α} : a ∣ normalize b ↔ a ∣ b

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
{a b : α}


theorem zero_kroneckerTMul (B : Matrix n p β) : (0 : Matrix l m α) ⊗ₖₜ[R] B = 0

(R : Type u_1)
{α : Type u_2}
{β : Type u_4}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
[CommSemiring R]
[AddCommMonoid α]
[AddCommMonoid β]
[Module R α]
[Module R β]
(B : Matrix n p β)

Matrix.kroneckerMap (TensorProduct.tmul R) 0 B = 0


/-- Given a MonoidHom `f : M →* N` and Submonoid `S ⊆ M` such that `f(S) ⊆ Nˣ`, for all
`y, z ∈ S`, we have `(f y)⁻¹ = (f z)⁻¹ → f y = f z`. -/
@[to_additive
    "Given an AddMonoidHom `f : M →+ N` and Submonoid `S ⊆ M` such that
`f(S) ⊆ AddUnits N`, for all `y, z ∈ S`, we have `- (f y) = - (f z) → f y = f z`."]
theorem inv_inj {f : M →* N} (hf : ∀ y : S, IsUnit (f y)) {y z : S}
    (h : (IsUnit.liftRight (f.restrict S) hf y)⁻¹ = (IsUnit.liftRight (f.restrict S) hf z)⁻¹) :
      f y = f z

(h : ((IsUnit.liftRight (f.restrict S) hf) y)⁻¹ = ((IsUnit.liftRight (f.restrict S) hf) z)⁻¹)


@[csimp] theorem sigma_eq_sigmaTR : @List.sigma = @sigmaTR


@[simp] theorem getElem_dropLast : ∀ (xs : List α) (i : Nat) (h : i < xs.dropLast.length),
    xs.dropLast[i] = xs[i]'(Nat.lt_of_lt_of_le h (length_dropLast .. ▸ Nat.pred_le _))

{α : Type u_1}
(xs : List α)
(i : Nat)
(h : i < xs.dropLast.length)


theorem mem_nhds_subtype (s : Set X) (x : { x // x ∈ s }) (t : Set { x // x ∈ s }) :
    t ∈ 𝓝 x ↔ ∃ u ∈ 𝓝 (x : X), Subtype.val ⁻¹' u ⊆ t

{X : Type u}
[TopologicalSpace X]
(s : Set X)
(x : { x // x ∈ s })
(t : Set { x // x ∈ s })

t ∈ 𝓝 x ↔ ∃ u ∈ 𝓝 ↑x, Subtype.val ⁻¹' u ⊆ t


@[simp]
lemma comp_mk_id [HasSmallLocalizedHom.{w} W X Y] [HasSmallLocalizedHom.{w} W Y Y]
    (α : SmallHom.{w} W X Y)  :
    α.comp (mk W (𝟙 Y)) = α

[CategoryTheory.Localization.HasSmallLocalizedHom W X Y]

[CategoryTheory.Localization.HasSmallLocalizedHom W Y Y]

(α : CategoryTheory.Localization.SmallHom W X Y)

α.comp (CategoryTheory.Localization.SmallHom.mk W (CategoryTheory.CategoryStruct.id Y)) = α


lemma vecMul_conjTranspose_mul_self_eq_zero (A : Matrix m n R) (v : n → R) :
    v ᵥ* (Aᴴ * A) = 0 ↔ v ᵥ* Aᴴ = 0

{m : Type u_1}
{n : Type u_2}
{R : Type u_4}
[Fintype m]
[Fintype n]
[PartialOrder R]
[NonUnitalRing R]
[StarRing R]
[StarOrderedRing R]
[NoZeroDivisors R]
(A : Matrix m n R)
(v : n → R)

Matrix.vecMul v (A.conjTranspose * A) = 0 ↔ Matrix.vecMul v A.conjTranspose = 0


theorem ContMDiffAt.contMDiffWithinAt (hf : ContMDiffAt I I' n f x) :
    ContMDiffWithinAt I I' n f s x

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


theorem Periodic.add_antiperiod_eq [AddGroup α] [Neg β] (h1 : Periodic f c₁)
    (h2 : Antiperiodic f c₂) : f (c₁ + c₂) = -f 0

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


theorem neg_toSimpleFunc (f : Lp.simpleFunc E p μ) : toSimpleFunc (-f) =ᵐ[μ] -toSimpleFunc f

(f : ↥(MeasureTheory.Lp.simpleFunc E p μ))

↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc (-f)) =ᵐ[μ] -↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc f)


theorem GoodProducts.finsupp_sum_mem_span_eval {a : I} {as : List I}
    (ha : List.Chain' (· > ·) (a :: as)) {c : Products I →₀ ℤ}
    (hc : (c.support : Set (Products I)) ⊆ {m | m.val ≤ as}) :
    (Finsupp.sum c fun a_1 b ↦ e (π C (· ∈ s)) a * b • Products.eval (π C (· ∈ s)) a_1) ∈
      Submodule.span ℤ (Products.eval (π C (· ∈ s)) '' {m | m.val ≤ a :: as})

(ha : List.Chain' (fun x x_1 => x > x_1) (a :: as))

{c : Profinite.NobelingProof.Products I →₀ ℤ}

(c.sum fun a_1 b =>
    Profinite.NobelingProof.e (Profinite.NobelingProof.π C fun x => x ∈ s) a *
      b • Profinite.NobelingProof.Products.eval (Profinite.NobelingProof.π C fun x => x ∈ s) a_1) ∈
  Submodule.span ℤ
    (Profinite.NobelingProof.Products.eval (Profinite.NobelingProof.π C fun x => x ∈ s) '' {m | ↑m ≤ a :: as})


theorem multiplicity_le_multiplicity_iff {a b : α} {c d : β} :
    multiplicity a b ≤ multiplicity c d ↔ ∀ n : ℕ, a ^ n ∣ b → c ^ n ∣ d

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

multiplicity a b ≤ multiplicity c d ↔ ∀ (n : ℕ), a ^ n ∣ b → c ^ n ∣ d


@[simp, norm_cast]
theorem coe_zpow (hr : r ≠ 0) (n : ℤ) : (↑(r ^ n) : ℝ≥0∞) = (r : ℝ≥0∞) ^ n


@[simp]
theorem one_coe_eq_one : ⇑(1 : ModularForm Γ 0) = 1


@[simp]
theorem sup_sdiff_right_self : (a ⊔ b) \ b = a \ b

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


/-- A subspace is complement to its orthogonal complement with respect to some reflexive bilinear
form if and only if that bilinear form restricted on to the subspace is nondegenerate. -/
theorem restrict_nondegenerate_iff_isCompl_orthogonal
    (b₁ : B.IsRefl) : (B.restrict W).Nondegenerate ↔ IsCompl W (B.orthogonal W)

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{B : LinearMap.BilinForm K V}
{W : Submodule K V}
(b₁ : B.IsRefl)


theorem measurable_sSup {ι} {f : ι → δ → α} {s : Set ι} (hs : s.Countable)
    (hf : ∀ i ∈ s, Measurable (f i)) :
    Measurable fun x => sSup ((fun i => f i x) '' s)

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[MeasurableSpace δ]
[ConditionallyCompleteLinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
{ι : Type u_5}
{f : ι → δ → α}
{s : Set ι}
(hs : s.Countable)
(hf : ∀ i ∈ s, Measurable (f i))


@[simp]
theorem sup_apply (f g : SupBotHom α β) (a : α) : (f ⊔ g) a = f a ⊔ g a

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Bot α]
[SemilatticeSup β]
[OrderBot β]
(f g : SupBotHom α β)
(a : α)


@[simp]
theorem Composition.toCompositionAsSet_blocks (c : Composition n) :
    c.toCompositionAsSet.blocks = c.blocks


/-- A generalized Boolean algebra is a distributive lattice with `⊥` and a relative complement
operation `\` (called `sdiff`, after "set difference") satisfying `(a ⊓ b) ⊔ (a \ b) = a` and
`(a ⊓ b) ⊓ (a \ b) = ⊥`, i.e. `a \ b` is the complement of `b` in `a`.

This is a generalization of Boolean algebras which applies to `Finset α` for arbitrary
(not-necessarily-`Fintype`) `α`. -/
class GeneralizedBooleanAlgebra (α : Type u) extends DistribLattice α, SDiff α, Bot α where
  /-- For any `a`, `b`, `(a ⊓ b) ⊔ (a / b) = a` -/
  sup_inf_sdiff : ∀ a b : α, a ⊓ b ⊔ a \ b = a
  /-- For any `a`, `b`, `(a ⊓ b) ⊓ (a / b) = ⊥` -/
  inf_inf_sdiff : ∀ a b : α, a ⊓ b ⊓ a \ b = ⊥

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


theorem HasSum.matrix_transpose {f : X → Matrix m n R} {a : Matrix m n R} (hf : HasSum f a) :
    HasSum (fun x => (f x)ᵀ) aᵀ

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{R : Type u_8}
[AddCommMonoid R]
[TopologicalSpace R]
{f : X → Matrix m n R}
{a : Matrix m n R}
(hf : HasSum f a)


/-- Given an algebra morphism whose carrier part is a monomorphism, we get an algebra monomorphism.
-/
theorem algebra_mono_of_mono {X Y : Algebra T} (f : X ⟶ Y) [h : Mono f.f] : Mono f

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


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

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


/-- The triangle in `CochainComplex C ℤ` attached to a degreewise split short exact sequence
of cochain complexes. -/
@[simps! obj₁ obj₂ obj₃ mor₁ mor₂ mor₃]
def triangleOfDegreewiseSplit : Triangle (CochainComplex C ℤ)

(S : CategoryTheory.ShortComplex (CochainComplex C ℤ))

(σ : (n : ℤ) → (S.map (HomologicalComplex.eval C (ComplexShape.up ℤ) n)).Splitting)

(CochainComplex.triangleOfDegreewiseSplit S σ).mor₂ = S.g


@[simp]
theorem one_divp (u : αˣ) : 1 /ₚ u = ↑u⁻¹


@[simp] theorem add_mul_mod_self_left (x y z : Nat) : (x + y * z) % y = x % y


theorem injective (f : r ↪r s) : Injective f

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


protected theorem _root_.IsMin.isSuccLimit : IsMin a → IsSuccLimit a


theorem CountablyGenerated.comap [m : MeasurableSpace β] [h : CountablyGenerated β] (f : α → β) :
    @CountablyGenerated α (.comap f m)

[h : MeasurableSpace.CountablyGenerated β]


theorem setOf_sOppSide_eq_image2 {s : AffineSubspace R P} {x p : P} (hx : x ∉ s) (hp : p ∈ s) :
    { y | s.SOppSide x y } = Set.image2 (fun (t : R) q => t • (x -ᵥ p) +ᵥ q) (Set.Iio 0) s

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x p : P}
(hx : x ∉ s)
(hp : p ∈ s)

{y | s.SOppSide x y} = Set.image2 (fun t q => t • (x -ᵥ p) +ᵥ q) (Set.Iio 0) ↑s


@[to_additive]
protected theorem mul_eq_one_iff : f * g = 1 ↔ ∃ a b, f = pure a ∧ g = pure b ∧ a * b = 1

{α : Type u_2}
[DivisionMonoid α]
{f g : Filter α}


@[to_additive sum_lt_sum]
theorem prod_lt_prod' (hle : ∀ i ∈ s, f i ≤ g i) (hlt : ∃ i ∈ s, f i < g i) :
    ∏ i ∈ s, f i < ∏ i ∈ s, g i

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelCommMonoid M]
{f g : ι → M}
{s : Finset ι}
(hle : ∀ i ∈ s, f i ≤ g i)
(hlt : ∃ i ∈ s, f i < g i)


@[simp] theorem toFin_neg (x : BitVec n) :
    (-x).toFin = Fin.ofNat' (2^n - x.toNat) (Nat.two_pow_pos _)

(-x).toFin = Fin.ofNat' (2 ^ n - x.toNat) ⋯


@[to_additive (attr := simp) prod_apply]
theorem prod_apply (f : M →* N) (g : M →* P) (x) : f.prod g x = (f x, g x)

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


theorem tail_eq_tailD (l) : @tail α l = tailD l []


theorem neg_le_iff {x y : PGame} : -y ≤ x ↔ -x ≤ y


lemma inrX_nullHomotopy_f (j : ι) :
    inrX K j ≫ (nullHomotopicMap K).f j = inrX K j ≫ (π K ≫ ι₀ K - 𝟙 _).f j

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

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

HomologicalComplex.cylinder.inrX K j ≫ (HomologicalComplex.cylinder.πCompι₀Homotopy.nullHomotopicMap K).f j =
  HomologicalComplex.cylinder.inrX K j ≫
    (HomologicalComplex.cylinder.π K ≫ HomologicalComplex.cylinder.ι₀ K - 𝟙 K.cylinder).f j


@[to_additive]
theorem prod_hom₂ (l : List ι) (f : M → N → P) (hf : ∀ a b c d, f (a * b) (c * d) = f a c * f b d)
    (hf' : f 1 1 = 1) (f₁ : ι → M) (f₂ : ι → N) :
    (l.map fun i => f (f₁ i) (f₂ i)).prod = f (l.map f₁).prod (l.map f₂).prod

(hf : ∀ (a b : M) (c d : N), f (a + b) (c + d) = f a c + f b d)

(List.map (fun i => f (f₁ i) (f₂ i)) l).sum = f (List.map f₁ l).sum (List.map f₂ l).sum


/-- A sum is infinite iff one term is infinite. -/
lemma sum_eq_top_iff : ∑ i ∈ s, f i = ⊤ ↔ ∃ i ∈ s, f i = ⊤

{ι : Type u_1}
{α : Type u_2}
[AddCommMonoid α]
{s : Finset ι}
{f : ι → WithTop α}


nonrec theorem _root_.Function.Involutive.list_map {f : α → α}
    (h : Involutive f) : Involutive (map f)

{α : Type u}
{f : α → α}
(h : Function.Involutive f)


theorem insert_def (x : α) (s : Set α) : insert x s = { y | y = x ∨ y ∈ s }


@[simp]
theorem mul_lt_mul_right [MulPosStrictMono α] [MulPosReflectLT α] (a0 : 0 < a) :
    b * a < c * a ↔ b < c

{α : Type u_1}
{a b c : α}
[Mul α]
[Zero α]
[Preorder α]
[MulPosStrictMono α]
[MulPosReflectLT α]
(a0 : 0 < a)


theorem sumInv_pqr (p q r : ℕ+) : sumInv {p, q, r} = (p : ℚ)⁻¹ + (q : ℚ)⁻¹ + (r : ℚ)⁻¹

ADEInequality.sumInv {p, q, r} = (↑↑p)⁻¹ + (↑↑q)⁻¹ + (↑↑r)⁻¹


protected theorem AnalyticAt.continuousAt (hf : AnalyticAt 𝕜 f x) : ContinuousAt f x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
(hf : AnalyticAt 𝕜 f x)


lemma cexp_neg_quadratic_isLittleO_abs_rpow_cocompact {a : ℂ} (ha : a.re < 0) (b : ℂ) (s : ℝ) :
    (fun x : ℝ ↦ cexp (a * x ^ 2 + b * x)) =o[cocompact ℝ] (|·| ^ s)

(fun x => cexp (a * ↑x ^ 2 + b * ↑x)) =o[Filter.cocompact ℝ] fun x => |x| ^ s


@[simp] theorem mul_emod_left (a b : Int) : (a * b) % b = 0


/-- Two functions monovary iff the rearrangement inequality holds. -/
lemma monovaryOn_iff_mul_rearrangement :
    MonovaryOn f g s ↔
      ∀ ⦃i⦄, i ∈ s → ∀ ⦃j⦄, j ∈ s → f i * g j + f j * g i ≤ f i * g i + f j * g j

{ι : Type u_1}
{α : Type u_2}
[LinearOrderedRing α]
{f g : ι → α}
{s : Set ι}

MonovaryOn f g s ↔ ∀ ⦃i : ι⦄, i ∈ s → ∀ ⦃j : ι⦄, j ∈ s → f i * g j + f j * g i ≤ f i * g i + f j * g j


theorem AbsolutelyContinuous.ae_eq (h : μ ≪ ν) {f g : α → δ} (h' : f =ᵐ[ν] g) : f =ᵐ[μ] g

{α : Type u_1}
{δ : Type u_4}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(h : μ.AbsolutelyContinuous ν)
{f g : α → δ}
(h' : f =ᵐ[ν] g)


theorem CNF_of_lt {b o : Ordinal} (ho : o ≠ 0) (hb : o < b) : CNF b o = [⟨0, o⟩]

{b o : Ordinal.{u_1}}
(ho : o ≠ 0)
(hb : o < b)


theorem IsMinFilter.min (hf : IsMinFilter f l a) (hg : IsMinFilter g l a) :
    IsMinFilter (fun x => min (f x) (g x)) l a

{α : Type u}
{β : Type v}
[LinearOrder β]
{f g : α → β}
{a : α}
{l : Filter α}
(hf : IsMinFilter f l a)
(hg : IsMinFilter g l a)


theorem dvd_def : a ∣ b ↔ ∃ c, b = a * c


theorem IsTheta.tendsto_zero_iff (h : f'' =Θ[l] g'') :
    Tendsto f'' l (𝓝 0) ↔ Tendsto g'' l (𝓝 0)

{α : Type u_1}
{E'' : Type u_9}
{F'' : Type u_10}
[NormedAddCommGroup E'']
[NormedAddCommGroup F'']
{f'' : α → E''}
{g'' : α → F''}
{l : Filter α}
(h : f'' =Θ[l] g'')

Filter.Tendsto f'' l (𝓝 0) ↔ Filter.Tendsto g'' l (𝓝 0)


theorem ContinuousOn.continuousAt {f : α → β} {s : Set α} {x : α} (h : ContinuousOn f s)
    (hx : s ∈ 𝓝 x) : ContinuousAt f x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
{x : α}
(h : ContinuousOn f s)
(hx : s ∈ 𝓝 x)


theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f

[hμm : MeasureTheory.SigmaFinite (μ.trim hm)]

μ[f|m] =ᵐ[μ] ↑↑(MeasureTheory.condexpL1 hm μ f)


@[to_additive (attr := simp)]
theorem preimage_mul_right_ball [IsometricSMul Gᵐᵒᵖ G] (a b : G) (r : ℝ) :
    (fun x => x * a) ⁻¹' ball b r = ball (b / a) r

{G : Type v}
[AddGroup G]
[PseudoMetricSpace G]
[IsometricVAdd Gᵃᵒᵖ G]
(a b : G)
(r : ℝ)

(fun x => x + a) ⁻¹' Metric.ball b r = Metric.ball (b - a) r


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

(G : Type v)
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul G G]
[IsometricSMul Gᵐᵒᵖ G]

(IsometryEquiv.inv G).symm = IsometryEquiv.inv G