Skip to content

Commit

Permalink
feat(algebra/algebra/subalgebra): subalgebra.subsingleton (#4631)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcommelin committed Oct 17, 2020
1 parent 688157f commit 82ff1e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/algebra/algebra/subalgebra.lean
Expand Up @@ -376,6 +376,7 @@ bot_equiv_of_injective (ring_hom.injective _)
end algebra

namespace subalgebra
open algebra

variables {R : Type u} {A : Type v}
variables [comm_semiring R] [semiring A] [algebra R A]
Expand All @@ -384,6 +385,15 @@ variables (S : subalgebra R A)
lemma range_val : S.val.range = S :=
ext $ set.ext_iff.1 $ S.val.coe_range.trans subtype.range_val

instance : unique (subalgebra R R) :=
{ uniq :=
begin
intro S,
refine le_antisymm (λ r hr, _) bot_le,
simp only [set.mem_range, coe_bot, id.map_eq_self, exists_apply_eq_apply, default],
end
.. algebra.inhabited }

end subalgebra

section nat
Expand Down
6 changes: 5 additions & 1 deletion src/order/bounded_lattice.lean
Expand Up @@ -392,9 +392,13 @@ lemma eq_top_of_bot_eq_top {α : Type*} [bounded_lattice α] (hα : (⊥ : α) =
x = (⊤ : α) :=
eq_top_mono bot_le hα

lemma subsingleton_of_top_le_bot {α : Type*} [bounded_lattice α] (h : (⊤ : α) ≤ (⊥ : α)) :
subsingleton α :=
⟨λ a b, le_antisymm (le_trans le_top $ le_trans h bot_le) (le_trans le_top $ le_trans h bot_le)⟩

lemma subsingleton_of_bot_eq_top {α : Type*} [bounded_lattice α] (hα : (⊥ : α) = (⊤ : α)) :
subsingleton α :=
⟨λ a b, by rw [eq_bot_of_bot_eq_top hα a, eq_bot_of_bot_eq_top hα b]⟩
subsingleton_of_top_le_bot (ge_of_eq hα)

/-- Attach `⊥` to a type. -/
def with_bot (α : Type*) := option α
Expand Down

0 comments on commit 82ff1e5

Please sign in to comment.