This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 297
[Merged by Bors] - feat(set_theory/surreal/dyadic): define add_monoid_hom structure on dyadic map #11052
Closed
Closed
[Merged by Bors] - feat(set_theory/surreal/dyadic): define add_monoid_hom structure on dyadic map #11052
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e44d7c5
Add pow_mk and log_mul.
apurvnakade 863549f
Upgrade dyadic_map to add_monoid_hom.
apurvnakade b4ddbf7
Review suggestions.
apurvnakade afd1d30
Update TODOs.
apurvnakade 05c4b1f
Review suggestions.
apurvnakade 1beaaa4
Add lift_on_zero lemma.
apurvnakade d4c22ee
Rewrite using lift_on_zero.
apurvnakade 635709e
Add dyadic_map_apply
apurvnakade c2ddc70
dyadic_map_apply_pow
apurvnakade d7aa25c
Add [simp].
apurvnakade 49604f9
Fix simp normal form.
apurvnakade File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. | |
Authors: Apurva Nakade | ||
-/ | ||
import algebra.algebra.basic | ||
import group_theory.monoid_localization | ||
import ring_theory.localization | ||
import set_theory.surreal.basic | ||
|
||
/-! | ||
|
@@ -178,33 +178,60 @@ begin | |
linarith }, | ||
end | ||
|
||
/-- The map `dyadic_map` sends ⟦⟨m, 2^n⟩⟧ to m • half ^ n. -/ | ||
def dyadic_map (x : localization (submonoid.powers (2 : ℤ))) : surreal := | ||
localization.lift_on x (λ x y, x • pow_half (submonoid.log y)) $ | ||
begin | ||
intros m₁ m₂ n₁ n₂ h₁, | ||
obtain ⟨⟨n₃, y₃, hn₃⟩, h₂⟩ := localization.r_iff_exists.mp h₁, | ||
simp only [subtype.coe_mk, mul_eq_mul_right_iff] at h₂, | ||
cases h₂, | ||
{ simp only, | ||
obtain ⟨a₁, ha₁⟩ := n₁.prop, | ||
obtain ⟨a₂, ha₂⟩ := n₂.prop, | ||
have hn₁ : n₁ = submonoid.pow 2 a₁ := subtype.ext ha₁.symm, | ||
have hn₂ : n₂ = submonoid.pow 2 a₂ := subtype.ext ha₂.symm, | ||
have h₂ : 1 < (2 : ℤ).nat_abs, from dec_trivial, | ||
rw [hn₁, hn₂, submonoid.log_pow_int_eq_self h₂, submonoid.log_pow_int_eq_self h₂], | ||
apply dyadic_aux, | ||
rwa [ha₁, ha₂] }, | ||
{ have := nat.one_le_pow y₃ 2 nat.succ_pos', | ||
linarith } | ||
end | ||
/-- The additive monoid morphism `dyadic_map` sends ⟦⟨m, 2^n⟩⟧ to m • half ^ n. -/ | ||
apurvnakade marked this conversation as resolved.
Show resolved
Hide resolved
|
||
def dyadic_map : localization.away (2 : ℤ) →+ surreal := | ||
{ to_fun := | ||
λ x, localization.lift_on x (λ x y, x • pow_half (submonoid.log y)) $ | ||
begin | ||
intros m₁ m₂ n₁ n₂ h₁, | ||
obtain ⟨⟨n₃, y₃, hn₃⟩, h₂⟩ := localization.r_iff_exists.mp h₁, | ||
simp only [subtype.coe_mk, mul_eq_mul_right_iff] at h₂, | ||
cases h₂, | ||
{ simp only, | ||
obtain ⟨a₁, ha₁⟩ := n₁.prop, | ||
obtain ⟨a₂, ha₂⟩ := n₂.prop, | ||
have hn₁ : n₁ = submonoid.pow 2 a₁ := subtype.ext ha₁.symm, | ||
have hn₂ : n₂ = submonoid.pow 2 a₂ := subtype.ext ha₂.symm, | ||
have h₂ : 1 < (2 : ℤ).nat_abs, from one_lt_two, | ||
rw [hn₁, hn₂, submonoid.log_pow_int_eq_self h₂, submonoid.log_pow_int_eq_self h₂], | ||
apply dyadic_aux, | ||
rwa [ha₁, ha₂] }, | ||
{ have := nat.one_le_pow y₃ 2 nat.succ_pos', | ||
linarith } | ||
end, | ||
map_zero' := localization.lift_on_zero _ _, | ||
map_add' := λ x y, localization.induction_on₂ x y $ | ||
begin | ||
rintro ⟨a, ⟨b, ⟨b', rfl⟩⟩⟩ ⟨c, ⟨d, ⟨d', rfl⟩⟩⟩, | ||
have h₂ : 1 < (2 : ℤ).nat_abs, from one_lt_two, | ||
have hpow₂ := submonoid.log_pow_int_eq_self h₂, | ||
simp_rw submonoid.pow_apply at hpow₂, | ||
simp_rw [localization.add_mk, localization.lift_on_mk, subtype.coe_mk, | ||
submonoid.log_mul (int.pow_right_injective h₂), hpow₂], | ||
calc (2 ^ b' * c + 2 ^ d' * a) • pow_half (b' + d') | ||
= (c * 2 ^ b') • pow_half (b' + d') + (a * 2 ^ d') • pow_half (d' + b') | ||
: by simp only [add_smul, mul_comm,add_comm] | ||
... = c • pow_half d' + a • pow_half b' : by simp only [zsmul_pow_two_pow_half] | ||
... = a • pow_half b' + c • pow_half d' : add_comm _ _, | ||
end } | ||
|
||
lemma dyadic_map_apply (m : ℤ) (p : submonoid.powers (2 : ℤ)) : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I added it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It needed converting into simp normal form. @[simp] lemma dyadic_map_apply (m : ℤ) (p : submonoid.powers (2 : ℤ)) :
dyadic_map (is_localization.mk' (localization (submonoid.powers 2)) m p) =
m • pow_half (submonoid.log p) |
||
dyadic_map (localization.mk m p) = m • pow_half (submonoid.log p) := rfl | ||
|
||
lemma dyadic_map_apply' (m : ℤ) (n : ℕ) : | ||
apurvnakade marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dyadic_map (localization.mk m (submonoid.pow 2 n)) = m • pow_half n := | ||
by rw [dyadic_map_apply, @submonoid.log_pow_int_eq_self 2 one_lt_two] | ||
|
||
lemma dyadic_map_apply'' (m : ℤ) (n : ℕ) : | ||
apurvnakade marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dyadic_map (localization.mk m ⟨2 ^ n, n, rfl⟩) = m • pow_half n := | ||
by rw [← submonoid.pow_apply, dyadic_map_apply'] | ||
|
||
/-- We define dyadic surreals as the range of the map `dyadic_map`. -/ | ||
def dyadic : set surreal := set.range dyadic_map | ||
|
||
-- We conclude with some ideas for further work on surreals; these would make fun projects. | ||
|
||
-- TODO show that the map from dyadic rationals to surreals is a group homomorphism, and injective | ||
-- TODO show that the map from dyadic rationals to surreals is injective | ||
|
||
-- TODO map the reals into the surreals, using dyadic Dedekind cuts | ||
-- TODO show this is a group homomorphism, and injective | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have
simp
lemmas that proveh
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
bors d+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
h
isn't always true though. The closest we have areint.pow_right_injective
andnat.pow_right_injective
.