Skip to content

Commit

Permalink
refactor(data/finsupp): use {f : α →₀ M | ∃ a b, f = single a b} in…
Browse files Browse the repository at this point in the history
…stead of union of ranges (#10671)
  • Loading branch information
urkud committed Dec 8, 2021
1 parent 8ab1b3b commit 2ce95ca
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/data/finsupp/basic.lean
Expand Up @@ -904,21 +904,20 @@ lemma induction_linear {p : (α →₀ M) → Prop} (f : α →₀ M)
p f :=
induction₂ f h0 (λ a b f _ _ w, hadd _ _ w (hsingle _ _))

@[simp] lemma add_closure_Union_range_single :
add_submonoid.closure (⋃ a : α, set.range (single a : M → α →₀ M)) = ⊤ :=
@[simp] lemma add_closure_set_of_eq_single :
add_submonoid.closure {f : α →₀ M | ∃ a b, f = single a b} = ⊤ :=
top_unique $ λ x hx, finsupp.induction x (add_submonoid.zero_mem _) $
λ a b f ha hb hf, add_submonoid.add_mem _
(add_submonoid.subset_closure $ set.mem_Union.2 ⟨a, set.mem_range_self _⟩) hf
(add_submonoid.subset_closure $ ⟨a, b, rfl⟩) hf

/-- If two additive homomorphisms from `α →₀ M` are equal on each `single a b`, then
they are equal. -/
lemma add_hom_ext [add_zero_class N] ⦃f g : (α →₀ M) →+ N⦄
(H : ∀ x y, f (single x y) = g (single x y)) :
f = g :=
begin
refine add_monoid_hom.eq_of_eq_on_mdense add_closure_Union_range_single (λ f hf, _),
simp only [set.mem_Union, set.mem_range] at hf,
rcases hf with ⟨x, y, rfl⟩,
refine add_monoid_hom.eq_of_eq_on_mdense add_closure_set_of_eq_single _,
rintro _ ⟨x, y, rfl⟩,
apply H
end

Expand Down

0 comments on commit 2ce95ca

Please sign in to comment.