Created
October 13, 2021 06:03
-
-
Save Timeroot/65e4e8a5b7a4216251f425c0e1cd1da1 to your computer and use it in GitHub Desktop.
Minimal example for struggling to show that some object mappings are inverses.
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
import algebra.group_with_zero | |
import data.equiv.mul_add | |
universe u | |
variables {S : Type*} | |
--We're going to show the 1-to-1 correspondence between groups (with additive notation) | |
--and groups_with_zero (with multiplicative notation). To make the mapping less trivial, | |
--we'll also use the opposite group: so a+b becomes b*a. | |
--First define how we multiply (with zero) from elements in an additive group. | |
--The operation: | |
def g₀_add_op [add_group S]: option S → option S → option S | |
| none _ := none | |
| _ none := none | |
| (some a) (some b) := some (b+a) | |
--The actual map: | |
def convert_g_into_g₀_op (g : add_group S) : group_with_zero (option S) := { | |
mul := g₀_add_op, | |
inv := begin intro a, cases a, exact none, exact some (-a) end, | |
zero := none, | |
one := some 0, | |
mul_assoc := begin intros, cases a; cases b; cases c; simp [g₀_add_op], exact (add_assoc c b a).symm end, | |
one_mul := begin intro, cases a; simp [g₀_add_op] end, | |
mul_one := begin intro, cases a; simp [g₀_add_op] end, | |
zero_mul := begin intro, cases a; simp [g₀_add_op] end, | |
mul_zero := begin intro, cases a; simp [g₀_add_op] end, | |
exists_pair_ne := ⟨none, some 0, by simp⟩, | |
inv_zero := sorry, mul_inv_cancel := sorry | |
} | |
--Then the map from a group with zero back to an additive group defined on the units: | |
def convert_g₀_into_g_op (g0 : group_with_zero S) : add_group (units S) := { | |
add := λ a b, b*a, | |
neg := λ a, a⁻¹, | |
zero := 1, | |
add_assoc := begin intros, simp, exact (mul_assoc c b a).symm end, | |
zero_add := by simp, | |
add_zero := by simp, | |
add_left_neg := sorry | |
} | |
--The syntax below is what's wrong and where I'm stuck. | |
--I want to show that convert_g_into_g₀_op and convert_g₀_into_g_op are inverses, | |
--in the sense that | |
-- convert_g_into_g₀_op (convert_g₀_into_g_op G) ≃* G | |
--for any group_with_zero G, and that | |
-- convert_g₀_into_g_op (convert_g_into_g₀_op G) ≃+ G | |
--for any add_group G. | |
def group_gzero_iso [g : add_group S]: convert_g₀_into_g_op (convert_g_into_g₀_op g) ≃+ g := | |
begin | |
sorry | |
end | |
def gzero_group_iso [g0 : group_with_zero S]: convert_g_into_g₀_op (convert_g₀_into_g_op g0) ≃* g0 := | |
begin | |
sorry | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found a good solution! Add
and then one can just write
with the extra apostrophe in
≃+'
. The "child" lets it accept thegroup S
, but then infer thehas_mul S
structure from that group, and turn that into amul_equiv
with no apostrophe.