Skip to content

Commit

Permalink
chore(data/finsupp/defs): move lemmas out of the single section which…
Browse files Browse the repository at this point in the history
… are not about single (#18260)
  • Loading branch information
eric-wieser committed Jan 23, 2023
1 parent 327c3c0 commit 33694ff
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/data/finsupp/defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ If `α` has a unique term, the type of finitely supported functions `α →₀
def _root_.equiv.finsupp_unique {ι : Type*} [unique ι] : (ι →₀ M) ≃ M :=
finsupp.equiv_fun_on_finite.trans (equiv.fun_unique ι M)

@[ext]
lemma unique_ext [unique α] {f g : α →₀ M} (h : f default = g default) : f = g :=
ext $ λ a, by rwa [unique.eq_default a]

lemma unique_ext_iff [unique α] {f g : α →₀ M} : f = g ↔ f default = g default :=
⟨λ h, h ▸ rfl, unique_ext⟩

end basic

/-! ### Declarations about `single` -/
Expand Down Expand Up @@ -339,13 +346,6 @@ end
lemma unique_single [unique α] (x : α →₀ M) : x = single default (x default) :=
ext $ unique.forall_iff.2 single_eq_same.symm

@[ext]
lemma unique_ext [unique α] {f g : α →₀ M} (h : f default = g default) : f = g :=
ext $ λ a, by rwa [unique.eq_default a]

lemma unique_ext_iff [unique α] {f g : α →₀ M} : f = g ↔ f default = g default :=
⟨λ h, h ▸ rfl, unique_ext⟩

@[simp] lemma unique_single_eq_iff [unique α] {b' : M} :
single a b = single a' b' ↔ b = b' :=
by rw [unique_ext_iff, unique.eq_default a, unique.eq_default a', single_eq_same, single_eq_same]
Expand Down

0 comments on commit 33694ff

Please sign in to comment.