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

Commit b35ed40

Browse files
committed
feat(algebra/order/hom/ring): There's at most one hom between linear ordered fields (#13601)
There is at most one ring homomorphism from a linear ordered field to an archimedean linear ordered field. Also generalize `map_rat_cast` to take in `ring_hom_class`. Co-authored-by: Alex J. Best <alex.j.best@gmail.com>
1 parent d795ea4 commit b35ed40

File tree

6 files changed

+64
-11
lines changed

6 files changed

+64
-11
lines changed

src/algebra/order/hom/ring.lean

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Copyright (c) 2022 Alex J. Best, Yaël Dillies. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Alex J. Best, Yaël Dillies
55
-/
6+
import algebra.order.archimedean
67
import algebra.order.hom.monoid
78
import algebra.order.ring
89
import algebra.ring.equiv
@@ -277,6 +278,10 @@ ext e.left_inv
277278
@[simp] lemma symm_trans_self (e : α ≃+*o β) : e.symm.trans e = order_ring_iso.refl β :=
278279
ext e.right_inv
279280

281+
lemma symm_bijective : bijective (order_ring_iso.symm : (α ≃+*o β) → β ≃+*o α) :=
282+
⟨λ f g h, f.symm_symm.symm.trans $ (congr_arg order_ring_iso.symm h).trans g.symm_symm,
283+
λ f, ⟨f.symm, f.symm_symm⟩⟩
284+
280285
end has_le
281286

282287
section non_assoc_semiring
@@ -294,5 +299,54 @@ def to_order_ring_hom (f : α ≃+*o β) : α →+*o β :=
294299
@[simp]
295300
lemma coe_to_order_ring_hom_refl : (order_ring_iso.refl α : α →+*o α) = order_ring_hom.id α := rfl
296301

302+
lemma to_order_ring_hom_injective : injective (to_order_ring_hom : (α ≃+*o β) → α →+*o β) :=
303+
λ f g h, fun_like.coe_injective $ by convert fun_like.ext'_iff.1 h
304+
297305
end non_assoc_semiring
298306
end order_ring_iso
307+
308+
/-!
309+
### Uniqueness
310+
311+
There is at most one ordered ring homomorphism from a linear ordered field to an archimedean linear
312+
ordered field. Reciprocally, such an ordered ring homomorphism exists when the codomain is further
313+
conditionally complete.
314+
-/
315+
316+
/-- There is at most one ordered ring homomorphism from a linear ordered field to an archimedean
317+
linear ordered field. -/
318+
-- TODO[gh-6025]: make this an instance once safe to do so
319+
lemma order_ring_hom.subsingleton [linear_ordered_field α] [linear_ordered_field β]
320+
[archimedean β] :
321+
subsingleton (α →+*o β) :=
322+
⟨λ f g, begin
323+
ext x,
324+
by_contra' h,
325+
wlog h : f x < g x using [f g, g f],
326+
{ exact ne.lt_or_lt h },
327+
obtain ⟨q, hf, hg⟩ := exists_rat_btwn h,
328+
rw ←map_rat_cast f at hf,
329+
rw ←map_rat_cast g at hg,
330+
exact (lt_asymm ((order_hom_class.mono g).reflect_lt hg) $
331+
(order_hom_class.mono f).reflect_lt hf).elim,
332+
end
333+
334+
local attribute [instance] order_ring_hom.subsingleton
335+
336+
/-- There is at most one ordered ring isomorphism between a linear ordered field and an archimedean
337+
linear ordered field. -/
338+
-- TODO[gh-6025]: make this an instance once safe to do so
339+
lemma order_ring_iso.subsingleton_right [linear_ordered_field α] [linear_ordered_field β]
340+
[archimedean β] :
341+
subsingleton (α ≃+*o β) :=
342+
order_ring_iso.to_order_ring_hom_injective.subsingleton
343+
344+
local attribute [instance] order_ring_iso.subsingleton_right
345+
346+
/-- There is at most one ordered ring isomorphism between an archimedean linear ordered field and a
347+
linear ordered field. -/
348+
-- TODO[gh-6025]: make this an instance once safe to do so
349+
lemma order_ring_iso.subsingleton_left [linear_ordered_field α] [archimedean α]
350+
[linear_ordered_field β] :
351+
subsingleton (α ≃+*o β) :=
352+
order_ring_iso.symm_bijective.injective.subsingleton

src/algebra/star/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def star_ring_equiv [non_unital_semiring R] [star_ring R] : R ≃+* Rᵐᵒᵖ :
264264

265265
@[simp, norm_cast] lemma star_rat_cast [division_ring R] [char_zero R] [star_ring R] (r : ℚ) :
266266
star (r : R) = r :=
267-
(congr_arg unop ((star_ring_equiv : R ≃+* Rᵐᵒᵖ).to_ring_hom.map_rat_cast r)).trans (unop_rat_cast _)
267+
(congr_arg unop $ map_rat_cast (star_ring_equiv : R ≃+* Rᵐᵒᵖ) r).trans (unop_rat_cast _)
268268

269269
/-- `star` as a ring automorphism, for commutative `R`. -/
270270
@[simps apply]

src/data/complex/basic.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,7 @@ by rw [← of_real_int_cast, of_real_re]
400400
@[simp, norm_cast] lemma int_cast_im (n : ℤ) : (n : ℂ).im = 0 :=
401401
by rw [← of_real_int_cast, of_real_im]
402402

403-
@[simp, norm_cast] theorem of_real_rat_cast (n : ℚ) : ((n : ℝ) : ℂ) = n :=
404-
of_real.map_rat_cast n
403+
@[simp, norm_cast] theorem of_real_rat_cast (n : ℚ) : ((n : ℝ) : ℂ) = n := map_rat_cast of_real n
405404

406405
@[simp, norm_cast] lemma rat_cast_re (q : ℚ) : (q : ℂ).re = q :=
407406
by rw [← of_real_rat_cast, of_real_re]

src/data/complex/is_R_or_C.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ by rw [← of_real_int_cast, of_real_im]
442442

443443
@[simp, is_R_or_C_simps, norm_cast, priority 900] theorem of_real_rat_cast (n : ℚ) :
444444
((n : ℝ) : K) = n :=
445-
(@is_R_or_C.of_real_hom K _).map_rat_cast n
445+
map_rat_cast (@is_R_or_C.of_real_hom K _) n
446446

447447
@[simp, is_R_or_C_simps, norm_cast] lemma rat_cast_re (q : ℚ) : re (q : K) = q :=
448448
by rw [← of_real_rat_cast, of_real_re]

src/data/rat/cast.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ casting lemmas showing the well-behavedness of this injection.
2424
rat, rationals, field, ℚ, numerator, denominator, num, denom, cast, coercion, casting
2525
-/
2626

27+
variables {F α β : Type*}
28+
2729
namespace rat
28-
variable {α : Type*}
2930
open_locale rat
3031

3132
section with_div_ring
@@ -271,10 +272,9 @@ calc f r = f (r.1 / r.2) : by rw [← int.cast_coe_nat, ← mk_eq_div, num_denom
271272

272273
-- This seems to be true for a `[char_p k]` too because `k'` must have the same characteristic
273274
-- but the proof would be much longer
274-
lemma ring_hom.map_rat_cast {k k'} [division_ring k] [char_zero k] [division_ring k']
275-
(f : k →+* k') (r : ℚ) :
276-
f r = r :=
277-
(f.comp (cast_hom k)).eq_rat_cast r
275+
@[simp] lemma map_rat_cast [division_ring α] [division_ring β] [char_zero α] [ring_hom_class F α β]
276+
(f : F) (q : ℚ) : f q = q :=
277+
((f : α →+* β).comp $ cast_hom α).eq_rat_cast q
278278

279279
lemma ring_hom.ext_rat {R : Type*} [semiring R] (f g : ℚ →+* R) : f = g :=
280280
begin
@@ -325,7 +325,7 @@ end monoid_with_zero_hom
325325

326326
namespace mul_opposite
327327

328-
variables {α : Type*} [division_ring α]
328+
variables [division_ring α]
329329

330330
@[simp, norm_cast] lemma op_rat_cast (r : ℚ) : op (r : α) = (↑r : αᵐᵒᵖ) :=
331331
by rw [cast_def, div_eq_mul_inv, op_mul, op_inv, op_nat_cast, op_int_cast,

src/ring_theory/algebraic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ by { rw ←ring_hom.map_int_cast (algebra_map R A), exact is_algebraic_algebra_m
101101

102102
lemma is_algebraic_rat (R : Type u) {A : Type v} [division_ring A] [field R] [char_zero R]
103103
[algebra R A] (n : ℚ) : is_algebraic R (n : A) :=
104-
by { rw ←ring_hom.map_rat_cast (algebra_map R A), exact is_algebraic_algebra_map n }
104+
by { rw ←map_rat_cast (algebra_map R A), exact is_algebraic_algebra_map n }
105105

106106
lemma is_algebraic_algebra_map_of_is_algebraic {a : S} :
107107
is_algebraic R a → is_algebraic R (algebra_map S A a) :=

0 commit comments

Comments
 (0)