Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 24013e2

Browse files
committed
feat(data/finsupp/basic): add finsupp.single_left_injective and docstrings (#7207)
1 parent 0688612 commit 24013e2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/data/finsupp/basic.lean

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ by rcases em (a = x) with (rfl|hx); [simp, simp [single_eq_of_ne hx]]
242242
lemma range_single_subset : set.range (single a b) ⊆ {0, b} :=
243243
set.range_subset_iff.2 single_apply_mem
244244

245+
/-- `finsupp.single a b` is injective in `b`. For the statement that it is injective in `a`, see
246+
`finsupp.single_left_injective` -/
245247
lemma single_injective (a : α) : function.injective (single a : M → α →₀ M) :=
246248
assume b₁ b₂ eq,
247249
have (single a b₁ : α →₀ M) a = (single a b₂ : α →₀ M) a, by rw eq,
@@ -281,11 +283,13 @@ begin
281283
{ rw [single_zero, single_zero] } }
282284
end
283285

284-
lemma single_left_inj (h : b ≠ 0) :
285-
single a b = single a' b ↔ a = a' :=
286-
⟨λ H, by simpa only [h, single_eq_single_iff,
287-
and_false, or_false, eq_self_iff_true, and_true] using H,
288-
λ H, by rw [H]⟩
286+
/-- `finsupp.single a b` is injective in `a`. For the statement that it is injective in `b`, see
287+
`finsupp.single_injective` -/
288+
lemma single_left_injective (h : b ≠ 0) : function.injective (λ a : α, single a b) :=
289+
λ a a' H, (((single_eq_single_iff _ _ _ _).mp H).resolve_right $ λ hb, h hb.1).left
290+
291+
lemma single_left_inj (h : b ≠ 0) : single a b = single a' b ↔ a = a' :=
292+
(single_left_injective h).eq_iff
289293

290294
lemma support_single_ne_bot (i : α) (h : b ≠ 0) :
291295
(single i b).support ≠ ⊥ :=

0 commit comments

Comments
 (0)