Skip to content

Commit

Permalink
feat(*): trivial lemmas from #8903 (#8909)
Browse files Browse the repository at this point in the history
  • Loading branch information
urkud committed Sep 7, 2021
1 parent 5b29630 commit 298f231
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/algebra/module/pi.lean
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ lemma single_smul {α} [monoid α] [Π i, add_monoid $ f i]
single i (r • x) = r • single i x :=
single_op (λ i : I, ((•) r : f i → f i)) (λ j, smul_zero _) _ _

/-- A version of `pi.single_smul` for non-dependent functions. It is useful in cases Lean fails
to apply `pi.single_smul`. -/
lemma single_smul'' {α β} [monoid α] [add_monoid β]
[distrib_mul_action α β] [decidable_eq I] (i : I) (r : α) (x : β) :
single i (r • x) = r • single i x :=
single_smul i r x

lemma single_smul' {g : I → Type*} [Π i, monoid_with_zero (f i)] [Π i, add_monoid (g i)]
[Π i, distrib_mul_action (f i) (g i)] [decidable_eq I] (i : I) (r : f i) (x : g i) :
single i (r • x) = single i r • single i x :=
Expand Down
2 changes: 2 additions & 0 deletions src/analysis/normed_space/operator_norm.lean
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,8 @@ def lsmul : 𝕜' →L[𝕜] E →L[𝕜] E :=
((algebra.lsmul 𝕜 E).to_linear_map : 𝕜' →ₗ[𝕜] E →ₗ[𝕜] E).mk_continuous₂ 1 $
λ c x, by simpa only [one_mul] using (norm_smul c x).le

@[simp] lemma lsmul_apply (c : 𝕜') (x : E) : lsmul 𝕜 𝕜' c x = c • x := rfl

end smul_linear

section restrict_scalars
Expand Down
3 changes: 3 additions & 0 deletions src/data/part.lean
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ theorem mem.left_unique : relator.left_unique ((∈) : α → part α → Prop)
theorem get_eq_of_mem {o : part α} {a} (h : a ∈ o) (h') : get o h' = a :=
mem_unique ⟨_, rfl⟩ h

protected theorem subsingleton (o : part α) : set.subsingleton {a | a ∈ o} :=
λ a ha b hb, mem_unique ha hb

@[simp] theorem get_some {a : α} (ha : (some a).dom) : get (some a) ha = a := rfl

theorem mem_some (a : α) : a ∈ some a := ⟨trivial, rfl⟩
Expand Down
6 changes: 6 additions & 0 deletions src/data/subtype.lean
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ protected theorem forall' {q : ∀ x, p x → Prop} :
(∃ x, q x) ↔ (∃ a b, q ⟨a, b⟩) :=
⟨assume ⟨⟨a, b⟩, h⟩, ⟨a, b, h⟩, assume ⟨a, b, h⟩, ⟨⟨a, b⟩, h⟩⟩

/-- An alternative version of `subtype.exists`. This one is useful if Lean cannot figure out `q`
when using `subtype.exists` from right to left. -/
protected theorem exists' {q : ∀x, p x → Prop} :
(∃ x h, q x h) ↔ (∃ x : {a // p a}, q x x.2) :=
(@subtype.exists _ _ (λ x, q x.1 x.2)).symm

@[ext] protected lemma ext : ∀ {a1 a2 : {x // p x}}, (a1 : α) = (a2 : α) → a1 = a2
| ⟨x, h1⟩ ⟨.(x), h2⟩ rfl := rfl

Expand Down
2 changes: 2 additions & 0 deletions src/order/bounded_lattice.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,8 @@ by rw [disjoint, disjoint, inf_comm]
@[symm] theorem disjoint.symm ⦃a b : α⦄ : disjoint a b → disjoint b a :=
disjoint.comm.1

lemma symmetric_disjoint : symmetric (disjoint : α → α → Prop) := disjoint.symm

@[simp] theorem disjoint_bot_left {a : α} : disjoint ⊥ a := inf_le_left
@[simp] theorem disjoint_bot_right {a : α} : disjoint a ⊥ := inf_le_right

Expand Down
4 changes: 4 additions & 0 deletions src/order/filter/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2254,6 +2254,10 @@ lemma tendsto.sup {f : α → β} {x₁ x₂ : filter α} {y : filter β} :
tendsto f x₁ y → tendsto f x₂ y → tendsto f (x₁ ⊔ x₂) y :=
λ h₁ h₂, tendsto_sup.mpr ⟨ h₁, h₂ ⟩

@[simp] lemma tendsto_supr {f : α → β} {x : ι → filter α} {y : filter β} :
tendsto f (⨆ i, x i) y ↔ ∀ i, tendsto f (x i) y :=
by simp only [tendsto, map_supr, supr_le_iff]

@[simp] lemma tendsto_principal {f : α → β} {l : filter α} {s : set β} :
tendsto f l (𝓟 s) ↔ ∀ᶠ a in l, f a ∈ s :=
by simp only [tendsto, le_principal_iff, mem_map', filter.eventually]
Expand Down
7 changes: 7 additions & 0 deletions src/topology/algebra/monoid.lean
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ instance pi.has_continuous_mul {C : ι → Type*} [∀ i, topological_space (C i
{ continuous_mul := continuous_pi (λ i, continuous.mul
((continuous_apply i).comp continuous_fst) ((continuous_apply i).comp continuous_snd)) }

/-- A version of `pi.has_continuous_mul` for non-dependent functions. It is needed because sometimes
Lean fails to use `pi.has_continuous_mul` for non-dependent functions. -/
@[to_additive "A version of `pi.has_continuous_add` for non-dependent functions. It is needed
because sometimes Lean fails to use `pi.has_continuous_add` for non-dependent functions."]
instance pi.has_continuous_mul' : has_continuous_mul (ι → M) :=
pi.has_continuous_mul

@[priority 100, to_additive]
instance has_continuous_mul_of_discrete_topology [topological_space N]
[has_mul N] [discrete_topology N] : has_continuous_mul N :=
Expand Down

0 comments on commit 298f231

Please sign in to comment.