@[simp]
theorem colimit_smul_mk_eq (r : R) (x : Σ j, F.obj j) : r • M.mk F x = M.mk F ⟨x.1, r • x.2⟩

{R : Type u}
[Ring R]
{J : Type v}
[CategoryTheory.SmallCategory J]
[CategoryTheory.IsFiltered J]
(F : J ⥤ ModuleCatMax R)
(r : R)
(x : (j : J) × ↑(F.obj j))

r • ModuleCat.FilteredColimits.M.mk F x = ModuleCat.FilteredColimits.M.mk F ⟨x.fst, r • x.snd⟩


@[simp]
theorem cos_pi_div_two : cos (π / 2) = 0


/-- A bounded convergence theorem for a finite measure:
If bounded continuous non-negative functions are uniformly bounded by a constant and tend to a
limit, then their integrals against the finite measure tend to the integral of the limit.
This formulation assumes:
 * the functions tend to a limit along a countably generated filter;
 * the limit is in the almost everywhere sense;
 * boundedness holds almost everywhere;
 * integration is the pairing against non-negative continuous test functions
   (`MeasureTheory.FiniteMeasure.testAgainstNN`).

A related result using `MeasureTheory.lintegral` for integration is
`MeasureTheory.FiniteMeasure.tendsto_lintegral_nn_filter_of_le_const`.
-/
theorem tendsto_testAgainstNN_filter_of_le_const {ι : Type*} {L : Filter ι}
    [L.IsCountablyGenerated] {μ : FiniteMeasure Ω} {fs : ι → Ω →ᵇ ℝ≥0} {c : ℝ≥0}
    (fs_le_const : ∀ᶠ i in L, ∀ᵐ ω : Ω ∂(μ : Measure Ω), fs i ω ≤ c) {f : Ω →ᵇ ℝ≥0}
    (fs_lim : ∀ᵐ ω : Ω ∂(μ : Measure Ω), Tendsto (fun i => fs i ω) L (𝓝 (f ω))) :
    Tendsto (fun i => μ.testAgainstNN (fs i)) L (𝓝 (μ.testAgainstNN f))

{fs : ι → Ω →ᵇ ℝ≥0}

(fs_le_const : ∀ᶠ (i : ι) in L, ∀ᵐ (ω : Ω) ∂↑μ, (fs i) ω ≤ c)

{f : Ω →ᵇ ℝ≥0}

(fs_lim : ∀ᵐ (ω : Ω) ∂↑μ, Filter.Tendsto (fun i => (fs i) ω) L (𝓝 (f ω)))

Filter.Tendsto (fun i => μ.testAgainstNN (fs i)) L (𝓝 (μ.testAgainstNN f))


theorem mk_le_of_le_val {b : Fin n} {a : Nat} (h : a ≤ b) :
    (⟨a, Nat.lt_of_le_of_lt h b.is_lt⟩ : Fin n) ≤ b

{n : Nat}
{b : Fin n}
{a : Nat}
(h : a ≤ ↑b)


theorem snd_pred_mem_erase_of_mem_left {b : Board} {m : ℤ × ℤ} (h : m ∈ left b) :
    (m.1, m.2 - 1) ∈ b.erase m

(h : m ∈ SetTheory.PGame.Domineering.left b)


@[simp]
theorem uncurry_curry (f : α × β → φ) : uncurry (curry f) = f

{α : Type u₁}
{β : Type u₂}
{φ : Type u₃}
(f : α × β → φ)


theorem union_sdiff_cancel_left (h : Disjoint s t) : (s ∪ t) \ s = t

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


lemma iInf_coe_lt_top : ⨅ i, (f i : ℝ≥0∞) < ⊤ ↔ Nonempty ι


/-- A preorder is a reflexive, transitive relation `≤` with `a < b` defined in the obvious way. -/
class Preorder (α : Type u) extends LE α, LT α where
  le_refl : ∀ a : α, a ≤ a
  le_trans : ∀ a b c : α, a ≤ b → b ≤ c → a ≤ c
  lt := fun a b => a ≤ b ∧ ¬b ≤ a
  lt_iff_le_not_le : ∀ a b : α, a < b ↔ a ≤ b ∧ ¬b ≤ a := by intros; rfl

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


/-- The `ℤ`-submodule spanned by a single element `a` is isomorphic to the quotient of `ℤ`
by the ideal generated by the order of `a`. -/
@[simps!] noncomputable def intSpanEquivQuotAddOrderOf (a : A) :
    (ℤ ∙ a) ≃ₗ[ℤ] ℤ ⧸ Ideal.span {(addOrderOf a : ℤ)}

∀ (a_1 : ℤ ⧸ Ideal.span {↑(addOrderOf a)}),
  ↑((CharacterModule.intSpanEquivQuotAddOrderOf a).symm a_1) =
    ↑((LinearMap.toSpanSingleton ℤ A a).quotKerEquivRange
        (((LinearMap.ker (LinearMap.toSpanSingleton ℤ A a)).quotEquivOfEq (Ideal.span {↑(addOrderOf a)}) ⋯).symm a_1))


protected theorem isUnit_iff (f : R ≃+* S) {a} : IsUnit (f a) ↔ IsUnit a

{R : Type u_4}
{S : Type u_5}
[Semiring R]
[Semiring S]
(f : R ≃+* S)
{a : R}


theorem mk_toNat_eq_card [Fintype α] : toNat #α = Fintype.card α

Cardinal.toNat (Cardinal.mk α) = Fintype.card α


theorem edges_takeUntil_subset {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.takeUntil u h).edges ⊆ p.edges

{V : Type u}
{G : SimpleGraph V}
[DecidableEq V]
{u v w : V}
(p : G.Walk v w)
(h : u ∈ p.support)


protected theorem coe_eq_zero {x : S} : (x : A) = 0 ↔ x = 0

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


theorem Primrec₂.comp {f : β → γ → σ} {g : α → β} {h : α → γ} (hf : Primrec₂ f) (hg : Primrec g)
    (hh : Primrec h) : Primrec fun a => f (g a) (h a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{σ : Type u_5}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
[Primcodable σ]
{f : β → γ → σ}
{g : α → β}
{h : α → γ}
(hf : Primrec₂ f)
(hg : Primrec g)
(hh : Primrec h)


@[simp, mfld_simps]
theorem partialHomeomorphSubtypeCoe_coe : (s.partialHomeomorphSubtypeCoe hs : s → X) = (↑)

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

↑(s.partialHomeomorphSubtypeCoe hs) = Subtype.val


theorem mk_list_eq_aleph0 (α : Type u) [Countable α] [Nonempty α] : #(List α) = ℵ₀


theorem derivative_X_sub_C_pow (c : R) (m : ℕ) :
    derivative ((X - C c) ^ m) = C (m : R) * (X - C c) ^ (m - 1)

{R : Type u}
[CommRing R]
(c : R)
(m : ℕ)

Polynomial.derivative ((Polynomial.X - Polynomial.C c) ^ m) =
  Polynomial.C ↑m * (Polynomial.X - Polynomial.C c) ^ (m - 1)


lemma bot_div_of_neg_ne_bot {a : EReal} (h : a < 0) (h' : a ≠ ⊥) : ⊥ / a = ⊤


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

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

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


theorem ext' (h : (p : Set B) = q) : p = q

{A : Type u_1}
{B : Type u_2}
[i : SetLike A B]
{p q : A}
(h : ↑p = ↑q)


theorem nat_rec₁ {f : ℕ → α → α} (a : α) (hf : Primrec₂ f) : Primrec (Nat.rec a f)

{α : Type u_1}
[Primcodable α]
{f : ℕ → α → α}
(a : α)
(hf : Primrec₂ f)


@[trans]
protected theorem Equiv.trans {x y z} (h1 : Equiv x y) (h2 : Equiv y z) : Equiv x z

{x : PSet}
{y : PSet}
{z : PSet}
(h1 : x.Equiv y)
(h2 : y.Equiv z)


/-- Identity map as a `BialgHom`. -/
@[simps!] protected def id : A →ₐc[R] A

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


protected theorem IsClique.map (h : G.IsClique s) {f : α ↪ β} : (G.map f).IsClique (f '' s)

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{s : Set α}
(h : G.IsClique s)
{f : α ↪ β}

(SimpleGraph.map f G).IsClique (⇑f '' s)


/-- The composition of a binary polynomial function
 with a unary polynomial function in the first argument is polynomial. -/
theorem compLeft {g f} [IsPoly₂ p g] [IsPoly p f] :
    IsPoly₂ p fun _R _Rcr x y => g (f x) y

{g : ⦃R : Type u_3⦄ → [inst : CommRing R] → WittVector p R → WittVector p R → WittVector p R}

{f : ⦃R : Type u_3⦄ → [inst : CommRing R] → WittVector p R → WittVector p R}

WittVector.IsPoly₂ p fun _R _Rcr x y => g (f x) y


theorem ofPowerSeries_powerSeriesPart (x : LaurentSeries R) :
    ofPowerSeries ℤ R x.powerSeriesPart = single (-x.order) 1 * x

{R : Type u_1}
[Semiring R]
(x : LaurentSeries R)

(HahnSeries.ofPowerSeries ℤ R) x.powerSeriesPart = (HahnSeries.single (-HahnSeries.order x)) 1 * x


lemma continuousAt_toReal (hx : x ≠ ∞) : ContinuousAt ENNReal.toReal x


@[to_additive] lemma inv_smul_eq_iff : g⁻¹ • a = b ↔ a = g • b

{G : Type u_3}
{α : Type u_7}
[AddGroup G]
[AddAction G α]
{g : G}
{a b : α}


/-- The inner product of a linear combination of a set of orthonormal vectors with one of those
vectors picks out the coefficient of that vector. -/
theorem Orthonormal.inner_left_fintype [Fintype ι] {v : ι → E} (hv : Orthonormal 𝕜 v) (l : ι → 𝕜)
    (i : ι) : ⟪∑ i : ι, l i • v i, v i⟫ = conj (l i)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
[Fintype ι]
{v : ι → E}
(hv : Orthonormal 𝕜 v)
(l : ι → 𝕜)
(i : ι)

⟪∑ i : ι, l i • v i, v i⟫_𝕜 = (starRingEnd 𝕜) (l i)


@[simp] lemma toDirectLimit_tmul_of
    {i : ι} (g : G i) (m : M) :
    (toDirectLimit f M <| (of _ _ G f i g) ⊗ₜ m) = (of _ _ _ _ i (g ⊗ₜ m))

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

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


theorem add_zsmul_modEq (z : ℤ) : a + z • p ≡ a [PMOD p]

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


theorem replaceF_cons (a : α) (l : List α) :
    (a :: l).replaceF p = match p a with
      | none => a :: replaceF p l
      | some a' => a' :: l

{α : Type u_1}
{p : α → Option α}
(a : α)
(l : List α)

List.replaceF p (a :: l) =
  match p a with
  | none => a :: List.replaceF p l
  | some a' => a' :: l


@[simp]
theorem modByMonicHom_map (h : IsAdjoinRootMonic S f) (g : R[X]) :
    h.modByMonicHom (h.map g) = g %ₘ f

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)
(g : R[X])


@[gcongr]
theorem ofReal_le_ofReal {p q : ℝ} (h : p ≤ q) : ENNReal.ofReal p ≤ ENNReal.ofReal q


theorem bot_degree (v : V) : (⊥ : SimpleGraph V).degree v = 0


theorem map_sub [Sub β] [Bot β] {f : α → β} (h : ∀ x y, f (x - y) = f x - f y) (h₀ : f ⊥ = ⊥) :
    ∀ x y : WithTop α, (x - y).map f = x.map f - y.map f

(h : ∀ (x y : α), f (x - y) = f x - f y)

WithTop.map f (x - y) = WithTop.map f x - WithTop.map f y


theorem inter_diff_distrib_left (s t u : Set α) : s ∩ (t \ u) = (s ∩ t) \ (s ∩ u)


lemma fromRows_ext_iff (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) (B₁ : Matrix m₁ n R)
    (B₂ : Matrix m₂ n R) :
    fromRows A₁ A₂ = fromRows B₁ B₂ ↔ A₁ = B₁ ∧ A₂ = B₂

{R : Type u_1}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n : Type u_5}
(A₁ : Matrix m₁ n R)
(A₂ : Matrix m₂ n R)
(B₁ : Matrix m₁ n R)
(B₂ : Matrix m₂ n R)

A₁.fromRows A₂ = B₁.fromRows B₂ ↔ A₁ = B₁ ∧ A₂ = B₂


/-- Upgrading `PiTensorProduct.mapL` to a `MonoidHom` when `E = E'`. -/
@[simps]
noncomputable def mapLMonoidHom : (Π i, E i →L[𝕜] E i) →* ((⨂[𝕜] i, E i) →L[𝕜] ⨂[𝕜] i, E i)

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

PiTensorProduct.mapLMonoidHom f = PiTensorProduct.mapL f


/-- The relation between the values of the quadratic character of one field `F` at the
cardinality of another field `F'` and of the quadratic character of `F'` at the cardinality
of `F`. -/
theorem quadraticChar_card_card [DecidableEq F] (hF : ringChar F ≠ 2) {F' : Type*} [Field F']
    [Fintype F'] [DecidableEq F'] (hF' : ringChar F' ≠ 2) (h : ringChar F' ≠ ringChar F) :
    quadraticChar F (Fintype.card F') =
    quadraticChar F' (quadraticChar F (-1) * Fintype.card F)

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]
(hF : ringChar F ≠ 2)
{F' : Type u_2}
[Field F']
[Fintype F']
[DecidableEq F']
(hF' : ringChar F' ≠ 2)
(h : ringChar F' ≠ ringChar F)

(quadraticChar F) ↑(Fintype.card F') = (quadraticChar F') (↑((quadraticChar F) (-1)) * ↑(Fintype.card F))


lemma shatters_iff : 𝒜.Shatters s ↔ 𝒜.image (fun t ↦ s ∩ t) = s.powerset

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

𝒜.Shatters s ↔ Finset.image (fun t => s ∩ t) 𝒜 = s.powerset


@[to_additive]
theorem mem_powers_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card G = p) {g g' : G} (hg : g ≠ 1) : g' ∈ Submonoid.powers g

∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)],
  Fintype.card G = p → ∀ {g g' : G}, g ≠ 0 → g' ∈ AddSubmonoid.multiples g


theorem mem_traverse {f : α' → Set β'} :
    ∀ (l : List α') (n : List β'), n ∈ traverse f l ↔ Forall₂ (fun b a => b ∈ f a) n l

{α' β' : Type u}
{f : α' → Set β'}
(l : List α')
(n : List β')

n ∈ traverse f l ↔ List.Forall₂ (fun b a => b ∈ f a) n l


/-- If measure `μ` is invariant under a group action and is nonzero on a compact set `K`, then it is
positive on any nonempty open set. In case of a regular measure, one can assume `μ ≠ 0` instead of
`μ K ≠ 0`, see `MeasureTheory.measure_isOpen_pos_of_smulInvariant_of_ne_zero`. -/
@[to_additive]
theorem measure_isOpen_pos_of_smulInvariant_of_compact_ne_zero (hK : IsCompact K) (hμK : μ K ≠ 0)
    (hU : IsOpen U) (hne : U.Nonempty) : 0 < μ U

[MeasureTheory.VAddInvariantMeasure G α μ]


theorem coe_of_s_get?_rat_eq :
    (((of q).s.get? n).map (Pair.map (↑)) : Option <| Pair K) = (of v).s.get? n

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
{v : K}
{q : ℚ}
(v_eq_q : v = ↑q)
(n : ℕ)

Option.map (GenContFract.Pair.map Rat.cast) ((GenContFract.of q).s.get? n) = (GenContFract.of v).s.get? n


/-- The restriction of a bilinear form on a submodule. -/
@[simps! apply]
def restrict (B : BilinForm R M) (W : Submodule R M) : BilinForm R W

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(B : LinearMap.BilinForm R M)
(W : Submodule R M)
(m : ↥W)


/-- Characterization of C^n functions into a smooth vector bundle. -/
theorem contMDiffWithinAt_totalSpace (f : M → TotalSpace F E) {s : Set M} {x₀ : M} :
    ContMDiffWithinAt IM (IB.prod 𝓘(𝕜, F)) n f s x₀ ↔
      ContMDiffWithinAt IM IB n (fun x => (f x).proj) s x₀ ∧
      ContMDiffWithinAt IM 𝓘(𝕜, F) n (fun x ↦ (trivializationAt F E (f x₀).proj (f x)).2) s x₀

[TopologicalSpace (Bundle.TotalSpace F E)]

ContMDiffWithinAt IM (IB.prod 𝓘(𝕜, F)) n f s x₀ ↔
  ContMDiffWithinAt IM IB n (fun x => (f x).proj) s x₀ ∧
    ContMDiffWithinAt IM 𝓘(𝕜, F) n (fun x => (↑(trivializationAt F E (f x₀).proj) (f x)).2) s x₀


theorem list_getD (d : α) : Primrec₂ fun l n => List.getD l n d


@[to_additive]
theorem inv_mul_lt_iff_lt_mul' : c⁻¹ * a < b ↔ a < b * c

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


@[simp]
theorem coe_comp (f' : G' ↪g G'') (f : G ↪g G') : ⇑(f'.comp f) = f' ∘ f

{V : Type u_1}
{W : Type u_2}
{X : Type u_3}
{G : SimpleGraph V}
{G' : SimpleGraph W}
{G'' : SimpleGraph X}
(f' : G' ↪g G'')
(f : G ↪g G')


/--
An equivalence relation `~ : α → α → Prop` is a relation that is:

* reflexive: `x ~ x`
* symmetric: `x ~ y` implies `y ~ x`
* transitive: `x ~ y` and `y ~ z` implies `x ~ z`

Equality is an equivalence relation, and equivalence relations share many of
the properties of equality. In particular, `Quot α r` is most well behaved
when `r` is an equivalence relation, and in this case we use `Quotient` instead.
-/
structure Equivalence {α : Sort u} (r : α → α → Prop) : Prop where
  /-- An equivalence relation is reflexive: `x ~ x` -/
  refl  : ∀ x, r x x
  /-- An equivalence relation is symmetric: `x ~ y` implies `y ~ x` -/
  symm  : ∀ {x y}, r x y → r y x
  /-- An equivalence relation is transitive: `x ~ y` and `y ~ z` implies `x ~ z` -/
  trans : ∀ {x y z}, r x y → r y z → r x z

{α : Sort u}
{r : α → α → Prop}
(self : Equivalence r)
{x y : α}


@[to_additive (attr := simp)]
theorem Step.not_rev {x b} : Step (L₁ ++ (x, !b) :: (x, b) :: L₂) (L₁ ++ L₂)

{α : Type u}
{L₁ L₂ : List (α × Bool)}
{x : α}
{b : Bool}

FreeGroup.Red.Step (L₁ ++ (x, !b) :: (x, b) :: L₂) (L₁ ++ L₂)


@[simp, nolint simpNF] -- Porting note: linter claims that LHS doesn't simplify, but it does
theorem linearProjOfIsCompl_of_proj (f : E →ₗ[R] p) (hf : ∀ x : p, f x = x) :
    p.linearProjOfIsCompl (ker f) (isCompl_of_proj hf) = f

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

p.linearProjOfIsCompl (LinearMap.ker f) ⋯ = f


/-- Reinterpret a complete lattice homomorphism as a complete lattice homomorphism between the dual
lattices. -/
@[simps!]
protected def dual : CompleteLatticeHom α β ≃ CompleteLatticeHom αᵒᵈ βᵒᵈ

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : CompleteLatticeHom αᵒᵈ βᵒᵈ)

∀ (a : αᵒᵈᵒᵈ), (CompleteLatticeHom.dual.symm f).toFun a = OrderDual.toDual (f (OrderDual.ofDual a))


/-- **Equality case of the Rearrangement Inequality**: Pointwise scalar multiplication of `f` and
`g`, which monovary together, is unchanged by a permutation if and only if `f` and `g ∘ σ` monovary
together. Stated by permuting the entries of `g`. -/
theorem Monovary.sum_smul_comp_perm_eq_sum_smul_iff (hfg : Monovary f g) :
    ∑ i, f i • g (σ i) = ∑ i, f i • g i ↔ Monovary f (g ∘ σ)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
[Fintype ι]
(hfg : Monovary f g)

∑ i : ι, f i • g (σ i) = ∑ i : ι, f i • g i ↔ Monovary f (g ∘ ⇑σ)


theorem csInf_mem {s : Set ℤ} (h1 : s.Nonempty) (h2 : BddBelow s) : sInf s ∈ s


/-- Elements of finite order are of finite order in submonoids. -/
@[to_additive "Elements of finite order are of finite order in submonoids."]
theorem Submonoid.isOfFinOrder_coe {H : Submonoid G} {x : H} :
    IsOfFinOrder (x : G) ↔ IsOfFinOrder x

{G : Type u_1}
[AddMonoid G]
{H : AddSubmonoid G}
{x : ↥H}


theorem preimage_prod_map_prod (f : α → β) (g : γ → δ) (s : Set β) (t : Set δ) :
    Prod.map f g ⁻¹' s ×ˢ t = (f ⁻¹' s) ×ˢ (g ⁻¹' t)

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


@[simp]
theorem iUnion_Ici : ⋃ a : α, Ici a = univ


theorem SeparatingLeft.toMatrix₂' {B : (ι → R₁) →ₗ[R₁] (ι → R₁) →ₗ[R₁] R₁} (h : B.SeparatingLeft) :
    (LinearMap.toMatrix₂' R₁ B).Nondegenerate


theorem mul_pred (n m : Nat) : n * pred m = n * m - n


@[to_additive (attr := simp)]
lemma Filter.inv_cobounded : (cobounded E)⁻¹ = cobounded E

(Bornology.cobounded E)⁻¹ = Bornology.cobounded E


theorem principal_add_omega : Principal (· + ·) omega

Ordinal.Principal (fun x x_1 => x + x_1) Ordinal.omega


@[simp]
theorem image₂_empty_right : image₂ f s ∅ = ∅

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}


theorem eval₂ :
    Polynomial.eval₂ (Subring.subtype <| (FixedPoints.subfield G F).toSubring) x (minpoly G F x) =
      0

(G : Type u)
[Group G]
(F : Type v)
[Field F]
[MulSemiringAction G F]
[Fintype G]
(x : F)

Polynomial.eval₂ (FixedPoints.subfield G F).subtype x (FixedPoints.minpoly G F x) = 0


theorem IsLittleO.sup (h : f =o[l] g) (h' : f =o[l'] g) : f =o[l ⊔ l'] g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
{l l' : Filter α}
(h : f =o[l] g)
(h' : f =o[l'] g)


theorem Finite.fin_param {s : Set α} (h : s.Finite) :
    ∃ (n : ℕ) (f : Fin n → α), Injective f ∧ range f = s

∃ n f, Function.Injective f ∧ Set.range f = s


/-- Equivalence between `Fin n` and `{ i // i < n }`. -/
@[simps apply symm_apply]
def equivSubtype : Fin n ≃ { i // i < n }


theorem cons_prefix_iff : a :: l₁ <+: b :: l₂ ↔ a = b ∧ l₁ <+: l₂

{α : Type u_1}
{l₁ l₂ : List α}
{a b : α}


lemma of_quasispectrum_eq {a b : A} {f : S → R} (ha : QuasispectrumRestricts a f)
    (h : quasispectrum S a = quasispectrum S b) : QuasispectrumRestricts b f


/-- Two functors out of a path category are equal when they agree on singleton paths. -/
@[ext]
theorem ext_functor {C} [Category C] {F G : Paths V ⥤ C} (h_obj : F.obj = G.obj)
    (h : ∀ (a b : V) (e : a ⟶ b), F.map e.toPath =
        eqToHom (congr_fun h_obj a) ≫ G.map e.toPath ≫ eqToHom (congr_fun h_obj.symm b)) :
    F = G

{F G : CategoryTheory.Functor (CategoryTheory.Paths V) C}

(h :
  ∀ (a b : V) (e : a ⟶ b),
    F.map e.toPath =
      CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
        (CategoryTheory.CategoryStruct.comp (G.map e.toPath) (CategoryTheory.eqToHom ⋯)))


/-- Turn a braided functor into a lax braided functor. -/
@[simps toLaxMonoidalFunctor]
def toLaxBraidedFunctor (F : BraidedFunctor C D) : LaxBraidedFunctor C D

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

(CategoryTheory.BraidedFunctor.toLaxBraidedFunctor C D F).toLaxMonoidalFunctor = F.toLaxMonoidalFunctor


theorem tendsto_tan_pi_div_two : Tendsto tan (𝓝[<] (π / 2)) atTop

Filter.Tendsto Real.tan (𝓝[<] (Real.pi / 2)) Filter.atTop


lemma isReal_comap_iff (f : k ≃+* K) {w : InfinitePlace K} :
    IsReal (w.comap (f : k →+* K)) ↔ IsReal w

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
(f : k ≃+* K)
{w : NumberField.InfinitePlace K}


theorem Equiv.Perm.IsSwap.finite_compl_fixedBy {σ : Perm α} (h : σ.IsSwap) :
    (fixedBy α σ)ᶜ.Finite

{α : Type u_2}
[DecidableEq α]
{σ : Equiv.Perm α}
(h : σ.IsSwap)


@[simp]
theorem toIcoDiv_zsmul_sub_self (a b : α) : toIcoDiv hp a b • p - b = -toIcoMod hp a b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b : α)


@[simp]
theorem symm_symm (e : R ≃+* S) : e.symm.symm = e

{R : Type u_4}
{S : Type u_5}
[Mul R]
[Mul S]
[Add R]
[Add S]
(e : R ≃+* S)


@[simp]
theorem map_zero (f : α → β) : (0 : VectorMeasure α M).map f = 0

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
(f : α → β)


/-- Promotes a linear `RingEquiv` to an `AlgEquiv`. -/
@[simps apply symm_apply toEquiv] -- Porting note: don't want redundant `toEquiv_symm_apply` simps
def ofRingEquiv {f : A₁ ≃+* A₂} (hf : ∀ x, f (algebraMap R A₁ x) = algebraMap R A₂ x) :
    A₁ ≃ₐ[R] A₂

(hf : ∀ (x : R), f ((algebraMap R A₁) x) = (algebraMap R A₂) x)

(AlgEquiv.ofRingEquiv hf).symm a = f.symm a


lemma baseChange_Ψ₃ : (W.baseChange B).Ψ₃ = (W.baseChange A).Ψ₃.map f

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

(W.baseChange B).Ψ₃ = Polynomial.map (↑f) (W.baseChange A).Ψ₃


theorem exists_countable_is_age_of_iff [Countable (Σ l, L.Functions l)] :
    (∃ M : Bundled.{w} L.Structure, Countable M ∧ L.age M = K) ↔
      K.Nonempty ∧ (∀ M N : Bundled.{w} L.Structure, Nonempty (M ≃[L] N) → (M ∈ K ↔ N ∈ K)) ∧
      (Quotient.mk' '' K).Countable ∧ (∀ M : Bundled.{w} L.Structure, M ∈ K → Structure.FG L M) ∧
      Hereditary K ∧ JointEmbedding K

{K : Set (CategoryTheory.Bundled L.Structure)}

(∃ M, Countable ↑M ∧ L.age ↑M = K) ↔
  K.Nonempty ∧
    (∀ (M N : CategoryTheory.Bundled L.Structure), Nonempty (↑M ≃[L] ↑N) → (M ∈ K ↔ N ∈ K)) ∧
      (Quotient.mk' '' K).Countable ∧
        (∀ M ∈ K, FirstOrder.Language.Structure.FG L ↑M) ∧
          FirstOrder.Language.Hereditary K ∧ FirstOrder.Language.JointEmbedding K


@[to_additive]
theorem mk_eq_mk_iff' : mk a₁ a₂ = mk b₁ b₂ ↔ ↑b₂ * a₁ = a₂ * b₁

{α : Type u_1}
[AddCancelCommMonoid α]
{s : AddSubmonoid α}
{a₁ b₁ : α}
{a₂ b₂ : ↥s}

AddLocalization.mk a₁ a₂ = AddLocalization.mk b₁ b₂ ↔ ↑b₂ + a₁ = ↑a₂ + b₁


/-- Hölder's inequality in case of finite non-zero integrals -/
theorem lintegral_mul_le_Lp_mul_Lq_of_ne_zero_of_ne_top {p q : ℝ} (hpq : p.IsConjExponent q)
    {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hf_nontop : (∫⁻ a, f a ^ p ∂μ) ≠ ⊤)
    (hg_nontop : (∫⁻ a, g a ^ q ∂μ) ≠ ⊤) (hf_nonzero : (∫⁻ a, f a ^ p ∂μ) ≠ 0)
    (hg_nonzero : (∫⁻ a, g a ^ q ∂μ) ≠ 0) :
    (∫⁻ a, (f * g) a ∂μ) ≤ (∫⁻ a, f a ^ p ∂μ) ^ (1 / p) * (∫⁻ a, g a ^ q ∂μ) ^ (1 / q)

(hf_nontop : ∫⁻ (a : α), f a ^ p ∂μ ≠ ⊤)

(hg_nontop : ∫⁻ (a : α), g a ^ q ∂μ ≠ ⊤)

(hf_nonzero : ∫⁻ (a : α), f a ^ p ∂μ ≠ 0)

(hg_nonzero : ∫⁻ (a : α), g a ^ q ∂μ ≠ 0)


@[simp]
theorem lTensor_comp_rTensor (f : M →ₗ[R] P) (g : N →ₗ[R] Q) :
    (g.lTensor P).comp (f.rTensor N) = map f g

{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)

LinearMap.lTensor P g ∘ₗ LinearMap.rTensor N f = TensorProduct.map f g


lemma evalEvalRingHom_eq (x : R) :
    evalEvalRingHom x = eval₂RingHom (evalRingHom x)

Polynomial.evalEvalRingHom x = Polynomial.eval₂RingHom (Polynomial.evalRingHom x)


theorem ae_map_mem_range {m0 : MeasurableSpace α} (f : α → β) (hf : MeasurableSet (range f))
    (μ : Measure α) : ∀ᵐ x ∂μ.map f, x ∈ range f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace β]
{m0 : MeasurableSpace α}
(f : α → β)
(hf : MeasurableSet (Set.range f))
(μ : MeasureTheory.Measure α)

∀ᵐ (x : β) ∂MeasureTheory.Measure.map f μ, x ∈ Set.range f


theorem continuous_iff'_left [TopologicalSpace β] {f : β → α} :
    Continuous f ↔ ∀ b, Tendsto (fun x => (f x, f b)) (𝓝 b) (𝓤 α)

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

Continuous f ↔ ∀ (b : β), Filter.Tendsto (fun x => (f x, f b)) (𝓝 b) (𝓤 α)


@[simp]
theorem nnnorm_equiv_symm_snd (y : β) :
    ‖(WithLp.equiv p (α × β)).symm (0, y)‖₊ = ‖y‖₊

(p : ℝ≥0∞)
(α : Type u_2)
(β : Type u_3)
[hp : Fact (1 ≤ p)]
[SeminormedAddCommGroup α]
[SeminormedAddCommGroup β]
(y : β)


theorem inner_rightAngleRotation_swap (x y : E) : ⟪x, J y⟫ = -⟪J x, y⟫

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

⟪x, o.rightAngleRotation y⟫_ℝ = -⟪o.rightAngleRotation x, y⟫_ℝ


@[simp]
theorem trace_adjMatrix [AddCommMonoid α] [One α] : Matrix.trace (G.adjMatrix α) = 0

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


@[simp]
theorem algebraMap_inj (x y : R) :
    algebraMap R (ExteriorAlgebra R M) x = algebraMap R (ExteriorAlgebra R M) y ↔ x = y

{R : Type u1}
[CommRing R]
(M : Type u2)
[AddCommGroup M]
[Module R M]
(x y : R)

(algebraMap R (ExteriorAlgebra R M)) x = (algebraMap R (ExteriorAlgebra R M)) y ↔ x = y


@[simp]
theorem interedges_empty_left (t : Finset β) : interedges r ∅ t = ∅

{α : Type u_4}
{β : Type u_5}
{r : α → β → Prop}
[(a : α) → DecidablePred (r a)]
(t : Finset β)


@[to_additive]
protected theorem Periodic.mul [Add α] [Mul β] (hf : Periodic f c) (hg : Periodic g c) :
    Periodic (f * g) c

{α : Type u_1}
{β : Type u_2}
{f g : α → β}
{c : α}
[Add α]
[Mul β]
(hf : Function.Periodic f c)
(hg : Function.Periodic g c)


/-- A complete sublattice is a subset of a complete lattice that is closed under arbitrary suprema
and infima. -/
structure CompleteSublattice extends Sublattice α where
  sSupClosed' : ∀ ⦃s : Set α⦄, s ⊆ carrier → sSup s ∈ carrier
  sInfClosed' : ∀ ⦃s : Set α⦄, s ⊆ carrier → sInf s ∈ carrier

{α : Type u_1}
[CompleteLattice α]
(self : CompleteSublattice α)
⦃s : Set α⦄

s ⊆ self.carrier → sSup s ∈ self.carrier


theorem count_sum' {s : Finset β} {a : α} {f : β → Multiset α} :
    count a (∑ x ∈ s, f x) = ∑ x ∈ s, count a (f x)

{α : Type u_3}
{β : Type u_4}
[DecidableEq α]
{s : Finset β}
{a : α}
{f : β → Multiset α}

Multiset.count a (∑ x ∈ s, f x) = ∑ x ∈ s, Multiset.count a (f x)


/-- Equivalence between dependent functions with finite support `s : Finset ι` and functions
`∀ i, {x : β i // x ≠ 0}`. -/
@[simps]
def subtypeSupportEqEquiv (s : Finset ι) :
    {f : Π₀ i, β i // f.support = s} ≃ ∀ i : s, {x : β i // x ≠ 0}

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

↑((DFinsupp.subtypeSupportEqEquiv s).symm f) = DFinsupp.mk s fun i => ↑(f i)


theorem tendsto_floor_atTop : Tendsto (floor : α → ℤ) atTop atTop

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]

Filter.Tendsto Int.floor Filter.atTop Filter.atTop


theorem IsNormal.generatedNormal_le {S : Subgroupoid C} (Sn : S.IsNormal) :
    generatedNormal X ≤ S ↔ ∀ c d, X c d ⊆ S.arrows c d

{C : Type u}
[CategoryTheory.Groupoid C]
(X : (c d : C) → Set (c ⟶ d))
{S : CategoryTheory.Subgroupoid C}
(Sn : S.IsNormal)

CategoryTheory.Subgroupoid.generatedNormal X ≤ S ↔ ∀ (c d : C), X c d ⊆ S.arrows c d


theorem nonsing_inv_apply_not_isUnit (h : ¬IsUnit A.det) : A⁻¹ = 0

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)
(h : ¬IsUnit A.det)


theorem circulant_add [Add α] [Sub n] (v w : n → α) :
    circulant (v + w) = circulant v + circulant w

{α : Type u_1}
{n : Type u_4}
[Add α]
[Sub n]
(v w : n → α)

Matrix.circulant (v + w) = Matrix.circulant v + Matrix.circulant w


theorem Context.sort_loop_nonEmpty (xs : List Nat) (h : xs ≠ []) : sort.loop xs ys ≠ []

{ys : List Nat}
(xs : List Nat)
(h : xs ≠ [])


theorem contMDiff_of_locally_contMDiffOn (h : ∀ x, ∃ u, IsOpen u ∧ x ∈ u ∧ ContMDiffOn I I' n f u) :
    ContMDiff I I' n f

(h : ∀ (x : M), ∃ u, IsOpen u ∧ x ∈ u ∧ ContMDiffOn I I' n f u)


theorem hasStrictDerivAt_exp_smul_const (x : 𝔸) (t : 𝕂) :
    HasStrictDerivAt (fun u : 𝕂 => exp 𝕂 (u • x)) (exp 𝕂 (t • x) * x) t

{𝕂 : Type u_1}
{𝔸 : Type u_3}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(x : 𝔸)
(t : 𝕂)

HasStrictDerivAt (fun u => NormedSpace.exp 𝕂 (u • x)) (NormedSpace.exp 𝕂 (t • x) * x) t


@[simp]
lemma isSquare_toMul_iff {a : Additive α} : IsSquare (Additive.toMul a) ↔ Even a


/-- An increasing intersection distributes over finite union. -/
theorem iInter_iUnion_of_monotone {ι ι' α : Type*} [Finite ι] [Preorder ι']
    [IsDirected ι' (swap (· ≤ ·))] [Nonempty ι'] {s : ι → ι' → Set α} (hs : ∀ i, Monotone (s i)) :
    ⋂ j : ι', ⋃ i : ι, s i j = ⋃ i : ι, ⋂ j : ι', s i j

[IsDirected ι' (Function.swap fun x x_1 => x ≤ x_1)]


@[simp]
theorem support_ofFinset : (ofFinset f s h h').support = ↑s ∩ Function.support f

{α : Type u_1}
{f : α → ENNReal}
{s : Finset α}
(h : ∑ a ∈ s, f a = 1)
(h' : ∀ a ∉ s, f a = 0)

(PMF.ofFinset f s h h').support = ↑s ∩ Function.support f


@[simp]
theorem mem_powersetAux {l : List α} {s} : s ∈ powersetAux l ↔ s ≤ ↑l

{α : Type u_1}
{l : List α}
{s : Multiset α}


theorem Monic.degree_pos : 0 < degree p ↔ p ≠ 1

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


theorem relNorm_apply (I : Ideal S) : relNorm R I = span (Algebra.norm R '' (I : Set S) : Set R)

(R : Type u_1)
[CommRing R]
{S : Type u_2}
[CommRing S]
[Algebra R S]
[IsDomain R]
[IsDomain S]
[IsDedekindDomain R]
[IsDedekindDomain S]
[Module.Finite R S]
[Module.Free R S]
(I : Ideal S)

(Ideal.relNorm R) I = Ideal.span (⇑(Algebra.norm R) '' ↑I)


theorem ite_disjunction {α : Type u} {P : Prop} [Decidable P] {a b : α} :
    (P ∧ (if P then a else b) = a) ∨ (¬ P ∧ (if P then a else b) = b)

P ∧ (if P then a else b) = a ∨ ¬P ∧ (if P then a else b) = b


@[simp]
theorem deriv_div_const (d : 𝕜') : deriv (fun x => c x / d) x = deriv c x / d

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{c : 𝕜 → 𝕜'}
(d : 𝕜')


@[simp]
theorem aleph0_toNat : toNat ℵ₀ = 0


theorem GroupWithZero.mul_right_injective (h : x ≠ 0) :
    Function.Injective fun y => y * x

{G₀ : Type u_3}
[GroupWithZero G₀]
{x : G₀}
(h : x ≠ 0)


theorem totalDegree_rename_le (f : σ → τ) (p : MvPolynomial σ R) :
    (rename f p).totalDegree ≤ p.totalDegree

{R : Type u}
{σ : Type u_1}
{τ : Type u_2}
[CommSemiring R]
(f : σ → τ)
(p : MvPolynomial σ R)

((MvPolynomial.rename f) p).totalDegree ≤ p.totalDegree


theorem pentagon (W X Y Z : ModuleCat R) :
    whiskerRight (associator W X Y).hom Z ≫
        (associator W (tensorObj X Y) Z).hom ≫ whiskerLeft W (associator X Y Z).hom =
      (associator (tensorObj W X) Y Z).hom ≫ (associator W X (tensorObj Y Z)).hom

{R : Type u}
[CommRing R]
(W : ModuleCat R)
(X : ModuleCat R)
(Y : ModuleCat R)
(Z : ModuleCat R)

ModuleCat.MonoidalCategory.whiskerRight (ModuleCat.MonoidalCategory.associator W X Y).hom Z ≫
    (ModuleCat.MonoidalCategory.associator W (ModuleCat.MonoidalCategory.tensorObj X Y) Z).hom ≫
      ModuleCat.MonoidalCategory.whiskerLeft W (ModuleCat.MonoidalCategory.associator X Y Z).hom =
  (ModuleCat.MonoidalCategory.associator (ModuleCat.MonoidalCategory.tensorObj W X) Y Z).hom ≫
    (ModuleCat.MonoidalCategory.associator W X (ModuleCat.MonoidalCategory.tensorObj Y Z)).hom


theorem preservesMonomorphisms.of_iso {F G : C ⥤ D} [PreservesMonomorphisms F] (α : F ≅ G) :
    PreservesMonomorphisms G

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


@[simp] theorem coe_ringHom_id {X : CommSemiRingCat} :
    @DFunLike.coe (X →+* X) X (fun _ ↦ X) _ (𝟙 X) = id


theorem tr_respects : Respects step (TM2.step tr) TrCfg

Turing.Respects Turing.ToPartrec.step (Turing.TM2.step Turing.PartrecToTM2.tr) Turing.PartrecToTM2.TrCfg


/-- The set of conjugates of `s` is closed under conjugation. -/
theorem conj_mem_conjugatesOfSet {x c : G} :
    x ∈ conjugatesOfSet s → c * x * c⁻¹ ∈ conjugatesOfSet s

{G : Type u_1}
[Group G]
{s : Set G}
{x c : G}

x ∈ Group.conjugatesOfSet s → c * x * c⁻¹ ∈ Group.conjugatesOfSet s


/-- A structure designed to hold the hypotheses for the Mellin-functional-equation argument
(most general version: rapid decay at `∞` up to constant terms) -/
structure WeakFEPair where
  /-- The functions whose Mellin transform we study -/
  (f g : ℝ → E)
  /-- Weight (exponent in the functional equation) -/
  (k : ℝ)
  /-- Root number -/
  (ε : ℂ)
  /-- Constant terms at `∞` -/
  (f₀ g₀ : E)
  (hf_int : LocallyIntegrableOn f (Ioi 0))
  (hg_int : LocallyIntegrableOn g (Ioi 0))
  (hk : 0 < k)
  (hε : ε ≠ 0)
  (h_feq : ∀ x ∈ Ioi 0, f (1 / x) = (ε * ↑(x ^ k)) • g x)
  (hf_top (r : ℝ) : (f · - f₀) =O[atTop] (· ^ r))
  (hg_top (r : ℝ) : (g · - g₀) =O[atTop] (· ^ r))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(self : WeakFEPair E)


@[to_additive (attr := simp)]
theorem inv_closedBall : (closedBall x δ)⁻¹ = closedBall x⁻¹ δ

{E : Type u_1}
[SeminormedAddCommGroup E]
(δ : ℝ)
(x : E)

-Metric.closedBall x δ = Metric.closedBall (-x) δ


/-- Explicit bound on `HD (dist)`. This means that when looking for minimizers it will
be sufficient to look for functions with `HD(f)` bounded by this bound. -/
theorem HD_candidatesBDist_le :
    HD (candidatesBDist X Y) ≤ diam (univ : Set X) + 1 + diam (univ : Set Y)

{X : Type u}
{Y : Type v}
[MetricSpace X]
[CompactSpace X]
[Nonempty X]
[MetricSpace Y]
[CompactSpace Y]
[Nonempty Y]

GromovHausdorff.HD (GromovHausdorff.candidatesBDist X Y) ≤ Metric.diam Set.univ + 1 + Metric.diam Set.univ


theorem apply_eq_of_isPreconnected (f : LocallyConstant X Y) {s : Set X} (hs : IsPreconnected s)
    {x y : X} (hx : x ∈ s) (hy : y ∈ s) : f x = f y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
(f : LocallyConstant X Y)
{s : Set X}
(hs : IsPreconnected s)
{x y : X}
(hx : x ∈ s)
(hy : y ∈ s)


theorem exists_prime_dvd_of_not_inf_one {a b : α} (ha : a ≠ 0) (hb : b ≠ 0)
    (h : Associates.mk a ⊓ Associates.mk b ≠ 1) : ∃ p : α, Prime p ∧ p ∣ a ∧ p ∣ b


/-- Used for `field_simp` to deal with inverses of units. -/
@[field_simps]
theorem inv_eq_one_divp (u : αˣ) : ↑u⁻¹ = 1 /ₚ u


@[measurability]
theorem Measurable.cosh : Measurable fun x => Real.cosh (f x)

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → ℝ}
(hf : Measurable f)


@[simp]
theorem coe_smulRight {R M₁ M₂ ι : Type*} [CommSemiring R] [AddCommMonoid M₁] [AddCommMonoid M₂]
    [Module R M₁] [Module R M₂] (f : M₁ [⋀^ι]→ₗ[R] R) (z : M₂) :
    (f.smulRight z : MultilinearMap R (fun _ : ι => M₁) M₂) = MultilinearMap.smulRight f z

{R : Type u_10}
{M₁ : Type u_11}
{M₂ : Type u_12}
{ι : Type u_13}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
(f : M₁ [⋀^ι]→ₗ[R] R)
(z : M₂)


theorem preimage_coe_inter_self (s t : Set α) :
    ((↑) : s → α) ⁻¹' (t ∩ s) = ((↑) : s → α) ⁻¹' t

Subtype.val ⁻¹' (t ∩ s) = Subtype.val ⁻¹' t


/-- To cancel a common factor `c` from a `ModEq` we must divide the modulus `m` by `gcd m c` -/
lemma cancel_left_div_gcd (hm : 0 < m) (h : c * a ≡ c * b [MOD m]) :  a ≡ b [MOD m / gcd m c]

{m a b c : ℕ}
(hm : 0 < m)
(h : c * a ≡ c * b [MOD m])


@[simp]
theorem mk_inf_mk [SemilatticeInf α] {P : α → Prop}
    (Pinf : ∀ ⦃x y⦄, P x → P y → P (x ⊓ y)) {x y : α} (hx : P x) (hy : P y) :
    (haveI := Subtype.semilatticeInf Pinf; (⟨x, hx⟩ ⊓ ⟨y, hy⟩ : Subtype P)) =
      ⟨x ⊓ y, Pinf hx hy⟩

(Pinf : ∀ ⦃x y : α⦄, P x → P y → P (x ⊓ y))


@[simp]
theorem cancel_left {g : β →ᵈ γ} {f₁ f₂ : α →ᵈ β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[PseudoEMetricSpace γ]
{g : β →ᵈ γ}
{f₁ f₂ : α →ᵈ β}
(hg : Function.Injective ⇑g)


/-- Flipping commutative squares is an auto-equivalence. -/
@[simps]
def flipEquivalence : Square C ≌ Square C

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

CategoryTheory.Square.flipEquivalence.unitIso =
  CategoryTheory.Iso.refl (CategoryTheory.Functor.id (CategoryTheory.Square C))


/--
A universe polymorphic "Yoneda presheaf" on `C` given by continuous maps into a topoological space
`Y`.
-/
@[simps]
def yonedaPresheaf : Cᵒᵖ ⥤ Type (max w w')

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : C ⥤ TopCat)
(Y : Type w')
[TopologicalSpace Y]

∀ {X Y_1 : Cᵒᵖ} (f : X ⟶ Y_1) (g : C(↑(F.obj (Opposite.unop X)), Y)),
  (ContinuousMap.yonedaPresheaf F Y).map f g = g.comp (F.map f.unop)


/-- A multiplicative morphism property `W` has right calculus of fractions if
any left fraction can be turned into a right fraction and that two morphisms
that can be equalized by postcomposition with a morphism in `W` can also
be equalized by precomposition with a morphism in `W`. -/
class HasRightCalculusOfFractions extends W.IsMultiplicative : Prop where
  exists_rightFraction ⦃X Y : C⦄ (φ : W.LeftFraction X Y) :
    ∃ (ψ : W.RightFraction X Y), ψ.s ≫ φ.f = ψ.f ≫ φ.s
  ext : ∀ ⦃X Y Y' : C⦄ (f₁ f₂ : X ⟶ Y) (s : Y ⟶ Y') (_ : W s)
    (_ : f₁ ≫ s = f₂ ≫ s), ∃ (X' : C) (t : X' ⟶ X) (_ : W t), t ≫ f₁ = t ≫ f₂

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[self : W.HasRightCalculusOfFractions]
⦃X Y Y' : C⦄
(f₁ f₂ : X ⟶ Y)
(s : Y ⟶ Y')

W s →
  CategoryTheory.CategoryStruct.comp f₁ s = CategoryTheory.CategoryStruct.comp f₂ s →
    ∃ X' t, ∃ (_ : W t), CategoryTheory.CategoryStruct.comp t f₁ = CategoryTheory.CategoryStruct.comp t f₂


/-- Evaluation of functions into an indexed collection of rings at a point is a ring
homomorphism. This is `Function.eval` as a `RingHom`. -/
@[simps!]
def Pi.evalRingHom (f : I → Type v) [∀ i, NonAssocSemiring (f i)] (i : I) : (∀ i, f i) →+* f i

{I : Type u}
(f : I → Type v)
[(i : I) → NonAssocSemiring (f i)]
(i : I)
(g : (i : I) → f i)


@[norm_cast]
theorem coe_mul (p q : SubMulAction R M) : ↑(p * q) = (p * q : Set M)

{R : Type u_1}
{M : Type u_2}
[Monoid R]
[MulAction R M]
[Mul M]
[IsScalarTower R M M]
(p q : SubMulAction R M)


@[to_additive addIndex_pos]
theorem index_pos (K : PositiveCompacts G) {V : Set G} (hV : (interior V).Nonempty) :
    0 < index (K : Set G) V

(K : TopologicalSpace.PositiveCompacts G)

0 < MeasureTheory.Measure.haar.index (↑K) V


@[simps]
instance : MonoidalCategoryStruct (FullSubcategory P)

∀ {X₁ Y₁ X₂ Y₂ : CategoryTheory.FullSubcategory P} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂),
  CategoryTheory.MonoidalCategory.tensorHom f g = CategoryTheory.MonoidalCategory.tensorHom f g


@[simp]
theorem le_find_iff (n : ℕ+) : n ≤ PNat.find h ↔ ∀ m < n, ¬p m

{p : ℕ+ → Prop}
[DecidablePred p]
(h : ∃ n, p n)
(n : ℕ+)


theorem type_empty : type (@EmptyRelation Empty) = 0


@[to_additive min_neg_neg]
theorem min_inv_inv' (a b : α) : min a⁻¹ b⁻¹ = (max a b)⁻¹

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


@[simp]
theorem fromSpec_preimage_self :
    hU.fromSpec ⁻¹ᵁ U = ⊤

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)

(TopologicalSpace.Opens.map hU.fromSpec.val.base).obj U = ⊤


@[simp]
theorem Quotient.lift_comp_mk [Setoid α] (f : α → β) (h : ∀ a b : α, a ≈ b → f a = f b) :
    Quotient.lift f h ∘ Quotient.mk _ = f

{α : Sort u_1}
{β : Sort u_2}
[Setoid α]
(f : α → β)
(h : ∀ (a b : α), a ≈ b → f a = f b)

Quotient.lift f h ∘ Quotient.mk inst✝ = f


@[simp]
theorem inf_dedup (s : Multiset α) : (dedup s).inf = s.inf

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


/-- `Fin.castSucc` as an `OrderEmbedding`.

`castSuccOrderEmb i` embeds `i : Fin n` in `Fin (n+1)`. -/
@[simps! apply toEmbedding]
def castSuccOrderEmb : Fin n ↪o Fin (n + 1)

∀ (a : Fin n), Fin.castSuccOrderEmb a = a.castSucc


@[simp] lemma locallyLipschitzOn_univ : LocallyLipschitzOn univ f ↔ LocallyLipschitz f

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

LocallyLipschitzOn Set.univ f ↔ LocallyLipschitz f


theorem Pairwise.imp_on (h : s.Pairwise r) (hrp : s.Pairwise fun ⦃a b : α⦄ => r a b → p a b) :
    s.Pairwise p

(hrp : s.Pairwise fun ⦃a b⦄ => r a b → p a b)


/-- The equivalence of functor categories induced by `op` and `unop`.
-/
@[simps]
def opUnopEquiv : (C ⥤ D)ᵒᵖ ≌ Cᵒᵖ ⥤ Dᵒᵖ

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

(CategoryTheory.Functor.opUnopEquiv C D).inverse = CategoryTheory.Functor.opInv C D


@[simp]
theorem map_eq_zero_iff (h : Function.Injective f) {x : M} : f x = 0 ↔ x = 0

{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₃ : Type u_12}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₃]
[Module R M]
[Module S M₃]
{σ : R →+* S}
(f : M →ₛₗ[σ] M₃)
(h : Function.Injective ⇑f)
{x : M}


theorem pi_caratheodory :
    MeasurableSpace.pi ≤ (OuterMeasure.pi fun i => (μ i).toOuterMeasure).caratheodory

(μ : (i : ι) → MeasureTheory.Measure (α i))

MeasurableSpace.pi ≤ (MeasureTheory.OuterMeasure.pi fun i => (μ i).toOuterMeasure).caratheodory


theorem range_pair_subset (f : α → β) (g : α → γ) :
    (range fun x => (f x, g x)) ⊆ range f ×ˢ range g

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

(Set.range fun x => (f x, g x)) ⊆ Set.range f ×ˢ Set.range g


theorem cons_sub_of_le (a : α) {s t : Multiset α} (h : t ≤ s) : a ::ₘ s - t = a ::ₘ (s - t)

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


lemma ltByCases_rec {h₁ : x < y → P} {h₂ : x = y → P} {h₃ : y < x → P} (p : P)
    (hlt : (h : x < y) → h₁ h = p) (heq : (h : x = y) → h₂ h = p)
    (hgt : (h : y < x) → h₃ h = p) :
    ltByCases x y h₁ h₂ h₃ = p

{α : Type u_2}
[LinearOrder α]
{P : Sort u_5}
{x y : α}
{h₁ : x < y → P}
{h₂ : x = y → P}
{h₃ : y < x → P}
(p : P)
(hlt : ∀ (h : x < y), h₁ h = p)
(heq : ∀ (h : x = y), h₂ h = p)
(hgt : ∀ (h : y < x), h₃ h = p)


@[reassoc]
lemma leftRightHomologyComparison'_fac (h₁ : S.LeftHomologyData) (h₂ : S.RightHomologyData)
    [S.HasHomology] :
    leftRightHomologyComparison' h₁ h₂ = h₁.homologyIso.inv ≫ h₂.homologyIso.hom

CategoryTheory.ShortComplex.leftRightHomologyComparison' h₁ h₂ =
  CategoryTheory.CategoryStruct.comp h₁.homologyIso.inv h₂.homologyIso.hom


@[simp] theorem all_some : Option.all p (some x) = p x

∀ {α : Type u_1} {p : α → Bool} {x : α}, Option.all p (some x) = p x


@[simp]
lemma RingHom.toKerIsLocalization_apply (hy : M ≤ Submonoid.comap g T) (r : RingHom.ker g) :
    (RingHom.toKerIsLocalization S Q g hy r).val = algebraMap R S r

{R : Type u_1}
{S : Type u_2}
{P : Type u_3}
(Q : Type u_4)
[CommSemiring R]
[CommSemiring S]
[CommSemiring P]
[CommSemiring Q]
{M : Submonoid R}
{T : Submonoid P}
[Algebra R S]
[Algebra P Q]
[IsLocalization M S]
[IsLocalization T Q]
(g : R →+* P)
(hy : M ≤ Submonoid.comap g T)
(r : ↥(RingHom.ker g))

↑((RingHom.toKerIsLocalization S Q g hy) r) = (algebraMap R S) ↑r


/-- **Hölder inequality**: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. A version for `NNReal`-valued
functions. For an alternative version, convenient if the infinite sums are not already expressed as
`p`-th powers, see `inner_le_Lp_mul_Lq_tsum_of_nonneg`.  -/
theorem inner_le_Lp_mul_Lq_hasSum_of_nonneg (hpq : p.IsConjExponent q) {A B : ℝ} (hA : 0 ≤ A)
    (hB : 0 ≤ B) (hf : ∀ i, 0 ≤ f i) (hg : ∀ i, 0 ≤ g i)
    (hf_sum : HasSum (fun i => f i ^ p) (A ^ p)) (hg_sum : HasSum (fun i => g i ^ q) (B ^ q)) :
    ∃ C : ℝ, 0 ≤ C ∧ C ≤ A * B ∧ HasSum (fun i => f i * g i) C

∃ C, 0 ≤ C ∧ C ≤ A * B ∧ HasSum (fun i => f i * g i) C


/-- Hyperbolic distance between two points is greater than or equal to the distance between the
logarithms of their imaginary parts. -/
theorem dist_log_im_le (z w : ℍ) : dist (log z.im) (log w.im) ≤ dist z w

dist (Real.log z.im) (Real.log w.im) ≤ dist z w


theorem Ico_mem_nhdsWithin_Iio (H : b ∈ Ioc a c) : Ico a c ∈ 𝓝[<] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a b c : α}
(H : b ∈ Set.Ioc a c)


/-- If `find p` returns `some i`, then `p j` does not hold for `j < i`, i.e., `i` is minimal among
the indices where `p` holds. -/
theorem find_min :
    ∀ {n : ℕ} {p : Fin n → Prop} [DecidablePred p] {i : Fin n} (_ : i ∈ Fin.find p) {j : Fin n}
      (_ : j < i), ¬p j

i ∈ Fin.find p → ∀ {j : Fin n}, j < i → ¬p j


lemma differentiableOn_one_add_smoothingFn : DifferentiableOn ℝ (fun z => 1 + ε z) (Set.Ioi 1)

DifferentiableOn ℝ (fun z => 1 + AkraBazziRecurrence.smoothingFn z) (Set.Ioi 1)


@[to_additive]
theorem haarMeasure_apply {K₀ : PositiveCompacts G} {s : Set G} (hs : MeasurableSet s) :
    haarMeasure K₀ s = (haarContent K₀).outerMeasure s / (haarContent K₀).measure K₀

{K₀ : TopologicalSpace.PositiveCompacts G}

(MeasureTheory.Measure.haarMeasure K₀) s =
  (MeasureTheory.Measure.haar.haarContent K₀).outerMeasure s / (MeasureTheory.Measure.haar.haarContent K₀).measure ↑K₀


@[simp]
theorem zero_f (C D : HomologicalComplex V c) (i : ι) : (0 : C ⟶ D).f i = 0


@[simp]
theorem reverse.map_mul (a b : CliffordAlgebra Q) :
    reverse (a * b) = reverse b * reverse a

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

CliffordAlgebra.reverse (a * b) = CliffordAlgebra.reverse b * CliffordAlgebra.reverse a


lemma eventually_atTop_nonneg_or_nonpos (hf : GrowsPolynomially f) :
    (∀ᶠ x in atTop, 0 ≤ f x) ∨ (∀ᶠ x in atTop, f x ≤ 0)

(hf : AkraBazziRecurrence.GrowsPolynomially f)

(∀ᶠ (x : ℝ) in Filter.atTop, 0 ≤ f x) ∨ ∀ᶠ (x : ℝ) in Filter.atTop, f x ≤ 0


/-- In a group with a left invariant measure `μ` and a right invariant measure `ν`, one can express
integrals with respect to `μ` as integrals with respect to `ν` up to a constant scaling factor
(given in the statement as `∫ x, g x ∂μ` where `g` is a fixed reference function) and an
explicit density `y ↦ 1/∫ z, g (z⁻¹ * y) ∂ν`. -/
@[to_additive]
lemma integral_isMulLeftInvariant_isMulRightInvariant_combo
    {μ ν : Measure G} [IsFiniteMeasureOnCompacts μ] [IsFiniteMeasureOnCompacts ν]
    [IsMulLeftInvariant μ] [IsMulRightInvariant ν] [IsOpenPosMeasure ν]
    {f g : G → ℝ} (hf : Continuous f) (h'f : HasCompactSupport f)
    (hg : Continuous g) (h'g : HasCompactSupport g) (g_nonneg : 0 ≤ g) {x₀ : G} (g_pos : g x₀ ≠ 0) :
    ∫ x, f x ∂μ = (∫ y, f y * (∫ z, g (z⁻¹ * y) ∂ν)⁻¹ ∂ν) * ∫ x, g x ∂μ

∫ (x : G), f x ∂μ = (∫ (y : G), f y * (∫ (z : G), g (-z + y) ∂ν)⁻¹ ∂ν) * ∫ (x : G), g x ∂μ


/-- Constructor for short complexes in `ModuleCat.{v} R` taking as inputs
morphisms `f` and `g` and the assumption `LinearMap.range f ≤ LinearMap.ker g`. -/
@[simps]
def moduleCatMkOfKerLERange {X₁ X₂ X₃ : ModuleCat.{v} R} (f : X₁ ⟶ X₂) (g : X₂ ⟶ X₃)
    (hfg : LinearMap.range f ≤ LinearMap.ker g) : ShortComplex (ModuleCat.{v} R)

(CategoryTheory.ShortComplex.moduleCatMkOfKerLERange f g hfg).g = g


@[simp] protected theorem zero_add : ∀ (n : Nat), 0 + n = n


theorem mem_doset_of_not_disjoint {H K : Subgroup G} {a b : G}
    (h : ¬Disjoint (doset a H K) (doset b H K)) : b ∈ doset a H K

(h : ¬Disjoint (Doset.doset a ↑H ↑K) (Doset.doset b ↑H ↑K))


@[simp] theorem id_comp (f : InfTopHom α β) : (InfTopHom.id β).comp f = f

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Top α]
[Inf β]
[Top β]
(f : InfTopHom α β)


/-- Monotone convergence theorem -- sometimes called Beppo-Levi convergence. Version with
ae_measurable functions. -/
theorem lintegral_iSup' {f : ℕ → α → ℝ≥0∞} (hf : ∀ n, AEMeasurable (f n) μ)
    (h_mono : ∀ᵐ x ∂μ, Monotone fun n => f n x) : ∫⁻ a, ⨆ n, f n a ∂μ = ⨆ n, ∫⁻ a, f n a ∂μ

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

(h_mono : ∀ᵐ (x : α) ∂μ, Monotone fun n => f n x)

∫⁻ (a : α), ⨆ n, f n a ∂μ = ⨆ n, ∫⁻ (a : α), f n a ∂μ


theorem hasStrictDerivAt_sin (x : ℝ) : HasStrictDerivAt sin (cos x) x

HasStrictDerivAt Real.sin (Real.cos x) x


theorem strictAnti_mul_right [ExistsAddOfLE α] [MulPosStrictMono α]
    [CovariantClass α α (swap (· + ·)) (· < ·)] [ContravariantClass α α (swap (· + ·)) (· < ·)]
    {a : α} (ha : a < 0) : StrictAnti fun x => x * a

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

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


@[simp]
lemma opcyclesMap_neg : opcyclesMap (-φ) = -opcyclesMap φ

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

CategoryTheory.ShortComplex.opcyclesMap (-φ) = -CategoryTheory.ShortComplex.opcyclesMap φ


protected theorem map_add : D (a + b) = D a + D b

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(D : Derivation R A M)
(a b : A)


theorem ite_ite_distrib_left : ite p a (ite q b c) = ite q (ite p a b) (ite p a c)

{α : Sort u_1}
{p q : Prop}
[Decidable p]
[Decidable q]
{a b c : α}

(if p then a else if q then b else c) = if q then if p then a else b else if p then a else c


@[simp]
theorem logEmbeddingQuot_apply (x : (𝓞 K)ˣ) :
    logEmbeddingQuot K ⟦x⟧ = logEmbedding K x

(K : Type u_1)
[Field K]
[NumberField K]
(x : (𝓞 K)ˣ)

(NumberField.Units.logEmbeddingQuot K) ⟦x⟧ = (NumberField.Units.logEmbedding K) x


@[to_additive]
theorem map_comap_eq (H : Subgroup N) : map f (comap f H) = f.range ⊓ H

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)
(H : Subgroup N)

Subgroup.map f (Subgroup.comap f H) = f.range ⊓ H


theorem to_ofNatMultiset (v : Multiset ℕ) (h) : (ofNatMultiset v h : Multiset ℕ) = v

(v : Multiset ℕ)
(h : ∀ p ∈ v, Nat.Prime p)

(PrimeMultiset.ofNatMultiset v h).toNatMultiset = v


@[simp] lemma get_append_cons_zero : get (append (x ::ᵥ xs) ys) ⟨0, by omega⟩ = x

{α : Type u_1}
{m n : ℕ}
(xs : Mathlib.Vector α n)
(ys : Mathlib.Vector α m)
{x : α}


lemma measurable_partitionFiltration_memPartitionSet (ht : ∀ n, MeasurableSet (t n)) (n : ℕ) :
    Measurable[partitionFiltration ht n] (memPartitionSet t n)

{α : Type u_1}
[m : MeasurableSpace α]
{t : ℕ → Set α}
(ht : ∀ (n : ℕ), MeasurableSet (t n))
(n : ℕ)


@[to_additive (attr := simp) snd_comp_prod]
theorem snd_comp_prod (f : M →ₙ* N) (g : M →ₙ* P) : (snd N P).comp (f.prod g) = g

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[Add M]
[Add N]
[Add P]
(f : AddHom M N)
(g : AddHom M P)


theorem intCast_div (a b : ℤ) (h : b ∣ a) : ((a / b : ℤ) : ℚ) = a / b


@[simp] lemma mk_one : (⟨1, one_mem _⟩ : 𝓞 K) = 1


protected theorem neg_lt_sub_right_of_lt_add {a b c : Int} (h : c < a + b) : -b < a - c


theorem Injective.ne (hf : Injective f) {a₁ a₂ : α} : a₁ ≠ a₂ → f a₁ ≠ f a₂

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
(hf : Function.Injective f)
{a₁ a₂ : α}

a₁ ≠ a₂ → f a₁ ≠ f a₂


@[simp]
theorem selfZPow_add {n m : ℤ} : selfZPow x B (n + m) = selfZPow x B n * selfZPow x B m

{R : Type u_1}
[CommRing R]
(x : R)
(B : Type u_2)
[CommRing B]
[Algebra R B]
[IsLocalization.Away x B]
{n m : ℤ}


@[simp] lemma bijOn_symm : BijOn e.symm t s ↔ BijOn e s t

{α : Type u_1}
{β : Type u_2}
{e : α ≃ β}
{s : Set α}
{t : Set β}

Set.BijOn (⇑e.symm) t s ↔ Set.BijOn (⇑e) s t


/-- For any extended real number `x`, the sum of `x` and `⊤` is equal to `⊤`
if and only if `x` is not `⊥`. -/
theorem add_top_iff_ne_bot {x : EReal} : x + ⊤ = ⊤ ↔ x ≠ ⊥

x + ⊤ = ⊤ ↔ x ≠ ⊥


theorem pos_iff_pos_of_mul_pos [PosMulReflectLT α] [MulPosReflectLT α] (hab : 0 < a * b) :
    0 < a ↔ 0 < b

{α : Type u_1}
{a b : α}
[MulZeroClass α]
[Preorder α]
[PosMulReflectLT α]
[MulPosReflectLT α]
(hab : 0 < a * b)


lemma toNNReal_add_add_neg_add_neg_eq (f g : C(X, ℝ)₀) :
    ((f + g).toNNReal + (-f).toNNReal + (-g).toNNReal) =
      ((-(f + g)).toNNReal + f.toNNReal + g.toNNReal)

{X : Type u_1}
[TopologicalSpace X]
[Zero X]
(f g : ContinuousMapZero X ℝ)

(f + g).toNNReal + (-f).toNNReal + (-g).toNNReal = (-(f + g)).toNNReal + f.toNNReal + g.toNNReal


@[norm_cast]
theorem coe_posPart (f : α →₁ₛ[μ] ℝ) : (posPart f : α →₁[μ] ℝ) = Lp.posPart (f : α →₁[μ] ℝ)

(f : ↥(MeasureTheory.Lp.simpleFunc ℝ 1 μ))

↑(MeasureTheory.L1.SimpleFunc.posPart f) = MeasureTheory.Lp.posPart ↑f


/-- The natural transformation `K.homologyπ i : K.cycles i ⟶ K.homology i`
for all `K : HomologicalComplex C c`. -/
@[simps]
noncomputable def natTransHomologyπ [CategoryWithHomology C] :
    cyclesFunctor C c i ⟶ homologyFunctor C c i

(HomologicalComplex.natTransHomologyπ C c i).app K = K.homologyπ i


@[to_additive]
theorem mk'_eq_of_eq' {a₁ b₁ : M} {a₂ b₂ : S} (H : b₁ * ↑a₂ = a₁ * ↑b₂) :
    f.mk' a₁ a₂ = f.mk' b₁ b₂

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(f : S.LocalizationMap N)
{a₁ b₁ : M}
{a₂ b₂ : ↥S}
(H : b₁ * ↑a₂ = a₁ * ↑b₂)


/-- An (additive) Klein four-group is an (additive) group of cardinality four and exponent two. -/
class IsAddKleinFour (G : Type*) [AddGroup G] : Prop where
  card_four : Nat.card G = 4
  exponent_two : AddMonoid.exponent G = 2

{G : Type u_1}
[AddGroup G]
[self : IsAddKleinFour G]


theorem mono_inr_of_isColimit [Mono f] {s : PushoutCocone f g} (hs : IsColimit s) : Mono s.inr

{s : CategoryTheory.Limits.PushoutCocone f g}

(hs : CategoryTheory.Limits.IsColimit s)


@[norm_cast move]
lemma piecewise_coe [∀ j, Decidable (j ∈ (s : Set ι))] :
    (s : Set ι).piecewise f g = s.piecewise f g

{ι : Type u_1}
{π : ι → Sort u_2}
(s : Finset ι)
(f g : (i : ι) → π i)
[(j : ι) → Decidable (j ∈ s)]
[(j : ι) → Decidable (j ∈ ↑s)]


/-- `trim` respects scalar multiplication. -/
theorem trim_smul {R : Type*} [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0∞ ℝ≥0∞] (c : R)
    (m : OuterMeasure α) : (c • m).trim = c • m.trim

{α : Type u_1}
[MeasurableSpace α]
{R : Type u_2}
[SMul R ℝ≥0∞]
[IsScalarTower R ℝ≥0∞ ℝ≥0∞]
(c : R)
(m : MeasureTheory.OuterMeasure α)


/-- If `s` is a countable family of compact sets covering `X`, `f` is a continuous function, and
the sequence `‖f.restrict (s i)‖ * μ (s i)` is summable, then `f` is integrable. -/
theorem integrable_of_summable_norm_restrict {f : C(X, E)} {s : ι → Compacts X}
    (hf : Summable fun i : ι => ‖f.restrict (s i)‖ * ENNReal.toReal (μ <| s i))
    (hs : ⋃ i : ι, ↑(s i) = (univ : Set X)) : Integrable f μ

(hf : Summable fun i => ‖ContinuousMap.restrict (↑(s i)) f‖ * (μ ↑(s i)).toReal)


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

(h : MeasureTheory.HasFiniteIntegral f μ)

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


/-- Given three points in weak order on the same line, with the first not equal to the second,
and a fourth point, the angles at the fourth point between the first and second or first and
third points have the same sign. -/
theorem _root_.Wbtw.oangle_sign_eq_of_ne_left {p₁ p₂ p₃ : P} (p₄ : P) (h : Wbtw ℝ p₁ p₂ p₃)
    (hne : p₁ ≠ p₂) : (∡ p₁ p₄ p₂).sign = (∡ p₁ p₄ p₃).sign

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


protected theorem sup_le {a b c : CauSeq α abs} (ha : a ≤ c) (hb : b ≤ c) : a ⊔ b ≤ c

{α : Type u_1}
[LinearOrderedField α]
{a b c : CauSeq α abs}
(ha : a ≤ c)
(hb : b ≤ c)


@[simp]
theorem prod_sdiff_diagonal : s ×ˢ s \ diagonal α = s.offDiag


@[simp] lemma den_ofNat (n : ℕ) : den (no_index (OfNat.ofNat n)) = 1


theorem closure_eq_self_union_frontier (s : Set X) : closure s = s ∪ frontier s

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


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

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


/-- `Sigma.mk i` as a bundled continuous map. -/
@[simps apply]
def sigmaMk (i : I) : C(X i, Σ i, X i)

{I : Type u_5}
{X : I → Type u_7}
[(i : I) → TopologicalSpace (X i)]
(i : I)
(snd : X i)

(ContinuousMap.sigmaMk i) snd = ⟨i, snd⟩


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

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


/-- Change of variables, general form for scalar functions. If `f` is continuous on `[a, b]` and has
continuous right-derivative `f'` in `(a, b)`, `g` is continuous on `f '' (a, b)` and integrable on
`f '' [a, b]`, and `(g ∘ f) x * f' x` is integrable on `[a, b]`, then we can substitute `u = f x`
to get `∫ x in a..b, (g ∘ f) x * f' x = ∫ u in f a..f b, g u`.
-/
theorem integral_comp_mul_deriv''' {a b : ℝ} {f f' : ℝ → ℝ} {g : ℝ → ℝ}
    (hf : ContinuousOn f [[a, b]])
    (hff' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
    (hg_cont : ContinuousOn g (f '' Ioo (min a b) (max a b))) (hg1 : IntegrableOn g (f '' [[a, b]]))
    (hg2 : IntegrableOn (fun x => (g ∘ f) x * f' x) [[a, b]]) :
    (∫ x in a..b, (g ∘ f) x * f' x) = ∫ u in f a..f b, g u

(hff' : ∀ x ∈ Set.Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Set.Ioi x) x)

(hg_cont : ContinuousOn g (f '' Set.Ioo (min a b) (max a b)))

(hg1 : MeasureTheory.IntegrableOn g (f '' [[a, b]]) MeasureTheory.volume)

(hg2 : MeasureTheory.IntegrableOn (fun x => (g ∘ f) x * f' x) [[a, b]] MeasureTheory.volume)

∫ (x : ℝ) in a..b, (g ∘ f) x * f' x = ∫ (u : ℝ) in f a..f b, g u


theorem real_smul_def (r : ℝ) (j : JordanDecomposition α) :
    r • j = if 0 ≤ r then r.toNNReal • j else -((-r).toNNReal • j)

(j : MeasureTheory.JordanDecomposition α)


/-- In a Banach-algebra `𝔸` over a normed field `𝕂` of characteristic zero, if `x` and `y` are
in the disk of convergence and commute, then `exp 𝕂 (x + y) = (exp 𝕂 x) * (exp 𝕂 y)`. -/
theorem exp_add_of_commute_of_mem_ball [CharZero 𝕂] {x y : 𝔸} (hxy : Commute x y)
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius)
    (hy : y ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) : exp 𝕂 (x + y) = exp 𝕂 x * exp 𝕂 y

(hx : x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

(hy : y ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

NormedSpace.exp 𝕂 (x + y) = NormedSpace.exp 𝕂 x * NormedSpace.exp 𝕂 y


@[simp]
theorem constants_mk₂ (c f₁ f₂ : Type u) (r₁ r₂ : Type v) :
    (Language.mk₂ c f₁ f₂ r₁ r₂).Constants = c

(FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Constants = c


/-- A `C^1` function with compact support is Lipschitz. -/
theorem ContDiff.lipschitzWith_of_hasCompactSupport {f : E' → F'} {n : ℕ∞}
    (hf : HasCompactSupport f) (h'f : ContDiff 𝕂 n f) (hn : 1 ≤ n) :
    ∃ C, LipschitzWith C f

{𝕂 : Type u_1}
[RCLike 𝕂]
{E' : Type u_2}
[NormedAddCommGroup E']
[NormedSpace 𝕂 E']
{F' : Type u_3}
[NormedAddCommGroup F']
[NormedSpace 𝕂 F']
{f : E' → F'}
{n : ℕ∞}
(hf : HasCompactSupport f)
(h'f : ContDiff 𝕂 n f)
(hn : 1 ≤ n)


@[to_additive (attr := simp)]
theorem coe_one {G : Type*} [One G] [TopologicalSpace G] [ChartedSpace H' G] :
    ⇑(1 : C^∞⟮I, N; I', G⟯) = 1

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{H' : Type u_5}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{G : Type u_10}
[One G]
[TopologicalSpace G]
[ChartedSpace H' G]


theorem and_and_and_comm : (a ∧ b) ∧ c ∧ d ↔ (a ∧ c) ∧ b ∧ d


theorem Surjective.iterate (Hsurj : Surjective f) (n : ℕ) : Surjective f^[n]

{α : Type u}
{f : α → α}
(Hsurj : Function.Surjective f)
(n : ℕ)


/-- A natural isomorphism `L₁ ≅ L₂` induces an equivalence of categories
    `Comma L₁ R ≌ Comma L₂ R`. -/
@[simps!]
def mapLeftIso (i : L₁ ≅ L₂) : Comma L₁ R ≌ Comma L₂ R

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(R : CategoryTheory.Functor B T)
{L₁ L₂ : CategoryTheory.Functor A T}
(i : L₁ ≅ L₂)
(X : CategoryTheory.Comma L₂ R)

((CategoryTheory.Comma.mapLeftIso R i).inverse.obj X).right = X.right


@[to_additive]
protected theorem injective (e : M ≃* N) : Function.Injective e

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(e : M ≃+ N)


lemma StarAlgHom.ext_continuousMap [UniqueContinuousFunctionalCalculus R A]
    (a : A) (φ ψ : C(spectrum R a, R) →⋆ₐ[R] A) (hφ : Continuous φ) (hψ : Continuous ψ)
    (h : φ (.restrict (spectrum R a) <| .id R) = ψ (.restrict (spectrum R a) <| .id R)) :
    φ = ψ

(h :
  φ (ContinuousMap.restrict (spectrum R a) (ContinuousMap.id R)) =
    ψ (ContinuousMap.restrict (spectrum R a) (ContinuousMap.id R)))


/-- The continuous homomorphism given by inclusion of the first factor. -/
@[to_additive (attr := simps!)
  "The continuous homomorphism given by inclusion of the first factor."]
def inl : ContinuousMonoidHom A (A × B)

(A : Type u_2)
(B : Type u_3)
[AddMonoid A]
[AddMonoid B]
[TopologicalSpace A]
[TopologicalSpace B]
(i : A)

(ContinuousAddMonoidHom.inl A B) i =
  ((ContinuousAddMonoidHom.id A).toAddMonoidHom i, (ContinuousAddMonoidHom.zero A B).toAddMonoidHom i)


protected theorem sum_mem {t : Finset ι} {f : ι → M} : (∀ c ∈ t, f c ∈ p) → (∑ i ∈ t, f i) ∈ p

{R : Type u}
{M : Type v}
{ι : Type w}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
(p : Submodule R M)
{t : Finset ι}
{f : ι → M}


protected theorem quotientMap (surj : Surjective f) : QuotientMap f

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{σ' : 𝕜' →+* 𝕜}
[RingHomInvPair σ σ']
[RingHomIsometric σ]
[RingHomIsometric σ']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
(f : E →SL[σ] F)
[CompleteSpace F]
[CompleteSpace E]
(surj : Function.Surjective ⇑f)


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

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


theorem of_le_right [LE α] (h : (a:α) ≤ b) (eq : b = b') : a ≤ b'

{α : Type u_1}
{a b b' : α}
[LE α]
(h : a ≤ b)
(eq : b = b')


theorem prod_eq_inf_comap (p : Submodule R M) (q : Submodule R M₂) :
    p.prod q = p.comap (LinearMap.fst R M M₂) ⊓ q.comap (LinearMap.snd R M M₂)

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(p : Submodule R M)
(q : Submodule R M₂)

p.prod q = Submodule.comap (LinearMap.fst R M M₂) p ⊓ Submodule.comap (LinearMap.snd R M M₂) q


/-- If a preadditive category has all cokernels, then it also has all coequalizers. -/
theorem hasCoequalizers_of_hasCokernels [HasCokernels C] : HasCoequalizers C

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


/-- A structure on an Lax functor that promotes an Lax functor to a pseudofunctor.

See `Pseudofunctor.mkOfLax`. -/
structure PseudoCore (F : LaxFunctor B C) where
  mapIdIso (a : B) : F.map (𝟙 a) ≅ 𝟙 (F.obj a)
  mapCompIso {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : F.map (f ≫ g) ≅ F.map f ≫ F.map g
  mapIdIso_inv {a : B} : (mapIdIso a).inv = F.mapId a := by aesop_cat
  mapCompIso_inv {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : (mapCompIso f g).inv = F.mapComp f g := by
    aesop_cat

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{F : CategoryTheory.LaxFunctor B C}
(self : F.PseudoCore)
{a : B}


theorem liftNC_smul {R : Type*} [AddZeroClass G] [Semiring R] (f : k →+* R)
    (g : Multiplicative G →* R) (c : k) (φ : MonoidAlgebra k G) :
    liftNC (f : k →+ R) g (c • φ) = f c * liftNC (f : k →+ R) g φ

{k : Type u₁}
{G : Type u₂}
[Semiring k]
{R : Type u_3}
[AddZeroClass G]
[Semiring R]
(f : k →+* R)
(g : Multiplicative G →* R)
(c : k)
(φ : MonoidAlgebra k G)

(AddMonoidAlgebra.liftNC ↑f ⇑g) (c • φ) = f c * (AddMonoidAlgebra.liftNC ↑f ⇑g) φ


@[simp]
theorem zero_apply (x : α) : (0 : α →ₙ+* β) x = 0

{α : Type u_2}
{β : Type u_3}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
(x : α)


theorem mem_eraseLast {s : CompositionSeries X} {x : X} (h : 0 < s.length) :
    x ∈ s.eraseLast ↔ x ≠ s.last ∧ x ∈ s

{X : Type u}
[Lattice X]
[JordanHolderLattice X]
{s : CompositionSeries X}
{x : X}
(h : 0 < s.length)

x ∈ RelSeries.eraseLast s ↔ x ≠ RelSeries.last s ∧ x ∈ s


@[to_additive]
theorem map [MonoidHomClass F M N] (f : F) {x : M} (h : IsUnit x) : IsUnit (f x)

{F : Type u_1}
{M : Type u_4}
{N : Type u_5}
[FunLike F M N]
[Monoid M]
[Monoid N]
[MonoidHomClass F M N]
(f : F)
{x : M}
(h : IsUnit x)


theorem nodal_eq_mul_nodal_erase [DecidableEq ι] {i : ι} (hi : i ∈ s) :
    nodal s v = (X - C (v i)) * nodal (s.erase i) v

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
{s : Finset ι}
{v : ι → R}
[DecidableEq ι]
{i : ι}
(hi : i ∈ s)

Lagrange.nodal s v = (Polynomial.X - Polynomial.C (v i)) * Lagrange.nodal (s.erase i) v


theorem isPrimitiveRoot_exp (n : ℕ) (h0 : n ≠ 0) : IsPrimitiveRoot (exp (2 * π * I / n)) n

IsPrimitiveRoot (Complex.exp (2 * ↑Real.pi * Complex.I / ↑n)) n


protected theorem map_sub (f : R' →ₑ+*[φ] S') (x y : R') : f (x - y) = f x - f y

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
(R' : Type u_11)
[Ring R']
[MulSemiringAction M R']
(S' : Type u_13)
[Ring S']
[MulSemiringAction N S']
(f : R' →ₑ+*[φ] S')
(x y : R')


theorem isPathConnected_univ [PathConnectedSpace X] : IsPathConnected (univ : Set X)

{X : Type u_1}
[TopologicalSpace X]
[PathConnectedSpace X]


theorem prod_le_prod_iff : s₁ ×ˢ t₁ ≤ s₂ ×ˢ t₂ ↔ s₁ ≤ s₂ ∧ t₁ ≤ t₂ ∨ s₂ = ⊤ ∨ t₂ = ⊤

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s₁ s₂ : UpperSet α}
{t₁ t₂ : UpperSet β}


@[simp]
lemma image_subtype_val_Ici_Iio {a : α} (b : Ici a) : Subtype.val '' Iio b = Ico a b

{α : Type u_1}
[Preorder α]
{a : α}
(b : ↑(Set.Ici a))


protected theorem Adj.fst_mem {H : G.Subgraph} {u v : V} (h : H.Adj u v) : u ∈ H.verts

{V : Type u}
{G : SimpleGraph V}
{H : G.Subgraph}
{u v : V}
(h : H.Adj u v)


/-- Monomorphisms are stable under pullback in the second argument. -/
theorem mono_fst_of_is_pullback_of_mono {t : PullbackCone f g} (ht : IsLimit t) [Mono g] :
    Mono t.fst

{t : CategoryTheory.Limits.PullbackCone f g}


@[simp] theorem ncard_diff_singleton_of_mem {a : α} (h : a ∈ s) (hs : s.Finite := by toFinite_tac) :
    (s \ {a}).ncard = s.ncard - 1

{α : Type u_1}
{s : Set α}
{a : α}
(h : a ∈ s)
(hs : s.Finite := by toFinite_tac)


theorem mem_primeFactorsList_mul_of_coprime {a b : ℕ} (hab : Coprime a b) (p : ℕ) :
    p ∈ (a * b).primeFactorsList ↔ p ∈ a.primeFactorsList ∪ b.primeFactorsList


theorem HasBasis.ext (hl : l.HasBasis p s) (hl' : l'.HasBasis p' s')
    (h : ∀ i, p i → ∃ i', p' i' ∧ s' i' ⊆ s i) (h' : ∀ i', p' i' → ∃ i, p i ∧ s i ⊆ s' i') :
    l = l'

(h : ∀ (i : ι), p i → ∃ i', p' i' ∧ s' i' ⊆ s i)

(h' : ∀ (i' : ι'), p' i' → ∃ i, p i ∧ s i ⊆ s' i')


/-- The functor from differential graded objects to homological complexes.
-/
@[simps]
def dgoToHomologicalComplex :
    DifferentialObject ℤ (GradedObjectWithShift b V) ⥤
      HomologicalComplex V (ComplexShape.up' b)

{X Y : CategoryTheory.DifferentialObject ℤ (CategoryTheory.GradedObjectWithShift b V)}

((HomologicalComplex.dgoToHomologicalComplex b V).map f).f i = f.f i


theorem mul_eq_opow_log_succ {a b : Ordinal.{u}} (ha : a ≠ 0) (hb : Principal (· * ·) b)
    (hb₂ : 2 < b) : a * b = (b^succ (log b a))

(hb : Ordinal.Principal (fun x x_1 => x * x_1) b)

a * b = b ^ Order.succ (Ordinal.log b a)


@[to_additive]
theorem isComplement'_bot_top : IsComplement' (⊥ : Subgroup G) ⊤


theorem sum_sum {ι' : Type*} (μ : ι → ι' → Measure α) :
    (sum fun n => sum (μ n)) = sum (fun (p : ι × ι') ↦ μ p.1 p.2)

{α : Type u_1}
{ι : Type u_5}
{m0 : MeasurableSpace α}
{ι' : Type u_8}
(μ : ι → ι' → MeasureTheory.Measure α)

(MeasureTheory.Measure.sum fun n => MeasureTheory.Measure.sum (μ n)) = MeasureTheory.Measure.sum fun p => μ p.1 p.2


theorem mem_sup_left {S T : Submodule R M} : ∀ {x : M}, x ∈ S → x ∈ S ⊔ T

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{S T : Submodule R M}
{x : M}


@[scoped simp]
theorem map_nat_add' [AddCommMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b]
    (f : F) (n : ℕ) (x : G) : f (↑n + x) = f x + n • b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{b : H}
[AddCommMonoidWithOne G]
[AddMonoid H]
[AddConstMapClass F G H 1 b]
(f : F)
(n : ℕ)
(x : G)


theorem hyperoperation_ge_three_eq_one (n m : ℕ) : hyperoperation (n + 3) m 0 = 1


theorem comp' {n m f g} (hf : @Partrec' m f) (hg : @Vec n m g) : Partrec' fun v => f (g v)

{g : Mathlib.Vector ℕ n → Mathlib.Vector ℕ m}


theorem roots_map {f : K[X]} (hf : f.Splits <| RingHom.id K) : (f.map i).roots = f.roots.map i

(hf : Polynomial.Splits (RingHom.id K) f)

(Polynomial.map i f).roots = Multiset.map (⇑i) f.roots


/-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories
    `Comma L R₁ ≌ Comma L R₂`. -/
@[simps!]
def mapRightIso (i : R₁ ≅ R₂) : Comma L R₁ ≌ Comma L R₂

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
{R₁ R₂ : CategoryTheory.Functor B T}
(i : R₁ ≅ R₂)
(X : CategoryTheory.Comma L R₂)

((CategoryTheory.Comma.mapRightIso L i).inverse.obj X).left = X.left


@[to_additive]
theorem ker_le_range_iff {I : Type w} [Group I] (f : G →* H) [f.range.Normal] (g : H →* I) :
    g.ker ≤ f.range ↔ (mk' f.range).comp g.ker.subtype = 1

{G : Type u}
[Group G]
{H : Type v}
[Group H]
{I : Type w}
[Group I]
(f : G →* H)
[f.range.Normal]
(g : H →* I)

g.ker ≤ f.range ↔ (QuotientGroup.mk' f.range).comp g.ker.subtype = 1


lemma exists_eventually_r_le_const_mul :
    ∃ c ∈ Set.Ioo (0 : ℝ) 1, ∀ᶠ (n : ℕ) in atTop, ∀ i, r i n ≤ c * n

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

∃ c ∈ Set.Ioo 0 1, ∀ᶠ (n : ℕ) in Filter.atTop, ∀ (i : α), ↑(r i n) ≤ c * ↑n


lemma norm_prod_le_iff : ‖x‖ ≤ r ↔ ‖x.1‖ ≤ r ∧ ‖x.2‖ ≤ r

{E : Type u_2}
{F : Type u_3}
[Norm E]
[Norm F]
{x : E × F}
{r : ℝ}

‖x‖ ≤ r ↔ ‖x.1‖ ≤ r ∧ ‖x.2‖ ≤ r


theorem AddSubgroup.quotient_norm_eq {S : AddSubgroup M} (x : M ⧸ S) :
    ‖x‖ = sInf (norm '' { m : M | (m : M ⧸ S) = x })

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


@[simp]
theorem span_left {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) : (span f g).obj WalkingSpan.left = Y

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

(CategoryTheory.Limits.span f g).obj CategoryTheory.Limits.WalkingSpan.left = Y


@[reassoc (attr := simp)]
theorem diagonalObjPullbackFstIso_hom_snd {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    (diagonalObjPullbackFstIso f g).hom ≫ pullback.snd _ _ =
      pullback.fst _ _ ≫ pullback.fst _ _

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Limits.HasPullbacks C]
{X Y Z : C}
(f : X ⟶ Z)
(g : Y ⟶ Z)

(CategoryTheory.Limits.diagonalObjPullbackFstIso f g).hom ≫
    CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.snd g g ≫ g) f =
  CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst f g) (CategoryTheory.Limits.pullback.fst f g) ≫
    CategoryTheory.Limits.pullback.fst f g


@[simp]
lemma forget₂_module_obj (X : AlgebraCat.{v} R) :
    (forget₂ (AlgebraCat.{v} R) (ModuleCat.{v} R)).obj X = ModuleCat.of R X

(R : Type u)
[CommRing R]
(X : AlgebraCat R)

(CategoryTheory.forget₂ (AlgebraCat R) (ModuleCat R)).obj X = ModuleCat.of R ↑X


@[simp]
theorem mem_sup : x ∈ s ⊔ t ↔ x ∈ s ∨ x ∈ t

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{A : Set M}
{α : Type u₁}
{s t : L.DefinableSet A α}
{x : α → M}


theorem toDual_apply_right (i : ι) (m : M) : b.toDual (b i) m = b.repr m i

{R : Type uR}
{M : Type uM}
{ι : Type uι}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[DecidableEq ι]
(b : Basis ι R M)
(i : ι)
(m : M)


@[to_additive] -- Porting note: simp removed, simpNF says LHS simplifies to itself
theorem ofHom_apply {X Y : Type u} [Semigroup X] [Semigroup Y] (f : X →ₙ* Y) (x : X) :
    ofHom f x = f x

{X Y : Type u}
[AddSemigroup X]
[AddSemigroup Y]
(f : AddHom X Y)
(x : X)


theorem eq_zero_or_eq_succ_pred : ∀ n, n = 0 ∨ n = succ (pred n)


/-- If `f a = 1` when `a ∉ s`, then the product of `f i` over `i ∈ insert a s` equals the product of
`f i` over `i ∈ s`. -/
@[to_additive
      "If `f a = 0` when `a ∉ s`, then the sum of `f i` over `i ∈ insert a s` equals the sum
      of `f i` over `i ∈ s`."]
theorem finprod_mem_insert_of_eq_one_if_not_mem (h : a ∉ s → f a = 1) :
    ∏ᶠ i ∈ insert a s, f i = ∏ᶠ i ∈ s, f i

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

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


@[to_additive]
lemma isOfFinOrder_of_finite (x : G) : IsOfFinOrder x

{G : Type u_1}
[AddLeftCancelMonoid G]
[Finite G]
(x : G)


theorem mk_finsupp_of_infinite' (α β : Type u) [Nonempty α] [Zero β] [Infinite β] :
    #(α →₀ β) = max #α #β


theorem minFac_le_of_dvd {n : ℕ} : ∀ {m : ℕ}, 2 ≤ m → m ∣ n → minFac n ≤ m


@[typevec]
theorem repeat_eq_nil (α : TypeVec 0) : repeatEq α = nilFun


theorem isOpen_biInter_finset {s : Finset α} {f : α → Set X} (h : ∀ i ∈ s, IsOpen (f i)) :
    IsOpen (⋂ i ∈ s, f i)

{X : Type u}
{α : Type u_1}
[TopologicalSpace X]
{s : Finset α}
{f : α → Set X}
(h : ∀ i ∈ s, IsOpen (f i))


theorem IsOpen.isOpenMap_subtype_val {s : Set X} (hs : IsOpen s) : IsOpenMap ((↑) : s → X)

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : IsOpen s)


theorem max_sub_max_le_max (a b c d : α) : max a b - max c d ≤ max (a - c) (b - d)

{α : Type u_1}
[LinearOrderedAddCommGroup α]
(a b c d : α)


lemma essFiniteType_iff :
    EssFiniteType R S ↔ ∃ (σ : Finset S),
      (∀ s : S, ∃ t ∈ Algebra.adjoin R (σ : Set S),
        IsUnit t ∧ s * t ∈ Algebra.adjoin R (σ : Set S))

(R : Type u_1)
(S : Type u_2)
[CommRing R]
[CommRing S]
[Algebra R S]

Algebra.EssFiniteType R S ↔ ∃ σ, ∀ (s : S), ∃ t ∈ Algebra.adjoin R ↑σ, IsUnit t ∧ s * t ∈ Algebra.adjoin R ↑σ


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


theorem of'_divOf (a : G) : of' k G a /ᵒᶠ a = 1

{k : Type u_1}
{G : Type u_2}
[Semiring k]
[AddCancelCommMonoid G]
(a : G)

(AddMonoidAlgebra.of' k G a).divOf a = 1


theorem logEmbedding_eq_zero_iff {x : (𝓞 K)ˣ} :
    logEmbedding K x = 0 ↔ x ∈ torsion K

{K : Type u_1}
[Field K]
[NumberField K]
{x : (𝓞 K)ˣ}

(NumberField.Units.logEmbedding K) x = 0 ↔ x ∈ NumberField.Units.torsion K


theorem manyOneEquiv_up {α} [Primcodable α] {p : α → Prop} : ManyOneEquiv (p ∘ ULower.up) p

{α : Type u_1}
[Primcodable α]
{p : α → Prop}


/-- Subsemiring closure of a set is monotone in its argument: if `s ⊆ t`,
then `closure s ≤ closure t`. -/
theorem closure_mono ⦃s t : Set R⦄ (h : s ⊆ t) : closure s ≤ closure t

{R : Type u}
[NonUnitalNonAssocSemiring R]
⦃s t : Set R⦄
(h : s ⊆ t)

NonUnitalSubsemiring.closure s ≤ NonUnitalSubsemiring.closure t


theorem measure_eq_right_of_subset_of_measure_add_eq {s t : Set α} (h : (μ + ν) t ≠ ∞) (h' : s ⊆ t)
    (h'' : (μ + ν) s = (μ + ν) t) : ν s = ν t

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{s t : Set α}
(h : (μ + ν) t ≠ ⊤)
(h' : s ⊆ t)
(h'' : (μ + ν) s = (μ + ν) t)


/-- (Implementation). The sheaf map given in `types.sheaf_hom` is natural in terms of `X`. -/
@[simps]
noncomputable def sheafCoyonedaHom (α : G.op ⋙ ℱ ⟶ G.op ⋙ ℱ'.val) :
    coyoneda ⋙ (whiskeringLeft Dᵒᵖ A (Type _)).obj ℱ ⟶
      coyoneda ⋙ (whiskeringLeft Dᵒᵖ A (Type _)).obj ℱ'.val

{K : CategoryTheory.GrothendieckTopology D}

(CategoryTheory.Functor.IsCoverDense.sheafCoyonedaHom α).app X =
  CategoryTheory.Functor.IsCoverDense.Types.presheafHom
    (CategoryTheory.Functor.IsCoverDense.homOver α (Opposite.unop X))


nonrec theorem IsLocalMinOn.max (hf : IsLocalMinOn f s a) (hg : IsLocalMinOn g s a) :
    IsLocalMinOn (fun x => max (f x) (g x)) s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder β]
{f g : α → β}
{a : α}
{s : Set α}
(hf : IsLocalMinOn f s a)
(hg : IsLocalMinOn g s a)


@[to_additive]
theorem subgroupOf_range_eq_of_le {G₁ G₂ : Type*} [Group G₁] [Group G₂] {K : Subgroup G₂}
    (f : G₁ →* G₂) (h : f.range ≤ K) :
    f.range.subgroupOf K = (f.codRestrict K fun x => h ⟨x, rfl⟩).range

{G₁ : Type u_7}
{G₂ : Type u_8}
[Group G₁]
[Group G₂]
{K : Subgroup G₂}
(f : G₁ →* G₂)
(h : f.range ≤ K)

f.range.subgroupOf K = (f.codRestrict K ⋯).range


theorem of_map_inf [SemilatticeInf α] [SemilatticeInf β] {f : α → β}
    (h : ∀ x y, f (x ⊓ y) = f x ⊓ f y) : Monotone f

(h : ∀ (x y : α), f (x ⊓ y) = f x ⊓ f y)


@[simp]
theorem trans_toEmbedding {α β γ : Type*} (e : α ≃ β) (f : β ≃ γ) :
    (e.trans f).toEmbedding = e.toEmbedding.trans f.toEmbedding

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


theorem PartiallyWellOrderedOn.exists_monotone_subseq (h : s.PartiallyWellOrderedOn r) (f : ℕ → α)
    (hf : ∀ n, f n ∈ s) : ∃ g : ℕ ↪o ℕ, ∀ m n : ℕ, m ≤ n → r (f (g m)) (f (g n))

{α : Type u_2}
{r : α → α → Prop}
{s : Set α}
[IsRefl α r]
[IsTrans α r]
(h : s.PartiallyWellOrderedOn r)
(f : ℕ → α)
(hf : ∀ (n : ℕ), f n ∈ s)

∃ g, ∀ (m n : ℕ), m ≤ n → r (f (g m)) (f (g n))


lemma card_filter_piFinset_eq (s : ∀ i, Finset (α i)) (i : ι) (a : α i) :
    ((piFinset s).filter fun f ↦ f i = a).card =
      if a ∈ s i then ∏ b ∈ univ.erase i, (s b).card else 0

{ι : Type u_4}
{α : ι → Type u_6}
[DecidableEq ι]
[Fintype ι]
[(i : ι) → DecidableEq (α i)]
(s : (i : ι) → Finset (α i))
(i : ι)
(a : α i)

(Finset.filter (fun f => f i = a) (Fintype.piFinset s)).card =
  if a ∈ s i then ∏ b ∈ Finset.univ.erase i, (s b).card else 0


theorem toMatrix_apply : e.toMatrix v i j = e.repr (v j) i

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_5}
{M : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(e : Basis ι R M)
(v : ι' → M)
(i : ι)
(j : ι')


/-- The weighted sum is unaffected by removing the base point, if
present, from the set of points. -/
@[simp (high)]
theorem weightedVSubOfPoint_erase [DecidableEq ι] (w : ι → k) (p : ι → P) (i : ι) :
    (s.erase i).weightedVSubOfPoint p (p i) w = s.weightedVSubOfPoint p (p i) w

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

((s.erase i).weightedVSubOfPoint p (p i)) w = (s.weightedVSubOfPoint p (p i)) w


@[simp]
theorem multispan_obj_left (a) : I.multispan.obj (WalkingMultispan.left a) = I.left a

(I : CategoryTheory.Limits.MultispanIndex C)

I.multispan.obj (CategoryTheory.Limits.WalkingMultispan.left a) = I.left a


theorem coe_inv' (A : symplecticGroup l R) : (↑A⁻¹ : Matrix (l ⊕ l) (l ⊕ l) R) = (↑A)⁻¹

{l : Type u_1}
{R : Type u_2}
[DecidableEq l]
[Fintype l]
[CommRing R]
(A : ↥(Matrix.symplecticGroup l R))

↑A⁻¹ = (↑A)⁻¹


theorem ediv_nonpos {a b : Int} (Ha : 0 ≤ a) (Hb : b ≤ 0) : a / b ≤ 0


/-- Two elements `a` and `b` are regular if and only if both products `a * b` and `b * a`
are regular. -/
@[to_additive "Two elements `a` and `b` are add-regular if and only if both sums `a + b` and
`b + a` are add-regular."]
theorem isRegular_mul_and_mul_iff :
    IsRegular (a * b) ∧ IsRegular (b * a) ↔ IsRegular a ∧ IsRegular b

{R : Type u_1}
[AddSemigroup R]
{a b : R}

IsAddRegular (a + b) ∧ IsAddRegular (b + a) ↔ IsAddRegular a ∧ IsAddRegular b


@[simp] lemma toUpper_ofUpper (a : WithUpper α) : toUpper (ofUpper a) = a

{α : Type u_1}
(a : Topology.WithUpper α)

Topology.WithUpper.toUpper (Topology.WithUpper.ofUpper a) = a


/-- The functor `Square C ⥤ Arrow (Arrow C)` which sends a
commutative square `sq` to the obvious arrow from the left morphism of `sq`
to the right morphism of `sq`. -/
@[simps!]
def toArrowArrowFunctor : Square C ⥤ Arrow (Arrow C)

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

(CategoryTheory.Square.toArrowArrowFunctor.obj sq).hom.left = sq.f₁₂


@[trans]
theorem mem_of_mem_of_subset {x : α} {s t : Set α} (hx : x ∈ s) (h : s ⊆ t) : x ∈ t

{α : Type u}
{x : α}
{s t : Set α}
(hx : x ∈ s)
(h : s ⊆ t)


/-- If `F : C ⥤ D` is fully faithful, every isomorphism `F.obj X ≅ F.obj Y` has a preimage. -/
@[simps]
noncomputable def preimageIso (f : F.obj X ≅ F.obj Y) :
    X ≅ Y

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
{X Y : C}
[F.Full]
[F.Faithful]
(f : F.obj X ≅ F.obj Y)

(F.preimageIso f).inv = F.preimage f.inv


theorem exists_pred_iterate_or : (∃ n, pred^[n] b = a) ∨ ∃ n, pred^[n] a = b

{α : Type u_1}
[LinearOrder α]
[PredOrder α]
[IsPredArchimedean α]
{a b : α}

(∃ n, Order.pred^[n] b = a) ∨ ∃ n, Order.pred^[n] a = b


theorem Tendsto.mono_left {f : α → β} {x y : Filter α} {z : Filter β} (hx : Tendsto f x z)
    (h : y ≤ x) : Tendsto f y z

{α : Type u}
{β : Type v}
{f : α → β}
{x y : Filter α}
{z : Filter β}
(hx : Filter.Tendsto f x z)
(h : y ≤ x)


@[deprecated getElem_of_append (since := "2024-06-12")]
theorem get_of_append {l : List α} (eq : l = l₁ ++ a :: l₂) (h : l₁.length = n) :
    l.get ⟨n, get_of_append_proof eq h⟩ = a

{α : Type u_1}
{l₁ : List α}
{a : α}
{l₂ : List α}
{n : Nat}
{l : List α}
(eq : l = l₁ ++ a :: l₂)
(h : l₁.length = n)


theorem mul_le_of_limit {a b c : Ordinal} (h : IsLimit b) : a * b ≤ c ↔ ∀ b' < b, a * b' ≤ c


/-- The element `0` is regular if and only if `R` is trivial. -/
theorem IsRegular.subsingleton (h : IsRegular (0 : R)) : Subsingleton R

{R : Type u_1}
[MulZeroClass R]
(h : IsRegular 0)


@[to_additive]
protected lemma div_mul_cancel_left (h : IsUnit a) (b : α) : a / (a * b) = b⁻¹

{α : Type u}
[DivisionCommMonoid α]
{a : α}
(h : IsUnit a)
(b : α)


theorem eq_of_mem_map_const {b₁ b₂ : β} {l : List α} (h : b₁ ∈ map (const α b₂) l) :
    b₁ = b₂

(h : b₁ ∈ List.map (Function.const α b₂) l)


/-- A path `Path x₀ x₁` generates a homotopy between constant functions `fun _ ↦ x₀` and
`fun _ ↦ x₁`. -/
@[simps!]
def toHomotopyConst (p : Path x₀ x₁) :
    (ContinuousMap.const Y x₀).Homotopy (ContinuousMap.const Y x₁)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{x₀ x₁ : X}
(p : Path x₀ x₁)

∀ (a : ↑I × Y), p.toHomotopyConst a = p a.1


theorem lintegral_comp (η : Kernel β γ) (κ : Kernel α β) (a : α) {g : γ → ℝ≥0∞}
    (hg : Measurable g) : ∫⁻ c, g c ∂(η ∘ₖ κ) a = ∫⁻ b, ∫⁻ c, g c ∂η b ∂κ a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
(η : ProbabilityTheory.Kernel β γ)
(κ : ProbabilityTheory.Kernel α β)
(a : α)
{g : γ → ℝ≥0∞}
(hg : Measurable g)

∫⁻ (c : γ), g c ∂(η.comp κ) a = ∫⁻ (b : β), ∫⁻ (c : γ), g c ∂η b ∂κ a


@[simp]
theorem mem_map (m' : M') : m' ∈ N.map f ↔ ∃ m, m ∈ N ∧ f m = m'

{R : Type u}
{L : Type v}
{M : Type w}
{M' : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup M']
[Module R M']
[LieRingModule L M']
{f : M →ₗ⁅R,L⁆ M'}
{N : LieSubmodule R L M}
(m' : M')

m' ∈ LieSubmodule.map f N ↔ ∃ m ∈ N, f m = m'


lemma IsLowerSet.sdiff_of_isUpperSet (hs : IsLowerSet s) (ht : IsUpperSet t) : IsLowerSet (s \ t)

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


@[to_additive]
theorem mul_iInter₂_subset (s : Set α) (t : ∀ i, κ i → Set α) :
    (s * ⋂ (i) (j), t i j) ⊆ ⋂ (i) (j), s * t i j

{α : Type u_2}
{ι : Sort u_5}
{κ : ι → Sort u_6}
[Add α]
(s : Set α)
(t : (i : ι) → κ i → Set α)

s + ⋂ i, ⋂ j, t i j ⊆ ⋂ i, ⋂ j, s + t i j


@[simp] lemma insert_sdiff_cancel (ha : a ∉ s) : insert a s \ s = {a}

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


theorem coe_ker : (f.ker : Set V₁) = (f : V₁ → V₂) ⁻¹' {0}

{V₁ : Type u_3}
{V₂ : Type u_4}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f : NormedAddGroupHom V₁ V₂)


lemma setIntegral_preCDF_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set α} (hs : MeasurableSet s)
    [IsFiniteMeasure ρ] :
    ∫ x in s, (preCDF ρ r x).toReal ∂ρ.fst = (ρ.IicSnd r s).toReal

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
(r : ℚ)
{s : Set α}
(hs : MeasurableSet s)
[MeasureTheory.IsFiniteMeasure ρ]

∫ (x : α) in s, (ProbabilityTheory.preCDF ρ r x).toReal ∂ρ.fst = ((ρ.IicSnd ↑r) s).toReal


@[simp]
theorem inter_left_idem (s t : Finset α) : s ∩ (s ∩ t) = s ∩ t

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


@[to_additive]
theorem continuous_prod [Monoid α] [ContinuousMul α] : Continuous (prod : List α → α)

{α : Type u_1}
[TopologicalSpace α]
[AddMonoid α]
[ContinuousAdd α]


@[to_additive]
theorem inv_eq_of_mul_eq_one_right : a * b = 1 → a⁻¹ = b

{G : Type u_1}
[SubtractionMonoid G]
{a b : G}


theorem nnabs_coe (x : ℝ≥0) : nnabs x = x


@[to_additive]
theorem HasCompactMulSupport.mul (hf : HasCompactMulSupport f) (hf' : HasCompactMulSupport f') :
    HasCompactMulSupport (f * f')

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[MulOneClass β]
{f f' : α → β}
(hf : HasCompactMulSupport f)
(hf' : HasCompactMulSupport f')


theorem one_lt_of_mem_cycleType {σ : Perm α} {n : ℕ} (h : n ∈ σ.cycleType) : 1 < n

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{σ : Equiv.Perm α}
{n : ℕ}
(h : n ∈ σ.cycleType)


@[to_additive (attr := continuity, fun_prop)]
theorem continuous_one [TopologicalSpace M] [One M] : Continuous (1 : X → M)

{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[Zero M]


@[simp, reassoc]
theorem unop_comp {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g).unop = g.unop ≫ f.unop

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

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


@[simp]
theorem rightUnitor_inv_apply {M : ModuleCat.{u} R} (m : M) :
    ((ρ_ M).inv : M ⟶ M ⊗ 𝟙_ (ModuleCat.{u} R)) m = m ⊗ₜ[R] 1

{R : Type u}
[CommRing R]
{M : ModuleCat R}
(m : ↑M)

(CategoryTheory.MonoidalCategory.rightUnitor M).inv m = m ⊗ₜ[R] 1


theorem val_eq_val (a b : Fin n) : (a : ℕ) = b ↔ a = b


theorem append_right (r : α → α → Prop) : ∀ {s₁ s₂} (t), Lex r s₁ s₂ → Lex r s₁ (s₂ ++ t)

{α : Type u}
(r : α → α → Prop)
{s₁ s₂ : List α}
(t : List α)

List.Lex r s₁ s₂ → List.Lex r s₁ (s₂ ++ t)


lemma densityProcess_mono_set (hκν : fst κ ≤ ν) (n : ℕ) (a : α) (x : γ)
    {s s' : Set β} (h : s ⊆ s') :
    densityProcess κ ν n a x s ≤ densityProcess κ ν n a x s'

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

κ.densityProcess ν n a x s ≤ κ.densityProcess ν n a x s'


theorem yang_baxter' (X Y Z : C) :
    (β_ X Y).hom ▷ Z ⊗≫ Y ◁ (β_ X Z).hom ⊗≫ (β_ Y Z).hom ▷ X =
      𝟙 _ ⊗≫ (X ◁ (β_ Y Z).hom ⊗≫ (β_ X Z).hom ▷ Y ⊗≫ Z ◁ (β_ X Y).hom) ⊗≫ 𝟙 _

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

(β_ X Y).hom ▷ Z ⊗≫ Y ◁ (β_ X Z).hom ⊗≫ (β_ Y Z).hom ▷ X =
  𝟙 ((X ⊗ Y) ⊗ Z) ⊗≫ (X ◁ (β_ Y Z).hom ⊗≫ (β_ X Z).hom ▷ Y ⊗≫ Z ◁ (β_ X Y).hom) ⊗≫ 𝟙 ((Z ⊗ Y) ⊗ X)


theorem HasFPowerSeriesOnBall.sum (h : HasFPowerSeriesOnBall f p x r) {y : E}
    (hy : y ∈ EMetric.ball (0 : E) r) : f (x + y) = p.sum y

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
(h : HasFPowerSeriesOnBall f p x r)
{y : E}
(hy : y ∈ EMetric.ball 0 r)


/-- Given an equivalence `e : R ≃+* S` of rings and a subring `s` of `R`,
`subringMap e s` is the induced equivalence between `s` and `s.map e` -/
@[simps!]
def subringMap (e : R ≃+* S) : s ≃+* s.map e.toRingHom

(y : ↑(⇑↑e.toAddEquiv '' ↑s.toAddSubmonoid))


/-- Expressing `HasDerivWithinAt f f' s x` in terms of `HasFDerivWithinAt` -/
theorem hasDerivWithinAt_iff_hasFDerivWithinAt {f' : F} :
    HasDerivWithinAt f f' s x ↔ HasFDerivWithinAt f (smulRight (1 : 𝕜 →L[𝕜] 𝕜) f') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
{f' : F}

HasDerivWithinAt f f' s x ↔ HasFDerivWithinAt f (ContinuousLinearMap.smulRight 1 f') s x


@[simp]
theorem inf_nhds_atTop (a : α) : 𝓝 a ⊓ atTop = ⊥

{α : Type u}
[Preorder α]
[NoTopOrder α]
[TopologicalSpace α]
[ClosedIciTopology α]
(a : α)


/-- The antidiagonal of `0` is the list `[(0, 0)]` -/
@[simp]
theorem antidiagonal_zero : antidiagonal 0 = {(0, 0)}


@[simp] theorem tailD_eq_tail? (l l' : List α) : tailD l l' = (tail? l).getD l'


theorem fromRel_ne : fromRel (fun (x y : α) z => z.symm : Symmetric Ne) = {z | ¬IsDiag z}


@[simp] theorem UInt64.toUInt32_toNat (x : UInt64) : x.toUInt32.toNat = x.toNat % 2 ^ 32


/-- See also `Finset.prod_apply`, with the same conclusion but with the weaker hypothesis
`f : α → β → γ` -/
@[to_additive (attr := simp)
  "See also `Finset.sum_apply`, with the same conclusion but with the weaker hypothesis
  `f : α → β → γ`"]
theorem MonoidHom.finset_prod_apply [MulOneClass β] [CommMonoid γ] (f : α → β →* γ) (s : Finset α)
    (b : β) : (∏ x ∈ s, f x) b = ∏ x ∈ s, f x b

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[AddZeroClass β]
[AddCommMonoid γ]
(f : α → β →+ γ)
(s : Finset α)
(b : β)


theorem pairwise_bind {R : β → β → Prop} {l : List α} {f : α → List β} :
    List.Pairwise R (l.bind f) ↔
      (∀ a ∈ l, Pairwise R (f a)) ∧ Pairwise (fun a₁ a₂ => ∀ x ∈ f a₁, ∀ y ∈ f a₂, R x y) l

{β : Type u_1}
{α : Type u_2}
{R : β → β → Prop}
{l : List α}
{f : α → List β}

List.Pairwise R (l.bind f) ↔
  (∀ (a : α), a ∈ l → List.Pairwise R (f a)) ∧
    List.Pairwise (fun a₁ a₂ => ∀ (x : β), x ∈ f a₁ → ∀ (y : β), y ∈ f a₂ → R x y) l


theorem Antitone.prod_map (hf : Antitone f) (hg : Antitone g) : Antitone (Prod.map f g)

{α : Type u}
{β : Type v}
{γ : Type w}
{δ : Type u_2}
[Preorder α]
[Preorder β]
[Preorder γ]
[Preorder δ]
{f : α → γ}
{g : β → δ}
(hf : Antitone f)
(hg : Antitone g)


/-- Equivalence between Young diagrams and weakly decreasing lists of positive natural numbers.
A Young diagram `μ` is equivalent to a list of row lengths. -/
@[simps]
def equivListRowLens : YoungDiagram ≃ { w : List ℕ // w.Sorted (· ≥ ·) ∧ ∀ x ∈ w, 0 < x }

↑(YoungDiagram.equivListRowLens μ) = μ.rowLens


@[simp]
theorem neLocus_zero_left : (0 : α →₀ N).neLocus f = f.support

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
(f : α →₀ N)


@[simp]
theorem totalSpaceMk_preimage_source (b : B) :
    TotalSpace.mk b ⁻¹' (a.pretrivializationAt b).source = univ

{B : Type u_2}
{F : Type u_3}
{E : B → Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
[(x : B) → TopologicalSpace (E x)]
(a : FiberPrebundle F E)
(b : B)

Bundle.TotalSpace.mk b ⁻¹' (a.pretrivializationAt b).source = Set.univ


theorem bounded_ge_inter_not_ge [SemilatticeInf α] (a : α) :
    Bounded (· ≥ ·) (s ∩ { b | ¬a ≤ b }) ↔ Bounded (· ≥ ·) s

{α : Type u_1}
{s : Set α}
[SemilatticeInf α]
(a : α)

Set.Bounded (fun x x_1 => x ≥ x_1) (s ∩ {b | ¬a ≤ b}) ↔ Set.Bounded (fun x x_1 => x ≥ x_1) s


/-- If two expansions (along the positive characteristic) of two separable polynomials `g` and `g'`
agree, then they have the same degree. -/
theorem contraction_degree_eq_or_insep [hq : NeZero q] [CharP F q] (g g' : F[X]) (m m' : ℕ)
    (h_expand : expand F (q ^ m) g = expand F (q ^ m') g') (hg : g.Separable) (hg' : g'.Separable) :
    g.natDegree = g'.natDegree

(h_expand : (Polynomial.expand F (q ^ m)) g = (Polynomial.expand F (q ^ m')) g')


theorem monotoneOn_iff_forall_lt :
    MonotoneOn f s ↔ ∀ ⦃a⦄ (_ : a ∈ s) ⦃b⦄ (_ : b ∈ s), a < b → f a ≤ f b

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

MonotoneOn f s ↔ ∀ ⦃a : α⦄, a ∈ s → ∀ ⦃b : α⦄, b ∈ s → a < b → f a ≤ f b


theorem ToAdjoin.injective (hx : IsIntegral R x) : Function.Injective (Minpoly.toAdjoin R x)

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
[IsDomain R]
[Algebra R S]
[IsDomain S]
[NoZeroSMulDivisors R S]
[IsIntegrallyClosed R]
{x : S}
(hx : IsIntegral R x)

Function.Injective ⇑(AdjoinRoot.Minpoly.toAdjoin R x)


lemma comp_isLocallySurjective_iff
    {F₁ F₂ F₃ : Cᵒᵖ ⥤ A} (f₁ : F₁ ⟶ F₂) (f₂ : F₂ ⟶ F₃)
    [IsLocallySurjective J f₁] :
    IsLocallySurjective J (f₁ ≫ f₂) ↔ IsLocallySurjective J f₂

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.Presheaf.IsLocallySurjective J (f₁ ≫ f₂) ↔ CategoryTheory.Presheaf.IsLocallySurjective J f₂


/-- The underlying oplax natural transformation of a strong natural transformation. -/
@[simps]
def toOplax {F G : OplaxFunctor B C} (η : StrongOplaxNatTrans F G) : OplaxNatTrans F G

(η : CategoryTheory.StrongOplaxNatTrans F G)


theorem ae_le_toMeasurable : s ≤ᵐ[μ] toMeasurable μ s

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


protected theorem div_nonneg {a b : Int} (Ha : 0 ≤ a) (Hb : 0 ≤ b) : 0 ≤ a.div b


@[to_additive (attr := simp)] lemma map_mk'_self : N.map (mk' N) = ⊥

{G : Type u}
[Group G]
(N : Subgroup G)
[nN : N.Normal]

Subgroup.map (QuotientGroup.mk' N) N = ⊥


theorem map_coe_ennreal_restrict (f : α →ₛ ℝ≥0) (s : Set α) :
    (f.restrict s).map ((↑) : ℝ≥0 → ℝ≥0∞) = (f.map (↑)).restrict s

{α : Type u_1}
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α ℝ≥0)
(s : Set α)

MeasureTheory.SimpleFunc.map ENNReal.ofNNReal (f.restrict s) =
  (MeasureTheory.SimpleFunc.map ENNReal.ofNNReal f).restrict s


@[to_additive (attr := simp)]
theorem aemeasurable_inv_iff {G : Type*} [Group G] [MeasurableSpace G] [MeasurableInv G]
    {f : α → G} : AEMeasurable (fun x => (f x)⁻¹) μ ↔ AEMeasurable f μ

{α : Type u_3}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{G : Type u_4}
[Group G]
[MeasurableSpace G]
[MeasurableInv G]
{f : α → G}


theorem diff_subset_closure_iff : s \ t ⊆ closure t ↔ s ⊆ closure t

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


theorem pow_succ' {m n : Nat} : m ^ n.succ = m * m ^ n


/-- Two subrings are equal if they have the same elements. -/
@[ext]
theorem ext {S T : Subring R} (h : ∀ x, x ∈ S ↔ x ∈ T) : S = T

{R : Type u}
[Ring R]
{S T : Subring R}
(h : ∀ (x : R), x ∈ S ↔ x ∈ T)


/-- Inversion on a `Group` or `GroupWithZero` is a permutation of the underlying type. -/
@[to_additive (attr := simps! (config := .asFn) apply)
    "Negation on an `AddGroup` is a permutation of the underlying type."]
protected def inv : Perm G


/-- The distance from `x` to `s` or `t` is controlled in terms of the Hausdorff distance
between `s` and `t`. -/
theorem infEdist_le_infEdist_add_hausdorffEdist :
    infEdist x t ≤ infEdist x s + hausdorffEdist s t

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{s t : Set α}

EMetric.infEdist x t ≤ EMetric.infEdist x s + EMetric.hausdorffEdist s t


theorem measure_eq_trim (s : Set α) : μ s = μ.toOuterMeasure.trim s

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


protected theorem tsub_lt_iff_tsub_lt (hb : AddLECancellable b) (hc : AddLECancellable c)
    (h₁ : b ≤ a) (h₂ : c ≤ a) : a - b < c ↔ a - c < b

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


lemma exists_isRegular_of_finrank_le_card (h : finrank R L ≤ #R) :
    ∃ x : L, IsRegular R x

(h : ↑(FiniteDimensional.finrank R L) ≤ Cardinal.mk R)


/-- A field extension E/F is Galois if it is both separable and normal. Note that in mathlib
a separable extension of fields is by definition algebraic. -/
class IsGalois : Prop where
  [to_isSeparable : Algebra.IsSeparable F E]
  [to_normal : Normal F E]

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
[self : IsGalois F E]


theorem projective_def' :
    Projective R P ↔ ∃ s : P →ₗ[R] P →₀ R, Finsupp.total P P R id ∘ₗ s = .id

{R : Type u_1}
[Semiring R]
{P : Type u_2}
[AddCommMonoid P]
[Module R P]

Module.Projective R P ↔ ∃ s, Finsupp.total P P R id ∘ₗ s = LinearMap.id


theorem mapRange_sub' [AddGroup G] [SubtractionMonoid H] [FunLike β G H] [AddMonoidHomClass β G H]
    {f : β} (v₁ v₂ : α →₀ G) :
    mapRange f (map_zero f) (v₁ - v₂) = mapRange f (map_zero f) v₁ - mapRange f (map_zero f) v₂

{α : Type u_1}
{β : Type u_2}
{G : Type u_9}
{H : Type u_10}
[AddGroup G]
[SubtractionMonoid H]
[FunLike β G H]
[AddMonoidHomClass β G H]
{f : β}
(v₁ v₂ : α →₀ G)

Finsupp.mapRange ⇑f ⋯ (v₁ - v₂) = Finsupp.mapRange ⇑f ⋯ v₁ - Finsupp.mapRange ⇑f ⋯ v₂


@[simp] theorem Function.Embedding.sumSet_preimage_inl (h : Disjoint s t) :
    .inl ⁻¹' (Function.Embedding.sumSet h ⁻¹' r) = r ∩ s

{α : Type u_1}
{s t r : Set α}
(h : Disjoint s t)

↑(Sum.inl ⁻¹' (⇑(Function.Embedding.sumSet h) ⁻¹' r)) = r ∩ s


theorem _root_.MeasureTheory.Integrable.comp_snd_map_prod_id [NormedAddCommGroup F] (hm : m ≤ mΩ)
    (hf : Integrable f μ) : Integrable (fun x : Ω × Ω => f x.2)
      (@Measure.map Ω (Ω × Ω) (m.prod mΩ) mΩ (fun ω => (id ω, id ω)) μ)

{Ω : Type u_1}
{F : Type u_2}
{m mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{f : Ω → F}
[NormedAddCommGroup F]
(hm : m ≤ mΩ)
(hf : MeasureTheory.Integrable f μ)

MeasureTheory.Integrable (fun x => f x.2) (MeasureTheory.Measure.map (fun ω => (id ω, id ω)) μ)


theorem nonPrincipals_eq_empty_iff : nonPrincipals R = ∅ ↔ IsPrincipalIdealRing R


@[simp]
theorem cancel_right {f₁ f₂ : β →+*o γ} {g : α →+*o β} (hg : Surjective g) :
    f₁.comp g = f₂.comp g ↔ f₁ = f₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[NonAssocSemiring α]
[Preorder α]
[NonAssocSemiring β]
[Preorder β]
[NonAssocSemiring γ]
[Preorder γ]
{f₁ f₂ : β →+*o γ}
{g : α →+*o β}
(hg : Function.Surjective ⇑g)


/-- A product over an index type with exactly one term is just the object over that term. -/
@[simps!]
def productUniqueIso : ∏ᶜ f ≅ f default

{β : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
[Unique β]
(f : β → C)

(CategoryTheory.Limits.productUniqueIso f).inv =
  CategoryTheory.Limits.limit.lift (CategoryTheory.Discrete.functor f) (CategoryTheory.Limits.limitConeOfUnique f).cone


@[to_additive]
theorem smul_opposite_image_mul_preimage {H : Subgroup G} (g : G) (h : H.op) (s : Set G) :
    (fun y => h • y) '' ((g * ·) ⁻¹' s) = (g * ·) ⁻¹' ((fun y => h • y) '' s)

{G : Type u_2}
[Group G]
{H : Subgroup G}
(g : G)
(h : ↥H.op)
(s : Set G)

(fun y => h • y) '' ((fun x => g * x) ⁻¹' s) = (fun x => g * x) ⁻¹' ((fun y => h • y) '' s)


theorem UInt64.toNat_lt (x : UInt64) : x.toNat < 2 ^ 64


@[simp]
theorem snd_mk (r : R) (m : M) : snd (r, m) = m

{R : Type u}
{M : Type v}
(r : R)
(m : M)


/-- An adjunction `adj : G ⊣ F` with `F : D ⥤ E` and `G : E ⥤ D` induces an adjunction
between `Sheaf J D` and `Sheaf J E`, in contexts where one can sheafify `D`-valued presheaves,
and `F` preserves the correct limits. -/
@[simps! unit_app_val counit_app_val]
def adjunction [HasSheafCompose J F] (adj : G ⊣ F) :
    composeAndSheafify J G ⊣ sheafCompose J F

(J : CategoryTheory.GrothendieckTopology C)

((CategoryTheory.Sheaf.adjunction J adj).unit.app X).val =
  ((CategoryTheory.Adjunction.whiskerRight Cᵒᵖ adj).homEquiv X.val
      ((CategoryTheory.presheafToSheaf J D).obj (X.val.comp G)).val)
    (CategoryTheory.toSheafify J (X.val.comp G))


/-- Auxiliary definition: the universal morphism to the proposed limit cone. -/
@[simps]
def limitConeLift (F : J ⥤ Cat.{v, v}) (s : Cone F) : s.pt ⟶ limitConeX F

(F : CategoryTheory.Functor J CategoryTheory.Cat)

∀ {X Y : ↑s.pt} (f : X ⟶ Y),
  (CategoryTheory.Cat.HasLimits.limitConeLift F s).map f =
    CategoryTheory.Limits.Types.Limit.mk
      (CategoryTheory.Cat.HasLimits.homDiagram
        (CategoryTheory.Limits.limit.lift (F.comp CategoryTheory.Cat.objects)
          { pt := ↑s.pt, π := { app := fun j => (s.π.app j).obj, naturality := ⋯ } } X)
        (CategoryTheory.Limits.limit.lift (F.comp CategoryTheory.Cat.objects)
          { pt := ↑s.pt, π := { app := fun j => (s.π.app j).obj, naturality := ⋯ } } Y))
      (fun j =>
        CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
          (CategoryTheory.CategoryStruct.comp ((s.π.app j).map f) (CategoryTheory.eqToHom ⋯)))
      ⋯


@[simp] theorem bne_false : ∀(b : Bool), (b != false) =  b